@lunora/studio 1.0.0-alpha.164 → 1.0.0-alpha.166

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 (97) hide show
  1. package/dist/standalone/{chunk-25NFR6EB.js → chunk-225VJ77I.js} +1 -1
  2. package/dist/standalone/{chunk-IABM4BFJ.js → chunk-2DX5MROH.js} +1 -1
  3. package/dist/standalone/chunk-2URQKGWU.js +1 -0
  4. package/dist/standalone/chunk-3FBLWUXD.js +1 -0
  5. package/dist/standalone/{chunk-LEE5CUZT.js → chunk-3LGVSZ4D.js} +1 -1
  6. package/dist/standalone/{chunk-WQNXLF5G.js → chunk-3UOVQ3YN.js} +1 -1
  7. package/dist/standalone/{chunk-EN47FSLD.js → chunk-4G7WDTSC.js} +1 -1
  8. package/dist/standalone/{chunk-7YLJ5KLR.js → chunk-4OGX6UIE.js} +1 -1
  9. package/dist/standalone/chunk-52Y5BCFW.js +8 -0
  10. package/dist/standalone/{chunk-EBWXFG4H.js → chunk-55754F6H.js} +1 -1
  11. package/dist/standalone/{chunk-RINMBBKH.js → chunk-5JHPL7FH.js} +1 -1
  12. package/dist/standalone/chunk-6D6Z2KXU.js +1 -0
  13. package/dist/standalone/{chunk-V4JC6W6G.js → chunk-7PEQ4RPL.js} +1 -1
  14. package/dist/standalone/{chunk-5GFSKIB2.js → chunk-AAVLPU5Q.js} +1 -1
  15. package/dist/standalone/chunk-AWHXPIXU.js +1 -0
  16. package/dist/standalone/{chunk-2XLW4JQW.js → chunk-B62IS74K.js} +1 -1
  17. package/dist/standalone/chunk-CMA4PTV7.js +1 -0
  18. package/dist/standalone/{chunk-2SGL4FWA.js → chunk-CO7D5QQA.js} +1 -1
  19. package/dist/standalone/{chunk-SPNZDIJ6.js → chunk-CQ4VSTAW.js} +1 -1
  20. package/dist/standalone/{chunk-VFUIZXI2.js → chunk-CQO3Z2AB.js} +1 -1
  21. package/dist/standalone/{chunk-V3KCWCAW.js → chunk-E67LBUZU.js} +1 -1
  22. package/dist/standalone/{chunk-ZLPC3XZF.js → chunk-E7TOMONS.js} +1 -1
  23. package/dist/standalone/{chunk-6D5ZAOXC.js → chunk-EFMYOSXQ.js} +1 -1
  24. package/dist/standalone/{chunk-LWM2KLIY.js → chunk-ERLNG3BC.js} +1 -1
  25. package/dist/standalone/chunk-EVTM6Q43.js +1 -0
  26. package/dist/standalone/{chunk-J35RH2FI.js → chunk-F4W5DVWA.js} +1 -1
  27. package/dist/standalone/{chunk-NCCAMFB6.js → chunk-FEWMAPNI.js} +1 -1
  28. package/dist/standalone/chunk-G37I6O7H.js +1 -0
  29. package/dist/standalone/{chunk-2ES4GR4C.js → chunk-GGPSI4ZR.js} +1 -1
  30. package/dist/standalone/chunk-GMS77BZD.js +1 -0
  31. package/dist/standalone/{chunk-2CNAVNV2.js → chunk-HKPAFIMB.js} +1 -1
  32. package/dist/standalone/{chunk-3Q2D36DA.js → chunk-I3PD3ZML.js} +1 -1
  33. package/dist/standalone/{chunk-EEZPJKMT.js → chunk-IBOPW37U.js} +1 -1
  34. package/dist/standalone/chunk-IHMGCHAA.js +1 -0
  35. package/dist/standalone/{chunk-SY4TXJZL.js → chunk-IMLGMLYE.js} +1 -1
  36. package/dist/standalone/{chunk-TGHH7ZFA.js → chunk-IS6LVJ6L.js} +1 -1
  37. package/dist/standalone/{chunk-V26KN3MP.js → chunk-IUHGODQV.js} +1 -1
  38. package/dist/standalone/{chunk-BL6QMVLF.js → chunk-JWJFB4ZB.js} +1 -1
  39. package/dist/standalone/{chunk-UC4Q7VXT.js → chunk-JXJZMINI.js} +1 -1
  40. package/dist/standalone/{chunk-2LIPLDNH.js → chunk-KF2YSK5Z.js} +1 -1
  41. package/dist/standalone/{chunk-MAZTCEWI.js → chunk-KMLTYAJF.js} +1 -1
  42. package/dist/standalone/{chunk-GFTXGON3.js → chunk-KPISDHKV.js} +1 -1
  43. package/dist/standalone/{chunk-U6PQT7NE.js → chunk-KRXDSPZ4.js} +1 -1
  44. package/dist/standalone/{chunk-QP3FHCVL.js → chunk-KSRQTLE3.js} +1 -1
  45. package/dist/standalone/{chunk-AMCDRK5X.js → chunk-KY7U3EOR.js} +1 -1
  46. package/dist/standalone/{chunk-7T2VCEMC.js → chunk-L6W4QXGJ.js} +1 -1
  47. package/dist/standalone/{chunk-EHSU2WDS.js → chunk-LBMSRD6N.js} +1 -1
  48. package/dist/standalone/{chunk-OYLP7ON7.js → chunk-MKRHFCPJ.js} +1 -1
  49. package/dist/standalone/{chunk-WQYWA7U6.js → chunk-MU3P2FI7.js} +1 -1
  50. package/dist/standalone/{chunk-NPERN4YF.js → chunk-MXLAOCAN.js} +1 -1
  51. package/dist/standalone/{chunk-D4P5T22H.js → chunk-N3MMJZQW.js} +1 -1
  52. package/dist/standalone/{chunk-MJJFRQE5.js → chunk-NXZGWCUN.js} +1 -1
  53. package/dist/standalone/{chunk-46Y3PCC5.js → chunk-NZDNC4KZ.js} +1 -1
  54. package/dist/standalone/{chunk-TX6LX7P4.js → chunk-O7D7DJVB.js} +1 -1
  55. package/dist/standalone/{chunk-URS4NC3B.js → chunk-OBSMXNVJ.js} +1 -1
  56. package/dist/standalone/{chunk-3HQRIHXM.js → chunk-OS6CZ56E.js} +1 -1
  57. package/dist/standalone/{chunk-SU737V7V.js → chunk-PD6WIDY6.js} +1 -1
  58. package/dist/standalone/chunk-PLHA3OWK.js +3 -0
  59. package/dist/standalone/{chunk-INWAISDG.js → chunk-QY4V5UOY.js} +1 -1
  60. package/dist/standalone/chunk-RFNGDE33.js +1 -0
  61. package/dist/standalone/{chunk-QAARTUOI.js → chunk-RH2G72SL.js} +1 -1
  62. package/dist/standalone/{chunk-2IIK5TFU.js → chunk-RQPSYNGU.js} +1 -1
  63. package/dist/standalone/{chunk-DBDMRCYH.js → chunk-SPERI4DG.js} +1 -1
  64. package/dist/standalone/chunk-SZUW2MXD.js +1 -0
  65. package/dist/standalone/{chunk-U6SAHQH5.js → chunk-T6X7NXEE.js} +1 -1
  66. package/dist/standalone/{chunk-ZTEUO2JE.js → chunk-TPVTZE6M.js} +1 -1
  67. package/dist/standalone/chunk-V3CZW3JB.js +1 -0
  68. package/dist/standalone/chunk-V3VJAA4D.js +1 -0
  69. package/dist/standalone/{chunk-66E6VAZO.js → chunk-V5PJJYCF.js} +1 -1
  70. package/dist/standalone/{chunk-KTCQA7J7.js → chunk-WDYULSDM.js} +2 -2
  71. package/dist/standalone/{chunk-TMRPWGMC.js → chunk-WRNNZJ34.js} +1 -1
  72. package/dist/standalone/{chunk-YMNWFAZD.js → chunk-WWHDFIP5.js} +1 -1
  73. package/dist/standalone/{chunk-IYFO726L.js → chunk-X5AXABWH.js} +1 -1
  74. package/dist/standalone/{chunk-DSWX2XAB.js → chunk-XAGNBUL3.js} +1 -1
  75. package/dist/standalone/{chunk-5BUNUDXO.js → chunk-XTC4KFYF.js} +1 -1
  76. package/dist/standalone/chunk-YPRQLCKF.js +1 -0
  77. package/dist/standalone/{chunk-VDLESMT6.js → chunk-YYR4P344.js} +1 -1
  78. package/dist/standalone/studio.js +1 -1
  79. package/package.json +12 -12
  80. package/dist/standalone/chunk-46ZJ3TM4.js +0 -2
  81. package/dist/standalone/chunk-7RIRJD2P.js +0 -1
  82. package/dist/standalone/chunk-C3TOZ4LG.js +0 -1
  83. package/dist/standalone/chunk-EEA5SMPT.js +0 -1
  84. package/dist/standalone/chunk-FO26ZU7E.js +0 -1
  85. package/dist/standalone/chunk-JVUZEYKQ.js +0 -1
  86. package/dist/standalone/chunk-MNAASONZ.js +0 -1
  87. package/dist/standalone/chunk-PYT4RZJH.js +0 -1
  88. package/dist/standalone/chunk-SB35BJ7A.js +0 -1
  89. package/dist/standalone/chunk-TJRQUJFS.js +0 -1
  90. package/dist/standalone/chunk-TWTNWOJU.js +0 -1
  91. package/dist/standalone/chunk-TYYQFPAP.js +0 -8
  92. package/dist/standalone/chunk-U5JDESCI.js +0 -1
  93. package/dist/standalone/chunk-UDCVU3Z5.js +0 -1
  94. package/dist/standalone/chunk-VILR66AG.js +0 -1
  95. package/dist/standalone/chunk-VVOVVU53.js +0 -1
  96. /package/dist/standalone/{chunk-D27D4UUI.js → chunk-3Q2P62UR.js} +0 -0
  97. /package/dist/standalone/{chunk-I52I2DJG.js → chunk-4JLGLPWV.js} +0 -0
