@synnaxlabs/pluto 0.45.0 → 0.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/{Animated-EQN_Zecr.cjs → Animated-BT-w0cPF.cjs} +1 -1
  2. package/dist/{Animated-B9bcEALW.js → Animated-B_xTpw9g.js} +1 -1
  3. package/dist/{LinePlot-Do2q5AyX.cjs → LinePlot-De-VLJHL.cjs} +3 -3
  4. package/dist/{LinePlot-82qQ7-BC.js → LinePlot-mRCOU5PM.js} +98 -98
  5. package/dist/{Toggle-BNABJ5M2.js → Toggle-CzRMXK-K.js} +1 -1
  6. package/dist/{Toggle-BKrbt8lh.cjs → Toggle-DY4PmA0_.cjs} +1 -1
  7. package/dist/button.cjs +1 -1
  8. package/dist/button.js +1 -1
  9. package/dist/color.cjs +1 -1
  10. package/dist/color.js +1 -1
  11. package/dist/dialog.cjs +1 -1
  12. package/dist/dialog.js +1 -1
  13. package/dist/{eraser-DXDDmPgV.js → eraser-BcLVtorx.js} +2910 -2812
  14. package/dist/eraser-h8NIswGM.cjs +63 -0
  15. package/dist/ether.cjs +1 -1
  16. package/dist/ether.js +5 -5
  17. package/dist/{external-65blLb4-.js → external-BA4cUJmi.js} +1 -1
  18. package/dist/{external-BIykXq97.cjs → external-BBGCooyz.cjs} +1 -1
  19. package/dist/{external-SQa3Pr0s.js → external-BF3OTViJ.js} +2 -2
  20. package/dist/{external-Gh_0tAJ0.js → external-BNitHfU5.js} +2 -2
  21. package/dist/{external-_ninRYLQ.js → external-BY99QanC.js} +3 -3
  22. package/dist/{external-W69NXl-R.js → external-ByxpHVEA.js} +2 -2
  23. package/dist/{external-BKOEKFd7.js → external-C-0pnmB4.js} +2 -2
  24. package/dist/{external-BOvnkwzO.js → external-CBLyUVI_.js} +3 -3
  25. package/dist/{external-5DC2xiKR.cjs → external-CGbANgXa.cjs} +1 -1
  26. package/dist/{external-CGX7u75x.js → external-CJrxLSWV.js} +2 -2
  27. package/dist/{external-DWfn7Yhk.cjs → external-CMtT44YA.cjs} +1 -1
  28. package/dist/{external-CFsDBQGs.cjs → external-CNbPkF53.cjs} +1 -1
  29. package/dist/{external-J1Ji-Eku.js → external-CbHzHgtw.js} +2 -2
  30. package/dist/external-CiJ7RsGt.cjs +1 -0
  31. package/dist/{external-DCQ725nK.cjs → external-D2VXaXzu.cjs} +1 -1
  32. package/dist/{external-CPW2TrSs.js → external-DNwQ_1PT.js} +2 -2
  33. package/dist/{external-Bqmws2bv.cjs → external-DYC1EK6G.cjs} +1 -1
  34. package/dist/{external-DLo-151g.js → external-D_PgcvDj.js} +2 -2
  35. package/dist/{external-mOr1FzAd.cjs → external-Dl5JyJaH.cjs} +1 -1
  36. package/dist/{external-DTLy0px_.js → external-Du8Z1FRh.js} +2 -2
  37. package/dist/{external-kaUzEm1U.cjs → external-DynvKrxv.cjs} +1 -1
  38. package/dist/{external-BSeWLcfY.js → external-DzuRmcYi.js} +3 -3
  39. package/dist/{external-CijGOPm7.cjs → external-ETemCKjS.cjs} +1 -1
  40. package/dist/{external-BEkAplsH.cjs → external-S6GiiOBy.cjs} +1 -1
  41. package/dist/{external-CJKfUQ-9.cjs → external-aXmXhGMj.cjs} +1 -1
  42. package/dist/{external-B8KPEzPt.cjs → external-zzhrikgD.cjs} +1 -1
  43. package/dist/flex.cjs +1 -1
  44. package/dist/flex.js +1 -1
  45. package/dist/{fontString-D_jEa-uI.js → fontString-B3WuZ-o6.js} +1 -1
  46. package/dist/{fontString-4EFXWlQp.cjs → fontString-C4QgiFXy.cjs} +1 -1
  47. package/dist/header.cjs +1 -1
  48. package/dist/header.js +1 -1
  49. package/dist/index.cjs +5 -5
  50. package/dist/index.js +30 -30
  51. package/dist/input.cjs +1 -1
  52. package/dist/input.js +1 -1
  53. package/dist/list.cjs +1 -1
  54. package/dist/list.js +1 -1
  55. package/dist/{main-2qH2bggR.cjs → main-DCvw0wt3.cjs} +3 -3
  56. package/dist/{main-jKCzbrWn.js → main-mGfIFfsW.js} +1 -1
  57. package/dist/menu.cjs +1 -1
  58. package/dist/menu.js +1 -1
  59. package/dist/tabs.cjs +1 -1
  60. package/dist/tabs.js +1 -1
  61. package/dist/text.cjs +1 -1
  62. package/dist/text.js +2 -2
  63. package/dist/theming.cjs +1 -1
  64. package/dist/theming.js +2 -2
  65. package/dist/tree.cjs +1 -1
  66. package/dist/tree.js +1 -1
  67. package/dist/triggers.cjs +1 -1
  68. package/dist/triggers.js +1 -1
  69. package/package.json +6 -6
  70. package/dist/eraser-C1jjA5cv.cjs +0 -63
  71. package/dist/external-DcNW5o-8.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("./main-2qH2bggR.cjs"),r=require("./jsx-runtime-CITbqOLs.cjs"),j=require("react"),u=require("./css-CmXY6iPo.cjs"),L=require("./eraser-C1jjA5cv.cjs"),Cf=require("./external-DcNW5o-8.cjs"),ql=require("./Animated-EQN_Zecr.cjs"),Ql=require("react-dom"),O=require("./LinePlot-Do2q5AyX.cjs"),Ps=require("./external-CFsDBQGs.cjs"),ne=require("zod"),_e=require("./external-kaUzEm1U.cjs"),Jl=require("./external-DCQ725nK.cjs"),nt=require("./external-mOr1FzAd.cjs"),ea=require("./external-BIykXq97.cjs"),Ae=require("./external-CijGOPm7.cjs"),pe=require("./external-CJKfUQ-9.cjs"),ta=require("./units-DkdMPsxa.cjs"),bf=require("./external-Bqmws2bv.cjs"),wf=require("./external-BEkAplsH.cjs"),Me=require("./external-B8KPEzPt.cjs"),vf=require("./external-5DC2xiKR.cjs"),kf=require("./external-DWfn7Yhk.cjs"),_f=require("./Video-CgaO8bTm.cjs"),na=require("./Toggle-BKrbt8lh.cjs"),Lf=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),Tf=e=>ne.array(e).or(e.transform(t=>[t])),sa=e=>L.p(e,(t,n,s)=>{const o=n===s.length-1,i=!isNaN(parseInt(t)),l=!isNaN(parseInt(s[n+1]));return i&&(t="element"),o||l?t:[t,"shape"]}),bi=(e,t)=>{if(e==null)return null;const n=e[t];return n==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:n},Mf=(e,t,n)=>t===""?e:L.c(bi(e,"shape"),sa(t),{...n,getter:bi}),Nf=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:Mf,getFieldSchemaPath:sa,nullToUndefined:Lf,toArray:Tf},Symbol.toStringTag,{value:"Module"})),oa=Symbol(),rr=Symbol(),pn="a",is="w";let Pf=(e,t)=>new Proxy(e,t);const To=Object.getPrototypeOf,wi=new WeakMap,ir=e=>e&&(wi.has(e)?wi.get(e):To(e)===Object.prototype||To(e)===Array.prototype),vi=e=>typeof e=="object"&&e!==null,ki=new WeakMap,ra=e=>e[rr]||e,ia=(e,t,n)=>{if(!ir(e))return e;const s=ra(e),o=(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===o||(i=((l,a)=>{const c={f:a};let d=!1;const x=(m,h)=>{if(!d){let g=c[pn].get(l);if(g||(g={},c[pn].set(l,g)),m===is)g[is]=!0;else{let E=g[m];E||(E=new Set,g[m]=E),E.add(h)}}},p={get:(m,h)=>h===rr?l:(x("k",h),ia(Reflect.get(m,h),c[pn],c.c)),has:(m,h)=>h===oa?(d=!0,c[pn].delete(l),!0):(x("h",h),Reflect.has(m,h)),getOwnPropertyDescriptor:(m,h)=>(x("o",h),Reflect.getOwnPropertyDescriptor(m,h)),ownKeys:m=>(x(is),Reflect.ownKeys(m))};return a&&(p.set=p.deleteProperty=()=>!1),[p,c]})(s,o),i[1].p=Pf(o?(l=>{let a=ki.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(To(l),c)}ki.set(l,a)}return a})(s):s,i[0]),n&&n.set(s,i)),i[1][pn]=t,i[1].c=n,i[1].p},la=(e,t,n,s)=>{if(Object.is(e,t))return!1;if(!vi(e)||!vi(t))return!0;const o=n.get(ra(e));if(!o)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 o.h||[])if(i=Reflect.has(e,l)!==Reflect.has(t,l),i)return i;if(o[is]===!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 o.o||[])if(i=!!Reflect.getOwnPropertyDescriptor(e,l)!=!!Reflect.getOwnPropertyDescriptor(t,l),i)return i;for(const l of o.k||[])if(i=la(e[l],t[l],n,s),i)return i;return i===null&&(i=!0),i}finally{s&&s.set(e,{n:t,g:i})}},Af=e=>!!ir(e)&&oa in e,aa=e=>ir(e)&&e[rr]||null,Of="h",If="w",Df="o",Bf="k",Mo=e=>typeof e=="object"&&e!==null,ca=(e,t)=>{if(!Mo(e))return e;const n=aa(e);return n!==null?(Af(e),n):(t.has(e)||(t.add(e),Object.entries(e).forEach(([s,o])=>{const i=ca(o,t);Object.is(i,o)||(e[s]=i)})),e)},No=(e,t,n)=>{var s,o,i;if(!Mo(e)||!Mo(t))return;const l=n.get(aa(t)||t);l&&((s=l[Of])==null||s.forEach(a=>{Reflect.has(e,a)}),l[If]===!0&&Reflect.ownKeys(e),(o=l[Df])==null||o.forEach(a=>{Reflect.getOwnPropertyDescriptor(e,a)}),(i=l[Bf])==null||i.forEach(a=>{No(e[a],t[a],n)}))},lo="o",ao="r",co="a";function $f(e,t){var n;let s=0;const o=(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[ao];for(let g=0;g<o;g+=1){const E=i[(s+g)%o];if(!E)break;if(!la(E[lo],c,E[co],new WeakMap))return No(c,E[lo],E[co]),l?.set(c,E),E[ao]}const x=new WeakMap,p=ia(c,x),m=ca(e(p),new Set);No(c,c,x);const h={[lo]:c,[ao]:m,[co]:x};return s=(s-1+o)%o,i[s]=h,l?.set(c,h),m}}const zf=(e,t)=>u.S.RUNTIME==="browser"?$f(e,t):e,It=(e,t)=>{j.useEffect(()=>{const n=new AbortController,s=n.signal,i=(async()=>(await u.pr(),await e(s)))().catch(console.error);return()=>{n.abort(),i.then(l=>l?.()).catch(console.error)}},t)},Vf=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,CSV:f.CSV,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,DarkMode:f.DarkMode,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,FillColor:f.FillColor,Filter:f.Filter,Fitting:f.Fitting,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,LightMode:f.LightMode,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,Process:f.Process,Pump:f.Pump,Python:f.Python,QuestionMark:f.QuestionMark,Rack:f.Rack,Range:f.Range,Reference:f.Reference,Refresh:f.Refresh,Release:f.Release,Rename:f.Rename,Reset:f.Reset,Resources:f.Resources,Rotate:f.Rotate,Rule:f.Rule,Safety:f.Safety,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,StrokeColor:f.StrokeColor,StrokeWidth:f.StrokeWidth,Subtract:f.Subtract,Sync:f.Sync,Table:f.Table,Tank:f.Tank,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,Valve:f.Valve,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"})),Ff=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"})),lr=({ref:e,location:t,style:n,size:s,className:o,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.p.dimension(p);return r.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("resize"),u.CSS.loc(x),o),style:{[m]:`${s}${a}`,...n},ref:e,direction:p,empty:!0,...d,children:[i,c&&r.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})]})},ua=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:o="x"})=>{const i=j.useRef(null),[l,a]=j.useState({sizeDistribution:Hf(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),o);a(E=>xo(E,g,p,s,m,h))},[s,a,o]);j.useEffect(()=>e?.(l.sizeDistribution),[l.sizeDistribution,e]);const d=j.useCallback((p,m)=>{p.preventDefault();const h=o==="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,o,xo]);return{setSize:j.useCallback((p,m)=>c(p,void 0,m),[xo]),props:{direction:o,sizeDistribution:l.sizeDistribution,onDragHandle:d,ref:i}}},da=({ref:e,direction:t="x",children:n,sizeDistribution:s,onDragHandle:o,className:i,...l})=>{const a=u.p.construct(t),c=j.Children.toArray(n);return s=Zf(s),r.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)=>r.jsxRuntimeExports.jsx(lr,{onDragStart:p=>o(p,x),location:u.p.location(a),size:s[x]*100,sizeUnits:"%",showHandle:x!==c.length-1,children:d},x))})},Hf=(e,t)=>{const n=e.reduce((o,i)=>o+i,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(o=>o/n);if(e.every(o=>o<=1)){const o=1-n;return[...e,...Array(s).fill(o/s)]}return e.map(()=>1/t)},uo=.001,Zf=e=>e.every(t=>u.cr.closeTo(t,1/e.length),uo)?e.map((t,n)=>n%2===0?t+uo:n===e.length-1?t:t-uo):e,xo=(e,t,n,s,o,i)=>{const l=xa(e,t,n,o,i),[a,c]=Kf(e.sizeDistribution,n,l,s/t),d=c?o??null:e.root;return{...e,sizeDistribution:a,root:d}},xa=(e,t,n,s,o)=>{let i;if(o!=null)o>1&&(o/=t),i=o-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},Kf=(e,t,n,s)=>{let o=t;for(;o>0&&e[o]+n<=s;)o--;const i=e[o]+n,l=Yf(o,e,s,n),a=e[l]-n;return i<s||a<s?[e,!1]:[e.map((c,d)=>d===o?i:d===l?a:c),!0]},Yf=(e,t,n,s)=>(e===t.length-1?Uf:Gf)(e,t,n,s),Gf=(e,t,n,s)=>{let o=e+1;for(;o<t.length-1&&t[o]-s<=n;)o++;return o},Uf=(e,t,n,s)=>{let o=e-1;for(;o>0&&t[o]-s<=n;)o--;return o},po=2,Wf=100,pa=({onCollapse:e,onResize:t,location:n="left",minSize:s,maxSize:o,initialSize:i=200,collapseThreshold:l=1/0,className:a,...c})=>{const[d,x]=j.useState(u.R(i,s,o)),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))),k=p.current+C,T=u.R(k,s,o);return(T-k)/(s??Wf)>l?po:T},[m,s,o,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)===po&&e?.(),[e,h]);j.useEffect(()=>{s==null||o==null||x(y=>{const C=u.R(y,s,o);return p.current=C,C})},[s,o]);const v=_e.useCursorDrag({onMove:E,onStart:S,onEnd:R});return r.jsxRuntimeExports.jsx(lr,{ref:g,location:m,size:d,onDragStart:v,className:u.clsx(a,u.CSS.expanded(d!==po)),...c})},Xf=Object.freeze(Object.defineProperty({__proto__:null,Core:lr,Multiple:da,Single:pa,calculateDiffPercentage:xa,useMultiple:ua},Symbol.toStringTag,{value:"Module"})),ar=({aetherKey:e,enabled:t=!0})=>{const{setState:n}=f.useLifecycle({aetherKey:e,type:L.Eraser.TYPE,schema:L.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])}},qf=({aetherKey:e,children:t})=>{const{erase:n}=ar({aetherKey:e}),s=f.useResize(n);return r.jsxRuntimeExports.jsx("div",{ref:s,className:u.CSS(u.CSS.inheritDims()),children:t})},Qf=Object.freeze(Object.defineProperty({__proto__:null,Eraser:qf,use:ar},Symbol.toStringTag,{value:"Module"})),Jf=({items:e,initialKey:t})=>{const[n,s]=j.useState(t),o=l=>s(l===n?void 0:l),i=e.find(l=>l.key===n);return{onSelect:o,activeItem:i}},eh=({activeItem:e,children:t,onSelect:n,location:s="left",collapseThreshold:o=.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}=ar({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 r.jsxRuntimeExports.jsx(pa,{className:u.CSS(u.CSS.B("nav-drawer"),u.CSS.dir(x),u.CSS.visible(e!=null),i),collapseThreshold:o,onCollapse:p,location:s,onResize:h,minSize:E,maxSize:S,initialSize:R,...d,children:g})},th=Object.freeze(Object.defineProperty({__proto__:null,Bar:f.Bar,Drawer:eh,useDrawer:Jf},Symbol.toStringTag,{value:"Module"})),cr={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)"},ur=({variant:e,...t})=>e==="loading"?r.jsxRuntimeExports.jsx(f.Loading,{...t}):r.jsxRuntimeExports.jsx(f.Circle,{color:e!=null?cr[e]:void 0,...t}),nh=({action:e})=>j.isValidElement(e)?e:j.createElement(f.Button,{...e,key:e.key,size:"tiny"}),sh=({status:{key:e,time:t,count:n,message:s,description:o,variant:i},silence:l,actions:a,className:c,children:d,...x})=>{const p=j.useRef(null);return r.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("notification"),c),y:!0,empty:!0,ref:p,...x,children:[r.jsxRuntimeExports.jsxs(f.Box,{x:!0,justify:"between",grow:!0,style:{width:"100%"},children:[r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",gap:"small",children:[r.jsxRuntimeExports.jsx(ur,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:`x${n}`}),r.jsxRuntimeExports.jsx(f.DateTime,{className:u.CSS(u.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),r.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:r.jsxRuntimeExports.jsx(f.Close,{})})]}),r.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"start",className:u.CSS(u.CSS.BE("notification","content")),gap:"small",children:[d??r.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","message")),style:{flexGrow:1},children:s}),o!=null&&r.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),a!=null&&r.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",justify:"end",className:u.CSS(u.CSS.BE("notification","actions")),children:L.t.toArray(a).map(m=>r.jsxRuntimeExports.jsx(nh,{action:m},m.key))})]},t.toString())},oh=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:f.Aggregator,Indicator:ur,Notification:sh,Summary:f.Summary,VARIANT_COLORS:cr,useAdder:f.useAdder,useAsyncErrorHandler:f.useAsyncErrorHandler,useErrorHandler:f.useErrorHandler,useNotifications:f.useNotifications},Symbol.toStringTag,{value:"Module"})),ma=e=>e==="preview"?"connected":e,fa=e=>e==="preview"?"preview":void 0,As=({resourceName:e,value:t,onChange:n,data:s,getItem:o,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:k="connected",...T})=>r.jsxRuntimeExports.jsx(f.Frame,{variant:ma(k),...T,children:r.jsxRuntimeExports.jsxs(f.Frame$1,{multiple:!0,value:t,onChange:n,data:s,getItem:o,subscribe:i,onFetchMore:m,allowNone:S,replaceOnSingle:R,virtual:y,children:[r.jsxRuntimeExports.jsx(ga,{haulType:l,icon:a,placeholder:`Select ${e}s`,disabled:c,variant:fa(k),...v,children:g}),r.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:d,emptyContent:x,status:p,actions:E,resourceName:e,...C,children:h})]})}),Qe=(e,t)=>{const n={};t.forEach(o=>n[o]=void 0);const s=o=>{const{...i}={...o,...n};return r.jsxRuntimeExports.jsx(e,{...i})};return s.displayName=`RemoveProps(${e.displayName})`,s},ha=e=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:L.SIZES,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"tiny",children:"S"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"small",children:"M"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"medium",children:"L"})]}),rh=Object.freeze(Object.defineProperty({__proto__:null,SIZES:L.SIZES,SelectSize:ha,isRenderProp:f.isRenderProp,isSize:L.isSize,removeProps:Qe,renderProp:f.renderProp,size:L.size},Symbol.toStringTag,{value:"Module"})),Os=({children:e="",size:t="medium",color:n,icon:s,onClose:o,className:i,onDragStart:l,...a})=>{const c=u.fr.cssString(n);s==null&&n!=null&&(s=r.jsxRuntimeExports.jsx(f.Circle,{color:c}));const d=o==null?void 0:r.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(),o()},children:r.jsxRuntimeExports.jsx(f.Close,{})});return r.jsxRuntimeExports.jsxs(f.Button,{el:"div",className:u.CSS(i,u.CSS.B("tag"),o!=null&&u.CSS.BM("tag","closeable")),size:t,overflow:"nowrap",align:"center",gap:"small",onDragStart:l,...a,children:[s,d,e]})},dr=({children:e,onClick:t,variant:n="outlined",size:s="medium",...o})=>r.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,...o,children:e}),ih=Object.freeze(Object.defineProperty({__proto__:null,Tag:Os,Tags:dr},Symbol.toStringTag,{value:"Module"})),lh=({itemKey:e,icon:t,onDragStart:n})=>{const s=f.useItem(e),{onSelect:o}=f.useItemState(e);return r.jsxRuntimeExports.jsx(Os,{onClose:o,onDragStart:()=>n(e),draggable:!0,size:"small",status:s==null?"error":void 0,icon:s?.icon??t,children:s?.name??e})},ah=f.renderProp(lh),xr=({items:e},t,n,s)=>{if(t===""||s===!0)return!1;const o=f.filterByType(t,e);return o.length>0&&!o.every(i=>n.includes(i.key))},ga=({haulType:e="",disabled:t,placeholder:n="Select...",variant:s="outlined",icon:o,children:i=ah})=>{const l=f.useSelection(),a=f.useSyncedRef(l),{setSelected:c}=f.useContext$3(),{toggle:d,visible:x}=f.useContext$2(),p=j.useCallback(v=>xr(v,e,L.t.toArray(l),t),[e,l,t]),{startDrag:m,...h}=f.useDragAndDrop({type:e,canDrop:p,onDrop:f.useFilterByTypeCallback(e,({items:v})=>{const y=L.t.toArray(a.current);return c(u.c.unique([...L.t.toArray(y),...v.map(C=>C.key)])),v},[c])}),g=j.useCallback(({dropped:v})=>{const y=l.filter(C=>!v.some(k=>k.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 r.jsxRuntimeExports.jsxs(dr,{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&&r.jsxRuntimeExports.jsxs(f.Text,{color:8,weight:400,style:{padding:"0 1rem"},children:[o,n]}),l.map(v=>i({key:v,itemKey:v,onDragStart:E,icon:o})),s!=="text"&&r.jsxRuntimeExports.jsx(ql.Animated,{className:u.CSS.level("p"),enabled:x,enabledLoc:"bottom",disabledLoc:"left",color:8}),R&&r.jsxRuntimeExports.jsx(f.Button,{variant:s,onClick:v=>{v.stopPropagation(),d()},children:r.jsxRuntimeExports.jsx(f.Add,{color:8})})]})},Dt=({resourceName:e,onChange:t,value:n,allowNone:s,emptyContent:o,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:k=!0,...T})=>r.jsxRuntimeExports.jsx(f.Frame,{...T,variant:ma(S),children:r.jsxRuntimeExports.jsxs(f.Frame$1,{value:n,onChange:t,data:l,getItem:a,subscribe:c,allowNone:s,onFetchMore:x,itemHeight:d,virtual:C,closeDialogOnSelect:k,children:[r.jsxRuntimeExports.jsx(ja,{haulType:i,icon:g,placeholder:`Select a ${e}`,disabled:p,variant:fa(S),...y}),r.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:m,resourceName:e,emptyContent:o,status:h,actions:R,...v,children:E})]})}),ja=({haulType:e="",placeholder:t,icon:n,disabled:s,iconOnly:o=!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=>xr(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 r.jsxRuntimeExports.jsxs(ea.Trigger,{variant:"outlined",gap:"small",className:u.CSS(u.CSS.dropRegion(h(E))),disabled:s,...g,...l,hideCaret:i||o,textColor:p==null?8:void 0,children:[m??n,!o&&(p??t)]})},ch=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);if(n==null)return null;const{name:s,icon:o}=n;return r.jsxRuntimeExports.jsxs(f.ListItem,{...e,children:[o,s]})}),An=({data:e,filter:t,children:n=ch,virtual:s=!1,...o})=>{const{retrieve:i,...l}=f.useStaticData({data:e,filter:t}),{search:a}=nt.usePager({retrieve:i});return r.jsxRuntimeExports.jsx(Dt,{...o,...l,onSearch:a,virtual:s,children:n})},ln=e=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:L.LEVELS,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h2",square:!0,children:"XL"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h3",square:!0,children:"L"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h4",square:!0,children:"M"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h5",square:!0,children:"S"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"small",square:!0,children:"XS"})]}),uh=[250,400,500,600],Ea=e=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:uh,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:250,children:"Light"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:400,children:"Normal"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:500,children:"Medium"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:600,children:"Bold"})]}),dh=Object.freeze(Object.defineProperty({__proto__:null,Level:ln,Weight:Ea},Symbol.toStringTag,{value:"Module"})),xh=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:As,MultipleTrigger:ga,Single:Dt,SingleTrigger:ja,Static:An,Text:dh,staticCanDrop:xr,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"})),ph=f.useVirtualCursorDragWebKit,Is=()=>{const e=j.useRef([]),t=j.useMemo(()=>({cleanup:()=>{e.current.forEach(n=>n()),e.current=[]},set:n=>{n!=null&&e.current.push(...L.t.toArray(n))}}),[]);return j.useEffect(()=>t.cleanup,[t.cleanup]),t},mh=()=>r.jsxRuntimeExports.jsx(f.Caret.Right,{className:u.CSS.BE("breadcrumb","separator")}),Cn=({children:e,...t})=>r.jsxRuntimeExports.jsx(f.Text,{className:u.CSS.BE("breadcrumb","segment"),...t,defaultEl:"span",children:e}),pr=({children:e,highlightVariant:t,...n})=>r.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,o)=>s==null||typeof s=="boolean"?null:r.jsxRuntimeExports.jsxs(j.Fragment,{children:[o>0&&r.jsxRuntimeExports.jsx(mh,{}),typeof s=="string"?r.jsxRuntimeExports.jsx(Cn,{children:s}):s]},o))}),fh=(e,t)=>{const n=e.split("/");return n.map((s,o)=>t({href:n.slice(0,o+1).join("/"),segment:s,index:o}))},hh=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:pr,Segment:Cn,mapURLSegments:fh},Symbol.toStringTag,{value:"Module"})),gh=({channelKey:e,rangeKey:t,shadow:n,className:s,...o})=>{const{value:i,onChange:l}=o,[a,c]=j.useState(!1),{update:d}=uc.useDirect({params:{rangeKey:t,channelKey:e}}),{data:x}=Mr.useDirect({params:{key:e,rangeKey:t}}),p=async C=>{d(C)},m=x?.alias,h=x?.alias??x?.name;let g=r.jsxRuntimeExports.jsx(f.Rename,{});a?g=r.jsxRuntimeExports.jsx(f.Loading,{}):m===i&&(g=r.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?r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):p==null?r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):i.length===0?r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):m===i?r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Alias synced with this label"}):r.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Sync alias for ",h," with this label"]});return r.jsxRuntimeExports.jsxs(f.Text$2,{selectOnFocus:!0,...o,children:[E&&r.jsxRuntimeExports.jsx(f.Button,{onClick:v,tooltip:r.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Set ",h," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:r.jsxRuntimeExports.jsx(f.Sync,{})}),r.jsxRuntimeExports.jsx(f.Button,{onClick:R,disabled:!E,tooltip:y,tooltipLocation:{y:"top"},variant:"outlined",children:g})]})},kt="channel";var _i=180/Math.PI,Po={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ya(e,t,n,s,o,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:o,translateY:i,rotate:Math.atan2(t,e)*_i,skewX:Math.atan(c)*_i,scaleX:l,scaleY:a}}var Wn;function jh(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Po:ya(t.a,t.b,t.c,t.d,t.e,t.f)}function Eh(e){return e==null||(Wn||(Wn=document.createElementNS("http://www.w3.org/2000/svg","g")),Wn.setAttribute("transform",e),!(e=Wn.transform.baseVal.consolidate()))?Po:(e=e.matrix,ya(e.a,e.b,e.c,e.d,e.e,e.f))}function Sa(e,t,n,s){function o(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:O.interpolateNumber(d,p)},{i:E-2,x:O.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(o(p)+"rotate(",null,s)-2,x:O.interpolateNumber(d,x)})):x&&p.push(o(p)+"rotate("+x+s)}function a(d,x,p,m){d!==x?m.push({i:p.push(o(p)+"skewX(",null,s)-2,x:O.interpolateNumber(d,x)}):x&&p.push(o(p)+"skewX("+x+s)}function c(d,x,p,m,h,g){if(d!==p||x!==m){var E=h.push(o(h)+"scale(",null,",",null,")");g.push({i:E-4,x:O.interpolateNumber(d,p)},{i:E-2,x:O.interpolateNumber(x,m)})}else(p!==1||m!==1)&&h.push(o(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 yh=Sa(jh,"px, ","px)","deg)"),Sh=Sa(Eh,", ",")",")"),Rh=1e-12;function Li(e){return((e=Math.exp(e))+1/e)/2}function Ch(e){return((e=Math.exp(e))-1/e)/2}function bh(e){return((e=Math.exp(2*e))-1)/(e+1)}const ls=function e(t,n,s){function o(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<Rh)R=Math.log(m/d)/t,S=function(P){return[a+P*h,c+P*g,d*Math.exp(t*P*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),k=Math.log(Math.sqrt(y*y+1)-y),T=Math.log(Math.sqrt(C*C+1)-C);R=(T-k)/t,S=function(P){var I=P*R,B=Li(k),F=d/(n*v)*(B*bh(t*I+k)-Ch(k));return[a+F*h,c+F*g,d*B/Li(t*I+k)]}}return S.duration=R*1e3*t/Math.SQRT2,S}return o.rho=function(i){var l=Math.max(.001,+i),a=l*l,c=a*a;return e(l,a,c)},o}(Math.SQRT2,2,4),wh=Object.freeze(Object.defineProperty({__proto__:null,Base:O.Base,Bottom:O.Bottom,Right:O.Right,Top:O.Top,axisStateZ:O.axisStateZ,newCanvas:O.newCanvas,newTickFactory:O.newTickFactory,tickFactoryProps:O.tickFactoryProps,tickType:O.tickType},Symbol.toStringTag,{value:"Module"})),vh=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:O.AcquireChannelControl,AuthoritySource:O.AuthoritySource,Chip:O.Chip,Controller:O.Controller,Indicator:O.Indicator,Legend:O.Legend,REGISTRY:O.REGISTRY$15,STATUSES:O.STATUSES,SetChannelValue:O.SetChannelValue,StateProvider:O.StateProvider,acquireChannelControl:O.acquireChannelControl,acquireChannelControlPropsZ:O.acquireChannelControlPropsZ,authoritySource:O.authoritySource,authoritySourceDetailsZ:O.authoritySourceDetailsZ,authoritySourceProps:O.authoritySourceProps,chipStateZ:O.chipStateZ,chipStatusDetailsZ:O.chipStatusDetailsZ,controllerStateZ:O.controllerStateZ,indicatorStateZ:O.indicatorStateZ,indicatorStatusDetailsZ:O.indicatorStatusDetailsZ,legendStateZ:O.legendStateZ,setChannelValue:O.setChannelValue,setChannelValuePropsZ:O.setChannelValuePropsZ,stateProviderStateZ:O.stateProviderStateZ,statusZ:O.statusZ,sugaredStateZ:O.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),kh={region:u.Ho.ZERO,dpr:1,os:u.S.getOS()},_h={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Lh=({children:e,resizeDebounce:t=100,className:n,...s})=>{const[{path:o},{bootstrapped:i,dpr:l},a]=f.use$2({type:O.Canvas.TYPE,schema:O.canvasStateZ,initialState:kh}),c=j.useRef({..._h}),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(),k=v.transferControlToOffscreen(),T=R.transferControlToOffscreen();a({glCanvas:C,upper2dCanvas:k,lower2dCanvas:T,bootstrap:!0,bootstrapped:!1,region:u.Ho.construct(S),dpr:window.devicePixelRatio,os:u.S.getOS({default:"Windows"})},[C,k,T])},[a]);return r.jsxRuntimeExports.jsxs("div",{ref:h,className:u.CSS(u.CSS.B("canvas-container"),n),...s,children:[r.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","lower2d"))}),r.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","gl"))}),r.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","upper2d"))}),r.jsxRuntimeExports.jsx(f.Composite,{path:o,children:i&&e})]})},On=(e,t)=>f.useResize(j.useCallback((n,s)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(u.C.XY.translate(u.K.scale(u.Ho.topLeft(o),-1)).box(n),s)},[e]),t),Th=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Lh,useRegion:On},Symbol.toStringTag,{value:"Module"})),Ra=j.createContext(null),ct=e=>{const t=j.use(Ra);if(t==null)throw new Error(`Cannot use ${e} as a non-child of LinePlot.`);return t},Ca=e=>{const{addViewportHandler:t}=ct("Viewport");j.useEffect(()=>t(e),[t,e])},In=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=ct(t),{key:o}=e;return f.useEffectCompare(()=>{u.K$1.outer.parse(e.loc),n(e)},([a],[c])=>L.N.equal(a,c),[e]),j.useEffect(()=>()=>s(o),[]),{gridArea:u.p.swap(u.K$1.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},ba=({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=u.K.ZERO,children:o,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:O.LinePlot.TYPE,schema:O.linePlotStateZ,initialState:{container:u.Ho.ZERO,viewport:u.Ho.DECIMAL,grid:{},...p}}),E=j.useCallback(D=>{a&&g(z=>({...z,container:D}))},[g,a]),S=On(E,{debounce:n});j.useEffect(()=>g(D=>({...D,...p})),[p]);const R=j.useRef(new Map),v=j.useCallback(D=>(R.current.set(D,null),()=>R.current.delete(D)),[R]),y=j.useCallback(D=>{const{mode:z,box:b,stage:N}=D;(z==="pan"&&N!=="start"||z==="zoom"||z==="zoomReset"&&N==="start")&&g(_=>({..._,viewport:b})),R.current.forEach((_,M)=>M(D))},[g]),C=j.useCallback(D=>{g(z=>({...z,grid:{...z.grid,[D.key]:D}}))},[g]),k=j.useCallback(D=>g(z=>{const{[D]:b,...N}=z.grid;return{...z,grid:N}}),[g]),T=j.useCallback(D=>{x(z=>[...z.filter(({key:b})=>b!==D.key),D])},[x]),P=j.useCallback(D=>x(z=>z.filter(({key:b})=>b!==D)),[T]),I=j.useMemo(()=>Mh(h),[h]),B=j.useCallback(D=>{g(z=>({...z,hold:D})),l?.(D)},[g,l]),F=`line-plot-${e}`,$=j.useMemo(()=>({lines:d,setGridEntry:C,removeGridEntry:k,setLine:T,removeLine:P,setViewport:y,addViewportHandler:v,setHold:B,id:F}),[F,d,C,k,T,P,y,v,B]);return r.jsxRuntimeExports.jsx("div",{id:F,className:u.CSS.B("line-plot"),style:{...t,...I},ref:S,...c,children:r.jsxRuntimeExports.jsx(Ra,{value:$,children:r.jsxRuntimeExports.jsx(f.Composite,{path:m,children:o})})})},Mh=e=>{const t=u.CSS.newGridBuilder();return O.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)"),O.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),O.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)"),O.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},mr=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?O.XAxis.TYPE:O.YAxis.TYPE,s=`${e}-axis`,o=({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:k,onAutoBoundsChange:T,style:P,...I})=>{const B=(c?.length??0)>0,F=f.useUniqueKey(i),$=f.useMemoDeepEqual({location:a,showGrid:g,type:E,bounds:S,axisKey:C,label:c,labelDirection:x,tickSpacing:v,autoBounds:y,autoBoundUpdateInterval:k}),[{path:D},{size:z,labelSize:b,...N},_]=f.use$2({aetherKey:F,type:n,schema:O.coreAxisStateZ,initialState:$});j.useEffect(()=>_(K=>({...K,...$})),[$]),j.useEffect(()=>{const{lower:K,upper:Z}=O.parseAutoBounds(N.autoBounds);N.bounds!=null&&(K&&S?.lower!==N.bounds.lower||Z&&S?.upper!==N.bounds.upper)&&T?.(N.bounds)},[N.autoBounds,N.bounds]);const M=In({loc:a,key:`${n}-${F}`,size:z+b,order:1},`${e.toUpperCase()}Axis`),V=Ps.useTypography(d).toString(),H=j.useRef(0);return j.useEffect(()=>{if(e==="y"){if(c==null)return;let Z=L.dimensions(c,V)[u.p.dimension(u.p.construct(x))];Z>0&&(Z+=9),_(G=>({...G,labelSize:Z}))}else{let Z=L.dimensions(c,V).height*1.3;Z>0&&(Z+=12);const G=H.current;O.withinSizeThreshold(G,Z)||(H.current=Z,_(Q=>({...Q,labelSize:Z})))}},[c,x,V]),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(R,u.CSS.B("axis"),u.CSS.B(s),u.CSS.loc(a)),style:{...P,...M},align:"center",justify:a!=="left"?"end":"start",direction:u.p.swap(e),...I,children:B&&r.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS(u.CSS.BE("axis","label"),u.CSS.dir(x)),value:c,onChange:p,level:d})}),r.jsxRuntimeExports.jsx(f.Composite,{path:D,children:l})]})};return o.displayName=`${e.toUpperCase()}Axis`,o},wa=mr("x"),va=mr("y"),Nh=u.K.xy.extend({root:u.K$1.corner,units:ne.z.object({x:ne.z.enum(["px","decimal"]),y:ne.z.enum(["px","decimal"])})}),Ph=Nh.partial({root:!0,units:!0}),Ah=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},Oh=(e,t)=>{const n={x:e.x,y:e.y};if(t.current==null)return n;const s=u.Ho.construct(t.current),o=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(o):n.x/=u.Ho.width(o),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(o):n.y/=u.Ho.height(o),n},Ih=(e,t)=>{if(t.current==null)return null;const n=u.Ho.construct(t.current.parentElement),s=u.Ho.construct(t.current),o={x:e.x,y:e.y,root:{...u.K$1.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*u.Ho.width(n)-u.Ho.width(s),o.root.x="right"):e.x<.2?o.x=e.x*u.Ho.width(n):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*u.Ho.height(n)-u.Ho.height(s),o.root.y="bottom"):e.y<.2?o.y=e.y*u.Ho.height(n):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...u.K.truncate(o,3)}},Ti=u.Ho.reRoot(u.Ho.DECIMAL,u.K$1.TOP_LEFT),Dh={x:.1,y:.1,root:u.K$1.TOP_LEFT,units:{x:"decimal",y:"decimal"}},Ds=j.memo(({className:e,value:t,onChange:n,style:s,draggable:o=!0,initial:i=Dh,...l})=>{const[a,c]=L.usePurePassthrough({value:t,onChange:n,initial:i}),d=j.useRef(a),x=f.useSyncedRef(o===!1),p=j.useRef(null);a!==null&&(s={...s,...Ah(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(Ti),R=S.box(u.Ho.construct(p.current)),v=u.C.XY.clamp(u.Ho.construct(u.Ho.topLeft(Ti),{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 Ih(C,p)},[]),h=_e.useCursorDrag({onStart:j.useCallback(()=>{d.current=Oh(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 r.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(e,u.CSS.B("legend")),bordered:!0,style:s,onDragStart:h,draggable:o,borderColor:5,ref:p,onDrag:f.preventDefault,onDragEnd:f.preventDefault,background:1,rounded:1,...l})});Ds.displayName="Legend.Container";const Dn=j.memo(({data:e,allowVisibleChange:t=!0,background:n=1,entryProps:s,...o})=>r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:e.sort((i,l)=>i.label.localeCompare(l.label)).map(({key:i,visible:l=!0,...a})=>r.jsxRuntimeExports.jsx(Bh,{entry:{key:i,visible:l,...a},allowVisibleChange:t,background:n,...s,...o},i))}));Dn.displayName="Legend.Entries";const Bh=({allowVisibleChange:e=!0,entry:t,onEntryChange:n,colorPickerVisible:s,onColorPickerVisibleChange:o,className:i,background:l,...a})=>{const{color:c,key:d,label:x,visible:p}=t;return r.jsxRuntimeExports.jsxs(f.Box,{align:"center",className:u.CSS(u.CSS.B("legend-entry"),i),gap:"small",x:!0,...a,children:[r.jsxRuntimeExports.jsxs(f.Box,{align:"center",gap:"small",x:!0,children:[r.jsxRuntimeExports.jsx(_e.Swatch,{allowChange:n!=null,draggable:!1,onChange:m=>n?.({...t,color:m}),size:"tiny",value:c,onVisibleChange:o}),r.jsxRuntimeExports.jsx(f.MaybeEditable,{color:t.visible?10:7,level:"small",onChange:m=>n?.({...t,label:m}),onDoubleClick:f.stopPropagation,overflow:"nowrap",value:x})]}),e&&r.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.B("visible-toggle"),contrast:l,onClick:m=>{m.stopPropagation(),n?.({...t,visible:!p})},onDoubleClick:f.stopPropagation,size:"tiny",variant:"text",children:p?r.jsxRuntimeExports.jsx(f.Visible,{}):r.jsxRuntimeExports.jsx(f.Hidden,{})})]},d)},ka=({data:e,background:t=1,allowVisibleChange:n=!0,onEntryChange:s,position:o,onPositionChange:i,...l})=>{const[a,c]=j.useState(!1);return e.length===0?null:r.jsxRuntimeExports.jsx(Ds,{...l,draggable:!a,value:o,onChange:i,gap:"small",background:t,className:u.CSS.B("legend-grouped"),children:e.map(({key:d,name:x,data:p},m)=>r.jsxRuntimeExports.jsxs(j.Fragment,{children:[r.jsxRuntimeExports.jsx(f.Text,{level:"small",color:9,weight:500,className:u.CSS.B("legend-name"),children:x}),r.jsxRuntimeExports.jsx(f.Box,{y:!0,grow:!0,className:u.CSS.B("legend-entries"),empty:!0,children:r.jsxRuntimeExports.jsx(Dn,{data:p,onEntryChange:s,colorPickerVisible:a,onColorPickerVisibleChange:c,allowVisibleChange:n,background:t,entryProps:$h})}),m!==e.length-1&&r.jsxRuntimeExports.jsx("div",{className:u.CSS.B("legend-divider")})]},d))})},$h={justify:"between",grow:!0},fr=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,allowVisibleChange:o=!0,background:i=1,...l})=>{const[a,c]=j.useState(!1);return e.length===0?null:r.jsxRuntimeExports.jsx(Ds,{...l,draggable:!a,value:n,onChange:s,background:i,empty:!0,children:r.jsxRuntimeExports.jsx(Dn,{data:e,onEntryChange:t,colorPickerVisible:a,onColorPickerVisibleChange:c,allowVisibleChange:o,background:i,entryProps:zh})})},zh={justify:"between",grow:!0},Vh=Object.freeze(Object.defineProperty({__proto__:null,Container:Ds,Grouped:ka,Simple:fr,stickyXYz:Ph},Symbol.toStringTag,{value:"Module"})),_a=({variant:e="floating",...t})=>e==="floating"?r.jsxRuntimeExports.jsx(La,{...t}):r.jsxRuntimeExports.jsx(Fh,{...t}),La=j.memo(({onLineChange:e,...t})=>{const{lines:n}=ct("FloatingLegend"),s=Ta(n);return s.length===1?r.jsxRuntimeExports.jsx(fr,{data:s[0].data,onEntryChange:e,...t}):r.jsxRuntimeExports.jsx(ka,{data:s,onEntryChange:e,...t})});La.displayName="LinePlot.FloatingLegend";const Ta=e=>j.useMemo(()=>{const n={};for(const o of e){const i=n[o.legendGroup];i!=null?i.push(o):n[o.legendGroup]=[o]}const s=Object.entries(n).map(([o,i])=>({key:o,name:o,data:i}));return s.sort((o,i)=>o.name.localeCompare(i.name)),s},[e]),Fh=({onLineChange:e})=>{const{lines:t}=ct("FixedLegend"),n=Ta(t),s=f.useUniqueKey(),o=In({key:s,size:t.length>0?36:0,loc:"top",order:5},"Legend");return n.length===0?null:n.length===1?r.jsxRuntimeExports.jsx(f.Box,{align:"center",justify:"start",x:!0,style:o,children:r.jsxRuntimeExports.jsx(Dn,{data:n[0].data,onEntryChange:e,background:0})}):r.jsxRuntimeExports.jsxs(f.Box,{align:"center",justify:"start",x:!0,style:o,gap:"huge",children:[r.jsxRuntimeExports.jsx(Mi,{name:"Y1",data:n[0].data,onLineChange:e}),r.jsxRuntimeExports.jsx(Mi,{name:"Y2",data:n[1].data,onLineChange:e})]})},Mi=({name:e,data:t,onLineChange:n})=>r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:e}),r.jsxRuntimeExports.jsx(Dn,{data:t,onEntryChange:n,background:0})]}),hr=j.memo(({aetherKey:e,...t})=>(f.useUnidirectional({aetherKey:e,type:O.Line.TYPE,schema:O.stateZ,state:t}),null));hr.displayName="Line";const Hh=Object.freeze(Object.defineProperty({__proto__:null,Line:hr},Symbol.toStringTag,{value:"Module"})),gr=({aetherKey:e,color:t,label:n="",legendGroup:s,visible:o=!0,...i})=>{const l=f.useUniqueKey(e),{setLine:a,removeLine:c}=ct("Line");return j.useEffect(()=>(a({key:l,color:t,label:n,visible:o,legendGroup:s}),()=>c(l)),[n,t,o,s]),r.jsxRuntimeExports.jsx(hr,{aetherKey:l,color:t,label:n,visible:o,...i})},Ma=({level:e="h2",...t})=>{const n=f.useUniqueKey(),s=Ps.useTypography(e),o=In({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return r.jsxRuntimeExports.jsx(f.Box,{justify:"center",align:"center",style:o,children:r.jsxRuntimeExports.jsx(f.MaybeEditable,{...t,level:e})})},Na=({aetherKey:e,...t})=>{const n=f.useUniqueKey(e),[,,s]=f.use$2({aetherKey:n,type:O.Tooltip.TYPE,schema:O.tooltipStateZ,initialState:{position:null,...t}}),o=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(o.current===null)return;const a=o.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",l),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",l)}},[i]),r.jsxRuntimeExports.jsx("span",{ref:o})},Zh=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Na},Symbol.toStringTag,{value:"Module"})),Pa=()=>{const e=j.useRef(new Map),t=j.useCallback(s=>{const{request:o,response:i}=s,l=e.current.get(o);l!=null&&(l(i.bounds),e.current.delete(o))},[]),[,,n]=f.use$2({type:O.BoundQuerier.TYPE,schema:O.boundQuerierStateZ,onAetherChange:t,initialState:{request:"",response:{request:"",bounds:{}}}});return j.useCallback(async()=>await new Promise(s=>{const o=u.Gt.create();e.current.set(o,s),n(i=>({...i,request:o}))}),[])},Kh=({ref:e})=>(e.current=Pa(),null),Yh={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer",cancel:"default"},Aa=({className:e,mode:t,maskBox:n,children:s,style:o,...i})=>r.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.noSelect,u.CSS.BE("viewport-mask","container"),e),style:{cursor:Yh[t],...o},...i,children:[r.jsxRuntimeExports.jsx("div",{style:{...u.Ho.css(n),display:u.Ho.areaIsZero(n)?"none":"block"},className:u.CSS.BE("viewport-mask","selection")}),s]}),Gh=(e,t)=>{for(;e!=null&&!t(e);)e=e.parentElement;return e},Uh=11,Wh=6,Xh=2,Ni=5,qh=e=>u.Ho.width(e)<Ni&&u.Ho.height(e)<Ni,hn=e=>{const t=u.Ho.width(e),n=u.Ho.height(e);return Math.min(t,n)<.001?Uh:Wh},Qh=["zoom","pan","select","zoomReset","cancel"],jr=[...Qh,"click"],Jh=ne.z.enum(jr),Oa=["zoom","select"],gn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"],["MouseMiddle"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},Ia={defaultMode:"pan",pan:[["MouseLeft"],["MouseMiddle"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},Da={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"],["MouseMiddle"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]],cancel:[["Escape"]]},Er={zoom:gn,pan:Ia,select:Da,zoomReset:gn,click:gn,cancel:gn},eg=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(o=>o.filter(i=>i!=="MouseLeft")).filter(o=>o.length>0)]))},tg=u.Ho.construct(0,0,1,1,u.K$1.TOP_LEFT),ng={width:30,height:50},Ba=({onChange:e,triggers:t,initial:n=tg,threshold:s=ng,ref:o})=>{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,hn(n))),[n]),j.useEffect(()=>d(i),[i]);const[E,S,R,v]=f.useMemoCompare(()=>{const I={...Er[i],...t},B=f.flattenConfig(I),F=eg(I);return[I,B,F,f.flattenConfig(F)]},f.compareModeConfigs,[t]),y=j.useCallback(({box:I,triggers:B,stage:F,cursor:$})=>{if(h.current==null)return;const D=f.determineMode(E,B),z=u.Ho.construct(h.current);if(D==null)return;if(D==="cancel"){a(u.Ho.ZERO),e?.({box:x.current,mode:D,stage:F,cursor:$});return}if(D==="zoomReset")return a(u.Ho.ZERO),e?.({box:u.Ho.DECIMAL,mode:D,stage:F,cursor:$}),p(u.Ho.DECIMAL);const b=qh(I);if(F==="end"){if(b){D==="zoom"&&a(u.Ho.ZERO),e?.({box:x.current,mode:"click",stage:F,cursor:$});return}return p(_=>{if(D==="pan"){const V=Pi(I,_,z);return V===null||u.Ho.equals(V,_)?_:(e?.({box:V,mode:D,stage:F,cursor:$}),V)}const M=C(I,_,z);return M===null?_:(e?.({box:M,mode:D,stage:F,cursor:$}),D==="zoom"?(a(u.Ho.ZERO),M):u.Ho.truncate(_,hn(_)))})}if(Oa.includes(D))return b?void 0:a(u.C.XY.scale(z).clamp(z).translate({x:-u.Ho.left(z),y:-u.Ho.top(z)}).box(Ai(g,I,z)));if(a(_=>u.Ho.areaIsZero(_)?_:u.Ho.ZERO),u.K.distance($,m.current)<Xh)return;m.current=$;const N=Pi(I,x.current,z);e?.({box:N,mode:D,stage:F,cursor:$})},[a,d,e,E,s.height,s.width,p,h,hn]);j.useImperativeHandle(o,()=>({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,F)=>{const $=Ao(B,F).box(Ai(g,I,F));return u.Ho.truncate($,hn($))},[s]),k=f.useHeldRef({triggers:[["Control"]]}),T=f.useHeldRef({triggers:[["Alt"]]});j.useEffect(()=>{const I=B=>{if(h.current==null)return;let F=1;B.deltaY<0?F-=.035:F+=.035;const $=u.Ho.construct(h.current),D=u.K.construct(B);if(Array.from(h.current.children).push(h.current),!u.Ho.contains($,D)||h.current!==B.target&&Gh(B.target,V=>V===h.current)==null)return;const N=Ao(x.current,u.Ho.construct(h.current)).pos(u.K.construct(B));let M=u.C.XY.magnify({x:k.current.held?1:F,y:T.current.held?1:F}).box(x.current);M=u.Ho.translate(M,{x:k.current.held?0:N.x*(1-F),y:T.current.held?0:N.y*(1-F)}),p(M),e?.({stage:"end",box:M,cursor:u.K.construct(B),mode:"zoom"})};return window.addEventListener("wheel",I),()=>window.removeEventListener("wheel",I)},[p,e]),Jl.useDrag({bound:h,onDrag:y,triggers:S,loose:!0});const P=j.useCallback(({triggers:I,stage:B})=>{if(B==="end")return d(i);const F=f.determineMode(R,I);F!=null&&d(F)},[R,i,e]);return f.use$1({triggers:v,callback:P,region:h}),{maskBox:l,ref:h,mode:c}},Ao=(e,t)=>u.C.XY.scale(t).clamp(t).scale(e),Pi=(e,t,n)=>{let s=u.Ho.signedDims(Ao(t,n).box(e));s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight};const o=u.C.XY.translate(u.K.construct(s)).box(t);return u.Ho.truncate(o,hn(o))},Ai=(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})=>r.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:[u.U.capitalize(e),r.jsxRuntimeExports.jsx(f.Text$1,{trigger:t[0],el:"span"})]}),sg=({triggers:e,value:t,onChange:n,disable:s=["zoomReset","click","cancel"],tooltipDelay:o,tooltipLocation:i,hideTooltip:l,...a})=>{const c=j.useMemo(()=>jr.filter(x=>!s.includes(x)),[s]),d={tooltipDelay:o,tooltipLocation:i,hideTooltip:l,size:"small"};return r.jsxRuntimeExports.jsxs(pe.Buttons,{...a,keys:c,value:t,onChange:n,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"zoom",tooltip:r.jsxRuntimeExports.jsx(Wt,{mode:"zoom",triggers:e.zoom}),...d,children:r.jsxRuntimeExports.jsx(f.Zoom,{})}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pan",tooltip:r.jsxRuntimeExports.jsx(Wt,{mode:"pan",triggers:e.pan}),...d,children:r.jsxRuntimeExports.jsx(f.Pan,{})}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"select",tooltip:r.jsxRuntimeExports.jsx(Wt,{mode:"select",triggers:e.select}),...d,children:r.jsxRuntimeExports.jsx(f.Selection,{})})]})},og=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Er,MASK_MODES:Oa,MODES:jr,Mask:Aa,PAN_DEFAULT_TRIGGERS:Ia,SELECT_DEFAULT_TRIGGERS:Da,SelectMode:sg,TooltipText:Wt,ZOOM_DEFAULT_TRIGGERS:gn,modeZ:Jh,use:Ba},Symbol.toStringTag,{value:"Module"})),rg=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,$a=({ref:e,children:t,initial:n=u.Ho.DECIMAL,onChange:s,...o})=>{const{setViewport:i}=ct("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,...o});return r.jsxRuntimeExports.jsx(Aa,{className:u.CSS.BE("line-plot","viewport"),...a,children:t})},ig=Object.freeze(Object.defineProperty({__proto__:null,BoundsQuerier:Kh,Legend:_a,Line:gr,LinePlot:ba,Title:Ma,Tooltip:Zh,Viewport:$a,XAxis:wa,YAxis:va,axisFactory:mr,selectViewportEl:rg,useBoundQuerier:Pa,useContext:ct,useGridEntry:In,useViewport:Ca},Symbol.toStringTag,{value:"Module"})),lg=({aetherKey:e,...t})=>(f.use$2({aetherKey:e,type:O.Annotation.TYPE,schema:O.annotationStateZ,initialState:t}),null),za=({aetherKey:e,menu:t,...n})=>{const s=f.useUniqueKey(e),{setViewport:o,setHold:i}=ct("Range.Provider"),[,{hovered:l,count:a},c]=f.use$2({aetherKey:s,type:O.Provider.TYPE,schema:O.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 r.jsxRuntimeExports.jsx(f.ContextMenu,{...x,menu:()=>t==null||l==null?null:t(l),children:r.jsxRuntimeExports.jsx(f.Box,{style:{...d,cursor:l!=null?"pointer":"default",width:"100%",height:"100%"},onContextMenu:x.open,className:x.className,onClick:()=>{l!=null&&(o({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})})},ag=Object.freeze(Object.defineProperty({__proto__:null,Annotation:lg,Provider:za},Symbol.toStringTag,{value:"Module"})),Va={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},cg=f.flattenConfig(Va),Fa=({aetherKey:e})=>{const t=f.useUniqueKey(e),[,,n]=f.use$2({aetherKey:t,type:O.Measure.TYPE,schema:O.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=j.useRef(null),o=f.useHeldRef({triggers:cg,loose:!0}),i=j.useCallback(({mode:c,cursor:d})=>{if(c==="click"){const x=f.determineMode(Va,o.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,o]);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]),r.jsxRuntimeExports.jsx("span",{ref:s})},ug=Object.freeze(Object.defineProperty({__proto__:null,Measure:Fa},Symbol.toStringTag,{value:"Module"})),yr=({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:o,onUnitsChange:i,units:l="",color:a,lineWidth:c,lineDash:d,className:x,onSelect:p,style:m,...h})=>{const[g,E]=L.usePurePassthrough({value:t,onChange:s,initial:""}),S=f.useSyncedRef(o),[,{pixelPosition:R},v]=f.use$2({aetherKey:e,type:O.Rule.TYPE,schema:O.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}=ct("Rule"),T=document.getElementById(C)?.querySelector(".pluto-line-plot__viewport"),P=j.useRef(R);j.useEffect(()=>{v(D=>({...D,position:n,color:a,lineWidth:c,lineDash:d}))},[n,a,c,d]);const I=_e.useCursorDrag({onStart:j.useCallback(()=>{p?.(),v(D=>({...D,dragging:!0})),P.current=y.current},[]),onMove:D=>{v(z=>({...z,pixelPosition:(P.current??0)+u.Ho.signedHeight(D)}))},onEnd:j.useCallback(()=>{v(D=>({...D,dragging:!1})),P.current=R},[])}),B=j.useRef(null);if(n==null||R==null)return null;const F=u.fr.pickByContrast(a,u.fr.BLACK,u.fr.WHITE),$=r.jsxRuntimeExports.jsxs("div",{ref:B,className:u.CSS.B("rule"),style:{top:`calc(${R}px - 0.5rem)`},children:[r.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("rule","drag-handle"),onDragStart:I,draggable:!0}),r.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.fr.cssString(a),backgroundColor:u.fr.hex(u.fr.setAlpha(a,.7)),...m},...h,children:[r.jsxRuntimeExports.jsx(f.Editable,{className:u.CSS.BE("rule","label"),level:"small",value:g,onChange:E,color:F}),r.jsxRuntimeExports.jsx(f.Divider$1,{y:!0,style:{borderColor:u.fr.cssString(a)}}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",className:u.CSS.BE("rule","value"),children:[r.jsxRuntimeExports.jsx(f.Editable,{value:n.toFixed(2),onChange:D=>{const z=Number(D);isFinite(z)&&o?.(z)},level:"small",color:F}),l.length>0&&r.jsxRuntimeExports.jsx(f.MaybeEditable,{level:"small",color:F,value:l,onChange:i})]})]})]});return T==null?$:Ql.createPortal($,T)},dg=Object.freeze(Object.defineProperty({__proto__:null,Rule:yr},Symbol.toStringTag,{value:"Module"})),Ha=f.canDropOfType(kt),xg=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:o,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:k,children:T,...P})=>{const I=t.filter(({location:z})=>u.K$1.isY(z)),B=j.useRef(null),F=f.usePrevious(e.length),$=f.usePrevious(P.hold),D=F===0&&e.length!==0||$===!0&&P.hold===!1;return j.useEffect(()=>{D&&B.current?.reset()},[D]),r.jsxRuntimeExports.jsxs(ba,{...P,children:[I.map((z,b)=>{const N=e.filter(V=>V.axes.x===z.key),_=t.filter(({location:V})=>u.K$1.isX(V)),M=h?.filter(V=>[..._.map(({key:H})=>H),z.key].includes(V.axis));return r.jsxRuntimeExports.jsx(pg,{axis:z,index:b,lines:N,yAxes:_,rules:M,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:C,onRuleChange:x,onSelectRule:k},z.key)}),i&&r.jsxRuntimeExports.jsx(_a,{onLineChange:d,position:l,onPositionChange:a,variant:R}),n&&r.jsxRuntimeExports.jsx(Ma,{value:s,onChange:o,level:c}),r.jsxRuntimeExports.jsxs($a,{initial:S,onChange:v,triggers:y,ref:B,children:[g&&r.jsxRuntimeExports.jsx(Na,{}),E&&r.jsxRuntimeExports.jsx(Fa,{}),T]})]})},pg=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:o,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:Ha,onDrop:j.useCallback(({items:S})=>{const R=f.filterByType(kt,S);return l?.(d,R.map(({key:v})=>v)),R},[d,l])}),g=s?.filter(S=>S.axis===d),E=f.useDraggingState();return r.jsxRuntimeExports.jsxs(wa,{...p,...h,location:c,axisKey:d,showGrid:x??n===0,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(kt)(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 r.jsxRuntimeExports.jsx(fg,{axis:{...S,showGrid:x??(n===0&&R===0)},lines:v,rules:y,onRuleChange:o,onAxisChannelDrop:l,onAxisChange:a,onSelectRule:i},S.key)}),g?.map(S=>j.createElement(yr,{aetherKey:S.key,...S,key:S.key,onLabelChange:R=>o?.({key:S.key,label:R}),onPositionChange:R=>o?.({key:S.key,position:R}),onUnitsChange:R=>o?.({key:S.key,units:R}),onSelect:()=>i?.(S.key)})),r.jsxRuntimeExports.jsx(za,{...m})]})},mg=({channels:{x:e,y:t}})=>`${e??0}-${t}`,fg=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:o,axis:{key:i,location:l,...a},onSelectRule:c})=>{const d=f.useDrop({type:"Channel.LinePlot.YAxis",canDrop:Ha,onDrop:j.useCallback(({items:p})=>{const m=f.filterByType(kt,p);return s?.(i,m.map(({key:h})=>h)),m},[i,s])}),x=f.useDraggingState();return r.jsxRuntimeExports.jsxs(va,{...a,...d,location:l,axisKey:i,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(kt)(x))),onAutoBoundsChange:p=>o?.({key:i,bounds:p}),onLabelChange:p=>o?.({key:i,label:p}),children:[e.map(p=>r.jsxRuntimeExports.jsx(hg,{line:p},mg(p))),t?.map(p=>j.createElement(yr,{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)}))]})},hg=({line:e})=>e.variant==="static"?r.jsxRuntimeExports.jsx(jg,{line:e}):r.jsxRuntimeExports.jsx(gg,{line:e}),gg=({line:{key:e,timeSpan:t,channels:{x:n,y:s},axes:o,...i}})=>{const{xTelem:l,yTelem:a}=j.useMemo(()=>{const c=Number(t.valueOf())*3,d=O.streamChannelData({timeSpan:t,channel:s,keepFor:c}),x=n!=null&&n!==0;return{xTelem:O.streamChannelData({timeSpan:t,channel:x?n:s,useIndexOfChannel:!x,keepFor:c}),yTelem:d}},[t.valueOf(),n,s]);return r.jsxRuntimeExports.jsx(gr,{aetherKey:e,y:a,x:l,legendGroup:o.y.toUpperCase(),...i},e)},jg=({line:{timeRange:e,key:t,channels:{x:n,y:s},...o}})=>{const{xTelem:i,yTelem:l}=j.useMemo(()=>{const a=O.channelData({timeRange:e,channel:s}),c=n!=null&&n!==0;return{xTelem:O.channelData({timeRange:e,channel:c?n:s,useIndexOfChannel:!c}),yTelem:a}},[e.start.valueOf(),e.end.valueOf(),n,s]);return r.jsxRuntimeExports.jsx(gr,{aetherKey:t,y:l,x:i,legendGroup:o.axes.y.toUpperCase(),...o},t)},lt=(e,t,n)=>({variant:"loading",status:u.xr.create({variant:"loading",message:`${u.U.capitalize(t)} ${e}`}),data:n}),Ze=(e,t,n)=>({variant:"success",status:u.xr.create({variant:"success",message:`${u.U.capitalize(t)} ${e}`}),data:n}),_t=(e,t,n)=>({variant:"error",status:u.xr.fromException(n,`Failed to ${t} ${e}`),data:void 0}),qt=(e,t)=>({variant:"disabled",status:u.xr.create({variant:"disabled",message:`Failed to ${t} ${e}`,description:`Cannot ${t} ${e} because no cluster is connected.`}),data:void 0}),Sr=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:()=>[]}),Et=e=>{const t=j.use(Sr);return e??t},yt=(e,t={})=>{const{optional:n=!1,onChange:s,defaultValue:o}=t,i=Et(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:o}),[e,l,n,o]));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}},Rr=(e,t)=>{const{get:n,bind:s}=Et(t?.ctx);return j.useSyncExternalStore(s,j.useCallback(()=>n(e,t),[e,n,t]))},Lt=(e,t)=>Rr(e,t)?.value??null,Eg=e=>Rr(e,{optional:!0})?.status?.variant==="success",Cr=(e,t)=>({value:()=>e.get(t).value,add:(n,s)=>{const o=u.Sr(e.get(t).value);o.splice(s,0,...L.t.toArray(n)),e.set(t,o)},push:(n,s)=>{const o=u.Sr(e.get(t).value);o.push(...L.t.toArray(n)),s!=null&&o.sort(s),e.set(t,o)},remove:n=>{const s=e.get(t).value,o=new Set(L.t.toArray(n)),i=s.filter(({key:l})=>!o.has(l));return e.set(t,i),i.map(({key:l})=>l)},keepOnly:n=>{const s=e.get(t).value,o=new Set(L.t.toArray(n)),i=s.filter(({key:l})=>o.has(l));return e.set(t,i),i.map(({key:l})=>l)},set:n=>e.set(t,L.executeSetter(n,e.get(t).value)),sort:n=>{const s=u.Sr(e.get(t).value);s.sort(n),e.set(t,s)}}),yg=(e,t)=>Cr(Et(t?.ctx),e),br=(e,t={})=>{const n=Et(t?.ctx),s=Lt(e,t);return j.useMemo(()=>({data:s.map(({key:o})=>o),...Cr(n,e)}),[s,n,e])},Sg=f.renderProp(e=>r.jsxRuntimeExports.jsx(f.Text$2,{...e})),ge=({path:e,children:t=Sg,label:n,padHelpText:s=!0,visible:o=!0,hideIfNull:i=!0,optional:l,onChange:a,className:c,defaultValue:d,...x})=>{const p=yt(e,{optional:l??i,onChange:a,defaultValue:d}),m=Et();if(p==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??=u.U.capitalize(L.N.element(e,-1)),o=typeof o=="function"?o(p,m):o,!o)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),r.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)})},Bn=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const o=({inputProps:i,path:l,fieldKey:a=t,optional:c,defaultValue:d,...x})=>r.jsxRuntimeExports.jsx(ge,{...n,...x,defaultValue:d,optional:c,path:a?`${l}.${a}`:l,children:p=>r.jsxRuntimeExports.jsx(e,{...p,...s,...i})});return o.displayName=e.displayName,o},Za=Bn(f.Numeric),Be=Za({inputProps:{}}),Ka=Bn(f.Text$2),wr=Ka({inputProps:{}}),Ya=Bn(f.Switch$1),Bs=Ya({inputProps:{}}),Rg=e=>Bn(An)(e),Cg=({children:e,...t})=>r.jsxRuntimeExports.jsx(Sr,{value:t,children:e}),bg=e=>e.code==="custom"&&e.params!=null&&"variant"in e.params?e.params.variant:"error";class wg extends O.a.Observer{schema;values;initialValues;statuses;touched;cachedRefs;constructor(t,n){super(),this.schema=n,this.values=L.N.copy(t),this.statuses=new Map,this.touched=new Set,this.cachedRefs=new Map,this.initialValues=L.N.copy(this.values)}setValue(t,n,s){t==""?this.values=L.N.copy(n):L.N.set(this.values,t,n),this.checkTouched(t,n,s),this.updateCachedRefs(t)}checkTouched(t,n,s={}){const{markTouched:o=!0}=s,i=L.N.get(this.initialValues,t,{optional:!0});L.N.equal(i,n)?(this.clearTouched(t),this.clearOrphanedTouchedPaths(t)):o&&this.setTouched(t)}clearOrphanedTouchedPaths(t){const n=new Set;this.touched.forEach(s=>{L.N.pathsMatch(s,t)&&s!==t&&!L.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(L.N.equal(this.values,t??this.initialValues))return;t!=null&&(this.initialValues=L.N.copy(t));const n=L.N.copy(this.initialValues);this.statuses.clear(),this.touched.clear();const s=new Set;this.cachedRefs.forEach((o,i)=>{const l=L.N.get(this.values,i,{optional:!0}),a=L.N.get(n,i,{optional:!0});L.N.equal(l,a)||s.add(i)}),s.forEach(o=>this.cachedRefs.delete(o)),this.values=n}setCurrentStateAsInitialValues(){this.initialValues=L.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){L.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(o=>{const i=[...n,...o.path],l=L.N.resolvePath(i.join("."),this.values);if(s.push({key:l,variant:bg(o),message:o.message}),o.code==="invalid_union"&&o.errors!=null&&o.errors.length>0){const a=o.errors.map(d=>d.filter(x=>L.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 o=new Set;if(this.statuses.forEach((a,c)=>{a.variant!=="success"&&o.add(c)}),o.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||L.N.pathsMatch(c,s)||L.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:o=void 0}=n,i=u.yr.getOrSetDefault(this.cachedRefs,t,{});let l=L.N.get(this.values,t,{optional:s||o!=null});if(l==null){if(o==null)return null;l=o,this.setValue(t,l)}if(i.value=l,i.required=!1,this.schema!=null){const a=Nf.getFieldSchema(this.schema,t,{optional:!0});a!=null&&(i.required=!a.safeParse(void 0).success)}return i.status=u.yr.getOrSetDefault(this.statuses,t,{key:t,variant:"success",message:""}),i.touched=this.touched.has(t),i}updateCachedRefs(t){this.cachedRefs.forEach((n,s)=>{(L.N.pathsMatch(s,t)||L.N.pathsMatch(t,s))&&this.cachedRefs.set(s,{})})}}const vr=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:o,onHasTouched:i})=>{const l=f.useInitializerRef(()=>new wg(e,n)),a=f.useSyncedRef(o),c=f.useErrorHandler(),d=f.useSyncedRef(i),x=j.useCallback(()=>{l.current.setCurrentStateAsInitialValues(),d.current?.(!1)},[]),p=j.useCallback(k=>l.current.onChange(k),[]),m=j.useCallback((k,T)=>l.current.getState(k,T),[]),h=j.useCallback(k=>{l.current.remove(k),l.current.notify()},[]),g=j.useCallback(k=>{const T=l.current.values,P=l.current.hasBeenTouched;l.current.reset(k),T!==l.current.values&&a.current?.({values:l.current.values,path:"",prev:T,valid:!0}),l.current.notify();const B=l.current.hasBeenTouched;B!==P&&d.current?.(B)},[]),E=j.useCallback(async k=>{const T=await l.current.validateAsync(!0,k);return l.current.notify(),T},[]),S=j.useCallback(k=>{const T=l.current.validate(!0,k);return l.current.notify(),T},[]),R=j.useCallback((k,T,P)=>{const{notifyOnChange:I=!0,markTouched:B=!0}=P??{},F=L.N.get(l.current.values,k,{optional:!0}),$=l.current.hasBeenTouched;l.current.setValue(k,T,{markTouched:B});const D=()=>{I&&a.current?.({values:l.current.values,path:k,prev:F,valid:!0}),l.current.notify();const z=l.current.hasBeenTouched;z!==$&&d.current?.(z)};try{l.current.validate()}catch{return c(async()=>{await l.current.validateAsync(),D()},"Failed to validate form")}D()},[]),v=j.useCallback(k=>L.N.has(l.current.values,k),[]),y=j.useCallback((k,T)=>{const P=l.current.hasBeenTouched;l.current.setStatus(k,T),l.current.notify();const I=l.current.hasBeenTouched;I!==P&&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: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])},Ga=({key:e,open:t,onChange:n})=>{const s=f.useMemoPrimitiveArray(e);It(async()=>{if(t==null)return;const o=await t();if(o==null)return;const i=o.onChange(n);return async()=>{i(),await o.close()}},[t==null,s])},vg=Object.freeze(Object.defineProperty({__proto__:null,useListener:Ga},Symbol.toStringTag,{value:"Module"})),yn={...O.ZERO_CONTEXT_VALUE,state:L.ab.connectivity.DEFAULT},kg={maxRetries:4,baseInterval:L.O$1.seconds(1),scale:2},kr=j.createContext(yn),Ua=()=>j.use(kr),Bt=()=>Ua().client,_g=()=>Ua().state,Oo={connected:"success",connecting:"loading",disconnected:"disabled",failed:"error"},Wa="serverVersionMismatch",Lg=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Tg=({children:e,client:t})=>{const{path:n}=f.useUnidirectional({type:O.Provider$1.TYPE,schema:O.Provider$1.stateZ,state:{props:null,state:null}});return r.jsxRuntimeExports.jsx(kr,{value:{...yn,client:t},children:r.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})})},Xa=({children:e,connParams:t})=>{const[n,s,o]=f.useCombinedStateAndRef(yn),{path:i}=f.useUnidirectional({type:O.Provider$1.TYPE,schema:O.Provider$1.stateZ,state:{props:t??null,state:null}}),l=f.useAdder(),a=j.useCallback(c=>{o.current.state.status!==c.status&&l({variant:Oo[c.status],message:c.message??u.U.capitalize(c.status)}),s(d=>({...d,state:c}))},[l]);return It(async c=>{if(n.client!=null&&n.client.close(),t==null)return s(yn);const d=new L.ab({retry:kg,...t,connectivityPollFrequency:L.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:Oo[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||u._r.semVerOlder(x.nodeVersion,x.clientVersion),m=Lg(p,x.clientVersion,x.nodeVersion);l({variant:"warning",message:"Incompatible cluster version",description:m,details:{type:Wa,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(a),()=>{d.close(),s(yn)}}},[t,a]),r.jsxRuntimeExports.jsx(kr,{value:n,children:r.jsxRuntimeExports.jsx(f.Composite,{path:i,children:e})})},Mg=Object.freeze(Object.defineProperty({__proto__:null,CONNECTION_STATE_VARIANTS:Oo,Provider:Xa,SERVER_VERSION_MISMATCH:Wa,TestProvider:Tg,use:Bt,useConnectionState:_g},Symbol.toStringTag,{value:"Module"})),Ng=({key:e,name:t,queryFn:n,values:s,openObservable:o,applyChanges:i,applyObservable:l,...a})=>{const c=Bt(),d=f.useErrorHandler(),x=f.useMemoPrimitiveArray(e),p=vr({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 o?.(c)},[x,c?.key]),h=j.useCallback(g=>l?.({changes:g,ctx:p}),[x,l]);return Ga({key:x,open:m,onChange:h}),p},Pg=Object.freeze(Object.defineProperty({__proto__:null,Context:Sr,Field:ge,Form:Cg,NumericField:Be,SwitchField:Bs,TextField:wr,buildNumericField:Za,buildSelectField:Rg,buildSwitchField:Ya,buildTextField:Ka,fieldBuilder:Bn,fieldListUtils:Cr,use:vr,useContext:Et,useField:yt,useFieldList:br,useFieldListUtils:yg,useFieldState:Rr,useFieldValid:Eg,useFieldValue:Lt,useSynced:Ng},Symbol.toStringTag,{value:"Module"})),Ag={markTouched:!1,notifyOnChange:!1},St=({name:e,schema:t,retrieve:n,mountListeners:s,update:o,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=Bt(),y=ze(R),C=Is(),k=vr({schema:t,values:a??i,onChange:({path:$})=>{c&&$!==""&&F()},sync:p,onHasTouched:m,mode:h}),T=j.useCallback(($,D,z)=>k.set($,D,{...z,...Ag}),[k]),P=j.useCallback(async($,D={})=>{const{signal:z}=D;try{if(v==null)return S(qt(e,"retrieve"));if(S(N=>lt(e,"retrieving",N.data)),z?.aborted)return;const b={client:v,params:$,store:y,...k,set:T};if(await n(b),z?.aborted)return;C.cleanup(),C.set(s?.(b)),S(Ze(e,"retrieved",void 0))}catch(b){if(z?.aborted)return;S(_t(e,"retrieve",b))}},[v,e,k,y,T]),I=f.useMemoDeepEqual(l);It(async $=>await P(I,{signal:$}),[P,I]);const B=j.useCallback(async($={})=>{const{signal:D}=$;try{if(v==null)return S(qt(e,"update")),!1;const z={client:v,params:l,store:y,...k,set:T};return await k.validateAsync()?(S(lt(e,"updating",void 0)),await x?.(z)===!1?(S(Ze(e,"updated",void 0)),!1):D?.aborted===!0?!1:(await o(z),S(Ze(e,"updated",void 0)),d?.(z),!0)):!1}catch(z){return D?.aborted!==!0&&S(_t(e,"update",z)),!1}},[e,l,x,d]),F=j.useCallback($=>void B($),[B]);return{form:k,save:F,...E}},qa=j.createContext(null),ze=e=>{const t=f.useRequiredContext(qa),n=f.useUniqueKey(e);return j.useMemo(()=>t.scopedStore(n),[t,n])},Qa=({children:e,...t})=>{const n=Bt(),s=f.useErrorHandler(),o=f.useAsyncErrorHandler(),{path:i}=f.useLifecycle({type:O.PROVIDER_TYPE,schema:O.providerStateZ$1,initialState:{}}),l=()=>"client"in t?t.client:new O.Client({client:n,storeConfig:t.storeConfig,handleError:s,handleAsyncError:o}),a=f.useInitializerRef(l),c=j.useRef(null);return n?.key!==c.current?.key&&(c.current=n,a.current=l()),r.jsxRuntimeExports.jsx(f.Composite,{path:i,children:r.jsxRuntimeExports.jsx(qa,{value:a.current,children:e})})},Og=()=>!0,Ig=u.i.milliseconds(100),Dg=(e,t,n,s,o,i)=>{if(e==null)return;let l=e({params:t.current??{},store:i});if(n.current!=null&&(l=l.filter(n.current)),s.current!=null&&(l=l.sort(s.current)),l.length!==0)return l.forEach(a=>o.current.set(a.key,a)),l.map(a=>a.key)},Ve=({name:e,mountListeners:t,retrieve:n,retrieveByKey:s,retrieveCached:o,sort:i})=>(l={})=>{const{filter:a=Og,sort:c,initialParams:d,retrieveDebounce:x=Ig}=l,p=f.useSyncedRef(a),m=f.useSyncedRef(c??i),h=Bt(),g=j.useRef(new Map),E=f.useInitializerRef(()=>new Map),S=ze(),R=j.useRef(d??null),[v,y,C]=f.useCombinedStateAndRef(()=>lt(e,"retrieving",Dg(o,R,p,m,g,S))),k=j.useRef(!0),T=Is(),P=j.useRef(!1),I=j.useCallback(_=>E.current.forEach((M,V)=>{M===_&&V()}),[E.current]),B=j.useCallback(_=>{if(m.current==null)return _;const M=_.map(V=>g.current.get(V)).filter(V=>V!=null);return M.sort(m.current),M.map(V=>V.key)},[m]),F=j.useCallback(()=>{h!=null&&(P.current=!0,T.cleanup(),T.set(t?.({client:h,store:S,params:R.current??{},onDelete:_=>{g.current.delete(_),y(M=>M.data==null?M:{...M,data:M.data.filter(V=>V!==_)})},onChange:(_,M,V={})=>{const{mode:H="append"}=V,K=g.current.get(_)??null;if(K!=null&&!p.current(K))return;const Z=L.executeSetter(M,K);Z==null||!p.current(Z)||(g.current.set(_,Z),y(G=>{if(G.data==null)return G;let Q;if(K==null)m.current!=null?Q=B([...G.data,_]):Q=H==="prepend"?[_,...G.data]:[...G.data,_];else if(m.current!=null){const ee=G.data.indexOf(_),ae=B(G.data),re=ae.indexOf(_);ee!==re?Q=ae:Q=G.data}else Q=G.data;return{...G,data:Q}}),I(_))}})))},[t,T]),$=j.useCallback(async(_,M={})=>{const{signal:V,mode:H="replace"}=M,K=L.executeSetter(_,R.current??{});R.current=K;try{if(h==null)return y(qt(e,"retrieve"));if(y(Q=>lt(e,"retrieving",Q.data)),H==="replace")k.current=!0;else if(H==="append"&&!k.current)return y(Q=>Ze(e,"retrieved",Q.data??[]));let Z=await n({client:h,params:K,store:S});if(V?.aborted)return;Z=Z.filter(p.current),m.current!=null&&(Z=Z.sort(m.current)),Z.length===0&&(k.current=!1);const G=Z.map(Q=>Q.key);return F(),C.current.data!=null&&u.k.primitiveArrays(C.current.data,G)===u.k.EQUAL?y(Q=>Ze(e,"retrieved",Q.data??[])):(Z.forEach(Q=>g.current.set(Q.key,Q)),y(Q=>{if(H==="replace"||Q.data==null)return Ze(e,"retrieved",G);const ee=new Set(G);return Ze(e,"retrieved",[...Q.data.filter(ae=>!ee.has(ae)),...G])}))}catch(Z){if(V?.aborted)return;y(_t(e,"retrieve",Z))}},[h,e,S,p,F]),D=j.useCallback((_,M={})=>{const{signal:V}=M;(async()=>{P.current||F();try{if(h==null||u.O$1.isZero(_))return;const H=await s({client:h,key:_,params:R.current??{},store:S});if(V?.aborted||H==null)return;if(!p.current(H)){g.current.set(_,null);return}g.current.set(_,H),I(_)}catch(H){if(V?.aborted)return;g.current.set(_,null),y(_t(e,"retrieve",H))}})()},[s,h,I,F]),z=j.useCallback(_=>{if(_==null)return;if(Array.isArray(_))return _.map(V=>z(V)).filter(V=>V!=null);const M=g.current.get(_);return M===void 0&&D(_),M},[D]),b=j.useCallback((_,M)=>M==null?()=>{}:(E.current.set(_,M),()=>E.current.delete(_)),[]);return{retrieve:_e.useDebouncedCallback((_,M={})=>void $(_,M),new u.i(x).milliseconds,[$]),retrieveAsync:$,subscribe:b,getItem:z,...v,data:v?.data??[]}},Bg=({key:e,subscribe:t,getItem:n})=>j.useSyncExternalStore(j.useCallback(s=>t(s,e),[t,e]),j.useCallback(()=>n(e),[n,e])),Ja=e=>lt(e,"retrieving",void 0),ec=e=>{const[t,n]=j.useState(Ja(e.name));return{...t,...tc({...e,onChange:n})}},tc=({retrieve:e,mountListeners:t,name:n,onChange:s,scope:o})=>{const i=Bt(),l=j.useRef(null),a=ze(o),c=Is(),d=j.useCallback(m=>s(h=>{if(h.data===void 0)return h;const g=L.executeSetter(m,h.data);return Ze(n,"retrieved",g)}),[s,n]),x=j.useCallback(async(m,h={})=>{const{signal:g}=h,E=L.executeSetter(m,l.current??{});l.current=E;try{if(i==null)return s(qt(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(Ze(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}},$g=({params:e,...t})=>{const{retrieveAsync:n,retrieve:s,...o}=ec(t),i=f.useMemoDeepEqual(e);return It(async l=>await n(i,{signal:l}),[n,i]),o},zg=({params:e,...t})=>{const n=j.useRef(Ja(t.name)),{retrieveAsync:s}=tc({...t,onChange:i=>{n.current=L.executeSetter(i,n.current),t.onChange?.(n.current)}}),o=f.useMemoDeepEqual(e);It(async i=>{o!=null&&await s(o,{signal:i})},[s,o])},Ye=e=>({useDirect:t=>$g({...e,...t}),useStateful:()=>ec(e),useEffect:t=>zg({...e,...t})}),nc=({onChange:e,params:t,update:n,name:s,scope:o,beforeUpdate:i,afterUpdate:l})=>{const a=Bt(),c=ze(o),d=j.useCallback(async(p,m={})=>{const{signal:h}=m;try{if(a==null)return e(qt(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===!1)return!1;E!==!0&&(p=E)}return await n({client:a,onChange:E=>{g=!0,e(Ze(s,"updated",E))},value:p,params:t,store:c}),h?.aborted===!0?!1:(g||e(Ze(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}},Vg=({params:e,name:t,...n})=>{const[s,o]=j.useState(Ze(t,"updated",void 0)),i=nc({...n,name:t,onChange:o,params:e});return{...s,...i}},Fe=e=>({useObservable:t=>nc({...t,...e}),useDirect:t=>Vg({...t,...e})}),Fg=Object.freeze(Object.defineProperty({__proto__:null,Client:O.Client,Provider:Qa,ScopedUnaryStore:O.ScopedUnaryStore,createForm:St,createList:Ve,createRetrieve:Ye,createStore:O.createStore,createUpdate:Fe,errorResult:_t,nullClientResult:qt,pendingResult:lt,scopeStore:O.scopeStore,successResult:Ze,useListItem:Bg,useStore:ze},Symbol.toStringTag,{value:"Module"})),sc="channels",Hg={channel:L.Bb.SET_CHANNEL_NAME,schema:L.Bb.keyZ,onChange:async({store:e,changed:t,client:n})=>e.channels.set(t,await n.channels.retrieve(t))},Zg={channel:L.Bb.DELETE_CHANNEL_NAME,schema:L.Bb.keyZ,onChange:({store:e,changed:t})=>e.channels.delete(t)},Kg={channel:L.Bb.CALCULATION_STATUS_CHANNEL_NAME,schema:L.Bb.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}))},Yg=e=>{const t=ze();j.useEffect(()=>t.channels.onSet(n=>{n.status!=null&&e(n.status)}),[t])},oc={equal:(e,t)=>L.N.equal(e.payload,t.payload),listeners:[Hg,Zg,Kg]},_r=L.Bb.newZ.extend({name:ne.z.string().min(1,"Name must not be empty"),dataType:L.k.z.transform(e=>e.toString())}).refine(e=>!e.isIndex||L.k.z.parse(e.dataType).equals(L.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||!L.k.z.parse(e.dataType).isVariable,{message:"Persisted channels must have a fixed-size data type",path:["dataType"]}),rc=_r.extend({expression:ne.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"]}),ic=e=>({...e.payload,dataType:e.dataType.toString()}),Lr={key:0,name:"",index:0,dataType:L.k.FLOAT32.toString(),internal:!1,isIndex:!1,leaseholder:0,virtual:!1,expression:"",requires:[]},Tr=async({client:e,params:{key:t,rangeKey:n},store:s})=>{let o=s.channels.get(t);if(o==null&&(o=await e.channels.retrieve(t),s.channels.set(o.key,o)),n!=null){const i=L.iT.aliasKey({range:n,channel:o.key});let l=s.rangeAliases.get(i);if(l==null)try{l={alias:await e.ranges.retrieveAlias(n,o.key),channel:o.key,range:n}}finally{s.rangeAliases.set(i,{channel:o.key,range:n})}l!=null&&(o.alias=l.alias)}return o},Gg=async({client:e,params:{keys:t,rangeKey:n},store:s})=>{const o=s.channels.get(t),i=new Set(o?.map(a=>a.key)),l=t.filter(a=>!i.has(a));if(l.length>0){const a=await e.channels.retrieve(l);o.push(...a),s.channels.set(a)}if(n!=null){const a=t.map(p=>L.iT.aliasKey({range:n,channel:p})),c=s.rangeAliases.get(a);c.forEach(p=>{if(p==null)return;const m=o.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=o.find(R=>R.key===g);E!=null&&(E.alias=h);const S=L.iT.aliasKey({range:n,channel:g});s.rangeAliases.set(S,{alias:h,channel:g,range:n})})}}return o},lc=async({params:{key:e,rangeKey:t},store:n,client:s,reset:o})=>{if(e==null)return;const i=await Tr({client:s,store:n,params:{key:e,rangeKey:t}});o(ic(i))},Mr=Ye({name:"Channel",retrieve:Tr,mountListeners:({store:e,onChange:t,params:{key:n,rangeKey:s},client:o})=>{const i=e.channels.onSet(d=>{if(s!=null){const x=e.rangeAliases.get(L.iT.aliasKey({range:s,channel:n}));x!=null&&(d.alias=x.alias)}t(d)},n);if(s==null)return i;const l=L.iT.aliasKey({range:s,channel:n}),a=e.rangeAliases.onSet(d=>{d!=null&&t(x=>o.channels.sugar({...x,alias:d.alias}))},l),c=e.rangeAliases.onDelete(()=>t(d=>o.channels.sugar({...d,alias:void 0})),l);return[i,a,c]}}),Ug=Ye({name:"Channels",retrieve:Gg,mountListeners:({store:e,onChange:t,params:{keys:n,rangeKey:s},client:o})=>{const i=new Set(n),l=e.channels.onSet(async d=>{if(i.has(d.key)){if(s!=null){const x=L.iT.aliasKey({range:s,channel:d.key});let p=e.rangeAliases.get(x);if(p==null)try{p={alias:await o.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?o.channels.sugar({...p,alias:d.alias}):p))}),c=e.rangeAliases.onDelete(d=>{const x=L.iT.decodeDeleteAliasChange(d);t(p=>p.map(m=>m.key===x.channel?o.channels.sugar({...m,alias:void 0}):m))});return[l,a,c]}}),ac=async({client:e,store:t,set:n,value:s})=>{const o=await e.channels.create(s());t.channels.set(o.key,o),n("key",o.key)},cc=({store:e,get:t,reset:n})=>e.channels.onSet(s=>{t("key").value===s.key&&n(ic(s))}),Wg=St({name:"Channel",schema:_r,initialValues:Lr,retrieve:lc,update:ac,mountListeners:cc}),Xg=St({name:"Calculated Channel",schema:rc,initialValues:Lr,retrieve:lc,update:ac,mountListeners:cc}),qg={internal:!1},Nr=Ve({name:"Channels",retrieveCached:({params:e,store:t})=>e.searchTerm!=null&&e.searchTerm.length>0?[]:t.channels.get(n=>!(e.internal!=null&&n.internal!==e.internal||e.calculated!=null&&n.isCalculated!==e.calculated||u.O$1.isNonZero(e.notDataTypes)&&e.notDataTypes.some(s=>new L.k(s).equals(n.dataType))||u.O$1.isNonZero(e.dataTypes)&&!e.dataTypes.some(s=>new L.k(s).equals(n.dataType))||e.isIndex!=null&&n.isIndex!==e.isIndex||e.virtual!=null&&n.virtual!==e.virtual)),retrieve:async({client:e,params:t,store:n})=>{const s=await e.channels.retrieve({...qg,...t});return n.channels.set(s),s},retrieveByKey:async({client:e,key:t,store:n})=>await Tr({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))]}),Qg=Fe({name:"Channel",update:async({client:e,value:t,store:n})=>{const s=await e.channels.create(t);n.channels.set(s.key,s)}}),Jg=Fe({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,o=>o==null?o:e.channels.sugar({...o,name:t})))}}),uc=Fe({name:"Channel Alias",update:async({client:e,value:t,store:n,params:{rangeKey:s,channelKey:o}})=>{if(s==null)return;const i={alias:t,channel:o,range:s};await e.ranges.setAlias(s,o,t),n.rangeAliases.set(L.iT.aliasKey(i),i)}}),dc=e=>{if(e==null)return f.Channel;if(L.Bb.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},xc=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e),s=dc(n?.payload);return r.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,children:[r.jsxRuntimeExports.jsx(s,{}),n?.name]})}),e1=({onChange:e,value:t,emptyContent:n,initialParams:s,filter:o,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=Nr({initialParams:s,filter:o}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return r.jsxRuntimeExports.jsx(As,{resourceName:"Channel",value:t,onChange:e,data:l,haulType:kt,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,icon:r.jsxRuntimeExports.jsx(f.Channel,{}),...i,children:xc})},Tt=({onChange:e,value:t,allowNone:n,emptyContent:s,initialParams:o,filter:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=Nr({initialParams:o,filter:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return r.jsxRuntimeExports.jsx(Dt,{resourceName:"Channel",onChange:e,value:t,allowNone:n,emptyContent:s,onFetchMore:m,onSearch:h,data:a,getItem:d,subscribe:x,status:p,haulType:kt,icon:r.jsxRuntimeExports.jsx(f.Channel,{}),...l,children:xc})},t1=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:gh,FLUX_STORE_CONFIG:oc,FLUX_STORE_KEY:sc,LinePlot:xg,SelectMultiple:e1,SelectSingle:Tt,ZERO_FORM_VALUES:Lr,calculatedFormSchema:rc,formSchema:_r,rename:Jg,resolveIcon:dc,retrieve:Mr,retrieveMany:Ug,update:Qg,updateAlias:uc,useCalculatedForm:Xg,useForm:Wg,useList:Nr,useListenForCalculationStatus:Yg},Symbol.toStringTag,{value:"Module"})),pc=({yDirection:e="up",...t})=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...t,keys:u.p.DIRECTIONS,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"x",children:r.jsxRuntimeExports.jsx(f.Arrow.Right,{})}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"y",children:e==="up"?r.jsxRuntimeExports.jsx(f.Arrow.Up,{}):r.jsxRuntimeExports.jsx(f.Arrow.Down,{})})]}),n1=Object.freeze(Object.defineProperty({__proto__:null,Select:pc},Symbol.toStringTag,{value:"Module"})),mc="groups",s1={channel:L.xb.SET_CHANNEL_NAME,schema:L.xb.groupZ,onChange:({store:e,changed:t})=>e.groups.set(t.key,t)},o1={channel:L.xb.DELETE_CHANNEL_NAME,schema:L.xb.keyZ,onChange:({store:e,changed:t})=>e.groups.delete(t)},fc={listeners:[s1,o1]},Io=async(e,t,n)=>{const s=n.groups.get(e);if(s!=null)return s;const o=await t.ontology.retrieve(L.xb.ontologyID(e));return n.groups.set(e,L.xb.groupZ.parse(o.data)),L.xb.groupZ.parse(o.data)},r1=Fe({name:"Group",update:async({value:e,client:t,onChange:n,store:s})=>{const{parent:o}=e,i=await t.ontology.groups.create(o,e.name,e.key);s.groups.set(i.key,i),n({...i,parent:o})}}),i1=Ve({name:"Group",retrieveCached:({store:e,params:t})=>{if(t.parent==null)return[];const n=e.relationships.get(s=>L.jb.matchRelationship(s,{from:t.parent,type:"parent"}));return e.groups.get(n.map(s=>s.to.key))},retrieve:async({client:e,params:t,store:n})=>{const{parent:s}=t;if(s==null)return[];const i=(await e.ontology.retrieveChildren(s,{...t,types:["group"]})).map(l=>L.xb.groupZ.parse(l.data));return n.groups.set(i),i.forEach(l=>{const a={from:s,type:"parent",to:L.xb.ontologyID(l.key)};n.relationships.set(L.jb.relationshipToString(a),a)}),i},retrieveByKey:async({client:e,key:t,store:n})=>await Io(t,e,n),mountListeners:({store:e,onChange:t,onDelete:n,params:{parent:s},client:o})=>[e.groups.onSet(i=>t(i.key,l=>l==null?null:i)),e.groups.onDelete(n),e.relationships.onSet(async i=>{if(s==null||!L.jb.matchRelationship(i,{from:s,type:"parent"}))return;const l=await Io(i.to.key,o,e);t(l.key,l)}),e.relationships.onDelete(async i=>{const l=L.jb.relationshipZ.parse(i);s==null||!L.jb.matchRelationship(l,{from:s,type:"parent"})||n(l.to.key)})]}),l1=Fe({name:"Group",update:async({client:e,value:t,params:n})=>await e.ontology.groups.rename(n.key,t)}).useDirect,a1=Fe({name:"Group",update:async({client:e,params:t})=>await e.ontology.groups.delete(t.key)}).useDirect,c1=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:fc,FLUX_STORE_KEY:mc,create:r1,singleRetrieve:Io,useDelete:a1,useList:i1,useRename:l1},Symbol.toStringTag,{value:"Module"})),hc="devices",u1={channel:L.Xb.SET_CHANNEL_NAME,schema:L.Xb.deviceZ,onChange:({store:e,changed:t})=>e.devices.set(t.key,n=>n==null?t:{...t,status:n.status})},d1={channel:L.Xb.DELETE_CHANNEL_NAME,schema:L.Xb.keyZ,onChange:({store:e,changed:t})=>e.devices.delete(t)},x1={channel:L.Xb.STATUS_CHANNEL_NAME,schema:L.Xb.statusZ,onChange:({store:e,changed:t})=>{e.devices.set(t.details.device,n=>n==null?n:{...n,status:t})}},gc={listeners:[u1,d1,x1]},p1=e=>{const t=ze();j.useEffect(()=>t.devices.onSet(e),[t])},jc=async(e,t,n)=>{const s=t.devices.get(n.key);if(s!=null)return s;const o=await e.hardware.devices.retrieve({...n,includeStatus:!0});return t.devices.set(n.key,o),o},m1=()=>Ye({name:"Device",retrieve:async({client:e,params:t,store:n})=>await jc(e,n,t),mountListeners:({store:e,onChange:t,params:{key:n}})=>[e.devices.onSet(s=>t(s),n)]}),Ec=Ve({name:"Devices",retrieveCached:({store:e,params:t})=>e.devices.get(n=>!(u.O$1.isNonZero(t.makes)&&!t.makes.includes(n.make)||u.O$1.isNonZero(t.models)&&!t.models.includes(n.model)||u.O$1.isNonZero(t.racks)&&!t.racks.includes(n.rack)||u.O$1.isNonZero(t.locations)&&!t.locations.includes(n.location)||u.O$1.isNonZero(t.names)&&!t.names.includes(n.name)||u.O$1.isNonZero(t.keys)&&!t.keys.includes(n.key))),retrieve:async({client:e,params:t,store:n})=>{const s=await e.hardware.devices.retrieve({includeStatus:!0,...t});return s.forEach(o=>n.devices.set(o.key,o)),s},retrieveByKey:async({client:e,key:t,store:n})=>await jc(e,n,{key:t}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.devices.onSet(s=>t(s.key,s)),e.devices.onDelete(n)]}),f1=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e);return r.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,className:u.CSS.BE("device","list-item"),justify:"between",align:"center",children:[r.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[r.jsxRuntimeExports.jsx(yc,{status:n?.status}),n?.name]}),r.jsxRuntimeExports.jsx(pr,{level:"small",color:9,weight:450,style:{marginTop:"0.25rem"},gap:"tiny",children:n?.location.split(".").map(s=>r.jsxRuntimeExports.jsx(Cn,{children:s},s))})]})}),h1=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:o,initialParams:i,disabled:l,icon:a=r.jsxRuntimeExports.jsx(f.Device,{}),...c})=>{const{data:d,retrieve:x,getItem:p,subscribe:m,status:h}=Ec({filter:n,initialParams:i}),{fetchMore:g,search:E}=nt.usePager({retrieve:x});return r.jsxRuntimeExports.jsx(Dt,{resourceName:"Device",value:t,onChange:e,data:d,getItem:p,subscribe:m,onFetchMore:g,onSearch:E,emptyContent:o,status:h,disabled:l,icon:a,...c,children:f1})},yc=({status:e,tooltipLocation:t="right"})=>{const n=e?.variant??"disabled",s=e?.message??"Device Status Unknown";return r.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[r.jsxRuntimeExports.jsx(f.Summary,{variant:n,hideIcon:!0,level:"small",weight:450,children:s}),r.jsxRuntimeExports.jsx(ur,{variant:n,className:u.CSS.BE("device","status-indicator")})]})},g1=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:gc,FLUX_STORE_KEY:hc,SelectSingle:h1,StatusIndicator:yc,retrieve:m1,useList:Ec,useSetSynchronizer:p1},Symbol.toStringTag,{value:"Module"})),Sc="racks",j1={channel:L.eT.SET_CHANNEL_NAME,schema:L.eT.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)}},E1={channel:L.eT.DELETE_CHANNEL_NAME,schema:L.eT.keyZ,onChange:({store:e,changed:t})=>e.racks.delete(t)},y1={channel:L.eT.STATUS_CHANNEL_NAME,schema:L.eT.statusZ,onChange:({store:e,changed:t})=>e.racks.set(t.details.rack,n=>n==null?n:{...n,status:t})},Rc={listeners:[j1,E1,y1]},Cc={includeStatus:!0},bc=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},wc=Ve({name:"Racks",retrieveCached:({store:e})=>e.racks.list(),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 bc({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)]}),S1=Ye({name:"Rack",retrieve:bc,mountListeners:({store:e,onChange:t,params:{key:n}})=>[e.racks.onSet(t,n)]}),R1=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);return r.jsxRuntimeExports.jsxs(f.ListItem,{...e,align:"center",justify:"between",children:[r.jsxRuntimeExports.jsx(f.Text,{children:n?.name}),r.jsxRuntimeExports.jsx(vc,{status:n?.status,tooltipLocation:"left"})]})}),C1=({value:e,onChange:t,filter:n,allowNone:s,emptyContent:o,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=wc({initialParams:{includeStatus:!0,...i},filter:n}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return r.jsxRuntimeExports.jsx(Dt,{resourceName:"Driver",value:e,onChange:t,data:a,getItem:d,subscribe:x,onFetchMore:m,onSearch:h,emptyContent:o,status:p,icon:r.jsxRuntimeExports.jsx(f.Rack,{}),...l,children:R1})},vc=({status:e,tooltipLocation:t="right"})=>{const n=j.useRef(null),s=e?.variant??"disabled";return j.useEffect(()=>{if(s!=="success")return;const o=n.current;o&&(o.classList.remove(u.CSS.BEM("rack","heartbeat","beat")),requestAnimationFrame(()=>o.classList.add(u.CSS.BEM("rack","heartbeat","beat"))))},[e]),r.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[r.jsxRuntimeExports.jsx(f.Summary,{variant:s,hideIcon:!0,level:"small",weight:450,children:e?.message}),r.jsxRuntimeExports.jsx(f.Heart,{ref:n,className:u.CSS.BE("rack","heartbeat"),style:{color:cr[s]}})]})},b1=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:Rc,FLUX_STORE_KEY:Sc,SelectSingle:C1,StatusIndicator:vc,retrieve:S1,useList:wc},Symbol.toStringTag,{value:"Module"})),kc="tasks",w1=["start","stop"],v1={channel:L.rT.SET_CHANNEL_NAME,schema:L.rT.keyZ,onChange:async({store:e,changed:t,client:n})=>e.tasks.set(t,await n.hardware.tasks.retrieve({key:t,includeStatus:!0}),"config")},k1={channel:L.rT.DELETE_CHANNEL_NAME,schema:L.rT.keyZ,onChange:({store:e,changed:t})=>e.tasks.delete(t)},_1=L.rT.statusZ(ne.z.unknown()),L1={channel:L.rT.STATUS_CHANNEL_NAME,schema:_1,onChange:async({store:e,changed:t,client:n})=>{if(!e.tasks.has(t.details.task)){const o=await n.hardware.tasks.retrieve({key:t.details.task});e.tasks.set(t.details.task,o,"config")}e.tasks.set(t.details.task,o=>o==null?o:n.hardware.tasks.sugar({...o,status:t}),"status")}},T1={channel:L.rT.COMMAND_CHANNEL_NAME,schema:L.rT.commandZ,onChange:({store:e,changed:t,client:n})=>e.tasks.set(t.task,s=>s==null||!w1.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:{}}}}),"status")},M1=e=>{const t=ze();j.useEffect(()=>t.tasks.onSet(n=>{n.status!=null&&e(n.status)}),[t])},_c={listeners:[v1,k1,L1,T1]},Pr=async(e,t,n,s)=>{const o=t.tasks.get(n.key);if(o!=null)return o;const i=await e.hardware.tasks.retrieve({...n,includeStatus:!0,schemas:s});return t.tasks.set(n.key,i,"config"),i},N1=e=>Ye({name:"Task",retrieve:async({client:t,params:n,store:s})=>n.key==null?null:await Pr(t,s,{key:n.key,includeStatus:!0},e),mountListeners:({store:t,params:{key:n},onChange:s})=>[t.tasks.onSet(o=>{n==null||o.key!==n||s(o)},n)]}),P1=Ve({name:"Task",retrieveCached:({store:e})=>e.tasks.list(),retrieve:async({client:e,params:t,store:n})=>{const s=await e.hardware.tasks.retrieve({includeStatus:!0,...t});return s.forEach(o=>n.tasks.set(o.key,o,"config")),s},retrieveByKey:async({client:e,key:t,store:n})=>await Pr(e,n,{key:t}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.tasks.onSet(s=>t(s.key,s)),e.tasks.onDelete(n)]}),A1=e=>ne.z.object({key:L.rT.keyZ.optional(),name:ne.z.string(),rackKey:ne.z.number(),type:e.typeSchema,snapshot:ne.z.boolean(),config:e.configSchema,status:L.rT.statusZ(e.statusDataSchema).optional().nullable()}),Xn=e=>({key:e.key,name:e.name,rackKey:e.key==null?0:L.rT.rackKey(e.key),type:e.type,config:e.config,status:e.status,snapshot:e.snapshot??!1}),O1=({schemas:e,initialValues:t})=>{const n=A1(e),s=Xn(t);return St({name:"Task",schema:n,initialValues:s,retrieve:async({client:o,store:i,params:{key:l},reset:a})=>{if(l==null)return;const c=await Pr(o,i,{key:l},e);a(Xn(c.payload))},update:async({client:o,params:i,store:l,...a})=>{const c=a.value(),x=await(await o.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),"config");const p=Xn(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:o,get:i,reset:l,set:a})=>[o.tasks.onSet((c,d)=>{const x=i("key",{optional:!0})?.value;if(!(x==null||x!==c.key))if(d==="config"){const p=c.payload;l(Xn(p))}else d==="status"&&a("status",c.status)})]})},I1=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:_c,FLUX_STORE_KEY:kc,createForm:O1,createRetrieveQuery:N1,useList:P1,useStatusSynchronizer:M1},Symbol.toStringTag,{value:"Module"})),Lc="labels",D1={channel:L.sT.SET_CHANNEL_NAME,schema:L.sT.labelZ,onChange:({store:e,changed:t})=>e.labels.set(t.key,t)},B1={channel:L.sT.DELETE_CHANNEL_NAME,schema:L.sT.keyZ,onChange:({store:e,changed:t})=>e.labels.delete(t)},Tc={listeners:[D1,B1]},Qt=(e,t)=>L.jb.matchRelationship(e,{from:t,type:L.sT.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE}),Mc=Ye({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(o=>{s(i=>{const l=i.filter(a=>a.key!==o.key);return l.length===i.length?i:[...l,o]})}),t.labels.onDelete(o=>s(i=>i.filter(l=>l.key!==o))),t.relationships.onSet(async o=>{if(!Qt(o,n))return;const{key:i}=o.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(o=>{const i=L.jb.relationshipZ.parse(o);Qt(i,n)&&s(l=>l.filter(a=>a.key!==i.to.key))})]}),Ar=Ve({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 o=s?new Set(s):void 0;return[e.labels.onSet(async i=>{o!=null&&!o.has(i.key)||t(i.key,i,{mode:"prepend"})}),e.labels.onDelete(async i=>n(i))]}}),Nc=L.sT.labelZ.partial({key:!0}),$1=St({name:"Label",initialValues:{name:"",color:"#000000"},schema:Nc,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)]}),z1=Fe({name:"Label",update:async({client:e,params:{key:t}})=>await e.labels.delete(t)}).useDirect,Or="label",V1=({itemKey:e,...t})=>{const n=f.useItem(e),{selected:s,onSelect:o,hovered:i}=f.useItemState(e);return n==null?null:r.jsxRuntimeExports.jsx(f.Item,{itemKey:e,onSelect:o,selected:s,hovered:i,...t,children:r.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[r.jsxRuntimeExports.jsx(f.Circle,{color:n?.color,size:"2.5em"}),n?.name]})})},Pc=f.renderProp(V1),F1=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t),{onSelect:s}=f.useItemState(t);return n==null?null:r.jsxRuntimeExports.jsx(Os,{color:n.color,onClose:s,size:"small",children:n.name})}),H1={variant:"text"},Z1=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:o,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=Ar({filter:s,initialParams:o}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return r.jsxRuntimeExports.jsx(As,{resourceName:"Label",haulType:Or,value:t,onChange:e,data:l,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,renderTag:F1,icon:r.jsxRuntimeExports.jsx(f.Label,{}),triggerProps:H1,variant:"floating",...i,children:Pc})},K1=({onChange:e,value:t,allowNone:n,emptyContent:s,filter:o,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=Ar({filter:o,initialParams:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return r.jsxRuntimeExports.jsx(Dt,{resourceName:"Label",value:t,onChange:e,data:a,getItem:d,subscribe:x,allowNone:n,onFetchMore:m,onSearch:h,emptyContent:s,status:p,haulType:Or,...l,children:Pc})},Y1=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:Tc,FLUX_STORE_KEY:Lc,HAUL_TYPE:Or,SelectMultiple:Z1,SelectSingle:K1,formSchema:Nc,matchRelationship:Qt,retrieveLabelsOf:Mc,useDelete:z1,useForm:$1,useList:Ar},Symbol.toStringTag,{value:"Module"})),$s=new Error("Tab not found"),G1=new Error("Invalid Mosaic"),ps=(e,t,n="center",s,o)=>{if(e=Ge(e),s===void 0)return Do(e,t);const i=Bo(e,s);if(n==="center")return i.tabs||=[],o!==void 0&&o>=0&&o<=i.tabs.length?i.tabs.splice(o,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(Bo(e,c).key!==i.key)return ps(e,t,"center",c);if(i.tabs==null||i.tabs.length===0)return ps(e,t,"center",s);const[d,x,p]=J1(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 G1;return i.first.key=l,i.last.key=a,i.tabs=void 0,i.size=void 0,i.selected=void 0,e},U1=(e,t,n)=>{e=Ge(e);const[s,o]=Mt(e,t);if(s==null||o==null)throw $s;return o.tabs=o.tabs?.map(i=>i.tabKey===t?n(i):i),e},Do=(e,t)=>(e=Ge(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=Do(e.first,t):e.last!=null&&(e.last=Do(e.last,t)),e)),ms=e=>{e=Ge(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]=ms(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=ms(e.last);e.last=n,t.push(...s)}return[e,t]},Ir=(e,t)=>{e=Ge(e);const[,n]=Mt(e,t);if(n==null)return[e,null];n.tabs=n.tabs?.filter(o=>o.tabKey!==t),n.selected=Me.resetSelection(n.selected,n.tabs),e=Q1(e);const s=n.selected??fs(e);return[e,s]},fs=e=>e.selected!=null?e.selected:e.first!=null?fs(e.first):e.last!=null?fs(e.last):null,Ac=(e,t)=>{e=Ge(e);const[n,s]=Mt(e,t);if(n==null||s==null)throw $s;return s.selected=t,e},Oc=(e,t,n,s,o)=>{e=Ge(e);const[i,l]=Mt(e,t);if(i==null||l==null)throw $s;const[a,c]=Ir(e,t);return[ps(a,i,n,s,o),c]},bn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=bn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=bn(e.last,t);if(n!=null)return n}},Ic=(e,t,n)=>{const s=hs(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},W1=(e,t,n)=>{e=Ge(e);const s=bn(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 o=s.tabs.findIndex(x=>x.tabKey===t);if(o===-1)throw new Error("Tab not found in node");const i=s.tabs[o];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},X1=(e,t)=>{const n=bn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Dc=(e,t,n)=>{e=Ge(e);const[,s]=Mt(e,t);if(s?.tabs==null)throw $s;return s.tabs=Me.rename(t,n,s?.tabs??[]),e},q1=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,Bo=(e,t)=>{const n=hs(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:Bo(e,s)},Q1=e=>{let t=!0;for(;t;)[e,t]=$o(e);return e=Vo(e,1),e},$o=e=>{if(e.first==null||e.last==null)return[e,!1];if(Ii(e.first))return[Oi(e.last),!0];if(Ii(e.last))return[Oi(e.first),!0];let t,n;return[e.first,t]=$o(e.first),[e.last,n]=$o(e.last),[e,t||n]},Oi=e=>(e.size=void 0,e),Ii=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),Mt=(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]=Mt(e.first,t);if(n!=null&&s!=null)return[n,s];const[o,i]=Mt(e.last,t);return[o,i]},hs=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=hs(e.first,t);return n??hs(e.last,t)},J1=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")}},Ge=e=>({...e,first:e.first!=null?Ge(e.first):void 0,last:e.last!=null?Ge(e.last):void 0}),gs=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&gs(e.first,t,n),e.last!=null&&gs(e.last,t,n),n),zo=(e,t)=>{t(e),e.first!=null&&zo(e.first,t),e.last!=null&&zo(e.last,t)},Vo=(e,t)=>(e=Ge(e),e.key=t,e.first!=null&&(e.first=Vo(e.first,t*2)),e.last!=null&&(e.last=Vo(e.last,t*2+1)),e);class Bc{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 ej=({node:e})=>{const t=j.createRef(),n=j.useRef(e);return j.useEffect(()=>{const s=t.current;if(s==null)return;const o=s.parentNode;if(o!=null)return e.mount(o,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 o=s.parentNode;o!=null&&e.mount(o,s)},[e]),r.jsxRuntimeExports.jsx("div",{ref:t})},$c=({node:e,children:t})=>Ql.createPortal(t,e.el),tj=Object.freeze(Object.defineProperty({__proto__:null,In:$c,Node:Bc,Out:ej},Symbol.toStringTag,{value:"Module"})),js=j.memo(({root:e,onDrop:t,onResize:n,onCreate:s,onFileDrop:o,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:k}=e,T={onDrop:t,onResize:n,onCreate:s,onFileDrop:o,children:i,onClose:d,contextMenu:m,onSelect:c,onRename:x,onReorder:p,activeTab:l,addTooltip:h},P=j.useCallback(([$])=>n(C,$),[n]),{props:I}=ua({direction:R,onResize:P,count:2,initialSizes:k!=null?[k]:void 0});let B={};C==1&&(B={...E,className:u.CSS(u.CSS.B("mosaic"),g)});let F;return S!==void 0?F=r.jsxRuntimeExports.jsx(zc,{root:e,emptyContent:a,...B,...T}):v!=null&&y!=null?F=r.jsxRuntimeExports.jsxs(da,{id:`mosaic-${C}`,align:"stretch",...I,...B,children:[r.jsxRuntimeExports.jsx(js,{...T,root:v,onResize:n},v.key),r.jsxRuntimeExports.jsx(js,{...T,root:y,onResize:n},y.key)]}):(F=null,console.warn("Mosaic tree is malformed")),F});js.displayName="Mosaic";const Es="pluto-mosaic-tab-drop",Dr="pluto-mosaic-tab-create",nj=(e,t,n)=>{if(f.filterByType(f.FILE_TYPE,t).length>0&&n)return!0;const o=f.filterByType(Es,t).map(a=>a.key),i=e.filter(a=>!o.includes(a.tabKey)).length>0;return f.filterByType(Dr,t).length>0||o.length>0&&(i||e.length===0)},zc=j.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:o,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})=>nj(p,B,g),[p,g]),S=j.useCallback(({items:B,event:F})=>{if(F==null)return[];const $=oj(F);h(null);const D=f.filterByType(f.FILE_TYPE,B).length>0,{percents:z}=Di(F),b=p.length===0?"center":Bi(z);if(D)return a?.(x,b,F),B;const N=f.filterByType(Es,B);if(N.length>0){const M=N.map(({key:V})=>V)[0];t(x,M,b,$)}const _=f.filterByType(Dr,B);if(_.length>0){const M=_.map(({key:V})=>V);n?.(x,b,M)}return N},[t,p.length]),R=j.useCallback(({event:B})=>{if(B==null)return;const{percents:F,inSelector:$}=Di(B);let D=null;$||(D=p.length===0?"center":Bi(F)),h(D)},[p.length]),{startDrag:v,...y}=f.useDragAndDrop({type:"Mosaic",canDrop:E,onDrop:S,onDragOver:R}),C=E(f.useDraggingState()),k=j.useCallback(()=>h(null),[]),T=j.useCallback((B,{tabKey:F})=>{v([{key:F,type:Es,elementID:B.currentTarget.id}])},[v]),P=j.useCallback(()=>n?.(x,"center"),[x]),I=x==1&&p.length==0;return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:r.jsxRuntimeExports.jsxs(Me.Tabs,{id:`tab-${x}`,tabs:p,className:u.CSS(i,I&&m!=null&&u.CSS.M("drag-over")),onDragLeave:k,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:T,onCreate:P,addTooltip:c,...y,...d,children:[e.selected!=null&&o(p.find(B=>B.tabKey===e.selected)),C&&r.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),m!=null&&r.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("mosaic","mask"),style:sj[m]})]})})});zc.displayName="MosaicTabLeaf";const sj={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%"}},Di=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}},oj=e=>{const t=e.target.closest(".pluto-tabs-selector__btn");if(t!=null)return Array.from(t.parentElement?.children??[]).indexOf(t)},rj=e=>e,ij=e=>1-e,Bi=({x:e,y:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[rj(e),ij(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")},lj=({root:e,onSelect:t,children:n})=>{const s=j.useRef(new Map),o=new Set,i=gs(e,l=>l.tabs?.map(a=>{let c=s.current.get(a.tabKey);return a==null?null:(c==null&&(c=new Bc({style:"width: 100%; height: 100%; position: relative;"}),c.el.addEventListener("click",()=>t?.(a.tabKey)),s.current.set(a.tabKey,c)),o.add(a.tabKey),r.jsxRuntimeExports.jsx($c,{node:c,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})).flat().filter(l=>l!=null);return s.current.forEach((l,a)=>!o.has(a)&&s.current.delete(a)),[s,i]},Fo=ne.z.object({key:ne.z.number(),tabs:ne.z.array(Me.tabZ).optional(),selected:ne.z.string().optional(),direction:u.p.direction.optional(),size:ne.z.number().optional(),get first(){return Fo.optional()},get last(){return Fo.optional()}}),aj=({allowRename:e=!1,initialTree:t})=>{const[n,s]=j.useState(t);return j.useEffect(()=>s(ms(t)[0]),[t]),{root:n,onDrop:(d,x,p)=>s(m=>Oc(m,x,p,d)[0]),onClose:d=>s(x=>Ir(x,d)[0]),onSelect:d=>s(x=>Ac(x,d)),onResize:(d,x)=>s(p=>Ic(p,d,x)),onRename:e?(d,x)=>s(p=>Dc(p,d,x)):void 0}},cj=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Dr,HAUL_DROP_TYPE:Es,Mosaic:js,autoSelectTabs:ms,canSplit:X1,findSelected:fs,findTabNode:bn,forEachNode:zo,insertTab:ps,isEmpty:q1,mapNodes:gs,moveTab:Oc,nodeZ:Fo,removeTab:Ir,renameTab:Dc,resizeNode:Ic,selectTab:Ac,split:W1,updateTab:U1,use:aj,usePortal:lj},Symbol.toStringTag,{value:"Module"})),uj=({variant:e,className:t,...n})=>r.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(t,u.CSS.B("note"),u.CSS.M(e)),align:"stretch",empty:!0,...n}),dj=Object.freeze(Object.defineProperty({__proto__:null,Note:uj},Symbol.toStringTag,{value:"Module"})),Vc="relationships",Fc="resources",xj={channel:L.jb.RELATIONSHIP_SET_CHANNEL_NAME,schema:L.jb.relationshipZ,onChange:({store:e,changed:t})=>e.relationships.set(L.jb.relationshipToString(t),t)},pj={channel:L.jb.RELATIONSHIP_DELETE_CHANNEL_NAME,schema:L.jb.relationshipZ,onChange:({store:e,changed:t})=>e.relationships.delete(L.jb.relationshipToString(t))},Hc={listeners:[xj,pj]},mj={channel:L.jb.RESOURCE_SET_CHANNEL_NAME,schema:L.jb.idZ,onChange:async({store:e,changed:t,client:n})=>e.resources.set(L.jb.idToString(t),await n.ontology.retrieve(t))},fj={channel:L.jb.RESOURCE_DELETE_CHANNEL_NAME,schema:L.jb.idZ,onChange:({store:e,changed:t})=>e.resources.delete(t.key)},Zc={listeners:[mj,fj]},hj=e=>{const t=ze();j.useEffect(()=>t.resources.onSet(e),[t.resources])},gj=e=>{const t=ze();j.useEffect(()=>{const n=t.resources.onDelete(async s=>e(L.jb.idZ.parse(s)));return()=>n()},[t.resources])},jj=e=>{const t=ze();j.useEffect(()=>t.relationships.onSet(e),[t.relationships])},Ej=e=>{const t=ze();j.useEffect(()=>t.relationships.onDelete(n=>e(L.jb.relationshipZ.parse(n))),[t.relationships])},Kc=e=>Ve({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:o,params:{id:i}})=>[t.relationships.onSet(async l=>{if(L.jb.matchRelationship(l,{type:"parent",[L.jb.oppositeRelationshipDirection(e)]:i})){const a=await o.ontology.retrieve(l[e]);n(a.key,a)}}),t.relationships.onDelete(l=>{const a=L.jb.relationshipZ.parse(l);L.jb.matchRelationship(a,{type:"parent",[L.jb.oppositeRelationshipDirection(e)]:i})&&s(L.jb.idToString(a[e]))}),t.resources.onSet(l=>n(l.key,a=>a==null?null:{...a,...l})),t.resources.onDelete(async l=>s(l))]}),yj=Kc("to"),Sj=Ve({name:"useResourceList",retrieveCached:({store:e})=>e.resources.list(),retrieve:async({client:e,params:t,store:n})=>{const s=await e.ontology.retrieve(t);return s.forEach(o=>n.resources.set(o.key,o)),s},retrieveByKey:async({client:e,key:t,store:n})=>{const s=await e.ontology.retrieve(L.jb.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))]}),Rj=Ye({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:o})=>o.type===t.type);return s==null?null:s.id},mountListeners:({store:e,onChange:t,client:n,params:{id:s}})=>[e.relationships.onSet(async o=>{if(L.jb.matchRelationship(o,{type:L.jb.PARENT_OF_RELATIONSHIP_TYPE,to:s})){const i=await n.ontology.retrieve(o.from);t(i.id)}else t(null)}),e.relationships.onDelete(async o=>{const i=L.jb.relationshipZ.parse(o);L.jb.matchRelationship(i,{type:L.jb.PARENT_OF_RELATIONSHIP_TYPE,to:s})&&t(null)})]}),Cj=Object.freeze(Object.defineProperty({__proto__:null,RELATIONSHIPS_FLUX_STORE_KEY:Vc,RELATIONSHIP_FLUX_STORE_CONFIG:Hc,RESOURCES_FLUX_STORE_KEY:Fc,RESOURCE_FLUX_STORE_CONFIG:Zc,createDependentsListHook:Kc,retrieveParentID:Rj,useChildren:yj,useRelationshipDeleteSynchronizer:Ej,useRelationshipSetSynchronizer:jj,useResourceDeleteSynchronizer:gj,useResourceList:Sj,useResourceSetSynchronizer:hj},Symbol.toStringTag,{value:"Module"})),mo={Close:r.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),r.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:r.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:r.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.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"}),r.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"})]})},bj=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:o,onFullscreen:i,onClose:l,...a})=>r.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:[r.jsxRuntimeExports.jsx(fo,{onClick:l,className:u.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:mo.Close}),r.jsxRuntimeExports.jsx(fo,{onClick:s,className:u.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:mo.Minimize}),r.jsxRuntimeExports.jsx(fo,{onClick:i,className:u.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:mo.Maximize})]}),fo=({className:e,disabled:t,color:n,...s})=>r.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("macos-control"),u.CSS.disabled(t),e),tabIndex:-1,disabled:t,...s}),wj=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:o,focused:i,contrast:l=2,...a})=>r.jsxRuntimeExports.jsxs(f.Box,{pack:!0,...a,children:[r.jsxRuntimeExports.jsx(ho,{className:u.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),contrast:l,children:r.jsxRuntimeExports.jsx(f.Subtract,{})}),r.jsxRuntimeExports.jsx(ho,{className:u.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),contrast:l,children:r.jsxRuntimeExports.jsx(f.Box$1,{})}),r.jsxRuntimeExports.jsx(ho,{onClick:s,className:u.CSS.BM("windows-control","close"),disabled:e.includes("close"),contrast:l,children:r.jsxRuntimeExports.jsx(f.Close,{})})]}),ho=({disabled:e=!1,className:t,...n})=>e?null:r.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.B("windows-control"),t),tabIndex:-1,...n}),Yc=u.S.getOS,vj="Windows",kj=({forceOS:e,visibleIfOS:t,...n})=>{const s=Yc({force:e,default:vj});if(t!=null&&t!==s)return null;const o=s==="macOS"?bj:wj;return r.jsxRuntimeExports.jsx(o,{...n})},_j=Object.freeze(Object.defineProperty({__proto__:null,Controls:kj,use:Yc},Symbol.toStringTag,{value:"Module"})),Lj=(e,t)=>{const n=s=>r.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},Tj=Object.freeze(Object.defineProperty({__proto__:null,createComponent:Lj},Symbol.toStringTag,{value:"Module"}));j.createContext({instrumentation:L.O.NOOP});const Mj=({children:e,...t})=>{const{path:n}=f.useUnidirectional({type:L.Provider$1.TYPE,schema:L.providerStateZ,state:t});return r.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})},Nj="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjUgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Gc="rangeKV",Uc="rangeAliases",wn=async(e,t,n)=>{const s=t.ranges.get(n);if(s!=null)return s;const o=await e.ranges.retrieve({keys:[n],includeParent:!0,includeLabels:!0});return t.ranges.set(n,o[0]),o[0]},Pj=async(e,t,n)=>{const s=await e.ranges.retrieve({...n,includeParent:!0,includeLabels:!0});return t.ranges.set(s),s},Aj=e=>{const t=ze();j.useEffect(()=>t.ranges.onSet(n=>e(n.payload)),[t])},Oj=e=>{const t=ze();j.useEffect(()=>t.ranges.onDelete(n=>e(n)),[t])},Wc=async(e,t,n,s)=>{if(L.jb.matchRelationship(e,{from:{type:"range"},type:L.sT.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]}))}},Xc=async(e,t,n,s)=>{if(L.jb.matchRelationship(e,{from:{type:"range"},type:L.jb.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}))}},Ij=Ve({name:"Range",retrieve:async({client:e,params:{key:t},store:n})=>{const s=await e.ontology.retrieveChildren(L.iT.ontologyID(t),{types:["range"]});return s.length===0?[]:await Pj(e,n,{keys:s.map(({id:{key:o}})=>o)})},retrieveByKey:async({client:e,key:t,store:n})=>await wn(e,n,t),mountListeners:({store:e,onChange:t,onDelete:n,client:s,params:{key:o}})=>[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(o==null)return;if(await Xc(i,t,s,e),await Wc(i,t,s,e),L.jb.matchRelationship(i,{from:L.iT.ontologyID(o),type:L.jb.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=>{if(o==null)return;const l=L.jb.relationshipZ.parse(i);if(L.jb.matchRelationship(l,{from:L.iT.ontologyID(o),type:L.jb.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}}))return n(l.to.key);l.type===L.sT.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)}))})]}),Dj=Ye({name:"Range",retrieve:async({client:e,params:{id:t}})=>{const s=(await e.ontology.retrieveParents(t)).find(({id:{type:o}})=>o==="range");return s==null?null:e.ranges.sugarOntologyResource(s)},mountListeners:({store:e,onChange:t,client:n,params:{id:s}})=>[e.ranges.onSet(o=>{t(i=>i==null||i.key!==o.key?i:n.ranges.sugarOne({...o,parent:o.parent??i.parent,labels:o.labels??i.labels}))}),e.relationships.onSet(async o=>{if(!L.jb.matchRelationship(o,{type:L.jb.PARENT_OF_RELATIONSHIP_TYPE,to:s}))return;if(!(o.from.type==="range"))return t(null);const a=await wn(n,e,o.from.key);t(n.ranges.sugarOne(a.payload))}),e.relationships.onDelete(async o=>{const i=L.jb.relationshipZ.parse(o);L.jb.matchRelationship(i,{type:L.jb.PARENT_OF_RELATIONSHIP_TYPE,to:s})&&t(null),L.jb.matchRelationship(i,{type:L.sT.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)}))})]}),qc=Ye({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 o=>{if(o!=null)return t(o)},s),e.relationships.onSet(async o=>{if(Qt(o,L.iT.ontologyID(s))){const a=await n.labels.retrieve({key:o.to.key});e.labels.set(o.to.key,a),t(c=>c==null?c:n.ranges.sugarOne({...c,labels:[...(c.labels??[]).filter(d=>d.key!==a.key),a]}))}if(L.jb.matchRelationship(o,{type:L.jb.PARENT_OF_RELATIONSHIP_TYPE,to:L.iT.ontologyID(s)})){const a=await n.ranges.retrieve(o.from.key);e.ranges.set(o.from.key,a),t(c=>c==null?c:n.ranges.sugarOne({...c,parent:a}))}},s)]}),Bj=qc.useDirect,Qc=ne.z.object({...L.iT.payloadZ.omit({timeRange:!0}).partial({key:!0}).shape,labels:ne.z.array(L.sT.keyZ),parent:ne.z.string().optional(),timeRange:ne.z.object({start:ne.z.number(),end:ne.z.number()})}),Ho=async e=>({...e.payload,timeRange:e.timeRange.numeric,parent:e.parent?.key,labels:e.labels?.map(t=>t.key)??[]}),$j={name:"",labels:[],parent:"",timeRange:{start:0,end:0}},zj=St({name:"Range",schema:Qc,initialValues:$j,retrieve:async({client:e,params:{key:t},store:n,reset:s})=>{t!=null&&s(await Ho(await wn(e,n,t)))},update:async({client:e,value:t,reset:n,store:s})=>{const o=t(),i=o.parent,l=u.O$1.isNonZero(i)?L.iT.ontologyID(i):void 0,a=await e.ranges.create(o,{parent:l});await e.labels.label(a.ontologyID,o.labels,{replace:!0});const c=s.labels.get(o.labels),d=new Set(c.map(m=>m.key)),x=o.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$1.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({...o,...a.payload,timeRange:a.timeRange.numeric,labels:o.labels,parent:o.parent})},mountListeners:({store:e,reset:t,get:n,set:s})=>[e.ranges.onSet(async o=>{const i=await Ho(o),l=n("key",{optional:!0})?.value;if(l==null||l!==o.key)return;const a=n("parent",{optional:!0})?.value,c=n("labels").value;t({...i,labels:c,parent:a})}),e.relationships.onSet(o=>{const i=n("key",{optional:!0})?.value;if(i==null)return;const l=L.iT.ontologyID(i);if(Qt(o,l)){const d=n("labels").value;return s("labels",[...d.filter(x=>x!==o.to.key),o.to.key])}L.jb.matchRelationship(o,{type:L.jb.PARENT_OF_RELATIONSHIP_TYPE,to:l})&&s("parent",o.from.key)}),e.relationships.onDelete(o=>{const i=n("key",{optional:!0})?.value;if(i==null)return;const l=L.jb.relationshipZ.parse(o),a=L.iT.ontologyID(i);if(Qt(l,a))return s("labels",n("labels").value.filter(x=>x!==l.to.key));if(L.jb.matchRelationship(l,{type:L.jb.PARENT_OF_RELATIONSHIP_TYPE,to:a}))return s("parent",void 0)})]}),Vj=e=>Mc.useDirect({params:{id:L.iT.ontologyID(e)}}),Fj={includeParent:!0,includeLabels:!0},Br=Ve({name:"Ranges",retrieveCached:({store:e,params:t})=>e.ranges.get(n=>u.O$1.isNonZero(t.keys)?t.keys.includes(n.key):!0),retrieve:async({client:e,params:t})=>await e.ranges.retrieve({...Fj,...t}),retrieveByKey:async({client:e,key:t,store:n})=>{const s=n.ranges.get(t);if(s!=null)return s;const o=await e.ranges.retrieve(t);return n.ranges.set(t,o),o},mountListeners:({store:e,onChange:t,onDelete:n,client:s,params:{keys:o}})=>{const i=o!=null&&o.length>0,l=new Set(o);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 Xc(a,t,s,e),await Wc(a,t,s,e)})]}}),Hj=ne.z.object({pairs:ne.z.array(ne.z.object({key:ne.z.string(),value:ne.z.string()}))}),Jc=ne.z.string().transform(e=>e.split("<--->")).transform(([e,t])=>({key:t,range:e})),Zj={channel:L.iT.KV_SET_CHANNEL,schema:L.iT.kvPairZ,onChange:({store:e,changed:t})=>{e.rangeKV.set(L.iT.kvPairKey(t),t)}},Kj={channel:L.iT.KV_DELETE_CHANNEL,schema:Jc,onChange:({store:e,changed:t})=>e.rangeKV.delete(L.iT.kvPairKey(t))},eu={listeners:[Zj,Kj]},Yj=Ve({name:"Range Meta Data",retrieve:async({client:e,params:{rangeKey:t}})=>{const s=await e.ranges.getKV(t).list();return Object.entries(s).map(([o,i])=>({key:o,value:i,range:t}))},retrieveByKey:async({client:e,key:t,params:{rangeKey:n}})=>{if(n==null)return;const o=await e.ranges.getKV(n).get(t);return{key:t,value:o,range:n}},mountListeners:({store:e,onChange:t,onDelete:n,params:{rangeKey:s}})=>[e.rangeKV.onSet(o=>{o.range===s&&t(o.key,o)}),e.rangeKV.onDelete(o=>{const i=Jc.parse(o);i.range===s&&n(i.key)})]}),tu=L.iT.kvPairZ,Gj=St({name:"Range Meta Data",schema:tu,retrieve:async()=>{},update:async({client:e,value:t})=>{const{key:n,value:s,range:o}=t();await e.ranges.getKV(o).set(n,s)},initialValues:{key:"",value:"",range:""}}),Uj=Fe({name:"Range Meta Data",update:async({client:e,value:t,params:{rangeKey:n}})=>{await e.ranges.getKV(n).delete(t)}}),Wj=Fe({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)}}),Xj=Fe({name:"Range",update:async({client:e,value:t,onChange:n,store:s})=>{const o=await e.ranges.create(t);s.ranges.set(o.key,o),n(o)}}),qj=Fe({name:"Range",update:async({client:e,value:t,store:n})=>{await e.ranges.delete(t),n.ranges.delete(t)}}),Qj={channel:L.iT.SET_ALIAS_CHANNEL_NAME,schema:L.iT.aliasZ,onChange:({store:e,changed:t})=>{e.rangeAliases.set(L.iT.aliasKey(t),t)}},Jj=ne.z.string().transform(e=>L.iT.decodeDeleteAliasChange(e)),e0={channel:L.iT.DELETE_ALIAS_CHANNEL_NAME,schema:Jj,onChange:({store:e,changed:t})=>e.rangeAliases.delete(L.iT.aliasKey(t))},nu={listeners:[Qj,e0]},su=({timeRange:e,level:t="p",color:n=9,showSpan:s=!1,...o})=>{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=r.jsxRuntimeExports.jsxs(f.Text,{x:!0,align:"center",gap:"small",children:[i.isToday&&r.jsxRuntimeExports.jsx(f.Text,{level:t,color:n,weight:450,children:"Today"}),r.jsxRuntimeExports.jsx(f.DateTime,{el:"span",level:t,displayTZ:"local",format:l,color:n,weight:450,children:i})]}),m=r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[c?r.jsxRuntimeExports.jsx(f.Text,{level:t,el:"span",children:"Now"}):r.jsxRuntimeExports.jsx(f.DateTime,{level:t,el:"span",displayTZ:"local",format:d,color:n,weight:450,children:a}),!x.isZero&&s&&r.jsxRuntimeExports.jsxs(f.Text,{level:t,color:n,weight:450,el:"span",children:["(",i.span(a).truncate(u.i.MILLISECOND).toString(),")"]})]});return r.jsxRuntimeExports.jsxs(f.Text,{x:!0,gap:"small",className:u.CSS(u.CSS.B("time-range-chip")),align:"center",level:t,color:n,...o,children:[p,r.jsxRuntimeExports.jsx(f.Arrow.Right,{color:9}),m]})},$r="range",zr=j.memo(({itemKey:e,showParent:t=!0,showLabels:n=!0,...s})=>{const o=f.useItem(e);if(o==null)return null;const{name:i,parent:l,timeRange:a,labels:c}=o;return r.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,justify:"between",...s,children:[r.jsxRuntimeExports.jsxs(pr,{children:[r.jsxRuntimeExports.jsx(Cn,{weight:450,color:10,children:i}),l!=null&&t&&r.jsxRuntimeExports.jsx(Cn,{weight:400,color:8,children:l.name})]}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(su,{level:"small",timeRange:a}),n&&r.jsxRuntimeExports.jsx(dr,{variant:"text",children:c?.map(d=>r.jsxRuntimeExports.jsx(Os,{color:d.color,size:"small",children:d.name},d.key))})]})]})});zr.displayName="Ranger.ListItem";const ou=f.renderProp(zr),ru=r.jsxRuntimeExports.jsx(f.Range,{}),t0=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:o,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=Br({filter:s,initialParams:o}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return r.jsxRuntimeExports.jsx(As,{resourceName:"Range",haulType:$r,value:t,onChange:e,data:l,getItem:c,icon:ru,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,...i,children:ou})},n0={style:{width:800}},s0=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:o,initialParams:i,...l})=>{const{data:a,retrieve:c,subscribe:d,getItem:x,status:p}=Br({filter:n,initialParams:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return r.jsxRuntimeExports.jsx(Dt,{resourceName:"Range",variant:"modal",value:t,onChange:e,data:a,allowNone:s,haulType:$r,onFetchMore:m,getItem:x,subscribe:d,status:p,onSearch:h,emptyContent:o,icon:ru,itemHeight:45,dialogProps:n0,...l,children:ou})},o0=Object.freeze(Object.defineProperty({__proto__:null,ALIAS_FLUX_STORE_CONFIG:nu,HAUL_TYPE:$r,KV_FLUX_STORE_CONFIG:eu,ListItem:zr,RANGE_ALIASES_FLUX_STORE_KEY:Uc,RANGE_KV_FLUX_STORE_KEY:Gc,SelectMultiple:t0,SelectSingle:s0,TimeRangeChip:su,formSchema:Qc,kvPairFormSchema:tu,metaDataFormSchema:Hj,retrieve:qc,retrieveParent:Dj,toFormValues:Ho,useChildren:Ij,useDelete:qj,useDeleteKV:Uj,useDeleteSynchronizer:Oj,useForm:zj,useKVPairForm:Gj,useLabels:Vj,useList:Br,useListKV:Yj,useRetrieve:Bj,useSetSynchronizer:Aj,useUpdate:Xj,useUpdateKV:Wj},Symbol.toStringTag,{value:"Module"})),iu="schematicSymbols",r0={channel:L.dT.symbol.SET_CHANNEL_NAME,schema:L.dT.symbol.symbolZ,onChange:({store:e,changed:t})=>e.schematicSymbols.set(t.key,t)},i0={channel:L.dT.symbol.DELETE_CHANNEL_NAME,schema:L.dT.symbol.keyZ,onChange:({store:e,changed:t})=>e.schematicSymbols.delete(t)},lu={listeners:[r0,i0]},ys=async(e,t,n)=>{const s=n.schematicSymbols.get(t);if(s!=null)return s;const o=await e.workspaces.schematic.symbols.retrieve({key:t});return n.schematicSymbols.set(t,o),o},zs=Ye({name:"SchematicSymbols",retrieve:async({client:e,params:t,store:n})=>await ys(e,t.key,n),mountListeners:({store:e,params:t,onChange:n})=>[e.schematicSymbols.onSet(n,t.key)]}),go=(e,t)=>L.jb.matchRelationship(e,{from:t,type:L.jb.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"schematic_symbol"}}),l0=Ve({sort:(e,t)=>e.name.localeCompare(t.name),retrieveCached:({params:e,store:t})=>{if(e.searchTerm!=null&&e.searchTerm.length>0)return[];if(e.parent==null)return t.schematicSymbols.list();const n=t.relationships.get(s=>go(s,e.parent));return t.schematicSymbols.get(n.map(s=>s.to.key))},name:"Schematic Symbols",retrieve:async({client:e,store:t,params:{parent:n,...s}})=>{if(n!=null){const l=(await e.ontology.retrieveChildren(n)).map(c=>c.id.key);if(l.length===0)return[];const a=await e.workspaces.schematic.symbols.retrieve({...s,keys:l});return a.forEach(c=>{const d={from:n,type:L.jb.PARENT_OF_RELATIONSHIP_TYPE,to:L.dT.symbol.ontologyID(c.key)};t.relationships.set(L.jb.relationshipToString(d),d)}),a}const o=await e.workspaces.schematic.symbols.retrieve(s);return t.schematicSymbols.set(o),o},retrieveByKey:async({client:e,key:t,store:n})=>await ys(e,t,n),mountListeners:({store:e,onChange:t,onDelete:n,params:s,client:o})=>[e.schematicSymbols.onSet(i=>t(i.key,l=>l==null?null:i)),e.schematicSymbols.onDelete(n),e.relationships.onSet(async i=>{if(!go(i,s.parent))return;const l=await ys(o,i.to.key,e);t(i.to.key,l)}),e.relationships.onDelete(async i=>{const l=L.jb.relationshipZ.parse(i);go(l,s.parent)&&n(l.to.key)})]}),au=L.dT.symbol.symbolZ.partial({key:!0}).extend({parent:L.jb.idZ}),a0=St({name:"SchematicSymbols",initialValues:{version:1,name:"",data:{svg:"",states:[],handles:[],variant:"static",scale:1,scaleStroke:!1,previewViewport:{zoom:1,position:{x:0,y:0}}},parent:L.jb.ROOT_ID},schema:au,retrieve:async({client:e,params:{key:t,parent:n},reset:s,store:o})=>{if(t==null)return;const i=await ys(e,t,o);n==null&&(n=(await e.ontology.retrieveParents(L.dT.symbol.ontologyID(t)))[0].id),s({version:1,name:i.name,data:i.data,key:i.key,parent:n})},update:async({client:e,value:t,reset:n,params:s})=>{const o=s.parent??t().parent??L.jb.ROOT_ID,i=await e.workspaces.schematic.symbols.create({...t(),parent:o});n({...i,parent:o})},mountListeners:({store:e,params:t,reset:n,get:s})=>t.key==null?[]:[e.schematicSymbols.onSet(o=>n({...o,parent:t.parent??s("parent",{optional:!0})?.value??L.jb.ROOT_ID}),t.key)]}),c0=Fe({name:"SchematicSymbols",update:async({client:e,value:t,params:n})=>await e.workspaces.schematic.symbols.rename(n.key,t)}).useDirect,u0=Fe({name:"SchematicSymbols",update:async({client:e,params:{key:t}})=>await e.workspaces.schematic.symbols.delete(t)}).useDirect,d0=Ye({name:"SchematicSymbols",retrieve:async({client:e})=>await e.workspaces.schematic.symbols.retrieveGroup()}),Ss="data-original-stroke",Rs="data-original-fill",x0=(e,t)=>{let n=[...e];if(e.length!==t.length){const o=new Map(e.map(l=>[l.key,l])),i=new Map(t.map(l=>[l.key,l]));n=n.filter(l=>i.has(l.key));for(const l of t)o.has(l.key)||n.push(L.N.copy(l))}const s=[...n];for(let o=0;o<s.length;o++){const i=s[o],l=t.find(a=>a.key===i.key);if(l&&i.regions.length!==l.regions.length){const a=[...i.regions],c=new Map(a.map(p=>[p.key,p])),d=new Map(l.regions.map(p=>[p.key,p])),x=a.filter(p=>d.has(p.key));for(const p of l.regions)c.has(p.key)||x.push(L.N.copy(p));s[o]={...i,regions:x}}}return s},p0=({path:e,onReset:t,getOriginalRegion:n})=>{const s=Lt(`${e}.name`),o=Lt(e),i=n(e),l=!L.N.equal(o,i);return r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",children:[r.jsxRuntimeExports.jsx(f.Text,{level:"small",color:9,style:{maxWidth:50,width:50},overflow:"ellipsis",children:u.U.capitalize(s)}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(ge,{path:`${e}.strokeColor`,showLabel:!1,padHelpText:!1,children:({value:a,onChange:c})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:a,onChange:d=>c(u.fr.hex(d))})}),r.jsxRuntimeExports.jsx(ge,{path:`${e}.fillColor`,showLabel:!1,padHelpText:!1,children:({value:a,onChange:c})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:a,onChange:d=>c(u.fr.hex(d))})}),r.jsxRuntimeExports.jsx(f.Button,{onClick:()=>t(e),variant:"text",size:"tiny",style:{opacity:l?1:0},children:r.jsxRuntimeExports.jsx(f.Reset,{})})]},e)]})},m0=({selectedState:e,onReset:t,getOriginalRegion:n})=>{const{data:s}=br(`stateOverrides.${e}.regions`);return r.jsxRuntimeExports.jsx(f.Box,{y:!0,align:"stretch",children:s.map(o=>r.jsxRuntimeExports.jsx(p0,{onReset:t,path:`stateOverrides.${e}.regions.${o}`,getOriginalRegion:n},o))})},cu=()=>{const e=Lt("specKey"),t=Et(),[n,s]=j.useState([]),{data:o}=br("stateOverrides"),[i,l]=j.useState(o?.[0]);zs.useEffect({params:{key:e},onChange:d=>{if(d.data?.data==null)return;const x=d.data.data;s(L.N.copy(x.states));const p=t.get("stateOverrides");if(p.value?.length===0)t.set("stateOverrides",L.N.copy(x.states)),l(x.states[0].key);else{const m=x0(p.value,x.states);t.set("stateOverrides",m)}}});const a=j.useCallback(d=>{const x=d.split(".").slice(1).join("."),p=L.N.get(n,x,{optional:!0});p!=null&&t.set(d,L.N.copy(p))},[t.set,n]),c=j.useCallback(d=>{const x=d.split(".").slice(1).join(".");return L.N.get(n,x,{optional:!0})??null},[n]);return r.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"stretch",children:[o.length>1&&r.jsxRuntimeExports.jsx(pe.Buttons,{keys:o,value:i,onChange:l,full:"x",children:o.map(d=>r.jsxRuntimeExports.jsx(pe.Button,{itemKey:d,justify:"center",children:u.U.capitalize(d)},d))}),i!=null&&r.jsxRuntimeExports.jsx(m0,{selectedState:i,onReset:a,getOriginalRegion:c})]})},$i=(e,t,n)=>{e.regions.forEach(s=>{s.selectors.forEach(o=>{t.querySelectorAll(o).forEach(l=>n(l,s))})})},f0=e=>{const t=e.getAttribute(Ss),n=e.getAttribute(Rs);t!=null&&e.setAttribute("stroke",t),n!=null&&e.setAttribute("fill",n)},h0=e=>{if(!e.hasAttribute(Ss)){const t=e.getAttribute("stroke");t!=null&&e.setAttribute(Ss,t)}if(!e.hasAttribute(Rs)){const t=e.getAttribute("fill");t!=null&&e.setAttribute(Rs,t)}},g0=(e,t,n)=>{n!=null&&$i(n,e,f0),$i(t,e,(s,o)=>{h0(s);const{strokeColor:i,fillColor:l}=o;if(i!=null)s.setAttribute("stroke",i);else{const a=s.getAttribute(Ss);a!=null&&s.setAttribute("stroke",a)}if(l!=null)s.setAttribute("fill",l);else{const a=s.getAttribute(Rs);a!=null&&s.setAttribute("fill",a)}})},Vr=({container:e,orientation:t,activeState:n,externalScale:s,spec:o,onMount:i,stateOverrides:l})=>{const a=j.useRef(null),c=j.useRef({width:0,height:0}),d=j.useRef(void 0),x=j.useRef(void 0),p=j.useRef(void 0),m=j.useRef(void 0),h=j.useRef(void 0);if(o==null||o.svg.length===0||e==null)return;const g=d.current!==s,E=p.current?.svg!==o?.svg,S=x.current!==t,R=p.current?.scale!==o?.scale,v=p.current?.scaleStroke!==o?.scaleStroke,y=p.current!==o,C=n==="active"?1:0,k=l?.[C]??o.states[C],T=m.current!==k,P=JSON.stringify(h.current)!==JSON.stringify(l);if(!(g||E||v||T||P))return;g&&(d.current=s),S&&(x.current=t),y&&(p.current=L.N.copy(o)),P&&(h.current=l);const{svg:B,scaleStroke:F,scale:$}=o;if(a.current==null||E){a.current!=null&&(a.current.remove(),a.current=null);const z=new DOMParser().parseFromString(B,"image/svg+xml"),b=z.documentElement;a.current=b;const N=a.current.getAttribute("viewBox");if(N){const[,,M,V]=N.split(" ").map(Number);c.current={width:M,height:V}}else a.current.viewBox?.baseVal?c.current={width:a.current.viewBox.baseVal.width,height:a.current.viewBox.baseVal.height}:c.current={width:100,height:100};if(!b.querySelector("g")){const M=z.createElementNS("http://www.w3.org/2000/svg","g"),V=Array.from(b.children);V.forEach(H=>b.removeChild(H)),V.forEach(H=>{H!==M&&M.appendChild(H)}),b.appendChild(M)}e.appendChild(b),i?.(a.current)}if((T||P)&&(g0(a.current,k,m.current),m.current=L.N.copy(k)),R||g||S||E){let D=c.current;u.p.construct(t)==="y"&&(D=u._.swap(D));const z=u._.scale(D,$*s);a.current.setAttribute("width",z.width.toString()),a.current.setAttribute("height",z.height.toString()),a.current.setAttribute("viewBox",`0 0 ${D.width} ${D.height}`)}if(v){const D=a.current.querySelectorAll("path, circle, rect, line, ellipse, polygon, polyline");F?D.forEach(z=>z.removeAttribute("vector-effect")):D.forEach(z=>z.setAttribute("vector-effect","non-scaling-stroke"))}},j0=["path","rect","circle","ellipse","polygon","polyline","line","text"],zi=u.fr.hex(u.fr.ZERO),Vi=e=>{if(e==null||e==="")return zi;const t=u.fr.fromCSS(e);return t==null?zi:u.fr.hex(t)},E0=e=>{const t=e.style.stroke||e.getAttribute("stroke"),n=e.style.fill||e.getAttribute("fill");return{stroke:Vi(t),fill:Vi(n)}},y0=e=>`${e.stroke}|${e.fill}`,uu=e=>{if(e.id)return`#${e.id}`;const t=e.getAttribute("data-region-id");if(t)return`[data-region-id="${t}"]`;if(e.classList.length>0)return`.${Array.from(e.classList).join(".")}`;const n=e.tagName.toLowerCase(),s=e.parentElement;if(!s)return n;let o=1,i=e.previousElementSibling;for(;i;)i.tagName.toLowerCase()===n&&o++,i=i.previousElementSibling;return`${s.tagName.toLowerCase()==="svg"?"":s instanceof SVGElement?`${uu(s)} > `:""}${n}:nth-of-type(${o})`},S0=e=>{const t=j0.flatMap(s=>Array.from(e.querySelectorAll(s))),n=new Map;return t.forEach(s=>{const o=E0(s),i=y0(o);n.has(i)||n.set(i,{elements:[],colorPair:o}),n.get(i).elements.push(s)}),Array.from(n.values()).map((s,o)=>{const i=s.elements.map(uu),l=Array.from(new Set(i)),a=o+1,c={key:`region-${a}`,name:`Region ${a}`,selectors:l};return c.strokeColor=s.colorPair.stroke,c.fillColor=s.colorPair.fill,c})},R0=({value:e,hideOuter:t=!1,showOuterCenter:n=!1,hideInner:s,onChange:o})=>{const{outer:i}=e,l=c=>()=>o({...e,...c}),a=u.CSS.B("select","orientation");return t?r.jsxRuntimeExports.jsx(Fi,{className:a,value:e,onChange:o}):r.jsxRuntimeExports.jsxs(f.Box,{className:a,align:"center",justify:"center",gap:"tiny",children:[r.jsxRuntimeExports.jsx(rt,{selected:i==="top",onClick:l({outer:"top"})}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",gap:"tiny",children:[r.jsxRuntimeExports.jsx(rt,{selected:i==="left",onClick:l({outer:"left"})}),r.jsxRuntimeExports.jsx(Fi,{hideInner:s,value:e,onChange:o,showOuterCenter:n}),r.jsxRuntimeExports.jsx(rt,{selected:i==="right",onClick:l({outer:"right"})})]}),r.jsxRuntimeExports.jsx(rt,{selected:i==="bottom",onClick:l({outer:"bottom"})})]})},Fi=({value:e,onChange:t,className:n,hideInner:s=!1,showOuterCenter:o=!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 o?d=r.jsxRuntimeExports.jsx(rt,{selected:e.outer==="center",onClick:a({outer:"center"})}):d=r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="top",onClick:a({inner:"top"})}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",children:[r.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,selected:l==="left",onClick:a({inner:"left"})}),r.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,selected:l==="right",onClick:a({inner:"right"})})]}),r.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="bottom",onClick:a({inner:"bottom"})})]}),r.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(n,u.CSS.B("value"),o&&u.CSS.M("show-outer-center")),y:!0,align:"center",justify:"center",empty:!0,...i,children:d})},rt=({selected:e,className:t,...n})=>r.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(t,u.CSS.selected(e)),size:"tiny",...n,children:r.jsxRuntimeExports.jsx("div",{className:"symbol"})}),C0=O.MODES,b0=({aetherKey:e,sink:t,mode:n})=>{const s=f.useMemoDeepEqual({sink:t,mode:n}),o=j.useRef({trigger:0,...s}),{setState:i}=f.useLifecycle({aetherKey:e,type:O.Button.TYPE,schema:O.buttonStateZ,initialState:o.current});j.useEffect(()=>{o.current={...o.current,...s},i(o.current)},[s,i,e]);const l=j.useCallback(()=>{o.current.trigger+=O.MOUSE_UP_INCREMENT,i(o.current)},[i]),a=j.useCallback(()=>{o.current.trigger+=O.MOUSE_DOWN_INCREMENT,i(o.current)},[i]);return{onClick:l,onMouseDown:a,onMouseUp:l}},w0=e=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:C0,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"fire",tooltip:"Output true when clicked",children:"Fire"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"momentary",tooltip:"Output true on press, false on release",children:"Momentary"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pulse",tooltip:"Output true and then immediately output false on click",children:"Pulse"})]}),du=ne.z.object({bounds:u.H.bounds,gradient:u.fr.gradientZ}),vn={bounds:{lower:0,upper:1},gradient:[]},Hi={size:"small",showDragHandle:!1},Zi={width:60},v0=u.C.Scale.scale(0,1),Fr=({path:e})=>{const{set:t,get:n}=Et(),{bounds:s}=Lt(`${e}`,{defaultValue:{bounds:{...vn.bounds},gradient:[...vn.gradient]}}),o=v0.scale(s);return r.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(Be,{inputProps:Hi,style:Zi,label:"Lower",path:`${e}.bounds.lower`}),r.jsxRuntimeExports.jsx(ge,{path:`${e}.gradient`,label:"Gradient",align:"start",padHelpText:!1,children:({value:i,onChange:l})=>r.jsxRuntimeExports.jsx(_e.GradientPicker,{value:L.N.copy(i),scale:o,onChange:a=>{const d={...n(`${e}.bounds`).value},x=a.map(S=>S.position),p=o.pos(Math.max(...x)),m=o.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.fr.hex(S.color)}));h||g?t(e,{bounds:d,gradient:E}):l(a.map(S=>({...S,color:u.fr.hex(S.color)})))}})}),r.jsxRuntimeExports.jsx(Be,{inputProps:Hi,style:Zi,label:"Upper",path:`${e}.bounds.upper`})]})},k0=e=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:u.wr.NOTATIONS,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"standard",children:"Standard"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"scientific",children:"Scientific"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"engineering",children:"Engineering"})]}),_0=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Hr=({path:e})=>{const{value:t,onChange:n}=yt(e),s=O.sourcePipelinePropsZ.parse(t.telem?.props),o=O.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=O.stringifyNumberProps.parse(s.segments.stringifier.props),l=O.rollingAverageProps.parse(s.segments.rollingAverage.props),a=h=>{const g=O.sourcePipeline("string",{connections:_0,segments:{valueStream:O.streamChannelValue({channel:o.channel}),stringifier:O.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:O.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:g})},c=h=>a({valueStream:O.streamChannelValue({channel:h??0})}),d=h=>a({stringifier:O.stringifyNumber({...i,notation:h})}),x=h=>a({stringifier:O.stringifyNumber({...i,precision:h})}),p=h=>a({rollingAverage:O.rollingAverage({windowSize:h})});if(typeof o.channel!="number")throw new Error("Must pass in a channel by key to Value.TelemForm");const{data:m}=Mr.useDirect({params:{key:o.channel}});return j.useEffect(()=>{m!=null&&n({...t,tooltip:[m.name]})},[m?.name,n]),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Input Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Tt,{value:o.channel,onChange:c})}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Notation",children:r.jsxRuntimeExports.jsx(k0,{value:i.notation,onChange:d})}),r.jsxRuntimeExports.jsx(Ae.Item,{label:"Precision",align:"start",children:r.jsxRuntimeExports.jsx(f.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),r.jsxRuntimeExports.jsx(Ae.Item,{label:"Averaging Window",align:"start",children:r.jsxRuntimeExports.jsx(f.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})}),r.jsxRuntimeExports.jsx(ge,{hideIfNull:!0,label:"Stale Color",align:"start",path:"stalenessColor",children:({value:h,onChange:g})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:h??u.fr.setAlpha(u.fr.ZERO,1),onChange:g,bordered:!0})}),r.jsxRuntimeExports.jsx(Be,{path:"stalenessTimeout",label:"Stale Timeout",inputProps:{bounds:{lower:1,upper:1/0},endContent:"s"}})]})]})},L0=O.Value.z.partial({color:!0}).extend({level:L.levelZ.optional()}),Zr=({aetherKey:e,box:t,telem:n,color:s,precision:o,minWidth:i,level:l="small",backgroundTelem:a,notation:c,location:d,stalenessColor:x,stalenessTimeout:p,useWidthForBackground:m,valueBackgroundOverScan:h,valueBackgroundShift:g})=>{const E=f.useMemoDeepEqual({box:t,telem:n,color:s,precision:o,level:l,minWidth:i,notation:c,backgroundTelem:a,stalenessColor:x,stalenessTimeout:p,location:d,useWidthForBackground:m,valueBackgroundOverScan:h,valueBackgroundShift:g}),[,S,R]=f.use$2({aetherKey:e,type:O.Value.TYPE,schema:O.Value.z,initialState:E});return j.useEffect(()=>R(v=>({...v,...E})),[E]),{width:S.width??S.minWidth}},T0=Object.freeze(Object.defineProperty({__proto__:null,RedlineForm:Fr,TelemForm:Hr,ZERO_READLINE:vn,corePropsZ:L0,redlineZ:du,use:Zr},Symbol.toStringTag,{value:"Module"})),Ne=({className:e,direction:t,...n})=>r.jsxRuntimeExports.jsx(f.Box,{direction:t,align:"stretch",className:u.CSS(u.CSS.B("symbol-form"),e),gap:t==="x"?"large":"medium",...n}),Rt=({hideOuter:e,hideInner:t,showOuterCenter:n,...s})=>t&&e?null:r.jsxRuntimeExports.jsx(ge,{label:"Orientation",padHelpText:!1,...s,children:({value:o,onChange:i})=>r.jsxRuntimeExports.jsx(R0,{value:{inner:o.orientation??"top",outer:o.label?.orientation??"top"},hideInner:t,hideOuter:e,showOuterCenter:n,onChange:l=>i({...o,orientation:l.inner,label:{...o.label,orientation:l.outer}})})}),ut=({path:e,omit:t=[]})=>r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(ge,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>r.jsxRuntimeExports.jsx(f.Text$2,{selectOnFocus:!0,...n})}),r.jsxRuntimeExports.jsx(Be,{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}),r.jsxRuntimeExports.jsx(ge,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:({value:n,onChange:s})=>r.jsxRuntimeExports.jsx(ln,{value:n,onChange:s})}),r.jsxRuntimeExports.jsx(ge,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>r.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:n,onChange:s})}),r.jsxRuntimeExports.jsx(ge,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>r.jsxRuntimeExports.jsx(pc,{value:n,onChange:s,yDirection:"down"})})]}),$e=e=>r.jsxRuntimeExports.jsx(ge,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...o})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:t??u.fr.setAlpha(u.fr.ZERO,1),onChange:n,...o,bordered:!0})}),M0={lower:5,upper:1e3},N0={x:.75,y:.5},xu=e=>r.jsxRuntimeExports.jsx(ge,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>r.jsxRuntimeExports.jsx(f.Numeric,{dragScale:N0,bounds:M0,endContent:"%",value:Math.round(t*100),onChange:s=>n(parseFloat((s/100).toFixed(2)))})}),xe=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>{const s=Lt("stateOverrides",{optional:!0})!=null;return r.jsxRuntimeExports.jsxs(Ne,{x:!0,align:"stretch",empty:!0,children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{omit:e,path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[!s&&r.jsxRuntimeExports.jsx($e,{path:"color",optional:!0}),r.jsxRuntimeExports.jsx(ge,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:o=>r.jsxRuntimeExports.jsx(f.Switch$1,{...o})}),r.jsxRuntimeExports.jsx(xu,{path:"scale"})]})]}),s&&r.jsxRuntimeExports.jsx(cu,{}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideInner:t,hideOuter:n})]})},P0=({path:e})=>{const{value:t,onChange:n}=yt(e),s=O.sourcePipelinePropsZ.parse(t.source?.props),o=O.sinkPipelinePropsZ.parse(t.sink?.props),i=O.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=O.setChannelValuePropsZ.parse(o.segments.setter.props),a=d=>{d??=0;const x=O.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:O.streamChannelValue({channel:d}),threshold:O.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:x})},c=d=>{d??=0;const x=O.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:O.setChannelValue({channel:d}),setpoint:O.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),p=O.authoritySource({channel:d}),m=O.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 r.jsxRuntimeExports.jsxs(Ne,{x:!0,grow:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"State Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Tt,{value:i.channel,onChange:a})}),r.jsxRuntimeExports.jsx(Ae.Item,{label:"Command Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Tt,{value:l.channel,onChange:c})}),r.jsxRuntimeExports.jsx(Bs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},Kr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ye=({actions:e,hideInnerOrientation:t})=>{const n=j.useCallback(({tabKey:o})=>{switch(o){case"control":return r.jsxRuntimeExports.jsx(P0,{path:""});default:return r.jsxRuntimeExports.jsx(xe,{hideInnerOrientation:t})}},[t]),s=Me.useStatic({tabs:Kr,content:n});return r.jsxRuntimeExports.jsx(Me.Tabs,{...s,actions:e})},mt={y:2,x:.25},Sn={lower:0,upper:2e3},Ki={lower:0,upper:51},pu=({includeBorderRadius:e=!1,includeStrokeWidth:t=!1})=>r.jsxRuntimeExports.jsxs(Ne,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx($e,{path:"backgroundColor",label:"Background Color"}),r.jsxRuntimeExports.jsx(ge,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:n=>r.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Ki,endContent:"%",...n})}),r.jsxRuntimeExports.jsx(ge,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:n=>r.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Ki,endContent:"%",...n})}),e&&r.jsxRuntimeExports.jsx(ge,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:n=>r.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Sn,endContent:"px",...n})}),t&&r.jsxRuntimeExports.jsx(ge,{path:"strokeWidth",hideIfNull:!0,optional:!0,label:"Border Width",grow:!0,children:n=>r.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:{lower:0,upper:21},endContent:"px",...n})}),r.jsxRuntimeExports.jsx(ge,{path:"dimensions.width",label:"Width",grow:!0,children:({value:n,...s})=>r.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:mt,bounds:Sn,endContent:"px",...s})}),r.jsxRuntimeExports.jsx(ge,{path:"dimensions.height",label:"Height",grow:!0,children:({value:n,...s})=>r.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:mt,bounds:Sn,endContent:"px",...s})})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideInner:!0,showOuterCenter:!0,label:"Label Location"})]}),A0=()=>r.jsxRuntimeExports.jsx(Ne,{direction:"x",align:"stretch",children:r.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx($e,{path:"backgroundColor",label:"Background Color"}),r.jsxRuntimeExports.jsx(Be,{path:"rotation",label:"Rotation",inputProps:{dragScale:{x:1,y:.25},bounds:{lower:0,upper:360},endContent:"°"},grow:!0}),r.jsxRuntimeExports.jsx(Be,{path:"numSides",label:"Number of Sides",inputProps:{dragScale:{x:.5,y:.1},bounds:{lower:3,upper:21}},grow:!0}),r.jsxRuntimeExports.jsx(Be,{path:"sideLength",label:"Side Length",inputProps:{dragScale:{x:1,y:1},bounds:{lower:10,upper:500},endContent:"px"},grow:!0}),r.jsxRuntimeExports.jsx(Be,{path:"cornerRounding",label:"Corner Rounding",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:181},endContent:"px"},grow:!0}),r.jsxRuntimeExports.jsx(Be,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),O0=()=>r.jsxRuntimeExports.jsx(Ne,{direction:"x",align:"stretch",children:r.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx($e,{path:"backgroundColor",label:"Background Color"}),r.jsxRuntimeExports.jsx(Be,{path:"radius",label:"Radius",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:500},endContent:"px"},grow:!0}),r.jsxRuntimeExports.jsx(Be,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),I0=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],D0={dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"},B0=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return r.jsxRuntimeExports.jsxs(Ne,{y:!0,empty:!0,children:[r.jsxRuntimeExports.jsx(Hr,{path:""}),";"]});case"redline":return r.jsxRuntimeExports.jsx(Ne,{y:!0,empty:!0,children:r.jsxRuntimeExports.jsx(Fr,{path:"redline"})});default:return r.jsxRuntimeExports.jsxs(Ne,{x:!0,children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx(ge,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>r.jsxRuntimeExports.jsx(f.Text$2,{...s})}),r.jsxRuntimeExports.jsx(Be,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:D0}),r.jsxRuntimeExports.jsx(ge,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:o})=>r.jsxRuntimeExports.jsx(ln,{value:s,onChange:o})})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideInner:!0})]})}},[]),t=Me.useStatic({tabs:I0,content:e});return r.jsxRuntimeExports.jsx(Me.Tabs,{...t})},$0=({path:e})=>{const{value:t,onChange:n}=yt(e),s=O.sourcePipelinePropsZ.parse(t.source?.props),o=O.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=O.withinBoundsProps.parse(s.segments.threshold.props),l=c=>{c??=0;const d=O.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:O.streamChannelValue({channel:c}),threshold:O.withinBounds({trueBound:i.trueBound})},outlet:"threshold"});n({...t,source:d})},a=c=>{const d=O.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:O.streamChannelValue({channel:o.channel}),threshold:O.withinBounds({trueBound:c})},outlet:"threshold"});n({...t,source:d})};if(typeof o.channel!="number")throw new Error("Channel key must be used for light telemetry");return r.jsxRuntimeExports.jsxs(Ne,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Input Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Tt,{value:o.channel,onChange:l})}),r.jsxRuntimeExports.jsx(Ae.Item,{label:"Lower Threshold",children:r.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.lower??.9,onChange:c=>a({...i.trueBound,lower:c})})}),r.jsxRuntimeExports.jsx(Ae.Item,{label:"Upper Threshold",children:r.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.upper??1.1,onChange:c=>a({...i.trueBound,upper:c})})})]})},z0=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],V0=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return r.jsxRuntimeExports.jsx($0,{path:""});default:return r.jsxRuntimeExports.jsx(xe,{})}},[]),t=Me.useStatic({tabs:z0,content:e});return r.jsxRuntimeExports.jsx(Me.Tabs,{...t})},F0=({path:e})=>{const{value:t,onChange:n}=yt(e),s=O.sinkPipelinePropsZ.parse(t.sink?.props),o=O.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=O.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:O.setChannelValue({channel:l}),setpoint:O.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),c=O.authoritySource({channel:l}),d=O.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 r.jsxRuntimeExports.jsxs(Ne,{y:!0,empty:!0,children:[r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Output Channel",grow:!0,padHelpText:!1,children:r.jsxRuntimeExports.jsx(Tt,{value:o.channel,onChange:i})}),r.jsxRuntimeExports.jsx(Be,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0,padHelpText:!1}),r.jsxRuntimeExports.jsx(Bs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0,padHelpText:!1})]}),r.jsxRuntimeExports.jsx(ge,{path:"mode",label:"Mode",optional:!0,children:({value:l,onChange:a})=>r.jsxRuntimeExports.jsx(w0,{value:l,onChange:a})})]})},H0=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"control":return r.jsxRuntimeExports.jsx(F0,{path:""});default:return r.jsxRuntimeExports.jsx(xe,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=Me.useStatic({tabs:Kr,content:e});return r.jsxRuntimeExports.jsx(Me.Tabs,{...t})},Z0=({path:e})=>{const{value:t,onChange:n}=yt(e),s=O.sinkPipelinePropsZ.parse(t.sink?.props),o=O.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=O.sinkPipeline("number",{connections:[],segments:{setter:O.setChannelValue({channel:l})},inlet:"setter"}),c=O.authoritySource({channel:l}),d=O.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 r.jsxRuntimeExports.jsx(Ne,{x:!0,grow:!0,align:"stretch",children:r.jsxRuntimeExports.jsx(Ae.Item,{label:"Command Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Tt,{value:o.channel,onChange:i})})})},K0=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"control":return r.jsxRuntimeExports.jsx(Z0,{path:""});default:return r.jsxRuntimeExports.jsxs(Ne,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"stretch",grow:!0,gap:"small",children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(wr,{path:"units",label:"Units",align:"start",padHelpText:!1}),r.jsxRuntimeExports.jsx(ge,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:o})=>r.jsxRuntimeExports.jsx(ha,{value:s,onChange:o})}),r.jsxRuntimeExports.jsx($e,{path:"color"})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideInner:!0})]})}},[]),t=Me.useStatic({tabs:Kr,content:e});return r.jsxRuntimeExports.jsx(Me.Tabs,{...t})},Y0=()=>{const e=yt("autoFit",{optional:!0});return r.jsxRuntimeExports.jsxs(Ne,{x:!0,align:"stretch",grow:!0,children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(ge,{path:"value",label:"Text",padHelpText:!1,grow:!0,children:t=>r.jsxRuntimeExports.jsx(f.Text$2,{...t})}),r.jsxRuntimeExports.jsx(ge,{path:"level",label:"Text Size",padHelpText:!1,children:({value:t,onChange:n})=>r.jsxRuntimeExports.jsx(ln,{value:t,onChange:n})}),r.jsxRuntimeExports.jsx(ge,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:({value:t,onChange:n})=>r.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:t,onChange:n})})]}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx(ge,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>r.jsxRuntimeExports.jsx(f.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:r.jsxRuntimeExports.jsx(f.Button,{onClick:()=>e?.onChange(!0),disabled:e?.value===!0,variant:"outlined",style:{borderLeft:"var(--pluto-border-l5)"},tooltip:e?.value===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:r.jsxRuntimeExports.jsx(f.AutoFitWidth,{})})})})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:""})]})},G0=()=>r.jsxRuntimeExports.jsxs(Ne,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label",omit:["maxInlineSize","align","direction"]}),r.jsxRuntimeExports.jsx($e,{path:"color"})]}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideOuter:!0})]}),U0=()=>r.jsxRuntimeExports.jsxs(Ne,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx($e,{path:"backgroundColor",label:"Background Color"}),r.jsxRuntimeExports.jsx(ge,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>r.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:mt,bounds:Sn,endContent:"px",...t})}),r.jsxRuntimeExports.jsx(ge,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>r.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:mt,bounds:Sn,endContent:"px",...t})})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideInner:!0})]}),$t=()=>r.jsxRuntimeExports.jsxs(Ne,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx(xu,{path:"scale"}),r.jsxRuntimeExports.jsx(Bs,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:""})]}),W0=()=>r.jsxRuntimeExports.jsx(pu,{includeBorderRadius:!0,includeStrokeWidth:!0}),X0=()=>r.jsxRuntimeExports.jsx(ye,{hideInnerOrientation:!0});function Te(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=Te(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var q0={value:()=>{}};function Vs(){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 as(n)}function as(e){this._=e}function Q0(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",o=n.indexOf(".");if(o>=0&&(s=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}as.prototype=Vs.prototype={constructor:as,on:function(e,t){var n=this._,s=Q0(e+"",n),o,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((o=(e=s[i]).type)&&(o=J0(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(o=(e=s[i]).type)n[o]=Yi(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Yi(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new as(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),s=0,o,i;s<o;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,o=i.length;s<o;++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],o=0,i=s.length;o<i;++o)s[o].value.apply(t,n)}};function J0(e,t){for(var n=0,s=e.length,o;n<s;++n)if((o=e[n]).name===t)return o.value}function Yi(e,t,n){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=q0,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Zo="http://www.w3.org/1999/xhtml";const Gi={svg:"http://www.w3.org/2000/svg",xhtml:Zo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Gi.hasOwnProperty(t)?{space:Gi[t],local:e}:e}function e2(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Zo&&t.documentElement.namespaceURI===Zo?t.createElement(e):t.createElementNS(n,e)}}function t2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mu(e){var t=Fs(e);return(t.local?t2:e2)(t)}function n2(){}function Yr(e){return e==null?n2:function(){return this.querySelector(e)}}function s2(e){typeof e!="function"&&(e=Yr(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,a=s[o]=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 Ke(s,this._parents)}function o2(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function r2(){return[]}function fu(e){return e==null?r2:function(){return this.querySelectorAll(e)}}function i2(e){return function(){return o2(e.apply(this,arguments))}}function l2(e){typeof e=="function"?e=i2(e):e=fu(e);for(var t=this._groups,n=t.length,s=[],o=[],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)),o.push(c));return new Ke(s,o)}function hu(e){return function(){return this.matches(e)}}function gu(e){return function(t){return t.matches(e)}}var a2=Array.prototype.find;function c2(e){return function(){return a2.call(this.children,e)}}function u2(){return this.firstElementChild}function d2(e){return this.select(e==null?u2:c2(typeof e=="function"?e:gu(e)))}var x2=Array.prototype.filter;function p2(){return Array.from(this.children)}function m2(e){return function(){return x2.call(this.children,e)}}function f2(e){return this.selectAll(e==null?p2:m2(typeof e=="function"?e:gu(e)))}function h2(e){typeof e!="function"&&(e=hu(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,a=s[o]=[],c,d=0;d<l;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&a.push(c);return new Ke(s,this._parents)}function ju(e){return new Array(e.length)}function g2(){return new Ke(this._enter||this._groups.map(ju),this._parents)}function Cs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Cs.prototype={constructor:Cs,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 j2(e){return function(){return e}}function E2(e,t,n,s,o,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 Cs(e,i[l]);for(;l<c;++l)(a=t[l])&&(o[l]=a)}function y2(e,t,n,s,o,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)?o[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 Cs(e,i[a]);for(a=0;a<x;++a)(c=t[a])&&d.get(m[a])===c&&(o[a]=c)}function S2(e){return e.__data__}function R2(e,t){if(!arguments.length)return Array.from(this,S2);var n=t?y2:E2,s=this._parents,o=this._groups;typeof e!="function"&&(e=j2(e));for(var i=o.length,l=new Array(i),a=new Array(i),c=new Array(i),d=0;d<i;++d){var x=s[d],p=o[d],m=p.length,h=C2(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,k;v<g;++v)if(C=E[v]){for(v>=y&&(y=v+1);!(k=S[y])&&++y<g;);C._next=k||null}}return l=new Ke(l,s),l._enter=a,l._exit=c,l}function C2(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function b2(){return new Ke(this._exit||this._groups.map(ju),this._parents)}function w2(e,t,n){var s=this.enter(),o=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),s&&o?s.merge(o).order():o}function v2(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,o=n.length,i=s.length,l=Math.min(o,i),a=new Array(o),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<o;++c)a[c]=n[c];return new Ke(a,this._parents)}function k2(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],o=s.length-1,i=s[o],l;--o>=0;)(l=s[o])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function _2(e){e||(e=L2);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,o=new Array(s),i=0;i<s;++i){for(var l=n[i],a=l.length,c=o[i]=new Array(a),d,x=0;x<a;++x)(d=l[x])&&(c[x]=d);c.sort(t)}return new Ke(o,this._parents).order()}function L2(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function T2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function M2(){return Array.from(this)}function N2(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,i=s.length;o<i;++o){var l=s[o];if(l)return l}return null}function P2(){let e=0;for(const t of this)++e;return e}function A2(){return!this.node()}function O2(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var o=t[n],i=0,l=o.length,a;i<l;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function I2(e){return function(){this.removeAttribute(e)}}function D2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function B2(e,t){return function(){this.setAttribute(e,t)}}function $2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function z2(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function V2(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 F2(e,t){var n=Fs(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?D2:I2:typeof t=="function"?n.local?V2:z2:n.local?$2:B2)(n,t))}function Eu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function H2(e){return function(){this.style.removeProperty(e)}}function Z2(e,t,n){return function(){this.style.setProperty(e,t,n)}}function K2(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function Y2(e,t,n){return arguments.length>1?this.each((t==null?H2:typeof t=="function"?K2:Z2)(e,t,n??"")):Jt(this.node(),e)}function Jt(e,t){return e.style.getPropertyValue(t)||Eu(e).getComputedStyle(e,null).getPropertyValue(t)}function G2(e){return function(){delete this[e]}}function U2(e,t){return function(){this[e]=t}}function W2(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function X2(e,t){return arguments.length>1?this.each((t==null?G2:typeof t=="function"?W2:U2)(e,t)):this.node()[e]}function yu(e){return e.trim().split(/^|\s+/)}function Gr(e){return e.classList||new Su(e)}function Su(e){this._node=e,this._names=yu(e.getAttribute("class")||"")}Su.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 Ru(e,t){for(var n=Gr(e),s=-1,o=t.length;++s<o;)n.add(t[s])}function Cu(e,t){for(var n=Gr(e),s=-1,o=t.length;++s<o;)n.remove(t[s])}function q2(e){return function(){Ru(this,e)}}function Q2(e){return function(){Cu(this,e)}}function J2(e,t){return function(){(t.apply(this,arguments)?Ru:Cu)(this,e)}}function eE(e,t){var n=yu(e+"");if(arguments.length<2){for(var s=Gr(this.node()),o=-1,i=n.length;++o<i;)if(!s.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?J2:t?q2:Q2)(n,t))}function tE(){this.textContent=""}function nE(e){return function(){this.textContent=e}}function sE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function oE(e){return arguments.length?this.each(e==null?tE:(typeof e=="function"?sE:nE)(e)):this.node().textContent}function rE(){this.innerHTML=""}function iE(e){return function(){this.innerHTML=e}}function lE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function aE(e){return arguments.length?this.each(e==null?rE:(typeof e=="function"?lE:iE)(e)):this.node().innerHTML}function cE(){this.nextSibling&&this.parentNode.appendChild(this)}function uE(){return this.each(cE)}function dE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xE(){return this.each(dE)}function pE(e){var t=typeof e=="function"?e:mu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function mE(){return null}function fE(e,t){var n=typeof e=="function"?e:mu(e),s=t==null?mE:typeof t=="function"?t:Yr(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 gE(){return this.each(hE)}function jE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function EE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yE(e){return this.select(e?EE:jE)}function SE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function RE(e){return function(t){e.call(this,t,this.__data__)}}function CE(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 bE(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,o=t.length,i;n<o;++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 wE(e,t,n){return function(){var s=this.__on,o,i=RE(t);if(s){for(var l=0,a=s.length;l<a;++l)if((o=s[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(o):this.__on=[o]}}function vE(e,t,n){var s=CE(e+""),o,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(o=0,x=a[c];o<i;++o)if((l=s[o]).type===x.type&&l.name===x.name)return x.value}return}for(a=t?wE:bE,o=0;o<i;++o)this.each(a(s[o],t,n));return this}function bu(e,t,n){var s=Eu(e),o=s.CustomEvent;typeof o=="function"?o=new o(t,n):(o=s.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function kE(e,t){return function(){return bu(this,e,t)}}function _E(e,t){return function(){return bu(this,e,t.apply(this,arguments))}}function LE(e,t){return this.each((typeof t=="function"?_E:kE)(e,t))}function*TE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,i=s.length,l;o<i;++o)(l=s[o])&&(yield l)}var wu=[null];function Ke(e,t){this._groups=e,this._parents=t}function $n(){return new Ke([[document.documentElement]],wu)}function ME(){return this}Ke.prototype=$n.prototype={constructor:Ke,select:s2,selectAll:l2,selectChild:d2,selectChildren:f2,filter:h2,data:R2,enter:g2,exit:b2,join:w2,merge:v2,selection:ME,order:k2,sort:_2,call:T2,nodes:M2,node:N2,size:P2,empty:A2,each:O2,attr:F2,style:Y2,property:X2,classed:eE,text:oE,html:aE,raise:uE,lower:xE,append:pE,insert:fE,remove:gE,clone:yE,datum:SE,on:vE,dispatch:LE,[Symbol.iterator]:TE};function He(e){return typeof e=="string"?new Ke([[document.querySelector(e)]],[document.documentElement]):new Ke([[e]],wu)}function NE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function We(e,t){if(e=NE(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 o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const PE={passive:!1},kn={capture:!0,passive:!1};function jo(e){e.stopImmediatePropagation()}function Xt(e){e.preventDefault(),e.stopImmediatePropagation()}function vu(e){var t=e.document.documentElement,n=He(e).on("dragstart.drag",Xt,kn);"onselectstart"in t?n.on("selectstart.drag",Xt,kn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ku(e,t){var n=e.document.documentElement,s=He(e).on("dragstart.drag",null);t&&(s.on("click.drag",Xt,kn),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 qn=e=>()=>e;function Ko(e,{sourceEvent:t,subject:n,target:s,identifier:o,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:o,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}})}Ko.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function AE(e){return!e.ctrlKey&&!e.button}function OE(){return this.parentNode}function IE(e,t){return t??{x:e.x,y:e.y}}function DE(){return navigator.maxTouchPoints||"ontouchstart"in this}function _u(){var e=AE,t=OE,n=IE,s=DE,o={},i=Vs("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,PE).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(C,k){if(!(x||!e.call(this,C,k))){var T=y(this,t.call(this,C,k),C,k,"mouse");T&&(He(C.view).on("mousemove.drag",g,kn).on("mouseup.drag",E,kn),vu(C.view),jo(C),d=!1,a=C.clientX,c=C.clientY,T("start",C))}}function g(C){if(Xt(C),!d){var k=C.clientX-a,T=C.clientY-c;d=k*k+T*T>p}o.mouse("drag",C)}function E(C){He(C.view).on("mousemove.drag mouseup.drag",null),ku(C.view,d),Xt(C),o.mouse("end",C)}function S(C,k){if(e.call(this,C,k)){var T=C.changedTouches,P=t.call(this,C,k),I=T.length,B,F;for(B=0;B<I;++B)(F=y(this,P,C,k,T[B].identifier,T[B]))&&(jo(C),F("start",C,T[B]))}}function R(C){var k=C.changedTouches,T=k.length,P,I;for(P=0;P<T;++P)(I=o[k[P].identifier])&&(Xt(C),I("drag",C,k[P]))}function v(C){var k=C.changedTouches,T=k.length,P,I;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),P=0;P<T;++P)(I=o[k[P].identifier])&&(jo(C),I("end",C,k[P]))}function y(C,k,T,P,I,B){var F=i.copy(),$=We(B||T,k),D,z,b;if((b=n.call(C,new Ko("beforestart",{sourceEvent:T,target:m,identifier:I,active:l,x:$[0],y:$[1],dx:0,dy:0,dispatch:F}),P))!=null)return D=b.x-$[0]||0,z=b.y-$[1]||0,function N(_,M,V){var H=$,K;switch(_){case"start":o[I]=N,K=l++;break;case"end":delete o[I],--l;case"drag":$=We(V||M,k),K=l;break}F.call(_,C,new Ko(_,{sourceEvent:M,subject:b,target:m,identifier:I,active:K,x:$[0]+D,y:$[1]+z,dx:$[0]-H[0],dy:$[1]-H[1],dispatch:F}),P)}}return m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:qn(!!C),m):e},m.container=function(C){return arguments.length?(t=typeof C=="function"?C:qn(C),m):t},m.subject=function(C){return arguments.length?(n=typeof C=="function"?C:qn(C),m):n},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:qn(!!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 en=0,jn=0,mn=0,Lu=1e3,bs,En,ws=0,Nt=0,Hs=0,_n=typeof performance=="object"&&performance.now?performance:Date,Tu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ur(){return Nt||(Tu(BE),Nt=_n.now()+Hs)}function BE(){Nt=0}function vs(){this._call=this._time=this._next=null}vs.prototype=Mu.prototype={constructor:vs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ur():+n)+(t==null?0:+t),!this._next&&En!==this&&(En?En._next=this:bs=this,En=this),this._call=e,this._time=n,Yo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yo())}};function Mu(e,t,n){var s=new vs;return s.restart(e,t,n),s}function $E(){Ur(),++en;for(var e=bs,t;e;)(t=Nt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--en}function Ui(){Nt=(ws=_n.now())+Hs,en=jn=0;try{$E()}finally{en=0,VE(),Nt=0}}function zE(){var e=_n.now(),t=e-ws;t>Lu&&(Hs-=t,ws=e)}function VE(){for(var e,t=bs,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:bs=n);En=e,Yo(s)}function Yo(e){if(!en){jn&&(jn=clearTimeout(jn));var t=e-Nt;t>24?(e<1/0&&(jn=setTimeout(Ui,e-_n.now()-Hs)),mn&&(mn=clearInterval(mn))):(mn||(ws=_n.now(),mn=setInterval(zE,Lu)),en=1,Tu(Ui))}}function Wi(e,t,n){var s=new vs;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,n),s}var FE=Vs("start","end","cancel","interrupt"),HE=[],Nu=0,Xi=1,Go=2,cs=3,qi=4,Uo=5,us=6;function Zs(e,t,n,s,o,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;ZE(e,n,{name:t,index:s,group:o,on:FE,tween:HE,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Nu})}function Wr(e,t){var n=Je(e,t);if(n.state>Nu)throw new Error("too late; already scheduled");return n}function st(e,t){var n=Je(e,t);if(n.state>cs)throw new Error("too late; already running");return n}function Je(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ZE(e,t,n){var s=e.__transition,o;s[t]=n,n.timer=Mu(i,0,n.time);function i(d){n.state=Xi,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!==Xi)return c();for(x in s)if(h=s[x],h.name===n.name){if(h.state===cs)return Wi(l);h.state===qi?(h.state=us,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete s[x]):+x<t&&(h.state=us,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete s[x])}if(Wi(function(){n.state===cs&&(n.state=qi,n.timer.restart(a,n.delay,n.time),a(d))}),n.state=Go,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Go){for(n.state=cs,o=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))&&(o[++p]=h);o.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=Uo,1),p=-1,m=o.length;++p<m;)o[p].call(e,x);n.state===Uo&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=us,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function ds(e,t){var n=e.__transition,s,o,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){i=!1;continue}o=s.state>Go&&s.state<Uo,s.state=us,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function KE(e){return this.each(function(){ds(this,e)})}function YE(e,t){var n,s;return function(){var o=st(this,e),i=o.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}}o.tween=s}}function GE(e,t,n){var s,o;if(typeof n!="function")throw new Error;return function(){var i=st(this,e),l=i.tween;if(l!==s){o=(s=l).slice();for(var a={name:t,value:n},c=0,d=o.length;c<d;++c)if(o[c].name===t){o[c]=a;break}c===d&&o.push(a)}i.tween=o}}function UE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Je(this.node(),n).tween,o=0,i=s.length,l;o<i;++o)if((l=s[o]).name===e)return l.value;return null}return this.each((t==null?YE:GE)(n,e,t))}function Xr(e,t,n){var s=e._id;return e.each(function(){var o=st(this,s);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Je(o,s).value[t]}}function Pu(e,t){var n;return(typeof t=="number"?O.interpolateNumber:t instanceof O.color?O.interpolateRgb:(n=O.color(t))?(t=n,O.interpolateRgb):O.interpolateString)(e,t)}function WE(e){return function(){this.removeAttribute(e)}}function XE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qE(e,t,n){var s,o=n+"",i;return function(){var l=this.getAttribute(e);return l===o?null:l===s?i:i=t(s=l,n)}}function QE(e,t,n){var s,o=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===s?i:i=t(s=l,n)}}function JE(e,t,n){var s,o,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===o?i:(o=c,i=t(s=l,a)))}}function e3(e,t,n){var s,o,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===o?i:(o=c,i=t(s=l,a)))}}function t3(e,t){var n=Fs(e),s=n==="transform"?Sh:Pu;return this.attrTween(e,typeof t=="function"?(n.local?e3:JE)(n,s,Xr(this,"attr."+e,t)):t==null?(n.local?XE:WE)(n):(n.local?QE:qE)(n,s,t))}function n3(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function s3(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function o3(e,t){var n,s;function o(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&s3(e,i)),n}return o._value=t,o}function r3(e,t){var n,s;function o(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&n3(e,i)),n}return o._value=t,o}function i3(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=Fs(e);return this.tween(n,(s.local?o3:r3)(s,t))}function l3(e,t){return function(){Wr(this,e).delay=+t.apply(this,arguments)}}function a3(e,t){return t=+t,function(){Wr(this,e).delay=t}}function c3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?l3:a3)(t,e)):Je(this.node(),t).delay}function u3(e,t){return function(){st(this,e).duration=+t.apply(this,arguments)}}function d3(e,t){return t=+t,function(){st(this,e).duration=t}}function x3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?u3:d3)(t,e)):Je(this.node(),t).duration}function p3(e,t){if(typeof t!="function")throw new Error;return function(){st(this,e).ease=t}}function m3(e){var t=this._id;return arguments.length?this.each(p3(t,e)):Je(this.node(),t).ease}function f3(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;st(this,e).ease=n}}function h3(e){if(typeof e!="function")throw new Error;return this.each(f3(this._id,e))}function g3(e){typeof e!="function"&&(e=hu(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,a=s[o]=[],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 j3(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,o=n.length,i=Math.min(s,o),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 E3(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 y3(e,t,n){var s,o,i=E3(t)?Wr:st;return function(){var l=i(this,e),a=l.on;a!==s&&(o=(s=a).copy()).on(t,n),l.on=o}}function S3(e,t){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(e):this.each(y3(n,e,t))}function R3(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function C3(){return this.on("end.remove",R3(this._id))}function b3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yr(e));for(var s=this._groups,o=s.length,i=new Array(o),l=0;l<o;++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,Zs(d[m],t,n,m,d,Je(x,n)));return new at(i,this._parents,t,n)}function w3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fu(e));for(var s=this._groups,o=s.length,i=[],l=[],a=0;a<o;++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=Je(x,n),E=0,S=m.length;E<S;++E)(h=m[E])&&Zs(h,t,n,E,m,g);i.push(m),l.push(x)}return new at(i,l,t,n)}var v3=$n.prototype.constructor;function k3(){return new v3(this._groups,this._parents)}function _3(e,t){var n,s,o;return function(){var i=Jt(this,e),l=(this.style.removeProperty(e),Jt(this,e));return i===l?null:i===n&&l===s?o:o=t(n=i,s=l)}}function Au(e){return function(){this.style.removeProperty(e)}}function L3(e,t,n){var s,o=n+"",i;return function(){var l=Jt(this,e);return l===o?null:l===s?i:i=t(s=l,n)}}function T3(e,t,n){var s,o,i;return function(){var l=Jt(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Jt(this,e))),l===c?null:l===s&&c===o?i:(o=c,i=t(s=l,a))}}function M3(e,t){var n,s,o,i="style."+t,l="end."+i,a;return function(){var c=st(this,e),d=c.on,x=c.value[i]==null?a||(a=Au(t)):void 0;(d!==n||o!==x)&&(s=(n=d).copy()).on(l,o=x),c.on=s}}function N3(e,t,n){var s=(e+="")=="transform"?yh:Pu;return t==null?this.styleTween(e,_3(e,s)).on("end.style."+e,Au(e)):typeof t=="function"?this.styleTween(e,T3(e,s,Xr(this,"style."+e,t))).each(M3(this._id,e)):this.styleTween(e,L3(e,s,t),n).on("end.style."+e,null)}function P3(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function A3(e,t,n){var s,o;function i(){var l=t.apply(this,arguments);return l!==o&&(s=(o=l)&&P3(e,l,n)),s}return i._value=t,i}function O3(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,A3(e,t,n??""))}function I3(e){return function(){this.textContent=e}}function D3(e){return function(){var t=e(this);this.textContent=t??""}}function B3(e){return this.tween("text",typeof e=="function"?D3(Xr(this,"text",e)):I3(e==null?"":e+""))}function $3(e){return function(t){this.textContent=e.call(this,t)}}function z3(e){var t,n;function s(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&$3(o)),t}return s._value=e,s}function V3(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,z3(e))}function F3(){for(var e=this._name,t=this._id,n=Ou(),s=this._groups,o=s.length,i=0;i<o;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)if(c=l[d]){var x=Je(c,t);Zs(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 H3(){var e,t,n=this,s=n._id,o=n.size();return new Promise(function(i,l){var a={value:l},c={value:function(){--o===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}),o===0&&i()})}var Z3=0;function at(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Ou(){return++Z3}var ot=$n.prototype;at.prototype={constructor:at,select:b3,selectAll:w3,selectChild:ot.selectChild,selectChildren:ot.selectChildren,filter:g3,merge:j3,selection:k3,transition:F3,call:ot.call,nodes:ot.nodes,node:ot.node,size:ot.size,empty:ot.empty,each:ot.each,on:S3,attr:t3,attrTween:i3,style:N3,styleTween:O3,text:B3,textTween:V3,remove:C3,tween:UE,delay:c3,duration:x3,ease:m3,easeVarying:h3,end:H3,[Symbol.iterator]:ot[Symbol.iterator]};function K3(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Y3={time:null,delay:0,duration:250,ease:K3};function G3(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 U3(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=Ou(),(n=Y3).time=Ur(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,i=0;i<o;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)(c=l[d])&&Zs(c,e,t,d,l,n||G3(c,t));return new at(s,this._parents,e,t)}$n.prototype.interrupt=KE;$n.prototype.transition=U3;const Qn=e=>()=>e;function W3(e,{sourceEvent:t,target:n,transform:s,dispatch:o}){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:o}})}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 Ks=new it(1,0,0);Iu.prototype=it.prototype;function Iu(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ks;return e.__zoom}function Eo(e){e.stopImmediatePropagation()}function fn(e){e.preventDefault(),e.stopImmediatePropagation()}function X3(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function q3(){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 Qi(){return this.__zoom||Ks}function Q3(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function J3(){return navigator.maxTouchPoints||"ontouchstart"in this}function ey(e,t,n){var s=e.invertX(t[0][0])-n[0][0],o=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(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function Du(){var e=X3,t=q3,n=ey,s=Q3,o=J3,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],a=250,c=ls,d=Vs("start","zoom","end"),x,p,m,h=500,g=150,E=0,S=10;function R(b){b.property("__zoom",Qi).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",F).filter(o).on("touchstart.zoom",$).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}R.transform=function(b,N,_,M){var V=b.selection?b.selection():b;V.property("__zoom",Qi),b!==V?k(b,N,_,M):V.interrupt().each(function(){T(this,arguments).event(M).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},R.scaleBy=function(b,N,_,M){R.scaleTo(b,function(){var V=this.__zoom.k,H=typeof N=="function"?N.apply(this,arguments):N;return V*H},_,M)},R.scaleTo=function(b,N,_,M){R.transform(b,function(){var V=t.apply(this,arguments),H=this.__zoom,K=_==null?C(V):typeof _=="function"?_.apply(this,arguments):_,Z=H.invert(K),G=typeof N=="function"?N.apply(this,arguments):N;return n(y(v(H,G),K,Z),V,l)},_,M)},R.translateBy=function(b,N,_,M){R.transform(b,function(){return n(this.__zoom.translate(typeof N=="function"?N.apply(this,arguments):N,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),l)},null,M)},R.translateTo=function(b,N,_,M,V){R.transform(b,function(){var H=t.apply(this,arguments),K=this.__zoom,Z=M==null?C(H):typeof M=="function"?M.apply(this,arguments):M;return n(Ks.translate(Z[0],Z[1]).scale(K.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof _=="function"?-_.apply(this,arguments):-_),H,l)},M,V)};function v(b,N){return N=Math.max(i[0],Math.min(i[1],N)),N===b.k?b:new it(N,b.x,b.y)}function y(b,N,_){var M=N[0]-_[0]*b.k,V=N[1]-_[1]*b.k;return M===b.x&&V===b.y?b:new it(b.k,M,V)}function C(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function k(b,N,_,M){b.on("start.zoom",function(){T(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(M).end()}).tween("zoom",function(){var V=this,H=arguments,K=T(V,H).event(M),Z=t.apply(V,H),G=_==null?C(Z):typeof _=="function"?_.apply(V,H):_,Q=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),ee=V.__zoom,ae=typeof N=="function"?N.apply(V,H):N,re=c(ee.invert(G).concat(Q/ee.k),ae.invert(G).concat(Q/ae.k));return function(se){if(se===1)se=ae;else{var te=re(se),le=Q/te[2];se=new it(le,G[0]-te[0]*le,G[1]-te[1]*le)}K.zoom(null,se)}})}function T(b,N,_){return!_&&b.__zooming||new P(b,N)}function P(b,N){this.that=b,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,N),this.taps=0}P.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,N){return this.mouse&&b!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=N.invert(this.touch1[0])),this.that.__zoom=N,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var N=He(this.that).datum();d.call(b,this.that,new W3(b,{sourceEvent:this.sourceEvent,target:R,transform:this.that.__zoom,dispatch:d}),N)}};function I(b,...N){if(!e.apply(this,arguments))return;var _=T(this,N).event(b),M=this.__zoom,V=Math.max(i[0],Math.min(i[1],M.k*Math.pow(2,s.apply(this,arguments)))),H=We(b);if(_.wheel)(_.mouse[0][0]!==H[0]||_.mouse[0][1]!==H[1])&&(_.mouse[1]=M.invert(_.mouse[0]=H)),clearTimeout(_.wheel);else{if(M.k===V)return;_.mouse=[H,M.invert(H)],ds(this),_.start()}fn(b),_.wheel=setTimeout(K,g),_.zoom("mouse",n(y(v(M,V),_.mouse[0],_.mouse[1]),_.extent,l));function K(){_.wheel=null,_.end()}}function B(b,...N){if(m||!e.apply(this,arguments))return;var _=b.currentTarget,M=T(this,N,!0).event(b),V=He(b.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",Q,!0),H=We(b,_),K=b.clientX,Z=b.clientY;vu(b.view),Eo(b),M.mouse=[H,this.__zoom.invert(H)],ds(this),M.start();function G(ee){if(fn(ee),!M.moved){var ae=ee.clientX-K,re=ee.clientY-Z;M.moved=ae*ae+re*re>E}M.event(ee).zoom("mouse",n(y(M.that.__zoom,M.mouse[0]=We(ee,_),M.mouse[1]),M.extent,l))}function Q(ee){V.on("mousemove.zoom mouseup.zoom",null),ku(ee.view,M.moved),fn(ee),M.event(ee).end()}}function F(b,...N){if(e.apply(this,arguments)){var _=this.__zoom,M=We(b.changedTouches?b.changedTouches[0]:b,this),V=_.invert(M),H=_.k*(b.shiftKey?.5:2),K=n(y(v(_,H),M,V),t.apply(this,N),l);fn(b),a>0?He(this).transition().duration(a).call(k,K,M,b):He(this).call(R.transform,K,M,b)}}function $(b,...N){if(e.apply(this,arguments)){var _=b.touches,M=_.length,V=T(this,N,b.changedTouches.length===M).event(b),H,K,Z,G;for(Eo(b),K=0;K<M;++K)Z=_[K],G=We(Z,this),G=[G,this.__zoom.invert(G),Z.identifier],V.touch0?!V.touch1&&V.touch0[2]!==G[2]&&(V.touch1=G,V.taps=0):(V.touch0=G,H=!0,V.taps=1+!!x);x&&(x=clearTimeout(x)),H&&(V.taps<2&&(p=G[0],x=setTimeout(function(){x=null},h)),ds(this),V.start())}}function D(b,...N){if(this.__zooming){var _=T(this,N).event(b),M=b.changedTouches,V=M.length,H,K,Z,G;for(fn(b),H=0;H<V;++H)K=M[H],Z=We(K,this),_.touch0&&_.touch0[2]===K.identifier?_.touch0[0]=Z:_.touch1&&_.touch1[2]===K.identifier&&(_.touch1[0]=Z);if(K=_.that.__zoom,_.touch1){var Q=_.touch0[0],ee=_.touch0[1],ae=_.touch1[0],re=_.touch1[1],se=(se=ae[0]-Q[0])*se+(se=ae[1]-Q[1])*se,te=(te=re[0]-ee[0])*te+(te=re[1]-ee[1])*te;K=v(K,Math.sqrt(se/te)),Z=[(Q[0]+ae[0])/2,(Q[1]+ae[1])/2],G=[(ee[0]+re[0])/2,(ee[1]+re[1])/2]}else if(_.touch0)Z=_.touch0[0],G=_.touch0[1];else return;_.zoom("touch",n(y(K,Z,G),_.extent,l))}}function z(b,...N){if(this.__zooming){var _=T(this,N).event(b),M=b.changedTouches,V=M.length,H,K;for(Eo(b),m&&clearTimeout(m),m=setTimeout(function(){m=null},h),H=0;H<V;++H)K=M[H],_.touch0&&_.touch0[2]===K.identifier?delete _.touch0:_.touch1&&_.touch1[2]===K.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(K=We(K,this),Math.hypot(p[0]-K[0],p[1]-K[1])<S)){var Z=He(this).on("dblclick.zoom");Z&&Z.apply(this,arguments)}}}return R.wheelDelta=function(b){return arguments.length?(s=typeof b=="function"?b:Qn(+b),R):s},R.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Qn(!!b),R):e},R.touchable=function(b){return arguments.length?(o=typeof b=="function"?b:Qn(!!b),R):o},R.extent=function(b){return arguments.length?(t=typeof b=="function"?b:Qn([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),R):t},R.scaleExtent=function(b){return arguments.length?(i[0]=+b[0],i[1]=+b[1],R):[i[0],i[1]]},R.translateExtent=function(b){return arguments.length?(l[0][0]=+b[0][0],l[1][0]=+b[1][0],l[0][1]=+b[0][1],l[1][1]=+b[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(b){return arguments.length?(n=b,R):n},R.duration=function(b){return arguments.length?(a=+b,R):a},R.interpolate=function(b){return arguments.length?(c=b,R):c},R.on=function(){var b=d.on.apply(d,arguments);return b===d?R:b},R.clickDistance=function(b){return arguments.length?(E=(b=+b)*b,R):Math.sqrt(E)},R.tapDistance=function(b){return arguments.length?(S=+b,R):S},R}const Oe={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."},Ln=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Bu=["Enter"," ","Escape"],$u={"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 tn;(function(e){e.Partial="partial",e.Full="full"})(tn||(tn={}));const zu={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 ks;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ks||(ks={}));var J;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(J||(J={}));const Ji={[J.Left]:J.Right,[J.Right]:J.Left,[J.Top]:J.Bottom,[J.Bottom]:J.Top};function Vu(e){return e===null?null:e?"valid":"invalid"}const Fu=e=>"id"in e&&"source"in e&&"target"in e,ty=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),qr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),zn=(e,t=[0,0])=>{const{width:n,height:s}=dt(e),o=e.origin??t,i=n*o[0],l=s*o[1];return{x:e.position.x-i,y:e.position.y-l}},ny=(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,o)=>{const i=typeof o=="string";let l=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(o):qr(o)?o:t.nodeLookup.get(o.id));const a=l?_s(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ys(s,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Gs(n)},Vn=(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 o=_s(s);n=Ys(n,o)}}),Gs(n)},Qr=(e,t,[n,s,o]=[0,0,1],i=!1,l=!1)=>{const a={...Fn(t,[n,s,o]),width:t.width/o,height:t.height/o},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=Tn(a,sn(d)),S=(h??0)*(g??0),R=i&&E>0;(!d.internals.handleBounds||R||E>=S||d.dragging)&&c.push(d)}return c},sy=(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 oy(e,t){const n=new Map,s=t?.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(t?.includeHiddenNodes||!o.hidden)&&(!s||s.has(o.id))&&n.set(o.id,o)}),n}async function ry({nodes:e,width:t,height:n,panZoom:s,minZoom:o,maxZoom:i},l){if(e.size===0)return Promise.resolve(!0);const a=oy(e,l),c=Vn(a),d=Jr(c,t,n,l?.minZoom??o,l?.maxZoom??i,l?.padding??.1);return await s.setViewport(d,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function Hu({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:o,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=o;if(l.extent==="parent"&&!l.expandParent)if(!a)i?.("005",Oe.error005());else{const h=a.measured.width,g=a.measured.height;h&&g&&(p=[[c,d],[c+h,d+g]])}else a&&on(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=on(p)?At(t,p,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&i?.("015",Oe.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 iy({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:o}){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=sy(l,c);for(const m of c)a.has(m.id)&&!x.find(g=>g.id===m.id)&&x.push(m);if(!o)return{edges:x,nodes:l};const p=await o({nodes:l,edges:x});return typeof p=="boolean"?p?{edges:x,nodes:l}:{edges:[],nodes:[]}:p}const nn=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),At=(e={x:0,y:0},t,n)=>({x:nn(e.x,t[0][0],t[1][0]-(n?.width??0)),y:nn(e.y,t[0][1],t[1][1]-(n?.height??0))});function Zu(e,t,n){const{width:s,height:o}=dt(n),{x:i,y:l}=n.internals.positionAbsolute;return At(e,[[i,l],[i+s,l+o]],t)}const el=(e,t,n)=>e<t?nn(Math.abs(e-t),1,t)/t:e>n?-nn(Math.abs(e-n),1,t)/t:0,Ku=(e,t,n=15,s=40)=>{const o=el(e.x,s,t.width-s)*n,i=el(e.y,s,t.height-s)*n;return[o,i]},Ys=(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)}),Wo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Gs=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),sn=(e,t=[0,0])=>{const{x:n,y:s}=qr(e)?e.internals.positionAbsolute:zn(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}},_s=(e,t=[0,0])=>{const{x:n,y:s}=qr(e)?e.internals.positionAbsolute:zn(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)}},Yu=(e,t)=>Gs(Ys(Wo(e),Wo(t))),Tn=(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)},tl=e=>Xe(e.width)&&Xe(e.height)&&Xe(e.x)&&Xe(e.y),Xe=e=>!isNaN(e)&&isFinite(e),Ls=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},Us=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Fn=({x:e,y:t},[n,s,o],i=!1,l=[1,1])=>{const a={x:(e-n)/o,y:(t-s)/o};return i?Us(a,l):a},Ts=({x:e,y:t},[n,s,o])=>({x:e*o+n,y:t*o+s});function Kt(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 ly(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=Kt(e,n),o=Kt(e,t);return{top:s,right:o,bottom:s,left:o,x:o*2,y:s*2}}if(typeof e=="object"){const s=Kt(e.top??e.y??0,n),o=Kt(e.bottom??e.y??0,n),i=Kt(e.left??e.x??0,t),l=Kt(e.right??e.x??0,t);return{top:s,right:l,bottom:o,left:i,x:i+l,y:s+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ay(e,t,n,s,o,i){const{x:l,y:a}=Ts(e,[t,n,s]),{x:c,y:d}=Ts({x:e.x+e.width,y:e.y+e.height},[t,n,s]),x=o-c,p=i-d;return{left:Math.floor(l),top:Math.floor(a),right:Math.floor(x),bottom:Math.floor(p)}}const Jr=(e,t,n,s,o,i)=>{const l=ly(i,t,n),a=(t-l.x)/e.width,c=(n-l.y)/e.height,d=Math.min(a,c),x=nn(d,s,o),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}},Ms=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function on(e){return e!==void 0&&e!=="parent"}function dt(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Gu(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Uu(e,t={width:0,height:0},n,s,o){const i={...e},l=s.get(n);if(l){const a=l.origin||o;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 nl(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function cy(){let e,t;return{promise:new Promise((s,o)=>{e=s,t=o}),resolve:e,reject:t}}function uy(e){return{...$u,...e||{}}}function Rn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:o}){const{x:i,y:l}=tt(e),a=Fn({x:i-(o?.left??0),y:l-(o?.top??0)},s),{x:c,y:d}=n?Us(a,t):a;return{xSnapped:c,ySnapped:d,...a}}const ei=e=>({width:e.offsetWidth,height:e.offsetHeight}),Wu=e=>e?.getRootNode?.()||window?.document,dy=["INPUT","SELECT","TEXTAREA"];function Xu(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:dy.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const qu=e=>"clientX"in e,tt=(e,t)=>{const n=qu(e),s=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:s-(t?.left??0),y:o-(t?.top??0)}},sl=(e,t,n,s,o)=>{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:o,position:l.getAttribute("data-handlepos"),x:(a.left-n.left)/s,y:(a.top-n.top)/s,...ei(l)}})};function Qu({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:o,sourceControlY:i,targetControlX:l,targetControlY:a}){const c=e*.125+o*.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 Jn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ol({pos:e,x1:t,y1:n,x2:s,y2:o,c:i}){switch(e){case J.Left:return[t-Jn(t-s,i),n];case J.Right:return[t+Jn(s-t,i),n];case J.Top:return[t,n-Jn(n-o,i)];case J.Bottom:return[t,n+Jn(o-n,i)]}}function Ju({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:s,targetY:o,targetPosition:i=J.Top,curvature:l=.25}){const[a,c]=ol({pos:n,x1:e,y1:t,x2:s,y2:o,c:l}),[d,x]=ol({pos:i,x1:s,y1:o,x2:e,y2:t,c:l}),[p,m,h,g]=Qu({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:a,sourceControlY:c,targetControlX:d,targetControlY:x});return[`M${e},${t} C${a},${c} ${d},${x} ${s},${o}`,p,m,h,g]}function ed({sourceX:e,sourceY:t,targetX:n,targetY:s}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,l=Math.abs(s-t)/2,a=s<t?s+l:s-l;return[i,a,o,l]}function xy({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s,elevateOnSelect:o=!1}){if(s!==void 0)return s;const i=o&&n?1e3:0,l=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return i+l}function py({sourceNode:e,targetNode:t,width:n,height:s,transform:o}){const i=Ys(_s(e),_s(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:s/o[2]};return Tn(l,Gs(i))>0}const td=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,my=(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)),nd=(e,t)=>{if(!e.source||!e.target)return Ls("006",Oe.error006()),t;let n;return Fu(e)?n={...e}:n={...e,id:td(e)},my(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:o,...i}=e;if(!t.source||!t.target)return Ls("006",Oe.error006()),n;if(!n.find(c=>c.id===e.id))return Ls("007",Oe.error007(o)),n;const a={...i,id:s.shouldReplaceId?td(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(c=>c.id!==o).concat(a)};function sd({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[o,i,l,a]=ed({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,o,i,l,a]}const rl={[J.Left]:{x:-1,y:0},[J.Right]:{x:1,y:0},[J.Top]:{x:0,y:-1},[J.Bottom]:{x:0,y:1}},hy=({source:e,sourcePosition:t=J.Bottom,target:n})=>t===J.Left||t===J.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},il=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function gy({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:s=J.Top,center:o,offset:i}){const l=rl[t],a=rl[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,k]=ed({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*a[p]===-1){g=o.x??v,E=o.y??y;const P=[{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"?P:I:h=p==="x"?I:P}else{const P=[{x:c.x,y:d.y}],I=[{x:d.x,y:c.y}];if(p==="x"?h=l.x===m?I:P:h=l.y===m?P:I,t===s){const z=Math.abs(e[p]-n[p]);if(z<=i){const b=Math.min(i-1,i-z);l[p]===m?S[p]=(c[p]>e[p]?-1:1)*b:R[p]=(d[p]>n[p]?-1:1)*b}}if(t!==s){const z=p==="x"?"y":"x",b=l[p]===a[z],N=c[z]>d[z],_=c[z]<d[z];(l[p]===1&&(!b&&N||b&&_)||l[p]!==1&&(!b&&_||b&&N))&&(h=p==="x"?P:I)}const B={x:c.x+S.x,y:c.y+S.y},F={x:d.x+R.x,y:d.y+R.y},$=Math.max(Math.abs(B.x-h[0].x),Math.abs(F.x-h[0].x)),D=Math.max(Math.abs(B.y-h[0].y),Math.abs(F.y-h[0].y));$>=D?(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,k]}function jy(e,t,n,s){const o=Math.min(il(e,t)/2,il(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+o*d},${l}Q ${i},${l} ${i},${l+o*x}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${l+o*c}Q ${i},${l} ${i+o*a},${l}`}function Xo({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:s,targetY:o,targetPosition:i=J.Top,borderRadius:l=5,centerX:a,centerY:c,offset:d=20}){const[x,p,m,h,g]=gy({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:o},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=jy(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 ll(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Ey(e){const{sourceNode:t,targetNode:n}=e;if(!ll(t)||!ll(n))return null;const s=t.internals.handleBounds||al(t.handles),o=n.internals.handleBounds||al(n.handles),i=cl(s?.source??[],e.sourceHandle),l=cl(e.connectionMode===Pt.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!i||!l)return e.onError?.("008",Oe.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||J.Bottom,c=l?.position||J.Top,d=Mn(t,i,a),x=Mn(n,l,c);return{sourceX:d.x,sourceY:d.y,targetX:x.x,targetY:x.y,sourcePosition:a,targetPosition:c}}function al(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 Mn(e,t,n=J.Left,s=!1){const o=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:l,height:a}=t??dt(e);if(s)return{x:o+l/2,y:i+a/2};switch(t?.position??n){case J.Top:return{x:o+l/2,y:i};case J.Right:return{x:o+l,y:i+a/2};case J.Bottom:return{x:o+l/2,y:i+a};case J.Left:return{x:o,y:i+a/2}}}function cl(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function qo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function yy(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:o}){const i=new Set;return e.reduce((l,a)=>([a.markerStart||s,a.markerEnd||o].forEach(c=>{if(c&&typeof c=="object"){const d=qo(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 ti={nodeOrigin:[0,0],nodeExtent:Ln,elevateNodesOnSelect:!0,defaults:{}},Sy={...ti,checkEquality:!0};function ni(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Ry(e,t,n){const s=ni(ti,n);for(const o of e.values())if(o.parentId)si(o,e,t,s);else{const i=zn(o,s.nodeOrigin),l=on(o.extent)?o.extent:s.nodeExtent,a=At(i,l,dt(o));o.internals.positionAbsolute=a}}function Qo(e,t,n,s){const o=ni(Sy,s);let i=e.length>0;const l=new Map(t),a=o?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let d=l.get(c.id);if(o.checkEquality&&c===d?.internals.userNode)t.set(c.id,d);else{const x=zn(c,o.nodeOrigin),p=on(c.extent)?c.extent:o.nodeExtent,m=At(x,p,dt(c));d={...o.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:m,handleBounds:c.measured?d?.internals.handleBounds:void 0,z:od(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&&si(d,t,n,s)}return i}function Cy(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 si(e,t,n,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:l}=ni(ti,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}Cy(e,n);const d=o?1e3:0,{x,y:p,z:m}=by(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 od(e,t){return(Xe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function by(e,t,n,s,o){const{x:i,y:l}=t.internals.positionAbsolute,a=dt(e),c=zn(e,n),d=on(e.extent)?At(c,e.extent,a):c;let x=At({x:i+d.x,y:l+d.y},s,a);e.extent==="parent"&&(x=Zu(x,a,t));const p=od(e,o),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>=p?m+1:p}}function oi(e,t,n,s=[0,0]){const o=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const c=i.get(l.parentId)?.expandedRect??sn(a),d=Yu(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=dt(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)&&(o.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)||o.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)&&o.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:g+(m?p[0]*m-S:0),height:E+(h?p[1]*h-R:0)}})}),o}function wy(e,t,n,s,o,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=ei(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=on(h.extent)?h.extent:i;let{positionAbsolute:y}=h.internals;h.parentId&&h.extent==="parent"?y=Zu(y,g,t.get(h.parentId)):v&&(y=At(y,v,g));const C={...h,measured:g,internals:{...h.internals,positionAbsolute:y,handleBounds:{source:sl("source",m.nodeElement,R,x,h.id),target:sl("target",m.nodeElement,R,x,h.id)}}};t.set(h.id,C),h.parentId&&si(C,t,n,{nodeOrigin:o}),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:sn(C,o)}))}}if(p.length>0){const m=oi(p,t,n,o);c.push(...m)}return{changes:c,updatedInternals:a}}async function vy({delta:e,panZoom:t,transform:n,translateExtent:s,width:o,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],[o,i]],s),a=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(a)}function ul(e,t,n,s,o,i){let l=o;const a=s.get(l)||new Map;s.set(l,a.set(n,t)),l=`${o}-${e}`;const c=s.get(l)||new Map;if(s.set(l,c.set(n,t)),i){l=`${o}-${e}-${i}`;const d=s.get(l)||new Map;s.set(l,d.set(n,t))}}function rd(e,t,n){e.clear(),t.clear();for(const s of n){const{source:o,target:i,sourceHandle:l=null,targetHandle:a=null}=s,c={edgeId:s.id,source:o,target:i,sourceHandle:l,targetHandle:a},d=`${o}-${l}--${i}-${a}`,x=`${i}-${a}--${o}-${l}`;ul("source",c,x,e,o,l),ul("target",c,d,e,i,a),t.set(s.id,s)}}function id(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:id(n,t):!1}function dl(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 ky(e,t,n,s){const o=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!id(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const a=e.get(i);a&&o.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 o}function yo({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){const o=[];for(const[l,a]of t){const c=n.get(l)?.internals.userNode;c&&o.push({...c,position:a.position,dragging:s})}if(!e)return[o[0],o];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:s}:o[0],o]}function _y({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:o}){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:k,nodeClickDistance:T=0}){m=He(y);function P({x:$,y:D},z){const{nodeLookup:b,nodeExtent:N,snapGrid:_,snapToGrid:M,nodeOrigin:V,onNodeDrag:H,onSelectionDrag:K,onError:Z,updateNodePositions:G}=t();i={x:$,y:D};let Q=!1,ee={x:0,y:0,x2:0,y2:0};if(a.size>1&&N){const ae=Vn(a);ee=Wo(ae)}for(const[ae,re]of a){if(!b.has(ae))continue;let se={x:$-re.distance.x,y:D-re.distance.y};M&&(se=Us(se,_));let te=[[N[0][0],N[0][1]],[N[1][0],N[1][1]]];if(a.size>1&&N&&!re.extent){const{positionAbsolute:Ce}=re.internals,ue=Ce.x-ee.x+N[0][0],me=Ce.x+re.measured.width-ee.x2+N[1][0],X=Ce.y-ee.y+N[0][1],de=Ce.y+re.measured.height-ee.y2+N[1][1];te=[[ue,X],[me,de]]}const{position:le,positionAbsolute:Re}=Hu({nodeId:ae,nextPosition:se,nodeLookup:b,nodeExtent:te,nodeOrigin:V,onError:Z});Q=Q||re.position.x!==le.x||re.position.y!==le.y,re.position=le,re.internals.positionAbsolute=Re}if(g=g||Q,!!Q&&(G(a,!0),z&&(s||H||!k&&K))){const[ae,re]=yo({nodeId:k,dragItems:a,nodeLookup:b});s?.(z,a,ae,re),H?.(z,ae,re),k||K?.(z,re)}}async function I(){if(!x)return;const{transform:$,panBy:D,autoPanSpeed:z,autoPanOnNodeDrag:b}=t();if(!b){c=!1,cancelAnimationFrame(l);return}const[N,_]=Ku(d,x,z);(N!==0||_!==0)&&(i.x=(i.x??0)-N/$[2],i.y=(i.y??0)-_/$[2],await D({x:N,y:_})&&P(i,null)),l=requestAnimationFrame(I)}function B($){const{nodeLookup:D,multiSelectionActive:z,nodesDraggable:b,transform:N,snapGrid:_,snapToGrid:M,selectNodesOnDrag:V,onNodeDragStart:H,onSelectionDragStart:K,unselectNodesAndEdges:Z}=t();p=!0,(!V||!C)&&!z&&k&&(D.get(k)?.selected||Z()),C&&V&&k&&e?.(k);const G=Rn($.sourceEvent,{transform:N,snapGrid:_,snapToGrid:M,containerBounds:x});if(i=G,a=ky(D,b,G,k),a.size>0&&(n||H||!k&&K)){const[Q,ee]=yo({nodeId:k,dragItems:a,nodeLookup:D});n?.($.sourceEvent,a,Q,ee),H?.($.sourceEvent,Q,ee),k||K?.($.sourceEvent,ee)}}const F=_u().clickDistance(T).on("start",$=>{const{domNode:D,nodeDragThreshold:z,transform:b,snapGrid:N,snapToGrid:_}=t();x=D?.getBoundingClientRect()||null,h=!1,g=!1,z===0&&B($),i=Rn($.sourceEvent,{transform:b,snapGrid:N,snapToGrid:_,containerBounds:x}),d=tt($.sourceEvent,x)}).on("drag",$=>{const{autoPanOnNodeDrag:D,transform:z,snapGrid:b,snapToGrid:N,nodeDragThreshold:_,nodeLookup:M}=t(),V=Rn($.sourceEvent,{transform:z,snapGrid:b,snapToGrid:N,containerBounds:x});if(($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||k&&!M.has(k))&&(h=!0),!h){if(!c&&D&&p&&(c=!0,I()),!p){const H=V.xSnapped-(i.x??0),K=V.ySnapped-(i.y??0);Math.sqrt(H*H+K*K)>_&&B($)}(i.x!==V.xSnapped||i.y!==V.ySnapped)&&a&&p&&(d=tt($.sourceEvent,x),P(V,$.sourceEvent))}}).on("end",$=>{if(!(!p||h)&&(c=!1,p=!1,cancelAnimationFrame(l),a.size>0)){const{nodeLookup:D,updateNodePositions:z,onNodeDragStop:b,onSelectionDragStop:N}=t();if(g&&(z(a,!1),g=!1),o||b||!k&&N){const[_,M]=yo({nodeId:k,dragItems:a,nodeLookup:D,dragging:!1});o?.($.sourceEvent,a,_,M),b?.($.sourceEvent,_,M),k||N?.($.sourceEvent,M)}}}).filter($=>{const D=$.target;return!$.button&&(!R||!dl(D,`.${R}`,y))&&(!v||dl(D,v,y))});m.call(F)}function S(){m?.on(".drag",null)}return{update:E,destroy:S}}function Ly(e,t,n){const s=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Tn(o,sn(i))>0&&s.push(i);return s}const Ty=250;function My(e,t,n,s){let o=[],i=1/0;const l=Ly(e,n,t+Ty);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}=Mn(a,d,d.position,!0),m=Math.sqrt(Math.pow(x-e.x,2)+Math.pow(p-e.y,2));m>t||(m<i?(o=[{...d,x,y:p}],i=m):m===i&&o.push({...d,x,y:p}))}}if(!o.length)return null;if(o.length>1){const a=s.type==="source"?"target":"source";return o.find(c=>c.type===a)??o[0]}return o[0]}function ld(e,t,n,s,o,i=!1){const l=s.get(e);if(!l)return null;const a=o==="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,...Mn(l,c,c.position,!0)}:c}function ad(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Ny(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const cd=()=>!0;function Py(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:o,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=cd,onReconnectEnd:v,updateConnection:y,getTransform:C,getFromHandle:k,autoPanSpeed:T,dragThreshold:P=1}){const I=Wu(e.target);let B=0,F;const{x:$,y:D}=tt(e),z=I?.elementFromPoint($,D),b=ad(i,z),N=a?.getBoundingClientRect();let _=!1;if(!N||!b)return;const M=ld(o,b,s,c,t);if(!M)return;let V=tt(e,N),H=!1,K=null,Z=!1,G=null;function Q(){if(!x||!N)return;const[Ce,ue]=Ku(V,N,T);m({x:Ce,y:ue}),B=requestAnimationFrame(Q)}const ee={...M,nodeId:o,type:b,position:M.position},ae=c.get(o);let se={inProgress:!0,isValid:null,from:Mn(ae,ee,J.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:ae,to:V,toHandle:null,toPosition:Ji[ee.position],toNode:null};function te(){_=!0,y(se),g?.(e,{nodeId:o,handleId:s,handleType:b})}P===0&&te();function le(Ce){if(!_){const{x:de,y:we}=tt(Ce),Pe=de-$,et=we-D;if(!(Pe*Pe+et*et>P*P))return;te()}if(!k()||!ee){Re(Ce);return}const ue=C();V=tt(Ce,N),F=My(Fn(V,ue,!1,[1,1]),n,c,ee),H||(Q(),H=!0);const me=ud(Ce,{handle:F,connectionMode:t,fromNodeId:o,fromHandleId:s,fromType:l?"target":"source",isValidConnection:R,doc:I,lib:d,flowId:p,nodeLookup:c});G=me.handleDomNode,K=me.connection,Z=Ny(!!F,me.isValid);const X={...se,isValid:Z,to:me.toHandle&&Z?Ts({x:me.toHandle.x,y:me.toHandle.y},ue):V,toHandle:me.toHandle,toPosition:Z&&me.toHandle?me.toHandle.position:Ji[ee.position],toNode:me.toHandle?c.get(me.toHandle.nodeId):null};Z&&F&&se.toHandle&&X.toHandle&&se.toHandle.type===X.toHandle.type&&se.toHandle.nodeId===X.toHandle.nodeId&&se.toHandle.id===X.toHandle.id&&se.to.x===X.to.x&&se.to.y===X.to.y||(y(X),se=X)}function Re(Ce){if(_){(F||G)&&K&&Z&&E?.(K);const{inProgress:ue,...me}=se,X={...me,toPosition:se.toHandle?se.toPosition:null};S?.(Ce,X),i&&v?.(Ce,X)}h(),cancelAnimationFrame(B),H=!1,Z=!1,K=null,G=null,I.removeEventListener("mousemove",le),I.removeEventListener("mouseup",Re),I.removeEventListener("touchmove",le),I.removeEventListener("touchend",Re)}I.addEventListener("mousemove",le),I.addEventListener("mouseup",Re),I.addEventListener("touchmove",le),I.addEventListener("touchend",Re)}function ud(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:i,doc:l,lib:a,flowId:c,isValidConnection:d=cd,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}=tt(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=ad(void 0,S),y=S.getAttribute("data-nodeid"),C=S.getAttribute("data-handleid"),k=S.classList.contains("connectable"),T=S.classList.contains("connectableend");if(!y||!v)return R;const P={source:p?y:s,sourceHandle:p?C:o,target:p?s:y,targetHandle:p?o:C};R.connection=P;const B=k&&T&&(n===Pt.Strict?p&&v==="source"||!p&&v==="target":y!==s||C!==o);R.isValid=B&&d(P),R.toHandle=ld(y,v,C,x,n,!0)}return R}const Jo={onPointerDown:Py,isValid:ud};function Ay({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const o=He(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 k=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*x,T=C[2]*Math.pow(2,k);t.scaleTo(T)};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 k=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],T=[k[0]-E[0],k[1]-E[1]];E=k;const P=s()*Math.max(C[2],Math.log(C[2]))*(h?-1:1),I={x:C[0]-T[0]*P,y:C[1]-T[1]*P},B=[[0,0],[c,d]];t.setViewportConstrained({x:I.x,y:I.y,zoom:C[2]},B,a)},v=Du().on("start",S).on("zoom",p?R:null).on("zoom.wheel",m?g:null);o.call(v,{})}function l(){o.on("zoom",null)}return{update:i,destroy:l,pointer:We}}const Oy=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ws=e=>({x:e.x,y:e.y,zoom:e.k}),So=({x:e,y:t,zoom:n})=>Ks.translate(e,t).scale(n),Gt=(e,t)=>e.target.closest(`.${t}`),dd=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Iy=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ro=(e,t=0,n=Iy,s=()=>{})=>{const o=typeof t=="number"&&t>0;return o||s(),o?e.transition().duration(t).ease(n).on("end",s):e},xd=e=>{const t=e.ctrlKey&&Ms()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Dy({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:d}){return x=>{if(Gt(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const S=We(x),R=xd(x),v=p*Math.pow(2,R);s.scaleTo(n,v,S,x);return}const m=x.deltaMode===1?20:1;let h=o===wt.Vertical?0:x.deltaX*m,g=o===wt.Horizontal?0:x.deltaY*m;!Ms()&&x.shiftKey&&o!==wt.Vertical&&(h=x.deltaY*m,g=0),s.translateBy(n,-(h/p)*i,-(g/p)*i,{internal:!0});const E=Ws(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 By({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,o){const i=s.type==="wheel",l=!t&&i&&!s.ctrlKey,a=Gt(s,e);if(s.ctrlKey&&i&&a&&s.preventDefault(),l||a)return null;s.preventDefault(),n.call(this,s,o)}}function $y({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{if(s.sourceEvent?.internal)return;const o=Ws(s.transform);e.mouseButton=s.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,s.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(s.sourceEvent,o)}}function zy({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:o}){return i=>{e.usedRightMouseButton=!!(n&&dd(t,e.mouseButton??0)),i.sourceEvent?.sync||s([i.transform.x,i.transform.y,i.transform.k]),o&&!i.sourceEvent?.internal&&o?.(i.sourceEvent,Ws(i.transform))}}function Vy({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:i}){return l=>{if(!l.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&dd(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),o&&Oy(e.prevViewport,l.transform))){const a=Ws(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(l.sourceEvent,a)},n?150:0)}}}function Fy({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:o,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"&&(Gt(x,`${d}-flow__node`)||Gt(x,`${d}-flow__edge`)))return!0;if(!s&&!p&&!o&&!i&&!n||l||Gt(x,a)&&x.type==="wheel"||Gt(x,c)&&(x.type!=="wheel"||o&&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&&!o&&!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 Hy({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:o,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=Du().clickDistance(!Xe(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(o),h=He(e).call(m);y({x:i.x,y:i.y,zoom:nn(i.zoom,t,n)},[[0,0],[p.width,p.height]],o);const g=h.on("wheel.zoom"),E=h.on("dblclick.zoom");m.wheelDelta(xd);function S(D,z){return h?new Promise(b=>{m?.interpolate(z?.interpolate==="linear"?O.interpolate:ls).transform(Ro(h,z?.duration,z?.ease,()=>b(!0)),D)}):Promise.resolve(!1)}function R({noWheelClassName:D,noPanClassName:z,onPaneContextMenu:b,userSelectionActive:N,panOnScroll:_,panOnDrag:M,panOnScrollMode:V,panOnScrollSpeed:H,preventScrolling:K,zoomOnPinch:Z,zoomOnScroll:G,zoomOnDoubleClick:Q,zoomActivationKeyPressed:ee,lib:ae,onTransformChange:re}){N&&!x.isZoomingOrPanning&&v();const te=_&&!ee&&!N?Dy({zoomPanValues:x,noWheelClassName:D,d3Selection:h,d3Zoom:m,panOnScrollMode:V,panOnScrollSpeed:H,zoomOnPinch:Z,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}):By({noWheelClassName:D,preventScrolling:K,d3ZoomHandler:g});if(h.on("wheel.zoom",te,{passive:!1}),!N){const Re=$y({zoomPanValues:x,onDraggingChange:d,onPanZoomStart:a});m.on("start",Re);const Ce=zy({zoomPanValues:x,panOnDrag:M,onPaneContextMenu:!!b,onPanZoom:l,onTransformChange:re});m.on("zoom",Ce);const ue=Vy({zoomPanValues:x,panOnDrag:M,panOnScroll:_,onPaneContextMenu:b,onPanZoomEnd:c,onDraggingChange:d});m.on("end",ue)}const le=Fy({zoomActivationKeyPressed:ee,panOnDrag:M,zoomOnScroll:G,panOnScroll:_,zoomOnDoubleClick:Q,zoomOnPinch:Z,userSelectionActive:N,noPanClassName:z,noWheelClassName:D,lib:ae});m.filter(le),Q?h.on("dblclick.zoom",E):h.on("dblclick.zoom",null)}function v(){m.on("zoom",null)}async function y(D,z,b){const N=So(D),_=m?.constrain()(N,z,b);return _&&await S(_),new Promise(M=>M(_))}async function C(D,z){const b=So(D);return await S(b,z),new Promise(N=>N(b))}function k(D){if(h){const z=So(D),b=h.property("__zoom");(b.k!==D.zoom||b.x!==D.x||b.y!==D.y)&&m?.transform(h,z,null,{sync:!0})}}function T(){const D=h?Iu(h.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}function P(D,z){return h?new Promise(b=>{m?.interpolate(z?.interpolate==="linear"?O.interpolate:ls).scaleTo(Ro(h,z?.duration,z?.ease,()=>b(!0)),D)}):Promise.resolve(!1)}function I(D,z){return h?new Promise(b=>{m?.interpolate(z?.interpolate==="linear"?O.interpolate:ls).scaleBy(Ro(h,z?.duration,z?.ease,()=>b(!0)),D)}):Promise.resolve(!1)}function B(D){m?.scaleExtent(D)}function F(D){m?.translateExtent(D)}function $(D){const z=!Xe(D)||D<0?0:D;m?.clickDistance(z)}return{update:R,destroy:v,setViewport:C,setViewportConstrained:y,getViewport:T,scaleTo:P,scaleBy:I,setScaleExtent:B,setTranslateExtent:F,syncViewport:k,setClickDistance:$}}var rn;(function(e){e.Line="line",e.Handle="handle"})(rn||(rn={}));function Zy({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:o,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&&o&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function Ky(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:o}}function xt(e,t){return Math.max(0,t-e)}function pt(e,t){return Math.max(0,e-t)}function es(e,t,n){return Math.max(0,t-e,e-n)}function xl(e,t){return e?!t:t}function Yy(e,t,n,s,o,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:k,height:T,aspectRatio:P}=e;let I=Math.floor(x?h-e.pointerX:0),B=Math.floor(p?g-e.pointerY:0);const F=k+(c?-I:I),$=T+(d?-B:B),D=-i[0]*k,z=-i[1]*T;let b=es(F,E,S),N=es($,R,v);if(l){let V=0,H=0;c&&I<0?V=xt(y+I+D,l[0][0]):!c&&I>0&&(V=pt(y+F+D,l[1][0])),d&&B<0?H=xt(C+B+z,l[0][1]):!d&&B>0&&(H=pt(C+$+z,l[1][1])),b=Math.max(b,V),N=Math.max(N,H)}if(a){let V=0,H=0;c&&I>0?V=pt(y+I,a[0][0]):!c&&I<0&&(V=xt(y+F,a[1][0])),d&&B>0?H=pt(C+B,a[0][1]):!d&&B<0&&(H=xt(C+$,a[1][1])),b=Math.max(b,V),N=Math.max(N,H)}if(o){if(x){const V=es(F/P,R,v)*P;if(b=Math.max(b,V),l){let H=0;!c&&!d||c&&!d&&m?H=pt(C+z+F/P,l[1][1])*P:H=xt(C+z+(c?I:-I)/P,l[0][1])*P,b=Math.max(b,H)}if(a){let H=0;!c&&!d||c&&!d&&m?H=xt(C+F/P,a[1][1])*P:H=pt(C+(c?I:-I)/P,a[0][1])*P,b=Math.max(b,H)}}if(p){const V=es($*P,E,S)/P;if(N=Math.max(N,V),l){let H=0;!c&&!d||d&&!c&&m?H=pt(y+$*P+D,l[1][0])/P:H=xt(y+(d?B:-B)*P+D,l[0][0])/P,N=Math.max(N,H)}if(a){let H=0;!c&&!d||d&&!c&&m?H=xt(y+$*P,a[1][0])/P:H=pt(y+(d?B:-B)*P,a[0][0])/P,N=Math.max(N,H)}}}B=B+(B<0?N:-N),I=I+(I<0?b:-b),o&&(m?F>$*P?B=(xl(c,d)?-I:I)/P:I=(xl(c,d)?-B:B)*P:x?(B=I/P,d=c):(I=B*P,c=d));const _=c?y+I:y,M=d?C+B:C;return{width:k+(c?-I:I),height:T+(d?-B:B),x:i[0]*I*(c?-1:1)+_,y:i[1]*B*(d?-1:1)+M}}const pd={width:0,height:0,x:0,y:0},Gy={...pd,pointerX:0,pointerY:0,aspectRatio:1};function Uy(e){return[[0,0],[e.measured.width,e.measured.height]]}function Wy(e,t,n){const s=t.position.x+e.position.x,o=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,o-c],[s+i-a,o+l-c]]}function Xy({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:o}){const i=He(e);function l({controlPosition:c,boundaries:d,keepAspectRatio:x,resizeDirection:p,onResizeStart:m,onResize:h,onResizeEnd:g,shouldResize:E}){let S={...pd},R={...Gy};const v=Ky(c);let y,C=null,k=[],T,P,I;const B=_u().on("start",F=>{const{nodeLookup:$,transform:D,snapGrid:z,snapToGrid:b,nodeOrigin:N,paneDomNode:_}=n();if(y=$.get(t),!y)return;C=_?.getBoundingClientRect()??null;const{xSnapped:M,ySnapped:V}=Rn(F.sourceEvent,{transform:D,snapGrid:z,snapToGrid:b,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:M,pointerY:V,aspectRatio:S.width/S.height},T=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(T=$.get(y.parentId),P=T&&y.extent==="parent"?Uy(T):void 0),k=[],I=void 0;for(const[H,K]of $)if(K.parentId===t&&(k.push({id:H,position:{...K.position},extent:K.extent}),K.extent==="parent"||K.expandParent)){const Z=Wy(K,y,K.origin??N);I?I=[[Math.min(Z[0][0],I[0][0]),Math.min(Z[0][1],I[0][1])],[Math.max(Z[1][0],I[1][0]),Math.max(Z[1][1],I[1][1])]]:I=Z}m?.(F,{...S})}).on("drag",F=>{const{transform:$,snapGrid:D,snapToGrid:z,nodeOrigin:b}=n(),N=Rn(F.sourceEvent,{transform:$,snapGrid:D,snapToGrid:z,containerBounds:C}),_=[];if(!y)return;const{x:M,y:V,width:H,height:K}=S,Z={},G=y.origin??b,{width:Q,height:ee,x:ae,y:re}=Yy(R,v,N,d,x,G,P,I),se=Q!==H,te=ee!==K,le=ae!==M&&se,Re=re!==V&&te;if(!le&&!Re&&!se&&!te)return;if((le||Re||G[0]===1||G[1]===1)&&(Z.x=le?ae:S.x,Z.y=Re?re:S.y,S.x=Z.x,S.y=Z.y,k.length>0)){const X=ae-M,de=re-V;for(const we of k)we.position={x:we.position.x-X+G[0]*(Q-H),y:we.position.y-de+G[1]*(ee-K)},_.push(we)}if((se||te)&&(Z.width=se&&(!p||p==="horizontal")?Q:S.width,Z.height=te&&(!p||p==="vertical")?ee:S.height,S.width=Z.width,S.height=Z.height),T&&y.expandParent){const X=G[0]*(Z.width??0);Z.x&&Z.x<X&&(S.x=X,R.x=R.x-(Z.x-X));const de=G[1]*(Z.height??0);Z.y&&Z.y<de&&(S.y=de,R.y=R.y-(Z.y-de))}const Ce=Zy({width:S.width,prevWidth:H,height:S.height,prevHeight:K,affectsX:v.affectsX,affectsY:v.affectsY}),ue={...S,direction:Ce};E?.(F,ue)!==!1&&(h?.(F,ue),s(Z,_))}).on("end",F=>{g?.(F,{...S}),o?.({...S})});i.call(B)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var ts={exports:{}},Co={},ns={exports:{}},bo={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./main-DCvw0wt3.cjs"),r=require("./jsx-runtime-CITbqOLs.cjs"),j=require("react"),u=require("./css-CmXY6iPo.cjs"),M=require("./eraser-h8NIswGM.cjs"),Cf=require("./external-CiJ7RsGt.cjs"),ql=require("./Animated-BT-w0cPF.cjs"),Ql=require("react-dom"),O=require("./LinePlot-De-VLJHL.cjs"),Ns=require("./external-CNbPkF53.cjs"),ne=require("zod"),_e=require("./external-DynvKrxv.cjs"),Jl=require("./external-D2VXaXzu.cjs"),nt=require("./external-Dl5JyJaH.cjs"),ea=require("./external-BBGCooyz.cjs"),Ae=require("./external-ETemCKjS.cjs"),pe=require("./external-aXmXhGMj.cjs"),ta=require("./units-DkdMPsxa.cjs"),bf=require("./external-DYC1EK6G.cjs"),wf=require("./external-S6GiiOBy.cjs"),Le=require("./external-zzhrikgD.cjs"),vf=require("./external-CGbANgXa.cjs"),kf=require("./external-CMtT44YA.cjs"),_f=require("./Video-CgaO8bTm.cjs"),na=require("./Toggle-DY4PmA0_.cjs"),Mf=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),Tf=e=>ne.array(e).or(e.transform(t=>[t])),sa=e=>M.y(e,(t,n,s)=>{const o=n===s.length-1,i=!isNaN(parseInt(t)),l=!isNaN(parseInt(s[n+1]));return i&&(t="element"),o||l?t:[t,"shape"]}),bi=(e,t)=>{if(e==null)return null;const n=e[t];return n==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:n},Lf=(e,t,n)=>t===""?e:M.p(bi(e,"shape"),sa(t),{...n,getter:bi}),Pf=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:Lf,getFieldSchemaPath:sa,nullToUndefined:Mf,toArray:Tf},Symbol.toStringTag,{value:"Module"})),oa=Symbol(),rr=Symbol(),pn="a",is="w";let Nf=(e,t)=>new Proxy(e,t);const To=Object.getPrototypeOf,wi=new WeakMap,ir=e=>e&&(wi.has(e)?wi.get(e):To(e)===Object.prototype||To(e)===Array.prototype),vi=e=>typeof e=="object"&&e!==null,ki=new WeakMap,ra=e=>e[rr]||e,ia=(e,t,n)=>{if(!ir(e))return e;const s=ra(e),o=(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===o||(i=((l,a)=>{const c={f:a};let d=!1;const x=(m,h)=>{if(!d){let g=c[pn].get(l);if(g||(g={},c[pn].set(l,g)),m===is)g[is]=!0;else{let E=g[m];E||(E=new Set,g[m]=E),E.add(h)}}},p={get:(m,h)=>h===rr?l:(x("k",h),ia(Reflect.get(m,h),c[pn],c.c)),has:(m,h)=>h===oa?(d=!0,c[pn].delete(l),!0):(x("h",h),Reflect.has(m,h)),getOwnPropertyDescriptor:(m,h)=>(x("o",h),Reflect.getOwnPropertyDescriptor(m,h)),ownKeys:m=>(x(is),Reflect.ownKeys(m))};return a&&(p.set=p.deleteProperty=()=>!1),[p,c]})(s,o),i[1].p=Nf(o?(l=>{let a=ki.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(To(l),c)}ki.set(l,a)}return a})(s):s,i[0]),n&&n.set(s,i)),i[1][pn]=t,i[1].c=n,i[1].p},la=(e,t,n,s)=>{if(Object.is(e,t))return!1;if(!vi(e)||!vi(t))return!0;const o=n.get(ra(e));if(!o)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 o.h||[])if(i=Reflect.has(e,l)!==Reflect.has(t,l),i)return i;if(o[is]===!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 o.o||[])if(i=!!Reflect.getOwnPropertyDescriptor(e,l)!=!!Reflect.getOwnPropertyDescriptor(t,l),i)return i;for(const l of o.k||[])if(i=la(e[l],t[l],n,s),i)return i;return i===null&&(i=!0),i}finally{s&&s.set(e,{n:t,g:i})}},Af=e=>!!ir(e)&&oa in e,aa=e=>ir(e)&&e[rr]||null,Of="h",If="w",Df="o",Bf="k",Lo=e=>typeof e=="object"&&e!==null,ca=(e,t)=>{if(!Lo(e))return e;const n=aa(e);return n!==null?(Af(e),n):(t.has(e)||(t.add(e),Object.entries(e).forEach(([s,o])=>{const i=ca(o,t);Object.is(i,o)||(e[s]=i)})),e)},Po=(e,t,n)=>{var s,o,i;if(!Lo(e)||!Lo(t))return;const l=n.get(aa(t)||t);l&&((s=l[Of])==null||s.forEach(a=>{Reflect.has(e,a)}),l[If]===!0&&Reflect.ownKeys(e),(o=l[Df])==null||o.forEach(a=>{Reflect.getOwnPropertyDescriptor(e,a)}),(i=l[Bf])==null||i.forEach(a=>{Po(e[a],t[a],n)}))},lo="o",ao="r",co="a";function $f(e,t){var n;let s=0;const o=(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[ao];for(let g=0;g<o;g+=1){const E=i[(s+g)%o];if(!E)break;if(!la(E[lo],c,E[co],new WeakMap))return Po(c,E[lo],E[co]),l?.set(c,E),E[ao]}const x=new WeakMap,p=ia(c,x),m=ca(e(p),new Set);Po(c,c,x);const h={[lo]:c,[ao]:m,[co]:x};return s=(s-1+o)%o,i[s]=h,l?.set(c,h),m}}const zf=(e,t)=>u.S.RUNTIME==="browser"?$f(e,t):e,It=(e,t)=>{j.useEffect(()=>{const n=new AbortController,s=n.signal,i=(async()=>(await u.pr(),await e(s)))().catch(console.error);return()=>{n.abort(),i.then(l=>l?.()).catch(console.error)}},t)},Vf=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,CSV:f.CSV,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,DarkMode:f.DarkMode,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,FillColor:f.FillColor,Filter:f.Filter,Fitting:f.Fitting,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,LightMode:f.LightMode,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,Process:f.Process,Pump:f.Pump,Python:f.Python,QuestionMark:f.QuestionMark,Rack:f.Rack,Range:f.Range,Reference:f.Reference,Refresh:f.Refresh,Release:f.Release,Rename:f.Rename,Reset:f.Reset,Resources:f.Resources,Rotate:f.Rotate,Rule:f.Rule,Safety:f.Safety,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,StrokeColor:f.StrokeColor,StrokeWidth:f.StrokeWidth,Subtract:f.Subtract,Sync:f.Sync,Table:f.Table,Tank:f.Tank,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,Valve:f.Valve,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"})),Ff=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"})),lr=({ref:e,location:t,style:n,size:s,className:o,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.p.dimension(p);return r.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("resize"),u.CSS.loc(x),o),style:{[m]:`${s}${a}`,...n},ref:e,direction:p,empty:!0,...d,children:[i,c&&r.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})]})},ua=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:o="x"})=>{const i=j.useRef(null),[l,a]=j.useState({sizeDistribution:Hf(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),o);a(E=>xo(E,g,p,s,m,h))},[s,a,o]);j.useEffect(()=>e?.(l.sizeDistribution),[l.sizeDistribution,e]);const d=j.useCallback((p,m)=>{p.preventDefault();const h=o==="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,o,xo]);return{setSize:j.useCallback((p,m)=>c(p,void 0,m),[xo]),props:{direction:o,sizeDistribution:l.sizeDistribution,onDragHandle:d,ref:i}}},da=({ref:e,direction:t="x",children:n,sizeDistribution:s,onDragHandle:o,className:i,...l})=>{const a=u.p.construct(t),c=j.Children.toArray(n);return s=Zf(s),r.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)=>r.jsxRuntimeExports.jsx(lr,{onDragStart:p=>o(p,x),location:u.p.location(a),size:s[x]*100,sizeUnits:"%",showHandle:x!==c.length-1,children:d},x))})},Hf=(e,t)=>{const n=e.reduce((o,i)=>o+i,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(o=>o/n);if(e.every(o=>o<=1)){const o=1-n;return[...e,...Array(s).fill(o/s)]}return e.map(()=>1/t)},uo=.001,Zf=e=>e.every(t=>u.cr.closeTo(t,1/e.length),uo)?e.map((t,n)=>n%2===0?t+uo:n===e.length-1?t:t-uo):e,xo=(e,t,n,s,o,i)=>{const l=xa(e,t,n,o,i),[a,c]=Kf(e.sizeDistribution,n,l,s/t),d=c?o??null:e.root;return{...e,sizeDistribution:a,root:d}},xa=(e,t,n,s,o)=>{let i;if(o!=null)o>1&&(o/=t),i=o-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},Kf=(e,t,n,s)=>{let o=t;for(;o>0&&e[o]+n<=s;)o--;const i=e[o]+n,l=Yf(o,e,s,n),a=e[l]-n;return i<s||a<s?[e,!1]:[e.map((c,d)=>d===o?i:d===l?a:c),!0]},Yf=(e,t,n,s)=>(e===t.length-1?Uf:Gf)(e,t,n,s),Gf=(e,t,n,s)=>{let o=e+1;for(;o<t.length-1&&t[o]-s<=n;)o++;return o},Uf=(e,t,n,s)=>{let o=e-1;for(;o>0&&t[o]-s<=n;)o--;return o},po=2,Wf=100,pa=({onCollapse:e,onResize:t,location:n="left",minSize:s,maxSize:o,initialSize:i=200,collapseThreshold:l=1/0,className:a,...c})=>{const[d,x]=j.useState(u.R(i,s,o)),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))),k=p.current+C,T=u.R(k,s,o);return(T-k)/(s??Wf)>l?po:T},[m,s,o,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)===po&&e?.(),[e,h]);j.useEffect(()=>{s==null||o==null||x(y=>{const C=u.R(y,s,o);return p.current=C,C})},[s,o]);const v=_e.useCursorDrag({onMove:E,onStart:S,onEnd:R});return r.jsxRuntimeExports.jsx(lr,{ref:g,location:m,size:d,onDragStart:v,className:u.clsx(a,u.CSS.expanded(d!==po)),...c})},Xf=Object.freeze(Object.defineProperty({__proto__:null,Core:lr,Multiple:da,Single:pa,calculateDiffPercentage:xa,useMultiple:ua},Symbol.toStringTag,{value:"Module"})),ar=({aetherKey:e,enabled:t=!0})=>{const{setState:n}=f.useLifecycle({aetherKey:e,type:M.Eraser.TYPE,schema:M.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])}},qf=({aetherKey:e,children:t})=>{const{erase:n}=ar({aetherKey:e}),s=f.useResize(n);return r.jsxRuntimeExports.jsx("div",{ref:s,className:u.CSS(u.CSS.inheritDims()),children:t})},Qf=Object.freeze(Object.defineProperty({__proto__:null,Eraser:qf,use:ar},Symbol.toStringTag,{value:"Module"})),Jf=({items:e,initialKey:t})=>{const[n,s]=j.useState(t),o=l=>s(l===n?void 0:l),i=e.find(l=>l.key===n);return{onSelect:o,activeItem:i}},eh=({activeItem:e,children:t,onSelect:n,location:s="left",collapseThreshold:o=.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}=ar({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 r.jsxRuntimeExports.jsx(pa,{className:u.CSS(u.CSS.B("nav-drawer"),u.CSS.dir(x),u.CSS.visible(e!=null),i),collapseThreshold:o,onCollapse:p,location:s,onResize:h,minSize:E,maxSize:S,initialSize:R,...d,children:g})},th=Object.freeze(Object.defineProperty({__proto__:null,Bar:f.Bar,Drawer:eh,useDrawer:Jf},Symbol.toStringTag,{value:"Module"})),cr={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)"},ur=({variant:e,...t})=>e==="loading"?r.jsxRuntimeExports.jsx(f.Loading,{...t}):r.jsxRuntimeExports.jsx(f.Circle,{color:e!=null?cr[e]:void 0,...t}),nh=({action:e})=>j.isValidElement(e)?e:j.createElement(f.Button,{...e,key:e.key,size:"tiny"}),sh=({status:{key:e,time:t,count:n,message:s,description:o,variant:i},silence:l,actions:a,className:c,children:d,...x})=>{const p=j.useRef(null);return r.jsxRuntimeExports.jsxs(f.Box,{className:u.CSS(u.CSS.B("notification"),c),y:!0,empty:!0,ref:p,...x,children:[r.jsxRuntimeExports.jsxs(f.Box,{x:!0,justify:"between",grow:!0,style:{width:"100%"},children:[r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",gap:"small",children:[r.jsxRuntimeExports.jsx(ur,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:`x${n}`}),r.jsxRuntimeExports.jsx(f.DateTime,{className:u.CSS(u.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),r.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:r.jsxRuntimeExports.jsx(f.Close,{})})]}),r.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"start",className:u.CSS(u.CSS.BE("notification","content")),gap:"small",children:[d??r.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","message")),style:{flexGrow:1},children:s}),o!=null&&r.jsxRuntimeExports.jsx(f.Text,{className:u.CSS(u.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:o})]}),a!=null&&r.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",justify:"end",className:u.CSS(u.CSS.BE("notification","actions")),children:M.t.toArray(a).map(m=>r.jsxRuntimeExports.jsx(nh,{action:m},m.key))})]},t.toString())},oh=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:f.Aggregator,Indicator:ur,Notification:sh,Summary:f.Summary,VARIANT_COLORS:cr,useAdder:f.useAdder,useAsyncErrorHandler:f.useAsyncErrorHandler,useErrorHandler:f.useErrorHandler,useNotifications:f.useNotifications},Symbol.toStringTag,{value:"Module"})),ma=e=>e==="preview"?"connected":e,fa=e=>e==="preview"?"preview":void 0,As=({resourceName:e,value:t,onChange:n,data:s,getItem:o,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:k="connected",...T})=>r.jsxRuntimeExports.jsx(f.Frame,{variant:ma(k),...T,children:r.jsxRuntimeExports.jsxs(f.Frame$1,{multiple:!0,value:t,onChange:n,data:s,getItem:o,subscribe:i,onFetchMore:m,allowNone:S,replaceOnSingle:R,virtual:y,children:[r.jsxRuntimeExports.jsx(ga,{haulType:l,icon:a,placeholder:`Select ${e}s`,disabled:c,variant:fa(k),...v,children:g}),r.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:d,emptyContent:x,status:p,actions:E,resourceName:e,...C,children:h})]})}),Qe=(e,t)=>{const n={};t.forEach(o=>n[o]=void 0);const s=o=>{const{...i}={...o,...n};return r.jsxRuntimeExports.jsx(e,{...i})};return s.displayName=`RemoveProps(${e.displayName})`,s},ha=e=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:M.SIZES,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"tiny",children:"S"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"small",children:"M"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"medium",children:"L"})]}),rh=Object.freeze(Object.defineProperty({__proto__:null,SIZES:M.SIZES,SelectSize:ha,isRenderProp:f.isRenderProp,isSize:M.isSize,removeProps:Qe,renderProp:f.renderProp,size:M.size},Symbol.toStringTag,{value:"Module"})),Os=({children:e="",size:t="medium",color:n,icon:s,onClose:o,className:i,onDragStart:l,...a})=>{const c=u.fr.cssString(n);s==null&&n!=null&&(s=r.jsxRuntimeExports.jsx(f.Circle,{color:c}));const d=o==null?void 0:r.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(),o()},children:r.jsxRuntimeExports.jsx(f.Close,{})});return r.jsxRuntimeExports.jsxs(f.Button,{el:"div",className:u.CSS(i,u.CSS.B("tag"),o!=null&&u.CSS.BM("tag","closeable")),size:t,overflow:"nowrap",align:"center",gap:"small",onDragStart:l,...a,children:[s,d,e]})},dr=({children:e,onClick:t,variant:n="outlined",size:s="medium",...o})=>r.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,...o,children:e}),ih=Object.freeze(Object.defineProperty({__proto__:null,Tag:Os,Tags:dr},Symbol.toStringTag,{value:"Module"})),lh=({itemKey:e,icon:t,onDragStart:n})=>{const s=f.useItem(e),{onSelect:o}=f.useItemState(e);return r.jsxRuntimeExports.jsx(Os,{onClose:o,onDragStart:()=>n(e),draggable:!0,size:"small",status:s==null?"error":void 0,icon:s?.icon??t,children:s?.name??e})},ah=f.renderProp(lh),xr=({items:e},t,n,s)=>{if(t===""||s===!0)return!1;const o=f.filterByType(t,e);return o.length>0&&!o.every(i=>n.includes(i.key))},ga=({haulType:e="",disabled:t,placeholder:n="Select...",variant:s="outlined",icon:o,children:i=ah})=>{const l=f.useSelection(),a=f.useSyncedRef(l),{setSelected:c}=f.useContext$3(),{toggle:d,visible:x}=f.useContext$2(),p=j.useCallback(v=>xr(v,e,M.t.toArray(l),t),[e,l,t]),{startDrag:m,...h}=f.useDragAndDrop({type:e,canDrop:p,onDrop:f.useFilterByTypeCallback(e,({items:v})=>{const y=M.t.toArray(a.current);return c(u.c.unique([...M.t.toArray(y),...v.map(C=>C.key)])),v},[c])}),g=j.useCallback(({dropped:v})=>{const y=l.filter(C=>!v.some(k=>k.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 r.jsxRuntimeExports.jsxs(dr,{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&&r.jsxRuntimeExports.jsxs(f.Text,{color:8,weight:400,style:{padding:"0 1rem"},children:[o,n]}),l.map(v=>i({key:v,itemKey:v,onDragStart:E,icon:o})),s!=="text"&&r.jsxRuntimeExports.jsx(ql.Animated,{className:u.CSS.level("p"),enabled:x,enabledLoc:"bottom",disabledLoc:"left",color:8}),R&&r.jsxRuntimeExports.jsx(f.Button,{variant:s,onClick:v=>{v.stopPropagation(),d()},children:r.jsxRuntimeExports.jsx(f.Add,{color:8})})]})},Dt=({resourceName:e,onChange:t,value:n,allowNone:s,emptyContent:o,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:k=!0,...T})=>r.jsxRuntimeExports.jsx(f.Frame,{...T,variant:ma(S),children:r.jsxRuntimeExports.jsxs(f.Frame$1,{value:n,onChange:t,data:l,getItem:a,subscribe:c,allowNone:s,onFetchMore:x,itemHeight:d,virtual:C,closeDialogOnSelect:k,children:[r.jsxRuntimeExports.jsx(ja,{haulType:i,icon:g,placeholder:`Select a ${e}`,disabled:p,variant:fa(S),...y}),r.jsxRuntimeExports.jsx(f.Dialog$2,{onSearch:m,resourceName:e,emptyContent:o,status:h,actions:R,...v,children:E})]})}),ja=({haulType:e="",placeholder:t,icon:n,disabled:s,iconOnly:o=!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=>xr(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 r.jsxRuntimeExports.jsxs(ea.Trigger,{variant:"outlined",gap:"small",className:u.CSS(u.CSS.dropRegion(h(E))),disabled:s,...g,...l,hideCaret:i||o,textColor:p==null?8:void 0,children:[m??n,!o&&(p??t)]})},ch=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);if(n==null)return null;const{name:s,icon:o}=n;return r.jsxRuntimeExports.jsxs(f.ListItem,{...e,children:[o,s]})}),An=({data:e,filter:t,children:n=ch,virtual:s=!1,...o})=>{const{retrieve:i,...l}=f.useStaticData({data:e,filter:t}),{search:a}=nt.usePager({retrieve:i});return r.jsxRuntimeExports.jsx(Dt,{...o,...l,onSearch:a,virtual:s,children:n})},ln=e=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:M.LEVELS,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h2",square:!0,children:"XL"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h3",square:!0,children:"L"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h4",square:!0,children:"M"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"h5",square:!0,children:"S"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"small",square:!0,children:"XS"})]}),uh=[250,400,500,600],Ea=e=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:uh,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:250,children:"Light"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:400,children:"Normal"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:500,children:"Medium"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:600,children:"Bold"})]}),dh=Object.freeze(Object.defineProperty({__proto__:null,Level:ln,Weight:Ea},Symbol.toStringTag,{value:"Module"})),xh=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:As,MultipleTrigger:ga,Single:Dt,SingleTrigger:ja,Static:An,Text:dh,staticCanDrop:xr,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"})),ph=f.useVirtualCursorDragWebKit,Is=()=>{const e=j.useRef([]),t=j.useMemo(()=>({cleanup:()=>{e.current.forEach(n=>n()),e.current=[]},set:n=>{n!=null&&e.current.push(...M.t.toArray(n))}}),[]);return j.useEffect(()=>t.cleanup,[t.cleanup]),t},mh=()=>r.jsxRuntimeExports.jsx(f.Caret.Right,{className:u.CSS.BE("breadcrumb","separator")}),Cn=({children:e,...t})=>r.jsxRuntimeExports.jsx(f.Text,{className:u.CSS.BE("breadcrumb","segment"),...t,defaultEl:"span",children:e}),pr=({children:e,highlightVariant:t,...n})=>r.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,o)=>s==null||typeof s=="boolean"?null:r.jsxRuntimeExports.jsxs(j.Fragment,{children:[o>0&&r.jsxRuntimeExports.jsx(mh,{}),typeof s=="string"?r.jsxRuntimeExports.jsx(Cn,{children:s}):s]},o))}),fh=(e,t)=>{const n=e.split("/");return n.map((s,o)=>t({href:n.slice(0,o+1).join("/"),segment:s,index:o}))},hh=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:pr,Segment:Cn,mapURLSegments:fh},Symbol.toStringTag,{value:"Module"})),gh=({channelKey:e,rangeKey:t,shadow:n,className:s,...o})=>{const{value:i,onChange:l}=o,[a,c]=j.useState(!1),{update:d}=uc.useDirect({params:{rangeKey:t,channelKey:e}}),{data:x}=Lr.useDirect({params:{key:e,rangeKey:t}}),p=async C=>{d(C)},m=x?.alias,h=x?.alias??x?.name;let g=r.jsxRuntimeExports.jsx(f.Rename,{});a?g=r.jsxRuntimeExports.jsx(f.Loading,{}):m===i&&(g=r.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?r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a channel to enable alias syncing with this label"}):p==null?r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Select a range to enable alias syncing with this label"}):i.length===0?r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Enter a value to enable alias syncing with this label"}):m===i?r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Alias synced with this label"}):r.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Sync alias for ",h," with this label"]});return r.jsxRuntimeExports.jsxs(f.Text$2,{selectOnFocus:!0,...o,children:[E&&r.jsxRuntimeExports.jsx(f.Button,{onClick:v,tooltip:r.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:["Set ",h," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:r.jsxRuntimeExports.jsx(f.Sync,{})}),r.jsxRuntimeExports.jsx(f.Button,{onClick:R,disabled:!E,tooltip:y,tooltipLocation:{y:"top"},variant:"outlined",children:g})]})},kt="channel";var _i=180/Math.PI,No={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ya(e,t,n,s,o,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:o,translateY:i,rotate:Math.atan2(t,e)*_i,skewX:Math.atan(c)*_i,scaleX:l,scaleY:a}}var Wn;function jh(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?No:ya(t.a,t.b,t.c,t.d,t.e,t.f)}function Eh(e){return e==null||(Wn||(Wn=document.createElementNS("http://www.w3.org/2000/svg","g")),Wn.setAttribute("transform",e),!(e=Wn.transform.baseVal.consolidate()))?No:(e=e.matrix,ya(e.a,e.b,e.c,e.d,e.e,e.f))}function Sa(e,t,n,s){function o(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:O.interpolateNumber(d,p)},{i:E-2,x:O.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(o(p)+"rotate(",null,s)-2,x:O.interpolateNumber(d,x)})):x&&p.push(o(p)+"rotate("+x+s)}function a(d,x,p,m){d!==x?m.push({i:p.push(o(p)+"skewX(",null,s)-2,x:O.interpolateNumber(d,x)}):x&&p.push(o(p)+"skewX("+x+s)}function c(d,x,p,m,h,g){if(d!==p||x!==m){var E=h.push(o(h)+"scale(",null,",",null,")");g.push({i:E-4,x:O.interpolateNumber(d,p)},{i:E-2,x:O.interpolateNumber(x,m)})}else(p!==1||m!==1)&&h.push(o(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 yh=Sa(jh,"px, ","px)","deg)"),Sh=Sa(Eh,", ",")",")"),Rh=1e-12;function Mi(e){return((e=Math.exp(e))+1/e)/2}function Ch(e){return((e=Math.exp(e))-1/e)/2}function bh(e){return((e=Math.exp(2*e))-1)/(e+1)}const ls=function e(t,n,s){function o(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<Rh)R=Math.log(m/d)/t,S=function(N){return[a+N*h,c+N*g,d*Math.exp(t*N*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),k=Math.log(Math.sqrt(y*y+1)-y),T=Math.log(Math.sqrt(C*C+1)-C);R=(T-k)/t,S=function(N){var I=N*R,B=Mi(k),F=d/(n*v)*(B*bh(t*I+k)-Ch(k));return[a+F*h,c+F*g,d*B/Mi(t*I+k)]}}return S.duration=R*1e3*t/Math.SQRT2,S}return o.rho=function(i){var l=Math.max(.001,+i),a=l*l,c=a*a;return e(l,a,c)},o}(Math.SQRT2,2,4),wh=Object.freeze(Object.defineProperty({__proto__:null,Base:O.Base,Bottom:O.Bottom,Right:O.Right,Top:O.Top,axisStateZ:O.axisStateZ,newCanvas:O.newCanvas,newTickFactory:O.newTickFactory,tickFactoryProps:O.tickFactoryProps,tickType:O.tickType},Symbol.toStringTag,{value:"Module"})),vh=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:O.AcquireChannelControl,AuthoritySource:O.AuthoritySource,Chip:O.Chip,Controller:O.Controller,Indicator:O.Indicator,Legend:O.Legend,REGISTRY:O.REGISTRY$15,STATUSES:O.STATUSES,SetChannelValue:O.SetChannelValue,StateProvider:O.StateProvider,acquireChannelControl:O.acquireChannelControl,acquireChannelControlPropsZ:O.acquireChannelControlPropsZ,authoritySource:O.authoritySource,authoritySourceDetailsZ:O.authoritySourceDetailsZ,authoritySourceProps:O.authoritySourceProps,chipStateZ:O.chipStateZ,chipStatusDetailsZ:O.chipStatusDetailsZ,controllerStateZ:O.controllerStateZ,indicatorStateZ:O.indicatorStateZ,indicatorStatusDetailsZ:O.indicatorStatusDetailsZ,legendStateZ:O.legendStateZ,setChannelValue:O.setChannelValue,setChannelValuePropsZ:O.setChannelValuePropsZ,stateProviderStateZ:O.stateProviderStateZ,statusZ:O.statusZ,sugaredStateZ:O.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),kh={region:u.Ho.ZERO,dpr:1,os:u.S.getOS()},_h={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Mh=({children:e,resizeDebounce:t=100,className:n,...s})=>{const[{path:o},{bootstrapped:i,dpr:l},a]=f.use$2({type:O.Canvas.TYPE,schema:O.canvasStateZ,initialState:kh}),c=j.useRef({..._h}),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(),k=v.transferControlToOffscreen(),T=R.transferControlToOffscreen();a({glCanvas:C,upper2dCanvas:k,lower2dCanvas:T,bootstrap:!0,bootstrapped:!1,region:u.Ho.construct(S),dpr:window.devicePixelRatio,os:u.S.getOS({default:"Windows"})},[C,k,T])},[a]);return r.jsxRuntimeExports.jsxs("div",{ref:h,className:u.CSS(u.CSS.B("canvas-container"),n),...s,children:[r.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","lower2d"))}),r.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","gl"))}),r.jsxRuntimeExports.jsx("canvas",{ref:g,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","upper2d"))}),r.jsxRuntimeExports.jsx(f.Composite,{path:o,children:i&&e})]})},On=(e,t)=>f.useResize(j.useCallback((n,s)=>{const o=document.querySelector(".pluto-canvas--lower2d");o!=null&&e(u.C.XY.translate(u.K.scale(u.Ho.topLeft(o),-1)).box(n),s)},[e]),t),Th=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Mh,useRegion:On},Symbol.toStringTag,{value:"Module"})),Ra=j.createContext(null),ct=e=>{const t=j.use(Ra);if(t==null)throw new Error(`Cannot use ${e} as a non-child of LinePlot.`);return t},Ca=e=>{const{addViewportHandler:t}=ct("Viewport");j.useEffect(()=>t(e),[t,e])},In=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=ct(t),{key:o}=e;return f.useEffectCompare(()=>{u.K$1.outer.parse(e.loc),n(e)},([a],[c])=>M.T.equal(a,c),[e]),j.useEffect(()=>()=>s(o),[]),{gridArea:u.p.swap(u.K$1.direction(e.loc))==="x"?`axis-start-${o} / plot-start / axis-end-${o} / plot-end`:`plot-start / axis-start-${o} / plot-end / axis-end-${o}`}},ba=({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=u.K.ZERO,children:o,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:O.LinePlot.TYPE,schema:O.linePlotStateZ,initialState:{container:u.Ho.ZERO,viewport:u.Ho.DECIMAL,grid:{},...p}}),E=j.useCallback(D=>{a&&g(z=>({...z,container:D}))},[g,a]),S=On(E,{debounce:n});j.useEffect(()=>g(D=>({...D,...p})),[p]);const R=j.useRef(new Map),v=j.useCallback(D=>(R.current.set(D,null),()=>R.current.delete(D)),[R]),y=j.useCallback(D=>{const{mode:z,box:b,stage:P}=D;(z==="pan"&&P!=="start"||z==="zoom"||z==="zoomReset"&&P==="start")&&g(_=>({..._,viewport:b})),R.current.forEach((_,L)=>L(D))},[g]),C=j.useCallback(D=>{g(z=>({...z,grid:{...z.grid,[D.key]:D}}))},[g]),k=j.useCallback(D=>g(z=>{const{[D]:b,...P}=z.grid;return{...z,grid:P}}),[g]),T=j.useCallback(D=>{x(z=>[...z.filter(({key:b})=>b!==D.key),D])},[x]),N=j.useCallback(D=>x(z=>z.filter(({key:b})=>b!==D)),[T]),I=j.useMemo(()=>Lh(h),[h]),B=j.useCallback(D=>{g(z=>({...z,hold:D})),l?.(D)},[g,l]),F=`line-plot-${e}`,$=j.useMemo(()=>({lines:d,setGridEntry:C,removeGridEntry:k,setLine:T,removeLine:N,setViewport:y,addViewportHandler:v,setHold:B,id:F}),[F,d,C,k,T,N,y,v,B]);return r.jsxRuntimeExports.jsx("div",{id:F,className:u.CSS.B("line-plot"),style:{...t,...I},ref:S,...c,children:r.jsxRuntimeExports.jsx(Ra,{value:$,children:r.jsxRuntimeExports.jsx(f.Composite,{path:m,children:o})})})},Lh=e=>{const t=u.CSS.newGridBuilder();return O.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)"),O.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),O.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)"),O.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},mr=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?O.XAxis.TYPE:O.YAxis.TYPE,s=`${e}-axis`,o=({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:k,onAutoBoundsChange:T,style:N,...I})=>{const B=(c?.length??0)>0,F=f.useUniqueKey(i),$=f.useMemoDeepEqual({location:a,showGrid:g,type:E,bounds:S,axisKey:C,label:c,labelDirection:x,tickSpacing:v,autoBounds:y,autoBoundUpdateInterval:k}),[{path:D},{size:z,labelSize:b,...P},_]=f.use$2({aetherKey:F,type:n,schema:O.coreAxisStateZ,initialState:$});j.useEffect(()=>_(K=>({...K,...$})),[$]),j.useEffect(()=>{const{lower:K,upper:Z}=O.parseAutoBounds(P.autoBounds);P.bounds!=null&&(K&&S?.lower!==P.bounds.lower||Z&&S?.upper!==P.bounds.upper)&&T?.(P.bounds)},[P.autoBounds,P.bounds]);const L=In({loc:a,key:`${n}-${F}`,size:z+b,order:1},`${e.toUpperCase()}Axis`),V=Ns.useTypography(d).toString(),H=j.useRef(0);return j.useEffect(()=>{if(e==="y"){if(c==null)return;let Z=M.dimensions(c,V)[u.p.dimension(u.p.construct(x))];Z>0&&(Z+=9),_(G=>({...G,labelSize:Z}))}else{let Z=M.dimensions(c,V).height*1.3;Z>0&&(Z+=12);const G=H.current;O.withinSizeThreshold(G,Z)||(H.current=Z,_(Q=>({...Q,labelSize:Z})))}},[c,x,V]),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(R,u.CSS.B("axis"),u.CSS.B(s),u.CSS.loc(a)),style:{...N,...L},align:"center",justify:a!=="left"?"end":"start",direction:u.p.swap(e),...I,children:B&&r.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS(u.CSS.BE("axis","label"),u.CSS.dir(x)),value:c,onChange:p,level:d})}),r.jsxRuntimeExports.jsx(f.Composite,{path:D,children:l})]})};return o.displayName=`${e.toUpperCase()}Axis`,o},wa=mr("x"),va=mr("y"),Ph=u.K.xy.extend({root:u.K$1.corner,units:ne.z.object({x:ne.z.enum(["px","decimal"]),y:ne.z.enum(["px","decimal"])})}),Nh=Ph.partial({root:!0,units:!0}),Ah=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},Oh=(e,t)=>{const n={x:e.x,y:e.y};if(t.current==null)return n;const s=u.Ho.construct(t.current),o=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(o):n.x/=u.Ho.width(o),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(o):n.y/=u.Ho.height(o),n},Ih=(e,t)=>{if(t.current==null)return null;const n=u.Ho.construct(t.current.parentElement),s=u.Ho.construct(t.current),o={x:e.x,y:e.y,root:{...u.K$1.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(o.x=(1-e.x)*u.Ho.width(n)-u.Ho.width(s),o.root.x="right"):e.x<.2?o.x=e.x*u.Ho.width(n):o.units.x="decimal",e.y>.8?(o.y=(1-e.y)*u.Ho.height(n)-u.Ho.height(s),o.root.y="bottom"):e.y<.2?o.y=e.y*u.Ho.height(n):o.units.y="decimal",o.x=Math.round(o.x*100)/100,{...o,...u.K.truncate(o,3)}},Ti=u.Ho.reRoot(u.Ho.DECIMAL,u.K$1.TOP_LEFT),Dh={x:.1,y:.1,root:u.K$1.TOP_LEFT,units:{x:"decimal",y:"decimal"}},Ds=j.memo(({className:e,value:t,onChange:n,style:s,draggable:o=!0,initial:i=Dh,...l})=>{const[a,c]=M.usePurePassthrough({value:t,onChange:n,initial:i}),d=j.useRef(a),x=f.useSyncedRef(o===!1),p=j.useRef(null);a!==null&&(s={...s,...Ah(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(Ti),R=S.box(u.Ho.construct(p.current)),v=u.C.XY.clamp(u.Ho.construct(u.Ho.topLeft(Ti),{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 Ih(C,p)},[]),h=_e.useCursorDrag({onStart:j.useCallback(()=>{d.current=Oh(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 r.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(e,u.CSS.B("legend")),bordered:!0,style:s,onDragStart:h,draggable:o,borderColor:5,ref:p,onDrag:f.preventDefault,onDragEnd:f.preventDefault,background:1,rounded:1,...l})});Ds.displayName="Legend.Container";const Dn=j.memo(({data:e,allowVisibleChange:t=!0,background:n=1,entryProps:s,...o})=>r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:e.sort((i,l)=>i.label.localeCompare(l.label)).map(({key:i,visible:l=!0,...a})=>r.jsxRuntimeExports.jsx(Bh,{entry:{key:i,visible:l,...a},allowVisibleChange:t,background:n,...s,...o},i))}));Dn.displayName="Legend.Entries";const Bh=({allowVisibleChange:e=!0,entry:t,onEntryChange:n,colorPickerVisible:s,onColorPickerVisibleChange:o,className:i,background:l,...a})=>{const{color:c,key:d,label:x,visible:p}=t;return r.jsxRuntimeExports.jsxs(f.Box,{align:"center",className:u.CSS(u.CSS.B("legend-entry"),i),gap:"small",x:!0,...a,children:[r.jsxRuntimeExports.jsxs(f.Box,{align:"center",gap:"small",x:!0,children:[r.jsxRuntimeExports.jsx(_e.Swatch,{allowChange:n!=null,draggable:!1,onChange:m=>n?.({...t,color:m}),size:"tiny",value:c,onVisibleChange:o}),r.jsxRuntimeExports.jsx(f.MaybeEditable,{color:t.visible?10:7,level:"small",onChange:m=>n?.({...t,label:m}),onDoubleClick:f.stopPropagation,overflow:"nowrap",value:x})]}),e&&r.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.B("visible-toggle"),contrast:l,onClick:m=>{m.stopPropagation(),n?.({...t,visible:!p})},onDoubleClick:f.stopPropagation,size:"tiny",variant:"text",children:p?r.jsxRuntimeExports.jsx(f.Visible,{}):r.jsxRuntimeExports.jsx(f.Hidden,{})})]},d)},ka=({data:e,background:t=1,allowVisibleChange:n=!0,onEntryChange:s,position:o,onPositionChange:i,...l})=>{const[a,c]=j.useState(!1);return e.length===0?null:r.jsxRuntimeExports.jsx(Ds,{...l,draggable:!a,value:o,onChange:i,gap:"small",background:t,className:u.CSS.B("legend-grouped"),children:e.map(({key:d,name:x,data:p},m)=>r.jsxRuntimeExports.jsxs(j.Fragment,{children:[r.jsxRuntimeExports.jsx(f.Text,{level:"small",color:9,weight:500,className:u.CSS.B("legend-name"),children:x}),r.jsxRuntimeExports.jsx(f.Box,{y:!0,grow:!0,className:u.CSS.B("legend-entries"),empty:!0,children:r.jsxRuntimeExports.jsx(Dn,{data:p,onEntryChange:s,colorPickerVisible:a,onColorPickerVisibleChange:c,allowVisibleChange:n,background:t,entryProps:$h})}),m!==e.length-1&&r.jsxRuntimeExports.jsx("div",{className:u.CSS.B("legend-divider")})]},d))})},$h={justify:"between",grow:!0},fr=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,allowVisibleChange:o=!0,background:i=1,...l})=>{const[a,c]=j.useState(!1);return e.length===0?null:r.jsxRuntimeExports.jsx(Ds,{...l,draggable:!a,value:n,onChange:s,background:i,empty:!0,children:r.jsxRuntimeExports.jsx(Dn,{data:e,onEntryChange:t,colorPickerVisible:a,onColorPickerVisibleChange:c,allowVisibleChange:o,background:i,entryProps:zh})})},zh={justify:"between",grow:!0},Vh=Object.freeze(Object.defineProperty({__proto__:null,Container:Ds,Grouped:ka,Simple:fr,stickyXYz:Nh},Symbol.toStringTag,{value:"Module"})),_a=({variant:e="floating",...t})=>e==="floating"?r.jsxRuntimeExports.jsx(Ma,{...t}):r.jsxRuntimeExports.jsx(Fh,{...t}),Ma=j.memo(({onLineChange:e,...t})=>{const{lines:n}=ct("FloatingLegend"),s=Ta(n);return s.length===1?r.jsxRuntimeExports.jsx(fr,{data:s[0].data,onEntryChange:e,...t}):r.jsxRuntimeExports.jsx(ka,{data:s,onEntryChange:e,...t})});Ma.displayName="LinePlot.FloatingLegend";const Ta=e=>j.useMemo(()=>{const n={};for(const o of e){const i=n[o.legendGroup];i!=null?i.push(o):n[o.legendGroup]=[o]}const s=Object.entries(n).map(([o,i])=>({key:o,name:o,data:i}));return s.sort((o,i)=>o.name.localeCompare(i.name)),s},[e]),Fh=({onLineChange:e})=>{const{lines:t}=ct("FixedLegend"),n=Ta(t),s=f.useUniqueKey(),o=In({key:s,size:t.length>0?36:0,loc:"top",order:5},"Legend");return n.length===0?null:n.length===1?r.jsxRuntimeExports.jsx(f.Box,{align:"center",justify:"start",x:!0,style:o,children:r.jsxRuntimeExports.jsx(Dn,{data:n[0].data,onEntryChange:e,background:0})}):r.jsxRuntimeExports.jsxs(f.Box,{align:"center",justify:"start",x:!0,style:o,gap:"huge",children:[r.jsxRuntimeExports.jsx(Li,{name:"Y1",data:n[0].data,onLineChange:e}),r.jsxRuntimeExports.jsx(Li,{name:"Y2",data:n[1].data,onLineChange:e})]})},Li=({name:e,data:t,onLineChange:n})=>r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:e}),r.jsxRuntimeExports.jsx(Dn,{data:t,onEntryChange:n,background:0})]}),hr=j.memo(({aetherKey:e,...t})=>(f.useUnidirectional({aetherKey:e,type:O.Line.TYPE,schema:O.stateZ,state:t}),null));hr.displayName="Line";const Hh=Object.freeze(Object.defineProperty({__proto__:null,Line:hr},Symbol.toStringTag,{value:"Module"})),gr=({aetherKey:e,color:t,label:n="",legendGroup:s,visible:o=!0,...i})=>{const l=f.useUniqueKey(e),{setLine:a,removeLine:c}=ct("Line");return j.useEffect(()=>(a({key:l,color:t,label:n,visible:o,legendGroup:s}),()=>c(l)),[n,t,o,s]),r.jsxRuntimeExports.jsx(hr,{aetherKey:l,color:t,label:n,visible:o,...i})},La=({level:e="h2",...t})=>{const n=f.useUniqueKey(),s=Ns.useTypography(e),o=In({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return r.jsxRuntimeExports.jsx(f.Box,{justify:"center",align:"center",style:o,children:r.jsxRuntimeExports.jsx(f.MaybeEditable,{...t,level:e})})},Pa=({aetherKey:e,...t})=>{const n=f.useUniqueKey(e),[,,s]=f.use$2({aetherKey:n,type:O.Tooltip.TYPE,schema:O.tooltipStateZ,initialState:{position:null,...t}}),o=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(o.current===null)return;const a=o.current.parentElement;if(a!=null)return a.addEventListener("mousemove",i),a.addEventListener("mouseleave",l),()=>{a.removeEventListener("mousemove",i),a.removeEventListener("mouseleave",l)}},[i]),r.jsxRuntimeExports.jsx("span",{ref:o})},Zh=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:Pa},Symbol.toStringTag,{value:"Module"})),Na=()=>{const e=j.useRef(new Map),t=j.useCallback(s=>{const{request:o,response:i}=s,l=e.current.get(o);l!=null&&(l(i.bounds),e.current.delete(o))},[]),[,,n]=f.use$2({type:O.BoundQuerier.TYPE,schema:O.boundQuerierStateZ,onAetherChange:t,initialState:{request:"",response:{request:"",bounds:{}}}});return j.useCallback(async()=>await new Promise(s=>{const o=u.Gt.create();e.current.set(o,s),n(i=>({...i,request:o}))}),[])},Kh=({ref:e})=>(e.current=Na(),null),Yh={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer",cancel:"default"},Aa=({className:e,mode:t,maskBox:n,children:s,style:o,...i})=>r.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.noSelect,u.CSS.BE("viewport-mask","container"),e),style:{cursor:Yh[t],...o},...i,children:[r.jsxRuntimeExports.jsx("div",{style:{...u.Ho.css(n),display:u.Ho.areaIsZero(n)?"none":"block"},className:u.CSS.BE("viewport-mask","selection")}),s]}),Gh=(e,t)=>{for(;e!=null&&!t(e);)e=e.parentElement;return e},Uh=11,Wh=6,Xh=2,Pi=5,qh=e=>u.Ho.width(e)<Pi&&u.Ho.height(e)<Pi,hn=e=>{const t=u.Ho.width(e),n=u.Ho.height(e);return Math.min(t,n)<.001?Uh:Wh},Qh=["zoom","pan","select","zoomReset","cancel"],jr=[...Qh,"click"],Jh=ne.z.enum(jr),Oa=["zoom","select"],gn={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"],["MouseMiddle"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},Ia={defaultMode:"pan",pan:[["MouseLeft"],["MouseMiddle"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]],cancel:[["Escape"]]},Da={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"],["MouseMiddle"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]],cancel:[["Escape"]]},Er={zoom:gn,pan:Ia,select:Da,zoomReset:gn,click:gn,cancel:gn},eg=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(o=>o.filter(i=>i!=="MouseLeft")).filter(o=>o.length>0)]))},tg=u.Ho.construct(0,0,1,1,u.K$1.TOP_LEFT),ng={width:30,height:50},Ba=({onChange:e,triggers:t,initial:n=tg,threshold:s=ng,ref:o})=>{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,hn(n))),[n]),j.useEffect(()=>d(i),[i]);const[E,S,R,v]=f.useMemoCompare(()=>{const I={...Er[i],...t},B=f.flattenConfig(I),F=eg(I);return[I,B,F,f.flattenConfig(F)]},f.compareModeConfigs,[t]),y=j.useCallback(({box:I,triggers:B,stage:F,cursor:$})=>{if(h.current==null)return;const D=f.determineMode(E,B),z=u.Ho.construct(h.current);if(D==null)return;if(D==="cancel"){a(u.Ho.ZERO),e?.({box:x.current,mode:D,stage:F,cursor:$});return}if(D==="zoomReset")return a(u.Ho.ZERO),e?.({box:u.Ho.DECIMAL,mode:D,stage:F,cursor:$}),p(u.Ho.DECIMAL);const b=qh(I);if(F==="end"){if(b){D==="zoom"&&a(u.Ho.ZERO),e?.({box:x.current,mode:"click",stage:F,cursor:$});return}return p(_=>{if(D==="pan"){const V=Ni(I,_,z);return V===null||u.Ho.equals(V,_)?_:(e?.({box:V,mode:D,stage:F,cursor:$}),V)}const L=C(I,_,z);return L===null?_:(e?.({box:L,mode:D,stage:F,cursor:$}),D==="zoom"?(a(u.Ho.ZERO),L):u.Ho.truncate(_,hn(_)))})}if(Oa.includes(D))return b?void 0:a(u.C.XY.scale(z).clamp(z).translate({x:-u.Ho.left(z),y:-u.Ho.top(z)}).box(Ai(g,I,z)));if(a(_=>u.Ho.areaIsZero(_)?_:u.Ho.ZERO),u.K.distance($,m.current)<Xh)return;m.current=$;const P=Ni(I,x.current,z);e?.({box:P,mode:D,stage:F,cursor:$})},[a,d,e,E,s.height,s.width,p,h,hn]);j.useImperativeHandle(o,()=>({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,F)=>{const $=Ao(B,F).box(Ai(g,I,F));return u.Ho.truncate($,hn($))},[s]),k=f.useHeldRef({triggers:[["Control"]]}),T=f.useHeldRef({triggers:[["Alt"]]});j.useEffect(()=>{const I=B=>{if(h.current==null)return;let F=1;B.deltaY<0?F-=.035:F+=.035;const $=u.Ho.construct(h.current),D=u.K.construct(B);if(Array.from(h.current.children).push(h.current),!u.Ho.contains($,D)||h.current!==B.target&&Gh(B.target,V=>V===h.current)==null)return;const P=Ao(x.current,u.Ho.construct(h.current)).pos(u.K.construct(B));let L=u.C.XY.magnify({x:k.current.held?1:F,y:T.current.held?1:F}).box(x.current);L=u.Ho.translate(L,{x:k.current.held?0:P.x*(1-F),y:T.current.held?0:P.y*(1-F)}),p(L),e?.({stage:"end",box:L,cursor:u.K.construct(B),mode:"zoom"})};return window.addEventListener("wheel",I),()=>window.removeEventListener("wheel",I)},[p,e]),Jl.useDrag({bound:h,onDrag:y,triggers:S,loose:!0});const N=j.useCallback(({triggers:I,stage:B})=>{if(B==="end")return d(i);const F=f.determineMode(R,I);F!=null&&d(F)},[R,i,e]);return f.use$1({triggers:v,callback:N,region:h}),{maskBox:l,ref:h,mode:c}},Ao=(e,t)=>u.C.XY.scale(t).clamp(t).scale(e),Ni=(e,t,n)=>{let s=u.Ho.signedDims(Ao(t,n).box(e));s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight};const o=u.C.XY.translate(u.K.construct(s)).box(t);return u.Ho.truncate(o,hn(o))},Ai=(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})=>r.jsxRuntimeExports.jsxs(f.Text,{level:"small",children:[u.U.capitalize(e),r.jsxRuntimeExports.jsx(f.Text$1,{trigger:t[0],el:"span"})]}),sg=({triggers:e,value:t,onChange:n,disable:s=["zoomReset","click","cancel"],tooltipDelay:o,tooltipLocation:i,hideTooltip:l,...a})=>{const c=j.useMemo(()=>jr.filter(x=>!s.includes(x)),[s]),d={tooltipDelay:o,tooltipLocation:i,hideTooltip:l,size:"small"};return r.jsxRuntimeExports.jsxs(pe.Buttons,{...a,keys:c,value:t,onChange:n,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"zoom",tooltip:r.jsxRuntimeExports.jsx(Wt,{mode:"zoom",triggers:e.zoom}),...d,children:r.jsxRuntimeExports.jsx(f.Zoom,{})}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pan",tooltip:r.jsxRuntimeExports.jsx(Wt,{mode:"pan",triggers:e.pan}),...d,children:r.jsxRuntimeExports.jsx(f.Pan,{})}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"select",tooltip:r.jsxRuntimeExports.jsx(Wt,{mode:"select",triggers:e.select}),...d,children:r.jsxRuntimeExports.jsx(f.Selection,{})})]})},og=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Er,MASK_MODES:Oa,MODES:jr,Mask:Aa,PAN_DEFAULT_TRIGGERS:Ia,SELECT_DEFAULT_TRIGGERS:Da,SelectMode:sg,TooltipText:Wt,ZOOM_DEFAULT_TRIGGERS:gn,modeZ:Jh,use:Ba},Symbol.toStringTag,{value:"Module"})),rg=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,$a=({ref:e,children:t,initial:n=u.Ho.DECIMAL,onChange:s,...o})=>{const{setViewport:i}=ct("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,...o});return r.jsxRuntimeExports.jsx(Aa,{className:u.CSS.BE("line-plot","viewport"),...a,children:t})},ig=Object.freeze(Object.defineProperty({__proto__:null,BoundsQuerier:Kh,Legend:_a,Line:gr,LinePlot:ba,Title:La,Tooltip:Zh,Viewport:$a,XAxis:wa,YAxis:va,axisFactory:mr,selectViewportEl:rg,useBoundQuerier:Na,useContext:ct,useGridEntry:In,useViewport:Ca},Symbol.toStringTag,{value:"Module"})),lg=({aetherKey:e,...t})=>(f.use$2({aetherKey:e,type:O.Annotation.TYPE,schema:O.annotationStateZ,initialState:t}),null),za=({aetherKey:e,menu:t,...n})=>{const s=f.useUniqueKey(e),{setViewport:o,setHold:i}=ct("Range.Provider"),[,{hovered:l,count:a},c]=f.use$2({aetherKey:s,type:O.Provider.TYPE,schema:O.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 r.jsxRuntimeExports.jsx(f.ContextMenu,{...x,menu:()=>t==null||l==null?null:t(l),children:r.jsxRuntimeExports.jsx(f.Box,{style:{...d,cursor:l!=null?"pointer":"default",width:"100%",height:"100%"},onContextMenu:x.open,className:x.className,onClick:()=>{l!=null&&(o({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})})},ag=Object.freeze(Object.defineProperty({__proto__:null,Annotation:lg,Provider:za},Symbol.toStringTag,{value:"Module"})),Va={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},cg=f.flattenConfig(Va),Fa=({aetherKey:e})=>{const t=f.useUniqueKey(e),[,,n]=f.use$2({aetherKey:t,type:O.Measure.TYPE,schema:O.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=j.useRef(null),o=f.useHeldRef({triggers:cg,loose:!0}),i=j.useCallback(({mode:c,cursor:d})=>{if(c==="click"){const x=f.determineMode(Va,o.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,o]);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]),r.jsxRuntimeExports.jsx("span",{ref:s})},ug=Object.freeze(Object.defineProperty({__proto__:null,Measure:Fa},Symbol.toStringTag,{value:"Module"})),yr=({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:o,onUnitsChange:i,units:l="",color:a,lineWidth:c,lineDash:d,className:x,onSelect:p,style:m,...h})=>{const[g,E]=M.usePurePassthrough({value:t,onChange:s,initial:""}),S=f.useSyncedRef(o),[,{pixelPosition:R},v]=f.use$2({aetherKey:e,type:O.Rule.TYPE,schema:O.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}=ct("Rule"),T=document.getElementById(C)?.querySelector(".pluto-line-plot__viewport"),N=j.useRef(R);j.useEffect(()=>{v(D=>({...D,position:n,color:a,lineWidth:c,lineDash:d}))},[n,a,c,d]);const I=_e.useCursorDrag({onStart:j.useCallback(()=>{p?.(),v(D=>({...D,dragging:!0})),N.current=y.current},[]),onMove:D=>{v(z=>({...z,pixelPosition:(N.current??0)+u.Ho.signedHeight(D)}))},onEnd:j.useCallback(()=>{v(D=>({...D,dragging:!1})),N.current=R},[])}),B=j.useRef(null);if(n==null||R==null)return null;const F=u.fr.pickByContrast(a,u.fr.BLACK,u.fr.WHITE),$=r.jsxRuntimeExports.jsxs("div",{ref:B,className:u.CSS.B("rule"),style:{top:`calc(${R}px - 0.5rem)`},children:[r.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("rule","drag-handle"),onDragStart:I,draggable:!0}),r.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.fr.cssString(a),backgroundColor:u.fr.hex(u.fr.setAlpha(a,.7)),...m},...h,children:[r.jsxRuntimeExports.jsx(f.Editable,{className:u.CSS.BE("rule","label"),level:"small",value:g,onChange:E,color:F}),r.jsxRuntimeExports.jsx(f.Divider$1,{y:!0,style:{borderColor:u.fr.cssString(a)}}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",className:u.CSS.BE("rule","value"),children:[r.jsxRuntimeExports.jsx(f.Editable,{value:n.toFixed(2),onChange:D=>{const z=Number(D);isFinite(z)&&o?.(z)},level:"small",color:F}),l.length>0&&r.jsxRuntimeExports.jsx(f.MaybeEditable,{level:"small",color:F,value:l,onChange:i})]})]})]});return T==null?$:Ql.createPortal($,T)},dg=Object.freeze(Object.defineProperty({__proto__:null,Rule:yr},Symbol.toStringTag,{value:"Module"})),Ha=f.canDropOfType(kt),xg=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:o,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:k,children:T,...N})=>{const I=t.filter(({location:z})=>u.K$1.isY(z)),B=j.useRef(null),F=f.usePrevious(e.length),$=f.usePrevious(N.hold),D=F===0&&e.length!==0||$===!0&&N.hold===!1;return j.useEffect(()=>{D&&B.current?.reset()},[D]),r.jsxRuntimeExports.jsxs(ba,{...N,children:[I.map((z,b)=>{const P=e.filter(V=>V.axes.x===z.key),_=t.filter(({location:V})=>u.K$1.isX(V)),L=h?.filter(V=>[..._.map(({key:H})=>H),z.key].includes(V.axis));return r.jsxRuntimeExports.jsx(pg,{axis:z,index:b,lines:P,yAxes:_,rules:L,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:C,onRuleChange:x,onSelectRule:k},z.key)}),i&&r.jsxRuntimeExports.jsx(_a,{onLineChange:d,position:l,onPositionChange:a,variant:R}),n&&r.jsxRuntimeExports.jsx(La,{value:s,onChange:o,level:c}),r.jsxRuntimeExports.jsxs($a,{initial:S,onChange:v,triggers:y,ref:B,children:[g&&r.jsxRuntimeExports.jsx(Pa,{}),E&&r.jsxRuntimeExports.jsx(Fa,{}),T]})]})},pg=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:o,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:Ha,onDrop:j.useCallback(({items:S})=>{const R=f.filterByType(kt,S);return l?.(d,R.map(({key:v})=>v)),R},[d,l])}),g=s?.filter(S=>S.axis===d),E=f.useDraggingState();return r.jsxRuntimeExports.jsxs(wa,{...p,...h,location:c,axisKey:d,showGrid:x??n===0,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(kt)(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 r.jsxRuntimeExports.jsx(fg,{axis:{...S,showGrid:x??(n===0&&R===0)},lines:v,rules:y,onRuleChange:o,onAxisChannelDrop:l,onAxisChange:a,onSelectRule:i},S.key)}),g?.map(S=>j.createElement(yr,{aetherKey:S.key,...S,key:S.key,onLabelChange:R=>o?.({key:S.key,label:R}),onPositionChange:R=>o?.({key:S.key,position:R}),onUnitsChange:R=>o?.({key:S.key,units:R}),onSelect:()=>i?.(S.key)})),r.jsxRuntimeExports.jsx(za,{...m})]})},mg=({channels:{x:e,y:t}})=>`${e??0}-${t}`,fg=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:o,axis:{key:i,location:l,...a},onSelectRule:c})=>{const d=f.useDrop({type:"Channel.LinePlot.YAxis",canDrop:Ha,onDrop:j.useCallback(({items:p})=>{const m=f.filterByType(kt,p);return s?.(i,m.map(({key:h})=>h)),m},[i,s])}),x=f.useDraggingState();return r.jsxRuntimeExports.jsxs(va,{...a,...d,location:l,axisKey:i,className:u.CSS(u.CSS.dropRegion(f.canDropOfType(kt)(x))),onAutoBoundsChange:p=>o?.({key:i,bounds:p}),onLabelChange:p=>o?.({key:i,label:p}),children:[e.map(p=>r.jsxRuntimeExports.jsx(hg,{line:p},mg(p))),t?.map(p=>j.createElement(yr,{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)}))]})},hg=({line:e})=>e.variant==="static"?r.jsxRuntimeExports.jsx(jg,{line:e}):r.jsxRuntimeExports.jsx(gg,{line:e}),gg=({line:{key:e,timeSpan:t,channels:{x:n,y:s},axes:o,...i}})=>{const{xTelem:l,yTelem:a}=j.useMemo(()=>{const c=Number(t.valueOf())*3,d=O.streamChannelData({timeSpan:t,channel:s,keepFor:c}),x=n!=null&&n!==0;return{xTelem:O.streamChannelData({timeSpan:t,channel:x?n:s,useIndexOfChannel:!x,keepFor:c}),yTelem:d}},[t.valueOf(),n,s]);return r.jsxRuntimeExports.jsx(gr,{aetherKey:e,y:a,x:l,legendGroup:o.y.toUpperCase(),...i},e)},jg=({line:{timeRange:e,key:t,channels:{x:n,y:s},...o}})=>{const{xTelem:i,yTelem:l}=j.useMemo(()=>{const a=O.channelData({timeRange:e,channel:s}),c=n!=null&&n!==0;return{xTelem:O.channelData({timeRange:e,channel:c?n:s,useIndexOfChannel:!c}),yTelem:a}},[e.start.valueOf(),e.end.valueOf(),n,s]);return r.jsxRuntimeExports.jsx(gr,{aetherKey:t,y:l,x:i,legendGroup:o.axes.y.toUpperCase(),...o},t)},lt=(e,t,n)=>({variant:"loading",status:u.xr.create({variant:"loading",message:`${u.U.capitalize(t)} ${e}`}),data:n}),Ze=(e,t,n)=>({variant:"success",status:u.xr.create({variant:"success",message:`${u.U.capitalize(t)} ${e}`}),data:n}),_t=(e,t,n)=>({variant:"error",status:u.xr.fromException(n,`Failed to ${t} ${e}`),data:void 0}),qt=(e,t)=>({variant:"disabled",status:u.xr.create({variant:"disabled",message:`Failed to ${t} ${e}`,description:`Cannot ${t} ${e} because no cluster is connected.`}),data:void 0}),Sr=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:()=>[]}),Et=e=>{const t=j.use(Sr);return e??t},yt=(e,t={})=>{const{optional:n=!1,onChange:s,defaultValue:o}=t,i=Et(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:o}),[e,l,n,o]));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}},Rr=(e,t)=>{const{get:n,bind:s}=Et(t?.ctx);return j.useSyncExternalStore(s,j.useCallback(()=>n(e,t),[e,n,t]))},Mt=(e,t)=>Rr(e,t)?.value??null,Eg=e=>Rr(e,{optional:!0})?.status?.variant==="success",Cr=(e,t)=>({value:()=>e.get(t).value,add:(n,s)=>{const o=u.Sr(e.get(t).value);o.splice(s,0,...M.t.toArray(n)),e.set(t,o)},push:(n,s)=>{const o=u.Sr(e.get(t).value);o.push(...M.t.toArray(n)),s!=null&&o.sort(s),e.set(t,o)},remove:n=>{const s=e.get(t).value,o=new Set(M.t.toArray(n)),i=s.filter(({key:l})=>!o.has(l));return e.set(t,i),i.map(({key:l})=>l)},keepOnly:n=>{const s=e.get(t).value,o=new Set(M.t.toArray(n)),i=s.filter(({key:l})=>o.has(l));return e.set(t,i),i.map(({key:l})=>l)},set:n=>e.set(t,M.executeSetter(n,e.get(t).value)),sort:n=>{const s=u.Sr(e.get(t).value);s.sort(n),e.set(t,s)}}),yg=(e,t)=>Cr(Et(t?.ctx),e),br=(e,t={})=>{const n=Et(t?.ctx),s=Mt(e,t);return j.useMemo(()=>({data:s.map(({key:o})=>o),...Cr(n,e)}),[s,n,e])},Sg=f.renderProp(e=>r.jsxRuntimeExports.jsx(f.Text$2,{...e})),ge=({path:e,children:t=Sg,label:n,padHelpText:s=!0,visible:o=!0,hideIfNull:i=!0,optional:l,onChange:a,className:c,defaultValue:d,...x})=>{const p=yt(e,{optional:l??i,onChange:a,defaultValue:d}),m=Et();if(p==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??=u.U.capitalize(M.T.element(e,-1)),o=typeof o=="function"?o(p,m):o,!o)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),r.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)})},Bn=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const o=({inputProps:i,path:l,fieldKey:a=t,optional:c,defaultValue:d,...x})=>r.jsxRuntimeExports.jsx(ge,{...n,...x,defaultValue:d,optional:c,path:a?`${l}.${a}`:l,children:p=>r.jsxRuntimeExports.jsx(e,{...p,...s,...i})});return o.displayName=e.displayName,o},Za=Bn(f.Numeric),Be=Za({inputProps:{}}),Ka=Bn(f.Text$2),wr=Ka({inputProps:{}}),Ya=Bn(f.Switch$1),Bs=Ya({inputProps:{}}),Rg=e=>Bn(An)(e),Cg=({children:e,...t})=>r.jsxRuntimeExports.jsx(Sr,{value:t,children:e}),bg=e=>e.code==="custom"&&e.params!=null&&"variant"in e.params?e.params.variant:"error";class wg extends O.a.Observer{schema;values;initialValues;statuses;touched;cachedRefs;constructor(t,n){super(),this.schema=n,this.values=M.T.copy(t),this.statuses=new Map,this.touched=new Set,this.cachedRefs=new Map,this.initialValues=M.T.copy(this.values)}setValue(t,n,s){t==""?this.values=M.T.copy(n):M.T.set(this.values,t,n),this.checkTouched(t,n,s),this.updateCachedRefs(t)}checkTouched(t,n,s={}){const{markTouched:o=!0}=s,i=M.T.get(this.initialValues,t,{optional:!0});M.T.equal(i,n)?(this.clearTouched(t),this.clearOrphanedTouchedPaths(t)):o&&this.setTouched(t)}clearOrphanedTouchedPaths(t){const n=new Set;this.touched.forEach(s=>{M.T.pathsMatch(s,t)&&s!==t&&!M.T.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(M.T.equal(this.values,t??this.initialValues))return;t!=null&&(this.initialValues=M.T.copy(t));const n=M.T.copy(this.initialValues);this.statuses.clear(),this.touched.clear();const s=new Set;this.cachedRefs.forEach((o,i)=>{const l=M.T.get(this.values,i,{optional:!0}),a=M.T.get(n,i,{optional:!0});M.T.equal(l,a)||s.add(i)}),s.forEach(o=>this.cachedRefs.delete(o)),this.values=n}setCurrentStateAsInitialValues(){this.initialValues=M.T.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){M.T.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(o=>{const i=[...n,...o.path],l=M.T.resolvePath(i.join("."),this.values);if(s.push({key:l,variant:bg(o),message:o.message}),o.code==="invalid_union"&&o.errors!=null&&o.errors.length>0){const a=o.errors.map(d=>d.filter(x=>M.T.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 o=new Set;if(this.statuses.forEach((a,c)=>{a.variant!=="success"&&o.add(c)}),o.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||M.T.pathsMatch(c,s)||M.T.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:o=void 0}=n,i=u.yr.getOrSetDefault(this.cachedRefs,t,{});let l=M.T.get(this.values,t,{optional:s||o!=null});if(l==null){if(o==null)return null;l=o,this.setValue(t,l)}if(i.value=l,i.required=!1,this.schema!=null){const a=Pf.getFieldSchema(this.schema,t,{optional:!0});a!=null&&(i.required=!a.safeParse(void 0).success)}return i.status=u.yr.getOrSetDefault(this.statuses,t,{key:t,variant:"success",message:""}),i.touched=this.touched.has(t),i}updateCachedRefs(t){this.cachedRefs.forEach((n,s)=>{(M.T.pathsMatch(s,t)||M.T.pathsMatch(t,s))&&this.cachedRefs.set(s,{})})}}const vr=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:o,onHasTouched:i})=>{const l=f.useInitializerRef(()=>new wg(e,n)),a=f.useSyncedRef(o),c=f.useErrorHandler(),d=f.useSyncedRef(i),x=j.useCallback(()=>{l.current.setCurrentStateAsInitialValues(),d.current?.(!1)},[]),p=j.useCallback(k=>l.current.onChange(k),[]),m=j.useCallback((k,T)=>l.current.getState(k,T),[]),h=j.useCallback(k=>{l.current.remove(k),l.current.notify()},[]),g=j.useCallback(k=>{const T=l.current.values,N=l.current.hasBeenTouched;l.current.reset(k),T!==l.current.values&&a.current?.({values:l.current.values,path:"",prev:T,valid:!0}),l.current.notify();const B=l.current.hasBeenTouched;B!==N&&d.current?.(B)},[]),E=j.useCallback(async k=>{const T=await l.current.validateAsync(!0,k);return l.current.notify(),T},[]),S=j.useCallback(k=>{const T=l.current.validate(!0,k);return l.current.notify(),T},[]),R=j.useCallback((k,T,N)=>{const{notifyOnChange:I=!0,markTouched:B=!0}=N??{},F=M.T.get(l.current.values,k,{optional:!0}),$=l.current.hasBeenTouched;l.current.setValue(k,T,{markTouched:B});const D=()=>{I&&a.current?.({values:l.current.values,path:k,prev:F,valid:!0}),l.current.notify();const z=l.current.hasBeenTouched;z!==$&&d.current?.(z)};try{l.current.validate()}catch{return c(async()=>{await l.current.validateAsync(),D()},"Failed to validate form")}D()},[]),v=j.useCallback(k=>M.T.has(l.current.values,k),[]),y=j.useCallback((k,T)=>{const N=l.current.hasBeenTouched;l.current.setStatus(k,T),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: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])},Ga=({key:e,open:t,onChange:n})=>{const s=f.useMemoPrimitiveArray(e);It(async()=>{if(t==null)return;const o=await t();if(o==null)return;const i=o.onChange(n);return async()=>{i(),await o.close()}},[t==null,s])},vg=Object.freeze(Object.defineProperty({__proto__:null,useListener:Ga},Symbol.toStringTag,{value:"Module"})),yn={...O.ZERO_CONTEXT_VALUE,state:M.ab.connectivity.DEFAULT},kg={maxRetries:4,baseInterval:M.O$1.seconds(1),scale:2},kr=j.createContext(yn),Ua=()=>j.use(kr),Bt=()=>Ua().client,_g=()=>Ua().state,Oo={connected:"success",connecting:"loading",disconnected:"disabled",failed:"error"},Wa="serverVersionMismatch",Mg=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,Tg=({children:e,client:t})=>{const{path:n}=f.useUnidirectional({type:O.Provider$1.TYPE,schema:O.Provider$1.stateZ,state:{props:null,state:null}});return r.jsxRuntimeExports.jsx(kr,{value:{...yn,client:t},children:r.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})})},Xa=({children:e,connParams:t})=>{const[n,s,o]=f.useCombinedStateAndRef(yn),{path:i}=f.useUnidirectional({type:O.Provider$1.TYPE,schema:O.Provider$1.stateZ,state:{props:t??null,state:null}}),l=f.useAdder(),a=j.useCallback(c=>{o.current.state.status!==c.status&&l({variant:Oo[c.status],message:c.message??u.U.capitalize(c.status)}),s(d=>({...d,state:c}))},[l]);return It(async c=>{if(n.client!=null&&n.client.close(),t==null)return s(yn);const d=new M.ab({retry:kg,...t,connectivityPollFrequency:M.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:Oo[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||u._r.semVerOlder(x.nodeVersion,x.clientVersion),m=Mg(p,x.clientVersion,x.nodeVersion);l({variant:"warning",message:"Incompatible cluster version",description:m,details:{type:Wa,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(a),()=>{d.close(),s(yn)}}},[t,a]),r.jsxRuntimeExports.jsx(kr,{value:n,children:r.jsxRuntimeExports.jsx(f.Composite,{path:i,children:e})})},Lg=Object.freeze(Object.defineProperty({__proto__:null,CONNECTION_STATE_VARIANTS:Oo,Provider:Xa,SERVER_VERSION_MISMATCH:Wa,TestProvider:Tg,use:Bt,useConnectionState:_g},Symbol.toStringTag,{value:"Module"})),Pg=({key:e,name:t,queryFn:n,values:s,openObservable:o,applyChanges:i,applyObservable:l,...a})=>{const c=Bt(),d=f.useErrorHandler(),x=f.useMemoPrimitiveArray(e),p=vr({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 o?.(c)},[x,c?.key]),h=j.useCallback(g=>l?.({changes:g,ctx:p}),[x,l]);return Ga({key:x,open:m,onChange:h}),p},Ng=Object.freeze(Object.defineProperty({__proto__:null,Context:Sr,Field:ge,Form:Cg,NumericField:Be,SwitchField:Bs,TextField:wr,buildNumericField:Za,buildSelectField:Rg,buildSwitchField:Ya,buildTextField:Ka,fieldBuilder:Bn,fieldListUtils:Cr,use:vr,useContext:Et,useField:yt,useFieldList:br,useFieldListUtils:yg,useFieldState:Rr,useFieldValid:Eg,useFieldValue:Mt,useSynced:Pg},Symbol.toStringTag,{value:"Module"})),Ag={markTouched:!1,notifyOnChange:!1},St=({name:e,schema:t,retrieve:n,mountListeners:s,update:o,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=Bt(),y=ze(R),C=Is(),k=vr({schema:t,values:a??i,onChange:({path:$})=>{c&&$!==""&&F()},sync:p,onHasTouched:m,mode:h}),T=j.useCallback(($,D,z)=>k.set($,D,{...z,...Ag}),[k]),N=j.useCallback(async($,D={})=>{const{signal:z}=D;try{if(v==null)return S(qt(e,"retrieve"));if(S(P=>lt(e,"retrieving",P.data)),z?.aborted)return;const b={client:v,params:$,store:y,...k,set:T};if(await n(b),z?.aborted)return;C.cleanup(),C.set(s?.(b)),S(Ze(e,"retrieved",void 0))}catch(b){if(z?.aborted)return;S(_t(e,"retrieve",b))}},[v,e,k,y,T]),I=f.useMemoDeepEqual(l);It(async $=>await N(I,{signal:$}),[N,I]);const B=j.useCallback(async($={})=>{const{signal:D}=$;try{if(v==null)return S(qt(e,"update")),!1;const z={client:v,params:l,store:y,...k,set:T};return await k.validateAsync()?(S(lt(e,"updating",void 0)),await x?.(z)===!1?(S(Ze(e,"updated",void 0)),!1):D?.aborted===!0?!1:(await o(z),S(Ze(e,"updated",void 0)),d?.(z),!0)):!1}catch(z){return D?.aborted!==!0&&S(_t(e,"update",z)),!1}},[e,l,x,d]),F=j.useCallback($=>void B($),[B]);return{form:k,save:F,...E}},qa=j.createContext(null),ze=e=>{const t=f.useRequiredContext(qa),n=f.useUniqueKey(e);return j.useMemo(()=>t.scopedStore(n),[t,n])},Qa=({children:e,...t})=>{const n=Bt(),s=f.useErrorHandler(),o=f.useAsyncErrorHandler(),{path:i}=f.useLifecycle({type:O.PROVIDER_TYPE,schema:O.providerStateZ$1,initialState:{}}),l=()=>"client"in t?t.client:new O.Client({client:n,storeConfig:t.storeConfig,handleError:s,handleAsyncError:o}),a=f.useInitializerRef(l),c=j.useRef(null);return n?.key!==c.current?.key&&(c.current=n,a.current=l()),r.jsxRuntimeExports.jsx(f.Composite,{path:i,children:r.jsxRuntimeExports.jsx(qa,{value:a.current,children:e})})},Og=()=>!0,Ig=u.i.milliseconds(100),Dg=(e,t,n,s,o,i)=>{if(e==null)return;let l=e({params:t.current??{},store:i});if(n.current!=null&&(l=l.filter(n.current)),s.current!=null&&(l=l.sort(s.current)),l.length!==0)return l.forEach(a=>o.current.set(a.key,a)),l.map(a=>a.key)},Ve=({name:e,mountListeners:t,retrieve:n,retrieveByKey:s,retrieveCached:o,sort:i})=>(l={})=>{const{filter:a=Og,sort:c,initialParams:d,retrieveDebounce:x=Ig}=l,p=f.useSyncedRef(a),m=f.useSyncedRef(c??i),h=Bt(),g=j.useRef(new Map),E=f.useInitializerRef(()=>new Map),S=ze(),R=j.useRef(d??null),[v,y,C]=f.useCombinedStateAndRef(()=>lt(e,"retrieving",Dg(o,R,p,m,g,S))),k=j.useRef(!0),T=Is(),N=j.useRef(!1),I=j.useCallback(_=>E.current.forEach((L,V)=>{L===_&&V()}),[E.current]),B=j.useCallback(_=>{if(m.current==null)return _;const L=_.map(V=>g.current.get(V)).filter(V=>V!=null);return L.sort(m.current),L.map(V=>V.key)},[m]),F=j.useCallback(()=>{h!=null&&(N.current=!0,T.cleanup(),T.set(t?.({client:h,store:S,params:R.current??{},onDelete:_=>{g.current.delete(_),y(L=>L.data==null?L:{...L,data:L.data.filter(V=>V!==_)})},onChange:(_,L,V={})=>{const{mode:H="append"}=V,K=g.current.get(_)??null;if(K!=null&&!p.current(K))return;const Z=M.executeSetter(L,K);Z==null||!p.current(Z)||(g.current.set(_,Z),y(G=>{if(G.data==null)return G;let Q;if(K==null)m.current!=null?Q=B([...G.data,_]):Q=H==="prepend"?[_,...G.data]:[...G.data,_];else if(m.current!=null){const ee=G.data.indexOf(_),ae=B(G.data),re=ae.indexOf(_);ee!==re?Q=ae:Q=G.data}else Q=G.data;return{...G,data:Q}}),I(_))}})))},[t,T]),$=j.useCallback(async(_,L={})=>{const{signal:V,mode:H="replace"}=L,K=M.executeSetter(_,R.current??{});R.current=K;try{if(h==null)return y(qt(e,"retrieve"));if(y(Q=>lt(e,"retrieving",Q.data)),H==="replace")k.current=!0;else if(H==="append"&&!k.current)return y(Q=>Ze(e,"retrieved",Q.data??[]));let Z=await n({client:h,params:K,store:S});if(V?.aborted)return;Z=Z.filter(p.current),m.current!=null&&(Z=Z.sort(m.current)),Z.length===0&&(k.current=!1);const G=Z.map(Q=>Q.key);return F(),C.current.data!=null&&u.k.primitiveArrays(C.current.data,G)===u.k.EQUAL?y(Q=>Ze(e,"retrieved",Q.data??[])):(Z.forEach(Q=>g.current.set(Q.key,Q)),y(Q=>{if(H==="replace"||Q.data==null)return Ze(e,"retrieved",G);const ee=new Set(G);return Ze(e,"retrieved",[...Q.data.filter(ae=>!ee.has(ae)),...G])}))}catch(Z){if(V?.aborted)return;y(_t(e,"retrieve",Z))}},[h,e,S,p,F]),D=j.useCallback((_,L={})=>{const{signal:V}=L;(async()=>{N.current||F();try{if(h==null||u.O$1.isZero(_))return;const H=await s({client:h,key:_,params:R.current??{},store:S});if(V?.aborted||H==null)return;if(!p.current(H)){g.current.set(_,null);return}g.current.set(_,H),I(_)}catch(H){if(V?.aborted)return;g.current.set(_,null),y(_t(e,"retrieve",H))}})()},[s,h,I,F]),z=j.useCallback(_=>{if(_==null)return;if(Array.isArray(_))return _.map(V=>z(V)).filter(V=>V!=null);const L=g.current.get(_);return L===void 0&&D(_),L},[D]),b=j.useCallback((_,L)=>L==null?()=>{}:(E.current.set(_,L),()=>E.current.delete(_)),[]);return{retrieve:_e.useDebouncedCallback((_,L={})=>void $(_,L),new u.i(x).milliseconds,[$]),retrieveAsync:$,subscribe:b,getItem:z,...v,data:v?.data??[]}},Bg=({key:e,subscribe:t,getItem:n})=>j.useSyncExternalStore(j.useCallback(s=>t(s,e),[t,e]),j.useCallback(()=>n(e),[n,e])),Ja=e=>lt(e,"retrieving",void 0),ec=e=>{const[t,n]=j.useState(Ja(e.name));return{...t,...tc({...e,onChange:n})}},tc=({retrieve:e,mountListeners:t,name:n,onChange:s,scope:o})=>{const i=Bt(),l=j.useRef(null),a=ze(o),c=Is(),d=j.useCallback(m=>s(h=>{if(h.data===void 0)return h;const g=M.executeSetter(m,h.data);return Ze(n,"retrieved",g)}),[s,n]),x=j.useCallback(async(m,h={})=>{const{signal:g}=h,E=M.executeSetter(m,l.current??{});l.current=E;try{if(i==null)return s(qt(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(Ze(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}},$g=({params:e,...t})=>{const{retrieveAsync:n,retrieve:s,...o}=ec(t),i=f.useMemoDeepEqual(e);return It(async l=>await n(i,{signal:l}),[n,i]),o},zg=({params:e,...t})=>{const n=j.useRef(Ja(t.name)),{retrieveAsync:s}=tc({...t,onChange:i=>{n.current=M.executeSetter(i,n.current),t.onChange?.(n.current)}}),o=f.useMemoDeepEqual(e);It(async i=>{o!=null&&await s(o,{signal:i})},[s,o])},Ye=e=>({useDirect:t=>$g({...e,...t}),useStateful:()=>ec(e),useEffect:t=>zg({...e,...t})}),nc=({onChange:e,params:t,update:n,name:s,scope:o,beforeUpdate:i,afterUpdate:l})=>{const a=Bt(),c=ze(o),d=j.useCallback(async(p,m={})=>{const{signal:h}=m;try{if(a==null)return e(qt(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===!1)return!1;E!==!0&&(p=E)}return await n({client:a,onChange:E=>{g=!0,e(Ze(s,"updated",E))},value:p,params:t,store:c}),h?.aborted===!0?!1:(g||e(Ze(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}},Vg=({params:e,name:t,...n})=>{const[s,o]=j.useState(Ze(t,"updated",void 0)),i=nc({...n,name:t,onChange:o,params:e});return{...s,...i}},Fe=e=>({useObservable:t=>nc({...t,...e}),useDirect:t=>Vg({...t,...e})}),Fg=Object.freeze(Object.defineProperty({__proto__:null,Client:O.Client,Provider:Qa,ScopedUnaryStore:O.ScopedUnaryStore,createForm:St,createList:Ve,createRetrieve:Ye,createStore:O.createStore,createUpdate:Fe,errorResult:_t,nullClientResult:qt,pendingResult:lt,scopeStore:O.scopeStore,successResult:Ze,useListItem:Bg,useStore:ze},Symbol.toStringTag,{value:"Module"})),sc="channels",Hg={channel:M.qb.SET_CHANNEL_NAME,schema:M.qb.keyZ,onChange:async({store:e,changed:t,client:n})=>e.channels.set(t,await n.channels.retrieve(t))},Zg={channel:M.qb.DELETE_CHANNEL_NAME,schema:M.qb.keyZ,onChange:({store:e,changed:t})=>e.channels.delete(t)},Kg={channel:M.qb.CALCULATION_STATUS_CHANNEL_NAME,schema:M.qb.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}))},Yg=e=>{const t=ze();j.useEffect(()=>t.channels.onSet(n=>{n.status!=null&&e(n.status)}),[t])},oc={equal:(e,t)=>M.T.equal(e.payload,t.payload),listeners:[Hg,Zg,Kg]},_r=M.qb.newZ.extend({name:ne.z.string().min(1,"Name must not be empty"),dataType:M.k.z.transform(e=>e.toString())}).refine(e=>!e.isIndex||M.k.z.parse(e.dataType).equals(M.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||!M.k.z.parse(e.dataType).isVariable,{message:"Persisted channels must have a fixed-size data type",path:["dataType"]}),rc=_r.extend({expression:ne.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"]}),ic=e=>({...e.payload,dataType:e.dataType.toString()}),Mr={key:0,name:"",index:0,dataType:M.k.FLOAT32.toString(),internal:!1,isIndex:!1,leaseholder:0,virtual:!1,expression:"",requires:[]},Tr=async({client:e,params:{key:t,rangeKey:n},store:s})=>{let o=s.channels.get(t);if(o==null&&(o=await e.channels.retrieve(t),s.channels.set(o.key,o)),n!=null){const i=M.oT.aliasKey({range:n,channel:o.key});let l=s.rangeAliases.get(i);if(l==null)try{l={alias:await e.ranges.retrieveAlias(n,o.key),channel:o.key,range:n}}finally{s.rangeAliases.set(i,{channel:o.key,range:n})}l!=null&&(o.alias=l.alias)}return o},Gg=async({client:e,params:{keys:t,rangeKey:n},store:s})=>{const o=s.channels.get(t),i=new Set(o?.map(a=>a.key)),l=t.filter(a=>!i.has(a));if(l.length>0){const a=await e.channels.retrieve(l);o.push(...a),s.channels.set(a)}if(n!=null){const a=t.map(p=>M.oT.aliasKey({range:n,channel:p})),c=s.rangeAliases.get(a);c.forEach(p=>{if(p==null)return;const m=o.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=o.find(R=>R.key===g);E!=null&&(E.alias=h);const S=M.oT.aliasKey({range:n,channel:g});s.rangeAliases.set(S,{alias:h,channel:g,range:n})})}}return o},lc=async({params:{key:e,rangeKey:t},store:n,client:s,reset:o})=>{if(e==null)return;const i=await Tr({client:s,store:n,params:{key:e,rangeKey:t}});o(ic(i))},Lr=Ye({name:"Channel",retrieve:Tr,mountListeners:({store:e,onChange:t,params:{key:n,rangeKey:s},client:o})=>{const i=e.channels.onSet(d=>{if(s!=null){const x=e.rangeAliases.get(M.oT.aliasKey({range:s,channel:n}));x!=null&&(d.alias=x.alias)}t(d)},n);if(s==null)return i;const l=M.oT.aliasKey({range:s,channel:n}),a=e.rangeAliases.onSet(d=>{d!=null&&t(x=>o.channels.sugar({...x,alias:d.alias}))},l),c=e.rangeAliases.onDelete(()=>t(d=>o.channels.sugar({...d,alias:void 0})),l);return[i,a,c]}}),Ug=Ye({name:"Channels",retrieve:Gg,mountListeners:({store:e,onChange:t,params:{keys:n,rangeKey:s},client:o})=>{const i=new Set(n),l=e.channels.onSet(async d=>{if(i.has(d.key)){if(s!=null){const x=M.oT.aliasKey({range:s,channel:d.key});let p=e.rangeAliases.get(x);if(p==null)try{p={alias:await o.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?o.channels.sugar({...p,alias:d.alias}):p))}),c=e.rangeAliases.onDelete(d=>{const x=M.oT.decodeDeleteAliasChange(d);t(p=>p.map(m=>m.key===x.channel?o.channels.sugar({...m,alias:void 0}):m))});return[l,a,c]}}),ac=async({client:e,store:t,set:n,value:s})=>{const o=await e.channels.create(s());t.channels.set(o.key,o),n("key",o.key)},cc=({store:e,get:t,reset:n})=>e.channels.onSet(s=>{t("key").value===s.key&&n(ic(s))}),Wg=St({name:"Channel",schema:_r,initialValues:Mr,retrieve:lc,update:ac,mountListeners:cc}),Xg=St({name:"Calculated Channel",schema:rc,initialValues:Mr,retrieve:lc,update:ac,mountListeners:cc}),qg={internal:!1},Pr=Ve({name:"Channels",retrieveCached:({params:e,store:t})=>e.searchTerm!=null&&e.searchTerm.length>0?[]:t.channels.get(n=>!(e.internal!=null&&n.internal!==e.internal||e.calculated!=null&&n.isCalculated!==e.calculated||u.O$1.isNonZero(e.notDataTypes)&&e.notDataTypes.some(s=>new M.k(s).equals(n.dataType))||u.O$1.isNonZero(e.dataTypes)&&!e.dataTypes.some(s=>new M.k(s).equals(n.dataType))||e.isIndex!=null&&n.isIndex!==e.isIndex||e.virtual!=null&&n.virtual!==e.virtual)),retrieve:async({client:e,params:t,store:n})=>{const s=await e.channels.retrieve({...qg,...t});return n.channels.set(s),s},retrieveByKey:async({client:e,key:t,store:n})=>await Tr({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))]}),Qg=Fe({name:"Channel",update:async({client:e,value:t,store:n})=>{const s=await e.channels.create(t);n.channels.set(s.key,s)}}),Jg=Fe({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,o=>o==null?o:e.channels.sugar({...o,name:t})))}}),uc=Fe({name:"Channel Alias",update:async({client:e,value:t,store:n,params:{rangeKey:s,channelKey:o}})=>{if(s==null)return;const i={alias:t,channel:o,range:s};await e.ranges.setAlias(s,o,t),n.rangeAliases.set(M.oT.aliasKey(i),i)}}),dc=e=>{if(e==null)return f.Channel;if(M.qb.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},xc=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e),s=dc(n?.payload);return r.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,children:[r.jsxRuntimeExports.jsx(s,{}),n?.name]})}),e1=({onChange:e,value:t,emptyContent:n,initialParams:s,filter:o,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=Pr({initialParams:s,filter:o}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return r.jsxRuntimeExports.jsx(As,{resourceName:"Channel",value:t,onChange:e,data:l,haulType:kt,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,icon:r.jsxRuntimeExports.jsx(f.Channel,{}),...i,children:xc})},Tt=({onChange:e,value:t,allowNone:n,emptyContent:s,initialParams:o,filter:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=Pr({initialParams:o,filter:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return r.jsxRuntimeExports.jsx(Dt,{resourceName:"Channel",onChange:e,value:t,allowNone:n,emptyContent:s,onFetchMore:m,onSearch:h,data:a,getItem:d,subscribe:x,status:p,haulType:kt,icon:r.jsxRuntimeExports.jsx(f.Channel,{}),...l,children:xc})},t1=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:gh,FLUX_STORE_CONFIG:oc,FLUX_STORE_KEY:sc,LinePlot:xg,SelectMultiple:e1,SelectSingle:Tt,ZERO_FORM_VALUES:Mr,calculatedFormSchema:rc,formSchema:_r,rename:Jg,resolveIcon:dc,retrieve:Lr,retrieveMany:Ug,update:Qg,updateAlias:uc,useCalculatedForm:Xg,useForm:Wg,useList:Pr,useListenForCalculationStatus:Yg},Symbol.toStringTag,{value:"Module"})),pc=({yDirection:e="up",...t})=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...t,keys:u.p.DIRECTIONS,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"x",children:r.jsxRuntimeExports.jsx(f.Arrow.Right,{})}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"y",children:e==="up"?r.jsxRuntimeExports.jsx(f.Arrow.Up,{}):r.jsxRuntimeExports.jsx(f.Arrow.Down,{})})]}),n1=Object.freeze(Object.defineProperty({__proto__:null,Select:pc},Symbol.toStringTag,{value:"Module"})),mc="groups",s1={channel:M.Cb.SET_CHANNEL_NAME,schema:M.Cb.groupZ,onChange:({store:e,changed:t})=>e.groups.set(t.key,t)},o1={channel:M.Cb.DELETE_CHANNEL_NAME,schema:M.Cb.keyZ,onChange:({store:e,changed:t})=>e.groups.delete(t)},fc={listeners:[s1,o1]},Io=async(e,t,n)=>{const s=n.groups.get(e);if(s!=null)return s;const o=await t.ontology.retrieve(M.Cb.ontologyID(e));return n.groups.set(e,M.Cb.groupZ.parse(o.data)),M.Cb.groupZ.parse(o.data)},r1=Fe({name:"Group",update:async({value:e,client:t,onChange:n,store:s})=>{const{parent:o}=e,i=await t.ontology.groups.create(o,e.name,e.key);s.groups.set(i.key,i),n({...i,parent:o})}}),i1=Ve({name:"Group",retrieveCached:({store:e,params:t})=>{if(t.parent==null)return[];const n=e.relationships.get(s=>M.Mb.matchRelationship(s,{from:t.parent,type:"parent"}));return e.groups.get(n.map(s=>s.to.key))},retrieve:async({client:e,params:t,store:n})=>{const{parent:s}=t;if(s==null)return[];const i=(await e.ontology.retrieveChildren(s,{...t,types:["group"]})).map(l=>M.Cb.groupZ.parse(l.data));return n.groups.set(i),i.forEach(l=>{const a={from:s,type:"parent",to:M.Cb.ontologyID(l.key)};n.relationships.set(M.Mb.relationshipToString(a),a)}),i},retrieveByKey:async({client:e,key:t,store:n})=>await Io(t,e,n),mountListeners:({store:e,onChange:t,onDelete:n,params:{parent:s},client:o})=>[e.groups.onSet(i=>t(i.key,l=>l==null?null:i)),e.groups.onDelete(n),e.relationships.onSet(async i=>{if(s==null||!M.Mb.matchRelationship(i,{from:s,type:"parent"}))return;const l=await Io(i.to.key,o,e);t(l.key,l)}),e.relationships.onDelete(async i=>{const l=M.Mb.relationshipZ.parse(i);s==null||!M.Mb.matchRelationship(l,{from:s,type:"parent"})||n(l.to.key)})]}),l1=Fe({name:"Group",update:async({client:e,value:t,params:n})=>await e.ontology.groups.rename(n.key,t)}).useDirect,a1=Fe({name:"Group",update:async({client:e,params:t})=>await e.ontology.groups.delete(t.key)}).useDirect,c1=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:fc,FLUX_STORE_KEY:mc,create:r1,singleRetrieve:Io,useDelete:a1,useList:i1,useRename:l1},Symbol.toStringTag,{value:"Module"})),hc="devices",u1={channel:M.Qb.SET_CHANNEL_NAME,schema:M.Qb.deviceZ,onChange:({store:e,changed:t})=>e.devices.set(t.key,n=>n==null?t:{...t,status:n.status})},d1={channel:M.Qb.DELETE_CHANNEL_NAME,schema:M.Qb.keyZ,onChange:({store:e,changed:t})=>e.devices.delete(t)},x1={channel:M.Qb.STATUS_CHANNEL_NAME,schema:M.Qb.statusZ,onChange:({store:e,changed:t})=>{e.devices.set(t.details.device,n=>n==null?n:{...n,status:t})}},gc={listeners:[u1,d1,x1]},p1=e=>{const t=ze();j.useEffect(()=>t.devices.onSet(e),[t])},jc=async(e,t,n)=>{const s=t.devices.get(n.key);if(s!=null)return s;const o=await e.hardware.devices.retrieve({...n,includeStatus:!0});return t.devices.set(n.key,o),o},m1=()=>Ye({name:"Device",retrieve:async({client:e,params:t,store:n})=>await jc(e,n,t),mountListeners:({store:e,onChange:t,params:{key:n}})=>[e.devices.onSet(s=>t(s),n)]}),Ec=Ve({name:"Devices",retrieveCached:({store:e,params:t})=>e.devices.get(n=>!(u.O$1.isNonZero(t.makes)&&!t.makes.includes(n.make)||u.O$1.isNonZero(t.models)&&!t.models.includes(n.model)||u.O$1.isNonZero(t.racks)&&!t.racks.includes(n.rack)||u.O$1.isNonZero(t.locations)&&!t.locations.includes(n.location)||u.O$1.isNonZero(t.names)&&!t.names.includes(n.name)||u.O$1.isNonZero(t.keys)&&!t.keys.includes(n.key))),retrieve:async({client:e,params:t,store:n})=>{const s=await e.hardware.devices.retrieve({includeStatus:!0,...t});return s.forEach(o=>n.devices.set(o.key,o)),s},retrieveByKey:async({client:e,key:t,store:n})=>await jc(e,n,{key:t}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.devices.onSet(s=>t(s.key,s)),e.devices.onDelete(n)]}),f1=f.renderProp(({itemKey:e,...t})=>{const n=f.useItem(e);return r.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,...t,className:u.CSS.BE("device","list-item"),justify:"between",align:"center",children:[r.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[r.jsxRuntimeExports.jsx(yc,{status:n?.status}),n?.name]}),r.jsxRuntimeExports.jsx(pr,{level:"small",color:9,weight:450,style:{marginTop:"0.25rem"},gap:"tiny",children:n?.location.split(".").map(s=>r.jsxRuntimeExports.jsx(Cn,{children:s},s))})]})}),h1=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:o,initialParams:i,disabled:l,icon:a=r.jsxRuntimeExports.jsx(f.Device,{}),...c})=>{const{data:d,retrieve:x,getItem:p,subscribe:m,status:h}=Ec({filter:n,initialParams:i}),{fetchMore:g,search:E}=nt.usePager({retrieve:x});return r.jsxRuntimeExports.jsx(Dt,{resourceName:"Device",value:t,onChange:e,data:d,getItem:p,subscribe:m,onFetchMore:g,onSearch:E,emptyContent:o,status:h,disabled:l,icon:a,...c,children:f1})},yc=({status:e,tooltipLocation:t="right"})=>{const n=e?.variant??"disabled",s=e?.message??"Device Status Unknown";return r.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[r.jsxRuntimeExports.jsx(f.Summary,{variant:n,hideIcon:!0,level:"small",weight:450,children:s}),r.jsxRuntimeExports.jsx(ur,{variant:n,className:u.CSS.BE("device","status-indicator")})]})},g1=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:gc,FLUX_STORE_KEY:hc,SelectSingle:h1,StatusIndicator:yc,retrieve:m1,useList:Ec,useSetSynchronizer:p1},Symbol.toStringTag,{value:"Module"})),Sc="racks",j1={channel:M.tT.SET_CHANNEL_NAME,schema:M.tT.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)}},E1={channel:M.tT.DELETE_CHANNEL_NAME,schema:M.tT.keyZ,onChange:({store:e,changed:t})=>e.racks.delete(t)},y1={channel:M.tT.STATUS_CHANNEL_NAME,schema:M.tT.statusZ,onChange:({store:e,changed:t})=>e.racks.set(t.details.rack,n=>n==null?n:{...n,status:t})},Rc={listeners:[j1,E1,y1]},Cc={includeStatus:!0},bc=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},wc=Ve({name:"Racks",retrieveCached:({store:e})=>e.racks.list(),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 bc({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)]}),S1=Ye({name:"Rack",retrieve:bc,mountListeners:({store:e,onChange:t,params:{key:n}})=>[e.racks.onSet(t,n)]}),R1=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t);return r.jsxRuntimeExports.jsxs(f.ListItem,{...e,align:"center",justify:"between",children:[r.jsxRuntimeExports.jsx(f.Text,{children:n?.name}),r.jsxRuntimeExports.jsx(vc,{status:n?.status,tooltipLocation:"left"})]})}),C1=({value:e,onChange:t,filter:n,allowNone:s,emptyContent:o,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=wc({initialParams:{includeStatus:!0,...i},filter:n}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return r.jsxRuntimeExports.jsx(Dt,{resourceName:"Driver",value:e,onChange:t,data:a,getItem:d,subscribe:x,onFetchMore:m,onSearch:h,emptyContent:o,status:p,icon:r.jsxRuntimeExports.jsx(f.Rack,{}),...l,children:R1})},vc=({status:e,tooltipLocation:t="right"})=>{const n=j.useRef(null),s=e?.variant??"disabled";return j.useEffect(()=>{if(s!=="success")return;const o=n.current;o&&(o.classList.remove(u.CSS.BEM("rack","heartbeat","beat")),requestAnimationFrame(()=>o.classList.add(u.CSS.BEM("rack","heartbeat","beat"))))},[e]),r.jsxRuntimeExports.jsxs(f.Dialog$1,{location:t,children:[r.jsxRuntimeExports.jsx(f.Summary,{variant:s,hideIcon:!0,level:"small",weight:450,children:e?.message}),r.jsxRuntimeExports.jsx(f.Heart,{ref:n,className:u.CSS.BE("rack","heartbeat"),style:{color:cr[s]}})]})},b1=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:Rc,FLUX_STORE_KEY:Sc,SelectSingle:C1,StatusIndicator:vc,retrieve:S1,useList:wc},Symbol.toStringTag,{value:"Module"})),kc="tasks",w1=["start","stop"],v1={channel:M.nT.SET_CHANNEL_NAME,schema:M.nT.keyZ,onChange:async({store:e,changed:t,client:n})=>e.tasks.set(t,await n.hardware.tasks.retrieve({key:t,includeStatus:!0}),"config")},k1={channel:M.nT.DELETE_CHANNEL_NAME,schema:M.nT.keyZ,onChange:({store:e,changed:t})=>e.tasks.delete(t)},_1=M.nT.statusZ(ne.z.unknown()),M1={channel:M.nT.STATUS_CHANNEL_NAME,schema:_1,onChange:async({store:e,changed:t,client:n})=>{if(!e.tasks.has(t.details.task)){const o=await n.hardware.tasks.retrieve({key:t.details.task});e.tasks.set(t.details.task,o,"config")}e.tasks.set(t.details.task,o=>o==null?o:n.hardware.tasks.sugar({...o,status:t}),"status")}},T1={channel:M.nT.COMMAND_CHANNEL_NAME,schema:M.nT.commandZ,onChange:({store:e,changed:t,client:n})=>e.tasks.set(t.task,s=>s==null||!w1.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:{}}}}),"status")},L1=e=>{const t=ze();j.useEffect(()=>t.tasks.onSet(n=>{n.status!=null&&e(n.status)}),[t])},_c={listeners:[v1,k1,M1,T1]},Nr=async(e,t,n,s)=>{const o=t.tasks.get(n.key);if(o!=null)return o;const i=await e.hardware.tasks.retrieve({...n,includeStatus:!0,schemas:s});return t.tasks.set(n.key,i,"config"),i},P1=e=>Ye({name:"Task",retrieve:async({client:t,params:n,store:s})=>n.key==null?null:await Nr(t,s,{key:n.key,includeStatus:!0},e),mountListeners:({store:t,params:{key:n},onChange:s})=>[t.tasks.onSet(o=>{n==null||o.key!==n||s(o)},n)]}),N1=Ve({name:"Task",retrieveCached:({store:e})=>e.tasks.list(),retrieve:async({client:e,params:t,store:n})=>{const s=await e.hardware.tasks.retrieve({includeStatus:!0,...t});return s.forEach(o=>n.tasks.set(o.key,o,"config")),s},retrieveByKey:async({client:e,key:t,store:n})=>await Nr(e,n,{key:t}),mountListeners:({store:e,onChange:t,onDelete:n})=>[e.tasks.onSet(s=>t(s.key,s)),e.tasks.onDelete(n)]}),A1=e=>ne.z.object({key:M.nT.keyZ.optional(),name:ne.z.string(),rackKey:ne.z.number(),type:e.typeSchema,snapshot:ne.z.boolean(),config:e.configSchema,status:M.nT.statusZ(e.statusDataSchema).optional().nullable()}),Xn=e=>({key:e.key,name:e.name,rackKey:e.key==null?0:M.nT.rackKey(e.key),type:e.type,config:e.config,status:e.status,snapshot:e.snapshot??!1}),O1=({schemas:e,initialValues:t})=>{const n=A1(e),s=Xn(t);return St({name:"Task",schema:n,initialValues:s,retrieve:async({client:o,store:i,params:{key:l},reset:a})=>{if(l==null)return;const c=await Nr(o,i,{key:l},e);a(Xn(c.payload))},update:async({client:o,params:i,store:l,...a})=>{const c=a.value(),x=await(await o.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),"config");const p=Xn(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:o,get:i,reset:l,set:a})=>[o.tasks.onSet((c,d)=>{const x=i("key",{optional:!0})?.value;if(!(x==null||x!==c.key))if(d==="config"){const p=c.payload;l(Xn(p))}else d==="status"&&a("status",c.status)})]})},I1=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:_c,FLUX_STORE_KEY:kc,createForm:O1,createRetrieveQuery:P1,useList:N1,useStatusSynchronizer:L1},Symbol.toStringTag,{value:"Module"})),Mc="labels",D1={channel:M.iT.SET_CHANNEL_NAME,schema:M.iT.labelZ,onChange:({store:e,changed:t})=>e.labels.set(t.key,t)},B1={channel:M.iT.DELETE_CHANNEL_NAME,schema:M.iT.keyZ,onChange:({store:e,changed:t})=>e.labels.delete(t)},Tc={listeners:[D1,B1]},Qt=(e,t)=>M.Mb.matchRelationship(e,{from:t,type:M.iT.LABELED_BY_ONTOLOGY_RELATIONSHIP_TYPE}),Lc=Ye({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(o=>{s(i=>{const l=i.filter(a=>a.key!==o.key);return l.length===i.length?i:[...l,o]})}),t.labels.onDelete(o=>s(i=>i.filter(l=>l.key!==o))),t.relationships.onSet(async o=>{if(!Qt(o,n))return;const{key:i}=o.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(o=>{const i=M.Mb.relationshipZ.parse(o);Qt(i,n)&&s(l=>l.filter(a=>a.key!==i.to.key))})]}),Ar=Ve({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 o=s?new Set(s):void 0;return[e.labels.onSet(async i=>{o!=null&&!o.has(i.key)||t(i.key,i,{mode:"prepend"})}),e.labels.onDelete(async i=>n(i))]}}),Pc=M.iT.labelZ.partial({key:!0}),$1=St({name:"Label",initialValues:{name:"",color:"#000000"},schema:Pc,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)]}),z1=Fe({name:"Label",update:async({client:e,params:{key:t}})=>await e.labels.delete(t)}).useDirect,Or="label",V1=({itemKey:e,...t})=>{const n=f.useItem(e),{selected:s,onSelect:o,hovered:i}=f.useItemState(e);return n==null?null:r.jsxRuntimeExports.jsx(f.Item,{itemKey:e,onSelect:o,selected:s,hovered:i,...t,children:r.jsxRuntimeExports.jsxs(f.Text,{align:"center",children:[r.jsxRuntimeExports.jsx(f.Circle,{color:n?.color,size:"2.5em"}),n?.name]})})},Nc=f.renderProp(V1),F1=f.renderProp(e=>{const{itemKey:t}=e,n=f.useItem(t),{onSelect:s}=f.useItemState(t);return n==null?null:r.jsxRuntimeExports.jsx(Os,{color:n.color,onClose:s,size:"small",children:n.name})}),H1={variant:"text"},Z1=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:o,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=Ar({filter:s,initialParams:o}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return r.jsxRuntimeExports.jsx(As,{resourceName:"Label",haulType:Or,value:t,onChange:e,data:l,getItem:c,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,renderTag:F1,icon:r.jsxRuntimeExports.jsx(f.Label,{}),triggerProps:H1,variant:"floating",...i,children:Nc})},K1=({onChange:e,value:t,allowNone:n,emptyContent:s,filter:o,initialParams:i,...l})=>{const{data:a,retrieve:c,getItem:d,subscribe:x,status:p}=Ar({filter:o,initialParams:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return r.jsxRuntimeExports.jsx(Dt,{resourceName:"Label",value:t,onChange:e,data:a,getItem:d,subscribe:x,allowNone:n,onFetchMore:m,onSearch:h,emptyContent:s,status:p,haulType:Or,...l,children:Nc})},Y1=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:Tc,FLUX_STORE_KEY:Mc,HAUL_TYPE:Or,SelectMultiple:Z1,SelectSingle:K1,formSchema:Pc,matchRelationship:Qt,retrieveLabelsOf:Lc,useDelete:z1,useForm:$1,useList:Ar},Symbol.toStringTag,{value:"Module"})),$s=new Error("Tab not found"),G1=new Error("Invalid Mosaic"),ps=(e,t,n="center",s,o)=>{if(e=Ge(e),s===void 0)return Do(e,t);const i=Bo(e,s);if(n==="center")return i.tabs||=[],o!==void 0&&o>=0&&o<=i.tabs.length?i.tabs.splice(o,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(Bo(e,c).key!==i.key)return ps(e,t,"center",c);if(i.tabs==null||i.tabs.length===0)return ps(e,t,"center",s);const[d,x,p]=J1(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 G1;return i.first.key=l,i.last.key=a,i.tabs=void 0,i.size=void 0,i.selected=void 0,e},U1=(e,t,n)=>{e=Ge(e);const[s,o]=Lt(e,t);if(s==null||o==null)throw $s;return o.tabs=o.tabs?.map(i=>i.tabKey===t?n(i):i),e},Do=(e,t)=>(e=Ge(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=Do(e.first,t):e.last!=null&&(e.last=Do(e.last,t)),e)),ms=e=>{e=Ge(e);const t=[];if(e.tabs!=null&&(e.selected=Le.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=ms(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=ms(e.last);e.last=n,t.push(...s)}return[e,t]},Ir=(e,t)=>{e=Ge(e);const[,n]=Lt(e,t);if(n==null)return[e,null];n.tabs=n.tabs?.filter(o=>o.tabKey!==t),n.selected=Le.resetSelection(n.selected,n.tabs),e=Q1(e);const s=n.selected??fs(e);return[e,s]},fs=e=>e.selected!=null?e.selected:e.first!=null?fs(e.first):e.last!=null?fs(e.last):null,Ac=(e,t)=>{e=Ge(e);const[n,s]=Lt(e,t);if(n==null||s==null)throw $s;return s.selected=t,e},Oc=(e,t,n,s,o)=>{e=Ge(e);const[i,l]=Lt(e,t);if(i==null||l==null)throw $s;const[a,c]=Ir(e,t);return[ps(a,i,n,s,o),c]},bn=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=bn(e.first,t);if(n!=null)return n}if(e.last!=null){const n=bn(e.last,t);if(n!=null)return n}},Ic=(e,t,n)=>{const s=hs(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},W1=(e,t,n)=>{e=Ge(e);const s=bn(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 o=s.tabs.findIndex(x=>x.tabKey===t);if(o===-1)throw new Error("Tab not found in node");const i=s.tabs[o];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=Le.resetSelection(d.selected,d.tabs),s.direction=n,s.first=d,s.last=c,s.tabs=void 0,s.selected=void 0,e},X1=(e,t)=>{const n=bn(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Dc=(e,t,n)=>{e=Ge(e);const[,s]=Lt(e,t);if(s?.tabs==null)throw $s;return s.tabs=Le.rename(t,n,s?.tabs??[]),e},q1=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,Bo=(e,t)=>{const n=hs(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:Bo(e,s)},Q1=e=>{let t=!0;for(;t;)[e,t]=$o(e);return e=Vo(e,1),e},$o=e=>{if(e.first==null||e.last==null)return[e,!1];if(Ii(e.first))return[Oi(e.last),!0];if(Ii(e.last))return[Oi(e.first),!0];let t,n;return[e.first,t]=$o(e.first),[e.last,n]=$o(e.last),[e,t||n]},Oi=e=>(e.size=void 0,e),Ii=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[o,i]=Lt(e.last,t);return[o,i]},hs=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=hs(e.first,t);return n??hs(e.last,t)},J1=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")}},Ge=e=>({...e,first:e.first!=null?Ge(e.first):void 0,last:e.last!=null?Ge(e.last):void 0}),gs=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&gs(e.first,t,n),e.last!=null&&gs(e.last,t,n),n),zo=(e,t)=>{t(e),e.first!=null&&zo(e.first,t),e.last!=null&&zo(e.last,t)},Vo=(e,t)=>(e=Ge(e),e.key=t,e.first!=null&&(e.first=Vo(e.first,t*2)),e.last!=null&&(e.last=Vo(e.last,t*2+1)),e);class Bc{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 e0=({node:e})=>{const t=j.createRef(),n=j.useRef(e);return j.useEffect(()=>{const s=t.current;if(s==null)return;const o=s.parentNode;if(o!=null)return e.mount(o,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 o=s.parentNode;o!=null&&e.mount(o,s)},[e]),r.jsxRuntimeExports.jsx("div",{ref:t})},$c=({node:e,children:t})=>Ql.createPortal(t,e.el),t0=Object.freeze(Object.defineProperty({__proto__:null,In:$c,Node:Bc,Out:e0},Symbol.toStringTag,{value:"Module"})),js=j.memo(({root:e,onDrop:t,onResize:n,onCreate:s,onFileDrop:o,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:k}=e,T={onDrop:t,onResize:n,onCreate:s,onFileDrop:o,children:i,onClose:d,contextMenu:m,onSelect:c,onRename:x,onReorder:p,activeTab:l,addTooltip:h},N=j.useCallback(([$])=>n(C,$),[n]),{props:I}=ua({direction:R,onResize:N,count:2,initialSizes:k!=null?[k]:void 0});let B={};C==1&&(B={...E,className:u.CSS(u.CSS.B("mosaic"),g)});let F;return S!==void 0?F=r.jsxRuntimeExports.jsx(zc,{root:e,emptyContent:a,...B,...T}):v!=null&&y!=null?F=r.jsxRuntimeExports.jsxs(da,{id:`mosaic-${C}`,align:"stretch",...I,...B,children:[r.jsxRuntimeExports.jsx(js,{...T,root:v,onResize:n},v.key),r.jsxRuntimeExports.jsx(js,{...T,root:y,onResize:n},y.key)]}):(F=null,console.warn("Mosaic tree is malformed")),F});js.displayName="Mosaic";const Es="pluto-mosaic-tab-drop",Dr="pluto-mosaic-tab-create",n0=(e,t,n)=>{if(f.filterByType(f.FILE_TYPE,t).length>0&&n)return!0;const o=f.filterByType(Es,t).map(a=>a.key),i=e.filter(a=>!o.includes(a.tabKey)).length>0;return f.filterByType(Dr,t).length>0||o.length>0&&(i||e.length===0)},zc=j.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:o,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})=>n0(p,B,g),[p,g]),S=j.useCallback(({items:B,event:F})=>{if(F==null)return[];const $=o0(F);h(null);const D=f.filterByType(f.FILE_TYPE,B).length>0,{percents:z}=Di(F),b=p.length===0?"center":Bi(z);if(D)return a?.(x,b,F),B;const P=f.filterByType(Es,B);if(P.length>0){const L=P.map(({key:V})=>V)[0];t(x,L,b,$)}const _=f.filterByType(Dr,B);if(_.length>0){const L=_.map(({key:V})=>V);n?.(x,b,L)}return P},[t,p.length]),R=j.useCallback(({event:B})=>{if(B==null)return;const{percents:F,inSelector:$}=Di(B);let D=null;$||(D=p.length===0?"center":Bi(F)),h(D)},[p.length]),{startDrag:v,...y}=f.useDragAndDrop({type:"Mosaic",canDrop:E,onDrop:S,onDragOver:R}),C=E(f.useDraggingState()),k=j.useCallback(()=>h(null),[]),T=j.useCallback((B,{tabKey:F})=>{v([{key:F,type:Es,elementID:B.currentTarget.id}])},[v]),N=j.useCallback(()=>n?.(x,"center"),[x]),I=x==1&&p.length==0;return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:r.jsxRuntimeExports.jsxs(Le.Tabs,{id:`tab-${x}`,tabs:p,className:u.CSS(i,I&&m!=null&&u.CSS.M("drag-over")),onDragLeave:k,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:T,onCreate:N,addTooltip:c,...y,...d,children:[e.selected!=null&&o(p.find(B=>B.tabKey===e.selected)),C&&r.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),m!=null&&r.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("mosaic","mask"),style:s0[m]})]})})});zc.displayName="MosaicTabLeaf";const s0={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%"}},Di=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}},o0=e=>{const t=e.target.closest(".pluto-tabs-selector__btn");if(t!=null)return Array.from(t.parentElement?.children??[]).indexOf(t)},r0=e=>e,i0=e=>1-e,Bi=({x:e,y:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[r0(e),i0(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")},l0=({root:e,onSelect:t,children:n})=>{const s=j.useRef(new Map),o=new Set,i=gs(e,l=>l.tabs?.map(a=>{let c=s.current.get(a.tabKey);return a==null?null:(c==null&&(c=new Bc({style:"width: 100%; height: 100%; position: relative;"}),c.el.addEventListener("click",()=>t?.(a.tabKey)),s.current.set(a.tabKey,c)),o.add(a.tabKey),r.jsxRuntimeExports.jsx($c,{node:c,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})).flat().filter(l=>l!=null);return s.current.forEach((l,a)=>!o.has(a)&&s.current.delete(a)),[s,i]},Fo=ne.z.object({key:ne.z.number(),tabs:ne.z.array(Le.tabZ).optional(),selected:ne.z.string().optional(),direction:u.p.direction.optional(),size:ne.z.number().optional(),get first(){return Fo.optional()},get last(){return Fo.optional()}}),a0=({allowRename:e=!1,initialTree:t})=>{const[n,s]=j.useState(t);return j.useEffect(()=>s(ms(t)[0]),[t]),{root:n,onDrop:(d,x,p)=>s(m=>Oc(m,x,p,d)[0]),onClose:d=>s(x=>Ir(x,d)[0]),onSelect:d=>s(x=>Ac(x,d)),onResize:(d,x)=>s(p=>Ic(p,d,x)),onRename:e?(d,x)=>s(p=>Dc(p,d,x)):void 0}},c0=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Dr,HAUL_DROP_TYPE:Es,Mosaic:js,autoSelectTabs:ms,canSplit:X1,findSelected:fs,findTabNode:bn,forEachNode:zo,insertTab:ps,isEmpty:q1,mapNodes:gs,moveTab:Oc,nodeZ:Fo,removeTab:Ir,renameTab:Dc,resizeNode:Ic,selectTab:Ac,split:W1,updateTab:U1,use:a0,usePortal:l0},Symbol.toStringTag,{value:"Module"})),u0=({variant:e,className:t,...n})=>r.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(t,u.CSS.B("note"),u.CSS.M(e)),align:"stretch",empty:!0,...n}),d0=Object.freeze(Object.defineProperty({__proto__:null,Note:u0},Symbol.toStringTag,{value:"Module"})),Vc="relationships",Fc="resources",x0={channel:M.Mb.RELATIONSHIP_SET_CHANNEL_NAME,schema:M.Mb.relationshipZ,onChange:({store:e,changed:t})=>e.relationships.set(M.Mb.relationshipToString(t),t)},p0={channel:M.Mb.RELATIONSHIP_DELETE_CHANNEL_NAME,schema:M.Mb.relationshipZ,onChange:({store:e,changed:t})=>e.relationships.delete(M.Mb.relationshipToString(t))},Hc={listeners:[x0,p0]},m0={channel:M.Mb.RESOURCE_SET_CHANNEL_NAME,schema:M.Mb.idZ,onChange:async({store:e,changed:t,client:n})=>e.resources.set(M.Mb.idToString(t),await n.ontology.retrieve(t))},f0={channel:M.Mb.RESOURCE_DELETE_CHANNEL_NAME,schema:M.Mb.idZ,onChange:({store:e,changed:t})=>e.resources.delete(t.key)},Zc={listeners:[m0,f0]},h0=e=>{const t=ze();j.useEffect(()=>t.resources.onSet(e),[t.resources])},g0=e=>{const t=ze();j.useEffect(()=>{const n=t.resources.onDelete(async s=>e(M.Mb.idZ.parse(s)));return()=>n()},[t.resources])},j0=e=>{const t=ze();j.useEffect(()=>t.relationships.onSet(e),[t.relationships])},E0=e=>{const t=ze();j.useEffect(()=>t.relationships.onDelete(n=>e(M.Mb.relationshipZ.parse(n))),[t.relationships])},Kc=e=>Ve({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:o,params:{id:i}})=>[t.relationships.onSet(async l=>{if(M.Mb.matchRelationship(l,{type:"parent",[M.Mb.oppositeRelationshipDirection(e)]:i})){const a=await o.ontology.retrieve(l[e]);n(a.key,a)}}),t.relationships.onDelete(l=>{const a=M.Mb.relationshipZ.parse(l);M.Mb.matchRelationship(a,{type:"parent",[M.Mb.oppositeRelationshipDirection(e)]:i})&&s(M.Mb.idToString(a[e]))}),t.resources.onSet(l=>n(l.key,a=>a==null?null:{...a,...l})),t.resources.onDelete(async l=>s(l))]}),y0=Kc("to"),S0=Ve({name:"useResourceList",retrieveCached:({store:e})=>e.resources.list(),retrieve:async({client:e,params:t,store:n})=>{const s=await e.ontology.retrieve(t);return s.forEach(o=>n.resources.set(o.key,o)),s},retrieveByKey:async({client:e,key:t,store:n})=>{const s=await e.ontology.retrieve(M.Mb.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))]}),R0=Ye({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:o})=>o.type===t.type);return s==null?null:s.id},mountListeners:({store:e,onChange:t,client:n,params:{id:s}})=>[e.relationships.onSet(async o=>{if(M.Mb.matchRelationship(o,{type:M.Mb.PARENT_OF_RELATIONSHIP_TYPE,to:s})){const i=await n.ontology.retrieve(o.from);t(i.id)}else t(null)}),e.relationships.onDelete(async o=>{const i=M.Mb.relationshipZ.parse(o);M.Mb.matchRelationship(i,{type:M.Mb.PARENT_OF_RELATIONSHIP_TYPE,to:s})&&t(null)})]}),C0=Object.freeze(Object.defineProperty({__proto__:null,RELATIONSHIPS_FLUX_STORE_KEY:Vc,RELATIONSHIP_FLUX_STORE_CONFIG:Hc,RESOURCES_FLUX_STORE_KEY:Fc,RESOURCE_FLUX_STORE_CONFIG:Zc,createDependentsListHook:Kc,retrieveParentID:R0,useChildren:y0,useRelationshipDeleteSynchronizer:E0,useRelationshipSetSynchronizer:j0,useResourceDeleteSynchronizer:g0,useResourceList:S0,useResourceSetSynchronizer:h0},Symbol.toStringTag,{value:"Module"})),mo={Close:r.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),r.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:r.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:r.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:r.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[r.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"}),r.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"})]})},b0=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:o,onFullscreen:i,onClose:l,...a})=>r.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:[r.jsxRuntimeExports.jsx(fo,{onClick:l,className:u.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:mo.Close}),r.jsxRuntimeExports.jsx(fo,{onClick:s,className:u.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:mo.Minimize}),r.jsxRuntimeExports.jsx(fo,{onClick:i,className:u.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:mo.Maximize})]}),fo=({className:e,disabled:t,color:n,...s})=>r.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("macos-control"),u.CSS.disabled(t),e),tabIndex:-1,disabled:t,...s}),w0=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:o,focused:i,contrast:l=2,...a})=>r.jsxRuntimeExports.jsxs(f.Box,{pack:!0,...a,children:[r.jsxRuntimeExports.jsx(ho,{className:u.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),contrast:l,children:r.jsxRuntimeExports.jsx(f.Subtract,{})}),r.jsxRuntimeExports.jsx(ho,{className:u.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),contrast:l,children:r.jsxRuntimeExports.jsx(f.Box$1,{})}),r.jsxRuntimeExports.jsx(ho,{onClick:s,className:u.CSS.BM("windows-control","close"),disabled:e.includes("close"),contrast:l,children:r.jsxRuntimeExports.jsx(f.Close,{})})]}),ho=({disabled:e=!1,className:t,...n})=>e?null:r.jsxRuntimeExports.jsx(f.Button,{className:u.CSS(u.CSS.B("windows-control"),t),tabIndex:-1,...n}),Yc=u.S.getOS,v0="Windows",k0=({forceOS:e,visibleIfOS:t,...n})=>{const s=Yc({force:e,default:v0});if(t!=null&&t!==s)return null;const o=s==="macOS"?b0:w0;return r.jsxRuntimeExports.jsx(o,{...n})},_0=Object.freeze(Object.defineProperty({__proto__:null,Controls:k0,use:Yc},Symbol.toStringTag,{value:"Module"})),M0=(e,t)=>{const n=s=>r.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},T0=Object.freeze(Object.defineProperty({__proto__:null,createComponent:M0},Symbol.toStringTag,{value:"Module"}));j.createContext({instrumentation:M.O.NOOP});const L0=({children:e,...t})=>{const{path:n}=f.useUnidirectional({type:M.Provider$1.TYPE,schema:M.providerStateZ,state:t});return r.jsxRuntimeExports.jsx(f.Composite,{path:n,children:e})},P0="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjUgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Gc="rangeKV",Uc="rangeAliases",wn=async(e,t,n)=>{const s=t.ranges.get(n);if(s!=null)return s;const o=await e.ranges.retrieve({keys:[n],includeParent:!0,includeLabels:!0});return t.ranges.set(n,o[0]),o[0]},N0=async(e,t,n)=>{const s=await e.ranges.retrieve({...n,includeParent:!0,includeLabels:!0});return t.ranges.set(s),s},A0=e=>{const t=ze();j.useEffect(()=>t.ranges.onSet(n=>e(n.payload)),[t])},O0=e=>{const t=ze();j.useEffect(()=>t.ranges.onDelete(n=>e(n)),[t])},Wc=async(e,t,n,s)=>{if(M.Mb.matchRelationship(e,{from:{type:"range"},type:M.iT.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]}))}},Xc=async(e,t,n,s)=>{if(M.Mb.matchRelationship(e,{from:{type:"range"},type:M.Mb.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}))}},I0=Ve({name:"Range",retrieve:async({client:e,params:{key:t},store:n})=>{const s=await e.ontology.retrieveChildren(M.oT.ontologyID(t),{types:["range"]});return s.length===0?[]:await N0(e,n,{keys:s.map(({id:{key:o}})=>o)})},retrieveByKey:async({client:e,key:t,store:n})=>await wn(e,n,t),mountListeners:({store:e,onChange:t,onDelete:n,client:s,params:{key:o}})=>[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(o==null)return;if(await Xc(i,t,s,e),await Wc(i,t,s,e),M.Mb.matchRelationship(i,{from:M.oT.ontologyID(o),type:M.Mb.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=>{if(o==null)return;const l=M.Mb.relationshipZ.parse(i);if(M.Mb.matchRelationship(l,{from:M.oT.ontologyID(o),type:M.Mb.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"range"}}))return n(l.to.key);l.type===M.iT.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)}))})]}),D0=Ye({name:"Range",retrieve:async({client:e,params:{id:t}})=>{const s=(await e.ontology.retrieveParents(t)).find(({id:{type:o}})=>o==="range");return s==null?null:e.ranges.sugarOntologyResource(s)},mountListeners:({store:e,onChange:t,client:n,params:{id:s}})=>[e.ranges.onSet(o=>{t(i=>i==null||i.key!==o.key?i:n.ranges.sugarOne({...o,parent:o.parent??i.parent,labels:o.labels??i.labels}))}),e.relationships.onSet(async o=>{if(!M.Mb.matchRelationship(o,{type:M.Mb.PARENT_OF_RELATIONSHIP_TYPE,to:s}))return;if(!(o.from.type==="range"))return t(null);const a=await wn(n,e,o.from.key);t(n.ranges.sugarOne(a.payload))}),e.relationships.onDelete(async o=>{const i=M.Mb.relationshipZ.parse(o);M.Mb.matchRelationship(i,{type:M.Mb.PARENT_OF_RELATIONSHIP_TYPE,to:s})&&t(null),M.Mb.matchRelationship(i,{type:M.iT.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)}))})]}),qc=Ye({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 o=>{if(o!=null)return t(o)},s),e.relationships.onSet(async o=>{if(Qt(o,M.oT.ontologyID(s))){const a=await n.labels.retrieve({key:o.to.key});e.labels.set(o.to.key,a),t(c=>c==null?c:n.ranges.sugarOne({...c,labels:[...(c.labels??[]).filter(d=>d.key!==a.key),a]}))}if(M.Mb.matchRelationship(o,{type:M.Mb.PARENT_OF_RELATIONSHIP_TYPE,to:M.oT.ontologyID(s)})){const a=await n.ranges.retrieve(o.from.key);e.ranges.set(o.from.key,a),t(c=>c==null?c:n.ranges.sugarOne({...c,parent:a}))}},s)]}),B0=qc.useDirect,Qc=ne.z.object({...M.oT.payloadZ.omit({timeRange:!0}).partial({key:!0}).shape,labels:ne.z.array(M.iT.keyZ),parent:ne.z.string().optional(),timeRange:ne.z.object({start:ne.z.number(),end:ne.z.number()})}),Ho=async e=>({...e.payload,timeRange:e.timeRange.numeric,parent:e.parent?.key,labels:e.labels?.map(t=>t.key)??[]}),$0={name:"",labels:[],parent:"",timeRange:{start:0,end:0}},z0=St({name:"Range",schema:Qc,initialValues:$0,retrieve:async({client:e,params:{key:t},store:n,reset:s})=>{t!=null&&s(await Ho(await wn(e,n,t)))},update:async({client:e,value:t,reset:n,store:s})=>{const o=t(),i=o.parent,l=u.O$1.isNonZero(i)?M.oT.ontologyID(i):void 0,a=await e.ranges.create(o,{parent:l});await e.labels.label(a.ontologyID,o.labels,{replace:!0});const c=s.labels.get(o.labels),d=new Set(c.map(m=>m.key)),x=o.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$1.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({...o,...a.payload,timeRange:a.timeRange.numeric,labels:o.labels,parent:o.parent})},mountListeners:({store:e,reset:t,get:n,set:s})=>[e.ranges.onSet(async o=>{const i=await Ho(o),l=n("key",{optional:!0})?.value;if(l==null||l!==o.key)return;const a=n("parent",{optional:!0})?.value,c=n("labels").value;t({...i,labels:c,parent:a})}),e.relationships.onSet(o=>{const i=n("key",{optional:!0})?.value;if(i==null)return;const l=M.oT.ontologyID(i);if(Qt(o,l)){const d=n("labels").value;return s("labels",[...d.filter(x=>x!==o.to.key),o.to.key])}M.Mb.matchRelationship(o,{type:M.Mb.PARENT_OF_RELATIONSHIP_TYPE,to:l})&&s("parent",o.from.key)}),e.relationships.onDelete(o=>{const i=n("key",{optional:!0})?.value;if(i==null)return;const l=M.Mb.relationshipZ.parse(o),a=M.oT.ontologyID(i);if(Qt(l,a))return s("labels",n("labels").value.filter(x=>x!==l.to.key));if(M.Mb.matchRelationship(l,{type:M.Mb.PARENT_OF_RELATIONSHIP_TYPE,to:a}))return s("parent",void 0)})]}),V0=e=>Lc.useDirect({params:{id:M.oT.ontologyID(e)}}),F0={includeParent:!0,includeLabels:!0},Br=Ve({name:"Ranges",retrieveCached:({store:e,params:t})=>e.ranges.get(n=>u.O$1.isNonZero(t.keys)?t.keys.includes(n.key):!0),retrieve:async({client:e,params:t})=>await e.ranges.retrieve({...F0,...t}),retrieveByKey:async({client:e,key:t,store:n})=>{const s=n.ranges.get(t);if(s!=null)return s;const o=await e.ranges.retrieve(t);return n.ranges.set(t,o),o},mountListeners:({store:e,onChange:t,onDelete:n,client:s,params:{keys:o}})=>{const i=o!=null&&o.length>0,l=new Set(o);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 Xc(a,t,s,e),await Wc(a,t,s,e)})]}}),H0=ne.z.object({pairs:ne.z.array(ne.z.object({key:ne.z.string(),value:ne.z.string()}))}),Jc=ne.z.string().transform(e=>e.split("<--->")).transform(([e,t])=>({key:t,range:e})),Z0={channel:M.oT.KV_SET_CHANNEL,schema:M.oT.kvPairZ,onChange:({store:e,changed:t})=>{e.rangeKV.set(M.oT.kvPairKey(t),t)}},K0={channel:M.oT.KV_DELETE_CHANNEL,schema:Jc,onChange:({store:e,changed:t})=>e.rangeKV.delete(M.oT.kvPairKey(t))},eu={listeners:[Z0,K0]},Y0=Ve({name:"Range Meta Data",retrieve:async({client:e,params:{rangeKey:t}})=>{const s=await e.ranges.getKV(t).list();return Object.entries(s).map(([o,i])=>({key:o,value:i,range:t}))},retrieveByKey:async({client:e,key:t,params:{rangeKey:n}})=>{if(n==null)return;const o=await e.ranges.getKV(n).get(t);return{key:t,value:o,range:n}},mountListeners:({store:e,onChange:t,onDelete:n,params:{rangeKey:s}})=>[e.rangeKV.onSet(o=>{o.range===s&&t(o.key,o)}),e.rangeKV.onDelete(o=>{const i=Jc.parse(o);i.range===s&&n(i.key)})]}),tu=M.oT.kvPairZ,G0=St({name:"Range Meta Data",schema:tu,retrieve:async()=>{},update:async({client:e,value:t})=>{const{key:n,value:s,range:o}=t();await e.ranges.getKV(o).set(n,s)},initialValues:{key:"",value:"",range:""}}),U0=Fe({name:"Range Meta Data",update:async({client:e,value:t,params:{rangeKey:n}})=>{await e.ranges.getKV(n).delete(t)}}),W0=Fe({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)}}),X0=Fe({name:"Range",update:async({client:e,value:t,onChange:n,store:s})=>{const o=await e.ranges.create(t);s.ranges.set(o.key,o),n(o)}}),q0=Fe({name:"Range",update:async({client:e,value:t,store:n})=>{await e.ranges.delete(t),n.ranges.delete(t)}}),Q0={channel:M.oT.SET_ALIAS_CHANNEL_NAME,schema:M.oT.aliasZ,onChange:({store:e,changed:t})=>{e.rangeAliases.set(M.oT.aliasKey(t),t)}},J0=ne.z.string().transform(e=>M.oT.decodeDeleteAliasChange(e)),ej={channel:M.oT.DELETE_ALIAS_CHANNEL_NAME,schema:J0,onChange:({store:e,changed:t})=>e.rangeAliases.delete(M.oT.aliasKey(t))},nu={listeners:[Q0,ej]},su=({timeRange:e,level:t="p",color:n=9,showSpan:s=!1,...o})=>{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=r.jsxRuntimeExports.jsxs(f.Text,{x:!0,align:"center",gap:"small",children:[i.isToday&&r.jsxRuntimeExports.jsx(f.Text,{level:t,color:n,weight:450,children:"Today"}),r.jsxRuntimeExports.jsx(f.DateTime,{el:"span",level:t,displayTZ:"local",format:l,color:n,weight:450,children:i})]}),m=r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[c?r.jsxRuntimeExports.jsx(f.Text,{level:t,el:"span",children:"Now"}):r.jsxRuntimeExports.jsx(f.DateTime,{level:t,el:"span",displayTZ:"local",format:d,color:n,weight:450,children:a}),!x.isZero&&s&&r.jsxRuntimeExports.jsxs(f.Text,{level:t,color:n,weight:450,el:"span",children:["(",i.span(a).truncate(u.i.MILLISECOND).toString(),")"]})]});return r.jsxRuntimeExports.jsxs(f.Text,{x:!0,gap:"small",className:u.CSS(u.CSS.B("time-range-chip")),align:"center",level:t,color:n,...o,children:[p,r.jsxRuntimeExports.jsx(f.Arrow.Right,{color:9}),m]})},$r="range",zr=j.memo(({itemKey:e,showParent:t=!0,showLabels:n=!0,...s})=>{const o=f.useItem(e);if(o==null)return null;const{name:i,parent:l,timeRange:a,labels:c}=o;return r.jsxRuntimeExports.jsxs(f.ListItem,{itemKey:e,justify:"between",...s,children:[r.jsxRuntimeExports.jsxs(pr,{children:[r.jsxRuntimeExports.jsx(Cn,{weight:450,color:10,children:i}),l!=null&&t&&r.jsxRuntimeExports.jsx(Cn,{weight:400,color:8,children:l.name})]}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(su,{level:"small",timeRange:a}),n&&r.jsxRuntimeExports.jsx(dr,{variant:"text",children:c?.map(d=>r.jsxRuntimeExports.jsx(Os,{color:d.color,size:"small",children:d.name},d.key))})]})]})});zr.displayName="Ranger.ListItem";const ou=f.renderProp(zr),ru=r.jsxRuntimeExports.jsx(f.Range,{}),tj=({onChange:e,value:t,emptyContent:n,filter:s,initialParams:o,...i})=>{const{data:l,retrieve:a,getItem:c,subscribe:d,status:x}=Br({filter:s,initialParams:o}),{fetchMore:p,search:m}=nt.usePager({retrieve:a});return r.jsxRuntimeExports.jsx(As,{resourceName:"Range",haulType:$r,value:t,onChange:e,data:l,getItem:c,icon:ru,subscribe:d,onFetchMore:p,onSearch:m,emptyContent:n,status:x,...i,children:ou})},nj={style:{width:800}},sj=({onChange:e,value:t,filter:n,allowNone:s,emptyContent:o,initialParams:i,...l})=>{const{data:a,retrieve:c,subscribe:d,getItem:x,status:p}=Br({filter:n,initialParams:i}),{fetchMore:m,search:h}=nt.usePager({retrieve:c});return r.jsxRuntimeExports.jsx(Dt,{resourceName:"Range",variant:"modal",value:t,onChange:e,data:a,allowNone:s,haulType:$r,onFetchMore:m,getItem:x,subscribe:d,status:p,onSearch:h,emptyContent:o,icon:ru,itemHeight:45,dialogProps:nj,...l,children:ou})},oj=Object.freeze(Object.defineProperty({__proto__:null,ALIAS_FLUX_STORE_CONFIG:nu,HAUL_TYPE:$r,KV_FLUX_STORE_CONFIG:eu,ListItem:zr,RANGE_ALIASES_FLUX_STORE_KEY:Uc,RANGE_KV_FLUX_STORE_KEY:Gc,SelectMultiple:tj,SelectSingle:sj,TimeRangeChip:su,formSchema:Qc,kvPairFormSchema:tu,metaDataFormSchema:H0,retrieve:qc,retrieveParent:D0,toFormValues:Ho,useChildren:I0,useDelete:q0,useDeleteKV:U0,useDeleteSynchronizer:O0,useForm:z0,useKVPairForm:G0,useLabels:V0,useList:Br,useListKV:Y0,useRetrieve:B0,useSetSynchronizer:A0,useUpdate:X0,useUpdateKV:W0},Symbol.toStringTag,{value:"Module"})),iu="schematicSymbols",rj={channel:M.yT.symbol.SET_CHANNEL_NAME,schema:M.yT.symbol.symbolZ,onChange:({store:e,changed:t})=>e.schematicSymbols.set(t.key,t)},ij={channel:M.yT.symbol.DELETE_CHANNEL_NAME,schema:M.yT.symbol.keyZ,onChange:({store:e,changed:t})=>e.schematicSymbols.delete(t)},lu={listeners:[rj,ij]},ys=async(e,t,n)=>{const s=n.schematicSymbols.get(t);if(s!=null)return s;const o=await e.workspaces.schematic.symbols.retrieve({key:t});return n.schematicSymbols.set(t,o),o},zs=Ye({name:"SchematicSymbols",retrieve:async({client:e,params:t,store:n})=>await ys(e,t.key,n),mountListeners:({store:e,params:t,onChange:n})=>[e.schematicSymbols.onSet(n,t.key)]}),go=(e,t)=>M.Mb.matchRelationship(e,{from:t,type:M.Mb.PARENT_OF_RELATIONSHIP_TYPE,to:{type:"schematic_symbol"}}),lj=Ve({sort:(e,t)=>e.name.localeCompare(t.name),retrieveCached:({params:e,store:t})=>{if(e.searchTerm!=null&&e.searchTerm.length>0)return[];if(e.parent==null)return t.schematicSymbols.list();const n=t.relationships.get(s=>go(s,e.parent));return t.schematicSymbols.get(n.map(s=>s.to.key))},name:"Schematic Symbols",retrieve:async({client:e,store:t,params:{parent:n,...s}})=>{if(n!=null){const l=(await e.ontology.retrieveChildren(n)).map(c=>c.id.key);if(l.length===0)return[];const a=await e.workspaces.schematic.symbols.retrieve({...s,keys:l});return a.forEach(c=>{const d={from:n,type:M.Mb.PARENT_OF_RELATIONSHIP_TYPE,to:M.yT.symbol.ontologyID(c.key)};t.relationships.set(M.Mb.relationshipToString(d),d)}),a}const o=await e.workspaces.schematic.symbols.retrieve(s);return t.schematicSymbols.set(o),o},retrieveByKey:async({client:e,key:t,store:n})=>await ys(e,t,n),mountListeners:({store:e,onChange:t,onDelete:n,params:s,client:o})=>[e.schematicSymbols.onSet(i=>t(i.key,l=>l==null?null:i)),e.schematicSymbols.onDelete(n),e.relationships.onSet(async i=>{if(!go(i,s.parent))return;const l=await ys(o,i.to.key,e);t(i.to.key,l)}),e.relationships.onDelete(async i=>{const l=M.Mb.relationshipZ.parse(i);go(l,s.parent)&&n(l.to.key)})]}),au=M.yT.symbol.symbolZ.partial({key:!0}).extend({parent:M.Mb.idZ}),aj=St({name:"SchematicSymbols",initialValues:{version:1,name:"",data:{svg:"",states:[],handles:[],variant:"static",scale:1,scaleStroke:!1,previewViewport:{zoom:1,position:{x:0,y:0}}},parent:M.Mb.ROOT_ID},schema:au,retrieve:async({client:e,params:{key:t,parent:n},reset:s,store:o})=>{if(t==null)return;const i=await ys(e,t,o);n==null&&(n=(await e.ontology.retrieveParents(M.yT.symbol.ontologyID(t)))[0].id),s({version:1,name:i.name,data:i.data,key:i.key,parent:n})},update:async({client:e,value:t,reset:n,params:s})=>{const o=s.parent??t().parent??M.Mb.ROOT_ID,i=await e.workspaces.schematic.symbols.create({...t(),parent:o});n({...i,parent:o})},mountListeners:({store:e,params:t,reset:n,get:s})=>t.key==null?[]:[e.schematicSymbols.onSet(o=>n({...o,parent:t.parent??s("parent",{optional:!0})?.value??M.Mb.ROOT_ID}),t.key)]}),cj=Fe({name:"SchematicSymbols",update:async({client:e,value:t,params:n})=>await e.workspaces.schematic.symbols.rename(n.key,t)}).useDirect,uj=Fe({name:"SchematicSymbols",update:async({client:e,params:{key:t}})=>await e.workspaces.schematic.symbols.delete(t)}).useDirect,dj=Ye({name:"SchematicSymbols",retrieve:async({client:e})=>await e.workspaces.schematic.symbols.retrieveGroup()}),Ss="data-original-stroke",Rs="data-original-fill",xj=(e,t)=>{let n=[...e];if(e.length!==t.length){const o=new Map(e.map(l=>[l.key,l])),i=new Map(t.map(l=>[l.key,l]));n=n.filter(l=>i.has(l.key));for(const l of t)o.has(l.key)||n.push(M.T.copy(l))}const s=[...n];for(let o=0;o<s.length;o++){const i=s[o],l=t.find(a=>a.key===i.key);if(l&&i.regions.length!==l.regions.length){const a=[...i.regions],c=new Map(a.map(p=>[p.key,p])),d=new Map(l.regions.map(p=>[p.key,p])),x=a.filter(p=>d.has(p.key));for(const p of l.regions)c.has(p.key)||x.push(M.T.copy(p));s[o]={...i,regions:x}}}return s},pj=({path:e,onReset:t,getOriginalRegion:n})=>{const s=Mt(`${e}.name`),o=Mt(e),i=n(e),l=!M.T.equal(o,i);return r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",children:[r.jsxRuntimeExports.jsx(f.Text,{level:"small",color:9,style:{maxWidth:50,width:50},overflow:"ellipsis",children:u.U.capitalize(s)}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(ge,{path:`${e}.strokeColor`,showLabel:!1,padHelpText:!1,children:({value:a,onChange:c})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:a,onChange:d=>c(u.fr.hex(d))})}),r.jsxRuntimeExports.jsx(ge,{path:`${e}.fillColor`,showLabel:!1,padHelpText:!1,children:({value:a,onChange:c})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:a,onChange:d=>c(u.fr.hex(d))})}),r.jsxRuntimeExports.jsx(f.Button,{onClick:()=>t(e),variant:"text",size:"tiny",style:{opacity:l?1:0},children:r.jsxRuntimeExports.jsx(f.Reset,{})})]},e)]})},mj=({selectedState:e,onReset:t,getOriginalRegion:n})=>{const{data:s}=br(`stateOverrides.${e}.regions`);return r.jsxRuntimeExports.jsx(f.Box,{y:!0,align:"stretch",children:s.map(o=>r.jsxRuntimeExports.jsx(pj,{onReset:t,path:`stateOverrides.${e}.regions.${o}`,getOriginalRegion:n},o))})},cu=()=>{const e=Mt("specKey"),t=Et(),[n,s]=j.useState([]),{data:o}=br("stateOverrides"),[i,l]=j.useState(o?.[0]);zs.useEffect({params:{key:e},onChange:d=>{if(d.data?.data==null)return;const x=d.data.data;s(M.T.copy(x.states));const p=t.get("stateOverrides");if(p.value?.length===0)t.set("stateOverrides",M.T.copy(x.states)),l(x.states[0].key);else{const m=xj(p.value,x.states);t.set("stateOverrides",m)}}});const a=j.useCallback(d=>{const x=d.split(".").slice(1).join("."),p=M.T.get(n,x,{optional:!0});p!=null&&t.set(d,M.T.copy(p))},[t.set,n]),c=j.useCallback(d=>{const x=d.split(".").slice(1).join(".");return M.T.get(n,x,{optional:!0})??null},[n]);return r.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"stretch",children:[o.length>1&&r.jsxRuntimeExports.jsx(pe.Buttons,{keys:o,value:i,onChange:l,full:"x",children:o.map(d=>r.jsxRuntimeExports.jsx(pe.Button,{itemKey:d,justify:"center",children:u.U.capitalize(d)},d))}),i!=null&&r.jsxRuntimeExports.jsx(mj,{selectedState:i,onReset:a,getOriginalRegion:c})]})},$i=(e,t,n)=>{e.regions.forEach(s=>{s.selectors.forEach(o=>{t.querySelectorAll(o).forEach(l=>n(l,s))})})},fj=e=>{const t=e.getAttribute(Ss),n=e.getAttribute(Rs);t!=null&&e.setAttribute("stroke",t),n!=null&&e.setAttribute("fill",n)},hj=e=>{if(!e.hasAttribute(Ss)){const t=e.getAttribute("stroke");t!=null&&e.setAttribute(Ss,t)}if(!e.hasAttribute(Rs)){const t=e.getAttribute("fill");t!=null&&e.setAttribute(Rs,t)}},gj=(e,t,n)=>{n!=null&&$i(n,e,fj),$i(t,e,(s,o)=>{hj(s);const{strokeColor:i,fillColor:l}=o;if(i!=null)s.setAttribute("stroke",i);else{const a=s.getAttribute(Ss);a!=null&&s.setAttribute("stroke",a)}if(l!=null)s.setAttribute("fill",l);else{const a=s.getAttribute(Rs);a!=null&&s.setAttribute("fill",a)}})},Vr=({container:e,orientation:t,activeState:n,externalScale:s,spec:o,onMount:i,stateOverrides:l})=>{const a=j.useRef(null),c=j.useRef({width:0,height:0}),d=j.useRef(void 0),x=j.useRef(void 0),p=j.useRef(void 0),m=j.useRef(void 0),h=j.useRef(void 0);if(o==null||o.svg.length===0||e==null)return;const g=d.current!==s,E=p.current?.svg!==o?.svg,S=x.current!==t,R=p.current?.scale!==o?.scale,v=p.current?.scaleStroke!==o?.scaleStroke,y=p.current!==o,C=n==="active"?1:0,k=l?.[C]??o.states[C],T=m.current!==k,N=JSON.stringify(h.current)!==JSON.stringify(l);if(!(g||E||v||T||N))return;g&&(d.current=s),S&&(x.current=t),y&&(p.current=M.T.copy(o)),N&&(h.current=l);const{svg:B,scaleStroke:F,scale:$}=o;if(a.current==null||E){a.current!=null&&(a.current.remove(),a.current=null);const z=new DOMParser().parseFromString(B,"image/svg+xml"),b=z.documentElement;a.current=b;const P=a.current.getAttribute("viewBox");if(P){const[,,L,V]=P.split(" ").map(Number);c.current={width:L,height:V}}else a.current.viewBox?.baseVal?c.current={width:a.current.viewBox.baseVal.width,height:a.current.viewBox.baseVal.height}:c.current={width:100,height:100};if(!b.querySelector("g")){const L=z.createElementNS("http://www.w3.org/2000/svg","g"),V=Array.from(b.children);V.forEach(H=>b.removeChild(H)),V.forEach(H=>{H!==L&&L.appendChild(H)}),b.appendChild(L)}e.appendChild(b),i?.(a.current)}if((T||N)&&(gj(a.current,k,m.current),m.current=M.T.copy(k)),R||g||S||E){let D=c.current;u.p.construct(t)==="y"&&(D=u._.swap(D));const z=u._.scale(D,$*s);a.current.setAttribute("width",z.width.toString()),a.current.setAttribute("height",z.height.toString()),a.current.setAttribute("viewBox",`0 0 ${D.width} ${D.height}`)}if(v){const D=a.current.querySelectorAll("path, circle, rect, line, ellipse, polygon, polyline");F?D.forEach(z=>z.removeAttribute("vector-effect")):D.forEach(z=>z.setAttribute("vector-effect","non-scaling-stroke"))}},jj=["path","rect","circle","ellipse","polygon","polyline","line","text"],zi=u.fr.hex(u.fr.ZERO),Vi=e=>{if(e==null||e==="")return zi;const t=u.fr.fromCSS(e);return t==null?zi:u.fr.hex(t)},Ej=e=>{const t=e.style.stroke||e.getAttribute("stroke"),n=e.style.fill||e.getAttribute("fill");return{stroke:Vi(t),fill:Vi(n)}},yj=e=>`${e.stroke}|${e.fill}`,uu=e=>{if(e.id)return`#${e.id}`;const t=e.getAttribute("data-region-id");if(t)return`[data-region-id="${t}"]`;if(e.classList.length>0)return`.${Array.from(e.classList).join(".")}`;const n=e.tagName.toLowerCase(),s=e.parentElement;if(!s)return n;let o=1,i=e.previousElementSibling;for(;i;)i.tagName.toLowerCase()===n&&o++,i=i.previousElementSibling;return`${s.tagName.toLowerCase()==="svg"?"":s instanceof SVGElement?`${uu(s)} > `:""}${n}:nth-of-type(${o})`},Sj=e=>{const t=jj.flatMap(s=>Array.from(e.querySelectorAll(s))),n=new Map;return t.forEach(s=>{const o=Ej(s),i=yj(o);n.has(i)||n.set(i,{elements:[],colorPair:o}),n.get(i).elements.push(s)}),Array.from(n.values()).map((s,o)=>{const i=s.elements.map(uu),l=Array.from(new Set(i)),a=o+1,c={key:`region-${a}`,name:`Region ${a}`,selectors:l};return c.strokeColor=s.colorPair.stroke,c.fillColor=s.colorPair.fill,c})},Rj=({value:e,hideOuter:t=!1,showOuterCenter:n=!1,hideInner:s,onChange:o})=>{const{outer:i}=e,l=c=>()=>o({...e,...c}),a=u.CSS.B("select","orientation");return t?r.jsxRuntimeExports.jsx(Fi,{className:a,value:e,onChange:o}):r.jsxRuntimeExports.jsxs(f.Box,{className:a,align:"center",justify:"center",gap:"tiny",children:[r.jsxRuntimeExports.jsx(rt,{selected:i==="top",onClick:l({outer:"top"})}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",gap:"tiny",children:[r.jsxRuntimeExports.jsx(rt,{selected:i==="left",onClick:l({outer:"left"})}),r.jsxRuntimeExports.jsx(Fi,{hideInner:s,value:e,onChange:o,showOuterCenter:n}),r.jsxRuntimeExports.jsx(rt,{selected:i==="right",onClick:l({outer:"right"})})]}),r.jsxRuntimeExports.jsx(rt,{selected:i==="bottom",onClick:l({outer:"bottom"})})]})},Fi=({value:e,onChange:t,className:n,hideInner:s=!1,showOuterCenter:o=!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 o?d=r.jsxRuntimeExports.jsx(rt,{selected:e.outer==="center",onClick:a({outer:"center"})}):d=r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="top",onClick:a({inner:"top"})}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"center",justify:"center",children:[r.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,selected:l==="left",onClick:a({inner:"left"})}),r.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,selected:l==="right",onClick:a({inner:"right"})})]}),r.jsxRuntimeExports.jsx(rt,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:l==="bottom",onClick:a({inner:"bottom"})})]}),r.jsxRuntimeExports.jsx(f.Box,{className:u.CSS(n,u.CSS.B("value"),o&&u.CSS.M("show-outer-center")),y:!0,align:"center",justify:"center",empty:!0,...i,children:d})},rt=({selected:e,className:t,...n})=>r.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(t,u.CSS.selected(e)),size:"tiny",...n,children:r.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Cj=O.MODES,bj=({aetherKey:e,sink:t,mode:n})=>{const s=f.useMemoDeepEqual({sink:t,mode:n}),o=j.useRef({trigger:0,...s}),{setState:i}=f.useLifecycle({aetherKey:e,type:O.Button.TYPE,schema:O.buttonStateZ,initialState:o.current});j.useEffect(()=>{o.current={...o.current,...s},i(o.current)},[s,i,e]);const l=j.useCallback(()=>{o.current.trigger+=O.MOUSE_UP_INCREMENT,i(o.current)},[i]),a=j.useCallback(()=>{o.current.trigger+=O.MOUSE_DOWN_INCREMENT,i(o.current)},[i]);return{onClick:l,onMouseDown:a,onMouseUp:l}},wj=e=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:Cj,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"fire",tooltip:"Output true when clicked",children:"Fire"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"momentary",tooltip:"Output true on press, false on release",children:"Momentary"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pulse",tooltip:"Output true and then immediately output false on click",children:"Pulse"})]}),du=ne.z.object({bounds:u.H.bounds,gradient:u.fr.gradientZ}),vn={bounds:{lower:0,upper:1},gradient:[]},Hi={size:"small",showDragHandle:!1},Zi={width:60},vj=u.C.Scale.scale(0,1),Fr=({path:e})=>{const{set:t,get:n}=Et(),{bounds:s}=Mt(`${e}`,{defaultValue:{bounds:{...vn.bounds},gradient:[...vn.gradient]}}),o=vj.scale(s);return r.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(Be,{inputProps:Hi,style:Zi,label:"Lower",path:`${e}.bounds.lower`}),r.jsxRuntimeExports.jsx(ge,{path:`${e}.gradient`,label:"Gradient",align:"start",padHelpText:!1,children:({value:i,onChange:l})=>r.jsxRuntimeExports.jsx(_e.GradientPicker,{value:M.T.copy(i),scale:o,onChange:a=>{const d={...n(`${e}.bounds`).value},x=a.map(S=>S.position),p=o.pos(Math.max(...x)),m=o.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.fr.hex(S.color)}));h||g?t(e,{bounds:d,gradient:E}):l(a.map(S=>({...S,color:u.fr.hex(S.color)})))}})}),r.jsxRuntimeExports.jsx(Be,{inputProps:Hi,style:Zi,label:"Upper",path:`${e}.bounds.upper`})]})},kj=e=>r.jsxRuntimeExports.jsxs(pe.Buttons,{...e,keys:u.wr.NOTATIONS,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"standard",children:"Standard"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"scientific",children:"Scientific"}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"engineering",children:"Engineering"})]}),_j=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],Hr=({path:e})=>{const{value:t,onChange:n}=yt(e),s=O.sourcePipelinePropsZ.parse(t.telem?.props),o=O.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=O.stringifyNumberProps.parse(s.segments.stringifier.props),l=O.rollingAverageProps.parse(s.segments.rollingAverage.props),a=h=>{const g=O.sourcePipeline("string",{connections:_j,segments:{valueStream:O.streamChannelValue({channel:o.channel}),stringifier:O.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:O.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:g})},c=h=>a({valueStream:O.streamChannelValue({channel:h??0})}),d=h=>a({stringifier:O.stringifyNumber({...i,notation:h})}),x=h=>a({stringifier:O.stringifyNumber({...i,precision:h})}),p=h=>a({rollingAverage:O.rollingAverage({windowSize:h})});if(typeof o.channel!="number")throw new Error("Must pass in a channel by key to Value.TelemForm");const{data:m}=Lr.useDirect({params:{key:o.channel}});return j.useEffect(()=>{m!=null&&n({...t,tooltip:[m.name]})},[m?.name,n]),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Input Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Tt,{value:o.channel,onChange:c})}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Notation",children:r.jsxRuntimeExports.jsx(kj,{value:i.notation,onChange:d})}),r.jsxRuntimeExports.jsx(Ae.Item,{label:"Precision",align:"start",children:r.jsxRuntimeExports.jsx(f.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),r.jsxRuntimeExports.jsx(Ae.Item,{label:"Averaging Window",align:"start",children:r.jsxRuntimeExports.jsx(f.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})}),r.jsxRuntimeExports.jsx(ge,{hideIfNull:!0,label:"Stale Color",align:"start",path:"stalenessColor",children:({value:h,onChange:g})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:h??u.fr.setAlpha(u.fr.ZERO,1),onChange:g,bordered:!0})}),r.jsxRuntimeExports.jsx(Be,{path:"stalenessTimeout",label:"Stale Timeout",inputProps:{bounds:{lower:1,upper:1/0},endContent:"s"}})]})]})},Mj=O.Value.z.partial({color:!0}).extend({level:M.levelZ.optional()}),Zr=({aetherKey:e,box:t,telem:n,color:s,precision:o,minWidth:i,level:l="small",backgroundTelem:a,notation:c,location:d,stalenessColor:x,stalenessTimeout:p,useWidthForBackground:m,valueBackgroundOverScan:h,valueBackgroundShift:g})=>{const E=f.useMemoDeepEqual({box:t,telem:n,color:s,precision:o,level:l,minWidth:i,notation:c,backgroundTelem:a,stalenessColor:x,stalenessTimeout:p,location:d,useWidthForBackground:m,valueBackgroundOverScan:h,valueBackgroundShift:g}),[,S,R]=f.use$2({aetherKey:e,type:O.Value.TYPE,schema:O.Value.z,initialState:E});return j.useEffect(()=>R(v=>({...v,...E})),[E]),{width:S.width??S.minWidth}},Tj=Object.freeze(Object.defineProperty({__proto__:null,RedlineForm:Fr,TelemForm:Hr,ZERO_READLINE:vn,corePropsZ:Mj,redlineZ:du,use:Zr},Symbol.toStringTag,{value:"Module"})),Pe=({className:e,direction:t,...n})=>r.jsxRuntimeExports.jsx(f.Box,{direction:t,align:"stretch",className:u.CSS(u.CSS.B("symbol-form"),e),gap:t==="x"?"large":"medium",...n}),Rt=({hideOuter:e,hideInner:t,showOuterCenter:n,...s})=>t&&e?null:r.jsxRuntimeExports.jsx(ge,{label:"Orientation",padHelpText:!1,...s,children:({value:o,onChange:i})=>r.jsxRuntimeExports.jsx(Rj,{value:{inner:o.orientation??"top",outer:o.label?.orientation??"top"},hideInner:t,hideOuter:e,showOuterCenter:n,onChange:l=>i({...o,orientation:l.inner,label:{...o.label,orientation:l.outer}})})}),ut=({path:e,omit:t=[]})=>r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(ge,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>r.jsxRuntimeExports.jsx(f.Text$2,{selectOnFocus:!0,...n})}),r.jsxRuntimeExports.jsx(Be,{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}),r.jsxRuntimeExports.jsx(ge,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:({value:n,onChange:s})=>r.jsxRuntimeExports.jsx(ln,{value:n,onChange:s})}),r.jsxRuntimeExports.jsx(ge,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>r.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:n,onChange:s})}),r.jsxRuntimeExports.jsx(ge,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:({value:n,onChange:s})=>r.jsxRuntimeExports.jsx(pc,{value:n,onChange:s,yDirection:"down"})})]}),$e=e=>r.jsxRuntimeExports.jsx(ge,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...o})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:t??u.fr.setAlpha(u.fr.ZERO,1),onChange:n,...o,bordered:!0})}),Lj={lower:5,upper:1e3},Pj={x:.75,y:.5},xu=e=>r.jsxRuntimeExports.jsx(ge,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>r.jsxRuntimeExports.jsx(f.Numeric,{dragScale:Pj,bounds:Lj,endContent:"%",value:Math.round(t*100),onChange:s=>n(parseFloat((s/100).toFixed(2)))})}),xe=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>{const s=Mt("stateOverrides",{optional:!0})!=null;return r.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",empty:!0,children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{omit:e,path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[!s&&r.jsxRuntimeExports.jsx($e,{path:"color",optional:!0}),r.jsxRuntimeExports.jsx(ge,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:o=>r.jsxRuntimeExports.jsx(f.Switch$1,{...o})}),r.jsxRuntimeExports.jsx(xu,{path:"scale"})]})]}),s&&r.jsxRuntimeExports.jsx(cu,{}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideInner:t,hideOuter:n})]})},Nj=({path:e})=>{const{value:t,onChange:n}=yt(e),s=O.sourcePipelinePropsZ.parse(t.source?.props),o=O.sinkPipelinePropsZ.parse(t.sink?.props),i=O.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=O.setChannelValuePropsZ.parse(o.segments.setter.props),a=d=>{d??=0;const x=O.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:O.streamChannelValue({channel:d}),threshold:O.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:x})},c=d=>{d??=0;const x=O.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:O.setChannelValue({channel:d}),setpoint:O.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),p=O.authoritySource({channel:d}),m=O.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 r.jsxRuntimeExports.jsxs(Pe,{x:!0,grow:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"State Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Tt,{value:i.channel,onChange:a})}),r.jsxRuntimeExports.jsx(Ae.Item,{label:"Command Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Tt,{value:l.channel,onChange:c})}),r.jsxRuntimeExports.jsx(Bs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},Kr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],ye=({actions:e,hideInnerOrientation:t})=>{const n=j.useCallback(({tabKey:o})=>{switch(o){case"control":return r.jsxRuntimeExports.jsx(Nj,{path:""});default:return r.jsxRuntimeExports.jsx(xe,{hideInnerOrientation:t})}},[t]),s=Le.useStatic({tabs:Kr,content:n});return r.jsxRuntimeExports.jsx(Le.Tabs,{...s,actions:e})},mt={y:2,x:.25},Sn={lower:0,upper:2e3},Ki={lower:0,upper:51},pu=({includeBorderRadius:e=!1,includeStrokeWidth:t=!1})=>r.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx($e,{path:"backgroundColor",label:"Background Color"}),r.jsxRuntimeExports.jsx(ge,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:n=>r.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Ki,endContent:"%",...n})}),r.jsxRuntimeExports.jsx(ge,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:n=>r.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Ki,endContent:"%",...n})}),e&&r.jsxRuntimeExports.jsx(ge,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:n=>r.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:Sn,endContent:"px",...n})}),t&&r.jsxRuntimeExports.jsx(ge,{path:"strokeWidth",hideIfNull:!0,optional:!0,label:"Border Width",grow:!0,children:n=>r.jsxRuntimeExports.jsx(f.Numeric,{dragScale:mt,bounds:{lower:0,upper:21},endContent:"px",...n})}),r.jsxRuntimeExports.jsx(ge,{path:"dimensions.width",label:"Width",grow:!0,children:({value:n,...s})=>r.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:mt,bounds:Sn,endContent:"px",...s})}),r.jsxRuntimeExports.jsx(ge,{path:"dimensions.height",label:"Height",grow:!0,children:({value:n,...s})=>r.jsxRuntimeExports.jsx(f.Numeric,{value:n??200,dragScale:mt,bounds:Sn,endContent:"px",...s})})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideInner:!0,showOuterCenter:!0,label:"Label Location"})]}),Aj=()=>r.jsxRuntimeExports.jsx(Pe,{direction:"x",align:"stretch",children:r.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx($e,{path:"backgroundColor",label:"Background Color"}),r.jsxRuntimeExports.jsx(Be,{path:"rotation",label:"Rotation",inputProps:{dragScale:{x:1,y:.25},bounds:{lower:0,upper:360},endContent:"°"},grow:!0}),r.jsxRuntimeExports.jsx(Be,{path:"numSides",label:"Number of Sides",inputProps:{dragScale:{x:.5,y:.1},bounds:{lower:3,upper:21}},grow:!0}),r.jsxRuntimeExports.jsx(Be,{path:"sideLength",label:"Side Length",inputProps:{dragScale:{x:1,y:1},bounds:{lower:10,upper:500},endContent:"px"},grow:!0}),r.jsxRuntimeExports.jsx(Be,{path:"cornerRounding",label:"Corner Rounding",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:181},endContent:"px"},grow:!0}),r.jsxRuntimeExports.jsx(Be,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),Oj=()=>r.jsxRuntimeExports.jsx(Pe,{direction:"x",align:"stretch",children:r.jsxRuntimeExports.jsxs(f.Box,{direction:"y",grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{direction:"x",children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx($e,{path:"backgroundColor",label:"Background Color"}),r.jsxRuntimeExports.jsx(Be,{path:"radius",label:"Radius",inputProps:{dragScale:{x:1,y:1},bounds:{lower:0,upper:500},endContent:"px"},grow:!0}),r.jsxRuntimeExports.jsx(Be,{path:"strokeWidth",label:"Border Width",inputProps:{dragScale:{x:1,y:1},bounds:{lower:1,upper:21},endContent:"px"},grow:!0})]})]})}),Ij=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],Dj={dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"},Bj=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return r.jsxRuntimeExports.jsxs(Pe,{y:!0,empty:!0,children:[r.jsxRuntimeExports.jsx(Hr,{path:""}),";"]});case"redline":return r.jsxRuntimeExports.jsx(Pe,{y:!0,empty:!0,children:r.jsxRuntimeExports.jsx(Fr,{path:"redline"})});default:return r.jsxRuntimeExports.jsxs(Pe,{x:!0,children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx(ge,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>r.jsxRuntimeExports.jsx(f.Text$2,{...s})}),r.jsxRuntimeExports.jsx(Be,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:Dj}),r.jsxRuntimeExports.jsx(ge,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:o})=>r.jsxRuntimeExports.jsx(ln,{value:s,onChange:o})})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideInner:!0})]})}},[]),t=Le.useStatic({tabs:Ij,content:e});return r.jsxRuntimeExports.jsx(Le.Tabs,{...t})},$j=({path:e})=>{const{value:t,onChange:n}=yt(e),s=O.sourcePipelinePropsZ.parse(t.source?.props),o=O.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=O.withinBoundsProps.parse(s.segments.threshold.props),l=c=>{c??=0;const d=O.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:O.streamChannelValue({channel:c}),threshold:O.withinBounds({trueBound:i.trueBound})},outlet:"threshold"});n({...t,source:d})},a=c=>{const d=O.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:O.streamChannelValue({channel:o.channel}),threshold:O.withinBounds({trueBound:c})},outlet:"threshold"});n({...t,source:d})};if(typeof o.channel!="number")throw new Error("Channel key must be used for light telemetry");return r.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Input Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Tt,{value:o.channel,onChange:l})}),r.jsxRuntimeExports.jsx(Ae.Item,{label:"Lower Threshold",children:r.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.lower??.9,onChange:c=>a({...i.trueBound,lower:c})})}),r.jsxRuntimeExports.jsx(Ae.Item,{label:"Upper Threshold",children:r.jsxRuntimeExports.jsx(f.Numeric,{value:i.trueBound.upper??1.1,onChange:c=>a({...i.trueBound,upper:c})})})]})},zj=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],Vj=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return r.jsxRuntimeExports.jsx($j,{path:""});default:return r.jsxRuntimeExports.jsx(xe,{})}},[]),t=Le.useStatic({tabs:zj,content:e});return r.jsxRuntimeExports.jsx(Le.Tabs,{...t})},Fj=({path:e})=>{const{value:t,onChange:n}=yt(e),s=O.sinkPipelinePropsZ.parse(t.sink?.props),o=O.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=O.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:O.setChannelValue({channel:l}),setpoint:O.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),c=O.authoritySource({channel:l}),d=O.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 r.jsxRuntimeExports.jsxs(Pe,{y:!0,empty:!0,children:[r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Output Channel",grow:!0,padHelpText:!1,children:r.jsxRuntimeExports.jsx(Tt,{value:o.channel,onChange:i})}),r.jsxRuntimeExports.jsx(Be,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0,padHelpText:!1}),r.jsxRuntimeExports.jsx(Bs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0,padHelpText:!1})]}),r.jsxRuntimeExports.jsx(ge,{path:"mode",label:"Mode",optional:!0,children:({value:l,onChange:a})=>r.jsxRuntimeExports.jsx(wj,{value:l,onChange:a})})]})},Hj=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"control":return r.jsxRuntimeExports.jsx(Fj,{path:""});default:return r.jsxRuntimeExports.jsx(xe,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=Le.useStatic({tabs:Kr,content:e});return r.jsxRuntimeExports.jsx(Le.Tabs,{...t})},Zj=({path:e})=>{const{value:t,onChange:n}=yt(e),s=O.sinkPipelinePropsZ.parse(t.sink?.props),o=O.setChannelValuePropsZ.parse(s.segments.setter.props),i=l=>{l??=0;const a=O.sinkPipeline("number",{connections:[],segments:{setter:O.setChannelValue({channel:l})},inlet:"setter"}),c=O.authoritySource({channel:l}),d=O.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 r.jsxRuntimeExports.jsx(Pe,{x:!0,grow:!0,align:"stretch",children:r.jsxRuntimeExports.jsx(Ae.Item,{label:"Command Channel",grow:!0,children:r.jsxRuntimeExports.jsx(Tt,{value:o.channel,onChange:i})})})},Kj=()=>{const e=j.useCallback(({tabKey:n})=>{switch(n){case"control":return r.jsxRuntimeExports.jsx(Zj,{path:""});default:return r.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,align:"stretch",grow:!0,gap:"small",children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(wr,{path:"units",label:"Units",align:"start",padHelpText:!1}),r.jsxRuntimeExports.jsx(ge,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:s,onChange:o})=>r.jsxRuntimeExports.jsx(ha,{value:s,onChange:o})}),r.jsxRuntimeExports.jsx($e,{path:"color"})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideInner:!0})]})}},[]),t=Le.useStatic({tabs:Kr,content:e});return r.jsxRuntimeExports.jsx(Le.Tabs,{...t})},Yj=()=>{const e=yt("autoFit",{optional:!0});return r.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",grow:!0,children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsxs(f.Box,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsx(ge,{path:"value",label:"Text",padHelpText:!1,grow:!0,children:t=>r.jsxRuntimeExports.jsx(f.Text$2,{...t})}),r.jsxRuntimeExports.jsx(ge,{path:"level",label:"Text Size",padHelpText:!1,children:({value:t,onChange:n})=>r.jsxRuntimeExports.jsx(ln,{value:t,onChange:n})}),r.jsxRuntimeExports.jsx(ge,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:({value:t,onChange:n})=>r.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:t,onChange:n})})]}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx(ge,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>r.jsxRuntimeExports.jsx(f.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:r.jsxRuntimeExports.jsx(f.Button,{onClick:()=>e?.onChange(!0),disabled:e?.value===!0,variant:"outlined",style:{borderLeft:"var(--pluto-border-l5)"},tooltip:e?.value===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:r.jsxRuntimeExports.jsx(f.AutoFitWidth,{})})})})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:""})]})},Gj=()=>r.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label",omit:["maxInlineSize","align","direction"]}),r.jsxRuntimeExports.jsx($e,{path:"color"})]}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideOuter:!0})]}),Uj=()=>r.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx($e,{path:"backgroundColor",label:"Background Color"}),r.jsxRuntimeExports.jsx(ge,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>r.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:mt,bounds:Sn,endContent:"px",...t})}),r.jsxRuntimeExports.jsx(ge,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>r.jsxRuntimeExports.jsx(f.Numeric,{value:e??200,dragScale:mt,bounds:Sn,endContent:"px",...t})})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:"",hideInner:!0})]}),$t=()=>r.jsxRuntimeExports.jsxs(Pe,{x:!0,align:"stretch",children:[r.jsxRuntimeExports.jsxs(f.Box,{y:!0,grow:!0,children:[r.jsxRuntimeExports.jsx(ut,{path:"label"}),r.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,children:[r.jsxRuntimeExports.jsx($e,{path:"color"}),r.jsxRuntimeExports.jsx(xu,{path:"scale"}),r.jsxRuntimeExports.jsx(Bs,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),r.jsxRuntimeExports.jsx(Rt,{path:""})]}),Wj=()=>r.jsxRuntimeExports.jsx(pu,{includeBorderRadius:!0,includeStrokeWidth:!0}),Xj=()=>r.jsxRuntimeExports.jsx(ye,{hideInnerOrientation:!0});function Te(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=Te(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var qj={value:()=>{}};function Vs(){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 as(n)}function as(e){this._=e}function Qj(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",o=n.indexOf(".");if(o>=0&&(s=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}as.prototype=Vs.prototype={constructor:as,on:function(e,t){var n=this._,s=Qj(e+"",n),o,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((o=(e=s[i]).type)&&(o=Jj(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(o=(e=s[i]).type)n[o]=Yi(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Yi(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new as(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),s=0,o,i;s<o;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,o=i.length;s<o;++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],o=0,i=s.length;o<i;++o)s[o].value.apply(t,n)}};function Jj(e,t){for(var n=0,s=e.length,o;n<s;++n)if((o=e[n]).name===t)return o.value}function Yi(e,t,n){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=qj,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var Zo="http://www.w3.org/1999/xhtml";const Gi={svg:"http://www.w3.org/2000/svg",xhtml:Zo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fs(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Gi.hasOwnProperty(t)?{space:Gi[t],local:e}:e}function e2(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Zo&&t.documentElement.namespaceURI===Zo?t.createElement(e):t.createElementNS(n,e)}}function t2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mu(e){var t=Fs(e);return(t.local?t2:e2)(t)}function n2(){}function Yr(e){return e==null?n2:function(){return this.querySelector(e)}}function s2(e){typeof e!="function"&&(e=Yr(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,a=s[o]=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 Ke(s,this._parents)}function o2(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function r2(){return[]}function fu(e){return e==null?r2:function(){return this.querySelectorAll(e)}}function i2(e){return function(){return o2(e.apply(this,arguments))}}function l2(e){typeof e=="function"?e=i2(e):e=fu(e);for(var t=this._groups,n=t.length,s=[],o=[],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)),o.push(c));return new Ke(s,o)}function hu(e){return function(){return this.matches(e)}}function gu(e){return function(t){return t.matches(e)}}var a2=Array.prototype.find;function c2(e){return function(){return a2.call(this.children,e)}}function u2(){return this.firstElementChild}function d2(e){return this.select(e==null?u2:c2(typeof e=="function"?e:gu(e)))}var x2=Array.prototype.filter;function p2(){return Array.from(this.children)}function m2(e){return function(){return x2.call(this.children,e)}}function f2(e){return this.selectAll(e==null?p2:m2(typeof e=="function"?e:gu(e)))}function h2(e){typeof e!="function"&&(e=hu(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,a=s[o]=[],c,d=0;d<l;++d)(c=i[d])&&e.call(c,c.__data__,d,i)&&a.push(c);return new Ke(s,this._parents)}function ju(e){return new Array(e.length)}function g2(){return new Ke(this._enter||this._groups.map(ju),this._parents)}function Cs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Cs.prototype={constructor:Cs,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 j2(e){return function(){return e}}function E2(e,t,n,s,o,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 Cs(e,i[l]);for(;l<c;++l)(a=t[l])&&(o[l]=a)}function y2(e,t,n,s,o,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)?o[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 Cs(e,i[a]);for(a=0;a<x;++a)(c=t[a])&&d.get(m[a])===c&&(o[a]=c)}function S2(e){return e.__data__}function R2(e,t){if(!arguments.length)return Array.from(this,S2);var n=t?y2:E2,s=this._parents,o=this._groups;typeof e!="function"&&(e=j2(e));for(var i=o.length,l=new Array(i),a=new Array(i),c=new Array(i),d=0;d<i;++d){var x=s[d],p=o[d],m=p.length,h=C2(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,k;v<g;++v)if(C=E[v]){for(v>=y&&(y=v+1);!(k=S[y])&&++y<g;);C._next=k||null}}return l=new Ke(l,s),l._enter=a,l._exit=c,l}function C2(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function b2(){return new Ke(this._exit||this._groups.map(ju),this._parents)}function w2(e,t,n){var s=this.enter(),o=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),s&&o?s.merge(o).order():o}function v2(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,o=n.length,i=s.length,l=Math.min(o,i),a=new Array(o),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<o;++c)a[c]=n[c];return new Ke(a,this._parents)}function k2(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],o=s.length-1,i=s[o],l;--o>=0;)(l=s[o])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function _2(e){e||(e=M2);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,o=new Array(s),i=0;i<s;++i){for(var l=n[i],a=l.length,c=o[i]=new Array(a),d,x=0;x<a;++x)(d=l[x])&&(c[x]=d);c.sort(t)}return new Ke(o,this._parents).order()}function M2(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function T2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function L2(){return Array.from(this)}function P2(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,i=s.length;o<i;++o){var l=s[o];if(l)return l}return null}function N2(){let e=0;for(const t of this)++e;return e}function A2(){return!this.node()}function O2(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var o=t[n],i=0,l=o.length,a;i<l;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function I2(e){return function(){this.removeAttribute(e)}}function D2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function B2(e,t){return function(){this.setAttribute(e,t)}}function $2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function z2(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function V2(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 F2(e,t){var n=Fs(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?D2:I2:typeof t=="function"?n.local?V2:z2:n.local?$2:B2)(n,t))}function Eu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function H2(e){return function(){this.style.removeProperty(e)}}function Z2(e,t,n){return function(){this.style.setProperty(e,t,n)}}function K2(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function Y2(e,t,n){return arguments.length>1?this.each((t==null?H2:typeof t=="function"?K2:Z2)(e,t,n??"")):Jt(this.node(),e)}function Jt(e,t){return e.style.getPropertyValue(t)||Eu(e).getComputedStyle(e,null).getPropertyValue(t)}function G2(e){return function(){delete this[e]}}function U2(e,t){return function(){this[e]=t}}function W2(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function X2(e,t){return arguments.length>1?this.each((t==null?G2:typeof t=="function"?W2:U2)(e,t)):this.node()[e]}function yu(e){return e.trim().split(/^|\s+/)}function Gr(e){return e.classList||new Su(e)}function Su(e){this._node=e,this._names=yu(e.getAttribute("class")||"")}Su.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 Ru(e,t){for(var n=Gr(e),s=-1,o=t.length;++s<o;)n.add(t[s])}function Cu(e,t){for(var n=Gr(e),s=-1,o=t.length;++s<o;)n.remove(t[s])}function q2(e){return function(){Ru(this,e)}}function Q2(e){return function(){Cu(this,e)}}function J2(e,t){return function(){(t.apply(this,arguments)?Ru:Cu)(this,e)}}function eE(e,t){var n=yu(e+"");if(arguments.length<2){for(var s=Gr(this.node()),o=-1,i=n.length;++o<i;)if(!s.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?J2:t?q2:Q2)(n,t))}function tE(){this.textContent=""}function nE(e){return function(){this.textContent=e}}function sE(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function oE(e){return arguments.length?this.each(e==null?tE:(typeof e=="function"?sE:nE)(e)):this.node().textContent}function rE(){this.innerHTML=""}function iE(e){return function(){this.innerHTML=e}}function lE(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function aE(e){return arguments.length?this.each(e==null?rE:(typeof e=="function"?lE:iE)(e)):this.node().innerHTML}function cE(){this.nextSibling&&this.parentNode.appendChild(this)}function uE(){return this.each(cE)}function dE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xE(){return this.each(dE)}function pE(e){var t=typeof e=="function"?e:mu(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function mE(){return null}function fE(e,t){var n=typeof e=="function"?e:mu(e),s=t==null?mE:typeof t=="function"?t:Yr(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 gE(){return this.each(hE)}function jE(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function EE(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function yE(e){return this.select(e?EE:jE)}function SE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function RE(e){return function(t){e.call(this,t,this.__data__)}}function CE(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 bE(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,o=t.length,i;n<o;++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 wE(e,t,n){return function(){var s=this.__on,o,i=RE(t);if(s){for(var l=0,a=s.length;l<a;++l)if((o=s[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(o):this.__on=[o]}}function vE(e,t,n){var s=CE(e+""),o,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(o=0,x=a[c];o<i;++o)if((l=s[o]).type===x.type&&l.name===x.name)return x.value}return}for(a=t?wE:bE,o=0;o<i;++o)this.each(a(s[o],t,n));return this}function bu(e,t,n){var s=Eu(e),o=s.CustomEvent;typeof o=="function"?o=new o(t,n):(o=s.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function kE(e,t){return function(){return bu(this,e,t)}}function _E(e,t){return function(){return bu(this,e,t.apply(this,arguments))}}function ME(e,t){return this.each((typeof t=="function"?_E:kE)(e,t))}function*TE(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],o=0,i=s.length,l;o<i;++o)(l=s[o])&&(yield l)}var wu=[null];function Ke(e,t){this._groups=e,this._parents=t}function $n(){return new Ke([[document.documentElement]],wu)}function LE(){return this}Ke.prototype=$n.prototype={constructor:Ke,select:s2,selectAll:l2,selectChild:d2,selectChildren:f2,filter:h2,data:R2,enter:g2,exit:b2,join:w2,merge:v2,selection:LE,order:k2,sort:_2,call:T2,nodes:L2,node:P2,size:N2,empty:A2,each:O2,attr:F2,style:Y2,property:X2,classed:eE,text:oE,html:aE,raise:uE,lower:xE,append:pE,insert:fE,remove:gE,clone:yE,datum:SE,on:vE,dispatch:ME,[Symbol.iterator]:TE};function He(e){return typeof e=="string"?new Ke([[document.querySelector(e)]],[document.documentElement]):new Ke([[e]],wu)}function PE(e){let t;for(;t=e.sourceEvent;)e=t;return e}function We(e,t){if(e=PE(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 o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const NE={passive:!1},kn={capture:!0,passive:!1};function jo(e){e.stopImmediatePropagation()}function Xt(e){e.preventDefault(),e.stopImmediatePropagation()}function vu(e){var t=e.document.documentElement,n=He(e).on("dragstart.drag",Xt,kn);"onselectstart"in t?n.on("selectstart.drag",Xt,kn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ku(e,t){var n=e.document.documentElement,s=He(e).on("dragstart.drag",null);t&&(s.on("click.drag",Xt,kn),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 qn=e=>()=>e;function Ko(e,{sourceEvent:t,subject:n,target:s,identifier:o,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:o,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}})}Ko.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function AE(e){return!e.ctrlKey&&!e.button}function OE(){return this.parentNode}function IE(e,t){return t??{x:e.x,y:e.y}}function DE(){return navigator.maxTouchPoints||"ontouchstart"in this}function _u(){var e=AE,t=OE,n=IE,s=DE,o={},i=Vs("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,NE).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(C,k){if(!(x||!e.call(this,C,k))){var T=y(this,t.call(this,C,k),C,k,"mouse");T&&(He(C.view).on("mousemove.drag",g,kn).on("mouseup.drag",E,kn),vu(C.view),jo(C),d=!1,a=C.clientX,c=C.clientY,T("start",C))}}function g(C){if(Xt(C),!d){var k=C.clientX-a,T=C.clientY-c;d=k*k+T*T>p}o.mouse("drag",C)}function E(C){He(C.view).on("mousemove.drag mouseup.drag",null),ku(C.view,d),Xt(C),o.mouse("end",C)}function S(C,k){if(e.call(this,C,k)){var T=C.changedTouches,N=t.call(this,C,k),I=T.length,B,F;for(B=0;B<I;++B)(F=y(this,N,C,k,T[B].identifier,T[B]))&&(jo(C),F("start",C,T[B]))}}function R(C){var k=C.changedTouches,T=k.length,N,I;for(N=0;N<T;++N)(I=o[k[N].identifier])&&(Xt(C),I("drag",C,k[N]))}function v(C){var k=C.changedTouches,T=k.length,N,I;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),N=0;N<T;++N)(I=o[k[N].identifier])&&(jo(C),I("end",C,k[N]))}function y(C,k,T,N,I,B){var F=i.copy(),$=We(B||T,k),D,z,b;if((b=n.call(C,new Ko("beforestart",{sourceEvent:T,target:m,identifier:I,active:l,x:$[0],y:$[1],dx:0,dy:0,dispatch:F}),N))!=null)return D=b.x-$[0]||0,z=b.y-$[1]||0,function P(_,L,V){var H=$,K;switch(_){case"start":o[I]=P,K=l++;break;case"end":delete o[I],--l;case"drag":$=We(V||L,k),K=l;break}F.call(_,C,new Ko(_,{sourceEvent:L,subject:b,target:m,identifier:I,active:K,x:$[0]+D,y:$[1]+z,dx:$[0]-H[0],dy:$[1]-H[1],dispatch:F}),N)}}return m.filter=function(C){return arguments.length?(e=typeof C=="function"?C:qn(!!C),m):e},m.container=function(C){return arguments.length?(t=typeof C=="function"?C:qn(C),m):t},m.subject=function(C){return arguments.length?(n=typeof C=="function"?C:qn(C),m):n},m.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:qn(!!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 en=0,jn=0,mn=0,Mu=1e3,bs,En,ws=0,Pt=0,Hs=0,_n=typeof performance=="object"&&performance.now?performance:Date,Tu=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ur(){return Pt||(Tu(BE),Pt=_n.now()+Hs)}function BE(){Pt=0}function vs(){this._call=this._time=this._next=null}vs.prototype=Lu.prototype={constructor:vs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ur():+n)+(t==null?0:+t),!this._next&&En!==this&&(En?En._next=this:bs=this,En=this),this._call=e,this._time=n,Yo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Yo())}};function Lu(e,t,n){var s=new vs;return s.restart(e,t,n),s}function $E(){Ur(),++en;for(var e=bs,t;e;)(t=Pt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--en}function Ui(){Pt=(ws=_n.now())+Hs,en=jn=0;try{$E()}finally{en=0,VE(),Pt=0}}function zE(){var e=_n.now(),t=e-ws;t>Mu&&(Hs-=t,ws=e)}function VE(){for(var e,t=bs,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:bs=n);En=e,Yo(s)}function Yo(e){if(!en){jn&&(jn=clearTimeout(jn));var t=e-Pt;t>24?(e<1/0&&(jn=setTimeout(Ui,e-_n.now()-Hs)),mn&&(mn=clearInterval(mn))):(mn||(ws=_n.now(),mn=setInterval(zE,Mu)),en=1,Tu(Ui))}}function Wi(e,t,n){var s=new vs;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,n),s}var FE=Vs("start","end","cancel","interrupt"),HE=[],Pu=0,Xi=1,Go=2,cs=3,qi=4,Uo=5,us=6;function Zs(e,t,n,s,o,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;ZE(e,n,{name:t,index:s,group:o,on:FE,tween:HE,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Pu})}function Wr(e,t){var n=Je(e,t);if(n.state>Pu)throw new Error("too late; already scheduled");return n}function st(e,t){var n=Je(e,t);if(n.state>cs)throw new Error("too late; already running");return n}function Je(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ZE(e,t,n){var s=e.__transition,o;s[t]=n,n.timer=Lu(i,0,n.time);function i(d){n.state=Xi,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!==Xi)return c();for(x in s)if(h=s[x],h.name===n.name){if(h.state===cs)return Wi(l);h.state===qi?(h.state=us,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete s[x]):+x<t&&(h.state=us,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete s[x])}if(Wi(function(){n.state===cs&&(n.state=qi,n.timer.restart(a,n.delay,n.time),a(d))}),n.state=Go,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Go){for(n.state=cs,o=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))&&(o[++p]=h);o.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=Uo,1),p=-1,m=o.length;++p<m;)o[p].call(e,x);n.state===Uo&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=us,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function ds(e,t){var n=e.__transition,s,o,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){i=!1;continue}o=s.state>Go&&s.state<Uo,s.state=us,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function KE(e){return this.each(function(){ds(this,e)})}function YE(e,t){var n,s;return function(){var o=st(this,e),i=o.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}}o.tween=s}}function GE(e,t,n){var s,o;if(typeof n!="function")throw new Error;return function(){var i=st(this,e),l=i.tween;if(l!==s){o=(s=l).slice();for(var a={name:t,value:n},c=0,d=o.length;c<d;++c)if(o[c].name===t){o[c]=a;break}c===d&&o.push(a)}i.tween=o}}function UE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=Je(this.node(),n).tween,o=0,i=s.length,l;o<i;++o)if((l=s[o]).name===e)return l.value;return null}return this.each((t==null?YE:GE)(n,e,t))}function Xr(e,t,n){var s=e._id;return e.each(function(){var o=st(this,s);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Je(o,s).value[t]}}function Nu(e,t){var n;return(typeof t=="number"?O.interpolateNumber:t instanceof O.color?O.interpolateRgb:(n=O.color(t))?(t=n,O.interpolateRgb):O.interpolateString)(e,t)}function WE(e){return function(){this.removeAttribute(e)}}function XE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qE(e,t,n){var s,o=n+"",i;return function(){var l=this.getAttribute(e);return l===o?null:l===s?i:i=t(s=l,n)}}function QE(e,t,n){var s,o=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===s?i:i=t(s=l,n)}}function JE(e,t,n){var s,o,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===o?i:(o=c,i=t(s=l,a)))}}function e3(e,t,n){var s,o,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===o?i:(o=c,i=t(s=l,a)))}}function t3(e,t){var n=Fs(e),s=n==="transform"?Sh:Nu;return this.attrTween(e,typeof t=="function"?(n.local?e3:JE)(n,s,Xr(this,"attr."+e,t)):t==null?(n.local?XE:WE)(n):(n.local?QE:qE)(n,s,t))}function n3(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function s3(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function o3(e,t){var n,s;function o(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&s3(e,i)),n}return o._value=t,o}function r3(e,t){var n,s;function o(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&n3(e,i)),n}return o._value=t,o}function i3(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=Fs(e);return this.tween(n,(s.local?o3:r3)(s,t))}function l3(e,t){return function(){Wr(this,e).delay=+t.apply(this,arguments)}}function a3(e,t){return t=+t,function(){Wr(this,e).delay=t}}function c3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?l3:a3)(t,e)):Je(this.node(),t).delay}function u3(e,t){return function(){st(this,e).duration=+t.apply(this,arguments)}}function d3(e,t){return t=+t,function(){st(this,e).duration=t}}function x3(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?u3:d3)(t,e)):Je(this.node(),t).duration}function p3(e,t){if(typeof t!="function")throw new Error;return function(){st(this,e).ease=t}}function m3(e){var t=this._id;return arguments.length?this.each(p3(t,e)):Je(this.node(),t).ease}function f3(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;st(this,e).ease=n}}function h3(e){if(typeof e!="function")throw new Error;return this.each(f3(this._id,e))}function g3(e){typeof e!="function"&&(e=hu(e));for(var t=this._groups,n=t.length,s=new Array(n),o=0;o<n;++o)for(var i=t[o],l=i.length,a=s[o]=[],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 j3(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,o=n.length,i=Math.min(s,o),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 E3(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 y3(e,t,n){var s,o,i=E3(t)?Wr:st;return function(){var l=i(this,e),a=l.on;a!==s&&(o=(s=a).copy()).on(t,n),l.on=o}}function S3(e,t){var n=this._id;return arguments.length<2?Je(this.node(),n).on.on(e):this.each(y3(n,e,t))}function R3(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function C3(){return this.on("end.remove",R3(this._id))}function b3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yr(e));for(var s=this._groups,o=s.length,i=new Array(o),l=0;l<o;++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,Zs(d[m],t,n,m,d,Je(x,n)));return new at(i,this._parents,t,n)}function w3(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fu(e));for(var s=this._groups,o=s.length,i=[],l=[],a=0;a<o;++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=Je(x,n),E=0,S=m.length;E<S;++E)(h=m[E])&&Zs(h,t,n,E,m,g);i.push(m),l.push(x)}return new at(i,l,t,n)}var v3=$n.prototype.constructor;function k3(){return new v3(this._groups,this._parents)}function _3(e,t){var n,s,o;return function(){var i=Jt(this,e),l=(this.style.removeProperty(e),Jt(this,e));return i===l?null:i===n&&l===s?o:o=t(n=i,s=l)}}function Au(e){return function(){this.style.removeProperty(e)}}function M3(e,t,n){var s,o=n+"",i;return function(){var l=Jt(this,e);return l===o?null:l===s?i:i=t(s=l,n)}}function T3(e,t,n){var s,o,i;return function(){var l=Jt(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Jt(this,e))),l===c?null:l===s&&c===o?i:(o=c,i=t(s=l,a))}}function L3(e,t){var n,s,o,i="style."+t,l="end."+i,a;return function(){var c=st(this,e),d=c.on,x=c.value[i]==null?a||(a=Au(t)):void 0;(d!==n||o!==x)&&(s=(n=d).copy()).on(l,o=x),c.on=s}}function P3(e,t,n){var s=(e+="")=="transform"?yh:Nu;return t==null?this.styleTween(e,_3(e,s)).on("end.style."+e,Au(e)):typeof t=="function"?this.styleTween(e,T3(e,s,Xr(this,"style."+e,t))).each(L3(this._id,e)):this.styleTween(e,M3(e,s,t),n).on("end.style."+e,null)}function N3(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function A3(e,t,n){var s,o;function i(){var l=t.apply(this,arguments);return l!==o&&(s=(o=l)&&N3(e,l,n)),s}return i._value=t,i}function O3(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,A3(e,t,n??""))}function I3(e){return function(){this.textContent=e}}function D3(e){return function(){var t=e(this);this.textContent=t??""}}function B3(e){return this.tween("text",typeof e=="function"?D3(Xr(this,"text",e)):I3(e==null?"":e+""))}function $3(e){return function(t){this.textContent=e.call(this,t)}}function z3(e){var t,n;function s(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&$3(o)),t}return s._value=e,s}function V3(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,z3(e))}function F3(){for(var e=this._name,t=this._id,n=Ou(),s=this._groups,o=s.length,i=0;i<o;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)if(c=l[d]){var x=Je(c,t);Zs(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 H3(){var e,t,n=this,s=n._id,o=n.size();return new Promise(function(i,l){var a={value:l},c={value:function(){--o===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}),o===0&&i()})}var Z3=0;function at(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Ou(){return++Z3}var ot=$n.prototype;at.prototype={constructor:at,select:b3,selectAll:w3,selectChild:ot.selectChild,selectChildren:ot.selectChildren,filter:g3,merge:j3,selection:k3,transition:F3,call:ot.call,nodes:ot.nodes,node:ot.node,size:ot.size,empty:ot.empty,each:ot.each,on:S3,attr:t3,attrTween:i3,style:P3,styleTween:O3,text:B3,textTween:V3,remove:C3,tween:UE,delay:c3,duration:x3,ease:m3,easeVarying:h3,end:H3,[Symbol.iterator]:ot[Symbol.iterator]};function K3(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Y3={time:null,delay:0,duration:250,ease:K3};function G3(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 U3(e){var t,n;e instanceof at?(t=e._id,e=e._name):(t=Ou(),(n=Y3).time=Ur(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,i=0;i<o;++i)for(var l=s[i],a=l.length,c,d=0;d<a;++d)(c=l[d])&&Zs(c,e,t,d,l,n||G3(c,t));return new at(s,this._parents,e,t)}$n.prototype.interrupt=KE;$n.prototype.transition=U3;const Qn=e=>()=>e;function W3(e,{sourceEvent:t,target:n,transform:s,dispatch:o}){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:o}})}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 Ks=new it(1,0,0);Iu.prototype=it.prototype;function Iu(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ks;return e.__zoom}function Eo(e){e.stopImmediatePropagation()}function fn(e){e.preventDefault(),e.stopImmediatePropagation()}function X3(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function q3(){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 Qi(){return this.__zoom||Ks}function Q3(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function J3(){return navigator.maxTouchPoints||"ontouchstart"in this}function ey(e,t,n){var s=e.invertX(t[0][0])-n[0][0],o=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(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function Du(){var e=X3,t=q3,n=ey,s=Q3,o=J3,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],a=250,c=ls,d=Vs("start","zoom","end"),x,p,m,h=500,g=150,E=0,S=10;function R(b){b.property("__zoom",Qi).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",F).filter(o).on("touchstart.zoom",$).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}R.transform=function(b,P,_,L){var V=b.selection?b.selection():b;V.property("__zoom",Qi),b!==V?k(b,P,_,L):V.interrupt().each(function(){T(this,arguments).event(L).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},R.scaleBy=function(b,P,_,L){R.scaleTo(b,function(){var V=this.__zoom.k,H=typeof P=="function"?P.apply(this,arguments):P;return V*H},_,L)},R.scaleTo=function(b,P,_,L){R.transform(b,function(){var V=t.apply(this,arguments),H=this.__zoom,K=_==null?C(V):typeof _=="function"?_.apply(this,arguments):_,Z=H.invert(K),G=typeof P=="function"?P.apply(this,arguments):P;return n(y(v(H,G),K,Z),V,l)},_,L)},R.translateBy=function(b,P,_,L){R.transform(b,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),l)},null,L)},R.translateTo=function(b,P,_,L,V){R.transform(b,function(){var H=t.apply(this,arguments),K=this.__zoom,Z=L==null?C(H):typeof L=="function"?L.apply(this,arguments):L;return n(Ks.translate(Z[0],Z[1]).scale(K.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof _=="function"?-_.apply(this,arguments):-_),H,l)},L,V)};function v(b,P){return P=Math.max(i[0],Math.min(i[1],P)),P===b.k?b:new it(P,b.x,b.y)}function y(b,P,_){var L=P[0]-_[0]*b.k,V=P[1]-_[1]*b.k;return L===b.x&&V===b.y?b:new it(b.k,L,V)}function C(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function k(b,P,_,L){b.on("start.zoom",function(){T(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(L).end()}).tween("zoom",function(){var V=this,H=arguments,K=T(V,H).event(L),Z=t.apply(V,H),G=_==null?C(Z):typeof _=="function"?_.apply(V,H):_,Q=Math.max(Z[1][0]-Z[0][0],Z[1][1]-Z[0][1]),ee=V.__zoom,ae=typeof P=="function"?P.apply(V,H):P,re=c(ee.invert(G).concat(Q/ee.k),ae.invert(G).concat(Q/ae.k));return function(se){if(se===1)se=ae;else{var te=re(se),le=Q/te[2];se=new it(le,G[0]-te[0]*le,G[1]-te[1]*le)}K.zoom(null,se)}})}function T(b,P,_){return!_&&b.__zooming||new N(b,P)}function N(b,P){this.that=b,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,P),this.taps=0}N.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,P){return this.mouse&&b!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var P=He(this.that).datum();d.call(b,this.that,new W3(b,{sourceEvent:this.sourceEvent,target:R,transform:this.that.__zoom,dispatch:d}),P)}};function I(b,...P){if(!e.apply(this,arguments))return;var _=T(this,P).event(b),L=this.__zoom,V=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,s.apply(this,arguments)))),H=We(b);if(_.wheel)(_.mouse[0][0]!==H[0]||_.mouse[0][1]!==H[1])&&(_.mouse[1]=L.invert(_.mouse[0]=H)),clearTimeout(_.wheel);else{if(L.k===V)return;_.mouse=[H,L.invert(H)],ds(this),_.start()}fn(b),_.wheel=setTimeout(K,g),_.zoom("mouse",n(y(v(L,V),_.mouse[0],_.mouse[1]),_.extent,l));function K(){_.wheel=null,_.end()}}function B(b,...P){if(m||!e.apply(this,arguments))return;var _=b.currentTarget,L=T(this,P,!0).event(b),V=He(b.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",Q,!0),H=We(b,_),K=b.clientX,Z=b.clientY;vu(b.view),Eo(b),L.mouse=[H,this.__zoom.invert(H)],ds(this),L.start();function G(ee){if(fn(ee),!L.moved){var ae=ee.clientX-K,re=ee.clientY-Z;L.moved=ae*ae+re*re>E}L.event(ee).zoom("mouse",n(y(L.that.__zoom,L.mouse[0]=We(ee,_),L.mouse[1]),L.extent,l))}function Q(ee){V.on("mousemove.zoom mouseup.zoom",null),ku(ee.view,L.moved),fn(ee),L.event(ee).end()}}function F(b,...P){if(e.apply(this,arguments)){var _=this.__zoom,L=We(b.changedTouches?b.changedTouches[0]:b,this),V=_.invert(L),H=_.k*(b.shiftKey?.5:2),K=n(y(v(_,H),L,V),t.apply(this,P),l);fn(b),a>0?He(this).transition().duration(a).call(k,K,L,b):He(this).call(R.transform,K,L,b)}}function $(b,...P){if(e.apply(this,arguments)){var _=b.touches,L=_.length,V=T(this,P,b.changedTouches.length===L).event(b),H,K,Z,G;for(Eo(b),K=0;K<L;++K)Z=_[K],G=We(Z,this),G=[G,this.__zoom.invert(G),Z.identifier],V.touch0?!V.touch1&&V.touch0[2]!==G[2]&&(V.touch1=G,V.taps=0):(V.touch0=G,H=!0,V.taps=1+!!x);x&&(x=clearTimeout(x)),H&&(V.taps<2&&(p=G[0],x=setTimeout(function(){x=null},h)),ds(this),V.start())}}function D(b,...P){if(this.__zooming){var _=T(this,P).event(b),L=b.changedTouches,V=L.length,H,K,Z,G;for(fn(b),H=0;H<V;++H)K=L[H],Z=We(K,this),_.touch0&&_.touch0[2]===K.identifier?_.touch0[0]=Z:_.touch1&&_.touch1[2]===K.identifier&&(_.touch1[0]=Z);if(K=_.that.__zoom,_.touch1){var Q=_.touch0[0],ee=_.touch0[1],ae=_.touch1[0],re=_.touch1[1],se=(se=ae[0]-Q[0])*se+(se=ae[1]-Q[1])*se,te=(te=re[0]-ee[0])*te+(te=re[1]-ee[1])*te;K=v(K,Math.sqrt(se/te)),Z=[(Q[0]+ae[0])/2,(Q[1]+ae[1])/2],G=[(ee[0]+re[0])/2,(ee[1]+re[1])/2]}else if(_.touch0)Z=_.touch0[0],G=_.touch0[1];else return;_.zoom("touch",n(y(K,Z,G),_.extent,l))}}function z(b,...P){if(this.__zooming){var _=T(this,P).event(b),L=b.changedTouches,V=L.length,H,K;for(Eo(b),m&&clearTimeout(m),m=setTimeout(function(){m=null},h),H=0;H<V;++H)K=L[H],_.touch0&&_.touch0[2]===K.identifier?delete _.touch0:_.touch1&&_.touch1[2]===K.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(K=We(K,this),Math.hypot(p[0]-K[0],p[1]-K[1])<S)){var Z=He(this).on("dblclick.zoom");Z&&Z.apply(this,arguments)}}}return R.wheelDelta=function(b){return arguments.length?(s=typeof b=="function"?b:Qn(+b),R):s},R.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Qn(!!b),R):e},R.touchable=function(b){return arguments.length?(o=typeof b=="function"?b:Qn(!!b),R):o},R.extent=function(b){return arguments.length?(t=typeof b=="function"?b:Qn([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),R):t},R.scaleExtent=function(b){return arguments.length?(i[0]=+b[0],i[1]=+b[1],R):[i[0],i[1]]},R.translateExtent=function(b){return arguments.length?(l[0][0]=+b[0][0],l[1][0]=+b[1][0],l[0][1]=+b[0][1],l[1][1]=+b[1][1],R):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},R.constrain=function(b){return arguments.length?(n=b,R):n},R.duration=function(b){return arguments.length?(a=+b,R):a},R.interpolate=function(b){return arguments.length?(c=b,R):c},R.on=function(){var b=d.on.apply(d,arguments);return b===d?R:b},R.clickDistance=function(b){return arguments.length?(E=(b=+b)*b,R):Math.sqrt(E)},R.tapDistance=function(b){return arguments.length?(S=+b,R):S},R}const Oe={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."},Mn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Bu=["Enter"," ","Escape"],$u={"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 wt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(wt||(wt={}));var tn;(function(e){e.Partial="partial",e.Full="full"})(tn||(tn={}));const zu={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 ks;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ks||(ks={}));var J;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(J||(J={}));const Ji={[J.Left]:J.Right,[J.Right]:J.Left,[J.Top]:J.Bottom,[J.Bottom]:J.Top};function Vu(e){return e===null?null:e?"valid":"invalid"}const Fu=e=>"id"in e&&"source"in e&&"target"in e,ty=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),qr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),zn=(e,t=[0,0])=>{const{width:n,height:s}=dt(e),o=e.origin??t,i=n*o[0],l=s*o[1];return{x:e.position.x-i,y:e.position.y-l}},ny=(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,o)=>{const i=typeof o=="string";let l=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(o):qr(o)?o:t.nodeLookup.get(o.id));const a=l?_s(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ys(s,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Gs(n)},Vn=(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 o=_s(s);n=Ys(n,o)}}),Gs(n)},Qr=(e,t,[n,s,o]=[0,0,1],i=!1,l=!1)=>{const a={...Fn(t,[n,s,o]),width:t.width/o,height:t.height/o},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=Tn(a,sn(d)),S=(h??0)*(g??0),R=i&&E>0;(!d.internals.handleBounds||R||E>=S||d.dragging)&&c.push(d)}return c},sy=(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 oy(e,t){const n=new Map,s=t?.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(t?.includeHiddenNodes||!o.hidden)&&(!s||s.has(o.id))&&n.set(o.id,o)}),n}async function ry({nodes:e,width:t,height:n,panZoom:s,minZoom:o,maxZoom:i},l){if(e.size===0)return Promise.resolve(!0);const a=oy(e,l),c=Vn(a),d=Jr(c,t,n,l?.minZoom??o,l?.maxZoom??i,l?.padding??.1);return await s.setViewport(d,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function Hu({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:o,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=o;if(l.extent==="parent"&&!l.expandParent)if(!a)i?.("005",Oe.error005());else{const h=a.measured.width,g=a.measured.height;h&&g&&(p=[[c,d],[c+h,d+g]])}else a&&on(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=on(p)?At(t,p,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&i?.("015",Oe.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 iy({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:o}){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=sy(l,c);for(const m of c)a.has(m.id)&&!x.find(g=>g.id===m.id)&&x.push(m);if(!o)return{edges:x,nodes:l};const p=await o({nodes:l,edges:x});return typeof p=="boolean"?p?{edges:x,nodes:l}:{edges:[],nodes:[]}:p}const nn=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),At=(e={x:0,y:0},t,n)=>({x:nn(e.x,t[0][0],t[1][0]-(n?.width??0)),y:nn(e.y,t[0][1],t[1][1]-(n?.height??0))});function Zu(e,t,n){const{width:s,height:o}=dt(n),{x:i,y:l}=n.internals.positionAbsolute;return At(e,[[i,l],[i+s,l+o]],t)}const el=(e,t,n)=>e<t?nn(Math.abs(e-t),1,t)/t:e>n?-nn(Math.abs(e-n),1,t)/t:0,Ku=(e,t,n=15,s=40)=>{const o=el(e.x,s,t.width-s)*n,i=el(e.y,s,t.height-s)*n;return[o,i]},Ys=(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)}),Wo=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Gs=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),sn=(e,t=[0,0])=>{const{x:n,y:s}=qr(e)?e.internals.positionAbsolute:zn(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}},_s=(e,t=[0,0])=>{const{x:n,y:s}=qr(e)?e.internals.positionAbsolute:zn(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)}},Yu=(e,t)=>Gs(Ys(Wo(e),Wo(t))),Tn=(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)},tl=e=>Xe(e.width)&&Xe(e.height)&&Xe(e.x)&&Xe(e.y),Xe=e=>!isNaN(e)&&isFinite(e),Ms=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},Us=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Fn=({x:e,y:t},[n,s,o],i=!1,l=[1,1])=>{const a={x:(e-n)/o,y:(t-s)/o};return i?Us(a,l):a},Ts=({x:e,y:t},[n,s,o])=>({x:e*o+n,y:t*o+s});function Kt(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 ly(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=Kt(e,n),o=Kt(e,t);return{top:s,right:o,bottom:s,left:o,x:o*2,y:s*2}}if(typeof e=="object"){const s=Kt(e.top??e.y??0,n),o=Kt(e.bottom??e.y??0,n),i=Kt(e.left??e.x??0,t),l=Kt(e.right??e.x??0,t);return{top:s,right:l,bottom:o,left:i,x:i+l,y:s+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ay(e,t,n,s,o,i){const{x:l,y:a}=Ts(e,[t,n,s]),{x:c,y:d}=Ts({x:e.x+e.width,y:e.y+e.height},[t,n,s]),x=o-c,p=i-d;return{left:Math.floor(l),top:Math.floor(a),right:Math.floor(x),bottom:Math.floor(p)}}const Jr=(e,t,n,s,o,i)=>{const l=ly(i,t,n),a=(t-l.x)/e.width,c=(n-l.y)/e.height,d=Math.min(a,c),x=nn(d,s,o),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}},Ls=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function on(e){return e!==void 0&&e!=="parent"}function dt(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Gu(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Uu(e,t={width:0,height:0},n,s,o){const i={...e},l=s.get(n);if(l){const a=l.origin||o;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 nl(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function cy(){let e,t;return{promise:new Promise((s,o)=>{e=s,t=o}),resolve:e,reject:t}}function uy(e){return{...$u,...e||{}}}function Rn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:o}){const{x:i,y:l}=tt(e),a=Fn({x:i-(o?.left??0),y:l-(o?.top??0)},s),{x:c,y:d}=n?Us(a,t):a;return{xSnapped:c,ySnapped:d,...a}}const ei=e=>({width:e.offsetWidth,height:e.offsetHeight}),Wu=e=>e?.getRootNode?.()||window?.document,dy=["INPUT","SELECT","TEXTAREA"];function Xu(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:dy.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const qu=e=>"clientX"in e,tt=(e,t)=>{const n=qu(e),s=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:s-(t?.left??0),y:o-(t?.top??0)}},sl=(e,t,n,s,o)=>{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:o,position:l.getAttribute("data-handlepos"),x:(a.left-n.left)/s,y:(a.top-n.top)/s,...ei(l)}})};function Qu({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:o,sourceControlY:i,targetControlX:l,targetControlY:a}){const c=e*.125+o*.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 Jn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ol({pos:e,x1:t,y1:n,x2:s,y2:o,c:i}){switch(e){case J.Left:return[t-Jn(t-s,i),n];case J.Right:return[t+Jn(s-t,i),n];case J.Top:return[t,n-Jn(n-o,i)];case J.Bottom:return[t,n+Jn(o-n,i)]}}function Ju({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:s,targetY:o,targetPosition:i=J.Top,curvature:l=.25}){const[a,c]=ol({pos:n,x1:e,y1:t,x2:s,y2:o,c:l}),[d,x]=ol({pos:i,x1:s,y1:o,x2:e,y2:t,c:l}),[p,m,h,g]=Qu({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:a,sourceControlY:c,targetControlX:d,targetControlY:x});return[`M${e},${t} C${a},${c} ${d},${x} ${s},${o}`,p,m,h,g]}function ed({sourceX:e,sourceY:t,targetX:n,targetY:s}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,l=Math.abs(s-t)/2,a=s<t?s+l:s-l;return[i,a,o,l]}function xy({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s,elevateOnSelect:o=!1}){if(s!==void 0)return s;const i=o&&n?1e3:0,l=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return i+l}function py({sourceNode:e,targetNode:t,width:n,height:s,transform:o}){const i=Ys(_s(e),_s(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:s/o[2]};return Tn(l,Gs(i))>0}const td=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,my=(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)),nd=(e,t)=>{if(!e.source||!e.target)return Ms("006",Oe.error006()),t;let n;return Fu(e)?n={...e}:n={...e,id:td(e)},my(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:o,...i}=e;if(!t.source||!t.target)return Ms("006",Oe.error006()),n;if(!n.find(c=>c.id===e.id))return Ms("007",Oe.error007(o)),n;const a={...i,id:s.shouldReplaceId?td(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(c=>c.id!==o).concat(a)};function sd({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[o,i,l,a]=ed({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,o,i,l,a]}const rl={[J.Left]:{x:-1,y:0},[J.Right]:{x:1,y:0},[J.Top]:{x:0,y:-1},[J.Bottom]:{x:0,y:1}},hy=({source:e,sourcePosition:t=J.Bottom,target:n})=>t===J.Left||t===J.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},il=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function gy({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:s=J.Top,center:o,offset:i}){const l=rl[t],a=rl[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,k]=ed({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*a[p]===-1){g=o.x??v,E=o.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 z=Math.abs(e[p]-n[p]);if(z<=i){const b=Math.min(i-1,i-z);l[p]===m?S[p]=(c[p]>e[p]?-1:1)*b:R[p]=(d[p]>n[p]?-1:1)*b}}if(t!==s){const z=p==="x"?"y":"x",b=l[p]===a[z],P=c[z]>d[z],_=c[z]<d[z];(l[p]===1&&(!b&&P||b&&_)||l[p]!==1&&(!b&&_||b&&P))&&(h=p==="x"?N:I)}const B={x:c.x+S.x,y:c.y+S.y},F={x:d.x+R.x,y:d.y+R.y},$=Math.max(Math.abs(B.x-h[0].x),Math.abs(F.x-h[0].x)),D=Math.max(Math.abs(B.y-h[0].y),Math.abs(F.y-h[0].y));$>=D?(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,k]}function jy(e,t,n,s){const o=Math.min(il(e,t)/2,il(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+o*d},${l}Q ${i},${l} ${i},${l+o*x}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${l+o*c}Q ${i},${l} ${i+o*a},${l}`}function Xo({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:s,targetY:o,targetPosition:i=J.Top,borderRadius:l=5,centerX:a,centerY:c,offset:d=20}){const[x,p,m,h,g]=gy({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:o},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=jy(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 ll(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Ey(e){const{sourceNode:t,targetNode:n}=e;if(!ll(t)||!ll(n))return null;const s=t.internals.handleBounds||al(t.handles),o=n.internals.handleBounds||al(n.handles),i=cl(s?.source??[],e.sourceHandle),l=cl(e.connectionMode===Nt.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!i||!l)return e.onError?.("008",Oe.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||J.Bottom,c=l?.position||J.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 al(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=J.Left,s=!1){const o=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:l,height:a}=t??dt(e);if(s)return{x:o+l/2,y:i+a/2};switch(t?.position??n){case J.Top:return{x:o+l/2,y:i};case J.Right:return{x:o+l,y:i+a/2};case J.Bottom:return{x:o+l/2,y:i+a};case J.Left:return{x:o,y:i+a/2}}}function cl(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function qo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function yy(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:o}){const i=new Set;return e.reduce((l,a)=>([a.markerStart||s,a.markerEnd||o].forEach(c=>{if(c&&typeof c=="object"){const d=qo(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 ti={nodeOrigin:[0,0],nodeExtent:Mn,elevateNodesOnSelect:!0,defaults:{}},Sy={...ti,checkEquality:!0};function ni(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Ry(e,t,n){const s=ni(ti,n);for(const o of e.values())if(o.parentId)si(o,e,t,s);else{const i=zn(o,s.nodeOrigin),l=on(o.extent)?o.extent:s.nodeExtent,a=At(i,l,dt(o));o.internals.positionAbsolute=a}}function Qo(e,t,n,s){const o=ni(Sy,s);let i=e.length>0;const l=new Map(t),a=o?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let d=l.get(c.id);if(o.checkEquality&&c===d?.internals.userNode)t.set(c.id,d);else{const x=zn(c,o.nodeOrigin),p=on(c.extent)?c.extent:o.nodeExtent,m=At(x,p,dt(c));d={...o.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:m,handleBounds:c.measured?d?.internals.handleBounds:void 0,z:od(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&&si(d,t,n,s)}return i}function Cy(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 si(e,t,n,s){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:l}=ni(ti,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}Cy(e,n);const d=o?1e3:0,{x,y:p,z:m}=by(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 od(e,t){return(Xe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function by(e,t,n,s,o){const{x:i,y:l}=t.internals.positionAbsolute,a=dt(e),c=zn(e,n),d=on(e.extent)?At(c,e.extent,a):c;let x=At({x:i+d.x,y:l+d.y},s,a);e.extent==="parent"&&(x=Zu(x,a,t));const p=od(e,o),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>=p?m+1:p}}function oi(e,t,n,s=[0,0]){const o=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const c=i.get(l.parentId)?.expandedRect??sn(a),d=Yu(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=dt(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)&&(o.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)||o.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)&&o.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:g+(m?p[0]*m-S:0),height:E+(h?p[1]*h-R:0)}})}),o}function wy(e,t,n,s,o,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=ei(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=on(h.extent)?h.extent:i;let{positionAbsolute:y}=h.internals;h.parentId&&h.extent==="parent"?y=Zu(y,g,t.get(h.parentId)):v&&(y=At(y,v,g));const C={...h,measured:g,internals:{...h.internals,positionAbsolute:y,handleBounds:{source:sl("source",m.nodeElement,R,x,h.id),target:sl("target",m.nodeElement,R,x,h.id)}}};t.set(h.id,C),h.parentId&&si(C,t,n,{nodeOrigin:o}),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:sn(C,o)}))}}if(p.length>0){const m=oi(p,t,n,o);c.push(...m)}return{changes:c,updatedInternals:a}}async function vy({delta:e,panZoom:t,transform:n,translateExtent:s,width:o,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],[o,i]],s),a=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(a)}function ul(e,t,n,s,o,i){let l=o;const a=s.get(l)||new Map;s.set(l,a.set(n,t)),l=`${o}-${e}`;const c=s.get(l)||new Map;if(s.set(l,c.set(n,t)),i){l=`${o}-${e}-${i}`;const d=s.get(l)||new Map;s.set(l,d.set(n,t))}}function rd(e,t,n){e.clear(),t.clear();for(const s of n){const{source:o,target:i,sourceHandle:l=null,targetHandle:a=null}=s,c={edgeId:s.id,source:o,target:i,sourceHandle:l,targetHandle:a},d=`${o}-${l}--${i}-${a}`,x=`${i}-${a}--${o}-${l}`;ul("source",c,x,e,o,l),ul("target",c,d,e,i,a),t.set(s.id,s)}}function id(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:id(n,t):!1}function dl(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 ky(e,t,n,s){const o=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!id(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const a=e.get(i);a&&o.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 o}function yo({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){const o=[];for(const[l,a]of t){const c=n.get(l)?.internals.userNode;c&&o.push({...c,position:a.position,dragging:s})}if(!e)return[o[0],o];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:s}:o[0],o]}function _y({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:o}){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:k,nodeClickDistance:T=0}){m=He(y);function N({x:$,y:D},z){const{nodeLookup:b,nodeExtent:P,snapGrid:_,snapToGrid:L,nodeOrigin:V,onNodeDrag:H,onSelectionDrag:K,onError:Z,updateNodePositions:G}=t();i={x:$,y:D};let Q=!1,ee={x:0,y:0,x2:0,y2:0};if(a.size>1&&P){const ae=Vn(a);ee=Wo(ae)}for(const[ae,re]of a){if(!b.has(ae))continue;let se={x:$-re.distance.x,y:D-re.distance.y};L&&(se=Us(se,_));let te=[[P[0][0],P[0][1]],[P[1][0],P[1][1]]];if(a.size>1&&P&&!re.extent){const{positionAbsolute:Ce}=re.internals,ue=Ce.x-ee.x+P[0][0],me=Ce.x+re.measured.width-ee.x2+P[1][0],X=Ce.y-ee.y+P[0][1],de=Ce.y+re.measured.height-ee.y2+P[1][1];te=[[ue,X],[me,de]]}const{position:le,positionAbsolute:Re}=Hu({nodeId:ae,nextPosition:se,nodeLookup:b,nodeExtent:te,nodeOrigin:V,onError:Z});Q=Q||re.position.x!==le.x||re.position.y!==le.y,re.position=le,re.internals.positionAbsolute=Re}if(g=g||Q,!!Q&&(G(a,!0),z&&(s||H||!k&&K))){const[ae,re]=yo({nodeId:k,dragItems:a,nodeLookup:b});s?.(z,a,ae,re),H?.(z,ae,re),k||K?.(z,re)}}async function I(){if(!x)return;const{transform:$,panBy:D,autoPanSpeed:z,autoPanOnNodeDrag:b}=t();if(!b){c=!1,cancelAnimationFrame(l);return}const[P,_]=Ku(d,x,z);(P!==0||_!==0)&&(i.x=(i.x??0)-P/$[2],i.y=(i.y??0)-_/$[2],await D({x:P,y:_})&&N(i,null)),l=requestAnimationFrame(I)}function B($){const{nodeLookup:D,multiSelectionActive:z,nodesDraggable:b,transform:P,snapGrid:_,snapToGrid:L,selectNodesOnDrag:V,onNodeDragStart:H,onSelectionDragStart:K,unselectNodesAndEdges:Z}=t();p=!0,(!V||!C)&&!z&&k&&(D.get(k)?.selected||Z()),C&&V&&k&&e?.(k);const G=Rn($.sourceEvent,{transform:P,snapGrid:_,snapToGrid:L,containerBounds:x});if(i=G,a=ky(D,b,G,k),a.size>0&&(n||H||!k&&K)){const[Q,ee]=yo({nodeId:k,dragItems:a,nodeLookup:D});n?.($.sourceEvent,a,Q,ee),H?.($.sourceEvent,Q,ee),k||K?.($.sourceEvent,ee)}}const F=_u().clickDistance(T).on("start",$=>{const{domNode:D,nodeDragThreshold:z,transform:b,snapGrid:P,snapToGrid:_}=t();x=D?.getBoundingClientRect()||null,h=!1,g=!1,z===0&&B($),i=Rn($.sourceEvent,{transform:b,snapGrid:P,snapToGrid:_,containerBounds:x}),d=tt($.sourceEvent,x)}).on("drag",$=>{const{autoPanOnNodeDrag:D,transform:z,snapGrid:b,snapToGrid:P,nodeDragThreshold:_,nodeLookup:L}=t(),V=Rn($.sourceEvent,{transform:z,snapGrid:b,snapToGrid:P,containerBounds:x});if(($.sourceEvent.type==="touchmove"&&$.sourceEvent.touches.length>1||k&&!L.has(k))&&(h=!0),!h){if(!c&&D&&p&&(c=!0,I()),!p){const H=V.xSnapped-(i.x??0),K=V.ySnapped-(i.y??0);Math.sqrt(H*H+K*K)>_&&B($)}(i.x!==V.xSnapped||i.y!==V.ySnapped)&&a&&p&&(d=tt($.sourceEvent,x),N(V,$.sourceEvent))}}).on("end",$=>{if(!(!p||h)&&(c=!1,p=!1,cancelAnimationFrame(l),a.size>0)){const{nodeLookup:D,updateNodePositions:z,onNodeDragStop:b,onSelectionDragStop:P}=t();if(g&&(z(a,!1),g=!1),o||b||!k&&P){const[_,L]=yo({nodeId:k,dragItems:a,nodeLookup:D,dragging:!1});o?.($.sourceEvent,a,_,L),b?.($.sourceEvent,_,L),k||P?.($.sourceEvent,L)}}}).filter($=>{const D=$.target;return!$.button&&(!R||!dl(D,`.${R}`,y))&&(!v||dl(D,v,y))});m.call(F)}function S(){m?.on(".drag",null)}return{update:E,destroy:S}}function My(e,t,n){const s=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Tn(o,sn(i))>0&&s.push(i);return s}const Ty=250;function Ly(e,t,n,s){let o=[],i=1/0;const l=My(e,n,t+Ty);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?(o=[{...d,x,y:p}],i=m):m===i&&o.push({...d,x,y:p}))}}if(!o.length)return null;if(o.length>1){const a=s.type==="source"?"target":"source";return o.find(c=>c.type===a)??o[0]}return o[0]}function ld(e,t,n,s,o,i=!1){const l=s.get(e);if(!l)return null;const a=o==="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 ad(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Py(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const cd=()=>!0;function Ny(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:o,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=cd,onReconnectEnd:v,updateConnection:y,getTransform:C,getFromHandle:k,autoPanSpeed:T,dragThreshold:N=1}){const I=Wu(e.target);let B=0,F;const{x:$,y:D}=tt(e),z=I?.elementFromPoint($,D),b=ad(i,z),P=a?.getBoundingClientRect();let _=!1;if(!P||!b)return;const L=ld(o,b,s,c,t);if(!L)return;let V=tt(e,P),H=!1,K=null,Z=!1,G=null;function Q(){if(!x||!P)return;const[Ce,ue]=Ku(V,P,T);m({x:Ce,y:ue}),B=requestAnimationFrame(Q)}const ee={...L,nodeId:o,type:b,position:L.position},ae=c.get(o);let se={inProgress:!0,isValid:null,from:Ln(ae,ee,J.Left,!0),fromHandle:ee,fromPosition:ee.position,fromNode:ae,to:V,toHandle:null,toPosition:Ji[ee.position],toNode:null};function te(){_=!0,y(se),g?.(e,{nodeId:o,handleId:s,handleType:b})}N===0&&te();function le(Ce){if(!_){const{x:de,y:we}=tt(Ce),Ne=de-$,et=we-D;if(!(Ne*Ne+et*et>N*N))return;te()}if(!k()||!ee){Re(Ce);return}const ue=C();V=tt(Ce,P),F=Ly(Fn(V,ue,!1,[1,1]),n,c,ee),H||(Q(),H=!0);const me=ud(Ce,{handle:F,connectionMode:t,fromNodeId:o,fromHandleId:s,fromType:l?"target":"source",isValidConnection:R,doc:I,lib:d,flowId:p,nodeLookup:c});G=me.handleDomNode,K=me.connection,Z=Py(!!F,me.isValid);const X={...se,isValid:Z,to:me.toHandle&&Z?Ts({x:me.toHandle.x,y:me.toHandle.y},ue):V,toHandle:me.toHandle,toPosition:Z&&me.toHandle?me.toHandle.position:Ji[ee.position],toNode:me.toHandle?c.get(me.toHandle.nodeId):null};Z&&F&&se.toHandle&&X.toHandle&&se.toHandle.type===X.toHandle.type&&se.toHandle.nodeId===X.toHandle.nodeId&&se.toHandle.id===X.toHandle.id&&se.to.x===X.to.x&&se.to.y===X.to.y||(y(X),se=X)}function Re(Ce){if(_){(F||G)&&K&&Z&&E?.(K);const{inProgress:ue,...me}=se,X={...me,toPosition:se.toHandle?se.toPosition:null};S?.(Ce,X),i&&v?.(Ce,X)}h(),cancelAnimationFrame(B),H=!1,Z=!1,K=null,G=null,I.removeEventListener("mousemove",le),I.removeEventListener("mouseup",Re),I.removeEventListener("touchmove",le),I.removeEventListener("touchend",Re)}I.addEventListener("mousemove",le),I.addEventListener("mouseup",Re),I.addEventListener("touchmove",le),I.addEventListener("touchend",Re)}function ud(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:o,fromType:i,doc:l,lib:a,flowId:c,isValidConnection:d=cd,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}=tt(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=ad(void 0,S),y=S.getAttribute("data-nodeid"),C=S.getAttribute("data-handleid"),k=S.classList.contains("connectable"),T=S.classList.contains("connectableend");if(!y||!v)return R;const N={source:p?y:s,sourceHandle:p?C:o,target:p?s:y,targetHandle:p?o:C};R.connection=N;const B=k&&T&&(n===Nt.Strict?p&&v==="source"||!p&&v==="target":y!==s||C!==o);R.isValid=B&&d(N),R.toHandle=ld(y,v,C,x,n,!0)}return R}const Jo={onPointerDown:Ny,isValid:ud};function Ay({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const o=He(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 k=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*x,T=C[2]*Math.pow(2,k);t.scaleTo(T)};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 k=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],T=[k[0]-E[0],k[1]-E[1]];E=k;const N=s()*Math.max(C[2],Math.log(C[2]))*(h?-1:1),I={x:C[0]-T[0]*N,y:C[1]-T[1]*N},B=[[0,0],[c,d]];t.setViewportConstrained({x:I.x,y:I.y,zoom:C[2]},B,a)},v=Du().on("start",S).on("zoom",p?R:null).on("zoom.wheel",m?g:null);o.call(v,{})}function l(){o.on("zoom",null)}return{update:i,destroy:l,pointer:We}}const Oy=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ws=e=>({x:e.x,y:e.y,zoom:e.k}),So=({x:e,y:t,zoom:n})=>Ks.translate(e,t).scale(n),Gt=(e,t)=>e.target.closest(`.${t}`),dd=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Iy=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ro=(e,t=0,n=Iy,s=()=>{})=>{const o=typeof t=="number"&&t>0;return o||s(),o?e.transition().duration(t).ease(n).on("end",s):e},xd=e=>{const t=e.ctrlKey&&Ls()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Dy({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:d}){return x=>{if(Gt(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const S=We(x),R=xd(x),v=p*Math.pow(2,R);s.scaleTo(n,v,S,x);return}const m=x.deltaMode===1?20:1;let h=o===wt.Vertical?0:x.deltaX*m,g=o===wt.Horizontal?0:x.deltaY*m;!Ls()&&x.shiftKey&&o!==wt.Vertical&&(h=x.deltaY*m,g=0),s.translateBy(n,-(h/p)*i,-(g/p)*i,{internal:!0});const E=Ws(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 By({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,o){const i=s.type==="wheel",l=!t&&i&&!s.ctrlKey,a=Gt(s,e);if(s.ctrlKey&&i&&a&&s.preventDefault(),l||a)return null;s.preventDefault(),n.call(this,s,o)}}function $y({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{if(s.sourceEvent?.internal)return;const o=Ws(s.transform);e.mouseButton=s.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,s.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(s.sourceEvent,o)}}function zy({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:o}){return i=>{e.usedRightMouseButton=!!(n&&dd(t,e.mouseButton??0)),i.sourceEvent?.sync||s([i.transform.x,i.transform.y,i.transform.k]),o&&!i.sourceEvent?.internal&&o?.(i.sourceEvent,Ws(i.transform))}}function Vy({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:i}){return l=>{if(!l.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&dd(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),o&&Oy(e.prevViewport,l.transform))){const a=Ws(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(l.sourceEvent,a)},n?150:0)}}}function Fy({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:o,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"&&(Gt(x,`${d}-flow__node`)||Gt(x,`${d}-flow__edge`)))return!0;if(!s&&!p&&!o&&!i&&!n||l||Gt(x,a)&&x.type==="wheel"||Gt(x,c)&&(x.type!=="wheel"||o&&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&&!o&&!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 Hy({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:o,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=Du().clickDistance(!Xe(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(o),h=He(e).call(m);y({x:i.x,y:i.y,zoom:nn(i.zoom,t,n)},[[0,0],[p.width,p.height]],o);const g=h.on("wheel.zoom"),E=h.on("dblclick.zoom");m.wheelDelta(xd);function S(D,z){return h?new Promise(b=>{m?.interpolate(z?.interpolate==="linear"?O.interpolate:ls).transform(Ro(h,z?.duration,z?.ease,()=>b(!0)),D)}):Promise.resolve(!1)}function R({noWheelClassName:D,noPanClassName:z,onPaneContextMenu:b,userSelectionActive:P,panOnScroll:_,panOnDrag:L,panOnScrollMode:V,panOnScrollSpeed:H,preventScrolling:K,zoomOnPinch:Z,zoomOnScroll:G,zoomOnDoubleClick:Q,zoomActivationKeyPressed:ee,lib:ae,onTransformChange:re}){P&&!x.isZoomingOrPanning&&v();const te=_&&!ee&&!P?Dy({zoomPanValues:x,noWheelClassName:D,d3Selection:h,d3Zoom:m,panOnScrollMode:V,panOnScrollSpeed:H,zoomOnPinch:Z,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}):By({noWheelClassName:D,preventScrolling:K,d3ZoomHandler:g});if(h.on("wheel.zoom",te,{passive:!1}),!P){const Re=$y({zoomPanValues:x,onDraggingChange:d,onPanZoomStart:a});m.on("start",Re);const Ce=zy({zoomPanValues:x,panOnDrag:L,onPaneContextMenu:!!b,onPanZoom:l,onTransformChange:re});m.on("zoom",Ce);const ue=Vy({zoomPanValues:x,panOnDrag:L,panOnScroll:_,onPaneContextMenu:b,onPanZoomEnd:c,onDraggingChange:d});m.on("end",ue)}const le=Fy({zoomActivationKeyPressed:ee,panOnDrag:L,zoomOnScroll:G,panOnScroll:_,zoomOnDoubleClick:Q,zoomOnPinch:Z,userSelectionActive:P,noPanClassName:z,noWheelClassName:D,lib:ae});m.filter(le),Q?h.on("dblclick.zoom",E):h.on("dblclick.zoom",null)}function v(){m.on("zoom",null)}async function y(D,z,b){const P=So(D),_=m?.constrain()(P,z,b);return _&&await S(_),new Promise(L=>L(_))}async function C(D,z){const b=So(D);return await S(b,z),new Promise(P=>P(b))}function k(D){if(h){const z=So(D),b=h.property("__zoom");(b.k!==D.zoom||b.x!==D.x||b.y!==D.y)&&m?.transform(h,z,null,{sync:!0})}}function T(){const D=h?Iu(h.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}function N(D,z){return h?new Promise(b=>{m?.interpolate(z?.interpolate==="linear"?O.interpolate:ls).scaleTo(Ro(h,z?.duration,z?.ease,()=>b(!0)),D)}):Promise.resolve(!1)}function I(D,z){return h?new Promise(b=>{m?.interpolate(z?.interpolate==="linear"?O.interpolate:ls).scaleBy(Ro(h,z?.duration,z?.ease,()=>b(!0)),D)}):Promise.resolve(!1)}function B(D){m?.scaleExtent(D)}function F(D){m?.translateExtent(D)}function $(D){const z=!Xe(D)||D<0?0:D;m?.clickDistance(z)}return{update:R,destroy:v,setViewport:C,setViewportConstrained:y,getViewport:T,scaleTo:N,scaleBy:I,setScaleExtent:B,setTranslateExtent:F,syncViewport:k,setClickDistance:$}}var rn;(function(e){e.Line="line",e.Handle="handle"})(rn||(rn={}));function Zy({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:o,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&&o&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function Ky(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:o}}function xt(e,t){return Math.max(0,t-e)}function pt(e,t){return Math.max(0,e-t)}function es(e,t,n){return Math.max(0,t-e,e-n)}function xl(e,t){return e?!t:t}function Yy(e,t,n,s,o,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:k,height:T,aspectRatio:N}=e;let I=Math.floor(x?h-e.pointerX:0),B=Math.floor(p?g-e.pointerY:0);const F=k+(c?-I:I),$=T+(d?-B:B),D=-i[0]*k,z=-i[1]*T;let b=es(F,E,S),P=es($,R,v);if(l){let V=0,H=0;c&&I<0?V=xt(y+I+D,l[0][0]):!c&&I>0&&(V=pt(y+F+D,l[1][0])),d&&B<0?H=xt(C+B+z,l[0][1]):!d&&B>0&&(H=pt(C+$+z,l[1][1])),b=Math.max(b,V),P=Math.max(P,H)}if(a){let V=0,H=0;c&&I>0?V=pt(y+I,a[0][0]):!c&&I<0&&(V=xt(y+F,a[1][0])),d&&B>0?H=pt(C+B,a[0][1]):!d&&B<0&&(H=xt(C+$,a[1][1])),b=Math.max(b,V),P=Math.max(P,H)}if(o){if(x){const V=es(F/N,R,v)*N;if(b=Math.max(b,V),l){let H=0;!c&&!d||c&&!d&&m?H=pt(C+z+F/N,l[1][1])*N:H=xt(C+z+(c?I:-I)/N,l[0][1])*N,b=Math.max(b,H)}if(a){let H=0;!c&&!d||c&&!d&&m?H=xt(C+F/N,a[1][1])*N:H=pt(C+(c?I:-I)/N,a[0][1])*N,b=Math.max(b,H)}}if(p){const V=es($*N,E,S)/N;if(P=Math.max(P,V),l){let H=0;!c&&!d||d&&!c&&m?H=pt(y+$*N+D,l[1][0])/N:H=xt(y+(d?B:-B)*N+D,l[0][0])/N,P=Math.max(P,H)}if(a){let H=0;!c&&!d||d&&!c&&m?H=xt(y+$*N,a[1][0])/N:H=pt(y+(d?B:-B)*N,a[0][0])/N,P=Math.max(P,H)}}}B=B+(B<0?P:-P),I=I+(I<0?b:-b),o&&(m?F>$*N?B=(xl(c,d)?-I:I)/N:I=(xl(c,d)?-B:B)*N:x?(B=I/N,d=c):(I=B*N,c=d));const _=c?y+I:y,L=d?C+B:C;return{width:k+(c?-I:I),height:T+(d?-B:B),x:i[0]*I*(c?-1:1)+_,y:i[1]*B*(d?-1:1)+L}}const pd={width:0,height:0,x:0,y:0},Gy={...pd,pointerX:0,pointerY:0,aspectRatio:1};function Uy(e){return[[0,0],[e.measured.width,e.measured.height]]}function Wy(e,t,n){const s=t.position.x+e.position.x,o=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,o-c],[s+i-a,o+l-c]]}function Xy({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:o}){const i=He(e);function l({controlPosition:c,boundaries:d,keepAspectRatio:x,resizeDirection:p,onResizeStart:m,onResize:h,onResizeEnd:g,shouldResize:E}){let S={...pd},R={...Gy};const v=Ky(c);let y,C=null,k=[],T,N,I;const B=_u().on("start",F=>{const{nodeLookup:$,transform:D,snapGrid:z,snapToGrid:b,nodeOrigin:P,paneDomNode:_}=n();if(y=$.get(t),!y)return;C=_?.getBoundingClientRect()??null;const{xSnapped:L,ySnapped:V}=Rn(F.sourceEvent,{transform:D,snapGrid:z,snapToGrid:b,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:L,pointerY:V,aspectRatio:S.width/S.height},T=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(T=$.get(y.parentId),N=T&&y.extent==="parent"?Uy(T):void 0),k=[],I=void 0;for(const[H,K]of $)if(K.parentId===t&&(k.push({id:H,position:{...K.position},extent:K.extent}),K.extent==="parent"||K.expandParent)){const Z=Wy(K,y,K.origin??P);I?I=[[Math.min(Z[0][0],I[0][0]),Math.min(Z[0][1],I[0][1])],[Math.max(Z[1][0],I[1][0]),Math.max(Z[1][1],I[1][1])]]:I=Z}m?.(F,{...S})}).on("drag",F=>{const{transform:$,snapGrid:D,snapToGrid:z,nodeOrigin:b}=n(),P=Rn(F.sourceEvent,{transform:$,snapGrid:D,snapToGrid:z,containerBounds:C}),_=[];if(!y)return;const{x:L,y:V,width:H,height:K}=S,Z={},G=y.origin??b,{width:Q,height:ee,x:ae,y:re}=Yy(R,v,P,d,x,G,N,I),se=Q!==H,te=ee!==K,le=ae!==L&&se,Re=re!==V&&te;if(!le&&!Re&&!se&&!te)return;if((le||Re||G[0]===1||G[1]===1)&&(Z.x=le?ae:S.x,Z.y=Re?re:S.y,S.x=Z.x,S.y=Z.y,k.length>0)){const X=ae-L,de=re-V;for(const we of k)we.position={x:we.position.x-X+G[0]*(Q-H),y:we.position.y-de+G[1]*(ee-K)},_.push(we)}if((se||te)&&(Z.width=se&&(!p||p==="horizontal")?Q:S.width,Z.height=te&&(!p||p==="vertical")?ee:S.height,S.width=Z.width,S.height=Z.height),T&&y.expandParent){const X=G[0]*(Z.width??0);Z.x&&Z.x<X&&(S.x=X,R.x=R.x-(Z.x-X));const de=G[1]*(Z.height??0);Z.y&&Z.y<de&&(S.y=de,R.y=R.y-(Z.y-de))}const Ce=Zy({width:S.width,prevWidth:H,height:S.height,prevHeight:K,affectsX:v.affectsX,affectsY:v.affectsY}),ue={...S,direction:Ce};E?.(F,ue)!==!1&&(h?.(F,ue),s(Z,_))}).on("end",F=>{g?.(F,{...S}),o?.({...S})});i.call(B)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var ts={exports:{}},Co={},ns={exports:{}},bo={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -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 hl;function Jy(){if(hl)return Co;hl=1;var e=j,t=md();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,o=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Co.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(T){if(!v){if(v=!0,y=T,T=m(T),h!==void 0&&E.hasValue){var P=E.value;if(h(P,T))return C=P}return C=T}if(P=C,s(y,T))return P;var I=m(T);return h!==void 0&&h(P,I)?(y=T,P):(y=T,C=I)}var v=!1,y,C,k=p===void 0?null:p;return[function(){return R(x())},k===null?void 0:function(){return R(k())}]},[x,p,m,h]);var S=o(d,g[0],g[1]);return l(function(){E.hasValue=!0,E.value=S},[S]),c(S),S},Co}var vo={};/**
25
+ */var hl;function Jy(){if(hl)return Co;hl=1;var e=j,t=md();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,o=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Co.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(T){if(!v){if(v=!0,y=T,T=m(T),h!==void 0&&E.hasValue){var N=E.value;if(h(N,T))return C=N}return C=T}if(N=C,s(y,T))return N;var I=m(T);return h!==void 0&&h(N,I)?(y=T,N):(y=T,C=I)}var v=!1,y,C,k=p===void 0?null:p;return[function(){return R(x())},k===null?void 0:function(){return R(k())}]},[x,p,m,h]);var S=o(d,g[0],g[1]);return l(function(){E.hasValue=!0,E.value=S},[S]),c(S),S},Co}var vo={};/**
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 gl;function e5(){return gl||(gl=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=md(),s=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,l=t.useEffect,a=t.useMemo,c=t.useDebugValue;vo.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(T){if(!v){if(v=!0,y=T,T=m(T),h!==void 0&&E.hasValue){var P=E.value;if(h(P,T))return C=P}return C=T}if(P=C,s(y,T))return P;var I=m(T);return h!==void 0&&h(P,I)?(y=T,P):(y=T,C=I)}var v=!1,y,C,k=p===void 0?null:p;return[function(){return R(x())},k===null?void 0:function(){return R(k())}]},[x,p,m,h]);var S=o(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())}()),vo}var jl;function t5(){return jl||(jl=1,process.env.NODE_ENV==="production"?ts.exports=Jy():ts.exports=e5()),ts.exports}var n5=t5();const s5=f.getDefaultExportFromCjs(n5),o5={},El=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))}},o=()=>t,c={setState:s,getState:o,getInitialState:()=>d,subscribe:x=>(n.add(x),()=>n.delete(x)),destroy:()=>{(o5?"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,o,c);return c},r5=e=>e?El(e):El,{useDebugValue:i5}=j,{useSyncExternalStoreWithSelector:l5}=s5,a5=e=>e;function fd(e,t=a5,n){const s=l5(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return i5(s),s}const yl=(e,t)=>{const n=r5(e),s=(o,i=t)=>fd(n,o,i);return Object.assign(s,n),s},c5=(e,t)=>e?yl(e,t):yl;function ke(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,o]of e)if(!Object.is(o,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 Xs=j.createContext(null),u5=Xs.Provider,hd=Oe.error001();function Ee(e,t){const n=j.useContext(Xs);if(n===null)throw new Error(hd);return fd(n,e,t)}function ve(){const e=j.useContext(Xs);if(e===null)throw new Error(hd);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Sl={display:"none"},d5={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},gd="react-flow__node-desc",jd="react-flow__edge-desc",x5="react-flow__aria-live",p5=e=>e.ariaLiveMessage,m5=e=>e.ariaLabelConfig;function f5({rfId:e}){const t=Ee(p5);return r.jsxRuntimeExports.jsx("div",{id:`${x5}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:d5,children:t})}function h5({rfId:e,disableKeyboardA11y:t}){const n=Ee(m5);return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{id:`${gd}-${e}`,style:Sl,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),r.jsxRuntimeExports.jsx("div",{id:`${jd}-${e}`,style:Sl,children:n["edge.a11yDescription.default"]}),!t&&r.jsxRuntimeExports.jsx(f5,{rfId:e})]})}const qs=j.forwardRef(({position:e="top-left",children:t,className:n,style:s,...o},i)=>{const l=`${e}`.split("-");return r.jsxRuntimeExports.jsx("div",{className:Te(["react-flow__panel",n,...l]),style:s,ref:i,...o,children:t})});qs.displayName="Panel";function g5({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:r.jsxRuntimeExports.jsx(qs,{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:r.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const j5=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}},ss=e=>e.id;function E5(e,t){return ke(e.selectedNodes.map(ss),t.selectedNodes.map(ss))&&ke(e.selectedEdges.map(ss),t.selectedEdges.map(ss))}function y5({onSelectionChange:e}){const t=ve(),{selectedNodes:n,selectedEdges:s}=Ee(j5,E5);return j.useEffect(()=>{const o={nodes:n,edges:s};e?.(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,s,e]),null}const S5=e=>!!e.onSelectionChangeHandlers;function R5({onSelectionChange:e}){const t=Ee(S5);return e||t?r.jsxRuntimeExports.jsx(y5,{onSelectionChange:e}):null}const Ed=[0,0],C5={x:0,y:0,zoom:1},b5=["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"],Rl=[...b5,"rfId"],w5=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}),Cl={translateExtent:Ln,nodeOrigin:Ed,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function v5(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:l,reset:a,setDefaultNodesAndEdges:c,setPaneClickDistance:d}=Ee(w5,ke),x=ve();j.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=Cl,a()}),[]);const p=j.useRef(Cl);return j.useEffect(()=>{for(const m of Rl){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"?o(h):m==="translateExtent"?i(h):m==="nodeExtent"?l(h):m==="paneClickDistance"?d(h):m==="ariaLabelConfig"?x.setState({ariaLabelConfig:uy(h)}):m==="fitView"?x.setState({fitViewQueued:h}):m==="fitViewOptions"?x.setState({fitViewOptions:h}):x.setState({[m]:h})))}p.current=e},Rl.map(m=>e[m])),null}function bl(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function k5(e){const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const s=bl(),o=()=>n(s?.matches?"dark":"light");return o(),s?.addEventListener("change",o),()=>{s?.removeEventListener("change",o)}},[e]),t!==null?t:bl()?.matches?"dark":"light"}const wl=typeof document<"u"?document:null;function Nn(e=null,t={target:wl,actInsideInputWithModifier:!0}){const[n,s]=j.useState(!1),o=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("+",`
33
+ */var gl;function e5(){return gl||(gl=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=md(),s=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,l=t.useEffect,a=t.useMemo,c=t.useDebugValue;vo.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(T){if(!v){if(v=!0,y=T,T=m(T),h!==void 0&&E.hasValue){var N=E.value;if(h(N,T))return C=N}return C=T}if(N=C,s(y,T))return N;var I=m(T);return h!==void 0&&h(N,I)?(y=T,N):(y=T,C=I)}var v=!1,y,C,k=p===void 0?null:p;return[function(){return R(x())},k===null?void 0:function(){return R(k())}]},[x,p,m,h]);var S=o(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())}()),vo}var jl;function t5(){return jl||(jl=1,process.env.NODE_ENV==="production"?ts.exports=Jy():ts.exports=e5()),ts.exports}var n5=t5();const s5=f.getDefaultExportFromCjs(n5),o5={},El=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))}},o=()=>t,c={setState:s,getState:o,getInitialState:()=>d,subscribe:x=>(n.add(x),()=>n.delete(x)),destroy:()=>{(o5?"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,o,c);return c},r5=e=>e?El(e):El,{useDebugValue:i5}=j,{useSyncExternalStoreWithSelector:l5}=s5,a5=e=>e;function fd(e,t=a5,n){const s=l5(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return i5(s),s}const yl=(e,t)=>{const n=r5(e),s=(o,i=t)=>fd(n,o,i);return Object.assign(s,n),s},c5=(e,t)=>e?yl(e,t):yl;function ke(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,o]of e)if(!Object.is(o,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 Xs=j.createContext(null),u5=Xs.Provider,hd=Oe.error001();function Ee(e,t){const n=j.useContext(Xs);if(n===null)throw new Error(hd);return fd(n,e,t)}function ve(){const e=j.useContext(Xs);if(e===null)throw new Error(hd);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Sl={display:"none"},d5={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},gd="react-flow__node-desc",jd="react-flow__edge-desc",x5="react-flow__aria-live",p5=e=>e.ariaLiveMessage,m5=e=>e.ariaLabelConfig;function f5({rfId:e}){const t=Ee(p5);return r.jsxRuntimeExports.jsx("div",{id:`${x5}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:d5,children:t})}function h5({rfId:e,disableKeyboardA11y:t}){const n=Ee(m5);return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{id:`${gd}-${e}`,style:Sl,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),r.jsxRuntimeExports.jsx("div",{id:`${jd}-${e}`,style:Sl,children:n["edge.a11yDescription.default"]}),!t&&r.jsxRuntimeExports.jsx(f5,{rfId:e})]})}const qs=j.forwardRef(({position:e="top-left",children:t,className:n,style:s,...o},i)=>{const l=`${e}`.split("-");return r.jsxRuntimeExports.jsx("div",{className:Te(["react-flow__panel",n,...l]),style:s,ref:i,...o,children:t})});qs.displayName="Panel";function g5({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:r.jsxRuntimeExports.jsx(qs,{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:r.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const j5=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}},ss=e=>e.id;function E5(e,t){return ke(e.selectedNodes.map(ss),t.selectedNodes.map(ss))&&ke(e.selectedEdges.map(ss),t.selectedEdges.map(ss))}function y5({onSelectionChange:e}){const t=ve(),{selectedNodes:n,selectedEdges:s}=Ee(j5,E5);return j.useEffect(()=>{const o={nodes:n,edges:s};e?.(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,s,e]),null}const S5=e=>!!e.onSelectionChangeHandlers;function R5({onSelectionChange:e}){const t=Ee(S5);return e||t?r.jsxRuntimeExports.jsx(y5,{onSelectionChange:e}):null}const Ed=[0,0],C5={x:0,y:0,zoom:1},b5=["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"],Rl=[...b5,"rfId"],w5=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}),Cl={translateExtent:Mn,nodeOrigin:Ed,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function v5(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:l,reset:a,setDefaultNodesAndEdges:c,setPaneClickDistance:d}=Ee(w5,ke),x=ve();j.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=Cl,a()}),[]);const p=j.useRef(Cl);return j.useEffect(()=>{for(const m of Rl){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"?o(h):m==="translateExtent"?i(h):m==="nodeExtent"?l(h):m==="paneClickDistance"?d(h):m==="ariaLabelConfig"?x.setState({ariaLabelConfig:uy(h)}):m==="fitView"?x.setState({fitViewQueued:h}):m==="fitViewOptions"?x.setState({fitViewOptions:h}):x.setState({[m]:h})))}p.current=e},Rl.map(m=>e[m])),null}function bl(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function k5(e){const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const s=bl(),o=()=>n(s?.matches?"dark":"light");return o(),s?.addEventListener("change",o),()=>{s?.removeEventListener("change",o)}},[e]),t!==null?t:bl()?.matches?"dark":"light"}const wl=typeof document<"u"?document:null;function Pn(e=null,t={target:wl,actInsideInputWithModifier:!0}){const[n,s]=j.useState(!1),o=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??wl,d=t?.actInsideInputWithModifier??!0;if(e!==null){const x=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!o.current||o.current&&!d)&&Xu(h))return!1;const E=kl(h.code,a);if(i.current.add(h[E]),vl(l,i.current,!1)){const S=h.composedPath?.()?.[0]||h.target,R=S?.nodeName==="BUTTON"||S?.nodeName==="A";t.preventDefault!==!1&&(o.current||!R)&&h.preventDefault(),s(!0)}},p=h=>{const g=kl(h.code,a);vl(l,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),o.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 vl(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function kl(e,t){return t.includes(e)?"code":"key"}const _5=()=>{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,o,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??o,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:o,minZoom:i,maxZoom:l,panZoom:a}=e.getState(),c=Jr(t,s,o,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:o,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??o,p=n.snapToGrid??i;return Fn(d,s,p,x)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:o,y:i}=s.getBoundingClientRect(),l=Ts(t,n);return{x:l.x+o,y:l.y+i}}}),[])};function yd(e,t){const n=[],s=new Map,o=[];for(const i of e)if(i.type==="add"){o.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)L5(c,a);n.push(a)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function L5(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 Sd(e,t){return yd(e,t)}function Rd(e,t){return yd(e,t)}function Ct(e,t){return{id:e,type:"select",selected:t}}function Ut(e,t=new Set,n=!1){const s=[];for(const[o,i]of e){const l=t.has(o);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),s.push(Ct(i.id,l)))}return s}function _l({items:e=[],lookup:t}){const n=[],s=new Map(e.map(o=>[o.id,o]));for(const[o,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:o})}for(const[o]of t)s.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Ll(e){return{id:e.id,type:"remove"}}const Tl=e=>ty(e),T5=e=>Fu(e);function Cd(e){return j.forwardRef(e)}const M5=typeof window<"u"?j.useLayoutEffect:j.useEffect;function Ml(e){const[t,n]=j.useState(BigInt(0)),[s]=j.useState(()=>N5(()=>n(o=>o+BigInt(1))));return M5(()=>{const o=s.get();o.length&&(e(o),s.reset())},[t]),s}function N5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const bd=j.createContext(null);function P5({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=_l({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=Ml(n),o=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(_l({items:h,lookup:m}))},[]),i=Ml(o),l=j.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return r.jsxRuntimeExports.jsx(bd.Provider,{value:l,children:e})}function A5(){const e=j.useContext(bd);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const O5=e=>!!e.panZoom;function zt(){const e=_5(),t=ve(),n=A5(),s=Ee(O5),o=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=Tl(p)?p:m.get(p.id),E=g.parentId?Uu(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 sn(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&&Tl(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&&T5(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:k,edges:T}=await iy({nodesToRemove:p,edgesToRemove:m,nodes:h,edges:g,onBeforeDelete:C}),P=T.length>0,I=k.length>0;if(P){const B=T.map(Ll);S?.(T),v(B)}if(I){const B=k.map(Ll);E?.(k),R(B)}return(I||P)&&y?.({nodes:k,edges:T}),{deletedNodes:k,deletedEdges:T}},getIntersectingNodes:(p,m=!0,h)=>{const g=tl(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=sn(S?R:v),C=Tn(y,E);return m&&C>0||C>=E.width*E.height}):[]},isNodeIntersecting:(p,m,h=!0)=>{const E=tl(p)?p:c(p);if(!E)return!1;const S=Tn(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 ny(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??cy();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:m}),n.nodeQueue.push(h=>[...h]),m.promise}}},[]);return j.useMemo(()=>({...o,...e,viewportInitialized:s}),[s])}const Nl=e=>e.selected,I5=typeof window<"u"?window:void 0;function D5({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ve(),{deleteElements:s}=zt(),o=Nn(e,{actInsideInputWithModifier:!1}),i=Nn(t,{target:I5});j.useEffect(()=>{if(o){const{edges:l,nodes:a}=n.getState();s({nodes:a.filter(Nl),edges:l.filter(Nl)}),n.setState({nodesSelectionActive:!1})}},[o]),j.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function B5(e){const t=ve();j.useEffect(()=>{const n=()=>{if(!e.current)return!1;const s=ei(e.current);(s.height===0||s.width===0)&&t.getState().onError?.("004",Oe.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 Qs={position:"absolute",width:"100%",height:"100%",top:0,left:0},$5=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function z5({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.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:v,paneClickDistance:y}){const C=ve(),k=j.useRef(null),{userSelectionActive:T,lib:P}=Ee($5,ke),I=Nn(m),B=j.useRef();B5(k);const F=j.useCallback($=>{R?.({x:$[0],y:$[1],zoom:$[2]}),v||C.setState({transform:$})},[R,v]);return j.useEffect(()=>{if(k.current){B.current=Hy({domNode:k.current,minZoom:x,maxZoom:p,translateExtent:d,viewport:c,paneClickDistance:y,onDraggingChange:b=>C.setState({paneDragging:b}),onPanZoomStart:(b,N)=>{const{onViewportChangeStart:_,onMoveStart:M}=C.getState();M?.(b,N),_?.(N)},onPanZoom:(b,N)=>{const{onViewportChange:_,onMove:M}=C.getState();M?.(b,N),_?.(N)},onPanZoomEnd:(b,N)=>{const{onViewportChangeEnd:_,onMoveEnd:M}=C.getState();M?.(b,N),_?.(N)}});const{x:$,y:D,zoom:z}=B.current.getViewport();return C.setState({panZoom:B.current,transform:[$,D,z],domNode:k.current.closest(".react-flow")}),()=>{B.current?.destroy()}}},[]),j.useEffect(()=>{B.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:I,preventScrolling:h,noPanClassName:S,userSelectionActive:T,noWheelClassName:E,lib:P,onTransformChange:F})},[e,t,n,s,o,i,l,a,I,h,S,T,E,P,F]),r.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:k,style:Qs,children:g})}const V5=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function F5(){const{userSelectionActive:e,userSelectionRect:t}=Ee(V5,ke);return e&&t?r.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 ko=(e,t)=>n=>{n.target===t.current&&e?.(n)},H5=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Z5({isSelecting:e,selectionKeyPressed:t,selectionMode:n=tn.Full,panOnDrag:s,selectionOnDrag:o,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}=Ee(H5,ke),y=S&&(e||E),C=j.useRef(null),k=j.useRef(),T=j.useRef(new Set),P=j.useRef(new Set),I=j.useRef(!1),B=j.useRef(!1),F=M=>{if(I.current||v){I.current=!1;return}a?.(M),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},$=M=>{if(Array.isArray(s)&&s?.includes(2)){M.preventDefault();return}c?.(M)},D=d?M=>d(M):void 0,z=M=>{const{resetSelectedElements:V,domNode:H}=g.getState();if(k.current=H?.getBoundingClientRect(),!S||!e||M.button!==0||M.target!==C.current||!k.current)return;M.target?.setPointerCapture?.(M.pointerId),B.current=!0,I.current=!1;const{x:K,y:Z}=tt(M.nativeEvent,k.current);V(),g.setState({userSelectionRect:{width:0,height:0,startX:K,startY:Z,x:K,y:Z}}),i?.(M)},b=M=>{const{userSelectionRect:V,transform:H,nodeLookup:K,edgeLookup:Z,connectionLookup:G,triggerNodeChanges:Q,triggerEdgeChanges:ee,defaultEdgeOptions:ae}=g.getState();if(!k.current||!V)return;I.current=!0;const{x:re,y:se}=tt(M.nativeEvent,k.current),{startX:te,startY:le}=V,Re={startX:te,startY:le,x:re<te?re:te,y:se<le?se:le,width:Math.abs(re-te),height:Math.abs(se-le)},Ce=T.current,ue=P.current;T.current=new Set(Qr(K,Re,H,n===tn.Partial,!0).map(X=>X.id)),P.current=new Set;const me=ae?.selectable??!0;for(const X of T.current){const de=G.get(X);if(de)for(const{edgeId:we}of de.values()){const Pe=Z.get(we);Pe&&(Pe.selectable??me)&&P.current.add(we)}}if(!nl(Ce,T.current)){const X=Ut(K,T.current,!0);Q(X)}if(!nl(ue,P.current)){const X=Ut(Z,P.current);ee(X)}g.setState({userSelectionRect:Re,userSelectionActive:!0,nodesSelectionActive:!1})},N=M=>{if(M.button!==0||!B.current)return;M.target?.releasePointerCapture?.(M.pointerId);const{userSelectionRect:V}=g.getState();!E&&V&&M.target===C.current&&F?.(M),g.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:T.current.size>0}),l?.(M),(t||o)&&(I.current=!1),B.current=!1},_=s===!0||Array.isArray(s)&&s.includes(0);return r.jsxRuntimeExports.jsxs("div",{className:Te(["react-flow__pane",{draggable:_,dragging:R,selection:e}]),onClick:y?void 0:ko(F,C),onContextMenu:ko($,C),onWheel:ko(D,C),onPointerEnter:y?void 0:x,onPointerDown:y?z:p,onPointerMove:y?b:p,onPointerUp:y?N:void 0,onPointerLeave:m,ref:C,style:Qs,children:[h,r.jsxRuntimeExports.jsx(F5,{})]})}function er({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:a,onError:c}=t.getState(),d=a.get(e);if(!d){c?.("012",Oe.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):o([e])}function wd({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:o,isSelectable:i,nodeClickDistance:l}){const a=ve(),[c,d]=j.useState(!1),x=j.useRef();return j.useEffect(()=>{x.current=_y({getStoreItems:()=>a.getState(),onNodeMouseDown:p=>{er({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:o,nodeClickDistance:l}),()=>{x.current?.destroy()}},[n,s,t,i,e,o]),c}const K5=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function vd(){const e=ve();return j.useCallback(n=>{const{nodeExtent:s,snapToGrid:o,snapGrid:i,nodesDraggable:l,onError:a,updateNodePositions:c,nodeLookup:d,nodeOrigin:x}=e.getState(),p=new Map,m=K5(l),h=o?i[0]:5,g=o?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};o&&(v=Us(v,i));const{position:y,positionAbsolute:C}=Hu({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 ri=j.createContext(null),Y5=ri.Provider;ri.Consumer;const kd=()=>j.useContext(ri),G5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),U5=(e,t,n)=>s=>{const{connectionClickStartHandle:o,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:o?.nodeId===e&&o?.id===t&&o?.type===n,isPossibleEndHandle:i===Pt.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!o,valid:x&&d}};function W5({type:e="source",position:t=J.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:o=!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=kd(),{connectOnClick:v,noPanClassName:y,rfId:C}=Ee(G5,ke),{connectingFrom:k,connectingTo:T,clickConnecting:P,isPossibleEndHandle:I,connectionInProcess:B,clickConnectionInProcess:F,valid:$}=Ee(U5(R,g,e),ke);R||S.getState().onError?.("010",Oe.error010());const D=N=>{const{defaultEdgeOptions:_,onConnect:M,hasDefaultEdges:V}=S.getState(),H={..._,...N};if(V){const{edges:K,setEdges:Z}=S.getState();Z(nd(H,K))}M?.(H),a?.(H)},z=N=>{if(!R)return;const _=qu(N.nativeEvent);if(o&&(_&&N.button===0||!_)){const M=S.getState();Jo.onPointerDown(N.nativeEvent,{autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:E,handleId:g,nodeId:R,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:M.onConnectEnd,updateConnection:M.updateConnection,onConnect:D,isValidConnection:n||M.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}_?x?.(N):p?.(N)},b=N=>{const{onClickConnectStart:_,onClickConnectEnd:M,connectionClickStartHandle:V,connectionMode:H,isValidConnection:K,lib:Z,rfId:G,nodeLookup:Q,connection:ee}=S.getState();if(!R||!V&&!o)return;if(!V){_?.(N.nativeEvent,{nodeId:R,handleId:g,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:R,type:e,id:g}});return}const ae=Wu(N.target),re=n||K,{connection:se,isValid:te}=Jo.isValid(N.nativeEvent,{handle:{nodeId:R,id:g,type:e},connectionMode:H,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:re,flowId:G,doc:ae,lib:Z,nodeLookup:Q});te&&se&&D(se);const le=structuredClone(ee);delete le.inProgress,le.toPosition=le.toHandle?le.toHandle.position:null,M?.(N,le),S.setState({connectionClickStartHandle:null})};return r.jsxRuntimeExports.jsx("div",{"data-handleid":g,"data-nodeid":R,"data-handlepos":t,"data-id":`${C}-${R}-${g}-${e}`,className:Te(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,d,{source:!E,target:E,connectable:s,connectablestart:o,connectableend:i,clickconnecting:P,connectingfrom:k,connectingto:T,valid:$,connectionindicator:s&&(!B||I)&&(B||F?i:o)}]),onMouseDown:z,onTouchStart:z,onClick:v?b:void 0,ref:h,...m,children:c})}const Pn=j.memo(Cd(W5));function X5({data:e,isConnectable:t,sourcePosition:n=J.Bottom}){return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[e?.label,r.jsxRuntimeExports.jsx(Pn,{type:"source",position:n,isConnectable:t})]})}function q5({data:e,isConnectable:t,targetPosition:n=J.Top,sourcePosition:s=J.Bottom}){return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(Pn,{type:"target",position:n,isConnectable:t}),e?.label,r.jsxRuntimeExports.jsx(Pn,{type:"source",position:s,isConnectable:t})]})}function Q5(){return null}function J5({data:e,isConnectable:t,targetPosition:n=J.Top}){return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(Pn,{type:"target",position:n,isConnectable:t}),e?.label]})}const Ns={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Pl={input:X5,default:q5,output:J5,group:Q5};function eS(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 tS=e=>{const{width:t,height:n,x:s,y:o}=Vn(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xe(t)?t:null,height:Xe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${o}px)`}};function nS({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=ve(),{width:o,height:i,transformString:l,userSelectionActive:a}=Ee(tS,ke),c=vd(),d=j.useRef(null);if(j.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),wd({nodeRef:d}),a||!o||!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(Ns,m.key)&&(m.preventDefault(),c({direction:Ns[m.key],factor:m.shiftKey?4:1}))};return r.jsxRuntimeExports.jsx("div",{className:Te(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:r.jsxRuntimeExports.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:o,height:i}})})}const Al=typeof window<"u"?window:void 0,sS=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _d({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,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:k,panOnScrollMode:T,zoomOnDoubleClick:P,panOnDrag:I,defaultViewport:B,translateExtent:F,minZoom:$,maxZoom:D,preventScrolling:z,onSelectionContextMenu:b,noWheelClassName:N,noPanClassName:_,disableKeyboardA11y:M,onViewportChange:V,isControlledViewport:H}){const{nodesSelectionActive:K,userSelectionActive:Z}=Ee(sS),G=Nn(d,{target:Al}),Q=Nn(E,{target:Al}),ee=Q||I,ae=Q||C,re=x&&ee!==!0,se=G||Z||re;return D5({deleteKeyCode:c,multiSelectionKeyCode:g}),r.jsxRuntimeExports.jsx(z5,{onPaneContextMenu:i,elementsSelectable:R,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ae,panOnScrollSpeed:k,panOnScrollMode:T,zoomOnDoubleClick:P,panOnDrag:!G&&ee,defaultViewport:B,translateExtent:F,minZoom:$,maxZoom:D,zoomActivationKeyCode:S,preventScrolling:z,noWheelClassName:N,noPanClassName:_,onViewportChange:V,isControlledViewport:H,paneClickDistance:a,children:r.jsxRuntimeExports.jsxs(Z5,{onSelectionStart:m,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:ee,isSelecting:!!se,selectionMode:p,selectionKeyPressed:G,selectionOnDrag:re,children:[e,K&&r.jsxRuntimeExports.jsx(nS,{onSelectionContextMenu:b,noPanClassName:_,disableKeyboardA11y:M})]})})}_d.displayName="FlowRenderer";const oS=j.memo(_d),rS=e=>t=>e?Qr(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 iS(e){return Ee(j.useCallback(rS(e),[e]),ke)}const lS=e=>e.updateNodeInternals;function aS(){const e=Ee(lS),[t]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:o.target,force:!0})}),e(s)}));return j.useEffect(()=>()=>{t?.disconnect()},[t]),t}function cS({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const o=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,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function uS({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:o,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:k}=Ee(te=>{const le=te.nodeLookup.get(e),Re=te.parentLookup.has(e);return{node:le,internals:le.internals,isParent:Re}},ke);let T=y.type||"default",P=S?.[T]||Pl[T];P===void 0&&(v?.("003",Oe.error003(T)),T="default",P=Pl.default);const I=!!(y.draggable||a&&typeof y.draggable>"u"),B=!!(y.selectable||c&&typeof y.selectable>"u"),F=!!(y.connectable||d&&typeof y.connectable>"u"),$=!!(y.focusable||x&&typeof y.focusable>"u"),D=ve(),z=Gu(y),b=cS({node:y,nodeType:T,hasDimensions:z,resizeObserver:p}),N=wd({nodeRef:b,disabled:y.hidden||!I,noDragClassName:m,handleSelector:y.dragHandle,nodeId:e,isSelectable:B,nodeClickDistance:R}),_=vd();if(y.hidden)return null;const M=dt(y),V=eS(y),H=B||I||t||n||s||o,K=n?te=>n(te,{...C.userNode}):void 0,Z=s?te=>s(te,{...C.userNode}):void 0,G=o?te=>o(te,{...C.userNode}):void 0,Q=i?te=>i(te,{...C.userNode}):void 0,ee=l?te=>l(te,{...C.userNode}):void 0,ae=te=>{const{selectNodesOnDrag:le,nodeDragThreshold:Re}=D.getState();B&&(!le||!I||Re>0)&&er({id:e,store:D,nodeRef:b}),t&&t(te,{...C.userNode})},re=te=>{if(!(Xu(te.nativeEvent)||g)){if(Bu.includes(te.key)&&B){const le=te.key==="Escape";er({id:e,store:D,unselect:le,nodeRef:b})}else if(I&&y.selected&&Object.prototype.hasOwnProperty.call(Ns,te.key)){te.preventDefault();const{ariaLabelConfig:le}=D.getState();D.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),_({direction:Ns[te.key],factor:te.shiftKey?4:1})}}},se=()=>{if(g||!b.current?.matches(":focus-visible"))return;const{transform:te,width:le,height:Re,autoPanOnNodeFocus:Ce,setCenter:ue}=D.getState();if(!Ce)return;Qr(new Map([[e,y]]),{x:0,y:0,width:le,height:Re},te,!0).length>0||ue(y.position.x+M.width/2,y.position.y+M.height/2,{zoom:te[2]})};return r.jsxRuntimeExports.jsx("div",{className:Te(["react-flow__node",`react-flow__node-${T}`,{[h]:I},y.className,{selected:y.selected,selectable:B,parent:k,draggable:I,dragging:N}]),ref:b,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:z?"visible":"hidden",...y.style,...V},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:K,onMouseMove:Z,onMouseLeave:G,onContextMenu:Q,onClick:ae,onDoubleClick:ee,onKeyDown:$?re:void 0,tabIndex:$?0:void 0,onFocus:$?se:void 0,role:y.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${gd}-${E}`,"aria-label":y.ariaLabel,...y.domAttributes,children:r.jsxRuntimeExports.jsx(Y5,{value:e,children:r.jsxRuntimeExports.jsx(P,{id:e,data:y.data,type:T,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:B,draggable:I,deletable:y.deletable??!0,isConnectable:F,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:N,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...M})})})}const dS=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Ld(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,onError:i}=Ee(dS,ke),l=iS(e.onlyRenderVisibleElements),a=aS();return r.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Qs,children:l.map(c=>r.jsxRuntimeExports.jsx(uS,{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:o,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}Ld.displayName="NodeRenderer";const xS=j.memo(Ld);function pS(e){return Ee(j.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const s=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),l=n.nodeLookup.get(o.target);i&&l&&py({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(o.id)}return s},[e]),ke)}const mS=({color:e="none",strokeWidth:t=1})=>r.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),fS=({color:e="none",strokeWidth:t=1})=>r.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Ol={[ks.Arrow]:mS,[ks.ArrowClosed]:fS};function hS(e){const t=ve();return j.useMemo(()=>Object.prototype.hasOwnProperty.call(Ol,e)?Ol[e]:(t.getState().onError?.("009",Oe.error009(e)),null),[e])}const gS=({id:e,type:t,color:n,width:s=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:a="auto-start-reverse"})=>{const c=hS(t);return c?r.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:r.jsxRuntimeExports.jsx(c,{color:n,strokeWidth:l})}):null},Td=({defaultColor:e,rfId:t})=>{const n=Ee(i=>i.edges),s=Ee(i=>i.defaultEdgeOptions),o=j.useMemo(()=>yy(n,{id:t,defaultColor:e,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[n,s,t,e]);return o.length?r.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:r.jsxRuntimeExports.jsx("defs",{children:o.map(i=>r.jsxRuntimeExports.jsx(gS,{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 jS=j.memo(Td);function Md({x:e,y:t,label:n,labelStyle:s,labelShowBg:o=!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=Te(["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?r.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:h,visibility:p.width?"visible":"hidden",...x,children:[o&&r.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}),r.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:g,style:s,children:n}),c]}):null}Md.displayName="EdgeText";const ES=j.memo(Md);function qe({path:e,labelX:t,labelY:n,label:s,labelStyle:o,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:d=20,...x}){return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("path",{...x,d:e,fill:"none",className:Te(["react-flow__edge-path",x.className])}),d&&r.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),s&&Xe(t)&&Xe(n)?r.jsxRuntimeExports.jsx(ES,{x:t,y:n,label:s,labelStyle:o,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function Il({pos:e,x1:t,y1:n,x2:s,y2:o}){return e===J.Left||e===J.Right?[.5*(t+s),n]:[t,.5*(n+o)]}function Nd({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:s,targetY:o,targetPosition:i=J.Top}){const[l,a]=Il({pos:n,x1:e,y1:t,x2:s,y2:o}),[c,d]=Il({pos:i,x1:s,y1:o,x2:e,y2:t}),[x,p,m,h]=Qu({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:d});return[`M${e},${t} C${l},${a} ${c},${d} ${s},${o}`,x,p,m,h]}function Pd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:o,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]=Nd({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:i,targetPosition:a}),k=e.isInternal?void 0:t;return r.jsxRuntimeExports.jsx(qe,{id:k,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 yS=Pd({isInternal:!1}),Ad=Pd({isInternal:!0});yS.displayName="SimpleBezierEdge";Ad.displayName="SimpleBezierEdgeInternal";function Od(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:i,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,sourcePosition:h=J.Bottom,targetPosition:g=J.Top,markerEnd:E,markerStart:S,pathOptions:R,interactionWidth:v})=>{const[y,C,k]=Xo({sourceX:n,sourceY:s,sourcePosition:h,targetX:o,targetY:i,targetPosition:g,borderRadius:R?.borderRadius,offset:R?.offset}),T=e.isInternal?void 0:t;return r.jsxRuntimeExports.jsx(qe,{id:T,path:y,labelX:C,labelY:k,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:E,markerStart:S,interactionWidth:v})})}const Id=Od({isInternal:!1}),Dd=Od({isInternal:!0});Id.displayName="SmoothStepEdge";Dd.displayName="SmoothStepEdgeInternal";function Bd(e){return j.memo(({id:t,...n})=>{const s=e.isInternal?void 0:t;return r.jsxRuntimeExports.jsx(Id,{...n,id:s,pathOptions:j.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const SS=Bd({isInternal:!1}),$d=Bd({isInternal:!0});SS.displayName="StepEdge";$d.displayName="StepEdgeInternal";function zd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:o,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]=sd({sourceX:n,sourceY:s,targetX:o,targetY:i}),y=e.isInternal?void 0:t;return r.jsxRuntimeExports.jsx(qe,{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 RS=zd({isInternal:!1}),Vd=zd({isInternal:!0});RS.displayName="StraightEdge";Vd.displayName="StraightEdgeInternal";function Fd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:i,sourcePosition:l=J.Bottom,targetPosition:a=J.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,k]=Ju({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:i,targetPosition:a,curvature:R?.curvature}),T=e.isInternal?void 0:t;return r.jsxRuntimeExports.jsx(qe,{id:T,path:y,labelX:C,labelY:k,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:E,markerStart:S,interactionWidth:v})})}const CS=Fd({isInternal:!1}),Hd=Fd({isInternal:!0});CS.displayName="BezierEdge";Hd.displayName="BezierEdgeInternal";const Dl={default:Hd,straight:Vd,step:$d,smoothstep:Dd,simplebezier:Ad},Bl={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},bS=(e,t,n)=>n===J.Left?e-t:n===J.Right?e+t:e,wS=(e,t,n)=>n===J.Top?e-t:n===J.Bottom?e+t:e,$l="react-flow__edgeupdater";function zl({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:o,onMouseEnter:i,onMouseOut:l,type:a}){return r.jsxRuntimeExports.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:l,className:Te([$l,`${$l}-${a}`]),cx:bS(t,s,e),cy:wS(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function vS({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:o,targetX:i,targetY:l,sourcePosition:a,targetPosition:c,onReconnect:d,onReconnectStart:x,onReconnectEnd:p,setReconnecting:m,setUpdateHover:h}){const g=ve(),E=(C,k)=>{if(C.button!==0)return;const{autoPanOnConnect:T,domNode:P,isValidConnection:I,connectionMode:B,connectionRadius:F,lib:$,onConnectStart:D,onConnectEnd:z,cancelConnection:b,nodeLookup:N,rfId:_,panBy:M,updateConnection:V}=g.getState(),H=k.type==="target",K=(Q,ee)=>{m(!1),p?.(Q,n,k.type,ee)},Z=Q=>d?.(n,Q),G=(Q,ee)=>{m(!0),x?.(C,n,k.type),D?.(Q,ee)};Jo.onPointerDown(C.nativeEvent,{autoPanOnConnect:T,connectionMode:B,connectionRadius:F,domNode:P,handleId:k.id,nodeId:k.nodeId,nodeLookup:N,isTarget:H,edgeUpdaterType:k.type,lib:$,flowId:_,cancelConnection:b,panBy:M,isValidConnection:I,onConnect:Z,onConnectStart:G,onConnectEnd:z,onReconnectEnd:K,updateConnection:V,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 r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&r.jsxRuntimeExports.jsx(zl,{position:a,centerX:s,centerY:o,radius:t,onMouseDown:S,onMouseEnter:v,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&r.jsxRuntimeExports.jsx(zl,{position:c,centerX:i,centerY:l,radius:t,onMouseDown:R,onMouseEnter:v,onMouseOut:y,type:"target"})]})}function kS({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:o,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=Ee(ue=>ue.edgeLookup.get(e));const C=Ee(ue=>ue.defaultEdgeOptions);y=C?{...C,...y}:y;let k=y.type||"default",T=E?.[k]||Dl[k];T===void 0&&(R?.("011",Oe.error011(k)),k="default",T=Dl.default);const P=!!(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"),F=j.useRef(null),[$,D]=j.useState(!1),[z,b]=j.useState(!1),N=ve(),{zIndex:_,sourceX:M,sourceY:V,targetX:H,targetY:K,sourcePosition:Z,targetPosition:G}=Ee(j.useCallback(ue=>{const me=ue.nodeLookup.get(y.source),X=ue.nodeLookup.get(y.target);if(!me||!X)return{zIndex:y.zIndex,...Bl};const de=Ey({id:e,sourceNode:me,targetNode:X,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ue.connectionMode,onError:R});return{zIndex:xy({selected:y.selected,zIndex:y.zIndex,sourceNode:me,targetNode:X,elevateOnSelect:ue.elevateEdgesOnSelect}),...de||Bl}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),ke),Q=j.useMemo(()=>y.markerStart?`url('#${qo(y.markerStart,g)}')`:void 0,[y.markerStart,g]),ee=j.useMemo(()=>y.markerEnd?`url('#${qo(y.markerEnd,g)}')`:void 0,[y.markerEnd,g]);if(y.hidden||M===null||V===null||H===null||K===null)return null;const ae=ue=>{const{addSelectedEdges:me,unselectNodesAndEdges:X,multiSelectionActive:de}=N.getState();B&&(N.setState({nodesSelectionActive:!1}),y.selected&&de?(X({nodes:[],edges:[y]}),F.current?.blur()):me([e])),o&&o(ue,y)},re=i?ue=>{i(ue,{...y})}:void 0,se=l?ue=>{l(ue,{...y})}:void 0,te=a?ue=>{a(ue,{...y})}:void 0,le=c?ue=>{c(ue,{...y})}:void 0,Re=d?ue=>{d(ue,{...y})}:void 0,Ce=ue=>{if(!v&&Bu.includes(ue.key)&&B){const{unselectNodesAndEdges:me,addSelectedEdges:X}=N.getState();ue.key==="Escape"?(F.current?.blur(),me({edges:[y]})):X([e])}};return r.jsxRuntimeExports.jsx("svg",{style:{zIndex:_},children:r.jsxRuntimeExports.jsxs("g",{className:Te(["react-flow__edge",`react-flow__edge-${k}`,y.className,S,{selected:y.selected,animated:y.animated,inactive:!B&&!o,updating:$,selectable:B}]),onClick:ae,onDoubleClick:re,onContextMenu:se,onMouseEnter:te,onMouseMove:le,onMouseLeave:Re,onKeyDown:P?Ce:void 0,tabIndex:P?0:void 0,role:y.ariaRole??(P?"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":P?`${jd}-${g}`:void 0,ref:F,...y.domAttributes,children:[!z&&r.jsxRuntimeExports.jsx(T,{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:M,sourceY:V,targetX:H,targetY:K,sourcePosition:Z,targetPosition:G,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:Q,markerEnd:ee,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),I&&r.jsxRuntimeExports.jsx(vS,{edge:y,isReconnectable:I,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,sourceX:M,sourceY:V,targetX:H,targetY:K,sourcePosition:Z,targetPosition:G,setUpdateHover:D,setReconnecting:b})]})})}const _S=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Zd({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:o,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}=Ee(_S,ke),C=pS(t);return r.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[r.jsxRuntimeExports.jsx(jS,{defaultColor:e,rfId:n}),C.map(k=>r.jsxRuntimeExports.jsx(kS,{id:k,edgesFocusable:S,edgesReconnectable:R,elementsSelectable:v,noPanClassName:o,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},k))]})}Zd.displayName="EdgeRenderer";const LS=j.memo(Zd),TS=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function MS({children:e}){const t=Ee(TS);return r.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function NS(e){const t=zt(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const PS=e=>e.panZoom?.syncViewport;function AS(e){const t=Ee(PS),n=ve();return j.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function OS(e){return e.connection.inProgress?{...e.connection,to:Fn(e.connection.to,e.transform)}:{...e.connection}}function IS(e){return OS}function DS(e){const t=IS();return Ee(t,ke)}const BS=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function $S({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:o,width:i,height:l,isValid:a,inProgress:c}=Ee(BS,ke);return!(i&&o&&c)?null:r.jsxRuntimeExports.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:r.jsxRuntimeExports.jsx("g",{className:Te(["react-flow__connection",Vu(a)]),children:r.jsxRuntimeExports.jsx(Kd,{style:t,type:n,CustomComponent:s,isValid:a})})})}const Kd=({style:e,type:t=ft.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:o,from:i,fromNode:l,fromHandle:a,fromPosition:c,to:d,toNode:x,toHandle:p,toPosition:m}=DS();if(!o)return;if(n)return r.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:Vu(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]=Ju(g);break;case ft.SimpleBezier:[h]=Nd(g);break;case ft.Step:[h]=Xo({...g,borderRadius:0});break;case ft.SmoothStep:[h]=Xo(g);break;default:[h]=sd(g)}return r.jsxRuntimeExports.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};Kd.displayName="ConnectionLine";const zS={};function Vl(e=zS){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 o of s)if(t.current[o]!==e[o]){n.getState().onError?.("002",Oe.error002());break}t.current=e}},[e])}function VS(){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",Oe.error013("react")),t.current=!0}},[])}function Yd({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:o,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:k,panActivationKeyCode:T,zoomActivationKeyCode:P,deleteKeyCode:I,onlyRenderVisibleElements:B,elementsSelectable:F,defaultViewport:$,translateExtent:D,minZoom:z,maxZoom:b,preventScrolling:N,defaultMarkerColor:_,zoomOnScroll:M,zoomOnPinch:V,panOnScroll:H,panOnScrollSpeed:K,panOnScrollMode:Z,zoomOnDoubleClick:G,panOnDrag:Q,onPaneClick:ee,onPaneMouseEnter:ae,onPaneMouseMove:re,onPaneMouseLeave:se,onPaneScroll:te,onPaneContextMenu:le,paneClickDistance:Re,nodeClickDistance:Ce,onEdgeContextMenu:ue,onEdgeMouseEnter:me,onEdgeMouseMove:X,onEdgeMouseLeave:de,reconnectRadius:we,onReconnect:Pe,onReconnectStart:et,onReconnectEnd:Kn,noDragClassName:Yn,noWheelClassName:Gn,noPanClassName:un,disableKeyboardA11y:dn,nodeExtent:oo,rfId:Un,viewport:Zt,onViewportChange:xn}){return Vl(e),Vl(t),VS(),NS(n),AS(Zt),r.jsxRuntimeExports.jsx(oS,{onPaneClick:ee,onPaneMouseEnter:ae,onPaneMouseMove:re,onPaneMouseLeave:se,onPaneContextMenu:le,onPaneScroll:te,paneClickDistance:Re,deleteKeyCode:I,selectionKeyCode:v,selectionOnDrag:y,selectionMode:C,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:k,panActivationKeyCode:T,zoomActivationKeyCode:P,elementsSelectable:F,zoomOnScroll:M,zoomOnPinch:V,zoomOnDoubleClick:G,panOnScroll:H,panOnScrollSpeed:K,panOnScrollMode:Z,panOnDrag:Q,defaultViewport:$,translateExtent:D,minZoom:z,maxZoom:b,onSelectionContextMenu:p,preventScrolling:N,noDragClassName:Yn,noWheelClassName:Gn,noPanClassName:un,disableKeyboardA11y:dn,onViewportChange:xn,isControlledViewport:!!Zt,children:r.jsxRuntimeExports.jsxs(MS,{children:[r.jsxRuntimeExports.jsx(LS,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:Pe,onReconnectStart:et,onReconnectEnd:Kn,onlyRenderVisibleElements:B,onEdgeContextMenu:ue,onEdgeMouseEnter:me,onEdgeMouseMove:X,onEdgeMouseLeave:de,reconnectRadius:we,defaultMarkerColor:_,noPanClassName:un,disableKeyboardA11y:dn,rfId:Un}),r.jsxRuntimeExports.jsx($S,{style:E,type:g,component:S,containerStyle:R}),r.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),r.jsxRuntimeExports.jsx(xS,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:x,nodeClickDistance:Ce,onlyRenderVisibleElements:B,noPanClassName:un,noDragClassName:Yn,disableKeyboardA11y:dn,nodeExtent:oo,rfId:Un}),r.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Yd.displayName="GraphView";const FS=j.memo(Yd),Fl=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,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??Ln;rd(g,E,S);const C=Qo(R,m,h,{nodeOrigin:v,nodeExtent:y,elevateNodesOnSelect:!1});let k=[0,0,1];if(l&&o&&i){const T=Vn(m,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:P,y:I,zoom:B}=Jr(T,o,i,c,d,a?.padding??.1);k=[P,I,B]}return{rfId:"1",width:0,height:0,transform:k,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:Ln,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Pt.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:{...zu},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Ls,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:$u}},HS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:x,nodeExtent:p})=>c5((m,h)=>{async function g(){const{nodeLookup:E,panZoom:S,fitViewOptions:R,fitViewResolver:v,width:y,height:C,minZoom:k,maxZoom:T}=h();S&&(await ry({nodes:E,width:y,height:C,panZoom:S,minZoom:k,maxZoom:T},R),v?.resolve(!0),m({fitViewResolver:null}))}return{...Fl({nodes:e,edges:t,width:o,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(),k=Qo(E,S,R,{nodeOrigin:v,nodeExtent:p,elevateNodesOnSelect:y,checkEquality:!0});C&&k?(g(),m({nodes:E,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:E,nodesInitialized:k})},setEdges:E=>{const{connectionLookup:S,edgeLookup:R}=h();rd(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:k,debug:T,fitViewQueued:P}=h(),{changes:I,updatedInternals:B}=wy(E,R,v,y,C,k);B&&(Ry(R,v,{nodeOrigin:C,nodeExtent:k}),P?(g(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),I?.length>0&&(T&&console.log("React Flow: trigger node changes",I),S?.(I)))},updateNodePositions:(E,S=!1)=>{const R=[],v=[],{nodeLookup:y,triggerNodeChanges:C}=h();for(const[k,T]of E){const P=y.get(k),I=!!(P?.expandParent&&P?.parentId&&T?.position),B={id:k,type:"position",position:I?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:S};I&&P.parentId&&R.push({id:k,parentId:P.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),v.push(B)}if(R.length>0){const{parentLookup:k,nodeOrigin:T}=h(),P=oi(R,y,k,T);v.push(...P)}C(v)},triggerNodeChanges:E=>{const{onNodesChange:S,setNodes:R,nodes:v,hasDefaultNodes:y,debug:C}=h();if(E?.length){if(y){const k=Sd(E,v);R(k)}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 k=Rd(E,v);R(k)}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 k=E.map(T=>Ct(T,!0));y(k);return}y(Ut(v,new Set([...E]),!0)),C(Ut(R))},addSelectedEdges:E=>{const{multiSelectionActive:S,edgeLookup:R,nodeLookup:v,triggerNodeChanges:y,triggerEdgeChanges:C}=h();if(S){const k=E.map(T=>Ct(T,!0));C(k);return}C(Ut(R,new Set([...E]))),y(Ut(v,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:S}={})=>{const{edges:R,nodes:v,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:k}=h(),T=E||v,P=S||R,I=T.map(F=>{const $=y.get(F.id);return $&&($.selected=!1),Ct(F.id,!1)}),B=P.map(F=>Ct(F.id,!1));C(I),k(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((T,P)=>P.selected?[...T,Ct(P.id,!1)]:T,[]),k=E.reduce((T,P)=>P.selected?[...T,Ct(P.id,!1)]:T,[]);R(C),v(k)},setNodeExtent:E=>{const{nodes:S,nodeLookup:R,parentLookup:v,nodeOrigin:y,elevateNodesOnSelect:C,nodeExtent:k}=h();E[0][0]===k[0][0]&&E[0][1]===k[0][1]&&E[1][0]===k[1][0]&&E[1][1]===k[1][1]||(Qo(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 vy({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:k}=h();if(!k)return Promise.resolve(!1);const T=typeof R?.zoom<"u"?R.zoom:C;return await k.setViewport({x:v/2-E*T,y:y/2-S*T,zoom:T},{duration:R?.duration,ease:R?.ease,interpolate:R?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{...zu}})},updateConnection:E=>{m({connection:E})},reset:()=>m({...Fl()})}},Object.is);function Gd({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:o,initialHeight:i,initialMinZoom:l,initialMaxZoom:a,initialFitViewOptions:c,fitView:d,nodeOrigin:x,nodeExtent:p,children:m}){const[h]=j.useState(()=>HS({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:i,fitView:d,minZoom:l,maxZoom:a,fitViewOptions:c,nodeOrigin:x,nodeExtent:p}));return r.jsxRuntimeExports.jsx(u5,{value:h,children:r.jsxRuntimeExports.jsx(P5,{children:m})})}function ZS({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:o,width:i,height:l,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:x,nodeOrigin:p,nodeExtent:m}){return j.useContext(Xs)?r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:e}):r.jsxRuntimeExports.jsx(Gd,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:o,initialWidth:i,initialHeight:l,fitView:a,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:x,nodeOrigin:p,nodeExtent:m,children:e})}const KS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function YS({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:o,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:k,onNodeDoubleClick:T,onNodeDragStart:P,onNodeDrag:I,onNodeDragStop:B,onNodesDelete:F,onEdgesDelete:$,onDelete:D,onSelectionChange:z,onSelectionDragStart:b,onSelectionDrag:N,onSelectionDragStop:_,onSelectionContextMenu:M,onSelectionStart:V,onSelectionEnd:H,onBeforeDelete:K,connectionMode:Z,connectionLineType:G=ft.Bezier,connectionLineStyle:Q,connectionLineComponent:ee,connectionLineContainerStyle:ae,deleteKeyCode:re="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:te=!1,selectionMode:le=tn.Full,panActivationKeyCode:Re="Space",multiSelectionKeyCode:Ce=Ms()?"Meta":"Control",zoomActivationKeyCode:ue=Ms()?"Meta":"Control",snapToGrid:me,snapGrid:X,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:we,nodesDraggable:Pe,autoPanOnNodeFocus:et,nodesConnectable:Kn,nodesFocusable:Yn,nodeOrigin:Gn=Ed,edgesFocusable:un,edgesReconnectable:dn,elementsSelectable:oo=!0,defaultViewport:Un=C5,minZoom:Zt=.5,maxZoom:xn=2,translateExtent:fi=Ln,preventScrolling:ym=!0,nodeExtent:ro,defaultMarkerColor:Sm="#b1b1b7",zoomOnScroll:Rm=!0,zoomOnPinch:Cm=!0,panOnScroll:bm=!1,panOnScrollSpeed:wm=.5,panOnScrollMode:vm=wt.Free,zoomOnDoubleClick:km=!0,panOnDrag:_m=!0,onPaneClick:Lm,onPaneMouseEnter:Tm,onPaneMouseMove:Mm,onPaneMouseLeave:Nm,onPaneScroll:Pm,onPaneContextMenu:Am,paneClickDistance:hi=0,nodeClickDistance:Om=0,children:Im,onReconnect:Dm,onReconnectStart:Bm,onReconnectEnd:$m,onEdgeContextMenu:zm,onEdgeDoubleClick:Vm,onEdgeMouseEnter:Fm,onEdgeMouseMove:Hm,onEdgeMouseLeave:Zm,reconnectRadius:Km=10,onNodesChange:Ym,onEdgesChange:Gm,noDragClassName:Um="nodrag",noWheelClassName:Wm="nowheel",noPanClassName:gi="nopan",fitView:ji,fitViewOptions:Ei,connectOnClick:Xm,attributionPosition:qm,proOptions:Qm,defaultEdgeOptions:Jm,elevateNodesOnSelect:ef,elevateEdgesOnSelect:tf,disableKeyboardA11y:yi=!1,autoPanOnConnect:nf,autoPanOnNodeDrag:sf,autoPanSpeed:of,connectionRadius:rf,isValidConnection:lf,onError:af,style:cf,id:Si,nodeDragThreshold:uf,connectionDragThreshold:df,viewport:xf,onViewportChange:pf,width:mf,height:ff,colorMode:hf="light",debug:gf,onScroll:Ri,ariaLabelConfig:jf,...Ef},yf){const io=Si||"1",Sf=k5(hf),Rf=j.useCallback(Ci=>{Ci.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ri?.(Ci)},[Ri]);return r.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...Ef,onScroll:Rf,style:{...cf,...KS},ref:yf,className:Te(["react-flow",o,Sf]),id:Si,role:"application",children:r.jsxRuntimeExports.jsxs(ZS,{nodes:e,edges:t,width:mf,height:ff,fitView:ji,fitViewOptions:Ei,minZoom:Zt,maxZoom:xn,nodeOrigin:Gn,nodeExtent:ro,children:[r.jsxRuntimeExports.jsx(FS,{onInit:d,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:k,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:l,connectionLineType:G,connectionLineStyle:Q,connectionLineComponent:ee,connectionLineContainerStyle:ae,selectionKeyCode:se,selectionOnDrag:te,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:Ce,panActivationKeyCode:Re,zoomActivationKeyCode:ue,onlyRenderVisibleElements:de,defaultViewport:Un,translateExtent:fi,minZoom:Zt,maxZoom:xn,preventScrolling:ym,zoomOnScroll:Rm,zoomOnPinch:Cm,zoomOnDoubleClick:km,panOnScroll:bm,panOnScrollSpeed:wm,panOnScrollMode:vm,panOnDrag:_m,onPaneClick:Lm,onPaneMouseEnter:Tm,onPaneMouseMove:Mm,onPaneMouseLeave:Nm,onPaneScroll:Pm,onPaneContextMenu:Am,paneClickDistance:hi,nodeClickDistance:Om,onSelectionContextMenu:M,onSelectionStart:V,onSelectionEnd:H,onReconnect:Dm,onReconnectStart:Bm,onReconnectEnd:$m,onEdgeContextMenu:zm,onEdgeDoubleClick:Vm,onEdgeMouseEnter:Fm,onEdgeMouseMove:Hm,onEdgeMouseLeave:Zm,reconnectRadius:Km,defaultMarkerColor:Sm,noDragClassName:Um,noWheelClassName:Wm,noPanClassName:gi,rfId:io,disableKeyboardA11y:yi,nodeExtent:ro,viewport:xf,onViewportChange:pf}),r.jsxRuntimeExports.jsx(v5,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:h,onConnectStart:g,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:R,nodesDraggable:Pe,autoPanOnNodeFocus:et,nodesConnectable:Kn,nodesFocusable:Yn,edgesFocusable:un,edgesReconnectable:dn,elementsSelectable:oo,elevateNodesOnSelect:ef,elevateEdgesOnSelect:tf,minZoom:Zt,maxZoom:xn,nodeExtent:ro,onNodesChange:Ym,onEdgesChange:Gm,snapToGrid:me,snapGrid:X,connectionMode:Z,translateExtent:fi,connectOnClick:Xm,defaultEdgeOptions:Jm,fitView:ji,fitViewOptions:Ei,onNodesDelete:F,onEdgesDelete:$,onDelete:D,onNodeDragStart:P,onNodeDrag:I,onNodeDragStop:B,onSelectionDrag:N,onSelectionDragStart:b,onSelectionDragStop:_,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:gi,nodeOrigin:Gn,rfId:io,autoPanOnConnect:nf,autoPanOnNodeDrag:sf,autoPanSpeed:of,onError:af,connectionRadius:rf,isValidConnection:lf,selectNodesOnDrag:we,nodeDragThreshold:uf,connectionDragThreshold:df,onBeforeDelete:K,paneClickDistance:hi,debug:gf,ariaLabelConfig:jf}),r.jsxRuntimeExports.jsx(R5,{onSelectionChange:z}),Im,r.jsxRuntimeExports.jsx(g5,{proOptions:Qm,position:qm}),r.jsxRuntimeExports.jsx(h5,{rfId:io,disableKeyboardA11y:yi})]})})}var GS=Cd(YS);function US(){const e=ve();return j.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),o=Array.isArray(t)?t:[t],i=new Map;o.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 WS({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 XS({dimensions:e,lineWidth:t,variant:n,className:s}){return r.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Te(["react-flow__background-pattern",n,s])})}function qS({radius:e,className:t}){return r.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Te(["react-flow__background-pattern","dots",t])})}var gt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(gt||(gt={}));const QS={[gt.Dots]:1,[gt.Lines]:1,[gt.Cross]:6},JS=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ud({id:e,variant:t=gt.Dots,gap:n=20,size:s,lineWidth:o=1,offset:i=0,color:l,bgColor:a,style:c,className:d,patternClassName:x}){const p=j.useRef(null),{transform:m,patternId:h}=Ee(JS,ke),g=s||QS[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],k=S?[y,y]:v,T=[C[0]*m[2]||1+k[0]/2,C[1]*m[2]||1+k[1]/2],P=`${h}${e||""}`;return r.jsxRuntimeExports.jsxs("svg",{className:Te(["react-flow__background",d]),style:{...c,...Qs,"--xy-background-color-props":a,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[r.jsxRuntimeExports.jsx("pattern",{id:P,x:m[0]%v[0],y:m[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:E?r.jsxRuntimeExports.jsx(qS,{radius:y/2,className:x}):r.jsxRuntimeExports.jsx(XS,{dimensions:k,lineWidth:o,variant:t,className:x})}),r.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${P})`})]})}Ud.displayName="Background";const eR=j.memo(Ud);function tR(){return r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:r.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function nR(){return r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:r.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function sR(){return r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:r.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 oR(){return r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:r.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 rR(){return r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:r.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 os({children:e,className:t,...n}){return r.jsxRuntimeExports.jsx("button",{type:"button",className:Te(["react-flow__controls-button",t]),...n,children:e})}const iR=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Wd({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:o,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}=Ee(iR,ke),{zoomIn:y,zoomOut:C,fitView:k}=zt(),T=()=>{y(),i?.()},P=()=>{C(),l?.()},I=()=>{k(o),a?.()},B=()=>{g.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),c?.(!E)},F=m==="horizontal"?"horizontal":"vertical";return r.jsxRuntimeExports.jsxs(qs,{className:Te(["react-flow__controls",F,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":h??v["controls.ariaLabel"],children:[t&&r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(os,{onClick:T,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:R,children:r.jsxRuntimeExports.jsx(tR,{})}),r.jsxRuntimeExports.jsx(os,{onClick:P,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:S,children:r.jsxRuntimeExports.jsx(nR,{})})]}),n&&r.jsxRuntimeExports.jsx(os,{className:"react-flow__controls-fitview",onClick:I,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:r.jsxRuntimeExports.jsx(sR,{})}),s&&r.jsxRuntimeExports.jsx(os,{className:"react-flow__controls-interactive",onClick:B,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:E?r.jsxRuntimeExports.jsx(rR,{}):r.jsxRuntimeExports.jsx(oR,{})}),x]})}Wd.displayName="Controls";j.memo(Wd);function lR({id:e,x:t,y:n,width:s,height:o,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 r.jsxRuntimeExports.jsx("rect",{className:Te(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:x,ry:x,width:s,height:o,style:{fill:S,stroke:a,strokeWidth:c},shapeRendering:p,onClick:h?R=>h(R,e):void 0})}const aR=j.memo(lR),cR=e=>e.nodes.map(t=>t.id),_o=e=>e instanceof Function?e:()=>e;function uR({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:i=aR,onClick:l}){const a=Ee(cR,ke),c=_o(t),d=_o(e),x=_o(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:a.map(m=>r.jsxRuntimeExports.jsx(xR,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function dR({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:a,onClick:c}){const{node:d,x,y:p,width:m,height:h}=Ee(g=>{const{internals:E}=g.nodeLookup.get(e),S=E.userNode,{x:R,y:v}=E.positionAbsolute,{width:y,height:C}=dt(S);return{node:S,x:R,y:v,width:y,height:C}},ke);return!d||d.hidden||!Gu(d)?null:r.jsxRuntimeExports.jsx(a,{x,y:p,width:m,height:h,style:d.style,selected:!!d.selected,className:s(d),color:t(d),borderRadius:o,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:c,id:d.id})}const xR=j.memo(dR);var pR=j.memo(uR);const mR=200,fR=150,hR=e=>!e.hidden,gR=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?Yu(Vn(e.nodeLookup,{filter:hR}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},jR="react-flow__minimap-desc";function Xd({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:o="",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 k=ve(),T=j.useRef(null),{boundingRect:P,viewBB:I,rfId:B,panZoom:F,translateExtent:$,flowWidth:D,flowHeight:z,ariaLabelConfig:b}=Ee(gR,ke),N=e?.width??mR,_=e?.height??fR,M=P.width/N,V=P.height/_,H=Math.max(M,V),K=H*N,Z=H*_,G=C*H,Q=P.x-(K-P.width)/2-G,ee=P.y-(Z-P.height)/2-G,ae=K+G*2,re=Z+G*2,se=`${jR}-${B}`,te=j.useRef(0),le=j.useRef();te.current=H,j.useEffect(()=>{if(T.current&&F)return le.current=Ay({domNode:T.current,panZoom:F,getTransform:()=>k.getState().transform,getViewScale:()=>te.current}),()=>{le.current?.destroy()}},[F]),j.useEffect(()=>{le.current?.update({translateExtent:$,width:D,height:z,inversePan:v,pannable:E,zoomStep:y,zoomable:S})},[E,S,v,y,$,D,z]);const Re=h?me=>{const[X,de]=le.current?.pointer(me)||[0,0];h(me,{x:X,y:de})}:void 0,Ce=g?j.useCallback((me,X)=>{const de=k.getState().nodeLookup.get(X).internals.userNode;g(me,de)},[]):void 0,ue=R??b["minimap.ariaLabel"];return r.jsxRuntimeExports.jsx(qs,{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*H: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:Te(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:r.jsxRuntimeExports.jsxs("svg",{width:N,height:_,viewBox:`${Q} ${ee} ${ae} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:T,onClick:Re,children:[ue&&r.jsxRuntimeExports.jsx("title",{id:se,children:ue}),r.jsxRuntimeExports.jsx(pR,{onClick:Ce,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:a}),r.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q-G},${ee-G}h${ae+G*2}v${re+G*2}h${-ae-G*2}z
39
- M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Xd.displayName="MiniMap";j.memo(Xd);const ER=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,yR={[rn.Line]:"right",[rn.Handle]:"bottom-right"};function SR({nodeId:e,position:t,variant:n=rn.Handle,className:s,style:o=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=kd(),y=typeof e=="string"?e:v,C=ve(),k=j.useRef(null),T=n===rn.Handle,P=Ee(j.useCallback(ER(T&&h),[T,h]),ke),I=j.useRef(null),B=t??yR[n];j.useEffect(()=>{if(!(!k.current||!y))return I.current||(I.current=Xy({domNode:k.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:$,transform:D,snapGrid:z,snapToGrid:b,nodeOrigin:N,domNode:_}=C.getState();return{nodeLookup:$,transform:D,snapGrid:z,snapToGrid:b,nodeOrigin:N,paneDomNode:_}},onChange:($,D)=>{const{triggerNodeChanges:z,nodeLookup:b,parentLookup:N,nodeOrigin:_}=C.getState(),M=[],V={x:$.x,y:$.y},H=b.get(y);if(H&&H.expandParent&&H.parentId){const K=H.origin??_,Z=$.width??H.measured.width??0,G=$.height??H.measured.height??0,Q={id:H.id,parentId:H.parentId,rect:{width:Z,height:G,...Uu({x:$.x??H.position.x,y:$.y??H.position.y},{width:Z,height:G},H.parentId,b,K)}},ee=oi([Q],b,N,_);M.push(...ee),V.x=$.x?Math.max(K[0]*Z,$.x):void 0,V.y=$.y?Math.max(K[1]*G,$.y):void 0}if(V.x!==void 0&&V.y!==void 0){const K={id:y,type:"position",position:{...V}};M.push(K)}if($.width!==void 0&&$.height!==void 0){const Z={id:y,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};M.push(Z)}for(const K of D){const Z={...K,type:"position"};M.push(Z)}z(M)},onEnd:({width:$,height:D})=>{const z={id:y,type:"dimensions",resizing:!1,dimensions:{width:$,height:D}};C.getState().triggerNodeChanges([z])}})),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 F=B.split("-");return r.jsxRuntimeExports.jsx("div",{className:Te(["react-flow__resize-control","nodrag",...F,n,s]),ref:k,style:{...o,scale:P,...l&&{[T?"backgroundColor":"borderColor"]:l}},children:i})}j.memo(SR);const A=e=>r.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),je=e=>r.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Le=e=>r.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),he=e=>r.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),RR={left:{left:J.Left,right:J.Right,top:J.Top,bottom:J.Bottom},right:{left:J.Right,right:J.Left,top:J.Bottom,bottom:J.Top},top:{left:J.Bottom,right:J.Top,top:J.Left,bottom:J.Right},bottom:{left:J.Top,right:J.Bottom,top:J.Right,bottom:J.Left}},CR=(e,t)=>RR[t][e],bR=(e,t=!1)=>{if(t)return e;switch(e){case J.Left:return J.Right;case J.Right:return J.Left;case J.Top:return J.Bottom;case J.Bottom:return J.Top;default:return J.Top}},wR=(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},U=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=US()}catch{return null}const o=j.useRef(null),i=j.useRef(!0);return j.useEffect(()=>{if(o.current==null)return;if(i.current){i.current=!1;return}const a=o.current.closest(".react-flow__node")?.getAttribute("data-id");a!=null&&s?.(a)},[t,n]),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("span",{ref:o}),e]})},w=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:o,top:i,style:l,...a})=>{const c=wR(i,s,t,n);return r.jsxRuntimeExports.jsx(Pn,{position:bR(CR(e,t),!o),...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}})},fe=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:o,...i})=>r.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.fr.cssString(o),...i}),oe=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.B("symbol-primitive"),e),...t}),vR=.8,q=({dimensions:e,orientation:t="left",children:n,className:s,color:o,style:i={},scale:l=1,...a})=>{e=u.p.construct(t)==="y"?u._.swap(e):e;const d=u.fr.cssString(o),x=f.use();let p={...i,aspectRatio:`${e.width} / ${e.height}`,width:u._.scale(e,l*vR).width};return o!=null&&(p={...p,[u.CSS.var("symbol-color")]:u.fr.rgbString(o),[u.CSS.var("symbol-color-contrast")]:u.fr.rgbString(u.fr.pickByContrast(o,x.colors.gray.l0,x.colors.gray.l11))}),r.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:r.jsxRuntimeExports.jsx("g",{children:n})})},qd=({className:e,orientation:t="left",scale:n,color:s,...o})=>{const i=u.fr.cssString(s);return r.jsxRuntimeExports.jsxs(fe,{...o,orientation:t,className:u.CSS(u.CSS.B("four-way-valve"),e),children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:12.037,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:87.963,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:50,top:7.2916,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:50,top:92.6084,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:108,height:96},color:s,scale:n,children:[r.jsxRuntimeExports.jsx(A,{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}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M8.70001 73.5C24.7 73.5 28.7 86.8333 28.7 93.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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}),r.jsxRuntimeExports.jsx(A,{d:"M99.7 22.5C83.7 22.5 79.7 9.16667 79.7 2.5",strokeLinecap:"round"})]})]})},Qd=({color:e,orientation:t="left",scale:n,...s})=>r.jsxRuntimeExports.jsxs(fe,{...s,className:u.CSS(u.CSS.B("three-way-valve")),orientation:t,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),r.jsxRuntimeExports.jsx(A,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),Jd=({orientation:e="left",color:t,scale:n,...s})=>r.jsxRuntimeExports.jsxs(fe,{...s,children:[r.jsxRuntimeExports.jsxs(U,{orientation:e,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:r.jsxRuntimeExports.jsx(A,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),ex=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:o,...i})=>r.jsxRuntimeExports.jsxs(fe,{className:u.CSS(u.CSS.B("solenoid-valve"),s&&u.CSS.M("normally-open"),e),orientation:n,...i,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:69},color:t,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),r.jsxRuntimeExports.jsx(je,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),tx=({specKey:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:o,scale:i=1,className:l,stateOverrides:a,...c})=>{const d=zs.useDirect({params:{key:e}}),x=j.useRef(null);Vr({container:x.current,orientation:s,activeState:t?"active":"base",externalScale:i,spec:d?.data?.data,stateOverrides:a});const p=d?.data?.data?.handles||[];return r.jsxRuntimeExports.jsx(fe,{ref:x,className:u.CSS(u.CSS.BM("symbol","custom"),u.CSS.B("custom-actuator"),s!=null&&u.CSS.loc(s),t&&u.CSS.M("enabled"),n&&u.CSS.M("triggered"),l),enabled:t,triggered:n,...c,children:r.jsxRuntimeExports.jsx(U,{orientation:s,children:p.map(m=>r.jsxRuntimeExports.jsx(w,{id:m.key,location:m.orientation,orientation:s,left:m.position.x*100,top:m.position.y*100},m.key))})})},nx=({specKey:e,orientation:t="left",color:n,scale:s=1,className:o,stateOverrides:i,...l})=>{const a=zs.useDirect({params:{key:e}}),c=j.useRef(null);Vr({container:c.current,orientation:t,activeState:"base",externalScale:s,spec:a?.data?.data,stateOverrides:i});const d=a?.data?.data?.handles||[];return r.jsxRuntimeExports.jsx(oe,{ref:c,className:u.CSS(u.CSS.BM("symbol","custom"),u.CSS.B("custom-static"),t!=null&&u.CSS.loc(t),o),...l,children:r.jsxRuntimeExports.jsx(U,{orientation:t,children:d.map(x=>r.jsxRuntimeExports.jsx(w,{id:x.key,location:x.orientation,orientation:t,left:x.position.x*100,top:x.position.y*100},x.key))})})},sx=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{className:u.CSS(u.CSS.B("relief-valve"),e),enabled:o,...i,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),ox=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{orientation:t,className:u.CSS(u.CSS.B("check-valve"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),rx=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const i=u.fr.cssString(n);return r.jsxRuntimeExports.jsxs(oe,{...o,orientation:t,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(Le,{cx:"7",cy:"7",r:"4",fill:i}),r.jsxRuntimeExports.jsx(A,{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"})]})]})},ix=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const i=u.fr.cssString(n);return r.jsxRuntimeExports.jsxs(oe,{orientation:t,className:u.CSS(u.CSS.B("check-valve-with-arrow"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:8.602,top:60.65,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.775,top:60.65,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:93,height:57},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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}),r.jsxRuntimeExports.jsx(A,{d:"M62.5 6H32.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Le,{cx:"7.5",cy:"13.5",r:"6",fill:i}),r.jsxRuntimeExports.jsx(A,{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"})]})]})},lx=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,orientation:n,className:u.CSS(u.CSS.B("angled-valve"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),r.jsxRuntimeExports.jsx(A,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"})]})]}),ax=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("ball-valve"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Le,{cx:"43.5978",cy:"20.972",r:"19"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("three-way-ball-valve"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.8,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:33.1308,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:33.1308,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Le,{cx:"43.5978",cy:"21.722",r:"19"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),ux=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("gate-valve"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 2 L43.5 39.7965"})]})]}),dx=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-one"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 2V40"}),r.jsxRuntimeExports.jsx(Le,{cx:"43.5",cy:"21",r:"10",fill:u.fr.cssString(e)})]})]}),xx=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-two"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Le,{cx:"43.5",cy:"21",r:"10",fill:u.fr.cssString(e)}),r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),r.jsxRuntimeExports.jsx(A,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),px=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("breather-valve"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:8.081,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:91.919,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Le,{cx:"91",cy:"49.5",r:"6",fill:u.fr.cssString(e)}),r.jsxRuntimeExports.jsx(Le,{cx:"8",cy:"7.5",r:"6",fill:u.fr.cssString(e)}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),mx=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)})]})]}),fx=({className:e,color:t,orientation:n="left",scale:s,...o})=>{const i=u.fr.cssString(t);return r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("symbol"),e),children:[r.jsxRuntimeExports.jsx(U,{orientation:n,children:r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:5,top:50,id:"1"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),r.jsxRuntimeExports.jsx(A,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:i}),r.jsxRuntimeExports.jsx(A,{d:"M33 24H2",strokeLinecap:"round"})]})]})},hx=({className:e,color:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("symbol"),e),children:[r.jsxRuntimeExports.jsx(U,{orientation:n,children:r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),gx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("cap"),e),...o,children:[r.jsxRuntimeExports.jsx(U,{orientation:t,children:r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),r.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:r.jsxRuntimeExports.jsx(A,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),jx=({className:e,orientation:t="left",color:n,scale:s=1,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("cap"),e),...o,children:[r.jsxRuntimeExports.jsx(U,{orientation:t,children:r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:50,top:50,id:"1"})}),r.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:r.jsxRuntimeExports.jsx(A,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),Ex=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:t,className:u.CSS(u.CSS.B("manual-valve"),e),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),r.jsxRuntimeExports.jsx(A,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),yx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("orifice_plate"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{color:n,dimensions:{width:72,height:36},orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M24.5 33V22",strokeLinecap:"round"})]})]}),Hl=(e,t)=>e/t*100,Sx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("filter"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:r.jsxRuntimeExports.jsx(A,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17"})})]}),Rx=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,kR=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:o}=e;return`${t.x}% ${n.x}% ${o.x}% ${s.x}% / ${t.y}% ${n.y}% ${o.y}% ${s.y}%`},Cx={width:40,height:80},ii={x:50,y:10},Js=({className:e,dimensions:t=Cx,borderRadius:n=ii,boxBorderRadius:s,color:o,backgroundColor:i,strokeWidth:l=2,...a})=>{const c=Rx(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=Hl(1,p),E=100-g,S=Hl(1,m),R=100-S;return r.jsxRuntimeExports.jsx(oe,{className:u.CSS(e,u.CSS.B("tank")),style:{...t,borderRadius:s??kR(c),borderColor:u.fr.cssString(o??x.colors.gray.l11),backgroundColor:u.fr.cssString(i),borderWidth:l},...a,children:r.jsxRuntimeExports.jsxs(U,{refreshDeps:h,orientation:"left",children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:50,top:S,id:"1"}),d&&r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:g,top:c.topLeft.y,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:E,top:c.topRight.y,id:"3"})]}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:50,top:R,id:"4"}),d&&r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:g,top:100-c.bottomLeft.y,id:"5"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:E,top:100-c.bottomRight.y,id:"6"})]}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:g,top:50,id:"7"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:E,top:50,id:"8"})]})})},_R=20,LR=(e,t,n=0,s=4)=>{const o=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=o*d+i-Math.PI/2;return{x:a+l*Math.cos(x),y:a+l*Math.sin(x)}})},TR=(e,t,n)=>{const s=[],o=Math.min(n,t/2),i=e.length;if(i<3||o<=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=o/g,R=o/E,v=c.x-x*S,y=c.y-p*S,C=c.x+m*R,k=c.y+h*R;l===0?s.push(`M ${v},${y}`):s.push(`L ${v},${y}`),s.push(`Q ${c.x},${c.y} ${C},${k}`)}return s.push("Z"),s.join(" ")},li=({numSides:e,sideLength:t,rotation:n=0,color:s,backgroundColor:o,className:i,cornerRounding:l,strokeWidth:a,...c})=>{const d=f.use(),x=j.useMemo(()=>2*((a??2)+1),[a]),p=j.useMemo(()=>LR(e,t,n,x),[e,t,n,x]),m=j.useMemo(()=>TR(p,t,l??0),[p,t,l]),h=j.useMemo(()=>2*(t/(2*Math.sin(Math.PI/e)))+x,[t,e,x]);return r.jsxRuntimeExports.jsx(oe,{className:u.CSS(i,u.CSS.B("polygon")),...c,children:r.jsxRuntimeExports.jsx(q,{dimensions:{width:h,height:h},children:r.jsxRuntimeExports.jsx(A,{d:m,fill:u.fr.cssString(o??d.colors.gray.l1),stroke:u.fr.cssString(s??d.colors.gray.l9),strokeWidth:a??2})})})},bx=({radius:e,color:t,backgroundColor:n,className:s,strokeWidth:o,...i})=>{const l=(o??2)+1,a=e*2,c=a+2*l,d=a+2*l;return r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(s,u.CSS.B("circle-shape")),...i,children:[r.jsxRuntimeExports.jsxs(U,{orientation:"left",refreshDeps:e,children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:50,top:l/d*100,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:50,top:(d-l)/d*100,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:l/c*100,top:50,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:(c-l)/c*100,top:50,id:"4"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:c,height:d},children:r.jsxRuntimeExports.jsx(Le,{cx:c/2,cy:d/2,r:e,stroke:u.fr.cssString(t),strokeWidth:o??2,fill:u.fr.cssString(n)})})]})},wx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(e,u.CSS.B("regulator")),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),r.jsxRuntimeExports.jsx(A,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),r.jsxRuntimeExports.jsx(he,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),vx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(e,u.CSS.B("regulator-manual")),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50,top:2.2989,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.381,top:75,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.619,top:75,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:84},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.5 20L43.5 2",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M19.5 2L67.5 2",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:"43.5",y1:"63",x2:"43.5",y2:"40"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),kx=({className:e,orientation:t="left",scale:n,color:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("orifice"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[r.jsxRuntimeExports.jsx(A,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:t,className:u.CSS(u.CSS.B("needle-valve"),e),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:u.fr.cssString(n)}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),Lx=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("angled-relief-valve"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),r.jsxRuntimeExports.jsx(A,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),Tx=({className:e,color:t,dimensions:n,orientation:s="left",units:o="psi",unitsLevel:i="small",children:l,inlineSize:a=80,...c})=>{const d=u.fr.cssString(t),x=f.use(),p=t==null?"var(--pluto-gray-l0)":u.fr.cssString(u.fr.pickByContrast(t,x.colors.gray.l0,x.colors.gray.l11));return r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("value"),e),...c,style:{borderColor:d,height:n?.height},children:[r.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n?.width,inlineSize:a,maxWidth:n?.width},children:l}),r.jsxRuntimeExports.jsxs(U,{orientation:s,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:100,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),r.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.BE("value","units"),u.CSS.M(i)),style:{background:d},children:r.jsxRuntimeExports.jsx(f.Text,{level:i,color:p,children:o})})]})},Mx=({enabled:e=!1,onClick:t,orientation:n="left"})=>r.jsxRuntimeExports.jsxs(oe,{orientation:n,children:[r.jsxRuntimeExports.jsx(f.Switch$1,{value:e,onClick:t,onChange:()=>{}}),r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Nx=({onClick:e,onMouseDown:t,onMouseUp:n,orientation:s="left",label:o="",color:i,size:l,level:a,onClickDelay:c})=>r.jsxRuntimeExports.jsxs(oe,{orientation:s,children:[r.jsxRuntimeExports.jsx(f.Button,{variant:"filled",onClick:e,onMouseDown:t,onMouseUp:n,color:i,size:l,level:a,onClickDelay:c,children:o}),r.jsxRuntimeExports.jsxs(U,{orientation:s,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:s,left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:s,left:100,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:s,left:50,top:0,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:s,left:50,top:100,id:"4"})]})]}),Px=({className:e,orientation:t="left",width:n,color:s,level:o,autoFit:i,align:l="center",value:a,onChange:c,...d})=>{const x={textAlign:l};return u.p.construct(t)==="y"?x.height=i?"fit-content":n:x.width=i?"fit-content":n,r.jsxRuntimeExports.jsx(oe,{style:x,orientation:t,className:u.CSS(u.CSS.B("text-box"),u.CSS.loc(t),e),...d,children:r.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS.BE("symbol","label"),color:u.fr.cssString(s),level:o,value:a,onChange:c})})},Ax=({orientation:e="left",className:t,onClick:n,children:s,value:o,units:i,color:l,onChange:a,size:c="small",disabled:d,...x})=>{const[p,m]=j.useState(o);return r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("setpoint"),t),orientation:e,...x,children:[r.jsxRuntimeExports.jsxs(U,{orientation:e,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:e,left:.5,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:e,left:100,top:50,id:"2",style:{zIndex:5}}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:e,left:50,top:-2,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),r.jsxRuntimeExports.jsx(f.Numeric,{size:c,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,color:l,borderWidth:1,disabled:d,children:r.jsxRuntimeExports.jsx(f.Button,{size:c,variant:"filled",onClick:()=>a(p),color:l,children:"Set"})})]})},Ox=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("screw-pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(A,{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)}),r.jsxRuntimeExports.jsx(A,{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)})]})]}),Ix=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("vacuum-pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:r.jsxRuntimeExports.jsx(A,{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"})})]}),Dx=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("cavity-pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(A,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Bx=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("piston-pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(A,{d:"M 23 32, h 16, m 0 -8, v 16",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),$x=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("static-mixer"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),zx=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("rotary-mixer"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Vx=({className:e,color:t,orientation:n="left",enabled:s,scale:o,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,orientation:n,className:u.CSS(u.CSS.B("light"),s&&u.CSS.M("enabled"),e),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:64,height:64},color:t,orientation:n,scale:o,children:r.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"})})]}),Fx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(e,u.CSS.B("regulator")),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.29885,top:69.565,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.70115,top:69.565,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:23.1479,top:23.61,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50,top:11.11,id:"4"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:76.8521,top:23.61,id:"5"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:69},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(je,{x:"21",y:"6.5",width:"44",height:"18",rx:"2"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"49",x2:"43",y2:"24.5"})]})]}),Hx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(e,u.CSS.B("regulator-motorized")),...o,orientation:t,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:35.6321,top:13.72549,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50,top:1.96078,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:64.3679,top:13.72549,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:24.1379,top:46.078,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:75.8621,top:46.078,id:"5"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.2989,top:78.43137,id:"6"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7011,top:78.43137,id:"7"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:102},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"80.5",x2:"43",y2:"56"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(je,{x:"21",y:"38",width:"44",height:"18",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M43 38V26",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Le,{cx:"43",cy:"14",r:"12"})]})]}),Zx=({orientation:e="left",color:t,scale:n,...s})=>r.jsxRuntimeExports.jsxs(fe,{...s,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:e,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:e,left:50,top:1,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:88,height:86},color:t,orientation:e,scale:n,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M43 1L45 65"})]})]}),Kx=({orientation:e="left",color:t,scale:n,...s})=>r.jsxRuntimeExports.jsxs(fe,{...s,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:e,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:e,left:51,top:2,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),Yx=({orientation:e="left",color:t,scale:n,...s})=>r.jsxRuntimeExports.jsxs(fe,{...s,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:e,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:e,left:51,top:2,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"1",x2:"43",y2:"49"}),r.jsxRuntimeExports.jsx(je,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Gx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:t,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:51,top:2,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"1",x2:"43",y2:"49"}),r.jsxRuntimeExports.jsx(je,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),r.jsxRuntimeExports.jsx(he,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"49",x2:"43",y2:"83",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),Ux=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:t,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:51,top:2,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(je,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),Wx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:t,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:51,top:2,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Xx=({id:e,className:t,orientation:n="right",label:s="text",color:o,level:i="p",onLabelChange:l,...a})=>{const c=document.querySelector(`[data-id="${e}"]`);c&&c.classList.add(n);const d=u.p.construct(n)==="y";return r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("arrow"),u.CSS.loc(n),t),orientation:n,...a,children:[r.jsxRuntimeExports.jsx("div",{className:"wrapper",children:r.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:u.fr.cssString(o)},children:r.jsxRuntimeExports.jsx("div",{className:"bg",children:r.jsxRuntimeExports.jsx(f.MaybeEditable,{value:s,onChange:l,level:i,className:u.CSS.BE("symbol","label")})})})}),r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:d,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:d,id:"2"})]}),r.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:r.jsxRuntimeExports.jsx("defs",{children:r.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[r.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),r.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"}),r.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},qx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("vent"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),r.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:r.jsxRuntimeExports.jsx(A,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),Qx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("iso-filter"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:95,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),r.jsxRuntimeExports.jsx(he,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),Jx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("flow-straightener"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:3,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:50,top:93,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2.5",y:"2.5",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M10.5 26.5H60.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M10.5 9.5H60.5",strokeLinecap:"round"})]})]}),ep=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("heater-element"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:11.9,top:5.55555556,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:11.9,top:94,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:21,height:36},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M2.5 34.0005H14.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M2.5 2.00049L14.5 2.00049",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),tp=({className:e,dimensions:t=Cx,borderRadius:n=ii,boxBorderRadius:s,color:o,backgroundColor:i,...l})=>{const a=Rx(n),c=f.use(),d=j.useMemo(()=>[t,n,a],[a.bottomLeft,a.bottomRight,a.topLeft,a.topRight,t.height,t.width]),x=u.fr.cssString(o??c.colors.gray.l11),p=i==null?void 0:u.fr.cssString(i),m=t.width/66,h=t.height/180,g=`scale(${m},${h})`;return r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(e,u.CSS.B("cylinder")),style:{...t},...l,children:[r.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:r.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})}),r.jsxRuntimeExports.jsxs(U,{refreshDeps:d,orientation:"left",children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:50,top:2,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:35,top:10,id:"9"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:65,top:10,id:"10"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:4,top:40,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:96,top:40,id:"4"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:4,top:60,id:"5"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:96,top:60,id:"6"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:4,top:80,id:"7"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},np=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...i})=>{const l=u.fr.cssString(n);return r.jsxRuntimeExports.jsxs(fe,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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}),r.jsxRuntimeExports.jsx(A,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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}),r.jsxRuntimeExports.jsx(Le,{cx:"44",cy:"55",r:"4",fill:l}),r.jsxRuntimeExports.jsx(A,{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})]})]})},sp=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...i})=>{const l=u.fr.cssString(n);return r.jsxRuntimeExports.jsxs(fe,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(Le,{cx:"21",cy:"56.0737",r:"4",fill:l}),r.jsxRuntimeExports.jsx(A,{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"})]})]})},op=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("t-junction"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:3.8462,top:22.3095,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.1538,top:22.3095,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:50,top:92.8571,id:"3"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:39,height:21},color:n,orientation:t,scale:s,children:r.jsxRuntimeExports.jsx(A,{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.fr.cssString(n),stroke:"none"})})]}),rp=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("t-junction"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:3.8462,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.1539,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:50.5,top:96.1539,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50.5,top:3.8462,id:"4"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:39,height:39},color:n,orientation:t,scale:s,children:r.jsxRuntimeExports.jsx(A,{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.fr.cssString(n),stroke:"none"})})]}),Ue=({position:e,color:t})=>r.jsxRuntimeExports.jsx("text",{x:e?.x??57,y:e?.y??27,style:{fill:u.fr.cssString(t),fontWeight:450},stroke:"none",children:"F"}),ip=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-general"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(Ue,{position:{x:56,y:25},color:s})]})]}),lp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Electromagnetic"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M47.5 17.5H55.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M15.5 17.5H23.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(Ue,{position:{x:58,y:29},color:s})]})]}),ap=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-VariableArea"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M46 10V25"}),r.jsxRuntimeExports.jsx(A,{d:"M23 13V22"}),r.jsxRuntimeExports.jsx(A,{d:"M23 13L46 10"}),r.jsxRuntimeExports.jsx(A,{d:"M23 22L46 25"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),cp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Coriolis"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M2 17.6024H28.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M28.5 17.6024L34.6834 14.0324",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M34.8 14L45.9058 20.9666",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M51.5 17.6024L46.0141 20.8987",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M20.5 17.6024L26.6574 14.0474",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M26.75 14.1024L37.788 21.0265",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 17.6024L37.8427 21.0017",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 17.6024H69",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{position:{x:58,y:29},color:s})]})]}),up=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Nozzle"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M24 2V7V12",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M24 12H34",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M24 23H29H34",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M24 33V23",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),dp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Venturi"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M8 33L26.5329 22.3",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M8 2L26.5329 12.7",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M56 33L26.5876 22.2948",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M56 2L26.5876 12.7052",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{position:{x:56,y:29},color:s})]})]}),xp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-RingPiston"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(Le,{cx:"36.5",cy:"17.5",r:"10.5",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(Le,{cx:"36.5",cy:"21.5",r:"6.5",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(Ue,{position:{x:56,y:29},color:s})]})]}),pp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-PositiveDisplacement"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),mp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Turbine"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M16.5 17.5H54.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M32.5 9L35.4756 17.1753",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M38.5 26L35.5244 17.8247",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M32.5 26L35.4756 17.8247",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M38.5 9L35.5244 17.1753",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),fp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Pulse"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M31 13.5H39",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M23 21.5H31",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M39 21.5H47",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M39 13.5V21.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31 13.5V21.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),hp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-FloatSensor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M25 8H46",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31 27H40",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31 27L25.046 8.11641",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M40 27L45.954 8.11641",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),gp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Orifice"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M24.5 33V22",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),jp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("heat-exchanger-general"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.545,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.454,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.454,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(A,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Ep=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:89,top:27.27,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:89,top:72.73,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.455,id:"4"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.545,top:50,id:"5"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),yp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:9,top:6.25,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:24,top:93.75,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:76,top:6.25,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:91,top:93.75,id:"4"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:1.508,top:50,id:"5"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98.492,top:50,id:"6"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:199,height:48},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"3",y:"3",width:"193",height:"42",rx:"1",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(je,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(je,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(he,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24",strokeWidth:"2"})]})]}),Sp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Rp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Cp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("compressor"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:r.jsxRuntimeExports.jsx(A,{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,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(Le,{cx:"33",cy:"33",r:"14.5"})]})]}),wp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M35 12.4V20.4"}),r.jsxRuntimeExports.jsx(A,{d:"M3 33H16"}),r.jsxRuntimeExports.jsx(A,{d:"M35 53.6V45.6"})]})]}),vp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M39 33H47"}),r.jsxRuntimeExports.jsx(A,{d:"M27 33H19"}),r.jsxRuntimeExports.jsx(A,{d:"M36 27.804L40 20.8758"}),r.jsxRuntimeExports.jsx(A,{d:"M30 27.804L26 20.8758"}),r.jsxRuntimeExports.jsx(A,{d:"M30 38.196L26 45.1242"}),r.jsxRuntimeExports.jsx(A,{d:"M36 38.196L40 45.1242"})]})]}),kp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M3 33H63"})]})]}),Lp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:7.575,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:92.425,top:50,id:"2"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:r.jsxRuntimeExports.jsx(A,{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"})})]}),Tp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),r.jsxRuntimeExports.jsx(A,{d:"M16 2.5L16 66.5"}),r.jsxRuntimeExports.jsx(A,{d:"M2 34.5H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 19H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 50H30"}),r.jsxRuntimeExports.jsx(A,{d:"M29.121 3.37903L61 34.5"}),r.jsxRuntimeExports.jsx(A,{d:"M29.12 65.62L61 34.5"})]})]}),Mp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),r.jsxRuntimeExports.jsx(A,{d:"M30 2.5L30 66.5"}),r.jsxRuntimeExports.jsx(A,{d:"M16 2.5L16 66.5"}),r.jsxRuntimeExports.jsx(A,{d:"M2 34.5H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 19H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 50H30"})]})]}),Np=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),r.jsxRuntimeExports.jsx(A,{d:"M16 2.5L16 66.5"}),r.jsxRuntimeExports.jsx(A,{d:"M2 34.5H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 19H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 50H30"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),r.jsxRuntimeExports.jsx(he,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Pp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),r.jsxRuntimeExports.jsx(A,{d:"M16 2.5L16 66.5"}),r.jsxRuntimeExports.jsx(A,{d:"M2 34.5H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 19H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 50H30"}),r.jsxRuntimeExports.jsx(A,{d:"M29.121 3.37903L61 34.5"}),r.jsxRuntimeExports.jsx(A,{d:"M29.12 65.62L61 34.5"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),r.jsxRuntimeExports.jsx(he,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Ap=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("thruster"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:25.3,top:4.76,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:25.3,top:95.24,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),r.jsxRuntimeExports.jsx(A,{d:"M78.5 37.5117V4.51172"}),r.jsxRuntimeExports.jsx(A,{d:"M40.5 11.5L76.0072 2.6232"}),r.jsxRuntimeExports.jsx(A,{d:"M40.5 30.5L76.0072 39.3768"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Op=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("nozzle"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:18.75,top:17.46,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:1.5873,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:81.25,top:17.46,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:126},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"12",y:"1.6667",width:"40",height:"40",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M1.3333 124H62.6667",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Ip=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("strainer"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),r.jsxRuntimeExports.jsx(A,{d:"M2.293 2.29297L29.9383 66.7986",strokeDasharray:"6 6"})]})]}),Dp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("strainer"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),r.jsxRuntimeExports.jsx(A,{d:"M31 34.5L2.30611 2.33992",strokeDasharray:"6 6"}),r.jsxRuntimeExports.jsx(A,{d:"M31 34.5L2.30611 66.6601",strokeDasharray:"6 6"})]})]}),eo=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Ie=(e,t)=>{const n=eo(t),s=e.getNodes().find(o=>o.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()))},MR=(e,t)=>to.fromFlow(e,t);class Bp{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 to{key;box;handles;constructor(t,n,s){this.key=t,this.box=n,this.handles=s,s.forEach(o=>o.node=this)}static fromFlow(t,n){const s=Ie(n,t),o=eo(t),i=o.getElementsByClassName("react-flow__handle"),l=u.Ho.construct(o),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 Bp(x,m)});return new to(t,s,a)}}const NR="Schematic.Grid",no=u.CSS.B("drag-handle"),PR=e=>{const n=eo(e).closest(".react-flow__pane");n!=null&&f.triggerReflow(n)},Hn=e=>{const t=({symbolKey:s,items:o,onLocationChange:i})=>{const l=`${s}.${NR}`,[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=o.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 r.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})=>r.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,...o})=>{const{editable:i,items:l}=o;if(i)return r.jsxRuntimeExports.jsx(t,{symbolKey:s,...o});const a=l.filter(c=>c.location===e);return a.length===0?null:r.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})=>r.jsxRuntimeExports.jsx(j.Fragment,{children:c},d))})}},AR=Hn("top"),OR=Hn("left"),IR=Hn("right"),DR=Hn("bottom"),BR=Hn("center"),Vt=({editable:e,allowRotate:t=!0,children:n,allowCenter:s,onRotate:o,symbolKey:i,...l})=>{const a=j.useRef(e);return e!==a.current&&(PR(i),a.current=e),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(AR,{editable:e,symbolKey:i,...l},`top-${i}`),r.jsxRuntimeExports.jsx(OR,{editable:e,symbolKey:i,...l},`left-${i}`),r.jsxRuntimeExports.jsx(IR,{editable:e,symbolKey:i,...l},`right-${i}`),r.jsxRuntimeExports.jsx(DR,{editable:e,symbolKey:i,...l},`bottom-${i}`),s&&r.jsxRuntimeExports.jsx(BR,{editable:e,symbolKey:i,...l},`center-${i}`),e&&t&&r.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.BE("grid","rotate"),size:"tiny",variant:"filled",onClick:o,children:r.jsxRuntimeExports.jsx(f.Rotate,{})}),r.jsxRuntimeExports.jsx("div",{className:no,children:n})]})},$R=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===L.Wb.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)"}}},$p=({source:e,sink:t,className:n,...s})=>{const o=f.useMemoDeepEqual({source:e,sink:t}),[,{status:i},l]=f.use$2({type:O.Chip.TYPE,schema:O.chipStateZ,initialState:{triggered:!1,...o,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:u.r.now(),details:{}}}});j.useEffect(()=>{l(m=>({...m,...o}))},[o,l]);const a=j.useCallback(()=>l(m=>({...m,triggered:!m.triggered})),[l]),{message:c,chipColor:d,buttonStyle:x,disabled:p}=$R(i);return r.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(u.CSS.B("control-chip"),n),disabled:p,onClick:a,tooltip:r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:c}),style:x,...s,children:r.jsxRuntimeExports.jsx(f.Circle,{color:d})})},zp=j.createContext({needsControlOf:[]}),Vp=()=>j.use(zp),zR=({children:e,onStatusChange:t,...n})=>{const s=f.useMemoDeepEqual(n),[{path:o},{status:i,needsControlOf:l},a]=f.use$2({type:O.Controller.TYPE,schema:O.controllerStateZ,initialState:s});return j.useEffect(()=>{i!=null&&t?.(i)},[i,t]),j.useEffect(()=>{a(c=>({...c,...s}))},[s,a]),j.useEffect(()=>()=>t?.("released"),[]),r.jsxRuntimeExports.jsxs(zp,{value:{needsControlOf:l},children:[r.jsxRuntimeExports.jsx(f.Composite,{path:o,children:e}),";"]})},Fp=({colorSource:e,statusSource:t})=>{const n=f.useMemoDeepEqual({colorSource:e,statusSource:t}),[,{color:s,status:o},i]=f.use$2({type:O.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:u.r.now(),details:{color:void 0}}},schema:O.indicatorStateZ});j.useEffect(()=>{i(a=>({...a,...n}))},[n,i]);let l;return o.details?.color!=null?l=u.fr.colorZ.parse(o.details.color):s!=null&&!u.fr.isZero(s)?l=s:l="var(--pluto-gray-l10)",r.jsxRuntimeExports.jsxs(f.Dialog$1,{location:{x:"center",y:"bottom"},children:[r.jsxRuntimeExports.jsx(f.Text,{children:o.message}),r.jsxRuntimeExports.jsx("div",{className:u.CSS.B("indicator"),style:{backgroundColor:u.fr.cssString(l),flexGrow:1}})]})},VR=e=>{const{needsControlOf:t}=Vp(),[,{states:n},s]=f.use$2({type:O.Legend.TYPE,schema:O.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 L.Tt("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return r.jsxRuntimeExports.jsx(fr,{data:i,...e})},Hp=({children:e})=>{const[{path:t}]=f.use$2({type:O.StateProvider.TYPE,schema:O.stateProviderStateZ,initialState:{}});return r.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},FR=Object.freeze(Object.defineProperty({__proto__:null,Chip:$p,Controller:zR,Indicator:Fp,Legend:VR,StateProvider:Hp,useContext:Vp},Symbol.toStringTag,{value:"Module"})),HR=({aetherKey:e,source:t})=>{const n=f.useMemoDeepEqual({source:t}),[,{enabled:s},o]=f.use$2({aetherKey:e,type:O.Light.TYPE,schema:O.stateZ$1,initialState:{enabled:!1,...n}});return j.useEffect(()=>o(i=>({...i,...n})),[n,o]),{enabled:s}},ZR=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{value:o},i]=f.use$2({aetherKey:e,type:O.Setpoint.TYPE,schema:O.stateZ$2,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:o}},KR=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{triggered:o,enabled:i},l]=f.use$2({aetherKey:e,type:O.Toggle.TYPE,schema:O.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:o,enabled:i}},an=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:o="top",direction:i,align:l,maxInlineSize:a}=e;return n==null||n.length===0?null:{key:"label",element:r.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:o}},ai=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:o,indicator:i,orientation:l="bottom"}=e;return{key:"control",element:r.jsxRuntimeExports.jsxs(f.Box,{direction:u.p.swap(l),align:"center",className:u.CSS(u.CSS.B("control-state")),gap:"small",children:[t&&n&&r.jsxRuntimeExports.jsx($p,{size:"small",...o}),t&&s&&r.jsxRuntimeExports.jsx(Fp,{...i})]}),location:l}},be=(e,t)=>{const n=({symbolKey:s,control:o,source:i,sink:l,label:a,onChange:c,selected:d,orientation:x="left",position:p,...m})=>{const{enabled:h,triggered:g,toggle:E}=KR({aetherKey:s,source:i,sink:l}),S=[],R=an(a,c);R!=null&&S.push(R);const v=ai(o);return v!=null&&S.push(v),r.jsxRuntimeExports.jsx(Vt,{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:{...o,orientation:C}})},...t?.grid,children:r.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:o,onChange:i,selected:l,position:a,orientation:c="left",...d})=>{const x=[],p=an(o,i);return p!=null&&x.push(p),r.jsxRuntimeExports.jsx(Vt,{...t?.grid,items:x,editable:l,symbolKey:s,onRotate:()=>i({orientation:u.K$1.rotate90(c)}),onLocationChange:(m,h)=>{m==="label"&&i({label:{...o,orientation:h}})},children:r.jsxRuntimeExports.jsx(e,{orientation:c,...d})})};return n.displayName=e.displayName,n},Ft=e=>{const t=({symbolKey:n,label:s,onChange:o,selected:i,position:l,orientation:a="left",enabled:c=!1,clickable:d=!1,...x})=>{const p=[],m=an(s,o);m!=null&&p.push(m);const h=()=>{d&&o({enabled:!c})};return r.jsxRuntimeExports.jsx(Vt,{items:p,editable:i,symbolKey:n,onRotate:()=>o({orientation:u.K$1.rotate90(a)}),onLocationChange:(g,E)=>{g==="label"&&o({label:{...s,orientation:E}})},children:r.jsxRuntimeExports.jsx(e,{orientation:a,enabled:c,onClick:h,...x})})};return t.displayName=e.displayName,t},YR=be(tx),GR=be(Qd),UR=be(Jd),WR=be(ex),XR=be(qd),qR=be(lx),QR=be(mx),JR=be(Sp),e4=be(Rp),t4=be(Ix),n4=be(Dx),s4=be(Bx),o4=be(zx),r4=be(Zx),i4=be(Kx),l4=be(Yx),a4=be(Gx),c4=be(Ux),u4=be(Wx),d4=be(Ox),x4=be(Cp),p4=be(bp),m4=be(wp),f4=be(vp),h4=be(kp),g4=be(_p),j4=be(dx),E4=be(xx),y4=be(ax),S4=be(cx),R4=be(ux),C4=ce(wx),b4=ce(vx),w4=ce(Fx),v4=ce(Hx),k4=ce(fx),_4=ce(gx),L4=ce(jx),T4=ce(Sx),M4=ce(ox),N4=ce(rx),P4=ce(ix),A4=ce(kx),O4=be(Mx,{grid:{allowRotate:!1}}),I4=ce(qx),D4=ce(yx),B4=ce(Qx),$4=ce(Jx),z4=ce(ep),V4=ce(hx),F4=ce(nx),H4=ce(op),Z4=ce(rp,{grid:{allowRotate:!1}}),K4=ce($x),Y4=ce(ip),G4=ce(lp),U4=ce(ap),W4=ce(cp),X4=ce(up),q4=ce(dp),Q4=ce(xp),J4=ce(pp),eC=ce(mp),tC=ce(fp),nC=ce(hp),sC=ce(gp),oC=ce(jp),rC=ce(Ep),iC=ce(yp),lC=ce(Lp),aC=ce(Mp),cC=ce(Tp),uC=ce(Np),dC=ce(Pp),xC=ce(Ap),pC=ce(Op),mC=ce(Ip),fC=ce(Dp),hC=Ft(_x),gC=Ft(sx),jC=Ft(np),EC=Ft(sp),yC=Ft(Ex),SC=Ft(Lx),RC=Ft(px),CC=ce(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:i})=>r.jsxRuntimeExports.jsx(Js,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:i,backgroundColor:e}),{grid:{allowCenter:!0,allowRotate:!1}}),bC=e=>r.jsxRuntimeExports.jsx(Js,{...e,dimensions:{width:25,height:50}});ce(({sideLength:e,rotation:t,color:n,backgroundColor:s,numSides:o,...i})=>r.jsxRuntimeExports.jsx(li,{numSides:3,sideLength:e,rotation:t,color:n,backgroundColor:s,...i}));const wC=ce(({numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:o,backgroundColor:i,strokeWidth:l,...a})=>r.jsxRuntimeExports.jsx(li,{numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:o,backgroundColor:i,strokeWidth:l,...a})),vC=ce(({radius:e,color:t,backgroundColor:n,strokeWidth:s,...o})=>r.jsxRuntimeExports.jsx(bx,{radius:e,color:t,backgroundColor:n,strokeWidth:s,...o}),{grid:{allowRotate:!1}}),kC=ce(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:o,dimensions:i,strokeWidth:l})=>r.jsxRuntimeExports.jsx(Js,{onResize:a=>n({dimensions:a}),orientation:s,color:o,dimensions:i,boxBorderRadius:t,backgroundColor:e,strokeWidth:l}),{grid:{allowCenter:!0,allowRotate:!1}}),_C=e=>r.jsxRuntimeExports.jsx(Js,{...e,dimensions:{width:25,height:50},borderRadius:0}),LC=({label:e,symbolKey:t,orientation:n="left",control:s,units:o,source:i,sink:l,color:a,onChange:c,selected:d,draggable:x,size:p,disabled:m})=>{const{value:h,set:g}=ZR({aetherKey:t,source:i,sink:l}),E=[],S=ai(s);S!=null&&E.push(S);const R=an(e,c);return R!=null&&E.push(R),r.jsxRuntimeExports.jsx(Vt,{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:r.jsxRuntimeExports.jsx(Ax,{value:h,onChange:g,units:o,color:a,orientation:n,disabled:m,size:p})})},TC=({className:e,...t})=>r.jsxRuntimeExports.jsx(Ax,{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:r.jsxRuntimeExports.jsx(f.Text,{children:"10.0"})}),MC=u.K.construct(10,-3),NC=u.K.construct(1,1),PC=({symbolKey:e,label:t,level:n="p",position:s,textColor:o,color:i,telem:l,units:a,onChange:c,inlineSize:d=70,selected:x,draggable:p,notation:m,stalenessColor:h,stalenessTimeout:g,redline:E})=>{const S=Ps.useTypography(n),R=(S.lineHeight+.5)*S.baseSize+2,v=j.useMemo(()=>{if(l==null||E==null)return;const{bounds:T,gradient:P}=E;return O.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:l,scale:O.scaleNumber({scale:u.C.Scale.scale(T).scale(0,1).transform}),gradient:O.colorGradient({gradient:P})},outlet:"gradient"})},[l,E]),{width:y}=Zr({aetherKey:e,color:o,level:n,box:u.Ho.construct(u.K.translateY({...s},1),{height:R,width:d}),telem:l,backgroundTelem:v,minWidth:d,stalenessColor:h,stalenessTimeout:g,notation:m,useWidthForBackground:!0,valueBackgroundOverScan:MC,valueBackgroundShift:NC}),C=[],k=an(t,c);return k!=null&&C.push(k),r.jsxRuntimeExports.jsx(Vt,{editable:x&&!p,symbolKey:e,items:C,allowRotate:!1,onLocationChange:(T,P)=>{T==="label"&&c({label:{...t,orientation:P}})},children:r.jsxRuntimeExports.jsx(Tx,{color:i,dimensions:{height:R,width:y},inlineSize:d,units:a,unitsLevel:L.downLevel(n)})})},AC=({color:e})=>r.jsxRuntimeExports.jsx(Tx,{color:e,dimensions:{width:60,height:25},units:"psi",children:r.jsxRuntimeExports.jsx(f.Text,{children:"50.00"})}),OC=({symbolKey:e,label:t,orientation:n="left",sink:s,control:o,selected:i,draggable:l,onChange:a,mode:c,...d})=>{const{onMouseDown:x,onMouseUp:p}=b0({aetherKey:e,sink:s,mode:c}),m=[],h=ai(o);return h!=null&&m.push(h),r.jsxRuntimeExports.jsx(Vt,{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:r.jsxRuntimeExports.jsx(Nx,{...t,onMouseDown:x,onMouseUp:p,orientation:n,...d})})},IC=({label:e,...t})=>r.jsxRuntimeExports.jsx(Nx,{label:"Button",...t}),DC=({symbolKey:e,label:t,source:n,onChange:s,selected:o,...i})=>{const{enabled:l}=HR({aetherKey:e,source:n}),a=[],c=an(t,s);return c!=null&&a.push(c),r.jsxRuntimeExports.jsx(Vt,{items:a,allowRotate:!1,editable:o,symbolKey:e,onLocationChange:(d,x)=>{d==="label"&&s({label:{...t,orientation:x}})},children:r.jsxRuntimeExports.jsx(Vx,{enabled:l,...i})})},BC=({label:{label:e,level:t},orientation:n,color:s,onChange:o})=>r.jsxRuntimeExports.jsx(Xx,{className:no,onLabelChange:i=>o({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),$C=({label:e,...t})=>r.jsxRuntimeExports.jsx(Xx,{label:"Off Page",...t,orientation:"right"}),zC=ce(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:i})=>r.jsxRuntimeExports.jsx(tp,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:i,backgroundColor:e})),VC=e=>r.jsxRuntimeExports.jsx(tp,{...e,dimensions:{width:25,height:50}}),FC=({onChange:e,symbolKey:t,color:n,width:s,align:o,autoFit:i,level:l,value:a})=>r.jsxRuntimeExports.jsx(Px,{className:no,onChange:c=>e({value:c}),value:a,level:l,color:n,width:s,align:o,autoFit:i},t),HC=e=>r.jsxRuntimeExports.jsx(Px,{...e,autoFit:!0,value:"Text Box"}),W=4,Zn=2,ZC=["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","customActuator","customStatic"],KC=ne.z.enum(ZC),ie={orientation:"left",scale:1},YC={source:O.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:O.streamChannelValue({channel:0}),rollingAverage:O.rollingAverage({windowSize:1}),stringifier:O.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},GC={...ie,source:O.sourcePipeline("number",{connections:[],segments:{valueStream:O.streamChannelValue({channel:0})},outlet:"valueStream"})},UC={...ie,sink:O.sinkPipeline("number",{connections:[],segments:{setter:O.setChannelValue({channel:0})},inlet:"setter"})},Zp={...ie,source:O.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:O.streamChannelValue({channel:0}),threshold:O.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},Kp={...ie,control:{show:!0},sink:O.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:O.setChannelValue({channel:0}),setpoint:O.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},Se={...Zp,...Kp},Ht={...ie,enabled:!1,clickable:!1},Y=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),WC={width:125,height:200},ci={dimensions:WC},XC=3,qC={name:"Three Way",key:"threeWayValve",Form:ye,Symbol:GR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three Way"),...Se}),Preview:Qd,zIndex:W},QC={name:"Generic",key:"valve",Form:ye,Symbol:UR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Valve"),...Se}),Preview:Jd,zIndex:W},JC={name:"Solenoid",key:"solenoidValve",Form:ye,Symbol:WR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Solenoid Valve"),normallyOpen:!1,...Se}),Preview:ex,zIndex:W},e6={name:"Four Way",key:"fourWayValve",Form:ye,Symbol:XR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Four Way Valve"),...Se}),Preview:qd,zIndex:W},t6={name:"Angled",key:"angledValve",Form:ye,Symbol:qR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Valve"),...Se}),Preview:lx,zIndex:W},n6={name:"Ball",key:"ballValve",Form:ye,Symbol:y4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ball Valve"),...Se}),Preview:ax,zIndex:W},s6={name:"Three-Way Ball",key:"threeWayBallValve",Form:ye,Symbol:S4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three-Way Ball Valve"),...Se}),Preview:cx,zIndex:W},o6={name:"Gate",key:"gateValve",Form:ye,Symbol:R4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Gate Valve"),...Se}),Preview:ux,zIndex:W},r6={name:"Butterfly (Remote)",key:"butterflyValveOne",Form:ye,Symbol:j4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Remote)"),...Se}),Preview:dx,zIndex:W},i6={name:"Butterfly (Manual)",key:"butterflyValveTwo",Form:ye,Symbol:E4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Manual)"),...Se}),Preview:xx,zIndex:W},l6={name:"Breather",key:"breatherValve",Form:$t,Symbol:RC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Breather Valve"),...Ht}),Preview:Qe(px,["clickable"]),zIndex:W},a6={name:"Pump",key:"pump",Form:ye,Symbol:QR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pump"),...Se}),Preview:mx,zIndex:W},c6={name:"Screw",key:"screwPump",Form:ye,Symbol:d4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Screw Pump"),...Se}),Preview:Ox,zIndex:W},u6={name:"Tank",key:"tank",Form:pu,Symbol:CC,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.fr.setAlpha(e.colors.gray.l1,0),...Y("Tank"),borderRadius:ii,...ci,...ie}),Preview:bC,zIndex:Zn},d6={name:"Polygon",key:"polygon",Symbol:wC,Form:A0,defaultProps:e=>({numSides:6,sideLength:_R,cornerRounding:0,rotation:0,color:e.colors.gray.l11,backgroundColor:u.fr.setAlpha(e.colors.gray.l1,0),strokeWidth:2,...Y("Polygon")}),Preview:Qe(li,["clickable"]),zIndex:Zn},x6={name:"Circle",key:"circle",Symbol:vC,Form:O0,defaultProps:e=>({radius:20,color:e.colors.gray.l11,backgroundColor:u.fr.setAlpha(e.colors.gray.l1,0),...Y("Circle"),strokeWidth:2}),Preview:Qe(bx,["clickable"]),zIndex:Zn},p6={name:"Cylinder",key:"cylinder",Form:U0,Symbol:zC,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.fr.setAlpha(e.colors.gray.l1,0),...Y("cylinder"),dimensions:{width:66,height:181},...ie}),Preview:VC,zIndex:Zn},m6={name:"Box",key:"box",Form:W0,Symbol:kC,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.fr.setAlpha(e.colors.gray.l1,0),...Y("Box"),borderRadius:XC,strokeWidth:2,...ci,...ie}),Preview:_C,zIndex:Zn},f6={name:"Relief",key:"reliefValve",Form:$t,Symbol:gC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Relief Valve"),...Ht}),Preview:Qe(sx,["clickable"]),zIndex:W},h6={name:"Spring Loaded Relief",key:"springLoadedReliefValve",Form:$t,Symbol:jC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Spring Loaded Relief Valve"),...Ht}),Preview:Qe(np,["clickable"]),zIndex:W},g6={name:"Angled Spring Loaded Relief",key:"angledSpringLoadedReliefValve",Form:$t,Symbol:EC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Spring Loaded Relief Valve"),...Ht}),Preview:Qe(sp,["clickable"]),zIndex:W},j6={name:"Regulator",key:"regulator",Form:xe,Symbol:C4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Regulator"),...ie}),Preview:wx,zIndex:W},E6={name:"Manual",key:"regulatorManual",Form:xe,Symbol:b4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Regulator"),...ie}),Preview:Qe(vx,["clickable"]),zIndex:W},y6={name:"Electric",key:"electricRegulator",Form:xe,Symbol:w4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator"),...ie}),Preview:Fx,zIndex:W},S6={name:"Motorized",key:"electricRegulatorMotorized",Form:xe,Symbol:v4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator Motorized"),...ie}),Preview:Hx,zIndex:W},R6={name:"Standard",key:"burstDisc",Form:xe,Symbol:k4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Burst Disc"),...ie}),Preview:fx,zIndex:W},C6={name:"ISO",key:"isoBurstDisc",Form:xe,Symbol:V4,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Burst Disc"),...ie}),Preview:hx,zIndex:W},b6={name:"Cap",key:"cap",Form:xe,Symbol:_4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cap"),...ie}),Preview:gx,zIndex:W},w6={name:"ISO Cap",key:"isoCap",Form:xe,Symbol:L4,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Cap"),...ie}),Preview:jx,zIndex:W},v6={name:"Manual",key:"manualValve",Form:$t,Symbol:yC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Valve"),...Ht}),Preview:Qe(Ex,["clickable"]),zIndex:W},k6={name:"Plate",key:"orificePlate",Form:xe,Symbol:D4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Plate"),...ie}),Preview:yx,zIndex:W},_6={name:"ISO Filter",key:"isoFilter",Form:xe,Symbol:B4,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Filter"),...ie}),Preview:Qx,zIndex:W},L6={name:"Filter",key:"filter",Form:xe,Symbol:T4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Filter"),...ie}),Preview:Sx,zIndex:W},T6={name:"Flow Straightener",key:"flowStraightener",Form:xe,Symbol:$4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flow Straightener"),...ie}),Preview:Jx,zIndex:W},M6={name:"Heater",key:"heaterElement",Form:xe,Symbol:z4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Heater Element"),...ie}),Preview:ep,zIndex:W},N6={name:"Needle",key:"needleValve",Form:$t,Symbol:hC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Needle Valve"),...Ht}),Preview:Qe(_x,["clickable"]),zIndex:W},P6={name:"Check",key:"checkValve",Form:xe,Symbol:M4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...ie}),Preview:ox,zIndex:W},A6={name:"Orifice",key:"orifice",Form:xe,Symbol:A4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice"),...ie}),Preview:kx,zIndex:W},O6={name:"Angled Relief",key:"angledReliefValve",Form:$t,Symbol:SC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Relief Valve"),...Ht}),Preview:Qe(Lx,["clickable"]),zIndex:W},I6={name:"Value",key:"value",Form:B0,Symbol:PC,Preview:AC,defaultProps:e=>({color:e.colors.gray.l11,units:"psi",level:"h5",inlineSize:70,...Y("Value"),...ie,stalenessTimeout:5,stalenessColor:e.colors.warning.m1,telem:YC.source,redline:vn}),zIndex:W},D6={name:"Button",key:"button",Symbol:OC,Form:H0,Preview:IC,defaultProps:e=>({color:e.colors.primary.z,...Y("Button"),...Kp,mode:"fire",onClickDelay:0,scale:null}),zIndex:W},B6={name:"Switch",key:"switch",Symbol:O4,Form:X0,defaultProps:()=>({...Y("Switch"),...Se,scale:null}),Preview:Mx,zIndex:W},$6={name:"Vacuum",key:"vacuumPump",Symbol:t4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vacuum Pump"),...Se}),Preview:Ix,zIndex:W},z6={name:"Compressor",key:"compressor",Symbol:x4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Compressor"),...Se}),Preview:Cp,zIndex:W},V6={name:"Cavity",key:"cavityPump",Symbol:n4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cavity Pump"),...Se}),Preview:Dx,zIndex:W},F6={name:"Piston",key:"pistonPump",Symbol:s4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Piston Pump"),...Se}),Preview:Bx,zIndex:W},H6={name:"Static Mixer",key:"staticMixer",Symbol:K4,Form:xe,defaultProps:e=>({color:e.colors.gray.l11,...Y("Static Mixer"),...ie}),Preview:$x,zIndex:W},Z6={name:"Rotary Mixer",key:"rotaryMixer",Symbol:o4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Rotary Mixer"),...Se}),Preview:zx,zIndex:W},K6={name:"Light",key:"light",Symbol:DC,Form:V0,defaultProps:e=>({color:e.colors.gray.l11,...Y("Light"),...Zp}),Preview:Vx,zIndex:W},Y6={name:"Setpoint",key:"setpoint",Symbol:LC,Form:K0,defaultProps:e=>({units:"mV",color:e.colors.gray.l11,size:"small",...Y("Setpoint"),...GC,...UC}),Preview:TC,zIndex:W},G6={name:"Agitator",key:"agitator",Symbol:r4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Agitator"),...Se}),Preview:Zx,zIndex:W},U6={name:"Propeller Agitator",key:"propellerAgitator",Symbol:i4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Propeller Agitator"),...Se}),Preview:Kx,zIndex:W},W6={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:l4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flat Blade Agitator"),...Se}),Preview:Yx,zIndex:W},X6={name:"Paddle Agitator",key:"paddleAgitator",Symbol:a4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Paddle Agitator"),...Se}),Preview:Gx,zIndex:W},q6={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:c4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cross Beam Agitator"),...Se}),Preview:Ux,zIndex:W},Q6={name:"Helical Agitator",key:"helicalAgitator",Symbol:u4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Helical Agitator"),...Se}),Preview:Wx,zIndex:W},J6={name:"Text Box",key:"textBox",Symbol:FC,Form:Y0,defaultProps:e=>({color:e.colors.gray.l11,autoFit:!0,align:"center",...Y("Text Box"),...ie,...ci,level:"p",value:"Text Box",width:75}),Preview:HC,zIndex:W},eb={name:"Off Page",key:"offPageReference",Form:G0,Symbol:BC,defaultProps:e=>({color:e.colors.gray.l11,orientation:"right",...Y("Off Page Reference")}),Preview:$C,zIndex:W},tb={name:"ISO Check",key:"isoCheckValve",Form:xe,Symbol:N4,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Check Valve"),...ie}),Preview:rx,zIndex:W},nb={name:"Check (Arrow)",key:"checkValveWithArrow",Form:xe,Symbol:P4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...ie}),Preview:ix,zIndex:W},sb={name:"Vent",key:"vent",Form:xe,Symbol:I4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vent"),...ie}),Preview:qx,zIndex:W},ob={name:"T Junction",key:"tJunction",Form:xe,Symbol:H4,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...ie}),Preview:op,zIndex:W+20},rb={name:"Cross Junction",key:"crossJunction",Form:xe,Symbol:Z4,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...ie}),Preview:rp,zIndex:W+20},ib={name:"General",key:"flowmeterGeneral",Form:xe,Symbol:Y4,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Flowmeter"),...ie}),Preview:ip,zIndex:W},lb={name:"Electromagnetic",key:"flowmeterElectromagnetic",Form:xe,Symbol:G4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electromagnetic Flowmeter"),...ie}),Preview:lp,zIndex:W},ab={name:"Variable Area",key:"flowmeterVariableArea",Form:xe,Symbol:U4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Variable Area Flowmeter"),...ie}),Preview:ap,zIndex:W},cb={name:"Coriolis",key:"flowmeterCoriolis",Form:xe,Symbol:W4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Coriolis Flowmeter"),...ie}),Preview:cp,zIndex:W},ub={name:"Nozzle",key:"flowmeterNozzle",Form:xe,Symbol:X4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle Flowmeter"),...ie}),Preview:up,zIndex:W},db={name:"Venturi",key:"flowmeterVenturi",Form:xe,Symbol:q4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Venturi Flowmeter"),...ie}),Preview:dp,zIndex:W},xb={name:"Ring Piston",key:"flowmeterRingPiston",Form:xe,Symbol:Q4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ring Piston Flowmeter"),...ie}),Preview:xp,zIndex:W},pb={name:"Positive Displacement",key:"flowmeterPositiveDisplacement",Form:xe,Symbol:J4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Positive Displacement Flowmeter"),...ie}),Preview:pp,zIndex:W},mb={name:"Turbine",key:"flowmeterTurbine",Form:xe,Symbol:eC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbine Flowmeter"),...ie}),Preview:mp,zIndex:W},fb={name:"Pulse",key:"flowmeterPulse",Form:xe,Symbol:tC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pulse Flowmeter"),...ie}),Preview:fp,zIndex:W},hb={name:"Float Sensor",key:"flowmeterFloatSensor",Form:xe,Symbol:nC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Float Sensor Flowmeter"),...ie}),Preview:hp,zIndex:W},gb={name:"Orifice",key:"flowmeterOrifice",Form:xe,Symbol:sC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Flowmeter"),...ie}),Preview:gp,zIndex:W},jb={name:"Heat Exchanger",key:"heatExchangerGeneral",Form:xe,Symbol:oC,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Heat Exchanger"),...ie}),Preview:jp,zIndex:W},Eb={name:"M-Type Heat Exchanger",key:"heatExchangerM",Form:xe,Symbol:rC,defaultProps:e=>({color:e.colors.gray.l11,...Y("M Heat Exchanger"),...ie}),Preview:Ep,zIndex:W},yb={name:"Straight Tube Heat Exchanger",key:"heatExchangerStraightTube",Form:xe,Symbol:iC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Straight Tube Heat Exchanger"),...ie}),Preview:yp,zIndex:W},Sb={name:"Turbo Compressor",key:"turboCompressor",Form:ye,Symbol:p4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbo Compressor"),...Se}),Preview:bp,zIndex:W},Rb={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:ye,Symbol:m4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Roller Vane Compressor"),...Se}),Preview:wp,zIndex:W},Cb={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:ye,Symbol:f4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Liquid Ring Compressor"),...Se}),Preview:vp,zIndex:W},bb={name:"Ejector Compressor",key:"ejectorCompressor",Form:ye,Symbol:h4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejector Compressor"),...Se}),Preview:kp,zIndex:W},wb={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:ye,Symbol:g4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Centrifugal Compressor"),...Se}),Preview:_p,zIndex:W},vb={name:"Diaphragm Pump",key:"diaphragmPump",Form:ye,Symbol:JR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Diaphragm Pump"),...Se}),Preview:Sp,zIndex:W},kb={name:"Ejection",key:"ejectionPump",Form:ye,Symbol:e4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejection Pump"),...Se}),Preview:Rp,zIndex:W},_b={name:"Standard",key:"flameArrestor",Form:xe,Symbol:lC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor"),...ie}),Preview:Lp,zIndex:W},Lb={name:"Explosion-Proof",key:"flameArrestorExplosion",Form:xe,Symbol:aC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Explosion-Proof)"),...ie}),Preview:Mp,zIndex:W},Tb={name:"Detonation-Proof",key:"flameArrestorDetonation",Form:xe,Symbol:cC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Detonation-Proof)"),...ie}),Preview:Tp,zIndex:W},Mb={name:"Fire Resistant",key:"flameArrestorFireRes",Form:xe,Symbol:uC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant)"),...ie}),Preview:Np,zIndex:W},Nb={name:"Fire Resistant & Detonation-Proof",key:"flameArrestorFireResDetonation",Form:xe,Symbol:dC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...ie}),Preview:Pp,zIndex:W},Pb={name:"Thruster",key:"thruster",Form:ye,Symbol:xC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Thruster"),...Se}),Preview:Ap,zIndex:W},Ab={name:"Nozzle",key:"nozzle",Form:xe,Symbol:pC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle"),...ie}),Preview:Op,zIndex:W},Ob={name:"Strainer",key:"strainer",Form:xe,Symbol:mC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer"),...ie}),Preview:Ip,zIndex:W},Ib={name:"Cone",key:"strainerCone",Form:xe,Symbol:fC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer Cone"),...ie}),Preview:Dp,zIndex:W},Db={name:"Custom Actuator",key:"customActuator",Form:ye,Symbol:YR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Custom Actuator"),...Se,specKey:"",stateOverrides:[]}),Preview:tx,zIndex:W},Bb={name:"Custom Static",key:"customStatic",Form:xe,Symbol:F4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Custom Static"),...ie,specKey:"",stateOverrides:[]}),Preview:nx,zIndex:W},$b={value:I6,button:D6,tank:u6,polygon:d6,circle:x6,tJunction:ob,crossJunction:rb,switch:B6,offPageReference:eb,light:K6,setpoint:Y6,box:m6,textBox:J6,valve:QC,solenoidValve:JC,threeWayValve:qC,fourWayValve:e6,angledValve:t6,ballValve:n6,threeWayBallValve:s6,gateValve:o6,butterflyValveOne:r6,butterflyValveTwo:i6,breatherValve:l6,manualValve:v6,needleValve:N6,reliefValve:f6,angledReliefValve:O6,checkValve:P6,regulator:j6,regulatorManual:E6,electricRegulator:y6,electricRegulatorMotorized:S6,springLoadedReliefValve:h6,angledSpringLoadedReliefValve:g6,pump:a6,pistonPump:F6,screwPump:c6,cavityPump:V6,diaphragmPump:vb,ejectionPump:kb,vacuumPump:$6,compressor:z6,turboCompressor:Sb,rollerVaneCompressor:Rb,liquidRingCompressor:Cb,ejectorCompressor:bb,centrifugalCompressor:wb,staticMixer:H6,rotaryMixer:Z6,burstDisc:R6,isoBurstDisc:C6,cap:b6,isoCap:w6,filter:L6,isoFilter:_6,flowStraightener:T6,heaterElement:M6,orifice:A6,orificePlate:k6,agitator:G6,propellerAgitator:U6,flatBladeAgitator:W6,paddleAgitator:X6,crossBeamAgitator:q6,helicalAgitator:Q6,isoCheckValve:tb,checkValveWithArrow:nb,vent:sb,cylinder:p6,flowmeterGeneral:ib,flowmeterElectromagnetic:lb,flowmeterVariableArea:ab,flowmeterCoriolis:cb,flowmeterNozzle:ub,flowmeterVenturi:db,flowmeterRingPiston:xb,flowmeterPositiveDisplacement:pb,flowmeterTurbine:mb,flowmeterPulse:fb,flowmeterFloatSensor:hb,flowmeterOrifice:gb,heatExchangerGeneral:jb,heatExchangerM:Eb,heatExchangerStraightTube:yb,flameArrestor:_b,flameArrestorExplosion:Lb,flameArrestorDetonation:Tb,flameArrestorFireRes:Mb,flameArrestorFireResDetonation:Nb,thruster:Pb,nozzle:Ab,strainer:Ob,strainerCone:Ib,customActuator:Db,customStatic:Bb},zb=[{key:"general",Icon:f.Channel,name:"General",symbols:["value","setpoint","textBox","offPageReference","button","switch","light","polygon","circle","box"]},{key:"vessels",name:"Vessels",Icon:f.Tank,symbols:["tank","cylinder","tJunction","crossJunction"]},{key:"valves",name:"Valves",Icon:f.Valve,symbols:["valve","solenoidValve","threeWayValve","fourWayValve","angledValve","ballValve","threeWayBallValve","gateValve","butterflyValveOne","butterflyValveTwo","breatherValve","manualValve","needleValve","reliefValve","angledReliefValve","springLoadedReliefValve","angledSpringLoadedReliefValve","checkValve","isoCheckValve","checkValveWithArrow","regulator","regulatorManual","electricRegulator","electricRegulatorMotorized"]},{key:"pumps",name:"Pumps",Icon:f.Pump,symbols:["pump","screwPump","pistonPump","cavityPump","diaphragmPump","ejectionPump","vacuumPump","compressor","turboCompressor","rollerVaneCompressor","liquidRingCompressor","ejectorCompressor","centrifugalCompressor"]},{key:"meters",name:"Flow Meters",Icon:f.Rule,symbols:["flowmeterGeneral","flowmeterElectromagnetic","flowmeterVariableArea","flowmeterCoriolis","flowmeterNozzle","flowmeterVenturi","flowmeterRingPiston","flowmeterPositiveDisplacement","flowmeterTurbine","flowmeterPulse","flowmeterFloatSensor","flowmeterOrifice"]},{key:"process",name:"Process",Icon:f.Process,symbols:["heatExchangerGeneral","heatExchangerM","heatExchangerStraightTube","staticMixer","rotaryMixer","agitator","propellerAgitator","flatBladeAgitator","paddleAgitator","crossBeamAgitator","helicalAgitator"]},{key:"safety",name:"Safety",Icon:f.Safety,symbols:["burstDisc","isoBurstDisc","flameArrestor","flameArrestorDetonation","flameArrestorExplosion","flameArrestorFireRes","flameArrestorFireResDetonation"]},{key:"fittings",name:"Fittings",Icon:f.Fitting,symbols:["cap","isoCap","orifice","orificePlate","vent","nozzle","heaterElement","thruster","filter","isoFilter","strainer","strainerCone","flowStraightener"]}],Vb=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:iu,GROUPS:zb,REGISTRY:$b,STORE_CONFIG:lu,StateOverrideControls:cu,extractRegions:S0,formSchema:au,retrieve:zs,retrieveGroup:d0,useCustom:Vr,useDelete:u0,useForm:a0,useList:l0,useRename:c0,variantZ:KC},Symbol.toStringTag,{value:"Module"})),Fb=Object.freeze(Object.defineProperty({__proto__:null,DRAG_HANDLE_CLASS:no,Symbol:Vb},Symbol.toStringTag,{value:"Module"})),Yp=({children:e})=>{const{path:t}=f.useUnidirectional({type:O.BaseProvider.TYPE,schema:O.providerStateZ$2,state:{}});return r.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},Hb=new Set([u.n.UUID,u.n.JSON]),Zb=e=>{if(e.equals(u.n.JSON))return r.jsxRuntimeExports.jsx(f.JSON,{});if(e.isInteger)return r.jsxRuntimeExports.jsx(f.Binary,{});if(e.isFloat)return r.jsxRuntimeExports.jsx(f.Decimal,{});if(e.equals(u.n.STRING)||e.equals(u.n.UUID))return r.jsxRuntimeExports.jsx(f.String,{});if(e.equals(u.n.TIMESTAMP))return r.jsxRuntimeExports.jsx(f.Time$1,{})},Gp=u.n.ALL.filter(e=>e!==u.n.UNKNOWN).map(e=>({key:e.toString(),name:Hb.has(e)?e.toString().toUpperCase():u.U.capitalize(e.toString()),icon:Zb(e)})),Kb=Gp.filter(e=>!new u.n(e.key).isVariable),Yb=({hideVariableDensity:e=!1,...t})=>{const n=e?Kb:Gp;return r.jsxRuntimeExports.jsx(An,{...t,data:n,resourceName:"Data Type"})},Gb=Object.freeze(Object.defineProperty({__proto__:null,Provider:Yp,SelectDataType:Yb},Symbol.toStringTag,{value:"Module"})),Up=e=>{const t=({disabled:n=!1,...s})=>n?s.children:r.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},Wp="workspaces",Ub={channel:L.pT.SET_CHANNEL_NAME,schema:L.pT.workspaceZ,onChange:({store:e,changed:t})=>e.workspaces.set(t.key,t)},Wb={channel:L.pT.DELETE_CHANNEL_NAME,schema:L.pT.keyZ,onChange:({store:e,changed:t})=>e.workspaces.delete(t)},Xp={listeners:[Ub,Wb]},Xb=Ye({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)]}),qb=Ve({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)]}),Qb=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:Xp,FLUX_STORE_KEY:Wp,retrieve:Xb,useList:qb},Symbol.toStringTag,{value:"Module"})),Jb=Up(Yp),e9=Up(f.Provider$4),qp={[O.FLUX_STORE_KEY]:O.FLUX_STORE_CONFIG,[Lc]:Tc,[Sc]:Rc,[hc]:gc,[kc]:_c,[Wp]:Xp,[Vc]:Hc,[Fc]:Zc,[Gc]:eu,[sc]:oc,[Uc]:nu,[iu]:lu,[mc]:fc},t9=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:o,tooltip:i,triggers:l,alamos:a,haul:c,telem:d,color:x})=>r.jsxRuntimeExports.jsx(f.Provider$1,{...l,children:r.jsxRuntimeExports.jsx(f.Config,{...i,children:r.jsxRuntimeExports.jsx(f.Provider$2,{...c,children:r.jsxRuntimeExports.jsx(f.Provider$3,{url:s??Nj,enabled:n,children:r.jsxRuntimeExports.jsx(e9,{workerKey:"vis",children:r.jsxRuntimeExports.jsx(Mj,{...a,children:r.jsxRuntimeExports.jsx(f.Aggregator,{children:r.jsxRuntimeExports.jsx(Xa,{connParams:t,children:r.jsxRuntimeExports.jsx(Qa,{storeConfig:qp,children:r.jsxRuntimeExports.jsx(_e.Provider,{...x,children:r.jsxRuntimeExports.jsx(f.Provider,{...o,children:r.jsxRuntimeExports.jsx(Jb,{...d,children:r.jsxRuntimeExports.jsx(Hp,{children:e})})})})})})})})})})})})}),n9=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:qp,Provider:t9},Symbol.toStringTag,{value:"Module"})),s9=({value:e})=>r.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress"),children:r.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress-bar"),style:{width:`${e}%`}})}),o9=Object.freeze(Object.defineProperty({__proto__:null,Progress:s9},Symbol.toStringTag,{value:"Module"})),r9=({steps:e,value:t,onChange:n,...s})=>{const o=e.findIndex(i=>i.key===t);return r.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",className:u.CSS.B("steps"),...s,children:e.map((i,l)=>r.jsxRuntimeExports.jsxs(j.Fragment,{children:[r.jsxRuntimeExports.jsxs(f.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>o,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&r.jsxRuntimeExports.jsx(f.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l10)"}})]},i.key))})},i9=Object.freeze(Object.defineProperty({__proto__:null,Steps:r9},Symbol.toStringTag,{value:"Module"})),l9=({children:e,className:t,visible:n,...s})=>{const[{path:o},,i]=f.use$2({type:O.Table.TYPE,schema:O.Table.stateZ,initialState:{region:u.Ho.ZERO,visible:n}});j.useEffect(()=>{i(a=>({...a,visible:n}))},[n]);const l=On(a=>i(c=>({...c,region:a})));return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{ref:l,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),r.jsxRuntimeExports.jsx("table",{className:u.CSS(u.CSS.B("table"),t),...s,children:r.jsxRuntimeExports.jsx("tbody",{children:r.jsxRuntimeExports.jsx(f.Composite,{path:o,children:e})})})]})},a9=({children:e,className:t,size:n,index:s,onResize:o,onSelect:i,position:l,...a})=>r.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),t),...a,children:[o!=null&&r.jsxRuntimeExports.jsx(Jp,{onSelect:i,index:s,value:n,onChange:o,position:l,direction:"y"}),e]}),ui=({ref:e,children:t,className:n,selected:s=!1,...o})=>r.jsxRuntimeExports.jsx("td",{ref:e,...o,className:u.CSS(u.CSS.BE("table","cell"),u.CSS.selected(s),n),children:t}),Qp="ABCDEFGHIJKLMNOPQRSTUVWXYZ",c9=e=>Qp[e],Jp=({value:e,selected:t=!1,index:n,onChange:s,position:o,direction:i="x",onSelect:l})=>{const a=f.useSyncedRef(e),c=j.useRef(e),d=_e.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 r.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.p.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[r.jsxRuntimeExports.jsx(f.Text,{full:"x",justify:"center",align:"center",square:!1,children:i==="x"?Qp[n]:n+1}),r.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[u.p.location(i)]:o+e},onDragStart:d,draggable:!0})]})},u9=({selected:e,onSelect:t,columns:n,onResize:s})=>{let o=15;return r.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),u.CSS.BE("table","col-resizer")),children:[r.jsxRuntimeExports.jsx("td",{}),n.map((i,l)=>{const a=o;return o+=i,r.jsxRuntimeExports.jsx(Jp,{onSelect:t,position:a,selected:e.includes(l),index:l,value:i,onChange:c=>s(c,l),direction:"x"},l)})]})},d9=Object.freeze(Object.defineProperty({__proto__:null,Cell:ui,ColumnIndicators:u9,Row:a9,Table:l9,getCellColumn:c9},Symbol.toStringTag,{value:"Module"})),x9="text",em=ne.z.object({value:ne.z.string(),level:L.levelZ,weight:L.weightZ,align:u.K$1.x.or(u.K$1.center),backgroundColor:u.fr.crudeZ}),tm=({cellKey:e,onChange:t,value:n,selected:s,onSelect:o,align:i,level:l,weight:a,backgroundColor:c})=>{const d=p=>o(e,p),x=p=>t({level:l,value:p,weight:a,align:i,backgroundColor:c});return r.jsxRuntimeExports.jsx(ui,{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.fr.cssString(c)},children:r.jsxRuntimeExports.jsx(f.Editable,{level:l,value:n,weight:a,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},p9="value",nm=ne.z.object({telem:O.stringSourceSpecZ,redline:du,level:L.levelZ,color:ne.z.string(),units:ne.z.string(),stalenessTimeout:ne.z.number().optional().default(5),stalenessColor:u.fr.colorZ.optional().default(u.fr.ZERO)}),sm=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:o,bounds:i},selected:l,box:a,onSelect:c,stalenessTimeout:d,stalenessColor:x})=>{const{width:p}=Zr({aetherKey:e,box:a,telem:t,level:n,color:s,stalenessTimeout:d,stalenessColor:x,backgroundTelem:O.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:O.scaleNumber({scale:u.C.Scale.scale(i).scale(0,1).transform}),gradient:O.colorGradient({gradient:o})},outlet:"gradient"}),location:{x:"center",y:"center"}}),m=h=>c(e,h);return r.jsxRuntimeExports.jsx(ui,{id:e,selected:l,onClick:m,onContextMenu:m,style:{height:"5rem",width:p},className:u.CSS(f.CONTEXT_TARGET,l&&f.CONTEXT_SELECTED,u.CSS.BEM("table","cell","value"))})},m9={padding:"2rem"},Lo=e=>r.jsxRuntimeExports.jsx(f.Box,{...e,style:m9,y:!0}),f9=[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],om=({onVariantChange:e})=>{const t=j.useCallback(({tabKey:s})=>{switch(s){case"telem":return r.jsxRuntimeExports.jsx(Lo,{children:r.jsxRuntimeExports.jsx(Hr,{path:""})});case"redline":return r.jsxRuntimeExports.jsx(Lo,{children:r.jsxRuntimeExports.jsx(Fr,{path:"redline"})});default:return r.jsxRuntimeExports.jsx(Lo,{children:r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Variant",padHelpText:!1,children:r.jsxRuntimeExports.jsx(di,{onChange:e,value:"value"})}),r.jsxRuntimeExports.jsx(ge,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:o,onChange:i,variant:l,...a})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:o??u.fr.setAlpha(u.fr.ZERO,1),onChange:i,...a,bordered:!0})}),r.jsxRuntimeExports.jsx(ge,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:o,onChange:i,variant:l,...a})=>r.jsxRuntimeExports.jsx(ln,{value:o,onChange:i,...a})})]})})}},[]),n=Me.useStatic({tabs:f9,content:t});return r.jsxRuntimeExports.jsx(Me.Tabs,{...n})},h9={padding:"2rem"},rm=({onVariantChange:e})=>r.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,style:h9,children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Variant",padHelpText:!1,children:r.jsxRuntimeExports.jsx(di,{onChange:e,value:"text"})}),r.jsxRuntimeExports.jsx(wr,{path:"value",label:"Text"}),r.jsxRuntimeExports.jsx(ge,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:t,onChange:n,variant:s,...o})=>r.jsxRuntimeExports.jsx(ln,{value:t,onChange:n,...o})}),r.jsxRuntimeExports.jsx(ge,{path:"weight",label:"Weight",padHelpText:!1,children:({value:t,onChange:n,variant:s,...o})=>r.jsxRuntimeExports.jsx(Ea,{value:t,onChange:n,...o})}),r.jsxRuntimeExports.jsx(ge,{path:"align",label:"Alignment",hideIfNull:!0,children:({value:t,onChange:n,variant:s,...o})=>r.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:t,onChange:n,...o})}),r.jsxRuntimeExports.jsx(ge,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:t,onChange:n})})]}),g9=[{key:"text",name:"Text",icon:r.jsxRuntimeExports.jsx(f.Text$3,{})},{key:"value",name:"Value",icon:r.jsxRuntimeExports.jsx(f.Channel,{})}],di=e=>r.jsxRuntimeExports.jsx(An,{...e,data:g9,resourceName:"Variant"}),j9=["text","value"],E9=ne.z.enum(j9),y9={key:"value",name:"Value",Form:om,Cell:sm,defaultProps:e=>({telem:O.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:O.streamChannelValue({channel:0}),rollingAverage:O.rollingAverage({windowSize:1}),stringifier:O.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"}),redline:vn,color:u.fr.hex(e.colors.gray.l10),level:"h5",units:"",stalenessTimeout:5,stalenessColor:e.colors.warning.m1}),schema:nm},S9={key:"text",name:"Text",Form:rm,Cell:tm,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:em},R9={text:S9,value:y9},C9=Object.freeze(Object.defineProperty({__proto__:null,CELLS:R9,SelectVariant:di,TEXT_TYPE:x9,Text:tm,TextForm:rm,VALUE_TYPE:p9,Value:sm,ValueForm:om,textPropsZ:em,valuePropsZ:nm,variantZ:E9},Symbol.toStringTag,{value:"Module"})),Zl=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const o=bt(e,...n);return u.K.distance(o,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",o),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Kl=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:o,targetBox:i})=>{if(!b9({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=u.p.construct(t),a=u.p.swap(l);let c=vt(a,s[a]-e[a]);const d=u.Ho.loc(n,c);if(u.K$1.swap(t)===o){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]+Ot(c,De)}},tr=ne.z.object({direction:u.p.direction,length:ne.z.number()}),bt=(e,...t)=>{let n=e;for(const s of t)n=u.K.translate(n,s.direction,s.length);return n},im=(e,t,n,s)=>{try{let o=e;const i=[e,...t.map(h=>(o=u.K.translate(o,h.direction,h.length),o))];if(!s)return i;const l=t[0],a=vt(l.direction,l.length),c=Yl(a),d=4*(2-n**.5);i[0]=u.K.translate(i[0],{[l.direction]:-1*c*d,[u.p.swap(l.direction)]:0});const x=t[t.length-1],p=vt(x.direction,x.length),m=Yl(p);return i[i.length-1]=u.K.translate(i[i.length-1],{[x.direction]:m*d,[u.p.swap(x.direction)]:0}),i}catch{return[]}},De=10,Yl=e=>e==="top"||e==="left"?-1:1,Ot=(e,t)=>e==="top"||e==="left"?-t:t,vt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ht=e=>vt(e.direction,e.length),b9=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=u.p.construct(n),o=t[s]-e[s];return Ot(n,o)<0},rs=e=>({direction:u.p.construct(e),length:Ot(e,De)}),Gl={top:rs("top"),bottom:rs("bottom"),left:rs("left"),right:rs("right")},w9=4,v9=.25,so=e=>nr(k9(nr(e))),k9=e=>{const t=[...e],n=e.findIndex((s,o)=>{const i=Math.abs(s.length);if(i<w9){if(o===0||o===e.length-1)return!1;if(i<v9)return!0;if(e.length<=3)return!1;if(o+2<e.length){const l=t[o+2];if(l.direction!==s.direction)return!1;t[o+2]={...l,length:l.length+s.length}}else{const l=t[o-2];if(l.direction!==s.direction)return!1;t[o-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},nr=e=>{const t=[...e];return e.findIndex((s,o)=>{const i=t[o-1];if(o===0||s.direction!==i.direction)return!1;if(o===1){const l=o-1,a=o,c=ht(i),d=ht(s);if(c===d)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(i.length)===De)return!1;const x=Ot(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(o===e.length-1){const l=o,a=o-1,c=ht(s),d=ht(i);if(c===d)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(s.length)===De)return!1;const x=Ot(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[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0})!==-1?nr(t):t},Yt=e=>so(_9(e)),_9=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:o,sourceOrientation:i})=>{let l=i,a=o,c={...Gl[i]},d=bt(n,c);const x={...Gl[o]};let p=bt(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=bt(n,c),p=bt(s,x));const g=[c],E=Kl({sourceStumpTip:d,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:o,targetBox:t});E!=null&&(g.push(E),d=bt(d,E),l=ht(E),c=E);const S=Kl({sourceStumpTip:p,sourceOrientation:a,sourceBox:t,targetStumpTip:d,targetOrientation:l,targetBox:e});S!=null&&(p=bt(p,S),a=vt(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)===o){const P=u.p.construct(l),I=(p[P]-d[P])/2;g.push({direction:P,length:I});const B=u.p.swap(P);return g.push({direction:B,length:p[B]-d[B]}),g.push({direction:P,length:I}),R(),g}const v=p[c.direction]-d[c.direction];let y=u.p.swap(c.direction);const C=d[y]-p[y];let k;vt(c.direction,v)===l&&vt(y,C)===a?k={direction:c.direction,length:v}:(k={direction:y,length:p[y]-d[y]},y=u.p.swap(y)),g.push(k);const T={direction:y,length:p[y]-d[y]};return g.push(T),R(),g},L9=e=>so(T9(e)),T9=({segments:e,index:t,magnitude:n})=>{const s=[...e],o=s[t],i=u.p.swap(o.direction),l=ht(o);if(t===0){s.unshift({direction:i,length:n});const a=Ot(l,De);s.unshift({direction:o.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=Ot(l,De);s.push({direction:o.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},M9=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},N9=(e,t,n=!1,...s)=>{const o=(i,l)=>!s.includes(l)&&t(i,l);return n?M9(e,o):e.findIndex(o)},P9=({delta:e,segments:t})=>so(lm(e,t,!1)),A9=({delta:e,segments:t})=>so(lm(e,t,!0)),lm=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Wl("x",e,s,n)),e.y!==0&&(s=Wl("y",e,s,n)),s},Ul=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},o=ht(t),i=ht(s),l=Math.abs(s.length),a=Math.abs(t.length);return(l>a||l>De)&&o===i},Wl=(e,t,n,s)=>{const o=u.p.swap(e),i=s?n.length-1:0,l=n[i];if(Ul(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=N9(n,p=>p.direction===e,s,i);if(d===a){const p=n[a];return Ul(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:o,length:n[0].length/2},{direction:e,length:-t[e]},{direction:o,length:n[0].length/2}]:l.direction===e?(n[i]={...l,length:l.length-t[e]},n):[{direction:o,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},O9=ne.z.object({position:u.K.xy,zoom:ne.z.number()}),am=ne.z.object({color:u.fr.crudeZ,variant:ne.z.string().optional(),segments:ne.z.array(tr)}),I9=am.extend({key:ne.z.string(),source:ne.z.string(),target:ne.z.string(),segments:ne.z.array(tr),color:u.fr.crudeZ,id:ne.z.string(),data:ne.z.object({segments:ne.z.array(tr),color:u.fr.crudeZ,variant:ne.z.string().optional()}).optional(),selected:ne.z.boolean(),sourceHandle:ne.z.string().nullable().optional(),targetHandle:ne.z.string().nullable().optional()}),D9=ne.z.object({key:ne.z.string(),position:u.K.xy,selected:ne.z.boolean().optional(),zIndex:ne.z.number().optional(),type:ne.z.string().optional(),data:u.l$1.unknownZ.optional(),measured:ne.z.object({width:ne.z.number().optional(),height:ne.z.number().optional()}).optional()}),xi=(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})),pi=e=>e.map(({segments:t,color:n,variant:s,...o})=>({...o,id:o.key,data:{segments:t,color:n,variant:s}})),cm=e=>e.map(t=>({key:t.id,...t})),um=(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})),dm=e=>({...e.position,zoom:e.zoom}),xm=e=>({position:u.K.construct(e),zoom:e.zoom}),pm=(e,t)=>cm(t(xi(e))),xs=(e,t,n)=>um(t(pi(e)),n),B9=(e,t="x")=>{if(e.length===0)return[];const n=u.K$1.construct(t),s=u.K$1.swap(n);return e.sort((o,i)=>u.Ho.loc(o.box,n)-u.Ho.loc(i.box,n)),e.forEach((o,i)=>{if(i===0)return;const a=e[i-1].handles.find(h=>h.orientation===s),c=o.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(o.box),p);o.box=u.Ho.construct(m,u.Ho.dims(o.box))}),e},$9=(e,t)=>e.map((n,s)=>u.K.translate(n,t[s])),mm=({points:e,color:t,...n})=>r.jsxRuntimeExports.jsx(qe,{path:jt(e),style:{stroke:u.fr.cssString(t)},...n}),z9=({points:e,color:t,...n})=>r.jsxRuntimeExports.jsx(qe,{path:jt(e),style:{stroke:u.fr.cssString(t),strokeDasharray:"12,4"},...n}),V9=({points:e,color:t,...n})=>r.jsxRuntimeExports.jsx(qe,{path:jt(e),style:{stroke:u.fr.cssString(t),strokeDasharray:"12,4,4"},...n}),F9=({points:e,color:t,...n})=>{const s=u.K.calculateMiters(e,6),o=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.fr.cssString(t),a=.7;return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(qe,{path:jt(o),style:{stroke:l,opacity:a},...n}),r.jsxRuntimeExports.jsx(qe,{path:jt(e),style:{stroke:l},...n}),r.jsxRuntimeExports.jsx(qe,{path:jt(i),style:{stroke:l,opacity:a},...n})]})},Xl=5,H9=(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 o=t;let i=0,l=o;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+=o,!(u.K.distance(m,x)<Xl||u.K.distance(m,d)<Xl)&&n.push({position:m,direction:h})}i+=c}return n},Z9=({color:e,position:t,direction:n})=>{const o="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,r.jsxRuntimeExports.jsx("path",{d:o,stroke:u.fr.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},K9=({color:e,position:t,direction:n})=>{const o="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),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("path",{d:o,stroke:u.fr.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),r.jsxRuntimeExports.jsx("path",{d:o,stroke:u.fr.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${i.x},${i.y}) rotate(${l})`,strokeLinecap:"round"})]})},Y9=({color:e,position:t})=>r.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:u.fr.cssString(e),strokeWidth:2}),mi=e=>{const t=({points:n,color:s,...o})=>{const i=jt(n),l=H9(n,40);return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(qe,{path:i,...o,style:{stroke:u.fr.cssString(s)}}),l.map(({position:a,direction:c},d)=>r.jsxRuntimeExports.jsx(e,{position:a,direction:c,color:s},d))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},G9=mi(Z9),U9=mi(K9),W9=mi(Y9),jt=e=>{let t="";const s=e.length+-1;for(let o=0;o<s;o++){const i=e[o%e.length],l=e[(o+1)%e.length],a=Math.min(6/Math.hypot(l.x-i.x,l.y-i.y),.5);o>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),o===0?t+=`M${i.x},${i.y}`:o===0&&(t+=`M${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),o===s-1?t+=`L${l.x},${l.y}`:o<s-1&&(t+=`L${i.x*a+l.x*(1-a)},${i.y*a+l.y*(1-a)}`)}return t},fm={pipe:mm,electric:z9,secondary:V9,jacketed:F9,hydraulic:G9,pneumatic:U9,data:W9},hm=mm,X9=[{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"}],q9=e=>r.jsxRuntimeExports.jsx(An,{data:X9,...e,resourceName:"Path Type"}),Q9=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:o,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=zt(),m=Yt({sourcePos:u.K.construct(e,t),targetPos:u.K.construct(n,s),sourceOrientation:o,targetOrientation:i,sourceBox:Ie(p,l?.id??""),targetBox:Ie(p,l?.id??"")}),h=im(u.K.construct(e,t),m,p.getZoom(),!1);return r.jsxRuntimeExports.jsx(hm,{points:h,style:{...a,stroke:u.fr.cssString(c==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l11)"),strokeWidth:2,fill:"none"}})},J9=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:o,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=zt(),[C,k,T]=f.useCombinedStateAndRef(()=>a.length>0?a:Yt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ie(y,t),targetBox:Ie(y,n)})),P=j.useRef(i),I=j.useRef(s),B=_e.useDebouncedCallback(c,100,[c]);if(!E||!v){let b=C;const N=u.K.translation(g.current,h),_=u.K.translation(S,R.current);u.K.equals(N,u.K.scale(_,-1),.001)?(g.current=h,R.current=S):(E?v||(b=A9({delta:_,segments:b}),P.current!==i&&(P.current=i,b=Yt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ie(y,t),targetBox:Ie(y,n)})),Zl({sourcePos:h,targetPos:S,next:b,prev:C})||(b=Yt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ie(y,t),targetBox:Ie(y,n)})),R.current=S):(b=P9({delta:N,segments:b}),I.current!==s&&(I.current=s,b=Yt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ie(y,t),targetBox:Ie(y,n)})),Zl({sourcePos:h,targetPos:S,next:b,prev:C})||(b=Yt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ie(y,t),targetBox:Ie(y,n)})),g.current=h),B(b),k(b))}const F=j.useRef(null),$=_e.useCursorDrag({onStart:j.useCallback((b,N,_)=>{F.current={index:Number(_.currentTarget.id.split("-")[1]),segments:[...T.current]}},[]),onMove:j.useCallback(b=>{if(F.current==null)return;const N=L9({segments:F.current.segments,index:F.current.index,magnitude:u.Ho.dim(b,u.p.swap(F.current.segments[F.current.index].direction),!0)/y.getZoom()});k(N)},[]),onEnd:j.useCallback(()=>c(T.current),[c])}),D=im(h,C,y.getZoom(),!0),z=fm[p];return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(z,{points:D,color:d}),x&&e7(D).map((b,N)=>{const _=C[N].direction,M=u.p.swap(_),V={[u.p.dimension(_)]:"18px",[u.p.dimension(M)]:"4px"},H={[_]:b[_]-9,[M]:b[M]-2};return r.jsxRuntimeExports.jsxs(j.Fragment,{children:[r.jsxRuntimeExports.jsx("rect",{className:u.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...V,...H,rx:"2px",ry:"2px"}),r.jsxRuntimeExports.jsx("foreignObject",{x:b.x-9,y:b.y-9,width:"18px",height:"18px",children:r.jsxRuntimeExports.jsx("div",{id:`handle-${N}`,className:u.CSS(u.CSS.BE("diagram-edge-handle","dragger"),u.CSS.dir(_)),draggable:!0,onDragStart:$})})]},N)})]})},e7=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)}),t7=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:u.K.ZERO,zoom:1}})=>{const[o,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:o,onEditableChange:i,fitViewOnResize:g,setFitViewOnResize:E,viewportMode:l,onViewportModeChange:a}},n7=()=>!0,s7={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},o7={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},sr={maxZoom:1,minZoom:.5,padding:.05},r7={hideAttribution:!0},gm=j.createContext({editable:!0,visible:!0,viewportMode:"select",onViewportModeChange:()=>{},onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),cn=()=>j.use(gm),jm=j.memo(({children:e})=>{const{registerNodeRenderer:t}=cn();return j.useEffect(()=>t(e),[t,e]),null});jm.displayName="NodeRenderer";const i7=["Backspace","Delete"],l7={panOnDrag:[f.MOUSE_LEFT_NUMBER,f.MOUSE_MIDDLE_NUMBER]},a7={selectionOnDrag:!0,panOnDrag:[f.MOUSE_MIDDLE_NUMBER]},c7=e=>e==="pan"?l7:a7,u7=({aetherKey:e,onNodesChange:t,onEdgesChange:n,nodes:s,edges:o,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:O.Diagram$1.TYPE,schema:O.diagramStateZ,initialState:{position:a.position,region:u.Ho.ZERO,zoom:a.zoom,...R}}),{fitView:C}=zt(),k=_e.useDebouncedCallback(X=>void C(X),50,[C]),T=On(j.useCallback(X=>{x&&k(sr),y(de=>({...de,region:X}))},[y,k,x]));j.useEffect(()=>y(X=>({...X,...R})),[R]);const P=u.fr.hex(f.use().colors.gray.l11),I=f.useMemoCompare(()=>c??Er.zoom,f.compareModeConfigs,[c]),B=j.useRef(null),F=j.useCallback(X=>{const de=B.current;de!=null&&de.x===X.x&&de.y===X.y&&de.zoom===X.zoom||(B.current=X,!(isNaN(X.x)||isNaN(X.y)||isNaN(X.zoom))&&(y(we=>({...we,position:X,zoom:X.zoom})),d(xm(X))))},[y,d]);WS({onStart:F,onChange:F,onEnd:F});const[$,D]=j.useState(()=>()=>null),z=j.useCallback(X=>D(()=>X),[]),b=j.useMemo(()=>({custom:({id:X,positionAbsoluteX:de,positionAbsoluteY:we,selected:Pe=!1,draggable:et=!0})=>$({symbolKey:X,position:{x:de,y:we},selected:Pe,draggable:et})}),[$]),N=j.useRef(o),_=j.useMemo(()=>(N.current=o,pi(o)),[o]),M=j.useRef(s),V=j.useMemo(()=>(M.current=s,xi(s,h)),[s,h]),H=j.useCallback(X=>t(pm(M.current,de=>Sd(X,de)),X),[t]),K=j.useCallback(X=>n(xs(N.current,de=>Rd(X,de),P)),[n,P]),Z=j.useCallback((X,de)=>n(xs(N.current,we=>fy(X,de,we),P)),[]),G=j.useCallback(X=>n(xs(N.current,de=>nd(X,de),P)),[n,P]),Q=j.useCallback((X,de)=>{const we=[...N.current],Pe=we.findIndex(et=>et.key===X);Pe!==-1&&(we[Pe]={...we[Pe],segments:de},N.current=we,n(we))},[n]),ee=l?s7:o7,ae=f.useSyncedRef(Q),re=j.useMemo(()=>({default:X=>r.jsxRuntimeExports.jsx(J9,{...X,segments:X.data?.segments??[],color:X.data?.color,variant:X.data?.variant,onSegmentsChange:j.useCallback(de=>ae.current(X.id,de),[X.id])},X.id)}),[]),se=j.useRef(null);f.use$1({triggers:I.zoomReset,callback:j.useCallback(({stage:X,cursor:de})=>{const we=se.current;we==null||X!=="start"||!u.Ho.contains(we,de)||C()},[C])});const te=f.purgeMouse(I.select)[0]??null,le=f.purgeMouse(I.pan)[0]??null,Re=f.purgeMouse(I.zoom)[0]??null,Ce={selectionOnDrag:te==null,panOnDrag:le==null,selectionKeyCode:te,panActivationKeyCode:le,zoomActivationKeyCode:Re},ue=f.useCombinedRefs(se,T),me=j.useMemo(()=>({visible:m,editable:l,onEditableChange:i,registerNodeRenderer:z,fitViewOnResize:x,setFitViewOnResize:p,viewportMode:g,onViewportModeChange:E}),[l,m,i,z,x,g,E]);return r.jsxRuntimeExports.jsx(gm,{value:me,children:r.jsxRuntimeExports.jsx(f.Composite,{path:v,children:m&&r.jsxRuntimeExports.jsx(GS,{...Ce,className:u.CSS(u.CSS.B("diagram"),u.CSS.editable(l),u.CSS.BE("symbol","container")),nodes:V,edges:_,nodeTypes:b,edgeTypes:re,ref:ue,fitView:!0,onNodesChange:H,onEdgesChange:K,onConnect:G,onReconnect:Z,defaultViewport:dm(a),connectionLineComponent:Q9,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:n7,connectionMode:Pt.Loose,fitViewOptions:sr,selectionMode:tn.Partial,proOptions:r7,deleteKeyCode:i7,...S,style:{[u.CSS.var("diagram-zoom")]:a.zoom,...S.style},...ee,...c7(g),nodesDraggable:l})})})},d7=()=>{const{editable:e}=cn();return e?r.jsxRuntimeExports.jsx(eR,{}):null},x7=e=>r.jsxRuntimeExports.jsx(f.Box,{x:!0,className:u.CSS.BE("diagram","controls"),...e}),or=u.K$1.BOTTOM_LEFT,p7=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=cn();return r.jsxRuntimeExports.jsx(na.Toggle,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:or,size:"small",tooltip:`${n?"Disable":"Enable"} editing`,...t,children:n?r.jsxRuntimeExports.jsx(f.EditOff,{}):r.jsxRuntimeExports.jsx(f.Edit,{})})},m7=({onClick:e,...t})=>{const{fitView:n}=zt(),{fitViewOnResize:s,setFitViewOnResize:o}=cn();return r.jsxRuntimeExports.jsx(na.Toggle,{onClick:i=>{n(sr),e?.(i)},value:s,onChange:o,rightClickToggle:!0,tooltip:r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:u.K$1.BOTTOM_LEFT,size:"small",...t,children:r.jsxRuntimeExports.jsx(f.Expand,{})})},Em=["zoom","pan","select"],f7=[["MouseMiddle"]],h7=[["MouseLeft"]],g7=()=>{const{viewportMode:e,onViewportModeChange:t}=cn();return r.jsxRuntimeExports.jsxs(pe.Buttons,{keys:Em,value:e,onChange:t,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pan",size:"small",tooltip:r.jsxRuntimeExports.jsx(Wt,{mode:"pan",triggers:f7}),tooltipLocation:or,children:r.jsxRuntimeExports.jsx(f.Pan,{})}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"select",size:"small",tooltip:r.jsxRuntimeExports.jsx(Wt,{mode:"select",triggers:h7}),tooltipLocation:or,children:r.jsxRuntimeExports.jsx(f.Selection,{})})]})},j7=e=>r.jsxRuntimeExports.jsx(Gd,{children:r.jsxRuntimeExports.jsx(u7,{...e})}),E7=Object.freeze(Object.defineProperty({__proto__:null,Background:d7,Controls:x7,DefaultPath:hm,Diagram:j7,FitViewControl:m7,HandleLayout:Bp,NodeLayout:to,NodeRenderer:jm,PATHS:fm,SelectPathType:q9,SelectViewportModeControl:g7,ToggleEditControl:p7,VIEWPORT_MODES:Em,alignNodes:B9,calcPath:jt,edgeConverter:xs,edgeZ:I9,nodeConverter:pm,nodeZ:D9,offsetPath:$9,rfEdgeDataZ:am,selectNode:eo,selectNodeBox:Ie,selectNodeLayout:MR,translateEdgesBackward:um,translateEdgesForward:pi,translateNodesBackward:cm,translateNodesForward:xi,translateViewportBackward:xm,translateViewportForward:dm,use:t7,useContext:cn,viewportZ:O9},Symbol.toStringTag,{value:"Module"})),y7=({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:o=r.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:O.Log.TYPE,schema:O.logState,initialState:{empty:!0,region:u.Ho.ZERO,scrolling:!1,wheelPos:0,...c}});j.useEffect(()=>{p(h=>({...h,...c}))},[c,p]);const m=On(j.useCallback(h=>p(g=>({...g,region:h})),[p]));return r.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?o:r.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:r.jsxRuntimeExports.jsx(f.Dynamic,{})})})},S7=Object.freeze(Object.defineProperty({__proto__:null,Log:y7},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.useWindowResize=f.useWindowResize;exports.CSS=u.CSS;exports.DataType=u.n;exports.Density=u.d;exports.MultiSeries=u.Wt;exports.Rate=u.b;exports.Series=u.A;exports.TimeRange=u.O;exports.TimeSpan=u.i;exports.TimeStamp=u.r;exports.newBEM=u.newBEM;exports.state=L.state;exports.Button=Cf.external;exports.Caret=ql.Animated$1;exports.telem=O.external;exports.Theming=Ps.external;exports.Color=_e.external;exports.useCursorDrag=_e.useCursorDrag;exports.useDebouncedCallback=_e.useDebouncedCallback;exports.Triggers=Jl.external;exports.List=nt.external;exports.Dialog=ea.external;exports.Input=Ae.external;exports.Flex=pe.external;exports.createHexOpacityVariants=ta.createHexOpacityVariants;exports.unitProperty=ta.unitProperty;exports.Header=bf.external;exports.Menu=wf.external;exports.Tabs=Me.external;exports.Text=vf.external;exports.Tree=kf.external;exports.Video=_f.Video;exports.Breadcrumb=hh;exports.Canvas=Th;exports.Channel=t1;exports.Component=rh;exports.Control=FR;exports.Device=g1;exports.Diagram=E7;exports.Direction=n1;exports.Eraser=Qf;exports.Flux=Fg;exports.Form=Pg;exports.Group=c1;exports.Icon=Vf;exports.Label=Y1;exports.Legend=Vh;exports.Line=Hh;exports.LinePlot=ig;exports.Log=S7;exports.Measure=ug;exports.Mosaic=cj;exports.Nav=th;exports.Note=dj;exports.OS=_j;exports.Observe=vg;exports.Ontology=Cj;exports.Override=Tj;exports.Pluto=n9;exports.Portal=tj;exports.Progress=o9;exports.Rack=b1;exports.Range=ag;exports.Ranger=o0;exports.Resize=Xf;exports.Rule=dg;exports.Schematic=Fb;exports.Select=xh;exports.Status=oh;exports.Steps=i9;exports.Synnax=Mg;exports.Table=d9;exports.TableCells=C9;exports.Tag=ih;exports.Task=I1;exports.Telem=Gb;exports.Tooltip=Ff;exports.Value=T0;exports.Viewport=og;exports.Workspace=Qb;exports.axis=wh;exports.control=vh;exports.proxyMemo=zf;exports.useAsyncEffect=It;exports.useDestructors=Is;exports.useVirtualCursorDrag=ph;
38
+ `)),x=d.reduce((p,m)=>p.concat(...m),[]);return[d,x]}return[[],[]]},[e]);return j.useEffect(()=>{const c=t?.target??wl,d=t?.actInsideInputWithModifier??!0;if(e!==null){const x=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!o.current||o.current&&!d)&&Xu(h))return!1;const E=kl(h.code,a);if(i.current.add(h[E]),vl(l,i.current,!1)){const S=h.composedPath?.()?.[0]||h.target,R=S?.nodeName==="BUTTON"||S?.nodeName==="A";t.preventDefault!==!1&&(o.current||!R)&&h.preventDefault(),s(!0)}},p=h=>{const g=kl(h.code,a);vl(l,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),o.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 vl(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function kl(e,t){return t.includes(e)?"code":"key"}const _5=()=>{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,o,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??o,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:o,minZoom:i,maxZoom:l,panZoom:a}=e.getState(),c=Jr(t,s,o,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:o,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??o,p=n.snapToGrid??i;return Fn(d,s,p,x)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:o,y:i}=s.getBoundingClientRect(),l=Ts(t,n);return{x:l.x+o,y:l.y+i}}}),[])};function yd(e,t){const n=[],s=new Map,o=[];for(const i of e)if(i.type==="add"){o.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)M5(c,a);n.push(a)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function M5(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 Sd(e,t){return yd(e,t)}function Rd(e,t){return yd(e,t)}function Ct(e,t){return{id:e,type:"select",selected:t}}function Ut(e,t=new Set,n=!1){const s=[];for(const[o,i]of e){const l=t.has(o);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),s.push(Ct(i.id,l)))}return s}function _l({items:e=[],lookup:t}){const n=[],s=new Map(e.map(o=>[o.id,o]));for(const[o,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:o})}for(const[o]of t)s.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Ml(e){return{id:e.id,type:"remove"}}const Tl=e=>ty(e),T5=e=>Fu(e);function Cd(e){return j.forwardRef(e)}const L5=typeof window<"u"?j.useLayoutEffect:j.useEffect;function Ll(e){const[t,n]=j.useState(BigInt(0)),[s]=j.useState(()=>P5(()=>n(o=>o+BigInt(1))));return L5(()=>{const o=s.get();o.length&&(e(o),s.reset())},[t]),s}function P5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const bd=j.createContext(null);function N5({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=_l({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=Ll(n),o=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(_l({items:h,lookup:m}))},[]),i=Ll(o),l=j.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return r.jsxRuntimeExports.jsx(bd.Provider,{value:l,children:e})}function A5(){const e=j.useContext(bd);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const O5=e=>!!e.panZoom;function zt(){const e=_5(),t=ve(),n=A5(),s=Ee(O5),o=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=Tl(p)?p:m.get(p.id),E=g.parentId?Uu(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 sn(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&&Tl(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&&T5(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:k,edges:T}=await iy({nodesToRemove:p,edgesToRemove:m,nodes:h,edges:g,onBeforeDelete:C}),N=T.length>0,I=k.length>0;if(N){const B=T.map(Ml);S?.(T),v(B)}if(I){const B=k.map(Ml);E?.(k),R(B)}return(I||N)&&y?.({nodes:k,edges:T}),{deletedNodes:k,deletedEdges:T}},getIntersectingNodes:(p,m=!0,h)=>{const g=tl(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=sn(S?R:v),C=Tn(y,E);return m&&C>0||C>=E.width*E.height}):[]},isNodeIntersecting:(p,m,h=!0)=>{const E=tl(p)?p:c(p);if(!E)return!1;const S=Tn(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 ny(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??cy();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:m}),n.nodeQueue.push(h=>[...h]),m.promise}}},[]);return j.useMemo(()=>({...o,...e,viewportInitialized:s}),[s])}const Pl=e=>e.selected,I5=typeof window<"u"?window:void 0;function D5({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ve(),{deleteElements:s}=zt(),o=Pn(e,{actInsideInputWithModifier:!1}),i=Pn(t,{target:I5});j.useEffect(()=>{if(o){const{edges:l,nodes:a}=n.getState();s({nodes:a.filter(Pl),edges:l.filter(Pl)}),n.setState({nodesSelectionActive:!1})}},[o]),j.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function B5(e){const t=ve();j.useEffect(()=>{const n=()=>{if(!e.current)return!1;const s=ei(e.current);(s.height===0||s.width===0)&&t.getState().onError?.("004",Oe.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 Qs={position:"absolute",width:"100%",height:"100%",top:0,left:0},$5=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function z5({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.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:v,paneClickDistance:y}){const C=ve(),k=j.useRef(null),{userSelectionActive:T,lib:N}=Ee($5,ke),I=Pn(m),B=j.useRef();B5(k);const F=j.useCallback($=>{R?.({x:$[0],y:$[1],zoom:$[2]}),v||C.setState({transform:$})},[R,v]);return j.useEffect(()=>{if(k.current){B.current=Hy({domNode:k.current,minZoom:x,maxZoom:p,translateExtent:d,viewport:c,paneClickDistance:y,onDraggingChange:b=>C.setState({paneDragging:b}),onPanZoomStart:(b,P)=>{const{onViewportChangeStart:_,onMoveStart:L}=C.getState();L?.(b,P),_?.(P)},onPanZoom:(b,P)=>{const{onViewportChange:_,onMove:L}=C.getState();L?.(b,P),_?.(P)},onPanZoomEnd:(b,P)=>{const{onViewportChangeEnd:_,onMoveEnd:L}=C.getState();L?.(b,P),_?.(P)}});const{x:$,y:D,zoom:z}=B.current.getViewport();return C.setState({panZoom:B.current,transform:[$,D,z],domNode:k.current.closest(".react-flow")}),()=>{B.current?.destroy()}}},[]),j.useEffect(()=>{B.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:I,preventScrolling:h,noPanClassName:S,userSelectionActive:T,noWheelClassName:E,lib:N,onTransformChange:F})},[e,t,n,s,o,i,l,a,I,h,S,T,E,N,F]),r.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:k,style:Qs,children:g})}const V5=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function F5(){const{userSelectionActive:e,userSelectionRect:t}=Ee(V5,ke);return e&&t?r.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 ko=(e,t)=>n=>{n.target===t.current&&e?.(n)},H5=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Z5({isSelecting:e,selectionKeyPressed:t,selectionMode:n=tn.Full,panOnDrag:s,selectionOnDrag:o,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}=Ee(H5,ke),y=S&&(e||E),C=j.useRef(null),k=j.useRef(),T=j.useRef(new Set),N=j.useRef(new Set),I=j.useRef(!1),B=j.useRef(!1),F=L=>{if(I.current||v){I.current=!1;return}a?.(L),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},$=L=>{if(Array.isArray(s)&&s?.includes(2)){L.preventDefault();return}c?.(L)},D=d?L=>d(L):void 0,z=L=>{const{resetSelectedElements:V,domNode:H}=g.getState();if(k.current=H?.getBoundingClientRect(),!S||!e||L.button!==0||L.target!==C.current||!k.current)return;L.target?.setPointerCapture?.(L.pointerId),B.current=!0,I.current=!1;const{x:K,y:Z}=tt(L.nativeEvent,k.current);V(),g.setState({userSelectionRect:{width:0,height:0,startX:K,startY:Z,x:K,y:Z}}),i?.(L)},b=L=>{const{userSelectionRect:V,transform:H,nodeLookup:K,edgeLookup:Z,connectionLookup:G,triggerNodeChanges:Q,triggerEdgeChanges:ee,defaultEdgeOptions:ae}=g.getState();if(!k.current||!V)return;I.current=!0;const{x:re,y:se}=tt(L.nativeEvent,k.current),{startX:te,startY:le}=V,Re={startX:te,startY:le,x:re<te?re:te,y:se<le?se:le,width:Math.abs(re-te),height:Math.abs(se-le)},Ce=T.current,ue=N.current;T.current=new Set(Qr(K,Re,H,n===tn.Partial,!0).map(X=>X.id)),N.current=new Set;const me=ae?.selectable??!0;for(const X of T.current){const de=G.get(X);if(de)for(const{edgeId:we}of de.values()){const Ne=Z.get(we);Ne&&(Ne.selectable??me)&&N.current.add(we)}}if(!nl(Ce,T.current)){const X=Ut(K,T.current,!0);Q(X)}if(!nl(ue,N.current)){const X=Ut(Z,N.current);ee(X)}g.setState({userSelectionRect:Re,userSelectionActive:!0,nodesSelectionActive:!1})},P=L=>{if(L.button!==0||!B.current)return;L.target?.releasePointerCapture?.(L.pointerId);const{userSelectionRect:V}=g.getState();!E&&V&&L.target===C.current&&F?.(L),g.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:T.current.size>0}),l?.(L),(t||o)&&(I.current=!1),B.current=!1},_=s===!0||Array.isArray(s)&&s.includes(0);return r.jsxRuntimeExports.jsxs("div",{className:Te(["react-flow__pane",{draggable:_,dragging:R,selection:e}]),onClick:y?void 0:ko(F,C),onContextMenu:ko($,C),onWheel:ko(D,C),onPointerEnter:y?void 0:x,onPointerDown:y?z:p,onPointerMove:y?b:p,onPointerUp:y?P:void 0,onPointerLeave:m,ref:C,style:Qs,children:[h,r.jsxRuntimeExports.jsx(F5,{})]})}function er({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:a,onError:c}=t.getState(),d=a.get(e);if(!d){c?.("012",Oe.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):o([e])}function wd({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:o,isSelectable:i,nodeClickDistance:l}){const a=ve(),[c,d]=j.useState(!1),x=j.useRef();return j.useEffect(()=>{x.current=_y({getStoreItems:()=>a.getState(),onNodeMouseDown:p=>{er({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:o,nodeClickDistance:l}),()=>{x.current?.destroy()}},[n,s,t,i,e,o]),c}const K5=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function vd(){const e=ve();return j.useCallback(n=>{const{nodeExtent:s,snapToGrid:o,snapGrid:i,nodesDraggable:l,onError:a,updateNodePositions:c,nodeLookup:d,nodeOrigin:x}=e.getState(),p=new Map,m=K5(l),h=o?i[0]:5,g=o?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};o&&(v=Us(v,i));const{position:y,positionAbsolute:C}=Hu({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 ri=j.createContext(null),Y5=ri.Provider;ri.Consumer;const kd=()=>j.useContext(ri),G5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),U5=(e,t,n)=>s=>{const{connectionClickStartHandle:o,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:o?.nodeId===e&&o?.id===t&&o?.type===n,isPossibleEndHandle:i===Nt.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!o,valid:x&&d}};function W5({type:e="source",position:t=J.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:o=!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=kd(),{connectOnClick:v,noPanClassName:y,rfId:C}=Ee(G5,ke),{connectingFrom:k,connectingTo:T,clickConnecting:N,isPossibleEndHandle:I,connectionInProcess:B,clickConnectionInProcess:F,valid:$}=Ee(U5(R,g,e),ke);R||S.getState().onError?.("010",Oe.error010());const D=P=>{const{defaultEdgeOptions:_,onConnect:L,hasDefaultEdges:V}=S.getState(),H={..._,...P};if(V){const{edges:K,setEdges:Z}=S.getState();Z(nd(H,K))}L?.(H),a?.(H)},z=P=>{if(!R)return;const _=qu(P.nativeEvent);if(o&&(_&&P.button===0||!_)){const L=S.getState();Jo.onPointerDown(P.nativeEvent,{autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:E,handleId:g,nodeId:R,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:L.onConnectEnd,updateConnection:L.updateConnection,onConnect:D,isValidConnection:n||L.isValidConnection,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}_?x?.(P):p?.(P)},b=P=>{const{onClickConnectStart:_,onClickConnectEnd:L,connectionClickStartHandle:V,connectionMode:H,isValidConnection:K,lib:Z,rfId:G,nodeLookup:Q,connection:ee}=S.getState();if(!R||!V&&!o)return;if(!V){_?.(P.nativeEvent,{nodeId:R,handleId:g,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:R,type:e,id:g}});return}const ae=Wu(P.target),re=n||K,{connection:se,isValid:te}=Jo.isValid(P.nativeEvent,{handle:{nodeId:R,id:g,type:e},connectionMode:H,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:re,flowId:G,doc:ae,lib:Z,nodeLookup:Q});te&&se&&D(se);const le=structuredClone(ee);delete le.inProgress,le.toPosition=le.toHandle?le.toHandle.position:null,L?.(P,le),S.setState({connectionClickStartHandle:null})};return r.jsxRuntimeExports.jsx("div",{"data-handleid":g,"data-nodeid":R,"data-handlepos":t,"data-id":`${C}-${R}-${g}-${e}`,className:Te(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,d,{source:!E,target:E,connectable:s,connectablestart:o,connectableend:i,clickconnecting:N,connectingfrom:k,connectingto:T,valid:$,connectionindicator:s&&(!B||I)&&(B||F?i:o)}]),onMouseDown:z,onTouchStart:z,onClick:v?b:void 0,ref:h,...m,children:c})}const Nn=j.memo(Cd(W5));function X5({data:e,isConnectable:t,sourcePosition:n=J.Bottom}){return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[e?.label,r.jsxRuntimeExports.jsx(Nn,{type:"source",position:n,isConnectable:t})]})}function q5({data:e,isConnectable:t,targetPosition:n=J.Top,sourcePosition:s=J.Bottom}){return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(Nn,{type:"target",position:n,isConnectable:t}),e?.label,r.jsxRuntimeExports.jsx(Nn,{type:"source",position:s,isConnectable:t})]})}function Q5(){return null}function J5({data:e,isConnectable:t,targetPosition:n=J.Top}){return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(Nn,{type:"target",position:n,isConnectable:t}),e?.label]})}const Ps={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Nl={input:X5,default:q5,output:J5,group:Q5};function eS(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 tS=e=>{const{width:t,height:n,x:s,y:o}=Vn(e.nodeLookup,{filter:i=>!!i.selected});return{width:Xe(t)?t:null,height:Xe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${o}px)`}};function nS({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=ve(),{width:o,height:i,transformString:l,userSelectionActive:a}=Ee(tS,ke),c=vd(),d=j.useRef(null);if(j.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),wd({nodeRef:d}),a||!o||!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(Ps,m.key)&&(m.preventDefault(),c({direction:Ps[m.key],factor:m.shiftKey?4:1}))};return r.jsxRuntimeExports.jsx("div",{className:Te(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:r.jsxRuntimeExports.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:o,height:i}})})}const Al=typeof window<"u"?window:void 0,sS=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function _d({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,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:k,panOnScrollMode:T,zoomOnDoubleClick:N,panOnDrag:I,defaultViewport:B,translateExtent:F,minZoom:$,maxZoom:D,preventScrolling:z,onSelectionContextMenu:b,noWheelClassName:P,noPanClassName:_,disableKeyboardA11y:L,onViewportChange:V,isControlledViewport:H}){const{nodesSelectionActive:K,userSelectionActive:Z}=Ee(sS),G=Pn(d,{target:Al}),Q=Pn(E,{target:Al}),ee=Q||I,ae=Q||C,re=x&&ee!==!0,se=G||Z||re;return D5({deleteKeyCode:c,multiSelectionKeyCode:g}),r.jsxRuntimeExports.jsx(z5,{onPaneContextMenu:i,elementsSelectable:R,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ae,panOnScrollSpeed:k,panOnScrollMode:T,zoomOnDoubleClick:N,panOnDrag:!G&&ee,defaultViewport:B,translateExtent:F,minZoom:$,maxZoom:D,zoomActivationKeyCode:S,preventScrolling:z,noWheelClassName:P,noPanClassName:_,onViewportChange:V,isControlledViewport:H,paneClickDistance:a,children:r.jsxRuntimeExports.jsxs(Z5,{onSelectionStart:m,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:ee,isSelecting:!!se,selectionMode:p,selectionKeyPressed:G,selectionOnDrag:re,children:[e,K&&r.jsxRuntimeExports.jsx(nS,{onSelectionContextMenu:b,noPanClassName:_,disableKeyboardA11y:L})]})})}_d.displayName="FlowRenderer";const oS=j.memo(_d),rS=e=>t=>e?Qr(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 iS(e){return Ee(j.useCallback(rS(e),[e]),ke)}const lS=e=>e.updateNodeInternals;function aS(){const e=Ee(lS),[t]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:o.target,force:!0})}),e(s)}));return j.useEffect(()=>()=>{t?.disconnect()},[t]),t}function cS({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const o=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,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function uS({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:o,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:k}=Ee(te=>{const le=te.nodeLookup.get(e),Re=te.parentLookup.has(e);return{node:le,internals:le.internals,isParent:Re}},ke);let T=y.type||"default",N=S?.[T]||Nl[T];N===void 0&&(v?.("003",Oe.error003(T)),T="default",N=Nl.default);const I=!!(y.draggable||a&&typeof y.draggable>"u"),B=!!(y.selectable||c&&typeof y.selectable>"u"),F=!!(y.connectable||d&&typeof y.connectable>"u"),$=!!(y.focusable||x&&typeof y.focusable>"u"),D=ve(),z=Gu(y),b=cS({node:y,nodeType:T,hasDimensions:z,resizeObserver:p}),P=wd({nodeRef:b,disabled:y.hidden||!I,noDragClassName:m,handleSelector:y.dragHandle,nodeId:e,isSelectable:B,nodeClickDistance:R}),_=vd();if(y.hidden)return null;const L=dt(y),V=eS(y),H=B||I||t||n||s||o,K=n?te=>n(te,{...C.userNode}):void 0,Z=s?te=>s(te,{...C.userNode}):void 0,G=o?te=>o(te,{...C.userNode}):void 0,Q=i?te=>i(te,{...C.userNode}):void 0,ee=l?te=>l(te,{...C.userNode}):void 0,ae=te=>{const{selectNodesOnDrag:le,nodeDragThreshold:Re}=D.getState();B&&(!le||!I||Re>0)&&er({id:e,store:D,nodeRef:b}),t&&t(te,{...C.userNode})},re=te=>{if(!(Xu(te.nativeEvent)||g)){if(Bu.includes(te.key)&&B){const le=te.key==="Escape";er({id:e,store:D,unselect:le,nodeRef:b})}else if(I&&y.selected&&Object.prototype.hasOwnProperty.call(Ps,te.key)){te.preventDefault();const{ariaLabelConfig:le}=D.getState();D.setState({ariaLiveMessage:le["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),_({direction:Ps[te.key],factor:te.shiftKey?4:1})}}},se=()=>{if(g||!b.current?.matches(":focus-visible"))return;const{transform:te,width:le,height:Re,autoPanOnNodeFocus:Ce,setCenter:ue}=D.getState();if(!Ce)return;Qr(new Map([[e,y]]),{x:0,y:0,width:le,height:Re},te,!0).length>0||ue(y.position.x+L.width/2,y.position.y+L.height/2,{zoom:te[2]})};return r.jsxRuntimeExports.jsx("div",{className:Te(["react-flow__node",`react-flow__node-${T}`,{[h]:I},y.className,{selected:y.selected,selectable:B,parent:k,draggable:I,dragging:P}]),ref:b,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:z?"visible":"hidden",...y.style,...V},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:K,onMouseMove:Z,onMouseLeave:G,onContextMenu:Q,onClick:ae,onDoubleClick:ee,onKeyDown:$?re:void 0,tabIndex:$?0:void 0,onFocus:$?se:void 0,role:y.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${gd}-${E}`,"aria-label":y.ariaLabel,...y.domAttributes,children:r.jsxRuntimeExports.jsx(Y5,{value:e,children:r.jsxRuntimeExports.jsx(N,{id:e,data:y.data,type:T,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:B,draggable:I,deletable:y.deletable??!0,isConnectable:F,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:P,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...L})})})}const dS=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Md(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:o,onError:i}=Ee(dS,ke),l=iS(e.onlyRenderVisibleElements),a=aS();return r.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Qs,children:l.map(c=>r.jsxRuntimeExports.jsx(uS,{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:o,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}Md.displayName="NodeRenderer";const xS=j.memo(Md);function pS(e){return Ee(j.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const s=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),l=n.nodeLookup.get(o.target);i&&l&&py({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(o.id)}return s},[e]),ke)}const mS=({color:e="none",strokeWidth:t=1})=>r.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),fS=({color:e="none",strokeWidth:t=1})=>r.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Ol={[ks.Arrow]:mS,[ks.ArrowClosed]:fS};function hS(e){const t=ve();return j.useMemo(()=>Object.prototype.hasOwnProperty.call(Ol,e)?Ol[e]:(t.getState().onError?.("009",Oe.error009(e)),null),[e])}const gS=({id:e,type:t,color:n,width:s=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:a="auto-start-reverse"})=>{const c=hS(t);return c?r.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:r.jsxRuntimeExports.jsx(c,{color:n,strokeWidth:l})}):null},Td=({defaultColor:e,rfId:t})=>{const n=Ee(i=>i.edges),s=Ee(i=>i.defaultEdgeOptions),o=j.useMemo(()=>yy(n,{id:t,defaultColor:e,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[n,s,t,e]);return o.length?r.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:r.jsxRuntimeExports.jsx("defs",{children:o.map(i=>r.jsxRuntimeExports.jsx(gS,{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 jS=j.memo(Td);function Ld({x:e,y:t,label:n,labelStyle:s,labelShowBg:o=!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=Te(["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?r.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:h,visibility:p.width?"visible":"hidden",...x,children:[o&&r.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}),r.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:g,style:s,children:n}),c]}):null}Ld.displayName="EdgeText";const ES=j.memo(Ld);function qe({path:e,labelX:t,labelY:n,label:s,labelStyle:o,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:d=20,...x}){return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("path",{...x,d:e,fill:"none",className:Te(["react-flow__edge-path",x.className])}),d&&r.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),s&&Xe(t)&&Xe(n)?r.jsxRuntimeExports.jsx(ES,{x:t,y:n,label:s,labelStyle:o,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function Il({pos:e,x1:t,y1:n,x2:s,y2:o}){return e===J.Left||e===J.Right?[.5*(t+s),n]:[t,.5*(n+o)]}function Pd({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:s,targetY:o,targetPosition:i=J.Top}){const[l,a]=Il({pos:n,x1:e,y1:t,x2:s,y2:o}),[c,d]=Il({pos:i,x1:s,y1:o,x2:e,y2:t}),[x,p,m,h]=Qu({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:d});return[`M${e},${t} C${l},${a} ${c},${d} ${s},${o}`,x,p,m,h]}function Nd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:o,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]=Pd({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:i,targetPosition:a}),k=e.isInternal?void 0:t;return r.jsxRuntimeExports.jsx(qe,{id:k,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 yS=Nd({isInternal:!1}),Ad=Nd({isInternal:!0});yS.displayName="SimpleBezierEdge";Ad.displayName="SimpleBezierEdgeInternal";function Od(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:i,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,sourcePosition:h=J.Bottom,targetPosition:g=J.Top,markerEnd:E,markerStart:S,pathOptions:R,interactionWidth:v})=>{const[y,C,k]=Xo({sourceX:n,sourceY:s,sourcePosition:h,targetX:o,targetY:i,targetPosition:g,borderRadius:R?.borderRadius,offset:R?.offset}),T=e.isInternal?void 0:t;return r.jsxRuntimeExports.jsx(qe,{id:T,path:y,labelX:C,labelY:k,label:l,labelStyle:a,labelShowBg:c,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:E,markerStart:S,interactionWidth:v})})}const Id=Od({isInternal:!1}),Dd=Od({isInternal:!0});Id.displayName="SmoothStepEdge";Dd.displayName="SmoothStepEdgeInternal";function Bd(e){return j.memo(({id:t,...n})=>{const s=e.isInternal?void 0:t;return r.jsxRuntimeExports.jsx(Id,{...n,id:s,pathOptions:j.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const SS=Bd({isInternal:!1}),$d=Bd({isInternal:!0});SS.displayName="StepEdge";$d.displayName="StepEdgeInternal";function zd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:o,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]=sd({sourceX:n,sourceY:s,targetX:o,targetY:i}),y=e.isInternal?void 0:t;return r.jsxRuntimeExports.jsx(qe,{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 RS=zd({isInternal:!1}),Vd=zd({isInternal:!0});RS.displayName="StraightEdge";Vd.displayName="StraightEdgeInternal";function Fd(e){return j.memo(({id:t,sourceX:n,sourceY:s,targetX:o,targetY:i,sourcePosition:l=J.Bottom,targetPosition:a=J.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,k]=Ju({sourceX:n,sourceY:s,sourcePosition:l,targetX:o,targetY:i,targetPosition:a,curvature:R?.curvature}),T=e.isInternal?void 0:t;return r.jsxRuntimeExports.jsx(qe,{id:T,path:y,labelX:C,labelY:k,label:c,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:h,style:g,markerEnd:E,markerStart:S,interactionWidth:v})})}const CS=Fd({isInternal:!1}),Hd=Fd({isInternal:!0});CS.displayName="BezierEdge";Hd.displayName="BezierEdgeInternal";const Dl={default:Hd,straight:Vd,step:$d,smoothstep:Dd,simplebezier:Ad},Bl={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},bS=(e,t,n)=>n===J.Left?e-t:n===J.Right?e+t:e,wS=(e,t,n)=>n===J.Top?e-t:n===J.Bottom?e+t:e,$l="react-flow__edgeupdater";function zl({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:o,onMouseEnter:i,onMouseOut:l,type:a}){return r.jsxRuntimeExports.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:l,className:Te([$l,`${$l}-${a}`]),cx:bS(t,s,e),cy:wS(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function vS({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:o,targetX:i,targetY:l,sourcePosition:a,targetPosition:c,onReconnect:d,onReconnectStart:x,onReconnectEnd:p,setReconnecting:m,setUpdateHover:h}){const g=ve(),E=(C,k)=>{if(C.button!==0)return;const{autoPanOnConnect:T,domNode:N,isValidConnection:I,connectionMode:B,connectionRadius:F,lib:$,onConnectStart:D,onConnectEnd:z,cancelConnection:b,nodeLookup:P,rfId:_,panBy:L,updateConnection:V}=g.getState(),H=k.type==="target",K=(Q,ee)=>{m(!1),p?.(Q,n,k.type,ee)},Z=Q=>d?.(n,Q),G=(Q,ee)=>{m(!0),x?.(C,n,k.type),D?.(Q,ee)};Jo.onPointerDown(C.nativeEvent,{autoPanOnConnect:T,connectionMode:B,connectionRadius:F,domNode:N,handleId:k.id,nodeId:k.nodeId,nodeLookup:P,isTarget:H,edgeUpdaterType:k.type,lib:$,flowId:_,cancelConnection:b,panBy:L,isValidConnection:I,onConnect:Z,onConnectStart:G,onConnectEnd:z,onReconnectEnd:K,updateConnection:V,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 r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&r.jsxRuntimeExports.jsx(zl,{position:a,centerX:s,centerY:o,radius:t,onMouseDown:S,onMouseEnter:v,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&r.jsxRuntimeExports.jsx(zl,{position:c,centerX:i,centerY:l,radius:t,onMouseDown:R,onMouseEnter:v,onMouseOut:y,type:"target"})]})}function kS({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:o,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=Ee(ue=>ue.edgeLookup.get(e));const C=Ee(ue=>ue.defaultEdgeOptions);y=C?{...C,...y}:y;let k=y.type||"default",T=E?.[k]||Dl[k];T===void 0&&(R?.("011",Oe.error011(k)),k="default",T=Dl.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"),F=j.useRef(null),[$,D]=j.useState(!1),[z,b]=j.useState(!1),P=ve(),{zIndex:_,sourceX:L,sourceY:V,targetX:H,targetY:K,sourcePosition:Z,targetPosition:G}=Ee(j.useCallback(ue=>{const me=ue.nodeLookup.get(y.source),X=ue.nodeLookup.get(y.target);if(!me||!X)return{zIndex:y.zIndex,...Bl};const de=Ey({id:e,sourceNode:me,targetNode:X,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ue.connectionMode,onError:R});return{zIndex:xy({selected:y.selected,zIndex:y.zIndex,sourceNode:me,targetNode:X,elevateOnSelect:ue.elevateEdgesOnSelect}),...de||Bl}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),ke),Q=j.useMemo(()=>y.markerStart?`url('#${qo(y.markerStart,g)}')`:void 0,[y.markerStart,g]),ee=j.useMemo(()=>y.markerEnd?`url('#${qo(y.markerEnd,g)}')`:void 0,[y.markerEnd,g]);if(y.hidden||L===null||V===null||H===null||K===null)return null;const ae=ue=>{const{addSelectedEdges:me,unselectNodesAndEdges:X,multiSelectionActive:de}=P.getState();B&&(P.setState({nodesSelectionActive:!1}),y.selected&&de?(X({nodes:[],edges:[y]}),F.current?.blur()):me([e])),o&&o(ue,y)},re=i?ue=>{i(ue,{...y})}:void 0,se=l?ue=>{l(ue,{...y})}:void 0,te=a?ue=>{a(ue,{...y})}:void 0,le=c?ue=>{c(ue,{...y})}:void 0,Re=d?ue=>{d(ue,{...y})}:void 0,Ce=ue=>{if(!v&&Bu.includes(ue.key)&&B){const{unselectNodesAndEdges:me,addSelectedEdges:X}=P.getState();ue.key==="Escape"?(F.current?.blur(),me({edges:[y]})):X([e])}};return r.jsxRuntimeExports.jsx("svg",{style:{zIndex:_},children:r.jsxRuntimeExports.jsxs("g",{className:Te(["react-flow__edge",`react-flow__edge-${k}`,y.className,S,{selected:y.selected,animated:y.animated,inactive:!B&&!o,updating:$,selectable:B}]),onClick:ae,onDoubleClick:re,onContextMenu:se,onMouseEnter:te,onMouseMove:le,onMouseLeave:Re,onKeyDown:N?Ce: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?`${jd}-${g}`:void 0,ref:F,...y.domAttributes,children:[!z&&r.jsxRuntimeExports.jsx(T,{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:L,sourceY:V,targetX:H,targetY:K,sourcePosition:Z,targetPosition:G,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:Q,markerEnd:ee,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),I&&r.jsxRuntimeExports.jsx(vS,{edge:y,isReconnectable:I,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:h,sourceX:L,sourceY:V,targetX:H,targetY:K,sourcePosition:Z,targetPosition:G,setUpdateHover:D,setReconnecting:b})]})})}const _S=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Zd({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:o,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}=Ee(_S,ke),C=pS(t);return r.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[r.jsxRuntimeExports.jsx(jS,{defaultColor:e,rfId:n}),C.map(k=>r.jsxRuntimeExports.jsx(kS,{id:k,edgesFocusable:S,edgesReconnectable:R,elementsSelectable:v,noPanClassName:o,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},k))]})}Zd.displayName="EdgeRenderer";const MS=j.memo(Zd),TS=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function LS({children:e}){const t=Ee(TS);return r.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function PS(e){const t=zt(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const NS=e=>e.panZoom?.syncViewport;function AS(e){const t=Ee(NS),n=ve();return j.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function OS(e){return e.connection.inProgress?{...e.connection,to:Fn(e.connection.to,e.transform)}:{...e.connection}}function IS(e){return OS}function DS(e){const t=IS();return Ee(t,ke)}const BS=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function $S({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:o,width:i,height:l,isValid:a,inProgress:c}=Ee(BS,ke);return!(i&&o&&c)?null:r.jsxRuntimeExports.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:r.jsxRuntimeExports.jsx("g",{className:Te(["react-flow__connection",Vu(a)]),children:r.jsxRuntimeExports.jsx(Kd,{style:t,type:n,CustomComponent:s,isValid:a})})})}const Kd=({style:e,type:t=ft.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:o,from:i,fromNode:l,fromHandle:a,fromPosition:c,to:d,toNode:x,toHandle:p,toPosition:m}=DS();if(!o)return;if(n)return r.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:Vu(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]=Ju(g);break;case ft.SimpleBezier:[h]=Pd(g);break;case ft.Step:[h]=Xo({...g,borderRadius:0});break;case ft.SmoothStep:[h]=Xo(g);break;default:[h]=sd(g)}return r.jsxRuntimeExports.jsx("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};Kd.displayName="ConnectionLine";const zS={};function Vl(e=zS){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 o of s)if(t.current[o]!==e[o]){n.getState().onError?.("002",Oe.error002());break}t.current=e}},[e])}function VS(){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",Oe.error013("react")),t.current=!0}},[])}function Yd({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:o,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:k,panActivationKeyCode:T,zoomActivationKeyCode:N,deleteKeyCode:I,onlyRenderVisibleElements:B,elementsSelectable:F,defaultViewport:$,translateExtent:D,minZoom:z,maxZoom:b,preventScrolling:P,defaultMarkerColor:_,zoomOnScroll:L,zoomOnPinch:V,panOnScroll:H,panOnScrollSpeed:K,panOnScrollMode:Z,zoomOnDoubleClick:G,panOnDrag:Q,onPaneClick:ee,onPaneMouseEnter:ae,onPaneMouseMove:re,onPaneMouseLeave:se,onPaneScroll:te,onPaneContextMenu:le,paneClickDistance:Re,nodeClickDistance:Ce,onEdgeContextMenu:ue,onEdgeMouseEnter:me,onEdgeMouseMove:X,onEdgeMouseLeave:de,reconnectRadius:we,onReconnect:Ne,onReconnectStart:et,onReconnectEnd:Kn,noDragClassName:Yn,noWheelClassName:Gn,noPanClassName:un,disableKeyboardA11y:dn,nodeExtent:oo,rfId:Un,viewport:Zt,onViewportChange:xn}){return Vl(e),Vl(t),VS(),PS(n),AS(Zt),r.jsxRuntimeExports.jsx(oS,{onPaneClick:ee,onPaneMouseEnter:ae,onPaneMouseMove:re,onPaneMouseLeave:se,onPaneContextMenu:le,onPaneScroll:te,paneClickDistance:Re,deleteKeyCode:I,selectionKeyCode:v,selectionOnDrag:y,selectionMode:C,onSelectionStart:m,onSelectionEnd:h,multiSelectionKeyCode:k,panActivationKeyCode:T,zoomActivationKeyCode:N,elementsSelectable:F,zoomOnScroll:L,zoomOnPinch:V,zoomOnDoubleClick:G,panOnScroll:H,panOnScrollSpeed:K,panOnScrollMode:Z,panOnDrag:Q,defaultViewport:$,translateExtent:D,minZoom:z,maxZoom:b,onSelectionContextMenu:p,preventScrolling:P,noDragClassName:Yn,noWheelClassName:Gn,noPanClassName:un,disableKeyboardA11y:dn,onViewportChange:xn,isControlledViewport:!!Zt,children:r.jsxRuntimeExports.jsxs(LS,{children:[r.jsxRuntimeExports.jsx(MS,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:l,onReconnect:Ne,onReconnectStart:et,onReconnectEnd:Kn,onlyRenderVisibleElements:B,onEdgeContextMenu:ue,onEdgeMouseEnter:me,onEdgeMouseMove:X,onEdgeMouseLeave:de,reconnectRadius:we,defaultMarkerColor:_,noPanClassName:un,disableKeyboardA11y:dn,rfId:Un}),r.jsxRuntimeExports.jsx($S,{style:E,type:g,component:S,containerStyle:R}),r.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),r.jsxRuntimeExports.jsx(xS,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:x,nodeClickDistance:Ce,onlyRenderVisibleElements:B,noPanClassName:un,noDragClassName:Yn,disableKeyboardA11y:dn,nodeExtent:oo,rfId:Un}),r.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Yd.displayName="GraphView";const FS=j.memo(Yd),Fl=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,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??Mn;rd(g,E,S);const C=Qo(R,m,h,{nodeOrigin:v,nodeExtent:y,elevateNodesOnSelect:!1});let k=[0,0,1];if(l&&o&&i){const T=Vn(m,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:N,y:I,zoom:B}=Jr(T,o,i,c,d,a?.padding??.1);k=[N,I,B]}return{rfId:"1",width:0,height:0,transform:k,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:Mn,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:{...zu},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Ms,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:$u}},HS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:i,fitView:l,fitViewOptions:a,minZoom:c,maxZoom:d,nodeOrigin:x,nodeExtent:p})=>c5((m,h)=>{async function g(){const{nodeLookup:E,panZoom:S,fitViewOptions:R,fitViewResolver:v,width:y,height:C,minZoom:k,maxZoom:T}=h();S&&(await ry({nodes:E,width:y,height:C,panZoom:S,minZoom:k,maxZoom:T},R),v?.resolve(!0),m({fitViewResolver:null}))}return{...Fl({nodes:e,edges:t,width:o,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(),k=Qo(E,S,R,{nodeOrigin:v,nodeExtent:p,elevateNodesOnSelect:y,checkEquality:!0});C&&k?(g(),m({nodes:E,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:E,nodesInitialized:k})},setEdges:E=>{const{connectionLookup:S,edgeLookup:R}=h();rd(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:k,debug:T,fitViewQueued:N}=h(),{changes:I,updatedInternals:B}=wy(E,R,v,y,C,k);B&&(Ry(R,v,{nodeOrigin:C,nodeExtent:k}),N?(g(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),I?.length>0&&(T&&console.log("React Flow: trigger node changes",I),S?.(I)))},updateNodePositions:(E,S=!1)=>{const R=[],v=[],{nodeLookup:y,triggerNodeChanges:C}=h();for(const[k,T]of E){const N=y.get(k),I=!!(N?.expandParent&&N?.parentId&&T?.position),B={id:k,type:"position",position:I?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:S};I&&N.parentId&&R.push({id:k,parentId:N.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),v.push(B)}if(R.length>0){const{parentLookup:k,nodeOrigin:T}=h(),N=oi(R,y,k,T);v.push(...N)}C(v)},triggerNodeChanges:E=>{const{onNodesChange:S,setNodes:R,nodes:v,hasDefaultNodes:y,debug:C}=h();if(E?.length){if(y){const k=Sd(E,v);R(k)}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 k=Rd(E,v);R(k)}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 k=E.map(T=>Ct(T,!0));y(k);return}y(Ut(v,new Set([...E]),!0)),C(Ut(R))},addSelectedEdges:E=>{const{multiSelectionActive:S,edgeLookup:R,nodeLookup:v,triggerNodeChanges:y,triggerEdgeChanges:C}=h();if(S){const k=E.map(T=>Ct(T,!0));C(k);return}C(Ut(R,new Set([...E]))),y(Ut(v,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:S}={})=>{const{edges:R,nodes:v,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:k}=h(),T=E||v,N=S||R,I=T.map(F=>{const $=y.get(F.id);return $&&($.selected=!1),Ct(F.id,!1)}),B=N.map(F=>Ct(F.id,!1));C(I),k(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((T,N)=>N.selected?[...T,Ct(N.id,!1)]:T,[]),k=E.reduce((T,N)=>N.selected?[...T,Ct(N.id,!1)]:T,[]);R(C),v(k)},setNodeExtent:E=>{const{nodes:S,nodeLookup:R,parentLookup:v,nodeOrigin:y,elevateNodesOnSelect:C,nodeExtent:k}=h();E[0][0]===k[0][0]&&E[0][1]===k[0][1]&&E[1][0]===k[1][0]&&E[1][1]===k[1][1]||(Qo(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 vy({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:k}=h();if(!k)return Promise.resolve(!1);const T=typeof R?.zoom<"u"?R.zoom:C;return await k.setViewport({x:v/2-E*T,y:y/2-S*T,zoom:T},{duration:R?.duration,ease:R?.ease,interpolate:R?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{...zu}})},updateConnection:E=>{m({connection:E})},reset:()=>m({...Fl()})}},Object.is);function Gd({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:o,initialHeight:i,initialMinZoom:l,initialMaxZoom:a,initialFitViewOptions:c,fitView:d,nodeOrigin:x,nodeExtent:p,children:m}){const[h]=j.useState(()=>HS({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:o,height:i,fitView:d,minZoom:l,maxZoom:a,fitViewOptions:c,nodeOrigin:x,nodeExtent:p}));return r.jsxRuntimeExports.jsx(u5,{value:h,children:r.jsxRuntimeExports.jsx(N5,{children:m})})}function ZS({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:o,width:i,height:l,fitView:a,fitViewOptions:c,minZoom:d,maxZoom:x,nodeOrigin:p,nodeExtent:m}){return j.useContext(Xs)?r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:e}):r.jsxRuntimeExports.jsx(Gd,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:o,initialWidth:i,initialHeight:l,fitView:a,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:x,nodeOrigin:p,nodeExtent:m,children:e})}const KS={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function YS({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:o,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:k,onNodeDoubleClick:T,onNodeDragStart:N,onNodeDrag:I,onNodeDragStop:B,onNodesDelete:F,onEdgesDelete:$,onDelete:D,onSelectionChange:z,onSelectionDragStart:b,onSelectionDrag:P,onSelectionDragStop:_,onSelectionContextMenu:L,onSelectionStart:V,onSelectionEnd:H,onBeforeDelete:K,connectionMode:Z,connectionLineType:G=ft.Bezier,connectionLineStyle:Q,connectionLineComponent:ee,connectionLineContainerStyle:ae,deleteKeyCode:re="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:te=!1,selectionMode:le=tn.Full,panActivationKeyCode:Re="Space",multiSelectionKeyCode:Ce=Ls()?"Meta":"Control",zoomActivationKeyCode:ue=Ls()?"Meta":"Control",snapToGrid:me,snapGrid:X,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:we,nodesDraggable:Ne,autoPanOnNodeFocus:et,nodesConnectable:Kn,nodesFocusable:Yn,nodeOrigin:Gn=Ed,edgesFocusable:un,edgesReconnectable:dn,elementsSelectable:oo=!0,defaultViewport:Un=C5,minZoom:Zt=.5,maxZoom:xn=2,translateExtent:fi=Mn,preventScrolling:ym=!0,nodeExtent:ro,defaultMarkerColor:Sm="#b1b1b7",zoomOnScroll:Rm=!0,zoomOnPinch:Cm=!0,panOnScroll:bm=!1,panOnScrollSpeed:wm=.5,panOnScrollMode:vm=wt.Free,zoomOnDoubleClick:km=!0,panOnDrag:_m=!0,onPaneClick:Mm,onPaneMouseEnter:Tm,onPaneMouseMove:Lm,onPaneMouseLeave:Pm,onPaneScroll:Nm,onPaneContextMenu:Am,paneClickDistance:hi=0,nodeClickDistance:Om=0,children:Im,onReconnect:Dm,onReconnectStart:Bm,onReconnectEnd:$m,onEdgeContextMenu:zm,onEdgeDoubleClick:Vm,onEdgeMouseEnter:Fm,onEdgeMouseMove:Hm,onEdgeMouseLeave:Zm,reconnectRadius:Km=10,onNodesChange:Ym,onEdgesChange:Gm,noDragClassName:Um="nodrag",noWheelClassName:Wm="nowheel",noPanClassName:gi="nopan",fitView:ji,fitViewOptions:Ei,connectOnClick:Xm,attributionPosition:qm,proOptions:Qm,defaultEdgeOptions:Jm,elevateNodesOnSelect:ef,elevateEdgesOnSelect:tf,disableKeyboardA11y:yi=!1,autoPanOnConnect:nf,autoPanOnNodeDrag:sf,autoPanSpeed:of,connectionRadius:rf,isValidConnection:lf,onError:af,style:cf,id:Si,nodeDragThreshold:uf,connectionDragThreshold:df,viewport:xf,onViewportChange:pf,width:mf,height:ff,colorMode:hf="light",debug:gf,onScroll:Ri,ariaLabelConfig:jf,...Ef},yf){const io=Si||"1",Sf=k5(hf),Rf=j.useCallback(Ci=>{Ci.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ri?.(Ci)},[Ri]);return r.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...Ef,onScroll:Rf,style:{...cf,...KS},ref:yf,className:Te(["react-flow",o,Sf]),id:Si,role:"application",children:r.jsxRuntimeExports.jsxs(ZS,{nodes:e,edges:t,width:mf,height:ff,fitView:ji,fitViewOptions:Ei,minZoom:Zt,maxZoom:xn,nodeOrigin:Gn,nodeExtent:ro,children:[r.jsxRuntimeExports.jsx(FS,{onInit:d,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:k,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:l,connectionLineType:G,connectionLineStyle:Q,connectionLineComponent:ee,connectionLineContainerStyle:ae,selectionKeyCode:se,selectionOnDrag:te,selectionMode:le,deleteKeyCode:re,multiSelectionKeyCode:Ce,panActivationKeyCode:Re,zoomActivationKeyCode:ue,onlyRenderVisibleElements:de,defaultViewport:Un,translateExtent:fi,minZoom:Zt,maxZoom:xn,preventScrolling:ym,zoomOnScroll:Rm,zoomOnPinch:Cm,zoomOnDoubleClick:km,panOnScroll:bm,panOnScrollSpeed:wm,panOnScrollMode:vm,panOnDrag:_m,onPaneClick:Mm,onPaneMouseEnter:Tm,onPaneMouseMove:Lm,onPaneMouseLeave:Pm,onPaneScroll:Nm,onPaneContextMenu:Am,paneClickDistance:hi,nodeClickDistance:Om,onSelectionContextMenu:L,onSelectionStart:V,onSelectionEnd:H,onReconnect:Dm,onReconnectStart:Bm,onReconnectEnd:$m,onEdgeContextMenu:zm,onEdgeDoubleClick:Vm,onEdgeMouseEnter:Fm,onEdgeMouseMove:Hm,onEdgeMouseLeave:Zm,reconnectRadius:Km,defaultMarkerColor:Sm,noDragClassName:Um,noWheelClassName:Wm,noPanClassName:gi,rfId:io,disableKeyboardA11y:yi,nodeExtent:ro,viewport:xf,onViewportChange:pf}),r.jsxRuntimeExports.jsx(v5,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:h,onConnectStart:g,onConnectEnd:E,onClickConnectStart:S,onClickConnectEnd:R,nodesDraggable:Ne,autoPanOnNodeFocus:et,nodesConnectable:Kn,nodesFocusable:Yn,edgesFocusable:un,edgesReconnectable:dn,elementsSelectable:oo,elevateNodesOnSelect:ef,elevateEdgesOnSelect:tf,minZoom:Zt,maxZoom:xn,nodeExtent:ro,onNodesChange:Ym,onEdgesChange:Gm,snapToGrid:me,snapGrid:X,connectionMode:Z,translateExtent:fi,connectOnClick:Xm,defaultEdgeOptions:Jm,fitView:ji,fitViewOptions:Ei,onNodesDelete:F,onEdgesDelete:$,onDelete:D,onNodeDragStart:N,onNodeDrag:I,onNodeDragStop:B,onSelectionDrag:P,onSelectionDragStart:b,onSelectionDragStop:_,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:gi,nodeOrigin:Gn,rfId:io,autoPanOnConnect:nf,autoPanOnNodeDrag:sf,autoPanSpeed:of,onError:af,connectionRadius:rf,isValidConnection:lf,selectNodesOnDrag:we,nodeDragThreshold:uf,connectionDragThreshold:df,onBeforeDelete:K,paneClickDistance:hi,debug:gf,ariaLabelConfig:jf}),r.jsxRuntimeExports.jsx(R5,{onSelectionChange:z}),Im,r.jsxRuntimeExports.jsx(g5,{proOptions:Qm,position:qm}),r.jsxRuntimeExports.jsx(h5,{rfId:io,disableKeyboardA11y:yi})]})})}var GS=Cd(YS);function US(){const e=ve();return j.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),o=Array.isArray(t)?t:[t],i=new Map;o.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 WS({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 XS({dimensions:e,lineWidth:t,variant:n,className:s}){return r.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Te(["react-flow__background-pattern",n,s])})}function qS({radius:e,className:t}){return r.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Te(["react-flow__background-pattern","dots",t])})}var gt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(gt||(gt={}));const QS={[gt.Dots]:1,[gt.Lines]:1,[gt.Cross]:6},JS=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ud({id:e,variant:t=gt.Dots,gap:n=20,size:s,lineWidth:o=1,offset:i=0,color:l,bgColor:a,style:c,className:d,patternClassName:x}){const p=j.useRef(null),{transform:m,patternId:h}=Ee(JS,ke),g=s||QS[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],k=S?[y,y]:v,T=[C[0]*m[2]||1+k[0]/2,C[1]*m[2]||1+k[1]/2],N=`${h}${e||""}`;return r.jsxRuntimeExports.jsxs("svg",{className:Te(["react-flow__background",d]),style:{...c,...Qs,"--xy-background-color-props":a,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[r.jsxRuntimeExports.jsx("pattern",{id:N,x:m[0]%v[0],y:m[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:E?r.jsxRuntimeExports.jsx(qS,{radius:y/2,className:x}):r.jsxRuntimeExports.jsx(XS,{dimensions:k,lineWidth:o,variant:t,className:x})}),r.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}Ud.displayName="Background";const eR=j.memo(Ud);function tR(){return r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:r.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function nR(){return r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:r.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function sR(){return r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:r.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 oR(){return r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:r.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 rR(){return r.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:r.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 os({children:e,className:t,...n}){return r.jsxRuntimeExports.jsx("button",{type:"button",className:Te(["react-flow__controls-button",t]),...n,children:e})}const iR=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Wd({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:o,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}=Ee(iR,ke),{zoomIn:y,zoomOut:C,fitView:k}=zt(),T=()=>{y(),i?.()},N=()=>{C(),l?.()},I=()=>{k(o),a?.()},B=()=>{g.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),c?.(!E)},F=m==="horizontal"?"horizontal":"vertical";return r.jsxRuntimeExports.jsxs(qs,{className:Te(["react-flow__controls",F,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":h??v["controls.ariaLabel"],children:[t&&r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(os,{onClick:T,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:R,children:r.jsxRuntimeExports.jsx(tR,{})}),r.jsxRuntimeExports.jsx(os,{onClick:N,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:S,children:r.jsxRuntimeExports.jsx(nR,{})})]}),n&&r.jsxRuntimeExports.jsx(os,{className:"react-flow__controls-fitview",onClick:I,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:r.jsxRuntimeExports.jsx(sR,{})}),s&&r.jsxRuntimeExports.jsx(os,{className:"react-flow__controls-interactive",onClick:B,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:E?r.jsxRuntimeExports.jsx(rR,{}):r.jsxRuntimeExports.jsx(oR,{})}),x]})}Wd.displayName="Controls";j.memo(Wd);function lR({id:e,x:t,y:n,width:s,height:o,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 r.jsxRuntimeExports.jsx("rect",{className:Te(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:x,ry:x,width:s,height:o,style:{fill:S,stroke:a,strokeWidth:c},shapeRendering:p,onClick:h?R=>h(R,e):void 0})}const aR=j.memo(lR),cR=e=>e.nodes.map(t=>t.id),_o=e=>e instanceof Function?e:()=>e;function uR({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:i=aR,onClick:l}){const a=Ee(cR,ke),c=_o(t),d=_o(e),x=_o(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:a.map(m=>r.jsxRuntimeExports.jsx(xR,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function dR({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:a,onClick:c}){const{node:d,x,y:p,width:m,height:h}=Ee(g=>{const{internals:E}=g.nodeLookup.get(e),S=E.userNode,{x:R,y:v}=E.positionAbsolute,{width:y,height:C}=dt(S);return{node:S,x:R,y:v,width:y,height:C}},ke);return!d||d.hidden||!Gu(d)?null:r.jsxRuntimeExports.jsx(a,{x,y:p,width:m,height:h,style:d.style,selected:!!d.selected,className:s(d),color:t(d),borderRadius:o,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:c,id:d.id})}const xR=j.memo(dR);var pR=j.memo(uR);const mR=200,fR=150,hR=e=>!e.hidden,gR=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?Yu(Vn(e.nodeLookup,{filter:hR}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},jR="react-flow__minimap-desc";function Xd({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:o="",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 k=ve(),T=j.useRef(null),{boundingRect:N,viewBB:I,rfId:B,panZoom:F,translateExtent:$,flowWidth:D,flowHeight:z,ariaLabelConfig:b}=Ee(gR,ke),P=e?.width??mR,_=e?.height??fR,L=N.width/P,V=N.height/_,H=Math.max(L,V),K=H*P,Z=H*_,G=C*H,Q=N.x-(K-N.width)/2-G,ee=N.y-(Z-N.height)/2-G,ae=K+G*2,re=Z+G*2,se=`${jR}-${B}`,te=j.useRef(0),le=j.useRef();te.current=H,j.useEffect(()=>{if(T.current&&F)return le.current=Ay({domNode:T.current,panZoom:F,getTransform:()=>k.getState().transform,getViewScale:()=>te.current}),()=>{le.current?.destroy()}},[F]),j.useEffect(()=>{le.current?.update({translateExtent:$,width:D,height:z,inversePan:v,pannable:E,zoomStep:y,zoomable:S})},[E,S,v,y,$,D,z]);const Re=h?me=>{const[X,de]=le.current?.pointer(me)||[0,0];h(me,{x:X,y:de})}:void 0,Ce=g?j.useCallback((me,X)=>{const de=k.getState().nodeLookup.get(X).internals.userNode;g(me,de)},[]):void 0,ue=R??b["minimap.ariaLabel"];return r.jsxRuntimeExports.jsx(qs,{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*H: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:Te(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:r.jsxRuntimeExports.jsxs("svg",{width:P,height:_,viewBox:`${Q} ${ee} ${ae} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:T,onClick:Re,children:[ue&&r.jsxRuntimeExports.jsx("title",{id:se,children:ue}),r.jsxRuntimeExports.jsx(pR,{onClick:Ce,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:a}),r.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q-G},${ee-G}h${ae+G*2}v${re+G*2}h${-ae-G*2}z
39
+ M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Xd.displayName="MiniMap";j.memo(Xd);const ER=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,yR={[rn.Line]:"right",[rn.Handle]:"bottom-right"};function SR({nodeId:e,position:t,variant:n=rn.Handle,className:s,style:o=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=kd(),y=typeof e=="string"?e:v,C=ve(),k=j.useRef(null),T=n===rn.Handle,N=Ee(j.useCallback(ER(T&&h),[T,h]),ke),I=j.useRef(null),B=t??yR[n];j.useEffect(()=>{if(!(!k.current||!y))return I.current||(I.current=Xy({domNode:k.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:$,transform:D,snapGrid:z,snapToGrid:b,nodeOrigin:P,domNode:_}=C.getState();return{nodeLookup:$,transform:D,snapGrid:z,snapToGrid:b,nodeOrigin:P,paneDomNode:_}},onChange:($,D)=>{const{triggerNodeChanges:z,nodeLookup:b,parentLookup:P,nodeOrigin:_}=C.getState(),L=[],V={x:$.x,y:$.y},H=b.get(y);if(H&&H.expandParent&&H.parentId){const K=H.origin??_,Z=$.width??H.measured.width??0,G=$.height??H.measured.height??0,Q={id:H.id,parentId:H.parentId,rect:{width:Z,height:G,...Uu({x:$.x??H.position.x,y:$.y??H.position.y},{width:Z,height:G},H.parentId,b,K)}},ee=oi([Q],b,P,_);L.push(...ee),V.x=$.x?Math.max(K[0]*Z,$.x):void 0,V.y=$.y?Math.max(K[1]*G,$.y):void 0}if(V.x!==void 0&&V.y!==void 0){const K={id:y,type:"position",position:{...V}};L.push(K)}if($.width!==void 0&&$.height!==void 0){const Z={id:y,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};L.push(Z)}for(const K of D){const Z={...K,type:"position"};L.push(Z)}z(L)},onEnd:({width:$,height:D})=>{const z={id:y,type:"dimensions",resizing:!1,dimensions:{width:$,height:D}};C.getState().triggerNodeChanges([z])}})),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 F=B.split("-");return r.jsxRuntimeExports.jsx("div",{className:Te(["react-flow__resize-control","nodrag",...F,n,s]),ref:k,style:{...o,scale:N,...l&&{[T?"backgroundColor":"borderColor"]:l}},children:i})}j.memo(SR);const A=e=>r.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),je=e=>r.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Me=e=>r.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),he=e=>r.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),RR={left:{left:J.Left,right:J.Right,top:J.Top,bottom:J.Bottom},right:{left:J.Right,right:J.Left,top:J.Bottom,bottom:J.Top},top:{left:J.Bottom,right:J.Top,top:J.Left,bottom:J.Right},bottom:{left:J.Top,right:J.Bottom,top:J.Right,bottom:J.Left}},CR=(e,t)=>RR[t][e],bR=(e,t=!1)=>{if(t)return e;switch(e){case J.Left:return J.Right;case J.Right:return J.Left;case J.Top:return J.Bottom;case J.Bottom:return J.Top;default:return J.Top}},wR=(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},U=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=US()}catch{return null}const o=j.useRef(null),i=j.useRef(!0);return j.useEffect(()=>{if(o.current==null)return;if(i.current){i.current=!1;return}const a=o.current.closest(".react-flow__node")?.getAttribute("data-id");a!=null&&s?.(a)},[t,n]),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("span",{ref:o}),e]})},w=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:o,top:i,style:l,...a})=>{const c=wR(i,s,t,n);return r.jsxRuntimeExports.jsx(Nn,{position:bR(CR(e,t),!o),...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}})},fe=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:o,...i})=>r.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.fr.cssString(o),...i}),oe=({className:e,...t})=>r.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.B("symbol-primitive"),e),...t}),vR=.8,q=({dimensions:e,orientation:t="left",children:n,className:s,color:o,style:i={},scale:l=1,...a})=>{e=u.p.construct(t)==="y"?u._.swap(e):e;const d=u.fr.cssString(o),x=f.use();let p={...i,aspectRatio:`${e.width} / ${e.height}`,width:u._.scale(e,l*vR).width};return o!=null&&(p={...p,[u.CSS.var("symbol-color")]:u.fr.rgbString(o),[u.CSS.var("symbol-color-contrast")]:u.fr.rgbString(u.fr.pickByContrast(o,x.colors.gray.l0,x.colors.gray.l11))}),r.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:r.jsxRuntimeExports.jsx("g",{children:n})})},qd=({className:e,orientation:t="left",scale:n,color:s,...o})=>{const i=u.fr.cssString(s);return r.jsxRuntimeExports.jsxs(fe,{...o,orientation:t,className:u.CSS(u.CSS.B("four-way-valve"),e),children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:12.037,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:87.963,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:50,top:7.2916,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:50,top:92.6084,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:108,height:96},color:s,scale:n,children:[r.jsxRuntimeExports.jsx(A,{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}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M8.70001 73.5C24.7 73.5 28.7 86.8333 28.7 93.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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}),r.jsxRuntimeExports.jsx(A,{d:"M99.7 22.5C83.7 22.5 79.7 9.16667 79.7 2.5",strokeLinecap:"round"})]})]})},Qd=({color:e,orientation:t="left",scale:n,...s})=>r.jsxRuntimeExports.jsxs(fe,{...s,className:u.CSS(u.CSS.B("three-way-valve")),orientation:t,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),r.jsxRuntimeExports.jsx(A,{d:"M44.3923 22.3611C44.0222 21.6298 42.9778 21.6298 42.6077 22.3611L24.7035 57.7433C23.6937 59.7388 25.1438 62.0978 27.3803 62.0978L59.6197 62.0978C61.8562 62.0978 63.3063 59.7388 62.2965 57.7433L44.3923 22.3611Z"})]})]}),Jd=({orientation:e="left",color:t,scale:n,...s})=>r.jsxRuntimeExports.jsxs(fe,{...s,children:[r.jsxRuntimeExports.jsxs(U,{orientation:e,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:r.jsxRuntimeExports.jsx(A,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"})})]}),ex=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:o,...i})=>r.jsxRuntimeExports.jsxs(fe,{className:u.CSS(u.CSS.B("solenoid-valve"),s&&u.CSS.M("normally-open"),e),orientation:n,...i,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:69},color:t,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),r.jsxRuntimeExports.jsx(je,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),tx=({specKey:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:o,scale:i=1,className:l,stateOverrides:a,...c})=>{const d=zs.useDirect({params:{key:e}}),x=j.useRef(null);Vr({container:x.current,orientation:s,activeState:t?"active":"base",externalScale:i,spec:d?.data?.data,stateOverrides:a});const p=d?.data?.data?.handles||[];return r.jsxRuntimeExports.jsx(fe,{ref:x,className:u.CSS(u.CSS.BM("symbol","custom"),u.CSS.B("custom-actuator"),s!=null&&u.CSS.loc(s),t&&u.CSS.M("enabled"),n&&u.CSS.M("triggered"),l),enabled:t,triggered:n,...c,children:r.jsxRuntimeExports.jsx(U,{orientation:s,children:p.map(m=>r.jsxRuntimeExports.jsx(w,{id:m.key,location:m.orientation,orientation:s,left:m.position.x*100,top:m.position.y*100},m.key))})})},nx=({specKey:e,orientation:t="left",color:n,scale:s=1,className:o,stateOverrides:i,...l})=>{const a=zs.useDirect({params:{key:e}}),c=j.useRef(null);Vr({container:c.current,orientation:t,activeState:"base",externalScale:s,spec:a?.data?.data,stateOverrides:i});const d=a?.data?.data?.handles||[];return r.jsxRuntimeExports.jsx(oe,{ref:c,className:u.CSS(u.CSS.BM("symbol","custom"),u.CSS.B("custom-static"),t!=null&&u.CSS.loc(t),o),...l,children:r.jsxRuntimeExports.jsx(U,{orientation:t,children:d.map(x=>r.jsxRuntimeExports.jsx(w,{id:x.key,location:x.orientation,orientation:t,left:x.position.x*100,top:x.position.y*100},x.key))})})},sx=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{className:u.CSS(u.CSS.B("relief-valve"),e),enabled:o,...i,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),ox=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{orientation:t,className:u.CSS(u.CSS.B("check-valve"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M41.6607 21.8946C42.3917 21.5238 42.3906 20.4794 41.6589 20.1101L6.25889 2.2412C4.26237 1.23341 1.90481 2.68589 1.90704 4.92235L1.93925 37.1617C1.94148 39.3982 4.30194 40.846 6.29644 39.8342L41.6607 21.8946Z"})]})]}),rx=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const i=u.fr.cssString(n);return r.jsxRuntimeExports.jsxs(oe,{...o,orientation:t,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(Me,{cx:"7",cy:"7",r:"4",fill:i}),r.jsxRuntimeExports.jsx(A,{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"})]})]})},ix=({className:e,orientation:t="left",color:n,scale:s,...o})=>{const i=u.fr.cssString(n);return r.jsxRuntimeExports.jsxs(oe,{orientation:t,className:u.CSS(u.CSS.B("check-valve-with-arrow"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:8.602,top:60.65,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.775,top:60.65,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:93,height:57},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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}),r.jsxRuntimeExports.jsx(A,{d:"M62.5 6H32.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Me,{cx:"7.5",cy:"13.5",r:"6",fill:i}),r.jsxRuntimeExports.jsx(A,{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"})]})]})},lx=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,orientation:n,className:u.CSS(u.CSS.B("angled-valve"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),r.jsxRuntimeExports.jsx(A,{d:"M21.8923 22.3611C21.5222 21.6298 20.4778 21.6298 20.1077 22.3611L2.20349 57.7433C1.19372 59.7388 2.64384 62.0978 4.8803 62.0978L37.1197 62.0978C39.3562 62.0978 40.8063 59.7388 39.7965 57.7433L21.8923 22.3611Z"})]})]}),ax=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("ball-valve"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Me,{cx:"43.5978",cy:"20.972",r:"19"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("three-way-ball-valve"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.8,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:33.1308,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:33.1308,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Me,{cx:"43.5978",cy:"21.722",r:"19"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),ux=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("gate-valve"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 2 L43.5 39.7965"})]})]}),dx=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-one"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 2V40"}),r.jsxRuntimeExports.jsx(Me,{cx:"43.5",cy:"21",r:"10",fill:u.fr.cssString(e)})]})]}),xx=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-two"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Me,{cx:"43.5",cy:"21",r:"10",fill:u.fr.cssString(e)}),r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),r.jsxRuntimeExports.jsx(A,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),px=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("breather-valve"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:8.081,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:91.919,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Me,{cx:"91",cy:"49.5",r:"6",fill:u.fr.cssString(e)}),r.jsxRuntimeExports.jsx(Me,{cx:"8",cy:"7.5",r:"6",fill:u.fr.cssString(e)}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),mx=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Me,{cx:"32",cy:"32",r:"30"}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)})]})]}),fx=({className:e,color:t,orientation:n="left",scale:s,...o})=>{const i=u.fr.cssString(t);return r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("symbol"),e),children:[r.jsxRuntimeExports.jsx(U,{orientation:n,children:r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:5,top:50,id:"1"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),r.jsxRuntimeExports.jsx(A,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:i}),r.jsxRuntimeExports.jsx(A,{d:"M33 24H2",strokeLinecap:"round"})]})]})},hx=({className:e,color:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("symbol"),e),children:[r.jsxRuntimeExports.jsx(U,{orientation:n,children:r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),gx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("cap"),e),...o,children:[r.jsxRuntimeExports.jsx(U,{orientation:t,children:r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),r.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:r.jsxRuntimeExports.jsx(A,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"})})]}),jx=({className:e,orientation:t="left",color:n,scale:s=1,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("cap"),e),...o,children:[r.jsxRuntimeExports.jsx(U,{orientation:t,children:r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:50,top:50,id:"1"})}),r.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:r.jsxRuntimeExports.jsx(A,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),Ex=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:t,className:u.CSS(u.CSS.B("manual-valve"),e),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),r.jsxRuntimeExports.jsx(A,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 27L6.35453 8.20349C4.35901 7.19372 2 8.64384 2 10.8803V43.1197C2 45.3562 4.35901 46.8063 6.35453 45.7965L43.5 27ZM43.5 27L80.6455 8.20349C82.641 7.19372 85 8.64384 85 10.8803V43.1197C85 45.3562 82.641 46.8063 80.6455 45.7965L43.5 27Z"})]})]}),yx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("orifice_plate"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{color:n,dimensions:{width:72,height:36},orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M24.5 33V22",strokeLinecap:"round"})]})]}),Hl=(e,t)=>e/t*100,Sx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("filter"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:r.jsxRuntimeExports.jsx(A,{d:"M6 17L24.8 2.9C25.5111 2.36667 26.4889 2.36667 27.2 2.9L46 17M6 17L24.8 31.1C25.5111 31.6333 26.4889 31.6333 27.2 31.1L46 17"})})]}),Rx=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,kR=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:o}=e;return`${t.x}% ${n.x}% ${o.x}% ${s.x}% / ${t.y}% ${n.y}% ${o.y}% ${s.y}%`},Cx={width:40,height:80},ii={x:50,y:10},Js=({className:e,dimensions:t=Cx,borderRadius:n=ii,boxBorderRadius:s,color:o,backgroundColor:i,strokeWidth:l=2,...a})=>{const c=Rx(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=Hl(1,p),E=100-g,S=Hl(1,m),R=100-S;return r.jsxRuntimeExports.jsx(oe,{className:u.CSS(e,u.CSS.B("tank")),style:{...t,borderRadius:s??kR(c),borderColor:u.fr.cssString(o??x.colors.gray.l11),backgroundColor:u.fr.cssString(i),borderWidth:l},...a,children:r.jsxRuntimeExports.jsxs(U,{refreshDeps:h,orientation:"left",children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:50,top:S,id:"1"}),d&&r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:g,top:c.topLeft.y,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:E,top:c.topRight.y,id:"3"})]}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:50,top:R,id:"4"}),d&&r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:g,top:100-c.bottomLeft.y,id:"5"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:E,top:100-c.bottomRight.y,id:"6"})]}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:g,top:50,id:"7"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:E,top:50,id:"8"})]})})},_R=20,MR=(e,t,n=0,s=4)=>{const o=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=o*d+i-Math.PI/2;return{x:a+l*Math.cos(x),y:a+l*Math.sin(x)}})},TR=(e,t,n)=>{const s=[],o=Math.min(n,t/2),i=e.length;if(i<3||o<=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=o/g,R=o/E,v=c.x-x*S,y=c.y-p*S,C=c.x+m*R,k=c.y+h*R;l===0?s.push(`M ${v},${y}`):s.push(`L ${v},${y}`),s.push(`Q ${c.x},${c.y} ${C},${k}`)}return s.push("Z"),s.join(" ")},li=({numSides:e,sideLength:t,rotation:n=0,color:s,backgroundColor:o,className:i,cornerRounding:l,strokeWidth:a,...c})=>{const d=f.use(),x=j.useMemo(()=>2*((a??2)+1),[a]),p=j.useMemo(()=>MR(e,t,n,x),[e,t,n,x]),m=j.useMemo(()=>TR(p,t,l??0),[p,t,l]),h=j.useMemo(()=>2*(t/(2*Math.sin(Math.PI/e)))+x,[t,e,x]);return r.jsxRuntimeExports.jsx(oe,{className:u.CSS(i,u.CSS.B("polygon")),...c,children:r.jsxRuntimeExports.jsx(q,{dimensions:{width:h,height:h},children:r.jsxRuntimeExports.jsx(A,{d:m,fill:u.fr.cssString(o??d.colors.gray.l1),stroke:u.fr.cssString(s??d.colors.gray.l9),strokeWidth:a??2})})})},bx=({radius:e,color:t,backgroundColor:n,className:s,strokeWidth:o,...i})=>{const l=(o??2)+1,a=e*2,c=a+2*l,d=a+2*l;return r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(s,u.CSS.B("circle-shape")),...i,children:[r.jsxRuntimeExports.jsxs(U,{orientation:"left",refreshDeps:e,children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:50,top:l/d*100,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:50,top:(d-l)/d*100,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:l/c*100,top:50,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:(c-l)/c*100,top:50,id:"4"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:c,height:d},children:r.jsxRuntimeExports.jsx(Me,{cx:c/2,cy:d/2,r:e,stroke:u.fr.cssString(t),strokeWidth:o??2,fill:u.fr.cssString(n)})})]})},wx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(e,u.CSS.B("regulator")),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),r.jsxRuntimeExports.jsx(A,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),r.jsxRuntimeExports.jsx(he,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),vx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(e,u.CSS.B("regulator-manual")),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50,top:2.2989,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.381,top:75,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.619,top:75,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:84},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.5 20L43.5 2",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M19.5 2L67.5 2",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:"43.5",y1:"63",x2:"43.5",y2:"40"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),kx=({className:e,orientation:t="left",scale:n,color:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("orifice"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[r.jsxRuntimeExports.jsx(A,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:t,className:u.CSS(u.CSS.B("needle-valve"),e),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M43.0152 21.5391L38.237 2.62245C38.1573 2.30658 38.396 2 38.7218 2L48.2782 2C48.604 2 48.8427 2.30658 48.763 2.62245L43.9848 21.5391C43.8576 22.0425 43.1424 22.0425 43.0152 21.5391Z",fill:u.fr.cssString(n)}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 21.5L6.35453 2.70349C4.35901 1.69372 2 3.14384 2 5.38029V37.6197C2 39.8562 4.35901 41.3063 6.35453 40.2965L43.5 21.5ZM43.5 21.5L80.6455 2.70349C82.641 1.69372 85 3.14384 85 5.3803V37.6197C85 39.8562 82.641 41.3063 80.6455 40.2965L43.5 21.5Z"})]})]}),Mx=({color:e,className:t,orientation:n="left",scale:s,enabled:o=!1,...i})=>r.jsxRuntimeExports.jsxs(fe,{...i,orientation:n,className:u.CSS(u.CSS.B("angled-relief-valve"),t),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),r.jsxRuntimeExports.jsx(A,{d:"M21.8923 37.3611C21.5222 36.6298 20.4778 36.6298 20.1077 37.3611L2.20349 72.7433C1.19372 74.7388 2.64384 77.0978 4.8803 77.0978H37.1197C39.3562 77.0978 40.8063 74.7388 39.7965 72.7433L21.8923 37.3611Z"})]})]}),Tx=({className:e,color:t,dimensions:n,orientation:s="left",units:o="psi",unitsLevel:i="small",children:l,inlineSize:a=80,...c})=>{const d=u.fr.cssString(t),x=f.use(),p=t==null?"var(--pluto-gray-l0)":u.fr.cssString(u.fr.pickByContrast(t,x.colors.gray.l0,x.colors.gray.l11));return r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("value"),e),...c,style:{borderColor:d,height:n?.height},children:[r.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n?.width,inlineSize:a,maxWidth:n?.width},children:l}),r.jsxRuntimeExports.jsxs(U,{orientation:s,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:100,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),r.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.BE("value","units"),u.CSS.M(i)),style:{background:d},children:r.jsxRuntimeExports.jsx(f.Text,{level:i,color:p,children:o})})]})},Lx=({enabled:e=!1,onClick:t,orientation:n="left"})=>r.jsxRuntimeExports.jsxs(oe,{orientation:n,children:[r.jsxRuntimeExports.jsx(f.Switch$1,{value:e,onClick:t,onChange:()=>{}}),r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Px=({onClick:e,onMouseDown:t,onMouseUp:n,orientation:s="left",label:o="",color:i,size:l,level:a,onClickDelay:c})=>r.jsxRuntimeExports.jsxs(oe,{orientation:s,children:[r.jsxRuntimeExports.jsx(f.Button,{variant:"filled",onClick:e,onMouseDown:t,onMouseUp:n,color:i,size:l,level:a,onClickDelay:c,children:o}),r.jsxRuntimeExports.jsxs(U,{orientation:s,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:s,left:0,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:s,left:100,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:s,left:50,top:0,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:s,left:50,top:100,id:"4"})]})]}),Nx=({className:e,orientation:t="left",width:n,color:s,level:o,autoFit:i,align:l="center",value:a,onChange:c,...d})=>{const x={textAlign:l};return u.p.construct(t)==="y"?x.height=i?"fit-content":n:x.width=i?"fit-content":n,r.jsxRuntimeExports.jsx(oe,{style:x,orientation:t,className:u.CSS(u.CSS.B("text-box"),u.CSS.loc(t),e),...d,children:r.jsxRuntimeExports.jsx(f.MaybeEditable,{className:u.CSS.BE("symbol","label"),color:u.fr.cssString(s),level:o,value:a,onChange:c})})},Ax=({orientation:e="left",className:t,onClick:n,children:s,value:o,units:i,color:l,onChange:a,size:c="small",disabled:d,...x})=>{const[p,m]=j.useState(o);return r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("setpoint"),t),orientation:e,...x,children:[r.jsxRuntimeExports.jsxs(U,{orientation:e,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:e,left:.5,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:e,left:100,top:50,id:"2",style:{zIndex:5}}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:e,left:50,top:-2,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),r.jsxRuntimeExports.jsx(f.Numeric,{size:c,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,color:l,borderWidth:1,disabled:d,children:r.jsxRuntimeExports.jsx(f.Button,{size:c,variant:"filled",onClick:()=>a(p),color:l,children:"Set"})})]})},Ox=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("screw-pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Me,{cx:"32",cy:"32",r:"30"}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(A,{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)}),r.jsxRuntimeExports.jsx(A,{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)})]})]}),Ix=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("vacuum-pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:r.jsxRuntimeExports.jsx(A,{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"})})]}),Dx=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("cavity-pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Me,{cx:"32",cy:"32",r:"30"}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(A,{d:"M 17 26 C 17 20.6667 23 20.6667 23 26 C 23 31.3333 29 31.3333 29 26 C 29 20.6667 35 20.6667 35 26",strokeLinecap:"round",transform:"translate(6, 6)",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Bx=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("piston-pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(Me,{cx:"32",cy:"32",r:"30"}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(A,{d:"M 23 32, h 16, m 0 -8, v 16",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),$x=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("static-mixer"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),zx=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("rotary-mixer"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),r.jsxRuntimeExports.jsx(he,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Vx=({className:e,color:t,orientation:n="left",enabled:s,scale:o,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,orientation:n,className:u.CSS(u.CSS.B("light"),s&&u.CSS.M("enabled"),e),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:64,height:64},color:t,orientation:n,scale:o,children:r.jsxRuntimeExports.jsx(Me,{cx:"32",cy:"32",r:"30"})})]}),Fx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(e,u.CSS.B("regulator")),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.29885,top:69.565,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.70115,top:69.565,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:23.1479,top:23.61,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50,top:11.11,id:"4"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:76.8521,top:23.61,id:"5"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:69},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(je,{x:"21",y:"6.5",width:"44",height:"18",rx:"2"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"49",x2:"43",y2:"24.5"})]})]}),Hx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(e,u.CSS.B("regulator-motorized")),...o,orientation:t,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:35.6321,top:13.72549,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50,top:1.96078,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:64.3679,top:13.72549,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:24.1379,top:46.078,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:75.8621,top:46.078,id:"5"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.2989,top:78.43137,id:"6"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97.7011,top:78.43137,id:"7"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:102},orientation:t,color:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"80.5",x2:"43",y2:"56"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(je,{x:"21",y:"38",width:"44",height:"18",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M43 38V26",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Me,{cx:"43",cy:"14",r:"12"})]})]}),Zx=({orientation:e="left",color:t,scale:n,...s})=>r.jsxRuntimeExports.jsxs(fe,{...s,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:e,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:e,left:50,top:1,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:88,height:86},color:t,orientation:e,scale:n,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M43 1L45 65"})]})]}),Kx=({orientation:e="left",color:t,scale:n,...s})=>r.jsxRuntimeExports.jsxs(fe,{...s,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:e,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:e,left:51,top:2,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),Yx=({orientation:e="left",color:t,scale:n,...s})=>r.jsxRuntimeExports.jsxs(fe,{...s,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:e,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:e,left:51,top:2,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:t,orientation:e,scale:n,children:[r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"1",x2:"43",y2:"49"}),r.jsxRuntimeExports.jsx(je,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),Gx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:t,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:51,top:2,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"1",x2:"43",y2:"49"}),r.jsxRuntimeExports.jsx(je,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),r.jsxRuntimeExports.jsx(he,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"49",x2:"43",y2:"83",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:u.CSS(u.CSS.M("detail"),e),strokeLinecap:"round"})]})]}),Ux=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:t,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:51,top:2,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(je,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),Wx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("agitator")),children:[r.jsxRuntimeExports.jsx(U,{orientation:t,children:r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:51,top:2,id:"4"})}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:87,height:87},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(he,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Xx=({id:e,className:t,orientation:n="right",label:s="text",color:o,level:i="p",onLabelChange:l,...a})=>{const c=document.querySelector(`[data-id="${e}"]`);c&&c.classList.add(n);const d=u.p.construct(n)==="y";return r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("arrow"),u.CSS.loc(n),t),orientation:n,...a,children:[r.jsxRuntimeExports.jsx("div",{className:"wrapper",children:r.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:u.fr.cssString(o)},children:r.jsxRuntimeExports.jsx("div",{className:"bg",children:r.jsxRuntimeExports.jsx(f.MaybeEditable,{value:s,onChange:l,level:i,className:u.CSS.BE("symbol","label")})})})}),r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:d,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:d,id:"2"})]}),r.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:r.jsxRuntimeExports.jsx("defs",{children:r.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[r.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),r.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"}),r.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},qx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("vent"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),r.jsxRuntimeExports.jsx(q,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:r.jsxRuntimeExports.jsx(A,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),Qx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("iso-filter"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:95,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),r.jsxRuntimeExports.jsx(he,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(he,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),Jx=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("flow-straightener"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:3,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:97,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:50,top:93,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2.5",y:"2.5",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M10.5 26.5H60.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M10.5 9.5H60.5",strokeLinecap:"round"})]})]}),ep=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("heater-element"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:11.9,top:5.55555556,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:11.9,top:94,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:21,height:36},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(A,{d:"M2.5 34.0005H14.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M2.5 2.00049L14.5 2.00049",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),tp=({className:e,dimensions:t=Cx,borderRadius:n=ii,boxBorderRadius:s,color:o,backgroundColor:i,...l})=>{const a=Rx(n),c=f.use(),d=j.useMemo(()=>[t,n,a],[a.bottomLeft,a.bottomRight,a.topLeft,a.topRight,t.height,t.width]),x=u.fr.cssString(o??c.colors.gray.l11),p=i==null?void 0:u.fr.cssString(i),m=t.width/66,h=t.height/180,g=`scale(${m},${h})`;return r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(e,u.CSS.B("cylinder")),style:{...t},...l,children:[r.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:r.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})}),r.jsxRuntimeExports.jsxs(U,{refreshDeps:d,orientation:"left",children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:"left",left:50,top:2,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:35,top:10,id:"9"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:65,top:10,id:"10"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:4,top:40,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:96,top:40,id:"4"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:4,top:60,id:"5"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:96,top:60,id:"6"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:"left",left:4,top:80,id:"7"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},np=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...i})=>{const l=u.fr.cssString(n);return r.jsxRuntimeExports.jsxs(fe,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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}),r.jsxRuntimeExports.jsx(A,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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}),r.jsxRuntimeExports.jsx(Me,{cx:"44",cy:"55",r:"4",fill:l}),r.jsxRuntimeExports.jsx(A,{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})]})]})},sp=({className:e,orientation:t="left",color:n,scale:s,enabled:o=!1,...i})=>{const l=u.fr.cssString(n);return r.jsxRuntimeExports.jsxs(fe,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(Me,{cx:"21",cy:"56.0737",r:"4",fill:l}),r.jsxRuntimeExports.jsx(A,{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"})]})]})},op=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("t-junction"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:3.8462,top:22.3095,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.1538,top:22.3095,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:50,top:92.8571,id:"3"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:39,height:21},color:n,orientation:t,scale:s,children:r.jsxRuntimeExports.jsx(A,{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.fr.cssString(n),stroke:"none"})})]}),rp=({className:e,orientation:t="left",color:n,scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{className:u.CSS(u.CSS.B("t-junction"),e),...o,children:[r.jsxRuntimeExports.jsxs(U,{orientation:t,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:t,left:3.8462,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:t,left:96.1539,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:t,left:50.5,top:96.1539,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:t,left:50.5,top:3.8462,id:"4"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:39,height:39},color:n,orientation:t,scale:s,children:r.jsxRuntimeExports.jsx(A,{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.fr.cssString(n),stroke:"none"})})]}),Ue=({position:e,color:t})=>r.jsxRuntimeExports.jsx("text",{x:e?.x??57,y:e?.y??27,style:{fill:u.fr.cssString(t),fontWeight:450},stroke:"none",children:"F"}),ip=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-general"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(Ue,{position:{x:56,y:25},color:s})]})]}),lp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Electromagnetic"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M47.5 17.5H55.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M15.5 17.5H23.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(Ue,{position:{x:58,y:29},color:s})]})]}),ap=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-VariableArea"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M46 10V25"}),r.jsxRuntimeExports.jsx(A,{d:"M23 13V22"}),r.jsxRuntimeExports.jsx(A,{d:"M23 13L46 10"}),r.jsxRuntimeExports.jsx(A,{d:"M23 22L46 25"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),cp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Coriolis"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M2 17.6024H28.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M28.5 17.6024L34.6834 14.0324",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M34.8 14L45.9058 20.9666",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M51.5 17.6024L46.0141 20.8987",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M20.5 17.6024L26.6574 14.0474",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M26.75 14.1024L37.788 21.0265",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 17.6024L37.8427 21.0017",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M43.5 17.6024H69",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{position:{x:58,y:29},color:s})]})]}),up=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Nozzle"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M24 2V7V12",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M24 12H34",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M24 23H29H34",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M24 33V23",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),dp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Venturi"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M8 33L26.5329 22.3",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M8 2L26.5329 12.7",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M56 33L26.5876 22.2948",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M56 2L26.5876 12.7052",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{position:{x:56,y:29},color:s})]})]}),xp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-RingPiston"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(Me,{cx:"36.5",cy:"17.5",r:"10.5",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(Me,{cx:"36.5",cy:"21.5",r:"6.5",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(Ue,{position:{x:56,y:29},color:s})]})]}),pp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-PositiveDisplacement"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),mp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Turbine"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M16.5 17.5H54.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M32.5 9L35.4756 17.1753",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M38.5 26L35.5244 17.8247",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M32.5 26L35.4756 17.8247",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M38.5 9L35.5244 17.1753",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),fp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Pulse"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M31 13.5H39",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M23 21.5H31",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M39 21.5H47",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M39 13.5V21.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31 13.5V21.5",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),hp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-FloatSensor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:71,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M25 8H46",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31 27H40",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M31 27L25.046 8.11641",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M40 27L45.954 8.11641",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),gp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("flowmeter-Orifice"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:6,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:91,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:72,height:36},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"2.5",y:"2",width:"67",height:"31",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M24.5 2V7.5V13",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{d:"M24.5 33V22",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(Ue,{color:s})]})]}),jp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("heat-exchanger-general"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.545,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.454,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.454,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(A,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Ep=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:89,top:27.27,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:89,top:72.73,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.455,id:"4"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.545,top:50,id:"5"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),yp=({id:e,className:t,orientation:n="right",color:s,scale:o=1,...i})=>r.jsxRuntimeExports.jsxs(oe,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:9,top:6.25,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:24,top:93.75,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:76,top:6.25,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:91,top:93.75,id:"4"}),r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:1.508,top:50,id:"5"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:98.492,top:50,id:"6"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:199,height:48},color:s,orientation:n,scale:o,children:[r.jsxRuntimeExports.jsx(je,{x:"3",y:"3",width:"193",height:"42",rx:"1",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(je,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(je,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1",strokeWidth:"2"}),r.jsxRuntimeExports.jsx(he,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24",strokeWidth:"2"})]})]}),Sp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Rp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Cp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("compressor"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:r.jsxRuntimeExports.jsx(A,{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,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(Me,{cx:"33",cy:"33",r:"14.5"})]})]}),wp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M35 12.4V20.4"}),r.jsxRuntimeExports.jsx(A,{d:"M3 33H16"}),r.jsxRuntimeExports.jsx(A,{d:"M35 53.6V45.6"})]})]}),vp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M39 33H47"}),r.jsxRuntimeExports.jsx(A,{d:"M27 33H19"}),r.jsxRuntimeExports.jsx(A,{d:"M36 27.804L40 20.8758"}),r.jsxRuntimeExports.jsx(A,{d:"M30 27.804L26 20.8758"}),r.jsxRuntimeExports.jsx(A,{d:"M30 38.196L26 45.1242"}),r.jsxRuntimeExports.jsx(A,{d:"M36 38.196L40 45.1242"})]})]}),kp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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,...o})=>r.jsxRuntimeExports.jsxs(fe,{...o,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{d:"M3 33H63"})]})]}),Mp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:7.575,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:92.425,top:50,id:"2"})]}),r.jsxRuntimeExports.jsx(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:r.jsxRuntimeExports.jsx(A,{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"})})]}),Tp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),r.jsxRuntimeExports.jsx(A,{d:"M16 2.5L16 66.5"}),r.jsxRuntimeExports.jsx(A,{d:"M2 34.5H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 19H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 50H30"}),r.jsxRuntimeExports.jsx(A,{d:"M29.121 3.37903L61 34.5"}),r.jsxRuntimeExports.jsx(A,{d:"M29.12 65.62L61 34.5"})]})]}),Lp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),r.jsxRuntimeExports.jsx(A,{d:"M30 2.5L30 66.5"}),r.jsxRuntimeExports.jsx(A,{d:"M16 2.5L16 66.5"}),r.jsxRuntimeExports.jsx(A,{d:"M2 34.5H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 19H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 50H30"})]})]}),Pp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),r.jsxRuntimeExports.jsx(A,{d:"M16 2.5L16 66.5"}),r.jsxRuntimeExports.jsx(A,{d:"M2 34.5H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 19H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 50H30"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),r.jsxRuntimeExports.jsx(he,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Np=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),r.jsxRuntimeExports.jsx(A,{d:"M16 2.5L16 66.5"}),r.jsxRuntimeExports.jsx(A,{d:"M2 34.5H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 19H30"}),r.jsxRuntimeExports.jsx(A,{d:"M2 50H30"}),r.jsxRuntimeExports.jsx(A,{d:"M29.121 3.37903L61 34.5"}),r.jsxRuntimeExports.jsx(A,{d:"M29.12 65.62L61 34.5"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(he,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),r.jsxRuntimeExports.jsx(he,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Ap=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("thruster"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:25.3,top:4.76,id:"3"}),r.jsxRuntimeExports.jsx(w,{location:"bottom",orientation:n,left:25.3,top:95.24,id:"4"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),r.jsxRuntimeExports.jsx(A,{d:"M78.5 37.5117V4.51172"}),r.jsxRuntimeExports.jsx(A,{d:"M40.5 11.5L76.0072 2.6232"}),r.jsxRuntimeExports.jsx(A,{d:"M40.5 30.5L76.0072 39.3768"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Op=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("nozzle"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:18.75,top:17.46,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"top",orientation:n,left:50,top:1.5873,id:"2"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:81.25,top:17.46,id:"3"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:64,height:126},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"12",y:"1.6667",width:"40",height:"40",rx:"2"}),r.jsxRuntimeExports.jsx(A,{d:"M1.3333 124H62.6667",strokeLinecap:"round"}),r.jsxRuntimeExports.jsx(A,{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"}),r.jsxRuntimeExports.jsx(A,{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"})]})]}),Ip=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("strainer"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),r.jsxRuntimeExports.jsx(A,{d:"M2.293 2.29297L29.9383 66.7986",strokeDasharray:"6 6"})]})]}),Dp=({color:e,className:t,orientation:n="left",scale:s,...o})=>r.jsxRuntimeExports.jsxs(oe,{...o,className:u.CSS(u.CSS.B("strainer"),t),children:[r.jsxRuntimeExports.jsxs(U,{orientation:n,children:[r.jsxRuntimeExports.jsx(w,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),r.jsxRuntimeExports.jsx(w,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),r.jsxRuntimeExports.jsxs(q,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[r.jsxRuntimeExports.jsx(je,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),r.jsxRuntimeExports.jsx(A,{d:"M31 34.5L2.30611 2.33992",strokeDasharray:"6 6"}),r.jsxRuntimeExports.jsx(A,{d:"M31 34.5L2.30611 66.6601",strokeDasharray:"6 6"})]})]}),eo=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Ie=(e,t)=>{const n=eo(t),s=e.getNodes().find(o=>o.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()))},LR=(e,t)=>to.fromFlow(e,t);class Bp{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 to{key;box;handles;constructor(t,n,s){this.key=t,this.box=n,this.handles=s,s.forEach(o=>o.node=this)}static fromFlow(t,n){const s=Ie(n,t),o=eo(t),i=o.getElementsByClassName("react-flow__handle"),l=u.Ho.construct(o),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 Bp(x,m)});return new to(t,s,a)}}const PR="Schematic.Grid",no=u.CSS.B("drag-handle"),NR=e=>{const n=eo(e).closest(".react-flow__pane");n!=null&&f.triggerReflow(n)},Hn=e=>{const t=({symbolKey:s,items:o,onLocationChange:i})=>{const l=`${s}.${PR}`,[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=o.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 r.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})=>r.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,...o})=>{const{editable:i,items:l}=o;if(i)return r.jsxRuntimeExports.jsx(t,{symbolKey:s,...o});const a=l.filter(c=>c.location===e);return a.length===0?null:r.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})=>r.jsxRuntimeExports.jsx(j.Fragment,{children:c},d))})}},AR=Hn("top"),OR=Hn("left"),IR=Hn("right"),DR=Hn("bottom"),BR=Hn("center"),Vt=({editable:e,allowRotate:t=!0,children:n,allowCenter:s,onRotate:o,symbolKey:i,...l})=>{const a=j.useRef(e);return e!==a.current&&(NR(i),a.current=e),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(AR,{editable:e,symbolKey:i,...l},`top-${i}`),r.jsxRuntimeExports.jsx(OR,{editable:e,symbolKey:i,...l},`left-${i}`),r.jsxRuntimeExports.jsx(IR,{editable:e,symbolKey:i,...l},`right-${i}`),r.jsxRuntimeExports.jsx(DR,{editable:e,symbolKey:i,...l},`bottom-${i}`),s&&r.jsxRuntimeExports.jsx(BR,{editable:e,symbolKey:i,...l},`center-${i}`),e&&t&&r.jsxRuntimeExports.jsx(f.Button,{className:u.CSS.BE("grid","rotate"),size:"tiny",variant:"filled",onClick:o,children:r.jsxRuntimeExports.jsx(f.Rotate,{})}),r.jsxRuntimeExports.jsx("div",{className:no,children:n})]})},$R=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===M.Gb.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)"}}},$p=({source:e,sink:t,className:n,...s})=>{const o=f.useMemoDeepEqual({source:e,sink:t}),[,{status:i},l]=f.use$2({type:O.Chip.TYPE,schema:O.chipStateZ,initialState:{triggered:!1,...o,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:u.r.now(),details:{}}}});j.useEffect(()=>{l(m=>({...m,...o}))},[o,l]);const a=j.useCallback(()=>l(m=>({...m,triggered:!m.triggered})),[l]),{message:c,chipColor:d,buttonStyle:x,disabled:p}=$R(i);return r.jsxRuntimeExports.jsx(f.Button,{variant:"text",className:u.CSS(u.CSS.B("control-chip"),n),disabled:p,onClick:a,tooltip:r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:c}),style:x,...s,children:r.jsxRuntimeExports.jsx(f.Circle,{color:d})})},zp=j.createContext({needsControlOf:[]}),Vp=()=>j.use(zp),zR=({children:e,onStatusChange:t,...n})=>{const s=f.useMemoDeepEqual(n),[{path:o},{status:i,needsControlOf:l},a]=f.use$2({type:O.Controller.TYPE,schema:O.controllerStateZ,initialState:s});return j.useEffect(()=>{i!=null&&t?.(i)},[i,t]),j.useEffect(()=>{a(c=>({...c,...s}))},[s,a]),j.useEffect(()=>()=>t?.("released"),[]),r.jsxRuntimeExports.jsxs(zp,{value:{needsControlOf:l},children:[r.jsxRuntimeExports.jsx(f.Composite,{path:o,children:e}),";"]})},Fp=({colorSource:e,statusSource:t})=>{const n=f.useMemoDeepEqual({colorSource:e,statusSource:t}),[,{color:s,status:o},i]=f.use$2({type:O.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:u.r.now(),details:{color:void 0}}},schema:O.indicatorStateZ});j.useEffect(()=>{i(a=>({...a,...n}))},[n,i]);let l;return o.details?.color!=null?l=u.fr.colorZ.parse(o.details.color):s!=null&&!u.fr.isZero(s)?l=s:l="var(--pluto-gray-l10)",r.jsxRuntimeExports.jsxs(f.Dialog$1,{location:{x:"center",y:"bottom"},children:[r.jsxRuntimeExports.jsx(f.Text,{children:o.message}),r.jsxRuntimeExports.jsx("div",{className:u.CSS.B("indicator"),style:{backgroundColor:u.fr.cssString(l),flexGrow:1}})]})},VR=e=>{const{needsControlOf:t}=Vp(),[,{states:n},s]=f.use$2({type:O.Legend.TYPE,schema:O.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 M.Tt("Legend subject not found");return{key:a.subject.key,label:a.subject.name,color:a.subjectColor}});return r.jsxRuntimeExports.jsx(fr,{data:i,...e})},Hp=({children:e})=>{const[{path:t}]=f.use$2({type:O.StateProvider.TYPE,schema:O.stateProviderStateZ,initialState:{}});return r.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},FR=Object.freeze(Object.defineProperty({__proto__:null,Chip:$p,Controller:zR,Indicator:Fp,Legend:VR,StateProvider:Hp,useContext:Vp},Symbol.toStringTag,{value:"Module"})),HR=({aetherKey:e,source:t})=>{const n=f.useMemoDeepEqual({source:t}),[,{enabled:s},o]=f.use$2({aetherKey:e,type:O.Light.TYPE,schema:O.stateZ$1,initialState:{enabled:!1,...n}});return j.useEffect(()=>o(i=>({...i,...n})),[n,o]),{enabled:s}},ZR=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{value:o},i]=f.use$2({aetherKey:e,type:O.Setpoint.TYPE,schema:O.stateZ$2,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:o}},KR=({aetherKey:e,source:t,sink:n})=>{const s=f.useMemoDeepEqual({source:t,sink:n}),[,{triggered:o,enabled:i},l]=f.use$2({aetherKey:e,type:O.Toggle.TYPE,schema:O.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:o,enabled:i}},an=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:o="top",direction:i,align:l,maxInlineSize:a}=e;return n==null||n.length===0?null:{key:"label",element:r.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:o}},ai=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:o,indicator:i,orientation:l="bottom"}=e;return{key:"control",element:r.jsxRuntimeExports.jsxs(f.Box,{direction:u.p.swap(l),align:"center",className:u.CSS(u.CSS.B("control-state")),gap:"small",children:[t&&n&&r.jsxRuntimeExports.jsx($p,{size:"small",...o}),t&&s&&r.jsxRuntimeExports.jsx(Fp,{...i})]}),location:l}},be=(e,t)=>{const n=({symbolKey:s,control:o,source:i,sink:l,label:a,onChange:c,selected:d,orientation:x="left",position:p,...m})=>{const{enabled:h,triggered:g,toggle:E}=KR({aetherKey:s,source:i,sink:l}),S=[],R=an(a,c);R!=null&&S.push(R);const v=ai(o);return v!=null&&S.push(v),r.jsxRuntimeExports.jsx(Vt,{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:{...o,orientation:C}})},...t?.grid,children:r.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:o,onChange:i,selected:l,position:a,orientation:c="left",...d})=>{const x=[],p=an(o,i);return p!=null&&x.push(p),r.jsxRuntimeExports.jsx(Vt,{...t?.grid,items:x,editable:l,symbolKey:s,onRotate:()=>i({orientation:u.K$1.rotate90(c)}),onLocationChange:(m,h)=>{m==="label"&&i({label:{...o,orientation:h}})},children:r.jsxRuntimeExports.jsx(e,{orientation:c,...d})})};return n.displayName=e.displayName,n},Ft=e=>{const t=({symbolKey:n,label:s,onChange:o,selected:i,position:l,orientation:a="left",enabled:c=!1,clickable:d=!1,...x})=>{const p=[],m=an(s,o);m!=null&&p.push(m);const h=()=>{d&&o({enabled:!c})};return r.jsxRuntimeExports.jsx(Vt,{items:p,editable:i,symbolKey:n,onRotate:()=>o({orientation:u.K$1.rotate90(a)}),onLocationChange:(g,E)=>{g==="label"&&o({label:{...s,orientation:E}})},children:r.jsxRuntimeExports.jsx(e,{orientation:a,enabled:c,onClick:h,...x})})};return t.displayName=e.displayName,t},YR=be(tx),GR=be(Qd),UR=be(Jd),WR=be(ex),XR=be(qd),qR=be(lx),QR=be(mx),JR=be(Sp),e4=be(Rp),t4=be(Ix),n4=be(Dx),s4=be(Bx),o4=be(zx),r4=be(Zx),i4=be(Kx),l4=be(Yx),a4=be(Gx),c4=be(Ux),u4=be(Wx),d4=be(Ox),x4=be(Cp),p4=be(bp),m4=be(wp),f4=be(vp),h4=be(kp),g4=be(_p),j4=be(dx),E4=be(xx),y4=be(ax),S4=be(cx),R4=be(ux),C4=ce(wx),b4=ce(vx),w4=ce(Fx),v4=ce(Hx),k4=ce(fx),_4=ce(gx),M4=ce(jx),T4=ce(Sx),L4=ce(ox),P4=ce(rx),N4=ce(ix),A4=ce(kx),O4=be(Lx,{grid:{allowRotate:!1}}),I4=ce(qx),D4=ce(yx),B4=ce(Qx),$4=ce(Jx),z4=ce(ep),V4=ce(hx),F4=ce(nx),H4=ce(op),Z4=ce(rp,{grid:{allowRotate:!1}}),K4=ce($x),Y4=ce(ip),G4=ce(lp),U4=ce(ap),W4=ce(cp),X4=ce(up),q4=ce(dp),Q4=ce(xp),J4=ce(pp),eC=ce(mp),tC=ce(fp),nC=ce(hp),sC=ce(gp),oC=ce(jp),rC=ce(Ep),iC=ce(yp),lC=ce(Mp),aC=ce(Lp),cC=ce(Tp),uC=ce(Pp),dC=ce(Np),xC=ce(Ap),pC=ce(Op),mC=ce(Ip),fC=ce(Dp),hC=Ft(_x),gC=Ft(sx),jC=Ft(np),EC=Ft(sp),yC=Ft(Ex),SC=Ft(Mx),RC=Ft(px),CC=ce(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:i})=>r.jsxRuntimeExports.jsx(Js,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:i,backgroundColor:e}),{grid:{allowCenter:!0,allowRotate:!1}}),bC=e=>r.jsxRuntimeExports.jsx(Js,{...e,dimensions:{width:25,height:50}});ce(({sideLength:e,rotation:t,color:n,backgroundColor:s,numSides:o,...i})=>r.jsxRuntimeExports.jsx(li,{numSides:3,sideLength:e,rotation:t,color:n,backgroundColor:s,...i}));const wC=ce(({numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:o,backgroundColor:i,strokeWidth:l,...a})=>r.jsxRuntimeExports.jsx(li,{numSides:e,sideLength:t,cornerRounding:n,rotation:s,color:o,backgroundColor:i,strokeWidth:l,...a})),vC=ce(({radius:e,color:t,backgroundColor:n,strokeWidth:s,...o})=>r.jsxRuntimeExports.jsx(bx,{radius:e,color:t,backgroundColor:n,strokeWidth:s,...o}),{grid:{allowRotate:!1}}),kC=ce(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:o,dimensions:i,strokeWidth:l})=>r.jsxRuntimeExports.jsx(Js,{onResize:a=>n({dimensions:a}),orientation:s,color:o,dimensions:i,boxBorderRadius:t,backgroundColor:e,strokeWidth:l}),{grid:{allowCenter:!0,allowRotate:!1}}),_C=e=>r.jsxRuntimeExports.jsx(Js,{...e,dimensions:{width:25,height:50},borderRadius:0}),MC=({label:e,symbolKey:t,orientation:n="left",control:s,units:o,source:i,sink:l,color:a,onChange:c,selected:d,draggable:x,size:p,disabled:m})=>{const{value:h,set:g}=ZR({aetherKey:t,source:i,sink:l}),E=[],S=ai(s);S!=null&&E.push(S);const R=an(e,c);return R!=null&&E.push(R),r.jsxRuntimeExports.jsx(Vt,{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:r.jsxRuntimeExports.jsx(Ax,{value:h,onChange:g,units:o,color:a,orientation:n,disabled:m,size:p})})},TC=({className:e,...t})=>r.jsxRuntimeExports.jsx(Ax,{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:r.jsxRuntimeExports.jsx(f.Text,{children:"10.0"})}),LC=u.K.construct(10,-3),PC=u.K.construct(1,1),NC=({symbolKey:e,label:t,level:n="p",position:s,textColor:o,color:i,telem:l,units:a,onChange:c,inlineSize:d=70,selected:x,draggable:p,notation:m,stalenessColor:h,stalenessTimeout:g,redline:E})=>{const S=Ns.useTypography(n),R=(S.lineHeight+.5)*S.baseSize+2,v=j.useMemo(()=>{if(l==null||E==null)return;const{bounds:T,gradient:N}=E;return O.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:l,scale:O.scaleNumber({scale:u.C.Scale.scale(T).scale(0,1).transform}),gradient:O.colorGradient({gradient:N})},outlet:"gradient"})},[l,E]),{width:y}=Zr({aetherKey:e,color:o,level:n,box:u.Ho.construct(u.K.translateY({...s},1),{height:R,width:d}),telem:l,backgroundTelem:v,minWidth:d,stalenessColor:h,stalenessTimeout:g,notation:m,useWidthForBackground:!0,valueBackgroundOverScan:LC,valueBackgroundShift:PC}),C=[],k=an(t,c);return k!=null&&C.push(k),r.jsxRuntimeExports.jsx(Vt,{editable:x&&!p,symbolKey:e,items:C,allowRotate:!1,onLocationChange:(T,N)=>{T==="label"&&c({label:{...t,orientation:N}})},children:r.jsxRuntimeExports.jsx(Tx,{color:i,dimensions:{height:R,width:y},inlineSize:d,units:a,unitsLevel:M.downLevel(n)})})},AC=({color:e})=>r.jsxRuntimeExports.jsx(Tx,{color:e,dimensions:{width:60,height:25},units:"psi",children:r.jsxRuntimeExports.jsx(f.Text,{children:"50.00"})}),OC=({symbolKey:e,label:t,orientation:n="left",sink:s,control:o,selected:i,draggable:l,onChange:a,mode:c,...d})=>{const{onMouseDown:x,onMouseUp:p}=bj({aetherKey:e,sink:s,mode:c}),m=[],h=ai(o);return h!=null&&m.push(h),r.jsxRuntimeExports.jsx(Vt,{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:r.jsxRuntimeExports.jsx(Px,{...t,onMouseDown:x,onMouseUp:p,orientation:n,...d})})},IC=({label:e,...t})=>r.jsxRuntimeExports.jsx(Px,{label:"Button",...t}),DC=({symbolKey:e,label:t,source:n,onChange:s,selected:o,...i})=>{const{enabled:l}=HR({aetherKey:e,source:n}),a=[],c=an(t,s);return c!=null&&a.push(c),r.jsxRuntimeExports.jsx(Vt,{items:a,allowRotate:!1,editable:o,symbolKey:e,onLocationChange:(d,x)=>{d==="label"&&s({label:{...t,orientation:x}})},children:r.jsxRuntimeExports.jsx(Vx,{enabled:l,...i})})},BC=({label:{label:e,level:t},orientation:n,color:s,onChange:o})=>r.jsxRuntimeExports.jsx(Xx,{className:no,onLabelChange:i=>o({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),$C=({label:e,...t})=>r.jsxRuntimeExports.jsx(Xx,{label:"Off Page",...t,orientation:"right"}),zC=ce(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:o,borderRadius:i})=>r.jsxRuntimeExports.jsx(tp,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:o,borderRadius:i,backgroundColor:e})),VC=e=>r.jsxRuntimeExports.jsx(tp,{...e,dimensions:{width:25,height:50}}),FC=({onChange:e,symbolKey:t,color:n,width:s,align:o,autoFit:i,level:l,value:a})=>r.jsxRuntimeExports.jsx(Nx,{className:no,onChange:c=>e({value:c}),value:a,level:l,color:n,width:s,align:o,autoFit:i},t),HC=e=>r.jsxRuntimeExports.jsx(Nx,{...e,autoFit:!0,value:"Text Box"}),W=4,Zn=2,ZC=["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","customActuator","customStatic"],KC=ne.z.enum(ZC),ie={orientation:"left",scale:1},YC={source:O.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:O.streamChannelValue({channel:0}),rollingAverage:O.rollingAverage({windowSize:1}),stringifier:O.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},GC={...ie,source:O.sourcePipeline("number",{connections:[],segments:{valueStream:O.streamChannelValue({channel:0})},outlet:"valueStream"})},UC={...ie,sink:O.sinkPipeline("number",{connections:[],segments:{setter:O.setChannelValue({channel:0})},inlet:"setter"})},Zp={...ie,source:O.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:O.streamChannelValue({channel:0}),threshold:O.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},Kp={...ie,control:{show:!0},sink:O.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:O.setChannelValue({channel:0}),setpoint:O.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},Se={...Zp,...Kp},Ht={...ie,enabled:!1,clickable:!1},Y=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),WC={width:125,height:200},ci={dimensions:WC},XC=3,qC={name:"Three Way",key:"threeWayValve",Form:ye,Symbol:GR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three Way"),...Se}),Preview:Qd,zIndex:W},QC={name:"Generic",key:"valve",Form:ye,Symbol:UR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Valve"),...Se}),Preview:Jd,zIndex:W},JC={name:"Solenoid",key:"solenoidValve",Form:ye,Symbol:WR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Solenoid Valve"),normallyOpen:!1,...Se}),Preview:ex,zIndex:W},e6={name:"Four Way",key:"fourWayValve",Form:ye,Symbol:XR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Four Way Valve"),...Se}),Preview:qd,zIndex:W},t6={name:"Angled",key:"angledValve",Form:ye,Symbol:qR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Valve"),...Se}),Preview:lx,zIndex:W},n6={name:"Ball",key:"ballValve",Form:ye,Symbol:y4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ball Valve"),...Se}),Preview:ax,zIndex:W},s6={name:"Three-Way Ball",key:"threeWayBallValve",Form:ye,Symbol:S4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Three-Way Ball Valve"),...Se}),Preview:cx,zIndex:W},o6={name:"Gate",key:"gateValve",Form:ye,Symbol:R4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Gate Valve"),...Se}),Preview:ux,zIndex:W},r6={name:"Butterfly (Remote)",key:"butterflyValveOne",Form:ye,Symbol:j4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Remote)"),...Se}),Preview:dx,zIndex:W},i6={name:"Butterfly (Manual)",key:"butterflyValveTwo",Form:ye,Symbol:E4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Butterfly Valve (Manual)"),...Se}),Preview:xx,zIndex:W},l6={name:"Breather",key:"breatherValve",Form:$t,Symbol:RC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Breather Valve"),...Ht}),Preview:Qe(px,["clickable"]),zIndex:W},a6={name:"Pump",key:"pump",Form:ye,Symbol:QR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pump"),...Se}),Preview:mx,zIndex:W},c6={name:"Screw",key:"screwPump",Form:ye,Symbol:d4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Screw Pump"),...Se}),Preview:Ox,zIndex:W},u6={name:"Tank",key:"tank",Form:pu,Symbol:CC,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.fr.setAlpha(e.colors.gray.l1,0),...Y("Tank"),borderRadius:ii,...ci,...ie}),Preview:bC,zIndex:Zn},d6={name:"Polygon",key:"polygon",Symbol:wC,Form:Aj,defaultProps:e=>({numSides:6,sideLength:_R,cornerRounding:0,rotation:0,color:e.colors.gray.l11,backgroundColor:u.fr.setAlpha(e.colors.gray.l1,0),strokeWidth:2,...Y("Polygon")}),Preview:Qe(li,["clickable"]),zIndex:Zn},x6={name:"Circle",key:"circle",Symbol:vC,Form:Oj,defaultProps:e=>({radius:20,color:e.colors.gray.l11,backgroundColor:u.fr.setAlpha(e.colors.gray.l1,0),...Y("Circle"),strokeWidth:2}),Preview:Qe(bx,["clickable"]),zIndex:Zn},p6={name:"Cylinder",key:"cylinder",Form:Uj,Symbol:zC,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.fr.setAlpha(e.colors.gray.l1,0),...Y("cylinder"),dimensions:{width:66,height:181},...ie}),Preview:VC,zIndex:Zn},m6={name:"Box",key:"box",Form:Wj,Symbol:kC,defaultProps:e=>({color:e.colors.gray.l11,backgroundColor:u.fr.setAlpha(e.colors.gray.l1,0),...Y("Box"),borderRadius:XC,strokeWidth:2,...ci,...ie}),Preview:_C,zIndex:Zn},f6={name:"Relief",key:"reliefValve",Form:$t,Symbol:gC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Relief Valve"),...Ht}),Preview:Qe(sx,["clickable"]),zIndex:W},h6={name:"Spring Loaded Relief",key:"springLoadedReliefValve",Form:$t,Symbol:jC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Spring Loaded Relief Valve"),...Ht}),Preview:Qe(np,["clickable"]),zIndex:W},g6={name:"Angled Spring Loaded Relief",key:"angledSpringLoadedReliefValve",Form:$t,Symbol:EC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Spring Loaded Relief Valve"),...Ht}),Preview:Qe(sp,["clickable"]),zIndex:W},j6={name:"Regulator",key:"regulator",Form:xe,Symbol:C4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Regulator"),...ie}),Preview:wx,zIndex:W},E6={name:"Manual",key:"regulatorManual",Form:xe,Symbol:b4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Regulator"),...ie}),Preview:Qe(vx,["clickable"]),zIndex:W},y6={name:"Electric",key:"electricRegulator",Form:xe,Symbol:w4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator"),...ie}),Preview:Fx,zIndex:W},S6={name:"Motorized",key:"electricRegulatorMotorized",Form:xe,Symbol:v4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electric Regulator Motorized"),...ie}),Preview:Hx,zIndex:W},R6={name:"Standard",key:"burstDisc",Form:xe,Symbol:k4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Burst Disc"),...ie}),Preview:fx,zIndex:W},C6={name:"ISO",key:"isoBurstDisc",Form:xe,Symbol:V4,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Burst Disc"),...ie}),Preview:hx,zIndex:W},b6={name:"Cap",key:"cap",Form:xe,Symbol:_4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cap"),...ie}),Preview:gx,zIndex:W},w6={name:"ISO Cap",key:"isoCap",Form:xe,Symbol:M4,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Cap"),...ie}),Preview:jx,zIndex:W},v6={name:"Manual",key:"manualValve",Form:$t,Symbol:yC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Manual Valve"),...Ht}),Preview:Qe(Ex,["clickable"]),zIndex:W},k6={name:"Plate",key:"orificePlate",Form:xe,Symbol:D4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Plate"),...ie}),Preview:yx,zIndex:W},_6={name:"ISO Filter",key:"isoFilter",Form:xe,Symbol:B4,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Filter"),...ie}),Preview:Qx,zIndex:W},M6={name:"Filter",key:"filter",Form:xe,Symbol:T4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Filter"),...ie}),Preview:Sx,zIndex:W},T6={name:"Flow Straightener",key:"flowStraightener",Form:xe,Symbol:$4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flow Straightener"),...ie}),Preview:Jx,zIndex:W},L6={name:"Heater",key:"heaterElement",Form:xe,Symbol:z4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Heater Element"),...ie}),Preview:ep,zIndex:W},P6={name:"Needle",key:"needleValve",Form:$t,Symbol:hC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Needle Valve"),...Ht}),Preview:Qe(_x,["clickable"]),zIndex:W},N6={name:"Check",key:"checkValve",Form:xe,Symbol:L4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...ie}),Preview:ox,zIndex:W},A6={name:"Orifice",key:"orifice",Form:xe,Symbol:A4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice"),...ie}),Preview:kx,zIndex:W},O6={name:"Angled Relief",key:"angledReliefValve",Form:$t,Symbol:SC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Angled Relief Valve"),...Ht}),Preview:Qe(Mx,["clickable"]),zIndex:W},I6={name:"Value",key:"value",Form:Bj,Symbol:NC,Preview:AC,defaultProps:e=>({color:e.colors.gray.l11,units:"psi",level:"h5",inlineSize:70,...Y("Value"),...ie,stalenessTimeout:5,stalenessColor:e.colors.warning.m1,telem:YC.source,redline:vn}),zIndex:W},D6={name:"Button",key:"button",Symbol:OC,Form:Hj,Preview:IC,defaultProps:e=>({color:e.colors.primary.z,...Y("Button"),...Kp,mode:"fire",onClickDelay:0,scale:null}),zIndex:W},B6={name:"Switch",key:"switch",Symbol:O4,Form:Xj,defaultProps:()=>({...Y("Switch"),...Se,scale:null}),Preview:Lx,zIndex:W},$6={name:"Vacuum",key:"vacuumPump",Symbol:t4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vacuum Pump"),...Se}),Preview:Ix,zIndex:W},z6={name:"Compressor",key:"compressor",Symbol:x4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Compressor"),...Se}),Preview:Cp,zIndex:W},V6={name:"Cavity",key:"cavityPump",Symbol:n4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cavity Pump"),...Se}),Preview:Dx,zIndex:W},F6={name:"Piston",key:"pistonPump",Symbol:s4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Piston Pump"),...Se}),Preview:Bx,zIndex:W},H6={name:"Static Mixer",key:"staticMixer",Symbol:K4,Form:xe,defaultProps:e=>({color:e.colors.gray.l11,...Y("Static Mixer"),...ie}),Preview:$x,zIndex:W},Z6={name:"Rotary Mixer",key:"rotaryMixer",Symbol:o4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Rotary Mixer"),...Se}),Preview:zx,zIndex:W},K6={name:"Light",key:"light",Symbol:DC,Form:Vj,defaultProps:e=>({color:e.colors.gray.l11,...Y("Light"),...Zp}),Preview:Vx,zIndex:W},Y6={name:"Setpoint",key:"setpoint",Symbol:MC,Form:Kj,defaultProps:e=>({units:"mV",color:e.colors.gray.l11,size:"small",...Y("Setpoint"),...GC,...UC}),Preview:TC,zIndex:W},G6={name:"Agitator",key:"agitator",Symbol:r4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Agitator"),...Se}),Preview:Zx,zIndex:W},U6={name:"Propeller Agitator",key:"propellerAgitator",Symbol:i4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Propeller Agitator"),...Se}),Preview:Kx,zIndex:W},W6={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:l4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flat Blade Agitator"),...Se}),Preview:Yx,zIndex:W},X6={name:"Paddle Agitator",key:"paddleAgitator",Symbol:a4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Paddle Agitator"),...Se}),Preview:Gx,zIndex:W},q6={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:c4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Cross Beam Agitator"),...Se}),Preview:Ux,zIndex:W},Q6={name:"Helical Agitator",key:"helicalAgitator",Symbol:u4,Form:ye,defaultProps:e=>({color:e.colors.gray.l11,...Y("Helical Agitator"),...Se}),Preview:Wx,zIndex:W},J6={name:"Text Box",key:"textBox",Symbol:FC,Form:Yj,defaultProps:e=>({color:e.colors.gray.l11,autoFit:!0,align:"center",...Y("Text Box"),...ie,...ci,level:"p",value:"Text Box",width:75}),Preview:HC,zIndex:W},eb={name:"Off Page",key:"offPageReference",Form:Gj,Symbol:BC,defaultProps:e=>({color:e.colors.gray.l11,orientation:"right",...Y("Off Page Reference")}),Preview:$C,zIndex:W},tb={name:"ISO Check",key:"isoCheckValve",Form:xe,Symbol:P4,defaultProps:e=>({color:e.colors.gray.l11,...Y("ISO Check Valve"),...ie}),Preview:rx,zIndex:W},nb={name:"Check (Arrow)",key:"checkValveWithArrow",Form:xe,Symbol:N4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Check Valve"),...ie}),Preview:ix,zIndex:W},sb={name:"Vent",key:"vent",Form:xe,Symbol:I4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Vent"),...ie}),Preview:qx,zIndex:W},ob={name:"T Junction",key:"tJunction",Form:xe,Symbol:H4,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...ie}),Preview:op,zIndex:W+20},rb={name:"Cross Junction",key:"crossJunction",Form:xe,Symbol:Z4,defaultProps:e=>({color:e.colors.gray.l11,...Y(""),...ie}),Preview:rp,zIndex:W+20},ib={name:"General",key:"flowmeterGeneral",Form:xe,Symbol:Y4,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Flowmeter"),...ie}),Preview:ip,zIndex:W},lb={name:"Electromagnetic",key:"flowmeterElectromagnetic",Form:xe,Symbol:G4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Electromagnetic Flowmeter"),...ie}),Preview:lp,zIndex:W},ab={name:"Variable Area",key:"flowmeterVariableArea",Form:xe,Symbol:U4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Variable Area Flowmeter"),...ie}),Preview:ap,zIndex:W},cb={name:"Coriolis",key:"flowmeterCoriolis",Form:xe,Symbol:W4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Coriolis Flowmeter"),...ie}),Preview:cp,zIndex:W},ub={name:"Nozzle",key:"flowmeterNozzle",Form:xe,Symbol:X4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle Flowmeter"),...ie}),Preview:up,zIndex:W},db={name:"Venturi",key:"flowmeterVenturi",Form:xe,Symbol:q4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Venturi Flowmeter"),...ie}),Preview:dp,zIndex:W},xb={name:"Ring Piston",key:"flowmeterRingPiston",Form:xe,Symbol:Q4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ring Piston Flowmeter"),...ie}),Preview:xp,zIndex:W},pb={name:"Positive Displacement",key:"flowmeterPositiveDisplacement",Form:xe,Symbol:J4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Positive Displacement Flowmeter"),...ie}),Preview:pp,zIndex:W},mb={name:"Turbine",key:"flowmeterTurbine",Form:xe,Symbol:eC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbine Flowmeter"),...ie}),Preview:mp,zIndex:W},fb={name:"Pulse",key:"flowmeterPulse",Form:xe,Symbol:tC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Pulse Flowmeter"),...ie}),Preview:fp,zIndex:W},hb={name:"Float Sensor",key:"flowmeterFloatSensor",Form:xe,Symbol:nC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Float Sensor Flowmeter"),...ie}),Preview:hp,zIndex:W},gb={name:"Orifice",key:"flowmeterOrifice",Form:xe,Symbol:sC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Orifice Flowmeter"),...ie}),Preview:gp,zIndex:W},jb={name:"Heat Exchanger",key:"heatExchangerGeneral",Form:xe,Symbol:oC,defaultProps:e=>({color:e.colors.gray.l11,...Y("General Heat Exchanger"),...ie}),Preview:jp,zIndex:W},Eb={name:"M-Type Heat Exchanger",key:"heatExchangerM",Form:xe,Symbol:rC,defaultProps:e=>({color:e.colors.gray.l11,...Y("M Heat Exchanger"),...ie}),Preview:Ep,zIndex:W},yb={name:"Straight Tube Heat Exchanger",key:"heatExchangerStraightTube",Form:xe,Symbol:iC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Straight Tube Heat Exchanger"),...ie}),Preview:yp,zIndex:W},Sb={name:"Turbo Compressor",key:"turboCompressor",Form:ye,Symbol:p4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Turbo Compressor"),...Se}),Preview:bp,zIndex:W},Rb={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:ye,Symbol:m4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Roller Vane Compressor"),...Se}),Preview:wp,zIndex:W},Cb={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:ye,Symbol:f4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Liquid Ring Compressor"),...Se}),Preview:vp,zIndex:W},bb={name:"Ejector Compressor",key:"ejectorCompressor",Form:ye,Symbol:h4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejector Compressor"),...Se}),Preview:kp,zIndex:W},wb={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:ye,Symbol:g4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Centrifugal Compressor"),...Se}),Preview:_p,zIndex:W},vb={name:"Diaphragm Pump",key:"diaphragmPump",Form:ye,Symbol:JR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Diaphragm Pump"),...Se}),Preview:Sp,zIndex:W},kb={name:"Ejection",key:"ejectionPump",Form:ye,Symbol:e4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Ejection Pump"),...Se}),Preview:Rp,zIndex:W},_b={name:"Standard",key:"flameArrestor",Form:xe,Symbol:lC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor"),...ie}),Preview:Mp,zIndex:W},Mb={name:"Explosion-Proof",key:"flameArrestorExplosion",Form:xe,Symbol:aC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Explosion-Proof)"),...ie}),Preview:Lp,zIndex:W},Tb={name:"Detonation-Proof",key:"flameArrestorDetonation",Form:xe,Symbol:cC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Detonation-Proof)"),...ie}),Preview:Tp,zIndex:W},Lb={name:"Fire Resistant",key:"flameArrestorFireRes",Form:xe,Symbol:uC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant)"),...ie}),Preview:Pp,zIndex:W},Pb={name:"Fire Resistant & Detonation-Proof",key:"flameArrestorFireResDetonation",Form:xe,Symbol:dC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...ie}),Preview:Np,zIndex:W},Nb={name:"Thruster",key:"thruster",Form:ye,Symbol:xC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Thruster"),...Se}),Preview:Ap,zIndex:W},Ab={name:"Nozzle",key:"nozzle",Form:xe,Symbol:pC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Nozzle"),...ie}),Preview:Op,zIndex:W},Ob={name:"Strainer",key:"strainer",Form:xe,Symbol:mC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer"),...ie}),Preview:Ip,zIndex:W},Ib={name:"Cone",key:"strainerCone",Form:xe,Symbol:fC,defaultProps:e=>({color:e.colors.gray.l11,...Y("Strainer Cone"),...ie}),Preview:Dp,zIndex:W},Db={name:"Custom Actuator",key:"customActuator",Form:ye,Symbol:YR,defaultProps:e=>({color:e.colors.gray.l11,...Y("Custom Actuator"),...Se,specKey:"",stateOverrides:[]}),Preview:tx,zIndex:W},Bb={name:"Custom Static",key:"customStatic",Form:xe,Symbol:F4,defaultProps:e=>({color:e.colors.gray.l11,...Y("Custom Static"),...ie,specKey:"",stateOverrides:[]}),Preview:nx,zIndex:W},$b={value:I6,button:D6,tank:u6,polygon:d6,circle:x6,tJunction:ob,crossJunction:rb,switch:B6,offPageReference:eb,light:K6,setpoint:Y6,box:m6,textBox:J6,valve:QC,solenoidValve:JC,threeWayValve:qC,fourWayValve:e6,angledValve:t6,ballValve:n6,threeWayBallValve:s6,gateValve:o6,butterflyValveOne:r6,butterflyValveTwo:i6,breatherValve:l6,manualValve:v6,needleValve:P6,reliefValve:f6,angledReliefValve:O6,checkValve:N6,regulator:j6,regulatorManual:E6,electricRegulator:y6,electricRegulatorMotorized:S6,springLoadedReliefValve:h6,angledSpringLoadedReliefValve:g6,pump:a6,pistonPump:F6,screwPump:c6,cavityPump:V6,diaphragmPump:vb,ejectionPump:kb,vacuumPump:$6,compressor:z6,turboCompressor:Sb,rollerVaneCompressor:Rb,liquidRingCompressor:Cb,ejectorCompressor:bb,centrifugalCompressor:wb,staticMixer:H6,rotaryMixer:Z6,burstDisc:R6,isoBurstDisc:C6,cap:b6,isoCap:w6,filter:M6,isoFilter:_6,flowStraightener:T6,heaterElement:L6,orifice:A6,orificePlate:k6,agitator:G6,propellerAgitator:U6,flatBladeAgitator:W6,paddleAgitator:X6,crossBeamAgitator:q6,helicalAgitator:Q6,isoCheckValve:tb,checkValveWithArrow:nb,vent:sb,cylinder:p6,flowmeterGeneral:ib,flowmeterElectromagnetic:lb,flowmeterVariableArea:ab,flowmeterCoriolis:cb,flowmeterNozzle:ub,flowmeterVenturi:db,flowmeterRingPiston:xb,flowmeterPositiveDisplacement:pb,flowmeterTurbine:mb,flowmeterPulse:fb,flowmeterFloatSensor:hb,flowmeterOrifice:gb,heatExchangerGeneral:jb,heatExchangerM:Eb,heatExchangerStraightTube:yb,flameArrestor:_b,flameArrestorExplosion:Mb,flameArrestorDetonation:Tb,flameArrestorFireRes:Lb,flameArrestorFireResDetonation:Pb,thruster:Nb,nozzle:Ab,strainer:Ob,strainerCone:Ib,customActuator:Db,customStatic:Bb},zb=[{key:"general",Icon:f.Channel,name:"General",symbols:["value","setpoint","textBox","offPageReference","button","switch","light","polygon","circle","box"]},{key:"vessels",name:"Vessels",Icon:f.Tank,symbols:["tank","cylinder","tJunction","crossJunction"]},{key:"valves",name:"Valves",Icon:f.Valve,symbols:["valve","solenoidValve","threeWayValve","fourWayValve","angledValve","ballValve","threeWayBallValve","gateValve","butterflyValveOne","butterflyValveTwo","breatherValve","manualValve","needleValve","reliefValve","angledReliefValve","springLoadedReliefValve","angledSpringLoadedReliefValve","checkValve","isoCheckValve","checkValveWithArrow","regulator","regulatorManual","electricRegulator","electricRegulatorMotorized"]},{key:"pumps",name:"Pumps",Icon:f.Pump,symbols:["pump","screwPump","pistonPump","cavityPump","diaphragmPump","ejectionPump","vacuumPump","compressor","turboCompressor","rollerVaneCompressor","liquidRingCompressor","ejectorCompressor","centrifugalCompressor"]},{key:"meters",name:"Flow Meters",Icon:f.Rule,symbols:["flowmeterGeneral","flowmeterElectromagnetic","flowmeterVariableArea","flowmeterCoriolis","flowmeterNozzle","flowmeterVenturi","flowmeterRingPiston","flowmeterPositiveDisplacement","flowmeterTurbine","flowmeterPulse","flowmeterFloatSensor","flowmeterOrifice"]},{key:"process",name:"Process",Icon:f.Process,symbols:["heatExchangerGeneral","heatExchangerM","heatExchangerStraightTube","staticMixer","rotaryMixer","agitator","propellerAgitator","flatBladeAgitator","paddleAgitator","crossBeamAgitator","helicalAgitator"]},{key:"safety",name:"Safety",Icon:f.Safety,symbols:["burstDisc","isoBurstDisc","flameArrestor","flameArrestorDetonation","flameArrestorExplosion","flameArrestorFireRes","flameArrestorFireResDetonation"]},{key:"fittings",name:"Fittings",Icon:f.Fitting,symbols:["cap","isoCap","orifice","orificePlate","vent","nozzle","heaterElement","thruster","filter","isoFilter","strainer","strainerCone","flowStraightener"]}],Vb=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_KEY:iu,GROUPS:zb,REGISTRY:$b,STORE_CONFIG:lu,StateOverrideControls:cu,extractRegions:Sj,formSchema:au,retrieve:zs,retrieveGroup:dj,useCustom:Vr,useDelete:uj,useForm:aj,useList:lj,useRename:cj,variantZ:KC},Symbol.toStringTag,{value:"Module"})),Fb=Object.freeze(Object.defineProperty({__proto__:null,DRAG_HANDLE_CLASS:no,Symbol:Vb},Symbol.toStringTag,{value:"Module"})),Yp=({children:e})=>{const{path:t}=f.useUnidirectional({type:O.BaseProvider.TYPE,schema:O.providerStateZ$2,state:{}});return r.jsxRuntimeExports.jsx(f.Composite,{path:t,children:e})},Hb=new Set([u.n.UUID,u.n.JSON]),Zb=e=>{if(e.equals(u.n.JSON))return r.jsxRuntimeExports.jsx(f.JSON,{});if(e.isInteger)return r.jsxRuntimeExports.jsx(f.Binary,{});if(e.isFloat)return r.jsxRuntimeExports.jsx(f.Decimal,{});if(e.equals(u.n.STRING)||e.equals(u.n.UUID))return r.jsxRuntimeExports.jsx(f.String,{});if(e.equals(u.n.TIMESTAMP))return r.jsxRuntimeExports.jsx(f.Time$1,{})},Gp=u.n.ALL.filter(e=>e!==u.n.UNKNOWN).map(e=>({key:e.toString(),name:Hb.has(e)?e.toString().toUpperCase():u.U.capitalize(e.toString()),icon:Zb(e)})),Kb=Gp.filter(e=>!new u.n(e.key).isVariable),Yb=({hideVariableDensity:e=!1,...t})=>{const n=e?Kb:Gp;return r.jsxRuntimeExports.jsx(An,{...t,data:n,resourceName:"Data Type"})},Gb=Object.freeze(Object.defineProperty({__proto__:null,Provider:Yp,SelectDataType:Yb},Symbol.toStringTag,{value:"Module"})),Up=e=>{const t=({disabled:n=!1,...s})=>n?s.children:r.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},Wp="workspaces",Ub={channel:M.mT.SET_CHANNEL_NAME,schema:M.mT.workspaceZ,onChange:({store:e,changed:t})=>e.workspaces.set(t.key,t)},Wb={channel:M.mT.DELETE_CHANNEL_NAME,schema:M.mT.keyZ,onChange:({store:e,changed:t})=>e.workspaces.delete(t)},Xp={listeners:[Ub,Wb]},Xb=Ye({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)]}),qb=Ve({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)]}),Qb=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:Xp,FLUX_STORE_KEY:Wp,retrieve:Xb,useList:qb},Symbol.toStringTag,{value:"Module"})),Jb=Up(Yp),e9=Up(f.Provider$4),qp={[O.FLUX_STORE_KEY]:O.FLUX_STORE_CONFIG,[Mc]:Tc,[Sc]:Rc,[hc]:gc,[kc]:_c,[Wp]:Xp,[Vc]:Hc,[Fc]:Zc,[Gc]:eu,[sc]:oc,[Uc]:nu,[iu]:lu,[mc]:fc},t9=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:o,tooltip:i,triggers:l,alamos:a,haul:c,telem:d,color:x})=>r.jsxRuntimeExports.jsx(f.Provider$1,{...l,children:r.jsxRuntimeExports.jsx(f.Config,{...i,children:r.jsxRuntimeExports.jsx(f.Provider$2,{...c,children:r.jsxRuntimeExports.jsx(f.Provider$3,{url:s??P0,enabled:n,children:r.jsxRuntimeExports.jsx(e9,{workerKey:"vis",children:r.jsxRuntimeExports.jsx(L0,{...a,children:r.jsxRuntimeExports.jsx(f.Aggregator,{children:r.jsxRuntimeExports.jsx(Xa,{connParams:t,children:r.jsxRuntimeExports.jsx(Qa,{storeConfig:qp,children:r.jsxRuntimeExports.jsx(_e.Provider,{...x,children:r.jsxRuntimeExports.jsx(f.Provider,{...o,children:r.jsxRuntimeExports.jsx(Jb,{...d,children:r.jsxRuntimeExports.jsx(Hp,{children:e})})})})})})})})})})})})}),n9=Object.freeze(Object.defineProperty({__proto__:null,FLUX_STORE_CONFIG:qp,Provider:t9},Symbol.toStringTag,{value:"Module"})),s9=({value:e})=>r.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress"),children:r.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress-bar"),style:{width:`${e}%`}})}),o9=Object.freeze(Object.defineProperty({__proto__:null,Progress:s9},Symbol.toStringTag,{value:"Module"})),r9=({steps:e,value:t,onChange:n,...s})=>{const o=e.findIndex(i=>i.key===t);return r.jsxRuntimeExports.jsx(f.Box,{x:!0,align:"center",className:u.CSS.B("steps"),...s,children:e.map((i,l)=>r.jsxRuntimeExports.jsxs(j.Fragment,{children:[r.jsxRuntimeExports.jsxs(f.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>o,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&r.jsxRuntimeExports.jsx(f.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l10)"}})]},i.key))})},i9=Object.freeze(Object.defineProperty({__proto__:null,Steps:r9},Symbol.toStringTag,{value:"Module"})),l9=({children:e,className:t,visible:n,...s})=>{const[{path:o},,i]=f.use$2({type:O.Table.TYPE,schema:O.Table.stateZ,initialState:{region:u.Ho.ZERO,visible:n}});j.useEffect(()=>{i(a=>({...a,visible:n}))},[n]);const l=On(a=>i(c=>({...c,region:a})));return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{ref:l,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),r.jsxRuntimeExports.jsx("table",{className:u.CSS(u.CSS.B("table"),t),...s,children:r.jsxRuntimeExports.jsx("tbody",{children:r.jsxRuntimeExports.jsx(f.Composite,{path:o,children:e})})})]})},a9=({children:e,className:t,size:n,index:s,onResize:o,onSelect:i,position:l,...a})=>r.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),t),...a,children:[o!=null&&r.jsxRuntimeExports.jsx(Jp,{onSelect:i,index:s,value:n,onChange:o,position:l,direction:"y"}),e]}),ui=({ref:e,children:t,className:n,selected:s=!1,...o})=>r.jsxRuntimeExports.jsx("td",{ref:e,...o,className:u.CSS(u.CSS.BE("table","cell"),u.CSS.selected(s),n),children:t}),Qp="ABCDEFGHIJKLMNOPQRSTUVWXYZ",c9=e=>Qp[e],Jp=({value:e,selected:t=!1,index:n,onChange:s,position:o,direction:i="x",onSelect:l})=>{const a=f.useSyncedRef(e),c=j.useRef(e),d=_e.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 r.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.p.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[r.jsxRuntimeExports.jsx(f.Text,{full:"x",justify:"center",align:"center",square:!1,children:i==="x"?Qp[n]:n+1}),r.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[u.p.location(i)]:o+e},onDragStart:d,draggable:!0})]})},u9=({selected:e,onSelect:t,columns:n,onResize:s})=>{let o=15;return r.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),u.CSS.BE("table","col-resizer")),children:[r.jsxRuntimeExports.jsx("td",{}),n.map((i,l)=>{const a=o;return o+=i,r.jsxRuntimeExports.jsx(Jp,{onSelect:t,position:a,selected:e.includes(l),index:l,value:i,onChange:c=>s(c,l),direction:"x"},l)})]})},d9=Object.freeze(Object.defineProperty({__proto__:null,Cell:ui,ColumnIndicators:u9,Row:a9,Table:l9,getCellColumn:c9},Symbol.toStringTag,{value:"Module"})),x9="text",em=ne.z.object({value:ne.z.string(),level:M.levelZ,weight:M.weightZ,align:u.K$1.x.or(u.K$1.center),backgroundColor:u.fr.crudeZ}),tm=({cellKey:e,onChange:t,value:n,selected:s,onSelect:o,align:i,level:l,weight:a,backgroundColor:c})=>{const d=p=>o(e,p),x=p=>t({level:l,value:p,weight:a,align:i,backgroundColor:c});return r.jsxRuntimeExports.jsx(ui,{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.fr.cssString(c)},children:r.jsxRuntimeExports.jsx(f.Editable,{level:l,value:n,weight:a,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},p9="value",nm=ne.z.object({telem:O.stringSourceSpecZ,redline:du,level:M.levelZ,color:ne.z.string(),units:ne.z.string(),stalenessTimeout:ne.z.number().optional().default(5),stalenessColor:u.fr.colorZ.optional().default(u.fr.ZERO)}),sm=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:o,bounds:i},selected:l,box:a,onSelect:c,stalenessTimeout:d,stalenessColor:x})=>{const{width:p}=Zr({aetherKey:e,box:a,telem:t,level:n,color:s,stalenessTimeout:d,stalenessColor:x,backgroundTelem:O.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:O.scaleNumber({scale:u.C.Scale.scale(i).scale(0,1).transform}),gradient:O.colorGradient({gradient:o})},outlet:"gradient"}),location:{x:"center",y:"center"}}),m=h=>c(e,h);return r.jsxRuntimeExports.jsx(ui,{id:e,selected:l,onClick:m,onContextMenu:m,style:{height:"5rem",width:p},className:u.CSS(f.CONTEXT_TARGET,l&&f.CONTEXT_SELECTED,u.CSS.BEM("table","cell","value"))})},m9={padding:"2rem"},Mo=e=>r.jsxRuntimeExports.jsx(f.Box,{...e,style:m9,y:!0}),f9=[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],om=({onVariantChange:e})=>{const t=j.useCallback(({tabKey:s})=>{switch(s){case"telem":return r.jsxRuntimeExports.jsx(Mo,{children:r.jsxRuntimeExports.jsx(Hr,{path:""})});case"redline":return r.jsxRuntimeExports.jsx(Mo,{children:r.jsxRuntimeExports.jsx(Fr,{path:"redline"})});default:return r.jsxRuntimeExports.jsx(Mo,{children:r.jsxRuntimeExports.jsxs(f.Box,{x:!0,children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Variant",padHelpText:!1,children:r.jsxRuntimeExports.jsx(di,{onChange:e,value:"value"})}),r.jsxRuntimeExports.jsx(ge,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:o,onChange:i,variant:l,...a})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:o??u.fr.setAlpha(u.fr.ZERO,1),onChange:i,...a,bordered:!0})}),r.jsxRuntimeExports.jsx(ge,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:o,onChange:i,variant:l,...a})=>r.jsxRuntimeExports.jsx(ln,{value:o,onChange:i,...a})})]})})}},[]),n=Le.useStatic({tabs:f9,content:t});return r.jsxRuntimeExports.jsx(Le.Tabs,{...n})},h9={padding:"2rem"},rm=({onVariantChange:e})=>r.jsxRuntimeExports.jsxs(f.Box,{x:!0,grow:!0,style:h9,children:[r.jsxRuntimeExports.jsx(Ae.Item,{label:"Variant",padHelpText:!1,children:r.jsxRuntimeExports.jsx(di,{onChange:e,value:"text"})}),r.jsxRuntimeExports.jsx(wr,{path:"value",label:"Text"}),r.jsxRuntimeExports.jsx(ge,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:({value:t,onChange:n,variant:s,...o})=>r.jsxRuntimeExports.jsx(ln,{value:t,onChange:n,...o})}),r.jsxRuntimeExports.jsx(ge,{path:"weight",label:"Weight",padHelpText:!1,children:({value:t,onChange:n,variant:s,...o})=>r.jsxRuntimeExports.jsx(Ea,{value:t,onChange:n,...o})}),r.jsxRuntimeExports.jsx(ge,{path:"align",label:"Alignment",hideIfNull:!0,children:({value:t,onChange:n,variant:s,...o})=>r.jsxRuntimeExports.jsx(pe.SelectAlignment,{value:t,onChange:n,...o})}),r.jsxRuntimeExports.jsx(ge,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>r.jsxRuntimeExports.jsx(_e.Swatch,{value:t,onChange:n})})]}),g9=[{key:"text",name:"Text",icon:r.jsxRuntimeExports.jsx(f.Text$3,{})},{key:"value",name:"Value",icon:r.jsxRuntimeExports.jsx(f.Channel,{})}],di=e=>r.jsxRuntimeExports.jsx(An,{...e,data:g9,resourceName:"Variant"}),j9=["text","value"],E9=ne.z.enum(j9),y9={key:"value",name:"Value",Form:om,Cell:sm,defaultProps:e=>({telem:O.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:O.streamChannelValue({channel:0}),rollingAverage:O.rollingAverage({windowSize:1}),stringifier:O.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"}),redline:vn,color:u.fr.hex(e.colors.gray.l10),level:"h5",units:"",stalenessTimeout:5,stalenessColor:e.colors.warning.m1}),schema:nm},S9={key:"text",name:"Text",Form:rm,Cell:tm,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:em},R9={text:S9,value:y9},C9=Object.freeze(Object.defineProperty({__proto__:null,CELLS:R9,SelectVariant:di,TEXT_TYPE:x9,Text:tm,TextForm:rm,VALUE_TYPE:p9,Value:sm,ValueForm:om,textPropsZ:em,valuePropsZ:nm,variantZ:E9},Symbol.toStringTag,{value:"Module"})),Zl=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const o=bt(e,...n);return u.K.distance(o,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",o),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Kl=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:o,targetBox:i})=>{if(!b9({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=u.p.construct(t),a=u.p.swap(l);let c=vt(a,s[a]-e[a]);const d=u.Ho.loc(n,c);if(u.K$1.swap(t)===o){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]+Ot(c,De)}},tr=ne.z.object({direction:u.p.direction,length:ne.z.number()}),bt=(e,...t)=>{let n=e;for(const s of t)n=u.K.translate(n,s.direction,s.length);return n},im=(e,t,n,s)=>{try{let o=e;const i=[e,...t.map(h=>(o=u.K.translate(o,h.direction,h.length),o))];if(!s)return i;const l=t[0],a=vt(l.direction,l.length),c=Yl(a),d=4*(2-n**.5);i[0]=u.K.translate(i[0],{[l.direction]:-1*c*d,[u.p.swap(l.direction)]:0});const x=t[t.length-1],p=vt(x.direction,x.length),m=Yl(p);return i[i.length-1]=u.K.translate(i[i.length-1],{[x.direction]:m*d,[u.p.swap(x.direction)]:0}),i}catch{return[]}},De=10,Yl=e=>e==="top"||e==="left"?-1:1,Ot=(e,t)=>e==="top"||e==="left"?-t:t,vt=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ht=e=>vt(e.direction,e.length),b9=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=u.p.construct(n),o=t[s]-e[s];return Ot(n,o)<0},rs=e=>({direction:u.p.construct(e),length:Ot(e,De)}),Gl={top:rs("top"),bottom:rs("bottom"),left:rs("left"),right:rs("right")},w9=4,v9=.25,so=e=>nr(k9(nr(e))),k9=e=>{const t=[...e],n=e.findIndex((s,o)=>{const i=Math.abs(s.length);if(i<w9){if(o===0||o===e.length-1)return!1;if(i<v9)return!0;if(e.length<=3)return!1;if(o+2<e.length){const l=t[o+2];if(l.direction!==s.direction)return!1;t[o+2]={...l,length:l.length+s.length}}else{const l=t[o-2];if(l.direction!==s.direction)return!1;t[o-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},nr=e=>{const t=[...e];return e.findIndex((s,o)=>{const i=t[o-1];if(o===0||s.direction!==i.direction)return!1;if(o===1){const l=o-1,a=o,c=ht(i),d=ht(s);if(c===d)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(i.length)===De)return!1;const x=Ot(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(o===e.length-1){const l=o,a=o-1,c=ht(s),d=ht(i);if(c===d)return t[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0;if(Math.abs(s.length)===De)return!1;const x=Ot(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[o-1]={direction:t[o-1].direction,length:t[o-1].length+t[o].length},t.splice(o,1),!0})!==-1?nr(t):t},Yt=e=>so(_9(e)),_9=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:o,sourceOrientation:i})=>{let l=i,a=o,c={...Gl[i]},d=bt(n,c);const x={...Gl[o]};let p=bt(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=bt(n,c),p=bt(s,x));const g=[c],E=Kl({sourceStumpTip:d,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:o,targetBox:t});E!=null&&(g.push(E),d=bt(d,E),l=ht(E),c=E);const S=Kl({sourceStumpTip:p,sourceOrientation:a,sourceBox:t,targetStumpTip:d,targetOrientation:l,targetBox:e});S!=null&&(p=bt(p,S),a=vt(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)===o){const N=u.p.construct(l),I=(p[N]-d[N])/2;g.push({direction:N,length:I});const B=u.p.swap(N);return g.push({direction:B,length:p[B]-d[B]}),g.push({direction:N,length:I}),R(),g}const v=p[c.direction]-d[c.direction];let y=u.p.swap(c.direction);const C=d[y]-p[y];let k;vt(c.direction,v)===l&&vt(y,C)===a?k={direction:c.direction,length:v}:(k={direction:y,length:p[y]-d[y]},y=u.p.swap(y)),g.push(k);const T={direction:y,length:p[y]-d[y]};return g.push(T),R(),g},M9=e=>so(T9(e)),T9=({segments:e,index:t,magnitude:n})=>{const s=[...e],o=s[t],i=u.p.swap(o.direction),l=ht(o);if(t===0){s.unshift({direction:i,length:n});const a=Ot(l,De);s.unshift({direction:o.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=Ot(l,De);s.push({direction:o.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},L9=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},P9=(e,t,n=!1,...s)=>{const o=(i,l)=>!s.includes(l)&&t(i,l);return n?L9(e,o):e.findIndex(o)},N9=({delta:e,segments:t})=>so(lm(e,t,!1)),A9=({delta:e,segments:t})=>so(lm(e,t,!0)),lm=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Wl("x",e,s,n)),e.y!==0&&(s=Wl("y",e,s,n)),s},Ul=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},o=ht(t),i=ht(s),l=Math.abs(s.length),a=Math.abs(t.length);return(l>a||l>De)&&o===i},Wl=(e,t,n,s)=>{const o=u.p.swap(e),i=s?n.length-1:0,l=n[i];if(Ul(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=P9(n,p=>p.direction===e,s,i);if(d===a){const p=n[a];return Ul(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:o,length:n[0].length/2},{direction:e,length:-t[e]},{direction:o,length:n[0].length/2}]:l.direction===e?(n[i]={...l,length:l.length-t[e]},n):[{direction:o,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},O9=ne.z.object({position:u.K.xy,zoom:ne.z.number()}),am=ne.z.object({color:u.fr.crudeZ,variant:ne.z.string().optional(),segments:ne.z.array(tr)}),I9=am.extend({key:ne.z.string(),source:ne.z.string(),target:ne.z.string(),segments:ne.z.array(tr),color:u.fr.crudeZ,id:ne.z.string(),data:ne.z.object({segments:ne.z.array(tr),color:u.fr.crudeZ,variant:ne.z.string().optional()}).optional(),selected:ne.z.boolean(),sourceHandle:ne.z.string().nullable().optional(),targetHandle:ne.z.string().nullable().optional()}),D9=ne.z.object({key:ne.z.string(),position:u.K.xy,selected:ne.z.boolean().optional(),zIndex:ne.z.number().optional(),type:ne.z.string().optional(),data:u.l$1.unknownZ.optional(),measured:ne.z.object({width:ne.z.number().optional(),height:ne.z.number().optional()}).optional()}),xi=(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})),pi=e=>e.map(({segments:t,color:n,variant:s,...o})=>({...o,id:o.key,data:{segments:t,color:n,variant:s}})),cm=e=>e.map(t=>({key:t.id,...t})),um=(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})),dm=e=>({...e.position,zoom:e.zoom}),xm=e=>({position:u.K.construct(e),zoom:e.zoom}),pm=(e,t)=>cm(t(xi(e))),xs=(e,t,n)=>um(t(pi(e)),n),B9=(e,t="x")=>{if(e.length===0)return[];const n=u.K$1.construct(t),s=u.K$1.swap(n);return e.sort((o,i)=>u.Ho.loc(o.box,n)-u.Ho.loc(i.box,n)),e.forEach((o,i)=>{if(i===0)return;const a=e[i-1].handles.find(h=>h.orientation===s),c=o.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(o.box),p);o.box=u.Ho.construct(m,u.Ho.dims(o.box))}),e},$9=(e,t)=>e.map((n,s)=>u.K.translate(n,t[s])),mm=({points:e,color:t,...n})=>r.jsxRuntimeExports.jsx(qe,{path:jt(e),style:{stroke:u.fr.cssString(t)},...n}),z9=({points:e,color:t,...n})=>r.jsxRuntimeExports.jsx(qe,{path:jt(e),style:{stroke:u.fr.cssString(t),strokeDasharray:"12,4"},...n}),V9=({points:e,color:t,...n})=>r.jsxRuntimeExports.jsx(qe,{path:jt(e),style:{stroke:u.fr.cssString(t),strokeDasharray:"12,4,4"},...n}),F9=({points:e,color:t,...n})=>{const s=u.K.calculateMiters(e,6),o=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.fr.cssString(t),a=.7;return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(qe,{path:jt(o),style:{stroke:l,opacity:a},...n}),r.jsxRuntimeExports.jsx(qe,{path:jt(e),style:{stroke:l},...n}),r.jsxRuntimeExports.jsx(qe,{path:jt(i),style:{stroke:l,opacity:a},...n})]})},Xl=5,H9=(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 o=t;let i=0,l=o;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+=o,!(u.K.distance(m,x)<Xl||u.K.distance(m,d)<Xl)&&n.push({position:m,direction:h})}i+=c}return n},Z9=({color:e,position:t,direction:n})=>{const o="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,r.jsxRuntimeExports.jsx("path",{d:o,stroke:u.fr.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},K9=({color:e,position:t,direction:n})=>{const o="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),r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("path",{d:o,stroke:u.fr.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),r.jsxRuntimeExports.jsx("path",{d:o,stroke:u.fr.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${i.x},${i.y}) rotate(${l})`,strokeLinecap:"round"})]})},Y9=({color:e,position:t})=>r.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:u.fr.cssString(e),strokeWidth:2}),mi=e=>{const t=({points:n,color:s,...o})=>{const i=jt(n),l=H9(n,40);return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(qe,{path:i,...o,style:{stroke:u.fr.cssString(s)}}),l.map(({position:a,direction:c},d)=>r.jsxRuntimeExports.jsx(e,{position:a,direction:c,color:s},d))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},G9=mi(Z9),U9=mi(K9),W9=mi(Y9),jt=e=>{let t="";const s=e.length+-1;for(let o=0;o<s;o++){const i=e[o%e.length],l=e[(o+1)%e.length],a=Math.min(6/Math.hypot(l.x-i.x,l.y-i.y),.5);o>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),o===0?t+=`M${i.x},${i.y}`:o===0&&(t+=`M${i.x*(1-a)+l.x*a},${i.y*(1-a)+l.y*a}`),o===s-1?t+=`L${l.x},${l.y}`:o<s-1&&(t+=`L${i.x*a+l.x*(1-a)},${i.y*a+l.y*(1-a)}`)}return t},fm={pipe:mm,electric:z9,secondary:V9,jacketed:F9,hydraulic:G9,pneumatic:U9,data:W9},hm=mm,X9=[{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"}],q9=e=>r.jsxRuntimeExports.jsx(An,{data:X9,...e,resourceName:"Path Type"}),Q9=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:o,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=zt(),m=Yt({sourcePos:u.K.construct(e,t),targetPos:u.K.construct(n,s),sourceOrientation:o,targetOrientation:i,sourceBox:Ie(p,l?.id??""),targetBox:Ie(p,l?.id??"")}),h=im(u.K.construct(e,t),m,p.getZoom(),!1);return r.jsxRuntimeExports.jsx(hm,{points:h,style:{...a,stroke:u.fr.cssString(c==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l11)"),strokeWidth:2,fill:"none"}})},J9=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:o,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=zt(),[C,k,T]=f.useCombinedStateAndRef(()=>a.length>0?a:Yt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ie(y,t),targetBox:Ie(y,n)})),N=j.useRef(i),I=j.useRef(s),B=_e.useDebouncedCallback(c,100,[c]);if(!E||!v){let b=C;const P=u.K.translation(g.current,h),_=u.K.translation(S,R.current);u.K.equals(P,u.K.scale(_,-1),.001)?(g.current=h,R.current=S):(E?v||(b=A9({delta:_,segments:b}),N.current!==i&&(N.current=i,b=Yt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ie(y,t),targetBox:Ie(y,n)})),Zl({sourcePos:h,targetPos:S,next:b,prev:C})||(b=Yt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ie(y,t),targetBox:Ie(y,n)})),R.current=S):(b=N9({delta:P,segments:b}),I.current!==s&&(I.current=s,b=Yt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ie(y,t),targetBox:Ie(y,n)})),Zl({sourcePos:h,targetPos:S,next:b,prev:C})||(b=Yt({sourcePos:h,targetPos:S,sourceOrientation:s,targetOrientation:i,sourceBox:Ie(y,t),targetBox:Ie(y,n)})),g.current=h),B(b),k(b))}const F=j.useRef(null),$=_e.useCursorDrag({onStart:j.useCallback((b,P,_)=>{F.current={index:Number(_.currentTarget.id.split("-")[1]),segments:[...T.current]}},[]),onMove:j.useCallback(b=>{if(F.current==null)return;const P=M9({segments:F.current.segments,index:F.current.index,magnitude:u.Ho.dim(b,u.p.swap(F.current.segments[F.current.index].direction),!0)/y.getZoom()});k(P)},[]),onEnd:j.useCallback(()=>c(T.current),[c])}),D=im(h,C,y.getZoom(),!0),z=fm[p];return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx(z,{points:D,color:d}),x&&e7(D).map((b,P)=>{const _=C[P].direction,L=u.p.swap(_),V={[u.p.dimension(_)]:"18px",[u.p.dimension(L)]:"4px"},H={[_]:b[_]-9,[L]:b[L]-2};return r.jsxRuntimeExports.jsxs(j.Fragment,{children:[r.jsxRuntimeExports.jsx("rect",{className:u.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...V,...H,rx:"2px",ry:"2px"}),r.jsxRuntimeExports.jsx("foreignObject",{x:b.x-9,y:b.y-9,width:"18px",height:"18px",children:r.jsxRuntimeExports.jsx("div",{id:`handle-${P}`,className:u.CSS(u.CSS.BE("diagram-edge-handle","dragger"),u.CSS.dir(_)),draggable:!0,onDragStart:$})})]},P)})]})},e7=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)}),t7=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:u.K.ZERO,zoom:1}})=>{const[o,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:o,onEditableChange:i,fitViewOnResize:g,setFitViewOnResize:E,viewportMode:l,onViewportModeChange:a}},n7=()=>!0,s7={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},o7={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},sr={maxZoom:1,minZoom:.5,padding:.05},r7={hideAttribution:!0},gm=j.createContext({editable:!0,visible:!0,viewportMode:"select",onViewportModeChange:()=>{},onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),cn=()=>j.use(gm),jm=j.memo(({children:e})=>{const{registerNodeRenderer:t}=cn();return j.useEffect(()=>t(e),[t,e]),null});jm.displayName="NodeRenderer";const i7=["Backspace","Delete"],l7={panOnDrag:[f.MOUSE_LEFT_NUMBER,f.MOUSE_MIDDLE_NUMBER]},a7={selectionOnDrag:!0,panOnDrag:[f.MOUSE_MIDDLE_NUMBER]},c7=e=>e==="pan"?l7:a7,u7=({aetherKey:e,onNodesChange:t,onEdgesChange:n,nodes:s,edges:o,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:O.Diagram$1.TYPE,schema:O.diagramStateZ,initialState:{position:a.position,region:u.Ho.ZERO,zoom:a.zoom,...R}}),{fitView:C}=zt(),k=_e.useDebouncedCallback(X=>void C(X),50,[C]),T=On(j.useCallback(X=>{x&&k(sr),y(de=>({...de,region:X}))},[y,k,x]));j.useEffect(()=>y(X=>({...X,...R})),[R]);const N=u.fr.hex(f.use().colors.gray.l11),I=f.useMemoCompare(()=>c??Er.zoom,f.compareModeConfigs,[c]),B=j.useRef(null),F=j.useCallback(X=>{const de=B.current;de!=null&&de.x===X.x&&de.y===X.y&&de.zoom===X.zoom||(B.current=X,!(isNaN(X.x)||isNaN(X.y)||isNaN(X.zoom))&&(y(we=>({...we,position:X,zoom:X.zoom})),d(xm(X))))},[y,d]);WS({onStart:F,onChange:F,onEnd:F});const[$,D]=j.useState(()=>()=>null),z=j.useCallback(X=>D(()=>X),[]),b=j.useMemo(()=>({custom:({id:X,positionAbsoluteX:de,positionAbsoluteY:we,selected:Ne=!1,draggable:et=!0})=>$({symbolKey:X,position:{x:de,y:we},selected:Ne,draggable:et})}),[$]),P=j.useRef(o),_=j.useMemo(()=>(P.current=o,pi(o)),[o]),L=j.useRef(s),V=j.useMemo(()=>(L.current=s,xi(s,h)),[s,h]),H=j.useCallback(X=>t(pm(L.current,de=>Sd(X,de)),X),[t]),K=j.useCallback(X=>n(xs(P.current,de=>Rd(X,de),N)),[n,N]),Z=j.useCallback((X,de)=>n(xs(P.current,we=>fy(X,de,we),N)),[]),G=j.useCallback(X=>n(xs(P.current,de=>nd(X,de),N)),[n,N]),Q=j.useCallback((X,de)=>{const we=[...P.current],Ne=we.findIndex(et=>et.key===X);Ne!==-1&&(we[Ne]={...we[Ne],segments:de},P.current=we,n(we))},[n]),ee=l?s7:o7,ae=f.useSyncedRef(Q),re=j.useMemo(()=>({default:X=>r.jsxRuntimeExports.jsx(J9,{...X,segments:X.data?.segments??[],color:X.data?.color,variant:X.data?.variant,onSegmentsChange:j.useCallback(de=>ae.current(X.id,de),[X.id])},X.id)}),[]),se=j.useRef(null);f.use$1({triggers:I.zoomReset,callback:j.useCallback(({stage:X,cursor:de})=>{const we=se.current;we==null||X!=="start"||!u.Ho.contains(we,de)||C()},[C])});const te=f.purgeMouse(I.select)[0]??null,le=f.purgeMouse(I.pan)[0]??null,Re=f.purgeMouse(I.zoom)[0]??null,Ce={selectionOnDrag:te==null,panOnDrag:le==null,selectionKeyCode:te,panActivationKeyCode:le,zoomActivationKeyCode:Re},ue=f.useCombinedRefs(se,T),me=j.useMemo(()=>({visible:m,editable:l,onEditableChange:i,registerNodeRenderer:z,fitViewOnResize:x,setFitViewOnResize:p,viewportMode:g,onViewportModeChange:E}),[l,m,i,z,x,g,E]);return r.jsxRuntimeExports.jsx(gm,{value:me,children:r.jsxRuntimeExports.jsx(f.Composite,{path:v,children:m&&r.jsxRuntimeExports.jsx(GS,{...Ce,className:u.CSS(u.CSS.B("diagram"),u.CSS.editable(l),u.CSS.BE("symbol","container")),nodes:V,edges:_,nodeTypes:b,edgeTypes:re,ref:ue,fitView:!0,onNodesChange:H,onEdgesChange:K,onConnect:G,onReconnect:Z,defaultViewport:dm(a),connectionLineComponent:Q9,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:n7,connectionMode:Nt.Loose,fitViewOptions:sr,selectionMode:tn.Partial,proOptions:r7,deleteKeyCode:i7,...S,style:{[u.CSS.var("diagram-zoom")]:a.zoom,...S.style},...ee,...c7(g),nodesDraggable:l})})})},d7=()=>{const{editable:e}=cn();return e?r.jsxRuntimeExports.jsx(eR,{}):null},x7=e=>r.jsxRuntimeExports.jsx(f.Box,{x:!0,className:u.CSS.BE("diagram","controls"),...e}),or=u.K$1.BOTTOM_LEFT,p7=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=cn();return r.jsxRuntimeExports.jsx(na.Toggle,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:or,size:"small",tooltip:`${n?"Disable":"Enable"} editing`,...t,children:n?r.jsxRuntimeExports.jsx(f.EditOff,{}):r.jsxRuntimeExports.jsx(f.Edit,{})})},m7=({onClick:e,...t})=>{const{fitView:n}=zt(),{fitViewOnResize:s,setFitViewOnResize:o}=cn();return r.jsxRuntimeExports.jsx(na.Toggle,{onClick:i=>{n(sr),e?.(i)},value:s,onChange:o,rightClickToggle:!0,tooltip:r.jsxRuntimeExports.jsx(f.Text,{level:"small",children:"Fit view to contents"}),tooltipLocation:u.K$1.BOTTOM_LEFT,size:"small",...t,children:r.jsxRuntimeExports.jsx(f.Expand,{})})},Em=["zoom","pan","select"],f7=[["MouseMiddle"]],h7=[["MouseLeft"]],g7=()=>{const{viewportMode:e,onViewportModeChange:t}=cn();return r.jsxRuntimeExports.jsxs(pe.Buttons,{keys:Em,value:e,onChange:t,children:[r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"pan",size:"small",tooltip:r.jsxRuntimeExports.jsx(Wt,{mode:"pan",triggers:f7}),tooltipLocation:or,children:r.jsxRuntimeExports.jsx(f.Pan,{})}),r.jsxRuntimeExports.jsx(pe.Button,{itemKey:"select",size:"small",tooltip:r.jsxRuntimeExports.jsx(Wt,{mode:"select",triggers:h7}),tooltipLocation:or,children:r.jsxRuntimeExports.jsx(f.Selection,{})})]})},j7=e=>r.jsxRuntimeExports.jsx(Gd,{children:r.jsxRuntimeExports.jsx(u7,{...e})}),E7=Object.freeze(Object.defineProperty({__proto__:null,Background:d7,Controls:x7,DefaultPath:hm,Diagram:j7,FitViewControl:m7,HandleLayout:Bp,NodeLayout:to,NodeRenderer:jm,PATHS:fm,SelectPathType:q9,SelectViewportModeControl:g7,ToggleEditControl:p7,VIEWPORT_MODES:Em,alignNodes:B9,calcPath:jt,edgeConverter:xs,edgeZ:I9,nodeConverter:pm,nodeZ:D9,offsetPath:$9,rfEdgeDataZ:am,selectNode:eo,selectNodeBox:Ie,selectNodeLayout:LR,translateEdgesBackward:um,translateEdgesForward:pi,translateNodesBackward:cm,translateNodesForward:xi,translateViewportBackward:xm,translateViewportForward:dm,use:t7,useContext:cn,viewportZ:O9},Symbol.toStringTag,{value:"Module"})),y7=({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:o=r.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:O.Log.TYPE,schema:O.logState,initialState:{empty:!0,region:u.Ho.ZERO,scrolling:!1,wheelPos:0,...c}});j.useEffect(()=>{p(h=>({...h,...c}))},[c,p]);const m=On(j.useCallback(h=>p(g=>({...g,region:h})),[p]));return r.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?o:r.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:r.jsxRuntimeExports.jsx(f.Dynamic,{})})})},S7=Object.freeze(Object.defineProperty({__proto__:null,Log:y7},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.useWindowResize=f.useWindowResize;exports.CSS=u.CSS;exports.DataType=u.n;exports.Density=u.d;exports.MultiSeries=u.Wt;exports.Rate=u.b;exports.Series=u.A;exports.TimeRange=u.O;exports.TimeSpan=u.i;exports.TimeStamp=u.r;exports.newBEM=u.newBEM;exports.state=M.state;exports.Button=Cf.external;exports.Caret=ql.Animated$1;exports.telem=O.external;exports.Theming=Ns.external;exports.Color=_e.external;exports.useCursorDrag=_e.useCursorDrag;exports.useDebouncedCallback=_e.useDebouncedCallback;exports.Triggers=Jl.external;exports.List=nt.external;exports.Dialog=ea.external;exports.Input=Ae.external;exports.Flex=pe.external;exports.createHexOpacityVariants=ta.createHexOpacityVariants;exports.unitProperty=ta.unitProperty;exports.Header=bf.external;exports.Menu=wf.external;exports.Tabs=Le.external;exports.Text=vf.external;exports.Tree=kf.external;exports.Video=_f.Video;exports.Breadcrumb=hh;exports.Canvas=Th;exports.Channel=t1;exports.Component=rh;exports.Control=FR;exports.Device=g1;exports.Diagram=E7;exports.Direction=n1;exports.Eraser=Qf;exports.Flux=Fg;exports.Form=Ng;exports.Group=c1;exports.Icon=Vf;exports.Label=Y1;exports.Legend=Vh;exports.Line=Hh;exports.LinePlot=ig;exports.Log=S7;exports.Measure=ug;exports.Mosaic=c0;exports.Nav=th;exports.Note=d0;exports.OS=_0;exports.Observe=vg;exports.Ontology=C0;exports.Override=T0;exports.Pluto=n9;exports.Portal=t0;exports.Progress=o9;exports.Rack=b1;exports.Range=ag;exports.Ranger=oj;exports.Resize=Xf;exports.Rule=dg;exports.Schematic=Fb;exports.Select=xh;exports.Status=oh;exports.Steps=i9;exports.Synnax=Lg;exports.Table=d9;exports.TableCells=C9;exports.Tag=ih;exports.Task=I1;exports.Telem=Gb;exports.Tooltip=Ff;exports.Value=Tj;exports.Viewport=og;exports.Workspace=Qb;exports.axis=wh;exports.control=vh;exports.proxyMemo=zf;exports.useAsyncEffect=It;exports.useDestructors=Is;exports.useVirtualCursorDrag=ph;