@synnaxlabs/pluto 0.44.3 → 0.44.5
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-BDoJWl9g.cjs +1 -0
- package/dist/{Animated-BHxq6Pmm.js → Animated-fI-NFaha.js} +2 -2
- package/dist/{symbols-aLnytgtc.js → Editable-C1g_CFYk.js} +5898 -5888
- package/dist/{symbols-DWZqHjhU.cjs → Editable-DUtJOqJ5.cjs} +41 -41
- package/dist/{LinePlot-BJ10hKs7.cjs → LinePlot-6cl8_hmn.cjs} +5 -5
- package/dist/{LinePlot-VIcFjuPQ.js → LinePlot-Ck0rhtFk.js} +712 -728
- package/dist/{Toggle-C--I90ch.js → Toggle-DEJ8Uvun.js} +1 -1
- package/dist/Toggle-DUKDeqpe.cjs +1 -0
- package/dist/{Video-DdsVXhnt.js → Video-B6tujjr8.js} +1 -1
- package/dist/{Video-BbRLzkdH.cjs → Video-BjRd9sFv.cjs} +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-DI0uCCGq.cjs +8 -0
- package/dist/{css-BKrX40Df.js → css-DvIPI3Qm.js} +1383 -1252
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/eraser-B03ej59l.cjs +63 -0
- package/dist/{eraser-DtXU7kOS.js → eraser-CnRJY__h.js} +4999 -4687
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +6 -6
- package/dist/{external-BT0nByPv.js → external-B3dPSZUg.js} +7 -8
- package/dist/external-BEd3F7zY.cjs +1 -0
- package/dist/external-BS9S-b49.cjs +1 -0
- package/dist/external-BVDQNHbo.cjs +1 -0
- package/dist/external-BenP6Hcm.cjs +1 -0
- package/dist/external-Blrrgnzw.cjs +1 -0
- package/dist/{external-tHxdTvxn.js → external-BzV_PGNe.js} +2 -2
- package/dist/{external-ONwuyKzG.js → external-C2iqWGd2.js} +22 -22
- package/dist/external-CAAPXpVr.cjs +1 -0
- package/dist/{external-n4gJTJfw.js → external-CKhbbig_.js} +15 -15
- package/dist/external-CNF5TNBY.cjs +1 -0
- package/dist/{external-Bt-WjDvD.js → external-D16M7vHB.js} +9 -9
- package/dist/{external-dkXc0y5z.js → external-D6hAP7eJ.js} +7 -7
- package/dist/external-D98a3YQJ.cjs +1 -0
- package/dist/external-DKh0JhWO.cjs +1 -0
- package/dist/external-DNO3FJLl.cjs +1 -0
- package/dist/{external-yddEc8os.cjs → external-DOEaBrpz.cjs} +2 -2
- package/dist/external-DRuZ24L7.js +78 -0
- package/dist/{external-CEMgElRx.js → external-Daage1AI.js} +10 -10
- package/dist/{external-BApQK7XP.js → external-Db9iKa8k.js} +3 -3
- package/dist/{external-BmfZaFKB.js → external-Dfr7xymv.js} +3 -3
- package/dist/external-DwRvB5ZT.cjs +1 -0
- package/dist/{external-NUi5IwGn.js → external-GR-20z_c.js} +14 -14
- package/dist/external-I_-aclFy.cjs +1 -0
- package/dist/{external-Dgui980d.js → external-R9a28aP6.js} +24 -24
- package/dist/{external-Dwfn2jsF.js → external-dew29Q0v.js} +9 -9
- package/dist/flex.cjs +1 -1
- package/dist/flex.js +1 -1
- package/dist/{fontString-D2-HUuI_.js → fontString-CW0wLG5g.js} +2 -2
- package/dist/{fontString-BWGnZU-8.cjs → fontString-aK--tYMM.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +6084 -5944
- 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/pluto.css +1 -1
- package/dist/src/channel/queries.d.ts.map +1 -1
- package/dist/src/flux/form.d.ts +39 -10
- package/dist/src/flux/form.d.ts.map +1 -1
- package/dist/src/flux/retrieve.d.ts +4 -2
- package/dist/src/flux/retrieve.d.ts.map +1 -1
- package/dist/src/flux/update.d.ts +13 -0
- package/dist/src/flux/update.d.ts.map +1 -1
- package/dist/src/form/Context.d.ts +6 -2
- package/dist/src/form/Context.d.ts.map +1 -1
- package/dist/src/form/state.d.ts +1 -0
- package/dist/src/form/state.d.ts.map +1 -1
- package/dist/src/form/use.d.ts.map +1 -1
- package/dist/src/hardware/device/queries.d.ts.map +1 -1
- package/dist/src/hardware/rack/queries.d.ts.map +1 -1
- package/dist/src/hardware/task/queries.d.ts +22 -1
- package/dist/src/hardware/task/queries.d.ts.map +1 -1
- package/dist/src/icon/registry.d.ts +1 -0
- package/dist/src/icon/registry.d.ts.map +1 -1
- package/dist/src/label/queries.d.ts.map +1 -1
- package/dist/src/mosaic/Mosaic.d.ts +1 -1
- package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
- package/dist/src/ontology/queries.d.ts.map +1 -1
- package/dist/src/ranger/queries.d.ts +3 -3
- package/dist/src/ranger/queries.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/use.d.ts +7 -4
- package/dist/src/select/use.d.ts.map +1 -1
- package/dist/src/showcase/TextShowcase.d.ts.map +1 -1
- package/dist/src/status/Summary.d.ts.map +1 -1
- package/dist/src/synnax/Provider.d.ts.map +1 -1
- package/dist/src/synnax/aether/provider.d.ts +6 -6
- package/dist/src/telem/aether/remote.d.ts +4 -4
- package/dist/src/telem/aether/transformers.d.ts +0 -2
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.spec.d.ts +2 -0
- package/dist/src/telem/aether/transformers.spec.d.ts.map +1 -0
- package/dist/src/text/external.d.ts +0 -1
- package/dist/src/text/external.d.ts.map +1 -1
- package/dist/src/triggers/Text.d.ts.map +1 -1
- package/dist/src/triggers/triggers.d.ts +3 -0
- package/dist/src/triggers/triggers.d.ts.map +1 -1
- package/dist/src/viewport/SelectMode.d.ts +10 -2
- package/dist/src/viewport/SelectMode.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/legend/Simple.d.ts.map +1 -1
- package/dist/src/vis/line/aether/line.d.ts +0 -1
- package/dist/src/vis/line/aether/line.d.ts.map +1 -1
- package/dist/src/vis/lineplot/Legend.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/XAxis.d.ts +2 -2
- package/dist/src/vis/lineplot/aether/YAxis.d.ts +2 -2
- package/dist/src/vis/lineplot/aether/axis.d.ts +2 -2
- package/dist/src/vis/lineplot/aether/axis.d.ts.map +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-ny6lkoIv.js → units-Dh7MflIZ.js} +3 -3
- package/dist/units-WWUmv-rf.cjs +1 -0
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +6 -6
- package/dist/Animated-DEXELMDa.cjs +0 -1
- package/dist/Toggle-CCsw0kkq.cjs +0 -1
- package/dist/css-TyQvZIXQ.cjs +0 -8
- package/dist/eraser-Bxknv-HS.cjs +0 -63
- package/dist/external-BBXhtVjD.cjs +0 -1
- package/dist/external-BOmNpcyI.js +0 -75
- package/dist/external-BPF50O_x.cjs +0 -1
- package/dist/external-BUAnicLg.cjs +0 -1
- package/dist/external-BaRBYE0N.cjs +0 -1
- package/dist/external-BsyCwXWB.cjs +0 -1
- package/dist/external-COBt6FnN.cjs +0 -1
- package/dist/external-CZSk2V5E.cjs +0 -1
- package/dist/external-Cw5iYImi.cjs +0 -1
- package/dist/external-EMhi5ISu.cjs +0 -1
- package/dist/external-Jee63xkv.cjs +0 -1
- package/dist/external-TAYJZFme.cjs +0 -1
- package/dist/external-bvOijYCw.cjs +0 -1
- package/dist/src/text/symbols.d.ts +0 -3
- package/dist/src/text/symbols.d.ts.map +0 -1
- package/dist/units-XE06scfL.cjs +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./symbols-DWZqHjhU.cjs"),o=require("./jsx-runtime-CITbqOLs.cjs"),j=require("react"),u=require("./css-TyQvZIXQ.cjs"),A=require("./eraser-Bxknv-HS.cjs"),Gh=require("./external-BsyCwXWB.cjs"),Dl=require("./Animated-DEXELMDa.cjs"),Bl=require("react-dom"),T=require("./LinePlot-BJ10hKs7.cjs"),ws=require("./external-TAYJZFme.cjs"),se=require("zod"),Ne=require("./external-yddEc8os.cjs"),$l=require("./external-BPF50O_x.cjs"),nt=require("./external-COBt6FnN.cjs"),zl=require("./external-CZSk2V5E.cjs"),Ae=require("./external-Cw5iYImi.cjs"),pe=require("./external-BUAnicLg.cjs"),Vl=require("./units-XE06scfL.cjs"),Uh=require("./external-BaRBYE0N.cjs"),Xh=require("./external-bvOijYCw.cjs"),Me=require("./external-EMhi5ISu.cjs"),qh=require("./external-Jee63xkv.cjs"),Qh=require("./external-BBXhtVjD.cjs"),Jh=require("./Video-BbRLzkdH.cjs"),Hl=require("./Toggle-CCsw0kkq.cjs"),eg=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),tg=e=>se.array(e).or(e.transform(t=>[t])),Fl=e=>A.f(e,(t,n,s)=>{const r=n===s.length-1,i=!isNaN(parseInt(t)),l=!isNaN(parseInt(s[n+1]));return i&&(t="element"),r||l?t:[t,"shape"]}),mi=(e,t)=>{if(e==null)return null;const n=e[t];return n==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:n},ng=(e,t,n)=>A.u(mi(e,"shape"),Fl(t),{...n,getter:mi}),sg=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:ng,getFieldSchemaPath:Fl,nullToUndefined:eg,toArray:tg},Symbol.toStringTag,{value:"Module"})),Zl=Symbol(),Wo=Symbol(),un="a",es="w";let og=(e,t)=>new Proxy(e,t);const yo=Object.getPrototypeOf,fi=new WeakMap,Go=e=>e&&(fi.has(e)?fi.get(e):yo(e)===Object.prototype||yo(e)===Array.prototype),hi=e=>typeof e=="object"&&e!==null,gi=new WeakMap,Kl=e=>e[Wo]||e,Yl=(e,t,n)=>{if(!Go(e))return e;const s=Kl(e),r=(l=>Object.isFrozen(l)||Object.values(Object.getOwnPropertyDescriptors(l)).some(a=>!a.writable))(s);let i=n&&n.get(s);return i&&i[1].f===r||(i=((l,a)=>{const c={f:a};let d=!1;const x=(m,h)=>{if(!d){let g=c[un].get(l);if(g||(g={},c[un].set(l,g)),m===es)g[es]=!0;else{let E=g[m];E||(E=new Set,g[m]=E),E.add(h)}}},p={get:(m,h)=>h===Wo?l:(x("k",h),Yl(Reflect.get(m,h),c[un],c.c)),has:(m,h)=>h===Zl?(d=!0,c[un].delete(l),!0):(x("h",h),Reflect.has(m,h)),getOwnPropertyDescriptor:(m,h)=>(x("o",h),Reflect.getOwnPropertyDescriptor(m,h)),ownKeys:m=>(x(es),Reflect.ownKeys(m))};return a&&(p.set=p.deleteProperty=()=>!1),[p,c]})(s,r),i[1].p=og(r?(l=>{let a=gi.get(l);if(!a){if(Array.isArray(l))a=Array.from(l);else{const c=Object.getOwnPropertyDescriptors(l);Object.values(c).forEach(d=>{d.configurable=!0}),a=Object.create(yo(l),c)}gi.set(l,a)}return a})(s):s,i[0]),n&&n.set(s,i)),i[1][un]=t,i[1].c=n,i[1].p},Wl=(e,t,n,s)=>{if(Object.is(e,t))return!1;if(!hi(e)||!hi(t))return!0;const r=n.get(Kl(e));if(!r)return!0;if(s){const l=s.get(e);if(l&&l.n===t)return l.g;s.set(e,{n:t,g:!1})}let i=null;try{for(const l of r.h||[])if(i=Reflect.has(e,l)!==Reflect.has(t,l),i)return i;if(r[es]===!0){if(i=((l,a)=>{const c=Reflect.ownKeys(l),d=Reflect.ownKeys(a);return c.length!==d.length||c.some((x,p)=>x!==d[p])})(e,t),i)return i}else for(const l of r.o||[])if(i=!!Reflect.getOwnPropertyDescriptor(e,l)!=!!Reflect.getOwnPropertyDescriptor(t,l),i)return i;for(const l of r.k||[])if(i=Wl(e[l],t[l],n,s),i)return i;return i===null&&(i=!0),i}finally{s&&s.set(e,{n:t,g:i})}},rg=e=>!!Go(e)&&Zl in e,Gl=e=>Go(e)&&e[Wo]||null,ig="h",lg="w",ag="o",cg="k",So=e=>typeof e=="object"&&e!==null,Ul=(e,t)=>{if(!So(e))return e;const n=Gl(e);return n!==null?(rg(e),n):(t.has(e)||(t.add(e),Object.entries(e).forEach(([s,r])=>{const i=Ul(r,t);Object.is(i,r)||(e[s]=i)})),e)},Ro=(e,t,n)=>{var s,r,i;if(!So(e)||!So(t))return;const l=n.get(Gl(t)||t);l&&((s=l[ig])==null||s.forEach(a=>{Reflect.has(e,a)}),l[lg]===!0&&Reflect.ownKeys(e),(r=l[ag])==null||r.forEach(a=>{Reflect.getOwnPropertyDescriptor(e,a)}),(i=l[cg])==null||i.forEach(a=>{Ro(e[a],t[a],n)}))},qs="o",Qs="r",Js="a";function ug(e,t){var n;let s=0;const r=(n=t?.size)!=null?n:1,i=[],l=t!=null&&t.noWeakMap?null:new WeakMap;return c=>{const d=l?.get(c);if(d)return d[Qs];for(let g=0;g<r;g+=1){const E=i[(s+g)%r];if(!E)break;if(!Wl(E[qs],c,E[Js],new WeakMap))return Ro(c,E[qs],E[Js]),l?.set(c,E),E[Qs]}const x=new WeakMap,p=Yl(c,x),m=Ul(e(p),new Set);Ro(c,c,x);const h={[qs]:c,[Qs]:m,[Js]:x};return s=(s-1+r)%r,i[s]=h,l?.set(c,h),m}}const dg=(e,t)=>u.S.RUNTIME==="browser"?ug(e,t):e,Jt=(e,t)=>{j.useEffect(()=>{const n=new AbortController,s=n.signal,i=(async()=>(await u.ur(),await e(s)))().catch(console.error);return()=>{n.abort(),i.then(l=>l?.()).catch(console.error)}},t)},xg=(e,t,n=150)=>{const[s,r]=j.useState(e);return j.useEffect(()=>{const i=setTimeout(()=>r(t),n);return()=>clearTimeout(i)},[t,n]),s},Uo=()=>{const e=j.useRef([]),t=j.useCallback(()=>{e.current.forEach(s=>s()),e.current=[]},[]),n=j.useCallback(s=>{s!=null&&e.current.push(...A.t.toArray(s))},[t]);return j.useEffect(()=>t,[t]),{cleanup:t,set:n}},pg=({transforms:e=[]})=>{const[t,n]=j.useState(e),s=j.useCallback((l,a,c=0)=>n(d=>{const x=d.filter(p=>p.key!==l);return x.push({key:l,transform:a,priority:c}),x.sort((p,m)=>m.priority-p.priority),x}),[n]),r=j.useCallback(l=>n(a=>a.filter(c=>c.key!==l)),[s]);return{transform:j.useCallback(l=>t.reduce((a,c)=>c.transform(a),{...l,transformed:!1}),[t]),setTransform:s,deleteTransform:r}},mg=Object.freeze(Object.defineProperty({__proto__:null,Access:f.Access,Acquire:f.Acquire,Add:f.Add,Align:f.Align,Analyze:f.Analyze,Annotate:f.Annotate,Array:f.Array,Arrow:f.Arrow,Attachment:f.Attachment,Auto:f.Auto,AutoFitWidth:f.AutoFitWidth,Binary:f.Binary,Bolt:f.Bolt,Box:f.Box$1,Bridge:f.Bridge,Calculation:f.Calculation,Calendar:f.Calendar$1,Caret:f.Caret,Channel:f.Channel,Check:f.Check,Circle:f.Circle,Close:f.Close,Cluster:f.Cluster,Commit:f.Commit,Concepts:f.Concepts,Connect:f.Connect,Constant:f.Constant,Control:f.Control,Copy:f.Copy,Decimal:f.Decimal,Delete:f.Delete,Details:f.Details,Device:f.Device,Disable:f.Disable,Disconnect:f.Disconnect,Download:f.Download,Downsample:f.Downsample,Drag:f.Drag,Dynamic:f.Dynamic,Edit:f.Edit,EditOff:f.EditOff,Enable:f.Enable,Expand:f.Expand,Explore:f.Explore,Export:f.Export,Feedback:f.Feedback,Filter:f.Filter,Focus:f.Focus,Function:f.Function,Group:f.Group,Guide:f.Guide,Hardware:f.Hardware,Heart:f.Heart,Hidden:f.Hidden,Import:f.Import,Index:f.Index,Info:f.Info,JSON:f.JSON,Keyboard:f.Keyboard,Label:f.Label,LinePlot:f.LinePlot,Linear:f.Linear,Link:f.Link,LinkExternal:f.LinkExternal,Loading:f.Loading,Log:f.Log,Logo:f.Logo,Map:f.Map,Menu:f.Menu$1,MoveToMainWindow:f.MoveToMainWindow,NPM:f.NPM,Node:f.Node,None:f.None,OpenExternal:f.OpenExternal,OpenInNewWindow:f.OpenInNewWindow,PNPM:f.PNPM,Pan:f.Pan,Pause:f.Pause,Play:f.Play,Python:f.Python,QuestionMark:f.QuestionMark,Rack:f.Rack,Range:f.Range,Reference:f.Reference,Refresh:f.Refresh,Release:f.Release,Rename:f.Rename,Resources:f.Resources,Rotate:f.Rotate,Rule:f.Rule,Save:f.Save,Schematic:f.Schematic,Search:f.Search,Selection:f.Selection,Settings:f.Settings,Snapshot:f.Snapshot,Snooze:f.Snooze,Sound:f.Sound,SplitX:f.SplitX,SplitY:f.SplitY,StarFilled:f.StarFilled,StarOutlined:f.StarOutlined,String:f.String,StrokeWidth:f.StrokeWidth,Subtract:f.Subtract,Sync:f.Sync,Table:f.Table,Tare:f.Tare,Task:f.Task,Terminal:f.Terminal,Text:f.Text$3,TextAlign:f.TextAlign,Time:f.Time$1,Tooltip:f.Tooltip,Type:f.Type,TypeScript:f.TypeScript,Units:f.Units,User:f.User,Value:f.Value,Variable:f.Variable,Virtual:f.Virtual,Visible:f.Visible,Visualize:f.Visualize,Warning:f.Warning,Wave:f.Wave,Workspace:f.Workspace,Yarn:f.Yarn,Zoom:f.Zoom,createComposite:f.createComposite,resolve:f.resolve,wrapSVGIcon:f.wrapSVGIcon},Symbol.toStringTag,{value:"Module"})),fg=Object.freeze(Object.defineProperty({__proto__:null,Config:f.Config,Dialog:f.Dialog$1,chooseLocation:f.chooseLocation,formatTip:f.formatTip,useConfig:f.useConfig,wrap:f.wrap},Symbol.toStringTag,{value:"Module"})),Xo=({ref:e,location:t,style:n,size:s,className:r,children:i,onDragStart:l,sizeUnits:a="px",showHandle:c=!0,...d})=>{const x=u.K$1.construct(t),p=u.K$1.direction(x),m=u.g.dimension(p);return o.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("resize"),u.CSS.loc(x),r),style:{[m]:`${s}${a}`,...n},ref:e,direction:p,empty:!0,...d,children:[i,c&&o.jsxRuntimeExports.jsx("div",{draggable:!0,className:u.CSS(u.CSS.BE("resize","handle"),u.CSS.bordered(u.K$1.swap(x))),onDragStart:l,onDrag:f.preventDefault,onDragEnd:f.preventDefault})]})},Xl=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:r="x"})=>{const i=j.useRef(null),[l,a]=j.useState({sizeDistribution:hg(n,t),root:null}),c=j.useCallback((p,m,h)=>{if(i.current==null)return;const g=u.Ho.dim(u.Ho.construct(i.current),r);a(E=>to(E,g,p,s,m,h))},[s,a,r]);j.useEffect(()=>e?.(l.sizeDistribution),[l.sizeDistribution,e]);const d=j.useCallback((p,m)=>{p.preventDefault();const h=r==="x"?"clientX":"clientY",g=S=>c(m,S[h]),E=()=>{a(S=>({...S,root:null})),document.removeEventListener("mousemove",g)};a(S=>({...S,root:p[h]})),document.addEventListener("mousemove",g),document.addEventListener("mouseup",E,{once:!0})},[a,r,to]);return{setSize:j.useCallback((p,m)=>c(p,void 0,m),[to]),props:{direction:r,sizeDistribution:l.sizeDistribution,onDragHandle:d,ref:i}}},ql=({ref:e,direction:t="x",children:n,sizeDistribution:s,onDragHandle:r,className:i,...l})=>{const a=u.g.construct(t),c=j.Children.toArray(n);return s=gg(s),o.jsxRuntimeExports.jsx(f.Box,{...l,ref:e,direction:a,className:u.CSS(u.CSS.B("resize-multiple"),i),empty:!0,grow:!0,children:c.map((d,x)=>o.jsxRuntimeExports.jsx(Xo,{onDragStart:p=>r(p,x),location:u.g.location(a),size:s[x]*100,sizeUnits:"%",showHandle:x!==c.length-1,children:d},x))})},hg=(e,t)=>{const n=e.reduce((r,i)=>r+i,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(r=>r/n);if(e.every(r=>r<=1)){const r=1-n;return[...e,...Array(s).fill(r/s)]}return e.map(()=>1/t)},eo=.001,gg=e=>e.every(t=>u.nr.closeTo(t,1/e.length),eo)?e.map((t,n)=>n%2===0?t+eo:n===e.length-1?t:t-eo):e,to=(e,t,n,s,r,i)=>{const l=Ql(e,t,n,r,i),[a,c]=jg(e.sizeDistribution,n,l,s/t),d=c?r??null:e.root;return{...e,sizeDistribution:a,root:d}},Ql=(e,t,n,s,r)=>{let i;if(r!=null)r>1&&(r/=t),i=r-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},jg=(e,t,n,s)=>{let r=t;for(;r>0&&e[r]+n<=s;)r--;const i=e[r]+n,l=Eg(r,e,s,n),a=e[l]-n;return i<s||a<s?[e,!1]:[e.map((c,d)=>d===r?i:d===l?a:c),!0]},Eg=(e,t,n,s)=>(e===t.length-1?Sg:yg)(e,t,n,s),yg=(e,t,n,s)=>{let r=e+1;for(;r<t.length-1&&t[r]-s<=n;)r++;return r},Sg=(e,t,n,s)=>{let r=e-1;for(;r>0&&t[r]-s<=n;)r--;return r},no=2,Rg=100,Jl=({onCollapse:e,onResize:t,location:n="left",minSize:s,maxSize:r,initialSize:i=200,collapseThreshold:l=1/0,className:a,...c})=>{const[d,x]=j.useState(u.R(i,s,r)),p=j.useRef(null),m=u.K$1.construct(n),h=j.useCallback(y=>{if(p.current===null)return 0;const C=u.Ho.dim(y,u.K$1.direction(m),!0)*(1-2*Number(["bottom","right"].includes(m))),v=p.current+C,L=u.R(v,s,r);return(L-v)/(s??Rg)>l?no:L},[m,s,r,l]),g=j.useRef(null),E=j.useCallback(y=>{const C=h(y);x(C),g.current!=null&&t?.(C,u.Ho.construct(g.current))},[t,h]),S=j.useCallback(()=>x(y=>(p.current=y,y)),[x]),R=j.useCallback(y=>h(y)===no&&e?.(),[e,h]);j.useEffect(()=>{s==null||r==null||x(y=>{const C=u.R(y,s,r);return p.current=C,C})},[s,r]);const _=Ne.useCursorDrag({onMove:E,onStart:S,onEnd:R});return o.jsxRuntimeExports.jsx(Xo,{ref:g,location:m,size:d,onDragStart:_,className:u.clsx(a,u.CSS.expanded(d!==no)),...c})},Cg=Object.freeze(Object.defineProperty({__proto__:null,Core:Xo,Multiple:ql,Single:Jl,calculateDiffPercentage:Ql,useMultiple:Xl},Symbol.toStringTag,{value:"Module"})),qo=({aetherKey:e,enabled:t=!0})=>{const{setState:n}=f.useLifecycle({aetherKey:e,type:A.Eraser.TYPE,schema:A.eraserStateZ,initialState:{region:u.Ho.ZERO,enabled:t}}),s=f.useSyncedRef(t);return{erase:j.useCallback(i=>{n({enabled:s.current,region:i})},[n,s])}},wg=({aetherKey:e,children:t})=>{const{erase:n}=qo({aetherKey:e}),s=f.useResize(n);return o.jsxRuntimeExports.jsx("div",{ref:s,className:u.CSS(u.CSS.inheritDims()),children:t})},bg=Object.freeze(Object.defineProperty({__proto__:null,Eraser:wg,use:qo},Symbol.toStringTag,{value:"Module"})),vg=({items:e,initialKey:t})=>{const[n,s]=j.useState(t),r=l=>s(l===n?void 0:l),i=e.find(l=>l.key===n);return{onSelect:r,activeItem:i}},_g=({activeItem:e,children:t,onSelect:n,location:s="left",collapseThreshold:r=.65,className:i,onResize:l,onCollapse:a,eraseEnabled:c,...d})=>{const x=u.K$1.direction(s);c??=e!=null;const p=j.useCallback(()=>{a?a():e!=null&&n?.(e.key)},[n,e?.key,a]),{erase:m}=qo({enabled:c}),h=j.useCallback((_,y)=>{l?.(_,y),m(y)},[l,m]),{content:g,minSize:E,maxSize:S,initialSize:R=0}=e??{};return o.jsxRuntimeExports.jsx(Jl,{className:u.CSS(u.CSS.B("nav-drawer"),u.CSS.dir(x),u.CSS.visible(e!=null),i),collapseThreshold:r,onCollapse:p,location:s,onResize:h,minSize:E,maxSize:S,initialSize:R,...d,children:g})},kg=Object.freeze(Object.defineProperty({__proto__:null,Bar:f.Bar,Drawer:_g,useDrawer:vg},Symbol.toStringTag,{value:"Module"})),Qo={info:"var(--pluto-text-color)",error:"var(--pluto-error-z)",warning:"var(--pluto-warning-m1)",success:"var(--pluto-primary-z)",loading:"var(--pluto-text-color)",disabled:"var(--pluto-gray-l8)"},Jo=({variant:e,...t})=>e==="loading"?o.jsxRuntimeExports.jsx(f.Loading,{...t}):o.jsxRuntimeExports.jsx(f.Circle,{color:e!=null?Qo[e]:void 0,...t}),Lg=({action:e})=>j.isValidElement(e)?e:j.createElement(f.Button,{...e,key:e.key,size:"tiny"}),Mg=({status:{key:e,time:t,count:n,message:s,description:r,variant:i},silence:l,actions:a,className:c,children:d,...x})=>{const p=j.useRef(null);return o.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("notification"),c),y:!0,empty:!0,ref:p,...x,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,justify:"between",grow:!0,style:{width:"100%"},children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",gap:"small",children:[o.jsxRuntimeExports.jsx(Jo,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:`x${n}`}),o.jsxRuntimeExports.jsx(f.DateTime,{className:u.CSS(u.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:o.jsxRuntimeExports.jsx(f.Close,{})})]}),o.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"start",className:u.CSS(u.CSS.BE("notification","content")),gap:"small",children:[d??o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","message")),style:{flexGrow:1},children:s}),r!=null&&o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),a!=null&&o.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",justify:"end",className:u.CSS(u.CSS.BE("notification","actions")),children:A.t.toArray(a).map(m=>o.jsxRuntimeExports.jsx(Lg,{action:m},m.key))})]},t.toString())},Pg=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:f.Aggregator,Indicator:Jo,Notification:Mg,Summary:f.Summary,VARIANT_COLORS:Qo,useAdder:f.useAdder,useAsyncErrorHandler:f.useAsyncErrorHandler,useErrorHandler:f.useErrorHandler,useNotifications:f.useNotifications},Symbol.toStringTag,{value:"Module"})),ea=e=>e==="preview"?"connected":e,ta=e=>e==="preview"?"preview":void 0,bs=({resourceName:e,value:t,onChange:n,data:s,getItem:r,subscribe:i,haulType:l,icon:a,disabled:c,onSearch:d,emptyContent:x,status:p,onFetchMore:m,children:h,renderTag:g,actions:E,allowNone:S,replaceOnSingle:R,triggerProps:_,virtual:y=!0,dialogProps:C,variant:v="connected",...L})=>o.jsxRuntimeExports.jsx(f.Frame,{variant:ea(v),...L,children:o.jsxRuntimeExports.jsxs(f.Frame$1,{multiple:!0,value:t,onChange:n,data:s,getItem:r,subscribe:i,onFetchMore:m,allowNone:S,replaceOnSingle:R,virtual:y,children:[o.jsxRuntimeExports.jsx(sa,{haulType:l,icon:a,placeholder:`Select ${e}s`,disabled:c,variant:ta(v),..._,children:g}),o.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:d,emptyContent:x,status:p,actions:E,resourceName:e,...C,children:h})]})}),Xe=(e,t)=>{const n={};t.forEach(r=>n[r]=void 0);const s=r=>{const{...i}={...r,...n};return o.jsxRuntimeExports.jsx(e,{...i})};return s.displayName=`RemoveProps(${e.displayName})`,s},na=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:A.SIZES,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"tiny",children:"L"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"small",children:"M"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"medium",children:"L"})]}),Ng=Object.freeze(Object.defineProperty({__proto__:null,SIZES:A.SIZES,SelectSize:na,isRenderProp:f.isRenderProp,isSize:A.isSize,removeProps:Xe,renderProp:f.renderProp,size:A.size},Symbol.toStringTag,{value:"Module"})),vs=({children:e="",size:t="medium",color:n,icon:s,onClose:r,className:i,onDragStart:l,...a})=>{const c=u.ir.cssString(n);s==null&&n!=null&&(s=o.jsxRuntimeExports.jsx(f.Circle,{color:c}));const d=r==null?void 0:o.jsxRuntimeExports.jsx(f.Button,{"aria-label":"close",size:t==="tiny"?"small":t,variant:"text",className:u.CSS.BE("tag","close"),sharp:!0,onClick:x=>{x.stopPropagation(),r()},children:o.jsxRuntimeExports.jsx(f.Close,{})});return o.jsxRuntimeExports.jsxs(f.Button,{el:"div",className:u.CSS(i,u.CSS.B("tag"),r!=null&&u.CSS.BM("tag","closeable")),size:t,overflow:"nowrap",align:"center",gap:"small",onDragStart:l,...a,children:[s,d,e]})},er=({children:e,onClick:t,variant:n="outlined",size:s="medium",...r})=>o.jsxRuntimeExports.jsx(f.Button,{el:"div",variant:n,size:s,x:!0,onClick:t,align:"center",gap:"small",style:{padding:"0rem 0.5rem",paddingRight:"2rem"},rounded:!0,...r,children:e}),Tg=Object.freeze(Object.defineProperty({__proto__:null,Tag:vs,Tags:er},Symbol.toStringTag,{value:"Module"})),Ag=({itemKey:e,icon:t,onDragStart:n})=>{const s=f.useItem(e),{onSelect:r}=f.useItemState(e);return o.jsxRuntimeExports.jsx(vs,{onClose:r,onDragStart:()=>n(e),draggable:!0,size:"small",status:s==null?"error":void 0,icon:s?.icon??t,children:s?.name??e})},Ig=f.renderProp(Ag),tr=({items:e},t,n,s)=>{if(t===""||s===!0)return!1;const r=f.filterByType(t,e);return r.length>0&&!r.every(i=>n.includes(i.key))},sa=({haulType:e="",disabled:t,placeholder:n="Select...",variant:s="outlined",icon:r,children:i=Ig})=>{const l=f.useSelection(),a=f.useSyncedRef(l),{setSelected:c}=f.useContext$3(),{toggle:d,visible:x}=f.useContext$2(),p=j.useCallback(_=>tr(_,e,A.t.toArray(l),t),[e,l,t]),{startDrag:m,...h}=f.useDragAndDrop({type:e,canDrop:p,onDrop:f.useFilterByTypeCallback(e,({items:_})=>{const y=A.t.toArray(a.current);return c(u.c.unique([...A.t.toArray(y),..._.map(C=>C.key)])),_},[c])}),g=j.useCallback(({dropped:_})=>{const y=l.filter(C=>!_.some(v=>v.key===C));c(y)},[c,l]),E=j.useCallback(_=>{m([{key:_,type:e}],g)},[m,g,e]),S=f.useDraggingState(),R=s==="text"&&l.length!==0;return o.jsxRuntimeExports.jsxs(er,{full:"x",onClick:()=>{R||d()},...h,className:u.CSS(u.CSS.dropRegion(p(S)),u.CSS.BE("dialog","trigger"),u.CSS.BM("variant",s)),variant:s,preventClick:R,grow:!0,children:[l.length===0&&o.jsxRuntimeExports.jsxs(f.Text,{color:8,weight:400,style:{padding:"0 1rem"},children:[r,n]}),l.map(_=>i({key:_,itemKey:_,onDragStart:E,icon:r})),s!=="text"&&o.jsxRuntimeExports.jsx(Dl.Animated,{className:u.CSS.level("p"),enabled:x,enabledLoc:"bottom",disabledLoc:"left",color:8}),R&&o.jsxRuntimeExports.jsx(f.Button,{variant:s,onClick:_=>{_.stopPropagation(),d()},children:o.jsxRuntimeExports.jsx(f.Add,{color:8})})]})},Tt=({resourceName:e,onChange:t,value:n,allowNone:s,emptyContent:r,haulType:i,data:l,getItem:a,subscribe:c,itemHeight:d,onFetchMore:x,disabled:p,onSearch:m,status:h,icon:g,children:E,variant:S="connected",actions:R,dialogProps:_,triggerProps:y,virtual:C=!0,closeDialogOnSelect:v=!0,...L})=>o.jsxRuntimeExports.jsx(f.Frame,{...L,variant:ea(S),children:o.jsxRuntimeExports.jsxs(f.Frame$1,{value:n,onChange:t,data:l,getItem:a,subscribe:c,allowNone:s,onFetchMore:x,itemHeight:d,virtual:C,closeDialogOnSelect:v,children:[o.jsxRuntimeExports.jsx(oa,{haulType:i,icon:g,placeholder:`Select a ${e}`,disabled:p,variant:ta(S),...y}),o.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:m,resourceName:e,emptyContent:r,status:h,actions:R,..._,children:E})]})}),oa=({haulType:e="",placeholder:t,icon:n,disabled:s,iconOnly:r=!1,hideCaret:i=!1,...l})=>{const a=f.useSelection(),{setSelected:c}=f.useContext$3(),[d]=a,x=f.useItem(d),{name:p,icon:m}=x??{},h=j.useCallback(S=>tr(S,e,a,s),[e,a,s]),g=f.useDrop({type:e,canDrop:h,onDrop:f.useFilterByTypeCallback(e,({items:S})=>(S.length!==0&&c([S[0].key]),S),[c])}),E=f.useDraggingState();return o.jsxRuntimeExports.jsxs(zl.Trigger,{variant:"outlined",gap:"small",className:u.CSS(u.CSS.dropRegion(h(E))),disabled:s,...g,...l,hideCaret:i||r,textColor:p==null?8:void 0,children:[m??n,!r&&(p??t)]})},Og=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);if(n==null)return null;const{name:s,icon:r}=n;return o.jsxRuntimeExports.jsxs(f.ListItem,{...e,children:[r,s]})}),Mn=({data:e,filter:t,children:n=Og,virtual:s=!1,...r})=>{const{retrieve:i,...l}=f.useStaticData({data:e,filter:t}),{search:a}=nt.usePager({retrieve:i});return o.jsxRuntimeExports.jsx(Tt,{...r,...l,onSearch:a,virtual:s,children:n})},en=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:A.LEVELS,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h2",square:!0,children:"XL"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h3",square:!0,children:"L"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h4",square:!0,children:"M"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h5",square:!0,children:"S"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"small",square:!0,children:"XS"})]}),Dg=[250,400,500,600],ra=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:Dg,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:250,children:"Light"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:400,children:"Normal"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:500,children:"Medium"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:600,children:"Bold"})]}),Bg=Object.freeze(Object.defineProperty({__proto__:null,Level:en,Weight:ra},Symbol.toStringTag,{value:"Module"})),$g=Object.freeze(Object.defineProperty({__proto__:null,Button:pe.Button,Buttons:pe.Buttons,Core:f.Core,Dialog:f.Dialog$2,Frame:f.Frame$1,ListItem:f.ListItem,Multiple:bs,MultipleTrigger:sa,Single:Tt,SingleTrigger:oa,Static:Mn,Text:Bg,staticCanDrop:tr,useClear:f.useClear,useContext:f.useContext$3,useHover:f.useHover,useItemState:f.useItemState,useMultiple:f.useMultiple,useSelection:f.useSelection,useSingle:f.useSingle},Symbol.toStringTag,{value:"Module"})),zg=()=>o.jsxRuntimeExports.jsx(f.Caret.Right,{className:u.CSS.BE("breadcrumb","separator")}),yn=({children:e,...t})=>o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS.BE("breadcrumb","segment"),...t,defaultEl:"span",children:e}),nr=({children:e,highlightVariant:t,...n})=>o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.B("breadcrumb"),t!=null&&u.CSS.BM("breadcrumb","highlight",t)),x:!0,align:"center",gap:"small",...n,children:j.Children.map(e,(s,r)=>s==null||typeof s=="boolean"?null:o.jsxRuntimeExports.jsxs(j.Fragment,{children:[r>0&&o.jsxRuntimeExports.jsx(zg,{}),typeof s=="string"?o.jsxRuntimeExports.jsx(yn,{children:s}):s]},r))}),Vg=(e,t)=>{const n=e.split("/");return n.map((s,r)=>t({href:n.slice(0,r+1).join("/"),segment:s,index:r}))},Hg=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:nr,Segment:yn,mapURLSegments:Vg},Symbol.toStringTag,{value:"Module"})),Fg=({channelKey:e,rangeKey:t,shadow:n,className:s,...r})=>{const{value:i,onChange:l}=r,[a,c]=j.useState(!1),{update:d}=Ga.useDirect({params:{rangeKey:t,channelKey:e}}),{data:x}=Rr.useDirect({params:{key:e,rangeKey:t}}),p=async C=>{d(C)},m=x?.alias,h=x?.alias??x?.name;let g=o.jsxRuntimeExports.jsx(f.Rename,{});a?g=o.jsxRuntimeExports.jsx(f.Loading,{}):m===i&&(g=o.jsxRuntimeExports.jsx(f.Check,{}));const E=p!=null&&!a&&m!==i&&e!==0,S=f.useErrorHandler(),R=()=>{E&&S(async()=>{c(!0);try{await p(i),c(!1)}catch(C){throw c(!1),C}},"Failed to set channel alias")},_=()=>{m!=null&&l?.(m)},y=e===0?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):p==null?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):i.length===0?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):m===i?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Alias synced with this label"}):o.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Sync alias for ",h," with this label"]});return o.jsxRuntimeExports.jsxs(f.Text$2,{selectOnFocus:!0,...r,children:[E&&o.jsxRuntimeExports.jsx(f.Button,{onClick:_,tooltip:o.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Set ",h," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:o.jsxRuntimeExports.jsx(f.Sync,{})}),o.jsxRuntimeExports.jsx(f.Button,{onClick:R,disabled:!E,tooltip:y,tooltipLocation:{y:"top"},variant:"outlined",children:g})]})},bt="channel";var ji=180/Math.PI,Co={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ia(e,t,n,s,r,i){var l,a,c;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(c=e*n+t*s)&&(n-=e*c,s-=t*c),(a=Math.sqrt(n*n+s*s))&&(n/=a,s/=a,c/=a),e*s<t*n&&(e=-e,t=-t,c=-c,l=-l),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*ji,skewX:Math.atan(c)*ji,scaleX:l,scaleY:a}}var Zn;function Zg(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Co:ia(t.a,t.b,t.c,t.d,t.e,t.f)}function Kg(e){return e==null||(Zn||(Zn=document.createElementNS("http://www.w3.org/2000/svg","g")),Zn.setAttribute("transform",e),!(e=Zn.transform.baseVal.consolidate()))?Co:(e=e.matrix,ia(e.a,e.b,e.c,e.d,e.e,e.f))}function la(e,t,n,s){function r(d){return d.length?d.pop()+" ":""}function i(d,x,p,m,h,g){if(d!==p||x!==m){var E=h.push("translate(",null,t,null,n);g.push({i:E-4,x:T.interpolateNumber(d,p)},{i:E-2,x:T.interpolateNumber(x,m)})}else(p||m)&&h.push("translate("+p+t+m+n)}function l(d,x,p,m){d!==x?(d-x>180?x+=360:x-d>180&&(d+=360),m.push({i:p.push(r(p)+"rotate(",null,s)-2,x:T.interpolateNumber(d,x)})):x&&p.push(r(p)+"rotate("+x+s)}function a(d,x,p,m){d!==x?m.push({i:p.push(r(p)+"skewX(",null,s)-2,x:T.interpolateNumber(d,x)}):x&&p.push(r(p)+"skewX("+x+s)}function c(d,x,p,m,h,g){if(d!==p||x!==m){var E=h.push(r(h)+"scale(",null,",",null,")");g.push({i:E-4,x:T.interpolateNumber(d,p)},{i:E-2,x:T.interpolateNumber(x,m)})}else(p!==1||m!==1)&&h.push(r(h)+"scale("+p+","+m+")")}return function(d,x){var p=[],m=[];return d=e(d),x=e(x),i(d.translateX,d.translateY,x.translateX,x.translateY,p,m),l(d.rotate,x.rotate,p,m),a(d.skewX,x.skewX,p,m),c(d.scaleX,d.scaleY,x.scaleX,x.scaleY,p,m),d=x=null,function(h){for(var g=-1,E=m.length,S;++g<E;)p[(S=m[g]).i]=S.x(h);return p.join("")}}}var Yg=la(Zg,"px, ","px)","deg)"),Wg=la(Kg,", ",")",")"),Gg=1e-12;function Ei(e){return((e=Math.exp(e))+1/e)/2}function Ug(e){return((e=Math.exp(e))-1/e)/2}function Xg(e){return((e=Math.exp(2*e))-1)/(e+1)}const ts=function e(t,n,s){function r(i,l){var a=i[0],c=i[1],d=i[2],x=l[0],p=l[1],m=l[2],h=x-a,g=p-c,E=h*h+g*g,S,R;if(E<Gg)R=Math.log(m/d)/t,S=function(N){return[a+N*h,c+N*g,d*Math.exp(t*N*R)]};else{var _=Math.sqrt(E),y=(m*m-d*d+s*E)/(2*d*n*_),C=(m*m-d*d-s*E)/(2*m*n*_),v=Math.log(Math.sqrt(y*y+1)-y),L=Math.log(Math.sqrt(C*C+1)-C);R=(L-v)/t,S=function(N){var I=N*R,B=Ei(v),z=d/(n*_)*(B*Xg(t*I+v)-Ug(v));return[a+z*h,c+z*g,d*B/Ei(t*I+v)]}}return S.duration=R*1e3*t/Math.SQRT2,S}return r.rho=function(i){var l=Math.max(.001,+i),a=l*l,c=a*a;return e(l,a,c)},r}(Math.SQRT2,2,4),qg=Object.freeze(Object.defineProperty({__proto__:null,Base:T.Base,Bottom:T.Bottom,Right:T.Right,Top:T.Top,axisStateZ:T.axisStateZ,newCanvas:T.newCanvas,newTickFactory:T.newTickFactory,tickFactoryProps:T.tickFactoryProps,tickType:T.tickType},Symbol.toStringTag,{value:"Module"})),Qg=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:T.AcquireChannelControl,AuthoritySource:T.AuthoritySource,Chip:T.Chip,Controller:T.Controller,Indicator:T.Indicator,Legend:T.Legend,REGISTRY:T.REGISTRY$15,STATUSES:T.STATUSES,SetChannelValue:T.SetChannelValue,StateProvider:T.StateProvider,acquireChannelControl:T.acquireChannelControl,acquireChannelControlPropsZ:T.acquireChannelControlPropsZ,authoritySource:T.authoritySource,authoritySourceDetailsZ:T.authoritySourceDetailsZ,authoritySourceProps:T.authoritySourceProps,chipStateZ:T.chipStateZ,chipStatusDetailsZ:T.chipStatusDetailsZ,controllerStateZ:T.controllerStateZ,indicatorStateZ:T.indicatorStateZ,indicatorStatusDetailsZ:T.indicatorStatusDetailsZ,legendStateZ:T.legendStateZ,setChannelValue:T.setChannelValue,setChannelValuePropsZ:T.setChannelValuePropsZ,stateProviderStateZ:T.stateProviderStateZ,statusZ:T.statusZ,sugaredStateZ:T.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),Jg={region:u.Ho.ZERO,dpr:1,os:u.S.getOS()},e1={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},t1=({children:e,resizeDebounce:t=100,className:n,...s})=>{const[{path:r},{bootstrapped:i,dpr:l},a]=f.use$2({type:T.Canvas.TYPE,schema:T.canvasStateZ,initialState:Jg}),c=j.useRef({...e1}),d=j.useRef(!1),x=j.useCallback(E=>{c.current.bootstrapped&&(a(()=>({bootstrapped:!0,region:E,dpr:window.devicePixelRatio,os:u.S.getOS({default:"Windows"})})),d.current=!0)},[a]),p=j.useRef(null),m=f.useResize(x,{debounce:t}),h=f.useCombinedRefs(p,m);j.useEffect(()=>{const E=()=>{window.devicePixelRatio===l||!c.current.bootstrapped||p.current==null||a(S=>({...S,region:u.Ho.construct(p.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",E,{once:!0})},[l]),j.useEffect(()=>{const E=()=>{!c.current.bootstrapped||p.current==null||a(S=>({...S,region:u.Ho.construct(p.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",E),window.addEventListener("blur",E)},[a]);const g=j.useCallback(E=>{if(E==null)return;E.className.includes("gl")?c.current.gl=E:E.className.includes("upper2d")?c.current.upper2d=E:c.current.lower2d=E;const{gl:S,lower2d:R,upper2d:_,bootstrapped:y}=c.current;if(S==null||R==null||_==null||y)return;c.current.bootstrapped=!0;const C=S.transferControlToOffscreen(),v=_.transferControlToOffscreen(),L=R.transferControlToOffscreen();a({glCanvas:C,upper2dCanvas:v,lower2dCanvas:L,bootstrap:!0,bootstrapped:!1,region:u.Ho.construct(S),dpr:window.devicePixelRatio,os:u.S.getOS({default:"Windows"})},[C,v,L])},[a]);return o.jsxRuntimeExports.jsxs("div",{ref:h,className:u.CSS(u.CSS.B("canvas-container"),n),...s,children:[o.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","lower2d"))}),o.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","gl"))}),o.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","upper2d"))}),o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:i&&e})]})},Pn=(e,t)=>f.useResize(j.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(u.C.XY.translate(u.K.scale(u.Ho.topLeft(r),-1)).box(n),s)},[e]),t),n1=Object.freeze(Object.defineProperty({__proto__:null,Canvas:t1,useRegion:Pn},Symbol.toStringTag,{value:"Module"})),aa=j.createContext(null),tt=e=>{const t=j.use(aa);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},ca=e=>{const{addViewportHandler:t}=tt("Viewport");j.useEffect(()=>t(e),[t,e])},Nn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=tt(t),{key:r}=e;return f.useEffectCompare(()=>{u.K$1.outer.parse(e.loc),n(e)},([a],[c])=>A.N.equal(a,c),[e]),j.useEffect(()=>()=>s(r),[]),{gridArea:u.g.swap(u.K$1.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},ua=({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=u.K.ZERO,children:r,hold:i=!1,onHold:l,visible:a,...c})=>{const[d,x]=j.useState([]),p=f.useMemoDeepEqual({clearOverScan:s,hold:i,visible:a}),[{path:m},{grid:h},g]=f.use$2({aetherKey:e,type:T.LinePlot.TYPE,schema:T.linePlotStateZ,initialState:{container:u.Ho.ZERO,viewport:u.Ho.DECIMAL,grid:{},...p}}),E=j.useCallback(D=>{a&&g(V=>({...V,container:D}))},[g,a]),S=Pn(E,{debounce:n});j.useEffect(()=>g(D=>({...D,...p})),[p]);const R=j.useRef(new Map),_=j.useCallback(D=>(R.current.set(D,null),()=>R.current.delete(D)),[R]),y=j.useCallback(D=>{const{mode:V,box:w,stage:k}=D;(V==="pan"&&k!=="start"||V==="zoom"||V==="zoomReset"&&k==="start")&&g(M=>({...M,viewport:w})),R.current.forEach((M,O)=>O(D))},[g]),C=j.useCallback(D=>{g(V=>({...V,grid:{...V.grid,[D.key]:D}}))},[g]),v=j.useCallback(D=>g(V=>{const{[D]:w,...k}=V.grid;return{...V,grid:k}}),[g]),L=j.useCallback(D=>{x(V=>[...V.filter(({key:w})=>w!==D.key),D])},[x]),N=j.useCallback(D=>x(V=>V.filter(({key:w})=>w!==D)),[L]),I=j.useMemo(()=>s1(h),[h]),B=j.useCallback(D=>{g(V=>({...V,hold:D})),l?.(D)},[g,l]),z=`line-plot-${e}`,H=j.useMemo(()=>({lines:d,setGridEntry:C,removeGridEntry:v,setLine:L,removeLine:N,setViewport:y,addViewportHandler:_,setHold:B,id:z}),[z,d,C,v,L,N,y,_,B]);return o.jsxRuntimeExports.jsx("div",{id:z,className:u.CSS.B("line-plot"),style:{...t,...I},ref:S,...c,children:o.jsxRuntimeExports.jsx(aa,{value:H,children:o.jsxRuntimeExports.jsx(f.Composite,{path:m,children:r})})})},s1=e=>{const t=u.CSS.newGridBuilder();return T.regions("top",e).forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),t.row("plot-start","plot-end","minmax(0, 1fr)"),T.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),T.regions("left",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.col("plot-start","plot-end","minmax(0, 1fr)"),T.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},sr=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?T.XAxis.TYPE:T.YAxis.TYPE,s=`${e}-axis`,r=({aetherKey:i,children:l,location:a=t,label:c="",labelLevel:d="small",labelDirection:x=e,onLabelChange:p,color:m,labelSize:h,showGrid:g,type:E,bounds:S,className:R,tickSpacing:_,autoBounds:y,axisKey:C,autoBoundUpdateInterval:v,onAutoBoundsChange:L,style:N,...I})=>{const B=(c?.length??0)>0,z=f.useUniqueKey(i),H=f.useMemoDeepEqual({location:a,showGrid:g,type:E,bounds:S,axisKey:C,label:c,labelDirection:x,tickSpacing:_,autoBounds:y,autoBoundUpdateInterval:v}),[{path:D},{size:V,labelSize:w,...k},M]=f.use$2({aetherKey:z,type:n,schema:T.coreAxisStateZ,initialState:H});j.useEffect(()=>M(Z=>({...Z,...H})),[H]),j.useEffect(()=>{const{lower:Z,upper:K}=T.parseAutoBounds(k.autoBounds);k.bounds!=null&&(Z&&S?.lower!==k.bounds.lower||K&&S?.upper!==k.bounds.upper)&&L?.(k.bounds)},[k.autoBounds,k.bounds]);const O=Nn({loc:a,key:`${n}-${z}`,size:V+w,order:1},`${e.toUpperCase()}Axis`),F=ws.useTypography(d).toString(),$=j.useRef(0);return j.useEffect(()=>{if(e==="y"){if(c==null)return;let K=A.dimensions(c,F)[u.g.dimension(u.g.construct(x))];K>0&&(K+=9),M(q=>({...q,labelSize:K}))}else{let K=A.dimensions(c,F).height*1.3;K>0&&(K+=12);const q=$.current;T.withinSizeThreshold(q,K)||($.current=K,M(te=>({...te,labelSize:K})))}},[c,x,F]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(R,u.CSS.B("axis"),u.CSS.B(s),u.CSS.loc(a)),style:{...N,...O},align:"center",justify:a!=="left"?"end":"start",direction:u.g.swap(e),...I,children:B&&o.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS(u.CSS.BE("axis","label"),u.CSS.dir(x)),value:c,onChange:p,level:d})}),o.jsxRuntimeExports.jsx(f.Composite,{path:D,children:l})]})};return r.displayName=`${e.toUpperCase()}Axis`,r},da=sr("x"),xa=sr("y"),pa=u.K.xy.extend({root:u.K$1.corner,units:se.z.object({x:se.z.enum(["px","decimal"]),y:se.z.enum(["px","decimal"])})}),o1=pa.partial({root:!0,units:!0}),r1=e=>{const t={};return t[e.root?.x??"left"]=e?.units?.x==="px"?`${e.x}px`:`${e.x*100}%`,t[e.root?.y??"top"]=e?.units?.y==="px"?`${e.y}px`:`${e.y*100}%`,t},i1=(e,t)=>{const n={x:e.x,y:e.y};if(t.current==null)return n;const s=u.Ho.construct(t.current),r=u.Ho.construct(t.current.parentElement);return e.units?.x==="decimal"?e.root?.x==="right"&&(n.x=1-e.x):e.root?.x==="right"?n.x=1-(e.x+u.Ho.width(s))/u.Ho.width(r):n.x/=u.Ho.width(r),e.units?.y==="decimal"?e.root?.y==="bottom"&&(n.y=1-e.y):e.root?.y==="bottom"?n.y=1-(e.y+u.Ho.height(s))/u.Ho.height(r):n.y/=u.Ho.height(r),n},ma=(e,t)=>{if(t.current==null)return null;const n=u.Ho.construct(t.current.parentElement),s=u.Ho.construct(t.current),r={x:e.x,y:e.y,root:{...u.K$1.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*u.Ho.width(n)-u.Ho.width(s),r.root.x="right"):e.x<.2?r.x=e.x*u.Ho.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*u.Ho.height(n)-u.Ho.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*u.Ho.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...u.K.truncate(r,3)}},yi=u.Ho.reRoot(u.Ho.DECIMAL,u.K$1.TOP_LEFT),l1={x:.1,y:.1,root:u.K$1.TOP_LEFT,units:{x:"decimal",y:"decimal"}},or=j.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,initial:i=l1,...l})=>{const[a,c]=A.usePurePassthrough({value:t,onChange:n,initial:i}),d=j.useRef(a),x=f.useSyncedRef(r===!1),p=j.useRef(null);a!==null&&(s={...s,...r1(a)});const m=j.useCallback(g=>{if(p.current?.parentElement==null)return d.current;const E=u.Ho.construct(p.current.parentElement),S=u.C.XY.scale(E).scale(yi),R=S.box(u.Ho.construct(p.current)),_=u.C.XY.clamp(u.Ho.construct(u.Ho.topLeft(yi),{width:1-u.Ho.width(R),height:1-u.Ho.height(R)})),y=u.K.translate(u.K.construct(d.current),u.Ho.signedDims(S.box(g))),C=_.pos(y);return ma(C,p)},[]),h=Ne.useCursorDrag({onStart:j.useCallback(()=>{d.current=i1(d.current,p)},[]),onMove:j.useCallback(g=>{if(x.current)return;const E=m(g);E!==null&&c(E)},[]),onEnd:j.useCallback(g=>{if(x.current)return;const E=m(g);E!==null&&(d.current=E)},[])});return o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(e,u.CSS.B("legend")),bordered:!0,style:s,onDragStart:h,draggable:r,borderColor:5,ref:p,onDrag:f.preventDefault,onDragEnd:f.preventDefault,background:1,rounded:1,...l})});or.displayName="Legend.Container";const _s=j.memo(({data:e,onEntryChange:t,onVisibleChange:n,allowVisibleChange:s=!0,background:r=1})=>o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e.sort((i,l)=>i.label.localeCompare(l.label)).map(({key:i,color:l,label:a,visible:c=!0})=>o.jsxRuntimeExports.jsxs(f.Box,{style:{cursor:"pointer",height:"3rem"},x:!0,align:"center",gap:"small",justify:"between",grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",align:"center",gap:"small",children:[o.jsxRuntimeExports.jsx(Ne.Swatch,{value:l,onChange:d=>t?.({key:i,color:d,label:a,visible:c}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"tiny"}),o.jsxRuntimeExports.jsx(f.MaybeEditable,{level:"small",value:a,onChange:d=>t?.({key:i,color:l,label:d,visible:c}),overflow:"nowrap",color:c?10:7,onDoubleClick:d=>d.stopPropagation()})]}),s&&o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.B("visible-toggle"),onClick:d=>{d.stopPropagation(),t?.({key:i,color:l,label:a,visible:!c})},onDoubleClick:d=>d.stopPropagation(),size:"tiny",contrast:r,variant:"text",children:c?o.jsxRuntimeExports.jsx(f.Visible,{}):o.jsxRuntimeExports.jsx(f.Hidden,{})})]},i))}));_s.displayName="LegendSwatches";const rr=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,allowVisibleChange:r=!0,background:i=1,...l})=>{const[a,c]=j.useState(!1);return e.length===0?null:o.jsxRuntimeExports.jsx(or,{...l,className:r?u.CSS.M("with-visible-toggle"):void 0,draggable:!a,value:n,onChange:s,gap:r?0:"small",background:i,children:o.jsxRuntimeExports.jsx(_s,{data:e,onEntryChange:t,onVisibleChange:c,allowVisibleChange:r,background:i})})},a1=Object.freeze(Object.defineProperty({__proto__:null,Container:or,LegendSwatches:_s,Simple:rr,calcStickyPos:ma,completeStickyXYz:pa,stickyXYz:o1},Symbol.toStringTag,{value:"Module"})),ir=j.memo(({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=tt("Legend");return tt("Legend"),o.jsxRuntimeExports.jsx(rr,{data:r,onEntryChange:n,...s})});ir.displayName="FloatingLegend";const c1=({onLineChange:e})=>{const{lines:t}=tt("Legend"),n=f.useUniqueKey(),s=Nn({key:n,size:t.length>0?36:0,loc:"bottom",order:5},"Legend");return o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS.BE("legend","container"),align:"center",x:!0,style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 ",width:"fit-content"},children:o.jsxRuntimeExports.jsx(_s,{data:t,onEntryChange:e,background:0})})},fa=({variant:e="floating",...t})=>e==="floating"?o.jsxRuntimeExports.jsx(ir,{...t}):o.jsxRuntimeExports.jsx(c1,{...t}),lr=j.memo(({aetherKey:e,...t})=>(f.useUnidirectional({aetherKey:e,type:T.Line.TYPE,schema:T.stateZ,state:t}),null));lr.displayName="Line";const u1=Object.freeze(Object.defineProperty({__proto__:null,Line:lr},Symbol.toStringTag,{value:"Module"})),ar=({aetherKey:e,color:t,label:n="",visible:s=!0,...r})=>{const i=f.useUniqueKey(e),{setLine:l,removeLine:a}=tt("Line");return j.useEffect(()=>(l({key:i,color:t,label:n,visible:s}),()=>a(i)),[n,t,s]),o.jsxRuntimeExports.jsx(lr,{aetherKey:i,color:t,label:n,visible:s,...r})},ha=({level:e="h2",...t})=>{const n=f.useUniqueKey(),s=ws.useTypography(e),r=Nn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return o.jsxRuntimeExports.jsx(f.Box,{justify:"center",align:"center",style:r,children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{...t,level:e})})},ga=({aetherKey:e,...t})=>{const n=f.useUniqueKey(e),[,,s]=f.use$2({aetherKey:n,type:T.Tooltip.TYPE,schema:T.tooltipStateZ,initialState:{position:null,...t}}),r=j.useRef(null),i=j.useCallback(a=>{const c=document.querySelector(".pluto-canvas-container");if(c==null)return;const d=u.Ho.topLeft(c);s({position:u.K.translation(d,u.K.construct(a))})},[s]),l=j.useCallback(()=>s({position:null}),[s]);return j.useEffect(()=>{if(r.current===null)return;const a=r.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",l),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",l)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:r})},d1=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:ga},Symbol.toStringTag,{value:"Module"})),ja=()=>{const e=j.useRef(new Map),t=j.useCallback(s=>{const{request:r,response:i}=s,l=e.current.get(r);l!=null&&(l(i.bounds),e.current.delete(r))},[]),[,,n]=f.use$2({type:T.BoundQuerier.TYPE,schema:T.boundQuerierStateZ,onAetherChange:t,initialState:{request:"",response:{request:"",bounds:{}}}});return j.useCallback(async()=>await new Promise(s=>{const r=u.$t.create();e.current.set(r,s),n(i=>({...i,request:r}))}),[])},x1=({ref:e})=>(e.current=ja(),null),p1={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer",cancel:"default"},Ea=({className:e,mode:t,maskBox:n,children:s,style:r,...i})=>o.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.noSelect,u.CSS.BE("viewport-mask","container"),e),style:{cursor:p1[t],...r},...i,children:[o.jsxRuntimeExports.jsx("div",{style:{...u.Ho.css(n),display:u.Ho.areaIsZero(n)?"none":"block"},className:u.CSS.BE("viewport-mask","selection")}),s]}),m1=(e,t)=>{for(;e!=null&&!t(e);)e=e.parentElement;return e},f1=11,h1=6,g1=2,Si=5,j1=e=>u.Ho.width(e)<Si&&u.Ho.height(e)<Si,pn=e=>{const t=u.Ho.width(e),n=u.Ho.height(e);return Math.min(t,n)<.001?f1:h1},E1=["zoom","pan","select","zoomReset","cancel"],cr=[...E1,"click"],y1=se.z.enum(cr),ya=["zoom","select"],mn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},Sa={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},Ra={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]],cancel:[["Escape"]]},ur={zoom:mn,pan:Sa,select:Ra,zoomReset:mn,click:mn,cancel:mn},S1=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},R1=u.Ho.construct(0,0,1,1,u.K$1.TOP_LEFT),C1={width:30,height:50},Ca=({onChange:e,triggers:t,initial:n=R1,threshold:s=C1,ref:r})=>{const i=t?.defaultMode??"zoom",[l,a]=j.useState(u.Ho.ZERO),[c,d]=j.useState(i),[x,p]=f.useStateRef(n),m=j.useRef(u.K.ZERO),h=j.useRef(null),g=u._.construct(s);j.useEffect(()=>p(()=>u.Ho.truncate(n,pn(n))),[n]),j.useEffect(()=>d(i),[i]);const[E,S,R,_]=f.useMemoCompare(()=>{const I={...ur[i],...t},B=f.flattenConfig(I),z=S1(I);return[I,B,z,f.flattenConfig(z)]},f.compareModeConfigs,[t]),y=j.useCallback(({box:I,triggers:B,stage:z,cursor:H})=>{if(h.current==null)return;const D=f.determineMode(E,B),V=u.Ho.construct(h.current);if(D==null)return;if(D==="cancel"){a(u.Ho.ZERO),e?.({box:x.current,mode:D,stage:z,cursor:H});return}if(D==="zoomReset")return a(u.Ho.ZERO),e?.({box:u.Ho.DECIMAL,mode:D,stage:z,cursor:H}),p(u.Ho.DECIMAL);const w=j1(I);if(z==="end"){if(w){D==="zoom"&&a(u.Ho.ZERO),e?.({box:x.current,mode:"click",stage:z,cursor:H});return}return p(M=>{if(D==="pan"){const F=Ri(I,M,V);return F===null||u.Ho.equals(F,M)?M:(e?.({box:F,mode:D,stage:z,cursor:H}),F)}const O=C(I,M,V);return O===null?M:(e?.({box:O,mode:D,stage:z,cursor:H}),D==="zoom"?(a(u.Ho.ZERO),O):u.Ho.truncate(M,pn(M)))})}if(ya.includes(D))return w?void 0:a(u.C.XY.scale(V).clamp(V).translate({x:-u.Ho.left(V),y:-u.Ho.top(V)}).box(Ci(g,I,V)));if(a(M=>u.Ho.areaIsZero(M)?M:u.Ho.ZERO),u.K.distance(H,m.current)<g1)return;m.current=H;const k=Ri(I,x.current,V);e?.({box:k,mode:D,stage:z,cursor:H})},[a,d,e,E,s.height,s.width,p,h,pn]);j.useImperativeHandle(r,()=>({reset:()=>{a(u.Ho.ZERO),p(u.Ho.DECIMAL),e?.({box:u.Ho.DECIMAL,mode:"zoomReset",stage:"start",cursor:u.K.ZERO})}}),[e]);const C=j.useCallback((I,B,z)=>{const H=wo(B,z).box(Ci(g,I,z));return u.Ho.truncate(H,pn(H))},[s]),v=f.useHeldRef({triggers:[["Control"]]}),L=f.useHeldRef({triggers:[["Alt"]]});j.useEffect(()=>{const I=B=>{if(h.current==null)return;let z=1;B.deltaY<0?z-=.035:z+=.035;const H=u.Ho.construct(h.current),D=u.K.construct(B);if(Array.from(h.current.children).push(h.current),!u.Ho.contains(H,D)||h.current!==B.target&&m1(B.target,F=>F===h.current)==null)return;const k=wo(x.current,u.Ho.construct(h.current)).pos(u.K.construct(B));let O=u.C.XY.magnify({x:v.current.held?1:z,y:L.current.held?1:z}).box(x.current);O=u.Ho.translate(O,{x:v.current.held?0:k.x*(1-z),y:L.current.held?0:k.y*(1-z)}),p(O),e?.({stage:"end",box:O,cursor:u.K.construct(B),mode:"zoom"})};return window.addEventListener("wheel",I),()=>window.removeEventListener("wheel",I)},[p,e]),$l.useDrag({bound:h,onDrag:y,triggers:S,loose:!0});const N=j.useCallback(({triggers:I,stage:B})=>{if(B==="end")return d(i);const z=f.determineMode(R,I);z!=null&&d(z)},[R,i,e]);return f.use$1({triggers:_,callback:N,region:h}),{maskBox:l,ref:h,mode:c}},wo=(e,t)=>u.C.XY.scale(t).clamp(t).scale(e),Ri=(e,t,n)=>{let s=u.Ho.signedDims(wo(t,n).box(e));s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight};const r=u.C.XY.translate(u.K.construct(s)).box(t);return u.Ho.truncate(r,pn(r))},Ci=(e,t,n)=>u.Ho.height(t)<=e.height?u.Ho.construct(u.Ho.left(t),u.Ho.top(n),u.Ho.width(t),u.Ho.height(n)):u.Ho.width(t)<=e.width?u.Ho.construct(u.Ho.left(n),u.Ho.top(t),u.Ho.width(n),u.Ho.height(t)):t,so=({mode:e,triggers:t})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",children:[o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:u.z.capitalize(e)}),o.jsxRuntimeExports.jsx(f.Box,{empty:!0,x:!0,align:"center",children:o.jsxRuntimeExports.jsx(f.Text$1,{trigger:t[0],level:"small"})})]}),w1=({triggers:e,value:t,onChange:n,disable:s=["zoomReset","click","cancel"],...r})=>{const i=j.useMemo(()=>cr.filter(l=>!s.includes(l)),[s]);return o.jsxRuntimeExports.jsxs(pe.Buttons,{...r,keys:i,value:t,onChange:n,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"zoom",tooltip:o.jsxRuntimeExports.jsx(so,{mode:"zoom",triggers:e.zoom}),size:"small",children:o.jsxRuntimeExports.jsx(f.Zoom,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pan",tooltip:o.jsxRuntimeExports.jsx(so,{mode:"pan",triggers:e.pan}),size:"small",children:o.jsxRuntimeExports.jsx(f.Pan,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"select",tooltip:o.jsxRuntimeExports.jsx(so,{mode:"select",triggers:e.select}),size:"small",children:o.jsxRuntimeExports.jsx(f.Selection,{})})]})},b1=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:ur,MASK_MODES:ya,MODES:cr,Mask:Ea,PAN_DEFAULT_TRIGGERS:Sa,SELECT_DEFAULT_TRIGGERS:Ra,SelectMode:w1,ZOOM_DEFAULT_TRIGGERS:mn,modeZ:y1,use:Ca},Symbol.toStringTag,{value:"Module"})),v1=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,wa=({ref:e,children:t,initial:n=u.Ho.DECIMAL,onChange:s,...r})=>{const{setViewport:i}=tt("Viewport");j.useLayoutEffect(()=>{i({box:n,mode:"zoom",cursor:u.K.ZERO,stage:"start"})},[i,n]);const l=j.useCallback(c=>{i(c),s?.(c)},[s,i]),a=Ca({onChange:l,initial:n,ref:e,...r});return o.jsxRuntimeExports.jsx(Ea,{className:u.CSS.BE("line-plot","viewport"),...a,children:t})},_1=Object.freeze(Object.defineProperty({__proto__:null,BoundsQuerier:x1,Floating:ir,Legend:fa,Line:ar,LinePlot:ua,Title:ha,Tooltip:d1,Viewport:wa,XAxis:da,YAxis:xa,axisFactory:sr,selectViewportEl:v1,useBoundQuerier:ja,useContext:tt,useGridEntry:Nn,useViewport:ca},Symbol.toStringTag,{value:"Module"})),k1=({aetherKey:e,...t})=>(f.use$2({aetherKey:e,type:T.Annotation.TYPE,schema:T.annotationStateZ,initialState:t}),null),ba=({aetherKey:e,menu:t,...n})=>{const s=f.useUniqueKey(e),{setViewport:r,setHold:i}=tt("Range.Provider"),[,{hovered:l,count:a},c]=f.use$2({aetherKey:s,type:T.Provider.TYPE,schema:T.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),d=Nn({key:s,loc:"top",size:a>0?32:0,order:3},"Annotation.Provider"),x=f.useContextMenu(),p=f.useSyncedRef(x.visible),m=j.useCallback(g=>c(E=>({...E,cursor:{x:g.clientX,y:g.clientY}})),[c]),h=j.useCallback(()=>{p.current||c(g=>({...g,cursor:null}))},[c,p]);return o.jsxRuntimeExports.jsx(f.ContextMenu,{...x,menu:()=>t==null||l==null?null:t(l),children:o.jsxRuntimeExports.jsx(f.Box,{style:{...d,cursor:l!=null?"pointer":"default",width:"100%",height:"100%"},onContextMenu:x.open,className:x.className,onClick:()=>{l!=null&&(r({box:u.Ho.construct({x:l.viewport.lower,y:0},{x:l.viewport.upper,y:1}),mode:"zoom",cursor:u.K.ZERO,stage:"start"}),i(!0))},onMouseMove:m,onMouseLeave:h})})},L1=Object.freeze(Object.defineProperty({__proto__:null,Annotation:k1,Provider:ba},Symbol.toStringTag,{value:"Module"})),va={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},M1=f.flattenConfig(va),_a=({aetherKey:e})=>{const t=f.useUniqueKey(e),[,,n]=f.use$2({aetherKey:t,type:T.Measure.TYPE,schema:T.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=j.useRef(null),r=f.useHeldRef({triggers:M1,loose:!0}),i=j.useCallback(({mode:c,cursor:d})=>{if(c==="click"){const x=f.determineMode(va,r.current.triggers,{loose:!0});if(["one","two"].includes(x))return n(p=>({...p,[x]:d}));n(x==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??d,two:p.one!==null?d:p.two}))}},[n,r]);ca(i);const l=j.useCallback(c=>n(d=>({...d,hover:u.K.construct(c)})),[n]),a=j.useCallback(()=>{n(c=>({...c,hover:null}))},[n]);return j.useEffect(()=>{if(s.current===null)return;const c=s.current.parentElement;if(c!=null)return c.addEventListener("mousemove",l),c.addEventListener("mouseleave",a),()=>{c.removeEventListener("mousemove",l),c.removeEventListener("mouseleave",a)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:s})},P1=Object.freeze(Object.defineProperty({__proto__:null,Measure:_a},Symbol.toStringTag,{value:"Module"})),dr=({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:r,onUnitsChange:i,units:l="",color:a,lineWidth:c,lineDash:d,className:x,onSelect:p,style:m,...h})=>{const[g,E]=A.usePurePassthrough({value:t,onChange:s,initial:""}),S=f.useSyncedRef(r),[,{pixelPosition:R},_]=f.use$2({aetherKey:e,type:T.Rule.TYPE,schema:T.ruleStateZ,initialState:{color:a,dragging:!1,position:n,lineWidth:c,lineDash:d},onAetherChange:j.useCallback(({position:D})=>{D!=null&&S.current?.(D)},[S])}),y=j.useRef(R);R!==y.current&&(y.current=R);const{id:C}=tt("Rule"),L=document.getElementById(C)?.querySelector(".pluto-line-plot__viewport"),N=j.useRef(R);j.useEffect(()=>{_(D=>({...D,position:n,color:a,lineWidth:c,lineDash:d}))},[n,a,c,d]);const I=Ne.useCursorDrag({onStart:j.useCallback(()=>{p?.(),_(D=>({...D,dragging:!0})),N.current=y.current},[]),onMove:D=>{_(V=>({...V,pixelPosition:(N.current??0)+u.Ho.signedHeight(D)}))},onEnd:j.useCallback(()=>{_(D=>({...D,dragging:!1})),N.current=R},[])}),B=j.useRef(null);if(n==null||R==null)return null;const z=u.ir.pickByContrast(a,u.ir.BLACK,u.ir.WHITE),H=o.jsxRuntimeExports.jsxs("div",{ref:B,className:u.CSS.B("rule"),style:{top:`calc(${R}px - 0.5rem)`},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("rule","drag-handle"),onDragStart:I,draggable:!0}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",className:u.CSS(x,u.CSS.BE("rule","tag")),bordered:!0,onClick:p,empty:!0,rounded:!0,style:{borderColor:u.ir.cssString(a),backgroundColor:u.ir.hex(u.ir.setAlpha(a,.7)),...m},...h,children:[o.jsxRuntimeExports.jsx(f.Editable,{className:u.CSS.BE("rule","label"),level:"small",value:g,onChange:E,color:z}),o.jsxRuntimeExports.jsx(f.Divider$1,{y:!0,style:{borderColor:u.ir.cssString(a)}}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",className:u.CSS.BE("rule","value"),children:[o.jsxRuntimeExports.jsx(f.Editable,{value:n.toFixed(2),onChange:D=>{const V=Number(D);isFinite(V)&&r?.(V)},level:"small",color:z}),l.length>0&&o.jsxRuntimeExports.jsx(f.MaybeEditable,{level:"small",color:z,value:l,onChange:i})]})]})]});return L==null?H:Bl.createPortal(H,L)},N1=Object.freeze(Object.defineProperty({__proto__:null,Rule:dr},Symbol.toStringTag,{value:"Module"})),ka=f.canDropOfType(bt),T1=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:r,showLegend:i=!0,legendPosition:l,onLegendPositionChange:a,titleLevel:c="h4",onLineChange:d,onRuleChange:x,onAxisChannelDrop:p,onAxisChange:m,rules:h,enableTooltip:g=!0,enableMeasure:E=!1,initialViewport:S=u.Ho.DECIMAL,legendVariant:R,onViewportChange:_,viewportTriggers:y,rangeAnnotationProvider:C,onSelectRule:v,children:L,...N})=>{const I=t.filter(({location:V})=>u.K$1.isY(V)),B=j.useRef(null),z=f.usePrevious(e.length),H=f.usePrevious(N.hold),D=z===0&&e.length!==0||H===!0&&N.hold===!1;return j.useEffect(()=>{D&&B.current?.reset()},[D]),o.jsxRuntimeExports.jsxs(ua,{...N,children:[I.map((V,w)=>{const k=e.filter(F=>F.axes.x===V.key),M=t.filter(({location:F})=>u.K$1.isX(F)),O=h?.filter(F=>[...M.map(({key:$})=>$),V.key].includes(F.axis));return o.jsxRuntimeExports.jsx(A1,{axis:V,index:w,lines:k,yAxes:M,rules:O,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:C,onRuleChange:x,onSelectRule:v},V.key)}),i&&o.jsxRuntimeExports.jsx(fa,{onLineChange:d,position:l,onPositionChange:a,variant:R}),n&&o.jsxRuntimeExports.jsx(ha,{value:s,onChange:r,level:c}),o.jsxRuntimeExports.jsxs(wa,{initial:S,onChange:_,triggers:y,ref:B,children:[g&&o.jsxRuntimeExports.jsx(ga,{}),E&&o.jsxRuntimeExports.jsx(_a,{}),L]})]})},A1=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:r,onSelectRule:i,onAxisChannelDrop:l,onAxisChange:a,axis:{location:c,key:d,showGrid:x,...p},annotationProvider:m})=>{const h=f.useDrop({type:"Channel.LinePlot.XAxis",canDrop:ka,onDrop:j.useCallback(({items:S})=>{const R=f.filterByType(bt,S);return l?.(d,R.map(({key:_})=>_)),R},[d,l])}),g=s?.filter(S=>S.axis===d),E=f.useDraggingState();return o.jsxRuntimeExports.jsxs(da,{...p,...h,location:c,axisKey:d,showGrid:x??n===0,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(bt)(E))),onAutoBoundsChange:S=>a?.({key:d,bounds:S}),onLabelChange:S=>a?.({key:d,label:S}),children:[e.map((S,R)=>{const _=t.filter(C=>C.axes.y===S.key),y=s?.filter(C=>C.axis===S.key);return o.jsxRuntimeExports.jsx(O1,{axis:{...S,showGrid:x??(n===0&&R===0)},lines:_,rules:y,onRuleChange:r,onAxisChannelDrop:l,onAxisChange:a,onSelectRule:i},S.key)}),g?.map(S=>j.createElement(dr,{aetherKey:S.key,...S,key:S.key,onLabelChange:R=>r?.({key:S.key,label:R}),onPositionChange:R=>r?.({key:S.key,position:R}),onUnitsChange:R=>r?.({key:S.key,units:R}),onSelect:()=>i?.(S.key)})),o.jsxRuntimeExports.jsx(ba,{...m})]})},I1=({channels:{x:e,y:t}})=>`${e??0}-${t}`,O1=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:i,location:l,...a},onSelectRule:c})=>{const d=f.useDrop({type:"Channel.LinePlot.YAxis",canDrop:ka,onDrop:j.useCallback(({items:p})=>{const m=f.filterByType(bt,p);return s?.(i,m.map(({key:h})=>h)),m},[i,s])}),x=f.useDraggingState();return o.jsxRuntimeExports.jsxs(xa,{...a,...d,location:l,axisKey:i,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(bt)(x))),onAutoBoundsChange:p=>r?.({key:i,bounds:p}),onLabelChange:p=>r?.({key:i,label:p}),children:[e.map(p=>o.jsxRuntimeExports.jsx(D1,{line:p},I1(p))),t?.map(p=>j.createElement(dr,{aetherKey:p.key,...p,key:p.key,onLabelChange:m=>n?.({key:p.key,label:m}),onPositionChange:m=>n?.({key:p.key,position:m}),onUnitsChange:m=>n?.({key:p.key,units:m}),onClick:()=>c?.(p.key)}))]})},D1=({line:e})=>e.variant==="static"?o.jsxRuntimeExports.jsx($1,{line:e}):o.jsxRuntimeExports.jsx(B1,{line:e}),B1=({line:{key:e,timeSpan:t,channels:{x:n,y:s},axes:r,...i}})=>{const{xTelem:l,yTelem:a}=j.useMemo(()=>{const c=Number(t.valueOf())*3,d=T.streamChannelData({timeSpan:t,channel:s,keepFor:c}),x=n!=null&&n!==0;return{xTelem:T.streamChannelData({timeSpan:t,channel:x?n:s,useIndexOfChannel:!x,keepFor:c}),yTelem:d}},[t.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(ar,{aetherKey:e,y:a,x:l,...i},e)},$1=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const{xTelem:i,yTelem:l}=j.useMemo(()=>{const a=T.channelData({timeRange:e,channel:s}),c=n!=null&&n!==0;return{xTelem:T.channelData({timeRange:e,channel:c?n:s,useIndexOfChannel:!c}),yTelem:a}},[e.start.valueOf(),e.end.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(ar,{aetherKey:t,y:l,x:i,...r},t)},vt=(e,t,n)=>({variant:"loading",status:u._r.create({variant:"loading",message:`${u.z.capitalize(t)} ${e}`}),data:n}),Je=(e,t,n)=>({variant:"success",status:u._r.create({variant:"success",message:`${u.z.capitalize(t)} ${e}`}),data:n}),Zt=(e,t,n)=>({variant:"error",status:u._r.fromException(n,`Failed to ${t} ${e}`),data:void 0}),ks=(e,t)=>({variant:"disabled",status:u._r.create({variant:"disabled",message:`Failed to ${t} ${e}`,description:`Cannot ${t} ${e} because no cluster is connected.`}),data:void 0}),gn={...T.ZERO_CONTEXT_VALUE,state:A.sm.connectivity.DEFAULT},xr=j.createContext(gn),La=()=>j.use(xr),tn=()=>La().client,z1=()=>La().state,bo={connected:"success",connecting:"loading",disconnected:"disabled",failed:"error"},Ma="serverVersionMismatch",V1=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,H1=({children:e,client:t})=>{const{path:n}=f.useUnidirectional({type:T.Provider$1.TYPE,schema:T.Provider$1.stateZ,state:{props:null,state:null}});return o.jsxRuntimeExports.jsx(xr,{value:{...gn,client:t},children:o.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})})},Pa=({children:e,connParams:t})=>{const[n,s,r]=f.useCombinedStateAndRef(gn),{path:i}=f.useUnidirectional({type:T.Provider$1.TYPE,schema:T.Provider$1.stateZ,state:{props:t??null,state:null}}),l=f.useAdder(),a=j.useCallback(c=>{r.current.state.status!==c.status&&l({variant:bo[c.status],message:c.message??u.z.capitalize(c.status)}),s(d=>({...d,state:c}))},[l]);return Jt(async c=>{if(n.client!=null&&n.client.close(),t==null)return s(gn);const d=new A.sm({...t,connectivityPollFrequency:A.O$1.seconds(2)});s({client:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(!c.aborted){if(s({client:d,state:x}),l({variant:bo[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||u.pr.semVerOlder(x.nodeVersion,x.clientVersion),m=V1(p,x.clientVersion,x.nodeVersion);l({variant:"warning",message:"Incompatible cluster version",description:m,details:{type:Ma,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(a),()=>{d.close(),s(gn)}}},[t,a]),o.jsxRuntimeExports.jsx(xr,{value:n,children:o.jsxRuntimeExports.jsx(f.Composite,{path:i,children:e})})},F1=Object.freeze(Object.defineProperty({__proto__:null,CONNECTION_STATE_VARIANTS:bo,Provider:Pa,SERVER_VERSION_MISMATCH:Ma,TestProvider:H1,use:tn,useConnectionState:z1},Symbol.toStringTag,{value:"Module"})),Na=j.createContext(null),Fe=e=>{const t=f.useRequiredContext(Na),n=f.useUniqueKey(e);return j.useMemo(()=>t.scopedStore(n),[t,n])},Ta=({children:e,...t})=>{const n=tn(),s=f.useErrorHandler(),r=f.useAsyncErrorHandler(),{path:i}=f.useLifecycle({type:T.PROVIDER_TYPE,schema:T.providerStateZ$1,initialState:{}}),l=()=>"client"in t?t.client:new T.Client({client:n,storeConfig:t.storeConfig,handleError:s,handleAsyncError:r}),a=f.useInitializerRef(l),c=j.useRef(null);return n?.key!==c.current?.key&&(c.current=n,a.current=l()),o.jsxRuntimeExports.jsx(f.Composite,{path:i,children:o.jsxRuntimeExports.jsx(Na,{value:a.current,children:e})})},Aa=e=>{const[t,n]=j.useState(vt(e.name,"retrieving",void 0));return{...t,...Ia({...e,onChange:n})}},Ia=({retrieve:e,mountListeners:t,name:n,onChange:s,scope:r})=>{const i=tn(),l=j.useRef(null),a=Fe(r),c=Uo(),d=j.useCallback(async(p,m={})=>{const{signal:h}=m,g=A.executeSetter(p,l.current??{});l.current=g;try{if(i==null)return s(ks(n,"retrieve"));if(s(S=>vt(n,"retrieving",S.data)),h?.aborted)return;const E=await e({client:i,params:g,store:a});if(h?.aborted)return;c.cleanup(),c.set(t?.({client:i,store:a,params:g,onChange:S=>s(R=>{if(R.data===void 0)return R;const _=A.executeSetter(S,R.data);return Je(n,"retrieved",_)})})),s(Je(n,"retrieved",E))}catch(E){if(h?.aborted)return;s(Zt(n,"retrieve",E))}},[i,n]);return{retrieve:j.useCallback((p,m)=>void d(p,m),[d]),retrieveAsync:d}},Z1=({params:e,...t})=>{const{retrieveAsync:n,retrieve:s,...r}=Aa(t),i=f.useMemoDeepEqual(e);return Jt(async l=>await n(i,{signal:l}),[n,i]),r},K1=({params:e,...t})=>{const{retrieveAsync:n}=Ia(t),s=f.useMemoDeepEqual(e);Jt(async r=>await n(s,{signal:r}),[n,s])},Ze=e=>({useDirect:t=>Z1({...e,...t}),useStateful:()=>Aa(e),useEffect:t=>K1({...e,...t})}),Oa=({onChange:e,params:t,update:n,name:s,scope:r})=>{const i=tn(),l=Fe(r),a=j.useCallback(async(d,x={})=>{const{signal:p}=x;try{if(i==null)return e(ks(s,"update")),!1;e(h=>vt(s,"updating",h.data));let m=!1;return await n({client:i,onChange:h=>{m=!0,e(Je(s,"updated",h))},value:d,params:t,store:l}),p?.aborted===!0?!1:(m||e(Je(s,"updated",d)),!0)}catch(m){return p?.aborted!==!0&&e(Zt(s,"update",m)),!1}},[s,t]);return{update:j.useCallback((d,x)=>void a(d,x),[a]),updateAsync:a}},Y1=({params:e,name:t,...n})=>{const[s,r]=j.useState(Je(t,"updated",void 0)),i=Oa({...n,name:t,onChange:r,params:e});return{...s,...i}},st=e=>({useObservable:t=>Oa({...t,...e}),useDirect:t=>Y1({...t,...e})}),pr=j.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:()=>{},setCurrentStateAsInitialValues:()=>{}}),nn=e=>{const t=j.use(pr);return e??t},jt=(e,t={})=>{const{optional:n=!1,onChange:s,defaultValue:r}=t,i=nn(t?.ctx),{get:l,bind:a,set:c,setStatus:d}=i,x=j.useCallback(g=>{s?.(g,{...i,path:e}),c(e,g)},[e,c,s]),p=j.useCallback(g=>d(e,g),[e,d]),m=j.useSyncExternalStore(a,j.useCallback(()=>l(e,{optional:n,defaultValue:r}),[e,l,n,r]));if(m==null){if(!n)throw new Error(`Field state is null: ${e}`);return null}const h=i.mode==="preview"?"preview":void 0;return{onChange:x,setStatus:p,variant:h,...m}},mr=(e,t)=>{const{get:n,bind:s}=nn(t?.ctx);return j.useSyncExternalStore(s,j.useCallback(()=>n(e,t),[e,n,t]))},fr=(e,t)=>mr(e,t)?.value??null,W1=e=>mr(e,{optional:!0})?.status?.variant==="success",Da=(e,t)=>({value:()=>e.get(t).value,add:(n,s)=>{const r=u.br(e.get(t).value);r.splice(s,0,...A.t.toArray(n)),e.set(t,r)},push:(n,s)=>{const r=u.br(e.get(t).value);r.push(...A.t.toArray(n)),s!=null&&r.sort(s),e.set(t,r)},remove:n=>{const s=e.get(t).value,r=new Set(A.t.toArray(n)),i=s.filter(({key:l})=>!r.has(l));return e.set(t,i),i.map(({key:l})=>l)},keepOnly:n=>{const s=e.get(t).value,r=new Set(A.t.toArray(n)),i=s.filter(({key:l})=>r.has(l));return e.set(t,i),i.map(({key:l})=>l)},set:n=>e.set(t,A.executeSetter(n,e.get(t).value)),sort:n=>{const s=u.br(e.get(t).value);s.sort(n),e.set(t,s)}}),G1=(e,t={})=>{const n=nn(t?.ctx),s=fr(e,t);return j.useMemo(()=>({data:s.map(({key:r})=>r),...Da(n,e)}),[s,n,e])},U1=f.renderProp(e=>o.jsxRuntimeExports.jsx(f.Text$2,{...e})),Ee=({path:e,children:t=U1,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:i=!1,optional:l,onChange:a,className:c,defaultValue:d,...x})=>{const p=jt(e,{optional:l??i,onChange:a,defaultValue:d}),m=nn();if(p==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??=u.z.capitalize(A.N.element(e,-1)),r=typeof r=="function"?r(p,m):r,!r)return null;const h=p.status.message,{onChange:g,value:E}=p,S={onChange:g,value:E};return p.variant!=null&&(S.variant=p.variant),o.jsxRuntimeExports.jsx(Ae.Item,{padHelpText:s,helpText:h,status:p.status.variant,label:n,required:p.required,className:u.CSS(c,u.CSS.BE("field",e.split(".").join("-")),u.CSS.M(p.status.variant)),...x,children:t(S)})},Tn=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:i,path:l,fieldKey:a=t,optional:c,defaultValue:d,...x})=>o.jsxRuntimeExports.jsx(Ee,{...n,...x,defaultValue:d,optional:c,path:a?`${l}.${a}`:l,children:p=>o.jsxRuntimeExports.jsx(e,{...p,...s,...i})});return r.displayName=e.displayName,r},Ba=Tn(f.Numeric),$e=Ba({inputProps:{}}),$a=Tn(f.Text$2),hr=$a({inputProps:{}}),za=Tn(f.Switch$1),Ls=za({inputProps:{}}),X1=e=>Tn(Mn)(e),q1=({children:e,...t})=>o.jsxRuntimeExports.jsx(pr,{value:t,children:e}),Q1=e=>e.code==="custom"&&e.params!=null&&"variant"in e.params?e.params.variant:"error";class J1 extends T.a.Observer{schema;values;initialValues;statuses;touched;cachedRefs;constructor(t,n){super(),this.schema=n,this.values=A.N.copy(t),this.statuses=new Map,this.touched=new Set,this.cachedRefs=new Map,this.initialValues=A.N.copy(this.values)}setValue(t,n){t==""?this.values=A.N.copy(n):A.N.set(this.values,t,n),this.checkTouched(t,n),this.updateCachedRefs(t)}checkTouched(t,n){const s=A.N.get(this.initialValues,t,{optional:!0});A.N.equal(s,n)?(this.clearTouched(t),this.clearOrphanedTouchedPaths(t)):this.setTouched(t)}clearOrphanedTouchedPaths(t){const n=new Set;this.touched.forEach(s=>{A.N.pathsMatch(s,t)&&s!==t&&!A.N.has(this.values,s)&&n.add(s)}),n.forEach(s=>{this.touched.delete(s),this.cachedRefs.delete(s)})}setStatus(t,n){this.statuses.set(t,n),this.updateCachedRefs(t)}clearStatus(t=""){this.statuses.delete(t),this.updateCachedRefs(t)}reset(t){if(A.N.equal(this.values,t??this.initialValues))return;t!=null&&(this.initialValues=A.N.copy(t));const n=A.N.copy(this.initialValues);this.statuses.clear(),this.touched.clear();const s=new Set;this.cachedRefs.forEach((r,i)=>{const l=A.N.get(this.values,i,{optional:!0}),a=A.N.get(n,i,{optional:!0});A.N.equal(l,a)||s.add(i)}),s.forEach(r=>this.cachedRefs.delete(r)),this.values=n}setCurrentStateAsInitialValues(){this.initialValues=A.N.copy(this.values),this.touched.clear(),this.cachedRefs.clear()}setTouched(t){this.touched.add(t),this.updateCachedRefs(t)}clearTouched(t=""){t===""?this.touched.clear():this.touched.delete(t),this.updateCachedRefs(t),this.notify()}remove(t){A.N.remove(this.values,t),this.statuses.delete(t),this.clearTouched(t),this.cachedRefs.delete(t)}validate(t,n){if(this.schema==null)return!0;const s=this.schema.safeParse(this.values);return this.processValidation(t,s,n)}async validateAsync(t,n){if(this.schema==null)return!0;const s=await this.schema.safeParseAsync(this.values);return this.processValidation(t,s,n)}errorsToStatuses(t,n,s){return t.forEach(r=>{const i=[...n,...r.path],l=A.N.resolvePath(i.join("."),this.values);if(s.push({key:l,variant:Q1(r),message:r.message}),r.code==="invalid_union"&&r.errors!=null&&r.errors.length>0){const a=r.errors.map(d=>d.filter(x=>A.N.has(this.values,[...i,...x.path].join("."))));a.sort((d,x)=>d.length-x.length);const c=a.find(d=>d.length>0);if(c==null)return;this.errorsToStatuses(c,i,s)}}),s}processValidation(t=!1,n,s){if(this.schema==null)return!0;const r=new Set;if(this.statuses.forEach((a,c)=>{a.variant!=="success"&&r.add(c)}),r.forEach(a=>this.clearStatus(a)),n.success)return!0;let i=!0;return this.errorsToStatuses(n.error.issues,[],[]).forEach(a=>{const{key:c,message:d,variant:x}=a;if(c==null)return;const p=s==null||A.N.pathsMatch(c,s)||A.N.pathsMatch(s,c),m=t||this.touched.has(c);!p||!m||(x!=="warning"&&(i=!1),this.setStatus(c,{key:c,variant:x,message:d}))}),i}get hasBeenTouched(){return this.touched.size>0}getState(t,n={}){const{optional:s=!1,defaultValue:r=void 0}=n,i=u.hr.getOrSetDefault(this.cachedRefs,t,{});let l=A.N.get(this.values,t,{optional:s||r!=null});if(l==null){if(r==null)return null;l=r,this.setValue(t,l)}if(i.value=l,i.required=!1,this.schema!=null){const a=sg.getFieldSchema(this.schema,t,{optional:!0});a!=null&&(i.required=!a.safeParse(void 0).success)}return i.status=u.hr.getOrSetDefault(this.statuses,t,{key:t,variant:"success",message:""}),i.touched=this.touched.has(t),i}updateCachedRefs(t){this.cachedRefs.forEach((n,s)=>{(A.N.pathsMatch(s,t)||A.N.pathsMatch(t,s))&&this.cachedRefs.set(s,{})})}}const gr=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r,onHasTouched:i})=>{const l=f.useInitializerRef(()=>new J1(e,n)),a=f.useSyncedRef(r),c=f.useErrorHandler(),d=f.useSyncedRef(i),x=j.useCallback(()=>{l.current.setCurrentStateAsInitialValues(),d.current?.(!1)},[]),p=j.useCallback(v=>l.current.onChange(v),[]),m=j.useCallback((v,L)=>l.current.getState(v,L),[]),h=j.useCallback(v=>{l.current.remove(v),l.current.notify()},[]),g=j.useCallback(v=>{const L=l.current.values,N=l.current.hasBeenTouched;l.current.reset(v),L!==l.current.values&&a.current?.({values:l.current.values,path:"",prev:L,valid:!0}),l.current.notify();const B=l.current.hasBeenTouched;B!==N&&d.current?.(B)},[]),E=j.useCallback(async v=>{const L=await l.current.validateAsync(!0,v);return l.current.notify(),L},[]),S=j.useCallback(v=>{const L=l.current.validate(!0,v);return l.current.notify(),L},[]),R=j.useCallback((v,L)=>{const N=A.N.get(l.current.values,v,{optional:!0}),I=l.current.hasBeenTouched;l.current.setValue(v,L);const B=()=>{a.current?.({values:l.current.values,path:v,prev:N,valid:!0}),l.current.notify();const z=l.current.hasBeenTouched;z!==I&&d.current?.(z)};try{l.current.validate()}catch{return c(async()=>{await l.current.validateAsync(),B()},"Failed to validate form")}B()},[]),_=j.useCallback(v=>A.N.has(l.current.values,v),[]),y=j.useCallback((v,L)=>{const N=l.current.hasBeenTouched;l.current.setStatus(v,L),l.current.notify();const I=l.current.hasBeenTouched;I!==N&&d.current?.(I)},[]),C=j.useCallback(()=>{l.current.clearStatus(),l.current.notify()},[]);return j.useEffect(()=>{t&&(l.current.reset(e),l.current.notify())},[t,e]),j.useMemo(()=>({bind:p,set:R,get:m,mode:s,validate:S,validateAsync:E,value:()=>l.current.values,has:_,remove:h,setStatus:y,clearStatuses:C,reset:g,setCurrentStateAsInitialValues:x}),[p,R,m,S,E,_,h,y,C,g,s,x])},Va=({key:e,open:t,onChange:n})=>{const s=f.useMemoPrimitiveArray(e);Jt(async()=>{if(t==null)return;const r=await t();if(r==null)return;const i=r.onChange(n);return async()=>{i(),await r.close()}},[t==null,s])},e0=Object.freeze(Object.defineProperty({__proto__:null,useListener:Va},Symbol.toStringTag,{value:"Module"})),t0=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:i,applyObservable:l,...a})=>{const c=tn(),d=f.useErrorHandler(),x=f.useMemoPrimitiveArray(e),p=gr({values:s,...a,sync:!1,onChange:g=>{c!=null&&d(async()=>{await i?.({...g,client:c})},`Failed to apply changes for ${t}`)}});Jt(async()=>{if(c!=null)try{const g=await n({client:c});p.set("",g)}catch(g){d(g,`Failed to retrieve ${t}`)}},[x,c?.key]);const m=j.useCallback(async()=>{if(c!=null)return await r?.(c)},[x,c?.key]),h=j.useCallback(g=>l?.({changes:g,ctx:p}),[x,l]);return Va({key:x,open:m,onChange:h}),p},n0=Object.freeze(Object.defineProperty({__proto__:null,Context:pr,Field:Ee,Form:q1,NumericField:$e,SwitchField:Ls,TextField:hr,buildNumericField:Ba,buildSelectField:X1,buildSwitchField:za,buildTextField:$a,fieldBuilder:Tn,fieldListUtils:Da,use:gr,useContext:nn,useField:jt,useFieldList:G1,useFieldState:mr,useFieldValid:W1,useFieldValue:fr,useSynced:t0},Symbol.toStringTag,{value:"Module"})),sn=({name:e,schema:t,retrieve:n,mountListeners:s,update:r,initialValues:i})=>{const l=Ze({name:e,retrieve:n,mountListeners:s}),a=st({name:e,update:r});return({params:c,initialValues:d,autoSave:x=!1,afterSave:p,sync:m,onHasTouched:h,mode:g,scope:E})=>{const[S,R,_]=f.useCombinedStateAndRef(vt(e,"retrieving",void 0)),y=f.useUniqueKey(E),C=f.useAdder(),v=gr({schema:t,values:d??i,onChange:({path:B})=>{x&&B!==""&&I()},sync:m,onHasTouched:h,mode:g}),L=j.useCallback(B=>{_.current.data!=null&&(_.current.data=v.value());const z=A.executeSetter(B,_.current);_.current=z,z.data!=null&&v.reset(z.data),R(z),z.variant==="error"&&C(z.status)},[v]);l.useEffect({params:c,onChange:L,scope:y});const{updateAsync:N}=a.useObservable({params:c,onChange:L,scope:y}),I=j.useCallback(B=>void(async()=>{try{if(!await v.validateAsync()||!await N(v.value(),B))return;p?.({form:v,params:c})}catch(z){R(Zt(e,"update",z))}})(),[v,N,p,c]);return{form:v,save:I,...S}}},s0=()=>!0,o0=u.a.milliseconds(100),Ke=({name:e,mountListeners:t,retrieve:n,retrieveByKey:s})=>(r={})=>{const{filter:i=s0,sort:l,initialParams:a,retrieveDebounce:c=o0}=r,d=f.useSyncedRef(i),x=f.useSyncedRef(l),p=tn(),m=j.useRef(new Map),h=f.useInitializerRef(()=>new Map),[g,E,S]=f.useCombinedStateAndRef(vt(e,"retrieving",void 0)),R=j.useRef(!0),_=j.useRef(a??null),y=Uo(),C=Fe(),v=j.useCallback(D=>h.current.forEach((V,w)=>{V===D&&w()}),[h.current]),L=j.useCallback(D=>{if(x.current==null)return D;const V=D.map(w=>m.current.get(w)).filter(w=>w!=null);return V.sort(x.current),V.map(w=>w.key)},[x]),N=j.useCallback(async(D,V={})=>{const{signal:w,mode:k="replace"}=V,M=A.executeSetter(D,_.current??{});_.current=M;try{if(p==null)return E(ks(e,"retrieve"));if(E($=>vt(e,"retrieving",$.data)),k==="replace")R.current=!0;else if(k==="append"&&!R.current)return E($=>Je(e,"retrieved",$.data??[]));let O=await n({client:p,params:M,store:C});if(w?.aborted)return;O=O.filter(d.current),x.current!=null&&(O=O.sort(x.current)),O.length===0&&(R.current=!1);const F=O.map($=>$.key);return y.cleanup(),y.set(t?.({client:p,store:C,params:M,onDelete:$=>{m.current.delete($),E(Z=>Z.data==null?Z:{...Z,data:Z.data.filter(K=>K!==$)})},onChange:($,Z,K={})=>{const{mode:q="append"}=K,te=m.current.get($)??null;if(te!=null&&!d.current(te))return;const J=A.executeSetter(Z,te);J==null||!d.current(J)||(m.current.set($,J),E(oe=>{if(oe.data==null)return oe;let ne;if(te==null)x.current!=null?ne=L([...oe.data,$]):ne=q==="prepend"?[$,...oe.data]:[...oe.data,$];else if(x.current!=null){const re=oe.data.indexOf($),ee=L(oe.data),ie=ee.indexOf($);re!==ie?ne=ee:ne=oe.data}else ne=oe.data;return{...oe,data:ne}}),v($))}})),S.current.data!=null&&u.k.primitiveArrays(S.current.data,F)===u.k.EQUAL?E($=>Je(e,"retrieved",$.data??[])):(O.forEach($=>m.current.set($.key,$)),E($=>{if(k==="replace"||$.data==null)return Je(e,"retrieved",F);const Z=new Set(F);return Je(e,"retrieved",[...$.data.filter(K=>!Z.has(K)),...F])}))}catch(O){if(w?.aborted)return;E(Zt(e,"retrieve",O))}},[p,e,C,d]),I=j.useCallback((D,V={})=>{const{signal:w}=V;(async()=>{try{if(p==null||u.O.isZero(D))return;const k=await s({client:p,key:D,params:_.current??{},store:C});if(w?.aborted||k==null)return;if(!d.current(k)){m.current.set(D,null);return}m.current.set(D,k),v(D)}catch(k){if(w?.aborted)return;m.current.set(D,null),E(Zt(e,"retrieve",k))}})()},[s,p,v]),B=j.useCallback(D=>{if(D==null)return;if(Array.isArray(D))return D.map(w=>B(w)).filter(w=>w!=null);const V=m.current.get(D);return V===void 0&&I(D),V},[I]),z=j.useCallback((D,V)=>V==null?()=>{}:(h.current.set(D,V),()=>h.current.delete(D)),[]);return{retrieve:Ne.useDebouncedCallback((D,V={})=>void N(D,V),new u.a(c).milliseconds,[N]),retrieveAsync:N,subscribe:z,getItem:B,...g,data:g?.data??[]}},r0=({key:e,subscribe:t,getItem:n})=>j.useSyncExternalStore(j.useCallback(s=>t(s,e),[t,e]),j.useCallback(()=>n(e),[n,e])),i0=Object.freeze(Object.defineProperty({__proto__:null,Client:T.Client,Provider:Ta,ScopedUnaryStore:T.ScopedUnaryStore,createForm:sn,createList:Ke,createRetrieve:Ze,createStore:T.createStore,createUpdate:st,errorResult:Zt,nullClientResult:ks,pendingResult:vt,scopeStore:T.scopeStore,successResult:Je,useListItem:r0,useStore:Fe},Symbol.toStringTag,{value:"Module"})),Ha="channels",l0={channel:A.Mm.SET_CHANNEL_NAME,schema:A.Mm.keyZ,onChange:async({store:e,changed:t,client:n})=>e.channels.set(t,await n.channels.retrieve(t))},a0={channel:A.Mm.DELETE_CHANNEL_NAME,schema:A.Mm.keyZ,onChange:({store:e,changed:t})=>e.channels.delete(t)},c0={channel:A.Mm.CALCULATION_STATUS_CHANNEL_NAME,schema:A.Mm.statusZ,onChange:async({store:e,changed:t,client:n})=>e.channels.set(Number(t.key),s=>s==null?s:n.channels.sugar({...s,status:t}))},u0=e=>{const t=Fe();j.useEffect(()=>t.channels.onSet(n=>{n.status!=null&&e(n.status)}),[t])},Fa={equal:(e,t)=>A.N.equal(e.payload,t.payload),listeners:[l0,a0,c0]},jr=A.Mm.newZ.extend({name:se.z.string().min(1,"Name must not be empty"),dataType:A.$.z.transform(e=>e.toString())}).refine(e=>!e.isIndex||A.$.z.parse(e.dataType).equals(A.$.TIMESTAMP),{message:"Index channel must have data type TIMESTAMP",path:["dataType"]}).refine(e=>e.isIndex||e.index!==0||e.virtual,{message:"Data channel must have an index",path:["index"]}).refine(e=>e.virtual||!A.$.z.parse(e.dataType).isVariable,{message:"Persisted channels must have a fixed-size data type",path:["dataType"]}),Za=jr.extend({expression:se.z.string().min(1,"Expression must not be empty").refine(e=>e.includes("return"),{message:"Expression must contain a return statement"})}).refine(e=>e.requires?.length>0,{message:"Expression must use at least one channel",path:["requires"]}),Er=e=>({...e.payload,dataType:e.dataType.toString()}),yr={key:0,name:"",index:0,dataType:A.$.FLOAT32.toString(),internal:!1,isIndex:!1,leaseholder:0,virtual:!1,expression:"",requires:[]},Sr=async({client:e,params:{key:t,rangeKey:n},store:s})=>{let r=s.channels.get(t);if(r==null&&(r=await e.channels.retrieve(t,{rangeKey:n}),s.channels.set(r.key,r)),n!=null){const i=A.rw.aliasKey({range:n,channel:r.key});let l=s.rangeAliases.get(i);if(l==null)try{l={alias:await e.ranges.retrieveAlias(n,r.key),channel:r.key,range:n}}finally{s.rangeAliases.set(i,{channel:r.key,range:n})}l!=null&&(r.alias=l.alias)}return r},d0=async({client:e,params:{keys:t,rangeKey:n},store:s})=>{const r=s.channels.get(t),i=new Set(r?.map(a=>a.key)),l=t.filter(a=>!i.has(a));if(l.length>0){const a=await e.channels.retrieve(l);r.push(...a),s.channels.set(a)}if(n!=null){const a=t.map(p=>A.rw.aliasKey({range:n,channel:p})),c=s.rangeAliases.get(a);c.forEach(p=>{if(p==null)return;const m=r.find(h=>h.key===p.channel);m!=null&&(m.alias=p.alias)});const d=new Set(c.map(p=>p.channel)),x=t.filter(p=>!d.has(p));if(x.length>0){const p=await e.ranges.retrieveAliases(n,x);Object.entries(p).forEach(([m,h])=>{const g=Number(m),E=r.find(R=>R.key===g);E!=null&&(E.alias=h);const S=A.rw.aliasKey({range:n,channel:g});s.rangeAliases.set(S,{alias:h,channel:g,range:n})})}}return r},Ka=async e=>{const{params:{key:t,rangeKey:n}}=e;if(t!=null)return Er(await Sr({...e,params:{key:t,rangeKey:n}}))},Rr=Ze({name:"Channel",retrieve:Sr,mountListeners:({store:e,onChange:t,params:{key:n,rangeKey:s},client:r})=>{const i=e.channels.onSet(d=>{if(s!=null){const x=e.rangeAliases.get(A.rw.aliasKey({range:s,channel:n}));x!=null&&(d.alias=x.alias)}t(d)},n);if(s==null)return i;const l=A.rw.aliasKey({range:s,channel:n}),a=e.rangeAliases.onSet(d=>{d!=null&&t(x=>r.channels.sugar({...x,alias:d.alias}))},l),c=e.rangeAliases.onDelete(()=>t(d=>r.channels.sugar({...d,alias:void 0})),l);return[i,a,c]}}),x0=Ze({name:"Channels",retrieve:d0,mountListeners:({store:e,onChange:t,params:{keys:n,rangeKey:s},client:r})=>{const i=new Set(n),l=e.channels.onSet(async d=>{if(i.has(d.key)){if(s!=null){const x=A.rw.aliasKey({range:s,channel:d.key});let p=e.rangeAliases.get(x);if(p==null)try{p={alias:await r.ranges.retrieveAlias(s,d.key),channel:d.key,range:s},e.rangeAliases.set(x,p)}catch(m){console.error(m)}p!=null&&(d.alias=p.alias)}t(x=>x.map(p=>p.key===d.key?d:p))}});if(s==null)return l;const a=e.rangeAliases.onSet(d=>{d!=null&&t(x=>x.map(p=>p.key===d.channel?r.channels.sugar({...p,alias:d.alias}):p))}),c=e.rangeAliases.onDelete(d=>{const x=A.rw.decodeDeleteAliasChange(d);t(p=>p.map(m=>m.key===x.channel?r.channels.sugar({...m,alias:void 0}):m))});return[l,a,c]}}),Ya=async({client:e,value:t,onChange:n,store:s})=>{const r=await e.channels.create(t);s.channels.set(r.key,r),n(Er(r))},Wa=({store:e,onChange:t})=>e.channels.onSet(n=>{t(s=>s==null||s.key!==n.key?s:Er(n))}),p0=sn({name:"Channel",schema:jr,initialValues:yr,retrieve:Ka,update:Ya,mountListeners:Wa}),m0=sn({name:"Calculated Channel",schema:Za,initialValues:yr,retrieve:Ka,update:Ya,mountListeners:Wa}),f0={internal:!1},Cr=Ke({name:"Channels",retrieve:async({client:e,params:t,store:n})=>{const s=await e.channels.retrieve({...f0,...t});return n.channels.set(s),s},retrieveByKey:async({client:e,key:t,store:n})=>await Sr({client:e,params:{key:t},store:n}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.channels.onSet(s=>t(s.key,s)),e.channels.onDelete(s=>n(s))]}),h0=st({name:"Channel",update:async({client:e,value:t,store:n})=>{const s=await e.channels.create(t);n.channels.set(s.key,s)}}),g0=st({name:"Channel",update:async({client:e,value:t,store:n,params:{key:s}})=>{s!=null&&(await e.channels.rename(s,t),n.channels.set(s,r=>r==null?r:e.channels.sugar({...r,name:t})))}}),Ga=st({name:"Channel Alias",update:async({client:e,value:t,store:n,params:{rangeKey:s,channelKey:r}})=>{if(s==null)return;const i={alias:t,channel:r,range:s};await e.ranges.setAlias(s,r,t),n.rangeAliases.set(A.rw.aliasKey(i),i)}}),Ua=e=>{if(e==null)return f.Channel;if(A.Mm.isCalculated(e))return f.Calculation;if(e.isIndex)return f.Index;const t=new u.r(e.dataType);return t.isInteger?f.Binary:t.isFloat?f.Decimal:t.equals(u.r.STRING)?f.String:t.equals(u.r.JSON)?f.JSON:f.Channel},Xa=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e),s=Ua(n?.payload);return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,children:[o.jsxRuntimeExports.jsx(s,{}),n?.name]})}),j0=({onChange:e,value:t,emptyContent:n,initialParams:s,filter:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=Cr({initialParams:s,filter:r}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(bs,{resourceName:"Channel",value:t,onChange:e,data:l,haulType:bt,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,icon:o.jsxRuntimeExports.jsx(f.Channel,{}),...i,children:Xa})},_t=({onChange:e,value:t,allowNone:n,emptyContent:s,initialParams:r,filter:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=Cr({initialParams:r,filter:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(Tt,{resourceName:"Channel",onChange:e,value:t,allowNone:n,emptyContent:s,onFetchMore:m,onSearch:h,data:a,getItem:d,subscribe:x,status:p,haulType:bt,icon:o.jsxRuntimeExports.jsx(f.Channel,{}),...l,children:Xa})},E0=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Fg,FLUX_STORE_KEY:Ha,LinePlot:T1,STORE_CONFIG:Fa,SelectMultiple:j0,SelectSingle:_t,ZERO_FORM_VALUES:yr,calculatedFormSchema:Za,formSchema:jr,rename:g0,resolveIcon:Ua,retrieve:Rr,retrieveMany:x0,update:h0,updateAlias:Ga,useCalculatedForm:m0,useForm:p0,useList:Cr,useListenForCalculationStatus:u0},Symbol.toStringTag,{value:"Module"})),qa=({yDirection:e="up",...t})=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...t,keys:u.g.DIRECTIONS,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"x",children:o.jsxRuntimeExports.jsx(f.Arrow.Right,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"y",children:e==="up"?o.jsxRuntimeExports.jsx(f.Arrow.Up,{}):o.jsxRuntimeExports.jsx(f.Arrow.Down,{})})]}),y0=Object.freeze(Object.defineProperty({__proto__:null,Select:qa},Symbol.toStringTag,{value:"Module"})),Qa="devices",S0={channel:A.Hm.SET_CHANNEL_NAME,schema:A.Hm.deviceZ,onChange:({store:e,changed:t})=>e.devices.set(t.key,t)},R0={channel:A.Hm.DELETE_CHANNEL_NAME,schema:A.Hm.keyZ,onChange:({store:e,changed:t})=>e.devices.delete(t)},C0={channel:A.Hm.STATUS_CHANNEL_NAME,schema:A.Hm.statusZ,onChange:({store:e,changed:t})=>{e.devices.set(t.details.device,n=>n==null?n:{...n,status:t})}},Ja={listeners:[S0,R0,C0]},w0=e=>{const t=Fe();j.useEffect(()=>t.devices.onSet(e),[t])},ec=async(e,t,n)=>{const s=t.devices.get(n.key);if(s!=null)return s;const r=await e.hardware.devices.retrieve({...n,includeStatus:!0});return t.devices.set(n.key,r),r},b0=()=>Ze({name:"Device",retrieve:async({client:e,params:t,store:n})=>await ec(e,n,t),mountListeners:({store:e,onChange:t,params:{key:n}})=>[e.devices.onSet(s=>t(s),n)]}),tc=Ke({name:"Devices",retrieve:async({client:e,params:t,store:n})=>{const s=await e.hardware.devices.retrieve({includeStatus:!0,...t});return s.forEach(r=>n.devices.set(r.key,r)),s},retrieveByKey:async({client:e,key:t,store:n})=>await ec(e,n,{key:t}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.devices.onSet(s=>t(s.key,s)),e.devices.onDelete(n)]}),v0=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e);return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,className:u.CSS.BE("device","list-item"),justify:"between",align:"center",children:[o.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[o.jsxRuntimeExports.jsx(nc,{status:n?.status}),n?.name]}),o.jsxRuntimeExports.jsx(nr,{level:"small",color:9,weight:450,style:{marginTop:"0.25rem"},gap:"tiny",children:n?.location.split(".").map(s=>o.jsxRuntimeExports.jsx(yn,{children:s},s))})]})}),_0=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,disabled:l,icon:a=o.jsxRuntimeExports.jsx(f.Device,{}),...c})=>{const{data:d,retrieve:x,getItem:p,subscribe:m,status:h}=tc({filter:n,initialParams:i}),{fetchMore:g,search:E}=nt.usePager({retrieve:x});return o.jsxRuntimeExports.jsx(Tt,{resourceName:"Device",value:t,onChange:e,data:d,getItem:p,subscribe:m,onFetchMore:g,onSearch:E,emptyContent:r,status:h,disabled:l,icon:a,...c,children:v0})},nc=({status:e,tooltipLocation:t="right"})=>{const n=e?.variant??"disabled",s=e?.message??"Device Status Unknown";return o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[o.jsxRuntimeExports.jsx(f.Summary,{variant:n,hideIcon:!0,level:"small",weight:450,children:s}),o.jsxRuntimeExports.jsx(Jo,{variant:n,className:u.CSS.BE("device","status-indicator")})]})},k0=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:Qa,STORE_CONFIG:Ja,SelectSingle:_0,StatusIndicator:nc,retrieve:b0,useList:tc,useSetSynchronizer:w0},Symbol.toStringTag,{value:"Module"})),sc="racks",L0={channel:A.Km.SET_CHANNEL_NAME,schema:A.Km.keyZ,onChange:async({store:e,changed:t,client:n})=>{const s=await n.hardware.racks.retrieve({key:t});e.racks.set(t,s.payload)}},M0={channel:A.Km.DELETE_CHANNEL_NAME,schema:A.Km.keyZ,onChange:({store:e,changed:t})=>e.racks.delete(t)},P0={channel:A.Km.STATUS_CHANNEL_NAME,schema:A.Km.statusZ,onChange:({store:e,changed:t})=>e.racks.set(t.details.rack,n=>n==null?n:{...n,status:t})},oc={listeners:[L0,M0,P0]},rc={includeStatus:!0},ic=async({client:e,params:t,store:n})=>{let s=n.racks.get(t.key);return s==null&&(s=await e.hardware.racks.retrieve({...rc,...t}),n.racks.set(s.key,s)),s},lc=Ke({name:"Racks",retrieve:async({client:e,params:t,store:n})=>{const s=await e.hardware.racks.retrieve({...rc,...t});return n.racks.set(s),s},retrieveByKey:async({client:e,key:t,store:n})=>await ic({client:e,params:{key:t},store:n}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.racks.onSet(s=>t(s.key,s)),e.racks.onDelete(n)]}),N0=Ze({name:"Rack",retrieve:ic,mountListeners:({store:e,onChange:t,params:{key:n}})=>[e.racks.onSet(t,n)]}),T0=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);return o.jsxRuntimeExports.jsxs(f.ListItem,{...e,align:"center",justify:"between",children:[o.jsxRuntimeExports.jsx(f.Text,{children:n?.name}),o.jsxRuntimeExports.jsx(ac,{status:n?.status,tooltipLocation:"left"})]})}),A0=({value:e,onChange:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=lc({initialParams:{includeStatus:!0,...i},filter:n}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(Tt,{resourceName:"Driver",value:e,onChange:t,data:a,getItem:d,subscribe:x,onFetchMore:m,onSearch:h,emptyContent:r,status:p,icon:o.jsxRuntimeExports.jsx(f.Rack,{}),...l,children:T0})},ac=({status:e,tooltipLocation:t="right"})=>{const n=j.useRef(null),s=e?.variant??"disabled";return j.useEffect(()=>{if(s!=="success")return;const r=n.current;r&&(r.classList.remove(u.CSS.BEM("rack","heartbeat","beat")),requestAnimationFrame(()=>r.classList.add(u.CSS.BEM("rack","heartbeat","beat"))))},[e]),o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[o.jsxRuntimeExports.jsx(f.Summary,{variant:s,hideIcon:!0,level:"small",weight:450,children:e?.message}),o.jsxRuntimeExports.jsx(f.Heart,{ref:n,className:u.CSS.BE("rack","heartbeat"),style:{color:Qo[s]}})]})},I0=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:sc,STORE_CONFIG:oc,SelectSingle:A0,StatusIndicator:ac,retrieve:N0,useList:lc},Symbol.toStringTag,{value:"Module"})),cc="tasks",O0=["start","stop"],D0={channel:A.Xm.SET_CHANNEL_NAME,schema:A.Xm.keyZ,onChange:async({store:e,changed:t,client:n})=>{const s=await n.hardware.tasks.retrieve({key:t});e.tasks.set(t,s)}},B0={channel:A.Xm.DELETE_CHANNEL_NAME,schema:A.Xm.keyZ,onChange:({store:e,changed:t})=>e.tasks.delete(t)},$0=A.Xm.statusZ(se.z.unknown()),z0={channel:A.Xm.STATUS_CHANNEL_NAME,schema:$0,onChange:({store:e,changed:t,client:n})=>{e.tasks.set(t.details.task,s=>s==null?s:n.hardware.tasks.sugar({...s,status:t}))}},V0={channel:A.Xm.COMMAND_CHANNEL_NAME,schema:A.Xm.commandZ,onChange:({store:e,changed:t,client:n})=>e.tasks.set(t.task,s=>s==null||!O0.includes(t.type)?s:n.hardware.tasks.sugar({...s,status:{...s.status,variant:"loading",message:`Running ${t.type} command...`,details:{task:t.task,running:!0,data:{}}}}))},H0=e=>{const t=Fe();j.useEffect(()=>t.tasks.onSet(n=>{n.status!=null&&e(n.status)}),[t])},uc={listeners:[D0,B0,z0,V0]},dc=async(e,t,n,s)=>{const r=t.tasks.get(n.key);if(r!=null)return r;const i=await e.hardware.tasks.retrieve({...n,includeStatus:!0,schemas:s});return t.tasks.set(n.key,i),i},F0=e=>Ze({name:"Task",retrieve:async({client:t,params:n,store:s})=>n.key==null?null:await dc(t,s,{key:n.key,includeStatus:!0},e),mountListeners:({store:t,params:{key:n},onChange:s})=>[t.tasks.onSet(r=>{n==null||r.key!==n||s(r)},n)]}),Z0=Ke({name:"Task",retrieve:async({client:e,params:t,store:n})=>{const s=await e.hardware.tasks.retrieve({includeStatus:!0,...t});return s.forEach(r=>n.tasks.set(r.key,r)),s},retrieveByKey:async({client:e,key:t,store:n})=>await dc(e,n,{key:t}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.tasks.onSet(s=>t(s.key,s)),e.tasks.onDelete(n)]}),K0=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:cc,STORE_CONFIG:uc,createRetrieveQuery:F0,useList:Z0,useStatusSynchronizer:H0},Symbol.toStringTag,{value:"Module"})),xc="labels",Y0={channel:A.ew.SET_CHANNEL_NAME,schema:A.ew.labelZ,onChange:({store:e,changed:t})=>e.labels.set(t.key,t)},W0={channel:A.ew.DELETE_CHANNEL_NAME,schema:A.ew.keyZ,onChange:({store:e,changed:t})=>e.labels.delete(t)},pc={listeners:[Y0,W0]},Kt=(e,t)=>A.km.matchRelationship(e,{from:t,type:A.ew.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE}),mc=Ze({name:"Labels",retrieve:async({client:e,params:{id:t}})=>await e.labels.retrieve({for:t}),mountListeners:({client:e,store:t,params:{id:n},onChange:s})=>[t.labels.onSet(r=>{s(i=>{const l=i.filter(a=>a.key!==r.key);return l.length===i.length?i:[...l,r]})}),t.labels.onDelete(r=>s(i=>i.filter(l=>l.key!==r))),t.relationships.onSet(async r=>{if(!Kt(r,n))return;const{key:i}=r.to,l=await e.labels.retrieve({key:i});t.labels.set(i,l),s(a=>[...a.filter(c=>c.key!==i),l])}),t.relationships.onDelete(r=>{const i=A.km.relationshipZ.parse(r);Kt(i,n)&&s(l=>l.filter(a=>a.key!==i.to.key))})]}),wr=Ke({name:"Labels",retrieve:async({client:e,params:t})=>await e.labels.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.labels.retrieve({key:t}),mountListeners:({store:e,onChange:t,onDelete:n,params:{keys:s}})=>{const r=s?new Set(s):void 0;return[e.labels.onSet(async i=>{r!=null&&!r.has(i.key)||t(i.key,i,{mode:"prepend"})}),e.labels.onDelete(async i=>n(i))]}}),fc=A.ew.labelZ.partial({key:!0}),G0=sn({name:"Label",initialValues:{name:"",color:"#000000"},schema:fc,retrieve:async({client:e,params:{key:t}})=>t==null?void 0:await e.labels.retrieve({key:t}),update:async({client:e,value:t,onChange:n})=>n(await e.labels.create(t)),mountListeners:({store:e,params:{key:t},onChange:n})=>[e.labels.onSet(async s=>{t==null||s.key!==t||n(s)},t)]}),U0=st({name:"Label",update:async({client:e,params:{key:t}})=>await e.labels.delete(t)}).useDirect,br="label",X0=({itemKey:e,...t})=>{const n=f.useItem(e),{selected:s,onSelect:r,hovered:i}=f.useItemState(e);return n==null?null:o.jsxRuntimeExports.jsx(f.Item,{itemKey:e,onSelect:r,selected:s,hovered:i,...t,children:o.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[o.jsxRuntimeExports.jsx(f.Circle,{color:n?.color,size:"2.5em"}),n?.name]})})},hc=f.renderProp(X0),q0=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t),{onSelect:s}=f.useItemState(t);return n==null?null:o.jsxRuntimeExports.jsx(vs,{color:n.color,onClose:s,size:"small",children:n.name})}),Q0={variant:"text"},J0=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=wr({filter:s,initialParams:r}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(bs,{resourceName:"Label",haulType:br,value:t,onChange:e,data:l,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,renderTag:q0,icon:o.jsxRuntimeExports.jsx(f.Label,{}),triggerProps:Q0,variant:"floating",...i,children:hc})},ej=({onChange:e,value:t,allowNone:n,emptyContent:s,filter:r,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=wr({filter:r,initialParams:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(Tt,{resourceName:"Label",value:t,onChange:e,data:a,getItem:d,subscribe:x,allowNone:n,onFetchMore:m,onSearch:h,emptyContent:s,status:p,haulType:br,...l,children:hc})},tj=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:xc,HAUL_TYPE:br,STORE_CONFIG:pc,SelectMultiple:J0,SelectSingle:ej,formSchema:fc,matchRelationship:Kt,retrieveLabelsOf:mc,useDelete:U0,useForm:G0,useList:wr},Symbol.toStringTag,{value:"Module"})),Ms=new Error("Tab not found"),nj=new Error("Invalid Mosaic"),ls=(e,t,n="center",s,r)=>{if(e=He(e),s===void 0)return vo(e,t);const i=_o(e,s);if(n==="center")return i.tabs||=[],r!==void 0&&r>=0&&r<=i.tabs.length?i.tabs.splice(r,0,t):i.tabs.push(t),i.selected=t.tabKey,e;const l=i.key*2,a=i.key*2+1,c=n==="top"||n==="left"?l:a;if(_o(e,c).key!==i.key)return ls(e,t,"center",c);if(i.tabs==null||i.tabs.length===0)return ls(e,t,"center",s);const[d,x,p]=aj(n);if(i.direction=p,i[d]={key:0,tabs:[t],selected:t.tabKey},i[x]={key:0,tabs:i.tabs,selected:i.selected},i.first==null||i.last==null)throw nj;return i.first.key=l,i.last.key=a,i.tabs=void 0,i.size=void 0,i.selected=void 0,e},sj=(e,t,n)=>{e=He(e);const[s,r]=kt(e,t);if(s==null||r==null)throw Ms;return r.tabs=r.tabs?.map(i=>i.tabKey===t?n(i):i),e},vo=(e,t)=>(e=He(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=vo(e.first,t):e.last!=null&&(e.last=vo(e.last,t)),e)),as=e=>{e=He(e);const t=[];if(e.tabs!=null&&(e.selected=Me.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=as(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=as(e.last);e.last=n,t.push(...s)}return[e,t]},vr=(e,t)=>{e=He(e);const[,n]=kt(e,t);if(n==null)return[e,null];n.tabs=n.tabs?.filter(r=>r.tabKey!==t),n.selected=Me.resetSelection(n.selected,n.tabs),e=lj(e);const s=n.selected??cs(e);return[e,s]},cs=e=>e.selected!=null?e.selected:e.first!=null?cs(e.first):e.last!=null?cs(e.last):null,gc=(e,t)=>{e=He(e);const[n,s]=kt(e,t);if(n==null||s==null)throw Ms;return s.selected=t,e},jc=(e,t,n,s,r)=>{e=He(e);const[i,l]=kt(e,t);if(i==null||l==null)throw Ms;const[a,c]=vr(e,t);return[ls(a,i,n,s,r),c]},Sn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=Sn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=Sn(e.last,t);if(n!=null)return n}},Ec=(e,t,n)=>{const s=us(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},oj=(e,t,n)=>{e=He(e);const s=Sn(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const r=s.tabs.findIndex(x=>x.tabKey===t);if(r===-1)throw new Error("Tab not found in node");const i=s.tabs[r];s.tabs=s.tabs.filter(x=>x.tabKey!==t);const l=s.key*2,c={key:s.key*2+1,tabs:[i],selected:i.tabKey},d={key:l,tabs:s.tabs,selected:s.selected};return d.selected=Me.resetSelection(d.selected,d.tabs),s.direction=n,s.first=d,s.last=c,s.tabs=void 0,s.selected=void 0,e},rj=(e,t)=>{const n=Sn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},yc=(e,t,n)=>{e=He(e);const[,s]=kt(e,t);if(s?.tabs==null)throw Ms;return s.tabs=Me.rename(t,n,s?.tabs??[]),e},ij=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,_o=(e,t)=>{const n=us(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:_o(e,s)},lj=e=>{let t=!0;for(;t;)[e,t]=ko(e);return e=Mo(e,1),e},ko=e=>{if(e.first==null||e.last==null)return[e,!1];if(bi(e.first))return[wi(e.last),!0];if(bi(e.last))return[wi(e.first),!0];let t,n;return[e.first,t]=ko(e.first),[e.last,n]=ko(e.last),[e,t||n]},wi=e=>(e.size=void 0,e),bi=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),kt=(e,t)=>{if(e.tabs!=null){const l=e.tabs.find(a=>a.tabKey===t);if(l!=null)return[l,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=kt(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,i]=kt(e.last,t);return[r,i]},us=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=us(e.first,t);return n??us(e.last,t)},aj=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")}},He=e=>({...e,first:e.first!=null?He(e.first):void 0,last:e.last!=null?He(e.last):void 0}),ds=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&ds(e.first,t,n),e.last!=null&&ds(e.last,t,n),n),Lo=(e,t)=>{t(e),e.first!=null&&Lo(e.first,t),e.last!=null&&Lo(e.last,t)},Mo=(e,t)=>(e=He(e),e.key=t,e.first!=null&&(e.first=Mo(e.first,t*2)),e.last!=null&&(e.last=Mo(e.last,t*2+1)),e);class Sc{parent;stub;el;constructor(t={}){this.el=document.createElement("div"),Object.entries(t).forEach(([n,s])=>this.el.setAttribute(n,s))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}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 cj=({node:e})=>{const t=j.createRef(),n=j.useRef(e);return j.useEffect(()=>{const s=t.current;if(s==null)return;const r=s.parentNode;if(r!=null)return e.mount(r,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),j.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const s=t.current;if(s==null)return;const r=s.parentNode;r!=null&&e.mount(r,s)},[e]),o.jsxRuntimeExports.jsx("div",{ref:t})},Rc=({node:e,children:t})=>Bl.createPortal(t,e.el),uj=Object.freeze(Object.defineProperty({__proto__:null,In:Rc,Node:Sc,Out:cj},Symbol.toStringTag,{value:"Module"})),xs=j.memo(({root:e,onDrop:t,onResize:n,onCreate:s,onFileDrop:r,children:i,activeTab:l,emptyContent:a,onSelect:c,onClose:d,onRename:x,onReorder:p,contextMenu:m,addTooltip:h,...g})=>{const{tabs:E,direction:S,first:R,last:_,key:y,size:C}=e,v={onDrop:t,onResize:n,onCreate:s,onFileDrop:r,children:i,onClose:d,contextMenu:m,onSelect:c,onRename:x,onReorder:p,activeTab:l,addTooltip:h},L=j.useCallback(([z])=>n(y,z),[n]),{props:N}=Xl({direction:S,onResize:L,count:2,initialSizes:C!=null?[C]:void 0});let I={};y==1&&(I={...g,className:u.CSS(u.CSS.B("mosaic"))});let B;return E!==void 0?B=o.jsxRuntimeExports.jsx(Cc,{root:e,emptyContent:a,...I,...v}):R!=null&&_!=null?B=o.jsxRuntimeExports.jsxs(ql,{id:`mosaic-${y}`,align:"stretch",...N,...I,children:[o.jsxRuntimeExports.jsx(xs,{...v,root:R,onResize:n},R.key),o.jsxRuntimeExports.jsx(xs,{...v,root:_,onResize:n},_.key)]}):(B=null,console.warn("Mosaic tree is malformed")),B});xs.displayName="Mosaic";const ps="pluto-mosaic-tab-drop",_r="pluto-mosaic-tab-create",dj=(e,t,n)=>{if(f.filterByType(f.FILE_TYPE,t).length>0&&n)return!0;const r=f.filterByType(ps,t).map(a=>a.key),i=e.filter(a=>!r.includes(a.tabKey)).length>0;return f.filterByType(_r,t).length>0||r.length>0&&(i||e.length===0)},Cc=j.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:r,className:i,onReorder:l,onFileDrop:a,addTooltip:c,...d})=>{const{key:x,tabs:p}=e,[m,h]=j.useState(null),g=a!=null,E=j.useCallback(({items:B})=>dj(p,B,g),[p,g]),S=j.useCallback(({items:B,event:z})=>{if(z==null)return[];const H=pj(z);h(null);const D=f.filterByType(f.FILE_TYPE,B).length>0,{percents:V}=vi(z),w=p.length===0?"center":_i(V);if(D)return a?.(x,w,z),B;const k=f.filterByType(ps,B);if(k.length>0){const O=k.map(({key:F})=>F)[0];t(x,O,w,H)}const M=f.filterByType(_r,B);if(M.length>0){const O=M.map(({key:F})=>F);n?.(x,w,O)}return k},[t,p.length]),R=j.useCallback(({event:B})=>{if(B==null)return;const{percents:z,inSelector:H}=vi(B);let D=null;H||(D=p.length===0?"center":_i(z)),h(D)},[p.length]),{startDrag:_,...y}=f.useDragAndDrop({type:"Mosaic",canDrop:E,onDrop:S,onDragOver:R}),C=E(f.useDraggingState()),v=j.useCallback(()=>h(null),[]),L=j.useCallback((B,{tabKey:z})=>{_([{key:z,type:ps,elementID:B.currentTarget.id}])},[_]),N=j.useCallback(()=>n?.(x,"center"),[x]),I=x==1&&p.length==0;return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:o.jsxRuntimeExports.jsxs(Me.Tabs,{id:`tab-${x}`,tabs:p,className:u.CSS(i,I&&m!=null&&u.CSS.M("drag-over")),onDragLeave:v,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:L,onCreate:N,addTooltip:c,...y,...d,children:[e.selected!=null&&r(p.find(B=>B.tabKey===e.selected)),C&&o.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),m!=null&&o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("mosaic","mask"),style:xj[m]})]})})});Cc.displayName="MosaicTabLeaf";const xj={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%"}},vi=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{percents:{x:.5,y:.5},inSelector:!0}:{percents:{x:n/t.width,y:s/t.height},inSelector:!1}},pj=e=>{const t=e.target.closest(".pluto-tabs-selector__btn");if(t!=null)return Array.from(t.parentElement?.children??[]).indexOf(t)},mj=e=>e,fj=e=>1-e,_i=({x:e,y:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[mj(e),fj(e)];if(t>n&&t>s)return"bottom";if(t<n&&t<s)return"top";if(t>n&&t<s)return"left";if(t<n&&t>s)return"right";throw new Error("[bug] - invalid insert position")},hj=({root:e,onSelect:t,children:n})=>{const s=j.useRef(new Map),r=new Set,i=ds(e,l=>l.tabs?.map(a=>{let c=s.current.get(a.tabKey);return a==null?null:(c==null&&(c=new Sc({style:"width: 100%; height: 100%; position: relative;"}),c.el.addEventListener("click",()=>t?.(a.tabKey)),s.current.set(a.tabKey,c)),r.add(a.tabKey),o.jsxRuntimeExports.jsx(Rc,{node:c,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})).flat().filter(l=>l!=null);return s.current.forEach((l,a)=>!r.has(a)&&s.current.delete(a)),[s,i]},Po=se.z.object({key:se.z.number(),tabs:se.z.array(Me.tabZ).optional(),selected:se.z.string().optional(),direction:u.g.direction.optional(),size:se.z.number().optional(),get first(){return Po.optional()},get last(){return Po.optional()}}),gj=({allowRename:e=!1,initialTree:t})=>{const[n,s]=j.useState(t);return j.useEffect(()=>s(as(t)[0]),[t]),{root:n,onDrop:(d,x,p)=>s(m=>jc(m,x,p,d)[0]),onClose:d=>s(x=>vr(x,d)[0]),onSelect:d=>s(x=>gc(x,d)),onResize:(d,x)=>s(p=>Ec(p,d,x)),onRename:e?(d,x)=>s(p=>yc(p,d,x)):void 0}},jj=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:_r,HAUL_DROP_TYPE:ps,Mosaic:xs,autoSelectTabs:as,canSplit:rj,findSelected:cs,findTabNode:Sn,forEachNode:Lo,insertTab:ls,isEmpty:ij,mapNodes:ds,moveTab:jc,nodeZ:Po,removeTab:vr,renameTab:yc,resizeNode:Ec,selectTab:gc,split:oj,updateTab:sj,use:gj,usePortal:hj},Symbol.toStringTag,{value:"Module"})),Ej=({variant:e,className:t,...n})=>o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(t,u.CSS.B("note"),u.CSS.M(e)),align:"stretch",empty:!0,...n}),yj=Object.freeze(Object.defineProperty({__proto__:null,Note:Ej},Symbol.toStringTag,{value:"Module"})),wc="relationships",bc="resources",Sj={channel:A.km.RELATIONSHIP_SET_CHANNEL_NAME,schema:A.km.relationshipZ,onChange:({store:e,changed:t})=>e.relationships.set(A.km.relationshipToString(t),t)},Rj={channel:A.km.RELATIONSHIP_DELETE_CHANNEL_NAME,schema:A.km.relationshipZ,onChange:({store:e,changed:t})=>e.relationships.delete(A.km.relationshipToString(t))},vc={listeners:[Sj,Rj]},Cj={channel:A.km.RESOURCE_SET_CHANNEL_NAME,schema:A.km.idZ,onChange:async({store:e,changed:t,client:n})=>{e.resources.set(A.km.idToString(t),await n.ontology.retrieve(t))}},wj={channel:A.km.RESOURCE_DELETE_CHANNEL_NAME,schema:A.km.idZ,onChange:({store:e,changed:t})=>e.resources.delete(t.key)},_c={listeners:[Cj,wj]},bj=e=>{const t=Fe();j.useEffect(()=>t.resources.onSet(e),[t.resources])},vj=e=>{const t=Fe();j.useEffect(()=>{const n=t.resources.onDelete(async s=>e(A.km.idZ.parse(s)));return()=>n()},[t.resources])},_j=e=>{const t=Fe();j.useEffect(()=>t.relationships.onSet(e),[t.relationships])},kj=e=>{const t=Fe();j.useEffect(()=>t.relationships.onDelete(n=>e(A.km.relationshipZ.parse(n))),[t.relationships])},kc=e=>Ke({name:"useDependents",retrieve:async({client:t,params:{id:n}})=>n==null?[]:await t.ontology.retrieve([n],{children:e==="to",parents:e==="from"}),retrieveByKey:async({client:t,key:n})=>await t.ontology.retrieve(n),mountListeners:({store:t,onChange:n,onDelete:s,client:r,params:{id:i}})=>[t.relationships.onSet(async l=>{if(A.km.matchRelationship(l,{type:"parent",[A.km.oppositeRelationshipDirection(e)]:i})){const a=await r.ontology.retrieve(l[e]);n(a.key,a)}}),t.relationships.onDelete(l=>{const a=A.km.relationshipZ.parse(l);A.km.matchRelationship(a,{type:"parent",[A.km.oppositeRelationshipDirection(e)]:i})&&s(A.km.idToString(a[e]))}),t.resources.onSet(l=>n(l.key,a=>a==null?null:{...a,...l})),t.resources.onDelete(async l=>s(l))]}),Lj=kc("to"),Mj=Ke({name:"useResourceList",retrieve:async({client:e,params:t,store:n})=>{const s=await e.ontology.retrieve(t);return s.forEach(r=>n.resources.set(r.key,r)),s},retrieveByKey:async({client:e,key:t,store:n})=>{const s=await e.ontology.retrieve(A.km.idZ.parse(t));return n.resources.set(t,s),s},mountListeners:({store:e,onChange:t,onDelete:n})=>[e.resources.onSet(async s=>t(s.key,s)),e.resources.onDelete(async s=>n(s))]}),Pj=Ze({name:"useParentID",retrieve:async({client:e,params:t})=>{const n=await e.ontology.retrieveParents(t.id);if(t.type==null)return n[0].id;const s=n.find(({id:r})=>r.type===t.type);return s==null?null:s.id},mountListeners:({store:e,onChange:t,client:n,params:{id:s}})=>[e.relationships.onSet(async r=>{if(A.km.matchRelationship(r,{type:A.km.PARENT_OF_RELATIONSHIP_TYPE,to:s})){const i=await n.ontology.retrieve(r.from);t(i.id)}else t(null)}),e.relationships.onDelete(async r=>{const i=A.km.relationshipZ.parse(r);A.km.matchRelationship(i,{type:A.km.PARENT_OF_RELATIONSHIP_TYPE,to:s})&&t(null)})]}),Nj=Object.freeze(Object.defineProperty({__proto__:null,RELATIONSHIPS_FLUX_STORE_KEY:wc,RELATIONSHIP_STORE_CONFIG:vc,RESOURCES_FLUX_STORE_KEY:bc,RESOURCE_STORE_CONFIG:_c,createDependentsListHook:kc,retrieveParentID:Pj,useChildren:Lj,useRelationshipDeleteSynchronizer:kj,useRelationshipSetSynchronizer:_j,useResourceDeleteSynchronizer:vj,useResourceList:Mj,useResourceSetSynchronizer:bj},Symbol.toStringTag,{value:"Module"})),oo={Close:o.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:o.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:o.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.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"}),o.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"})]})},Tj=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:i,onClose:l,...a})=>o.jsxRuntimeExports.jsxs(f.Box,{gap:1.5,x:!0,className:u.CSS(u.CSS.B("macos-controls"),!n&&u.CSS.BM("macos-controls","blurred"),t),...a,children:[o.jsxRuntimeExports.jsx(ro,{onClick:l,className:u.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:oo.Close}),o.jsxRuntimeExports.jsx(ro,{onClick:s,className:u.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:oo.Minimize}),o.jsxRuntimeExports.jsx(ro,{onClick:i,className:u.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:oo.Maximize})]}),ro=({className:e,disabled:t,color:n,...s})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("macos-control"),u.CSS.disabled(t),e),tabIndex:-1,disabled:t,...s}),Aj=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:i,contrast:l=2,...a})=>o.jsxRuntimeExports.jsxs(f.Box,{pack:!0,...a,children:[o.jsxRuntimeExports.jsx(io,{className:u.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Subtract,{})}),o.jsxRuntimeExports.jsx(io,{className:u.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Box$1,{})}),o.jsxRuntimeExports.jsx(io,{onClick:s,className:u.CSS.BM("windows-control","close"),disabled:e.includes("close"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Close,{})})]}),io=({disabled:e=!1,className:t,...n})=>e?null:o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.B("windows-control"),t),tabIndex:-1,...n}),Lc=u.S.getOS,Ij="Windows",Oj=({forceOS:e,visibleIfOS:t,...n})=>{const s=Lc({force:e,default:Ij});if(t!=null&&t!==s)return null;const r=s==="macOS"?Tj:Aj;return o.jsxRuntimeExports.jsx(r,{...n})},Dj=Object.freeze(Object.defineProperty({__proto__:null,Controls:Oj,use:Lc},Symbol.toStringTag,{value:"Module"})),Bj=(e,t)=>{const n=s=>o.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},$j=Object.freeze(Object.defineProperty({__proto__:null,createComponent:Bj},Symbol.toStringTag,{value:"Module"}));j.createContext({instrumentation:A.O.NOOP});const zj=({children:e,...t})=>{const{path:n}=f.useUnidirectional({type:A.Provider$1.TYPE,schema:A.providerStateZ,state:t});return o.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})},Vj="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjUgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Mc="rangeKV",Pc="rangeAliases",Rn=async(e,t,n)=>{const s=t.ranges.get(n);if(s!=null)return s;const r=await e.ranges.retrieve({keys:[n],includeParent:!0,includeLabels:!0});return t.ranges.set(n,r[0]),r[0]},Hj=async(e,t,n)=>{const s=await e.ranges.retrieve({...n,includeParent:!0,includeLabels:!0});return t.ranges.set(s),s},Fj=e=>{const t=Fe();j.useEffect(()=>t.ranges.onSet(n=>e(n.payload)),[t])},Nc=async(e,t,n,s)=>{if(A.km.matchRelationship(e,{from:{type:"range"},type:A.ew.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE,to:{type:"label"}})){let i=s.labels.get(e.to.key);i==null&&(i=await n.labels.retrieve({key:e.to.key}),s.labels.set(e.to.key,i)),t(e.from.key,l=>l==null?l:n.ranges.sugarOne({...l,labels:[...l.labels?.filter(a=>a.key!==e.to.key)??[],i]}))}},Tc=async(e,t,n,s)=>{if(A.km.matchRelationship(e,{from:{type:"range"},type:A.km.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}})){const i=await n.ranges.retrieve(e.from.key);s.ranges.set(e.from.key,i),t(e.to.key,l=>l==null?l:n.ranges.sugarOne({...l,parent:i}))}},Zj=Ke({name:"Range",retrieve:async({client:e,params:{key:t},store:n})=>{const s=await e.ontology.retrieveChildren(A.rw.ontologyID(t),{types:["range"]});return s.length===0?[]:await Hj(e,n,{keys:s.map(({id:{key:r}})=>r)})},retrieveByKey:async({client:e,key:t,store:n})=>await Rn(e,n,t),mountListeners:({store:e,onChange:t,onDelete:n,client:s,params:{key:r}})=>[e.ranges.onSet(i=>{t(i.key,l=>l==null?l:s.ranges.sugarOne({...i,parent:i.parent??l.parent,labels:i.labels??l.labels}))}),e.ranges.onDelete(async i=>n(i)),e.relationships.onSet(async i=>{if(await Tc(i,t,s,e),await Nc(i,t,s,e),A.km.matchRelationship(i,{from:A.rw.ontologyID(r),type:A.km.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}})){const a=await s.ranges.retrieve({keys:[i.to.key],includeParent:!0,includeLabels:!0});return t(i.to.key,a[0])}}),e.relationships.onDelete(async i=>{const l=A.km.relationshipZ.parse(i);if(A.km.matchRelationship(l,{from:A.rw.ontologyID(r),type:A.km.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}}))return n(l.to.key);l.type===A.ew.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE&&t(l.from.key,d=>d==null?d:s.ranges.sugarOne({...d,labels:d.labels?.filter(x=>x.key!==l.to.key)}))})]}),Kj=Ze({name:"Range",retrieve:async({client:e,params:{key:t}})=>{const s=(await e.ontology.retrieveParents(A.rw.ontologyID(t))).find(({id:{type:r}})=>r==="range");return s==null?null:e.ranges.sugarOntologyResource(s)},mountListeners:({store:e,onChange:t,client:n,params:{key:s}})=>[e.ranges.onSet(r=>{t(i=>i==null||i.key!==r.key?i:n.ranges.sugarOne({...r,parent:r.parent??i.parent,labels:r.labels??i.labels}))}),e.relationships.onSet(async r=>{if(!A.km.matchRelationship(r,{type:A.km.PARENT_OF_RELATIONSHIP_TYPE,to:A.rw.ontologyID(s)}))return;if(!(r.from.type==="range"))return t(null);const a=await Rn(n,e,r.from.key);t(n.ranges.sugarOne(a.payload))}),e.relationships.onDelete(async r=>{const i=A.km.relationshipZ.parse(r);A.km.matchRelationship(i,{type:A.km.PARENT_OF_RELATIONSHIP_TYPE,to:A.rw.ontologyID(s)})&&t(null),A.km.matchRelationship(i,{type:A.ew.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE,to:A.rw.ontologyID(s)})&&t(c=>c==null?c:n.ranges.sugarOne({...c,labels:c.labels?.filter(d=>d.key!==i.to.key)}))})]}),Ac=Ze({name:"Range",retrieve:async({client:e,params:{key:t},store:n})=>await Rn(e,n,t),mountListeners:({store:e,onChange:t,client:n,params:{key:s}})=>[e.ranges.onSet(async r=>{if(r!=null)return t(r)},s),e.relationships.onSet(async r=>{if(Kt(r,A.rw.ontologyID(s))){const a=await n.labels.retrieve({key:r.to.key});e.labels.set(r.to.key,a),t(c=>c==null?c:n.ranges.sugarOne({...c,labels:[...(c.labels??[]).filter(d=>d.key!==a.key),a]}))}if(A.km.matchRelationship(r,{type:A.km.PARENT_OF_RELATIONSHIP_TYPE,to:A.rw.ontologyID(s)})){const a=await n.ranges.retrieve(r.from.key);e.ranges.set(r.from.key,a),t(c=>c==null?c:n.ranges.sugarOne({...c,parent:a}))}},s)]}),Yj=Ac.useDirect,Ic=se.z.object({...A.rw.payloadZ.omit({timeRange:!0}).partial({key:!0}).shape,labels:se.z.array(A.ew.keyZ),parent:se.z.string().optional(),timeRange:se.z.object({start:se.z.number(),end:se.z.number()})}),No=async e=>({...e.payload,timeRange:e.timeRange.numeric,parent:e.parent?.key,labels:e.labels?.map(t=>t.key)??[]}),Wj={name:"",labels:[],parent:"",timeRange:{start:0,end:0}},Gj=sn({name:"Range",schema:Ic,initialValues:Wj,retrieve:async({client:e,params:{key:t},store:n})=>{if(t!=null)return await No(await Rn(e,n,t))},update:async({client:e,value:t,onChange:n,store:s})=>{const r=u.O.isNonZero(t.parent)?A.rw.ontologyID(t.parent):void 0,i=await e.ranges.create(t,{parent:r});await e.labels.label(i.ontologyID,t.labels,{replace:!0});const l=s.labels.get(t.labels),a=new Set(l.map(x=>x.key)),c=t.labels.filter(x=>!a.has(x));if(c.length>0){const x=await e.labels.retrieve({keys:c});l.push(...x),s.labels.set(x)}let d=null;u.O.isNonZero(t.parent)&&(d=await Rn(e,s,t.parent)),s.ranges.set(i.key,e.ranges.sugarOne({...i.payload,labels:l,parent:d?.payload??null})),n({...t,...i.payload,timeRange:i.timeRange.numeric,labels:t.labels,parent:t.parent})},mountListeners:({store:e,onChange:t})=>[e.ranges.onSet(async n=>{const s=await No(n);t(r=>r==null||r?.key!==n.key?r:{...s,labels:r.labels,parent:r.parent})}),e.relationships.onSet(n=>{t(s=>{if(s==null||s.key==null)return s;const r=A.rw.ontologyID(s.key);return Kt(n,r)?{...s,labels:[...s.labels.filter(a=>a!==n.to.key),n.to.key]}:A.km.matchRelationship(n,{type:A.km.PARENT_OF_RELATIONSHIP_TYPE,to:r})?{...s,parent:n.from.key}:s})}),e.relationships.onDelete(n=>{t(s=>{if(s==null||s.key==null)return s;const r=A.km.relationshipZ.parse(n),i=A.rw.ontologyID(s.key);return Kt(r,i)?{...s,labels:s.labels.filter(c=>c!==r.to.key)}:A.km.matchRelationship(r,{type:A.km.PARENT_OF_RELATIONSHIP_TYPE,to:i})?{...s,parent:void 0}:s})})]}),Uj=e=>mc.useDirect({params:{id:A.rw.ontologyID(e)}}),Xj={includeParent:!0,includeLabels:!0},kr=Ke({name:"Ranges",retrieve:async({client:e,params:t})=>await e.ranges.retrieve({...Xj,...t}),retrieveByKey:async({client:e,key:t,store:n})=>{const s=n.ranges.get(t);if(s!=null)return s;const r=await e.ranges.retrieve(t);return n.ranges.set(t,r),r},mountListeners:({store:e,onChange:t,onDelete:n,client:s})=>[e.ranges.onSet(r=>{t(r.key,i=>i==null?r:s.ranges.sugarOne({...r.payload,labels:r.labels??i.labels}))}),e.ranges.onDelete(async r=>n(r)),e.relationships.onSet(async r=>{await Tc(r,t,s,e),await Nc(r,t,s,e)})]}),qj=se.z.object({pairs:se.z.array(se.z.object({key:se.z.string(),value:se.z.string()}))}),Oc=se.z.string().transform(e=>e.split("<--->")).transform(([e,t])=>({key:t,range:e})),Qj={channel:A.rw.KV_SET_CHANNEL,schema:A.rw.kvPairZ,onChange:({store:e,changed:t})=>{e.rangeKV.set(A.rw.kvPairKey(t),t)}},Jj={channel:A.rw.KV_DELETE_CHANNEL,schema:Oc,onChange:({store:e,changed:t})=>e.rangeKV.delete(A.rw.kvPairKey(t))},Dc={listeners:[Qj,Jj]},e2=Ke({name:"Range Meta Data",retrieve:async({client:e,params:{rangeKey:t}})=>{const s=await e.ranges.getKV(t).list();return Object.entries(s).map(([r,i])=>({key:r,value:i,range:t}))},retrieveByKey:async({client:e,key:t,params:{rangeKey:n}})=>{if(n==null)return;const r=await e.ranges.getKV(n).get(t);return{key:t,value:r,range:n}},mountListeners:({store:e,onChange:t,onDelete:n,params:{rangeKey:s}})=>[e.rangeKV.onSet(r=>{r.range===s&&t(r.key,r)}),e.rangeKV.onDelete(r=>{const i=Oc.parse(r);i.range===s&&n(i.key)})]}),Bc=A.rw.kvPairZ,t2=sn({name:"Range Meta Data",schema:Bc,retrieve:async()=>{},update:async({client:e,value:t})=>{await e.ranges.getKV(t.range).set(t.key,t.value)},initialValues:{key:"",value:"",range:""}}),n2=st({name:"Range Meta Data",update:async({client:e,value:t,params:{rangeKey:n}})=>{await e.ranges.getKV(n).delete(t)}}),s2=st({name:"Range Meta Data",update:async({client:e,value:t,onChange:n})=>{await e.ranges.getKV(t.range).set(t.key,t.value),n(t)}}),o2=st({name:"Range",update:async({client:e,value:t,onChange:n,store:s})=>{const r=await e.ranges.create(t);s.ranges.set(r.key,r),n(r)}}),r2=st({name:"Range",update:async({client:e,value:t,store:n})=>{await e.ranges.delete(t),n.ranges.delete(t)}}),i2={channel:A.rw.SET_ALIAS_CHANNEL_NAME,schema:A.rw.aliasZ,onChange:({store:e,changed:t})=>{e.rangeAliases.set(A.rw.aliasKey(t),t)}},l2=se.z.string().transform(e=>A.rw.decodeDeleteAliasChange(e)),a2={channel:A.rw.DELETE_ALIAS_CHANNEL_NAME,schema:l2,onChange:({store:e,changed:t})=>e.rangeAliases.delete(A.rw.aliasKey(t))},$c={listeners:[i2,a2]},zc=({timeRange:e,level:t="p",color:n=9,showSpan:s=!1,...r})=>{const i=new u.n(e.start),l=i.isToday?"time":"dateTime",a=new u.n(e.end),c=a.equals(u.n.MAX),d=a.span(i)<u.a.DAY?"time":"dateTime",x=i.span(a),p=o.jsxRuntimeExports.jsxs(f.Text,{x:!0,align:"center",gap:"small",children:[i.isToday&&o.jsxRuntimeExports.jsx(f.Text,{level:t,color:n,weight:450,children:"Today"}),o.jsxRuntimeExports.jsx(f.DateTime,{el:"span",level:t,displayTZ:"local",format:l,color:n,weight:450,children:i})]}),m=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[c?o.jsxRuntimeExports.jsx(f.Text,{level:t,el:"span",children:"Now"}):o.jsxRuntimeExports.jsx(f.DateTime,{level:t,el:"span",displayTZ:"local",format:d,color:n,weight:450,children:a}),!x.isZero&&s&&o.jsxRuntimeExports.jsxs(f.Text,{level:t,color:n,weight:450,el:"span",children:["(",i.span(a).truncate(u.a.MILLISECOND).toString(),")"]})]});return o.jsxRuntimeExports.jsxs(f.Text,{x:!0,gap:"small",className:u.CSS(u.CSS.B("time-range-chip")),align:"center",level:t,color:n,...r,children:[p,o.jsxRuntimeExports.jsx(f.Arrow.Right,{color:9}),m]})},Lr="range",Mr=j.memo(({itemKey:e,showParent:t=!0,showLabels:n=!0,...s})=>{const r=f.useItem(e);if(r==null)return null;const{name:i,parent:l,timeRange:a,labels:c}=r;return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,justify:"between",...s,children:[o.jsxRuntimeExports.jsxs(nr,{children:[o.jsxRuntimeExports.jsx(yn,{weight:450,color:10,children:i}),l!=null&&t&&o.jsxRuntimeExports.jsx(yn,{weight:400,color:8,children:l.name})]}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(zc,{level:"small",timeRange:a}),n&&o.jsxRuntimeExports.jsx(er,{variant:"text",children:c?.map(d=>o.jsxRuntimeExports.jsx(vs,{color:d.color,size:"small",children:d.name},d.key))})]})]})});Mr.displayName="Ranger.ListItem";const Vc=f.renderProp(Mr),Hc=o.jsxRuntimeExports.jsx(f.Range,{}),c2=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=kr({filter:s,initialParams:r}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(bs,{resourceName:"Range",haulType:Lr,value:t,onChange:e,data:l,getItem:c,icon:Hc,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,...i,children:Vc})},u2={style:{width:800}},d2=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,...l})=>{const{data:a,retrieve:c,subscribe:d,getItem:x,status:p}=kr({filter:n,initialParams:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(Tt,{resourceName:"Range",variant:"modal",value:t,onChange:e,data:a,allowNone:s,haulType:Lr,onFetchMore:m,getItem:x,subscribe:d,status:p,onSearch:h,emptyContent:r,icon:Hc,itemHeight:45,dialogProps:u2,...l,children:Vc})},x2=Object.freeze(Object.defineProperty({__proto__:null,ALIAS_STORE_CONFIG:$c,HAUL_TYPE:Lr,KV_STORE_CONFIG:Dc,ListItem:Mr,RANGE_ALIASES_FLUX_STORE_KEY:Pc,RANGE_KV_FLUX_STORE_KEY:Mc,SelectMultiple:c2,SelectSingle:d2,TimeRangeChip:zc,formSchema:Ic,kvPairFormSchema:Bc,metaDataFormSchema:qj,retrieve:Ac,retrieveParent:Kj,toFormValues:No,useChildren:Zj,useDelete:r2,useDeleteKV:n2,useForm:Gj,useKVPairForm:t2,useLabels:Uj,useList:kr,useListKV:e2,useRetrieve:Yj,useSetSynchronizer:Fj,useUpdate:o2,useUpdateKV:s2},Symbol.toStringTag,{value:"Module"})),Fc=({children:e})=>{const{path:t}=f.useUnidirectional({type:T.BaseProvider.TYPE,schema:T.providerStateZ$2,state:{}});return o.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},p2=new Set([u.r.UUID,u.r.JSON]),m2=e=>{if(e.equals(u.r.JSON))return o.jsxRuntimeExports.jsx(f.JSON,{});if(e.isInteger)return o.jsxRuntimeExports.jsx(f.Binary,{});if(e.isFloat)return o.jsxRuntimeExports.jsx(f.Decimal,{});if(e.equals(u.r.STRING)||e.equals(u.r.UUID))return o.jsxRuntimeExports.jsx(f.String,{});if(e.equals(u.r.TIMESTAMP))return o.jsxRuntimeExports.jsx(f.Time$1,{})},Zc=u.r.ALL.filter(e=>e!==u.r.UNKNOWN).map(e=>({key:e.toString(),name:p2.has(e)?e.toString().toUpperCase():u.z.capitalize(e.toString()),icon:m2(e)})),f2=Zc.filter(e=>!new u.r(e.key).isVariable),h2=({hideVariableDensity:e=!1,...t})=>{const n=e?f2:Zc;return o.jsxRuntimeExports.jsx(Mn,{...t,data:n,resourceName:"Data Type"})},g2=Object.freeze(Object.defineProperty({__proto__:null,Provider:Fc,SelectDataType:h2},Symbol.toStringTag,{value:"Module"})),j2=e=>{switch(e.variant){case"disabled":return e.details?.valid===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l12)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l7)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return e.details?.authority===A.Ym.ABSOLUTE_AUTHORITY?{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 schematic to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Kc=({source:e,sink:t,className:n,...s})=>{const r=f.useMemoDeepEqual({source:e,sink:t}),[,{status:i},l]=f.use$2({type:T.Chip.TYPE,schema:T.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:u.n.now(),details:{}}}});j.useEffect(()=>{l(m=>({...m,...r}))},[r,l]);const a=j.useCallback(()=>l(m=>({...m,triggered:!m.triggered})),[l]),{message:c,chipColor:d,buttonStyle:x,disabled:p}=j2(i);return o.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(u.CSS.B("control-chip"),n),disabled:p,onClick:a,tooltip:o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:c}),style:x,...s,children:o.jsxRuntimeExports.jsx(f.Circle,{color:d})})},Yc=j.createContext({needsControlOf:[]}),Wc=()=>j.use(Yc),E2=({children:e,onStatusChange:t,...n})=>{const s=f.useMemoDeepEqual(n),[{path:r},{status:i,needsControlOf:l},a]=f.use$2({type:T.Controller.TYPE,schema:T.controllerStateZ,initialState:s});return j.useEffect(()=>{i!=null&&t?.(i)},[i,t]),j.useEffect(()=>{a(c=>({...c,...s}))},[s,a]),j.useEffect(()=>()=>t?.("released"),[]),o.jsxRuntimeExports.jsxs(Yc,{value:{needsControlOf:l},children:[o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:e}),";"]})},Gc=({colorSource:e,statusSource:t})=>{const n=f.useMemoDeepEqual({colorSource:e,statusSource:t}),[,{color:s,status:r},i]=f.use$2({type:T.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:u.n.now(),details:{color:void 0}}},schema:T.indicatorStateZ});j.useEffect(()=>{i(a=>({...a,...n}))},[n,i]);let l;return r.details?.color!=null?l=u.ir.colorZ.parse(r.details.color):s!=null&&!u.ir.isZero(s)?l=s:l="var(--pluto-gray-l10)",o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:{x:"center",y:"bottom"},children:[o.jsxRuntimeExports.jsx(f.Text,{children:r.message}),o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("indicator"),style:{backgroundColor:u.ir.cssString(l),flexGrow:1}})]})},y2=e=>{const{needsControlOf:t}=Wc(),[,{states:n},s]=f.use$2({type:T.Legend.TYPE,schema:T.legendStateZ,initialState:{states:[],needsControlOf:t}});j.useEffect(()=>{s(l=>({...l,needsControlOf:t}))},[t]);const i=u.c.unique(n.map(l=>l.subject.key)).map(l=>{const a=n.find(c=>c.subject.key===l);if(a==null)throw new A.lt("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return o.jsxRuntimeExports.jsx(rr,{data:i,...e})},Uc=({children:e})=>{const[{path:t}]=f.use$2({type:T.StateProvider.TYPE,schema:T.stateProviderStateZ,initialState:{}});return o.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},S2=Object.freeze(Object.defineProperty({__proto__:null,Chip:Kc,Controller:E2,Indicator:Gc,Legend:y2,StateProvider:Uc,useContext:Wc},Symbol.toStringTag,{value:"Module"})),Xc=e=>{const t=({disabled:n=!1,...s})=>n?s.children:o.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},qc="workspaces",R2={channel:A.hw.SET_CHANNEL_NAME,schema:A.hw.workspaceZ,onChange:({store:e,changed:t})=>e.workspaces.set(t.key,t)},C2={channel:A.hw.DELETE_CHANNEL_NAME,schema:A.hw.keyZ,onChange:({store:e,changed:t})=>e.workspaces.delete(t)},Qc={listeners:[R2,C2]},w2=Ze({name:"Workspace",retrieve:({params:e,client:t})=>t.workspaces.retrieve(e.key),mountListeners:({store:e,params:t,onChange:n})=>[e.workspaces.onSet(n,t.key)]}),b2=Ke({name:"Workspace",retrieve:async({client:e,params:t})=>await e.workspaces.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.workspaces.retrieve(t),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.workspaces.onSet(s=>t(s.key,s)),e.workspaces.onDelete(n)]}),v2=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:qc,STORE_CONFIG:Qc,retrieve:w2,useList:b2},Symbol.toStringTag,{value:"Module"})),_2=Xc(Fc),k2=Xc(f.Provider$4),Jc={[T.FLUX_STORE_KEY]:T.STORE_CONFIG,[xc]:pc,[sc]:oc,[Qa]:Ja,[cc]:uc,[qc]:Qc,[wc]:vc,[bc]:_c,[Mc]:Dc,[Ha]:Fa,[Pc]:$c},L2=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:r,tooltip:i,triggers:l,alamos:a,haul:c,telem:d,color:x})=>o.jsxRuntimeExports.jsx(f.Provider$1,{...l,children:o.jsxRuntimeExports.jsx(f.Config,{...i,children:o.jsxRuntimeExports.jsx(f.Provider$2,{...c,children:o.jsxRuntimeExports.jsx(f.Provider$3,{url:s??Vj,enabled:n,children:o.jsxRuntimeExports.jsx(k2,{workerKey:"vis",children:o.jsxRuntimeExports.jsx(zj,{...a,children:o.jsxRuntimeExports.jsx(f.Aggregator,{children:o.jsxRuntimeExports.jsx(Pa,{connParams:t,children:o.jsxRuntimeExports.jsx(Ta,{storeConfig:Jc,children:o.jsxRuntimeExports.jsx(Ne.Provider,{...x,children:o.jsxRuntimeExports.jsx(f.Provider,{...r,children:o.jsxRuntimeExports.jsx(_2,{...d,children:o.jsxRuntimeExports.jsx(Uc,{children:e})})})})})})})})})})})})}),M2=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:Jc,Provider:L2},Symbol.toStringTag,{value:"Module"})),P2=({value:e})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress"),children:o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress-bar"),style:{width:`${e}%`}})}),N2=Object.freeze(Object.defineProperty({__proto__:null,Progress:P2},Symbol.toStringTag,{value:"Module"})),T2=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(i=>i.key===t);return o.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",className:u.CSS.B("steps"),...s,children:e.map((i,l)=>o.jsxRuntimeExports.jsxs(j.Fragment,{children:[o.jsxRuntimeExports.jsxs(f.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>r,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&o.jsxRuntimeExports.jsx(f.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l10)"}})]},i.key))})},A2=Object.freeze(Object.defineProperty({__proto__:null,Steps:T2},Symbol.toStringTag,{value:"Module"})),I2=({children:e,className:t,visible:n,...s})=>{const[{path:r},,i]=f.use$2({type:T.Table.TYPE,schema:T.Table.stateZ,initialState:{region:u.Ho.ZERO,visible:n}});j.useEffect(()=>{i(a=>({...a,visible:n}))},[n]);const l=Pn(a=>i(c=>({...c,region:a})));return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{ref:l,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),o.jsxRuntimeExports.jsx("table",{className:u.CSS(u.CSS.B("table"),t),...s,children:o.jsxRuntimeExports.jsx("tbody",{children:o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:e})})})]})},O2=({children:e,className:t,size:n,index:s,onResize:r,onSelect:i,position:l,...a})=>o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),t),...a,children:[r!=null&&o.jsxRuntimeExports.jsx(tu,{onSelect:i,index:s,value:n,onChange:r,position:l,direction:"y"}),e]}),Pr=({ref:e,children:t,className:n,selected:s=!1,...r})=>o.jsxRuntimeExports.jsx("td",{ref:e,...r,className:u.CSS(u.CSS.BE("table","cell"),u.CSS.selected(s),n),children:t}),eu="ABCDEFGHIJKLMNOPQRSTUVWXYZ",D2=e=>eu[e],tu=({value:e,selected:t=!1,index:n,onChange:s,position:r,direction:i="x",onSelect:l})=>{const a=f.useSyncedRef(e),c=j.useRef(e),d=Ne.useCursorDrag({onStart:j.useCallback(()=>{c.current=a.current},[]),onMove:j.useCallback(x=>s(c.current+u.Ho.dim(x,i,!0),n),[s,n])});return o.jsxRuntimeExports.jsxs("td",{id:`resizer-${i}-${n}`,className:u.CSS(u.CSS.BE("table","resizer"),u.CSS.dir(i),u.CSS.selected(t),f.CONTEXT_TARGET,t&&f.CONTEXT_SELECTED),style:{[u.g.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[o.jsxRuntimeExports.jsx(f.Text,{full:"x",justify:"center",align:"center",square:!1,children:i==="x"?eu[n]:n+1}),o.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[u.g.location(i)]:r+e},onDragStart:d,draggable:!0})]})},B2=({selected:e,onSelect:t,columns:n,onResize:s})=>{let r=15;return o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),u.CSS.BE("table","col-resizer")),children:[o.jsxRuntimeExports.jsx("td",{}),n.map((i,l)=>{const a=r;return r+=i,o.jsxRuntimeExports.jsx(tu,{onSelect:t,position:a,selected:e.includes(l),index:l,value:i,onChange:c=>s(c,l),direction:"x"},l)})]})},$2=Object.freeze(Object.defineProperty({__proto__:null,Cell:Pr,ColumnIndicators:B2,Row:O2,Table:I2,getCellColumn:D2},Symbol.toStringTag,{value:"Module"})),nu=se.z.object({bounds:u.W.bounds,gradient:u.ir.gradientZ}),Nr={bounds:{lower:0,upper:1},gradient:[]},ki={size:"small",showDragHandle:!1},Li={width:60},z2=u.C.Scale.scale(0,1),Tr=({path:e})=>{const{set:t,get:n}=nn(),s=fr(`${e}.bounds`),r=z2.scale(s);return o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx($e,{inputProps:ki,style:Li,label:"Lower",path:`${e}.bounds.lower`}),o.jsxRuntimeExports.jsx(Ee,{path:`${e}.gradient`,label:"Gradient",align:"start",padHelpText:!1,children:({value:i,onChange:l})=>o.jsxRuntimeExports.jsx(Ne.GradientPicker,{value:A.N.copy(i),scale:r,onChange:a=>{const d={...n(`${e}.bounds`).value},x=a.map(S=>S.position),p=r.pos(Math.max(...x)),m=r.pos(Math.min(...x)),h=p>d.upper,g=m<d.lower;h&&(a[a.length-1].position=1,d.upper=p),g&&(a[0].position=0,d.lower=m);const E=a.map(S=>({...S,color:u.ir.hex(S.color)}));h||g?t(e,{bounds:d,gradient:E}):l(a.map(S=>({...S,color:u.ir.hex(S.color)})))}})}),o.jsxRuntimeExports.jsx($e,{inputProps:ki,style:Li,label:"Upper",path:`${e}.bounds.upper`})]})},V2=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:u.mr.NOTATIONS,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"standard",children:"Standard"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"scientific",children:"Scientific"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"engineering",children:"Engineering"})]}),H2=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Ar=({path:e})=>{const{value:t,onChange:n}=jt(e),s=T.sourcePipelinePropsZ.parse(t.telem?.props),r=T.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=T.stringifyNumberProps.parse(s.segments.stringifier.props),l=T.rollingAverageProps.parse(s.segments.rollingAverage.props),a=h=>{const g=T.sourcePipeline("string",{connections:H2,segments:{valueStream:T.streamChannelValue({channel:r.channel}),stringifier:T.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:T.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:g})},c=h=>a({valueStream:T.streamChannelValue({channel:h??0})}),d=h=>a({stringifier:T.stringifyNumber({...i,notation:h})}),x=h=>a({stringifier:T.stringifyNumber({...i,precision:h})}),p=h=>a({rollingAverage:T.rollingAverage({windowSize:h})});if(typeof r.channel!="number")throw new Error("Must pass in a channel by key to Value.TelemForm");const{data:m}=Rr.useDirect({params:{key:r.channel}});return j.useEffect(()=>{m!=null&&n({...t,tooltip:[m.name]})},[m?.name,n]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(_t,{value:r.channel,onChange:c})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Notation",children:o.jsxRuntimeExports.jsx(V2,{value:i.notation,onChange:d})}),o.jsxRuntimeExports.jsx(Ae.Item,{label:"Precision",align:"start",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),o.jsxRuntimeExports.jsx(Ae.Item,{label:"Averaging Window",align:"start",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})]})},F2=T.Value.z.partial({color:!0}).extend({level:A.levelZ.optional()}),Ir=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:i,level:l="small",backgroundTelem:a,notation:c,location:d,useWidthForBackground:x,valueBackgroundOverScan:p,valueBackgroundShift:m})=>{const h=f.useMemoDeepEqual({box:t,telem:n,color:s,precision:r,level:l,minWidth:i,notation:c,backgroundTelem:a,location:d,useWidthForBackground:x,valueBackgroundOverScan:p,valueBackgroundShift:m}),[,g,E]=f.use$2({aetherKey:e,type:T.Value.TYPE,schema:T.Value.z,initialState:h});return j.useEffect(()=>E(S=>({...S,...h})),[h]),{width:g.width??g.minWidth}},Z2=Object.freeze(Object.defineProperty({__proto__:null,RedlineForm:Tr,TelemForm:Ar,ZERO_READLINE:Nr,corePropsZ:F2,redlineZ:nu,use:Ir},Symbol.toStringTag,{value:"Module"})),K2="text",su=se.z.object({value:se.z.string(),level:A.levelZ,weight:A.weightZ,align:u.K$1.x.or(u.K$1.center),backgroundColor:u.ir.crudeZ}),ou=({cellKey:e,onChange:t,value:n,selected:s,onSelect:r,align:i,level:l,weight:a,backgroundColor:c})=>{const d=p=>r(e,p),x=p=>t({level:l,value:p,weight:a,align:i,backgroundColor:c});return o.jsxRuntimeExports.jsx(Pr,{id:e,className:u.CSS(f.CONTEXT_TARGET,s&&f.CONTEXT_SELECTED,u.CSS.BEM("table","cell","text")),selected:s,onClick:d,onContextMenu:d,style:{backgroundColor:u.ir.cssString(c)},children:o.jsxRuntimeExports.jsx(f.Editable,{level:l,value:n,weight:a,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},Y2="value",ru=se.z.object({telem:T.stringSourceSpecZ,redline:nu,level:A.levelZ,color:se.z.string(),units:se.z.string()}),iu=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:r,bounds:i},selected:l,box:a,onSelect:c})=>{const{width:d}=Ir({aetherKey:e,box:a,telem:t,level:n,color:s,backgroundTelem:T.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:T.scaleNumber({scale:u.C.Scale.scale(i).scale(0,1).transform}),gradient:T.colorGradient({gradient:r})},outlet:"gradient"}),location:{x:"center",y:"center"}}),x=p=>c(e,p);return o.jsxRuntimeExports.jsx(Pr,{id:e,selected:l,onClick:x,onContextMenu:x,style:{height:"5rem",width:d},className:u.CSS(f.CONTEXT_TARGET,l&&f.CONTEXT_SELECTED,u.CSS.BEM("table","cell","value"))})},W2={padding:"2rem"},lo=e=>o.jsxRuntimeExports.jsx(f.Box,{...e,style:W2,y:!0}),G2=[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],lu=({onVariantChange:e})=>{const t=j.useCallback(({tabKey:s})=>{switch(s){case"telem":return o.jsxRuntimeExports.jsx(lo,{children:o.jsxRuntimeExports.jsx(Ar,{path:""})});case"redline":return o.jsxRuntimeExports.jsx(lo,{children:o.jsxRuntimeExports.jsx(Tr,{path:"redline"})});default:return o.jsxRuntimeExports.jsx(lo,{children:o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Or,{onChange:e,value:"value"})}),o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:r,onChange:i,variant:l,...a})=>o.jsxRuntimeExports.jsx(Ne.Swatch,{value:r??u.ir.setAlpha(u.ir.ZERO,1),onChange:i,...a,bordered:!0})}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:r,onChange:i,variant:l,...a})=>o.jsxRuntimeExports.jsx(en,{value:r,onChange:i,...a})})]})})}},[]),n=Me.useStatic({tabs:G2,content:t});return o.jsxRuntimeExports.jsx(Me.Tabs,{...n,size:"small"})},U2={padding:"2rem"},au=({onVariantChange:e})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,style:U2,children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Or,{onChange:e,value:"text"})}),o.jsxRuntimeExports.jsx(hr,{path:"value",label:"Text"}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(en,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(Ee,{path:"weight",label:"Weight",padHelpText:!1,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(ra,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(Ee,{path:"align",label:"Alignment",hideIfNull:!0,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(Ee,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(Ne.Swatch,{value:t,onChange:n})})]}),X2=[{key:"text",name:"Text",icon:o.jsxRuntimeExports.jsx(f.Text$3,{})},{key:"value",name:"Value",icon:o.jsxRuntimeExports.jsx(f.Channel,{})}],Or=e=>o.jsxRuntimeExports.jsx(Mn,{...e,data:X2,resourceName:"Variant"}),q2=["text","value"],Q2=se.z.enum(q2),J2={key:"value",name:"Value",Form:lu,Cell:iu,defaultProps:e=>({telem:T.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:T.streamChannelValue({channel:0}),rollingAverage:T.rollingAverage({windowSize:1}),stringifier:T.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"}),redline:Nr,color:u.ir.hex(e.colors.gray.l10),level:"h5",units:""}),schema:ru},e3={key:"text",name:"Text",Form:au,Cell:ou,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:su},t3={text:e3,value:J2},n3=Object.freeze(Object.defineProperty({__proto__:null,CELLS:t3,SelectVariant:Or,TEXT_TYPE:K2,Text:ou,TextForm:au,VALUE_TYPE:Y2,Value:iu,ValueForm:lu,textPropsZ:su,valuePropsZ:ru,variantZ:Q2},Symbol.toStringTag,{value:"Module"})),Mi=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=St(e,...n);return u.K.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Pi=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:i})=>{if(!s3({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=u.g.construct(t),a=u.g.swap(l);let c=Ct(a,s[a]-e[a]);const d=u.Ho.loc(n,c);if(u.K$1.swap(t)===r){const x=u.Ho.loc(i,u.K$1.swap(c));Math.abs(d-x)<De&&(c=u.K$1.swap(c))}return{direction:a,length:d-e[a]+Lt(c,De)}},To=se.z.object({direction:u.g.direction,length:se.z.number()}),St=(e,...t)=>{let n=e;for(const s of t)n=u.K.translate(n,s.direction,s.length);return n},cu=(e,t,n,s)=>{try{let r=e;const i=[e,...t.map(h=>(r=u.K.translate(r,h.direction,h.length),r))];if(!s)return i;const l=t[0],a=Ct(l.direction,l.length),c=Ni(a),d=4*(2-n**.5);i[0]=u.K.translate(i[0],{[l.direction]:-1*c*d,[u.g.swap(l.direction)]:0});const x=t[t.length-1],p=Ct(x.direction,x.length),m=Ni(p);return i[i.length-1]=u.K.translate(i[i.length-1],{[x.direction]:m*d,[u.g.swap(x.direction)]:0}),i}catch{return[]}},De=10,Ni=e=>e==="top"||e==="left"?-1:1,Lt=(e,t)=>e==="top"||e==="left"?-t:t,Ct=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ft=e=>Ct(e.direction,e.length),s3=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=u.g.construct(n),r=t[s]-e[s];return Lt(n,r)<0},Kn=e=>({direction:u.g.construct(e),length:Lt(e,De)}),Ti={top:Kn("top"),bottom:Kn("bottom"),left:Kn("left"),right:Kn("right")},o3=4,r3=.25,Ps=e=>Ao(i3(Ao(e))),i3=e=>{const t=[...e],n=e.findIndex((s,r)=>{const i=Math.abs(s.length);if(i<o3){if(r===0||r===e.length-1)return!1;if(i<r3)return!0;if(e.length<=3)return!1;if(r+2<e.length){const l=t[r+2];if(l.direction!==s.direction)return!1;t[r+2]={...l,length:l.length+s.length}}else{const l=t[r-2];if(l.direction!==s.direction)return!1;t[r-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},Ao=e=>{const t=[...e];return e.findIndex((s,r)=>{const i=t[r-1];if(r===0||s.direction!==i.direction)return!1;if(r===1){const l=r-1,a=r,c=ft(i),d=ft(s);if(c===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(i.length)===De)return!1;const x=Lt(c,De),p=t[l].length-x,m=t[a].length+p;return Math.abs(m)<De?!1:(t[l]={...t[l],length:x},t[a]={...t[a],length:m},!0)}if(r===e.length-1){const l=r,a=r-1,c=ft(s),d=ft(i);if(c===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(s.length)===De)return!1;const x=Lt(c,De),p=t[l].length-x,m=t[a].length+p;return Math.abs(m)<De?!1:(t[l]={...t[l],length:x},t[a]={...t[a],length:m},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?Ao(t):t},zt=e=>Ps(l3(e)),l3=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:i})=>{let l=i,a=r,c={...Ti[i]},d=St(n,c);const x={...Ti[r]};let p=St(s,x);const m=Math.abs(d.x-p.x),h=Math.abs(d.y-p.y);m<2*De&&h<10&&(c.length-=m/2,x.length+=m/2,d=St(n,c),p=St(s,x));const g=[c],E=Pi({sourceStumpTip:d,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});E!=null&&(g.push(E),d=St(d,E),l=ft(E),c=E);const S=Pi({sourceStumpTip:p,sourceOrientation:a,sourceBox:t,targetStumpTip:d,targetOrientation:l,targetBox:e});S!=null&&(p=St(p,S),a=Ct(S.direction,S.length));const R=()=>{S!=null&&(S.length*=-1,g.push(S)),x.length*=-1,g.push(x)};if(u.K$1.swap(l)===r){const N=u.g.construct(l),I=(p[N]-d[N])/2;g.push({direction:N,length:I});const B=u.g.swap(N);return g.push({direction:B,length:p[B]-d[B]}),g.push({direction:N,length:I}),R(),g}const _=p[c.direction]-d[c.direction];let y=u.g.swap(c.direction);const C=d[y]-p[y];let v;Ct(c.direction,_)===l&&Ct(y,C)===a?v={direction:c.direction,length:_}:(v={direction:y,length:p[y]-d[y]},y=u.g.swap(y)),g.push(v);const L={direction:y,length:p[y]-d[y]};return g.push(L),R(),g},a3=e=>Ps(c3(e)),c3=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],i=u.g.swap(r.direction),l=ft(r);if(t===0){s.unshift({direction:i,length:n});const a=Lt(l,De);s.unshift({direction:r.direction,length:a}),t+=2,s[t]={...s[t],length:s[t].length-a}}else s[t-1]={direction:s[t-1].direction,length:s[t-1].length+n};if(t===s.length-1){s.push({direction:i,length:-n});const a=Lt(l,De);s.push({direction:r.direction,length:a}),s[t]={...s[t],length:s[t].length-a}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},u3=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},d3=(e,t,n=!1,...s)=>{const r=(i,l)=>!s.includes(l)&&t(i,l);return n?u3(e,r):e.findIndex(r)},x3=({delta:e,segments:t})=>Ps(uu(e,t,!1)),p3=({delta:e,segments:t})=>Ps(uu(e,t,!0)),uu=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Ii("x",e,s,n)),e.y!==0&&(s=Ii("y",e,s,n)),s},Ai=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=ft(t),i=ft(s),l=Math.abs(s.length),a=Math.abs(t.length);return(l>a||l>De)&&r===i},Ii=(e,t,n,s)=>{const r=u.g.swap(e),i=s?n.length-1:0,l=n[i];if(Ai(e,l,t)){const p=n[n.length-1];return p.direction===e&&Math.abs(l.length)<De?(n[n.length-1]={...p,length:p.length-t[e]},n):(n[i]={...l,length:l.length-t[e]},n)}const a=s?0:n.length-1,d=d3(n,p=>p.direction===e,s,i);if(d===a){const p=n[a];return Ai(e,p,t)?(n[a]={...p,length:p.length-t[e]},n):(l.direction===e&&Math.abs(l.length)>p.length?n[i]={...l,length:l.length-t[e]}:n[a]={...p,length:p.length-t[e]},n)}if(d===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:r,length:n[0].length/2},{direction:e,length:-t[e]},{direction:r,length:n[0].length/2}]:l.direction===e?(n[i]={...l,length:l.length-t[e]},n):[{direction:r,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const x=n[d];return n[d]={...x,length:x.length-t[e]},n},m3=se.z.object({position:u.K.xy,zoom:se.z.number()}),du=se.z.object({color:u.ir.crudeZ,variant:se.z.string().optional(),segments:se.z.array(To)}),f3=du.extend({key:se.z.string(),source:se.z.string(),target:se.z.string(),segments:se.z.array(To),color:u.ir.crudeZ,id:se.z.string(),data:se.z.object({segments:se.z.array(To),color:u.ir.crudeZ,variant:se.z.string().optional()}).optional(),selected:se.z.boolean(),sourceHandle:se.z.string().nullable().optional(),targetHandle:se.z.string().nullable().optional()}),h3=se.z.object({key:se.z.string(),position:u.K.xy,selected:se.z.boolean().optional(),zIndex:se.z.number().optional(),type:se.z.string().optional(),data:u.u.unknownZ.optional(),measured:se.z.object({width:se.z.number().optional(),height:se.z.number().optional()}).optional()}),Dr=(e,t)=>e.map(n=>({id:n.key,type:"custom",zIndex:n.zIndex,measured:{...n.measured},position:{...n.position},selected:n.selected,data:{},dragHandle:t})),Br=e=>e.map(({segments:t,color:n,variant:s,...r})=>({...r,id:r.key,data:{segments:t,color:n,variant:s}})),xu=e=>e.map(t=>({key:t.id,...t})),pu=(e,t)=>e.map(n=>(n.data??={segments:[],color:t,variant:"pipe"},{key:n.id,segments:n.data?.segments??[],selected:n.selected??!1,color:n.data?.color??t,variant:n.data?.variant??"pipe",...n})),mu=e=>({...e.position,zoom:e.zoom}),fu=e=>({position:u.K.construct(e),zoom:e.zoom}),hu=(e,t)=>xu(t(Dr(e))),ns=(e,t,n)=>pu(t(Br(e)),n),g3=(e,t="x")=>{if(e.length===0)return[];const n=u.K$1.construct(t),s=u.K$1.swap(n);return e.sort((r,i)=>u.Ho.loc(r.box,n)-u.Ho.loc(i.box,n)),e.forEach((r,i)=>{if(i===0)return;const a=e[i-1].handles.find(h=>h.orientation===s),c=r.handles.find(h=>h.orientation===n);if(a==null||c==null)return;const d=a.absolutePosition,x=c.absolutePosition,p=u.K.set(u.K.translation(x,d),t,0),m=u.K.translate(u.Ho.topLeft(r.box),p);r.box=u.Ho.construct(m,u.Ho.dims(r.box))}),e};function Le(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=Le(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var j3={value:()=>{}};function Ns(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new ss(n)}function ss(e){this._=e}function E3(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}ss.prototype=Ns.prototype={constructor:ss,on:function(e,t){var n=this._,s=E3(e+"",n),r,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((r=(e=s[i]).type)&&(r=y3(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(r=(e=s[i]).type)n[r]=Oi(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Oi(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ss(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function y3(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function Oi(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=j3,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Io="http://www.w3.org/1999/xhtml";const Di={svg:"http://www.w3.org/2000/svg",xhtml:Io,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ts(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Di.hasOwnProperty(t)?{space:Di[t],local:e}:e}function S3(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Io&&t.documentElement.namespaceURI===Io?t.createElement(e):t.createElementNS(n,e)}}function R3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gu(e){var t=Ts(e);return(t.local?R3:S3)(t)}function C3(){}function $r(e){return e==null?C3:function(){return this.querySelector(e)}}function w3(e){typeof e!="function"&&(e=$r(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=new Array(l),c,d,x=0;x<l;++x)(c=i[x])&&(d=e.call(c,c.__data__,x,i))&&("__data__"in c&&(d.__data__=c.__data__),a[x]=d);return new Ve(s,this._parents)}function b3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function v3(){return[]}function ju(e){return e==null?v3:function(){return this.querySelectorAll(e)}}function _3(e){return function(){return b3(e.apply(this,arguments))}}function k3(e){typeof e=="function"?e=_3(e):e=ju(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var l=t[i],a=l.length,c,d=0;d<a;++d)(c=l[d])&&(s.push(e.call(c,c.__data__,d,l)),r.push(c));return new Ve(s,r)}function Eu(e){return function(){return this.matches(e)}}function yu(e){return function(t){return t.matches(e)}}var L3=Array.prototype.find;function M3(e){return function(){return L3.call(this.children,e)}}function P3(){return this.firstElementChild}function N3(e){return this.select(e==null?P3:M3(typeof e=="function"?e:yu(e)))}var T3=Array.prototype.filter;function A3(){return Array.from(this.children)}function I3(e){return function(){return T3.call(this.children,e)}}function O3(e){return this.selectAll(e==null?A3:I3(typeof e=="function"?e:yu(e)))}function D3(e){typeof e!="function"&&(e=Eu(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=[],c,d=0;d<l;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&a.push(c);return new Ve(s,this._parents)}function Su(e){return new Array(e.length)}function B3(){return new Ve(this._enter||this._groups.map(Su),this._parents)}function ms(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ms.prototype={constructor:ms,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function $3(e){return function(){return e}}function z3(e,t,n,s,r,i){for(var l=0,a,c=t.length,d=i.length;l<d;++l)(a=t[l])?(a.__data__=i[l],s[l]=a):n[l]=new ms(e,i[l]);for(;l<c;++l)(a=t[l])&&(r[l]=a)}function V3(e,t,n,s,r,i,l){var a,c,d=new Map,x=t.length,p=i.length,m=new Array(x),h;for(a=0;a<x;++a)(c=t[a])&&(m[a]=h=l.call(c,c.__data__,a,t)+"",d.has(h)?r[a]=c:d.set(h,c));for(a=0;a<p;++a)h=l.call(e,i[a],a,i)+"",(c=d.get(h))?(s[a]=c,c.__data__=i[a],d.delete(h)):n[a]=new ms(e,i[a]);for(a=0;a<x;++a)(c=t[a])&&d.get(m[a])===c&&(r[a]=c)}function H3(e){return e.__data__}function F3(e,t){if(!arguments.length)return Array.from(this,H3);var n=t?V3:z3,s=this._parents,r=this._groups;typeof e!="function"&&(e=$3(e));for(var i=r.length,l=new Array(i),a=new Array(i),c=new Array(i),d=0;d<i;++d){var x=s[d],p=r[d],m=p.length,h=Z3(e.call(x,x&&x.__data__,d,s)),g=h.length,E=a[d]=new Array(g),S=l[d]=new Array(g),R=c[d]=new Array(m);n(x,p,E,S,R,h,t);for(var _=0,y=0,C,v;_<g;++_)if(C=E[_]){for(_>=y&&(y=_+1);!(v=S[y])&&++y<g;);C._next=v||null}}return l=new Ve(l,s),l._enter=a,l._exit=c,l}function Z3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function K3(){return new Ve(this._exit||this._groups.map(Su),this._parents)}function Y3(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function W3(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,l=Math.min(r,i),a=new Array(r),c=0;c<l;++c)for(var d=n[c],x=s[c],p=d.length,m=a[c]=new Array(p),h,g=0;g<p;++g)(h=d[g]||x[g])&&(m[g]=h);for(;c<r;++c)a[c]=n[c];return new Ve(a,this._parents)}function G3(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],l;--r>=0;)(l=s[r])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function U3(e){e||(e=X3);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var l=n[i],a=l.length,c=r[i]=new Array(a),d,x=0;x<a;++x)(d=l[x])&&(c[x]=d);c.sort(t)}return new Ve(r,this._parents).order()}function X3(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function q3(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Q3(){return Array.from(this)}function J3(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var l=s[r];if(l)return l}return null}function eE(){let e=0;for(const t of this)++e;return e}function tE(){return!this.node()}function nE(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,l=r.length,a;i<l;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function sE(e){return function(){this.removeAttribute(e)}}function oE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rE(e,t){return function(){this.setAttribute(e,t)}}function iE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function lE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function aE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function cE(e,t){var n=Ts(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?oE:sE:typeof t=="function"?n.local?aE:lE:n.local?iE:rE)(n,t))}function Ru(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function uE(e){return function(){this.style.removeProperty(e)}}function dE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function xE(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function pE(e,t,n){return arguments.length>1?this.each((t==null?uE:typeof t=="function"?xE:dE)(e,t,n??"")):Yt(this.node(),e)}function Yt(e,t){return e.style.getPropertyValue(t)||Ru(e).getComputedStyle(e,null).getPropertyValue(t)}function mE(e){return function(){delete this[e]}}function fE(e,t){return function(){this[e]=t}}function hE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function gE(e,t){return arguments.length>1?this.each((t==null?mE:typeof t=="function"?hE:fE)(e,t)):this.node()[e]}function Cu(e){return e.trim().split(/^|\s+/)}function zr(e){return e.classList||new wu(e)}function wu(e){this._node=e,this._names=Cu(e.getAttribute("class")||"")}wu.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function bu(e,t){for(var n=zr(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function vu(e,t){for(var n=zr(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function jE(e){return function(){bu(this,e)}}function EE(e){return function(){vu(this,e)}}function yE(e,t){return function(){(t.apply(this,arguments)?bu:vu)(this,e)}}function SE(e,t){var n=Cu(e+"");if(arguments.length<2){for(var s=zr(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?yE:t?jE:EE)(n,t))}function RE(){this.textContent=""}function CE(e){return function(){this.textContent=e}}function wE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function bE(e){return arguments.length?this.each(e==null?RE:(typeof e=="function"?wE:CE)(e)):this.node().textContent}function vE(){this.innerHTML=""}function _E(e){return function(){this.innerHTML=e}}function kE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function LE(e){return arguments.length?this.each(e==null?vE:(typeof e=="function"?kE:_E)(e)):this.node().innerHTML}function ME(){this.nextSibling&&this.parentNode.appendChild(this)}function PE(){return this.each(ME)}function NE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function TE(){return this.each(NE)}function AE(e){var t=typeof e=="function"?e:gu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function IE(){return null}function OE(e,t){var n=typeof e=="function"?e:gu(e),s=t==null?IE:typeof t=="function"?t:$r(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function DE(){var e=this.parentNode;e&&e.removeChild(this)}function BE(){return this.each(DE)}function $E(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function zE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function VE(e){return this.select(e?zE:$E)}function HE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function FE(e){return function(t){e.call(this,t,this.__data__)}}function ZE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function KE(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function YE(e,t,n){return function(){var s=this.__on,r,i=FE(t);if(s){for(var l=0,a=s.length;l<a;++l)if((r=s[l]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function WE(e,t,n){var s=ZE(e+""),r,i=s.length,l;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,d=a.length,x;c<d;++c)for(r=0,x=a[c];r<i;++r)if((l=s[r]).type===x.type&&l.name===x.name)return x.value}return}for(a=t?YE:KE,r=0;r<i;++r)this.each(a(s[r],t,n));return this}function _u(e,t,n){var s=Ru(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function GE(e,t){return function(){return _u(this,e,t)}}function UE(e,t){return function(){return _u(this,e,t.apply(this,arguments))}}function XE(e,t){return this.each((typeof t=="function"?UE:GE)(e,t))}function*qE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,l;r<i;++r)(l=s[r])&&(yield l)}var ku=[null];function Ve(e,t){this._groups=e,this._parents=t}function An(){return new Ve([[document.documentElement]],ku)}function QE(){return this}Ve.prototype=An.prototype={constructor:Ve,select:w3,selectAll:k3,selectChild:N3,selectChildren:O3,filter:D3,data:F3,enter:B3,exit:K3,join:Y3,merge:W3,selection:QE,order:G3,sort:U3,call:q3,nodes:Q3,node:J3,size:eE,empty:tE,each:nE,attr:cE,style:pE,property:gE,classed:SE,text:bE,html:LE,raise:PE,lower:TE,append:AE,insert:OE,remove:BE,clone:VE,datum:HE,on:WE,dispatch:XE,[Symbol.iterator]:qE};function ze(e){return typeof e=="string"?new Ve([[document.querySelector(e)]],[document.documentElement]):new Ve([[e]],ku)}function JE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function We(e,t){if(e=JE(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const e5={passive:!1},Cn={capture:!0,passive:!1};function ao(e){e.stopImmediatePropagation()}function Ft(e){e.preventDefault(),e.stopImmediatePropagation()}function Lu(e){var t=e.document.documentElement,n=ze(e).on("dragstart.drag",Ft,Cn);"onselectstart"in t?n.on("selectstart.drag",Ft,Cn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Mu(e,t){var n=e.document.documentElement,s=ze(e).on("dragstart.drag",null);t&&(s.on("click.drag",Ft,Cn),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Yn=e=>()=>e;function Oo(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:l,y:a,dx:c,dy:d,dispatch:x}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:x}})}Oo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function t5(e){return!e.ctrlKey&&!e.button}function n5(){return this.parentNode}function s5(e,t){return t??{x:e.x,y:e.y}}function o5(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pu(){var e=t5,t=n5,n=s5,s=o5,r={},i=Ns("start","drag","end"),l=0,a,c,d,x,p=0;function m(C){C.on("mousedown.drag",h).filter(s).on("touchstart.drag",S).on("touchmove.drag",R,e5).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(C,v){if(!(x||!e.call(this,C,v))){var L=y(this,t.call(this,C,v),C,v,"mouse");L&&(ze(C.view).on("mousemove.drag",g,Cn).on("mouseup.drag",E,Cn),Lu(C.view),ao(C),d=!1,a=C.clientX,c=C.clientY,L("start",C))}}function g(C){if(Ft(C),!d){var v=C.clientX-a,L=C.clientY-c;d=v*v+L*L>p}r.mouse("drag",C)}function E(C){ze(C.view).on("mousemove.drag mouseup.drag",null),Mu(C.view,d),Ft(C),r.mouse("end",C)}function S(C,v){if(e.call(this,C,v)){var L=C.changedTouches,N=t.call(this,C,v),I=L.length,B,z;for(B=0;B<I;++B)(z=y(this,N,C,v,L[B].identifier,L[B]))&&(ao(C),z("start",C,L[B]))}}function R(C){var v=C.changedTouches,L=v.length,N,I;for(N=0;N<L;++N)(I=r[v[N].identifier])&&(Ft(C),I("drag",C,v[N]))}function _(C){var v=C.changedTouches,L=v.length,N,I;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),N=0;N<L;++N)(I=r[v[N].identifier])&&(ao(C),I("end",C,v[N]))}function y(C,v,L,N,I,B){var z=i.copy(),H=We(B||L,v),D,V,w;if((w=n.call(C,new Oo("beforestart",{sourceEvent:L,target:m,identifier:I,active:l,x:H[0],y:H[1],dx:0,dy:0,dispatch:z}),N))!=null)return D=w.x-H[0]||0,V=w.y-H[1]||0,function k(M,O,F){var $=H,Z;switch(M){case"start":r[I]=k,Z=l++;break;case"end":delete r[I],--l;case"drag":H=We(F||O,v),Z=l;break}z.call(M,C,new Oo(M,{sourceEvent:O,subject:w,target:m,identifier:I,active:Z,x:H[0]+D,y:H[1]+V,dx:H[0]-$[0],dy:H[1]-$[1],dispatch:z}),N)}}return m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Yn(!!C),m):e},m.container=function(C){return arguments.length?(t=typeof C=="function"?C:Yn(C),m):t},m.subject=function(C){return arguments.length?(n=typeof C=="function"?C:Yn(C),m):n},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:Yn(!!C),m):s},m.on=function(){var C=i.on.apply(i,arguments);return C===i?m:C},m.clickDistance=function(C){return arguments.length?(p=(C=+C)*C,m):Math.sqrt(p)},m}var Wt=0,fn=0,dn=0,Nu=1e3,fs,hn,hs=0,Mt=0,As=0,wn=typeof performance=="object"&&performance.now?performance:Date,Tu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Vr(){return Mt||(Tu(r5),Mt=wn.now()+As)}function r5(){Mt=0}function gs(){this._call=this._time=this._next=null}gs.prototype=Au.prototype={constructor:gs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Vr():+n)+(t==null?0:+t),!this._next&&hn!==this&&(hn?hn._next=this:fs=this,hn=this),this._call=e,this._time=n,Do()},stop:function(){this._call&&(this._call=null,this._time=1/0,Do())}};function Au(e,t,n){var s=new gs;return s.restart(e,t,n),s}function i5(){Vr(),++Wt;for(var e=fs,t;e;)(t=Mt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Wt}function Bi(){Mt=(hs=wn.now())+As,Wt=fn=0;try{i5()}finally{Wt=0,a5(),Mt=0}}function l5(){var e=wn.now(),t=e-hs;t>Nu&&(As-=t,hs=e)}function a5(){for(var e,t=fs,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:fs=n);hn=e,Do(s)}function Do(e){if(!Wt){fn&&(fn=clearTimeout(fn));var t=e-Mt;t>24?(e<1/0&&(fn=setTimeout(Bi,e-wn.now()-As)),dn&&(dn=clearInterval(dn))):(dn||(hs=wn.now(),dn=setInterval(l5,Nu)),Wt=1,Tu(Bi))}}function $i(e,t,n){var s=new gs;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var c5=Ns("start","end","cancel","interrupt"),u5=[],Iu=0,zi=1,Bo=2,os=3,Vi=4,$o=5,rs=6;function Is(e,t,n,s,r,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;d5(e,n,{name:t,index:s,group:r,on:c5,tween:u5,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Iu})}function Hr(e,t){var n=qe(e,t);if(n.state>Iu)throw new Error("too late; already scheduled");return n}function ot(e,t){var n=qe(e,t);if(n.state>os)throw new Error("too late; already running");return n}function qe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function d5(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=Au(i,0,n.time);function i(d){n.state=zi,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var x,p,m,h;if(n.state!==zi)return c();for(x in s)if(h=s[x],h.name===n.name){if(h.state===os)return $i(l);h.state===Vi?(h.state=rs,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete s[x]):+x<t&&(h.state=rs,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete s[x])}if($i(function(){n.state===os&&(n.state=Vi,n.timer.restart(a,n.delay,n.time),a(d))}),n.state=Bo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Bo){for(n.state=os,r=new Array(m=n.tween.length),x=0,p=-1;x<m;++x)(h=n.tween[x].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=h);r.length=p+1}}function a(d){for(var x=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=$o,1),p=-1,m=r.length;++p<m;)r[p].call(e,x);n.state===$o&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=rs,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function is(e,t){var n=e.__transition,s,r,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){i=!1;continue}r=s.state>Bo&&s.state<$o,s.state=rs,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function x5(e){return this.each(function(){is(this,e)})}function p5(e,t){var n,s;return function(){var r=ot(this,e),i=r.tween;if(i!==n){s=n=i;for(var l=0,a=s.length;l<a;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}r.tween=s}}function m5(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=ot(this,e),l=i.tween;if(l!==s){r=(s=l).slice();for(var a={name:t,value:n},c=0,d=r.length;c<d;++c)if(r[c].name===t){r[c]=a;break}c===d&&r.push(a)}i.tween=r}}function f5(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=qe(this.node(),n).tween,r=0,i=s.length,l;r<i;++r)if((l=s[r]).name===e)return l.value;return null}return this.each((t==null?p5:m5)(n,e,t))}function Fr(e,t,n){var s=e._id;return e.each(function(){var r=ot(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return qe(r,s).value[t]}}function Ou(e,t){var n;return(typeof t=="number"?T.interpolateNumber:t instanceof T.color?T.interpolateRgb:(n=T.color(t))?(t=n,T.interpolateRgb):T.interpolateString)(e,t)}function h5(e){return function(){this.removeAttribute(e)}}function g5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function j5(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttribute(e);return l===r?null:l===s?i:i=t(s=l,n)}}function E5(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===r?null:l===s?i:i=t(s=l,n)}}function y5(e,t,n){var s,r,i;return function(){var l,a=n(this),c;return a==null?void this.removeAttribute(e):(l=this.getAttribute(e),c=a+"",l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a)))}}function S5(e,t,n){var s,r,i;return function(){var l,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),c=a+"",l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a)))}}function R5(e,t){var n=Ts(e),s=n==="transform"?Wg:Ou;return this.attrTween(e,typeof t=="function"?(n.local?S5:y5)(n,s,Fr(this,"attr."+e,t)):t==null?(n.local?g5:h5)(n):(n.local?E5:j5)(n,s,t))}function C5(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function w5(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function b5(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&w5(e,i)),n}return r._value=t,r}function v5(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&C5(e,i)),n}return r._value=t,r}function _5(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=Ts(e);return this.tween(n,(s.local?b5:v5)(s,t))}function k5(e,t){return function(){Hr(this,e).delay=+t.apply(this,arguments)}}function L5(e,t){return t=+t,function(){Hr(this,e).delay=t}}function M5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?k5:L5)(t,e)):qe(this.node(),t).delay}function P5(e,t){return function(){ot(this,e).duration=+t.apply(this,arguments)}}function N5(e,t){return t=+t,function(){ot(this,e).duration=t}}function T5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?P5:N5)(t,e)):qe(this.node(),t).duration}function A5(e,t){if(typeof t!="function")throw new Error;return function(){ot(this,e).ease=t}}function I5(e){var t=this._id;return arguments.length?this.each(A5(t,e)):qe(this.node(),t).ease}function O5(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;ot(this,e).ease=n}}function D5(e){if(typeof e!="function")throw new Error;return this.each(O5(this._id,e))}function B5(e){typeof e!="function"&&(e=Eu(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=[],c,d=0;d<l;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&a.push(c);return new at(s,this._parents,this._name,this._id)}function $5(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),l=new Array(s),a=0;a<i;++a)for(var c=t[a],d=n[a],x=c.length,p=l[a]=new Array(x),m,h=0;h<x;++h)(m=c[h]||d[h])&&(p[h]=m);for(;a<s;++a)l[a]=t[a];return new at(l,this._parents,this._name,this._id)}function z5(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function V5(e,t,n){var s,r,i=z5(t)?Hr:ot;return function(){var l=i(this,e),a=l.on;a!==s&&(r=(s=a).copy()).on(t,n),l.on=r}}function H5(e,t){var n=this._id;return arguments.length<2?qe(this.node(),n).on.on(e):this.each(V5(n,e,t))}function F5(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Z5(){return this.on("end.remove",F5(this._id))}function K5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=$r(e));for(var s=this._groups,r=s.length,i=new Array(r),l=0;l<r;++l)for(var a=s[l],c=a.length,d=i[l]=new Array(c),x,p,m=0;m<c;++m)(x=a[m])&&(p=e.call(x,x.__data__,m,a))&&("__data__"in x&&(p.__data__=x.__data__),d[m]=p,Is(d[m],t,n,m,d,qe(x,n)));return new at(i,this._parents,t,n)}function Y5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ju(e));for(var s=this._groups,r=s.length,i=[],l=[],a=0;a<r;++a)for(var c=s[a],d=c.length,x,p=0;p<d;++p)if(x=c[p]){for(var m=e.call(x,x.__data__,p,c),h,g=qe(x,n),E=0,S=m.length;E<S;++E)(h=m[E])&&Is(h,t,n,E,m,g);i.push(m),l.push(x)}return new at(i,l,t,n)}var W5=An.prototype.constructor;function G5(){return new W5(this._groups,this._parents)}function U5(e,t){var n,s,r;return function(){var i=Yt(this,e),l=(this.style.removeProperty(e),Yt(this,e));return i===l?null:i===n&&l===s?r:r=t(n=i,s=l)}}function Du(e){return function(){this.style.removeProperty(e)}}function X5(e,t,n){var s,r=n+"",i;return function(){var l=Yt(this,e);return l===r?null:l===s?i:i=t(s=l,n)}}function q5(e,t,n){var s,r,i;return function(){var l=Yt(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Yt(this,e))),l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a))}}function Q5(e,t){var n,s,r,i="style."+t,l="end."+i,a;return function(){var c=ot(this,e),d=c.on,x=c.value[i]==null?a||(a=Du(t)):void 0;(d!==n||r!==x)&&(s=(n=d).copy()).on(l,r=x),c.on=s}}function J5(e,t,n){var s=(e+="")=="transform"?Yg:Ou;return t==null?this.styleTween(e,U5(e,s)).on("end.style."+e,Du(e)):typeof t=="function"?this.styleTween(e,q5(e,s,Fr(this,"style."+e,t))).each(Q5(this._id,e)):this.styleTween(e,X5(e,s,t),n).on("end.style."+e,null)}function ey(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function ty(e,t,n){var s,r;function i(){var l=t.apply(this,arguments);return l!==r&&(s=(r=l)&&ey(e,l,n)),s}return i._value=t,i}function ny(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,ty(e,t,n??""))}function sy(e){return function(){this.textContent=e}}function oy(e){return function(){var t=e(this);this.textContent=t??""}}function ry(e){return this.tween("text",typeof e=="function"?oy(Fr(this,"text",e)):sy(e==null?"":e+""))}function iy(e){return function(t){this.textContent=e.call(this,t)}}function ly(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&iy(r)),t}return s._value=e,s}function ay(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,ly(e))}function cy(){for(var e=this._name,t=this._id,n=Bu(),s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)if(c=l[d]){var x=qe(c,t);Is(c,e,n,d,l,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new at(s,this._parents,e,n)}function uy(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,l){var a={value:l},c={value:function(){--r===0&&i()}};n.each(function(){var d=ot(this,s),x=d.on;x!==e&&(t=(e=x).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),d.on=t}),r===0&&i()})}var dy=0;function at(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Bu(){return++dy}var rt=An.prototype;at.prototype={constructor:at,select:K5,selectAll:Y5,selectChild:rt.selectChild,selectChildren:rt.selectChildren,filter:B5,merge:$5,selection:G5,transition:cy,call:rt.call,nodes:rt.nodes,node:rt.node,size:rt.size,empty:rt.empty,each:rt.each,on:H5,attr:R5,attrTween:_5,style:J5,styleTween:ny,text:ry,textTween:ay,remove:Z5,tween:f5,delay:M5,duration:T5,ease:I5,easeVarying:D5,end:uy,[Symbol.iterator]:rt[Symbol.iterator]};function xy(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var py={time:null,delay:0,duration:250,ease:xy};function my(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function fy(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=Bu(),(n=py).time=Vr(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)(c=l[d])&&Is(c,e,t,d,l,n||my(c,t));return new at(s,this._parents,e,t)}An.prototype.interrupt=x5;An.prototype.transition=fy;const Wn=e=>()=>e;function hy(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function lt(e,t,n){this.k=e,this.x=t,this.y=n}lt.prototype={constructor:lt,scale:function(e){return e===1?this:new lt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new lt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Os=new lt(1,0,0);$u.prototype=lt.prototype;function $u(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Os;return e.__zoom}function co(e){e.stopImmediatePropagation()}function xn(e){e.preventDefault(),e.stopImmediatePropagation()}function gy(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function jy(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Hi(){return this.__zoom||Os}function Ey(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function yy(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sy(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function zu(){var e=gy,t=jy,n=Sy,s=Ey,r=yy,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],a=250,c=ts,d=Ns("start","zoom","end"),x,p,m,h=500,g=150,E=0,S=10;function R(w){w.property("__zoom",Hi).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",z).filter(r).on("touchstart.zoom",H).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}R.transform=function(w,k,M,O){var F=w.selection?w.selection():w;F.property("__zoom",Hi),w!==F?v(w,k,M,O):F.interrupt().each(function(){L(this,arguments).event(O).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},R.scaleBy=function(w,k,M,O){R.scaleTo(w,function(){var F=this.__zoom.k,$=typeof k=="function"?k.apply(this,arguments):k;return F*$},M,O)},R.scaleTo=function(w,k,M,O){R.transform(w,function(){var F=t.apply(this,arguments),$=this.__zoom,Z=M==null?C(F):typeof M=="function"?M.apply(this,arguments):M,K=$.invert(Z),q=typeof k=="function"?k.apply(this,arguments):k;return n(y(_($,q),Z,K),F,l)},M,O)},R.translateBy=function(w,k,M,O){R.transform(w,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),l)},null,O)},R.translateTo=function(w,k,M,O,F){R.transform(w,function(){var $=t.apply(this,arguments),Z=this.__zoom,K=O==null?C($):typeof O=="function"?O.apply(this,arguments):O;return n(Os.translate(K[0],K[1]).scale(Z.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof M=="function"?-M.apply(this,arguments):-M),$,l)},O,F)};function _(w,k){return k=Math.max(i[0],Math.min(i[1],k)),k===w.k?w:new lt(k,w.x,w.y)}function y(w,k,M){var O=k[0]-M[0]*w.k,F=k[1]-M[1]*w.k;return O===w.x&&F===w.y?w:new lt(w.k,O,F)}function C(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function v(w,k,M,O){w.on("start.zoom",function(){L(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(O).end()}).tween("zoom",function(){var F=this,$=arguments,Z=L(F,$).event(O),K=t.apply(F,$),q=M==null?C(K):typeof M=="function"?M.apply(F,$):M,te=Math.max(K[1][0]-K[0][0],K[1][1]-K[0][1]),J=F.__zoom,oe=typeof k=="function"?k.apply(F,$):k,ne=c(J.invert(q).concat(te/J.k),oe.invert(q).concat(te/oe.k));return function(re){if(re===1)re=oe;else{var ee=ne(re),ie=te/ee[2];re=new lt(ie,q[0]-ee[0]*ie,q[1]-ee[1]*ie)}Z.zoom(null,re)}})}function L(w,k,M){return!M&&w.__zooming||new N(w,k)}function N(w,k){this.that=w,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(w,k),this.taps=0}N.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,k){return this.mouse&&w!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var k=ze(this.that).datum();d.call(w,this.that,new hy(w,{sourceEvent:this.sourceEvent,target:R,transform:this.that.__zoom,dispatch:d}),k)}};function I(w,...k){if(!e.apply(this,arguments))return;var M=L(this,k).event(w),O=this.__zoom,F=Math.max(i[0],Math.min(i[1],O.k*Math.pow(2,s.apply(this,arguments)))),$=We(w);if(M.wheel)(M.mouse[0][0]!==$[0]||M.mouse[0][1]!==$[1])&&(M.mouse[1]=O.invert(M.mouse[0]=$)),clearTimeout(M.wheel);else{if(O.k===F)return;M.mouse=[$,O.invert($)],is(this),M.start()}xn(w),M.wheel=setTimeout(Z,g),M.zoom("mouse",n(y(_(O,F),M.mouse[0],M.mouse[1]),M.extent,l));function Z(){M.wheel=null,M.end()}}function B(w,...k){if(m||!e.apply(this,arguments))return;var M=w.currentTarget,O=L(this,k,!0).event(w),F=ze(w.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",te,!0),$=We(w,M),Z=w.clientX,K=w.clientY;Lu(w.view),co(w),O.mouse=[$,this.__zoom.invert($)],is(this),O.start();function q(J){if(xn(J),!O.moved){var oe=J.clientX-Z,ne=J.clientY-K;O.moved=oe*oe+ne*ne>E}O.event(J).zoom("mouse",n(y(O.that.__zoom,O.mouse[0]=We(J,M),O.mouse[1]),O.extent,l))}function te(J){F.on("mousemove.zoom mouseup.zoom",null),Mu(J.view,O.moved),xn(J),O.event(J).end()}}function z(w,...k){if(e.apply(this,arguments)){var M=this.__zoom,O=We(w.changedTouches?w.changedTouches[0]:w,this),F=M.invert(O),$=M.k*(w.shiftKey?.5:2),Z=n(y(_(M,$),O,F),t.apply(this,k),l);xn(w),a>0?ze(this).transition().duration(a).call(v,Z,O,w):ze(this).call(R.transform,Z,O,w)}}function H(w,...k){if(e.apply(this,arguments)){var M=w.touches,O=M.length,F=L(this,k,w.changedTouches.length===O).event(w),$,Z,K,q;for(co(w),Z=0;Z<O;++Z)K=M[Z],q=We(K,this),q=[q,this.__zoom.invert(q),K.identifier],F.touch0?!F.touch1&&F.touch0[2]!==q[2]&&(F.touch1=q,F.taps=0):(F.touch0=q,$=!0,F.taps=1+!!x);x&&(x=clearTimeout(x)),$&&(F.taps<2&&(p=q[0],x=setTimeout(function(){x=null},h)),is(this),F.start())}}function D(w,...k){if(this.__zooming){var M=L(this,k).event(w),O=w.changedTouches,F=O.length,$,Z,K,q;for(xn(w),$=0;$<F;++$)Z=O[$],K=We(Z,this),M.touch0&&M.touch0[2]===Z.identifier?M.touch0[0]=K:M.touch1&&M.touch1[2]===Z.identifier&&(M.touch1[0]=K);if(Z=M.that.__zoom,M.touch1){var te=M.touch0[0],J=M.touch0[1],oe=M.touch1[0],ne=M.touch1[1],re=(re=oe[0]-te[0])*re+(re=oe[1]-te[1])*re,ee=(ee=ne[0]-J[0])*ee+(ee=ne[1]-J[1])*ee;Z=_(Z,Math.sqrt(re/ee)),K=[(te[0]+oe[0])/2,(te[1]+oe[1])/2],q=[(J[0]+ne[0])/2,(J[1]+ne[1])/2]}else if(M.touch0)K=M.touch0[0],q=M.touch0[1];else return;M.zoom("touch",n(y(Z,K,q),M.extent,l))}}function V(w,...k){if(this.__zooming){var M=L(this,k).event(w),O=w.changedTouches,F=O.length,$,Z;for(co(w),m&&clearTimeout(m),m=setTimeout(function(){m=null},h),$=0;$<F;++$)Z=O[$],M.touch0&&M.touch0[2]===Z.identifier?delete M.touch0:M.touch1&&M.touch1[2]===Z.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(Z=We(Z,this),Math.hypot(p[0]-Z[0],p[1]-Z[1])<S)){var K=ze(this).on("dblclick.zoom");K&&K.apply(this,arguments)}}}return R.wheelDelta=function(w){return arguments.length?(s=typeof w=="function"?w:Wn(+w),R):s},R.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Wn(!!w),R):e},R.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Wn(!!w),R):r},R.extent=function(w){return arguments.length?(t=typeof w=="function"?w:Wn([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),R):t},R.scaleExtent=function(w){return arguments.length?(i[0]=+w[0],i[1]=+w[1],R):[i[0],i[1]]},R.translateExtent=function(w){return arguments.length?(l[0][0]=+w[0][0],l[1][0]=+w[1][0],l[0][1]=+w[0][1],l[1][1]=+w[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(w){return arguments.length?(n=w,R):n},R.duration=function(w){return arguments.length?(a=+w,R):a},R.interpolate=function(w){return arguments.length?(c=w,R):c},R.on=function(){var w=d.on.apply(d,arguments);return w===d?R:w},R.clickDistance=function(w){return arguments.length?(E=(w=+w)*w,R):Math.sqrt(E)},R.tapDistance=function(w){return arguments.length?(S=+w,R):S},R}const Ie={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},bn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Vu=["Enter"," ","Escape"],Hu={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Pt;(function(e){e.Strict="strict",e.Loose="loose"})(Pt||(Pt={}));var wt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(wt||(wt={}));var Gt;(function(e){e.Partial="partial",e.Full="full"})(Gt||(Gt={}));const Fu={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var mt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(mt||(mt={}));var js;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(js||(js={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const Fi={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function Zu(e){return e===null?null:e?"valid":"invalid"}const Ku=e=>"id"in e&&"source"in e&&"target"in e,Ry=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Zr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),In=(e,t=[0,0])=>{const{width:n,height:s}=ct(e),r=e.origin??t,i=n*r[0],l=s*r[1];return{x:e.position.x-i,y:e.position.y-l}},Cy=(e,t={nodeOrigin:[0,0]})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,r)=>{const i=typeof r=="string";let l=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(r):Zr(r)?r:t.nodeLookup.get(r.id));const a=l?Es(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ds(s,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Bs(n)},On=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(s=>{if(t.filter===void 0||t.filter(s)){const r=Es(s);n=Ds(n,r)}}),Bs(n)},Kr=(e,t,[n,s,r]=[0,0,1],i=!1,l=!1)=>{const a={...Dn(t,[n,s,r]),width:t.width/r,height:t.height/r},c=[];for(const d of e.values()){const{measured:x,selectable:p=!0,hidden:m=!1}=d;if(l&&!p||m)continue;const h=x.width??d.width??d.initialWidth??null,g=x.height??d.height??d.initialHeight??null,E=vn(a,Xt(d)),S=(h??0)*(g??0),R=i&&E>0;(!d.internals.handleBounds||R||E>=S||d.dragging)&&c.push(d)}return c},wy=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function by(e,t){const n=new Map,s=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function vy({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},l){if(e.size===0)return Promise.resolve(!0);const a=by(e,l),c=On(a),d=Yr(c,t,n,l?.minZoom??r,l?.maxZoom??i,l?.padding??.1);return await s.setViewport(d,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function Yu({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const l=n.get(e),a=l.parentId?n.get(l.parentId):void 0,{x:c,y:d}=a?a.internals.positionAbsolute:{x:0,y:0},x=l.origin??s;let p=r;if(l.extent==="parent"&&!l.expandParent)if(!a)i?.("005",Ie.error005());else{const h=a.measured.width,g=a.measured.height;h&&g&&(p=[[c,d],[c+h,d+g]])}else a&&qt(l.extent)&&(p=[[l.extent[0][0]+c,l.extent[0][1]+d],[l.extent[1][0]+c,l.extent[1][1]+d]]);const m=qt(p)?Nt(t,p,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&i?.("015",Ie.error015()),{position:{x:m.x-c+(l.measured.width??0)*x[0],y:m.y-d+(l.measured.height??0)*x[1]},positionAbsolute:m}}async function _y({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(m=>m.id)),l=[];for(const m of n){if(m.deletable===!1)continue;const h=i.has(m.id),g=!h&&m.parentId&&l.find(E=>E.id===m.parentId);(h||g)&&l.push(m)}const a=new Set(t.map(m=>m.id)),c=s.filter(m=>m.deletable!==!1),x=wy(l,c);for(const m of c)a.has(m.id)&&!x.find(g=>g.id===m.id)&&x.push(m);if(!r)return{edges:x,nodes:l};const p=await r({nodes:l,edges:x});return typeof p=="boolean"?p?{edges:x,nodes:l}:{edges:[],nodes:[]}:p}const Ut=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Nt=(e={x:0,y:0},t,n)=>({x:Ut(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Ut(e.y,t[0][1],t[1][1]-(n?.height??0))});function Wu(e,t,n){const{width:s,height:r}=ct(n),{x:i,y:l}=n.internals.positionAbsolute;return Nt(e,[[i,l],[i+s,l+r]],t)}const Zi=(e,t,n)=>e<t?Ut(Math.abs(e-t),1,t)/t:e>n?-Ut(Math.abs(e-n),1,t)/t:0,Gu=(e,t,n=15,s=40)=>{const r=Zi(e.x,s,t.width-s)*n,i=Zi(e.y,s,t.height-s)*n;return[r,i]},Ds=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),zo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Bs=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Xt=(e,t=[0,0])=>{const{x:n,y:s}=Zr(e)?e.internals.positionAbsolute:In(e,t);return{x:n,y:s,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Es=(e,t=[0,0])=>{const{x:n,y:s}=Zr(e)?e.internals.positionAbsolute:In(e,t);return{x:n,y:s,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:s+(e.measured?.height??e.height??e.initialHeight??0)}},Uu=(e,t)=>Bs(Ds(zo(e),zo(t))),vn=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},Ki=e=>Ge(e.width)&&Ge(e.height)&&Ge(e.x)&&Ge(e.y),Ge=e=>!isNaN(e)&&isFinite(e),ys=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},$s=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Dn=({x:e,y:t},[n,s,r],i=!1,l=[1,1])=>{const a={x:(e-n)/r,y:(t-s)/r};return i?$s(a,l):a},Ss=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s});function $t(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ky(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=$t(e,n),r=$t(e,t);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof e=="object"){const s=$t(e.top??e.y??0,n),r=$t(e.bottom??e.y??0,n),i=$t(e.left??e.x??0,t),l=$t(e.right??e.x??0,t);return{top:s,right:l,bottom:r,left:i,x:i+l,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Ly(e,t,n,s,r,i){const{x:l,y:a}=Ss(e,[t,n,s]),{x:c,y:d}=Ss({x:e.x+e.width,y:e.y+e.height},[t,n,s]),x=r-c,p=i-d;return{left:Math.floor(l),top:Math.floor(a),right:Math.floor(x),bottom:Math.floor(p)}}const Yr=(e,t,n,s,r,i)=>{const l=ky(i,t,n),a=(t-l.x)/e.width,c=(n-l.y)/e.height,d=Math.min(a,c),x=Ut(d,s,r),p=e.x+e.width/2,m=e.y+e.height/2,h=t/2-p*x,g=n/2-m*x,E=Ly(e,h,g,x,t,n),S={left:Math.min(E.left-l.left,0),top:Math.min(E.top-l.top,0),right:Math.min(E.right-l.right,0),bottom:Math.min(E.bottom-l.bottom,0)};return{x:h-S.left+S.right,y:g-S.top+S.bottom,zoom:x}},Rs=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function qt(e){return e!==void 0&&e!=="parent"}function ct(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Xu(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function qu(e,t={width:0,height:0},n,s,r){const i={...e},l=s.get(n);if(l){const a=l.origin||r;i.x+=l.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=l.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Yi(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function My(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}function Py(e){return{...Hu,...e||{}}}function jn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:l}=et(e),a=Dn({x:i-(r?.left??0),y:l-(r?.top??0)},s),{x:c,y:d}=n?$s(a,t):a;return{xSnapped:c,ySnapped:d,...a}}const Wr=e=>({width:e.offsetWidth,height:e.offsetHeight}),Qu=e=>e?.getRootNode?.()||window?.document,Ny=["INPUT","SELECT","TEXTAREA"];function Ju(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:Ny.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ed=e=>"clientX"in e,et=(e,t)=>{const n=ed(e),s=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:s-(t?.left??0),y:r-(t?.top??0)}},Wi=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const a=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:r,position:l.getAttribute("data-handlepos"),x:(a.left-n.left)/s,y:(a.top-n.top)/s,...Wr(l)}})};function td({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:l,targetControlY:a}){const c=e*.125+r*.375+l*.375+n*.125,d=t*.125+i*.375+a*.375+s*.125,x=Math.abs(c-e),p=Math.abs(d-t);return[c,d,x,p]}function Gn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Gi({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case Q.Left:return[t-Gn(t-s,i),n];case Q.Right:return[t+Gn(s-t,i),n];case Q.Top:return[t,n-Gn(n-r,i)];case Q.Bottom:return[t,n+Gn(r-n,i)]}}function nd({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top,curvature:l=.25}){const[a,c]=Gi({pos:n,x1:e,y1:t,x2:s,y2:r,c:l}),[d,x]=Gi({pos:i,x1:s,y1:r,x2:e,y2:t,c:l}),[p,m,h,g]=td({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:d,targetControlY:x});return[`M${e},${t} C${a},${c} ${d},${x} ${s},${r}`,p,m,h,g]}function sd({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,l=Math.abs(s-t)/2,a=s<t?s+l:s-l;return[i,a,r,l]}function Ty({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s,elevateOnSelect:r=!1}){if(s!==void 0)return s;const i=r&&n?1e3:0,l=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return i+l}function Ay({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=Ds(Es(e),Es(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return vn(l,Bs(i))>0}const od=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,Iy=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),rd=(e,t)=>{if(!e.source||!e.target)return ys("006",Ie.error006()),t;let n;return Ku(e)?n={...e}:n={...e,id:od(e)},Iy(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},Oy=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...i}=e;if(!t.source||!t.target)return ys("006",Ie.error006()),n;if(!n.find(c=>c.id===e.id))return ys("007",Ie.error007(r)),n;const a={...i,id:s.shouldReplaceId?od(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(c=>c.id!==r).concat(a)};function id({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,l,a]=sd({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,l,a]}const Ui={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},Dy=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Xi=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function By({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:s=Q.Top,center:r,offset:i}){const l=Ui[t],a=Ui[s],c={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+a.x*i,y:n.y+a.y*i},x=Dy({source:c,sourcePosition:t,target:d}),p=x.x!==0?"x":"y",m=x[p];let h=[],g,E;const S={x:0,y:0},R={x:0,y:0},[_,y,C,v]=sd({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*a[p]===-1){g=r.x??_,E=r.y??y;const N=[{x:g,y:c.y},{x:g,y:d.y}],I=[{x:c.x,y:E},{x:d.x,y:E}];l[p]===m?h=p==="x"?N:I:h=p==="x"?I:N}else{const N=[{x:c.x,y:d.y}],I=[{x:d.x,y:c.y}];if(p==="x"?h=l.x===m?I:N:h=l.y===m?N:I,t===s){const V=Math.abs(e[p]-n[p]);if(V<=i){const w=Math.min(i-1,i-V);l[p]===m?S[p]=(c[p]>e[p]?-1:1)*w:R[p]=(d[p]>n[p]?-1:1)*w}}if(t!==s){const V=p==="x"?"y":"x",w=l[p]===a[V],k=c[V]>d[V],M=c[V]<d[V];(l[p]===1&&(!w&&k||w&&M)||l[p]!==1&&(!w&&M||w&&k))&&(h=p==="x"?N:I)}const B={x:c.x+S.x,y:c.y+S.y},z={x:d.x+R.x,y:d.y+R.y},H=Math.max(Math.abs(B.x-h[0].x),Math.abs(z.x-h[0].x)),D=Math.max(Math.abs(B.y-h[0].y),Math.abs(z.y-h[0].y));H>=D?(g=(B.x+z.x)/2,E=h[0].y):(g=h[0].x,E=(B.y+z.y)/2)}return[[e,{x:c.x+S.x,y:c.y+S.y},...h,{x:d.x+R.x,y:d.y+R.y},n],g,E,C,v]}function $y(e,t,n,s){const r=Math.min(Xi(e,t)/2,Xi(t,n)/2,s),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const d=e.x<n.x?-1:1,x=e.y<n.y?1:-1;return`L ${i+r*d},${l}Q ${i},${l} ${i},${l+r*x}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${l+r*c}Q ${i},${l} ${i+r*a},${l}`}function Vo({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top,borderRadius:l=5,centerX:a,centerY:c,offset:d=20}){const[x,p,m,h,g]=By({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:a,y:c},offset:d});return[x.reduce((S,R,_)=>{let y="";return _>0&&_<x.length-1?y=$y(x[_-1],R,x[_+1],l):y=`${_===0?"M":"L"}${R.x} ${R.y}`,S+=y,S},""),p,m,h,g]}function qi(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function zy(e){const{sourceNode:t,targetNode:n}=e;if(!qi(t)||!qi(n))return null;const s=t.internals.handleBounds||Qi(t.handles),r=n.internals.handleBounds||Qi(n.handles),i=Ji(s?.source??[],e.sourceHandle),l=Ji(e.connectionMode===Pt.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!l)return e.onError?.("008",Ie.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Q.Bottom,c=l?.position||Q.Top,d=_n(t,i,a),x=_n(n,l,c);return{sourceX:d.x,sourceY:d.y,targetX:x.x,targetY:x.y,sourcePosition:a,targetPosition:c}}function Qi(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function _n(e,t,n=Q.Left,s=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:l,height:a}=t??ct(e);if(s)return{x:r+l/2,y:i+a/2};switch(t?.position??n){case Q.Top:return{x:r+l/2,y:i};case Q.Right:return{x:r+l,y:i+a/2};case Q.Bottom:return{x:r+l/2,y:i+a};case Q.Left:return{x:r,y:i+a/2}}}function Ji(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Ho(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function Vy(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((l,a)=>([a.markerStart||s,a.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const d=Ho(c,t);i.has(d)||(l.push({id:d,color:c.color||n,...c}),i.add(d))}}),l),[]).sort((l,a)=>l.id.localeCompare(a.id))}const Gr={nodeOrigin:[0,0],nodeExtent:bn,elevateNodesOnSelect:!0,defaults:{}},Hy={...Gr,checkEquality:!0};function Ur(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Fy(e,t,n){const s=Ur(Gr,n);for(const r of e.values())if(r.parentId)Xr(r,e,t,s);else{const i=In(r,s.nodeOrigin),l=qt(r.extent)?r.extent:s.nodeExtent,a=Nt(i,l,ct(r));r.internals.positionAbsolute=a}}function Fo(e,t,n,s){const r=Ur(Hy,s);let i=e.length>0;const l=new Map(t),a=r?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let d=l.get(c.id);if(r.checkEquality&&c===d?.internals.userNode)t.set(c.id,d);else{const x=In(c,r.nodeOrigin),p=qt(c.extent)?c.extent:r.nodeExtent,m=Nt(x,p,ct(c));d={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:m,handleBounds:c.measured?d?.internals.handleBounds:void 0,z:ld(c,a),userNode:c}},t.set(c.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(i=!1),c.parentId&&Xr(d,t,n,s)}return i}function Zy(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Xr(e,t,n,s){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:l}=Ur(Gr,s),a=e.parentId,c=t.get(a);if(!c){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Zy(e,n);const d=r?1e3:0,{x,y:p,z:m}=Ky(e,c,i,l,d),{positionAbsolute:h}=e.internals,g=x!==h.x||p!==h.y;(g||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x,y:p}:h,z:m}})}function ld(e,t){return(Ge(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Ky(e,t,n,s,r){const{x:i,y:l}=t.internals.positionAbsolute,a=ct(e),c=In(e,n),d=qt(e.extent)?Nt(c,e.extent,a):c;let x=Nt({x:i+d.x,y:l+d.y},s,a);e.extent==="parent"&&(x=Wu(x,a,t));const p=ld(e,r),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>=p?m+1:p}}function qr(e,t,n,s=[0,0]){const r=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const c=i.get(l.parentId)?.expandedRect??Xt(a),d=Uu(c,l.rect);i.set(l.parentId,{expandedRect:d,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},c)=>{const d=a.internals.positionAbsolute,x=ct(a),p=a.origin??s,m=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,h=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,g=Math.max(x.width,Math.round(l.width)),E=Math.max(x.height,Math.round(l.height)),S=(g-x.width)*p[0],R=(E-x.height)*p[1];(m>0||h>0||S||R)&&(r.push({id:c,type:"position",position:{x:a.position.x-m+S,y:a.position.y-h+R}}),n.get(c)?.forEach(_=>{e.some(y=>y.id===_.id)||r.push({id:_.id,type:"position",position:{x:_.position.x+m,y:_.position.y+h}})})),(x.width<l.width||x.height<l.height||m||h)&&r.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:g+(m?p[0]*m-S:0),height:E+(h?p[1]*h-R:0)}})}),r}function Yy(e,t,n,s,r,i){const l=s?.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const c=[],d=window.getComputedStyle(l),{m22:x}=new window.DOMMatrixReadOnly(d.transform),p=[];for(const m of e.values()){const h=t.get(m.id);if(!h)continue;if(h.hidden){t.set(h.id,{...h,internals:{...h.internals,handleBounds:void 0}}),a=!0;continue}const g=Wr(m.nodeElement),E=h.measured.width!==g.width||h.measured.height!==g.height;if(!!(g.width&&g.height&&(E||!h.internals.handleBounds||m.force))){const R=m.nodeElement.getBoundingClientRect(),_=qt(h.extent)?h.extent:i;let{positionAbsolute:y}=h.internals;h.parentId&&h.extent==="parent"?y=Wu(y,g,t.get(h.parentId)):_&&(y=Nt(y,_,g));const C={...h,measured:g,internals:{...h.internals,positionAbsolute:y,handleBounds:{source:Wi("source",m.nodeElement,R,x,h.id),target:Wi("target",m.nodeElement,R,x,h.id)}}};t.set(h.id,C),h.parentId&&Xr(C,t,n,{nodeOrigin:r}),a=!0,E&&(c.push({id:h.id,type:"dimensions",dimensions:g}),h.expandParent&&h.parentId&&p.push({id:h.id,parentId:h.parentId,rect:Xt(C,r)}))}}if(p.length>0){const m=qr(p,t,n,r);c.push(...m)}return{changes:c,updatedInternals:a}}async function Wy({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],s),a=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(a)}function el(e,t,n,s,r,i){let l=r;const a=s.get(l)||new Map;s.set(l,a.set(n,t)),l=`${r}-${e}`;const c=s.get(l)||new Map;if(s.set(l,c.set(n,t)),i){l=`${r}-${e}-${i}`;const d=s.get(l)||new Map;s.set(l,d.set(n,t))}}function ad(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:l=null,targetHandle:a=null}=s,c={edgeId:s.id,source:r,target:i,sourceHandle:l,targetHandle:a},d=`${r}-${l}--${i}-${a}`,x=`${i}-${a}--${r}-${l}`;el("source",c,x,e,r,l),el("target",c,d,e,i,a),t.set(s.id,s)}}function cd(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:cd(n,t):!1}function tl(e,t,n){let s=e;do{if(s?.matches?.(t))return!0;if(s===n)return!1;s=s?.parentElement}while(s);return!1}function Gy(e,t,n,s){const r=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!cd(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function uo({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){const r=[];for(const[l,a]of t){const c=n.get(l)?.internals.userNode;c&&r.push({...c,position:a.position,dragging:s})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:s}:r[0],r]}function Uy({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},l=0,a=new Map,c=!1,d={x:0,y:0},x=null,p=!1,m=null,h=!1,g=!1;function E({noDragClassName:R,handleSelector:_,domNode:y,isSelectable:C,nodeId:v,nodeClickDistance:L=0}){m=ze(y);function N({x:H,y:D},V){const{nodeLookup:w,nodeExtent:k,snapGrid:M,snapToGrid:O,nodeOrigin:F,onNodeDrag:$,onSelectionDrag:Z,onError:K,updateNodePositions:q}=t();i={x:H,y:D};let te=!1,J={x:0,y:0,x2:0,y2:0};if(a.size>1&&k){const oe=On(a);J=zo(oe)}for(const[oe,ne]of a){if(!w.has(oe))continue;let re={x:H-ne.distance.x,y:D-ne.distance.y};O&&(re=$s(re,M));let ee=[[k[0][0],k[0][1]],[k[1][0],k[1][1]]];if(a.size>1&&k&&!ne.extent){const{positionAbsolute:Se}=ne.internals,ue=Se.x-J.x+k[0][0],me=Se.x+ne.measured.width-J.x2+k[1][0],U=Se.y-J.y+k[0][1],de=Se.y+ne.measured.height-J.y2+k[1][1];ee=[[ue,U],[me,de]]}const{position:ie,positionAbsolute:ye}=Yu({nodeId:oe,nextPosition:re,nodeLookup:w,nodeExtent:ee,nodeOrigin:F,onError:K});te=te||ne.position.x!==ie.x||ne.position.y!==ie.y,ne.position=ie,ne.internals.positionAbsolute=ye}if(g=g||te,!!te&&(q(a,!0),V&&(s||$||!v&&Z))){const[oe,ne]=uo({nodeId:v,dragItems:a,nodeLookup:w});s?.(V,a,oe,ne),$?.(V,oe,ne),v||Z?.(V,ne)}}async function I(){if(!x)return;const{transform:H,panBy:D,autoPanSpeed:V,autoPanOnNodeDrag:w}=t();if(!w){c=!1,cancelAnimationFrame(l);return}const[k,M]=Gu(d,x,V);(k!==0||M!==0)&&(i.x=(i.x??0)-k/H[2],i.y=(i.y??0)-M/H[2],await D({x:k,y:M})&&N(i,null)),l=requestAnimationFrame(I)}function B(H){const{nodeLookup:D,multiSelectionActive:V,nodesDraggable:w,transform:k,snapGrid:M,snapToGrid:O,selectNodesOnDrag:F,onNodeDragStart:$,onSelectionDragStart:Z,unselectNodesAndEdges:K}=t();p=!0,(!F||!C)&&!V&&v&&(D.get(v)?.selected||K()),C&&F&&v&&e?.(v);const q=jn(H.sourceEvent,{transform:k,snapGrid:M,snapToGrid:O,containerBounds:x});if(i=q,a=Gy(D,w,q,v),a.size>0&&(n||$||!v&&Z)){const[te,J]=uo({nodeId:v,dragItems:a,nodeLookup:D});n?.(H.sourceEvent,a,te,J),$?.(H.sourceEvent,te,J),v||Z?.(H.sourceEvent,J)}}const z=Pu().clickDistance(L).on("start",H=>{const{domNode:D,nodeDragThreshold:V,transform:w,snapGrid:k,snapToGrid:M}=t();x=D?.getBoundingClientRect()||null,h=!1,g=!1,V===0&&B(H),i=jn(H.sourceEvent,{transform:w,snapGrid:k,snapToGrid:M,containerBounds:x}),d=et(H.sourceEvent,x)}).on("drag",H=>{const{autoPanOnNodeDrag:D,transform:V,snapGrid:w,snapToGrid:k,nodeDragThreshold:M,nodeLookup:O}=t(),F=jn(H.sourceEvent,{transform:V,snapGrid:w,snapToGrid:k,containerBounds:x});if((H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||v&&!O.has(v))&&(h=!0),!h){if(!c&&D&&p&&(c=!0,I()),!p){const $=F.xSnapped-(i.x??0),Z=F.ySnapped-(i.y??0);Math.sqrt($*$+Z*Z)>M&&B(H)}(i.x!==F.xSnapped||i.y!==F.ySnapped)&&a&&p&&(d=et(H.sourceEvent,x),N(F,H.sourceEvent))}}).on("end",H=>{if(!(!p||h)&&(c=!1,p=!1,cancelAnimationFrame(l),a.size>0)){const{nodeLookup:D,updateNodePositions:V,onNodeDragStop:w,onSelectionDragStop:k}=t();if(g&&(V(a,!1),g=!1),r||w||!v&&k){const[M,O]=uo({nodeId:v,dragItems:a,nodeLookup:D,dragging:!1});r?.(H.sourceEvent,a,M,O),w?.(H.sourceEvent,M,O),v||k?.(H.sourceEvent,O)}}}).filter(H=>{const D=H.target;return!H.button&&(!R||!tl(D,`.${R}`,y))&&(!_||tl(D,_,y))});m.call(z)}function S(){m?.on(".drag",null)}return{update:E,destroy:S}}function Xy(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())vn(r,Xt(i))>0&&s.push(i);return s}const qy=250;function Qy(e,t,n,s){let r=[],i=1/0;const l=Xy(e,n,t+qy);for(const a of l){const c=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const d of c){if(s.nodeId===d.nodeId&&s.type===d.type&&s.id===d.id)continue;const{x,y:p}=_n(a,d,d.position,!0),m=Math.sqrt(Math.pow(x-e.x,2)+Math.pow(p-e.y,2));m>t||(m<i?(r=[{...d,x,y:p}],i=m):m===i&&r.push({...d,x,y:p}))}}if(!r.length)return null;if(r.length>1){const a=s.type==="source"?"target":"source";return r.find(c=>c.type===a)??r[0]}return r[0]}function ud(e,t,n,s,r,i=!1){const l=s.get(e);if(!l)return null;const a=r==="strict"?l.internals.handleBounds?.[t]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],c=(n?a?.find(d=>d.id===n):a?.[0])??null;return c&&i?{...c,..._n(l,c,c.position,!0)}:c}function dd(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Jy(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const xd=()=>!0;function eS(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:l,domNode:a,nodeLookup:c,lib:d,autoPanOnConnect:x,flowId:p,panBy:m,cancelConnection:h,onConnectStart:g,onConnect:E,onConnectEnd:S,isValidConnection:R=xd,onReconnectEnd:_,updateConnection:y,getTransform:C,getFromHandle:v,autoPanSpeed:L,dragThreshold:N=1}){const I=Qu(e.target);let B=0,z;const{x:H,y:D}=et(e),V=I?.elementFromPoint(H,D),w=dd(i,V),k=a?.getBoundingClientRect();let M=!1;if(!k||!w)return;const O=ud(r,w,s,c,t);if(!O)return;let F=et(e,k),$=!1,Z=null,K=!1,q=null;function te(){if(!x||!k)return;const[Se,ue]=Gu(F,k,L);m({x:Se,y:ue}),B=requestAnimationFrame(te)}const J={...O,nodeId:r,type:w,position:O.position},oe=c.get(r);let re={inProgress:!0,isValid:null,from:_n(oe,J,Q.Left,!0),fromHandle:J,fromPosition:J.position,fromNode:oe,to:F,toHandle:null,toPosition:Fi[J.position],toNode:null};function ee(){M=!0,y(re),g?.(e,{nodeId:r,handleId:s,handleType:w})}N===0&&ee();function ie(Se){if(!M){const{x:de,y:be}=et(Se),Te=de-H,Qe=be-D;if(!(Te*Te+Qe*Qe>N*N))return;ee()}if(!v()||!J){ye(Se);return}const ue=C();F=et(Se,k),z=Qy(Dn(F,ue,!1,[1,1]),n,c,J),$||(te(),$=!0);const me=pd(Se,{handle:z,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:l?"target":"source",isValidConnection:R,doc:I,lib:d,flowId:p,nodeLookup:c});q=me.handleDomNode,Z=me.connection,K=Jy(!!z,me.isValid);const U={...re,isValid:K,to:me.toHandle&&K?Ss({x:me.toHandle.x,y:me.toHandle.y},ue):F,toHandle:me.toHandle,toPosition:K&&me.toHandle?me.toHandle.position:Fi[J.position],toNode:me.toHandle?c.get(me.toHandle.nodeId):null};K&&z&&re.toHandle&&U.toHandle&&re.toHandle.type===U.toHandle.type&&re.toHandle.nodeId===U.toHandle.nodeId&&re.toHandle.id===U.toHandle.id&&re.to.x===U.to.x&&re.to.y===U.to.y||(y(U),re=U)}function ye(Se){if(M){(z||q)&&Z&&K&&E?.(Z);const{inProgress:ue,...me}=re,U={...me,toPosition:re.toHandle?re.toPosition:null};S?.(Se,U),i&&_?.(Se,U)}h(),cancelAnimationFrame(B),$=!1,K=!1,Z=null,q=null,I.removeEventListener("mousemove",ie),I.removeEventListener("mouseup",ye),I.removeEventListener("touchmove",ie),I.removeEventListener("touchend",ye)}I.addEventListener("mousemove",ie),I.addEventListener("mouseup",ye),I.addEventListener("touchmove",ie),I.addEventListener("touchend",ye)}function pd(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:l,lib:a,flowId:c,isValidConnection:d=xd,nodeLookup:x}){const p=i==="target",m=t?l.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:g}=et(e),E=l.elementFromPoint(h,g),S=E?.classList.contains(`${a}-flow__handle`)?E:m,R={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const _=dd(void 0,S),y=S.getAttribute("data-nodeid"),C=S.getAttribute("data-handleid"),v=S.classList.contains("connectable"),L=S.classList.contains("connectableend");if(!y||!_)return R;const N={source:p?y:s,sourceHandle:p?C:r,target:p?s:y,targetHandle:p?r:C};R.connection=N;const B=v&&L&&(n===Pt.Strict?p&&_==="source"||!p&&_==="target":y!==s||C!==r);R.isValid=B&&d(N),R.toHandle=ud(y,_,C,x,n,!0)}return R}const Zo={onPointerDown:eS,isValid:pd};function tS({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=ze(e);function i({translateExtent:a,width:c,height:d,zoomStep:x=10,pannable:p=!0,zoomable:m=!0,inversePan:h=!1}){const g=y=>{const C=n();if(y.sourceEvent.type!=="wheel"||!t)return;const v=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*x,L=C[2]*Math.pow(2,v);t.scaleTo(L)};let E=[0,0];const S=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},R=y=>{const C=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const v=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],L=[v[0]-E[0],v[1]-E[1]];E=v;const N=s()*Math.max(C[2],Math.log(C[2]))*(h?-1:1),I={x:C[0]-L[0]*N,y:C[1]-L[1]*N},B=[[0,0],[c,d]];t.setViewportConstrained({x:I.x,y:I.y,zoom:C[2]},B,a)},_=zu().on("start",S).on("zoom",p?R:null).on("zoom.wheel",m?g:null);r.call(_,{})}function l(){r.on("zoom",null)}return{update:i,destroy:l,pointer:We}}const nS=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,zs=e=>({x:e.x,y:e.y,zoom:e.k}),xo=({x:e,y:t,zoom:n})=>Os.translate(e,t).scale(n),Vt=(e,t)=>e.target.closest(`.${t}`),md=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),sS=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,po=(e,t=0,n=sS,s=()=>{})=>{const r=typeof t=="number"&&t>0;return r||s(),r?e.transition().duration(t).ease(n).on("end",s):e},fd=e=>{const t=e.ctrlKey&&Rs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function oS({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:d}){return x=>{if(Vt(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const S=We(x),R=fd(x),_=p*Math.pow(2,R);s.scaleTo(n,_,S,x);return}const m=x.deltaMode===1?20:1;let h=r===wt.Vertical?0:x.deltaX*m,g=r===wt.Horizontal?0:x.deltaY*m;!Rs()&&x.shiftKey&&r!==wt.Vertical&&(h=x.deltaY*m,g=0),s.translateBy(n,-(h/p)*i,-(g/p)*i,{internal:!0});const E=zs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a?.(x,E)),e.isPanScrolling&&(c?.(x,E),e.panScrollTimeout=setTimeout(()=>{d?.(x,E),e.isPanScrolling=!1},150))}}function rS({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){const i=s.type==="wheel",l=!t&&i&&!s.ctrlKey,a=Vt(s,e);if(s.ctrlKey&&i&&a&&s.preventDefault(),l||a)return null;s.preventDefault(),n.call(this,s,r)}}function iS({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{if(s.sourceEvent?.internal)return;const r=zs(s.transform);e.mouseButton=s.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,s.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(s.sourceEvent,r)}}function lS({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&md(t,e.mouseButton??0)),i.sourceEvent?.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,zs(i.transform))}}function aS({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return l=>{if(!l.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&md(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),r&&nS(e.prevViewport,l.transform))){const a=zs(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(l.sourceEvent,a)},n?150:0)}}}function cS({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:a,noPanClassName:c,lib:d}){return x=>{const p=e||t,m=n&&x.ctrlKey;if(x.button===1&&x.type==="mousedown"&&(Vt(x,`${d}-flow__node`)||Vt(x,`${d}-flow__edge`)))return!0;if(!s&&!p&&!r&&!i&&!n||l||Vt(x,a)&&x.type==="wheel"||Vt(x,c)&&(x.type!=="wheel"||r&&x.type==="wheel"&&!e)||!n&&x.ctrlKey&&x.type==="wheel")return!1;if(!n&&x.type==="touchstart"&&x.touches?.length>1)return x.preventDefault(),!1;if(!p&&!r&&!m&&x.type==="wheel"||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const h=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||x.type==="wheel")&&h}}function uS({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:r,viewport:i,onPanZoom:l,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:d}){const x={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),m=zu().clickDistance(!Ge(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(r),h=ze(e).call(m);y({x:i.x,y:i.y,zoom:Ut(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const g=h.on("wheel.zoom"),E=h.on("dblclick.zoom");m.wheelDelta(fd);function S(D,V){return h?new Promise(w=>{m?.interpolate(V?.interpolate==="linear"?T.interpolate:ts).transform(po(h,V?.duration,V?.ease,()=>w(!0)),D)}):Promise.resolve(!1)}function R({noWheelClassName:D,noPanClassName:V,onPaneContextMenu:w,userSelectionActive:k,panOnScroll:M,panOnDrag:O,panOnScrollMode:F,panOnScrollSpeed:$,preventScrolling:Z,zoomOnPinch:K,zoomOnScroll:q,zoomOnDoubleClick:te,zoomActivationKeyPressed:J,lib:oe,onTransformChange:ne}){k&&!x.isZoomingOrPanning&&_();const ee=M&&!J&&!k?oS({zoomPanValues:x,noWheelClassName:D,d3Selection:h,d3Zoom:m,panOnScrollMode:F,panOnScrollSpeed:$,zoomOnPinch:K,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}):rS({noWheelClassName:D,preventScrolling:Z,d3ZoomHandler:g});if(h.on("wheel.zoom",ee,{passive:!1}),!k){const ye=iS({zoomPanValues:x,onDraggingChange:d,onPanZoomStart:a});m.on("start",ye);const Se=lS({zoomPanValues:x,panOnDrag:O,onPaneContextMenu:!!w,onPanZoom:l,onTransformChange:ne});m.on("zoom",Se);const ue=aS({zoomPanValues:x,panOnDrag:O,panOnScroll:M,onPaneContextMenu:w,onPanZoomEnd:c,onDraggingChange:d});m.on("end",ue)}const ie=cS({zoomActivationKeyPressed:J,panOnDrag:O,zoomOnScroll:q,panOnScroll:M,zoomOnDoubleClick:te,zoomOnPinch:K,userSelectionActive:k,noPanClassName:V,noWheelClassName:D,lib:oe});m.filter(ie),te?h.on("dblclick.zoom",E):h.on("dblclick.zoom",null)}function _(){m.on("zoom",null)}async function y(D,V,w){const k=xo(D),M=m?.constrain()(k,V,w);return M&&await S(M),new Promise(O=>O(M))}async function C(D,V){const w=xo(D);return await S(w,V),new Promise(k=>k(w))}function v(D){if(h){const V=xo(D),w=h.property("__zoom");(w.k!==D.zoom||w.x!==D.x||w.y!==D.y)&&m?.transform(h,V,null,{sync:!0})}}function L(){const D=h?$u(h.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}function N(D,V){return h?new Promise(w=>{m?.interpolate(V?.interpolate==="linear"?T.interpolate:ts).scaleTo(po(h,V?.duration,V?.ease,()=>w(!0)),D)}):Promise.resolve(!1)}function I(D,V){return h?new Promise(w=>{m?.interpolate(V?.interpolate==="linear"?T.interpolate:ts).scaleBy(po(h,V?.duration,V?.ease,()=>w(!0)),D)}):Promise.resolve(!1)}function B(D){m?.scaleExtent(D)}function z(D){m?.translateExtent(D)}function H(D){const V=!Ge(D)||D<0?0:D;m?.clickDistance(V)}return{update:R,destroy:_,setViewport:C,setViewportConstrained:y,getViewport:L,scaleTo:N,scaleBy:I,setScaleExtent:B,setTranslateExtent:z,syncViewport:v,setClickDistance:H}}var Qt;(function(e){e.Line="line",e.Handle="handle"})(Qt||(Qt={}));function dS({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const l=e-t,a=n-s,c=[l>0?1:l<0?-1:0,a>0?1:a<0?-1:0];return l&&r&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function xS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function dt(e,t){return Math.max(0,t-e)}function xt(e,t){return Math.max(0,e-t)}function Un(e,t,n){return Math.max(0,t-e,e-n)}function nl(e,t){return e?!t:t}function pS(e,t,n,s,r,i,l,a){let{affectsX:c,affectsY:d}=t;const{isHorizontal:x,isVertical:p}=t,m=x&&p,{xSnapped:h,ySnapped:g}=n,{minWidth:E,maxWidth:S,minHeight:R,maxHeight:_}=s,{x:y,y:C,width:v,height:L,aspectRatio:N}=e;let I=Math.floor(x?h-e.pointerX:0),B=Math.floor(p?g-e.pointerY:0);const z=v+(c?-I:I),H=L+(d?-B:B),D=-i[0]*v,V=-i[1]*L;let w=Un(z,E,S),k=Un(H,R,_);if(l){let F=0,$=0;c&&I<0?F=dt(y+I+D,l[0][0]):!c&&I>0&&(F=xt(y+z+D,l[1][0])),d&&B<0?$=dt(C+B+V,l[0][1]):!d&&B>0&&($=xt(C+H+V,l[1][1])),w=Math.max(w,F),k=Math.max(k,$)}if(a){let F=0,$=0;c&&I>0?F=xt(y+I,a[0][0]):!c&&I<0&&(F=dt(y+z,a[1][0])),d&&B>0?$=xt(C+B,a[0][1]):!d&&B<0&&($=dt(C+H,a[1][1])),w=Math.max(w,F),k=Math.max(k,$)}if(r){if(x){const F=Un(z/N,R,_)*N;if(w=Math.max(w,F),l){let $=0;!c&&!d||c&&!d&&m?$=xt(C+V+z/N,l[1][1])*N:$=dt(C+V+(c?I:-I)/N,l[0][1])*N,w=Math.max(w,$)}if(a){let $=0;!c&&!d||c&&!d&&m?$=dt(C+z/N,a[1][1])*N:$=xt(C+(c?I:-I)/N,a[0][1])*N,w=Math.max(w,$)}}if(p){const F=Un(H*N,E,S)/N;if(k=Math.max(k,F),l){let $=0;!c&&!d||d&&!c&&m?$=xt(y+H*N+D,l[1][0])/N:$=dt(y+(d?B:-B)*N+D,l[0][0])/N,k=Math.max(k,$)}if(a){let $=0;!c&&!d||d&&!c&&m?$=dt(y+H*N,a[1][0])/N:$=xt(y+(d?B:-B)*N,a[0][0])/N,k=Math.max(k,$)}}}B=B+(B<0?k:-k),I=I+(I<0?w:-w),r&&(m?z>H*N?B=(nl(c,d)?-I:I)/N:I=(nl(c,d)?-B:B)*N:x?(B=I/N,d=c):(I=B*N,c=d));const M=c?y+I:y,O=d?C+B:C;return{width:v+(c?-I:I),height:L+(d?-B:B),x:i[0]*I*(c?-1:1)+M,y:i[1]*B*(d?-1:1)+O}}const hd={width:0,height:0,x:0,y:0},mS={...hd,pointerX:0,pointerY:0,aspectRatio:1};function fS(e){return[[0,0],[e.measured.width,e.measured.height]]}function hS(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,a=n[0]*i,c=n[1]*l;return[[s-a,r-c],[s+i-a,r+l-c]]}function gS({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=ze(e);function l({controlPosition:c,boundaries:d,keepAspectRatio:x,resizeDirection:p,onResizeStart:m,onResize:h,onResizeEnd:g,shouldResize:E}){let S={...hd},R={...mS};const _=xS(c);let y,C=null,v=[],L,N,I;const B=Pu().on("start",z=>{const{nodeLookup:H,transform:D,snapGrid:V,snapToGrid:w,nodeOrigin:k,paneDomNode:M}=n();if(y=H.get(t),!y)return;C=M?.getBoundingClientRect()??null;const{xSnapped:O,ySnapped:F}=jn(z.sourceEvent,{transform:D,snapGrid:V,snapToGrid:w,containerBounds:C});S={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},R={...S,pointerX:O,pointerY:F,aspectRatio:S.width/S.height},L=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(L=H.get(y.parentId),N=L&&y.extent==="parent"?fS(L):void 0),v=[],I=void 0;for(const[$,Z]of H)if(Z.parentId===t&&(v.push({id:$,position:{...Z.position},extent:Z.extent}),Z.extent==="parent"||Z.expandParent)){const K=hS(Z,y,Z.origin??k);I?I=[[Math.min(K[0][0],I[0][0]),Math.min(K[0][1],I[0][1])],[Math.max(K[1][0],I[1][0]),Math.max(K[1][1],I[1][1])]]:I=K}m?.(z,{...S})}).on("drag",z=>{const{transform:H,snapGrid:D,snapToGrid:V,nodeOrigin:w}=n(),k=jn(z.sourceEvent,{transform:H,snapGrid:D,snapToGrid:V,containerBounds:C}),M=[];if(!y)return;const{x:O,y:F,width:$,height:Z}=S,K={},q=y.origin??w,{width:te,height:J,x:oe,y:ne}=pS(R,_,k,d,x,q,N,I),re=te!==$,ee=J!==Z,ie=oe!==O&&re,ye=ne!==F&ⅇif(!ie&&!ye&&!re&&!ee)return;if((ie||ye||q[0]===1||q[1]===1)&&(K.x=ie?oe:S.x,K.y=ye?ne:S.y,S.x=K.x,S.y=K.y,v.length>0)){const U=oe-O,de=ne-F;for(const be of v)be.position={x:be.position.x-U+q[0]*(te-$),y:be.position.y-de+q[1]*(J-Z)},M.push(be)}if((re||ee)&&(K.width=re&&(!p||p==="horizontal")?te:S.width,K.height=ee&&(!p||p==="vertical")?J:S.height,S.width=K.width,S.height=K.height),L&&y.expandParent){const U=q[0]*(K.width??0);K.x&&K.x<U&&(S.x=U,R.x=R.x-(K.x-U));const de=q[1]*(K.height??0);K.y&&K.y<de&&(S.y=de,R.y=R.y-(K.y-de))}const Se=dS({width:S.width,prevWidth:$,height:S.height,prevHeight:Z,affectsX:_.affectsX,affectsY:_.affectsY}),ue={...S,direction:Se};E?.(z,ue)!==!1&&(h?.(z,ue),s(K,M))}).on("end",z=>{g?.(z,{...S}),r?.({...S})});i.call(B)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var Xn={exports:{}},mo={},qn={exports:{}},fo={};/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./Editable-DUtJOqJ5.cjs"),o=require("./jsx-runtime-CITbqOLs.cjs"),j=require("react"),u=require("./css-DI0uCCGq.cjs"),A=require("./eraser-B03ej59l.cjs"),qh=require("./external-BEd3F7zY.cjs"),$l=require("./Animated-BDoJWl9g.cjs"),zl=require("react-dom"),I=require("./LinePlot-6cl8_hmn.cjs"),_s=require("./external-DwRvB5ZT.cjs"),te=require("zod"),Ne=require("./external-DOEaBrpz.cjs"),Vl=require("./external-BS9S-b49.cjs"),nt=require("./external-BenP6Hcm.cjs"),Fl=require("./external-I_-aclFy.cjs"),Ie=require("./external-CAAPXpVr.cjs"),pe=require("./external-DNO3FJLl.cjs"),Hl=require("./units-WWUmv-rf.cjs"),Qh=require("./external-DKh0JhWO.cjs"),Jh=require("./external-D98a3YQJ.cjs"),Me=require("./external-CNF5TNBY.cjs"),eg=require("./external-Blrrgnzw.cjs"),tg=require("./external-BVDQNHbo.cjs"),ng=require("./Video-BjRd9sFv.cjs"),Zl=require("./Toggle-DUKDeqpe.cjs"),sg=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),og=e=>te.array(e).or(e.transform(t=>[t])),Kl=e=>A.p(e,(t,n,s)=>{const r=n===s.length-1,i=!isNaN(parseInt(t)),l=!isNaN(parseInt(s[n+1]));return i&&(t="element"),r||l?t:[t,"shape"]}),hi=(e,t)=>{if(e==null)return null;const n=e[t];return n==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:n},rg=(e,t,n)=>t===""?e:A.c(hi(e,"shape"),Kl(t),{...n,getter:hi}),ig=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:rg,getFieldSchemaPath:Kl,nullToUndefined:sg,toArray:og},Symbol.toStringTag,{value:"Module"})),Yl=Symbol(),Xo=Symbol(),xn="a",ss="w";let lg=(e,t)=>new Proxy(e,t);const Ro=Object.getPrototypeOf,gi=new WeakMap,qo=e=>e&&(gi.has(e)?gi.get(e):Ro(e)===Object.prototype||Ro(e)===Array.prototype),ji=e=>typeof e=="object"&&e!==null,Ei=new WeakMap,Wl=e=>e[Xo]||e,Gl=(e,t,n)=>{if(!qo(e))return e;const s=Wl(e),r=(l=>Object.isFrozen(l)||Object.values(Object.getOwnPropertyDescriptors(l)).some(a=>!a.writable))(s);let i=n&&n.get(s);return i&&i[1].f===r||(i=((l,a)=>{const c={f:a};let d=!1;const x=(m,h)=>{if(!d){let g=c[xn].get(l);if(g||(g={},c[xn].set(l,g)),m===ss)g[ss]=!0;else{let E=g[m];E||(E=new Set,g[m]=E),E.add(h)}}},p={get:(m,h)=>h===Xo?l:(x("k",h),Gl(Reflect.get(m,h),c[xn],c.c)),has:(m,h)=>h===Yl?(d=!0,c[xn].delete(l),!0):(x("h",h),Reflect.has(m,h)),getOwnPropertyDescriptor:(m,h)=>(x("o",h),Reflect.getOwnPropertyDescriptor(m,h)),ownKeys:m=>(x(ss),Reflect.ownKeys(m))};return a&&(p.set=p.deleteProperty=()=>!1),[p,c]})(s,r),i[1].p=lg(r?(l=>{let a=Ei.get(l);if(!a){if(Array.isArray(l))a=Array.from(l);else{const c=Object.getOwnPropertyDescriptors(l);Object.values(c).forEach(d=>{d.configurable=!0}),a=Object.create(Ro(l),c)}Ei.set(l,a)}return a})(s):s,i[0]),n&&n.set(s,i)),i[1][xn]=t,i[1].c=n,i[1].p},Ul=(e,t,n,s)=>{if(Object.is(e,t))return!1;if(!ji(e)||!ji(t))return!0;const r=n.get(Wl(e));if(!r)return!0;if(s){const l=s.get(e);if(l&&l.n===t)return l.g;s.set(e,{n:t,g:!1})}let i=null;try{for(const l of r.h||[])if(i=Reflect.has(e,l)!==Reflect.has(t,l),i)return i;if(r[ss]===!0){if(i=((l,a)=>{const c=Reflect.ownKeys(l),d=Reflect.ownKeys(a);return c.length!==d.length||c.some((x,p)=>x!==d[p])})(e,t),i)return i}else for(const l of r.o||[])if(i=!!Reflect.getOwnPropertyDescriptor(e,l)!=!!Reflect.getOwnPropertyDescriptor(t,l),i)return i;for(const l of r.k||[])if(i=Ul(e[l],t[l],n,s),i)return i;return i===null&&(i=!0),i}finally{s&&s.set(e,{n:t,g:i})}},ag=e=>!!qo(e)&&Yl in e,Xl=e=>qo(e)&&e[Xo]||null,cg="h",ug="w",dg="o",xg="k",Co=e=>typeof e=="object"&&e!==null,ql=(e,t)=>{if(!Co(e))return e;const n=Xl(e);return n!==null?(ag(e),n):(t.has(e)||(t.add(e),Object.entries(e).forEach(([s,r])=>{const i=ql(r,t);Object.is(i,r)||(e[s]=i)})),e)},wo=(e,t,n)=>{var s,r,i;if(!Co(e)||!Co(t))return;const l=n.get(Xl(t)||t);l&&((s=l[cg])==null||s.forEach(a=>{Reflect.has(e,a)}),l[ug]===!0&&Reflect.ownKeys(e),(r=l[dg])==null||r.forEach(a=>{Reflect.getOwnPropertyDescriptor(e,a)}),(i=l[xg])==null||i.forEach(a=>{wo(e[a],t[a],n)}))},eo="o",to="r",no="a";function pg(e,t){var n;let s=0;const r=(n=t?.size)!=null?n:1,i=[],l=t!=null&&t.noWeakMap?null:new WeakMap;return c=>{const d=l?.get(c);if(d)return d[to];for(let g=0;g<r;g+=1){const E=i[(s+g)%r];if(!E)break;if(!Ul(E[eo],c,E[no],new WeakMap))return wo(c,E[eo],E[no]),l?.set(c,E),E[to]}const x=new WeakMap,p=Gl(c,x),m=ql(e(p),new Set);wo(c,c,x);const h={[eo]:c,[to]:m,[no]:x};return s=(s-1+r)%r,i[s]=h,l?.set(c,h),m}}const mg=(e,t)=>u.S.RUNTIME==="browser"?pg(e,t):e,It=(e,t)=>{j.useEffect(()=>{const n=new AbortController,s=n.signal,i=(async()=>(await u.dr(),await e(s)))().catch(console.error);return()=>{n.abort(),i.then(l=>l?.()).catch(console.error)}},t)},fg=(e,t,n=150)=>{const[s,r]=j.useState(e);return j.useEffect(()=>{const i=setTimeout(()=>r(t),n);return()=>clearTimeout(i)},[t,n]),s},ks=()=>{const e=j.useRef([]),t=j.useCallback(()=>{e.current.forEach(s=>s()),e.current=[]},[]),n=j.useCallback(s=>{s!=null&&e.current.push(...A.t.toArray(s))},[t]);return j.useEffect(()=>t,[t]),{cleanup:t,set:n}},hg=({transforms:e=[]})=>{const[t,n]=j.useState(e),s=j.useCallback((l,a,c=0)=>n(d=>{const x=d.filter(p=>p.key!==l);return x.push({key:l,transform:a,priority:c}),x.sort((p,m)=>m.priority-p.priority),x}),[n]),r=j.useCallback(l=>n(a=>a.filter(c=>c.key!==l)),[s]);return{transform:j.useCallback(l=>t.reduce((a,c)=>c.transform(a),{...l,transformed:!1}),[t]),setTransform:s,deleteTransform:r}},gg=Object.freeze(Object.defineProperty({__proto__:null,Access:f.Access,Acquire:f.Acquire,Add:f.Add,Align:f.Align,Analyze:f.Analyze,Annotate:f.Annotate,Array:f.Array,Arrow:f.Arrow,Attachment:f.Attachment,Auto:f.Auto,AutoFitWidth:f.AutoFitWidth,Binary:f.Binary,Bolt:f.Bolt,Box:f.Box$1,Bridge:f.Bridge,Calculation:f.Calculation,Calendar:f.Calendar$1,Caret:f.Caret,Channel:f.Channel,Check:f.Check,Circle:f.Circle,Click:f.Click,Close:f.Close,Cluster:f.Cluster,Commit:f.Commit,Concepts:f.Concepts,Connect:f.Connect,Constant:f.Constant,Control:f.Control,Copy:f.Copy,Decimal:f.Decimal,Delete:f.Delete,Details:f.Details,Device:f.Device,Disable:f.Disable,Disconnect:f.Disconnect,Download:f.Download,Downsample:f.Downsample,Drag:f.Drag,Dynamic:f.Dynamic,Edit:f.Edit,EditOff:f.EditOff,Enable:f.Enable,Expand:f.Expand,Explore:f.Explore,Export:f.Export,Feedback:f.Feedback,Filter:f.Filter,Focus:f.Focus,Function:f.Function,Group:f.Group,Guide:f.Guide,Hardware:f.Hardware,Heart:f.Heart,Hidden:f.Hidden,Import:f.Import,Index:f.Index,Info:f.Info,JSON:f.JSON,Keyboard:f.Keyboard,Label:f.Label,LinePlot:f.LinePlot,Linear:f.Linear,Link:f.Link,LinkExternal:f.LinkExternal,Loading:f.Loading,Log:f.Log,Logo:f.Logo,Map:f.Map,Menu:f.Menu$1,MoveToMainWindow:f.MoveToMainWindow,NPM:f.NPM,Node:f.Node,None:f.None,OpenExternal:f.OpenExternal,OpenInNewWindow:f.OpenInNewWindow,PNPM:f.PNPM,Pan:f.Pan,Pause:f.Pause,Play:f.Play,Python:f.Python,QuestionMark:f.QuestionMark,Rack:f.Rack,Range:f.Range,Reference:f.Reference,Refresh:f.Refresh,Release:f.Release,Rename:f.Rename,Resources:f.Resources,Rotate:f.Rotate,Rule:f.Rule,Save:f.Save,Schematic:f.Schematic,Search:f.Search,Selection:f.Selection,Settings:f.Settings,Snapshot:f.Snapshot,Snooze:f.Snooze,Sound:f.Sound,SplitX:f.SplitX,SplitY:f.SplitY,StarFilled:f.StarFilled,StarOutlined:f.StarOutlined,String:f.String,StrokeWidth:f.StrokeWidth,Subtract:f.Subtract,Sync:f.Sync,Table:f.Table,Tare:f.Tare,Task:f.Task,Terminal:f.Terminal,Text:f.Text$3,TextAlign:f.TextAlign,Time:f.Time$1,Tooltip:f.Tooltip,Type:f.Type,TypeScript:f.TypeScript,Units:f.Units,User:f.User,Value:f.Value,Variable:f.Variable,Virtual:f.Virtual,Visible:f.Visible,Visualize:f.Visualize,Warning:f.Warning,Wave:f.Wave,Workspace:f.Workspace,Yarn:f.Yarn,Zoom:f.Zoom,createComposite:f.createComposite,resolve:f.resolve,wrapSVGIcon:f.wrapSVGIcon},Symbol.toStringTag,{value:"Module"})),jg=Object.freeze(Object.defineProperty({__proto__:null,Config:f.Config,Dialog:f.Dialog$1,chooseLocation:f.chooseLocation,formatTip:f.formatTip,useConfig:f.useConfig,wrap:f.wrap},Symbol.toStringTag,{value:"Module"})),Qo=({ref:e,location:t,style:n,size:s,className:r,children:i,onDragStart:l,sizeUnits:a="px",showHandle:c=!0,...d})=>{const x=u.K$1.construct(t),p=u.K$1.direction(x),m=u.g.dimension(p);return o.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("resize"),u.CSS.loc(x),r),style:{[m]:`${s}${a}`,...n},ref:e,direction:p,empty:!0,...d,children:[i,c&&o.jsxRuntimeExports.jsx("div",{draggable:!0,className:u.CSS(u.CSS.BE("resize","handle"),u.CSS.bordered(u.K$1.swap(x))),onDragStart:l,onDrag:f.preventDefault,onDragEnd:f.preventDefault})]})},Ql=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:r="x"})=>{const i=j.useRef(null),[l,a]=j.useState({sizeDistribution:Eg(n,t),root:null}),c=j.useCallback((p,m,h)=>{if(i.current==null)return;const g=u.Ho.dim(u.Ho.construct(i.current),r);a(E=>oo(E,g,p,s,m,h))},[s,a,r]);j.useEffect(()=>e?.(l.sizeDistribution),[l.sizeDistribution,e]);const d=j.useCallback((p,m)=>{p.preventDefault();const h=r==="x"?"clientX":"clientY",g=S=>c(m,S[h]),E=()=>{a(S=>({...S,root:null})),document.removeEventListener("mousemove",g)};a(S=>({...S,root:p[h]})),document.addEventListener("mousemove",g),document.addEventListener("mouseup",E,{once:!0})},[a,r,oo]);return{setSize:j.useCallback((p,m)=>c(p,void 0,m),[oo]),props:{direction:r,sizeDistribution:l.sizeDistribution,onDragHandle:d,ref:i}}},Jl=({ref:e,direction:t="x",children:n,sizeDistribution:s,onDragHandle:r,className:i,...l})=>{const a=u.g.construct(t),c=j.Children.toArray(n);return s=yg(s),o.jsxRuntimeExports.jsx(f.Box,{...l,ref:e,direction:a,className:u.CSS(u.CSS.B("resize-multiple"),i),empty:!0,grow:!0,children:c.map((d,x)=>o.jsxRuntimeExports.jsx(Qo,{onDragStart:p=>r(p,x),location:u.g.location(a),size:s[x]*100,sizeUnits:"%",showHandle:x!==c.length-1,children:d},x))})},Eg=(e,t)=>{const n=e.reduce((r,i)=>r+i,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(r=>r/n);if(e.every(r=>r<=1)){const r=1-n;return[...e,...Array(s).fill(r/s)]}return e.map(()=>1/t)},so=.001,yg=e=>e.every(t=>u.or.closeTo(t,1/e.length),so)?e.map((t,n)=>n%2===0?t+so:n===e.length-1?t:t-so):e,oo=(e,t,n,s,r,i)=>{const l=ea(e,t,n,r,i),[a,c]=Sg(e.sizeDistribution,n,l,s/t),d=c?r??null:e.root;return{...e,sizeDistribution:a,root:d}},ea=(e,t,n,s,r)=>{let i;if(r!=null)r>1&&(r/=t),i=r-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},Sg=(e,t,n,s)=>{let r=t;for(;r>0&&e[r]+n<=s;)r--;const i=e[r]+n,l=Rg(r,e,s,n),a=e[l]-n;return i<s||a<s?[e,!1]:[e.map((c,d)=>d===r?i:d===l?a:c),!0]},Rg=(e,t,n,s)=>(e===t.length-1?wg:Cg)(e,t,n,s),Cg=(e,t,n,s)=>{let r=e+1;for(;r<t.length-1&&t[r]-s<=n;)r++;return r},wg=(e,t,n,s)=>{let r=e-1;for(;r>0&&t[r]-s<=n;)r--;return r},ro=2,bg=100,ta=({onCollapse:e,onResize:t,location:n="left",minSize:s,maxSize:r,initialSize:i=200,collapseThreshold:l=1/0,className:a,...c})=>{const[d,x]=j.useState(u.R(i,s,r)),p=j.useRef(null),m=u.K$1.construct(n),h=j.useCallback(y=>{if(p.current===null)return 0;const C=u.Ho.dim(y,u.K$1.direction(m),!0)*(1-2*Number(["bottom","right"].includes(m))),_=p.current+C,k=u.R(_,s,r);return(k-_)/(s??bg)>l?ro:k},[m,s,r,l]),g=j.useRef(null),E=j.useCallback(y=>{const C=h(y);x(C),g.current!=null&&t?.(C,u.Ho.construct(g.current))},[t,h]),S=j.useCallback(()=>x(y=>(p.current=y,y)),[x]),R=j.useCallback(y=>h(y)===ro&&e?.(),[e,h]);j.useEffect(()=>{s==null||r==null||x(y=>{const C=u.R(y,s,r);return p.current=C,C})},[s,r]);const v=Ne.useCursorDrag({onMove:E,onStart:S,onEnd:R});return o.jsxRuntimeExports.jsx(Qo,{ref:g,location:m,size:d,onDragStart:v,className:u.clsx(a,u.CSS.expanded(d!==ro)),...c})},vg=Object.freeze(Object.defineProperty({__proto__:null,Core:Qo,Multiple:Jl,Single:ta,calculateDiffPercentage:ea,useMultiple:Ql},Symbol.toStringTag,{value:"Module"})),Jo=({aetherKey:e,enabled:t=!0})=>{const{setState:n}=f.useLifecycle({aetherKey:e,type:A.Eraser.TYPE,schema:A.eraserStateZ,initialState:{region:u.Ho.ZERO,enabled:t}}),s=f.useSyncedRef(t);return{erase:j.useCallback(i=>{n({enabled:s.current,region:i})},[n,s])}},_g=({aetherKey:e,children:t})=>{const{erase:n}=Jo({aetherKey:e}),s=f.useResize(n);return o.jsxRuntimeExports.jsx("div",{ref:s,className:u.CSS(u.CSS.inheritDims()),children:t})},kg=Object.freeze(Object.defineProperty({__proto__:null,Eraser:_g,use:Jo},Symbol.toStringTag,{value:"Module"})),Lg=({items:e,initialKey:t})=>{const[n,s]=j.useState(t),r=l=>s(l===n?void 0:l),i=e.find(l=>l.key===n);return{onSelect:r,activeItem:i}},Mg=({activeItem:e,children:t,onSelect:n,location:s="left",collapseThreshold:r=.65,className:i,onResize:l,onCollapse:a,eraseEnabled:c,...d})=>{const x=u.K$1.direction(s);c??=e!=null;const p=j.useCallback(()=>{a?a():e!=null&&n?.(e.key)},[n,e?.key,a]),{erase:m}=Jo({enabled:c}),h=j.useCallback((v,y)=>{l?.(v,y),m(y)},[l,m]),{content:g,minSize:E,maxSize:S,initialSize:R=0}=e??{};return o.jsxRuntimeExports.jsx(ta,{className:u.CSS(u.CSS.B("nav-drawer"),u.CSS.dir(x),u.CSS.visible(e!=null),i),collapseThreshold:r,onCollapse:p,location:s,onResize:h,minSize:E,maxSize:S,initialSize:R,...d,children:g})},Pg=Object.freeze(Object.defineProperty({__proto__:null,Bar:f.Bar,Drawer:Mg,useDrawer:Lg},Symbol.toStringTag,{value:"Module"})),er={info:"var(--pluto-text-color)",error:"var(--pluto-error-z)",warning:"var(--pluto-warning-m1)",success:"var(--pluto-primary-z)",loading:"var(--pluto-text-color)",disabled:"var(--pluto-gray-l8)"},tr=({variant:e,...t})=>e==="loading"?o.jsxRuntimeExports.jsx(f.Loading,{...t}):o.jsxRuntimeExports.jsx(f.Circle,{color:e!=null?er[e]:void 0,...t}),Ng=({action:e})=>j.isValidElement(e)?e:j.createElement(f.Button,{...e,key:e.key,size:"tiny"}),Tg=({status:{key:e,time:t,count:n,message:s,description:r,variant:i},silence:l,actions:a,className:c,children:d,...x})=>{const p=j.useRef(null);return o.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("notification"),c),y:!0,empty:!0,ref:p,...x,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,justify:"between",grow:!0,style:{width:"100%"},children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",gap:"small",children:[o.jsxRuntimeExports.jsx(tr,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:`x${n}`}),o.jsxRuntimeExports.jsx(f.DateTime,{className:u.CSS(u.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:o.jsxRuntimeExports.jsx(f.Close,{})})]}),o.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"start",className:u.CSS(u.CSS.BE("notification","content")),gap:"small",children:[d??o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","message")),style:{flexGrow:1},children:s}),r!=null&&o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),a!=null&&o.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",justify:"end",className:u.CSS(u.CSS.BE("notification","actions")),children:A.t.toArray(a).map(m=>o.jsxRuntimeExports.jsx(Ng,{action:m},m.key))})]},t.toString())},Ig=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:f.Aggregator,Indicator:tr,Notification:Tg,Summary:f.Summary,VARIANT_COLORS:er,useAdder:f.useAdder,useAsyncErrorHandler:f.useAsyncErrorHandler,useErrorHandler:f.useErrorHandler,useNotifications:f.useNotifications},Symbol.toStringTag,{value:"Module"})),na=e=>e==="preview"?"connected":e,sa=e=>e==="preview"?"preview":void 0,Ls=({resourceName:e,value:t,onChange:n,data:s,getItem:r,subscribe:i,haulType:l,icon:a,disabled:c,onSearch:d,emptyContent:x,status:p,onFetchMore:m,children:h,renderTag:g,actions:E,allowNone:S,replaceOnSingle:R,triggerProps:v,virtual:y=!0,dialogProps:C,variant:_="connected",...k})=>o.jsxRuntimeExports.jsx(f.Frame,{variant:na(_),...k,children:o.jsxRuntimeExports.jsxs(f.Frame$1,{multiple:!0,value:t,onChange:n,data:s,getItem:r,subscribe:i,onFetchMore:m,allowNone:S,replaceOnSingle:R,virtual:y,children:[o.jsxRuntimeExports.jsx(ra,{haulType:l,icon:a,placeholder:`Select ${e}s`,disabled:c,variant:sa(_),...v,children:g}),o.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:d,emptyContent:x,status:p,actions:E,resourceName:e,...C,children:h})]})}),Xe=(e,t)=>{const n={};t.forEach(r=>n[r]=void 0);const s=r=>{const{...i}={...r,...n};return o.jsxRuntimeExports.jsx(e,{...i})};return s.displayName=`RemoveProps(${e.displayName})`,s},oa=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:A.SIZES,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"tiny",children:"L"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"small",children:"M"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"medium",children:"L"})]}),Ag=Object.freeze(Object.defineProperty({__proto__:null,SIZES:A.SIZES,SelectSize:oa,isRenderProp:f.isRenderProp,isSize:A.isSize,removeProps:Xe,renderProp:f.renderProp,size:A.size},Symbol.toStringTag,{value:"Module"})),Ms=({children:e="",size:t="medium",color:n,icon:s,onClose:r,className:i,onDragStart:l,...a})=>{const c=u.cr.cssString(n);s==null&&n!=null&&(s=o.jsxRuntimeExports.jsx(f.Circle,{color:c}));const d=r==null?void 0:o.jsxRuntimeExports.jsx(f.Button,{"aria-label":"close",size:t==="tiny"?"small":t,variant:"text",className:u.CSS.BE("tag","close"),sharp:!0,onClick:x=>{x.stopPropagation(),r()},children:o.jsxRuntimeExports.jsx(f.Close,{})});return o.jsxRuntimeExports.jsxs(f.Button,{el:"div",className:u.CSS(i,u.CSS.B("tag"),r!=null&&u.CSS.BM("tag","closeable")),size:t,overflow:"nowrap",align:"center",gap:"small",onDragStart:l,...a,children:[s,d,e]})},nr=({children:e,onClick:t,variant:n="outlined",size:s="medium",...r})=>o.jsxRuntimeExports.jsx(f.Button,{el:"div",variant:n,size:s,x:!0,onClick:t,align:"center",gap:"small",style:{padding:"0rem 0.5rem",paddingRight:"2rem"},rounded:!0,...r,children:e}),Og=Object.freeze(Object.defineProperty({__proto__:null,Tag:Ms,Tags:nr},Symbol.toStringTag,{value:"Module"})),Dg=({itemKey:e,icon:t,onDragStart:n})=>{const s=f.useItem(e),{onSelect:r}=f.useItemState(e);return o.jsxRuntimeExports.jsx(Ms,{onClose:r,onDragStart:()=>n(e),draggable:!0,size:"small",status:s==null?"error":void 0,icon:s?.icon??t,children:s?.name??e})},Bg=f.renderProp(Dg),sr=({items:e},t,n,s)=>{if(t===""||s===!0)return!1;const r=f.filterByType(t,e);return r.length>0&&!r.every(i=>n.includes(i.key))},ra=({haulType:e="",disabled:t,placeholder:n="Select...",variant:s="outlined",icon:r,children:i=Bg})=>{const l=f.useSelection(),a=f.useSyncedRef(l),{setSelected:c}=f.useContext$3(),{toggle:d,visible:x}=f.useContext$2(),p=j.useCallback(v=>sr(v,e,A.t.toArray(l),t),[e,l,t]),{startDrag:m,...h}=f.useDragAndDrop({type:e,canDrop:p,onDrop:f.useFilterByTypeCallback(e,({items:v})=>{const y=A.t.toArray(a.current);return c(u.c.unique([...A.t.toArray(y),...v.map(C=>C.key)])),v},[c])}),g=j.useCallback(({dropped:v})=>{const y=l.filter(C=>!v.some(_=>_.key===C));c(y)},[c,l]),E=j.useCallback(v=>{m([{key:v,type:e}],g)},[m,g,e]),S=f.useDraggingState(),R=s==="text"&&l.length!==0;return o.jsxRuntimeExports.jsxs(nr,{full:"x",onClick:()=>{R||d()},...h,className:u.CSS(u.CSS.dropRegion(p(S)),u.CSS.BE("dialog","trigger"),u.CSS.BM("variant",s)),variant:s,preventClick:R,grow:!0,children:[l.length===0&&o.jsxRuntimeExports.jsxs(f.Text,{color:8,weight:400,style:{padding:"0 1rem"},children:[r,n]}),l.map(v=>i({key:v,itemKey:v,onDragStart:E,icon:r})),s!=="text"&&o.jsxRuntimeExports.jsx($l.Animated,{className:u.CSS.level("p"),enabled:x,enabledLoc:"bottom",disabledLoc:"left",color:8}),R&&o.jsxRuntimeExports.jsx(f.Button,{variant:s,onClick:v=>{v.stopPropagation(),d()},children:o.jsxRuntimeExports.jsx(f.Add,{color:8})})]})},At=({resourceName:e,onChange:t,value:n,allowNone:s,emptyContent:r,haulType:i,data:l,getItem:a,subscribe:c,itemHeight:d,onFetchMore:x,disabled:p,onSearch:m,status:h,icon:g,children:E,variant:S="connected",actions:R,dialogProps:v,triggerProps:y,virtual:C=!0,closeDialogOnSelect:_=!0,...k})=>o.jsxRuntimeExports.jsx(f.Frame,{...k,variant:na(S),children:o.jsxRuntimeExports.jsxs(f.Frame$1,{value:n,onChange:t,data:l,getItem:a,subscribe:c,allowNone:s,onFetchMore:x,itemHeight:d,virtual:C,closeDialogOnSelect:_,children:[o.jsxRuntimeExports.jsx(ia,{haulType:i,icon:g,placeholder:`Select a ${e}`,disabled:p,variant:sa(S),...y}),o.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:m,resourceName:e,emptyContent:r,status:h,actions:R,...v,children:E})]})}),ia=({haulType:e="",placeholder:t,icon:n,disabled:s,iconOnly:r=!1,hideCaret:i=!1,...l})=>{const a=f.useSelection(),{setSelected:c}=f.useContext$3(),[d]=a,x=f.useItem(d),{name:p,icon:m}=x??{},h=j.useCallback(S=>sr(S,e,a,s),[e,a,s]),g=f.useDrop({type:e,canDrop:h,onDrop:f.useFilterByTypeCallback(e,({items:S})=>(S.length!==0&&c([S[0].key]),S),[c])}),E=f.useDraggingState();return o.jsxRuntimeExports.jsxs(Fl.Trigger,{variant:"outlined",gap:"small",className:u.CSS(u.CSS.dropRegion(h(E))),disabled:s,...g,...l,hideCaret:i||r,textColor:p==null?8:void 0,children:[m??n,!r&&(p??t)]})},$g=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);if(n==null)return null;const{name:s,icon:r}=n;return o.jsxRuntimeExports.jsxs(f.ListItem,{...e,children:[r,s]})}),Nn=({data:e,filter:t,children:n=$g,virtual:s=!1,...r})=>{const{retrieve:i,...l}=f.useStaticData({data:e,filter:t}),{search:a}=nt.usePager({retrieve:i});return o.jsxRuntimeExports.jsx(At,{...r,...l,onSearch:a,virtual:s,children:n})},on=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:A.LEVELS,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h2",square:!0,children:"XL"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h3",square:!0,children:"L"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h4",square:!0,children:"M"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h5",square:!0,children:"S"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"small",square:!0,children:"XS"})]}),zg=[250,400,500,600],la=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:zg,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:250,children:"Light"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:400,children:"Normal"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:500,children:"Medium"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:600,children:"Bold"})]}),Vg=Object.freeze(Object.defineProperty({__proto__:null,Level:on,Weight:la},Symbol.toStringTag,{value:"Module"})),Fg=Object.freeze(Object.defineProperty({__proto__:null,Button:pe.Button,Buttons:pe.Buttons,Core:f.Core,Dialog:f.Dialog$2,Frame:f.Frame$1,ListItem:f.ListItem,Multiple:Ls,MultipleTrigger:ra,Single:At,SingleTrigger:ia,Static:Nn,Text:Vg,staticCanDrop:sr,useClear:f.useClear,useContext:f.useContext$3,useHover:f.useHover,useItemState:f.useItemState,useMultiple:f.useMultiple,useSelection:f.useSelection,useSingle:f.useSingle},Symbol.toStringTag,{value:"Module"})),Hg=()=>o.jsxRuntimeExports.jsx(f.Caret.Right,{className:u.CSS.BE("breadcrumb","separator")}),Rn=({children:e,...t})=>o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS.BE("breadcrumb","segment"),...t,defaultEl:"span",children:e}),or=({children:e,highlightVariant:t,...n})=>o.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.B("breadcrumb"),t!=null&&u.CSS.BM("breadcrumb","highlight",t)),x:!0,align:"center",gap:"small",...n,children:j.Children.map(e,(s,r)=>s==null||typeof s=="boolean"?null:o.jsxRuntimeExports.jsxs(j.Fragment,{children:[r>0&&o.jsxRuntimeExports.jsx(Hg,{}),typeof s=="string"?o.jsxRuntimeExports.jsx(Rn,{children:s}):s]},r))}),Zg=(e,t)=>{const n=e.split("/");return n.map((s,r)=>t({href:n.slice(0,r+1).join("/"),segment:s,index:r}))},Kg=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:or,Segment:Rn,mapURLSegments:Zg},Symbol.toStringTag,{value:"Module"})),Yg=({channelKey:e,rangeKey:t,shadow:n,className:s,...r})=>{const{value:i,onChange:l}=r,[a,c]=j.useState(!1),{update:d}=Qa.useDirect({params:{rangeKey:t,channelKey:e}}),{data:x}=Cr.useDirect({params:{key:e,rangeKey:t}}),p=async C=>{d(C)},m=x?.alias,h=x?.alias??x?.name;let g=o.jsxRuntimeExports.jsx(f.Rename,{});a?g=o.jsxRuntimeExports.jsx(f.Loading,{}):m===i&&(g=o.jsxRuntimeExports.jsx(f.Check,{}));const E=p!=null&&!a&&m!==i&&e!==0,S=f.useErrorHandler(),R=()=>{E&&S(async()=>{c(!0);try{await p(i),c(!1)}catch(C){throw c(!1),C}},"Failed to set channel alias")},v=()=>{m!=null&&l?.(m)},y=e===0?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):p==null?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):i.length===0?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):m===i?o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Alias synced with this label"}):o.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Sync alias for ",h," with this label"]});return o.jsxRuntimeExports.jsxs(f.Text$2,{selectOnFocus:!0,...r,children:[E&&o.jsxRuntimeExports.jsx(f.Button,{onClick:v,tooltip:o.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Set ",h," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:o.jsxRuntimeExports.jsx(f.Sync,{})}),o.jsxRuntimeExports.jsx(f.Button,{onClick:R,disabled:!E,tooltip:y,tooltipLocation:{y:"top"},variant:"outlined",children:g})]})},vt="channel";var yi=180/Math.PI,bo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function aa(e,t,n,s,r,i){var l,a,c;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(c=e*n+t*s)&&(n-=e*c,s-=t*c),(a=Math.sqrt(n*n+s*s))&&(n/=a,s/=a,c/=a),e*s<t*n&&(e=-e,t=-t,c=-c,l=-l),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*yi,skewX:Math.atan(c)*yi,scaleX:l,scaleY:a}}var Yn;function Wg(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?bo:aa(t.a,t.b,t.c,t.d,t.e,t.f)}function Gg(e){return e==null||(Yn||(Yn=document.createElementNS("http://www.w3.org/2000/svg","g")),Yn.setAttribute("transform",e),!(e=Yn.transform.baseVal.consolidate()))?bo:(e=e.matrix,aa(e.a,e.b,e.c,e.d,e.e,e.f))}function ca(e,t,n,s){function r(d){return d.length?d.pop()+" ":""}function i(d,x,p,m,h,g){if(d!==p||x!==m){var E=h.push("translate(",null,t,null,n);g.push({i:E-4,x:I.interpolateNumber(d,p)},{i:E-2,x:I.interpolateNumber(x,m)})}else(p||m)&&h.push("translate("+p+t+m+n)}function l(d,x,p,m){d!==x?(d-x>180?x+=360:x-d>180&&(d+=360),m.push({i:p.push(r(p)+"rotate(",null,s)-2,x:I.interpolateNumber(d,x)})):x&&p.push(r(p)+"rotate("+x+s)}function a(d,x,p,m){d!==x?m.push({i:p.push(r(p)+"skewX(",null,s)-2,x:I.interpolateNumber(d,x)}):x&&p.push(r(p)+"skewX("+x+s)}function c(d,x,p,m,h,g){if(d!==p||x!==m){var E=h.push(r(h)+"scale(",null,",",null,")");g.push({i:E-4,x:I.interpolateNumber(d,p)},{i:E-2,x:I.interpolateNumber(x,m)})}else(p!==1||m!==1)&&h.push(r(h)+"scale("+p+","+m+")")}return function(d,x){var p=[],m=[];return d=e(d),x=e(x),i(d.translateX,d.translateY,x.translateX,x.translateY,p,m),l(d.rotate,x.rotate,p,m),a(d.skewX,x.skewX,p,m),c(d.scaleX,d.scaleY,x.scaleX,x.scaleY,p,m),d=x=null,function(h){for(var g=-1,E=m.length,S;++g<E;)p[(S=m[g]).i]=S.x(h);return p.join("")}}}var Ug=ca(Wg,"px, ","px)","deg)"),Xg=ca(Gg,", ",")",")"),qg=1e-12;function Si(e){return((e=Math.exp(e))+1/e)/2}function Qg(e){return((e=Math.exp(e))-1/e)/2}function Jg(e){return((e=Math.exp(2*e))-1)/(e+1)}const os=function e(t,n,s){function r(i,l){var a=i[0],c=i[1],d=i[2],x=l[0],p=l[1],m=l[2],h=x-a,g=p-c,E=h*h+g*g,S,R;if(E<qg)R=Math.log(m/d)/t,S=function(T){return[a+T*h,c+T*g,d*Math.exp(t*T*R)]};else{var v=Math.sqrt(E),y=(m*m-d*d+s*E)/(2*d*n*v),C=(m*m-d*d-s*E)/(2*m*n*v),_=Math.log(Math.sqrt(y*y+1)-y),k=Math.log(Math.sqrt(C*C+1)-C);R=(k-_)/t,S=function(T){var O=T*R,B=Si(_),F=d/(n*v)*(B*Jg(t*O+_)-Qg(_));return[a+F*h,c+F*g,d*B/Si(t*O+_)]}}return S.duration=R*1e3*t/Math.SQRT2,S}return r.rho=function(i){var l=Math.max(.001,+i),a=l*l,c=a*a;return e(l,a,c)},r}(Math.SQRT2,2,4),e1=Object.freeze(Object.defineProperty({__proto__:null,Base:I.Base,Bottom:I.Bottom,Right:I.Right,Top:I.Top,axisStateZ:I.axisStateZ,newCanvas:I.newCanvas,newTickFactory:I.newTickFactory,tickFactoryProps:I.tickFactoryProps,tickType:I.tickType},Symbol.toStringTag,{value:"Module"})),t1=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:I.AcquireChannelControl,AuthoritySource:I.AuthoritySource,Chip:I.Chip,Controller:I.Controller,Indicator:I.Indicator,Legend:I.Legend,REGISTRY:I.REGISTRY$15,STATUSES:I.STATUSES,SetChannelValue:I.SetChannelValue,StateProvider:I.StateProvider,acquireChannelControl:I.acquireChannelControl,acquireChannelControlPropsZ:I.acquireChannelControlPropsZ,authoritySource:I.authoritySource,authoritySourceDetailsZ:I.authoritySourceDetailsZ,authoritySourceProps:I.authoritySourceProps,chipStateZ:I.chipStateZ,chipStatusDetailsZ:I.chipStatusDetailsZ,controllerStateZ:I.controllerStateZ,indicatorStateZ:I.indicatorStateZ,indicatorStatusDetailsZ:I.indicatorStatusDetailsZ,legendStateZ:I.legendStateZ,setChannelValue:I.setChannelValue,setChannelValuePropsZ:I.setChannelValuePropsZ,stateProviderStateZ:I.stateProviderStateZ,statusZ:I.statusZ,sugaredStateZ:I.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),n1={region:u.Ho.ZERO,dpr:1,os:u.S.getOS()},s1={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},o1=({children:e,resizeDebounce:t=100,className:n,...s})=>{const[{path:r},{bootstrapped:i,dpr:l},a]=f.use$2({type:I.Canvas.TYPE,schema:I.canvasStateZ,initialState:n1}),c=j.useRef({...s1}),d=j.useRef(!1),x=j.useCallback(E=>{c.current.bootstrapped&&(a(()=>({bootstrapped:!0,region:E,dpr:window.devicePixelRatio,os:u.S.getOS({default:"Windows"})})),d.current=!0)},[a]),p=j.useRef(null),m=f.useResize(x,{debounce:t}),h=f.useCombinedRefs(p,m);j.useEffect(()=>{const E=()=>{window.devicePixelRatio===l||!c.current.bootstrapped||p.current==null||a(S=>({...S,region:u.Ho.construct(p.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",E,{once:!0})},[l]),j.useEffect(()=>{const E=()=>{!c.current.bootstrapped||p.current==null||a(S=>({...S,region:u.Ho.construct(p.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",E),window.addEventListener("blur",E)},[a]);const g=j.useCallback(E=>{if(E==null)return;E.className.includes("gl")?c.current.gl=E:E.className.includes("upper2d")?c.current.upper2d=E:c.current.lower2d=E;const{gl:S,lower2d:R,upper2d:v,bootstrapped:y}=c.current;if(S==null||R==null||v==null||y)return;c.current.bootstrapped=!0;const C=S.transferControlToOffscreen(),_=v.transferControlToOffscreen(),k=R.transferControlToOffscreen();a({glCanvas:C,upper2dCanvas:_,lower2dCanvas:k,bootstrap:!0,bootstrapped:!1,region:u.Ho.construct(S),dpr:window.devicePixelRatio,os:u.S.getOS({default:"Windows"})},[C,_,k])},[a]);return o.jsxRuntimeExports.jsxs("div",{ref:h,className:u.CSS(u.CSS.B("canvas-container"),n),...s,children:[o.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","lower2d"))}),o.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","gl"))}),o.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","upper2d"))}),o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:i&&e})]})},Tn=(e,t)=>f.useResize(j.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(u.C.XY.translate(u.K.scale(u.Ho.topLeft(r),-1)).box(n),s)},[e]),t),r1=Object.freeze(Object.defineProperty({__proto__:null,Canvas:o1,useRegion:Tn},Symbol.toStringTag,{value:"Module"})),ua=j.createContext(null),tt=e=>{const t=j.use(ua);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},da=e=>{const{addViewportHandler:t}=tt("Viewport");j.useEffect(()=>t(e),[t,e])},In=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=tt(t),{key:r}=e;return f.useEffectCompare(()=>{u.K$1.outer.parse(e.loc),n(e)},([a],[c])=>A.N.equal(a,c),[e]),j.useEffect(()=>()=>s(r),[]),{gridArea:u.g.swap(u.K$1.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},xa=({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=u.K.ZERO,children:r,hold:i=!1,onHold:l,visible:a,...c})=>{const[d,x]=j.useState([]),p=f.useMemoDeepEqual({clearOverScan:s,hold:i,visible:a}),[{path:m},{grid:h},g]=f.use$2({aetherKey:e,type:I.LinePlot.TYPE,schema:I.linePlotStateZ,initialState:{container:u.Ho.ZERO,viewport:u.Ho.DECIMAL,grid:{},...p}}),E=j.useCallback(N=>{a&&g($=>({...$,container:N}))},[g,a]),S=Tn(E,{debounce:n});j.useEffect(()=>g(N=>({...N,...p})),[p]);const R=j.useRef(new Map),v=j.useCallback(N=>(R.current.set(N,null),()=>R.current.delete(N)),[R]),y=j.useCallback(N=>{const{mode:$,box:w,stage:L}=N;($==="pan"&&L!=="start"||$==="zoom"||$==="zoomReset"&&L==="start")&&g(M=>({...M,viewport:w})),R.current.forEach((M,D)=>D(N))},[g]),C=j.useCallback(N=>{g($=>({...$,grid:{...$.grid,[N.key]:N}}))},[g]),_=j.useCallback(N=>g($=>{const{[N]:w,...L}=$.grid;return{...$,grid:L}}),[g]),k=j.useCallback(N=>{x($=>[...$.filter(({key:w})=>w!==N.key),N])},[x]),T=j.useCallback(N=>x($=>$.filter(({key:w})=>w!==N)),[k]),O=j.useMemo(()=>i1(h),[h]),B=j.useCallback(N=>{g($=>({...$,hold:N})),l?.(N)},[g,l]),F=`line-plot-${e}`,z=j.useMemo(()=>({lines:d,setGridEntry:C,removeGridEntry:_,setLine:k,removeLine:T,setViewport:y,addViewportHandler:v,setHold:B,id:F}),[F,d,C,_,k,T,y,v,B]);return o.jsxRuntimeExports.jsx("div",{id:F,className:u.CSS.B("line-plot"),style:{...t,...O},ref:S,...c,children:o.jsxRuntimeExports.jsx(ua,{value:z,children:o.jsxRuntimeExports.jsx(f.Composite,{path:m,children:r})})})},i1=e=>{const t=u.CSS.newGridBuilder();return I.regions("top",e).forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),t.row("plot-start","plot-end","minmax(0, 1fr)"),I.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),I.regions("left",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.col("plot-start","plot-end","minmax(0, 1fr)"),I.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},rr=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?I.XAxis.TYPE:I.YAxis.TYPE,s=`${e}-axis`,r=({aetherKey:i,children:l,location:a=t,label:c="",labelLevel:d="small",labelDirection:x=e,onLabelChange:p,color:m,labelSize:h,showGrid:g,type:E,bounds:S,className:R,tickSpacing:v,autoBounds:y,axisKey:C,autoBoundUpdateInterval:_,onAutoBoundsChange:k,style:T,...O})=>{const B=(c?.length??0)>0,F=f.useUniqueKey(i),z=f.useMemoDeepEqual({location:a,showGrid:g,type:E,bounds:S,axisKey:C,label:c,labelDirection:x,tickSpacing:v,autoBounds:y,autoBoundUpdateInterval:_}),[{path:N},{size:$,labelSize:w,...L},M]=f.use$2({aetherKey:F,type:n,schema:I.coreAxisStateZ,initialState:z});j.useEffect(()=>M(Z=>({...Z,...z})),[z]),j.useEffect(()=>{const{lower:Z,upper:K}=I.parseAutoBounds(L.autoBounds);L.bounds!=null&&(Z&&S?.lower!==L.bounds.lower||K&&S?.upper!==L.bounds.upper)&&k?.(L.bounds)},[L.autoBounds,L.bounds]);const D=In({loc:a,key:`${n}-${F}`,size:$+w,order:1},`${e.toUpperCase()}Axis`),H=_s.useTypography(d).toString(),V=j.useRef(0);return j.useEffect(()=>{if(e==="y"){if(c==null)return;let K=A.dimensions(c,H)[u.g.dimension(u.g.construct(x))];K>0&&(K+=9),M(q=>({...q,labelSize:K}))}else{let K=A.dimensions(c,H).height*1.3;K>0&&(K+=12);const q=V.current;I.withinSizeThreshold(q,K)||(V.current=K,M(ne=>({...ne,labelSize:K})))}},[c,x,H]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(R,u.CSS.B("axis"),u.CSS.B(s),u.CSS.loc(a)),style:{...T,...D},align:"center",justify:a!=="left"?"end":"start",direction:u.g.swap(e),...O,children:B&&o.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS(u.CSS.BE("axis","label"),u.CSS.dir(x)),value:c,onChange:p,level:d})}),o.jsxRuntimeExports.jsx(f.Composite,{path:N,children:l})]})};return r.displayName=`${e.toUpperCase()}Axis`,r},pa=rr("x"),ma=rr("y"),fa=u.K.xy.extend({root:u.K$1.corner,units:te.z.object({x:te.z.enum(["px","decimal"]),y:te.z.enum(["px","decimal"])})}),l1=fa.partial({root:!0,units:!0}),a1=e=>{const t={};return t[e.root?.x??"left"]=e?.units?.x==="px"?`${e.x}px`:`${e.x*100}%`,t[e.root?.y??"top"]=e?.units?.y==="px"?`${e.y}px`:`${e.y*100}%`,t},c1=(e,t)=>{const n={x:e.x,y:e.y};if(t.current==null)return n;const s=u.Ho.construct(t.current),r=u.Ho.construct(t.current.parentElement);return e.units?.x==="decimal"?e.root?.x==="right"&&(n.x=1-e.x):e.root?.x==="right"?n.x=1-(e.x+u.Ho.width(s))/u.Ho.width(r):n.x/=u.Ho.width(r),e.units?.y==="decimal"?e.root?.y==="bottom"&&(n.y=1-e.y):e.root?.y==="bottom"?n.y=1-(e.y+u.Ho.height(s))/u.Ho.height(r):n.y/=u.Ho.height(r),n},ha=(e,t)=>{if(t.current==null)return null;const n=u.Ho.construct(t.current.parentElement),s=u.Ho.construct(t.current),r={x:e.x,y:e.y,root:{...u.K$1.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*u.Ho.width(n)-u.Ho.width(s),r.root.x="right"):e.x<.2?r.x=e.x*u.Ho.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*u.Ho.height(n)-u.Ho.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*u.Ho.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...u.K.truncate(r,3)}},Ri=u.Ho.reRoot(u.Ho.DECIMAL,u.K$1.TOP_LEFT),u1={x:.1,y:.1,root:u.K$1.TOP_LEFT,units:{x:"decimal",y:"decimal"}},ir=j.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,initial:i=u1,...l})=>{const[a,c]=A.usePurePassthrough({value:t,onChange:n,initial:i}),d=j.useRef(a),x=f.useSyncedRef(r===!1),p=j.useRef(null);a!==null&&(s={...s,...a1(a)});const m=j.useCallback(g=>{if(p.current?.parentElement==null)return d.current;const E=u.Ho.construct(p.current.parentElement),S=u.C.XY.scale(E).scale(Ri),R=S.box(u.Ho.construct(p.current)),v=u.C.XY.clamp(u.Ho.construct(u.Ho.topLeft(Ri),{width:1-u.Ho.width(R),height:1-u.Ho.height(R)})),y=u.K.translate(u.K.construct(d.current),u.Ho.signedDims(S.box(g))),C=v.pos(y);return ha(C,p)},[]),h=Ne.useCursorDrag({onStart:j.useCallback(()=>{d.current=c1(d.current,p)},[]),onMove:j.useCallback(g=>{if(x.current)return;const E=m(g);E!==null&&c(E)},[]),onEnd:j.useCallback(g=>{if(x.current)return;const E=m(g);E!==null&&(d.current=E)},[])});return o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(e,u.CSS.B("legend")),bordered:!0,style:s,onDragStart:h,draggable:r,borderColor:5,ref:p,onDrag:f.preventDefault,onDragEnd:f.preventDefault,background:1,rounded:1,...l})});ir.displayName="Legend.Container";const Ps=j.memo(({data:e,onEntryChange:t,onVisibleChange:n,allowVisibleChange:s=!0,background:r=1})=>o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e.sort((i,l)=>i.label.localeCompare(l.label)).map(({key:i,color:l,label:a,visible:c=!0})=>o.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS.B("legend-swatch"),x:!0,align:"center",gap:"small",justify:"between",children:[o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",align:"center",gap:"small",children:[o.jsxRuntimeExports.jsx(Ne.Swatch,{value:l,onChange:d=>t?.({key:i,color:d,label:a,visible:c}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"tiny"}),o.jsxRuntimeExports.jsx(f.MaybeEditable,{level:"small",value:a,onChange:d=>t?.({key:i,color:l,label:d,visible:c}),overflow:"nowrap",color:c?10:7,onDoubleClick:d=>d.stopPropagation()})]}),s&&o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.B("visible-toggle"),onClick:d=>{d.stopPropagation(),t?.({key:i,color:l,label:a,visible:!c})},onDoubleClick:d=>d.stopPropagation(),size:"tiny",contrast:r,variant:"text",children:c?o.jsxRuntimeExports.jsx(f.Visible,{}):o.jsxRuntimeExports.jsx(f.Hidden,{})})]},i))}));Ps.displayName="LegendSwatches";const lr=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,allowVisibleChange:r=!0,background:i=1,...l})=>{const[a,c]=j.useState(!1);return e.length===0?null:o.jsxRuntimeExports.jsx(ir,{...l,className:r?u.CSS.M("with-visible-toggle"):void 0,draggable:!a,value:n,onChange:s,gap:r?0:"small",background:i,children:o.jsxRuntimeExports.jsx(Ps,{data:e,onEntryChange:t,onVisibleChange:c,allowVisibleChange:r,background:i})})},d1=Object.freeze(Object.defineProperty({__proto__:null,Container:ir,LegendSwatches:Ps,Simple:lr,calcStickyPos:ha,completeStickyXYz:fa,stickyXYz:l1},Symbol.toStringTag,{value:"Module"})),ar=j.memo(({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=tt("Legend");return tt("Legend"),o.jsxRuntimeExports.jsx(lr,{data:r,onEntryChange:n,...s})});ar.displayName="FloatingLegend";const x1=({onLineChange:e})=>{const{lines:t}=tt("Legend"),n=f.useUniqueKey(),s=In({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(u.CSS.BE("legend","container"),u.CSS.B("legend","fixed")),align:"center",justify:"start",x:!0,style:s,children:o.jsxRuntimeExports.jsx(Ps,{data:t,onEntryChange:e,background:0})})},ga=({variant:e="floating",...t})=>e==="floating"?o.jsxRuntimeExports.jsx(ar,{...t}):o.jsxRuntimeExports.jsx(x1,{...t}),cr=j.memo(({aetherKey:e,...t})=>(f.useUnidirectional({aetherKey:e,type:I.Line.TYPE,schema:I.stateZ,state:t}),null));cr.displayName="Line";const p1=Object.freeze(Object.defineProperty({__proto__:null,Line:cr},Symbol.toStringTag,{value:"Module"})),ur=({aetherKey:e,color:t,label:n="",visible:s=!0,...r})=>{const i=f.useUniqueKey(e),{setLine:l,removeLine:a}=tt("Line");return j.useEffect(()=>(l({key:i,color:t,label:n,visible:s}),()=>a(i)),[n,t,s]),o.jsxRuntimeExports.jsx(cr,{aetherKey:i,color:t,label:n,visible:s,...r})},ja=({level:e="h2",...t})=>{const n=f.useUniqueKey(),s=_s.useTypography(e),r=In({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return o.jsxRuntimeExports.jsx(f.Box,{justify:"center",align:"center",style:r,children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{...t,level:e})})},Ea=({aetherKey:e,...t})=>{const n=f.useUniqueKey(e),[,,s]=f.use$2({aetherKey:n,type:I.Tooltip.TYPE,schema:I.tooltipStateZ,initialState:{position:null,...t}}),r=j.useRef(null),i=j.useCallback(a=>{const c=document.querySelector(".pluto-canvas-container");if(c==null)return;const d=u.Ho.topLeft(c);s({position:u.K.translation(d,u.K.construct(a))})},[s]),l=j.useCallback(()=>s({position:null}),[s]);return j.useEffect(()=>{if(r.current===null)return;const a=r.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",l),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",l)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:r})},m1=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Ea},Symbol.toStringTag,{value:"Module"})),ya=()=>{const e=j.useRef(new Map),t=j.useCallback(s=>{const{request:r,response:i}=s,l=e.current.get(r);l!=null&&(l(i.bounds),e.current.delete(r))},[]),[,,n]=f.use$2({type:I.BoundQuerier.TYPE,schema:I.boundQuerierStateZ,onAetherChange:t,initialState:{request:"",response:{request:"",bounds:{}}}});return j.useCallback(async()=>await new Promise(s=>{const r=u.kt.create();e.current.set(r,s),n(i=>({...i,request:r}))}),[])},f1=({ref:e})=>(e.current=ya(),null),h1={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer",cancel:"default"},Sa=({className:e,mode:t,maskBox:n,children:s,style:r,...i})=>o.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.noSelect,u.CSS.BE("viewport-mask","container"),e),style:{cursor:h1[t],...r},...i,children:[o.jsxRuntimeExports.jsx("div",{style:{...u.Ho.css(n),display:u.Ho.areaIsZero(n)?"none":"block"},className:u.CSS.BE("viewport-mask","selection")}),s]}),g1=(e,t)=>{for(;e!=null&&!t(e);)e=e.parentElement;return e},j1=11,E1=6,y1=2,Ci=5,S1=e=>u.Ho.width(e)<Ci&&u.Ho.height(e)<Ci,fn=e=>{const t=u.Ho.width(e),n=u.Ho.height(e);return Math.min(t,n)<.001?j1:E1},R1=["zoom","pan","select","zoomReset","cancel"],dr=[...R1,"click"],C1=te.z.enum(dr),Ra=["zoom","select"],hn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"],["MouseMiddle"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},Ca={defaultMode:"pan",pan:[["MouseLeft"],["MouseMiddle"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},wa={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"],["MouseMiddle"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]],cancel:[["Escape"]]},xr={zoom:hn,pan:Ca,select:wa,zoomReset:hn,click:hn,cancel:hn},w1=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},b1=u.Ho.construct(0,0,1,1,u.K$1.TOP_LEFT),v1={width:30,height:50},ba=({onChange:e,triggers:t,initial:n=b1,threshold:s=v1,ref:r})=>{const i=t?.defaultMode??"zoom",[l,a]=j.useState(u.Ho.ZERO),[c,d]=j.useState(i),[x,p]=f.useStateRef(n),m=j.useRef(u.K.ZERO),h=j.useRef(null),g=u._.construct(s);j.useEffect(()=>p(()=>u.Ho.truncate(n,fn(n))),[n]),j.useEffect(()=>d(i),[i]);const[E,S,R,v]=f.useMemoCompare(()=>{const O={...xr[i],...t},B=f.flattenConfig(O),F=w1(O);return[O,B,F,f.flattenConfig(F)]},f.compareModeConfigs,[t]),y=j.useCallback(({box:O,triggers:B,stage:F,cursor:z})=>{if(h.current==null)return;const N=f.determineMode(E,B),$=u.Ho.construct(h.current);if(N==null)return;if(N==="cancel"){a(u.Ho.ZERO),e?.({box:x.current,mode:N,stage:F,cursor:z});return}if(N==="zoomReset")return a(u.Ho.ZERO),e?.({box:u.Ho.DECIMAL,mode:N,stage:F,cursor:z}),p(u.Ho.DECIMAL);const w=S1(O);if(F==="end"){if(w){N==="zoom"&&a(u.Ho.ZERO),e?.({box:x.current,mode:"click",stage:F,cursor:z});return}return p(M=>{if(N==="pan"){const H=wi(O,M,$);return H===null||u.Ho.equals(H,M)?M:(e?.({box:H,mode:N,stage:F,cursor:z}),H)}const D=C(O,M,$);return D===null?M:(e?.({box:D,mode:N,stage:F,cursor:z}),N==="zoom"?(a(u.Ho.ZERO),D):u.Ho.truncate(M,fn(M)))})}if(Ra.includes(N))return w?void 0:a(u.C.XY.scale($).clamp($).translate({x:-u.Ho.left($),y:-u.Ho.top($)}).box(bi(g,O,$)));if(a(M=>u.Ho.areaIsZero(M)?M:u.Ho.ZERO),u.K.distance(z,m.current)<y1)return;m.current=z;const L=wi(O,x.current,$);e?.({box:L,mode:N,stage:F,cursor:z})},[a,d,e,E,s.height,s.width,p,h,fn]);j.useImperativeHandle(r,()=>({reset:()=>{a(u.Ho.ZERO),p(u.Ho.DECIMAL),e?.({box:u.Ho.DECIMAL,mode:"zoomReset",stage:"start",cursor:u.K.ZERO})}}),[e]);const C=j.useCallback((O,B,F)=>{const z=vo(B,F).box(bi(g,O,F));return u.Ho.truncate(z,fn(z))},[s]),_=f.useHeldRef({triggers:[["Control"]]}),k=f.useHeldRef({triggers:[["Alt"]]});j.useEffect(()=>{const O=B=>{if(h.current==null)return;let F=1;B.deltaY<0?F-=.035:F+=.035;const z=u.Ho.construct(h.current),N=u.K.construct(B);if(Array.from(h.current.children).push(h.current),!u.Ho.contains(z,N)||h.current!==B.target&&g1(B.target,H=>H===h.current)==null)return;const L=vo(x.current,u.Ho.construct(h.current)).pos(u.K.construct(B));let D=u.C.XY.magnify({x:_.current.held?1:F,y:k.current.held?1:F}).box(x.current);D=u.Ho.translate(D,{x:_.current.held?0:L.x*(1-F),y:k.current.held?0:L.y*(1-F)}),p(D),e?.({stage:"end",box:D,cursor:u.K.construct(B),mode:"zoom"})};return window.addEventListener("wheel",O),()=>window.removeEventListener("wheel",O)},[p,e]),Vl.useDrag({bound:h,onDrag:y,triggers:S,loose:!0});const T=j.useCallback(({triggers:O,stage:B})=>{if(B==="end")return d(i);const F=f.determineMode(R,O);F!=null&&d(F)},[R,i,e]);return f.use$1({triggers:v,callback:T,region:h}),{maskBox:l,ref:h,mode:c}},vo=(e,t)=>u.C.XY.scale(t).clamp(t).scale(e),wi=(e,t,n)=>{let s=u.Ho.signedDims(vo(t,n).box(e));s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight};const r=u.C.XY.translate(u.K.construct(s)).box(t);return u.Ho.truncate(r,fn(r))},bi=(e,t,n)=>u.Ho.height(t)<=e.height?u.Ho.construct(u.Ho.left(t),u.Ho.top(n),u.Ho.width(t),u.Ho.height(n)):u.Ho.width(t)<=e.width?u.Ho.construct(u.Ho.left(n),u.Ho.top(t),u.Ho.width(n),u.Ho.height(t)):t,Wt=({mode:e,triggers:t})=>o.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:[u.z.capitalize(e),o.jsxRuntimeExports.jsx(f.Text$1,{trigger:t[0],el:"span"})]}),_1=({triggers:e,value:t,onChange:n,disable:s=["zoomReset","click","cancel"],tooltipDelay:r,tooltipLocation:i,hideTooltip:l,...a})=>{const c=j.useMemo(()=>dr.filter(x=>!s.includes(x)),[s]),d={tooltipDelay:r,tooltipLocation:i,hideTooltip:l,size:"small"};return o.jsxRuntimeExports.jsxs(pe.Buttons,{...a,keys:c,value:t,onChange:n,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"zoom",tooltip:o.jsxRuntimeExports.jsx(Wt,{mode:"zoom",triggers:e.zoom}),...d,children:o.jsxRuntimeExports.jsx(f.Zoom,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pan",tooltip:o.jsxRuntimeExports.jsx(Wt,{mode:"pan",triggers:e.pan}),...d,children:o.jsxRuntimeExports.jsx(f.Pan,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"select",tooltip:o.jsxRuntimeExports.jsx(Wt,{mode:"select",triggers:e.select}),...d,children:o.jsxRuntimeExports.jsx(f.Selection,{})})]})},k1=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:xr,MASK_MODES:Ra,MODES:dr,Mask:Sa,PAN_DEFAULT_TRIGGERS:Ca,SELECT_DEFAULT_TRIGGERS:wa,SelectMode:_1,TooltipText:Wt,ZOOM_DEFAULT_TRIGGERS:hn,modeZ:C1,use:ba},Symbol.toStringTag,{value:"Module"})),L1=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,va=({ref:e,children:t,initial:n=u.Ho.DECIMAL,onChange:s,...r})=>{const{setViewport:i}=tt("Viewport");j.useLayoutEffect(()=>{i({box:n,mode:"zoom",cursor:u.K.ZERO,stage:"start"})},[i,n]);const l=j.useCallback(c=>{i(c),s?.(c)},[s,i]),a=ba({onChange:l,initial:n,ref:e,...r});return o.jsxRuntimeExports.jsx(Sa,{className:u.CSS.BE("line-plot","viewport"),...a,children:t})},M1=Object.freeze(Object.defineProperty({__proto__:null,BoundsQuerier:f1,Floating:ar,Legend:ga,Line:ur,LinePlot:xa,Title:ja,Tooltip:m1,Viewport:va,XAxis:pa,YAxis:ma,axisFactory:rr,selectViewportEl:L1,useBoundQuerier:ya,useContext:tt,useGridEntry:In,useViewport:da},Symbol.toStringTag,{value:"Module"})),P1=({aetherKey:e,...t})=>(f.use$2({aetherKey:e,type:I.Annotation.TYPE,schema:I.annotationStateZ,initialState:t}),null),_a=({aetherKey:e,menu:t,...n})=>{const s=f.useUniqueKey(e),{setViewport:r,setHold:i}=tt("Range.Provider"),[,{hovered:l,count:a},c]=f.use$2({aetherKey:s,type:I.Provider.TYPE,schema:I.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),d=In({key:s,loc:"top",size:a>0?32:0,order:3},"Annotation.Provider"),x=f.useContextMenu(),p=f.useSyncedRef(x.visible),m=j.useCallback(g=>c(E=>({...E,cursor:{x:g.clientX,y:g.clientY}})),[c]),h=j.useCallback(()=>{p.current||c(g=>({...g,cursor:null}))},[c,p]);return o.jsxRuntimeExports.jsx(f.ContextMenu,{...x,menu:()=>t==null||l==null?null:t(l),children:o.jsxRuntimeExports.jsx(f.Box,{style:{...d,cursor:l!=null?"pointer":"default",width:"100%",height:"100%"},onContextMenu:x.open,className:x.className,onClick:()=>{l!=null&&(r({box:u.Ho.construct({x:l.viewport.lower,y:0},{x:l.viewport.upper,y:1}),mode:"zoom",cursor:u.K.ZERO,stage:"start"}),i(!0))},onMouseMove:m,onMouseLeave:h})})},N1=Object.freeze(Object.defineProperty({__proto__:null,Annotation:P1,Provider:_a},Symbol.toStringTag,{value:"Module"})),ka={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},T1=f.flattenConfig(ka),La=({aetherKey:e})=>{const t=f.useUniqueKey(e),[,,n]=f.use$2({aetherKey:t,type:I.Measure.TYPE,schema:I.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=j.useRef(null),r=f.useHeldRef({triggers:T1,loose:!0}),i=j.useCallback(({mode:c,cursor:d})=>{if(c==="click"){const x=f.determineMode(ka,r.current.triggers,{loose:!0});if(["one","two"].includes(x))return n(p=>({...p,[x]:d}));n(x==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??d,two:p.one!==null?d:p.two}))}},[n,r]);da(i);const l=j.useCallback(c=>n(d=>({...d,hover:u.K.construct(c)})),[n]),a=j.useCallback(()=>{n(c=>({...c,hover:null}))},[n]);return j.useEffect(()=>{if(s.current===null)return;const c=s.current.parentElement;if(c!=null)return c.addEventListener("mousemove",l),c.addEventListener("mouseleave",a),()=>{c.removeEventListener("mousemove",l),c.removeEventListener("mouseleave",a)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:s})},I1=Object.freeze(Object.defineProperty({__proto__:null,Measure:La},Symbol.toStringTag,{value:"Module"})),pr=({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:r,onUnitsChange:i,units:l="",color:a,lineWidth:c,lineDash:d,className:x,onSelect:p,style:m,...h})=>{const[g,E]=A.usePurePassthrough({value:t,onChange:s,initial:""}),S=f.useSyncedRef(r),[,{pixelPosition:R},v]=f.use$2({aetherKey:e,type:I.Rule.TYPE,schema:I.ruleStateZ,initialState:{color:a,dragging:!1,position:n,lineWidth:c,lineDash:d},onAetherChange:j.useCallback(({position:N})=>{N!=null&&S.current?.(N)},[S])}),y=j.useRef(R);R!==y.current&&(y.current=R);const{id:C}=tt("Rule"),k=document.getElementById(C)?.querySelector(".pluto-line-plot__viewport"),T=j.useRef(R);j.useEffect(()=>{v(N=>({...N,position:n,color:a,lineWidth:c,lineDash:d}))},[n,a,c,d]);const O=Ne.useCursorDrag({onStart:j.useCallback(()=>{p?.(),v(N=>({...N,dragging:!0})),T.current=y.current},[]),onMove:N=>{v($=>({...$,pixelPosition:(T.current??0)+u.Ho.signedHeight(N)}))},onEnd:j.useCallback(()=>{v(N=>({...N,dragging:!1})),T.current=R},[])}),B=j.useRef(null);if(n==null||R==null)return null;const F=u.cr.pickByContrast(a,u.cr.BLACK,u.cr.WHITE),z=o.jsxRuntimeExports.jsxs("div",{ref:B,className:u.CSS.B("rule"),style:{top:`calc(${R}px - 0.5rem)`},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("rule","drag-handle"),onDragStart:O,draggable:!0}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",className:u.CSS(x,u.CSS.BE("rule","tag")),bordered:!0,onClick:p,empty:!0,rounded:!0,style:{borderColor:u.cr.cssString(a),backgroundColor:u.cr.hex(u.cr.setAlpha(a,.7)),...m},...h,children:[o.jsxRuntimeExports.jsx(f.Editable,{className:u.CSS.BE("rule","label"),level:"small",value:g,onChange:E,color:F}),o.jsxRuntimeExports.jsx(f.Divider$1,{y:!0,style:{borderColor:u.cr.cssString(a)}}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",className:u.CSS.BE("rule","value"),children:[o.jsxRuntimeExports.jsx(f.Editable,{value:n.toFixed(2),onChange:N=>{const $=Number(N);isFinite($)&&r?.($)},level:"small",color:F}),l.length>0&&o.jsxRuntimeExports.jsx(f.MaybeEditable,{level:"small",color:F,value:l,onChange:i})]})]})]});return k==null?z:zl.createPortal(z,k)},A1=Object.freeze(Object.defineProperty({__proto__:null,Rule:pr},Symbol.toStringTag,{value:"Module"})),Ma=f.canDropOfType(vt),O1=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:r,showLegend:i=!0,legendPosition:l,onLegendPositionChange:a,titleLevel:c="h4",onLineChange:d,onRuleChange:x,onAxisChannelDrop:p,onAxisChange:m,rules:h,enableTooltip:g=!0,enableMeasure:E=!1,initialViewport:S=u.Ho.DECIMAL,legendVariant:R,onViewportChange:v,viewportTriggers:y,rangeAnnotationProvider:C,onSelectRule:_,children:k,...T})=>{const O=t.filter(({location:$})=>u.K$1.isY($)),B=j.useRef(null),F=f.usePrevious(e.length),z=f.usePrevious(T.hold),N=F===0&&e.length!==0||z===!0&&T.hold===!1;return j.useEffect(()=>{N&&B.current?.reset()},[N]),o.jsxRuntimeExports.jsxs(xa,{...T,children:[O.map(($,w)=>{const L=e.filter(H=>H.axes.x===$.key),M=t.filter(({location:H})=>u.K$1.isX(H)),D=h?.filter(H=>[...M.map(({key:V})=>V),$.key].includes(H.axis));return o.jsxRuntimeExports.jsx(D1,{axis:$,index:w,lines:L,yAxes:M,rules:D,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:C,onRuleChange:x,onSelectRule:_},$.key)}),i&&o.jsxRuntimeExports.jsx(ga,{onLineChange:d,position:l,onPositionChange:a,variant:R}),n&&o.jsxRuntimeExports.jsx(ja,{value:s,onChange:r,level:c}),o.jsxRuntimeExports.jsxs(va,{initial:S,onChange:v,triggers:y,ref:B,children:[g&&o.jsxRuntimeExports.jsx(Ea,{}),E&&o.jsxRuntimeExports.jsx(La,{}),k]})]})},D1=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:r,onSelectRule:i,onAxisChannelDrop:l,onAxisChange:a,axis:{location:c,key:d,showGrid:x,...p},annotationProvider:m})=>{const h=f.useDrop({type:"Channel.LinePlot.XAxis",canDrop:Ma,onDrop:j.useCallback(({items:S})=>{const R=f.filterByType(vt,S);return l?.(d,R.map(({key:v})=>v)),R},[d,l])}),g=s?.filter(S=>S.axis===d),E=f.useDraggingState();return o.jsxRuntimeExports.jsxs(pa,{...p,...h,location:c,axisKey:d,showGrid:x??n===0,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(vt)(E))),onAutoBoundsChange:S=>a?.({key:d,bounds:S}),onLabelChange:S=>a?.({key:d,label:S}),children:[e.map((S,R)=>{const v=t.filter(C=>C.axes.y===S.key),y=s?.filter(C=>C.axis===S.key);return o.jsxRuntimeExports.jsx($1,{axis:{...S,showGrid:x??(n===0&&R===0)},lines:v,rules:y,onRuleChange:r,onAxisChannelDrop:l,onAxisChange:a,onSelectRule:i},S.key)}),g?.map(S=>j.createElement(pr,{aetherKey:S.key,...S,key:S.key,onLabelChange:R=>r?.({key:S.key,label:R}),onPositionChange:R=>r?.({key:S.key,position:R}),onUnitsChange:R=>r?.({key:S.key,units:R}),onSelect:()=>i?.(S.key)})),o.jsxRuntimeExports.jsx(_a,{...m})]})},B1=({channels:{x:e,y:t}})=>`${e??0}-${t}`,$1=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:i,location:l,...a},onSelectRule:c})=>{const d=f.useDrop({type:"Channel.LinePlot.YAxis",canDrop:Ma,onDrop:j.useCallback(({items:p})=>{const m=f.filterByType(vt,p);return s?.(i,m.map(({key:h})=>h)),m},[i,s])}),x=f.useDraggingState();return o.jsxRuntimeExports.jsxs(ma,{...a,...d,location:l,axisKey:i,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(vt)(x))),onAutoBoundsChange:p=>r?.({key:i,bounds:p}),onLabelChange:p=>r?.({key:i,label:p}),children:[e.map(p=>o.jsxRuntimeExports.jsx(z1,{line:p},B1(p))),t?.map(p=>j.createElement(pr,{aetherKey:p.key,...p,key:p.key,onLabelChange:m=>n?.({key:p.key,label:m}),onPositionChange:m=>n?.({key:p.key,position:m}),onUnitsChange:m=>n?.({key:p.key,units:m}),onClick:()=>c?.(p.key)}))]})},z1=({line:e})=>e.variant==="static"?o.jsxRuntimeExports.jsx(F1,{line:e}):o.jsxRuntimeExports.jsx(V1,{line:e}),V1=({line:{key:e,timeSpan:t,channels:{x:n,y:s},axes:r,...i}})=>{const{xTelem:l,yTelem:a}=j.useMemo(()=>{const c=Number(t.valueOf())*3,d=I.streamChannelData({timeSpan:t,channel:s,keepFor:c}),x=n!=null&&n!==0;return{xTelem:I.streamChannelData({timeSpan:t,channel:x?n:s,useIndexOfChannel:!x,keepFor:c}),yTelem:d}},[t.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(ur,{aetherKey:e,y:a,x:l,...i},e)},F1=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const{xTelem:i,yTelem:l}=j.useMemo(()=>{const a=I.channelData({timeRange:e,channel:s}),c=n!=null&&n!==0;return{xTelem:I.channelData({timeRange:e,channel:c?n:s,useIndexOfChannel:!c}),yTelem:a}},[e.start.valueOf(),e.end.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(ur,{aetherKey:t,y:l,x:i,...r},t)},lt=(e,t,n)=>({variant:"loading",status:u.wr.create({variant:"loading",message:`${u.z.capitalize(t)} ${e}`}),data:n}),Ve=(e,t,n)=>({variant:"success",status:u.wr.create({variant:"success",message:`${u.z.capitalize(t)} ${e}`}),data:n}),_t=(e,t,n)=>({variant:"error",status:u.wr.fromException(n,`Failed to ${t} ${e}`),data:void 0}),Ut=(e,t)=>({variant:"disabled",status:u.wr.create({variant:"disabled",message:`Failed to ${t} ${e}`,description:`Cannot ${t} ${e} because no cluster is connected.`}),data:void 0}),mr=j.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:()=>{},setCurrentStateAsInitialValues:()=>{},getStatuses:()=>[]}),rn=e=>{const t=j.use(mr);return e??t},Et=(e,t={})=>{const{optional:n=!1,onChange:s,defaultValue:r}=t,i=rn(t?.ctx),{get:l,bind:a,set:c,setStatus:d}=i,x=j.useCallback(g=>{s?.(g,{...i,path:e}),c(e,g)},[e,c,s]),p=j.useCallback(g=>d(e,g),[e,d]),m=j.useSyncExternalStore(a,j.useCallback(()=>l(e,{optional:n,defaultValue:r}),[e,l,n,r]));if(m==null){if(!n)throw new Error(`Field state is null: ${e}`);return null}const h=i.mode==="preview"?"preview":void 0;return{onChange:x,setStatus:p,variant:h,...m}},fr=(e,t)=>{const{get:n,bind:s}=rn(t?.ctx);return j.useSyncExternalStore(s,j.useCallback(()=>n(e,t),[e,n,t]))},hr=(e,t)=>fr(e,t)?.value??null,H1=e=>fr(e,{optional:!0})?.status?.variant==="success",Pa=(e,t)=>({value:()=>e.get(t).value,add:(n,s)=>{const r=u.yr(e.get(t).value);r.splice(s,0,...A.t.toArray(n)),e.set(t,r)},push:(n,s)=>{const r=u.yr(e.get(t).value);r.push(...A.t.toArray(n)),s!=null&&r.sort(s),e.set(t,r)},remove:n=>{const s=e.get(t).value,r=new Set(A.t.toArray(n)),i=s.filter(({key:l})=>!r.has(l));return e.set(t,i),i.map(({key:l})=>l)},keepOnly:n=>{const s=e.get(t).value,r=new Set(A.t.toArray(n)),i=s.filter(({key:l})=>r.has(l));return e.set(t,i),i.map(({key:l})=>l)},set:n=>e.set(t,A.executeSetter(n,e.get(t).value)),sort:n=>{const s=u.yr(e.get(t).value);s.sort(n),e.set(t,s)}}),Z1=(e,t={})=>{const n=rn(t?.ctx),s=hr(e,t);return j.useMemo(()=>({data:s.map(({key:r})=>r),...Pa(n,e)}),[s,n,e])},K1=f.renderProp(e=>o.jsxRuntimeExports.jsx(f.Text$2,{...e})),Ee=({path:e,children:t=K1,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:i=!0,optional:l,onChange:a,className:c,defaultValue:d,...x})=>{const p=Et(e,{optional:l??i,onChange:a,defaultValue:d}),m=rn();if(p==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??=u.z.capitalize(A.N.element(e,-1)),r=typeof r=="function"?r(p,m):r,!r)return null;const h=p.status.message,{onChange:g,value:E}=p,S={onChange:g,value:E};return p.variant!=null&&(S.variant=p.variant),o.jsxRuntimeExports.jsx(Ie.Item,{padHelpText:s,helpText:h,status:p.status.variant,label:n,required:p.required,className:u.CSS(c,u.CSS.BE("field",e.split(".").join("-")),u.CSS.M(p.status.variant)),...x,children:t(S)})},An=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:i,path:l,fieldKey:a=t,optional:c,defaultValue:d,...x})=>o.jsxRuntimeExports.jsx(Ee,{...n,...x,defaultValue:d,optional:c,path:a?`${l}.${a}`:l,children:p=>o.jsxRuntimeExports.jsx(e,{...p,...s,...i})});return r.displayName=e.displayName,r},Na=An(f.Numeric),$e=Na({inputProps:{}}),Ta=An(f.Text$2),gr=Ta({inputProps:{}}),Ia=An(f.Switch$1),Ns=Ia({inputProps:{}}),Y1=e=>An(Nn)(e),W1=({children:e,...t})=>o.jsxRuntimeExports.jsx(mr,{value:t,children:e}),G1=e=>e.code==="custom"&&e.params!=null&&"variant"in e.params?e.params.variant:"error";class U1 extends I.a.Observer{schema;values;initialValues;statuses;touched;cachedRefs;constructor(t,n){super(),this.schema=n,this.values=A.N.copy(t),this.statuses=new Map,this.touched=new Set,this.cachedRefs=new Map,this.initialValues=A.N.copy(this.values)}setValue(t,n){t==""?this.values=A.N.copy(n):A.N.set(this.values,t,n),this.checkTouched(t,n),this.updateCachedRefs(t)}checkTouched(t,n){const s=A.N.get(this.initialValues,t,{optional:!0});A.N.equal(s,n)?(this.clearTouched(t),this.clearOrphanedTouchedPaths(t)):this.setTouched(t)}clearOrphanedTouchedPaths(t){const n=new Set;this.touched.forEach(s=>{A.N.pathsMatch(s,t)&&s!==t&&!A.N.has(this.values,s)&&n.add(s)}),n.forEach(s=>{this.touched.delete(s),this.cachedRefs.delete(s)})}setStatus(t,n){this.statuses.set(t,n),this.updateCachedRefs(t)}clearStatus(t=""){this.statuses.delete(t),this.updateCachedRefs(t)}reset(t){if(A.N.equal(this.values,t??this.initialValues))return;t!=null&&(this.initialValues=A.N.copy(t));const n=A.N.copy(this.initialValues);this.statuses.clear(),this.touched.clear();const s=new Set;this.cachedRefs.forEach((r,i)=>{const l=A.N.get(this.values,i,{optional:!0}),a=A.N.get(n,i,{optional:!0});A.N.equal(l,a)||s.add(i)}),s.forEach(r=>this.cachedRefs.delete(r)),this.values=n}setCurrentStateAsInitialValues(){this.initialValues=A.N.copy(this.values),this.touched.clear(),this.cachedRefs.clear()}setTouched(t){this.touched.add(t),this.updateCachedRefs(t)}clearTouched(t=""){t===""?this.touched.clear():this.touched.delete(t),this.updateCachedRefs(t),this.notify()}remove(t){A.N.remove(this.values,t),this.statuses.delete(t),this.clearTouched(t),this.cachedRefs.delete(t)}validate(t,n){if(this.schema==null)return!0;const s=this.schema.safeParse(this.values);return this.processValidation(t,s,n)}async validateAsync(t,n){if(this.schema==null)return!0;const s=await this.schema.safeParseAsync(this.values);return this.processValidation(t,s,n)}errorsToStatuses(t,n,s){return t.forEach(r=>{const i=[...n,...r.path],l=A.N.resolvePath(i.join("."),this.values);if(s.push({key:l,variant:G1(r),message:r.message}),r.code==="invalid_union"&&r.errors!=null&&r.errors.length>0){const a=r.errors.map(d=>d.filter(x=>A.N.has(this.values,[...i,...x.path].join("."))));a.sort((d,x)=>d.length-x.length);const c=a.find(d=>d.length>0);if(c==null)return;this.errorsToStatuses(c,i,s)}}),s}processValidation(t=!1,n,s){if(this.schema==null)return!0;const r=new Set;if(this.statuses.forEach((a,c)=>{a.variant!=="success"&&r.add(c)}),r.forEach(a=>this.clearStatus(a)),n.success)return!0;let i=!0;return this.errorsToStatuses(n.error.issues,[],[]).forEach(a=>{const{key:c,message:d,variant:x}=a;if(c==null)return;const p=s==null||A.N.pathsMatch(c,s)||A.N.pathsMatch(s,c),m=t||this.touched.has(c);!p||!m||(x!=="warning"&&(i=!1),this.setStatus(c,{key:c,variant:x,message:d}))}),i}get hasBeenTouched(){return this.touched.size>0}getStatuses(){return Array.from(this.statuses.values()).filter(t=>t.variant!=="success")}getState(t,n={}){const{optional:s=!1,defaultValue:r=void 0}=n,i=u.mr.getOrSetDefault(this.cachedRefs,t,{});let l=A.N.get(this.values,t,{optional:s||r!=null});if(l==null){if(r==null)return null;l=r,this.setValue(t,l)}if(i.value=l,i.required=!1,this.schema!=null){const a=ig.getFieldSchema(this.schema,t,{optional:!0});a!=null&&(i.required=!a.safeParse(void 0).success)}return i.status=u.mr.getOrSetDefault(this.statuses,t,{key:t,variant:"success",message:""}),i.touched=this.touched.has(t),i}updateCachedRefs(t){this.cachedRefs.forEach((n,s)=>{(A.N.pathsMatch(s,t)||A.N.pathsMatch(t,s))&&this.cachedRefs.set(s,{})})}}const jr=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r,onHasTouched:i})=>{const l=f.useInitializerRef(()=>new U1(e,n)),a=f.useSyncedRef(r),c=f.useErrorHandler(),d=f.useSyncedRef(i),x=j.useCallback(()=>{l.current.setCurrentStateAsInitialValues(),d.current?.(!1)},[]),p=j.useCallback(_=>l.current.onChange(_),[]),m=j.useCallback((_,k)=>l.current.getState(_,k),[]),h=j.useCallback(_=>{l.current.remove(_),l.current.notify()},[]),g=j.useCallback(_=>{const k=l.current.values,T=l.current.hasBeenTouched;l.current.reset(_),k!==l.current.values&&a.current?.({values:l.current.values,path:"",prev:k,valid:!0}),l.current.notify();const B=l.current.hasBeenTouched;B!==T&&d.current?.(B)},[]),E=j.useCallback(async _=>{const k=await l.current.validateAsync(!0,_);return l.current.notify(),k},[]),S=j.useCallback(_=>{const k=l.current.validate(!0,_);return l.current.notify(),k},[]),R=j.useCallback((_,k,T)=>{const{notifyOnChange:O=!0}=T??{},B=A.N.get(l.current.values,_,{optional:!0}),F=l.current.hasBeenTouched;l.current.setValue(_,k);const z=()=>{O&&a.current?.({values:l.current.values,path:_,prev:B,valid:!0}),l.current.notify();const N=l.current.hasBeenTouched;N!==F&&d.current?.(N)};try{l.current.validate()}catch{return c(async()=>{await l.current.validateAsync(),z()},"Failed to validate form")}z()},[]),v=j.useCallback(_=>A.N.has(l.current.values,_),[]),y=j.useCallback((_,k)=>{const T=l.current.hasBeenTouched;l.current.setStatus(_,k),l.current.notify();const O=l.current.hasBeenTouched;O!==T&&d.current?.(O)},[]),C=j.useCallback(()=>{l.current.clearStatus(),l.current.notify()},[]);return j.useEffect(()=>{t&&(l.current.reset(e),l.current.notify())},[t,e]),j.useMemo(()=>({bind:p,set:R,get:m,mode:s,validate:S,validateAsync:E,value:()=>l.current.values,has:v,remove:h,setStatus:y,clearStatuses:C,reset:g,setCurrentStateAsInitialValues:x,getStatuses:()=>l.current.getStatuses()}),[p,R,m,S,E,v,h,y,C,g,s,x])},Aa=({key:e,open:t,onChange:n})=>{const s=f.useMemoPrimitiveArray(e);It(async()=>{if(t==null)return;const r=await t();if(r==null)return;const i=r.onChange(n);return async()=>{i(),await r.close()}},[t==null,s])},X1=Object.freeze(Object.defineProperty({__proto__:null,useListener:Aa},Symbol.toStringTag,{value:"Module"})),En={...I.ZERO_CONTEXT_VALUE,state:A.vm.connectivity.DEFAULT},q1={maxRetries:4,baseInterval:A.O$1.seconds(1),scale:2},Er=j.createContext(En),Oa=()=>j.use(Er),Ot=()=>Oa().client,Q1=()=>Oa().state,_o={connected:"success",connecting:"loading",disconnected:"disabled",failed:"error"},Da="serverVersionMismatch",J1=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,e0=({children:e,client:t})=>{const{path:n}=f.useUnidirectional({type:I.Provider$1.TYPE,schema:I.Provider$1.stateZ,state:{props:null,state:null}});return o.jsxRuntimeExports.jsx(Er,{value:{...En,client:t},children:o.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})})},Ba=({children:e,connParams:t})=>{const[n,s,r]=f.useCombinedStateAndRef(En),{path:i}=f.useUnidirectional({type:I.Provider$1.TYPE,schema:I.Provider$1.stateZ,state:{props:t??null,state:null}}),l=f.useAdder(),a=j.useCallback(c=>{r.current.state.status!==c.status&&l({variant:_o[c.status],message:c.message??u.z.capitalize(c.status)}),s(d=>({...d,state:c}))},[l]);return It(async c=>{if(n.client!=null&&n.client.close(),t==null)return s(En);const d=new A.vm({retry:q1,...t,connectivityPollFrequency:A.O$1.seconds(2)});s({client:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(!c.aborted){if(s({client:d,state:x}),l({variant:_o[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||u.gr.semVerOlder(x.nodeVersion,x.clientVersion),m=J1(p,x.clientVersion,x.nodeVersion);l({variant:"warning",message:"Incompatible cluster version",description:m,details:{type:Da,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(a),()=>{d.close(),s(En)}}},[t,a]),o.jsxRuntimeExports.jsx(Er,{value:n,children:o.jsxRuntimeExports.jsx(f.Composite,{path:i,children:e})})},t0=Object.freeze(Object.defineProperty({__proto__:null,CONNECTION_STATE_VARIANTS:_o,Provider:Ba,SERVER_VERSION_MISMATCH:Da,TestProvider:e0,use:Ot,useConnectionState:Q1},Symbol.toStringTag,{value:"Module"})),n0=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:i,applyObservable:l,...a})=>{const c=Ot(),d=f.useErrorHandler(),x=f.useMemoPrimitiveArray(e),p=jr({values:s,...a,sync:!1,onChange:g=>{c!=null&&d(async()=>{await i?.({...g,client:c})},`Failed to apply changes for ${t}`)}});It(async()=>{if(c!=null)try{const g=await n({client:c});p.set("",g)}catch(g){d(g,`Failed to retrieve ${t}`)}},[x,c?.key]);const m=j.useCallback(async()=>{if(c!=null)return await r?.(c)},[x,c?.key]),h=j.useCallback(g=>l?.({changes:g,ctx:p}),[x,l]);return Aa({key:x,open:m,onChange:h}),p},s0=Object.freeze(Object.defineProperty({__proto__:null,Context:mr,Field:Ee,Form:W1,NumericField:$e,SwitchField:Ns,TextField:gr,buildNumericField:Na,buildSelectField:Y1,buildSwitchField:Ia,buildTextField:Ta,fieldBuilder:An,fieldListUtils:Pa,use:jr,useContext:rn,useField:Et,useFieldList:Z1,useFieldState:fr,useFieldValid:H1,useFieldValue:hr,useSynced:n0},Symbol.toStringTag,{value:"Module"})),Dt=({name:e,schema:t,retrieve:n,mountListeners:s,update:r,initialValues:i})=>({params:l,initialValues:a,autoSave:c=!1,afterSave:d,beforeSave:x,sync:p,onHasTouched:m,mode:h,scope:g})=>{const[E,S]=j.useState(lt(e,"retrieving",void 0)),R=f.useUniqueKey(g),v=Ot(),y=He(R),C=ks(),_=jr({schema:t,values:a??i,onChange:({path:z})=>{c&&z!==""&&F()},sync:p,onHasTouched:m,mode:h}),k=j.useCallback((z,N,$)=>_.set(z,N,{...$,notifyOnChange:!1}),[_]),T=j.useCallback(async(z,N={})=>{const{signal:$}=N;try{if(v==null)return S(Ut(e,"retrieve"));if(S(L=>lt(e,"retrieving",L.data)),$?.aborted)return;const w={client:v,params:z,store:y,..._,set:k};if(await n(w),$?.aborted)return;C.cleanup(),C.set(s?.(w)),S(Ve(e,"retrieved",void 0))}catch(w){if($?.aborted)return;S(_t(e,"retrieve",w))}},[v,e,_,y,k]),O=f.useMemoDeepEqual(l);It(async z=>await T(O,{signal:z}),[T,O]);const B=j.useCallback(async(z={})=>{const{signal:N}=z;try{if(v==null)return S(Ut(e,"update")),!1;const $={client:v,params:l,store:y,..._,set:k};return await _.validateAsync()?(S(lt(e,"updating",void 0)),await x?.($)===!1?(S(Ve(e,"updated",void 0)),!1):N?.aborted===!0?!1:(await r($),S(Ve(e,"updated",void 0)),d?.($),!0)):!1}catch($){return N?.aborted!==!0&&S(_t(e,"update",$)),!1}},[e,l,x,d]),F=j.useCallback(z=>void B(z),[B]);return{form:_,save:F,...E}},$a=j.createContext(null),He=e=>{const t=f.useRequiredContext($a),n=f.useUniqueKey(e);return j.useMemo(()=>t.scopedStore(n),[t,n])},za=({children:e,...t})=>{const n=Ot(),s=f.useErrorHandler(),r=f.useAsyncErrorHandler(),{path:i}=f.useLifecycle({type:I.PROVIDER_TYPE,schema:I.providerStateZ$1,initialState:{}}),l=()=>"client"in t?t.client:new I.Client({client:n,storeConfig:t.storeConfig,handleError:s,handleAsyncError:r}),a=f.useInitializerRef(l),c=j.useRef(null);return n?.key!==c.current?.key&&(c.current=n,a.current=l()),o.jsxRuntimeExports.jsx(f.Composite,{path:i,children:o.jsxRuntimeExports.jsx($a,{value:a.current,children:e})})},o0=()=>!0,r0=u.i.milliseconds(100),Ke=({name:e,mountListeners:t,retrieve:n,retrieveByKey:s})=>(r={})=>{const{filter:i=o0,sort:l,initialParams:a,retrieveDebounce:c=r0}=r,d=f.useSyncedRef(i),x=f.useSyncedRef(l),p=Ot(),m=j.useRef(new Map),h=f.useInitializerRef(()=>new Map),[g,E,S]=f.useCombinedStateAndRef(lt(e,"retrieving",void 0)),R=j.useRef(!0),v=j.useRef(a??null),y=ks(),C=He(),_=j.useCallback(N=>h.current.forEach(($,w)=>{$===N&&w()}),[h.current]),k=j.useCallback(N=>{if(x.current==null)return N;const $=N.map(w=>m.current.get(w)).filter(w=>w!=null);return $.sort(x.current),$.map(w=>w.key)},[x]),T=j.useCallback(async(N,$={})=>{const{signal:w,mode:L="replace"}=$,M=A.executeSetter(N,v.current??{});v.current=M;try{if(p==null)return E(Ut(e,"retrieve"));if(E(V=>lt(e,"retrieving",V.data)),L==="replace")R.current=!0;else if(L==="append"&&!R.current)return E(V=>Ve(e,"retrieved",V.data??[]));let D=await n({client:p,params:M,store:C});if(w?.aborted)return;D=D.filter(d.current),x.current!=null&&(D=D.sort(x.current)),D.length===0&&(R.current=!1);const H=D.map(V=>V.key);return y.cleanup(),y.set(t?.({client:p,store:C,params:M,onDelete:V=>{m.current.delete(V),E(Z=>Z.data==null?Z:{...Z,data:Z.data.filter(K=>K!==V)})},onChange:(V,Z,K={})=>{const{mode:q="append"}=K,ne=m.current.get(V)??null;if(ne!=null&&!d.current(ne))return;const J=A.executeSetter(Z,ne);J==null||!d.current(J)||(m.current.set(V,J),E(oe=>{if(oe.data==null)return oe;let se;if(ne==null)x.current!=null?se=k([...oe.data,V]):se=q==="prepend"?[V,...oe.data]:[...oe.data,V];else if(x.current!=null){const re=oe.data.indexOf(V),ee=k(oe.data),ie=ee.indexOf(V);re!==ie?se=ee:se=oe.data}else se=oe.data;return{...oe,data:se}}),_(V))}})),S.current.data!=null&&u.k.primitiveArrays(S.current.data,H)===u.k.EQUAL?E(V=>Ve(e,"retrieved",V.data??[])):(D.forEach(V=>m.current.set(V.key,V)),E(V=>{if(L==="replace"||V.data==null)return Ve(e,"retrieved",H);const Z=new Set(H);return Ve(e,"retrieved",[...V.data.filter(K=>!Z.has(K)),...H])}))}catch(D){if(w?.aborted)return;E(_t(e,"retrieve",D))}},[p,e,C,d]),O=j.useCallback((N,$={})=>{const{signal:w}=$;(async()=>{try{if(p==null||u.O.isZero(N))return;const L=await s({client:p,key:N,params:v.current??{},store:C});if(w?.aborted||L==null)return;if(!d.current(L)){m.current.set(N,null);return}m.current.set(N,L),_(N)}catch(L){if(w?.aborted)return;m.current.set(N,null),E(_t(e,"retrieve",L))}})()},[s,p,_]),B=j.useCallback(N=>{if(N==null)return;if(Array.isArray(N))return N.map(w=>B(w)).filter(w=>w!=null);const $=m.current.get(N);return $===void 0&&O(N),$},[O]),F=j.useCallback((N,$)=>$==null?()=>{}:(h.current.set(N,$),()=>h.current.delete(N)),[]);return{retrieve:Ne.useDebouncedCallback((N,$={})=>void T(N,$),new u.i(c).milliseconds,[T]),retrieveAsync:T,subscribe:F,getItem:B,...g,data:g?.data??[]}},i0=({key:e,subscribe:t,getItem:n})=>j.useSyncExternalStore(j.useCallback(s=>t(s,e),[t,e]),j.useCallback(()=>n(e),[n,e])),Va=e=>lt(e,"retrieving",void 0),Fa=e=>{const[t,n]=j.useState(Va(e.name));return{...t,...Ha({...e,onChange:n})}},Ha=({retrieve:e,mountListeners:t,name:n,onChange:s,scope:r})=>{const i=Ot(),l=j.useRef(null),a=He(r),c=ks(),d=j.useCallback(m=>s(h=>{if(h.data===void 0)return h;const g=A.executeSetter(m,h.data);return Ve(n,"retrieved",g)}),[s,n]),x=j.useCallback(async(m,h={})=>{const{signal:g}=h,E=A.executeSetter(m,l.current??{});l.current=E;try{if(i==null)return s(Ut(n,"retrieve"));if(s(v=>lt(n,"retrieving",v.data)),g?.aborted)return;const S={client:i,params:E,store:a},R=await e(S);if(g?.aborted)return;c.cleanup(),c.set(t?.({...S,onChange:d})),s(Ve(n,"retrieved",R))}catch(S){if(g?.aborted)return;s(_t(n,"retrieve",S))}},[i,n]);return{retrieve:j.useCallback((m,h)=>void x(m,h),[x]),retrieveAsync:x}},l0=({params:e,...t})=>{const{retrieveAsync:n,retrieve:s,...r}=Fa(t),i=f.useMemoDeepEqual(e);return It(async l=>await n(i,{signal:l}),[n,i]),r},a0=({params:e,...t})=>{const n=j.useRef(Va(t.name)),{retrieveAsync:s}=Ha({...t,onChange:i=>{n.current=A.executeSetter(i,n.current),t.onChange?.(n.current)}}),r=f.useMemoDeepEqual(e);It(async i=>{r!=null&&await s(r,{signal:i})},[s,r])},qe=e=>({useDirect:t=>l0({...e,...t}),useStateful:()=>Fa(e),useEffect:t=>a0({...e,...t})}),Za=({onChange:e,params:t,update:n,name:s,scope:r,beforeUpdate:i,afterUpdate:l})=>{const a=Ot(),c=He(r),d=j.useCallback(async(p,m={})=>{const{signal:h}=m;try{if(a==null)return e(Ut(s,"update")),!1;e(E=>lt(s,"updating",E.data));let g=!1;if(i!=null){const E=await i({client:a,value:p});if(E==null)return!1;p=E}return await n({client:a,onChange:E=>{g=!0,e(Ve(s,"updated",E))},value:p,params:t,store:c}),h?.aborted===!0?!1:(g||e(Ve(s,"updated",p)),l!=null&&await l({client:a,value:p}),!0)}catch(g){return h?.aborted!==!0&&e(_t(s,"update",g)),!1}},[s,t]);return{update:j.useCallback((p,m)=>void d(p,m),[d]),updateAsync:d}},c0=({params:e,name:t,...n})=>{const[s,r]=j.useState(Ve(t,"updated",void 0)),i=Za({...n,name:t,onChange:r,params:e});return{...s,...i}},ct=e=>({useObservable:t=>Za({...t,...e}),useDirect:t=>c0({...t,...e})}),u0=Object.freeze(Object.defineProperty({__proto__:null,Client:I.Client,Provider:za,ScopedUnaryStore:I.ScopedUnaryStore,createForm:Dt,createList:Ke,createRetrieve:qe,createStore:I.createStore,createUpdate:ct,errorResult:_t,nullClientResult:Ut,pendingResult:lt,scopeStore:I.scopeStore,successResult:Ve,useListItem:i0,useStore:He},Symbol.toStringTag,{value:"Module"})),Ka="channels",d0={channel:A.Xm.SET_CHANNEL_NAME,schema:A.Xm.keyZ,onChange:async({store:e,changed:t,client:n})=>e.channels.set(t,await n.channels.retrieve(t))},x0={channel:A.Xm.DELETE_CHANNEL_NAME,schema:A.Xm.keyZ,onChange:({store:e,changed:t})=>e.channels.delete(t)},p0={channel:A.Xm.CALCULATION_STATUS_CHANNEL_NAME,schema:A.Xm.statusZ,onChange:async({store:e,changed:t,client:n})=>e.channels.set(Number(t.key),s=>s==null?s:n.channels.sugar({...s,status:t}))},m0=e=>{const t=He();j.useEffect(()=>t.channels.onSet(n=>{n.status!=null&&e(n.status)}),[t])},Ya={equal:(e,t)=>A.N.equal(e.payload,t.payload),listeners:[d0,x0,p0]},yr=A.Xm.newZ.extend({name:te.z.string().min(1,"Name must not be empty"),dataType:A.k.z.transform(e=>e.toString())}).refine(e=>!e.isIndex||A.k.z.parse(e.dataType).equals(A.k.TIMESTAMP),{message:"Index channel must have data type TIMESTAMP",path:["dataType"]}).refine(e=>e.isIndex||e.index!==0||e.virtual,{message:"Data channel must have an index",path:["index"]}).refine(e=>e.virtual||!A.k.z.parse(e.dataType).isVariable,{message:"Persisted channels must have a fixed-size data type",path:["dataType"]}),Wa=yr.extend({expression:te.z.string().min(1,"Expression must not be empty").refine(e=>e.includes("return"),{message:"Expression must contain a return statement"})}).refine(e=>e.requires?.length>0,{message:"Expression must use at least one channel",path:["requires"]}),Ga=e=>({...e.payload,dataType:e.dataType.toString()}),Sr={key:0,name:"",index:0,dataType:A.k.FLOAT32.toString(),internal:!1,isIndex:!1,leaseholder:0,virtual:!1,expression:"",requires:[]},Rr=async({client:e,params:{key:t,rangeKey:n},store:s})=>{let r=s.channels.get(t);if(r==null&&(r=await e.channels.retrieve(t),s.channels.set(r.key,r)),n!=null){const i=A.ww.aliasKey({range:n,channel:r.key});let l=s.rangeAliases.get(i);if(l==null)try{l={alias:await e.ranges.retrieveAlias(n,r.key),channel:r.key,range:n}}finally{s.rangeAliases.set(i,{channel:r.key,range:n})}l!=null&&(r.alias=l.alias)}return r},f0=async({client:e,params:{keys:t,rangeKey:n},store:s})=>{const r=s.channels.get(t),i=new Set(r?.map(a=>a.key)),l=t.filter(a=>!i.has(a));if(l.length>0){const a=await e.channels.retrieve(l);r.push(...a),s.channels.set(a)}if(n!=null){const a=t.map(p=>A.ww.aliasKey({range:n,channel:p})),c=s.rangeAliases.get(a);c.forEach(p=>{if(p==null)return;const m=r.find(h=>h.key===p.channel);m!=null&&(m.alias=p.alias)});const d=new Set(c.map(p=>p.channel)),x=t.filter(p=>!d.has(p));if(x.length>0){const p=await e.ranges.retrieveAliases(n,x);Object.entries(p).forEach(([m,h])=>{const g=Number(m),E=r.find(R=>R.key===g);E!=null&&(E.alias=h);const S=A.ww.aliasKey({range:n,channel:g});s.rangeAliases.set(S,{alias:h,channel:g,range:n})})}}return r},Ua=async({params:{key:e,rangeKey:t},store:n,client:s,reset:r})=>{if(e==null)return;const i=await Rr({client:s,store:n,params:{key:e,rangeKey:t}});r(Ga(i))},Cr=qe({name:"Channel",retrieve:Rr,mountListeners:({store:e,onChange:t,params:{key:n,rangeKey:s},client:r})=>{const i=e.channels.onSet(d=>{if(s!=null){const x=e.rangeAliases.get(A.ww.aliasKey({range:s,channel:n}));x!=null&&(d.alias=x.alias)}t(d)},n);if(s==null)return i;const l=A.ww.aliasKey({range:s,channel:n}),a=e.rangeAliases.onSet(d=>{d!=null&&t(x=>r.channels.sugar({...x,alias:d.alias}))},l),c=e.rangeAliases.onDelete(()=>t(d=>r.channels.sugar({...d,alias:void 0})),l);return[i,a,c]}}),h0=qe({name:"Channels",retrieve:f0,mountListeners:({store:e,onChange:t,params:{keys:n,rangeKey:s},client:r})=>{const i=new Set(n),l=e.channels.onSet(async d=>{if(i.has(d.key)){if(s!=null){const x=A.ww.aliasKey({range:s,channel:d.key});let p=e.rangeAliases.get(x);if(p==null)try{p={alias:await r.ranges.retrieveAlias(s,d.key),channel:d.key,range:s},e.rangeAliases.set(x,p)}catch(m){console.error(m)}p!=null&&(d.alias=p.alias)}t(x=>x.map(p=>p.key===d.key?d:p))}});if(s==null)return l;const a=e.rangeAliases.onSet(d=>{d!=null&&t(x=>x.map(p=>p.key===d.channel?r.channels.sugar({...p,alias:d.alias}):p))}),c=e.rangeAliases.onDelete(d=>{const x=A.ww.decodeDeleteAliasChange(d);t(p=>p.map(m=>m.key===x.channel?r.channels.sugar({...m,alias:void 0}):m))});return[l,a,c]}}),Xa=async({client:e,store:t,set:n,value:s})=>{const r=await e.channels.create(s());t.channels.set(r.key,r),n("key",r.key)},qa=({store:e,get:t,reset:n})=>e.channels.onSet(s=>{t("key").value===s.key&&n(Ga(s))}),g0=Dt({name:"Channel",schema:yr,initialValues:Sr,retrieve:Ua,update:Xa,mountListeners:qa}),j0=Dt({name:"Calculated Channel",schema:Wa,initialValues:Sr,retrieve:Ua,update:Xa,mountListeners:qa}),E0={internal:!1},wr=Ke({name:"Channels",retrieve:async({client:e,params:t,store:n})=>{const s=await e.channels.retrieve({...E0,...t});return n.channels.set(s),s},retrieveByKey:async({client:e,key:t,store:n})=>await Rr({client:e,params:{key:t},store:n}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.channels.onSet(s=>t(s.key,s)),e.channels.onDelete(s=>n(s))]}),y0=ct({name:"Channel",update:async({client:e,value:t,store:n})=>{const s=await e.channels.create(t);n.channels.set(s.key,s)}}),S0=ct({name:"Channel",update:async({client:e,value:t,store:n,params:{key:s}})=>{s!=null&&(await e.channels.rename(s,t),n.channels.set(s,r=>r==null?r:e.channels.sugar({...r,name:t})))}}),Qa=ct({name:"Channel Alias",update:async({client:e,value:t,store:n,params:{rangeKey:s,channelKey:r}})=>{if(s==null)return;const i={alias:t,channel:r,range:s};await e.ranges.setAlias(s,r,t),n.rangeAliases.set(A.ww.aliasKey(i),i)}}),Ja=e=>{if(e==null)return f.Channel;if(A.Xm.isCalculated(e))return f.Calculation;if(e.isIndex)return f.Index;const t=new u.n(e.dataType);return t.isInteger?f.Binary:t.isFloat?f.Decimal:t.equals(u.n.STRING)?f.String:t.equals(u.n.JSON)?f.JSON:f.Channel},ec=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e),s=Ja(n?.payload);return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,children:[o.jsxRuntimeExports.jsx(s,{}),n?.name]})}),R0=({onChange:e,value:t,emptyContent:n,initialParams:s,filter:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=wr({initialParams:s,filter:r}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(Ls,{resourceName:"Channel",value:t,onChange:e,data:l,haulType:vt,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,icon:o.jsxRuntimeExports.jsx(f.Channel,{}),...i,children:ec})},kt=({onChange:e,value:t,allowNone:n,emptyContent:s,initialParams:r,filter:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=wr({initialParams:r,filter:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(At,{resourceName:"Channel",onChange:e,value:t,allowNone:n,emptyContent:s,onFetchMore:m,onSearch:h,data:a,getItem:d,subscribe:x,status:p,haulType:vt,icon:o.jsxRuntimeExports.jsx(f.Channel,{}),...l,children:ec})},C0=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:Yg,FLUX_STORE_KEY:Ka,LinePlot:O1,STORE_CONFIG:Ya,SelectMultiple:R0,SelectSingle:kt,ZERO_FORM_VALUES:Sr,calculatedFormSchema:Wa,formSchema:yr,rename:S0,resolveIcon:Ja,retrieve:Cr,retrieveMany:h0,update:y0,updateAlias:Qa,useCalculatedForm:j0,useForm:g0,useList:wr,useListenForCalculationStatus:m0},Symbol.toStringTag,{value:"Module"})),tc=({yDirection:e="up",...t})=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...t,keys:u.g.DIRECTIONS,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"x",children:o.jsxRuntimeExports.jsx(f.Arrow.Right,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"y",children:e==="up"?o.jsxRuntimeExports.jsx(f.Arrow.Up,{}):o.jsxRuntimeExports.jsx(f.Arrow.Down,{})})]}),w0=Object.freeze(Object.defineProperty({__proto__:null,Select:tc},Symbol.toStringTag,{value:"Module"})),nc="devices",b0={channel:A.uw.SET_CHANNEL_NAME,schema:A.uw.deviceZ,onChange:({store:e,changed:t})=>e.devices.set(t.key,n=>n==null?t:{...t,status:n.status})},v0={channel:A.uw.DELETE_CHANNEL_NAME,schema:A.uw.keyZ,onChange:({store:e,changed:t})=>e.devices.delete(t)},_0={channel:A.uw.STATUS_CHANNEL_NAME,schema:A.uw.statusZ,onChange:({store:e,changed:t})=>{e.devices.set(t.details.device,n=>n==null?n:{...n,status:t})}},sc={listeners:[b0,v0,_0]},k0=e=>{const t=He();j.useEffect(()=>t.devices.onSet(e),[t])},oc=async(e,t,n)=>{const s=t.devices.get(n.key);if(s!=null)return s;const r=await e.hardware.devices.retrieve({...n,includeStatus:!0});return t.devices.set(n.key,r),r},L0=()=>qe({name:"Device",retrieve:async({client:e,params:t,store:n})=>await oc(e,n,t),mountListeners:({store:e,onChange:t,params:{key:n}})=>[e.devices.onSet(s=>t(s),n)]}),rc=Ke({name:"Devices",retrieve:async({client:e,params:t,store:n})=>{const s=await e.hardware.devices.retrieve({includeStatus:!0,...t});return s.forEach(r=>n.devices.set(r.key,r)),s},retrieveByKey:async({client:e,key:t,store:n})=>await oc(e,n,{key:t}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.devices.onSet(s=>t(s.key,s)),e.devices.onDelete(n)]}),M0=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e);return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,className:u.CSS.BE("device","list-item"),justify:"between",align:"center",children:[o.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[o.jsxRuntimeExports.jsx(ic,{status:n?.status}),n?.name]}),o.jsxRuntimeExports.jsx(or,{level:"small",color:9,weight:450,style:{marginTop:"0.25rem"},gap:"tiny",children:n?.location.split(".").map(s=>o.jsxRuntimeExports.jsx(Rn,{children:s},s))})]})}),P0=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,disabled:l,icon:a=o.jsxRuntimeExports.jsx(f.Device,{}),...c})=>{const{data:d,retrieve:x,getItem:p,subscribe:m,status:h}=rc({filter:n,initialParams:i}),{fetchMore:g,search:E}=nt.usePager({retrieve:x});return o.jsxRuntimeExports.jsx(At,{resourceName:"Device",value:t,onChange:e,data:d,getItem:p,subscribe:m,onFetchMore:g,onSearch:E,emptyContent:r,status:h,disabled:l,icon:a,...c,children:M0})},ic=({status:e,tooltipLocation:t="right"})=>{const n=e?.variant??"disabled",s=e?.message??"Device Status Unknown";return o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[o.jsxRuntimeExports.jsx(f.Summary,{variant:n,hideIcon:!0,level:"small",weight:450,children:s}),o.jsxRuntimeExports.jsx(tr,{variant:n,className:u.CSS.BE("device","status-indicator")})]})},N0=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:nc,STORE_CONFIG:sc,SelectSingle:P0,StatusIndicator:ic,retrieve:L0,useList:rc,useSetSynchronizer:k0},Symbol.toStringTag,{value:"Module"})),lc="racks",T0={channel:A.dw.SET_CHANNEL_NAME,schema:A.dw.keyZ,onChange:async({store:e,changed:t,client:n})=>{const s=await n.hardware.racks.retrieve({key:t,includeStatus:!0});e.racks.set(t,s.payload)}},I0={channel:A.dw.DELETE_CHANNEL_NAME,schema:A.dw.keyZ,onChange:({store:e,changed:t})=>e.racks.delete(t)},A0={channel:A.dw.STATUS_CHANNEL_NAME,schema:A.dw.statusZ,onChange:({store:e,changed:t})=>e.racks.set(t.details.rack,n=>n==null?n:{...n,status:t})},ac={listeners:[T0,I0,A0]},cc={includeStatus:!0},uc=async({client:e,params:t,store:n})=>{let s=n.racks.get(t.key);return s==null&&(s=await e.hardware.racks.retrieve({...cc,...t}),n.racks.set(s.key,s)),s},dc=Ke({name:"Racks",retrieve:async({client:e,params:t,store:n})=>{const s=await e.hardware.racks.retrieve({...cc,...t});return n.racks.set(s),s},retrieveByKey:async({client:e,key:t,store:n})=>await uc({client:e,params:{key:t},store:n}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.racks.onSet(s=>t(s.key,s)),e.racks.onDelete(n)]}),O0=qe({name:"Rack",retrieve:uc,mountListeners:({store:e,onChange:t,params:{key:n}})=>[e.racks.onSet(t,n)]}),D0=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);return o.jsxRuntimeExports.jsxs(f.ListItem,{...e,align:"center",justify:"between",children:[o.jsxRuntimeExports.jsx(f.Text,{children:n?.name}),o.jsxRuntimeExports.jsx(xc,{status:n?.status,tooltipLocation:"left"})]})}),B0=({value:e,onChange:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=dc({initialParams:{includeStatus:!0,...i},filter:n}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(At,{resourceName:"Driver",value:e,onChange:t,data:a,getItem:d,subscribe:x,onFetchMore:m,onSearch:h,emptyContent:r,status:p,icon:o.jsxRuntimeExports.jsx(f.Rack,{}),...l,children:D0})},xc=({status:e,tooltipLocation:t="right"})=>{const n=j.useRef(null),s=e?.variant??"disabled";return j.useEffect(()=>{if(s!=="success")return;const r=n.current;r&&(r.classList.remove(u.CSS.BEM("rack","heartbeat","beat")),requestAnimationFrame(()=>r.classList.add(u.CSS.BEM("rack","heartbeat","beat"))))},[e]),o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[o.jsxRuntimeExports.jsx(f.Summary,{variant:s,hideIcon:!0,level:"small",weight:450,children:e?.message}),o.jsxRuntimeExports.jsx(f.Heart,{ref:n,className:u.CSS.BE("rack","heartbeat"),style:{color:er[s]}})]})},$0=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:lc,STORE_CONFIG:ac,SelectSingle:B0,StatusIndicator:xc,retrieve:O0,useList:dc},Symbol.toStringTag,{value:"Module"})),pc="tasks",z0=["start","stop"],V0={channel:A.yw.SET_CHANNEL_NAME,schema:A.yw.keyZ,onChange:async({store:e,changed:t,client:n})=>e.tasks.set(t,await n.hardware.tasks.retrieve({key:t,includeStatus:!0}))},F0={channel:A.yw.DELETE_CHANNEL_NAME,schema:A.yw.keyZ,onChange:({store:e,changed:t})=>e.tasks.delete(t)},H0=A.yw.statusZ(te.z.unknown()),Z0={channel:A.yw.STATUS_CHANNEL_NAME,schema:H0,onChange:async({store:e,changed:t,client:n})=>{if(!e.tasks.has(t.details.task)){const r=await n.hardware.tasks.retrieve({key:t.details.task});e.tasks.set(t.details.task,r)}e.tasks.set(t.details.task,r=>r==null?r:n.hardware.tasks.sugar({...r,status:t}))}},K0={channel:A.yw.COMMAND_CHANNEL_NAME,schema:A.yw.commandZ,onChange:({store:e,changed:t,client:n})=>e.tasks.set(t.task,s=>s==null||!z0.includes(t.type)?s:n.hardware.tasks.sugar({...s,status:{...s.status,variant:"loading",message:`Running ${t.type} command...`,details:{task:t.task,running:!0,data:{}}}}))},Y0=e=>{const t=He();j.useEffect(()=>t.tasks.onSet(n=>{n.status!=null&&e(n.status)}),[t])},mc={listeners:[V0,F0,Z0,K0]},br=async(e,t,n,s)=>{const r=t.tasks.get(n.key);if(r!=null)return r;const i=await e.hardware.tasks.retrieve({...n,includeStatus:!0,schemas:s});return t.tasks.set(n.key,i),i},W0=e=>qe({name:"Task",retrieve:async({client:t,params:n,store:s})=>n.key==null?null:await br(t,s,{key:n.key,includeStatus:!0},e),mountListeners:({store:t,params:{key:n},onChange:s})=>[t.tasks.onSet(r=>{n==null||r.key!==n||s(r)},n)]}),G0=Ke({name:"Task",retrieve:async({client:e,params:t,store:n})=>{const s=await e.hardware.tasks.retrieve({includeStatus:!0,...t});return s.forEach(r=>n.tasks.set(r.key,r)),s},retrieveByKey:async({client:e,key:t,store:n})=>await br(e,n,{key:t}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.tasks.onSet(s=>t(s.key,s)),e.tasks.onDelete(n)]}),U0=e=>te.z.object({key:A.yw.keyZ.optional(),name:te.z.string(),rackKey:te.z.number(),type:e.typeSchema,snapshot:te.z.boolean(),config:e.configSchema,status:A.yw.statusZ(e.statusDataSchema).optional().nullable()}),Wn=e=>({key:e.key,name:e.name,rackKey:e.key==null?0:A.yw.rackKey(e.key),type:e.type,config:e.config,status:e.status,snapshot:e.snapshot??!1}),X0=({schemas:e,initialValues:t})=>{const n=U0(e),s=Wn(t);return Dt({name:"Task",schema:n,initialValues:s,retrieve:async({client:r,store:i,params:{key:l},reset:a})=>{l!=null&&a(Wn(await br(r,i,{key:l},e)))},update:async({client:r,params:i,store:l,...a})=>{const c=a.value(),x=await(await r.hardware.racks.retrieve({key:c.rackKey})).createTask({key:i.key,name:c.name,type:c.type,config:c.config});l.tasks.set(x.key,m=>m==null?m:(x.status=m.status,x));const p=Wn(x.payload);a.set("key",p.key),a.set("name",p.name),a.set("rackKey",p.rackKey),a.set("type",p.type),a.set("config",p.config),a.set("snapshot",p.snapshot)},mountListeners:({store:r,get:i,reset:l})=>[r.tasks.onSet(a=>{const c=i("key",{optional:!0})?.value;c==null||c!==a.key||l(Wn(a))})]})},q0=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:pc,STORE_CONFIG:mc,createForm:X0,createRetrieveQuery:W0,useList:G0,useStatusSynchronizer:Y0},Symbol.toStringTag,{value:"Module"})),fc="labels",Q0={channel:A.pw.SET_CHANNEL_NAME,schema:A.pw.labelZ,onChange:({store:e,changed:t})=>e.labels.set(t.key,t)},J0={channel:A.pw.DELETE_CHANNEL_NAME,schema:A.pw.keyZ,onChange:({store:e,changed:t})=>e.labels.delete(t)},hc={listeners:[Q0,J0]},Xt=(e,t)=>A.Vm.matchRelationship(e,{from:t,type:A.pw.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE}),gc=qe({name:"Labels",retrieve:async({client:e,params:{id:t}})=>await e.labels.retrieve({for:t}),mountListeners:({client:e,store:t,params:{id:n},onChange:s})=>[t.labels.onSet(r=>{s(i=>{const l=i.filter(a=>a.key!==r.key);return l.length===i.length?i:[...l,r]})}),t.labels.onDelete(r=>s(i=>i.filter(l=>l.key!==r))),t.relationships.onSet(async r=>{if(!Xt(r,n))return;const{key:i}=r.to,l=await e.labels.retrieve({key:i});t.labels.set(i,l),s(a=>[...a.filter(c=>c.key!==i),l])}),t.relationships.onDelete(r=>{const i=A.Vm.relationshipZ.parse(r);Xt(i,n)&&s(l=>l.filter(a=>a.key!==i.to.key))})]}),vr=Ke({name:"Labels",retrieve:async({client:e,params:t})=>await e.labels.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.labels.retrieve({key:t}),mountListeners:({store:e,onChange:t,onDelete:n,params:{keys:s}})=>{const r=s?new Set(s):void 0;return[e.labels.onSet(async i=>{r!=null&&!r.has(i.key)||t(i.key,i,{mode:"prepend"})}),e.labels.onDelete(async i=>n(i))]}}),jc=A.pw.labelZ.partial({key:!0}),ej=Dt({name:"Label",initialValues:{name:"",color:"#000000"},schema:jc,retrieve:async({client:e,params:{key:t},reset:n})=>{t!=null&&n(await e.labels.retrieve({key:t}))},update:async({client:e,value:t,reset:n})=>{const s=await e.labels.create(t());n(s)},mountListeners:({store:e,params:{key:t},reset:n})=>[e.labels.onSet(async s=>{t==null||s.key!==t||n(s)},t)]}),tj=ct({name:"Label",update:async({client:e,params:{key:t}})=>await e.labels.delete(t)}).useDirect,_r="label",nj=({itemKey:e,...t})=>{const n=f.useItem(e),{selected:s,onSelect:r,hovered:i}=f.useItemState(e);return n==null?null:o.jsxRuntimeExports.jsx(f.Item,{itemKey:e,onSelect:r,selected:s,hovered:i,...t,children:o.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[o.jsxRuntimeExports.jsx(f.Circle,{color:n?.color,size:"2.5em"}),n?.name]})})},Ec=f.renderProp(nj),sj=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t),{onSelect:s}=f.useItemState(t);return n==null?null:o.jsxRuntimeExports.jsx(Ms,{color:n.color,onClose:s,size:"small",children:n.name})}),oj={variant:"text"},rj=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=vr({filter:s,initialParams:r}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(Ls,{resourceName:"Label",haulType:_r,value:t,onChange:e,data:l,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,renderTag:sj,icon:o.jsxRuntimeExports.jsx(f.Label,{}),triggerProps:oj,variant:"floating",...i,children:Ec})},ij=({onChange:e,value:t,allowNone:n,emptyContent:s,filter:r,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=vr({filter:r,initialParams:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(At,{resourceName:"Label",value:t,onChange:e,data:a,getItem:d,subscribe:x,allowNone:n,onFetchMore:m,onSearch:h,emptyContent:s,status:p,haulType:_r,...l,children:Ec})},lj=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:fc,HAUL_TYPE:_r,STORE_CONFIG:hc,SelectMultiple:rj,SelectSingle:ij,formSchema:jc,matchRelationship:Xt,retrieveLabelsOf:gc,useDelete:tj,useForm:ej,useList:vr},Symbol.toStringTag,{value:"Module"})),Ts=new Error("Tab not found"),aj=new Error("Invalid Mosaic"),us=(e,t,n="center",s,r)=>{if(e=Ze(e),s===void 0)return ko(e,t);const i=Lo(e,s);if(n==="center")return i.tabs||=[],r!==void 0&&r>=0&&r<=i.tabs.length?i.tabs.splice(r,0,t):i.tabs.push(t),i.selected=t.tabKey,e;const l=i.key*2,a=i.key*2+1,c=n==="top"||n==="left"?l:a;if(Lo(e,c).key!==i.key)return us(e,t,"center",c);if(i.tabs==null||i.tabs.length===0)return us(e,t,"center",s);const[d,x,p]=mj(n);if(i.direction=p,i[d]={key:0,tabs:[t],selected:t.tabKey},i[x]={key:0,tabs:i.tabs,selected:i.selected},i.first==null||i.last==null)throw aj;return i.first.key=l,i.last.key=a,i.tabs=void 0,i.size=void 0,i.selected=void 0,e},cj=(e,t,n)=>{e=Ze(e);const[s,r]=Lt(e,t);if(s==null||r==null)throw Ts;return r.tabs=r.tabs?.map(i=>i.tabKey===t?n(i):i),e},ko=(e,t)=>(e=Ze(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=ko(e.first,t):e.last!=null&&(e.last=ko(e.last,t)),e)),ds=e=>{e=Ze(e);const t=[];if(e.tabs!=null&&(e.selected=Me.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=ds(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=ds(e.last);e.last=n,t.push(...s)}return[e,t]},kr=(e,t)=>{e=Ze(e);const[,n]=Lt(e,t);if(n==null)return[e,null];n.tabs=n.tabs?.filter(r=>r.tabKey!==t),n.selected=Me.resetSelection(n.selected,n.tabs),e=pj(e);const s=n.selected??xs(e);return[e,s]},xs=e=>e.selected!=null?e.selected:e.first!=null?xs(e.first):e.last!=null?xs(e.last):null,yc=(e,t)=>{e=Ze(e);const[n,s]=Lt(e,t);if(n==null||s==null)throw Ts;return s.selected=t,e},Sc=(e,t,n,s,r)=>{e=Ze(e);const[i,l]=Lt(e,t);if(i==null||l==null)throw Ts;const[a,c]=kr(e,t);return[us(a,i,n,s,r),c]},Cn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=Cn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=Cn(e.last,t);if(n!=null)return n}},Rc=(e,t,n)=>{const s=ps(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},uj=(e,t,n)=>{e=Ze(e);const s=Cn(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const r=s.tabs.findIndex(x=>x.tabKey===t);if(r===-1)throw new Error("Tab not found in node");const i=s.tabs[r];s.tabs=s.tabs.filter(x=>x.tabKey!==t);const l=s.key*2,c={key:s.key*2+1,tabs:[i],selected:i.tabKey},d={key:l,tabs:s.tabs,selected:s.selected};return d.selected=Me.resetSelection(d.selected,d.tabs),s.direction=n,s.first=d,s.last=c,s.tabs=void 0,s.selected=void 0,e},dj=(e,t)=>{const n=Cn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Cc=(e,t,n)=>{e=Ze(e);const[,s]=Lt(e,t);if(s?.tabs==null)throw Ts;return s.tabs=Me.rename(t,n,s?.tabs??[]),e},xj=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,Lo=(e,t)=>{const n=ps(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:Lo(e,s)},pj=e=>{let t=!0;for(;t;)[e,t]=Mo(e);return e=No(e,1),e},Mo=e=>{if(e.first==null||e.last==null)return[e,!1];if(_i(e.first))return[vi(e.last),!0];if(_i(e.last))return[vi(e.first),!0];let t,n;return[e.first,t]=Mo(e.first),[e.last,n]=Mo(e.last),[e,t||n]},vi=e=>(e.size=void 0,e),_i=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Lt=(e,t)=>{if(e.tabs!=null){const l=e.tabs.find(a=>a.tabKey===t);if(l!=null)return[l,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=Lt(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,i]=Lt(e.last,t);return[r,i]},ps=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=ps(e.first,t);return n??ps(e.last,t)},mj=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")}},Ze=e=>({...e,first:e.first!=null?Ze(e.first):void 0,last:e.last!=null?Ze(e.last):void 0}),ms=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&ms(e.first,t,n),e.last!=null&&ms(e.last,t,n),n),Po=(e,t)=>{t(e),e.first!=null&&Po(e.first,t),e.last!=null&&Po(e.last,t)},No=(e,t)=>(e=Ze(e),e.key=t,e.first!=null&&(e.first=No(e.first,t*2)),e.last!=null&&(e.last=No(e.last,t*2+1)),e);class wc{parent;stub;el;constructor(t={}){this.el=document.createElement("div"),Object.entries(t).forEach(([n,s])=>this.el.setAttribute(n,s))}mount(t,n){n!==this.stub&&(this.unmount(null),t.replaceChild(this.el,n),this.parent=t,this.stub=n)}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 fj=({node:e})=>{const t=j.createRef(),n=j.useRef(e);return j.useEffect(()=>{const s=t.current;if(s==null)return;const r=s.parentNode;if(r!=null)return e.mount(r,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),j.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const s=t.current;if(s==null)return;const r=s.parentNode;r!=null&&e.mount(r,s)},[e]),o.jsxRuntimeExports.jsx("div",{ref:t})},bc=({node:e,children:t})=>zl.createPortal(t,e.el),hj=Object.freeze(Object.defineProperty({__proto__:null,In:bc,Node:wc,Out:fj},Symbol.toStringTag,{value:"Module"})),fs=j.memo(({root:e,onDrop:t,onResize:n,onCreate:s,onFileDrop:r,children:i,activeTab:l,emptyContent:a,onSelect:c,onClose:d,onRename:x,onReorder:p,contextMenu:m,addTooltip:h,className:g,...E})=>{const{tabs:S,direction:R,first:v,last:y,key:C,size:_}=e,k={onDrop:t,onResize:n,onCreate:s,onFileDrop:r,children:i,onClose:d,contextMenu:m,onSelect:c,onRename:x,onReorder:p,activeTab:l,addTooltip:h},T=j.useCallback(([z])=>n(C,z),[n]),{props:O}=Ql({direction:R,onResize:T,count:2,initialSizes:_!=null?[_]:void 0});let B={};C==1&&(B={...E,className:u.CSS(u.CSS.B("mosaic"),g)});let F;return S!==void 0?F=o.jsxRuntimeExports.jsx(vc,{root:e,emptyContent:a,...B,...k}):v!=null&&y!=null?F=o.jsxRuntimeExports.jsxs(Jl,{id:`mosaic-${C}`,align:"stretch",...O,...B,children:[o.jsxRuntimeExports.jsx(fs,{...k,root:v,onResize:n},v.key),o.jsxRuntimeExports.jsx(fs,{...k,root:y,onResize:n},y.key)]}):(F=null,console.warn("Mosaic tree is malformed")),F});fs.displayName="Mosaic";const hs="pluto-mosaic-tab-drop",Lr="pluto-mosaic-tab-create",gj=(e,t,n)=>{if(f.filterByType(f.FILE_TYPE,t).length>0&&n)return!0;const r=f.filterByType(hs,t).map(a=>a.key),i=e.filter(a=>!r.includes(a.tabKey)).length>0;return f.filterByType(Lr,t).length>0||r.length>0&&(i||e.length===0)},vc=j.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:r,className:i,onReorder:l,onFileDrop:a,addTooltip:c,...d})=>{const{key:x,tabs:p}=e,[m,h]=j.useState(null),g=a!=null,E=j.useCallback(({items:B})=>gj(p,B,g),[p,g]),S=j.useCallback(({items:B,event:F})=>{if(F==null)return[];const z=Ej(F);h(null);const N=f.filterByType(f.FILE_TYPE,B).length>0,{percents:$}=ki(F),w=p.length===0?"center":Li($);if(N)return a?.(x,w,F),B;const L=f.filterByType(hs,B);if(L.length>0){const D=L.map(({key:H})=>H)[0];t(x,D,w,z)}const M=f.filterByType(Lr,B);if(M.length>0){const D=M.map(({key:H})=>H);n?.(x,w,D)}return L},[t,p.length]),R=j.useCallback(({event:B})=>{if(B==null)return;const{percents:F,inSelector:z}=ki(B);let N=null;z||(N=p.length===0?"center":Li(F)),h(N)},[p.length]),{startDrag:v,...y}=f.useDragAndDrop({type:"Mosaic",canDrop:E,onDrop:S,onDragOver:R}),C=E(f.useDraggingState()),_=j.useCallback(()=>h(null),[]),k=j.useCallback((B,{tabKey:F})=>{v([{key:F,type:hs,elementID:B.currentTarget.id}])},[v]),T=j.useCallback(()=>n?.(x,"center"),[x]),O=x==1&&p.length==0;return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:o.jsxRuntimeExports.jsxs(Me.Tabs,{id:`tab-${x}`,tabs:p,className:u.CSS(i,O&&m!=null&&u.CSS.M("drag-over")),onDragLeave:_,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:k,onCreate:T,addTooltip:c,...y,...d,children:[e.selected!=null&&r(p.find(B=>B.tabKey===e.selected)),C&&o.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),m!=null&&o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("mosaic","mask"),style:jj[m]})]})})});vc.displayName="MosaicTabLeaf";const jj={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%"}},ki=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{percents:{x:.5,y:.5},inSelector:!0}:{percents:{x:n/t.width,y:s/t.height},inSelector:!1}},Ej=e=>{const t=e.target.closest(".pluto-tabs-selector__btn");if(t!=null)return Array.from(t.parentElement?.children??[]).indexOf(t)},yj=e=>e,Sj=e=>1-e,Li=({x:e,y:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[yj(e),Sj(e)];if(t>n&&t>s)return"bottom";if(t<n&&t<s)return"top";if(t>n&&t<s)return"left";if(t<n&&t>s)return"right";throw new Error("[bug] - invalid insert position")},Rj=({root:e,onSelect:t,children:n})=>{const s=j.useRef(new Map),r=new Set,i=ms(e,l=>l.tabs?.map(a=>{let c=s.current.get(a.tabKey);return a==null?null:(c==null&&(c=new wc({style:"width: 100%; height: 100%; position: relative;"}),c.el.addEventListener("click",()=>t?.(a.tabKey)),s.current.set(a.tabKey,c)),r.add(a.tabKey),o.jsxRuntimeExports.jsx(bc,{node:c,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})).flat().filter(l=>l!=null);return s.current.forEach((l,a)=>!r.has(a)&&s.current.delete(a)),[s,i]},To=te.z.object({key:te.z.number(),tabs:te.z.array(Me.tabZ).optional(),selected:te.z.string().optional(),direction:u.g.direction.optional(),size:te.z.number().optional(),get first(){return To.optional()},get last(){return To.optional()}}),Cj=({allowRename:e=!1,initialTree:t})=>{const[n,s]=j.useState(t);return j.useEffect(()=>s(ds(t)[0]),[t]),{root:n,onDrop:(d,x,p)=>s(m=>Sc(m,x,p,d)[0]),onClose:d=>s(x=>kr(x,d)[0]),onSelect:d=>s(x=>yc(x,d)),onResize:(d,x)=>s(p=>Rc(p,d,x)),onRename:e?(d,x)=>s(p=>Cc(p,d,x)):void 0}},wj=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Lr,HAUL_DROP_TYPE:hs,Mosaic:fs,autoSelectTabs:ds,canSplit:dj,findSelected:xs,findTabNode:Cn,forEachNode:Po,insertTab:us,isEmpty:xj,mapNodes:ms,moveTab:Sc,nodeZ:To,removeTab:kr,renameTab:Cc,resizeNode:Rc,selectTab:yc,split:uj,updateTab:cj,use:Cj,usePortal:Rj},Symbol.toStringTag,{value:"Module"})),bj=({variant:e,className:t,...n})=>o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(t,u.CSS.B("note"),u.CSS.M(e)),align:"stretch",empty:!0,...n}),vj=Object.freeze(Object.defineProperty({__proto__:null,Note:bj},Symbol.toStringTag,{value:"Module"})),_c="relationships",kc="resources",_j={channel:A.Vm.RELATIONSHIP_SET_CHANNEL_NAME,schema:A.Vm.relationshipZ,onChange:({store:e,changed:t})=>e.relationships.set(A.Vm.relationshipToString(t),t)},kj={channel:A.Vm.RELATIONSHIP_DELETE_CHANNEL_NAME,schema:A.Vm.relationshipZ,onChange:({store:e,changed:t})=>e.relationships.delete(A.Vm.relationshipToString(t))},Lc={listeners:[_j,kj]},Lj={channel:A.Vm.RESOURCE_SET_CHANNEL_NAME,schema:A.Vm.idZ,onChange:async({store:e,changed:t,client:n})=>e.resources.set(A.Vm.idToString(t),await n.ontology.retrieve(t))},Mj={channel:A.Vm.RESOURCE_DELETE_CHANNEL_NAME,schema:A.Vm.idZ,onChange:({store:e,changed:t})=>e.resources.delete(t.key)},Mc={listeners:[Lj,Mj]},Pj=e=>{const t=He();j.useEffect(()=>t.resources.onSet(e),[t.resources])},Nj=e=>{const t=He();j.useEffect(()=>{const n=t.resources.onDelete(async s=>e(A.Vm.idZ.parse(s)));return()=>n()},[t.resources])},Tj=e=>{const t=He();j.useEffect(()=>t.relationships.onSet(e),[t.relationships])},Ij=e=>{const t=He();j.useEffect(()=>t.relationships.onDelete(n=>e(A.Vm.relationshipZ.parse(n))),[t.relationships])},Pc=e=>Ke({name:"useDependents",retrieve:async({client:t,params:{id:n}})=>n==null?[]:await t.ontology.retrieve([n],{children:e==="to",parents:e==="from"}),retrieveByKey:async({client:t,key:n})=>await t.ontology.retrieve(n),mountListeners:({store:t,onChange:n,onDelete:s,client:r,params:{id:i}})=>[t.relationships.onSet(async l=>{if(A.Vm.matchRelationship(l,{type:"parent",[A.Vm.oppositeRelationshipDirection(e)]:i})){const a=await r.ontology.retrieve(l[e]);n(a.key,a)}}),t.relationships.onDelete(l=>{const a=A.Vm.relationshipZ.parse(l);A.Vm.matchRelationship(a,{type:"parent",[A.Vm.oppositeRelationshipDirection(e)]:i})&&s(A.Vm.idToString(a[e]))}),t.resources.onSet(l=>n(l.key,a=>a==null?null:{...a,...l})),t.resources.onDelete(async l=>s(l))]}),Aj=Pc("to"),Oj=Ke({name:"useResourceList",retrieve:async({client:e,params:t,store:n})=>{const s=await e.ontology.retrieve(t);return s.forEach(r=>n.resources.set(r.key,r)),s},retrieveByKey:async({client:e,key:t,store:n})=>{const s=await e.ontology.retrieve(A.Vm.idZ.parse(t));return n.resources.set(t,s),s},mountListeners:({store:e,onChange:t,onDelete:n})=>[e.resources.onSet(async s=>t(s.key,s)),e.resources.onDelete(async s=>n(s))]}),Dj=qe({name:"useParentID",retrieve:async({client:e,params:t})=>{const n=await e.ontology.retrieveParents(t.id);if(t.type==null)return n[0].id;const s=n.find(({id:r})=>r.type===t.type);return s==null?null:s.id},mountListeners:({store:e,onChange:t,client:n,params:{id:s}})=>[e.relationships.onSet(async r=>{if(A.Vm.matchRelationship(r,{type:A.Vm.PARENT_OF_RELATIONSHIP_TYPE,to:s})){const i=await n.ontology.retrieve(r.from);t(i.id)}else t(null)}),e.relationships.onDelete(async r=>{const i=A.Vm.relationshipZ.parse(r);A.Vm.matchRelationship(i,{type:A.Vm.PARENT_OF_RELATIONSHIP_TYPE,to:s})&&t(null)})]}),Bj=Object.freeze(Object.defineProperty({__proto__:null,RELATIONSHIPS_FLUX_STORE_KEY:_c,RELATIONSHIP_STORE_CONFIG:Lc,RESOURCES_FLUX_STORE_KEY:kc,RESOURCE_STORE_CONFIG:Mc,createDependentsListHook:Pc,retrieveParentID:Dj,useChildren:Aj,useRelationshipDeleteSynchronizer:Ij,useRelationshipSetSynchronizer:Tj,useResourceDeleteSynchronizer:Nj,useResourceList:Oj,useResourceSetSynchronizer:Pj},Symbol.toStringTag,{value:"Module"})),io={Close:o.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:o.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:o.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.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"}),o.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"})]})},$j=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:i,onClose:l,...a})=>o.jsxRuntimeExports.jsxs(f.Box,{gap:1.5,x:!0,className:u.CSS(u.CSS.B("macos-controls"),!n&&u.CSS.BM("macos-controls","blurred"),t),...a,children:[o.jsxRuntimeExports.jsx(lo,{onClick:l,className:u.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:io.Close}),o.jsxRuntimeExports.jsx(lo,{onClick:s,className:u.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:io.Minimize}),o.jsxRuntimeExports.jsx(lo,{onClick:i,className:u.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:io.Maximize})]}),lo=({className:e,disabled:t,color:n,...s})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("macos-control"),u.CSS.disabled(t),e),tabIndex:-1,disabled:t,...s}),zj=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:i,contrast:l=2,...a})=>o.jsxRuntimeExports.jsxs(f.Box,{pack:!0,...a,children:[o.jsxRuntimeExports.jsx(ao,{className:u.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Subtract,{})}),o.jsxRuntimeExports.jsx(ao,{className:u.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Box$1,{})}),o.jsxRuntimeExports.jsx(ao,{onClick:s,className:u.CSS.BM("windows-control","close"),disabled:e.includes("close"),contrast:l,children:o.jsxRuntimeExports.jsx(f.Close,{})})]}),ao=({disabled:e=!1,className:t,...n})=>e?null:o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.B("windows-control"),t),tabIndex:-1,...n}),Nc=u.S.getOS,Vj="Windows",Fj=({forceOS:e,visibleIfOS:t,...n})=>{const s=Nc({force:e,default:Vj});if(t!=null&&t!==s)return null;const r=s==="macOS"?$j:zj;return o.jsxRuntimeExports.jsx(r,{...n})},Hj=Object.freeze(Object.defineProperty({__proto__:null,Controls:Fj,use:Nc},Symbol.toStringTag,{value:"Module"})),Zj=(e,t)=>{const n=s=>o.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},Kj=Object.freeze(Object.defineProperty({__proto__:null,createComponent:Zj},Symbol.toStringTag,{value:"Module"}));j.createContext({instrumentation:A.O.NOOP});const Yj=({children:e,...t})=>{const{path:n}=f.useUnidirectional({type:A.Provider$1.TYPE,schema:A.providerStateZ,state:t});return o.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})},Wj="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjUgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Tc="rangeKV",Ic="rangeAliases",wn=async(e,t,n)=>{const s=t.ranges.get(n);if(s!=null)return s;const r=await e.ranges.retrieve({keys:[n],includeParent:!0,includeLabels:!0});return t.ranges.set(n,r[0]),r[0]},Gj=async(e,t,n)=>{const s=await e.ranges.retrieve({...n,includeParent:!0,includeLabels:!0});return t.ranges.set(s),s},Uj=e=>{const t=He();j.useEffect(()=>t.ranges.onSet(n=>e(n.payload)),[t])},Ac=async(e,t,n,s)=>{if(A.Vm.matchRelationship(e,{from:{type:"range"},type:A.pw.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE,to:{type:"label"}})){let i=s.labels.get(e.to.key);i==null&&(i=await n.labels.retrieve({key:e.to.key}),s.labels.set(e.to.key,i)),t(e.from.key,l=>l==null?l:n.ranges.sugarOne({...l,labels:[...l.labels?.filter(a=>a.key!==e.to.key)??[],i]}))}},Oc=async(e,t,n,s)=>{if(A.Vm.matchRelationship(e,{from:{type:"range"},type:A.Vm.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}})){const i=await n.ranges.retrieve(e.from.key);s.ranges.set(e.from.key,i),t(e.to.key,l=>l==null?l:n.ranges.sugarOne({...l,parent:i}))}},Xj=Ke({name:"Range",retrieve:async({client:e,params:{key:t},store:n})=>{const s=await e.ontology.retrieveChildren(A.ww.ontologyID(t),{types:["range"]});return s.length===0?[]:await Gj(e,n,{keys:s.map(({id:{key:r}})=>r)})},retrieveByKey:async({client:e,key:t,store:n})=>await wn(e,n,t),mountListeners:({store:e,onChange:t,onDelete:n,client:s,params:{key:r}})=>[e.ranges.onSet(i=>{t(i.key,l=>l==null?l:s.ranges.sugarOne({...i,parent:i.parent??l.parent,labels:i.labels??l.labels}))}),e.ranges.onDelete(async i=>n(i)),e.relationships.onSet(async i=>{if(await Oc(i,t,s,e),await Ac(i,t,s,e),A.Vm.matchRelationship(i,{from:A.ww.ontologyID(r),type:A.Vm.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}})){const a=await s.ranges.retrieve({keys:[i.to.key],includeParent:!0,includeLabels:!0});return t(i.to.key,a[0])}}),e.relationships.onDelete(async i=>{const l=A.Vm.relationshipZ.parse(i);if(A.Vm.matchRelationship(l,{from:A.ww.ontologyID(r),type:A.Vm.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}}))return n(l.to.key);l.type===A.pw.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE&&t(l.from.key,d=>d==null?d:s.ranges.sugarOne({...d,labels:d.labels?.filter(x=>x.key!==l.to.key)}))})]}),qj=qe({name:"Range",retrieve:async({client:e,params:{id:t}})=>{const s=(await e.ontology.retrieveParents(t)).find(({id:{type:r}})=>r==="range");return s==null?null:e.ranges.sugarOntologyResource(s)},mountListeners:({store:e,onChange:t,client:n,params:{id:s}})=>[e.ranges.onSet(r=>{t(i=>i==null||i.key!==r.key?i:n.ranges.sugarOne({...r,parent:r.parent??i.parent,labels:r.labels??i.labels}))}),e.relationships.onSet(async r=>{if(!A.Vm.matchRelationship(r,{type:A.Vm.PARENT_OF_RELATIONSHIP_TYPE,to:s}))return;if(!(r.from.type==="range"))return t(null);const a=await wn(n,e,r.from.key);t(n.ranges.sugarOne(a.payload))}),e.relationships.onDelete(async r=>{const i=A.Vm.relationshipZ.parse(r);A.Vm.matchRelationship(i,{type:A.Vm.PARENT_OF_RELATIONSHIP_TYPE,to:s})&&t(null),A.Vm.matchRelationship(i,{type:A.pw.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE,to:s})&&t(c=>c==null?c:n.ranges.sugarOne({...c,labels:c.labels?.filter(d=>d.key!==i.to.key)}))})]}),Dc=qe({name:"Range",retrieve:async({client:e,params:{key:t},store:n})=>await wn(e,n,t),mountListeners:({store:e,onChange:t,client:n,params:{key:s}})=>[e.ranges.onSet(async r=>{if(r!=null)return t(r)},s),e.relationships.onSet(async r=>{if(Xt(r,A.ww.ontologyID(s))){const a=await n.labels.retrieve({key:r.to.key});e.labels.set(r.to.key,a),t(c=>c==null?c:n.ranges.sugarOne({...c,labels:[...(c.labels??[]).filter(d=>d.key!==a.key),a]}))}if(A.Vm.matchRelationship(r,{type:A.Vm.PARENT_OF_RELATIONSHIP_TYPE,to:A.ww.ontologyID(s)})){const a=await n.ranges.retrieve(r.from.key);e.ranges.set(r.from.key,a),t(c=>c==null?c:n.ranges.sugarOne({...c,parent:a}))}},s)]}),Qj=Dc.useDirect,Bc=te.z.object({...A.ww.payloadZ.omit({timeRange:!0}).partial({key:!0}).shape,labels:te.z.array(A.pw.keyZ),parent:te.z.string().optional(),timeRange:te.z.object({start:te.z.number(),end:te.z.number()})}),Io=async e=>({...e.payload,timeRange:e.timeRange.numeric,parent:e.parent?.key,labels:e.labels?.map(t=>t.key)??[]}),Jj={name:"",labels:[],parent:"",timeRange:{start:0,end:0}},e2=Dt({name:"Range",schema:Bc,initialValues:Jj,retrieve:async({client:e,params:{key:t},store:n,reset:s})=>{t!=null&&s(await Io(await wn(e,n,t)))},update:async({client:e,value:t,reset:n,store:s})=>{const r=t(),i=r.parent,l=u.O.isNonZero(i)?A.ww.ontologyID(i):void 0,a=await e.ranges.create(r,{parent:l});await e.labels.label(a.ontologyID,r.labels,{replace:!0});const c=s.labels.get(r.labels),d=new Set(c.map(m=>m.key)),x=r.labels.filter(m=>!d.has(m));if(x.length>0){const m=await e.labels.retrieve({keys:x});c.push(...m),s.labels.set(m)}let p=null;u.O.isNonZero(i)&&(p=await wn(e,s,i)),s.ranges.set(a.key,e.ranges.sugarOne({...a.payload,labels:c,parent:p?.payload??null})),n({...r,...a.payload,timeRange:a.timeRange.numeric,labels:r.labels,parent:r.parent})},mountListeners:({store:e,reset:t,get:n,set:s})=>[e.ranges.onSet(async r=>{const i=await Io(r),l=n("key",{optional:!0})?.value;if(l==null||l!==r.key)return;const a=n("parent",{optional:!0})?.value,c=n("labels").value;t({...i,labels:c,parent:a})}),e.relationships.onSet(r=>{const i=n("key",{optional:!0})?.value;if(i==null)return;const l=A.ww.ontologyID(i);if(Xt(r,l)){const d=n("labels").value;return s("labels",[...d.filter(x=>x!==r.to.key),r.to.key])}A.Vm.matchRelationship(r,{type:A.Vm.PARENT_OF_RELATIONSHIP_TYPE,to:l})&&s("parent",r.from.key)}),e.relationships.onDelete(r=>{const i=n("key",{optional:!0})?.value;if(i==null)return;const l=A.Vm.relationshipZ.parse(r),a=A.ww.ontologyID(i);if(Xt(l,a))return s("labels",n("labels").value.filter(x=>x!==l.to.key));if(A.Vm.matchRelationship(l,{type:A.Vm.PARENT_OF_RELATIONSHIP_TYPE,to:a}))return s("parent",void 0)})]}),t2=e=>gc.useDirect({params:{id:A.ww.ontologyID(e)}}),n2={includeParent:!0,includeLabels:!0},Mr=Ke({name:"Ranges",retrieve:async({client:e,params:t})=>await e.ranges.retrieve({...n2,...t}),retrieveByKey:async({client:e,key:t,store:n})=>{const s=n.ranges.get(t);if(s!=null)return s;const r=await e.ranges.retrieve(t);return n.ranges.set(t,r),r},mountListeners:({store:e,onChange:t,onDelete:n,client:s,params:{keys:r}})=>{const i=r!=null&&r.length>0,l=new Set(r);return[e.ranges.onSet(a=>{i&&!l.has(a.key)||t(a.key,c=>c==null?a:s.ranges.sugarOne({...a.payload,labels:a.labels??c.labels}))}),e.ranges.onDelete(async a=>n(a)),e.relationships.onSet(async a=>{await Oc(a,t,s,e),await Ac(a,t,s,e)})]}}),s2=te.z.object({pairs:te.z.array(te.z.object({key:te.z.string(),value:te.z.string()}))}),$c=te.z.string().transform(e=>e.split("<--->")).transform(([e,t])=>({key:t,range:e})),o2={channel:A.ww.KV_SET_CHANNEL,schema:A.ww.kvPairZ,onChange:({store:e,changed:t})=>{e.rangeKV.set(A.ww.kvPairKey(t),t)}},r2={channel:A.ww.KV_DELETE_CHANNEL,schema:$c,onChange:({store:e,changed:t})=>e.rangeKV.delete(A.ww.kvPairKey(t))},zc={listeners:[o2,r2]},i2=Ke({name:"Range Meta Data",retrieve:async({client:e,params:{rangeKey:t}})=>{const s=await e.ranges.getKV(t).list();return Object.entries(s).map(([r,i])=>({key:r,value:i,range:t}))},retrieveByKey:async({client:e,key:t,params:{rangeKey:n}})=>{if(n==null)return;const r=await e.ranges.getKV(n).get(t);return{key:t,value:r,range:n}},mountListeners:({store:e,onChange:t,onDelete:n,params:{rangeKey:s}})=>[e.rangeKV.onSet(r=>{r.range===s&&t(r.key,r)}),e.rangeKV.onDelete(r=>{const i=$c.parse(r);i.range===s&&n(i.key)})]}),Vc=A.ww.kvPairZ,l2=Dt({name:"Range Meta Data",schema:Vc,retrieve:async()=>{},update:async({client:e,value:t})=>{const{key:n,value:s,range:r}=t();await e.ranges.getKV(r).set(n,s)},initialValues:{key:"",value:"",range:""}}),a2=ct({name:"Range Meta Data",update:async({client:e,value:t,params:{rangeKey:n}})=>{await e.ranges.getKV(n).delete(t)}}),c2=ct({name:"Range Meta Data",update:async({client:e,value:t,onChange:n})=>{await e.ranges.getKV(t.range).set(t.key,t.value),n(t)}}),u2=ct({name:"Range",update:async({client:e,value:t,onChange:n,store:s})=>{const r=await e.ranges.create(t);s.ranges.set(r.key,r),n(r)}}),d2=ct({name:"Range",update:async({client:e,value:t,store:n})=>{await e.ranges.delete(t),n.ranges.delete(t)}}),x2={channel:A.ww.SET_ALIAS_CHANNEL_NAME,schema:A.ww.aliasZ,onChange:({store:e,changed:t})=>{e.rangeAliases.set(A.ww.aliasKey(t),t)}},p2=te.z.string().transform(e=>A.ww.decodeDeleteAliasChange(e)),m2={channel:A.ww.DELETE_ALIAS_CHANNEL_NAME,schema:p2,onChange:({store:e,changed:t})=>e.rangeAliases.delete(A.ww.aliasKey(t))},Fc={listeners:[x2,m2]},Hc=({timeRange:e,level:t="p",color:n=9,showSpan:s=!1,...r})=>{const i=new u.r(e.start),l=i.isToday?"time":"dateTime",a=new u.r(e.end),c=a.equals(u.r.MAX),d=a.span(i)<u.i.DAY?"time":"dateTime",x=i.span(a),p=o.jsxRuntimeExports.jsxs(f.Text,{x:!0,align:"center",gap:"small",children:[i.isToday&&o.jsxRuntimeExports.jsx(f.Text,{level:t,color:n,weight:450,children:"Today"}),o.jsxRuntimeExports.jsx(f.DateTime,{el:"span",level:t,displayTZ:"local",format:l,color:n,weight:450,children:i})]}),m=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[c?o.jsxRuntimeExports.jsx(f.Text,{level:t,el:"span",children:"Now"}):o.jsxRuntimeExports.jsx(f.DateTime,{level:t,el:"span",displayTZ:"local",format:d,color:n,weight:450,children:a}),!x.isZero&&s&&o.jsxRuntimeExports.jsxs(f.Text,{level:t,color:n,weight:450,el:"span",children:["(",i.span(a).truncate(u.i.MILLISECOND).toString(),")"]})]});return o.jsxRuntimeExports.jsxs(f.Text,{x:!0,gap:"small",className:u.CSS(u.CSS.B("time-range-chip")),align:"center",level:t,color:n,...r,children:[p,o.jsxRuntimeExports.jsx(f.Arrow.Right,{color:9}),m]})},Pr="range",Nr=j.memo(({itemKey:e,showParent:t=!0,showLabels:n=!0,...s})=>{const r=f.useItem(e);if(r==null)return null;const{name:i,parent:l,timeRange:a,labels:c}=r;return o.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,justify:"between",...s,children:[o.jsxRuntimeExports.jsxs(or,{children:[o.jsxRuntimeExports.jsx(Rn,{weight:450,color:10,children:i}),l!=null&&t&&o.jsxRuntimeExports.jsx(Rn,{weight:400,color:8,children:l.name})]}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Hc,{level:"small",timeRange:a}),n&&o.jsxRuntimeExports.jsx(nr,{variant:"text",children:c?.map(d=>o.jsxRuntimeExports.jsx(Ms,{color:d.color,size:"small",children:d.name},d.key))})]})]})});Nr.displayName="Ranger.ListItem";const Zc=f.renderProp(Nr),Kc=o.jsxRuntimeExports.jsx(f.Range,{}),f2=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:r,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=Mr({filter:s,initialParams:r}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return o.jsxRuntimeExports.jsx(Ls,{resourceName:"Range",haulType:Pr,value:t,onChange:e,data:l,getItem:c,icon:Kc,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,...i,children:Zc})},h2={style:{width:800}},g2=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:r,initialParams:i,...l})=>{const{data:a,retrieve:c,subscribe:d,getItem:x,status:p}=Mr({filter:n,initialParams:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return o.jsxRuntimeExports.jsx(At,{resourceName:"Range",variant:"modal",value:t,onChange:e,data:a,allowNone:s,haulType:Pr,onFetchMore:m,getItem:x,subscribe:d,status:p,onSearch:h,emptyContent:r,icon:Kc,itemHeight:45,dialogProps:h2,...l,children:Zc})},j2=Object.freeze(Object.defineProperty({__proto__:null,ALIAS_STORE_CONFIG:Fc,HAUL_TYPE:Pr,KV_STORE_CONFIG:zc,ListItem:Nr,RANGE_ALIASES_FLUX_STORE_KEY:Ic,RANGE_KV_FLUX_STORE_KEY:Tc,SelectMultiple:f2,SelectSingle:g2,TimeRangeChip:Hc,formSchema:Bc,kvPairFormSchema:Vc,metaDataFormSchema:s2,retrieve:Dc,retrieveParent:qj,toFormValues:Io,useChildren:Xj,useDelete:d2,useDeleteKV:a2,useForm:e2,useKVPairForm:l2,useLabels:t2,useList:Mr,useListKV:i2,useRetrieve:Qj,useSetSynchronizer:Uj,useUpdate:u2,useUpdateKV:c2},Symbol.toStringTag,{value:"Module"})),Yc=({children:e})=>{const{path:t}=f.useUnidirectional({type:I.BaseProvider.TYPE,schema:I.providerStateZ$2,state:{}});return o.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},E2=new Set([u.n.UUID,u.n.JSON]),y2=e=>{if(e.equals(u.n.JSON))return o.jsxRuntimeExports.jsx(f.JSON,{});if(e.isInteger)return o.jsxRuntimeExports.jsx(f.Binary,{});if(e.isFloat)return o.jsxRuntimeExports.jsx(f.Decimal,{});if(e.equals(u.n.STRING)||e.equals(u.n.UUID))return o.jsxRuntimeExports.jsx(f.String,{});if(e.equals(u.n.TIMESTAMP))return o.jsxRuntimeExports.jsx(f.Time$1,{})},Wc=u.n.ALL.filter(e=>e!==u.n.UNKNOWN).map(e=>({key:e.toString(),name:E2.has(e)?e.toString().toUpperCase():u.z.capitalize(e.toString()),icon:y2(e)})),S2=Wc.filter(e=>!new u.n(e.key).isVariable),R2=({hideVariableDensity:e=!1,...t})=>{const n=e?S2:Wc;return o.jsxRuntimeExports.jsx(Nn,{...t,data:n,resourceName:"Data Type"})},C2=Object.freeze(Object.defineProperty({__proto__:null,Provider:Yc,SelectDataType:R2},Symbol.toStringTag,{value:"Module"})),w2=e=>{switch(e.variant){case"disabled":return e.details?.valid===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l12)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l7)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return e.details?.authority===A.iw.ABSOLUTE_AUTHORITY?{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 schematic to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Gc=({source:e,sink:t,className:n,...s})=>{const r=f.useMemoDeepEqual({source:e,sink:t}),[,{status:i},l]=f.use$2({type:I.Chip.TYPE,schema:I.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:u.r.now(),details:{}}}});j.useEffect(()=>{l(m=>({...m,...r}))},[r,l]);const a=j.useCallback(()=>l(m=>({...m,triggered:!m.triggered})),[l]),{message:c,chipColor:d,buttonStyle:x,disabled:p}=w2(i);return o.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(u.CSS.B("control-chip"),n),disabled:p,onClick:a,tooltip:o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:c}),style:x,...s,children:o.jsxRuntimeExports.jsx(f.Circle,{color:d})})},Uc=j.createContext({needsControlOf:[]}),Xc=()=>j.use(Uc),b2=({children:e,onStatusChange:t,...n})=>{const s=f.useMemoDeepEqual(n),[{path:r},{status:i,needsControlOf:l},a]=f.use$2({type:I.Controller.TYPE,schema:I.controllerStateZ,initialState:s});return j.useEffect(()=>{i!=null&&t?.(i)},[i,t]),j.useEffect(()=>{a(c=>({...c,...s}))},[s,a]),j.useEffect(()=>()=>t?.("released"),[]),o.jsxRuntimeExports.jsxs(Uc,{value:{needsControlOf:l},children:[o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:e}),";"]})},qc=({colorSource:e,statusSource:t})=>{const n=f.useMemoDeepEqual({colorSource:e,statusSource:t}),[,{color:s,status:r},i]=f.use$2({type:I.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:u.r.now(),details:{color:void 0}}},schema:I.indicatorStateZ});j.useEffect(()=>{i(a=>({...a,...n}))},[n,i]);let l;return r.details?.color!=null?l=u.cr.colorZ.parse(r.details.color):s!=null&&!u.cr.isZero(s)?l=s:l="var(--pluto-gray-l10)",o.jsxRuntimeExports.jsxs(f.Dialog$1,{location:{x:"center",y:"bottom"},children:[o.jsxRuntimeExports.jsx(f.Text,{children:r.message}),o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("indicator"),style:{backgroundColor:u.cr.cssString(l),flexGrow:1}})]})},v2=e=>{const{needsControlOf:t}=Xc(),[,{states:n},s]=f.use$2({type:I.Legend.TYPE,schema:I.legendStateZ,initialState:{states:[],needsControlOf:t}});j.useEffect(()=>{s(l=>({...l,needsControlOf:t}))},[t]);const i=u.c.unique(n.map(l=>l.subject.key)).map(l=>{const a=n.find(c=>c.subject.key===l);if(a==null)throw new A.ht("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return o.jsxRuntimeExports.jsx(lr,{data:i,...e})},Qc=({children:e})=>{const[{path:t}]=f.use$2({type:I.StateProvider.TYPE,schema:I.stateProviderStateZ,initialState:{}});return o.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},_2=Object.freeze(Object.defineProperty({__proto__:null,Chip:Gc,Controller:b2,Indicator:qc,Legend:v2,StateProvider:Qc,useContext:Xc},Symbol.toStringTag,{value:"Module"})),Jc=e=>{const t=({disabled:n=!1,...s})=>n?s.children:o.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},eu="workspaces",k2={channel:A.Iw.SET_CHANNEL_NAME,schema:A.Iw.workspaceZ,onChange:({store:e,changed:t})=>e.workspaces.set(t.key,t)},L2={channel:A.Iw.DELETE_CHANNEL_NAME,schema:A.Iw.keyZ,onChange:({store:e,changed:t})=>e.workspaces.delete(t)},tu={listeners:[k2,L2]},M2=qe({name:"Workspace",retrieve:({params:e,client:t})=>t.workspaces.retrieve(e.key),mountListeners:({store:e,params:t,onChange:n})=>[e.workspaces.onSet(n,t.key)]}),P2=Ke({name:"Workspace",retrieve:async({client:e,params:t})=>await e.workspaces.retrieve(t),retrieveByKey:async({client:e,key:t})=>await e.workspaces.retrieve(t),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.workspaces.onSet(s=>t(s.key,s)),e.workspaces.onDelete(n)]}),N2=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:eu,STORE_CONFIG:tu,retrieve:M2,useList:P2},Symbol.toStringTag,{value:"Module"})),T2=Jc(Yc),I2=Jc(f.Provider$4),nu={[I.FLUX_STORE_KEY]:I.STORE_CONFIG,[fc]:hc,[lc]:ac,[nc]:sc,[pc]:mc,[eu]:tu,[_c]:Lc,[kc]:Mc,[Tc]:zc,[Ka]:Ya,[Ic]:Fc},A2=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:r,tooltip:i,triggers:l,alamos:a,haul:c,telem:d,color:x})=>o.jsxRuntimeExports.jsx(f.Provider$1,{...l,children:o.jsxRuntimeExports.jsx(f.Config,{...i,children:o.jsxRuntimeExports.jsx(f.Provider$2,{...c,children:o.jsxRuntimeExports.jsx(f.Provider$3,{url:s??Wj,enabled:n,children:o.jsxRuntimeExports.jsx(I2,{workerKey:"vis",children:o.jsxRuntimeExports.jsx(Yj,{...a,children:o.jsxRuntimeExports.jsx(f.Aggregator,{children:o.jsxRuntimeExports.jsx(Ba,{connParams:t,children:o.jsxRuntimeExports.jsx(za,{storeConfig:nu,children:o.jsxRuntimeExports.jsx(Ne.Provider,{...x,children:o.jsxRuntimeExports.jsx(f.Provider,{...r,children:o.jsxRuntimeExports.jsx(T2,{...d,children:o.jsxRuntimeExports.jsx(Qc,{children:e})})})})})})})})})})})})}),O2=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:nu,Provider:A2},Symbol.toStringTag,{value:"Module"})),D2=({value:e})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress"),children:o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress-bar"),style:{width:`${e}%`}})}),B2=Object.freeze(Object.defineProperty({__proto__:null,Progress:D2},Symbol.toStringTag,{value:"Module"})),$2=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(i=>i.key===t);return o.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",className:u.CSS.B("steps"),...s,children:e.map((i,l)=>o.jsxRuntimeExports.jsxs(j.Fragment,{children:[o.jsxRuntimeExports.jsxs(f.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>r,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&o.jsxRuntimeExports.jsx(f.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l10)"}})]},i.key))})},z2=Object.freeze(Object.defineProperty({__proto__:null,Steps:$2},Symbol.toStringTag,{value:"Module"})),V2=({children:e,className:t,visible:n,...s})=>{const[{path:r},,i]=f.use$2({type:I.Table.TYPE,schema:I.Table.stateZ,initialState:{region:u.Ho.ZERO,visible:n}});j.useEffect(()=>{i(a=>({...a,visible:n}))},[n]);const l=Tn(a=>i(c=>({...c,region:a})));return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{ref:l,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),o.jsxRuntimeExports.jsx("table",{className:u.CSS(u.CSS.B("table"),t),...s,children:o.jsxRuntimeExports.jsx("tbody",{children:o.jsxRuntimeExports.jsx(f.Composite,{path:r,children:e})})})]})},F2=({children:e,className:t,size:n,index:s,onResize:r,onSelect:i,position:l,...a})=>o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),t),...a,children:[r!=null&&o.jsxRuntimeExports.jsx(ou,{onSelect:i,index:s,value:n,onChange:r,position:l,direction:"y"}),e]}),Tr=({ref:e,children:t,className:n,selected:s=!1,...r})=>o.jsxRuntimeExports.jsx("td",{ref:e,...r,className:u.CSS(u.CSS.BE("table","cell"),u.CSS.selected(s),n),children:t}),su="ABCDEFGHIJKLMNOPQRSTUVWXYZ",H2=e=>su[e],ou=({value:e,selected:t=!1,index:n,onChange:s,position:r,direction:i="x",onSelect:l})=>{const a=f.useSyncedRef(e),c=j.useRef(e),d=Ne.useCursorDrag({onStart:j.useCallback(()=>{c.current=a.current},[]),onMove:j.useCallback(x=>s(c.current+u.Ho.dim(x,i,!0),n),[s,n])});return o.jsxRuntimeExports.jsxs("td",{id:`resizer-${i}-${n}`,className:u.CSS(u.CSS.BE("table","resizer"),u.CSS.dir(i),u.CSS.selected(t),f.CONTEXT_TARGET,t&&f.CONTEXT_SELECTED),style:{[u.g.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[o.jsxRuntimeExports.jsx(f.Text,{full:"x",justify:"center",align:"center",square:!1,children:i==="x"?su[n]:n+1}),o.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[u.g.location(i)]:r+e},onDragStart:d,draggable:!0})]})},Z2=({selected:e,onSelect:t,columns:n,onResize:s})=>{let r=15;return o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),u.CSS.BE("table","col-resizer")),children:[o.jsxRuntimeExports.jsx("td",{}),n.map((i,l)=>{const a=r;return r+=i,o.jsxRuntimeExports.jsx(ou,{onSelect:t,position:a,selected:e.includes(l),index:l,value:i,onChange:c=>s(c,l),direction:"x"},l)})]})},K2=Object.freeze(Object.defineProperty({__proto__:null,Cell:Tr,ColumnIndicators:Z2,Row:F2,Table:V2,getCellColumn:H2},Symbol.toStringTag,{value:"Module"})),ru=te.z.object({bounds:u.H.bounds,gradient:u.cr.gradientZ}),Ir={bounds:{lower:0,upper:1},gradient:[]},Mi={size:"small",showDragHandle:!1},Pi={width:60},Y2=u.C.Scale.scale(0,1),Ar=({path:e})=>{const{set:t,get:n}=rn(),s=hr(`${e}.bounds`),r=Y2.scale(s);return o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx($e,{inputProps:Mi,style:Pi,label:"Lower",path:`${e}.bounds.lower`}),o.jsxRuntimeExports.jsx(Ee,{path:`${e}.gradient`,label:"Gradient",align:"start",padHelpText:!1,children:({value:i,onChange:l})=>o.jsxRuntimeExports.jsx(Ne.GradientPicker,{value:A.N.copy(i),scale:r,onChange:a=>{const d={...n(`${e}.bounds`).value},x=a.map(S=>S.position),p=r.pos(Math.max(...x)),m=r.pos(Math.min(...x)),h=p>d.upper,g=m<d.lower;h&&(a[a.length-1].position=1,d.upper=p),g&&(a[0].position=0,d.lower=m);const E=a.map(S=>({...S,color:u.cr.hex(S.color)}));h||g?t(e,{bounds:d,gradient:E}):l(a.map(S=>({...S,color:u.cr.hex(S.color)})))}})}),o.jsxRuntimeExports.jsx($e,{inputProps:Mi,style:Pi,label:"Upper",path:`${e}.bounds.upper`})]})},W2=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:u.br.NOTATIONS,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"standard",children:"Standard"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"scientific",children:"Scientific"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"engineering",children:"Engineering"})]}),G2=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Or=({path:e})=>{const{value:t,onChange:n}=Et(e),s=I.sourcePipelinePropsZ.parse(t.telem?.props),r=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=I.stringifyNumberProps.parse(s.segments.stringifier.props),l=I.rollingAverageProps.parse(s.segments.rollingAverage.props),a=h=>{const g=I.sourcePipeline("string",{connections:G2,segments:{valueStream:I.streamChannelValue({channel:r.channel}),stringifier:I.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:I.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:g})},c=h=>a({valueStream:I.streamChannelValue({channel:h??0})}),d=h=>a({stringifier:I.stringifyNumber({...i,notation:h})}),x=h=>a({stringifier:I.stringifyNumber({...i,precision:h})}),p=h=>a({rollingAverage:I.rollingAverage({windowSize:h})});if(typeof r.channel!="number")throw new Error("Must pass in a channel by key to Value.TelemForm");const{data:m}=Cr.useDirect({params:{key:r.channel}});return j.useEffect(()=>{m!=null&&n({...t,tooltip:[m.name]})},[m?.name,n]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ie.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(kt,{value:r.channel,onChange:c})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Ie.Item,{label:"Notation",children:o.jsxRuntimeExports.jsx(W2,{value:i.notation,onChange:d})}),o.jsxRuntimeExports.jsx(Ie.Item,{label:"Precision",align:"start",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),o.jsxRuntimeExports.jsx(Ie.Item,{label:"Averaging Window",align:"start",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})]})},U2=I.Value.z.partial({color:!0}).extend({level:A.levelZ.optional()}),Dr=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:i,level:l="small",backgroundTelem:a,notation:c,location:d,useWidthForBackground:x,valueBackgroundOverScan:p,valueBackgroundShift:m})=>{const h=f.useMemoDeepEqual({box:t,telem:n,color:s,precision:r,level:l,minWidth:i,notation:c,backgroundTelem:a,location:d,useWidthForBackground:x,valueBackgroundOverScan:p,valueBackgroundShift:m}),[,g,E]=f.use$2({aetherKey:e,type:I.Value.TYPE,schema:I.Value.z,initialState:h});return j.useEffect(()=>E(S=>({...S,...h})),[h]),{width:g.width??g.minWidth}},X2=Object.freeze(Object.defineProperty({__proto__:null,RedlineForm:Ar,TelemForm:Or,ZERO_READLINE:Ir,corePropsZ:U2,redlineZ:ru,use:Dr},Symbol.toStringTag,{value:"Module"})),q2="text",iu=te.z.object({value:te.z.string(),level:A.levelZ,weight:A.weightZ,align:u.K$1.x.or(u.K$1.center),backgroundColor:u.cr.crudeZ}),lu=({cellKey:e,onChange:t,value:n,selected:s,onSelect:r,align:i,level:l,weight:a,backgroundColor:c})=>{const d=p=>r(e,p),x=p=>t({level:l,value:p,weight:a,align:i,backgroundColor:c});return o.jsxRuntimeExports.jsx(Tr,{id:e,className:u.CSS(f.CONTEXT_TARGET,s&&f.CONTEXT_SELECTED,u.CSS.BEM("table","cell","text")),selected:s,onClick:d,onContextMenu:d,style:{backgroundColor:u.cr.cssString(c)},children:o.jsxRuntimeExports.jsx(f.Editable,{level:l,value:n,weight:a,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},Q2="value",au=te.z.object({telem:I.stringSourceSpecZ,redline:ru,level:A.levelZ,color:te.z.string(),units:te.z.string()}),cu=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:r,bounds:i},selected:l,box:a,onSelect:c})=>{const{width:d}=Dr({aetherKey:e,box:a,telem:t,level:n,color:s,backgroundTelem:I.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:I.scaleNumber({scale:u.C.Scale.scale(i).scale(0,1).transform}),gradient:I.colorGradient({gradient:r})},outlet:"gradient"}),location:{x:"center",y:"center"}}),x=p=>c(e,p);return o.jsxRuntimeExports.jsx(Tr,{id:e,selected:l,onClick:x,onContextMenu:x,style:{height:"5rem",width:d},className:u.CSS(f.CONTEXT_TARGET,l&&f.CONTEXT_SELECTED,u.CSS.BEM("table","cell","value"))})},J2={padding:"2rem"},co=e=>o.jsxRuntimeExports.jsx(f.Box,{...e,style:J2,y:!0}),e3=[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],uu=({onVariantChange:e})=>{const t=j.useCallback(({tabKey:s})=>{switch(s){case"telem":return o.jsxRuntimeExports.jsx(co,{children:o.jsxRuntimeExports.jsx(Or,{path:""})});case"redline":return o.jsxRuntimeExports.jsx(co,{children:o.jsxRuntimeExports.jsx(Ar,{path:"redline"})});default:return o.jsxRuntimeExports.jsx(co,{children:o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Ie.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Br,{onChange:e,value:"value"})}),o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:r,onChange:i,variant:l,...a})=>o.jsxRuntimeExports.jsx(Ne.Swatch,{value:r??u.cr.setAlpha(u.cr.ZERO,1),onChange:i,...a,bordered:!0})}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:r,onChange:i,variant:l,...a})=>o.jsxRuntimeExports.jsx(on,{value:r,onChange:i,...a})})]})})}},[]),n=Me.useStatic({tabs:e3,content:t});return o.jsxRuntimeExports.jsx(Me.Tabs,{...n,size:"small"})},t3={padding:"2rem"},du=({onVariantChange:e})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,style:t3,children:[o.jsxRuntimeExports.jsx(Ie.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(Br,{onChange:e,value:"text"})}),o.jsxRuntimeExports.jsx(gr,{path:"value",label:"Text"}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(on,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(Ee,{path:"weight",label:"Weight",padHelpText:!1,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(la,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(Ee,{path:"align",label:"Alignment",hideIfNull:!0,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:t,onChange:n,...r})}),o.jsxRuntimeExports.jsx(Ee,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(Ne.Swatch,{value:t,onChange:n})})]}),n3=[{key:"text",name:"Text",icon:o.jsxRuntimeExports.jsx(f.Text$3,{})},{key:"value",name:"Value",icon:o.jsxRuntimeExports.jsx(f.Channel,{})}],Br=e=>o.jsxRuntimeExports.jsx(Nn,{...e,data:n3,resourceName:"Variant"}),s3=["text","value"],o3=te.z.enum(s3),r3={key:"value",name:"Value",Form:uu,Cell:cu,defaultProps:e=>({telem:I.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:I.streamChannelValue({channel:0}),rollingAverage:I.rollingAverage({windowSize:1}),stringifier:I.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"}),redline:Ir,color:u.cr.hex(e.colors.gray.l10),level:"h5",units:""}),schema:au},i3={key:"text",name:"Text",Form:du,Cell:lu,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:iu},l3={text:i3,value:r3},a3=Object.freeze(Object.defineProperty({__proto__:null,CELLS:l3,SelectVariant:Br,TEXT_TYPE:q2,Text:lu,TextForm:du,VALUE_TYPE:Q2,Value:cu,ValueForm:uu,textPropsZ:iu,valuePropsZ:au,variantZ:o3},Symbol.toStringTag,{value:"Module"})),Ni=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=Rt(e,...n);return u.K.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Ti=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:i})=>{if(!c3({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=u.g.construct(t),a=u.g.swap(l);let c=wt(a,s[a]-e[a]);const d=u.Ho.loc(n,c);if(u.K$1.swap(t)===r){const x=u.Ho.loc(i,u.K$1.swap(c));Math.abs(d-x)<De&&(c=u.K$1.swap(c))}return{direction:a,length:d-e[a]+Mt(c,De)}},Ao=te.z.object({direction:u.g.direction,length:te.z.number()}),Rt=(e,...t)=>{let n=e;for(const s of t)n=u.K.translate(n,s.direction,s.length);return n},xu=(e,t,n,s)=>{try{let r=e;const i=[e,...t.map(h=>(r=u.K.translate(r,h.direction,h.length),r))];if(!s)return i;const l=t[0],a=wt(l.direction,l.length),c=Ii(a),d=4*(2-n**.5);i[0]=u.K.translate(i[0],{[l.direction]:-1*c*d,[u.g.swap(l.direction)]:0});const x=t[t.length-1],p=wt(x.direction,x.length),m=Ii(p);return i[i.length-1]=u.K.translate(i[i.length-1],{[x.direction]:m*d,[u.g.swap(x.direction)]:0}),i}catch{return[]}},De=10,Ii=e=>e==="top"||e==="left"?-1:1,Mt=(e,t)=>e==="top"||e==="left"?-t:t,wt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ht=e=>wt(e.direction,e.length),c3=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=u.g.construct(n),r=t[s]-e[s];return Mt(n,r)<0},Gn=e=>({direction:u.g.construct(e),length:Mt(e,De)}),Ai={top:Gn("top"),bottom:Gn("bottom"),left:Gn("left"),right:Gn("right")},u3=4,d3=.25,Is=e=>Oo(x3(Oo(e))),x3=e=>{const t=[...e],n=e.findIndex((s,r)=>{const i=Math.abs(s.length);if(i<u3){if(r===0||r===e.length-1)return!1;if(i<d3)return!0;if(e.length<=3)return!1;if(r+2<e.length){const l=t[r+2];if(l.direction!==s.direction)return!1;t[r+2]={...l,length:l.length+s.length}}else{const l=t[r-2];if(l.direction!==s.direction)return!1;t[r-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},Oo=e=>{const t=[...e];return e.findIndex((s,r)=>{const i=t[r-1];if(r===0||s.direction!==i.direction)return!1;if(r===1){const l=r-1,a=r,c=ht(i),d=ht(s);if(c===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(i.length)===De)return!1;const x=Mt(c,De),p=t[l].length-x,m=t[a].length+p;return Math.abs(m)<De?!1:(t[l]={...t[l],length:x},t[a]={...t[a],length:m},!0)}if(r===e.length-1){const l=r,a=r-1,c=ht(s),d=ht(i);if(c===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(s.length)===De)return!1;const x=Mt(c,De),p=t[l].length-x,m=t[a].length+p;return Math.abs(m)<De?!1:(t[l]={...t[l],length:x},t[a]={...t[a],length:m},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?Oo(t):t},Zt=e=>Is(p3(e)),p3=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:i})=>{let l=i,a=r,c={...Ai[i]},d=Rt(n,c);const x={...Ai[r]};let p=Rt(s,x);const m=Math.abs(d.x-p.x),h=Math.abs(d.y-p.y);m<2*De&&h<10&&(c.length-=m/2,x.length+=m/2,d=Rt(n,c),p=Rt(s,x));const g=[c],E=Ti({sourceStumpTip:d,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});E!=null&&(g.push(E),d=Rt(d,E),l=ht(E),c=E);const S=Ti({sourceStumpTip:p,sourceOrientation:a,sourceBox:t,targetStumpTip:d,targetOrientation:l,targetBox:e});S!=null&&(p=Rt(p,S),a=wt(S.direction,S.length));const R=()=>{S!=null&&(S.length*=-1,g.push(S)),x.length*=-1,g.push(x)};if(u.K$1.swap(l)===r){const T=u.g.construct(l),O=(p[T]-d[T])/2;g.push({direction:T,length:O});const B=u.g.swap(T);return g.push({direction:B,length:p[B]-d[B]}),g.push({direction:T,length:O}),R(),g}const v=p[c.direction]-d[c.direction];let y=u.g.swap(c.direction);const C=d[y]-p[y];let _;wt(c.direction,v)===l&&wt(y,C)===a?_={direction:c.direction,length:v}:(_={direction:y,length:p[y]-d[y]},y=u.g.swap(y)),g.push(_);const k={direction:y,length:p[y]-d[y]};return g.push(k),R(),g},m3=e=>Is(f3(e)),f3=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],i=u.g.swap(r.direction),l=ht(r);if(t===0){s.unshift({direction:i,length:n});const a=Mt(l,De);s.unshift({direction:r.direction,length:a}),t+=2,s[t]={...s[t],length:s[t].length-a}}else s[t-1]={direction:s[t-1].direction,length:s[t-1].length+n};if(t===s.length-1){s.push({direction:i,length:-n});const a=Mt(l,De);s.push({direction:r.direction,length:a}),s[t]={...s[t],length:s[t].length-a}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},h3=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},g3=(e,t,n=!1,...s)=>{const r=(i,l)=>!s.includes(l)&&t(i,l);return n?h3(e,r):e.findIndex(r)},j3=({delta:e,segments:t})=>Is(pu(e,t,!1)),E3=({delta:e,segments:t})=>Is(pu(e,t,!0)),pu=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Di("x",e,s,n)),e.y!==0&&(s=Di("y",e,s,n)),s},Oi=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=ht(t),i=ht(s),l=Math.abs(s.length),a=Math.abs(t.length);return(l>a||l>De)&&r===i},Di=(e,t,n,s)=>{const r=u.g.swap(e),i=s?n.length-1:0,l=n[i];if(Oi(e,l,t)){const p=n[n.length-1];return p.direction===e&&Math.abs(l.length)<De?(n[n.length-1]={...p,length:p.length-t[e]},n):(n[i]={...l,length:l.length-t[e]},n)}const a=s?0:n.length-1,d=g3(n,p=>p.direction===e,s,i);if(d===a){const p=n[a];return Oi(e,p,t)?(n[a]={...p,length:p.length-t[e]},n):(l.direction===e&&Math.abs(l.length)>p.length?n[i]={...l,length:l.length-t[e]}:n[a]={...p,length:p.length-t[e]},n)}if(d===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:r,length:n[0].length/2},{direction:e,length:-t[e]},{direction:r,length:n[0].length/2}]:l.direction===e?(n[i]={...l,length:l.length-t[e]},n):[{direction:r,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const x=n[d];return n[d]={...x,length:x.length-t[e]},n},y3=te.z.object({position:u.K.xy,zoom:te.z.number()}),mu=te.z.object({color:u.cr.crudeZ,variant:te.z.string().optional(),segments:te.z.array(Ao)}),S3=mu.extend({key:te.z.string(),source:te.z.string(),target:te.z.string(),segments:te.z.array(Ao),color:u.cr.crudeZ,id:te.z.string(),data:te.z.object({segments:te.z.array(Ao),color:u.cr.crudeZ,variant:te.z.string().optional()}).optional(),selected:te.z.boolean(),sourceHandle:te.z.string().nullable().optional(),targetHandle:te.z.string().nullable().optional()}),R3=te.z.object({key:te.z.string(),position:u.K.xy,selected:te.z.boolean().optional(),zIndex:te.z.number().optional(),type:te.z.string().optional(),data:u.u.unknownZ.optional(),measured:te.z.object({width:te.z.number().optional(),height:te.z.number().optional()}).optional()}),$r=(e,t)=>e.map(n=>({id:n.key,type:"custom",zIndex:n.zIndex,measured:{...n.measured},position:{...n.position},selected:n.selected,data:{},dragHandle:t})),zr=e=>e.map(({segments:t,color:n,variant:s,...r})=>({...r,id:r.key,data:{segments:t,color:n,variant:s}})),fu=e=>e.map(t=>({key:t.id,...t})),hu=(e,t)=>e.map(n=>(n.data??={segments:[],color:t,variant:"pipe"},{key:n.id,segments:n.data?.segments??[],selected:n.selected??!1,color:n.data?.color??t,variant:n.data?.variant??"pipe",...n})),gu=e=>({...e.position,zoom:e.zoom}),ju=e=>({position:u.K.construct(e),zoom:e.zoom}),Eu=(e,t)=>fu(t($r(e))),rs=(e,t,n)=>hu(t(zr(e)),n),C3=(e,t="x")=>{if(e.length===0)return[];const n=u.K$1.construct(t),s=u.K$1.swap(n);return e.sort((r,i)=>u.Ho.loc(r.box,n)-u.Ho.loc(i.box,n)),e.forEach((r,i)=>{if(i===0)return;const a=e[i-1].handles.find(h=>h.orientation===s),c=r.handles.find(h=>h.orientation===n);if(a==null||c==null)return;const d=a.absolutePosition,x=c.absolutePosition,p=u.K.set(u.K.translation(x,d),t,0),m=u.K.translate(u.Ho.topLeft(r.box),p);r.box=u.Ho.construct(m,u.Ho.dims(r.box))}),e};function Le(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n<e.length;n++)(s=Le(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var w3={value:()=>{}};function As(){for(var e=0,t=arguments.length,n={},s;e<t;++e){if(!(s=arguments[e]+"")||s in n||/[\s.]/.test(s))throw new Error("illegal type: "+s);n[s]=[]}return new is(n)}function is(e){this._=e}function b3(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}is.prototype=As.prototype={constructor:is,on:function(e,t){var n=this._,s=b3(e+"",n),r,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((r=(e=s[i]).type)&&(r=v3(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(r=(e=s[i]).type)n[r]=Bi(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Bi(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new is(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function v3(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function Bi(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=w3,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Do="http://www.w3.org/1999/xhtml";const $i={svg:"http://www.w3.org/2000/svg",xhtml:Do,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Os(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),$i.hasOwnProperty(t)?{space:$i[t],local:e}:e}function _3(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Do&&t.documentElement.namespaceURI===Do?t.createElement(e):t.createElementNS(n,e)}}function k3(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yu(e){var t=Os(e);return(t.local?k3:_3)(t)}function L3(){}function Vr(e){return e==null?L3:function(){return this.querySelector(e)}}function M3(e){typeof e!="function"&&(e=Vr(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=new Array(l),c,d,x=0;x<l;++x)(c=i[x])&&(d=e.call(c,c.__data__,x,i))&&("__data__"in c&&(d.__data__=c.__data__),a[x]=d);return new Fe(s,this._parents)}function P3(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function N3(){return[]}function Su(e){return e==null?N3:function(){return this.querySelectorAll(e)}}function T3(e){return function(){return P3(e.apply(this,arguments))}}function I3(e){typeof e=="function"?e=T3(e):e=Su(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var l=t[i],a=l.length,c,d=0;d<a;++d)(c=l[d])&&(s.push(e.call(c,c.__data__,d,l)),r.push(c));return new Fe(s,r)}function Ru(e){return function(){return this.matches(e)}}function Cu(e){return function(t){return t.matches(e)}}var A3=Array.prototype.find;function O3(e){return function(){return A3.call(this.children,e)}}function D3(){return this.firstElementChild}function B3(e){return this.select(e==null?D3:O3(typeof e=="function"?e:Cu(e)))}var $3=Array.prototype.filter;function z3(){return Array.from(this.children)}function V3(e){return function(){return $3.call(this.children,e)}}function F3(e){return this.selectAll(e==null?z3:V3(typeof e=="function"?e:Cu(e)))}function H3(e){typeof e!="function"&&(e=Ru(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=[],c,d=0;d<l;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&a.push(c);return new Fe(s,this._parents)}function wu(e){return new Array(e.length)}function Z3(){return new Fe(this._enter||this._groups.map(wu),this._parents)}function gs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}gs.prototype={constructor:gs,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function K3(e){return function(){return e}}function Y3(e,t,n,s,r,i){for(var l=0,a,c=t.length,d=i.length;l<d;++l)(a=t[l])?(a.__data__=i[l],s[l]=a):n[l]=new gs(e,i[l]);for(;l<c;++l)(a=t[l])&&(r[l]=a)}function W3(e,t,n,s,r,i,l){var a,c,d=new Map,x=t.length,p=i.length,m=new Array(x),h;for(a=0;a<x;++a)(c=t[a])&&(m[a]=h=l.call(c,c.__data__,a,t)+"",d.has(h)?r[a]=c:d.set(h,c));for(a=0;a<p;++a)h=l.call(e,i[a],a,i)+"",(c=d.get(h))?(s[a]=c,c.__data__=i[a],d.delete(h)):n[a]=new gs(e,i[a]);for(a=0;a<x;++a)(c=t[a])&&d.get(m[a])===c&&(r[a]=c)}function G3(e){return e.__data__}function U3(e,t){if(!arguments.length)return Array.from(this,G3);var n=t?W3:Y3,s=this._parents,r=this._groups;typeof e!="function"&&(e=K3(e));for(var i=r.length,l=new Array(i),a=new Array(i),c=new Array(i),d=0;d<i;++d){var x=s[d],p=r[d],m=p.length,h=X3(e.call(x,x&&x.__data__,d,s)),g=h.length,E=a[d]=new Array(g),S=l[d]=new Array(g),R=c[d]=new Array(m);n(x,p,E,S,R,h,t);for(var v=0,y=0,C,_;v<g;++v)if(C=E[v]){for(v>=y&&(y=v+1);!(_=S[y])&&++y<g;);C._next=_||null}}return l=new Fe(l,s),l._enter=a,l._exit=c,l}function X3(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function q3(){return new Fe(this._exit||this._groups.map(wu),this._parents)}function Q3(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function J3(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,l=Math.min(r,i),a=new Array(r),c=0;c<l;++c)for(var d=n[c],x=s[c],p=d.length,m=a[c]=new Array(p),h,g=0;g<p;++g)(h=d[g]||x[g])&&(m[g]=h);for(;c<r;++c)a[c]=n[c];return new Fe(a,this._parents)}function eE(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],l;--r>=0;)(l=s[r])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function tE(e){e||(e=nE);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var l=n[i],a=l.length,c=r[i]=new Array(a),d,x=0;x<a;++x)(d=l[x])&&(c[x]=d);c.sort(t)}return new Fe(r,this._parents).order()}function nE(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function sE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oE(){return Array.from(this)}function rE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var l=s[r];if(l)return l}return null}function iE(){let e=0;for(const t of this)++e;return e}function lE(){return!this.node()}function aE(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,l=r.length,a;i<l;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function cE(e){return function(){this.removeAttribute(e)}}function uE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dE(e,t){return function(){this.setAttribute(e,t)}}function xE(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function pE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function mE(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function fE(e,t){var n=Os(e);if(arguments.length<2){var s=this.node();return n.local?s.getAttributeNS(n.space,n.local):s.getAttribute(n)}return this.each((t==null?n.local?uE:cE:typeof t=="function"?n.local?mE:pE:n.local?xE:dE)(n,t))}function bu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function hE(e){return function(){this.style.removeProperty(e)}}function gE(e,t,n){return function(){this.style.setProperty(e,t,n)}}function jE(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function EE(e,t,n){return arguments.length>1?this.each((t==null?hE:typeof t=="function"?jE:gE)(e,t,n??"")):qt(this.node(),e)}function qt(e,t){return e.style.getPropertyValue(t)||bu(e).getComputedStyle(e,null).getPropertyValue(t)}function yE(e){return function(){delete this[e]}}function SE(e,t){return function(){this[e]=t}}function RE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function CE(e,t){return arguments.length>1?this.each((t==null?yE:typeof t=="function"?RE:SE)(e,t)):this.node()[e]}function vu(e){return e.trim().split(/^|\s+/)}function Fr(e){return e.classList||new _u(e)}function _u(e){this._node=e,this._names=vu(e.getAttribute("class")||"")}_u.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ku(e,t){for(var n=Fr(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function Lu(e,t){for(var n=Fr(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function wE(e){return function(){ku(this,e)}}function bE(e){return function(){Lu(this,e)}}function vE(e,t){return function(){(t.apply(this,arguments)?ku:Lu)(this,e)}}function _E(e,t){var n=vu(e+"");if(arguments.length<2){for(var s=Fr(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?vE:t?wE:bE)(n,t))}function kE(){this.textContent=""}function LE(e){return function(){this.textContent=e}}function ME(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function PE(e){return arguments.length?this.each(e==null?kE:(typeof e=="function"?ME:LE)(e)):this.node().textContent}function NE(){this.innerHTML=""}function TE(e){return function(){this.innerHTML=e}}function IE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function AE(e){return arguments.length?this.each(e==null?NE:(typeof e=="function"?IE:TE)(e)):this.node().innerHTML}function OE(){this.nextSibling&&this.parentNode.appendChild(this)}function DE(){return this.each(OE)}function BE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $E(){return this.each(BE)}function zE(e){var t=typeof e=="function"?e:yu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function VE(){return null}function FE(e,t){var n=typeof e=="function"?e:yu(e),s=t==null?VE:typeof t=="function"?t:Vr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function HE(){var e=this.parentNode;e&&e.removeChild(this)}function ZE(){return this.each(HE)}function KE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function YE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function WE(e){return this.select(e?YE:KE)}function GE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function UE(e){return function(t){e.call(this,t,this.__data__)}}function XE(e){return e.trim().split(/^|\s+/).map(function(t){var n="",s=t.indexOf(".");return s>=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function qE(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function QE(e,t,n){return function(){var s=this.__on,r,i=UE(t);if(s){for(var l=0,a=s.length;l<a;++l)if((r=s[l]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function JE(e,t,n){var s=XE(e+""),r,i=s.length,l;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,d=a.length,x;c<d;++c)for(r=0,x=a[c];r<i;++r)if((l=s[r]).type===x.type&&l.name===x.name)return x.value}return}for(a=t?QE:qE,r=0;r<i;++r)this.each(a(s[r],t,n));return this}function Mu(e,t,n){var s=bu(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function e5(e,t){return function(){return Mu(this,e,t)}}function t5(e,t){return function(){return Mu(this,e,t.apply(this,arguments))}}function n5(e,t){return this.each((typeof t=="function"?t5:e5)(e,t))}function*s5(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,l;r<i;++r)(l=s[r])&&(yield l)}var Pu=[null];function Fe(e,t){this._groups=e,this._parents=t}function On(){return new Fe([[document.documentElement]],Pu)}function o5(){return this}Fe.prototype=On.prototype={constructor:Fe,select:M3,selectAll:I3,selectChild:B3,selectChildren:F3,filter:H3,data:U3,enter:Z3,exit:q3,join:Q3,merge:J3,selection:o5,order:eE,sort:tE,call:sE,nodes:oE,node:rE,size:iE,empty:lE,each:aE,attr:fE,style:EE,property:CE,classed:_E,text:PE,html:AE,raise:DE,lower:$E,append:zE,insert:FE,remove:ZE,clone:WE,datum:GE,on:JE,dispatch:n5,[Symbol.iterator]:s5};function ze(e){return typeof e=="string"?new Fe([[document.querySelector(e)]],[document.documentElement]):new Fe([[e]],Pu)}function r5(e){let t;for(;t=e.sourceEvent;)e=t;return e}function We(e,t){if(e=r5(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const i5={passive:!1},bn={capture:!0,passive:!1};function uo(e){e.stopImmediatePropagation()}function Gt(e){e.preventDefault(),e.stopImmediatePropagation()}function Nu(e){var t=e.document.documentElement,n=ze(e).on("dragstart.drag",Gt,bn);"onselectstart"in t?n.on("selectstart.drag",Gt,bn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Tu(e,t){var n=e.document.documentElement,s=ze(e).on("dragstart.drag",null);t&&(s.on("click.drag",Gt,bn),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in n?s.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Un=e=>()=>e;function Bo(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:l,y:a,dx:c,dy:d,dispatch:x}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:x}})}Bo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function l5(e){return!e.ctrlKey&&!e.button}function a5(){return this.parentNode}function c5(e,t){return t??{x:e.x,y:e.y}}function u5(){return navigator.maxTouchPoints||"ontouchstart"in this}function Iu(){var e=l5,t=a5,n=c5,s=u5,r={},i=As("start","drag","end"),l=0,a,c,d,x,p=0;function m(C){C.on("mousedown.drag",h).filter(s).on("touchstart.drag",S).on("touchmove.drag",R,i5).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(C,_){if(!(x||!e.call(this,C,_))){var k=y(this,t.call(this,C,_),C,_,"mouse");k&&(ze(C.view).on("mousemove.drag",g,bn).on("mouseup.drag",E,bn),Nu(C.view),uo(C),d=!1,a=C.clientX,c=C.clientY,k("start",C))}}function g(C){if(Gt(C),!d){var _=C.clientX-a,k=C.clientY-c;d=_*_+k*k>p}r.mouse("drag",C)}function E(C){ze(C.view).on("mousemove.drag mouseup.drag",null),Tu(C.view,d),Gt(C),r.mouse("end",C)}function S(C,_){if(e.call(this,C,_)){var k=C.changedTouches,T=t.call(this,C,_),O=k.length,B,F;for(B=0;B<O;++B)(F=y(this,T,C,_,k[B].identifier,k[B]))&&(uo(C),F("start",C,k[B]))}}function R(C){var _=C.changedTouches,k=_.length,T,O;for(T=0;T<k;++T)(O=r[_[T].identifier])&&(Gt(C),O("drag",C,_[T]))}function v(C){var _=C.changedTouches,k=_.length,T,O;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),T=0;T<k;++T)(O=r[_[T].identifier])&&(uo(C),O("end",C,_[T]))}function y(C,_,k,T,O,B){var F=i.copy(),z=We(B||k,_),N,$,w;if((w=n.call(C,new Bo("beforestart",{sourceEvent:k,target:m,identifier:O,active:l,x:z[0],y:z[1],dx:0,dy:0,dispatch:F}),T))!=null)return N=w.x-z[0]||0,$=w.y-z[1]||0,function L(M,D,H){var V=z,Z;switch(M){case"start":r[O]=L,Z=l++;break;case"end":delete r[O],--l;case"drag":z=We(H||D,_),Z=l;break}F.call(M,C,new Bo(M,{sourceEvent:D,subject:w,target:m,identifier:O,active:Z,x:z[0]+N,y:z[1]+$,dx:z[0]-V[0],dy:z[1]-V[1],dispatch:F}),T)}}return m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Un(!!C),m):e},m.container=function(C){return arguments.length?(t=typeof C=="function"?C:Un(C),m):t},m.subject=function(C){return arguments.length?(n=typeof C=="function"?C:Un(C),m):n},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:Un(!!C),m):s},m.on=function(){var C=i.on.apply(i,arguments);return C===i?m:C},m.clickDistance=function(C){return arguments.length?(p=(C=+C)*C,m):Math.sqrt(p)},m}var Qt=0,gn=0,pn=0,Au=1e3,js,jn,Es=0,Pt=0,Ds=0,vn=typeof performance=="object"&&performance.now?performance:Date,Ou=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Hr(){return Pt||(Ou(d5),Pt=vn.now()+Ds)}function d5(){Pt=0}function ys(){this._call=this._time=this._next=null}ys.prototype=Du.prototype={constructor:ys,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Hr():+n)+(t==null?0:+t),!this._next&&jn!==this&&(jn?jn._next=this:js=this,jn=this),this._call=e,this._time=n,$o()},stop:function(){this._call&&(this._call=null,this._time=1/0,$o())}};function Du(e,t,n){var s=new ys;return s.restart(e,t,n),s}function x5(){Hr(),++Qt;for(var e=js,t;e;)(t=Pt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qt}function zi(){Pt=(Es=vn.now())+Ds,Qt=gn=0;try{x5()}finally{Qt=0,m5(),Pt=0}}function p5(){var e=vn.now(),t=e-Es;t>Au&&(Ds-=t,Es=e)}function m5(){for(var e,t=js,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:js=n);jn=e,$o(s)}function $o(e){if(!Qt){gn&&(gn=clearTimeout(gn));var t=e-Pt;t>24?(e<1/0&&(gn=setTimeout(zi,e-vn.now()-Ds)),pn&&(pn=clearInterval(pn))):(pn||(Es=vn.now(),pn=setInterval(p5,Au)),Qt=1,Ou(zi))}}function Vi(e,t,n){var s=new ys;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var f5=As("start","end","cancel","interrupt"),h5=[],Bu=0,Fi=1,zo=2,ls=3,Hi=4,Vo=5,as=6;function Bs(e,t,n,s,r,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;g5(e,n,{name:t,index:s,group:r,on:f5,tween:h5,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Bu})}function Zr(e,t){var n=Qe(e,t);if(n.state>Bu)throw new Error("too late; already scheduled");return n}function st(e,t){var n=Qe(e,t);if(n.state>ls)throw new Error("too late; already running");return n}function Qe(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function g5(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=Du(i,0,n.time);function i(d){n.state=Fi,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var x,p,m,h;if(n.state!==Fi)return c();for(x in s)if(h=s[x],h.name===n.name){if(h.state===ls)return Vi(l);h.state===Hi?(h.state=as,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete s[x]):+x<t&&(h.state=as,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete s[x])}if(Vi(function(){n.state===ls&&(n.state=Hi,n.timer.restart(a,n.delay,n.time),a(d))}),n.state=zo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===zo){for(n.state=ls,r=new Array(m=n.tween.length),x=0,p=-1;x<m;++x)(h=n.tween[x].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=h);r.length=p+1}}function a(d){for(var x=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(c),n.state=Vo,1),p=-1,m=r.length;++p<m;)r[p].call(e,x);n.state===Vo&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=as,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function cs(e,t){var n=e.__transition,s,r,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){i=!1;continue}r=s.state>zo&&s.state<Vo,s.state=as,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function j5(e){return this.each(function(){cs(this,e)})}function E5(e,t){var n,s;return function(){var r=st(this,e),i=r.tween;if(i!==n){s=n=i;for(var l=0,a=s.length;l<a;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}r.tween=s}}function y5(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=st(this,e),l=i.tween;if(l!==s){r=(s=l).slice();for(var a={name:t,value:n},c=0,d=r.length;c<d;++c)if(r[c].name===t){r[c]=a;break}c===d&&r.push(a)}i.tween=r}}function S5(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Qe(this.node(),n).tween,r=0,i=s.length,l;r<i;++r)if((l=s[r]).name===e)return l.value;return null}return this.each((t==null?E5:y5)(n,e,t))}function Kr(e,t,n){var s=e._id;return e.each(function(){var r=st(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Qe(r,s).value[t]}}function $u(e,t){var n;return(typeof t=="number"?I.interpolateNumber:t instanceof I.color?I.interpolateRgb:(n=I.color(t))?(t=n,I.interpolateRgb):I.interpolateString)(e,t)}function R5(e){return function(){this.removeAttribute(e)}}function C5(e){return function(){this.removeAttributeNS(e.space,e.local)}}function w5(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttribute(e);return l===r?null:l===s?i:i=t(s=l,n)}}function b5(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===r?null:l===s?i:i=t(s=l,n)}}function v5(e,t,n){var s,r,i;return function(){var l,a=n(this),c;return a==null?void this.removeAttribute(e):(l=this.getAttribute(e),c=a+"",l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a)))}}function _5(e,t,n){var s,r,i;return function(){var l,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),c=a+"",l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a)))}}function k5(e,t){var n=Os(e),s=n==="transform"?Xg:$u;return this.attrTween(e,typeof t=="function"?(n.local?_5:v5)(n,s,Kr(this,"attr."+e,t)):t==null?(n.local?C5:R5)(n):(n.local?b5:w5)(n,s,t))}function L5(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function M5(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function P5(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&M5(e,i)),n}return r._value=t,r}function N5(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&L5(e,i)),n}return r._value=t,r}function T5(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var s=Os(e);return this.tween(n,(s.local?P5:N5)(s,t))}function I5(e,t){return function(){Zr(this,e).delay=+t.apply(this,arguments)}}function A5(e,t){return t=+t,function(){Zr(this,e).delay=t}}function O5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?I5:A5)(t,e)):Qe(this.node(),t).delay}function D5(e,t){return function(){st(this,e).duration=+t.apply(this,arguments)}}function B5(e,t){return t=+t,function(){st(this,e).duration=t}}function $5(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?D5:B5)(t,e)):Qe(this.node(),t).duration}function z5(e,t){if(typeof t!="function")throw new Error;return function(){st(this,e).ease=t}}function V5(e){var t=this._id;return arguments.length?this.each(z5(t,e)):Qe(this.node(),t).ease}function F5(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;st(this,e).ease=n}}function H5(e){if(typeof e!="function")throw new Error;return this.each(F5(this._id,e))}function Z5(e){typeof e!="function"&&(e=Ru(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,a=s[r]=[],c,d=0;d<l;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&a.push(c);return new at(s,this._parents,this._name,this._id)}function K5(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),l=new Array(s),a=0;a<i;++a)for(var c=t[a],d=n[a],x=c.length,p=l[a]=new Array(x),m,h=0;h<x;++h)(m=c[h]||d[h])&&(p[h]=m);for(;a<s;++a)l[a]=t[a];return new at(l,this._parents,this._name,this._id)}function Y5(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function W5(e,t,n){var s,r,i=Y5(t)?Zr:st;return function(){var l=i(this,e),a=l.on;a!==s&&(r=(s=a).copy()).on(t,n),l.on=r}}function G5(e,t){var n=this._id;return arguments.length<2?Qe(this.node(),n).on.on(e):this.each(W5(n,e,t))}function U5(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function X5(){return this.on("end.remove",U5(this._id))}function q5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Vr(e));for(var s=this._groups,r=s.length,i=new Array(r),l=0;l<r;++l)for(var a=s[l],c=a.length,d=i[l]=new Array(c),x,p,m=0;m<c;++m)(x=a[m])&&(p=e.call(x,x.__data__,m,a))&&("__data__"in x&&(p.__data__=x.__data__),d[m]=p,Bs(d[m],t,n,m,d,Qe(x,n)));return new at(i,this._parents,t,n)}function Q5(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Su(e));for(var s=this._groups,r=s.length,i=[],l=[],a=0;a<r;++a)for(var c=s[a],d=c.length,x,p=0;p<d;++p)if(x=c[p]){for(var m=e.call(x,x.__data__,p,c),h,g=Qe(x,n),E=0,S=m.length;E<S;++E)(h=m[E])&&Bs(h,t,n,E,m,g);i.push(m),l.push(x)}return new at(i,l,t,n)}var J5=On.prototype.constructor;function ey(){return new J5(this._groups,this._parents)}function ty(e,t){var n,s,r;return function(){var i=qt(this,e),l=(this.style.removeProperty(e),qt(this,e));return i===l?null:i===n&&l===s?r:r=t(n=i,s=l)}}function zu(e){return function(){this.style.removeProperty(e)}}function ny(e,t,n){var s,r=n+"",i;return function(){var l=qt(this,e);return l===r?null:l===s?i:i=t(s=l,n)}}function sy(e,t,n){var s,r,i;return function(){var l=qt(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),qt(this,e))),l===c?null:l===s&&c===r?i:(r=c,i=t(s=l,a))}}function oy(e,t){var n,s,r,i="style."+t,l="end."+i,a;return function(){var c=st(this,e),d=c.on,x=c.value[i]==null?a||(a=zu(t)):void 0;(d!==n||r!==x)&&(s=(n=d).copy()).on(l,r=x),c.on=s}}function ry(e,t,n){var s=(e+="")=="transform"?Ug:$u;return t==null?this.styleTween(e,ty(e,s)).on("end.style."+e,zu(e)):typeof t=="function"?this.styleTween(e,sy(e,s,Kr(this,"style."+e,t))).each(oy(this._id,e)):this.styleTween(e,ny(e,s,t),n).on("end.style."+e,null)}function iy(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function ly(e,t,n){var s,r;function i(){var l=t.apply(this,arguments);return l!==r&&(s=(r=l)&&iy(e,l,n)),s}return i._value=t,i}function ay(e,t,n){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,ly(e,t,n??""))}function cy(e){return function(){this.textContent=e}}function uy(e){return function(){var t=e(this);this.textContent=t??""}}function dy(e){return this.tween("text",typeof e=="function"?uy(Kr(this,"text",e)):cy(e==null?"":e+""))}function xy(e){return function(t){this.textContent=e.call(this,t)}}function py(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&xy(r)),t}return s._value=e,s}function my(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,py(e))}function fy(){for(var e=this._name,t=this._id,n=Vu(),s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)if(c=l[d]){var x=Qe(c,t);Bs(c,e,n,d,l,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new at(s,this._parents,e,n)}function hy(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,l){var a={value:l},c={value:function(){--r===0&&i()}};n.each(function(){var d=st(this,s),x=d.on;x!==e&&(t=(e=x).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),d.on=t}),r===0&&i()})}var gy=0;function at(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Vu(){return++gy}var ot=On.prototype;at.prototype={constructor:at,select:q5,selectAll:Q5,selectChild:ot.selectChild,selectChildren:ot.selectChildren,filter:Z5,merge:K5,selection:ey,transition:fy,call:ot.call,nodes:ot.nodes,node:ot.node,size:ot.size,empty:ot.empty,each:ot.each,on:G5,attr:k5,attrTween:T5,style:ry,styleTween:ay,text:dy,textTween:my,remove:X5,tween:S5,delay:O5,duration:$5,ease:V5,easeVarying:H5,end:hy,[Symbol.iterator]:ot[Symbol.iterator]};function jy(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ey={time:null,delay:0,duration:250,ease:jy};function yy(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Sy(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=Vu(),(n=Ey).time=Hr(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)(c=l[d])&&Bs(c,e,t,d,l,n||yy(c,t));return new at(s,this._parents,e,t)}On.prototype.interrupt=j5;On.prototype.transition=Sy;const Xn=e=>()=>e;function Ry(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function it(e,t,n){this.k=e,this.x=t,this.y=n}it.prototype={constructor:it,scale:function(e){return e===1?this:new it(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new it(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $s=new it(1,0,0);Fu.prototype=it.prototype;function Fu(e){for(;!e.__zoom;)if(!(e=e.parentNode))return $s;return e.__zoom}function xo(e){e.stopImmediatePropagation()}function mn(e){e.preventDefault(),e.stopImmediatePropagation()}function Cy(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function wy(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Zi(){return this.__zoom||$s}function by(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function vy(){return navigator.maxTouchPoints||"ontouchstart"in this}function _y(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function Hu(){var e=Cy,t=wy,n=_y,s=by,r=vy,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],a=250,c=os,d=As("start","zoom","end"),x,p,m,h=500,g=150,E=0,S=10;function R(w){w.property("__zoom",Zi).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",F).filter(r).on("touchstart.zoom",z).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}R.transform=function(w,L,M,D){var H=w.selection?w.selection():w;H.property("__zoom",Zi),w!==H?_(w,L,M,D):H.interrupt().each(function(){k(this,arguments).event(D).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},R.scaleBy=function(w,L,M,D){R.scaleTo(w,function(){var H=this.__zoom.k,V=typeof L=="function"?L.apply(this,arguments):L;return H*V},M,D)},R.scaleTo=function(w,L,M,D){R.transform(w,function(){var H=t.apply(this,arguments),V=this.__zoom,Z=M==null?C(H):typeof M=="function"?M.apply(this,arguments):M,K=V.invert(Z),q=typeof L=="function"?L.apply(this,arguments):L;return n(y(v(V,q),Z,K),H,l)},M,D)},R.translateBy=function(w,L,M,D){R.transform(w,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),l)},null,D)},R.translateTo=function(w,L,M,D,H){R.transform(w,function(){var V=t.apply(this,arguments),Z=this.__zoom,K=D==null?C(V):typeof D=="function"?D.apply(this,arguments):D;return n($s.translate(K[0],K[1]).scale(Z.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof M=="function"?-M.apply(this,arguments):-M),V,l)},D,H)};function v(w,L){return L=Math.max(i[0],Math.min(i[1],L)),L===w.k?w:new it(L,w.x,w.y)}function y(w,L,M){var D=L[0]-M[0]*w.k,H=L[1]-M[1]*w.k;return D===w.x&&H===w.y?w:new it(w.k,D,H)}function C(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function _(w,L,M,D){w.on("start.zoom",function(){k(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(D).end()}).tween("zoom",function(){var H=this,V=arguments,Z=k(H,V).event(D),K=t.apply(H,V),q=M==null?C(K):typeof M=="function"?M.apply(H,V):M,ne=Math.max(K[1][0]-K[0][0],K[1][1]-K[0][1]),J=H.__zoom,oe=typeof L=="function"?L.apply(H,V):L,se=c(J.invert(q).concat(ne/J.k),oe.invert(q).concat(ne/oe.k));return function(re){if(re===1)re=oe;else{var ee=se(re),ie=ne/ee[2];re=new it(ie,q[0]-ee[0]*ie,q[1]-ee[1]*ie)}Z.zoom(null,re)}})}function k(w,L,M){return!M&&w.__zooming||new T(w,L)}function T(w,L){this.that=w,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(w,L),this.taps=0}T.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,L){return this.mouse&&w!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var L=ze(this.that).datum();d.call(w,this.that,new Ry(w,{sourceEvent:this.sourceEvent,target:R,transform:this.that.__zoom,dispatch:d}),L)}};function O(w,...L){if(!e.apply(this,arguments))return;var M=k(this,L).event(w),D=this.__zoom,H=Math.max(i[0],Math.min(i[1],D.k*Math.pow(2,s.apply(this,arguments)))),V=We(w);if(M.wheel)(M.mouse[0][0]!==V[0]||M.mouse[0][1]!==V[1])&&(M.mouse[1]=D.invert(M.mouse[0]=V)),clearTimeout(M.wheel);else{if(D.k===H)return;M.mouse=[V,D.invert(V)],cs(this),M.start()}mn(w),M.wheel=setTimeout(Z,g),M.zoom("mouse",n(y(v(D,H),M.mouse[0],M.mouse[1]),M.extent,l));function Z(){M.wheel=null,M.end()}}function B(w,...L){if(m||!e.apply(this,arguments))return;var M=w.currentTarget,D=k(this,L,!0).event(w),H=ze(w.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",ne,!0),V=We(w,M),Z=w.clientX,K=w.clientY;Nu(w.view),xo(w),D.mouse=[V,this.__zoom.invert(V)],cs(this),D.start();function q(J){if(mn(J),!D.moved){var oe=J.clientX-Z,se=J.clientY-K;D.moved=oe*oe+se*se>E}D.event(J).zoom("mouse",n(y(D.that.__zoom,D.mouse[0]=We(J,M),D.mouse[1]),D.extent,l))}function ne(J){H.on("mousemove.zoom mouseup.zoom",null),Tu(J.view,D.moved),mn(J),D.event(J).end()}}function F(w,...L){if(e.apply(this,arguments)){var M=this.__zoom,D=We(w.changedTouches?w.changedTouches[0]:w,this),H=M.invert(D),V=M.k*(w.shiftKey?.5:2),Z=n(y(v(M,V),D,H),t.apply(this,L),l);mn(w),a>0?ze(this).transition().duration(a).call(_,Z,D,w):ze(this).call(R.transform,Z,D,w)}}function z(w,...L){if(e.apply(this,arguments)){var M=w.touches,D=M.length,H=k(this,L,w.changedTouches.length===D).event(w),V,Z,K,q;for(xo(w),Z=0;Z<D;++Z)K=M[Z],q=We(K,this),q=[q,this.__zoom.invert(q),K.identifier],H.touch0?!H.touch1&&H.touch0[2]!==q[2]&&(H.touch1=q,H.taps=0):(H.touch0=q,V=!0,H.taps=1+!!x);x&&(x=clearTimeout(x)),V&&(H.taps<2&&(p=q[0],x=setTimeout(function(){x=null},h)),cs(this),H.start())}}function N(w,...L){if(this.__zooming){var M=k(this,L).event(w),D=w.changedTouches,H=D.length,V,Z,K,q;for(mn(w),V=0;V<H;++V)Z=D[V],K=We(Z,this),M.touch0&&M.touch0[2]===Z.identifier?M.touch0[0]=K:M.touch1&&M.touch1[2]===Z.identifier&&(M.touch1[0]=K);if(Z=M.that.__zoom,M.touch1){var ne=M.touch0[0],J=M.touch0[1],oe=M.touch1[0],se=M.touch1[1],re=(re=oe[0]-ne[0])*re+(re=oe[1]-ne[1])*re,ee=(ee=se[0]-J[0])*ee+(ee=se[1]-J[1])*ee;Z=v(Z,Math.sqrt(re/ee)),K=[(ne[0]+oe[0])/2,(ne[1]+oe[1])/2],q=[(J[0]+se[0])/2,(J[1]+se[1])/2]}else if(M.touch0)K=M.touch0[0],q=M.touch0[1];else return;M.zoom("touch",n(y(Z,K,q),M.extent,l))}}function $(w,...L){if(this.__zooming){var M=k(this,L).event(w),D=w.changedTouches,H=D.length,V,Z;for(xo(w),m&&clearTimeout(m),m=setTimeout(function(){m=null},h),V=0;V<H;++V)Z=D[V],M.touch0&&M.touch0[2]===Z.identifier?delete M.touch0:M.touch1&&M.touch1[2]===Z.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(Z=We(Z,this),Math.hypot(p[0]-Z[0],p[1]-Z[1])<S)){var K=ze(this).on("dblclick.zoom");K&&K.apply(this,arguments)}}}return R.wheelDelta=function(w){return arguments.length?(s=typeof w=="function"?w:Xn(+w),R):s},R.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Xn(!!w),R):e},R.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Xn(!!w),R):r},R.extent=function(w){return arguments.length?(t=typeof w=="function"?w:Xn([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),R):t},R.scaleExtent=function(w){return arguments.length?(i[0]=+w[0],i[1]=+w[1],R):[i[0],i[1]]},R.translateExtent=function(w){return arguments.length?(l[0][0]=+w[0][0],l[1][0]=+w[1][0],l[0][1]=+w[0][1],l[1][1]=+w[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(w){return arguments.length?(n=w,R):n},R.duration=function(w){return arguments.length?(a=+w,R):a},R.interpolate=function(w){return arguments.length?(c=w,R):c},R.on=function(){var w=d.on.apply(d,arguments);return w===d?R:w},R.clickDistance=function(w){return arguments.length?(E=(w=+w)*w,R):Math.sqrt(E)},R.tapDistance=function(w){return arguments.length?(S=+w,R):S},R}const Ae={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},_n=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Zu=["Enter"," ","Escape"],Ku={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Nt;(function(e){e.Strict="strict",e.Loose="loose"})(Nt||(Nt={}));var bt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(bt||(bt={}));var Jt;(function(e){e.Partial="partial",e.Full="full"})(Jt||(Jt={}));const Yu={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var ft;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ft||(ft={}));var Ss;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ss||(Ss={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const Ki={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function Wu(e){return e===null?null:e?"valid":"invalid"}const Gu=e=>"id"in e&&"source"in e&&"target"in e,ky=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Yr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Dn=(e,t=[0,0])=>{const{width:n,height:s}=ut(e),r=e.origin??t,i=n*r[0],l=s*r[1];return{x:e.position.x-i,y:e.position.y-l}},Ly=(e,t={nodeOrigin:[0,0]})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,r)=>{const i=typeof r=="string";let l=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(r):Yr(r)?r:t.nodeLookup.get(r.id));const a=l?Rs(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return zs(s,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Vs(n)},Bn=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(s=>{if(t.filter===void 0||t.filter(s)){const r=Rs(s);n=zs(n,r)}}),Vs(n)},Wr=(e,t,[n,s,r]=[0,0,1],i=!1,l=!1)=>{const a={...$n(t,[n,s,r]),width:t.width/r,height:t.height/r},c=[];for(const d of e.values()){const{measured:x,selectable:p=!0,hidden:m=!1}=d;if(l&&!p||m)continue;const h=x.width??d.width??d.initialWidth??null,g=x.height??d.height??d.initialHeight??null,E=kn(a,tn(d)),S=(h??0)*(g??0),R=i&&E>0;(!d.internals.handleBounds||R||E>=S||d.dragging)&&c.push(d)}return c},My=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function Py(e,t){const n=new Map,s=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function Ny({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},l){if(e.size===0)return Promise.resolve(!0);const a=Py(e,l),c=Bn(a),d=Gr(c,t,n,l?.minZoom??r,l?.maxZoom??i,l?.padding??.1);return await s.setViewport(d,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function Uu({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const l=n.get(e),a=l.parentId?n.get(l.parentId):void 0,{x:c,y:d}=a?a.internals.positionAbsolute:{x:0,y:0},x=l.origin??s;let p=r;if(l.extent==="parent"&&!l.expandParent)if(!a)i?.("005",Ae.error005());else{const h=a.measured.width,g=a.measured.height;h&&g&&(p=[[c,d],[c+h,d+g]])}else a&&nn(l.extent)&&(p=[[l.extent[0][0]+c,l.extent[0][1]+d],[l.extent[1][0]+c,l.extent[1][1]+d]]);const m=nn(p)?Tt(t,p,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&i?.("015",Ae.error015()),{position:{x:m.x-c+(l.measured.width??0)*x[0],y:m.y-d+(l.measured.height??0)*x[1]},positionAbsolute:m}}async function Ty({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(m=>m.id)),l=[];for(const m of n){if(m.deletable===!1)continue;const h=i.has(m.id),g=!h&&m.parentId&&l.find(E=>E.id===m.parentId);(h||g)&&l.push(m)}const a=new Set(t.map(m=>m.id)),c=s.filter(m=>m.deletable!==!1),x=My(l,c);for(const m of c)a.has(m.id)&&!x.find(g=>g.id===m.id)&&x.push(m);if(!r)return{edges:x,nodes:l};const p=await r({nodes:l,edges:x});return typeof p=="boolean"?p?{edges:x,nodes:l}:{edges:[],nodes:[]}:p}const en=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Tt=(e={x:0,y:0},t,n)=>({x:en(e.x,t[0][0],t[1][0]-(n?.width??0)),y:en(e.y,t[0][1],t[1][1]-(n?.height??0))});function Xu(e,t,n){const{width:s,height:r}=ut(n),{x:i,y:l}=n.internals.positionAbsolute;return Tt(e,[[i,l],[i+s,l+r]],t)}const Yi=(e,t,n)=>e<t?en(Math.abs(e-t),1,t)/t:e>n?-en(Math.abs(e-n),1,t)/t:0,qu=(e,t,n=15,s=40)=>{const r=Yi(e.x,s,t.width-s)*n,i=Yi(e.y,s,t.height-s)*n;return[r,i]},zs=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Fo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Vs=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),tn=(e,t=[0,0])=>{const{x:n,y:s}=Yr(e)?e.internals.positionAbsolute:Dn(e,t);return{x:n,y:s,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Rs=(e,t=[0,0])=>{const{x:n,y:s}=Yr(e)?e.internals.positionAbsolute:Dn(e,t);return{x:n,y:s,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:s+(e.measured?.height??e.height??e.initialHeight??0)}},Qu=(e,t)=>Vs(zs(Fo(e),Fo(t))),kn=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},Wi=e=>Ge(e.width)&&Ge(e.height)&&Ge(e.x)&&Ge(e.y),Ge=e=>!isNaN(e)&&isFinite(e),Cs=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},Fs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),$n=({x:e,y:t},[n,s,r],i=!1,l=[1,1])=>{const a={x:(e-n)/r,y:(t-s)/r};return i?Fs(a,l):a},ws=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s});function Ht(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Iy(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=Ht(e,n),r=Ht(e,t);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof e=="object"){const s=Ht(e.top??e.y??0,n),r=Ht(e.bottom??e.y??0,n),i=Ht(e.left??e.x??0,t),l=Ht(e.right??e.x??0,t);return{top:s,right:l,bottom:r,left:i,x:i+l,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Ay(e,t,n,s,r,i){const{x:l,y:a}=ws(e,[t,n,s]),{x:c,y:d}=ws({x:e.x+e.width,y:e.y+e.height},[t,n,s]),x=r-c,p=i-d;return{left:Math.floor(l),top:Math.floor(a),right:Math.floor(x),bottom:Math.floor(p)}}const Gr=(e,t,n,s,r,i)=>{const l=Iy(i,t,n),a=(t-l.x)/e.width,c=(n-l.y)/e.height,d=Math.min(a,c),x=en(d,s,r),p=e.x+e.width/2,m=e.y+e.height/2,h=t/2-p*x,g=n/2-m*x,E=Ay(e,h,g,x,t,n),S={left:Math.min(E.left-l.left,0),top:Math.min(E.top-l.top,0),right:Math.min(E.right-l.right,0),bottom:Math.min(E.bottom-l.bottom,0)};return{x:h-S.left+S.right,y:g-S.top+S.bottom,zoom:x}},bs=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function nn(e){return e!==void 0&&e!=="parent"}function ut(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Ju(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function ed(e,t={width:0,height:0},n,s,r){const i={...e},l=s.get(n);if(l){const a=l.origin||r;i.x+=l.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=l.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Gi(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Oy(){let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}function Dy(e){return{...Ku,...e||{}}}function yn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:l}=et(e),a=$n({x:i-(r?.left??0),y:l-(r?.top??0)},s),{x:c,y:d}=n?Fs(a,t):a;return{xSnapped:c,ySnapped:d,...a}}const Ur=e=>({width:e.offsetWidth,height:e.offsetHeight}),td=e=>e?.getRootNode?.()||window?.document,By=["INPUT","SELECT","TEXTAREA"];function nd(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:By.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const sd=e=>"clientX"in e,et=(e,t)=>{const n=sd(e),s=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:s-(t?.left??0),y:r-(t?.top??0)}},Ui=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const a=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:r,position:l.getAttribute("data-handlepos"),x:(a.left-n.left)/s,y:(a.top-n.top)/s,...Ur(l)}})};function od({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:l,targetControlY:a}){const c=e*.125+r*.375+l*.375+n*.125,d=t*.125+i*.375+a*.375+s*.125,x=Math.abs(c-e),p=Math.abs(d-t);return[c,d,x,p]}function qn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Xi({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case Q.Left:return[t-qn(t-s,i),n];case Q.Right:return[t+qn(s-t,i),n];case Q.Top:return[t,n-qn(n-r,i)];case Q.Bottom:return[t,n+qn(r-n,i)]}}function rd({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top,curvature:l=.25}){const[a,c]=Xi({pos:n,x1:e,y1:t,x2:s,y2:r,c:l}),[d,x]=Xi({pos:i,x1:s,y1:r,x2:e,y2:t,c:l}),[p,m,h,g]=od({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:d,targetControlY:x});return[`M${e},${t} C${a},${c} ${d},${x} ${s},${r}`,p,m,h,g]}function id({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,l=Math.abs(s-t)/2,a=s<t?s+l:s-l;return[i,a,r,l]}function $y({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s,elevateOnSelect:r=!1}){if(s!==void 0)return s;const i=r&&n?1e3:0,l=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return i+l}function zy({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=zs(Rs(e),Rs(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return kn(l,Vs(i))>0}const ld=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,Vy=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),ad=(e,t)=>{if(!e.source||!e.target)return Cs("006",Ae.error006()),t;let n;return Gu(e)?n={...e}:n={...e,id:ld(e)},Vy(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},Fy=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...i}=e;if(!t.source||!t.target)return Cs("006",Ae.error006()),n;if(!n.find(c=>c.id===e.id))return Cs("007",Ae.error007(r)),n;const a={...i,id:s.shouldReplaceId?ld(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(c=>c.id!==r).concat(a)};function cd({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,l,a]=id({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,l,a]}const qi={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},Hy=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Qi=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Zy({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:s=Q.Top,center:r,offset:i}){const l=qi[t],a=qi[s],c={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+a.x*i,y:n.y+a.y*i},x=Hy({source:c,sourcePosition:t,target:d}),p=x.x!==0?"x":"y",m=x[p];let h=[],g,E;const S={x:0,y:0},R={x:0,y:0},[v,y,C,_]=id({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*a[p]===-1){g=r.x??v,E=r.y??y;const T=[{x:g,y:c.y},{x:g,y:d.y}],O=[{x:c.x,y:E},{x:d.x,y:E}];l[p]===m?h=p==="x"?T:O:h=p==="x"?O:T}else{const T=[{x:c.x,y:d.y}],O=[{x:d.x,y:c.y}];if(p==="x"?h=l.x===m?O:T:h=l.y===m?T:O,t===s){const $=Math.abs(e[p]-n[p]);if($<=i){const w=Math.min(i-1,i-$);l[p]===m?S[p]=(c[p]>e[p]?-1:1)*w:R[p]=(d[p]>n[p]?-1:1)*w}}if(t!==s){const $=p==="x"?"y":"x",w=l[p]===a[$],L=c[$]>d[$],M=c[$]<d[$];(l[p]===1&&(!w&&L||w&&M)||l[p]!==1&&(!w&&M||w&&L))&&(h=p==="x"?T:O)}const B={x:c.x+S.x,y:c.y+S.y},F={x:d.x+R.x,y:d.y+R.y},z=Math.max(Math.abs(B.x-h[0].x),Math.abs(F.x-h[0].x)),N=Math.max(Math.abs(B.y-h[0].y),Math.abs(F.y-h[0].y));z>=N?(g=(B.x+F.x)/2,E=h[0].y):(g=h[0].x,E=(B.y+F.y)/2)}return[[e,{x:c.x+S.x,y:c.y+S.y},...h,{x:d.x+R.x,y:d.y+R.y},n],g,E,C,_]}function Ky(e,t,n,s){const r=Math.min(Qi(e,t)/2,Qi(t,n)/2,s),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const d=e.x<n.x?-1:1,x=e.y<n.y?1:-1;return`L ${i+r*d},${l}Q ${i},${l} ${i},${l+r*x}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${l+r*c}Q ${i},${l} ${i+r*a},${l}`}function Ho({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top,borderRadius:l=5,centerX:a,centerY:c,offset:d=20}){const[x,p,m,h,g]=Zy({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:a,y:c},offset:d});return[x.reduce((S,R,v)=>{let y="";return v>0&&v<x.length-1?y=Ky(x[v-1],R,x[v+1],l):y=`${v===0?"M":"L"}${R.x} ${R.y}`,S+=y,S},""),p,m,h,g]}function Ji(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Yy(e){const{sourceNode:t,targetNode:n}=e;if(!Ji(t)||!Ji(n))return null;const s=t.internals.handleBounds||el(t.handles),r=n.internals.handleBounds||el(n.handles),i=tl(s?.source??[],e.sourceHandle),l=tl(e.connectionMode===Nt.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!l)return e.onError?.("008",Ae.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Q.Bottom,c=l?.position||Q.Top,d=Ln(t,i,a),x=Ln(n,l,c);return{sourceX:d.x,sourceY:d.y,targetX:x.x,targetY:x.y,sourcePosition:a,targetPosition:c}}function el(e){if(!e)return null;const t=[],n=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&n.push(s);return{source:t,target:n}}function Ln(e,t,n=Q.Left,s=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:l,height:a}=t??ut(e);if(s)return{x:r+l/2,y:i+a/2};switch(t?.position??n){case Q.Top:return{x:r+l/2,y:i};case Q.Right:return{x:r+l,y:i+a/2};case Q.Bottom:return{x:r+l/2,y:i+a};case Q.Left:return{x:r,y:i+a/2}}}function tl(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Zo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function Wy(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((l,a)=>([a.markerStart||s,a.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const d=Zo(c,t);i.has(d)||(l.push({id:d,color:c.color||n,...c}),i.add(d))}}),l),[]).sort((l,a)=>l.id.localeCompare(a.id))}const Xr={nodeOrigin:[0,0],nodeExtent:_n,elevateNodesOnSelect:!0,defaults:{}},Gy={...Xr,checkEquality:!0};function qr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Uy(e,t,n){const s=qr(Xr,n);for(const r of e.values())if(r.parentId)Qr(r,e,t,s);else{const i=Dn(r,s.nodeOrigin),l=nn(r.extent)?r.extent:s.nodeExtent,a=Tt(i,l,ut(r));r.internals.positionAbsolute=a}}function Ko(e,t,n,s){const r=qr(Gy,s);let i=e.length>0;const l=new Map(t),a=r?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let d=l.get(c.id);if(r.checkEquality&&c===d?.internals.userNode)t.set(c.id,d);else{const x=Dn(c,r.nodeOrigin),p=nn(c.extent)?c.extent:r.nodeExtent,m=Tt(x,p,ut(c));d={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:m,handleBounds:c.measured?d?.internals.handleBounds:void 0,z:ud(c,a),userNode:c}},t.set(c.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(i=!1),c.parentId&&Qr(d,t,n,s)}return i}function Xy(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Qr(e,t,n,s){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:l}=qr(Xr,s),a=e.parentId,c=t.get(a);if(!c){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Xy(e,n);const d=r?1e3:0,{x,y:p,z:m}=qy(e,c,i,l,d),{positionAbsolute:h}=e.internals,g=x!==h.x||p!==h.y;(g||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x,y:p}:h,z:m}})}function ud(e,t){return(Ge(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function qy(e,t,n,s,r){const{x:i,y:l}=t.internals.positionAbsolute,a=ut(e),c=Dn(e,n),d=nn(e.extent)?Tt(c,e.extent,a):c;let x=Tt({x:i+d.x,y:l+d.y},s,a);e.extent==="parent"&&(x=Xu(x,a,t));const p=ud(e,r),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>=p?m+1:p}}function Jr(e,t,n,s=[0,0]){const r=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const c=i.get(l.parentId)?.expandedRect??tn(a),d=Qu(c,l.rect);i.set(l.parentId,{expandedRect:d,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},c)=>{const d=a.internals.positionAbsolute,x=ut(a),p=a.origin??s,m=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,h=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,g=Math.max(x.width,Math.round(l.width)),E=Math.max(x.height,Math.round(l.height)),S=(g-x.width)*p[0],R=(E-x.height)*p[1];(m>0||h>0||S||R)&&(r.push({id:c,type:"position",position:{x:a.position.x-m+S,y:a.position.y-h+R}}),n.get(c)?.forEach(v=>{e.some(y=>y.id===v.id)||r.push({id:v.id,type:"position",position:{x:v.position.x+m,y:v.position.y+h}})})),(x.width<l.width||x.height<l.height||m||h)&&r.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:g+(m?p[0]*m-S:0),height:E+(h?p[1]*h-R:0)}})}),r}function Qy(e,t,n,s,r,i){const l=s?.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const c=[],d=window.getComputedStyle(l),{m22:x}=new window.DOMMatrixReadOnly(d.transform),p=[];for(const m of e.values()){const h=t.get(m.id);if(!h)continue;if(h.hidden){t.set(h.id,{...h,internals:{...h.internals,handleBounds:void 0}}),a=!0;continue}const g=Ur(m.nodeElement),E=h.measured.width!==g.width||h.measured.height!==g.height;if(!!(g.width&&g.height&&(E||!h.internals.handleBounds||m.force))){const R=m.nodeElement.getBoundingClientRect(),v=nn(h.extent)?h.extent:i;let{positionAbsolute:y}=h.internals;h.parentId&&h.extent==="parent"?y=Xu(y,g,t.get(h.parentId)):v&&(y=Tt(y,v,g));const C={...h,measured:g,internals:{...h.internals,positionAbsolute:y,handleBounds:{source:Ui("source",m.nodeElement,R,x,h.id),target:Ui("target",m.nodeElement,R,x,h.id)}}};t.set(h.id,C),h.parentId&&Qr(C,t,n,{nodeOrigin:r}),a=!0,E&&(c.push({id:h.id,type:"dimensions",dimensions:g}),h.expandParent&&h.parentId&&p.push({id:h.id,parentId:h.parentId,rect:tn(C,r)}))}}if(p.length>0){const m=Jr(p,t,n,r);c.push(...m)}return{changes:c,updatedInternals:a}}async function Jy({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],s),a=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(a)}function nl(e,t,n,s,r,i){let l=r;const a=s.get(l)||new Map;s.set(l,a.set(n,t)),l=`${r}-${e}`;const c=s.get(l)||new Map;if(s.set(l,c.set(n,t)),i){l=`${r}-${e}-${i}`;const d=s.get(l)||new Map;s.set(l,d.set(n,t))}}function dd(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:l=null,targetHandle:a=null}=s,c={edgeId:s.id,source:r,target:i,sourceHandle:l,targetHandle:a},d=`${r}-${l}--${i}-${a}`,x=`${i}-${a}--${r}-${l}`;nl("source",c,x,e,r,l),nl("target",c,d,e,i,a),t.set(s.id,s)}}function xd(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:xd(n,t):!1}function sl(e,t,n){let s=e;do{if(s?.matches?.(t))return!0;if(s===n)return!1;s=s?.parentElement}while(s);return!1}function eS(e,t,n,s){const r=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!xd(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function po({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){const r=[];for(const[l,a]of t){const c=n.get(l)?.internals.userNode;c&&r.push({...c,position:a.position,dragging:s})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:s}:r[0],r]}function tS({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},l=0,a=new Map,c=!1,d={x:0,y:0},x=null,p=!1,m=null,h=!1,g=!1;function E({noDragClassName:R,handleSelector:v,domNode:y,isSelectable:C,nodeId:_,nodeClickDistance:k=0}){m=ze(y);function T({x:z,y:N},$){const{nodeLookup:w,nodeExtent:L,snapGrid:M,snapToGrid:D,nodeOrigin:H,onNodeDrag:V,onSelectionDrag:Z,onError:K,updateNodePositions:q}=t();i={x:z,y:N};let ne=!1,J={x:0,y:0,x2:0,y2:0};if(a.size>1&&L){const oe=Bn(a);J=Fo(oe)}for(const[oe,se]of a){if(!w.has(oe))continue;let re={x:z-se.distance.x,y:N-se.distance.y};D&&(re=Fs(re,M));let ee=[[L[0][0],L[0][1]],[L[1][0],L[1][1]]];if(a.size>1&&L&&!se.extent){const{positionAbsolute:Se}=se.internals,ue=Se.x-J.x+L[0][0],me=Se.x+se.measured.width-J.x2+L[1][0],U=Se.y-J.y+L[0][1],de=Se.y+se.measured.height-J.y2+L[1][1];ee=[[ue,U],[me,de]]}const{position:ie,positionAbsolute:ye}=Uu({nodeId:oe,nextPosition:re,nodeLookup:w,nodeExtent:ee,nodeOrigin:H,onError:K});ne=ne||se.position.x!==ie.x||se.position.y!==ie.y,se.position=ie,se.internals.positionAbsolute=ye}if(g=g||ne,!!ne&&(q(a,!0),$&&(s||V||!_&&Z))){const[oe,se]=po({nodeId:_,dragItems:a,nodeLookup:w});s?.($,a,oe,se),V?.($,oe,se),_||Z?.($,se)}}async function O(){if(!x)return;const{transform:z,panBy:N,autoPanSpeed:$,autoPanOnNodeDrag:w}=t();if(!w){c=!1,cancelAnimationFrame(l);return}const[L,M]=qu(d,x,$);(L!==0||M!==0)&&(i.x=(i.x??0)-L/z[2],i.y=(i.y??0)-M/z[2],await N({x:L,y:M})&&T(i,null)),l=requestAnimationFrame(O)}function B(z){const{nodeLookup:N,multiSelectionActive:$,nodesDraggable:w,transform:L,snapGrid:M,snapToGrid:D,selectNodesOnDrag:H,onNodeDragStart:V,onSelectionDragStart:Z,unselectNodesAndEdges:K}=t();p=!0,(!H||!C)&&!$&&_&&(N.get(_)?.selected||K()),C&&H&&_&&e?.(_);const q=yn(z.sourceEvent,{transform:L,snapGrid:M,snapToGrid:D,containerBounds:x});if(i=q,a=eS(N,w,q,_),a.size>0&&(n||V||!_&&Z)){const[ne,J]=po({nodeId:_,dragItems:a,nodeLookup:N});n?.(z.sourceEvent,a,ne,J),V?.(z.sourceEvent,ne,J),_||Z?.(z.sourceEvent,J)}}const F=Iu().clickDistance(k).on("start",z=>{const{domNode:N,nodeDragThreshold:$,transform:w,snapGrid:L,snapToGrid:M}=t();x=N?.getBoundingClientRect()||null,h=!1,g=!1,$===0&&B(z),i=yn(z.sourceEvent,{transform:w,snapGrid:L,snapToGrid:M,containerBounds:x}),d=et(z.sourceEvent,x)}).on("drag",z=>{const{autoPanOnNodeDrag:N,transform:$,snapGrid:w,snapToGrid:L,nodeDragThreshold:M,nodeLookup:D}=t(),H=yn(z.sourceEvent,{transform:$,snapGrid:w,snapToGrid:L,containerBounds:x});if((z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||_&&!D.has(_))&&(h=!0),!h){if(!c&&N&&p&&(c=!0,O()),!p){const V=H.xSnapped-(i.x??0),Z=H.ySnapped-(i.y??0);Math.sqrt(V*V+Z*Z)>M&&B(z)}(i.x!==H.xSnapped||i.y!==H.ySnapped)&&a&&p&&(d=et(z.sourceEvent,x),T(H,z.sourceEvent))}}).on("end",z=>{if(!(!p||h)&&(c=!1,p=!1,cancelAnimationFrame(l),a.size>0)){const{nodeLookup:N,updateNodePositions:$,onNodeDragStop:w,onSelectionDragStop:L}=t();if(g&&($(a,!1),g=!1),r||w||!_&&L){const[M,D]=po({nodeId:_,dragItems:a,nodeLookup:N,dragging:!1});r?.(z.sourceEvent,a,M,D),w?.(z.sourceEvent,M,D),_||L?.(z.sourceEvent,D)}}}).filter(z=>{const N=z.target;return!z.button&&(!R||!sl(N,`.${R}`,y))&&(!v||sl(N,v,y))});m.call(F)}function S(){m?.on(".drag",null)}return{update:E,destroy:S}}function nS(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())kn(r,tn(i))>0&&s.push(i);return s}const sS=250;function oS(e,t,n,s){let r=[],i=1/0;const l=nS(e,n,t+sS);for(const a of l){const c=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const d of c){if(s.nodeId===d.nodeId&&s.type===d.type&&s.id===d.id)continue;const{x,y:p}=Ln(a,d,d.position,!0),m=Math.sqrt(Math.pow(x-e.x,2)+Math.pow(p-e.y,2));m>t||(m<i?(r=[{...d,x,y:p}],i=m):m===i&&r.push({...d,x,y:p}))}}if(!r.length)return null;if(r.length>1){const a=s.type==="source"?"target":"source";return r.find(c=>c.type===a)??r[0]}return r[0]}function pd(e,t,n,s,r,i=!1){const l=s.get(e);if(!l)return null;const a=r==="strict"?l.internals.handleBounds?.[t]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],c=(n?a?.find(d=>d.id===n):a?.[0])??null;return c&&i?{...c,...Ln(l,c,c.position,!0)}:c}function md(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function rS(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const fd=()=>!0;function iS(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:l,domNode:a,nodeLookup:c,lib:d,autoPanOnConnect:x,flowId:p,panBy:m,cancelConnection:h,onConnectStart:g,onConnect:E,onConnectEnd:S,isValidConnection:R=fd,onReconnectEnd:v,updateConnection:y,getTransform:C,getFromHandle:_,autoPanSpeed:k,dragThreshold:T=1}){const O=td(e.target);let B=0,F;const{x:z,y:N}=et(e),$=O?.elementFromPoint(z,N),w=md(i,$),L=a?.getBoundingClientRect();let M=!1;if(!L||!w)return;const D=pd(r,w,s,c,t);if(!D)return;let H=et(e,L),V=!1,Z=null,K=!1,q=null;function ne(){if(!x||!L)return;const[Se,ue]=qu(H,L,k);m({x:Se,y:ue}),B=requestAnimationFrame(ne)}const J={...D,nodeId:r,type:w,position:D.position},oe=c.get(r);let re={inProgress:!0,isValid:null,from:Ln(oe,J,Q.Left,!0),fromHandle:J,fromPosition:J.position,fromNode:oe,to:H,toHandle:null,toPosition:Ki[J.position],toNode:null};function ee(){M=!0,y(re),g?.(e,{nodeId:r,handleId:s,handleType:w})}T===0&&ee();function ie(Se){if(!M){const{x:de,y:be}=et(Se),Te=de-z,Je=be-N;if(!(Te*Te+Je*Je>T*T))return;ee()}if(!_()||!J){ye(Se);return}const ue=C();H=et(Se,L),F=oS($n(H,ue,!1,[1,1]),n,c,J),V||(ne(),V=!0);const me=hd(Se,{handle:F,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:l?"target":"source",isValidConnection:R,doc:O,lib:d,flowId:p,nodeLookup:c});q=me.handleDomNode,Z=me.connection,K=rS(!!F,me.isValid);const U={...re,isValid:K,to:me.toHandle&&K?ws({x:me.toHandle.x,y:me.toHandle.y},ue):H,toHandle:me.toHandle,toPosition:K&&me.toHandle?me.toHandle.position:Ki[J.position],toNode:me.toHandle?c.get(me.toHandle.nodeId):null};K&&F&&re.toHandle&&U.toHandle&&re.toHandle.type===U.toHandle.type&&re.toHandle.nodeId===U.toHandle.nodeId&&re.toHandle.id===U.toHandle.id&&re.to.x===U.to.x&&re.to.y===U.to.y||(y(U),re=U)}function ye(Se){if(M){(F||q)&&Z&&K&&E?.(Z);const{inProgress:ue,...me}=re,U={...me,toPosition:re.toHandle?re.toPosition:null};S?.(Se,U),i&&v?.(Se,U)}h(),cancelAnimationFrame(B),V=!1,K=!1,Z=null,q=null,O.removeEventListener("mousemove",ie),O.removeEventListener("mouseup",ye),O.removeEventListener("touchmove",ie),O.removeEventListener("touchend",ye)}O.addEventListener("mousemove",ie),O.addEventListener("mouseup",ye),O.addEventListener("touchmove",ie),O.addEventListener("touchend",ye)}function hd(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:l,lib:a,flowId:c,isValidConnection:d=fd,nodeLookup:x}){const p=i==="target",m=t?l.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:g}=et(e),E=l.elementFromPoint(h,g),S=E?.classList.contains(`${a}-flow__handle`)?E:m,R={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const v=md(void 0,S),y=S.getAttribute("data-nodeid"),C=S.getAttribute("data-handleid"),_=S.classList.contains("connectable"),k=S.classList.contains("connectableend");if(!y||!v)return R;const T={source:p?y:s,sourceHandle:p?C:r,target:p?s:y,targetHandle:p?r:C};R.connection=T;const B=_&&k&&(n===Nt.Strict?p&&v==="source"||!p&&v==="target":y!==s||C!==r);R.isValid=B&&d(T),R.toHandle=pd(y,v,C,x,n,!0)}return R}const Yo={onPointerDown:iS,isValid:hd};function lS({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=ze(e);function i({translateExtent:a,width:c,height:d,zoomStep:x=10,pannable:p=!0,zoomable:m=!0,inversePan:h=!1}){const g=y=>{const C=n();if(y.sourceEvent.type!=="wheel"||!t)return;const _=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*x,k=C[2]*Math.pow(2,_);t.scaleTo(k)};let E=[0,0];const S=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},R=y=>{const C=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const _=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],k=[_[0]-E[0],_[1]-E[1]];E=_;const T=s()*Math.max(C[2],Math.log(C[2]))*(h?-1:1),O={x:C[0]-k[0]*T,y:C[1]-k[1]*T},B=[[0,0],[c,d]];t.setViewportConstrained({x:O.x,y:O.y,zoom:C[2]},B,a)},v=Hu().on("start",S).on("zoom",p?R:null).on("zoom.wheel",m?g:null);r.call(v,{})}function l(){r.on("zoom",null)}return{update:i,destroy:l,pointer:We}}const aS=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Hs=e=>({x:e.x,y:e.y,zoom:e.k}),mo=({x:e,y:t,zoom:n})=>$s.translate(e,t).scale(n),Kt=(e,t)=>e.target.closest(`.${t}`),gd=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),cS=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,fo=(e,t=0,n=cS,s=()=>{})=>{const r=typeof t=="number"&&t>0;return r||s(),r?e.transition().duration(t).ease(n).on("end",s):e},jd=e=>{const t=e.ctrlKey&&bs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function uS({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:d}){return x=>{if(Kt(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const S=We(x),R=jd(x),v=p*Math.pow(2,R);s.scaleTo(n,v,S,x);return}const m=x.deltaMode===1?20:1;let h=r===bt.Vertical?0:x.deltaX*m,g=r===bt.Horizontal?0:x.deltaY*m;!bs()&&x.shiftKey&&r!==bt.Vertical&&(h=x.deltaY*m,g=0),s.translateBy(n,-(h/p)*i,-(g/p)*i,{internal:!0});const E=Hs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a?.(x,E)),e.isPanScrolling&&(c?.(x,E),e.panScrollTimeout=setTimeout(()=>{d?.(x,E),e.isPanScrolling=!1},150))}}function dS({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){const i=s.type==="wheel",l=!t&&i&&!s.ctrlKey,a=Kt(s,e);if(s.ctrlKey&&i&&a&&s.preventDefault(),l||a)return null;s.preventDefault(),n.call(this,s,r)}}function xS({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{if(s.sourceEvent?.internal)return;const r=Hs(s.transform);e.mouseButton=s.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,s.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(s.sourceEvent,r)}}function pS({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&gd(t,e.mouseButton??0)),i.sourceEvent?.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,Hs(i.transform))}}function mS({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return l=>{if(!l.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&gd(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),r&&aS(e.prevViewport,l.transform))){const a=Hs(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(l.sourceEvent,a)},n?150:0)}}}function fS({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:a,noPanClassName:c,lib:d}){return x=>{const p=e||t,m=n&&x.ctrlKey;if(x.button===1&&x.type==="mousedown"&&(Kt(x,`${d}-flow__node`)||Kt(x,`${d}-flow__edge`)))return!0;if(!s&&!p&&!r&&!i&&!n||l||Kt(x,a)&&x.type==="wheel"||Kt(x,c)&&(x.type!=="wheel"||r&&x.type==="wheel"&&!e)||!n&&x.ctrlKey&&x.type==="wheel")return!1;if(!n&&x.type==="touchstart"&&x.touches?.length>1)return x.preventDefault(),!1;if(!p&&!r&&!m&&x.type==="wheel"||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const h=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||x.type==="wheel")&&h}}function hS({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:r,viewport:i,onPanZoom:l,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:d}){const x={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),m=Hu().clickDistance(!Ge(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(r),h=ze(e).call(m);y({x:i.x,y:i.y,zoom:en(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const g=h.on("wheel.zoom"),E=h.on("dblclick.zoom");m.wheelDelta(jd);function S(N,$){return h?new Promise(w=>{m?.interpolate($?.interpolate==="linear"?I.interpolate:os).transform(fo(h,$?.duration,$?.ease,()=>w(!0)),N)}):Promise.resolve(!1)}function R({noWheelClassName:N,noPanClassName:$,onPaneContextMenu:w,userSelectionActive:L,panOnScroll:M,panOnDrag:D,panOnScrollMode:H,panOnScrollSpeed:V,preventScrolling:Z,zoomOnPinch:K,zoomOnScroll:q,zoomOnDoubleClick:ne,zoomActivationKeyPressed:J,lib:oe,onTransformChange:se}){L&&!x.isZoomingOrPanning&&v();const ee=M&&!J&&!L?uS({zoomPanValues:x,noWheelClassName:N,d3Selection:h,d3Zoom:m,panOnScrollMode:H,panOnScrollSpeed:V,zoomOnPinch:K,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}):dS({noWheelClassName:N,preventScrolling:Z,d3ZoomHandler:g});if(h.on("wheel.zoom",ee,{passive:!1}),!L){const ye=xS({zoomPanValues:x,onDraggingChange:d,onPanZoomStart:a});m.on("start",ye);const Se=pS({zoomPanValues:x,panOnDrag:D,onPaneContextMenu:!!w,onPanZoom:l,onTransformChange:se});m.on("zoom",Se);const ue=mS({zoomPanValues:x,panOnDrag:D,panOnScroll:M,onPaneContextMenu:w,onPanZoomEnd:c,onDraggingChange:d});m.on("end",ue)}const ie=fS({zoomActivationKeyPressed:J,panOnDrag:D,zoomOnScroll:q,panOnScroll:M,zoomOnDoubleClick:ne,zoomOnPinch:K,userSelectionActive:L,noPanClassName:$,noWheelClassName:N,lib:oe});m.filter(ie),ne?h.on("dblclick.zoom",E):h.on("dblclick.zoom",null)}function v(){m.on("zoom",null)}async function y(N,$,w){const L=mo(N),M=m?.constrain()(L,$,w);return M&&await S(M),new Promise(D=>D(M))}async function C(N,$){const w=mo(N);return await S(w,$),new Promise(L=>L(w))}function _(N){if(h){const $=mo(N),w=h.property("__zoom");(w.k!==N.zoom||w.x!==N.x||w.y!==N.y)&&m?.transform(h,$,null,{sync:!0})}}function k(){const N=h?Fu(h.node()):{x:0,y:0,k:1};return{x:N.x,y:N.y,zoom:N.k}}function T(N,$){return h?new Promise(w=>{m?.interpolate($?.interpolate==="linear"?I.interpolate:os).scaleTo(fo(h,$?.duration,$?.ease,()=>w(!0)),N)}):Promise.resolve(!1)}function O(N,$){return h?new Promise(w=>{m?.interpolate($?.interpolate==="linear"?I.interpolate:os).scaleBy(fo(h,$?.duration,$?.ease,()=>w(!0)),N)}):Promise.resolve(!1)}function B(N){m?.scaleExtent(N)}function F(N){m?.translateExtent(N)}function z(N){const $=!Ge(N)||N<0?0:N;m?.clickDistance($)}return{update:R,destroy:v,setViewport:C,setViewportConstrained:y,getViewport:k,scaleTo:T,scaleBy:O,setScaleExtent:B,setTranslateExtent:F,syncViewport:_,setClickDistance:z}}var sn;(function(e){e.Line="line",e.Handle="handle"})(sn||(sn={}));function gS({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const l=e-t,a=n-s,c=[l>0?1:l<0?-1:0,a>0?1:a<0?-1:0];return l&&r&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function jS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function xt(e,t){return Math.max(0,t-e)}function pt(e,t){return Math.max(0,e-t)}function Qn(e,t,n){return Math.max(0,t-e,e-n)}function ol(e,t){return e?!t:t}function ES(e,t,n,s,r,i,l,a){let{affectsX:c,affectsY:d}=t;const{isHorizontal:x,isVertical:p}=t,m=x&&p,{xSnapped:h,ySnapped:g}=n,{minWidth:E,maxWidth:S,minHeight:R,maxHeight:v}=s,{x:y,y:C,width:_,height:k,aspectRatio:T}=e;let O=Math.floor(x?h-e.pointerX:0),B=Math.floor(p?g-e.pointerY:0);const F=_+(c?-O:O),z=k+(d?-B:B),N=-i[0]*_,$=-i[1]*k;let w=Qn(F,E,S),L=Qn(z,R,v);if(l){let H=0,V=0;c&&O<0?H=xt(y+O+N,l[0][0]):!c&&O>0&&(H=pt(y+F+N,l[1][0])),d&&B<0?V=xt(C+B+$,l[0][1]):!d&&B>0&&(V=pt(C+z+$,l[1][1])),w=Math.max(w,H),L=Math.max(L,V)}if(a){let H=0,V=0;c&&O>0?H=pt(y+O,a[0][0]):!c&&O<0&&(H=xt(y+F,a[1][0])),d&&B>0?V=pt(C+B,a[0][1]):!d&&B<0&&(V=xt(C+z,a[1][1])),w=Math.max(w,H),L=Math.max(L,V)}if(r){if(x){const H=Qn(F/T,R,v)*T;if(w=Math.max(w,H),l){let V=0;!c&&!d||c&&!d&&m?V=pt(C+$+F/T,l[1][1])*T:V=xt(C+$+(c?O:-O)/T,l[0][1])*T,w=Math.max(w,V)}if(a){let V=0;!c&&!d||c&&!d&&m?V=xt(C+F/T,a[1][1])*T:V=pt(C+(c?O:-O)/T,a[0][1])*T,w=Math.max(w,V)}}if(p){const H=Qn(z*T,E,S)/T;if(L=Math.max(L,H),l){let V=0;!c&&!d||d&&!c&&m?V=pt(y+z*T+N,l[1][0])/T:V=xt(y+(d?B:-B)*T+N,l[0][0])/T,L=Math.max(L,V)}if(a){let V=0;!c&&!d||d&&!c&&m?V=xt(y+z*T,a[1][0])/T:V=pt(y+(d?B:-B)*T,a[0][0])/T,L=Math.max(L,V)}}}B=B+(B<0?L:-L),O=O+(O<0?w:-w),r&&(m?F>z*T?B=(ol(c,d)?-O:O)/T:O=(ol(c,d)?-B:B)*T:x?(B=O/T,d=c):(O=B*T,c=d));const M=c?y+O:y,D=d?C+B:C;return{width:_+(c?-O:O),height:k+(d?-B:B),x:i[0]*O*(c?-1:1)+M,y:i[1]*B*(d?-1:1)+D}}const Ed={width:0,height:0,x:0,y:0},yS={...Ed,pointerX:0,pointerY:0,aspectRatio:1};function SS(e){return[[0,0],[e.measured.width,e.measured.height]]}function RS(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,a=n[0]*i,c=n[1]*l;return[[s-a,r-c],[s+i-a,r+l-c]]}function CS({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=ze(e);function l({controlPosition:c,boundaries:d,keepAspectRatio:x,resizeDirection:p,onResizeStart:m,onResize:h,onResizeEnd:g,shouldResize:E}){let S={...Ed},R={...yS};const v=jS(c);let y,C=null,_=[],k,T,O;const B=Iu().on("start",F=>{const{nodeLookup:z,transform:N,snapGrid:$,snapToGrid:w,nodeOrigin:L,paneDomNode:M}=n();if(y=z.get(t),!y)return;C=M?.getBoundingClientRect()??null;const{xSnapped:D,ySnapped:H}=yn(F.sourceEvent,{transform:N,snapGrid:$,snapToGrid:w,containerBounds:C});S={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},R={...S,pointerX:D,pointerY:H,aspectRatio:S.width/S.height},k=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(k=z.get(y.parentId),T=k&&y.extent==="parent"?SS(k):void 0),_=[],O=void 0;for(const[V,Z]of z)if(Z.parentId===t&&(_.push({id:V,position:{...Z.position},extent:Z.extent}),Z.extent==="parent"||Z.expandParent)){const K=RS(Z,y,Z.origin??L);O?O=[[Math.min(K[0][0],O[0][0]),Math.min(K[0][1],O[0][1])],[Math.max(K[1][0],O[1][0]),Math.max(K[1][1],O[1][1])]]:O=K}m?.(F,{...S})}).on("drag",F=>{const{transform:z,snapGrid:N,snapToGrid:$,nodeOrigin:w}=n(),L=yn(F.sourceEvent,{transform:z,snapGrid:N,snapToGrid:$,containerBounds:C}),M=[];if(!y)return;const{x:D,y:H,width:V,height:Z}=S,K={},q=y.origin??w,{width:ne,height:J,x:oe,y:se}=ES(R,v,L,d,x,q,T,O),re=ne!==V,ee=J!==Z,ie=oe!==D&&re,ye=se!==H&ⅇif(!ie&&!ye&&!re&&!ee)return;if((ie||ye||q[0]===1||q[1]===1)&&(K.x=ie?oe:S.x,K.y=ye?se:S.y,S.x=K.x,S.y=K.y,_.length>0)){const U=oe-D,de=se-H;for(const be of _)be.position={x:be.position.x-U+q[0]*(ne-V),y:be.position.y-de+q[1]*(J-Z)},M.push(be)}if((re||ee)&&(K.width=re&&(!p||p==="horizontal")?ne:S.width,K.height=ee&&(!p||p==="vertical")?J:S.height,S.width=K.width,S.height=K.height),k&&y.expandParent){const U=q[0]*(K.width??0);K.x&&K.x<U&&(S.x=U,R.x=R.x-(K.x-U));const de=q[1]*(K.height??0);K.y&&K.y<de&&(S.y=de,R.y=R.y-(K.y-de))}const Se=gS({width:S.width,prevWidth:V,height:S.height,prevHeight:Z,affectsX:v.affectsX,affectsY:v.affectsY}),ue={...S,direction:Se};E?.(F,ue)!==!1&&(h?.(F,ue),s(K,M))}).on("end",F=>{g?.(F,{...S}),r?.({...S})});i.call(B)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var Jn={exports:{}},ho={},es={exports:{}},go={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var rl;function wS(){if(rl)return go;rl=1;var e=j;function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function a(p,m){var h=m(),g=s({inst:{value:h,getSnapshot:m}}),E=g[0].inst,S=g[1];return i(function(){E.value=h,E.getSnapshot=m,c(E)&&S({inst:E})},[p,h,m]),r(function(){return c(E)&&S({inst:E}),p(function(){c(E)&&S({inst:E})})},[p]),l(h),h}function c(p){var m=p.getSnapshot;p=p.value;try{var h=m();return!n(p,h)}catch{return!0}}function d(p,m){return m()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:a;return go.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,go}var jo={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* use-sync-external-store-shim.development.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var il;function bS(){return il||(il=1,process.env.NODE_ENV!=="production"&&function(){function e(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}function t(h,g){x||r.startTransition===void 0||(x=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=g();if(!p){var S=g();i(E,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}S=l({inst:{value:E,getSnapshot:g}});var R=S[0].inst,v=S[1];return c(function(){R.value=E,R.getSnapshot=g,n(R)&&v({inst:R})},[h,E,g]),a(function(){return n(R)&&v({inst:R}),h(function(){n(R)&&v({inst:R})})},[h]),d(E),E}function n(h){var g=h.getSnapshot;h=h.value;try{var E=g();return!i(h,E)}catch{return!0}}function s(h,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=j,i=typeof Object.is=="function"?Object.is:e,l=r.useState,a=r.useEffect,c=r.useLayoutEffect,d=r.useDebugValue,x=!1,p=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;jo.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),jo}var ll;function yd(){return ll||(ll=1,process.env.NODE_ENV==="production"?es.exports=wS():es.exports=bS()),es.exports}/**
|
|
18
18
|
* @license React
|
|
19
19
|
* use-sync-external-store-shim/with-selector.production.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var
|
|
25
|
+
*/var al;function vS(){if(al)return ho;al=1;var e=j,t=yd();function n(d,x){return d===x&&(d!==0||1/d===1/x)||d!==d&&x!==x}var s=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,a=e.useMemo,c=e.useDebugValue;return ho.useSyncExternalStoreWithSelector=function(d,x,p,m,h){var g=i(null);if(g.current===null){var E={hasValue:!1,value:null};g.current=E}else E=g.current;g=a(function(){function R(k){if(!v){if(v=!0,y=k,k=m(k),h!==void 0&&E.hasValue){var T=E.value;if(h(T,k))return C=T}return C=k}if(T=C,s(y,k))return T;var O=m(k);return h!==void 0&&h(T,O)?(y=k,T):(y=k,C=O)}var v=!1,y,C,_=p===void 0?null:p;return[function(){return R(x())},_===null?void 0:function(){return R(_())}]},[x,p,m,h]);var S=r(d,g[0],g[1]);return l(function(){E.hasValue=!0,E.value=S},[S]),c(S),S},ho}var Eo={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* use-sync-external-store-shim/with-selector.development.js
|
|
28
28
|
*
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var cl;function _S(){return cl||(cl=1,process.env.NODE_ENV!=="production"&&function(){function e(d,x){return d===x&&(d!==0||1/d===1/x)||d!==d&&x!==x}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=j,n=yd(),s=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,i=t.useRef,l=t.useEffect,a=t.useMemo,c=t.useDebugValue;Eo.useSyncExternalStoreWithSelector=function(d,x,p,m,h){var g=i(null);if(g.current===null){var E={hasValue:!1,value:null};g.current=E}else E=g.current;g=a(function(){function R(k){if(!v){if(v=!0,y=k,k=m(k),h!==void 0&&E.hasValue){var T=E.value;if(h(T,k))return C=T}return C=k}if(T=C,s(y,k))return T;var O=m(k);return h!==void 0&&h(T,O)?(y=k,T):(y=k,C=O)}var v=!1,y,C,_=p===void 0?null:p;return[function(){return R(x())},_===null?void 0:function(){return R(_())}]},[x,p,m,h]);var S=r(d,g[0],g[1]);return l(function(){E.hasValue=!0,E.value=S},[S]),c(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Eo}var ul;function kS(){return ul||(ul=1,process.env.NODE_ENV==="production"?Jn.exports=vS():Jn.exports=_S()),Jn.exports}var LS=kS();const MS=f.getDefaultExportFromCjs(LS),PS={},dl=e=>{let t;const n=new Set,s=(x,p)=>{const m=typeof x=="function"?x(t):x;if(!Object.is(m,t)){const h=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(g=>g(t,h))}},r=()=>t,c={setState:s,getState:r,getInitialState:()=>d,subscribe:x=>(n.add(x),()=>n.delete(x)),destroy:()=>{(PS?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},d=t=e(s,r,c);return c},NS=e=>e?dl(e):dl,{useDebugValue:TS}=j,{useSyncExternalStoreWithSelector:IS}=MS,AS=e=>e;function Sd(e,t=AS,n){const s=IS(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return TS(s),s}const xl=(e,t)=>{const n=NS(e),s=(r,i=t)=>Sd(n,r,i);return Object.assign(s,n),s},OS=(e,t)=>e?xl(e,t):xl;function _e(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const Zs=j.createContext(null),DS=Zs.Provider,Rd=Ae.error001();function je(e,t){const n=j.useContext(Zs);if(n===null)throw new Error(Rd);return Sd(n,e,t)}function ve(){const e=j.useContext(Zs);if(e===null)throw new Error(Rd);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const pl={display:"none"},BS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Cd="react-flow__node-desc",wd="react-flow__edge-desc",$S="react-flow__aria-live",zS=e=>e.ariaLiveMessage,VS=e=>e.ariaLabelConfig;function FS({rfId:e}){const t=je(zS);return o.jsxRuntimeExports.jsx("div",{id:`${$S}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:BS,children:t})}function HS({rfId:e,disableKeyboardA11y:t}){const n=je(VS);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{id:`${Cd}-${e}`,style:pl,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsxRuntimeExports.jsx("div",{id:`${wd}-${e}`,style:pl,children:n["edge.a11yDescription.default"]}),!t&&o.jsxRuntimeExports.jsx(FS,{rfId:e})]})}const Ks=j.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const l=`${e}`.split("-");return o.jsxRuntimeExports.jsx("div",{className:Le(["react-flow__panel",n,...l]),style:s,ref:i,...r,children:t})});Ks.displayName="Panel";function ZS({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:o.jsxRuntimeExports.jsx(Ks,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:o.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const KS=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},ts=e=>e.id;function YS(e,t){return _e(e.selectedNodes.map(ts),t.selectedNodes.map(ts))&&_e(e.selectedEdges.map(ts),t.selectedEdges.map(ts))}function WS({onSelectionChange:e}){const t=ve(),{selectedNodes:n,selectedEdges:s}=je(KS,YS);return j.useEffect(()=>{const r={nodes:n,edges:s};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const GS=e=>!!e.onSelectionChangeHandlers;function US({onSelectionChange:e}){const t=je(GS);return e||t?o.jsxRuntimeExports.jsx(WS,{onSelectionChange:e}):null}const bd=[0,0],XS={x:0,y:0,zoom:1},qS=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig"],ml=[...qS,"rfId"],QS=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),fl={translateExtent:_n,nodeOrigin:bd,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function JS(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:l,reset:a,setDefaultNodesAndEdges:c,setPaneClickDistance:d}=je(QS,_e),x=ve();j.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=fl,a()}),[]);const p=j.useRef(fl);return j.useEffect(()=>{for(const m of ml){const h=e[m],g=p.current[m];h!==g&&(typeof e[m]>"u"||(m==="nodes"?t(h):m==="edges"?n(h):m==="minZoom"?s(h):m==="maxZoom"?r(h):m==="translateExtent"?i(h):m==="nodeExtent"?l(h):m==="paneClickDistance"?d(h):m==="ariaLabelConfig"?x.setState({ariaLabelConfig:Dy(h)}):m==="fitView"?x.setState({fitViewQueued:h}):m==="fitViewOptions"?x.setState({fitViewOptions:h}):x.setState({[m]:h})))}p.current=e},ml.map(m=>e[m])),null}function hl(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function e4(e){const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const s=hl(),r=()=>n(s?.matches?"dark":"light");return r(),s?.addEventListener("change",r),()=>{s?.removeEventListener("change",r)}},[e]),t!==null?t:hl()?.matches?"dark":"light"}const gl=typeof document<"u"?document:null;function Mn(e=null,t={target:gl,actInsideInputWithModifier:!0}){const[n,s]=j.useState(!1),r=j.useRef(!1),i=j.useRef(new Set([])),[l,a]=j.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
|
|
34
34
|
`).replace(`
|
|
35
35
|
|
|
36
36
|
`,`
|
|
37
37
|
+`).split(`
|
|
38
|
-
`)),x=d.reduce((p,m)=>p.concat(...m),[]);return[d,x]}return[[],[]]},[e]);return j.useEffect(()=>{const c=t?.target??fl,d=t?.actInsideInputWithModifier??!0;if(e!==null){const x=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!d)&&Ju(h))return!1;const E=gl(h.code,a);if(i.current.add(h[E]),hl(l,i.current,!1)){const S=h.composedPath?.()?.[0]||h.target,R=S?.nodeName==="BUTTON"||S?.nodeName==="A";t.preventDefault!==!1&&(r.current||!R)&&h.preventDefault(),s(!0)}},p=h=>{const g=gl(h.code,a);hl(l,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),r.current=!1},m=()=>{i.current.clear(),s(!1)};return c?.addEventListener("keydown",x),c?.addEventListener("keyup",p),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c?.removeEventListener("keydown",x),c?.removeEventListener("keyup",p),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,s]),n}function hl(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function gl(e,t){return t.includes(e)?"code":"key"}const US=()=>{const e=ve();return j.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:l,panZoom:a}=e.getState(),c=Yr(t,s,r,i,l,n?.padding??.1);return a?(await a.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:l}=e.getState();if(!l)return t;const{x:a,y:c}=l.getBoundingClientRect(),d={x:t.x-a,y:t.y-c},x=n.snapGrid??r,p=n.snapToGrid??i;return Dn(d,s,p,x)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),l=Ss(t,n);return{x:l.x+r,y:l.y+i}}}),[])};function Cd(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const l=s.get(i.id);l?l.push(i):s.set(i.id,[i])}for(const i of t){const l=s.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const a={...i};for(const c of l)XS(c,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function XS(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??={},t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function wd(e,t){return Cd(e,t)}function bd(e,t){return Cd(e,t)}function Rt(e,t){return{id:e,type:"select",selected:t}}function Ht(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const l=t.has(r);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),s.push(Rt(i.id,l)))}return s}function jl({items:e=[],lookup:t}){const n=[],s=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const l=t.get(i.id),a=l?.internals?.userNode??l;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)s.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function El(e){return{id:e.id,type:"remove"}}const yl=e=>Ry(e),qS=e=>Ku(e);function vd(e){return j.forwardRef(e)}const QS=typeof window<"u"?j.useLayoutEffect:j.useEffect;function Sl(e){const[t,n]=j.useState(BigInt(0)),[s]=j.useState(()=>JS(()=>n(r=>r+BigInt(1))));return QS(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function JS(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const _d=j.createContext(null);function e4({children:e}){const t=ve(),n=j.useCallback(a=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:x,onNodesChange:p,nodeLookup:m,fitViewQueued:h}=t.getState();let g=c;for(const S of a)g=typeof S=="function"?S(g):S;const E=jl({items:g,lookup:m});x&&d(g),E.length>0?p?.(E):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:R,setNodes:_}=t.getState();S&&_(R)})},[]),s=Sl(n),r=j.useCallback(a=>{const{edges:c=[],setEdges:d,hasDefaultEdges:x,onEdgesChange:p,edgeLookup:m}=t.getState();let h=c;for(const g of a)h=typeof g=="function"?g(h):g;x?d(h):p&&p(jl({items:h,lookup:m}))},[]),i=Sl(r),l=j.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsxRuntimeExports.jsx(_d.Provider,{value:l,children:e})}function t4(){const e=j.useContext(_d);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const n4=e=>!!e.panZoom;function At(){const e=US(),t=ve(),n=t4(),s=je(n4),r=j.useMemo(()=>{const i=p=>t.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},a=p=>{n.edgeQueue.push(p)},c=p=>{const{nodeLookup:m,nodeOrigin:h}=t.getState(),g=yl(p)?p:m.get(p.id),E=g.parentId?qu(g.position,g.measured,g.parentId,m,h):g.position,S={...g,position:E,width:g.measured?.width??g.width,height:g.measured?.height??g.height};return Xt(S)},d=(p,m,h={replace:!1})=>{l(g=>g.map(E=>{if(E.id===p){const S=typeof m=="function"?m(E):m;return h.replace&&yl(S)?S:{...E,...S}}return E}))},x=(p,m,h={replace:!1})=>{a(g=>g.map(E=>{if(E.id===p){const S=typeof m=="function"?m(E):m;return h.replace&&qS(S)?S:{...E,...S}}return E}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>i(p)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(m=>({...m}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:l,setEdges:a,addNodes:p=>{const m=Array.isArray(p)?p:[p];n.nodeQueue.push(h=>[...h,...m])},addEdges:p=>{const m=Array.isArray(p)?p:[p];n.edgeQueue.push(h=>[...h,...m])},toObject:()=>{const{nodes:p=[],edges:m=[],transform:h}=t.getState(),[g,E,S]=h;return{nodes:p.map(R=>({...R})),edges:m.map(R=>({...R})),viewport:{x:g,y:E,zoom:S}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:h,edges:g,onNodesDelete:E,onEdgesDelete:S,triggerNodeChanges:R,triggerEdgeChanges:_,onDelete:y,onBeforeDelete:C}=t.getState(),{nodes:v,edges:L}=await _y({nodesToRemove:p,edgesToRemove:m,nodes:h,edges:g,onBeforeDelete:C}),N=L.length>0,I=v.length>0;if(N){const B=L.map(El);S?.(L),_(B)}if(I){const B=v.map(El);E?.(v),R(B)}return(I||N)&&y?.({nodes:v,edges:L}),{deletedNodes:v,deletedEdges:L}},getIntersectingNodes:(p,m=!0,h)=>{const g=Ki(p),E=g?p:c(p),S=h!==void 0;return E?(h||t.getState().nodes).filter(R=>{const _=t.getState().nodeLookup.get(R.id);if(_&&!g&&(R.id===p.id||!_.internals.positionAbsolute))return!1;const y=Xt(S?R:_),C=vn(y,E);return m&&C>0||C>=E.width*E.height}):[]},isNodeIntersecting:(p,m,h=!0)=>{const E=Ki(p)?p:c(p);if(!E)return!1;const S=vn(E,m);return h&&S>0||S>=E.width*E.height},updateNode:d,updateNodeData:(p,m,h={replace:!1})=>{d(p,g=>{const E=typeof m=="function"?m(g):m;return h.replace?{...g,data:E}:{...g,data:{...g.data,...E}}},h)},updateEdge:x,updateEdgeData:(p,m,h={replace:!1})=>{x(p,g=>{const E=typeof m=="function"?m(g):m;return h.replace?{...g,data:E}:{...g,data:{...g.data,...E}}},h)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:h}=t.getState();return Cy(p,{nodeLookup:m,nodeOrigin:h})},getHandleConnections:({type:p,id:m,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${p}${m?`-${m}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:m,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${p?m?`-${p}-${m}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const m=t.getState().fitViewResolver??My();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:m}),n.nodeQueue.push(h=>[...h]),m.promise}}},[]);return j.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const Rl=e=>e.selected,s4=typeof window<"u"?window:void 0;function o4({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ve(),{deleteElements:s}=At(),r=kn(e,{actInsideInputWithModifier:!1}),i=kn(t,{target:s4});j.useEffect(()=>{if(r){const{edges:l,nodes:a}=n.getState();s({nodes:a.filter(Rl),edges:l.filter(Rl)}),n.setState({nodesSelectionActive:!1})}},[r]),j.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function r4(e){const t=ve();j.useEffect(()=>{const n=()=>{if(!e.current)return!1;const s=Wr(e.current);(s.height===0||s.width===0)&&t.getState().onError?.("004",Ie.error004()),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Fs={position:"absolute",width:"100%",height:"100%",top:0,left:0},i4=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function l4({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=wt.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:d,minZoom:x,maxZoom:p,zoomActivationKeyCode:m,preventScrolling:h=!0,children:g,noWheelClassName:E,noPanClassName:S,onViewportChange:R,isControlledViewport:_,paneClickDistance:y}){const C=ve(),v=j.useRef(null),{userSelectionActive:L,lib:N}=je(i4,_e),I=kn(m),B=j.useRef();r4(v);const z=j.useCallback(H=>{R?.({x:H[0],y:H[1],zoom:H[2]}),_||C.setState({transform:H})},[R,_]);return j.useEffect(()=>{if(v.current){B.current=uS({domNode:v.current,minZoom:x,maxZoom:p,translateExtent:d,viewport:c,paneClickDistance:y,onDraggingChange:w=>C.setState({paneDragging:w}),onPanZoomStart:(w,k)=>{const{onViewportChangeStart:M,onMoveStart:O}=C.getState();O?.(w,k),M?.(k)},onPanZoom:(w,k)=>{const{onViewportChange:M,onMove:O}=C.getState();O?.(w,k),M?.(k)},onPanZoomEnd:(w,k)=>{const{onViewportChangeEnd:M,onMoveEnd:O}=C.getState();O?.(w,k),M?.(k)}});const{x:H,y:D,zoom:V}=B.current.getViewport();return C.setState({panZoom:B.current,transform:[H,D,V],domNode:v.current.closest(".react-flow")}),()=>{B.current?.destroy()}}},[]),j.useEffect(()=>{B.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:I,preventScrolling:h,noPanClassName:S,userSelectionActive:L,noWheelClassName:E,lib:N,onTransformChange:z})},[e,t,n,s,r,i,l,a,I,h,S,L,E,N,z]),o.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:v,style:Fs,children:g})}const a4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function c4(){const{userSelectionActive:e,userSelectionRect:t}=je(a4,_e);return e&&t?o.jsxRuntimeExports.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const jo=(e,t)=>n=>{n.target===t.current&&e?.(n)},u4=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function d4({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Gt.Full,panOnDrag:s,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:l,onPaneClick:a,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:x,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){const g=ve(),{userSelectionActive:E,elementsSelectable:S,dragging:R,connectionInProgress:_}=je(u4,_e),y=S&&(e||E),C=j.useRef(null),v=j.useRef(),L=j.useRef(new Set),N=j.useRef(new Set),I=j.useRef(!1),B=j.useRef(!1),z=O=>{if(I.current||_){I.current=!1;return}a?.(O),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},H=O=>{if(Array.isArray(s)&&s?.includes(2)){O.preventDefault();return}c?.(O)},D=d?O=>d(O):void 0,V=O=>{const{resetSelectedElements:F,domNode:$}=g.getState();if(v.current=$?.getBoundingClientRect(),!S||!e||O.button!==0||O.target!==C.current||!v.current)return;O.target?.setPointerCapture?.(O.pointerId),B.current=!0,I.current=!1;const{x:Z,y:K}=et(O.nativeEvent,v.current);F(),g.setState({userSelectionRect:{width:0,height:0,startX:Z,startY:K,x:Z,y:K}}),i?.(O)},w=O=>{const{userSelectionRect:F,transform:$,nodeLookup:Z,edgeLookup:K,connectionLookup:q,triggerNodeChanges:te,triggerEdgeChanges:J,defaultEdgeOptions:oe}=g.getState();if(!v.current||!F)return;I.current=!0;const{x:ne,y:re}=et(O.nativeEvent,v.current),{startX:ee,startY:ie}=F,ye={startX:ee,startY:ie,x:ne<ee?ne:ee,y:re<ie?re:ie,width:Math.abs(ne-ee),height:Math.abs(re-ie)},Se=L.current,ue=N.current;L.current=new Set(Kr(Z,ye,$,n===Gt.Partial,!0).map(U=>U.id)),N.current=new Set;const me=oe?.selectable??!0;for(const U of L.current){const de=q.get(U);if(de)for(const{edgeId:be}of de.values()){const Te=K.get(be);Te&&(Te.selectable??me)&&N.current.add(be)}}if(!Yi(Se,L.current)){const U=Ht(Z,L.current,!0);te(U)}if(!Yi(ue,N.current)){const U=Ht(K,N.current);J(U)}g.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},k=O=>{if(O.button!==0||!B.current)return;O.target?.releasePointerCapture?.(O.pointerId);const{userSelectionRect:F}=g.getState();!E&&F&&O.target===C.current&&z?.(O),g.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:L.current.size>0}),l?.(O),(t||r)&&(I.current=!1),B.current=!1},M=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxRuntimeExports.jsxs("div",{className:Le(["react-flow__pane",{draggable:M,dragging:R,selection:e}]),onClick:y?void 0:jo(z,C),onContextMenu:jo(H,C),onWheel:jo(D,C),onPointerEnter:y?void 0:x,onPointerDown:y?V:p,onPointerMove:y?w:p,onPointerUp:y?k:void 0,onPointerLeave:m,ref:C,style:Fs,children:[h,o.jsxRuntimeExports.jsx(c4,{})]})}function Ko({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:a,onError:c}=t.getState(),d=a.get(e);if(!d){c?.("012",Ie.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):r([e])}function kd({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:l}){const a=ve(),[c,d]=j.useState(!1),x=j.useRef();return j.useEffect(()=>{x.current=Uy({getStoreItems:()=>a.getState(),onNodeMouseDown:p=>{Ko({id:p,store:a,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),j.useEffect(()=>{if(t)x.current?.destroy();else if(e.current)return x.current?.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:l}),()=>{x.current?.destroy()}},[n,s,t,i,e,r]),c}const x4=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Ld(){const e=ve();return j.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:l,onError:a,updateNodePositions:c,nodeLookup:d,nodeOrigin:x}=e.getState(),p=new Map,m=x4(l),h=r?i[0]:5,g=r?i[1]:5,E=n.direction.x*h*n.factor,S=n.direction.y*g*n.factor;for(const[,R]of d){if(!m(R))continue;let _={x:R.internals.positionAbsolute.x+E,y:R.internals.positionAbsolute.y+S};r&&(_=$s(_,i));const{position:y,positionAbsolute:C}=Yu({nodeId:R.id,nextPosition:_,nodeLookup:d,nodeExtent:s,nodeOrigin:x,onError:a});R.position=y,R.internals.positionAbsolute=C,p.set(R.id,R)}c(p)},[])}const Qr=j.createContext(null),p4=Qr.Provider;Qr.Consumer;const Md=()=>j.useContext(Qr),m4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),f4=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:l}=s,{fromHandle:a,toHandle:c,isValid:d}=l,x=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:x,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===Pt.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:x&&d}};function h4({type:e="source",position:t=Q.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:l,onConnect:a,children:c,className:d,onMouseDown:x,onTouchStart:p,...m},h){const g=l||null,E=e==="target",S=ve(),R=Md(),{connectOnClick:_,noPanClassName:y,rfId:C}=je(m4,_e),{connectingFrom:v,connectingTo:L,clickConnecting:N,isPossibleEndHandle:I,connectionInProcess:B,clickConnectionInProcess:z,valid:H}=je(f4(R,g,e),_e);R||S.getState().onError?.("010",Ie.error010());const D=k=>{const{defaultEdgeOptions:M,onConnect:O,hasDefaultEdges:F}=S.getState(),$={...M,...k};if(F){const{edges:Z,setEdges:K}=S.getState();K(rd($,Z))}O?.($),a?.($)},V=k=>{if(!R)return;const M=ed(k.nativeEvent);if(r&&(M&&k.button===0||!M)){const O=S.getState();Zo.onPointerDown(k.nativeEvent,{autoPanOnConnect:O.autoPanOnConnect,connectionMode:O.connectionMode,connectionRadius:O.connectionRadius,domNode:O.domNode,nodeLookup:O.nodeLookup,lib:O.lib,isTarget:E,handleId:g,nodeId:R,flowId:O.rfId,panBy:O.panBy,cancelConnection:O.cancelConnection,onConnectStart:O.onConnectStart,onConnectEnd:O.onConnectEnd,updateConnection:O.updateConnection,onConnect:D,isValidConnection:n||O.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:O.autoPanSpeed,dragThreshold:O.connectionDragThreshold})}M?x?.(k):p?.(k)},w=k=>{const{onClickConnectStart:M,onClickConnectEnd:O,connectionClickStartHandle:F,connectionMode:$,isValidConnection:Z,lib:K,rfId:q,nodeLookup:te,connection:J}=S.getState();if(!R||!F&&!r)return;if(!F){M?.(k.nativeEvent,{nodeId:R,handleId:g,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:R,type:e,id:g}});return}const oe=Qu(k.target),ne=n||Z,{connection:re,isValid:ee}=Zo.isValid(k.nativeEvent,{handle:{nodeId:R,id:g,type:e},connectionMode:$,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:ne,flowId:q,doc:oe,lib:K,nodeLookup:te});ee&&re&&D(re);const ie=structuredClone(J);delete ie.inProgress,ie.toPosition=ie.toHandle?ie.toHandle.position:null,O?.(k,ie),S.setState({connectionClickStartHandle:null})};return o.jsxRuntimeExports.jsx("div",{"data-handleid":g,"data-nodeid":R,"data-handlepos":t,"data-id":`${C}-${R}-${g}-${e}`,className:Le(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,d,{source:!E,target:E,connectable:s,connectablestart:r,connectableend:i,clickconnecting:N,connectingfrom:v,connectingto:L,valid:H,connectionindicator:s&&(!B||I)&&(B||z?i:r)}]),onMouseDown:V,onTouchStart:V,onClick:_?w:void 0,ref:h,...m,children:c})}const Ln=j.memo(vd(h4));function g4({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e?.label,o.jsxRuntimeExports.jsx(Ln,{type:"source",position:n,isConnectable:t})]})}function j4({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:s=Q.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ln,{type:"target",position:n,isConnectable:t}),e?.label,o.jsxRuntimeExports.jsx(Ln,{type:"source",position:s,isConnectable:t})]})}function E4(){return null}function y4({data:e,isConnectable:t,targetPosition:n=Q.Top}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ln,{type:"target",position:n,isConnectable:t}),e?.label]})}const Cs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Cl={input:g4,default:j4,output:y4,group:E4};function S4(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const R4=e=>{const{width:t,height:n,x:s,y:r}=On(e.nodeLookup,{filter:i=>!!i.selected});return{width:Ge(t)?t:null,height:Ge(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function C4({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=ve(),{width:r,height:i,transformString:l,userSelectionActive:a}=je(R4,_e),c=Ld(),d=j.useRef(null);if(j.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),kd({nodeRef:d}),a||!r||!i)return null;const x=e?m=>{const h=s.getState().nodes.filter(g=>g.selected);e(m,h)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Cs,m.key)&&(m.preventDefault(),c({direction:Cs[m.key],factor:m.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:Le(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:o.jsxRuntimeExports.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:r,height:i}})})}const wl=typeof window<"u"?window:void 0,w4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Pd({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:x,selectionMode:p,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:E,zoomActivationKeyCode:S,elementsSelectable:R,zoomOnScroll:_,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:v,panOnScrollMode:L,zoomOnDoubleClick:N,panOnDrag:I,defaultViewport:B,translateExtent:z,minZoom:H,maxZoom:D,preventScrolling:V,onSelectionContextMenu:w,noWheelClassName:k,noPanClassName:M,disableKeyboardA11y:O,onViewportChange:F,isControlledViewport:$}){const{nodesSelectionActive:Z,userSelectionActive:K}=je(w4),q=kn(d,{target:wl}),te=kn(E,{target:wl}),J=te||I,oe=te||C,ne=x&&J!==!0,re=q||K||ne;return o4({deleteKeyCode:c,multiSelectionKeyCode:g}),o.jsxRuntimeExports.jsx(l4,{onPaneContextMenu:i,elementsSelectable:R,zoomOnScroll:_,zoomOnPinch:y,panOnScroll:oe,panOnScrollSpeed:v,panOnScrollMode:L,zoomOnDoubleClick:N,panOnDrag:!q&&J,defaultViewport:B,translateExtent:z,minZoom:H,maxZoom:D,zoomActivationKeyCode:S,preventScrolling:V,noWheelClassName:k,noPanClassName:M,onViewportChange:F,isControlledViewport:$,paneClickDistance:a,children:o.jsxRuntimeExports.jsxs(d4,{onSelectionStart:m,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:J,isSelecting:!!re,selectionMode:p,selectionKeyPressed:q,selectionOnDrag:ne,children:[e,Z&&o.jsxRuntimeExports.jsx(C4,{onSelectionContextMenu:w,noPanClassName:M,disableKeyboardA11y:O})]})})}Pd.displayName="FlowRenderer";const b4=j.memo(Pd),v4=e=>t=>e?Kr(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function _4(e){return je(j.useCallback(v4(e),[e]),_e)}const k4=e=>e.updateNodeInternals;function L4(){const e=je(k4),[t]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return j.useEffect(()=>()=>{t?.disconnect()},[t]),t}function M4({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=ve(),i=j.useRef(null),l=j.useRef(null),a=j.useRef(e.sourcePosition),c=j.useRef(e.targetPosition),d=j.useRef(t),x=n&&!!e.internals.handleBounds;return j.useEffect(()=>{i.current&&!e.hidden&&(!x||l.current!==i.current)&&(l.current&&s?.unobserve(l.current),s?.observe(i.current),l.current=i.current)},[x,e.hidden]),j.useEffect(()=>()=>{l.current&&(s?.unobserve(l.current),l.current=null)},[]),j.useEffect(()=>{if(i.current){const p=d.current!==t,m=a.current!==e.sourcePosition,h=c.current!==e.targetPosition;(p||m||h)&&(d.current=t,a.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function P4({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:l,nodesDraggable:a,elementsSelectable:c,nodesConnectable:d,nodesFocusable:x,resizeObserver:p,noDragClassName:m,noPanClassName:h,disableKeyboardA11y:g,rfId:E,nodeTypes:S,nodeClickDistance:R,onError:_}){const{node:y,internals:C,isParent:v}=je(ee=>{const ie=ee.nodeLookup.get(e),ye=ee.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:ye}},_e);let L=y.type||"default",N=S?.[L]||Cl[L];N===void 0&&(_?.("003",Ie.error003(L)),L="default",N=Cl.default);const I=!!(y.draggable||a&&typeof y.draggable>"u"),B=!!(y.selectable||c&&typeof y.selectable>"u"),z=!!(y.connectable||d&&typeof y.connectable>"u"),H=!!(y.focusable||x&&typeof y.focusable>"u"),D=ve(),V=Xu(y),w=M4({node:y,nodeType:L,hasDimensions:V,resizeObserver:p}),k=kd({nodeRef:w,disabled:y.hidden||!I,noDragClassName:m,handleSelector:y.dragHandle,nodeId:e,isSelectable:B,nodeClickDistance:R}),M=Ld();if(y.hidden)return null;const O=ct(y),F=S4(y),$=B||I||t||n||s||r,Z=n?ee=>n(ee,{...C.userNode}):void 0,K=s?ee=>s(ee,{...C.userNode}):void 0,q=r?ee=>r(ee,{...C.userNode}):void 0,te=i?ee=>i(ee,{...C.userNode}):void 0,J=l?ee=>l(ee,{...C.userNode}):void 0,oe=ee=>{const{selectNodesOnDrag:ie,nodeDragThreshold:ye}=D.getState();B&&(!ie||!I||ye>0)&&Ko({id:e,store:D,nodeRef:w}),t&&t(ee,{...C.userNode})},ne=ee=>{if(!(Ju(ee.nativeEvent)||g)){if(Vu.includes(ee.key)&&B){const ie=ee.key==="Escape";Ko({id:e,store:D,unselect:ie,nodeRef:w})}else if(I&&y.selected&&Object.prototype.hasOwnProperty.call(Cs,ee.key)){ee.preventDefault();const{ariaLabelConfig:ie}=D.getState();D.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),M({direction:Cs[ee.key],factor:ee.shiftKey?4:1})}}},re=()=>{if(g||!w.current?.matches(":focus-visible"))return;const{transform:ee,width:ie,height:ye,autoPanOnNodeFocus:Se,setCenter:ue}=D.getState();if(!Se)return;Kr(new Map([[e,y]]),{x:0,y:0,width:ie,height:ye},ee,!0).length>0||ue(y.position.x+O.width/2,y.position.y+O.height/2,{zoom:ee[2]})};return o.jsxRuntimeExports.jsx("div",{className:Le(["react-flow__node",`react-flow__node-${L}`,{[h]:I},y.className,{selected:y.selected,selectable:B,parent:v,draggable:I,dragging:k}]),ref:w,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:V?"visible":"hidden",...y.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Z,onMouseMove:K,onMouseLeave:q,onContextMenu:te,onClick:oe,onDoubleClick:J,onKeyDown:H?ne:void 0,tabIndex:H?0:void 0,onFocus:H?re:void 0,role:y.ariaRole??(H?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${yd}-${E}`,"aria-label":y.ariaLabel,...y.domAttributes,children:o.jsxRuntimeExports.jsx(p4,{value:e,children:o.jsxRuntimeExports.jsx(N,{id:e,data:y.data,type:L,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:B,draggable:I,deletable:y.deletable??!0,isConnectable:z,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:k,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...O})})})}const N4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Nd(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=je(N4,_e),l=_4(e.onlyRenderVisibleElements),a=L4();return o.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Fs,children:l.map(c=>o.jsxRuntimeExports.jsx(P4,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}Nd.displayName="NodeRenderer";const T4=j.memo(Nd);function A4(e){return je(j.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);i&&l&&Ay({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),_e)}const I4=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),O4=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),bl={[js.Arrow]:I4,[js.ArrowClosed]:O4};function D4(e){const t=ve();return j.useMemo(()=>Object.prototype.hasOwnProperty.call(bl,e)?bl[e]:(t.getState().onError?.("009",Ie.error009(e)),null),[e])}const B4=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:a="auto-start-reverse"})=>{const c=D4(t);return c?o.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:o.jsxRuntimeExports.jsx(c,{color:n,strokeWidth:l})}):null},Td=({defaultColor:e,rfId:t})=>{const n=je(i=>i.edges),s=je(i=>i.defaultEdgeOptions),r=j.useMemo(()=>Vy(n,{id:t,defaultColor:e,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[n,s,t,e]);return r.length?o.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsxRuntimeExports.jsx("defs",{children:r.map(i=>o.jsxRuntimeExports.jsx(B4,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Td.displayName="MarkerDefinitions";var $4=j.memo(Td);function Ad({x:e,y:t,label:n,labelStyle:s,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:a=2,children:c,className:d,...x}){const[p,m]=j.useState({x:1,y:0,width:0,height:0}),h=Le(["react-flow__edge-textwrapper",d]),g=j.useRef(null);return j.useEffect(()=>{if(g.current){const E=g.current.getBBox();m({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),n?o.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:h,visibility:p.width?"visible":"hidden",...x,children:[r&&o.jsxRuntimeExports.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),o.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:g,style:s,children:n}),c]}):null}Ad.displayName="EdgeText";const z4=j.memo(Ad);function Ue({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:d=20,...x}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{...x,d:e,fill:"none",className:Le(["react-flow__edge-path",x.className])}),d&&o.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),s&&Ge(t)&&Ge(n)?o.jsxRuntimeExports.jsx(z4,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function vl({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===Q.Left||e===Q.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function Id({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top}){const[l,a]=vl({pos:n,x1:e,y1:t,x2:s,y2:r}),[c,d]=vl({pos:i,x1:s,y1:r,x2:e,y2:t}),[x,p,m,h]=td({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:d});return[`M${e},${t} C${l},${a} ${c},${d} ${s},${r}`,x,p,m,h]}function Od(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l,targetPosition:a,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:E,markerStart:S,interactionWidth:R})=>{const[_,y,C]=Id({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:a}),v=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:v,path:_,labelX:y,labelY:C,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:E,markerStart:S,interactionWidth:R})})}const V4=Od({isInternal:!1}),Dd=Od({isInternal:!0});V4.displayName="SimpleBezierEdge";Dd.displayName="SimpleBezierEdgeInternal";function Bd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,sourcePosition:h=Q.Bottom,targetPosition:g=Q.Top,markerEnd:E,markerStart:S,pathOptions:R,interactionWidth:_})=>{const[y,C,v]=Vo({sourceX:n,sourceY:s,sourcePosition:h,targetX:r,targetY:i,targetPosition:g,borderRadius:R?.borderRadius,offset:R?.offset}),L=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:L,path:y,labelX:C,labelY:v,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:E,markerStart:S,interactionWidth:_})})}const $d=Bd({isInternal:!1}),zd=Bd({isInternal:!0});$d.displayName="SmoothStepEdge";zd.displayName="SmoothStepEdgeInternal";function Vd(e){return j.memo(({id:t,...n})=>{const s=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx($d,{...n,id:s,pathOptions:j.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const H4=Vd({isInternal:!1}),Hd=Vd({isInternal:!0});H4.displayName="StepEdge";Hd.displayName="StepEdgeInternal";function Fd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:E})=>{const[S,R,_]=id({sourceX:n,sourceY:s,targetX:r,targetY:i}),y=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:y,path:S,labelX:R,labelY:_,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:E})})}const F4=Fd({isInternal:!1}),Zd=Fd({isInternal:!0});F4.displayName="StraightEdge";Zd.displayName="StraightEdgeInternal";function Kd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=Q.Bottom,targetPosition:a=Q.Top,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:E,markerStart:S,pathOptions:R,interactionWidth:_})=>{const[y,C,v]=nd({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:a,curvature:R?.curvature}),L=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:L,path:y,labelX:C,labelY:v,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:E,markerStart:S,interactionWidth:_})})}const Z4=Kd({isInternal:!1}),Yd=Kd({isInternal:!0});Z4.displayName="BezierEdge";Yd.displayName="BezierEdgeInternal";const _l={default:Yd,straight:Zd,step:Hd,smoothstep:zd,simplebezier:Dd},kl={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},K4=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,Y4=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,Ll="react-flow__edgeupdater";function Ml({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:l,type:a}){return o.jsxRuntimeExports.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:l,className:Le([Ll,`${Ll}-${a}`]),cx:K4(t,s,e),cy:Y4(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function W4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:l,sourcePosition:a,targetPosition:c,onReconnect:d,onReconnectStart:x,onReconnectEnd:p,setReconnecting:m,setUpdateHover:h}){const g=ve(),E=(C,v)=>{if(C.button!==0)return;const{autoPanOnConnect:L,domNode:N,isValidConnection:I,connectionMode:B,connectionRadius:z,lib:H,onConnectStart:D,onConnectEnd:V,cancelConnection:w,nodeLookup:k,rfId:M,panBy:O,updateConnection:F}=g.getState(),$=v.type==="target",Z=(te,J)=>{m(!1),p?.(te,n,v.type,J)},K=te=>d?.(n,te),q=(te,J)=>{m(!0),x?.(C,n,v.type),D?.(te,J)};Zo.onPointerDown(C.nativeEvent,{autoPanOnConnect:L,connectionMode:B,connectionRadius:z,domNode:N,handleId:v.id,nodeId:v.nodeId,nodeLookup:k,isTarget:$,edgeUpdaterType:v.type,lib:H,flowId:M,cancelConnection:w,panBy:O,isValidConnection:I,onConnect:K,onConnectStart:q,onConnectEnd:V,onReconnectEnd:Z,updateConnection:F,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold})},S=C=>E(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),R=C=>E(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>h(!0),y=()=>h(!1);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&o.jsxRuntimeExports.jsx(Ml,{position:a,centerX:s,centerY:r,radius:t,onMouseDown:S,onMouseEnter:_,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&o.jsxRuntimeExports.jsx(Ml,{position:c,centerX:i,centerY:l,radius:t,onMouseDown:R,onMouseEnter:_,onMouseOut:y,type:"target"})]})}function G4({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:l,onMouseEnter:a,onMouseMove:c,onMouseLeave:d,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,rfId:g,edgeTypes:E,noPanClassName:S,onError:R,disableKeyboardA11y:_}){let y=je(ue=>ue.edgeLookup.get(e));const C=je(ue=>ue.defaultEdgeOptions);y=C?{...C,...y}:y;let v=y.type||"default",L=E?.[v]||_l[v];L===void 0&&(R?.("011",Ie.error011(v)),v="default",L=_l.default);const N=!!(y.focusable||t&&typeof y.focusable>"u"),I=typeof p<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),B=!!(y.selectable||s&&typeof y.selectable>"u"),z=j.useRef(null),[H,D]=j.useState(!1),[V,w]=j.useState(!1),k=ve(),{zIndex:M,sourceX:O,sourceY:F,targetX:$,targetY:Z,sourcePosition:K,targetPosition:q}=je(j.useCallback(ue=>{const me=ue.nodeLookup.get(y.source),U=ue.nodeLookup.get(y.target);if(!me||!U)return{zIndex:y.zIndex,...kl};const de=zy({id:e,sourceNode:me,targetNode:U,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ue.connectionMode,onError:R});return{zIndex:Ty({selected:y.selected,zIndex:y.zIndex,sourceNode:me,targetNode:U,elevateOnSelect:ue.elevateEdgesOnSelect}),...de||kl}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),_e),te=j.useMemo(()=>y.markerStart?`url('#${Ho(y.markerStart,g)}')`:void 0,[y.markerStart,g]),J=j.useMemo(()=>y.markerEnd?`url('#${Ho(y.markerEnd,g)}')`:void 0,[y.markerEnd,g]);if(y.hidden||O===null||F===null||$===null||Z===null)return null;const oe=ue=>{const{addSelectedEdges:me,unselectNodesAndEdges:U,multiSelectionActive:de}=k.getState();B&&(k.setState({nodesSelectionActive:!1}),y.selected&&de?(U({nodes:[],edges:[y]}),z.current?.blur()):me([e])),r&&r(ue,y)},ne=i?ue=>{i(ue,{...y})}:void 0,re=l?ue=>{l(ue,{...y})}:void 0,ee=a?ue=>{a(ue,{...y})}:void 0,ie=c?ue=>{c(ue,{...y})}:void 0,ye=d?ue=>{d(ue,{...y})}:void 0,Se=ue=>{if(!_&&Vu.includes(ue.key)&&B){const{unselectNodesAndEdges:me,addSelectedEdges:U}=k.getState();ue.key==="Escape"?(z.current?.blur(),me({edges:[y]})):U([e])}};return o.jsxRuntimeExports.jsx("svg",{style:{zIndex:M},children:o.jsxRuntimeExports.jsxs("g",{className:Le(["react-flow__edge",`react-flow__edge-${v}`,y.className,S,{selected:y.selected,animated:y.animated,inactive:!B&&!r,updating:H,selectable:B}]),onClick:oe,onDoubleClick:ne,onContextMenu:re,onMouseEnter:ee,onMouseMove:ie,onMouseLeave:ye,onKeyDown:N?Se:void 0,tabIndex:N?0:void 0,role:y.ariaRole??(N?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":N?`${Sd}-${g}`:void 0,ref:z,...y.domAttributes,children:[!V&&o.jsxRuntimeExports.jsx(L,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:B,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:O,sourceY:F,targetX:$,targetY:Z,sourcePosition:K,targetPosition:q,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:te,markerEnd:J,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),I&&o.jsxRuntimeExports.jsx(W4,{edge:y,isReconnectable:I,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,sourceX:O,sourceY:F,targetX:$,targetY:Z,sourcePosition:K,targetPosition:q,setUpdateHover:D,setReconnecting:w})]})})}const U4=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Wd({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:x,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:E}){const{edgesFocusable:S,edgesReconnectable:R,elementsSelectable:_,onError:y}=je(U4,_e),C=A4(t);return o.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[o.jsxRuntimeExports.jsx($4,{defaultColor:e,rfId:n}),C.map(v=>o.jsxRuntimeExports.jsx(G4,{id:v,edgesFocusable:S,edgesReconnectable:R,elementsSelectable:_,noPanClassName:r,onReconnect:i,onContextMenu:l,onMouseEnter:a,onMouseMove:c,onMouseLeave:d,onClick:x,reconnectRadius:p,onDoubleClick:m,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:y,edgeTypes:s,disableKeyboardA11y:E},v))]})}Wd.displayName="EdgeRenderer";const X4=j.memo(Wd),q4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Q4({children:e}){const t=je(q4);return o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function J4(e){const t=At(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const eR=e=>e.panZoom?.syncViewport;function tR(e){const t=je(eR),n=ve();return j.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function nR(e){return e.connection.inProgress?{...e.connection,to:Dn(e.connection.to,e.transform)}:{...e.connection}}function sR(e){return nR}function oR(e){const t=sR();return je(t,_e)}const rR=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function iR({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:l,isValid:a,inProgress:c}=je(rR,_e);return!(i&&r&&c)?null:o.jsxRuntimeExports.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:o.jsxRuntimeExports.jsx("g",{className:Le(["react-flow__connection",Zu(a)]),children:o.jsxRuntimeExports.jsx(Gd,{style:t,type:n,CustomComponent:s,isValid:a})})})}const Gd=({style:e,type:t=mt.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:l,fromHandle:a,fromPosition:c,to:d,toNode:x,toHandle:p,toPosition:m}=oR();if(!r)return;if(n)return o.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:a,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:m,connectionStatus:Zu(s),toNode:x,toHandle:p});let h="";const g={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:m};switch(t){case mt.Bezier:[h]=nd(g);break;case mt.SimpleBezier:[h]=Id(g);break;case mt.Step:[h]=Vo({...g,borderRadius:0});break;case mt.SmoothStep:[h]=Vo(g);break;default:[h]=id(g)}return o.jsxRuntimeExports.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};Gd.displayName="ConnectionLine";const lR={};function Pl(e=lR){const t=j.useRef(e),n=ve();j.useEffect(()=>{if(process.env.NODE_ENV==="development"){const s=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const r of s)if(t.current[r]!==e[r]){n.getState().onError?.("002",Ie.error002());break}t.current=e}},[e])}function aR(){const e=ve(),t=j.useRef(!1);j.useEffect(()=>{if(process.env.NODE_ENV==="development"&&!t.current){const n=document.querySelector(".react-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.getState().onError?.("013",Ie.error013("react")),t.current=!0}},[])}function Ud({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:x,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:E,connectionLineComponent:S,connectionLineContainerStyle:R,selectionKeyCode:_,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:v,panActivationKeyCode:L,zoomActivationKeyCode:N,deleteKeyCode:I,onlyRenderVisibleElements:B,elementsSelectable:z,defaultViewport:H,translateExtent:D,minZoom:V,maxZoom:w,preventScrolling:k,defaultMarkerColor:M,zoomOnScroll:O,zoomOnPinch:F,panOnScroll:$,panOnScrollSpeed:Z,panOnScrollMode:K,zoomOnDoubleClick:q,panOnDrag:te,onPaneClick:J,onPaneMouseEnter:oe,onPaneMouseMove:ne,onPaneMouseLeave:re,onPaneScroll:ee,onPaneContextMenu:ie,paneClickDistance:ye,nodeClickDistance:Se,onEdgeContextMenu:ue,onEdgeMouseEnter:me,onEdgeMouseMove:U,onEdgeMouseLeave:de,reconnectRadius:be,onReconnect:Te,onReconnectStart:Qe,onReconnectEnd:zn,noDragClassName:Vn,noWheelClassName:Hn,noPanClassName:ln,disableKeyboardA11y:an,nodeExtent:Gs,rfId:Fn,viewport:Bt,onViewportChange:cn}){return Pl(e),Pl(t),aR(),J4(n),tR(Bt),o.jsxRuntimeExports.jsx(b4,{onPaneClick:J,onPaneMouseEnter:oe,onPaneMouseMove:ne,onPaneMouseLeave:re,onPaneContextMenu:ie,onPaneScroll:ee,paneClickDistance:ye,deleteKeyCode:I,selectionKeyCode:_,selectionOnDrag:y,selectionMode:C,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:v,panActivationKeyCode:L,zoomActivationKeyCode:N,elementsSelectable:z,zoomOnScroll:O,zoomOnPinch:F,zoomOnDoubleClick:q,panOnScroll:$,panOnScrollSpeed:Z,panOnScrollMode:K,panOnDrag:te,defaultViewport:H,translateExtent:D,minZoom:V,maxZoom:w,onSelectionContextMenu:p,preventScrolling:k,noDragClassName:Vn,noWheelClassName:Hn,noPanClassName:ln,disableKeyboardA11y:an,onViewportChange:cn,isControlledViewport:!!Bt,children:o.jsxRuntimeExports.jsxs(Q4,{children:[o.jsxRuntimeExports.jsx(X4,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:Te,onReconnectStart:Qe,onReconnectEnd:zn,onlyRenderVisibleElements:B,onEdgeContextMenu:ue,onEdgeMouseEnter:me,onEdgeMouseMove:U,onEdgeMouseLeave:de,reconnectRadius:be,defaultMarkerColor:M,noPanClassName:ln,disableKeyboardA11y:an,rfId:Fn}),o.jsxRuntimeExports.jsx(iR,{style:E,type:g,component:S,containerStyle:R}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsxRuntimeExports.jsx(T4,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:x,nodeClickDistance:Se,onlyRenderVisibleElements:B,noPanClassName:ln,noDragClassName:Vn,disableKeyboardA11y:an,nodeExtent:Gs,rfId:Fn}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Ud.displayName="GraphView";const cR=j.memo(Ud),Nl=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c=.5,maxZoom:d=2,nodeOrigin:x,nodeExtent:p}={})=>{const m=new Map,h=new Map,g=new Map,E=new Map,S=s??t??[],R=n??e??[],_=x??[0,0],y=p??bn;ad(g,E,S);const C=Fo(R,m,h,{nodeOrigin:_,nodeExtent:y,elevateNodesOnSelect:!1});let v=[0,0,1];if(l&&r&&i){const L=On(m,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:N,y:I,zoom:B}=Yr(L,r,i,c,d,a?.padding??.1);v=[N,I,B]}return{rfId:"1",width:0,height:0,transform:v,nodes:R,nodesInitialized:C,nodeLookup:m,parentLookup:h,edges:S,edgeLookup:E,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:bn,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Pt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Fu},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:ys,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Hu}},uR=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:x,nodeExtent:p})=>MS((m,h)=>{async function g(){const{nodeLookup:E,panZoom:S,fitViewOptions:R,fitViewResolver:_,width:y,height:C,minZoom:v,maxZoom:L}=h();S&&(await vy({nodes:E,width:y,height:C,panZoom:S,minZoom:v,maxZoom:L},R),_?.resolve(!0),m({fitViewResolver:null}))}return{...Nl({nodes:e,edges:t,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:x,nodeExtent:p,defaultNodes:n,defaultEdges:s}),setNodes:E=>{const{nodeLookup:S,parentLookup:R,nodeOrigin:_,elevateNodesOnSelect:y,fitViewQueued:C}=h(),v=Fo(E,S,R,{nodeOrigin:_,nodeExtent:p,elevateNodesOnSelect:y,checkEquality:!0});C&&v?(g(),m({nodes:E,nodesInitialized:v,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:E,nodesInitialized:v})},setEdges:E=>{const{connectionLookup:S,edgeLookup:R}=h();ad(S,R,E),m({edges:E})},setDefaultNodesAndEdges:(E,S)=>{if(E){const{setNodes:R}=h();R(E),m({hasDefaultNodes:!0})}if(S){const{setEdges:R}=h();R(S),m({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:S,nodeLookup:R,parentLookup:_,domNode:y,nodeOrigin:C,nodeExtent:v,debug:L,fitViewQueued:N}=h(),{changes:I,updatedInternals:B}=Yy(E,R,_,y,C,v);B&&(Fy(R,_,{nodeOrigin:C,nodeExtent:v}),N?(g(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),I?.length>0&&(L&&console.log("React Flow: trigger node changes",I),S?.(I)))},updateNodePositions:(E,S=!1)=>{const R=[],_=[],{nodeLookup:y,triggerNodeChanges:C}=h();for(const[v,L]of E){const N=y.get(v),I=!!(N?.expandParent&&N?.parentId&&L?.position),B={id:v,type:"position",position:I?{x:Math.max(0,L.position.x),y:Math.max(0,L.position.y)}:L.position,dragging:S};I&&N.parentId&&R.push({id:v,parentId:N.parentId,rect:{...L.internals.positionAbsolute,width:L.measured.width??0,height:L.measured.height??0}}),_.push(B)}if(R.length>0){const{parentLookup:v,nodeOrigin:L}=h(),N=qr(R,y,v,L);_.push(...N)}C(_)},triggerNodeChanges:E=>{const{onNodesChange:S,setNodes:R,nodes:_,hasDefaultNodes:y,debug:C}=h();if(E?.length){if(y){const v=wd(E,_);R(v)}C&&console.log("React Flow: trigger node changes",E),S?.(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:S,setEdges:R,edges:_,hasDefaultEdges:y,debug:C}=h();if(E?.length){if(y){const v=bd(E,_);R(v)}C&&console.log("React Flow: trigger edge changes",E),S?.(E)}},addSelectedNodes:E=>{const{multiSelectionActive:S,edgeLookup:R,nodeLookup:_,triggerNodeChanges:y,triggerEdgeChanges:C}=h();if(S){const v=E.map(L=>Rt(L,!0));y(v);return}y(Ht(_,new Set([...E]),!0)),C(Ht(R))},addSelectedEdges:E=>{const{multiSelectionActive:S,edgeLookup:R,nodeLookup:_,triggerNodeChanges:y,triggerEdgeChanges:C}=h();if(S){const v=E.map(L=>Rt(L,!0));C(v);return}C(Ht(R,new Set([...E]))),y(Ht(_,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:S}={})=>{const{edges:R,nodes:_,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:v}=h(),L=E||_,N=S||R,I=L.map(z=>{const H=y.get(z.id);return H&&(H.selected=!1),Rt(z.id,!1)}),B=N.map(z=>Rt(z.id,!1));C(I),v(B)},setMinZoom:E=>{const{panZoom:S,maxZoom:R}=h();S?.setScaleExtent([E,R]),m({minZoom:E})},setMaxZoom:E=>{const{panZoom:S,minZoom:R}=h();S?.setScaleExtent([R,E]),m({maxZoom:E})},setTranslateExtent:E=>{h().panZoom?.setTranslateExtent(E),m({translateExtent:E})},setPaneClickDistance:E=>{h().panZoom?.setClickDistance(E)},resetSelectedElements:()=>{const{edges:E,nodes:S,triggerNodeChanges:R,triggerEdgeChanges:_,elementsSelectable:y}=h();if(!y)return;const C=S.reduce((L,N)=>N.selected?[...L,Rt(N.id,!1)]:L,[]),v=E.reduce((L,N)=>N.selected?[...L,Rt(N.id,!1)]:L,[]);R(C),_(v)},setNodeExtent:E=>{const{nodes:S,nodeLookup:R,parentLookup:_,nodeOrigin:y,elevateNodesOnSelect:C,nodeExtent:v}=h();E[0][0]===v[0][0]&&E[0][1]===v[0][1]&&E[1][0]===v[1][0]&&E[1][1]===v[1][1]||(Fo(S,R,_,{nodeOrigin:y,nodeExtent:E,elevateNodesOnSelect:C,checkEquality:!1}),m({nodeExtent:E}))},panBy:E=>{const{transform:S,width:R,height:_,panZoom:y,translateExtent:C}=h();return Wy({delta:E,panZoom:y,transform:S,translateExtent:C,width:R,height:_})},setCenter:async(E,S,R)=>{const{width:_,height:y,maxZoom:C,panZoom:v}=h();if(!v)return Promise.resolve(!1);const L=typeof R?.zoom<"u"?R.zoom:C;return await v.setViewport({x:_/2-E*L,y:y/2-S*L,zoom:L},{duration:R?.duration,ease:R?.ease,interpolate:R?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{...Fu}})},updateConnection:E=>{m({connection:E})},reset:()=>m({...Nl()})}},Object.is);function Xd({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,initialMinZoom:l,initialMaxZoom:a,initialFitViewOptions:c,fitView:d,nodeOrigin:x,nodeExtent:p,children:m}){const[h]=j.useState(()=>uR({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:d,minZoom:l,maxZoom:a,fitViewOptions:c,nodeOrigin:x,nodeExtent:p}));return o.jsxRuntimeExports.jsx(PS,{value:h,children:o.jsxRuntimeExports.jsx(e4,{children:m})})}function dR({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:l,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:x,nodeOrigin:p,nodeExtent:m}){return j.useContext(Vs)?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):o.jsxRuntimeExports.jsx(Xd,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:l,fitView:a,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:x,nodeOrigin:p,nodeExtent:m,children:e})}const xR={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function pR({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:l,onNodeClick:a,onEdgeClick:c,onInit:d,onMove:x,onMoveStart:p,onMoveEnd:m,onConnect:h,onConnectStart:g,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:R,onNodeMouseEnter:_,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:v,onNodeDoubleClick:L,onNodeDragStart:N,onNodeDrag:I,onNodeDragStop:B,onNodesDelete:z,onEdgesDelete:H,onDelete:D,onSelectionChange:V,onSelectionDragStart:w,onSelectionDrag:k,onSelectionDragStop:M,onSelectionContextMenu:O,onSelectionStart:F,onSelectionEnd:$,onBeforeDelete:Z,connectionMode:K,connectionLineType:q=mt.Bezier,connectionLineStyle:te,connectionLineComponent:J,connectionLineContainerStyle:oe,deleteKeyCode:ne="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:ee=!1,selectionMode:ie=Gt.Full,panActivationKeyCode:ye="Space",multiSelectionKeyCode:Se=Rs()?"Meta":"Control",zoomActivationKeyCode:ue=Rs()?"Meta":"Control",snapToGrid:me,snapGrid:U,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:be,nodesDraggable:Te,autoPanOnNodeFocus:Qe,nodesConnectable:zn,nodesFocusable:Vn,nodeOrigin:Hn=Rd,edgesFocusable:ln,edgesReconnectable:an,elementsSelectable:Gs=!0,defaultViewport:Fn=ZS,minZoom:Bt=.5,maxZoom:cn=2,translateExtent:ri=bn,preventScrolling:Yf=!0,nodeExtent:Us,defaultMarkerColor:Wf="#b1b1b7",zoomOnScroll:Gf=!0,zoomOnPinch:Uf=!0,panOnScroll:Xf=!1,panOnScrollSpeed:qf=.5,panOnScrollMode:Qf=wt.Free,zoomOnDoubleClick:Jf=!0,panOnDrag:eh=!0,onPaneClick:th,onPaneMouseEnter:nh,onPaneMouseMove:sh,onPaneMouseLeave:oh,onPaneScroll:rh,onPaneContextMenu:ih,paneClickDistance:ii=0,nodeClickDistance:lh=0,children:ah,onReconnect:ch,onReconnectStart:uh,onReconnectEnd:dh,onEdgeContextMenu:xh,onEdgeDoubleClick:ph,onEdgeMouseEnter:mh,onEdgeMouseMove:fh,onEdgeMouseLeave:hh,reconnectRadius:gh=10,onNodesChange:jh,onEdgesChange:Eh,noDragClassName:yh="nodrag",noWheelClassName:Sh="nowheel",noPanClassName:li="nopan",fitView:ai,fitViewOptions:ci,connectOnClick:Rh,attributionPosition:Ch,proOptions:wh,defaultEdgeOptions:bh,elevateNodesOnSelect:vh,elevateEdgesOnSelect:_h,disableKeyboardA11y:ui=!1,autoPanOnConnect:kh,autoPanOnNodeDrag:Lh,autoPanSpeed:Mh,connectionRadius:Ph,isValidConnection:Nh,onError:Th,style:Ah,id:di,nodeDragThreshold:Ih,connectionDragThreshold:Oh,viewport:Dh,onViewportChange:Bh,width:$h,height:zh,colorMode:Vh="light",debug:Hh,onScroll:xi,ariaLabelConfig:Fh,...Zh},Kh){const Xs=di||"1",Yh=GS(Vh),Wh=j.useCallback(pi=>{pi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),xi?.(pi)},[xi]);return o.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...Zh,onScroll:Wh,style:{...Ah,...xR},ref:Kh,className:Le(["react-flow",r,Yh]),id:di,role:"application",children:o.jsxRuntimeExports.jsxs(dR,{nodes:e,edges:t,width:$h,height:zh,fitView:ai,fitViewOptions:ci,minZoom:Bt,maxZoom:cn,nodeOrigin:Hn,nodeExtent:Us,children:[o.jsxRuntimeExports.jsx(cR,{onInit:d,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:_,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:v,onNodeDoubleClick:L,nodeTypes:i,edgeTypes:l,connectionLineType:q,connectionLineStyle:te,connectionLineComponent:J,connectionLineContainerStyle:oe,selectionKeyCode:re,selectionOnDrag:ee,selectionMode:ie,deleteKeyCode:ne,multiSelectionKeyCode:Se,panActivationKeyCode:ye,zoomActivationKeyCode:ue,onlyRenderVisibleElements:de,defaultViewport:Fn,translateExtent:ri,minZoom:Bt,maxZoom:cn,preventScrolling:Yf,zoomOnScroll:Gf,zoomOnPinch:Uf,zoomOnDoubleClick:Jf,panOnScroll:Xf,panOnScrollSpeed:qf,panOnScrollMode:Qf,panOnDrag:eh,onPaneClick:th,onPaneMouseEnter:nh,onPaneMouseMove:sh,onPaneMouseLeave:oh,onPaneScroll:rh,onPaneContextMenu:ih,paneClickDistance:ii,nodeClickDistance:lh,onSelectionContextMenu:O,onSelectionStart:F,onSelectionEnd:$,onReconnect:ch,onReconnectStart:uh,onReconnectEnd:dh,onEdgeContextMenu:xh,onEdgeDoubleClick:ph,onEdgeMouseEnter:mh,onEdgeMouseMove:fh,onEdgeMouseLeave:hh,reconnectRadius:gh,defaultMarkerColor:Wf,noDragClassName:yh,noWheelClassName:Sh,noPanClassName:li,rfId:Xs,disableKeyboardA11y:ui,nodeExtent:Us,viewport:Dh,onViewportChange:Bh}),o.jsxRuntimeExports.jsx(WS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:h,onConnectStart:g,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:R,nodesDraggable:Te,autoPanOnNodeFocus:Qe,nodesConnectable:zn,nodesFocusable:Vn,edgesFocusable:ln,edgesReconnectable:an,elementsSelectable:Gs,elevateNodesOnSelect:vh,elevateEdgesOnSelect:_h,minZoom:Bt,maxZoom:cn,nodeExtent:Us,onNodesChange:jh,onEdgesChange:Eh,snapToGrid:me,snapGrid:U,connectionMode:K,translateExtent:ri,connectOnClick:Rh,defaultEdgeOptions:bh,fitView:ai,fitViewOptions:ci,onNodesDelete:z,onEdgesDelete:H,onDelete:D,onNodeDragStart:N,onNodeDrag:I,onNodeDragStop:B,onSelectionDrag:k,onSelectionDragStart:w,onSelectionDragStop:M,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:li,nodeOrigin:Hn,rfId:Xs,autoPanOnConnect:kh,autoPanOnNodeDrag:Lh,autoPanSpeed:Mh,onError:Th,connectionRadius:Ph,isValidConnection:Nh,selectNodesOnDrag:be,nodeDragThreshold:Ih,connectionDragThreshold:Oh,onBeforeDelete:Z,paneClickDistance:ii,debug:Hh,ariaLabelConfig:Fh}),o.jsxRuntimeExports.jsx(FS,{onSelectionChange:V}),ah,o.jsxRuntimeExports.jsx(BS,{proOptions:wh,position:Ch}),o.jsxRuntimeExports.jsx(DS,{rfId:Xs,disableKeyboardA11y:ui})]})})}var mR=vd(pR);function fR(){const e=ve();return j.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),r=Array.isArray(t)?t:[t],i=new Map;r.forEach(l=>{const a=n?.querySelector(`.react-flow__node[data-id="${l}"]`);a&&i.set(l,{id:l,nodeElement:a,force:!0})}),requestAnimationFrame(()=>s(i,{triggerFitView:!1}))},[])}function hR({onStart:e,onChange:t,onEnd:n}){const s=ve();j.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),j.useEffect(()=>{s.setState({onViewportChange:t})},[t]),j.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function gR({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Le(["react-flow__background-pattern",n,s])})}function jR({radius:e,className:t}){return o.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Le(["react-flow__background-pattern","dots",t])})}var ht;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ht||(ht={}));const ER={[ht.Dots]:1,[ht.Lines]:1,[ht.Cross]:6},yR=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function qd({id:e,variant:t=ht.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:l,bgColor:a,style:c,className:d,patternClassName:x}){const p=j.useRef(null),{transform:m,patternId:h}=je(yR,_e),g=s||ER[t],E=t===ht.Dots,S=t===ht.Cross,R=Array.isArray(n)?n:[n,n],_=[R[0]*m[2]||1,R[1]*m[2]||1],y=g*m[2],C=Array.isArray(i)?i:[i,i],v=S?[y,y]:_,L=[C[0]*m[2]||1+v[0]/2,C[1]*m[2]||1+v[1]/2],N=`${h}${e||""}`;return o.jsxRuntimeExports.jsxs("svg",{className:Le(["react-flow__background",d]),style:{...c,...Fs,"--xy-background-color-props":a,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[o.jsxRuntimeExports.jsx("pattern",{id:N,x:m[0]%_[0],y:m[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:E?o.jsxRuntimeExports.jsx(jR,{radius:y/2,className:x}):o.jsxRuntimeExports.jsx(gR,{dimensions:v,lineWidth:r,variant:t,className:x})}),o.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}qd.displayName="Background";const SR=j.memo(qd);function RR(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function CR(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function wR(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.jsxRuntimeExports.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function bR(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function vR(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Jn({children:e,className:t,...n}){return o.jsxRuntimeExports.jsx("button",{type:"button",className:Le(["react-flow__controls-button",t]),...n,children:e})}const _R=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Qd({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:l,onFitView:a,onInteractiveChange:c,className:d,children:x,position:p="bottom-left",orientation:m="vertical","aria-label":h}){const g=ve(),{isInteractive:E,minZoomReached:S,maxZoomReached:R,ariaLabelConfig:_}=je(_R,_e),{zoomIn:y,zoomOut:C,fitView:v}=At(),L=()=>{y(),i?.()},N=()=>{C(),l?.()},I=()=>{v(r),a?.()},B=()=>{g.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),c?.(!E)},z=m==="horizontal"?"horizontal":"vertical";return o.jsxRuntimeExports.jsxs(Hs,{className:Le(["react-flow__controls",z,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":h??_["controls.ariaLabel"],children:[t&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Jn,{onClick:L,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:R,children:o.jsxRuntimeExports.jsx(RR,{})}),o.jsxRuntimeExports.jsx(Jn,{onClick:N,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:S,children:o.jsxRuntimeExports.jsx(CR,{})})]}),n&&o.jsxRuntimeExports.jsx(Jn,{className:"react-flow__controls-fitview",onClick:I,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:o.jsxRuntimeExports.jsx(wR,{})}),s&&o.jsxRuntimeExports.jsx(Jn,{className:"react-flow__controls-interactive",onClick:B,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:E?o.jsxRuntimeExports.jsx(vR,{}):o.jsxRuntimeExports.jsx(bR,{})}),x]})}Qd.displayName="Controls";j.memo(Qd);function kR({id:e,x:t,y:n,width:s,height:r,style:i,color:l,strokeColor:a,strokeWidth:c,className:d,borderRadius:x,shapeRendering:p,selected:m,onClick:h}){const{background:g,backgroundColor:E}=i||{},S=l||g||E;return o.jsxRuntimeExports.jsx("rect",{className:Le(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:x,ry:x,width:s,height:r,style:{fill:S,stroke:a,strokeWidth:c},shapeRendering:p,onClick:h?R=>h(R,e):void 0})}const LR=j.memo(kR),MR=e=>e.nodes.map(t=>t.id),Eo=e=>e instanceof Function?e:()=>e;function PR({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=LR,onClick:l}){const a=je(MR,_e),c=Eo(t),d=Eo(e),x=Eo(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:a.map(m=>o.jsxRuntimeExports.jsx(TR,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function NR({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:a,onClick:c}){const{node:d,x,y:p,width:m,height:h}=je(g=>{const{internals:E}=g.nodeLookup.get(e),S=E.userNode,{x:R,y:_}=E.positionAbsolute,{width:y,height:C}=ct(S);return{node:S,x:R,y:_,width:y,height:C}},_e);return!d||d.hidden||!Xu(d)?null:o.jsxRuntimeExports.jsx(a,{x,y:p,width:m,height:h,style:d.style,selected:!!d.selected,className:s(d),color:t(d),borderRadius:r,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:c,id:d.id})}const TR=j.memo(NR);var AR=j.memo(PR);const IR=200,OR=150,DR=e=>!e.hidden,BR=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Uu(On(e.nodeLookup,{filter:DR}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},$R="react-flow__minimap-desc";function Jd({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:a,bgColor:c,maskColor:d,maskStrokeColor:x,maskStrokeWidth:p,position:m="bottom-right",onClick:h,onNodeClick:g,pannable:E=!1,zoomable:S=!1,ariaLabel:R,inversePan:_,zoomStep:y=10,offsetScale:C=5}){const v=ve(),L=j.useRef(null),{boundingRect:N,viewBB:I,rfId:B,panZoom:z,translateExtent:H,flowWidth:D,flowHeight:V,ariaLabelConfig:w}=je(BR,_e),k=e?.width??IR,M=e?.height??OR,O=N.width/k,F=N.height/M,$=Math.max(O,F),Z=$*k,K=$*M,q=C*$,te=N.x-(Z-N.width)/2-q,J=N.y-(K-N.height)/2-q,oe=Z+q*2,ne=K+q*2,re=`${$R}-${B}`,ee=j.useRef(0),ie=j.useRef();ee.current=$,j.useEffect(()=>{if(L.current&&z)return ie.current=tS({domNode:L.current,panZoom:z,getTransform:()=>v.getState().transform,getViewScale:()=>ee.current}),()=>{ie.current?.destroy()}},[z]),j.useEffect(()=>{ie.current?.update({translateExtent:H,width:D,height:V,inversePan:_,pannable:E,zoomStep:y,zoomable:S})},[E,S,_,y,H,D,V]);const ye=h?me=>{const[U,de]=ie.current?.pointer(me)||[0,0];h(me,{x:U,y:de})}:void 0,Se=g?j.useCallback((me,U)=>{const de=v.getState().nodeLookup.get(U).internals.userNode;g(me,de)},[]):void 0,ue=R??w["minimap.ariaLabel"];return o.jsxRuntimeExports.jsx(Hs,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof x=="string"?x:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*$:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Le(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxRuntimeExports.jsxs("svg",{width:k,height:M,viewBox:`${te} ${J} ${oe} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":re,ref:L,onClick:ye,children:[ue&&o.jsxRuntimeExports.jsx("title",{id:re,children:ue}),o.jsxRuntimeExports.jsx(AR,{onClick:Se,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:a}),o.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${te-q},${J-q}h${oe+q*2}v${ne+q*2}h${-oe-q*2}z
|
|
39
|
-
M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Jd.displayName="MiniMap";j.memo(Jd);const zR=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,VR={[Qt.Line]:"right",[Qt.Handle]:"bottom-right"};function HR({nodeId:e,position:t,variant:n=Qt.Handle,className:s,style:r=void 0,children:i,color:l,minWidth:a=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:m,autoScale:h=!0,shouldResize:g,onResizeStart:E,onResize:S,onResizeEnd:R}){const _=Md(),y=typeof e=="string"?e:_,C=ve(),v=j.useRef(null),L=n===Qt.Handle,N=je(j.useCallback(zR(L&&h),[L,h]),_e),I=j.useRef(null),B=t??VR[n];j.useEffect(()=>{if(!(!v.current||!y))return I.current||(I.current=gS({domNode:v.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:H,transform:D,snapGrid:V,snapToGrid:w,nodeOrigin:k,domNode:M}=C.getState();return{nodeLookup:H,transform:D,snapGrid:V,snapToGrid:w,nodeOrigin:k,paneDomNode:M}},onChange:(H,D)=>{const{triggerNodeChanges:V,nodeLookup:w,parentLookup:k,nodeOrigin:M}=C.getState(),O=[],F={x:H.x,y:H.y},$=w.get(y);if($&&$.expandParent&&$.parentId){const Z=$.origin??M,K=H.width??$.measured.width??0,q=H.height??$.measured.height??0,te={id:$.id,parentId:$.parentId,rect:{width:K,height:q,...qu({x:H.x??$.position.x,y:H.y??$.position.y},{width:K,height:q},$.parentId,w,Z)}},J=qr([te],w,k,M);O.push(...J),F.x=H.x?Math.max(Z[0]*K,H.x):void 0,F.y=H.y?Math.max(Z[1]*q,H.y):void 0}if(F.x!==void 0&&F.y!==void 0){const Z={id:y,type:"position",position:{...F}};O.push(Z)}if(H.width!==void 0&&H.height!==void 0){const K={id:y,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:H.width,height:H.height}};O.push(K)}for(const Z of D){const K={...Z,type:"position"};O.push(K)}V(O)},onEnd:({width:H,height:D})=>{const V={id:y,type:"dimensions",resizing:!1,dimensions:{width:H,height:D}};C.getState().triggerNodeChanges([V])}})),I.current.update({controlPosition:B,boundaries:{minWidth:a,minHeight:c,maxWidth:d,maxHeight:x},keepAspectRatio:p,resizeDirection:m,onResizeStart:E,onResize:S,onResizeEnd:R,shouldResize:g}),()=>{I.current?.destroy()}},[B,a,c,d,x,p,E,S,R,g]);const z=B.split("-");return o.jsxRuntimeExports.jsx("div",{className:Le(["react-flow__resize-control","nodrag",...z,n,s]),ref:v,style:{...r,scale:N,...l&&{[L?"backgroundColor":"borderColor"]:l}},children:i})}j.memo(HR);const FR=(e,t)=>e.map((n,s)=>u.K.translate(n,t[s])),ex=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:gt(e),style:{stroke:u.ir.cssString(t)},...n}),ZR=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:gt(e),style:{stroke:u.ir.cssString(t),strokeDasharray:"12,4"},...n}),KR=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:gt(e),style:{stroke:u.ir.cssString(t),strokeDasharray:"12,4,4"},...n}),YR=({points:e,color:t,...n})=>{const s=u.K.calculateMiters(e,6),r=e.map((c,d)=>u.K.translate(c,s[d])),i=e.map((c,d)=>u.K.translate(c,u.K.scale(s[d],-1))),l=u.ir.cssString(t),a=.7;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ue,{path:gt(r),style:{stroke:l,opacity:a},...n}),o.jsxRuntimeExports.jsx(Ue,{path:gt(e),style:{stroke:l},...n}),o.jsxRuntimeExports.jsx(Ue,{path:gt(i),style:{stroke:l,opacity:a},...n})]})},Tl=5,WR=(e,t)=>{const n=[],s=[];for(let a=0;a<e.length-1;a++){const c=u.K.distance(e[a],e[a+1]);s.push(c)}const r=t;let i=0,l=r;for(let a=0;a<s.length;a++){const c=s[a],d=e[a],x=e[a+1];for(;i+c>=l;){const p=(l-i)/c,m={x:d.x+p*(x.x-d.x),y:d.y+p*(x.y-d.y)};let h="x";Math.abs(x.x-d.x)<1&&(h="y"),l+=r,!(u.K.distance(m,x)<Tl||u.K.distance(m,d)<Tl)&&n.push({position:m,direction:h})}i+=c}return n},GR=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.ir.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},UR=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10";n==="x"?t.y+=10/3:t.x-=10/3;let i=u.K.translateX(t,-10),l=45;return n==="y"&&(i=u.K.translateY(t,-10),l+=90),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.ir.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.ir.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${i.x},${i.y}) rotate(${l})`,strokeLinecap:"round"})]})},XR=({color:e,position:t})=>o.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:u.ir.cssString(e),strokeWidth:2}),Jr=e=>{const t=({points:n,color:s,...r})=>{const i=gt(n),l=WR(n,40);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ue,{path:i,...r,style:{stroke:u.ir.cssString(s)}}),l.map(({position:a,direction:c},d)=>o.jsxRuntimeExports.jsx(e,{position:a,direction:c,color:s},d))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},qR=Jr(GR),QR=Jr(UR),JR=Jr(XR),gt=e=>{let t="";const s=e.length+-1;for(let r=0;r<s;r++){const i=e[r%e.length],l=e[(r+1)%e.length],a=Math.min(6/Math.hypot(l.x-i.x,l.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),r===s-1?t+=`L${l.x},${l.y}`:r<s-1&&(t+=`L${i.x*a+l.x*(1-a)},${i.y*a+l.y*(1-a)}`)}return t},tx={pipe:ex,electric:ZR,secondary:KR,jacketed:YR,hydraulic:qR,pneumatic:QR,data:JR},nx=ex,eC=[{key:"pipe",name:"Pipe"},{key:"electric",name:"Electric Signal"},{key:"secondary",name:"Secondary"},{key:"jacketed",name:"Jacketed"},{key:"hydraulic",name:"Hydraulic"},{key:"pneumatic",name:"Pneumatic"},{key:"data",name:"Data"}],tC=e=>o.jsxRuntimeExports.jsx(Mn,{data:eC,...e,resourceName:"Path Type"}),Zs=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 n=Zs(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return u.Ho.construct(s.position,u._.scale(u.Ho.dims(u.Ho.construct(n)),1/e.getZoom()))},nC=(e,t)=>Ks.fromFlow(e,t);class sx{node_=null;position;orientation;constructor(t,n){this.position=t,this.orientation=n}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 u.K.translate(u.Ho.topLeft(this.node.box),this.position)}}class Ks{key;box;handles;constructor(t,n,s){this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Oe(n,t),r=Zs(t),i=r.getElementsByClassName("react-flow__handle"),l=u.Ho.construct(r),a=Array.from(i).map(c=>{const d=u.Ho.center(u.Ho.construct(c)),x=u.K.translation(u.Ho.topLeft(l),d),p=c.className.match(/react-flow__handle-(\w+)/);if(p==null)throw new Error("[schematic] - cannot find handle orientation");const m=u.K$1.construct(p[0]);return new sx(x,m)});return new Ks(t,s,a)}}const sC=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:r,toPosition:i,fromNode:l,connectionLineStyle:a,connectionStatus:c})=>{const x=document.querySelector(".react-flow__handle-connecting")?.className.match(/react-flow__handle-(\w+)/);if(x!=null){const g=u.K$1.outer.safeParse(x[1]);g.success&&(i=g.data)}const p=At(),m=zt({sourcePos:u.K.construct(e,t),targetPos:u.K.construct(n,s),sourceOrientation:r,targetOrientation:i,sourceBox:Oe(p,l?.id??""),targetBox:Oe(p,l?.id??"")}),h=cu(u.K.construct(e,t),m,p.getZoom(),!1);return o.jsxRuntimeExports.jsx(nx,{points:h,style:{...a,stroke:u.ir.cssString(c==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l11)"),strokeWidth:2,fill:"none"}})},oC=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:r,targetPosition:i,style:l,segments:a=[],onSegmentsChange:c,color:d="var(--pluto-gray-l11)",selected:x=!1,variant:p="pipe",...m})=>{const h=u.K.construct(m.sourceX,m.sourceY),g=j.useRef(h),E=u.K.equals(h,g.current),S=u.K.construct(m.targetX,m.targetY),R=j.useRef(S),_=u.K.equals(S,R.current),y=At(),[C,v,L]=f.useCombinedStateAndRef(()=>a.length>0?a:zt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),N=j.useRef(i),I=j.useRef(s),B=Ne.useDebouncedCallback(c,100,[c]);if(!E||!_){let w=C;const k=u.K.translation(g.current,h),M=u.K.translation(S,R.current);u.K.equals(k,u.K.scale(M,-1),.001)?(g.current=h,R.current=S):(E?_||(w=p3({delta:M,segments:w}),N.current!==i&&(N.current=i,w=zt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),Mi({sourcePos:h,targetPos:S,next:w,prev:C})||(w=zt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),R.current=S):(w=x3({delta:k,segments:w}),I.current!==s&&(I.current=s,w=zt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),Mi({sourcePos:h,targetPos:S,next:w,prev:C})||(w=zt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),g.current=h),B(w),v(w))}const z=j.useRef(null),H=Ne.useCursorDrag({onStart:j.useCallback((w,k,M)=>{z.current={index:Number(M.currentTarget.id.split("-")[1]),segments:[...L.current]}},[]),onMove:j.useCallback(w=>{if(z.current==null)return;const k=a3({segments:z.current.segments,index:z.current.index,magnitude:u.Ho.dim(w,u.g.swap(z.current.segments[z.current.index].direction),!0)/y.getZoom()});v(k)},[]),onEnd:j.useCallback(()=>c(L.current),[c])}),D=cu(h,C,y.getZoom(),!0),V=tx[p];return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(V,{points:D,color:d}),x&&rC(D).map((w,k)=>{const M=C[k].direction,O=u.g.swap(M),F={[u.g.dimension(M)]:"18px",[u.g.dimension(O)]:"4px"},$={[M]:w[M]-9,[O]:w[O]-2};return o.jsxRuntimeExports.jsxs(j.Fragment,{children:[o.jsxRuntimeExports.jsx("rect",{className:u.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...F,...$,rx:"2px",ry:"2px"}),o.jsxRuntimeExports.jsx("foreignObject",{x:w.x-9,y:w.y-9,width:"18px",height:"18px",children:o.jsxRuntimeExports.jsx("div",{id:`handle-${k}`,className:u.CSS(u.CSS.BE("diagram-edge-handle","dragger"),u.CSS.dir(M)),draggable:!0,onDragStart:H})})]},k)})]})},rC=e=>e.slice(1).map((t,n)=>{const s=e[n];return u.K.construct((t.x+s.x)/2,(t.y+s.y)/2)}),iC=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:u.K.ZERO,zoom:1}})=>{const[r,i]=j.useState(n),[l,a]=j.useState("select"),[c,d]=j.useState(e),[x,p]=j.useState(t),[m,h]=j.useState(s),[g,E]=j.useState(!1);return{viewport:m,onViewportChange:h,edges:x,nodes:c,onNodesChange:d,onEdgesChange:p,editable:r,onEditableChange:i,fitViewOnResize:g,setFitViewOnResize:E,viewportMode:l,onViewportModeChange:a}},lC=()=>!0,aC={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},cC={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesReconnectable:!1,nodesFocusable:!1,reconnectRadius:0},Yo={maxZoom:1,minZoom:.5,padding:.05},uC={hideAttribution:!0},ox=j.createContext({editable:!0,visible:!0,viewportMode:"select",onViewportModeChange:()=>{},onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),on=()=>j.use(ox),rx=j.memo(({children:e})=>{const{registerNodeRenderer:t}=on();return j.useEffect(()=>t(e),[t,e]),null});rx.displayName="NodeRenderer";const dC=["Backspace","Delete"],xC=e=>e==="pan"?{panOnDrag:!0}:e==="select"?{selectionOnDrag:!0}:{},pC=({aetherKey:e,onNodesChange:t,onEdgesChange:n,nodes:s,edges:r,onEditableChange:i,editable:l,viewport:a,triggers:c,onViewportChange:d,fitViewOnResize:x,setFitViewOnResize:p,visible:m,dragHandleSelector:h,viewportMode:g,onViewportModeChange:E,...S})=>{const R=f.useMemoDeepEqual({visible:m}),[{path:_},,y]=f.use$2({aetherKey:e,type:T.Diagram$1.TYPE,schema:T.diagramStateZ,initialState:{position:a.position,region:u.Ho.ZERO,zoom:a.zoom,...R}}),{fitView:C}=At(),v=Ne.useDebouncedCallback(U=>void C(U),50,[C]),L=Pn(j.useCallback(U=>{x&&v(Yo),y(de=>({...de,region:U}))},[y,v,x]));j.useEffect(()=>y(U=>({...U,...R})),[R]);const N=u.ir.hex(f.use().colors.gray.l11),I=f.useMemoCompare(()=>c??ur.zoom,f.compareModeConfigs,[c]),B=j.useRef(null),z=j.useCallback(U=>{const de=B.current;de!=null&&de.x===U.x&&de.y===U.y&&de.zoom===U.zoom||(B.current=U,!(isNaN(U.x)||isNaN(U.y)||isNaN(U.zoom))&&(y(be=>({...be,position:U,zoom:U.zoom})),d(fu(U))))},[y,d]);hR({onStart:z,onChange:z,onEnd:z});const[H,D]=j.useState(()=>()=>null),V=j.useCallback(U=>D(()=>U),[]),w=j.useMemo(()=>({custom:({id:U,positionAbsoluteX:de,positionAbsoluteY:be,selected:Te=!1,draggable:Qe=!0})=>H({symbolKey:U,position:{x:de,y:be},selected:Te,draggable:Qe})}),[H]),k=j.useRef(r),M=j.useMemo(()=>(k.current=r,Br(r)),[r]),O=j.useRef(s),F=j.useMemo(()=>(O.current=s,Dr(s,h)),[s,h]),$=j.useCallback(U=>t(hu(O.current,de=>wd(U,de)),U),[t]),Z=j.useCallback(U=>n(ns(k.current,de=>bd(U,de),N)),[n,N]),K=j.useCallback((U,de)=>n(ns(k.current,be=>Oy(U,de,be),N)),[]),q=j.useCallback(U=>n(ns(k.current,de=>rd(U,de),N)),[n,N]),te=j.useCallback((U,de)=>{const be=[...k.current],Te=be.findIndex(Qe=>Qe.key===U);Te!==-1&&(be[Te]={...be[Te],segments:de},k.current=be,n(be))},[n]),J=l?aC:cC,oe=f.useSyncedRef(te),ne=j.useMemo(()=>({default:U=>o.jsxRuntimeExports.jsx(oC,{...U,segments:U.data?.segments??[],color:U.data?.color,variant:U.data?.variant,onSegmentsChange:j.useCallback(de=>oe.current(U.id,de),[U.id])},U.id)}),[]),re=j.useRef(null);f.use$1({triggers:I.zoomReset,callback:j.useCallback(({stage:U,cursor:de})=>{const be=re.current;be==null||U!=="start"||!u.Ho.contains(be,de)||C()},[C])});const ee=f.purgeMouse(I.select)[0]??null,ie=f.purgeMouse(I.pan)[0]??null,ye=f.purgeMouse(I.zoom)[0]??null,Se={selectionOnDrag:ee==null,panOnDrag:ie==null,selectionKeyCode:ee,panActivationKeyCode:ie,zoomActivationKeyCode:ye},ue=f.useCombinedRefs(re,L),me=j.useMemo(()=>({visible:m,editable:l,onEditableChange:i,registerNodeRenderer:V,fitViewOnResize:x,setFitViewOnResize:p,viewportMode:g,onViewportModeChange:E}),[l,m,i,V,x,g,E]);return o.jsxRuntimeExports.jsx(ox,{value:me,children:o.jsxRuntimeExports.jsx(f.Composite,{path:_,children:m&&o.jsxRuntimeExports.jsx(mR,{...Se,className:u.CSS(u.CSS.B("diagram"),u.CSS.editable(l),u.CSS.BE("symbol","container")),nodes:F,edges:M,nodeTypes:w,edgeTypes:ne,ref:ue,fitView:!0,onNodesChange:$,onEdgesChange:Z,onConnect:q,onReconnect:K,defaultViewport:mu(a),connectionLineComponent:sC,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:lC,connectionMode:Pt.Loose,fitViewOptions:Yo,selectionMode:Gt.Partial,proOptions:uC,deleteKeyCode:dC,...S,style:{[u.CSS.var("diagram-zoom")]:a.zoom,...S.style},...J,...xC(g),nodesDraggable:l})})})},mC=()=>{const{editable:e}=on();return e?o.jsxRuntimeExports.jsx(SR,{}):null},fC=e=>o.jsxRuntimeExports.jsx(f.Box,{x:!0,className:u.CSS.BE("diagram","controls"),...e}),hC=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=on();return o.jsxRuntimeExports.jsx(Hl.Toggle,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:u.K$1.BOTTOM_LEFT,size:"small",tooltip:`${n?"Disable":"Enable"} editing`,...t,children:n?o.jsxRuntimeExports.jsx(f.EditOff,{}):o.jsxRuntimeExports.jsx(f.Edit,{})})},gC=({onClick:e,...t})=>{const{fitView:n}=At(),{fitViewOnResize:s,setFitViewOnResize:r}=on();return o.jsxRuntimeExports.jsx(Hl.Toggle,{onClick:i=>{n(Yo),e?.(i)},value:s,onChange:r,rightClickToggle:!0,tooltip:o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:u.K$1.BOTTOM_LEFT,size:"small",...t,children:o.jsxRuntimeExports.jsx(f.Expand,{})})},ix=["zoom","pan","select"],jC=()=>{const{viewportMode:e,onViewportModeChange:t}=on();return o.jsxRuntimeExports.jsxs(pe.Buttons,{keys:ix,value:e,onChange:t,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pan",size:"small",children:o.jsxRuntimeExports.jsx(f.Pan,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"select",size:"small",children:o.jsxRuntimeExports.jsx(f.Selection,{})})]})},EC=e=>o.jsxRuntimeExports.jsx(Xd,{children:o.jsxRuntimeExports.jsx(pC,{...e})}),yC=Object.freeze(Object.defineProperty({__proto__:null,Background:mC,Controls:fC,DefaultPath:nx,Diagram:EC,FitViewControl:gC,HandleLayout:sx,NodeLayout:Ks,NodeRenderer:rx,PATHS:tx,SelectPathType:tC,SelectViewportModeControl:jC,ToggleEditControl:hC,VIEWPORT_MODES:ix,alignNodes:g3,calcPath:gt,edgeConverter:ns,edgeZ:f3,nodeConverter:hu,nodeZ:h3,offsetPath:FR,rfEdgeDataZ:du,selectNode:Zs,selectNodeBox:Oe,selectNodeLayout:nC,translateEdgesBackward:pu,translateEdgesForward:Br,translateNodesBackward:xu,translateNodesForward:Dr,translateViewportBackward:fu,translateViewportForward:mu,use:iC,useContext:on,viewportZ:m3},Symbol.toStringTag,{value:"Module"})),SC=({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=o.jsxRuntimeExports.jsx(f.Summary,{center:!0,level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:l,...a})=>{const c=f.useMemoDeepEqual({font:t,color:i,telem:l,visible:s}),[,{scrolling:d,empty:x},p]=f.use$2({type:T.Log.TYPE,schema:T.logState,initialState:{empty:!0,region:u.Ho.ZERO,scrolling:!1,wheelPos:0,...c}});j.useEffect(()=>{p(h=>({...h,...c}))},[c,p]);const m=Pn(j.useCallback(h=>p(g=>({...g,region:h})),[p]));return o.jsxRuntimeExports.jsx("div",{ref:m,className:u.CSS(u.CSS.B("log"),n),onWheel:h=>{p(g=>({...g,wheelPos:g.wheelPos-h.deltaY,scrolling:g.scrolling?g.scrolling:h.deltaY<0}))},...a,children:x?r:o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.BE("log","live"),d&&u.CSS.M("active")),variant:"outlined",onClick:()=>p(h=>({...h,scrolling:!h.scrolling})),tooltip:d?"Resume Scrolling":"Pause Scrolling",tooltipLocation:u.K$1.BOTTOM_LEFT,children:o.jsxRuntimeExports.jsx(f.Dynamic,{})})})},RC=Object.freeze(Object.defineProperty({__proto__:null,Log:SC},Symbol.toStringTag,{value:"Module"})),CC="Schematic.Grid",Ys=u.CSS.B("drag-handle"),wC=e=>{const n=Zs(e).closest(".react-flow__pane");n!=null&&f.triggerReflow(n)},Bn=e=>{const t=({symbolKey:s,items:r,onLocationChange:i})=>{const l=`${s}.${CC}`,[a,c]=j.useState(!1),d=j.useMemo(()=>f.canDropOfType(l),[l]),x=f.useSyncedRef(i),{startDrag:p,onDragEnd:m,...h}=f.useDragAndDrop({type:l,canDrop:d,onDrop:j.useCallback(({items:R})=>(c(!1),R),[]),onDragOver:j.useCallback(R=>{const{items:_}=R;c(d(R)),_.forEach(({key:y})=>x.current(y,e))},[])}),g=r.filter(R=>R.location===e),E=j.useCallback((R,_)=>{p([{key:_,type:l}]),document.addEventListener("mousemove",m,{once:!0})},[p,l,m]),S=d(f.useDraggingState());return o.jsxRuntimeExports.jsx(f.Box,{direction:u.K$1.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e),u.CSS.dropRegion(S),a&&u.CSS.B("dragging-over"),S&&u.CSS.B("dragging")),onDragLeave:()=>c(!1),empty:!0,...h,children:g.map(({element:R,key:_})=>o.jsxRuntimeExports.jsx(j.Fragment,{children:j.cloneElement(R,{draggable:!0,onDragStart:y=>E(y,_),onDragEnd:m,style:{...R.props.style,cursor:"grab"}})},_))})};return({symbolKey:s,...r})=>{const{editable:i,items:l}=r;if(i)return o.jsxRuntimeExports.jsx(t,{symbolKey:s,...r});const a=l.filter(c=>c.location===e);return a.length===0?null:o.jsxRuntimeExports.jsx(f.Box,{direction:u.K$1.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e)),empty:!0,children:a.map(({element:c,key:d})=>o.jsxRuntimeExports.jsx(j.Fragment,{children:c},d))})}},bC=Bn("top"),vC=Bn("left"),_C=Bn("right"),kC=Bn("bottom"),LC=Bn("center"),It=({editable:e,allowRotate:t=!0,children:n,allowCenter:s,onRotate:r,symbolKey:i,...l})=>{const a=j.useRef(e);return e!==a.current&&(wC(i),a.current=e),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(bC,{editable:e,symbolKey:i,...l},`top-${i}`),o.jsxRuntimeExports.jsx(vC,{editable:e,symbolKey:i,...l},`left-${i}`),o.jsxRuntimeExports.jsx(_C,{editable:e,symbolKey:i,...l},`right-${i}`),o.jsxRuntimeExports.jsx(kC,{editable:e,symbolKey:i,...l},`bottom-${i}`),s&&o.jsxRuntimeExports.jsx(LC,{editable:e,symbolKey:i,...l},`center-${i}`),e&&t&&o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.BE("grid","rotate"),size:"tiny",variant:"filled",onClick:r,children:o.jsxRuntimeExports.jsx(f.Rotate,{})}),o.jsxRuntimeExports.jsx("div",{className:Ys,children:n})]})},MC=T.MODES,PC=({aetherKey:e,sink:t,mode:n})=>{const s=f.useMemoDeepEqual({sink:t,mode:n}),r=j.useRef({trigger:0,...s}),{setState:i}=f.useLifecycle({aetherKey:e,type:T.Button.TYPE,schema:T.buttonStateZ,initialState:r.current});j.useEffect(()=>{r.current={...r.current,...s},i(r.current)},[s,i,e]);const l=j.useCallback(()=>{r.current.trigger+=T.MOUSE_UP_INCREMENT,i(r.current)},[i]),a=j.useCallback(()=>{r.current.trigger+=T.MOUSE_DOWN_INCREMENT,i(r.current)},[i]);return{onClick:l,onMouseDown:a,onMouseUp:l}},NC=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:MC,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"fire",tooltip:"Output true when clicked",children:"Fire"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"momentary",tooltip:"Output true on press, false on release",children:"Momentary"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pulse",tooltip:"Output true and then immediately output false on click",children:"Pulse"})]}),TC=({value:e,hideOuter:t=!1,showOuterCenter:n=!1,hideInner:s,onChange:r})=>{const{outer:i}=e,l=c=>()=>r({...e,...c}),a=u.CSS.B("select","orientation");return t?o.jsxRuntimeExports.jsx(Al,{className:a,value:e,onChange:r}):o.jsxRuntimeExports.jsxs(f.Box,{className:a,align:"center",justify:"center",gap:"tiny",children:[o.jsxRuntimeExports.jsx(it,{selected:i==="top",onClick:l({outer:"top"})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",gap:"tiny",children:[o.jsxRuntimeExports.jsx(it,{selected:i==="left",onClick:l({outer:"left"})}),o.jsxRuntimeExports.jsx(Al,{hideInner:s,value:e,onChange:r,showOuterCenter:n}),o.jsxRuntimeExports.jsx(it,{selected:i==="right",onClick:l({outer:"right"})})]}),o.jsxRuntimeExports.jsx(it,{selected:i==="bottom",onClick:l({outer:"bottom"})})]})},Al=({value:e,onChange:t,className:n,hideInner:s=!1,showOuterCenter:r=!1,...i})=>{const{inner:l}=e,a=x=>()=>t({...e,...x});let c={};s&&(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"});let d=null;return r?d=o.jsxRuntimeExports.jsx(it,{selected:e.outer==="center",onClick:a({outer:"center"})}):d=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(it,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="top",onClick:a({inner:"top"})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",children:[o.jsxRuntimeExports.jsx(it,{style:c,disabled:s,selected:l==="left",onClick:a({inner:"left"})}),o.jsxRuntimeExports.jsx(it,{style:c,disabled:s,selected:l==="right",onClick:a({inner:"right"})})]}),o.jsxRuntimeExports.jsx(it,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="bottom",onClick:a({inner:"bottom"})})]}),o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(n,u.CSS.B("value"),r&&u.CSS.M("show-outer-center")),y:!0,align:"center",justify:"center",empty:!0,...i,children:d})},it=({selected:e,className:t,...n})=>o.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(t,u.CSS.selected(e)),size:"tiny",...n,children:o.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Pe=({className:e,direction:t,...n})=>o.jsxRuntimeExports.jsx(f.Box,{direction:t,align:"stretch",className:u.CSS(u.CSS.B("symbol-form"),e),gap:t==="x"?"large":"medium",...n}),Et=({hideOuter:e,hideInner:t,showOuterCenter:n,...s})=>t&&e?null:o.jsxRuntimeExports.jsx(Ee,{label:"Orientation",padHelpText:!1,...s,children:({value:r,onChange:i})=>o.jsxRuntimeExports.jsx(TC,{value:{inner:r.orientation??"top",outer:r.label?.orientation??"top"},hideInner:t,hideOuter:e,showOuterCenter:n,onChange:l=>i({...r,orientation:l.inner,label:{...r.label,orientation:l.outer}})})}),ut=({path:e,omit:t=[]})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ee,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Text$2,{selectOnFocus:!0,...n})}),o.jsxRuntimeExports.jsx($e,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px",dragScale:{x:1,y:.5}},padHelpText:!1}),o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(en,{value:n,onChange:s})}),o.jsxRuntimeExports.jsx(Ee,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:n,onChange:s})}),o.jsxRuntimeExports.jsx(Ee,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(qa,{value:n,onChange:s,yDirection:"down"})})]}),Be=e=>o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(Ne.Swatch,{value:t??u.ir.setAlpha(u.ir.ZERO,1),onChange:n,...r,bordered:!0})}),lx=e=>o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:{x:.75,y:.5},bounds:{lower:50,upper:1e3},endContent:"%",value:Math.round(t*100),onChange:s=>n(parseFloat((s/100).toFixed(2)))})}),xe=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",empty:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(ut,{omit:e,path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color",optional:!0}),o.jsxRuntimeExports.jsx(Ee,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:s=>o.jsxRuntimeExports.jsx(f.Switch$1,{...s})}),o.jsxRuntimeExports.jsx(lx,{path:"scale"})]})]}),o.jsxRuntimeExports.jsx(Et,{path:"",hideInner:t,hideOuter:n})]}),AC=({path:e})=>{const{value:t,onChange:n}=jt(e),s=T.sourcePipelinePropsZ.parse(t.source?.props),r=T.sinkPipelinePropsZ.parse(t.sink?.props),i=T.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=T.setChannelValuePropsZ.parse(r.segments.setter.props),a=d=>{d??=0;const x=T.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:T.streamChannelValue({channel:d}),threshold:T.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:x})},c=d=>{d??=0;const x=T.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:T.setChannelValue({channel:d}),setpoint:T.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),p=T.authoritySource({channel:d}),m=T.acquireChannelControl({channel:d,authority:255});n({...t,sink:x,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:m,source:p},indicator:{statusSource:p}}})};return o.jsxRuntimeExports.jsxs(Pe,{x:!0,grow:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"State Channel",grow:!0,children:o.jsxRuntimeExports.jsx(_t,{value:i.channel,onChange:a})}),o.jsxRuntimeExports.jsx(Ae.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(_t,{value:l.channel,onChange:c})}),o.jsxRuntimeExports.jsx(Ls,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},ei=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],Re=({hideInnerOrientation:e})=>{const t=j.useCallback(({tabKey:s})=>{switch(s){case"control":return o.jsxRuntimeExports.jsx(AC,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{hideInnerOrientation:e})}},[e]),n=Me.useStatic({tabs:ei,content:t});return o.jsxRuntimeExports.jsx(Me.Tabs,{...n})},pt={y:2,x:.25},En={lower:0,upper:2e3},Il={lower:0,upper:51},ax=({includeBorderRadius:e=!1,includeStrokeWidth:t=!1})=>o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(ut,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Be,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(Ee,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:pt,bounds:Il,endContent:"%",...n})}),o.jsxRuntimeExports.jsx(Ee,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:pt,bounds:Il,endContent:"%",...n})}),e&&o.jsxRuntimeExports.jsx(Ee,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:pt,bounds:En,endContent:"px",...n})}),t&&o.jsxRuntimeExports.jsx(Ee,{path:"strokeWidth",hideIfNull:!0,optional:!0,label:"Border Width",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:pt,bounds:{lower:0,upper:21},endContent:"px",...n})}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.width",label:"Width",grow:!0,children:({value:n,...s})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:pt,bounds:En,endContent:"px",...s})}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.height",label:"Height",grow:!0,children:({value:n,...s})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:pt,bounds:En,endContent:"px",...s})})]})]}),o.jsxRuntimeExports.jsx(Et,{path:"",hideInner:!0,showOuterCenter:!0,label:"Label Location"})]}),IC=()=>o.jsxRuntimeExports.jsx(Pe,{direction:"x",align:"stretch",children:o.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(ut,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Be,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx($e,{path:"rotation",label:"Rotation",inputProps:{dragScale:{x:1,y:.25},bounds:{lower:0,upper:360},endContent:"°"},grow:!0}),o.jsxRuntimeExports.jsx($e,{path:"numSides",label:"Number of Sides",inputProps:{dragScale:{x:.5,y:.1},bounds:{lower:3,upper:21}},grow:!0}),o.jsxRuntimeExports.jsx($e,{path:"sideLength",label:"Side Length",inputProps:{dragScale:{x:1,y:1},bounds:{lower:10,upper:500},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx($e,{path:"cornerRounding",label:"Corner Rounding",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:181},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx($e,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),OC=()=>o.jsxRuntimeExports.jsx(Pe,{direction:"x",align:"stretch",children:o.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(ut,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Be,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx($e,{path:"radius",label:"Radius",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:500},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx($e,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),cx=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],DC={dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"},BC=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsxs(Pe,{y:!0,empty:!0,children:[o.jsxRuntimeExports.jsx(Ar,{path:""}),";"]});case"redline":return o.jsxRuntimeExports.jsx(Pe,{y:!0,empty:!0,children:o.jsxRuntimeExports.jsx(Tr,{path:"redline"})});default:return o.jsxRuntimeExports.jsxs(Pe,{x:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(ut,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Ee,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(f.Text$2,{...s})}),o.jsxRuntimeExports.jsx($e,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:DC}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:r})=>o.jsxRuntimeExports.jsx(en,{value:s,onChange:r})})]})]}),o.jsxRuntimeExports.jsx(Et,{path:"",hideInner:!0})]})}},[]),t=Me.useStatic({tabs:cx,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},$C=({path:e})=>{const{value:t,onChange:n}=jt(e),s=T.sourcePipelinePropsZ.parse(t.source?.props),r=T.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=T.withinBoundsProps.parse(s.segments.threshold.props),l=c=>{c??=0;const d=T.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:T.streamChannelValue({channel:c}),threshold:T.withinBounds({trueBound:{lower:i.trueBound.lower??.9,upper:i.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:d})},a=c=>{const d=T.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:T.streamChannelValue({channel:r.channel}),threshold:T.withinBounds({trueBound:c})},outlet:"threshold"});n({...t,source:d})};return o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(_t,{value:r.channel,onChange:l})}),o.jsxRuntimeExports.jsx(Ae.Item,{label:"Lower Threshold",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.lower??.9,onChange:c=>a({...i.trueBound,lower:c})})}),o.jsxRuntimeExports.jsx(Ae.Item,{label:"Upper Threshold",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.upper??1.1,onChange:c=>a({...i.trueBound,upper:c})})})]})},zC=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsx($C,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{})}},[]),t=Me.useStatic({tabs:cx,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},VC=({path:e})=>{const{value:t,onChange:n}=jt(e),s=T.sinkPipelinePropsZ.parse(t.sink?.props),r=T.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=T.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:T.setChannelValue({channel:l}),setpoint:T.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),c=T.authoritySource({channel:l}),d=T.acquireChannelControl({channel:l,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:c},showIndicator:!0,indicator:{statusSource:c}}})};return o.jsxRuntimeExports.jsxs(Pe,{y:!0,empty:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Ae.Item,{label:"Output Channel",grow:!0,padHelpText:!1,children:o.jsxRuntimeExports.jsx(_t,{value:r.channel,onChange:i})}),o.jsxRuntimeExports.jsx($e,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0,padHelpText:!1}),o.jsxRuntimeExports.jsx(Ls,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0,padHelpText:!1})]}),o.jsxRuntimeExports.jsx(Ee,{path:"mode",label:"Mode",optional:!0,children:({value:l,onChange:a})=>o.jsxRuntimeExports.jsx(NC,{value:l,onChange:a})})]})},HC=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(VC,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=Me.useStatic({tabs:ei,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},FC=({path:e})=>{const{value:t,onChange:n}=jt(e),s=T.sinkPipelinePropsZ.parse(t.sink?.props),r=T.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=T.sinkPipeline("number",{connections:[],segments:{setter:T.setChannelValue({channel:l})},inlet:"setter"}),c=T.authoritySource({channel:l}),d=T.acquireChannelControl({channel:l,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:c},showIndicator:!0,indicator:{statusSource:c}},disabled:l==0})};return o.jsxRuntimeExports.jsx(Pe,{x:!0,grow:!0,align:"stretch",children:o.jsxRuntimeExports.jsx(Ae.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(_t,{value:r.channel,onChange:i})})})},ZC=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(FC,{path:""});default:return o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"stretch",grow:!0,gap:"small",children:[o.jsxRuntimeExports.jsx(ut,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(hr,{path:"units",label:"Units",align:"start",padHelpText:!1}),o.jsxRuntimeExports.jsx(Ee,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:r})=>o.jsxRuntimeExports.jsx(na,{value:s,onChange:r})}),o.jsxRuntimeExports.jsx(Be,{path:"color"})]})]}),o.jsxRuntimeExports.jsx(Et,{path:"",hideInner:!0})]})}},[]),t=Me.useStatic({tabs:ei,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},KC=()=>{const e=jt("autoFit",{optional:!0});return o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ee,{path:"value",label:"Text",padHelpText:!1,grow:!0,children:t=>o.jsxRuntimeExports.jsx(f.Text$2,{...t})}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Text Size",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(en,{value:t,onChange:n})}),o.jsxRuntimeExports.jsx(Ee,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:t,onChange:n})})]}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Ee,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(f.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:o.jsxRuntimeExports.jsx(f.Button,{onClick:()=>e?.onChange(!0),disabled:e?.value===!0,variant:"outlined",tooltip:e?.value===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:o.jsxRuntimeExports.jsx(f.AutoFitWidth,{})})})})]})]}),o.jsxRuntimeExports.jsx(Et,{path:""})]})},YC=()=>o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(ut,{path:"label",omit:["maxInlineSize","align","direction"]}),o.jsxRuntimeExports.jsx(Be,{path:"color"})]}),o.jsxRuntimeExports.jsx(Et,{path:"",hideOuter:!0})]}),WC=()=>o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(ut,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Be,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:pt,bounds:En,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:pt,bounds:En,endContent:"px",...t})})]})]}),o.jsxRuntimeExports.jsx(Et,{path:"",hideInner:!0})]}),Ot=()=>o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(ut,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(lx,{path:"scale"}),o.jsxRuntimeExports.jsx(Ls,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),o.jsxRuntimeExports.jsx(Et,{path:""})]}),GC=()=>o.jsxRuntimeExports.jsx(ax,{includeBorderRadius:!0,includeStrokeWidth:!0}),UC=()=>o.jsxRuntimeExports.jsx(Re,{hideInnerOrientation:!0}),P=e=>o.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),ge=e=>o.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),ke=e=>o.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),fe=e=>o.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),XC={left:{left:Q.Left,right:Q.Right,top:Q.Top,bottom:Q.Bottom},right:{left:Q.Right,right:Q.Left,top:Q.Bottom,bottom:Q.Top},top:{left:Q.Bottom,right:Q.Top,top:Q.Left,bottom:Q.Right},bottom:{left:Q.Top,right:Q.Bottom,top:Q.Right,bottom:Q.Left}},qC=(e,t)=>XC[t][e],QC=(e,t=!1)=>{if(t)return e;switch(e){case Q.Left:return Q.Right;case Q.Right:return Q.Left;case Q.Top:return Q.Bottom;case Q.Bottom:return Q.Top;default:return Q.Top}},JC=(e,t,n,s=!1)=>s?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},W=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=fR()}catch{return null}const r=j.useRef(null),i=j.useRef(!0);return j.useEffect(()=>{if(r.current==null)return;if(i.current){i.current=!1;return}const a=r.current.closest(".react-flow__node")?.getAttribute("data-id");a!=null&&s?.(a)},[t,n]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("span",{ref:r}),e]})},b=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:r,top:i,style:l,...a})=>{const c=JC(i,s,t,n);return o.jsxRuntimeExports.jsx(Ln,{position:QC(qC(e,t),!r),...a,type:"source",onClick:d=>d.stopPropagation(),className:(u.CSS.B("handle"),u.CSS.BE("handle",a.id)),style:{left:`${c.left}%`,top:`${c.top}%`,...l}})},he=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:r,...i})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("symbol-primitive"),u.CSS.B("symbol-primitive-toggle"),s!=null&&u.CSS.loc(s),t&&u.CSS.M("enabled"),n&&u.CSS.M("triggered"),e),color:u.ir.cssString(r),...i}),le=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.B("symbol-primitive"),e),...t}),e6=.8,X=({dimensions:e,orientation:t="left",children:n,className:s,color:r,style:i={},scale:l=1,...a})=>{e=u.g.construct(t)==="y"?u._.swap(e):e;const d=u.ir.cssString(r),x=f.use();let p={...i,aspectRatio:`${e.width} / ${e.height}`,width:u._.scale(e,l*e6).width};return r!=null&&(p={...p,[u.CSS.var("symbol-color")]:u.ir.rgbString(r),[u.CSS.var("symbol-color-contrast")]:u.ir.rgbString(u.ir.pickByContrast(r,x.colors.gray.l0,x.colors.gray.l11))}),o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u._.svgViewBox(e),className:u.CSS(u.CSS.loc(t),s),fill:d,stroke:d,...a,style:p,children:o.jsxRuntimeExports.jsx("g",{children:n})})},ux=({className:e,orientation:t="left",scale:n,color:s,...r})=>{const i=u.ir.cssString(s);return o.jsxRuntimeExports.jsxs(he,{...r,orientation:t,className:u.CSS(u.CSS.B("four-way-valve"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:12.037,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:87.963,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:7.2916,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:92.6084,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:108,height:96},color:s,scale:n,children:[o.jsxRuntimeExports.jsx(P,{d:"M3.02937 72.7038C2.50936 73.1041 2.50936 73.8883 3.02937 74.2886L7.14001 77.453C7.79757 77.9592 8.75 77.4904 8.75 76.6606V70.3318C8.75 69.502 7.79757 69.0332 7.14001 69.5394L3.02937 72.7038Z",fill:i}),o.jsxRuntimeExports.jsx(P,{d:"M54.2 48L17.0545 29.2035C15.059 28.1937 12.7 29.6438 12.7 31.8803V64.1197C12.7 66.3562 15.059 67.8063 17.0545 66.7965L54.2 48ZM54.2 48L91.3455 29.2035C93.341 28.1937 95.7 29.6438 95.7 31.8803V64.1197C95.7 66.3562 93.341 67.8063 91.3455 66.7965L54.2 48Z"}),o.jsxRuntimeExports.jsx(P,{d:"M54.2 48L35.4035 85.1455C34.3937 87.141 35.8439 89.5 38.0803 89.5H70.3197C72.5562 89.5 74.0063 87.141 72.9965 85.1455L54.2 48ZM54.2 48L35.4035 10.8545C34.3937 8.85901 35.8439 6.5 38.0803 6.5H70.3197C72.5562 6.5 74.0063 8.85901 72.9965 10.8545L54.2 48Z"}),o.jsxRuntimeExports.jsx(P,{d:"M8.70001 73.5C24.7 73.5 28.7 86.8333 28.7 93.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M105.371 23.2962C105.891 22.8959 105.891 22.1117 105.371 21.7114L101.26 18.547C100.602 18.0408 99.65 18.5096 99.65 19.3394V25.6682C99.65 26.498 100.602 26.9668 101.26 26.4606L105.371 23.2962Z",fill:i}),o.jsxRuntimeExports.jsx(P,{d:"M99.7 22.5C83.7 22.5 79.7 9.16667 79.7 2.5",strokeLinecap:"round"})]})]})},dx=({color:e,orientation:t="left",scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("three-way-valve")),orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),xx=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:o.jsxRuntimeExports.jsx(P,{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"})})]}),px=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{className:u.CSS(u.CSS.B("solenoid-valve"),s&&u.CSS.M("normally-open"),e),...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(P,{className:u.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"}),o.jsxRuntimeExports.jsx(fe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),o.jsxRuntimeExports.jsx(ge,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),mx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{className:u.CSS(u.CSS.B("relief-valve"),e),enabled:r,...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),fx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{orientation:t,className:u.CSS(u.CSS.B("check-valve"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),hx=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(le,{...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"7",cy:"7",r:"4",fill:i}),o.jsxRuntimeExports.jsx(P,{d:"M7 39.5V11.5941C7 9.42886 9.22384 7.97669 11.2063 8.84738L76.7937 37.6526C78.7762 38.5233 81 37.0711 81 34.9059V6",strokeLinecap:"round"})]})]})},gx=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(le,{orientation:t,className:u.CSS(u.CSS.B("check-valve-with-arrow"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:8.602,top:60.65,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.775,top:60.65,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:93,height:57},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M67.4706 5.20759C67.9906 5.6079 67.9906 6.3921 67.4706 6.79241L63.36 9.95678C62.7024 10.463 61.75 9.99421 61.75 9.16437V2.83563C61.75 2.00579 62.7024 1.53702 63.36 2.04322L67.4706 5.20759Z",fill:i}),o.jsxRuntimeExports.jsx(P,{d:"M62.5 6H32.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(ke,{cx:"7.5",cy:"13.5",r:"6",fill:i}),o.jsxRuntimeExports.jsx(P,{d:"M49 34.5L11.8545 15.7035C9.85901 14.6937 7.5 16.1438 7.5 18.3803V50.6197C7.5 52.8562 9.85901 54.3063 11.8545 53.2965L49 34.5ZM49 34.5L86.1455 15.7035C88.141 14.6937 90.5 16.1438 90.5 18.3803V50.6197C90.5 52.8562 88.141 54.3063 86.1455 53.2965L49 34.5Z"})]})]})},jx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,orientation:n,className:u.CSS(u.CSS.B("angled-valve"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),Ex=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"43.5978",cy:"20.972",r:"19"}),o.jsxRuntimeExports.jsx(P,{d:"M26.5 12.8472L6.35452 2.17563C4.35901 1.16585 2 2.61598 2 4.85243V37.0918C2 39.3283 4.35901 40.7784 6.35453 39.7686L26.5 29.3472"}),o.jsxRuntimeExports.jsx(P,{d:"M60.5 28.8486L80.6455 39.5202C82.641 40.5299 85 39.0798 85 36.8434V4.60396C85 2.36751 82.641 0.917381 80.6455 1.92716L60.5 12.3486"})]})]}),yx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("three-way-ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.8,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"43.5978",cy:"21.722",r:"19"}),o.jsxRuntimeExports.jsx(P,{d:"M26.5 13.5972L6.35452 2.92563C4.35901 1.91585 2 3.36598 2 5.60243V37.8418C2 40.0783 4.35901 41.5284 6.35453 40.5186L26.5 30.0972"}),o.jsxRuntimeExports.jsx(P,{d:"M60.5 29.5986L80.6455 40.2702C82.641 41.2799 85 39.8298 85 37.5934V5.35396C85 3.11751 82.641 1.66738 80.6455 2.67716L60.5 13.0986"}),o.jsxRuntimeExports.jsx(P,{d:"M35.3737 38.7499L24.7021 58.8954C23.6923 60.8909 25.1425 63.2499 27.3789 63.2499H59.6183C61.8548 63.2499 63.3049 60.8909 62.2951 58.8954L51.8737 38.7499"})]})]}),Sx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("gate-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 2 L43.5 39.7965"})]})]}),Rx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-one"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 2V40"}),o.jsxRuntimeExports.jsx(ke,{cx:"43.5",cy:"21",r:"10",fill:u.ir.cssString(e)})]})]}),Cx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-two"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"43.5",cy:"21",r:"10",fill:u.ir.cssString(e)}),o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),o.jsxRuntimeExports.jsx(P,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),wx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("breather-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:8.081,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:91.919,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"91",cy:"49.5",r:"6",fill:u.ir.cssString(e)}),o.jsxRuntimeExports.jsx(ke,{cx:"8",cy:"7.5",r:"6",fill:u.ir.cssString(e)}),o.jsxRuntimeExports.jsx(P,{d:"M49.5 28.5L12.3545 9.70349C10.359 8.69372 8 10.1438 8 12.3803V44.6197C8 46.8562 10.359 48.3063 12.3545 47.2965L49.5 28.5ZM49.5 28.5L86.6455 9.70349C88.641 8.69372 91 10.1438 91 12.3803V44.6197C91 46.8562 88.641 48.3063 86.6455 47.2965L49.5 28.5Z"})]})]}),bx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)})]})]}),vx=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const i=u.ir.cssString(t);return o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:5,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{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}),o.jsxRuntimeExports.jsx(P,{d:"M33 24H2",strokeLinecap:"round"})]})]})},_x=({className:e,color:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M13 68V47C13 46.4477 13.4489 45.9892 13.9928 45.8933C16.1351 45.5152 21 43.7981 21 36C21 28.2019 16.1351 26.4848 13.9928 26.1068C13.4489 26.0108 13 25.5523 13 25V4",strokeWidth:"2"})]})]}),kx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(X,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(P,{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"})})]}),Lx=({className:e,orientation:t="left",color:n,scale:s=1,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:50,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(X,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:o.jsxRuntimeExports.jsx(P,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),Mx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("manual-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),o.jsxRuntimeExports.jsx(P,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),Px=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("orifice_plate"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{color:n,dimensions:{width:72,height:36},orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M24.5 33V22",strokeLinecap:"round"})]})]}),Ol=(e,t)=>e/t*100,Nx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:o.jsxRuntimeExports.jsx(P,{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 17"})})]}),Tx=e=>typeof e=="number"?{topLeft:u.K.construct(e),topRight:u.K.construct(e),bottomLeft:u.K.construct(e),bottomRight:u.K.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:u.K.construct(e.topLeft),topRight:u.K.construct(e.topRight),bottomLeft:u.K.construct(e.bottomLeft),bottomRight:u.K.construct(e.bottomRight)}:e,t6=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:r}=e;return`${t.x}% ${n.x}% ${r.x}% ${s.x}% / ${t.y}% ${n.y}% ${r.y}% ${s.y}%`},Ax={width:40,height:80},ti={x:50,y:10},Ws=({className:e,dimensions:t=Ax,borderRadius:n=ti,boxBorderRadius:s,color:r,backgroundColor:i,strokeWidth:l=2,...a})=>{const c=Tx(n),d=s==null,x=f.use(),{width:p,height:m}=t,h=j.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,m,p]),g=Ol(1,p),E=100-g,S=Ol(1,m),R=100-S;return o.jsxRuntimeExports.jsx(le,{className:u.CSS(e,u.CSS.B("tank")),style:{...t,borderRadius:s??t6(c),borderColor:u.ir.cssString(r??x.colors.gray.l11),backgroundColor:u.ir.cssString(i),borderWidth:l},...a,children:o.jsxRuntimeExports.jsxs(W,{refreshDeps:h,orientation:"left",children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:S,id:"1"}),d&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:g,top:c.topLeft.y,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:E,top:c.topRight.y,id:"3"})]}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:R,id:"4"}),d&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:g,top:100-c.bottomLeft.y,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:E,top:100-c.bottomRight.y,id:"6"})]}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:g,top:50,id:"7"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:E,top:50,id:"8"})]})})},n6=20,s6=(e,t,n=0,s=4)=>{const r=2*Math.PI/e,i=n*Math.PI/180,l=t/(2*Math.sin(Math.PI/e)),a=l+s/2;return Array.from({length:e}).map((c,d)=>{const x=r*d+i-Math.PI/2;return{x:a+l*Math.cos(x),y:a+l*Math.sin(x)}})},o6=(e,t,n)=>{const s=[],r=Math.min(n,t/2),i=e.length;if(i<3||r<=0)return`M ${e.map(l=>`${l.x},${l.y}`).join(" L ")} Z`;for(let l=0;l<i;l++){const a=e[(l-1+i)%i],c=e[l],d=e[(l+1)%i],x=c.x-a.x,p=c.y-a.y,m=d.x-c.x,h=d.y-c.y,g=Math.hypot(x,p),E=Math.hypot(m,h),S=r/g,R=r/E,_=c.x-x*S,y=c.y-p*S,C=c.x+m*R,v=c.y+h*R;l===0?s.push(`M ${_},${y}`):s.push(`L ${_},${y}`),s.push(`Q ${c.x},${c.y} ${C},${v}`)}return s.push("Z"),s.join(" ")},ni=({numSides:e,sideLength:t,rotation:n=0,color:s,backgroundColor:r,className:i,cornerRounding:l,strokeWidth:a,...c})=>{const d=f.use(),x=j.useMemo(()=>2*((a??2)+1),[a]),p=j.useMemo(()=>s6(e,t,n,x),[e,t,n,x]),m=j.useMemo(()=>o6(p,t,l??0),[p,t,l]),h=j.useMemo(()=>2*(t/(2*Math.sin(Math.PI/e)))+x,[t,e,x]);return o.jsxRuntimeExports.jsx(le,{className:u.CSS(i,u.CSS.B("polygon")),...c,children:o.jsxRuntimeExports.jsx(X,{dimensions:{width:h,height:h},children:o.jsxRuntimeExports.jsx(P,{d:m,fill:u.ir.cssString(r??d.colors.gray.l1),stroke:u.ir.cssString(s??d.colors.gray.l9),strokeWidth:a??2})})})},Ix=({radius:e,color:t,backgroundColor:n,className:s,strokeWidth:r,...i})=>{const l=(r??2)+1,a=e*2,c=a+2*l,d=a+2*l;return o.jsxRuntimeExports.jsxs(le,{className:u.CSS(s,u.CSS.B("circle-shape")),...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:"left",refreshDeps:e,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:l/d*100,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:(d-l)/d*100,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:l/c*100,top:50,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:(c-l)/c*100,top:50,id:"4"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:c,height:d},children:o.jsxRuntimeExports.jsx(ke,{cx:c/2,cy:d/2,r:e,stroke:u.ir.cssString(t),strokeWidth:r??2,fill:u.ir.cssString(n)})})]})},Ox=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{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.5 30H61Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M44.5 10V8C44.5 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.5 53"})]})]}),Dx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(e,u.CSS.B("regulator-manual")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:2.2989,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.381,top:75,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.619,top:75,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:84},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M43.5 20L43.5 2",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M19.5 2L67.5 2",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 63L6.35453 44.2035C4.35901 43.1937 2 44.6438 2 46.8803V79.1197C2 81.3562 4.35901 82.8063 6.35453 81.7965L43.5 63ZM43.5 63L80.6455 44.2035C82.641 43.1937 85 44.6438 85 46.8803V79.1197C85 81.3562 82.641 82.8063 80.6455 81.7965L43.5 63Z"}),o.jsxRuntimeExports.jsx(P,{d:"M60.5 40C62.1569 40 63.5231 38.6494 63.2755 37.0111C62.641 32.8129 60.681 28.8968 57.6421 25.8579C53.8914 22.1071 48.8043 20 43.5 20C38.1957 20 33.1086 22.1071 29.3579 25.8579C26.319 28.8968 24.359 32.8129 23.7245 37.0111C23.4769 38.6494 24.8431 40 26.5 40L43.5 40H60.5Z"}),o.jsxRuntimeExports.jsx(P,{d:"M60.5 40C62.1569 40 63.5231 38.6494 63.2755 37.0111C62.641 32.8129 60.681 28.8968 57.6421 25.8579C53.8914 22.1071 48.8043 20 43.5 20C38.1957 20 33.1086 22.1071 29.3579 25.8579C26.319 28.8968 24.359 32.8129 23.7245 37.0111C23.4769 38.6494 24.8431 40 26.5 40L43.5 40H60.5Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"63",x2:"43.5",y2:"40"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 20V18C43.5 16.3431 44.8431 15 46.5 15H79.5C81.1569 15 82.5 16.3431 82.5 18V34.4281C82.5 35.4126 82.017 36.3344 81.2076 36.8947L43.5 63"})]})]}),Bx=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("orifice"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[o.jsxRuntimeExports.jsx(P,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),$x=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("needle-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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:u.ir.cssString(n)}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),zx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("angled-relief-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),Vx=({className:e,color:t,dimensions:n,orientation:s="left",units:r="psi",unitsLevel:i="small",children:l,inlineSize:a=80,...c})=>{const d=u.ir.cssString(t),x=f.use(),p=t==null?"var(--pluto-gray-l0)":u.ir.cssString(u.ir.pickByContrast(t,x.colors.gray.l0,x.colors.gray.l11));return o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("value"),e),...c,style:{borderColor:d,height:n?.height,width:"100%"},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n?.width,inlineSize:a,maxWidth:n?.width},children:l}),o.jsxRuntimeExports.jsxs(W,{orientation:s,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.BE("value","units"),u.CSS.M(i)),style:{background:d},children:o.jsxRuntimeExports.jsx(f.Text,{level:i,color:p,children:r})})]})},Hx=({enabled:e=!1,onClick:t,orientation:n="left"})=>o.jsxRuntimeExports.jsxs(le,{orientation:n,children:[o.jsxRuntimeExports.jsx(f.Switch$1,{value:e,onClick:t,onChange:()=>{}}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Fx=({onClick:e,onMouseDown:t,onMouseUp:n,orientation:s="left",label:r="",color:i,size:l,level:a,onClickDelay:c})=>o.jsxRuntimeExports.jsxs(le,{orientation:s,children:[o.jsxRuntimeExports.jsx(f.Button,{variant:"filled",onClick:e,onMouseDown:t,onMouseUp:n,color:i,size:l,level:a,onClickDelay:c,children:r}),o.jsxRuntimeExports.jsxs(W,{orientation:s,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:s,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:s,left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:s,left:50,top:0,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:s,left:50,top:100,id:"4"})]})]}),Zx=({className:e,orientation:t="left",width:n,color:s,level:r,autoFit:i,align:l="center",value:a,onChange:c,...d})=>{const x={textAlign:l};return u.g.construct(t)==="y"?x.height=i?"fit-content":n:x.width=i?"fit-content":n,o.jsxRuntimeExports.jsx(le,{style:x,orientation:t,className:u.CSS(u.CSS.B("text-box"),u.CSS.loc(t),e),...d,children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS.BE("symbol","label"),color:u.ir.cssString(s),level:r,value:a,onChange:c})})},Kx=({orientation:e="left",className:t,onClick:n,children:s,value:r,units:i,color:l,onChange:a,size:c="small",disabled:d,...x})=>{const[p,m]=j.useState(r);return o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("setpoint"),t),orientation:e,...x,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:.5,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:100,top:50,id:"2",style:{zIndex:5}}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx(f.Numeric,{size:c,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,color:l,borderWidth:1,disabled:d,children:o.jsxRuntimeExports.jsx(f.Button,{size:c,variant:"filled",onClick:()=>a(p),color:l,children:"Set"})})]})},Yx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("screw-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(P,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(P,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Wx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("vacuum-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"})})]}),Gx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("cavity-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(P,{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:u.CSS(u.CSS.M("detail"),t)})]})]}),Ux=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("piston-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(P,{d:"M 23 32, h 16, m 0 -8, v 16",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Xx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("static-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),qx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("rotary-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Qx=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,orientation:n,className:u.CSS(u.CSS.B("light"),s&&u.CSS.M("enabled"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:o.jsxRuntimeExports.jsx(ke,{cx:"32",cy:"32",r:"30"})})]}),Jx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.29885,top:69.565,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.70115,top:69.565,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:23.1479,top:23.61,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:11.11,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:76.8521,top:23.61,id:"5"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:69},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M43.5 49L6.35453 30.2035C4.35901 29.1937 2 30.6438 2 32.8803V65.1197C2 67.3562 4.35901 68.8063 6.35453 67.7965L43.5 49ZM43.5 49L80.6455 30.2035C82.641 29.1937 85 30.6438 85 32.8803V65.1197C85 67.3562 82.641 68.8063 80.6455 67.7965L43.5 49Z"}),o.jsxRuntimeExports.jsx(ge,{x:"21",y:"6.5",width:"44",height:"18",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M43 6.5V4C43 2.34315 44.3431 1 46 1H79C80.6569 1 82 2.34315 82 4V20.4281C82 21.4126 81.517 22.3344 80.7076 22.8947L43 49"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"24.5"})]})]}),ep=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(e,u.CSS.B("regulator-motorized")),...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:35.6321,top:13.72549,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:1.96078,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:64.3679,top:13.72549,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:24.1379,top:46.078,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:75.8621,top:46.078,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:78.43137,id:"6"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:78.43137,id:"7"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:102},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M43.5 80.5L6.35453 61.7035C4.35901 60.6937 2 62.1438 2 64.3803V96.6197C2 98.8562 4.35901 100.306 6.35453 99.2965L43.5 80.5ZM43.5 80.5L80.6455 61.7035C82.641 60.6937 85 62.1438 85 64.3803V96.6197C85 98.8562 82.641 100.306 80.6455 99.2965L43.5 80.5Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"80.5",x2:"43",y2:"56"}),o.jsxRuntimeExports.jsx(P,{d:"M43 38V35.5C43 33.8431 44.3431 32.5 46 32.5H79C80.6569 32.5 82 33.8431 82 35.5V51.9281C82 52.9126 81.517 53.8344 80.7076 54.3947L43 80.5"}),o.jsxRuntimeExports.jsx(ge,{x:"21",y:"38",width:"44",height:"18",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M43 38V26",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(ke,{cx:"43",cy:"14",r:"12"})]})]}),tp=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:50,top:1,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:88,height:86},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(P,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44"}),o.jsxRuntimeExports.jsx(P,{d:"M43 1L45 65"})]})]}),np=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(P,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),sp=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(ge,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),op=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(ge,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),rp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(ge,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),ip=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M5.375 36L70.8204 48.7138C74.0584 49.3428 74.0573 53.9765 70.8189 54.6039L14.7952 65.4584C11.5729 66.0827 11.5494 70.6856 14.7651 71.3429L81.5208 84.9873",strokeLinecap:"round"})]})]}),lp=({id:e,className:t,orientation:n="right",label:s="text",color:r,level:i="p",onLabelChange:l,...a})=>{const c=document.querySelector(`[data-id="${e}"]`);c&&c.classList.add(n);const d=u.g.construct(n)==="y";return o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("arrow"),u.CSS.loc(n),t),orientation:n,...a,children:[o.jsxRuntimeExports.jsx("div",{className:"wrapper",children:o.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:u.ir.cssString(r)},children:o.jsxRuntimeExports.jsx("div",{className:"bg",children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{value:s,onChange:l,level:i,className:u.CSS.BE("symbol","label")})})})}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:d,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:d,id:"2"})]}),o.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:o.jsxRuntimeExports.jsx("defs",{children:o.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[o.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),o.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),o.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},ap=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("vent"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(X,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),cp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("iso-filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:95,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),up=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("flow-straightener"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:93,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:72,height:36},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2.5",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M10.5 26.5H60.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M10.5 9.5H60.5",strokeLinecap:"round"})]})]}),dp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("heater-element"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:11.9,top:5.55555556,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:11.9,top:94,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:21,height:36},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M2.5 34.0005H14.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M2.5 2.00049L14.5 2.00049",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M14.3793 10.0013C14.9046 10.0013 15.4248 10.1048 15.9101 10.3058C16.3954 10.5068 16.8363 10.8015 17.2078 11.1729C17.5792 11.5443 17.8738 11.9853 18.0749 12.4706C18.2759 12.9559 18.3793 13.4761 18.3793 14.0013C18.3793 14.5266 18.2759 15.0468 18.0749 15.5321C17.8738 16.0174 17.5792 16.4583 17.2078 16.8298C16.8363 17.2012 16.3954 17.4958 15.9101 17.6969C15.4248 17.8979 14.9046 18.0013 14.3793 18.0013"}),o.jsxRuntimeExports.jsx(P,{d:"M14.5 2.00049C15.0253 2.00049 15.5454 2.10395 16.0307 2.30497C16.516 2.50599 16.957 2.80063 17.3284 3.17206C17.6999 3.5435 17.9945 3.98445 18.1955 4.46975C18.3965 4.95506 18.5 5.4752 18.5 6.00049C18.5 6.52578 18.3965 7.04592 18.1955 7.53122C17.9945 8.01652 17.6999 8.45748 17.3284 8.82892C16.957 9.20035 16.516 9.49499 16.0307 9.69601C15.5454 9.89703 15.0253 10.0005 14.5 10.0005"}),o.jsxRuntimeExports.jsx(P,{d:"M14.5 18.0005C15.0253 18.0005 15.5454 18.104 16.0307 18.305C16.516 18.506 16.957 18.8006 17.3284 19.1721C17.6999 19.5435 17.9945 19.9845 18.1955 20.4698C18.3965 20.9551 18.5 21.4752 18.5 22.0005C18.5 22.5258 18.3965 23.0459 18.1955 23.5312C17.9945 24.0165 17.6999 24.4575 17.3284 24.8289C16.957 25.2003 16.516 25.495 16.0307 25.696C15.5454 25.897 15.0253 26.0005 14.5 26.0005"}),o.jsxRuntimeExports.jsx(P,{d:"M14.6206 25.9995C15.1459 25.9995 15.6661 26.103 16.1514 26.304C16.6367 26.505 17.0776 26.7997 17.4491 27.1711C17.8205 27.5425 18.1151 27.9835 18.3162 28.4688C18.5172 28.9541 18.6206 29.4742 18.6206 29.9995C18.6206 30.5248 18.5172 31.0449 18.3162 31.5302C18.1151 32.0155 17.8205 32.4565 17.4491 32.8279C17.0776 33.1994 16.6367 33.494 16.1514 33.695C15.6661 33.896 15.1459 33.9995 14.6206 33.9995"})]})]}),xp=({className:e,dimensions:t=Ax,borderRadius:n=ti,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const a=Tx(n),c=f.use(),d=j.useMemo(()=>[t,n,a],[a.bottomLeft,a.bottomRight,a.topLeft,a.topRight,t.height,t.width]),x=u.ir.cssString(r??c.colors.gray.l11),p=i==null?void 0:u.ir.cssString(i),m=t.width/66,h=t.height/180,g=`scale(${m},${h})`;return o.jsxRuntimeExports.jsxs(le,{className:u.CSS(e,u.CSS.B("cylinder")),style:{...t},...l,children:[o.jsxRuntimeExports.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:g,children:o.jsxRuntimeExports.jsx("path",{d:"M23 33.6712C11.9844 36.0332 3 42.4382 3 52.8862V174.568C3 176.225 4.34315 177.568 6 177.568H60C61.6569 177.568 63 176.225 63 174.568V52.8862C63 36.3342 40.4511 29.9292 23 33.6712ZM23 33.6712V13.3181C23 0.318109 42.9975 0.318123 42.9975 13.3181V33.6712",vectorEffect:"non-scaling-stroke",strokeWidth:"2",stroke:x,transform:g,fill:p})}),o.jsxRuntimeExports.jsxs(W,{refreshDeps:d,orientation:"left",children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:2,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:35,top:10,id:"9"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:65,top:10,id:"10"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:40,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:40,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:60,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:60,id:"6"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:80,id:"7"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},pp=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M46.3625 54.1079C45.6312 54.4779 45.6311 55.5223 46.3624 55.8924L81.7435 73.7989C83.7389 74.8088 86.098 73.3588 86.0982 71.1224L86.1002 38.883C86.1003 36.6465 83.7414 35.1962 81.7458 36.2059L46.3625 54.1079Z",stroke:l}),o.jsxRuntimeExports.jsx(P,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M41.6389 55.8923C42.3702 55.5222 42.3702 54.4778 41.6389 54.1077L6.2567 36.2035C4.26118 35.1937 1.90217 36.6438 1.90217 38.8803L1.90217 71.1197C1.90217 73.3562 4.26119 74.8063 6.2567 73.7965L41.6389 55.8923Z",stroke:l}),o.jsxRuntimeExports.jsx(ke,{cx:"44",cy:"55",r:"4",fill:l}),o.jsxRuntimeExports.jsx(P,{d:"M45 4C45 3.44772 44.5523 3 44 3C43.4477 3 43 3.44772 43 4H45ZM37.5777 24.7889L38.0249 23.8944L37.5777 24.7889ZM37.5777 21.2111L38.0249 22.1056L37.5777 21.2111ZM50.4223 31.2111L49.9751 32.1056L50.4223 31.2111ZM37.5777 44.7889L37.1305 45.6833L37.5777 44.7889ZM37.5777 41.2111L37.1305 40.3167L37.5777 41.2111ZM42.8944 47.4472L42.4472 48.3416L42.8944 47.4472ZM45 52V49.2361H43V52H45ZM43.3416 46.5528L38.0249 43.8944L37.1305 45.6833L42.4472 48.3416L43.3416 46.5528ZM38.0249 42.1056L50.8695 35.6833L49.9751 33.8944L37.1305 40.3167L38.0249 42.1056ZM50.8695 30.3167L38.0249 23.8944L37.1305 25.6833L49.9751 32.1056L50.8695 30.3167ZM38.0249 22.1056L50.8695 15.6833L49.9751 13.8944L37.1305 20.3167L38.0249 22.1056ZM50.8695 10.3167L45.5528 7.65836L44.6584 9.44721L49.9751 12.1056L50.8695 10.3167ZM45 6.76393V4H43V6.76393H45ZM45.5528 7.65836C45.214 7.48897 45 7.1427 45 6.76393H43C43 7.90025 43.642 8.93904 44.6584 9.44721L45.5528 7.65836ZM50.8695 15.6833C53.0806 14.5777 53.0807 11.4223 50.8695 10.3167L49.9751 12.1056C50.7121 12.4741 50.7121 13.5259 49.9751 13.8944L50.8695 15.6833ZM38.0249 23.8944C37.2879 23.5259 37.2879 22.4741 38.0249 22.1056L37.1305 20.3167C34.9193 21.4223 34.9194 24.5777 37.1305 25.6833L38.0249 23.8944ZM50.8695 35.6833C53.0806 34.5777 53.0807 31.4223 50.8695 30.3167L49.9751 32.1056C50.7121 32.4741 50.7121 33.5259 49.9751 33.8944L50.8695 35.6833ZM38.0249 43.8944C37.2879 43.5259 37.2879 42.4741 38.0249 42.1056L37.1305 40.3167C34.9193 41.4223 34.9194 44.5777 37.1305 45.6833L38.0249 43.8944ZM45 49.2361C45 48.0998 44.358 47.061 43.3416 46.5528L42.4472 48.3416C42.786 48.511 43 48.8573 43 49.2361H45Z",fill:l,strokeWidth:1})]})]})},mp=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.ir.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M23.3625 55.6237C22.6312 55.9937 22.6311 57.0381 23.3624 57.4082L58.7435 75.3147C60.7389 76.3246 63.098 74.8747 63.0981 72.6382L63.1001 40.3988C63.1003 38.1624 60.7414 36.7121 58.7458 37.7217L23.3625 55.6237Z"}),o.jsxRuntimeExports.jsx(P,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),o.jsxRuntimeExports.jsx(P,{d:"M21.8923 58.4348C21.5222 57.7035 20.4778 57.7035 20.1077 58.4348L2.20349 93.817C1.19372 95.8125 2.64384 98.1715 4.8803 98.1715H37.1197C39.3562 98.1715 40.8063 95.8125 39.7965 93.817L21.8923 58.4348Z"}),o.jsxRuntimeExports.jsx(ke,{cx:"21",cy:"56.0737",r:"4",fill:l}),o.jsxRuntimeExports.jsx(P,{d:"M21 53.0105V50.0225C21 49.3397 20.6516 48.704 20.0759 48.3366L15.6419 45.507C14.4098 44.7207 14.4098 42.9214 15.6419 42.1351L26.3581 35.2965C27.5902 34.5102 27.5902 32.7109 26.3581 31.9246L15.6419 25.0859C14.4098 24.2997 14.4098 22.5003 15.6419 21.714L26.3581 14.8754C27.5902 14.0891 27.5902 12.2898 26.3581 11.5035L21.9241 8.67393C21.3484 8.30656 21 7.67087 21 6.98798V4",stroke:l,strokeLinecap:"round"})]})]})},fp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.8462,top:22.3095,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.1538,top:22.3095,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:92.8571,id:"3"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:39,height:21},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M1.5 5.5V3.5C1.5 2.39543 2.39543 1.5 3.5 1.5H35.5C36.6046 1.5 37.5 2.39543 37.5 3.5V5.5C37.5 6.60457 36.6046 7.5 35.5 7.5H24.5C23.3954 7.5 22.5 8.39543 22.5 9.5V17.5C22.5 18.6046 21.6046 19.5 20.5 19.5H18.5C17.3954 19.5 16.5 18.6046 16.5 17.5V9.5C16.5 8.39543 15.6046 7.5 14.5 7.5H3.5C2.39543 7.5 1.5 6.60457 1.5 5.5Z",fill:u.ir.cssString(n),stroke:"none"})})]}),hp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.8462,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.1539,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50.5,top:96.1539,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50.5,top:3.8462,id:"4"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:39,height:39},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M22.5 35.5C22.5 36.6046 21.6046 37.5 20.5 37.5H18.5C17.3954 37.5 16.5 36.6046 16.5 35.5V24.5C16.5 23.3954 15.6046 22.5 14.5 22.5H3.5C2.39543 22.5 1.5 21.6046 1.5 20.5V18.5C1.5 17.3954 2.39543 16.5 3.5 16.5H14.5C15.6046 16.5 16.5 15.6046 16.5 14.5V3.5C16.5 2.39543 17.3954 1.5 18.5 1.5H20.5C21.6046 1.5 22.5 2.39543 22.5 3.5V14.5C22.5 15.6046 23.3954 16.5 24.5 16.5H35.5C36.6046 16.5 37.5 17.3954 37.5 18.5V20.5C37.5 21.6046 36.6046 22.5 35.5 22.5H24.5C23.3954 22.5 22.5 23.3954 22.5 24.5V35.5Z",fill:u.ir.cssString(n),stroke:"none"})})]}),Ye=({position:e,color:t})=>o.jsxRuntimeExports.jsx("text",{x:e?.x??57,y:e?.y??27,style:{fill:u.ir.cssString(t),fontWeight:450},stroke:"none",children:"F"}),gp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Ye,{position:{x:56,y:25},color:s})]})]}),jp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Electromagnetic"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M47.5 17.5H55.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M15.5 17.5H23.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M23.5 17.5C23.5 16.9747 23.6035 16.4546 23.8045 15.9693C24.0055 15.484 24.3001 15.043 24.6716 14.6716C25.043 14.3001 25.484 14.0055 25.9693 13.8045C26.4546 13.6035 26.9747 13.5 27.5 13.5C28.0253 13.5 28.5454 13.6035 29.0307 13.8045C29.516 14.0055 29.957 14.3001 30.3284 14.6716C30.6999 15.043 30.9945 15.484 31.1955 15.9693C31.3965 16.4546 31.5 16.9747 31.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M31.5 17.5C31.5 16.9747 31.6035 16.4546 31.8045 15.9693C32.0055 15.484 32.3001 15.043 32.6716 14.6716C33.043 14.3001 33.484 14.0055 33.9693 13.8045C34.4546 13.6035 34.9747 13.5 35.5 13.5C36.0253 13.5 36.5454 13.6035 37.0307 13.8045C37.516 14.0055 37.957 14.3001 38.3284 14.6716C38.6999 15.043 38.9945 15.484 39.1955 15.9693C39.3965 16.4546 39.5 16.9747 39.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M39.5 17.5C39.5 16.9747 39.6035 16.4546 39.8045 15.9693C40.0055 15.484 40.3001 15.043 40.6716 14.6716C41.043 14.3001 41.484 14.0055 41.9693 13.8045C42.4546 13.6035 42.9747 13.5 43.5 13.5C44.0253 13.5 44.5454 13.6035 45.0307 13.8045C45.516 14.0055 45.957 14.3001 46.3284 14.6716C46.6999 15.043 46.9945 15.484 47.1955 15.9693C47.3965 16.4546 47.5 16.9747 47.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ye,{position:{x:58,y:29},color:s})]})]}),Ep=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-VariableArea"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M46 10V25"}),o.jsxRuntimeExports.jsx(P,{d:"M23 13V22"}),o.jsxRuntimeExports.jsx(P,{d:"M23 13L46 10"}),o.jsxRuntimeExports.jsx(P,{d:"M23 22L46 25"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),yp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Coriolis"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M2 17.6024H28.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M28.5 17.6024L34.6834 14.0324",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M34.8 14L45.9058 20.9666",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M51.5 17.6024L46.0141 20.8987",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M20.5 17.6024L26.6574 14.0474",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M26.75 14.1024L37.788 21.0265",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 17.6024L37.8427 21.0017",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 17.6024H69",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{position:{x:58,y:29},color:s})]})]}),Sp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M24 2V7V12",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M24 12H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M24 23H29H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M24 33V23",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),Rp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Venturi"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M8 33L26.5329 22.3",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M8 2L26.5329 12.7",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M56 33L26.5876 22.2948",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M56 2L26.5876 12.7052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{position:{x:56,y:29},color:s})]})]}),Cp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-RingPiston"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(ke,{cx:"36.5",cy:"17.5",r:"10.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(ke,{cx:"36.5",cy:"21.5",r:"6.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ye,{position:{x:56,y:29},color:s})]})]}),wp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-PositiveDisplacement"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:72,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M41 13C41 15.4853 38.9853 17.5 36.5 17.5C34.0147 17.5 32 15.4853 32 13C32 10.5147 34.0147 8.5 36.5 8.5C38.9853 8.5 41 10.5147 41 13Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M41 22C41 24.4853 38.9853 26.5 36.5 26.5C34.0147 26.5 32 24.4853 32 22C32 19.5147 34.0147 17.5 36.5 17.5C38.9853 17.5 41 19.5147 41 22Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),bp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Turbine"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M16.5 17.5H54.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M32.5 9L35.4756 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M38.5 26L35.5244 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M32.5 26L35.4756 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M38.5 9L35.5244 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M32.5 9C32.5 8.20435 32.8161 7.44129 33.3787 6.87868C33.9413 6.31607 34.7044 6 35.5 6C36.2956 6 37.0587 6.31607 37.6213 6.87868C38.1839 7.44129 38.5 8.20435 38.5 9",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M38.5 26C38.5 26.7956 38.1839 27.5587 37.6213 28.1213C37.0587 28.6839 36.2956 29 35.5 29C34.7044 29 33.9413 28.6839 33.3787 28.1213C32.8161 27.5587 32.5 26.7956 32.5 26",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),vp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Pulse"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M31 13.5H39",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M23 21.5H31",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M39 21.5H47",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M39 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),_p=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-FloatSensor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M25 8H46",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31 27H40",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31 27L25.046 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M40 27L45.954 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),kp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Orifice"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:72,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M24.5 33V22",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),Lp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("heat-exchanger-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.545,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.454,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.454,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(P,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),o.jsxRuntimeExports.jsx(P,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"})]})]}),Mp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:89,top:27.27,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:89,top:72.73,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.455,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.545,top:50,id:"5"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(P,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),Pp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:9,top:6.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:24,top:93.75,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:76,top:6.25,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:91,top:93.75,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.508,top:50,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.492,top:50,id:"6"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:199,height:48},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"3",y:"3",width:"193",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(ge,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(ge,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(fe,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24",strokeWidth:"2"})]})]}),Np=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31 62C29.2204 62 27.3855 61.332 25.5927 59.9086C23.791 58.4782 22.0952 56.3316 20.6377 53.5381C19.1829 50.7496 18.0147 47.4106 17.214 43.7054C16.4137 40.0021 16 36.0237 16 32C16 27.9763 16.4137 23.9979 17.214 20.2946C18.0147 16.5895 19.1829 13.2504 20.6377 10.4619C22.0952 7.66841 23.791 5.52179 25.5927 4.09136C27.3855 2.66801 29.2204 2 31 2",strokeWidth:"2"})]})]}),Tp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M50.3827 20.3601C47.1902 21.7605 43.4002 22.8046 39.2752 23.4077C35.1519 24.0105 30.8103 24.1557 26.5584 23.8319C22.3057 23.508 18.2597 22.7238 14.7044 21.5418C11.1449 20.3584 8.19358 18.8149 6.03181 17.0454M6.02374 46.9613C8.18198 45.1925 11.129 43.6491 14.6841 42.465C18.2349 41.2824 22.2765 40.4968 26.5256 40.1707C30.774 39.8447 35.113 39.9871 39.2353 40.5866C43.3592 41.1864 47.15 42.2268 50.3455 43.6237",strokeLinecap:"round"})]})]}),Ap=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("compressor"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z",strokeLinecap:"round"})})]}),Ip=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(ke,{cx:"33",cy:"33",r:"14.5"})]})]}),Op=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M35 12.4V20.4"}),o.jsxRuntimeExports.jsx(P,{d:"M3 33H16"}),o.jsxRuntimeExports.jsx(P,{d:"M35 53.6V45.6"})]})]}),Dp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M39 33C39 33.7879 38.8448 34.5681 38.5433 35.2961C38.2417 36.0241 37.7998 36.6855 37.2426 37.2426C36.6855 37.7998 36.0241 38.2417 35.2961 38.5433C34.5681 38.8448 33.7879 39 33 39C32.2121 39 31.4319 38.8448 30.7039 38.5433C29.9759 38.2417 29.3145 37.7998 28.7574 37.2426C28.2002 36.6855 27.7583 36.0241 27.4567 35.2961C27.1552 34.5681 27 33.7879 27 33C27 32.2121 27.1552 31.4319 27.4567 30.7039C27.7583 29.9759 28.2002 29.3145 28.7574 28.7574C29.3145 28.2002 29.9759 27.7583 30.7039 27.4567C31.4319 27.1552 32.2121 27 33 27C33.7879 27 34.5681 27.1552 35.2961 27.4567C36.0241 27.7583 36.6855 28.2002 37.2426 28.7574C37.7998 29.3145 38.2417 29.9759 38.5433 30.7039C38.8448 31.4319 39 32.2121 39 33L39 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M39 33H47"}),o.jsxRuntimeExports.jsx(P,{d:"M27 33H19"}),o.jsxRuntimeExports.jsx(P,{d:"M36 27.804L40 20.8758"}),o.jsxRuntimeExports.jsx(P,{d:"M30 27.804L26 20.8758"}),o.jsxRuntimeExports.jsx(P,{d:"M30 38.196L26 45.1242"}),o.jsxRuntimeExports.jsx(P,{d:"M36 38.196L40 45.1242"})]})]}),Bp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M49.1214 16.2515C43.5325 21.3055 36.2463 24.0711 28.7115 23.9986C21.1766 23.9262 13.945 21.0209 8.45428 15.8604M8.4838 50.112C13.9718 44.968 21.1918 42.0733 28.7133 42.0014C36.2348 41.9295 43.5089 44.6858 49.0942 49.7239"})]})]}),$p=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M3 33H63"})]})]}),zp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:7.575,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:92.425,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M16.5 2.5L16.5 66.5M2.5 34.5H30.5M2.5 18.9848H30.5M2.5 50.0152H30.5M5.3 66.5H27.7C29.2464 66.5 30.5 65.1976 30.5 63.5909V5.40909C30.5 3.80244 29.2464 2.5 27.7 2.5H5.3C3.7536 2.5 2.5 3.80245 2.5 5.40909V63.5909C2.5 65.1976 3.7536 66.5 5.3 66.5Z",strokeLinecap:"round"})})]}),Vp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(P,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(P,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(P,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(P,{d:"M29.12 65.62L61 34.5"})]})]}),Hp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(P,{d:"M30 2.5L30 66.5"}),o.jsxRuntimeExports.jsx(P,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(P,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 50H30"})]})]}),Fp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(P,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(P,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(P,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5",strokeLinecap:"square"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Zp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(P,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(P,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(P,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(P,{d:"M29.12 65.62L61 34.5"}),o.jsxRuntimeExports.jsx(P,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Kp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("thruster"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:25.3,top:4.76,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:25.3,top:95.24,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),o.jsxRuntimeExports.jsx(P,{d:"M78.5 37.5117V4.51172"}),o.jsxRuntimeExports.jsx(P,{d:"M40.5 11.5L76.0072 2.6232"}),o.jsxRuntimeExports.jsx(P,{d:"M40.5 30.5L76.0072 39.3768"}),o.jsxRuntimeExports.jsx(P,{d:"M75.6192 2.71597C75.9231 2.56695 76.2597 2.49745 76.5977 2.51399C76.9357 2.53052 77.264 2.63256 77.5518 2.81053C77.8397 2.98851 78.0776 3.23661 78.2435 3.53161C78.4093 3.82661 78.4975 4.15886 78.4999 4.49726"}),o.jsxRuntimeExports.jsx(P,{d:"M78.4994 37.5101C78.4914 37.8382 78.4028 38.1592 78.2414 38.445C78.0801 38.7307 77.8509 38.9723 77.574 39.1486C77.2972 39.3248 76.9813 39.4302 76.6541 39.4555C76.3269 39.4808 75.9986 39.4252 75.698 39.2936"})]})]}),Yp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:18.75,top:17.46,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:1.5873,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:81.25,top:17.46,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:126},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"12",y:"1.6667",width:"40",height:"40",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M1.3333 124H62.6667",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M50.1883 41.6667C41.7748 41.6667 35.0143 46.3333 42.6923 59.3333C59.3476 87.5333 63.6327 119 62.855 124",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M14 41.6667C22.4135 41.6667 29.174 46.3333 21.496 59.3333C4.84066 87.5333 0.555555 119 1.33333 124",strokeLinecap:"round"})]})]}),Wp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(P,{d:"M2.293 2.29297L29.9383 66.7986",strokeDasharray:"6 6"})]})]}),Gp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(P,{d:"M31 34.5L2.30611 2.33992",strokeDasharray:"6 6"}),o.jsxRuntimeExports.jsx(P,{d:"M31 34.5L2.30611 66.6601",strokeDasharray:"6 6"})]})]}),r6=({aetherKey:e,source:t})=>{const n=f.useMemoDeepEqual({source:t}),[,{enabled:s},r]=f.use$2({aetherKey:e,type:T.Light.TYPE,schema:T.lightStateZ,initialState:{enabled:!1,...n}});return j.useEffect(()=>r(i=>({...i,...n})),[n,r]),{enabled:s}},i6=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{value:r},i]=f.use$2({aetherKey:e,type:T.Setpoint.TYPE,schema:T.setpointStateZ,initialState:{trigger:0,value:0,...s}});return j.useEffect(()=>{i(a=>({...a,...s}))},[s,i]),{set:j.useCallback(a=>i(c=>({...c,trigger:c.trigger+1,command:a})),[i]),value:r}},l6=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{triggered:r,enabled:i},l]=f.use$2({aetherKey:e,type:T.Toggle.TYPE,schema:T.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return j.useEffect(()=>{l(c=>({...c,...s}))},[s,l]),{toggle:j.useCallback(()=>l(c=>({...c,triggered:!c.triggered})),[l]),triggered:r,enabled:i}},rn=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:r="top",direction:i,align:l,maxInlineSize:a}=e;return n==null||n.length===0?null:{key:"label",element:o.jsxRuntimeExports.jsx(f.Editable,{className:u.CSS(u.CSS.BE("symbol","label"),u.CSS.dir(i)),level:s,value:n,onChange:c=>t?.({label:{...e,label:c}}),allowEmpty:!0,style:{textAlign:l,maxInlineSize:a}}),location:r}},si=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:r,indicator:i,orientation:l="bottom"}=e;return{key:"control",element:o.jsxRuntimeExports.jsxs(f.Box,{direction:u.g.swap(l),align:"center",className:u.CSS(u.CSS.B("control-state")),gap:"small",children:[t&&n&&o.jsxRuntimeExports.jsx(Kc,{size:"small",...r}),t&&s&&o.jsxRuntimeExports.jsx(Gc,{...i})]}),location:l}},Ce=(e,t)=>{const n=({symbolKey:s,control:r,source:i,sink:l,label:a,onChange:c,selected:d,orientation:x="left",position:p,...m})=>{const{enabled:h,triggered:g,toggle:E}=l6({aetherKey:s,source:i,sink:l}),S=[],R=rn(a,c);R!=null&&S.push(R);const _=si(r);return _!=null&&S.push(_),o.jsxRuntimeExports.jsx(It,{editable:d,symbolKey:s,items:S,onRotate:()=>c({orientation:u.K$1.rotate90(x)}),onLocationChange:(y,C)=>{y==="label"&&c({label:{...a,orientation:C}}),y==="control"&&c({control:{...r,orientation:C}})},...t?.grid,children:o.jsxRuntimeExports.jsx(e,{enabled:h,triggered:g,onClick:E,orientation:x,...m})})};return n.displayName=e.displayName,n},ce=(e,t)=>{const n=({symbolKey:s,label:r,onChange:i,selected:l,position:a,orientation:c="left",...d})=>{const x=[],p=rn(r,i);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(It,{...t?.grid,items:x,editable:l,symbolKey:s,onRotate:()=>i({orientation:u.K$1.rotate90(c)}),onLocationChange:(m,h)=>{m==="label"&&i({label:{...r,orientation:h}})},children:o.jsxRuntimeExports.jsx(e,{orientation:c,...d})})};return n.displayName=e.displayName,n},yt=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,position:l,orientation:a="left",enabled:c=!1,clickable:d=!1,...x})=>{const p=[],m=rn(s,r);m!=null&&p.push(m);const h=()=>{d&&r({enabled:!c})};return o.jsxRuntimeExports.jsx(It,{items:p,editable:i,symbolKey:n,onRotate:()=>r({orientation:u.K$1.rotate90(a)}),onLocationChange:(g,E)=>{g==="label"&&r({label:{...s,orientation:E}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,enabled:c,onClick:h,...x})})};return t.displayName=e.displayName,t},Up=Ce(dx),Xp=Ce(xx),qp=Ce(px),Qp=Ce(ux),Jp=Ce(jx),em=Ce(bx),tm=Ce(Np),nm=Ce(Tp),sm=Ce(Wx),om=Ce(Gx),rm=Ce(Ux),im=Ce(qx),lm=Ce(tp),am=Ce(np),cm=Ce(sp),um=Ce(op),dm=Ce(rp),xm=Ce(ip),pm=Ce(Yx),mm=Ce(Ap),fm=Ce(Ip),hm=Ce(Op),gm=Ce(Dp),jm=Ce(Bp),Em=Ce($p),ym=Ce(Rx),Sm=Ce(Cx),Rm=Ce(Ex),Cm=Ce(yx),wm=Ce(Sx),bm=ce(Ox),vm=ce(Dx),_m=ce(Jx),km=ce(ep),Lm=ce(vx),Mm=ce(kx),Pm=ce(Lx),Nm=ce(Nx),Tm=ce(fx),Am=ce(hx),Im=ce(gx),Om=ce(Bx),Dm=Ce(Hx,{grid:{allowRotate:!1}}),Bm=ce(ap),$m=ce(Px),zm=ce(cp),Vm=ce(up),Hm=ce(dp),Fm=ce(_x),Zm=ce(fp),Km=ce(hp,{grid:{allowRotate:!1}}),Ym=ce(Xx),Wm=ce(gp),Gm=ce(jp),Um=ce(Ep),Xm=ce(yp),qm=ce(Sp),Qm=ce(Rp),Jm=ce(Cp),ef=ce(wp),tf=ce(bp),nf=ce(vp),sf=ce(_p),of=ce(kp),rf=ce(Lp),lf=ce(Mp),af=ce(Pp),cf=ce(zp),uf=ce(Hp),df=ce(Vp),xf=ce(Fp),pf=ce(Zp),mf=ce(Kp),ff=ce(Yp),hf=ce(Wp),gf=ce(Gp),jf=yt($x),Ef=yt(mx),yf=yt(pp),Sf=yt(mp),Rf=yt(Mx),Cf=yt(zx),wf=yt(wx),bf=ce(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Ws,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e}),{grid:{allowCenter:!0,allowRotate:!1}}),vf=e=>o.jsxRuntimeExports.jsx(Ws,{...e,dimensions:{width:25,height:50}}),a6=ce(({sideLength:e,rotation:t,color:n,backgroundColor:s,numSides:r,...i})=>o.jsxRuntimeExports.jsx(ni,{numSides:3,sideLength:e,rotation:t,color:n,backgroundColor:s,...i})),_f=ce(({numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:r,backgroundColor:i,strokeWidth:l,...a})=>o.jsxRuntimeExports.jsx(ni,{numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:r,backgroundColor:i,strokeWidth:l,...a})),kf=ce(({radius:e,color:t,backgroundColor:n,strokeWidth:s,...r})=>o.jsxRuntimeExports.jsx(Ix,{radius:e,color:t,backgroundColor:n,strokeWidth:s,...r}),{grid:{allowRotate:!1}}),Lf=ce(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:r,dimensions:i,strokeWidth:l})=>o.jsxRuntimeExports.jsx(Ws,{onResize:a=>n({dimensions:a}),orientation:s,color:r,dimensions:i,boxBorderRadius:t,backgroundColor:e,strokeWidth:l}),{grid:{allowCenter:!0,allowRotate:!1}}),Mf=e=>o.jsxRuntimeExports.jsx(Ws,{...e,dimensions:{width:25,height:50},borderRadius:0}),Pf=({label:e,symbolKey:t,orientation:n="left",control:s,units:r,source:i,sink:l,color:a,onChange:c,selected:d,draggable:x,size:p,disabled:m})=>{const{value:h,set:g}=i6({aetherKey:t,source:i,sink:l}),E=[],S=si(s);S!=null&&E.push(S);const R=rn(e,c);return R!=null&&E.push(R),o.jsxRuntimeExports.jsx(It,{symbolKey:t,allowRotate:!1,editable:d&&!x,onRotate:()=>c({orientation:u.K$1.rotate90(n)}),items:E,onLocationChange:(_,y)=>{_==="label"&&c({label:{...e,orientation:y}})},children:o.jsxRuntimeExports.jsx(Kx,{value:h,onChange:g,units:r,color:a,orientation:n,disabled:m,size:p})})},Nf=({className:e,...t})=>o.jsxRuntimeExports.jsx(Kx,{value:12,onChange:()=>{},units:"mV",style:{width:120,transform:"scale(0.95)"},className:u.CSS(u.CSS.BM("setpoint","preview"),e),disabled:!0,...t,children:o.jsxRuntimeExports.jsx(f.Text,{children:"10.0"})}),c6=u.K.construct(10,-1),u6=u.K.construct(1,1),Tf=({symbolKey:e,label:t,level:n="p",position:s,textColor:r,color:i,telem:l,units:a,onChange:c,inlineSize:d=70,selected:x,draggable:p,notation:m,redline:h})=>{const g=ws.useTypography(n),E=(g.lineHeight+.5)*g.baseSize+2,S=j.useMemo(()=>{if(l==null||h==null)return;const{bounds:C,gradient:v}=h;return T.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:l,scale:T.scaleNumber({scale:u.C.Scale.scale(C).scale(0,1).transform}),gradient:T.colorGradient({gradient:v})},outlet:"gradient"})},[l,h]),{width:R}=Ir({aetherKey:e,color:r,level:n,box:u.Ho.construct(u.K.translateY({...s},1),{height:E,width:d}),telem:l,backgroundTelem:S,minWidth:d,notation:m,useWidthForBackground:!0,valueBackgroundOverScan:c6,valueBackgroundShift:u6}),_=[],y=rn(t,c);return y!=null&&_.push(y),o.jsxRuntimeExports.jsx(It,{editable:x&&!p,symbolKey:e,items:_,allowRotate:!1,onLocationChange:(C,v)=>{C==="label"&&c({label:{...t,orientation:v}})},children:o.jsxRuntimeExports.jsx(Vx,{color:i,dimensions:{height:E,width:R},inlineSize:d,units:a,unitsLevel:A.downLevel(n)})})},Af=({color:e})=>o.jsxRuntimeExports.jsx(Vx,{color:e,dimensions:{width:60,height:25},units:"psi",children:o.jsxRuntimeExports.jsx(f.Text,{children:"50.00"})}),If=({symbolKey:e,label:t,orientation:n="left",sink:s,control:r,selected:i,draggable:l,onChange:a,mode:c,...d})=>{const{onMouseDown:x,onMouseUp:p}=PC({aetherKey:e,sink:s,mode:c}),m=[],h=si(r);return h!=null&&m.push(h),o.jsxRuntimeExports.jsx(It,{onRotate:()=>a({orientation:u.K$1.rotate90(n)}),allowRotate:!1,editable:i,symbolKey:e,items:m,onLocationChange:(g,E)=>{g==="label"&&a({label:{...t,orientation:E}})},children:o.jsxRuntimeExports.jsx(Fx,{...t,onMouseDown:x,onMouseUp:p,orientation:n,...d})})},Of=({label:e,...t})=>o.jsxRuntimeExports.jsx(Fx,{label:"Button",...t}),Df=({symbolKey:e,label:t,source:n,onChange:s,selected:r,...i})=>{const{enabled:l}=r6({aetherKey:e,source:n}),a=[],c=rn(t,s);return c!=null&&a.push(c),o.jsxRuntimeExports.jsx(It,{items:a,allowRotate:!1,editable:r,symbolKey:e,onLocationChange:(d,x)=>{d==="label"&&s({label:{...t,orientation:x}})},children:o.jsxRuntimeExports.jsx(Qx,{enabled:l,...i})})},Bf=({label:{label:e,level:t},orientation:n,color:s,onChange:r})=>o.jsxRuntimeExports.jsx(lp,{className:Ys,onLabelChange:i=>r({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),$f=({label:e,...t})=>o.jsxRuntimeExports.jsx(lp,{label:"Off Page",...t,orientation:"right"}),zf=ce(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(xp,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),Vf=e=>o.jsxRuntimeExports.jsx(xp,{...e,dimensions:{width:25,height:50}}),Hf=({onChange:e,symbolKey:t,color:n,width:s,align:r,autoFit:i,level:l,value:a})=>o.jsxRuntimeExports.jsx(Zx,{className:Ys,onChange:c=>e({value:c}),value:a,level:l,color:n,width:s,align:r,autoFit:i},t),Ff=e=>o.jsxRuntimeExports.jsx(Zx,{...e,autoFit:!0,value:"Text Box"}),G=4,$n=2,d6=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","ballValve","threeWayBallValve","gateValve","butterflyValveOne","butterflyValveTwo","breatherValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","crossBeamAgitator","electricRegulator","electricRegulatorMotorized","filter","flowStraightener","heaterElement","checkValveWithArrow","flatBladeAgitator","flowmeterGeneral","flowmeterElectromagnetic","flowmeterVariableArea","flowmeterCoriolis","flowmeterNozzle","flowmeterVenturi","flowmeterRingPiston","flowmeterPositiveDisplacement","flowmeterTurbine","flowmeterPulse","flowmeterFloatSensor","flowmeterOrifice","fourWayValve","helicalAgitator","isoCap","isoCheckValve","isoFilter","light","manualValve","needleValve","orifice","orificePlate","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","regulatorManual","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","springLoadedReliefValve","staticMixer","switch","tank","polygon","circle","textBox","threeWayValve","vacuumPump","value","valve","vent","tJunction","crossJunction","heatExchangerGeneral","heatExchangerM","heatExchangerStraightTube","diaphragmPump","ejectionPump","compressor","turboCompressor","rollerVaneCompressor","liquidRingCompressor","ejectorCompressor","centrifugalCompressor","flameArrestor","flameArrestorDetonation","flameArrestorExplosion","flameArrestorFireRes","flameArrestorFireResDetonation","thruster","nozzle","strainer","strainerCone"],x6=se.z.enum(d6),ae={orientation:"left",scale:1},p6={source:T.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:T.streamChannelValue({channel:0}),rollingAverage:T.rollingAverage({windowSize:1}),stringifier:T.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},m6={...ae,source:T.sourcePipeline("number",{connections:[],segments:{valueStream:T.streamChannelValue({channel:0})},outlet:"valueStream"})},f6={...ae,sink:T.sinkPipeline("number",{connections:[],segments:{setter:T.setChannelValue({channel:0})},inlet:"setter"})},Zf={...ae,source:T.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:T.streamChannelValue({channel:0}),threshold:T.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},Kf={...ae,control:{show:!0},sink:T.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:T.setChannelValue({channel:0}),setpoint:T.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},we={...Zf,...Kf},Dt={...ae,enabled:!1,clickable:!1},Y=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),h6={width:125,height:200},oi={dimensions:h6},g6=3,j6={name:"Three Way Valve",key:"threeWayValve",Form:Re,Symbol:Up,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three Way Valve"),...we}),Preview:dx,zIndex:G},E6={name:"Valve",key:"valve",Form:Re,Symbol:Xp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Valve"),...we}),Preview:xx,zIndex:G},y6={name:"Solenoid Valve",key:"solenoidValve",Form:Re,Symbol:qp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Solenoid Valve"),normallyOpen:!1,...we}),Preview:px,zIndex:G},S6={name:"Four Way Valve",key:"fourWayValve",Form:Re,Symbol:Qp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Four Way Valve"),...we}),Preview:ux,zIndex:G},R6={name:"Angled Valve",key:"angledValve",Form:Re,Symbol:Jp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Valve"),...we}),Preview:jx,zIndex:G},C6={name:"Ball Valve",key:"ballValve",Form:Re,Symbol:Rm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ball Valve"),...we}),Preview:Ex,zIndex:G},w6={name:"Three-Way Ball Valve",key:"threeWayBallValve",Form:Re,Symbol:Cm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three-Way Ball Valve"),...we}),Preview:yx,zIndex:G},b6={name:"Gate Valve",key:"gateValve",Form:Re,Symbol:wm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Gate Valve"),...we}),Preview:Sx,zIndex:G},v6={name:"Butterfly Valve (Remote)",key:"butterflyValveOne",Form:Re,Symbol:ym,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Remote)"),...we}),Preview:Rx,zIndex:G},_6={name:"Butterfly Valve (Manual)",key:"butterflyValveTwo",Form:Re,Symbol:Sm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Manual)"),...we}),Preview:Cx,zIndex:G},k6={name:"Breather Valve",key:"breatherValve",Form:Ot,Symbol:wf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Breather Valve"),...Dt}),Preview:Xe(wx,["clickable"]),zIndex:G},L6={name:"Pump",key:"pump",Form:Re,Symbol:em,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pump"),...we}),Preview:bx,zIndex:G},M6={name:"Screw Pump",key:"screwPump",Form:Re,Symbol:pm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Screw Pump"),...we}),Preview:Yx,zIndex:G},P6={name:"Tank",key:"tank",Form:ax,Symbol:bf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("Tank"),borderRadius:ti,...oi,...ae}),Preview:vf,zIndex:$n},N6={name:"Polygon",key:"polygon",Symbol:_f,Form:IC,defaultProps:e=>({numSides:6,sideLength:n6,cornerRounding:0,rotation:0,color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),strokeWidth:2,...Y("Polygon")}),Preview:Xe(ni,["clickable"]),zIndex:$n},T6={name:"Circle",key:"circle",Symbol:kf,Form:OC,defaultProps:e=>({radius:20,color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("Circle"),strokeWidth:2}),Preview:Xe(Ix,["clickable"]),zIndex:$n},A6={name:"Cylinder",key:"cylinder",Form:WC,Symbol:zf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("cylinder"),dimensions:{width:66,height:181},...ae}),Preview:Vf,zIndex:$n},I6={name:"Box",key:"box",Form:GC,Symbol:Lf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.ir.setAlpha(e.colors.gray.l1,0),...Y("Box"),borderRadius:g6,strokeWidth:2,...oi,...ae}),Preview:Mf,zIndex:$n},O6={name:"Relief Valve",key:"reliefValve",Form:Ot,Symbol:Ef,defaultProps:e=>({color:e.colors.gray.l11,...Y("Relief Valve"),...Dt}),Preview:Xe(mx,["clickable"]),zIndex:G},D6={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:Ot,Symbol:yf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Spring Loaded Relief Valve"),...Dt}),Preview:Xe(pp,["clickable"]),zIndex:G},B6={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:Ot,Symbol:Sf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Spring Loaded Relief Valve"),...Dt}),Preview:Xe(mp,["clickable"]),zIndex:G},$6={name:"Regulator",key:"regulator",Form:xe,Symbol:bm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Regulator"),...ae}),Preview:Ox,zIndex:G},z6={name:"Manual Regulator",key:"regulatorManual",Form:xe,Symbol:vm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Regulator"),...ae}),Preview:Xe(Dx,["clickable"]),zIndex:G},V6={name:"Electric Regulator",key:"electricRegulator",Form:xe,Symbol:_m,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator"),...ae}),Preview:Jx,zIndex:G},H6={name:"Electric Regulator Motorized",key:"electricRegulatorMotorized",Form:xe,Symbol:km,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator Motorized"),...ae}),Preview:ep,zIndex:G},F6={name:"Burst Disc",key:"burstDisc",Form:xe,Symbol:Lm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Burst Disc"),...ae}),Preview:vx,zIndex:G},Z6={name:"ISO Burst Disc",key:"isoBurstDisc",Form:xe,Symbol:Fm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Burst Disc"),...ae}),Preview:_x,zIndex:G},K6={name:"Cap",key:"cap",Form:xe,Symbol:Mm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cap"),...ae}),Preview:kx,zIndex:G},Y6={name:"ISO Cap",key:"isoCap",Form:xe,Symbol:Pm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Cap"),...ae}),Preview:Lx,zIndex:G},W6={name:"Manual Valve",key:"manualValve",Form:Ot,Symbol:Rf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Valve"),...Dt}),Preview:Xe(Mx,["clickable"]),zIndex:G},G6={name:"Orifice Plate",key:"orificePlate",Form:xe,Symbol:$m,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Plate"),...ae}),Preview:Px,zIndex:G},U6={name:"ISO Filter",key:"isoFilter",Form:xe,Symbol:zm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Filter"),...ae}),Preview:cp,zIndex:G},X6={name:"Filter",key:"filter",Form:xe,Symbol:Nm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Filter"),...ae}),Preview:Nx,zIndex:G},q6={name:"Flow Straightener",key:"flowStraightener",Form:xe,Symbol:Vm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flow Straightener"),...ae}),Preview:up,zIndex:G},Q6={name:"Heater Element",key:"heaterElement",Form:xe,Symbol:Hm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Heater Element"),...ae}),Preview:dp,zIndex:G},J6={name:"Needle Valve",key:"needleValve",Form:Ot,Symbol:jf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Needle Valve"),...Dt}),Preview:Xe($x,["clickable"]),zIndex:G},e9={name:"Check Valve",key:"checkValve",Form:xe,Symbol:Tm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...ae}),Preview:fx,zIndex:G},t9={name:"Orifice",key:"orifice",Form:xe,Symbol:Om,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice"),...ae}),Preview:Bx,zIndex:G},n9={name:"Angled Relief Valve",key:"angledReliefValve",Form:Ot,Symbol:Cf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Relief Valve"),...Dt}),Preview:Xe(zx,["clickable"]),zIndex:G},s9={name:"Value",key:"value",Form:BC,Symbol:Tf,Preview:Af,defaultProps:e=>({color:e.colors.gray.l11,units:"psi",level:"h5",inlineSize:70,...Y("Value"),...ae,telem:p6.source,redline:Nr}),zIndex:G},o9={name:"Button",key:"button",Symbol:If,Form:HC,Preview:Of,defaultProps:e=>({color:e.colors.primary.z,...Y("Button"),...Kf,mode:"fire",onClickDelay:0,scale:null}),zIndex:G},r9={name:"Switch",key:"switch",Symbol:Dm,Form:UC,defaultProps:()=>({...Y("Switch"),...we,scale:null}),Preview:Hx,zIndex:G},i9={name:"Vacuum Pump",key:"vacuumPump",Symbol:sm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vacuum Pump"),...we}),Preview:Wx,zIndex:G},l9={name:"Compressor",key:"compressor",Symbol:mm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Compressor"),...we}),Preview:Ap,zIndex:G},a9={name:"Cavity Pump",key:"cavityPump",Symbol:om,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cavity Pump"),...we}),Preview:Gx,zIndex:G},c9={name:"Piston Pump",key:"pistonPump",Symbol:rm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Piston Pump"),...we}),Preview:Ux,zIndex:G},u9={name:"Static Mixer",key:"staticMixer",Symbol:Ym,Form:xe,defaultProps:e=>({color:e.colors.gray.l11,...Y("Static Mixer"),...ae}),Preview:Xx,zIndex:G},d9={name:"Rotary Mixer",key:"rotaryMixer",Symbol:im,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Rotary Mixer"),...we}),Preview:qx,zIndex:G},x9={name:"Light",key:"light",Symbol:Df,Form:zC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Light"),...Zf}),Preview:Qx,zIndex:G},p9={name:"Setpoint",key:"setpoint",Symbol:Pf,Form:ZC,defaultProps:e=>({units:"mV",color:e.colors.gray.l11,size:"small",...Y("Setpoint"),...m6,...f6}),Preview:Nf,zIndex:G},m9={name:"Agitator",key:"agitator",Symbol:lm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Agitator"),...we}),Preview:tp,zIndex:G},f9={name:"Propeller Agitator",key:"propellerAgitator",Symbol:am,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Propeller Agitator"),...we}),Preview:np,zIndex:G},h9={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:cm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flat Blade Agitator"),...we}),Preview:sp,zIndex:G},g9={name:"Paddle Agitator",key:"paddleAgitator",Symbol:um,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Paddle Agitator"),...we}),Preview:op,zIndex:G},j9={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:dm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cross Beam Agitator"),...we}),Preview:rp,zIndex:G},E9={name:"Helical Agitator",key:"helicalAgitator",Symbol:xm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Helical Agitator"),...we}),Preview:ip,zIndex:G},y9={name:"Text Box",key:"textBox",Symbol:Hf,Form:KC,defaultProps:e=>({color:e.colors.gray.l11,autoFit:!0,align:"center",...Y("Text Box"),...ae,...oi,level:"p",value:"Text Box",width:75}),Preview:Ff,zIndex:G},S9={name:"Off Page Reference",key:"offPageReference",Form:YC,Symbol:Bf,defaultProps:e=>({color:e.colors.gray.l11,orientation:"right",...Y("Off Page Reference")}),Preview:$f,zIndex:G},R9={name:"ISO Check Valve",key:"isoCheckValve",Form:xe,Symbol:Am,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Check Valve"),...ae}),Preview:hx,zIndex:G},C9={name:"Check Valve Variant",key:"checkValveWithArrow",Form:xe,Symbol:Im,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...ae}),Preview:gx,zIndex:G},w9={name:"Vent",key:"vent",Form:xe,Symbol:Bm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vent"),...ae}),Preview:ap,zIndex:G},b9={name:"T Junction",key:"tJunction",Form:xe,Symbol:Zm,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...ae}),Preview:fp,zIndex:G+20},v9={name:"Cross Junction",key:"crossJunction",Form:xe,Symbol:Km,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...ae}),Preview:hp,zIndex:G+20},_9={name:"Flowmeter General",key:"flowmeterGeneral",Form:xe,Symbol:Wm,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Flowmeter"),...ae}),Preview:gp,zIndex:G},k9={name:"Flowmeter Electromagnetic",key:"flowmeterElectromagnetic",Form:xe,Symbol:Gm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electromagnetic Flowmeter"),...ae}),Preview:jp,zIndex:G},L9={name:"Flowmeter Variable Area",key:"flowmeterVariableArea",Form:xe,Symbol:Um,defaultProps:e=>({color:e.colors.gray.l11,...Y("Variable Area Flowmeter"),...ae}),Preview:Ep,zIndex:G},M9={name:"Flowmeter Coriolis",key:"flowmeterCoriolis",Form:xe,Symbol:Xm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Coriolis Flowmeter"),...ae}),Preview:yp,zIndex:G},P9={name:"Flowmeter Nozzle",key:"flowmeterNozzle",Form:xe,Symbol:qm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle Flowmeter"),...ae}),Preview:Sp,zIndex:G},N9={name:"Flowmeter Venturi",key:"flowmeterVenturi",Form:xe,Symbol:Qm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Venturi Flowmeter"),...ae}),Preview:Rp,zIndex:G},T9={name:"Flowmeter Ring Piston",key:"flowmeterRingPiston",Form:xe,Symbol:Jm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ring Piston Flowmeter"),...ae}),Preview:Cp,zIndex:G},A9={name:"Flowmeter Positive Displacement",key:"flowmeterPositiveDisplacement",Form:xe,Symbol:ef,defaultProps:e=>({color:e.colors.gray.l11,...Y("Positive Displacement Flowmeter"),...ae}),Preview:wp,zIndex:G},I9={name:"Flowmeter Turbine",key:"flowmeterTurbine",Form:xe,Symbol:tf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbine Flowmeter"),...ae}),Preview:bp,zIndex:G},O9={name:"Flowmeter Pulse",key:"flowmeterPulse",Form:xe,Symbol:nf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pulse Flowmeter"),...ae}),Preview:vp,zIndex:G},D9={name:"Flowmeter Float Sensor",key:"flowmeterFloatSensor",Form:xe,Symbol:sf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Float Sensor Flowmeter"),...ae}),Preview:_p,zIndex:G},B9={name:"Flowmeter Orifice",key:"flowmeterOrifice",Form:xe,Symbol:of,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Flowmeter"),...ae}),Preview:kp,zIndex:G},$9={name:"Heat Exchanger General",key:"heatExchangerGeneral",Form:xe,Symbol:rf,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Heat Exchanger"),...ae}),Preview:Lp,zIndex:G},z9={name:"Heat Exchanger M",key:"heatExchangerM",Form:xe,Symbol:lf,defaultProps:e=>({color:e.colors.gray.l11,...Y("M Heat Exchanger"),...ae}),Preview:Mp,zIndex:G},V9={name:"Heat Exchanger Straight Tube",key:"heatExchangerStraightTube",Form:xe,Symbol:af,defaultProps:e=>({color:e.colors.gray.l11,...Y("Straight Tube Heat Exchanger"),...ae}),Preview:Pp,zIndex:G},H9={name:"Turbo Compressor",key:"turboCompressor",Form:Re,Symbol:fm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbo Compressor"),...we}),Preview:Ip,zIndex:G},F9={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:Re,Symbol:hm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Roller Vane Compressor"),...we}),Preview:Op,zIndex:G},Z9={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:Re,Symbol:gm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Liquid Ring Compressor"),...we}),Preview:Dp,zIndex:G},K9={name:"Ejector Compressor",key:"ejectorCompressor",Form:Re,Symbol:jm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejector Compressor"),...we}),Preview:Bp,zIndex:G},Y9={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:Re,Symbol:Em,defaultProps:e=>({color:e.colors.gray.l11,...Y("Centrifugal Compressor"),...we}),Preview:$p,zIndex:G},W9={name:"Diaphragm Pump",key:"diaphragmPump",Form:Re,Symbol:tm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Diaphragm Pump"),...we}),Preview:Np,zIndex:G},G9={name:"Ejection Pump",key:"ejectionPump",Form:Re,Symbol:nm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejection Pump"),...we}),Preview:Tp,zIndex:G},U9={name:"Flame Arrestor",key:"flameArrestor",Form:xe,Symbol:cf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor"),...ae}),Preview:zp,zIndex:G},X9={name:"Flame Arrestor (Explosion-Proof)",key:"flameArrestorExplosion",Form:xe,Symbol:uf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Explosion-Proof)"),...ae}),Preview:Hp,zIndex:G},q9={name:"Flame Arrestor (Detonation-Proof)",key:"flameArrestorDetonation",Form:xe,Symbol:df,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Detonation-Proof)"),...ae}),Preview:Vp,zIndex:G},Q9={name:"Flame Arrestor (Fire Resistant)",key:"flameArrestorFireRes",Form:xe,Symbol:xf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant)"),...ae}),Preview:Fp,zIndex:G},J9={name:"Flame Arrestor (Fire Resistant and Detonation-Proof)",key:"flameArrestorFireResDetonation",Form:xe,Symbol:pf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...ae}),Preview:Zp,zIndex:G},e7={name:"Thruster",key:"thruster",Form:Re,Symbol:mf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Thruster"),...we}),Preview:Kp,zIndex:G},t7={name:"Nozzle",key:"nozzle",Form:xe,Symbol:ff,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle"),...ae}),Preview:Yp,zIndex:G},n7={name:"Strainer",key:"strainer",Form:xe,Symbol:hf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer"),...ae}),Preview:Wp,zIndex:G},s7={name:"Strainer Cone",key:"strainerCone",Form:xe,Symbol:gf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer Cone"),...ae}),Preview:Gp,zIndex:G},o7={value:s9,button:o9,tank:P6,polygon:N6,circle:T6,tJunction:b9,crossJunction:v9,switch:r9,offPageReference:S9,light:x9,setpoint:p9,box:I6,textBox:y9,valve:E6,solenoidValve:y6,threeWayValve:j6,fourWayValve:S6,angledValve:R6,ballValve:C6,threeWayBallValve:w6,gateValve:b6,butterflyValveOne:v6,butterflyValveTwo:_6,breatherValve:k6,manualValve:W6,needleValve:J6,reliefValve:O6,angledReliefValve:n9,checkValve:e9,regulator:$6,regulatorManual:z6,electricRegulator:V6,electricRegulatorMotorized:H6,springLoadedReliefValve:D6,angledSpringLoadedReliefValve:B6,pump:L6,pistonPump:c9,screwPump:M6,cavityPump:a9,diaphragmPump:W9,ejectionPump:G9,vacuumPump:i9,compressor:l9,turboCompressor:H9,rollerVaneCompressor:F9,liquidRingCompressor:Z9,ejectorCompressor:K9,centrifugalCompressor:Y9,staticMixer:u9,rotaryMixer:d9,burstDisc:F6,isoBurstDisc:Z6,cap:K6,isoCap:Y6,filter:X6,isoFilter:U6,flowStraightener:q6,heaterElement:Q6,orifice:t9,orificePlate:G6,agitator:m9,propellerAgitator:f9,flatBladeAgitator:h9,paddleAgitator:g9,crossBeamAgitator:j9,helicalAgitator:E9,isoCheckValve:R9,checkValveWithArrow:C9,vent:w9,cylinder:A6,flowmeterGeneral:_9,flowmeterElectromagnetic:k9,flowmeterVariableArea:L9,flowmeterCoriolis:M9,flowmeterNozzle:P9,flowmeterVenturi:N9,flowmeterRingPiston:T9,flowmeterPositiveDisplacement:A9,flowmeterTurbine:I9,flowmeterPulse:O9,flowmeterFloatSensor:D9,flowmeterOrifice:B9,heatExchangerGeneral:$9,heatExchangerM:z9,heatExchangerStraightTube:V9,flameArrestor:U9,flameArrestorExplosion:X9,flameArrestorDetonation:q9,flameArrestorFireRes:Q9,flameArrestorFireResDetonation:J9,thruster:e7,nozzle:t7,strainer:n7,strainerCone:s7},r7=Object.freeze(Object.defineProperty({__proto__:null,Agitator:lm,AngledReliefValve:Cf,AngledSpringLoadedReliefValve:Sf,AngledValve:Jp,BallValve:Rm,Box:Lf,BoxPreview:Mf,BreatherValve:wf,BurstDisc:Lm,ButterflyValveOne:ym,ButterflyValveTwo:Sm,Button:If,ButtonPreview:Of,Cap:Mm,CavityPump:om,CentrifugalCompressor:Em,CheckValve:Tm,CheckValveWithArrow:Im,Circle:kf,Compressor:mm,CrossBeamAgitator:dm,CrossJunction:Km,Cylinder:zf,CylinderPreview:Vf,DRAG_HANDLE_CLASS:Ys,DiaphragmPump:tm,EjectionPump:nm,EjectorCompressor:jm,ElectricRegulator:_m,ElectricRegulatorMotorized:km,Filter:Nm,FlameArrestor:cf,FlameArrestorDetonation:df,FlameArrestorExplosion:uf,FlameArrestorFireRes:xf,FlameArrestorFireResDetonation:pf,FlatBladeAgitator:cm,FlowStraightener:Vm,FlowmeterCoriolis:Xm,FlowmeterElectromagnetic:Gm,FlowmeterFloatSensor:sf,FlowmeterGeneral:Wm,FlowmeterNozzle:qm,FlowmeterOrifice:of,FlowmeterPositiveDisplacement:ef,FlowmeterPulse:nf,FlowmeterRingPiston:Jm,FlowmeterTurbine:tf,FlowmeterVariableArea:Um,FlowmeterVenturi:Qm,FourWayValve:Qp,GateValve:wm,HeatExchangerGeneral:rf,HeatExchangerM:lf,HeatExchangerStraightTube:af,HeaterElement:Hm,HelicalAgitator:xm,ISOBurstDisc:Fm,ISOCap:Pm,ISOCheckValve:Am,ISOFilter:zm,Light:Df,LiquidRingCompressor:gm,ManualValve:Rf,NeedleValve:jf,Nozzle:ff,OffPageReference:Bf,OffPageReferencePreview:$f,Orifice:Om,OrificePlate:$m,PaddleAgitator:um,PistonPump:rm,PolygonSymbol:_f,PropellerAgitator:am,Pump:em,Regulator:bm,RegulatorManual:vm,ReliefValve:Ef,RollerVaneCompressor:hm,RotaryMixer:im,SYMBOLS:o7,ScrewPump:pm,Setpoint:Pf,SetpointPreview:Nf,SolenoidValve:qp,SpringLoadedReliefValve:yf,StaticMixer:Ym,Strainer:hf,StrainerCone:gf,Switch:Dm,TJunction:Zm,Tank:bf,TankPreview:vf,TextBox:Hf,TextBoxPreview:Ff,ThreeWayBallValve:Cm,ThreeWayValve:Up,Thruster:mf,Triangle:a6,TurboCompressor:fm,VacuumPump:sm,Value:Tf,ValuePreview:Af,Valve:Xp,Vent:Bm,createDummyToggle:yt,createLabeled:ce,createToggle:Ce,variantZ:x6},Symbol.toStringTag,{value:"Module"}));exports.Aether=f.main;exports.Divider=f.Divider$2;exports.Generic=f.Generic;exports.Haul=f.Haul;exports.Worker=f.Context;exports.compareArrayDeps=f.compareArrayDeps;exports.preventDefault=f.preventDefault;exports.stopPropagation=f.stopPropagation;exports.useClickOutside=f.useClickOutside;exports.useCombinedRefs=f.useCombinedRefs;exports.useCombinedStateAndRef=f.useCombinedStateAndRef;exports.useEffectCompare=f.useEffectCompare;exports.useInitializerRef=f.useInitializerRef;exports.useMemoCompare=f.useMemoCompare;exports.useMemoDeepEqual=f.useMemoDeepEqual;exports.useMemoPrimitiveArray=f.useMemoPrimitiveArray;exports.usePrevious=f.usePrevious;exports.useRequiredContext=f.useRequiredContext;exports.useResize=f.useResize;exports.useStateRef=f.useStateRef;exports.useSyncedRef=f.useSyncedRef;exports.CSS=u.CSS;exports.DataType=u.r;exports.Density=u.d;exports.MultiSeries=u.Vt;exports.Rate=u.E;exports.Series=u.I;exports.TimeRange=u.w;exports.TimeSpan=u.a;exports.TimeStamp=u.n;exports.newBEM=u.newBEM;exports.state=A.state;exports.Button=Gh.external;exports.Caret=Dl.Animated$1;exports.telem=T.external;exports.Theming=ws.external;exports.Color=Ne.external;exports.useDebouncedCallback=Ne.useDebouncedCallback;exports.Triggers=$l.external;exports.List=nt.external;exports.Dialog=zl.external;exports.Input=Ae.external;exports.Flex=pe.external;exports.createHexOpacityVariants=Vl.createHexOpacityVariants;exports.unitProperty=Vl.unitProperty;exports.Header=Uh.external;exports.Menu=Xh.external;exports.Tabs=Me.external;exports.Text=qh.external;exports.Tree=Qh.external;exports.Video=Jh.Video;exports.Breadcrumb=Hg;exports.Canvas=n1;exports.Channel=E0;exports.Component=Ng;exports.Control=S2;exports.Device=k0;exports.Diagram=yC;exports.Direction=y0;exports.Eraser=bg;exports.Flux=i0;exports.Form=n0;exports.Icon=mg;exports.Label=tj;exports.Legend=a1;exports.Line=u1;exports.LinePlot=_1;exports.Log=RC;exports.Measure=P1;exports.Mosaic=jj;exports.Nav=kg;exports.Note=yj;exports.OS=Dj;exports.Observe=e0;exports.Ontology=Nj;exports.Override=$j;exports.Pluto=M2;exports.Portal=uj;exports.Progress=N2;exports.Rack=I0;exports.Range=L1;exports.Ranger=x2;exports.Resize=Cg;exports.Rule=N1;exports.Schematic=r7;exports.Select=$g;exports.Status=Pg;exports.Steps=A2;exports.Synnax=F1;exports.Table=$2;exports.TableCells=n3;exports.Tag=Tg;exports.Task=K0;exports.Telem=g2;exports.Tooltip=fg;exports.Value=Z2;exports.Viewport=b1;exports.Workspace=v2;exports.axis=qg;exports.control=Qg;exports.proxyMemo=dg;exports.useAsyncEffect=Jt;exports.useDelayedState=xg;exports.useDestructors=Uo;exports.useTransforms=pg;
|
|
38
|
+
`)),x=d.reduce((p,m)=>p.concat(...m),[]);return[d,x]}return[[],[]]},[e]);return j.useEffect(()=>{const c=t?.target??gl,d=t?.actInsideInputWithModifier??!0;if(e!==null){const x=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!d)&&nd(h))return!1;const E=El(h.code,a);if(i.current.add(h[E]),jl(l,i.current,!1)){const S=h.composedPath?.()?.[0]||h.target,R=S?.nodeName==="BUTTON"||S?.nodeName==="A";t.preventDefault!==!1&&(r.current||!R)&&h.preventDefault(),s(!0)}},p=h=>{const g=El(h.code,a);jl(l,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),r.current=!1},m=()=>{i.current.clear(),s(!1)};return c?.addEventListener("keydown",x),c?.addEventListener("keyup",p),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c?.removeEventListener("keydown",x),c?.removeEventListener("keyup",p),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,s]),n}function jl(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function El(e,t){return t.includes(e)?"code":"key"}const t4=()=>{const e=ve();return j.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:l,panZoom:a}=e.getState(),c=Gr(t,s,r,i,l,n?.padding??.1);return a?(await a.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:r,snapToGrid:i,domNode:l}=e.getState();if(!l)return t;const{x:a,y:c}=l.getBoundingClientRect(),d={x:t.x-a,y:t.y-c},x=n.snapGrid??r,p=n.snapToGrid??i;return $n(d,s,p,x)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),l=ws(t,n);return{x:l.x+r,y:l.y+i}}}),[])};function vd(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const l=s.get(i.id);l?l.push(i):s.set(i.id,[i])}for(const i of t){const l=s.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const a={...i};for(const c of l)n4(c,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function n4(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??={},t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function _d(e,t){return vd(e,t)}function kd(e,t){return vd(e,t)}function Ct(e,t){return{id:e,type:"select",selected:t}}function Yt(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const l=t.has(r);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),s.push(Ct(i.id,l)))}return s}function yl({items:e=[],lookup:t}){const n=[],s=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const l=t.get(i.id),a=l?.internals?.userNode??l;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)s.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function Sl(e){return{id:e.id,type:"remove"}}const Rl=e=>ky(e),s4=e=>Gu(e);function Ld(e){return j.forwardRef(e)}const o4=typeof window<"u"?j.useLayoutEffect:j.useEffect;function Cl(e){const[t,n]=j.useState(BigInt(0)),[s]=j.useState(()=>r4(()=>n(r=>r+BigInt(1))));return o4(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function r4(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Md=j.createContext(null);function i4({children:e}){const t=ve(),n=j.useCallback(a=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:x,onNodesChange:p,nodeLookup:m,fitViewQueued:h}=t.getState();let g=c;for(const S of a)g=typeof S=="function"?S(g):S;const E=yl({items:g,lookup:m});x&&d(g),E.length>0?p?.(E):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:R,setNodes:v}=t.getState();S&&v(R)})},[]),s=Cl(n),r=j.useCallback(a=>{const{edges:c=[],setEdges:d,hasDefaultEdges:x,onEdgesChange:p,edgeLookup:m}=t.getState();let h=c;for(const g of a)h=typeof g=="function"?g(h):g;x?d(h):p&&p(yl({items:h,lookup:m}))},[]),i=Cl(r),l=j.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsxRuntimeExports.jsx(Md.Provider,{value:l,children:e})}function l4(){const e=j.useContext(Md);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const a4=e=>!!e.panZoom;function Bt(){const e=t4(),t=ve(),n=l4(),s=je(a4),r=j.useMemo(()=>{const i=p=>t.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},a=p=>{n.edgeQueue.push(p)},c=p=>{const{nodeLookup:m,nodeOrigin:h}=t.getState(),g=Rl(p)?p:m.get(p.id),E=g.parentId?ed(g.position,g.measured,g.parentId,m,h):g.position,S={...g,position:E,width:g.measured?.width??g.width,height:g.measured?.height??g.height};return tn(S)},d=(p,m,h={replace:!1})=>{l(g=>g.map(E=>{if(E.id===p){const S=typeof m=="function"?m(E):m;return h.replace&&Rl(S)?S:{...E,...S}}return E}))},x=(p,m,h={replace:!1})=>{a(g=>g.map(E=>{if(E.id===p){const S=typeof m=="function"?m(E):m;return h.replace&&s4(S)?S:{...E,...S}}return E}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>i(p)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(m=>({...m}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:l,setEdges:a,addNodes:p=>{const m=Array.isArray(p)?p:[p];n.nodeQueue.push(h=>[...h,...m])},addEdges:p=>{const m=Array.isArray(p)?p:[p];n.edgeQueue.push(h=>[...h,...m])},toObject:()=>{const{nodes:p=[],edges:m=[],transform:h}=t.getState(),[g,E,S]=h;return{nodes:p.map(R=>({...R})),edges:m.map(R=>({...R})),viewport:{x:g,y:E,zoom:S}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:h,edges:g,onNodesDelete:E,onEdgesDelete:S,triggerNodeChanges:R,triggerEdgeChanges:v,onDelete:y,onBeforeDelete:C}=t.getState(),{nodes:_,edges:k}=await Ty({nodesToRemove:p,edgesToRemove:m,nodes:h,edges:g,onBeforeDelete:C}),T=k.length>0,O=_.length>0;if(T){const B=k.map(Sl);S?.(k),v(B)}if(O){const B=_.map(Sl);E?.(_),R(B)}return(O||T)&&y?.({nodes:_,edges:k}),{deletedNodes:_,deletedEdges:k}},getIntersectingNodes:(p,m=!0,h)=>{const g=Wi(p),E=g?p:c(p),S=h!==void 0;return E?(h||t.getState().nodes).filter(R=>{const v=t.getState().nodeLookup.get(R.id);if(v&&!g&&(R.id===p.id||!v.internals.positionAbsolute))return!1;const y=tn(S?R:v),C=kn(y,E);return m&&C>0||C>=E.width*E.height}):[]},isNodeIntersecting:(p,m,h=!0)=>{const E=Wi(p)?p:c(p);if(!E)return!1;const S=kn(E,m);return h&&S>0||S>=E.width*E.height},updateNode:d,updateNodeData:(p,m,h={replace:!1})=>{d(p,g=>{const E=typeof m=="function"?m(g):m;return h.replace?{...g,data:E}:{...g,data:{...g.data,...E}}},h)},updateEdge:x,updateEdgeData:(p,m,h={replace:!1})=>{x(p,g=>{const E=typeof m=="function"?m(g):m;return h.replace?{...g,data:E}:{...g,data:{...g.data,...E}}},h)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:h}=t.getState();return Ly(p,{nodeLookup:m,nodeOrigin:h})},getHandleConnections:({type:p,id:m,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${p}${m?`-${m}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:m,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${p?m?`-${p}-${m}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const m=t.getState().fitViewResolver??Oy();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:m}),n.nodeQueue.push(h=>[...h]),m.promise}}},[]);return j.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const wl=e=>e.selected,c4=typeof window<"u"?window:void 0;function u4({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ve(),{deleteElements:s}=Bt(),r=Mn(e,{actInsideInputWithModifier:!1}),i=Mn(t,{target:c4});j.useEffect(()=>{if(r){const{edges:l,nodes:a}=n.getState();s({nodes:a.filter(wl),edges:l.filter(wl)}),n.setState({nodesSelectionActive:!1})}},[r]),j.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function d4(e){const t=ve();j.useEffect(()=>{const n=()=>{if(!e.current)return!1;const s=Ur(e.current);(s.height===0||s.width===0)&&t.getState().onError?.("004",Ae.error004()),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Ys={position:"absolute",width:"100%",height:"100%",top:0,left:0},x4=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function p4({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=bt.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:d,minZoom:x,maxZoom:p,zoomActivationKeyCode:m,preventScrolling:h=!0,children:g,noWheelClassName:E,noPanClassName:S,onViewportChange:R,isControlledViewport:v,paneClickDistance:y}){const C=ve(),_=j.useRef(null),{userSelectionActive:k,lib:T}=je(x4,_e),O=Mn(m),B=j.useRef();d4(_);const F=j.useCallback(z=>{R?.({x:z[0],y:z[1],zoom:z[2]}),v||C.setState({transform:z})},[R,v]);return j.useEffect(()=>{if(_.current){B.current=hS({domNode:_.current,minZoom:x,maxZoom:p,translateExtent:d,viewport:c,paneClickDistance:y,onDraggingChange:w=>C.setState({paneDragging:w}),onPanZoomStart:(w,L)=>{const{onViewportChangeStart:M,onMoveStart:D}=C.getState();D?.(w,L),M?.(L)},onPanZoom:(w,L)=>{const{onViewportChange:M,onMove:D}=C.getState();D?.(w,L),M?.(L)},onPanZoomEnd:(w,L)=>{const{onViewportChangeEnd:M,onMoveEnd:D}=C.getState();D?.(w,L),M?.(L)}});const{x:z,y:N,zoom:$}=B.current.getViewport();return C.setState({panZoom:B.current,transform:[z,N,$],domNode:_.current.closest(".react-flow")}),()=>{B.current?.destroy()}}},[]),j.useEffect(()=>{B.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:O,preventScrolling:h,noPanClassName:S,userSelectionActive:k,noWheelClassName:E,lib:T,onTransformChange:F})},[e,t,n,s,r,i,l,a,O,h,S,k,E,T,F]),o.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:_,style:Ys,children:g})}const m4=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function f4(){const{userSelectionActive:e,userSelectionRect:t}=je(m4,_e);return e&&t?o.jsxRuntimeExports.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const yo=(e,t)=>n=>{n.target===t.current&&e?.(n)},h4=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function g4({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Jt.Full,panOnDrag:s,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:l,onPaneClick:a,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:x,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){const g=ve(),{userSelectionActive:E,elementsSelectable:S,dragging:R,connectionInProgress:v}=je(h4,_e),y=S&&(e||E),C=j.useRef(null),_=j.useRef(),k=j.useRef(new Set),T=j.useRef(new Set),O=j.useRef(!1),B=j.useRef(!1),F=D=>{if(O.current||v){O.current=!1;return}a?.(D),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},z=D=>{if(Array.isArray(s)&&s?.includes(2)){D.preventDefault();return}c?.(D)},N=d?D=>d(D):void 0,$=D=>{const{resetSelectedElements:H,domNode:V}=g.getState();if(_.current=V?.getBoundingClientRect(),!S||!e||D.button!==0||D.target!==C.current||!_.current)return;D.target?.setPointerCapture?.(D.pointerId),B.current=!0,O.current=!1;const{x:Z,y:K}=et(D.nativeEvent,_.current);H(),g.setState({userSelectionRect:{width:0,height:0,startX:Z,startY:K,x:Z,y:K}}),i?.(D)},w=D=>{const{userSelectionRect:H,transform:V,nodeLookup:Z,edgeLookup:K,connectionLookup:q,triggerNodeChanges:ne,triggerEdgeChanges:J,defaultEdgeOptions:oe}=g.getState();if(!_.current||!H)return;O.current=!0;const{x:se,y:re}=et(D.nativeEvent,_.current),{startX:ee,startY:ie}=H,ye={startX:ee,startY:ie,x:se<ee?se:ee,y:re<ie?re:ie,width:Math.abs(se-ee),height:Math.abs(re-ie)},Se=k.current,ue=T.current;k.current=new Set(Wr(Z,ye,V,n===Jt.Partial,!0).map(U=>U.id)),T.current=new Set;const me=oe?.selectable??!0;for(const U of k.current){const de=q.get(U);if(de)for(const{edgeId:be}of de.values()){const Te=K.get(be);Te&&(Te.selectable??me)&&T.current.add(be)}}if(!Gi(Se,k.current)){const U=Yt(Z,k.current,!0);ne(U)}if(!Gi(ue,T.current)){const U=Yt(K,T.current);J(U)}g.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},L=D=>{if(D.button!==0||!B.current)return;D.target?.releasePointerCapture?.(D.pointerId);const{userSelectionRect:H}=g.getState();!E&&H&&D.target===C.current&&F?.(D),g.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),l?.(D),(t||r)&&(O.current=!1),B.current=!1},M=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxRuntimeExports.jsxs("div",{className:Le(["react-flow__pane",{draggable:M,dragging:R,selection:e}]),onClick:y?void 0:yo(F,C),onContextMenu:yo(z,C),onWheel:yo(N,C),onPointerEnter:y?void 0:x,onPointerDown:y?$:p,onPointerMove:y?w:p,onPointerUp:y?L:void 0,onPointerLeave:m,ref:C,style:Ys,children:[h,o.jsxRuntimeExports.jsx(f4,{})]})}function Wo({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:a,onError:c}=t.getState(),d=a.get(e);if(!d){c?.("012",Ae.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):r([e])}function Pd({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:l}){const a=ve(),[c,d]=j.useState(!1),x=j.useRef();return j.useEffect(()=>{x.current=tS({getStoreItems:()=>a.getState(),onNodeMouseDown:p=>{Wo({id:p,store:a,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),j.useEffect(()=>{if(t)x.current?.destroy();else if(e.current)return x.current?.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:l}),()=>{x.current?.destroy()}},[n,s,t,i,e,r]),c}const j4=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Nd(){const e=ve();return j.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:l,onError:a,updateNodePositions:c,nodeLookup:d,nodeOrigin:x}=e.getState(),p=new Map,m=j4(l),h=r?i[0]:5,g=r?i[1]:5,E=n.direction.x*h*n.factor,S=n.direction.y*g*n.factor;for(const[,R]of d){if(!m(R))continue;let v={x:R.internals.positionAbsolute.x+E,y:R.internals.positionAbsolute.y+S};r&&(v=Fs(v,i));const{position:y,positionAbsolute:C}=Uu({nodeId:R.id,nextPosition:v,nodeLookup:d,nodeExtent:s,nodeOrigin:x,onError:a});R.position=y,R.internals.positionAbsolute=C,p.set(R.id,R)}c(p)},[])}const ei=j.createContext(null),E4=ei.Provider;ei.Consumer;const Td=()=>j.useContext(ei),y4=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),S4=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:l}=s,{fromHandle:a,toHandle:c,isValid:d}=l,x=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:x,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===Nt.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:x&&d}};function R4({type:e="source",position:t=Q.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:l,onConnect:a,children:c,className:d,onMouseDown:x,onTouchStart:p,...m},h){const g=l||null,E=e==="target",S=ve(),R=Td(),{connectOnClick:v,noPanClassName:y,rfId:C}=je(y4,_e),{connectingFrom:_,connectingTo:k,clickConnecting:T,isPossibleEndHandle:O,connectionInProcess:B,clickConnectionInProcess:F,valid:z}=je(S4(R,g,e),_e);R||S.getState().onError?.("010",Ae.error010());const N=L=>{const{defaultEdgeOptions:M,onConnect:D,hasDefaultEdges:H}=S.getState(),V={...M,...L};if(H){const{edges:Z,setEdges:K}=S.getState();K(ad(V,Z))}D?.(V),a?.(V)},$=L=>{if(!R)return;const M=sd(L.nativeEvent);if(r&&(M&&L.button===0||!M)){const D=S.getState();Yo.onPointerDown(L.nativeEvent,{autoPanOnConnect:D.autoPanOnConnect,connectionMode:D.connectionMode,connectionRadius:D.connectionRadius,domNode:D.domNode,nodeLookup:D.nodeLookup,lib:D.lib,isTarget:E,handleId:g,nodeId:R,flowId:D.rfId,panBy:D.panBy,cancelConnection:D.cancelConnection,onConnectStart:D.onConnectStart,onConnectEnd:D.onConnectEnd,updateConnection:D.updateConnection,onConnect:N,isValidConnection:n||D.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:D.autoPanSpeed,dragThreshold:D.connectionDragThreshold})}M?x?.(L):p?.(L)},w=L=>{const{onClickConnectStart:M,onClickConnectEnd:D,connectionClickStartHandle:H,connectionMode:V,isValidConnection:Z,lib:K,rfId:q,nodeLookup:ne,connection:J}=S.getState();if(!R||!H&&!r)return;if(!H){M?.(L.nativeEvent,{nodeId:R,handleId:g,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:R,type:e,id:g}});return}const oe=td(L.target),se=n||Z,{connection:re,isValid:ee}=Yo.isValid(L.nativeEvent,{handle:{nodeId:R,id:g,type:e},connectionMode:V,fromNodeId:H.nodeId,fromHandleId:H.id||null,fromType:H.type,isValidConnection:se,flowId:q,doc:oe,lib:K,nodeLookup:ne});ee&&re&&N(re);const ie=structuredClone(J);delete ie.inProgress,ie.toPosition=ie.toHandle?ie.toHandle.position:null,D?.(L,ie),S.setState({connectionClickStartHandle:null})};return o.jsxRuntimeExports.jsx("div",{"data-handleid":g,"data-nodeid":R,"data-handlepos":t,"data-id":`${C}-${R}-${g}-${e}`,className:Le(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,d,{source:!E,target:E,connectable:s,connectablestart:r,connectableend:i,clickconnecting:T,connectingfrom:_,connectingto:k,valid:z,connectionindicator:s&&(!B||O)&&(B||F?i:r)}]),onMouseDown:$,onTouchStart:$,onClick:v?w:void 0,ref:h,...m,children:c})}const Pn=j.memo(Ld(R4));function C4({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e?.label,o.jsxRuntimeExports.jsx(Pn,{type:"source",position:n,isConnectable:t})]})}function w4({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:s=Q.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Pn,{type:"target",position:n,isConnectable:t}),e?.label,o.jsxRuntimeExports.jsx(Pn,{type:"source",position:s,isConnectable:t})]})}function b4(){return null}function v4({data:e,isConnectable:t,targetPosition:n=Q.Top}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Pn,{type:"target",position:n,isConnectable:t}),e?.label]})}const vs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},bl={input:C4,default:w4,output:v4,group:b4};function _4(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const k4=e=>{const{width:t,height:n,x:s,y:r}=Bn(e.nodeLookup,{filter:i=>!!i.selected});return{width:Ge(t)?t:null,height:Ge(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function L4({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=ve(),{width:r,height:i,transformString:l,userSelectionActive:a}=je(k4,_e),c=Nd(),d=j.useRef(null);if(j.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),Pd({nodeRef:d}),a||!r||!i)return null;const x=e?m=>{const h=s.getState().nodes.filter(g=>g.selected);e(m,h)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(vs,m.key)&&(m.preventDefault(),c({direction:vs[m.key],factor:m.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:Le(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:o.jsxRuntimeExports.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:r,height:i}})})}const vl=typeof window<"u"?window:void 0,M4=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Id({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:x,selectionMode:p,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:E,zoomActivationKeyCode:S,elementsSelectable:R,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:_,panOnScrollMode:k,zoomOnDoubleClick:T,panOnDrag:O,defaultViewport:B,translateExtent:F,minZoom:z,maxZoom:N,preventScrolling:$,onSelectionContextMenu:w,noWheelClassName:L,noPanClassName:M,disableKeyboardA11y:D,onViewportChange:H,isControlledViewport:V}){const{nodesSelectionActive:Z,userSelectionActive:K}=je(M4),q=Mn(d,{target:vl}),ne=Mn(E,{target:vl}),J=ne||O,oe=ne||C,se=x&&J!==!0,re=q||K||se;return u4({deleteKeyCode:c,multiSelectionKeyCode:g}),o.jsxRuntimeExports.jsx(p4,{onPaneContextMenu:i,elementsSelectable:R,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:oe,panOnScrollSpeed:_,panOnScrollMode:k,zoomOnDoubleClick:T,panOnDrag:!q&&J,defaultViewport:B,translateExtent:F,minZoom:z,maxZoom:N,zoomActivationKeyCode:S,preventScrolling:$,noWheelClassName:L,noPanClassName:M,onViewportChange:H,isControlledViewport:V,paneClickDistance:a,children:o.jsxRuntimeExports.jsxs(g4,{onSelectionStart:m,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:J,isSelecting:!!re,selectionMode:p,selectionKeyPressed:q,selectionOnDrag:se,children:[e,Z&&o.jsxRuntimeExports.jsx(L4,{onSelectionContextMenu:w,noPanClassName:M,disableKeyboardA11y:D})]})})}Id.displayName="FlowRenderer";const P4=j.memo(Id),N4=e=>t=>e?Wr(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function T4(e){return je(j.useCallback(N4(e),[e]),_e)}const I4=e=>e.updateNodeInternals;function A4(){const e=je(I4),[t]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return j.useEffect(()=>()=>{t?.disconnect()},[t]),t}function O4({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=ve(),i=j.useRef(null),l=j.useRef(null),a=j.useRef(e.sourcePosition),c=j.useRef(e.targetPosition),d=j.useRef(t),x=n&&!!e.internals.handleBounds;return j.useEffect(()=>{i.current&&!e.hidden&&(!x||l.current!==i.current)&&(l.current&&s?.unobserve(l.current),s?.observe(i.current),l.current=i.current)},[x,e.hidden]),j.useEffect(()=>()=>{l.current&&(s?.unobserve(l.current),l.current=null)},[]),j.useEffect(()=>{if(i.current){const p=d.current!==t,m=a.current!==e.sourcePosition,h=c.current!==e.targetPosition;(p||m||h)&&(d.current=t,a.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function D4({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:l,nodesDraggable:a,elementsSelectable:c,nodesConnectable:d,nodesFocusable:x,resizeObserver:p,noDragClassName:m,noPanClassName:h,disableKeyboardA11y:g,rfId:E,nodeTypes:S,nodeClickDistance:R,onError:v}){const{node:y,internals:C,isParent:_}=je(ee=>{const ie=ee.nodeLookup.get(e),ye=ee.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:ye}},_e);let k=y.type||"default",T=S?.[k]||bl[k];T===void 0&&(v?.("003",Ae.error003(k)),k="default",T=bl.default);const O=!!(y.draggable||a&&typeof y.draggable>"u"),B=!!(y.selectable||c&&typeof y.selectable>"u"),F=!!(y.connectable||d&&typeof y.connectable>"u"),z=!!(y.focusable||x&&typeof y.focusable>"u"),N=ve(),$=Ju(y),w=O4({node:y,nodeType:k,hasDimensions:$,resizeObserver:p}),L=Pd({nodeRef:w,disabled:y.hidden||!O,noDragClassName:m,handleSelector:y.dragHandle,nodeId:e,isSelectable:B,nodeClickDistance:R}),M=Nd();if(y.hidden)return null;const D=ut(y),H=_4(y),V=B||O||t||n||s||r,Z=n?ee=>n(ee,{...C.userNode}):void 0,K=s?ee=>s(ee,{...C.userNode}):void 0,q=r?ee=>r(ee,{...C.userNode}):void 0,ne=i?ee=>i(ee,{...C.userNode}):void 0,J=l?ee=>l(ee,{...C.userNode}):void 0,oe=ee=>{const{selectNodesOnDrag:ie,nodeDragThreshold:ye}=N.getState();B&&(!ie||!O||ye>0)&&Wo({id:e,store:N,nodeRef:w}),t&&t(ee,{...C.userNode})},se=ee=>{if(!(nd(ee.nativeEvent)||g)){if(Zu.includes(ee.key)&&B){const ie=ee.key==="Escape";Wo({id:e,store:N,unselect:ie,nodeRef:w})}else if(O&&y.selected&&Object.prototype.hasOwnProperty.call(vs,ee.key)){ee.preventDefault();const{ariaLabelConfig:ie}=N.getState();N.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),M({direction:vs[ee.key],factor:ee.shiftKey?4:1})}}},re=()=>{if(g||!w.current?.matches(":focus-visible"))return;const{transform:ee,width:ie,height:ye,autoPanOnNodeFocus:Se,setCenter:ue}=N.getState();if(!Se)return;Wr(new Map([[e,y]]),{x:0,y:0,width:ie,height:ye},ee,!0).length>0||ue(y.position.x+D.width/2,y.position.y+D.height/2,{zoom:ee[2]})};return o.jsxRuntimeExports.jsx("div",{className:Le(["react-flow__node",`react-flow__node-${k}`,{[h]:O},y.className,{selected:y.selected,selectable:B,parent:_,draggable:O,dragging:L}]),ref:w,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:$?"visible":"hidden",...y.style,...H},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:Z,onMouseMove:K,onMouseLeave:q,onContextMenu:ne,onClick:oe,onDoubleClick:J,onKeyDown:z?se:void 0,tabIndex:z?0:void 0,onFocus:z?re:void 0,role:y.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${Cd}-${E}`,"aria-label":y.ariaLabel,...y.domAttributes,children:o.jsxRuntimeExports.jsx(E4,{value:e,children:o.jsxRuntimeExports.jsx(T,{id:e,data:y.data,type:k,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:B,draggable:O,deletable:y.deletable??!0,isConnectable:F,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:L,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...D})})})}const B4=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Ad(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=je(B4,_e),l=T4(e.onlyRenderVisibleElements),a=A4();return o.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ys,children:l.map(c=>o.jsxRuntimeExports.jsx(D4,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}Ad.displayName="NodeRenderer";const $4=j.memo(Ad);function z4(e){return je(j.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);i&&l&&zy({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),_e)}const V4=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),F4=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),_l={[Ss.Arrow]:V4,[Ss.ArrowClosed]:F4};function H4(e){const t=ve();return j.useMemo(()=>Object.prototype.hasOwnProperty.call(_l,e)?_l[e]:(t.getState().onError?.("009",Ae.error009(e)),null),[e])}const Z4=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:a="auto-start-reverse"})=>{const c=H4(t);return c?o.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:o.jsxRuntimeExports.jsx(c,{color:n,strokeWidth:l})}):null},Od=({defaultColor:e,rfId:t})=>{const n=je(i=>i.edges),s=je(i=>i.defaultEdgeOptions),r=j.useMemo(()=>Wy(n,{id:t,defaultColor:e,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[n,s,t,e]);return r.length?o.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsxRuntimeExports.jsx("defs",{children:r.map(i=>o.jsxRuntimeExports.jsx(Z4,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Od.displayName="MarkerDefinitions";var K4=j.memo(Od);function Dd({x:e,y:t,label:n,labelStyle:s,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:a=2,children:c,className:d,...x}){const[p,m]=j.useState({x:1,y:0,width:0,height:0}),h=Le(["react-flow__edge-textwrapper",d]),g=j.useRef(null);return j.useEffect(()=>{if(g.current){const E=g.current.getBBox();m({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),n?o.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:h,visibility:p.width?"visible":"hidden",...x,children:[r&&o.jsxRuntimeExports.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),o.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:g,style:s,children:n}),c]}):null}Dd.displayName="EdgeText";const Y4=j.memo(Dd);function Ue({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:d=20,...x}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{...x,d:e,fill:"none",className:Le(["react-flow__edge-path",x.className])}),d&&o.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),s&&Ge(t)&&Ge(n)?o.jsxRuntimeExports.jsx(Y4,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function kl({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===Q.Left||e===Q.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function Bd({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:s,targetY:r,targetPosition:i=Q.Top}){const[l,a]=kl({pos:n,x1:e,y1:t,x2:s,y2:r}),[c,d]=kl({pos:i,x1:s,y1:r,x2:e,y2:t}),[x,p,m,h]=od({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:d});return[`M${e},${t} C${l},${a} ${c},${d} ${s},${r}`,x,p,m,h]}function $d(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l,targetPosition:a,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:E,markerStart:S,interactionWidth:R})=>{const[v,y,C]=Bd({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:a}),_=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:_,path:v,labelX:y,labelY:C,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:E,markerStart:S,interactionWidth:R})})}const W4=$d({isInternal:!1}),zd=$d({isInternal:!0});W4.displayName="SimpleBezierEdge";zd.displayName="SimpleBezierEdgeInternal";function Vd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,sourcePosition:h=Q.Bottom,targetPosition:g=Q.Top,markerEnd:E,markerStart:S,pathOptions:R,interactionWidth:v})=>{const[y,C,_]=Ho({sourceX:n,sourceY:s,sourcePosition:h,targetX:r,targetY:i,targetPosition:g,borderRadius:R?.borderRadius,offset:R?.offset}),k=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:k,path:y,labelX:C,labelY:_,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:E,markerStart:S,interactionWidth:v})})}const Fd=Vd({isInternal:!1}),Hd=Vd({isInternal:!0});Fd.displayName="SmoothStepEdge";Hd.displayName="SmoothStepEdgeInternal";function Zd(e){return j.memo(({id:t,...n})=>{const s=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Fd,{...n,id:s,pathOptions:j.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const G4=Zd({isInternal:!1}),Kd=Zd({isInternal:!0});G4.displayName="StepEdge";Kd.displayName="StepEdgeInternal";function Yd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:E})=>{const[S,R,v]=cd({sourceX:n,sourceY:s,targetX:r,targetY:i}),y=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:y,path:S,labelX:R,labelY:v,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:E})})}const U4=Yd({isInternal:!1}),Wd=Yd({isInternal:!0});U4.displayName="StraightEdge";Wd.displayName="StraightEdgeInternal";function Gd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=Q.Bottom,targetPosition:a=Q.Top,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:E,markerStart:S,pathOptions:R,interactionWidth:v})=>{const[y,C,_]=rd({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:a,curvature:R?.curvature}),k=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ue,{id:k,path:y,labelX:C,labelY:_,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:E,markerStart:S,interactionWidth:v})})}const X4=Gd({isInternal:!1}),Ud=Gd({isInternal:!0});X4.displayName="BezierEdge";Ud.displayName="BezierEdgeInternal";const Ll={default:Ud,straight:Wd,step:Kd,smoothstep:Hd,simplebezier:zd},Ml={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},q4=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,Q4=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,Pl="react-flow__edgeupdater";function Nl({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:l,type:a}){return o.jsxRuntimeExports.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:l,className:Le([Pl,`${Pl}-${a}`]),cx:q4(t,s,e),cy:Q4(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function J4({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:l,sourcePosition:a,targetPosition:c,onReconnect:d,onReconnectStart:x,onReconnectEnd:p,setReconnecting:m,setUpdateHover:h}){const g=ve(),E=(C,_)=>{if(C.button!==0)return;const{autoPanOnConnect:k,domNode:T,isValidConnection:O,connectionMode:B,connectionRadius:F,lib:z,onConnectStart:N,onConnectEnd:$,cancelConnection:w,nodeLookup:L,rfId:M,panBy:D,updateConnection:H}=g.getState(),V=_.type==="target",Z=(ne,J)=>{m(!1),p?.(ne,n,_.type,J)},K=ne=>d?.(n,ne),q=(ne,J)=>{m(!0),x?.(C,n,_.type),N?.(ne,J)};Yo.onPointerDown(C.nativeEvent,{autoPanOnConnect:k,connectionMode:B,connectionRadius:F,domNode:T,handleId:_.id,nodeId:_.nodeId,nodeLookup:L,isTarget:V,edgeUpdaterType:_.type,lib:z,flowId:M,cancelConnection:w,panBy:D,isValidConnection:O,onConnect:K,onConnectStart:q,onConnectEnd:$,onReconnectEnd:Z,updateConnection:H,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold})},S=C=>E(C,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),R=C=>E(C,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>h(!0),y=()=>h(!1);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&o.jsxRuntimeExports.jsx(Nl,{position:a,centerX:s,centerY:r,radius:t,onMouseDown:S,onMouseEnter:v,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&o.jsxRuntimeExports.jsx(Nl,{position:c,centerX:i,centerY:l,radius:t,onMouseDown:R,onMouseEnter:v,onMouseOut:y,type:"target"})]})}function eR({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:l,onMouseEnter:a,onMouseMove:c,onMouseLeave:d,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,rfId:g,edgeTypes:E,noPanClassName:S,onError:R,disableKeyboardA11y:v}){let y=je(ue=>ue.edgeLookup.get(e));const C=je(ue=>ue.defaultEdgeOptions);y=C?{...C,...y}:y;let _=y.type||"default",k=E?.[_]||Ll[_];k===void 0&&(R?.("011",Ae.error011(_)),_="default",k=Ll.default);const T=!!(y.focusable||t&&typeof y.focusable>"u"),O=typeof p<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),B=!!(y.selectable||s&&typeof y.selectable>"u"),F=j.useRef(null),[z,N]=j.useState(!1),[$,w]=j.useState(!1),L=ve(),{zIndex:M,sourceX:D,sourceY:H,targetX:V,targetY:Z,sourcePosition:K,targetPosition:q}=je(j.useCallback(ue=>{const me=ue.nodeLookup.get(y.source),U=ue.nodeLookup.get(y.target);if(!me||!U)return{zIndex:y.zIndex,...Ml};const de=Yy({id:e,sourceNode:me,targetNode:U,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ue.connectionMode,onError:R});return{zIndex:$y({selected:y.selected,zIndex:y.zIndex,sourceNode:me,targetNode:U,elevateOnSelect:ue.elevateEdgesOnSelect}),...de||Ml}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),_e),ne=j.useMemo(()=>y.markerStart?`url('#${Zo(y.markerStart,g)}')`:void 0,[y.markerStart,g]),J=j.useMemo(()=>y.markerEnd?`url('#${Zo(y.markerEnd,g)}')`:void 0,[y.markerEnd,g]);if(y.hidden||D===null||H===null||V===null||Z===null)return null;const oe=ue=>{const{addSelectedEdges:me,unselectNodesAndEdges:U,multiSelectionActive:de}=L.getState();B&&(L.setState({nodesSelectionActive:!1}),y.selected&&de?(U({nodes:[],edges:[y]}),F.current?.blur()):me([e])),r&&r(ue,y)},se=i?ue=>{i(ue,{...y})}:void 0,re=l?ue=>{l(ue,{...y})}:void 0,ee=a?ue=>{a(ue,{...y})}:void 0,ie=c?ue=>{c(ue,{...y})}:void 0,ye=d?ue=>{d(ue,{...y})}:void 0,Se=ue=>{if(!v&&Zu.includes(ue.key)&&B){const{unselectNodesAndEdges:me,addSelectedEdges:U}=L.getState();ue.key==="Escape"?(F.current?.blur(),me({edges:[y]})):U([e])}};return o.jsxRuntimeExports.jsx("svg",{style:{zIndex:M},children:o.jsxRuntimeExports.jsxs("g",{className:Le(["react-flow__edge",`react-flow__edge-${_}`,y.className,S,{selected:y.selected,animated:y.animated,inactive:!B&&!r,updating:z,selectable:B}]),onClick:oe,onDoubleClick:se,onContextMenu:re,onMouseEnter:ee,onMouseMove:ie,onMouseLeave:ye,onKeyDown:T?Se:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${wd}-${g}`:void 0,ref:F,...y.domAttributes,children:[!$&&o.jsxRuntimeExports.jsx(k,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:B,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:D,sourceY:H,targetX:V,targetY:Z,sourcePosition:K,targetPosition:q,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:ne,markerEnd:J,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),O&&o.jsxRuntimeExports.jsx(J4,{edge:y,isReconnectable:O,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,sourceX:D,sourceY:H,targetX:V,targetY:Z,sourcePosition:K,targetPosition:q,setUpdateHover:N,setReconnecting:w})]})})}const tR=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Xd({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:x,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:E}){const{edgesFocusable:S,edgesReconnectable:R,elementsSelectable:v,onError:y}=je(tR,_e),C=z4(t);return o.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[o.jsxRuntimeExports.jsx(K4,{defaultColor:e,rfId:n}),C.map(_=>o.jsxRuntimeExports.jsx(eR,{id:_,edgesFocusable:S,edgesReconnectable:R,elementsSelectable:v,noPanClassName:r,onReconnect:i,onContextMenu:l,onMouseEnter:a,onMouseMove:c,onMouseLeave:d,onClick:x,reconnectRadius:p,onDoubleClick:m,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:y,edgeTypes:s,disableKeyboardA11y:E},_))]})}Xd.displayName="EdgeRenderer";const nR=j.memo(Xd),sR=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function oR({children:e}){const t=je(sR);return o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function rR(e){const t=Bt(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const iR=e=>e.panZoom?.syncViewport;function lR(e){const t=je(iR),n=ve();return j.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function aR(e){return e.connection.inProgress?{...e.connection,to:$n(e.connection.to,e.transform)}:{...e.connection}}function cR(e){return aR}function uR(e){const t=cR();return je(t,_e)}const dR=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function xR({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:l,isValid:a,inProgress:c}=je(dR,_e);return!(i&&r&&c)?null:o.jsxRuntimeExports.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:o.jsxRuntimeExports.jsx("g",{className:Le(["react-flow__connection",Wu(a)]),children:o.jsxRuntimeExports.jsx(qd,{style:t,type:n,CustomComponent:s,isValid:a})})})}const qd=({style:e,type:t=ft.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:l,fromHandle:a,fromPosition:c,to:d,toNode:x,toHandle:p,toPosition:m}=uR();if(!r)return;if(n)return o.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:a,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:m,connectionStatus:Wu(s),toNode:x,toHandle:p});let h="";const g={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:m};switch(t){case ft.Bezier:[h]=rd(g);break;case ft.SimpleBezier:[h]=Bd(g);break;case ft.Step:[h]=Ho({...g,borderRadius:0});break;case ft.SmoothStep:[h]=Ho(g);break;default:[h]=cd(g)}return o.jsxRuntimeExports.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};qd.displayName="ConnectionLine";const pR={};function Tl(e=pR){const t=j.useRef(e),n=ve();j.useEffect(()=>{if(process.env.NODE_ENV==="development"){const s=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const r of s)if(t.current[r]!==e[r]){n.getState().onError?.("002",Ae.error002());break}t.current=e}},[e])}function mR(){const e=ve(),t=j.useRef(!1);j.useEffect(()=>{if(process.env.NODE_ENV==="development"&&!t.current){const n=document.querySelector(".react-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.getState().onError?.("013",Ae.error013("react")),t.current=!0}},[])}function Qd({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:x,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:E,connectionLineComponent:S,connectionLineContainerStyle:R,selectionKeyCode:v,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:_,panActivationKeyCode:k,zoomActivationKeyCode:T,deleteKeyCode:O,onlyRenderVisibleElements:B,elementsSelectable:F,defaultViewport:z,translateExtent:N,minZoom:$,maxZoom:w,preventScrolling:L,defaultMarkerColor:M,zoomOnScroll:D,zoomOnPinch:H,panOnScroll:V,panOnScrollSpeed:Z,panOnScrollMode:K,zoomOnDoubleClick:q,panOnDrag:ne,onPaneClick:J,onPaneMouseEnter:oe,onPaneMouseMove:se,onPaneMouseLeave:re,onPaneScroll:ee,onPaneContextMenu:ie,paneClickDistance:ye,nodeClickDistance:Se,onEdgeContextMenu:ue,onEdgeMouseEnter:me,onEdgeMouseMove:U,onEdgeMouseLeave:de,reconnectRadius:be,onReconnect:Te,onReconnectStart:Je,onReconnectEnd:Fn,noDragClassName:Hn,noWheelClassName:Zn,noPanClassName:cn,disableKeyboardA11y:un,nodeExtent:qs,rfId:Kn,viewport:Ft,onViewportChange:dn}){return Tl(e),Tl(t),mR(),rR(n),lR(Ft),o.jsxRuntimeExports.jsx(P4,{onPaneClick:J,onPaneMouseEnter:oe,onPaneMouseMove:se,onPaneMouseLeave:re,onPaneContextMenu:ie,onPaneScroll:ee,paneClickDistance:ye,deleteKeyCode:O,selectionKeyCode:v,selectionOnDrag:y,selectionMode:C,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:_,panActivationKeyCode:k,zoomActivationKeyCode:T,elementsSelectable:F,zoomOnScroll:D,zoomOnPinch:H,zoomOnDoubleClick:q,panOnScroll:V,panOnScrollSpeed:Z,panOnScrollMode:K,panOnDrag:ne,defaultViewport:z,translateExtent:N,minZoom:$,maxZoom:w,onSelectionContextMenu:p,preventScrolling:L,noDragClassName:Hn,noWheelClassName:Zn,noPanClassName:cn,disableKeyboardA11y:un,onViewportChange:dn,isControlledViewport:!!Ft,children:o.jsxRuntimeExports.jsxs(oR,{children:[o.jsxRuntimeExports.jsx(nR,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:Te,onReconnectStart:Je,onReconnectEnd:Fn,onlyRenderVisibleElements:B,onEdgeContextMenu:ue,onEdgeMouseEnter:me,onEdgeMouseMove:U,onEdgeMouseLeave:de,reconnectRadius:be,defaultMarkerColor:M,noPanClassName:cn,disableKeyboardA11y:un,rfId:Kn}),o.jsxRuntimeExports.jsx(xR,{style:E,type:g,component:S,containerStyle:R}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsxRuntimeExports.jsx($4,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:x,nodeClickDistance:Se,onlyRenderVisibleElements:B,noPanClassName:cn,noDragClassName:Hn,disableKeyboardA11y:un,nodeExtent:qs,rfId:Kn}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Qd.displayName="GraphView";const fR=j.memo(Qd),Il=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c=.5,maxZoom:d=2,nodeOrigin:x,nodeExtent:p}={})=>{const m=new Map,h=new Map,g=new Map,E=new Map,S=s??t??[],R=n??e??[],v=x??[0,0],y=p??_n;dd(g,E,S);const C=Ko(R,m,h,{nodeOrigin:v,nodeExtent:y,elevateNodesOnSelect:!1});let _=[0,0,1];if(l&&r&&i){const k=Bn(m,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:T,y:O,zoom:B}=Gr(k,r,i,c,d,a?.padding??.1);_=[T,O,B]}return{rfId:"1",width:0,height:0,transform:_,nodes:R,nodesInitialized:C,nodeLookup:m,parentLookup:h,edges:S,edgeLookup:E,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:_n,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Nt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Yu},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Cs,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Ku}},hR=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:x,nodeExtent:p})=>OS((m,h)=>{async function g(){const{nodeLookup:E,panZoom:S,fitViewOptions:R,fitViewResolver:v,width:y,height:C,minZoom:_,maxZoom:k}=h();S&&(await Ny({nodes:E,width:y,height:C,panZoom:S,minZoom:_,maxZoom:k},R),v?.resolve(!0),m({fitViewResolver:null}))}return{...Il({nodes:e,edges:t,width:r,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:x,nodeExtent:p,defaultNodes:n,defaultEdges:s}),setNodes:E=>{const{nodeLookup:S,parentLookup:R,nodeOrigin:v,elevateNodesOnSelect:y,fitViewQueued:C}=h(),_=Ko(E,S,R,{nodeOrigin:v,nodeExtent:p,elevateNodesOnSelect:y,checkEquality:!0});C&&_?(g(),m({nodes:E,nodesInitialized:_,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:E,nodesInitialized:_})},setEdges:E=>{const{connectionLookup:S,edgeLookup:R}=h();dd(S,R,E),m({edges:E})},setDefaultNodesAndEdges:(E,S)=>{if(E){const{setNodes:R}=h();R(E),m({hasDefaultNodes:!0})}if(S){const{setEdges:R}=h();R(S),m({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:S,nodeLookup:R,parentLookup:v,domNode:y,nodeOrigin:C,nodeExtent:_,debug:k,fitViewQueued:T}=h(),{changes:O,updatedInternals:B}=Qy(E,R,v,y,C,_);B&&(Uy(R,v,{nodeOrigin:C,nodeExtent:_}),T?(g(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),O?.length>0&&(k&&console.log("React Flow: trigger node changes",O),S?.(O)))},updateNodePositions:(E,S=!1)=>{const R=[],v=[],{nodeLookup:y,triggerNodeChanges:C}=h();for(const[_,k]of E){const T=y.get(_),O=!!(T?.expandParent&&T?.parentId&&k?.position),B={id:_,type:"position",position:O?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:S};O&&T.parentId&&R.push({id:_,parentId:T.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}}),v.push(B)}if(R.length>0){const{parentLookup:_,nodeOrigin:k}=h(),T=Jr(R,y,_,k);v.push(...T)}C(v)},triggerNodeChanges:E=>{const{onNodesChange:S,setNodes:R,nodes:v,hasDefaultNodes:y,debug:C}=h();if(E?.length){if(y){const _=_d(E,v);R(_)}C&&console.log("React Flow: trigger node changes",E),S?.(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:S,setEdges:R,edges:v,hasDefaultEdges:y,debug:C}=h();if(E?.length){if(y){const _=kd(E,v);R(_)}C&&console.log("React Flow: trigger edge changes",E),S?.(E)}},addSelectedNodes:E=>{const{multiSelectionActive:S,edgeLookup:R,nodeLookup:v,triggerNodeChanges:y,triggerEdgeChanges:C}=h();if(S){const _=E.map(k=>Ct(k,!0));y(_);return}y(Yt(v,new Set([...E]),!0)),C(Yt(R))},addSelectedEdges:E=>{const{multiSelectionActive:S,edgeLookup:R,nodeLookup:v,triggerNodeChanges:y,triggerEdgeChanges:C}=h();if(S){const _=E.map(k=>Ct(k,!0));C(_);return}C(Yt(R,new Set([...E]))),y(Yt(v,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:S}={})=>{const{edges:R,nodes:v,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:_}=h(),k=E||v,T=S||R,O=k.map(F=>{const z=y.get(F.id);return z&&(z.selected=!1),Ct(F.id,!1)}),B=T.map(F=>Ct(F.id,!1));C(O),_(B)},setMinZoom:E=>{const{panZoom:S,maxZoom:R}=h();S?.setScaleExtent([E,R]),m({minZoom:E})},setMaxZoom:E=>{const{panZoom:S,minZoom:R}=h();S?.setScaleExtent([R,E]),m({maxZoom:E})},setTranslateExtent:E=>{h().panZoom?.setTranslateExtent(E),m({translateExtent:E})},setPaneClickDistance:E=>{h().panZoom?.setClickDistance(E)},resetSelectedElements:()=>{const{edges:E,nodes:S,triggerNodeChanges:R,triggerEdgeChanges:v,elementsSelectable:y}=h();if(!y)return;const C=S.reduce((k,T)=>T.selected?[...k,Ct(T.id,!1)]:k,[]),_=E.reduce((k,T)=>T.selected?[...k,Ct(T.id,!1)]:k,[]);R(C),v(_)},setNodeExtent:E=>{const{nodes:S,nodeLookup:R,parentLookup:v,nodeOrigin:y,elevateNodesOnSelect:C,nodeExtent:_}=h();E[0][0]===_[0][0]&&E[0][1]===_[0][1]&&E[1][0]===_[1][0]&&E[1][1]===_[1][1]||(Ko(S,R,v,{nodeOrigin:y,nodeExtent:E,elevateNodesOnSelect:C,checkEquality:!1}),m({nodeExtent:E}))},panBy:E=>{const{transform:S,width:R,height:v,panZoom:y,translateExtent:C}=h();return Jy({delta:E,panZoom:y,transform:S,translateExtent:C,width:R,height:v})},setCenter:async(E,S,R)=>{const{width:v,height:y,maxZoom:C,panZoom:_}=h();if(!_)return Promise.resolve(!1);const k=typeof R?.zoom<"u"?R.zoom:C;return await _.setViewport({x:v/2-E*k,y:y/2-S*k,zoom:k},{duration:R?.duration,ease:R?.ease,interpolate:R?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{...Yu}})},updateConnection:E=>{m({connection:E})},reset:()=>m({...Il()})}},Object.is);function Jd({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,initialMinZoom:l,initialMaxZoom:a,initialFitViewOptions:c,fitView:d,nodeOrigin:x,nodeExtent:p,children:m}){const[h]=j.useState(()=>hR({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:d,minZoom:l,maxZoom:a,fitViewOptions:c,nodeOrigin:x,nodeExtent:p}));return o.jsxRuntimeExports.jsx(DS,{value:h,children:o.jsxRuntimeExports.jsx(i4,{children:m})})}function gR({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:l,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:x,nodeOrigin:p,nodeExtent:m}){return j.useContext(Zs)?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):o.jsxRuntimeExports.jsx(Jd,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:l,fitView:a,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:x,nodeOrigin:p,nodeExtent:m,children:e})}const jR={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function ER({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:l,onNodeClick:a,onEdgeClick:c,onInit:d,onMove:x,onMoveStart:p,onMoveEnd:m,onConnect:h,onConnectStart:g,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:R,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:_,onNodeDoubleClick:k,onNodeDragStart:T,onNodeDrag:O,onNodeDragStop:B,onNodesDelete:F,onEdgesDelete:z,onDelete:N,onSelectionChange:$,onSelectionDragStart:w,onSelectionDrag:L,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:H,onSelectionEnd:V,onBeforeDelete:Z,connectionMode:K,connectionLineType:q=ft.Bezier,connectionLineStyle:ne,connectionLineComponent:J,connectionLineContainerStyle:oe,deleteKeyCode:se="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:ee=!1,selectionMode:ie=Jt.Full,panActivationKeyCode:ye="Space",multiSelectionKeyCode:Se=bs()?"Meta":"Control",zoomActivationKeyCode:ue=bs()?"Meta":"Control",snapToGrid:me,snapGrid:U,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:be,nodesDraggable:Te,autoPanOnNodeFocus:Je,nodesConnectable:Fn,nodesFocusable:Hn,nodeOrigin:Zn=bd,edgesFocusable:cn,edgesReconnectable:un,elementsSelectable:qs=!0,defaultViewport:Kn=XS,minZoom:Ft=.5,maxZoom:dn=2,translateExtent:li=_n,preventScrolling:Uf=!0,nodeExtent:Qs,defaultMarkerColor:Xf="#b1b1b7",zoomOnScroll:qf=!0,zoomOnPinch:Qf=!0,panOnScroll:Jf=!1,panOnScrollSpeed:eh=.5,panOnScrollMode:th=bt.Free,zoomOnDoubleClick:nh=!0,panOnDrag:sh=!0,onPaneClick:oh,onPaneMouseEnter:rh,onPaneMouseMove:ih,onPaneMouseLeave:lh,onPaneScroll:ah,onPaneContextMenu:ch,paneClickDistance:ai=0,nodeClickDistance:uh=0,children:dh,onReconnect:xh,onReconnectStart:ph,onReconnectEnd:mh,onEdgeContextMenu:fh,onEdgeDoubleClick:hh,onEdgeMouseEnter:gh,onEdgeMouseMove:jh,onEdgeMouseLeave:Eh,reconnectRadius:yh=10,onNodesChange:Sh,onEdgesChange:Rh,noDragClassName:Ch="nodrag",noWheelClassName:wh="nowheel",noPanClassName:ci="nopan",fitView:ui,fitViewOptions:di,connectOnClick:bh,attributionPosition:vh,proOptions:_h,defaultEdgeOptions:kh,elevateNodesOnSelect:Lh,elevateEdgesOnSelect:Mh,disableKeyboardA11y:xi=!1,autoPanOnConnect:Ph,autoPanOnNodeDrag:Nh,autoPanSpeed:Th,connectionRadius:Ih,isValidConnection:Ah,onError:Oh,style:Dh,id:pi,nodeDragThreshold:Bh,connectionDragThreshold:$h,viewport:zh,onViewportChange:Vh,width:Fh,height:Hh,colorMode:Zh="light",debug:Kh,onScroll:mi,ariaLabelConfig:Yh,...Wh},Gh){const Js=pi||"1",Uh=e4(Zh),Xh=j.useCallback(fi=>{fi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),mi?.(fi)},[mi]);return o.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...Wh,onScroll:Xh,style:{...Dh,...jR},ref:Gh,className:Le(["react-flow",r,Uh]),id:pi,role:"application",children:o.jsxRuntimeExports.jsxs(gR,{nodes:e,edges:t,width:Fh,height:Hh,fitView:ui,fitViewOptions:di,minZoom:Ft,maxZoom:dn,nodeOrigin:Zn,nodeExtent:Qs,children:[o.jsxRuntimeExports.jsx(fR,{onInit:d,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:_,onNodeDoubleClick:k,nodeTypes:i,edgeTypes:l,connectionLineType:q,connectionLineStyle:ne,connectionLineComponent:J,connectionLineContainerStyle:oe,selectionKeyCode:re,selectionOnDrag:ee,selectionMode:ie,deleteKeyCode:se,multiSelectionKeyCode:Se,panActivationKeyCode:ye,zoomActivationKeyCode:ue,onlyRenderVisibleElements:de,defaultViewport:Kn,translateExtent:li,minZoom:Ft,maxZoom:dn,preventScrolling:Uf,zoomOnScroll:qf,zoomOnPinch:Qf,zoomOnDoubleClick:nh,panOnScroll:Jf,panOnScrollSpeed:eh,panOnScrollMode:th,panOnDrag:sh,onPaneClick:oh,onPaneMouseEnter:rh,onPaneMouseMove:ih,onPaneMouseLeave:lh,onPaneScroll:ah,onPaneContextMenu:ch,paneClickDistance:ai,nodeClickDistance:uh,onSelectionContextMenu:D,onSelectionStart:H,onSelectionEnd:V,onReconnect:xh,onReconnectStart:ph,onReconnectEnd:mh,onEdgeContextMenu:fh,onEdgeDoubleClick:hh,onEdgeMouseEnter:gh,onEdgeMouseMove:jh,onEdgeMouseLeave:Eh,reconnectRadius:yh,defaultMarkerColor:Xf,noDragClassName:Ch,noWheelClassName:wh,noPanClassName:ci,rfId:Js,disableKeyboardA11y:xi,nodeExtent:Qs,viewport:zh,onViewportChange:Vh}),o.jsxRuntimeExports.jsx(JS,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:h,onConnectStart:g,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:R,nodesDraggable:Te,autoPanOnNodeFocus:Je,nodesConnectable:Fn,nodesFocusable:Hn,edgesFocusable:cn,edgesReconnectable:un,elementsSelectable:qs,elevateNodesOnSelect:Lh,elevateEdgesOnSelect:Mh,minZoom:Ft,maxZoom:dn,nodeExtent:Qs,onNodesChange:Sh,onEdgesChange:Rh,snapToGrid:me,snapGrid:U,connectionMode:K,translateExtent:li,connectOnClick:bh,defaultEdgeOptions:kh,fitView:ui,fitViewOptions:di,onNodesDelete:F,onEdgesDelete:z,onDelete:N,onNodeDragStart:T,onNodeDrag:O,onNodeDragStop:B,onSelectionDrag:L,onSelectionDragStart:w,onSelectionDragStop:M,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:ci,nodeOrigin:Zn,rfId:Js,autoPanOnConnect:Ph,autoPanOnNodeDrag:Nh,autoPanSpeed:Th,onError:Oh,connectionRadius:Ih,isValidConnection:Ah,selectNodesOnDrag:be,nodeDragThreshold:Bh,connectionDragThreshold:$h,onBeforeDelete:Z,paneClickDistance:ai,debug:Kh,ariaLabelConfig:Yh}),o.jsxRuntimeExports.jsx(US,{onSelectionChange:$}),dh,o.jsxRuntimeExports.jsx(ZS,{proOptions:_h,position:vh}),o.jsxRuntimeExports.jsx(HS,{rfId:Js,disableKeyboardA11y:xi})]})})}var yR=Ld(ER);function SR(){const e=ve();return j.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),r=Array.isArray(t)?t:[t],i=new Map;r.forEach(l=>{const a=n?.querySelector(`.react-flow__node[data-id="${l}"]`);a&&i.set(l,{id:l,nodeElement:a,force:!0})}),requestAnimationFrame(()=>s(i,{triggerFitView:!1}))},[])}function RR({onStart:e,onChange:t,onEnd:n}){const s=ve();j.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),j.useEffect(()=>{s.setState({onViewportChange:t})},[t]),j.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function CR({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Le(["react-flow__background-pattern",n,s])})}function wR({radius:e,className:t}){return o.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Le(["react-flow__background-pattern","dots",t])})}var gt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(gt||(gt={}));const bR={[gt.Dots]:1,[gt.Lines]:1,[gt.Cross]:6},vR=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ex({id:e,variant:t=gt.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:l,bgColor:a,style:c,className:d,patternClassName:x}){const p=j.useRef(null),{transform:m,patternId:h}=je(vR,_e),g=s||bR[t],E=t===gt.Dots,S=t===gt.Cross,R=Array.isArray(n)?n:[n,n],v=[R[0]*m[2]||1,R[1]*m[2]||1],y=g*m[2],C=Array.isArray(i)?i:[i,i],_=S?[y,y]:v,k=[C[0]*m[2]||1+_[0]/2,C[1]*m[2]||1+_[1]/2],T=`${h}${e||""}`;return o.jsxRuntimeExports.jsxs("svg",{className:Le(["react-flow__background",d]),style:{...c,...Ys,"--xy-background-color-props":a,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[o.jsxRuntimeExports.jsx("pattern",{id:T,x:m[0]%v[0],y:m[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:E?o.jsxRuntimeExports.jsx(wR,{radius:y/2,className:x}):o.jsxRuntimeExports.jsx(CR,{dimensions:_,lineWidth:r,variant:t,className:x})}),o.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}ex.displayName="Background";const _R=j.memo(ex);function kR(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function LR(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function MR(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.jsxRuntimeExports.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function PR(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function NR(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function ns({children:e,className:t,...n}){return o.jsxRuntimeExports.jsx("button",{type:"button",className:Le(["react-flow__controls-button",t]),...n,children:e})}const TR=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function tx({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:l,onFitView:a,onInteractiveChange:c,className:d,children:x,position:p="bottom-left",orientation:m="vertical","aria-label":h}){const g=ve(),{isInteractive:E,minZoomReached:S,maxZoomReached:R,ariaLabelConfig:v}=je(TR,_e),{zoomIn:y,zoomOut:C,fitView:_}=Bt(),k=()=>{y(),i?.()},T=()=>{C(),l?.()},O=()=>{_(r),a?.()},B=()=>{g.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),c?.(!E)},F=m==="horizontal"?"horizontal":"vertical";return o.jsxRuntimeExports.jsxs(Ks,{className:Le(["react-flow__controls",F,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":h??v["controls.ariaLabel"],children:[t&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(ns,{onClick:k,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:R,children:o.jsxRuntimeExports.jsx(kR,{})}),o.jsxRuntimeExports.jsx(ns,{onClick:T,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:S,children:o.jsxRuntimeExports.jsx(LR,{})})]}),n&&o.jsxRuntimeExports.jsx(ns,{className:"react-flow__controls-fitview",onClick:O,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:o.jsxRuntimeExports.jsx(MR,{})}),s&&o.jsxRuntimeExports.jsx(ns,{className:"react-flow__controls-interactive",onClick:B,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:E?o.jsxRuntimeExports.jsx(NR,{}):o.jsxRuntimeExports.jsx(PR,{})}),x]})}tx.displayName="Controls";j.memo(tx);function IR({id:e,x:t,y:n,width:s,height:r,style:i,color:l,strokeColor:a,strokeWidth:c,className:d,borderRadius:x,shapeRendering:p,selected:m,onClick:h}){const{background:g,backgroundColor:E}=i||{},S=l||g||E;return o.jsxRuntimeExports.jsx("rect",{className:Le(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:x,ry:x,width:s,height:r,style:{fill:S,stroke:a,strokeWidth:c},shapeRendering:p,onClick:h?R=>h(R,e):void 0})}const AR=j.memo(IR),OR=e=>e.nodes.map(t=>t.id),So=e=>e instanceof Function?e:()=>e;function DR({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=AR,onClick:l}){const a=je(OR,_e),c=So(t),d=So(e),x=So(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:a.map(m=>o.jsxRuntimeExports.jsx($R,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function BR({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:a,onClick:c}){const{node:d,x,y:p,width:m,height:h}=je(g=>{const{internals:E}=g.nodeLookup.get(e),S=E.userNode,{x:R,y:v}=E.positionAbsolute,{width:y,height:C}=ut(S);return{node:S,x:R,y:v,width:y,height:C}},_e);return!d||d.hidden||!Ju(d)?null:o.jsxRuntimeExports.jsx(a,{x,y:p,width:m,height:h,style:d.style,selected:!!d.selected,className:s(d),color:t(d),borderRadius:r,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:c,id:d.id})}const $R=j.memo(BR);var zR=j.memo(DR);const VR=200,FR=150,HR=e=>!e.hidden,ZR=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Qu(Bn(e.nodeLookup,{filter:HR}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},KR="react-flow__minimap-desc";function nx({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:a,bgColor:c,maskColor:d,maskStrokeColor:x,maskStrokeWidth:p,position:m="bottom-right",onClick:h,onNodeClick:g,pannable:E=!1,zoomable:S=!1,ariaLabel:R,inversePan:v,zoomStep:y=10,offsetScale:C=5}){const _=ve(),k=j.useRef(null),{boundingRect:T,viewBB:O,rfId:B,panZoom:F,translateExtent:z,flowWidth:N,flowHeight:$,ariaLabelConfig:w}=je(ZR,_e),L=e?.width??VR,M=e?.height??FR,D=T.width/L,H=T.height/M,V=Math.max(D,H),Z=V*L,K=V*M,q=C*V,ne=T.x-(Z-T.width)/2-q,J=T.y-(K-T.height)/2-q,oe=Z+q*2,se=K+q*2,re=`${KR}-${B}`,ee=j.useRef(0),ie=j.useRef();ee.current=V,j.useEffect(()=>{if(k.current&&F)return ie.current=lS({domNode:k.current,panZoom:F,getTransform:()=>_.getState().transform,getViewScale:()=>ee.current}),()=>{ie.current?.destroy()}},[F]),j.useEffect(()=>{ie.current?.update({translateExtent:z,width:N,height:$,inversePan:v,pannable:E,zoomStep:y,zoomable:S})},[E,S,v,y,z,N,$]);const ye=h?me=>{const[U,de]=ie.current?.pointer(me)||[0,0];h(me,{x:U,y:de})}:void 0,Se=g?j.useCallback((me,U)=>{const de=_.getState().nodeLookup.get(U).internals.userNode;g(me,de)},[]):void 0,ue=R??w["minimap.ariaLabel"];return o.jsxRuntimeExports.jsx(Ks,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof x=="string"?x:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*V:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Le(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxRuntimeExports.jsxs("svg",{width:L,height:M,viewBox:`${ne} ${J} ${oe} ${se}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":re,ref:k,onClick:ye,children:[ue&&o.jsxRuntimeExports.jsx("title",{id:re,children:ue}),o.jsxRuntimeExports.jsx(zR,{onClick:Se,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:a}),o.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${ne-q},${J-q}h${oe+q*2}v${se+q*2}h${-oe-q*2}z
|
|
39
|
+
M${O.x},${O.y}h${O.width}v${O.height}h${-O.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}nx.displayName="MiniMap";j.memo(nx);const YR=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,WR={[sn.Line]:"right",[sn.Handle]:"bottom-right"};function GR({nodeId:e,position:t,variant:n=sn.Handle,className:s,style:r=void 0,children:i,color:l,minWidth:a=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:m,autoScale:h=!0,shouldResize:g,onResizeStart:E,onResize:S,onResizeEnd:R}){const v=Td(),y=typeof e=="string"?e:v,C=ve(),_=j.useRef(null),k=n===sn.Handle,T=je(j.useCallback(YR(k&&h),[k,h]),_e),O=j.useRef(null),B=t??WR[n];j.useEffect(()=>{if(!(!_.current||!y))return O.current||(O.current=CS({domNode:_.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:z,transform:N,snapGrid:$,snapToGrid:w,nodeOrigin:L,domNode:M}=C.getState();return{nodeLookup:z,transform:N,snapGrid:$,snapToGrid:w,nodeOrigin:L,paneDomNode:M}},onChange:(z,N)=>{const{triggerNodeChanges:$,nodeLookup:w,parentLookup:L,nodeOrigin:M}=C.getState(),D=[],H={x:z.x,y:z.y},V=w.get(y);if(V&&V.expandParent&&V.parentId){const Z=V.origin??M,K=z.width??V.measured.width??0,q=z.height??V.measured.height??0,ne={id:V.id,parentId:V.parentId,rect:{width:K,height:q,...ed({x:z.x??V.position.x,y:z.y??V.position.y},{width:K,height:q},V.parentId,w,Z)}},J=Jr([ne],w,L,M);D.push(...J),H.x=z.x?Math.max(Z[0]*K,z.x):void 0,H.y=z.y?Math.max(Z[1]*q,z.y):void 0}if(H.x!==void 0&&H.y!==void 0){const Z={id:y,type:"position",position:{...H}};D.push(Z)}if(z.width!==void 0&&z.height!==void 0){const K={id:y,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};D.push(K)}for(const Z of N){const K={...Z,type:"position"};D.push(K)}$(D)},onEnd:({width:z,height:N})=>{const $={id:y,type:"dimensions",resizing:!1,dimensions:{width:z,height:N}};C.getState().triggerNodeChanges([$])}})),O.current.update({controlPosition:B,boundaries:{minWidth:a,minHeight:c,maxWidth:d,maxHeight:x},keepAspectRatio:p,resizeDirection:m,onResizeStart:E,onResize:S,onResizeEnd:R,shouldResize:g}),()=>{O.current?.destroy()}},[B,a,c,d,x,p,E,S,R,g]);const F=B.split("-");return o.jsxRuntimeExports.jsx("div",{className:Le(["react-flow__resize-control","nodrag",...F,n,s]),ref:_,style:{...r,scale:T,...l&&{[k?"backgroundColor":"borderColor"]:l}},children:i})}j.memo(GR);const UR=(e,t)=>e.map((n,s)=>u.K.translate(n,t[s])),sx=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:jt(e),style:{stroke:u.cr.cssString(t)},...n}),XR=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:jt(e),style:{stroke:u.cr.cssString(t),strokeDasharray:"12,4"},...n}),qR=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ue,{path:jt(e),style:{stroke:u.cr.cssString(t),strokeDasharray:"12,4,4"},...n}),QR=({points:e,color:t,...n})=>{const s=u.K.calculateMiters(e,6),r=e.map((c,d)=>u.K.translate(c,s[d])),i=e.map((c,d)=>u.K.translate(c,u.K.scale(s[d],-1))),l=u.cr.cssString(t),a=.7;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ue,{path:jt(r),style:{stroke:l,opacity:a},...n}),o.jsxRuntimeExports.jsx(Ue,{path:jt(e),style:{stroke:l},...n}),o.jsxRuntimeExports.jsx(Ue,{path:jt(i),style:{stroke:l,opacity:a},...n})]})},Al=5,JR=(e,t)=>{const n=[],s=[];for(let a=0;a<e.length-1;a++){const c=u.K.distance(e[a],e[a+1]);s.push(c)}const r=t;let i=0,l=r;for(let a=0;a<s.length;a++){const c=s[a],d=e[a],x=e[a+1];for(;i+c>=l;){const p=(l-i)/c,m={x:d.x+p*(x.x-d.x),y:d.y+p*(x.y-d.y)};let h="x";Math.abs(x.x-d.x)<1&&(h="y"),l+=r,!(u.K.distance(m,x)<Al||u.K.distance(m,d)<Al)&&n.push({position:m,direction:h})}i+=c}return n},eC=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cr.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},tC=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10";n==="x"?t.y+=10/3:t.x-=10/3;let i=u.K.translateX(t,-10),l=45;return n==="y"&&(i=u.K.translateY(t,-10),l+=90),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cr.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cr.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${i.x},${i.y}) rotate(${l})`,strokeLinecap:"round"})]})},nC=({color:e,position:t})=>o.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:u.cr.cssString(e),strokeWidth:2}),ti=e=>{const t=({points:n,color:s,...r})=>{const i=jt(n),l=JR(n,40);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ue,{path:i,...r,style:{stroke:u.cr.cssString(s)}}),l.map(({position:a,direction:c},d)=>o.jsxRuntimeExports.jsx(e,{position:a,direction:c,color:s},d))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},sC=ti(eC),oC=ti(tC),rC=ti(nC),jt=e=>{let t="";const s=e.length+-1;for(let r=0;r<s;r++){const i=e[r%e.length],l=e[(r+1)%e.length],a=Math.min(6/Math.hypot(l.x-i.x,l.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),r===s-1?t+=`L${l.x},${l.y}`:r<s-1&&(t+=`L${i.x*a+l.x*(1-a)},${i.y*a+l.y*(1-a)}`)}return t},ox={pipe:sx,electric:XR,secondary:qR,jacketed:QR,hydraulic:sC,pneumatic:oC,data:rC},rx=sx,iC=[{key:"pipe",name:"Pipe"},{key:"electric",name:"Electric Signal"},{key:"secondary",name:"Secondary"},{key:"jacketed",name:"Jacketed"},{key:"hydraulic",name:"Hydraulic"},{key:"pneumatic",name:"Pneumatic"},{key:"data",name:"Data"}],lC=e=>o.jsxRuntimeExports.jsx(Nn,{data:iC,...e,resourceName:"Path Type"}),Ws=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 n=Ws(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return u.Ho.construct(s.position,u._.scale(u.Ho.dims(u.Ho.construct(n)),1/e.getZoom()))},aC=(e,t)=>Gs.fromFlow(e,t);class ix{node_=null;position;orientation;constructor(t,n){this.position=t,this.orientation=n}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 u.K.translate(u.Ho.topLeft(this.node.box),this.position)}}class Gs{key;box;handles;constructor(t,n,s){this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Oe(n,t),r=Ws(t),i=r.getElementsByClassName("react-flow__handle"),l=u.Ho.construct(r),a=Array.from(i).map(c=>{const d=u.Ho.center(u.Ho.construct(c)),x=u.K.translation(u.Ho.topLeft(l),d),p=c.className.match(/react-flow__handle-(\w+)/);if(p==null)throw new Error("[schematic] - cannot find handle orientation");const m=u.K$1.construct(p[0]);return new ix(x,m)});return new Gs(t,s,a)}}const cC=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:r,toPosition:i,fromNode:l,connectionLineStyle:a,connectionStatus:c})=>{const x=document.querySelector(".react-flow__handle-connecting")?.className.match(/react-flow__handle-(\w+)/);if(x!=null){const g=u.K$1.outer.safeParse(x[1]);g.success&&(i=g.data)}const p=Bt(),m=Zt({sourcePos:u.K.construct(e,t),targetPos:u.K.construct(n,s),sourceOrientation:r,targetOrientation:i,sourceBox:Oe(p,l?.id??""),targetBox:Oe(p,l?.id??"")}),h=xu(u.K.construct(e,t),m,p.getZoom(),!1);return o.jsxRuntimeExports.jsx(rx,{points:h,style:{...a,stroke:u.cr.cssString(c==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l11)"),strokeWidth:2,fill:"none"}})},uC=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:r,targetPosition:i,style:l,segments:a=[],onSegmentsChange:c,color:d="var(--pluto-gray-l11)",selected:x=!1,variant:p="pipe",...m})=>{const h=u.K.construct(m.sourceX,m.sourceY),g=j.useRef(h),E=u.K.equals(h,g.current),S=u.K.construct(m.targetX,m.targetY),R=j.useRef(S),v=u.K.equals(S,R.current),y=Bt(),[C,_,k]=f.useCombinedStateAndRef(()=>a.length>0?a:Zt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),T=j.useRef(i),O=j.useRef(s),B=Ne.useDebouncedCallback(c,100,[c]);if(!E||!v){let w=C;const L=u.K.translation(g.current,h),M=u.K.translation(S,R.current);u.K.equals(L,u.K.scale(M,-1),.001)?(g.current=h,R.current=S):(E?v||(w=E3({delta:M,segments:w}),T.current!==i&&(T.current=i,w=Zt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),Ni({sourcePos:h,targetPos:S,next:w,prev:C})||(w=Zt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),R.current=S):(w=j3({delta:L,segments:w}),O.current!==s&&(O.current=s,w=Zt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),Ni({sourcePos:h,targetPos:S,next:w,prev:C})||(w=Zt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Oe(y,t),targetBox:Oe(y,n)})),g.current=h),B(w),_(w))}const F=j.useRef(null),z=Ne.useCursorDrag({onStart:j.useCallback((w,L,M)=>{F.current={index:Number(M.currentTarget.id.split("-")[1]),segments:[...k.current]}},[]),onMove:j.useCallback(w=>{if(F.current==null)return;const L=m3({segments:F.current.segments,index:F.current.index,magnitude:u.Ho.dim(w,u.g.swap(F.current.segments[F.current.index].direction),!0)/y.getZoom()});_(L)},[]),onEnd:j.useCallback(()=>c(k.current),[c])}),N=xu(h,C,y.getZoom(),!0),$=ox[p];return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx($,{points:N,color:d}),x&&dC(N).map((w,L)=>{const M=C[L].direction,D=u.g.swap(M),H={[u.g.dimension(M)]:"18px",[u.g.dimension(D)]:"4px"},V={[M]:w[M]-9,[D]:w[D]-2};return o.jsxRuntimeExports.jsxs(j.Fragment,{children:[o.jsxRuntimeExports.jsx("rect",{className:u.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...H,...V,rx:"2px",ry:"2px"}),o.jsxRuntimeExports.jsx("foreignObject",{x:w.x-9,y:w.y-9,width:"18px",height:"18px",children:o.jsxRuntimeExports.jsx("div",{id:`handle-${L}`,className:u.CSS(u.CSS.BE("diagram-edge-handle","dragger"),u.CSS.dir(M)),draggable:!0,onDragStart:z})})]},L)})]})},dC=e=>e.slice(1).map((t,n)=>{const s=e[n];return u.K.construct((t.x+s.x)/2,(t.y+s.y)/2)}),xC=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:u.K.ZERO,zoom:1}})=>{const[r,i]=j.useState(n),[l,a]=j.useState("select"),[c,d]=j.useState(e),[x,p]=j.useState(t),[m,h]=j.useState(s),[g,E]=j.useState(!1);return{viewport:m,onViewportChange:h,edges:x,nodes:c,onNodesChange:d,onEdgesChange:p,editable:r,onEditableChange:i,fitViewOnResize:g,setFitViewOnResize:E,viewportMode:l,onViewportModeChange:a}},pC=()=>!0,mC={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},fC={connectionRadius:0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnDoubleClick:!1,zoomOnPinch:!1,edgesFocusable:!1,edgesReconnectable:!1,nodesFocusable:!1,reconnectRadius:0},Go={maxZoom:1,minZoom:.5,padding:.05},hC={hideAttribution:!0},lx=j.createContext({editable:!0,visible:!0,viewportMode:"select",onViewportModeChange:()=>{},onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),ln=()=>j.use(lx),ax=j.memo(({children:e})=>{const{registerNodeRenderer:t}=ln();return j.useEffect(()=>t(e),[t,e]),null});ax.displayName="NodeRenderer";const gC=["Backspace","Delete"],jC={panOnDrag:[f.MOUSE_LEFT_NUMBER,f.MOUSE_MIDDLE_NUMBER]},EC={selectionOnDrag:!0,panOnDrag:[f.MOUSE_MIDDLE_NUMBER]},yC=e=>e==="pan"?jC:EC,SC=({aetherKey:e,onNodesChange:t,onEdgesChange:n,nodes:s,edges:r,onEditableChange:i,editable:l,viewport:a,triggers:c,onViewportChange:d,fitViewOnResize:x,setFitViewOnResize:p,visible:m,dragHandleSelector:h,viewportMode:g,onViewportModeChange:E,...S})=>{const R=f.useMemoDeepEqual({visible:m}),[{path:v},,y]=f.use$2({aetherKey:e,type:I.Diagram$1.TYPE,schema:I.diagramStateZ,initialState:{position:a.position,region:u.Ho.ZERO,zoom:a.zoom,...R}}),{fitView:C}=Bt(),_=Ne.useDebouncedCallback(U=>void C(U),50,[C]),k=Tn(j.useCallback(U=>{x&&_(Go),y(de=>({...de,region:U}))},[y,_,x]));j.useEffect(()=>y(U=>({...U,...R})),[R]);const T=u.cr.hex(f.use().colors.gray.l11),O=f.useMemoCompare(()=>c??xr.zoom,f.compareModeConfigs,[c]),B=j.useRef(null),F=j.useCallback(U=>{const de=B.current;de!=null&&de.x===U.x&&de.y===U.y&&de.zoom===U.zoom||(B.current=U,!(isNaN(U.x)||isNaN(U.y)||isNaN(U.zoom))&&(y(be=>({...be,position:U,zoom:U.zoom})),d(ju(U))))},[y,d]);RR({onStart:F,onChange:F,onEnd:F});const[z,N]=j.useState(()=>()=>null),$=j.useCallback(U=>N(()=>U),[]),w=j.useMemo(()=>({custom:({id:U,positionAbsoluteX:de,positionAbsoluteY:be,selected:Te=!1,draggable:Je=!0})=>z({symbolKey:U,position:{x:de,y:be},selected:Te,draggable:Je})}),[z]),L=j.useRef(r),M=j.useMemo(()=>(L.current=r,zr(r)),[r]),D=j.useRef(s),H=j.useMemo(()=>(D.current=s,$r(s,h)),[s,h]),V=j.useCallback(U=>t(Eu(D.current,de=>_d(U,de)),U),[t]),Z=j.useCallback(U=>n(rs(L.current,de=>kd(U,de),T)),[n,T]),K=j.useCallback((U,de)=>n(rs(L.current,be=>Fy(U,de,be),T)),[]),q=j.useCallback(U=>n(rs(L.current,de=>ad(U,de),T)),[n,T]),ne=j.useCallback((U,de)=>{const be=[...L.current],Te=be.findIndex(Je=>Je.key===U);Te!==-1&&(be[Te]={...be[Te],segments:de},L.current=be,n(be))},[n]),J=l?mC:fC,oe=f.useSyncedRef(ne),se=j.useMemo(()=>({default:U=>o.jsxRuntimeExports.jsx(uC,{...U,segments:U.data?.segments??[],color:U.data?.color,variant:U.data?.variant,onSegmentsChange:j.useCallback(de=>oe.current(U.id,de),[U.id])},U.id)}),[]),re=j.useRef(null);f.use$1({triggers:O.zoomReset,callback:j.useCallback(({stage:U,cursor:de})=>{const be=re.current;be==null||U!=="start"||!u.Ho.contains(be,de)||C()},[C])});const ee=f.purgeMouse(O.select)[0]??null,ie=f.purgeMouse(O.pan)[0]??null,ye=f.purgeMouse(O.zoom)[0]??null,Se={selectionOnDrag:ee==null,panOnDrag:ie==null,selectionKeyCode:ee,panActivationKeyCode:ie,zoomActivationKeyCode:ye},ue=f.useCombinedRefs(re,k),me=j.useMemo(()=>({visible:m,editable:l,onEditableChange:i,registerNodeRenderer:$,fitViewOnResize:x,setFitViewOnResize:p,viewportMode:g,onViewportModeChange:E}),[l,m,i,$,x,g,E]);return o.jsxRuntimeExports.jsx(lx,{value:me,children:o.jsxRuntimeExports.jsx(f.Composite,{path:v,children:m&&o.jsxRuntimeExports.jsx(yR,{...Se,className:u.CSS(u.CSS.B("diagram"),u.CSS.editable(l),u.CSS.BE("symbol","container")),nodes:H,edges:M,nodeTypes:w,edgeTypes:se,ref:ue,fitView:!0,onNodesChange:V,onEdgesChange:Z,onConnect:q,onReconnect:K,defaultViewport:gu(a),connectionLineComponent:cC,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:pC,connectionMode:Nt.Loose,fitViewOptions:Go,selectionMode:Jt.Partial,proOptions:hC,deleteKeyCode:gC,...S,style:{[u.CSS.var("diagram-zoom")]:a.zoom,...S.style},...J,...yC(g),nodesDraggable:l})})})},RC=()=>{const{editable:e}=ln();return e?o.jsxRuntimeExports.jsx(_R,{}):null},CC=e=>o.jsxRuntimeExports.jsx(f.Box,{x:!0,className:u.CSS.BE("diagram","controls"),...e}),Uo=u.K$1.BOTTOM_LEFT,wC=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=ln();return o.jsxRuntimeExports.jsx(Zl.Toggle,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:Uo,size:"small",tooltip:`${n?"Disable":"Enable"} editing`,...t,children:n?o.jsxRuntimeExports.jsx(f.EditOff,{}):o.jsxRuntimeExports.jsx(f.Edit,{})})},bC=({onClick:e,...t})=>{const{fitView:n}=Bt(),{fitViewOnResize:s,setFitViewOnResize:r}=ln();return o.jsxRuntimeExports.jsx(Zl.Toggle,{onClick:i=>{n(Go),e?.(i)},value:s,onChange:r,rightClickToggle:!0,tooltip:o.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:u.K$1.BOTTOM_LEFT,size:"small",...t,children:o.jsxRuntimeExports.jsx(f.Expand,{})})},cx=["zoom","pan","select"],vC=[["MouseMiddle"]],_C=[["MouseLeft"]],kC=()=>{const{viewportMode:e,onViewportModeChange:t}=ln();return o.jsxRuntimeExports.jsxs(pe.Buttons,{keys:cx,value:e,onChange:t,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pan",size:"small",tooltip:o.jsxRuntimeExports.jsx(Wt,{mode:"pan",triggers:vC}),tooltipLocation:Uo,children:o.jsxRuntimeExports.jsx(f.Pan,{})}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"select",size:"small",tooltip:o.jsxRuntimeExports.jsx(Wt,{mode:"select",triggers:_C}),tooltipLocation:Uo,children:o.jsxRuntimeExports.jsx(f.Selection,{})})]})},LC=e=>o.jsxRuntimeExports.jsx(Jd,{children:o.jsxRuntimeExports.jsx(SC,{...e})}),MC=Object.freeze(Object.defineProperty({__proto__:null,Background:RC,Controls:CC,DefaultPath:rx,Diagram:LC,FitViewControl:bC,HandleLayout:ix,NodeLayout:Gs,NodeRenderer:ax,PATHS:ox,SelectPathType:lC,SelectViewportModeControl:kC,ToggleEditControl:wC,VIEWPORT_MODES:cx,alignNodes:C3,calcPath:jt,edgeConverter:rs,edgeZ:S3,nodeConverter:Eu,nodeZ:R3,offsetPath:UR,rfEdgeDataZ:mu,selectNode:Ws,selectNodeBox:Oe,selectNodeLayout:aC,translateEdgesBackward:hu,translateEdgesForward:zr,translateNodesBackward:fu,translateNodesForward:$r,translateViewportBackward:ju,translateViewportForward:gu,use:xC,useContext:ln,viewportZ:y3},Symbol.toStringTag,{value:"Module"})),PC=({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=o.jsxRuntimeExports.jsx(f.Summary,{center:!0,level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:l,...a})=>{const c=f.useMemoDeepEqual({font:t,color:i,telem:l,visible:s}),[,{scrolling:d,empty:x},p]=f.use$2({type:I.Log.TYPE,schema:I.logState,initialState:{empty:!0,region:u.Ho.ZERO,scrolling:!1,wheelPos:0,...c}});j.useEffect(()=>{p(h=>({...h,...c}))},[c,p]);const m=Tn(j.useCallback(h=>p(g=>({...g,region:h})),[p]));return o.jsxRuntimeExports.jsx("div",{ref:m,className:u.CSS(u.CSS.B("log"),n),onWheel:h=>{p(g=>({...g,wheelPos:g.wheelPos-h.deltaY,scrolling:g.scrolling?g.scrolling:h.deltaY<0}))},...a,children:x?r:o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.BE("log","live"),d&&u.CSS.M("active")),variant:"outlined",onClick:()=>p(h=>({...h,scrolling:!h.scrolling})),tooltip:d?"Resume Scrolling":"Pause Scrolling",tooltipLocation:u.K$1.BOTTOM_LEFT,children:o.jsxRuntimeExports.jsx(f.Dynamic,{})})})},NC=Object.freeze(Object.defineProperty({__proto__:null,Log:PC},Symbol.toStringTag,{value:"Module"})),TC="Schematic.Grid",Us=u.CSS.B("drag-handle"),IC=e=>{const n=Ws(e).closest(".react-flow__pane");n!=null&&f.triggerReflow(n)},zn=e=>{const t=({symbolKey:s,items:r,onLocationChange:i})=>{const l=`${s}.${TC}`,[a,c]=j.useState(!1),d=j.useMemo(()=>f.canDropOfType(l),[l]),x=f.useSyncedRef(i),{startDrag:p,onDragEnd:m,...h}=f.useDragAndDrop({type:l,canDrop:d,onDrop:j.useCallback(({items:R})=>(c(!1),R),[]),onDragOver:j.useCallback(R=>{const{items:v}=R;c(d(R)),v.forEach(({key:y})=>x.current(y,e))},[])}),g=r.filter(R=>R.location===e),E=j.useCallback((R,v)=>{p([{key:v,type:l}]),document.addEventListener("mousemove",m,{once:!0})},[p,l,m]),S=d(f.useDraggingState());return o.jsxRuntimeExports.jsx(f.Box,{direction:u.K$1.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e),u.CSS.dropRegion(S),a&&u.CSS.B("dragging-over"),S&&u.CSS.B("dragging")),onDragLeave:()=>c(!1),empty:!0,...h,children:g.map(({element:R,key:v})=>o.jsxRuntimeExports.jsx(j.Fragment,{children:j.cloneElement(R,{draggable:!0,onDragStart:y=>E(y,v),onDragEnd:m,style:{...R.props.style,cursor:"grab"}})},v))})};return({symbolKey:s,...r})=>{const{editable:i,items:l}=r;if(i)return o.jsxRuntimeExports.jsx(t,{symbolKey:s,...r});const a=l.filter(c=>c.location===e);return a.length===0?null:o.jsxRuntimeExports.jsx(f.Box,{direction:u.K$1.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e)),empty:!0,children:a.map(({element:c,key:d})=>o.jsxRuntimeExports.jsx(j.Fragment,{children:c},d))})}},AC=zn("top"),OC=zn("left"),DC=zn("right"),BC=zn("bottom"),$C=zn("center"),$t=({editable:e,allowRotate:t=!0,children:n,allowCenter:s,onRotate:r,symbolKey:i,...l})=>{const a=j.useRef(e);return e!==a.current&&(IC(i),a.current=e),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(AC,{editable:e,symbolKey:i,...l},`top-${i}`),o.jsxRuntimeExports.jsx(OC,{editable:e,symbolKey:i,...l},`left-${i}`),o.jsxRuntimeExports.jsx(DC,{editable:e,symbolKey:i,...l},`right-${i}`),o.jsxRuntimeExports.jsx(BC,{editable:e,symbolKey:i,...l},`bottom-${i}`),s&&o.jsxRuntimeExports.jsx($C,{editable:e,symbolKey:i,...l},`center-${i}`),e&&t&&o.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.BE("grid","rotate"),size:"tiny",variant:"filled",onClick:r,children:o.jsxRuntimeExports.jsx(f.Rotate,{})}),o.jsxRuntimeExports.jsx("div",{className:Us,children:n})]})},zC=I.MODES,VC=({aetherKey:e,sink:t,mode:n})=>{const s=f.useMemoDeepEqual({sink:t,mode:n}),r=j.useRef({trigger:0,...s}),{setState:i}=f.useLifecycle({aetherKey:e,type:I.Button.TYPE,schema:I.buttonStateZ,initialState:r.current});j.useEffect(()=>{r.current={...r.current,...s},i(r.current)},[s,i,e]);const l=j.useCallback(()=>{r.current.trigger+=I.MOUSE_UP_INCREMENT,i(r.current)},[i]),a=j.useCallback(()=>{r.current.trigger+=I.MOUSE_DOWN_INCREMENT,i(r.current)},[i]);return{onClick:l,onMouseDown:a,onMouseUp:l}},FC=e=>o.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:zC,children:[o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"fire",tooltip:"Output true when clicked",children:"Fire"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"momentary",tooltip:"Output true on press, false on release",children:"Momentary"}),o.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pulse",tooltip:"Output true and then immediately output false on click",children:"Pulse"})]}),HC=({value:e,hideOuter:t=!1,showOuterCenter:n=!1,hideInner:s,onChange:r})=>{const{outer:i}=e,l=c=>()=>r({...e,...c}),a=u.CSS.B("select","orientation");return t?o.jsxRuntimeExports.jsx(Ol,{className:a,value:e,onChange:r}):o.jsxRuntimeExports.jsxs(f.Box,{className:a,align:"center",justify:"center",gap:"tiny",children:[o.jsxRuntimeExports.jsx(rt,{selected:i==="top",onClick:l({outer:"top"})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",gap:"tiny",children:[o.jsxRuntimeExports.jsx(rt,{selected:i==="left",onClick:l({outer:"left"})}),o.jsxRuntimeExports.jsx(Ol,{hideInner:s,value:e,onChange:r,showOuterCenter:n}),o.jsxRuntimeExports.jsx(rt,{selected:i==="right",onClick:l({outer:"right"})})]}),o.jsxRuntimeExports.jsx(rt,{selected:i==="bottom",onClick:l({outer:"bottom"})})]})},Ol=({value:e,onChange:t,className:n,hideInner:s=!1,showOuterCenter:r=!1,...i})=>{const{inner:l}=e,a=x=>()=>t({...e,...x});let c={};s&&(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"});let d=null;return r?d=o.jsxRuntimeExports.jsx(rt,{selected:e.outer==="center",onClick:a({outer:"center"})}):d=o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="top",onClick:a({inner:"top"})}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",children:[o.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,selected:l==="left",onClick:a({inner:"left"})}),o.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,selected:l==="right",onClick:a({inner:"right"})})]}),o.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="bottom",onClick:a({inner:"bottom"})})]}),o.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(n,u.CSS.B("value"),r&&u.CSS.M("show-outer-center")),y:!0,align:"center",justify:"center",empty:!0,...i,children:d})},rt=({selected:e,className:t,...n})=>o.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(t,u.CSS.selected(e)),size:"tiny",...n,children:o.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Pe=({className:e,direction:t,...n})=>o.jsxRuntimeExports.jsx(f.Box,{direction:t,align:"stretch",className:u.CSS(u.CSS.B("symbol-form"),e),gap:t==="x"?"large":"medium",...n}),yt=({hideOuter:e,hideInner:t,showOuterCenter:n,...s})=>t&&e?null:o.jsxRuntimeExports.jsx(Ee,{label:"Orientation",padHelpText:!1,...s,children:({value:r,onChange:i})=>o.jsxRuntimeExports.jsx(HC,{value:{inner:r.orientation??"top",outer:r.label?.orientation??"top"},hideInner:t,hideOuter:e,showOuterCenter:n,onChange:l=>i({...r,orientation:l.inner,label:{...r.label,orientation:l.outer}})})}),dt=({path:e,omit:t=[]})=>o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ee,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Text$2,{selectOnFocus:!0,...n})}),o.jsxRuntimeExports.jsx($e,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px",dragScale:{x:1,y:.5}},padHelpText:!1}),o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(on,{value:n,onChange:s})}),o.jsxRuntimeExports.jsx(Ee,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:n,onChange:s})}),o.jsxRuntimeExports.jsx(Ee,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>o.jsxRuntimeExports.jsx(tc,{value:n,onChange:s,yDirection:"down"})})]}),Be=e=>o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(Ne.Swatch,{value:t??u.cr.setAlpha(u.cr.ZERO,1),onChange:n,...r,bordered:!0})}),ux=e=>o.jsxRuntimeExports.jsx(Ee,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:{x:.75,y:.5},bounds:{lower:50,upper:1e3},endContent:"%",value:Math.round(t*100),onChange:s=>n(parseFloat((s/100).toFixed(2)))})}),xe=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",empty:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{omit:e,path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color",optional:!0}),o.jsxRuntimeExports.jsx(Ee,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:s=>o.jsxRuntimeExports.jsx(f.Switch$1,{...s})}),o.jsxRuntimeExports.jsx(ux,{path:"scale"})]})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideInner:t,hideOuter:n})]}),ZC=({path:e})=>{const{value:t,onChange:n}=Et(e),s=I.sourcePipelinePropsZ.parse(t.source?.props),r=I.sinkPipelinePropsZ.parse(t.sink?.props),i=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=I.setChannelValuePropsZ.parse(r.segments.setter.props),a=d=>{d??=0;const x=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:d}),threshold:I.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:x})},c=d=>{d??=0;const x=I.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:I.setChannelValue({channel:d}),setpoint:I.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),p=I.authoritySource({channel:d}),m=I.acquireChannelControl({channel:d,authority:255});n({...t,sink:x,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:m,source:p},indicator:{statusSource:p}}})};return o.jsxRuntimeExports.jsxs(Pe,{x:!0,grow:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ie.Item,{label:"State Channel",grow:!0,children:o.jsxRuntimeExports.jsx(kt,{value:i.channel,onChange:a})}),o.jsxRuntimeExports.jsx(Ie.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(kt,{value:l.channel,onChange:c})}),o.jsxRuntimeExports.jsx(Ns,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},ni=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],Re=({hideInnerOrientation:e})=>{const t=j.useCallback(({tabKey:s})=>{switch(s){case"control":return o.jsxRuntimeExports.jsx(ZC,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{hideInnerOrientation:e})}},[e]),n=Me.useStatic({tabs:ni,content:t});return o.jsxRuntimeExports.jsx(Me.Tabs,{...n})},mt={y:2,x:.25},Sn={lower:0,upper:2e3},Dl={lower:0,upper:51},dx=({includeBorderRadius:e=!1,includeStrokeWidth:t=!1})=>o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Be,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(Ee,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Dl,endContent:"%",...n})}),o.jsxRuntimeExports.jsx(Ee,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Dl,endContent:"%",...n})}),e&&o.jsxRuntimeExports.jsx(Ee,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Sn,endContent:"px",...n})}),t&&o.jsxRuntimeExports.jsx(Ee,{path:"strokeWidth",hideIfNull:!0,optional:!0,label:"Border Width",grow:!0,children:n=>o.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:{lower:0,upper:21},endContent:"px",...n})}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.width",label:"Width",grow:!0,children:({value:n,...s})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:mt,bounds:Sn,endContent:"px",...s})}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.height",label:"Height",grow:!0,children:({value:n,...s})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:mt,bounds:Sn,endContent:"px",...s})})]})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideInner:!0,showOuterCenter:!0,label:"Label Location"})]}),KC=()=>o.jsxRuntimeExports.jsx(Pe,{direction:"x",align:"stretch",children:o.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Be,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx($e,{path:"rotation",label:"Rotation",inputProps:{dragScale:{x:1,y:.25},bounds:{lower:0,upper:360},endContent:"°"},grow:!0}),o.jsxRuntimeExports.jsx($e,{path:"numSides",label:"Number of Sides",inputProps:{dragScale:{x:.5,y:.1},bounds:{lower:3,upper:21}},grow:!0}),o.jsxRuntimeExports.jsx($e,{path:"sideLength",label:"Side Length",inputProps:{dragScale:{x:1,y:1},bounds:{lower:10,upper:500},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx($e,{path:"cornerRounding",label:"Corner Rounding",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:181},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx($e,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),YC=()=>o.jsxRuntimeExports.jsx(Pe,{direction:"x",align:"stretch",children:o.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Be,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx($e,{path:"radius",label:"Radius",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:500},endContent:"px"},grow:!0}),o.jsxRuntimeExports.jsx($e,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),xx=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],WC={dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"},GC=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsxs(Pe,{y:!0,empty:!0,children:[o.jsxRuntimeExports.jsx(Or,{path:""}),";"]});case"redline":return o.jsxRuntimeExports.jsx(Pe,{y:!0,empty:!0,children:o.jsxRuntimeExports.jsx(Ar,{path:"redline"})});default:return o.jsxRuntimeExports.jsxs(Pe,{x:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Ee,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(f.Text$2,{...s})}),o.jsxRuntimeExports.jsx($e,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:WC}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:r})=>o.jsxRuntimeExports.jsx(on,{value:s,onChange:r})})]})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideInner:!0})]})}},[]),t=Me.useStatic({tabs:xx,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},UC=({path:e})=>{const{value:t,onChange:n}=Et(e),s=I.sourcePipelinePropsZ.parse(t.source?.props),r=I.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=I.withinBoundsProps.parse(s.segments.threshold.props),l=c=>{c??=0;const d=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:c}),threshold:I.withinBounds({trueBound:{lower:i.trueBound.lower??.9,upper:i.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:d})},a=c=>{const d=I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:r.channel}),threshold:I.withinBounds({trueBound:c})},outlet:"threshold"});n({...t,source:d})};return o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ie.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(kt,{value:r.channel,onChange:l})}),o.jsxRuntimeExports.jsx(Ie.Item,{label:"Lower Threshold",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.lower??.9,onChange:c=>a({...i.trueBound,lower:c})})}),o.jsxRuntimeExports.jsx(Ie.Item,{label:"Upper Threshold",children:o.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.upper??1.1,onChange:c=>a({...i.trueBound,upper:c})})})]})},XC=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsx(UC,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{})}},[]),t=Me.useStatic({tabs:xx,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},qC=({path:e})=>{const{value:t,onChange:n}=Et(e),s=I.sinkPipelinePropsZ.parse(t.sink?.props),r=I.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=I.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:I.setChannelValue({channel:l}),setpoint:I.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),c=I.authoritySource({channel:l}),d=I.acquireChannelControl({channel:l,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:c},showIndicator:!0,indicator:{statusSource:c}}})};return o.jsxRuntimeExports.jsxs(Pe,{y:!0,empty:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Ie.Item,{label:"Output Channel",grow:!0,padHelpText:!1,children:o.jsxRuntimeExports.jsx(kt,{value:r.channel,onChange:i})}),o.jsxRuntimeExports.jsx($e,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0,padHelpText:!1}),o.jsxRuntimeExports.jsx(Ns,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0,padHelpText:!1})]}),o.jsxRuntimeExports.jsx(Ee,{path:"mode",label:"Mode",optional:!0,children:({value:l,onChange:a})=>o.jsxRuntimeExports.jsx(FC,{value:l,onChange:a})})]})},QC=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(qC,{path:""});default:return o.jsxRuntimeExports.jsx(xe,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=Me.useStatic({tabs:ni,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},JC=({path:e})=>{const{value:t,onChange:n}=Et(e),s=I.sinkPipelinePropsZ.parse(t.sink?.props),r=I.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=I.sinkPipeline("number",{connections:[],segments:{setter:I.setChannelValue({channel:l})},inlet:"setter"}),c=I.authoritySource({channel:l}),d=I.acquireChannelControl({channel:l,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:d,source:c},showIndicator:!0,indicator:{statusSource:c}},disabled:l==0})};return o.jsxRuntimeExports.jsx(Pe,{x:!0,grow:!0,align:"stretch",children:o.jsxRuntimeExports.jsx(Ie.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(kt,{value:r.channel,onChange:i})})})},e6=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(JC,{path:""});default:return o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"stretch",grow:!0,gap:"small",children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(gr,{path:"units",label:"Units",align:"start",padHelpText:!1}),o.jsxRuntimeExports.jsx(Ee,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:r})=>o.jsxRuntimeExports.jsx(oa,{value:s,onChange:r})}),o.jsxRuntimeExports.jsx(Be,{path:"color"})]})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideInner:!0})]})}},[]),t=Me.useStatic({tabs:ni,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},t6=()=>{const e=Et("autoFit",{optional:!0});return o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ee,{path:"value",label:"Text",padHelpText:!1,grow:!0,children:t=>o.jsxRuntimeExports.jsx(f.Text$2,{...t})}),o.jsxRuntimeExports.jsx(Ee,{path:"level",label:"Text Size",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(on,{value:t,onChange:n})}),o.jsxRuntimeExports.jsx(Ee,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:t,onChange:n})})]}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Ee,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(f.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:o.jsxRuntimeExports.jsx(f.Button,{onClick:()=>e?.onChange(!0),disabled:e?.value===!0,variant:"outlined",tooltip:e?.value===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:o.jsxRuntimeExports.jsx(f.AutoFitWidth,{})})})})]})]}),o.jsxRuntimeExports.jsx(yt,{path:""})]})},n6=()=>o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label",omit:["maxInlineSize","align","direction"]}),o.jsxRuntimeExports.jsx(Be,{path:"color"})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideOuter:!0})]}),s6=()=>o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(Be,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:mt,bounds:Sn,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(Ee,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:mt,bounds:Sn,endContent:"px",...t})})]})]}),o.jsxRuntimeExports.jsx(yt,{path:"",hideInner:!0})]}),zt=()=>o.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[o.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(dt,{path:"label"}),o.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[o.jsxRuntimeExports.jsx(Be,{path:"color"}),o.jsxRuntimeExports.jsx(ux,{path:"scale"}),o.jsxRuntimeExports.jsx(Ns,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),o.jsxRuntimeExports.jsx(yt,{path:""})]}),o6=()=>o.jsxRuntimeExports.jsx(dx,{includeBorderRadius:!0,includeStrokeWidth:!0}),r6=()=>o.jsxRuntimeExports.jsx(Re,{hideInnerOrientation:!0}),P=e=>o.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),ge=e=>o.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),ke=e=>o.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),fe=e=>o.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),i6={left:{left:Q.Left,right:Q.Right,top:Q.Top,bottom:Q.Bottom},right:{left:Q.Right,right:Q.Left,top:Q.Bottom,bottom:Q.Top},top:{left:Q.Bottom,right:Q.Top,top:Q.Left,bottom:Q.Right},bottom:{left:Q.Top,right:Q.Bottom,top:Q.Right,bottom:Q.Left}},l6=(e,t)=>i6[t][e],a6=(e,t=!1)=>{if(t)return e;switch(e){case Q.Left:return Q.Right;case Q.Right:return Q.Left;case Q.Top:return Q.Bottom;case Q.Bottom:return Q.Top;default:return Q.Top}},c6=(e,t,n,s=!1)=>s?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},W=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=SR()}catch{return null}const r=j.useRef(null),i=j.useRef(!0);return j.useEffect(()=>{if(r.current==null)return;if(i.current){i.current=!1;return}const a=r.current.closest(".react-flow__node")?.getAttribute("data-id");a!=null&&s?.(a)},[t,n]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("span",{ref:r}),e]})},b=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:r,top:i,style:l,...a})=>{const c=c6(i,s,t,n);return o.jsxRuntimeExports.jsx(Pn,{position:a6(l6(e,t),!r),...a,type:"source",onClick:d=>d.stopPropagation(),className:(u.CSS.B("handle"),u.CSS.BE("handle",a.id)),style:{left:`${c.left}%`,top:`${c.top}%`,...l}})},he=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:r,...i})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("symbol-primitive"),u.CSS.B("symbol-primitive-toggle"),s!=null&&u.CSS.loc(s),t&&u.CSS.M("enabled"),n&&u.CSS.M("triggered"),e),color:u.cr.cssString(r),...i}),le=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.B("symbol-primitive"),e),...t}),u6=.8,X=({dimensions:e,orientation:t="left",children:n,className:s,color:r,style:i={},scale:l=1,...a})=>{e=u.g.construct(t)==="y"?u._.swap(e):e;const d=u.cr.cssString(r),x=f.use();let p={...i,aspectRatio:`${e.width} / ${e.height}`,width:u._.scale(e,l*u6).width};return r!=null&&(p={...p,[u.CSS.var("symbol-color")]:u.cr.rgbString(r),[u.CSS.var("symbol-color-contrast")]:u.cr.rgbString(u.cr.pickByContrast(r,x.colors.gray.l0,x.colors.gray.l11))}),o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u._.svgViewBox(e),className:u.CSS(u.CSS.loc(t),s),fill:d,stroke:d,...a,style:p,children:o.jsxRuntimeExports.jsx("g",{children:n})})},px=({className:e,orientation:t="left",scale:n,color:s,...r})=>{const i=u.cr.cssString(s);return o.jsxRuntimeExports.jsxs(he,{...r,orientation:t,className:u.CSS(u.CSS.B("four-way-valve"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:12.037,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:87.963,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:7.2916,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:92.6084,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:108,height:96},color:s,scale:n,children:[o.jsxRuntimeExports.jsx(P,{d:"M3.02937 72.7038C2.50936 73.1041 2.50936 73.8883 3.02937 74.2886L7.14001 77.453C7.79757 77.9592 8.75 77.4904 8.75 76.6606V70.3318C8.75 69.502 7.79757 69.0332 7.14001 69.5394L3.02937 72.7038Z",fill:i}),o.jsxRuntimeExports.jsx(P,{d:"M54.2 48L17.0545 29.2035C15.059 28.1937 12.7 29.6438 12.7 31.8803V64.1197C12.7 66.3562 15.059 67.8063 17.0545 66.7965L54.2 48ZM54.2 48L91.3455 29.2035C93.341 28.1937 95.7 29.6438 95.7 31.8803V64.1197C95.7 66.3562 93.341 67.8063 91.3455 66.7965L54.2 48Z"}),o.jsxRuntimeExports.jsx(P,{d:"M54.2 48L35.4035 85.1455C34.3937 87.141 35.8439 89.5 38.0803 89.5H70.3197C72.5562 89.5 74.0063 87.141 72.9965 85.1455L54.2 48ZM54.2 48L35.4035 10.8545C34.3937 8.85901 35.8439 6.5 38.0803 6.5H70.3197C72.5562 6.5 74.0063 8.85901 72.9965 10.8545L54.2 48Z"}),o.jsxRuntimeExports.jsx(P,{d:"M8.70001 73.5C24.7 73.5 28.7 86.8333 28.7 93.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M105.371 23.2962C105.891 22.8959 105.891 22.1117 105.371 21.7114L101.26 18.547C100.602 18.0408 99.65 18.5096 99.65 19.3394V25.6682C99.65 26.498 100.602 26.9668 101.26 26.4606L105.371 23.2962Z",fill:i}),o.jsxRuntimeExports.jsx(P,{d:"M99.7 22.5C83.7 22.5 79.7 9.16667 79.7 2.5",strokeLinecap:"round"})]})]})},mx=({color:e,orientation:t="left",scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("three-way-valve")),orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),fx=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:o.jsxRuntimeExports.jsx(P,{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"})})]}),hx=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{className:u.CSS(u.CSS.B("solenoid-valve"),s&&u.CSS.M("normally-open"),e),...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(P,{className:u.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"}),o.jsxRuntimeExports.jsx(fe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),o.jsxRuntimeExports.jsx(ge,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),gx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{className:u.CSS(u.CSS.B("relief-valve"),e),enabled:r,...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),jx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{orientation:t,className:u.CSS(u.CSS.B("check-valve"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),Ex=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.cr.cssString(n);return o.jsxRuntimeExports.jsxs(le,{...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"7",cy:"7",r:"4",fill:i}),o.jsxRuntimeExports.jsx(P,{d:"M7 39.5V11.5941C7 9.42886 9.22384 7.97669 11.2063 8.84738L76.7937 37.6526C78.7762 38.5233 81 37.0711 81 34.9059V6",strokeLinecap:"round"})]})]})},yx=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.cr.cssString(n);return o.jsxRuntimeExports.jsxs(le,{orientation:t,className:u.CSS(u.CSS.B("check-valve-with-arrow"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:8.602,top:60.65,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.775,top:60.65,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:93,height:57},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M67.4706 5.20759C67.9906 5.6079 67.9906 6.3921 67.4706 6.79241L63.36 9.95678C62.7024 10.463 61.75 9.99421 61.75 9.16437V2.83563C61.75 2.00579 62.7024 1.53702 63.36 2.04322L67.4706 5.20759Z",fill:i}),o.jsxRuntimeExports.jsx(P,{d:"M62.5 6H32.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(ke,{cx:"7.5",cy:"13.5",r:"6",fill:i}),o.jsxRuntimeExports.jsx(P,{d:"M49 34.5L11.8545 15.7035C9.85901 14.6937 7.5 16.1438 7.5 18.3803V50.6197C7.5 52.8562 9.85901 54.3063 11.8545 53.2965L49 34.5ZM49 34.5L86.1455 15.7035C88.141 14.6937 90.5 16.1438 90.5 18.3803V50.6197C90.5 52.8562 88.141 54.3063 86.1455 53.2965L49 34.5Z"})]})]})},Sx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,orientation:n,className:u.CSS(u.CSS.B("angled-valve"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),Rx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"43.5978",cy:"20.972",r:"19"}),o.jsxRuntimeExports.jsx(P,{d:"M26.5 12.8472L6.35452 2.17563C4.35901 1.16585 2 2.61598 2 4.85243V37.0918C2 39.3283 4.35901 40.7784 6.35453 39.7686L26.5 29.3472"}),o.jsxRuntimeExports.jsx(P,{d:"M60.5 28.8486L80.6455 39.5202C82.641 40.5299 85 39.0798 85 36.8434V4.60396C85 2.36751 82.641 0.917381 80.6455 1.92716L60.5 12.3486"})]})]}),Cx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("three-way-ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.8,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"43.5978",cy:"21.722",r:"19"}),o.jsxRuntimeExports.jsx(P,{d:"M26.5 13.5972L6.35452 2.92563C4.35901 1.91585 2 3.36598 2 5.60243V37.8418C2 40.0783 4.35901 41.5284 6.35453 40.5186L26.5 30.0972"}),o.jsxRuntimeExports.jsx(P,{d:"M60.5 29.5986L80.6455 40.2702C82.641 41.2799 85 39.8298 85 37.5934V5.35396C85 3.11751 82.641 1.66738 80.6455 2.67716L60.5 13.0986"}),o.jsxRuntimeExports.jsx(P,{d:"M35.3737 38.7499L24.7021 58.8954C23.6923 60.8909 25.1425 63.2499 27.3789 63.2499H59.6183C61.8548 63.2499 63.3049 60.8909 62.2951 58.8954L51.8737 38.7499"})]})]}),wx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("gate-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 2 L43.5 39.7965"})]})]}),bx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-one"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 2V40"}),o.jsxRuntimeExports.jsx(ke,{cx:"43.5",cy:"21",r:"10",fill:u.cr.cssString(e)})]})]}),vx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-two"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"43.5",cy:"21",r:"10",fill:u.cr.cssString(e)}),o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),o.jsxRuntimeExports.jsx(P,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),_x=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("breather-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:8.081,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:91.919,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"91",cy:"49.5",r:"6",fill:u.cr.cssString(e)}),o.jsxRuntimeExports.jsx(ke,{cx:"8",cy:"7.5",r:"6",fill:u.cr.cssString(e)}),o.jsxRuntimeExports.jsx(P,{d:"M49.5 28.5L12.3545 9.70349C10.359 8.69372 8 10.1438 8 12.3803V44.6197C8 46.8562 10.359 48.3063 12.3545 47.2965L49.5 28.5ZM49.5 28.5L86.6455 9.70349C88.641 8.69372 91 10.1438 91 12.3803V44.6197C91 46.8562 88.641 48.3063 86.6455 47.2965L49.5 28.5Z"})]})]}),kx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Lx=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const i=u.cr.cssString(t);return o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:5,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{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}),o.jsxRuntimeExports.jsx(P,{d:"M33 24H2",strokeLinecap:"round"})]})]})},Mx=({className:e,color:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M13 68V47C13 46.4477 13.4489 45.9892 13.9928 45.8933C16.1351 45.5152 21 43.7981 21 36C21 28.2019 16.1351 26.4848 13.9928 26.1068C13.4489 26.0108 13 25.5523 13 25V4",strokeWidth:"2"})]})]}),Px=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(X,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(P,{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"})})]}),Nx=({className:e,orientation:t="left",color:n,scale:s=1,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:50,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(X,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:o.jsxRuntimeExports.jsx(P,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),Tx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("manual-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),o.jsxRuntimeExports.jsx(P,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),Ix=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("orifice_plate"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{color:n,dimensions:{width:72,height:36},orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M24.5 33V22",strokeLinecap:"round"})]})]}),Bl=(e,t)=>e/t*100,Ax=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:o.jsxRuntimeExports.jsx(P,{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 17"})})]}),Ox=e=>typeof e=="number"?{topLeft:u.K.construct(e),topRight:u.K.construct(e),bottomLeft:u.K.construct(e),bottomRight:u.K.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:u.K.construct(e.topLeft),topRight:u.K.construct(e.topRight),bottomLeft:u.K.construct(e.bottomLeft),bottomRight:u.K.construct(e.bottomRight)}:e,d6=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:r}=e;return`${t.x}% ${n.x}% ${r.x}% ${s.x}% / ${t.y}% ${n.y}% ${r.y}% ${s.y}%`},Dx={width:40,height:80},si={x:50,y:10},Xs=({className:e,dimensions:t=Dx,borderRadius:n=si,boxBorderRadius:s,color:r,backgroundColor:i,strokeWidth:l=2,...a})=>{const c=Ox(n),d=s==null,x=f.use(),{width:p,height:m}=t,h=j.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,m,p]),g=Bl(1,p),E=100-g,S=Bl(1,m),R=100-S;return o.jsxRuntimeExports.jsx(le,{className:u.CSS(e,u.CSS.B("tank")),style:{...t,borderRadius:s??d6(c),borderColor:u.cr.cssString(r??x.colors.gray.l11),backgroundColor:u.cr.cssString(i),borderWidth:l},...a,children:o.jsxRuntimeExports.jsxs(W,{refreshDeps:h,orientation:"left",children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:S,id:"1"}),d&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:g,top:c.topLeft.y,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:E,top:c.topRight.y,id:"3"})]}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:R,id:"4"}),d&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:g,top:100-c.bottomLeft.y,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:E,top:100-c.bottomRight.y,id:"6"})]}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:g,top:50,id:"7"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:E,top:50,id:"8"})]})})},x6=20,p6=(e,t,n=0,s=4)=>{const r=2*Math.PI/e,i=n*Math.PI/180,l=t/(2*Math.sin(Math.PI/e)),a=l+s/2;return Array.from({length:e}).map((c,d)=>{const x=r*d+i-Math.PI/2;return{x:a+l*Math.cos(x),y:a+l*Math.sin(x)}})},m6=(e,t,n)=>{const s=[],r=Math.min(n,t/2),i=e.length;if(i<3||r<=0)return`M ${e.map(l=>`${l.x},${l.y}`).join(" L ")} Z`;for(let l=0;l<i;l++){const a=e[(l-1+i)%i],c=e[l],d=e[(l+1)%i],x=c.x-a.x,p=c.y-a.y,m=d.x-c.x,h=d.y-c.y,g=Math.hypot(x,p),E=Math.hypot(m,h),S=r/g,R=r/E,v=c.x-x*S,y=c.y-p*S,C=c.x+m*R,_=c.y+h*R;l===0?s.push(`M ${v},${y}`):s.push(`L ${v},${y}`),s.push(`Q ${c.x},${c.y} ${C},${_}`)}return s.push("Z"),s.join(" ")},oi=({numSides:e,sideLength:t,rotation:n=0,color:s,backgroundColor:r,className:i,cornerRounding:l,strokeWidth:a,...c})=>{const d=f.use(),x=j.useMemo(()=>2*((a??2)+1),[a]),p=j.useMemo(()=>p6(e,t,n,x),[e,t,n,x]),m=j.useMemo(()=>m6(p,t,l??0),[p,t,l]),h=j.useMemo(()=>2*(t/(2*Math.sin(Math.PI/e)))+x,[t,e,x]);return o.jsxRuntimeExports.jsx(le,{className:u.CSS(i,u.CSS.B("polygon")),...c,children:o.jsxRuntimeExports.jsx(X,{dimensions:{width:h,height:h},children:o.jsxRuntimeExports.jsx(P,{d:m,fill:u.cr.cssString(r??d.colors.gray.l1),stroke:u.cr.cssString(s??d.colors.gray.l9),strokeWidth:a??2})})})},Bx=({radius:e,color:t,backgroundColor:n,className:s,strokeWidth:r,...i})=>{const l=(r??2)+1,a=e*2,c=a+2*l,d=a+2*l;return o.jsxRuntimeExports.jsxs(le,{className:u.CSS(s,u.CSS.B("circle-shape")),...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:"left",refreshDeps:e,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:l/d*100,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:(d-l)/d*100,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:l/c*100,top:50,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:(c-l)/c*100,top:50,id:"4"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:c,height:d},children:o.jsxRuntimeExports.jsx(ke,{cx:c/2,cy:d/2,r:e,stroke:u.cr.cssString(t),strokeWidth:r??2,fill:u.cr.cssString(n)})})]})},$x=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{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.5 30H61Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M44.5 10V8C44.5 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.5 53"})]})]}),zx=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(e,u.CSS.B("regulator-manual")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:2.2989,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.381,top:75,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.619,top:75,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:84},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M43.5 20L43.5 2",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M19.5 2L67.5 2",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 63L6.35453 44.2035C4.35901 43.1937 2 44.6438 2 46.8803V79.1197C2 81.3562 4.35901 82.8063 6.35453 81.7965L43.5 63ZM43.5 63L80.6455 44.2035C82.641 43.1937 85 44.6438 85 46.8803V79.1197C85 81.3562 82.641 82.8063 80.6455 81.7965L43.5 63Z"}),o.jsxRuntimeExports.jsx(P,{d:"M60.5 40C62.1569 40 63.5231 38.6494 63.2755 37.0111C62.641 32.8129 60.681 28.8968 57.6421 25.8579C53.8914 22.1071 48.8043 20 43.5 20C38.1957 20 33.1086 22.1071 29.3579 25.8579C26.319 28.8968 24.359 32.8129 23.7245 37.0111C23.4769 38.6494 24.8431 40 26.5 40L43.5 40H60.5Z"}),o.jsxRuntimeExports.jsx(P,{d:"M60.5 40C62.1569 40 63.5231 38.6494 63.2755 37.0111C62.641 32.8129 60.681 28.8968 57.6421 25.8579C53.8914 22.1071 48.8043 20 43.5 20C38.1957 20 33.1086 22.1071 29.3579 25.8579C26.319 28.8968 24.359 32.8129 23.7245 37.0111C23.4769 38.6494 24.8431 40 26.5 40L43.5 40H60.5Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"63",x2:"43.5",y2:"40"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 20V18C43.5 16.3431 44.8431 15 46.5 15H79.5C81.1569 15 82.5 16.3431 82.5 18V34.4281C82.5 35.4126 82.017 36.3344 81.2076 36.8947L43.5 63"})]})]}),Vx=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("orifice"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[o.jsxRuntimeExports.jsx(P,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Fx=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("needle-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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:u.cr.cssString(n)}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),Hx=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("angled-relief-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(P,{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"})]})]}),Zx=({className:e,color:t,dimensions:n,orientation:s="left",units:r="psi",unitsLevel:i="small",children:l,inlineSize:a=80,...c})=>{const d=u.cr.cssString(t),x=f.use(),p=t==null?"var(--pluto-gray-l0)":u.cr.cssString(u.cr.pickByContrast(t,x.colors.gray.l0,x.colors.gray.l11));return o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("value"),e),...c,style:{borderColor:d,height:n?.height,width:"100%"},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n?.width,inlineSize:a,maxWidth:n?.width},children:l}),o.jsxRuntimeExports.jsxs(W,{orientation:s,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.BE("value","units"),u.CSS.M(i)),style:{background:d},children:o.jsxRuntimeExports.jsx(f.Text,{level:i,color:p,children:r})})]})},Kx=({enabled:e=!1,onClick:t,orientation:n="left"})=>o.jsxRuntimeExports.jsxs(le,{orientation:n,children:[o.jsxRuntimeExports.jsx(f.Switch$1,{value:e,onClick:t,onChange:()=>{}}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Yx=({onClick:e,onMouseDown:t,onMouseUp:n,orientation:s="left",label:r="",color:i,size:l,level:a,onClickDelay:c})=>o.jsxRuntimeExports.jsxs(le,{orientation:s,children:[o.jsxRuntimeExports.jsx(f.Button,{variant:"filled",onClick:e,onMouseDown:t,onMouseUp:n,color:i,size:l,level:a,onClickDelay:c,children:r}),o.jsxRuntimeExports.jsxs(W,{orientation:s,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:s,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:s,left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:s,left:50,top:0,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:s,left:50,top:100,id:"4"})]})]}),Wx=({className:e,orientation:t="left",width:n,color:s,level:r,autoFit:i,align:l="center",value:a,onChange:c,...d})=>{const x={textAlign:l};return u.g.construct(t)==="y"?x.height=i?"fit-content":n:x.width=i?"fit-content":n,o.jsxRuntimeExports.jsx(le,{style:x,orientation:t,className:u.CSS(u.CSS.B("text-box"),u.CSS.loc(t),e),...d,children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS.BE("symbol","label"),color:u.cr.cssString(s),level:r,value:a,onChange:c})})},Gx=({orientation:e="left",className:t,onClick:n,children:s,value:r,units:i,color:l,onChange:a,size:c="small",disabled:d,...x})=>{const[p,m]=j.useState(r);return o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("setpoint"),t),orientation:e,...x,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:e,left:.5,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:e,left:100,top:50,id:"2",style:{zIndex:5}}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx(f.Numeric,{size:c,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,color:l,borderWidth:1,disabled:d,children:o.jsxRuntimeExports.jsx(f.Button,{size:c,variant:"filled",onClick:()=>a(p),color:l,children:"Set"})})]})},Ux=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("screw-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(P,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(P,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(42, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Xx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("vacuum-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"})})]}),qx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("cavity-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(P,{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:u.CSS(u.CSS.M("detail"),t)})]})]}),Qx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("piston-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ke,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(P,{d:"M 23 32, h 16, m 0 -8, v 16",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Jx=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("static-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),ep=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("rotary-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{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"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),tp=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,orientation:n,className:u.CSS(u.CSS.B("light"),s&&u.CSS.M("enabled"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:o.jsxRuntimeExports.jsx(ke,{cx:"32",cy:"32",r:"30"})})]}),np=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.29885,top:69.565,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.70115,top:69.565,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:23.1479,top:23.61,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:11.11,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:76.8521,top:23.61,id:"5"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:69},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M43.5 49L6.35453 30.2035C4.35901 29.1937 2 30.6438 2 32.8803V65.1197C2 67.3562 4.35901 68.8063 6.35453 67.7965L43.5 49ZM43.5 49L80.6455 30.2035C82.641 29.1937 85 30.6438 85 32.8803V65.1197C85 67.3562 82.641 68.8063 80.6455 67.7965L43.5 49Z"}),o.jsxRuntimeExports.jsx(ge,{x:"21",y:"6.5",width:"44",height:"18",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M43 6.5V4C43 2.34315 44.3431 1 46 1H79C80.6569 1 82 2.34315 82 4V20.4281C82 21.4126 81.517 22.3344 80.7076 22.8947L43 49"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"24.5"})]})]}),sp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(e,u.CSS.B("regulator-motorized")),...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:35.6321,top:13.72549,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:1.96078,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:64.3679,top:13.72549,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:24.1379,top:46.078,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:75.8621,top:46.078,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.2989,top:78.43137,id:"6"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97.7011,top:78.43137,id:"7"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:102},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M43.5 80.5L6.35453 61.7035C4.35901 60.6937 2 62.1438 2 64.3803V96.6197C2 98.8562 4.35901 100.306 6.35453 99.2965L43.5 80.5ZM43.5 80.5L80.6455 61.7035C82.641 60.6937 85 62.1438 85 64.3803V96.6197C85 98.8562 82.641 100.306 80.6455 99.2965L43.5 80.5Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"80.5",x2:"43",y2:"56"}),o.jsxRuntimeExports.jsx(P,{d:"M43 38V35.5C43 33.8431 44.3431 32.5 46 32.5H79C80.6569 32.5 82 33.8431 82 35.5V51.9281C82 52.9126 81.517 53.8344 80.7076 54.3947L43 80.5"}),o.jsxRuntimeExports.jsx(ge,{x:"21",y:"38",width:"44",height:"18",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M43 38V26",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(ke,{cx:"43",cy:"14",r:"12"})]})]}),op=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:50,top:1,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:88,height:86},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(P,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44"}),o.jsxRuntimeExports.jsx(P,{d:"M43 1L45 65"})]})]}),rp=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(P,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),ip=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:e,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:e,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(ge,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),lp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(ge,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),ap=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(ge,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),cp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:51,top:2,id:"4"})}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M5.375 36L70.8204 48.7138C74.0584 49.3428 74.0573 53.9765 70.8189 54.6039L14.7952 65.4584C11.5729 66.0827 11.5494 70.6856 14.7651 71.3429L81.5208 84.9873",strokeLinecap:"round"})]})]}),up=({id:e,className:t,orientation:n="right",label:s="text",color:r,level:i="p",onLabelChange:l,...a})=>{const c=document.querySelector(`[data-id="${e}"]`);c&&c.classList.add(n);const d=u.g.construct(n)==="y";return o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("arrow"),u.CSS.loc(n),t),orientation:n,...a,children:[o.jsxRuntimeExports.jsx("div",{className:"wrapper",children:o.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:u.cr.cssString(r)},children:o.jsxRuntimeExports.jsx("div",{className:"bg",children:o.jsxRuntimeExports.jsx(f.MaybeEditable,{value:s,onChange:l,level:i,className:u.CSS.BE("symbol","label")})})})}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:d,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:d,id:"2"})]}),o.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:o.jsxRuntimeExports.jsx("defs",{children:o.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[o.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),o.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),o.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},dp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("vent"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(X,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),xp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("iso-filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:95,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),pp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("flow-straightener"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:97,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:93,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:72,height:36},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2.5",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M10.5 26.5H60.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M10.5 9.5H60.5",strokeLinecap:"round"})]})]}),mp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("heater-element"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:11.9,top:5.55555556,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:11.9,top:94,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:21,height:36},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M2.5 34.0005H14.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M2.5 2.00049L14.5 2.00049",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M14.3793 10.0013C14.9046 10.0013 15.4248 10.1048 15.9101 10.3058C16.3954 10.5068 16.8363 10.8015 17.2078 11.1729C17.5792 11.5443 17.8738 11.9853 18.0749 12.4706C18.2759 12.9559 18.3793 13.4761 18.3793 14.0013C18.3793 14.5266 18.2759 15.0468 18.0749 15.5321C17.8738 16.0174 17.5792 16.4583 17.2078 16.8298C16.8363 17.2012 16.3954 17.4958 15.9101 17.6969C15.4248 17.8979 14.9046 18.0013 14.3793 18.0013"}),o.jsxRuntimeExports.jsx(P,{d:"M14.5 2.00049C15.0253 2.00049 15.5454 2.10395 16.0307 2.30497C16.516 2.50599 16.957 2.80063 17.3284 3.17206C17.6999 3.5435 17.9945 3.98445 18.1955 4.46975C18.3965 4.95506 18.5 5.4752 18.5 6.00049C18.5 6.52578 18.3965 7.04592 18.1955 7.53122C17.9945 8.01652 17.6999 8.45748 17.3284 8.82892C16.957 9.20035 16.516 9.49499 16.0307 9.69601C15.5454 9.89703 15.0253 10.0005 14.5 10.0005"}),o.jsxRuntimeExports.jsx(P,{d:"M14.5 18.0005C15.0253 18.0005 15.5454 18.104 16.0307 18.305C16.516 18.506 16.957 18.8006 17.3284 19.1721C17.6999 19.5435 17.9945 19.9845 18.1955 20.4698C18.3965 20.9551 18.5 21.4752 18.5 22.0005C18.5 22.5258 18.3965 23.0459 18.1955 23.5312C17.9945 24.0165 17.6999 24.4575 17.3284 24.8289C16.957 25.2003 16.516 25.495 16.0307 25.696C15.5454 25.897 15.0253 26.0005 14.5 26.0005"}),o.jsxRuntimeExports.jsx(P,{d:"M14.6206 25.9995C15.1459 25.9995 15.6661 26.103 16.1514 26.304C16.6367 26.505 17.0776 26.7997 17.4491 27.1711C17.8205 27.5425 18.1151 27.9835 18.3162 28.4688C18.5172 28.9541 18.6206 29.4742 18.6206 29.9995C18.6206 30.5248 18.5172 31.0449 18.3162 31.5302C18.1151 32.0155 17.8205 32.4565 17.4491 32.8279C17.0776 33.1994 16.6367 33.494 16.1514 33.695C15.6661 33.896 15.1459 33.9995 14.6206 33.9995"})]})]}),fp=({className:e,dimensions:t=Dx,borderRadius:n=si,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const a=Ox(n),c=f.use(),d=j.useMemo(()=>[t,n,a],[a.bottomLeft,a.bottomRight,a.topLeft,a.topRight,t.height,t.width]),x=u.cr.cssString(r??c.colors.gray.l11),p=i==null?void 0:u.cr.cssString(i),m=t.width/66,h=t.height/180,g=`scale(${m},${h})`;return o.jsxRuntimeExports.jsxs(le,{className:u.CSS(e,u.CSS.B("cylinder")),style:{...t},...l,children:[o.jsxRuntimeExports.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:g,children:o.jsxRuntimeExports.jsx("path",{d:"M23 33.6712C11.9844 36.0332 3 42.4382 3 52.8862V174.568C3 176.225 4.34315 177.568 6 177.568H60C61.6569 177.568 63 176.225 63 174.568V52.8862C63 36.3342 40.4511 29.9292 23 33.6712ZM23 33.6712V13.3181C23 0.318109 42.9975 0.318123 42.9975 13.3181V33.6712",vectorEffect:"non-scaling-stroke",strokeWidth:"2",stroke:x,transform:g,fill:p})}),o.jsxRuntimeExports.jsxs(W,{refreshDeps:d,orientation:"left",children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:"left",left:50,top:2,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:35,top:10,id:"9"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:65,top:10,id:"10"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:40,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:40,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:60,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:60,id:"6"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:"left",left:4,top:80,id:"7"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},hp=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.cr.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M46.3625 54.1079C45.6312 54.4779 45.6311 55.5223 46.3624 55.8924L81.7435 73.7989C83.7389 74.8088 86.098 73.3588 86.0982 71.1224L86.1002 38.883C86.1003 36.6465 83.7414 35.1962 81.7458 36.2059L46.3625 54.1079Z",stroke:l}),o.jsxRuntimeExports.jsx(P,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M41.6389 55.8923C42.3702 55.5222 42.3702 54.4778 41.6389 54.1077L6.2567 36.2035C4.26118 35.1937 1.90217 36.6438 1.90217 38.8803L1.90217 71.1197C1.90217 73.3562 4.26119 74.8063 6.2567 73.7965L41.6389 55.8923Z",stroke:l}),o.jsxRuntimeExports.jsx(ke,{cx:"44",cy:"55",r:"4",fill:l}),o.jsxRuntimeExports.jsx(P,{d:"M45 4C45 3.44772 44.5523 3 44 3C43.4477 3 43 3.44772 43 4H45ZM37.5777 24.7889L38.0249 23.8944L37.5777 24.7889ZM37.5777 21.2111L38.0249 22.1056L37.5777 21.2111ZM50.4223 31.2111L49.9751 32.1056L50.4223 31.2111ZM37.5777 44.7889L37.1305 45.6833L37.5777 44.7889ZM37.5777 41.2111L37.1305 40.3167L37.5777 41.2111ZM42.8944 47.4472L42.4472 48.3416L42.8944 47.4472ZM45 52V49.2361H43V52H45ZM43.3416 46.5528L38.0249 43.8944L37.1305 45.6833L42.4472 48.3416L43.3416 46.5528ZM38.0249 42.1056L50.8695 35.6833L49.9751 33.8944L37.1305 40.3167L38.0249 42.1056ZM50.8695 30.3167L38.0249 23.8944L37.1305 25.6833L49.9751 32.1056L50.8695 30.3167ZM38.0249 22.1056L50.8695 15.6833L49.9751 13.8944L37.1305 20.3167L38.0249 22.1056ZM50.8695 10.3167L45.5528 7.65836L44.6584 9.44721L49.9751 12.1056L50.8695 10.3167ZM45 6.76393V4H43V6.76393H45ZM45.5528 7.65836C45.214 7.48897 45 7.1427 45 6.76393H43C43 7.90025 43.642 8.93904 44.6584 9.44721L45.5528 7.65836ZM50.8695 15.6833C53.0806 14.5777 53.0807 11.4223 50.8695 10.3167L49.9751 12.1056C50.7121 12.4741 50.7121 13.5259 49.9751 13.8944L50.8695 15.6833ZM38.0249 23.8944C37.2879 23.5259 37.2879 22.4741 38.0249 22.1056L37.1305 20.3167C34.9193 21.4223 34.9194 24.5777 37.1305 25.6833L38.0249 23.8944ZM50.8695 35.6833C53.0806 34.5777 53.0807 31.4223 50.8695 30.3167L49.9751 32.1056C50.7121 32.4741 50.7121 33.5259 49.9751 33.8944L50.8695 35.6833ZM38.0249 43.8944C37.2879 43.5259 37.2879 42.4741 38.0249 42.1056L37.1305 40.3167C34.9193 41.4223 34.9194 44.5777 37.1305 45.6833L38.0249 43.8944ZM45 49.2361C45 48.0998 44.358 47.061 43.3416 46.5528L42.4472 48.3416C42.786 48.511 43 48.8573 43 49.2361H45Z",fill:l,strokeWidth:1})]})]})},gp=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.cr.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M23.3625 55.6237C22.6312 55.9937 22.6311 57.0381 23.3624 57.4082L58.7435 75.3147C60.7389 76.3246 63.098 74.8747 63.0981 72.6382L63.1001 40.3988C63.1003 38.1624 60.7414 36.7121 58.7458 37.7217L23.3625 55.6237Z"}),o.jsxRuntimeExports.jsx(P,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),o.jsxRuntimeExports.jsx(P,{d:"M21.8923 58.4348C21.5222 57.7035 20.4778 57.7035 20.1077 58.4348L2.20349 93.817C1.19372 95.8125 2.64384 98.1715 4.8803 98.1715H37.1197C39.3562 98.1715 40.8063 95.8125 39.7965 93.817L21.8923 58.4348Z"}),o.jsxRuntimeExports.jsx(ke,{cx:"21",cy:"56.0737",r:"4",fill:l}),o.jsxRuntimeExports.jsx(P,{d:"M21 53.0105V50.0225C21 49.3397 20.6516 48.704 20.0759 48.3366L15.6419 45.507C14.4098 44.7207 14.4098 42.9214 15.6419 42.1351L26.3581 35.2965C27.5902 34.5102 27.5902 32.7109 26.3581 31.9246L15.6419 25.0859C14.4098 24.2997 14.4098 22.5003 15.6419 21.714L26.3581 14.8754C27.5902 14.0891 27.5902 12.2898 26.3581 11.5035L21.9241 8.67393C21.3484 8.30656 21 7.67087 21 6.98798V4",stroke:l,strokeLinecap:"round"})]})]})},jp=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.8462,top:22.3095,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.1538,top:22.3095,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50,top:92.8571,id:"3"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:39,height:21},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M1.5 5.5V3.5C1.5 2.39543 2.39543 1.5 3.5 1.5H35.5C36.6046 1.5 37.5 2.39543 37.5 3.5V5.5C37.5 6.60457 36.6046 7.5 35.5 7.5H24.5C23.3954 7.5 22.5 8.39543 22.5 9.5V17.5C22.5 18.6046 21.6046 19.5 20.5 19.5H18.5C17.3954 19.5 16.5 18.6046 16.5 17.5V9.5C16.5 8.39543 15.6046 7.5 14.5 7.5H3.5C2.39543 7.5 1.5 6.60457 1.5 5.5Z",fill:u.cr.cssString(n),stroke:"none"})})]}),Ep=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:t,left:3.8462,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:t,left:96.1539,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:t,left:50.5,top:96.1539,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:t,left:50.5,top:3.8462,id:"4"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:39,height:39},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M22.5 35.5C22.5 36.6046 21.6046 37.5 20.5 37.5H18.5C17.3954 37.5 16.5 36.6046 16.5 35.5V24.5C16.5 23.3954 15.6046 22.5 14.5 22.5H3.5C2.39543 22.5 1.5 21.6046 1.5 20.5V18.5C1.5 17.3954 2.39543 16.5 3.5 16.5H14.5C15.6046 16.5 16.5 15.6046 16.5 14.5V3.5C16.5 2.39543 17.3954 1.5 18.5 1.5H20.5C21.6046 1.5 22.5 2.39543 22.5 3.5V14.5C22.5 15.6046 23.3954 16.5 24.5 16.5H35.5C36.6046 16.5 37.5 17.3954 37.5 18.5V20.5C37.5 21.6046 36.6046 22.5 35.5 22.5H24.5C23.3954 22.5 22.5 23.3954 22.5 24.5V35.5Z",fill:u.cr.cssString(n),stroke:"none"})})]}),Ye=({position:e,color:t})=>o.jsxRuntimeExports.jsx("text",{x:e?.x??57,y:e?.y??27,style:{fill:u.cr.cssString(t),fontWeight:450},stroke:"none",children:"F"}),yp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Ye,{position:{x:56,y:25},color:s})]})]}),Sp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Electromagnetic"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M47.5 17.5H55.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M15.5 17.5H23.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M23.5 17.5C23.5 16.9747 23.6035 16.4546 23.8045 15.9693C24.0055 15.484 24.3001 15.043 24.6716 14.6716C25.043 14.3001 25.484 14.0055 25.9693 13.8045C26.4546 13.6035 26.9747 13.5 27.5 13.5C28.0253 13.5 28.5454 13.6035 29.0307 13.8045C29.516 14.0055 29.957 14.3001 30.3284 14.6716C30.6999 15.043 30.9945 15.484 31.1955 15.9693C31.3965 16.4546 31.5 16.9747 31.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M31.5 17.5C31.5 16.9747 31.6035 16.4546 31.8045 15.9693C32.0055 15.484 32.3001 15.043 32.6716 14.6716C33.043 14.3001 33.484 14.0055 33.9693 13.8045C34.4546 13.6035 34.9747 13.5 35.5 13.5C36.0253 13.5 36.5454 13.6035 37.0307 13.8045C37.516 14.0055 37.957 14.3001 38.3284 14.6716C38.6999 15.043 38.9945 15.484 39.1955 15.9693C39.3965 16.4546 39.5 16.9747 39.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M39.5 17.5C39.5 16.9747 39.6035 16.4546 39.8045 15.9693C40.0055 15.484 40.3001 15.043 40.6716 14.6716C41.043 14.3001 41.484 14.0055 41.9693 13.8045C42.4546 13.6035 42.9747 13.5 43.5 13.5C44.0253 13.5 44.5454 13.6035 45.0307 13.8045C45.516 14.0055 45.957 14.3001 46.3284 14.6716C46.6999 15.043 46.9945 15.484 47.1955 15.9693C47.3965 16.4546 47.5 16.9747 47.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ye,{position:{x:58,y:29},color:s})]})]}),Rp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-VariableArea"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M46 10V25"}),o.jsxRuntimeExports.jsx(P,{d:"M23 13V22"}),o.jsxRuntimeExports.jsx(P,{d:"M23 13L46 10"}),o.jsxRuntimeExports.jsx(P,{d:"M23 22L46 25"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),Cp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Coriolis"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M2 17.6024H28.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M28.5 17.6024L34.6834 14.0324",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M34.8 14L45.9058 20.9666",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M51.5 17.6024L46.0141 20.8987",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M20.5 17.6024L26.6574 14.0474",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M26.75 14.1024L37.788 21.0265",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 17.6024L37.8427 21.0017",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M43.5 17.6024H69",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{position:{x:58,y:29},color:s})]})]}),wp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M24 2V7V12",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M24 12H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M24 23H29H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M24 33V23",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),bp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Venturi"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M8 33L26.5329 22.3",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M8 2L26.5329 12.7",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M56 33L26.5876 22.2948",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M56 2L26.5876 12.7052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{position:{x:56,y:29},color:s})]})]}),vp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-RingPiston"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(ke,{cx:"36.5",cy:"17.5",r:"10.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(ke,{cx:"36.5",cy:"21.5",r:"6.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ye,{position:{x:56,y:29},color:s})]})]}),_p=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-PositiveDisplacement"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:72,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M41 13C41 15.4853 38.9853 17.5 36.5 17.5C34.0147 17.5 32 15.4853 32 13C32 10.5147 34.0147 8.5 36.5 8.5C38.9853 8.5 41 10.5147 41 13Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M41 22C41 24.4853 38.9853 26.5 36.5 26.5C34.0147 26.5 32 24.4853 32 22C32 19.5147 34.0147 17.5 36.5 17.5C38.9853 17.5 41 19.5147 41 22Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),kp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Turbine"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M16.5 17.5H54.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M32.5 9L35.4756 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M38.5 26L35.5244 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M32.5 26L35.4756 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M38.5 9L35.5244 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M32.5 9C32.5 8.20435 32.8161 7.44129 33.3787 6.87868C33.9413 6.31607 34.7044 6 35.5 6C36.2956 6 37.0587 6.31607 37.6213 6.87868C38.1839 7.44129 38.5 8.20435 38.5 9",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M38.5 26C38.5 26.7956 38.1839 27.5587 37.6213 28.1213C37.0587 28.6839 36.2956 29 35.5 29C34.7044 29 33.9413 28.6839 33.3787 28.1213C32.8161 27.5587 32.5 26.7956 32.5 26",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),Lp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Pulse"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M31 13.5H39",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M23 21.5H31",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M39 21.5H47",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M39 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),Mp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-FloatSensor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:71,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M25 8H46",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31 27H40",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31 27L25.046 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M40 27L45.954 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),Pp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("flowmeter-Orifice"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:6,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:72,height:36},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M24.5 33V22",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ye,{color:s})]})]}),Np=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("heat-exchanger-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.545,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.454,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.454,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(P,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),o.jsxRuntimeExports.jsx(P,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"})]})]}),Tp=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:89,top:27.27,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:89,top:72.73,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.455,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.545,top:50,id:"5"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(P,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),Ip=({id:e,className:t,orientation:n="right",color:s,scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(le,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:9,top:6.25,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:24,top:93.75,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:76,top:6.25,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:91,top:93.75,id:"4"}),o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:1.508,top:50,id:"5"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:98.492,top:50,id:"6"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:199,height:48},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(ge,{x:"3",y:"3",width:"193",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(ge,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(ge,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(fe,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24",strokeWidth:"2"})]})]}),Ap=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M31 62C29.2204 62 27.3855 61.332 25.5927 59.9086C23.791 58.4782 22.0952 56.3316 20.6377 53.5381C19.1829 50.7496 18.0147 47.4106 17.214 43.7054C16.4137 40.0021 16 36.0237 16 32C16 27.9763 16.4137 23.9979 17.214 20.2946C18.0147 16.5895 19.1829 13.2504 20.6377 10.4619C22.0952 7.66841 23.791 5.52179 25.5927 4.09136C27.3855 2.66801 29.2204 2 31 2",strokeWidth:"2"})]})]}),Op=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M50.3827 20.3601C47.1902 21.7605 43.4002 22.8046 39.2752 23.4077C35.1519 24.0105 30.8103 24.1557 26.5584 23.8319C22.3057 23.508 18.2597 22.7238 14.7044 21.5418C11.1449 20.3584 8.19358 18.8149 6.03181 17.0454M6.02374 46.9613C8.18198 45.1925 11.129 43.6491 14.6841 42.465C18.2349 41.2824 22.2765 40.4968 26.5256 40.1707C30.774 39.8447 35.113 39.9871 39.2353 40.5866C43.3592 41.1864 47.15 42.2268 50.3455 43.6237",strokeLinecap:"round"})]})]}),Dp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("compressor"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z",strokeLinecap:"round"})})]}),Bp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(ke,{cx:"33",cy:"33",r:"14.5"})]})]}),$p=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M35 12.4V20.4"}),o.jsxRuntimeExports.jsx(P,{d:"M3 33H16"}),o.jsxRuntimeExports.jsx(P,{d:"M35 53.6V45.6"})]})]}),zp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M39 33C39 33.7879 38.8448 34.5681 38.5433 35.2961C38.2417 36.0241 37.7998 36.6855 37.2426 37.2426C36.6855 37.7998 36.0241 38.2417 35.2961 38.5433C34.5681 38.8448 33.7879 39 33 39C32.2121 39 31.4319 38.8448 30.7039 38.5433C29.9759 38.2417 29.3145 37.7998 28.7574 37.2426C28.2002 36.6855 27.7583 36.0241 27.4567 35.2961C27.1552 34.5681 27 33.7879 27 33C27 32.2121 27.1552 31.4319 27.4567 30.7039C27.7583 29.9759 28.2002 29.3145 28.7574 28.7574C29.3145 28.2002 29.9759 27.7583 30.7039 27.4567C31.4319 27.1552 32.2121 27 33 27C33.7879 27 34.5681 27.1552 35.2961 27.4567C36.0241 27.7583 36.6855 28.2002 37.2426 28.7574C37.7998 29.3145 38.2417 29.9759 38.5433 30.7039C38.8448 31.4319 39 32.2121 39 33L39 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M39 33H47"}),o.jsxRuntimeExports.jsx(P,{d:"M27 33H19"}),o.jsxRuntimeExports.jsx(P,{d:"M36 27.804L40 20.8758"}),o.jsxRuntimeExports.jsx(P,{d:"M30 27.804L26 20.8758"}),o.jsxRuntimeExports.jsx(P,{d:"M30 38.196L26 45.1242"}),o.jsxRuntimeExports.jsx(P,{d:"M36 38.196L40 45.1242"})]})]}),Vp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M49.1214 16.2515C43.5325 21.3055 36.2463 24.0711 28.7115 23.9986C21.1766 23.9262 13.945 21.0209 8.45428 15.8604M8.4838 50.112C13.9718 44.968 21.1918 42.0733 28.7133 42.0014C36.2348 41.9295 43.5089 44.6858 49.0942 49.7239"})]})]}),Fp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(P,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(P,{d:"M3 33H63"})]})]}),Hp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:7.575,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:92.425,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(X,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(P,{d:"M16.5 2.5L16.5 66.5M2.5 34.5H30.5M2.5 18.9848H30.5M2.5 50.0152H30.5M5.3 66.5H27.7C29.2464 66.5 30.5 65.1976 30.5 63.5909V5.40909C30.5 3.80244 29.2464 2.5 27.7 2.5H5.3C3.7536 2.5 2.5 3.80245 2.5 5.40909V63.5909C2.5 65.1976 3.7536 66.5 5.3 66.5Z",strokeLinecap:"round"})})]}),Zp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(P,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(P,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(P,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(P,{d:"M29.12 65.62L61 34.5"})]})]}),Kp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(P,{d:"M30 2.5L30 66.5"}),o.jsxRuntimeExports.jsx(P,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(P,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 50H30"})]})]}),Yp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(P,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(P,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(P,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5",strokeLinecap:"square"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Wp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(P,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(P,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(P,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(P,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(P,{d:"M29.12 65.62L61 34.5"}),o.jsxRuntimeExports.jsx(P,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Gp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("thruster"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:25.3,top:4.76,id:"3"}),o.jsxRuntimeExports.jsx(b,{location:"bottom",orientation:n,left:25.3,top:95.24,id:"4"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),o.jsxRuntimeExports.jsx(P,{d:"M78.5 37.5117V4.51172"}),o.jsxRuntimeExports.jsx(P,{d:"M40.5 11.5L76.0072 2.6232"}),o.jsxRuntimeExports.jsx(P,{d:"M40.5 30.5L76.0072 39.3768"}),o.jsxRuntimeExports.jsx(P,{d:"M75.6192 2.71597C75.9231 2.56695 76.2597 2.49745 76.5977 2.51399C76.9357 2.53052 77.264 2.63256 77.5518 2.81053C77.8397 2.98851 78.0776 3.23661 78.2435 3.53161C78.4093 3.82661 78.4975 4.15886 78.4999 4.49726"}),o.jsxRuntimeExports.jsx(P,{d:"M78.4994 37.5101C78.4914 37.8382 78.4028 38.1592 78.2414 38.445C78.0801 38.7307 77.8509 38.9723 77.574 39.1486C77.2972 39.3248 76.9813 39.4302 76.6541 39.4555C76.3269 39.4808 75.9986 39.4252 75.698 39.2936"})]})]}),Up=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:18.75,top:17.46,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"top",orientation:n,left:50,top:1.5873,id:"2"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:81.25,top:17.46,id:"3"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:64,height:126},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"12",y:"1.6667",width:"40",height:"40",rx:"2"}),o.jsxRuntimeExports.jsx(P,{d:"M1.3333 124H62.6667",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M50.1883 41.6667C41.7748 41.6667 35.0143 46.3333 42.6923 59.3333C59.3476 87.5333 63.6327 119 62.855 124",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(P,{d:"M14 41.6667C22.4135 41.6667 29.174 46.3333 21.496 59.3333C4.84066 87.5333 0.555555 119 1.33333 124",strokeLinecap:"round"})]})]}),Xp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(P,{d:"M2.293 2.29297L29.9383 66.7986",strokeDasharray:"6 6"})]})]}),qp=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(le,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(b,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(b,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(X,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(ge,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(P,{d:"M31 34.5L2.30611 2.33992",strokeDasharray:"6 6"}),o.jsxRuntimeExports.jsx(P,{d:"M31 34.5L2.30611 66.6601",strokeDasharray:"6 6"})]})]}),f6=({aetherKey:e,source:t})=>{const n=f.useMemoDeepEqual({source:t}),[,{enabled:s},r]=f.use$2({aetherKey:e,type:I.Light.TYPE,schema:I.lightStateZ,initialState:{enabled:!1,...n}});return j.useEffect(()=>r(i=>({...i,...n})),[n,r]),{enabled:s}},h6=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{value:r},i]=f.use$2({aetherKey:e,type:I.Setpoint.TYPE,schema:I.setpointStateZ,initialState:{trigger:0,value:0,...s}});return j.useEffect(()=>{i(a=>({...a,...s}))},[s,i]),{set:j.useCallback(a=>i(c=>({...c,trigger:c.trigger+1,command:a})),[i]),value:r}},g6=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{triggered:r,enabled:i},l]=f.use$2({aetherKey:e,type:I.Toggle.TYPE,schema:I.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return j.useEffect(()=>{l(c=>({...c,...s}))},[s,l]),{toggle:j.useCallback(()=>l(c=>({...c,triggered:!c.triggered})),[l]),triggered:r,enabled:i}},an=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:r="top",direction:i,align:l,maxInlineSize:a}=e;return n==null||n.length===0?null:{key:"label",element:o.jsxRuntimeExports.jsx(f.Editable,{className:u.CSS(u.CSS.BE("symbol","label"),u.CSS.dir(i)),level:s,value:n,onChange:c=>t?.({label:{...e,label:c}}),allowEmpty:!0,style:{textAlign:l,maxInlineSize:a}}),location:r}},ri=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:r,indicator:i,orientation:l="bottom"}=e;return{key:"control",element:o.jsxRuntimeExports.jsxs(f.Box,{direction:u.g.swap(l),align:"center",className:u.CSS(u.CSS.B("control-state")),gap:"small",children:[t&&n&&o.jsxRuntimeExports.jsx(Gc,{size:"small",...r}),t&&s&&o.jsxRuntimeExports.jsx(qc,{...i})]}),location:l}},Ce=(e,t)=>{const n=({symbolKey:s,control:r,source:i,sink:l,label:a,onChange:c,selected:d,orientation:x="left",position:p,...m})=>{const{enabled:h,triggered:g,toggle:E}=g6({aetherKey:s,source:i,sink:l}),S=[],R=an(a,c);R!=null&&S.push(R);const v=ri(r);return v!=null&&S.push(v),o.jsxRuntimeExports.jsx($t,{editable:d,symbolKey:s,items:S,onRotate:()=>c({orientation:u.K$1.rotate90(x)}),onLocationChange:(y,C)=>{y==="label"&&c({label:{...a,orientation:C}}),y==="control"&&c({control:{...r,orientation:C}})},...t?.grid,children:o.jsxRuntimeExports.jsx(e,{enabled:h,triggered:g,onClick:E,orientation:x,...m})})};return n.displayName=e.displayName,n},ce=(e,t)=>{const n=({symbolKey:s,label:r,onChange:i,selected:l,position:a,orientation:c="left",...d})=>{const x=[],p=an(r,i);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx($t,{...t?.grid,items:x,editable:l,symbolKey:s,onRotate:()=>i({orientation:u.K$1.rotate90(c)}),onLocationChange:(m,h)=>{m==="label"&&i({label:{...r,orientation:h}})},children:o.jsxRuntimeExports.jsx(e,{orientation:c,...d})})};return n.displayName=e.displayName,n},St=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,position:l,orientation:a="left",enabled:c=!1,clickable:d=!1,...x})=>{const p=[],m=an(s,r);m!=null&&p.push(m);const h=()=>{d&&r({enabled:!c})};return o.jsxRuntimeExports.jsx($t,{items:p,editable:i,symbolKey:n,onRotate:()=>r({orientation:u.K$1.rotate90(a)}),onLocationChange:(g,E)=>{g==="label"&&r({label:{...s,orientation:E}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,enabled:c,onClick:h,...x})})};return t.displayName=e.displayName,t},Qp=Ce(mx),Jp=Ce(fx),em=Ce(hx),tm=Ce(px),nm=Ce(Sx),sm=Ce(kx),om=Ce(Ap),rm=Ce(Op),im=Ce(Xx),lm=Ce(qx),am=Ce(Qx),cm=Ce(ep),um=Ce(op),dm=Ce(rp),xm=Ce(ip),pm=Ce(lp),mm=Ce(ap),fm=Ce(cp),hm=Ce(Ux),gm=Ce(Dp),jm=Ce(Bp),Em=Ce($p),ym=Ce(zp),Sm=Ce(Vp),Rm=Ce(Fp),Cm=Ce(bx),wm=Ce(vx),bm=Ce(Rx),vm=Ce(Cx),_m=Ce(wx),km=ce($x),Lm=ce(zx),Mm=ce(np),Pm=ce(sp),Nm=ce(Lx),Tm=ce(Px),Im=ce(Nx),Am=ce(Ax),Om=ce(jx),Dm=ce(Ex),Bm=ce(yx),$m=ce(Vx),zm=Ce(Kx,{grid:{allowRotate:!1}}),Vm=ce(dp),Fm=ce(Ix),Hm=ce(xp),Zm=ce(pp),Km=ce(mp),Ym=ce(Mx),Wm=ce(jp),Gm=ce(Ep,{grid:{allowRotate:!1}}),Um=ce(Jx),Xm=ce(yp),qm=ce(Sp),Qm=ce(Rp),Jm=ce(Cp),ef=ce(wp),tf=ce(bp),nf=ce(vp),sf=ce(_p),of=ce(kp),rf=ce(Lp),lf=ce(Mp),af=ce(Pp),cf=ce(Np),uf=ce(Tp),df=ce(Ip),xf=ce(Hp),pf=ce(Kp),mf=ce(Zp),ff=ce(Yp),hf=ce(Wp),gf=ce(Gp),jf=ce(Up),Ef=ce(Xp),yf=ce(qp),Sf=St(Fx),Rf=St(gx),Cf=St(hp),wf=St(gp),bf=St(Tx),vf=St(Hx),_f=St(_x),kf=ce(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Xs,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e}),{grid:{allowCenter:!0,allowRotate:!1}}),Lf=e=>o.jsxRuntimeExports.jsx(Xs,{...e,dimensions:{width:25,height:50}}),j6=ce(({sideLength:e,rotation:t,color:n,backgroundColor:s,numSides:r,...i})=>o.jsxRuntimeExports.jsx(oi,{numSides:3,sideLength:e,rotation:t,color:n,backgroundColor:s,...i})),Mf=ce(({numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:r,backgroundColor:i,strokeWidth:l,...a})=>o.jsxRuntimeExports.jsx(oi,{numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:r,backgroundColor:i,strokeWidth:l,...a})),Pf=ce(({radius:e,color:t,backgroundColor:n,strokeWidth:s,...r})=>o.jsxRuntimeExports.jsx(Bx,{radius:e,color:t,backgroundColor:n,strokeWidth:s,...r}),{grid:{allowRotate:!1}}),Nf=ce(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:r,dimensions:i,strokeWidth:l})=>o.jsxRuntimeExports.jsx(Xs,{onResize:a=>n({dimensions:a}),orientation:s,color:r,dimensions:i,boxBorderRadius:t,backgroundColor:e,strokeWidth:l}),{grid:{allowCenter:!0,allowRotate:!1}}),Tf=e=>o.jsxRuntimeExports.jsx(Xs,{...e,dimensions:{width:25,height:50},borderRadius:0}),If=({label:e,symbolKey:t,orientation:n="left",control:s,units:r,source:i,sink:l,color:a,onChange:c,selected:d,draggable:x,size:p,disabled:m})=>{const{value:h,set:g}=h6({aetherKey:t,source:i,sink:l}),E=[],S=ri(s);S!=null&&E.push(S);const R=an(e,c);return R!=null&&E.push(R),o.jsxRuntimeExports.jsx($t,{symbolKey:t,allowRotate:!1,editable:d&&!x,onRotate:()=>c({orientation:u.K$1.rotate90(n)}),items:E,onLocationChange:(v,y)=>{v==="label"&&c({label:{...e,orientation:y}})},children:o.jsxRuntimeExports.jsx(Gx,{value:h,onChange:g,units:r,color:a,orientation:n,disabled:m,size:p})})},Af=({className:e,...t})=>o.jsxRuntimeExports.jsx(Gx,{value:12,onChange:()=>{},units:"mV",style:{width:120,transform:"scale(0.95)"},className:u.CSS(u.CSS.BM("setpoint","preview"),e),disabled:!0,...t,children:o.jsxRuntimeExports.jsx(f.Text,{children:"10.0"})}),E6=u.K.construct(10,-1),y6=u.K.construct(1,1),Of=({symbolKey:e,label:t,level:n="p",position:s,textColor:r,color:i,telem:l,units:a,onChange:c,inlineSize:d=70,selected:x,draggable:p,notation:m,redline:h})=>{const g=_s.useTypography(n),E=(g.lineHeight+.5)*g.baseSize+2,S=j.useMemo(()=>{if(l==null||h==null)return;const{bounds:C,gradient:_}=h;return I.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:l,scale:I.scaleNumber({scale:u.C.Scale.scale(C).scale(0,1).transform}),gradient:I.colorGradient({gradient:_})},outlet:"gradient"})},[l,h]),{width:R}=Dr({aetherKey:e,color:r,level:n,box:u.Ho.construct(u.K.translateY({...s},1),{height:E,width:d}),telem:l,backgroundTelem:S,minWidth:d,notation:m,useWidthForBackground:!0,valueBackgroundOverScan:E6,valueBackgroundShift:y6}),v=[],y=an(t,c);return y!=null&&v.push(y),o.jsxRuntimeExports.jsx($t,{editable:x&&!p,symbolKey:e,items:v,allowRotate:!1,onLocationChange:(C,_)=>{C==="label"&&c({label:{...t,orientation:_}})},children:o.jsxRuntimeExports.jsx(Zx,{color:i,dimensions:{height:E,width:R},inlineSize:d,units:a,unitsLevel:A.downLevel(n)})})},Df=({color:e})=>o.jsxRuntimeExports.jsx(Zx,{color:e,dimensions:{width:60,height:25},units:"psi",children:o.jsxRuntimeExports.jsx(f.Text,{children:"50.00"})}),Bf=({symbolKey:e,label:t,orientation:n="left",sink:s,control:r,selected:i,draggable:l,onChange:a,mode:c,...d})=>{const{onMouseDown:x,onMouseUp:p}=VC({aetherKey:e,sink:s,mode:c}),m=[],h=ri(r);return h!=null&&m.push(h),o.jsxRuntimeExports.jsx($t,{onRotate:()=>a({orientation:u.K$1.rotate90(n)}),allowRotate:!1,editable:i,symbolKey:e,items:m,onLocationChange:(g,E)=>{g==="label"&&a({label:{...t,orientation:E}})},children:o.jsxRuntimeExports.jsx(Yx,{...t,onMouseDown:x,onMouseUp:p,orientation:n,...d})})},$f=({label:e,...t})=>o.jsxRuntimeExports.jsx(Yx,{label:"Button",...t}),zf=({symbolKey:e,label:t,source:n,onChange:s,selected:r,...i})=>{const{enabled:l}=f6({aetherKey:e,source:n}),a=[],c=an(t,s);return c!=null&&a.push(c),o.jsxRuntimeExports.jsx($t,{items:a,allowRotate:!1,editable:r,symbolKey:e,onLocationChange:(d,x)=>{d==="label"&&s({label:{...t,orientation:x}})},children:o.jsxRuntimeExports.jsx(tp,{enabled:l,...i})})},Vf=({label:{label:e,level:t},orientation:n,color:s,onChange:r})=>o.jsxRuntimeExports.jsx(up,{className:Us,onLabelChange:i=>r({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),Ff=({label:e,...t})=>o.jsxRuntimeExports.jsx(up,{label:"Off Page",...t,orientation:"right"}),Hf=ce(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(fp,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),Zf=e=>o.jsxRuntimeExports.jsx(fp,{...e,dimensions:{width:25,height:50}}),Kf=({onChange:e,symbolKey:t,color:n,width:s,align:r,autoFit:i,level:l,value:a})=>o.jsxRuntimeExports.jsx(Wx,{className:Us,onChange:c=>e({value:c}),value:a,level:l,color:n,width:s,align:r,autoFit:i},t),Yf=e=>o.jsxRuntimeExports.jsx(Wx,{...e,autoFit:!0,value:"Text Box"}),G=4,Vn=2,S6=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","ballValve","threeWayBallValve","gateValve","butterflyValveOne","butterflyValveTwo","breatherValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","crossBeamAgitator","electricRegulator","electricRegulatorMotorized","filter","flowStraightener","heaterElement","checkValveWithArrow","flatBladeAgitator","flowmeterGeneral","flowmeterElectromagnetic","flowmeterVariableArea","flowmeterCoriolis","flowmeterNozzle","flowmeterVenturi","flowmeterRingPiston","flowmeterPositiveDisplacement","flowmeterTurbine","flowmeterPulse","flowmeterFloatSensor","flowmeterOrifice","fourWayValve","helicalAgitator","isoCap","isoCheckValve","isoFilter","light","manualValve","needleValve","orifice","orificePlate","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","regulatorManual","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","springLoadedReliefValve","staticMixer","switch","tank","polygon","circle","textBox","threeWayValve","vacuumPump","value","valve","vent","tJunction","crossJunction","heatExchangerGeneral","heatExchangerM","heatExchangerStraightTube","diaphragmPump","ejectionPump","compressor","turboCompressor","rollerVaneCompressor","liquidRingCompressor","ejectorCompressor","centrifugalCompressor","flameArrestor","flameArrestorDetonation","flameArrestorExplosion","flameArrestorFireRes","flameArrestorFireResDetonation","thruster","nozzle","strainer","strainerCone"],R6=te.z.enum(S6),ae={orientation:"left",scale:1},C6={source:I.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:I.streamChannelValue({channel:0}),rollingAverage:I.rollingAverage({windowSize:1}),stringifier:I.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},w6={...ae,source:I.sourcePipeline("number",{connections:[],segments:{valueStream:I.streamChannelValue({channel:0})},outlet:"valueStream"})},b6={...ae,sink:I.sinkPipeline("number",{connections:[],segments:{setter:I.setChannelValue({channel:0})},inlet:"setter"})},Wf={...ae,source:I.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:I.streamChannelValue({channel:0}),threshold:I.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},Gf={...ae,control:{show:!0},sink:I.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:I.setChannelValue({channel:0}),setpoint:I.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},we={...Wf,...Gf},Vt={...ae,enabled:!1,clickable:!1},Y=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),v6={width:125,height:200},ii={dimensions:v6},_6=3,k6={name:"Three Way Valve",key:"threeWayValve",Form:Re,Symbol:Qp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three Way Valve"),...we}),Preview:mx,zIndex:G},L6={name:"Valve",key:"valve",Form:Re,Symbol:Jp,defaultProps:e=>({color:e.colors.gray.l11,...Y("Valve"),...we}),Preview:fx,zIndex:G},M6={name:"Solenoid Valve",key:"solenoidValve",Form:Re,Symbol:em,defaultProps:e=>({color:e.colors.gray.l11,...Y("Solenoid Valve"),normallyOpen:!1,...we}),Preview:hx,zIndex:G},P6={name:"Four Way Valve",key:"fourWayValve",Form:Re,Symbol:tm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Four Way Valve"),...we}),Preview:px,zIndex:G},N6={name:"Angled Valve",key:"angledValve",Form:Re,Symbol:nm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Valve"),...we}),Preview:Sx,zIndex:G},T6={name:"Ball Valve",key:"ballValve",Form:Re,Symbol:bm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ball Valve"),...we}),Preview:Rx,zIndex:G},I6={name:"Three-Way Ball Valve",key:"threeWayBallValve",Form:Re,Symbol:vm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three-Way Ball Valve"),...we}),Preview:Cx,zIndex:G},A6={name:"Gate Valve",key:"gateValve",Form:Re,Symbol:_m,defaultProps:e=>({color:e.colors.gray.l11,...Y("Gate Valve"),...we}),Preview:wx,zIndex:G},O6={name:"Butterfly Valve (Remote)",key:"butterflyValveOne",Form:Re,Symbol:Cm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Remote)"),...we}),Preview:bx,zIndex:G},D6={name:"Butterfly Valve (Manual)",key:"butterflyValveTwo",Form:Re,Symbol:wm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Manual)"),...we}),Preview:vx,zIndex:G},B6={name:"Breather Valve",key:"breatherValve",Form:zt,Symbol:_f,defaultProps:e=>({color:e.colors.gray.l11,...Y("Breather Valve"),...Vt}),Preview:Xe(_x,["clickable"]),zIndex:G},$6={name:"Pump",key:"pump",Form:Re,Symbol:sm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pump"),...we}),Preview:kx,zIndex:G},z6={name:"Screw Pump",key:"screwPump",Form:Re,Symbol:hm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Screw Pump"),...we}),Preview:Ux,zIndex:G},V6={name:"Tank",key:"tank",Form:dx,Symbol:kf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.cr.setAlpha(e.colors.gray.l1,0),...Y("Tank"),borderRadius:si,...ii,...ae}),Preview:Lf,zIndex:Vn},F6={name:"Polygon",key:"polygon",Symbol:Mf,Form:KC,defaultProps:e=>({numSides:6,sideLength:x6,cornerRounding:0,rotation:0,color:e.colors.gray.l11,backgroundColor:u.cr.setAlpha(e.colors.gray.l1,0),strokeWidth:2,...Y("Polygon")}),Preview:Xe(oi,["clickable"]),zIndex:Vn},H6={name:"Circle",key:"circle",Symbol:Pf,Form:YC,defaultProps:e=>({radius:20,color:e.colors.gray.l11,backgroundColor:u.cr.setAlpha(e.colors.gray.l1,0),...Y("Circle"),strokeWidth:2}),Preview:Xe(Bx,["clickable"]),zIndex:Vn},Z6={name:"Cylinder",key:"cylinder",Form:s6,Symbol:Hf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.cr.setAlpha(e.colors.gray.l1,0),...Y("cylinder"),dimensions:{width:66,height:181},...ae}),Preview:Zf,zIndex:Vn},K6={name:"Box",key:"box",Form:o6,Symbol:Nf,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.cr.setAlpha(e.colors.gray.l1,0),...Y("Box"),borderRadius:_6,strokeWidth:2,...ii,...ae}),Preview:Tf,zIndex:Vn},Y6={name:"Relief Valve",key:"reliefValve",Form:zt,Symbol:Rf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Relief Valve"),...Vt}),Preview:Xe(gx,["clickable"]),zIndex:G},W6={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:zt,Symbol:Cf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Spring Loaded Relief Valve"),...Vt}),Preview:Xe(hp,["clickable"]),zIndex:G},G6={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:zt,Symbol:wf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Spring Loaded Relief Valve"),...Vt}),Preview:Xe(gp,["clickable"]),zIndex:G},U6={name:"Regulator",key:"regulator",Form:xe,Symbol:km,defaultProps:e=>({color:e.colors.gray.l11,...Y("Regulator"),...ae}),Preview:$x,zIndex:G},X6={name:"Manual Regulator",key:"regulatorManual",Form:xe,Symbol:Lm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Regulator"),...ae}),Preview:Xe(zx,["clickable"]),zIndex:G},q6={name:"Electric Regulator",key:"electricRegulator",Form:xe,Symbol:Mm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator"),...ae}),Preview:np,zIndex:G},Q6={name:"Electric Regulator Motorized",key:"electricRegulatorMotorized",Form:xe,Symbol:Pm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator Motorized"),...ae}),Preview:sp,zIndex:G},J6={name:"Burst Disc",key:"burstDisc",Form:xe,Symbol:Nm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Burst Disc"),...ae}),Preview:Lx,zIndex:G},e9={name:"ISO Burst Disc",key:"isoBurstDisc",Form:xe,Symbol:Ym,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Burst Disc"),...ae}),Preview:Mx,zIndex:G},t9={name:"Cap",key:"cap",Form:xe,Symbol:Tm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cap"),...ae}),Preview:Px,zIndex:G},n9={name:"ISO Cap",key:"isoCap",Form:xe,Symbol:Im,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Cap"),...ae}),Preview:Nx,zIndex:G},s9={name:"Manual Valve",key:"manualValve",Form:zt,Symbol:bf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Valve"),...Vt}),Preview:Xe(Tx,["clickable"]),zIndex:G},o9={name:"Orifice Plate",key:"orificePlate",Form:xe,Symbol:Fm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Plate"),...ae}),Preview:Ix,zIndex:G},r9={name:"ISO Filter",key:"isoFilter",Form:xe,Symbol:Hm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Filter"),...ae}),Preview:xp,zIndex:G},i9={name:"Filter",key:"filter",Form:xe,Symbol:Am,defaultProps:e=>({color:e.colors.gray.l11,...Y("Filter"),...ae}),Preview:Ax,zIndex:G},l9={name:"Flow Straightener",key:"flowStraightener",Form:xe,Symbol:Zm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flow Straightener"),...ae}),Preview:pp,zIndex:G},a9={name:"Heater Element",key:"heaterElement",Form:xe,Symbol:Km,defaultProps:e=>({color:e.colors.gray.l11,...Y("Heater Element"),...ae}),Preview:mp,zIndex:G},c9={name:"Needle Valve",key:"needleValve",Form:zt,Symbol:Sf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Needle Valve"),...Vt}),Preview:Xe(Fx,["clickable"]),zIndex:G},u9={name:"Check Valve",key:"checkValve",Form:xe,Symbol:Om,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...ae}),Preview:jx,zIndex:G},d9={name:"Orifice",key:"orifice",Form:xe,Symbol:$m,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice"),...ae}),Preview:Vx,zIndex:G},x9={name:"Angled Relief Valve",key:"angledReliefValve",Form:zt,Symbol:vf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Relief Valve"),...Vt}),Preview:Xe(Hx,["clickable"]),zIndex:G},p9={name:"Value",key:"value",Form:GC,Symbol:Of,Preview:Df,defaultProps:e=>({color:e.colors.gray.l11,units:"psi",level:"h5",inlineSize:70,...Y("Value"),...ae,telem:C6.source,redline:Ir}),zIndex:G},m9={name:"Button",key:"button",Symbol:Bf,Form:QC,Preview:$f,defaultProps:e=>({color:e.colors.primary.z,...Y("Button"),...Gf,mode:"fire",onClickDelay:0,scale:null}),zIndex:G},f9={name:"Switch",key:"switch",Symbol:zm,Form:r6,defaultProps:()=>({...Y("Switch"),...we,scale:null}),Preview:Kx,zIndex:G},h9={name:"Vacuum Pump",key:"vacuumPump",Symbol:im,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vacuum Pump"),...we}),Preview:Xx,zIndex:G},g9={name:"Compressor",key:"compressor",Symbol:gm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Compressor"),...we}),Preview:Dp,zIndex:G},j9={name:"Cavity Pump",key:"cavityPump",Symbol:lm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cavity Pump"),...we}),Preview:qx,zIndex:G},E9={name:"Piston Pump",key:"pistonPump",Symbol:am,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Piston Pump"),...we}),Preview:Qx,zIndex:G},y9={name:"Static Mixer",key:"staticMixer",Symbol:Um,Form:xe,defaultProps:e=>({color:e.colors.gray.l11,...Y("Static Mixer"),...ae}),Preview:Jx,zIndex:G},S9={name:"Rotary Mixer",key:"rotaryMixer",Symbol:cm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Rotary Mixer"),...we}),Preview:ep,zIndex:G},R9={name:"Light",key:"light",Symbol:zf,Form:XC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Light"),...Wf}),Preview:tp,zIndex:G},C9={name:"Setpoint",key:"setpoint",Symbol:If,Form:e6,defaultProps:e=>({units:"mV",color:e.colors.gray.l11,size:"small",...Y("Setpoint"),...w6,...b6}),Preview:Af,zIndex:G},w9={name:"Agitator",key:"agitator",Symbol:um,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Agitator"),...we}),Preview:op,zIndex:G},b9={name:"Propeller Agitator",key:"propellerAgitator",Symbol:dm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Propeller Agitator"),...we}),Preview:rp,zIndex:G},v9={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:xm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flat Blade Agitator"),...we}),Preview:ip,zIndex:G},_9={name:"Paddle Agitator",key:"paddleAgitator",Symbol:pm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Paddle Agitator"),...we}),Preview:lp,zIndex:G},k9={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:mm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cross Beam Agitator"),...we}),Preview:ap,zIndex:G},L9={name:"Helical Agitator",key:"helicalAgitator",Symbol:fm,Form:Re,defaultProps:e=>({color:e.colors.gray.l11,...Y("Helical Agitator"),...we}),Preview:cp,zIndex:G},M9={name:"Text Box",key:"textBox",Symbol:Kf,Form:t6,defaultProps:e=>({color:e.colors.gray.l11,autoFit:!0,align:"center",...Y("Text Box"),...ae,...ii,level:"p",value:"Text Box",width:75}),Preview:Yf,zIndex:G},P9={name:"Off Page Reference",key:"offPageReference",Form:n6,Symbol:Vf,defaultProps:e=>({color:e.colors.gray.l11,orientation:"right",...Y("Off Page Reference")}),Preview:Ff,zIndex:G},N9={name:"ISO Check Valve",key:"isoCheckValve",Form:xe,Symbol:Dm,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Check Valve"),...ae}),Preview:Ex,zIndex:G},T9={name:"Check Valve Variant",key:"checkValveWithArrow",Form:xe,Symbol:Bm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...ae}),Preview:yx,zIndex:G},I9={name:"Vent",key:"vent",Form:xe,Symbol:Vm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vent"),...ae}),Preview:dp,zIndex:G},A9={name:"T Junction",key:"tJunction",Form:xe,Symbol:Wm,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...ae}),Preview:jp,zIndex:G+20},O9={name:"Cross Junction",key:"crossJunction",Form:xe,Symbol:Gm,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...ae}),Preview:Ep,zIndex:G+20},D9={name:"Flowmeter General",key:"flowmeterGeneral",Form:xe,Symbol:Xm,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Flowmeter"),...ae}),Preview:yp,zIndex:G},B9={name:"Flowmeter Electromagnetic",key:"flowmeterElectromagnetic",Form:xe,Symbol:qm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electromagnetic Flowmeter"),...ae}),Preview:Sp,zIndex:G},$9={name:"Flowmeter Variable Area",key:"flowmeterVariableArea",Form:xe,Symbol:Qm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Variable Area Flowmeter"),...ae}),Preview:Rp,zIndex:G},z9={name:"Flowmeter Coriolis",key:"flowmeterCoriolis",Form:xe,Symbol:Jm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Coriolis Flowmeter"),...ae}),Preview:Cp,zIndex:G},V9={name:"Flowmeter Nozzle",key:"flowmeterNozzle",Form:xe,Symbol:ef,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle Flowmeter"),...ae}),Preview:wp,zIndex:G},F9={name:"Flowmeter Venturi",key:"flowmeterVenturi",Form:xe,Symbol:tf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Venturi Flowmeter"),...ae}),Preview:bp,zIndex:G},H9={name:"Flowmeter Ring Piston",key:"flowmeterRingPiston",Form:xe,Symbol:nf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ring Piston Flowmeter"),...ae}),Preview:vp,zIndex:G},Z9={name:"Flowmeter Positive Displacement",key:"flowmeterPositiveDisplacement",Form:xe,Symbol:sf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Positive Displacement Flowmeter"),...ae}),Preview:_p,zIndex:G},K9={name:"Flowmeter Turbine",key:"flowmeterTurbine",Form:xe,Symbol:of,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbine Flowmeter"),...ae}),Preview:kp,zIndex:G},Y9={name:"Flowmeter Pulse",key:"flowmeterPulse",Form:xe,Symbol:rf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pulse Flowmeter"),...ae}),Preview:Lp,zIndex:G},W9={name:"Flowmeter Float Sensor",key:"flowmeterFloatSensor",Form:xe,Symbol:lf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Float Sensor Flowmeter"),...ae}),Preview:Mp,zIndex:G},G9={name:"Flowmeter Orifice",key:"flowmeterOrifice",Form:xe,Symbol:af,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Flowmeter"),...ae}),Preview:Pp,zIndex:G},U9={name:"Heat Exchanger General",key:"heatExchangerGeneral",Form:xe,Symbol:cf,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Heat Exchanger"),...ae}),Preview:Np,zIndex:G},X9={name:"Heat Exchanger M",key:"heatExchangerM",Form:xe,Symbol:uf,defaultProps:e=>({color:e.colors.gray.l11,...Y("M Heat Exchanger"),...ae}),Preview:Tp,zIndex:G},q9={name:"Heat Exchanger Straight Tube",key:"heatExchangerStraightTube",Form:xe,Symbol:df,defaultProps:e=>({color:e.colors.gray.l11,...Y("Straight Tube Heat Exchanger"),...ae}),Preview:Ip,zIndex:G},Q9={name:"Turbo Compressor",key:"turboCompressor",Form:Re,Symbol:jm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbo Compressor"),...we}),Preview:Bp,zIndex:G},J9={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:Re,Symbol:Em,defaultProps:e=>({color:e.colors.gray.l11,...Y("Roller Vane Compressor"),...we}),Preview:$p,zIndex:G},e7={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:Re,Symbol:ym,defaultProps:e=>({color:e.colors.gray.l11,...Y("Liquid Ring Compressor"),...we}),Preview:zp,zIndex:G},t7={name:"Ejector Compressor",key:"ejectorCompressor",Form:Re,Symbol:Sm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejector Compressor"),...we}),Preview:Vp,zIndex:G},n7={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:Re,Symbol:Rm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Centrifugal Compressor"),...we}),Preview:Fp,zIndex:G},s7={name:"Diaphragm Pump",key:"diaphragmPump",Form:Re,Symbol:om,defaultProps:e=>({color:e.colors.gray.l11,...Y("Diaphragm Pump"),...we}),Preview:Ap,zIndex:G},o7={name:"Ejection Pump",key:"ejectionPump",Form:Re,Symbol:rm,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejection Pump"),...we}),Preview:Op,zIndex:G},r7={name:"Flame Arrestor",key:"flameArrestor",Form:xe,Symbol:xf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor"),...ae}),Preview:Hp,zIndex:G},i7={name:"Flame Arrestor (Explosion-Proof)",key:"flameArrestorExplosion",Form:xe,Symbol:pf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Explosion-Proof)"),...ae}),Preview:Kp,zIndex:G},l7={name:"Flame Arrestor (Detonation-Proof)",key:"flameArrestorDetonation",Form:xe,Symbol:mf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Detonation-Proof)"),...ae}),Preview:Zp,zIndex:G},a7={name:"Flame Arrestor (Fire Resistant)",key:"flameArrestorFireRes",Form:xe,Symbol:ff,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant)"),...ae}),Preview:Yp,zIndex:G},c7={name:"Flame Arrestor (Fire Resistant and Detonation-Proof)",key:"flameArrestorFireResDetonation",Form:xe,Symbol:hf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...ae}),Preview:Wp,zIndex:G},u7={name:"Thruster",key:"thruster",Form:Re,Symbol:gf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Thruster"),...we}),Preview:Gp,zIndex:G},d7={name:"Nozzle",key:"nozzle",Form:xe,Symbol:jf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle"),...ae}),Preview:Up,zIndex:G},x7={name:"Strainer",key:"strainer",Form:xe,Symbol:Ef,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer"),...ae}),Preview:Xp,zIndex:G},p7={name:"Strainer Cone",key:"strainerCone",Form:xe,Symbol:yf,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer Cone"),...ae}),Preview:qp,zIndex:G},m7={value:p9,button:m9,tank:V6,polygon:F6,circle:H6,tJunction:A9,crossJunction:O9,switch:f9,offPageReference:P9,light:R9,setpoint:C9,box:K6,textBox:M9,valve:L6,solenoidValve:M6,threeWayValve:k6,fourWayValve:P6,angledValve:N6,ballValve:T6,threeWayBallValve:I6,gateValve:A6,butterflyValveOne:O6,butterflyValveTwo:D6,breatherValve:B6,manualValve:s9,needleValve:c9,reliefValve:Y6,angledReliefValve:x9,checkValve:u9,regulator:U6,regulatorManual:X6,electricRegulator:q6,electricRegulatorMotorized:Q6,springLoadedReliefValve:W6,angledSpringLoadedReliefValve:G6,pump:$6,pistonPump:E9,screwPump:z6,cavityPump:j9,diaphragmPump:s7,ejectionPump:o7,vacuumPump:h9,compressor:g9,turboCompressor:Q9,rollerVaneCompressor:J9,liquidRingCompressor:e7,ejectorCompressor:t7,centrifugalCompressor:n7,staticMixer:y9,rotaryMixer:S9,burstDisc:J6,isoBurstDisc:e9,cap:t9,isoCap:n9,filter:i9,isoFilter:r9,flowStraightener:l9,heaterElement:a9,orifice:d9,orificePlate:o9,agitator:w9,propellerAgitator:b9,flatBladeAgitator:v9,paddleAgitator:_9,crossBeamAgitator:k9,helicalAgitator:L9,isoCheckValve:N9,checkValveWithArrow:T9,vent:I9,cylinder:Z6,flowmeterGeneral:D9,flowmeterElectromagnetic:B9,flowmeterVariableArea:$9,flowmeterCoriolis:z9,flowmeterNozzle:V9,flowmeterVenturi:F9,flowmeterRingPiston:H9,flowmeterPositiveDisplacement:Z9,flowmeterTurbine:K9,flowmeterPulse:Y9,flowmeterFloatSensor:W9,flowmeterOrifice:G9,heatExchangerGeneral:U9,heatExchangerM:X9,heatExchangerStraightTube:q9,flameArrestor:r7,flameArrestorExplosion:i7,flameArrestorDetonation:l7,flameArrestorFireRes:a7,flameArrestorFireResDetonation:c7,thruster:u7,nozzle:d7,strainer:x7,strainerCone:p7},f7=Object.freeze(Object.defineProperty({__proto__:null,Agitator:um,AngledReliefValve:vf,AngledSpringLoadedReliefValve:wf,AngledValve:nm,BallValve:bm,Box:Nf,BoxPreview:Tf,BreatherValve:_f,BurstDisc:Nm,ButterflyValveOne:Cm,ButterflyValveTwo:wm,Button:Bf,ButtonPreview:$f,Cap:Tm,CavityPump:lm,CentrifugalCompressor:Rm,CheckValve:Om,CheckValveWithArrow:Bm,Circle:Pf,Compressor:gm,CrossBeamAgitator:mm,CrossJunction:Gm,Cylinder:Hf,CylinderPreview:Zf,DRAG_HANDLE_CLASS:Us,DiaphragmPump:om,EjectionPump:rm,EjectorCompressor:Sm,ElectricRegulator:Mm,ElectricRegulatorMotorized:Pm,Filter:Am,FlameArrestor:xf,FlameArrestorDetonation:mf,FlameArrestorExplosion:pf,FlameArrestorFireRes:ff,FlameArrestorFireResDetonation:hf,FlatBladeAgitator:xm,FlowStraightener:Zm,FlowmeterCoriolis:Jm,FlowmeterElectromagnetic:qm,FlowmeterFloatSensor:lf,FlowmeterGeneral:Xm,FlowmeterNozzle:ef,FlowmeterOrifice:af,FlowmeterPositiveDisplacement:sf,FlowmeterPulse:rf,FlowmeterRingPiston:nf,FlowmeterTurbine:of,FlowmeterVariableArea:Qm,FlowmeterVenturi:tf,FourWayValve:tm,GateValve:_m,HeatExchangerGeneral:cf,HeatExchangerM:uf,HeatExchangerStraightTube:df,HeaterElement:Km,HelicalAgitator:fm,ISOBurstDisc:Ym,ISOCap:Im,ISOCheckValve:Dm,ISOFilter:Hm,Light:zf,LiquidRingCompressor:ym,ManualValve:bf,NeedleValve:Sf,Nozzle:jf,OffPageReference:Vf,OffPageReferencePreview:Ff,Orifice:$m,OrificePlate:Fm,PaddleAgitator:pm,PistonPump:am,PolygonSymbol:Mf,PropellerAgitator:dm,Pump:sm,Regulator:km,RegulatorManual:Lm,ReliefValve:Rf,RollerVaneCompressor:Em,RotaryMixer:cm,SYMBOLS:m7,ScrewPump:hm,Setpoint:If,SetpointPreview:Af,SolenoidValve:em,SpringLoadedReliefValve:Cf,StaticMixer:Um,Strainer:Ef,StrainerCone:yf,Switch:zm,TJunction:Wm,Tank:kf,TankPreview:Lf,TextBox:Kf,TextBoxPreview:Yf,ThreeWayBallValve:vm,ThreeWayValve:Qp,Thruster:gf,Triangle:j6,TurboCompressor:jm,VacuumPump:im,Value:Of,ValuePreview:Df,Valve:Jp,Vent:Vm,createDummyToggle:St,createLabeled:ce,createToggle:Ce,variantZ:R6},Symbol.toStringTag,{value:"Module"}));exports.Aether=f.main;exports.Divider=f.Divider$2;exports.Generic=f.Generic;exports.Haul=f.Haul;exports.Worker=f.Context;exports.compareArrayDeps=f.compareArrayDeps;exports.preventDefault=f.preventDefault;exports.stopPropagation=f.stopPropagation;exports.useClickOutside=f.useClickOutside;exports.useCombinedRefs=f.useCombinedRefs;exports.useCombinedStateAndRef=f.useCombinedStateAndRef;exports.useEffectCompare=f.useEffectCompare;exports.useInitializerRef=f.useInitializerRef;exports.useMemoCompare=f.useMemoCompare;exports.useMemoDeepEqual=f.useMemoDeepEqual;exports.useMemoPrimitiveArray=f.useMemoPrimitiveArray;exports.usePrevious=f.usePrevious;exports.useRequiredContext=f.useRequiredContext;exports.useResize=f.useResize;exports.useStateRef=f.useStateRef;exports.useSyncedRef=f.useSyncedRef;exports.CSS=u.CSS;exports.DataType=u.n;exports.Density=u.d;exports.MultiSeries=u.Wt;exports.Rate=u.I;exports.Series=u.v;exports.TimeRange=u.w;exports.TimeSpan=u.i;exports.TimeStamp=u.r;exports.newBEM=u.newBEM;exports.state=A.state;exports.Button=qh.external;exports.Caret=$l.Animated$1;exports.telem=I.external;exports.Theming=_s.external;exports.Color=Ne.external;exports.useDebouncedCallback=Ne.useDebouncedCallback;exports.Triggers=Vl.external;exports.List=nt.external;exports.Dialog=Fl.external;exports.Input=Ie.external;exports.Flex=pe.external;exports.createHexOpacityVariants=Hl.createHexOpacityVariants;exports.unitProperty=Hl.unitProperty;exports.Header=Qh.external;exports.Menu=Jh.external;exports.Tabs=Me.external;exports.Text=eg.external;exports.Tree=tg.external;exports.Video=ng.Video;exports.Breadcrumb=Kg;exports.Canvas=r1;exports.Channel=C0;exports.Component=Ag;exports.Control=_2;exports.Device=N0;exports.Diagram=MC;exports.Direction=w0;exports.Eraser=kg;exports.Flux=u0;exports.Form=s0;exports.Icon=gg;exports.Label=lj;exports.Legend=d1;exports.Line=p1;exports.LinePlot=M1;exports.Log=NC;exports.Measure=I1;exports.Mosaic=wj;exports.Nav=Pg;exports.Note=vj;exports.OS=Hj;exports.Observe=X1;exports.Ontology=Bj;exports.Override=Kj;exports.Pluto=O2;exports.Portal=hj;exports.Progress=B2;exports.Rack=$0;exports.Range=N1;exports.Ranger=j2;exports.Resize=vg;exports.Rule=A1;exports.Schematic=f7;exports.Select=Fg;exports.Status=Ig;exports.Steps=z2;exports.Synnax=t0;exports.Table=K2;exports.TableCells=a3;exports.Tag=Og;exports.Task=q0;exports.Telem=C2;exports.Tooltip=jg;exports.Value=X2;exports.Viewport=k1;exports.Workspace=N2;exports.axis=e1;exports.control=t1;exports.proxyMemo=mg;exports.useAsyncEffect=It;exports.useDelayedState=fg;exports.useDestructors=ks;exports.useTransforms=hg;
|