@@ -0,0 +1,8 @@
1
+ import{a as et,b as Ni}from"./chunk-CSUROWL2.js";import{a as Mi,b as Ii,c as Pi,f as xn}from"./chunk-RFNGDE33.js";import{e as bi,k as Si}from"./chunk-V3VJAA4D.js";import{a as ho,b as po,c as vi,d as Ei,e as yn,g as Ci,h as _i,i as pt}from"./chunk-5JDWLCSH.js";import{W as wi}from"./chunk-PLHA3OWK.js";import{b as Fl}from"./chunk-Y6CXU7T4.js";import{a as Bl}from"./chunk-4L4WTGN5.js";import{a as fo}from"./chunk-55754F6H.js";import{b as Ht}from"./chunk-FEWMAPNI.js";import{d as yi}from"./chunk-KSYIH3NO.js";import{d as Lt,o as mn}from"./chunk-FODLDLE2.js";import{a as o,d as Le,e as uo,f as Vl,g as xi,i as je}from"./chunk-YKXDMIHQ.js";var ht=Le(Vl(),1);var T=Le(xi()),P=Le(uo());function ae(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ae(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}o(ae,"cc");var Wl={value:o(()=>{},"value")};function Ai(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new wn(n)}o(Ai,"dispatch");function wn(e){this._=e}o(wn,"Dispatch");function Yl(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}o(Yl,"parseTypenames");wn.prototype=Ai.prototype={constructor:wn,on:o(function(e,t){var n=this._,r=Yl(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=Xl(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=ki(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ki(n[i],e.name,null);return this},"on"),copy:o(function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new wn(e)},"copy"),call:o(function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},"call"),apply:o(function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)},"apply")};function Xl(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}o(Xl,"get");function ki(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Wl,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}o(ki,"set");var tt=Ai;var bn="http://www.w3.org/1999/xhtml",go={svg:"http://www.w3.org/2000/svg",xhtml:bn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Me(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),go.hasOwnProperty(t)?{space:go[t],local:e}:e}o(Me,"default");function Zl(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===bn&&t.documentElement.namespaceURI===bn?t.createElement(e):t.createElementNS(n,e)}}o(Zl,"creatorInherit");function Ul(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}o(Ul,"creatorFixed");function Bt(e){var t=Me(e);return(t.local?Ul:Zl)(t)}o(Bt,"default");function ql(){}o(ql,"none");function He(e){return e==null?ql:function(){return this.querySelector(e)}}o(He,"default");function mo(e){typeof e!="function"&&(e=He(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=new Array(a),l,u,d=0;d<a;++d)(l=s[d])&&(u=e.call(l,l.__data__,d,s))&&("__data__"in l&&(u.__data__=l.__data__),c[d]=u);return new ce(r,this._parents)}o(mo,"default");function yo(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}o(yo,"array");function Kl(){return[]}o(Kl,"empty");function gt(e){return e==null?Kl:function(){return this.querySelectorAll(e)}}o(gt,"default");function Gl(e){return function(){return yo(e.apply(this,arguments))}}o(Gl,"arrayAll");function xo(e){typeof e=="function"?e=Gl(e):e=gt(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],c=a.length,l,u=0;u<c;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new ce(r,i)}o(xo,"default");function mt(e){return function(){return this.matches(e)}}o(mt,"default");function Sn(e){return function(t){return t.matches(e)}}o(Sn,"childMatcher");var Ql=Array.prototype.find;function Jl(e){return function(){return Ql.call(this.children,e)}}o(Jl,"childFind");function jl(){return this.firstElementChild}o(jl,"childFirst");function wo(e){return this.select(e==null?jl:Jl(typeof e=="function"?e:Sn(e)))}o(wo,"default");var eu=Array.prototype.filter;function tu(){return Array.from(this.children)}o(tu,"children");function nu(e){return function(){return eu.call(this.children,e)}}o(nu,"childrenFilter");function bo(e){return this.selectAll(e==null?tu:nu(typeof e=="function"?e:Sn(e)))}o(bo,"default");function So(e){typeof e!="function"&&(e=mt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&c.push(l);return new ce(r,this._parents)}o(So,"default");function Vt(e){return new Array(e.length)}o(Vt,"default");function vo(){return new ce(this._enter||this._groups.map(Vt),this._parents)}o(vo,"default");function Ft(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}o(Ft,"EnterNode");Ft.prototype={constructor:Ft,appendChild:o(function(e){return this._parent.insertBefore(e,this._next)},"appendChild"),insertBefore:o(function(e,t){return this._parent.insertBefore(e,t)},"insertBefore"),querySelector:o(function(e){return this._parent.querySelector(e)},"querySelector"),querySelectorAll:o(function(e){return this._parent.querySelectorAll(e)},"querySelectorAll")};function Eo(e){return function(){return e}}o(Eo,"default");function ou(e,t,n,r,i,s){for(var a=0,c,l=t.length,u=s.length;a<u;++a)(c=t[a])?(c.__data__=s[a],r[a]=c):n[a]=new Ft(e,s[a]);for(;a<l;++a)(c=t[a])&&(i[a]=c)}o(ou,"bindIndex");function ru(e,t,n,r,i,s,a){var c,l,u=new Map,d=t.length,h=s.length,f=new Array(d),g;for(c=0;c<d;++c)(l=t[c])&&(f[c]=g=a.call(l,l.__data__,c,t)+"",u.has(g)?i[c]=l:u.set(g,l));for(c=0;c<h;++c)g=a.call(e,s[c],c,s)+"",(l=u.get(g))?(r[c]=l,l.__data__=s[c],u.delete(g)):n[c]=new Ft(e,s[c]);for(c=0;c<d;++c)(l=t[c])&&u.get(f[c])===l&&(i[c]=l)}o(ru,"bindKey");function iu(e){return e.__data__}o(iu,"datum");function Co(e,t){if(!arguments.length)return Array.from(this,iu);var n=t?ru:ou,r=this._parents,i=this._groups;typeof e!="function"&&(e=Eo(e));for(var s=i.length,a=new Array(s),c=new Array(s),l=new Array(s),u=0;u<s;++u){var d=r[u],h=i[u],f=h.length,g=su(e.call(d,d&&d.__data__,u,r)),p=g.length,S=c[u]=new Array(p),b=a[u]=new Array(p),x=l[u]=new Array(f);n(d,h,S,b,x,g,t);for(var v=0,m=0,w,N;v<p;++v)if(w=S[v]){for(v>=m&&(m=v+1);!(N=b[m])&&++m<p;);w._next=N||null}}return a=new ce(a,r),a._enter=c,a._exit=l,a}o(Co,"default");function su(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}o(su,"arraylike");function _o(){return new ce(this._exit||this._groups.map(Vt),this._parents)}o(_o,"default");function No(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}o(No,"default");function Mo(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),c=new Array(i),l=0;l<a;++l)for(var u=n[l],d=r[l],h=u.length,f=c[l]=new Array(h),g,p=0;p<h;++p)(g=u[p]||d[p])&&(f[p]=g);for(;l<i;++l)c[l]=n[l];return new ce(c,this._parents)}o(Mo,"default");function Io(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}o(Io,"default");function Po(e){e||(e=au);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}o(t,"compareNode");for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],c=a.length,l=i[s]=new Array(c),u,d=0;d<c;++d)(u=a[d])&&(l[d]=u);l.sort(t)}return new ce(i,this._parents).order()}o(Po,"default");function au(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(au,"ascending");function ko(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}o(ko,"default");function Ao(){return Array.from(this)}o(Ao,"default");function To(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}o(To,"default");function Do(){let e=0;for(let t of this)++e;return e}o(Do,"default");function Ro(){return!this.node()}o(Ro,"default");function zo(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,c;s<a;++s)(c=i[s])&&e.call(c,c.__data__,s,i);return this}o(zo,"default");function cu(e){return function(){this.removeAttribute(e)}}o(cu,"attrRemove");function lu(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(lu,"attrRemoveNS");function uu(e,t){return function(){this.setAttribute(e,t)}}o(uu,"attrConstant");function du(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}o(du,"attrConstantNS");function fu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}o(fu,"attrFunction");function hu(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)}}o(hu,"attrFunctionNS");function Oo(e,t){var n=Me(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?lu:cu:typeof t=="function"?n.local?hu:fu:n.local?du:uu)(n,t))}o(Oo,"default");function Wt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}o(Wt,"default");function pu(e){return function(){this.style.removeProperty(e)}}o(pu,"styleRemove");function gu(e,t,n){return function(){this.style.setProperty(e,t,n)}}o(gu,"styleConstant");function mu(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}o(mu,"styleFunction");function $o(e,t,n){return arguments.length>1?this.each((t==null?pu:typeof t=="function"?mu:gu)(e,t,n??"")):Be(this.node(),e)}o($o,"default");function Be(e,t){return e.style.getPropertyValue(t)||Wt(e).getComputedStyle(e,null).getPropertyValue(t)}o(Be,"styleValue");function yu(e){return function(){delete this[e]}}o(yu,"propertyRemove");function xu(e,t){return function(){this[e]=t}}o(xu,"propertyConstant");function wu(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}o(wu,"propertyFunction");function Lo(e,t){return arguments.length>1?this.each((t==null?yu:typeof t=="function"?wu:xu)(e,t)):this.node()[e]}o(Lo,"default");function Ti(e){return e.trim().split(/^|\s+/)}o(Ti,"classArray");function Ho(e){return e.classList||new Di(e)}o(Ho,"classList");function Di(e){this._node=e,this._names=Ti(e.getAttribute("class")||"")}o(Di,"ClassList");Di.prototype={add:o(function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(e){return this._names.indexOf(e)>=0},"contains")};function Ri(e,t){for(var n=Ho(e),r=-1,i=t.length;++r<i;)n.add(t[r])}o(Ri,"classedAdd");function zi(e,t){for(var n=Ho(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}o(zi,"classedRemove");function bu(e){return function(){Ri(this,e)}}o(bu,"classedTrue");function Su(e){return function(){zi(this,e)}}o(Su,"classedFalse");function vu(e,t){return function(){(t.apply(this,arguments)?Ri:zi)(this,e)}}o(vu,"classedFunction");function Bo(e,t){var n=Ti(e+"");if(arguments.length<2){for(var r=Ho(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?vu:t?bu:Su)(n,t))}o(Bo,"default");function Eu(){this.textContent=""}o(Eu,"textRemove");function Cu(e){return function(){this.textContent=e}}o(Cu,"textConstant");function _u(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}o(_u,"textFunction");function Vo(e){return arguments.length?this.each(e==null?Eu:(typeof e=="function"?_u:Cu)(e)):this.node().textContent}o(Vo,"default");function Nu(){this.innerHTML=""}o(Nu,"htmlRemove");function Mu(e){return function(){this.innerHTML=e}}o(Mu,"htmlConstant");function Iu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}o(Iu,"htmlFunction");function Fo(e){return arguments.length?this.each(e==null?Nu:(typeof e=="function"?Iu:Mu)(e)):this.node().innerHTML}o(Fo,"default");function Pu(){this.nextSibling&&this.parentNode.appendChild(this)}o(Pu,"raise");function Wo(){return this.each(Pu)}o(Wo,"default");function ku(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}o(ku,"lower");function Yo(){return this.each(ku)}o(Yo,"default");function Xo(e){var t=typeof e=="function"?e:Bt(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}o(Xo,"default");function Au(){return null}o(Au,"constantNull");function Zo(e,t){var n=typeof e=="function"?e:Bt(e),r=t==null?Au:typeof t=="function"?t:He(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}o(Zo,"default");function Tu(){var e=this.parentNode;e&&e.removeChild(this)}o(Tu,"remove");function Uo(){return this.each(Tu)}o(Uo,"default");function Du(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(Du,"selection_cloneShallow");function Ru(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(Ru,"selection_cloneDeep");function qo(e){return this.select(e?Ru:Du)}o(qo,"default");function Ko(e){return arguments.length?this.property("__data__",e):this.node().__data__}o(Ko,"default");function zu(e){return function(t){e.call(this,t,this.__data__)}}o(zu,"contextListener");function Ou(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}o(Ou,"parseTypenames");function $u(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}o($u,"onRemove");function Lu(e,t,n){return function(){var r=this.__on,i,s=zu(t);if(r){for(var a=0,c=r.length;a<c;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}o(Lu,"onAdd");function Go(e,t,n){var r=Ou(e+""),i,s=r.length,a;if(arguments.length<2){var c=this.node().__on;if(c){for(var l=0,u=c.length,d;l<u;++l)for(i=0,d=c[l];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(c=t?Lu:$u,i=0;i<s;++i)this.each(c(r[i],t,n));return this}o(Go,"default");function Oi(e,t,n){var r=Wt(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}o(Oi,"dispatchEvent");function Hu(e,t){return function(){return Oi(this,e,t)}}o(Hu,"dispatchConstant");function Bu(e,t){return function(){return Oi(this,e,t.apply(this,arguments))}}o(Bu,"dispatchFunction");function Qo(e,t){return this.each((typeof t=="function"?Bu:Hu)(e,t))}o(Qo,"default");function*Jo(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}o(Jo,"default");var jo=[null];function ce(e,t){this._groups=e,this._parents=t}o(ce,"Selection");function $i(){return new ce([[document.documentElement]],jo)}o($i,"selection");function Vu(){return this}o(Vu,"selection_selection");ce.prototype=$i.prototype={constructor:ce,select:mo,selectAll:xo,selectChild:wo,selectChildren:bo,filter:So,data:Co,enter:vo,exit:_o,join:No,merge:Mo,selection:Vu,order:Io,sort:Po,call:ko,nodes:Ao,node:To,size:Do,empty:Ro,each:zo,attr:Oo,style:$o,property:Lo,classed:Bo,text:Vo,html:Fo,raise:Wo,lower:Yo,append:Xo,insert:Zo,remove:Uo,clone:qo,datum:Ko,on:Go,dispatch:Qo,[Symbol.iterator]:Jo};var De=$i;function le(e){return typeof e=="string"?new ce([[document.querySelector(e)]],[document.documentElement]):new ce([[e]],jo)}o(le,"default");function er(e){let t;for(;t=e.sourceEvent;)e=t;return e}o(er,"default");function he(e,t){if(e=er(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}o(he,"default");var Li={passive:!1},nt={capture:!0,passive:!1};function vn(e){e.stopImmediatePropagation()}o(vn,"nopropagation");function Re(e){e.preventDefault(),e.stopImmediatePropagation()}o(Re,"default");function yt(e){var t=e.document.documentElement,n=le(e).on("dragstart.drag",Re,nt);"onselectstart"in t?n.on("selectstart.drag",Re,nt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}o(yt,"default");function Yt(e,t){var n=e.document.documentElement,r=le(e).on("dragstart.drag",null);t&&(r.on("click.drag",Re,nt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}o(Yt,"yesdrag");var Xt=o(e=>()=>e,"default");function Zt(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:c,dx:l,dy:u,dispatch:d}){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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}o(Zt,"DragEvent");Zt.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Fu(e){return!e.ctrlKey&&!e.button}o(Fu,"defaultFilter");function Wu(){return this.parentNode}o(Wu,"defaultContainer");function Yu(e,t){return t??{x:e.x,y:e.y}}o(Yu,"defaultSubject");function Xu(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Xu,"defaultTouchable");function Ut(){var e=Fu,t=Wu,n=Yu,r=Xu,i={},s=tt("start","drag","end"),a=0,c,l,u,d,h=0;function f(w){w.on("mousedown.drag",g).filter(r).on("touchstart.drag",b).on("touchmove.drag",x,Li).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(f,"drag");function g(w,N){if(!(d||!e.call(this,w,N))){var C=m(this,t.call(this,w,N),w,N,"mouse");C&&(le(w.view).on("mousemove.drag",p,nt).on("mouseup.drag",S,nt),yt(w.view),vn(w),u=!1,c=w.clientX,l=w.clientY,C("start",w))}}o(g,"mousedowned");function p(w){if(Re(w),!u){var N=w.clientX-c,C=w.clientY-l;u=N*N+C*C>h}i.mouse("drag",w)}o(p,"mousemoved");function S(w){le(w.view).on("mousemove.drag mouseup.drag",null),Yt(w.view,u),Re(w),i.mouse("end",w)}o(S,"mouseupped");function b(w,N){if(e.call(this,w,N)){var C=w.changedTouches,I=t.call(this,w,N),k=C.length,A,F;for(A=0;A<k;++A)(F=m(this,I,w,N,C[A].identifier,C[A]))&&(vn(w),F("start",w,C[A]))}}o(b,"touchstarted");function x(w){var N=w.changedTouches,C=N.length,I,k;for(I=0;I<C;++I)(k=i[N[I].identifier])&&(Re(w),k("drag",w,N[I]))}o(x,"touchmoved");function v(w){var N=w.changedTouches,C=N.length,I,k;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),I=0;I<C;++I)(k=i[N[I].identifier])&&(vn(w),k("end",w,N[I]))}o(v,"touchended");function m(w,N,C,I,k,A){var F=s.copy(),z=he(A||C,N),H,$,y;if((y=n.call(w,new Zt("beforestart",{sourceEvent:C,target:f,identifier:k,active:a,x:z[0],y:z[1],dx:0,dy:0,dispatch:F}),I))!=null)return H=y.x-z[0]||0,$=y.y-z[1]||0,o(function E(_,M,D){var R=z,L;switch(_){case"start":i[k]=E,L=a++;break;case"end":delete i[k],--a;case"drag":z=he(D||M,N),L=a;break}F.call(_,w,new Zt(_,{sourceEvent:M,subject:y,target:f,identifier:k,active:L,x:z[0]+H,y:z[1]+$,dx:z[0]-R[0],dy:z[1]-R[1],dispatch:F}),I)},"gesture")}return o(m,"beforestart"),f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Xt(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:Xt(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Xt(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Xt(!!w),f):r},f.on=function(){var w=s.on.apply(s,arguments);return w===s?f:w},f.clickDistance=function(w){return arguments.length?(h=(w=+w)*w,f):Math.sqrt(h)},f}o(Ut,"default");var xt=0,Kt=0,qt=0,Bi=1e3,En,Gt,Cn=0,ot=0,_n=0,Qt=typeof performance=="object"&&performance.now?performance:Date,Vi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function jt(){return ot||(Vi(Zu),ot=Qt.now()+_n)}o(jt,"now");function Zu(){ot=0}o(Zu,"clearNow");function Jt(){this._call=this._time=this._next=null}o(Jt,"Timer");Jt.prototype=Nn.prototype={constructor:Jt,restart:o(function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?jt():+n)+(t==null?0:+t),!this._next&&Gt!==this&&(Gt?Gt._next=this:En=this,Gt=this),this._call=e,this._time=n,tr()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,tr())},"stop")};function Nn(e,t,n){var r=new Jt;return r.restart(e,t,n),r}o(Nn,"timer");function Fi(){jt(),++xt;for(var e=En,t;e;)(t=ot-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xt}o(Fi,"timerFlush");function Hi(){ot=(Cn=Qt.now())+_n,xt=Kt=0;try{Fi()}finally{xt=0,qu(),ot=0}}o(Hi,"wake");function Uu(){var e=Qt.now(),t=e-Cn;t>Bi&&(_n-=t,Cn=e)}o(Uu,"poke");function qu(){for(var e,t=En,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:En=n);Gt=e,tr(r)}o(qu,"nap");function tr(e){if(!xt){Kt&&(Kt=clearTimeout(Kt));var t=e-ot;t>24?(e<1/0&&(Kt=setTimeout(Hi,e-Qt.now()-_n)),qt&&(qt=clearInterval(qt))):(qt||(Cn=Qt.now(),qt=setInterval(Uu,Bi)),xt=1,Vi(Hi))}}o(tr,"sleep");function en(e,t,n){var r=new Jt;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}o(en,"default");var Ku=tt("start","end","cancel","interrupt"),Gu=[],Xi=0,Wi=1,In=2,Mn=3,Yi=4,Pn=5,tn=6;function ze(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;Qu(e,n,{name:t,index:r,group:i,on:Ku,tween:Gu,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Xi})}o(ze,"default");function nn(e,t){var n=ue(e,t);if(n.state>Xi)throw new Error("too late; already scheduled");return n}o(nn,"init");function fe(e,t){var n=ue(e,t);if(n.state>Mn)throw new Error("too late; already running");return n}o(fe,"set");function ue(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}o(ue,"get");function Qu(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Nn(s,0,n.time);function s(u){n.state=Wi,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}o(s,"schedule");function a(u){var d,h,f,g;if(n.state!==Wi)return l();for(d in r)if(g=r[d],g.name===n.name){if(g.state===Mn)return en(a);g.state===Yi?(g.state=tn,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[d]):+d<t&&(g.state=tn,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[d])}if(en(function(){n.state===Mn&&(n.state=Yi,n.timer.restart(c,n.delay,n.time),c(u))}),n.state=In,n.on.call("start",e,e.__data__,n.index,n.group),n.state===In){for(n.state=Mn,i=new Array(f=n.tween.length),d=0,h=-1;d<f;++d)(g=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=g);i.length=h+1}}o(a,"start");function c(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Pn,1),h=-1,f=i.length;++h<f;)i[h].call(e,d);n.state===Pn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}o(c,"tick");function l(){n.state=tn,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}o(l,"stop")}o(Qu,"create");function Ve(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>In&&r.state<Pn,r.state=tn,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}o(Ve,"default");function nr(e){return this.each(function(){Ve(this,e)})}o(nr,"default");function Ju(e,t){var n,r;return function(){var i=fe(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,c=r.length;a<c;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}o(Ju,"tweenRemove");function ju(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=fe(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var c={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=c;break}l===u&&i.push(c)}s.tween=i}}o(ju,"tweenFunction");function or(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ue(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?Ju:ju)(n,e,t))}o(or,"default");function wt(e,t,n){var r=e._id;return e.each(function(){var i=fe(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return ue(i,r).value[t]}}o(wt,"tweenValue");function on(e,t){var n;return(typeof t=="number"?vi:t instanceof ho?po:(n=ho(t))?(t=n,po):Ei)(e,t)}o(on,"default");function ed(e){return function(){this.removeAttribute(e)}}o(ed,"attrRemove");function td(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(td,"attrRemoveNS");function nd(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}o(nd,"attrConstant");function od(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}o(od,"attrConstantNS");function rd(e,t,n){var r,i,s;return function(){var a,c=n(this),l;return c==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=c+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c)))}}o(rd,"attrFunction");function id(e,t,n){var r,i,s;return function(){var a,c=n(this),l;return c==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=c+"",a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c)))}}o(id,"attrFunctionNS");function rr(e,t){var n=Me(e),r=n==="transform"?_i:on;return this.attrTween(e,typeof t=="function"?(n.local?id:rd)(n,r,wt(this,"attr."+e,t)):t==null?(n.local?td:ed)(n):(n.local?od:nd)(n,r,t))}o(rr,"default");function sd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}o(sd,"attrInterpolate");function ad(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}o(ad,"attrInterpolateNS");function cd(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ad(e,s)),n}return o(i,"tween"),i._value=t,i}o(cd,"attrTweenNS");function ld(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&sd(e,s)),n}return o(i,"tween"),i._value=t,i}o(ld,"attrTween");function ir(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 r=Me(e);return this.tween(n,(r.local?cd:ld)(r,t))}o(ir,"default");function ud(e,t){return function(){nn(this,e).delay=+t.apply(this,arguments)}}o(ud,"delayFunction");function dd(e,t){return t=+t,function(){nn(this,e).delay=t}}o(dd,"delayConstant");function sr(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ud:dd)(t,e)):ue(this.node(),t).delay}o(sr,"default");function fd(e,t){return function(){fe(this,e).duration=+t.apply(this,arguments)}}o(fd,"durationFunction");function hd(e,t){return t=+t,function(){fe(this,e).duration=t}}o(hd,"durationConstant");function ar(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fd:hd)(t,e)):ue(this.node(),t).duration}o(ar,"default");function pd(e,t){if(typeof t!="function")throw new Error;return function(){fe(this,e).ease=t}}o(pd,"easeConstant");function cr(e){var t=this._id;return arguments.length?this.each(pd(t,e)):ue(this.node(),t).ease}o(cr,"default");function gd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;fe(this,e).ease=n}}o(gd,"easeVarying");function lr(e){if(typeof e!="function")throw new Error;return this.each(gd(this._id,e))}o(lr,"default");function ur(e){typeof e!="function"&&(e=mt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,c=r[i]=[],l,u=0;u<a;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&c.push(l);return new ge(r,this._parents,this._name,this._id)}o(ur,"default");function dr(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),c=0;c<s;++c)for(var l=t[c],u=n[c],d=l.length,h=a[c]=new Array(d),f,g=0;g<d;++g)(f=l[g]||u[g])&&(h[g]=f);for(;c<r;++c)a[c]=t[c];return new ge(a,this._parents,this._name,this._id)}o(dr,"default");function md(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}o(md,"start");function yd(e,t,n){var r,i,s=md(t)?nn:fe;return function(){var a=s(this,e),c=a.on;c!==r&&(i=(r=c).copy()).on(t,n),a.on=i}}o(yd,"onFunction");function fr(e,t){var n=this._id;return arguments.length<2?ue(this.node(),n).on.on(e):this.each(yd(n,e,t))}o(fr,"default");function xd(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}o(xd,"removeFunction");function hr(){return this.on("end.remove",xd(this._id))}o(hr,"default");function pr(e){var t=this._name,n=this._id;typeof e!="function"&&(e=He(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],l=c.length,u=s[a]=new Array(l),d,h,f=0;f<l;++f)(d=c[f])&&(h=e.call(d,d.__data__,f,c))&&("__data__"in d&&(h.__data__=d.__data__),u[f]=h,ze(u[f],t,n,f,u,ue(d,n)));return new ge(s,this._parents,t,n)}o(pr,"default");function gr(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gt(e));for(var r=this._groups,i=r.length,s=[],a=[],c=0;c<i;++c)for(var l=r[c],u=l.length,d,h=0;h<u;++h)if(d=l[h]){for(var f=e.call(d,d.__data__,h,l),g,p=ue(d,n),S=0,b=f.length;S<b;++S)(g=f[S])&&ze(g,t,n,S,f,p);s.push(f),a.push(d)}return new ge(s,a,t,n)}o(gr,"default");var wd=De.prototype.constructor;function mr(){return new wd(this._groups,this._parents)}o(mr,"default");function bd(e,t){var n,r,i;return function(){var s=Be(this,e),a=(this.style.removeProperty(e),Be(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}o(bd,"styleNull");function Zi(e){return function(){this.style.removeProperty(e)}}o(Zi,"styleRemove");function Sd(e,t,n){var r,i=n+"",s;return function(){var a=Be(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}o(Sd,"styleConstant");function vd(e,t,n){var r,i,s;return function(){var a=Be(this,e),c=n(this),l=c+"";return c==null&&(l=c=(this.style.removeProperty(e),Be(this,e))),a===l?null:a===r&&l===i?s:(i=l,s=t(r=a,c))}}o(vd,"styleFunction");function Ed(e,t){var n,r,i,s="style."+t,a="end."+s,c;return function(){var l=fe(this,e),u=l.on,d=l.value[s]==null?c||(c=Zi(t)):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(a,i=d),l.on=r}}o(Ed,"styleMaybeRemove");function yr(e,t,n){var r=(e+="")=="transform"?Ci:on;return t==null?this.styleTween(e,bd(e,r)).on("end.style."+e,Zi(e)):typeof t=="function"?this.styleTween(e,vd(e,r,wt(this,"style."+e,t))).each(Ed(this._id,e)):this.styleTween(e,Sd(e,r,t),n).on("end.style."+e,null)}o(yr,"default");function Cd(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}o(Cd,"styleInterpolate");function _d(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Cd(e,a,n)),r}return o(s,"tween"),s._value=t,s}o(_d,"styleTween");function xr(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,_d(e,t,n??""))}o(xr,"default");function Nd(e){return function(){this.textContent=e}}o(Nd,"textConstant");function Md(e){return function(){var t=e(this);this.textContent=t??""}}o(Md,"textFunction");function wr(e){return this.tween("text",typeof e=="function"?Md(wt(this,"text",e)):Nd(e==null?"":e+""))}o(wr,"default");function Id(e){return function(t){this.textContent=e.call(this,t)}}o(Id,"textInterpolate");function Pd(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Id(i)),t}return o(r,"tween"),r._value=e,r}o(Pd,"textTween");function br(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,Pd(e))}o(br,"default");function Sr(){for(var e=this._name,t=this._id,n=kn(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],c=a.length,l,u=0;u<c;++u)if(l=a[u]){var d=ue(l,t);ze(l,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new ge(r,this._parents,e,n)}o(Sr,"default");function vr(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var c={value:a},l={value:o(function(){--i===0&&s()},"value")};n.each(function(){var u=fe(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(l)),u.on=t}),i===0&&s()})}o(vr,"default");var kd=0;function ge(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}o(ge,"Transition");function Ui(e){return De().transition(e)}o(Ui,"transition");function kn(){return++kd}o(kn,"newId");var Oe=De.prototype;ge.prototype=Ui.prototype={constructor:ge,select:pr,selectAll:gr,selectChild:Oe.selectChild,selectChildren:Oe.selectChildren,filter:ur,merge:dr,selection:mr,transition:Sr,call:Oe.call,nodes:Oe.nodes,node:Oe.node,size:Oe.size,empty:Oe.empty,each:Oe.each,on:fr,attr:rr,attrTween:ir,style:yr,styleTween:xr,text:wr,textTween:br,remove:hr,tween:or,delay:sr,duration:ar,ease:cr,easeVarying:lr,end:vr,[Symbol.iterator]:Oe[Symbol.iterator]};function An(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}o(An,"cubicInOut");var Ad={time:null,delay:0,duration:250,ease:An};function Td(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}o(Td,"inherit");function Er(e){var t,n;e instanceof ge?(t=e._id,e=e._name):(t=kn(),(n=Ad).time=jt(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],c=a.length,l,u=0;u<c;++u)(l=a[u])&&ze(l,e,t,u,a,n||Td(l,t));return new ge(r,this._parents,e,t)}o(Er,"default");De.prototype.interrupt=nr;De.prototype.transition=Er;var rn=o(e=>()=>e,"default");function Cr(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){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:r,enumerable:!0,configurable:!0},_:{value:i}})}o(Cr,"ZoomEvent");function Ee(e,t,n){this.k=e,this.x=t,this.y=n}o(Ee,"Transform");Ee.prototype={constructor:Ee,scale:o(function(e){return e===1?this:new Ee(this.k*e,this.x,this.y)},"scale"),translate:o(function(e,t){return e===0&t===0?this:new Ee(this.k,this.x+this.k*e,this.y+this.k*t)},"translate"),apply:o(function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},"apply"),applyX:o(function(e){return e*this.k+this.x},"applyX"),applyY:o(function(e){return e*this.k+this.y},"applyY"),invert:o(function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},"invert"),invertX:o(function(e){return(e-this.x)/this.k},"invertX"),invertY:o(function(e){return(e-this.y)/this.k},"invertY"),rescaleX:o(function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},"rescaleX"),rescaleY:o(function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},"rescaleY"),toString:o(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};var rt=new Ee(1,0,0);sn.prototype=Ee.prototype;function sn(e){for(;!e.__zoom;)if(!(e=e.parentNode))return rt;return e.__zoom}o(sn,"transform");function Tn(e){e.stopImmediatePropagation()}o(Tn,"nopropagation");function it(e){e.preventDefault(),e.stopImmediatePropagation()}o(it,"default");function Dd(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}o(Dd,"defaultFilter");function Rd(){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]]}o(Rd,"defaultExtent");function qi(){return this.__zoom||rt}o(qi,"defaultTransform");function zd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}o(zd,"defaultWheelDelta");function Od(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Od,"defaultTouchable");function $d(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}o($d,"defaultConstrain");function an(){var e=Dd,t=Rd,n=$d,r=zd,i=Od,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],c=250,l=pt,u=tt("start","zoom","end"),d,h,f,g=500,p=150,S=0,b=10;function x(y){y.property("__zoom",qi).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",F).filter(i).on("touchstart.zoom",z).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(x,"zoom"),x.transform=function(y,E,_,M){var D=y.selection?y.selection():y;D.property("__zoom",qi),y!==D?N(y,E,_,M):D.interrupt().each(function(){C(this,arguments).event(M).start().zoom(null,typeof E=="function"?E.apply(this,arguments):E).end()})},x.scaleBy=function(y,E,_,M){x.scaleTo(y,function(){var D=this.__zoom.k,R=typeof E=="function"?E.apply(this,arguments):E;return D*R},_,M)},x.scaleTo=function(y,E,_,M){x.transform(y,function(){var D=t.apply(this,arguments),R=this.__zoom,L=_==null?w(D):typeof _=="function"?_.apply(this,arguments):_,V=R.invert(L),B=typeof E=="function"?E.apply(this,arguments):E;return n(m(v(R,B),L,V),D,a)},_,M)},x.translateBy=function(y,E,_,M){x.transform(y,function(){return n(this.__zoom.translate(typeof E=="function"?E.apply(this,arguments):E,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),a)},null,M)},x.translateTo=function(y,E,_,M,D){x.transform(y,function(){var R=t.apply(this,arguments),L=this.__zoom,V=M==null?w(R):typeof M=="function"?M.apply(this,arguments):M;return n(rt.translate(V[0],V[1]).scale(L.k).translate(typeof E=="function"?-E.apply(this,arguments):-E,typeof _=="function"?-_.apply(this,arguments):-_),R,a)},M,D)};function v(y,E){return E=Math.max(s[0],Math.min(s[1],E)),E===y.k?y:new Ee(E,y.x,y.y)}o(v,"scale");function m(y,E,_){var M=E[0]-_[0]*y.k,D=E[1]-_[1]*y.k;return M===y.x&&D===y.y?y:new Ee(y.k,M,D)}o(m,"translate");function w(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}o(w,"centroid");function N(y,E,_,M){y.on("start.zoom",function(){C(this,arguments).event(M).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(M).end()}).tween("zoom",function(){var D=this,R=arguments,L=C(D,R).event(M),V=t.apply(D,R),B=_==null?w(V):typeof _=="function"?_.apply(D,R):_,U=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),W=D.__zoom,G=typeof E=="function"?E.apply(D,R):E,ee=l(W.invert(B).concat(U/W.k),G.invert(B).concat(U/G.k));return function(K){if(K===1)K=G;else{var O=ee(K),Y=U/O[2];K=new Ee(Y,B[0]-O[0]*Y,B[1]-O[1]*Y)}L.zoom(null,K)}})}o(N,"schedule");function C(y,E,_){return!_&&y.__zooming||new I(y,E)}o(C,"gesture");function I(y,E){this.that=y,this.args=E,this.active=0,this.sourceEvent=null,this.extent=t.apply(y,E),this.taps=0}o(I,"Gesture"),I.prototype={event:o(function(y){return y&&(this.sourceEvent=y),this},"event"),start:o(function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},"start"),zoom:o(function(y,E){return this.mouse&&y!=="mouse"&&(this.mouse[1]=E.invert(this.mouse[0])),this.touch0&&y!=="touch"&&(this.touch0[1]=E.invert(this.touch0[0])),this.touch1&&y!=="touch"&&(this.touch1[1]=E.invert(this.touch1[0])),this.that.__zoom=E,this.emit("zoom"),this},"zoom"),end:o(function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},"end"),emit:o(function(y){var E=le(this.that).datum();u.call(y,this.that,new Cr(y,{sourceEvent:this.sourceEvent,target:x,type:y,transform:this.that.__zoom,dispatch:u}),E)},"emit")};function k(y,...E){if(!e.apply(this,arguments))return;var _=C(this,E).event(y),M=this.__zoom,D=Math.max(s[0],Math.min(s[1],M.k*Math.pow(2,r.apply(this,arguments)))),R=he(y);if(_.wheel)(_.mouse[0][0]!==R[0]||_.mouse[0][1]!==R[1])&&(_.mouse[1]=M.invert(_.mouse[0]=R)),clearTimeout(_.wheel);else{if(M.k===D)return;_.mouse=[R,M.invert(R)],Ve(this),_.start()}it(y),_.wheel=setTimeout(L,p),_.zoom("mouse",n(m(v(M,D),_.mouse[0],_.mouse[1]),_.extent,a));function L(){_.wheel=null,_.end()}o(L,"wheelidled")}o(k,"wheeled");function A(y,...E){if(f||!e.apply(this,arguments))return;var _=y.currentTarget,M=C(this,E,!0).event(y),D=le(y.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",U,!0),R=he(y,_),L=y.clientX,V=y.clientY;yt(y.view),Tn(y),M.mouse=[R,this.__zoom.invert(R)],Ve(this),M.start();function B(W){if(it(W),!M.moved){var G=W.clientX-L,ee=W.clientY-V;M.moved=G*G+ee*ee>S}M.event(W).zoom("mouse",n(m(M.that.__zoom,M.mouse[0]=he(W,_),M.mouse[1]),M.extent,a))}o(B,"mousemoved");function U(W){D.on("mousemove.zoom mouseup.zoom",null),Yt(W.view,M.moved),it(W),M.event(W).end()}o(U,"mouseupped")}o(A,"mousedowned");function F(y,...E){if(e.apply(this,arguments)){var _=this.__zoom,M=he(y.changedTouches?y.changedTouches[0]:y,this),D=_.invert(M),R=_.k*(y.shiftKey?.5:2),L=n(m(v(_,R),M,D),t.apply(this,E),a);it(y),c>0?le(this).transition().duration(c).call(N,L,M,y):le(this).call(x.transform,L,M,y)}}o(F,"dblclicked");function z(y,...E){if(e.apply(this,arguments)){var _=y.touches,M=_.length,D=C(this,E,y.changedTouches.length===M).event(y),R,L,V,B;for(Tn(y),L=0;L<M;++L)V=_[L],B=he(V,this),B=[B,this.__zoom.invert(B),V.identifier],D.touch0?!D.touch1&&D.touch0[2]!==B[2]&&(D.touch1=B,D.taps=0):(D.touch0=B,R=!0,D.taps=1+!!d);d&&(d=clearTimeout(d)),R&&(D.taps<2&&(h=B[0],d=setTimeout(function(){d=null},g)),Ve(this),D.start())}}o(z,"touchstarted");function H(y,...E){if(this.__zooming){var _=C(this,E).event(y),M=y.changedTouches,D=M.length,R,L,V,B;for(it(y),R=0;R<D;++R)L=M[R],V=he(L,this),_.touch0&&_.touch0[2]===L.identifier?_.touch0[0]=V:_.touch1&&_.touch1[2]===L.identifier&&(_.touch1[0]=V);if(L=_.that.__zoom,_.touch1){var U=_.touch0[0],W=_.touch0[1],G=_.touch1[0],ee=_.touch1[1],K=(K=G[0]-U[0])*K+(K=G[1]-U[1])*K,O=(O=ee[0]-W[0])*O+(O=ee[1]-W[1])*O;L=v(L,Math.sqrt(K/O)),V=[(U[0]+G[0])/2,(U[1]+G[1])/2],B=[(W[0]+ee[0])/2,(W[1]+ee[1])/2]}else if(_.touch0)V=_.touch0[0],B=_.touch0[1];else return;_.zoom("touch",n(m(L,V,B),_.extent,a))}}o(H,"touchmoved");function $(y,...E){if(this.__zooming){var _=C(this,E).event(y),M=y.changedTouches,D=M.length,R,L;for(Tn(y),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),R=0;R<D;++R)L=M[R],_.touch0&&_.touch0[2]===L.identifier?delete _.touch0:_.touch1&&_.touch1[2]===L.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(L=he(L,this),Math.hypot(h[0]-L[0],h[1]-L[1])<b)){var V=le(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return o($,"touchended"),x.wheelDelta=function(y){return arguments.length?(r=typeof y=="function"?y:rn(+y),x):r},x.filter=function(y){return arguments.length?(e=typeof y=="function"?y:rn(!!y),x):e},x.touchable=function(y){return arguments.length?(i=typeof y=="function"?y:rn(!!y),x):i},x.extent=function(y){return arguments.length?(t=typeof y=="function"?y:rn([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),x):t},x.scaleExtent=function(y){return arguments.length?(s[0]=+y[0],s[1]=+y[1],x):[s[0],s[1]]},x.translateExtent=function(y){return arguments.length?(a[0][0]=+y[0][0],a[1][0]=+y[1][0],a[0][1]=+y[0][1],a[1][1]=+y[1][1],x):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},x.constrain=function(y){return arguments.length?(n=y,x):n},x.duration=function(y){return arguments.length?(c=+y,x):c},x.interpolate=function(y){return arguments.length?(l=y,x):l},x.on=function(){var y=u.on.apply(u,arguments);return y===u?x:y},x.clickDistance=function(y){return arguments.length?(S=(y=+y)*y,x):Math.sqrt(S)},x.tapDistance=function(y){return arguments.length?(b=+y,x):b},x}o(an,"default");var ye={error001:o((e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,"error001"),error002:o(()=>"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.","error002"),error003:o(e=>`Node type "${e}" not found. Using fallback type "default".`,"error003"),error004:o(()=>"The parent container needs a width and a height to render the graph.","error004"),error005:o(()=>"Only child nodes can use a parent extent.","error005"),error006:o(()=>"Can't create edge. An edge needs a source and a target.","error006"),error007:o(e=>`The old edge with id=${e} does not exist.`,"error007"),error009:o(e=>`Marker type "${e}" doesn't exist.`,"error009"),error008:o((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,"error008"),error010:o(()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","error010"),error011:o(e=>`Edge type "${e}" not found. Using fallback type "default".`,"error011"),error012:o(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.`,"error012"),error013:o((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.`,"error013"),error014:o(()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.","error014"),error015:o(()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.","error015"),error016:o(e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`,"error016")},Et=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Pr=["Enter"," ","Escape"],kr={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":o(({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"node.a11yDescription.ariaLiveMessage"),"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},Xe;(function(e){e.Strict="strict",e.Loose="loose"})(Xe||(Xe={}));var $e;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})($e||($e={}));var st;(function(e){e.Partial="partial",e.Full="full"})(st||(st={}));var Ar={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Ie;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ie||(Ie={}));var St;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(St||(St={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));var Ki={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top},Tr=o(e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,"isEdgeBase"),cs=o(e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),"isNodeBase"),Dr=o(e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),"isInternalNodeBase");var ln=o((e,t=[0,0])=>{let{width:n,height:r}=Se(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},"getNodePositionWithOrigin"),un=o((e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((i,s)=>{let a=typeof s=="string",c=!t.nodeLookup&&!a?s:void 0;return t.nodeLookup&&(c=a?t.nodeLookup.get(s):Dr(s)?s:t.nodeLookup.get(s.id)),c?(n=!0,Ln(i,zn(c,t.nodeOrigin))):i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Hn(r):{x:0,y:0,width:0,height:0}},"getNodesBounds"),Ct=o((e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Ln(n,zn(i)),r=!0)}),r?Hn(n):{x:0,y:0,width:0,height:0}},"getInternalNodesBounds"),On=o((e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{let c=(t.x-n)/i,l=(t.y-r)/i,u=t.width/i,d=t.height/i,h=[];for(let f of e.values()){let{measured:g,selectable:p=!0,hidden:S=!1}=f;if(a&&!p||S)continue;let b=g.width??f.width??f.initialWidth??0,x=g.height??f.height??f.initialHeight??0,{x:v,y:m}=f.internals.positionAbsolute,w=hs(c,l,u,d,v,m,b,x),N=b*x,C=s&&w>0;(!f.internals.handleBounds||C||w>=N||f.dragging)&&h.push(f)}return h},"getNodesInside"),ls=o((e,t)=>{let n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))},"getConnectedEdges");function Ld(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{let s;if(t?.includeHiddenNodes){let{width:a,height:c}=Se(i);s=a>0&&c>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}o(Ld,"getFitViewNodes");async function us({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;let c=Ld(e,a),l=Ct(c),u=ut(l,t,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??.1);return await r.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}o(us,"fitViewport");function Rr({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){let a=n.get(e),c=a.parentId?n.get(a.parentId):void 0,{x:l,y:u}=c?c.internals.positionAbsolute:{x:0,y:0},d=a.origin??r,h=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!c)s?.("005",ye.error005());else{let{width:g,height:p}=Se(c);g&&p&&(h=[[l,u],[l+g,u+p]])}else c&&lt(a.extent)&&(h=[[a.extent[0][0]+l,a.extent[0][1]+u],[a.extent[1][0]+l,a.extent[1][1]+u]]);let f=lt(h)?at(t,h,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",ye.error015()),{position:{x:f.x-l+(a.measured.width??0)*d[0],y:f.y-u+(a.measured.height??0)*d[1]},positionAbsolute:f}}o(Rr,"calculateNodePosition");async function ds({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let s=new Set(e.map(f=>f.id)),a=[];for(let f of n){if(f.deletable===!1)continue;let g=s.has(f.id),p=!g&&f.parentId&&a.find(S=>S.id===f.parentId);(g||p)&&a.push(f)}let c=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),d=ls(a,l);for(let f of l)c.has(f.id)&&!d.find(p=>p.id===f.id)&&d.push(f);if(!i)return{edges:d,nodes:a};let h=await i({nodes:a,edges:d});return typeof h=="boolean"?h?{edges:d,nodes:a}:{edges:[],nodes:[]}:h}o(ds,"getElementsToRemove");var vt=o((e,t=0,n=1)=>Math.min(Math.max(e,t),n),"clamp"),at=o((e={x:0,y:0},t,n)=>({x:vt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:vt(e.y,t[0][1],t[1][1]-(n?.height??0))}),"clampPosition");function fs(e,t,n){let{width:r,height:i}=Se(n),{x:s,y:a}=n.internals.positionAbsolute;return at(e,[[s,a],[s+r,a+i]],t)}o(fs,"clampPositionToParent");var Gi=o((e,t,n)=>e<t?vt(Math.abs(e-t),1,t)/t:e>n?-vt(Math.abs(e-n),1,t)/t:0,"calcAutoPanVelocity"),$n=o((e,t,n=15,r=40)=>{let i=Gi(e.x,r,t.width-r)*n,s=Gi(e.y,r,t.height-r)*n;return[i,s]},"calcAutoPan"),Ln=o((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)}),"getBoundsOfBoxes"),Ir=o(({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),"rectToBox"),Hn=o(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),"boxToRect"),_t=o((e,t=[0,0])=>{let{x:n,y:r}=Dr(e)?e.internals.positionAbsolute:ln(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},"nodeToRect"),zn=o((e,t=[0,0])=>{let{x:n,y:r}=Dr(e)?e.internals.positionAbsolute:ln(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},"nodeToBox"),zr=o((e,t)=>Hn(Ln(Ir(e),Ir(t))),"getBoundsOfRects"),hs=o((e,t,n,r,i,s,a,c)=>{let l=Math.max(0,Math.min(e+n,i+a)-Math.max(e,i)),u=Math.max(0,Math.min(t+r,s+c)-Math.max(t,s));return Math.ceil(l*u)},"getRectsOverlappingArea"),dn=o((e,t)=>hs(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),"getOverlappingArea"),Or=o(e=>we(e.width)&&we(e.height)&&we(e.x)&&we(e.y),"isRectObject"),we=o(e=>!isNaN(e)&&isFinite(e),"isNumeric"),$r=o((e,t)=>(n,r)=>{},"createDevWarn"),Nt=o((e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),"snapPosition"),Mt=o(({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{let c={x:(e-n)/i,y:(t-r)/i};return s?Nt(c,a):c},"pointToRendererPoint"),ct=o(({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),"rendererPointToPoint");function bt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}o(bt,"parsePadding");function Hd(e,t,n){if(typeof e=="string"||typeof e=="number"){let r=bt(e,n),i=bt(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){let r=bt(e.top??e.y??0,n),i=bt(e.bottom??e.y??0,n),s=bt(e.left??e.x??0,t),a=bt(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}o(Hd,"parsePaddings");function Bd(e,t,n,r,i,s){let{x:a,y:c}=ct(e,[t,n,r]),{x:l,y:u}=ct({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-l,h=s-u;return{left:Math.floor(a),top:Math.floor(c),right:Math.floor(d),bottom:Math.floor(h)}}o(Bd,"calculateAppliedPaddings");var ut=o((e,t,n,r,i,s)=>{let a=Hd(s,t,n),c=(t-a.x)/e.width,l=(n-a.y)/e.height,u=Math.min(c,l),d=vt(u,r,i),h=e.x+e.width/2,f=e.y+e.height/2,g=t/2-h*d,p=n/2-f*d,S=Bd(e,g,p,d,t,n),b={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:g-b.left+b.right,y:p-b.top+b.bottom,zoom:d}},"getViewportForBounds"),It=o(()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,"isMacOs");function lt(e){return e!=null&&e!=="parent"}o(lt,"isCoordinateExtent");function Se(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}o(Se,"getNodeDimensions");function Bn(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}o(Bn,"nodeHasDimensions");function Lr(e,t={width:0,height:0},n,r,i){let s={...e},a=r.get(n);if(a){let c=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*c[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*c[1]}return s}o(Lr,"evaluateAbsolutePosition");function Hr(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}o(Hr,"areSetsEqual");function ps(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}o(ps,"withResolvers");function gs(e){return{...kr,...e||{}}}o(gs,"mergeAriaLabelConfig");function Br(e){return e===null?null:e?"valid":"invalid"}o(Br,"getConnectionStatus");function cn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:s,y:a}=be(e),c=Mt({x:s-(i?.left??0),y:a-(i?.top??0)},r),{x:l,y:u}=n?Nt(c,t):c;return{xSnapped:l,ySnapped:u,...c}}o(cn,"getPointerPosition");var Vn=o(e=>({width:e.offsetWidth,height:e.offsetHeight}),"getDimensions"),Vr=o(e=>e?.getRootNode?.()||window?.document,"getHostForElement"),Vd=["INPUT","SELECT","TEXTAREA"];function Fr(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:Vd.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}o(Fr,"isInputDOMNode");var Wr=o(e=>"clientX"in e,"isMouseEvent"),be=o((e,t)=>{let n=Wr(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},"getEventPosition"),Qi=o((e,t,n,r,i)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{let c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...Vn(a)}})},"getHandleBounds");function Fn({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:c}){let l=e*.125+i*.375+a*.375+n*.125,u=t*.125+s*.375+c*.375+r*.125,d=Math.abs(l-e),h=Math.abs(u-t);return[l,u,d,h]}o(Fn,"getBezierEdgeCenter");function Dn(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}o(Dn,"calculateControlOffset");function Ji({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case X.Left:return[t-Dn(t-r,s),n];case X.Right:return[t+Dn(r-t,s),n];case X.Top:return[t,n-Dn(n-i,s)];case X.Bottom:return[t,n+Dn(i-n,s)]}}o(Ji,"getControlWithCurvature");function Wn({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:i,targetPosition:s=X.Top,curvature:a=.25}){let[c,l]=Ji({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,d]=Ji({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[h,f,g,p]=Fn({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:c,sourceControlY:l,targetControlX:u,targetControlY:d});return[`M${e},${t} C${c},${l} ${u},${d} ${r},${i}`,h,f,g,p]}o(Wn,"getBezierPath");function Yr({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(r-t)/2,c=r<t?r+a:r-a;return[s,c,i,a]}o(Yr,"getEdgeCenter");function ms({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;let a=i&&n?r+1e3:r,c=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return a+c}o(ms,"getElevatedEdgeZIndex");function ys({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let s=Ln(zn(e),zn(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return dn(a,Hn(s))>0}o(ys,"isEdgeVisible");var Fd=o(({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,"getEdgeId"),Wd=o((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)),"connectionExists"),xs=o((e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ye.error006()),t;let r=n.getEdgeId||Fd,i;return Tr(e)?i={...e}:i={...e,id:r(e)},Wd(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))},"addEdge");function Yn({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,s,a,c]=Yr({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,c]}o(Yn,"getStraightPath");var ji={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},Yd=o(({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},"getDirection"),es=o((e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),"distance");function Xd({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:i,offset:s,stepPosition:a}){let c=ji[t],l=ji[r],u={x:e.x+c.x*s,y:e.y+c.y*s},d={x:n.x+l.x*s,y:n.y+l.y*s},h=Yd({source:u,sourcePosition:t,target:d}),f=h.x!==0?"x":"y",g=h[f],p=[],S,b,x={x:0,y:0},v={x:0,y:0},[,,m,w]=Yr({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[f]*l[f]===-1){f==="x"?(S=i.x??u.x+(d.x-u.x)*a,b=i.y??(u.y+d.y)/2):(S=i.x??(u.x+d.x)/2,b=i.y??u.y+(d.y-u.y)*a);let k=[{x:S,y:u.y},{x:S,y:d.y}],A=[{x:u.x,y:b},{x:d.x,y:b}];c[f]===g?p=f==="x"?k:A:p=f==="x"?A:k}else{let k=[{x:u.x,y:d.y}],A=[{x:d.x,y:u.y}];if(f==="x"?p=c.x===g?A:k:p=c.y===g?k:A,t===r){let y=Math.abs(e[f]-n[f]);if(y<=s){let E=Math.min(s-1,s-y);c[f]===g?x[f]=(u[f]>e[f]?-1:1)*E:v[f]=(d[f]>n[f]?-1:1)*E}}if(t!==r){let y=f==="x"?"y":"x",E=c[f]===l[y],_=u[y]>d[y],M=u[y]<d[y];(c[f]===1&&(!E&&_||E&&M)||c[f]!==1&&(!E&&M||E&&_))&&(p=f==="x"?k:A)}let F={x:u.x+x.x,y:u.y+x.y},z={x:d.x+v.x,y:d.y+v.y},H=Math.max(Math.abs(F.x-p[0].x),Math.abs(z.x-p[0].x)),$=Math.max(Math.abs(F.y-p[0].y),Math.abs(z.y-p[0].y));H>=$?(S=(F.x+z.x)/2,b=p[0].y):(S=p[0].x,b=(F.y+z.y)/2)}let N={x:u.x+x.x,y:u.y+x.y},C={x:d.x+v.x,y:d.y+v.y};return[[e,...N.x!==p[0].x||N.y!==p[0].y?[N]:[],...p,...C.x!==p[p.length-1].x||C.y!==p[p.length-1].y?[C]:[],n],S,b,m,w]}o(Xd,"getPoints");function Zd(e,t,n,r){let i=Math.min(es(e,t)/2,es(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){let u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${s+i*u},${a}Q ${s},${a} ${s},${a+i*d}`}let c=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${s},${a+i*l}Q ${s},${a} ${s+i*c},${a}`}o(Zd,"getBend");function fn({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:i,targetPosition:s=X.Top,borderRadius:a=5,centerX:c,centerY:l,offset:u=20,stepPosition:d=.5}){let[h,f,g,p,S]=Xd({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:c,y:l},offset:u,stepPosition:d}),b=`M${h[0].x} ${h[0].y}`;for(let x=1;x<h.length-1;x++)b+=Zd(h[x-1],h[x],h[x+1],a);return b+=`L${h[h.length-1].x} ${h[h.length-1].y}`,[b,f,g,p,S]}o(fn,"getSmoothStepPath");function ts(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}o(ts,"isNodeInitialized");function ws(e){let{sourceNode:t,targetNode:n}=e;if(!ts(t)||!ts(n))return null;let r=t.internals.handleBounds||ns(t.handles),i=n.internals.handleBounds||ns(n.handles),s=os(r?.source??[],e.sourceHandle),a=os(e.connectionMode===Xe.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!s||!a)return e.onError?.("008",ye.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let c=s?.position||X.Bottom,l=a?.position||X.Top,u=Ze(t,s,c),d=Ze(n,a,l);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:c,targetPosition:l}}o(ws,"getEdgePosition");function ns(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}o(ns,"toHandleBounds");function Ze(e,t,n=X.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:c}=t??Se(e);if(r)return{x:i+a/2,y:s+c/2};switch(t?.position??n){case X.Top:return{x:i+a/2,y:s};case X.Right:return{x:i+a,y:s+c/2};case X.Bottom:return{x:i+a/2,y:s+c};case X.Left:return{x:i,y:s+c/2}}}o(Ze,"getHandlePosition");function os(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}o(os,"getHandle$1");function Xn(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}o(Xn,"getMarkerId");function bs(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let s=new Set;return e.reduce((a,c)=>([c.markerStart||r,c.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){let u=Xn(l,t);s.has(u)||(a.push({id:u,color:l.color||n,...l}),s.add(u))}}),a),[]).sort((a,c)=>a.id.localeCompare(c.id))}o(bs,"createMarkerIds");var Ss=1e3,Ud=10,Xr={nodeOrigin:[0,0],nodeExtent:Et,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},qd={...Xr,checkEquality:!0};function Zr(e,t){let n={...e};for(let r in t)t[r]!==void 0&&(n[r]=t[r]);return n}o(Zr,"mergeObjects");function vs(e,t,n){let r=Zr(Xr,n);for(let i of e.values())if(i.parentId)qr(i,e,t,r);else{let s=ln(i,r.nodeOrigin),a=lt(i.extent)?i.extent:r.nodeExtent,c=at(s,a,Se(i));i.internals.positionAbsolute=c}}o(vs,"updateAbsolutePositions");function Kd(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let i of e.handles){let s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}o(Kd,"parseHandles");function Ur(e){return e==="manual"}o(Ur,"isManualZIndexMode");function Zn(e,t,n,r={}){let i=Zr(qd,r),s={i:0},a=new Map(t),c=i?.elevateNodesOnSelect&&!Ur(i.zIndexMode)?Ss:0,l=e.length>0,u=!1;t.clear(),n.clear();for(let d of e){let h=a.get(d.id);if(i.checkEquality&&d===h?.internals.userNode)t.set(d.id,h);else{let f=ln(d,i.nodeOrigin),g=lt(d.extent)?d.extent:i.nodeExtent,p=at(f,g,Se(d));h={...i.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:p,handleBounds:Kd(d,h),z:Es(d,c,i.zIndexMode),userNode:d}},t.set(d.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(l=!1),d.parentId&&qr(h,t,n,r,s),u||=d.selected??!1}return{nodesInitialized:l,hasSelectedNodes:u}}o(Zn,"adoptUserNodes");function Gd(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}o(Gd,"updateParentLookup");function qr(e,t,n,r,i){let{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:c,zIndexMode:l}=Zr(Xr,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Gd(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*Ud),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);let h=s&&!Ur(l)?Ss:0,{x:f,y:g,z:p}=Qd(e,d,a,c,h,l),{positionAbsolute:S}=e.internals,b=f!==S.x||g!==S.y;(b||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:f,y:g}:S,z:p}})}o(qr,"updateChildNode");function Es(e,t,n){let r=we(e.zIndex)?e.zIndex:0;return Ur(n)?r:r+(e.selected?t:0)}o(Es,"calculateZ");function Qd(e,t,n,r,i,s){let{x:a,y:c}=t.internals.positionAbsolute,l=Se(e),u=ln(e,n),d=lt(e.extent)?at(u,e.extent,l):u,h=at({x:a+d.x,y:c+d.y},r,l);e.extent==="parent"&&(h=fs(h,l,t));let f=Es(e,i,s),g=t.internals.z??0;return{x:h.x,y:h.y,z:g>=f?g+1:f}}o(Qd,"calculateChildXYZ");function Un(e,t,n,r=[0,0]){let i=[],s=new Map;for(let a of e){let c=t.get(a.parentId);if(!c)continue;let l=s.get(a.parentId)?.expandedRect??_t(c),u=zr(l,a.rect);s.set(a.parentId,{expandedRect:u,parent:c})}return s.size>0&&s.forEach(({expandedRect:a,parent:c},l)=>{let u=c.internals.positionAbsolute,d=Se(c),h=c.origin??r,f=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,g=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,p=Math.max(d.width,Math.round(a.width)),S=Math.max(d.height,Math.round(a.height)),b=(p-d.width)*h[0],x=(S-d.height)*h[1];(f>0||g>0||b||x)&&(i.push({id:l,type:"position",position:{x:c.position.x-f+b,y:c.position.y-g+x}}),n.get(l)?.forEach(v=>{e.some(m=>m.id===v.id)||i.push({id:v.id,type:"position",position:{x:v.position.x+f,y:v.position.y+g}})})),(d.width<a.width||d.height<a.height||f||g)&&i.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:p+(f?h[0]*f-b:0),height:S+(g?h[1]*g-x:0)}})}),i}o(Un,"handleExpandParent");function Cs(e,t,n,r,i,s,a){let c=r?.querySelector(".xyflow__viewport"),l=!1;if(!c)return{changes:[],updatedInternals:l};let u=[],d=window.getComputedStyle(c),{m22:h}=new window.DOMMatrixReadOnly(d.transform),f=[];for(let g of e.values()){let p=t.get(g.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}let S=Vn(g.nodeElement),b=p.measured.width!==S.width||p.measured.height!==S.height;if(!!(S.width&&S.height&&(b||!p.internals.handleBounds||g.force))){let v=g.nodeElement.getBoundingClientRect(),m=lt(p.extent)?p.extent:s,{positionAbsolute:w}=p.internals;if(p.parentId&&p.extent==="parent"){let C=t.get(p.parentId);C&&(w=fs(w,S,C))}else m&&(w=at(w,m,S));let N={...p,measured:S,internals:{...p.internals,positionAbsolute:w,handleBounds:{source:Qi("source",g.nodeElement,v,h,p.id),target:Qi("target",g.nodeElement,v,h,p.id)}}};t.set(p.id,N),p.parentId&&qr(N,t,n,{nodeOrigin:i,zIndexMode:a}),l=!0,b&&(u.push({id:p.id,type:"dimensions",dimensions:S}),p.expandParent&&p.parentId&&f.push({id:p.id,parentId:p.parentId,rect:_t(N,i)}))}}if(f.length>0){let g=Un(f,t,n,i);u.push(...g)}return{changes:u,updatedInternals:l}}o(Cs,"updateNodeInternals");async function _s({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return!1;let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}o(_s,"panBy");function rs(e,t,n,r,i,s){let a=i,c=r.get(a)||new Map;r.set(a,c.set(n,t)),a=`${i}-${e}`;let l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),s){a=`${i}-${e}-${s}`;let u=r.get(a)||new Map;r.set(a,u.set(n,t))}}o(rs,"addConnectionToLookup");function Kr(e,t,n){e.clear(),t.clear();for(let r of n){let{source:i,target:s,sourceHandle:a=null,targetHandle:c=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:c},u=`${i}-${a}--${s}-${c}`,d=`${s}-${c}--${i}-${a}`;rs("source",l,d,e,i,a),rs("target",l,u,e,s,c),t.set(r.id,r)}}o(Kr,"updateConnectionLookup");function Ns(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Ns(n,t):!1}o(Ns,"isParentSelected");function is(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}o(is,"hasSelector");function Jd(e,t,n,r){let i=new Map;for(let[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!Ns(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){let c=e.get(s);c&&i.set(s,{id:s,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 i}o(Jd,"getDragItems");function _r({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[a,c]of t){let l=n.get(a)?.internals.userNode;l&&i.push({...l,position:c.position,dragging:r})}if(!e)return[i[0],i];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:r}:i[0],i]}o(_r,"getEventHandlerParams");function jd({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let s={x:n-i.distance.x,y:r-i.distance.y},a=Nt(s,t);return{x:a.x-s.x,y:a.y-s.y}}o(jd,"calculateSnapOffset");function Ms({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,c=new Map,l=!1,u={x:0,y:0},d=null,h=!1,f=null,g=!1,p=!1,S=null;function b({noDragClassName:v,handleSelector:m,domNode:w,isSelectable:N,nodeId:C,nodeClickDistance:I=0}){f=le(w);function k({x:H,y:$}){let{nodeLookup:y,nodeExtent:E,snapGrid:_,snapToGrid:M,nodeOrigin:D,onNodeDrag:R,onSelectionDrag:L,onError:V,updateNodePositions:B}=t();s={x:H,y:$};let U=!1,W=c.size>1,G=W&&E?Ir(Ct(c)):null,ee=W&&M?jd({dragItems:c,snapGrid:_,x:H,y:$}):null;for(let[K,O]of c){if(!y.has(K))continue;let Y={x:H-O.distance.x,y:$-O.distance.y};M&&(Y=ee?{x:Math.round(Y.x+ee.x),y:Math.round(Y.y+ee.y)}:Nt(Y,_));let j=null;if(W&&E&&!O.extent&&G){let{positionAbsolute:Q}=O.internals,te=Q.x-G.x+E[0][0],oe=Q.x+O.measured.width-G.x2+E[1][0],re=Q.y-G.y+E[0][1],de=Q.y+O.measured.height-G.y2+E[1][1];j=[[te,re],[oe,de]]}let{position:J,positionAbsolute:q}=Rr({nodeId:K,nextPosition:Y,nodeLookup:y,nodeExtent:j||E,nodeOrigin:D,onError:V});U=U||O.position.x!==J.x||O.position.y!==J.y,O.position=J,O.internals.positionAbsolute=q}if(p=p||U,!!U&&(B(c,!0),S&&(r||R||!C&&L))){let[K,O]=_r({nodeId:C,dragItems:c,nodeLookup:y});r?.(S,c,K,O),R?.(S,K,O),C||L?.(S,O)}}o(k,"updateNodes");async function A(){if(!d)return;let{transform:H,panBy:$,autoPanSpeed:y,autoPanOnNodeDrag:E}=t();if(!E){l=!1,cancelAnimationFrame(a);return}let[_,M]=$n(u,d,y);(_!==0||M!==0)&&(s.x=(s.x??0)-_/H[2],s.y=(s.y??0)-M/H[2],await $({x:_,y:M})&&k(s)),a=requestAnimationFrame(A)}o(A,"autoPan");function F(H){let{nodeLookup:$,multiSelectionActive:y,nodesDraggable:E,transform:_,snapGrid:M,snapToGrid:D,selectNodesOnDrag:R,onNodeDragStart:L,onSelectionDragStart:V,unselectNodesAndEdges:B}=t();h=!0,(!R||!N)&&!y&&C&&($.get(C)?.selected||B()),N&&R&&C&&e?.(C);let U=cn(H.sourceEvent,{transform:_,snapGrid:M,snapToGrid:D,containerBounds:d});if(s=U,c=Jd($,E,U,C),c.size>0&&(n||L||!C&&V)){let[W,G]=_r({nodeId:C,dragItems:c,nodeLookup:$});n?.(H.sourceEvent,c,W,G),L?.(H.sourceEvent,W,G),C||V?.(H.sourceEvent,G)}}o(F,"startDrag");let z=Ut().clickDistance(I).on("start",H=>{let{domNode:$,nodeDragThreshold:y,transform:E,snapGrid:_,snapToGrid:M}=t();d=$?.getBoundingClientRect()||null,g=!1,p=!1,S=H.sourceEvent,y===0&&F(H),s=cn(H.sourceEvent,{transform:E,snapGrid:_,snapToGrid:M,containerBounds:d}),u=be(H.sourceEvent,d)}).on("drag",H=>{let{autoPanOnNodeDrag:$,transform:y,snapGrid:E,snapToGrid:_,nodeDragThreshold:M,nodeLookup:D}=t(),R=cn(H.sourceEvent,{transform:y,snapGrid:E,snapToGrid:_,containerBounds:d});if(S=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||C&&!D.has(C))&&(g=!0),!g){if(!l&&$&&h&&(l=!0,A()),!h){let L=be(H.sourceEvent,d),V=L.x-u.x,B=L.y-u.y;Math.sqrt(V*V+B*B)>M&&F(H)}(s.x!==R.xSnapped||s.y!==R.ySnapped)&&c&&h&&(u=be(H.sourceEvent,d),k(R))}}).on("end",H=>{if(!h||g){g&&c.size>0&&t().updateNodePositions(c,!1);return}if(l=!1,h=!1,cancelAnimationFrame(a),c.size>0){let{nodeLookup:$,updateNodePositions:y,onNodeDragStop:E,onSelectionDragStop:_}=t();if(p&&(y(c,!1),p=!1),i||E||!C&&_){let[M,D]=_r({nodeId:C,dragItems:c,nodeLookup:$,dragging:!1});i?.(H.sourceEvent,c,M,D),E?.(H.sourceEvent,M,D),C||_?.(H.sourceEvent,D)}}}).filter(H=>{let $=H.target;return!H.button&&(!v||!is($,`.${v}`,w))&&(!m||is($,m,w))});f.call(z)}o(b,"update");function x(){f?.on(".drag",null)}return o(x,"destroy"),{update:b,destroy:x}}o(Ms,"XYDrag");function ef(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())dn(i,_t(s))>0&&r.push(s);return r}o(ef,"getNodesWithinDistance");var tf=250;function nf(e,t,n,r){let i=[],s=1/0,a=ef(e,n,t+tf);for(let c of a){let l=[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]];for(let u of l){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;let{x:d,y:h}=Ze(c,u,u.position,!0),f=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(h-e.y,2));f>t||(f<s?(i=[{...u,x:d,y:h}],s=f):f===s&&i.push({...u,x:d,y:h}))}}if(!i.length)return null;if(i.length>1){let c=r.type==="source"?"target":"source";return i.find(l=>l.type===c)??i[0]}return i[0]}o(nf,"getClosestHandle");function Is(e,t,n,r,i,s=!1){let a=r.get(e);if(!a)return null;let c=i==="strict"?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],l=(n?c?.find(u=>u.id===n):c?.[0])??null;return l&&s?{...l,...Ze(a,l,l.position,!0)}:l}o(Is,"getHandle");function Ps(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}o(Ps,"getHandleType");function of(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}o(of,"isConnectionValid");var ks=o(()=>!0,"alwaysValid");function rf(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:c,nodeLookup:l,lib:u,autoPanOnConnect:d,flowId:h,panBy:f,cancelConnection:g,onConnectStart:p,onConnect:S,onConnectEnd:b,isValidConnection:x=ks,onReconnectEnd:v,updateConnection:m,getTransform:w,getFromHandle:N,autoPanSpeed:C,dragThreshold:I=1,handleDomNode:k}){let A=Vr(e.target),F=0,z,{x:H,y:$}=be(e),y=Ps(s,k),E=c?.getBoundingClientRect(),_=!1;if(!E||!y)return;let M=Is(i,y,r,l,t);if(!M)return;let D=be(e,E),R=!1,L=null,V=!1,B=null;function U(){if(!d||!E)return;let[J,q]=$n(D,E,C);f({x:J,y:q}),F=requestAnimationFrame(U)}o(U,"autoPan");let W={...M,nodeId:i,type:y,position:M.position},G=l.get(i),K={inProgress:!0,isValid:null,from:Ze(G,W,X.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:G,to:D,toHandle:null,toPosition:Ki[W.position],toNode:null,pointer:D};function O(){_=!0,m(K),p?.(e,{nodeId:i,handleId:r,handleType:y})}o(O,"startConnection"),I===0&&O();function Y(J){if(!_){let{x:de,y:Pe}=be(J),_e=de-H,Ne=Pe-$;if(!(_e*_e+Ne*Ne>I*I))return;O()}if(!N()||!W){j(J);return}let q=w();D=be(J,E),z=nf(Mt(D,q,!1,[1,1]),n,l,W),R||(U(),R=!0);let Q=As(J,{handle:z,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:x,doc:A,lib:u,flowId:h,nodeLookup:l});B=Q.handleDomNode,L=Q.connection,V=of(!!z,Q.isValid);let te=l.get(i),oe=te?Ze(te,W,X.Left,!0):K.from,re={...K,from:oe,isValid:V,to:Q.toHandle&&V?ct({x:Q.toHandle.x,y:Q.toHandle.y},q):D,toHandle:Q.toHandle,toPosition:V&&Q.toHandle?Q.toHandle.position:Ki[W.position],toNode:Q.toHandle?l.get(Q.toHandle.nodeId):null,pointer:D};m(re),K=re}o(Y,"onPointerMove");function j(J){if(!("touches"in J&&J.touches.length>0)){if(_){(z||B)&&L&&V&&S?.(L);let{inProgress:q,...Q}=K,te={...Q,toPosition:K.toHandle?K.toPosition:null};b?.(J,te),s&&v?.(J,te)}g(),cancelAnimationFrame(F),R=!1,V=!1,L=null,B=null,A.removeEventListener("mousemove",Y),A.removeEventListener("mouseup",j),A.removeEventListener("touchmove",Y),A.removeEventListener("touchend",j)}}o(j,"onPointerUp"),A.addEventListener("mousemove",Y),A.addEventListener("mouseup",j),A.addEventListener("touchmove",Y),A.addEventListener("touchend",j)}o(rf,"onPointerDown");function As(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:c,flowId:l,isValidConnection:u=ks,nodeLookup:d}){let h=s==="target",f=t?a.querySelector(`.${c}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:p}=be(e),S=a.elementFromPoint(g,p),b=S?.classList.contains(`${c}-flow__handle`)?S:f,x={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){let v=Ps(void 0,b),m=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),N=b.classList.contains("connectable"),C=b.classList.contains("connectableend");if(!m||!v)return x;let I={source:h?m:r,sourceHandle:h?w:i,target:h?r:m,targetHandle:h?i:w};x.connection=I;let A=N&&C&&(n===Xe.Strict?h&&v==="source"||!h&&v==="target":m!==r||w!==i);x.isValid=A&&u(I),x.toHandle=Is(m,v,w,d,n,!0)}return x}o(As,"isValidHandle");var qn={onPointerDown:rf,isValid:As};function Ts({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=le(e);function s({translateExtent:c,width:l,height:u,zoomStep:d=1,pannable:h=!0,zoomable:f=!0,inversePan:g=!1}){let p=o(m=>{if(m.sourceEvent.type!=="wheel"||!t)return;let w=n(),N=m.sourceEvent.ctrlKey&&It()?10:1,C=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*d,I=w[2]*Math.pow(2,C*N);t.scaleTo(I)},"zoomHandler"),S=[0,0],b=o(m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(S=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},"panStartHandler"),x=o(m=>{let w=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;let N=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],C=[N[0]-S[0],N[1]-S[1]];S=N;let I=r()*Math.max(w[2],Math.log(w[2]))*(g?-1:1),k={x:w[0]-C[0]*I,y:w[1]-C[1]*I},A=[[0,0],[l,u]];t.setViewportConstrained({x:k.x,y:k.y,zoom:w[2]},A,c)},"panHandler"),v=an().on("start",b).on("zoom",h?x:null).on("zoom.wheel",f?p:null);i.call(v,{})}o(s,"update");function a(){i.on("zoom",null)}return o(a,"destroy"),{update:s,destroy:a,pointer:he}}o(Ts,"XYMinimap");var Kn=o(e=>({x:e.x,y:e.y,zoom:e.k}),"transformToViewport"),Nr=o(({x:e,y:t,zoom:n})=>rt.translate(e,t).scale(n),"viewportToTransform"),Ye=o((e,t)=>e.target.closest(`.${t}`),"isWrappedWithClass"),Ds=o((e,t)=>t===2&&Array.isArray(e)&&e.includes(2),"isRightClickPan"),sf=o(e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,"defaultEase"),Mr=o((e,t=0,n=sf,r=()=>{})=>{let i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},"getD3Transition"),Rs=o(e=>{let t=e.ctrlKey&&It()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},"wheelDelta");function af({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:u}){return d=>{if(Ye(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let h=n.property("__zoom").k||1;if(d.ctrlKey&&a){let b=he(d),x=Rs(d),v=h*Math.pow(2,x);r.scaleTo(n,v,b,d);return}let f=d.deltaMode===1?20:1,g=i===$e.Vertical?0:d.deltaX*f,p=i===$e.Horizontal?0:d.deltaY*f;!It()&&d.shiftKey&&i!==$e.Vertical&&(g=d.deltaY*f,p=0),r.translateBy(n,-(g/h)*s,-(p/h)*s,{internal:!0});let S=Kn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?l?.(d,S):(e.isPanScrolling=!0,c?.(d,S)),e.panScrollTimeout=setTimeout(()=>{u?.(d,S),e.isPanScrolling=!1},150)}}o(af,"createPanOnScrollHandler");function cf({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,c=Ye(r,e);if(r.ctrlKey&&s&&c&&r.preventDefault(),a||c)return null;r.preventDefault(),n.call(this,r,i)}}o(cf,"createZoomOnScrollHandler");function lf({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Kn(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}o(lf,"createPanZoomStartHandler");function uf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{e.usedRightMouseButton=!!(n&&Ds(t,e.mouseButton??0)),s.sourceEvent?.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!s.sourceEvent?.internal&&i?.(s.sourceEvent,Kn(s.transform))}}o(uf,"createPanZoomHandler");function df({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Ds(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let c=Kn(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(a.sourceEvent,c)},n?150:0)}}}o(df,"createPanZoomEndHandler");function ff({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:a,userSelectionActive:c,noWheelClassName:l,noPanClassName:u,lib:d,connectionInProgress:h}){return f=>{let g=t||n,p=r&&f.ctrlKey,S=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Ye(f,`${d}-flow__node`)||Ye(f,`${d}-flow__edge`)||Ye(f,`${d}-flow__selection`)||Ye(f,`${d}-flow__nodesselection`)))return!0;if(!i&&!g&&!s&&!a&&!r||c||h&&!S||Ye(f,l)&&S||Ye(f,u)&&(!S||s&&S&&!t)||!r&&f.ctrlKey&&S)return!1;if(!r&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!g&&!s&&!p&&S||!i&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(i)&&!i.includes(f.button)&&f.type==="mousedown")return!1;let b=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||S||e)&&b}}o(ff,"createFilter");function zs({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:l}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),h=[[0,0],[d.width,d.height]];(typeof ResizeObserver<"u"?new ResizeObserver($=>{let y=$[0];y&&(h=[[0,0],[y.contentRect.width,y.contentRect.height]])}):null)?.observe(e);let g=an().extent(()=>h).scaleExtent([t,n]).translateExtent(r),p=le(e).call(g);w({x:i.x,y:i.y,zoom:vt(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);let S=p.on("wheel.zoom"),b=p.on("dblclick.zoom");g.wheelDelta(Rs);async function x($,y){return p?new Promise(E=>{g?.interpolate(y?.interpolate==="linear"?yn:pt).transform(Mr(p,y?.duration,y?.ease,()=>E(!0)),$)}):!1}o(x,"setTransform");function v({noWheelClassName:$,noPanClassName:y,onPaneContextMenu:E,userSelectionActive:_,panOnScroll:M,panOnDrag:D,panOnScrollMode:R,panOnScrollSpeed:L,preventScrolling:V,zoomOnPinch:B,zoomOnScroll:U,zoomOnDoubleClick:W,panActivationKeyPressed:G=!1,zoomActivationKeyPressed:ee,lib:K,onTransformChange:O,connectionInProgress:Y,paneClickDistance:j,selectionOnDrag:J}){_&&!u.isZoomingOrPanning&&m();let q=M&&!ee&&!_;g.clickDistance(J?1/0:!we(j)||j<0?0:j);let Q=q?af({zoomPanValues:u,noWheelClassName:$,d3Selection:p,d3Zoom:g,panOnScrollMode:R,panOnScrollSpeed:L,zoomOnPinch:B,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:c}):cf({noWheelClassName:$,preventScrolling:V,d3ZoomHandler:S});p.on("wheel.zoom",Q,{passive:!1});let te=lf({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});g.on("start",te);let oe=uf({zoomPanValues:u,panOnDrag:D,onPaneContextMenu:!!E,onPanZoom:s,onTransformChange:O});g.on("zoom",oe);let re=df({zoomPanValues:u,panOnDrag:D,panOnScroll:M,onPaneContextMenu:E,onPanZoomEnd:c,onDraggingChange:l});g.on("end",re);let de=ff({panActivationKeyPressed:G,zoomActivationKeyPressed:ee,panOnDrag:D,zoomOnScroll:U,panOnScroll:M,zoomOnDoubleClick:W,zoomOnPinch:B,userSelectionActive:_,noPanClassName:y,noWheelClassName:$,lib:K,connectionInProgress:Y});g.filter(de),W?p.on("dblclick.zoom",b):p.on("dblclick.zoom",null)}o(v,"update");function m(){g.on("zoom",null)}o(m,"destroy");async function w($,y,E){let _=Nr($),M=g?.constrain()(_,y,E);return M&&await x(M),M}o(w,"setViewportConstrained");async function N($,y){let E=Nr($);return await x(E,y),E}o(N,"setViewport");function C($){if(p){let y=Nr($),E=p.property("__zoom");(E.k!==$.zoom||E.x!==$.x||E.y!==$.y)&&g?.transform(p,y,null,{sync:!0})}}o(C,"syncViewport");function I(){let $=p?sn(p.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}o(I,"getViewport");async function k($,y){return p?new Promise(E=>{g?.interpolate(y?.interpolate==="linear"?yn:pt).scaleTo(Mr(p,y?.duration,y?.ease,()=>E(!0)),$)}):!1}o(k,"scaleTo");async function A($,y){return p?new Promise(E=>{g?.interpolate(y?.interpolate==="linear"?yn:pt).scaleBy(Mr(p,y?.duration,y?.ease,()=>E(!0)),$)}):!1}o(A,"scaleBy");function F($){g?.scaleExtent($)}o(F,"setScaleExtent");function z($){g?.translateExtent($)}o(z,"setTranslateExtent");function H($){let y=!we($)||$<0?0:$;g?.clickDistance(y)}return o(H,"setClickDistance"),{update:v,destroy:m,setViewport:N,setViewportConstrained:w,getViewport:I,scaleTo:k,scaleBy:A,setScaleExtent:F,setTranslateExtent:z,syncViewport:C,setClickDistance:H}}o(zs,"XYPanZoom");var Ue;(function(e){e.Line="line",e.Handle="handle"})(Ue||(Ue={}));function hf({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){let a=e-t,c=n-r,l=[a>0?1:a<0?-1:0,c>0?1:c<0?-1:0];return a&&i&&(l[0]=l[0]*-1),c&&s&&(l[1]=l[1]*-1),l}o(hf,"getResizeDirection");function ss(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}o(ss,"getControlDirection");function Fe(e,t){return Math.max(0,t-e)}o(Fe,"getLowerExtentClamp");function We(e,t){return Math.max(0,e-t)}o(We,"getUpperExtentClamp");function Rn(e,t,n){return Math.max(0,t-e,e-n)}o(Rn,"getSizeClamp");function as(e,t){return e?!t:t}o(as,"xor");function pf(e,t,n,r,i,s,a,c){let{affectsX:l,affectsY:u}=t,{isHorizontal:d,isVertical:h}=t,f=d&&h,{xSnapped:g,ySnapped:p}=n,{minWidth:S,maxWidth:b,minHeight:x,maxHeight:v}=r,{x:m,y:w,width:N,height:C,aspectRatio:I}=e,k=Math.floor(d?g-e.pointerX:0),A=Math.floor(h?p-e.pointerY:0),F=N+(l?-k:k),z=C+(u?-A:A),H=-s[0]*N,$=-s[1]*C,y=Rn(F,S,b),E=Rn(z,x,v);if(a){let D=0,R=0;l&&k<0?D=Fe(m+k+H,a[0][0]):!l&&k>0&&(D=We(m+F+H,a[1][0])),u&&A<0?R=Fe(w+A+$,a[0][1]):!u&&A>0&&(R=We(w+z+$,a[1][1])),y=Math.max(y,D),E=Math.max(E,R)}if(c){let D=0,R=0;l&&k>0?D=We(m+k,c[0][0]):!l&&k<0&&(D=Fe(m+F,c[1][0])),u&&A>0?R=We(w+A,c[0][1]):!u&&A<0&&(R=Fe(w+z,c[1][1])),y=Math.max(y,D),E=Math.max(E,R)}if(i){if(d){let D=Rn(F/I,x,v)*I;if(y=Math.max(y,D),a){let R=0;!l&&!u||l&&!u&&f?R=We(w+$+F/I,a[1][1])*I:R=Fe(w+$+(l?k:-k)/I,a[0][1])*I,y=Math.max(y,R)}if(c){let R=0;!l&&!u||l&&!u&&f?R=Fe(w+F/I,c[1][1])*I:R=We(w+(l?k:-k)/I,c[0][1])*I,y=Math.max(y,R)}}if(h){let D=Rn(z*I,S,b)/I;if(E=Math.max(E,D),a){let R=0;!l&&!u||u&&!l&&f?R=We(m+z*I+H,a[1][0])/I:R=Fe(m+(u?A:-A)*I+H,a[0][0])/I,E=Math.max(E,R)}if(c){let R=0;!l&&!u||u&&!l&&f?R=Fe(m+z*I,c[1][0])/I:R=We(m+(u?A:-A)*I,c[0][0])/I,E=Math.max(E,R)}}}A=A+(A<0?E:-E),k=k+(k<0?y:-y),i&&(f?F>z*I?A=(as(l,u)?-k:k)/I:k=(as(l,u)?-A:A)*I:d?(A=k/I,u=l):(k=A*I,l=u));let _=l?m+k:m,M=u?w+A:w;return{width:N+(l?-k:k),height:C+(u?-A:A),x:s[0]*k*(l?-1:1)+_,y:s[1]*A*(u?-1:1)+M}}o(pf,"getDimensionsAfterResize");var Os={width:0,height:0,x:0,y:0},gf={...Os,pointerX:0,pointerY:0,aspectRatio:1};function mf(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,c=n[0]*s,l=n[1]*a;return[[r-c,i-l],[r+s-c,i+a-l]]}o(mf,"nodeToChildExtent");function $s({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let s=le(e),a={controlDirection:ss("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:u,boundaries:d,keepAspectRatio:h,resizeDirection:f,onResizeStart:g,onResize:p,onResizeEnd:S,shouldResize:b}){let x={...Os},v={...gf};a={boundaries:d,resizeDirection:f,keepAspectRatio:h,controlDirection:ss(u)};let m,w=null,N=[],C,I,k,A=!1,F=Ut().on("start",z=>{let{nodeLookup:H,transform:$,snapGrid:y,snapToGrid:E,nodeOrigin:_,paneDomNode:M}=n();if(m=H.get(t),!m)return;w=M?.getBoundingClientRect()??null;let{xSnapped:D,ySnapped:R}=cn(z.sourceEvent,{transform:$,snapGrid:y,snapToGrid:E,containerBounds:w});x={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},v={...x,pointerX:D,pointerY:R,aspectRatio:x.width/x.height},C=void 0,I=lt(m.extent)?m.extent:void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(C=H.get(m.parentId)),C&&m.extent==="parent"&&(I=[[0,0],[C.measured.width,C.measured.height]]),N=[],k=void 0;for(let[L,V]of H)if(V.parentId===t&&(N.push({id:L,position:{...V.position},extent:V.extent}),V.extent==="parent"||V.expandParent)){let B=mf(V,m,V.origin??_);k?k=[[Math.min(B[0][0],k[0][0]),Math.min(B[0][1],k[0][1])],[Math.max(B[1][0],k[1][0]),Math.max(B[1][1],k[1][1])]]:k=B}g?.(z,{...x})}).on("drag",z=>{let{transform:H,snapGrid:$,snapToGrid:y,nodeOrigin:E}=n(),_=cn(z.sourceEvent,{transform:H,snapGrid:$,snapToGrid:y,containerBounds:w}),M=[];if(!m)return;let{x:D,y:R,width:L,height:V}=x,B={},U=m.origin??E,{width:W,height:G,x:ee,y:K}=pf(v,a.controlDirection,_,a.boundaries,a.keepAspectRatio,U,I,k),O=W!==L,Y=G!==V,j=ee!==D&&O,J=K!==R&&Y;if(!j&&!J&&!O&&!Y)return;if((j||J||U[0]===1||U[1]===1)&&(B.x=j?ee:x.x,B.y=J?K:x.y,x.x=B.x,x.y=B.y,N.length>0)){let oe=ee-D,re=K-R;for(let de of N)de.position={x:de.position.x-oe+U[0]*(W-L),y:de.position.y-re+U[1]*(G-V)},M.push(de)}if((O||Y)&&(B.width=O&&(!a.resizeDirection||a.resizeDirection==="horizontal")?W:x.width,B.height=Y&&(!a.resizeDirection||a.resizeDirection==="vertical")?G:x.height,x.width=B.width,x.height=B.height),C&&m.expandParent){let oe=U[0]*(B.width??0);B.x&&B.x<oe&&(x.x=oe,v.x=v.x-(B.x-oe));let re=U[1]*(B.height??0);B.y&&B.y<re&&(x.y=re,v.y=v.y-(B.y-re))}let q=hf({width:x.width,prevWidth:L,height:x.height,prevHeight:V,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),Q={...x,direction:q};b?.(z,Q)!==!1&&(A=!0,p?.(z,Q),r(B,M))}).on("end",z=>{A&&(S?.(z,{...x}),i?.({...x}),A=!1)});s.call(F)}o(c,"update");function l(){s.on(".drag",null)}return o(l,"destroy"),{update:c,destroy:l}}o($s,"XYResizer");var Vs=Le(uo(),1),Fs=Le(Fl(),1);var Ls=o(e=>{let t,n=new Set,r=o((d,h)=>{let f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){let g=t;t=h??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(p=>p(t,g))}},"setState"),i=o(()=>t,"getState"),l={setState:r,getState:i,getInitialState:o(()=>u,"getInitialState"),subscribe:o(d=>(n.add(d),()=>n.delete(d)),"subscribe"),destroy:o(()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()},"destroy")},u=t=e(r,i,l);return l},"createStoreImpl"),Hs=o(e=>e?Ls(e):Ls,"createStore");var{useDebugValue:yf}=Vs.default,{useSyncExternalStoreWithSelector:xf}=Fs.default,wf=o(e=>e,"identity");function Gr(e,t=wf,n){let r=xf(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return yf(r),r}o(Gr,"useStoreWithEqualityFn");var Bs=o((e,t)=>{let n=Hs(e),r=o((i,s=t)=>Gr(n,i,s),"useBoundStoreWithEqualityFn");return Object.assign(r,n),r},"createWithEqualityFnImpl"),Ws=o((e,t)=>e?Bs(e,t):Bs,"createWithEqualityFn");function ie(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(let[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}o(ie,"shallow$1");var bf=Le(Bl());var jn=(0,P.createContext)(null),Sf=jn.Provider,ma=ye.error001("react");function ne(e,t){let n=(0,P.useContext)(jn);if(n===null)throw new Error(ma);return Gr(n,e,t)}o(ne,"useStore");function se(){let e=(0,P.useContext)(jn);if(e===null)throw new Error(ma);return(0,P.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}o(se,"useStoreApi");var Ys={display:"none"},vf={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",xa="react-flow__edge-desc",Ef="react-flow__aria-live",Cf=o(e=>e.ariaLiveMessage,"ariaLiveSelector"),_f=o(e=>e.ariaLabelConfig,"ariaLabelConfigSelector");function Nf({rfId:e}){let t=ne(Cf);return(0,T.jsx)("div",{id:`${Ef}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vf,children:t})}o(Nf,"AriaLiveMessage");function Mf({rfId:e,disableKeyboardA11y:t}){let n=ne(_f);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{id:`${ya}-${e}`,style:Ys,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,T.jsx)("div",{id:`${xa}-${e}`,style:Ys,children:n["edge.a11yDescription.default"]}),!t&&(0,T.jsx)(Nf,{rfId:e})]})}o(Mf,"A11yDescriptions");var Ke=(0,P.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{let a=`${e}`.split("-");return(0,T.jsx)("div",{className:ae(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});Ke.displayName="Panel";var Xs="https://reactflow.dev?utm_source=attribution";function If({proOptions:e,position:t="bottom-right"}){return(0,P.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,T.jsx)(Ke,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Xs}`,children:(0,T.jsx)("a",{href:Xs,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}o(If,"Attribution");var Pf=o(e=>{let t=[],n=[];for(let[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(let[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},"selector$l"),Gn=o(e=>e.id,"selectId");function kf(e,t){return ie(e.selectedNodes.map(Gn),t.selectedNodes.map(Gn))&&ie(e.selectedEdges.map(Gn),t.selectedEdges.map(Gn))}o(kf,"areEqual$1");function Af({onSelectionChange:e}){let t=se(),{selectedNodes:n,selectedEdges:r}=ne(Pf,kf);return(0,P.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}o(Af,"SelectionListenerInner");var Tf=o(e=>!!e.onSelectionChangeHandlers,"changeSelector");function Df({onSelectionChange:e}){let t=ne(Tf);return e||t?(0,T.jsx)(Af,{onSelectionChange:e}):null}o(Df,"SelectionListener");var wa=[0,0],Rf={x:0,y:0,zoom:1},zf=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Zs=[...zf,"rfId"],Of=o(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}),"selector$k"),Us={translateExtent:Et,nodeOrigin:wa,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function $f(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:c,setDefaultNodesAndEdges:l}=ne(Of,ie),u=se();(0,P.useEffect)(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=Us,c()}),[]);let d=(0,P.useRef)(Us);return(0,P.useEffect)(()=>{for(let h of Zs){let f=e[h],g=d.current[h];f!==g&&(typeof e[h]>"u"||(h==="nodes"?t(f):h==="edges"?n(f):h==="minZoom"?r(f):h==="maxZoom"?i(f):h==="translateExtent"?s(f):h==="nodeExtent"?a(f):h==="ariaLabelConfig"?u.setState({ariaLabelConfig:gs(f)}):h==="fitView"?u.setState({fitViewQueued:f}):h==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[h]:f})))}d.current=e},Zs.map(h=>e[h])),null}o($f,"StoreUpdater");function qs(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}o(qs,"getMediaQuery");function Lf(e){let[t,n]=(0,P.useState)(e==="system"?null:e);return(0,P.useEffect)(()=>{if(e!=="system"){n(e);return}let r=qs(),i=o(()=>n(r?.matches?"dark":"light"),"updateColorModeClass");return i(),r?.addEventListener("change",i),()=>{r?.removeEventListener("change",i)}},[e]),t!==null?t:qs()?.matches?"dark":"light"}o(Lf,"useColorModeClass");var Ks=typeof document<"u"?document:null;function hn(e=null,t={target:Ks,actInsideInputWithModifier:!0}){let[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(!1),s=(0,P.useRef)(new Set([])),[a,c]=(0,P.useMemo)(()=>{if(e!==null){let u=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace(/\+/g,`
2
+ `).replace(`
3
+
4
+ `,`
5
+ +`).split(`
6
+ `)),d=u.reduce((h,f)=>h.concat(...f),[]);return[u,d]}return[[],[]]},[e]);return(0,P.useEffect)(()=>{let l=t?.target??Ks,u=t?.actInsideInputWithModifier??!0;if(e!==null){let d=o(g=>{if(i.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!i.current||i.current&&!u)&&Fr(g))return!1;let S=Qs(g.code,c);if(s.current.add(g[S]),Gs(a,s.current,!1)){let b=g.composedPath?.()?.[0]||g.target,x=b?.nodeName==="BUTTON"||b?.nodeName==="A";t.preventDefault!==!1&&(i.current||!x)&&g.preventDefault(),r(!0)}},"downHandler"),h=o(g=>{let p=Qs(g.code,c);Gs(a,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(g[p]),g.key==="Meta"&&s.current.clear(),i.current=!1},"upHandler"),f=o(()=>{s.current.clear(),r(!1)},"resetHandler");return l?.addEventListener("keydown",d),l?.addEventListener("keyup",h),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{l?.removeEventListener("keydown",d),l?.removeEventListener("keyup",h),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}o(hn,"useKeyPress");function Gs(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}o(Gs,"isMatchingKey");function Qs(e,t){return t.includes(e)?"code":"key"}o(Qs,"useKeyOrCode");var Hf=o(()=>{let e=se();return(0,P.useMemo)(()=>({zoomIn:o(async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},"zoomIn"),zoomOut:o(async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},"zoomOut"),zoomTo:o(async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},"zoomTo"),getZoom:o(()=>e.getState().transform[2],"getZoom"),setViewport:o(async(t,n)=>{let{transform:[r,i,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??s},n),!0):!1},"setViewport"),getViewport:o(()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},"getViewport"),setCenter:o(async(t,n,r)=>e.getState().setCenter(t,n,r),"setCenter"),fitBounds:o(async(t,n)=>{let{width:r,height:i,minZoom:s,maxZoom:a,panZoom:c}=e.getState(),l=ut(t,r,i,s,a,n?.padding??.1);return c?(await c.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},"fitBounds"),screenToFlowPosition:o((t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:s,domNode:a}=e.getState();if(!a)return t;let{x:c,y:l}=a.getBoundingClientRect(),u={x:t.x-c,y:t.y-l},d=n.snapGrid??i,h=n.snapToGrid??s;return Mt(u,r,h,d)},"screenToFlowPosition"),flowToScreenPosition:o(t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:s}=r.getBoundingClientRect(),a=ct(t,n);return{x:a.x+i,y:a.y+s}},"flowToScreenPosition")}),[])},"useViewportHelper");function ba(e,t){let n=[],r=new Map,i=[];for(let s of e)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{let a=r.get(s.id);a?a.push(s):r.set(s.id,[s])}for(let s of t){let a=r.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}let c={...s};for(let l of a)Bf(l,c);n.push(c)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}o(ba,"applyChanges");function Bf(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={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}o(Bf,"applyChange");function Sa(e,t){return ba(e,t)}o(Sa,"applyNodeChanges");function va(e,t){return ba(e,t)}o(va,"applyEdgeChanges");function dt(e,t){return{id:e,type:"select",selected:t}}o(dt,"createSelectionChange");function Pt(e,t=new Set,n=!1){let r=[];for(let[i,s]of e){let a=t.has(i);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),r.push(dt(s.id,a)))}return r}o(Pt,"getSelectionChanges");function Js({items:e=[],lookup:t}){let n=[],r=new Map(e.map(i=>[i.id,i]));for(let[i,s]of e.entries()){let a=t.get(s.id),c=a?.internals?.userNode??a;c!==void 0&&c!==s&&n.push({id:s.id,item:s,type:"replace"}),c===void 0&&n.push({item:s,type:"add",index:i})}for(let[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}o(Js,"getElementsDiffChanges");function js(e){return{id:e.id,type:"remove"}}o(js,"elementToRemoveChange");var Vf=$r("React Flow","https://reactflow.dev/");function Ff(e,t,n={}){return xs(e,t,{...n,onError:n.onError??Vf})}o(Ff,"addEdge");var ea=o(e=>cs(e),"isNode"),Wf=o(e=>Tr(e),"isEdge");function Ea(e){return(0,P.forwardRef)(e)}o(Ea,"fixedForwardRef");var Ca=typeof window<"u"?P.useLayoutEffect:P.useEffect;function ta(e){let[t,n]=(0,P.useState)(BigInt(0)),[r]=(0,P.useState)(()=>Yf(()=>n(i=>i+BigInt(1))));return Ca(()=>{let i=r.get();i.length&&(e(i),r.reset())},[t]),r}o(ta,"useQueue");function Yf(e){let t=[];return{get:o(()=>t,"get"),reset:o(()=>{t=[]},"reset"),push:o(n=>{t.push(n),e()},"push")}}o(Yf,"createQueue");var _a=(0,P.createContext)(null);function Xf({children:e}){let t=se(),n=(0,P.useCallback)(c=>{let{nodes:l=[],setNodes:u,hasDefaultNodes:d,onNodesChange:h,nodeLookup:f,fitViewQueued:g,onNodesChangeMiddlewareMap:p}=t.getState(),S=l;for(let x of c)S=typeof x=="function"?x(S):x;let b=Js({items:S,lookup:f});for(let x of p.values())b=x(b);d&&u(S),b.length>0?h?.(b):g&&window.requestAnimationFrame(()=>{let{fitViewQueued:x,nodes:v,setNodes:m}=t.getState();x&&m(v)})},[]),r=ta(n),i=(0,P.useCallback)(c=>{let{edges:l=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:h,edgeLookup:f}=t.getState(),g=l;for(let p of c)g=typeof p=="function"?p(g):p;d?u(g):h&&h(Js({items:g,lookup:f}))},[]),s=ta(i),a=(0,P.useMemo)(()=>({nodeQueue:r,edgeQueue:s}),[]);return(0,T.jsx)(_a.Provider,{value:a,children:e})}o(Xf,"BatchProvider");function Zf(){let e=(0,P.useContext)(_a);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}o(Zf,"useBatchContext");var Uf=o(e=>!!e.panZoom,"selector$j");function kt(){let e=Hf(),t=se(),n=Zf(),r=ne(Uf),i=(0,P.useMemo)(()=>{let s=o(h=>t.getState().nodeLookup.get(h),"getInternalNode"),a=o(h=>{n.nodeQueue.push(h)},"setNodes"),c=o(h=>{n.edgeQueue.push(h)},"setEdges"),l=o(h=>{let{nodeLookup:f,nodeOrigin:g}=t.getState(),p=ea(h)?h:f.get(h.id),S=p.parentId?Lr(p.position,p.measured,p.parentId,f,g):p.position,b={...p,position:S,width:p.measured?.width??p.width,height:p.measured?.height??p.height};return _t(b)},"getNodeRect"),u=o((h,f,g={replace:!1})=>{a(p=>p.map(S=>{if(S.id===h){let b=typeof f=="function"?f(S):f;return g.replace&&ea(b)?b:{...S,...b}}return S}))},"updateNode"),d=o((h,f,g={replace:!1})=>{c(p=>p.map(S=>{if(S.id===h){let b=typeof f=="function"?f(S):f;return g.replace&&Wf(b)?b:{...S,...b}}return S}))},"updateEdge");return{getNodes:o(()=>t.getState().nodes.map(h=>({...h})),"getNodes"),getNode:o(h=>s(h)?.internals.userNode,"getNode"),getInternalNode:s,getEdges:o(()=>{let{edges:h=[]}=t.getState();return h.map(f=>({...f}))},"getEdges"),getEdge:o(h=>t.getState().edgeLookup.get(h),"getEdge"),setNodes:a,setEdges:c,addNodes:o(h=>{let f=Array.isArray(h)?h:[h];n.nodeQueue.push(g=>[...g,...f])},"addNodes"),addEdges:o(h=>{let f=Array.isArray(h)?h:[h];n.edgeQueue.push(g=>[...g,...f])},"addEdges"),toObject:o(()=>{let{nodes:h=[],edges:f=[],transform:g}=t.getState(),[p,S,b]=g;return{nodes:h.map(x=>({...x})),edges:f.map(x=>({...x})),viewport:{x:p,y:S,zoom:b}}},"toObject"),deleteElements:o(async({nodes:h=[],edges:f=[]})=>{let{nodes:g,edges:p,onNodesDelete:S,onEdgesDelete:b,triggerNodeChanges:x,triggerEdgeChanges:v,onDelete:m,onBeforeDelete:w}=t.getState(),{nodes:N,edges:C}=await ds({nodesToRemove:h,edgesToRemove:f,nodes:g,edges:p,onBeforeDelete:w}),I=C.length>0,k=N.length>0;if(I){let A=C.map(js);b?.(C),v(A)}if(k){let A=N.map(js);S?.(N),x(A)}return(k||I)&&m?.({nodes:N,edges:C}),{deletedNodes:N,deletedEdges:C}},"deleteElements"),getIntersectingNodes:o((h,f=!0,g)=>{let p=Or(h),S=p?h:l(h),b=g!==void 0;return S?(g||t.getState().nodes).filter(x=>{let v=t.getState().nodeLookup.get(x.id);if(v&&!p&&(x.id===h.id||!v.internals.positionAbsolute))return!1;let m=_t(b?x:v),w=dn(m,S);return f&&w>0||w>=m.width*m.height||w>=S.width*S.height}):[]},"getIntersectingNodes"),isNodeIntersecting:o((h,f,g=!0)=>{let S=Or(h)?h:l(h);if(!S)return!1;let b=dn(S,f);return g&&b>0||b>=f.width*f.height||b>=S.width*S.height},"isNodeIntersecting"),updateNode:u,updateNodeData:o((h,f,g={replace:!1})=>{u(h,p=>{let S=typeof f=="function"?f(p):f;return g.replace?{...p,data:S}:{...p,data:{...p.data,...S}}},g)},"updateNodeData"),updateEdge:d,updateEdgeData:o((h,f,g={replace:!1})=>{d(h,p=>{let S=typeof f=="function"?f(p):f;return g.replace?{...p,data:S}:{...p,data:{...p.data,...S}}},g)},"updateEdgeData"),getNodesBounds:o(h=>{let{nodeLookup:f,nodeOrigin:g}=t.getState();return un(h,{nodeLookup:f,nodeOrigin:g})},"getNodesBounds"),getHandleConnections:o(({type:h,id:f,nodeId:g})=>Array.from(t.getState().connectionLookup.get(`${g}-${h}${f?`-${f}`:""}`)?.values()??[]),"getHandleConnections"),getNodeConnections:o(({type:h,handleId:f,nodeId:g})=>Array.from(t.getState().connectionLookup.get(`${g}${h?f?`-${h}-${f}`:`-${h}`:""}`)?.values()??[]),"getNodeConnections"),fitView:o(async h=>{let f=t.getState().fitViewResolver??ps();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:f}),n.nodeQueue.push(g=>[...g]),f.promise},"fitView")}},[]);return(0,P.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}o(kt,"useReactFlow");var na=o(e=>e.selected,"selected"),qf=typeof window<"u"?window:void 0;function Kf({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=se(),{deleteElements:r}=kt(),i=hn(e,{actInsideInputWithModifier:!1}),s=hn(t,{target:qf});(0,P.useEffect)(()=>{if(i){let{edges:a,nodes:c}=n.getState();r({nodes:c.filter(na),edges:a.filter(na)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,P.useEffect)(()=>{n.setState({multiSelectionActive:s})},[s])}o(Kf,"useGlobalKeyHandler");function Gf(e){let t=se();(0,P.useEffect)(()=>{let n=o(()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let r=Vn(e.current);(r.height===0||r.width===0)&&t.getState().onError?.("004",ye.error004()),t.setState({width:r.width||500,height:r.height||500})},"updateDimensions");if(e.current){n(),window.addEventListener("resize",n);let r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}o(Gf,"useResizeHandler");var eo={position:"absolute",width:"100%",height:"100%",top:0,left:0},Qf=o(e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress}),"selector$i");function Jf({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:s=.5,panOnScrollMode:a=$e.Free,zoomOnDoubleClick:c=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:d,minZoom:h,maxZoom:f,zoomActivationKeyCode:g,preventScrolling:p=!0,children:S,noWheelClassName:b,noPanClassName:x,onViewportChange:v,isControlledViewport:m,paneClickDistance:w,selectionOnDrag:N}){let C=se(),I=(0,P.useRef)(null),{userSelectionActive:k,lib:A,connectionInProgress:F}=ne(Qf,ie),z=hn(g),H=(0,P.useRef)();Gf(I);let $=(0,P.useCallback)(y=>{v?.({x:y[0],y:y[1],zoom:y[2]}),m||C.setState({transform:y})},[v,m]);return(0,P.useEffect)(()=>{if(I.current){H.current=zs({domNode:I.current,minZoom:h,maxZoom:f,translateExtent:d,viewport:u,onDraggingChange:o(M=>C.setState(D=>D.paneDragging===M?D:{paneDragging:M}),"onDraggingChange"),onPanZoomStart:o((M,D)=>{let{onViewportChangeStart:R,onMoveStart:L}=C.getState();L?.(M,D),R?.(D)},"onPanZoomStart"),onPanZoom:o((M,D)=>{let{onViewportChange:R,onMove:L}=C.getState();L?.(M,D),R?.(D)},"onPanZoom"),onPanZoomEnd:o((M,D)=>{let{onViewportChangeEnd:R,onMoveEnd:L}=C.getState();L?.(M,D),R?.(D)},"onPanZoomEnd")});let{x:y,y:E,zoom:_}=H.current.getViewport();return C.setState({panZoom:H.current,transform:[y,E,_],domNode:I.current.closest(".react-flow")}),()=>{H.current?.destroy()}}},[]),(0,P.useEffect)(()=>{H.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:s,panOnScrollMode:a,zoomOnDoubleClick:c,panOnDrag:l,zoomActivationKeyPressed:z,preventScrolling:p,noPanClassName:x,userSelectionActive:k,noWheelClassName:b,lib:A,onTransformChange:$,connectionInProgress:F,selectionOnDrag:N,paneClickDistance:w})},[e,t,n,r,i,s,a,c,l,z,p,x,k,b,A,$,F,N,w]),(0,T.jsx)("div",{className:"react-flow__renderer",ref:I,style:eo,children:S})}o(Jf,"ZoomPane");var jf=o(e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect}),"selector$h");function eh(){let{userSelectionActive:e,userSelectionRect:t}=ne(jf,ie);return e&&t?(0,T.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}o(eh,"UserSelection");var Qr=o((e,t)=>n=>{n.target===t.current&&e?.(n)},"wrapHandler"),th=o(e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed}),"selector$g");function nh({isSelecting:e,selectionKeyPressed:t,selectionMode:n=st.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:c,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:h,onPaneMouseEnter:f,onPaneMouseMove:g,onPaneMouseLeave:p,children:S}){let b=(0,P.useRef)(0),x=se(),{userSelectionActive:v,elementsSelectable:m,dragging:w,panBy:N,autoPanSpeed:C}=ne(th,ie),I=m&&(e||v),k=(0,P.useRef)(null),A=(0,P.useRef)(),F=(0,P.useRef)(new Set),z=(0,P.useRef)(new Set),H=(0,P.useRef)(!1),$=(0,P.useRef)(!1),y=(0,P.useRef)({x:0,y:0}),E=(0,P.useRef)(!1),_=o(O=>{if($.current||H.current||x.getState().connection.inProgress){$.current=!1,H.current=!1;return}u?.(O),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},"onClick"),M=o(O=>{if(Array.isArray(r)&&r?.includes(2)){O.preventDefault();return}d?.(O)},"onContextMenu"),D=h?O=>h(O):void 0,R=o(O=>{$.current&&(O.stopPropagation(),$.current=!1)},"onClickCapture"),L=o(O=>{if(O.pointerType==="touch"&&r!==!1&&!t)return;let{domNode:Y,transform:j}=x.getState();if(A.current=Y?.getBoundingClientRect(),!A.current)return;let J=O.target===k.current;if(!J&&!!O.target.closest(".nokey")||!e||!(a&&J||t)||O.button!==0||!O.isPrimary)return;O.target?.setPointerCapture?.(O.pointerId),$.current=!1;let{x:te,y:oe}=be(O.nativeEvent,A.current),re=Mt({x:te,y:oe},j);x.setState({userSelectionRect:{width:0,height:0,startX:re.x,startY:re.y,x:te,y:oe}}),J||(O.stopPropagation(),O.preventDefault())},"onPointerDownCapture");function V(O,Y){let{userSelectionRect:j}=x.getState();if(!j)return;let{transform:J,nodeLookup:q,edgeLookup:Q,connectionLookup:te,triggerNodeChanges:oe,triggerEdgeChanges:re,defaultEdgeOptions:de}=x.getState(),Pe={x:j.startX,y:j.startY},{x:_e,y:Ne}=ct(Pe,J),ke={startX:Pe.x,startY:Pe.y,x:O<_e?O:_e,y:Y<Ne?Y:Ne,width:Math.abs(O-_e),height:Math.abs(Y-Ne)},$t=F.current,Ge=z.current;F.current=new Set(On(q,ke,J,n===st.Partial,!0).map(ve=>ve.id)),z.current=new Set;let Qe=de?.selectable??!0;for(let ve of F.current){let Ae=te.get(ve);if(Ae)for(let{edgeId:Te}of Ae.values()){let Je=Q.get(Te);Je&&(Je.selectable??Qe)&&z.current.add(Te)}}if(!Hr($t,F.current)){let ve=Pt(q,F.current,!0);oe(ve)}if(!Hr(Ge,z.current)){let ve=Pt(Q,z.current);re(ve)}x.setState({userSelectionRect:ke,userSelectionActive:!0,nodesSelectionActive:!1})}o(V,"commitUserSelectionRect");function B(){if(!i||!A.current)return;let[O,Y]=$n(y.current,A.current,C);N({x:O,y:Y}).then(j=>{if(!$.current||!j){b.current=requestAnimationFrame(B);return}let{x:J,y:q}=y.current;V(J,q),b.current=requestAnimationFrame(B)})}o(B,"autoPan");let U=o(()=>{cancelAnimationFrame(b.current),b.current=0,E.current=!1},"cleanupAutoPan");(0,P.useEffect)(()=>()=>U(),[]);let W=o(O=>{let{userSelectionRect:Y,transform:j,resetSelectedElements:J}=x.getState();if(!A.current||!Y)return;let{x:q,y:Q}=be(O.nativeEvent,A.current);y.current={x:q,y:Q};let te=ct({x:Y.startX,y:Y.startY},j);if(!$.current){let oe=t?0:s;if(Math.hypot(q-te.x,Q-te.y)<=oe)return;J(),c?.(O)}$.current=!0,E.current||(B(),E.current=!0),V(q,Q)},"onPointerMove"),G=o(O=>{if(!I){O.target===k.current&&x.getState().connection.inProgress&&(H.current=!0);return}O.button===0&&(O.target?.releasePointerCapture?.(O.pointerId),!v&&O.target===k.current&&x.getState().userSelectionRect&&_?.(O),x.setState({userSelectionActive:!1,userSelectionRect:null}),$.current&&(l?.(O),x.setState({nodesSelectionActive:F.current.size>0})),U())},"onPointerUp"),ee=o(O=>{O.target?.releasePointerCapture?.(O.pointerId),U()},"onPointerCancel"),K=r===!0||Array.isArray(r)&&r.includes(0);return(0,T.jsxs)("div",{className:ae(["react-flow__pane",{draggable:K,dragging:w,selection:e}]),onClick:I?void 0:Qr(_,k),onContextMenu:Qr(M,k),onWheel:Qr(D,k),onPointerEnter:I?void 0:f,onPointerMove:I?W:g,onPointerUp:G,onPointerCancel:I?ee:void 0,onPointerDownCapture:I?L:void 0,onClickCapture:I?R:void 0,onPointerLeave:p,ref:k,style:eo,children:[S,(0,T.jsx)(eh,{})]})}o(nh,"Pane");function jr({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:c,onError:l}=t.getState(),u=c.get(e);if(!u){l?.("012",ye.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}o(jr,"handleNodeClick");function Na({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:a}){let c=se(),[l,u]=(0,P.useState)(!1),d=(0,P.useRef)();return(0,P.useEffect)(()=>{if(!t)return d.current=Ms({getStoreItems:o(()=>c.getState(),"getStoreItems"),onNodeMouseDown:o(h=>{jr({id:h,store:c,nodeRef:e})},"onNodeMouseDown"),onDragStart:o(()=>{u(!0)},"onDragStart"),onDragStop:o(()=>{u(!1)},"onDragStop")}),()=>{d.current?.destroy(),d.current=void 0}},[t,c,e]),(0,P.useEffect)(()=>{t||!e.current||!d.current||d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:i,nodeClickDistance:a})},[n,r,t,s,e,i,a]),l}o(Na,"useDrag");var oh=o(e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u"),"selectedAndDraggable");function Ma(){let e=se();return(0,P.useCallback)(n=>{let{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:a,onError:c,updateNodePositions:l,nodeLookup:u,nodeOrigin:d}=e.getState(),h=new Map,f=oh(a),g=i?s[0]:5,p=i?s[1]:5,S=n.direction.x*g*n.factor,b=n.direction.y*p*n.factor;for(let[,x]of u){if(!f(x))continue;let v={x:x.internals.positionAbsolute.x+S,y:x.internals.positionAbsolute.y+b};i&&(v=Nt(v,s));let{position:m,positionAbsolute:w}=Rr({nodeId:x.id,nextPosition:v,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:c});x.position=m,x.internals.positionAbsolute=w,h.set(x.id,x)}l(h)},[])}o(Ma,"useMoveSelectedNodes");var ei=(0,P.createContext)(null),rh=ei.Provider;ei.Consumer;var Ia=o(()=>(0,P.useContext)(ei),"useNodeId"),ih=o(e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),"selector$f"),Pa=(0,P.createContext)(null);function sh({children:e}){let t=ne(ih,ie);return(0,T.jsx)(Pa.Provider,{value:t,children:e})}o(sh,"HandleConfigProvider");function ah(){let e=(0,P.useContext)(Pa);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}o(ah,"useHandleConfig");var ch={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},lh=o((e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:s,connection:a}=r,{fromHandle:c,toHandle:l,isValid:u}=a;if(!c&&!i)return ch;let d=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:c?.nodeId===e&&c?.id===t&&c?.type===n,connectingTo:d,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:s===Xe.Strict?c?.type!==n:e!==c?.nodeId||t!==c?.id,connectionInProcess:!!c,clickConnectionInProcess:!!i,valid:d&&u}},"connectingSelector");function uh({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:a,onConnect:c,children:l,className:u,onMouseDown:d,onTouchStart:h,...f},g){let p=a||null,S=e==="target",b=se(),x=Ia(),{connectOnClick:v,noPanClassName:m,rfId:w}=ah(),{connectingFrom:N,connectingTo:C,clickConnecting:I,isPossibleEndHandle:k,connectionInProcess:A,clickConnectionInProcess:F,valid:z}=ne(lh(x,p,e),ie);x||b.getState().onError?.("010",ye.error010());let H=o(E=>{let{defaultEdgeOptions:_,onConnect:M,hasDefaultEdges:D}=b.getState(),R={..._,...E};if(D){let{edges:L,setEdges:V,onError:B}=b.getState();V(Ff(R,L,{onError:B}))}M?.(R),c?.(R)},"onConnectExtended"),$=o(E=>{if(!x)return;let _=Wr(E.nativeEvent);if(i&&(_&&E.button===0||!_)){let M=b.getState();qn.onPointerDown(E.nativeEvent,{handleDomNode:E.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:S,handleId:p,nodeId:x,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:o((...D)=>b.getState().onConnectEnd?.(...D),"onConnectEnd"),updateConnection:M.updateConnection,onConnect:H,isValidConnection:n||((...D)=>b.getState().isValidConnection?.(...D)??!0),getTransform:o(()=>b.getState().transform,"getTransform"),getFromHandle:o(()=>b.getState().connection.fromHandle,"getFromHandle"),autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}_?d?.(E):h?.(E)},"onPointerDown"),y=o(E=>{let{onClickConnectStart:_,onClickConnectEnd:M,connectionClickStartHandle:D,connectionMode:R,isValidConnection:L,lib:V,rfId:B,nodeLookup:U,connection:W}=b.getState();if(!x||!D&&!i)return;if(!D){_?.(E.nativeEvent,{nodeId:x,handleId:p,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:x,type:e,id:p}});return}let G=Vr(E.target),ee=n||L,{connection:K,isValid:O}=qn.isValid(E.nativeEvent,{handle:{nodeId:x,id:p,type:e},connectionMode:R,fromNodeId:D.nodeId,fromHandleId:D.id||null,fromType:D.type,isValidConnection:ee,flowId:B,doc:G,lib:V,nodeLookup:U});O&&K&&H(K);let Y=structuredClone(W);delete Y.inProgress,Y.toPosition=Y.toHandle?Y.toHandle.position:null,M?.(E,Y),b.setState({connectionClickStartHandle:null})},"onClick");return(0,T.jsx)("div",{"data-handleid":p,"data-nodeid":x,"data-handlepos":t,"data-id":`${w}-${x}-${p}-${e}`,className:ae(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,u,{source:!S,target:S,connectable:r,connectablestart:i,connectableend:s,clickconnecting:I,connectingfrom:N,connectingto:C,valid:z,connectionindicator:r&&(!A||k)&&(A||F?s:i)}]),onMouseDown:$,onTouchStart:$,onClick:v?y:void 0,ref:g,...f,children:l})}o(uh,"HandleComponent");var ft=(0,P.memo)(Ea(uh));function dh({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return(0,T.jsxs)(T.Fragment,{children:[e?.label,(0,T.jsx)(ft,{type:"source",position:n,isConnectable:t})]})}o(dh,"InputNode");function fh({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:r=X.Bottom}){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ft,{type:"target",position:n,isConnectable:t}),e?.label,(0,T.jsx)(ft,{type:"source",position:r,isConnectable:t})]})}o(fh,"DefaultNode");function hh(){return null}o(hh,"GroupNode");function ph({data:e,isConnectable:t,targetPosition:n=X.Top}){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(ft,{type:"target",position:n,isConnectable:t}),e?.label]})}o(ph,"OutputNode");var Jn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},oa={input:dh,default:fh,output:ph,group:hh};function gh(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}o(gh,"getNodeInlineStyleDimensions");var mh=o(e=>{let{width:t,height:n,x:r,y:i}=Ct(e.nodeLookup,{filter:o(s=>!!s.selected,"filter")});return{width:we(t)?t:null,height:we(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}},"selector$e");function yh({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=se(),{width:i,height:s,transformString:a,userSelectionActive:c}=ne(mh,ie),l=Ma(),u=(0,P.useRef)(null);(0,P.useEffect)(()=>{n||u.current?.focus({preventScroll:!0})},[n]);let d=!c&&i!==null&&s!==null;if(Na({nodeRef:u,disabled:!d}),!d)return null;let h=e?g=>{let p=r.getState().nodes.filter(S=>S.selected);e(g,p)}:void 0,f=o(g=>{Object.prototype.hasOwnProperty.call(Jn,g.key)&&(g.preventDefault(),l({direction:Jn[g.key],factor:g.shiftKey?4:1}))},"onKeyDown");return(0,T.jsx)("div",{className:ae(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:(0,T.jsx)("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:i,height:s}})})}o(yh,"NodesSelection");var ra=typeof window<"u"?window:void 0,xh=o(e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive}),"selector$d");function ka({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:c,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:d,selectionMode:h,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:p,panActivationKeyCode:S,zoomActivationKeyCode:b,elementsSelectable:x,zoomOnScroll:v,zoomOnPinch:m,panOnScroll:w,panOnScrollSpeed:N,panOnScrollMode:C,zoomOnDoubleClick:I,panOnDrag:k,autoPanOnSelection:A,defaultViewport:F,translateExtent:z,minZoom:H,maxZoom:$,preventScrolling:y,onSelectionContextMenu:E,noWheelClassName:_,noPanClassName:M,disableKeyboardA11y:D,onViewportChange:R,isControlledViewport:L}){let{nodesSelectionActive:V,userSelectionActive:B}=ne(xh,ie),U=hn(u,{target:ra}),W=hn(S,{target:ra}),G=W||k,ee=W||w,K=d&&G!==!0,O=U||B||K;return Kf({deleteKeyCode:l,multiSelectionKeyCode:p}),(0,T.jsx)(Jf,{onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:v,zoomOnPinch:m,panOnScroll:ee,panActivationKeyPressed:W,panOnScrollSpeed:N,panOnScrollMode:C,zoomOnDoubleClick:I,panOnDrag:!U&&G,defaultViewport:F,translateExtent:z,minZoom:H,maxZoom:$,zoomActivationKeyCode:b,preventScrolling:y,noWheelClassName:_,noPanClassName:M,onViewportChange:R,isControlledViewport:L,paneClickDistance:c,selectionOnDrag:K,children:(0,T.jsxs)(nh,{onSelectionStart:f,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:G,autoPanOnSelection:A,isSelecting:!!O,selectionMode:h,selectionKeyPressed:U,paneClickDistance:c,selectionOnDrag:K,children:[e,V&&(0,T.jsx)(yh,{onSelectionContextMenu:E,noPanClassName:M,disableKeyboardA11y:D})]})})}o(ka,"FlowRendererComponent");ka.displayName="FlowRenderer";var wh=(0,P.memo)(ka),bh=o(e=>t=>e?On(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys()),"selector$c");function Sh(e){return ne((0,P.useCallback)(bh(e),[e]),ie)}o(Sh,"useVisibleNodeIds");var vh=o(e=>e.updateNodeInternals,"selector$b");function Eh(){let e=ne(vh),[t]=(0,P.useState)(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{let r=new Map;n.forEach(i=>{let s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),e(r)}));return(0,P.useEffect)(()=>()=>{t?.disconnect()},[t]),t}o(Eh,"useResizeObserver");function Ch({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=se(),s=(0,P.useRef)(null),a=(0,P.useRef)(null),c=(0,P.useRef)(e.sourcePosition),l=(0,P.useRef)(e.targetPosition),u=(0,P.useRef)(t),d=n&&!!e.internals.handleBounds;return(0,P.useEffect)(()=>{s.current&&!e.hidden&&(!d||a.current!==s.current)&&(a.current&&r?.unobserve(a.current),r?.observe(s.current),a.current=s.current)},[d,e.hidden]),(0,P.useEffect)(()=>()=>{a.current&&(r?.unobserve(a.current),a.current=null)},[]),(0,P.useEffect)(()=>{if(s.current){let h=u.current!==t,f=c.current!==e.sourcePosition,g=l.current!==e.targetPosition;(h||f||g)&&(u.current=t,c.current=e.sourcePosition,l.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}o(Ch,"useNodeObserver");function _h({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:a,nodesDraggable:c,elementsSelectable:l,nodesConnectable:u,nodesFocusable:d,resizeObserver:h,noDragClassName:f,noPanClassName:g,disableKeyboardA11y:p,rfId:S,nodeTypes:b,nodeClickDistance:x,onError:v}){let{node:m,internals:w,isParent:N}=ne(O=>{let Y=O.nodeLookup.get(e),j=O.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:j}},ie),C=m.type||"default",I=b?.[C]||oa[C];I===void 0&&(v?.("003",ye.error003(C)),C="default",I=b?.default||oa.default);let k=!!(m.draggable||c&&typeof m.draggable>"u"),A=!!(m.selectable||l&&typeof m.selectable>"u"),F=!!(m.connectable||u&&typeof m.connectable>"u"),z=!!(m.focusable||d&&typeof m.focusable>"u"),H=se(),$=Bn(m),y=Ch({node:m,nodeType:C,hasDimensions:$,resizeObserver:h}),E=Na({nodeRef:y,disabled:m.hidden||!k,noDragClassName:f,handleSelector:m.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:x}),_=Ma();if(m.hidden)return null;let M=Se(m),D=gh(m),R=A||k||t||n||r||i,L=n?O=>n(O,{...w.userNode}):void 0,V=r?O=>r(O,{...w.userNode}):void 0,B=i?O=>i(O,{...w.userNode}):void 0,U=s?O=>s(O,{...w.userNode}):void 0,W=a?O=>a(O,{...w.userNode}):void 0,G=o(O=>{let{selectNodesOnDrag:Y,nodeDragThreshold:j}=H.getState();A&&(!Y||!k||j>0)&&jr({id:e,store:H,nodeRef:y}),t&&t(O,{...w.userNode})},"onSelectNodeHandler"),ee=o(O=>{if(!(Fr(O.nativeEvent)||p)){if(Pr.includes(O.key)&&A){let Y=O.key==="Escape";jr({id:e,store:H,unselect:Y,nodeRef:y})}else if(k&&m.selected&&Object.prototype.hasOwnProperty.call(Jn,O.key)){O.preventDefault();let{ariaLabelConfig:Y}=H.getState();H.setState({ariaLiveMessage:Y["node.a11yDescription.ariaLiveMessage"]({direction:O.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),_({direction:Jn[O.key],factor:O.shiftKey?4:1})}}},"onKeyDown"),K=o(()=>{if(p||!y.current?.matches(":focus-visible"))return;let{transform:O,width:Y,height:j,autoPanOnNodeFocus:J,setCenter:q}=H.getState();if(!J)return;On(new Map([[e,m]]),{x:0,y:0,width:Y,height:j},O,!0).length>0||q(m.position.x+M.width/2,m.position.y+M.height/2,{zoom:O[2]})},"onFocus");return(0,T.jsx)("div",{className:ae(["react-flow__node",`react-flow__node-${C}`,{[g]:k},m.className,{selected:m.selected,selectable:A,parent:N,draggable:k,dragging:E}]),ref:y,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:R?"all":"none",visibility:$?"visible":"hidden",...m.style,...D},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:V,onMouseLeave:B,onContextMenu:U,onClick:G,onDoubleClick:W,onKeyDown:z?ee:void 0,tabIndex:z?0:void 0,onFocus:z?K:void 0,role:m.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${ya}-${S}`,"aria-label":m.ariaLabel,...m.domAttributes,children:(0,T.jsx)(rh,{value:e,children:(0,T.jsx)(I,{id:e,data:m.data,type:C,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:m.selected??!1,selectable:A,draggable:k,deletable:m.deletable??!0,isConnectable:F,sourcePosition:m.sourcePosition,targetPosition:m.targetPosition,dragging:E,dragHandle:m.dragHandle,zIndex:w.z,parentId:m.parentId,...M})})})}o(_h,"NodeWrapper");var Nh=(0,P.memo)(_h),Mh=o(e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError}),"selector$a");function Aa(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=ne(Mh,ie),s=Sh(e.onlyRenderVisibleElements),a=Eh();return(0,T.jsx)("div",{className:"react-flow__nodes",style:eo,children:s.map(c=>(0,T.jsx)(Nh,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}o(Aa,"NodeRendererComponent");Aa.displayName="NodeRenderer";var Ih=(0,P.memo)(Aa);function Ph(e){return ne((0,P.useCallback)(n=>{if(!e)return n.edges.map(i=>i.id);let r=[];if(n.width&&n.height)for(let i of n.edges){let s=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);s&&a&&ys({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),ie)}o(Ph,"useVisibleEdgeIds");var kh=o(({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,T.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},"ArrowSymbol"),Ah=o(({color:e="none",strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,T.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},"ArrowClosedSymbol"),ia={[St.Arrow]:kh,[St.ArrowClosed]:Ah};function Th(e){let t=se();return(0,P.useMemo)(()=>Object.prototype.hasOwnProperty.call(ia,e)?ia[e]:(t.getState().onError?.("009",ye.error009(e)),null),[e])}o(Th,"useMarkerSymbol");var Dh=o(({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:c="auto-start-reverse"})=>{let l=Th(t);return l?(0,T.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0",children:(0,T.jsx)(l,{color:n,strokeWidth:a})}):null},"Marker"),Ta=o(({defaultColor:e,rfId:t})=>{let n=ne(s=>s.edges),r=ne(s=>s.defaultEdgeOptions),i=(0,P.useMemo)(()=>bs(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,T.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,T.jsx)("defs",{children:i.map(s=>(0,T.jsx)(Dh,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null},"MarkerDefinitions");Ta.displayName="MarkerDefinitions";var Rh=(0,P.memo)(Ta);function Da({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:c=2,children:l,className:u,...d}){let[h,f]=(0,P.useState)({x:1,y:0,width:0,height:0}),g=ae(["react-flow__edge-textwrapper",u]),p=(0,P.useRef)(null);return(0,P.useEffect)(()=>{if(p.current){let S=p.current.getBBox();f({x:S.x,y:S.y,width:S.width,height:S.height})}},[n]),n?(0,T.jsxs)("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",...d,children:[i&&(0,T.jsx)("rect",{width:h.width+2*a[0],x:-a[0],y:-a[1],height:h.height+2*a[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),(0,T.jsx)("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:r,children:n}),l]}):null}o(Da,"EdgeTextComponent");Da.displayName="EdgeText";var zh=(0,P.memo)(Da);function to({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:l,interactionWidth:u=20,...d}){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("path",{...d,d:e,fill:"none",className:ae(["react-flow__edge-path",d.className])}),u?(0,T.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&we(t)&&we(n)?(0,T.jsx)(zh,{x:t,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:l}):null]})}o(to,"BaseEdge");function sa({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===X.Left||e===X.Right?[.5*(t+r),n]:[t,.5*(n+i)]}o(sa,"getControl");function Ra({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:i,targetPosition:s=X.Top}){let[a,c]=sa({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,u]=sa({pos:s,x1:r,y1:i,x2:e,y2:t}),[d,h,f,g]=Fn({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${c} ${l},${u} ${r},${i}`,d,h,f,g]}o(Ra,"getSimpleBezierPath");function za(e){return(0,P.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:c,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:g,style:p,markerEnd:S,markerStart:b,interactionWidth:x})=>{let[v,m,w]=Ra({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:c}),N=e.isInternal?void 0:t;return(0,T.jsx)(to,{id:N,path:v,labelX:m,labelY:w,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:g,style:p,markerEnd:S,markerStart:b,interactionWidth:x})})}o(za,"createSimpleBezierEdge");var Oh=za({isInternal:!1}),Oa=za({isInternal:!0});Oh.displayName="SimpleBezierEdge";Oa.displayName="SimpleBezierEdgeInternal";function $a(e){return(0,P.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,sourcePosition:g=X.Bottom,targetPosition:p=X.Top,markerEnd:S,markerStart:b,pathOptions:x,interactionWidth:v})=>{let[m,w,N]=fn({sourceX:n,sourceY:r,sourcePosition:g,targetX:i,targetY:s,targetPosition:p,borderRadius:x?.borderRadius,offset:x?.offset,stepPosition:x?.stepPosition}),C=e.isInternal?void 0:t;return(0,T.jsx)(to,{id:C,path:m,labelX:w,labelY:N,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:S,markerStart:b,interactionWidth:v})})}o($a,"createSmoothStepEdge");var La=$a({isInternal:!1}),Ha=$a({isInternal:!0});La.displayName="SmoothStepEdge";Ha.displayName="SmoothStepEdgeInternal";function Ba(e){return(0,P.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,T.jsx)(La,{...n,id:r,pathOptions:(0,P.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}o(Ba,"createStepEdge");var $h=Ba({isInternal:!1}),Va=Ba({isInternal:!0});$h.displayName="StepEdge";Va.displayName="StepEdgeInternal";function Fa(e){return(0,P.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:g,markerStart:p,interactionWidth:S})=>{let[b,x,v]=Yn({sourceX:n,sourceY:r,targetX:i,targetY:s}),m=e.isInternal?void 0:t;return(0,T.jsx)(to,{id:m,path:b,labelX:x,labelY:v,label:a,labelStyle:c,labelShowBg:l,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:f,markerEnd:g,markerStart:p,interactionWidth:S})})}o(Fa,"createStraightEdge");var Lh=Fa({isInternal:!1}),Wa=Fa({isInternal:!0});Lh.displayName="StraightEdge";Wa.displayName="StraightEdgeInternal";function Ya(e){return(0,P.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a=X.Bottom,targetPosition:c=X.Top,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:g,style:p,markerEnd:S,markerStart:b,pathOptions:x,interactionWidth:v})=>{let[m,w,N]=Wn({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:c,curvature:x?.curvature}),C=e.isInternal?void 0:t;return(0,T.jsx)(to,{id:C,path:m,labelX:w,labelY:N,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:h,labelBgPadding:f,labelBgBorderRadius:g,style:p,markerEnd:S,markerStart:b,interactionWidth:v})})}o(Ya,"createBezierEdge");var Hh=Ya({isInternal:!1}),Xa=Ya({isInternal:!0});Hh.displayName="BezierEdge";Xa.displayName="BezierEdgeInternal";var aa={default:Xa,straight:Wa,step:Va,smoothstep:Ha,simplebezier:Oa},ca={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Bh=o((e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,"shiftX"),Vh=o((e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,"shiftY"),la="react-flow__edgeupdater";function ua({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:a,type:c}){return(0,T.jsx)("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:a,className:ae([la,`${la}-${c}`]),cx:Bh(t,r,e),cy:Vh(n,r,e),r,stroke:"transparent",fill:"transparent"})}o(ua,"EdgeAnchor");function Fh({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:a,sourcePosition:c,targetPosition:l,onReconnect:u,onReconnectStart:d,onReconnectEnd:h,setReconnecting:f,setUpdateHover:g}){let p=se(),S=o((w,N)=>{if(w.button!==0)return;let{autoPanOnConnect:C,domNode:I,connectionMode:k,connectionRadius:A,lib:F,onConnectStart:z,cancelConnection:H,nodeLookup:$,rfId:y,panBy:E,updateConnection:_}=p.getState(),M=N.type==="target",D=o((V,B)=>{f(!1),h?.(V,n,N.type,B)},"_onReconnectEnd"),R=o(V=>u?.(n,V),"onConnectEdge"),L=o((V,B)=>{f(!0),d?.(w,n,N.type),z?.(V,B)},"_onConnectStart");qn.onPointerDown(w.nativeEvent,{autoPanOnConnect:C,connectionMode:k,connectionRadius:A,domNode:I,handleId:N.id,nodeId:N.nodeId,nodeLookup:$,isTarget:M,edgeUpdaterType:N.type,lib:F,flowId:y,cancelConnection:H,panBy:E,isValidConnection:o((...V)=>p.getState().isValidConnection?.(...V)??!0,"isValidConnection"),onConnect:R,onConnectStart:L,onConnectEnd:o((...V)=>p.getState().onConnectEnd?.(...V),"onConnectEnd"),onReconnectEnd:D,updateConnection:_,getTransform:o(()=>p.getState().transform,"getTransform"),getFromHandle:o(()=>p.getState().connection.fromHandle,"getFromHandle"),dragThreshold:p.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},"handleEdgeUpdater"),b=o(w=>S(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),"onReconnectSourceMouseDown"),x=o(w=>S(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),"onReconnectTargetMouseDown"),v=o(()=>g(!0),"onReconnectMouseEnter"),m=o(()=>g(!1),"onReconnectMouseOut");return(0,T.jsxs)(T.Fragment,{children:[(e===!0||e==="source")&&(0,T.jsx)(ua,{position:c,centerX:r,centerY:i,radius:t,onMouseDown:b,onMouseEnter:v,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&(0,T.jsx)(ua,{position:l,centerX:s,centerY:a,radius:t,onMouseDown:x,onMouseEnter:v,onMouseOut:m,type:"target"})]})}o(Fh,"EdgeUpdateAnchors");function Wh({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:a,onMouseEnter:c,onMouseMove:l,onMouseLeave:u,reconnectRadius:d,onReconnect:h,onReconnectStart:f,onReconnectEnd:g,rfId:p,edgeTypes:S,noPanClassName:b,onError:x,disableKeyboardA11y:v}){let m=ne(q=>q.edgeLookup.get(e)),w=ne(q=>q.defaultEdgeOptions);m=w?{...w,...m}:m;let N=m.type||"default",C=S?.[N]||aa[N];C===void 0&&(x?.("011",ye.error011(N)),N="default",C=S?.default||aa.default);let I=!!(m.focusable||t&&typeof m.focusable>"u"),k=typeof h<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),A=!!(m.selectable||r&&typeof m.selectable>"u"),F=(0,P.useRef)(null),[z,H]=(0,P.useState)(!1),[$,y]=(0,P.useState)(!1),E=se(),{zIndex:_=m.zIndex,sourceX:M,sourceY:D,targetX:R,targetY:L,sourcePosition:V,targetPosition:B}=ne((0,P.useCallback)(q=>{let Q=q.nodeLookup.get(m.source),te=q.nodeLookup.get(m.target);if(!Q||!te)return ca;let oe=ws({id:e,sourceNode:Q,targetNode:te,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:q.connectionMode,onError:x}),re=ms({selected:m.selected,zIndex:m.zIndex,sourceNode:Q,targetNode:te,elevateOnSelect:q.elevateEdgesOnSelect,zIndexMode:q.zIndexMode});return{...oe||ca,zIndex:re}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex,x]),ie),U=(0,P.useMemo)(()=>m.markerStart?`url('#${Xn(m.markerStart,p)}')`:void 0,[m.markerStart,p]),W=(0,P.useMemo)(()=>m.markerEnd?`url('#${Xn(m.markerEnd,p)}')`:void 0,[m.markerEnd,p]);if(m.hidden||M===null||D===null||R===null||L===null)return null;let G=o(q=>{let{addSelectedEdges:Q,unselectNodesAndEdges:te,multiSelectionActive:oe}=E.getState();A&&(E.setState({nodesSelectionActive:!1}),m.selected&&oe?(te({nodes:[],edges:[m]}),F.current?.blur()):Q([e])),i&&i(q,m)},"onEdgeClick"),ee=s?q=>{s(q,{...m})}:void 0,K=a?q=>{a(q,{...m})}:void 0,O=c?q=>{c(q,{...m})}:void 0,Y=l?q=>{l(q,{...m})}:void 0,j=u?q=>{u(q,{...m})}:void 0,J=o(q=>{if(!v&&Pr.includes(q.key)&&A){let{unselectNodesAndEdges:Q,addSelectedEdges:te}=E.getState();q.key==="Escape"?(F.current?.blur(),Q({edges:[m]})):te([e])}},"onKeyDown");return(0,T.jsx)("svg",{style:{zIndex:_},children:(0,T.jsxs)("g",{className:ae(["react-flow__edge",`react-flow__edge-${N}`,m.className,b,{selected:m.selected,animated:m.animated,inactive:!A&&!i,updating:z,selectable:A}]),onClick:G,onDoubleClick:ee,onContextMenu:K,onMouseEnter:O,onMouseMove:Y,onMouseLeave:j,onKeyDown:I?J:void 0,tabIndex:I?0:void 0,role:m.ariaRole??(I?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":I?`${xa}-${p}`:void 0,ref:F,...m.domAttributes,children:[!$&&(0,T.jsx)(C,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:A,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:M,sourceY:D,targetX:R,targetY:L,sourcePosition:V,targetPosition:B,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:U,markerEnd:W,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),k&&(0,T.jsx)(Fh,{edge:m,isReconnectable:k,reconnectRadius:d,onReconnect:h,onReconnectStart:f,onReconnectEnd:g,sourceX:M,sourceY:D,targetX:R,targetY:L,sourcePosition:V,targetPosition:B,setUpdateHover:H,setReconnecting:y})]})})}o(Wh,"EdgeWrapper");var Yh=(0,P.memo)(Wh),Xh=o(e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError}),"selector$9");function Za({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:h,onEdgeDoubleClick:f,onReconnectStart:g,onReconnectEnd:p,disableKeyboardA11y:S}){let{edgesFocusable:b,edgesReconnectable:x,elementsSelectable:v,onError:m}=ne(Xh,ie),w=Ph(t);return(0,T.jsxs)("div",{className:"react-flow__edges",children:[(0,T.jsx)(Rh,{defaultColor:e,rfId:n}),w.map(N=>(0,T.jsx)(Yh,{id:N,edgesFocusable:b,edgesReconnectable:x,elementsSelectable:v,noPanClassName:i,onReconnect:s,onContextMenu:a,onMouseEnter:c,onMouseMove:l,onMouseLeave:u,onClick:d,reconnectRadius:h,onDoubleClick:f,onReconnectStart:g,onReconnectEnd:p,rfId:n,onError:m,edgeTypes:r,disableKeyboardA11y:S},N))]})}o(Za,"EdgeRendererComponent");Za.displayName="EdgeRenderer";var Zh=(0,P.memo)(Za),da=o(e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`,"toTransformString");function Uh({children:e}){let t=se(),n=(0,P.useRef)(null),[r]=(0,P.useState)(()=>t.getState().transform);return Ca(()=>{let i=null,s=o(()=>{let a=t.getState().transform;i&&a[0]===i[0]&&a[1]===i[1]&&a[2]===i[2]||(i=a,n.current&&(n.current.style.transform=da(a)))},"applyTransform");return s(),t.subscribe(s)},[t]),(0,T.jsx)("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:da(r)},children:e})}o(Uh,"Viewport");function qh(e){let t=kt(),n=(0,P.useRef)(!1);(0,P.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}o(qh,"useOnInitHandler");var Kh=o(e=>e.panZoom?.syncViewport,"selector$8");function Gh(e){let t=ne(Kh),n=se();return(0,P.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}o(Gh,"useViewportSync");function fa(e){return e.connection.inProgress?{...e.connection,to:Mt(e.connection.to,e.transform)}:{...e.connection}}o(fa,"storeSelector$1");function Qh(e){return e?o(n=>{let r=fa(n);return e(r)},"combinedSelector"):fa}o(Qh,"getSelector");function Jh(e){let t=Qh(e);return ne(t,ie)}o(Jh,"useConnection");var jh=o(e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height}),"selector$7");function ep({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:s,height:a,isValid:c,inProgress:l}=ne(jh,ie);return!(s&&i&&l)?null:(0,T.jsx)("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:(0,T.jsx)("g",{className:ae(["react-flow__connection",Br(c)]),children:(0,T.jsx)(Ua,{style:t,type:n,CustomComponent:r,isValid:c})})})}o(ep,"ConnectionLineWrapper");var Ua=o(({style:e,type:t=Ie.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:s,fromNode:a,fromHandle:c,fromPosition:l,to:u,toNode:d,toHandle:h,toPosition:f,pointer:g}=Jh();if(!i)return;if(n)return(0,T.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:c,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:f,connectionStatus:Br(r),toNode:d,toHandle:h,pointer:g});let p="",S={sourceX:s.x,sourceY:s.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Ie.Bezier:[p]=Wn(S);break;case Ie.SimpleBezier:[p]=Ra(S);break;case Ie.Step:[p]=fn({...S,borderRadius:0});break;case Ie.SmoothStep:[p]=fn(S);break;default:[p]=Yn(S)}return(0,T.jsx)("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})},"ConnectionLine");Ua.displayName="ConnectionLine";var tp={};function ha(e=tp){let t=(0,P.useRef)(e),n=se();(0,P.useEffect)(()=>{},[e])}o(ha,"useNodeOrEdgeTypesWarning");function np(){let e=se(),t=(0,P.useRef)(!1);(0,P.useEffect)(()=>{},[])}o(np,"useStylesLoadedWarning");function qa({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:h,onSelectionStart:f,onSelectionEnd:g,connectionLineType:p,connectionLineStyle:S,connectionLineComponent:b,connectionLineContainerStyle:x,selectionKeyCode:v,selectionOnDrag:m,selectionMode:w,multiSelectionKeyCode:N,panActivationKeyCode:C,zoomActivationKeyCode:I,deleteKeyCode:k,onlyRenderVisibleElements:A,elementsSelectable:F,defaultViewport:z,translateExtent:H,minZoom:$,maxZoom:y,preventScrolling:E,defaultMarkerColor:_,zoomOnScroll:M,zoomOnPinch:D,panOnScroll:R,panOnScrollSpeed:L,panOnScrollMode:V,zoomOnDoubleClick:B,panOnDrag:U,autoPanOnSelection:W,onPaneClick:G,onPaneMouseEnter:ee,onPaneMouseMove:K,onPaneMouseLeave:O,onPaneScroll:Y,onPaneContextMenu:j,paneClickDistance:J,nodeClickDistance:q,onEdgeContextMenu:Q,onEdgeMouseEnter:te,onEdgeMouseMove:oe,onEdgeMouseLeave:re,reconnectRadius:de,onReconnect:Pe,onReconnectStart:_e,onReconnectEnd:Ne,noDragClassName:ke,noWheelClassName:$t,noPanClassName:Ge,disableKeyboardA11y:Qe,nodeExtent:ve,rfId:Ae,viewport:Te,onViewportChange:Je,nodesDraggable:ao}){return ha(e),ha(t),np(),qh(n),Gh(Te),(0,T.jsx)(wh,{onPaneClick:G,onPaneMouseEnter:ee,onPaneMouseMove:K,onPaneMouseLeave:O,onPaneContextMenu:j,onPaneScroll:Y,paneClickDistance:J,deleteKeyCode:k,selectionKeyCode:v,selectionOnDrag:m,selectionMode:w,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:N,panActivationKeyCode:C,zoomActivationKeyCode:I,elementsSelectable:F,zoomOnScroll:M,zoomOnPinch:D,zoomOnDoubleClick:B,panOnScroll:R,panOnScrollSpeed:L,panOnScrollMode:V,panOnDrag:U,autoPanOnSelection:W,defaultViewport:z,translateExtent:H,minZoom:$,maxZoom:y,onSelectionContextMenu:h,preventScrolling:E,noDragClassName:ke,noWheelClassName:$t,noPanClassName:Ge,disableKeyboardA11y:Qe,onViewportChange:Je,isControlledViewport:!!Te,children:(0,T.jsxs)(Uh,{children:[(0,T.jsx)(Zh,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:Pe,onReconnectStart:_e,onReconnectEnd:Ne,onlyRenderVisibleElements:A,onEdgeContextMenu:Q,onEdgeMouseEnter:te,onEdgeMouseMove:oe,onEdgeMouseLeave:re,reconnectRadius:de,defaultMarkerColor:_,noPanClassName:Ge,disableKeyboardA11y:Qe,rfId:Ae}),(0,T.jsx)(ep,{style:S,type:p,component:b,containerStyle:x}),(0,T.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,T.jsx)(Ih,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:q,onlyRenderVisibleElements:A,noPanClassName:Ge,noDragClassName:ke,disableKeyboardA11y:Qe,nodeExtent:ve,rfId:Ae,nodesDraggable:ao}),(0,T.jsx)("div",{className:"react-flow__viewport-portal"})]})})}o(qa,"GraphViewComponent");qa.displayName="GraphView";var op=(0,P.memo)(qa),rp=$r("React Flow","https://reactflow.dev/"),pa=o(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:c,minZoom:l=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:h,zIndexMode:f="basic"}={})=>{let g=new Map,p=new Map,S=new Map,b=new Map,x=r??t??[],v=n??e??[],m=d??[0,0],w=h??Et;Kr(S,b,x);let{nodesInitialized:N}=Zn(v,g,p,{nodeOrigin:m,nodeExtent:w,zIndexMode:f}),C=[0,0,1];if(a&&i&&s){let I=Ct(g,{filter:o(z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight)),"filter")}),{x:k,y:A,zoom:F}=ut(I,i,s,l,u,c?.padding??.1);C=[k,A,F]}return{rfId:"1",width:i??0,height:s??0,transform:C,nodes:v,nodesInitialized:N,nodeLookup:g,parentLookup:p,edges:x,edgeLookup:b,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Et,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Xe.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:m,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:c,fitViewResolver:null,connection:{...Ar},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:rp,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:kr,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},"getInitialState"),ip=o(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:h,zIndexMode:f})=>Ws((g,p)=>{async function S(){let{nodeLookup:b,panZoom:x,fitViewOptions:v,fitViewResolver:m,width:w,height:N,minZoom:C,maxZoom:I}=p();x&&(await us({nodes:b,width:w,height:N,panZoom:x,minZoom:C,maxZoom:I},v),m?.resolve(!0),g({fitViewResolver:null}))}return o(S,"resolveFitView"),{...pa({nodes:e,edges:t,width:i,height:s,fitView:a,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:h,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:o(b=>{let{nodeLookup:x,parentLookup:v,nodeOrigin:m,nodeExtent:w,elevateNodesOnSelect:N,fitViewQueued:C,zIndexMode:I,nodesSelectionActive:k}=p(),{nodesInitialized:A,hasSelectedNodes:F}=Zn(b,x,v,{nodeOrigin:m,nodeExtent:w,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:I}),z=k&&F;C&&A?(S(),g({nodes:b,nodesInitialized:A,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:z})):g({nodes:b,nodesInitialized:A,nodesSelectionActive:z})},"setNodes"),setEdges:o(b=>{let{connectionLookup:x,edgeLookup:v}=p();Kr(x,v,b),g({edges:b})},"setEdges"),setDefaultNodesAndEdges:o((b,x)=>{if(b){let{setNodes:v}=p();v(b),g({hasDefaultNodes:!0})}if(x){let{setEdges:v}=p();v(x),g({hasDefaultEdges:!0})}},"setDefaultNodesAndEdges"),updateNodeInternals:o(b=>{let{triggerNodeChanges:x,nodeLookup:v,parentLookup:m,domNode:w,nodeOrigin:N,nodeExtent:C,debug:I,fitViewQueued:k,zIndexMode:A}=p(),{changes:F,updatedInternals:z}=Cs(b,v,m,w,N,C,A);z&&(vs(v,m,{nodeOrigin:N,nodeExtent:C,zIndexMode:A}),k?(S(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),F?.length>0&&(I&&console.log("React Flow: trigger node changes",F),x?.(F)))},"updateNodeInternals"),updateNodePositions:o((b,x=!1)=>{let v=[],m=[],{nodeLookup:w,triggerNodeChanges:N,connection:C,updateConnection:I,onNodesChangeMiddlewareMap:k}=p();for(let[A,F]of b){let z=w.get(A),H=!!(z?.expandParent&&z?.parentId&&F?.position),$={id:A,type:"position",position:H?{x:Math.max(0,F.position.x),y:Math.max(0,F.position.y)}:F.position,dragging:x};if(z&&C.inProgress&&C.fromNode.id===z.id){let y=Ze(z,C.fromHandle,X.Left,!0);I({...C,from:y})}H&&z.parentId&&v.push({id:A,parentId:z.parentId,rect:{...F.internals.positionAbsolute,width:F.measured.width??0,height:F.measured.height??0}}),m.push($)}if(v.length>0){let{parentLookup:A,nodeOrigin:F}=p(),z=Un(v,w,A,F);m.push(...z)}for(let A of k.values())m=A(m);N(m)},"updateNodePositions"),triggerNodeChanges:o(b=>{let{onNodesChange:x,setNodes:v,nodes:m,hasDefaultNodes:w,debug:N}=p();if(b?.length){if(w){let C=Sa(b,m);v(C)}N&&console.log("React Flow: trigger node changes",b),x?.(b)}},"triggerNodeChanges"),triggerEdgeChanges:o(b=>{let{onEdgesChange:x,setEdges:v,edges:m,hasDefaultEdges:w,debug:N}=p();if(b?.length){if(w){let C=va(b,m);v(C)}N&&console.log("React Flow: trigger edge changes",b),x?.(b)}},"triggerEdgeChanges"),addSelectedNodes:o(b=>{let{multiSelectionActive:x,edgeLookup:v,nodeLookup:m,triggerNodeChanges:w,triggerEdgeChanges:N}=p();if(x){let C=b.map(I=>dt(I,!0));w(C);return}w(Pt(m,new Set([...b]),!0)),N(Pt(v))},"addSelectedNodes"),addSelectedEdges:o(b=>{let{multiSelectionActive:x,edgeLookup:v,nodeLookup:m,triggerNodeChanges:w,triggerEdgeChanges:N}=p();if(x){let C=b.map(I=>dt(I,!0));N(C);return}N(Pt(v,new Set([...b]))),w(Pt(m,new Set,!0))},"addSelectedEdges"),unselectNodesAndEdges:o(({nodes:b,edges:x}={})=>{let{edges:v,nodes:m,nodeLookup:w,triggerNodeChanges:N,triggerEdgeChanges:C}=p(),I=b||m,k=x||v,A=[];for(let z of I){if(!z.selected)continue;let H=w.get(z.id);H&&(H.selected=!1),A.push(dt(z.id,!1))}let F=[];for(let z of k)z.selected&&F.push(dt(z.id,!1));N(A),C(F)},"unselectNodesAndEdges"),setMinZoom:o(b=>{let{panZoom:x,maxZoom:v}=p();x?.setScaleExtent([b,v]),g({minZoom:b})},"setMinZoom"),setMaxZoom:o(b=>{let{panZoom:x,minZoom:v}=p();x?.setScaleExtent([v,b]),g({maxZoom:b})},"setMaxZoom"),setTranslateExtent:o(b=>{p().panZoom?.setTranslateExtent(b),g({translateExtent:b})},"setTranslateExtent"),resetSelectedElements:o(()=>{let{edges:b,nodes:x,triggerNodeChanges:v,triggerEdgeChanges:m,elementsSelectable:w}=p();if(!w)return;let N=x.reduce((I,k)=>k.selected?[...I,dt(k.id,!1)]:I,[]),C=b.reduce((I,k)=>k.selected?[...I,dt(k.id,!1)]:I,[]);v(N),m(C)},"resetSelectedElements"),setNodeExtent:o(b=>{let{nodes:x,nodeLookup:v,parentLookup:m,nodeOrigin:w,elevateNodesOnSelect:N,nodeExtent:C,zIndexMode:I}=p();b[0][0]===C[0][0]&&b[0][1]===C[0][1]&&b[1][0]===C[1][0]&&b[1][1]===C[1][1]||(Zn(x,v,m,{nodeOrigin:w,nodeExtent:b,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:I}),g({nodeExtent:b}))},"setNodeExtent"),panBy:o(b=>{let{transform:x,width:v,height:m,panZoom:w,translateExtent:N}=p();return _s({delta:b,panZoom:w,transform:x,translateExtent:N,width:v,height:m})},"panBy"),setCenter:o(async(b,x,v)=>{let{width:m,height:w,maxZoom:N,panZoom:C}=p();if(!C)return!1;let I=typeof v?.zoom<"u"?v.zoom:N;return await C.setViewport({x:m/2-b*I,y:w/2-x*I,zoom:I},{duration:v?.duration,ease:v?.ease,interpolate:v?.interpolate}),!0},"setCenter"),cancelConnection:o(()=>{g({connection:{...Ar}})},"cancelConnection"),updateConnection:o(b=>{g({connection:b})},"updateConnection"),reset:o(()=>g({...pa()}),"reset")}},Object.is),"createStore");function sp({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,initialMinZoom:a,initialMaxZoom:c,initialFitViewOptions:l,fitView:u,nodeOrigin:d,nodeExtent:h,zIndexMode:f,children:g}){let[p]=(0,P.useState)(()=>ip({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:u,minZoom:a,maxZoom:c,fitViewOptions:l,nodeOrigin:d,nodeExtent:h,zIndexMode:f}));return(0,T.jsx)(Sf,{value:p,children:(0,T.jsx)(Xf,{children:(0,T.jsx)(sh,{children:g})})})}o(sp,"ReactFlowProvider");function ap({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:a,fitView:c,fitViewOptions:l,minZoom:u,maxZoom:d,nodeOrigin:h,nodeExtent:f,zIndexMode:g}){return(0,P.useContext)(jn)?(0,T.jsx)(T.Fragment,{children:e}):(0,T.jsx)(sp,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:a,fitView:c,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:h,nodeExtent:f,zIndexMode:g,children:e})}o(ap,"Wrapper");var cp={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function lp({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:a,onNodeClick:c,onEdgeClick:l,onInit:u,onMove:d,onMoveStart:h,onMoveEnd:f,onConnect:g,onConnectStart:p,onConnectEnd:S,onClickConnectStart:b,onClickConnectEnd:x,onNodeMouseEnter:v,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:C,onNodeDragStart:I,onNodeDrag:k,onNodeDragStop:A,onNodesDelete:F,onEdgesDelete:z,onDelete:H,onSelectionChange:$,onSelectionDragStart:y,onSelectionDrag:E,onSelectionDragStop:_,onSelectionContextMenu:M,onSelectionStart:D,onSelectionEnd:R,onBeforeDelete:L,connectionMode:V,connectionLineType:B=Ie.Bezier,connectionLineStyle:U,connectionLineComponent:W,connectionLineContainerStyle:G,deleteKeyCode:ee="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:O=!1,selectionMode:Y=st.Full,panActivationKeyCode:j="Space",multiSelectionKeyCode:J=It()?"Meta":"Control",zoomActivationKeyCode:q=It()?"Meta":"Control",snapToGrid:Q,snapGrid:te,onlyRenderVisibleElements:oe=!1,selectNodesOnDrag:re,nodesDraggable:de,autoPanOnNodeFocus:Pe,nodesConnectable:_e,nodesFocusable:Ne,nodeOrigin:ke=wa,edgesFocusable:$t,edgesReconnectable:Ge,elementsSelectable:Qe=!0,defaultViewport:ve=Rf,minZoom:Ae=.5,maxZoom:Te=2,translateExtent:Je=Et,preventScrolling:ao=!0,nodeExtent:co,defaultMarkerColor:$c="#b1b1b7",zoomOnScroll:Lc=!0,zoomOnPinch:Hc=!0,panOnScroll:Bc=!1,panOnScrollSpeed:Vc=.5,panOnScrollMode:Fc=$e.Free,zoomOnDoubleClick:Wc=!0,panOnDrag:Yc=!0,onPaneClick:Xc,onPaneMouseEnter:Zc,onPaneMouseMove:Uc,onPaneMouseLeave:qc,onPaneScroll:Kc,onPaneContextMenu:Gc,paneClickDistance:Qc=1,nodeClickDistance:Jc=0,children:jc,onReconnect:el,onReconnectStart:tl,onReconnectEnd:nl,onEdgeContextMenu:ol,onEdgeDoubleClick:rl,onEdgeMouseEnter:il,onEdgeMouseMove:sl,onEdgeMouseLeave:al,reconnectRadius:cl=10,onNodesChange:ll,onEdgesChange:ul,noDragClassName:dl="nodrag",noWheelClassName:fl="nowheel",noPanClassName:li="nopan",fitView:ui,fitViewOptions:di,connectOnClick:hl,attributionPosition:pl,proOptions:gl,defaultEdgeOptions:ml,elevateNodesOnSelect:yl=!0,elevateEdgesOnSelect:xl=!1,disableKeyboardA11y:fi=!1,autoPanOnConnect:wl,autoPanOnNodeDrag:bl,autoPanOnSelection:Sl=!0,autoPanSpeed:vl,connectionRadius:El,isValidConnection:Cl,onError:_l,style:Nl,id:hi,nodeDragThreshold:Ml,connectionDragThreshold:Il,viewport:Pl,onViewportChange:kl,width:Al,height:Tl,colorMode:Dl="light",debug:Rl,onScroll:pi,ariaLabelConfig:zl,zIndexMode:gi="basic",...Ol},$l){let lo=hi||"1",Ll=Lf(Dl),Hl=(0,P.useCallback)(mi=>{mi.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),pi?.(mi)},[pi]);return(0,T.jsx)("div",{"data-testid":"rf__wrapper",...Ol,onScroll:Hl,style:{...Nl,...cp},ref:$l,className:ae(["react-flow",i,Ll]),id:hi,role:"application",children:(0,T.jsxs)(ap,{nodes:e,edges:t,width:Al,height:Tl,fitView:ui,fitViewOptions:di,minZoom:Ae,maxZoom:Te,nodeOrigin:ke,nodeExtent:co,zIndexMode:gi,children:[(0,T.jsx)($f,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:p,onConnectEnd:S,onClickConnectStart:b,onClickConnectEnd:x,nodesDraggable:de,autoPanOnNodeFocus:Pe,nodesConnectable:_e,nodesFocusable:Ne,edgesFocusable:$t,edgesReconnectable:Ge,elementsSelectable:Qe,elevateNodesOnSelect:yl,elevateEdgesOnSelect:xl,minZoom:Ae,maxZoom:Te,nodeExtent:co,onNodesChange:ll,onEdgesChange:ul,snapToGrid:Q,snapGrid:te,connectionMode:V,translateExtent:Je,connectOnClick:hl,defaultEdgeOptions:ml,fitView:ui,fitViewOptions:di,onNodesDelete:F,onEdgesDelete:z,onDelete:H,onNodeDragStart:I,onNodeDrag:k,onNodeDragStop:A,onSelectionDrag:E,onSelectionDragStart:y,onSelectionDragStop:_,onMove:d,onMoveStart:h,onMoveEnd:f,noPanClassName:li,nodeOrigin:ke,rfId:lo,autoPanOnConnect:wl,autoPanOnNodeDrag:bl,autoPanSpeed:vl,onError:_l,connectionRadius:El,isValidConnection:Cl,selectNodesOnDrag:re,nodeDragThreshold:Ml,connectionDragThreshold:Il,onBeforeDelete:L,debug:Rl,ariaLabelConfig:zl,zIndexMode:gi}),(0,T.jsx)(op,{onInit:u,onNodeClick:c,onEdgeClick:l,onNodeMouseEnter:v,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:C,nodeTypes:s,edgeTypes:a,connectionLineType:B,connectionLineStyle:U,connectionLineComponent:W,connectionLineContainerStyle:G,selectionKeyCode:K,selectionOnDrag:O,selectionMode:Y,deleteKeyCode:ee,multiSelectionKeyCode:J,panActivationKeyCode:j,zoomActivationKeyCode:q,onlyRenderVisibleElements:oe,defaultViewport:ve,translateExtent:Je,minZoom:Ae,maxZoom:Te,preventScrolling:ao,zoomOnScroll:Lc,zoomOnPinch:Hc,zoomOnDoubleClick:Wc,panOnScroll:Bc,panOnScrollSpeed:Vc,panOnScrollMode:Fc,panOnDrag:Yc,autoPanOnSelection:Sl,onPaneClick:Xc,onPaneMouseEnter:Zc,onPaneMouseMove:Uc,onPaneMouseLeave:qc,onPaneScroll:Kc,onPaneContextMenu:Gc,paneClickDistance:Qc,nodeClickDistance:Jc,onSelectionContextMenu:M,onSelectionStart:D,onSelectionEnd:R,onReconnect:el,onReconnectStart:tl,onReconnectEnd:nl,onEdgeContextMenu:ol,onEdgeDoubleClick:rl,onEdgeMouseEnter:il,onEdgeMouseMove:sl,onEdgeMouseLeave:al,reconnectRadius:cl,defaultMarkerColor:$c,noDragClassName:dl,noWheelClassName:fl,noPanClassName:li,rfId:lo,disableKeyboardA11y:fi,nodeExtent:co,viewport:Pl,onViewportChange:kl,nodesDraggable:de}),(0,T.jsx)(Df,{onSelectionChange:$}),jc,(0,T.jsx)(If,{proOptions:gl,position:pl}),(0,T.jsx)(Mf,{rfId:lo,disableKeyboardA11y:fi})]})})}o(lp,"ReactFlow");var Ka=Ea(lp);var up=o(e=>e.nodes,"nodesSelector");function Ga(){return ne(up,ie)}o(Ga,"useNodes");function Qa(e){let[t,n]=(0,P.useState)(e),r=(0,P.useCallback)(i=>n(s=>Sa(i,s)),[]);return[t,n,r]}o(Qa,"useNodesState");function Ja(e){let[t,n]=(0,P.useState)(e),r=(0,P.useCallback)(i=>n(s=>va(i,s)),[]);return[t,n,r]}o(Ja,"useEdgesState");var dp=o(e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(let[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!Bn(n.userNode))return!1;return!0},"selector$4");function ja(e={includeHiddenNodes:!1}){return ne(dp(e))}o(ja,"useNodesInitialized");var FS=ye.error014();function fp({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,T.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ae(["react-flow__background-pattern",n,r])})}o(fp,"LinePattern");function hp({radius:e,className:t}){return(0,T.jsx)("circle",{cx:e,cy:e,r:e,className:ae(["react-flow__background-pattern","dots",t])})}o(hp,"DotPattern");var qe;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(qe||(qe={}));var pp={[qe.Dots]:1,[qe.Lines]:1,[qe.Cross]:6},gp=o(e=>({transform:e.transform,patternId:`pattern-${e.rfId}`}),"selector$3");function ec({id:e,variant:t=qe.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:a,bgColor:c,style:l,className:u,patternClassName:d}){let h=(0,P.useRef)(null),{transform:f,patternId:g}=ne(gp,ie),p=r||pp[t],S=t===qe.Dots,b=t===qe.Cross,x=Array.isArray(n)?n:[n,n],v=[x[0]*f[2]||1,x[1]*f[2]||1],m=p*f[2],w=Array.isArray(s)?s:[s,s],N=b?[m,m]:v,C=[w[0]*f[2]+N[0]/2,w[1]*f[2]+N[1]/2],I=`${g}${e||""}`;return(0,T.jsxs)("svg",{className:ae(["react-flow__background",u]),style:{...l,...eo,"--xy-background-color-props":c,"--xy-background-pattern-color-props":a},ref:h,"data-testid":"rf__background",children:[(0,T.jsx)("pattern",{id:I,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:S?(0,T.jsx)(hp,{radius:m/2,className:d}):(0,T.jsx)(fp,{dimensions:N,lineWidth:i,variant:t,className:d})}),(0,T.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${I})`})]})}o(ec,"BackgroundComponent");ec.displayName="Background";var tc=(0,P.memo)(ec);function mp(){return(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,T.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}o(mp,"PlusIcon");function yp(){return(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,T.jsx)("path",{d:"M0 0h32v4.2H0z"})})}o(yp,"MinusIcon");function xp(){return(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,T.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"})})}o(xp,"FitViewIcon");function wp(){return(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,T.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"})})}o(wp,"LockIcon");function bp(){return(0,T.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,T.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"})})}o(bp,"UnlockIcon");function Qn({children:e,className:t,...n}){return(0,T.jsx)("button",{type:"button",className:ae(["react-flow__controls-button",t]),...n,children:e})}o(Qn,"ControlButton");var Sp=o(e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig}),"selector$2");function nc({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:a,onFitView:c,onInteractiveChange:l,className:u,children:d,position:h="bottom-left",orientation:f="vertical","aria-label":g}){let p=se(),{isInteractive:S,minZoomReached:b,maxZoomReached:x,ariaLabelConfig:v}=ne(Sp,ie),{zoomIn:m,zoomOut:w,fitView:N}=kt(),C=o(()=>{m(),s?.()},"onZoomInHandler"),I=o(()=>{w(),a?.()},"onZoomOutHandler"),k=o(()=>{N(i),c?.()},"onFitViewHandler"),A=o(()=>{p.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),l?.(!S)},"onToggleInteractivity");return(0,T.jsxs)(Ke,{className:ae(["react-flow__controls",f==="horizontal"?"horizontal":"vertical",u]),position:h,style:e,"data-testid":"rf__controls","aria-label":g??v["controls.ariaLabel"],children:[t&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Qn,{onClick:C,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:x,children:(0,T.jsx)(mp,{})}),(0,T.jsx)(Qn,{onClick:I,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:b,children:(0,T.jsx)(yp,{})})]}),n&&(0,T.jsx)(Qn,{className:"react-flow__controls-fitview",onClick:k,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:(0,T.jsx)(xp,{})}),r&&(0,T.jsx)(Qn,{className:"react-flow__controls-interactive",onClick:A,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:S?(0,T.jsx)(bp,{}):(0,T.jsx)(wp,{})}),d]})}o(nc,"ControlsComponent");nc.displayName="Controls";var oc=(0,P.memo)(nc);function vp({id:e,x:t,y:n,width:r,height:i,style:s,color:a,strokeColor:c,strokeWidth:l,className:u,borderRadius:d,shapeRendering:h,selected:f,onClick:g}){let{background:p,backgroundColor:S}=s||{},b=a||p||S;return(0,T.jsx)("rect",{className:ae(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:b,stroke:c,strokeWidth:l},shapeRendering:h,onClick:g?x=>g(x,e):void 0})}o(vp,"MiniMapNodeComponent");var Ep=(0,P.memo)(vp),Cp=o(e=>e.nodes.map(t=>t.id),"selectorNodeIds"),Jr=o(e=>e instanceof Function?e:()=>e,"getAttrFunction");function _p({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=Ep,onClick:a}){let c=ne(Cp,ie),l=Jr(t),u=Jr(e),d=Jr(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return(0,T.jsx)(T.Fragment,{children:c.map(f=>(0,T.jsx)(Mp,{id:f,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:a,shapeRendering:h},f))})}o(_p,"MiniMapNodes");function Np({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:c,onClick:l}){let{node:u,x:d,y:h,width:f,height:g}=ne(p=>{let S=p.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};let b=S.internals.userNode,{x,y:v}=S.internals.positionAbsolute,{width:m,height:w}=Se(b);return{node:b,x,y:v,width:m,height:w}},ie);return!u||u.hidden||!Bn(u)?null:(0,T.jsx)(c,{x:d,y:h,width:f,height:g,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:s,shapeRendering:a,onClick:l,id:u.id})}o(Np,"NodeComponentWrapperInner");var Mp=(0,P.memo)(Np),Ip=(0,P.memo)(_p),Pp=200,kp=150,Ap=o(e=>!e.hidden,"filterHidden"),Tp=o(e=>{let 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]},n=!1;for(let r of e.nodeLookup.values())if(!r.hidden){n=!0;break}return{viewBB:t,boundingRect:n?zr(Ct(e.nodeLookup,{filter:Ap}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},"selector$1"),ga=o((e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,"rectEqual"),Dp=o((e,t)=>ga(e.viewBB,t.viewBB)&&ga(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,"areEqual"),Rp="react-flow__minimap-desc";function rc({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:c,bgColor:l,maskColor:u,maskStrokeColor:d,maskStrokeWidth:h,position:f="bottom-right",onClick:g,onNodeClick:p,pannable:S=!1,zoomable:b=!1,ariaLabel:x,inversePan:v,zoomStep:m=1,offsetScale:w=5}){let N=se(),C=(0,P.useRef)(null),{boundingRect:I,panZoom:k,viewBB:A,rfId:F,translateExtent:z,flowWidth:H,flowHeight:$,ariaLabelConfig:y}=ne(Tp,Dp),E=e?.width??Pp,_=e?.height??kp,M=I.width/E,D=I.height/_,R=Math.max(M,D),L=R*E,V=R*_,B=w*R,U=I.x-(L-I.width)/2-B,W=I.y-(V-I.height)/2-B,G=L+B*2,ee=V+B*2,K=`${Rp}-${F}`,O=(0,P.useRef)(0),Y=(0,P.useRef)();O.current=R,(0,P.useEffect)(()=>{let te=N.getState().panZoom;if(C.current&&te)return Y.current=Ts({domNode:C.current,panZoom:te,getTransform:o(()=>N.getState().transform,"getTransform"),getViewScale:o(()=>O.current,"getViewScale")}),()=>{Y.current?.destroy()}},[k]),(0,P.useEffect)(()=>{Y.current?.update({translateExtent:z,width:H,height:$,inversePan:v,pannable:S,zoomStep:m,zoomable:b})},[S,b,v,m,z,H,$]);let j=g?te=>{let[oe,re]=Y.current?.pointer(te)||[0,0];g(te,{x:oe,y:re})}:void 0,J=(0,P.useCallback)((te,oe)=>{let re=N.getState().nodeLookup.get(oe).internals.userNode;p?.(te,re)},[p]),q=p?J:void 0,Q=x??y["minimap.ariaLabel"];return(0,T.jsx)(Ke,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*R:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ae(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,T.jsxs)("svg",{width:E,height:_,viewBox:`${U} ${W} ${G} ${ee}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":K,ref:C,onClick:j,children:[Q&&(0,T.jsx)("title",{id:K,children:Q}),(0,T.jsx)(Ip,{onClick:q,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:c}),(0,T.jsx)("path",{className:"react-flow__minimap-mask",d:`M${U-B},${W-B}h${G+B*2}v${ee+B*2}h${-G-B*2}z
7
+ M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}o(rc,"MiniMapComponent");rc.displayName="MiniMap";var ic=(0,P.memo)(rc),zp=o(e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,"scaleSelector"),Op={[Ue.Line]:"right",[Ue.Handle]:"bottom-right"};function $p({nodeId:e,position:t,variant:n=Ue.Handle,className:r,style:i=void 0,children:s,color:a,minWidth:c=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:f,autoScale:g=!0,shouldResize:p,onResizeStart:S,onResize:b,onResizeEnd:x}){let v=Ia(),m=typeof e=="string"?e:v,w=se(),N=(0,P.useRef)(null),C=n===Ue.Handle,I=ne((0,P.useCallback)(zp(C&&g),[C,g]),ie),k=(0,P.useRef)(null),A=t??Op[n];(0,P.useEffect)(()=>{if(!(!N.current||!m))return k.current||(k.current=$s({domNode:N.current,nodeId:m,getStoreItems:o(()=>{let{nodeLookup:z,transform:H,snapGrid:$,snapToGrid:y,nodeOrigin:E,domNode:_}=w.getState();return{nodeLookup:z,transform:H,snapGrid:$,snapToGrid:y,nodeOrigin:E,paneDomNode:_}},"getStoreItems"),onChange:o((z,H)=>{let{triggerNodeChanges:$,nodeLookup:y,parentLookup:E,nodeOrigin:_}=w.getState(),M=[],D={x:z.x,y:z.y},R=y.get(m);if(R&&R.expandParent&&R.parentId){let L=R.origin??_,V=z.width??R.measured.width??0,B=z.height??R.measured.height??0,U={id:R.id,parentId:R.parentId,rect:{width:V,height:B,...Lr({x:z.x??R.position.x,y:z.y??R.position.y},{width:V,height:B},R.parentId,y,L)}},W=Un([U],y,E,_);M.push(...W),D.x=z.x?Math.max(L[0]*V,z.x):void 0,D.y=z.y?Math.max(L[1]*B,z.y):void 0}if(D.x!==void 0&&D.y!==void 0){let L={id:m,type:"position",position:{...D}};M.push(L)}if(z.width!==void 0&&z.height!==void 0){let V={id:m,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};M.push(V)}for(let L of H){let V={...L,type:"position"};M.push(V)}$(M)},"onChange"),onEnd:o(({width:z,height:H})=>{let $={id:m,type:"dimensions",resizing:!1,dimensions:{width:z,height:H}};w.getState().triggerNodeChanges([$])},"onEnd")})),k.current.update({controlPosition:A,boundaries:{minWidth:c,minHeight:l,maxWidth:u,maxHeight:d},keepAspectRatio:h,resizeDirection:f,onResizeStart:S,onResize:b,onResizeEnd:x,shouldResize:p}),()=>{k.current?.destroy()}},[A,c,l,u,d,h,S,b,x,p]);let F=A.split("-");return(0,T.jsx)("div",{className:ae(["react-flow__resize-control","nodrag",...F,n,r]),ref:N,style:{...i,scale:I,...a&&{[C?"backgroundColor":"borderColor"]:a}},children:s})}o($p,"ResizeControl");var WS=(0,P.memo)($p);var me=Le(uo(),1);var Z=Le(xi(),1);function sc(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let n=document.implementation.createHTMLDocument(),r=n.createElement("base"),i=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}o(sc,"resolveUrl");var ac=(()=>{let e=0,t=o(()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4),"random");return()=>(e+=1,`u${t()}${e}`)})();function Ce(e){let t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}o(Ce,"toArray");var At=null;function oo(e={}){return At||(e.includeStyleProperties?(At=e.includeStyleProperties,At):(At=Ce(window.getComputedStyle(document.documentElement)),At))}o(oo,"getStyleProperties");function no(e,t){let r=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return r?parseFloat(r.replace("px","")):0}o(no,"px");function Lp(e){let t=no(e,"border-left-width"),n=no(e,"border-right-width");return e.clientWidth+t+n}o(Lp,"getNodeWidth");function Hp(e){let t=no(e,"border-top-width"),n=no(e,"border-bottom-width");return e.clientHeight+t+n}o(Hp,"getNodeHeight");function ti(e,t={}){let n=t.width||Lp(e),r=t.height||Hp(e);return{width:n,height:r}}o(ti,"getImageSize");function cc(){let e,t;try{t=process}catch{}let n=t&&t.env?t.env.devicePixelRatio:null;return n&&(e=parseInt(n,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}o(cc,"getPixelRatio");var xe=16384;function lc(e){(e.width>xe||e.height>xe)&&(e.width>xe&&e.height>xe?e.width>e.height?(e.height*=xe/e.width,e.width=xe):(e.width*=xe/e.height,e.height=xe):e.width>xe?(e.height*=xe/e.width,e.width=xe):(e.width*=xe/e.height,e.height=xe))}o(lc,"checkCanvasDimensions");function uc(e,t={}){return e.toBlob?new Promise(n=>{e.toBlob(n,t.type?t.type:"image/png",t.quality?t.quality:1)}):new Promise(n=>{let r=window.atob(e.toDataURL(t.type?t.type:void 0,t.quality?t.quality:void 0).split(",")[1]),i=r.length,s=new Uint8Array(i);for(let a=0;a<i;a+=1)s[a]=r.charCodeAt(a);n(new Blob([s],{type:t.type?t.type:"image/png"}))})}o(uc,"canvasToBlob");function Tt(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}o(Tt,"createImage");async function Bp(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}o(Bp,"svgToDataURL");async function dc(e,t,n){let r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),s=document.createElementNS(r,"foreignObject");return i.setAttribute("width",`${t}`),i.setAttribute("height",`${n}`),i.setAttribute("viewBox",`0 0 ${t} ${n}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),s.setAttribute("x","0"),s.setAttribute("y","0"),s.setAttribute("externalResourcesRequired","true"),i.appendChild(s),s.appendChild(e),Bp(i)}o(dc,"nodeToDataURL");var pe=o((e,t)=>{if(e instanceof t)return!0;let n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||pe(n,t)},"isInstanceOfElement");function Vp(e){let t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}o(Vp,"formatCSSText");function Fp(e,t){return oo(t).map(n=>{let r=e.getPropertyValue(n),i=e.getPropertyPriority(n);return`${n}: ${r}${i?" !important":""};`}).join(" ")}o(Fp,"formatCSSProperties");function Wp(e,t,n,r){let i=`.${e}:${t}`,s=n.cssText?Vp(n):Fp(n,r);return document.createTextNode(`${i}{${s}}`)}o(Wp,"getPseudoElementStyle");function fc(e,t,n,r){let i=window.getComputedStyle(e,n),s=i.getPropertyValue("content");if(s===""||s==="none")return;let a=ac();try{t.className=`${t.className} ${a}`}catch{return}let c=document.createElement("style");c.appendChild(Wp(a,n,i,r)),t.appendChild(c)}o(fc,"clonePseudoElement");function hc(e,t,n){fc(e,t,":before",n),fc(e,t,":after",n)}o(hc,"clonePseudoElements");var pc="application/font-woff",gc="image/jpeg",Yp={woff:pc,woff2:pc,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:gc,jpeg:gc,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Xp(e){let t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}o(Xp,"getExtension");function Dt(e){let t=Xp(e).toLowerCase();return Yp[t]||""}o(Dt,"getMimeType");function Zp(e){return e.split(/,/)[1]}o(Zp,"getContentFromDataUrl");function pn(e){return e.search(/^(data:)/)!==-1}o(pn,"isDataUrl");function oi(e,t){return`data:${t};base64,${e}`}o(oi,"makeDataUrl");async function ri(e,t,n){let r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);let i=await r.blob();return new Promise((s,a)=>{let c=new FileReader;c.onerror=a,c.onloadend=()=>{try{s(n({res:r,result:c.result}))}catch(l){a(l)}},c.readAsDataURL(i)})}o(ri,"fetchAsDataURL");var ni={};function Up(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}o(Up,"getCacheKey");async function Rt(e,t,n){let r=Up(e,t,n.includeQueryParams);if(ni[r]!=null)return ni[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let i;try{let s=await ri(e,n.fetchRequestInit,({res:a,result:c})=>(t||(t=a.headers.get("Content-Type")||""),Zp(c)));i=oi(s,t)}catch(s){i=n.imagePlaceholder||"";let a=`Failed to fetch resource: ${e}`;s&&(a=typeof s=="string"?s:s.message),a&&console.warn(a)}return ni[r]=i,i}o(Rt,"resourceToDataURL");async function qp(e){let t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Tt(t)}o(qp,"cloneCanvasElement");async function Kp(e,t){if(e.currentSrc){let s=document.createElement("canvas"),a=s.getContext("2d");s.width=e.clientWidth,s.height=e.clientHeight,a?.drawImage(e,0,0,s.width,s.height);let c=s.toDataURL();return Tt(c)}let n=e.poster,r=Dt(n),i=await Rt(n,r,t);return Tt(i)}o(Kp,"cloneVideoElement");async function Gp(e,t){var n;try{if(!((n=e?.contentDocument)===null||n===void 0)&&n.body)return await gn(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}o(Gp,"cloneIFrameElement");async function Qp(e,t){return pe(e,HTMLCanvasElement)?qp(e):pe(e,HTMLVideoElement)?Kp(e,t):pe(e,HTMLIFrameElement)?Gp(e,t):e.cloneNode(mc(e))}o(Qp,"cloneSingleNode");var Jp=o(e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT","isSlotElement"),mc=o(e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG","isSVGElement");async function jp(e,t,n){var r,i;if(mc(t))return t;let s=[];return Jp(e)&&e.assignedNodes?s=Ce(e.assignedNodes()):pe(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?s=Ce(e.contentDocument.body.childNodes):s=Ce(((i=e.shadowRoot)!==null&&i!==void 0?i:e).childNodes),s.length===0||pe(e,HTMLVideoElement)||await s.reduce((a,c)=>a.then(()=>gn(c,n)).then(l=>{l&&t.appendChild(l)}),Promise.resolve()),t}o(jp,"cloneChildren");function eg(e,t,n){let r=t.style;if(!r)return;let i=window.getComputedStyle(e);i.cssText?(r.cssText=i.cssText,r.transformOrigin=i.transformOrigin):oo(n).forEach(s=>{let a=i.getPropertyValue(s);s==="font-size"&&a.endsWith("px")&&(a=`${Math.floor(parseFloat(a.substring(0,a.length-2)))-.1}px`),pe(e,HTMLIFrameElement)&&s==="display"&&a==="inline"&&(a="block"),s==="d"&&t.getAttribute("d")&&(a=`path(${t.getAttribute("d")})`),r.setProperty(s,a,i.getPropertyPriority(s))})}o(eg,"cloneCSSStyle");function tg(e,t){pe(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),pe(e,HTMLInputElement)&&t.setAttribute("value",e.value)}o(tg,"cloneInputValue");function ng(e,t){if(pe(e,HTMLSelectElement)){let r=Array.from(t.children).find(i=>e.value===i.getAttribute("value"));r&&r.setAttribute("selected","")}}o(ng,"cloneSelectValue");function og(e,t,n){return pe(t,Element)&&(eg(e,t,n),hc(e,t,n),tg(e,t),ng(e,t)),t}o(og,"decorate");async function rg(e,t){let n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;let r={};for(let s=0;s<n.length;s++){let c=n[s].getAttribute("xlink:href");if(c){let l=e.querySelector(c),u=document.querySelector(c);!l&&u&&!r[c]&&(r[c]=await gn(u,t,!0))}}let i=Object.values(r);if(i.length){let s="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg");a.setAttribute("xmlns",s),a.style.position="absolute",a.style.width="0",a.style.height="0",a.style.overflow="hidden",a.style.display="none";let c=document.createElementNS(s,"defs");a.appendChild(c);for(let l=0;l<i.length;l++)c.appendChild(i[l]);e.appendChild(a)}return e}o(rg,"ensureSVGSymbols");async function gn(e,t,n){return!n&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(r=>Qp(r,t)).then(r=>jp(e,r,t)).then(r=>og(e,r,t)).then(r=>rg(r,t))}o(gn,"cloneNode");var yc=/url\((['"]?)([^'"]+?)\1\)/g,ig=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,sg=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function ag(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}o(ag,"toRegex");function cg(e){let t=[];return e.replace(yc,(n,r,i)=>(t.push(i),n)),t.filter(n=>!pn(n))}o(cg,"parseURLs");async function lg(e,t,n,r,i){try{let s=n?sc(t,n):t,a=Dt(t),c;if(i){let l=await i(s);c=oi(l,a)}else c=await Rt(s,a,r);return e.replace(ag(t),`$1${c}$3`)}catch{}return e}o(lg,"embed");function ug(e,{preferredFontFormat:t}){return t?e.replace(sg,n=>{for(;;){let[r,,i]=ig.exec(n)||[];if(!i)return"";if(i===t)return`src: ${r};`}}):e}o(ug,"filterPreferredFontFormat");function ii(e){return e.search(yc)!==-1}o(ii,"shouldEmbed");async function ro(e,t,n){if(!ii(e))return e;let r=ug(e,n);return cg(r).reduce((s,a)=>s.then(c=>lg(c,a,t,n)),Promise.resolve(r))}o(ro,"embedResources");async function zt(e,t,n){var r;let i=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(i){let s=await ro(i,null,n);return t.style.setProperty(e,s,t.style.getPropertyPriority(e)),!0}return!1}o(zt,"embedProp");async function dg(e,t){await zt("background",e,t)||await zt("background-image",e,t),await zt("mask",e,t)||await zt("-webkit-mask",e,t)||await zt("mask-image",e,t)||await zt("-webkit-mask-image",e,t)}o(dg,"embedBackground");async function fg(e,t){let n=pe(e,HTMLImageElement);if(!(n&&!pn(e.src))&&!(pe(e,SVGImageElement)&&!pn(e.href.baseVal)))return;let r=n?e.src:e.href.baseVal,i=await Rt(r,Dt(r),t);await new Promise((s,a)=>{e.onload=s,e.onerror=t.onImageErrorHandler?(...l)=>{try{s(t.onImageErrorHandler(...l))}catch(u){a(u)}}:a;let c=e;c.decode&&(c.decode=s),c.loading==="lazy"&&(c.loading="eager"),n?(e.srcset="",e.src=i):e.href.baseVal=i})}o(fg,"embedImageNode");async function hg(e,t){let r=Ce(e.childNodes).map(i=>si(i,t));await Promise.all(r).then(()=>e)}o(hg,"embedChildren");async function si(e,t){pe(e,Element)&&(await dg(e,t),await fg(e,t),await hg(e,t))}o(si,"embedImages");function xc(e,t){let{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);let r=t.style;return r!=null&&Object.keys(r).forEach(i=>{n[i]=r[i]}),e}o(xc,"applyStyle");var wc={};async function bc(e){let t=wc[e];if(t!=null)return t;let r=await(await fetch(e)).text();return t={url:e,cssText:r},wc[e]=t,t}o(bc,"fetchCSS");async function Sc(e,t){let n=e.cssText,r=/url\(["']?([^"')]+)["']?\)/g,s=(n.match(/url\([^)]+\)/g)||[]).map(async a=>{let c=a.replace(r,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),ri(c,t.fetchRequestInit,({result:l})=>(n=n.replace(a,`url(${l})`),[a,l]))});return Promise.all(s).then(()=>n)}o(Sc,"embedFonts");function vc(e){if(e==null)return[];let t=[],n=/(\/\*[\s\S]*?\*\/)/gi,r=e.replace(n,""),i=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){let l=i.exec(r);if(l===null)break;t.push(l[0])}r=r.replace(i,"");let s=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(a,"gi");for(;;){let l=s.exec(r);if(l===null){if(l=c.exec(r),l===null)break;s.lastIndex=c.lastIndex}else c.lastIndex=s.lastIndex;t.push(l[0])}return t}o(vc,"parseCSS");async function pg(e,t){let n=[],r=[];return e.forEach(i=>{if("cssRules"in i)try{Ce(i.cssRules||[]).forEach((s,a)=>{if(s.type===CSSRule.IMPORT_RULE){let c=a+1,l=s.href,u=bc(l).then(d=>Sc(d,t)).then(d=>vc(d).forEach(h=>{try{i.insertRule(h,h.startsWith("@import")?c+=1:i.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:h,error:f})}})).catch(d=>{console.error("Error loading remote css",d.toString())});r.push(u)}})}catch(s){let a=e.find(c=>c.href==null)||document.styleSheets[0];i.href!=null&&r.push(bc(i.href).then(c=>Sc(c,t)).then(c=>vc(c).forEach(l=>{a.insertRule(l,a.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",s)}}),Promise.all(r).then(()=>(e.forEach(i=>{if("cssRules"in i)try{Ce(i.cssRules||[]).forEach(s=>{n.push(s)})}catch(s){console.error(`Error while reading CSS rules from ${i.href}`,s)}}),n))}o(pg,"getCSSRules");function gg(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>ii(t.style.getPropertyValue("src")))}o(gg,"getWebFontRules");async function mg(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");let n=Ce(e.ownerDocument.styleSheets),r=await pg(n,t);return gg(r)}o(mg,"parseWebFontRules");function Ec(e){return e.trim().replace(/["']/g,"")}o(Ec,"normalizeFontFamily");function yg(e){let t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(s=>{t.add(Ec(s))}),Array.from(r.children).forEach(s=>{s instanceof HTMLElement&&n(s)})}return o(n,"traverse"),n(e),t}o(yg,"getUsedFonts");async function Cc(e,t){let n=await mg(e,t),r=yg(e);return(await Promise.all(n.filter(s=>r.has(Ec(s.style.fontFamily))).map(s=>{let a=s.parentStyleSheet?s.parentStyleSheet.href:null;return ro(s.cssText,a,t)}))).join(`
8
+ `)}o(Cc,"getWebFontCSS");async function _c(e,t){let n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await Cc(e,t);if(n){let r=document.createElement("style"),i=document.createTextNode(n);r.appendChild(i),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}o(_c,"embedWebFonts");async function ai(e,t={}){let{width:n,height:r}=ti(e,t),i=await gn(e,t,!0);return await _c(i,t),await si(i,t),xc(i,t),await dc(i,n,r)}o(ai,"toSvg");async function xg(e,t={}){let{width:n,height:r}=ti(e,t),i=await ai(e,t),s=await Tt(i),a=document.createElement("canvas"),c=a.getContext("2d"),l=t.pixelRatio||cc(),u=t.canvasWidth||n,d=t.canvasHeight||r;return a.width=u*l,a.height=d*l,t.skipAutoScale||lc(a),a.style.width=`${u}`,a.style.height=`${d}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,a.width,a.height)),c.drawImage(s,0,0,a.width,a.height),a}o(xg,"toCanvas");async function Nc(e,t={}){let n=await xg(e,t);return await uc(n)}o(Nc,"toBlob");function wg(e){let t=(0,ht.c)(10),n,r,i;t[0]!==e?({className:n,selected:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i):(n=t[1],r=t[2],i=t[3]);let s=i===!0?"":void 0,a;t[4]!==n?(a=je("rounded-md border border-border bg-card text-card-foreground shadow-sm transition-colors","data-[selected]:border-ring data-[selected]:ring-[3px] data-[selected]:ring-ring/30",n),t[4]=n,t[5]=a):a=t[5];let c;return t[6]!==r||t[7]!==s||t[8]!==a?(c=(0,Z.jsx)("div",{"data-slot":"base-node","data-selected":s,className:a,...r}),t[6]=r,t[7]=s,t[8]=a,t[9]=c):c=t[9],c}o(wg,"Ee");function bg(e){let t=(0,ht.c)(8),n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=je("flex items-center gap-2 rounded-t-md bg-muted/50 px-3 py-1.5",n),t[3]=n,t[4]=i):i=t[4];let s;return t[5]!==r||t[6]!==i?(s=(0,Z.jsx)("div",{"data-slot":"base-node-header",className:i,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}o(bg,"Te");function Sg(e){let t=(0,ht.c)(8),n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let i;t[3]!==n?(i=je("flex flex-col",n),t[3]=n,t[4]=i):i=t[4];let s;return t[5]!==r||t[6]!==i?(s=(0,Z.jsx)("div",{"data-slot":"base-node-content",className:i,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}o(Sg,"$e");var Mc=o(e=>{let t=e.ref===void 0?e.type:`${e.type} \u2192 ${e.ref}`;return e.optional===!0?`${t}?`:t},"F"),vg=o(e=>{let t=(0,ht.c)(22),{data:n,selected:r}=e,i=Lt(),s;t[0]!==n.label||t[1]!==n.loadError||t[2]!==i?(s=n.loadError===!0?(0,Z.jsx)("span",{className:"px-3 py-1.5 text-xs text-destructive","data-testid":`sd-node-${n.label}-error`,children:i("Columns unavailable")}):(0,Z.jsx)("span",{className:"px-3 py-1.5 text-xs text-muted-foreground",children:"\u2014"}),t[0]=n.label,t[1]=n.loadError,t[2]=i,t[3]=s):s=t[3];let a=s,c=`sd-node-${n.label}`,l;t[4]!==n.label?(l=(0,Z.jsx)("span",{className:"truncate font-mono text-xs font-semibold",title:n.label,children:n.label}),t[4]=n.label,t[5]=l):l=t[5];let u;t[6]!==n.tier?(u=(0,Z.jsx)("span",{className:"ms-auto",children:(0,Z.jsx)(Ni,{tier:n.tier})}),t[6]=n.tier,t[7]=u):u=t[7];let d;t[8]!==l||t[9]!==u?(d=(0,Z.jsxs)(bg,{children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let h;t[11]!==n.columns||t[12]!==n.label||t[13]!==a?(h=n.columns.length===0?a:n.columns.map(p=>(0,Z.jsxs)("div",{className:je("relative flex items-center gap-2 border-t border-border px-3 py-1.5 text-xs first:border-t-0",p.pk===!0&&"bg-muted/30"),"data-testid":`sd-col-${n.label}-${p.name}`,children:[(0,Z.jsx)(ft,{className:"!h-2 !w-2 !-left-1 !border-border !bg-muted-foreground/70",id:p.name,isConnectable:!1,position:X.Left,type:"target"}),(0,Z.jsx)("span",{className:"truncate font-mono",title:p.name,children:p.name}),p.pk===!0&&(0,Z.jsx)(Ht,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),p.ref!==void 0&&(0,Z.jsx)(Ht,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),(0,Z.jsx)("span",{className:"ms-auto truncate text-muted-foreground",title:Mc(p),children:Mc(p)}),(0,Z.jsx)(ft,{className:"!h-2 !w-2 !-right-1 !border-border !bg-muted-foreground/70",id:p.name,isConnectable:!1,position:X.Right,type:"source"})]},p.name)),t[11]=n.columns,t[12]=n.label,t[13]=a,t[14]=h):h=t[14];let f;t[15]!==h?(f=(0,Z.jsx)(Sg,{children:h}),t[15]=h,t[16]=f):f=t[16];let g;return t[17]!==r||t[18]!==c||t[19]!==d||t[20]!==f?(g=(0,Z.jsxs)(wg,{className:"w-64 overflow-hidden","data-testid":c,selected:r,children:[d,f]}),t[17]=r,t[18]=c,t[19]=d,t[20]=f,t[21]=g):g=t[21],g},"_e"),Ot=1920,so=1080,kc=32,ci=o((e,t)=>{let n=globalThis.document.createElement("a");n.href=e,n.download=t,globalThis.document.body.append(n),n.click(),n.remove()},"R"),Eg=o((e,t,n="schema-diagram.json")=>{let r={edges:t,exportedAt:new Date().toISOString(),nodes:e},i=JSON.stringify(r,void 0,2),s=globalThis.URL.createObjectURL(new globalThis.Blob([i],{type:"application/json"}));ci(s,n),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(s)},0)},"Ce"),Ac=o((e,t,n,r)=>{let i=un(e),{x:s,y:a,zoom:c}=ut(i,t,n,.1,2,r);return{transform:[s,a,c],zoom:c}},"P"),Cg=o(async(e,t,n="schema-diagram.png")=>{let{transform:r}=Ac(t,Ot,so,kc),[i,s,a]=r,c=await Nc(e,{backgroundColor:"#ffffff",height:so,style:{transform:`translate(${i.toString()}px, ${s.toString()}px) scale(${a.toString()})`,transformOrigin:"top left",width:`${Ot.toString()}px`},width:Ot});if(c===null)throw new yi("INTERNAL","html-to-image produced no blob");let l=globalThis.URL.createObjectURL(c);ci(l,n),globalThis.setTimeout(()=>{globalThis.URL.revokeObjectURL(l)},0)},"Me"),_g=o(async(e,t,n="schema-diagram.svg")=>{let{transform:r}=Ac(t,Ot,so,kc),[i,s,a]=r,c=await ai(e,{backgroundColor:"#ffffff",height:so,style:{transform:`translate(${i.toString()}px, ${s.toString()}px) scale(${a.toString()})`,transformOrigin:"top left",width:`${Ot.toString()}px`},width:Ot});ci(c,n)},"ke"),Tc=256,Dc=112,Ic=36,io=24,Ng=480,Mg=1.4,Ig=o(e=>{let t=Math.max(1,Math.round(Math.sqrt(Mg*e/(Tc+Dc))));return Math.max(Ng,e/t)},"Re"),Pg=38,kg=28,Pc=o(e=>Pg+Math.max(1,e)*kg,"z"),Ag=o((e,t)=>{let n=new Map;for(let a of e)n.set(a,[]);for(let a of t)a.to!==a.from&&n.has(a.from)&&n.has(a.to)&&n.get(a.from)?.push(a.to);let r=new Map,i=new Set,s=o(a=>{let c=r.get(a);if(c!==void 0)return c;if(i.has(a))return 0;i.add(a);let l=0;for(let u of n.get(a)??[])l=Math.max(l,s(u)+1);return i.delete(a),r.set(a,l),l},"r");for(let a of e)s(a);return r},"He"),Tg=o((e,t,n)=>{let r=Ag(e,t),i=new Map;for(let u of e){let d=r.get(u)??0,h=i.get(d);h===void 0?i.set(d,[u]):h.push(u)}let s=e.reduce((u,d)=>u+Pc(n.get(d)??0)+Ic,0),a=Ig(s),c=[],l=0;for(let u of[...i.keys()].toSorted((d,h)=>d-h)){let d=0,h=io;for(let f of i.get(u)??[]){let g=Pc(n.get(f)??0);h>io&&h+g>a&&(d+=1,h=io),c.push({name:f,x:io+(l+d)*(Tc+Dc),y:h}),h+=g+Ic}l+=d+1}return c},"Be"),Dg={databaseSchema:vg},Rc={backgroundColor:et.shard.color},zc={backgroundColor:et.global.color},Rg={global:!0,shard:!0},zg={},Og=o(e=>{let t=e.find(n=>n.pk===!0)?.name;return t!==void 0?t:e.some(n=>n.name==="_id")?"_id":e.some(n=>n.name==="id")?"id":e[0]?.name??"_id"},"Ie"),Oc=o(e=>e.flatMap(t=>t.columns.filter(n=>n.ref!==void 0).map(n=>({column:n.name,from:t.name,to:n.ref}))),"Y"),$g=o((e,t,n)=>{let r=e.map(c=>c.name),i=new Map(e.map(c=>[c.name,c.columns.length])),s=Tg(r,Oc(e),i),a=new Map(e.map(c=>[c.name,c]));return s.flatMap(({name:c,x:l,y:u})=>{let d=a.get(c);return d===void 0?[]:[{className:n[c],data:{columns:d.columns,label:c,loadError:t,tier:d.tier},id:c,position:{x:l,y:u},type:"databaseSchema"}]})},"ze"),Lg=o(e=>{let t=new Map(e.map(n=>[n.name,n.columns]));return Oc(e).flatMap(n=>{let r=t.get(n.to)??[],i=t.get(n.from)??[],s=Og(r);return!r.some(a=>a.name===s)||!i.some(a=>a.name===n.column)?[]:[{id:`${n.from}.${n.column}->${n.to}`,source:n.to,sourceHandle:s,target:n.from,targetHandle:n.column}]})},"Ue"),Hg=o(()=>{let e=(0,ht.c)(15),t=Lt(),n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,Z.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Z.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:Rc}),et.shard.label]}),e[0]=n):n=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,Z.jsxs)("span",{className:"flex items-center gap-1",children:[(0,Z.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:zc}),et.global.label]}),e[1]=r):r=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i=(0,Z.jsx)(Ht,{className:"px-1 py-0 text-[10px] leading-tight",variant:"secondary",children:"PK"}),e[2]=i):i=e[2];let s;e[3]!==t?(s=t("Primary key"),e[3]=t,e[4]=s):s=e[4];let a;e[5]!==s?(a=(0,Z.jsxs)("span",{className:"flex items-center gap-1",children:[i,s]}),e[5]=s,e[6]=a):a=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=(0,Z.jsx)(Ht,{className:"px-1 py-0 text-[10px] leading-tight",variant:"outline",children:"FK"}),e[7]=c):c=e[7];let l;e[8]!==t?(l=t("Foreign key"),e[8]=t,e[9]=l):l=e[9];let u;e[10]!==l?(u=(0,Z.jsxs)("span",{className:"flex items-center gap-1",children:[c,l]}),e[10]=l,e[11]=u):u=e[11];let d;return e[12]!==a||e[13]!==u?(d=(0,Z.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 rounded-xl border border-border bg-card/95 px-2.5 py-1.5 text-[11px] text-muted-foreground shadow-xs",children:[n,r,a,u]}),e[12]=a,e[13]=u,e[14]=d):d=e[14],d},"Ke"),Bg=12,Vg=o(e=>{let t=(0,ht.c)(9),{containerRef:n,seedKey:r}=e,i=ja(),{fitView:s}=kt(),a;t[0]!==n||t[1]!==s||t[2]!==i?(a=o(()=>{if(!i)return;let l=o(()=>{mn(s({duration:0,maxZoom:1.6,padding:.14}))},"d");l();let u=n.current;if(u===null)return;let d=new ResizeObserver(()=>{l()});return d.observe(u),()=>{d.disconnect()}},"n"),t[0]=n,t[1]=s,t[2]=i,t[3]=a):a=t[3];let c;return t[4]!==n||t[5]!==s||t[6]!==i||t[7]!==r?(c=[n,s,i,r],t[4]=n,t[5]=s,t[6]=i,t[7]=r,t[8]=c):c=t[8],(0,me.useEffect)(a,c),null},"We"),Fg=o(({containerRef:e,testIdPrefix:t})=>{let n=Lt(),r=Ga(),{getEdges:i}=kt(),[s,a]=(0,me.useState)(null),c=o(async()=>{let f=e.current?.querySelector(".react-flow__viewport");if(f){a("png");try{await Cg(f,r,`${t}-schema-diagram.png`)}finally{a(null)}}},"l"),l=o(async()=>{let f=e.current?.querySelector(".react-flow__viewport");if(f){a("svg");try{await _g(f,r,`${t}-schema-diagram.svg`)}finally{a(null)}}},"d"),u=o(()=>{a("json");try{Eg(r,i(),`${t}-schema-diagram.json`)}finally{a(null)}},"m"),d=o(()=>{mn(c())},"c"),h=o(()=>{mn(l())},"p");return(0,Z.jsx)(Ke,{position:"top-right",children:(0,Z.jsxs)(Mi,{children:[(0,Z.jsxs)(Ii,{className:"group/button inline-flex shrink-0 cursor-pointer items-center justify-center gap-1 rounded-md border border-border bg-background px-2 text-xs font-medium whitespace-nowrap hover:bg-muted disabled:pointer-events-none disabled:opacity-50","data-testid":`${t}-export-trigger`,disabled:s!==null,children:[(0,Z.jsx)(Si,{className:"size-3.5",icon:bi,strokeWidth:2}),n("Export")]}),(0,Z.jsxs)(Pi,{align:"end",children:[(0,Z.jsx)(xn,{"data-testid":`${t}-export-png`,disabled:s!==null,onClick:d,children:n("PNG")}),(0,Z.jsx)(xn,{"data-testid":`${t}-export-svg`,disabled:s!==null,onClick:h,children:n("SVG")}),(0,Z.jsx)(xn,{"data-testid":`${t}-export-json`,disabled:s!==null,onClick:u,children:n("JSON")})]})]})})},"qe"),Zv=o(({columnsError:e,fill:t=!1,nodeClasses:n,tables:r,testIdPrefix:i})=>{let s=Lt(),[a,c]=(0,me.useState)(Rg),[l,u]=(0,me.useState)(""),d=(0,me.useMemo)(()=>{let k=l.trim().toLowerCase();return r.filter(A=>a[A.tier]&&A.name.toLowerCase().includes(k))},[r,a,l]),h=(0,me.useMemo)(()=>$g(d,e??!1,n??zg),[d,e,n]),f=(0,me.useMemo)(()=>Lg(d),[d]),g=d.map(k=>k.name).join(","),[p,S,b]=Qa(h),[x,v,m]=Ja(f),w=(0,me.useRef)(null);(0,me.useEffect)(()=>{S(h)},[h,S]),(0,me.useEffect)(()=>{v(f)},[f,v]);let N=o(k=>{u(k.target.value)},"ee"),C=o(()=>{c(k=>({...k,shard:!k.shard}))},"te"),I=o(()=>{c(k=>({...k,global:!k.global}))},"oe");return r.length===0?(0,Z.jsx)("section",{className:"flex flex-col gap-2","data-testid":`${i}-section`,children:(0,Z.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":`${i}-empty`,children:s("No tables to graph.")})}):(0,Z.jsx)("section",{className:je("flex flex-col",t&&"min-h-0 flex-1"),"data-testid":`${i}-section`,children:(0,Z.jsx)("div",{className:je("w-full overflow-hidden border border-border bg-muted/20",t?"min-h-0 flex-1":"h-[560px]"),"data-testid":`${i}-canvas`,ref:w,children:(0,Z.jsxs)(Ka,{edges:x,elementsSelectable:!0,fitView:!0,minZoom:.2,nodes:p,nodesConnectable:!1,nodeTypes:Dg,onEdgesChange:m,onNodesChange:b,children:[(0,Z.jsx)(tc,{}),(0,Z.jsx)(Ke,{position:"top-left",children:(0,Z.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl border border-border bg-card/95 p-2 shadow-xs",children:[(0,Z.jsx)(wi,{"aria-label":s("Find table\u2026"),className:"h-7 w-44 text-xs","data-testid":`${i}-find`,onChange:N,placeholder:s("Find table\u2026"),value:l}),(0,Z.jsxs)("div",{"aria-label":s("Storage tiers"),className:"flex items-center gap-1.5",role:"group",children:[(0,Z.jsxs)(fo,{"aria-pressed":a.shard,className:"gap-1.5","data-testid":`${i}-tier-shard`,onClick:C,size:"xs",type:"button",variant:a.shard?"default":"outline",children:[(0,Z.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:Rc}),et.shard.label]}),(0,Z.jsxs)(fo,{"aria-pressed":a.global,className:"gap-1.5","data-testid":`${i}-tier-global`,onClick:I,size:"xs",type:"button",variant:a.global?"default":"outline",children:[(0,Z.jsx)("span",{"aria-hidden":"true",className:"size-1.5 rounded-full",style:zc}),et.global.label]})]})]})}),(0,Z.jsx)(Ke,{position:"bottom-center",children:(0,Z.jsx)(Hg,{})}),(0,Z.jsx)(oc,{showInteractive:!1}),d.length>Bg&&(0,Z.jsx)(ic,{className:"!border !border-border !bg-card",maskColor:"var(--color-muted)",nodeColor:"var(--color-muted-foreground)",nodeStrokeWidth:0,pannable:!0,zoomable:!0}),(0,Z.jsx)(Fg,{containerRef:w,testIdPrefix:i}),(0,Z.jsx)(Vg,{containerRef:w,seedKey:g})]})})})},"dt");export{Zv as a};
@@ -1 +1 @@
1
- import{c as l}from"./chunk-TGHH7ZFA.js";import{j as u}from"./chunk-25NFR6EB.js";import{a as c}from"./chunk-FSRSK4LY.js";import{a as t,d as o,e as h,g as z,i as d}from"./chunk-YKXDMIHQ.js";var p=o(h(),1);var a=p.forwardRef(t(function(e,r){let{render:n,className:k,disabled:s=!1,focusableWhenDisabled:g=!1,nativeButton:f=!0,style:B,...b}=e,{getButtonProps:m,buttonRef:x}=l({disabled:s,focusableWhenDisabled:g,native:f});return u("button",e,{state:{disabled:s},ref:[r,x],props:[b,m]})},"Button"));var v=o(z(),1);var y=c("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",xs:"h-6 gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-md px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",icon:"size-8","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-md","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function W({className:i,variant:e="default",size:r="default",...n}){return(0,v.jsx)(a,{"data-slot":"button",className:d(y({variant:e,size:r,className:i})),...n})}t(W,"v");export{W as a};
1
+ import{c as l}from"./chunk-IS6LVJ6L.js";import{j as u}from"./chunk-225VJ77I.js";import{a as c}from"./chunk-FSRSK4LY.js";import{a as t,d as o,e as h,g as z,i as d}from"./chunk-YKXDMIHQ.js";var p=o(h(),1);var a=p.forwardRef(t(function(e,r){let{render:n,className:k,disabled:s=!1,focusableWhenDisabled:g=!1,nativeButton:f=!0,style:B,...b}=e,{getButtonProps:m,buttonRef:x}=l({disabled:s,focusableWhenDisabled:g,native:f});return u("button",e,{state:{disabled:s},ref:[r,x],props:[b,m]})},"Button"));var v=o(z(),1);var y=c("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",xs:"h-6 gap-1 rounded-md px-2 text-xs has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-md px-2.5 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pe-2 has-data-[icon=inline-start]:ps-2",icon:"size-8","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-md","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function W({className:i,variant:e="default",size:r="default",...n}){return(0,v.jsx)(a,{"data-slot":"button",className:d(y({variant:e,size:r,className:i})),...n})}t(W,"v");export{W as a};