@synnaxlabs/pluto 0.38.0 → 0.38.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 (214) hide show
  1. package/dist/{Animated-CBm9-vEt.js → Animated-BWcO40x5.js} +2 -2
  2. package/dist/{Animated-Cv0kRBvj.cjs → Animated-Cxl7iHik.cjs} +1 -1
  3. package/dist/{Item-DfHOrsI4.js → Item-BZvmqn4h.js} +4 -4
  4. package/dist/{Item-D4eTqW7p.cjs → Item-C4SOBynl.cjs} +1 -1
  5. package/dist/{LinePlot-BLovx_K1.js → LinePlot-B_tFyvNo.js} +1776 -1794
  6. package/dist/LinePlot-C_uxbSzY.cjs +56 -0
  7. package/dist/{Link-DsUveQ8_.js → Link-BIWA4Kdj.js} +1 -1
  8. package/dist/{Link-CcELhLK5.cjs → Link-DO2YbtQM.cjs} +1 -1
  9. package/dist/{Pack-SDIuOEWr.cjs → Pack-B7_tAsYd.cjs} +1 -1
  10. package/dist/{Pack-meMPpnLE.js → Pack-Di5J8hmU.js} +1 -1
  11. package/dist/{Toggle--8qqNnzb.cjs → Toggle-BOWYgKry.cjs} +61 -61
  12. package/dist/{Toggle-Bkpw4raJ.js → Toggle-DvdBHJvZ.js} +6983 -6992
  13. package/dist/{Video-M2UhBzQi.js → Video-CAbdyjCE.js} +1 -1
  14. package/dist/{Video-D9_mAnaf.cjs → Video-usN9Roxq.cjs} +1 -1
  15. package/dist/{aggregator-By11htYo.cjs → aggregator-B4RWbN9h.cjs} +34 -34
  16. package/dist/{aggregator-BpyoaCoW.js → aggregator-Bl15iClv.js} +2593 -2617
  17. package/dist/align.cjs +1 -1
  18. package/dist/align.js +1 -1
  19. package/dist/button.cjs +1 -1
  20. package/dist/button.js +1 -1
  21. package/dist/color.cjs +1 -1
  22. package/dist/color.js +1 -1
  23. package/dist/{css-CxwKC6TD.js → css-Bbri4zkj.js} +190 -184
  24. package/dist/css-DT9dIVAb.cjs +1 -0
  25. package/dist/css.cjs +1 -1
  26. package/dist/css.js +2 -2
  27. package/dist/dropdown.cjs +1 -1
  28. package/dist/dropdown.js +1 -1
  29. package/dist/ether.cjs +1 -1
  30. package/dist/ether.js +67 -71
  31. package/dist/{external-ByzAGKGm.cjs → external-8OKX45Jc.cjs} +1 -1
  32. package/dist/{external-biLn9KfP.cjs → external-9Q86X8hc.cjs} +1 -1
  33. package/dist/{external-DSHJn336.js → external-B45MvYg8.js} +4 -4
  34. package/dist/{external-BDxOWeCJ.js → external-BP5euc4j.js} +3 -3
  35. package/dist/external-Ba8go3wq.cjs +1 -0
  36. package/dist/{external-BDI5gGZT.js → external-C59dex28.js} +2 -2
  37. package/dist/{external-BlB1LKU5.cjs → external-CKXRIr4_.cjs} +1 -1
  38. package/dist/{external-CEAUuDRU.js → external-CML3oqyJ.js} +2 -2
  39. package/dist/{external-BdhgaSFj.cjs → external-CW61uh4b.cjs} +1 -1
  40. package/dist/{external-DaTbvfth.cjs → external-CWIwuJks.cjs} +1 -1
  41. package/dist/{external-BOqGZoJO.js → external-CcuRxo0Z.js} +27 -27
  42. package/dist/{external-Dvj3Y4C_.cjs → external-CigHe3w_.cjs} +1 -1
  43. package/dist/{external-NDebmx0l.js → external-Cm1kldLr.js} +13 -13
  44. package/dist/{external-Cc7R9gIf.js → external-DNjLBxYA.js} +4 -4
  45. package/dist/{external-BzzIJ4wP.js → external-DTDBfIqD.js} +1 -1
  46. package/dist/{external-DN8Ec8n8.cjs → external-DkXE1VK8.cjs} +1 -1
  47. package/dist/{external--jF6DCow.cjs → external-Dt4ggRt2.cjs} +1 -1
  48. package/dist/{external-CsLjI7EJ.js → external-DuGCS_ZD.js} +2 -2
  49. package/dist/{external-CqOmm0mk.js → external-DuK5v_sl.js} +38 -36
  50. package/dist/{external-mT9bNf0F.cjs → external-SsIgRo40.cjs} +1 -1
  51. package/dist/{external-hZWRSBEb.js → external-U33eEFR3.js} +14 -14
  52. package/dist/{external-CDa3lybi.js → external-bw66TR6V.js} +10 -10
  53. package/dist/{external---lrKeGh.cjs → external-kZBV4X9L.cjs} +1 -1
  54. package/dist/{external-Dqh2Lbnl.cjs → external-ok_ye4LF.cjs} +1 -1
  55. package/dist/header.cjs +1 -1
  56. package/dist/header.js +1 -1
  57. package/dist/index.cjs +7 -7
  58. package/dist/index.js +2867 -2875
  59. package/dist/input.cjs +1 -1
  60. package/dist/input.js +1 -1
  61. package/dist/list.cjs +1 -1
  62. package/dist/list.js +1 -1
  63. package/dist/menu.cjs +1 -1
  64. package/dist/menu.js +1 -1
  65. package/dist/src/aether/aether/aether.bench.d.ts +2 -0
  66. package/dist/src/aether/aether/aether.bench.d.ts.map +1 -0
  67. package/dist/src/aether/aether/aether.d.ts +143 -136
  68. package/dist/src/aether/aether/aether.d.ts.map +1 -1
  69. package/dist/src/aether/aether/{worker.spec.d.ts → aether.spec.spec.d.ts} +1 -1
  70. package/dist/src/aether/aether/aether.spec.spec.d.ts.map +1 -0
  71. package/dist/src/alamos/aether/alamos.d.ts +2 -2
  72. package/dist/src/alamos/aether/alamos.d.ts.map +1 -1
  73. package/dist/src/breadcrumb/Breadcrumb.d.ts +2 -2
  74. package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
  75. package/dist/src/button/Button.d.ts +5 -5
  76. package/dist/src/button/Button.d.ts.map +1 -1
  77. package/dist/src/button/Toggle.d.ts +2 -2
  78. package/dist/src/channel/Select.d.ts +1 -1
  79. package/dist/src/channel/Select.d.ts.map +1 -1
  80. package/dist/src/color/Provider.d.ts.map +1 -1
  81. package/dist/src/hooks/effect.d.ts +2 -2
  82. package/dist/src/hooks/effect.d.ts.map +1 -1
  83. package/dist/src/icon/Icon.d.ts +11 -4
  84. package/dist/src/icon/Icon.d.ts.map +1 -1
  85. package/dist/src/menu/Item.d.ts.map +1 -1
  86. package/dist/src/os/Controls/Controls.d.ts.map +1 -1
  87. package/dist/src/os/use.d.ts.map +1 -1
  88. package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
  89. package/dist/src/select/Alignment.d.ts +1 -1
  90. package/dist/src/select/Alignment.d.ts.map +1 -1
  91. package/dist/src/select/ComponentSize.d.ts.map +1 -1
  92. package/dist/src/select/Direction.d.ts +1 -1
  93. package/dist/src/select/Direction.d.ts.map +1 -1
  94. package/dist/src/status/Aggregator.d.ts +4 -6
  95. package/dist/src/status/Aggregator.d.ts.map +1 -1
  96. package/dist/src/status/aether/aggregator.d.ts +10 -4
  97. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  98. package/dist/src/synnax/aether/provider.d.ts +2 -2
  99. package/dist/src/synnax/aether/provider.d.ts.map +1 -1
  100. package/dist/src/table/aether/Table.d.ts +3 -1
  101. package/dist/src/table/aether/Table.d.ts.map +1 -1
  102. package/dist/src/table/cells/registry.d.ts.map +1 -1
  103. package/dist/src/table/external.d.ts.map +1 -1
  104. package/dist/src/tabs/types.d.ts +2 -2
  105. package/dist/src/tabs/types.d.ts.map +1 -1
  106. package/dist/src/tag/Tag.d.ts +1 -1
  107. package/dist/src/tag/Tag.d.ts.map +1 -1
  108. package/dist/src/telem/aether/context.d.ts +22 -22
  109. package/dist/src/telem/aether/context.d.ts.map +1 -1
  110. package/dist/src/telem/aether/factory.d.ts +1 -1
  111. package/dist/src/telem/aether/factory.d.ts.map +1 -1
  112. package/dist/src/telem/aether/provider.d.ts +3 -13
  113. package/dist/src/telem/aether/provider.d.ts.map +1 -1
  114. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  115. package/dist/src/telem/client/client.d.ts +8 -12
  116. package/dist/src/telem/client/client.d.ts.map +1 -1
  117. package/dist/src/telem/control/aether/chip.d.ts +1 -2
  118. package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
  119. package/dist/src/telem/control/aether/controller.d.ts +3 -2
  120. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  121. package/dist/src/telem/control/aether/indicator.d.ts +1 -2
  122. package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
  123. package/dist/src/telem/control/aether/legend.d.ts +1 -1
  124. package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
  125. package/dist/src/telem/control/aether/state.d.ts +1 -1
  126. package/dist/src/telem/control/aether/state.d.ts.map +1 -1
  127. package/dist/src/text/Editable.d.ts.map +1 -1
  128. package/dist/src/theming/Provider.d.ts.map +1 -1
  129. package/dist/src/theming/aether/provider.d.ts +1 -1
  130. package/dist/src/theming/aether/provider.d.ts.map +1 -1
  131. package/dist/src/tree/Tree.d.ts +1 -1
  132. package/dist/src/tree/Tree.d.ts.map +1 -1
  133. package/dist/src/tree/core.d.ts +1 -2
  134. package/dist/src/tree/core.d.ts.map +1 -1
  135. package/dist/src/triggers/Provider.d.ts.map +1 -1
  136. package/dist/src/util/canDisable.d.ts.map +1 -1
  137. package/dist/src/util/reflow.d.ts.map +1 -1
  138. package/dist/src/vis/axis/canvas.d.ts +1 -1
  139. package/dist/src/vis/axis/canvas.d.ts.map +1 -1
  140. package/dist/src/vis/button/aether/button.d.ts +1 -1
  141. package/dist/src/vis/button/aether/button.d.ts.map +1 -1
  142. package/dist/src/vis/canvas/aether/canvas.d.ts +9 -8
  143. package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
  144. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  145. package/dist/src/vis/diagram/aether/Diagram.d.ts +2 -2
  146. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  147. package/dist/src/vis/eraser/aether/eraser.d.ts +4 -4
  148. package/dist/src/vis/eraser/aether/eraser.d.ts.map +1 -1
  149. package/dist/src/vis/light/aether/light.d.ts +2 -2
  150. package/dist/src/vis/light/aether/light.d.ts.map +1 -1
  151. package/dist/src/vis/line/aether/line.d.ts +2 -2
  152. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  153. package/dist/src/vis/lineplot/aether/LinePlot.d.ts +3 -3
  154. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  155. package/dist/src/vis/lineplot/aether/axis.d.ts +2 -2
  156. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  157. package/dist/src/vis/lineplot/range/aether/annotation.d.ts +1 -1
  158. package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
  159. package/dist/src/vis/lineplot/range/aether/provider.d.ts +1 -1
  160. package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
  161. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +2 -2
  162. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts.map +1 -1
  163. package/dist/src/vis/log/Log.d.ts.map +1 -1
  164. package/dist/src/vis/log/aether/Log.d.ts +1 -1
  165. package/dist/src/vis/log/aether/Log.d.ts.map +1 -1
  166. package/dist/src/vis/log/index.d.ts.map +1 -1
  167. package/dist/src/vis/measure/aether/measure.d.ts +3 -3
  168. package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
  169. package/dist/src/vis/render/GLProgram.d.ts +1 -1
  170. package/dist/src/vis/render/GLProgram.d.ts.map +1 -1
  171. package/dist/src/vis/render/external.d.ts +0 -1
  172. package/dist/src/vis/render/external.d.ts.map +1 -1
  173. package/dist/src/vis/render/loop.d.ts +1 -1
  174. package/dist/src/vis/render/loop.d.ts.map +1 -1
  175. package/dist/src/vis/rule/aether/aether.d.ts +2 -2
  176. package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
  177. package/dist/src/vis/setpoint/aether/setpoint.d.ts +2 -2
  178. package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -1
  179. package/dist/src/vis/toggle/aether/toggle.d.ts +2 -2
  180. package/dist/src/vis/toggle/aether/toggle.d.ts.map +1 -1
  181. package/dist/src/vis/value/aether/value.d.ts +2 -2
  182. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  183. package/dist/src/worker/Context.d.ts.map +1 -1
  184. package/dist/tabs.cjs +1 -1
  185. package/dist/tabs.js +1 -1
  186. package/dist/text.cjs +1 -1
  187. package/dist/text.js +2 -2
  188. package/dist/theming.cjs +1 -1
  189. package/dist/theming.js +2 -2
  190. package/dist/{transformColorsToHex-1p-bBtDw.cjs → transformColorsToHex-CDwcIPob.cjs} +1 -1
  191. package/dist/{transformColorsToHex-CjnZ3Lo3.js → transformColorsToHex-CnZpPlL2.js} +1 -1
  192. package/dist/tree.cjs +1 -1
  193. package/dist/tree.js +1 -1
  194. package/dist/triggers.cjs +1 -1
  195. package/dist/triggers.js +1 -1
  196. package/dist/{units-Cq6pBqSd.cjs → units-BpKy5yTv.cjs} +1 -1
  197. package/dist/{units-Bz3KAVba.js → units-CNGjg1NV.js} +1 -1
  198. package/dist/video.cjs +1 -1
  199. package/dist/video.js +1 -1
  200. package/package.json +6 -5
  201. package/dist/LinePlot-BXBKDBXS.cjs +0 -56
  202. package/dist/css-CRd0zXr-.cjs +0 -1
  203. package/dist/external-BXEbAbxf.cjs +0 -1
  204. package/dist/src/aether/aether/worker.spec.d.ts.map +0 -1
  205. package/dist/src/aether/test/index.d.ts +0 -2
  206. package/dist/src/aether/test/index.d.ts.map +0 -1
  207. package/dist/src/aether/test/test.d.ts +0 -11
  208. package/dist/src/aether/test/test.d.ts.map +0 -1
  209. package/dist/src/telem/test/index.d.ts +0 -2
  210. package/dist/src/telem/test/index.d.ts.map +0 -1
  211. package/dist/src/telem/test/mock.d.ts +0 -33
  212. package/dist/src/telem/test/mock.d.ts.map +0 -1
  213. package/dist/src/vis/render/eraser.d.ts +0 -20
  214. package/dist/src/vis/render/eraser.d.ts.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var _m=Object.defineProperty;var Pm=(e,t,n)=>t in e?_m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ge=(e,t,n)=>Pm(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-D8EVjfnb.cjs"),g=require("react"),E=require("./Toggle--8qqNnzb.cjs"),u=require("./css-CRd0zXr-.cjs"),zn=require("./external-DN8Ec8n8.cjs"),Z=require("./aggregator-By11htYo.cjs"),te=require("./Pack-SDIuOEWr.cjs"),Lm=require("./external-BlB1LKU5.cjs"),Me=require("./external-BdhgaSFj.cjs"),ve=require("./external-biLn9KfP.cjs"),Nm=require("./external-DaTbvfth.cjs"),_o=require("./Animated-Cv0kRBvj.cjs"),B=require("./LinePlot-BXBKDBXS.cjs"),ce=require("zod"),Ki=require("./external--jF6DCow.cjs");require("./Item-D4eTqW7p.cjs");const Po=require("react-dom"),Gt=require("./external-ByzAGKGm.cjs"),Tm=require("./external-Dqh2Lbnl.cjs"),Xi=require("./units-Cq6pBqSd.cjs"),Ne=require("./external-mT9bNf0F.cjs"),Am=require("./external---lrKeGh.cjs"),Im=require("./external-Dvj3Y4C_.cjs"),$m=require("./external-BXEbAbxf.cjs"),zm=require("./Video-D9_mAnaf.cjs"),Bm=(e,t,n=150)=>{const[s,r]=g.useState(e);return g.useEffect(()=>{const i=setTimeout(()=>r(t),n);return()=>clearTimeout(i)},[t,n]),s},Yn=e=>e.preventDefault(),Lo=({ref:e,location:t,style:n,size:s,className:r,children:i,onDragStart:l,sizeUnits:c="px",showHandle:a=!0,...d})=>{const x=u.K.construct(t),p=u.K.direction(x),m=u.g.dimension(p);return o.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.B("resize"),u.CSS.loc(x),u.CSS.dir(p),r),style:{[m]:`${s}${c}`,...n},ref:e,...d,children:[i,a&&o.jsxRuntimeExports.jsx("div",{draggable:!0,className:u.CSS(u.CSS.BE("resize","handle"),u.CSS.bordered(u.K.swap(x))),onDragStart:l,onDrag:Yn,onDragEnd:Yn})]})},No=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:r="x"})=>{const i=g.useRef(null),[l,c]=g.useState({sizeDistribution:Dm(n,t),root:null}),a=g.useCallback((p,m,f)=>{if(i.current==null)return;const h=u.Mt.dim(u.Mt.construct(i.current),r);c(j=>Fs(j,h,p,s,m,f))},[s,c,r]);g.useEffect(()=>e==null?void 0:e(l.sizeDistribution),[l.sizeDistribution,e]);const d=g.useCallback((p,m)=>{p.preventDefault();const f=r==="x"?"clientX":"clientY",h=y=>a(m,y[f]),j=()=>{c(y=>({...y,root:null})),document.removeEventListener("mousemove",h)};c(y=>({...y,root:p[f]})),document.addEventListener("mousemove",h),document.addEventListener("mouseup",j,{once:!0})},[c,r,Fs]);return{setSize:g.useCallback((p,m)=>a(p,void 0,m),[Fs]),props:{direction:r,sizeDistribution:l.sizeDistribution,onDragHandle:d,ref:i}}},To=({ref:e,direction:t="x",children:n,sizeDistribution:s,onDragHandle:r,className:i,...l})=>{const c=u.g.construct(t),a=g.Children.toArray(n);return s=Om(s),o.jsxRuntimeExports.jsx(te.Space,{...l,ref:e,direction:c,className:u.CSS(u.CSS.B("resize-multiple"),i),empty:!0,grow:!0,children:a.map((d,x)=>o.jsxRuntimeExports.jsx(Lo,{onDragStart:p=>r(p,x),location:u.g.location(c),size:s[x]*100,sizeUnits:"%",showHandle:x!==a.length-1,children:d},x))})},Dm=(e,t)=>{const n=e.reduce((r,i)=>r+i,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(r=>r/n);if(e.every(r=>r<=1)){const r=1-n;return[...e,...Array(s).fill(r/s)]}return e.map(()=>1/t)},Vs=.001,Om=e=>e.every(t=>u.G$1.closeTo(t,1/e.length),Vs)?e.map((t,n)=>n%2===0?t+Vs:n===e.length-1?t:t-Vs):e,Fs=(e,t,n,s,r,i)=>{const l=qi(e,t,n,r,i),[c,a]=Vm(e.sizeDistribution,n,l,s/t),d=a?r??null:e.root;return{...e,sizeDistribution:c,root:d}},qi=(e,t,n,s,r)=>{let i;if(r!=null)r>1&&(r/=t),i=r-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},Vm=(e,t,n,s)=>{let r=t;for(;r>0&&e[r]+n<=s;)r--;const i=e[r]+n,l=Fm(r,e,s,n),c=e[l]-n;return i<s||c<s?[e,!1]:[e.map((a,d)=>d===r?i:d===l?c:a),!0]},Fm=(e,t,n,s)=>(e===t.length-1?Zm:Hm)(e,t,n,s),Hm=(e,t,n,s)=>{let r=e+1;for(;r<t.length-1&&t[r]-s<=n;)r++;return r},Zm=(e,t,n,s)=>{let r=e-1;for(;r>0&&t[r]-s<=n;)r--;return r},Hs=2,Ui=({onCollapse:e,onResize:t,location:n="left",minSize:s=100,maxSize:r=1/0,initialSize:i=200,collapseThreshold:l=1/0,className:c,...a})=>{const[d,x]=g.useState(u.Y(i,s,r)),p=g.useRef(null),m=u.K.construct(n),f=g.useCallback(C=>{if(p.current===null)return 0;const b=u.Mt.dim(C,u.K.direction(m),!0)*(1-2*Number(["bottom","right"].includes(m))),w=p.current+b,P=u.Y(w,s,r);return(P-w)/s>l?Hs:P},[m,s,r,l]),h=g.useRef(null),j=g.useCallback(C=>{const b=f(C);x(b),h.current!=null&&(t==null||t(b,u.Mt.construct(h.current)))},[t,f]),y=g.useCallback(()=>x(C=>(p.current=C,C)),[x]),S=g.useCallback(C=>f(C)===Hs&&(e==null?void 0:e()),[e,f]);g.useEffect(()=>x(C=>{const b=u.Y(C,s,r);return p.current=b,b}),[s,r]);const M=E.useCursorDrag({onMove:j,onStart:y,onEnd:S});return o.jsxRuntimeExports.jsx(Lo,{ref:h,location:m,size:d,onDragStart:M,className:u.clsx(c,u.CSS.expanded(d!==Hs)),...a})},Gm=Object.freeze(Object.defineProperty({__proto__:null,Core:Lo,Multiple:To,Single:Ui,calculateDiffPercentage:qi,useMultiple:No},Symbol.toStringTag,{value:"Module"})),Ao=({aetherKey:e})=>{const[,{region:t},n]=E.use$3({aetherKey:e,type:Z.Eraser$1.TYPE,schema:Z.eraserStateZ,initialState:{region:u.Mt.ZERO,enabled:!0}}),s=E.useSyncedRef(t),r=g.useCallback(l=>{u.Mt.equals(l,s.current)||n(c=>({...c,region:l}))},[n]);return{setEnabled:g.useCallback(l=>n(c=>({...c,enabled:l})),[n]),erase:r}},Ym=({aetherKey:e,children:t})=>{const{erase:n}=Ao({aetherKey:e}),s=E.useResize(n);return o.jsxRuntimeExports.jsx("div",{ref:s,className:u.CSS(u.CSS.inheritDims()),children:t})},Wm=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Ym,use:Ao},Symbol.toStringTag,{value:"Module"})),Km=({items:e,initialKey:t})=>{const[n,s]=g.useState(t),r=l=>s(l===n?void 0:l),i=e.find(l=>l.key===n);return{onSelect:r,activeItem:i}},Xm=({activeItem:e,children:t,onSelect:n,location:s="left",collapseThreshold:r=.65,className:i,onResize:l,...c})=>{const a=u.K.direction(s),d=g.useCallback(()=>e!=null&&(n==null?void 0:n(e.key)),[n,e==null?void 0:e.key]),{erase:x,setEnabled:p}=Ao({}),m=g.useCallback((M,C)=>{l==null||l(M,C),x(C)},[l,x]);if(g.useLayoutEffect(()=>{p(e!=null)},[e,p]),e==null)return null;const{content:f,key:h,minSize:j,maxSize:y,initialSize:S}=e;return o.jsxRuntimeExports.jsx(Ui,{className:u.CSS(u.CSS.BE("navdrawer","content"),u.CSS.dir(a),i),collapseThreshold:r,onCollapse:d,location:s,onResize:m,minSize:j,maxSize:y,initialSize:S,...c,children:f},h)},qm=Object.freeze(Object.defineProperty({__proto__:null,Bar:E.Bar,Drawer:Xm,useDrawer:Km},Symbol.toStringTag,{value:"Module"})),Ji=({variant:e="info",...t})=>o.jsxRuntimeExports.jsx(E.yt.Circle,{color:E.variantColors[e],...t}),Um=({status:{key:e,time:t,count:n,message:s,description:r,variant:i},silence:l,actions:c,className:a,children:d,...x})=>o.jsxRuntimeExports.jsxs(te.Space,{className:u.CSS(u.CSS.B("notification"),a),direction:"y",empty:!0,...x,children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",size:"small",children:[o.jsxRuntimeExports.jsx(Ji,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),o.jsxRuntimeExports.jsx(E.Text$1,{level:"small",shade:7,children:`x${n}`}),o.jsxRuntimeExports.jsx(E.DateTime,{className:u.CSS(u.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),o.jsxRuntimeExports.jsx(E.Icon,{className:u.CSS(u.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:o.jsxRuntimeExports.jsx(E.yt.Close,{})})]}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",align:"start",className:u.CSS(u.CSS.BE("notification","content")),size:"small",children:[d??o.jsxRuntimeExports.jsx(E.Text$1,{className:u.CSS(u.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),r!=null&&o.jsxRuntimeExports.jsx(E.Text$1,{className:u.CSS(u.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),c!=null&&o.jsxRuntimeExports.jsx(te.Space,{direction:"x",align:"center",justify:"end",className:u.CSS(u.CSS.BE("notification","actions")),children:Z.A(c).map(p=>o.jsxRuntimeExports.jsx(Jm,{action:p},p.key))})]},t.toString()),Jm=({action:e})=>{if(!g.isValidElement(e)){const t=e;return o.jsxRuntimeExports.jsx(E.Button,{...t})}return e},Qm=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:E.Aggregator,Circle:Ji,Notification:Um,Text:E.Text$3,VARIANTS:Z.VARIANTS,specZ:Z.specZ$1,useAggregator:E.useAggregator,useContext:E.useContext$3,useExceptionHandler:E.useExceptionHandler,useNotifications:E.useNotifications,variantZ:Z.variantZ},Symbol.toStringTag,{value:"Module"})),ef=Object.freeze(Object.defineProperty({__proto__:null,Config:E.Config,Context:E.Context,Dialog:E.Dialog$1,chooseLocation:E.chooseLocation,formatTip:E.formatTip,useConfig:E.useConfig,wrap:E.wrap},Symbol.toStringTag,{value:"Module"})),Bn="y",_r=28,tf=32,nf=40,sf=.5,of=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:r,...i}}=No({direction:Bn,count:e.length,minSize:_r}),l=c=>{if(r.current==null)return;const a=u.Mt.dim(u.Mt.construct(r.current),Bn);s[c]<nf/a?n(c,e[c].initialSize??sf):n(c,_r+1)};return o.jsxRuntimeExports.jsx(To,{empty:!0,className:u.CSS.B("accordion"),sizeDistribution:s,ref:r,...t,...i,children:e.map((c,a)=>g.createElement(cf,{...c,key:c.key,index:a,direction:Bn,onExpand:l,parent:r,size:s[a]}))})},rf=o.jsxRuntimeExports.jsx(E.yt.Caret.Down,{"aria-label":"contract"}),lf=o.jsxRuntimeExports.jsx(E.yt.Caret.Right,{"aria-label":"expand"}),cf=({index:e,name:t,content:n,actions:s,size:r,parent:i,onExpand:l})=>{let c=!0;if(i.current!=null){const d=u.Mt.dim(u.Mt.construct(i.current),Bn);c=r*d>tf}const a=c?rf:lf;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(zn.Header,{level:"p",className:u.CSS.expanded(c),empty:!0,children:[o.jsxRuntimeExports.jsx(zn.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&o.jsxRuntimeExports.jsx(zn.Actions,{children:s})]}),n]})},af=Object.freeze(Object.defineProperty({__proto__:null,Accordion:of},Symbol.toStringTag,{value:"Module"})),uf=(e,t)=>Z.A(e).map(s=>typeof s=="string"?s.split(t).map(r=>({label:r})):s).flat(),Qi=({segments:e,shade:t,level:n,weight:s,separator:r,transform:i})=>{let c=uf(e,r);return i!=null&&(c=c.map(i)),c.map(({label:a,icon:d,href:x,...p},m)=>{const f=[o.jsxRuntimeExports.jsx(E.yt.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:u.CSS.shade(t)}},`${a}-${m}`)];if(d!=null){const j=Me.resolve(d);j!=null&&f.push(j)}const h={weight:s,shade:t,level:n,style:{marginLeft:d!=null?"0.5rem":"0"},children:a,...p};return x!=null?f.push(o.jsxRuntimeExports.jsx(ve.Link,{...h,href:x},a)):f.push(o.jsxRuntimeExports.jsx(E.Text$1,{...h},a)),f}).flat()},df=({children:e,icon:t,shade:n=7,weight:s,size:r=.5,url:i,level:l="p",separator:c=".",className:a,hideFirst:d=!0,...x})=>{i!=null&&(e=i);const p=Qi({segments:e,separator:c,shade:n,level:l,weight:s});return d&&p.shift(),o.jsxRuntimeExports.jsxs(E.WithIcon,{className:u.CSS(a,u.CSS.B("breadcrumb"),d&&u.CSS.M("hide-first")),level:l,shade:n,weight:s,size:r,direction:"x",...x,children:[Me.resolve(t),...p]})},xf=({url:e,className:t,level:n="p",separator:s="/",weight:r,shade:i=7})=>{const l=Qi({segments:e,separator:s,shade:i,level:n,weight:r,transform:(c,a)=>({...c,label:c.label.split("-").map(d=>u.d.capitalize(d)).join(" "),href:`/${e.split(s).slice(0,a+1).join("/")}`})});return o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(t,u.CSS.B("breadcrumb"),u.CSS.BM("breadcrumb","url")),direction:"x",size:"small",align:"center",children:l})},pf=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:df,URL:xf},Symbol.toStringTag,{value:"Module"})),Io=g.createContext(B.ZERO_CONTEXT_VALUE),Fe=()=>g.useContext(Io).synnax,mf=()=>g.useContext(Io).state,Pr={connected:"success",connecting:"info",disconnected:"info",failed:"error"},el="serverVersionMismatch",ff=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,tl=({children:e,connParams:t})=>{const[n,s,r]=E.useCombinedStateAndRef(B.ZERO_CONTEXT_VALUE),[{path:i},,l]=E.use$3({type:B.Provider.TYPE,schema:B.Provider.stateZ,initialState:{props:t??null,state:null}}),c=E.useAggregator(),a=g.useCallback(d=>{r.current.state.status!==d.status&&c({variant:Pr[d.status],message:d.message??u.d.capitalize(d.status)}),s(x=>({...x,state:d}))},[c]);return E.useAsyncEffect(async()=>{if(n.synnax!=null&&n.synnax.close(),t==null)return s(B.ZERO_CONTEXT_VALUE);const d=new Z.pg({...t,connectivityPollFrequency:Z.S$1.seconds(5)});s({synnax:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(s({synnax:d,state:x}),c({variant:Pr[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||Z.X.semVerOlder(x.nodeVersion,x.clientVersion),m=ff(p,x.clientVersion,x.nodeVersion);c({variant:"warning",message:"Incompatible cluster version",description:m,data:{type:el,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(a),l({props:t,state:x}),()=>{d.close(),s(B.ZERO_CONTEXT_VALUE),l({props:null,state:null})}},[t,a]),o.jsxRuntimeExports.jsx(Io.Provider,{value:n,children:o.jsxRuntimeExports.jsx(E.Composite,{path:i,children:e})})},hf=Object.freeze(Object.defineProperty({__proto__:null,Provider:tl,SERVER_VERSION_MISMATCH:el,use:Fe,useConnectionState:mf},Symbol.toStringTag,{value:"Module"})),Yt=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),nl=()=>g.useContext(Yt),sl=e=>{const{aliases:t}=g.useContext(Yt);return t[e]??null},xs=()=>{const{aliases:e}=g.useContext(Yt);return e},ps=(e,t="")=>{const{getName:n}=g.useContext(Yt),[s,r]=g.useState(t);return E.useAsyncEffect(async()=>{const i=await n(e);r(i)},[e,n]),s??t},$o=()=>{const{activeRange:e}=g.useContext(Yt);return e??void 0},ol=({activeRange:e,children:t})=>{const n=Fe(),[s,r]=g.useState({}),i=g.useCallback(a=>{r(d=>{const x={...d};return a.forEach(({variant:p,key:m,value:f})=>{const h=Number(m.split("---")[1]);p==="delete"?delete x[h]:x[f.channel]=f.alias}),x})},[r]),l=g.useCallback(async(a,d)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(a,d)},[n,e]),c=g.useCallback(async a=>{if(n==null||a===0)return;const d=s[a];return d??(await n.channels.retrieve(a)).name},[s,n]);return E.useAsyncEffect(async()=>{if(n==null||e==null){r({});return}const a=await n.ranges.retrieve(e),d=await a.listAliases();r(d);const x=await a.openAliasTracker(),p=x.onChange(i);return()=>{p(),x.close()}},[n,e]),o.jsxRuntimeExports.jsx(Yt.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},gf=({channelKey:e,value:t,shadow:n,className:s,...r})=>{const[i,l]=g.useState(!1),{setAlias:c}=nl(),a=sl(e),d=ps(e);let x=o.jsxRuntimeExports.jsx(E.yt.Rename,{});i?x=o.jsxRuntimeExports.jsx(E.yt.Loading,{}):a===t&&(x=o.jsxRuntimeExports.jsx(E.yt.Check,{}));const p=c!=null&&!i&&a!==t&&e!==0,m=()=>{p&&(async()=>(l(!0),await c(e,t),l(!1)))()},f=()=>{var j;a!=null&&((j=r.onChange)==null||j.call(r,a))},h=()=>e===0?o.jsxRuntimeExports.jsx(E.Text$1,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?o.jsxRuntimeExports.jsx(E.Text$1,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?o.jsxRuntimeExports.jsx(E.Text$1,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?o.jsxRuntimeExports.jsx(E.Text$1,{level:"small",children:"Alias synced with this label"}):o.jsxRuntimeExports.jsxs(E.Text$1,{level:"small",children:["Sync alias for ",d," with this label"]});return o.jsxRuntimeExports.jsxs(E.Text$2,{value:t,...r,children:[p&&o.jsxRuntimeExports.jsx(E.Icon,{onClick:f,tooltip:o.jsxRuntimeExports.jsxs(E.Text$1,{level:"small",children:["Set ",d," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:o.jsxRuntimeExports.jsx(E.yt.Sync,{})}),o.jsxRuntimeExports.jsx(E.Icon,{onClick:m,disabled:!p,tooltip:o.jsxRuntimeExports.jsx(h,{}),tooltipLocation:{y:"top"},variant:"outlined",children:x})]})},Ye="channel";var Lr=180/Math.PI,ro={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function rl(e,t,n,s,r,i){var l,c,a;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(a=e*n+t*s)&&(n-=e*a,s-=t*a),(c=Math.sqrt(n*n+s*s))&&(n/=c,s/=c,a/=c),e*s<t*n&&(e=-e,t=-t,a=-a,l=-l),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Lr,skewX:Math.atan(a)*Lr,scaleX:l,scaleY:c}}var Mn;function jf(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ro:rl(t.a,t.b,t.c,t.d,t.e,t.f)}function Ef(e){return e==null||(Mn||(Mn=document.createElementNS("http://www.w3.org/2000/svg","g")),Mn.setAttribute("transform",e),!(e=Mn.transform.baseVal.consolidate()))?ro:(e=e.matrix,rl(e.a,e.b,e.c,e.d,e.e,e.f))}function il(e,t,n,s){function r(d){return d.length?d.pop()+" ":""}function i(d,x,p,m,f,h){if(d!==p||x!==m){var j=f.push("translate(",null,t,null,n);h.push({i:j-4,x:B.interpolateNumber(d,p)},{i:j-2,x:B.interpolateNumber(x,m)})}else(p||m)&&f.push("translate("+p+t+m+n)}function l(d,x,p,m){d!==x?(d-x>180?x+=360:x-d>180&&(d+=360),m.push({i:p.push(r(p)+"rotate(",null,s)-2,x:B.interpolateNumber(d,x)})):x&&p.push(r(p)+"rotate("+x+s)}function c(d,x,p,m){d!==x?m.push({i:p.push(r(p)+"skewX(",null,s)-2,x:B.interpolateNumber(d,x)}):x&&p.push(r(p)+"skewX("+x+s)}function a(d,x,p,m,f,h){if(d!==p||x!==m){var j=f.push(r(f)+"scale(",null,",",null,")");h.push({i:j-4,x:B.interpolateNumber(d,p)},{i:j-2,x:B.interpolateNumber(x,m)})}else(p!==1||m!==1)&&f.push(r(f)+"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),c(d.skewX,x.skewX,p,m),a(d.scaleX,d.scaleY,x.scaleX,x.scaleY,p,m),d=x=null,function(f){for(var h=-1,j=m.length,y;++h<j;)p[(y=m[h]).i]=y.x(f);return p.join("")}}}var yf=il(jf,"px, ","px)","deg)"),Sf=il(Ef,", ",")",")"),Rf=1e-12;function Nr(e){return((e=Math.exp(e))+1/e)/2}function Cf(e){return((e=Math.exp(e))-1/e)/2}function bf(e){return((e=Math.exp(2*e))-1)/(e+1)}const wf=function e(t,n,s){function r(i,l){var c=i[0],a=i[1],d=i[2],x=l[0],p=l[1],m=l[2],f=x-c,h=p-a,j=f*f+h*h,y,S;if(j<Rf)S=Math.log(m/d)/t,y=function(k){return[c+k*f,a+k*h,d*Math.exp(t*k*S)]};else{var M=Math.sqrt(j),C=(m*m-d*d+s*j)/(2*d*n*M),b=(m*m-d*d-s*j)/(2*m*n*M),w=Math.log(Math.sqrt(C*C+1)-C),P=Math.log(Math.sqrt(b*b+1)-b);S=(P-w)/t,y=function(k){var T=k*S,A=Nr(w),I=d/(n*M)*(A*bf(t*T+w)-Cf(w));return[c+I*f,a+I*h,d*A/Nr(t*T+w)]}}return y.duration=S*1e3*t/Math.SQRT2,y}return r.rho=function(i){var l=Math.max(.001,+i),c=l*l,a=c*c;return e(l,c,a)},r}(Math.SQRT2,2,4),vf=Object.freeze(Object.defineProperty({__proto__:null,Canvas:B.Canvas,axisStateZ:B.axisStateZ,newTickFactory:B.newTickFactory,tickFactoryProps:B.tickFactoryProps,tickType:B.tickType},Symbol.toStringTag,{value:"Module"})),Mf=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:B.AcquireChannelControl,AuthoritySource:B.AuthoritySource,Chip:B.Chip,Controller:B.Controller$1,Indicator:B.Indicator,Legend:B.Legend,REGISTRY:B.REGISTRY$3,STATUSES:B.STATUSES,SetChannelValue:B.SetChannelValue,StateProvider:B.StateProvider,acquireChannelControl:B.acquireChannelControl,acquireChannelControlPropsZ:B.acquireChannelControlPropsZ,authoritySource:B.authoritySource,authoritySourceProps:B.authoritySourceProps,chipStateZ:B.chipStateZ,controllerStateZ:B.controllerStateZ,indicatorStateZ:B.indicatorStateZ,legendStateZ:B.legendStateZ,setChannelValue:B.setChannelValue,setChannelValuePropsZ:B.setChannelValuePropsZ,stateProviderStateZ:B.stateProviderStateZ,statusZ:B.statusZ,sugaredStateZ:B.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),kf={region:u.Mt.ZERO,dpr:1,os:Z.S.getOS()},_f={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Pf=({children:e,resizeDebounce:t=100,className:n,...s})=>{const[{path:r},{bootstrapped:i,dpr:l},c]=E.use$3({type:B.Canvas$1.TYPE,schema:B.canvasStateZ,initialState:kf}),a=g.useRef({..._f}),d=g.useRef(!1),x=g.useCallback(j=>{a.current.bootstrapped&&(c(()=>({bootstrapped:!0,region:j,dpr:window.devicePixelRatio,os:Z.S.getOS({default:"Windows"})})),d.current=!0)},[c]),p=g.useRef(null),m=E.useResize(x,{debounce:t}),f=E.useCombinedRefs(p,m);g.useEffect(()=>{const j=()=>{window.devicePixelRatio===l||!a.current.bootstrapped||p.current==null||c(y=>({...y,region:u.Mt.construct(p.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",j,{once:!0})},[l]),g.useEffect(()=>{const j=()=>{!a.current.bootstrapped||p.current==null||c(y=>({...y,region:u.Mt.construct(p.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",j),window.addEventListener("blur",j)},[c]);const h=g.useCallback(j=>{if(j==null)return;j.className.includes("gl")?a.current.gl=j:j.className.includes("upper2d")?a.current.upper2d=j:a.current.lower2d=j;const{gl:y,lower2d:S,upper2d:M,bootstrapped:C}=a.current;if(y==null||S==null||M==null||C)return;a.current.bootstrapped=!0;const b=y.transferControlToOffscreen(),w=M.transferControlToOffscreen(),P=S.transferControlToOffscreen();c({glCanvas:b,upper2dCanvas:w,lower2dCanvas:P,bootstrap:!0,bootstrapped:!1,region:u.Mt.construct(y),dpr:window.devicePixelRatio,os:Z.S.getOS({default:"Windows"})},[b,w,P])},[c]);return o.jsxRuntimeExports.jsxs("div",{ref:f,className:u.CSS(u.CSS.B("canvas-container"),n),...s,children:[o.jsxRuntimeExports.jsx("canvas",{ref:h,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","lower2d"))}),o.jsxRuntimeExports.jsx("canvas",{ref:h,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","gl"))}),o.jsxRuntimeExports.jsx("canvas",{ref:h,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","upper2d"))}),o.jsxRuntimeExports.jsx(E.Composite,{path:r,children:i&&e})]})},En=(e,t)=>E.useResize(g.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(u.b.XY.translate(u.G.scale(u.Mt.topLeft(r),-1)).box(n),s)},[e]),t),Lf=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Pf,useRegion:En},Symbol.toStringTag,{value:"Module"})),ll=g.createContext(null),We=e=>{const t=g.useContext(ll);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},cl=e=>{const t=We("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},yn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=We(t),{key:r}=e;return E.useEffectCompare(()=>{u.K.outer.parse(e.loc),n(e)},([c],[a])=>Z._.equal(c,a),[e]),g.useEffect(()=>()=>s(r),[]),{gridArea:u.g.swap(u.K.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},al=({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=u.G.ZERO,children:r,hold:i=!1,onHold:l,visible:c,...a})=>{const[d,x]=g.useState([]),p=E.useMemoDeepEqualProps({clearOverScan:s,hold:i,visible:c}),[{path:m},{grid:f},h]=E.use$3({aetherKey:e,type:B.LinePlot.TYPE,schema:B.linePlotStateZ,initialState:{container:u.Mt.ZERO,viewport:u.Mt.DECIMAL,grid:{},...p}});g.useEffect(()=>h($=>({...$,...p})),[p]);const j=g.useRef(new Map),y=g.useCallback($=>(j.current.set($,null),()=>j.current.delete($)),[j]),S=g.useCallback($=>{const{mode:z,box:R,stage:N}=$;(z==="pan"&&N!=="start"||z==="zoom"||z==="zoomReset"&&N==="start")&&h(_=>({..._,viewport:R})),j.current.forEach((_,D)=>D($))},[h]),M=g.useCallback($=>h(z=>({...z,container:$})),[h]),C=En(M,{debounce:n}),b=g.useCallback($=>h(z=>({...z,grid:{...z.grid,[$.key]:$}})),[h]),w=g.useCallback($=>h(z=>{const{[$]:R,...N}=z.grid;return{...z,grid:N}}),[h]),P=g.useCallback($=>{x(z=>[...z.filter(({key:R})=>R!==$.key),$])},[x,S]),k=g.useCallback($=>x(z=>z.filter(({key:R})=>R!==$)),[P]),T=g.useMemo(()=>Nf(f),[f]),A=g.useCallback($=>{h(z=>({...z,hold:$})),l==null||l($)},[h,l]),I=`line-plot-${e}`,F=g.useMemo(()=>({lines:d,setGridEntry:b,removeGridEntry:w,setLine:P,removeLine:k,setViewport:S,addViewportHandler:y,setHold:A,id:I}),[I,d,b,w,P,k,S,y,A]);return o.jsxRuntimeExports.jsx("div",{id:I,className:u.CSS.B("line-plot"),style:{...t,...T},ref:C,...a,children:o.jsxRuntimeExports.jsx(ll.Provider,{value:F,children:o.jsxRuntimeExports.jsx(E.Composite,{path:m,children:r})})})},Nf=e=>{const t=u.CSS.newGridBuilder();return B.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)"),B.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),B.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)"),B.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},zo=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?B.XAxis.TYPE:B.YAxis.TYPE,s=`${e}-axis`,r=({aetherKey:i,children:l,location:c=t,label:a="",labelLevel:d="small",labelDirection:x=e,onLabelChange:p,color:m,labelSize:f,showGrid:h,type:j,bounds:y,className:S,tickSpacing:M,autoBounds:C,autoBoundUpdateInterval:b,onAutoBoundsChange:w,style:P,...k})=>{const T=((a==null?void 0:a.length)??0)>0,A=E.useUniqueKey(i),I=E.useMemoDeepEqualProps({location:c,showGrid:h,type:j,bounds:y,label:a,labelDirection:x,tickSpacing:M,autoBounds:C,autoBoundUpdateInterval:b}),[{path:F},{size:$,labelSize:z,...R},N]=E.use$3({aetherKey:A,type:n,schema:B.coreAxisStateZ,initialState:I});g.useEffect(()=>N(V=>({...V,...I})),[I]),g.useEffect(()=>{const{lower:V,upper:H}=B.parseAutoBounds(R.autoBounds);R.bounds!=null&&(V&&(y==null?void 0:y.lower)!==R.bounds.lower||H&&(y==null?void 0:y.upper)!==R.bounds.upper)&&(w==null||w(R.bounds))},[R.autoBounds,R.bounds]);const _=yn({loc:c,key:`${n}-${A}`,size:$+z,order:1},`${e.toUpperCase()}Axis`),D=E.useTypography(d).toString(),L=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(a==null)return;let H=Z.dimensions(a,D)[u.g.dimension(u.g.construct(x))];H>0&&(H+=9),N(G=>({...G,labelSize:H}))}else{let H=Z.dimensions(a,D).height*1.3;H>0&&(H+=12);const G=L.current;B.withinSizeThreshold(G,H)||(L.current=H,N(q=>({...q,labelSize:H})))}},[a,x,D]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(S,u.CSS.B("axis"),u.CSS.B(s),u.CSS.loc(c)),style:{...P,..._},align:"center",justify:c!=="left"?"end":"start",direction:u.g.swap(e),...k,children:T&&o.jsxRuntimeExports.jsx(E.MaybeEditable,{className:u.CSS(u.CSS.BE("axis","label"),u.CSS.dir(x)),value:a,onChange:p,level:d})}),o.jsxRuntimeExports.jsx(E.Composite,{path:F,children:l})]})};return r.displayName=`${e.toUpperCase()}Axis`,r},ul=zo("x"),dl=zo("y"),xl=u.G.xy.extend({root:u.K.corner,units:ce.z.object({x:ce.z.enum(["px","decimal"]),y:ce.z.enum(["px","decimal"])})}),Tf=xl.partial({root:!0,units:!0}),Af=e=>{var n,s,r,i;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((s=e==null?void 0:e.units)==null?void 0:s.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((r=e.root)==null?void 0:r.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},If=(e,t)=>{var i,l,c,a,d,x;const n={x:e.x,y:e.y};if(t.current==null)return n;const s=u.Mt.construct(t.current),r=u.Mt.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.x)==="decimal"?((l=e.root)==null?void 0:l.x)==="right"&&(n.x=1-e.x):((c=e.root)==null?void 0:c.x)==="right"?n.x=1-(e.x+u.Mt.width(s))/u.Mt.width(r):n.x/=u.Mt.width(r),((a=e.units)==null?void 0:a.y)==="decimal"?((d=e.root)==null?void 0:d.y)==="bottom"&&(n.y=1-e.y):((x=e.root)==null?void 0:x.y)==="bottom"?n.y=1-(e.y+u.Mt.height(s))/u.Mt.height(r):n.y/=u.Mt.height(r),n},pl=(e,t)=>{if(t.current==null)return null;const n=u.Mt.construct(t.current.parentElement),s=u.Mt.construct(t.current),r={x:e.x,y:e.y,root:{...u.K.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*u.Mt.width(n)-u.Mt.width(s),r.root.x="right"):e.x<.2?r.x=e.x*u.Mt.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*u.Mt.height(n)-u.Mt.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*u.Mt.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...u.G.truncate(r,3)}},Tr=u.Mt.reRoot(u.Mt.DECIMAL,u.K.TOP_LEFT),Bo=g.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,...i})=>{const[l,c]=Z.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:u.K.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),a=g.useRef(l),d=E.useSyncedRef(r===!1),x=g.useRef(null);l!==null&&(s={...s,...Af(l)});const p=g.useCallback(f=>{var b;if(((b=x.current)==null?void 0:b.parentElement)==null)return a.current;const h=u.Mt.construct(x.current.parentElement),j=u.b.XY.scale(h).scale(Tr),y=j.box(u.Mt.construct(x.current)),S=u.b.XY.clamp(u.Mt.construct(u.Mt.topLeft(Tr),{width:1-u.Mt.width(y),height:1-u.Mt.height(y)})),M=u.G.translate(u.G.construct(a.current),u.Mt.signedDims(j.box(f))),C=S.pos(M);return pl(C,x)},[]),m=E.useCursorDrag({onStart:g.useCallback(()=>{a.current=If(a.current,x)},[]),onMove:g.useCallback(f=>{if(d.current)return;const h=p(f);h!==null&&c(h)},[]),onEnd:g.useCallback(f=>{if(d.current)return;const h=p(f);h!==null&&(a.current=h)},[])});return o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(e,u.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:m,draggable:r,ref:x,...i,onDrag:Yn,onDragEnd:Yn,empty:!0})});Bo.displayName="Legend.Container";const Do=(e,t,n)=>e.sort((s,r)=>s.label.localeCompare(r.label)).map(({key:s,color:r,label:i})=>o.jsxRuntimeExports.jsxs(te.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[o.jsxRuntimeExports.jsx(E.Swatch,{value:r,onChange:l=>t==null?void 0:t({key:s,color:l,label:i}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"small"}),o.jsxRuntimeExports.jsx(E.MaybeEditable,{level:"small",value:i,onChange:l=>t==null?void 0:t({key:s,color:r,label:l}),noWrap:!0})]},s)),Oo=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...r})=>{const[i,l]=g.useState(!1);return e.length===0?null:o.jsxRuntimeExports.jsx(Bo,{...r,draggable:!i,value:n,onChange:s,children:Do(e,t,l)})},$f=Object.freeze(Object.defineProperty({__proto__:null,Container:Bo,Simple:Oo,calcStickyPos:pl,completeStickyXYz:xl,legendSwatches:Do,stickyXYz:Tf},Symbol.toStringTag,{value:"Module"})),Vo=g.memo(({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=We("Legend");return We("Legend"),o.jsxRuntimeExports.jsx(Oo,{data:r,onEntryChange:n,...s})});Vo.displayName="FloatingLegend";const zf=({onLineChange:e})=>{const{lines:t}=We("Legend"),n=E.useUniqueKey(),s=yn({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:Do(t,e)})},ml=({variant:e="floating",...t})=>e==="floating"?o.jsxRuntimeExports.jsx(Vo,{...t}):o.jsxRuntimeExports.jsx(zf,{...t}),Fo=g.memo(({aetherKey:e,...t})=>(E.useUnidirectional({aetherKey:e,type:B.Line.TYPE,schema:B.stateZ,state:t}),null));Fo.displayName="Line";const Bf=Object.freeze(Object.defineProperty({__proto__:null,Line:Fo},Symbol.toStringTag,{value:"Module"})),Ho=({aetherKey:e,color:t,label:n="",...s})=>{const r=E.useUniqueKey(e),{setLine:i,removeLine:l}=We("Line");return g.useEffect(()=>(i({key:r,color:t,label:n}),()=>l(r)),[n,t]),o.jsxRuntimeExports.jsx(Fo,{aetherKey:r,color:t,label:n,...s})},fl=({level:e="h2",...t})=>{const n=E.useUniqueKey(),s=E.useTypography(e),r=yn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return o.jsxRuntimeExports.jsx(te.Space,{justify:"center",align:"center",style:r,children:o.jsxRuntimeExports.jsx(E.MaybeEditable,{...t,level:e})})},hl=({aetherKey:e,...t})=>{const n=E.useUniqueKey(e),[,,s]=E.use$3({aetherKey:n,type:B.Tooltip.TYPE,schema:B.tooltipStateZ,initialState:{position:null,...t}}),r=g.useRef(null),i=g.useCallback(c=>{const a=document.querySelector(".pluto-canvas-container");if(a==null)return;const d=u.Mt.topLeft(a);s({position:u.G.translation(d,u.G.construct(c))})},[s]),l=g.useCallback(()=>s({position:null}),[s]);return g.useEffect(()=>{if(r.current===null)return;const c=r.current.parentElement;if(c!=null)return c.addEventListener("mousemove",i),c.addEventListener("mouseleave",l),()=>{c.removeEventListener("mousemove",i),c.removeEventListener("mouseleave",l)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:r})},Df=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:hl},Symbol.toStringTag,{value:"Module"})),Of={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},gl=({className:e,mode:t,maskBox:n,children:s,style:r,...i})=>o.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.noSelect,u.CSS.BE("viewport-mask","container"),e),style:{cursor:Of[t],...r},...i,children:[o.jsxRuntimeExports.jsx("div",{style:{...u.Mt.css(n),display:u.Mt.areaIsZero(n)?"none":"block"},className:u.CSS.BE("viewport-mask","selection")}),s]}),Vf=[{key:"start",icon:o.jsxRuntimeExports.jsx(E.yt.TextAlign.Left,{})},{key:"center",icon:o.jsxRuntimeExports.jsx(E.yt.TextAlign.Center,{})},{key:"end",icon:o.jsxRuntimeExports.jsx(E.yt.TextAlign.Right,{})}],Ff=({key:e,entry:t,onClick:n,selected:s})=>o.jsxRuntimeExports.jsx(E.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),ms=({children:e=Ff,...t})=>o.jsxRuntimeExports.jsx(ve.Button,{...t,allowMultiple:!1,data:Vf,children:e}),Hf=[{key:"large",label:"L"},{key:"medium",label:"M"},{key:"small",label:"S"}],jl=({children:e,...t})=>o.jsxRuntimeExports.jsx(ve.Button,{...t,data:Hf,entryRenderKey:"label",children:e}),Zf=new Set([Z.g.UUID,Z.g.JSON]),El=Z.g.ALL.filter(e=>e!==Z.g.UNKNOWN).map(e=>({key:e.toString(),name:Zf.has(e)?e.toString().toUpperCase():u.d.capitalize(e.toString())})),Gf=El.filter(e=>!new Z.g(e.key).isVariable),Yf=[{key:"name",name:"Name"}],Wf=({hideVariableDensity:e=!1,...t})=>o.jsxRuntimeExports.jsx(ve.DropdownButton,{...t,data:e?Gf:El,columns:Yf,entryRenderKey:"name"}),Kf=[{key:"x",icon:o.jsxRuntimeExports.jsx(E.yt.Arrow.Right,{})},{key:"y",icon:o.jsxRuntimeExports.jsx(E.yt.Arrow.Up,{})}],Xf=[{key:"x",icon:o.jsxRuntimeExports.jsx(E.yt.Arrow.Right,{})},{key:"y",icon:o.jsxRuntimeExports.jsx(E.yt.Arrow.Down,{})}],qf=({key:e,entry:t,onClick:n,selected:s})=>o.jsxRuntimeExports.jsx(E.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),yl=({children:e=qf,yDirection:t="up",...n})=>o.jsxRuntimeExports.jsx(ve.Button,{...n,allowMultiple:!1,data:t==="up"?Kf:Xf,children:e}),Sl=e=>o.jsxRuntimeExports.jsx(E.Icon,{className:u.CSS.BE("select","clear"),variant:"outlined",...e,children:o.jsxRuntimeExports.jsx(E.yt.Close,{"aria-label":"clear"})}),xt=({onChange:e,value:t,entryRenderKey:n="key",columns:s,data:r,emptyContent:i,inputProps:l,allowNone:c=!0,searcher:a,className:d,variant:x="button",hideColumnHeader:p=!1,disabled:m,omit:f,children:h,dropdownVariant:j="connected",placeholder:y=fs,inputPlaceholder:S=y,triggerTooltip:M,dropdownZIndex:C,filter:b,actions:w,...P})=>{const{visible:k,open:T,close:A,toggle:I}=E.use$2(),[F,$]=g.useState(null),z=a!=null;E.useAsyncEffect(async()=>{if(E.selectValueIsZero(t))return $(null);if((F==null?void 0:F.key)===t)return;let L=null;if(z)try{[L]=await a.retrieve([t])}finally{L??(L=null)}else r!=null&&(L=r.find(V=>V.key===t)??null);$(L)},[a,t,r]);const R=g.useCallback((L,V)=>{Array.isArray(L)||($(L==null?null:V.entries[0]),A(),e(L,V))},[e,c]),N=g.useMemo(()=>z?E.Search:Gt.Filter,[z]),_=o.jsxRuntimeExports.jsx(N,{searcher:a,filter:b,children:({onChange:L})=>o.jsxRuntimeExports.jsx(Uf,{...l,autoFocus:j==="modal",variant:x,onChange:L,onFocus:T,selected:F,entryRenderKey:n,visible:k,allowNone:c,className:d,dropdownVariant:j,disabled:m,placeholder:S,children:w})}),D=o.jsxRuntimeExports.jsx(E.Button,{tooltip:M,variant:"outlined",onClick:I,disabled:m,children:F!=null?Rl(n,F):y});return o.jsxRuntimeExports.jsx(ve.Core,{close:A,zIndex:C,open:T,data:r,omit:f,emptyContent:i,allowMultiple:!1,visible:k,value:t,hideColumnHeader:p,onChange:R,allowNone:c,columns:s,listItem:h,variant:j,trigger:j!=="modal"?_:D,extraDialogContent:j==="modal"?_:void 0,keepMounted:!1,...P})},fs="Select",Rl=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),Uf=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:r,allowNone:i=!0,placeholder:l=fs,className:c,disabled:a,dropdownVariant:d,children:x,...p})=>{const{clear:m}=E.useSelectionUtils(),[f,h]=g.useState("");g.useEffect(()=>{if(!n){if(Z.w$1(t==null?void 0:t.key))return h("");t!=null&&h(Rl(e,t))}},[t,n,e]);const j=b=>{s(b),h(b)},y=()=>{f===""&&s(""),h(""),r==null||r()},S=b=>{n||(b.preventDefault(),r==null||r())},M=()=>{h(""),m==null||m()};let C;return d!=="modal"&&(C=o.jsxRuntimeExports.jsx(_o.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n})),o.jsxRuntimeExports.jsxs(E.Text$2,{className:u.CSS(u.CSS.BE("select","input"),c),value:f,onChange:j,onFocus:y,onKeyDown:E.matchCallback([["Enter"]],b=>{b.preventDefault(),!n&&(r==null||r())}),endContent:C,style:{flexGrow:1},onClick:S,placeholder:l,disabled:a,...p,children:[x,i&&o.jsxRuntimeExports.jsx(Sl,{onClick:M,disabled:a})]})},an=({children:e="",size:t="medium",color:n,icon:s,onClose:r,className:i,onDragStart:l,...c})=>{const a=u.cssString(n);s==null&&n!=null&&(s=o.jsxRuntimeExports.jsx(E.yt.Circle,{fill:a}));const d=r==null?void 0:o.jsxRuntimeExports.jsx(E.Icon,{"aria-label":"close",size:"small",className:u.CSS.BE("tag","close"),onClick:x=>{x.stopPropagation(),r()},children:o.jsxRuntimeExports.jsx(E.yt.Close,{})});return o.jsxRuntimeExports.jsx(E.WithIcon,{startIcon:s,endIcon:d,className:u.CSS(i,u.CSS.B("tag"),r!=null&&u.CSS.BM("tag","closeable")),level:Z.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:l,...c,children:e})},Jf=Object.freeze(Object.defineProperty({__proto__:null,Tag:an},Symbol.toStringTag,{value:"Module"})),Zo=({entryKey:e,entryRenderKey:t,entry:n,loading:s,...r})=>{let i=e;return n!=null&&(i=typeof t=="function"?t(n):n[t]),g.createElement(an,{size:"small",variant:"outlined",className:u.CSS(n==null&&!s&&u.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},Z.Y(i))},Qf=E.componentRenderProp(Zo),Wt=({onChange:e,value:t,className:n,data:s,columns:r=[],entryRenderKey:i="key",emptyContent:l,searcher:c,renderTag:a=Qf,placeholder:d,onTagDragStart:x,allowMultiple:p,allowNone:m,replaceOnSingle:f,onTagDragEnd:h,style:j,addPlaceholder:y="Add",children:S,dropdownVariant:M="connected",actions:C,...b})=>{const{visible:w,open:P,close:k}=E.use$2(),[T,A]=g.useState([]),[I,F]=g.useState(!1),$=c!=null;E.useAsyncEffect(async()=>{F(!0),E.selectValueIsZero(t)&&A([]);const D=T.map(H=>H.key),L=Z.A(t);if(Z.F.unorderedPrimitiveArrays(D,L)===Z.F.EQUAL)return;let V=[];if($)try{V=await c.retrieve(L)}finally{F(!1)}else s!=null&&(V=s.filter(H=>L.includes(H.key)));A(V)},[c,$,t,s]);const z=g.useCallback((D,L)=>{D!=null&&(A(L.entries),e(Z.A(D),L))},[e]),R=g.useMemo(()=>$?E.Search:Gt.Filter,[$]);let N,_;if(M==="connected")_=o.jsxRuntimeExports.jsx(R,{searcher:c,children:({onChange:D,value:L})=>o.jsxRuntimeExports.jsx(eh,{dropdownVariant:M,value:L,selectedKeys:t,className:n,onChange:D,loading:I,selected:T,onFocus:P,entryRenderKey:i,visible:w,renderTag:a,placeholder:d,onTagDragStart:x,onTagDragEnd:h,style:j,children:C})});else{const D=Z.A(t);_=o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",grow:!0,style:j,size:"small",children:[D.map(L=>{const V=T.find(H=>H.key===L);return a({key:L,entryKey:L,entryRenderKey:i,loading:I,entry:V,onClose:()=>{const H=D.filter(G=>G!==L);e(H,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:H=>x==null?void 0:x(H,L),onDragEnd:H=>h==null?void 0:h(H,L)})}),D.length>0?o.jsxRuntimeExports.jsx(E.Icon,{onClick:P,children:o.jsxRuntimeExports.jsx(E.yt.Add,{style:{color:"var(--pluto-gray-l7)"}})}):o.jsxRuntimeExports.jsx(E.Button,{onClick:P,shade:7,startIcon:o.jsxRuntimeExports.jsx(E.yt.Add,{}),variant:"text",children:y})]}),N=o.jsxRuntimeExports.jsx(R,{searcher:c,children:L=>o.jsxRuntimeExports.jsx(E.Text$2,{autoFocus:!0,placeholder:"Search",...L,children:C})})}return o.jsxRuntimeExports.jsx(ve.Core,{close:k,open:P,data:s,emptyContent:l,visible:w,value:t,onChange:z,allowNone:m,replaceOnSingle:f,columns:r,allowMultiple:!0,listItem:S,trigger:_,extraDialogContent:N,variant:M,...b})},eh=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:r,visible:i,entryRenderKey:l,renderTag:c,placeholder:a=fs,onTagDragStart:d,onTagDragEnd:x,value:p,className:m,children:f,dropdownVariant:h,...j})=>{const{onSelect:y,clear:S}=E.useSelectionUtils(),M=g.useRef(null);g.useLayoutEffect(()=>{var k;i&&((k=M.current)==null||k.focus())},[i,n]);const C=()=>{i||s(""),r==null||r()},b=()=>{i||r==null||r()},w=()=>{i||s("")};let P;return h!=="modal"&&(P=o.jsxRuntimeExports.jsx(_o.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:i})),o.jsxRuntimeExports.jsxs(E.Text$2,{ref:M,className:u.CSS(u.CSS.BE("select-multiple","input"),u.CSS.visible(i),m),onBlur:w,placeholder:a,value:p,onChange:s,onFocus:C,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:b,endContent:P,variant:"button",...j,children:[o.jsxRuntimeExports.jsx(te.Space,{direction:"x",className:u.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:Z.A(e).map(k=>{const T=n.find(A=>A.key===k);return c({key:k,entryKey:k,entryRenderKey:l,loading:t,entry:T,onClose:()=>y==null?void 0:y(k),onDragStart:A=>d==null?void 0:d(A,k),onDragEnd:A=>x==null?void 0:x(A,k)})})}),f,o.jsxRuntimeExports.jsx(Sl,{onClick:S})]})},th=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:ve.BaseButton,Button:ve.Button,ComponentSize:jl,DEFAULT_PLACEHOLDER:fs,DataType:Wf,Direction:yl,DropdownButton:ve.DropdownButton,Multiple:Wt,MultipleTag:Zo,Single:xt,TextAlignment:ms,defaultButton:ve.defaultButton},Symbol.toStringTag,{value:"Module"})),Dn=6,nh=2,Ar=5,sh=e=>u.Mt.width(e)<Ar&&u.Mt.height(e)<Ar,oh=["zoom","pan","select","zoomReset"],on=[...oh,"click"],rh=ce.z.enum(on),Cl=["zoom","select"],On={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},bl={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},wl={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Go={zoom:On,pan:bl,select:wl,zoomReset:On,click:On},ih=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},lh=u.Mt.construct(0,0,1,1,u.K.TOP_LEFT),ch={width:30,height:50},vl=({onChange:e,triggers:t,initial:n=lh,threshold:s=ch,ref:r})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[l,c]=g.useState(u.Mt.ZERO),[a,d]=g.useState(i),[x,p]=E.useStateRef(n),m=g.useRef(u.G.ZERO),f=g.useRef(null),h=u._.construct(s);g.useEffect(()=>p(()=>u.Mt.truncate(n,Dn)),[n]),g.useEffect(()=>d(i),[i]);const[j,y,S,M]=E.useMemoCompare(()=>{const T={...Go[i],...t},A=E.flattenConfig(T),I=ih(T);return[T,A,I,E.flattenConfig(I)]},E.compareModeConfigs,[t]),C=g.useCallback(({box:T,triggers:A,stage:I,cursor:F})=>{if(f.current==null)return;const $=E.determineMode(j,A),z=u.Mt.construct(f.current);if($==null)return;if($==="zoomReset")return c(u.Mt.ZERO),e==null||e({box:u.Mt.DECIMAL,mode:$,stage:I,cursor:F}),p(u.Mt.DECIMAL);const R=sh(T);if(I==="end"){if(R){$==="zoom"&&c(u.Mt.ZERO),e==null||e({box:x.current,mode:"click",stage:I,cursor:F});return}return p(_=>{if($==="pan"){const L=Ir(T,_,z);return L===null||u.Mt.equals(L,_)?_:(e==null||e({box:L,mode:$,stage:I,cursor:F}),L)}const D=b(T,_,z);return D===null?_:(e==null||e({box:D,mode:$,stage:I,cursor:F}),$==="zoom"?(c(u.Mt.ZERO),D):u.Mt.truncate(_,Dn))})}if(Cl.includes($))return R?void 0:c(u.b.XY.scale(z).clamp(z).translate({x:-u.Mt.left(z),y:-u.Mt.top(z)}).box($r(h,T,z)));if(c(_=>u.Mt.areaIsZero(_)?_:u.Mt.ZERO),u.G.distance(F,m.current)<nh)return;m.current=F;const N=Ir(T,x.current,z);e==null||e({box:N,mode:$,stage:I,cursor:F})},[c,d,e,j,s.height,s.width,p,f]);g.useImperativeHandle(r,()=>({reset:()=>{c(u.Mt.ZERO),p(u.Mt.DECIMAL),e==null||e({box:u.Mt.DECIMAL,mode:"zoomReset",stage:"start",cursor:u.G.ZERO})}}),[e]);const b=g.useCallback((T,A,I)=>u.Mt.truncate(io(A,I).box($r(h,T,I)),Dn),[s]),w=E.useHeldRef({triggers:[["Control"]]}),P=E.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const T=A=>{if(f.current==null)return;let I=1;A.deltaY<0?I-=.035:I+=.035;const F=u.Mt.construct(f.current),$=u.G.construct(A);if(Array.from(f.current.children).push(f.current),!u.Mt.contains(F,$)||f.current!==A.target&&E.findParent(A.target,L=>L===f.current)==null)return;const N=io(x.current,u.Mt.construct(f.current)).pos(u.G.construct(A));let D=u.b.XY.magnify({x:w.current.held?1:I,y:P.current.held?1:I}).box(x.current);D=u.Mt.translate(D,{x:w.current.held?0:N.x*(1-I),y:P.current.held?0:N.y*(1-I)}),p(D),e==null||e({stage:"end",box:D,cursor:u.G.construct(A),mode:"zoom"})};return window.addEventListener("wheel",T),()=>window.removeEventListener("wheel",T)},[p,e]),Ki.useDrag({bound:f,onDrag:C,triggers:y,loose:!0});const k=g.useCallback(({triggers:T,stage:A})=>{if(A==="end")return d(i);const I=E.determineMode(S,T);I!=null&&d(I)},[S,i,e]);return E.use$1({triggers:M,callback:k,region:f}),{maskBox:l,ref:f,mode:a}},io=(e,t)=>u.b.XY.scale(t).clamp(t).scale(e),Ir=(e,t,n)=>{let s=u.Mt.signedDims(io(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},u.Mt.truncate(u.b.XY.translate(u.G.construct(s)).box(t),Dn)},$r=(e,t,n)=>u.Mt.height(t)<=e.height?u.Mt.construct(u.Mt.left(t),u.Mt.top(n),u.Mt.width(t),u.Mt.height(n)):u.Mt.width(t)<=e.width?u.Mt.construct(u.Mt.left(n),u.Mt.top(t),u.Mt.width(n),u.Mt.height(t)):t,ah=({mode:e,triggers:t})=>o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",children:[o.jsxRuntimeExports.jsx(E.Text$1,{level:"small",children:u.d.capitalize(e)}),o.jsxRuntimeExports.jsx(te.Space,{empty:!0,direction:"x",align:"center",children:o.jsxRuntimeExports.jsx(E.Text,{trigger:t[0],level:"small"})})]}),uh={zoom:o.jsxRuntimeExports.jsx(E.yt.Zoom,{}),pan:o.jsxRuntimeExports.jsx(E.yt.Pan,{}),select:o.jsxRuntimeExports.jsx(E.yt.Selection,{}),zoomReset:o.jsxRuntimeExports.jsx(E.yt.Expand,{}),click:o.jsxRuntimeExports.jsx(E.yt.Bolt,{})},dh=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([r])=>!t.includes(r)&&on.includes(r)).map(([r,i])=>({key:r,icon:uh[r],tooltip:o.jsxRuntimeExports.jsx(ah,{mode:r,triggers:i})})).sort((r,i)=>on.indexOf(r.key)-on.indexOf(i.key));return o.jsxRuntimeExports.jsx(ve.Button,{...n,data:s,entryRenderKey:"icon",children:({title:r,entry:i,...l})=>g.createElement(E.Icon,{...l,key:i.key,variant:l.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},xh=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Go,MASK_MODES:Cl,MODES:on,Mask:gl,PAN_DEFAULT_TRIGGERS:bl,SELECT_DEFAULT_TRIGGERS:wl,SelectMode:dh,ZOOM_DEFAULT_TRIGGERS:On,modeZ:rh,use:vl},Symbol.toStringTag,{value:"Module"})),ph=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,Ml=({ref:e,children:t,initial:n=u.Mt.DECIMAL,onChange:s,...r})=>{const{setViewport:i}=We("Viewport");g.useLayoutEffect(()=>{i({box:n,mode:"zoom",cursor:u.G.ZERO,stage:"start"})},[i,n]);const l=g.useCallback(a=>{i(a),s==null||s(a)},[s,i]),c=vl({onChange:l,initial:n,ref:e,...r});return o.jsxRuntimeExports.jsx(gl,{className:u.CSS.BE("line-plot","viewport"),...c,children:t})},mh=Object.freeze(Object.defineProperty({__proto__:null,Floating:Vo,Legend:ml,Line:Ho,LinePlot:al,Title:fl,Tooltip:Df,Viewport:Ml,XAxis:ul,YAxis:dl,axisFactory:zo,selectViewportEl:ph,useContext:We,useGridEntry:yn,useViewport:cl},Symbol.toStringTag,{value:"Module"})),fh=({aetherKey:e,...t})=>(E.use$3({aetherKey:e,type:B.Annotation.TYPE,schema:B.annotationStateZ,initialState:t}),null),kl=({aetherKey:e,menu:t,...n})=>{const s=E.useUniqueKey(e),{setViewport:r,setHold:i}=We("Range.Provider"),[,{hovered:l,count:c},a]=E.use$3({aetherKey:s,type:B.Provider$1.TYPE,schema:B.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),d=yn({key:s,loc:"top",size:c>0?32:0,order:3},"Annotation.Provider"),x=E.useContextMenu(),p=E.useSyncedRef(x.visible),m=g.useCallback(f=>{const h=y=>{a(S=>({...S,cursor:{x:y.clientX,y:y.clientY}}))},j=f.currentTarget;j.addEventListener("mousemove",h),j.addEventListener("mouseleave",()=>{j.removeEventListener("mousemove",h),p.current||a(y=>({...y,cursor:null}))},{once:!0})},[a]);return o.jsxRuntimeExports.jsx(E.ContextMenu,{style:{...d,cursor:l!=null?"pointer":"default"},...x,menu:()=>t==null||l==null?null:t(l),children:o.jsxRuntimeExports.jsx(te.Space,{style:{width:"100%",height:"100%"},onClick:()=>{l!=null&&(r({box:u.Mt.construct({x:l.viewport.lower,y:0},{x:l.viewport.upper,y:1}),mode:"zoom",cursor:u.G.ZERO,stage:"start"}),i(!0))},onMouseEnter:m})})},hh=Object.freeze(Object.defineProperty({__proto__:null,Annotation:fh,Provider:kl},Symbol.toStringTag,{value:"Module"})),_l={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},gh=E.flattenConfig(_l),Pl=({aetherKey:e})=>{const t=E.useUniqueKey(e),[,,n]=E.use$3({aetherKey:t,type:B.Measure.TYPE,schema:B.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=g.useRef(null),r=E.useHeldRef({triggers:gh,loose:!0}),i=g.useCallback(({mode:a,cursor:d})=>{if(a==="click"){const x=E.determineMode(_l,r.current.triggers,{loose:!0});if(["one","two"].includes(x))return n(p=>({...p,[x]:d}));n(x==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??d,two:p.one!==null?d:p.two}))}},[n,r]);cl(i);const l=g.useCallback(a=>n(d=>({...d,hover:u.G.construct(a)})),[n]),c=g.useCallback(()=>{n(a=>({...a,hover:null}))},[n]);return g.useEffect(()=>{if(s.current===null)return;const a=s.current.parentElement;if(a!=null)return a.addEventListener("mousemove",l),a.addEventListener("mouseleave",c),()=>{a.removeEventListener("mousemove",l),a.removeEventListener("mouseleave",c)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:s})},jh=Object.freeze(Object.defineProperty({__proto__:null,Measure:Pl},Symbol.toStringTag,{value:"Module"})),Yo=({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:r,onUnitsChange:i,units:l="",color:c,lineWidth:a,lineDash:d,className:x,onSelect:p,style:m,...f})=>{const[h,j]=Z.usePurePassthrough({value:t,onChange:s,initial:""}),y=E.useSyncedRef(r),[,{pixelPosition:S},M]=E.use$3({aetherKey:e,type:B.Rule.TYPE,schema:B.ruleStateZ,initialState:{color:c,dragging:!1,position:n,lineWidth:a,lineDash:d},onAetherChange:g.useCallback(({position:z})=>{var R;z!=null&&((R=y.current)==null||R.call(y,z))},[y])}),C=g.useRef(S);S!==C.current&&(C.current=S);const{id:b}=We("Rule"),w=document.getElementById(b),P=w==null?void 0:w.querySelector(".pluto-line-plot__viewport"),k=g.useRef(S);g.useEffect(()=>{M(z=>({...z,position:n,color:c,lineWidth:a,lineDash:d}))},[n,c,a,d]);const T=E.useCursorDrag({onStart:g.useCallback(()=>{p==null||p(),M(z=>({...z,dragging:!0})),k.current=C.current},[]),onMove:z=>{M(R=>({...R,pixelPosition:(k.current??0)+u.Mt.signedHeight(z)}))},onEnd:g.useCallback(()=>{M(z=>({...z,dragging:!1})),k.current=S},[])}),A=g.useRef(null);if(n==null||S==null)return null;const F=new u.Color(c).pickByContrast("#000000","#ffffff"),$=o.jsxRuntimeExports.jsxs("div",{ref:A,className:u.CSS.B("rule"),style:{top:`calc(${S}px - 0.5rem)`},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("rule","drag-handle"),onDragStart:T,draggable:!0}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",className:u.CSS(x,u.CSS.BE("rule","tag")),bordered:!0,onClick:p,size:1,rounded:!0,style:{borderColor:u.cssString(c),backgroundColor:new u.Color(c).setAlpha(.7).hex,...m},...f,children:[o.jsxRuntimeExports.jsx(E.Editable,{className:u.CSS.B("label"),level:"small",value:h,onChange:j,color:F}),o.jsxRuntimeExports.jsx(E.Divider,{direction:"y",style:{borderColor:u.cssString(c)}}),o.jsxRuntimeExports.jsxs(te.Space,{size:"small",direction:"x",align:"center",children:[o.jsxRuntimeExports.jsx(E.Editable,{value:n.toFixed(2),onChange:z=>{const R=Number(z);isFinite(R)&&(r==null||r(R))},level:"small",color:F}),o.jsxRuntimeExports.jsx(E.MaybeEditable,{level:"small",color:F,value:l,onChange:i})]})]})]});return P==null?$:Po.createPortal($,P)},Eh=Object.freeze(Object.defineProperty({__proto__:null,Rule:Yo},Symbol.toStringTag,{value:"Module"})),Ll=E.canDropOfType(Ye),yh=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:r,showLegend:i=!0,legendPosition:l,onLegendPositionChange:c,titleLevel:a="h4",onLineChange:d,onRuleChange:x,onAxisChannelDrop:p,onAxisChange:m,rules:f,enableTooltip:h=!0,enableMeasure:j=!1,initialViewport:y=u.Mt.DECIMAL,legendVariant:S,onViewportChange:M,viewportTriggers:C,annotationProvider:b,onSelectRule:w,...P})=>{var F;const k=t.filter(({location:$})=>u.K.isY($)),T=g.useRef(null),A=E.usePrevious(e.length),I=E.usePrevious(P.hold);return(A===0&&e.length!==0||I===!0&&P.hold===!1)&&((F=T.current)==null||F.reset()),o.jsxRuntimeExports.jsxs(al,{...P,children:[k.map(($,z)=>{const R=e.filter(D=>D.axes.x===$.key),N=t.filter(({location:D})=>u.K.isX(D)),_=f==null?void 0:f.filter(D=>[...N.map(({key:L})=>L),$.key].includes(D.axis));return o.jsxRuntimeExports.jsx(Sh,{axis:$,index:z,lines:R,yAxes:N,rules:_,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:b,onRuleChange:x,onSelectRule:w},$.key)}),i&&o.jsxRuntimeExports.jsx(ml,{onLineChange:d,position:l,onPositionChange:c,variant:S}),n&&o.jsxRuntimeExports.jsx(fl,{value:s,onChange:r,level:a}),o.jsxRuntimeExports.jsxs(Ml,{initial:y,onChange:M,triggers:C,ref:T,children:[h&&o.jsxRuntimeExports.jsx(hl,{}),j&&o.jsxRuntimeExports.jsx(Pl,{})]})]})},Sh=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:r,onSelectRule:i,onAxisChannelDrop:l,onAxisChange:c,axis:{location:a,key:d,showGrid:x,...p},annotationProvider:m})=>{const f=E.useDrop({type:"Channel.LinePlot.XAxis",canDrop:Ll,onDrop:g.useCallback(({items:y})=>{const S=E.filterByType(Ye,y);return l==null||l(d,S.map(({key:M})=>M)),S},[d,l])}),h=s==null?void 0:s.filter(y=>y.axis===d),j=E.useDraggingState();return o.jsxRuntimeExports.jsxs(ul,{...p,...f,location:a,showGrid:x??n===0,className:u.CSS(u.CSS.dropRegion(E.canDropOfType(Ye)(j))),onAutoBoundsChange:y=>c==null?void 0:c({key:d,bounds:y}),children:[e.map((y,S)=>{const M=t.filter(b=>b.axes.y===y.key),C=s==null?void 0:s.filter(b=>b.axis===y.key);return o.jsxRuntimeExports.jsx(Ch,{axis:{...y,showGrid:x??(n===0&&S===0)},lines:M,rules:C,onRuleChange:r,onAxisChannelDrop:l,onAxisChange:c,onSelectRule:i},y.key)}),h==null?void 0:h.map(y=>g.createElement(Yo,{aetherKey:y.key,...y,key:y.key,onLabelChange:S=>r==null?void 0:r({key:y.key,label:S}),onPositionChange:S=>r==null?void 0:r({key:y.key,position:S}),onUnitsChange:S=>r==null?void 0:r({key:y.key,units:S}),onSelect:()=>i==null?void 0:i(y.key)})),o.jsxRuntimeExports.jsx(kl,{...m})]})},Rh=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Ch=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:i,location:l,...c},onSelectRule:a})=>{const d=E.useDrop({type:"Channel.LinePlot.YAxis",canDrop:Ll,onDrop:g.useCallback(({items:p})=>{const m=E.filterByType(Ye,p);return s==null||s(i,m.map(({key:f})=>f)),m},[i,s])}),x=E.useDraggingState();return o.jsxRuntimeExports.jsxs(dl,{...c,...d,location:l,className:u.CSS(u.CSS.dropRegion(E.canDropOfType(Ye)(x))),onAutoBoundsChange:p=>r==null?void 0:r({key:i,bounds:p}),children:[e.map(p=>o.jsxRuntimeExports.jsx(bh,{line:p},Rh(p))),t==null?void 0:t.map(p=>g.createElement(Yo,{aetherKey:p.key,...p,key:p.key,onLabelChange:m=>n==null?void 0:n({key:p.key,label:m}),onPositionChange:m=>n==null?void 0:n({key:p.key,position:m}),onUnitsChange:m=>n==null?void 0:n({key:p.key,units:m}),onClick:()=>a==null?void 0:a(p.key)}))]})},bh=({line:e})=>e.variant==="static"?o.jsxRuntimeExports.jsx(vh,{line:e}):o.jsxRuntimeExports.jsx(wh,{line:e}),wh=({line:{key:e,timeSpan:t,channels:{x:n,y:s},axes:r,...i}})=>{const{xTelem:l,yTelem:c}=g.useMemo(()=>{const a=Number(t.valueOf())*3,d=B.streamChannelData({timeSpan:t,channel:s,keepFor:a}),x=n!=null&&n!==0;return{xTelem:B.streamChannelData({timeSpan:t,channel:x?n:s,useIndexOfChannel:!x,keepFor:a}),yTelem:d}},[t.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(Ho,{aetherKey:e,y:c,x:l,...i})},vh=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const{xTelem:i,yTelem:l}=g.useMemo(()=>{const c=B.channelData({timeRange:e,channel:s}),a=n!=null&&n!==0;return{xTelem:B.channelData({timeRange:e,channel:a?n:s,useIndexOfChannel:!a}),yTelem:c}},[e.start.valueOf(),e.end.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(Ho,{aetherKey:t,y:l,x:i,...r})},zr=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Wn=({items:e},t)=>{const n=E.filterByType(Ye,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Nl=["name","alias"],Tl=e=>{const t=xs();return g.useMemo(()=>e.length===0?zr:zr.filter(n=>e.includes(n.key)),[e,t])},Al=e=>{if(e==null)return o.jsxRuntimeExports.jsx(E.yt.Channel,{});if(Z.zg.isCalculated(e))return o.jsxRuntimeExports.jsx(E.yt.Calculation,{});if(e.isIndex)return o.jsxRuntimeExports.jsx(E.yt.Index,{});const t=new Z.g(e.dataType);return t.isInteger?o.jsxRuntimeExports.jsx(E.yt.Binary,{}):t.isFloat?o.jsxRuntimeExports.jsx(E.yt.Decimal,{}):t.equals(Z.g.STRING)?o.jsxRuntimeExports.jsx(E.yt.String,{}):t.equals(Z.g.JSON)?o.jsxRuntimeExports.jsx(E.yt.JSON,{}):o.jsxRuntimeExports.jsx(E.yt.Channel,{})},Mh=({key:e,...t})=>o.jsxRuntimeExports.jsx(Zo,{icon:Al(t.entry),...t},e),kh=({columns:e=Nl,onChange:t,className:n,value:s,searchOptions:r,...i})=>{const l=Fe(),c=xs(),a=Tl(e),d=$o(),x=E.useMemoDeepEqualProps(r),p=g.useMemo(()=>l==null?void 0:l.channels.newSearcherWithOptions({rangeKey:d,internal:!1,...x}),[l,d,x]),m=l!=null?void 0:o.jsxRuntimeExports.jsx(E.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:f,onDragEnd:h,...j}=E.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(b=>Wn(b,Z.A(s)),[s]),onDrop:g.useCallback(({items:b})=>{const w=E.filterByType(Ye,b);if(w.length===0)return[];const P=Z.c.unique([...Z.A(s),...w.map(k=>k.key)]);return t(P,{clickedIndex:null,clicked:null,entries:[]}),w},[t,s])}),y=E.useDraggingState(),S=g.useCallback(({dropped:b})=>{t(Z.A(s).filter(w=>!b.some(P=>P.key===w)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),M=g.useCallback((b,w)=>f([{key:w,type:Ye}],S),[f,S]),C=g.useCallback(b=>c[b.key]??b.name,[c]);return o.jsxRuntimeExports.jsx(Wt,{className:u.CSS(n,u.CSS.dropRegion(Wn(y,Z.A(s)))),value:s,onTagDragStart:M,onTagDragEnd:h,searcher:p,onChange:t,columns:a,emptyContent:m,entryRenderKey:C,renderTag:Mh,...j,...i})},Ct=({columns:e=Nl,onChange:t,value:n,className:s,data:r,searchOptions:i,...l})=>{const c=Fe(),a=xs(),d=Tl(e),x=$o(),p=E.useMemoDeepEqualProps(i),m=g.useMemo(()=>{if(!(r!=null&&r.length>0))return c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:x,internal:!1,...p})},[c,x,r==null?void 0:r.length,p]),f=c!=null?void 0:o.jsxRuntimeExports.jsx(E.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),j=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:y,onDragEnd:S,...M}=E.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(P=>Wn(P,Z.o$1(n)),[n]),onDrop:g.useCallback(({items:P})=>{const k=E.filterByType(Ye,P);return k.length===0?[]:(t(k[0].key,{clickedIndex:null,clicked:null,entries:[]}),k)},[j,t])}),C=E.useDraggingState(),b=g.useCallback(()=>n!=null&&y([{type:Ye,key:n}]),[y,n]),w=g.useCallback(P=>a[P.key]??P.name,[a]);return o.jsxRuntimeExports.jsx(xt,{data:r,className:u.CSS(s,u.CSS.dropRegion(Wn(C,Z.o$1(n)))),value:n,onDragStart:b,onDragEnd:S,onChange:t,searcher:m,columns:d,emptyContent:f,entryRenderKey:w,...M,...l})},_h=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:gf,AliasProvider:ol,LinePlot:yh,SelectMultiple:kh,SelectSingle:Ct,resolveIcon:Al,useActiveRange:$o,useAlias:sl,useAliases:xs,useContext:nl,useName:ps},Symbol.toStringTag,{value:"Module"})),pt=({path:e,optional:t=!1,onChange:n})=>{const s=tt(),{get:r,bind:i,set:l,setStatus:c}=s,[a,d]=g.useState(r(e,{optional:t}));g.useEffect(()=>(d(r(e,{optional:t})),i({path:e,onChange:d,listenToChildren:!1})),[e,n,i,r]);const x=g.useCallback(f=>{n==null||n(f,{...s,path:e}),l(e,f)},[e,l,n]),p=g.useCallback(f=>c(e,f),[e,c]);if(a==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let m;return s.mode==="preview"&&(m="preview"),{onChange:x,setStatus:p,variant:m,...a}},Il=(e,t=!1,n)=>{const{get:s,bind:r}=tt(n),[,i]=g.useState(0);return g.useEffect(()=>(i(l=>l+1),r({path:e,onChange:()=>i(l=>l+1)})),[e,r]),s(e,{optional:t})??null},$l=(e,t=!1,n)=>{var l;const{get:s,bind:r}=tt(n),[,i]=g.useState(0);return g.useEffect(()=>(i(c=>c+1),r({path:e,onChange:()=>i(c=>c+1)})),[e,r]),((l=s(e,{optional:t}))==null?void 0:l.value)??null},Ph=e=>{var t,n;return((n=(t=Il(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},Lh=({path:e,ctx:t,onChange:n})=>{const s=tt(t);g.useEffect(()=>s.bind({path:e,onChange:r=>n(r,s),listenToChildren:!1}),[e,s])},Nh=({path:e,optional:t=!1})=>{const{bind:n,get:s}=tt(),[r,i]=g.useState(s(e,{optional:t}));if(g.useEffect(()=>(i(s(e,{optional:t})),n({path:e,onChange:l=>i({...l,value:Z.ee(l.value)}),listenToChildren:!0})),[e,n,s]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},zl=(e,t)=>({add:(n,s)=>{const r=Z.ee(e.get(t).value);r.splice(s,0,...Z.A(n)),e.set(t,r,{validateChildren:!1})},push:(n,s)=>{const r=Z.ee(e.get(t).value);r.push(...Z.A(n)),s!=null&&r.sort(s),e.set(t,r,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,r=new Set(Z.A(n));e.set(t,s.filter((i,l)=>!r.has(l)))},keepOnly:n=>{const s=e.get(t).value,r=new Set(Z.A(n));e.set(t,s.filter((i,l)=>r.has(l)))},set:n=>e.set(t,Z.executeSetter(n,e.get(t).value)),sort:n=>{const s=Z.ee(e.get(t).value);s.sort(n),e.set(t,s)}}),Th=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=tt(n),{bind:r,get:i}=s,[l,c]=g.useState(i(e).value);return g.useEffect(()=>(c(i(e).value),r({path:e,onChange:a=>{c(Z.ee(a.value))},listenToChildren:t})),[e,r,i,c]),g.useMemo(()=>({value:l,...zl(s,e)}),[l,s,e])},Wo=g.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:()=>{}}),tt=e=>{const t=g.useContext(Wo);return e??t},Br=e=>({key:e,variant:"success",message:""}),Ah=e=>e.code===ce.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",Bl=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r})=>{const i=g.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),l=E.useSyncedRef(n),c=E.useSyncedRef(r),a=g.useCallback(({path:w,onChange:P,listenToChildren:k=!1})=>{var F;const{parentListeners:T,listeners:A}=i.current,I=k?T:A;return I.has(w)||I.set(w,new Set),(F=I.get(w))==null||F.add(P),()=>{var $;return($=I.get(w))==null?void 0:$.delete(P)}},[]),d=g.useCallback((w,{optional:P}={optional:!1})=>{const{state:k,statuses:T,touched:A}=i.current,I=Z._.get(k,w,{optional:P});if(I==null)return null;const F={value:I,status:T.get(w)??Br(w),touched:A.has(w),required:!1};if(l.current==null)return F;const $=l.current,z=Z.y.getFieldSchema($,w,{optional:!0});return z==null||(F.required=!z.isOptional()),F},[]),x=g.useCallback(w=>{const{state:P,statuses:k,touched:T,listeners:A,parentListeners:I}=i.current;Z._.remove(P,w),k.delete(w),T.delete(w),A.delete(w),I.delete(w)},[]),p=g.useCallback(w=>{const{statuses:P,touched:k}=i.current;i.current.state=w,f(""),P.clear(),k.clear()},[]),m=g.useCallback(w=>{var T;const{listeners:P}=i.current,k=d(w,{optional:!0});k!=null&&((T=P.get(w))==null||T.forEach(A=>A(k)))},[]),f=g.useCallback(w=>{const{listeners:P,parentListeners:k}=i.current,T=P.get(w);if(w==""&&([...P.keys()].forEach(F=>{var z;const $=d(F,{optional:!0});$!=null&&((z=P.get(F))==null||z.forEach(R=>{R($)}))}),[...k.keys()].forEach(F=>{var z;const $=d(F,{optional:!0});$!=null&&((z=k.get(F))==null||z.forEach(R=>{R($)}))})),T!=null){const A=d(w,{optional:!0});A!=null&&T.forEach(I=>{I(A)})}k.forEach((A,I)=>{if(Z._.pathsMatch(w,I)){const $=d(I,{optional:!0});$!=null&&A.forEach(z=>{z($)})}})},[]),h=g.useCallback((w,P="",k=!0)=>{const{statuses:T,listeners:A,touched:I}=i.current;if(w.success){const R=[...T.keys()];return T.clear(),R.forEach(N=>m(N)),!0}let F=!0;const $=new Set(w.error.issues.map(R=>R.path.join(".")));let z=(R,N)=>R===N;return k&&(z=(R,N)=>Z._.pathsMatch(R,N)),w.error.issues.forEach(R=>{var V;const{message:N}=R,_=R.path.join(".");if(!z(_,P))return;const D=Ah(R);D!=="warning"&&(F=!1),T.set(_,{key:_,variant:D,message:N}),I.add(_);let L=d(_,{optional:!0});L??(L={value:void 0,status:T.get(_)??Br(_),touched:!1,required:!1}),(V=A.get(_))==null||V.forEach(H=>H(L))}),T.forEach((R,N)=>{$.has(N)||(T.delete(N),m(N))}),F},[]),j=g.useCallback((w,P)=>{if(l.current==null)return!0;const{state:k}=i.current,T=l.current.safeParse(k);return h(T,w,P)},[h]),y=g.useCallback(async(w,P)=>{if(l.current==null)return!0;const{state:k}=i.current,T=await l.current.safeParseAsync(k);return h(T,w,P)},[h]),S=g.useCallback((w,P,k={})=>{const T=Z._.get(i.current.state,w,{optional:!0}),{validateChildren:A=!0}=k,{state:I,touched:F}=i.current;F.add(w),w.length===0?i.current.state=P:Z._.set(I,w,P),f(w),(async()=>{var z;let $;try{$=j(w,A)}catch{$=await y(w,A)}(z=c.current)==null||z.call(c,{values:i.current.state,path:w,prev:T,valid:$})})()},[]),M=g.useCallback(w=>Z._.has(i.current.state,w),[]),C=g.useCallback((w,P)=>{i.current.statuses.set(w,P),i.current.touched.add(w),m(w)},[]),b=g.useCallback(()=>{const{statuses:w}=i.current;w.clear(),w.forEach((P,k)=>m(k))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:w}=i.current;i.current.state=e,w.forEach((P,k)=>{const T=d(k,{optional:!0});T!=null&&P.forEach(A=>A(T))})},[t,e]),g.useMemo(()=>({bind:a,set:S,get:d,mode:s,validate:j,validateAsync:y,value:()=>i.current.state,has:M,remove:x,setStatus:C,clearStatuses:b,reset:p}),[a,S,d,j,y,M,x,C,b,p,s])},Ih=e=>o.jsxRuntimeExports.jsx(Wo.Provider,{value:e,children:e.children}),$h=E.componentRenderProp(E.Text$2),ye=({path:e,children:t=$h,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:i=!1,optional:l,onChange:c,className:a,...d})=>{const x=pt({path:e,optional:l??i,onChange:c}),p=tt();if(x==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??(n=u.d.capitalize(Z._.element(e,-1))),r=typeof r=="function"?r(x,p):r,!r)return null;const m=x.status.message,{onChange:f,value:h}=x,j={onChange:f,value:h};return x.variant!=null&&(j.variant=x.variant),o.jsxRuntimeExports.jsx(Ne.Item,{padHelpText:s,helpText:m,helpTextVariant:x.status.variant,label:n,required:x.required,className:u.CSS(a,u.CSS.BE("field",e.split(".").join("-")),u.CSS.M(x.status.variant)),...d,children:t(j)})},_t=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:i,path:l,fieldKey:c=t,...a})=>o.jsxRuntimeExports.jsx(ye,{...n,...a,path:c?`${l}.${c}`:l,children:d=>o.jsxRuntimeExports.jsx(e,{...d,...s,...i})});return r.displayName=e.displayName,r},Dl=_t(E.Numeric),zt=Dl({}),Ol=_t(E.Text$2),Ko=Ol({}),Vl=_t(E.Switch$1),hs=Vl({}),zh=_t(xt),Bh=_t(Wt),Dh=_t(ve.DropdownButton),Xo=({key:e,open:t,onChange:n})=>{const s=E.useMemoPrimitiveArray(e);E.useAsyncEffect(async()=>{if(t==null)return;const r=await t();if(r!=null)return r.onChange(n),async()=>await r.close()},[t==null,s])},Oh=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return E.useAsyncEffect(async()=>{s(await e())},[e]),Xo({...t,onChange:s}),n},Vh=Object.freeze(Object.defineProperty({__proto__:null,useListener:Xo,useState:Oh},Symbol.toStringTag,{value:"Module"})),Fh=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:i,applyObservable:l,...c})=>{const a=Fe(),d=E.useExceptionHandler(),x=E.useMemoPrimitiveArray(e),p=Bl({values:s,...c,sync:!1,onChange:h=>{a!=null&&(async()=>{try{await(i==null?void 0:i({...h,client:a}))}catch(j){d(j,`Failed to save ${t}`)}})()}});E.useAsyncEffect(async()=>{if(a!=null)try{const h=await n({client:a});p.set("",h)}catch(h){d(h,`Failed to retrieve ${t}`)}},[x,a==null?void 0:a.key]);const m=g.useCallback(async()=>{if(a!=null)return await(r==null?void 0:r(a))},[x,a==null?void 0:a.key]),f=g.useCallback(h=>l==null?void 0:l({changes:h,ctx:p}),[x,l]);return Xo({key:x,open:m,onChange:f}),p},Hh=Object.freeze(Object.defineProperty({__proto__:null,Context:Wo,Field:ye,Form:Ih,NumericField:zt,SwitchField:hs,TextField:Ko,buildDropdownButtonSelectField:Dh,buildNumericField:Dl,buildSelectMultiField:Bh,buildSelectSingleField:zh,buildSwitchField:Vl,buildTextField:Ol,fieldArrayUtils:zl,fieldBuilder:_t,use:Bl,useChildFieldValues:Nh,useContext:tt,useField:pt,useFieldArray:Th,useFieldListener:Lh,useFieldState:Il,useFieldValid:Ph,useFieldValue:$l,useSynced:Fh},Symbol.toStringTag,{value:"Module"})),Zh=[{key:"name",name:"Name"},{key:"location",name:"Location"}],Gh=({searchOptions:e,...t})=>{const n=Fe();let s=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(s=n.hardware.devices.newSearcherWithOptions(e)),o.jsxRuntimeExports.jsx(xt,{columns:Zh,searcher:s,entryRenderKey:"name",...t})},Yh=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Gh},Symbol.toStringTag,{value:"Module"})),Bt="label",qo=[{key:"color",name:"Color",render:({entry:e})=>o.jsxRuntimeExports.jsx(E.yt.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Kn=({items:e},t)=>{const n=E.filterByType(Bt,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Wh=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...r})=>o.jsxRuntimeExports.jsx(an,{color:e==null?void 0:e.color,...r,children:e==null?void 0:e.name}),Kh=E.componentRenderProp(Wh),Xh=({onChange:e,className:t,value:n,...s})=>{const r=Fe(),i=r!=null?void 0:o.jsxRuntimeExports.jsx(E.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=E.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(m=>Kn(m,Z.A(n)),[n]),onDrop:g.useCallback(({items:m})=>{const f=E.filterByType(Bt,m);if(f.length===0)return[];const h=Z.c.unique([...Z.A(n),...f.map(j=>j.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),d=E.useDraggingState(),x=g.useCallback(({dropped:m})=>{e(Z.A(n).filter(f=>!m.some(h=>h.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=g.useCallback((m,f)=>l([{key:f,type:Bt}],x),[l,x]);return o.jsxRuntimeExports.jsx(Wt,{className:u.CSS(t,u.CSS.dropRegion(Kn(d,Z.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.labels,onChange:e,columns:qo,emptyContent:i,renderTag:Kh,addPlaceholder:"Label",...a,...s})},Fl=({value:e,onChange:t})=>{const n=Fe(),s=n!=null?void 0:o.jsxRuntimeExports.jsx(E.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=g.useId(),i=g.useMemo(()=>({key:r,type:"Label.SelectMultiple"}),[r]),l=E.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(d=>Kn(d,Z.o$1(e)),[e]),onDrop:g.useCallback(({items:d})=>{const x=E.filterByType(Bt,d);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[i,t])}),c=E.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:Bt,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},qh=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:i,...l}=Fl({value:t,onChange:e});return o.jsxRuntimeExports.jsx(xt,{data:s,className:u.CSS(n,u.CSS.dropRegion(Kn(i,Z.o$1(t)))),value:t,onChange:e,columns:qo,entryRenderKey:"name",...l,...r})},Uh=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...i}=Fl({value:t,onChange:n});return o.jsxRuntimeExports.jsx(xt,{data:e,value:t,onChange:n,columns:qo,entryRenderKey:"name",...i,...s})},Jh=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Bt,SelectButton:Uh,SelectMultiple:Xh,SelectSingle:qh},Symbol.toStringTag,{value:"Module"})),Hl=({children:e,centered:t,visible:n,enabled:s=!0,close:r,style:i,...l})=>{const c=g.useRef(null),a=g.useRef(n);E.useClickOutside({ref:c,exclude:x=>E.findParent(x.target,m=>m.getAttribute("role")==="dialog")!=null,onClickOutside:r});const d=g.useCallback(x=>{var m;if(!a.current||x.stage!=="start")return;const p=(m=c.current)==null?void 0:m.querySelectorAll(`.${u.CSS.visible(!0)}`);p&&p.length>0||r()},[r]);return E.use$1({triggers:[["Escape"]],callback:d,loose:!0}),o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(u.CSS.BE("modal","bg"),u.CSS.visible(n),s&&u.CSS.M("enabled-modal")),empty:!0,align:"center",children:o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(u.CSS.BE("modal","dialog"),t&&u.CSS.M("centered")),role:"dialog",empty:!0,ref:c,...l,style:{zIndex:s?11:void 0,...i},children:o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(u.CSS.BE("modal","content")),empty:!0,children:e})})})},Qh=({root:e,...t})=>Po.createPortal(o.jsxRuntimeExports.jsx(Hl,{...t}),E.getRootElement(e)),eg=Object.freeze(Object.defineProperty({__proto__:null,Dialog:Hl,Modal:Qh},Symbol.toStringTag,{value:"Module"})),gs=new Error("Tab not found"),tg=new Error("Invalid Mosaic"),Xn=(e,t,n="center",s)=>{var p;if(e=nt(e),s===void 0)return lo(e,t);const r=co(e,s);if(n==="center")return(p=r.tabs)==null||p.push(t),r.selected=t.tabKey,e;const i=r.key*2,l=r.key*2+1,c=n==="top"||n==="left"?i:l;if(co(e,c).key!==r.key)return Xn(e,t,"center",c);if(r.tabs==null||r.tabs.length===0)return Xn(e,t,"center",s);const[a,d,x]=lg(n);if(r.direction=x,r[a]={key:0,tabs:[t],selected:t.tabKey},r[d]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw tg;return r.first.key=i,r.last.key=l,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},ng=(e,t,n)=>{var i;e=nt(e);const[s,r]=bt(e,t);if(s==null||r==null)throw gs;return r.tabs=(i=r.tabs)==null?void 0:i.map(l=>l.tabKey===t?n(l):l),e},lo=(e,t)=>(e=nt(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=lo(e.first,t):e.last!=null&&(e.last=lo(e.last,t)),e)),qn=e=>{e=nt(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]=qn(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=qn(e.last);e.last=n,t.push(...s)}return[e,t]},Uo=(e,t)=>{var r;e=nt(e);const[,n]=bt(e,t);if(n==null)return[e,null];n.tabs=(r=n.tabs)==null?void 0:r.filter(i=>i.tabKey!==t),n.selected=Me.resetSelection(n.selected,n.tabs),e=ig(e);const s=n.selected??Un(e);return[e,s]},Un=e=>e.selected!=null?e.selected:e.first!=null?Un(e.first):e.last!=null?Un(e.last):null,Zl=(e,t)=>{e=nt(e);const[n,s]=bt(e,t);if(n==null||s==null)throw gs;return s.selected=t,e},Gl=(e,t,n,s)=>{e=nt(e);const[r,i]=bt(e,t);if(r==null||i==null)throw gs;const[l,c]=Uo(e,t);return[Xn(l,r,n,s),c]},un=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=un(e.first,t);if(n!=null)return n}if(e.last!=null){const n=un(e.last,t);if(n!=null)return n}},Yl=(e,t,n)=>{const s=Jn(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},sg=(e,t,n)=>{e=nt(e);const s=un(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const r=s.tabs.findIndex(x=>x.tabKey===t);if(r===-1)throw new Error("Tab not found in node");const i=s.tabs[r];s.tabs=s.tabs.filter(x=>x.tabKey!==t);const l=s.key*2,a={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=a,s.tabs=void 0,s.selected=void 0,e},og=(e,t)=>{const n=un(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Wl=(e,t,n)=>{e=nt(e);const[,s]=bt(e,t);if((s==null?void 0:s.tabs)==null)throw gs;return s.tabs=Me.rename(t,n,(s==null?void 0:s.tabs)??[]),e},rg=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,co=(e,t)=>{const n=Jn(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:co(e,s)},ig=e=>{let t=!0;for(;t;)[e,t]=ao(e);return e.first==null&&e.last==null&&(e.key=1),e},ao=e=>{if(e.first==null||e.last==null)return[e,!1];if(Or(e.first))return[Dr(e.last,!0),!0];if(Or(e.last))return[Dr(e.first,!1),!0];let t,n;return[e.first,t]=ao(e.first),[e.last,n]=ao(e.last),[e,t||n]},Dr=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Or=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),bt=(e,t)=>{if(e.tabs!=null){const l=e.tabs.find(c=>c.tabKey===t);if(l!=null)return[l,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=bt(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,i]=bt(e.last,t);return[r,i]},Jn=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=Jn(e.first,t);return n??Jn(e.last,t)},lg=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")}},nt=e=>Z._.copy(e),Qn=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&Qn(e.first,t,n),e.last!=null&&Qn(e.last,t,n),n),uo=(e,t)=>{t(e),e.first!=null&&uo(e.first,t),e.last!=null&&uo(e.last,t)};class Kl{constructor(t={}){Ge(this,"parent");Ge(this,"stub");Ge(this,"el");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 cg=({node:e})=>{const t=g.createRef(),n=g.useRef(e);return g.useEffect(()=>{const s=t.current;if(s==null)return;const r=s.parentNode;if(r!=null)return e.mount(r,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),g.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const s=t.current;if(s==null)return;const r=s.parentNode;r!=null&&e.mount(r,s)},[e]),o.jsxRuntimeExports.jsx("div",{ref:t})},Xl=({node:e,children:t})=>Po.createPortal(t,e.el),ag=Object.freeze(Object.defineProperty({__proto__:null,In:Xl,Node:Kl,Out:cg},Symbol.toStringTag,{value:"Module"})),es=g.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:s,direction:r,first:i,last:l,key:c,size:a},emptyContent:d,...x}=n,p=g.useCallback(([h])=>t(c,h),[t]),{props:m}=No({direction:r,onResize:p,count:2,initialSizes:a!=null?[a]:void 0});let f;return s!==void 0?f=o.jsxRuntimeExports.jsx(ql,{emptyContent:d,...n}):i!=null&&l!=null?f=o.jsxRuntimeExports.jsxs(To,{id:`mosaic-${c}`,align:"stretch",className:u.CSS.BE("mosaic","resize"),...m,children:[o.jsxRuntimeExports.jsx(es,{...x,root:i,onResize:t},i.key),o.jsxRuntimeExports.jsx(es,{...x,root:l,onResize:t},l.key)]}):(f=null,console.warn("Mosaic tree is malformed")),c===1?o.jsxRuntimeExports.jsx(E.Provider$3,{children:f}):f});es.displayName="Mosaic";const ts="pluto-mosaic-tab-drop",Jo="pluto-mosaic-tab-create",ug=(e,t,n)=>{if(E.filterByType(E.FILE_TYPE,t).length>0&&n)return!0;const r=E.filterByType(ts,t).map(c=>c.key),i=e.filter(c=>!r.includes(c.tabKey)).length>0;return E.filterByType(Jo,t).length>0||r.length>0&&(i||e.length===0)},ql=g.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:r,onFileDrop:i,...l})=>{const{key:c,tabs:a}=e,[d,x]=g.useState(null),p=i!=null,m=g.useCallback(({items:w})=>ug(a,w,p),[a,p]),f=g.useCallback(({items:w,event:P})=>{if(P==null)return[];x(null);const k=E.filterByType(E.FILE_TYPE,w).length>0,T=a.length===0?"center":Fr(Vr(P));if(k)return i==null||i(c,T,P),w;const A=E.filterByType(ts,w);if(A.length>0){const F=A.map(({key:$})=>$)[0];t(c,F,T)}const I=E.filterByType(Jo,w);if(I.length>0){const F=I.map(({key:$})=>$);n==null||n(c,T,F)}return A},[t,a.length]),h=g.useCallback(({event:w})=>{if(w==null)return;const P=a.length===0?"center":Fr(Vr(w));x(P)},[a.length]),{startDrag:j,...y}=E.useDragAndDrop({type:"Mosaic",canDrop:m,onDrop:f,onDragOver:h}),S=m(E.useDraggingState()),M=g.useCallback(()=>x(null),[]),C=g.useCallback((w,{tabKey:P})=>{j([{key:P,type:ts,elementID:w.currentTarget.id}])},[j]),b=g.useCallback(()=>n==null?void 0:n(c,"center"),[c]);return o.jsxRuntimeExports.jsxs("div",{id:`mosaic-${c}`,className:u.CSS.BE("mosaic","leaf"),children:[o.jsxRuntimeExports.jsxs(Me.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:M,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:C,onCreate:b,...l,...y,children:[e.selected!=null&&r(a.find(w=>w.tabKey===e.selected)),S&&o.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),d!=null&&o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("mosaic","mask"),style:dg[d]})]})});ql.displayName="MosaicTabLeaf";const dg={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%"}},Vr=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{px:.5,py:.5}:{px:n/t.width,py:s/t.height}},xg=e=>e,pg=e=>1-e,Fr=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[xg(e),pg(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")},mg=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),r=new Set,i=Qn(e,l=>{var c;return(c=l.tabs)==null?void 0:c.map(a=>{let d=s.current.get(a.tabKey);return a==null?null:(d==null&&(d=new Kl({style:"width: 100%; height: 100%; position: relative;"}),d.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,d)),r.add(a.tabKey),o.jsxRuntimeExports.jsx(Xl,{node:d,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})}).flat().filter(l=>l!=null);return s.current.forEach((l,c)=>!r.has(c)&&s.current.delete(c)),[s,i]},fg=ce.z.object({key:ce.z.number(),tabs:ce.z.array(Me.tabZ).optional(),selected:ce.z.string().optional(),direction:u.g.direction.optional(),size:ce.z.number().optional()}),xo=fg.extend({first:ce.z.lazy(()=>xo).optional(),last:ce.z.lazy(()=>xo).optional()}),hg=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(qn(t)[0]),[t]),{root:n,onDrop:(d,x,p)=>s(m=>Gl(m,x,p,d)[0]),onClose:d=>s(x=>Uo(x,d)[0]),onSelect:d=>s(x=>Zl(x,d)),onResize:(d,x)=>s(p=>Yl(p,d,x)),onRename:e?(d,x)=>s(p=>Wl(p,d,x)):void 0}},gg=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Jo,HAUL_DROP_TYPE:ts,Mosaic:es,autoSelectTabs:qn,canSplit:og,findSelected:Un,findTabNode:un,forEachNode:uo,insertTab:Xn,isEmpty:rg,mapNodes:Qn,moveTab:Gl,nodeZ:xo,removeTab:Uo,renameTab:Wl,resizeNode:Yl,selectTab:Zl,split:sg,updateTab:ng,use:hg,usePortal:mg},Symbol.toStringTag,{value:"Module"})),jg=({variant:e,className:t,children:n,...s})=>o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(t,u.CSS.B("note"),u.CSS.M(e)),align:"stretch",empty:!0,...s,children:n}),Eg=Object.freeze(Object.defineProperty({__proto__:null,Note:jg},Symbol.toStringTag,{value:"Module"})),Zs={Close:o.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:o.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:o.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),o.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},yg=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:i,onClose:l,...c})=>o.jsxRuntimeExports.jsxs(te.Space,{size:1.5,direction:"x",className:u.CSS(u.CSS.B("macos-controls"),!n&&u.CSS.BM("macos-controls","blurred"),t),...c,children:[o.jsxRuntimeExports.jsx(Gs,{onClick:l,className:u.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Zs.Close}),o.jsxRuntimeExports.jsx(Gs,{onClick:s,className:u.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Zs.Minimize}),o.jsxRuntimeExports.jsx(Gs,{onClick:i,className:u.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Zs.Maximize})]}),Gs=({className:e,disabled:t,color:n,...s})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("macos-control"),u.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),Ys=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:i,...l})=>o.jsxRuntimeExports.jsxs(te.Pack,{...l,children:[o.jsxRuntimeExports.jsx(Ws,{className:u.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:o.jsxRuntimeExports.jsx(E.yt.Subtract,{})}),o.jsxRuntimeExports.jsx(Ws,{className:u.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:o.jsxRuntimeExports.jsx(E.yt.Box,{})}),o.jsxRuntimeExports.jsx(Ws,{onClick:s,className:u.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:o.jsxRuntimeExports.jsx(E.yt.Close,{})})]}),Ws=({disabled:e=!1,className:t,...n})=>e?null:o.jsxRuntimeExports.jsx(E.Icon,{className:u.CSS(u.CSS.B("windows-control"),t),tabIndex:-1,...n}),Ul=e=>Z.S.getOS(e),Sg={MacOS:yg,Windows:Ys,Linux:Ys,Docker:Ys},Rg="Windows",Cg=({forceOS:e,visibleIfOS:t,...n})=>{const s=Ul({force:e,default:Rg}),r=Sg[s];return t!=null&&t!==s?null:o.jsxRuntimeExports.jsx(r,{...n})},bg=Object.freeze(Object.defineProperty({__proto__:null,Controls:Cg,use:Ul},Symbol.toStringTag,{value:"Module"})),wg=(e,t)=>{const n=s=>o.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},vg=Object.freeze(Object.defineProperty({__proto__:null,createComponent:wg},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:Z.B.NOOP});const Mg=({children:e,...t})=>{const{path:n}=E.useUnidirectional({type:B.Provider$2.TYPE,schema:B.providerStateZ$1,state:t});return o.jsxRuntimeExports.jsx(E.Composite,{path:n,children:e})},kg="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjQgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Jl=({children:e})=>{const[{path:t}]=E.use$3({type:B.BaseProvider.TYPE,schema:B.providerStateZ$2,initialState:{}});return o.jsxRuntimeExports.jsx(E.Composite,{path:t,children:e})},_g=Object.freeze(Object.defineProperty({__proto__:null,Provider:Jl},Symbol.toStringTag,{value:"Module"})),Pg=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===Z.ep.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Ql=({source:e,sink:t,className:n,...s})=>{const r=E.useMemoDeepEqualProps({source:e,sink:t}),[,{status:i},l]=E.use$3({type:B.Chip.TYPE,schema:B.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:Z.m.now()}}});g.useEffect(()=>{l(m=>({...m,...r}))},[r,l]);const c=g.useCallback(()=>l(m=>({...m,triggered:!m.triggered})),[l]),{message:a,chipColor:d,buttonStyle:x,disabled:p}=Pg(i);return o.jsxRuntimeExports.jsx(E.Icon,{variant:"text",className:u.CSS(u.CSS.B("control-chip"),n),disabled:p,onClick:c,tooltip:o.jsxRuntimeExports.jsx(E.Text$1,{level:"small",children:a}),style:x,...s,children:o.jsxRuntimeExports.jsx(E.yt.Circle,{color:d})})},ec=g.createContext({needsControlOf:[]}),tc=()=>g.useContext(ec),Lg=({children:e,onStatusChange:t,...n})=>{const s=E.useMemoDeepEqualProps(n),[{path:r},{status:i,needsControlOf:l},c]=E.use$3({type:B.Controller$1.TYPE,schema:B.controllerStateZ,initialState:s});return g.useEffect(()=>{i!=null&&(t==null||t(i))},[i,t]),g.useEffect(()=>{c(a=>({...a,...s}))},[s,c]),g.useEffect(()=>()=>t==null?void 0:t("released"),[]),o.jsxRuntimeExports.jsxs(ec.Provider,{value:{needsControlOf:l},children:[o.jsxRuntimeExports.jsx(E.Composite,{path:r,children:e}),";"]})},nc=({colorSource:e,statusSource:t})=>{var c;const n=E.useMemoDeepEqualProps({colorSource:e,statusSource:t}),[,{color:s,status:r},i]=E.use$3({type:B.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:Z.m.now()}},schema:B.indicatorStateZ});g.useEffect(()=>{i(a=>({...a,...n}))},[n,i]);let l;return((c=r.data)==null?void 0:c.color)!=null?l=u.Color.z.parse(r.data.color):s!=null&&!s.isZero?l=s:l="var(--pluto-gray-l8)",o.jsxRuntimeExports.jsxs(E.Dialog$1,{location:{x:"center",y:"bottom"},children:[o.jsxRuntimeExports.jsx(E.Text$1,{level:"p",children:r.message}),o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("indicator"),style:{backgroundColor:u.cssString(l),flexGrow:1}})]})},Ng=({...e})=>{const{needsControlOf:t}=tc(),[,{states:n},s]=E.use$3({type:B.Legend.TYPE,schema:B.legendStateZ,initialState:{states:[],needsControlOf:t}});g.useEffect(()=>{s(l=>({...l,needsControlOf:t}))},[t]);const i=Z.c.unique(n.map(l=>l.subject.key)).map(l=>{const c=n.find(a=>a.subject.key===l);if(c==null)throw new Z.xe("Legend subject not found");return{key:c.subject.key,label:c.subject.name,color:c.subjectColor}});return o.jsxRuntimeExports.jsx(Oo,{data:i,...e})},sc=({children:e})=>{const[{path:t}]=E.use$3({type:B.StateProvider.TYPE,schema:B.stateProviderStateZ,initialState:{}});return o.jsxRuntimeExports.jsx(E.Composite,{path:t,children:e})},Tg=Object.freeze(Object.defineProperty({__proto__:null,Chip:Ql,Controller:Lg,Indicator:nc,Legend:Ng,StateProvider:sc,useContext:tc},Symbol.toStringTag,{value:"Module"})),oc=e=>{const t=({disabled:n=!1,...s})=>n?s.children:o.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},Ag=oc(Jl),Ig=oc(E.Provider$4),$g=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:r,tooltip:i,triggers:l,alamos:c,haul:a,channelAlias:d,telem:x,color:p})=>o.jsxRuntimeExports.jsx(E.Provider$2,{...l,children:o.jsxRuntimeExports.jsx(E.Config,{...i,children:o.jsxRuntimeExports.jsx(E.Provider$3,{...a,children:o.jsxRuntimeExports.jsx(E.Provider$5,{url:s??kg,enabled:n,children:o.jsxRuntimeExports.jsx(Ig,{workerKey:"vis",children:o.jsxRuntimeExports.jsx(Mg,{...c,children:o.jsxRuntimeExports.jsx(E.Aggregator,{children:o.jsxRuntimeExports.jsx(tl,{connParams:t,children:o.jsxRuntimeExports.jsx(ol,{...d,children:o.jsxRuntimeExports.jsx(Ag,{...x,children:o.jsxRuntimeExports.jsx(E.Provider$1,{...p,children:o.jsxRuntimeExports.jsx(E.Provider,{...r,children:o.jsxRuntimeExports.jsx(sc,{children:e})})})})})})})})})})})})}),zg=Object.freeze(Object.defineProperty({__proto__:null,Provider:$g},Symbol.toStringTag,{value:"Module"})),Bg=({value:e})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress"),children:o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Dg=Object.freeze(Object.defineProperty({__proto__:null,Progress:Bg},Symbol.toStringTag,{value:"Module"})),dn="range",Qo=[{key:"name",name:"Name"}],ns=({items:e},t)=>{const n=E.filterByType(dn,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Og=({onChange:e,className:t,value:n,...s})=>{const r=Fe(),i=r!=null?void 0:o.jsxRuntimeExports.jsx(E.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=E.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(m=>ns(m,Z.A(n)),[n]),onDrop:g.useCallback(({items:m})=>{const f=E.filterByType(dn,m);if(f.length===0)return[];const h=Z.c.unique([...Z.A(n),...f.map(j=>j.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),d=E.useDraggingState(),x=g.useCallback(({dropped:m})=>{e(Z.A(n).filter(f=>!m.some(h=>h.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=g.useCallback((m,f)=>l([{key:f,type:dn}],x),[l,x]);return o.jsxRuntimeExports.jsx(Wt,{className:u.CSS(t,u.CSS.dropRegion(ns(d,Z.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.ranges,onChange:e,columns:Qo,emptyContent:i,entryRenderKey:"name",...a,...s})},rc=({value:e,onChange:t})=>{const n=Fe(),s=n!=null?void 0:o.jsxRuntimeExports.jsx(E.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=g.useId(),i=g.useMemo(()=>({key:r,type:"Ranger.SelectMultiple"}),[r]),{startDrag:l,...c}=E.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(x=>ns(x,Z.o$1(e)),[e]),onDrop:g.useCallback(({items:x})=>{const p=E.filterByType(dn,x);return p.length===0?[]:(t(p[0].key,{clickedIndex:null,clicked:null,entries:[]}),p)},[i,t])}),a=E.useDraggingState(),d=g.useCallback(()=>e!=null&&l([{type:dn,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:d,searcher:n==null?void 0:n.ranges}},Vg=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:i,...l}=rc({value:t,onChange:e});return o.jsxRuntimeExports.jsx(xt,{data:s,className:u.CSS(n,u.CSS.dropRegion(ns(i,Z.o$1(t)))),value:t,onChange:e,columns:Qo,entryRenderKey:"name",...l,...r})},Fg=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...i}=rc({value:t,onChange:n});return o.jsxRuntimeExports.jsx(xt,{data:e,value:t,onChange:n,columns:Qo,entryRenderKey:"name",...i,...s})},Hg=[{key:"color",name:"Color",width:50,render:e=>o.jsxRuntimeExports.jsx(E.yt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Zg=e=>{const t=Fe();return o.jsxRuntimeExports.jsx(Wt,{...e,searcher:t==null?void 0:t.labels,columns:Hg,renderTag:n=>n.entry==null?o.jsxRuntimeExports.jsx(an,{color:"gray",children:n.entryKey}):o.jsxRuntimeExports.jsx(an,{color:n.entry.color,children:n.entry.name})})},Gg=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...r})=>{const i=new Z.m(e.start),l=i.isToday?"time":"dateTime",c=new Z.m(e.end),a=c.equals(Z.m.MAX),d=c.span(i)<Z.w.DAY?"time":"dateTime",x=i.span(c);return o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",size:"small",className:u.CSS(u.CSS.B("time-range-chip")),align:"center",...r,children:[i.isToday&&o.jsxRuntimeExports.jsx(E.Text$1,{level:t,shade:n,weight:450,children:"Today"}),o.jsxRuntimeExports.jsx(E.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:i}),o.jsxRuntimeExports.jsx(E.yt.Arrow.Right,{color:"var(--pluto-text-color)"}),a?o.jsxRuntimeExports.jsx(E.Text$1,{level:t,children:"Now"}):o.jsxRuntimeExports.jsx(E.DateTime,{level:t,displayTZ:"local",format:d,shade:n,weight:450,children:c}),!x.isZero&&s&&o.jsxRuntimeExports.jsxs(E.Text$1,{level:t,shade:n,weight:450,children:["(",i.span(c).truncate(Z.w.MILLISECOND).toString(),")"]})]})},Yg=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Fg,SelectLabels:Zg,SelectMultiple:Og,SelectSingle:Vg,TimeRangeChip:Gg},Symbol.toStringTag,{value:"Module"})),Wg=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(i=>i.key===t);return o.jsxRuntimeExports.jsx(te.Space,{direction:"x",align:"center",className:u.CSS.B("steps"),...s,children:e.map((i,l)=>o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsxs(E.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>r,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&o.jsxRuntimeExports.jsx(E.yt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},Kg=Object.freeze(Object.defineProperty({__proto__:null,Steps:Wg},Symbol.toStringTag,{value:"Module"})),Xg=({children:e,className:t,visible:n,...s})=>{const[{path:r},,i]=E.use$3({type:B.Table.TYPE,schema:B.Table.stateZ,initialState:{region:u.Mt.ZERO,visible:n}});g.useEffect(()=>{i(c=>({...c,visible:n}))},[n]);const l=En(c=>i(a=>({...a,region:c})));return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{ref:l,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),o.jsxRuntimeExports.jsx("table",{className:u.CSS(u.CSS.B("table"),t),...s,children:o.jsxRuntimeExports.jsx("tbody",{children:o.jsxRuntimeExports.jsx(E.Composite,{path:r,children:e})})})]})},qg=({children:e,className:t,size:n,index:s,onResize:r,onSelect:i,position:l,...c})=>o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),t),...c,children:[r!=null&&o.jsxRuntimeExports.jsx(lc,{onSelect:i,index:s,value:n,onChange:r,position:l,direction:"y"}),e]}),er=({ref:e,children:t,className:n,selected:s=!1,...r})=>o.jsxRuntimeExports.jsx("td",{ref:e,...r,className:u.CSS(u.CSS.BE("table","cell"),u.CSS.selected(s),n),children:t}),ic="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Ug=e=>ic[e],lc=({value:e,selected:t=!1,index:n,onChange:s,position:r,direction:i="x",onSelect:l})=>{const c=E.useSyncedRef(e),a=g.useRef(e),d=E.useCursorDrag({onStart:g.useCallback(()=>{a.current=c.current},[]),onMove:g.useCallback(x=>s(a.current+u.Mt.dim(x,i,!0),n),[s,n])});return o.jsxRuntimeExports.jsxs("td",{id:`resizer-${i}-${n}`,className:u.CSS(u.CSS.BE("table","resizer"),u.CSS.dir(i),u.CSS.selected(t),E.CONTEXT_TARGET,t&&E.CONTEXT_SELECTED),style:{[u.g.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[o.jsxRuntimeExports.jsx(E.Text$1,{level:"p",shade:7,style:{width:"100%",textAlign:"center"},children:i==="x"?ic[n]:n+1}),o.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[u.g.location(i)]:r+e},onDragStart:d,draggable:!0})]})},Jg=({selected:e,onSelect:t,columns:n,onResize:s})=>{let r=15;return o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),u.CSS.BE("table","col-resizer")),children:[o.jsxRuntimeExports.jsx("td",{}),n.map((i,l)=>{const c=r;return r+=i,o.jsxRuntimeExports.jsx(lc,{onSelect:t,position:c,selected:e.includes(l),index:l,value:i,onChange:a=>s(a,l),direction:"x"},l)})]})},Qg=Object.freeze(Object.defineProperty({__proto__:null,Cell:er,ColumnIndicators:Jg,Row:qg,Table:Xg,getCellColumn:Ug},Symbol.toStringTag,{value:"Module"})),e1=[{key:"standard",name:"Standard"},{key:"scientific",name:"Scientific"},{key:"engineering",name:"Engineering"}],t1=({...e})=>o.jsxRuntimeExports.jsx(ve.Button,{...e,entryRenderKey:"name",data:e1}),cc=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],tr=({path:e})=>{var f;const{value:t,onChange:n}=pt({path:e}),s=B.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),r=B.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=B.stringifyNumberProps.parse(s.segments.stringifier.props),l=B.rollingAverageProps.parse(s.segments.rollingAverage.props),c=h=>{const j=B.sourcePipeline("string",{connections:cc,segments:{valueStream:B.streamChannelValue({channel:r.channel}),stringifier:B.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:B.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:j})},a=h=>c({valueStream:B.streamChannelValue({channel:h??0})}),d=h=>c({stringifier:B.stringifyNumber({...i,notation:h})}),x=h=>c({stringifier:B.stringifyNumber({...i,precision:h})}),p=h=>c({rollingAverage:B.rollingAverage({windowSize:h})}),m=ps(r.channel);return g.useEffect(()=>n({...t,tooltip:[m]}),[m]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:r.channel,onChange:a})}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Notation",children:o.jsxRuntimeExports.jsx(t1,{value:i.notation,onChange:d})}),o.jsxRuntimeExports.jsx(Ne.Item,{label:"Precision",align:"start",children:o.jsxRuntimeExports.jsx(E.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),o.jsxRuntimeExports.jsx(Ne.Item,{label:"Averaging Window",align:"start",children:o.jsxRuntimeExports.jsx(E.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})]})},n1=B.Value.z.partial({color:!0}).extend({level:Z.levelZ.optional()}),nr=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:i,level:l="small",backgroundTelem:c,notation:a,location:d})=>{const x=E.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:r,level:l,minWidth:i,notation:a,backgroundTelem:c,location:d}),[,p,m]=E.use$3({aetherKey:e,type:B.Value.TYPE,schema:B.Value.z,initialState:x});return g.useEffect(()=>m(f=>({...f,...x})),[x]),{width:p.width??p.minWidth}},s1=Object.freeze(Object.defineProperty({__proto__:null,TelemForm:tr,VALUE_CONNECTIONS:cc,corePropsZ:n1,use:nr},Symbol.toStringTag,{value:"Module"})),o1=ce.z.object({value:ce.z.string(),level:Z.levelZ,weight:Z.weightZ,align:u.K.x.or(u.K.center),backgroundColor:u.crudeZ}),r1=({cellKey:e,onChange:t,value:n,selected:s,onSelect:r,align:i,level:l,weight:c,backgroundColor:a})=>{const d=p=>r(e,p),x=p=>t({level:l,value:p,weight:c,align:i,backgroundColor:a});return o.jsxRuntimeExports.jsx(er,{id:e,className:u.CSS(E.CONTEXT_TARGET,s&&E.CONTEXT_SELECTED,u.CSS.BEM("table","cell","text")),selected:s,onClick:d,onContextMenu:d,style:{backgroundColor:u.cssString(a)},children:o.jsxRuntimeExports.jsx(E.Editable,{level:l,value:n,weight:c,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},i1=ce.z.object({telem:B.stringSourceSpecZ,redline:ce.z.object({bounds:u.H.bounds,gradient:u.gradientZ}),level:Z.levelZ,color:ce.z.string(),units:ce.z.string()}),l1=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:r,bounds:i},selected:l,box:c,onSelect:a})=>{const{width:d}=nr({aetherKey:e,box:c,telem:t,level:n,color:s,backgroundTelem:B.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:B.scaleNumber({scale:u.b.Scale.scale(i).scale(0,1).transform}),gradient:B.colorGradient({gradient:r})},outlet:"gradient"}),location:{x:"center",y:"center"}}),x=p=>a(e,p);return o.jsxRuntimeExports.jsx(er,{id:e,selected:l,onClick:x,onContextMenu:x,style:{height:"5rem",width:d},className:u.CSS(E.CONTEXT_TARGET,l&&E.CONTEXT_SELECTED,u.CSS.BEM("table","cell","value"))})},c1=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return o.jsxRuntimeExports.jsx(te.Space,{direction:"y",style:{padding:"2rem"},children:o.jsxRuntimeExports.jsx(tr,{path:""})});case"redline":return o.jsxRuntimeExports.jsx(te.Space,{direction:"y",style:{padding:"2rem"},children:o.jsxRuntimeExports.jsx(a1,{})});default:return o.jsxRuntimeExports.jsx(te.Space,{direction:"y",grow:!0,empty:!0,style:{padding:"2rem"},children:o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(ac,{onChange:e,value:"value"})}),o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:r,onChange:i,variant:l,...c})=>o.jsxRuntimeExports.jsx(E.Swatch,{value:r??u.ZERO.setAlpha(1).rgba255,onChange:a=>i(a.rgba255),...c,bordered:!0})}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:r=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...r})})]})})}},[]),n=Me.useStatic({tabs:[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],content:t});return o.jsxRuntimeExports.jsx(Me.Tabs,{...n})},a1=()=>{const{set:e,get:t}=tt(),n=$l("redline.bounds"),s=u.b.Scale.scale(0,1).scale(n);return o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(zt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Lower",path:"redline.bounds.lower"}),o.jsxRuntimeExports.jsx(ye,{path:"redline.gradient",label:"Gradient",align:"start",padHelpText:!1,children:({value:r,onChange:i})=>o.jsxRuntimeExports.jsx(E.GradientPicker,{value:Z._.copy(r),scale:s,onChange:l=>{const a={...t("redline.bounds").value},d=l.map(j=>j.position),x=s.pos(Math.max(...d)),p=s.pos(Math.min(...d)),m=x>a.upper,f=p<a.lower;m&&(l[l.length-1].position=1,a.upper=x),f&&(l[0].position=0,a.lower=p);const h=l.map(j=>({...j,color:new u.Color(j.color).hex}));m||f?e("redline",{bounds:a,gradient:h}):i(l.map(j=>({...j,color:new u.Color(j.color).hex})))}})}),o.jsxRuntimeExports.jsx(zt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Upper",path:"redline.bounds.upper"})]})},u1=({onVariantChange:e})=>o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,style:{padding:"2rem"},children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(ac,{onChange:e,value:"text"})}),o.jsxRuntimeExports.jsx(Ko,{path:"value",label:"Text"}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"weight",label:"Weight",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ve.SelectWeight,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"align",label:"Alignment",hideIfNull:!0,children:t=>o.jsxRuntimeExports.jsx(ms,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(E.Swatch,{value:t,onChange:n})})]}),d1=[{key:"text",name:"Text"},{key:"value",name:"Value"}],ac=({onChange:e,value:t})=>o.jsxRuntimeExports.jsx(ve.Button,{value:t,onChange:e,data:d1,allowMultiple:!1,entryRenderKey:"name"}),x1=["text","value"],p1=ce.z.enum(x1),m1={key:"value",name:"Value",Form:c1,Cell:l1,defaultProps:e=>({telem:B.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:B.streamChannelValue({channel:0}),rollingAverage:B.rollingAverage({windowSize:1}),stringifier:B.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"}),redline:{bounds:{lower:0,upper:1},gradient:[]},color:e.colors.gray.l8.hex,level:"h5",units:""}),schema:i1},f1={key:"text",name:"Text",Form:u1,Cell:r1,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:o1},h1={text:f1,value:m1},g1=Object.freeze(Object.defineProperty({__proto__:null,CELLS:h1,variantZ:p1},Symbol.toStringTag,{value:"Module"})),Hr=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=jt(e,...n);return u.G.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Zr=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:i})=>{if(!j1({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=u.g.construct(t),c=u.g.swap(l);let a=St(c,s[c]-e[c]);const d=u.Mt.loc(n,a);if(u.K.swap(t)===r){const x=u.Mt.loc(i,u.K.swap(a));Math.abs(d-x)<Ae&&(a=u.K.swap(a))}return{direction:c,length:d-e[c]+wt(a,Ae)}},po=ce.z.object({direction:u.g.direction,length:ce.z.number()}),jt=(e,...t)=>{let n=e;for(const s of t)n=u.G.translate(n,s.direction,s.length);return n},uc=(e,t,n,s)=>{try{let r=e;const i=[e,...t.map(f=>(r=u.G.translate(r,f.direction,f.length),r))];if(!s)return i;const l=t[0],c=St(l.direction,l.length),a=Gr(c),d=4*(2-n**.5);i[0]=u.G.translate(i[0],{[l.direction]:-1*a*d,[u.g.swap(l.direction)]:0});const x=t[t.length-1],p=St(x.direction,x.length),m=Gr(p);return i[i.length-1]=u.G.translate(i[i.length-1],{[x.direction]:m*d,[u.g.swap(x.direction)]:0}),i}catch{return[]}},Ae=10,Gr=e=>e==="top"||e==="left"?-1:1,wt=(e,t)=>e==="top"||e==="left"?-t:t,St=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ct=e=>St(e.direction,e.length),j1=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=u.g.construct(n),r=t[s]-e[s];return wt(n,r)<0},kn=e=>({direction:u.g.construct(e),length:wt(e,Ae)}),Yr={top:kn("top"),bottom:kn("bottom"),left:kn("left"),right:kn("right")},E1=4,y1=.25,js=e=>mo(S1(mo(e))),S1=e=>{const t=[...e],n=e.findIndex((s,r)=>{const i=Math.abs(s.length);if(i<E1){if(r===0||r===e.length-1)return!1;if(i<y1)return!0;if(e.length<=3)return!1;if(r+2<e.length){const l=t[r+2];if(l.direction!==s.direction)return!1;t[r+2]={...l,length:l.length+s.length}}else{const l=t[r-2];if(l.direction!==s.direction)return!1;t[r-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},mo=e=>{const t=[...e];return e.findIndex((s,r)=>{const i=t[r-1];if(r===0||s.direction!==i.direction)return!1;if(r===1){const l=r-1,c=r,a=ct(i),d=ct(s);if(a===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(i.length)===Ae)return!1;const x=wt(a,Ae),p=t[l].length-x,m=t[c].length+p;return Math.abs(m)<Ae?!1:(t[l]={...t[l],length:x},t[c]={...t[c],length:m},!0)}if(r===e.length-1){const l=r,c=r-1,a=ct(s),d=ct(i);if(a===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(s.length)===Ae)return!1;const x=wt(a,Ae),p=t[l].length-x,m=t[c].length+p;return Math.abs(m)<Ae?!1:(t[l]={...t[l],length:x},t[c]={...t[c],length:m},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?mo(t):t},Tt=e=>js(R1(e)),R1=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:i})=>{let l=i,c=r,a={...Yr[i]},d=jt(n,a);const x={...Yr[r]};let p=jt(s,x);const m=Math.abs(d.x-p.x),f=Math.abs(d.y-p.y);m<2*Ae&&f<10&&(a.length-=m/2,x.length+=m/2,d=jt(n,a),p=jt(s,x));const h=[a],j=Zr({sourceStumpTip:d,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});j!=null&&(h.push(j),d=jt(d,j),l=ct(j),a=j);const y=Zr({sourceStumpTip:p,sourceOrientation:c,sourceBox:t,targetStumpTip:d,targetOrientation:l,targetBox:e});y!=null&&(p=jt(p,y),c=St(y.direction,y.length));const S=()=>{y!=null&&(y.length*=-1,h.push(y)),x.length*=-1,h.push(x)};if(u.K.swap(l)===r){const k=u.g.construct(l),T=(p[k]-d[k])/2;h.push({direction:k,length:T});const A=u.g.swap(k);return h.push({direction:A,length:p[A]-d[A]}),h.push({direction:k,length:T}),S(),h}const M=p[a.direction]-d[a.direction];let C=u.g.swap(a.direction);const b=d[C]-p[C];let w;St(a.direction,M)===l&&St(C,b)===c?w={direction:a.direction,length:M}:(w={direction:C,length:p[C]-d[C]},C=u.g.swap(C)),h.push(w);const P={direction:C,length:p[C]-d[C]};return h.push(P),S(),h},C1=e=>js(b1(e)),b1=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],i=u.g.swap(r.direction),l=ct(r);if(t===0){s.unshift({direction:i,length:n});const c=wt(l,Ae);s.unshift({direction:r.direction,length:c}),t+=2,s[t]={...s[t],length:s[t].length-c}}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 c=wt(l,Ae);s.push({direction:r.direction,length:c}),s[t]={...s[t],length:s[t].length-c}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},w1=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},v1=(e,t,n=!1,...s)=>{const r=(i,l)=>!s.includes(l)&&t(i,l);return n?w1(e,r):e.findIndex(r)},M1=({delta:e,segments:t})=>js(dc(e,t,!1)),k1=({delta:e,segments:t})=>js(dc(e,t,!0)),dc=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Kr("x",e,s,n)),e.y!==0&&(s=Kr("y",e,s,n)),s},Wr=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=ct(t),i=ct(s),l=Math.abs(s.length),c=Math.abs(t.length);return(l>c||l>Ae)&&r===i},Kr=(e,t,n,s)=>{const r=u.g.swap(e),i=s?n.length-1:0,l=n[i];if(Wr(e,l,t)){const p=n[n.length-1];return p.direction===e&&Math.abs(l.length)<Ae?(n[n.length-1]={...p,length:p.length-t[e]},n):(n[i]={...l,length:l.length-t[e]},n)}const c=s?0:n.length-1,d=v1(n,p=>p.direction===e,s,i);if(d===c){const p=n[c];return Wr(e,p,t)?(n[c]={...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[c]={...p,length:p.length-t[e]},n)}if(d===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:r,length:n[0].length/2},{direction:e,length:-t[e]},{direction:r,length:n[0].length/2}]:l.direction===e?(n[i]={...l,length:l.length-t[e]},n):[{direction:r,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const x=n[d];return n[d]={...x,length:x.length-t[e]},n},_1=ce.z.object({position:u.G.xy,zoom:ce.z.number()}),xc=ce.z.object({color:u.crudeZ,variant:ce.z.string().optional(),segments:ce.z.array(po)}),P1=xc.extend({key:ce.z.string(),source:ce.z.string(),target:ce.z.string(),segments:ce.z.array(po),color:u.crudeZ,id:ce.z.string(),data:ce.z.object({segments:ce.z.array(po),color:u.crudeZ,variant:ce.z.string().optional()}).optional(),selected:ce.z.boolean(),sourceHandle:ce.z.string().nullable().optional(),targetHandle:ce.z.string().nullable().optional()}),L1=ce.z.object({key:ce.z.string(),position:u.G.xy,selected:ce.z.boolean().optional(),zIndex:ce.z.number().optional(),type:ce.z.string().optional(),data:ce.z.record(ce.z.unknown()).optional(),measured:ce.z.object({width:ce.z.number().optional(),height:ce.z.number().optional()}).optional()}),sr=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),or=e=>e.map(({segments:t,color:n,variant:s,...r})=>({...r,id:r.key,data:{segments:t,color:n,variant:s}})),pc=e=>e.map(t=>({key:t.id,...t})),mc=(e,t)=>e.map(n=>{var s,r,i;return n.data??(n.data={segments:[],color:t,variant:"pipe"}),{key:n.id,segments:((s=n.data)==null?void 0:s.segments)??[],selected:n.selected??!1,color:((r=n.data)==null?void 0:r.color)??t,variant:((i=n.data)==null?void 0:i.variant)??"pipe",...n}}),fc=e=>({...e.position,zoom:e.zoom}),hc=e=>({position:u.G.construct(e),zoom:e.zoom}),gc=(e,t)=>pc(t(sr(e))),Vn=(e,t,n)=>mc(t(or(e)),n),N1=(e,t="x")=>{if(e.length===0)return[];const n=u.K.construct(t),s=u.K.swap(n);return e.sort((r,i)=>u.Mt.loc(r.box,n)-u.Mt.loc(i.box,n)),e.forEach((r,i)=>{if(i===0)return;const c=e[i-1].handles.find(f=>f.orientation===s),a=r.handles.find(f=>f.orientation===n);if(c==null||a==null)return;const d=c.absolutePosition,x=a.absolutePosition,p=u.G.set(u.G.translation(x,d),t,0),m=u.G.translate(u.Mt.topLeft(r.box),p);r.box=u.Mt.construct(m,u.Mt.dims(r.box))}),e};function _e(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=_e(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var T1={value:()=>{}};function Es(){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 Fn(n)}function Fn(e){this._=e}function A1(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Fn.prototype=Es.prototype={constructor:Fn,on:function(e,t){var n=this._,s=A1(e+"",n),r,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((r=(e=s[i]).type)&&(r=I1(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(r=(e=s[i]).type)n[r]=Xr(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Xr(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Fn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function I1(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function Xr(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=T1,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var fo="http://www.w3.org/1999/xhtml";const qr={svg:"http://www.w3.org/2000/svg",xhtml:fo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ys(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),qr.hasOwnProperty(t)?{space:qr[t],local:e}:e}function $1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fo&&t.documentElement.namespaceURI===fo?t.createElement(e):t.createElementNS(n,e)}}function z1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jc(e){var t=ys(e);return(t.local?z1:$1)(t)}function B1(){}function rr(e){return e==null?B1:function(){return this.querySelector(e)}}function D1(e){typeof e!="function"&&(e=rr(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=new Array(l),a,d,x=0;x<l;++x)(a=i[x])&&(d=e.call(a,a.__data__,x,i))&&("__data__"in a&&(d.__data__=a.__data__),c[x]=d);return new ze(s,this._parents)}function O1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function V1(){return[]}function Ec(e){return e==null?V1:function(){return this.querySelectorAll(e)}}function F1(e){return function(){return O1(e.apply(this,arguments))}}function H1(e){typeof e=="function"?e=F1(e):e=Ec(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var l=t[i],c=l.length,a,d=0;d<c;++d)(a=l[d])&&(s.push(e.call(a,a.__data__,d,l)),r.push(a));return new ze(s,r)}function yc(e){return function(){return this.matches(e)}}function Sc(e){return function(t){return t.matches(e)}}var Z1=Array.prototype.find;function G1(e){return function(){return Z1.call(this.children,e)}}function Y1(){return this.firstElementChild}function W1(e){return this.select(e==null?Y1:G1(typeof e=="function"?e:Sc(e)))}var K1=Array.prototype.filter;function X1(){return Array.from(this.children)}function q1(e){return function(){return K1.call(this.children,e)}}function U1(e){return this.selectAll(e==null?X1:q1(typeof e=="function"?e:Sc(e)))}function J1(e){typeof e!="function"&&(e=yc(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=[],a,d=0;d<l;++d)(a=i[d])&&e.call(a,a.__data__,d,i)&&c.push(a);return new ze(s,this._parents)}function Rc(e){return new Array(e.length)}function Q1(){return new ze(this._enter||this._groups.map(Rc),this._parents)}function ss(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ss.prototype={constructor:ss,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 ej(e){return function(){return e}}function tj(e,t,n,s,r,i){for(var l=0,c,a=t.length,d=i.length;l<d;++l)(c=t[l])?(c.__data__=i[l],s[l]=c):n[l]=new ss(e,i[l]);for(;l<a;++l)(c=t[l])&&(r[l]=c)}function nj(e,t,n,s,r,i,l){var c,a,d=new Map,x=t.length,p=i.length,m=new Array(x),f;for(c=0;c<x;++c)(a=t[c])&&(m[c]=f=l.call(a,a.__data__,c,t)+"",d.has(f)?r[c]=a:d.set(f,a));for(c=0;c<p;++c)f=l.call(e,i[c],c,i)+"",(a=d.get(f))?(s[c]=a,a.__data__=i[c],d.delete(f)):n[c]=new ss(e,i[c]);for(c=0;c<x;++c)(a=t[c])&&d.get(m[c])===a&&(r[c]=a)}function sj(e){return e.__data__}function oj(e,t){if(!arguments.length)return Array.from(this,sj);var n=t?nj:tj,s=this._parents,r=this._groups;typeof e!="function"&&(e=ej(e));for(var i=r.length,l=new Array(i),c=new Array(i),a=new Array(i),d=0;d<i;++d){var x=s[d],p=r[d],m=p.length,f=rj(e.call(x,x&&x.__data__,d,s)),h=f.length,j=c[d]=new Array(h),y=l[d]=new Array(h),S=a[d]=new Array(m);n(x,p,j,y,S,f,t);for(var M=0,C=0,b,w;M<h;++M)if(b=j[M]){for(M>=C&&(C=M+1);!(w=y[C])&&++C<h;);b._next=w||null}}return l=new ze(l,s),l._enter=c,l._exit=a,l}function rj(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ij(){return new ze(this._exit||this._groups.map(Rc),this._parents)}function lj(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function cj(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,l=Math.min(r,i),c=new Array(r),a=0;a<l;++a)for(var d=n[a],x=s[a],p=d.length,m=c[a]=new Array(p),f,h=0;h<p;++h)(f=d[h]||x[h])&&(m[h]=f);for(;a<r;++a)c[a]=n[a];return new ze(c,this._parents)}function aj(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],l;--r>=0;)(l=s[r])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function uj(e){e||(e=dj);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var l=n[i],c=l.length,a=r[i]=new Array(c),d,x=0;x<c;++x)(d=l[x])&&(a[x]=d);a.sort(t)}return new ze(r,this._parents).order()}function dj(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function xj(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pj(){return Array.from(this)}function mj(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var l=s[r];if(l)return l}return null}function fj(){let e=0;for(const t of this)++e;return e}function hj(){return!this.node()}function gj(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,l=r.length,c;i<l;++i)(c=r[i])&&e.call(c,c.__data__,i,r);return this}function jj(e){return function(){this.removeAttribute(e)}}function Ej(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yj(e,t){return function(){this.setAttribute(e,t)}}function Sj(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Rj(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Cj(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 bj(e,t){var n=ys(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?Ej:jj:typeof t=="function"?n.local?Cj:Rj:n.local?Sj:yj)(n,t))}function Cc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function wj(e){return function(){this.style.removeProperty(e)}}function vj(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Mj(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function kj(e,t,n){return arguments.length>1?this.each((t==null?wj:typeof t=="function"?Mj:vj)(e,t,n??"")):Dt(this.node(),e)}function Dt(e,t){return e.style.getPropertyValue(t)||Cc(e).getComputedStyle(e,null).getPropertyValue(t)}function _j(e){return function(){delete this[e]}}function Pj(e,t){return function(){this[e]=t}}function Lj(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Nj(e,t){return arguments.length>1?this.each((t==null?_j:typeof t=="function"?Lj:Pj)(e,t)):this.node()[e]}function bc(e){return e.trim().split(/^|\s+/)}function ir(e){return e.classList||new wc(e)}function wc(e){this._node=e,this._names=bc(e.getAttribute("class")||"")}wc.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 vc(e,t){for(var n=ir(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function Mc(e,t){for(var n=ir(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function Tj(e){return function(){vc(this,e)}}function Aj(e){return function(){Mc(this,e)}}function Ij(e,t){return function(){(t.apply(this,arguments)?vc:Mc)(this,e)}}function $j(e,t){var n=bc(e+"");if(arguments.length<2){for(var s=ir(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?Ij:t?Tj:Aj)(n,t))}function zj(){this.textContent=""}function Bj(e){return function(){this.textContent=e}}function Dj(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Oj(e){return arguments.length?this.each(e==null?zj:(typeof e=="function"?Dj:Bj)(e)):this.node().textContent}function Vj(){this.innerHTML=""}function Fj(e){return function(){this.innerHTML=e}}function Hj(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Zj(e){return arguments.length?this.each(e==null?Vj:(typeof e=="function"?Hj:Fj)(e)):this.node().innerHTML}function Gj(){this.nextSibling&&this.parentNode.appendChild(this)}function Yj(){return this.each(Gj)}function Wj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Kj(){return this.each(Wj)}function Xj(e){var t=typeof e=="function"?e:jc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qj(){return null}function Uj(e,t){var n=typeof e=="function"?e:jc(e),s=t==null?qj:typeof t=="function"?t:rr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function Jj(){var e=this.parentNode;e&&e.removeChild(this)}function Qj(){return this.each(Jj)}function e0(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function t0(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function n0(e){return this.select(e?t0:e0)}function s0(e){return arguments.length?this.property("__data__",e):this.node().__data__}function o0(e){return function(t){e.call(this,t,this.__data__)}}function r0(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 i0(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function l0(e,t,n){return function(){var s=this.__on,r,i=o0(t);if(s){for(var l=0,c=s.length;l<c;++l)if((r=s[l]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function c0(e,t,n){var s=r0(e+""),r,i=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var a=0,d=c.length,x;a<d;++a)for(r=0,x=c[a];r<i;++r)if((l=s[r]).type===x.type&&l.name===x.name)return x.value}return}for(c=t?l0:i0,r=0;r<i;++r)this.each(c(s[r],t,n));return this}function kc(e,t,n){var s=Cc(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function a0(e,t){return function(){return kc(this,e,t)}}function u0(e,t){return function(){return kc(this,e,t.apply(this,arguments))}}function d0(e,t){return this.each((typeof t=="function"?u0:a0)(e,t))}function*x0(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,l;r<i;++r)(l=s[r])&&(yield l)}var _c=[null];function ze(e,t){this._groups=e,this._parents=t}function Sn(){return new ze([[document.documentElement]],_c)}function p0(){return this}ze.prototype=Sn.prototype={constructor:ze,select:D1,selectAll:H1,selectChild:W1,selectChildren:U1,filter:J1,data:oj,enter:Q1,exit:ij,join:lj,merge:cj,selection:p0,order:aj,sort:uj,call:xj,nodes:pj,node:mj,size:fj,empty:hj,each:gj,attr:bj,style:kj,property:Nj,classed:$j,text:Oj,html:Zj,raise:Yj,lower:Kj,append:Xj,insert:Uj,remove:Qj,clone:n0,datum:s0,on:c0,dispatch:d0,[Symbol.iterator]:x0};function $e(e){return typeof e=="string"?new ze([[document.querySelector(e)]],[document.documentElement]):new ze([[e]],_c)}function m0(e){let t;for(;t=e.sourceEvent;)e=t;return e}function De(e,t){if(e=m0(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const f0={passive:!1},xn={capture:!0,passive:!1};function Ks(e){e.stopImmediatePropagation()}function $t(e){e.preventDefault(),e.stopImmediatePropagation()}function Pc(e){var t=e.document.documentElement,n=$e(e).on("dragstart.drag",$t,xn);"onselectstart"in t?n.on("selectstart.drag",$t,xn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Lc(e,t){var n=e.document.documentElement,s=$e(e).on("dragstart.drag",null);t&&(s.on("click.drag",$t,xn),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 _n=e=>()=>e;function ho(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:l,y:c,dx:a,dy:d,dispatch:x}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:x}})}ho.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function h0(e){return!e.ctrlKey&&!e.button}function g0(){return this.parentNode}function j0(e,t){return t??{x:e.x,y:e.y}}function E0(){return navigator.maxTouchPoints||"ontouchstart"in this}function Nc(){var e=h0,t=g0,n=j0,s=E0,r={},i=Es("start","drag","end"),l=0,c,a,d,x,p=0;function m(b){b.on("mousedown.drag",f).filter(s).on("touchstart.drag",y).on("touchmove.drag",S,f0).on("touchend.drag touchcancel.drag",M).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(b,w){if(!(x||!e.call(this,b,w))){var P=C(this,t.call(this,b,w),b,w,"mouse");P&&($e(b.view).on("mousemove.drag",h,xn).on("mouseup.drag",j,xn),Pc(b.view),Ks(b),d=!1,c=b.clientX,a=b.clientY,P("start",b))}}function h(b){if($t(b),!d){var w=b.clientX-c,P=b.clientY-a;d=w*w+P*P>p}r.mouse("drag",b)}function j(b){$e(b.view).on("mousemove.drag mouseup.drag",null),Lc(b.view,d),$t(b),r.mouse("end",b)}function y(b,w){if(e.call(this,b,w)){var P=b.changedTouches,k=t.call(this,b,w),T=P.length,A,I;for(A=0;A<T;++A)(I=C(this,k,b,w,P[A].identifier,P[A]))&&(Ks(b),I("start",b,P[A]))}}function S(b){var w=b.changedTouches,P=w.length,k,T;for(k=0;k<P;++k)(T=r[w[k].identifier])&&($t(b),T("drag",b,w[k]))}function M(b){var w=b.changedTouches,P=w.length,k,T;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),k=0;k<P;++k)(T=r[w[k].identifier])&&(Ks(b),T("end",b,w[k]))}function C(b,w,P,k,T,A){var I=i.copy(),F=De(A||P,w),$,z,R;if((R=n.call(b,new ho("beforestart",{sourceEvent:P,target:m,identifier:T,active:l,x:F[0],y:F[1],dx:0,dy:0,dispatch:I}),k))!=null)return $=R.x-F[0]||0,z=R.y-F[1]||0,function N(_,D,L){var V=F,H;switch(_){case"start":r[T]=N,H=l++;break;case"end":delete r[T],--l;case"drag":F=De(L||D,w),H=l;break}I.call(_,b,new ho(_,{sourceEvent:D,subject:R,target:m,identifier:T,active:H,x:F[0]+$,y:F[1]+z,dx:F[0]-V[0],dy:F[1]-V[1],dispatch:I}),k)}}return m.filter=function(b){return arguments.length?(e=typeof b=="function"?b:_n(!!b),m):e},m.container=function(b){return arguments.length?(t=typeof b=="function"?b:_n(b),m):t},m.subject=function(b){return arguments.length?(n=typeof b=="function"?b:_n(b),m):n},m.touchable=function(b){return arguments.length?(s=typeof b=="function"?b:_n(!!b),m):s},m.on=function(){var b=i.on.apply(i,arguments);return b===i?m:b},m.clickDistance=function(b){return arguments.length?(p=(b=+b)*b,m):Math.sqrt(p)},m}var Ot=0,nn=0,en=0,Tc=1e3,os,sn,rs=0,vt=0,Ss=0,pn=typeof performance=="object"&&performance.now?performance:Date,Ac=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function lr(){return vt||(Ac(y0),vt=pn.now()+Ss)}function y0(){vt=0}function is(){this._call=this._time=this._next=null}is.prototype=Ic.prototype={constructor:is,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?lr():+n)+(t==null?0:+t),!this._next&&sn!==this&&(sn?sn._next=this:os=this,sn=this),this._call=e,this._time=n,go()},stop:function(){this._call&&(this._call=null,this._time=1/0,go())}};function Ic(e,t,n){var s=new is;return s.restart(e,t,n),s}function S0(){lr(),++Ot;for(var e=os,t;e;)(t=vt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ot}function Ur(){vt=(rs=pn.now())+Ss,Ot=nn=0;try{S0()}finally{Ot=0,C0(),vt=0}}function R0(){var e=pn.now(),t=e-rs;t>Tc&&(Ss-=t,rs=e)}function C0(){for(var e,t=os,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:os=n);sn=e,go(s)}function go(e){if(!Ot){nn&&(nn=clearTimeout(nn));var t=e-vt;t>24?(e<1/0&&(nn=setTimeout(Ur,e-pn.now()-Ss)),en&&(en=clearInterval(en))):(en||(rs=pn.now(),en=setInterval(R0,Tc)),Ot=1,Ac(Ur))}}function Jr(e,t,n){var s=new is;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var b0=Es("start","end","cancel","interrupt"),w0=[],$c=0,Qr=1,jo=2,Hn=3,ei=4,Eo=5,Zn=6;function Rs(e,t,n,s,r,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;v0(e,n,{name:t,index:s,group:r,on:b0,tween:w0,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:$c})}function cr(e,t){var n=He(e,t);if(n.state>$c)throw new Error("too late; already scheduled");return n}function Xe(e,t){var n=He(e,t);if(n.state>Hn)throw new Error("too late; already running");return n}function He(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function v0(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=Ic(i,0,n.time);function i(d){n.state=Qr,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var x,p,m,f;if(n.state!==Qr)return a();for(x in s)if(f=s[x],f.name===n.name){if(f.state===Hn)return Jr(l);f.state===ei?(f.state=Zn,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete s[x]):+x<t&&(f.state=Zn,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete s[x])}if(Jr(function(){n.state===Hn&&(n.state=ei,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=jo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===jo){for(n.state=Hn,r=new Array(m=n.tween.length),x=0,p=-1;x<m;++x)(f=n.tween[x].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=f);r.length=p+1}}function c(d){for(var x=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(a),n.state=Eo,1),p=-1,m=r.length;++p<m;)r[p].call(e,x);n.state===Eo&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Zn,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function Gn(e,t){var n=e.__transition,s,r,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){i=!1;continue}r=s.state>jo&&s.state<Eo,s.state=Zn,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function M0(e){return this.each(function(){Gn(this,e)})}function k0(e,t){var n,s;return function(){var r=Xe(this,e),i=r.tween;if(i!==n){s=n=i;for(var l=0,c=s.length;l<c;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}r.tween=s}}function _0(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=Xe(this,e),l=i.tween;if(l!==s){r=(s=l).slice();for(var c={name:t,value:n},a=0,d=r.length;a<d;++a)if(r[a].name===t){r[a]=c;break}a===d&&r.push(c)}i.tween=r}}function P0(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=He(this.node(),n).tween,r=0,i=s.length,l;r<i;++r)if((l=s[r]).name===e)return l.value;return null}return this.each((t==null?k0:_0)(n,e,t))}function ar(e,t,n){var s=e._id;return e.each(function(){var r=Xe(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return He(r,s).value[t]}}function zc(e,t){var n;return(typeof t=="number"?B.interpolateNumber:t instanceof B.color?B.interpolateRgb:(n=B.color(t))?(t=n,B.interpolateRgb):B.interpolateString)(e,t)}function L0(e){return function(){this.removeAttribute(e)}}function N0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function T0(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttribute(e);return l===r?null:l===s?i:i=t(s=l,n)}}function A0(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===r?null:l===s?i:i=t(s=l,n)}}function I0(e,t,n){var s,r,i;return function(){var l,c=n(this),a;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),a=c+"",l===a?null:l===s&&a===r?i:(r=a,i=t(s=l,c)))}}function $0(e,t,n){var s,r,i;return function(){var l,c=n(this),a;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),a=c+"",l===a?null:l===s&&a===r?i:(r=a,i=t(s=l,c)))}}function z0(e,t){var n=ys(e),s=n==="transform"?Sf:zc;return this.attrTween(e,typeof t=="function"?(n.local?$0:I0)(n,s,ar(this,"attr."+e,t)):t==null?(n.local?N0:L0)(n):(n.local?A0:T0)(n,s,t))}function B0(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function D0(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function O0(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&D0(e,i)),n}return r._value=t,r}function V0(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&B0(e,i)),n}return r._value=t,r}function F0(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=ys(e);return this.tween(n,(s.local?O0:V0)(s,t))}function H0(e,t){return function(){cr(this,e).delay=+t.apply(this,arguments)}}function Z0(e,t){return t=+t,function(){cr(this,e).delay=t}}function G0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?H0:Z0)(t,e)):He(this.node(),t).delay}function Y0(e,t){return function(){Xe(this,e).duration=+t.apply(this,arguments)}}function W0(e,t){return t=+t,function(){Xe(this,e).duration=t}}function K0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Y0:W0)(t,e)):He(this.node(),t).duration}function X0(e,t){if(typeof t!="function")throw new Error;return function(){Xe(this,e).ease=t}}function q0(e){var t=this._id;return arguments.length?this.each(X0(t,e)):He(this.node(),t).ease}function U0(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Xe(this,e).ease=n}}function J0(e){if(typeof e!="function")throw new Error;return this.each(U0(this._id,e))}function Q0(e){typeof e!="function"&&(e=yc(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=[],a,d=0;d<l;++d)(a=i[d])&&e.call(a,a.__data__,d,i)&&c.push(a);return new et(s,this._parents,this._name,this._id)}function e2(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),l=new Array(s),c=0;c<i;++c)for(var a=t[c],d=n[c],x=a.length,p=l[c]=new Array(x),m,f=0;f<x;++f)(m=a[f]||d[f])&&(p[f]=m);for(;c<s;++c)l[c]=t[c];return new et(l,this._parents,this._name,this._id)}function t2(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 n2(e,t,n){var s,r,i=t2(t)?cr:Xe;return function(){var l=i(this,e),c=l.on;c!==s&&(r=(s=c).copy()).on(t,n),l.on=r}}function s2(e,t){var n=this._id;return arguments.length<2?He(this.node(),n).on.on(e):this.each(n2(n,e,t))}function o2(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function r2(){return this.on("end.remove",o2(this._id))}function i2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=rr(e));for(var s=this._groups,r=s.length,i=new Array(r),l=0;l<r;++l)for(var c=s[l],a=c.length,d=i[l]=new Array(a),x,p,m=0;m<a;++m)(x=c[m])&&(p=e.call(x,x.__data__,m,c))&&("__data__"in x&&(p.__data__=x.__data__),d[m]=p,Rs(d[m],t,n,m,d,He(x,n)));return new et(i,this._parents,t,n)}function l2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ec(e));for(var s=this._groups,r=s.length,i=[],l=[],c=0;c<r;++c)for(var a=s[c],d=a.length,x,p=0;p<d;++p)if(x=a[p]){for(var m=e.call(x,x.__data__,p,a),f,h=He(x,n),j=0,y=m.length;j<y;++j)(f=m[j])&&Rs(f,t,n,j,m,h);i.push(m),l.push(x)}return new et(i,l,t,n)}var c2=Sn.prototype.constructor;function a2(){return new c2(this._groups,this._parents)}function u2(e,t){var n,s,r;return function(){var i=Dt(this,e),l=(this.style.removeProperty(e),Dt(this,e));return i===l?null:i===n&&l===s?r:r=t(n=i,s=l)}}function Bc(e){return function(){this.style.removeProperty(e)}}function d2(e,t,n){var s,r=n+"",i;return function(){var l=Dt(this,e);return l===r?null:l===s?i:i=t(s=l,n)}}function x2(e,t,n){var s,r,i;return function(){var l=Dt(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),Dt(this,e))),l===a?null:l===s&&a===r?i:(r=a,i=t(s=l,c))}}function p2(e,t){var n,s,r,i="style."+t,l="end."+i,c;return function(){var a=Xe(this,e),d=a.on,x=a.value[i]==null?c||(c=Bc(t)):void 0;(d!==n||r!==x)&&(s=(n=d).copy()).on(l,r=x),a.on=s}}function m2(e,t,n){var s=(e+="")=="transform"?yf:zc;return t==null?this.styleTween(e,u2(e,s)).on("end.style."+e,Bc(e)):typeof t=="function"?this.styleTween(e,x2(e,s,ar(this,"style."+e,t))).each(p2(this._id,e)):this.styleTween(e,d2(e,s,t),n).on("end.style."+e,null)}function f2(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function h2(e,t,n){var s,r;function i(){var l=t.apply(this,arguments);return l!==r&&(s=(r=l)&&f2(e,l,n)),s}return i._value=t,i}function g2(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,h2(e,t,n??""))}function j2(e){return function(){this.textContent=e}}function E2(e){return function(){var t=e(this);this.textContent=t??""}}function y2(e){return this.tween("text",typeof e=="function"?E2(ar(this,"text",e)):j2(e==null?"":e+""))}function S2(e){return function(t){this.textContent=e.call(this,t)}}function R2(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&S2(r)),t}return s._value=e,s}function C2(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,R2(e))}function b2(){for(var e=this._name,t=this._id,n=Dc(),s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],c=l.length,a,d=0;d<c;++d)if(a=l[d]){var x=He(a,t);Rs(a,e,n,d,l,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new et(s,this._parents,e,n)}function w2(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,l){var c={value:l},a={value:function(){--r===0&&i()}};n.each(function(){var d=Xe(this,s),x=d.on;x!==e&&(t=(e=x).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(a)),d.on=t}),r===0&&i()})}var v2=0;function et(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Dc(){return++v2}var Ue=Sn.prototype;et.prototype={constructor:et,select:i2,selectAll:l2,selectChild:Ue.selectChild,selectChildren:Ue.selectChildren,filter:Q0,merge:e2,selection:a2,transition:b2,call:Ue.call,nodes:Ue.nodes,node:Ue.node,size:Ue.size,empty:Ue.empty,each:Ue.each,on:s2,attr:z0,attrTween:F0,style:m2,styleTween:g2,text:y2,textTween:C2,remove:r2,tween:P0,delay:G0,duration:K0,ease:q0,easeVarying:J0,end:w2,[Symbol.iterator]:Ue[Symbol.iterator]};function M2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var k2={time:null,delay:0,duration:250,ease:M2};function _2(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 P2(e){var t,n;e instanceof et?(t=e._id,e=e._name):(t=Dc(),(n=k2).time=lr(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],c=l.length,a,d=0;d<c;++d)(a=l[d])&&Rs(a,e,t,d,l,n||_2(a,t));return new et(s,this._parents,e,t)}Sn.prototype.interrupt=M0;Sn.prototype.transition=P2;const Pn=e=>()=>e;function L2(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function Je(e,t,n){this.k=e,this.x=t,this.y=n}Je.prototype={constructor:Je,scale:function(e){return e===1?this:new Je(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Je(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 Cs=new Je(1,0,0);Oc.prototype=Je.prototype;function Oc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Cs;return e.__zoom}function Xs(e){e.stopImmediatePropagation()}function tn(e){e.preventDefault(),e.stopImmediatePropagation()}function N2(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function T2(){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 ti(){return this.__zoom||Cs}function A2(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function I2(){return navigator.maxTouchPoints||"ontouchstart"in this}function $2(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function Vc(){var e=N2,t=T2,n=$2,s=A2,r=I2,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=wf,d=Es("start","zoom","end"),x,p,m,f=500,h=150,j=0,y=10;function S(R){R.property("__zoom",ti).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",I).filter(r).on("touchstart.zoom",F).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(R,N,_,D){var L=R.selection?R.selection():R;L.property("__zoom",ti),R!==L?w(R,N,_,D):L.interrupt().each(function(){P(this,arguments).event(D).start().zoom(null,typeof N=="function"?N.apply(this,arguments):N).end()})},S.scaleBy=function(R,N,_,D){S.scaleTo(R,function(){var L=this.__zoom.k,V=typeof N=="function"?N.apply(this,arguments):N;return L*V},_,D)},S.scaleTo=function(R,N,_,D){S.transform(R,function(){var L=t.apply(this,arguments),V=this.__zoom,H=_==null?b(L):typeof _=="function"?_.apply(this,arguments):_,G=V.invert(H),q=typeof N=="function"?N.apply(this,arguments):N;return n(C(M(V,q),H,G),L,l)},_,D)},S.translateBy=function(R,N,_,D){S.transform(R,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,D)},S.translateTo=function(R,N,_,D,L){S.transform(R,function(){var V=t.apply(this,arguments),H=this.__zoom,G=D==null?b(V):typeof D=="function"?D.apply(this,arguments):D;return n(Cs.translate(G[0],G[1]).scale(H.k).translate(typeof N=="function"?-N.apply(this,arguments):-N,typeof _=="function"?-_.apply(this,arguments):-_),V,l)},D,L)};function M(R,N){return N=Math.max(i[0],Math.min(i[1],N)),N===R.k?R:new Je(N,R.x,R.y)}function C(R,N,_){var D=N[0]-_[0]*R.k,L=N[1]-_[1]*R.k;return D===R.x&&L===R.y?R:new Je(R.k,D,L)}function b(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function w(R,N,_,D){R.on("start.zoom",function(){P(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(D).end()}).tween("zoom",function(){var L=this,V=arguments,H=P(L,V).event(D),G=t.apply(L,V),q=_==null?b(G):typeof _=="function"?_.apply(L,V):_,oe=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),ee=L.__zoom,ne=typeof N=="function"?N.apply(L,V):N,se=a(ee.invert(q).concat(oe/ee.k),ne.invert(q).concat(oe/ne.k));return function(ie){if(ie===1)ie=ne;else{var U=se(ie),ue=oe/U[2];ie=new Je(ue,q[0]-U[0]*ue,q[1]-U[1]*ue)}H.zoom(null,ie)}})}function P(R,N,_){return!_&&R.__zooming||new k(R,N)}function k(R,N){this.that=R,this.args=N,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,N),this.taps=0}k.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,N){return this.mouse&&R!=="mouse"&&(this.mouse[1]=N.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=N.invert(this.touch0[0])),this.touch1&&R!=="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(R){var N=$e(this.that).datum();d.call(R,this.that,new L2(R,{sourceEvent:this.sourceEvent,target:S,type:R,transform:this.that.__zoom,dispatch:d}),N)}};function T(R,...N){if(!e.apply(this,arguments))return;var _=P(this,N).event(R),D=this.__zoom,L=Math.max(i[0],Math.min(i[1],D.k*Math.pow(2,s.apply(this,arguments)))),V=De(R);if(_.wheel)(_.mouse[0][0]!==V[0]||_.mouse[0][1]!==V[1])&&(_.mouse[1]=D.invert(_.mouse[0]=V)),clearTimeout(_.wheel);else{if(D.k===L)return;_.mouse=[V,D.invert(V)],Gn(this),_.start()}tn(R),_.wheel=setTimeout(H,h),_.zoom("mouse",n(C(M(D,L),_.mouse[0],_.mouse[1]),_.extent,l));function H(){_.wheel=null,_.end()}}function A(R,...N){if(m||!e.apply(this,arguments))return;var _=R.currentTarget,D=P(this,N,!0).event(R),L=$e(R.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",oe,!0),V=De(R,_),H=R.clientX,G=R.clientY;Pc(R.view),Xs(R),D.mouse=[V,this.__zoom.invert(V)],Gn(this),D.start();function q(ee){if(tn(ee),!D.moved){var ne=ee.clientX-H,se=ee.clientY-G;D.moved=ne*ne+se*se>j}D.event(ee).zoom("mouse",n(C(D.that.__zoom,D.mouse[0]=De(ee,_),D.mouse[1]),D.extent,l))}function oe(ee){L.on("mousemove.zoom mouseup.zoom",null),Lc(ee.view,D.moved),tn(ee),D.event(ee).end()}}function I(R,...N){if(e.apply(this,arguments)){var _=this.__zoom,D=De(R.changedTouches?R.changedTouches[0]:R,this),L=_.invert(D),V=_.k*(R.shiftKey?.5:2),H=n(C(M(_,V),D,L),t.apply(this,N),l);tn(R),c>0?$e(this).transition().duration(c).call(w,H,D,R):$e(this).call(S.transform,H,D,R)}}function F(R,...N){if(e.apply(this,arguments)){var _=R.touches,D=_.length,L=P(this,N,R.changedTouches.length===D).event(R),V,H,G,q;for(Xs(R),H=0;H<D;++H)G=_[H],q=De(G,this),q=[q,this.__zoom.invert(q),G.identifier],L.touch0?!L.touch1&&L.touch0[2]!==q[2]&&(L.touch1=q,L.taps=0):(L.touch0=q,V=!0,L.taps=1+!!x);x&&(x=clearTimeout(x)),V&&(L.taps<2&&(p=q[0],x=setTimeout(function(){x=null},f)),Gn(this),L.start())}}function $(R,...N){if(this.__zooming){var _=P(this,N).event(R),D=R.changedTouches,L=D.length,V,H,G,q;for(tn(R),V=0;V<L;++V)H=D[V],G=De(H,this),_.touch0&&_.touch0[2]===H.identifier?_.touch0[0]=G:_.touch1&&_.touch1[2]===H.identifier&&(_.touch1[0]=G);if(H=_.that.__zoom,_.touch1){var oe=_.touch0[0],ee=_.touch0[1],ne=_.touch1[0],se=_.touch1[1],ie=(ie=ne[0]-oe[0])*ie+(ie=ne[1]-oe[1])*ie,U=(U=se[0]-ee[0])*U+(U=se[1]-ee[1])*U;H=M(H,Math.sqrt(ie/U)),G=[(oe[0]+ne[0])/2,(oe[1]+ne[1])/2],q=[(ee[0]+se[0])/2,(ee[1]+se[1])/2]}else if(_.touch0)G=_.touch0[0],q=_.touch0[1];else return;_.zoom("touch",n(C(H,G,q),_.extent,l))}}function z(R,...N){if(this.__zooming){var _=P(this,N).event(R),D=R.changedTouches,L=D.length,V,H;for(Xs(R),m&&clearTimeout(m),m=setTimeout(function(){m=null},f),V=0;V<L;++V)H=D[V],_.touch0&&_.touch0[2]===H.identifier?delete _.touch0:_.touch1&&_.touch1[2]===H.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(H=De(H,this),Math.hypot(p[0]-H[0],p[1]-H[1])<y)){var G=$e(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return S.wheelDelta=function(R){return arguments.length?(s=typeof R=="function"?R:Pn(+R),S):s},S.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Pn(!!R),S):e},S.touchable=function(R){return arguments.length?(r=typeof R=="function"?R:Pn(!!R),S):r},S.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Pn([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),S):t},S.scaleExtent=function(R){return arguments.length?(i[0]=+R[0],i[1]=+R[1],S):[i[0],i[1]]},S.translateExtent=function(R){return arguments.length?(l[0][0]=+R[0][0],l[1][0]=+R[1][0],l[0][1]=+R[0][1],l[1][1]=+R[1][1],S):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},S.constrain=function(R){return arguments.length?(n=R,S):n},S.duration=function(R){return arguments.length?(c=+R,S):c},S.interpolate=function(R){return arguments.length?(a=R,S):a},S.on=function(){var R=d.on.apply(d,arguments);return R===d?S:R},S.clickDistance=function(R){return arguments.length?(j=(R=+R)*R,S):Math.sqrt(j)},S.tapDistance=function(R){return arguments.length?(y=+R,S):y},S}const Ie={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},mn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Fc=["Enter"," ","Escape"];var Mt;(function(e){e.Strict="strict",e.Loose="loose"})(Mt||(Mt={}));var Rt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Rt||(Rt={}));var Vt;(function(e){e.Partial="partial",e.Full="full"})(Vt||(Vt={}));const Hc={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var lt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(lt||(lt={}));var ls;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ls||(ls={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const ni={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Zc(e){return e===null?null:e?"valid":"invalid"}const Gc=e=>"id"in e&&"source"in e&&"target"in e,z2=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ur=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Rn=(e,t=[0,0])=>{const{width:n,height:s}=st(e),r=e.origin??t,i=n*r[0],l=s*r[1];return{x:e.position.x-i,y:e.position.y-l}},B2=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,r)=>{const i=typeof r=="string";let l=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(r):ur(r)?r:t.nodeLookup.get(r.id));const c=l?cs(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return bs(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ws(n)},Cn=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(s=>{if(t.filter===void 0||t.filter(s)){const r=cs(s);n=bs(n,r)}}),ws(n)},Yc=(e,t,[n,s,r]=[0,0,1],i=!1,l=!1)=>{const c={...bn(t,[n,s,r]),width:t.width/r,height:t.height/r},a=[];for(const d of e.values()){const{measured:x,selectable:p=!0,hidden:m=!1}=d;if(l&&!p||m)continue;const f=x.width??d.width??d.initialWidth??null,h=x.height??d.height??d.initialHeight??null,j=fn(c,Ht(d)),y=(f??0)*(h??0),S=i&&j>0;(!d.internals.handleBounds||S||j>=y||d.dragging)&&a.push(d)}return a},D2=(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 yo(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function So({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},l){if(e.size===0)return Promise.resolve(!1);const c=Cn(e),a=dr(c,t,n,(l==null?void 0:l.minZoom)??r,(l==null?void 0:l.maxZoom)??i,(l==null?void 0:l.padding)??.1);return await s.setViewport(a,{duration:l==null?void 0:l.duration}),Promise.resolve(!0)}function Wc({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:a,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},x=l.origin??s;let p=r;if(l.extent==="parent"&&!l.expandParent)if(!c)i==null||i("005",Ie.error005());else{const f=c.measured.width,h=c.measured.height;f&&h&&(p=[[a,d],[a+f,d+h]])}else c&&Zt(l.extent)&&(p=[[l.extent[0][0]+a,l.extent[0][1]+d],[l.extent[1][0]+a,l.extent[1][1]+d]]);const m=Zt(p)?kt(t,p,l.measured):t;return{position:{x:m.x-a+l.measured.width*x[0],y:m.y-d+l.measured.height*x[1]},positionAbsolute:m}}async function O2({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(m=>m.id)),l=[];for(const m of n){if(m.deletable===!1)continue;const f=i.has(m.id),h=!f&&m.parentId&&l.find(j=>j.id===m.parentId);(f||h)&&l.push(m)}const c=new Set(t.map(m=>m.id)),a=s.filter(m=>m.deletable!==!1),x=D2(l,a);for(const m of a)c.has(m.id)&&!x.find(h=>h.id===m.id)&&x.push(m);if(!r)return{edges:x,nodes:l};const p=await r({nodes:l,edges:x});return typeof p=="boolean"?p?{edges:x,nodes:l}:{edges:[],nodes:[]}:p}const Ft=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),kt=(e={x:0,y:0},t,n)=>({x:Ft(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ft(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Kc(e,t,n){const{width:s,height:r}=st(n),{x:i,y:l}=n.internals.positionAbsolute;return kt(e,[[i,l],[i+s,l+r]],t)}const si=(e,t,n)=>e<t?Ft(Math.abs(e-t),1,t)/t:e>n?-Ft(Math.abs(e-n),1,t)/t:0,Xc=(e,t,n=15,s=40)=>{const r=si(e.x,s,t.width-s)*n,i=si(e.y,s,t.height-s)*n;return[r,i]},bs=(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)}),Ro=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),ws=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Ht=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=ur(e)?e.internals.positionAbsolute:Rn(e,t);return{x:n,y:s,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},cs=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=ur(e)?e.internals.positionAbsolute:Rn(e,t);return{x:n,y:s,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:s+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},qc=(e,t)=>ws(bs(Ro(e),Ro(t))),fn=(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)},oi=e=>Oe(e.width)&&Oe(e.height)&&Oe(e.x)&&Oe(e.y),Oe=e=>!isNaN(e)&&isFinite(e),as=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},vs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bn=({x:e,y:t},[n,s,r],i=!1,l=[1,1])=>{const c={x:(e-n)/r,y:(t-s)/r};return i?vs(c,l):c},Uc=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s}),dr=(e,t,n,s,r,i)=>{const l=t/(e.width*(1+i)),c=n/(e.height*(1+i)),a=Math.min(l,c),d=Ft(a,s,r),x=e.x+e.width/2,p=e.y+e.height/2,m=t/2-x*d,f=n/2-p*d;return{x:m,y:f,zoom:d}},us=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Zt(e){return e!==void 0&&e!=="parent"}function st(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Jc(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Qc(e,t={width:0,height:0},n,s,r){const i={...e},l=s.get(n);if(l){const c=l.origin||r;i.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],i.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return i}function rn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:l}=Qe(e),c=bn({x:i-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)},s),{x:a,y:d}=n?vs(c,t):c;return{xSnapped:a,ySnapped:d,...c}}const Ms=e=>({width:e.offsetWidth,height:e.offsetHeight}),ea=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},V2=["INPUT","SELECT","TEXTAREA"];function Co(e){var s,r,i;const t=((r=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:r[0])||e.target;return V2.includes(t==null?void 0:t.nodeName)||((i=t==null?void 0:t.hasAttribute)==null?void 0:i.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const ta=e=>"clientX"in e,Qe=(e,t)=>{var i,l;const n=ta(e),s=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,r=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},ri=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:r,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/s,y:(c.top-n.top)/s,...Ms(l)}})};function na({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:l,targetControlY:c}){const a=e*.125+r*.375+l*.375+n*.125,d=t*.125+i*.375+c*.375+s*.125,x=Math.abs(a-e),p=Math.abs(d-t);return[a,d,x,p]}function Ln(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ii({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case X.Left:return[t-Ln(t-s,i),n];case X.Right:return[t+Ln(s-t,i),n];case X.Top:return[t,n-Ln(n-r,i)];case X.Bottom:return[t,n+Ln(r-n,i)]}}function sa({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top,curvature:l=.25}){const[c,a]=ii({pos:n,x1:e,y1:t,x2:s,y2:r,c:l}),[d,x]=ii({pos:i,x1:s,y1:r,x2:e,y2:t,c:l}),[p,m,f,h]=na({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:c,sourceControlY:a,targetControlX:d,targetControlY:x});return[`M${e},${t} C${c},${a} ${d},${x} ${s},${r}`,p,m,f,h]}function oa({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,l=Math.abs(s-t)/2,c=s<t?s+l:s-l;return[i,c,r,l]}function F2({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:r=!1}){if(!r)return s;const i=n||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return s+(i?l:0)}function H2({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=bs(cs(e),cs(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return fn(l,ws(i))>0}const ra=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,Z2=(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)),ia=(e,t)=>{if(!e.source||!e.target)return as("006",Ie.error006()),t;let n;return Gc(e)?n={...e}:n={...e,id:ra(e)},Z2(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},G2=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...i}=e;if(!t.source||!t.target)return as("006",Ie.error006()),n;if(!n.find(a=>a.id===e.id))return as("007",Ie.error007(r)),n;const c={...i,id:s.shouldReplaceId?ra(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==r).concat(c)};function la({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,l,c]=oa({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,l,c]}const li={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},Y2=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},ci=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function W2({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:s=X.Top,center:r,offset:i}){const l=li[t],c=li[s],a={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},x=Y2({source:a,sourcePosition:t,target:d}),p=x.x!==0?"x":"y",m=x[p];let f=[],h,j;const y={x:0,y:0},S={x:0,y:0},[M,C,b,w]=oa({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*c[p]===-1){h=r.x??M,j=r.y??C;const k=[{x:h,y:a.y},{x:h,y:d.y}],T=[{x:a.x,y:j},{x:d.x,y:j}];l[p]===m?f=p==="x"?k:T:f=p==="x"?T:k}else{const k=[{x:a.x,y:d.y}],T=[{x:d.x,y:a.y}];if(p==="x"?f=l.x===m?T:k:f=l.y===m?k:T,t===s){const z=Math.abs(e[p]-n[p]);if(z<=i){const R=Math.min(i-1,i-z);l[p]===m?y[p]=(a[p]>e[p]?-1:1)*R:S[p]=(d[p]>n[p]?-1:1)*R}}if(t!==s){const z=p==="x"?"y":"x",R=l[p]===c[z],N=a[z]>d[z],_=a[z]<d[z];(l[p]===1&&(!R&&N||R&&_)||l[p]!==1&&(!R&&_||R&&N))&&(f=p==="x"?k:T)}const A={x:a.x+y.x,y:a.y+y.y},I={x:d.x+S.x,y:d.y+S.y},F=Math.max(Math.abs(A.x-f[0].x),Math.abs(I.x-f[0].x)),$=Math.max(Math.abs(A.y-f[0].y),Math.abs(I.y-f[0].y));F>=$?(h=(A.x+I.x)/2,j=f[0].y):(h=f[0].x,j=(A.y+I.y)/2)}return[[e,{x:a.x+y.x,y:a.y+y.y},...f,{x:d.x+S.x,y:d.y+S.y},n],h,j,b,w]}function K2(e,t,n,s){const r=Math.min(ci(e,t)/2,ci(t,n)/2,s),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const d=e.x<n.x?-1:1,x=e.y<n.y?1:-1;return`L ${i+r*d},${l}Q ${i},${l} ${i},${l+r*x}`}const c=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${l+r*a}Q ${i},${l} ${i+r*c},${l}`}function bo({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top,borderRadius:l=5,centerX:c,centerY:a,offset:d=20}){const[x,p,m,f,h]=W2({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:c,y:a},offset:d});return[x.reduce((y,S,M)=>{let C="";return M>0&&M<x.length-1?C=K2(x[M-1],S,x[M+1],l):C=`${M===0?"M":"L"}${S.x} ${S.y}`,y+=C,y},""),p,m,f,h]}function ai(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function X2(e){var p;const{sourceNode:t,targetNode:n}=e;if(!ai(t)||!ai(n))return null;const s=t.internals.handleBounds||ui(t.handles),r=n.internals.handleBounds||ui(n.handles),i=di((s==null?void 0:s.source)??[],e.sourceHandle),l=di(e.connectionMode===Mt.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!i||!l)return(p=e.onError)==null||p.call(e,"008",Ie.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(i==null?void 0:i.position)||X.Bottom,a=(l==null?void 0:l.position)||X.Top,d=hn(t,i,c),x=hn(n,l,a);return{sourceX:d.x,sourceY:d.y,targetX:x.x,targetY:x.y,sourcePosition:c,targetPosition:a}}function ui(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 hn(e,t,n=X.Left,s=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??st(e);if(s)return{x:r+l/2,y:i+c/2};switch((t==null?void 0:t.position)??n){case X.Top:return{x:r+l/2,y:i};case X.Right:return{x:r+l,y:i+c/2};case X.Bottom:return{x:r+l/2,y:i+c};case X.Left:return{x:r,y:i+c/2}}}function di(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function wo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function q2(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((l,c)=>([c.markerStart||s,c.markerEnd||r].forEach(a=>{if(a&&typeof a=="object"){const d=wo(a,t);i.has(d)||(l.push({id:d,color:a.color||n,...a}),i.add(d))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const xr={nodeOrigin:[0,0],nodeExtent:mn,elevateNodesOnSelect:!0,defaults:{}},U2={...xr,checkEquality:!0};function pr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function J2(e,t,n){const s=pr(xr,n);for(const r of e.values())if(r.parentId)mr(r,e,t,s);else{const i=Rn(r,s.nodeOrigin),l=Zt(r.extent)?r.extent:s.nodeExtent,c=kt(i,l,st(r));r.internals.positionAbsolute=c}}function vo(e,t,n,s){var c,a;const r=pr(U2,s),i=new Map(t),l=r!=null&&r.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const d of e){let x=i.get(d.id);if(r.checkEquality&&d===(x==null?void 0:x.internals.userNode))t.set(d.id,x);else{const p=Rn(d,r.nodeOrigin),m=Zt(d.extent)?d.extent:r.nodeExtent,f=kt(p,m,st(d));x={...r.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(a=d.measured)==null?void 0:a.height},internals:{positionAbsolute:f,handleBounds:d.measured?x==null?void 0:x.internals.handleBounds:void 0,z:ca(d,l),userNode:d}},t.set(d.id,x)}d.parentId&&mr(x,t,n,s)}}function Q2(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 mr(e,t,n,s){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:l}=pr(xr,s),c=e.parentId,a=t.get(c);if(!a){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Q2(e,n);const d=r?1e3:0,{x,y:p,z:m}=e3(e,a,i,l,d),{positionAbsolute:f}=e.internals,h=x!==f.x||p!==f.y;(h||m!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:h?{x,y:p}:f,z:m})}function ca(e,t){return(Oe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function e3(e,t,n,s,r){const{x:i,y:l}=t.internals.positionAbsolute,c=st(e),a=Rn(e,n),d=Zt(e.extent)?kt(a,e.extent,c):a;let x=kt({x:i+d.x,y:l+d.y},s,c);e.extent==="parent"&&(x=Kc(x,c,t));const p=ca(e,r),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>p?m:p}}function fr(e,t,n,s=[0,0]){var l;const r=[],i=new Map;for(const c of e){const a=t.get(c.parentId);if(!a)continue;const d=((l=i.get(c.parentId))==null?void 0:l.expandedRect)??Ht(a),x=qc(d,c.rect);i.set(c.parentId,{expandedRect:x,parent:a})}return i.size>0&&i.forEach(({expandedRect:c,parent:a},d)=>{var C;const x=a.internals.positionAbsolute,p=st(a),m=a.origin??s,f=c.x<x.x?Math.round(Math.abs(x.x-c.x)):0,h=c.y<x.y?Math.round(Math.abs(x.y-c.y)):0,j=Math.max(p.width,Math.round(c.width)),y=Math.max(p.height,Math.round(c.height)),S=(j-p.width)*m[0],M=(y-p.height)*m[1];(f>0||h>0||S||M)&&(r.push({id:d,type:"position",position:{x:a.position.x-f+S,y:a.position.y-h+M}}),(C=n.get(d))==null||C.forEach(b=>{e.some(w=>w.id===b.id)||r.push({id:b.id,type:"position",position:{x:b.position.x+f,y:b.position.y+h}})})),(p.width<c.width||p.height<c.height||f||h)&&r.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:j+(f?m[0]*f-S:0),height:y+(h?m[1]*h-M:0)}})}),r}function t3(e,t,n,s,r,i){const l=s==null?void 0:s.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const a=[],d=window.getComputedStyle(l),{m22:x}=new window.DOMMatrixReadOnly(d.transform),p=[];for(const m of e.values()){const f=t.get(m.id);if(f)if(f.hidden)f.internals={...f.internals,handleBounds:void 0},c=!0;else{const h=Ms(m.nodeElement),j=f.measured.width!==h.width||f.measured.height!==h.height;if(!!(h.width&&h.height&&(j||!f.internals.handleBounds||m.force))){const S=m.nodeElement.getBoundingClientRect(),M=Zt(f.extent)?f.extent:i;let{positionAbsolute:C}=f.internals;f.parentId&&f.extent==="parent"?C=Kc(C,h,t.get(f.parentId)):M&&(C=kt(C,M,h)),f.measured=h,f.internals={...f.internals,positionAbsolute:C,handleBounds:{source:ri("source",m.nodeElement,S,x,f.id),target:ri("target",m.nodeElement,S,x,f.id)}},f.parentId&&mr(f,t,n,{nodeOrigin:r}),c=!0,j&&(a.push({id:f.id,type:"dimensions",dimensions:h}),f.expandParent&&f.parentId&&p.push({id:f.id,parentId:f.parentId,rect:Ht(f,r)}))}}}if(p.length>0){const m=fr(p,t,n,r);a.push(...m)}return{changes:a,updatedInternals:c}}async function n3({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],s),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function aa(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:l=null,targetHandle:c=null}=s,a=`${r}-source-${l}`,d=`${i}-target-${c}`,x=e.get(a)||new Map,p=e.get(d)||new Map,m={edgeId:s.id,source:r,target:i,sourceHandle:l,targetHandle:c};t.set(s.id,s),e.set(a,x.set(`${i}-${c}`,m)),e.set(d,p.set(`${r}-${l}`,m))}}function ua(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:ua(n,t):!1}function xi(e,t,n){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===n)return!1;s=s.parentElement}while(s);return!1}function s3(e,t,n,s){const r=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!ua(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(i);c&&r.set(i,{id:i,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return r}function qs({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var l,c,a;const r=[];for(const[d,x]of t){const p=(l=n.get(d))==null?void 0:l.internals.userNode;p&&r.push({...p,position:x.position,dragging:s})}if(!e)return[r[0],r];const i=(c=n.get(e))==null?void 0:c.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:s}:r[0],r]}function o3({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},l=0,c=new Map,a=!1,d={x:0,y:0},x=null,p=!1,m=null,f=!1;function h({noDragClassName:y,handleSelector:S,domNode:M,isSelectable:C,nodeId:b,nodeClickDistance:w=0}){m=$e(M);function P({x:I,y:F},$){const{nodeLookup:z,nodeExtent:R,snapGrid:N,snapToGrid:_,nodeOrigin:D,onNodeDrag:L,onSelectionDrag:V,onError:H,updateNodePositions:G}=t();i={x:I,y:F};let q=!1,oe={x:0,y:0,x2:0,y2:0};if(c.size>1&&R){const ee=Cn(c);oe=Ro(ee)}for(const[ee,ne]of c){if(!z.has(ee))continue;let se={x:I-ne.distance.x,y:F-ne.distance.y};_&&(se=vs(se,N));let ie=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(c.size>1&&R&&!ne.extent){const{positionAbsolute:ge}=ne.internals,pe=ge.x-oe.x+R[0][0],re=ge.x+ne.measured.width-oe.x2+R[1][0],Q=ge.y-oe.y+R[0][1],le=ge.y+ne.measured.height-oe.y2+R[1][1];ie=[[pe,Q],[re,le]]}const{position:U,positionAbsolute:ue}=Wc({nodeId:ee,nextPosition:se,nodeLookup:z,nodeExtent:ie,nodeOrigin:D,onError:H});q=q||ne.position.x!==U.x||ne.position.y!==U.y,ne.position=U,ne.internals.positionAbsolute=ue}if(q&&(G(c,!0),$&&(s||L||!b&&V))){const[ee,ne]=qs({nodeId:b,dragItems:c,nodeLookup:z});s==null||s($,c,ee,ne),L==null||L($,ee,ne),b||V==null||V($,ne)}}async function k(){if(!x)return;const{transform:I,panBy:F,autoPanSpeed:$}=t(),[z,R]=Xc(d,x,$);(z!==0||R!==0)&&(i.x=(i.x??0)-z/I[2],i.y=(i.y??0)-R/I[2],await F({x:z,y:R})&&P(i,null)),l=requestAnimationFrame(k)}function T(I){var q;const{nodeLookup:F,multiSelectionActive:$,nodesDraggable:z,transform:R,snapGrid:N,snapToGrid:_,selectNodesOnDrag:D,onNodeDragStart:L,onSelectionDragStart:V,unselectNodesAndEdges:H}=t();p=!0,(!D||!C)&&!$&&b&&((q=F.get(b))!=null&&q.selected||H()),C&&D&&b&&(e==null||e(b));const G=rn(I.sourceEvent,{transform:R,snapGrid:N,snapToGrid:_,containerBounds:x});if(i=G,c=s3(F,z,G,b),c.size>0&&(n||L||!b&&V)){const[oe,ee]=qs({nodeId:b,dragItems:c,nodeLookup:F});n==null||n(I.sourceEvent,c,oe,ee),L==null||L(I.sourceEvent,oe,ee),b||V==null||V(I.sourceEvent,ee)}}const A=Nc().clickDistance(w).on("start",I=>{const{domNode:F,nodeDragThreshold:$,transform:z,snapGrid:R,snapToGrid:N}=t();x=(F==null?void 0:F.getBoundingClientRect())||null,f=!1,$===0&&T(I),i=rn(I.sourceEvent,{transform:z,snapGrid:R,snapToGrid:N,containerBounds:x}),d=Qe(I.sourceEvent,x)}).on("drag",I=>{const{autoPanOnNodeDrag:F,transform:$,snapGrid:z,snapToGrid:R,nodeDragThreshold:N,nodeLookup:_}=t(),D=rn(I.sourceEvent,{transform:$,snapGrid:z,snapToGrid:R,containerBounds:x});if((I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||b&&!_.has(b))&&(f=!0),!f){if(!a&&F&&p&&(a=!0,k()),!p){const L=D.xSnapped-(i.x??0),V=D.ySnapped-(i.y??0);Math.sqrt(L*L+V*V)>N&&T(I)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&c&&p&&(d=Qe(I.sourceEvent,x),P(D,I.sourceEvent))}}).on("end",I=>{if(!(!p||f)&&(a=!1,p=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:F,updateNodePositions:$,onNodeDragStop:z,onSelectionDragStop:R}=t();if($(c,!1),r||z||!b&&R){const[N,_]=qs({nodeId:b,dragItems:c,nodeLookup:F,dragging:!1});r==null||r(I.sourceEvent,c,N,_),z==null||z(I.sourceEvent,N,_),b||R==null||R(I.sourceEvent,_)}}}).filter(I=>{const F=I.target;return!I.button&&(!y||!xi(F,`.${y}`,M))&&(!S||xi(F,S,M))});m.call(A)}function j(){m==null||m.on(".drag",null)}return{update:h,destroy:j}}function r3(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())fn(r,Ht(i))>0&&s.push(i);return s}const i3=250;function l3(e,t,n,s){var c,a;let r=[],i=1/0;const l=r3(e,n,t+i3);for(const d of l){const x=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((a=d.internals.handleBounds)==null?void 0:a.target)??[]];for(const p of x){if(s.nodeId===p.nodeId&&s.type===p.type&&s.id===p.id)continue;const{x:m,y:f}=hn(d,p,p.position,!0),h=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(f-e.y,2));h>t||(h<i?(r=[{...p,x:m,y:f}],i=h):h===i&&r.push({...p,x:m,y:f}))}}if(!r.length)return null;if(r.length>1){const d=s.type==="source"?"target":"source";return r.find(x=>x.type===d)??r[0]}return r[0]}function da(e,t,n,s,r,i=!1){var d,x,p;const l=s.get(e);if(!l)return null;const c=r==="strict"?(d=l.internals.handleBounds)==null?void 0:d[t]:[...((x=l.internals.handleBounds)==null?void 0:x.source)??[],...((p=l.internals.handleBounds)==null?void 0:p.target)??[]],a=(n?c==null?void 0:c.find(m=>m.id===n):c==null?void 0:c[0])??null;return a&&i?{...a,...hn(l,a,a.position,!0)}:a}function xa(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function c3(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const pa=()=>!0;function a3(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:l,domNode:c,nodeLookup:a,lib:d,autoPanOnConnect:x,flowId:p,panBy:m,cancelConnection:f,onConnectStart:h,onConnect:j,onConnectEnd:y,isValidConnection:S=pa,onReconnectEnd:M,updateConnection:C,getTransform:b,getFromHandle:w,autoPanSpeed:P}){const k=ea(e.target);let T=0,A;const{x:I,y:F}=Qe(e),$=k==null?void 0:k.elementFromPoint(I,F),z=xa(i,$),R=c==null?void 0:c.getBoundingClientRect();if(!R||!z)return;const N=da(r,z,s,a,t);if(!N)return;let _=Qe(e,R),D=!1,L=null,V=!1,H=null;function G(){if(!x||!R)return;const[ue,ge]=Xc(_,R,P);m({x:ue,y:ge}),T=requestAnimationFrame(G)}const q={...N,nodeId:r,type:z,position:N.position},oe=a.get(r),ne={inProgress:!0,isValid:null,from:hn(oe,q,X.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:oe,to:_,toHandle:null,toPosition:ni[q.position],toNode:null};C(ne);let se=ne;h==null||h(e,{nodeId:r,handleId:s,handleType:z});function ie(ue){if(!w()||!q){U(ue);return}const ge=b();_=Qe(ue,R),A=l3(bn(_,ge,!1,[1,1]),n,a,q),D||(G(),D=!0);const pe=ma(ue,{handle:A,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:l?"target":"source",isValidConnection:S,doc:k,lib:d,flowId:p,nodeLookup:a});H=pe.handleDomNode,L=pe.connection,V=c3(!!A,pe.isValid);const re={...se,isValid:V,to:A&&V?Uc({x:A.x,y:A.y},ge):_,toHandle:pe.toHandle,toPosition:V&&pe.toHandle?pe.toHandle.position:ni[q.position],toNode:pe.toHandle?a.get(pe.toHandle.nodeId):null};V&&A&&se.toHandle&&re.toHandle&&se.toHandle.type===re.toHandle.type&&se.toHandle.nodeId===re.toHandle.nodeId&&se.toHandle.id===re.toHandle.id&&se.to.x===re.to.x&&se.to.y===re.to.y||(C(re),se=re)}function U(ue){(A||H)&&L&&V&&(j==null||j(L));const{inProgress:ge,...pe}=se,re={...pe,toPosition:se.toHandle?se.toPosition:null};y==null||y(ue,re),i&&(M==null||M(ue,re)),f(),cancelAnimationFrame(T),D=!1,V=!1,L=null,H=null,k.removeEventListener("mousemove",ie),k.removeEventListener("mouseup",U),k.removeEventListener("touchmove",ie),k.removeEventListener("touchend",U)}k.addEventListener("mousemove",ie),k.addEventListener("mouseup",U),k.addEventListener("touchmove",ie),k.addEventListener("touchend",U)}function ma(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:l,lib:c,flowId:a,isValidConnection:d=pa,nodeLookup:x}){const p=i==="target",m=t?l.querySelector(`.${c}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:f,y:h}=Qe(e),j=l.elementFromPoint(f,h),y=j!=null&&j.classList.contains(`${c}-flow__handle`)?j:m,S={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const M=xa(void 0,y),C=y.getAttribute("data-nodeid"),b=y.getAttribute("data-handleid"),w=y.classList.contains("connectable"),P=y.classList.contains("connectableend");if(!C||!M)return S;const k={source:p?C:s,sourceHandle:p?b:r,target:p?s:C,targetHandle:p?r:b};S.connection=k;const A=w&&P&&(n===Mt.Strict?p&&M==="source"||!p&&M==="target":C!==s||b!==r);S.isValid=A&&d(k),S.toHandle=da(C,M,b,x,n,!1)}return S}const Mo={onPointerDown:a3,isValid:ma};function u3({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=$e(e);function i({translateExtent:c,width:a,height:d,zoomStep:x=10,pannable:p=!0,zoomable:m=!0,inversePan:f=!1}){const h=C=>{const b=n();if(C.sourceEvent.type!=="wheel"||!t)return;const w=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*x,P=b[2]*Math.pow(2,w);t.scaleTo(P)};let j=[0,0];const y=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(j=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},S=C=>{const b=n();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!t)return;const w=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],P=[w[0]-j[0],w[1]-j[1]];j=w;const k=s()*Math.max(b[2],Math.log(b[2]))*(f?-1:1),T={x:b[0]-P[0]*k,y:b[1]-P[1]*k},A=[[0,0],[a,d]];t.setViewportConstrained({x:T.x,y:T.y,zoom:b[2]},A,c)},M=Vc().on("start",y).on("zoom",p?S:null).on("zoom.wheel",m?h:null);r.call(M,{})}function l(){r.on("zoom",null)}return{update:i,destroy:l,pointer:De}}const d3=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,ks=e=>({x:e.x,y:e.y,zoom:e.k}),Us=({x:e,y:t,zoom:n})=>Cs.translate(e,t).scale(n),At=(e,t)=>e.target.closest(`.${t}`),fa=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Js=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},ha=e=>{const t=e.ctrlKey&&us()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function x3({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:d}){return x=>{if(At(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const y=De(x),S=ha(x),M=p*Math.pow(2,S);s.scaleTo(n,M,y,x);return}const m=x.deltaMode===1?20:1;let f=r===Rt.Vertical?0:x.deltaX*m,h=r===Rt.Horizontal?0:x.deltaY*m;!us()&&x.shiftKey&&r!==Rt.Vertical&&(f=x.deltaY*m,h=0),s.translateBy(n,-(f/p)*i,-(h/p)*i,{internal:!0});const j=ks(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(x,j)),e.isPanScrolling&&(a==null||a(x,j),e.panScrollTimeout=setTimeout(()=>{d==null||d(x,j),e.isPanScrolling=!1},150))}}function p3({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){if(!t&&s.type==="wheel"&&!s.ctrlKey||At(s,e))return null;s.preventDefault(),n.call(this,s,r)}}function m3({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var i,l,c;if((i=s.sourceEvent)!=null&&i.internal)return;const r=ks(s.transform);e.mouseButton=((l=s.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((c=s.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,r))}}function f3({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{var l,c;e.usedRightMouseButton=!!(n&&fa(t,e.mouseButton??0)),(l=i.sourceEvent)!=null&&l.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!((c=i.sourceEvent)!=null&&c.internal)&&(r==null||r(i.sourceEvent,ks(i.transform)))}}function h3({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,i&&fa(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),r&&d3(e.prevViewport,l.transform))){const a=ks(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(l.sourceEvent,a)},n?150:0)}}}function g3({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:c,noPanClassName:a,lib:d}){return x=>{var h;const p=e||t,m=n&&x.ctrlKey;if(x.button===1&&x.type==="mousedown"&&(At(x,`${d}-flow__node`)||At(x,`${d}-flow__edge`)))return!0;if(!s&&!p&&!r&&!i&&!n||l||At(x,c)&&x.type==="wheel"||At(x,a)&&(x.type!=="wheel"||r&&x.type==="wheel"&&!e)||!n&&x.ctrlKey&&x.type==="wheel")return!1;if(!n&&x.type==="touchstart"&&((h=x.touches)==null?void 0:h.length)>1)return x.preventDefault(),!1;if(!p&&!r&&!m&&x.type==="wheel"||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const f=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||x.type==="wheel")&&f}}function j3({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:r,viewport:i,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:a,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=Vc().clickDistance(!Oe(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(r),f=$e(e).call(m);C({x:i.x,y:i.y,zoom:Ft(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const h=f.on("wheel.zoom"),j=f.on("dblclick.zoom");m.wheelDelta(ha);function y($,z){return f?new Promise(R=>{m==null||m.transform(Js(f,z==null?void 0:z.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function S({noWheelClassName:$,noPanClassName:z,onPaneContextMenu:R,userSelectionActive:N,panOnScroll:_,panOnDrag:D,panOnScrollMode:L,panOnScrollSpeed:V,preventScrolling:H,zoomOnPinch:G,zoomOnScroll:q,zoomOnDoubleClick:oe,zoomActivationKeyPressed:ee,lib:ne,onTransformChange:se}){N&&!x.isZoomingOrPanning&&M();const U=_&&!ee&&!N?x3({zoomPanValues:x,noWheelClassName:$,d3Selection:f,d3Zoom:m,panOnScrollMode:L,panOnScrollSpeed:V,zoomOnPinch:G,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):p3({noWheelClassName:$,preventScrolling:H,d3ZoomHandler:h});if(f.on("wheel.zoom",U,{passive:!1}),!N){const ge=m3({zoomPanValues:x,onDraggingChange:d,onPanZoomStart:c});m.on("start",ge);const pe=f3({zoomPanValues:x,panOnDrag:D,onPaneContextMenu:!!R,onPanZoom:l,onTransformChange:se});m.on("zoom",pe);const re=h3({zoomPanValues:x,panOnDrag:D,panOnScroll:_,onPaneContextMenu:R,onPanZoomEnd:a,onDraggingChange:d});m.on("end",re)}const ue=g3({zoomActivationKeyPressed:ee,panOnDrag:D,zoomOnScroll:q,panOnScroll:_,zoomOnDoubleClick:oe,zoomOnPinch:G,userSelectionActive:N,noPanClassName:z,noWheelClassName:$,lib:ne});m.filter(ue),oe?f.on("dblclick.zoom",j):f.on("dblclick.zoom",null)}function M(){m.on("zoom",null)}async function C($,z,R){const N=Us($),_=m==null?void 0:m.constrain()(N,z,R);return _&&await y(_),new Promise(D=>D(_))}async function b($,z){const R=Us($);return await y(R,z),new Promise(N=>N(R))}function w($){if(f){const z=Us($),R=f.property("__zoom");(R.k!==$.zoom||R.x!==$.x||R.y!==$.y)&&(m==null||m.transform(f,z,null,{sync:!0}))}}function P(){const $=f?Oc(f.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function k($,z){return f?new Promise(R=>{m==null||m.scaleTo(Js(f,z==null?void 0:z.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function T($,z){return f?new Promise(R=>{m==null||m.scaleBy(Js(f,z==null?void 0:z.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function A($){m==null||m.scaleExtent($)}function I($){m==null||m.translateExtent($)}function F($){const z=!Oe($)||$<0?0:$;m==null||m.clickDistance(z)}return{update:S,destroy:M,setViewport:b,setViewportConstrained:C,getViewport:P,scaleTo:k,scaleBy:T,setScaleExtent:A,setTranslateExtent:I,syncViewport:w,setClickDistance:F}}var ln;(function(e){e.Line="line",e.Handle="handle"})(ln||(ln={}));function E3({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const l=e-t,c=n-s,a=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&r&&(a[0]=a[0]*-1),c&&i&&(a[1]=a[1]*-1),a}function y3(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function rt(e,t){return Math.max(0,t-e)}function it(e,t){return Math.max(0,e-t)}function Nn(e,t,n){return Math.max(0,t-e,e-n)}function pi(e,t){return e?!t:t}function S3(e,t,n,s,r,i,l,c){let{affectsX:a,affectsY:d}=t;const{isHorizontal:x,isVertical:p}=t,m=x&&p,{xSnapped:f,ySnapped:h}=n,{minWidth:j,maxWidth:y,minHeight:S,maxHeight:M}=s,{x:C,y:b,width:w,height:P,aspectRatio:k}=e;let T=Math.floor(x?f-e.pointerX:0),A=Math.floor(p?h-e.pointerY:0);const I=w+(a?-T:T),F=P+(d?-A:A),$=-i[0]*w,z=-i[1]*P;let R=Nn(I,j,y),N=Nn(F,S,M);if(l){let L=0,V=0;a&&T<0?L=rt(C+T+$,l[0][0]):!a&&T>0&&(L=it(C+I+$,l[1][0])),d&&A<0?V=rt(b+A+z,l[0][1]):!d&&A>0&&(V=it(b+F+z,l[1][1])),R=Math.max(R,L),N=Math.max(N,V)}if(c){let L=0,V=0;a&&T>0?L=it(C+T,c[0][0]):!a&&T<0&&(L=rt(C+I,c[1][0])),d&&A>0?V=it(b+A,c[0][1]):!d&&A<0&&(V=rt(b+F,c[1][1])),R=Math.max(R,L),N=Math.max(N,V)}if(r){if(x){const L=Nn(I/k,S,M)*k;if(R=Math.max(R,L),l){let V=0;!a&&!d||a&&!d&&m?V=it(b+z+I/k,l[1][1])*k:V=rt(b+z+(a?T:-T)/k,l[0][1])*k,R=Math.max(R,V)}if(c){let V=0;!a&&!d||a&&!d&&m?V=rt(b+I/k,c[1][1])*k:V=it(b+(a?T:-T)/k,c[0][1])*k,R=Math.max(R,V)}}if(p){const L=Nn(F*k,j,y)/k;if(N=Math.max(N,L),l){let V=0;!a&&!d||d&&!a&&m?V=it(C+F*k+$,l[1][0])/k:V=rt(C+(d?A:-A)*k+$,l[0][0])/k,N=Math.max(N,V)}if(c){let V=0;!a&&!d||d&&!a&&m?V=rt(C+F*k,c[1][0])/k:V=it(C+(d?A:-A)*k,c[0][0])/k,N=Math.max(N,V)}}}A=A+(A<0?N:-N),T=T+(T<0?R:-R),r&&(m?I>F*k?A=(pi(a,d)?-T:T)/k:T=(pi(a,d)?-A:A)*k:x?(A=T/k,d=a):(T=A*k,a=d));const _=a?C+T:C,D=d?b+A:b;return{width:w+(a?-T:T),height:P+(d?-A:A),x:i[0]*T*(a?-1:1)+_,y:i[1]*A*(d?-1:1)+D}}const ga={width:0,height:0,x:0,y:0},R3={...ga,pointerX:0,pointerY:0,aspectRatio:1};function C3(e){return[[0,0],[e.measured.width,e.measured.height]]}function b3(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,c=n[0]*i,a=n[1]*l;return[[s-c,r-a],[s+i-c,r+l-a]]}function w3({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=$e(e);function l({controlPosition:a,boundaries:d,keepAspectRatio:x,onResizeStart:p,onResize:m,onResizeEnd:f,shouldResize:h}){let j={...ga},y={...R3};const S=y3(a);let M,C=null,b=[],w,P,k;const T=Nc().on("start",A=>{const{nodeLookup:I,transform:F,snapGrid:$,snapToGrid:z,nodeOrigin:R,paneDomNode:N}=n();if(M=I.get(t),!M)return;C=(N==null?void 0:N.getBoundingClientRect())??null;const{xSnapped:_,ySnapped:D}=rn(A.sourceEvent,{transform:F,snapGrid:$,snapToGrid:z,containerBounds:C});j={width:M.measured.width??0,height:M.measured.height??0,x:M.position.x??0,y:M.position.y??0},y={...j,pointerX:_,pointerY:D,aspectRatio:j.width/j.height},w=void 0,M.parentId&&(M.extent==="parent"||M.expandParent)&&(w=I.get(M.parentId),P=w&&M.extent==="parent"?C3(w):void 0),b=[],k=void 0;for(const[L,V]of I)if(V.parentId===t&&(b.push({id:L,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const H=b3(V,M,V.origin??R);k?k=[[Math.min(H[0][0],k[0][0]),Math.min(H[0][1],k[0][1])],[Math.max(H[1][0],k[1][0]),Math.max(H[1][1],k[1][1])]]:k=H}p==null||p(A,{...j})}).on("drag",A=>{const{transform:I,snapGrid:F,snapToGrid:$,nodeOrigin:z}=n(),R=rn(A.sourceEvent,{transform:I,snapGrid:F,snapToGrid:$,containerBounds:C}),N=[];if(!M)return;const{x:_,y:D,width:L,height:V}=j,H={},G=M.origin??z,{width:q,height:oe,x:ee,y:ne}=S3(y,S,R,d,x,G,P,k),se=q!==L,ie=oe!==V,U=ee!==_&&se,ue=ne!==D&&ie;if(!U&&!ue&&!se&&!ie)return;if((U||ue||G[0]===1||G[1]===1)&&(H.x=U?ee:j.x,H.y=ue?ne:j.y,j.x=H.x,j.y=H.y,b.length>0)){const Q=ee-_,le=ne-D;for(const je of b)je.position={x:je.position.x-Q+G[0]*(q-L),y:je.position.y-le+G[1]*(oe-V)},N.push(je)}if((se||ie)&&(H.width=se?q:j.width,H.height=ie?oe:j.height,j.width=H.width,j.height=H.height),w&&M.expandParent){const Q=G[0]*(H.width??0);H.x&&H.x<Q&&(j.x=Q,y.x=y.x-(H.x-Q));const le=G[1]*(H.height??0);H.y&&H.y<le&&(j.y=le,y.y=y.y-(H.y-le))}const ge=E3({width:j.width,prevWidth:L,height:j.height,prevHeight:V,affectsX:S.affectsX,affectsY:S.affectsY}),pe={...j,direction:ge};(h==null?void 0:h(A,pe))!==!1&&(m==null||m(A,pe),s(H,N))}).on("end",A=>{f==null||f(A,{...j}),r==null||r()});i.call(T)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var Tn={exports:{}},Qs={},An={exports:{}},eo={};/**
1
+ "use strict";var _m=Object.defineProperty;var Mm=(e,t,n)=>t in e?_m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ge=(e,t,n)=>Mm(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-D8EVjfnb.cjs"),g=require("react"),j=require("./Toggle-BOWYgKry.cjs"),u=require("./css-DT9dIVAb.cjs"),zn=require("./external-DkXE1VK8.cjs"),Z=require("./aggregator-B4RWbN9h.cjs"),te=require("./Pack-B7_tAsYd.cjs"),Lm=require("./external-CKXRIr4_.cjs"),ke=require("./external-CW61uh4b.cjs"),ve=require("./external-9Q86X8hc.cjs"),Pm=require("./external-CWIwuJks.cjs"),_o=require("./Animated-Cxl7iHik.cjs"),B=require("./LinePlot-C_uxbSzY.cjs"),ce=require("zod"),Wi=require("./external-Dt4ggRt2.cjs");require("./Item-C4SOBynl.cjs");const Mo=require("react-dom"),Gt=require("./external-8OKX45Jc.cjs"),Tm=require("./external-ok_ye4LF.cjs"),Ki=require("./units-BpKy5yTv.cjs"),Te=require("./external-SsIgRo40.cjs"),Nm=require("./external-kZBV4X9L.cjs"),Am=require("./external-CigHe3w_.cjs"),Im=require("./external-Ba8go3wq.cjs"),$m=require("./Video-usN9Roxq.cjs"),zm=(e,t,n=150)=>{const[s,r]=g.useState(e);return g.useEffect(()=>{const i=setTimeout(()=>r(t),n);return()=>clearTimeout(i)},[t,n]),s},Yn=e=>e.preventDefault(),Lo=({ref:e,location:t,style:n,size:s,className:r,children:i,onDragStart:l,sizeUnits:c="px",showHandle:a=!0,...d})=>{const x=u.K.construct(t),p=u.K.direction(x),m=u.g.dimension(p);return o.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.B("resize"),u.CSS.loc(x),u.CSS.dir(p),r),style:{[m]:`${s}${c}`,...n},ref:e,...d,children:[i,a&&o.jsxRuntimeExports.jsx("div",{draggable:!0,className:u.CSS(u.CSS.BE("resize","handle"),u.CSS.bordered(u.K.swap(x))),onDragStart:l,onDrag:Yn,onDragEnd:Yn})]})},Po=({onResize:e,count:t,initialSizes:n=[],minSize:s=100,direction:r="x"})=>{const i=g.useRef(null),[l,c]=g.useState({sizeDistribution:Bm(n,t),root:null}),a=g.useCallback((p,m,f)=>{if(i.current==null)return;const h=u.Tt.dim(u.Tt.construct(i.current),r);c(E=>Fs(E,h,p,s,m,f))},[s,c,r]);g.useEffect(()=>e==null?void 0:e(l.sizeDistribution),[l.sizeDistribution,e]);const d=g.useCallback((p,m)=>{p.preventDefault();const f=r==="x"?"clientX":"clientY",h=y=>a(m,y[f]),E=()=>{c(y=>({...y,root:null})),document.removeEventListener("mousemove",h)};c(y=>({...y,root:p[f]})),document.addEventListener("mousemove",h),document.addEventListener("mouseup",E,{once:!0})},[c,r,Fs]);return{setSize:g.useCallback((p,m)=>a(p,void 0,m),[Fs]),props:{direction:r,sizeDistribution:l.sizeDistribution,onDragHandle:d,ref:i}}},To=({ref:e,direction:t="x",children:n,sizeDistribution:s,onDragHandle:r,className:i,...l})=>{const c=u.g.construct(t),a=g.Children.toArray(n);return s=Dm(s),o.jsxRuntimeExports.jsx(te.Space,{...l,ref:e,direction:c,className:u.CSS(u.CSS.B("resize-multiple"),i),empty:!0,grow:!0,children:a.map((d,x)=>o.jsxRuntimeExports.jsx(Lo,{onDragStart:p=>r(p,x),location:u.g.location(c),size:s[x]*100,sizeUnits:"%",showHandle:x!==a.length-1,children:d},x))})},Bm=(e,t)=>{const n=e.reduce((r,i)=>r+i,0),s=t-e.length;if(s<=0)return e.slice(0,t).map(r=>r/n);if(e.every(r=>r<=1)){const r=1-n;return[...e,...Array(s).fill(r/s)]}return e.map(()=>1/t)},Vs=.001,Dm=e=>e.every(t=>u.G$1.closeTo(t,1/e.length),Vs)?e.map((t,n)=>n%2===0?t+Vs:n===e.length-1?t:t-Vs):e,Fs=(e,t,n,s,r,i)=>{const l=Xi(e,t,n,r,i),[c,a]=Om(e.sizeDistribution,n,l,s/t),d=a?r??null:e.root;return{...e,sizeDistribution:c,root:d}},Xi=(e,t,n,s,r)=>{let i;if(r!=null)r>1&&(r/=t),i=r-e.sizeDistribution[n];else if(s!=null){if(e.root===null)throw new Error("resize root is null during handle drag");i=(s-e.root)/t}else throw new Error("must provide either a MouseEvent or a targetSize");return i},Om=(e,t,n,s)=>{let r=t;for(;r>0&&e[r]+n<=s;)r--;const i=e[r]+n,l=Vm(r,e,s,n),c=e[l]-n;return i<s||c<s?[e,!1]:[e.map((a,d)=>d===r?i:d===l?c:a),!0]},Vm=(e,t,n,s)=>(e===t.length-1?Hm:Fm)(e,t,n,s),Fm=(e,t,n,s)=>{let r=e+1;for(;r<t.length-1&&t[r]-s<=n;)r++;return r},Hm=(e,t,n,s)=>{let r=e-1;for(;r>0&&t[r]-s<=n;)r--;return r},Hs=2,qi=({onCollapse:e,onResize:t,location:n="left",minSize:s=100,maxSize:r=1/0,initialSize:i=200,collapseThreshold:l=1/0,className:c,...a})=>{const[d,x]=g.useState(u.Y(i,s,r)),p=g.useRef(null),m=u.K.construct(n),f=g.useCallback(C=>{if(p.current===null)return 0;const b=u.Tt.dim(C,u.K.direction(m),!0)*(1-2*Number(["bottom","right"].includes(m))),w=p.current+b,L=u.Y(w,s,r);return(L-w)/s>l?Hs:L},[m,s,r,l]),h=g.useRef(null),E=g.useCallback(C=>{const b=f(C);x(b),h.current!=null&&(t==null||t(b,u.Tt.construct(h.current)))},[t,f]),y=g.useCallback(()=>x(C=>(p.current=C,C)),[x]),S=g.useCallback(C=>f(C)===Hs&&(e==null?void 0:e()),[e,f]);g.useEffect(()=>x(C=>{const b=u.Y(C,s,r);return p.current=b,b}),[s,r]);const k=j.useCursorDrag({onMove:E,onStart:y,onEnd:S});return o.jsxRuntimeExports.jsx(Lo,{ref:h,location:m,size:d,onDragStart:k,className:u.clsx(c,u.CSS.expanded(d!==Hs)),...a})},Zm=Object.freeze(Object.defineProperty({__proto__:null,Core:Lo,Multiple:To,Single:qi,calculateDiffPercentage:Xi,useMultiple:Po},Symbol.toStringTag,{value:"Module"})),No=({aetherKey:e})=>{const[,{region:t},n]=j.use$3({aetherKey:e,type:Z.Eraser.TYPE,schema:Z.eraserStateZ,initialState:{region:u.Tt.ZERO,enabled:!0}}),s=j.useSyncedRef(t),r=g.useCallback(l=>{u.Tt.equals(l,s.current)||n(c=>({...c,region:l}))},[n]);return{setEnabled:g.useCallback(l=>n(c=>({...c,enabled:l})),[n]),erase:r}},Gm=({aetherKey:e,children:t})=>{const{erase:n}=No({aetherKey:e}),s=j.useResize(n);return o.jsxRuntimeExports.jsx("div",{ref:s,className:u.CSS(u.CSS.inheritDims()),children:t})},Ym=Object.freeze(Object.defineProperty({__proto__:null,Eraser:Gm,use:No},Symbol.toStringTag,{value:"Module"})),Wm=({items:e,initialKey:t})=>{const[n,s]=g.useState(t),r=l=>s(l===n?void 0:l),i=e.find(l=>l.key===n);return{onSelect:r,activeItem:i}},Km=({activeItem:e,children:t,onSelect:n,location:s="left",collapseThreshold:r=.65,className:i,onResize:l,...c})=>{const a=u.K.direction(s),d=g.useCallback(()=>e!=null&&(n==null?void 0:n(e.key)),[n,e==null?void 0:e.key]),{erase:x,setEnabled:p}=No({}),m=g.useCallback((k,C)=>{l==null||l(k,C),x(C)},[l,x]);if(g.useLayoutEffect(()=>{p(e!=null)},[e,p]),e==null)return null;const{content:f,key:h,minSize:E,maxSize:y,initialSize:S}=e;return o.jsxRuntimeExports.jsx(qi,{className:u.CSS(u.CSS.BE("navdrawer","content"),u.CSS.dir(a),i),collapseThreshold:r,onCollapse:d,location:s,onResize:m,minSize:E,maxSize:y,initialSize:S,...c,children:f},h)},Xm=Object.freeze(Object.defineProperty({__proto__:null,Bar:j.Bar,Drawer:Km,useDrawer:Wm},Symbol.toStringTag,{value:"Module"})),Ui=({variant:e="info",...t})=>o.jsxRuntimeExports.jsx(j.Lt.Circle,{color:j.variantColors[e],...t}),qm=({status:{key:e,time:t,count:n,message:s,description:r,variant:i},silence:l,actions:c,className:a,children:d,...x})=>o.jsxRuntimeExports.jsxs(te.Space,{className:u.CSS(u.CSS.B("notification"),a),direction:"y",empty:!0,...x,children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",justify:"spaceBetween",grow:!0,style:{width:"100%"},children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",size:"small",children:[o.jsxRuntimeExports.jsx(Ui,{style:{height:"2.25rem",width:"2.5rem"},variant:i}),o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",shade:7,children:`x${n}`}),o.jsxRuntimeExports.jsx(j.DateTime,{className:u.CSS(u.CSS.BE("notification","time")),level:"small",format:"time",children:t})]}),o.jsxRuntimeExports.jsx(j.Icon,{className:u.CSS(u.CSS.BE("notification","silence")),variant:"outlined",size:"small",onClick:()=>l(e),children:o.jsxRuntimeExports.jsx(j.Lt.Close,{})})]}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",align:"start",className:u.CSS(u.CSS.BE("notification","content")),size:"small",children:[d??o.jsxRuntimeExports.jsx(j.Text$1,{className:u.CSS(u.CSS.BE("notification","message")),level:"p",style:{flexGrow:1},children:s}),r!=null&&o.jsxRuntimeExports.jsx(j.Text$1,{className:u.CSS(u.CSS.BE("notification","description")),level:"small",style:{flexGrow:1},children:r})]}),c!=null&&o.jsxRuntimeExports.jsx(te.Space,{direction:"x",align:"center",justify:"end",className:u.CSS(u.CSS.BE("notification","actions")),children:Z.A(c).map(p=>o.jsxRuntimeExports.jsx(Um,{action:p},p.key))})]},t.toString()),Um=({action:e})=>g.isValidElement(e)?e:o.jsxRuntimeExports.jsx(j.Button,{...e}),Jm=Object.freeze(Object.defineProperty({__proto__:null,Aggregator:j.Aggregator,Circle:Ui,Notification:qm,Text:j.Text$3,VARIANTS:Z.VARIANTS,specZ:Z.specZ$1,useAggregator:j.useAggregator,useContext:j.useContext$3,useExceptionHandler:j.useExceptionHandler,useNotifications:j.useNotifications,variantZ:Z.variantZ},Symbol.toStringTag,{value:"Module"})),Qm=Object.freeze(Object.defineProperty({__proto__:null,Config:j.Config,Context:j.Context,Dialog:j.Dialog$1,chooseLocation:j.chooseLocation,formatTip:j.formatTip,useConfig:j.useConfig,wrap:j.wrap},Symbol.toStringTag,{value:"Module"})),Bn="y",_r=28,ef=32,tf=40,nf=.5,sf=({data:e,...t})=>{const{setSize:n,props:{sizeDistribution:s,ref:r,...i}}=Po({direction:Bn,count:e.length,minSize:_r}),l=c=>{if(r.current==null)return;const a=u.Tt.dim(u.Tt.construct(r.current),Bn);s[c]<tf/a?n(c,e[c].initialSize??nf):n(c,_r+1)};return o.jsxRuntimeExports.jsx(To,{empty:!0,className:u.CSS.B("accordion"),sizeDistribution:s,ref:r,...t,...i,children:e.map((c,a)=>g.createElement(lf,{...c,key:c.key,index:a,direction:Bn,onExpand:l,parent:r,size:s[a]}))})},of=o.jsxRuntimeExports.jsx(j.Lt.Caret.Down,{"aria-label":"contract"}),rf=o.jsxRuntimeExports.jsx(j.Lt.Caret.Right,{"aria-label":"expand"}),lf=({index:e,name:t,content:n,actions:s,size:r,parent:i,onExpand:l})=>{let c=!0;if(i.current!=null){const d=u.Tt.dim(u.Tt.construct(i.current),Bn);c=r*d>ef}const a=c?of:rf;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs(zn.Header,{level:"p",className:u.CSS.expanded(c),empty:!0,children:[o.jsxRuntimeExports.jsx(zn.ButtonTitle,{startIcon:a,onClick:()=>l(e),children:t}),s!=null&&o.jsxRuntimeExports.jsx(zn.Actions,{children:s})]}),n]})},cf=Object.freeze(Object.defineProperty({__proto__:null,Accordion:sf},Symbol.toStringTag,{value:"Module"})),af=(e,t)=>Z.A(e).map(s=>typeof s=="string"?s.split(t).map(r=>({label:r})):s).flat(),Ji=({segments:e,shade:t,level:n,weight:s,separator:r,transform:i})=>{let c=af(e,r);return i!=null&&(c=c.map(i)),c.map(({label:a,icon:d,href:x,...p},m)=>{const f=[o.jsxRuntimeExports.jsx(j.Lt.Caret.Right,{style:{transform:"scale(0.8) translateY(1px)",color:u.CSS.shade(t)}},`${a}-${m}`)];if(d!=null){const E=ke.resolve(d);E!=null&&f.push(E)}const h={weight:s,shade:t,level:n,style:{marginLeft:d!=null?"0.5rem":"0"},children:a,...p};return x!=null?f.push(o.jsxRuntimeExports.jsx(ve.Link,{...h,href:x},a)):f.push(o.jsxRuntimeExports.jsx(j.Text$1,{...h},a)),f}).flat()},uf=({children:e,icon:t,shade:n=7,weight:s,size:r=.5,url:i,level:l="p",separator:c=".",className:a,hideFirst:d=!0,...x})=>{i!=null&&(e=i);const p=Ji({segments:e,separator:c,shade:n,level:l,weight:s});return d&&p.shift(),o.jsxRuntimeExports.jsxs(j.WithIcon,{className:u.CSS(a,u.CSS.B("breadcrumb"),d&&u.CSS.M("hide-first")),level:l,shade:n,weight:s,size:r,direction:"x",...x,children:[ke.resolve(t),...p]})},df=({url:e,className:t,level:n="p",separator:s="/",weight:r,shade:i=7})=>{const l=Ji({segments:e,separator:s,shade:i,level:n,weight:r,transform:(c,a)=>({...c,label:c.label.split("-").map(d=>u.d.capitalize(d)).join(" "),href:`/${e.split(s).slice(0,a+1).join("/")}`})});return o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(t,u.CSS.B("breadcrumb"),u.CSS.BM("breadcrumb","url")),direction:"x",size:"small",align:"center",children:l})},xf=Object.freeze(Object.defineProperty({__proto__:null,Breadcrumb:uf,URL:df},Symbol.toStringTag,{value:"Module"})),Ao=g.createContext(B.ZERO_CONTEXT_VALUE),Fe=()=>g.useContext(Ao).synnax,pf=()=>g.useContext(Ao).state,Mr={connected:"success",connecting:"info",disconnected:"info",failed:"error"},Qi="serverVersionMismatch",mf=(e,t,n)=>`Cluster version ${n!=null?`${n} `:""}is ${e?"older":"newer"} than client version ${t}. Compatibility issues may arise.`,el=({children:e,connParams:t})=>{const[n,s,r]=j.useCombinedStateAndRef(B.ZERO_CONTEXT_VALUE),[{path:i},,l]=j.use$3({type:B.Provider.TYPE,schema:B.Provider.stateZ,initialState:{props:t??null,state:null}}),c=j.useAggregator(),a=g.useCallback(d=>{r.current.state.status!==d.status&&c({variant:Mr[d.status],message:d.message??u.d.capitalize(d.status)}),s(x=>({...x,state:d}))},[c]);return j.useAsyncEffect(async()=>{if(n.synnax!=null&&n.synnax.close(),t==null)return s(B.ZERO_CONTEXT_VALUE);const d=new Z.bg({...t,connectivityPollFrequency:Z.S$1.seconds(5)});s({synnax:d,state:{clusterKey:"",status:"connecting",message:"Connecting...",clientServerCompatible:!1,clientVersion:d.clientVersion}});const x=await d.connectivity.check();if(s({synnax:d,state:x}),c({variant:Mr[x.status],message:x.message??x.status.toUpperCase()}),x.status==="connected"&&!x.clientServerCompatible){const p=x.nodeVersion==null||Z.X.semVerOlder(x.nodeVersion,x.clientVersion),m=mf(p,x.clientVersion,x.nodeVersion);c({variant:"warning",message:"Incompatible cluster version",description:m,data:{type:Qi,oldServer:p,nodeVersion:x.nodeVersion,clientVersion:x.clientVersion}})}return d.connectivity.onChange(a),l({props:t,state:x}),()=>{d.close(),s(B.ZERO_CONTEXT_VALUE),l({props:null,state:null})}},[t,a]),o.jsxRuntimeExports.jsx(Ao.Provider,{value:n,children:o.jsxRuntimeExports.jsx(j.Composite,{path:i,children:e})})},ff=Object.freeze(Object.defineProperty({__proto__:null,Provider:el,SERVER_VERSION_MISMATCH:Qi,use:Fe,useConnectionState:pf},Symbol.toStringTag,{value:"Module"})),Yt=g.createContext({aliases:{},getName:async()=>await Promise.resolve(void 0),setAlias:null}),tl=()=>g.useContext(Yt),nl=e=>{const{aliases:t}=g.useContext(Yt);return t[e]??null},xs=()=>{const{aliases:e}=g.useContext(Yt);return e},ps=(e,t="")=>{const{getName:n}=g.useContext(Yt),[s,r]=g.useState(t);return j.useAsyncEffect(async()=>{const i=await n(e);r(i)},[e,n]),s??t},Io=()=>{const{activeRange:e}=g.useContext(Yt);return e??void 0},sl=({activeRange:e,children:t})=>{const n=Fe(),[s,r]=g.useState({}),i=g.useCallback(a=>{r(d=>{const x={...d};return a.forEach(({variant:p,key:m,value:f})=>{const h=Number(m.split("---")[1]);p==="delete"?delete x[h]:x[f.channel]=f.alias}),x})},[r]),l=g.useCallback(async(a,d)=>{if(n==null||e==null)return;await(await n.ranges.retrieve(e)).setAlias(a,d)},[n,e]),c=g.useCallback(async a=>{if(n==null||a===0)return;const d=s[a];return d??(await n.channels.retrieve(a)).name},[s,n]);return j.useAsyncEffect(async()=>{if(n==null||e==null){r({});return}const a=await n.ranges.retrieve(e),d=await a.listAliases();r(d);const x=await a.openAliasTracker(),p=x.onChange(i);return()=>{p(),x.close()}},[n,e]),o.jsxRuntimeExports.jsx(Yt.Provider,{value:{aliases:s,activeRange:e,setAlias:e!=null?l:null,getName:c},children:t})},hf=({channelKey:e,value:t,shadow:n,className:s,...r})=>{const[i,l]=g.useState(!1),{setAlias:c}=tl(),a=nl(e),d=ps(e);let x=o.jsxRuntimeExports.jsx(j.Lt.Rename,{});i?x=o.jsxRuntimeExports.jsx(j.Lt.Loading,{}):a===t&&(x=o.jsxRuntimeExports.jsx(j.Lt.Check,{}));const p=c!=null&&!i&&a!==t&&e!==0,m=()=>{p&&(async()=>(l(!0),await c(e,t),l(!1)))()},f=()=>{var E;a!=null&&((E=r.onChange)==null||E.call(r,a))},h=()=>e===0?o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Select a channel to enable alias syncing with this label"}):c==null?o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Select a range to enable alias syncing with this label"}):t.length===0?o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Enter a value to enable alias syncing with this label"}):a===t?o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Alias synced with this label"}):o.jsxRuntimeExports.jsxs(j.Text$1,{level:"small",children:["Sync alias for ",d," with this label"]});return o.jsxRuntimeExports.jsxs(j.Text$2,{value:t,...r,children:[p&&o.jsxRuntimeExports.jsx(j.Icon,{onClick:f,tooltip:o.jsxRuntimeExports.jsxs(j.Text$1,{level:"small",children:["Set ",d," as label"]}),tooltipLocation:{y:"top"},variant:"outlined",children:o.jsxRuntimeExports.jsx(j.Lt.Sync,{})}),o.jsxRuntimeExports.jsx(j.Icon,{onClick:m,disabled:!p,tooltip:o.jsxRuntimeExports.jsx(h,{}),tooltipLocation:{y:"top"},variant:"outlined",children:x})]})},Ye="channel";var Lr=180/Math.PI,oo={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ol(e,t,n,s,r,i){var l,c,a;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(a=e*n+t*s)&&(n-=e*a,s-=t*a),(c=Math.sqrt(n*n+s*s))&&(n/=c,s/=c,a/=c),e*s<t*n&&(e=-e,t=-t,a=-a,l=-l),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Lr,skewX:Math.atan(a)*Lr,scaleX:l,scaleY:c}}var kn;function gf(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?oo:ol(t.a,t.b,t.c,t.d,t.e,t.f)}function jf(e){return e==null||(kn||(kn=document.createElementNS("http://www.w3.org/2000/svg","g")),kn.setAttribute("transform",e),!(e=kn.transform.baseVal.consolidate()))?oo:(e=e.matrix,ol(e.a,e.b,e.c,e.d,e.e,e.f))}function rl(e,t,n,s){function r(d){return d.length?d.pop()+" ":""}function i(d,x,p,m,f,h){if(d!==p||x!==m){var E=f.push("translate(",null,t,null,n);h.push({i:E-4,x:B.interpolateNumber(d,p)},{i:E-2,x:B.interpolateNumber(x,m)})}else(p||m)&&f.push("translate("+p+t+m+n)}function l(d,x,p,m){d!==x?(d-x>180?x+=360:x-d>180&&(d+=360),m.push({i:p.push(r(p)+"rotate(",null,s)-2,x:B.interpolateNumber(d,x)})):x&&p.push(r(p)+"rotate("+x+s)}function c(d,x,p,m){d!==x?m.push({i:p.push(r(p)+"skewX(",null,s)-2,x:B.interpolateNumber(d,x)}):x&&p.push(r(p)+"skewX("+x+s)}function a(d,x,p,m,f,h){if(d!==p||x!==m){var E=f.push(r(f)+"scale(",null,",",null,")");h.push({i:E-4,x:B.interpolateNumber(d,p)},{i:E-2,x:B.interpolateNumber(x,m)})}else(p!==1||m!==1)&&f.push(r(f)+"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),c(d.skewX,x.skewX,p,m),a(d.scaleX,d.scaleY,x.scaleX,x.scaleY,p,m),d=x=null,function(f){for(var h=-1,E=m.length,y;++h<E;)p[(y=m[h]).i]=y.x(f);return p.join("")}}}var Ef=rl(gf,"px, ","px)","deg)"),yf=rl(jf,", ",")",")"),Sf=1e-12;function Pr(e){return((e=Math.exp(e))+1/e)/2}function Rf(e){return((e=Math.exp(e))-1/e)/2}function Cf(e){return((e=Math.exp(2*e))-1)/(e+1)}const bf=function e(t,n,s){function r(i,l){var c=i[0],a=i[1],d=i[2],x=l[0],p=l[1],m=l[2],f=x-c,h=p-a,E=f*f+h*h,y,S;if(E<Sf)S=Math.log(m/d)/t,y=function(_){return[c+_*f,a+_*h,d*Math.exp(t*_*S)]};else{var k=Math.sqrt(E),C=(m*m-d*d+s*E)/(2*d*n*k),b=(m*m-d*d-s*E)/(2*m*n*k),w=Math.log(Math.sqrt(C*C+1)-C),L=Math.log(Math.sqrt(b*b+1)-b);S=(L-w)/t,y=function(_){var N=_*S,A=Pr(w),I=d/(n*k)*(A*Cf(t*N+w)-Rf(w));return[c+I*f,a+I*h,d*A/Pr(t*N+w)]}}return y.duration=S*1e3*t/Math.SQRT2,y}return r.rho=function(i){var l=Math.max(.001,+i),c=l*l,a=c*c;return e(l,c,a)},r}(Math.SQRT2,2,4),wf=Object.freeze(Object.defineProperty({__proto__:null,Canvas:B.Canvas,axisStateZ:B.axisStateZ,newTickFactory:B.newTickFactory,tickFactoryProps:B.tickFactoryProps,tickType:B.tickType},Symbol.toStringTag,{value:"Module"})),vf=Object.freeze(Object.defineProperty({__proto__:null,AcquireChannelControl:B.AcquireChannelControl,AuthoritySource:B.AuthoritySource,Chip:B.Chip,Controller:B.Controller$1,Indicator:B.Indicator,Legend:B.Legend,REGISTRY:B.REGISTRY$3,STATUSES:B.STATUSES,SetChannelValue:B.SetChannelValue,StateProvider:B.StateProvider,acquireChannelControl:B.acquireChannelControl,acquireChannelControlPropsZ:B.acquireChannelControlPropsZ,authoritySource:B.authoritySource,authoritySourceProps:B.authoritySourceProps,chipStateZ:B.chipStateZ,controllerStateZ:B.controllerStateZ,indicatorStateZ:B.indicatorStateZ,legendStateZ:B.legendStateZ,setChannelValue:B.setChannelValue,setChannelValuePropsZ:B.setChannelValuePropsZ,stateProviderStateZ:B.stateProviderStateZ,statusZ:B.statusZ,sugaredStateZ:B.sugaredStateZ},Symbol.toStringTag,{value:"Module"})),kf={region:u.Tt.ZERO,dpr:1,os:Z.S.getOS()},_f={gl:null,lower2d:null,upper2d:null,bootstrapped:!1},Mf=({children:e,resizeDebounce:t=100,className:n,...s})=>{const[{path:r},{bootstrapped:i,dpr:l},c]=j.use$3({type:B.Canvas$1.TYPE,schema:B.canvasStateZ,initialState:kf}),a=g.useRef({..._f}),d=g.useRef(!1),x=g.useCallback(E=>{a.current.bootstrapped&&(c(()=>({bootstrapped:!0,region:E,dpr:window.devicePixelRatio,os:Z.S.getOS({default:"Windows"})})),d.current=!0)},[c]),p=g.useRef(null),m=j.useResize(x,{debounce:t}),f=j.useCombinedRefs(p,m);g.useEffect(()=>{const E=()=>{window.devicePixelRatio===l||!a.current.bootstrapped||p.current==null||c(y=>({...y,region:u.Tt.construct(p.current),dpr:window.devicePixelRatio}))};window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`).addEventListener("change",E,{once:!0})},[l]),g.useEffect(()=>{const E=()=>{!a.current.bootstrapped||p.current==null||c(y=>({...y,region:u.Tt.construct(p.current),glCanvas:void 0,upper2dCanvas:void 0,lower2dCanvas:void 0}))};window.addEventListener("focus",E),window.addEventListener("blur",E)},[c]);const h=g.useCallback(E=>{if(E==null)return;E.className.includes("gl")?a.current.gl=E:E.className.includes("upper2d")?a.current.upper2d=E:a.current.lower2d=E;const{gl:y,lower2d:S,upper2d:k,bootstrapped:C}=a.current;if(y==null||S==null||k==null||C)return;a.current.bootstrapped=!0;const b=y.transferControlToOffscreen(),w=k.transferControlToOffscreen(),L=S.transferControlToOffscreen();c({glCanvas:b,upper2dCanvas:w,lower2dCanvas:L,bootstrap:!0,bootstrapped:!1,region:u.Tt.construct(y),dpr:window.devicePixelRatio,os:Z.S.getOS({default:"Windows"})},[b,w,L])},[c]);return o.jsxRuntimeExports.jsxs("div",{ref:f,className:u.CSS(u.CSS.B("canvas-container"),n),...s,children:[o.jsxRuntimeExports.jsx("canvas",{ref:h,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","lower2d"))}),o.jsxRuntimeExports.jsx("canvas",{ref:h,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","gl"))}),o.jsxRuntimeExports.jsx("canvas",{ref:h,className:u.CSS(u.CSS.B("canvas"),u.CSS.BM("canvas","upper2d"))}),o.jsxRuntimeExports.jsx(j.Composite,{path:r,children:i&&e})]})},En=(e,t)=>j.useResize(g.useCallback((n,s)=>{const r=document.querySelector(".pluto-canvas--lower2d");r!=null&&e(u.b.XY.translate(u.G.scale(u.Tt.topLeft(r),-1)).box(n),s)},[e]),t),Lf=Object.freeze(Object.defineProperty({__proto__:null,Canvas:Mf,useRegion:En},Symbol.toStringTag,{value:"Module"})),il=g.createContext(null),We=e=>{const t=g.useContext(il);if(t==null)throw new Error(`Cannot to use ${e} as a non-child of LinePlot.`);return t},ll=e=>{const t=We("Viewport"),{addViewportHandler:n}=t;g.useEffect(()=>n(e),[n,e])},yn=(e,t)=>{const{setGridEntry:n,removeGridEntry:s}=We(t),{key:r}=e;return j.useEffectCompare(()=>{u.K.outer.parse(e.loc),n(e)},([c],[a])=>Z._.equal(c,a),[e]),g.useEffect(()=>()=>s(r),[]),{gridArea:u.g.swap(u.K.direction(e.loc))==="x"?`axis-start-${r} / plot-start / axis-end-${r} / plot-end`:`plot-start / axis-start-${r} / plot-end / axis-end-${r}`}},cl=({aetherKey:e,style:t,resizeDebounce:n=0,clearOverScan:s=u.G.ZERO,children:r,hold:i=!1,onHold:l,visible:c,...a})=>{const[d,x]=g.useState([]),p=j.useMemoDeepEqualProps({clearOverScan:s,hold:i,visible:c}),[{path:m},{grid:f},h]=j.use$3({aetherKey:e,type:B.LinePlot.TYPE,schema:B.linePlotStateZ,initialState:{container:u.Tt.ZERO,viewport:u.Tt.DECIMAL,grid:{},...p}});g.useEffect(()=>h($=>({...$,...p})),[p]);const E=g.useRef(new Map),y=g.useCallback($=>(E.current.set($,null),()=>E.current.delete($)),[E]),S=g.useCallback($=>{const{mode:z,box:R,stage:T}=$;(z==="pan"&&T!=="start"||z==="zoom"||z==="zoomReset"&&T==="start")&&h(M=>({...M,viewport:R})),E.current.forEach((M,D)=>D($))},[h]),k=g.useCallback($=>h(z=>({...z,container:$})),[h]),C=En(k,{debounce:n}),b=g.useCallback($=>h(z=>({...z,grid:{...z.grid,[$.key]:$}})),[h]),w=g.useCallback($=>h(z=>{const{[$]:R,...T}=z.grid;return{...z,grid:T}}),[h]),L=g.useCallback($=>{x(z=>[...z.filter(({key:R})=>R!==$.key),$])},[x,S]),_=g.useCallback($=>x(z=>z.filter(({key:R})=>R!==$)),[L]),N=g.useMemo(()=>Pf(f),[f]),A=g.useCallback($=>{h(z=>({...z,hold:$})),l==null||l($)},[h,l]),I=`line-plot-${e}`,F=g.useMemo(()=>({lines:d,setGridEntry:b,removeGridEntry:w,setLine:L,removeLine:_,setViewport:S,addViewportHandler:y,setHold:A,id:I}),[I,d,b,w,L,_,S,y,A]);return o.jsxRuntimeExports.jsx("div",{id:I,className:u.CSS.B("line-plot"),style:{...t,...N},ref:C,...a,children:o.jsxRuntimeExports.jsx(il.Provider,{value:F,children:o.jsxRuntimeExports.jsx(j.Composite,{path:m,children:r})})})},Pf=e=>{const t=u.CSS.newGridBuilder();return B.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)"),B.regions("bottom",e).reverse().forEach(({key:n,size:s})=>t.row(`axis-start-${n}`,`axis-end-${n}`,s)),B.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)"),B.regions("right",e).forEach(({key:n,size:s})=>t.col(`axis-start-${n}`,`axis-end-${n}`,s)),t.build()},$o=e=>{const t=e==="x"?"bottom":"left",n=e==="x"?B.XAxis.TYPE:B.YAxis.TYPE,s=`${e}-axis`,r=({aetherKey:i,children:l,location:c=t,label:a="",labelLevel:d="small",labelDirection:x=e,onLabelChange:p,color:m,labelSize:f,showGrid:h,type:E,bounds:y,className:S,tickSpacing:k,autoBounds:C,autoBoundUpdateInterval:b,onAutoBoundsChange:w,style:L,..._})=>{const N=((a==null?void 0:a.length)??0)>0,A=j.useUniqueKey(i),I=j.useMemoDeepEqualProps({location:c,showGrid:h,type:E,bounds:y,label:a,labelDirection:x,tickSpacing:k,autoBounds:C,autoBoundUpdateInterval:b}),[{path:F},{size:$,labelSize:z,...R},T]=j.use$3({aetherKey:A,type:n,schema:B.coreAxisStateZ,initialState:I});g.useEffect(()=>T(V=>({...V,...I})),[I]),g.useEffect(()=>{const{lower:V,upper:H}=B.parseAutoBounds(R.autoBounds);R.bounds!=null&&(V&&(y==null?void 0:y.lower)!==R.bounds.lower||H&&(y==null?void 0:y.upper)!==R.bounds.upper)&&(w==null||w(R.bounds))},[R.autoBounds,R.bounds]);const M=yn({loc:c,key:`${n}-${A}`,size:$+z,order:1},`${e.toUpperCase()}Axis`),D=j.useTypography(d).toString(),P=g.useRef(0);return g.useEffect(()=>{if(e==="y"){if(a==null)return;let H=Z.dimensions(a,D)[u.g.dimension(u.g.construct(x))];H>0&&(H+=9),T(G=>({...G,labelSize:H}))}else{let H=Z.dimensions(a,D).height*1.3;H>0&&(H+=12);const G=P.current;B.withinSizeThreshold(G,H)||(P.current=H,T(q=>({...q,labelSize:H})))}},[a,x,D]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(S,u.CSS.B("axis"),u.CSS.B(s),u.CSS.loc(c)),style:{...L,...M},align:"center",justify:c!=="left"?"end":"start",direction:u.g.swap(e),..._,children:N&&o.jsxRuntimeExports.jsx(j.MaybeEditable,{className:u.CSS(u.CSS.BE("axis","label"),u.CSS.dir(x)),value:a,onChange:p,level:d})}),o.jsxRuntimeExports.jsx(j.Composite,{path:F,children:l})]})};return r.displayName=`${e.toUpperCase()}Axis`,r},al=$o("x"),ul=$o("y"),dl=u.G.xy.extend({root:u.K.corner,units:ce.z.object({x:ce.z.enum(["px","decimal"]),y:ce.z.enum(["px","decimal"])})}),Tf=dl.partial({root:!0,units:!0}),Nf=e=>{var n,s,r,i;const t={};return t[((n=e.root)==null?void 0:n.x)??"left"]=((s=e==null?void 0:e.units)==null?void 0:s.x)==="px"?`${e.x}px`:`${e.x*100}%`,t[((r=e.root)==null?void 0:r.y)??"top"]=((i=e==null?void 0:e.units)==null?void 0:i.y)==="px"?`${e.y}px`:`${e.y*100}%`,t},Af=(e,t)=>{var i,l,c,a,d,x;const n={x:e.x,y:e.y};if(t.current==null)return n;const s=u.Tt.construct(t.current),r=u.Tt.construct(t.current.parentElement);return((i=e.units)==null?void 0:i.x)==="decimal"?((l=e.root)==null?void 0:l.x)==="right"&&(n.x=1-e.x):((c=e.root)==null?void 0:c.x)==="right"?n.x=1-(e.x+u.Tt.width(s))/u.Tt.width(r):n.x/=u.Tt.width(r),((a=e.units)==null?void 0:a.y)==="decimal"?((d=e.root)==null?void 0:d.y)==="bottom"&&(n.y=1-e.y):((x=e.root)==null?void 0:x.y)==="bottom"?n.y=1-(e.y+u.Tt.height(s))/u.Tt.height(r):n.y/=u.Tt.height(r),n},xl=(e,t)=>{if(t.current==null)return null;const n=u.Tt.construct(t.current.parentElement),s=u.Tt.construct(t.current),r={x:e.x,y:e.y,root:{...u.K.TOP_LEFT},units:{x:"px",y:"px"}};return e.x>.8?(r.x=(1-e.x)*u.Tt.width(n)-u.Tt.width(s),r.root.x="right"):e.x<.2?r.x=e.x*u.Tt.width(n):r.units.x="decimal",e.y>.8?(r.y=(1-e.y)*u.Tt.height(n)-u.Tt.height(s),r.root.y="bottom"):e.y<.2?r.y=e.y*u.Tt.height(n):r.units.y="decimal",r.x=Math.round(r.x*100)/100,{...r,...u.G.truncate(r,3)}},Tr=u.Tt.reRoot(u.Tt.DECIMAL,u.K.TOP_LEFT),zo=g.memo(({className:e,value:t,onChange:n,style:s,draggable:r=!0,...i})=>{const[l,c]=Z.usePurePassthrough({value:t,onChange:n,initial:{x:.1,y:.1,root:u.K.TOP_LEFT,units:{x:"decimal",y:"decimal"}}}),a=g.useRef(l),d=j.useSyncedRef(r===!1),x=g.useRef(null);l!==null&&(s={...s,...Nf(l)});const p=g.useCallback(f=>{var b;if(((b=x.current)==null?void 0:b.parentElement)==null)return a.current;const h=u.Tt.construct(x.current.parentElement),E=u.b.XY.scale(h).scale(Tr),y=E.box(u.Tt.construct(x.current)),S=u.b.XY.clamp(u.Tt.construct(u.Tt.topLeft(Tr),{width:1-u.Tt.width(y),height:1-u.Tt.height(y)})),k=u.G.translate(u.G.construct(a.current),u.Tt.signedDims(E.box(f))),C=S.pos(k);return xl(C,x)},[]),m=j.useCursorDrag({onStart:g.useCallback(()=>{a.current=Af(a.current,x)},[]),onMove:g.useCallback(f=>{if(d.current)return;const h=p(f);h!==null&&c(h)},[]),onEnd:g.useCallback(f=>{if(d.current)return;const h=p(f);h!==null&&(a.current=h)},[])});return o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(e,u.CSS.B("legend")),bordered:!0,rounded:!0,style:s,onDragStart:m,draggable:r,ref:x,...i,onDrag:Yn,onDragEnd:Yn,empty:!0})});zo.displayName="Legend.Container";const Bo=(e,t,n)=>e.sort((s,r)=>s.label.localeCompare(r.label)).map(({key:s,color:r,label:i})=>o.jsxRuntimeExports.jsxs(te.Space,{style:{cursor:"pointer"},direction:"x",align:"center",size:"small",children:[o.jsxRuntimeExports.jsx(j.Swatch,{value:r,onChange:l=>t==null?void 0:t({key:s,color:l,label:i}),onVisibleChange:n,allowChange:t!=null,draggable:!1,size:"small"}),o.jsxRuntimeExports.jsx(j.MaybeEditable,{level:"small",value:i,onChange:l=>t==null?void 0:t({key:s,color:r,label:l}),noWrap:!0})]},s)),Do=({data:e=[],onEntryChange:t,position:n,onPositionChange:s,...r})=>{const[i,l]=g.useState(!1);return e.length===0?null:o.jsxRuntimeExports.jsx(zo,{...r,draggable:!i,value:n,onChange:s,children:Bo(e,t,l)})},If=Object.freeze(Object.defineProperty({__proto__:null,Container:zo,Simple:Do,calcStickyPos:xl,completeStickyXYz:dl,legendSwatches:Bo,stickyXYz:Tf},Symbol.toStringTag,{value:"Module"})),Oo=g.memo(({className:e,style:t,onLineChange:n,...s})=>{const{lines:r}=We("Legend");return We("Legend"),o.jsxRuntimeExports.jsx(Do,{data:r,onEntryChange:n,...s})});Oo.displayName="FloatingLegend";const $f=({onLineChange:e})=>{const{lines:t}=We("Legend"),n=j.useUniqueKey(),s=yn({key:n,size:t.length>0?36:0,loc:"top",order:5},"Legend");return o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS.BE("legend","container"),align:"center",direction:"x",size:"large",style:{...s,padding:"0 1rem",height:"var(--pluto-height-medium)",margin:"1rem 0 "},children:Bo(t,e)})},pl=({variant:e="floating",...t})=>e==="floating"?o.jsxRuntimeExports.jsx(Oo,{...t}):o.jsxRuntimeExports.jsx($f,{...t}),Vo=g.memo(({aetherKey:e,...t})=>(j.useUnidirectional({aetherKey:e,type:B.Line.TYPE,schema:B.stateZ,state:t}),null));Vo.displayName="Line";const zf=Object.freeze(Object.defineProperty({__proto__:null,Line:Vo},Symbol.toStringTag,{value:"Module"})),Fo=({aetherKey:e,color:t,label:n="",...s})=>{const r=j.useUniqueKey(e),{setLine:i,removeLine:l}=We("Line");return g.useEffect(()=>(i({key:r,color:t,label:n}),()=>l(r)),[n,t]),o.jsxRuntimeExports.jsx(Vo,{aetherKey:r,color:t,label:n,...s})},ml=({level:e="h2",...t})=>{const n=j.useUniqueKey(),s=j.useTypography(e),r=yn({key:n,size:(s.lineHeight+2)*s.baseSize,loc:"top",order:10},"Title");return o.jsxRuntimeExports.jsx(te.Space,{justify:"center",align:"center",style:r,children:o.jsxRuntimeExports.jsx(j.MaybeEditable,{...t,level:e})})},fl=({aetherKey:e,...t})=>{const n=j.useUniqueKey(e),[,,s]=j.use$3({aetherKey:n,type:B.Tooltip.TYPE,schema:B.tooltipStateZ,initialState:{position:null,...t}}),r=g.useRef(null),i=g.useCallback(c=>{const a=document.querySelector(".pluto-canvas-container");if(a==null)return;const d=u.Tt.topLeft(a);s({position:u.G.translation(d,u.G.construct(c))})},[s]),l=g.useCallback(()=>s({position:null}),[s]);return g.useEffect(()=>{if(r.current===null)return;const c=r.current.parentElement;if(c!=null)return c.addEventListener("mousemove",i),c.addEventListener("mouseleave",l),()=>{c.removeEventListener("mousemove",i),c.removeEventListener("mouseleave",l)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:r})},Bf=Object.freeze(Object.defineProperty({__proto__:null,Tooltip:fl},Symbol.toStringTag,{value:"Module"})),Df={select:"pointer",zoom:"crosshair",pan:"grab",zoomReset:"crosshair",click:"pointer"},hl=({className:e,mode:t,maskBox:n,children:s,style:r,...i})=>o.jsxRuntimeExports.jsxs("div",{className:u.CSS(u.CSS.noSelect,u.CSS.BE("viewport-mask","container"),e),style:{cursor:Df[t],...r},...i,children:[o.jsxRuntimeExports.jsx("div",{style:{...u.Tt.css(n),display:u.Tt.areaIsZero(n)?"none":"block"},className:u.CSS.BE("viewport-mask","selection")}),s]}),Of=[{key:"start",icon:o.jsxRuntimeExports.jsx(j.Lt.TextAlign.Left,{})},{key:"center",icon:o.jsxRuntimeExports.jsx(j.Lt.TextAlign.Center,{})},{key:"end",icon:o.jsxRuntimeExports.jsx(j.Lt.TextAlign.Right,{})}],Vf=({key:e,entry:t,onClick:n,selected:s})=>o.jsxRuntimeExports.jsx(j.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),ms=({children:e=Vf,...t})=>o.jsxRuntimeExports.jsx(ve.Button,{...t,allowMultiple:!1,data:Of,children:e}),Ff=[{key:"large",label:"L"},{key:"medium",label:"M"},{key:"small",label:"S"}],gl=({children:e,...t})=>o.jsxRuntimeExports.jsx(ve.Button,{...t,data:Ff,entryRenderKey:"label",children:e}),Hf=new Set([Z.g.UUID,Z.g.JSON]),jl=Z.g.ALL.filter(e=>e!==Z.g.UNKNOWN).map(e=>({key:e.toString(),name:Hf.has(e)?e.toString().toUpperCase():u.d.capitalize(e.toString())})),Zf=jl.filter(e=>!new Z.g(e.key).isVariable),Gf=[{key:"name",name:"Name"}],Yf=({hideVariableDensity:e=!1,...t})=>o.jsxRuntimeExports.jsx(ve.DropdownButton,{...t,data:e?Zf:jl,columns:Gf,entryRenderKey:"name"}),Wf=[{key:"x",icon:o.jsxRuntimeExports.jsx(j.Lt.Arrow.Right,{})},{key:"y",icon:o.jsxRuntimeExports.jsx(j.Lt.Arrow.Up,{})}],Kf=[{key:"x",icon:o.jsxRuntimeExports.jsx(j.Lt.Arrow.Right,{})},{key:"y",icon:o.jsxRuntimeExports.jsx(j.Lt.Arrow.Down,{})}],Xf=({key:e,entry:t,onClick:n,selected:s})=>o.jsxRuntimeExports.jsx(j.Icon,{variant:s?"filled":"outlined",onClick:n,children:t.icon},e),El=({children:e=Xf,yDirection:t="up",...n})=>o.jsxRuntimeExports.jsx(ve.Button,{...n,allowMultiple:!1,data:t==="up"?Wf:Kf,children:e}),yl=e=>o.jsxRuntimeExports.jsx(j.Icon,{className:u.CSS.BE("select","clear"),variant:"outlined",...e,children:o.jsxRuntimeExports.jsx(j.Lt.Close,{"aria-label":"clear"})}),xt=({onChange:e,value:t,entryRenderKey:n="key",columns:s,data:r,emptyContent:i,inputProps:l,allowNone:c=!0,searcher:a,className:d,variant:x="button",hideColumnHeader:p=!1,disabled:m,omit:f,children:h,dropdownVariant:E="connected",placeholder:y=fs,inputPlaceholder:S=y,triggerTooltip:k,dropdownZIndex:C,filter:b,actions:w,...L})=>{const{visible:_,open:N,close:A,toggle:I}=j.use$2(),[F,$]=g.useState(null),z=a!=null;j.useAsyncEffect(async()=>{if(j.selectValueIsZero(t))return $(null);if((F==null?void 0:F.key)===t)return;let P=null;if(z)try{[P]=await a.retrieve([t])}finally{P??(P=null)}else r!=null&&(P=r.find(V=>V.key===t)??null);$(P)},[a,t,r]);const R=g.useCallback((P,V)=>{Array.isArray(P)||($(P==null?null:V.entries[0]),A(),e(P,V))},[e,c]),T=g.useMemo(()=>z?j.Search:Gt.Filter,[z]),M=o.jsxRuntimeExports.jsx(T,{searcher:a,filter:b,children:({onChange:P})=>o.jsxRuntimeExports.jsx(qf,{...l,autoFocus:E==="modal",variant:x,onChange:P,onFocus:N,selected:F,entryRenderKey:n,visible:_,allowNone:c,className:d,dropdownVariant:E,disabled:m,placeholder:S,children:w})}),D=o.jsxRuntimeExports.jsx(j.Button,{tooltip:k,variant:"outlined",onClick:I,disabled:m,children:F!=null?Sl(n,F):y});return o.jsxRuntimeExports.jsx(ve.Core,{close:A,zIndex:C,open:N,data:r,omit:f,emptyContent:i,allowMultiple:!1,visible:_,value:t,hideColumnHeader:p,onChange:R,allowNone:c,columns:s,listItem:h,variant:E,trigger:E!=="modal"?M:D,extraDialogContent:E==="modal"?M:void 0,keepMounted:!1,...L})},fs="Select",Sl=(e,t)=>t==null?"":typeof e=="function"?e(t):t[e].toString(),qf=({entryRenderKey:e,selected:t,visible:n,onChange:s,onFocus:r,allowNone:i=!0,placeholder:l=fs,className:c,disabled:a,dropdownVariant:d,children:x,...p})=>{const{clear:m}=j.useSelectionUtils(),[f,h]=g.useState("");g.useEffect(()=>{if(!n){if(Z.w$1(t==null?void 0:t.key))return h("");t!=null&&h(Sl(e,t))}},[t,n,e]);const E=b=>{s(b),h(b)},y=()=>{f===""&&s(""),h(""),r==null||r()},S=b=>{n||(b.preventDefault(),r==null||r())},k=()=>{h(""),m==null||m()};let C;return d!=="modal"&&(C=o.jsxRuntimeExports.jsx(_o.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:n})),o.jsxRuntimeExports.jsxs(j.Text$2,{className:u.CSS(u.CSS.BE("select","input"),c),value:f,onChange:E,onFocus:y,onKeyDown:j.matchCallback([["Enter"]],b=>{b.preventDefault(),!n&&(r==null||r())}),endContent:C,style:{flexGrow:1},onClick:S,placeholder:l,disabled:a,...p,children:[x,i&&o.jsxRuntimeExports.jsx(yl,{onClick:k,disabled:a})]})},an=({children:e="",size:t="medium",color:n,icon:s,onClose:r,className:i,onDragStart:l,...c})=>{const a=u.cssString(n);s==null&&n!=null&&(s=o.jsxRuntimeExports.jsx(j.Lt.Circle,{fill:a}));const d=r==null?void 0:o.jsxRuntimeExports.jsx(j.Icon,{"aria-label":"close",size:"small",className:u.CSS.BE("tag","close"),onClick:x=>{x.stopPropagation(),r()},children:o.jsxRuntimeExports.jsx(j.Lt.Close,{})});return o.jsxRuntimeExports.jsx(j.WithIcon,{startIcon:s,endIcon:d,className:u.CSS(i,u.CSS.B("tag"),r!=null&&u.CSS.BM("tag","closeable")),level:Z.ComponentSizeLevels[t],noWrap:!0,align:"center",onDragStart:l,...c,children:e})},Uf=Object.freeze(Object.defineProperty({__proto__:null,Tag:an},Symbol.toStringTag,{value:"Module"})),Ho=({entryKey:e,entryRenderKey:t,entry:n,loading:s,...r})=>{let i=e;return n!=null&&(i=typeof t=="function"?t(n):n[t]),g.createElement(an,{size:"small",variant:"outlined",className:u.CSS(n==null&&!s&&u.CSS.BEM("select-multiple","tag","invalid")),draggable:!0,...r,key:e.toString()},Z.Y(i))},Jf=j.componentRenderProp(Ho),Wt=({onChange:e,value:t,className:n,data:s,columns:r=[],entryRenderKey:i="key",emptyContent:l,searcher:c,renderTag:a=Jf,placeholder:d,onTagDragStart:x,allowMultiple:p,allowNone:m,replaceOnSingle:f,onTagDragEnd:h,style:E,addPlaceholder:y="Add",children:S,dropdownVariant:k="connected",actions:C,...b})=>{const{visible:w,open:L,close:_}=j.use$2(),[N,A]=g.useState([]),[I,F]=g.useState(!1),$=c!=null;j.useAsyncEffect(async()=>{F(!0),j.selectValueIsZero(t)&&A([]);const D=N.map(H=>H.key),P=Z.A(t);if(Z.F.unorderedPrimitiveArrays(D,P)===Z.F.EQUAL)return;let V=[];if($)try{V=await c.retrieve(P)}finally{F(!1)}else s!=null&&(V=s.filter(H=>P.includes(H.key)));A(V)},[c,$,t,s]);const z=g.useCallback((D,P)=>{D!=null&&(A(P.entries),e(Z.A(D),P))},[e]),R=g.useMemo(()=>$?j.Search:Gt.Filter,[$]);let T,M;if(k==="connected")M=o.jsxRuntimeExports.jsx(R,{searcher:c,children:({onChange:D,value:P})=>o.jsxRuntimeExports.jsx(Qf,{dropdownVariant:k,value:P,selectedKeys:t,className:n,onChange:D,loading:I,selected:N,onFocus:L,entryRenderKey:i,visible:w,renderTag:a,placeholder:d,onTagDragStart:x,onTagDragEnd:h,style:E,children:C})});else{const D=Z.A(t);M=o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",grow:!0,style:E,size:"small",children:[D.map(P=>{const V=N.find(H=>H.key===P);return a({key:P,entryKey:P,entryRenderKey:i,loading:I,entry:V,onClose:()=>{const H=D.filter(G=>G!==P);e(H,{clicked:null,clickedIndex:-1,entries:[]})},onDragStart:H=>x==null?void 0:x(H,P),onDragEnd:H=>h==null?void 0:h(H,P)})}),D.length>0?o.jsxRuntimeExports.jsx(j.Icon,{onClick:L,children:o.jsxRuntimeExports.jsx(j.Lt.Add,{style:{color:"var(--pluto-gray-l7)"}})}):o.jsxRuntimeExports.jsx(j.Button,{onClick:L,shade:7,startIcon:o.jsxRuntimeExports.jsx(j.Lt.Add,{}),variant:"text",children:y})]}),T=o.jsxRuntimeExports.jsx(R,{searcher:c,children:P=>o.jsxRuntimeExports.jsx(j.Text$2,{autoFocus:!0,placeholder:"Search",...P,children:C})})}return o.jsxRuntimeExports.jsx(ve.Core,{close:_,open:L,data:s,emptyContent:l,visible:w,value:t,onChange:z,allowNone:m,replaceOnSingle:f,columns:r,allowMultiple:!0,listItem:S,trigger:M,extraDialogContent:T,variant:k,...b})},Qf=({selectedKeys:e,loading:t,selected:n,onChange:s,onFocus:r,visible:i,entryRenderKey:l,renderTag:c,placeholder:a=fs,onTagDragStart:d,onTagDragEnd:x,value:p,className:m,children:f,dropdownVariant:h,...E})=>{const{onSelect:y,clear:S}=j.useSelectionUtils(),k=g.useRef(null);g.useLayoutEffect(()=>{var _;i&&((_=k.current)==null||_.focus())},[i,n]);const C=()=>{i||s(""),r==null||r()},b=()=>{i||r==null||r()},w=()=>{i||s("")};let L;return h!=="modal"&&(L=o.jsxRuntimeExports.jsx(_o.Animated,{enabledLoc:"bottom",disabledLoc:"left",enabled:i})),o.jsxRuntimeExports.jsxs(j.Text$2,{ref:k,className:u.CSS(u.CSS.BE("select-multiple","input"),u.CSS.visible(i),m),onBlur:w,placeholder:a,value:p,onChange:s,onFocus:C,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",onClick:b,endContent:L,variant:"button",...E,children:[o.jsxRuntimeExports.jsx(te.Space,{direction:"x",className:u.CSS.BE("select-multiple","tags"),align:"center",grow:!0,size:"small",children:Z.A(e).map(_=>{const N=n.find(A=>A.key===_);return c({key:_,entryKey:_,entryRenderKey:l,loading:t,entry:N,onClose:()=>y==null?void 0:y(_),onDragStart:A=>d==null?void 0:d(A,_),onDragEnd:A=>x==null?void 0:x(A,_)})})}),f,o.jsxRuntimeExports.jsx(yl,{onClick:S})]})},eh=Object.freeze(Object.defineProperty({__proto__:null,BaseButton:ve.BaseButton,Button:ve.Button,ComponentSize:gl,DEFAULT_PLACEHOLDER:fs,DataType:Yf,Direction:El,DropdownButton:ve.DropdownButton,Multiple:Wt,MultipleTag:Ho,Single:xt,TextAlignment:ms,defaultButton:ve.defaultButton},Symbol.toStringTag,{value:"Module"})),Dn=6,th=2,Nr=5,nh=e=>u.Tt.width(e)<Nr&&u.Tt.height(e)<Nr,sh=["zoom","pan","select","zoomReset"],on=[...sh,"click"],oh=ce.z.enum(on),Rl=["zoom","select"],On={defaultMode:"zoom",zoom:[["MouseLeft"]],zoomReset:[["MouseLeft","Control"]],pan:[["MouseLeft","Shift"]],select:[["MouseLeft","Alt"]]},Cl={defaultMode:"pan",pan:[["MouseLeft"]],zoom:[["MouseLeft","Shift"]],zoomReset:[["MouseLeft","Control"]],select:[["MouseLeft","Alt"]]},bl={defaultMode:"select",select:[["MouseLeft"]],pan:[["MouseLeft","Shift"]],zoom:[["MouseLeft","Alt"]],zoomReset:[["MouseLeft","Control"]]},Zo={zoom:On,pan:Cl,select:bl,zoomReset:On,click:On},rh=e=>{const t=Object.entries(e);return Object.fromEntries(t.map(([n,s])=>n==="defaultMode"?[n,s]:[n,s.map(r=>r.filter(i=>i!=="MouseLeft")).filter(r=>r.length>0)]))},ih=u.Tt.construct(0,0,1,1,u.K.TOP_LEFT),lh={width:30,height:50},wl=({onChange:e,triggers:t,initial:n=ih,threshold:s=lh,ref:r})=>{const i=(t==null?void 0:t.defaultMode)??"zoom",[l,c]=g.useState(u.Tt.ZERO),[a,d]=g.useState(i),[x,p]=j.useStateRef(n),m=g.useRef(u.G.ZERO),f=g.useRef(null),h=u._.construct(s);g.useEffect(()=>p(()=>u.Tt.truncate(n,Dn)),[n]),g.useEffect(()=>d(i),[i]);const[E,y,S,k]=j.useMemoCompare(()=>{const N={...Zo[i],...t},A=j.flattenConfig(N),I=rh(N);return[N,A,I,j.flattenConfig(I)]},j.compareModeConfigs,[t]),C=g.useCallback(({box:N,triggers:A,stage:I,cursor:F})=>{if(f.current==null)return;const $=j.determineMode(E,A),z=u.Tt.construct(f.current);if($==null)return;if($==="zoomReset")return c(u.Tt.ZERO),e==null||e({box:u.Tt.DECIMAL,mode:$,stage:I,cursor:F}),p(u.Tt.DECIMAL);const R=nh(N);if(I==="end"){if(R){$==="zoom"&&c(u.Tt.ZERO),e==null||e({box:x.current,mode:"click",stage:I,cursor:F});return}return p(M=>{if($==="pan"){const P=Ar(N,M,z);return P===null||u.Tt.equals(P,M)?M:(e==null||e({box:P,mode:$,stage:I,cursor:F}),P)}const D=b(N,M,z);return D===null?M:(e==null||e({box:D,mode:$,stage:I,cursor:F}),$==="zoom"?(c(u.Tt.ZERO),D):u.Tt.truncate(M,Dn))})}if(Rl.includes($))return R?void 0:c(u.b.XY.scale(z).clamp(z).translate({x:-u.Tt.left(z),y:-u.Tt.top(z)}).box(Ir(h,N,z)));if(c(M=>u.Tt.areaIsZero(M)?M:u.Tt.ZERO),u.G.distance(F,m.current)<th)return;m.current=F;const T=Ar(N,x.current,z);e==null||e({box:T,mode:$,stage:I,cursor:F})},[c,d,e,E,s.height,s.width,p,f]);g.useImperativeHandle(r,()=>({reset:()=>{c(u.Tt.ZERO),p(u.Tt.DECIMAL),e==null||e({box:u.Tt.DECIMAL,mode:"zoomReset",stage:"start",cursor:u.G.ZERO})}}),[e]);const b=g.useCallback((N,A,I)=>u.Tt.truncate(ro(A,I).box(Ir(h,N,I)),Dn),[s]),w=j.useHeldRef({triggers:[["Control"]]}),L=j.useHeldRef({triggers:[["Alt"]]});g.useEffect(()=>{const N=A=>{if(f.current==null)return;let I=1;A.deltaY<0?I-=.035:I+=.035;const F=u.Tt.construct(f.current),$=u.G.construct(A);if(Array.from(f.current.children).push(f.current),!u.Tt.contains(F,$)||f.current!==A.target&&j.findParent(A.target,P=>P===f.current)==null)return;const T=ro(x.current,u.Tt.construct(f.current)).pos(u.G.construct(A));let D=u.b.XY.magnify({x:w.current.held?1:I,y:L.current.held?1:I}).box(x.current);D=u.Tt.translate(D,{x:w.current.held?0:T.x*(1-I),y:L.current.held?0:T.y*(1-I)}),p(D),e==null||e({stage:"end",box:D,cursor:u.G.construct(A),mode:"zoom"})};return window.addEventListener("wheel",N),()=>window.removeEventListener("wheel",N)},[p,e]),Wi.useDrag({bound:f,onDrag:C,triggers:y,loose:!0});const _=g.useCallback(({triggers:N,stage:A})=>{if(A==="end")return d(i);const I=j.determineMode(S,N);I!=null&&d(I)},[S,i,e]);return j.use$1({triggers:k,callback:_,region:f}),{maskBox:l,ref:f,mode:a}},ro=(e,t)=>u.b.XY.scale(t).clamp(t).scale(e),Ar=(e,t,n)=>{let s=u.Tt.signedDims(ro(t,n).box(e));return s={signedWidth:-s.signedWidth,signedHeight:-s.signedHeight},u.Tt.truncate(u.b.XY.translate(u.G.construct(s)).box(t),Dn)},Ir=(e,t,n)=>u.Tt.height(t)<=e.height?u.Tt.construct(u.Tt.left(t),u.Tt.top(n),u.Tt.width(t),u.Tt.height(n)):u.Tt.width(t)<=e.width?u.Tt.construct(u.Tt.left(n),u.Tt.top(t),u.Tt.width(n),u.Tt.height(t)):t,ch=({mode:e,triggers:t})=>o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",children:[o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:u.d.capitalize(e)}),o.jsxRuntimeExports.jsx(te.Space,{empty:!0,direction:"x",align:"center",children:o.jsxRuntimeExports.jsx(j.Text,{trigger:t[0],level:"small"})})]}),ah={zoom:o.jsxRuntimeExports.jsx(j.Lt.Zoom,{}),pan:o.jsxRuntimeExports.jsx(j.Lt.Pan,{}),select:o.jsxRuntimeExports.jsx(j.Lt.Selection,{}),zoomReset:o.jsxRuntimeExports.jsx(j.Lt.Expand,{}),click:o.jsxRuntimeExports.jsx(j.Lt.Bolt,{})},uh=({triggers:e,disable:t=["zoomReset","click"],...n})=>{const s=Object.entries(e).filter(([r])=>!t.includes(r)&&on.includes(r)).map(([r,i])=>({key:r,icon:ah[r],tooltip:o.jsxRuntimeExports.jsx(ch,{mode:r,triggers:i})})).sort((r,i)=>on.indexOf(r.key)-on.indexOf(i.key));return o.jsxRuntimeExports.jsx(ve.Button,{...n,data:s,entryRenderKey:"icon",children:({title:r,entry:i,...l})=>g.createElement(j.Icon,{...l,key:i.key,variant:l.selected?"filled":"text",size:"medium",tooltip:i.tooltip,tooltipLocation:{x:"right",y:"top"}},i.icon)})},dh=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_TRIGGERS:Zo,MASK_MODES:Rl,MODES:on,Mask:hl,PAN_DEFAULT_TRIGGERS:Cl,SELECT_DEFAULT_TRIGGERS:bl,SelectMode:uh,ZOOM_DEFAULT_TRIGGERS:On,modeZ:oh,use:wl},Symbol.toStringTag,{value:"Module"})),xh=e=>e==null?null:e.closest(".pluto-line-plot__viewport")??null,vl=({ref:e,children:t,initial:n=u.Tt.DECIMAL,onChange:s,...r})=>{const{setViewport:i}=We("Viewport");g.useLayoutEffect(()=>{i({box:n,mode:"zoom",cursor:u.G.ZERO,stage:"start"})},[i,n]);const l=g.useCallback(a=>{i(a),s==null||s(a)},[s,i]),c=wl({onChange:l,initial:n,ref:e,...r});return o.jsxRuntimeExports.jsx(hl,{className:u.CSS.BE("line-plot","viewport"),...c,children:t})},ph=Object.freeze(Object.defineProperty({__proto__:null,Floating:Oo,Legend:pl,Line:Fo,LinePlot:cl,Title:ml,Tooltip:Bf,Viewport:vl,XAxis:al,YAxis:ul,axisFactory:$o,selectViewportEl:xh,useContext:We,useGridEntry:yn,useViewport:ll},Symbol.toStringTag,{value:"Module"})),mh=({aetherKey:e,...t})=>(j.use$3({aetherKey:e,type:B.Annotation.TYPE,schema:B.annotationStateZ,initialState:t}),null),kl=({aetherKey:e,menu:t,...n})=>{const s=j.useUniqueKey(e),{setViewport:r,setHold:i}=We("Range.Provider"),[,{hovered:l,count:c},a]=j.use$3({aetherKey:s,type:B.Provider$1.TYPE,schema:B.providerStateZ,initialState:{...n,cursor:null,hovered:null,count:0}}),d=yn({key:s,loc:"top",size:c>0?32:0,order:3},"Annotation.Provider"),x=j.useContextMenu(),p=j.useSyncedRef(x.visible),m=g.useCallback(f=>{const h=y=>{a(S=>({...S,cursor:{x:y.clientX,y:y.clientY}}))},E=f.currentTarget;E.addEventListener("mousemove",h),E.addEventListener("mouseleave",()=>{E.removeEventListener("mousemove",h),p.current||a(y=>({...y,cursor:null}))},{once:!0})},[a]);return o.jsxRuntimeExports.jsx(j.ContextMenu,{style:{...d,cursor:l!=null?"pointer":"default"},...x,menu:()=>t==null||l==null?null:t(l),children:o.jsxRuntimeExports.jsx(te.Space,{style:{width:"100%",height:"100%"},onClick:()=>{l!=null&&(r({box:u.Tt.construct({x:l.viewport.lower,y:0},{x:l.viewport.upper,y:1}),mode:"zoom",cursor:u.G.ZERO,stage:"start"}),i(!0))},onMouseEnter:m})})},fh=Object.freeze(Object.defineProperty({__proto__:null,Annotation:mh,Provider:kl},Symbol.toStringTag,{value:"Module"})),_l={defaultMode:"empty",one:[["1"]],two:[["2"]],clear:[["Shift"]],empty:[[]]},hh=j.flattenConfig(_l),Ml=({aetherKey:e})=>{const t=j.useUniqueKey(e),[,,n]=j.use$3({aetherKey:t,type:B.Measure.TYPE,schema:B.measureStateZ,initialState:{hover:null,one:null,two:null}}),s=g.useRef(null),r=j.useHeldRef({triggers:hh,loose:!0}),i=g.useCallback(({mode:a,cursor:d})=>{if(a==="click"){const x=j.determineMode(_l,r.current.triggers,{loose:!0});if(["one","two"].includes(x))return n(p=>({...p,[x]:d}));n(x==="clear"?p=>({...p,one:null,two:null}):p=>({...p,one:p.one??d,two:p.one!==null?d:p.two}))}},[n,r]);ll(i);const l=g.useCallback(a=>n(d=>({...d,hover:u.G.construct(a)})),[n]),c=g.useCallback(()=>{n(a=>({...a,hover:null}))},[n]);return g.useEffect(()=>{if(s.current===null)return;const a=s.current.parentElement;if(a!=null)return a.addEventListener("mousemove",l),a.addEventListener("mouseleave",c),()=>{a.removeEventListener("mousemove",l),a.removeEventListener("mouseleave",c)}},[i]),o.jsxRuntimeExports.jsx("span",{ref:s})},gh=Object.freeze(Object.defineProperty({__proto__:null,Measure:Ml},Symbol.toStringTag,{value:"Module"})),Go=({aetherKey:e,label:t,position:n,onLabelChange:s,onPositionChange:r,onUnitsChange:i,units:l="",color:c,lineWidth:a,lineDash:d,className:x,onSelect:p,style:m,...f})=>{const[h,E]=Z.usePurePassthrough({value:t,onChange:s,initial:""}),y=j.useSyncedRef(r),[,{pixelPosition:S},k]=j.use$3({aetherKey:e,type:B.Rule.TYPE,schema:B.ruleStateZ,initialState:{color:c,dragging:!1,position:n,lineWidth:a,lineDash:d},onAetherChange:g.useCallback(({position:z})=>{var R;z!=null&&((R=y.current)==null||R.call(y,z))},[y])}),C=g.useRef(S);S!==C.current&&(C.current=S);const{id:b}=We("Rule"),w=document.getElementById(b),L=w==null?void 0:w.querySelector(".pluto-line-plot__viewport"),_=g.useRef(S);g.useEffect(()=>{k(z=>({...z,position:n,color:c,lineWidth:a,lineDash:d}))},[n,c,a,d]);const N=j.useCursorDrag({onStart:g.useCallback(()=>{p==null||p(),k(z=>({...z,dragging:!0})),_.current=C.current},[]),onMove:z=>{k(R=>({...R,pixelPosition:(_.current??0)+u.Tt.signedHeight(z)}))},onEnd:g.useCallback(()=>{k(z=>({...z,dragging:!1})),_.current=S},[])}),A=g.useRef(null);if(n==null||S==null)return null;const F=new u.Color(c).pickByContrast("#000000","#ffffff"),$=o.jsxRuntimeExports.jsxs("div",{ref:A,className:u.CSS.B("rule"),style:{top:`calc(${S}px - 0.5rem)`},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("rule","drag-handle"),onDragStart:N,draggable:!0}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",className:u.CSS(x,u.CSS.BE("rule","tag")),bordered:!0,onClick:p,size:1,rounded:!0,style:{borderColor:u.cssString(c),backgroundColor:new u.Color(c).setAlpha(.7).hex,...m},...f,children:[o.jsxRuntimeExports.jsx(j.Editable,{className:u.CSS.B("label"),level:"small",value:h,onChange:E,color:F}),o.jsxRuntimeExports.jsx(j.Divider,{direction:"y",style:{borderColor:u.cssString(c)}}),o.jsxRuntimeExports.jsxs(te.Space,{size:"small",direction:"x",align:"center",children:[o.jsxRuntimeExports.jsx(j.Editable,{value:n.toFixed(2),onChange:z=>{const R=Number(z);isFinite(R)&&(r==null||r(R))},level:"small",color:F}),o.jsxRuntimeExports.jsx(j.MaybeEditable,{level:"small",color:F,value:l,onChange:i})]})]})]});return L==null?$:Mo.createPortal($,L)},jh=Object.freeze(Object.defineProperty({__proto__:null,Rule:Go},Symbol.toStringTag,{value:"Module"})),Ll=j.canDropOfType(Ye),Eh=({lines:e,axes:t,showTitle:n=!0,title:s="",onTitleChange:r,showLegend:i=!0,legendPosition:l,onLegendPositionChange:c,titleLevel:a="h4",onLineChange:d,onRuleChange:x,onAxisChannelDrop:p,onAxisChange:m,rules:f,enableTooltip:h=!0,enableMeasure:E=!1,initialViewport:y=u.Tt.DECIMAL,legendVariant:S,onViewportChange:k,viewportTriggers:C,annotationProvider:b,onSelectRule:w,...L})=>{var F;const _=t.filter(({location:$})=>u.K.isY($)),N=g.useRef(null),A=j.usePrevious(e.length),I=j.usePrevious(L.hold);return(A===0&&e.length!==0||I===!0&&L.hold===!1)&&((F=N.current)==null||F.reset()),o.jsxRuntimeExports.jsxs(cl,{...L,children:[_.map(($,z)=>{const R=e.filter(D=>D.axes.x===$.key),T=t.filter(({location:D})=>u.K.isX(D)),M=f==null?void 0:f.filter(D=>[...T.map(({key:P})=>P),$.key].includes(D.axis));return o.jsxRuntimeExports.jsx(yh,{axis:$,index:z,lines:R,yAxes:T,rules:M,onAxisChannelDrop:p,onAxisChange:m,annotationProvider:b,onRuleChange:x,onSelectRule:w},$.key)}),i&&o.jsxRuntimeExports.jsx(pl,{onLineChange:d,position:l,onPositionChange:c,variant:S}),n&&o.jsxRuntimeExports.jsx(ml,{value:s,onChange:r,level:a}),o.jsxRuntimeExports.jsxs(vl,{initial:y,onChange:k,triggers:C,ref:N,children:[h&&o.jsxRuntimeExports.jsx(fl,{}),E&&o.jsxRuntimeExports.jsx(Ml,{})]})]})},yh=({yAxes:e,lines:t,index:n,rules:s,onRuleChange:r,onSelectRule:i,onAxisChannelDrop:l,onAxisChange:c,axis:{location:a,key:d,showGrid:x,...p},annotationProvider:m})=>{const f=j.useDrop({type:"Channel.LinePlot.XAxis",canDrop:Ll,onDrop:g.useCallback(({items:y})=>{const S=j.filterByType(Ye,y);return l==null||l(d,S.map(({key:k})=>k)),S},[d,l])}),h=s==null?void 0:s.filter(y=>y.axis===d),E=j.useDraggingState();return o.jsxRuntimeExports.jsxs(al,{...p,...f,location:a,showGrid:x??n===0,className:u.CSS(u.CSS.dropRegion(j.canDropOfType(Ye)(E))),onAutoBoundsChange:y=>c==null?void 0:c({key:d,bounds:y}),children:[e.map((y,S)=>{const k=t.filter(b=>b.axes.y===y.key),C=s==null?void 0:s.filter(b=>b.axis===y.key);return o.jsxRuntimeExports.jsx(Rh,{axis:{...y,showGrid:x??(n===0&&S===0)},lines:k,rules:C,onRuleChange:r,onAxisChannelDrop:l,onAxisChange:c,onSelectRule:i},y.key)}),h==null?void 0:h.map(y=>g.createElement(Go,{aetherKey:y.key,...y,key:y.key,onLabelChange:S=>r==null?void 0:r({key:y.key,label:S}),onPositionChange:S=>r==null?void 0:r({key:y.key,position:S}),onUnitsChange:S=>r==null?void 0:r({key:y.key,units:S}),onSelect:()=>i==null?void 0:i(y.key)})),o.jsxRuntimeExports.jsx(kl,{...m})]})},Sh=({channels:{x:e,y:t}})=>`${e??0}-${t}`,Rh=({lines:e,rules:t,onRuleChange:n,onAxisChannelDrop:s,onAxisChange:r,axis:{key:i,location:l,...c},onSelectRule:a})=>{const d=j.useDrop({type:"Channel.LinePlot.YAxis",canDrop:Ll,onDrop:g.useCallback(({items:p})=>{const m=j.filterByType(Ye,p);return s==null||s(i,m.map(({key:f})=>f)),m},[i,s])}),x=j.useDraggingState();return o.jsxRuntimeExports.jsxs(ul,{...c,...d,location:l,className:u.CSS(u.CSS.dropRegion(j.canDropOfType(Ye)(x))),onAutoBoundsChange:p=>r==null?void 0:r({key:i,bounds:p}),children:[e.map(p=>o.jsxRuntimeExports.jsx(Ch,{line:p},Sh(p))),t==null?void 0:t.map(p=>g.createElement(Go,{aetherKey:p.key,...p,key:p.key,onLabelChange:m=>n==null?void 0:n({key:p.key,label:m}),onPositionChange:m=>n==null?void 0:n({key:p.key,position:m}),onUnitsChange:m=>n==null?void 0:n({key:p.key,units:m}),onClick:()=>a==null?void 0:a(p.key)}))]})},Ch=({line:e})=>e.variant==="static"?o.jsxRuntimeExports.jsx(wh,{line:e}):o.jsxRuntimeExports.jsx(bh,{line:e}),bh=({line:{key:e,timeSpan:t,channels:{x:n,y:s},axes:r,...i}})=>{const{xTelem:l,yTelem:c}=g.useMemo(()=>{const a=Number(t.valueOf())*3,d=B.streamChannelData({timeSpan:t,channel:s,keepFor:a}),x=n!=null&&n!==0;return{xTelem:B.streamChannelData({timeSpan:t,channel:x?n:s,useIndexOfChannel:!x,keepFor:a}),yTelem:d}},[t.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(Fo,{aetherKey:e,y:c,x:l,...i})},wh=({line:{timeRange:e,key:t,channels:{x:n,y:s},...r}})=>{const{xTelem:i,yTelem:l}=g.useMemo(()=>{const c=B.channelData({timeRange:e,channel:s}),a=n!=null&&n!==0;return{xTelem:B.channelData({timeRange:e,channel:a?n:s,useIndexOfChannel:!a}),yTelem:c}},[e.start.valueOf(),e.end.valueOf(),n,s]);return o.jsxRuntimeExports.jsx(Fo,{aetherKey:t,y:l,x:i,...r})},$r=[{key:"name",name:"Name"},{key:"alias",name:"Alias"},{key:"rate",name:"Rate"},{key:"dataType",name:"Data Type"},{key:"index",name:"Index"},{key:"key",name:"Key"},{key:"isIndex",name:"Is Index"}],Wn=({items:e},t)=>{const n=j.filterByType(Ye,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Pl=["name","alias"],Tl=e=>{const t=xs();return g.useMemo(()=>e.length===0?$r:$r.filter(n=>e.includes(n.key)),[e,t])},Nl=e=>{if(e==null)return o.jsxRuntimeExports.jsx(j.Lt.Channel,{});if(Z.Fg.isCalculated(e))return o.jsxRuntimeExports.jsx(j.Lt.Calculation,{});if(e.isIndex)return o.jsxRuntimeExports.jsx(j.Lt.Index,{});const t=new Z.g(e.dataType);return t.isInteger?o.jsxRuntimeExports.jsx(j.Lt.Binary,{}):t.isFloat?o.jsxRuntimeExports.jsx(j.Lt.Decimal,{}):t.equals(Z.g.STRING)?o.jsxRuntimeExports.jsx(j.Lt.String,{}):t.equals(Z.g.JSON)?o.jsxRuntimeExports.jsx(j.Lt.JSON,{}):o.jsxRuntimeExports.jsx(j.Lt.Channel,{})},vh=({key:e,...t})=>o.jsxRuntimeExports.jsx(Ho,{icon:Nl(t.entry),...t},e),kh=({columns:e=Pl,onChange:t,className:n,value:s,searchOptions:r,...i})=>{const l=Fe(),c=xs(),a=Tl(e),d=Io(),x=j.useMemoDeepEqualProps(r),p=g.useMemo(()=>l==null?void 0:l.channels.newSearcherWithOptions({rangeKey:d,internal:!1,...x}),[l,d,x]),m=l!=null?void 0:o.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:f,onDragEnd:h,...E}=j.useDragAndDrop({type:"Channel.SelectMultiple",canDrop:g.useCallback(b=>Wn(b,Z.A(s)),[s]),onDrop:g.useCallback(({items:b})=>{const w=j.filterByType(Ye,b);if(w.length===0)return[];const L=Z.c.unique([...Z.A(s),...w.map(_=>_.key)]);return t(L,{clickedIndex:null,clicked:null,entries:[]}),w},[t,s])}),y=j.useDraggingState(),S=g.useCallback(({dropped:b})=>{t(Z.A(s).filter(w=>!b.some(L=>L.key===w)),{clickedIndex:null,clicked:null,entries:[]})},[t,s]),k=g.useCallback((b,w)=>f([{key:w,type:Ye}],S),[f,S]),C=g.useCallback(b=>c[b.key]??b.name,[c]);return o.jsxRuntimeExports.jsx(Wt,{className:u.CSS(n,u.CSS.dropRegion(Wn(y,Z.A(s)))),value:s,onTagDragStart:k,onTagDragEnd:h,searcher:p,onChange:t,columns:a,emptyContent:m,entryRenderKey:C,renderTag:vh,...E,...i})},Ct=({columns:e=Pl,onChange:t,value:n,className:s,data:r,searchOptions:i,...l})=>{const c=Fe(),a=xs(),d=Tl(e),x=Io(),p=j.useMemoDeepEqualProps(i),m=g.useMemo(()=>{if(!(r!=null&&r.length>0))return c==null?void 0:c.channels.newSearcherWithOptions({rangeKey:x,internal:!1,...p})},[c,x,r==null?void 0:r.length,p]),f=c!=null?void 0:o.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),h=g.useId(),E=g.useMemo(()=>({key:h,type:"Channel.SelectMultiple"}),[h]),{startDrag:y,onDragEnd:S,...k}=j.useDragAndDrop({type:"Channel.SelectSingle",canDrop:g.useCallback(L=>Wn(L,Z.o$1(n)),[n]),onDrop:g.useCallback(({items:L})=>{const _=j.filterByType(Ye,L);return _.length===0?[]:(t(_[0].key,{clickedIndex:null,clicked:null,entries:[]}),_)},[E,t])}),C=j.useDraggingState(),b=g.useCallback(()=>n!=null&&y([{type:Ye,key:n}]),[y,n]),w=g.useCallback(L=>a[L.key]??L.name,[a]);return o.jsxRuntimeExports.jsx(xt,{data:r,className:u.CSS(s,u.CSS.dropRegion(Wn(C,Z.o$1(n)))),value:n,onDragStart:b,onDragEnd:S,onChange:t,searcher:m,columns:d,emptyContent:f,entryRenderKey:w,...k,...l})},_h=Object.freeze(Object.defineProperty({__proto__:null,AliasInput:hf,AliasProvider:sl,LinePlot:Eh,SelectMultiple:kh,SelectSingle:Ct,resolveIcon:Nl,useActiveRange:Io,useAlias:nl,useAliases:xs,useContext:tl,useName:ps},Symbol.toStringTag,{value:"Module"})),pt=({path:e,optional:t=!1,onChange:n})=>{const s=tt(),{get:r,bind:i,set:l,setStatus:c}=s,[a,d]=g.useState(r(e,{optional:t}));g.useEffect(()=>(d(r(e,{optional:t})),i({path:e,onChange:d,listenToChildren:!1})),[e,n,i,r]);const x=g.useCallback(f=>{n==null||n(f,{...s,path:e}),l(e,f)},[e,l,n]),p=g.useCallback(f=>c(e,f),[e,c]);if(a==null){if(!t)throw new Error(`Field state is null: ${e}`);return null}let m;return s.mode==="preview"&&(m="preview"),{onChange:x,setStatus:p,variant:m,...a}},Al=(e,t=!1,n)=>{const{get:s,bind:r}=tt(n),[,i]=g.useState(0);return g.useEffect(()=>(i(l=>l+1),r({path:e,onChange:()=>i(l=>l+1)})),[e,r]),s(e,{optional:t})??null},Il=(e,t=!1,n)=>{var l;const{get:s,bind:r}=tt(n),[,i]=g.useState(0);return g.useEffect(()=>(i(c=>c+1),r({path:e,onChange:()=>i(c=>c+1)})),[e,r]),((l=s(e,{optional:t}))==null?void 0:l.value)??null},Mh=e=>{var t,n;return((n=(t=Al(e,!0))==null?void 0:t.status)==null?void 0:n.variant)==="success"},Lh=({path:e,ctx:t,onChange:n})=>{const s=tt(t);g.useEffect(()=>s.bind({path:e,onChange:r=>n(r,s),listenToChildren:!1}),[e,s])},Ph=({path:e,optional:t=!1})=>{const{bind:n,get:s}=tt(),[r,i]=g.useState(s(e,{optional:t}));if(g.useEffect(()=>(i(s(e,{optional:t})),n({path:e,onChange:l=>i({...l,value:Z.ee(l.value)}),listenToChildren:!0})),[e,n,s]),r==null&&!t)throw new Error("Field state is null");return(r==null?void 0:r.value)??null},$l=(e,t)=>({add:(n,s)=>{const r=Z.ee(e.get(t).value);r.splice(s,0,...Z.A(n)),e.set(t,r,{validateChildren:!1})},push:(n,s)=>{const r=Z.ee(e.get(t).value);r.push(...Z.A(n)),s!=null&&r.sort(s),e.set(t,r,{validateChildren:!1})},remove:n=>{const s=e.get(t).value,r=new Set(Z.A(n));e.set(t,s.filter((i,l)=>!r.has(l)))},keepOnly:n=>{const s=e.get(t).value,r=new Set(Z.A(n));e.set(t,s.filter((i,l)=>r.has(l)))},set:n=>e.set(t,Z.executeSetter(n,e.get(t).value)),sort:n=>{const s=Z.ee(e.get(t).value);s.sort(n),e.set(t,s)}}),Th=({path:e,updateOnChildren:t=!1,ctx:n})=>{const s=tt(n),{bind:r,get:i}=s,[l,c]=g.useState(i(e).value);return g.useEffect(()=>(c(i(e).value),r({path:e,onChange:a=>{c(Z.ee(a.value))},listenToChildren:t})),[e,r,i,c]),g.useMemo(()=>({value:l,...$l(s,e)}),[l,s,e])},Yo=g.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:()=>{}}),tt=e=>{const t=g.useContext(Yo);return e??t},zr=e=>({key:e,variant:"success",message:""}),Nh=e=>e.code===ce.z.ZodIssueCode.custom&&e.params!=null&&"variant"in e.params?e.params.variant:"error",zl=({values:e,sync:t=!1,schema:n,mode:s="normal",onChange:r})=>{const i=g.useRef({state:e,statuses:new Map,touched:new Set,listeners:new Map,parentListeners:new Map}),l=j.useSyncedRef(n),c=j.useSyncedRef(r),a=g.useCallback(({path:w,onChange:L,listenToChildren:_=!1})=>{var F;const{parentListeners:N,listeners:A}=i.current,I=_?N:A;return I.has(w)||I.set(w,new Set),(F=I.get(w))==null||F.add(L),()=>{var $;return($=I.get(w))==null?void 0:$.delete(L)}},[]),d=g.useCallback((w,{optional:L}={optional:!1})=>{const{state:_,statuses:N,touched:A}=i.current,I=Z._.get(_,w,{optional:L});if(I==null)return null;const F={value:I,status:N.get(w)??zr(w),touched:A.has(w),required:!1};if(l.current==null)return F;const $=l.current,z=Z.y.getFieldSchema($,w,{optional:!0});return z==null||(F.required=!z.isOptional()),F},[]),x=g.useCallback(w=>{const{state:L,statuses:_,touched:N,listeners:A,parentListeners:I}=i.current;Z._.remove(L,w),_.delete(w),N.delete(w),A.delete(w),I.delete(w)},[]),p=g.useCallback(w=>{const{statuses:L,touched:_}=i.current;i.current.state=w,f(""),L.clear(),_.clear()},[]),m=g.useCallback(w=>{var N;const{listeners:L}=i.current,_=d(w,{optional:!0});_!=null&&((N=L.get(w))==null||N.forEach(A=>A(_)))},[]),f=g.useCallback(w=>{const{listeners:L,parentListeners:_}=i.current,N=L.get(w);if(w==""&&([...L.keys()].forEach(F=>{var z;const $=d(F,{optional:!0});$!=null&&((z=L.get(F))==null||z.forEach(R=>{R($)}))}),[..._.keys()].forEach(F=>{var z;const $=d(F,{optional:!0});$!=null&&((z=_.get(F))==null||z.forEach(R=>{R($)}))})),N!=null){const A=d(w,{optional:!0});A!=null&&N.forEach(I=>{I(A)})}_.forEach((A,I)=>{if(Z._.pathsMatch(w,I)){const $=d(I,{optional:!0});$!=null&&A.forEach(z=>{z($)})}})},[]),h=g.useCallback((w,L="",_=!0)=>{const{statuses:N,listeners:A,touched:I}=i.current;if(w.success){const R=[...N.keys()];return N.clear(),R.forEach(T=>m(T)),!0}let F=!0;const $=new Set(w.error.issues.map(R=>R.path.join(".")));let z=(R,T)=>R===T;return _&&(z=(R,T)=>Z._.pathsMatch(R,T)),w.error.issues.forEach(R=>{var V;const{message:T}=R,M=R.path.join(".");if(!z(M,L))return;const D=Nh(R);D!=="warning"&&(F=!1),N.set(M,{key:M,variant:D,message:T}),I.add(M);let P=d(M,{optional:!0});P??(P={value:void 0,status:N.get(M)??zr(M),touched:!1,required:!1}),(V=A.get(M))==null||V.forEach(H=>H(P))}),N.forEach((R,T)=>{$.has(T)||(N.delete(T),m(T))}),F},[]),E=g.useCallback((w,L)=>{if(l.current==null)return!0;const{state:_}=i.current,N=l.current.safeParse(_);return h(N,w,L)},[h]),y=g.useCallback(async(w,L)=>{if(l.current==null)return!0;const{state:_}=i.current,N=await l.current.safeParseAsync(_);return h(N,w,L)},[h]),S=g.useCallback((w,L,_={})=>{const N=Z._.get(i.current.state,w,{optional:!0}),{validateChildren:A=!0}=_,{state:I,touched:F}=i.current;F.add(w),w.length===0?i.current.state=L:Z._.set(I,w,L),f(w),(async()=>{var z;let $;try{$=E(w,A)}catch{$=await y(w,A)}(z=c.current)==null||z.call(c,{values:i.current.state,path:w,prev:N,valid:$})})()},[]),k=g.useCallback(w=>Z._.has(i.current.state,w),[]),C=g.useCallback((w,L)=>{i.current.statuses.set(w,L),i.current.touched.add(w),m(w)},[]),b=g.useCallback(()=>{const{statuses:w}=i.current;w.clear(),w.forEach((L,_)=>m(_))},[]);return g.useEffect(()=>{if(!t)return;const{listeners:w}=i.current;i.current.state=e,w.forEach((L,_)=>{const N=d(_,{optional:!0});N!=null&&L.forEach(A=>A(N))})},[t,e]),g.useMemo(()=>({bind:a,set:S,get:d,mode:s,validate:E,validateAsync:y,value:()=>i.current.state,has:k,remove:x,setStatus:C,clearStatuses:b,reset:p}),[a,S,d,E,y,k,x,C,b,p,s])},Ah=e=>o.jsxRuntimeExports.jsx(Yo.Provider,{value:e,children:e.children}),Ih=j.componentRenderProp(j.Text$2),ye=({path:e,children:t=Ih,label:n,padHelpText:s=!0,visible:r=!0,hideIfNull:i=!1,optional:l,onChange:c,className:a,...d})=>{const x=pt({path:e,optional:l??i,onChange:c}),p=tt();if(x==null)return null;if(e==null)throw new Error("No path provided to Form Field");if(n??(n=u.d.capitalize(Z._.element(e,-1))),r=typeof r=="function"?r(x,p):r,!r)return null;const m=x.status.message,{onChange:f,value:h}=x,E={onChange:f,value:h};return x.variant!=null&&(E.variant=x.variant),o.jsxRuntimeExports.jsx(Te.Item,{padHelpText:s,helpText:m,helpTextVariant:x.status.variant,label:n,required:x.required,className:u.CSS(a,u.CSS.BE("field",e.split(".").join("-")),u.CSS.M(x.status.variant)),...d,children:t(E)})},Mt=e=>({fieldKey:t,fieldProps:n,inputProps:s})=>{const r=({inputProps:i,path:l,fieldKey:c=t,...a})=>o.jsxRuntimeExports.jsx(ye,{...n,...a,path:c?`${l}.${c}`:l,children:d=>o.jsxRuntimeExports.jsx(e,{...d,...s,...i})});return r.displayName=e.displayName,r},Bl=Mt(j.Numeric),zt=Bl({}),Dl=Mt(j.Text$2),Wo=Dl({}),Ol=Mt(j.Switch$1),hs=Ol({}),$h=Mt(xt),zh=Mt(Wt),Bh=Mt(ve.DropdownButton),Ko=({key:e,open:t,onChange:n})=>{const s=j.useMemoPrimitiveArray(e);j.useAsyncEffect(async()=>{if(t==null)return;const r=await t();if(r!=null)return r.onChange(n),async()=>await r.close()},[t==null,s])},Dh=({fetchInitialValue:e,...t})=>{const[n,s]=g.useState(void 0);return j.useAsyncEffect(async()=>{s(await e())},[e]),Ko({...t,onChange:s}),n},Oh=Object.freeze(Object.defineProperty({__proto__:null,useListener:Ko,useState:Dh},Symbol.toStringTag,{value:"Module"})),Vh=({key:e,name:t,queryFn:n,values:s,openObservable:r,applyChanges:i,applyObservable:l,...c})=>{const a=Fe(),d=j.useExceptionHandler(),x=j.useMemoPrimitiveArray(e),p=zl({values:s,...c,sync:!1,onChange:h=>{a!=null&&(async()=>{try{await(i==null?void 0:i({...h,client:a}))}catch(E){d(E,`Failed to save ${t}`)}})()}});j.useAsyncEffect(async()=>{if(a!=null)try{const h=await n({client:a});p.set("",h)}catch(h){d(h,`Failed to retrieve ${t}`)}},[x,a==null?void 0:a.key]);const m=g.useCallback(async()=>{if(a!=null)return await(r==null?void 0:r(a))},[x,a==null?void 0:a.key]),f=g.useCallback(h=>l==null?void 0:l({changes:h,ctx:p}),[x,l]);return Ko({key:x,open:m,onChange:f}),p},Fh=Object.freeze(Object.defineProperty({__proto__:null,Context:Yo,Field:ye,Form:Ah,NumericField:zt,SwitchField:hs,TextField:Wo,buildDropdownButtonSelectField:Bh,buildNumericField:Bl,buildSelectMultiField:zh,buildSelectSingleField:$h,buildSwitchField:Ol,buildTextField:Dl,fieldArrayUtils:$l,fieldBuilder:Mt,use:zl,useChildFieldValues:Ph,useContext:tt,useField:pt,useFieldArray:Th,useFieldListener:Lh,useFieldState:Al,useFieldValid:Mh,useFieldValue:Il,useSynced:Vh},Symbol.toStringTag,{value:"Module"})),Hh=[{key:"name",name:"Name"},{key:"location",name:"Location"}],Zh=({searchOptions:e,...t})=>{const n=Fe();let s=n==null?void 0:n.hardware.devices;return e!=null&&n!=null&&(s=n.hardware.devices.newSearcherWithOptions(e)),o.jsxRuntimeExports.jsx(xt,{columns:Hh,searcher:s,entryRenderKey:"name",...t})},Gh=Object.freeze(Object.defineProperty({__proto__:null,SelectSingle:Zh},Symbol.toStringTag,{value:"Module"})),Bt="label",Xo=[{key:"color",name:"Color",render:({entry:e})=>o.jsxRuntimeExports.jsx(j.Lt.Circle,{name:"circle",color:e.color,style:{height:"2.5rem",width:"2.5rem"}})},{key:"name",name:"Name"}],Kn=({items:e},t)=>{const n=j.filterByType(Bt,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Yh=({entry:e,loading:t,entryKey:n,entryRenderKey:s,...r})=>o.jsxRuntimeExports.jsx(an,{color:e==null?void 0:e.color,...r,children:e==null?void 0:e.name}),Wh=j.componentRenderProp(Yh),Kh=({onChange:e,className:t,value:n,...s})=>{const r=Fe(),i=r!=null?void 0:o.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=j.useDragAndDrop({type:"Label.SelectMultiple",canDrop:g.useCallback(m=>Kn(m,Z.A(n)),[n]),onDrop:g.useCallback(({items:m})=>{const f=j.filterByType(Bt,m);if(f.length===0)return[];const h=Z.c.unique([...Z.A(n),...f.map(E=>E.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),d=j.useDraggingState(),x=g.useCallback(({dropped:m})=>{e(Z.A(n).filter(f=>!m.some(h=>h.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=g.useCallback((m,f)=>l([{key:f,type:Bt}],x),[l,x]);return o.jsxRuntimeExports.jsx(Wt,{className:u.CSS(t,u.CSS.dropRegion(Kn(d,Z.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.labels,onChange:e,columns:Xo,emptyContent:i,renderTag:Wh,addPlaceholder:"Label",...a,...s})},Vl=({value:e,onChange:t})=>{const n=Fe(),s=n!=null?void 0:o.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=g.useId(),i=g.useMemo(()=>({key:r,type:"Label.SelectMultiple"}),[r]),l=j.useDragAndDrop({type:"Label.SelectSingle",canDrop:g.useCallback(d=>Kn(d,Z.o$1(e)),[e]),onDrop:g.useCallback(({items:d})=>{const x=j.filterByType(Bt,d);return x.length===0?[]:(t(x[0].key,{clickedIndex:null,clicked:null,entries:[]}),x)},[i,t])}),c=j.useDraggingState(),a=g.useCallback(()=>e!=null&&l.startDrag([{type:Bt,key:e}]),[l.startDrag,e]);return{emptyContent:s,dragging:c,...l,onDragStart:a,searcher:n==null?void 0:n.labels}},Xh=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:i,...l}=Vl({value:t,onChange:e});return o.jsxRuntimeExports.jsx(xt,{data:s,className:u.CSS(n,u.CSS.dropRegion(Kn(i,Z.o$1(t)))),value:t,onChange:e,columns:Xo,entryRenderKey:"name",...l,...r})},qh=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...i}=Vl({value:t,onChange:n});return o.jsxRuntimeExports.jsx(xt,{data:e,value:t,onChange:n,columns:Xo,entryRenderKey:"name",...i,...s})},Uh=Object.freeze(Object.defineProperty({__proto__:null,HAUL_TYPE:Bt,SelectButton:qh,SelectMultiple:Kh,SelectSingle:Xh},Symbol.toStringTag,{value:"Module"})),Fl=({children:e,centered:t,visible:n,enabled:s=!0,close:r,style:i,...l})=>{const c=g.useRef(null),a=g.useRef(n);j.useClickOutside({ref:c,exclude:x=>j.findParent(x.target,m=>m.getAttribute("role")==="dialog")!=null,onClickOutside:r});const d=g.useCallback(x=>{var m;if(!a.current||x.stage!=="start")return;const p=(m=c.current)==null?void 0:m.querySelectorAll(`.${u.CSS.visible(!0)}`);p&&p.length>0||r()},[r]);return j.use$1({triggers:[["Escape"]],callback:d,loose:!0}),o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(u.CSS.BE("modal","bg"),u.CSS.visible(n),s&&u.CSS.M("enabled-modal")),empty:!0,align:"center",children:o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(u.CSS.BE("modal","dialog"),t&&u.CSS.M("centered")),role:"dialog",empty:!0,ref:c,...l,style:{zIndex:s?11:void 0,...i},children:o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(u.CSS.BE("modal","content")),empty:!0,children:e})})})},Jh=({root:e,...t})=>Mo.createPortal(o.jsxRuntimeExports.jsx(Fl,{...t}),j.getRootElement(e)),Qh=Object.freeze(Object.defineProperty({__proto__:null,Dialog:Fl,Modal:Jh},Symbol.toStringTag,{value:"Module"})),gs=new Error("Tab not found"),eg=new Error("Invalid Mosaic"),Xn=(e,t,n="center",s)=>{var p;if(e=nt(e),s===void 0)return io(e,t);const r=lo(e,s);if(n==="center")return(p=r.tabs)==null||p.push(t),r.selected=t.tabKey,e;const i=r.key*2,l=r.key*2+1,c=n==="top"||n==="left"?i:l;if(lo(e,c).key!==r.key)return Xn(e,t,"center",c);if(r.tabs==null||r.tabs.length===0)return Xn(e,t,"center",s);const[a,d,x]=ig(n);if(r.direction=x,r[a]={key:0,tabs:[t],selected:t.tabKey},r[d]={key:0,tabs:r.tabs,selected:r.selected},r.first==null||r.last==null)throw eg;return r.first.key=i,r.last.key=l,r.tabs=void 0,r.size=void 0,r.selected=void 0,e},tg=(e,t,n)=>{var i;e=nt(e);const[s,r]=bt(e,t);if(s==null||r==null)throw gs;return r.tabs=(i=r.tabs)==null?void 0:i.map(l=>l.tabKey===t?n(l):l),e},io=(e,t)=>(e=nt(e),e.tabs!=null?(e.tabs.push(t),e.selected=t.tabKey,e):(e.first!=null?e.first=io(e.first,t):e.last!=null&&(e.last=io(e.last,t)),e)),qn=e=>{e=nt(e);const t=[];if(e.tabs!=null&&(e.selected=ke.resetSelection(e.selected,e.tabs),e.selected!=null&&t.push(e.selected)),e.first!=null){const[n,s]=qn(e.first);e.first=n,t.push(...s)}if(e.last!=null){const[n,s]=qn(e.last);e.last=n,t.push(...s)}return[e,t]},qo=(e,t)=>{var r;e=nt(e);const[,n]=bt(e,t);if(n==null)return[e,null];n.tabs=(r=n.tabs)==null?void 0:r.filter(i=>i.tabKey!==t),n.selected=ke.resetSelection(n.selected,n.tabs),e=rg(e);const s=n.selected??Un(e);return[e,s]},Un=e=>e.selected!=null?e.selected:e.first!=null?Un(e.first):e.last!=null?Un(e.last):null,Hl=(e,t)=>{e=nt(e);const[n,s]=bt(e,t);if(n==null||s==null)throw gs;return s.selected=t,e},Zl=(e,t,n,s)=>{e=nt(e);const[r,i]=bt(e,t);if(r==null||i==null)throw gs;const[l,c]=qo(e,t);return[Xn(l,r,n,s),c]},un=(e,t)=>{if(e.tabs!=null)return e.tabs.some(n=>n.tabKey===t)?e:void 0;if(e.first!=null){const n=un(e.first,t);if(n!=null)return n}if(e.last!=null){const n=un(e.last,t);if(n!=null)return n}},Gl=(e,t,n)=>{const s=Jn(e,t);if(s==null)throw new Error("Node not found");return s.size=n,e},ng=(e,t,n)=>{e=nt(e);const s=un(e,t);if(s==null)throw new Error("Tab not found");if(s.tabs==null||s.tabs.length===0)throw new Error("Node has no tabs");const r=s.tabs.findIndex(x=>x.tabKey===t);if(r===-1)throw new Error("Tab not found in node");const i=s.tabs[r];s.tabs=s.tabs.filter(x=>x.tabKey!==t);const l=s.key*2,a={key:s.key*2+1,tabs:[i],selected:i.tabKey},d={key:l,tabs:s.tabs,selected:s.selected};return d.selected=ke.resetSelection(d.selected,d.tabs),s.direction=n,s.first=d,s.last=a,s.tabs=void 0,s.selected=void 0,e},sg=(e,t)=>{const n=un(e,t);return n==null?!1:n.tabs!=null&&n.tabs.length>1},Yl=(e,t,n)=>{e=nt(e);const[,s]=bt(e,t);if((s==null?void 0:s.tabs)==null)throw gs;return s.tabs=ke.rename(t,n,(s==null?void 0:s.tabs)??[]),e},og=e=>e.tabs!=null?e.tabs.length===0:e.first==null&&e.last==null,lo=(e,t)=>{const n=Jn(e,t);if(n!=null)return n;const s=Math.floor(t/2);return s===0?e:lo(e,s)},rg=e=>{let t=!0;for(;t;)[e,t]=co(e);return e.first==null&&e.last==null&&(e.key=1),e},co=e=>{if(e.first==null||e.last==null)return[e,!1];if(Dr(e.first))return[Br(e.last,!0),!0];if(Dr(e.last))return[Br(e.first,!1),!0];let t,n;return[e.first,t]=co(e.first),[e.last,n]=co(e.last),[e,t||n]},Br=(e,t)=>(e.size=void 0,e.key=(e.key-Number(t))/2,e),Dr=e=>e.first==null&&e.last==null&&(e.tabs==null||e.tabs.length===0),bt=(e,t)=>{if(e.tabs!=null){const l=e.tabs.find(c=>c.tabKey===t);if(l!=null)return[l,e]}if(e.first==null||e.last==null)return[void 0,void 0];const[n,s]=bt(e.first,t);if(n!=null&&s!=null)return[n,s];const[r,i]=bt(e.last,t);return[r,i]},Jn=(e,t)=>{if(e.key===t)return e;if(e.first==null||e.last==null)return;const n=Jn(e.first,t);return n??Jn(e.last,t)},ig=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")}},nt=e=>Z._.copy(e),Qn=(e,t,n=[])=>(n.push(t(e)),e.first!=null&&Qn(e.first,t,n),e.last!=null&&Qn(e.last,t,n),n),ao=(e,t)=>{t(e),e.first!=null&&ao(e.first,t),e.last!=null&&ao(e.last,t)};class Wl{constructor(t={}){Ge(this,"parent");Ge(this,"stub");Ge(this,"el");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 lg=({node:e})=>{const t=g.createRef(),n=g.useRef(e);return g.useEffect(()=>{const s=t.current;if(s==null)return;const r=s.parentNode;if(r!=null)return e.mount(r,s),()=>{t.current!=null&&e.unmount(t.current)}},[]),g.useEffect(()=>{n.current!=null&&e!==n.current&&(n.current.unmount(t.current),n.current=e);const s=t.current;if(s==null)return;const r=s.parentNode;r!=null&&e.mount(r,s)},[e]),o.jsxRuntimeExports.jsx("div",{ref:t})},Kl=({node:e,children:t})=>Mo.createPortal(t,e.el),cg=Object.freeze(Object.defineProperty({__proto__:null,In:Kl,Node:Wl,Out:lg},Symbol.toStringTag,{value:"Module"})),es=g.memo(e=>{const{onResize:t,...n}=e,{root:{tabs:s,direction:r,first:i,last:l,key:c,size:a},emptyContent:d,...x}=n,p=g.useCallback(([h])=>t(c,h),[t]),{props:m}=Po({direction:r,onResize:p,count:2,initialSizes:a!=null?[a]:void 0});let f;return s!==void 0?f=o.jsxRuntimeExports.jsx(Xl,{emptyContent:d,...n}):i!=null&&l!=null?f=o.jsxRuntimeExports.jsxs(To,{id:`mosaic-${c}`,align:"stretch",className:u.CSS.BE("mosaic","resize"),...m,children:[o.jsxRuntimeExports.jsx(es,{...x,root:i,onResize:t},i.key),o.jsxRuntimeExports.jsx(es,{...x,root:l,onResize:t},l.key)]}):(f=null,console.warn("Mosaic tree is malformed")),c===1?o.jsxRuntimeExports.jsx(j.Provider$3,{children:f}):f});es.displayName="Mosaic";const ts="pluto-mosaic-tab-drop",Uo="pluto-mosaic-tab-create",ag=(e,t,n)=>{if(j.filterByType(j.FILE_TYPE,t).length>0&&n)return!0;const r=j.filterByType(ts,t).map(c=>c.key),i=e.filter(c=>!r.includes(c.tabKey)).length>0;return j.filterByType(Uo,t).length>0||r.length>0&&(i||e.length===0)},Xl=g.memo(({root:e,onDrop:t,onCreate:n,activeTab:s,children:r,onFileDrop:i,...l})=>{const{key:c,tabs:a}=e,[d,x]=g.useState(null),p=i!=null,m=g.useCallback(({items:w})=>ag(a,w,p),[a,p]),f=g.useCallback(({items:w,event:L})=>{if(L==null)return[];x(null);const _=j.filterByType(j.FILE_TYPE,w).length>0,N=a.length===0?"center":Vr(Or(L));if(_)return i==null||i(c,N,L),w;const A=j.filterByType(ts,w);if(A.length>0){const F=A.map(({key:$})=>$)[0];t(c,F,N)}const I=j.filterByType(Uo,w);if(I.length>0){const F=I.map(({key:$})=>$);n==null||n(c,N,F)}return A},[t,a.length]),h=g.useCallback(({event:w})=>{if(w==null)return;const L=a.length===0?"center":Vr(Or(w));x(L)},[a.length]),{startDrag:E,...y}=j.useDragAndDrop({type:"Mosaic",canDrop:m,onDrop:f,onDragOver:h}),S=m(j.useDraggingState()),k=g.useCallback(()=>x(null),[]),C=g.useCallback((w,{tabKey:L})=>{E([{key:L,type:ts,elementID:w.currentTarget.id}])},[E]),b=g.useCallback(()=>n==null?void 0:n(c,"center"),[c]);return o.jsxRuntimeExports.jsxs("div",{id:`mosaic-${c}`,className:u.CSS.BE("mosaic","leaf"),children:[o.jsxRuntimeExports.jsxs(ke.Tabs,{id:`tab-${c}`,tabs:a,onDragLeave:k,selected:e.selected,selectedAltColor:s===e.selected,onDragStart:C,onCreate:b,...l,...y,children:[e.selected!=null&&r(a.find(w=>w.tabKey===e.selected)),S&&o.jsxRuntimeExports.jsx("div",{style:{zIndex:1e3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}})]}),d!=null&&o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("mosaic","mask"),style:ug[d]})]})});Xl.displayName="MosaicTabLeaf";const ug={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%"}},Or=e=>{const t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left,s=e.clientY-t.top;return s<24?{px:.5,py:.5}:{px:n/t.width,py:s/t.height}},dg=e=>e,xg=e=>1-e,Vr=({px:e,py:t})=>{if(e>.33&&e<.66&&t>.33&&t<.66)return"center";const[n,s]=[dg(e),xg(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")},pg=({root:e,onSelect:t,children:n})=>{const s=g.useRef(new Map),r=new Set,i=Qn(e,l=>{var c;return(c=l.tabs)==null?void 0:c.map(a=>{let d=s.current.get(a.tabKey);return a==null?null:(d==null&&(d=new Wl({style:"width: 100%; height: 100%; position: relative;"}),d.el.addEventListener("click",()=>t==null?void 0:t(a.tabKey)),s.current.set(a.tabKey,d)),r.add(a.tabKey),o.jsxRuntimeExports.jsx(Kl,{node:d,children:n({...a,visible:a.tabKey===l.selected})},a.tabKey))})}).flat().filter(l=>l!=null);return s.current.forEach((l,c)=>!r.has(c)&&s.current.delete(c)),[s,i]},mg=ce.z.object({key:ce.z.number(),tabs:ce.z.array(ke.tabZ).optional(),selected:ce.z.string().optional(),direction:u.g.direction.optional(),size:ce.z.number().optional()}),uo=mg.extend({first:ce.z.lazy(()=>uo).optional(),last:ce.z.lazy(()=>uo).optional()}),fg=({allowRename:e=!1,initialTree:t})=>{const[n,s]=g.useState(t);return g.useEffect(()=>s(qn(t)[0]),[t]),{root:n,onDrop:(d,x,p)=>s(m=>Zl(m,x,p,d)[0]),onClose:d=>s(x=>qo(x,d)[0]),onSelect:d=>s(x=>Hl(x,d)),onResize:(d,x)=>s(p=>Gl(p,d,x)),onRename:e?(d,x)=>s(p=>Yl(p,d,x)):void 0}},hg=Object.freeze(Object.defineProperty({__proto__:null,HAUL_CREATE_TYPE:Uo,HAUL_DROP_TYPE:ts,Mosaic:es,autoSelectTabs:qn,canSplit:sg,findSelected:Un,findTabNode:un,forEachNode:ao,insertTab:Xn,isEmpty:og,mapNodes:Qn,moveTab:Zl,nodeZ:uo,removeTab:qo,renameTab:Yl,resizeNode:Gl,selectTab:Hl,split:ng,updateTab:tg,use:fg,usePortal:pg},Symbol.toStringTag,{value:"Module"})),gg=({variant:e,className:t,children:n,...s})=>o.jsxRuntimeExports.jsx(te.Space,{className:u.CSS(t,u.CSS.B("note"),u.CSS.M(e)),align:"stretch",empty:!0,...s,children:n}),jg=Object.freeze(Object.defineProperty({__proto__:null,Note:gg},Symbol.toStringTag,{value:"Module"})),Zs={Close:o.jsxRuntimeExports.jsxs("svg",{width:"124",height:"124",viewBox:"0 0 124 124",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"88.3883",width:"87",height:"11",transform:"rotate(-45 26.8701 88.3883)",fill:"#7E0508"}),o.jsxRuntimeExports.jsx("rect",{x:"26.8701",y:"34.6482",width:"11",height:"87",transform:"rotate(-45 26.8701 34.6482)",fill:"#7E0508"})]}),Minimize:o.jsxRuntimeExports.jsx("svg",{width:"87",height:"11",viewBox:"0 0 87 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsxRuntimeExports.jsx("rect",{x:"15",width:"60",height:"11",fill:"#985712"})}),Maximize:o.jsxRuntimeExports.jsxs("svg",{width:"143",height:"143",viewBox:"0 0 143 143",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[o.jsxRuntimeExports.jsx("path",{d:"M108.242 32.8833C108.797 32.8817 109.247 33.3317 109.245 33.8862L109.092 87.5891C109.09 88.4786 108.014 88.9223 107.385 88.2933L53.8351 34.7432C53.2061 34.1142 53.6499 33.0387 54.5394 33.0361L108.242 32.8833Z",fill:"#0B650D"}),o.jsxRuntimeExports.jsx("path",{d:"M33.8862 109.245C33.3317 109.247 32.8818 108.797 32.8833 108.242L33.0361 54.5394C33.0387 53.6499 34.1142 53.2061 34.7432 53.8351L88.2934 107.385C88.9223 108.014 88.4786 109.09 87.5891 109.092L33.8862 109.245Z",fill:"#0B650D"})]})},Eg=({disabled:e=[],className:t,focused:n=!0,onMinimize:s,onMaximize:r,onFullscreen:i,onClose:l,...c})=>o.jsxRuntimeExports.jsxs(te.Space,{size:1.5,direction:"x",className:u.CSS(u.CSS.B("macos-controls"),!n&&u.CSS.BM("macos-controls","blurred"),t),...c,children:[o.jsxRuntimeExports.jsx(Gs,{onClick:l,className:u.CSS.BM("macos-control","close"),disabled:e.includes("close"),children:Zs.Close}),o.jsxRuntimeExports.jsx(Gs,{onClick:s,className:u.CSS.BM("macos-control","minimize"),disabled:e.includes("minimize"),children:Zs.Minimize}),o.jsxRuntimeExports.jsx(Gs,{onClick:i,className:u.CSS.BM("macos-control","maximize"),disabled:e.includes("maximize"),children:Zs.Maximize})]}),Gs=({className:e,disabled:t,color:n,...s})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("macos-control"),u.CSS.disabled(t),e),tabIndex:-1,disabled:t,size:"",...s}),yg=({disabled:e=[],onMinimize:t,onMaximize:n,onClose:s,onFullscreen:r,focused:i,...l})=>o.jsxRuntimeExports.jsxs(te.Pack,{...l,children:[o.jsxRuntimeExports.jsx(Ys,{className:u.CSS.BM("windows-control","minimize"),onClick:t,disabled:e.includes("minimize"),children:o.jsxRuntimeExports.jsx(j.Lt.Subtract,{})}),o.jsxRuntimeExports.jsx(Ys,{className:u.CSS.BM("windows-control","maximize"),onClick:n,disabled:e.includes("maximize"),children:o.jsxRuntimeExports.jsx(j.Lt.Box,{})}),o.jsxRuntimeExports.jsx(Ys,{onClick:s,className:u.CSS.BM("windows-control","close"),disabled:e.includes("close"),children:o.jsxRuntimeExports.jsx(j.Lt.Close,{})})]}),Ys=({disabled:e=!1,className:t,...n})=>e?null:o.jsxRuntimeExports.jsx(j.Icon,{className:u.CSS(u.CSS.B("windows-control"),t),tabIndex:-1,...n}),ql=Z.S.getOS,Sg="Windows",Rg=({forceOS:e,visibleIfOS:t,...n})=>{const s=ql({force:e,default:Sg});if(t!=null&&t!==s)return null;const r=s==="macOS"?Eg:yg;return o.jsxRuntimeExports.jsx(r,{...n})},Cg=Object.freeze(Object.defineProperty({__proto__:null,Controls:Rg,use:ql},Symbol.toStringTag,{value:"Module"})),bg=(e,t)=>{const n=s=>o.jsxRuntimeExports.jsx(e,{...t,...s});return n.displayName=e.displayName,n},wg=Object.freeze(Object.defineProperty({__proto__:null,createComponent:bg},Symbol.toStringTag,{value:"Module"}));g.createContext({instrumentation:Z.B.NOOP});const vg=({children:e,...t})=>{const{path:n}=j.useUnidirectional({type:B.Provider$2.TYPE,schema:B.providerStateZ$1,state:t});return o.jsxRuntimeExports.jsx(j.Composite,{path:n,children:e})},kg="data:video/mp2t;base64,Ly8gQ29weXJpZ2h0IDIwMjUgU3lubmF4IExhYnMsIEluYy4KLy8KLy8gVXNlIG9mIHRoaXMgc29mdHdhcmUgaXMgZ292ZXJuZWQgYnkgdGhlIEJ1c2luZXNzIFNvdXJjZSBMaWNlbnNlIGluY2x1ZGVkIGluIHRoZSBmaWxlCi8vIGxpY2Vuc2VzL0JTTC50eHQuCi8vCi8vIEFzIG9mIHRoZSBDaGFuZ2UgRGF0ZSBzcGVjaWZpZWQgaW4gdGhhdCBmaWxlLCBpbiBhY2NvcmRhbmNlIHdpdGggdGhlIEJ1c2luZXNzIFNvdXJjZQovLyBMaWNlbnNlLCB1c2Ugb2YgdGhpcyBzb2Z0d2FyZSB3aWxsIGJlIGdvdmVybmVkIGJ5IHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAsCi8vIGluY2x1ZGVkIGluIHRoZSBmaWxlIGxpY2Vuc2VzL0FQTC50eHQuCgppbXBvcnQgeyBwbHV0byB9IGZyb20gIkAvcGx1dG8vYWV0aGVyIjsKCnBsdXRvLnJlbmRlcigpOwo=",Ul=({children:e})=>{const[{path:t}]=j.use$3({type:B.BaseProvider.TYPE,schema:B.providerStateZ$2,initialState:{}});return o.jsxRuntimeExports.jsx(j.Composite,{path:t,children:e})},_g=Object.freeze(Object.defineProperty({__proto__:null,Provider:Ul},Symbol.toStringTag,{value:"Module"})),Mg=e=>{var t,n;switch(e.variant){case"disabled":return((t=e.data)==null?void 0:t.valid)===!0?{message:"Uncontrolled. Click to take control.",chipColor:"var(--pluto-gray-l10)"}:{message:"No channel connected. This element cannot be controlled.",chipColor:"var(--pluto-gray-l5)",disabled:!0};case"error":return{message:"Not controlled by you. Click to take absolute control.",chipColor:"var(--pluto-error-z)"};case"success":return((n=e.data)==null?void 0:n.authority)===Z.rp.Authority.Absolute.valueOf()?{message:"You have absolute control. Click to release.",chipColor:"var(--pluto-secondary-z)",buttonStyle:{background:"var(--pluto-secondary-z-30)"}}:{message:"You're in control. Release P&ID to release control.",chipColor:"var(--pluto-primary-z)"};default:return{message:"Unexpected status.",chipColor:"var(--pluto-error-z)"}}},Jl=({source:e,sink:t,className:n,...s})=>{const r=j.useMemoDeepEqualProps({source:e,sink:t}),[,{status:i},l]=j.use$3({type:B.Chip.TYPE,schema:B.chipStateZ,initialState:{triggered:!1,...r,status:{key:"no_chip",variant:"disabled",message:"No chip connected.",time:Z.m.now()}}});g.useEffect(()=>{l(m=>({...m,...r}))},[r,l]);const c=g.useCallback(()=>l(m=>({...m,triggered:!m.triggered})),[l]),{message:a,chipColor:d,buttonStyle:x,disabled:p}=Mg(i);return o.jsxRuntimeExports.jsx(j.Icon,{variant:"text",className:u.CSS(u.CSS.B("control-chip"),n),disabled:p,onClick:c,tooltip:o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:a}),style:x,...s,children:o.jsxRuntimeExports.jsx(j.Lt.Circle,{color:d})})},Ql=g.createContext({needsControlOf:[]}),ec=()=>g.useContext(Ql),Lg=({children:e,onStatusChange:t,...n})=>{const s=j.useMemoDeepEqualProps(n),[{path:r},{status:i,needsControlOf:l},c]=j.use$3({type:B.Controller$1.TYPE,schema:B.controllerStateZ,initialState:s});return g.useEffect(()=>{i!=null&&(t==null||t(i))},[i,t]),g.useEffect(()=>{c(a=>({...a,...s}))},[s,c]),g.useEffect(()=>()=>t==null?void 0:t("released"),[]),o.jsxRuntimeExports.jsxs(Ql.Provider,{value:{needsControlOf:l},children:[o.jsxRuntimeExports.jsx(j.Composite,{path:r,children:e}),";"]})},tc=({colorSource:e,statusSource:t})=>{var c;const n=j.useMemoDeepEqualProps({colorSource:e,statusSource:t}),[,{color:s,status:r},i]=j.use$3({type:B.Indicator.TYPE,initialState:{...n,status:{key:"no_chip",variant:"warning",message:"No chip connected.",time:Z.m.now()}},schema:B.indicatorStateZ});g.useEffect(()=>{i(a=>({...a,...n}))},[n,i]);let l;return((c=r.data)==null?void 0:c.color)!=null?l=u.Color.z.parse(r.data.color):s!=null&&!s.isZero?l=s:l="var(--pluto-gray-l8)",o.jsxRuntimeExports.jsxs(j.Dialog$1,{location:{x:"center",y:"bottom"},children:[o.jsxRuntimeExports.jsx(j.Text$1,{level:"p",children:r.message}),o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("indicator"),style:{backgroundColor:u.cssString(l),flexGrow:1}})]})},Pg=({...e})=>{const{needsControlOf:t}=ec(),[,{states:n},s]=j.use$3({type:B.Legend.TYPE,schema:B.legendStateZ,initialState:{states:[],needsControlOf:t}});g.useEffect(()=>{s(l=>({...l,needsControlOf:t}))},[t]);const i=Z.c.unique(n.map(l=>l.subject.key)).map(l=>{const c=n.find(a=>a.subject.key===l);if(c==null)throw new Z.xe("Legend subject not found");return{key:c.subject.key,label:c.subject.name,color:c.subjectColor}});return o.jsxRuntimeExports.jsx(Do,{data:i,...e})},nc=({children:e})=>{const[{path:t}]=j.use$3({type:B.StateProvider.TYPE,schema:B.stateProviderStateZ,initialState:{}});return o.jsxRuntimeExports.jsx(j.Composite,{path:t,children:e})},Tg=Object.freeze(Object.defineProperty({__proto__:null,Chip:Jl,Controller:Lg,Indicator:tc,Legend:Pg,StateProvider:nc,useContext:ec},Symbol.toStringTag,{value:"Module"})),sc=e=>{const t=({disabled:n=!1,...s})=>n?s.children:o.jsxRuntimeExports.jsx(e,{...s});return t.displayName=e.displayName,t},Ng=sc(Ul),Ag=sc(j.Provider$4),Ig=({children:e,connParams:t,workerEnabled:n=!0,workerURL:s,theming:r,tooltip:i,triggers:l,alamos:c,haul:a,channelAlias:d,telem:x,color:p})=>o.jsxRuntimeExports.jsx(j.Provider$2,{...l,children:o.jsxRuntimeExports.jsx(j.Config,{...i,children:o.jsxRuntimeExports.jsx(j.Provider$3,{...a,children:o.jsxRuntimeExports.jsx(j.Provider$5,{url:s??kg,enabled:n,children:o.jsxRuntimeExports.jsx(Ag,{workerKey:"vis",children:o.jsxRuntimeExports.jsx(vg,{...c,children:o.jsxRuntimeExports.jsx(j.Aggregator,{children:o.jsxRuntimeExports.jsx(el,{connParams:t,children:o.jsxRuntimeExports.jsx(sl,{...d,children:o.jsxRuntimeExports.jsx(j.Provider$1,{...p,children:o.jsxRuntimeExports.jsx(j.Provider,{...r,children:o.jsxRuntimeExports.jsx(Ng,{...x,children:o.jsxRuntimeExports.jsx(nc,{children:e})})})})})})})})})})})})}),$g=Object.freeze(Object.defineProperty({__proto__:null,Provider:Ig},Symbol.toStringTag,{value:"Module"})),zg=({value:e})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress"),children:o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("progress-bar"),style:{width:`${e}%`}})}),Bg=Object.freeze(Object.defineProperty({__proto__:null,Progress:zg},Symbol.toStringTag,{value:"Module"})),dn="range",Jo=[{key:"name",name:"Name"}],ns=({items:e},t)=>{const n=j.filterByType(dn,e);return n.length>0&&!n.every(s=>t.includes(s.key))},Dg=({onChange:e,className:t,value:n,...s})=>{const r=Fe(),i=r!=null?void 0:o.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),{startDrag:l,onDragEnd:c,...a}=j.useDragAndDrop({type:"Ranger.SelectMultiple",canDrop:g.useCallback(m=>ns(m,Z.A(n)),[n]),onDrop:g.useCallback(({items:m})=>{const f=j.filterByType(dn,m);if(f.length===0)return[];const h=Z.c.unique([...Z.A(n),...f.map(E=>E.key)]);return e(h,{clickedIndex:null,clicked:null,entries:[]}),f},[e,n])}),d=j.useDraggingState(),x=g.useCallback(({dropped:m})=>{e(Z.A(n).filter(f=>!m.some(h=>h.key===f)),{clickedIndex:null,clicked:null,entries:[]})},[e,n]),p=g.useCallback((m,f)=>l([{key:f,type:dn}],x),[l,x]);return o.jsxRuntimeExports.jsx(Wt,{className:u.CSS(t,u.CSS.dropRegion(ns(d,Z.A(n)))),value:n,onTagDragStart:p,onTagDragEnd:c,searcher:r==null?void 0:r.ranges,onChange:e,columns:Jo,emptyContent:i,entryRenderKey:"name",...a,...s})},oc=({value:e,onChange:t})=>{const n=Fe(),s=n!=null?void 0:o.jsxRuntimeExports.jsx(j.Text$3.Centered,{variant:"error",level:"h4",style:{height:150},children:"No client available"}),r=g.useId(),i=g.useMemo(()=>({key:r,type:"Ranger.SelectMultiple"}),[r]),{startDrag:l,...c}=j.useDragAndDrop({type:"Ranger.SelectSingle",canDrop:g.useCallback(x=>ns(x,Z.o$1(e)),[e]),onDrop:g.useCallback(({items:x})=>{const p=j.filterByType(dn,x);return p.length===0?[]:(t(p[0].key,{clickedIndex:null,clicked:null,entries:[]}),p)},[i,t])}),a=j.useDraggingState(),d=g.useCallback(()=>e!=null&&l([{type:dn,key:e}]),[l,e]);return{emptyContent:s,dragging:a,...c,onDragStart:d,searcher:n==null?void 0:n.ranges}},Og=({onChange:e,value:t,className:n,data:s,...r})=>{const{dragging:i,...l}=oc({value:t,onChange:e});return o.jsxRuntimeExports.jsx(xt,{data:s,className:u.CSS(n,u.CSS.dropRegion(ns(i,Z.o$1(t)))),value:t,onChange:e,columns:Jo,entryRenderKey:"name",...l,...r})},Vg=({data:e,value:t,onChange:n,...s})=>{const{dragging:r,...i}=oc({value:t,onChange:n});return o.jsxRuntimeExports.jsx(xt,{data:e,value:t,onChange:n,columns:Jo,entryRenderKey:"name",...i,...s})},Fg=[{key:"color",name:"Color",width:50,render:e=>o.jsxRuntimeExports.jsx(j.Lt.Circle,{style:{fontSize:10,marginLeft:10,marginRight:30},color:e.entry.color})},{key:"name",name:"Name"}],Hg=e=>{const t=Fe();return o.jsxRuntimeExports.jsx(Wt,{...e,searcher:t==null?void 0:t.labels,columns:Fg,renderTag:n=>n.entry==null?o.jsxRuntimeExports.jsx(an,{color:"gray",children:n.entryKey}):o.jsxRuntimeExports.jsx(an,{color:n.entry.color,children:n.entry.name})})},Zg=({timeRange:e,level:t="p",shade:n=7,showSpan:s=!1,...r})=>{const i=new Z.m(e.start),l=i.isToday?"time":"dateTime",c=new Z.m(e.end),a=c.equals(Z.m.MAX),d=c.span(i)<Z.w.DAY?"time":"dateTime",x=i.span(c);return o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",size:"small",className:u.CSS(u.CSS.B("time-range-chip")),align:"center",...r,children:[i.isToday&&o.jsxRuntimeExports.jsx(j.Text$1,{level:t,shade:n,weight:450,children:"Today"}),o.jsxRuntimeExports.jsx(j.DateTime,{level:t,displayTZ:"local",format:l,shade:n,weight:450,children:i}),o.jsxRuntimeExports.jsx(j.Lt.Arrow.Right,{color:"var(--pluto-text-color)"}),a?o.jsxRuntimeExports.jsx(j.Text$1,{level:t,children:"Now"}):o.jsxRuntimeExports.jsx(j.DateTime,{level:t,displayTZ:"local",format:d,shade:n,weight:450,children:c}),!x.isZero&&s&&o.jsxRuntimeExports.jsxs(j.Text$1,{level:t,shade:n,weight:450,children:["(",i.span(c).truncate(Z.w.MILLISECOND).toString(),")"]})]})},Gg=Object.freeze(Object.defineProperty({__proto__:null,SelectButton:Vg,SelectLabels:Hg,SelectMultiple:Dg,SelectSingle:Og,TimeRangeChip:Zg},Symbol.toStringTag,{value:"Module"})),Yg=({steps:e,value:t,onChange:n,...s})=>{const r=e.findIndex(i=>i.key===t);return o.jsxRuntimeExports.jsx(te.Space,{direction:"x",align:"center",className:u.CSS.B("steps"),...s,children:e.map((i,l)=>o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsxs(j.Button,{onClick:()=>n(i.key),variant:"outlined",disabled:l>r,children:[l+1,". ",i.title]},i.key),l!==e.length-1&&o.jsxRuntimeExports.jsx(j.Lt.Arrow.Right,{style:{fontSize:"15px",color:"var(--pluto-gray-l8)"}})]},i.key))})},Wg=Object.freeze(Object.defineProperty({__proto__:null,Steps:Yg},Symbol.toStringTag,{value:"Module"})),Kg=({children:e,className:t,visible:n,...s})=>{const[{path:r},,i]=j.use$3({type:B.Table.TYPE,schema:B.Table.stateZ,initialState:{region:u.Tt.ZERO,visible:n}});g.useEffect(()=>{i(c=>({...c,visible:n}))},[n]);const l=En(c=>i(a=>({...a,region:c})));return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("div",{ref:l,style:{right:0,bottom:0,position:"absolute",top:6,left:6}}),o.jsxRuntimeExports.jsx("table",{className:u.CSS(u.CSS.B("table"),t),...s,children:o.jsxRuntimeExports.jsx("tbody",{children:o.jsxRuntimeExports.jsx(j.Composite,{path:r,children:e})})})]})},Xg=({children:e,className:t,size:n,index:s,onResize:r,onSelect:i,position:l,...c})=>o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),t),...c,children:[r!=null&&o.jsxRuntimeExports.jsx(ic,{onSelect:i,index:s,value:n,onChange:r,position:l,direction:"y"}),e]}),Qo=({ref:e,children:t,className:n,selected:s=!1,...r})=>o.jsxRuntimeExports.jsx("td",{ref:e,...r,className:u.CSS(u.CSS.BE("table","cell"),u.CSS.selected(s),n),children:t}),rc="ABCDEFGHIJKLMNOPQRSTUVWXYZ",qg=e=>rc[e],ic=({value:e,selected:t=!1,index:n,onChange:s,position:r,direction:i="x",onSelect:l})=>{const c=j.useSyncedRef(e),a=g.useRef(e),d=j.useCursorDrag({onStart:g.useCallback(()=>{a.current=c.current},[]),onMove:g.useCallback(x=>s(a.current+u.Tt.dim(x,i,!0),n),[s,n])});return o.jsxRuntimeExports.jsxs("td",{id:`resizer-${i}-${n}`,className:u.CSS(u.CSS.BE("table","resizer"),u.CSS.dir(i),u.CSS.selected(t),j.CONTEXT_TARGET,t&&j.CONTEXT_SELECTED),style:{[u.g.dimension(i)]:e},onClick:()=>l(n),onContextMenu:()=>l(n),children:[o.jsxRuntimeExports.jsx(j.Text$1,{level:"p",shade:7,style:{width:"100%",textAlign:"center"},children:i==="x"?rc[n]:n+1}),o.jsxRuntimeExports.jsx("button",{onClick:x=>x.stopPropagation(),style:{[u.g.location(i)]:r+e},onDragStart:d,draggable:!0})]})},Ug=({selected:e,onSelect:t,columns:n,onResize:s})=>{let r=15;return o.jsxRuntimeExports.jsxs("tr",{className:u.CSS(u.CSS.BE("table","row"),u.CSS.BE("table","col-resizer")),children:[o.jsxRuntimeExports.jsx("td",{}),n.map((i,l)=>{const c=r;return r+=i,o.jsxRuntimeExports.jsx(ic,{onSelect:t,position:c,selected:e.includes(l),index:l,value:i,onChange:a=>s(a,l),direction:"x"},l)})]})},Jg=Object.freeze(Object.defineProperty({__proto__:null,Cell:Qo,ColumnIndicators:Ug,Row:Xg,Table:Kg,getCellColumn:qg},Symbol.toStringTag,{value:"Module"})),Qg=[{key:"standard",name:"Standard"},{key:"scientific",name:"Scientific"},{key:"engineering",name:"Engineering"}],e1=({...e})=>o.jsxRuntimeExports.jsx(ve.Button,{...e,entryRenderKey:"name",data:Qg}),lc=[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],er=({path:e})=>{var f;const{value:t,onChange:n}=pt({path:e}),s=B.sourcePipelinePropsZ.parse((f=t.telem)==null?void 0:f.props),r=B.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=B.stringifyNumberProps.parse(s.segments.stringifier.props),l=B.rollingAverageProps.parse(s.segments.rollingAverage.props),c=h=>{const E=B.sourcePipeline("string",{connections:lc,segments:{valueStream:B.streamChannelValue({channel:r.channel}),stringifier:B.stringifyNumber({precision:i.precision??2,notation:i.notation}),rollingAverage:B.rollingAverage({windowSize:l.windowSize??1}),...h},outlet:"stringifier"});n({...t,telem:E})},a=h=>c({valueStream:B.streamChannelValue({channel:h??0})}),d=h=>c({stringifier:B.stringifyNumber({...i,notation:h})}),x=h=>c({stringifier:B.stringifyNumber({...i,precision:h})}),p=h=>c({rollingAverage:B.rollingAverage({windowSize:h})}),m=ps(r.channel);return g.useEffect(()=>n({...t,tooltip:[m]}),[m]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:r.channel,onChange:a})}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Notation",children:o.jsxRuntimeExports.jsx(e1,{value:i.notation,onChange:d})}),o.jsxRuntimeExports.jsx(Te.Item,{label:"Precision",align:"start",children:o.jsxRuntimeExports.jsx(j.Numeric,{value:i.precision??2,bounds:{lower:0,upper:10},onChange:x})}),o.jsxRuntimeExports.jsx(Te.Item,{label:"Averaging Window",align:"start",children:o.jsxRuntimeExports.jsx(j.Numeric,{value:l.windowSize??1,bounds:{lower:1,upper:100},onChange:p})})]})]})},t1=B.Value.z.partial({color:!0}).extend({level:Z.levelZ.optional()}),tr=({aetherKey:e,box:t,telem:n,color:s,precision:r,minWidth:i,level:l="small",backgroundTelem:c,notation:a,location:d})=>{const x=j.useMemoDeepEqualProps({box:t,telem:n,color:s,precision:r,level:l,minWidth:i,notation:a,backgroundTelem:c,location:d}),[,p,m]=j.use$3({aetherKey:e,type:B.Value.TYPE,schema:B.Value.z,initialState:x});return g.useEffect(()=>m(f=>({...f,...x})),[x]),{width:p.width??p.minWidth}},n1=Object.freeze(Object.defineProperty({__proto__:null,TelemForm:er,VALUE_CONNECTIONS:lc,corePropsZ:t1,use:tr},Symbol.toStringTag,{value:"Module"})),s1=ce.z.object({value:ce.z.string(),level:Z.levelZ,weight:Z.weightZ,align:u.K.x.or(u.K.center),backgroundColor:u.crudeZ}),o1=({cellKey:e,onChange:t,value:n,selected:s,onSelect:r,align:i,level:l,weight:c,backgroundColor:a})=>{const d=p=>r(e,p),x=p=>t({level:l,value:p,weight:c,align:i,backgroundColor:a});return o.jsxRuntimeExports.jsx(Qo,{id:e,className:u.CSS(j.CONTEXT_TARGET,s&&j.CONTEXT_SELECTED,u.CSS.BEM("table","cell","text")),selected:s,onClick:d,onContextMenu:d,style:{backgroundColor:u.cssString(a)},children:o.jsxRuntimeExports.jsx(j.Editable,{level:l,value:n,weight:c,onChange:x,style:{justifyContent:i},allowEmpty:!0,outline:!1})})},r1=ce.z.object({telem:B.stringSourceSpecZ,redline:ce.z.object({bounds:u.H.bounds,gradient:u.gradientZ}),level:Z.levelZ,color:ce.z.string(),units:ce.z.string()}),i1=({cellKey:e,telem:t,level:n,color:s,redline:{gradient:r,bounds:i},selected:l,box:c,onSelect:a})=>{const{width:d}=tr({aetherKey:e,box:c,telem:t,level:n,color:s,backgroundTelem:B.sourcePipeline("color",{connections:[{from:"source",to:"scale"},{from:"scale",to:"gradient"}],segments:{source:t,scale:B.scaleNumber({scale:u.b.Scale.scale(i).scale(0,1).transform}),gradient:B.colorGradient({gradient:r})},outlet:"gradient"}),location:{x:"center",y:"center"}}),x=p=>a(e,p);return o.jsxRuntimeExports.jsx(Qo,{id:e,selected:l,onClick:x,onContextMenu:x,style:{height:"5rem",width:d},className:u.CSS(j.CONTEXT_TARGET,l&&j.CONTEXT_SELECTED,u.CSS.BEM("table","cell","value"))})},l1=({onVariantChange:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"telem":return o.jsxRuntimeExports.jsx(te.Space,{direction:"y",style:{padding:"2rem"},children:o.jsxRuntimeExports.jsx(er,{path:""})});case"redline":return o.jsxRuntimeExports.jsx(te.Space,{direction:"y",style:{padding:"2rem"},children:o.jsxRuntimeExports.jsx(c1,{})});default:return o.jsxRuntimeExports.jsx(te.Space,{direction:"y",grow:!0,empty:!0,style:{padding:"2rem"},children:o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(cc,{onChange:e,value:"value"})}),o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,path:"color",children:({value:r,onChange:i,variant:l,...c})=>o.jsxRuntimeExports.jsx(j.Swatch,{value:r??u.ZERO.setAlpha(1).rgba255,onChange:a=>i(a.rgba255),...c,bordered:!0})}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:r=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...r})})]})})}},[]),n=ke.useStatic({tabs:[{tabKey:"style",name:"Style"},{tabKey:"telem",name:"Telemetry"},{tabKey:"redline",name:"Redline"}],content:t});return o.jsxRuntimeExports.jsx(ke.Tabs,{...n})},c1=()=>{const{set:e,get:t}=tt(),n=Il("redline.bounds"),s=u.b.Scale.scale(0,1).scale(n);return o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(zt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Lower",path:"redline.bounds.lower"}),o.jsxRuntimeExports.jsx(ye,{path:"redline.gradient",label:"Gradient",align:"start",padHelpText:!1,children:({value:r,onChange:i})=>o.jsxRuntimeExports.jsx(j.GradientPicker,{value:Z._.copy(r),scale:s,onChange:l=>{const a={...t("redline.bounds").value},d=l.map(E=>E.position),x=s.pos(Math.max(...d)),p=s.pos(Math.min(...d)),m=x>a.upper,f=p<a.lower;m&&(l[l.length-1].position=1,a.upper=x),f&&(l[0].position=0,a.lower=p);const h=l.map(E=>({...E,color:new u.Color(E.color).hex}));m||f?e("redline",{bounds:a,gradient:h}):i(l.map(E=>({...E,color:new u.Color(E.color).hex})))}})}),o.jsxRuntimeExports.jsx(zt,{inputProps:{size:"small",showDragHandle:!1},style:{width:60},label:"Upper",path:"redline.bounds.upper"})]})},a1=({onVariantChange:e})=>o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,style:{padding:"2rem"},children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Variant",padHelpText:!1,children:o.jsxRuntimeExports.jsx(cc,{onChange:e,value:"text"})}),o.jsxRuntimeExports.jsx(Wo,{path:"value",label:"Text"}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"weight",label:"Weight",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ve.SelectWeight,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"align",label:"Alignment",hideIfNull:!0,children:t=>o.jsxRuntimeExports.jsx(ms,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"backgroundColor",label:"Background",align:"start",padHelpText:!1,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(j.Swatch,{value:t,onChange:n})})]}),u1=[{key:"text",name:"Text"},{key:"value",name:"Value"}],cc=({onChange:e,value:t})=>o.jsxRuntimeExports.jsx(ve.Button,{value:t,onChange:e,data:u1,allowMultiple:!1,entryRenderKey:"name"}),d1=["text","value"],x1=ce.z.enum(d1),p1={key:"value",name:"Value",Form:l1,Cell:i1,defaultProps:e=>({telem:B.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:B.streamChannelValue({channel:0}),rollingAverage:B.rollingAverage({windowSize:1}),stringifier:B.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"}),redline:{bounds:{lower:0,upper:1},gradient:[]},color:e.colors.gray.l8.hex,level:"h5",units:""}),schema:r1},m1={key:"text",name:"Text",Form:a1,Cell:o1,defaultProps:()=>({value:"",level:"h5",units:"",weight:400,align:"center",backgroundColor:"#00000000"}),schema:s1},f1={text:m1,value:p1},h1=Object.freeze(Object.defineProperty({__proto__:null,CELLS:f1,variantZ:x1},Symbol.toStringTag,{value:"Module"})),Fr=({sourcePos:e,targetPos:t,next:n,prev:s})=>{const r=jt(e,...n);return u.G.distance(r,t)<1?!0:(console.warn("Connector is out of sync with target"),console.log("Theoretical target",r),console.log("Actual target",t),console.log("Segments",n),console.log("Prev segments",s),!1)},Hr=({sourceStumpTip:e,sourceOrientation:t,sourceBox:n,targetStumpTip:s,targetOrientation:r,targetBox:i})=>{if(!g1({sourcePos:e,sourceOrientation:t,targetPos:s}))return;const l=u.g.construct(t),c=u.g.swap(l);let a=St(c,s[c]-e[c]);const d=u.Tt.loc(n,a);if(u.K.swap(t)===r){const x=u.Tt.loc(i,u.K.swap(a));Math.abs(d-x)<Ae&&(a=u.K.swap(a))}return{direction:c,length:d-e[c]+wt(a,Ae)}},xo=ce.z.object({direction:u.g.direction,length:ce.z.number()}),jt=(e,...t)=>{let n=e;for(const s of t)n=u.G.translate(n,s.direction,s.length);return n},ac=(e,t,n,s)=>{try{let r=e;const i=[e,...t.map(f=>(r=u.G.translate(r,f.direction,f.length),r))];if(!s)return i;const l=t[0],c=St(l.direction,l.length),a=Zr(c),d=4*(2-n**.5);i[0]=u.G.translate(i[0],{[l.direction]:-1*a*d,[u.g.swap(l.direction)]:0});const x=t[t.length-1],p=St(x.direction,x.length),m=Zr(p);return i[i.length-1]=u.G.translate(i[i.length-1],{[x.direction]:m*d,[u.g.swap(x.direction)]:0}),i}catch{return[]}},Ae=10,Zr=e=>e==="top"||e==="left"?-1:1,wt=(e,t)=>e==="top"||e==="left"?-t:t,St=(e,t)=>e==="x"?t>0?"right":"left":t>0?"bottom":"top",ct=e=>St(e.direction,e.length),g1=({sourcePos:e,targetPos:t,sourceOrientation:n})=>{const s=u.g.construct(n),r=t[s]-e[s];return wt(n,r)<0},_n=e=>({direction:u.g.construct(e),length:wt(e,Ae)}),Gr={top:_n("top"),bottom:_n("bottom"),left:_n("left"),right:_n("right")},j1=4,E1=.25,js=e=>po(y1(po(e))),y1=e=>{const t=[...e],n=e.findIndex((s,r)=>{const i=Math.abs(s.length);if(i<j1){if(r===0||r===e.length-1)return!1;if(i<E1)return!0;if(e.length<=3)return!1;if(r+2<e.length){const l=t[r+2];if(l.direction!==s.direction)return!1;t[r+2]={...l,length:l.length+s.length}}else{const l=t[r-2];if(l.direction!==s.direction)return!1;t[r-2]={...l,length:l.length+s.length}}return!0}return!1});return n!==-1&&t.splice(n,1),t},po=e=>{const t=[...e];return e.findIndex((s,r)=>{const i=t[r-1];if(r===0||s.direction!==i.direction)return!1;if(r===1){const l=r-1,c=r,a=ct(i),d=ct(s);if(a===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(i.length)===Ae)return!1;const x=wt(a,Ae),p=t[l].length-x,m=t[c].length+p;return Math.abs(m)<Ae?!1:(t[l]={...t[l],length:x},t[c]={...t[c],length:m},!0)}if(r===e.length-1){const l=r,c=r-1,a=ct(s),d=ct(i);if(a===d)return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0;if(Math.abs(s.length)===Ae)return!1;const x=wt(a,Ae),p=t[l].length-x,m=t[c].length+p;return Math.abs(m)<Ae?!1:(t[l]={...t[l],length:x},t[c]={...t[c],length:m},!0)}return t[r-1]={direction:t[r-1].direction,length:t[r-1].length+t[r].length},t.splice(r,1),!0})!==-1?po(t):t},Nt=e=>js(S1(e)),S1=({sourceBox:e,targetBox:t,sourcePos:n,targetPos:s,targetOrientation:r,sourceOrientation:i})=>{let l=i,c=r,a={...Gr[i]},d=jt(n,a);const x={...Gr[r]};let p=jt(s,x);const m=Math.abs(d.x-p.x),f=Math.abs(d.y-p.y);m<2*Ae&&f<10&&(a.length-=m/2,x.length+=m/2,d=jt(n,a),p=jt(s,x));const h=[a],E=Hr({sourceStumpTip:d,sourceOrientation:i,sourceBox:e,targetStumpTip:p,targetOrientation:r,targetBox:t});E!=null&&(h.push(E),d=jt(d,E),l=ct(E),a=E);const y=Hr({sourceStumpTip:p,sourceOrientation:c,sourceBox:t,targetStumpTip:d,targetOrientation:l,targetBox:e});y!=null&&(p=jt(p,y),c=St(y.direction,y.length));const S=()=>{y!=null&&(y.length*=-1,h.push(y)),x.length*=-1,h.push(x)};if(u.K.swap(l)===r){const _=u.g.construct(l),N=(p[_]-d[_])/2;h.push({direction:_,length:N});const A=u.g.swap(_);return h.push({direction:A,length:p[A]-d[A]}),h.push({direction:_,length:N}),S(),h}const k=p[a.direction]-d[a.direction];let C=u.g.swap(a.direction);const b=d[C]-p[C];let w;St(a.direction,k)===l&&St(C,b)===c?w={direction:a.direction,length:k}:(w={direction:C,length:p[C]-d[C]},C=u.g.swap(C)),h.push(w);const L={direction:C,length:p[C]-d[C]};return h.push(L),S(),h},R1=e=>js(C1(e)),C1=({segments:e,index:t,magnitude:n})=>{const s=[...e],r=s[t],i=u.g.swap(r.direction),l=ct(r);if(t===0){s.unshift({direction:i,length:n});const c=wt(l,Ae);s.unshift({direction:r.direction,length:c}),t+=2,s[t]={...s[t],length:s[t].length-c}}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 c=wt(l,Ae);s.push({direction:r.direction,length:c}),s[t]={...s[t],length:s[t].length-c}}else s[t+1]={direction:s[t+1].direction,length:s[t+1].length-n};return s},b1=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1},w1=(e,t,n=!1,...s)=>{const r=(i,l)=>!s.includes(l)&&t(i,l);return n?b1(e,r):e.findIndex(r)},v1=({delta:e,segments:t})=>js(uc(e,t,!1)),k1=({delta:e,segments:t})=>js(uc(e,t,!0)),uc=(e,t,n)=>{let s=[...t];return e.x!==0&&(s=Wr("x",e,s,n)),e.y!==0&&(s=Wr("y",e,s,n)),s},Yr=(e,t,n)=>{if(t.direction!==e)return!1;const s={...t,length:t.length-n[e]},r=ct(t),i=ct(s),l=Math.abs(s.length),c=Math.abs(t.length);return(l>c||l>Ae)&&r===i},Wr=(e,t,n,s)=>{const r=u.g.swap(e),i=s?n.length-1:0,l=n[i];if(Yr(e,l,t)){const p=n[n.length-1];return p.direction===e&&Math.abs(l.length)<Ae?(n[n.length-1]={...p,length:p.length-t[e]},n):(n[i]={...l,length:l.length-t[e]},n)}const c=s?0:n.length-1,d=w1(n,p=>p.direction===e,s,i);if(d===c){const p=n[c];return Yr(e,p,t)?(n[c]={...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[c]={...p,length:p.length-t[e]},n)}if(d===-1)return n.length===1?n[0].direction===e?[{direction:e,length:n[0].length-t[e]}]:[{direction:r,length:n[0].length/2},{direction:e,length:-t[e]},{direction:r,length:n[0].length/2}]:l.direction===e?(n[i]={...l,length:l.length-t[e]},n):[{direction:r,length:n[0].length},{direction:e,length:-t[e]},...n.slice(1)];const x=n[d];return n[d]={...x,length:x.length-t[e]},n},_1=ce.z.object({position:u.G.xy,zoom:ce.z.number()}),dc=ce.z.object({color:u.crudeZ,variant:ce.z.string().optional(),segments:ce.z.array(xo)}),M1=dc.extend({key:ce.z.string(),source:ce.z.string(),target:ce.z.string(),segments:ce.z.array(xo),color:u.crudeZ,id:ce.z.string(),data:ce.z.object({segments:ce.z.array(xo),color:u.crudeZ,variant:ce.z.string().optional()}).optional(),selected:ce.z.boolean(),sourceHandle:ce.z.string().nullable().optional(),targetHandle:ce.z.string().nullable().optional()}),L1=ce.z.object({key:ce.z.string(),position:u.G.xy,selected:ce.z.boolean().optional(),zIndex:ce.z.number().optional(),type:ce.z.string().optional(),data:ce.z.record(ce.z.unknown()).optional(),measured:ce.z.object({width:ce.z.number().optional(),height:ce.z.number().optional()}).optional()}),nr=e=>e.map(t=>({id:t.key,type:"custom",zIndex:t.zIndex,measured:{...t.measured},position:{...t.position},selected:t.selected,data:{}})),sr=e=>e.map(({segments:t,color:n,variant:s,...r})=>({...r,id:r.key,data:{segments:t,color:n,variant:s}})),xc=e=>e.map(t=>({key:t.id,...t})),pc=(e,t)=>e.map(n=>{var s,r,i;return n.data??(n.data={segments:[],color:t,variant:"pipe"}),{key:n.id,segments:((s=n.data)==null?void 0:s.segments)??[],selected:n.selected??!1,color:((r=n.data)==null?void 0:r.color)??t,variant:((i=n.data)==null?void 0:i.variant)??"pipe",...n}}),mc=e=>({...e.position,zoom:e.zoom}),fc=e=>({position:u.G.construct(e),zoom:e.zoom}),hc=(e,t)=>xc(t(nr(e))),Vn=(e,t,n)=>pc(t(sr(e)),n),P1=(e,t="x")=>{if(e.length===0)return[];const n=u.K.construct(t),s=u.K.swap(n);return e.sort((r,i)=>u.Tt.loc(r.box,n)-u.Tt.loc(i.box,n)),e.forEach((r,i)=>{if(i===0)return;const c=e[i-1].handles.find(f=>f.orientation===s),a=r.handles.find(f=>f.orientation===n);if(c==null||a==null)return;const d=c.absolutePosition,x=a.absolutePosition,p=u.G.set(u.G.translation(x,d),t,0),m=u.G.translate(u.Tt.topLeft(r.box),p);r.box=u.Tt.construct(m,u.Tt.dims(r.box))}),e};function Me(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=Me(e[n]))!==""&&(t+=(t&&" ")+s);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var T1={value:()=>{}};function Es(){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 Fn(n)}function Fn(e){this._=e}function N1(e,t){return e.trim().split(/^|\s+/).map(function(n){var s="",r=n.indexOf(".");if(r>=0&&(s=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Fn.prototype=Es.prototype={constructor:Fn,on:function(e,t){var n=this._,s=N1(e+"",n),r,i=-1,l=s.length;if(arguments.length<2){for(;++i<l;)if((r=(e=s[i]).type)&&(r=A1(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<l;)if(r=(e=s[i]).type)n[r]=Kr(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Kr(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Fn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),s=0,r,i;s<r;++s)n[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],s=0,r=i.length;s<r;++s)i[s].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)}};function A1(e,t){for(var n=0,s=e.length,r;n<s;++n)if((r=e[n]).name===t)return r.value}function Kr(e,t,n){for(var s=0,r=e.length;s<r;++s)if(e[s].name===t){e[s]=T1,e=e.slice(0,s).concat(e.slice(s+1));break}return n!=null&&e.push({name:t,value:n}),e}var mo="http://www.w3.org/1999/xhtml";const Xr={svg:"http://www.w3.org/2000/svg",xhtml:mo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ys(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Xr.hasOwnProperty(t)?{space:Xr[t],local:e}:e}function I1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===mo&&t.documentElement.namespaceURI===mo?t.createElement(e):t.createElementNS(n,e)}}function $1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gc(e){var t=ys(e);return(t.local?$1:I1)(t)}function z1(){}function or(e){return e==null?z1:function(){return this.querySelector(e)}}function B1(e){typeof e!="function"&&(e=or(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=new Array(l),a,d,x=0;x<l;++x)(a=i[x])&&(d=e.call(a,a.__data__,x,i))&&("__data__"in a&&(d.__data__=a.__data__),c[x]=d);return new ze(s,this._parents)}function D1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function O1(){return[]}function jc(e){return e==null?O1:function(){return this.querySelectorAll(e)}}function V1(e){return function(){return D1(e.apply(this,arguments))}}function F1(e){typeof e=="function"?e=V1(e):e=jc(e);for(var t=this._groups,n=t.length,s=[],r=[],i=0;i<n;++i)for(var l=t[i],c=l.length,a,d=0;d<c;++d)(a=l[d])&&(s.push(e.call(a,a.__data__,d,l)),r.push(a));return new ze(s,r)}function Ec(e){return function(){return this.matches(e)}}function yc(e){return function(t){return t.matches(e)}}var H1=Array.prototype.find;function Z1(e){return function(){return H1.call(this.children,e)}}function G1(){return this.firstElementChild}function Y1(e){return this.select(e==null?G1:Z1(typeof e=="function"?e:yc(e)))}var W1=Array.prototype.filter;function K1(){return Array.from(this.children)}function X1(e){return function(){return W1.call(this.children,e)}}function q1(e){return this.selectAll(e==null?K1:X1(typeof e=="function"?e:yc(e)))}function U1(e){typeof e!="function"&&(e=Ec(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=[],a,d=0;d<l;++d)(a=i[d])&&e.call(a,a.__data__,d,i)&&c.push(a);return new ze(s,this._parents)}function Sc(e){return new Array(e.length)}function J1(){return new ze(this._enter||this._groups.map(Sc),this._parents)}function ss(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ss.prototype={constructor:ss,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 Q1(e){return function(){return e}}function ej(e,t,n,s,r,i){for(var l=0,c,a=t.length,d=i.length;l<d;++l)(c=t[l])?(c.__data__=i[l],s[l]=c):n[l]=new ss(e,i[l]);for(;l<a;++l)(c=t[l])&&(r[l]=c)}function tj(e,t,n,s,r,i,l){var c,a,d=new Map,x=t.length,p=i.length,m=new Array(x),f;for(c=0;c<x;++c)(a=t[c])&&(m[c]=f=l.call(a,a.__data__,c,t)+"",d.has(f)?r[c]=a:d.set(f,a));for(c=0;c<p;++c)f=l.call(e,i[c],c,i)+"",(a=d.get(f))?(s[c]=a,a.__data__=i[c],d.delete(f)):n[c]=new ss(e,i[c]);for(c=0;c<x;++c)(a=t[c])&&d.get(m[c])===a&&(r[c]=a)}function nj(e){return e.__data__}function sj(e,t){if(!arguments.length)return Array.from(this,nj);var n=t?tj:ej,s=this._parents,r=this._groups;typeof e!="function"&&(e=Q1(e));for(var i=r.length,l=new Array(i),c=new Array(i),a=new Array(i),d=0;d<i;++d){var x=s[d],p=r[d],m=p.length,f=oj(e.call(x,x&&x.__data__,d,s)),h=f.length,E=c[d]=new Array(h),y=l[d]=new Array(h),S=a[d]=new Array(m);n(x,p,E,y,S,f,t);for(var k=0,C=0,b,w;k<h;++k)if(b=E[k]){for(k>=C&&(C=k+1);!(w=y[C])&&++C<h;);b._next=w||null}}return l=new ze(l,s),l._enter=c,l._exit=a,l}function oj(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rj(){return new ze(this._exit||this._groups.map(Sc),this._parents)}function ij(e,t,n){var s=this.enter(),r=this,i=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),s&&r?s.merge(r).order():r}function lj(e){for(var t=e.selection?e.selection():e,n=this._groups,s=t._groups,r=n.length,i=s.length,l=Math.min(r,i),c=new Array(r),a=0;a<l;++a)for(var d=n[a],x=s[a],p=d.length,m=c[a]=new Array(p),f,h=0;h<p;++h)(f=d[h]||x[h])&&(m[h]=f);for(;a<r;++a)c[a]=n[a];return new ze(c,this._parents)}function cj(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var s=e[t],r=s.length-1,i=s[r],l;--r>=0;)(l=s[r])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function aj(e){e||(e=uj);function t(p,m){return p&&m?e(p.__data__,m.__data__):!p-!m}for(var n=this._groups,s=n.length,r=new Array(s),i=0;i<s;++i){for(var l=n[i],c=l.length,a=r[i]=new Array(c),d,x=0;x<c;++x)(d=l[x])&&(a[x]=d);a.sort(t)}return new ze(r,this._parents).order()}function uj(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dj(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function xj(){return Array.from(this)}function pj(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length;r<i;++r){var l=s[r];if(l)return l}return null}function mj(){let e=0;for(const t of this)++e;return e}function fj(){return!this.node()}function hj(e){for(var t=this._groups,n=0,s=t.length;n<s;++n)for(var r=t[n],i=0,l=r.length,c;i<l;++i)(c=r[i])&&e.call(c,c.__data__,i,r);return this}function gj(e){return function(){this.removeAttribute(e)}}function jj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ej(e,t){return function(){this.setAttribute(e,t)}}function yj(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Sj(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Rj(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 Cj(e,t){var n=ys(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?jj:gj:typeof t=="function"?n.local?Rj:Sj:n.local?yj:Ej)(n,t))}function Rc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function bj(e){return function(){this.style.removeProperty(e)}}function wj(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vj(e,t,n){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,n)}}function kj(e,t,n){return arguments.length>1?this.each((t==null?bj:typeof t=="function"?vj:wj)(e,t,n??"")):Dt(this.node(),e)}function Dt(e,t){return e.style.getPropertyValue(t)||Rc(e).getComputedStyle(e,null).getPropertyValue(t)}function _j(e){return function(){delete this[e]}}function Mj(e,t){return function(){this[e]=t}}function Lj(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Pj(e,t){return arguments.length>1?this.each((t==null?_j:typeof t=="function"?Lj:Mj)(e,t)):this.node()[e]}function Cc(e){return e.trim().split(/^|\s+/)}function rr(e){return e.classList||new bc(e)}function bc(e){this._node=e,this._names=Cc(e.getAttribute("class")||"")}bc.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 wc(e,t){for(var n=rr(e),s=-1,r=t.length;++s<r;)n.add(t[s])}function vc(e,t){for(var n=rr(e),s=-1,r=t.length;++s<r;)n.remove(t[s])}function Tj(e){return function(){wc(this,e)}}function Nj(e){return function(){vc(this,e)}}function Aj(e,t){return function(){(t.apply(this,arguments)?wc:vc)(this,e)}}function Ij(e,t){var n=Cc(e+"");if(arguments.length<2){for(var s=rr(this.node()),r=-1,i=n.length;++r<i;)if(!s.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?Aj:t?Tj:Nj)(n,t))}function $j(){this.textContent=""}function zj(e){return function(){this.textContent=e}}function Bj(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Dj(e){return arguments.length?this.each(e==null?$j:(typeof e=="function"?Bj:zj)(e)):this.node().textContent}function Oj(){this.innerHTML=""}function Vj(e){return function(){this.innerHTML=e}}function Fj(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Hj(e){return arguments.length?this.each(e==null?Oj:(typeof e=="function"?Fj:Vj)(e)):this.node().innerHTML}function Zj(){this.nextSibling&&this.parentNode.appendChild(this)}function Gj(){return this.each(Zj)}function Yj(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Wj(){return this.each(Yj)}function Kj(e){var t=typeof e=="function"?e:gc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Xj(){return null}function qj(e,t){var n=typeof e=="function"?e:gc(e),s=t==null?Xj:typeof t=="function"?t:or(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),s.apply(this,arguments)||null)})}function Uj(){var e=this.parentNode;e&&e.removeChild(this)}function Jj(){return this.each(Uj)}function Qj(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function e0(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function t0(e){return this.select(e?e0:Qj)}function n0(e){return arguments.length?this.property("__data__",e):this.node().__data__}function s0(e){return function(t){e.call(this,t,this.__data__)}}function o0(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 r0(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++s]=i;++s?t.length=s:delete this.__on}}}function i0(e,t,n){return function(){var s=this.__on,r,i=s0(t);if(s){for(var l=0,c=s.length;l<c;++l)if((r=s[l]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},s?s.push(r):this.__on=[r]}}function l0(e,t,n){var s=o0(e+""),r,i=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var a=0,d=c.length,x;a<d;++a)for(r=0,x=c[a];r<i;++r)if((l=s[r]).type===x.type&&l.name===x.name)return x.value}return}for(c=t?i0:r0,r=0;r<i;++r)this.each(c(s[r],t,n));return this}function kc(e,t,n){var s=Rc(e),r=s.CustomEvent;typeof r=="function"?r=new r(t,n):(r=s.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function c0(e,t){return function(){return kc(this,e,t)}}function a0(e,t){return function(){return kc(this,e,t.apply(this,arguments))}}function u0(e,t){return this.each((typeof t=="function"?a0:c0)(e,t))}function*d0(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var s=e[t],r=0,i=s.length,l;r<i;++r)(l=s[r])&&(yield l)}var _c=[null];function ze(e,t){this._groups=e,this._parents=t}function Sn(){return new ze([[document.documentElement]],_c)}function x0(){return this}ze.prototype=Sn.prototype={constructor:ze,select:B1,selectAll:F1,selectChild:Y1,selectChildren:q1,filter:U1,data:sj,enter:J1,exit:rj,join:ij,merge:lj,selection:x0,order:cj,sort:aj,call:dj,nodes:xj,node:pj,size:mj,empty:fj,each:hj,attr:Cj,style:kj,property:Pj,classed:Ij,text:Dj,html:Hj,raise:Gj,lower:Wj,append:Kj,insert:qj,remove:Jj,clone:t0,datum:n0,on:l0,dispatch:u0,[Symbol.iterator]:d0};function $e(e){return typeof e=="string"?new ze([[document.querySelector(e)]],[document.documentElement]):new ze([[e]],_c)}function p0(e){let t;for(;t=e.sourceEvent;)e=t;return e}function De(e,t){if(e=p0(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var s=n.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const m0={passive:!1},xn={capture:!0,passive:!1};function Ws(e){e.stopImmediatePropagation()}function $t(e){e.preventDefault(),e.stopImmediatePropagation()}function Mc(e){var t=e.document.documentElement,n=$e(e).on("dragstart.drag",$t,xn);"onselectstart"in t?n.on("selectstart.drag",$t,xn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Lc(e,t){var n=e.document.documentElement,s=$e(e).on("dragstart.drag",null);t&&(s.on("click.drag",$t,xn),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 Mn=e=>()=>e;function fo(e,{sourceEvent:t,subject:n,target:s,identifier:r,active:i,x:l,y:c,dx:a,dy:d,dispatch:x}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:x}})}fo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function f0(e){return!e.ctrlKey&&!e.button}function h0(){return this.parentNode}function g0(e,t){return t??{x:e.x,y:e.y}}function j0(){return navigator.maxTouchPoints||"ontouchstart"in this}function Pc(){var e=f0,t=h0,n=g0,s=j0,r={},i=Es("start","drag","end"),l=0,c,a,d,x,p=0;function m(b){b.on("mousedown.drag",f).filter(s).on("touchstart.drag",y).on("touchmove.drag",S,m0).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(b,w){if(!(x||!e.call(this,b,w))){var L=C(this,t.call(this,b,w),b,w,"mouse");L&&($e(b.view).on("mousemove.drag",h,xn).on("mouseup.drag",E,xn),Mc(b.view),Ws(b),d=!1,c=b.clientX,a=b.clientY,L("start",b))}}function h(b){if($t(b),!d){var w=b.clientX-c,L=b.clientY-a;d=w*w+L*L>p}r.mouse("drag",b)}function E(b){$e(b.view).on("mousemove.drag mouseup.drag",null),Lc(b.view,d),$t(b),r.mouse("end",b)}function y(b,w){if(e.call(this,b,w)){var L=b.changedTouches,_=t.call(this,b,w),N=L.length,A,I;for(A=0;A<N;++A)(I=C(this,_,b,w,L[A].identifier,L[A]))&&(Ws(b),I("start",b,L[A]))}}function S(b){var w=b.changedTouches,L=w.length,_,N;for(_=0;_<L;++_)(N=r[w[_].identifier])&&($t(b),N("drag",b,w[_]))}function k(b){var w=b.changedTouches,L=w.length,_,N;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),_=0;_<L;++_)(N=r[w[_].identifier])&&(Ws(b),N("end",b,w[_]))}function C(b,w,L,_,N,A){var I=i.copy(),F=De(A||L,w),$,z,R;if((R=n.call(b,new fo("beforestart",{sourceEvent:L,target:m,identifier:N,active:l,x:F[0],y:F[1],dx:0,dy:0,dispatch:I}),_))!=null)return $=R.x-F[0]||0,z=R.y-F[1]||0,function T(M,D,P){var V=F,H;switch(M){case"start":r[N]=T,H=l++;break;case"end":delete r[N],--l;case"drag":F=De(P||D,w),H=l;break}I.call(M,b,new fo(M,{sourceEvent:D,subject:R,target:m,identifier:N,active:H,x:F[0]+$,y:F[1]+z,dx:F[0]-V[0],dy:F[1]-V[1],dispatch:I}),_)}}return m.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Mn(!!b),m):e},m.container=function(b){return arguments.length?(t=typeof b=="function"?b:Mn(b),m):t},m.subject=function(b){return arguments.length?(n=typeof b=="function"?b:Mn(b),m):n},m.touchable=function(b){return arguments.length?(s=typeof b=="function"?b:Mn(!!b),m):s},m.on=function(){var b=i.on.apply(i,arguments);return b===i?m:b},m.clickDistance=function(b){return arguments.length?(p=(b=+b)*b,m):Math.sqrt(p)},m}var Ot=0,nn=0,en=0,Tc=1e3,os,sn,rs=0,vt=0,Ss=0,pn=typeof performance=="object"&&performance.now?performance:Date,Nc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ir(){return vt||(Nc(E0),vt=pn.now()+Ss)}function E0(){vt=0}function is(){this._call=this._time=this._next=null}is.prototype=Ac.prototype={constructor:is,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ir():+n)+(t==null?0:+t),!this._next&&sn!==this&&(sn?sn._next=this:os=this,sn=this),this._call=e,this._time=n,ho()},stop:function(){this._call&&(this._call=null,this._time=1/0,ho())}};function Ac(e,t,n){var s=new is;return s.restart(e,t,n),s}function y0(){ir(),++Ot;for(var e=os,t;e;)(t=vt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ot}function qr(){vt=(rs=pn.now())+Ss,Ot=nn=0;try{y0()}finally{Ot=0,R0(),vt=0}}function S0(){var e=pn.now(),t=e-rs;t>Tc&&(Ss-=t,rs=e)}function R0(){for(var e,t=os,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:os=n);sn=e,ho(s)}function ho(e){if(!Ot){nn&&(nn=clearTimeout(nn));var t=e-vt;t>24?(e<1/0&&(nn=setTimeout(qr,e-pn.now()-Ss)),en&&(en=clearInterval(en))):(en||(rs=pn.now(),en=setInterval(S0,Tc)),Ot=1,Nc(qr))}}function Ur(e,t,n){var s=new is;return t=t==null?0:+t,s.restart(r=>{s.stop(),e(r+t)},t,n),s}var C0=Es("start","end","cancel","interrupt"),b0=[],Ic=0,Jr=1,go=2,Hn=3,Qr=4,jo=5,Zn=6;function Rs(e,t,n,s,r,i){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;w0(e,n,{name:t,index:s,group:r,on:C0,tween:b0,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Ic})}function lr(e,t){var n=He(e,t);if(n.state>Ic)throw new Error("too late; already scheduled");return n}function Xe(e,t){var n=He(e,t);if(n.state>Hn)throw new Error("too late; already running");return n}function He(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function w0(e,t,n){var s=e.__transition,r;s[t]=n,n.timer=Ac(i,0,n.time);function i(d){n.state=Jr,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var x,p,m,f;if(n.state!==Jr)return a();for(x in s)if(f=s[x],f.name===n.name){if(f.state===Hn)return Ur(l);f.state===Qr?(f.state=Zn,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete s[x]):+x<t&&(f.state=Zn,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete s[x])}if(Ur(function(){n.state===Hn&&(n.state=Qr,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=go,n.on.call("start",e,e.__data__,n.index,n.group),n.state===go){for(n.state=Hn,r=new Array(m=n.tween.length),x=0,p=-1;x<m;++x)(f=n.tween[x].value.call(e,e.__data__,n.index,n.group))&&(r[++p]=f);r.length=p+1}}function c(d){for(var x=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(a),n.state=jo,1),p=-1,m=r.length;++p<m;)r[p].call(e,x);n.state===jo&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Zn,n.timer.stop(),delete s[t];for(var d in s)return;delete e.__transition}}function Gn(e,t){var n=e.__transition,s,r,i=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((s=n[l]).name!==t){i=!1;continue}r=s.state>go&&s.state<jo,s.state=Zn,s.timer.stop(),s.on.call(r?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete n[l]}i&&delete e.__transition}}function v0(e){return this.each(function(){Gn(this,e)})}function k0(e,t){var n,s;return function(){var r=Xe(this,e),i=r.tween;if(i!==n){s=n=i;for(var l=0,c=s.length;l<c;++l)if(s[l].name===t){s=s.slice(),s.splice(l,1);break}}r.tween=s}}function _0(e,t,n){var s,r;if(typeof n!="function")throw new Error;return function(){var i=Xe(this,e),l=i.tween;if(l!==s){r=(s=l).slice();for(var c={name:t,value:n},a=0,d=r.length;a<d;++a)if(r[a].name===t){r[a]=c;break}a===d&&r.push(c)}i.tween=r}}function M0(e,t){var n=this._id;if(e+="",arguments.length<2){for(var s=He(this.node(),n).tween,r=0,i=s.length,l;r<i;++r)if((l=s[r]).name===e)return l.value;return null}return this.each((t==null?k0:_0)(n,e,t))}function cr(e,t,n){var s=e._id;return e.each(function(){var r=Xe(this,s);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return He(r,s).value[t]}}function $c(e,t){var n;return(typeof t=="number"?B.interpolateNumber:t instanceof B.color?B.interpolateRgb:(n=B.color(t))?(t=n,B.interpolateRgb):B.interpolateString)(e,t)}function L0(e){return function(){this.removeAttribute(e)}}function P0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function T0(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttribute(e);return l===r?null:l===s?i:i=t(s=l,n)}}function N0(e,t,n){var s,r=n+"",i;return function(){var l=this.getAttributeNS(e.space,e.local);return l===r?null:l===s?i:i=t(s=l,n)}}function A0(e,t,n){var s,r,i;return function(){var l,c=n(this),a;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),a=c+"",l===a?null:l===s&&a===r?i:(r=a,i=t(s=l,c)))}}function I0(e,t,n){var s,r,i;return function(){var l,c=n(this),a;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),a=c+"",l===a?null:l===s&&a===r?i:(r=a,i=t(s=l,c)))}}function $0(e,t){var n=ys(e),s=n==="transform"?yf:$c;return this.attrTween(e,typeof t=="function"?(n.local?I0:A0)(n,s,cr(this,"attr."+e,t)):t==null?(n.local?P0:L0)(n):(n.local?N0:T0)(n,s,t))}function z0(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function B0(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function D0(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&B0(e,i)),n}return r._value=t,r}function O0(e,t){var n,s;function r(){var i=t.apply(this,arguments);return i!==s&&(n=(s=i)&&z0(e,i)),n}return r._value=t,r}function V0(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=ys(e);return this.tween(n,(s.local?D0:O0)(s,t))}function F0(e,t){return function(){lr(this,e).delay=+t.apply(this,arguments)}}function H0(e,t){return t=+t,function(){lr(this,e).delay=t}}function Z0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?F0:H0)(t,e)):He(this.node(),t).delay}function G0(e,t){return function(){Xe(this,e).duration=+t.apply(this,arguments)}}function Y0(e,t){return t=+t,function(){Xe(this,e).duration=t}}function W0(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?G0:Y0)(t,e)):He(this.node(),t).duration}function K0(e,t){if(typeof t!="function")throw new Error;return function(){Xe(this,e).ease=t}}function X0(e){var t=this._id;return arguments.length?this.each(K0(t,e)):He(this.node(),t).ease}function q0(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Xe(this,e).ease=n}}function U0(e){if(typeof e!="function")throw new Error;return this.each(q0(this._id,e))}function J0(e){typeof e!="function"&&(e=Ec(e));for(var t=this._groups,n=t.length,s=new Array(n),r=0;r<n;++r)for(var i=t[r],l=i.length,c=s[r]=[],a,d=0;d<l;++d)(a=i[d])&&e.call(a,a.__data__,d,i)&&c.push(a);return new et(s,this._parents,this._name,this._id)}function Q0(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,s=t.length,r=n.length,i=Math.min(s,r),l=new Array(s),c=0;c<i;++c)for(var a=t[c],d=n[c],x=a.length,p=l[c]=new Array(x),m,f=0;f<x;++f)(m=a[f]||d[f])&&(p[f]=m);for(;c<s;++c)l[c]=t[c];return new et(l,this._parents,this._name,this._id)}function e2(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 t2(e,t,n){var s,r,i=e2(t)?lr:Xe;return function(){var l=i(this,e),c=l.on;c!==s&&(r=(s=c).copy()).on(t,n),l.on=r}}function n2(e,t){var n=this._id;return arguments.length<2?He(this.node(),n).on.on(e):this.each(t2(n,e,t))}function s2(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function o2(){return this.on("end.remove",s2(this._id))}function r2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=or(e));for(var s=this._groups,r=s.length,i=new Array(r),l=0;l<r;++l)for(var c=s[l],a=c.length,d=i[l]=new Array(a),x,p,m=0;m<a;++m)(x=c[m])&&(p=e.call(x,x.__data__,m,c))&&("__data__"in x&&(p.__data__=x.__data__),d[m]=p,Rs(d[m],t,n,m,d,He(x,n)));return new et(i,this._parents,t,n)}function i2(e){var t=this._name,n=this._id;typeof e!="function"&&(e=jc(e));for(var s=this._groups,r=s.length,i=[],l=[],c=0;c<r;++c)for(var a=s[c],d=a.length,x,p=0;p<d;++p)if(x=a[p]){for(var m=e.call(x,x.__data__,p,a),f,h=He(x,n),E=0,y=m.length;E<y;++E)(f=m[E])&&Rs(f,t,n,E,m,h);i.push(m),l.push(x)}return new et(i,l,t,n)}var l2=Sn.prototype.constructor;function c2(){return new l2(this._groups,this._parents)}function a2(e,t){var n,s,r;return function(){var i=Dt(this,e),l=(this.style.removeProperty(e),Dt(this,e));return i===l?null:i===n&&l===s?r:r=t(n=i,s=l)}}function zc(e){return function(){this.style.removeProperty(e)}}function u2(e,t,n){var s,r=n+"",i;return function(){var l=Dt(this,e);return l===r?null:l===s?i:i=t(s=l,n)}}function d2(e,t,n){var s,r,i;return function(){var l=Dt(this,e),c=n(this),a=c+"";return c==null&&(a=c=(this.style.removeProperty(e),Dt(this,e))),l===a?null:l===s&&a===r?i:(r=a,i=t(s=l,c))}}function x2(e,t){var n,s,r,i="style."+t,l="end."+i,c;return function(){var a=Xe(this,e),d=a.on,x=a.value[i]==null?c||(c=zc(t)):void 0;(d!==n||r!==x)&&(s=(n=d).copy()).on(l,r=x),a.on=s}}function p2(e,t,n){var s=(e+="")=="transform"?Ef:$c;return t==null?this.styleTween(e,a2(e,s)).on("end.style."+e,zc(e)):typeof t=="function"?this.styleTween(e,d2(e,s,cr(this,"style."+e,t))).each(x2(this._id,e)):this.styleTween(e,u2(e,s,t),n).on("end.style."+e,null)}function m2(e,t,n){return function(s){this.style.setProperty(e,t.call(this,s),n)}}function f2(e,t,n){var s,r;function i(){var l=t.apply(this,arguments);return l!==r&&(s=(r=l)&&m2(e,l,n)),s}return i._value=t,i}function h2(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,f2(e,t,n??""))}function g2(e){return function(){this.textContent=e}}function j2(e){return function(){var t=e(this);this.textContent=t??""}}function E2(e){return this.tween("text",typeof e=="function"?j2(cr(this,"text",e)):g2(e==null?"":e+""))}function y2(e){return function(t){this.textContent=e.call(this,t)}}function S2(e){var t,n;function s(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&y2(r)),t}return s._value=e,s}function R2(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,S2(e))}function C2(){for(var e=this._name,t=this._id,n=Bc(),s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],c=l.length,a,d=0;d<c;++d)if(a=l[d]){var x=He(a,t);Rs(a,e,n,d,l,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new et(s,this._parents,e,n)}function b2(){var e,t,n=this,s=n._id,r=n.size();return new Promise(function(i,l){var c={value:l},a={value:function(){--r===0&&i()}};n.each(function(){var d=Xe(this,s),x=d.on;x!==e&&(t=(e=x).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(a)),d.on=t}),r===0&&i()})}var w2=0;function et(e,t,n,s){this._groups=e,this._parents=t,this._name=n,this._id=s}function Bc(){return++w2}var Ue=Sn.prototype;et.prototype={constructor:et,select:r2,selectAll:i2,selectChild:Ue.selectChild,selectChildren:Ue.selectChildren,filter:J0,merge:Q0,selection:c2,transition:C2,call:Ue.call,nodes:Ue.nodes,node:Ue.node,size:Ue.size,empty:Ue.empty,each:Ue.each,on:n2,attr:$0,attrTween:V0,style:p2,styleTween:h2,text:E2,textTween:R2,remove:o2,tween:M0,delay:Z0,duration:W0,ease:X0,easeVarying:U0,end:b2,[Symbol.iterator]:Ue[Symbol.iterator]};function v2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var k2={time:null,delay:0,duration:250,ease:v2};function _2(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 M2(e){var t,n;e instanceof et?(t=e._id,e=e._name):(t=Bc(),(n=k2).time=ir(),e=e==null?null:e+"");for(var s=this._groups,r=s.length,i=0;i<r;++i)for(var l=s[i],c=l.length,a,d=0;d<c;++d)(a=l[d])&&Rs(a,e,t,d,l,n||_2(a,t));return new et(s,this._parents,e,t)}Sn.prototype.interrupt=v0;Sn.prototype.transition=M2;const Ln=e=>()=>e;function L2(e,{sourceEvent:t,target:n,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function Je(e,t,n){this.k=e,this.x=t,this.y=n}Je.prototype={constructor:Je,scale:function(e){return e===1?this:new Je(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Je(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 Cs=new Je(1,0,0);Dc.prototype=Je.prototype;function Dc(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Cs;return e.__zoom}function Ks(e){e.stopImmediatePropagation()}function tn(e){e.preventDefault(),e.stopImmediatePropagation()}function P2(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function T2(){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 ei(){return this.__zoom||Cs}function N2(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function A2(){return navigator.maxTouchPoints||"ontouchstart"in this}function I2(e,t,n){var s=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function Oc(){var e=P2,t=T2,n=I2,s=N2,r=A2,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,a=bf,d=Es("start","zoom","end"),x,p,m,f=500,h=150,E=0,y=10;function S(R){R.property("__zoom",ei).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",I).filter(r).on("touchstart.zoom",F).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(R,T,M,D){var P=R.selection?R.selection():R;P.property("__zoom",ei),R!==P?w(R,T,M,D):P.interrupt().each(function(){L(this,arguments).event(D).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},S.scaleBy=function(R,T,M,D){S.scaleTo(R,function(){var P=this.__zoom.k,V=typeof T=="function"?T.apply(this,arguments):T;return P*V},M,D)},S.scaleTo=function(R,T,M,D){S.transform(R,function(){var P=t.apply(this,arguments),V=this.__zoom,H=M==null?b(P):typeof M=="function"?M.apply(this,arguments):M,G=V.invert(H),q=typeof T=="function"?T.apply(this,arguments):T;return n(C(k(V,q),H,G),P,l)},M,D)},S.translateBy=function(R,T,M,D){S.transform(R,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),l)},null,D)},S.translateTo=function(R,T,M,D,P){S.transform(R,function(){var V=t.apply(this,arguments),H=this.__zoom,G=D==null?b(V):typeof D=="function"?D.apply(this,arguments):D;return n(Cs.translate(G[0],G[1]).scale(H.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof M=="function"?-M.apply(this,arguments):-M),V,l)},D,P)};function k(R,T){return T=Math.max(i[0],Math.min(i[1],T)),T===R.k?R:new Je(T,R.x,R.y)}function C(R,T,M){var D=T[0]-M[0]*R.k,P=T[1]-M[1]*R.k;return D===R.x&&P===R.y?R:new Je(R.k,D,P)}function b(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function w(R,T,M,D){R.on("start.zoom",function(){L(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(D).end()}).tween("zoom",function(){var P=this,V=arguments,H=L(P,V).event(D),G=t.apply(P,V),q=M==null?b(G):typeof M=="function"?M.apply(P,V):M,oe=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),ee=P.__zoom,ne=typeof T=="function"?T.apply(P,V):T,se=a(ee.invert(q).concat(oe/ee.k),ne.invert(q).concat(oe/ne.k));return function(ie){if(ie===1)ie=ne;else{var U=se(ie),ue=oe/U[2];ie=new Je(ue,q[0]-U[0]*ue,q[1]-U[1]*ue)}H.zoom(null,ie)}})}function L(R,T,M){return!M&&R.__zooming||new _(R,T)}function _(R,T){this.that=R,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,T),this.taps=0}_.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,T){return this.mouse&&R!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var T=$e(this.that).datum();d.call(R,this.that,new L2(R,{sourceEvent:this.sourceEvent,target:S,type:R,transform:this.that.__zoom,dispatch:d}),T)}};function N(R,...T){if(!e.apply(this,arguments))return;var M=L(this,T).event(R),D=this.__zoom,P=Math.max(i[0],Math.min(i[1],D.k*Math.pow(2,s.apply(this,arguments)))),V=De(R);if(M.wheel)(M.mouse[0][0]!==V[0]||M.mouse[0][1]!==V[1])&&(M.mouse[1]=D.invert(M.mouse[0]=V)),clearTimeout(M.wheel);else{if(D.k===P)return;M.mouse=[V,D.invert(V)],Gn(this),M.start()}tn(R),M.wheel=setTimeout(H,h),M.zoom("mouse",n(C(k(D,P),M.mouse[0],M.mouse[1]),M.extent,l));function H(){M.wheel=null,M.end()}}function A(R,...T){if(m||!e.apply(this,arguments))return;var M=R.currentTarget,D=L(this,T,!0).event(R),P=$e(R.view).on("mousemove.zoom",q,!0).on("mouseup.zoom",oe,!0),V=De(R,M),H=R.clientX,G=R.clientY;Mc(R.view),Ks(R),D.mouse=[V,this.__zoom.invert(V)],Gn(this),D.start();function q(ee){if(tn(ee),!D.moved){var ne=ee.clientX-H,se=ee.clientY-G;D.moved=ne*ne+se*se>E}D.event(ee).zoom("mouse",n(C(D.that.__zoom,D.mouse[0]=De(ee,M),D.mouse[1]),D.extent,l))}function oe(ee){P.on("mousemove.zoom mouseup.zoom",null),Lc(ee.view,D.moved),tn(ee),D.event(ee).end()}}function I(R,...T){if(e.apply(this,arguments)){var M=this.__zoom,D=De(R.changedTouches?R.changedTouches[0]:R,this),P=M.invert(D),V=M.k*(R.shiftKey?.5:2),H=n(C(k(M,V),D,P),t.apply(this,T),l);tn(R),c>0?$e(this).transition().duration(c).call(w,H,D,R):$e(this).call(S.transform,H,D,R)}}function F(R,...T){if(e.apply(this,arguments)){var M=R.touches,D=M.length,P=L(this,T,R.changedTouches.length===D).event(R),V,H,G,q;for(Ks(R),H=0;H<D;++H)G=M[H],q=De(G,this),q=[q,this.__zoom.invert(q),G.identifier],P.touch0?!P.touch1&&P.touch0[2]!==q[2]&&(P.touch1=q,P.taps=0):(P.touch0=q,V=!0,P.taps=1+!!x);x&&(x=clearTimeout(x)),V&&(P.taps<2&&(p=q[0],x=setTimeout(function(){x=null},f)),Gn(this),P.start())}}function $(R,...T){if(this.__zooming){var M=L(this,T).event(R),D=R.changedTouches,P=D.length,V,H,G,q;for(tn(R),V=0;V<P;++V)H=D[V],G=De(H,this),M.touch0&&M.touch0[2]===H.identifier?M.touch0[0]=G:M.touch1&&M.touch1[2]===H.identifier&&(M.touch1[0]=G);if(H=M.that.__zoom,M.touch1){var oe=M.touch0[0],ee=M.touch0[1],ne=M.touch1[0],se=M.touch1[1],ie=(ie=ne[0]-oe[0])*ie+(ie=ne[1]-oe[1])*ie,U=(U=se[0]-ee[0])*U+(U=se[1]-ee[1])*U;H=k(H,Math.sqrt(ie/U)),G=[(oe[0]+ne[0])/2,(oe[1]+ne[1])/2],q=[(ee[0]+se[0])/2,(ee[1]+se[1])/2]}else if(M.touch0)G=M.touch0[0],q=M.touch0[1];else return;M.zoom("touch",n(C(H,G,q),M.extent,l))}}function z(R,...T){if(this.__zooming){var M=L(this,T).event(R),D=R.changedTouches,P=D.length,V,H;for(Ks(R),m&&clearTimeout(m),m=setTimeout(function(){m=null},f),V=0;V<P;++V)H=D[V],M.touch0&&M.touch0[2]===H.identifier?delete M.touch0:M.touch1&&M.touch1[2]===H.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(H=De(H,this),Math.hypot(p[0]-H[0],p[1]-H[1])<y)){var G=$e(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return S.wheelDelta=function(R){return arguments.length?(s=typeof R=="function"?R:Ln(+R),S):s},S.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Ln(!!R),S):e},S.touchable=function(R){return arguments.length?(r=typeof R=="function"?R:Ln(!!R),S):r},S.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Ln([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),S):t},S.scaleExtent=function(R){return arguments.length?(i[0]=+R[0],i[1]=+R[1],S):[i[0],i[1]]},S.translateExtent=function(R){return arguments.length?(l[0][0]=+R[0][0],l[1][0]=+R[1][0],l[0][1]=+R[0][1],l[1][1]=+R[1][1],S):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},S.constrain=function(R){return arguments.length?(n=R,S):n},S.duration=function(R){return arguments.length?(c=+R,S):c},S.interpolate=function(R){return arguments.length?(a=R,S):a},S.on=function(){var R=d.on.apply(d,arguments);return R===d?S:R},S.clickDistance=function(R){return arguments.length?(E=(R=+R)*R,S):Math.sqrt(E)},S.tapDistance=function(R){return arguments.length?(y=+R,S):y},S}const Ie={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`},mn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Vc=["Enter"," ","Escape"];var kt;(function(e){e.Strict="strict",e.Loose="loose"})(kt||(kt={}));var Rt;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Rt||(Rt={}));var Vt;(function(e){e.Partial="partial",e.Full="full"})(Vt||(Vt={}));const Fc={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var lt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(lt||(lt={}));var ls;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ls||(ls={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const ti={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top};function Hc(e){return e===null?null:e?"valid":"invalid"}const Zc=e=>"id"in e&&"source"in e&&"target"in e,$2=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ar=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Rn=(e,t=[0,0])=>{const{width:n,height:s}=st(e),r=e.origin??t,i=n*r[0],l=s*r[1];return{x:e.position.x-i,y:e.position.y-l}},z2=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,r)=>{const i=typeof r=="string";let l=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(l=i?t.nodeLookup.get(r):ar(r)?r:t.nodeLookup.get(r.id));const c=l?cs(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return bs(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ws(n)},Cn=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(s=>{if(t.filter===void 0||t.filter(s)){const r=cs(s);n=bs(n,r)}}),ws(n)},Gc=(e,t,[n,s,r]=[0,0,1],i=!1,l=!1)=>{const c={...bn(t,[n,s,r]),width:t.width/r,height:t.height/r},a=[];for(const d of e.values()){const{measured:x,selectable:p=!0,hidden:m=!1}=d;if(l&&!p||m)continue;const f=x.width??d.width??d.initialWidth??null,h=x.height??d.height??d.initialHeight??null,E=fn(c,Ht(d)),y=(f??0)*(h??0),S=i&&E>0;(!d.internals.handleBounds||S||E>=y||d.dragging)&&a.push(d)}return a},B2=(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 Eo(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!r.hidden)&&(!s||s.has(r.id))&&n.set(r.id,r)}),n}async function yo({nodes:e,width:t,height:n,panZoom:s,minZoom:r,maxZoom:i},l){if(e.size===0)return Promise.resolve(!1);const c=Cn(e),a=ur(c,t,n,(l==null?void 0:l.minZoom)??r,(l==null?void 0:l.maxZoom)??i,(l==null?void 0:l.padding)??.1);return await s.setViewport(a,{duration:l==null?void 0:l.duration}),Promise.resolve(!0)}function Yc({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:r,onError:i}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:a,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},x=l.origin??s;let p=r;if(l.extent==="parent"&&!l.expandParent)if(!c)i==null||i("005",Ie.error005());else{const f=c.measured.width,h=c.measured.height;f&&h&&(p=[[a,d],[a+f,d+h]])}else c&&Zt(l.extent)&&(p=[[l.extent[0][0]+a,l.extent[0][1]+d],[l.extent[1][0]+a,l.extent[1][1]+d]]);const m=Zt(p)?_t(t,p,l.measured):t;return{position:{x:m.x-a+l.measured.width*x[0],y:m.y-d+l.measured.height*x[1]},positionAbsolute:m}}async function D2({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:r}){const i=new Set(e.map(m=>m.id)),l=[];for(const m of n){if(m.deletable===!1)continue;const f=i.has(m.id),h=!f&&m.parentId&&l.find(E=>E.id===m.parentId);(f||h)&&l.push(m)}const c=new Set(t.map(m=>m.id)),a=s.filter(m=>m.deletable!==!1),x=B2(l,a);for(const m of a)c.has(m.id)&&!x.find(h=>h.id===m.id)&&x.push(m);if(!r)return{edges:x,nodes:l};const p=await r({nodes:l,edges:x});return typeof p=="boolean"?p?{edges:x,nodes:l}:{edges:[],nodes:[]}:p}const Ft=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),_t=(e={x:0,y:0},t,n)=>({x:Ft(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ft(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Wc(e,t,n){const{width:s,height:r}=st(n),{x:i,y:l}=n.internals.positionAbsolute;return _t(e,[[i,l],[i+s,l+r]],t)}const ni=(e,t,n)=>e<t?Ft(Math.abs(e-t),1,t)/t:e>n?-Ft(Math.abs(e-n),1,t)/t:0,Kc=(e,t,n=15,s=40)=>{const r=ni(e.x,s,t.width-s)*n,i=ni(e.y,s,t.height-s)*n;return[r,i]},bs=(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)}),So=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),ws=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Ht=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=ar(e)?e.internals.positionAbsolute:Rn(e,t);return{x:n,y:s,width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},cs=(e,t=[0,0])=>{var r,i;const{x:n,y:s}=ar(e)?e.internals.positionAbsolute:Rn(e,t);return{x:n,y:s,x2:n+(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0),y2:s+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Xc=(e,t)=>ws(bs(So(e),So(t))),fn=(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)},si=e=>Oe(e.width)&&Oe(e.height)&&Oe(e.x)&&Oe(e.y),Oe=e=>!isNaN(e)&&isFinite(e),as=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},vs=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bn=({x:e,y:t},[n,s,r],i=!1,l=[1,1])=>{const c={x:(e-n)/r,y:(t-s)/r};return i?vs(c,l):c},qc=({x:e,y:t},[n,s,r])=>({x:e*r+n,y:t*r+s}),ur=(e,t,n,s,r,i)=>{const l=t/(e.width*(1+i)),c=n/(e.height*(1+i)),a=Math.min(l,c),d=Ft(a,s,r),x=e.x+e.width/2,p=e.y+e.height/2,m=t/2-x*d,f=n/2-p*d;return{x:m,y:f,zoom:d}},us=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Zt(e){return e!==void 0&&e!=="parent"}function st(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Uc(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Jc(e,t={width:0,height:0},n,s,r){const i={...e},l=s.get(n);if(l){const c=l.origin||r;i.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],i.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return i}function rn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:r}){const{x:i,y:l}=Qe(e),c=bn({x:i-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)},s),{x:a,y:d}=n?vs(c,t):c;return{xSnapped:a,ySnapped:d,...c}}const ks=e=>({width:e.offsetWidth,height:e.offsetHeight}),Qc=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},O2=["INPUT","SELECT","TEXTAREA"];function Ro(e){var s,r,i;const t=((r=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:r[0])||e.target;return O2.includes(t==null?void 0:t.nodeName)||((i=t==null?void 0:t.hasAttribute)==null?void 0:i.call(t,"contenteditable"))||!!(t!=null&&t.closest(".nokey"))}const ea=e=>"clientX"in e,Qe=(e,t)=>{var i,l;const n=ea(e),s=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,r=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:r-((t==null?void 0:t.top)??0)}},oi=(e,t,n,s,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:r,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/s,y:(c.top-n.top)/s,...ks(l)}})};function ta({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:r,sourceControlY:i,targetControlX:l,targetControlY:c}){const a=e*.125+r*.375+l*.375+n*.125,d=t*.125+i*.375+c*.375+s*.125,x=Math.abs(a-e),p=Math.abs(d-t);return[a,d,x,p]}function Pn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ri({pos:e,x1:t,y1:n,x2:s,y2:r,c:i}){switch(e){case X.Left:return[t-Pn(t-s,i),n];case X.Right:return[t+Pn(s-t,i),n];case X.Top:return[t,n-Pn(n-r,i)];case X.Bottom:return[t,n+Pn(r-n,i)]}}function na({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top,curvature:l=.25}){const[c,a]=ri({pos:n,x1:e,y1:t,x2:s,y2:r,c:l}),[d,x]=ri({pos:i,x1:s,y1:r,x2:e,y2:t,c:l}),[p,m,f,h]=ta({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:c,sourceControlY:a,targetControlX:d,targetControlY:x});return[`M${e},${t} C${c},${a} ${d},${x} ${s},${r}`,p,m,f,h]}function sa({sourceX:e,sourceY:t,targetX:n,targetY:s}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,l=Math.abs(s-t)/2,c=s<t?s+l:s-l;return[i,c,r,l]}function V2({sourceNode:e,targetNode:t,selected:n=!1,zIndex:s=0,elevateOnSelect:r=!1}){if(!r)return s;const i=n||t.selected||e.selected,l=Math.max(e.internals.z||0,t.internals.z||0,1e3);return s+(i?l:0)}function F2({sourceNode:e,targetNode:t,width:n,height:s,transform:r}){const i=bs(cs(e),cs(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:s/r[2]};return fn(l,ws(i))>0}const oa=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,H2=(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)),ra=(e,t)=>{if(!e.source||!e.target)return as("006",Ie.error006()),t;let n;return Zc(e)?n={...e}:n={...e,id:oa(e)},H2(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))},Z2=(e,t,n,s={shouldReplaceId:!0})=>{const{id:r,...i}=e;if(!t.source||!t.target)return as("006",Ie.error006()),n;if(!n.find(a=>a.id===e.id))return as("007",Ie.error007(r)),n;const c={...i,id:s.shouldReplaceId?oa(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==r).concat(c)};function ia({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[r,i,l,c]=sa({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,r,i,l,c]}const ii={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},G2=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.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},li=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Y2({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:s=X.Top,center:r,offset:i}){const l=ii[t],c=ii[s],a={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},x=G2({source:a,sourcePosition:t,target:d}),p=x.x!==0?"x":"y",m=x[p];let f=[],h,E;const y={x:0,y:0},S={x:0,y:0},[k,C,b,w]=sa({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[p]*c[p]===-1){h=r.x??k,E=r.y??C;const _=[{x:h,y:a.y},{x:h,y:d.y}],N=[{x:a.x,y:E},{x:d.x,y:E}];l[p]===m?f=p==="x"?_:N:f=p==="x"?N:_}else{const _=[{x:a.x,y:d.y}],N=[{x:d.x,y:a.y}];if(p==="x"?f=l.x===m?N:_:f=l.y===m?_:N,t===s){const z=Math.abs(e[p]-n[p]);if(z<=i){const R=Math.min(i-1,i-z);l[p]===m?y[p]=(a[p]>e[p]?-1:1)*R:S[p]=(d[p]>n[p]?-1:1)*R}}if(t!==s){const z=p==="x"?"y":"x",R=l[p]===c[z],T=a[z]>d[z],M=a[z]<d[z];(l[p]===1&&(!R&&T||R&&M)||l[p]!==1&&(!R&&M||R&&T))&&(f=p==="x"?_:N)}const A={x:a.x+y.x,y:a.y+y.y},I={x:d.x+S.x,y:d.y+S.y},F=Math.max(Math.abs(A.x-f[0].x),Math.abs(I.x-f[0].x)),$=Math.max(Math.abs(A.y-f[0].y),Math.abs(I.y-f[0].y));F>=$?(h=(A.x+I.x)/2,E=f[0].y):(h=f[0].x,E=(A.y+I.y)/2)}return[[e,{x:a.x+y.x,y:a.y+y.y},...f,{x:d.x+S.x,y:d.y+S.y},n],h,E,b,w]}function W2(e,t,n,s){const r=Math.min(li(e,t)/2,li(t,n)/2,s),{x:i,y:l}=t;if(e.x===i&&i===n.x||e.y===l&&l===n.y)return`L${i} ${l}`;if(e.y===l){const d=e.x<n.x?-1:1,x=e.y<n.y?1:-1;return`L ${i+r*d},${l}Q ${i},${l} ${i},${l+r*x}`}const c=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${l+r*a}Q ${i},${l} ${i+r*c},${l}`}function Co({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top,borderRadius:l=5,centerX:c,centerY:a,offset:d=20}){const[x,p,m,f,h]=Y2({source:{x:e,y:t},sourcePosition:n,target:{x:s,y:r},targetPosition:i,center:{x:c,y:a},offset:d});return[x.reduce((y,S,k)=>{let C="";return k>0&&k<x.length-1?C=W2(x[k-1],S,x[k+1],l):C=`${k===0?"M":"L"}${S.x} ${S.y}`,y+=C,y},""),p,m,f,h]}function ci(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function K2(e){var p;const{sourceNode:t,targetNode:n}=e;if(!ci(t)||!ci(n))return null;const s=t.internals.handleBounds||ai(t.handles),r=n.internals.handleBounds||ai(n.handles),i=ui((s==null?void 0:s.source)??[],e.sourceHandle),l=ui(e.connectionMode===kt.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),e.targetHandle);if(!i||!l)return(p=e.onError)==null||p.call(e,"008",Ie.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(i==null?void 0:i.position)||X.Bottom,a=(l==null?void 0:l.position)||X.Top,d=hn(t,i,c),x=hn(n,l,a);return{sourceX:d.x,sourceY:d.y,targetX:x.x,targetY:x.y,sourcePosition:c,targetPosition:a}}function ai(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 hn(e,t,n=X.Left,s=!1){const r=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??st(e);if(s)return{x:r+l/2,y:i+c/2};switch((t==null?void 0:t.position)??n){case X.Top:return{x:r+l/2,y:i};case X.Right:return{x:r+l,y:i+c/2};case X.Bottom:return{x:r+l/2,y:i+c};case X.Left:return{x:r,y:i+c/2}}}function ui(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function bo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function X2(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:r}){const i=new Set;return e.reduce((l,c)=>([c.markerStart||s,c.markerEnd||r].forEach(a=>{if(a&&typeof a=="object"){const d=bo(a,t);i.has(d)||(l.push({id:d,color:a.color||n,...a}),i.add(d))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const dr={nodeOrigin:[0,0],nodeExtent:mn,elevateNodesOnSelect:!0,defaults:{}},q2={...dr,checkEquality:!0};function xr(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function U2(e,t,n){const s=xr(dr,n);for(const r of e.values())if(r.parentId)pr(r,e,t,s);else{const i=Rn(r,s.nodeOrigin),l=Zt(r.extent)?r.extent:s.nodeExtent,c=_t(i,l,st(r));r.internals.positionAbsolute=c}}function wo(e,t,n,s){var c,a;const r=xr(q2,s),i=new Map(t),l=r!=null&&r.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const d of e){let x=i.get(d.id);if(r.checkEquality&&d===(x==null?void 0:x.internals.userNode))t.set(d.id,x);else{const p=Rn(d,r.nodeOrigin),m=Zt(d.extent)?d.extent:r.nodeExtent,f=_t(p,m,st(d));x={...r.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(a=d.measured)==null?void 0:a.height},internals:{positionAbsolute:f,handleBounds:d.measured?x==null?void 0:x.internals.handleBounds:void 0,z:la(d,l),userNode:d}},t.set(d.id,x)}d.parentId&&pr(x,t,n,s)}}function J2(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 pr(e,t,n,s){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:l}=xr(dr,s),c=e.parentId,a=t.get(c);if(!a){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}J2(e,n);const d=r?1e3:0,{x,y:p,z:m}=Q2(e,a,i,l,d),{positionAbsolute:f}=e.internals,h=x!==f.x||p!==f.y;(h||m!==e.internals.z)&&(e.internals={...e.internals,positionAbsolute:h?{x,y:p}:f,z:m})}function la(e,t){return(Oe(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Q2(e,t,n,s,r){const{x:i,y:l}=t.internals.positionAbsolute,c=st(e),a=Rn(e,n),d=Zt(e.extent)?_t(a,e.extent,c):a;let x=_t({x:i+d.x,y:l+d.y},s,c);e.extent==="parent"&&(x=Wc(x,c,t));const p=la(e,r),m=t.internals.z??0;return{x:x.x,y:x.y,z:m>p?m:p}}function mr(e,t,n,s=[0,0]){var l;const r=[],i=new Map;for(const c of e){const a=t.get(c.parentId);if(!a)continue;const d=((l=i.get(c.parentId))==null?void 0:l.expandedRect)??Ht(a),x=Xc(d,c.rect);i.set(c.parentId,{expandedRect:x,parent:a})}return i.size>0&&i.forEach(({expandedRect:c,parent:a},d)=>{var C;const x=a.internals.positionAbsolute,p=st(a),m=a.origin??s,f=c.x<x.x?Math.round(Math.abs(x.x-c.x)):0,h=c.y<x.y?Math.round(Math.abs(x.y-c.y)):0,E=Math.max(p.width,Math.round(c.width)),y=Math.max(p.height,Math.round(c.height)),S=(E-p.width)*m[0],k=(y-p.height)*m[1];(f>0||h>0||S||k)&&(r.push({id:d,type:"position",position:{x:a.position.x-f+S,y:a.position.y-h+k}}),(C=n.get(d))==null||C.forEach(b=>{e.some(w=>w.id===b.id)||r.push({id:b.id,type:"position",position:{x:b.position.x+f,y:b.position.y+h}})})),(p.width<c.width||p.height<c.height||f||h)&&r.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:E+(f?m[0]*f-S:0),height:y+(h?m[1]*h-k:0)}})}),r}function e3(e,t,n,s,r,i){const l=s==null?void 0:s.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const a=[],d=window.getComputedStyle(l),{m22:x}=new window.DOMMatrixReadOnly(d.transform),p=[];for(const m of e.values()){const f=t.get(m.id);if(f)if(f.hidden)f.internals={...f.internals,handleBounds:void 0},c=!0;else{const h=ks(m.nodeElement),E=f.measured.width!==h.width||f.measured.height!==h.height;if(!!(h.width&&h.height&&(E||!f.internals.handleBounds||m.force))){const S=m.nodeElement.getBoundingClientRect(),k=Zt(f.extent)?f.extent:i;let{positionAbsolute:C}=f.internals;f.parentId&&f.extent==="parent"?C=Wc(C,h,t.get(f.parentId)):k&&(C=_t(C,k,h)),f.measured=h,f.internals={...f.internals,positionAbsolute:C,handleBounds:{source:oi("source",m.nodeElement,S,x,f.id),target:oi("target",m.nodeElement,S,x,f.id)}},f.parentId&&pr(f,t,n,{nodeOrigin:r}),c=!0,E&&(a.push({id:f.id,type:"dimensions",dimensions:h}),f.expandParent&&f.parentId&&p.push({id:f.id,parentId:f.parentId,rect:Ht(f,r)}))}}}if(p.length>0){const m=mr(p,t,n,r);a.push(...m)}return{changes:a,updatedInternals:c}}async function t3({delta:e,panZoom:t,transform:n,translateExtent:s,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],s),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function ca(e,t,n){e.clear(),t.clear();for(const s of n){const{source:r,target:i,sourceHandle:l=null,targetHandle:c=null}=s,a=`${r}-source-${l}`,d=`${i}-target-${c}`,x=e.get(a)||new Map,p=e.get(d)||new Map,m={edgeId:s.id,source:r,target:i,sourceHandle:l,targetHandle:c};t.set(s.id,s),e.set(a,x.set(`${i}-${c}`,m)),e.set(d,p.set(`${r}-${l}`,m))}}function aa(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:aa(n,t):!1}function di(e,t,n){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===n)return!1;s=s.parentElement}while(s);return!1}function n3(e,t,n,s){const r=new Map;for(const[i,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!aa(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(i);c&&r.set(i,{id:i,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return r}function Xs({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var l,c,a;const r=[];for(const[d,x]of t){const p=(l=n.get(d))==null?void 0:l.internals.userNode;p&&r.push({...p,position:x.position,dragging:s})}if(!e)return[r[0],r];const i=(c=n.get(e))==null?void 0:c.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:s}:r[0],r]}function s3({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:r}){let i={x:null,y:null},l=0,c=new Map,a=!1,d={x:0,y:0},x=null,p=!1,m=null,f=!1;function h({noDragClassName:y,handleSelector:S,domNode:k,isSelectable:C,nodeId:b,nodeClickDistance:w=0}){m=$e(k);function L({x:I,y:F},$){const{nodeLookup:z,nodeExtent:R,snapGrid:T,snapToGrid:M,nodeOrigin:D,onNodeDrag:P,onSelectionDrag:V,onError:H,updateNodePositions:G}=t();i={x:I,y:F};let q=!1,oe={x:0,y:0,x2:0,y2:0};if(c.size>1&&R){const ee=Cn(c);oe=So(ee)}for(const[ee,ne]of c){if(!z.has(ee))continue;let se={x:I-ne.distance.x,y:F-ne.distance.y};M&&(se=vs(se,T));let ie=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];if(c.size>1&&R&&!ne.extent){const{positionAbsolute:ge}=ne.internals,pe=ge.x-oe.x+R[0][0],re=ge.x+ne.measured.width-oe.x2+R[1][0],Q=ge.y-oe.y+R[0][1],le=ge.y+ne.measured.height-oe.y2+R[1][1];ie=[[pe,Q],[re,le]]}const{position:U,positionAbsolute:ue}=Yc({nodeId:ee,nextPosition:se,nodeLookup:z,nodeExtent:ie,nodeOrigin:D,onError:H});q=q||ne.position.x!==U.x||ne.position.y!==U.y,ne.position=U,ne.internals.positionAbsolute=ue}if(q&&(G(c,!0),$&&(s||P||!b&&V))){const[ee,ne]=Xs({nodeId:b,dragItems:c,nodeLookup:z});s==null||s($,c,ee,ne),P==null||P($,ee,ne),b||V==null||V($,ne)}}async function _(){if(!x)return;const{transform:I,panBy:F,autoPanSpeed:$}=t(),[z,R]=Kc(d,x,$);(z!==0||R!==0)&&(i.x=(i.x??0)-z/I[2],i.y=(i.y??0)-R/I[2],await F({x:z,y:R})&&L(i,null)),l=requestAnimationFrame(_)}function N(I){var q;const{nodeLookup:F,multiSelectionActive:$,nodesDraggable:z,transform:R,snapGrid:T,snapToGrid:M,selectNodesOnDrag:D,onNodeDragStart:P,onSelectionDragStart:V,unselectNodesAndEdges:H}=t();p=!0,(!D||!C)&&!$&&b&&((q=F.get(b))!=null&&q.selected||H()),C&&D&&b&&(e==null||e(b));const G=rn(I.sourceEvent,{transform:R,snapGrid:T,snapToGrid:M,containerBounds:x});if(i=G,c=n3(F,z,G,b),c.size>0&&(n||P||!b&&V)){const[oe,ee]=Xs({nodeId:b,dragItems:c,nodeLookup:F});n==null||n(I.sourceEvent,c,oe,ee),P==null||P(I.sourceEvent,oe,ee),b||V==null||V(I.sourceEvent,ee)}}const A=Pc().clickDistance(w).on("start",I=>{const{domNode:F,nodeDragThreshold:$,transform:z,snapGrid:R,snapToGrid:T}=t();x=(F==null?void 0:F.getBoundingClientRect())||null,f=!1,$===0&&N(I),i=rn(I.sourceEvent,{transform:z,snapGrid:R,snapToGrid:T,containerBounds:x}),d=Qe(I.sourceEvent,x)}).on("drag",I=>{const{autoPanOnNodeDrag:F,transform:$,snapGrid:z,snapToGrid:R,nodeDragThreshold:T,nodeLookup:M}=t(),D=rn(I.sourceEvent,{transform:$,snapGrid:z,snapToGrid:R,containerBounds:x});if((I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||b&&!M.has(b))&&(f=!0),!f){if(!a&&F&&p&&(a=!0,_()),!p){const P=D.xSnapped-(i.x??0),V=D.ySnapped-(i.y??0);Math.sqrt(P*P+V*V)>T&&N(I)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&c&&p&&(d=Qe(I.sourceEvent,x),L(D,I.sourceEvent))}}).on("end",I=>{if(!(!p||f)&&(a=!1,p=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:F,updateNodePositions:$,onNodeDragStop:z,onSelectionDragStop:R}=t();if($(c,!1),r||z||!b&&R){const[T,M]=Xs({nodeId:b,dragItems:c,nodeLookup:F,dragging:!1});r==null||r(I.sourceEvent,c,T,M),z==null||z(I.sourceEvent,T,M),b||R==null||R(I.sourceEvent,M)}}}).filter(I=>{const F=I.target;return!I.button&&(!y||!di(F,`.${y}`,k))&&(!S||di(F,S,k))});m.call(A)}function E(){m==null||m.on(".drag",null)}return{update:h,destroy:E}}function o3(e,t,n){const s=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())fn(r,Ht(i))>0&&s.push(i);return s}const r3=250;function i3(e,t,n,s){var c,a;let r=[],i=1/0;const l=o3(e,n,t+r3);for(const d of l){const x=[...((c=d.internals.handleBounds)==null?void 0:c.source)??[],...((a=d.internals.handleBounds)==null?void 0:a.target)??[]];for(const p of x){if(s.nodeId===p.nodeId&&s.type===p.type&&s.id===p.id)continue;const{x:m,y:f}=hn(d,p,p.position,!0),h=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(f-e.y,2));h>t||(h<i?(r=[{...p,x:m,y:f}],i=h):h===i&&r.push({...p,x:m,y:f}))}}if(!r.length)return null;if(r.length>1){const d=s.type==="source"?"target":"source";return r.find(x=>x.type===d)??r[0]}return r[0]}function ua(e,t,n,s,r,i=!1){var d,x,p;const l=s.get(e);if(!l)return null;const c=r==="strict"?(d=l.internals.handleBounds)==null?void 0:d[t]:[...((x=l.internals.handleBounds)==null?void 0:x.source)??[],...((p=l.internals.handleBounds)==null?void 0:p.target)??[]],a=(n?c==null?void 0:c.find(m=>m.id===n):c==null?void 0:c[0])??null;return a&&i?{...a,...hn(l,a,a.position,!0)}:a}function da(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function l3(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const xa=()=>!0;function c3(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:r,edgeUpdaterType:i,isTarget:l,domNode:c,nodeLookup:a,lib:d,autoPanOnConnect:x,flowId:p,panBy:m,cancelConnection:f,onConnectStart:h,onConnect:E,onConnectEnd:y,isValidConnection:S=xa,onReconnectEnd:k,updateConnection:C,getTransform:b,getFromHandle:w,autoPanSpeed:L}){const _=Qc(e.target);let N=0,A;const{x:I,y:F}=Qe(e),$=_==null?void 0:_.elementFromPoint(I,F),z=da(i,$),R=c==null?void 0:c.getBoundingClientRect();if(!R||!z)return;const T=ua(r,z,s,a,t);if(!T)return;let M=Qe(e,R),D=!1,P=null,V=!1,H=null;function G(){if(!x||!R)return;const[ue,ge]=Kc(M,R,L);m({x:ue,y:ge}),N=requestAnimationFrame(G)}const q={...T,nodeId:r,type:z,position:T.position},oe=a.get(r),ne={inProgress:!0,isValid:null,from:hn(oe,q,X.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:oe,to:M,toHandle:null,toPosition:ti[q.position],toNode:null};C(ne);let se=ne;h==null||h(e,{nodeId:r,handleId:s,handleType:z});function ie(ue){if(!w()||!q){U(ue);return}const ge=b();M=Qe(ue,R),A=i3(bn(M,ge,!1,[1,1]),n,a,q),D||(G(),D=!0);const pe=pa(ue,{handle:A,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:l?"target":"source",isValidConnection:S,doc:_,lib:d,flowId:p,nodeLookup:a});H=pe.handleDomNode,P=pe.connection,V=l3(!!A,pe.isValid);const re={...se,isValid:V,to:A&&V?qc({x:A.x,y:A.y},ge):M,toHandle:pe.toHandle,toPosition:V&&pe.toHandle?pe.toHandle.position:ti[q.position],toNode:pe.toHandle?a.get(pe.toHandle.nodeId):null};V&&A&&se.toHandle&&re.toHandle&&se.toHandle.type===re.toHandle.type&&se.toHandle.nodeId===re.toHandle.nodeId&&se.toHandle.id===re.toHandle.id&&se.to.x===re.to.x&&se.to.y===re.to.y||(C(re),se=re)}function U(ue){(A||H)&&P&&V&&(E==null||E(P));const{inProgress:ge,...pe}=se,re={...pe,toPosition:se.toHandle?se.toPosition:null};y==null||y(ue,re),i&&(k==null||k(ue,re)),f(),cancelAnimationFrame(N),D=!1,V=!1,P=null,H=null,_.removeEventListener("mousemove",ie),_.removeEventListener("mouseup",U),_.removeEventListener("touchmove",ie),_.removeEventListener("touchend",U)}_.addEventListener("mousemove",ie),_.addEventListener("mouseup",U),_.addEventListener("touchmove",ie),_.addEventListener("touchend",U)}function pa(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:i,doc:l,lib:c,flowId:a,isValidConnection:d=xa,nodeLookup:x}){const p=i==="target",m=t?l.querySelector(`.${c}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:f,y:h}=Qe(e),E=l.elementFromPoint(f,h),y=E!=null&&E.classList.contains(`${c}-flow__handle`)?E:m,S={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const k=da(void 0,y),C=y.getAttribute("data-nodeid"),b=y.getAttribute("data-handleid"),w=y.classList.contains("connectable"),L=y.classList.contains("connectableend");if(!C||!k)return S;const _={source:p?C:s,sourceHandle:p?b:r,target:p?s:C,targetHandle:p?r:b};S.connection=_;const A=w&&L&&(n===kt.Strict?p&&k==="source"||!p&&k==="target":C!==s||b!==r);S.isValid=A&&d(_),S.toHandle=ua(C,k,b,x,n,!1)}return S}const vo={onPointerDown:c3,isValid:pa};function a3({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const r=$e(e);function i({translateExtent:c,width:a,height:d,zoomStep:x=10,pannable:p=!0,zoomable:m=!0,inversePan:f=!1}){const h=C=>{const b=n();if(C.sourceEvent.type!=="wheel"||!t)return;const w=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*x,L=b[2]*Math.pow(2,w);t.scaleTo(L)};let E=[0,0];const y=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(E=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},S=C=>{const b=n();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!t)return;const w=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],L=[w[0]-E[0],w[1]-E[1]];E=w;const _=s()*Math.max(b[2],Math.log(b[2]))*(f?-1:1),N={x:b[0]-L[0]*_,y:b[1]-L[1]*_},A=[[0,0],[a,d]];t.setViewportConstrained({x:N.x,y:N.y,zoom:b[2]},A,c)},k=Oc().on("start",y).on("zoom",p?S:null).on("zoom.wheel",m?h:null);r.call(k,{})}function l(){r.on("zoom",null)}return{update:i,destroy:l,pointer:De}}const u3=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,_s=e=>({x:e.x,y:e.y,zoom:e.k}),qs=({x:e,y:t,zoom:n})=>Cs.translate(e,t).scale(n),At=(e,t)=>e.target.closest(`.${t}`),ma=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Us=(e,t=0,n=()=>{})=>{const s=typeof t=="number"&&t>0;return s||n(),s?e.transition().duration(t).on("end",n):e},fa=e=>{const t=e.ctrlKey&&us()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function d3({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:a,onPanZoomEnd:d}){return x=>{if(At(x,t))return!1;x.preventDefault(),x.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(x.ctrlKey&&l){const y=De(x),S=fa(x),k=p*Math.pow(2,S);s.scaleTo(n,k,y,x);return}const m=x.deltaMode===1?20:1;let f=r===Rt.Vertical?0:x.deltaX*m,h=r===Rt.Horizontal?0:x.deltaY*m;!us()&&x.shiftKey&&r!==Rt.Vertical&&(f=x.deltaY*m,h=0),s.translateBy(n,-(f/p)*i,-(h/p)*i,{internal:!0});const E=_s(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c==null||c(x,E)),e.isPanScrolling&&(a==null||a(x,E),e.panScrollTimeout=setTimeout(()=>{d==null||d(x,E),e.isPanScrolling=!1},150))}}function x3({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,r){if(!t&&s.type==="wheel"&&!s.ctrlKey||At(s,e))return null;s.preventDefault(),n.call(this,s,r)}}function p3({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var i,l,c;if((i=s.sourceEvent)!=null&&i.internal)return;const r=_s(s.transform);e.mouseButton=((l=s.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=r,((c=s.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,r))}}function m3({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:r}){return i=>{var l,c;e.usedRightMouseButton=!!(n&&ma(t,e.mouseButton??0)),(l=i.sourceEvent)!=null&&l.sync||s([i.transform.x,i.transform.y,i.transform.k]),r&&!((c=i.sourceEvent)!=null&&c.internal)&&(r==null||r(i.sourceEvent,_s(i.transform)))}}function f3({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:i}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,i&&ma(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),r&&u3(e.prevViewport,l.transform))){const a=_s(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r==null||r(l.sourceEvent,a)},n?150:0)}}}function h3({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:c,noPanClassName:a,lib:d}){return x=>{var h;const p=e||t,m=n&&x.ctrlKey;if(x.button===1&&x.type==="mousedown"&&(At(x,`${d}-flow__node`)||At(x,`${d}-flow__edge`)))return!0;if(!s&&!p&&!r&&!i&&!n||l||At(x,c)&&x.type==="wheel"||At(x,a)&&(x.type!=="wheel"||r&&x.type==="wheel"&&!e)||!n&&x.ctrlKey&&x.type==="wheel")return!1;if(!n&&x.type==="touchstart"&&((h=x.touches)==null?void 0:h.length)>1)return x.preventDefault(),!1;if(!p&&!r&&!m&&x.type==="wheel"||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const f=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||x.type==="wheel")&&f}}function g3({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:s,translateExtent:r,viewport:i,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:a,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=Oc().clickDistance(!Oe(s)||s<0?0:s).scaleExtent([t,n]).translateExtent(r),f=$e(e).call(m);C({x:i.x,y:i.y,zoom:Ft(i.zoom,t,n)},[[0,0],[p.width,p.height]],r);const h=f.on("wheel.zoom"),E=f.on("dblclick.zoom");m.wheelDelta(fa);function y($,z){return f?new Promise(R=>{m==null||m.transform(Us(f,z==null?void 0:z.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function S({noWheelClassName:$,noPanClassName:z,onPaneContextMenu:R,userSelectionActive:T,panOnScroll:M,panOnDrag:D,panOnScrollMode:P,panOnScrollSpeed:V,preventScrolling:H,zoomOnPinch:G,zoomOnScroll:q,zoomOnDoubleClick:oe,zoomActivationKeyPressed:ee,lib:ne,onTransformChange:se}){T&&!x.isZoomingOrPanning&&k();const U=M&&!ee&&!T?d3({zoomPanValues:x,noWheelClassName:$,d3Selection:f,d3Zoom:m,panOnScrollMode:P,panOnScrollSpeed:V,zoomOnPinch:G,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:a}):x3({noWheelClassName:$,preventScrolling:H,d3ZoomHandler:h});if(f.on("wheel.zoom",U,{passive:!1}),!T){const ge=p3({zoomPanValues:x,onDraggingChange:d,onPanZoomStart:c});m.on("start",ge);const pe=m3({zoomPanValues:x,panOnDrag:D,onPaneContextMenu:!!R,onPanZoom:l,onTransformChange:se});m.on("zoom",pe);const re=f3({zoomPanValues:x,panOnDrag:D,panOnScroll:M,onPaneContextMenu:R,onPanZoomEnd:a,onDraggingChange:d});m.on("end",re)}const ue=h3({zoomActivationKeyPressed:ee,panOnDrag:D,zoomOnScroll:q,panOnScroll:M,zoomOnDoubleClick:oe,zoomOnPinch:G,userSelectionActive:T,noPanClassName:z,noWheelClassName:$,lib:ne});m.filter(ue),oe?f.on("dblclick.zoom",E):f.on("dblclick.zoom",null)}function k(){m.on("zoom",null)}async function C($,z,R){const T=qs($),M=m==null?void 0:m.constrain()(T,z,R);return M&&await y(M),new Promise(D=>D(M))}async function b($,z){const R=qs($);return await y(R,z),new Promise(T=>T(R))}function w($){if(f){const z=qs($),R=f.property("__zoom");(R.k!==$.zoom||R.x!==$.x||R.y!==$.y)&&(m==null||m.transform(f,z,null,{sync:!0}))}}function L(){const $=f?Dc(f.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function _($,z){return f?new Promise(R=>{m==null||m.scaleTo(Us(f,z==null?void 0:z.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function N($,z){return f?new Promise(R=>{m==null||m.scaleBy(Us(f,z==null?void 0:z.duration,()=>R(!0)),$)}):Promise.resolve(!1)}function A($){m==null||m.scaleExtent($)}function I($){m==null||m.translateExtent($)}function F($){const z=!Oe($)||$<0?0:$;m==null||m.clickDistance(z)}return{update:S,destroy:k,setViewport:b,setViewportConstrained:C,getViewport:L,scaleTo:_,scaleBy:N,setScaleExtent:A,setTranslateExtent:I,syncViewport:w,setClickDistance:F}}var ln;(function(e){e.Line="line",e.Handle="handle"})(ln||(ln={}));function j3({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:r,affectsY:i}){const l=e-t,c=n-s,a=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&r&&(a[0]=a[0]*-1),c&&i&&(a[1]=a[1]*-1),a}function E3(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:r}}function rt(e,t){return Math.max(0,t-e)}function it(e,t){return Math.max(0,e-t)}function Tn(e,t,n){return Math.max(0,t-e,e-n)}function xi(e,t){return e?!t:t}function y3(e,t,n,s,r,i,l,c){let{affectsX:a,affectsY:d}=t;const{isHorizontal:x,isVertical:p}=t,m=x&&p,{xSnapped:f,ySnapped:h}=n,{minWidth:E,maxWidth:y,minHeight:S,maxHeight:k}=s,{x:C,y:b,width:w,height:L,aspectRatio:_}=e;let N=Math.floor(x?f-e.pointerX:0),A=Math.floor(p?h-e.pointerY:0);const I=w+(a?-N:N),F=L+(d?-A:A),$=-i[0]*w,z=-i[1]*L;let R=Tn(I,E,y),T=Tn(F,S,k);if(l){let P=0,V=0;a&&N<0?P=rt(C+N+$,l[0][0]):!a&&N>0&&(P=it(C+I+$,l[1][0])),d&&A<0?V=rt(b+A+z,l[0][1]):!d&&A>0&&(V=it(b+F+z,l[1][1])),R=Math.max(R,P),T=Math.max(T,V)}if(c){let P=0,V=0;a&&N>0?P=it(C+N,c[0][0]):!a&&N<0&&(P=rt(C+I,c[1][0])),d&&A>0?V=it(b+A,c[0][1]):!d&&A<0&&(V=rt(b+F,c[1][1])),R=Math.max(R,P),T=Math.max(T,V)}if(r){if(x){const P=Tn(I/_,S,k)*_;if(R=Math.max(R,P),l){let V=0;!a&&!d||a&&!d&&m?V=it(b+z+I/_,l[1][1])*_:V=rt(b+z+(a?N:-N)/_,l[0][1])*_,R=Math.max(R,V)}if(c){let V=0;!a&&!d||a&&!d&&m?V=rt(b+I/_,c[1][1])*_:V=it(b+(a?N:-N)/_,c[0][1])*_,R=Math.max(R,V)}}if(p){const P=Tn(F*_,E,y)/_;if(T=Math.max(T,P),l){let V=0;!a&&!d||d&&!a&&m?V=it(C+F*_+$,l[1][0])/_:V=rt(C+(d?A:-A)*_+$,l[0][0])/_,T=Math.max(T,V)}if(c){let V=0;!a&&!d||d&&!a&&m?V=rt(C+F*_,c[1][0])/_:V=it(C+(d?A:-A)*_,c[0][0])/_,T=Math.max(T,V)}}}A=A+(A<0?T:-T),N=N+(N<0?R:-R),r&&(m?I>F*_?A=(xi(a,d)?-N:N)/_:N=(xi(a,d)?-A:A)*_:x?(A=N/_,d=a):(N=A*_,a=d));const M=a?C+N:C,D=d?b+A:b;return{width:w+(a?-N:N),height:L+(d?-A:A),x:i[0]*N*(a?-1:1)+M,y:i[1]*A*(d?-1:1)+D}}const ha={width:0,height:0,x:0,y:0},S3={...ha,pointerX:0,pointerY:0,aspectRatio:1};function R3(e){return[[0,0],[e.measured.width,e.measured.height]]}function C3(e,t,n){const s=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,c=n[0]*i,a=n[1]*l;return[[s-c,r-a],[s+i-c,r+l-a]]}function b3({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:r}){const i=$e(e);function l({controlPosition:a,boundaries:d,keepAspectRatio:x,onResizeStart:p,onResize:m,onResizeEnd:f,shouldResize:h}){let E={...ha},y={...S3};const S=E3(a);let k,C=null,b=[],w,L,_;const N=Pc().on("start",A=>{const{nodeLookup:I,transform:F,snapGrid:$,snapToGrid:z,nodeOrigin:R,paneDomNode:T}=n();if(k=I.get(t),!k)return;C=(T==null?void 0:T.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:D}=rn(A.sourceEvent,{transform:F,snapGrid:$,snapToGrid:z,containerBounds:C});E={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},y={...E,pointerX:M,pointerY:D,aspectRatio:E.width/E.height},w=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(w=I.get(k.parentId),L=w&&k.extent==="parent"?R3(w):void 0),b=[],_=void 0;for(const[P,V]of I)if(V.parentId===t&&(b.push({id:P,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){const H=C3(V,k,V.origin??R);_?_=[[Math.min(H[0][0],_[0][0]),Math.min(H[0][1],_[0][1])],[Math.max(H[1][0],_[1][0]),Math.max(H[1][1],_[1][1])]]:_=H}p==null||p(A,{...E})}).on("drag",A=>{const{transform:I,snapGrid:F,snapToGrid:$,nodeOrigin:z}=n(),R=rn(A.sourceEvent,{transform:I,snapGrid:F,snapToGrid:$,containerBounds:C}),T=[];if(!k)return;const{x:M,y:D,width:P,height:V}=E,H={},G=k.origin??z,{width:q,height:oe,x:ee,y:ne}=y3(y,S,R,d,x,G,L,_),se=q!==P,ie=oe!==V,U=ee!==M&&se,ue=ne!==D&&ie;if(!U&&!ue&&!se&&!ie)return;if((U||ue||G[0]===1||G[1]===1)&&(H.x=U?ee:E.x,H.y=ue?ne:E.y,E.x=H.x,E.y=H.y,b.length>0)){const Q=ee-M,le=ne-D;for(const je of b)je.position={x:je.position.x-Q+G[0]*(q-P),y:je.position.y-le+G[1]*(oe-V)},T.push(je)}if((se||ie)&&(H.width=se?q:E.width,H.height=ie?oe:E.height,E.width=H.width,E.height=H.height),w&&k.expandParent){const Q=G[0]*(H.width??0);H.x&&H.x<Q&&(E.x=Q,y.x=y.x-(H.x-Q));const le=G[1]*(H.height??0);H.y&&H.y<le&&(E.y=le,y.y=y.y-(H.y-le))}const ge=j3({width:E.width,prevWidth:P,height:E.height,prevHeight:V,affectsX:S.affectsX,affectsY:S.affectsY}),pe={...E,direction:ge};(h==null?void 0:h(A,pe))!==!1&&(m==null||m(A,pe),s(H,T))}).on("end",A=>{f==null||f(A,{...E}),r==null||r()});i.call(N)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var Nn={exports:{}},Js={},An={exports:{}},Qs={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var mi;function v3(){if(mi)return eo;mi=1;var e=g;function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function c(p,m){var f=m(),h=s({inst:{value:f,getSnapshot:m}}),j=h[0].inst,y=h[1];return i(function(){j.value=f,j.getSnapshot=m,a(j)&&y({inst:j})},[p,f,m]),r(function(){return a(j)&&y({inst:j}),p(function(){a(j)&&y({inst:j})})},[p]),l(f),f}function a(p){var m=p.getSnapshot;p=p.value;try{var f=m();return!n(p,f)}catch{return!0}}function d(p,m){return m()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return eo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,eo}var to={};/**
9
+ */var pi;function w3(){if(pi)return Qs;pi=1;var e=g;function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function c(p,m){var f=m(),h=s({inst:{value:f,getSnapshot:m}}),E=h[0].inst,y=h[1];return i(function(){E.value=f,E.getSnapshot=m,a(E)&&y({inst:E})},[p,f,m]),r(function(){return a(E)&&y({inst:E}),p(function(){a(E)&&y({inst:E})})},[p]),l(f),f}function a(p){var m=p.getSnapshot;p=p.value;try{var f=m();return!n(p,f)}catch{return!0}}function d(p,m){return m()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return Qs.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,Qs}var eo={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim.development.js
12
12
  *
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var fi;function M3(){return fi||(fi=1,process.env.NODE_ENV!=="production"&&function(){function e(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}function t(f,h){x||r.startTransition===void 0||(x=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var j=h();if(!p){var y=h();i(j,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}y=l({inst:{value:j,getSnapshot:h}});var S=y[0].inst,M=y[1];return a(function(){S.value=j,S.getSnapshot=h,n(S)&&M({inst:S})},[f,j,h]),c(function(){return n(S)&&M({inst:S}),f(function(){n(S)&&M({inst:S})})},[f]),d(j),j}function n(f){var h=f.getSnapshot;f=f.value;try{var j=h();return!i(f,j)}catch{return!0}}function s(f,h){return h()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=g,i=typeof Object.is=="function"?Object.is:e,l=r.useState,c=r.useEffect,a=r.useLayoutEffect,d=r.useDebugValue,x=!1,p=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;to.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),to}var hi;function ja(){return hi||(hi=1,process.env.NODE_ENV==="production"?An.exports=v3():An.exports=M3()),An.exports}/**
17
+ */var mi;function v3(){return mi||(mi=1,process.env.NODE_ENV!=="production"&&function(){function e(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}function t(f,h){x||r.startTransition===void 0||(x=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=h();if(!p){var y=h();i(E,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}y=l({inst:{value:E,getSnapshot:h}});var S=y[0].inst,k=y[1];return a(function(){S.value=E,S.getSnapshot=h,n(S)&&k({inst:S})},[f,E,h]),c(function(){return n(S)&&k({inst:S}),f(function(){n(S)&&k({inst:S})})},[f]),d(E),E}function n(f){var h=f.getSnapshot;f=f.value;try{var E=h();return!i(f,E)}catch{return!0}}function s(f,h){return h()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=g,i=typeof Object.is=="function"?Object.is:e,l=r.useState,c=r.useEffect,a=r.useLayoutEffect,d=r.useDebugValue,x=!1,p=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?s:t;eo.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),eo}var fi;function ga(){return fi||(fi=1,process.env.NODE_ENV==="production"?An.exports=w3():An.exports=v3()),An.exports}/**
18
18
  * @license React
19
19
  * use-sync-external-store-shim/with-selector.production.js
20
20
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var gi;function k3(){if(gi)return Qs;gi=1;var e=g,t=ja();function n(d,x){return d===x&&(d!==0||1/d===1/x)||d!==d&&x!==x}var s=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,c=e.useMemo,a=e.useDebugValue;return Qs.useSyncExternalStoreWithSelector=function(d,x,p,m,f){var h=i(null);if(h.current===null){var j={hasValue:!1,value:null};h.current=j}else j=h.current;h=c(function(){function S(P){if(!M){if(M=!0,C=P,P=m(P),f!==void 0&&j.hasValue){var k=j.value;if(f(k,P))return b=k}return b=P}if(k=b,s(C,P))return k;var T=m(P);return f!==void 0&&f(k,T)?(C=P,k):(C=P,b=T)}var M=!1,C,b,w=p===void 0?null:p;return[function(){return S(x())},w===null?void 0:function(){return S(w())}]},[x,p,m,f]);var y=r(d,h[0],h[1]);return l(function(){j.hasValue=!0,j.value=y},[y]),a(y),y},Qs}var no={};/**
25
+ */var hi;function k3(){if(hi)return Js;hi=1;var e=g,t=ga();function n(d,x){return d===x&&(d!==0||1/d===1/x)||d!==d&&x!==x}var s=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,c=e.useMemo,a=e.useDebugValue;return Js.useSyncExternalStoreWithSelector=function(d,x,p,m,f){var h=i(null);if(h.current===null){var E={hasValue:!1,value:null};h.current=E}else E=h.current;h=c(function(){function S(L){if(!k){if(k=!0,C=L,L=m(L),f!==void 0&&E.hasValue){var _=E.value;if(f(_,L))return b=_}return b=L}if(_=b,s(C,L))return _;var N=m(L);return f!==void 0&&f(_,N)?(C=L,_):(C=L,b=N)}var k=!1,C,b,w=p===void 0?null:p;return[function(){return S(x())},w===null?void 0:function(){return S(w())}]},[x,p,m,f]);var y=r(d,h[0],h[1]);return l(function(){E.hasValue=!0,E.value=y},[y]),a(y),y},Js}var to={};/**
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 ji;function _3(){return ji||(ji=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=g,n=ja(),s=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,i=t.useRef,l=t.useEffect,c=t.useMemo,a=t.useDebugValue;no.useSyncExternalStoreWithSelector=function(d,x,p,m,f){var h=i(null);if(h.current===null){var j={hasValue:!1,value:null};h.current=j}else j=h.current;h=c(function(){function S(P){if(!M){if(M=!0,C=P,P=m(P),f!==void 0&&j.hasValue){var k=j.value;if(f(k,P))return b=k}return b=P}if(k=b,s(C,P))return k;var T=m(P);return f!==void 0&&f(k,T)?(C=P,k):(C=P,b=T)}var M=!1,C,b,w=p===void 0?null:p;return[function(){return S(x())},w===null?void 0:function(){return S(w())}]},[x,p,m,f]);var y=r(d,h[0],h[1]);return l(function(){j.hasValue=!0,j.value=y},[y]),a(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),no}var Ei;function P3(){return Ei||(Ei=1,process.env.NODE_ENV==="production"?Tn.exports=k3():Tn.exports=_3()),Tn.exports}var L3=P3();const N3=E.getDefaultExportFromCjs(L3),yi=e=>{let t;const n=new Set,s=(x,p)=>{const m=typeof x=="function"?x(t):x;if(!Object.is(m,t)){const f=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(h=>h(t,f))}},r=()=>t,a={setState:s,getState:r,getInitialState:()=>d,subscribe:x=>(n.add(x),()=>n.delete(x)),destroy:()=>{n.clear()}},d=t=e(s,r,a);return a},T3=e=>e?yi(e):yi,{useDebugValue:A3}=g,{useSyncExternalStoreWithSelector:I3}=N3,$3=e=>e;function Ea(e,t=$3,n){const s=I3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return A3(s),s}const Si=(e,t)=>{const n=T3(e),s=(r,i=t)=>Ea(n,r,i);return Object.assign(s,n),s},z3=(e,t)=>e?Si(e,t):Si;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,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const _s=g.createContext(null),B3=_s.Provider,ya=Ie.error001();function Ee(e,t){const n=g.useContext(_s);if(n===null)throw new Error(ya);return Ea(n,e,t)}function we(){const e=g.useContext(_s);if(e===null)throw new Error(ya);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Ri={display:"none"},D3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Sa="react-flow__node-desc",Ra="react-flow__edge-desc",O3="react-flow__aria-live",V3=e=>e.ariaLiveMessage;function F3({rfId:e}){const t=Ee(V3);return o.jsxRuntimeExports.jsx("div",{id:`${O3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:D3,children:t})}function H3({rfId:e,disableKeyboardA11y:t}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{id:`${Sa}-${e}`,style:Ri,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),o.jsxRuntimeExports.jsx("div",{id:`${Ra}-${e}`,style:Ri,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&o.jsxRuntimeExports.jsx(F3,{rfId:e})]})}const Z3=e=>e.userSelectionActive?"none":"all",hr=g.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const l=Ee(Z3),c=`${e}`.split("-");return o.jsxRuntimeExports.jsx("div",{className:_e(["react-flow__panel",n,...c]),style:{...s,pointerEvents:l},ref:i,...r,children:t})});function G3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsxRuntimeExports.jsx(hr,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:o.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Y3=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}},In=e=>e.id;function W3(e,t){return ke(e.selectedNodes.map(In),t.selectedNodes.map(In))&&ke(e.selectedEdges.map(In),t.selectedEdges.map(In))}function K3({onSelectionChange:e}){const t=we(),{selectedNodes:n,selectedEdges:s}=Ee(Y3,W3);return g.useEffect(()=>{const r={nodes:n,edges:s};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const X3=e=>!!e.onSelectionChangeHandlers;function q3({onSelectionChange:e}){const t=Ee(X3);return e||t?o.jsxRuntimeExports.jsx(K3,{onSelectionChange:e}):null}const Ca=[0,0],U3={x:0,y:0,zoom:1},J3=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","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","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],Ci=[...J3,"rfId"],Q3=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}),bi={translateExtent:mn,nodeOrigin:Ca,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function e5(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:a,setPaneClickDistance:d}=Ee(Q3,ke),x=we();g.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{p.current=bi,c()}),[]);const p=g.useRef(bi);return g.useEffect(()=>{for(const m of Ci){const f=e[m],h=p.current[m];f!==h&&(typeof e[m]>"u"||(m==="nodes"?t(f):m==="edges"?n(f):m==="minZoom"?s(f):m==="maxZoom"?r(f):m==="translateExtent"?i(f):m==="nodeExtent"?l(f):m==="paneClickDistance"?d(f):m==="fitView"?x.setState({fitViewOnInit:f}):m==="fitViewOptions"?x.setState({fitViewOnInitOptions:f}):x.setState({[m]:f})))}p.current=e},Ci.map(m=>e[m])),null}function wi(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function t5(e){var s;const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const r=wi(),i=()=>n(r!=null&&r.matches?"dark":"light");return i(),r==null||r.addEventListener("change",i),()=>{r==null||r.removeEventListener("change",i)}},[e]),t!==null?t:(s=wi())!=null&&s.matches?"dark":"light"}const vi=typeof document<"u"?document:null;function gn(e=null,t={target:vi,actInsideInputWithModifier:!0}){const[n,s]=g.useState(!1),r=g.useRef(!1),i=g.useRef(new Set([])),[l,c]=g.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
33
+ */var gi;function _3(){return gi||(gi=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=g,n=ga(),s=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,i=t.useRef,l=t.useEffect,c=t.useMemo,a=t.useDebugValue;to.useSyncExternalStoreWithSelector=function(d,x,p,m,f){var h=i(null);if(h.current===null){var E={hasValue:!1,value:null};h.current=E}else E=h.current;h=c(function(){function S(L){if(!k){if(k=!0,C=L,L=m(L),f!==void 0&&E.hasValue){var _=E.value;if(f(_,L))return b=_}return b=L}if(_=b,s(C,L))return _;var N=m(L);return f!==void 0&&f(_,N)?(C=L,_):(C=L,b=N)}var k=!1,C,b,w=p===void 0?null:p;return[function(){return S(x())},w===null?void 0:function(){return S(w())}]},[x,p,m,f]);var y=r(d,h[0],h[1]);return l(function(){E.hasValue=!0,E.value=y},[y]),a(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),to}var ji;function M3(){return ji||(ji=1,process.env.NODE_ENV==="production"?Nn.exports=k3():Nn.exports=_3()),Nn.exports}var L3=M3();const P3=j.getDefaultExportFromCjs(L3),Ei=e=>{let t;const n=new Set,s=(x,p)=>{const m=typeof x=="function"?x(t):x;if(!Object.is(m,t)){const f=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(h=>h(t,f))}},r=()=>t,a={setState:s,getState:r,getInitialState:()=>d,subscribe:x=>(n.add(x),()=>n.delete(x)),destroy:()=>{n.clear()}},d=t=e(s,r,a);return a},T3=e=>e?Ei(e):Ei,{useDebugValue:N3}=g,{useSyncExternalStoreWithSelector:A3}=P3,I3=e=>e;function ja(e,t=I3,n){const s=A3(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return N3(s),s}const yi=(e,t)=>{const n=T3(e),s=(r,i=t)=>ja(n,r,i);return Object.assign(s,n),s},$3=(e,t)=>e?yi(e,t):yi;function _e(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,r]of e)if(!Object.is(r,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const Ms=g.createContext(null),z3=Ms.Provider,Ea=Ie.error001();function Ee(e,t){const n=g.useContext(Ms);if(n===null)throw new Error(Ea);return ja(n,e,t)}function we(){const e=g.useContext(Ms);if(e===null)throw new Error(Ea);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Si={display:"none"},B3={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ya="react-flow__node-desc",Sa="react-flow__edge-desc",D3="react-flow__aria-live",O3=e=>e.ariaLiveMessage;function V3({rfId:e}){const t=Ee(O3);return o.jsxRuntimeExports.jsx("div",{id:`${D3}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:B3,children:t})}function F3({rfId:e,disableKeyboardA11y:t}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsxs("div",{id:`${ya}-${e}`,style:Si,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),o.jsxRuntimeExports.jsx("div",{id:`${Sa}-${e}`,style:Si,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&o.jsxRuntimeExports.jsx(V3,{rfId:e})]})}const H3=e=>e.userSelectionActive?"none":"all",fr=g.forwardRef(({position:e="top-left",children:t,className:n,style:s,...r},i)=>{const l=Ee(H3),c=`${e}`.split("-");return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__panel",n,...c]),style:{...s,pointerEvents:l},ref:i,...r,children:t})});function Z3({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsxRuntimeExports.jsx(fr,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:o.jsxRuntimeExports.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const G3=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}},In=e=>e.id;function Y3(e,t){return _e(e.selectedNodes.map(In),t.selectedNodes.map(In))&&_e(e.selectedEdges.map(In),t.selectedEdges.map(In))}function W3({onSelectionChange:e}){const t=we(),{selectedNodes:n,selectedEdges:s}=Ee(G3,Y3);return g.useEffect(()=>{const r={nodes:n,edges:s};e==null||e(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,s,e]),null}const K3=e=>!!e.onSelectionChangeHandlers;function X3({onSelectionChange:e}){const t=Ee(K3);return e||t?o.jsxRuntimeExports.jsx(W3,{onSelectionChange:e}):null}const Ra=[0,0],q3={x:0,y:0,zoom:1},U3=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","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","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],Ri=[...U3,"rfId"],J3=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}),Ci={translateExtent:mn,nodeOrigin:Ra,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Q3(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:a,setPaneClickDistance:d}=Ee(J3,_e),x=we();g.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{p.current=Ci,c()}),[]);const p=g.useRef(Ci);return g.useEffect(()=>{for(const m of Ri){const f=e[m],h=p.current[m];f!==h&&(typeof e[m]>"u"||(m==="nodes"?t(f):m==="edges"?n(f):m==="minZoom"?s(f):m==="maxZoom"?r(f):m==="translateExtent"?i(f):m==="nodeExtent"?l(f):m==="paneClickDistance"?d(f):m==="fitView"?x.setState({fitViewOnInit:f}):m==="fitViewOptions"?x.setState({fitViewOnInitOptions:f}):x.setState({[m]:f})))}p.current=e},Ri.map(m=>e[m])),null}function bi(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function e5(e){var s;const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const r=bi(),i=()=>n(r!=null&&r.matches?"dark":"light");return i(),r==null||r.addEventListener("change",i),()=>{r==null||r.removeEventListener("change",i)}},[e]),t!==null?t:(s=bi())!=null&&s.matches?"dark":"light"}const wi=typeof document<"u"?document:null;function gn(e=null,t={target:wi,actInsideInputWithModifier:!0}){const[n,s]=g.useState(!1),r=g.useRef(!1),i=g.useRef(new Set([])),[l,c]=g.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 g.useEffect(()=>{const a=(t==null?void 0:t.target)||vi;if(e!==null){const d=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!t.actInsideInputWithModifier)&&Co(m))return!1;const h=ki(m.code,c);i.current.add(m[h]),Mi(l,i.current,!1)&&(m.preventDefault(),s(!0))},x=m=>{if((!r.current||r.current&&!t.actInsideInputWithModifier)&&Co(m))return!1;const h=ki(m.code,c);Mi(l,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(m[h]),m.key==="Meta"&&i.current.clear(),r.current=!1},p=()=>{i.current.clear(),s(!1)};return a==null||a.addEventListener("keydown",d),a==null||a.addEventListener("keyup",x),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{a==null||a.removeEventListener("keydown",d),a==null||a.removeEventListener("keyup",x),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,s]),n}function Mi(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function ki(e,t){return t.includes(e)?"code":"key"}const n5=()=>{const e=we();return g.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},fitView:t=>{const{nodeLookup:n,minZoom:s,maxZoom:r,panZoom:i,domNode:l}=e.getState();if(!i||!l)return Promise.resolve(!1);const c=yo(n,t),{width:a,height:d}=Ms(l);return So({nodes:c,width:a,height:d,minZoom:s,maxZoom:r,panZoom:i},t)},setCenter:async(t,n,s)=>{const{width:r,height:i,maxZoom:l,panZoom:c}=e.getState(),a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:l,d=r/2-t*a,x=i/2-n*a;return c?(await c.setViewport({x:d,y:x,zoom:a},{duration:s==null?void 0:s.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:l,panZoom:c}=e.getState(),a=dr(t,s,r,i,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(a,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:s,snapGrid:r,domNode:i}=e.getState();if(!i)return t;const{x:l,y:c}=i.getBoundingClientRect(),a={x:t.x-l,y:t.y-c};return bn(a,s,n.snapToGrid,r)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),l=Uc(t,n);return{x:l.x+r,y:l.y+i}}}),[])};function ba(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const l=s.get(i.id);l?l.push(i):s.set(i.id,[i])}for(const i of t){const l=s.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...i};for(const a of l)s5(a,c);n.push(c)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function s5(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={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function wa(e,t){return ba(e,t)}function va(e,t){return ba(e,t)}function Et(e,t){return{id:e,type:"select",selected:t}}function It(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const l=t.has(r);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),s.push(Et(i.id,l)))}return s}function _i({items:e=[],lookup:t}){var r;const n=[],s=new Map(e.map(i=>[i.id,i]));for(const[i,l]of e.entries()){const c=t.get(l.id),a=((r=c==null?void 0:c.internals)==null?void 0:r.userNode)??c;a!==void 0&&a!==l&&n.push({id:l.id,item:l,type:"replace"}),a===void 0&&n.push({item:l,type:"add",index:i})}for(const[i]of t)s.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function Pi(e){return{id:e.id,type:"remove"}}const Li=e=>z2(e),o5=e=>Gc(e);function Ma(e){return g.forwardRef(e)}const r5=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Ni(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>i5(()=>n(r=>r+BigInt(1))));return r5(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function i5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const ka=g.createContext(null);function l5({children:e}){const t=we(),n=g.useCallback(c=>{const{nodes:a=[],setNodes:d,hasDefaultNodes:x,onNodesChange:p,nodeLookup:m}=t.getState();let f=a;for(const h of c)f=typeof h=="function"?h(f):h;x?d(f):p&&p(_i({items:f,lookup:m}))},[]),s=Ni(n),r=g.useCallback(c=>{const{edges:a=[],setEdges:d,hasDefaultEdges:x,onEdgesChange:p,edgeLookup:m}=t.getState();let f=a;for(const h of c)f=typeof h=="function"?h(f):h;x?d(f):p&&p(_i({items:f,lookup:m}))},[]),i=Ni(r),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsxRuntimeExports.jsx(ka.Provider,{value:l,children:e})}function c5(){const e=g.useContext(ka);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const a5=e=>!!e.panZoom;function Pt(){const e=n5(),t=we(),n=c5(),s=Ee(a5),r=g.useMemo(()=>{const i=p=>t.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},a=p=>{var S,M;const{nodeLookup:m,nodeOrigin:f}=t.getState(),h=Li(p)?p:m.get(p.id),j=h.parentId?Qc(h.position,h.measured,h.parentId,m,f):h.position,y={...h,position:j,width:((S=h.measured)==null?void 0:S.width)??h.width,height:((M=h.measured)==null?void 0:M.height)??h.height};return Ht(y)},d=(p,m,f={replace:!1})=>{l(h=>h.map(j=>{if(j.id===p){const y=typeof m=="function"?m(j):m;return f.replace&&Li(y)?y:{...j,...y}}return j}))},x=(p,m,f={replace:!1})=>{c(h=>h.map(j=>{if(j.id===p){const y=typeof m=="function"?m(j):m;return f.replace&&o5(y)?y:{...j,...y}}return j}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var m;return(m=i(p))==null?void 0:m.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:c,addNodes:p=>{const m=Array.isArray(p)?p:[p];n.nodeQueue.push(f=>[...f,...m])},addEdges:p=>{const m=Array.isArray(p)?p:[p];n.edgeQueue.push(f=>[...f,...m])},toObject:()=>{const{nodes:p=[],edges:m=[],transform:f}=t.getState(),[h,j,y]=f;return{nodes:p.map(S=>({...S})),edges:m.map(S=>({...S})),viewport:{x:h,y:j,zoom:y}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:f,edges:h,onNodesDelete:j,onEdgesDelete:y,triggerNodeChanges:S,triggerEdgeChanges:M,onDelete:C,onBeforeDelete:b}=t.getState(),{nodes:w,edges:P}=await O2({nodesToRemove:p,edgesToRemove:m,nodes:f,edges:h,onBeforeDelete:b}),k=P.length>0,T=w.length>0;if(k){const A=P.map(Pi);y==null||y(P),M(A)}if(T){const A=w.map(Pi);j==null||j(w),S(A)}return(T||k)&&(C==null||C({nodes:w,edges:P})),{deletedNodes:w,deletedEdges:P}},getIntersectingNodes:(p,m=!0,f)=>{const h=oi(p),j=h?p:a(p),y=f!==void 0;return j?(f||t.getState().nodes).filter(S=>{const M=t.getState().nodeLookup.get(S.id);if(M&&!h&&(S.id===p.id||!M.internals.positionAbsolute))return!1;const C=Ht(y?S:M),b=fn(C,j);return m&&b>0||b>=j.width*j.height}):[]},isNodeIntersecting:(p,m,f=!0)=>{const j=oi(p)?p:a(p);if(!j)return!1;const y=fn(j,m);return f&&y>0||y>=j.width*j.height},updateNode:d,updateNodeData:(p,m,f={replace:!1})=>{d(p,h=>{const j=typeof m=="function"?m(h):m;return f.replace?{...h,data:j}:{...h,data:{...h.data,...j}}},f)},updateEdge:x,updateEdgeData:(p,m,f={replace:!1})=>{x(p,h=>{const j=typeof m=="function"?m(h):m;return f.replace?{...h,data:j}:{...h,data:{...h.data,...j}}},f)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:f}=t.getState();return B2(p,{nodeLookup:m,nodeOrigin:f})},getHandleConnections:({type:p,id:m,nodeId:f})=>{var h;return Array.from(((h=t.getState().connectionLookup.get(`${f}-${p}-${m??null}`))==null?void 0:h.values())??[])}}},[]);return g.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const Ti=e=>e.selected,u5={actInsideInputWithModifier:!1},d5=typeof window<"u"?window:void 0;function x5({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=we(),{deleteElements:s}=Pt(),r=gn(e,u5),i=gn(t,{target:d5});g.useEffect(()=>{if(r){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(Ti),edges:l.filter(Ti)}),n.setState({nodesSelectionActive:!1})}},[r]),g.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function p5(e){const t=we();g.useEffect(()=>{const n=()=>{var r,i;if(!e.current)return!1;const s=Ms(e.current);(s.height===0||s.width===0)&&((i=(r=t.getState()).onError)==null||i.call(r,"004",Ie.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Ps={position:"absolute",width:"100%",height:"100%",top:0,left:0},m5=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function f5({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=Rt.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:d,minZoom:x,maxZoom:p,zoomActivationKeyCode:m,preventScrolling:f=!0,children:h,noWheelClassName:j,noPanClassName:y,onViewportChange:S,isControlledViewport:M,paneClickDistance:C}){const b=we(),w=g.useRef(null),{userSelectionActive:P,lib:k}=Ee(m5,ke),T=gn(m),A=g.useRef();p5(w);const I=g.useCallback(F=>{S==null||S({x:F[0],y:F[1],zoom:F[2]}),M||b.setState({transform:F})},[S,M]);return g.useEffect(()=>{if(w.current){A.current=j3({domNode:w.current,minZoom:x,maxZoom:p,translateExtent:d,viewport:a,paneClickDistance:C,onDraggingChange:R=>b.setState({paneDragging:R}),onPanZoomStart:(R,N)=>{const{onViewportChangeStart:_,onMoveStart:D}=b.getState();D==null||D(R,N),_==null||_(N)},onPanZoom:(R,N)=>{const{onViewportChange:_,onMove:D}=b.getState();D==null||D(R,N),_==null||_(N)},onPanZoomEnd:(R,N)=>{const{onViewportChangeEnd:_,onMoveEnd:D}=b.getState();D==null||D(R,N),_==null||_(N)}});const{x:F,y:$,zoom:z}=A.current.getViewport();return b.setState({panZoom:A.current,transform:[F,$,z],domNode:w.current.closest(".react-flow")}),()=>{var R;(R=A.current)==null||R.destroy()}}},[]),g.useEffect(()=>{var F;(F=A.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:T,preventScrolling:f,noPanClassName:y,userSelectionActive:P,noWheelClassName:j,lib:k,onTransformChange:I})},[e,t,n,s,r,i,l,c,T,f,y,P,j,k,I]),o.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:w,style:Ps,children:h})}const h5=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function g5(){const{userSelectionActive:e,userSelectionRect:t}=Ee(h5,ke);return e&&t?o.jsxRuntimeExports.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const so=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},j5=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function E5({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Vt.Full,panOnDrag:s,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:a,onPaneScroll:d,onPaneMouseEnter:x,onPaneMouseMove:p,onPaneMouseLeave:m,children:f}){const h=g.useRef(null),j=we(),y=g.useRef(0),S=g.useRef(0),M=g.useRef(),C=g.useRef(new Map),{userSelectionActive:b,elementsSelectable:w,dragging:P}=Ee(j5,ke),k=w&&(e||b),T=g.useRef(!1),A=g.useRef(!1),I=()=>{j.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,S.current=0},F=L=>{if(T.current){T.current=!1;return}c==null||c(L),j.getState().resetSelectedElements(),j.setState({nodesSelectionActive:!1})},$=L=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){L.preventDefault();return}a==null||a(L)},z=d?L=>d(L):void 0,R=L=>{var ee,ne,se,ie;const{resetSelectedElements:V,domNode:H,edgeLookup:G}=j.getState();if(M.current=H==null?void 0:H.getBoundingClientRect(),!w||!e||L.button!==0||L.target!==h.current||!M.current)return;(ne=(ee=L.target)==null?void 0:ee.setPointerCapture)==null||ne.call(ee,L.pointerId),A.current=!0,T.current=!1,C.current=new Map;for(const[U,ue]of G)C.current.set(ue.source,((se=C.current.get(ue.source))==null?void 0:se.add(U))||new Set([U])),C.current.set(ue.target,((ie=C.current.get(ue.target))==null?void 0:ie.add(U))||new Set([U]));const{x:q,y:oe}=Qe(L.nativeEvent,M.current);V(),j.setState({userSelectionRect:{width:0,height:0,startX:q,startY:oe,x:q,y:oe}}),i==null||i(L)},N=L=>{const{userSelectionRect:V,edgeLookup:H,transform:G,nodeLookup:q,triggerNodeChanges:oe,triggerEdgeChanges:ee}=j.getState();if(!M.current||!V)return;T.current=!0;const{x:ne,y:se}=Qe(L.nativeEvent,M.current),{startX:ie,startY:U}=V,ue={startX:ie,startY:U,x:ne<ie?ne:ie,y:se<U?se:U,width:Math.abs(ne-ie),height:Math.abs(se-U)},ge=Yc(q,ue,G,n===Vt.Partial,!0),pe=new Set,re=new Set;for(const Q of ge){re.add(Q.id);const le=C.current.get(Q.id);if(le)for(const je of le)pe.add(je)}if(y.current!==re.size){y.current=re.size;const Q=It(q,re,!0);oe(Q)}if(S.current!==pe.size){S.current=pe.size;const Q=It(H,pe);ee(Q)}j.setState({userSelectionRect:ue,userSelectionActive:!0,nodesSelectionActive:!1})},_=L=>{var H,G;if(L.button!==0||!A.current)return;(G=(H=L.target)==null?void 0:H.releasePointerCapture)==null||G.call(H,L.pointerId);const{userSelectionRect:V}=j.getState();!b&&V&&L.target===h.current&&(F==null||F(L)),y.current>0&&j.setState({nodesSelectionActive:!0}),I(),l==null||l(L),(t||r)&&(T.current=!1),A.current=!1},D=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxRuntimeExports.jsxs("div",{className:_e(["react-flow__pane",{draggable:D,dragging:P,selection:e}]),onClick:k?void 0:so(F,h),onContextMenu:so($,h),onWheel:so(z,h),onPointerEnter:k?void 0:x,onPointerDown:k?R:p,onPointerMove:k?N:p,onPointerUp:k?_:void 0,onPointerLeave:m,ref:h,style:Ps,children:[f,o.jsxRuntimeExports.jsx(g5,{})]})}function ko({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:c,onError:a}=t.getState(),d=c.get(e);if(!d){a==null||a("012",Ie.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var x;return(x=s==null?void 0:s.current)==null?void 0:x.blur()})):r([e])}function _a({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:l}){const c=we(),[a,d]=g.useState(!1),x=g.useRef();return g.useEffect(()=>{x.current=o3({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{ko({id:p,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),g.useEffect(()=>{var p,m;if(t)(p=x.current)==null||p.destroy();else if(e.current)return(m=x.current)==null||m.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:l}),()=>{var f;(f=x.current)==null||f.destroy()}},[n,s,t,i,e,r]),a}const y5=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Pa(){const e=we();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:l,onError:c,updateNodePositions:a,nodeLookup:d,nodeOrigin:x}=e.getState(),p=new Map,m=y5(l),f=r?i[0]:5,h=r?i[1]:5,j=n.direction.x*f*n.factor,y=n.direction.y*h*n.factor;for(const[,S]of d){if(!m(S))continue;let M={x:S.internals.positionAbsolute.x+j,y:S.internals.positionAbsolute.y+y};r&&(M=vs(M,i));const{position:C,positionAbsolute:b}=Wc({nodeId:S.id,nextPosition:M,nodeLookup:d,nodeExtent:s,nodeOrigin:x,onError:c});S.position=C,S.internals.positionAbsolute=b,p.set(S.id,S)}a(p)},[])}const gr=g.createContext(null),S5=gr.Provider;gr.Consumer;const La=()=>g.useContext(gr),R5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),C5=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:l}=s,{fromHandle:c,toHandle:a,isValid:d}=l,x=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:x,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:i===Mt.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,valid:x&&d}};function b5({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:l,onConnect:c,children:a,className:d,onMouseDown:x,onTouchStart:p,...m},f){var R,N;const h=l||null,j=e==="target",y=we(),S=La(),{connectOnClick:M,noPanClassName:C,rfId:b}=Ee(R5,ke),{connectingFrom:w,connectingTo:P,clickConnecting:k,isPossibleEndHandle:T,connectionInProcess:A,valid:I}=Ee(C5(S,h,e),ke);S||(N=(R=y.getState()).onError)==null||N.call(R,"010",Ie.error010());const F=_=>{const{defaultEdgeOptions:D,onConnect:L,hasDefaultEdges:V}=y.getState(),H={...D,..._};if(V){const{edges:G,setEdges:q}=y.getState();q(ia(H,G))}L==null||L(H),c==null||c(H)},$=_=>{if(!S)return;const D=ta(_.nativeEvent);if(r&&(D&&_.button===0||!D)){const L=y.getState();Mo.onPointerDown(_.nativeEvent,{autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:j,handleId:h,nodeId:S,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:L.onConnectEnd,updateConnection:L.updateConnection,onConnect:F,isValidConnection:n||L.isValidConnection,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed})}D?x==null||x(_):p==null||p(_)},z=_=>{const{onClickConnectStart:D,onClickConnectEnd:L,connectionClickStartHandle:V,connectionMode:H,isValidConnection:G,lib:q,rfId:oe,nodeLookup:ee,connection:ne}=y.getState();if(!S||!V&&!r)return;if(!V){D==null||D(_.nativeEvent,{nodeId:S,handleId:h,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:S,type:e,id:h}});return}const se=ea(_.target),ie=n||G,{connection:U,isValid:ue}=Mo.isValid(_.nativeEvent,{handle:{nodeId:S,id:h,type:e},connectionMode:H,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:ie,flowId:oe,doc:se,lib:q,nodeLookup:ee});ue&&U&&F(U);const ge=structuredClone(ne);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,L==null||L(_,ge),y.setState({connectionClickStartHandle:null})};return o.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":S,"data-handlepos":t,"data-id":`${b}-${S}-${h}-${e}`,className:_e(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",C,d,{source:!j,target:j,connectable:s,connectablestart:r,connectableend:i,clickconnecting:k,connectingfrom:w,connectingto:P,valid:I,connectionindicator:s&&(!A||T)&&(A?i:r)}]),onMouseDown:$,onTouchStart:$,onClick:M?z:void 0,ref:f,...m,children:a})}const jn=g.memo(Ma(b5));function w5({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e==null?void 0:e.label,o.jsxRuntimeExports.jsx(jn,{type:"source",position:n,isConnectable:t})]})}function v5({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:s=X.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(jn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsxRuntimeExports.jsx(jn,{type:"source",position:s,isConnectable:t})]})}function M5(){return null}function k5({data:e,isConnectable:t,targetPosition:n=X.Top}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(jn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ds={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ai={input:w5,default:v5,output:k5,group:M5};function _5(e){var t,n,s,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const P5=e=>{const{width:t,height:n,x:s,y:r}=Cn(e.nodeLookup,{filter:i=>!!i.selected});return{width:Oe(t)?t:null,height:Oe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function L5({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=we(),{width:r,height:i,transformString:l,userSelectionActive:c}=Ee(P5,ke),a=Pa(),d=g.useRef(null);if(g.useEffect(()=>{var m;n||(m=d.current)==null||m.focus({preventScroll:!0})},[n]),_a({nodeRef:d}),c||!r||!i)return null;const x=e?m=>{const f=s.getState().nodes.filter(h=>h.selected);e(m,f)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(ds,m.key)&&(m.preventDefault(),a({direction:ds[m.key],factor:m.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:_e(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:o.jsxRuntimeExports.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:r,height:i}})})}const Ii=typeof window<"u"?window:void 0,N5=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Na({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:a,selectionKeyCode:d,selectionOnDrag:x,selectionMode:p,onSelectionStart:m,onSelectionEnd:f,multiSelectionKeyCode:h,panActivationKeyCode:j,zoomActivationKeyCode:y,elementsSelectable:S,zoomOnScroll:M,zoomOnPinch:C,panOnScroll:b,panOnScrollSpeed:w,panOnScrollMode:P,zoomOnDoubleClick:k,panOnDrag:T,defaultViewport:A,translateExtent:I,minZoom:F,maxZoom:$,preventScrolling:z,onSelectionContextMenu:R,noWheelClassName:N,noPanClassName:_,disableKeyboardA11y:D,onViewportChange:L,isControlledViewport:V}){const{nodesSelectionActive:H,userSelectionActive:G}=Ee(N5),q=gn(d,{target:Ii}),oe=gn(j,{target:Ii}),ee=oe||T,ne=oe||b,se=x&&ee!==!0,ie=q||G||se;return x5({deleteKeyCode:a,multiSelectionKeyCode:h}),o.jsxRuntimeExports.jsx(f5,{onPaneContextMenu:i,elementsSelectable:S,zoomOnScroll:M,zoomOnPinch:C,panOnScroll:ne,panOnScrollSpeed:w,panOnScrollMode:P,zoomOnDoubleClick:k,panOnDrag:!q&&ee,defaultViewport:A,translateExtent:I,minZoom:F,maxZoom:$,zoomActivationKeyCode:y,preventScrolling:z,noWheelClassName:N,noPanClassName:_,onViewportChange:L,isControlledViewport:V,paneClickDistance:c,children:o.jsxRuntimeExports.jsxs(E5,{onSelectionStart:m,onSelectionEnd:f,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:ee,isSelecting:!!ie,selectionMode:p,selectionKeyPressed:q,selectionOnDrag:se,children:[e,H&&o.jsxRuntimeExports.jsx(L5,{onSelectionContextMenu:R,noPanClassName:_,disableKeyboardA11y:D})]})})}Na.displayName="FlowRenderer";const T5=g.memo(Na),A5=e=>t=>e?Yc(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 I5(e){return Ee(g.useCallback(A5(e),[e]),ke)}const $5=e=>e.updateNodeInternals;function z5(){const e=Ee($5),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function B5({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=we(),i=g.useRef(null),l=g.useRef(null),c=g.useRef(e.sourcePosition),a=g.useRef(e.targetPosition),d=g.useRef(t),x=n&&!!e.internals.handleBounds;return g.useEffect(()=>{i.current&&!e.hidden&&(!x||l.current!==i.current)&&(l.current&&(s==null||s.unobserve(l.current)),s==null||s.observe(i.current),l.current=i.current)},[x,e.hidden]),g.useEffect(()=>()=>{l.current&&(s==null||s.unobserve(l.current),l.current=null)},[]),g.useEffect(()=>{if(i.current){const p=d.current!==t,m=c.current!==e.sourcePosition,f=a.current!==e.targetPosition;(p||m||f)&&(d.current=t,c.current=e.sourcePosition,a.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function D5({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:l,nodesDraggable:c,elementsSelectable:a,nodesConnectable:d,nodesFocusable:x,resizeObserver:p,noDragClassName:m,noPanClassName:f,disableKeyboardA11y:h,rfId:j,nodeTypes:y,nodeExtent:S,nodeClickDistance:M,onError:C}){const{node:b,internals:w,isParent:P}=Ee(U=>{const ue=U.nodeLookup.get(e),ge=U.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:ge}},ke);let k=b.type||"default",T=(y==null?void 0:y[k])||Ai[k];T===void 0&&(C==null||C("003",Ie.error003(k)),k="default",T=Ai.default);const A=!!(b.draggable||c&&typeof b.draggable>"u"),I=!!(b.selectable||a&&typeof b.selectable>"u"),F=!!(b.connectable||d&&typeof b.connectable>"u"),$=!!(b.focusable||x&&typeof b.focusable>"u"),z=we(),R=Jc(b),N=B5({node:b,nodeType:k,hasDimensions:R,resizeObserver:p}),_=_a({nodeRef:N,disabled:b.hidden||!A,noDragClassName:m,handleSelector:b.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:M}),D=Pa();if(b.hidden)return null;const L=st(b),V=_5(b),H=I||A||t||n||s||r,G=n?U=>n(U,{...w.userNode}):void 0,q=s?U=>s(U,{...w.userNode}):void 0,oe=r?U=>r(U,{...w.userNode}):void 0,ee=i?U=>i(U,{...w.userNode}):void 0,ne=l?U=>l(U,{...w.userNode}):void 0,se=U=>{const{selectNodesOnDrag:ue,nodeDragThreshold:ge}=z.getState();I&&(!ue||!A||ge>0)&&ko({id:e,store:z,nodeRef:N}),t&&t(U,{...w.userNode})},ie=U=>{if(!(Co(U.nativeEvent)||h))if(Fc.includes(U.key)&&I){const ue=U.key==="Escape";ko({id:e,store:z,unselect:ue,nodeRef:N})}else A&&b.selected&&Object.prototype.hasOwnProperty.call(ds,U.key)&&(U.preventDefault(),z.setState({ariaLiveMessage:`Moved selected node ${U.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~w.positionAbsolute.x}, y: ${~~w.positionAbsolute.y}`}),D({direction:ds[U.key],factor:U.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:_e(["react-flow__node",`react-flow__node-${k}`,{[f]:A},b.className,{selected:b.selected,selectable:I,parent:P,draggable:A,dragging:_}]),ref:N,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:R?"visible":"hidden",...b.style,...V},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:G,onMouseMove:q,onMouseLeave:oe,onContextMenu:ee,onClick:se,onDoubleClick:ne,onKeyDown:$?ie:void 0,tabIndex:$?0:void 0,role:$?"button":void 0,"aria-describedby":h?void 0:`${Sa}-${j}`,"aria-label":b.ariaLabel,children:o.jsxRuntimeExports.jsx(S5,{value:e,children:o.jsxRuntimeExports.jsx(T,{id:e,data:b.data,type:k,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:b.selected,selectable:I,draggable:A,deletable:b.deletable??!0,isConnectable:F,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:_,dragHandle:b.dragHandle,zIndex:w.z,parentId:b.parentId,...L})})})}const O5=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Ta(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=Ee(O5,ke),l=I5(e.onlyRenderVisibleElements),c=z5();return o.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ps,children:l.map(a=>o.jsxRuntimeExports.jsx(D5,{id:a,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:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}Ta.displayName="NodeRenderer";const V5=g.memo(Ta);function F5(e){return Ee(g.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);i&&l&&H2({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),ke)}const H5=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),Z5=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),$i={[ls.Arrow]:H5,[ls.ArrowClosed]:Z5};function G5(e){const t=we();return g.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call($i,e)?$i[e]:((i=(r=t.getState()).onError)==null||i.call(r,"009",Ie.error009(e)),null)},[e])}const Y5=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const a=G5(t);return a?o.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:c,refX:"0",refY:"0",children:o.jsxRuntimeExports.jsx(a,{color:n,strokeWidth:l})}):null},Aa=({defaultColor:e,rfId:t})=>{const n=Ee(i=>i.edges),s=Ee(i=>i.defaultEdgeOptions),r=g.useMemo(()=>q2(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return r.length?o.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker",children:o.jsxRuntimeExports.jsx("defs",{children:r.map(i=>o.jsxRuntimeExports.jsx(Y5,{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};Aa.displayName="MarkerDefinitions";var W5=g.memo(Aa);function Ia({x:e,y:t,label:n,labelStyle:s={},labelShowBg:r=!0,labelBgStyle:i={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:a,className:d,...x}){const[p,m]=g.useState({x:1,y:0,width:0,height:0}),f=_e(["react-flow__edge-textwrapper",d]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const j=h.current.getBBox();m({x:j.x,y:j.y,width:j.width,height:j.height})}},[n]),typeof n>"u"||!n?null:o.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:f,visibility:p.width?"visible":"hidden",...x,children:[r&&o.jsxRuntimeExports.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:c,ry:c}),o.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:h,style:s,children:n}),a]})}Ia.displayName="EdgeText";const K5=g.memo(Ia);function Ve({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a,interactionWidth:d=20,...x}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{...x,d:e,fill:"none",className:_e(["react-flow__edge-path",x.className])}),d&&o.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),s&&Oe(t)&&Oe(n)?o.jsxRuntimeExports.jsx(K5,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a}):null]})}function zi({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===X.Left||e===X.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function $a({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top}){const[l,c]=zi({pos:n,x1:e,y1:t,x2:s,y2:r}),[a,d]=zi({pos:i,x1:s,y1:r,x2:e,y2:t}),[x,p,m,f]=na({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:a,targetControlY:d});return[`M${e},${t} C${l},${c} ${a},${d} ${s},${r}`,x,p,m,f]}function za(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=X.Bottom,targetPosition:c=X.Top,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:y,interactionWidth:S})=>{const[M,C,b]=$a({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:c}),w=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:w,path:M,labelX:C,labelY:b,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:y,interactionWidth:S})})}const X5=za({isInternal:!1}),Ba=za({isInternal:!0});X5.displayName="SimpleBezierEdge";Ba.displayName="SimpleBezierEdgeInternal";function Da(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,sourcePosition:f=X.Bottom,targetPosition:h=X.Top,markerEnd:j,markerStart:y,pathOptions:S,interactionWidth:M})=>{const[C,b,w]=bo({sourceX:n,sourceY:s,sourcePosition:f,targetX:r,targetY:i,targetPosition:h,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset}),P=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:P,path:C,labelX:b,labelY:w,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:j,markerStart:y,interactionWidth:M})})}const Oa=Da({isInternal:!1}),Va=Da({isInternal:!0});Oa.displayName="SmoothStepEdge";Va.displayName="SmoothStepEdgeInternal";function Fa(e){return g.memo(({id:t,...n})=>{var r;const s=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Oa,{...n,id:s,pathOptions:g.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const q5=Fa({isInternal:!1}),Ha=Fa({isInternal:!0});q5.displayName="StepEdge";Ha.displayName="StepEdgeInternal";function Za(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:f,markerStart:h,interactionWidth:j})=>{const[y,S,M]=la({sourceX:n,sourceY:s,targetX:r,targetY:i}),C=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:C,path:y,labelX:S,labelY:M,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:f,markerStart:h,interactionWidth:j})})}const U5=Za({isInternal:!1}),Ga=Za({isInternal:!0});U5.displayName="StraightEdge";Ga.displayName="StraightEdgeInternal";function Ya(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=X.Bottom,targetPosition:c=X.Top,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:y,pathOptions:S,interactionWidth:M})=>{const[C,b,w]=sa({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:c,curvature:S==null?void 0:S.curvature}),P=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:P,path:C,labelX:b,labelY:w,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:j,markerStart:y,interactionWidth:M})})}const J5=Ya({isInternal:!1}),Wa=Ya({isInternal:!0});J5.displayName="BezierEdge";Wa.displayName="BezierEdgeInternal";const Bi={default:Wa,straight:Ga,step:Ha,smoothstep:Va,simplebezier:Ba},Di={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Q5=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,eE=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,Oi="react-flow__edgeupdater";function Vi({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:l,type:c}){return o.jsxRuntimeExports.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:l,className:_e([Oi,`${Oi}-${c}`]),cx:Q5(t,s,e),cy:eE(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function tE({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:l,sourcePosition:c,targetPosition:a,onReconnect:d,onReconnectStart:x,onReconnectEnd:p,setReconnecting:m,setUpdateHover:f}){const h=we(),j=(b,w)=>{if(b.button!==0)return;const{autoPanOnConnect:P,domNode:k,isValidConnection:T,connectionMode:A,connectionRadius:I,lib:F,onConnectStart:$,onConnectEnd:z,cancelConnection:R,nodeLookup:N,rfId:_,panBy:D,updateConnection:L}=h.getState(),V=w.type==="target";m(!0),x==null||x(b,n,w.type);const H=(q,oe)=>{m(!1),p==null||p(q,n,w.type,oe)},G=q=>d==null?void 0:d(n,q);Mo.onPointerDown(b.nativeEvent,{autoPanOnConnect:P,connectionMode:A,connectionRadius:I,domNode:k,handleId:w.id,nodeId:w.nodeId,nodeLookup:N,isTarget:V,edgeUpdaterType:w.type,lib:F,flowId:_,cancelConnection:R,panBy:D,isValidConnection:T,onConnect:G,onConnectStart:$,onConnectEnd:z,onReconnectEnd:H,updateConnection:L,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle})},y=b=>j(b,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=b=>j(b,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),M=()=>f(!0),C=()=>f(!1);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&o.jsxRuntimeExports.jsx(Vi,{position:c,centerX:s,centerY:r,radius:t,onMouseDown:y,onMouseEnter:M,onMouseOut:C,type:"source"}),(e===!0||e==="target")&&o.jsxRuntimeExports.jsx(Vi,{position:a,centerX:i,centerY:l,radius:t,onMouseDown:S,onMouseEnter:M,onMouseOut:C,type:"target"})]})}function nE({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:d,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:f,rfId:h,edgeTypes:j,noPanClassName:y,onError:S,disableKeyboardA11y:M}){let C=Ee(re=>re.edgeLookup.get(e));const b=Ee(re=>re.defaultEdgeOptions);C=b?{...b,...C}:C;let w=C.type||"default",P=(j==null?void 0:j[w])||Bi[w];P===void 0&&(S==null||S("011",Ie.error011(w)),w="default",P=Bi.default);const k=!!(C.focusable||t&&typeof C.focusable>"u"),T=typeof p<"u"&&(C.reconnectable||n&&typeof C.reconnectable>"u"),A=!!(C.selectable||s&&typeof C.selectable>"u"),I=g.useRef(null),[F,$]=g.useState(!1),[z,R]=g.useState(!1),N=we(),{zIndex:_,sourceX:D,sourceY:L,targetX:V,targetY:H,sourcePosition:G,targetPosition:q}=Ee(g.useCallback(re=>{const Q=re.nodeLookup.get(C.source),le=re.nodeLookup.get(C.target);if(!Q||!le)return{zIndex:C.zIndex,...Di};const je=X2({id:e,sourceNode:Q,targetNode:le,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:re.connectionMode,onError:S});return{zIndex:F2({selected:C.selected,zIndex:C.zIndex,sourceNode:Q,targetNode:le,elevateOnSelect:re.elevateEdgesOnSelect}),...je||Di}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),ke),oe=g.useMemo(()=>C.markerStart?`url('#${wo(C.markerStart,h)}')`:void 0,[C.markerStart,h]),ee=g.useMemo(()=>C.markerEnd?`url('#${wo(C.markerEnd,h)}')`:void 0,[C.markerEnd,h]);if(C.hidden||D===null||L===null||V===null||H===null)return null;const ne=re=>{var Pe;const{addSelectedEdges:Q,unselectNodesAndEdges:le,multiSelectionActive:je}=N.getState();A&&(N.setState({nodesSelectionActive:!1}),C.selected&&je?(le({nodes:[],edges:[C]}),(Pe=I.current)==null||Pe.blur()):Q([e])),r&&r(re,C)},se=i?re=>{i(re,{...C})}:void 0,ie=l?re=>{l(re,{...C})}:void 0,U=c?re=>{c(re,{...C})}:void 0,ue=a?re=>{a(re,{...C})}:void 0,ge=d?re=>{d(re,{...C})}:void 0,pe=re=>{var Q;if(!M&&Fc.includes(re.key)&&A){const{unselectNodesAndEdges:le,addSelectedEdges:je}=N.getState();re.key==="Escape"?((Q=I.current)==null||Q.blur(),le({edges:[C]})):je([e])}};return o.jsxRuntimeExports.jsx("svg",{style:{zIndex:_},children:o.jsxRuntimeExports.jsxs("g",{className:_e(["react-flow__edge",`react-flow__edge-${w}`,C.className,y,{selected:C.selected,animated:C.animated,inactive:!A&&!r,updating:F,selectable:A}]),onClick:ne,onDoubleClick:se,onContextMenu:ie,onMouseEnter:U,onMouseMove:ue,onMouseLeave:ge,onKeyDown:k?pe:void 0,tabIndex:k?0:void 0,role:k?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":k?`${Ra}-${h}`:void 0,ref:I,children:[!z&&o.jsxRuntimeExports.jsx(P,{id:e,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:A,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:D,sourceY:L,targetX:V,targetY:H,sourcePosition:G,targetPosition:q,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:oe,markerEnd:ee,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),T&&o.jsxRuntimeExports.jsx(tE,{edge:C,isReconnectable:T,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:f,sourceX:D,sourceY:L,targetX:V,targetY:H,sourcePosition:G,targetPosition:q,setUpdateHover:$,setReconnecting:R})]})})}const sE=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Ka({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:a,onEdgeMouseLeave:d,onEdgeClick:x,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:f,onReconnectEnd:h,disableKeyboardA11y:j}){const{edgesFocusable:y,edgesReconnectable:S,elementsSelectable:M,onError:C}=Ee(sE,ke),b=F5(t);return o.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[o.jsxRuntimeExports.jsx(W5,{defaultColor:e,rfId:n}),b.map(w=>o.jsxRuntimeExports.jsx(nE,{id:w,edgesFocusable:y,edgesReconnectable:S,elementsSelectable:M,noPanClassName:r,onReconnect:i,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:d,onClick:x,reconnectRadius:p,onDoubleClick:m,onReconnectStart:f,onReconnectEnd:h,rfId:n,onError:C,edgeTypes:s,disableKeyboardA11y:j},w))]})}Ka.displayName="EdgeRenderer";const oE=g.memo(Ka),rE=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function iE({children:e}){const t=Ee(rE);return o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function lE(e){const t=Pt(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const cE=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function aE(e){const t=Ee(cE),n=we();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function uE(e){return e.connection.inProgress?{...e.connection,to:bn(e.connection.to,e.transform)}:{...e.connection}}function dE(e){return uE}function xE(e){const t=dE();return Ee(t,ke)}const pE=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function mE({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:l,isValid:c,inProgress:a}=Ee(pE,ke);return!(i&&r&&a)?null:o.jsxRuntimeExports.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:o.jsxRuntimeExports.jsx("g",{className:_e(["react-flow__connection",Zc(c)]),children:o.jsxRuntimeExports.jsx(Xa,{style:t,type:n,CustomComponent:s,isValid:c})})})}const Xa=({style:e,type:t=lt.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:l,fromHandle:c,fromPosition:a,to:d,toNode:x,toHandle:p,toPosition:m}=xE();if(!r)return;if(n)return o.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:a,toPosition:m,connectionStatus:Zc(s),toNode:x,toHandle:p});let f="";const h={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:d.x,targetY:d.y,targetPosition:m};switch(t){case lt.Bezier:[f]=sa(h);break;case lt.SimpleBezier:[f]=$a(h);break;case lt.Step:[f]=bo({...h,borderRadius:0});break;case lt.SmoothStep:[f]=bo(h);break;default:[f]=la(h)}return o.jsxRuntimeExports.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:e})};Xa.displayName="ConnectionLine";const fE={};function Fi(e=fE){const t=g.useRef(e),n=we();g.useEffect(()=>{var s,r;if(process.env.NODE_ENV==="development"){const i=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const l of i)if(t.current[l]!==e[l]){(r=(s=n.getState()).onError)==null||r.call(s,"002",Ie.error002());break}t.current=e}},[e])}function hE(){const e=we(),t=g.useRef(!1);g.useEffect(()=>{var n,s;if(process.env.NODE_ENV==="development"&&!t.current){const r=document.querySelector(".react-flow__pane");r&&window.getComputedStyle(r).zIndex!=="1"&&((s=(n=e.getState()).onError)==null||s.call(n,"013",Ie.error013("react"))),t.current=!0}},[])}function qa({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:d,onNodeContextMenu:x,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:f,connectionLineType:h,connectionLineStyle:j,connectionLineComponent:y,connectionLineContainerStyle:S,selectionKeyCode:M,selectionOnDrag:C,selectionMode:b,multiSelectionKeyCode:w,panActivationKeyCode:P,zoomActivationKeyCode:k,deleteKeyCode:T,onlyRenderVisibleElements:A,elementsSelectable:I,defaultViewport:F,translateExtent:$,minZoom:z,maxZoom:R,preventScrolling:N,defaultMarkerColor:_,zoomOnScroll:D,zoomOnPinch:L,panOnScroll:V,panOnScrollSpeed:H,panOnScrollMode:G,zoomOnDoubleClick:q,panOnDrag:oe,onPaneClick:ee,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:ie,onPaneScroll:U,onPaneContextMenu:ue,paneClickDistance:ge,nodeClickDistance:pe,onEdgeContextMenu:re,onEdgeMouseEnter:Q,onEdgeMouseMove:le,onEdgeMouseLeave:je,reconnectRadius:Pe,onReconnect:qe,onReconnectStart:Is,onReconnectEnd:$s,noDragClassName:Xt,noWheelClassName:zs,noPanClassName:qt,disableKeyboardA11y:Ut,nodeExtent:Bs,rfId:Jt,viewport:Qt,onViewportChange:vn}){return Fi(e),Fi(t),hE(),lE(n),aE(Qt),o.jsxRuntimeExports.jsx(T5,{onPaneClick:ee,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:ie,onPaneContextMenu:ue,onPaneScroll:U,paneClickDistance:ge,deleteKeyCode:T,selectionKeyCode:M,selectionOnDrag:C,selectionMode:b,onSelectionStart:m,onSelectionEnd:f,multiSelectionKeyCode:w,panActivationKeyCode:P,zoomActivationKeyCode:k,elementsSelectable:I,zoomOnScroll:D,zoomOnPinch:L,zoomOnDoubleClick:q,panOnScroll:V,panOnScrollSpeed:H,panOnScrollMode:G,panOnDrag:oe,defaultViewport:F,translateExtent:$,minZoom:z,maxZoom:R,onSelectionContextMenu:p,preventScrolling:N,noDragClassName:Xt,noWheelClassName:zs,noPanClassName:qt,disableKeyboardA11y:Ut,onViewportChange:vn,isControlledViewport:!!Qt,children:o.jsxRuntimeExports.jsxs(iE,{children:[o.jsxRuntimeExports.jsx(oE,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:qe,onReconnectStart:Is,onReconnectEnd:$s,onlyRenderVisibleElements:A,onEdgeContextMenu:re,onEdgeMouseEnter:Q,onEdgeMouseMove:le,onEdgeMouseLeave:je,reconnectRadius:Pe,defaultMarkerColor:_,noPanClassName:qt,disableKeyboardA11y:Ut,rfId:Jt}),o.jsxRuntimeExports.jsx(mE,{style:j,type:h,component:y,containerStyle:S}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsxRuntimeExports.jsx(V5,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:d,onNodeContextMenu:x,nodeClickDistance:pe,onlyRenderVisibleElements:A,noPanClassName:qt,noDragClassName:Xt,disableKeyboardA11y:Ut,nodeExtent:Bs,rfId:Jt}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}qa.displayName="GraphView";const gE=g.memo(qa),Hi=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a}={})=>{const d=new Map,x=new Map,p=new Map,m=new Map,f=s??t??[],h=n??e??[],j=c??[0,0],y=a??mn;aa(p,m,f),vo(h,d,x,{nodeOrigin:j,nodeExtent:y,elevateNodesOnSelect:!1});let S=[0,0,1];if(l&&r&&i){const M=Cn(d,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:C,y:b,zoom:w}=dr(M,r,i,.5,2,.1);S=[C,b,w]}return{rfId:"1",width:0,height:0,transform:S,nodes:h,nodeLookup:d,parentLookup:x,edges:f,edgeLookup:m,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:mn,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Mt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:j,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...Hc},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:as,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},jE=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a})=>z3((d,x)=>({...Hi({nodes:e,edges:t,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a,defaultNodes:n,defaultEdges:s}),setNodes:p=>{const{nodeLookup:m,parentLookup:f,nodeOrigin:h,elevateNodesOnSelect:j}=x();vo(p,m,f,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:j,checkEquality:!0}),d({nodes:p})},setEdges:p=>{const{connectionLookup:m,edgeLookup:f}=x();aa(m,f,p),d({edges:p})},setDefaultNodesAndEdges:(p,m)=>{if(p){const{setNodes:f}=x();f(p),d({hasDefaultNodes:!0})}if(m){const{setEdges:f}=x();f(m),d({hasDefaultEdges:!0})}},updateNodeInternals:(p,m={triggerFitView:!0})=>{const{triggerNodeChanges:f,nodeLookup:h,parentLookup:j,fitViewOnInit:y,fitViewDone:S,fitViewOnInitOptions:M,domNode:C,nodeOrigin:b,nodeExtent:w,debug:P,fitViewSync:k}=x(),{changes:T,updatedInternals:A}=t3(p,h,j,C,b,w);if(A){if(J2(h,j,{nodeOrigin:b,nodeExtent:w}),m.triggerFitView){let I=S;!S&&y&&(I=k({...M,nodes:M==null?void 0:M.nodes})),d({fitViewDone:I})}else d({});(T==null?void 0:T.length)>0&&(P&&console.log("React Flow: trigger node changes",T),f==null||f(T))}},updateNodePositions:(p,m=!1)=>{const f=[],h=[];for(const[j,y]of p){const S=!!(y!=null&&y.expandParent&&(y!=null&&y.parentId)&&(y!=null&&y.position)),M={id:j,type:"position",position:S?{x:Math.max(0,y.position.x),y:Math.max(0,y.position.y)}:y.position,dragging:m};S&&f.push({id:j,parentId:y.parentId,rect:{...y.internals.positionAbsolute,width:y.measured.width,height:y.measured.height}}),h.push(M)}if(f.length>0){const{nodeLookup:j,parentLookup:y,nodeOrigin:S}=x(),M=fr(f,j,y,S);h.push(...M)}x().triggerNodeChanges(h)},triggerNodeChanges:p=>{const{onNodesChange:m,setNodes:f,nodes:h,hasDefaultNodes:j,debug:y}=x();if(p!=null&&p.length){if(j){const S=wa(p,h);f(S)}y&&console.log("React Flow: trigger node changes",p),m==null||m(p)}},triggerEdgeChanges:p=>{const{onEdgesChange:m,setEdges:f,edges:h,hasDefaultEdges:j,debug:y}=x();if(p!=null&&p.length){if(j){const S=va(p,h);f(S)}y&&console.log("React Flow: trigger edge changes",p),m==null||m(p)}},addSelectedNodes:p=>{const{multiSelectionActive:m,edgeLookup:f,nodeLookup:h,triggerNodeChanges:j,triggerEdgeChanges:y}=x();if(m){const S=p.map(M=>Et(M,!0));j(S);return}j(It(h,new Set([...p]),!0)),y(It(f))},addSelectedEdges:p=>{const{multiSelectionActive:m,edgeLookup:f,nodeLookup:h,triggerNodeChanges:j,triggerEdgeChanges:y}=x();if(m){const S=p.map(M=>Et(M,!0));y(S);return}y(It(f,new Set([...p]))),j(It(h,new Set,!0))},unselectNodesAndEdges:({nodes:p,edges:m}={})=>{const{edges:f,nodes:h,nodeLookup:j,triggerNodeChanges:y,triggerEdgeChanges:S}=x(),M=p||h,C=m||f,b=M.map(P=>{const k=j.get(P.id);return k&&(k.selected=!1),Et(P.id,!1)}),w=C.map(P=>Et(P.id,!1));y(b),S(w)},setMinZoom:p=>{const{panZoom:m,maxZoom:f}=x();m==null||m.setScaleExtent([p,f]),d({minZoom:p})},setMaxZoom:p=>{const{panZoom:m,minZoom:f}=x();m==null||m.setScaleExtent([f,p]),d({maxZoom:p})},setTranslateExtent:p=>{var m;(m=x().panZoom)==null||m.setTranslateExtent(p),d({translateExtent:p})},setPaneClickDistance:p=>{var m;(m=x().panZoom)==null||m.setClickDistance(p)},resetSelectedElements:()=>{const{edges:p,nodes:m,triggerNodeChanges:f,triggerEdgeChanges:h}=x(),j=m.reduce((S,M)=>M.selected?[...S,Et(M.id,!1)]:S,[]),y=p.reduce((S,M)=>M.selected?[...S,Et(M.id,!1)]:S,[]);f(j),h(y)},setNodeExtent:p=>{const{nodes:m,nodeLookup:f,parentLookup:h,nodeOrigin:j,elevateNodesOnSelect:y,nodeExtent:S}=x();p[0][0]===S[0][0]&&p[0][1]===S[0][1]&&p[1][0]===S[1][0]&&p[1][1]===S[1][1]||(vo(m,f,h,{nodeOrigin:j,nodeExtent:p,elevateNodesOnSelect:y,checkEquality:!1}),d({nodeExtent:p}))},panBy:p=>{const{transform:m,width:f,height:h,panZoom:j,translateExtent:y}=x();return n3({delta:p,panZoom:j,transform:m,translateExtent:y,width:f,height:h})},fitView:p=>{const{panZoom:m,width:f,height:h,minZoom:j,maxZoom:y,nodeLookup:S}=x();if(!m)return Promise.resolve(!1);const M=yo(S,p);return So({nodes:M,width:f,height:h,panZoom:m,minZoom:j,maxZoom:y},p)},fitViewSync:p=>{const{panZoom:m,width:f,height:h,minZoom:j,maxZoom:y,nodeLookup:S}=x();if(!m)return!1;const M=yo(S,p);return So({nodes:M,width:f,height:h,panZoom:m,minZoom:j,maxZoom:y},p),M.size>0},cancelConnection:()=>{d({connection:{...Hc}})},updateConnection:p=>{d({connection:p})},reset:()=>d({...Hi()})}),Object.is);function Ua({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,fitView:l,nodeOrigin:c,nodeExtent:a,children:d}){const[x]=g.useState(()=>jE({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a}));return o.jsxRuntimeExports.jsx(B3,{value:x,children:o.jsxRuntimeExports.jsx(l5,{children:d})})}function EE({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:l,fitView:c,nodeOrigin:a,nodeExtent:d}){return g.useContext(_s)?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):o.jsxRuntimeExports.jsx(Ua,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:d,children:e})}const yE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function SE({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:l,onNodeClick:c,onEdgeClick:a,onInit:d,onMove:x,onMoveStart:p,onMoveEnd:m,onConnect:f,onConnectStart:h,onConnectEnd:j,onClickConnectStart:y,onClickConnectEnd:S,onNodeMouseEnter:M,onNodeMouseMove:C,onNodeMouseLeave:b,onNodeContextMenu:w,onNodeDoubleClick:P,onNodeDragStart:k,onNodeDrag:T,onNodeDragStop:A,onNodesDelete:I,onEdgesDelete:F,onDelete:$,onSelectionChange:z,onSelectionDragStart:R,onSelectionDrag:N,onSelectionDragStop:_,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:V,onBeforeDelete:H,connectionMode:G,connectionLineType:q=lt.Bezier,connectionLineStyle:oe,connectionLineComponent:ee,connectionLineContainerStyle:ne,deleteKeyCode:se="Backspace",selectionKeyCode:ie="Shift",selectionOnDrag:U=!1,selectionMode:ue=Vt.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:pe=us()?"Meta":"Control",zoomActivationKeyCode:re=us()?"Meta":"Control",snapToGrid:Q,snapGrid:le,onlyRenderVisibleElements:je=!1,selectNodesOnDrag:Pe,nodesDraggable:qe,nodesConnectable:Is,nodesFocusable:$s,nodeOrigin:Xt=Ca,edgesFocusable:zs,edgesReconnectable:qt,elementsSelectable:Ut=!0,defaultViewport:Bs=U3,minZoom:Jt=.5,maxZoom:Qt=2,translateExtent:vn=mn,preventScrolling:_p=!0,nodeExtent:Ds,defaultMarkerColor:Pp="#b1b1b7",zoomOnScroll:Lp=!0,zoomOnPinch:Np=!0,panOnScroll:Tp=!1,panOnScrollSpeed:Ap=.5,panOnScrollMode:Ip=Rt.Free,zoomOnDoubleClick:$p=!0,panOnDrag:zp=!0,onPaneClick:Bp,onPaneMouseEnter:Dp,onPaneMouseMove:Op,onPaneMouseLeave:Vp,onPaneScroll:Fp,onPaneContextMenu:Hp,paneClickDistance:br=0,nodeClickDistance:Zp=0,children:Gp,onReconnect:Yp,onReconnectStart:Wp,onReconnectEnd:Kp,onEdgeContextMenu:Xp,onEdgeDoubleClick:qp,onEdgeMouseEnter:Up,onEdgeMouseMove:Jp,onEdgeMouseLeave:Qp,reconnectRadius:em=10,onNodesChange:tm,onEdgesChange:nm,noDragClassName:sm="nodrag",noWheelClassName:om="nowheel",noPanClassName:wr="nopan",fitView:vr,fitViewOptions:rm,connectOnClick:im,attributionPosition:lm,proOptions:cm,defaultEdgeOptions:am,elevateNodesOnSelect:um,elevateEdgesOnSelect:dm,disableKeyboardA11y:Mr=!1,autoPanOnConnect:xm,autoPanOnNodeDrag:pm,autoPanSpeed:mm,connectionRadius:fm,isValidConnection:hm,onError:gm,style:jm,id:kr,nodeDragThreshold:Em,viewport:ym,onViewportChange:Sm,width:Rm,height:Cm,colorMode:bm="light",debug:wm,...vm},Mm){const Os=kr||"1",km=t5(bm);return o.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...vm,style:{...jm,...yE},ref:Mm,className:_e(["react-flow",r,km]),id:kr,children:o.jsxRuntimeExports.jsxs(EE,{nodes:e,edges:t,width:Rm,height:Cm,fitView:vr,nodeOrigin:Xt,nodeExtent:Ds,children:[o.jsxRuntimeExports.jsx(gE,{onInit:d,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:M,onNodeMouseMove:C,onNodeMouseLeave:b,onNodeContextMenu:w,onNodeDoubleClick:P,nodeTypes:i,edgeTypes:l,connectionLineType:q,connectionLineStyle:oe,connectionLineComponent:ee,connectionLineContainerStyle:ne,selectionKeyCode:ie,selectionOnDrag:U,selectionMode:ue,deleteKeyCode:se,multiSelectionKeyCode:pe,panActivationKeyCode:ge,zoomActivationKeyCode:re,onlyRenderVisibleElements:je,defaultViewport:Bs,translateExtent:vn,minZoom:Jt,maxZoom:Qt,preventScrolling:_p,zoomOnScroll:Lp,zoomOnPinch:Np,zoomOnDoubleClick:$p,panOnScroll:Tp,panOnScrollSpeed:Ap,panOnScrollMode:Ip,panOnDrag:zp,onPaneClick:Bp,onPaneMouseEnter:Dp,onPaneMouseMove:Op,onPaneMouseLeave:Vp,onPaneScroll:Fp,onPaneContextMenu:Hp,paneClickDistance:br,nodeClickDistance:Zp,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:V,onReconnect:Yp,onReconnectStart:Wp,onReconnectEnd:Kp,onEdgeContextMenu:Xp,onEdgeDoubleClick:qp,onEdgeMouseEnter:Up,onEdgeMouseMove:Jp,onEdgeMouseLeave:Qp,reconnectRadius:em,defaultMarkerColor:Pp,noDragClassName:sm,noWheelClassName:om,noPanClassName:wr,rfId:Os,disableKeyboardA11y:Mr,nodeExtent:Ds,viewport:ym,onViewportChange:Sm}),o.jsxRuntimeExports.jsx(e5,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:f,onConnectStart:h,onConnectEnd:j,onClickConnectStart:y,onClickConnectEnd:S,nodesDraggable:qe,nodesConnectable:Is,nodesFocusable:$s,edgesFocusable:zs,edgesReconnectable:qt,elementsSelectable:Ut,elevateNodesOnSelect:um,elevateEdgesOnSelect:dm,minZoom:Jt,maxZoom:Qt,nodeExtent:Ds,onNodesChange:tm,onEdgesChange:nm,snapToGrid:Q,snapGrid:le,connectionMode:G,translateExtent:vn,connectOnClick:im,defaultEdgeOptions:am,fitView:vr,fitViewOptions:rm,onNodesDelete:I,onEdgesDelete:F,onDelete:$,onNodeDragStart:k,onNodeDrag:T,onNodeDragStop:A,onSelectionDrag:N,onSelectionDragStart:R,onSelectionDragStop:_,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:wr,nodeOrigin:Xt,rfId:Os,autoPanOnConnect:xm,autoPanOnNodeDrag:pm,autoPanSpeed:mm,onError:gm,connectionRadius:fm,isValidConnection:hm,selectNodesOnDrag:Pe,nodeDragThreshold:Em,onBeforeDelete:H,paneClickDistance:br,debug:wm}),o.jsxRuntimeExports.jsx(q3,{onSelectionChange:z}),Gp,o.jsxRuntimeExports.jsx(G3,{proOptions:cm,position:lm}),o.jsxRuntimeExports.jsx(H3,{rfId:Os,disableKeyboardA11y:Mr})]})})}var RE=Ma(SE);function CE(){const e=we();return g.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),r=Array.isArray(t)?t:[t],i=new Map;r.forEach(l=>{const c=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${l}"]`);c&&i.set(l,{id:l,nodeElement:c,force:!0})}),requestAnimationFrame(()=>s(i,{triggerFitView:!1}))},[])}function bE({onStart:e,onChange:t,onEnd:n}){const s=we();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function wE({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_e(["react-flow__background-pattern",n,s])})}function vE({radius:e,className:t}){return o.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:_e(["react-flow__background-pattern","dots",t])})}var ut;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ut||(ut={}));const ME={[ut.Dots]:1,[ut.Lines]:1,[ut.Cross]:6},kE=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ja({id:e,variant:t=ut.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:l,bgColor:c,style:a,className:d,patternClassName:x}){const p=g.useRef(null),{transform:m,patternId:f}=Ee(kE,ke),h=s||ME[t],j=t===ut.Dots,y=t===ut.Cross,S=Array.isArray(n)?n:[n,n],M=[S[0]*m[2]||1,S[1]*m[2]||1],C=h*m[2],b=Array.isArray(i)?i:[i,i],w=y?[C,C]:M,P=[b[0]*m[2]||1+w[0]/2,b[1]*m[2]||1+w[1]/2],k=`${f}${e||""}`;return o.jsxRuntimeExports.jsxs("svg",{className:_e(["react-flow__background",d]),style:{...a,...Ps,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[o.jsxRuntimeExports.jsx("pattern",{id:k,x:m[0]%M[0],y:m[1]%M[1],width:M[0],height:M[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${P[0]},-${P[1]})`,children:j?o.jsxRuntimeExports.jsx(vE,{radius:C/2,className:x}):o.jsxRuntimeExports.jsx(wE,{dimensions:w,lineWidth:r,variant:t,className:x})}),o.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}Ja.displayName="Background";const _E=g.memo(Ja);function PE(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function LE(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function NE(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.jsxRuntimeExports.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function TE(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function AE(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function $n({children:e,className:t,...n}){return o.jsxRuntimeExports.jsx("button",{type:"button",className:_e(["react-flow__controls-button",t]),...n,children:e})}const IE=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Qa({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:l,onFitView:c,onInteractiveChange:a,className:d,children:x,position:p="bottom-left",orientation:m="vertical","aria-label":f="React Flow controls"}){const h=we(),{isInteractive:j,minZoomReached:y,maxZoomReached:S}=Ee(IE,ke),{zoomIn:M,zoomOut:C,fitView:b}=Pt(),w=()=>{M(),i==null||i()},P=()=>{C(),l==null||l()},k=()=>{b(r),c==null||c()},T=()=>{h.setState({nodesDraggable:!j,nodesConnectable:!j,elementsSelectable:!j}),a==null||a(!j)},A=m==="horizontal"?"horizontal":"vertical";return o.jsxRuntimeExports.jsxs(hr,{className:_e(["react-flow__controls",A,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":f,children:[t&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx($n,{onClick:w,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:S,children:o.jsxRuntimeExports.jsx(PE,{})}),o.jsxRuntimeExports.jsx($n,{onClick:P,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:y,children:o.jsxRuntimeExports.jsx(LE,{})})]}),n&&o.jsxRuntimeExports.jsx($n,{className:"react-flow__controls-fitview",onClick:k,title:"fit view","aria-label":"fit view",children:o.jsxRuntimeExports.jsx(NE,{})}),s&&o.jsxRuntimeExports.jsx($n,{className:"react-flow__controls-interactive",onClick:T,title:"toggle interactivity","aria-label":"toggle interactivity",children:j?o.jsxRuntimeExports.jsx(AE,{}):o.jsxRuntimeExports.jsx(TE,{})}),x]})}Qa.displayName="Controls";g.memo(Qa);function $E({id:e,x:t,y:n,width:s,height:r,style:i,color:l,strokeColor:c,strokeWidth:a,className:d,borderRadius:x,shapeRendering:p,selected:m,onClick:f}){const{background:h,backgroundColor:j}=i||{},y=l||h||j;return o.jsxRuntimeExports.jsx("rect",{className:_e(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:x,ry:x,width:s,height:r,style:{fill:y,stroke:c,strokeWidth:a},shapeRendering:p,onClick:f?S=>f(S,e):void 0})}const zE=g.memo($E),BE=e=>e.nodes.map(t=>t.id),oo=e=>e instanceof Function?e:()=>e;function DE({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=zE,onClick:l}){const c=Ee(BE,ke),a=oo(t),d=oo(e),x=oo(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:c.map(m=>o.jsxRuntimeExports.jsx(VE,{id:m,nodeColorFunc:a,nodeStrokeColorFunc:d,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function OE({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:c,onClick:a}){const{node:d,x,y:p,width:m,height:f}=Ee(h=>{const j=h.nodeLookup.get(e),{x:y,y:S}=j.internals.positionAbsolute,{width:M,height:C}=st(j);return{node:j,x:y,y:S,width:M,height:C}},ke);return!d||d.hidden||!Jc(d)?null:o.jsxRuntimeExports.jsx(c,{x,y:p,width:m,height:f,style:d.style,selected:!!d.selected,className:s(d),color:t(d),borderRadius:r,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:a,id:d.id})}const VE=g.memo(OE);var FE=g.memo(DE);const HE=200,ZE=150,GE=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?qc(Cn(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},YE="react-flow__minimap-desc";function eu({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:a,maskColor:d,maskStrokeColor:x,maskStrokeWidth:p,position:m="bottom-right",onClick:f,onNodeClick:h,pannable:j=!1,zoomable:y=!1,ariaLabel:S="React Flow mini map",inversePan:M,zoomStep:C=10,offsetScale:b=5}){const w=we(),P=g.useRef(null),{boundingRect:k,viewBB:T,rfId:A,panZoom:I,translateExtent:F,flowWidth:$,flowHeight:z}=Ee(GE,ke),R=(e==null?void 0:e.width)??HE,N=(e==null?void 0:e.height)??ZE,_=k.width/R,D=k.height/N,L=Math.max(_,D),V=L*R,H=L*N,G=b*L,q=k.x-(V-k.width)/2-G,oe=k.y-(H-k.height)/2-G,ee=V+G*2,ne=H+G*2,se=`${YE}-${A}`,ie=g.useRef(0),U=g.useRef();ie.current=L,g.useEffect(()=>{if(P.current&&I)return U.current=u3({domNode:P.current,panZoom:I,getTransform:()=>w.getState().transform,getViewScale:()=>ie.current}),()=>{var pe;(pe=U.current)==null||pe.destroy()}},[I]),g.useEffect(()=>{var pe;(pe=U.current)==null||pe.update({translateExtent:F,width:$,height:z,inversePan:M,pannable:j,zoomStep:C,zoomable:y})},[j,y,M,C,F,$,z]);const ue=f?pe=>{var le;const[re,Q]=((le=U.current)==null?void 0:le.pointer(pe))||[0,0];f(pe,{x:re,y:Q})}:void 0,ge=h?g.useCallback((pe,re)=>{const Q=w.getState().nodeLookup.get(re);h(pe,Q)},[]):void 0;return o.jsxRuntimeExports.jsx(hr,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a: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*L: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=="string"?l:void 0},className:_e(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxRuntimeExports.jsxs("svg",{width:R,height:N,viewBox:`${q} ${oe} ${ee} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:P,onClick:ue,children:[S&&o.jsxRuntimeExports.jsx("title",{id:se,children:S}),o.jsxRuntimeExports.jsx(FE,{onClick:ge,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:c}),o.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${q-G},${oe-G}h${ee+G*2}v${ne+G*2}h${-ee-G*2}z
39
- M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}eu.displayName="MiniMap";g.memo(eu);function WE({nodeId:e,position:t,variant:n=ln.Handle,className:s,style:r={},children:i,color:l,minWidth:c=10,minHeight:a=10,maxWidth:d=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:p=!1,shouldResize:m,onResizeStart:f,onResize:h,onResizeEnd:j}){const y=La(),S=typeof e=="string"?e:y,M=we(),C=g.useRef(null),b=n===ln.Line?"right":"bottom-right",w=t??b,P=g.useRef(null);g.useEffect(()=>{if(!(!C.current||!S))return P.current||(P.current=w3({domNode:C.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:I,transform:F,snapGrid:$,snapToGrid:z,nodeOrigin:R,domNode:N}=M.getState();return{nodeLookup:I,transform:F,snapGrid:$,snapToGrid:z,nodeOrigin:R,paneDomNode:N}},onChange:(I,F)=>{const{triggerNodeChanges:$,nodeLookup:z,parentLookup:R,nodeOrigin:N}=M.getState(),_=[],D={x:I.x,y:I.y},L=z.get(S);if(L&&L.expandParent&&L.parentId){const V=L.origin??N,H=I.width??L.measured.width,G=I.height??L.measured.height,q={id:L.id,parentId:L.parentId,rect:{width:H,height:G,...Qc({x:I.x??L.position.x,y:I.y??L.position.y},{width:H,height:G},L.parentId,z,V)}},oe=fr([q],z,R,N);_.push(...oe),D.x=I.x?Math.max(V[0]*H,I.x):void 0,D.y=I.y?Math.max(V[1]*G,I.y):void 0}if(D.x!==void 0&&D.y!==void 0){const V={id:S,type:"position",position:{...D}};_.push(V)}if(I.width!==void 0&&I.height!==void 0){const V={id:S,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:I.width,height:I.height}};_.push(V)}for(const V of F){const H={...V,type:"position"};_.push(H)}$(_)},onEnd:()=>{const I={id:S,type:"dimensions",resizing:!1};M.getState().triggerNodeChanges([I])}})),P.current.update({controlPosition:w,boundaries:{minWidth:c,minHeight:a,maxWidth:d,maxHeight:x},keepAspectRatio:p,onResizeStart:f,onResize:h,onResizeEnd:j,shouldResize:m}),()=>{var I;(I=P.current)==null||I.destroy()}},[w,c,a,d,x,p,f,h,j,m]);const k=w.split("-"),T=n===ln.Line?"borderColor":"backgroundColor",A=l?{...r,[T]:l}:r;return o.jsxRuntimeExports.jsx("div",{className:_e(["react-flow__resize-control","nodrag",...k,n,s]),ref:C,style:A,children:i})}g.memo(WE);const KE=(e,t)=>e.map((n,s)=>u.G.translate(n,t[s])),tu=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:u.cssString(t)},...n}),XE=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:u.cssString(t),strokeDasharray:"12,4"},...n}),qE=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:u.cssString(t),strokeDasharray:"12,4,4"},...n}),UE=({points:e,color:t,...n})=>{const s=u.G.calculateMiters(e,6),r=e.map((a,d)=>u.G.translate(a,s[d])),i=e.map((a,d)=>u.G.translate(a,u.G.scale(s[d],-1))),l=u.cssString(t),c=.7;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ve,{path:dt(r),style:{stroke:l,opacity:c},...n}),o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:l},...n}),o.jsxRuntimeExports.jsx(Ve,{path:dt(i),style:{stroke:l,opacity:c},...n})]})},Zi=5,JE=(e,t)=>{const n=[],s=[];for(let c=0;c<e.length-1;c++){const a=u.G.distance(e[c],e[c+1]);s.push(a)}const r=t;let i=0,l=r;for(let c=0;c<s.length;c++){const a=s[c],d=e[c],x=e[c+1];for(;i+a>=l;){const p=(l-i)/a,m={x:d.x+p*(x.x-d.x),y:d.y+p*(x.y-d.y)};let f="x";Math.abs(x.x-d.x)<1&&(f="y"),l+=r,!(u.G.distance(m,x)<Zi||u.G.distance(m,d)<Zi)&&n.push({position:m,direction:f})}i+=a}return n},QE=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},ey=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10";n==="x"?t.y+=10/3:t.x-=10/3;let i=u.G.translateX(t,-10),l=45;return n==="y"&&(i=u.G.translateY(t,-10),l+=90),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${i.x},${i.y}) rotate(${l})`,strokeLinecap:"round"})]})},ty=({color:e,position:t})=>o.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:u.cssString(e),strokeWidth:2}),jr=e=>{const t=({points:n,color:s,...r})=>{const i=dt(n),l=JE(n,40);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ve,{path:i,...r,style:{stroke:u.cssString(s)}}),l.map(({position:c,direction:a},d)=>o.jsxRuntimeExports.jsx(e,{position:c,direction:a,color:s},d))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},ny=jr(QE),sy=jr(ey),oy=jr(ty),dt=e=>{let t="";const s=e.length+-1;for(let r=0;r<s;r++){const i=e[r%e.length],l=e[(r+1)%e.length],c=Math.min(6/Math.hypot(l.x-i.x,l.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-c)+l.x*c},${i.y*(1-c)+l.y*c}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-c)+l.x*c},${i.y*(1-c)+l.y*c}`),r===s-1?t+=`L${l.x},${l.y}`:r<s-1&&(t+=`L${i.x*c+l.x*(1-c)},${i.y*c+l.y*(1-c)}`)}return t},nu={pipe:tu,electric:XE,secondary:qE,jacketed:UE,hydraulic:ny,pneumatic:sy,data:oy},su=tu,ou=[{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"}],ry=e=>o.jsxRuntimeExports.jsx(ve.DropdownButton,{columns:[{key:"name",name:"Type"}],data:ou,style:{width:200},entryRenderKey:"name",...e}),Ls=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Te=(e,t)=>{const n=Ls(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return u.Mt.construct(s.position,u._.scale(u.Mt.dims(u.Mt.construct(n)),1/e.getZoom()))},iy=(e,t)=>Ns.fromFlow(e,t);class ru{constructor(t,n){Ge(this,"node_",null);Ge(this,"position");Ge(this,"orientation");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.G.translate(u.Mt.topLeft(this.node.box),this.position)}}class Ns{constructor(t,n,s){Ge(this,"key");Ge(this,"box");Ge(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Te(n,t),r=Ls(t),i=r.getElementsByClassName("react-flow__handle"),l=u.Mt.construct(r),c=Array.from(i).map(a=>{const d=u.Mt.center(u.Mt.construct(a)),x=u.G.translation(u.Mt.topLeft(l),d),p=a.className.match(/react-flow__handle-(\w+)/);if(p==null)throw new Error("[schematic] - cannot find handle orientation");const m=u.K.construct(p[0]);return new ru(x,m)});return new Ns(t,s,c)}}const ly=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:r,toPosition:i,fromNode:l,connectionLineStyle:c,connectionStatus:a})=>{const d=document.querySelector(".react-flow__handle-connecting"),x=d==null?void 0:d.className.match(/react-flow__handle-(\w+)/);if(x!=null){const h=u.K.outer.safeParse(x[1]);h.success&&(i=h.data)}const p=Pt(),m=Tt({sourcePos:u.G.construct(e,t),targetPos:u.G.construct(n,s),sourceOrientation:r,targetOrientation:i,sourceBox:Te(p,(l==null?void 0:l.id)??""),targetBox:Te(p,(l==null?void 0:l.id)??"")}),f=uc(u.G.construct(e,t),m,p.getZoom(),!1);return o.jsxRuntimeExports.jsx(su,{points:f,style:{...c,stroke:u.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},cy=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:r,targetPosition:i,style:l,segments:c=[],onSegmentsChange:a,color:d="var(--pluto-gray-l9)",selected:x=!1,variant:p="pipe",...m})=>{const f=u.G.construct(m.sourceX,m.sourceY),h=g.useRef(f),j=u.G.equals(f,h.current),y=u.G.construct(m.targetX,m.targetY),S=g.useRef(y),M=u.G.equals(y,S.current),C=Pt(),[b,w,P]=E.useCombinedStateAndRef(()=>c.length>0?c:Tt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Te(C,t),targetBox:Te(C,n)})),k=g.useRef(i),T=g.useRef(s),A=E.useDebouncedCallback(a,100,[a]);if(!j||!M){let R=b;const N=u.G.translation(h.current,f),_=u.G.translation(y,S.current);u.G.equals(N,u.G.scale(_,-1),.001)?(h.current=f,S.current=y):(j?M||(R=k1({delta:_,segments:R}),k.current!==i&&(k.current=i,R=Tt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Te(C,t),targetBox:Te(C,n)})),Hr({sourcePos:f,targetPos:y,next:R,prev:b})||(R=Tt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Te(C,t),targetBox:Te(C,n)})),S.current=y):(R=M1({delta:N,segments:R}),T.current!==s&&(T.current=s,R=Tt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Te(C,t),targetBox:Te(C,n)})),Hr({sourcePos:f,targetPos:y,next:R,prev:b})||(R=Tt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Te(C,t),targetBox:Te(C,n)})),h.current=f),A(R),w(R))}const I=g.useRef(null),F=E.useCursorDrag({onStart:g.useCallback((R,N,_)=>{I.current={index:Number(_.currentTarget.id.split("-")[1]),segments:[...P.current]}},[]),onMove:g.useCallback(R=>{if(I.current==null)return;const N=C1({segments:I.current.segments,index:I.current.index,magnitude:u.Mt.dim(R,u.g.swap(I.current.segments[I.current.index].direction),!0)/C.getZoom()});w(N)},[]),onEnd:g.useCallback(()=>a(P.current),[a])}),$=uc(f,b,C.getZoom(),!0),z=nu[p];return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(z,{points:$,color:d}),x&&ay($).map((R,N)=>{const _=b[N].direction,D=u.g.swap(_),L={[u.g.dimension(_)]:"18px",[u.g.dimension(D)]:"4px"},V={[_]:R[_]-9,[D]:R[D]-2};return o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsx("rect",{className:u.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...L,...V,rx:"2px",ry:"2px"}),o.jsxRuntimeExports.jsx("foreignObject",{x:R.x-9,y:R.y-9,width:"18px",height:"18px",children:o.jsxRuntimeExports.jsx("div",{id:`handle-${N}`,className:u.CSS(u.CSS.BE("diagram-edge-handle","dragger"),u.CSS.dir(_)),draggable:!0,onDragStart:F})})]},N)})]})},ay=e=>e.slice(1).map((t,n)=>{const s=e[n];return u.G.construct((t.x+s.x)/2,(t.y+s.y)/2)}),uy=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:u.G.ZERO,zoom:1}})=>{const[r,i]=g.useState(n),[l,c]=g.useState(e),[a,d]=g.useState(t),[x,p]=g.useState(s),[m,f]=g.useState(!1);return{viewport:x,onViewportChange:p,edges:a,nodes:l,onNodesChange:c,onEdgesChange:d,editable:r,onEditableChange:i,fitViewOnResize:m,setFitViewOnResize:f}},dy=()=>!0,xy={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},py={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},iu={maxZoom:1,minZoom:.5},my={hideAttribution:!0},lu=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),wn=()=>g.useContext(lu),cu=g.memo(({children:e})=>{const{registerNodeRenderer:t}=wn();return g.useEffect(()=>t(e),[t,e]),null});cu.displayName="NodeRenderer";const fy=["Backspace","Delete"],hy=({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:s,nodes:r,edges:i,onEditableChange:l,editable:c,viewport:a,triggers:d,onViewportChange:x,fitViewOnResize:p,setFitViewOnResize:m,visible:f,...h})=>{const j=E.useMemoDeepEqualProps({visible:f}),[{path:y},,S]=E.use$3({aetherKey:e,type:B.Diagram$1.TYPE,schema:B.diagramStateZ,initialState:{position:a.position,region:u.Mt.ZERO,zoom:a.zoom,...j}});g.useEffect(()=>S(Q=>({...Q,...j})),[j]);const M=E.use().colors.gray.l9.hex,C=E.useMemoCompare(()=>d??Go.zoom,E.compareModeConfigs,[d]),{fitView:b}=Pt(),w=E.useDebouncedCallback(Q=>b(Q),50,[b]),P=En(g.useCallback(Q=>{p&&w({maxZoom:1}),S(le=>({...le,region:Q}))},[S,w,p])),k=g.useRef(null),T=g.useCallback(Q=>{const le=k.current;le!=null&&le.x===Q.x&&le.y===Q.y&&le.zoom===Q.zoom||(k.current=Q,!(isNaN(Q.x)||isNaN(Q.y)||isNaN(Q.zoom))&&(S(je=>({...je,position:Q,zoom:Q.zoom})),x(hc(Q))))},[S,x]);bE({onStart:T,onChange:T,onEnd:T});const[A,I]=g.useState(()=>()=>null),F=g.useCallback(Q=>I(()=>Q),[]),$=g.useMemo(()=>({custom:({id:Q,positionAbsoluteX:le,positionAbsoluteY:je,selected:Pe=!1,draggable:qe=!0})=>A({symbolKey:Q,position:{x:le,y:je},selected:Pe,draggable:qe})}),[A]),z=g.useRef(i),R=g.useMemo(()=>(z.current=i,or(i)),[i]),N=g.useRef(r),_=g.useMemo(()=>(N.current=r,sr(r)),[r]),D=g.useCallback(Q=>n(gc(N.current,le=>wa(Q,le)),Q),[n]),L=g.useCallback(Q=>s(Vn(z.current,le=>va(Q,le),M)),[s,M]),V=g.useCallback((Q,le)=>s(Vn(z.current,je=>G2(Q,le,je),M)),[]),H=g.useCallback(Q=>s(Vn(z.current,le=>ia(Q,le),M)),[s,M]),G=g.useCallback((Q,le)=>{const je=[...z.current],Pe=je.findIndex(qe=>qe.key===Q);Pe!==-1&&(je[Pe]={...je[Pe],segments:le},z.current=je,s(je))},[s]),q=c?xy:py,oe=E.useSyncedRef(G),ee=g.useMemo(()=>({default:Q=>{var le,je,Pe;return o.jsxRuntimeExports.jsx(cy,{...Q,segments:((le=Q.data)==null?void 0:le.segments)??[],color:(je=Q.data)==null?void 0:je.color,variant:(Pe=Q.data)==null?void 0:Pe.variant,onSegmentsChange:g.useCallback(qe=>oe.current(Q.id,qe),[Q.id])},Q.id)}}),[]),ne=E.useHeld({triggers:[["Q"]],loose:!0}),se=g.useRef(null);E.use$1({triggers:C.zoomReset,callback:g.useCallback(({stage:Q,cursor:le})=>{const je=se.current;je==null||Q!=="start"||!u.Mt.contains(je,le)||b()},[b])});const ie=E.purgeMouse(C.select)[0]??null,U=E.purgeMouse(C.pan)[0]??null,ue=E.purgeMouse(C.zoom)[0]??null,ge={selectionOnDrag:ie==null,panOnDrag:U==null,selectionKeyCode:ie,panActivationKeyCode:U,zoomActivationKeyCode:ue},pe=E.useCombinedRefs(se,P),re=g.useMemo(()=>({visible:f,editable:c,onEditableChange:l,registerNodeRenderer:F,fitViewOnResize:p,setFitViewOnResize:m}),[c,f,l,F,p]);return o.jsxRuntimeExports.jsx(lu.Provider,{value:re,children:o.jsxRuntimeExports.jsx(E.Composite,{path:y,children:f&&o.jsxRuntimeExports.jsx(RE,{...ge,className:u.CSS(u.CSS.B("diagram"),u.CSS.editable(c),u.CSS.BE("symbol","container")),nodes:_,edges:R,nodeTypes:$,edgeTypes:ee,ref:pe,fitView:!0,onNodesChange:D,onEdgesChange:L,onConnect:H,onReconnect:V,defaultViewport:fc(a),connectionLineComponent:ly,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:dy,connectionMode:Mt.Loose,fitViewOptions:iu,selectionMode:Vt.Partial,proOptions:my,deleteKeyCode:fy,...h,style:{[u.CSS.var("diagram-zoom")]:a.zoom,...h.style},...q,nodesDraggable:c&&!ne.held,children:t})})})},gy=()=>{const{editable:e}=wn();return e?o.jsxRuntimeExports.jsx(_E,{}):null},jy=({children:e,...t})=>o.jsxRuntimeExports.jsx(te.Pack,{direction:"y",borderShade:4,className:u.CSS.BE("diagram","controls"),...t,children:e}),Ey=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=wn();return o.jsxRuntimeExports.jsx(E.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:u.K.RIGHT_CENTER,tooltip:n?o.jsxRuntimeExports.jsx(E.Text$1,{level:"small",children:"Disable edit mode"}):o.jsxRuntimeExports.jsx(E.Text$1,{level:"small",children:"Enable edit mode"}),...t,children:n?o.jsxRuntimeExports.jsx(E.yt.EditOff,{}):o.jsxRuntimeExports.jsx(E.yt.Edit,{})})},yy=({onClick:e,...t})=>{const{fitView:n}=Pt(),{fitViewOnResize:s,setFitViewOnResize:r}=wn();return o.jsxRuntimeExports.jsx(E.ToggleIcon,{onClick:i=>{n(iu),e==null||e(i)},value:s,onChange:i=>r(i),rightClickToggle:!0,tooltip:o.jsxRuntimeExports.jsx(E.Text$1,{level:"small",children:"Fit view to contents"}),tooltipLocation:u.K.RIGHT_CENTER,variant:"outlined",...t,children:o.jsxRuntimeExports.jsx(E.yt.Expand,{})})},Sy=e=>o.jsxRuntimeExports.jsx(Ua,{children:o.jsxRuntimeExports.jsx(hy,{...e})}),Ry=Object.freeze(Object.defineProperty({__proto__:null,Background:gy,Controls:jy,DefaultPath:su,Diagram:Sy,FitViewControl:yy,HandleLayout:ru,NodeLayout:Ns,NodeRenderer:cu,PATHS:nu,PATH_TYPES:ou,SelectPathType:ry,ToggleEditControl:Ey,alignNodes:N1,calcPath:dt,edgeConverter:Vn,edgeZ:P1,nodeConverter:gc,nodeZ:L1,offsetPath:KE,rfEdgeDataZ:xc,selectNode:Ls,selectNodeBox:Te,selectNodeLayout:iy,translateEdgesBackward:mc,translateEdgesForward:or,translateNodesBackward:pc,translateNodesForward:sr,translateViewportBackward:hc,translateViewportForward:fc,use:uy,useContext:wn,viewportZ:_1},Symbol.toStringTag,{value:"Module"})),Cy=({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=o.jsxRuntimeExports.jsx(E.Text$3.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:l,...c})=>{const a=E.useUniqueKey(e),d=E.useMemoDeepEqualProps({font:t,color:i,telem:l,visible:s}),[,{scrolling:x,empty:p},m]=E.use$3({aetherKey:a,type:B.Log.TYPE,schema:B.logState,initialState:{empty:!0,region:u.Mt.ZERO,scrolling:!1,wheelPos:0,...d}});g.useEffect(()=>{m(h=>({...h,...d}))},[d,m]);const f=En(g.useCallback(h=>m(j=>({...j,region:h})),[m]));return o.jsxRuntimeExports.jsx("div",{ref:f,className:u.CSS(u.CSS.B("log"),n),onWheel:h=>{m(j=>({...j,wheelPos:j.wheelPos-h.deltaY,scrolling:j.scrolling?j.scrolling:h.deltaY<0}))},...c,children:p?r:o.jsxRuntimeExports.jsx(E.Icon,{className:u.CSS(u.CSS.BE("log","live"),x&&u.CSS.M("active")),variant:"outlined",onClick:()=>m(h=>({...h,scrolling:!h.scrolling})),tooltip:x?"Resume Scrolling":"Pause Scrolling",children:o.jsxRuntimeExports.jsx(E.yt.Dynamic,{})})})},by=Object.freeze(Object.defineProperty({__proto__:null,Log:Cy},Symbol.toStringTag,{value:"Module"})),mt=(e,t)=>{const n={};t.forEach(r=>n[r]=void 0);const s=r=>{const{...i}={...r,...n};return o.jsxRuntimeExports.jsx(e,{...i})};return s.displayName=`RemoveProps(${e.displayName})`,s},wy=({value:e,hideOuter:t=!1,hideInner:n,onChange:s})=>{const{outer:r}=e,i=l=>()=>s({...e,...l});return t?o.jsxRuntimeExports.jsx(Gi,{className:u.CSS.B("orientation-control"),value:e,onChange:s}):o.jsxRuntimeExports.jsxs(te.Space,{className:u.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[o.jsxRuntimeExports.jsx(at,{selected:r==="top",onClick:i({outer:"top"})}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[o.jsxRuntimeExports.jsx(at,{selected:r==="left",onClick:i({outer:"left"})}),o.jsxRuntimeExports.jsx(Gi,{hideInner:n,value:e,onChange:s}),o.jsxRuntimeExports.jsx(at,{selected:r==="right",onClick:i({outer:"right"})})]}),o.jsxRuntimeExports.jsx(at,{selected:r==="bottom",onClick:i({outer:"bottom"})})]})},Gi=({value:e,onChange:t,className:n,hideInner:s=!1,...r})=>{const{inner:i}=e,l=a=>()=>t({...e,...a});let c={};return s&&(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),o.jsxRuntimeExports.jsxs(te.Space,{className:u.CSS(n,u.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...r,children:[o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:i==="top",onClick:l({inner:"top"})}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",justify:"center",children:[o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,selected:i==="left",onClick:l({inner:"left"})}),o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,selected:i==="right",onClick:l({inner:"right"})})]}),o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:i==="bottom",onClick:l({inner:"bottom"})})]})},at=({selected:e,className:t,...n})=>o.jsxRuntimeExports.jsx(E.Icon,{variant:"text",className:u.CSS(t,u.CSS.selected(e)),...n,children:o.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Be=({className:e,direction:t,...n})=>o.jsxRuntimeExports.jsx(te.Space,{direction:t,align:"stretch",className:u.CSS(u.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),ft=({hideOuter:e,hideInner:t,...n})=>t&&e?null:o.jsxRuntimeExports.jsx(ye,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:r})=>{var i;return o.jsxRuntimeExports.jsx(wy,{value:{inner:s.orientation??"top",outer:((i=s.label)==null?void 0:i.orientation)??"top"},hideInner:t,hideOuter:e,onChange:l=>r({...s,orientation:l.inner,label:{...s.label,orientation:l.outer}})})}}),Lt=({path:e,omit:t=[]})=>o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(ye,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>o.jsxRuntimeExports.jsx(E.Text$2,{selectOnFocus:!0,...n})}),o.jsxRuntimeExports.jsx(zt,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px",dragScale:{x:1,y:.5}},padHelpText:!1}),o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...n})}),o.jsxRuntimeExports.jsx(ye,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>o.jsxRuntimeExports.jsx(ms,{...n})}),o.jsxRuntimeExports.jsx(ye,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:n=>o.jsxRuntimeExports.jsx(yl,{...n,yDirection:"down"})})]}),Ke=e=>o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(E.Swatch,{value:t??u.ZERO.setAlpha(1).rgba255,onChange:i=>n(i.rgba255),...r,bordered:!0})}),au=e=>o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(E.Numeric,{dragScale:{x:.75,y:.5},bounds:{lower:50,upper:1e3},endContent:"%",value:Math.round(t*100),onChange:s=>n(parseFloat((s/100).toFixed(2)))})}),me=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Lt,{omit:e,path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(Ke,{path:"color",optional:!0}),o.jsxRuntimeExports.jsx(ye,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:s=>o.jsxRuntimeExports.jsx(E.Switch$1,{...s})}),o.jsxRuntimeExports.jsx(au,{path:"scale"})]})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideInner:t,hideOuter:n})]}),vy=({path:e})=>{var d,x;const{value:t,onChange:n}=pt({path:e}),s=B.sourcePipelinePropsZ.parse((d=t.source)==null?void 0:d.props),r=B.sinkPipelinePropsZ.parse((x=t.sink)==null?void 0:x.props),i=B.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=B.setChannelValuePropsZ.parse(r.segments.setter.props),c=p=>{p??(p=0);const m=B.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:B.streamChannelValue({channel:p}),threshold:B.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:m})},a=p=>{p??(p=0);const m=B.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:B.setChannelValue({channel:p}),setpoint:B.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),f=B.authoritySource({channel:p}),h=B.acquireChannelControl({channel:p,authority:255});n({...t,sink:m,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:h,source:f},indicator:{statusSource:f}}})};return o.jsxRuntimeExports.jsxs(Be,{direction:"x",grow:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"State Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:i.channel,onChange:c})}),o.jsxRuntimeExports.jsx(Ne.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:l.channel,onChange:a})}),o.jsxRuntimeExports.jsx(hs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},Er=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],Re=({hideInnerOrientation:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"control":return o.jsxRuntimeExports.jsx(vy,{path:""});default:return o.jsxRuntimeExports.jsx(me,{hideInnerOrientation:e})}},[e]),n=Me.useStatic({tabs:Er,content:t});return o.jsxRuntimeExports.jsx(Me.Tabs,{...n})},yt={y:2,x:.25},cn={lower:0,upper:2e3},Yi={lower:0,upper:51},uu=({includeBorderRadius:e=!1})=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Lt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ke,{path:"color"}),o.jsxRuntimeExports.jsx(Ke,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(ye,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(E.Numeric,{value:t,dragScale:yt,bounds:Yi,endContent:"%",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(E.Numeric,{value:t,dragScale:yt,bounds:Yi,endContent:"%",...n})}),e&&o.jsxRuntimeExports.jsx(ye,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(E.Numeric,{value:t,dragScale:yt,bounds:cn,endContent:"px",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(E.Numeric,{value:t??200,dragScale:yt,bounds:cn,endContent:"px",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(E.Numeric,{value:t??200,dragScale:yt,bounds:cn,endContent:"px",...n})})]})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideInner:!0})]}),du=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],My=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsxs(Be,{direction:"y",empty:!0,children:[o.jsxRuntimeExports.jsx(tr,{path:""}),";"]});default:return o.jsxRuntimeExports.jsxs(Be,{direction:"x",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Lt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ke,{path:"color"}),o.jsxRuntimeExports.jsx(ye,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(E.Text$2,{...s})}),o.jsxRuntimeExports.jsx(zt,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...s})})]})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideInner:!0})]})}},[]),t=Me.useStatic({tabs:du,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},ky=({path:e})=>{var d;const{value:t,onChange:n}=pt({path:e}),s=B.sourcePipelinePropsZ.parse((d=t.source)==null?void 0:d.props),r=B.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=B.withinBoundsProps.parse(s.segments.threshold.props),l=x=>{x??(x=0);const p=B.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:B.streamChannelValue({channel:x}),threshold:B.withinBounds({trueBound:{lower:i.trueBound.lower??.9,upper:i.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:p})},c=x=>{const p=B.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:B.streamChannelValue({channel:r.channel}),threshold:B.withinBounds({trueBound:x})},outlet:"threshold"});n({...t,source:p})},a=ps(r.channel);return g.useEffect(()=>n({...t}),[a]),o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:r.channel,onChange:l})}),o.jsxRuntimeExports.jsx(Ne.Item,{label:"Lower Threshold",children:o.jsxRuntimeExports.jsx(E.Numeric,{value:i.trueBound.lower??.9,onChange:x=>c({...i.trueBound,lower:x})})}),o.jsxRuntimeExports.jsx(Ne.Item,{label:"Upper Threshold",children:o.jsxRuntimeExports.jsx(E.Numeric,{value:i.trueBound.upper??1.1,onChange:x=>c({...i.trueBound,upper:x})})})]})},_y=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsx(ky,{path:""});default:return o.jsxRuntimeExports.jsx(me,{})}},[]),t=Me.useStatic({tabs:du,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},Py=({path:e})=>{var l;const{value:t,onChange:n}=pt({path:e}),s=B.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),r=B.setChannelValuePropsZ.parse(s.segments.setter.props),i=c=>{c??(c=0);const a=B.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:B.setChannelValue({channel:c}),setpoint:B.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),d=B.authoritySource({channel:c}),x=B.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:x,source:d},showIndicator:!0,indicator:{statusSource:d}}})};return o.jsxRuntimeExports.jsxs(Be,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ne.Item,{label:"Output Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:r.channel,onChange:i})}),o.jsxRuntimeExports.jsx(zt,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),o.jsxRuntimeExports.jsx(hs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},Ly=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(Py,{path:""});default:return o.jsxRuntimeExports.jsx(me,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=Me.useStatic({tabs:Er,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},Ny=({path:e})=>{var l;const{value:t,onChange:n}=pt({path:e}),s=B.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),r=B.setChannelValuePropsZ.parse(s.segments.setter.props),i=c=>{c??(c=0);const a=B.sinkPipeline("number",{connections:[],segments:{setter:B.setChannelValue({channel:c})},inlet:"setter"}),d=B.authoritySource({channel:c}),x=B.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:x,source:d},showIndicator:!0,indicator:{statusSource:d}},disabled:c==0})};return o.jsxRuntimeExports.jsx(Be,{direction:"x",grow:!0,align:"stretch",children:o.jsxRuntimeExports.jsx(Ne.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:r.channel,onChange:i})})})},Ty=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(Ny,{path:""});default:return o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",align:"stretch",grow:!0,size:"small",children:[o.jsxRuntimeExports.jsx(Lt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ko,{path:"units",label:"Units",align:"start",padHelpText:!1}),o.jsxRuntimeExports.jsx(ye,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(jl,{...s})}),o.jsxRuntimeExports.jsx(Ke,{path:"color"})]})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideInner:!0})]})}},[]),t=Me.useStatic({tabs:Er,content:e});return o.jsxRuntimeExports.jsx(Me.Tabs,{...t})},Ay=()=>{const e=pt({path:"autoFit",optional:!0});return o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",grow:!0,children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(ye,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>o.jsxRuntimeExports.jsx(E.Text$2,{selectOnFocus:!0,...t})}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Text Size",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>o.jsxRuntimeExports.jsx(ms,{...t})})]}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ke,{path:"color"}),o.jsxRuntimeExports.jsx(ye,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(E.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:o.jsxRuntimeExports.jsx(E.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:o.jsxRuntimeExports.jsx(E.yt.AutoFitWidth,{})})})})]})]}),o.jsxRuntimeExports.jsx(ft,{path:""})]})},Iy=()=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Lt,{path:"label",omit:["maxInlineSize","align","direction"]}),o.jsxRuntimeExports.jsx(Ke,{path:"color"})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideOuter:!0})]}),$y=()=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Lt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ke,{path:"color"}),o.jsxRuntimeExports.jsx(Ke,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(E.Numeric,{value:e??200,dragScale:yt,bounds:cn,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(E.Numeric,{value:e??200,dragScale:yt,bounds:cn,endContent:"px",...t})})]})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideInner:!0})]}),ht=()=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Lt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(Ke,{path:"color"}),o.jsxRuntimeExports.jsx(au,{path:"scale"}),o.jsxRuntimeExports.jsx(hs,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),o.jsxRuntimeExports.jsx(ft,{path:""})]}),zy=()=>o.jsxRuntimeExports.jsx(uu,{includeBorderRadius:!0}),By=()=>o.jsxRuntimeExports.jsx(Re,{hideInnerOrientation:!0}),O=e=>o.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),Se=e=>o.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Le=e=>o.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),fe=e=>o.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),Dy={left:{left:X.Left,right:X.Right,top:X.Top,bottom:X.Bottom},right:{left:X.Right,right:X.Left,top:X.Bottom,bottom:X.Top},top:{left:X.Bottom,right:X.Top,top:X.Left,bottom:X.Right},bottom:{left:X.Top,right:X.Bottom,top:X.Right,bottom:X.Left}},Oy=(e,t)=>Dy[t][e],Vy=(e,t=!1)=>{if(t)return e;switch(e){case X.Left:return X.Right;case X.Right:return X.Left;case X.Top:return X.Bottom;case X.Bottom:return X.Top;default:return X.Top}},Fy=(e,t,n,s=!1)=>s?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},W=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=CE()}catch{return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})}const r=g.useRef(null),i=g.useRef(!0);return g.useEffect(()=>{if(r.current==null)return;if(i.current){i.current=!1;return}const l=r.current.closest(".react-flow__node"),c=l==null?void 0:l.getAttribute("data-id");c!=null&&(s==null||s(c))},[t,n]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("span",{ref:r}),e]})},v=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:r,top:i,style:l,...c})=>{const a=Fy(i,s,t,n);return o.jsxRuntimeExports.jsx(jn,{position:Vy(Oy(e,t),!r),...c,type:"source",onClick:d=>d.stopPropagation(),className:(u.CSS.B("handle"),u.CSS.BE("handle",c.id)),style:{left:`${a.left}%`,top:`${a.top}%`,...l}})},he=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:r,...i})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("symbol-primitive"),u.CSS.B("symbol-primitive-toggle"),s!=null&&u.CSS.loc(s),t&&u.CSS.M("enabled"),n&&u.CSS.M("triggered"),e),color:u.cssString(r),...i}),de=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.B("symbol-primitive"),e),...t}),Hy=.8,J=({dimensions:e,orientation:t="left",children:n,className:s,color:r,style:i={},scale:l=1,...c})=>{e=u.g.construct(t)==="y"?u._.swap(e):e;const d=u.cssString(r),x=E.use();return r!=null&&(i[u.CSS.var("symbol-color")]=new u.Color(r).rgbString,i[u.CSS.var("symbol-color-contrast")]=new u.Color(r).pickByContrast(x.colors.gray.l0,x.colors.gray.l10).rgbString),o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u._.svgViewBox(e),className:u.CSS(u.CSS.loc(t),s),fill:d,stroke:d,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:u._.scale(e,l*Hy).width,...i},children:o.jsxRuntimeExports.jsx("g",{children:n})})},xu=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,orientation:t,className:u.CSS(u.CSS.B("four-way-valve"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:87},color:s,scale:n,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),pu=({color:e,orientation:t="left",scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("three-way-valve")),orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),mu=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),fu=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{className:u.CSS(u.CSS.B("solenoid-valve"),s&&u.CSS.M("normally-open"),e),...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(O,{className:u.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),o.jsxRuntimeExports.jsx(fe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),o.jsxRuntimeExports.jsx(Se,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),hu=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{className:u.CSS(u.CSS.B("relief-valve"),e),enabled:r,...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),gu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{orientation:t,className:u.CSS(u.CSS.B("check-valve"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),ju=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.cssString(n);return o.jsxRuntimeExports.jsxs(de,{...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"7",cy:"7",r:"4",fill:i}),o.jsxRuntimeExports.jsx(O,{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"})]})]})},Eu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,orientation:n,className:u.CSS(u.CSS.B("angled-valve"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),yu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"43.5978",cy:"20.972",r:"19"}),o.jsxRuntimeExports.jsx(O,{d:"M26.5 12.8472L6.35452 2.17563C4.35901 1.16585 2 2.61598 2 4.85243V37.0918C2 39.3283 4.35901 40.7784 6.35453 39.7686L26.5 29.3472"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Su=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("three-way-ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.8,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"43.5978",cy:"21.722",r:"19"}),o.jsxRuntimeExports.jsx(O,{d:"M26.5 13.5972L6.35452 2.92563C4.35901 1.91585 2 3.36598 2 5.60243V37.8418C2 40.0783 4.35901 41.5284 6.35453 40.5186L26.5 30.0972"}),o.jsxRuntimeExports.jsx(O,{d:"M60.5 29.5986L80.6455 40.2702C82.641 41.2799 85 39.8298 85 37.5934V5.35396C85 3.11751 82.641 1.66738 80.6455 2.67716L60.5 13.0986"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Ru=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("gate-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 2 L43.5 39.7965"})]})]}),Cu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-one"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 2V40"}),o.jsxRuntimeExports.jsx(Le,{cx:"43.5",cy:"21",r:"10",fill:u.cssString(e)})]})]}),bu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-two"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"43.5",cy:"21",r:"10",fill:u.cssString(e)}),o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),wu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("breather-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:8.081,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:91.919,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"91",cy:"49.5",r:"6",fill:u.cssString(e)}),o.jsxRuntimeExports.jsx(Le,{cx:"8",cy:"7.5",r:"6",fill:u.cssString(e)}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),vu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Mu=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const i=u.cssString(t);return o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:5,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),o.jsxRuntimeExports.jsx(O,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:i}),o.jsxRuntimeExports.jsx(O,{d:"M33 24H2",strokeLinecap:"round"})]})]})},ku=({className:e,color:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),_u=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(J,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Pu=({className:e,orientation:t="left",color:n,scale:s=1,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:50,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(J,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:o.jsxRuntimeExports.jsx(O,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),Lu=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("manual-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Nu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("orifice_plate"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{color:n,dimensions:{width:96,height:48},orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"3",y:"3",width:"90",height:"42",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(fe,{x1:"33",y1:"3",x2:"33",y2:"21",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"33",y1:"27",x2:"33",y2:"45",strokeLinecap:"round"})]})]}),Wi=(e,t)=>e/t*100,Tu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Au=e=>typeof e=="number"?{topLeft:u.G.construct(e),topRight:u.G.construct(e),bottomLeft:u.G.construct(e),bottomRight:u.G.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:u.G.construct(e.topLeft),topRight:u.G.construct(e.topRight),bottomLeft:u.G.construct(e.bottomLeft),bottomRight:u.G.construct(e.bottomRight)}:e,Zy=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:r}=e;return`${t.x}% ${n.x}% ${r.x}% ${s.x}% / ${t.y}% ${n.y}% ${r.y}% ${s.y}%`},Iu={width:40,height:80},yr={x:50,y:10},Ts=({className:e,dimensions:t=Iu,borderRadius:n=yr,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const c=Au(n),a=s==null,d=E.use(),{width:x,height:p}=t,m=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,p,x]),f=Wi(1,x),h=100-f,j=Wi(1,p),y=100-j;return o.jsxRuntimeExports.jsx(de,{className:u.CSS(e,u.CSS.B("tank")),style:{...t,borderRadius:s??Zy(c),borderColor:u.cssString(r??d.colors.gray.l9),backgroundColor:u.cssString(i)},...l,children:o.jsxRuntimeExports.jsxs(W,{refreshDeps:m,orientation:"left",children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:j,id:"1"}),a&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:f,top:c.topLeft.y,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:h,top:c.topRight.y,id:"3"})]}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:y,id:"4"}),a&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:f,top:100-c.bottomLeft.y,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:h,top:100-c.bottomRight.y,id:"6"})]}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:f,top:50,id:"7"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:h,top:50,id:"8"})]})})},$u=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),o.jsxRuntimeExports.jsx(O,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),zu=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("orifice"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[o.jsxRuntimeExports.jsx(O,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),Bu=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("needle-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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.cssString(n)}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Du=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("angled-relief-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Ou=({className:e,color:t,dimensions:n,orientation:s="left",units:r="psi",unitsLevel:i="small",children:l,inlineSize:c=80,...a})=>{const d=u.cssString(t),x=E.use(),p=t==null?"var(--pluto-gray-l0)":u.cssString(new u.Color(t).pickByContrast(x.colors.gray.l0,x.colors.gray.l9));return o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("value"),e),...a,style:{borderColor:d,height:n==null?void 0:n.height,width:"100%"},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:c},children:l}),o.jsxRuntimeExports.jsxs(W,{orientation:s,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.BE("value","units"),u.CSS.M(i)),style:{background:d},children:o.jsxRuntimeExports.jsx(E.Text$1,{level:i,color:p,children:r})})]})},Vu=({enabled:e=!1,onClick:t,orientation:n="left"})=>o.jsxRuntimeExports.jsxs(de,{orientation:n,children:[o.jsxRuntimeExports.jsx(E.Switch$1,{value:e,onClick:t,onChange:()=>{}}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Fu=({onClick:e,orientation:t="left",label:n="",color:s,size:r,level:i,onClickDelay:l})=>o.jsxRuntimeExports.jsxs(de,{orientation:t,children:[o.jsxRuntimeExports.jsx(E.Button,{onClick:e,color:s,size:r,level:i,onClickDelay:l,children:n}),o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:0,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),Hu=({className:e,orientation:t="left",text:n="",width:s,color:r="var(--pluto-gray-l9)",level:i,autoFit:l,align:c="center"})=>{const a={textAlign:c};return u.g.construct(t)==="y"?a.height=l?"fit-content":s:a.width=l?"fit-content":s,o.jsxRuntimeExports.jsx(de,{style:a,orientation:t,className:u.CSS(u.CSS.B("text-box"),u.CSS.loc(t),e),children:o.jsxRuntimeExports.jsx(E.Text$1,{color:u.cssString(r),level:i,children:n})})},Zu=({orientation:e="left",className:t,onClick:n,children:s,value:r,units:i,color:l,onChange:c,size:a="small",disabled:d,...x})=>{const[p,m]=g.useState(r);return o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("setpoint"),t),orientation:e,...x,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:e,left:.5,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:e,left:100,top:50,id:"2",style:{zIndex:5}}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:e,left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx(E.Numeric,{size:a,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,outlineColor:l,borderWidth:1,disabled:d,children:o.jsxRuntimeExports.jsx(E.Button,{size:a,variant:"filled",onClick:()=>c(p),color:l,children:"Set"})})]})},Gu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("screw-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{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)})]})]}),Yu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("vacuum-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Wu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("cavity-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{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)})]})]}),Ku=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("piston-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{d:"M 23 32, h 16, m 0 -8, v 16",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Xu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("static-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),qu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("rotary-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),Uu=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,orientation:n,className:u.CSS(u.CSS.B("light"),s&&u.CSS.M("enabled"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:o.jsxRuntimeExports.jsx(Le,{cx:"32",cy:"32",r:"30"})})]}),Ju=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:21.5909,top:25,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:12.5,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:70/88*100,top:20/80*100,id:"5"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),o.jsxRuntimeExports.jsx(Se,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Qu=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44"}),o.jsxRuntimeExports.jsx(O,{d:"M43 1L45 65"})]})]}),ed=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50.5814,top:200/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),td=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(Se,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),nd=({height:e=86,className:t,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(Se,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),sd=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Se,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),od=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(fe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),rd=({id:e,className:t,orientation:n="right",label:s="text",color:r="black",level:i="p",onLabelChange:l,...c})=>{const a=document.querySelector(`[data-id="${e}"]`);a&&a.classList.add(n);const d=u.g.construct(n)==="y";return o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("arrow"),u.CSS.loc(n),t),orientation:n,...c,children:[o.jsxRuntimeExports.jsx("div",{className:"wrapper",children:o.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:u.cssString(r)},children:o.jsxRuntimeExports.jsx("div",{className:"bg",children:o.jsxRuntimeExports.jsx(E.MaybeEditable,{value:s,onChange:l,level:i,className:u.CSS.BE("symbol","label")})})})}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:d,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:d,id:"2"})]}),o.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:o.jsxRuntimeExports.jsx("defs",{children:o.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[o.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),o.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),o.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},id=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("vent"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(J,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),ld=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("iso-filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),cd=({className:e,dimensions:t=Iu,borderRadius:n=yr,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const c=Au(n),a=E.use(),d=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]),x=u.cssString(r??a.colors.gray.l9),p=i==null?void 0:u.cssString(i),m=t.width/66,f=t.height/180,h=`scale(${m},${f})`;return o.jsxRuntimeExports.jsxs(de,{className:u.CSS(e,u.CSS.B("cylinder")),style:{...t},...l,children:[o.jsxRuntimeExports.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:h,children:o.jsxRuntimeExports.jsx("path",{d:"M23 33.6712C11.9844 36.0332 3 42.4382 3 52.8862V174.568C3 176.225 4.34315 177.568 6 177.568H60C61.6569 177.568 63 176.225 63 174.568V52.8862C63 36.3342 40.4511 29.9292 23 33.6712ZM23 33.6712V13.3181C23 0.318109 42.9975 0.318123 42.9975 13.3181V33.6712",vectorEffect:"non-scaling-stroke",strokeWidth:"2",stroke:x,transform:h,fill:p})}),o.jsxRuntimeExports.jsxs(W,{refreshDeps:d,orientation:"left",children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:2,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:35,top:10,id:"9"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:65,top:10,id:"10"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:40,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:40,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:60,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:60,id:"6"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:80,id:"7"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},ad=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M46.3625 54.1079C45.6312 54.4779 45.6311 55.5223 46.3624 55.8924L81.7435 73.7989C83.7389 74.8088 86.098 73.3588 86.0982 71.1224L86.1002 38.883C86.1003 36.6465 83.7414 35.1962 81.7458 36.2059L46.3625 54.1079Z",stroke:l}),o.jsxRuntimeExports.jsx(O,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M41.6389 55.8923C42.3702 55.5222 42.3702 54.4778 41.6389 54.1077L6.2567 36.2035C4.26118 35.1937 1.90217 36.6438 1.90217 38.8803L1.90217 71.1197C1.90217 73.3562 4.26119 74.8063 6.2567 73.7965L41.6389 55.8923Z",stroke:l}),o.jsxRuntimeExports.jsx(Le,{cx:"44",cy:"55",r:"4",fill:l}),o.jsxRuntimeExports.jsx(O,{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})]})]})},ud=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M23.3625 55.6237C22.6312 55.9937 22.6311 57.0381 23.3624 57.4082L58.7435 75.3147C60.7389 76.3246 63.098 74.8747 63.0981 72.6382L63.1001 40.3988C63.1003 38.1624 60.7414 36.7121 58.7458 37.7217L23.3625 55.6237Z"}),o.jsxRuntimeExports.jsx(O,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),o.jsxRuntimeExports.jsx(O,{d:"M21.8923 58.4348C21.5222 57.7035 20.4778 57.7035 20.1077 58.4348L2.20349 93.817C1.19372 95.8125 2.64384 98.1715 4.8803 98.1715H37.1197C39.3562 98.1715 40.8063 95.8125 39.7965 93.817L21.8923 58.4348Z"}),o.jsxRuntimeExports.jsx(Le,{cx:"21",cy:"56.0737",r:"4",fill:l}),o.jsxRuntimeExports.jsx(O,{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"})]})]})},dd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:1.6667,top:20,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:98.3333,top:20,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:95,id:"3"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:36,height:18},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{d:"M0 4V2C0 0.895431 0.895431 0 2 0H34C35.1046 0 36 0.89543 36 2V4C36 5.10457 35.1046 6 34 6H23C21.8954 6 21 6.89543 21 8V16C21 17.1046 20.1046 18 19 18H17C15.8954 18 15 17.1046 15 16V8C15 6.89543 14.1046 6 13 6H2C0.895431 6 0 5.10457 0 4Z",fill:u.cssString(n),stroke:"none"})})]}),xd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:5,top:49,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95,top:49,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:95,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:5,id:"4"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:36,height:36},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{d:"M21 34C21 35.1046 20.1046 36 19 36H17C15.8954 36 15 35.1046 15 34V23C15 21.8954 14.1046 21 13 21H2C0.895432 21 0 20.1046 0 19V17C0 15.8954 0.895432 15 2 15H13C14.1046 15 15 14.1046 15 13V2C15 0.895432 15.8954 0 17 0H19C20.1046 0 21 0.895432 21 2V13C21 14.1046 21.8954 15 23 15H34C35.1046 15 36 15.8954 36 17V19C36 20.1046 35.1046 21 34 21H23C21.8954 21 21 21.8954 21 23V34Z",fill:u.cssString(n),stroke:"none"})})]}),Ze=({position:e,color:t})=>o.jsxRuntimeExports.jsx("text",{x:(e==null?void 0:e.x)??57,y:(e==null?void 0:e.y)??27,style:{fill:u.cssString(t),fontWeight:450},stroke:"none",children:"F"}),pd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:25},color:s})]})]}),md=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Electromagnetic"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M47.5 17.5H55.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M15.5 17.5H23.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M23.5 17.5C23.5 16.9747 23.6035 16.4546 23.8045 15.9693C24.0055 15.484 24.3001 15.043 24.6716 14.6716C25.043 14.3001 25.484 14.0055 25.9693 13.8045C26.4546 13.6035 26.9747 13.5 27.5 13.5C28.0253 13.5 28.5454 13.6035 29.0307 13.8045C29.516 14.0055 29.957 14.3001 30.3284 14.6716C30.6999 15.043 30.9945 15.484 31.1955 15.9693C31.3965 16.4546 31.5 16.9747 31.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M31.5 17.5C31.5 16.9747 31.6035 16.4546 31.8045 15.9693C32.0055 15.484 32.3001 15.043 32.6716 14.6716C33.043 14.3001 33.484 14.0055 33.9693 13.8045C34.4546 13.6035 34.9747 13.5 35.5 13.5C36.0253 13.5 36.5454 13.6035 37.0307 13.8045C37.516 14.0055 37.957 14.3001 38.3284 14.6716C38.6999 15.043 38.9945 15.484 39.1955 15.9693C39.3965 16.4546 39.5 16.9747 39.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M39.5 17.5C39.5 16.9747 39.6035 16.4546 39.8045 15.9693C40.0055 15.484 40.3001 15.043 40.6716 14.6716C41.043 14.3001 41.484 14.0055 41.9693 13.8045C42.4546 13.6035 42.9747 13.5 43.5 13.5C44.0253 13.5 44.5454 13.6035 45.0307 13.8045C45.516 14.0055 45.957 14.3001 46.3284 14.6716C46.6999 15.043 46.9945 15.484 47.1955 15.9693C47.3965 16.4546 47.5 16.9747 47.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:58,y:29},color:s})]})]}),fd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-VariableArea"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M46 10V25"}),o.jsxRuntimeExports.jsx(O,{d:"M23 13V22"}),o.jsxRuntimeExports.jsx(O,{d:"M23 13L46 10"}),o.jsxRuntimeExports.jsx(O,{d:"M23 22L46 25"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),hd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Coriolis"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M2 17.6024H28.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M28.5 17.6024L34.6834 14.0324",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M34.8 14L45.9058 20.9666",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M51.5 17.6024L46.0141 20.8987",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M20.5 17.6024L26.6574 14.0474",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M26.75 14.1024L37.788 21.0265",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 17.6024L37.8427 21.0017",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 17.6024H69",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:58,y:29},color:s})]})]}),gd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M24 2V7V12",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M24 12H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M24 23H29H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M24 33V23",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),jd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Venturi"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M8 33L26.5329 22.3",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M8 2L26.5329 12.7",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M56 33L26.5876 22.2948",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M56 2L26.5876 12.7052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:29},color:s})]})]}),Ed=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-RingPiston"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Le,{cx:"36.5",cy:"17.5",r:"10.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Le,{cx:"36.5",cy:"21.5",r:"6.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:29},color:s})]})]}),yd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-PositiveDisplacement"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M41 13C41 15.4853 38.9853 17.5 36.5 17.5C34.0147 17.5 32 15.4853 32 13C32 10.5147 34.0147 8.5 36.5 8.5C38.9853 8.5 41 10.5147 41 13Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M41 22C41 24.4853 38.9853 26.5 36.5 26.5C34.0147 26.5 32 24.4853 32 22C32 19.5147 34.0147 17.5 36.5 17.5C38.9853 17.5 41 19.5147 41 22Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),Sd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Turbine"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M16.5 17.5H54.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M32.5 9L35.4756 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M38.5 26L35.5244 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M32.5 26L35.4756 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M38.5 9L35.5244 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M32.5 9C32.5 8.20435 32.8161 7.44129 33.3787 6.87868C33.9413 6.31607 34.7044 6 35.5 6C36.2956 6 37.0587 6.31607 37.6213 6.87868C38.1839 7.44129 38.5 8.20435 38.5 9",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M38.5 26C38.5 26.7956 38.1839 27.5587 37.6213 28.1213C37.0587 28.6839 36.2956 29 35.5 29C34.7044 29 33.9413 28.6839 33.3787 28.1213C32.8161 27.5587 32.5 26.7956 32.5 26",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),Rd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Pulse"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M31 13.5H39",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M23 21.5H31",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M39 21.5H47",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M39 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),Cd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-FloatSensor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M25 8H46",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31 27H40",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31 27L25.046 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M40 27L45.954 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),bd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("heat-exchanger-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.545,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.454,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.454,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(O,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),wd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:89,top:27.27,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:89,top:72.73,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.455,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.545,top:50,id:"5"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(O,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"}),o.jsxRuntimeExports.jsx(O,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),vd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:9,top:6.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:24,top:93.75,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:76,top:6.25,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:91,top:93.75,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.508,top:50,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.492,top:50,id:"6"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:199,height:48},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"3",y:"3",width:"193",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Se,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Se,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(fe,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24",strokeWidth:"2"})]})]}),Md=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),kd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),_d=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("compressor"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Pd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(Le,{cx:"33",cy:"33",r:"14.5"})]})]}),Ld=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(O,{d:"M35 12.4V20.4"}),o.jsxRuntimeExports.jsx(O,{d:"M3 33H16"}),o.jsxRuntimeExports.jsx(O,{d:"M35 53.6V45.6"})]})]}),Nd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(O,{d:"M39 33C39 33.7879 38.8448 34.5681 38.5433 35.2961C38.2417 36.0241 37.7998 36.6855 37.2426 37.2426C36.6855 37.7998 36.0241 38.2417 35.2961 38.5433C34.5681 38.8448 33.7879 39 33 39C32.2121 39 31.4319 38.8448 30.7039 38.5433C29.9759 38.2417 29.3145 37.7998 28.7574 37.2426C28.2002 36.6855 27.7583 36.0241 27.4567 35.2961C27.1552 34.5681 27 33.7879 27 33C27 32.2121 27.1552 31.4319 27.4567 30.7039C27.7583 29.9759 28.2002 29.3145 28.7574 28.7574C29.3145 28.2002 29.9759 27.7583 30.7039 27.4567C31.4319 27.1552 32.2121 27 33 27C33.7879 27 34.5681 27.1552 35.2961 27.4567C36.0241 27.7583 36.6855 28.2002 37.2426 28.7574C37.7998 29.3145 38.2417 29.9759 38.5433 30.7039C38.8448 31.4319 39 32.2121 39 33L39 33Z"}),o.jsxRuntimeExports.jsx(O,{d:"M39 33H47"}),o.jsxRuntimeExports.jsx(O,{d:"M27 33H19"}),o.jsxRuntimeExports.jsx(O,{d:"M36 27.804L40 20.8758"}),o.jsxRuntimeExports.jsx(O,{d:"M30 27.804L26 20.8758"}),o.jsxRuntimeExports.jsx(O,{d:"M30 38.196L26 45.1242"}),o.jsxRuntimeExports.jsx(O,{d:"M36 38.196L40 45.1242"})]})]}),Td=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Ad=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(O,{d:"M3 33H63"})]})]}),Id=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:7.575,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:92.425,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),$d=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(O,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(O,{d:"M29.12 65.62L61 34.5"})]})]}),zd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M30 2.5L30 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"})]})]}),Bd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(O,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5",strokeLinecap:"square"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Dd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(O,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(O,{d:"M29.12 65.62L61 34.5"}),o.jsxRuntimeExports.jsx(O,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Od=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("thruster"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:25.3,top:4.76,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:25.3,top:95.24,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M78.5 37.5117V4.51172"}),o.jsxRuntimeExports.jsx(O,{d:"M40.5 11.5L76.0072 2.6232"}),o.jsxRuntimeExports.jsx(O,{d:"M40.5 30.5L76.0072 39.3768"}),o.jsxRuntimeExports.jsx(O,{d:"M75.6192 2.71597C75.9231 2.56695 76.2597 2.49745 76.5977 2.51399C76.9357 2.53052 77.264 2.63256 77.5518 2.81053C77.8397 2.98851 78.0776 3.23661 78.2435 3.53161C78.4093 3.82661 78.4975 4.15886 78.4999 4.49726"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Vd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M2.293 2.29297L29.9383 66.7986",strokeDasharray:"6 6"})]})]}),Fd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M31 34.5L2.30611 2.33992",strokeDasharray:"6 6"}),o.jsxRuntimeExports.jsx(O,{d:"M31 34.5L2.30611 66.6601",strokeDasharray:"6 6"})]})]}),Gy=({aetherKey:e,sink:t})=>{const n=E.useMemoDeepEqualProps({sink:t}),[,,s]=E.use$3({aetherKey:e,type:B.Button.TYPE,schema:B.buttonStateZ,initialState:{trigger:0,sink:t}});return g.useEffect(()=>{s(i=>({...i,...n}))},[n]),{click:g.useCallback(()=>{s(i=>({...i,trigger:i.trigger+1}))},[s])}},Yy=({aetherKey:e,source:t})=>{const n=E.useMemoDeepEqualProps({source:t}),[,{enabled:s},r]=E.use$3({aetherKey:e,type:B.Light.TYPE,schema:B.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>r(i=>({...i,...n})),[n,r]),{enabled:s}},Wy="Schematic.Grid",Ky=e=>{const n=Ls(e).closest(".react-flow__pane");n!=null&&E.triggerReflow(n)},As=e=>{const t=({symbolKey:s,items:r,onLocationChange:i})=>{const l=`${s}.${Wy}`,[c,a]=g.useState(!1),d=g.useCallback(({items:y})=>y.every(S=>S.type===l),[l]),x=E.useSyncedRef(i),{startDrag:p,onDragEnd:m,...f}=E.useDragAndDrop({type:l,canDrop:d,onDrop:g.useCallback(({items:y})=>y,[]),onDragOver:g.useCallback(y=>{a(d(y)),y.items.forEach(({key:S})=>x.current(S,e))},[])}),h=r.filter(y=>y.location===e),j=g.useCallback((y,S)=>p([{key:S,type:l}]),[p,l]);return o.jsxRuntimeExports.jsx(te.Space,{direction:u.K.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e),u.CSS.dropRegion(!0),c&&u.CSS.B("dragging-over")),onDragLeave:()=>a(!1),empty:!0,...f,children:h.map(({element:y,key:S})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(y,{draggable:!0,onDragStart:M=>j(M,S),onDragEnd:m,style:{...y.props.style,cursor:"grab"}})},S))})};return({symbolKey:s,...r})=>{const{editable:i,items:l}=r,c=g.useRef(i);if(i!==c.current&&e==="top"&&(Ky(s),c.current=i),i)return o.jsxRuntimeExports.jsx(t,{symbolKey:s,...r});const a=l.filter(d=>d.location===e);return a.length===0?null:o.jsxRuntimeExports.jsx(te.Space,{direction:u.K.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e)),empty:!0,children:a.map(({element:d,key:x})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:d},x))})}},Xy=As("top"),qy=As("left"),Uy=As("right"),Jy=As("bottom"),Nt=({editable:e,onRotate:t,children:n,...s})=>o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Xy,{editable:e,...s}),o.jsxRuntimeExports.jsx(qy,{editable:e,...s}),o.jsxRuntimeExports.jsx(Uy,{editable:e,...s}),o.jsxRuntimeExports.jsx(Jy,{editable:e,...s}),e&&o.jsxRuntimeExports.jsx(E.Icon,{className:u.CSS.BE("grid","rotate"),size:"small",variant:"filled",onClick:t,children:o.jsxRuntimeExports.jsx(E.yt.Rotate,{})}),n]}),Qy=({aetherKey:e,source:t,sink:n})=>{const s=E.useMemoDeepEqualProps({source:t,sink:n}),[,{value:r},i]=E.use$3({aetherKey:e,type:B.Setpoint.TYPE,schema:B.setpointStateZ,initialState:{trigger:0,value:0,...s}});return g.useEffect(()=>{i(c=>({...c,...s}))},[s,i]),{set:g.useCallback(c=>i(a=>({...a,trigger:a.trigger+1,command:c})),[i]),value:r}},e4=({aetherKey:e,source:t,sink:n})=>{const s=E.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:r,enabled:i},l]=E.use$3({aetherKey:e,type:B.Toggle.TYPE,schema:B.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return g.useEffect(()=>{l(a=>({...a,...s}))},[s,l]),{toggle:g.useCallback(()=>l(a=>({...a,triggered:!a.triggered})),[l]),triggered:r,enabled:i}},Kt=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:r="top",direction:i,align:l,maxInlineSize:c}=e;return n==null||n.length===0?null:{key:"label",element:o.jsxRuntimeExports.jsx(E.Editable,{className:u.CSS(u.CSS.BE("symbol","label"),u.CSS.dir(i)),level:s,value:n,onChange:a=>t==null?void 0:t({label:{...e,label:a}}),allowEmpty:!0,style:{textAlign:l,maxInlineSize:c}}),location:r}},Sr=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:r,indicator:i,orientation:l="bottom"}=e;return{key:"control",element:o.jsxRuntimeExports.jsxs(te.Space,{direction:u.g.swap(l),align:"center",className:u.CSS(u.CSS.B("control-state")),size:"small",children:[t&&n&&o.jsxRuntimeExports.jsx(Ql,{size:"small",...r}),t&&s&&o.jsxRuntimeExports.jsx(nc,{...i})]}),location:l}},Ce=e=>{const t=({symbolKey:n,control:s,source:r,sink:i,label:l,onChange:c,draggable:a,selected:d,orientation:x="left",...p})=>{const{enabled:m,triggered:f,toggle:h}=e4({aetherKey:n,source:r,sink:i}),j=[],y=Kt(l,c);y!=null&&j.push(y);const S=Sr(s);return S!=null&&j.push(S),o.jsxRuntimeExports.jsx(Nt,{editable:d&&!a,symbolKey:n,items:j,onRotate:()=>c({orientation:u.K.rotate90(x)}),onLocationChange:(M,C)=>{M==="label"&&c({label:{...l,orientation:C}}),M==="control"&&c({control:{...s,orientation:C}})},children:o.jsxRuntimeExports.jsx(e,{enabled:m,triggered:f,onClick:h,orientation:x,...p})})};return t.displayName=e.displayName,t},xe=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,draggable:l,position:c,orientation:a="left",...d})=>{const x=[],p=Kt(s,r);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Nt,{items:x,editable:i&&!l,symbolKey:n,onRotate:()=>r({orientation:u.K.rotate90(a)}),onLocationChange:(m,f)=>{m==="label"&&r({label:{...s,orientation:f}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,...d})})};return t.displayName=e.displayName,t},ot=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,draggable:l,position:c,orientation:a="left",enabled:d=!1,clickable:x=!1,...p})=>{const m=[],f=Kt(s,r);f!=null&&m.push(f);const h=()=>{x&&r({enabled:!d})};return o.jsxRuntimeExports.jsx(Nt,{items:m,editable:i&&!l,symbolKey:n,onRotate:()=>r({orientation:u.K.rotate90(a)}),onLocationChange:(j,y)=>{j==="label"&&r({label:{...s,orientation:y}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,enabled:d,onClick:h,...p})})};return t.displayName=e.displayName,t},Hd=Ce(pu),Zd=Ce(mu),Gd=Ce(fu),Yd=Ce(xu),Wd=Ce(Eu),Kd=Ce(vu),Xd=Ce(Md),qd=Ce(kd),Ud=Ce(Yu),Jd=Ce(Wu),Qd=Ce(Ku),ex=Ce(qu),tx=Ce(Qu),nx=Ce(ed),sx=Ce(td),ox=Ce(nd),rx=Ce(sd),ix=Ce(od),lx=Ce(Gu),cx=Ce(_d),ax=Ce(Pd),ux=Ce(Ld),dx=Ce(Nd),xx=Ce(Td),px=Ce(Ad),mx=Ce(Cu),fx=Ce(yu),hx=Ce(Su),gx=Ce(Ru),jx=xe($u),Ex=xe(Ju),yx=xe(Mu),Sx=xe(_u),Rx=xe(Pu),Cx=xe(Tu),bx=xe(gu),wx=xe(ju),vx=xe(zu),Mx=Ce(Vu),kx=xe(id),_x=xe(Nu),Px=xe(ld),Lx=xe(ku),Nx=xe(dd),Tx=xe(xd),Ax=xe(Xu),Ix=xe(pd),$x=xe(md),zx=xe(fd),Bx=xe(hd),Dx=xe(gd),Ox=xe(jd),Vx=xe(Ed),Fx=xe(yd),Hx=xe(Sd),Zx=xe(Rd),Gx=xe(Cd),Yx=xe(bd),Wx=xe(wd),Kx=xe(vd),Xx=xe(Id),qx=xe(zd),Ux=xe($d),Jx=xe(Bd),Qx=xe(Dd),ep=xe(Od),tp=xe(Vd),np=xe(Fd),sp=ot(Bu),op=ot(hu),rp=ot(ad),ip=ot(ud),lp=ot(Lu),cp=ot(Du),ap=ot(bu),up=ot(wu),dp=xe(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Ts,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),xp=e=>o.jsxRuntimeExports.jsx(Ts,{...e,dimensions:{width:25,height:50}}),pp=xe(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:r,dimensions:i})=>o.jsxRuntimeExports.jsx(Ts,{onResize:l=>n({dimensions:l}),orientation:s,color:r,dimensions:i,boxBorderRadius:t,backgroundColor:e})),mp=e=>o.jsxRuntimeExports.jsx(Ts,{...e,dimensions:{width:25,height:50},borderRadius:0}),fp=({label:e,symbolKey:t,orientation:n="left",control:s,units:r,source:i,sink:l,color:c,onChange:a,selected:d,draggable:x,size:p,disabled:m})=>{const{value:f,set:h}=Qy({aetherKey:t,source:i,sink:l}),j=[],y=Sr(s);y!=null&&j.push(y);const S=Kt(e,a);return S!=null&&j.push(S),o.jsxRuntimeExports.jsx(Nt,{symbolKey:t,editable:d&&!x,onRotate:()=>a({orientation:u.K.rotate90(n)}),items:j,onLocationChange:(M,C)=>{M==="label"&&a({label:{...e,orientation:C}})},children:o.jsxRuntimeExports.jsx(Zu,{value:f,onChange:h,units:r,color:c,orientation:n,disabled:m,size:p})})},hp=({className:e,...t})=>o.jsxRuntimeExports.jsx(Zu,{value:12,onChange:()=>{},units:"mV",style:{width:120,transform:"scale(0.95)"},className:u.CSS(u.CSS.BM("setpoint","preview"),e),disabled:!0,...t,children:o.jsxRuntimeExports.jsx(E.Text$1,{level:"p",children:"10.0"})}),gp=({symbolKey:e,label:t,level:n="p",position:s,textColor:r,color:i,telem:l,units:c,onChange:a,inlineSize:d=70,selected:x,draggable:p,notation:m})=>{const f=E.useTypography(n),h=(f.lineHeight+.5)*f.baseSize+2,{width:j}=nr({aetherKey:e,color:r,level:n,box:u.Mt.construct(u.G.translateY({...s},1),{height:h,width:d}),telem:l,minWidth:d,notation:m}),y=[],S=Kt(t,a);return S!=null&&y.push(S),o.jsxRuntimeExports.jsx(Nt,{editable:x&&!p,symbolKey:e,items:y,onLocationChange:(M,C)=>{M==="label"&&a({label:{...t,orientation:C}})},children:o.jsxRuntimeExports.jsx(Ou,{color:i,dimensions:{height:h,width:j},inlineSize:d,units:c,unitsLevel:Z.downLevel(n)})})},jp=({color:e})=>o.jsxRuntimeExports.jsx(Ou,{color:e,dimensions:{width:60,height:25},units:"psi",children:o.jsxRuntimeExports.jsx(E.Text$1,{level:"p",children:"50.00"})}),Ep=({symbolKey:e,label:t,orientation:n="left",sink:s,control:r,selected:i,draggable:l,onChange:c,...a})=>{const{click:d}=Gy({aetherKey:e,sink:s}),x=[],p=Sr(r);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Nt,{onRotate:()=>c({orientation:u.K.rotate90(n)}),editable:i&&!l,symbolKey:e,items:x,onLocationChange:(m,f)=>{m==="label"&&c({label:{...t,orientation:f}})},children:o.jsxRuntimeExports.jsx(Fu,{...t,onClick:d,orientation:n,...a})})},yp=({label:e,...t})=>o.jsxRuntimeExports.jsx(Fu,{label:"Button",...t}),Sp=({symbolKey:e,label:t,source:n,onChange:s,selected:r,draggable:i,...l})=>{const{enabled:c}=Yy({aetherKey:e,source:n}),a=[],d=Kt(t,s);return d!=null&&a.push(d),o.jsxRuntimeExports.jsx(Nt,{items:a,editable:r&&!i,symbolKey:e,onLocationChange:(x,p)=>{x==="label"&&s({label:{...t,orientation:p}})},children:o.jsxRuntimeExports.jsx(Uu,{enabled:c,...l})})},Rp=e=>o.jsxRuntimeExports.jsx(Hu,{...e,autoFit:!0,text:"Text Box"}),Cp=({label:{label:e,level:t},orientation:n,color:s,onChange:r})=>o.jsxRuntimeExports.jsx(rd,{onLabelChange:i=>r({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),bp=({label:e,...t})=>o.jsxRuntimeExports.jsx(rd,{label:"Off Page",...t,orientation:"right"}),wp=xe(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(cd,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),vp=e=>o.jsxRuntimeExports.jsx(cd,{...e,dimensions:{width:25,height:50}}),K=4,Rr=2,t4=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","ballValve","threeWayBallValve","gateValve","butterflyValveOne","butterflyValveTwo","breatherValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","flowmeterGeneral","flowmeterElectromagnetic","flowmeterVariableArea","flowmeterCoriolis","flowmeterNozzle","flowmeterVenturi","flowmeterRingPiston","flowmeterPositiveDisplacement","flowmeterTurbine","flowmeterPulse","flowmeterFloatSensor","fourWayValve","helicalAgitator","isoCap","isoCheckValve","isoFilter","light","manualValve","needleValve","orifice","orificePlate","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","springLoadedReliefValve","staticMixer","switch","tank","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","strainer","strainerCone"],n4=ce.z.enum(t4),ae={orientation:"left",scale:1},s4={...ae,source:B.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:B.streamChannelValue({channel:0}),rollingAverage:B.rollingAverage({windowSize:1}),stringifier:B.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},o4={...ae,source:B.sourcePipeline("number",{connections:[],segments:{valueStream:B.streamChannelValue({channel:0})},outlet:"valueStream"})},r4={...ae,sink:B.sinkPipeline("number",{connections:[],segments:{setter:B.setChannelValue({channel:0})},inlet:"setter"})},Mp={...ae,source:B.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:B.streamChannelValue({channel:0}),threshold:B.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},kp={...ae,control:{show:!0},sink:B.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:B.setChannelValue({channel:0}),setpoint:B.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},be={...Mp,...kp},gt={...ae,enabled:!1,clickable:!1},Y=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),i4={width:125,height:200},Cr={dimensions:i4},l4=3,c4={name:"Three Way Valve",key:"threeWayValve",Form:Re,Symbol:Hd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Three Way Valve"),...be}),Preview:pu,zIndex:K},a4={name:"Valve",key:"valve",Form:Re,Symbol:Zd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Valve"),...be}),Preview:mu,zIndex:K},u4={name:"Solenoid Valve",key:"solenoidValve",Form:Re,Symbol:Gd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Solenoid Valve"),normallyOpen:!1,...be}),Preview:fu,zIndex:K},d4={name:"Four Way Valve",key:"fourWayValve",Form:Re,Symbol:Yd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Four Way Valve"),...be}),Preview:xu,zIndex:K},x4={name:"Angled Valve",key:"angledValve",Form:Re,Symbol:Wd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Angled Valve"),...be}),Preview:Eu,zIndex:K},p4={name:"Ball Valve",key:"ballValve",Form:Re,Symbol:fx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ball Valve"),...be}),Preview:yu,zIndex:K},m4={name:"Three-Way Ball Valve",key:"threeWayBallValve",Form:Re,Symbol:hx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Three-Way Ball Valve"),...be}),Preview:Su,zIndex:K},f4={name:"Gate Valve",key:"gateValve",Form:Re,Symbol:gx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Gate Valve"),...be}),Preview:Ru,zIndex:K},h4={name:"Butterfly Valve (Remote)",key:"butterflyValveOne",Form:Re,Symbol:mx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Butterfly Valve (Remote)"),...be}),Preview:Cu,zIndex:K},g4={name:"Butterfly Valve (Manual)",key:"butterflyValveTwo",Form:ht,Symbol:ap,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Butterfly Valve (Manual)"),...gt}),Preview:mt(bu,["clickable"]),zIndex:K},j4={name:"Breather Valve",key:"breatherValve",Form:ht,Symbol:up,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Breather Valve"),...gt}),Preview:mt(wu,["clickable"]),zIndex:K},E4={name:"Pump",key:"pump",Form:Re,Symbol:Kd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Pump"),...be}),Preview:vu,zIndex:K},y4={name:"Screw Pump",key:"screwPump",Form:Re,Symbol:lx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Screw Pump"),...be}),Preview:Gu,zIndex:K},S4={name:"Tank",key:"tank",Form:uu,Symbol:dp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Y("Tank"),borderRadius:yr,...Cr,...ae}),Preview:xp,zIndex:Rr},R4={name:"Cylinder",key:"cylinder",Form:$y,Symbol:wp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Y("cylinder"),dimensions:{width:66,height:181},...ae}),Preview:vp,zIndex:Rr},C4={name:"Box",key:"box",Form:zy,Symbol:pp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Y("Box"),borderRadius:l4,...Cr,...ae}),Preview:mp,zIndex:Rr},b4={name:"Relief Valve",key:"reliefValve",Form:ht,Symbol:op,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Relief Valve"),...gt}),Preview:mt(hu,["clickable"]),zIndex:K},w4={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:ht,Symbol:rp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Spring Loaded Relief Valve"),...gt}),Preview:mt(ad,["clickable"]),zIndex:K},v4={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:ht,Symbol:ip,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Angled Spring Loaded Relief Valve"),...gt}),Preview:mt(ud,["clickable"]),zIndex:K},M4={name:"Regulator",key:"regulator",Form:me,Symbol:jx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Regulator"),...ae}),Preview:$u,zIndex:K},k4={name:"Electric Regulator",key:"electricRegulator",Form:me,Symbol:Ex,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Electric Regulator"),...ae}),Preview:Ju,zIndex:K},_4={name:"Burst Disc",key:"burstDisc",Form:me,Symbol:yx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Burst Disc"),...ae}),Preview:Mu,zIndex:K},P4={name:"ISO Burst Disc",key:"isoBurstDisc",Form:me,Symbol:Lx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Burst Disc"),...ae}),Preview:ku,zIndex:K},L4={name:"Cap",key:"cap",Form:me,Symbol:Sx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Cap"),...ae}),Preview:_u,zIndex:K},N4={name:"ISO Cap",key:"isoCap",Form:me,Symbol:Rx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Cap"),...ae}),Preview:Pu,zIndex:K},T4={name:"Manual Valve",key:"manualValve",Form:ht,Symbol:lp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Manual Valve"),...gt}),Preview:mt(Lu,["clickable"]),zIndex:K},A4={name:"Orifice Plate",key:"orificePlate",Form:me,Symbol:_x,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Orifice Plate"),...ae}),Preview:Nu,zIndex:K},I4={name:"ISO Filter",key:"isoFilter",Form:me,Symbol:Px,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Filter"),...ae}),Preview:ld,zIndex:K},$4={name:"Filter",key:"filter",Form:me,Symbol:Cx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Filter"),...ae}),Preview:Tu,zIndex:K},z4={name:"Needle Valve",key:"needleValve",Form:ht,Symbol:sp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Needle Valve"),...gt}),Preview:mt(Bu,["clickable"]),zIndex:K},B4={name:"Check Valve",key:"checkValve",Form:me,Symbol:bx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Check Valve"),...ae}),Preview:gu,zIndex:K},D4={name:"Orifice",key:"orifice",Form:me,Symbol:vx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Orifice"),...ae}),Preview:zu,zIndex:K},O4={name:"Angled Relief Valve",key:"angledReliefValve",Form:ht,Symbol:cp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Angled Relief Valve"),...gt}),Preview:mt(Du,["clickable"]),zIndex:K},V4={name:"Value",key:"value",Form:My,Symbol:gp,Preview:jp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...Y("Value"),...ae,telem:s4.source}),zIndex:K},F4={name:"Button",key:"button",Symbol:Ep,Form:Ly,Preview:yp,defaultProps:e=>({color:e.colors.primary.z.rgba255,...Y("Button"),...kp,onClickDelay:0,scale:null}),zIndex:K},H4={name:"Switch",key:"switch",Symbol:Mx,Form:By,defaultProps:()=>({...Y("Switch"),...be,scale:null}),Preview:Vu,zIndex:K},Z4={name:"Vacuum Pump",key:"vacuumPump",Symbol:Ud,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Vacuum Pump"),...be}),Preview:Yu,zIndex:K},G4={name:"Compressor",key:"compressor",Symbol:cx,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Compressor"),...be}),Preview:_d,zIndex:K},Y4={name:"Cavity Pump",key:"cavityPump",Symbol:Jd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Cavity Pump"),...be}),Preview:Wu,zIndex:K},W4={name:"Piston Pump",key:"pistonPump",Symbol:Qd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Piston Pump"),...be}),Preview:Ku,zIndex:K},K4={name:"Static Mixer",key:"staticMixer",Symbol:Ax,Form:me,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Static Mixer"),...ae}),Preview:Xu,zIndex:K},X4={name:"Rotary Mixer",key:"rotaryMixer",Symbol:ex,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Rotary Mixer"),...be}),Preview:qu,zIndex:K},q4={name:"Light",key:"light",Symbol:Sp,Form:_y,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Light"),...Mp}),Preview:Uu,zIndex:K},U4={name:"Setpoint",key:"setpoint",Symbol:fp,Form:Ty,defaultProps:e=>({units:"mV",color:e.colors.gray.l9.rgba255,size:"small",...Y("Setpoint"),...o4,...r4}),Preview:hp,zIndex:K},J4={name:"Agitator",key:"agitator",Symbol:tx,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Agitator"),...be}),Preview:Qu,zIndex:K},Q4={name:"Propeller Agitator",key:"propellerAgitator",Symbol:nx,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Propeller Agitator"),...be}),Preview:ed,zIndex:K},eS={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:sx,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flat Blade Agitator"),...be}),Preview:td,zIndex:K},tS={name:"Paddle Agitator",key:"paddleAgitator",Symbol:ox,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Paddle Agitator"),...be}),Preview:nd,zIndex:K},nS={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:rx,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Cross Beam Agitator"),...be}),Preview:sd,zIndex:K},sS={name:"Helical Agitator",key:"helicalAgitator",Symbol:ix,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Helical Agitator"),...be}),Preview:od,zIndex:K},oS={name:"Text Box",key:"textBox",Symbol:Hu,Form:Ay,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...Y("Text Box"),...ae,...Cr,level:"p",text:"Text Box",width:75}),Preview:Rp,zIndex:K},rS={name:"Off Page Reference",key:"offPageReference",Form:Iy,Symbol:Cp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...Y("Off Page Reference")}),Preview:bp,zIndex:K},iS={name:"ISO Check Valve",key:"isoCheckValve",Form:me,Symbol:wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Check Valve"),...ae}),Preview:ju,zIndex:K},lS={name:"Vent",key:"vent",Form:me,Symbol:kx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Vent"),...ae}),Preview:id,zIndex:K},cS={name:"T Junction",key:"tJunction",Form:me,Symbol:Nx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y(""),...ae}),Preview:dd,zIndex:K+20},aS={name:"Cross Junction",key:"crossJunction",Form:me,Symbol:Tx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y(""),...ae}),Preview:xd,zIndex:K+20},uS={name:"Flowmeter General",key:"flowmeterGeneral",Form:me,Symbol:Ix,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("General Flowmeter"),...ae}),Preview:pd,zIndex:K},dS={name:"Flowmeter Electromagnetic",key:"flowmeterElectromagnetic",Form:me,Symbol:$x,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Electromagnetic Flowmeter"),...ae}),Preview:md,zIndex:K},xS={name:"Flowmeter Variable Area",key:"flowmeterVariableArea",Form:me,Symbol:zx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Variable Area Flowmeter"),...ae}),Preview:fd,zIndex:K},pS={name:"Flowmeter Coriolis",key:"flowmeterCoriolis",Form:me,Symbol:Bx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Coriolis Flowmeter"),...ae}),Preview:hd,zIndex:K},mS={name:"Flowmeter Nozzle",key:"flowmeterNozzle",Form:me,Symbol:Dx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Nozzle Flowmeter"),...ae}),Preview:gd,zIndex:K},fS={name:"Flowmeter Venturi",key:"flowmeterVenturi",Form:me,Symbol:Ox,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Venturi Flowmeter"),...ae}),Preview:jd,zIndex:K},hS={name:"Flowmeter Ring Piston",key:"flowmeterRingPiston",Form:me,Symbol:Vx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ring Piston Flowmeter"),...ae}),Preview:Ed,zIndex:K},gS={name:"Flowmeter Positive Displacement",key:"flowmeterPositiveDisplacement",Form:me,Symbol:Fx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Positive Displacement Flowmeter"),...ae}),Preview:yd,zIndex:K},jS={name:"Flowmeter Turbine",key:"flowmeterTurbine",Form:me,Symbol:Hx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Turbine Flowmeter"),...ae}),Preview:Sd,zIndex:K},ES={name:"Flowmeter Pulse",key:"flowmeterPulse",Form:me,Symbol:Zx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Pulse Flowmeter"),...ae}),Preview:Rd,zIndex:K},yS={name:"Flowmeter Float Sensor",key:"flowmeterFloatSensor",Form:me,Symbol:Gx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Float Sensor Flowmeter"),...ae}),Preview:Cd,zIndex:K},SS={name:"Heat Exchanger General",key:"heatExchangerGeneral",Form:me,Symbol:Yx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("General Heat Exchanger"),...ae}),Preview:bd,zIndex:K},RS={name:"Heat Exchanger M",key:"heatExchangerM",Form:me,Symbol:Wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("M Heat Exchanger"),...ae}),Preview:wd,zIndex:K},CS={name:"Heat Exchanger Straight Tube",key:"heatExchangerStraightTube",Form:me,Symbol:Kx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Straight Tube Heat Exchanger"),...ae}),Preview:vd,zIndex:K},bS={name:"Turbo Compressor",key:"turboCompressor",Form:Re,Symbol:ax,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Turbo Compressor"),...be}),Preview:Pd,zIndex:K},wS={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:Re,Symbol:ux,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Roller Vane Compressor"),...be}),Preview:Ld,zIndex:K},vS={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:Re,Symbol:dx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Liquid Ring Compressor"),...be}),Preview:Nd,zIndex:K},MS={name:"Ejector Compressor",key:"ejectorCompressor",Form:Re,Symbol:xx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ejector Compressor"),...be}),Preview:Td,zIndex:K},kS={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:Re,Symbol:px,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Centrifugal Compressor"),...be}),Preview:Ad,zIndex:K},_S={name:"Diaphragm Pump",key:"diaphragmPump",Form:Re,Symbol:Xd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Diaphragm Pump"),...be}),Preview:Md,zIndex:K},PS={name:"Ejection Pump",key:"ejectionPump",Form:Re,Symbol:qd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ejection Pump"),...be}),Preview:kd,zIndex:K},LS={name:"Flame Arrestor",key:"flameArrestor",Form:me,Symbol:Xx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor"),...ae}),Preview:Id,zIndex:K},NS={name:"Flame Arrestor (Explosion-Proof)",key:"flameArrestorExplosion",Form:me,Symbol:qx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Explosion-Proof)"),...ae}),Preview:zd,zIndex:K},TS={name:"Flame Arrestor (Detonation-Proof)",key:"flameArrestorDetonation",Form:me,Symbol:Ux,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Detonation-Proof)"),...ae}),Preview:$d,zIndex:K},AS={name:"Flame Arrestor (Fire Resistant)",key:"flameArrestorFireRes",Form:me,Symbol:Jx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Fire Resistant)"),...ae}),Preview:Bd,zIndex:K},IS={name:"Flame Arrestor (Fire Resistant and Detonation-Proof)",key:"flameArrestorFireResDetonation",Form:me,Symbol:Qx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...ae}),Preview:Dd,zIndex:K},$S={name:"Thruster",key:"thruster",Form:Re,Symbol:ep,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Thruster"),...be}),Preview:Od,zIndex:K},zS={name:"Strainer",key:"strainer",Form:me,Symbol:tp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Strainer"),...ae}),Preview:Vd,zIndex:K},BS={name:"Strainer Cone",key:"strainerCone",Form:me,Symbol:np,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Strainer Cone"),...ae}),Preview:Fd,zIndex:K},DS={value:V4,button:F4,tank:S4,tJunction:cS,crossJunction:aS,switch:H4,offPageReference:rS,light:q4,setpoint:U4,box:C4,textBox:oS,valve:a4,solenoidValve:u4,threeWayValve:c4,fourWayValve:d4,angledValve:x4,ballValve:p4,threeWayBallValve:m4,gateValve:f4,butterflyValveOne:h4,butterflyValveTwo:g4,breatherValve:j4,manualValve:T4,needleValve:z4,reliefValve:b4,angledReliefValve:O4,checkValve:B4,regulator:M4,electricRegulator:k4,springLoadedReliefValve:w4,angledSpringLoadedReliefValve:v4,pump:E4,pistonPump:W4,screwPump:y4,cavityPump:Y4,diaphragmPump:_S,ejectionPump:PS,vacuumPump:Z4,compressor:G4,turboCompressor:bS,rollerVaneCompressor:wS,liquidRingCompressor:vS,ejectorCompressor:MS,centrifugalCompressor:kS,staticMixer:K4,rotaryMixer:X4,burstDisc:_4,isoBurstDisc:P4,cap:L4,isoCap:N4,filter:$4,isoFilter:I4,orifice:D4,orificePlate:A4,agitator:J4,propellerAgitator:Q4,flatBladeAgitator:eS,paddleAgitator:tS,crossBeamAgitator:nS,helicalAgitator:sS,isoCheckValve:iS,vent:lS,cylinder:R4,flowmeterGeneral:uS,flowmeterElectromagnetic:dS,flowmeterVariableArea:xS,flowmeterCoriolis:pS,flowmeterNozzle:mS,flowmeterVenturi:fS,flowmeterRingPiston:hS,flowmeterPositiveDisplacement:gS,flowmeterTurbine:jS,flowmeterPulse:ES,flowmeterFloatSensor:yS,heatExchangerGeneral:SS,heatExchangerM:RS,heatExchangerStraightTube:CS,flameArrestor:LS,flameArrestorExplosion:NS,flameArrestorDetonation:TS,flameArrestorFireRes:AS,flameArrestorFireResDetonation:IS,thruster:$S,strainer:zS,strainerCone:BS},OS=Object.freeze(Object.defineProperty({__proto__:null,Agitator:tx,AngledReliefValve:cp,AngledSpringLoadedReliefValve:ip,AngledValve:Wd,BallValve:fx,Box:pp,BoxPreview:mp,BreatherValve:up,BurstDisc:yx,ButterflyValveOne:mx,ButterflyValveTwo:ap,Button:Ep,ButtonPreview:yp,Cap:Sx,CavityPump:Jd,CentrifugalCompressor:px,CheckValve:bx,Compressor:cx,CrossBeamAgitator:rx,CrossJunction:Tx,Cylinder:wp,CylinderPreview:vp,DiaphragmPump:Xd,EjectionPump:qd,EjectorCompressor:xx,ElectricRegulator:Ex,Filter:Cx,FlameArrestor:Xx,FlameArrestorDetonation:Ux,FlameArrestorExplosion:qx,FlameArrestorFireRes:Jx,FlameArrestorFireResDetonation:Qx,FlatBladeAgitator:sx,FlowmeterCoriolis:Bx,FlowmeterElectromagnetic:$x,FlowmeterFloatSensor:Gx,FlowmeterGeneral:Ix,FlowmeterNozzle:Dx,FlowmeterPositiveDisplacement:Fx,FlowmeterPulse:Zx,FlowmeterRingPiston:Vx,FlowmeterTurbine:Hx,FlowmeterVariableArea:zx,FlowmeterVenturi:Ox,FourWayValve:Yd,GateValve:gx,HeatExchangerGeneral:Yx,HeatExchangerM:Wx,HeatExchangerStraightTube:Kx,HelicalAgitator:ix,ISOBurstDisc:Lx,ISOCap:Rx,ISOCheckValve:wx,ISOFilter:Px,Light:Sp,LiquidRingCompressor:dx,ManualValve:lp,NeedleValve:sp,OffPageReference:Cp,OffPageReferencePreview:bp,Orifice:vx,OrificePlate:_x,PaddleAgitator:ox,PistonPump:Qd,PropellerAgitator:nx,Pump:Kd,Regulator:jx,ReliefValve:op,RollerVaneCompressor:ux,RotaryMixer:ex,SYMBOLS:DS,ScrewPump:lx,Setpoint:fp,SetpointPreview:hp,SolenoidValve:Gd,SpringLoadedReliefValve:rp,StaticMixer:Ax,Strainer:tp,StrainerCone:np,Switch:Mx,TJunction:Nx,Tank:dp,TankPreview:xp,TextBoxPreview:Rp,ThreeWayBallValve:hx,ThreeWayValve:Hd,Thruster:ep,TurboCompressor:ax,VacuumPump:Ud,Value:gp,ValuePreview:jp,Valve:Zd,Vent:kx,createDummyToggle:ot,createLabeled:xe,createToggle:Ce,variantZ:n4},Symbol.toStringTag,{value:"Module"}));exports.Aether=E.main;exports.Dialog=E.use$4;exports.Divider=E.Divider$1;exports.Dropdown=E.Dropdown;exports.Haul=E.Haul;exports.Worker=E.Context$1;exports.compareArrayDeps=E.compareArrayDeps;exports.componentRenderProp=E.componentRenderProp;exports.isRenderProp=E.isRenderProp;exports.useAsyncEffect=E.useAsyncEffect;exports.useClickOutside=E.useClickOutside;exports.useCombinedRefs=E.useCombinedRefs;exports.useCombinedStateAndRef=E.useCombinedStateAndRef;exports.useDebouncedCallback=E.useDebouncedCallback;exports.useEffectCompare=E.useEffectCompare;exports.useMemoCompare=E.useMemoCompare;exports.useMemoDeepEqualProps=E.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=E.useMemoPrimitiveArray;exports.usePrevious=E.usePrevious;exports.useResize=E.useResize;exports.useStateRef=E.useStateRef;exports.useSyncedRef=E.useSyncedRef;exports.useTransforms=E.useTransforms;exports.CSS=u.CSS;exports.newBEM=u.newBEM;exports.Header=zn.external;exports.DataType=Z.g;exports.Density=Z.b;exports.MultiSeries=Z.Dt;exports.Rate=Z.$;exports.Series=Z.Z;exports.TimeRange=Z.E;exports.TimeSpan=Z.w;exports.TimeStamp=Z.m;exports.state=Z.state;exports.Generic=te.Generic;exports.Align=Lm.external;exports.Icon=Me.Icon;exports.Tabs=Me.external;exports.Text=ve.external;exports.Button=Nm.external;exports.Caret=_o.Animated$1;exports.telem=B.external;exports.Triggers=Ki.external;exports.List=Gt.external;exports.createFilterTransform=Gt.createFilterTransform;exports.fuseFilter=Gt.fuseFilter;exports.proxyMemo=Gt.proxyMemo;exports.Color=Tm.external;exports.createHexOpacityVariants=Xi.createHexOpacityVariants;exports.unitProperty=Xi.unitProperty;exports.Input=Ne.external;exports.Menu=Am.external;exports.Theming=Im.external;exports.Tree=$m.external;exports.Video=zm.Video;exports.Accordion=af;exports.Breadcrumb=pf;exports.Canvas=Lf;exports.Channel=_h;exports.Control=Tg;exports.Device=Yh;exports.Diagram=Ry;exports.Eraser=Wm;exports.Form=Hh;exports.Label=Jh;exports.Legend=$f;exports.Line=Bf;exports.LinePlot=mh;exports.Log=by;exports.Measure=jh;exports.Modal=eg;exports.Mosaic=gg;exports.Nav=qm;exports.Note=Eg;exports.OS=bg;exports.Observe=Vh;exports.Override=vg;exports.Pluto=zg;exports.Portal=ag;exports.Progress=Dg;exports.Range=hh;exports.Ranger=Yg;exports.Resize=Gm;exports.Rule=Eh;exports.Schematic=OS;exports.Select=th;exports.Status=Qm;exports.Steps=Kg;exports.Synnax=hf;exports.Table=Qg;exports.TableCells=g1;exports.Tag=Jf;exports.Telem=_g;exports.Tooltip=ef;exports.Value=s1;exports.Viewport=xh;exports.axis=vf;exports.control=Mf;exports.useDelayedState=Bm;
38
+ `)),x=d.reduce((p,m)=>p.concat(...m),[]);return[d,x]}return[[],[]]},[e]);return g.useEffect(()=>{const a=(t==null?void 0:t.target)||wi;if(e!==null){const d=m=>{if(r.current=m.ctrlKey||m.metaKey||m.shiftKey,(!r.current||r.current&&!t.actInsideInputWithModifier)&&Ro(m))return!1;const h=ki(m.code,c);i.current.add(m[h]),vi(l,i.current,!1)&&(m.preventDefault(),s(!0))},x=m=>{if((!r.current||r.current&&!t.actInsideInputWithModifier)&&Ro(m))return!1;const h=ki(m.code,c);vi(l,i.current,!0)?(s(!1),i.current.clear()):i.current.delete(m[h]),m.key==="Meta"&&i.current.clear(),r.current=!1},p=()=>{i.current.clear(),s(!1)};return a==null||a.addEventListener("keydown",d),a==null||a.addEventListener("keyup",x),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{a==null||a.removeEventListener("keydown",d),a==null||a.removeEventListener("keyup",x),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,s]),n}function vi(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(r=>t.has(r)))}function ki(e,t){return t.includes(e)?"code":"key"}const t5=()=>{const e=we();return g.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,r,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??s,y:t.y??r,zoom:t.zoom??i},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},fitView:t=>{const{nodeLookup:n,minZoom:s,maxZoom:r,panZoom:i,domNode:l}=e.getState();if(!i||!l)return Promise.resolve(!1);const c=Eo(n,t),{width:a,height:d}=ks(l);return yo({nodes:c,width:a,height:d,minZoom:s,maxZoom:r,panZoom:i},t)},setCenter:async(t,n,s)=>{const{width:r,height:i,maxZoom:l,panZoom:c}=e.getState(),a=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:l,d=r/2-t*a,x=i/2-n*a;return c?(await c.setViewport({x:d,y:x,zoom:a},{duration:s==null?void 0:s.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:s,height:r,minZoom:i,maxZoom:l,panZoom:c}=e.getState(),a=ur(t,s,r,i,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(a,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:s,snapGrid:r,domNode:i}=e.getState();if(!i)return t;const{x:l,y:c}=i.getBoundingClientRect(),a={x:t.x-l,y:t.y-c};return bn(a,s,n.snapToGrid,r)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:r,y:i}=s.getBoundingClientRect(),l=qc(t,n);return{x:l.x+r,y:l.y+i}}}),[])};function Ca(e,t){const n=[],s=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")s.set(i.id,[i]);else{const l=s.get(i.id);l?l.push(i):s.set(i.id,[i])}for(const i of t){const l=s.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...i};for(const a of l)n5(a,c);n.push(c)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function n5(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={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function ba(e,t){return Ca(e,t)}function wa(e,t){return Ca(e,t)}function Et(e,t){return{id:e,type:"select",selected:t}}function It(e,t=new Set,n=!1){const s=[];for(const[r,i]of e){const l=t.has(r);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),s.push(Et(i.id,l)))}return s}function _i({items:e=[],lookup:t}){var r;const n=[],s=new Map(e.map(i=>[i.id,i]));for(const[i,l]of e.entries()){const c=t.get(l.id),a=((r=c==null?void 0:c.internals)==null?void 0:r.userNode)??c;a!==void 0&&a!==l&&n.push({id:l.id,item:l,type:"replace"}),a===void 0&&n.push({item:l,type:"add",index:i})}for(const[i]of t)s.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function Mi(e){return{id:e.id,type:"remove"}}const Li=e=>$2(e),s5=e=>Zc(e);function va(e){return g.forwardRef(e)}const o5=typeof window<"u"?g.useLayoutEffect:g.useEffect;function Pi(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>r5(()=>n(r=>r+BigInt(1))));return o5(()=>{const r=s.get();r.length&&(e(r),s.reset())},[t]),s}function r5(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const ka=g.createContext(null);function i5({children:e}){const t=we(),n=g.useCallback(c=>{const{nodes:a=[],setNodes:d,hasDefaultNodes:x,onNodesChange:p,nodeLookup:m}=t.getState();let f=a;for(const h of c)f=typeof h=="function"?h(f):h;x?d(f):p&&p(_i({items:f,lookup:m}))},[]),s=Pi(n),r=g.useCallback(c=>{const{edges:a=[],setEdges:d,hasDefaultEdges:x,onEdgesChange:p,edgeLookup:m}=t.getState();let f=a;for(const h of c)f=typeof h=="function"?h(f):h;x?d(f):p&&p(_i({items:f,lookup:m}))},[]),i=Pi(r),l=g.useMemo(()=>({nodeQueue:s,edgeQueue:i}),[]);return o.jsxRuntimeExports.jsx(ka.Provider,{value:l,children:e})}function l5(){const e=g.useContext(ka);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const c5=e=>!!e.panZoom;function Lt(){const e=t5(),t=we(),n=l5(),s=Ee(c5),r=g.useMemo(()=>{const i=p=>t.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},a=p=>{var S,k;const{nodeLookup:m,nodeOrigin:f}=t.getState(),h=Li(p)?p:m.get(p.id),E=h.parentId?Jc(h.position,h.measured,h.parentId,m,f):h.position,y={...h,position:E,width:((S=h.measured)==null?void 0:S.width)??h.width,height:((k=h.measured)==null?void 0:k.height)??h.height};return Ht(y)},d=(p,m,f={replace:!1})=>{l(h=>h.map(E=>{if(E.id===p){const y=typeof m=="function"?m(E):m;return f.replace&&Li(y)?y:{...E,...y}}return E}))},x=(p,m,f={replace:!1})=>{c(h=>h.map(E=>{if(E.id===p){const y=typeof m=="function"?m(E):m;return f.replace&&s5(y)?y:{...E,...y}}return E}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var m;return(m=i(p))==null?void 0:m.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:c,addNodes:p=>{const m=Array.isArray(p)?p:[p];n.nodeQueue.push(f=>[...f,...m])},addEdges:p=>{const m=Array.isArray(p)?p:[p];n.edgeQueue.push(f=>[...f,...m])},toObject:()=>{const{nodes:p=[],edges:m=[],transform:f}=t.getState(),[h,E,y]=f;return{nodes:p.map(S=>({...S})),edges:m.map(S=>({...S})),viewport:{x:h,y:E,zoom:y}}},deleteElements:async({nodes:p=[],edges:m=[]})=>{const{nodes:f,edges:h,onNodesDelete:E,onEdgesDelete:y,triggerNodeChanges:S,triggerEdgeChanges:k,onDelete:C,onBeforeDelete:b}=t.getState(),{nodes:w,edges:L}=await D2({nodesToRemove:p,edgesToRemove:m,nodes:f,edges:h,onBeforeDelete:b}),_=L.length>0,N=w.length>0;if(_){const A=L.map(Mi);y==null||y(L),k(A)}if(N){const A=w.map(Mi);E==null||E(w),S(A)}return(N||_)&&(C==null||C({nodes:w,edges:L})),{deletedNodes:w,deletedEdges:L}},getIntersectingNodes:(p,m=!0,f)=>{const h=si(p),E=h?p:a(p),y=f!==void 0;return E?(f||t.getState().nodes).filter(S=>{const k=t.getState().nodeLookup.get(S.id);if(k&&!h&&(S.id===p.id||!k.internals.positionAbsolute))return!1;const C=Ht(y?S:k),b=fn(C,E);return m&&b>0||b>=E.width*E.height}):[]},isNodeIntersecting:(p,m,f=!0)=>{const E=si(p)?p:a(p);if(!E)return!1;const y=fn(E,m);return f&&y>0||y>=E.width*E.height},updateNode:d,updateNodeData:(p,m,f={replace:!1})=>{d(p,h=>{const E=typeof m=="function"?m(h):m;return f.replace?{...h,data:E}:{...h,data:{...h.data,...E}}},f)},updateEdge:x,updateEdgeData:(p,m,f={replace:!1})=>{x(p,h=>{const E=typeof m=="function"?m(h):m;return f.replace?{...h,data:E}:{...h,data:{...h.data,...E}}},f)},getNodesBounds:p=>{const{nodeLookup:m,nodeOrigin:f}=t.getState();return z2(p,{nodeLookup:m,nodeOrigin:f})},getHandleConnections:({type:p,id:m,nodeId:f})=>{var h;return Array.from(((h=t.getState().connectionLookup.get(`${f}-${p}-${m??null}`))==null?void 0:h.values())??[])}}},[]);return g.useMemo(()=>({...r,...e,viewportInitialized:s}),[s])}const Ti=e=>e.selected,a5={actInsideInputWithModifier:!1},u5=typeof window<"u"?window:void 0;function d5({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=we(),{deleteElements:s}=Lt(),r=gn(e,a5),i=gn(t,{target:u5});g.useEffect(()=>{if(r){const{edges:l,nodes:c}=n.getState();s({nodes:c.filter(Ti),edges:l.filter(Ti)}),n.setState({nodesSelectionActive:!1})}},[r]),g.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function x5(e){const t=we();g.useEffect(()=>{const n=()=>{var r,i;if(!e.current)return!1;const s=ks(e.current);(s.height===0||s.width===0)&&((i=(r=t.getState()).onError)==null||i.call(r,"004",Ie.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Ls={position:"absolute",width:"100%",height:"100%",top:0,left:0},p5=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function m5({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=Rt.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:a,translateExtent:d,minZoom:x,maxZoom:p,zoomActivationKeyCode:m,preventScrolling:f=!0,children:h,noWheelClassName:E,noPanClassName:y,onViewportChange:S,isControlledViewport:k,paneClickDistance:C}){const b=we(),w=g.useRef(null),{userSelectionActive:L,lib:_}=Ee(p5,_e),N=gn(m),A=g.useRef();x5(w);const I=g.useCallback(F=>{S==null||S({x:F[0],y:F[1],zoom:F[2]}),k||b.setState({transform:F})},[S,k]);return g.useEffect(()=>{if(w.current){A.current=g3({domNode:w.current,minZoom:x,maxZoom:p,translateExtent:d,viewport:a,paneClickDistance:C,onDraggingChange:R=>b.setState({paneDragging:R}),onPanZoomStart:(R,T)=>{const{onViewportChangeStart:M,onMoveStart:D}=b.getState();D==null||D(R,T),M==null||M(T)},onPanZoom:(R,T)=>{const{onViewportChange:M,onMove:D}=b.getState();D==null||D(R,T),M==null||M(T)},onPanZoomEnd:(R,T)=>{const{onViewportChangeEnd:M,onMoveEnd:D}=b.getState();D==null||D(R,T),M==null||M(T)}});const{x:F,y:$,zoom:z}=A.current.getViewport();return b.setState({panZoom:A.current,transform:[F,$,z],domNode:w.current.closest(".react-flow")}),()=>{var R;(R=A.current)==null||R.destroy()}}},[]),g.useEffect(()=>{var F;(F=A.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:N,preventScrolling:f,noPanClassName:y,userSelectionActive:L,noWheelClassName:E,lib:_,onTransformChange:I})},[e,t,n,s,r,i,l,c,N,f,y,L,E,_,I]),o.jsxRuntimeExports.jsx("div",{className:"react-flow__renderer",ref:w,style:Ls,children:h})}const f5=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function h5(){const{userSelectionActive:e,userSelectionRect:t}=Ee(f5,_e);return e&&t?o.jsxRuntimeExports.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const no=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},g5=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function j5({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Vt.Full,panOnDrag:s,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:a,onPaneScroll:d,onPaneMouseEnter:x,onPaneMouseMove:p,onPaneMouseLeave:m,children:f}){const h=g.useRef(null),E=we(),y=g.useRef(0),S=g.useRef(0),k=g.useRef(),C=g.useRef(new Map),{userSelectionActive:b,elementsSelectable:w,dragging:L}=Ee(g5,_e),_=w&&(e||b),N=g.useRef(!1),A=g.useRef(!1),I=()=>{E.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,S.current=0},F=P=>{if(N.current){N.current=!1;return}c==null||c(P),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},$=P=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){P.preventDefault();return}a==null||a(P)},z=d?P=>d(P):void 0,R=P=>{var ee,ne,se,ie;const{resetSelectedElements:V,domNode:H,edgeLookup:G}=E.getState();if(k.current=H==null?void 0:H.getBoundingClientRect(),!w||!e||P.button!==0||P.target!==h.current||!k.current)return;(ne=(ee=P.target)==null?void 0:ee.setPointerCapture)==null||ne.call(ee,P.pointerId),A.current=!0,N.current=!1,C.current=new Map;for(const[U,ue]of G)C.current.set(ue.source,((se=C.current.get(ue.source))==null?void 0:se.add(U))||new Set([U])),C.current.set(ue.target,((ie=C.current.get(ue.target))==null?void 0:ie.add(U))||new Set([U]));const{x:q,y:oe}=Qe(P.nativeEvent,k.current);V(),E.setState({userSelectionRect:{width:0,height:0,startX:q,startY:oe,x:q,y:oe}}),i==null||i(P)},T=P=>{const{userSelectionRect:V,edgeLookup:H,transform:G,nodeLookup:q,triggerNodeChanges:oe,triggerEdgeChanges:ee}=E.getState();if(!k.current||!V)return;N.current=!0;const{x:ne,y:se}=Qe(P.nativeEvent,k.current),{startX:ie,startY:U}=V,ue={startX:ie,startY:U,x:ne<ie?ne:ie,y:se<U?se:U,width:Math.abs(ne-ie),height:Math.abs(se-U)},ge=Gc(q,ue,G,n===Vt.Partial,!0),pe=new Set,re=new Set;for(const Q of ge){re.add(Q.id);const le=C.current.get(Q.id);if(le)for(const je of le)pe.add(je)}if(y.current!==re.size){y.current=re.size;const Q=It(q,re,!0);oe(Q)}if(S.current!==pe.size){S.current=pe.size;const Q=It(H,pe);ee(Q)}E.setState({userSelectionRect:ue,userSelectionActive:!0,nodesSelectionActive:!1})},M=P=>{var H,G;if(P.button!==0||!A.current)return;(G=(H=P.target)==null?void 0:H.releasePointerCapture)==null||G.call(H,P.pointerId);const{userSelectionRect:V}=E.getState();!b&&V&&P.target===h.current&&(F==null||F(P)),y.current>0&&E.setState({nodesSelectionActive:!0}),I(),l==null||l(P),(t||r)&&(N.current=!1),A.current=!1},D=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxRuntimeExports.jsxs("div",{className:Me(["react-flow__pane",{draggable:D,dragging:L,selection:e}]),onClick:_?void 0:no(F,h),onContextMenu:no($,h),onWheel:no(z,h),onPointerEnter:_?void 0:x,onPointerDown:_?R:p,onPointerMove:_?T:p,onPointerUp:_?M:void 0,onPointerLeave:m,ref:h,style:Ls,children:[f,o.jsxRuntimeExports.jsx(h5,{})]})}function ko({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:c,onError:a}=t.getState(),d=c.get(e);if(!d){a==null||a("012",Ie.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var x;return(x=s==null?void 0:s.current)==null?void 0:x.blur()})):r([e])}function _a({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:r,isSelectable:i,nodeClickDistance:l}){const c=we(),[a,d]=g.useState(!1),x=g.useRef();return g.useEffect(()=>{x.current=s3({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{ko({id:p,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),g.useEffect(()=>{var p,m;if(t)(p=x.current)==null||p.destroy();else if(e.current)return(m=x.current)==null||m.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:l}),()=>{var f;(f=x.current)==null||f.destroy()}},[n,s,t,i,e,r]),a}const E5=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Ma(){const e=we();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:r,snapGrid:i,nodesDraggable:l,onError:c,updateNodePositions:a,nodeLookup:d,nodeOrigin:x}=e.getState(),p=new Map,m=E5(l),f=r?i[0]:5,h=r?i[1]:5,E=n.direction.x*f*n.factor,y=n.direction.y*h*n.factor;for(const[,S]of d){if(!m(S))continue;let k={x:S.internals.positionAbsolute.x+E,y:S.internals.positionAbsolute.y+y};r&&(k=vs(k,i));const{position:C,positionAbsolute:b}=Yc({nodeId:S.id,nextPosition:k,nodeLookup:d,nodeExtent:s,nodeOrigin:x,onError:c});S.position=C,S.internals.positionAbsolute=b,p.set(S.id,S)}a(p)},[])}const hr=g.createContext(null),y5=hr.Provider;hr.Consumer;const La=()=>g.useContext(hr),S5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),R5=(e,t,n)=>s=>{const{connectionClickStartHandle:r,connectionMode:i,connection:l}=s,{fromHandle:c,toHandle:a,isValid:d}=l,x=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:x,clickConnecting:(r==null?void 0:r.nodeId)===e&&(r==null?void 0:r.id)===t&&(r==null?void 0:r.type)===n,isPossibleEndHandle:i===kt.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,valid:x&&d}};function C5({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:l,onConnect:c,children:a,className:d,onMouseDown:x,onTouchStart:p,...m},f){var R,T;const h=l||null,E=e==="target",y=we(),S=La(),{connectOnClick:k,noPanClassName:C,rfId:b}=Ee(S5,_e),{connectingFrom:w,connectingTo:L,clickConnecting:_,isPossibleEndHandle:N,connectionInProcess:A,valid:I}=Ee(R5(S,h,e),_e);S||(T=(R=y.getState()).onError)==null||T.call(R,"010",Ie.error010());const F=M=>{const{defaultEdgeOptions:D,onConnect:P,hasDefaultEdges:V}=y.getState(),H={...D,...M};if(V){const{edges:G,setEdges:q}=y.getState();q(ra(H,G))}P==null||P(H),c==null||c(H)},$=M=>{if(!S)return;const D=ea(M.nativeEvent);if(r&&(D&&M.button===0||!D)){const P=y.getState();vo.onPointerDown(M.nativeEvent,{autoPanOnConnect:P.autoPanOnConnect,connectionMode:P.connectionMode,connectionRadius:P.connectionRadius,domNode:P.domNode,nodeLookup:P.nodeLookup,lib:P.lib,isTarget:E,handleId:h,nodeId:S,flowId:P.rfId,panBy:P.panBy,cancelConnection:P.cancelConnection,onConnectStart:P.onConnectStart,onConnectEnd:P.onConnectEnd,updateConnection:P.updateConnection,onConnect:F,isValidConnection:n||P.isValidConnection,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:P.autoPanSpeed})}D?x==null||x(M):p==null||p(M)},z=M=>{const{onClickConnectStart:D,onClickConnectEnd:P,connectionClickStartHandle:V,connectionMode:H,isValidConnection:G,lib:q,rfId:oe,nodeLookup:ee,connection:ne}=y.getState();if(!S||!V&&!r)return;if(!V){D==null||D(M.nativeEvent,{nodeId:S,handleId:h,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:S,type:e,id:h}});return}const se=Qc(M.target),ie=n||G,{connection:U,isValid:ue}=vo.isValid(M.nativeEvent,{handle:{nodeId:S,id:h,type:e},connectionMode:H,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:ie,flowId:oe,doc:se,lib:q,nodeLookup:ee});ue&&U&&F(U);const ge=structuredClone(ne);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,P==null||P(M,ge),y.setState({connectionClickStartHandle:null})};return o.jsxRuntimeExports.jsx("div",{"data-handleid":h,"data-nodeid":S,"data-handlepos":t,"data-id":`${b}-${S}-${h}-${e}`,className:Me(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",C,d,{source:!E,target:E,connectable:s,connectablestart:r,connectableend:i,clickconnecting:_,connectingfrom:w,connectingto:L,valid:I,connectionindicator:s&&(!A||N)&&(A?i:r)}]),onMouseDown:$,onTouchStart:$,onClick:k?z:void 0,ref:f,...m,children:a})}const jn=g.memo(va(C5));function b5({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e==null?void 0:e.label,o.jsxRuntimeExports.jsx(jn,{type:"source",position:n,isConnectable:t})]})}function w5({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:s=X.Bottom}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(jn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsxRuntimeExports.jsx(jn,{type:"source",position:s,isConnectable:t})]})}function v5(){return null}function k5({data:e,isConnectable:t,targetPosition:n=X.Top}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(jn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ds={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ni={input:b5,default:w5,output:k5,group:v5};function _5(e){var t,n,s,r;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((r=e.style)==null?void 0:r.height)}}const M5=e=>{const{width:t,height:n,x:s,y:r}=Cn(e.nodeLookup,{filter:i=>!!i.selected});return{width:Oe(t)?t:null,height:Oe(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${r}px)`}};function L5({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=we(),{width:r,height:i,transformString:l,userSelectionActive:c}=Ee(M5,_e),a=Ma(),d=g.useRef(null);if(g.useEffect(()=>{var m;n||(m=d.current)==null||m.focus({preventScroll:!0})},[n]),_a({nodeRef:d}),c||!r||!i)return null;const x=e?m=>{const f=s.getState().nodes.filter(h=>h.selected);e(m,f)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(ds,m.key)&&(m.preventDefault(),a({direction:ds[m.key],factor:m.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:o.jsxRuntimeExports.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:r,height:i}})})}const Ai=typeof window<"u"?window:void 0,P5=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Pa({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:a,selectionKeyCode:d,selectionOnDrag:x,selectionMode:p,onSelectionStart:m,onSelectionEnd:f,multiSelectionKeyCode:h,panActivationKeyCode:E,zoomActivationKeyCode:y,elementsSelectable:S,zoomOnScroll:k,zoomOnPinch:C,panOnScroll:b,panOnScrollSpeed:w,panOnScrollMode:L,zoomOnDoubleClick:_,panOnDrag:N,defaultViewport:A,translateExtent:I,minZoom:F,maxZoom:$,preventScrolling:z,onSelectionContextMenu:R,noWheelClassName:T,noPanClassName:M,disableKeyboardA11y:D,onViewportChange:P,isControlledViewport:V}){const{nodesSelectionActive:H,userSelectionActive:G}=Ee(P5),q=gn(d,{target:Ai}),oe=gn(E,{target:Ai}),ee=oe||N,ne=oe||b,se=x&&ee!==!0,ie=q||G||se;return d5({deleteKeyCode:a,multiSelectionKeyCode:h}),o.jsxRuntimeExports.jsx(m5,{onPaneContextMenu:i,elementsSelectable:S,zoomOnScroll:k,zoomOnPinch:C,panOnScroll:ne,panOnScrollSpeed:w,panOnScrollMode:L,zoomOnDoubleClick:_,panOnDrag:!q&&ee,defaultViewport:A,translateExtent:I,minZoom:F,maxZoom:$,zoomActivationKeyCode:y,preventScrolling:z,noWheelClassName:T,noPanClassName:M,onViewportChange:P,isControlledViewport:V,paneClickDistance:c,children:o.jsxRuntimeExports.jsxs(j5,{onSelectionStart:m,onSelectionEnd:f,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:ee,isSelecting:!!ie,selectionMode:p,selectionKeyPressed:q,selectionOnDrag:se,children:[e,H&&o.jsxRuntimeExports.jsx(L5,{onSelectionContextMenu:R,noPanClassName:M,disableKeyboardA11y:D})]})})}Pa.displayName="FlowRenderer";const T5=g.memo(Pa),N5=e=>t=>e?Gc(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 A5(e){return Ee(g.useCallback(N5(e),[e]),_e)}const I5=e=>e.updateNodeInternals;function $5(){const e=Ee(I5),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");s.set(i,{id:i,nodeElement:r.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function z5({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const r=we(),i=g.useRef(null),l=g.useRef(null),c=g.useRef(e.sourcePosition),a=g.useRef(e.targetPosition),d=g.useRef(t),x=n&&!!e.internals.handleBounds;return g.useEffect(()=>{i.current&&!e.hidden&&(!x||l.current!==i.current)&&(l.current&&(s==null||s.unobserve(l.current)),s==null||s.observe(i.current),l.current=i.current)},[x,e.hidden]),g.useEffect(()=>()=>{l.current&&(s==null||s.unobserve(l.current),l.current=null)},[]),g.useEffect(()=>{if(i.current){const p=d.current!==t,m=c.current!==e.sourcePosition,f=a.current!==e.targetPosition;(p||m||f)&&(d.current=t,c.current=e.sourcePosition,a.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function B5({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:r,onContextMenu:i,onDoubleClick:l,nodesDraggable:c,elementsSelectable:a,nodesConnectable:d,nodesFocusable:x,resizeObserver:p,noDragClassName:m,noPanClassName:f,disableKeyboardA11y:h,rfId:E,nodeTypes:y,nodeExtent:S,nodeClickDistance:k,onError:C}){const{node:b,internals:w,isParent:L}=Ee(U=>{const ue=U.nodeLookup.get(e),ge=U.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:ge}},_e);let _=b.type||"default",N=(y==null?void 0:y[_])||Ni[_];N===void 0&&(C==null||C("003",Ie.error003(_)),_="default",N=Ni.default);const A=!!(b.draggable||c&&typeof b.draggable>"u"),I=!!(b.selectable||a&&typeof b.selectable>"u"),F=!!(b.connectable||d&&typeof b.connectable>"u"),$=!!(b.focusable||x&&typeof b.focusable>"u"),z=we(),R=Uc(b),T=z5({node:b,nodeType:_,hasDimensions:R,resizeObserver:p}),M=_a({nodeRef:T,disabled:b.hidden||!A,noDragClassName:m,handleSelector:b.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:k}),D=Ma();if(b.hidden)return null;const P=st(b),V=_5(b),H=I||A||t||n||s||r,G=n?U=>n(U,{...w.userNode}):void 0,q=s?U=>s(U,{...w.userNode}):void 0,oe=r?U=>r(U,{...w.userNode}):void 0,ee=i?U=>i(U,{...w.userNode}):void 0,ne=l?U=>l(U,{...w.userNode}):void 0,se=U=>{const{selectNodesOnDrag:ue,nodeDragThreshold:ge}=z.getState();I&&(!ue||!A||ge>0)&&ko({id:e,store:z,nodeRef:T}),t&&t(U,{...w.userNode})},ie=U=>{if(!(Ro(U.nativeEvent)||h))if(Vc.includes(U.key)&&I){const ue=U.key==="Escape";ko({id:e,store:z,unselect:ue,nodeRef:T})}else A&&b.selected&&Object.prototype.hasOwnProperty.call(ds,U.key)&&(U.preventDefault(),z.setState({ariaLiveMessage:`Moved selected node ${U.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~w.positionAbsolute.x}, y: ${~~w.positionAbsolute.y}`}),D({direction:ds[U.key],factor:U.shiftKey?4:1}))};return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__node",`react-flow__node-${_}`,{[f]:A},b.className,{selected:b.selected,selectable:I,parent:L,draggable:A,dragging:M}]),ref:T,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:R?"visible":"hidden",...b.style,...V},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:G,onMouseMove:q,onMouseLeave:oe,onContextMenu:ee,onClick:se,onDoubleClick:ne,onKeyDown:$?ie:void 0,tabIndex:$?0:void 0,role:$?"button":void 0,"aria-describedby":h?void 0:`${ya}-${E}`,"aria-label":b.ariaLabel,children:o.jsxRuntimeExports.jsx(y5,{value:e,children:o.jsxRuntimeExports.jsx(N,{id:e,data:b.data,type:_,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:b.selected,selectable:I,draggable:A,deletable:b.deletable??!0,isConnectable:F,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:M,dragHandle:b.dragHandle,zIndex:w.z,parentId:b.parentId,...P})})})}const D5=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Ta(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,onError:i}=Ee(D5,_e),l=A5(e.onlyRenderVisibleElements),c=$5();return o.jsxRuntimeExports.jsx("div",{className:"react-flow__nodes",style:Ls,children:l.map(a=>o.jsxRuntimeExports.jsx(B5,{id:a,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:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}Ta.displayName="NodeRenderer";const O5=g.memo(Ta);function V5(e){return Ee(g.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const s=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);i&&l&&F2({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&s.push(r.id)}return s},[e]),_e)}const F5=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),H5=({color:e="none",strokeWidth:t=1})=>o.jsxRuntimeExports.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Ii={[ls.Arrow]:F5,[ls.ArrowClosed]:H5};function Z5(e){const t=we();return g.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call(Ii,e)?Ii[e]:((i=(r=t.getState()).onError)==null||i.call(r,"009",Ie.error009(e)),null)},[e])}const G5=({id:e,type:t,color:n,width:s=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const a=Z5(t);return a?o.jsxRuntimeExports.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:c,refX:"0",refY:"0",children:o.jsxRuntimeExports.jsx(a,{color:n,strokeWidth:l})}):null},Na=({defaultColor:e,rfId:t})=>{const n=Ee(i=>i.edges),s=Ee(i=>i.defaultEdgeOptions),r=g.useMemo(()=>X2(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return r.length?o.jsxRuntimeExports.jsx("svg",{className:"react-flow__marker",children:o.jsxRuntimeExports.jsx("defs",{children:r.map(i=>o.jsxRuntimeExports.jsx(G5,{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};Na.displayName="MarkerDefinitions";var Y5=g.memo(Na);function Aa({x:e,y:t,label:n,labelStyle:s={},labelShowBg:r=!0,labelBgStyle:i={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:a,className:d,...x}){const[p,m]=g.useState({x:1,y:0,width:0,height:0}),f=Me(["react-flow__edge-textwrapper",d]),h=g.useRef(null);return g.useEffect(()=>{if(h.current){const E=h.current.getBBox();m({x:E.x,y:E.y,width:E.width,height:E.height})}},[n]),typeof n>"u"||!n?null:o.jsxRuntimeExports.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:f,visibility:p.width?"visible":"hidden",...x,children:[r&&o.jsxRuntimeExports.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:c,ry:c}),o.jsxRuntimeExports.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:h,style:s,children:n}),a]})}Aa.displayName="EdgeText";const W5=g.memo(Aa);function Ve({path:e,labelX:t,labelY:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a,interactionWidth:d=20,...x}){return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{...x,d:e,fill:"none",className:Me(["react-flow__edge-path",x.className])}),d&&o.jsxRuntimeExports.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}),s&&Oe(t)&&Oe(n)?o.jsxRuntimeExports.jsx(W5,{x:t,y:n,label:s,labelStyle:r,labelShowBg:i,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:a}):null]})}function $i({pos:e,x1:t,y1:n,x2:s,y2:r}){return e===X.Left||e===X.Right?[.5*(t+s),n]:[t,.5*(n+r)]}function Ia({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:s,targetY:r,targetPosition:i=X.Top}){const[l,c]=$i({pos:n,x1:e,y1:t,x2:s,y2:r}),[a,d]=$i({pos:i,x1:s,y1:r,x2:e,y2:t}),[x,p,m,f]=ta({sourceX:e,sourceY:t,targetX:s,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:a,targetControlY:d});return[`M${e},${t} C${l},${c} ${a},${d} ${s},${r}`,x,p,m,f]}function $a(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=X.Bottom,targetPosition:c=X.Top,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:E,markerStart:y,interactionWidth:S})=>{const[k,C,b]=Ia({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:c}),w=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:w,path:k,labelX:C,labelY:b,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:E,markerStart:y,interactionWidth:S})})}const K5=$a({isInternal:!1}),za=$a({isInternal:!0});K5.displayName="SimpleBezierEdge";za.displayName="SimpleBezierEdgeInternal";function Ba(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,sourcePosition:f=X.Bottom,targetPosition:h=X.Top,markerEnd:E,markerStart:y,pathOptions:S,interactionWidth:k})=>{const[C,b,w]=Co({sourceX:n,sourceY:s,sourcePosition:f,targetX:r,targetY:i,targetPosition:h,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset}),L=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:L,path:C,labelX:b,labelY:w,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:E,markerStart:y,interactionWidth:k})})}const Da=Ba({isInternal:!1}),Oa=Ba({isInternal:!0});Da.displayName="SmoothStepEdge";Oa.displayName="SmoothStepEdgeInternal";function Va(e){return g.memo(({id:t,...n})=>{var r;const s=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Da,{...n,id:s,pathOptions:g.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const X5=Va({isInternal:!1}),Fa=Va({isInternal:!0});X5.displayName="StepEdge";Fa.displayName="StepEdgeInternal";function Ha(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:f,markerStart:h,interactionWidth:E})=>{const[y,S,k]=ia({sourceX:n,sourceY:s,targetX:r,targetY:i}),C=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:C,path:y,labelX:S,labelY:k,label:l,labelStyle:c,labelShowBg:a,labelBgStyle:d,labelBgPadding:x,labelBgBorderRadius:p,style:m,markerEnd:f,markerStart:h,interactionWidth:E})})}const q5=Ha({isInternal:!1}),Za=Ha({isInternal:!0});q5.displayName="StraightEdge";Za.displayName="StraightEdgeInternal";function Ga(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:r,targetY:i,sourcePosition:l=X.Bottom,targetPosition:c=X.Top,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:E,markerStart:y,pathOptions:S,interactionWidth:k})=>{const[C,b,w]=na({sourceX:n,sourceY:s,sourcePosition:l,targetX:r,targetY:i,targetPosition:c,curvature:S==null?void 0:S.curvature}),L=e.isInternal?void 0:t;return o.jsxRuntimeExports.jsx(Ve,{id:L,path:C,labelX:b,labelY:w,label:a,labelStyle:d,labelShowBg:x,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:f,style:h,markerEnd:E,markerStart:y,interactionWidth:k})})}const U5=Ga({isInternal:!1}),Ya=Ga({isInternal:!0});U5.displayName="BezierEdge";Ya.displayName="BezierEdgeInternal";const zi={default:Ya,straight:Za,step:Fa,smoothstep:Oa,simplebezier:za},Bi={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},J5=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,Q5=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,Di="react-flow__edgeupdater";function Oi({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:r,onMouseEnter:i,onMouseOut:l,type:c}){return o.jsxRuntimeExports.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:l,className:Me([Di,`${Di}-${c}`]),cx:J5(t,s,e),cy:Q5(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function eE({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:r,targetX:i,targetY:l,sourcePosition:c,targetPosition:a,onReconnect:d,onReconnectStart:x,onReconnectEnd:p,setReconnecting:m,setUpdateHover:f}){const h=we(),E=(b,w)=>{if(b.button!==0)return;const{autoPanOnConnect:L,domNode:_,isValidConnection:N,connectionMode:A,connectionRadius:I,lib:F,onConnectStart:$,onConnectEnd:z,cancelConnection:R,nodeLookup:T,rfId:M,panBy:D,updateConnection:P}=h.getState(),V=w.type==="target";m(!0),x==null||x(b,n,w.type);const H=(q,oe)=>{m(!1),p==null||p(q,n,w.type,oe)},G=q=>d==null?void 0:d(n,q);vo.onPointerDown(b.nativeEvent,{autoPanOnConnect:L,connectionMode:A,connectionRadius:I,domNode:_,handleId:w.id,nodeId:w.nodeId,nodeLookup:T,isTarget:V,edgeUpdaterType:w.type,lib:F,flowId:M,cancelConnection:R,panBy:D,isValidConnection:N,onConnect:G,onConnectStart:$,onConnectEnd:z,onReconnectEnd:H,updateConnection:P,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle})},y=b=>E(b,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),S=b=>E(b,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),k=()=>f(!0),C=()=>f(!1);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[(e===!0||e==="source")&&o.jsxRuntimeExports.jsx(Oi,{position:c,centerX:s,centerY:r,radius:t,onMouseDown:y,onMouseEnter:k,onMouseOut:C,type:"source"}),(e===!0||e==="target")&&o.jsxRuntimeExports.jsx(Oi,{position:a,centerX:i,centerY:l,radius:t,onMouseDown:S,onMouseEnter:k,onMouseOut:C,type:"target"})]})}function tE({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:r,onDoubleClick:i,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:d,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:f,rfId:h,edgeTypes:E,noPanClassName:y,onError:S,disableKeyboardA11y:k}){let C=Ee(re=>re.edgeLookup.get(e));const b=Ee(re=>re.defaultEdgeOptions);C=b?{...b,...C}:C;let w=C.type||"default",L=(E==null?void 0:E[w])||zi[w];L===void 0&&(S==null||S("011",Ie.error011(w)),w="default",L=zi.default);const _=!!(C.focusable||t&&typeof C.focusable>"u"),N=typeof p<"u"&&(C.reconnectable||n&&typeof C.reconnectable>"u"),A=!!(C.selectable||s&&typeof C.selectable>"u"),I=g.useRef(null),[F,$]=g.useState(!1),[z,R]=g.useState(!1),T=we(),{zIndex:M,sourceX:D,sourceY:P,targetX:V,targetY:H,sourcePosition:G,targetPosition:q}=Ee(g.useCallback(re=>{const Q=re.nodeLookup.get(C.source),le=re.nodeLookup.get(C.target);if(!Q||!le)return{zIndex:C.zIndex,...Bi};const je=K2({id:e,sourceNode:Q,targetNode:le,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:re.connectionMode,onError:S});return{zIndex:V2({selected:C.selected,zIndex:C.zIndex,sourceNode:Q,targetNode:le,elevateOnSelect:re.elevateEdgesOnSelect}),...je||Bi}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),_e),oe=g.useMemo(()=>C.markerStart?`url('#${bo(C.markerStart,h)}')`:void 0,[C.markerStart,h]),ee=g.useMemo(()=>C.markerEnd?`url('#${bo(C.markerEnd,h)}')`:void 0,[C.markerEnd,h]);if(C.hidden||D===null||P===null||V===null||H===null)return null;const ne=re=>{var Le;const{addSelectedEdges:Q,unselectNodesAndEdges:le,multiSelectionActive:je}=T.getState();A&&(T.setState({nodesSelectionActive:!1}),C.selected&&je?(le({nodes:[],edges:[C]}),(Le=I.current)==null||Le.blur()):Q([e])),r&&r(re,C)},se=i?re=>{i(re,{...C})}:void 0,ie=l?re=>{l(re,{...C})}:void 0,U=c?re=>{c(re,{...C})}:void 0,ue=a?re=>{a(re,{...C})}:void 0,ge=d?re=>{d(re,{...C})}:void 0,pe=re=>{var Q;if(!k&&Vc.includes(re.key)&&A){const{unselectNodesAndEdges:le,addSelectedEdges:je}=T.getState();re.key==="Escape"?((Q=I.current)==null||Q.blur(),le({edges:[C]})):je([e])}};return o.jsxRuntimeExports.jsx("svg",{style:{zIndex:M},children:o.jsxRuntimeExports.jsxs("g",{className:Me(["react-flow__edge",`react-flow__edge-${w}`,C.className,y,{selected:C.selected,animated:C.animated,inactive:!A&&!r,updating:F,selectable:A}]),onClick:ne,onDoubleClick:se,onContextMenu:ie,onMouseEnter:U,onMouseMove:ue,onMouseLeave:ge,onKeyDown:_?pe:void 0,tabIndex:_?0:void 0,role:_?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":_?`${Sa}-${h}`:void 0,ref:I,children:[!z&&o.jsxRuntimeExports.jsx(L,{id:e,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:A,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:D,sourceY:P,targetX:V,targetY:H,sourcePosition:G,targetPosition:q,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:oe,markerEnd:ee,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),N&&o.jsxRuntimeExports.jsx(eE,{edge:C,isReconnectable:N,reconnectRadius:x,onReconnect:p,onReconnectStart:m,onReconnectEnd:f,sourceX:D,sourceY:P,targetX:V,targetY:H,sourcePosition:G,targetPosition:q,setUpdateHover:$,setReconnecting:R})]})})}const nE=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Wa({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:r,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:a,onEdgeMouseLeave:d,onEdgeClick:x,reconnectRadius:p,onEdgeDoubleClick:m,onReconnectStart:f,onReconnectEnd:h,disableKeyboardA11y:E}){const{edgesFocusable:y,edgesReconnectable:S,elementsSelectable:k,onError:C}=Ee(nE,_e),b=V5(t);return o.jsxRuntimeExports.jsxs("div",{className:"react-flow__edges",children:[o.jsxRuntimeExports.jsx(Y5,{defaultColor:e,rfId:n}),b.map(w=>o.jsxRuntimeExports.jsx(tE,{id:w,edgesFocusable:y,edgesReconnectable:S,elementsSelectable:k,noPanClassName:r,onReconnect:i,onContextMenu:l,onMouseEnter:c,onMouseMove:a,onMouseLeave:d,onClick:x,reconnectRadius:p,onDoubleClick:m,onReconnectStart:f,onReconnectEnd:h,rfId:n,onError:C,edgeTypes:s,disableKeyboardA11y:E},w))]})}Wa.displayName="EdgeRenderer";const sE=g.memo(Wa),oE=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function rE({children:e}){const t=Ee(oE);return o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function iE(e){const t=Lt(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const lE=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function cE(e){const t=Ee(lE),n=we();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function aE(e){return e.connection.inProgress?{...e.connection,to:bn(e.connection.to,e.transform)}:{...e.connection}}function uE(e){return aE}function dE(e){const t=uE();return Ee(t,_e)}const xE=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function pE({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:r,width:i,height:l,isValid:c,inProgress:a}=Ee(xE,_e);return!(i&&r&&a)?null:o.jsxRuntimeExports.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:o.jsxRuntimeExports.jsx("g",{className:Me(["react-flow__connection",Hc(c)]),children:o.jsxRuntimeExports.jsx(Ka,{style:t,type:n,CustomComponent:s,isValid:c})})})}const Ka=({style:e,type:t=lt.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:r,from:i,fromNode:l,fromHandle:c,fromPosition:a,to:d,toNode:x,toHandle:p,toPosition:m}=dE();if(!r)return;if(n)return o.jsxRuntimeExports.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:a,toPosition:m,connectionStatus:Hc(s),toNode:x,toHandle:p});let f="";const h={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:d.x,targetY:d.y,targetPosition:m};switch(t){case lt.Bezier:[f]=na(h);break;case lt.SimpleBezier:[f]=Ia(h);break;case lt.Step:[f]=Co({...h,borderRadius:0});break;case lt.SmoothStep:[f]=Co(h);break;default:[f]=ia(h)}return o.jsxRuntimeExports.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:e})};Ka.displayName="ConnectionLine";const mE={};function Vi(e=mE){const t=g.useRef(e),n=we();g.useEffect(()=>{var s,r;if(process.env.NODE_ENV==="development"){const i=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const l of i)if(t.current[l]!==e[l]){(r=(s=n.getState()).onError)==null||r.call(s,"002",Ie.error002());break}t.current=e}},[e])}function fE(){const e=we(),t=g.useRef(!1);g.useEffect(()=>{var n,s;if(process.env.NODE_ENV==="development"&&!t.current){const r=document.querySelector(".react-flow__pane");r&&window.getComputedStyle(r).zIndex!=="1"&&((s=(n=e.getState()).onError)==null||s.call(n,"013",Ie.error013("react"))),t.current=!0}},[])}function Xa({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:d,onNodeContextMenu:x,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:f,connectionLineType:h,connectionLineStyle:E,connectionLineComponent:y,connectionLineContainerStyle:S,selectionKeyCode:k,selectionOnDrag:C,selectionMode:b,multiSelectionKeyCode:w,panActivationKeyCode:L,zoomActivationKeyCode:_,deleteKeyCode:N,onlyRenderVisibleElements:A,elementsSelectable:I,defaultViewport:F,translateExtent:$,minZoom:z,maxZoom:R,preventScrolling:T,defaultMarkerColor:M,zoomOnScroll:D,zoomOnPinch:P,panOnScroll:V,panOnScrollSpeed:H,panOnScrollMode:G,zoomOnDoubleClick:q,panOnDrag:oe,onPaneClick:ee,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:ie,onPaneScroll:U,onPaneContextMenu:ue,paneClickDistance:ge,nodeClickDistance:pe,onEdgeContextMenu:re,onEdgeMouseEnter:Q,onEdgeMouseMove:le,onEdgeMouseLeave:je,reconnectRadius:Le,onReconnect:qe,onReconnectStart:Is,onReconnectEnd:$s,noDragClassName:Xt,noWheelClassName:zs,noPanClassName:qt,disableKeyboardA11y:Ut,nodeExtent:Bs,rfId:Jt,viewport:Qt,onViewportChange:vn}){return Vi(e),Vi(t),fE(),iE(n),cE(Qt),o.jsxRuntimeExports.jsx(T5,{onPaneClick:ee,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:ie,onPaneContextMenu:ue,onPaneScroll:U,paneClickDistance:ge,deleteKeyCode:N,selectionKeyCode:k,selectionOnDrag:C,selectionMode:b,onSelectionStart:m,onSelectionEnd:f,multiSelectionKeyCode:w,panActivationKeyCode:L,zoomActivationKeyCode:_,elementsSelectable:I,zoomOnScroll:D,zoomOnPinch:P,zoomOnDoubleClick:q,panOnScroll:V,panOnScrollSpeed:H,panOnScrollMode:G,panOnDrag:oe,defaultViewport:F,translateExtent:$,minZoom:z,maxZoom:R,onSelectionContextMenu:p,preventScrolling:T,noDragClassName:Xt,noWheelClassName:zs,noPanClassName:qt,disableKeyboardA11y:Ut,onViewportChange:vn,isControlledViewport:!!Qt,children:o.jsxRuntimeExports.jsxs(rE,{children:[o.jsxRuntimeExports.jsx(sE,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:qe,onReconnectStart:Is,onReconnectEnd:$s,onlyRenderVisibleElements:A,onEdgeContextMenu:re,onEdgeMouseEnter:Q,onEdgeMouseMove:le,onEdgeMouseLeave:je,reconnectRadius:Le,defaultMarkerColor:M,noPanClassName:qt,disableKeyboardA11y:Ut,rfId:Jt}),o.jsxRuntimeExports.jsx(pE,{style:E,type:h,component:y,containerStyle:S}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsxRuntimeExports.jsx(O5,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:i,onNodeMouseEnter:c,onNodeMouseMove:a,onNodeMouseLeave:d,onNodeContextMenu:x,nodeClickDistance:pe,onlyRenderVisibleElements:A,noPanClassName:qt,noDragClassName:Xt,disableKeyboardA11y:Ut,nodeExtent:Bs,rfId:Jt}),o.jsxRuntimeExports.jsx("div",{className:"react-flow__viewport-portal"})]})})}Xa.displayName="GraphView";const hE=g.memo(Xa),Fi=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a}={})=>{const d=new Map,x=new Map,p=new Map,m=new Map,f=s??t??[],h=n??e??[],E=c??[0,0],y=a??mn;ca(p,m,f),wo(h,d,x,{nodeOrigin:E,nodeExtent:y,elevateNodesOnSelect:!1});let S=[0,0,1];if(l&&r&&i){const k=Cn(d,{filter:L=>!!((L.width||L.initialWidth)&&(L.height||L.initialHeight))}),{x:C,y:b,zoom:w}=ur(k,r,i,.5,2,.1);S=[C,b,w]}return{rfId:"1",width:0,height:0,transform:S,nodes:h,nodeLookup:d,parentLookup:x,edges:f,edgeLookup:m,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:mn,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:kt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...Fc},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:as,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},gE=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a})=>$3((d,x)=>({...Fi({nodes:e,edges:t,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a,defaultNodes:n,defaultEdges:s}),setNodes:p=>{const{nodeLookup:m,parentLookup:f,nodeOrigin:h,elevateNodesOnSelect:E}=x();wo(p,m,f,{nodeOrigin:h,nodeExtent:a,elevateNodesOnSelect:E,checkEquality:!0}),d({nodes:p})},setEdges:p=>{const{connectionLookup:m,edgeLookup:f}=x();ca(m,f,p),d({edges:p})},setDefaultNodesAndEdges:(p,m)=>{if(p){const{setNodes:f}=x();f(p),d({hasDefaultNodes:!0})}if(m){const{setEdges:f}=x();f(m),d({hasDefaultEdges:!0})}},updateNodeInternals:(p,m={triggerFitView:!0})=>{const{triggerNodeChanges:f,nodeLookup:h,parentLookup:E,fitViewOnInit:y,fitViewDone:S,fitViewOnInitOptions:k,domNode:C,nodeOrigin:b,nodeExtent:w,debug:L,fitViewSync:_}=x(),{changes:N,updatedInternals:A}=e3(p,h,E,C,b,w);if(A){if(U2(h,E,{nodeOrigin:b,nodeExtent:w}),m.triggerFitView){let I=S;!S&&y&&(I=_({...k,nodes:k==null?void 0:k.nodes})),d({fitViewDone:I})}else d({});(N==null?void 0:N.length)>0&&(L&&console.log("React Flow: trigger node changes",N),f==null||f(N))}},updateNodePositions:(p,m=!1)=>{const f=[],h=[];for(const[E,y]of p){const S=!!(y!=null&&y.expandParent&&(y!=null&&y.parentId)&&(y!=null&&y.position)),k={id:E,type:"position",position:S?{x:Math.max(0,y.position.x),y:Math.max(0,y.position.y)}:y.position,dragging:m};S&&f.push({id:E,parentId:y.parentId,rect:{...y.internals.positionAbsolute,width:y.measured.width,height:y.measured.height}}),h.push(k)}if(f.length>0){const{nodeLookup:E,parentLookup:y,nodeOrigin:S}=x(),k=mr(f,E,y,S);h.push(...k)}x().triggerNodeChanges(h)},triggerNodeChanges:p=>{const{onNodesChange:m,setNodes:f,nodes:h,hasDefaultNodes:E,debug:y}=x();if(p!=null&&p.length){if(E){const S=ba(p,h);f(S)}y&&console.log("React Flow: trigger node changes",p),m==null||m(p)}},triggerEdgeChanges:p=>{const{onEdgesChange:m,setEdges:f,edges:h,hasDefaultEdges:E,debug:y}=x();if(p!=null&&p.length){if(E){const S=wa(p,h);f(S)}y&&console.log("React Flow: trigger edge changes",p),m==null||m(p)}},addSelectedNodes:p=>{const{multiSelectionActive:m,edgeLookup:f,nodeLookup:h,triggerNodeChanges:E,triggerEdgeChanges:y}=x();if(m){const S=p.map(k=>Et(k,!0));E(S);return}E(It(h,new Set([...p]),!0)),y(It(f))},addSelectedEdges:p=>{const{multiSelectionActive:m,edgeLookup:f,nodeLookup:h,triggerNodeChanges:E,triggerEdgeChanges:y}=x();if(m){const S=p.map(k=>Et(k,!0));y(S);return}y(It(f,new Set([...p]))),E(It(h,new Set,!0))},unselectNodesAndEdges:({nodes:p,edges:m}={})=>{const{edges:f,nodes:h,nodeLookup:E,triggerNodeChanges:y,triggerEdgeChanges:S}=x(),k=p||h,C=m||f,b=k.map(L=>{const _=E.get(L.id);return _&&(_.selected=!1),Et(L.id,!1)}),w=C.map(L=>Et(L.id,!1));y(b),S(w)},setMinZoom:p=>{const{panZoom:m,maxZoom:f}=x();m==null||m.setScaleExtent([p,f]),d({minZoom:p})},setMaxZoom:p=>{const{panZoom:m,minZoom:f}=x();m==null||m.setScaleExtent([f,p]),d({maxZoom:p})},setTranslateExtent:p=>{var m;(m=x().panZoom)==null||m.setTranslateExtent(p),d({translateExtent:p})},setPaneClickDistance:p=>{var m;(m=x().panZoom)==null||m.setClickDistance(p)},resetSelectedElements:()=>{const{edges:p,nodes:m,triggerNodeChanges:f,triggerEdgeChanges:h}=x(),E=m.reduce((S,k)=>k.selected?[...S,Et(k.id,!1)]:S,[]),y=p.reduce((S,k)=>k.selected?[...S,Et(k.id,!1)]:S,[]);f(E),h(y)},setNodeExtent:p=>{const{nodes:m,nodeLookup:f,parentLookup:h,nodeOrigin:E,elevateNodesOnSelect:y,nodeExtent:S}=x();p[0][0]===S[0][0]&&p[0][1]===S[0][1]&&p[1][0]===S[1][0]&&p[1][1]===S[1][1]||(wo(m,f,h,{nodeOrigin:E,nodeExtent:p,elevateNodesOnSelect:y,checkEquality:!1}),d({nodeExtent:p}))},panBy:p=>{const{transform:m,width:f,height:h,panZoom:E,translateExtent:y}=x();return t3({delta:p,panZoom:E,transform:m,translateExtent:y,width:f,height:h})},fitView:p=>{const{panZoom:m,width:f,height:h,minZoom:E,maxZoom:y,nodeLookup:S}=x();if(!m)return Promise.resolve(!1);const k=Eo(S,p);return yo({nodes:k,width:f,height:h,panZoom:m,minZoom:E,maxZoom:y},p)},fitViewSync:p=>{const{panZoom:m,width:f,height:h,minZoom:E,maxZoom:y,nodeLookup:S}=x();if(!m)return!1;const k=Eo(S,p);return yo({nodes:k,width:f,height:h,panZoom:m,minZoom:E,maxZoom:y},p),k.size>0},cancelConnection:()=>{d({connection:{...Fc}})},updateConnection:p=>{d({connection:p})},reset:()=>d({...Fi()})}),Object.is);function qa({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:r,initialHeight:i,fitView:l,nodeOrigin:c,nodeExtent:a,children:d}){const[x]=g.useState(()=>gE({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:r,height:i,fitView:l,nodeOrigin:c,nodeExtent:a}));return o.jsxRuntimeExports.jsx(z3,{value:x,children:o.jsxRuntimeExports.jsx(i5,{children:d})})}function jE({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:r,width:i,height:l,fitView:c,nodeOrigin:a,nodeExtent:d}){return g.useContext(Ms)?o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:e}):o.jsxRuntimeExports.jsx(qa,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:r,initialWidth:i,initialHeight:l,fitView:c,nodeOrigin:a,nodeExtent:d,children:e})}const EE={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function yE({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:r,nodeTypes:i,edgeTypes:l,onNodeClick:c,onEdgeClick:a,onInit:d,onMove:x,onMoveStart:p,onMoveEnd:m,onConnect:f,onConnectStart:h,onConnectEnd:E,onClickConnectStart:y,onClickConnectEnd:S,onNodeMouseEnter:k,onNodeMouseMove:C,onNodeMouseLeave:b,onNodeContextMenu:w,onNodeDoubleClick:L,onNodeDragStart:_,onNodeDrag:N,onNodeDragStop:A,onNodesDelete:I,onEdgesDelete:F,onDelete:$,onSelectionChange:z,onSelectionDragStart:R,onSelectionDrag:T,onSelectionDragStop:M,onSelectionContextMenu:D,onSelectionStart:P,onSelectionEnd:V,onBeforeDelete:H,connectionMode:G,connectionLineType:q=lt.Bezier,connectionLineStyle:oe,connectionLineComponent:ee,connectionLineContainerStyle:ne,deleteKeyCode:se="Backspace",selectionKeyCode:ie="Shift",selectionOnDrag:U=!1,selectionMode:ue=Vt.Full,panActivationKeyCode:ge="Space",multiSelectionKeyCode:pe=us()?"Meta":"Control",zoomActivationKeyCode:re=us()?"Meta":"Control",snapToGrid:Q,snapGrid:le,onlyRenderVisibleElements:je=!1,selectNodesOnDrag:Le,nodesDraggable:qe,nodesConnectable:Is,nodesFocusable:$s,nodeOrigin:Xt=Ra,edgesFocusable:zs,edgesReconnectable:qt,elementsSelectable:Ut=!0,defaultViewport:Bs=q3,minZoom:Jt=.5,maxZoom:Qt=2,translateExtent:vn=mn,preventScrolling:_p=!0,nodeExtent:Ds,defaultMarkerColor:Mp="#b1b1b7",zoomOnScroll:Lp=!0,zoomOnPinch:Pp=!0,panOnScroll:Tp=!1,panOnScrollSpeed:Np=.5,panOnScrollMode:Ap=Rt.Free,zoomOnDoubleClick:Ip=!0,panOnDrag:$p=!0,onPaneClick:zp,onPaneMouseEnter:Bp,onPaneMouseMove:Dp,onPaneMouseLeave:Op,onPaneScroll:Vp,onPaneContextMenu:Fp,paneClickDistance:Cr=0,nodeClickDistance:Hp=0,children:Zp,onReconnect:Gp,onReconnectStart:Yp,onReconnectEnd:Wp,onEdgeContextMenu:Kp,onEdgeDoubleClick:Xp,onEdgeMouseEnter:qp,onEdgeMouseMove:Up,onEdgeMouseLeave:Jp,reconnectRadius:Qp=10,onNodesChange:em,onEdgesChange:tm,noDragClassName:nm="nodrag",noWheelClassName:sm="nowheel",noPanClassName:br="nopan",fitView:wr,fitViewOptions:om,connectOnClick:rm,attributionPosition:im,proOptions:lm,defaultEdgeOptions:cm,elevateNodesOnSelect:am,elevateEdgesOnSelect:um,disableKeyboardA11y:vr=!1,autoPanOnConnect:dm,autoPanOnNodeDrag:xm,autoPanSpeed:pm,connectionRadius:mm,isValidConnection:fm,onError:hm,style:gm,id:kr,nodeDragThreshold:jm,viewport:Em,onViewportChange:ym,width:Sm,height:Rm,colorMode:Cm="light",debug:bm,...wm},vm){const Os=kr||"1",km=e5(Cm);return o.jsxRuntimeExports.jsx("div",{"data-testid":"rf__wrapper",...wm,style:{...gm,...EE},ref:vm,className:Me(["react-flow",r,km]),id:kr,children:o.jsxRuntimeExports.jsxs(jE,{nodes:e,edges:t,width:Sm,height:Rm,fitView:wr,nodeOrigin:Xt,nodeExtent:Ds,children:[o.jsxRuntimeExports.jsx(hE,{onInit:d,onNodeClick:c,onEdgeClick:a,onNodeMouseEnter:k,onNodeMouseMove:C,onNodeMouseLeave:b,onNodeContextMenu:w,onNodeDoubleClick:L,nodeTypes:i,edgeTypes:l,connectionLineType:q,connectionLineStyle:oe,connectionLineComponent:ee,connectionLineContainerStyle:ne,selectionKeyCode:ie,selectionOnDrag:U,selectionMode:ue,deleteKeyCode:se,multiSelectionKeyCode:pe,panActivationKeyCode:ge,zoomActivationKeyCode:re,onlyRenderVisibleElements:je,defaultViewport:Bs,translateExtent:vn,minZoom:Jt,maxZoom:Qt,preventScrolling:_p,zoomOnScroll:Lp,zoomOnPinch:Pp,zoomOnDoubleClick:Ip,panOnScroll:Tp,panOnScrollSpeed:Np,panOnScrollMode:Ap,panOnDrag:$p,onPaneClick:zp,onPaneMouseEnter:Bp,onPaneMouseMove:Dp,onPaneMouseLeave:Op,onPaneScroll:Vp,onPaneContextMenu:Fp,paneClickDistance:Cr,nodeClickDistance:Hp,onSelectionContextMenu:D,onSelectionStart:P,onSelectionEnd:V,onReconnect:Gp,onReconnectStart:Yp,onReconnectEnd:Wp,onEdgeContextMenu:Kp,onEdgeDoubleClick:Xp,onEdgeMouseEnter:qp,onEdgeMouseMove:Up,onEdgeMouseLeave:Jp,reconnectRadius:Qp,defaultMarkerColor:Mp,noDragClassName:nm,noWheelClassName:sm,noPanClassName:br,rfId:Os,disableKeyboardA11y:vr,nodeExtent:Ds,viewport:Em,onViewportChange:ym}),o.jsxRuntimeExports.jsx(Q3,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:f,onConnectStart:h,onConnectEnd:E,onClickConnectStart:y,onClickConnectEnd:S,nodesDraggable:qe,nodesConnectable:Is,nodesFocusable:$s,edgesFocusable:zs,edgesReconnectable:qt,elementsSelectable:Ut,elevateNodesOnSelect:am,elevateEdgesOnSelect:um,minZoom:Jt,maxZoom:Qt,nodeExtent:Ds,onNodesChange:em,onEdgesChange:tm,snapToGrid:Q,snapGrid:le,connectionMode:G,translateExtent:vn,connectOnClick:rm,defaultEdgeOptions:cm,fitView:wr,fitViewOptions:om,onNodesDelete:I,onEdgesDelete:F,onDelete:$,onNodeDragStart:_,onNodeDrag:N,onNodeDragStop:A,onSelectionDrag:T,onSelectionDragStart:R,onSelectionDragStop:M,onMove:x,onMoveStart:p,onMoveEnd:m,noPanClassName:br,nodeOrigin:Xt,rfId:Os,autoPanOnConnect:dm,autoPanOnNodeDrag:xm,autoPanSpeed:pm,onError:hm,connectionRadius:mm,isValidConnection:fm,selectNodesOnDrag:Le,nodeDragThreshold:jm,onBeforeDelete:H,paneClickDistance:Cr,debug:bm}),o.jsxRuntimeExports.jsx(X3,{onSelectionChange:z}),Zp,o.jsxRuntimeExports.jsx(Z3,{proOptions:lm,position:im}),o.jsxRuntimeExports.jsx(F3,{rfId:Os,disableKeyboardA11y:vr})]})})}var SE=va(yE);function RE(){const e=we();return g.useCallback(t=>{const{domNode:n,updateNodeInternals:s}=e.getState(),r=Array.isArray(t)?t:[t],i=new Map;r.forEach(l=>{const c=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${l}"]`);c&&i.set(l,{id:l,nodeElement:c,force:!0})}),requestAnimationFrame(()=>s(i,{triggerFitView:!1}))},[])}function CE({onStart:e,onChange:t,onEnd:n}){const s=we();g.useEffect(()=>{s.setState({onViewportChangeStart:e})},[e]),g.useEffect(()=>{s.setState({onViewportChange:t})},[t]),g.useEffect(()=>{s.setState({onViewportChangeEnd:n})},[n])}function bE({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsxRuntimeExports.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Me(["react-flow__background-pattern",n,s])})}function wE({radius:e,className:t}){return o.jsxRuntimeExports.jsx("circle",{cx:e,cy:e,r:e,className:Me(["react-flow__background-pattern","dots",t])})}var ut;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ut||(ut={}));const vE={[ut.Dots]:1,[ut.Lines]:1,[ut.Cross]:6},kE=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ua({id:e,variant:t=ut.Dots,gap:n=20,size:s,lineWidth:r=1,offset:i=0,color:l,bgColor:c,style:a,className:d,patternClassName:x}){const p=g.useRef(null),{transform:m,patternId:f}=Ee(kE,_e),h=s||vE[t],E=t===ut.Dots,y=t===ut.Cross,S=Array.isArray(n)?n:[n,n],k=[S[0]*m[2]||1,S[1]*m[2]||1],C=h*m[2],b=Array.isArray(i)?i:[i,i],w=y?[C,C]:k,L=[b[0]*m[2]||1+w[0]/2,b[1]*m[2]||1+w[1]/2],_=`${f}${e||""}`;return o.jsxRuntimeExports.jsxs("svg",{className:Me(["react-flow__background",d]),style:{...a,...Ls,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[o.jsxRuntimeExports.jsx("pattern",{id:_,x:m[0]%k[0],y:m[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:E?o.jsxRuntimeExports.jsx(wE,{radius:C/2,className:x}):o.jsxRuntimeExports.jsx(bE,{dimensions:w,lineWidth:r,variant:t,className:x})}),o.jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}Ua.displayName="Background";const _E=g.memo(Ua);function ME(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsxRuntimeExports.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function LE(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsxRuntimeExports.jsx("path",{d:"M0 0h32v4.2H0z"})})}function PE(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.jsxRuntimeExports.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function TE(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function NE(){return o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsxRuntimeExports.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function $n({children:e,className:t,...n}){return o.jsxRuntimeExports.jsx("button",{type:"button",className:Me(["react-flow__controls-button",t]),...n,children:e})}const AE=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function Ja({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:l,onFitView:c,onInteractiveChange:a,className:d,children:x,position:p="bottom-left",orientation:m="vertical","aria-label":f="React Flow controls"}){const h=we(),{isInteractive:E,minZoomReached:y,maxZoomReached:S}=Ee(AE,_e),{zoomIn:k,zoomOut:C,fitView:b}=Lt(),w=()=>{k(),i==null||i()},L=()=>{C(),l==null||l()},_=()=>{b(r),c==null||c()},N=()=>{h.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),a==null||a(!E)},A=m==="horizontal"?"horizontal":"vertical";return o.jsxRuntimeExports.jsxs(fr,{className:Me(["react-flow__controls",A,d]),position:p,style:e,"data-testid":"rf__controls","aria-label":f,children:[t&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx($n,{onClick:w,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:S,children:o.jsxRuntimeExports.jsx(ME,{})}),o.jsxRuntimeExports.jsx($n,{onClick:L,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:y,children:o.jsxRuntimeExports.jsx(LE,{})})]}),n&&o.jsxRuntimeExports.jsx($n,{className:"react-flow__controls-fitview",onClick:_,title:"fit view","aria-label":"fit view",children:o.jsxRuntimeExports.jsx(PE,{})}),s&&o.jsxRuntimeExports.jsx($n,{className:"react-flow__controls-interactive",onClick:N,title:"toggle interactivity","aria-label":"toggle interactivity",children:E?o.jsxRuntimeExports.jsx(NE,{}):o.jsxRuntimeExports.jsx(TE,{})}),x]})}Ja.displayName="Controls";g.memo(Ja);function IE({id:e,x:t,y:n,width:s,height:r,style:i,color:l,strokeColor:c,strokeWidth:a,className:d,borderRadius:x,shapeRendering:p,selected:m,onClick:f}){const{background:h,backgroundColor:E}=i||{},y=l||h||E;return o.jsxRuntimeExports.jsx("rect",{className:Me(["react-flow__minimap-node",{selected:m},d]),x:t,y:n,rx:x,ry:x,width:s,height:r,style:{fill:y,stroke:c,strokeWidth:a},shapeRendering:p,onClick:f?S=>f(S,e):void 0})}const $E=g.memo(IE),zE=e=>e.nodes.map(t=>t.id),so=e=>e instanceof Function?e:()=>e;function BE({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:i=$E,onClick:l}){const c=Ee(zE,_e),a=so(t),d=so(e),x=so(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:c.map(m=>o.jsxRuntimeExports.jsx(OE,{id:m,nodeColorFunc:a,nodeStrokeColorFunc:d,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:i,onClick:l,shapeRendering:p},m))})}function DE({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:c,onClick:a}){const{node:d,x,y:p,width:m,height:f}=Ee(h=>{const E=h.nodeLookup.get(e),{x:y,y:S}=E.internals.positionAbsolute,{width:k,height:C}=st(E);return{node:E,x:y,y:S,width:k,height:C}},_e);return!d||d.hidden||!Uc(d)?null:o.jsxRuntimeExports.jsx(c,{x,y:p,width:m,height:f,style:d.style,selected:!!d.selected,className:s(d),color:t(d),borderRadius:r,strokeColor:n(d),strokeWidth:i,shapeRendering:l,onClick:a,id:d.id})}const OE=g.memo(DE);var VE=g.memo(BE);const FE=200,HE=150,ZE=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?Xc(Cn(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},GE="react-flow__minimap-desc";function Qa({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:a,maskColor:d,maskStrokeColor:x,maskStrokeWidth:p,position:m="bottom-right",onClick:f,onNodeClick:h,pannable:E=!1,zoomable:y=!1,ariaLabel:S="React Flow mini map",inversePan:k,zoomStep:C=10,offsetScale:b=5}){const w=we(),L=g.useRef(null),{boundingRect:_,viewBB:N,rfId:A,panZoom:I,translateExtent:F,flowWidth:$,flowHeight:z}=Ee(ZE,_e),R=(e==null?void 0:e.width)??FE,T=(e==null?void 0:e.height)??HE,M=_.width/R,D=_.height/T,P=Math.max(M,D),V=P*R,H=P*T,G=b*P,q=_.x-(V-_.width)/2-G,oe=_.y-(H-_.height)/2-G,ee=V+G*2,ne=H+G*2,se=`${GE}-${A}`,ie=g.useRef(0),U=g.useRef();ie.current=P,g.useEffect(()=>{if(L.current&&I)return U.current=a3({domNode:L.current,panZoom:I,getTransform:()=>w.getState().transform,getViewScale:()=>ie.current}),()=>{var pe;(pe=U.current)==null||pe.destroy()}},[I]),g.useEffect(()=>{var pe;(pe=U.current)==null||pe.update({translateExtent:F,width:$,height:z,inversePan:k,pannable:E,zoomStep:C,zoomable:y})},[E,y,k,C,F,$,z]);const ue=f?pe=>{var le;const[re,Q]=((le=U.current)==null?void 0:le.pointer(pe))||[0,0];f(pe,{x:re,y:Q})}:void 0,ge=h?g.useCallback((pe,re)=>{const Q=w.getState().nodeLookup.get(re);h(pe,Q)},[]):void 0;return o.jsxRuntimeExports.jsx(fr,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a: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*P:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="string"?l:void 0},className:Me(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxRuntimeExports.jsxs("svg",{width:R,height:T,viewBox:`${q} ${oe} ${ee} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:L,onClick:ue,children:[S&&o.jsxRuntimeExports.jsx("title",{id:se,children:S}),o.jsxRuntimeExports.jsx(VE,{onClick:ge,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:c}),o.jsxRuntimeExports.jsx("path",{className:"react-flow__minimap-mask",d:`M${q-G},${oe-G}h${ee+G*2}v${ne+G*2}h${-ee-G*2}z
39
+ M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Qa.displayName="MiniMap";g.memo(Qa);function YE({nodeId:e,position:t,variant:n=ln.Handle,className:s,style:r={},children:i,color:l,minWidth:c=10,minHeight:a=10,maxWidth:d=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:p=!1,shouldResize:m,onResizeStart:f,onResize:h,onResizeEnd:E}){const y=La(),S=typeof e=="string"?e:y,k=we(),C=g.useRef(null),b=n===ln.Line?"right":"bottom-right",w=t??b,L=g.useRef(null);g.useEffect(()=>{if(!(!C.current||!S))return L.current||(L.current=b3({domNode:C.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:I,transform:F,snapGrid:$,snapToGrid:z,nodeOrigin:R,domNode:T}=k.getState();return{nodeLookup:I,transform:F,snapGrid:$,snapToGrid:z,nodeOrigin:R,paneDomNode:T}},onChange:(I,F)=>{const{triggerNodeChanges:$,nodeLookup:z,parentLookup:R,nodeOrigin:T}=k.getState(),M=[],D={x:I.x,y:I.y},P=z.get(S);if(P&&P.expandParent&&P.parentId){const V=P.origin??T,H=I.width??P.measured.width,G=I.height??P.measured.height,q={id:P.id,parentId:P.parentId,rect:{width:H,height:G,...Jc({x:I.x??P.position.x,y:I.y??P.position.y},{width:H,height:G},P.parentId,z,V)}},oe=mr([q],z,R,T);M.push(...oe),D.x=I.x?Math.max(V[0]*H,I.x):void 0,D.y=I.y?Math.max(V[1]*G,I.y):void 0}if(D.x!==void 0&&D.y!==void 0){const V={id:S,type:"position",position:{...D}};M.push(V)}if(I.width!==void 0&&I.height!==void 0){const V={id:S,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:I.width,height:I.height}};M.push(V)}for(const V of F){const H={...V,type:"position"};M.push(H)}$(M)},onEnd:()=>{const I={id:S,type:"dimensions",resizing:!1};k.getState().triggerNodeChanges([I])}})),L.current.update({controlPosition:w,boundaries:{minWidth:c,minHeight:a,maxWidth:d,maxHeight:x},keepAspectRatio:p,onResizeStart:f,onResize:h,onResizeEnd:E,shouldResize:m}),()=>{var I;(I=L.current)==null||I.destroy()}},[w,c,a,d,x,p,f,h,E,m]);const _=w.split("-"),N=n===ln.Line?"borderColor":"backgroundColor",A=l?{...r,[N]:l}:r;return o.jsxRuntimeExports.jsx("div",{className:Me(["react-flow__resize-control","nodrag",..._,n,s]),ref:C,style:A,children:i})}g.memo(YE);const WE=(e,t)=>e.map((n,s)=>u.G.translate(n,t[s])),eu=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:u.cssString(t)},...n}),KE=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:u.cssString(t),strokeDasharray:"12,4"},...n}),XE=({points:e,color:t,...n})=>o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:u.cssString(t),strokeDasharray:"12,4,4"},...n}),qE=({points:e,color:t,...n})=>{const s=u.G.calculateMiters(e,6),r=e.map((a,d)=>u.G.translate(a,s[d])),i=e.map((a,d)=>u.G.translate(a,u.G.scale(s[d],-1))),l=u.cssString(t),c=.7;return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ve,{path:dt(r),style:{stroke:l,opacity:c},...n}),o.jsxRuntimeExports.jsx(Ve,{path:dt(e),style:{stroke:l},...n}),o.jsxRuntimeExports.jsx(Ve,{path:dt(i),style:{stroke:l,opacity:c},...n})]})},Hi=5,UE=(e,t)=>{const n=[],s=[];for(let c=0;c<e.length-1;c++){const a=u.G.distance(e[c],e[c+1]);s.push(a)}const r=t;let i=0,l=r;for(let c=0;c<s.length;c++){const a=s[c],d=e[c],x=e[c+1];for(;i+a>=l;){const p=(l-i)/a,m={x:d.x+p*(x.x-d.x),y:d.y+p*(x.y-d.y)};let f="x";Math.abs(x.x-d.x)<1&&(f="y"),l+=r,!(u.G.distance(m,x)<Hi||u.G.distance(m,d)<Hi)&&n.push({position:m,direction:f})}i+=a}return n},JE=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10 L10,-10";return n==="x"?t.y+=10/2:t.x+=10/2,o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(270)`,strokeLinecap:"round"})},QE=({color:e,position:t,direction:n})=>{const r="M0,0 L0,-10";n==="x"?t.y+=10/3:t.x-=10/3;let i=u.G.translateX(t,-10),l=45;return n==="y"&&(i=u.G.translateY(t,-10),l+=90),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${t.x},${t.y}) rotate(${l})`,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx("path",{d:r,stroke:u.cssString(e),fill:"none",strokeWidth:2,transform:`translate(${i.x},${i.y}) rotate(${l})`,strokeLinecap:"round"})]})},ey=({color:e,position:t})=>o.jsxRuntimeExports.jsx("circle",{cx:t.x,cy:t.y,r:3,fill:"var(--pluto-gray-l0)",stroke:u.cssString(e),strokeWidth:2}),gr=e=>{const t=({points:n,color:s,...r})=>{const i=dt(n),l=UE(n,40);return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ve,{path:i,...r,style:{stroke:u.cssString(s)}}),l.map(({position:c,direction:a},d)=>o.jsxRuntimeExports.jsx(e,{position:c,direction:a,color:s},d))]})};return t.displayName=`SymbolLine(${e.displayName})`,t},ty=gr(JE),ny=gr(QE),sy=gr(ey),dt=e=>{let t="";const s=e.length+-1;for(let r=0;r<s;r++){const i=e[r%e.length],l=e[(r+1)%e.length],c=Math.min(6/Math.hypot(l.x-i.x,l.y-i.y),.5);r>0&&(t+=`Q${i.x},${i.y} ${i.x*(1-c)+l.x*c},${i.y*(1-c)+l.y*c}`),r===0?t+=`M${i.x},${i.y}`:r===0&&(t+=`M${i.x*(1-c)+l.x*c},${i.y*(1-c)+l.y*c}`),r===s-1?t+=`L${l.x},${l.y}`:r<s-1&&(t+=`L${i.x*c+l.x*(1-c)},${i.y*c+l.y*(1-c)}`)}return t},tu={pipe:eu,electric:KE,secondary:XE,jacketed:qE,hydraulic:ty,pneumatic:ny,data:sy},nu=eu,su=[{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"}],oy=e=>o.jsxRuntimeExports.jsx(ve.DropdownButton,{columns:[{key:"name",name:"Type"}],data:su,style:{width:200},entryRenderKey:"name",...e}),Ps=e=>{const t=document.querySelector(`[data-id="${e}"]`);if(t==null)throw new Error(`[diagram] - cannot find node with key: ${e}`);return t},Ne=(e,t)=>{const n=Ps(t),s=e.getNodes().find(r=>r.id===t);if(s==null)throw new Error(`[diagram] - cannot find node with key: ${t}`);return u.Tt.construct(s.position,u._.scale(u.Tt.dims(u.Tt.construct(n)),1/e.getZoom()))},ry=(e,t)=>Ts.fromFlow(e,t);class ou{constructor(t,n){Ge(this,"node_",null);Ge(this,"position");Ge(this,"orientation");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.G.translate(u.Tt.topLeft(this.node.box),this.position)}}class Ts{constructor(t,n,s){Ge(this,"key");Ge(this,"box");Ge(this,"handles");this.key=t,this.box=n,this.handles=s,s.forEach(r=>r.node=this)}static fromFlow(t,n){const s=Ne(n,t),r=Ps(t),i=r.getElementsByClassName("react-flow__handle"),l=u.Tt.construct(r),c=Array.from(i).map(a=>{const d=u.Tt.center(u.Tt.construct(a)),x=u.G.translation(u.Tt.topLeft(l),d),p=a.className.match(/react-flow__handle-(\w+)/);if(p==null)throw new Error("[schematic] - cannot find handle orientation");const m=u.K.construct(p[0]);return new ou(x,m)});return new Ts(t,s,c)}}const iy=({fromX:e,fromY:t,toX:n,toY:s,fromPosition:r,toPosition:i,fromNode:l,connectionLineStyle:c,connectionStatus:a})=>{const d=document.querySelector(".react-flow__handle-connecting"),x=d==null?void 0:d.className.match(/react-flow__handle-(\w+)/);if(x!=null){const h=u.K.outer.safeParse(x[1]);h.success&&(i=h.data)}const p=Lt(),m=Nt({sourcePos:u.G.construct(e,t),targetPos:u.G.construct(n,s),sourceOrientation:r,targetOrientation:i,sourceBox:Ne(p,(l==null?void 0:l.id)??""),targetBox:Ne(p,(l==null?void 0:l.id)??"")}),f=ac(u.G.construct(e,t),m,p.getZoom(),!1);return o.jsxRuntimeExports.jsx(nu,{points:f,style:{...c,stroke:u.cssString(a==="invalid"?"var(--pluto-error-z)":"var(--pluto-gray-l9)"),strokeWidth:2,fill:"none"}})},ly=({id:e,source:t,target:n,sourcePosition:s,targetHandleId:r,targetPosition:i,style:l,segments:c=[],onSegmentsChange:a,color:d="var(--pluto-gray-l9)",selected:x=!1,variant:p="pipe",...m})=>{const f=u.G.construct(m.sourceX,m.sourceY),h=g.useRef(f),E=u.G.equals(f,h.current),y=u.G.construct(m.targetX,m.targetY),S=g.useRef(y),k=u.G.equals(y,S.current),C=Lt(),[b,w,L]=j.useCombinedStateAndRef(()=>c.length>0?c:Nt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Ne(C,t),targetBox:Ne(C,n)})),_=g.useRef(i),N=g.useRef(s),A=j.useDebouncedCallback(a,100,[a]);if(!E||!k){let R=b;const T=u.G.translation(h.current,f),M=u.G.translation(y,S.current);u.G.equals(T,u.G.scale(M,-1),.001)?(h.current=f,S.current=y):(E?k||(R=k1({delta:M,segments:R}),_.current!==i&&(_.current=i,R=Nt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Ne(C,t),targetBox:Ne(C,n)})),Fr({sourcePos:f,targetPos:y,next:R,prev:b})||(R=Nt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Ne(C,t),targetBox:Ne(C,n)})),S.current=y):(R=v1({delta:T,segments:R}),N.current!==s&&(N.current=s,R=Nt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Ne(C,t),targetBox:Ne(C,n)})),Fr({sourcePos:f,targetPos:y,next:R,prev:b})||(R=Nt({sourcePos:f,targetPos:y,sourceOrientation:s,targetOrientation:i,sourceBox:Ne(C,t),targetBox:Ne(C,n)})),h.current=f),A(R),w(R))}const I=g.useRef(null),F=j.useCursorDrag({onStart:g.useCallback((R,T,M)=>{I.current={index:Number(M.currentTarget.id.split("-")[1]),segments:[...L.current]}},[]),onMove:g.useCallback(R=>{if(I.current==null)return;const T=R1({segments:I.current.segments,index:I.current.index,magnitude:u.Tt.dim(R,u.g.swap(I.current.segments[I.current.index].direction),!0)/C.getZoom()});w(T)},[]),onEnd:g.useCallback(()=>a(L.current),[a])}),$=ac(f,b,C.getZoom(),!0),z=tu[p];return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(z,{points:$,color:d}),x&&cy($).map((R,T)=>{const M=b[T].direction,D=u.g.swap(M),P={[u.g.dimension(M)]:"18px",[u.g.dimension(D)]:"4px"},V={[M]:R[M]-9,[D]:R[D]-2};return o.jsxRuntimeExports.jsxs(g.Fragment,{children:[o.jsxRuntimeExports.jsx("rect",{className:u.CSS.BE("diagram-edge-handle","background"),fill:"var(--pluto-gray-l0)",stroke:"var(--pluto-primary-z)",...P,...V,rx:"2px",ry:"2px"}),o.jsxRuntimeExports.jsx("foreignObject",{x:R.x-9,y:R.y-9,width:"18px",height:"18px",children:o.jsxRuntimeExports.jsx("div",{id:`handle-${T}`,className:u.CSS(u.CSS.BE("diagram-edge-handle","dragger"),u.CSS.dir(M)),draggable:!0,onDragStart:F})})]},T)})]})},cy=e=>e.slice(1).map((t,n)=>{const s=e[n];return u.G.construct((t.x+s.x)/2,(t.y+s.y)/2)}),ay=({initialNodes:e,initialEdges:t,allowEdit:n=!0,initialViewport:s={position:u.G.ZERO,zoom:1}})=>{const[r,i]=g.useState(n),[l,c]=g.useState(e),[a,d]=g.useState(t),[x,p]=g.useState(s),[m,f]=g.useState(!1);return{viewport:x,onViewportChange:p,edges:a,nodes:l,onNodesChange:c,onEdgesChange:d,editable:r,onEditableChange:i,fitViewOnResize:m,setFitViewOnResize:f}},uy=()=>!0,dy={nodesDraggable:!0,nodesConnectable:!0,elementsSelectable:!0,zoomOnDoubleClick:!1,nodeClickDistance:5,reconnectRadius:15,connectionRadius:30},xy={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},ru={maxZoom:1,minZoom:.5},py={hideAttribution:!0},iu=g.createContext({editable:!0,visible:!0,onEditableChange:()=>{},registerNodeRenderer:()=>{},fitViewOnResize:!1,setFitViewOnResize:()=>{}}),wn=()=>g.useContext(iu),lu=g.memo(({children:e})=>{const{registerNodeRenderer:t}=wn();return g.useEffect(()=>t(e),[t,e]),null});lu.displayName="NodeRenderer";const my=["Backspace","Delete"],fy=({aetherKey:e,children:t,onNodesChange:n,onEdgesChange:s,nodes:r,edges:i,onEditableChange:l,editable:c,viewport:a,triggers:d,onViewportChange:x,fitViewOnResize:p,setFitViewOnResize:m,visible:f,...h})=>{const E=j.useMemoDeepEqualProps({visible:f}),[{path:y},,S]=j.use$3({aetherKey:e,type:B.Diagram$1.TYPE,schema:B.diagramStateZ,initialState:{position:a.position,region:u.Tt.ZERO,zoom:a.zoom,...E}});g.useEffect(()=>S(Q=>({...Q,...E})),[E]);const k=j.use().colors.gray.l9.hex,C=j.useMemoCompare(()=>d??Zo.zoom,j.compareModeConfigs,[d]),{fitView:b}=Lt(),w=j.useDebouncedCallback(Q=>void b(Q),50,[b]),L=En(g.useCallback(Q=>{p&&w({maxZoom:1}),S(le=>({...le,region:Q}))},[S,w,p])),_=g.useRef(null),N=g.useCallback(Q=>{const le=_.current;le!=null&&le.x===Q.x&&le.y===Q.y&&le.zoom===Q.zoom||(_.current=Q,!(isNaN(Q.x)||isNaN(Q.y)||isNaN(Q.zoom))&&(S(je=>({...je,position:Q,zoom:Q.zoom})),x(fc(Q))))},[S,x]);CE({onStart:N,onChange:N,onEnd:N});const[A,I]=g.useState(()=>()=>null),F=g.useCallback(Q=>I(()=>Q),[]),$=g.useMemo(()=>({custom:({id:Q,positionAbsoluteX:le,positionAbsoluteY:je,selected:Le=!1,draggable:qe=!0})=>A({symbolKey:Q,position:{x:le,y:je},selected:Le,draggable:qe})}),[A]),z=g.useRef(i),R=g.useMemo(()=>(z.current=i,sr(i)),[i]),T=g.useRef(r),M=g.useMemo(()=>(T.current=r,nr(r)),[r]),D=g.useCallback(Q=>n(hc(T.current,le=>ba(Q,le)),Q),[n]),P=g.useCallback(Q=>s(Vn(z.current,le=>wa(Q,le),k)),[s,k]),V=g.useCallback((Q,le)=>s(Vn(z.current,je=>Z2(Q,le,je),k)),[]),H=g.useCallback(Q=>s(Vn(z.current,le=>ra(Q,le),k)),[s,k]),G=g.useCallback((Q,le)=>{const je=[...z.current],Le=je.findIndex(qe=>qe.key===Q);Le!==-1&&(je[Le]={...je[Le],segments:le},z.current=je,s(je))},[s]),q=c?dy:xy,oe=j.useSyncedRef(G),ee=g.useMemo(()=>({default:Q=>{var le,je,Le;return o.jsxRuntimeExports.jsx(ly,{...Q,segments:((le=Q.data)==null?void 0:le.segments)??[],color:(je=Q.data)==null?void 0:je.color,variant:(Le=Q.data)==null?void 0:Le.variant,onSegmentsChange:g.useCallback(qe=>oe.current(Q.id,qe),[Q.id])},Q.id)}}),[]),ne=j.useHeld({triggers:[["Q"]],loose:!0}),se=g.useRef(null);j.use$1({triggers:C.zoomReset,callback:g.useCallback(({stage:Q,cursor:le})=>{const je=se.current;je==null||Q!=="start"||!u.Tt.contains(je,le)||b()},[b])});const ie=j.purgeMouse(C.select)[0]??null,U=j.purgeMouse(C.pan)[0]??null,ue=j.purgeMouse(C.zoom)[0]??null,ge={selectionOnDrag:ie==null,panOnDrag:U==null,selectionKeyCode:ie,panActivationKeyCode:U,zoomActivationKeyCode:ue},pe=j.useCombinedRefs(se,L),re=g.useMemo(()=>({visible:f,editable:c,onEditableChange:l,registerNodeRenderer:F,fitViewOnResize:p,setFitViewOnResize:m}),[c,f,l,F,p]);return o.jsxRuntimeExports.jsx(iu.Provider,{value:re,children:o.jsxRuntimeExports.jsx(j.Composite,{path:y,children:f&&o.jsxRuntimeExports.jsx(SE,{...ge,className:u.CSS(u.CSS.B("diagram"),u.CSS.editable(c),u.CSS.BE("symbol","container")),nodes:M,edges:R,nodeTypes:$,edgeTypes:ee,ref:pe,fitView:!0,onNodesChange:D,onEdgesChange:P,onConnect:H,onReconnect:V,defaultViewport:mc(a),connectionLineComponent:iy,elevateEdgesOnSelect:!0,minZoom:.5,maxZoom:1.2,isValidConnection:uy,connectionMode:kt.Loose,fitViewOptions:ru,selectionMode:Vt.Partial,proOptions:py,deleteKeyCode:my,...h,style:{[u.CSS.var("diagram-zoom")]:a.zoom,...h.style},...q,nodesDraggable:c&&!ne.held,children:t})})})},hy=()=>{const{editable:e}=wn();return e?o.jsxRuntimeExports.jsx(_E,{}):null},gy=({children:e,...t})=>o.jsxRuntimeExports.jsx(te.Pack,{direction:"y",borderShade:4,className:u.CSS.BE("diagram","controls"),...t,children:e}),jy=({onClick:e,...t})=>{const{editable:n,onEditableChange:s}=wn();return o.jsxRuntimeExports.jsx(j.ToggleIcon,{onChange:()=>s(!n),value:n,uncheckedVariant:"outlined",checkedVariant:"filled",tooltipLocation:u.K.RIGHT_CENTER,tooltip:n?o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Disable edit mode"}):o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Enable edit mode"}),...t,children:n?o.jsxRuntimeExports.jsx(j.Lt.EditOff,{}):o.jsxRuntimeExports.jsx(j.Lt.Edit,{})})},Ey=({onClick:e,...t})=>{const{fitView:n}=Lt(),{fitViewOnResize:s,setFitViewOnResize:r}=wn();return o.jsxRuntimeExports.jsx(j.ToggleIcon,{onClick:i=>{n(ru),e==null||e(i)},value:s,onChange:i=>r(i),rightClickToggle:!0,tooltip:o.jsxRuntimeExports.jsx(j.Text$1,{level:"small",children:"Fit view to contents"}),tooltipLocation:u.K.RIGHT_CENTER,variant:"outlined",...t,children:o.jsxRuntimeExports.jsx(j.Lt.Expand,{})})},yy=e=>o.jsxRuntimeExports.jsx(qa,{children:o.jsxRuntimeExports.jsx(fy,{...e})}),Sy=Object.freeze(Object.defineProperty({__proto__:null,Background:hy,Controls:gy,DefaultPath:nu,Diagram:yy,FitViewControl:Ey,HandleLayout:ou,NodeLayout:Ts,NodeRenderer:lu,PATHS:tu,PATH_TYPES:su,SelectPathType:oy,ToggleEditControl:jy,alignNodes:P1,calcPath:dt,edgeConverter:Vn,edgeZ:M1,nodeConverter:hc,nodeZ:L1,offsetPath:WE,rfEdgeDataZ:dc,selectNode:Ps,selectNodeBox:Ne,selectNodeLayout:ry,translateEdgesBackward:pc,translateEdgesForward:sr,translateNodesBackward:xc,translateNodesForward:nr,translateViewportBackward:fc,translateViewportForward:mc,use:ay,useContext:wn,viewportZ:_1},Symbol.toStringTag,{value:"Module"})),Ry=({aetherKey:e,font:t,className:n,visible:s=!0,emptyContent:r=o.jsxRuntimeExports.jsx(j.Text$3.Centered,{level:"h3",variant:"disabled",hideIcon:!0,children:"Empty Log"}),color:i,telem:l,...c})=>{const a=j.useMemoDeepEqualProps({font:t,color:i,telem:l,visible:s}),[,{scrolling:d,empty:x},p]=j.use$3({type:B.Log.TYPE,schema:B.logState,initialState:{empty:!0,region:u.Tt.ZERO,scrolling:!1,wheelPos:0,...a}});g.useEffect(()=>{p(f=>({...f,...a}))},[a,p]);const m=En(g.useCallback(f=>p(h=>({...h,region:f})),[p]));return o.jsxRuntimeExports.jsx("div",{ref:m,className:u.CSS(u.CSS.B("log"),n),onWheel:f=>{p(h=>({...h,wheelPos:h.wheelPos-f.deltaY,scrolling:h.scrolling?h.scrolling:f.deltaY<0}))},...c,children:x?r:o.jsxRuntimeExports.jsx(j.Icon,{className:u.CSS(u.CSS.BE("log","live"),d&&u.CSS.M("active")),variant:"outlined",onClick:()=>p(f=>({...f,scrolling:!f.scrolling})),tooltip:d?"Resume Scrolling":"Pause Scrolling",children:o.jsxRuntimeExports.jsx(j.Lt.Dynamic,{})})})},Cy=Object.freeze(Object.defineProperty({__proto__:null,Log:Ry},Symbol.toStringTag,{value:"Module"})),mt=(e,t)=>{const n={};t.forEach(r=>n[r]=void 0);const s=r=>{const{...i}={...r,...n};return o.jsxRuntimeExports.jsx(e,{...i})};return s.displayName=`RemoveProps(${e.displayName})`,s},by=({value:e,hideOuter:t=!1,hideInner:n,onChange:s})=>{const{outer:r}=e,i=l=>()=>s({...e,...l});return t?o.jsxRuntimeExports.jsx(Zi,{className:u.CSS.B("orientation-control"),value:e,onChange:s}):o.jsxRuntimeExports.jsxs(te.Space,{className:u.CSS.B("orientation-control"),align:"center",justify:"center",size:.5,children:[o.jsxRuntimeExports.jsx(at,{selected:r==="top",onClick:i({outer:"top"})}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",justify:"center",size:.5,children:[o.jsxRuntimeExports.jsx(at,{selected:r==="left",onClick:i({outer:"left"})}),o.jsxRuntimeExports.jsx(Zi,{hideInner:n,value:e,onChange:s}),o.jsxRuntimeExports.jsx(at,{selected:r==="right",onClick:i({outer:"right"})})]}),o.jsxRuntimeExports.jsx(at,{selected:r==="bottom",onClick:i({outer:"bottom"})})]})},Zi=({value:e,onChange:t,className:n,hideInner:s=!1,...r})=>{const{inner:i}=e,l=a=>()=>t({...e,...a});let c={};return s&&(c={opacity:0,userSelect:"none",width:"1.5rem",height:"1.5rem"}),o.jsxRuntimeExports.jsxs(te.Space,{className:u.CSS(n,u.CSS.B("value")),direction:"y",align:"center",justify:"center",empty:!0,...r,children:[o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:i==="top",onClick:l({inner:"top"})}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"center",justify:"center",children:[o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,selected:i==="left",onClick:l({inner:"left"})}),o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,selected:i==="right",onClick:l({inner:"right"})})]}),o.jsxRuntimeExports.jsx(at,{style:c,disabled:s,className:u.CSS(u.CSS.dir("y")),selected:i==="bottom",onClick:l({inner:"bottom"})})]})},at=({selected:e,className:t,...n})=>o.jsxRuntimeExports.jsx(j.Icon,{variant:"text",className:u.CSS(t,u.CSS.selected(e)),...n,children:o.jsxRuntimeExports.jsx("div",{className:"symbol"})}),Be=({className:e,direction:t,...n})=>o.jsxRuntimeExports.jsx(te.Space,{direction:t,align:"stretch",className:u.CSS(u.CSS.B("symbol-form"),e),size:t==="x"?"large":"medium",...n}),ft=({hideOuter:e,hideInner:t,...n})=>t&&e?null:o.jsxRuntimeExports.jsx(ye,{label:"Orientation",padHelpText:!1,...n,children:({value:s,onChange:r})=>{var i;return o.jsxRuntimeExports.jsx(by,{value:{inner:s.orientation??"top",outer:((i=s.label)==null?void 0:i.orientation)??"top"},hideInner:t,hideOuter:e,onChange:l=>r({...s,orientation:l.inner,label:{...s.label,orientation:l.outer}})})}}),Pt=({path:e,omit:t=[]})=>o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(ye,{path:`${e}.label`,label:"Label",padHelpText:!1,grow:!0,children:n=>o.jsxRuntimeExports.jsx(j.Text$2,{selectOnFocus:!0,...n})}),o.jsxRuntimeExports.jsx(zt,{visible:!t.includes("maxInlineSize"),style:{maxWidth:125},path:`${e}.maxInlineSize`,hideIfNull:!0,label:"Label Wrap Width",inputProps:{endContent:"px",dragScale:{x:1,y:.5}},padHelpText:!1}),o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,visible:!t.includes("level"),path:`${e}.level`,label:"Label Size",padHelpText:!1,children:n=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...n})}),o.jsxRuntimeExports.jsx(ye,{visible:!t.includes("align"),path:`${e}.align`,label:"Label Alignment",padHelpText:!1,hideIfNull:!0,children:n=>o.jsxRuntimeExports.jsx(ms,{...n})}),o.jsxRuntimeExports.jsx(ye,{visible:!t.includes("direction"),path:`${e}.direction`,label:"Label Direction",padHelpText:!1,hideIfNull:!0,children:n=>o.jsxRuntimeExports.jsx(El,{...n,yDirection:"down"})})]}),Ke=e=>o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Color",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n,variant:s,...r})=>o.jsxRuntimeExports.jsx(j.Swatch,{value:t??u.ZERO.setAlpha(1).rgba255,onChange:i=>n(i.rgba255),...r,bordered:!0})}),cu=e=>o.jsxRuntimeExports.jsx(ye,{hideIfNull:!0,label:"Scale",align:"start",padHelpText:!1,...e,children:({value:t,onChange:n})=>o.jsxRuntimeExports.jsx(j.Numeric,{dragScale:{x:.75,y:.5},bounds:{lower:50,upper:1e3},endContent:"%",value:Math.round(t*100),onChange:s=>n(parseFloat((s/100).toFixed(2)))})}),me=({omit:e,hideInnerOrientation:t,hideOuterOrientation:n})=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{omit:e,path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(Ke,{path:"color",optional:!0}),o.jsxRuntimeExports.jsx(ye,{path:"normallyOpen",label:"Normally Open",padHelpText:!1,hideIfNull:!0,optional:!0,children:s=>o.jsxRuntimeExports.jsx(j.Switch$1,{...s})}),o.jsxRuntimeExports.jsx(cu,{path:"scale"})]})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideInner:t,hideOuter:n})]}),wy=({path:e})=>{var d,x;const{value:t,onChange:n}=pt({path:e}),s=B.sourcePipelinePropsZ.parse((d=t.source)==null?void 0:d.props),r=B.sinkPipelinePropsZ.parse((x=t.sink)==null?void 0:x.props),i=B.streamChannelValuePropsZ.parse(s.segments.valueStream.props),l=B.setChannelValuePropsZ.parse(r.segments.setter.props),c=p=>{p??(p=0);const m=B.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:B.streamChannelValue({channel:p}),threshold:B.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"});n({...t,source:m})},a=p=>{p??(p=0);const m=B.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:B.setChannelValue({channel:p}),setpoint:B.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),f=B.authoritySource({channel:p}),h=B.acquireChannelControl({channel:p,authority:255});n({...t,sink:m,control:{showChip:!0,showIndicator:!0,...t.control,chip:{sink:h,source:f},indicator:{statusSource:f}}})};return o.jsxRuntimeExports.jsxs(Be,{direction:"x",grow:!0,align:"stretch",children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"State Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:i.channel,onChange:c})}),o.jsxRuntimeExports.jsx(Te.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:l.channel,onChange:a})}),o.jsxRuntimeExports.jsx(hs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},jr=[{tabKey:"style",name:"Style"},{tabKey:"control",name:"Control"}],Re=({hideInnerOrientation:e})=>{const t=g.useCallback(({tabKey:s})=>{switch(s){case"control":return o.jsxRuntimeExports.jsx(wy,{path:""});default:return o.jsxRuntimeExports.jsx(me,{hideInnerOrientation:e})}},[e]),n=ke.useStatic({tabs:jr,content:t});return o.jsxRuntimeExports.jsx(ke.Tabs,{...n})},yt={y:2,x:.25},cn={lower:0,upper:2e3},Gi={lower:0,upper:51},au=({includeBorderRadius:e=!1})=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ke,{path:"color"}),o.jsxRuntimeExports.jsx(Ke,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(ye,{path:"borderRadius.x",hideIfNull:!0,optional:!0,label:"X Border Radius",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:yt,bounds:Gi,endContent:"%",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"borderRadius.y",hideIfNull:!0,optional:!0,label:"Y Border Radius",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:yt,bounds:Gi,endContent:"%",...n})}),e&&o.jsxRuntimeExports.jsx(ye,{path:"borderRadius",hideIfNull:!0,optional:!0,label:"Border Radius",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:t,dragScale:yt,bounds:cn,endContent:"px",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.width",label:"Width",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:t??200,dragScale:yt,bounds:cn,endContent:"px",...n})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.height",label:"Height",grow:!0,children:({value:t,...n})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:t??200,dragScale:yt,bounds:cn,endContent:"px",...n})})]})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideInner:!0})]}),uu=[{tabKey:"style",name:"Style"},{tabKey:"telemetry",name:"Telemetry"}],vy=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsxs(Be,{direction:"y",empty:!0,children:[o.jsxRuntimeExports.jsx(er,{path:""}),";"]});default:return o.jsxRuntimeExports.jsxs(Be,{direction:"x",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ke,{path:"color"}),o.jsxRuntimeExports.jsx(ye,{path:"units",label:"Units",align:"start",padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(j.Text$2,{...s})}),o.jsxRuntimeExports.jsx(zt,{path:"inlineSize",label:"Value Width",hideIfNull:!0,inputProps:{dragScale:{x:1,y:.25},bounds:{lower:40,upper:500},endContent:"px"}}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...s})})]})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideInner:!0})]})}},[]),t=ke.useStatic({tabs:uu,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},ky=({path:e})=>{var d;const{value:t,onChange:n}=pt({path:e}),s=B.sourcePipelinePropsZ.parse((d=t.source)==null?void 0:d.props),r=B.streamChannelValuePropsZ.parse(s.segments.valueStream.props),i=B.withinBoundsProps.parse(s.segments.threshold.props),l=x=>{x??(x=0);const p=B.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:B.streamChannelValue({channel:x}),threshold:B.withinBounds({trueBound:{lower:i.trueBound.lower??.9,upper:i.trueBound.upper??1.1}})},outlet:"threshold"});n({...t,source:p})},c=x=>{const p=B.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:B.streamChannelValue({channel:r.channel}),threshold:B.withinBounds({trueBound:x})},outlet:"threshold"});n({...t,source:p})},a=ps(r.channel);return g.useEffect(()=>n({...t}),[a]),o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Input Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:r.channel,onChange:l})}),o.jsxRuntimeExports.jsx(Te.Item,{label:"Lower Threshold",children:o.jsxRuntimeExports.jsx(j.Numeric,{value:i.trueBound.lower??.9,onChange:x=>c({...i.trueBound,lower:x})})}),o.jsxRuntimeExports.jsx(Te.Item,{label:"Upper Threshold",children:o.jsxRuntimeExports.jsx(j.Numeric,{value:i.trueBound.upper??1.1,onChange:x=>c({...i.trueBound,upper:x})})})]})},_y=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"telemetry":return o.jsxRuntimeExports.jsx(ky,{path:""});default:return o.jsxRuntimeExports.jsx(me,{})}},[]),t=ke.useStatic({tabs:uu,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},My=({path:e})=>{var l;const{value:t,onChange:n}=pt({path:e}),s=B.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),r=B.setChannelValuePropsZ.parse(s.segments.setter.props),i=c=>{c??(c=0);const a=B.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:B.setChannelValue({channel:c}),setpoint:B.setpoint({truthy:1,falsy:0})},inlet:"setpoint"}),d=B.authoritySource({channel:c}),x=B.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:x,source:d},showIndicator:!0,indicator:{statusSource:d}}})};return o.jsxRuntimeExports.jsxs(Be,{direction:"x",children:[o.jsxRuntimeExports.jsx(Te.Item,{label:"Output Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:r.channel,onChange:i})}),o.jsxRuntimeExports.jsx(zt,{label:"Activation Delay",path:"onClickDelay",inputProps:{endContent:"ms"},hideIfNull:!0}),o.jsxRuntimeExports.jsx(hs,{path:"control.show",label:"Show Control Chip",hideIfNull:!0,optional:!0})]})},Ly=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(My,{path:""});default:return o.jsxRuntimeExports.jsx(me,{omit:["align","maxInlineSize"],hideInnerOrientation:!0,hideOuterOrientation:!0})}},[]),t=ke.useStatic({tabs:jr,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},Py=({path:e})=>{var l;const{value:t,onChange:n}=pt({path:e}),s=B.sinkPipelinePropsZ.parse((l=t.sink)==null?void 0:l.props),r=B.setChannelValuePropsZ.parse(s.segments.setter.props),i=c=>{c??(c=0);const a=B.sinkPipeline("number",{connections:[],segments:{setter:B.setChannelValue({channel:c})},inlet:"setter"}),d=B.authoritySource({channel:c}),x=B.acquireChannelControl({channel:c,authority:255});n({...t,sink:a,control:{...t.control,showChip:!0,chip:{sink:x,source:d},showIndicator:!0,indicator:{statusSource:d}},disabled:c==0})};return o.jsxRuntimeExports.jsx(Be,{direction:"x",grow:!0,align:"stretch",children:o.jsxRuntimeExports.jsx(Te.Item,{label:"Command Channel",grow:!0,children:o.jsxRuntimeExports.jsx(Ct,{value:r.channel,onChange:i})})})},Ty=()=>{const e=g.useCallback(({tabKey:n})=>{switch(n){case"control":return o.jsxRuntimeExports.jsx(Py,{path:""});default:return o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",align:"stretch",grow:!0,size:"small",children:[o.jsxRuntimeExports.jsx(Pt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Wo,{path:"units",label:"Units",align:"start",padHelpText:!1}),o.jsxRuntimeExports.jsx(ye,{path:"size",label:"Size",hideIfNull:!0,padHelpText:!1,children:s=>o.jsxRuntimeExports.jsx(gl,{...s})}),o.jsxRuntimeExports.jsx(Ke,{path:"color"})]})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideInner:!0})]})}},[]),t=ke.useStatic({tabs:jr,content:e});return o.jsxRuntimeExports.jsx(ke.Tabs,{...t})},Ny=()=>{const e=pt({path:"autoFit",optional:!0});return o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",grow:!0,children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsx(ye,{path:"text",label:"Text",padHelpText:!1,grow:!0,children:t=>o.jsxRuntimeExports.jsx(j.Text$2,{selectOnFocus:!0,...t})}),o.jsxRuntimeExports.jsx(ye,{path:"level",label:"Text Size",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(ve.SelectLevel,{...t})}),o.jsxRuntimeExports.jsx(ye,{path:"align",label:"Alignment",padHelpText:!1,hideIfNull:!0,children:t=>o.jsxRuntimeExports.jsx(ms,{...t})})]}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ke,{path:"color"}),o.jsxRuntimeExports.jsx(ye,{onChange:(t,{set:n})=>n("autoFit",!1),path:"width",label:"Wrap Width",padHelpText:!1,children:t=>o.jsxRuntimeExports.jsx(j.Numeric,{...t,bounds:{lower:0,upper:2e3},dragScale:5,endContent:"px",children:o.jsxRuntimeExports.jsx(j.Icon,{onClick:()=>e==null?void 0:e.onChange(!0),disabled:(e==null?void 0:e.value)===!0,variant:"outlined",tooltip:(e==null?void 0:e.value)===!0?"Manually enter value to disable auto fit":"Enable auto fit",children:o.jsxRuntimeExports.jsx(j.Lt.AutoFitWidth,{})})})})]})]}),o.jsxRuntimeExports.jsx(ft,{path:""})]})},Ay=()=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{path:"label",omit:["maxInlineSize","align","direction"]}),o.jsxRuntimeExports.jsx(Ke,{path:"color"})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideOuter:!0})]}),Iy=()=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",children:[o.jsxRuntimeExports.jsx(Ke,{path:"color"}),o.jsxRuntimeExports.jsx(Ke,{path:"backgroundColor",label:"Background Color"}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.width",label:"Width",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:e??200,dragScale:yt,bounds:cn,endContent:"px",...t})}),o.jsxRuntimeExports.jsx(ye,{path:"dimensions.height",label:"Height",grow:!0,children:({value:e,...t})=>o.jsxRuntimeExports.jsx(j.Numeric,{value:e??200,dragScale:yt,bounds:cn,endContent:"px",...t})})]})]}),o.jsxRuntimeExports.jsx(ft,{path:"",hideInner:!0})]}),ht=()=>o.jsxRuntimeExports.jsxs(Be,{direction:"x",align:"stretch",children:[o.jsxRuntimeExports.jsxs(te.Space,{direction:"y",grow:!0,children:[o.jsxRuntimeExports.jsx(Pt,{path:"label"}),o.jsxRuntimeExports.jsxs(te.Space,{direction:"x",grow:!0,children:[o.jsxRuntimeExports.jsx(Ke,{path:"color"}),o.jsxRuntimeExports.jsx(cu,{path:"scale"}),o.jsxRuntimeExports.jsx(hs,{path:"clickable",label:"Clickable",hideIfNull:!0,optional:!0})]})]}),o.jsxRuntimeExports.jsx(ft,{path:""})]}),$y=()=>o.jsxRuntimeExports.jsx(au,{includeBorderRadius:!0}),zy=()=>o.jsxRuntimeExports.jsx(Re,{hideInnerOrientation:!0}),O=e=>o.jsxRuntimeExports.jsx("path",{vectorEffect:"non-scaling-stroke",...e}),Se=e=>o.jsxRuntimeExports.jsx("rect",{vectorEffect:"non-scaling-stroke",...e}),Pe=e=>o.jsxRuntimeExports.jsx("circle",{vectorEffect:"non-scaling-stroke",...e}),fe=e=>o.jsxRuntimeExports.jsx("line",{vectorEffect:"non-scaling-stroke",...e}),By={left:{left:X.Left,right:X.Right,top:X.Top,bottom:X.Bottom},right:{left:X.Right,right:X.Left,top:X.Bottom,bottom:X.Top},top:{left:X.Bottom,right:X.Top,top:X.Left,bottom:X.Right},bottom:{left:X.Top,right:X.Bottom,top:X.Right,bottom:X.Left}},Dy=(e,t)=>By[t][e],Oy=(e,t=!1)=>{if(t)return e;switch(e){case X.Left:return X.Right;case X.Right:return X.Left;case X.Top:return X.Bottom;case X.Bottom:return X.Top;default:return X.Top}},Vy=(e,t,n,s=!1)=>s?{left:t,top:e}:n==="left"?{top:e,left:t}:n==="right"?{top:100-e,left:100-t}:n==="top"?{top:100-t,left:e}:{top:t,left:100-e},W=({children:e,orientation:t,refreshDeps:n})=>{let s;try{s=RE()}catch{return o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})}const r=g.useRef(null),i=g.useRef(!0);return g.useEffect(()=>{if(r.current==null)return;if(i.current){i.current=!1;return}const l=r.current.closest(".react-flow__node"),c=l==null?void 0:l.getAttribute("data-id");c!=null&&(s==null||s(c))},[t,n]),o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx("span",{ref:r}),e]})},v=({location:e,orientation:t,preventAutoAdjust:n,left:s,swap:r,top:i,style:l,...c})=>{const a=Vy(i,s,t,n);return o.jsxRuntimeExports.jsx(jn,{position:Oy(Dy(e,t),!r),...c,type:"source",onClick:d=>d.stopPropagation(),className:(u.CSS.B("handle"),u.CSS.BE("handle",c.id)),style:{left:`${a.left}%`,top:`${a.top}%`,...l}})},he=({className:e,enabled:t=!1,triggered:n=!1,orientation:s="left",color:r,...i})=>o.jsxRuntimeExports.jsx("button",{className:u.CSS(u.CSS.B("symbol-primitive"),u.CSS.B("symbol-primitive-toggle"),s!=null&&u.CSS.loc(s),t&&u.CSS.M("enabled"),n&&u.CSS.M("triggered"),e),color:u.cssString(r),...i}),de=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.B("symbol-primitive"),e),...t}),Fy=.8,J=({dimensions:e,orientation:t="left",children:n,className:s,color:r,style:i={},scale:l=1,...c})=>{e=u.g.construct(t)==="y"?u._.swap(e):e;const d=u.cssString(r),x=j.use();return r!=null&&(i[u.CSS.var("symbol-color")]=new u.Color(r).rgbString,i[u.CSS.var("symbol-color-contrast")]=new u.Color(r).pickByContrast(x.colors.gray.l0,x.colors.gray.l10).rgbString),o.jsxRuntimeExports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:u._.svgViewBox(e),className:u.CSS(u.CSS.loc(t),s),fill:d,stroke:d,...c,style:{aspectRatio:`${e.width} / ${e.height}`,width:u._.scale(e,l*Fy).width,...i},children:o.jsxRuntimeExports.jsx("g",{children:n})})},du=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,orientation:t,className:u.CSS(u.CSS.B("four-way-valve"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:97.7011,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:2.2989,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:97.7011,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:87},color:s,scale:n,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 43.5L6.35453 24.7035C4.35901 23.6937 2 25.1438 2 27.3803V59.6197C2 61.8562 4.35901 63.3063 6.35453 62.2965L43.5 43.5ZM43.5 43.5L80.6455 24.7035C82.641 23.6937 85 25.1438 85 27.3803V59.6197C85 61.8562 82.641 63.3063 80.6455 62.2965L43.5 43.5Z"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 43.5L24.7035 80.6455C23.6937 82.641 25.1438 85 27.3803 85H59.6197C61.8562 85 63.3063 82.641 62.2965 80.6455L43.5 43.5ZM43.5 43.5L24.7035 6.35453C23.6937 4.35901 25.1438 2 27.3803 2H59.6197C61.8562 2 63.3063 4.35901 62.2965 6.35453L43.5 43.5Z"})]})]}),xu=({color:e,orientation:t="left",scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,className:u.CSS(u.CSS.B("three-way-valve")),orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:64},color:e,orientation:t,scale:n,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),pu=({orientation:e="left",color:t,scale:n,...s})=>o.jsxRuntimeExports.jsxs(he,{...s,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:e,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:e,left:97.7701,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:87,height:42},color:t,orientation:e,scale:n,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),mu=({className:e,color:t,orientation:n="left",normallyOpen:s=!1,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{className:u.CSS(u.CSS.B("solenoid-valve"),s&&u.CSS.M("normally-open"),e),...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:69.5652,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:69.5652,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:33.3333,top:17.7778,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:2.8986,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:66.6667,top:17.7778,id:"5"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:69},color:t,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(O,{className:u.CSS.B("body"),d:"M43.5 48L6.35453 29.2035C4.35901 28.1937 2 29.6438 2 31.8803V64.1197C2 66.3562 4.35901 67.8063 6.35453 66.7965L43.5 48ZM43.5 48L80.6455 29.2035C82.641 28.1937 85 29.6438 85 31.8803V64.1197C85 66.3562 82.641 67.8063 80.6455 66.7965L43.5 48Z"}),o.jsxRuntimeExports.jsx(fe,{x1:43.5,x2:43.5,y1:24.5333,y2:48}),o.jsxRuntimeExports.jsx(Se,{x:"29",y:"2",width:"29",height:"22.5333",rx:"1"})]})]}),fu=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{className:u.CSS(u.CSS.B("relief-valve"),e),enabled:r,...i,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:63.7931,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:63.7931,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:58},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 37L6.35453 18.2035C4.35901 17.1937 2 18.6438 2 20.8803V53.1197C2 55.3562 4.35901 56.8063 6.35453 55.7965L43.5 37ZM43.5 37L80.6455 18.2035C82.641 17.1937 85 18.6438 85 20.8803V53.1197C85 55.3562 82.641 56.8063 80.6455 55.7965L43.5 37Z"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 2 L43.5 37",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31.8011 14.0802L55.1773 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31.8011 20.0802L55.1773 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31.8011 26.0802L55.1773 16.2961",strokeLinecap:"round"})]})]}),hu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{orientation:t,className:u.CSS(u.CSS.B("check-valve"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:4.2222,top:48.8372,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:94.2038,top:48.8372,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:45,height:43},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"42.3917",y1:"2",x2:"42.3917",y2:"41",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),gu=({className:e,orientation:t="left",color:n,scale:s,...r})=>{const i=u.cssString(n);return o.jsxRuntimeExports.jsxs(de,{...r,orientation:t,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:8.3333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.4286,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:84,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Pe,{cx:"7",cy:"7",r:"4",fill:i}),o.jsxRuntimeExports.jsx(O,{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"})]})]})},ju=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,orientation:n,className:u.CSS(u.CSS.B("angled-valve"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:32.8125,top:97.0278,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.0278,top:32.8125,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M22.3611 20.1077C21.6298 20.4778 21.6298 21.5222 22.3611 21.8923L57.7433 39.7965C59.7388 40.8063 62.0978 39.3562 62.0978 37.1197L62.0978 4.88029C62.0978 2.64384 59.7388 1.19372 57.7433 2.2035L22.3611 20.1077Z"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Eu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Pe,{cx:"43.5978",cy:"20.972",r:"19"}),o.jsxRuntimeExports.jsx(O,{d:"M26.5 12.8472L6.35452 2.17563C4.35901 1.16585 2 2.61598 2 4.85243V37.0918C2 39.3283 4.35901 40.7784 6.35453 39.7686L26.5 29.3472"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),yu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("three-way-ball-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.8,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:33.1308,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:33.1308,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Pe,{cx:"43.5978",cy:"21.722",r:"19"}),o.jsxRuntimeExports.jsx(O,{d:"M26.5 13.5972L6.35452 2.92563C4.35901 1.91585 2 3.36598 2 5.60243V37.8418C2 40.0783 4.35901 41.5284 6.35453 40.5186L26.5 30.0972"}),o.jsxRuntimeExports.jsx(O,{d:"M60.5 29.5986L80.6455 40.2702C82.641 41.2799 85 39.8298 85 37.5934V5.35396C85 3.11751 82.641 1.66738 80.6455 2.67716L60.5 13.0986"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Su=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("gate-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 2 L43.5 39.7965"})]})]}),Ru=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-one"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 21L6.35453 2.20349C4.35901 1.19372 2 2.64384 2 4.88029V37.1197C2 39.3562 4.35901 40.8063 6.35453 39.7965L43.5 21ZM43.5 21L80.6455 2.20349C82.641 1.19372 85 2.64384 85 4.8803V37.1197C85 39.3562 82.641 40.8063 80.6455 39.7965L43.5 21Z"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 2V40"}),o.jsxRuntimeExports.jsx(Pe,{cx:"43.5",cy:"21",r:"10",fill:u.cssString(e)})]})]}),Cu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("butterfly-valve-two"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2.2989,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.7011,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Pe,{cx:"43.5",cy:"21",r:"10",fill:u.cssString(e)}),o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"83",height:"38",rx:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M2.29001 2.29004L84.7069 39.676"})]})]}),bu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("breather-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:8.081,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:91.919,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:99,height:57},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Pe,{cx:"91",cy:"49.5",r:"6",fill:u.cssString(e)}),o.jsxRuntimeExports.jsx(Pe,{cx:"8",cy:"7.5",r:"6",fill:u.cssString(e)}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),wu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Pe,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)})]})]}),vu=({className:e,color:t,orientation:n="left",scale:s,...r})=>{const i=u.cssString(t);return o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:5,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:40,height:48},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M24 24C24 35.1852 15.2546 44.4725 3.87626 45.8297C2.90571 45.9455 2 45.1407 2 44V4C2 2.85926 2.90571 2.0545 3.87626 2.17027C15.2546 3.52755 24 12.8148 24 24Z"}),o.jsxRuntimeExports.jsx(O,{d:"M37.9706 23.2076C38.4906 23.6079 38.4906 24.3921 37.9706 24.7924L33.86 27.9568C33.2024 28.463 32.25 27.9942 32.25 27.1644V20.8356C32.25 20.0058 33.2024 19.537 33.86 20.0432L37.9706 23.2076Z",fill:i}),o.jsxRuntimeExports.jsx(O,{d:"M33 24H2",strokeLinecap:"round"})]})]})},ku=({className:e,color:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("symbol"),e),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:11.1111,top:50,id:"1"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:36,height:72},color:t,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"4",y:"4",width:"28",height:"64",rx:"2",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),_u=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:7.6923,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(J,{color:n,dimensions:{width:26,height:48},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Mu=({className:e,orientation:t="left",color:n,scale:s=1,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("cap"),e),...r,children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:50,top:50,id:"1"})}),o.jsxRuntimeExports.jsx(J,{color:n,dimensions:{width:36,height:48},orientation:t,scale:s*.6,children:o.jsxRuntimeExports.jsx(O,{d:"M3 3H30C31.6569 3 33 4.34315 33 6V42C33 43.6569 31.6569 45 30 45H3",strokeLinecap:"round"})})]}),Lu=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("manual-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:56.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:56.25,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:48},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43.5",y1:"27",x2:"43.5",y2:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M19.64 1 L66.68 1",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Pu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("orifice_plate"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.875,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{color:n,dimensions:{width:96,height:48},orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"3",y:"3",width:"90",height:"42",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(fe,{x1:"33",y1:"3",x2:"33",y2:"21",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"33",y1:"27",x2:"33",y2:"45",strokeLinecap:"round"})]})]}),Yi=(e,t)=>e/t*100,Tu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:11.5385,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:88.4615,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:52,height:34},orientation:t,color:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Nu=e=>typeof e=="number"?{topLeft:u.G.construct(e),topRight:u.G.construct(e),bottomLeft:u.G.construct(e),bottomRight:u.G.construct(e)}:"x"in e?{topLeft:e,topRight:e,bottomLeft:e,bottomRight:e}:typeof e.bottomLeft=="number"?{topLeft:u.G.construct(e.topLeft),topRight:u.G.construct(e.topRight),bottomLeft:u.G.construct(e.bottomLeft),bottomRight:u.G.construct(e.bottomRight)}:e,Hy=e=>{const{topLeft:t,topRight:n,bottomLeft:s,bottomRight:r}=e;return`${t.x}% ${n.x}% ${r.x}% ${s.x}% / ${t.y}% ${n.y}% ${r.y}% ${s.y}%`},Au={width:40,height:80},Er={x:50,y:10},Ns=({className:e,dimensions:t=Au,borderRadius:n=Er,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const c=Nu(n),a=s==null,d=j.use(),{width:x,height:p}=t,m=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,p,x]),f=Yi(1,x),h=100-f,E=Yi(1,p),y=100-E;return o.jsxRuntimeExports.jsx(de,{className:u.CSS(e,u.CSS.B("tank")),style:{...t,borderRadius:s??Hy(c),borderColor:u.cssString(r??d.colors.gray.l9),backgroundColor:u.cssString(i)},...l,children:o.jsxRuntimeExports.jsxs(W,{refreshDeps:m,orientation:"left",children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:E,id:"1"}),a&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:f,top:c.topLeft.y,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:h,top:c.topRight.y,id:"3"})]}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:y,id:"4"}),a&&o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:f,top:100-c.bottomLeft.y,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:h,top:100-c.bottomRight.y,id:"6"})]}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:f,top:50,id:"7"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:h,top:50,id:"8"})]})})},Iu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50.9091,top:12.5,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),o.jsxRuntimeExports.jsx(O,{d:"M61 30C62.6569 30 64.0231 28.6494 63.7755 27.0111C63.141 22.8129 61.181 18.8968 58.1421 15.8579C54.3914 12.1071 49.3043 10 44 10C38.6957 10 33.6086 12.1071 29.8579 15.8579C26.819 18.8968 24.859 22.8129 24.2245 27.0111C23.9769 28.6494 25.3431 30 27 30L44.5 30H61Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),$u=({className:e,orientation:t="left",scale:n,color:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("orifice"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.8571,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.1429,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:70,height:34},orientation:t,color:s,scale:n,children:[o.jsxRuntimeExports.jsx(O,{d:"M2 2.5C27.451 21.3469 60.0915 12.0132 68 2.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M2 32.5C27.451 13.6531 60.0915 22.9868 68 32.5",strokeLinecap:"round"})]})]}),zu=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("needle-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.2989,top:51.1905,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7011,top:51.1905,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:87,height:42},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{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.cssString(n)}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Bu=({color:e,className:t,orientation:n="left",scale:s,enabled:r=!1,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,orientation:n,className:u.CSS(u.CSS.B("angled-relief-valve"),t),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:32.8125,top:97.5922,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.0278,top:45.5639,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:79},orientation:n,color:e,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:21,y1:2,x2:21,y2:36.7,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M9.05106 14.0802L32.4273 4.29611",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M9.05106 20.0802L32.4273 10.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M9.05106 26.0802L32.4273 16.2961",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M22.3611 35.1077C21.6298 35.4778 21.6298 36.5222 22.3611 36.8923L57.7433 54.7965C59.7388 55.8063 62.0978 54.3562 62.0978 52.1197L62.0978 19.8803C62.0978 17.6438 59.7388 16.1937 57.7433 17.2035L22.3611 35.1077Z"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Du=({className:e,color:t,dimensions:n,orientation:s="left",units:r="psi",unitsLevel:i="small",children:l,inlineSize:c=80,...a})=>{const d=u.cssString(t),x=j.use(),p=t==null?"var(--pluto-gray-l0)":u.cssString(new u.Color(t).pickByContrast(x.colors.gray.l0,x.colors.gray.l9));return o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("value"),e),...a,style:{borderColor:d,height:n==null?void 0:n.height,width:"100%"},children:[o.jsxRuntimeExports.jsx("div",{className:u.CSS.BE("value","content"),style:{flexGrow:1,minWidth:n==null?void 0:n.width,inlineSize:c},children:l}),o.jsxRuntimeExports.jsxs(W,{orientation:s,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx("div",{className:u.CSS(u.CSS.BE("value","units"),u.CSS.M(i)),style:{background:d},children:o.jsxRuntimeExports.jsx(j.Text$1,{level:i,color:p,children:r})})]})},Ou=({enabled:e=!1,onClick:t,orientation:n="left"})=>o.jsxRuntimeExports.jsxs(de,{orientation:n,children:[o.jsxRuntimeExports.jsx(j.Switch$1,{value:e,onClick:t,onChange:()=>{}}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:100,top:50,id:"2"})]})]}),Vu=({onClick:e,orientation:t="left",label:n="",color:s,size:r,level:i,onClickDelay:l})=>o.jsxRuntimeExports.jsxs(de,{orientation:t,children:[o.jsxRuntimeExports.jsx(j.Button,{onClick:e,color:s,size:r,level:i,onClickDelay:l,children:n}),o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:0,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:100,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:0,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:100,id:"4"})]})]}),Fu=({className:e,orientation:t="left",text:n="",width:s,color:r="var(--pluto-gray-l9)",level:i,autoFit:l,align:c="center"})=>{const a={textAlign:c};return u.g.construct(t)==="y"?a.height=l?"fit-content":s:a.width=l?"fit-content":s,o.jsxRuntimeExports.jsx(de,{style:a,orientation:t,className:u.CSS(u.CSS.B("text-box"),u.CSS.loc(t),e),children:o.jsxRuntimeExports.jsx(j.Text$1,{color:u.cssString(r),level:i,children:n})})},Hu=({orientation:e="left",className:t,onClick:n,children:s,value:r,units:i,color:l,onChange:c,size:a="small",disabled:d,...x})=>{const[p,m]=g.useState(r);return o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("setpoint"),t),orientation:e,...x,children:[o.jsxRuntimeExports.jsxs(W,{orientation:e,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:e,left:.5,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:e,left:100,top:50,id:"2",style:{zIndex:5}}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:e,left:50,top:-2,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:e,left:50,top:102,id:"4"})]}),o.jsxRuntimeExports.jsx(j.Numeric,{size:a,value:p,onChange:m,showDragHandle:!1,selectOnFocus:!0,endContent:i,outlineColor:l,borderWidth:1,disabled:d,children:o.jsxRuntimeExports.jsx(j.Button,{size:a,variant:"filled",onClick:()=>c(p),color:l,children:"Set"})})]})},Zu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("screw-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Pe,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{d:"M 0 0, L -10 -10, M 0 0, L -10 10",transform:"translate(32, 32)",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{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)})]})]}),Gu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("vacuum-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Yu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("cavity-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Pe,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{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)})]})]}),Wu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("piston-pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Pe,{cx:"32",cy:"32",r:"30"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"2",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"62",x2:"62",y2:"32",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(O,{d:"M 23 32, h 16, m 0 -8, v 16",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),Ku=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("static-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.5152,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.4848,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.3333,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.6667,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:30},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"1",y:"1",width:"64",height:"28",rx:"2",ry:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M17 10C23 10 27 20 33 20C39 20 43 10 49 10",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M17 20C23 20 27 10 33 10C39 10 43 20 49 20",strokeLinecap:"round"})]})]}),Xu=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("rotary-mixer"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:2,top:48.4849,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:97.5,top:48.4849,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:50,height:33},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M1 30V2C1 1.44772 1.44772 1 2 1H35.4545C35.7434 1 36.0181 1.12487 36.208 1.34247L48.4262 15.3425C48.7549 15.7192 48.7549 16.2808 48.4262 16.6575L36.208 30.6575C36.0181 30.8751 35.7434 31 35.4545 31H2C1.44772 31 1 30.5523 1 30Z"}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"40",y2:"16",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"22.9282",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)}),o.jsxRuntimeExports.jsx(fe,{x1:"32",y1:"16",x2:"28",y2:"9.0717",strokeLinecap:"round",className:u.CSS(u.CSS.M("detail"),t)})]})]}),qu=({className:e,color:t,orientation:n="left",enabled:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,orientation:n,className:u.CSS(u.CSS.B("light"),s&&u.CSS.M("enabled"),e),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.75,id:"4"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:64,height:64},color:t,orientation:n,scale:r,children:o.jsxRuntimeExports.jsx(Pe,{cx:"32",cy:"32",r:"30"})})]}),Uu=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(e,u.CSS.B("regulator")),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:3.4091,top:66.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:97.7273,top:66.25,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:21.5909,top:25,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:12.5,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:70/88*100,top:20/80*100,id:"5"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:88,height:80},orientation:t,color:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M44.5 53L7.35453 34.2035C5.35901 33.1937 3 34.6438 3 36.8803V69.1197C3 71.3562 5.35901 72.8063 7.35453 71.7965L44.5 53ZM44.5 53L81.6455 34.2035C83.641 33.1937 86 34.6438 86 36.8803V69.1197C86 71.3562 83.641 72.8063 81.6455 71.7965L44.5 53Z"}),o.jsxRuntimeExports.jsx(Se,{x:"19",y:"10",width:"51",height:"20",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"44.5",y1:"53",x2:"44.5",y2:"30",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Ju=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M1 85V48.8541C1 46.624 3.34694 45.1735 5.34164 46.1708L80.6584 83.8292 C82.6531 84.8265 85 83.376 85 81.1459 V44"}),o.jsxRuntimeExports.jsx(O,{d:"M43 1L45 65"})]})]}),Qu=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50.5814,top:200/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M43.5 69.573L14.9534 55.6147C8.97428 52.6911 2 57.0443 2 63.6999V75.4462C2 82.1018 8.97429 86.455 14.9534 83.5314L43.5 69.573ZM43.5 69.573L72.0466 55.6147C78.0257 52.6911 85 57.0443 85 63.6999V75.4462C85 82.1018 78.0257 86.455 72.0466 83.5314L43.5 69.573Z"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 69.6L43.5 2",strokeLinecap:"round"})]})]}),ed=({height:e=86,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:t,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(Se,{x:"3",y:"49",width:"80",height:"34",rx:"3",strokeLinecap:"round"})]})]}),td=({height:e=86,className:t,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/e,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:e},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49"}),o.jsxRuntimeExports.jsx(Se,{x:"3",y:"49",width:"80",height:"34",rx:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"3.8",y1:"82.1",x2:"43",y2:"49",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"83",x2:"82.2",y2:"49.9",className:u.CSS(u.CSS.M("detail"),t),strokeLinecap:"round"})]})]}),nd=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"1",x2:"43",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"49",x2:"83",y2:"49",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"3",y1:"83",x2:"83",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"43",y1:"49",x2:"43",y2:"83",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Se,{x:"3",y:"49",width:"80",height:"34",strokeWidth:0})]})]}),sd=({className:e,height:t=86,orientation:n="left",color:s,scale:r,...i})=>o.jsxRuntimeExports.jsxs(he,{...i,className:u.CSS(u.CSS.B("agitator")),children:[o.jsxRuntimeExports.jsx(W,{orientation:n,children:o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:100/t,id:"4"})}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:86,height:t},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(fe,{x1:43,y1:1,x2:43,y2:60,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),od=({id:e,className:t,orientation:n="right",label:s="text",color:r="black",level:i="p",onLabelChange:l,...c})=>{const a=document.querySelector(`[data-id="${e}"]`);a&&a.classList.add(n);const d=u.g.construct(n)==="y";return o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("arrow"),u.CSS.loc(n),t),orientation:n,...c,children:[o.jsxRuntimeExports.jsx("div",{className:"wrapper",children:o.jsxRuntimeExports.jsx("div",{className:"outline",style:{backgroundColor:u.cssString(r)},children:o.jsxRuntimeExports.jsx("div",{className:"bg",children:o.jsxRuntimeExports.jsx(j.MaybeEditable,{value:s,onChange:l,level:i,className:u.CSS.BE("symbol","label")})})})}),o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,preventAutoAdjust:!0,left:98,top:50,swap:d,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",preventAutoAdjust:!0,orientation:n,left:1,top:50,swap:d,id:"2"})]}),o.jsxRuntimeExports.jsx("svg",{style:{visibility:"hidden",position:"absolute"},width:"0",height:"0",xmlns:"http://www.w3.org/2000/svg",version:"1.1",children:o.jsxRuntimeExports.jsx("defs",{children:o.jsxRuntimeExports.jsxs("filter",{id:"goo",children:[o.jsxRuntimeExports.jsx("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"1.5",result:"blur"}),o.jsxRuntimeExports.jsx("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9",result:"goo"}),o.jsxRuntimeExports.jsx("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})]})},rd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("vent"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:22.7273,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:80,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(J,{color:n,dimensions:{width:22,height:32},orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{d:"M5 3L16.6325 13.8016C17.9107 14.9885 17.9107 17.0115 16.6325 18.1984L5 29",strokeLinecap:"round"})})]}),id=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("iso-filter"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:5,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:60,height:42},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"3",y:"3",width:"54",height:"36",rx:"3",ry:"3"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"3",x2:"30",y2:"13",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"17",x2:"30",y2:"25",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(fe,{x1:"30",y1:"29",x2:"30",y2:"39",strokeLinecap:"round"})]})]}),ld=({className:e,dimensions:t=Au,borderRadius:n=Er,boxBorderRadius:s,color:r,backgroundColor:i,...l})=>{const c=Nu(n),a=j.use(),d=g.useMemo(()=>[t,n,c],[c.bottomLeft,c.bottomRight,c.topLeft,c.topRight,t.height,t.width]),x=u.cssString(r??a.colors.gray.l9),p=i==null?void 0:u.cssString(i),m=t.width/66,f=t.height/180,h=`scale(${m},${f})`;return o.jsxRuntimeExports.jsxs(de,{className:u.CSS(e,u.CSS.B("cylinder")),style:{...t},...l,children:[o.jsxRuntimeExports.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${t.width} ${t.height}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",transform:h,children:o.jsxRuntimeExports.jsx("path",{d:"M23 33.6712C11.9844 36.0332 3 42.4382 3 52.8862V174.568C3 176.225 4.34315 177.568 6 177.568H60C61.6569 177.568 63 176.225 63 174.568V52.8862C63 36.3342 40.4511 29.9292 23 33.6712ZM23 33.6712V13.3181C23 0.318109 42.9975 0.318123 42.9975 13.3181V33.6712",vectorEffect:"non-scaling-stroke",strokeWidth:"2",stroke:x,transform:h,fill:p})}),o.jsxRuntimeExports.jsxs(W,{refreshDeps:d,orientation:"left",children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:"left",left:50,top:2,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:35,top:10,id:"9"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:65,top:10,id:"10"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:"left",left:50,top:98.3333,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:40,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:40,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:60,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:60,id:"6"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:"left",left:4,top:80,id:"7"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:"left",left:96,top:80,id:"8"})]})]})},cd=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:2.1373,top:69.0785,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:96.7416,top:72.368,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:89,height:76},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M46.3625 54.1079C45.6312 54.4779 45.6311 55.5223 46.3624 55.8924L81.7435 73.7989C83.7389 74.8088 86.098 73.3588 86.0982 71.1224L86.1002 38.883C86.1003 36.6465 83.7414 35.1962 81.7458 36.2059L46.3625 54.1079Z",stroke:l}),o.jsxRuntimeExports.jsx(O,{d:"M71 38.0014V72.0014",stroke:l,strokeWidth:4,strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M41.6389 55.8923C42.3702 55.5222 42.3702 54.4778 41.6389 54.1077L6.2567 36.2035C4.26118 35.1937 1.90217 36.6438 1.90217 38.8803L1.90217 71.1197C1.90217 73.3562 4.26119 74.8063 6.2567 73.7965L41.6389 55.8923Z",stroke:l}),o.jsxRuntimeExports.jsx(Pe,{cx:"44",cy:"55",r:"4",fill:l}),o.jsxRuntimeExports.jsx(O,{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})]})]})},ad=({className:e,orientation:t="left",color:n,scale:s,enabled:r=!1,...i})=>{const l=u.cssString(n);return o.jsxRuntimeExports.jsxs(he,{...i,orientation:t,className:u.CSS(u.CSS.B("spring-loaded-relief-valve"),e),enabled:r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:31.8182,top:98,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95.6061,top:55.5185,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:101},color:n,orientation:t,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M23.3625 55.6237C22.6312 55.9937 22.6311 57.0381 23.3624 57.4082L58.7435 75.3147C60.7389 76.3246 63.098 74.8747 63.0981 72.6382L63.1001 40.3988C63.1003 38.1624 60.7414 36.7121 58.7458 37.7217L23.3625 55.6237Z"}),o.jsxRuntimeExports.jsx(O,{d:"M48 38.633V72.633",strokeLinecap:"round",strokeWidth:4}),o.jsxRuntimeExports.jsx(O,{d:"M21.8923 58.4348C21.5222 57.7035 20.4778 57.7035 20.1077 58.4348L2.20349 93.817C1.19372 95.8125 2.64384 98.1715 4.8803 98.1715H37.1197C39.3562 98.1715 40.8063 95.8125 39.7965 93.817L21.8923 58.4348Z"}),o.jsxRuntimeExports.jsx(Pe,{cx:"21",cy:"56.0737",r:"4",fill:l}),o.jsxRuntimeExports.jsx(O,{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"})]})]})},ud=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:1.6667,top:20,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:98.3333,top:20,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:95,id:"3"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:36,height:18},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{d:"M0 4V2C0 0.895431 0.895431 0 2 0H34C35.1046 0 36 0.89543 36 2V4C36 5.10457 35.1046 6 34 6H23C21.8954 6 21 6.89543 21 8V16C21 17.1046 20.1046 18 19 18H17C15.8954 18 15 17.1046 15 16V8C15 6.89543 14.1046 6 13 6H2C0.895431 6 0 5.10457 0 4Z",fill:u.cssString(n),stroke:"none"})})]}),dd=({className:e,orientation:t="left",color:n,scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{className:u.CSS(u.CSS.B("t-junction"),e),...r,children:[o.jsxRuntimeExports.jsxs(W,{orientation:t,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:t,left:5,top:49,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:t,left:95,top:49,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:t,left:50,top:95,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:t,left:50,top:5,id:"4"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:36,height:36},color:n,orientation:t,scale:s,children:o.jsxRuntimeExports.jsx(O,{d:"M21 34C21 35.1046 20.1046 36 19 36H17C15.8954 36 15 35.1046 15 34V23C15 21.8954 14.1046 21 13 21H2C0.895432 21 0 20.1046 0 19V17C0 15.8954 0.895432 15 2 15H13C14.1046 15 15 14.1046 15 13V2C15 0.895432 15.8954 0 17 0H19C20.1046 0 21 0.895432 21 2V13C21 14.1046 21.8954 15 23 15H34C35.1046 15 36 15.8954 36 17V19C36 20.1046 35.1046 21 34 21H23C21.8954 21 21 21.8954 21 23V34Z",fill:u.cssString(n),stroke:"none"})})]}),Ze=({position:e,color:t})=>o.jsxRuntimeExports.jsx("text",{x:(e==null?void 0:e.x)??57,y:(e==null?void 0:e.y)??27,style:{fill:u.cssString(t),fontWeight:450},stroke:"none",children:"F"}),xd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:25},color:s})]})]}),pd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Electromagnetic"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M47.5 17.5H55.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M15.5 17.5H23.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M23.5 17.5C23.5 16.9747 23.6035 16.4546 23.8045 15.9693C24.0055 15.484 24.3001 15.043 24.6716 14.6716C25.043 14.3001 25.484 14.0055 25.9693 13.8045C26.4546 13.6035 26.9747 13.5 27.5 13.5C28.0253 13.5 28.5454 13.6035 29.0307 13.8045C29.516 14.0055 29.957 14.3001 30.3284 14.6716C30.6999 15.043 30.9945 15.484 31.1955 15.9693C31.3965 16.4546 31.5 16.9747 31.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M31.5 17.5C31.5 16.9747 31.6035 16.4546 31.8045 15.9693C32.0055 15.484 32.3001 15.043 32.6716 14.6716C33.043 14.3001 33.484 14.0055 33.9693 13.8045C34.4546 13.6035 34.9747 13.5 35.5 13.5C36.0253 13.5 36.5454 13.6035 37.0307 13.8045C37.516 14.0055 37.957 14.3001 38.3284 14.6716C38.6999 15.043 38.9945 15.484 39.1955 15.9693C39.3965 16.4546 39.5 16.9747 39.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M39.5 17.5C39.5 16.9747 39.6035 16.4546 39.8045 15.9693C40.0055 15.484 40.3001 15.043 40.6716 14.6716C41.043 14.3001 41.484 14.0055 41.9693 13.8045C42.4546 13.6035 42.9747 13.5 43.5 13.5C44.0253 13.5 44.5454 13.6035 45.0307 13.8045C45.516 14.0055 45.957 14.3001 46.3284 14.6716C46.6999 15.043 46.9945 15.484 47.1955 15.9693C47.3965 16.4546 47.5 16.9747 47.5 17.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:58,y:29},color:s})]})]}),md=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-VariableArea"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M46 10V25"}),o.jsxRuntimeExports.jsx(O,{d:"M23 13V22"}),o.jsxRuntimeExports.jsx(O,{d:"M23 13L46 10"}),o.jsxRuntimeExports.jsx(O,{d:"M23 22L46 25"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),fd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Coriolis"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M2 17.6024H28.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M28.5 17.6024L34.6834 14.0324",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M34.8 14L45.9058 20.9666",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M51.5 17.6024L46.0141 20.8987",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M20.5 17.6024L26.6574 14.0474",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M26.75 14.1024L37.788 21.0265",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 17.6024L37.8427 21.0017",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M43.5 17.6024H69",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:58,y:29},color:s})]})]}),hd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Nozzle"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M24 2V7V12",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M24 12H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M24 23H29H34",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M24 33V23",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),gd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Venturi"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M8 33L26.5329 22.3",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M8 2L26.5329 12.7",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M56 33L26.5876 22.2948",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M56 2L26.5876 12.7052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:29},color:s})]})]}),jd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-RingPiston"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(Pe,{cx:"36.5",cy:"17.5",r:"10.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Pe,{cx:"36.5",cy:"21.5",r:"6.5",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{position:{x:56,y:29},color:s})]})]}),Ed=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-PositiveDisplacement"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M41 13C41 15.4853 38.9853 17.5 36.5 17.5C34.0147 17.5 32 15.4853 32 13C32 10.5147 34.0147 8.5 36.5 8.5C38.9853 8.5 41 10.5147 41 13Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M41 22C41 24.4853 38.9853 26.5 36.5 26.5C34.0147 26.5 32 24.4853 32 22C32 19.5147 34.0147 17.5 36.5 17.5C38.9853 17.5 41 19.5147 41 22Z",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),yd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Turbine"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M16.5 17.5H54.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M32.5 9L35.4756 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M38.5 26L35.5244 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M32.5 26L35.4756 17.8247",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M38.5 9L35.5244 17.1753",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M32.5 9C32.5 8.20435 32.8161 7.44129 33.3787 6.87868C33.9413 6.31607 34.7044 6 35.5 6C36.2956 6 37.0587 6.31607 37.6213 6.87868C38.1839 7.44129 38.5 8.20435 38.5 9",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M38.5 26C38.5 26.7956 38.1839 27.5587 37.6213 28.1213C37.0587 28.6839 36.2956 29 35.5 29C34.7044 29 33.9413 28.6839 33.3787 28.1213C32.8161 27.5587 32.5 26.7956 32.5 26",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),Sd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-Pulse"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:5.714,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:94.386,id:"3"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M31 13.5H39",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M23 21.5H31",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M39 21.5H47",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M39 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31 13.5V21.5",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),Rd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("flowmeter-FloatSensor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.6667,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.3333,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:71,height:35},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"67",height:"31",rx:"2"}),o.jsxRuntimeExports.jsx(O,{d:"M25 8H46",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31 27H40",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M31 27L25.046 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{d:"M40 27L45.954 8.11641",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(Ze,{color:s})]})]}),Cd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("heat-exchanger-general"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.545,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.454,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.454,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(O,{d:"M3 33H18.3956L33.1284 18.1508M33.4276 47.8492L48.1604 33H63M33.278 48V18"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),bd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:89,top:27.27,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:89,top:72.73,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.545,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.455,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.545,top:50,id:"5"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(O,{d:"M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33L63 33Z"}),o.jsxRuntimeExports.jsx(O,{d:"M58.9698 18H23.56L38.5623 33.0023M38.5623 32.9977L23.56 48H58.9698"})]})]}),wd=({id:e,className:t,orientation:n="right",color:s="black",scale:r=1,...i})=>o.jsxRuntimeExports.jsxs(de,{...i,className:u.CSS(u.CSS.B("heat-exchanger-M"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:9,top:6.25,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:24,top:93.75,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:76,top:6.25,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:91,top:93.75,id:"4"}),o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:1.508,top:50,id:"5"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:98.492,top:50,id:"6"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:199,height:48},color:s,orientation:n,scale:r,children:[o.jsxRuntimeExports.jsx(Se,{x:"3",y:"3",width:"193",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Se,{x:"32.397",y:"3",width:"134.206",height:"42",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(Se,{x:"32.397",y:"13.5",width:"134.206",height:"21",rx:"1",strokeWidth:"2"}),o.jsxRuntimeExports.jsx(fe,{x1:"32.3769",y1:"24",x2:"166.623",y2:"24",strokeWidth:"2"})]})]}),vd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),kd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:3.125,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:96.875,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:64,height:64},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M62 32C62 48.5685 48.5685 62 32 62M62 32C62 15.4315 48.5685 2 32 2C15.4315 2 2 15.4315 2 32C2 48.5685 15.4315 62 32 62M62 32L32 62M32 2.00269L62.0025 32.0052",strokeLinecap:"round"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),_d=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("compressor"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Md=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(Pe,{cx:"33",cy:"33",r:"14.5"})]})]}),Ld=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(O,{d:"M35 12.4V20.4"}),o.jsxRuntimeExports.jsx(O,{d:"M3 33H16"}),o.jsxRuntimeExports.jsx(O,{d:"M35 53.6V45.6"})]})]}),Pd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(O,{d:"M39 33C39 33.7879 38.8448 34.5681 38.5433 35.2961C38.2417 36.0241 37.7998 36.6855 37.2426 37.2426C36.6855 37.7998 36.0241 38.2417 35.2961 38.5433C34.5681 38.8448 33.7879 39 33 39C32.2121 39 31.4319 38.8448 30.7039 38.5433C29.9759 38.2417 29.3145 37.7998 28.7574 37.2426C28.2002 36.6855 27.7583 36.0241 27.4567 35.2961C27.1552 34.5681 27 33.7879 27 33C27 32.2121 27.1552 31.4319 27.4567 30.7039C27.7583 29.9759 28.2002 29.3145 28.7574 28.7574C29.3145 28.2002 29.9759 27.7583 30.7039 27.4567C31.4319 27.1552 32.2121 27 33 27C33.7879 27 34.5681 27.1552 35.2961 27.4567C36.0241 27.7583 36.6855 28.2002 37.2426 28.7574C37.7998 29.3145 38.2417 29.9759 38.5433 30.7039C38.8448 31.4319 39 32.2121 39 33L39 33Z"}),o.jsxRuntimeExports.jsx(O,{d:"M39 33H47"}),o.jsxRuntimeExports.jsx(O,{d:"M27 33H19"}),o.jsxRuntimeExports.jsx(O,{d:"M36 27.804L40 20.8758"}),o.jsxRuntimeExports.jsx(O,{d:"M30 27.804L26 20.8758"}),o.jsxRuntimeExports.jsx(O,{d:"M30 38.196L26 45.1242"}),o.jsxRuntimeExports.jsx(O,{d:"M36 38.196L40 45.1242"})]})]}),Td=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Nd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(he,{...r,className:u.CSS(u.CSS.B("pump"),t),orientation:n,children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:4.55,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:95.45,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:50,top:4.55,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:50,top:95.45,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:66,height:66},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(O,{d:"M17 7.59998L59.5394 18.9984M17 58.3984L59.5394 47M63 33C63 36.9397 62.224 40.8407 60.7164 44.4805C59.2087 48.1203 56.999 51.4274 54.2132 54.2132C51.4274 56.999 48.1203 59.2087 44.4805 60.7164C40.8407 62.224 36.9397 63 33 63C29.0603 63 25.1593 62.224 21.5195 60.7164C17.8797 59.2087 14.5726 56.999 11.7868 54.2132C9.00104 51.4274 6.79125 48.1203 5.28361 44.4805C3.77597 40.8407 3 36.9397 3 33C3 29.0603 3.77597 25.1593 5.28362 21.5195C6.79126 17.8797 9.00104 14.5726 11.7868 11.7868C14.5726 9.00104 17.8797 6.79125 21.5195 5.28361C25.1593 3.77597 29.0603 3 33 3C36.9397 3 40.8407 3.77597 44.4805 5.28362C48.1203 6.79126 51.4274 9.00104 54.2132 11.7868C56.999 14.5726 59.2087 17.8797 60.7164 21.5195C62.224 25.1593 63 29.0603 63 33Z"}),o.jsxRuntimeExports.jsx(O,{d:"M3 33H63"})]})]}),Ad=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:7.575,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:92.425,top:50,id:"2"})]}),o.jsxRuntimeExports.jsx(J,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:o.jsxRuntimeExports.jsx(O,{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"})})]}),Id=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(O,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(O,{d:"M29.12 65.62L61 34.5"})]})]}),$d=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:60,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"56",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M30 2.5L30 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"})]})]}),zd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(O,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5",strokeLinecap:"square"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Bd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("flame-arrestor"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.333,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.667,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:63,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2.5",width:"28",height:"64",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M16 2.5L16 66.5"}),o.jsxRuntimeExports.jsx(O,{d:"M2 34.5H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 19H30"}),o.jsxRuntimeExports.jsx(O,{d:"M2 50H30"}),o.jsxRuntimeExports.jsx(O,{d:"M29.121 3.37903L61 34.5"}),o.jsxRuntimeExports.jsx(O,{d:"M29.12 65.62L61 34.5"}),o.jsxRuntimeExports.jsx(O,{d:"M29 2.5C33.2023 2.5 37.3635 3.3277 41.2459 4.93586C45.1283 6.54401 48.656 8.90111 51.6274 11.8726C54.5989 14.8441 56.956 18.3717 58.5642 22.2541C60.1723 26.1366 61 30.2977 61 34.5C61 38.7023 60.1723 42.8635 58.5642 46.7459C56.956 50.6283 54.5989 54.1559 51.6274 57.1274C48.6559 60.0989 45.1283 62.456 41.2459 64.0641C37.3635 65.6723 33.2023 66.5 29 66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"66.5",x2:"29",y2:"66.5"}),o.jsxRuntimeExports.jsx(fe,{x1:"27",y1:"2.5",x2:"29",y2:"2.5"})]})]}),Dd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("thruster"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:3.125,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:96.875,top:50,id:"2"}),o.jsxRuntimeExports.jsx(v,{location:"top",orientation:n,left:25.3,top:4.76,id:"3"}),o.jsxRuntimeExports.jsx(v,{location:"bottom",orientation:n,left:25.3,top:95.24,id:"4"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:81,height:42},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2.5",y:"2",width:"38",height:"38",rx:"3"}),o.jsxRuntimeExports.jsx(O,{d:"M78.5 37.5117V4.51172"}),o.jsxRuntimeExports.jsx(O,{d:"M40.5 11.5L76.0072 2.6232"}),o.jsxRuntimeExports.jsx(O,{d:"M40.5 30.5L76.0072 39.3768"}),o.jsxRuntimeExports.jsx(O,{d:"M75.6192 2.71597C75.9231 2.56695 76.2597 2.49745 76.5977 2.51399C76.9357 2.53052 77.264 2.63256 77.5518 2.81053C77.8397 2.98851 78.0776 3.23661 78.2435 3.53161C78.4093 3.82661 78.4975 4.15886 78.4999 4.49726"}),o.jsxRuntimeExports.jsx(O,{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"})]})]}),Od=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M2.293 2.29297L29.9383 66.7986",strokeDasharray:"6 6"})]})]}),Vd=({color:e,className:t,orientation:n="left",scale:s,...r})=>o.jsxRuntimeExports.jsxs(de,{...r,className:u.CSS(u.CSS.B("strainer"),t),children:[o.jsxRuntimeExports.jsxs(W,{orientation:n,children:[o.jsxRuntimeExports.jsx(v,{location:"left",orientation:n,left:6.06,top:50,id:"1"}),o.jsxRuntimeExports.jsx(v,{location:"right",orientation:n,left:93.04,top:50,id:"2"})]}),o.jsxRuntimeExports.jsxs(J,{dimensions:{width:33,height:69},color:e,orientation:n,scale:s,children:[o.jsxRuntimeExports.jsx(Se,{x:"2",y:"2",width:"29",height:"65",rx:"1"}),o.jsxRuntimeExports.jsx(O,{d:"M31 34.5L2.30611 2.33992",strokeDasharray:"6 6"}),o.jsxRuntimeExports.jsx(O,{d:"M31 34.5L2.30611 66.6601",strokeDasharray:"6 6"})]})]}),Zy=({aetherKey:e,sink:t})=>{const n=j.useMemoDeepEqualProps({sink:t}),[,,s]=j.use$3({aetherKey:e,type:B.Button.TYPE,schema:B.buttonStateZ,initialState:{trigger:0,sink:t}});return g.useEffect(()=>{s(i=>({...i,...n}))},[n]),{click:g.useCallback(()=>{s(i=>({...i,trigger:i.trigger+1}))},[s])}},Gy=({aetherKey:e,source:t})=>{const n=j.useMemoDeepEqualProps({source:t}),[,{enabled:s},r]=j.use$3({aetherKey:e,type:B.Light.TYPE,schema:B.lightStateZ,initialState:{enabled:!1,...n}});return g.useEffect(()=>r(i=>({...i,...n})),[n,r]),{enabled:s}},Yy="Schematic.Grid",Wy=e=>{const n=Ps(e).closest(".react-flow__pane");n!=null&&j.triggerReflow(n)},As=e=>{const t=({symbolKey:s,items:r,onLocationChange:i})=>{const l=`${s}.${Yy}`,[c,a]=g.useState(!1),d=g.useCallback(({items:y})=>y.every(S=>S.type===l),[l]),x=j.useSyncedRef(i),{startDrag:p,onDragEnd:m,...f}=j.useDragAndDrop({type:l,canDrop:d,onDrop:g.useCallback(({items:y})=>y,[]),onDragOver:g.useCallback(y=>{a(d(y)),y.items.forEach(({key:S})=>x.current(S,e))},[])}),h=r.filter(y=>y.location===e),E=g.useCallback((y,S)=>p([{key:S,type:l}]),[p,l]);return o.jsxRuntimeExports.jsx(te.Space,{direction:u.K.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e),u.CSS.dropRegion(!0),c&&u.CSS.B("dragging-over")),onDragLeave:()=>a(!1),empty:!0,...f,children:h.map(({element:y,key:S})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:g.cloneElement(y,{draggable:!0,onDragStart:k=>E(k,S),onDragEnd:m,style:{...y.props.style,cursor:"grab"}})},S))})};return({symbolKey:s,...r})=>{const{editable:i,items:l}=r,c=g.useRef(i);if(i!==c.current&&e==="top"&&(Wy(s),c.current=i),i)return o.jsxRuntimeExports.jsx(t,{symbolKey:s,...r});const a=l.filter(d=>d.location===e);return a.length===0?null:o.jsxRuntimeExports.jsx(te.Space,{direction:u.K.direction(e),className:u.CSS(u.CSS.BE("grid","item"),u.CSS.loc(e)),empty:!0,children:a.map(({element:d,key:x})=>o.jsxRuntimeExports.jsx(g.Fragment,{children:d},x))})}},Ky=As("top"),Xy=As("left"),qy=As("right"),Uy=As("bottom"),Tt=({editable:e,onRotate:t,children:n,...s})=>o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(Ky,{editable:e,...s}),o.jsxRuntimeExports.jsx(Xy,{editable:e,...s}),o.jsxRuntimeExports.jsx(qy,{editable:e,...s}),o.jsxRuntimeExports.jsx(Uy,{editable:e,...s}),e&&o.jsxRuntimeExports.jsx(j.Icon,{className:u.CSS.BE("grid","rotate"),size:"small",variant:"filled",onClick:t,children:o.jsxRuntimeExports.jsx(j.Lt.Rotate,{})}),n]}),Jy=({aetherKey:e,source:t,sink:n})=>{const s=j.useMemoDeepEqualProps({source:t,sink:n}),[,{value:r},i]=j.use$3({aetherKey:e,type:B.Setpoint.TYPE,schema:B.setpointStateZ,initialState:{trigger:0,value:0,...s}});return g.useEffect(()=>{i(c=>({...c,...s}))},[s,i]),{set:g.useCallback(c=>i(a=>({...a,trigger:a.trigger+1,command:c})),[i]),value:r}},Qy=({aetherKey:e,source:t,sink:n})=>{const s=j.useMemoDeepEqualProps({source:t,sink:n}),[,{triggered:r,enabled:i},l]=j.use$3({aetherKey:e,type:B.Toggle.TYPE,schema:B.toggleStateZ,initialState:{triggered:!1,enabled:!1,...s}});return g.useEffect(()=>{l(a=>({...a,...s}))},[s,l]),{toggle:g.useCallback(()=>l(a=>({...a,triggered:!a.triggered})),[l]),triggered:r,enabled:i}},Kt=(e,t)=>{if(e==null)return null;const{label:n,level:s="p",orientation:r="top",direction:i,align:l,maxInlineSize:c}=e;return n==null||n.length===0?null:{key:"label",element:o.jsxRuntimeExports.jsx(j.Editable,{className:u.CSS(u.CSS.BE("symbol","label"),u.CSS.dir(i)),level:s,value:n,onChange:a=>t==null?void 0:t({label:{...e,label:a}}),allowEmpty:!0,style:{textAlign:l,maxInlineSize:c}}),location:r}},yr=e=>{if(e==null)return null;const{show:t=!0,showChip:n=!0,showIndicator:s=!0,chip:r,indicator:i,orientation:l="bottom"}=e;return{key:"control",element:o.jsxRuntimeExports.jsxs(te.Space,{direction:u.g.swap(l),align:"center",className:u.CSS(u.CSS.B("control-state")),size:"small",children:[t&&n&&o.jsxRuntimeExports.jsx(Jl,{size:"small",...r}),t&&s&&o.jsxRuntimeExports.jsx(tc,{...i})]}),location:l}},Ce=e=>{const t=({symbolKey:n,control:s,source:r,sink:i,label:l,onChange:c,draggable:a,selected:d,orientation:x="left",...p})=>{const{enabled:m,triggered:f,toggle:h}=Qy({aetherKey:n,source:r,sink:i}),E=[],y=Kt(l,c);y!=null&&E.push(y);const S=yr(s);return S!=null&&E.push(S),o.jsxRuntimeExports.jsx(Tt,{editable:d&&!a,symbolKey:n,items:E,onRotate:()=>c({orientation:u.K.rotate90(x)}),onLocationChange:(k,C)=>{k==="label"&&c({label:{...l,orientation:C}}),k==="control"&&c({control:{...s,orientation:C}})},children:o.jsxRuntimeExports.jsx(e,{enabled:m,triggered:f,onClick:h,orientation:x,...p})})};return t.displayName=e.displayName,t},xe=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,draggable:l,position:c,orientation:a="left",...d})=>{const x=[],p=Kt(s,r);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Tt,{items:x,editable:i&&!l,symbolKey:n,onRotate:()=>r({orientation:u.K.rotate90(a)}),onLocationChange:(m,f)=>{m==="label"&&r({label:{...s,orientation:f}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,...d})})};return t.displayName=e.displayName,t},ot=e=>{const t=({symbolKey:n,label:s,onChange:r,selected:i,draggable:l,position:c,orientation:a="left",enabled:d=!1,clickable:x=!1,...p})=>{const m=[],f=Kt(s,r);f!=null&&m.push(f);const h=()=>{x&&r({enabled:!d})};return o.jsxRuntimeExports.jsx(Tt,{items:m,editable:i&&!l,symbolKey:n,onRotate:()=>r({orientation:u.K.rotate90(a)}),onLocationChange:(E,y)=>{E==="label"&&r({label:{...s,orientation:y}})},children:o.jsxRuntimeExports.jsx(e,{orientation:a,enabled:d,onClick:h,...p})})};return t.displayName=e.displayName,t},Fd=Ce(xu),Hd=Ce(pu),Zd=Ce(mu),Gd=Ce(du),Yd=Ce(ju),Wd=Ce(wu),Kd=Ce(vd),Xd=Ce(kd),qd=Ce(Gu),Ud=Ce(Yu),Jd=Ce(Wu),Qd=Ce(Xu),ex=Ce(Ju),tx=Ce(Qu),nx=Ce(ed),sx=Ce(td),ox=Ce(nd),rx=Ce(sd),ix=Ce(Zu),lx=Ce(_d),cx=Ce(Md),ax=Ce(Ld),ux=Ce(Pd),dx=Ce(Td),xx=Ce(Nd),px=Ce(Ru),mx=Ce(Eu),fx=Ce(yu),hx=Ce(Su),gx=xe(Iu),jx=xe(Uu),Ex=xe(vu),yx=xe(_u),Sx=xe(Mu),Rx=xe(Tu),Cx=xe(hu),bx=xe(gu),wx=xe($u),vx=Ce(Ou),kx=xe(rd),_x=xe(Pu),Mx=xe(id),Lx=xe(ku),Px=xe(ud),Tx=xe(dd),Nx=xe(Ku),Ax=xe(xd),Ix=xe(pd),$x=xe(md),zx=xe(fd),Bx=xe(hd),Dx=xe(gd),Ox=xe(jd),Vx=xe(Ed),Fx=xe(yd),Hx=xe(Sd),Zx=xe(Rd),Gx=xe(Cd),Yx=xe(bd),Wx=xe(wd),Kx=xe(Ad),Xx=xe($d),qx=xe(Id),Ux=xe(zd),Jx=xe(Bd),Qx=xe(Dd),ep=xe(Od),tp=xe(Vd),np=ot(zu),sp=ot(fu),op=ot(cd),rp=ot(ad),ip=ot(Lu),lp=ot(Bu),cp=ot(Cu),ap=ot(bu),up=xe(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(Ns,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),dp=e=>o.jsxRuntimeExports.jsx(Ns,{...e,dimensions:{width:25,height:50}}),xp=xe(({backgroundColor:e,borderRadius:t,onChange:n,orientation:s,color:r,dimensions:i})=>o.jsxRuntimeExports.jsx(Ns,{onResize:l=>n({dimensions:l}),orientation:s,color:r,dimensions:i,boxBorderRadius:t,backgroundColor:e})),pp=e=>o.jsxRuntimeExports.jsx(Ns,{...e,dimensions:{width:25,height:50},borderRadius:0}),mp=({label:e,symbolKey:t,orientation:n="left",control:s,units:r,source:i,sink:l,color:c,onChange:a,selected:d,draggable:x,size:p,disabled:m})=>{const{value:f,set:h}=Jy({aetherKey:t,source:i,sink:l}),E=[],y=yr(s);y!=null&&E.push(y);const S=Kt(e,a);return S!=null&&E.push(S),o.jsxRuntimeExports.jsx(Tt,{symbolKey:t,editable:d&&!x,onRotate:()=>a({orientation:u.K.rotate90(n)}),items:E,onLocationChange:(k,C)=>{k==="label"&&a({label:{...e,orientation:C}})},children:o.jsxRuntimeExports.jsx(Hu,{value:f,onChange:h,units:r,color:c,orientation:n,disabled:m,size:p})})},fp=({className:e,...t})=>o.jsxRuntimeExports.jsx(Hu,{value:12,onChange:()=>{},units:"mV",style:{width:120,transform:"scale(0.95)"},className:u.CSS(u.CSS.BM("setpoint","preview"),e),disabled:!0,...t,children:o.jsxRuntimeExports.jsx(j.Text$1,{level:"p",children:"10.0"})}),hp=({symbolKey:e,label:t,level:n="p",position:s,textColor:r,color:i,telem:l,units:c,onChange:a,inlineSize:d=70,selected:x,draggable:p,notation:m})=>{const f=j.useTypography(n),h=(f.lineHeight+.5)*f.baseSize+2,{width:E}=tr({aetherKey:e,color:r,level:n,box:u.Tt.construct(u.G.translateY({...s},1),{height:h,width:d}),telem:l,minWidth:d,notation:m}),y=[],S=Kt(t,a);return S!=null&&y.push(S),o.jsxRuntimeExports.jsx(Tt,{editable:x&&!p,symbolKey:e,items:y,onLocationChange:(k,C)=>{k==="label"&&a({label:{...t,orientation:C}})},children:o.jsxRuntimeExports.jsx(Du,{color:i,dimensions:{height:h,width:E},inlineSize:d,units:c,unitsLevel:Z.downLevel(n)})})},gp=({color:e})=>o.jsxRuntimeExports.jsx(Du,{color:e,dimensions:{width:60,height:25},units:"psi",children:o.jsxRuntimeExports.jsx(j.Text$1,{level:"p",children:"50.00"})}),jp=({symbolKey:e,label:t,orientation:n="left",sink:s,control:r,selected:i,draggable:l,onChange:c,...a})=>{const{click:d}=Zy({aetherKey:e,sink:s}),x=[],p=yr(r);return p!=null&&x.push(p),o.jsxRuntimeExports.jsx(Tt,{onRotate:()=>c({orientation:u.K.rotate90(n)}),editable:i&&!l,symbolKey:e,items:x,onLocationChange:(m,f)=>{m==="label"&&c({label:{...t,orientation:f}})},children:o.jsxRuntimeExports.jsx(Vu,{...t,onClick:d,orientation:n,...a})})},Ep=({label:e,...t})=>o.jsxRuntimeExports.jsx(Vu,{label:"Button",...t}),yp=({symbolKey:e,label:t,source:n,onChange:s,selected:r,draggable:i,...l})=>{const{enabled:c}=Gy({aetherKey:e,source:n}),a=[],d=Kt(t,s);return d!=null&&a.push(d),o.jsxRuntimeExports.jsx(Tt,{items:a,editable:r&&!i,symbolKey:e,onLocationChange:(x,p)=>{x==="label"&&s({label:{...t,orientation:p}})},children:o.jsxRuntimeExports.jsx(qu,{enabled:c,...l})})},Sp=e=>o.jsxRuntimeExports.jsx(Fu,{...e,autoFit:!0,text:"Text Box"}),Rp=({label:{label:e,level:t},orientation:n,color:s,onChange:r})=>o.jsxRuntimeExports.jsx(od,{onLabelChange:i=>r({label:{label:i,level:t}}),label:e,level:t,orientation:n,color:s}),Cp=({label:e,...t})=>o.jsxRuntimeExports.jsx(od,{label:"Off Page",...t,orientation:"right"}),bp=xe(({backgroundColor:e,onChange:t,orientation:n,color:s,dimensions:r,borderRadius:i})=>o.jsxRuntimeExports.jsx(ld,{onResize:l=>t({dimensions:l}),orientation:n,color:s,dimensions:r,borderRadius:i,backgroundColor:e})),wp=e=>o.jsxRuntimeExports.jsx(ld,{...e,dimensions:{width:25,height:50}}),K=4,Sr=2,e4=["agitator","angledReliefValve","angledSpringLoadedReliefValve","angledValve","ballValve","threeWayBallValve","gateValve","butterflyValveOne","butterflyValveTwo","breatherValve","offPageReference","box","burstDisc","isoBurstDisc","button","cap","cavityPump","checkValve","cylinder","crossBeamAgitator","electricRegulator","filter","flatBladeAgitator","flowmeterGeneral","flowmeterElectromagnetic","flowmeterVariableArea","flowmeterCoriolis","flowmeterNozzle","flowmeterVenturi","flowmeterRingPiston","flowmeterPositiveDisplacement","flowmeterTurbine","flowmeterPulse","flowmeterFloatSensor","fourWayValve","helicalAgitator","isoCap","isoCheckValve","isoFilter","light","manualValve","needleValve","orifice","orificePlate","paddleAgitator","propellerAgitator","pistonPump","pump","regulator","reliefValve","rotaryMixer","screwPump","setpoint","solenoidValve","springLoadedReliefValve","staticMixer","switch","tank","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","strainer","strainerCone"],t4=ce.z.enum(e4),ae={orientation:"left",scale:1},n4={...ae,source:B.sourcePipeline("string",{connections:[{from:"valueStream",to:"rollingAverage"},{from:"rollingAverage",to:"stringifier"}],segments:{valueStream:B.streamChannelValue({channel:0}),rollingAverage:B.rollingAverage({windowSize:1}),stringifier:B.stringifyNumber({precision:2,notation:"standard"})},outlet:"stringifier"})},s4={...ae,source:B.sourcePipeline("number",{connections:[],segments:{valueStream:B.streamChannelValue({channel:0})},outlet:"valueStream"})},o4={...ae,sink:B.sinkPipeline("number",{connections:[],segments:{setter:B.setChannelValue({channel:0})},inlet:"setter"})},vp={...ae,source:B.sourcePipeline("boolean",{connections:[{from:"valueStream",to:"threshold"}],segments:{valueStream:B.streamChannelValue({channel:0}),threshold:B.withinBounds({trueBound:{lower:.9,upper:1.1}})},outlet:"threshold"})},kp={...ae,control:{show:!0},sink:B.sinkPipeline("boolean",{connections:[{from:"setpoint",to:"setter"}],segments:{setter:B.setChannelValue({channel:0}),setpoint:B.setpoint({truthy:1,falsy:0})},inlet:"setpoint"})},be={...vp,...kp},gt={...ae,enabled:!1,clickable:!1},Y=e=>({label:{label:e,level:"p",orientation:"top",maxInlineSize:150,align:"center",direction:"x"}}),r4={width:125,height:200},Rr={dimensions:r4},i4=3,l4={name:"Three Way Valve",key:"threeWayValve",Form:Re,Symbol:Fd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Three Way Valve"),...be}),Preview:xu,zIndex:K},c4={name:"Valve",key:"valve",Form:Re,Symbol:Hd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Valve"),...be}),Preview:pu,zIndex:K},a4={name:"Solenoid Valve",key:"solenoidValve",Form:Re,Symbol:Zd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Solenoid Valve"),normallyOpen:!1,...be}),Preview:mu,zIndex:K},u4={name:"Four Way Valve",key:"fourWayValve",Form:Re,Symbol:Gd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Four Way Valve"),...be}),Preview:du,zIndex:K},d4={name:"Angled Valve",key:"angledValve",Form:Re,Symbol:Yd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Angled Valve"),...be}),Preview:ju,zIndex:K},x4={name:"Ball Valve",key:"ballValve",Form:Re,Symbol:mx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ball Valve"),...be}),Preview:Eu,zIndex:K},p4={name:"Three-Way Ball Valve",key:"threeWayBallValve",Form:Re,Symbol:fx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Three-Way Ball Valve"),...be}),Preview:yu,zIndex:K},m4={name:"Gate Valve",key:"gateValve",Form:Re,Symbol:hx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Gate Valve"),...be}),Preview:Su,zIndex:K},f4={name:"Butterfly Valve (Remote)",key:"butterflyValveOne",Form:Re,Symbol:px,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Butterfly Valve (Remote)"),...be}),Preview:Ru,zIndex:K},h4={name:"Butterfly Valve (Manual)",key:"butterflyValveTwo",Form:ht,Symbol:cp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Butterfly Valve (Manual)"),...gt}),Preview:mt(Cu,["clickable"]),zIndex:K},g4={name:"Breather Valve",key:"breatherValve",Form:ht,Symbol:ap,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Breather Valve"),...gt}),Preview:mt(bu,["clickable"]),zIndex:K},j4={name:"Pump",key:"pump",Form:Re,Symbol:Wd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Pump"),...be}),Preview:wu,zIndex:K},E4={name:"Screw Pump",key:"screwPump",Form:Re,Symbol:ix,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Screw Pump"),...be}),Preview:Zu,zIndex:K},y4={name:"Tank",key:"tank",Form:au,Symbol:up,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Y("Tank"),borderRadius:Er,...Rr,...ae}),Preview:dp,zIndex:Sr},S4={name:"Cylinder",key:"cylinder",Form:Iy,Symbol:bp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Y("cylinder"),dimensions:{width:66,height:181},...ae}),Preview:wp,zIndex:Sr},R4={name:"Box",key:"box",Form:$y,Symbol:xp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,backgroundColor:e.colors.gray.l1.setAlpha(0).rgba255,...Y("Box"),borderRadius:i4,...Rr,...ae}),Preview:pp,zIndex:Sr},C4={name:"Relief Valve",key:"reliefValve",Form:ht,Symbol:sp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Relief Valve"),...gt}),Preview:mt(fu,["clickable"]),zIndex:K},b4={name:"Spring Loaded Relief Valve",key:"springLoadedReliefValve",Form:ht,Symbol:op,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Spring Loaded Relief Valve"),...gt}),Preview:mt(cd,["clickable"]),zIndex:K},w4={name:"Angled Spring Loaded Relief Valve",key:"angledSpringLoadedReliefValve",Form:ht,Symbol:rp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Angled Spring Loaded Relief Valve"),...gt}),Preview:mt(ad,["clickable"]),zIndex:K},v4={name:"Regulator",key:"regulator",Form:me,Symbol:gx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Regulator"),...ae}),Preview:Iu,zIndex:K},k4={name:"Electric Regulator",key:"electricRegulator",Form:me,Symbol:jx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Electric Regulator"),...ae}),Preview:Uu,zIndex:K},_4={name:"Burst Disc",key:"burstDisc",Form:me,Symbol:Ex,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Burst Disc"),...ae}),Preview:vu,zIndex:K},M4={name:"ISO Burst Disc",key:"isoBurstDisc",Form:me,Symbol:Lx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Burst Disc"),...ae}),Preview:ku,zIndex:K},L4={name:"Cap",key:"cap",Form:me,Symbol:yx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Cap"),...ae}),Preview:_u,zIndex:K},P4={name:"ISO Cap",key:"isoCap",Form:me,Symbol:Sx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Cap"),...ae}),Preview:Mu,zIndex:K},T4={name:"Manual Valve",key:"manualValve",Form:ht,Symbol:ip,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Manual Valve"),...gt}),Preview:mt(Lu,["clickable"]),zIndex:K},N4={name:"Orifice Plate",key:"orificePlate",Form:me,Symbol:_x,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Orifice Plate"),...ae}),Preview:Pu,zIndex:K},A4={name:"ISO Filter",key:"isoFilter",Form:me,Symbol:Mx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Filter"),...ae}),Preview:id,zIndex:K},I4={name:"Filter",key:"filter",Form:me,Symbol:Rx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Filter"),...ae}),Preview:Tu,zIndex:K},$4={name:"Needle Valve",key:"needleValve",Form:ht,Symbol:np,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Needle Valve"),...gt}),Preview:mt(zu,["clickable"]),zIndex:K},z4={name:"Check Valve",key:"checkValve",Form:me,Symbol:Cx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Check Valve"),...ae}),Preview:hu,zIndex:K},B4={name:"Orifice",key:"orifice",Form:me,Symbol:wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Orifice"),...ae}),Preview:$u,zIndex:K},D4={name:"Angled Relief Valve",key:"angledReliefValve",Form:ht,Symbol:lp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Angled Relief Valve"),...gt}),Preview:mt(Bu,["clickable"]),zIndex:K},O4={name:"Value",key:"value",Form:vy,Symbol:hp,Preview:gp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,units:"psi",level:"h5",inlineSize:70,...Y("Value"),...ae,telem:n4.source}),zIndex:K},V4={name:"Button",key:"button",Symbol:jp,Form:Ly,Preview:Ep,defaultProps:e=>({color:e.colors.primary.z.rgba255,...Y("Button"),...kp,onClickDelay:0,scale:null}),zIndex:K},F4={name:"Switch",key:"switch",Symbol:vx,Form:zy,defaultProps:()=>({...Y("Switch"),...be,scale:null}),Preview:Ou,zIndex:K},H4={name:"Vacuum Pump",key:"vacuumPump",Symbol:qd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Vacuum Pump"),...be}),Preview:Gu,zIndex:K},Z4={name:"Compressor",key:"compressor",Symbol:lx,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Compressor"),...be}),Preview:_d,zIndex:K},G4={name:"Cavity Pump",key:"cavityPump",Symbol:Ud,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Cavity Pump"),...be}),Preview:Yu,zIndex:K},Y4={name:"Piston Pump",key:"pistonPump",Symbol:Jd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Piston Pump"),...be}),Preview:Wu,zIndex:K},W4={name:"Static Mixer",key:"staticMixer",Symbol:Nx,Form:me,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Static Mixer"),...ae}),Preview:Ku,zIndex:K},K4={name:"Rotary Mixer",key:"rotaryMixer",Symbol:Qd,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Rotary Mixer"),...be}),Preview:Xu,zIndex:K},X4={name:"Light",key:"light",Symbol:yp,Form:_y,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Light"),...vp}),Preview:qu,zIndex:K},q4={name:"Setpoint",key:"setpoint",Symbol:mp,Form:Ty,defaultProps:e=>({units:"mV",color:e.colors.gray.l9.rgba255,size:"small",...Y("Setpoint"),...s4,...o4}),Preview:fp,zIndex:K},U4={name:"Agitator",key:"agitator",Symbol:ex,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Agitator"),...be}),Preview:Ju,zIndex:K},J4={name:"Propeller Agitator",key:"propellerAgitator",Symbol:tx,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Propeller Agitator"),...be}),Preview:Qu,zIndex:K},Q4={name:"Flat Blade Agitator",key:"flatBladeAgitator",Symbol:nx,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flat Blade Agitator"),...be}),Preview:ed,zIndex:K},eS={name:"Paddle Agitator",key:"paddleAgitator",Symbol:sx,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Paddle Agitator"),...be}),Preview:td,zIndex:K},tS={name:"Cross Beam Agitator",key:"crossBeamAgitator",Symbol:ox,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Cross Beam Agitator"),...be}),Preview:nd,zIndex:K},nS={name:"Helical Agitator",key:"helicalAgitator",Symbol:rx,Form:Re,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Helical Agitator"),...be}),Preview:sd,zIndex:K},sS={name:"Text Box",key:"textBox",Symbol:Fu,Form:Ny,defaultProps:e=>({color:e.colors.gray.l9.rgba255,autoFit:!0,align:"center",...Y("Text Box"),...ae,...Rr,level:"p",text:"Text Box",width:75}),Preview:Sp,zIndex:K},oS={name:"Off Page Reference",key:"offPageReference",Form:Ay,Symbol:Rp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,orientation:"right",...Y("Off Page Reference")}),Preview:Cp,zIndex:K},rS={name:"ISO Check Valve",key:"isoCheckValve",Form:me,Symbol:bx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("ISO Check Valve"),...ae}),Preview:gu,zIndex:K},iS={name:"Vent",key:"vent",Form:me,Symbol:kx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Vent"),...ae}),Preview:rd,zIndex:K},lS={name:"T Junction",key:"tJunction",Form:me,Symbol:Px,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y(""),...ae}),Preview:ud,zIndex:K+20},cS={name:"Cross Junction",key:"crossJunction",Form:me,Symbol:Tx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y(""),...ae}),Preview:dd,zIndex:K+20},aS={name:"Flowmeter General",key:"flowmeterGeneral",Form:me,Symbol:Ax,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("General Flowmeter"),...ae}),Preview:xd,zIndex:K},uS={name:"Flowmeter Electromagnetic",key:"flowmeterElectromagnetic",Form:me,Symbol:Ix,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Electromagnetic Flowmeter"),...ae}),Preview:pd,zIndex:K},dS={name:"Flowmeter Variable Area",key:"flowmeterVariableArea",Form:me,Symbol:$x,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Variable Area Flowmeter"),...ae}),Preview:md,zIndex:K},xS={name:"Flowmeter Coriolis",key:"flowmeterCoriolis",Form:me,Symbol:zx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Coriolis Flowmeter"),...ae}),Preview:fd,zIndex:K},pS={name:"Flowmeter Nozzle",key:"flowmeterNozzle",Form:me,Symbol:Bx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Nozzle Flowmeter"),...ae}),Preview:hd,zIndex:K},mS={name:"Flowmeter Venturi",key:"flowmeterVenturi",Form:me,Symbol:Dx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Venturi Flowmeter"),...ae}),Preview:gd,zIndex:K},fS={name:"Flowmeter Ring Piston",key:"flowmeterRingPiston",Form:me,Symbol:Ox,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ring Piston Flowmeter"),...ae}),Preview:jd,zIndex:K},hS={name:"Flowmeter Positive Displacement",key:"flowmeterPositiveDisplacement",Form:me,Symbol:Vx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Positive Displacement Flowmeter"),...ae}),Preview:Ed,zIndex:K},gS={name:"Flowmeter Turbine",key:"flowmeterTurbine",Form:me,Symbol:Fx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Turbine Flowmeter"),...ae}),Preview:yd,zIndex:K},jS={name:"Flowmeter Pulse",key:"flowmeterPulse",Form:me,Symbol:Hx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Pulse Flowmeter"),...ae}),Preview:Sd,zIndex:K},ES={name:"Flowmeter Float Sensor",key:"flowmeterFloatSensor",Form:me,Symbol:Zx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Float Sensor Flowmeter"),...ae}),Preview:Rd,zIndex:K},yS={name:"Heat Exchanger General",key:"heatExchangerGeneral",Form:me,Symbol:Gx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("General Heat Exchanger"),...ae}),Preview:Cd,zIndex:K},SS={name:"Heat Exchanger M",key:"heatExchangerM",Form:me,Symbol:Yx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("M Heat Exchanger"),...ae}),Preview:bd,zIndex:K},RS={name:"Heat Exchanger Straight Tube",key:"heatExchangerStraightTube",Form:me,Symbol:Wx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Straight Tube Heat Exchanger"),...ae}),Preview:wd,zIndex:K},CS={name:"Turbo Compressor",key:"turboCompressor",Form:Re,Symbol:cx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Turbo Compressor"),...be}),Preview:Md,zIndex:K},bS={name:"Roller Vane Compressor",key:"rollerVaneCompressor",Form:Re,Symbol:ax,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Roller Vane Compressor"),...be}),Preview:Ld,zIndex:K},wS={name:"Liquid Ring Compressor",key:"liquidRingCompressor",Form:Re,Symbol:ux,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Liquid Ring Compressor"),...be}),Preview:Pd,zIndex:K},vS={name:"Ejector Compressor",key:"ejectorCompressor",Form:Re,Symbol:dx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ejector Compressor"),...be}),Preview:Td,zIndex:K},kS={name:"Centrifugal Compressor",key:"centrifugalCompressor",Form:Re,Symbol:xx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Centrifugal Compressor"),...be}),Preview:Nd,zIndex:K},_S={name:"Diaphragm Pump",key:"diaphragmPump",Form:Re,Symbol:Kd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Diaphragm Pump"),...be}),Preview:vd,zIndex:K},MS={name:"Ejection Pump",key:"ejectionPump",Form:Re,Symbol:Xd,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Ejection Pump"),...be}),Preview:kd,zIndex:K},LS={name:"Flame Arrestor",key:"flameArrestor",Form:me,Symbol:Kx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor"),...ae}),Preview:Ad,zIndex:K},PS={name:"Flame Arrestor (Explosion-Proof)",key:"flameArrestorExplosion",Form:me,Symbol:Xx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Explosion-Proof)"),...ae}),Preview:$d,zIndex:K},TS={name:"Flame Arrestor (Detonation-Proof)",key:"flameArrestorDetonation",Form:me,Symbol:qx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Detonation-Proof)"),...ae}),Preview:Id,zIndex:K},NS={name:"Flame Arrestor (Fire Resistant)",key:"flameArrestorFireRes",Form:me,Symbol:Ux,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Fire Resistant)"),...ae}),Preview:zd,zIndex:K},AS={name:"Flame Arrestor (Fire Resistant and Detonation-Proof)",key:"flameArrestorFireResDetonation",Form:me,Symbol:Jx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Flame Arrestor (Fire Resistant and Detonation-Proof)"),...ae}),Preview:Bd,zIndex:K},IS={name:"Thruster",key:"thruster",Form:Re,Symbol:Qx,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Thruster"),...be}),Preview:Dd,zIndex:K},$S={name:"Strainer",key:"strainer",Form:me,Symbol:ep,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Strainer"),...ae}),Preview:Od,zIndex:K},zS={name:"Strainer Cone",key:"strainerCone",Form:me,Symbol:tp,defaultProps:e=>({color:e.colors.gray.l9.rgba255,...Y("Strainer Cone"),...ae}),Preview:Vd,zIndex:K},BS={value:O4,button:V4,tank:y4,tJunction:lS,crossJunction:cS,switch:F4,offPageReference:oS,light:X4,setpoint:q4,box:R4,textBox:sS,valve:c4,solenoidValve:a4,threeWayValve:l4,fourWayValve:u4,angledValve:d4,ballValve:x4,threeWayBallValve:p4,gateValve:m4,butterflyValveOne:f4,butterflyValveTwo:h4,breatherValve:g4,manualValve:T4,needleValve:$4,reliefValve:C4,angledReliefValve:D4,checkValve:z4,regulator:v4,electricRegulator:k4,springLoadedReliefValve:b4,angledSpringLoadedReliefValve:w4,pump:j4,pistonPump:Y4,screwPump:E4,cavityPump:G4,diaphragmPump:_S,ejectionPump:MS,vacuumPump:H4,compressor:Z4,turboCompressor:CS,rollerVaneCompressor:bS,liquidRingCompressor:wS,ejectorCompressor:vS,centrifugalCompressor:kS,staticMixer:W4,rotaryMixer:K4,burstDisc:_4,isoBurstDisc:M4,cap:L4,isoCap:P4,filter:I4,isoFilter:A4,orifice:B4,orificePlate:N4,agitator:U4,propellerAgitator:J4,flatBladeAgitator:Q4,paddleAgitator:eS,crossBeamAgitator:tS,helicalAgitator:nS,isoCheckValve:rS,vent:iS,cylinder:S4,flowmeterGeneral:aS,flowmeterElectromagnetic:uS,flowmeterVariableArea:dS,flowmeterCoriolis:xS,flowmeterNozzle:pS,flowmeterVenturi:mS,flowmeterRingPiston:fS,flowmeterPositiveDisplacement:hS,flowmeterTurbine:gS,flowmeterPulse:jS,flowmeterFloatSensor:ES,heatExchangerGeneral:yS,heatExchangerM:SS,heatExchangerStraightTube:RS,flameArrestor:LS,flameArrestorExplosion:PS,flameArrestorDetonation:TS,flameArrestorFireRes:NS,flameArrestorFireResDetonation:AS,thruster:IS,strainer:$S,strainerCone:zS},DS=Object.freeze(Object.defineProperty({__proto__:null,Agitator:ex,AngledReliefValve:lp,AngledSpringLoadedReliefValve:rp,AngledValve:Yd,BallValve:mx,Box:xp,BoxPreview:pp,BreatherValve:ap,BurstDisc:Ex,ButterflyValveOne:px,ButterflyValveTwo:cp,Button:jp,ButtonPreview:Ep,Cap:yx,CavityPump:Ud,CentrifugalCompressor:xx,CheckValve:Cx,Compressor:lx,CrossBeamAgitator:ox,CrossJunction:Tx,Cylinder:bp,CylinderPreview:wp,DiaphragmPump:Kd,EjectionPump:Xd,EjectorCompressor:dx,ElectricRegulator:jx,Filter:Rx,FlameArrestor:Kx,FlameArrestorDetonation:qx,FlameArrestorExplosion:Xx,FlameArrestorFireRes:Ux,FlameArrestorFireResDetonation:Jx,FlatBladeAgitator:nx,FlowmeterCoriolis:zx,FlowmeterElectromagnetic:Ix,FlowmeterFloatSensor:Zx,FlowmeterGeneral:Ax,FlowmeterNozzle:Bx,FlowmeterPositiveDisplacement:Vx,FlowmeterPulse:Hx,FlowmeterRingPiston:Ox,FlowmeterTurbine:Fx,FlowmeterVariableArea:$x,FlowmeterVenturi:Dx,FourWayValve:Gd,GateValve:hx,HeatExchangerGeneral:Gx,HeatExchangerM:Yx,HeatExchangerStraightTube:Wx,HelicalAgitator:rx,ISOBurstDisc:Lx,ISOCap:Sx,ISOCheckValve:bx,ISOFilter:Mx,Light:yp,LiquidRingCompressor:ux,ManualValve:ip,NeedleValve:np,OffPageReference:Rp,OffPageReferencePreview:Cp,Orifice:wx,OrificePlate:_x,PaddleAgitator:sx,PistonPump:Jd,PropellerAgitator:tx,Pump:Wd,Regulator:gx,ReliefValve:sp,RollerVaneCompressor:ax,RotaryMixer:Qd,SYMBOLS:BS,ScrewPump:ix,Setpoint:mp,SetpointPreview:fp,SolenoidValve:Zd,SpringLoadedReliefValve:op,StaticMixer:Nx,Strainer:ep,StrainerCone:tp,Switch:vx,TJunction:Px,Tank:up,TankPreview:dp,TextBoxPreview:Sp,ThreeWayBallValve:fx,ThreeWayValve:Fd,Thruster:Qx,TurboCompressor:cx,VacuumPump:qd,Value:hp,ValuePreview:gp,Valve:Hd,Vent:kx,createDummyToggle:ot,createLabeled:xe,createToggle:Ce,variantZ:t4},Symbol.toStringTag,{value:"Module"}));exports.Aether=j.main;exports.Dialog=j.use$4;exports.Divider=j.Divider$1;exports.Dropdown=j.Dropdown;exports.Haul=j.Haul;exports.Worker=j.Context$1;exports.compareArrayDeps=j.compareArrayDeps;exports.componentRenderProp=j.componentRenderProp;exports.isRenderProp=j.isRenderProp;exports.useAsyncEffect=j.useAsyncEffect;exports.useClickOutside=j.useClickOutside;exports.useCombinedRefs=j.useCombinedRefs;exports.useCombinedStateAndRef=j.useCombinedStateAndRef;exports.useDebouncedCallback=j.useDebouncedCallback;exports.useEffectCompare=j.useEffectCompare;exports.useMemoCompare=j.useMemoCompare;exports.useMemoDeepEqualProps=j.useMemoDeepEqualProps;exports.useMemoPrimitiveArray=j.useMemoPrimitiveArray;exports.usePrevious=j.usePrevious;exports.useResize=j.useResize;exports.useStateRef=j.useStateRef;exports.useSyncedRef=j.useSyncedRef;exports.useTransforms=j.useTransforms;exports.CSS=u.CSS;exports.newBEM=u.newBEM;exports.Header=zn.external;exports.DataType=Z.g;exports.Density=Z.b;exports.MultiSeries=Z.Dt;exports.Rate=Z.$;exports.Series=Z.Z;exports.TimeRange=Z.E;exports.TimeSpan=Z.w;exports.TimeStamp=Z.m;exports.state=Z.state;exports.Generic=te.Generic;exports.Align=Lm.external;exports.Icon=ke.Icon;exports.Tabs=ke.external;exports.Text=ve.external;exports.Button=Pm.external;exports.Caret=_o.Animated$1;exports.telem=B.external;exports.Triggers=Wi.external;exports.List=Gt.external;exports.createFilterTransform=Gt.createFilterTransform;exports.fuseFilter=Gt.fuseFilter;exports.proxyMemo=Gt.proxyMemo;exports.Color=Tm.external;exports.createHexOpacityVariants=Ki.createHexOpacityVariants;exports.unitProperty=Ki.unitProperty;exports.Input=Te.external;exports.Menu=Nm.external;exports.Theming=Am.external;exports.Tree=Im.external;exports.Video=$m.Video;exports.Accordion=cf;exports.Breadcrumb=xf;exports.Canvas=Lf;exports.Channel=_h;exports.Control=Tg;exports.Device=Gh;exports.Diagram=Sy;exports.Eraser=Ym;exports.Form=Fh;exports.Label=Uh;exports.Legend=If;exports.Line=zf;exports.LinePlot=ph;exports.Log=Cy;exports.Measure=gh;exports.Modal=Qh;exports.Mosaic=hg;exports.Nav=Xm;exports.Note=jg;exports.OS=Cg;exports.Observe=Oh;exports.Override=wg;exports.Pluto=$g;exports.Portal=cg;exports.Progress=Bg;exports.Range=fh;exports.Ranger=Gg;exports.Resize=Zm;exports.Rule=jh;exports.Schematic=DS;exports.Select=eh;exports.Status=Jm;exports.Steps=Wg;exports.Synnax=ff;exports.Table=Jg;exports.TableCells=h1;exports.Tag=Uf;exports.Telem=_g;exports.Tooltip=Qm;exports.Value=n1;exports.Viewport=dh;exports.axis=wf;exports.control=vf;exports.useDelayedState=zm;