clitrigger 0.2.25 → 0.2.27

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 (38) hide show
  1. package/README.md +56 -31
  2. package/README_KR.md +56 -31
  3. package/dist/client/assets/AnalyticsPanel-_kLM7VrI.js +48 -0
  4. package/dist/client/assets/FloatingComposerController-5A3GJtK4-BxUxSq5t.js +1 -0
  5. package/dist/client/assets/PlannerPageEditor-1-XUcFw6.css +1 -0
  6. package/dist/client/assets/PlannerPageEditor-CupJFWnQ.js +211 -0
  7. package/dist/client/assets/TaskGraph-CRH0BXMs.js +2 -0
  8. package/dist/client/assets/VaultLayout-Cmj72_CB.js +161 -0
  9. package/dist/client/assets/clsx-B-dksMZM.js +1 -0
  10. package/dist/client/assets/index-DBeo9lgK.js +668 -0
  11. package/dist/client/assets/index-DToMB-Fe.css +32 -0
  12. package/dist/client/assets/index-Vcq4gwWv.js +1 -0
  13. package/dist/client/assets/style-BZV40eAE.css +1 -0
  14. package/dist/client/assets/style-BzUN1WGh.js +7 -0
  15. package/dist/client/assets/value-BTdN53H7.js +1 -0
  16. package/dist/client/assets/with-selector-DLSr3nnk.js +17 -0
  17. package/dist/client/index.html +2 -2
  18. package/dist/server/db/queries.d.ts.map +1 -1
  19. package/dist/server/db/queries.js +14 -8
  20. package/dist/server/db/queries.js.map +1 -1
  21. package/dist/server/db/schema.d.ts.map +1 -1
  22. package/dist/server/db/schema.js +3 -1
  23. package/dist/server/db/schema.js.map +1 -1
  24. package/dist/server/index.js +17 -20
  25. package/dist/server/index.js.map +1 -1
  26. package/dist/server/services/session-manager.d.ts +1 -0
  27. package/dist/server/services/session-manager.d.ts.map +1 -1
  28. package/dist/server/services/session-manager.js +32 -1
  29. package/dist/server/services/session-manager.js.map +1 -1
  30. package/dist/server/websocket/index.d.ts.map +1 -1
  31. package/dist/server/websocket/index.js +18 -1
  32. package/dist/server/websocket/index.js.map +1 -1
  33. package/electron/main.cjs +12 -0
  34. package/electron/preload.cjs +5 -0
  35. package/package.json +6 -6
  36. package/dist/client/assets/FloatingComposerController-5A3GJtK4-Dewu1Gm8.js +0 -1
  37. package/dist/client/assets/index-B27QeZaI.js +0 -1098
  38. package/dist/client/assets/index-BlJ7W4Dm.css +0 -32
@@ -0,0 +1,7 @@
1
+ import{aj as Es,r as D,j as T}from"./index-DBeo9lgK.js";import{a as Ct,c as Fn,b as On,d as Ss,i as Ke}from"./value-BTdN53H7.js";import{u as Ns}from"./with-selector-DLSr3nnk.js";function it(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,o;n<t.length;n++)(o=it(t[n]))!==""&&(e+=(e&&" ")+o);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var Cs={value:()=>{}};function ze(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new ve(n)}function ve(t){this._=t}function Ms(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}ve.prototype=ze.prototype={constructor:ve,on:function(t,e){var n=this._,o=Ms(t+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(t=o[i]).type)&&(r=Is(n[r],t.name)))return r;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<s;)if(r=(t=o[i]).type)n[r]=Xn(n[r],t.name,e);else if(e==null)for(r in n)n[r]=Xn(n[r],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ve(t)},call:function(t,e){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],o=0,r=i.length;o<r;++o)i[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],r=0,i=o.length;r<i;++r)o[r].value.apply(e,n)}};function Is(t,e){for(var n=0,o=t.length,r;n<o;++n)if((r=t[n]).name===e)return r.value}function Xn(t,e,n){for(var o=0,r=t.length;o<r;++o)if(t[o].name===e){t[o]=Cs,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var on="http://www.w3.org/1999/xhtml";const Yn={svg:"http://www.w3.org/2000/svg",xhtml:on,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function De(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Yn.hasOwnProperty(e)?{space:Yn[e],local:t}:t}function As(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===on&&e.documentElement.namespaceURI===on?e.createElement(t):e.createElementNS(n,t)}}function ks(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ro(t){var e=De(t);return(e.local?ks:As)(e)}function Ps(){}function yn(t){return t==null?Ps:function(){return this.querySelector(t)}}function $s(t){typeof t!="function"&&(t=yn(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i=e[r],s=i.length,a=o[r]=new Array(s),c,l,f=0;f<s;++f)(c=i[f])&&(l=t.call(c,c.__data__,f,i))&&("__data__"in c&&(l.__data__=c.__data__),a[f]=l);return new ct(o,this._parents)}function Ts(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function zs(){return[]}function Vo(t){return t==null?zs:function(){return this.querySelectorAll(t)}}function Ds(t){return function(){return Ts(t.apply(this,arguments))}}function Ls(t){typeof t=="function"?t=Ds(t):t=Vo(t);for(var e=this._groups,n=e.length,o=[],r=[],i=0;i<n;++i)for(var s=e[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(o.push(t.call(c,c.__data__,l,s)),r.push(c));return new ct(o,r)}function Bo(t){return function(){return this.matches(t)}}function Fo(t){return function(e){return e.matches(t)}}var Hs=Array.prototype.find;function Rs(t){return function(){return Hs.call(this.children,t)}}function Vs(){return this.firstElementChild}function Bs(t){return this.select(t==null?Vs:Rs(typeof t=="function"?t:Fo(t)))}var Fs=Array.prototype.filter;function Os(){return Array.from(this.children)}function Xs(t){return function(){return Fs.call(this.children,t)}}function Ys(t){return this.selectAll(t==null?Os:Xs(typeof t=="function"?t:Fo(t)))}function js(t){typeof t!="function"&&(t=Bo(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i=e[r],s=i.length,a=o[r]=[],c,l=0;l<s;++l)(c=i[l])&&t.call(c,c.__data__,l,i)&&a.push(c);return new ct(o,this._parents)}function Oo(t){return new Array(t.length)}function Ws(){return new ct(this._enter||this._groups.map(Oo),this._parents)}function Ne(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Ne.prototype={constructor:Ne,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Gs(t){return function(){return t}}function qs(t,e,n,o,r,i){for(var s=0,a,c=e.length,l=i.length;s<l;++s)(a=e[s])?(a.__data__=i[s],o[s]=a):n[s]=new Ne(t,i[s]);for(;s<c;++s)(a=e[s])&&(r[s]=a)}function Ks(t,e,n,o,r,i,s){var a,c,l=new Map,f=e.length,u=i.length,d=new Array(f),h;for(a=0;a<f;++a)(c=e[a])&&(d[a]=h=s.call(c,c.__data__,a,e)+"",l.has(h)?r[a]=c:l.set(h,c));for(a=0;a<u;++a)h=s.call(t,i[a],a,i)+"",(c=l.get(h))?(o[a]=c,c.__data__=i[a],l.delete(h)):n[a]=new Ne(t,i[a]);for(a=0;a<f;++a)(c=e[a])&&l.get(d[a])===c&&(r[a]=c)}function Zs(t){return t.__data__}function Us(t,e){if(!arguments.length)return Array.from(this,Zs);var n=e?Ks:qs,o=this._parents,r=this._groups;typeof t!="function"&&(t=Gs(t));for(var i=r.length,s=new Array(i),a=new Array(i),c=new Array(i),l=0;l<i;++l){var f=o[l],u=r[l],d=u.length,h=Qs(t.call(f,f&&f.__data__,l,o)),g=h.length,x=a[l]=new Array(g),y=s[l]=new Array(g),m=c[l]=new Array(d);n(f,u,x,y,m,h,e);for(var _=0,p=0,w,S;_<g;++_)if(w=x[_]){for(_>=p&&(p=_+1);!(S=y[p])&&++p<g;);w._next=S||null}}return s=new ct(s,o),s._enter=a,s._exit=c,s}function Qs(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Js(){return new ct(this._exit||this._groups.map(Oo),this._parents)}function ta(t,e,n){var o=this.enter(),r=this,i=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(r=e(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function ea(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),c=0;c<s;++c)for(var l=n[c],f=o[c],u=l.length,d=a[c]=new Array(u),h,g=0;g<u;++g)(h=l[g]||f[g])&&(d[g]=h);for(;c<r;++c)a[c]=n[c];return new ct(a,this._parents)}function na(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function oa(t){t||(t=ra);function e(u,d){return u&&d?t(u.__data__,d.__data__):!u-!d}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,c=r[i]=new Array(a),l,f=0;f<a;++f)(l=s[f])&&(c[f]=l);c.sort(e)}return new ct(r,this._parents).order()}function ra(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function ia(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function sa(){return Array.from(this)}function aa(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function ca(){let t=0;for(const e of this)++t;return t}function la(){return!this.node()}function ua(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var r=e[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&t.call(a,a.__data__,i,r);return this}function da(t){return function(){this.removeAttribute(t)}}function fa(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ha(t,e){return function(){this.setAttribute(t,e)}}function ga(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function pa(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ma(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ya(t,e){var n=De(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?fa:da:typeof e=="function"?n.local?ma:pa:n.local?ga:ha)(n,e))}function Xo(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function xa(t){return function(){this.style.removeProperty(t)}}function wa(t,e,n){return function(){this.style.setProperty(t,e,n)}}function va(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function _a(t,e,n){return arguments.length>1?this.each((e==null?xa:typeof e=="function"?va:wa)(t,e,n??"")):Ht(this.node(),t)}function Ht(t,e){return t.style.getPropertyValue(e)||Xo(t).getComputedStyle(t,null).getPropertyValue(e)}function ba(t){return function(){delete this[t]}}function Ea(t,e){return function(){this[t]=e}}function Sa(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function Na(t,e){return arguments.length>1?this.each((e==null?ba:typeof e=="function"?Sa:Ea)(t,e)):this.node()[t]}function Yo(t){return t.trim().split(/^|\s+/)}function xn(t){return t.classList||new jo(t)}function jo(t){this._node=t,this._names=Yo(t.getAttribute("class")||"")}jo.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Wo(t,e){for(var n=xn(t),o=-1,r=e.length;++o<r;)n.add(e[o])}function Go(t,e){for(var n=xn(t),o=-1,r=e.length;++o<r;)n.remove(e[o])}function Ca(t){return function(){Wo(this,t)}}function Ma(t){return function(){Go(this,t)}}function Ia(t,e){return function(){(e.apply(this,arguments)?Wo:Go)(this,t)}}function Aa(t,e){var n=Yo(t+"");if(arguments.length<2){for(var o=xn(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof e=="function"?Ia:e?Ca:Ma)(n,e))}function ka(){this.textContent=""}function Pa(t){return function(){this.textContent=t}}function $a(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ta(t){return arguments.length?this.each(t==null?ka:(typeof t=="function"?$a:Pa)(t)):this.node().textContent}function za(){this.innerHTML=""}function Da(t){return function(){this.innerHTML=t}}function La(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Ha(t){return arguments.length?this.each(t==null?za:(typeof t=="function"?La:Da)(t)):this.node().innerHTML}function Ra(){this.nextSibling&&this.parentNode.appendChild(this)}function Va(){return this.each(Ra)}function Ba(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Fa(){return this.each(Ba)}function Oa(t){var e=typeof t=="function"?t:Ro(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Xa(){return null}function Ya(t,e){var n=typeof t=="function"?t:Ro(t),o=e==null?Xa:typeof e=="function"?e:yn(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function ja(){var t=this.parentNode;t&&t.removeChild(this)}function Wa(){return this.each(ja)}function Ga(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function qa(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Ka(t){return this.select(t?qa:Ga)}function Za(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ua(t){return function(e){t.call(this,e,this.__data__)}}function Qa(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function Ja(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,r=e.length,i;n<r;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++o]=i;++o?e.length=o:delete this.__on}}}function tc(t,e,n){return function(){var o=this.__on,r,i=Ua(e);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=e;return}}this.addEventListener(t.type,i,n),r={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(r):this.__on=[r]}}function ec(t,e,n){var o=Qa(t+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,f;c<l;++c)for(r=0,f=a[c];r<i;++r)if((s=o[r]).type===f.type&&s.name===f.name)return f.value}return}for(a=e?tc:Ja,r=0;r<i;++r)this.each(a(o[r],e,n));return this}function qo(t,e,n){var o=Xo(t),r=o.CustomEvent;typeof r=="function"?r=new r(e,n):(r=o.document.createEvent("Event"),n?(r.initEvent(e,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(e,!1,!1)),t.dispatchEvent(r)}function nc(t,e){return function(){return qo(this,t,e)}}function oc(t,e){return function(){return qo(this,t,e.apply(this,arguments))}}function rc(t,e){return this.each((typeof e=="function"?oc:nc)(t,e))}function*ic(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var Ko=[null];function ct(t,e){this._groups=t,this._parents=e}function se(){return new ct([[document.documentElement]],Ko)}function sc(){return this}ct.prototype=se.prototype={constructor:ct,select:$s,selectAll:Ls,selectChild:Bs,selectChildren:Ys,filter:js,data:Us,enter:Ws,exit:Js,join:ta,merge:ea,selection:sc,order:na,sort:oa,call:ia,nodes:sa,node:aa,size:ca,empty:la,each:ua,attr:ya,style:_a,property:Na,classed:Aa,text:Ta,html:Ha,raise:Va,lower:Fa,append:Oa,insert:Ya,remove:Wa,clone:Ka,datum:Za,on:ec,dispatch:rc,[Symbol.iterator]:ic};function at(t){return typeof t=="string"?new ct([[document.querySelector(t)]],[document.documentElement]):new ct([[t]],Ko)}function ac(t){let e;for(;e=t.sourceEvent;)t=e;return t}function lt(t,e){if(t=ac(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var r=e.getBoundingClientRect();return[t.clientX-r.left-e.clientLeft,t.clientY-r.top-e.clientTop]}}return[t.pageX,t.pageY]}const cc={passive:!1},Jt={capture:!0,passive:!1};function Ze(t){t.stopImmediatePropagation()}function Lt(t){t.preventDefault(),t.stopImmediatePropagation()}function Zo(t){var e=t.document.documentElement,n=at(t).on("dragstart.drag",Lt,Jt);"onselectstart"in e?n.on("selectstart.drag",Lt,Jt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Uo(t,e){var n=t.document.documentElement,o=at(t).on("dragstart.drag",null);e&&(o.on("click.drag",Lt,Jt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const he=t=>()=>t;function rn(t,{sourceEvent:e,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:c,dy:l,dispatch:f}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:f}})}rn.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function lc(t){return!t.ctrlKey&&!t.button}function uc(){return this.parentNode}function dc(t,e){return e??{x:t.x,y:t.y}}function fc(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qo(){var t=lc,e=uc,n=dc,o=fc,r={},i=ze("start","drag","end"),s=0,a,c,l,f,u=0;function d(w){w.on("mousedown.drag",h).filter(o).on("touchstart.drag",y).on("touchmove.drag",m,cc).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,S){if(!(f||!t.call(this,w,S))){var N=p(this,e.call(this,w,S),w,S,"mouse");N&&(at(w.view).on("mousemove.drag",g,Jt).on("mouseup.drag",x,Jt),Zo(w.view),Ze(w),l=!1,a=w.clientX,c=w.clientY,N("start",w))}}function g(w){if(Lt(w),!l){var S=w.clientX-a,N=w.clientY-c;l=S*S+N*N>u}r.mouse("drag",w)}function x(w){at(w.view).on("mousemove.drag mouseup.drag",null),Uo(w.view,l),Lt(w),r.mouse("end",w)}function y(w,S){if(t.call(this,w,S)){var N=w.changedTouches,A=e.call(this,w,S),$=N.length,P,B;for(P=0;P<$;++P)(B=p(this,A,w,S,N[P].identifier,N[P]))&&(Ze(w),B("start",w,N[P]))}}function m(w){var S=w.changedTouches,N=S.length,A,$;for(A=0;A<N;++A)($=r[S[A].identifier])&&(Lt(w),$("drag",w,S[A]))}function _(w){var S=w.changedTouches,N=S.length,A,$;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),A=0;A<N;++A)($=r[S[A].identifier])&&(Ze(w),$("end",w,S[A]))}function p(w,S,N,A,$,P){var B=i.copy(),M=lt(P||N,S),z,V,v;if((v=n.call(w,new rn("beforestart",{sourceEvent:N,target:d,identifier:$,active:s,x:M[0],y:M[1],dx:0,dy:0,dispatch:B}),A))!=null)return z=v.x-M[0]||0,V=v.y-M[1]||0,function I(b,k,C){var E=M,L;switch(b){case"start":r[$]=I,L=s++;break;case"end":delete r[$],--s;case"drag":M=lt(C||k,S),L=s;break}B.call(b,w,new rn(b,{sourceEvent:k,subject:v,target:d,identifier:$,active:L,x:M[0]+z,y:M[1]+V,dx:M[0]-E[0],dy:M[1]-E[1],dispatch:B}),A)}}return d.filter=function(w){return arguments.length?(t=typeof w=="function"?w:he(!!w),d):t},d.container=function(w){return arguments.length?(e=typeof w=="function"?w:he(w),d):e},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:he(w),d):n},d.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:he(!!w),d):o},d.on=function(){var w=i.on.apply(i,arguments);return w===i?d:w},d.clickDistance=function(w){return arguments.length?(u=(w=+w)*w,d):Math.sqrt(u)},d}var jn=180/Math.PI,sn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Jo(t,e,n,o,r,i){var s,a,c;return(s=Math.sqrt(t*t+e*e))&&(t/=s,e/=s),(c=t*n+e*o)&&(n-=t*c,o-=e*c),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,c/=a),t*o<e*n&&(t=-t,e=-e,c=-c,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(e,t)*jn,skewX:Math.atan(c)*jn,scaleX:s,scaleY:a}}var ge;function hc(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?sn:Jo(e.a,e.b,e.c,e.d,e.e,e.f)}function gc(t){return t==null||(ge||(ge=document.createElementNS("http://www.w3.org/2000/svg","g")),ge.setAttribute("transform",t),!(t=ge.transform.baseVal.consolidate()))?sn:(t=t.matrix,Jo(t.a,t.b,t.c,t.d,t.e,t.f))}function tr(t,e,n,o){function r(l){return l.length?l.pop()+" ":""}function i(l,f,u,d,h,g){if(l!==u||f!==d){var x=h.push("translate(",null,e,null,n);g.push({i:x-4,x:Ct(l,u)},{i:x-2,x:Ct(f,d)})}else(u||d)&&h.push("translate("+u+e+d+n)}function s(l,f,u,d){l!==f?(l-f>180?f+=360:f-l>180&&(l+=360),d.push({i:u.push(r(u)+"rotate(",null,o)-2,x:Ct(l,f)})):f&&u.push(r(u)+"rotate("+f+o)}function a(l,f,u,d){l!==f?d.push({i:u.push(r(u)+"skewX(",null,o)-2,x:Ct(l,f)}):f&&u.push(r(u)+"skewX("+f+o)}function c(l,f,u,d,h,g){if(l!==u||f!==d){var x=h.push(r(h)+"scale(",null,",",null,")");g.push({i:x-4,x:Ct(l,u)},{i:x-2,x:Ct(f,d)})}else(u!==1||d!==1)&&h.push(r(h)+"scale("+u+","+d+")")}return function(l,f){var u=[],d=[];return l=t(l),f=t(f),i(l.translateX,l.translateY,f.translateX,f.translateY,u,d),s(l.rotate,f.rotate,u,d),a(l.skewX,f.skewX,u,d),c(l.scaleX,l.scaleY,f.scaleX,f.scaleY,u,d),l=f=null,function(h){for(var g=-1,x=d.length,y;++g<x;)u[(y=d[g]).i]=y.x(h);return u.join("")}}}var pc=tr(hc,"px, ","px)","deg)"),mc=tr(gc,", ",")",")"),yc=1e-12;function Wn(t){return((t=Math.exp(t))+1/t)/2}function xc(t){return((t=Math.exp(t))-1/t)/2}function wc(t){return((t=Math.exp(2*t))-1)/(t+1)}const _e=(function t(e,n,o){function r(i,s){var a=i[0],c=i[1],l=i[2],f=s[0],u=s[1],d=s[2],h=f-a,g=u-c,x=h*h+g*g,y,m;if(x<yc)m=Math.log(d/l)/e,y=function(A){return[a+A*h,c+A*g,l*Math.exp(e*A*m)]};else{var _=Math.sqrt(x),p=(d*d-l*l+o*x)/(2*l*n*_),w=(d*d-l*l-o*x)/(2*d*n*_),S=Math.log(Math.sqrt(p*p+1)-p),N=Math.log(Math.sqrt(w*w+1)-w);m=(N-S)/e,y=function(A){var $=A*m,P=Wn(S),B=l/(n*_)*(P*wc(e*$+S)-xc(S));return[a+B*h,c+B*g,l*P/Wn(e*$+S)]}}return y.duration=m*1e3*e/Math.SQRT2,y}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return t(s,a,c)},r})(Math.SQRT2,2,4);var Rt=0,Zt=0,qt=0,er=1e3,Ce,Ut,Me=0,At=0,Le=0,te=typeof performance=="object"&&performance.now?performance:Date,nr=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function wn(){return At||(nr(vc),At=te.now()+Le)}function vc(){At=0}function Ie(){this._call=this._time=this._next=null}Ie.prototype=or.prototype={constructor:Ie,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?wn():+n)+(e==null?0:+e),!this._next&&Ut!==this&&(Ut?Ut._next=this:Ce=this,Ut=this),this._call=t,this._time=n,an()},stop:function(){this._call&&(this._call=null,this._time=1/0,an())}};function or(t,e,n){var o=new Ie;return o.restart(t,e,n),o}function _c(){wn(),++Rt;for(var t=Ce,e;t;)(e=At-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Rt}function Gn(){At=(Me=te.now())+Le,Rt=Zt=0;try{_c()}finally{Rt=0,Ec(),At=0}}function bc(){var t=te.now(),e=t-Me;e>er&&(Le-=e,Me=t)}function Ec(){for(var t,e=Ce,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Ce=n);Ut=t,an(o)}function an(t){if(!Rt){Zt&&(Zt=clearTimeout(Zt));var e=t-At;e>24?(t<1/0&&(Zt=setTimeout(Gn,t-te.now()-Le)),qt&&(qt=clearInterval(qt))):(qt||(Me=te.now(),qt=setInterval(bc,er)),Rt=1,nr(Gn))}}function qn(t,e,n){var o=new Ie;return e=e==null?0:+e,o.restart(r=>{o.stop(),t(r+e)},e,n),o}var Sc=ze("start","end","cancel","interrupt"),Nc=[],rr=0,Kn=1,cn=2,be=3,Zn=4,ln=5,Ee=6;function He(t,e,n,o,r,i){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;Cc(t,n,{name:e,index:o,group:r,on:Sc,tween:Nc,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:rr})}function vn(t,e){var n=ft(t,e);if(n.state>rr)throw new Error("too late; already scheduled");return n}function gt(t,e){var n=ft(t,e);if(n.state>be)throw new Error("too late; already running");return n}function ft(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Cc(t,e,n){var o=t.__transition,r;o[e]=n,n.timer=or(i,0,n.time);function i(l){n.state=Kn,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var f,u,d,h;if(n.state!==Kn)return c();for(f in o)if(h=o[f],h.name===n.name){if(h.state===be)return qn(s);h.state===Zn?(h.state=Ee,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete o[f]):+f<e&&(h.state=Ee,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete o[f])}if(qn(function(){n.state===be&&(n.state=Zn,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=cn,n.on.call("start",t,t.__data__,n.index,n.group),n.state===cn){for(n.state=be,r=new Array(d=n.tween.length),f=0,u=-1;f<d;++f)(h=n.tween[f].value.call(t,t.__data__,n.index,n.group))&&(r[++u]=h);r.length=u+1}}function a(l){for(var f=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=ln,1),u=-1,d=r.length;++u<d;)r[u].call(t,f);n.state===ln&&(n.on.call("end",t,t.__data__,n.index,n.group),c())}function c(){n.state=Ee,n.timer.stop(),delete o[e];for(var l in o)return;delete t.__transition}}function Se(t,e){var n=t.__transition,o,r,i=!0,s;if(n){e=e==null?null:e+"";for(s in n){if((o=n[s]).name!==e){i=!1;continue}r=o.state>cn&&o.state<ln,o.state=Ee,o.timer.stop(),o.on.call(r?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[s]}i&&delete t.__transition}}function Mc(t){return this.each(function(){Se(this,t)})}function Ic(t,e){var n,o;return function(){var r=gt(this,t),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===e){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function Ac(t,e,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=gt(this,t),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:e,value:n},c=0,l=r.length;c<l;++c)if(r[c].name===e){r[c]=a;break}c===l&&r.push(a)}i.tween=r}}function kc(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=ft(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===t)return s.value;return null}return this.each((e==null?Ic:Ac)(n,t,e))}function _n(t,e,n){var o=t._id;return t.each(function(){var r=gt(this,o);(r.value||(r.value={}))[e]=n.apply(this,arguments)}),function(r){return ft(r,o).value[e]}}function ir(t,e){var n;return(typeof e=="number"?Ct:e instanceof Fn?On:(n=Fn(e))?(e=n,On):Ss)(t,e)}function Pc(t){return function(){this.removeAttribute(t)}}function $c(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Tc(t,e,n){var o,r=n+"",i;return function(){var s=this.getAttribute(t);return s===r?null:s===o?i:i=e(o=s,n)}}function zc(t,e,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(t.space,t.local);return s===r?null:s===o?i:i=e(o=s,n)}}function Dc(t,e,n){var o,r,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(t):(s=this.getAttribute(t),c=a+"",s===c?null:s===o&&c===r?i:(r=c,i=e(o=s,a)))}}function Lc(t,e,n){var o,r,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(t.space,t.local):(s=this.getAttributeNS(t.space,t.local),c=a+"",s===c?null:s===o&&c===r?i:(r=c,i=e(o=s,a)))}}function Hc(t,e){var n=De(t),o=n==="transform"?mc:ir;return this.attrTween(t,typeof e=="function"?(n.local?Lc:Dc)(n,o,_n(this,"attr."+t,e)):e==null?(n.local?$c:Pc)(n):(n.local?zc:Tc)(n,o,e))}function Rc(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Vc(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Bc(t,e){var n,o;function r(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&Vc(t,i)),n}return r._value=e,r}function Fc(t,e){var n,o;function r(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&Rc(t,i)),n}return r._value=e,r}function Oc(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=De(t);return this.tween(n,(o.local?Bc:Fc)(o,e))}function Xc(t,e){return function(){vn(this,t).delay=+e.apply(this,arguments)}}function Yc(t,e){return e=+e,function(){vn(this,t).delay=e}}function jc(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Xc:Yc)(e,t)):ft(this.node(),e).delay}function Wc(t,e){return function(){gt(this,t).duration=+e.apply(this,arguments)}}function Gc(t,e){return e=+e,function(){gt(this,t).duration=e}}function qc(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?Wc:Gc)(e,t)):ft(this.node(),e).duration}function Kc(t,e){if(typeof e!="function")throw new Error;return function(){gt(this,t).ease=e}}function Zc(t){var e=this._id;return arguments.length?this.each(Kc(e,t)):ft(this.node(),e).ease}function Uc(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;gt(this,t).ease=n}}function Qc(t){if(typeof t!="function")throw new Error;return this.each(Uc(this._id,t))}function Jc(t){typeof t!="function"&&(t=Bo(t));for(var e=this._groups,n=e.length,o=new Array(n),r=0;r<n;++r)for(var i=e[r],s=i.length,a=o[r]=[],c,l=0;l<s;++l)(c=i[l])&&t.call(c,c.__data__,l,i)&&a.push(c);return new xt(o,this._parents,this._name,this._id)}function tl(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var c=e[a],l=n[a],f=c.length,u=s[a]=new Array(f),d,h=0;h<f;++h)(d=c[h]||l[h])&&(u[h]=d);for(;a<o;++a)s[a]=e[a];return new xt(s,this._parents,this._name,this._id)}function el(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function nl(t,e,n){var o,r,i=el(e)?vn:gt;return function(){var s=i(this,t),a=s.on;a!==o&&(r=(o=a).copy()).on(e,n),s.on=r}}function ol(t,e){var n=this._id;return arguments.length<2?ft(this.node(),n).on.on(t):this.each(nl(n,t,e))}function rl(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function il(){return this.on("end.remove",rl(this._id))}function sl(t){var e=this._name,n=this._id;typeof t!="function"&&(t=yn(t));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],c=a.length,l=i[s]=new Array(c),f,u,d=0;d<c;++d)(f=a[d])&&(u=t.call(f,f.__data__,d,a))&&("__data__"in f&&(u.__data__=f.__data__),l[d]=u,He(l[d],e,n,d,l,ft(f,n)));return new xt(i,this._parents,e,n)}function al(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Vo(t));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var c=o[a],l=c.length,f,u=0;u<l;++u)if(f=c[u]){for(var d=t.call(f,f.__data__,u,c),h,g=ft(f,n),x=0,y=d.length;x<y;++x)(h=d[x])&&He(h,e,n,x,d,g);i.push(d),s.push(f)}return new xt(i,s,e,n)}var cl=se.prototype.constructor;function ll(){return new cl(this._groups,this._parents)}function ul(t,e){var n,o,r;return function(){var i=Ht(this,t),s=(this.style.removeProperty(t),Ht(this,t));return i===s?null:i===n&&s===o?r:r=e(n=i,o=s)}}function sr(t){return function(){this.style.removeProperty(t)}}function dl(t,e,n){var o,r=n+"",i;return function(){var s=Ht(this,t);return s===r?null:s===o?i:i=e(o=s,n)}}function fl(t,e,n){var o,r,i;return function(){var s=Ht(this,t),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(t),Ht(this,t))),s===c?null:s===o&&c===r?i:(r=c,i=e(o=s,a))}}function hl(t,e){var n,o,r,i="style."+e,s="end."+i,a;return function(){var c=gt(this,t),l=c.on,f=c.value[i]==null?a||(a=sr(e)):void 0;(l!==n||r!==f)&&(o=(n=l).copy()).on(s,r=f),c.on=o}}function gl(t,e,n){var o=(t+="")=="transform"?pc:ir;return e==null?this.styleTween(t,ul(t,o)).on("end.style."+t,sr(t)):typeof e=="function"?this.styleTween(t,fl(t,o,_n(this,"style."+t,e))).each(hl(this._id,t)):this.styleTween(t,dl(t,o,e),n).on("end.style."+t,null)}function pl(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function ml(t,e,n){var o,r;function i(){var s=e.apply(this,arguments);return s!==r&&(o=(r=s)&&pl(t,s,n)),o}return i._value=e,i}function yl(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,ml(t,e,n??""))}function xl(t){return function(){this.textContent=t}}function wl(t){return function(){var e=t(this);this.textContent=e??""}}function vl(t){return this.tween("text",typeof t=="function"?wl(_n(this,"text",t)):xl(t==null?"":t+""))}function _l(t){return function(e){this.textContent=t.call(this,e)}}function bl(t){var e,n;function o(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&_l(r)),e}return o._value=t,o}function El(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,bl(t))}function Sl(){for(var t=this._name,e=this._id,n=ar(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var f=ft(c,e);He(c,t,n,l,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new xt(o,this._parents,t,n)}function Nl(){var t,e,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--r===0&&i()}};n.each(function(){var l=gt(this,o),f=l.on;f!==t&&(e=(t=f).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(c)),l.on=e}),r===0&&i()})}var Cl=0;function xt(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function ar(){return++Cl}var mt=se.prototype;xt.prototype={constructor:xt,select:sl,selectAll:al,selectChild:mt.selectChild,selectChildren:mt.selectChildren,filter:Jc,merge:tl,selection:ll,transition:Sl,call:mt.call,nodes:mt.nodes,node:mt.node,size:mt.size,empty:mt.empty,each:mt.each,on:ol,attr:Hc,attrTween:Oc,style:gl,styleTween:yl,text:vl,textTween:El,remove:il,tween:kc,delay:jc,duration:qc,ease:Zc,easeVarying:Qc,end:Nl,[Symbol.iterator]:mt[Symbol.iterator]};function Ml(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Il={time:null,delay:0,duration:250,ease:Ml};function Al(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function kl(t){var e,n;t instanceof xt?(e=t._id,t=t._name):(e=ar(),(n=Il).time=wn(),t=t==null?null:t+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&He(c,t,e,l,s,n||Al(c,e));return new xt(o,this._parents,t,e)}se.prototype.interrupt=Mc;se.prototype.transition=kl;const pe=t=>()=>t;function Pl(t,{sourceEvent:e,target:n,transform:o,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:r}})}function yt(t,e,n){this.k=t,this.x=e,this.y=n}yt.prototype={constructor:yt,scale:function(t){return t===1?this:new yt(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new yt(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Re=new yt(1,0,0);cr.prototype=yt.prototype;function cr(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Re;return t.__zoom}function Ue(t){t.stopImmediatePropagation()}function Kt(t){t.preventDefault(),t.stopImmediatePropagation()}function $l(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Tl(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Un(){return this.__zoom||Re}function zl(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Dl(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ll(t,e,n){var o=t.invertX(e[0][0])-n[0][0],r=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],s=t.invertY(e[1][1])-n[1][1];return t.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function lr(){var t=$l,e=Tl,n=Ll,o=zl,r=Dl,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=_e,l=ze("start","zoom","end"),f,u,d,h=500,g=150,x=0,y=10;function m(v){v.property("__zoom",Un).on("wheel.zoom",$,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",B).filter(r).on("touchstart.zoom",M).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(v,I,b,k){var C=v.selection?v.selection():v;C.property("__zoom",Un),v!==C?S(v,I,b,k):C.interrupt().each(function(){N(this,arguments).event(k).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},m.scaleBy=function(v,I,b,k){m.scaleTo(v,function(){var C=this.__zoom.k,E=typeof I=="function"?I.apply(this,arguments):I;return C*E},b,k)},m.scaleTo=function(v,I,b,k){m.transform(v,function(){var C=e.apply(this,arguments),E=this.__zoom,L=b==null?w(C):typeof b=="function"?b.apply(this,arguments):b,R=E.invert(L),H=typeof I=="function"?I.apply(this,arguments):I;return n(p(_(E,H),L,R),C,s)},b,k)},m.translateBy=function(v,I,b,k){m.transform(v,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof b=="function"?b.apply(this,arguments):b),e.apply(this,arguments),s)},null,k)},m.translateTo=function(v,I,b,k,C){m.transform(v,function(){var E=e.apply(this,arguments),L=this.__zoom,R=k==null?w(E):typeof k=="function"?k.apply(this,arguments):k;return n(Re.translate(R[0],R[1]).scale(L.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof b=="function"?-b.apply(this,arguments):-b),E,s)},k,C)};function _(v,I){return I=Math.max(i[0],Math.min(i[1],I)),I===v.k?v:new yt(I,v.x,v.y)}function p(v,I,b){var k=I[0]-b[0]*v.k,C=I[1]-b[1]*v.k;return k===v.x&&C===v.y?v:new yt(v.k,k,C)}function w(v){return[(+v[0][0]+ +v[1][0])/2,(+v[0][1]+ +v[1][1])/2]}function S(v,I,b,k){v.on("start.zoom",function(){N(this,arguments).event(k).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(k).end()}).tween("zoom",function(){var C=this,E=arguments,L=N(C,E).event(k),R=e.apply(C,E),H=b==null?w(R):typeof b=="function"?b.apply(C,E):b,O=Math.max(R[1][0]-R[0][0],R[1][1]-R[0][1]),X=C.__zoom,j=typeof I=="function"?I.apply(C,E):I,K=c(X.invert(H).concat(O/X.k),j.invert(H).concat(O/j.k));return function(G){if(G===1)G=j;else{var F=K(G),W=O/F[2];G=new yt(W,H[0]-F[0]*W,H[1]-F[1]*W)}L.zoom(null,G)}})}function N(v,I,b){return!b&&v.__zooming||new A(v,I)}function A(v,I){this.that=v,this.args=I,this.active=0,this.sourceEvent=null,this.extent=e.apply(v,I),this.taps=0}A.prototype={event:function(v){return v&&(this.sourceEvent=v),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(v,I){return this.mouse&&v!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&v!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&v!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(v){var I=at(this.that).datum();l.call(v,this.that,new Pl(v,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:l}),I)}};function $(v,...I){if(!t.apply(this,arguments))return;var b=N(this,I).event(v),k=this.__zoom,C=Math.max(i[0],Math.min(i[1],k.k*Math.pow(2,o.apply(this,arguments)))),E=lt(v);if(b.wheel)(b.mouse[0][0]!==E[0]||b.mouse[0][1]!==E[1])&&(b.mouse[1]=k.invert(b.mouse[0]=E)),clearTimeout(b.wheel);else{if(k.k===C)return;b.mouse=[E,k.invert(E)],Se(this),b.start()}Kt(v),b.wheel=setTimeout(L,g),b.zoom("mouse",n(p(_(k,C),b.mouse[0],b.mouse[1]),b.extent,s));function L(){b.wheel=null,b.end()}}function P(v,...I){if(d||!t.apply(this,arguments))return;var b=v.currentTarget,k=N(this,I,!0).event(v),C=at(v.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",O,!0),E=lt(v,b),L=v.clientX,R=v.clientY;Zo(v.view),Ue(v),k.mouse=[E,this.__zoom.invert(E)],Se(this),k.start();function H(X){if(Kt(X),!k.moved){var j=X.clientX-L,K=X.clientY-R;k.moved=j*j+K*K>x}k.event(X).zoom("mouse",n(p(k.that.__zoom,k.mouse[0]=lt(X,b),k.mouse[1]),k.extent,s))}function O(X){C.on("mousemove.zoom mouseup.zoom",null),Uo(X.view,k.moved),Kt(X),k.event(X).end()}}function B(v,...I){if(t.apply(this,arguments)){var b=this.__zoom,k=lt(v.changedTouches?v.changedTouches[0]:v,this),C=b.invert(k),E=b.k*(v.shiftKey?.5:2),L=n(p(_(b,E),k,C),e.apply(this,I),s);Kt(v),a>0?at(this).transition().duration(a).call(S,L,k,v):at(this).call(m.transform,L,k,v)}}function M(v,...I){if(t.apply(this,arguments)){var b=v.touches,k=b.length,C=N(this,I,v.changedTouches.length===k).event(v),E,L,R,H;for(Ue(v),L=0;L<k;++L)R=b[L],H=lt(R,this),H=[H,this.__zoom.invert(H),R.identifier],C.touch0?!C.touch1&&C.touch0[2]!==H[2]&&(C.touch1=H,C.taps=0):(C.touch0=H,E=!0,C.taps=1+!!f);f&&(f=clearTimeout(f)),E&&(C.taps<2&&(u=H[0],f=setTimeout(function(){f=null},h)),Se(this),C.start())}}function z(v,...I){if(this.__zooming){var b=N(this,I).event(v),k=v.changedTouches,C=k.length,E,L,R,H;for(Kt(v),E=0;E<C;++E)L=k[E],R=lt(L,this),b.touch0&&b.touch0[2]===L.identifier?b.touch0[0]=R:b.touch1&&b.touch1[2]===L.identifier&&(b.touch1[0]=R);if(L=b.that.__zoom,b.touch1){var O=b.touch0[0],X=b.touch0[1],j=b.touch1[0],K=b.touch1[1],G=(G=j[0]-O[0])*G+(G=j[1]-O[1])*G,F=(F=K[0]-X[0])*F+(F=K[1]-X[1])*F;L=_(L,Math.sqrt(G/F)),R=[(O[0]+j[0])/2,(O[1]+j[1])/2],H=[(X[0]+K[0])/2,(X[1]+K[1])/2]}else if(b.touch0)R=b.touch0[0],H=b.touch0[1];else return;b.zoom("touch",n(p(L,R,H),b.extent,s))}}function V(v,...I){if(this.__zooming){var b=N(this,I).event(v),k=v.changedTouches,C=k.length,E,L;for(Ue(v),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),E=0;E<C;++E)L=k[E],b.touch0&&b.touch0[2]===L.identifier?delete b.touch0:b.touch1&&b.touch1[2]===L.identifier&&delete b.touch1;if(b.touch1&&!b.touch0&&(b.touch0=b.touch1,delete b.touch1),b.touch0)b.touch0[1]=this.__zoom.invert(b.touch0[0]);else if(b.end(),b.taps===2&&(L=lt(L,this),Math.hypot(u[0]-L[0],u[1]-L[1])<y)){var R=at(this).on("dblclick.zoom");R&&R.apply(this,arguments)}}}return m.wheelDelta=function(v){return arguments.length?(o=typeof v=="function"?v:pe(+v),m):o},m.filter=function(v){return arguments.length?(t=typeof v=="function"?v:pe(!!v),m):t},m.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:pe(!!v),m):r},m.extent=function(v){return arguments.length?(e=typeof v=="function"?v:pe([[+v[0][0],+v[0][1]],[+v[1][0],+v[1][1]]]),m):e},m.scaleExtent=function(v){return arguments.length?(i[0]=+v[0],i[1]=+v[1],m):[i[0],i[1]]},m.translateExtent=function(v){return arguments.length?(s[0][0]=+v[0][0],s[1][0]=+v[1][0],s[0][1]=+v[0][1],s[1][1]=+v[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(v){return arguments.length?(n=v,m):n},m.duration=function(v){return arguments.length?(a=+v,m):a},m.interpolate=function(v){return arguments.length?(c=v,m):c},m.on=function(){var v=l.on.apply(l,arguments);return v===l?m:v},m.clickDistance=function(v){return arguments.length?(x=(v=+v)*v,m):Math.sqrt(x)},m.tapDistance=function(v){return arguments.length?(y=+v,m):y},m}const ht={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:o}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ee=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ur=["Enter"," ","Escape"],dr={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Vt;(function(t){t.Strict="strict",t.Loose="loose"})(Vt||(Vt={}));var It;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(It||(It={}));var ne;(function(t){t.Partial="partial",t.Full="full"})(ne||(ne={}));const fr={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Et;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Et||(Et={}));var Ae;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(Ae||(Ae={}));var Y;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Y||(Y={}));const Qn={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top};function hr(t){return t===null?null:t?"valid":"invalid"}const gr=t=>"id"in t&&"source"in t&&"target"in t,Hl=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),bn=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),ae=(t,e=[0,0])=>{const{width:n,height:o}=wt(t),r=t.origin??e,i=n*r[0],s=o*r[1];return{x:t.position.x-i,y:t.position.y-s}},Rl=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((o,r)=>{const i=typeof r=="string";let s=!e.nodeLookup&&!i?r:void 0;e.nodeLookup&&(s=i?e.nodeLookup.get(r):bn(r)?r:e.nodeLookup.get(r.id));const a=s?ke(s,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ve(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Be(n)},ce=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return t.forEach(r=>{(e.filter===void 0||e.filter(r))&&(n=Ve(n,ke(r)),o=!0)}),o?Be(n):{x:0,y:0,width:0,height:0}},En=(t,e,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...ue(e,[n,o,r]),width:e.width/r,height:e.height/r},c=[];for(const l of t.values()){const{measured:f,selectable:u=!0,hidden:d=!1}=l;if(s&&!u||d)continue;const h=f.width??l.width??l.initialWidth??null,g=f.height??l.height??l.initialHeight??null,x=oe(a,Ft(l)),y=(h??0)*(g??0),m=i&&x>0;(!l.internals.handleBounds||m||x>=y||l.dragging)&&c.push(l)}return c},Vl=(t,e)=>{const n=new Set;return t.forEach(o=>{n.add(o.id)}),e.filter(o=>n.has(o.source)||n.has(o.target))};function Bl(t,e){const n=new Map,o=e!=null&&e.nodes?new Set(e.nodes.map(r=>r.id)):null;return t.forEach(r=>{r.measured.width&&r.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!r.hidden)&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function Fl({nodes:t,width:e,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(t.size===0)return Promise.resolve(!0);const a=Bl(t,s),c=ce(a),l=Sn(c,e,n,(s==null?void 0:s.minZoom)??r,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await o.setViewport(l,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function pr({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(t),a=s.parentId?n.get(s.parentId):void 0,{x:c,y:l}=a?a.internals.positionAbsolute:{x:0,y:0},f=s.origin??o;let u=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i==null||i("005",ht.error005());else{const h=a.measured.width,g=a.measured.height;h&&g&&(u=[[c,l],[c+h,l+g]])}else a&&Ot(s.extent)&&(u=[[s.extent[0][0]+c,s.extent[0][1]+l],[s.extent[1][0]+c,s.extent[1][1]+l]]);const d=Ot(u)?kt(e,u,s.measured):e;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",ht.error015())),{position:{x:d.x-c+(s.measured.width??0)*f[0],y:d.y-l+(s.measured.height??0)*f[1]},positionAbsolute:d}}async function Ol({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(t.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const h=i.has(d.id),g=!h&&d.parentId&&s.find(x=>x.id===d.parentId);(h||g)&&s.push(d)}const a=new Set(e.map(d=>d.id)),c=o.filter(d=>d.deletable!==!1),f=Vl(s,c);for(const d of c)a.has(d.id)&&!f.find(g=>g.id===d.id)&&f.push(d);if(!r)return{edges:f,nodes:s};const u=await r({nodes:s,edges:f});return typeof u=="boolean"?u?{edges:f,nodes:s}:{edges:[],nodes:[]}:u}const Bt=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),kt=(t={x:0,y:0},e,n)=>({x:Bt(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:Bt(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function mr(t,e,n){const{width:o,height:r}=wt(n),{x:i,y:s}=n.internals.positionAbsolute;return kt(t,[[i,s],[i+o,s+r]],e)}const Jn=(t,e,n)=>t<e?Bt(Math.abs(t-e),1,e)/e:t>n?-Bt(Math.abs(t-n),1,e)/e:0,yr=(t,e,n=15,o=40)=>{const r=Jn(t.x,o,e.width-o)*n,i=Jn(t.y,o,e.height-o)*n;return[r,i]},Ve=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),un=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),Be=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),Ft=(t,e=[0,0])=>{var r,i;const{x:n,y:o}=bn(t)?t.internals.positionAbsolute:ae(t,e);return{x:n,y:o,width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0}},ke=(t,e=[0,0])=>{var r,i;const{x:n,y:o}=bn(t)?t.internals.positionAbsolute:ae(t,e);return{x:n,y:o,x2:n+(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0),y2:o+(((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0)}},xr=(t,e)=>Be(Ve(un(t),un(e))),oe=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},to=t=>ut(t.width)&&ut(t.height)&&ut(t.x)&&ut(t.y),ut=t=>!isNaN(t)&&isFinite(t),Xl=(t,e)=>{},le=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),ue=({x:t,y:e},[n,o,r],i=!1,s=[1,1])=>{const a={x:(t-n)/r,y:(e-o)/r};return i?le(a,s):a},Pe=({x:t,y:e},[n,o,r])=>({x:t*r+n,y:e*r+o});function Tt(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Yl(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=Tt(t,n),r=Tt(t,e);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof t=="object"){const o=Tt(t.top??t.y??0,n),r=Tt(t.bottom??t.y??0,n),i=Tt(t.left??t.x??0,e),s=Tt(t.right??t.x??0,e);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function jl(t,e,n,o,r,i){const{x:s,y:a}=Pe(t,[e,n,o]),{x:c,y:l}=Pe({x:t.x+t.width,y:t.y+t.height},[e,n,o]),f=r-c,u=i-l;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(f),bottom:Math.floor(u)}}const Sn=(t,e,n,o,r,i)=>{const s=Yl(i,e,n),a=(e-s.x)/t.width,c=(n-s.y)/t.height,l=Math.min(a,c),f=Bt(l,o,r),u=t.x+t.width/2,d=t.y+t.height/2,h=e/2-u*f,g=n/2-d*f,x=jl(t,h,g,f,e,n),y={left:Math.min(x.left-s.left,0),top:Math.min(x.top-s.top,0),right:Math.min(x.right-s.right,0),bottom:Math.min(x.bottom-s.bottom,0)};return{x:h-y.left+y.right,y:g-y.top+y.bottom,zoom:f}},re=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function Ot(t){return t!=null&&t!=="parent"}function wt(t){var e,n;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight??0}}function wr(t){var e,n;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight)!==void 0}function vr(t,e={width:0,height:0},n,o,r){const i={...t},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(e.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(e.height??0)*a[1]}return i}function eo(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function Wl(){let t,e;return{promise:new Promise((o,r)=>{t=o,e=r}),resolve:t,reject:e}}function Gl(t){return{...dr,...t||{}}}function Qt(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=dt(t),a=ue({x:i-((r==null?void 0:r.left)??0),y:s-((r==null?void 0:r.top)??0)},o),{x:c,y:l}=n?le(a,e):a;return{xSnapped:c,ySnapped:l,...a}}const Nn=t=>({width:t.offsetWidth,height:t.offsetHeight}),_r=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},ql=["INPUT","SELECT","TEXTAREA"];function br(t){var o,r;const e=((r=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:r[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:ql.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const Er=t=>"clientX"in t,dt=(t,e)=>{var i,s;const n=Er(t),o=n?t.clientX:(i=t.touches)==null?void 0:i[0].clientX,r=n?t.clientY:(s=t.touches)==null?void 0:s[0].clientY;return{x:o-((e==null?void 0:e.left)??0),y:r-((e==null?void 0:e.top)??0)}},no=(t,e,n,o,r)=>{const i=e.querySelectorAll(`.${t}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:t,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Nn(s)}})};function Sr({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const c=t*.125+r*.375+s*.375+n*.125,l=e*.125+i*.375+a*.375+o*.125,f=Math.abs(c-t),u=Math.abs(l-e);return[c,l,f,u]}function me(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function oo({pos:t,x1:e,y1:n,x2:o,y2:r,c:i}){switch(t){case Y.Left:return[e-me(e-o,i),n];case Y.Right:return[e+me(o-e,i),n];case Y.Top:return[e,n-me(n-r,i)];case Y.Bottom:return[e,n+me(r-n,i)]}}function Nr({sourceX:t,sourceY:e,sourcePosition:n=Y.Bottom,targetX:o,targetY:r,targetPosition:i=Y.Top,curvature:s=.25}){const[a,c]=oo({pos:n,x1:t,y1:e,x2:o,y2:r,c:s}),[l,f]=oo({pos:i,x1:o,y1:r,x2:t,y2:e,c:s}),[u,d,h,g]=Sr({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:l,targetControlY:f});return[`M${t},${e} C${a},${c} ${l},${f} ${o},${r}`,u,d,h,g]}function Cr({sourceX:t,sourceY:e,targetX:n,targetY:o}){const r=Math.abs(n-t)/2,i=n<t?n+r:n-r,s=Math.abs(o-e)/2,a=o<e?o+s:o-s;return[i,a,r,s]}function Kl({sourceNode:t,targetNode:e,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const s=r&&n?o+1e3:o,a=Math.max(t.parentId||r&&t.selected?t.internals.z:0,e.parentId||r&&e.selected?e.internals.z:0);return s+a}function Zl({sourceNode:t,targetNode:e,width:n,height:o,transform:r}){const i=Ve(ke(t),ke(e));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return oe(s,Be(i))>0}const Ul=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`,Ql=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),Jl=(t,e,n={})=>{if(!t.source||!t.target)return e;const o=n.getEdgeId||Ul;let r;return gr(t)?r={...t}:r={...t,id:o(t)},Ql(r,e)?e:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,e.concat(r))};function Mr({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[r,i,s,a]=Cr({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,r,i,s,a]}const ro={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},tu=({source:t,sourcePosition:e=Y.Bottom,target:n})=>e===Y.Left||e===Y.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},io=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function eu({source:t,sourcePosition:e=Y.Bottom,target:n,targetPosition:o=Y.Top,center:r,offset:i,stepPosition:s}){const a=ro[e],c=ro[o],l={x:t.x+a.x*i,y:t.y+a.y*i},f={x:n.x+c.x*i,y:n.y+c.y*i},u=tu({source:l,sourcePosition:e,target:f}),d=u.x!==0?"x":"y",h=u[d];let g=[],x,y;const m={x:0,y:0},_={x:0,y:0},[,,p,w]=Cr({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[d]*c[d]===-1){d==="x"?(x=r.x??l.x+(f.x-l.x)*s,y=r.y??(l.y+f.y)/2):(x=r.x??(l.x+f.x)/2,y=r.y??l.y+(f.y-l.y)*s);const $=[{x,y:l.y},{x,y:f.y}],P=[{x:l.x,y},{x:f.x,y}];a[d]===h?g=d==="x"?$:P:g=d==="x"?P:$}else{const $=[{x:l.x,y:f.y}],P=[{x:f.x,y:l.y}];if(d==="x"?g=a.x===h?P:$:g=a.y===h?$:P,e===o){const v=Math.abs(t[d]-n[d]);if(v<=i){const I=Math.min(i-1,i-v);a[d]===h?m[d]=(l[d]>t[d]?-1:1)*I:_[d]=(f[d]>n[d]?-1:1)*I}}if(e!==o){const v=d==="x"?"y":"x",I=a[d]===c[v],b=l[v]>f[v],k=l[v]<f[v];(a[d]===1&&(!I&&b||I&&k)||a[d]!==1&&(!I&&k||I&&b))&&(g=d==="x"?$:P)}const B={x:l.x+m.x,y:l.y+m.y},M={x:f.x+_.x,y:f.y+_.y},z=Math.max(Math.abs(B.x-g[0].x),Math.abs(M.x-g[0].x)),V=Math.max(Math.abs(B.y-g[0].y),Math.abs(M.y-g[0].y));z>=V?(x=(B.x+M.x)/2,y=g[0].y):(x=g[0].x,y=(B.y+M.y)/2)}const S={x:l.x+m.x,y:l.y+m.y},N={x:f.x+_.x,y:f.y+_.y};return[[t,...S.x!==g[0].x||S.y!==g[0].y?[S]:[],...g,...N.x!==g[g.length-1].x||N.y!==g[g.length-1].y?[N]:[],n],x,y,p,w]}function nu(t,e,n,o){const r=Math.min(io(t,e)/2,io(e,n)/2,o),{x:i,y:s}=e;if(t.x===i&&i===n.x||t.y===s&&s===n.y)return`L${i} ${s}`;if(t.y===s){const l=t.x<n.x?-1:1,f=t.y<n.y?1:-1;return`L ${i+r*l},${s}Q ${i},${s} ${i},${s+r*f}`}const a=t.x<n.x?1:-1,c=t.y<n.y?-1:1;return`L ${i},${s+r*c}Q ${i},${s} ${i+r*a},${s}`}function dn({sourceX:t,sourceY:e,sourcePosition:n=Y.Bottom,targetX:o,targetY:r,targetPosition:i=Y.Top,borderRadius:s=5,centerX:a,centerY:c,offset:l=20,stepPosition:f=.5}){const[u,d,h,g,x]=eu({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:c},offset:l,stepPosition:f});let y=`M${u[0].x} ${u[0].y}`;for(let m=1;m<u.length-1;m++)y+=nu(u[m-1],u[m],u[m+1],s);return y+=`L${u[u.length-1].x} ${u[u.length-1].y}`,[y,d,h,g,x]}function so(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function ou(t){var u;const{sourceNode:e,targetNode:n}=t;if(!so(e)||!so(n))return null;const o=e.internals.handleBounds||ao(e.handles),r=n.internals.handleBounds||ao(n.handles),i=co((o==null?void 0:o.source)??[],t.sourceHandle),s=co(t.connectionMode===Vt.Strict?(r==null?void 0:r.target)??[]:((r==null?void 0:r.target)??[]).concat((r==null?void 0:r.source)??[]),t.targetHandle);if(!i||!s)return(u=t.onError)==null||u.call(t,"008",ht.error008(i?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const a=(i==null?void 0:i.position)||Y.Bottom,c=(s==null?void 0:s.position)||Y.Top,l=Pt(e,i,a),f=Pt(n,s,c);return{sourceX:l.x,sourceY:l.y,targetX:f.x,targetY:f.y,sourcePosition:a,targetPosition:c}}function ao(t){if(!t)return null;const e=[],n=[];for(const o of t)o.width=o.width??1,o.height=o.height??1,o.type==="source"?e.push(o):o.type==="target"&&n.push(o);return{source:e,target:n}}function Pt(t,e,n=Y.Left,o=!1){const r=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,i=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:s,height:a}=e??wt(t);if(o)return{x:r+s/2,y:i+a/2};switch((e==null?void 0:e.position)??n){case Y.Top:return{x:r+s/2,y:i};case Y.Right:return{x:r+s,y:i+a/2};case Y.Bottom:return{x:r+s/2,y:i+a};case Y.Left:return{x:r,y:i+a/2}}}function co(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function fn(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(o=>`${o}=${t[o]}`).join("&")}`:""}function ru(t,{id:e,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return t.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const l=fn(c,e);i.has(l)||(s.push({id:l,color:c.color||n,...c}),i.add(l))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Ir=1e3,iu=10,Cn={nodeOrigin:[0,0],nodeExtent:ee,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},su={...Cn,checkEquality:!0};function Mn(t,e){const n={...t};for(const o in e)e[o]!==void 0&&(n[o]=e[o]);return n}function au(t,e,n){const o=Mn(Cn,n);for(const r of t.values())if(r.parentId)An(r,t,e,o);else{const i=ae(r,o.nodeOrigin),s=Ot(r.extent)?r.extent:o.nodeExtent,a=kt(i,s,wt(r));r.internals.positionAbsolute=a}}function cu(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const n=[],o=[];for(const r of t.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:t.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function In(t){return t==="manual"}function hn(t,e,n,o={}){var f,u;const r=Mn(su,o),i={i:0},s=new Map(e),a=r!=null&&r.elevateNodesOnSelect&&!In(r.zIndexMode)?Ir:0;let c=t.length>0,l=!1;e.clear(),n.clear();for(const d of t){let h=s.get(d.id);if(r.checkEquality&&d===(h==null?void 0:h.internals.userNode))e.set(d.id,h);else{const g=ae(d,r.nodeOrigin),x=Ot(d.extent)?d.extent:r.nodeExtent,y=kt(g,x,wt(d));h={...r.defaults,...d,measured:{width:(f=d.measured)==null?void 0:f.width,height:(u=d.measured)==null?void 0:u.height},internals:{positionAbsolute:y,handleBounds:cu(d,h),z:Ar(d,a,r.zIndexMode),userNode:d}},e.set(d.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(c=!1),d.parentId&&An(h,e,n,o,i),l||(l=d.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:l}}function lu(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function An(t,e,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:c}=Mn(Cn,o),l=t.parentId,f=e.get(l);if(!f){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}lu(t,n),r&&!f.parentId&&f.internals.rootParentIndex===void 0&&c==="auto"&&(f.internals.rootParentIndex=++r.i,f.internals.z=f.internals.z+r.i*iu),r&&f.internals.rootParentIndex!==void 0&&(r.i=f.internals.rootParentIndex);const u=i&&!In(c)?Ir:0,{x:d,y:h,z:g}=uu(t,f,s,a,u,c),{positionAbsolute:x}=t.internals,y=d!==x.x||h!==x.y;(y||g!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:y?{x:d,y:h}:x,z:g}})}function Ar(t,e,n){const o=ut(t.zIndex)?t.zIndex:0;return In(n)?o:o+(t.selected?e:0)}function uu(t,e,n,o,r,i){const{x:s,y:a}=e.internals.positionAbsolute,c=wt(t),l=ae(t,n),f=Ot(t.extent)?kt(l,t.extent,c):l;let u=kt({x:s+f.x,y:a+f.y},o,c);t.extent==="parent"&&(u=mr(u,c,e));const d=Ar(t,r,i),h=e.internals.z??0;return{x:u.x,y:u.y,z:h>=d?h+1:d}}function kn(t,e,n,o=[0,0]){var s;const r=[],i=new Map;for(const a of t){const c=e.get(a.parentId);if(!c)continue;const l=((s=i.get(a.parentId))==null?void 0:s.expandedRect)??Ft(c),f=xr(l,a.rect);i.set(a.parentId,{expandedRect:f,parent:c})}return i.size>0&&i.forEach(({expandedRect:a,parent:c},l)=>{var p;const f=c.internals.positionAbsolute,u=wt(c),d=c.origin??o,h=a.x<f.x?Math.round(Math.abs(f.x-a.x)):0,g=a.y<f.y?Math.round(Math.abs(f.y-a.y)):0,x=Math.max(u.width,Math.round(a.width)),y=Math.max(u.height,Math.round(a.height)),m=(x-u.width)*d[0],_=(y-u.height)*d[1];(h>0||g>0||m||_)&&(r.push({id:l,type:"position",position:{x:c.position.x-h+m,y:c.position.y-g+_}}),(p=n.get(l))==null||p.forEach(w=>{t.some(S=>S.id===w.id)||r.push({id:w.id,type:"position",position:{x:w.position.x+h,y:w.position.y+g}})})),(u.width<a.width||u.height<a.height||h||g)&&r.push({id:l,type:"dimensions",setAttributes:!0,dimensions:{width:x+(h?d[0]*h-m:0),height:y+(g?d[1]*g-_:0)}})}),r}function du(t,e,n,o,r,i,s){const a=o==null?void 0:o.querySelector(".xyflow__viewport");let c=!1;if(!a)return{changes:[],updatedInternals:c};const l=[],f=window.getComputedStyle(a),{m22:u}=new window.DOMMatrixReadOnly(f.transform),d=[];for(const h of t.values()){const g=e.get(h.id);if(!g)continue;if(g.hidden){e.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),c=!0;continue}const x=Nn(h.nodeElement),y=g.measured.width!==x.width||g.measured.height!==x.height;if(!!(x.width&&x.height&&(y||!g.internals.handleBounds||h.force))){const _=h.nodeElement.getBoundingClientRect(),p=Ot(g.extent)?g.extent:i;let{positionAbsolute:w}=g.internals;g.parentId&&g.extent==="parent"?w=mr(w,x,e.get(g.parentId)):p&&(w=kt(w,p,x));const S={...g,measured:x,internals:{...g.internals,positionAbsolute:w,handleBounds:{source:no("source",h.nodeElement,_,u,g.id),target:no("target",h.nodeElement,_,u,g.id)}}};e.set(g.id,S),g.parentId&&An(S,e,n,{nodeOrigin:r,zIndexMode:s}),c=!0,y&&(l.push({id:g.id,type:"dimensions",dimensions:x}),g.expandParent&&g.parentId&&d.push({id:g.id,parentId:g.parentId,rect:Ft(S,r)}))}}if(d.length>0){const h=kn(d,e,n,r);l.push(...h)}return{changes:l,updatedInternals:c}}async function fu({delta:t,panZoom:e,transform:n,translateExtent:o,width:r,height:i}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const s=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[r,i]],o),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function lo(t,e,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,e)),s=`${r}-${t}`;const c=o.get(s)||new Map;if(o.set(s,c.set(n,e)),i){s=`${r}-${t}-${i}`;const l=o.get(s)||new Map;o.set(s,l.set(n,e))}}function kr(t,e,n){t.clear(),e.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,c={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},l=`${r}-${s}--${i}-${a}`,f=`${i}-${a}--${r}-${s}`;lo("source",c,f,t,r,s),lo("target",c,l,t,i,a),e.set(o.id,o)}}function Pr(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:Pr(n,e):!1}function uo(t,e,n){var r;let o=t;do{if((r=o==null?void 0:o.matches)!=null&&r.call(o,e))return!0;if(o===n)return!1;o=o==null?void 0:o.parentElement}while(o);return!1}function hu(t,e,n,o){const r=new Map;for(const[i,s]of t)if((s.selected||s.id===o)&&(!s.parentId||!Pr(s,t))&&(s.draggable||e&&typeof s.draggable>"u")){const a=t.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function Qe({nodeId:t,dragItems:e,nodeLookup:n,dragging:o=!0}){var s,a,c;const r=[];for(const[l,f]of e){const u=(s=n.get(l))==null?void 0:s.internals.userNode;u&&r.push({...u,position:f.position,dragging:o})}if(!t)return[r[0],r];const i=(a=n.get(t))==null?void 0:a.internals.userNode;return[i?{...i,position:((c=e.get(t))==null?void 0:c.position)||i.position,dragging:o}:r[0],r]}function gu({dragItems:t,snapGrid:e,x:n,y:o}){const r=t.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=le(i,e);return{x:s.x-i.x,y:s.y-i.y}}function pu({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,c=!1,l={x:0,y:0},f=null,u=!1,d=null,h=!1,g=!1,x=null;function y({noDragClassName:_,handleSelector:p,domNode:w,isSelectable:S,nodeId:N,nodeClickDistance:A=0}){d=at(w);function $({x:z,y:V}){const{nodeLookup:v,nodeExtent:I,snapGrid:b,snapToGrid:k,nodeOrigin:C,onNodeDrag:E,onSelectionDrag:L,onError:R,updateNodePositions:H}=e();i={x:z,y:V};let O=!1;const X=a.size>1,j=X&&I?un(ce(a)):null,K=X&&k?gu({dragItems:a,snapGrid:b,x:z,y:V}):null;for(const[G,F]of a){if(!v.has(G))continue;let W={x:z-F.distance.x,y:V-F.distance.y};k&&(W=K?{x:Math.round(W.x+K.x),y:Math.round(W.y+K.y)}:le(W,b));let Q=null;if(X&&I&&!F.extent&&j){const{positionAbsolute:q}=F.internals,et=q.x-j.x+I[0][0],nt=q.x+F.measured.width-j.x2+I[1][0],tt=q.y-j.y+I[0][1],st=q.y+F.measured.height-j.y2+I[1][1];Q=[[et,tt],[nt,st]]}const{position:U,positionAbsolute:Z}=pr({nodeId:G,nextPosition:W,nodeLookup:v,nodeExtent:Q||I,nodeOrigin:C,onError:R});O=O||F.position.x!==U.x||F.position.y!==U.y,F.position=U,F.internals.positionAbsolute=Z}if(g=g||O,!!O&&(H(a,!0),x&&(o||E||!N&&L))){const[G,F]=Qe({nodeId:N,dragItems:a,nodeLookup:v});o==null||o(x,a,G,F),E==null||E(x,G,F),N||L==null||L(x,F)}}async function P(){if(!f)return;const{transform:z,panBy:V,autoPanSpeed:v,autoPanOnNodeDrag:I}=e();if(!I){c=!1,cancelAnimationFrame(s);return}const[b,k]=yr(l,f,v);(b!==0||k!==0)&&(i.x=(i.x??0)-b/z[2],i.y=(i.y??0)-k/z[2],await V({x:b,y:k})&&$(i)),s=requestAnimationFrame(P)}function B(z){var X;const{nodeLookup:V,multiSelectionActive:v,nodesDraggable:I,transform:b,snapGrid:k,snapToGrid:C,selectNodesOnDrag:E,onNodeDragStart:L,onSelectionDragStart:R,unselectNodesAndEdges:H}=e();u=!0,(!E||!S)&&!v&&N&&((X=V.get(N))!=null&&X.selected||H()),S&&E&&N&&(t==null||t(N));const O=Qt(z.sourceEvent,{transform:b,snapGrid:k,snapToGrid:C,containerBounds:f});if(i=O,a=hu(V,I,O,N),a.size>0&&(n||L||!N&&R)){const[j,K]=Qe({nodeId:N,dragItems:a,nodeLookup:V});n==null||n(z.sourceEvent,a,j,K),L==null||L(z.sourceEvent,j,K),N||R==null||R(z.sourceEvent,K)}}const M=Qo().clickDistance(A).on("start",z=>{const{domNode:V,nodeDragThreshold:v,transform:I,snapGrid:b,snapToGrid:k}=e();f=(V==null?void 0:V.getBoundingClientRect())||null,h=!1,g=!1,x=z.sourceEvent,v===0&&B(z),i=Qt(z.sourceEvent,{transform:I,snapGrid:b,snapToGrid:k,containerBounds:f}),l=dt(z.sourceEvent,f)}).on("drag",z=>{const{autoPanOnNodeDrag:V,transform:v,snapGrid:I,snapToGrid:b,nodeDragThreshold:k,nodeLookup:C}=e(),E=Qt(z.sourceEvent,{transform:v,snapGrid:I,snapToGrid:b,containerBounds:f});if(x=z.sourceEvent,(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1||N&&!C.has(N))&&(h=!0),!h){if(!c&&V&&u&&(c=!0,P()),!u){const L=dt(z.sourceEvent,f),R=L.x-l.x,H=L.y-l.y;Math.sqrt(R*R+H*H)>k&&B(z)}(i.x!==E.xSnapped||i.y!==E.ySnapped)&&a&&u&&(l=dt(z.sourceEvent,f),$(E))}}).on("end",z=>{if(!(!u||h)&&(c=!1,u=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:V,updateNodePositions:v,onNodeDragStop:I,onSelectionDragStop:b}=e();if(g&&(v(a,!1),g=!1),r||I||!N&&b){const[k,C]=Qe({nodeId:N,dragItems:a,nodeLookup:V,dragging:!1});r==null||r(z.sourceEvent,a,k,C),I==null||I(z.sourceEvent,k,C),N||b==null||b(z.sourceEvent,C)}}}).filter(z=>{const V=z.target;return!z.button&&(!_||!uo(V,`.${_}`,w))&&(!p||uo(V,p,w))});d.call(M)}function m(){d==null||d.on(".drag",null)}return{update:y,destroy:m}}function mu(t,e,n){const o=[],r={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const i of e.values())oe(r,Ft(i))>0&&o.push(i);return o}const yu=250;function xu(t,e,n,o){var a,c;let r=[],i=1/0;const s=mu(t,n,e+yu);for(const l of s){const f=[...((a=l.internals.handleBounds)==null?void 0:a.source)??[],...((c=l.internals.handleBounds)==null?void 0:c.target)??[]];for(const u of f){if(o.nodeId===u.nodeId&&o.type===u.type&&o.id===u.id)continue;const{x:d,y:h}=Pt(l,u,u.position,!0),g=Math.sqrt(Math.pow(d-t.x,2)+Math.pow(h-t.y,2));g>e||(g<i?(r=[{...u,x:d,y:h}],i=g):g===i&&r.push({...u,x:d,y:h}))}}if(!r.length)return null;if(r.length>1){const l=o.type==="source"?"target":"source";return r.find(f=>f.type===l)??r[0]}return r[0]}function $r(t,e,n,o,r,i=!1){var l,f,u;const s=o.get(t);if(!s)return null;const a=r==="strict"?(l=s.internals.handleBounds)==null?void 0:l[e]:[...((f=s.internals.handleBounds)==null?void 0:f.source)??[],...((u=s.internals.handleBounds)==null?void 0:u.target)??[]],c=(n?a==null?void 0:a.find(d=>d.id===n):a==null?void 0:a[0])??null;return c&&i?{...c,...Pt(s,c,c.position,!0)}:c}function Tr(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function wu(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const zr=()=>!0;function vu(t,{connectionMode:e,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:c,lib:l,autoPanOnConnect:f,flowId:u,panBy:d,cancelConnection:h,onConnectStart:g,onConnect:x,onConnectEnd:y,isValidConnection:m=zr,onReconnectEnd:_,updateConnection:p,getTransform:w,getFromHandle:S,autoPanSpeed:N,dragThreshold:A=1,handleDomNode:$}){const P=_r(t.target);let B=0,M;const{x:z,y:V}=dt(t),v=Tr(i,$),I=a==null?void 0:a.getBoundingClientRect();let b=!1;if(!I||!v)return;const k=$r(r,v,o,c,e);if(!k)return;let C=dt(t,I),E=!1,L=null,R=!1,H=null;function O(){if(!f||!I)return;const[U,Z]=yr(C,I,N);d({x:U,y:Z}),B=requestAnimationFrame(O)}const X={...k,nodeId:r,type:v,position:k.position},j=c.get(r);let G={inProgress:!0,isValid:null,from:Pt(j,X,Y.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:j,to:C,toHandle:null,toPosition:Qn[X.position],toNode:null,pointer:C};function F(){b=!0,p(G),g==null||g(t,{nodeId:r,handleId:o,handleType:v})}A===0&&F();function W(U){if(!b){const{x:st,y:vt}=dt(U),pt=st-z,Nt=vt-V;if(!(pt*pt+Nt*Nt>A*A))return;F()}if(!S()||!X){Q(U);return}const Z=w();C=dt(U,I),M=xu(ue(C,Z,!1,[1,1]),n,c,X),E||(O(),E=!0);const q=Dr(U,{handle:M,connectionMode:e,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:m,doc:P,lib:l,flowId:u,nodeLookup:c});H=q.handleDomNode,L=q.connection,R=wu(!!M,q.isValid);const et=c.get(r),nt=et?Pt(et,X,Y.Left,!0):G.from,tt={...G,from:nt,isValid:R,to:q.toHandle&&R?Pe({x:q.toHandle.x,y:q.toHandle.y},Z):C,toHandle:q.toHandle,toPosition:R&&q.toHandle?q.toHandle.position:Qn[X.position],toNode:q.toHandle?c.get(q.toHandle.nodeId):null,pointer:C};p(tt),G=tt}function Q(U){if(!("touches"in U&&U.touches.length>0)){if(b){(M||H)&&L&&R&&(x==null||x(L));const{inProgress:Z,...q}=G,et={...q,toPosition:G.toHandle?G.toPosition:null};y==null||y(U,et),i&&(_==null||_(U,et))}h(),cancelAnimationFrame(B),E=!1,R=!1,L=null,H=null,P.removeEventListener("mousemove",W),P.removeEventListener("mouseup",Q),P.removeEventListener("touchmove",W),P.removeEventListener("touchend",Q)}}P.addEventListener("mousemove",W),P.addEventListener("mouseup",Q),P.addEventListener("touchmove",W),P.addEventListener("touchend",Q)}function Dr(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:c,isValidConnection:l=zr,nodeLookup:f}){const u=i==="target",d=e?s.querySelector(`.${a}-flow__handle[data-id="${c}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:h,y:g}=dt(t),x=s.elementFromPoint(h,g),y=x!=null&&x.classList.contains(`${a}-flow__handle`)?x:d,m={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const _=Tr(void 0,y),p=y.getAttribute("data-nodeid"),w=y.getAttribute("data-handleid"),S=y.classList.contains("connectable"),N=y.classList.contains("connectableend");if(!p||!_)return m;const A={source:u?p:o,sourceHandle:u?w:r,target:u?o:p,targetHandle:u?r:w};m.connection=A;const P=S&&N&&(n===Vt.Strict?u&&_==="source"||!u&&_==="target":p!==o||w!==r);m.isValid=P&&l(A),m.toHandle=$r(p,_,w,f,n,!0)}return m}const gn={onPointerDown:vu,isValid:Dr};function _u({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){const r=at(t);function i({translateExtent:a,width:c,height:l,zoomStep:f=1,pannable:u=!0,zoomable:d=!0,inversePan:h=!1}){const g=p=>{if(p.sourceEvent.type!=="wheel"||!e)return;const w=n(),S=p.sourceEvent.ctrlKey&&re()?10:1,N=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*f,A=w[2]*Math.pow(2,N*S);e.scaleTo(A)};let x=[0,0];const y=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(x=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},m=p=>{const w=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!e)return;const S=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],N=[S[0]-x[0],S[1]-x[1]];x=S;const A=o()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),$={x:w[0]-N[0]*A,y:w[1]-N[1]*A},P=[[0,0],[c,l]];e.setViewportConstrained({x:$.x,y:$.y,zoom:w[2]},P,a)},_=lr().on("start",y).on("zoom",u?m:null).on("zoom.wheel",d?g:null);r.call(_,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:lt}}const Fe=t=>({x:t.x,y:t.y,zoom:t.k}),Je=({x:t,y:e,zoom:n})=>Re.translate(t,e).scale(n),zt=(t,e)=>t.target.closest(`.${e}`),Lr=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),bu=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,tn=(t,e=0,n=bu,o=()=>{})=>{const r=typeof e=="number"&&e>0;return r||o(),r?t.transition().duration(e).ease(n).on("end",o):t},Hr=t=>{const e=t.ctrlKey&&re()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function Eu({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:l}){return f=>{if(zt(f,e))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();const u=n.property("__zoom").k||1;if(f.ctrlKey&&s){const y=lt(f),m=Hr(f),_=u*Math.pow(2,m);o.scaleTo(n,_,y,f);return}const d=f.deltaMode===1?20:1;let h=r===It.Vertical?0:f.deltaX*d,g=r===It.Horizontal?0:f.deltaY*d;!re()&&f.shiftKey&&r!==It.Vertical&&(h=f.deltaY*d,g=0),o.translateBy(n,-(h/u)*i,-(g/u)*i,{internal:!0});const x=Fe(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(c==null||c(f,x),t.panScrollTimeout=setTimeout(()=>{l==null||l(f,x),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,a==null||a(f,x))}}function Su({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!e&&i&&!o.ctrlKey,a=zt(o,t);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Nu({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{var i,s,a;if((i=o.sourceEvent)!=null&&i.internal)return;const r=Fe(o.transform);t.mouseButton=((s=o.sourceEvent)==null?void 0:s.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=r,((a=o.sourceEvent)==null?void 0:a.type)==="mousedown"&&e(!0),n&&(n==null||n(o.sourceEvent,r))}}function Cu({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{var s,a;t.usedRightMouseButton=!!(n&&Lr(e,t.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!((a=i.sourceEvent)!=null&&a.internal)&&(r==null||r(i.sourceEvent,Fe(i.transform)))}}function Mu({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{var a;if(!((a=s.sourceEvent)!=null&&a.internal)&&(t.isZoomingOrPanning=!1,i&&Lr(e,t.mouseButton??0)&&!t.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),t.usedRightMouseButton=!1,o(!1),r)){const c=Fe(s.transform);t.prevViewport=c,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{r==null||r(s.sourceEvent,c)},n?150:0)}}}function Iu({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:c,lib:l,connectionInProgress:f}){return u=>{var y;const d=t||e,h=n&&u.ctrlKey,g=u.type==="wheel";if(u.button===1&&u.type==="mousedown"&&(zt(u,`${l}-flow__node`)||zt(u,`${l}-flow__edge`)))return!0;if(!o&&!d&&!r&&!i&&!n||s||f&&!g||zt(u,a)&&g||zt(u,c)&&(!g||r&&g&&!t)||!n&&u.ctrlKey&&g)return!1;if(!n&&u.type==="touchstart"&&((y=u.touches)==null?void 0:y.length)>1)return u.preventDefault(),!1;if(!d&&!r&&!h&&g||!o&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(o)&&!o.includes(u.button)&&u.type==="mousedown")return!1;const x=Array.isArray(o)&&o.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||g)&&x}}function Au({domNode:t,minZoom:e,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:c}){const l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=t.getBoundingClientRect(),u=lr().scaleExtent([e,n]).translateExtent(o),d=at(t).call(u);_({x:r.x,y:r.y,zoom:Bt(r.zoom,e,n)},[[0,0],[f.width,f.height]],o);const h=d.on("wheel.zoom"),g=d.on("dblclick.zoom");u.wheelDelta(Hr);function x(M,z){return d?new Promise(V=>{u==null||u.interpolate((z==null?void 0:z.interpolate)==="linear"?Ke:_e).transform(tn(d,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>V(!0)),M)}):Promise.resolve(!1)}function y({noWheelClassName:M,noPanClassName:z,onPaneContextMenu:V,userSelectionActive:v,panOnScroll:I,panOnDrag:b,panOnScrollMode:k,panOnScrollSpeed:C,preventScrolling:E,zoomOnPinch:L,zoomOnScroll:R,zoomOnDoubleClick:H,zoomActivationKeyPressed:O,lib:X,onTransformChange:j,connectionInProgress:K,paneClickDistance:G,selectionOnDrag:F}){v&&!l.isZoomingOrPanning&&m();const W=I&&!O&&!v;u.clickDistance(F?1/0:!ut(G)||G<0?0:G);const Q=W?Eu({zoomPanValues:l,noWheelClassName:M,d3Selection:d,d3Zoom:u,panOnScrollMode:k,panOnScrollSpeed:C,zoomOnPinch:L,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):Su({noWheelClassName:M,preventScrolling:E,d3ZoomHandler:h});if(d.on("wheel.zoom",Q,{passive:!1}),!v){const Z=Nu({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:s});u.on("start",Z);const q=Cu({zoomPanValues:l,panOnDrag:b,onPaneContextMenu:!!V,onPanZoom:i,onTransformChange:j});u.on("zoom",q);const et=Mu({zoomPanValues:l,panOnDrag:b,panOnScroll:I,onPaneContextMenu:V,onPanZoomEnd:a,onDraggingChange:c});u.on("end",et)}const U=Iu({zoomActivationKeyPressed:O,panOnDrag:b,zoomOnScroll:R,panOnScroll:I,zoomOnDoubleClick:H,zoomOnPinch:L,userSelectionActive:v,noPanClassName:z,noWheelClassName:M,lib:X,connectionInProgress:K});u.filter(U),H?d.on("dblclick.zoom",g):d.on("dblclick.zoom",null)}function m(){u.on("zoom",null)}async function _(M,z,V){const v=Je(M),I=u==null?void 0:u.constrain()(v,z,V);return I&&await x(I),new Promise(b=>b(I))}async function p(M,z){const V=Je(M);return await x(V,z),new Promise(v=>v(V))}function w(M){if(d){const z=Je(M),V=d.property("__zoom");(V.k!==M.zoom||V.x!==M.x||V.y!==M.y)&&(u==null||u.transform(d,z,null,{sync:!0}))}}function S(){const M=d?cr(d.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function N(M,z){return d?new Promise(V=>{u==null||u.interpolate((z==null?void 0:z.interpolate)==="linear"?Ke:_e).scaleTo(tn(d,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>V(!0)),M)}):Promise.resolve(!1)}function A(M,z){return d?new Promise(V=>{u==null||u.interpolate((z==null?void 0:z.interpolate)==="linear"?Ke:_e).scaleBy(tn(d,z==null?void 0:z.duration,z==null?void 0:z.ease,()=>V(!0)),M)}):Promise.resolve(!1)}function $(M){u==null||u.scaleExtent(M)}function P(M){u==null||u.translateExtent(M)}function B(M){const z=!ut(M)||M<0?0:M;u==null||u.clickDistance(z)}return{update:y,destroy:m,setViewport:p,setViewportConstrained:_,getViewport:S,scaleTo:N,scaleBy:A,setScaleExtent:$,setTranslateExtent:P,syncViewport:w,setClickDistance:B}}var Xt;(function(t){t.Line="line",t.Handle="handle"})(Xt||(Xt={}));function ku({width:t,prevWidth:e,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=t-e,a=n-o,c=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function fo(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),o=t.includes("left"),r=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:o,affectsY:r}}function _t(t,e){return Math.max(0,e-t)}function bt(t,e){return Math.max(0,t-e)}function ye(t,e,n){return Math.max(0,e-t,t-n)}function ho(t,e){return t?!e:e}function Pu(t,e,n,o,r,i,s,a){let{affectsX:c,affectsY:l}=e;const{isHorizontal:f,isVertical:u}=e,d=f&&u,{xSnapped:h,ySnapped:g}=n,{minWidth:x,maxWidth:y,minHeight:m,maxHeight:_}=o,{x:p,y:w,width:S,height:N,aspectRatio:A}=t;let $=Math.floor(f?h-t.pointerX:0),P=Math.floor(u?g-t.pointerY:0);const B=S+(c?-$:$),M=N+(l?-P:P),z=-i[0]*S,V=-i[1]*N;let v=ye(B,x,y),I=ye(M,m,_);if(s){let C=0,E=0;c&&$<0?C=_t(p+$+z,s[0][0]):!c&&$>0&&(C=bt(p+B+z,s[1][0])),l&&P<0?E=_t(w+P+V,s[0][1]):!l&&P>0&&(E=bt(w+M+V,s[1][1])),v=Math.max(v,C),I=Math.max(I,E)}if(a){let C=0,E=0;c&&$>0?C=bt(p+$,a[0][0]):!c&&$<0&&(C=_t(p+B,a[1][0])),l&&P>0?E=bt(w+P,a[0][1]):!l&&P<0&&(E=_t(w+M,a[1][1])),v=Math.max(v,C),I=Math.max(I,E)}if(r){if(f){const C=ye(B/A,m,_)*A;if(v=Math.max(v,C),s){let E=0;!c&&!l||c&&!l&&d?E=bt(w+V+B/A,s[1][1])*A:E=_t(w+V+(c?$:-$)/A,s[0][1])*A,v=Math.max(v,E)}if(a){let E=0;!c&&!l||c&&!l&&d?E=_t(w+B/A,a[1][1])*A:E=bt(w+(c?$:-$)/A,a[0][1])*A,v=Math.max(v,E)}}if(u){const C=ye(M*A,x,y)/A;if(I=Math.max(I,C),s){let E=0;!c&&!l||l&&!c&&d?E=bt(p+M*A+z,s[1][0])/A:E=_t(p+(l?P:-P)*A+z,s[0][0])/A,I=Math.max(I,E)}if(a){let E=0;!c&&!l||l&&!c&&d?E=_t(p+M*A,a[1][0])/A:E=bt(p+(l?P:-P)*A,a[0][0])/A,I=Math.max(I,E)}}}P=P+(P<0?I:-I),$=$+($<0?v:-v),r&&(d?B>M*A?P=(ho(c,l)?-$:$)/A:$=(ho(c,l)?-P:P)*A:f?(P=$/A,l=c):($=P*A,c=l));const b=c?p+$:p,k=l?w+P:w;return{width:S+(c?-$:$),height:N+(l?-P:P),x:i[0]*$*(c?-1:1)+b,y:i[1]*P*(l?-1:1)+k}}const Rr={width:0,height:0,x:0,y:0},$u={...Rr,pointerX:0,pointerY:0,aspectRatio:1};function Tu(t){return[[0,0],[t.measured.width,t.measured.height]]}function zu(t,e,n){const o=e.position.x+t.position.x,r=e.position.y+t.position.y,i=t.measured.width??0,s=t.measured.height??0,a=n[0]*i,c=n[1]*s;return[[o-a,r-c],[o+i-a,r+s-c]]}function Du({domNode:t,nodeId:e,getStoreItems:n,onChange:o,onEnd:r}){const i=at(t);let s={controlDirection:fo("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:l,boundaries:f,keepAspectRatio:u,resizeDirection:d,onResizeStart:h,onResize:g,onResizeEnd:x,shouldResize:y}){let m={...Rr},_={...$u};s={boundaries:f,resizeDirection:d,keepAspectRatio:u,controlDirection:fo(l)};let p,w=null,S=[],N,A,$,P=!1;const B=Qo().on("start",M=>{const{nodeLookup:z,transform:V,snapGrid:v,snapToGrid:I,nodeOrigin:b,paneDomNode:k}=n();if(p=z.get(e),!p)return;w=(k==null?void 0:k.getBoundingClientRect())??null;const{xSnapped:C,ySnapped:E}=Qt(M.sourceEvent,{transform:V,snapGrid:v,snapToGrid:I,containerBounds:w});m={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},_={...m,pointerX:C,pointerY:E,aspectRatio:m.width/m.height},N=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(N=z.get(p.parentId),A=N&&p.extent==="parent"?Tu(N):void 0),S=[],$=void 0;for(const[L,R]of z)if(R.parentId===e&&(S.push({id:L,position:{...R.position},extent:R.extent}),R.extent==="parent"||R.expandParent)){const H=zu(R,p,R.origin??b);$?$=[[Math.min(H[0][0],$[0][0]),Math.min(H[0][1],$[0][1])],[Math.max(H[1][0],$[1][0]),Math.max(H[1][1],$[1][1])]]:$=H}h==null||h(M,{...m})}).on("drag",M=>{const{transform:z,snapGrid:V,snapToGrid:v,nodeOrigin:I}=n(),b=Qt(M.sourceEvent,{transform:z,snapGrid:V,snapToGrid:v,containerBounds:w}),k=[];if(!p)return;const{x:C,y:E,width:L,height:R}=m,H={},O=p.origin??I,{width:X,height:j,x:K,y:G}=Pu(_,s.controlDirection,b,s.boundaries,s.keepAspectRatio,O,A,$),F=X!==L,W=j!==R,Q=K!==C&&F,U=G!==E&&W;if(!Q&&!U&&!F&&!W)return;if((Q||U||O[0]===1||O[1]===1)&&(H.x=Q?K:m.x,H.y=U?G:m.y,m.x=H.x,m.y=H.y,S.length>0)){const nt=K-C,tt=G-E;for(const st of S)st.position={x:st.position.x-nt+O[0]*(X-L),y:st.position.y-tt+O[1]*(j-R)},k.push(st)}if((F||W)&&(H.width=F&&(!s.resizeDirection||s.resizeDirection==="horizontal")?X:m.width,H.height=W&&(!s.resizeDirection||s.resizeDirection==="vertical")?j:m.height,m.width=H.width,m.height=H.height),N&&p.expandParent){const nt=O[0]*(H.width??0);H.x&&H.x<nt&&(m.x=nt,_.x=_.x-(H.x-nt));const tt=O[1]*(H.height??0);H.y&&H.y<tt&&(m.y=tt,_.y=_.y-(H.y-tt))}const Z=ku({width:m.width,prevWidth:L,height:m.height,prevHeight:R,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),q={...m,direction:Z};(y==null?void 0:y(M,q))!==!1&&(P=!0,g==null||g(M,q),o(H,k))}).on("end",M=>{P&&(x==null||x(M,{...m}),r==null||r({...m}),P=!1)});i.call(B)}function c(){i.on(".drag",null)}return{update:a,destroy:c}}const Lu={},go=t=>{let e;const n=new Set,o=(f,u)=>{const d=typeof f=="function"?f(e):f;if(!Object.is(d,e)){const h=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),n.forEach(g=>g(e,h))}},r=()=>e,c={setState:o,getState:r,getInitialState:()=>l,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(Lu?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=e=t(o,r,c);return c},Hu=t=>t?go(t):go,{useDebugValue:Ru}=Es,{useSyncExternalStoreWithSelector:Vu}=Ns,Bu=t=>t;function Vr(t,e=Bu,n){const o=Vu(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return Ru(o),o}const po=(t,e)=>{const n=Hu(t),o=(r,i=e)=>Vr(n,r,i);return Object.assign(o,n),o},Fu=(t,e)=>t?po(t,e):po;function ot(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[o,r]of t)if(!Object.is(r,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!Object.is(t[o],e[o]))return!1;return!0}const Oe=D.createContext(null),Ou=Oe.Provider,Br=ht.error001();function J(t,e){const n=D.useContext(Oe);if(n===null)throw new Error(Br);return Vr(n,t,e)}function rt(){const t=D.useContext(Oe);if(t===null)throw new Error(Br);return D.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const mo={display:"none"},Xu={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Fr="react-flow__node-desc",Or="react-flow__edge-desc",Yu="react-flow__aria-live",ju=t=>t.ariaLiveMessage,Wu=t=>t.ariaLabelConfig;function Gu({rfId:t}){const e=J(ju);return T.jsx("div",{id:`${Yu}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:Xu,children:e})}function qu({rfId:t,disableKeyboardA11y:e}){const n=J(Wu);return T.jsxs(T.Fragment,{children:[T.jsx("div",{id:`${Fr}-${t}`,style:mo,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),T.jsx("div",{id:`${Or}-${t}`,style:mo,children:n["edge.a11yDescription.default"]}),!e&&T.jsx(Gu,{rfId:t})]})}const Xe=D.forwardRef(({position:t="top-left",children:e,className:n,style:o,...r},i)=>{const s=`${t}`.split("-");return T.jsx("div",{className:it(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:e})});Xe.displayName="Panel";function Ku({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:T.jsx(Xe,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:T.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Zu=t=>{const e=[],n=[];for(const[,o]of t.nodeLookup)o.selected&&e.push(o.internals.userNode);for(const[,o]of t.edgeLookup)o.selected&&n.push(o);return{selectedNodes:e,selectedEdges:n}},xe=t=>t.id;function Uu(t,e){return ot(t.selectedNodes.map(xe),e.selectedNodes.map(xe))&&ot(t.selectedEdges.map(xe),e.selectedEdges.map(xe))}function Qu({onSelectionChange:t}){const e=rt(),{selectedNodes:n,selectedEdges:o}=J(Zu,Uu);return D.useEffect(()=>{const r={nodes:n,edges:o};t==null||t(r),e.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,t]),null}const Ju=t=>!!t.onSelectionChangeHandlers;function td({onSelectionChange:t}){const e=J(Ju);return t||e?T.jsx(Qu,{onSelectionChange:t}):null}const pn=typeof window<"u"?D.useLayoutEffect:D.useEffect,Xr=[0,0],ed={x:0,y:0,zoom:1},nd=["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"],yo=[...nd,"rfId"],od=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),xo={translateExtent:ee,nodeOrigin:Xr,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function rd(t){const{setNodes:e,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:c}=J(od,ot),l=rt();pn(()=>(c(t.defaultNodes,t.defaultEdges),()=>{f.current=xo,a()}),[]);const f=D.useRef(xo);return pn(()=>{for(const u of yo){const d=t[u],h=f.current[u];d!==h&&(typeof t[u]>"u"||(u==="nodes"?e(d):u==="edges"?n(d):u==="minZoom"?o(d):u==="maxZoom"?r(d):u==="translateExtent"?i(d):u==="nodeExtent"?s(d):u==="ariaLabelConfig"?l.setState({ariaLabelConfig:Gl(d)}):u==="fitView"?l.setState({fitViewQueued:d}):u==="fitViewOptions"?l.setState({fitViewOptions:d}):l.setState({[u]:d})))}f.current=t},yo.map(u=>t[u])),null}function wo(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function id(t){var o;const[e,n]=D.useState(t==="system"?null:t);return D.useEffect(()=>{if(t!=="system"){n(t);return}const r=wo(),i=()=>n(r!=null&&r.matches?"dark":"light");return i(),r==null||r.addEventListener("change",i),()=>{r==null||r.removeEventListener("change",i)}},[t]),e!==null?e:(o=wo())!=null&&o.matches?"dark":"light"}const vo=typeof document<"u"?document:null;function ie(t=null,e={target:vo,actInsideInputWithModifier:!0}){const[n,o]=D.useState(!1),r=D.useRef(!1),i=D.useRef(new Set([])),[s,a]=D.useMemo(()=>{if(t!==null){const l=(Array.isArray(t)?t:[t]).filter(u=>typeof u=="string").map(u=>u.replace("+",`
2
+ `).replace(`
3
+
4
+ `,`
5
+ +`).split(`
6
+ `)),f=l.reduce((u,d)=>u.concat(...d),[]);return[l,f]}return[[],[]]},[t]);return D.useEffect(()=>{const c=(e==null?void 0:e.target)??vo,l=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(t!==null){const f=h=>{var y,m;if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!l)&&br(h))return!1;const x=bo(h.code,a);if(i.current.add(h[x]),_o(s,i.current,!1)){const _=((m=(y=h.composedPath)==null?void 0:y.call(h))==null?void 0:m[0])||h.target,p=(_==null?void 0:_.nodeName)==="BUTTON"||(_==null?void 0:_.nodeName)==="A";e.preventDefault!==!1&&(r.current||!p)&&h.preventDefault(),o(!0)}},u=h=>{const g=bo(h.code,a);_o(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),r.current=!1},d=()=>{i.current.clear(),o(!1)};return c==null||c.addEventListener("keydown",f),c==null||c.addEventListener("keyup",u),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{c==null||c.removeEventListener("keydown",f),c==null||c.removeEventListener("keyup",u),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[t,o]),n}function _o(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(r=>e.has(r)))}function bo(t,e){return e.includes(t)?"code":"key"}const sd=()=>{const t=rt();return D.useMemo(()=>({zoomIn:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,e):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,e):Promise.resolve(!1)},zoomTo:(e,n)=>{const{panZoom:o}=t.getState();return o?o.scaleTo(e,n):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[o,r,i],panZoom:s}=t.getState();return s?(await s.setViewport({x:e.x??o,y:e.y??r,zoom:e.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,n,o]=t.getState().transform;return{x:e,y:n,zoom:o}},setCenter:async(e,n,o)=>t.getState().setCenter(e,n,o),fitBounds:async(e,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=t.getState(),c=Sn(e,o,r,i,s,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=t.getState();if(!s)return e;const{x:a,y:c}=s.getBoundingClientRect(),l={x:e.x-a,y:e.y-c},f=n.snapGrid??r,u=n.snapToGrid??i;return ue(l,o,u,f)},flowToScreenPosition:e=>{const{transform:n,domNode:o}=t.getState();if(!o)return e;const{x:r,y:i}=o.getBoundingClientRect(),s=Pe(e,n);return{x:s.x+r,y:s.y+i}}}),[])};function Yr(t,e){const n=[],o=new Map,r=[];for(const i of t)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of e){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const c of s)ad(c,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function ad(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function jr(t,e){return Yr(t,e)}function Wr(t,e){return Yr(t,e)}function Mt(t,e){return{id:t,type:"select",selected:e}}function Dt(t,e=new Set,n=!1){const o=[];for(const[r,i]of t){const s=e.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(Mt(i.id,s)))}return o}function Eo({items:t=[],lookup:e}){var r;const n=[],o=new Map(t.map(i=>[i.id,i]));for(const[i,s]of t.entries()){const a=e.get(s.id),c=((r=a==null?void 0:a.internals)==null?void 0:r.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(const[i]of e)o.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function So(t){return{id:t.id,type:"remove"}}const No=t=>Hl(t),cd=t=>gr(t);function Gr(t){return D.forwardRef(t)}function Co(t){const[e,n]=D.useState(BigInt(0)),[o]=D.useState(()=>ld(()=>n(r=>r+BigInt(1))));return pn(()=>{const r=o.get();r.length&&(t(r),o.reset())},[e]),o}function ld(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const qr=D.createContext(null);function ud({children:t}){const e=rt(),n=D.useCallback(a=>{const{nodes:c=[],setNodes:l,hasDefaultNodes:f,onNodesChange:u,nodeLookup:d,fitViewQueued:h,onNodesChangeMiddlewareMap:g}=e.getState();let x=c;for(const m of a)x=typeof m=="function"?m(x):m;let y=Eo({items:x,lookup:d});for(const m of g.values())y=m(y);f&&l(x),y.length>0?u==null||u(y):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:_,setNodes:p}=e.getState();m&&p(_)})},[]),o=Co(n),r=D.useCallback(a=>{const{edges:c=[],setEdges:l,hasDefaultEdges:f,onEdgesChange:u,edgeLookup:d}=e.getState();let h=c;for(const g of a)h=typeof g=="function"?g(h):g;f?l(h):u&&u(Eo({items:h,lookup:d}))},[]),i=Co(r),s=D.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return T.jsx(qr.Provider,{value:s,children:t})}function dd(){const t=D.useContext(qr);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const fd=t=>!!t.panZoom;function Pn(){const t=sd(),e=rt(),n=dd(),o=J(fd),r=D.useMemo(()=>{const i=u=>e.getState().nodeLookup.get(u),s=u=>{n.nodeQueue.push(u)},a=u=>{n.edgeQueue.push(u)},c=u=>{var m,_;const{nodeLookup:d,nodeOrigin:h}=e.getState(),g=No(u)?u:d.get(u.id),x=g.parentId?vr(g.position,g.measured,g.parentId,d,h):g.position,y={...g,position:x,width:((m=g.measured)==null?void 0:m.width)??g.width,height:((_=g.measured)==null?void 0:_.height)??g.height};return Ft(y)},l=(u,d,h={replace:!1})=>{s(g=>g.map(x=>{if(x.id===u){const y=typeof d=="function"?d(x):d;return h.replace&&No(y)?y:{...x,...y}}return x}))},f=(u,d,h={replace:!1})=>{a(g=>g.map(x=>{if(x.id===u){const y=typeof d=="function"?d(x):d;return h.replace&&cd(y)?y:{...x,...y}}return x}))};return{getNodes:()=>e.getState().nodes.map(u=>({...u})),getNode:u=>{var d;return(d=i(u))==null?void 0:d.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:u=[]}=e.getState();return u.map(d=>({...d}))},getEdge:u=>e.getState().edgeLookup.get(u),setNodes:s,setEdges:a,addNodes:u=>{const d=Array.isArray(u)?u:[u];n.nodeQueue.push(h=>[...h,...d])},addEdges:u=>{const d=Array.isArray(u)?u:[u];n.edgeQueue.push(h=>[...h,...d])},toObject:()=>{const{nodes:u=[],edges:d=[],transform:h}=e.getState(),[g,x,y]=h;return{nodes:u.map(m=>({...m})),edges:d.map(m=>({...m})),viewport:{x:g,y:x,zoom:y}}},deleteElements:async({nodes:u=[],edges:d=[]})=>{const{nodes:h,edges:g,onNodesDelete:x,onEdgesDelete:y,triggerNodeChanges:m,triggerEdgeChanges:_,onDelete:p,onBeforeDelete:w}=e.getState(),{nodes:S,edges:N}=await Ol({nodesToRemove:u,edgesToRemove:d,nodes:h,edges:g,onBeforeDelete:w}),A=N.length>0,$=S.length>0;if(A){const P=N.map(So);y==null||y(N),_(P)}if($){const P=S.map(So);x==null||x(S),m(P)}return($||A)&&(p==null||p({nodes:S,edges:N})),{deletedNodes:S,deletedEdges:N}},getIntersectingNodes:(u,d=!0,h)=>{const g=to(u),x=g?u:c(u),y=h!==void 0;return x?(h||e.getState().nodes).filter(m=>{const _=e.getState().nodeLookup.get(m.id);if(_&&!g&&(m.id===u.id||!_.internals.positionAbsolute))return!1;const p=Ft(y?m:_),w=oe(p,x);return d&&w>0||w>=p.width*p.height||w>=x.width*x.height}):[]},isNodeIntersecting:(u,d,h=!0)=>{const x=to(u)?u:c(u);if(!x)return!1;const y=oe(x,d);return h&&y>0||y>=d.width*d.height||y>=x.width*x.height},updateNode:l,updateNodeData:(u,d,h={replace:!1})=>{l(u,g=>{const x=typeof d=="function"?d(g):d;return h.replace?{...g,data:x}:{...g,data:{...g.data,...x}}},h)},updateEdge:f,updateEdgeData:(u,d,h={replace:!1})=>{f(u,g=>{const x=typeof d=="function"?d(g):d;return h.replace?{...g,data:x}:{...g,data:{...g.data,...x}}},h)},getNodesBounds:u=>{const{nodeLookup:d,nodeOrigin:h}=e.getState();return Rl(u,{nodeLookup:d,nodeOrigin:h})},getHandleConnections:({type:u,id:d,nodeId:h})=>{var g;return Array.from(((g=e.getState().connectionLookup.get(`${h}-${u}${d?`-${d}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:u,handleId:d,nodeId:h})=>{var g;return Array.from(((g=e.getState().connectionLookup.get(`${h}${u?d?`-${u}-${d}`:`-${u}`:""}`))==null?void 0:g.values())??[])},fitView:async u=>{const d=e.getState().fitViewResolver??Wl();return e.setState({fitViewQueued:!0,fitViewOptions:u,fitViewResolver:d}),n.nodeQueue.push(h=>[...h]),d.promise}}},[]);return D.useMemo(()=>({...r,...t,viewportInitialized:o}),[o])}const Mo=t=>t.selected,hd=typeof window<"u"?window:void 0;function gd({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=rt(),{deleteElements:o}=Pn(),r=ie(t,{actInsideInputWithModifier:!1}),i=ie(e,{target:hd});D.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(Mo),edges:s.filter(Mo)}),n.setState({nodesSelectionActive:!1})}},[r]),D.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function pd(t){const e=rt();D.useEffect(()=>{const n=()=>{var r,i,s,a;if(!t.current||!(((i=(r=t.current).checkVisibility)==null?void 0:i.call(r))??!0))return!1;const o=Nn(t.current);(o.height===0||o.width===0)&&((a=(s=e.getState()).onError)==null||a.call(s,"004",ht.error004())),e.setState({width:o.width||500,height:o.height||500})};if(t.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(t.current),()=>{window.removeEventListener("resize",n),o&&t.current&&o.unobserve(t.current)}}},[])}const Ye={position:"absolute",width:"100%",height:"100%",top:0,left:0},md=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function yd({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=It.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:l,minZoom:f,maxZoom:u,zoomActivationKeyCode:d,preventScrolling:h=!0,children:g,noWheelClassName:x,noPanClassName:y,onViewportChange:m,isControlledViewport:_,paneClickDistance:p,selectionOnDrag:w}){const S=rt(),N=D.useRef(null),{userSelectionActive:A,lib:$,connectionInProgress:P}=J(md,ot),B=ie(d),M=D.useRef();pd(N);const z=D.useCallback(V=>{m==null||m({x:V[0],y:V[1],zoom:V[2]}),_||S.setState({transform:V})},[m,_]);return D.useEffect(()=>{if(N.current){M.current=Au({domNode:N.current,minZoom:f,maxZoom:u,translateExtent:l,viewport:c,onDraggingChange:b=>S.setState(k=>k.paneDragging===b?k:{paneDragging:b}),onPanZoomStart:(b,k)=>{const{onViewportChangeStart:C,onMoveStart:E}=S.getState();E==null||E(b,k),C==null||C(k)},onPanZoom:(b,k)=>{const{onViewportChange:C,onMove:E}=S.getState();E==null||E(b,k),C==null||C(k)},onPanZoomEnd:(b,k)=>{const{onViewportChangeEnd:C,onMoveEnd:E}=S.getState();E==null||E(b,k),C==null||C(k)}});const{x:V,y:v,zoom:I}=M.current.getViewport();return S.setState({panZoom:M.current,transform:[V,v,I],domNode:N.current.closest(".react-flow")}),()=>{var b;(b=M.current)==null||b.destroy()}}},[]),D.useEffect(()=>{var V;(V=M.current)==null||V.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:B,preventScrolling:h,noPanClassName:y,userSelectionActive:A,noWheelClassName:x,lib:$,onTransformChange:z,connectionInProgress:P,selectionOnDrag:w,paneClickDistance:p})},[t,e,n,o,r,i,s,a,B,h,y,A,x,$,z,P,w,p]),T.jsx("div",{className:"react-flow__renderer",ref:N,style:Ye,children:g})}const xd=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function wd(){const{userSelectionActive:t,userSelectionRect:e}=J(xd,ot);return t&&e?T.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const en=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},vd=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function _d({isSelecting:t,selectionKeyPressed:e,selectionMode:n=ne.Full,panOnDrag:o,paneClickDistance:r,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:a,onPaneClick:c,onPaneContextMenu:l,onPaneScroll:f,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:h,children:g}){const x=rt(),{userSelectionActive:y,elementsSelectable:m,dragging:_,connectionInProgress:p}=J(vd,ot),w=m&&(t||y),S=D.useRef(null),N=D.useRef(),A=D.useRef(new Set),$=D.useRef(new Set),P=D.useRef(!1),B=C=>{if(P.current||p){P.current=!1;return}c==null||c(C),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},M=C=>{if(Array.isArray(o)&&(o!=null&&o.includes(2))){C.preventDefault();return}l==null||l(C)},z=f?C=>f(C):void 0,V=C=>{P.current&&(C.stopPropagation(),P.current=!1)},v=C=>{var j,K;const{domNode:E}=x.getState();if(N.current=E==null?void 0:E.getBoundingClientRect(),!N.current)return;const L=C.target===S.current;if(!L&&!!C.target.closest(".nokey")||!t||!(i&&L||e)||C.button!==0||!C.isPrimary)return;(K=(j=C.target)==null?void 0:j.setPointerCapture)==null||K.call(j,C.pointerId),P.current=!1;const{x:O,y:X}=dt(C.nativeEvent,N.current);x.setState({userSelectionRect:{width:0,height:0,startX:O,startY:X,x:O,y:X}}),L||(C.stopPropagation(),C.preventDefault())},I=C=>{const{userSelectionRect:E,transform:L,nodeLookup:R,edgeLookup:H,connectionLookup:O,triggerNodeChanges:X,triggerEdgeChanges:j,defaultEdgeOptions:K,resetSelectedElements:G}=x.getState();if(!N.current||!E)return;const{x:F,y:W}=dt(C.nativeEvent,N.current),{startX:Q,startY:U}=E;if(!P.current){const tt=e?0:r;if(Math.hypot(F-Q,W-U)<=tt)return;G(),s==null||s(C)}P.current=!0;const Z={startX:Q,startY:U,x:F<Q?F:Q,y:W<U?W:U,width:Math.abs(F-Q),height:Math.abs(W-U)},q=A.current,et=$.current;A.current=new Set(En(R,Z,L,n===ne.Partial,!0).map(tt=>tt.id)),$.current=new Set;const nt=(K==null?void 0:K.selectable)??!0;for(const tt of A.current){const st=O.get(tt);if(st)for(const{edgeId:vt}of st.values()){const pt=H.get(vt);pt&&(pt.selectable??nt)&&$.current.add(vt)}}if(!eo(q,A.current)){const tt=Dt(R,A.current,!0);X(tt)}if(!eo(et,$.current)){const tt=Dt(H,$.current);j(tt)}x.setState({userSelectionRect:Z,userSelectionActive:!0,nodesSelectionActive:!1})},b=C=>{var E,L;C.button===0&&((L=(E=C.target)==null?void 0:E.releasePointerCapture)==null||L.call(E,C.pointerId),!y&&C.target===S.current&&x.getState().userSelectionRect&&(B==null||B(C)),x.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(a==null||a(C),x.setState({nodesSelectionActive:A.current.size>0})))},k=o===!0||Array.isArray(o)&&o.includes(0);return T.jsxs("div",{className:it(["react-flow__pane",{draggable:k,dragging:_,selection:t}]),onClick:w?void 0:en(B,S),onContextMenu:en(M,S),onWheel:en(z,S),onPointerEnter:w?void 0:u,onPointerMove:w?I:d,onPointerUp:w?b:void 0,onPointerDownCapture:w?v:void 0,onClickCapture:w?V:void 0,onPointerLeave:h,ref:S,style:Ye,children:[g,T.jsx(wd,{})]})}function mn({id:t,store:e,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:c}=e.getState(),l=a.get(t);if(!l){c==null||c("012",ht.error012(t));return}e.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&s)&&(i({nodes:[l],edges:[]}),requestAnimationFrame(()=>{var f;return(f=o==null?void 0:o.current)==null?void 0:f.blur()})):r([t])}function Kr({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=rt(),[c,l]=D.useState(!1),f=D.useRef();return D.useEffect(()=>{f.current=pu({getStoreItems:()=>a.getState(),onNodeMouseDown:u=>{mn({id:u,store:a,nodeRef:t})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),D.useEffect(()=>{if(!(e||!t.current||!f.current))return f.current.update({noDragClassName:n,handleSelector:o,domNode:t.current,isSelectable:i,nodeId:r,nodeClickDistance:s}),()=>{var u;(u=f.current)==null||u.destroy()}},[n,o,e,i,t,r,s]),c}const bd=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function Zr(){const t=rt();return D.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:c,nodeLookup:l,nodeOrigin:f}=t.getState(),u=new Map,d=bd(s),h=r?i[0]:5,g=r?i[1]:5,x=n.direction.x*h*n.factor,y=n.direction.y*g*n.factor;for(const[,m]of l){if(!d(m))continue;let _={x:m.internals.positionAbsolute.x+x,y:m.internals.positionAbsolute.y+y};r&&(_=le(_,i));const{position:p,positionAbsolute:w}=pr({nodeId:m.id,nextPosition:_,nodeLookup:l,nodeExtent:o,nodeOrigin:f,onError:a});m.position=p,m.internals.positionAbsolute=w,u.set(m.id,m)}c(u)},[])}const $n=D.createContext(null),Ed=$n.Provider;$n.Consumer;const Ur=()=>D.useContext($n),Sd=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),Nd=(t,e,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:c,isValid:l}=s,f=(c==null?void 0:c.nodeId)===t&&(c==null?void 0:c.id)===e&&(c==null?void 0:c.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===t&&(a==null?void 0:a.id)===e&&(a==null?void 0:a.type)===n,connectingTo:f,clickConnecting:(r==null?void 0:r.nodeId)===t&&(r==null?void 0:r.id)===e&&(r==null?void 0:r.type)===n,isPossibleEndHandle:i===Vt.Strict?(a==null?void 0:a.type)!==n:t!==(a==null?void 0:a.nodeId)||e!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:f&&l}};function Cd({type:t="source",position:e=Y.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:c,className:l,onMouseDown:f,onTouchStart:u,...d},h){var I,b;const g=s||null,x=t==="target",y=rt(),m=Ur(),{connectOnClick:_,noPanClassName:p,rfId:w}=J(Sd,ot),{connectingFrom:S,connectingTo:N,clickConnecting:A,isPossibleEndHandle:$,connectionInProcess:P,clickConnectionInProcess:B,valid:M}=J(Nd(m,g,t),ot);m||(b=(I=y.getState()).onError)==null||b.call(I,"010",ht.error010());const z=k=>{const{defaultEdgeOptions:C,onConnect:E,hasDefaultEdges:L}=y.getState(),R={...C,...k};if(L){const{edges:H,setEdges:O}=y.getState();O(Jl(R,H))}E==null||E(R),a==null||a(R)},V=k=>{if(!m)return;const C=Er(k.nativeEvent);if(r&&(C&&k.button===0||!C)){const E=y.getState();gn.onPointerDown(k.nativeEvent,{handleDomNode:k.currentTarget,autoPanOnConnect:E.autoPanOnConnect,connectionMode:E.connectionMode,connectionRadius:E.connectionRadius,domNode:E.domNode,nodeLookup:E.nodeLookup,lib:E.lib,isTarget:x,handleId:g,nodeId:m,flowId:E.rfId,panBy:E.panBy,cancelConnection:E.cancelConnection,onConnectStart:E.onConnectStart,onConnectEnd:(...L)=>{var R,H;return(H=(R=y.getState()).onConnectEnd)==null?void 0:H.call(R,...L)},updateConnection:E.updateConnection,onConnect:z,isValidConnection:n||((...L)=>{var R,H;return((H=(R=y.getState()).isValidConnection)==null?void 0:H.call(R,...L))??!0}),getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:E.autoPanSpeed,dragThreshold:E.connectionDragThreshold})}C?f==null||f(k):u==null||u(k)},v=k=>{const{onClickConnectStart:C,onClickConnectEnd:E,connectionClickStartHandle:L,connectionMode:R,isValidConnection:H,lib:O,rfId:X,nodeLookup:j,connection:K}=y.getState();if(!m||!L&&!r)return;if(!L){C==null||C(k.nativeEvent,{nodeId:m,handleId:g,handleType:t}),y.setState({connectionClickStartHandle:{nodeId:m,type:t,id:g}});return}const G=_r(k.target),F=n||H,{connection:W,isValid:Q}=gn.isValid(k.nativeEvent,{handle:{nodeId:m,id:g,type:t},connectionMode:R,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:F,flowId:X,doc:G,lib:O,nodeLookup:j});Q&&W&&z(W);const U=structuredClone(K);delete U.inProgress,U.toPosition=U.toHandle?U.toHandle.position:null,E==null||E(k,U),y.setState({connectionClickStartHandle:null})};return T.jsx("div",{"data-handleid":g,"data-nodeid":m,"data-handlepos":e,"data-id":`${w}-${m}-${g}-${t}`,className:it(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",p,l,{source:!x,target:x,connectable:o,connectablestart:r,connectableend:i,clickconnecting:A,connectingfrom:S,connectingto:N,valid:M,connectionindicator:o&&(!P||$)&&(P||B?i:r)}]),onMouseDown:V,onTouchStart:V,onClick:_?v:void 0,ref:h,...d,children:c})}const $e=D.memo(Gr(Cd));function Md({data:t,isConnectable:e,sourcePosition:n=Y.Bottom}){return T.jsxs(T.Fragment,{children:[t==null?void 0:t.label,T.jsx($e,{type:"source",position:n,isConnectable:e})]})}function Id({data:t,isConnectable:e,targetPosition:n=Y.Top,sourcePosition:o=Y.Bottom}){return T.jsxs(T.Fragment,{children:[T.jsx($e,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,T.jsx($e,{type:"source",position:o,isConnectable:e})]})}function Ad(){return null}function kd({data:t,isConnectable:e,targetPosition:n=Y.Top}){return T.jsxs(T.Fragment,{children:[T.jsx($e,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label]})}const Te={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Io={input:Md,default:Id,output:kd,group:Ad};function Pd(t){var e,n,o,r;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((e=t.style)==null?void 0:e.width),height:t.height??t.initialHeight??((n=t.style)==null?void 0:n.height)}:{width:t.width??((o=t.style)==null?void 0:o.width),height:t.height??((r=t.style)==null?void 0:r.height)}}const $d=t=>{const{width:e,height:n,x:o,y:r}=ce(t.nodeLookup,{filter:i=>!!i.selected});return{width:ut(e)?e:null,height:ut(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${o}px,${r}px)`}};function Td({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=rt(),{width:r,height:i,transformString:s,userSelectionActive:a}=J($d,ot),c=Zr(),l=D.useRef(null);D.useEffect(()=>{var h;n||(h=l.current)==null||h.focus({preventScroll:!0})},[n]);const f=!a&&r!==null&&i!==null;if(Kr({nodeRef:l,disabled:!f}),!f)return null;const u=t?h=>{const g=o.getState().nodes.filter(x=>x.selected);t(h,g)}:void 0,d=h=>{Object.prototype.hasOwnProperty.call(Te,h.key)&&(h.preventDefault(),c({direction:Te[h.key],factor:h.shiftKey?4:1}))};return T.jsx("div",{className:it(["react-flow__nodesselection","react-flow__container",e]),style:{transform:s},children:T.jsx("div",{ref:l,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:r,height:i}})})}const Ao=typeof window<"u"?window:void 0,zd=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Qr({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:f,selectionMode:u,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:x,zoomActivationKeyCode:y,elementsSelectable:m,zoomOnScroll:_,zoomOnPinch:p,panOnScroll:w,panOnScrollSpeed:S,panOnScrollMode:N,zoomOnDoubleClick:A,panOnDrag:$,defaultViewport:P,translateExtent:B,minZoom:M,maxZoom:z,preventScrolling:V,onSelectionContextMenu:v,noWheelClassName:I,noPanClassName:b,disableKeyboardA11y:k,onViewportChange:C,isControlledViewport:E}){const{nodesSelectionActive:L,userSelectionActive:R}=J(zd,ot),H=ie(l,{target:Ao}),O=ie(x,{target:Ao}),X=O||$,j=O||w,K=f&&X!==!0,G=H||R||K;return gd({deleteKeyCode:c,multiSelectionKeyCode:g}),T.jsx(yd,{onPaneContextMenu:i,elementsSelectable:m,zoomOnScroll:_,zoomOnPinch:p,panOnScroll:j,panOnScrollSpeed:S,panOnScrollMode:N,zoomOnDoubleClick:A,panOnDrag:!H&&X,defaultViewport:P,translateExtent:B,minZoom:M,maxZoom:z,zoomActivationKeyCode:y,preventScrolling:V,noWheelClassName:I,noPanClassName:b,onViewportChange:C,isControlledViewport:E,paneClickDistance:a,selectionOnDrag:K,children:T.jsxs(_d,{onSelectionStart:d,onSelectionEnd:h,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:X,isSelecting:!!G,selectionMode:u,selectionKeyPressed:H,paneClickDistance:a,selectionOnDrag:K,children:[t,L&&T.jsx(Td,{onSelectionContextMenu:v,noPanClassName:b,disableKeyboardA11y:k})]})})}Qr.displayName="FlowRenderer";const Dd=D.memo(Qr),Ld=t=>e=>t?En(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function Hd(t){return J(D.useCallback(Ld(t),[t]),ot)}const Rd=t=>t.updateNodeInternals;function Vd(){const t=J(Rd),[e]=D.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),t(o)}));return D.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function Bd({node:t,nodeType:e,hasDimensions:n,resizeObserver:o}){const r=rt(),i=D.useRef(null),s=D.useRef(null),a=D.useRef(t.sourcePosition),c=D.useRef(t.targetPosition),l=D.useRef(e),f=n&&!!t.internals.handleBounds;return D.useEffect(()=>{i.current&&!t.hidden&&(!f||s.current!==i.current)&&(s.current&&(o==null||o.unobserve(s.current)),o==null||o.observe(i.current),s.current=i.current)},[f,t.hidden]),D.useEffect(()=>()=>{s.current&&(o==null||o.unobserve(s.current),s.current=null)},[]),D.useEffect(()=>{if(i.current){const u=l.current!==e,d=a.current!==t.sourcePosition,h=c.current!==t.targetPosition;(u||d||h)&&(l.current=e,a.current=t.sourcePosition,c.current=t.targetPosition,r.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:i.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),i}function Fd({id:t,onClick:e,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:c,nodesConnectable:l,nodesFocusable:f,resizeObserver:u,noDragClassName:d,noPanClassName:h,disableKeyboardA11y:g,rfId:x,nodeTypes:y,nodeClickDistance:m,onError:_}){const{node:p,internals:w,isParent:S}=J(F=>{const W=F.nodeLookup.get(t),Q=F.parentLookup.has(t);return{node:W,internals:W.internals,isParent:Q}},ot);let N=p.type||"default",A=(y==null?void 0:y[N])||Io[N];A===void 0&&(_==null||_("003",ht.error003(N)),N="default",A=(y==null?void 0:y.default)||Io.default);const $=!!(p.draggable||a&&typeof p.draggable>"u"),P=!!(p.selectable||c&&typeof p.selectable>"u"),B=!!(p.connectable||l&&typeof p.connectable>"u"),M=!!(p.focusable||f&&typeof p.focusable>"u"),z=rt(),V=wr(p),v=Bd({node:p,nodeType:N,hasDimensions:V,resizeObserver:u}),I=Kr({nodeRef:v,disabled:p.hidden||!$,noDragClassName:d,handleSelector:p.dragHandle,nodeId:t,isSelectable:P,nodeClickDistance:m}),b=Zr();if(p.hidden)return null;const k=wt(p),C=Pd(p),E=P||$||e||n||o||r,L=n?F=>n(F,{...w.userNode}):void 0,R=o?F=>o(F,{...w.userNode}):void 0,H=r?F=>r(F,{...w.userNode}):void 0,O=i?F=>i(F,{...w.userNode}):void 0,X=s?F=>s(F,{...w.userNode}):void 0,j=F=>{const{selectNodesOnDrag:W,nodeDragThreshold:Q}=z.getState();P&&(!W||!$||Q>0)&&mn({id:t,store:z,nodeRef:v}),e&&e(F,{...w.userNode})},K=F=>{if(!(br(F.nativeEvent)||g)){if(ur.includes(F.key)&&P){const W=F.key==="Escape";mn({id:t,store:z,unselect:W,nodeRef:v})}else if($&&p.selected&&Object.prototype.hasOwnProperty.call(Te,F.key)){F.preventDefault();const{ariaLabelConfig:W}=z.getState();z.setState({ariaLiveMessage:W["node.a11yDescription.ariaLiveMessage"]({direction:F.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),b({direction:Te[F.key],factor:F.shiftKey?4:1})}}},G=()=>{var et;if(g||!((et=v.current)!=null&&et.matches(":focus-visible")))return;const{transform:F,width:W,height:Q,autoPanOnNodeFocus:U,setCenter:Z}=z.getState();if(!U)return;En(new Map([[t,p]]),{x:0,y:0,width:W,height:Q},F,!0).length>0||Z(p.position.x+k.width/2,p.position.y+k.height/2,{zoom:F[2]})};return T.jsx("div",{className:it(["react-flow__node",`react-flow__node-${N}`,{[h]:$},p.className,{selected:p.selected,selectable:P,parent:S,draggable:$,dragging:I}]),ref:v,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:E?"all":"none",visibility:V?"visible":"hidden",...p.style,...C},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:L,onMouseMove:R,onMouseLeave:H,onContextMenu:O,onClick:j,onDoubleClick:X,onKeyDown:M?K:void 0,tabIndex:M?0:void 0,onFocus:M?G:void 0,role:p.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${Fr}-${x}`,"aria-label":p.ariaLabel,...p.domAttributes,children:T.jsx(Ed,{value:t,children:T.jsx(A,{id:t,data:p.data,type:N,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:p.selected??!1,selectable:P,draggable:$,deletable:p.deletable??!0,isConnectable:B,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:I,dragHandle:p.dragHandle,zIndex:w.z,parentId:p.parentId,...k})})})}var Od=D.memo(Fd);const Xd=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Jr(t){const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,onError:i}=J(Xd,ot),s=Hd(t.onlyRenderVisibleElements),a=Vd();return T.jsx("div",{className:"react-flow__nodes",style:Ye,children:s.map(c=>T.jsx(Od,{id:c,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:a,nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,nodeClickDistance:t.nodeClickDistance,onError:i},c))})}Jr.displayName="NodeRenderer";const Yd=D.memo(Jr);function jd(t){return J(D.useCallback(n=>{if(!t)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&Zl({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[t]),ot)}const Wd=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return T.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Gd=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return T.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ko={[Ae.Arrow]:Wd,[Ae.ArrowClosed]:Gd};function qd(t){const e=rt();return D.useMemo(()=>{var r,i;return Object.prototype.hasOwnProperty.call(ko,t)?ko[t]:((i=(r=e.getState()).onError)==null||i.call(r,"009",ht.error009(t)),null)},[t])}const Kd=({id:t,type:e,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const c=qd(e);return c?T.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:T.jsx(c,{color:n,strokeWidth:s})}):null},ti=({defaultColor:t,rfId:e})=>{const n=J(i=>i.edges),o=J(i=>i.defaultEdgeOptions),r=D.useMemo(()=>ru(n,{id:e,defaultColor:t,defaultMarkerStart:o==null?void 0:o.markerStart,defaultMarkerEnd:o==null?void 0:o.markerEnd}),[n,o,e,t]);return r.length?T.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:T.jsx("defs",{children:r.map(i=>T.jsx(Kd,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};ti.displayName="MarkerDefinitions";var Zd=D.memo(ti);function ei({x:t,y:e,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:c,className:l,...f}){const[u,d]=D.useState({x:1,y:0,width:0,height:0}),h=it(["react-flow__edge-textwrapper",l]),g=D.useRef(null);return D.useEffect(()=>{if(g.current){const x=g.current.getBBox();d({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?T.jsxs("g",{transform:`translate(${t-u.width/2} ${e-u.height/2})`,className:h,visibility:u.width?"visible":"hidden",...f,children:[r&&T.jsx("rect",{width:u.width+2*s[0],x:-s[0],y:-s[1],height:u.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),T.jsx("text",{className:"react-flow__edge-text",y:u.height/2,dy:"0.3em",ref:g,style:o,children:n}),c]}):null}ei.displayName="EdgeText";const Ud=D.memo(ei);function je({path:t,labelX:e,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:l=20,...f}){return T.jsxs(T.Fragment,{children:[T.jsx("path",{...f,d:t,fill:"none",className:it(["react-flow__edge-path",f.className])}),l?T.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:l,className:"react-flow__edge-interaction"}):null,o&&ut(e)&&ut(n)?T.jsx(Ud,{x:e,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function Po({pos:t,x1:e,y1:n,x2:o,y2:r}){return t===Y.Left||t===Y.Right?[.5*(e+o),n]:[e,.5*(n+r)]}function ni({sourceX:t,sourceY:e,sourcePosition:n=Y.Bottom,targetX:o,targetY:r,targetPosition:i=Y.Top}){const[s,a]=Po({pos:n,x1:t,y1:e,x2:o,y2:r}),[c,l]=Po({pos:i,x1:o,y1:r,x2:t,y2:e}),[f,u,d,h]=Sr({sourceX:t,sourceY:e,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:c,targetControlY:l});return[`M${t},${e} C${s},${a} ${c},${l} ${o},${r}`,f,u,d,h]}function oi(t){return D.memo(({id:e,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:c,labelStyle:l,labelShowBg:f,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:x,markerStart:y,interactionWidth:m})=>{const[_,p,w]=ni({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),S=t.isInternal?void 0:e;return T.jsx(je,{id:S,path:_,labelX:p,labelY:w,label:c,labelStyle:l,labelShowBg:f,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:x,markerStart:y,interactionWidth:m})})}const Qd=oi({isInternal:!1}),ri=oi({isInternal:!0});Qd.displayName="SimpleBezierEdge";ri.displayName="SimpleBezierEdgeInternal";function ii(t){return D.memo(({id:e,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:u,style:d,sourcePosition:h=Y.Bottom,targetPosition:g=Y.Top,markerEnd:x,markerStart:y,pathOptions:m,interactionWidth:_})=>{const[p,w,S]=dn({sourceX:n,sourceY:o,sourcePosition:h,targetX:r,targetY:i,targetPosition:g,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),N=t.isInternal?void 0:e;return T.jsx(je,{id:N,path:p,labelX:w,labelY:S,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:u,style:d,markerEnd:x,markerStart:y,interactionWidth:_})})}const si=ii({isInternal:!1}),ai=ii({isInternal:!0});si.displayName="SmoothStepEdge";ai.displayName="SmoothStepEdgeInternal";function ci(t){return D.memo(({id:e,...n})=>{var r;const o=t.isInternal?void 0:e;return T.jsx(si,{...n,id:o,pathOptions:D.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const Jd=ci({isInternal:!1}),li=ci({isInternal:!0});Jd.displayName="StepEdge";li.displayName="StepEdgeInternal";function ui(t){return D.memo(({id:e,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:g,interactionWidth:x})=>{const[y,m,_]=Mr({sourceX:n,sourceY:o,targetX:r,targetY:i}),p=t.isInternal?void 0:e;return T.jsx(je,{id:p,path:y,labelX:m,labelY:_,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:f,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:g,interactionWidth:x})})}const tf=ui({isInternal:!1}),di=ui({isInternal:!0});tf.displayName="StraightEdge";di.displayName="StraightEdgeInternal";function fi(t){return D.memo(({id:e,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=Y.Bottom,targetPosition:a=Y.Top,label:c,labelStyle:l,labelShowBg:f,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:x,markerStart:y,pathOptions:m,interactionWidth:_})=>{const[p,w,S]=Nr({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:m==null?void 0:m.curvature}),N=t.isInternal?void 0:e;return T.jsx(je,{id:N,path:p,labelX:w,labelY:S,label:c,labelStyle:l,labelShowBg:f,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,style:g,markerEnd:x,markerStart:y,interactionWidth:_})})}const ef=fi({isInternal:!1}),hi=fi({isInternal:!0});ef.displayName="BezierEdge";hi.displayName="BezierEdgeInternal";const $o={default:hi,straight:di,step:li,smoothstep:ai,simplebezier:ri},To={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},nf=(t,e,n)=>n===Y.Left?t-e:n===Y.Right?t+e:t,of=(t,e,n)=>n===Y.Top?t-e:n===Y.Bottom?t+e:t,zo="react-flow__edgeupdater";function Do({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return T.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:it([zo,`${zo}-${a}`]),cx:nf(e,o,t),cy:of(n,o,t),r:o,stroke:"transparent",fill:"transparent"})}function rf({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:c,onReconnect:l,onReconnectStart:f,onReconnectEnd:u,setReconnecting:d,setUpdateHover:h}){const g=rt(),x=(w,S)=>{if(w.button!==0)return;const{autoPanOnConnect:N,domNode:A,connectionMode:$,connectionRadius:P,lib:B,onConnectStart:M,cancelConnection:z,nodeLookup:V,rfId:v,panBy:I,updateConnection:b}=g.getState(),k=S.type==="target",C=(R,H)=>{d(!1),u==null||u(R,n,S.type,H)},E=R=>l==null?void 0:l(n,R),L=(R,H)=>{d(!0),f==null||f(w,n,S.type),M==null||M(R,H)};gn.onPointerDown(w.nativeEvent,{autoPanOnConnect:N,connectionMode:$,connectionRadius:P,domNode:A,handleId:S.id,nodeId:S.nodeId,nodeLookup:V,isTarget:k,edgeUpdaterType:S.type,lib:B,flowId:v,cancelConnection:z,panBy:I,isValidConnection:(...R)=>{var H,O;return((O=(H=g.getState()).isValidConnection)==null?void 0:O.call(H,...R))??!0},onConnect:E,onConnectStart:L,onConnectEnd:(...R)=>{var H,O;return(O=(H=g.getState()).onConnectEnd)==null?void 0:O.call(H,...R)},onReconnectEnd:C,updateConnection:b,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},y=w=>x(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=w=>x(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),_=()=>h(!0),p=()=>h(!1);return T.jsxs(T.Fragment,{children:[(t===!0||t==="source")&&T.jsx(Do,{position:a,centerX:o,centerY:r,radius:e,onMouseDown:y,onMouseEnter:_,onMouseOut:p,type:"source"}),(t===!0||t==="target")&&T.jsx(Do,{position:c,centerX:i,centerY:s,radius:e,onMouseDown:m,onMouseEnter:_,onMouseOut:p,type:"target"})]})}function sf({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:l,reconnectRadius:f,onReconnect:u,onReconnectStart:d,onReconnectEnd:h,rfId:g,edgeTypes:x,noPanClassName:y,onError:m,disableKeyboardA11y:_}){let p=J(Z=>Z.edgeLookup.get(t));const w=J(Z=>Z.defaultEdgeOptions);p=w?{...w,...p}:p;let S=p.type||"default",N=(x==null?void 0:x[S])||$o[S];N===void 0&&(m==null||m("011",ht.error011(S)),S="default",N=(x==null?void 0:x.default)||$o.default);const A=!!(p.focusable||e&&typeof p.focusable>"u"),$=typeof u<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),P=!!(p.selectable||o&&typeof p.selectable>"u"),B=D.useRef(null),[M,z]=D.useState(!1),[V,v]=D.useState(!1),I=rt(),{zIndex:b,sourceX:k,sourceY:C,targetX:E,targetY:L,sourcePosition:R,targetPosition:H}=J(D.useCallback(Z=>{const q=Z.nodeLookup.get(p.source),et=Z.nodeLookup.get(p.target);if(!q||!et)return{zIndex:p.zIndex,...To};const nt=ou({id:t,sourceNode:q,targetNode:et,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:Z.connectionMode,onError:m});return{zIndex:Kl({selected:p.selected,zIndex:p.zIndex,sourceNode:q,targetNode:et,elevateOnSelect:Z.elevateEdgesOnSelect,zIndexMode:Z.zIndexMode}),...nt||To}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),ot),O=D.useMemo(()=>p.markerStart?`url('#${fn(p.markerStart,g)}')`:void 0,[p.markerStart,g]),X=D.useMemo(()=>p.markerEnd?`url('#${fn(p.markerEnd,g)}')`:void 0,[p.markerEnd,g]);if(p.hidden||k===null||C===null||E===null||L===null)return null;const j=Z=>{var tt;const{addSelectedEdges:q,unselectNodesAndEdges:et,multiSelectionActive:nt}=I.getState();P&&(I.setState({nodesSelectionActive:!1}),p.selected&&nt?(et({nodes:[],edges:[p]}),(tt=B.current)==null||tt.blur()):q([t])),r&&r(Z,p)},K=i?Z=>{i(Z,{...p})}:void 0,G=s?Z=>{s(Z,{...p})}:void 0,F=a?Z=>{a(Z,{...p})}:void 0,W=c?Z=>{c(Z,{...p})}:void 0,Q=l?Z=>{l(Z,{...p})}:void 0,U=Z=>{var q;if(!_&&ur.includes(Z.key)&&P){const{unselectNodesAndEdges:et,addSelectedEdges:nt}=I.getState();Z.key==="Escape"?((q=B.current)==null||q.blur(),et({edges:[p]})):nt([t])}};return T.jsx("svg",{style:{zIndex:b},children:T.jsxs("g",{className:it(["react-flow__edge",`react-flow__edge-${S}`,p.className,y,{selected:p.selected,animated:p.animated,inactive:!P&&!r,updating:M,selectable:P}]),onClick:j,onDoubleClick:K,onContextMenu:G,onMouseEnter:F,onMouseMove:W,onMouseLeave:Q,onKeyDown:A?U:void 0,tabIndex:A?0:void 0,role:p.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":A?`${Or}-${g}`:void 0,ref:B,...p.domAttributes,children:[!V&&T.jsx(N,{id:t,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:P,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:k,sourceY:C,targetX:E,targetY:L,sourcePosition:R,targetPosition:H,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:O,markerEnd:X,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),$&&T.jsx(rf,{edge:p,isReconnectable:$,reconnectRadius:f,onReconnect:u,onReconnectStart:d,onReconnectEnd:h,sourceX:k,sourceY:C,targetX:E,targetY:L,sourcePosition:R,targetPosition:H,setUpdateHover:z,setReconnecting:v})]})})}var af=D.memo(sf);const cf=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function gi({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:f,reconnectRadius:u,onEdgeDoubleClick:d,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:x}){const{edgesFocusable:y,edgesReconnectable:m,elementsSelectable:_,onError:p}=J(cf,ot),w=jd(e);return T.jsxs("div",{className:"react-flow__edges",children:[T.jsx(Zd,{defaultColor:t,rfId:n}),w.map(S=>T.jsx(af,{id:S,edgesFocusable:y,edgesReconnectable:m,elementsSelectable:_,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:l,onClick:f,reconnectRadius:u,onDoubleClick:d,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:p,edgeTypes:o,disableKeyboardA11y:x},S))]})}gi.displayName="EdgeRenderer";const lf=D.memo(gi),uf=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function df({children:t}){const e=J(uf);return T.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:t})}function ff(t){const e=Pn(),n=D.useRef(!1);D.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const hf=t=>{var e;return(e=t.panZoom)==null?void 0:e.syncViewport};function gf(t){const e=J(hf),n=rt();return D.useEffect(()=>{t&&(e==null||e(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function pf(t){return t.connection.inProgress?{...t.connection,to:ue(t.connection.to,t.transform)}:{...t.connection}}function mf(t){return pf}function yf(t){const e=mf();return J(e,ot)}const xf=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function wf({containerStyle:t,style:e,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:c}=J(xf,ot);return!(i&&r&&c)?null:T.jsx("svg",{style:t,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:T.jsx("g",{className:it(["react-flow__connection",hr(a)]),children:T.jsx(pi,{style:e,type:n,CustomComponent:o,isValid:a})})})}const pi=({style:t,type:e=Et.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:c,to:l,toNode:f,toHandle:u,toPosition:d,pointer:h}=yf();if(!r)return;if(n)return T.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:d,connectionStatus:hr(o),toNode:f,toHandle:u,pointer:h});let g="";const x={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:d};switch(e){case Et.Bezier:[g]=Nr(x);break;case Et.SimpleBezier:[g]=ni(x);break;case Et.Step:[g]=dn({...x,borderRadius:0});break;case Et.SmoothStep:[g]=dn(x);break;default:[g]=Mr(x)}return T.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:t})};pi.displayName="ConnectionLine";const vf={};function Lo(t=vf){D.useRef(t),rt(),D.useEffect(()=>{},[t])}function _f(){rt(),D.useRef(!1),D.useEffect(()=>{},[])}function mi({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:f,onSelectionContextMenu:u,onSelectionStart:d,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:x,connectionLineComponent:y,connectionLineContainerStyle:m,selectionKeyCode:_,selectionOnDrag:p,selectionMode:w,multiSelectionKeyCode:S,panActivationKeyCode:N,zoomActivationKeyCode:A,deleteKeyCode:$,onlyRenderVisibleElements:P,elementsSelectable:B,defaultViewport:M,translateExtent:z,minZoom:V,maxZoom:v,preventScrolling:I,defaultMarkerColor:b,zoomOnScroll:k,zoomOnPinch:C,panOnScroll:E,panOnScrollSpeed:L,panOnScrollMode:R,zoomOnDoubleClick:H,panOnDrag:O,onPaneClick:X,onPaneMouseEnter:j,onPaneMouseMove:K,onPaneMouseLeave:G,onPaneScroll:F,onPaneContextMenu:W,paneClickDistance:Q,nodeClickDistance:U,onEdgeContextMenu:Z,onEdgeMouseEnter:q,onEdgeMouseMove:et,onEdgeMouseLeave:nt,reconnectRadius:tt,onReconnect:st,onReconnectStart:vt,onReconnectEnd:pt,noDragClassName:Nt,noWheelClassName:Yt,noPanClassName:jt,disableKeyboardA11y:Wt,nodeExtent:We,rfId:de,viewport:$t,onViewportChange:Gt}){return Lo(t),Lo(e),_f(),ff(n),gf($t),T.jsx(Dd,{onPaneClick:X,onPaneMouseEnter:j,onPaneMouseMove:K,onPaneMouseLeave:G,onPaneContextMenu:W,onPaneScroll:F,paneClickDistance:Q,deleteKeyCode:$,selectionKeyCode:_,selectionOnDrag:p,selectionMode:w,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:S,panActivationKeyCode:N,zoomActivationKeyCode:A,elementsSelectable:B,zoomOnScroll:k,zoomOnPinch:C,zoomOnDoubleClick:H,panOnScroll:E,panOnScrollSpeed:L,panOnScrollMode:R,panOnDrag:O,defaultViewport:M,translateExtent:z,minZoom:V,maxZoom:v,onSelectionContextMenu:u,preventScrolling:I,noDragClassName:Nt,noWheelClassName:Yt,noPanClassName:jt,disableKeyboardA11y:Wt,onViewportChange:Gt,isControlledViewport:!!$t,children:T.jsxs(df,{children:[T.jsx(lf,{edgeTypes:e,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:st,onReconnectStart:vt,onReconnectEnd:pt,onlyRenderVisibleElements:P,onEdgeContextMenu:Z,onEdgeMouseEnter:q,onEdgeMouseMove:et,onEdgeMouseLeave:nt,reconnectRadius:tt,defaultMarkerColor:b,noPanClassName:jt,disableKeyboardA11y:Wt,rfId:de}),T.jsx(wf,{style:x,type:g,component:y,containerStyle:m}),T.jsx("div",{className:"react-flow__edgelabel-renderer"}),T.jsx(Yd,{nodeTypes:t,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:f,nodeClickDistance:U,onlyRenderVisibleElements:P,noPanClassName:jt,noDragClassName:Nt,disableKeyboardA11y:Wt,nodeExtent:We,rfId:de}),T.jsx("div",{className:"react-flow__viewport-portal"})]})})}mi.displayName="GraphView";const bf=D.memo(mi),Ho=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c=.5,maxZoom:l=2,nodeOrigin:f,nodeExtent:u,zIndexMode:d="basic"}={})=>{const h=new Map,g=new Map,x=new Map,y=new Map,m=o??e??[],_=n??t??[],p=f??[0,0],w=u??ee;kr(x,y,m);const{nodesInitialized:S}=hn(_,h,g,{nodeOrigin:p,nodeExtent:w,zIndexMode:d});let N=[0,0,1];if(s&&r&&i){const A=ce(h,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:$,y:P,zoom:B}=Sn(A,r,i,c,l,(a==null?void 0:a.padding)??.1);N=[$,P,B]}return{rfId:"1",width:r??0,height:i??0,transform:N,nodes:_,nodesInitialized:S,nodeLookup:h,parentLookup:g,edges:m,edgeLookup:y,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:ee,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Vt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:p,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:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...fr},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Xl,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:dr,zIndexMode:d,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Ef=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c,maxZoom:l,nodeOrigin:f,nodeExtent:u,zIndexMode:d})=>Fu((h,g)=>{async function x(){const{nodeLookup:y,panZoom:m,fitViewOptions:_,fitViewResolver:p,width:w,height:S,minZoom:N,maxZoom:A}=g();m&&(await Fl({nodes:y,width:w,height:S,panZoom:m,minZoom:N,maxZoom:A},_),p==null||p.resolve(!0),h({fitViewResolver:null}))}return{...Ho({nodes:t,edges:e,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c,maxZoom:l,nodeOrigin:f,nodeExtent:u,defaultNodes:n,defaultEdges:o,zIndexMode:d}),setNodes:y=>{const{nodeLookup:m,parentLookup:_,nodeOrigin:p,elevateNodesOnSelect:w,fitViewQueued:S,zIndexMode:N,nodesSelectionActive:A}=g(),{nodesInitialized:$,hasSelectedNodes:P}=hn(y,m,_,{nodeOrigin:p,nodeExtent:u,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:N}),B=A&&P;S&&$?(x(),h({nodes:y,nodesInitialized:$,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):h({nodes:y,nodesInitialized:$,nodesSelectionActive:B})},setEdges:y=>{const{connectionLookup:m,edgeLookup:_}=g();kr(m,_,y),h({edges:y})},setDefaultNodesAndEdges:(y,m)=>{if(y){const{setNodes:_}=g();_(y),h({hasDefaultNodes:!0})}if(m){const{setEdges:_}=g();_(m),h({hasDefaultEdges:!0})}},updateNodeInternals:y=>{const{triggerNodeChanges:m,nodeLookup:_,parentLookup:p,domNode:w,nodeOrigin:S,nodeExtent:N,debug:A,fitViewQueued:$,zIndexMode:P}=g(),{changes:B,updatedInternals:M}=du(y,_,p,w,S,N,P);M&&(au(_,p,{nodeOrigin:S,nodeExtent:N,zIndexMode:P}),$?(x(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),(B==null?void 0:B.length)>0&&(A&&console.log("React Flow: trigger node changes",B),m==null||m(B)))},updateNodePositions:(y,m=!1)=>{const _=[];let p=[];const{nodeLookup:w,triggerNodeChanges:S,connection:N,updateConnection:A,onNodesChangeMiddlewareMap:$}=g();for(const[P,B]of y){const M=w.get(P),z=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(B!=null&&B.position)),V={id:P,type:"position",position:z?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:m};if(M&&N.inProgress&&N.fromNode.id===M.id){const v=Pt(M,N.fromHandle,Y.Left,!0);A({...N,from:v})}z&&M.parentId&&_.push({id:P,parentId:M.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),p.push(V)}if(_.length>0){const{parentLookup:P,nodeOrigin:B}=g(),M=kn(_,w,P,B);p.push(...M)}for(const P of $.values())p=P(p);S(p)},triggerNodeChanges:y=>{const{onNodesChange:m,setNodes:_,nodes:p,hasDefaultNodes:w,debug:S}=g();if(y!=null&&y.length){if(w){const N=jr(y,p);_(N)}S&&console.log("React Flow: trigger node changes",y),m==null||m(y)}},triggerEdgeChanges:y=>{const{onEdgesChange:m,setEdges:_,edges:p,hasDefaultEdges:w,debug:S}=g();if(y!=null&&y.length){if(w){const N=Wr(y,p);_(N)}S&&console.log("React Flow: trigger edge changes",y),m==null||m(y)}},addSelectedNodes:y=>{const{multiSelectionActive:m,edgeLookup:_,nodeLookup:p,triggerNodeChanges:w,triggerEdgeChanges:S}=g();if(m){const N=y.map(A=>Mt(A,!0));w(N);return}w(Dt(p,new Set([...y]),!0)),S(Dt(_))},addSelectedEdges:y=>{const{multiSelectionActive:m,edgeLookup:_,nodeLookup:p,triggerNodeChanges:w,triggerEdgeChanges:S}=g();if(m){const N=y.map(A=>Mt(A,!0));S(N);return}S(Dt(_,new Set([...y]))),w(Dt(p,new Set,!0))},unselectNodesAndEdges:({nodes:y,edges:m}={})=>{const{edges:_,nodes:p,nodeLookup:w,triggerNodeChanges:S,triggerEdgeChanges:N}=g(),A=y||p,$=m||_,P=[];for(const M of A){if(!M.selected)continue;const z=w.get(M.id);z&&(z.selected=!1),P.push(Mt(M.id,!1))}const B=[];for(const M of $)M.selected&&B.push(Mt(M.id,!1));S(P),N(B)},setMinZoom:y=>{const{panZoom:m,maxZoom:_}=g();m==null||m.setScaleExtent([y,_]),h({minZoom:y})},setMaxZoom:y=>{const{panZoom:m,minZoom:_}=g();m==null||m.setScaleExtent([_,y]),h({maxZoom:y})},setTranslateExtent:y=>{var m;(m=g().panZoom)==null||m.setTranslateExtent(y),h({translateExtent:y})},resetSelectedElements:()=>{const{edges:y,nodes:m,triggerNodeChanges:_,triggerEdgeChanges:p,elementsSelectable:w}=g();if(!w)return;const S=m.reduce((A,$)=>$.selected?[...A,Mt($.id,!1)]:A,[]),N=y.reduce((A,$)=>$.selected?[...A,Mt($.id,!1)]:A,[]);_(S),p(N)},setNodeExtent:y=>{const{nodes:m,nodeLookup:_,parentLookup:p,nodeOrigin:w,elevateNodesOnSelect:S,nodeExtent:N,zIndexMode:A}=g();y[0][0]===N[0][0]&&y[0][1]===N[0][1]&&y[1][0]===N[1][0]&&y[1][1]===N[1][1]||(hn(m,_,p,{nodeOrigin:w,nodeExtent:y,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:A}),h({nodeExtent:y}))},panBy:y=>{const{transform:m,width:_,height:p,panZoom:w,translateExtent:S}=g();return fu({delta:y,panZoom:w,transform:m,translateExtent:S,width:_,height:p})},setCenter:async(y,m,_)=>{const{width:p,height:w,maxZoom:S,panZoom:N}=g();if(!N)return Promise.resolve(!1);const A=typeof(_==null?void 0:_.zoom)<"u"?_.zoom:S;return await N.setViewport({x:p/2-y*A,y:w/2-m*A,zoom:A},{duration:_==null?void 0:_.duration,ease:_==null?void 0:_.ease,interpolate:_==null?void 0:_.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{h({connection:{...fr}})},updateConnection:y=>{h({connection:y})},reset:()=>h({...Ho()})}},Object.is);function Sf({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:c,fitView:l,nodeOrigin:f,nodeExtent:u,zIndexMode:d,children:h}){const[g]=D.useState(()=>Ef({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:l,minZoom:s,maxZoom:a,fitViewOptions:c,nodeOrigin:f,nodeExtent:u,zIndexMode:d}));return T.jsx(Ou,{value:g,children:T.jsx(ud,{children:h})})}function Nf({children:t,nodes:e,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:c,minZoom:l,maxZoom:f,nodeOrigin:u,nodeExtent:d,zIndexMode:h}){return D.useContext(Oe)?T.jsx(T.Fragment,{children:t}):T.jsx(Sf,{initialNodes:e,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:f,nodeOrigin:u,nodeExtent:d,zIndexMode:h,children:t})}const Cf={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Mf({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:c,onInit:l,onMove:f,onMoveStart:u,onMoveEnd:d,onConnect:h,onConnectStart:g,onConnectEnd:x,onClickConnectStart:y,onClickConnectEnd:m,onNodeMouseEnter:_,onNodeMouseMove:p,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:N,onNodeDragStart:A,onNodeDrag:$,onNodeDragStop:P,onNodesDelete:B,onEdgesDelete:M,onDelete:z,onSelectionChange:V,onSelectionDragStart:v,onSelectionDrag:I,onSelectionDragStop:b,onSelectionContextMenu:k,onSelectionStart:C,onSelectionEnd:E,onBeforeDelete:L,connectionMode:R,connectionLineType:H=Et.Bezier,connectionLineStyle:O,connectionLineComponent:X,connectionLineContainerStyle:j,deleteKeyCode:K="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:F=!1,selectionMode:W=ne.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:U=re()?"Meta":"Control",zoomActivationKeyCode:Z=re()?"Meta":"Control",snapToGrid:q,snapGrid:et,onlyRenderVisibleElements:nt=!1,selectNodesOnDrag:tt,nodesDraggable:st,autoPanOnNodeFocus:vt,nodesConnectable:pt,nodesFocusable:Nt,nodeOrigin:Yt=Xr,edgesFocusable:jt,edgesReconnectable:Wt,elementsSelectable:We=!0,defaultViewport:de=ed,minZoom:$t=.5,maxZoom:Gt=2,translateExtent:Tn=ee,preventScrolling:vi=!0,nodeExtent:Ge,defaultMarkerColor:_i="#b1b1b7",zoomOnScroll:bi=!0,zoomOnPinch:Ei=!0,panOnScroll:Si=!1,panOnScrollSpeed:Ni=.5,panOnScrollMode:Ci=It.Free,zoomOnDoubleClick:Mi=!0,panOnDrag:Ii=!0,onPaneClick:Ai,onPaneMouseEnter:ki,onPaneMouseMove:Pi,onPaneMouseLeave:$i,onPaneScroll:Ti,onPaneContextMenu:zi,paneClickDistance:Di=1,nodeClickDistance:Li=0,children:Hi,onReconnect:Ri,onReconnectStart:Vi,onReconnectEnd:Bi,onEdgeContextMenu:Fi,onEdgeDoubleClick:Oi,onEdgeMouseEnter:Xi,onEdgeMouseMove:Yi,onEdgeMouseLeave:ji,reconnectRadius:Wi=10,onNodesChange:Gi,onEdgesChange:qi,noDragClassName:Ki="nodrag",noWheelClassName:Zi="nowheel",noPanClassName:zn="nopan",fitView:Dn,fitViewOptions:Ln,connectOnClick:Ui,attributionPosition:Qi,proOptions:Ji,defaultEdgeOptions:ts,elevateNodesOnSelect:es=!0,elevateEdgesOnSelect:ns=!1,disableKeyboardA11y:Hn=!1,autoPanOnConnect:os,autoPanOnNodeDrag:rs,autoPanSpeed:is,connectionRadius:ss,isValidConnection:as,onError:cs,style:ls,id:Rn,nodeDragThreshold:us,connectionDragThreshold:ds,viewport:fs,onViewportChange:hs,width:gs,height:ps,colorMode:ms="light",debug:ys,onScroll:fe,ariaLabelConfig:xs,zIndexMode:Vn="basic",...ws},vs){const qe=Rn||"1",_s=id(ms),bs=D.useCallback(Bn=>{Bn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),fe==null||fe(Bn)},[fe]);return T.jsx("div",{"data-testid":"rf__wrapper",...ws,onScroll:bs,style:{...ls,...Cf},ref:vs,className:it(["react-flow",r,_s]),id:Rn,role:"application",children:T.jsxs(Nf,{nodes:t,edges:e,width:gs,height:ps,fitView:Dn,fitViewOptions:Ln,minZoom:$t,maxZoom:Gt,nodeOrigin:Yt,nodeExtent:Ge,zIndexMode:Vn,children:[T.jsx(rd,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:h,onConnectStart:g,onConnectEnd:x,onClickConnectStart:y,onClickConnectEnd:m,nodesDraggable:st,autoPanOnNodeFocus:vt,nodesConnectable:pt,nodesFocusable:Nt,edgesFocusable:jt,edgesReconnectable:Wt,elementsSelectable:We,elevateNodesOnSelect:es,elevateEdgesOnSelect:ns,minZoom:$t,maxZoom:Gt,nodeExtent:Ge,onNodesChange:Gi,onEdgesChange:qi,snapToGrid:q,snapGrid:et,connectionMode:R,translateExtent:Tn,connectOnClick:Ui,defaultEdgeOptions:ts,fitView:Dn,fitViewOptions:Ln,onNodesDelete:B,onEdgesDelete:M,onDelete:z,onNodeDragStart:A,onNodeDrag:$,onNodeDragStop:P,onSelectionDrag:I,onSelectionDragStart:v,onSelectionDragStop:b,onMove:f,onMoveStart:u,onMoveEnd:d,noPanClassName:zn,nodeOrigin:Yt,rfId:qe,autoPanOnConnect:os,autoPanOnNodeDrag:rs,autoPanSpeed:is,onError:cs,connectionRadius:ss,isValidConnection:as,selectNodesOnDrag:tt,nodeDragThreshold:us,connectionDragThreshold:ds,onBeforeDelete:L,debug:ys,ariaLabelConfig:xs,zIndexMode:Vn}),T.jsx(bf,{onInit:l,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:_,onNodeMouseMove:p,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:s,connectionLineType:H,connectionLineStyle:O,connectionLineComponent:X,connectionLineContainerStyle:j,selectionKeyCode:G,selectionOnDrag:F,selectionMode:W,deleteKeyCode:K,multiSelectionKeyCode:U,panActivationKeyCode:Q,zoomActivationKeyCode:Z,onlyRenderVisibleElements:nt,defaultViewport:de,translateExtent:Tn,minZoom:$t,maxZoom:Gt,preventScrolling:vi,zoomOnScroll:bi,zoomOnPinch:Ei,zoomOnDoubleClick:Mi,panOnScroll:Si,panOnScrollSpeed:Ni,panOnScrollMode:Ci,panOnDrag:Ii,onPaneClick:Ai,onPaneMouseEnter:ki,onPaneMouseMove:Pi,onPaneMouseLeave:$i,onPaneScroll:Ti,onPaneContextMenu:zi,paneClickDistance:Di,nodeClickDistance:Li,onSelectionContextMenu:k,onSelectionStart:C,onSelectionEnd:E,onReconnect:Ri,onReconnectStart:Vi,onReconnectEnd:Bi,onEdgeContextMenu:Fi,onEdgeDoubleClick:Oi,onEdgeMouseEnter:Xi,onEdgeMouseMove:Yi,onEdgeMouseLeave:ji,reconnectRadius:Wi,defaultMarkerColor:_i,noDragClassName:Ki,noWheelClassName:Zi,noPanClassName:zn,rfId:qe,disableKeyboardA11y:Hn,nodeExtent:Ge,viewport:fs,onViewportChange:hs}),T.jsx(td,{onSelectionChange:V}),Hi,T.jsx(Ku,{proOptions:Ji,position:Qi}),T.jsx(qu,{rfId:qe,disableKeyboardA11y:Hn})]})})}var nh=Gr(Mf);function oh(t){const[e,n]=D.useState(t),o=D.useCallback(r=>n(i=>jr(r,i)),[]);return[e,n,o]}function rh(t){const[e,n]=D.useState(t),o=D.useCallback(r=>n(i=>Wr(r,i)),[]);return[e,n,o]}function If({dimensions:t,lineWidth:e,variant:n,className:o}){return T.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:it(["react-flow__background-pattern",n,o])})}function Af({radius:t,className:e}){return T.jsx("circle",{cx:t,cy:t,r:t,className:it(["react-flow__background-pattern","dots",e])})}var St;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(St||(St={}));const kf={[St.Dots]:1,[St.Lines]:1,[St.Cross]:6},Pf=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function yi({id:t,variant:e=St.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:c,className:l,patternClassName:f}){const u=D.useRef(null),{transform:d,patternId:h}=J(Pf,ot),g=o||kf[e],x=e===St.Dots,y=e===St.Cross,m=Array.isArray(n)?n:[n,n],_=[m[0]*d[2]||1,m[1]*d[2]||1],p=g*d[2],w=Array.isArray(i)?i:[i,i],S=y?[p,p]:_,N=[w[0]*d[2]||1+S[0]/2,w[1]*d[2]||1+S[1]/2],A=`${h}${t||""}`;return T.jsxs("svg",{className:it(["react-flow__background",l]),style:{...c,...Ye,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:u,"data-testid":"rf__background",children:[T.jsx("pattern",{id:A,x:d[0]%_[0],y:d[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:x?T.jsx(Af,{radius:p/2,className:f}):T.jsx(If,{dimensions:S,lineWidth:r,variant:e,className:f})}),T.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}yi.displayName="Background";const ih=D.memo(yi);function $f(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:T.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Tf(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:T.jsx("path",{d:"M0 0h32v4.2H0z"})})}function zf(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children: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"})})}function Df(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children: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"})})}function Lf(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children: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"})})}function we({children:t,className:e,...n}){return T.jsx("button",{type:"button",className:it(["react-flow__controls-button",e]),...n,children:t})}const Hf=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function xi({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:c,className:l,children:f,position:u="bottom-left",orientation:d="vertical","aria-label":h}){const g=rt(),{isInteractive:x,minZoomReached:y,maxZoomReached:m,ariaLabelConfig:_}=J(Hf,ot),{zoomIn:p,zoomOut:w,fitView:S}=Pn(),N=()=>{p(),i==null||i()},A=()=>{w(),s==null||s()},$=()=>{S(r),a==null||a()},P=()=>{g.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),c==null||c(!x)},B=d==="horizontal"?"horizontal":"vertical";return T.jsxs(Xe,{className:it(["react-flow__controls",B,l]),position:u,style:t,"data-testid":"rf__controls","aria-label":h??_["controls.ariaLabel"],children:[e&&T.jsxs(T.Fragment,{children:[T.jsx(we,{onClick:N,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:m,children:T.jsx($f,{})}),T.jsx(we,{onClick:A,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:y,children:T.jsx(Tf,{})})]}),n&&T.jsx(we,{className:"react-flow__controls-fitview",onClick:$,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:T.jsx(zf,{})}),o&&T.jsx(we,{className:"react-flow__controls-interactive",onClick:P,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:x?T.jsx(Lf,{}):T.jsx(Df,{})}),f]})}xi.displayName="Controls";const sh=D.memo(xi);function Rf({id:t,x:e,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:c,className:l,borderRadius:f,shapeRendering:u,selected:d,onClick:h}){const{background:g,backgroundColor:x}=i||{},y=s||g||x;return T.jsx("rect",{className:it(["react-flow__minimap-node",{selected:d},l]),x:e,y:n,rx:f,ry:f,width:o,height:r,style:{fill:y,stroke:a,strokeWidth:c},shapeRendering:u,onClick:h?m=>h(m,t):void 0})}const Vf=D.memo(Rf),Bf=t=>t.nodes.map(e=>e.id),nn=t=>t instanceof Function?t:()=>t;function Ff({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=Vf,onClick:s}){const a=J(Bf,ot),c=nn(e),l=nn(t),f=nn(n),u=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return T.jsx(T.Fragment,{children:a.map(d=>T.jsx(Xf,{id:d,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:f,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:u},d))})}function Of({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:c}){const{node:l,x:f,y:u,width:d,height:h}=J(g=>{const x=g.nodeLookup.get(t);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const y=x.internals.userNode,{x:m,y:_}=x.internals.positionAbsolute,{width:p,height:w}=wt(y);return{node:y,x:m,y:_,width:p,height:w}},ot);return!l||l.hidden||!wr(l)?null:T.jsx(a,{x:f,y:u,width:d,height:h,style:l.style,selected:!!l.selected,className:o(l),color:e(l),borderRadius:r,strokeColor:n(l),strokeWidth:i,shapeRendering:s,onClick:c,id:l.id})}const Xf=D.memo(Of);var Yf=D.memo(Ff);const jf=200,Wf=150,Gf=t=>!t.hidden,qf=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?xr(ce(t.nodeLookup,{filter:Gf}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},Kf="react-flow__minimap-desc";function wi({style:t,className:e,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:c,maskColor:l,maskStrokeColor:f,maskStrokeWidth:u,position:d="bottom-right",onClick:h,onNodeClick:g,pannable:x=!1,zoomable:y=!1,ariaLabel:m,inversePan:_,zoomStep:p=1,offsetScale:w=5}){const S=rt(),N=D.useRef(null),{boundingRect:A,viewBB:$,rfId:P,panZoom:B,translateExtent:M,flowWidth:z,flowHeight:V,ariaLabelConfig:v}=J(qf,ot),I=(t==null?void 0:t.width)??jf,b=(t==null?void 0:t.height)??Wf,k=A.width/I,C=A.height/b,E=Math.max(k,C),L=E*I,R=E*b,H=w*E,O=A.x-(L-A.width)/2-H,X=A.y-(R-A.height)/2-H,j=L+H*2,K=R+H*2,G=`${Kf}-${P}`,F=D.useRef(0),W=D.useRef();F.current=E,D.useEffect(()=>{if(N.current&&B)return W.current=_u({domNode:N.current,panZoom:B,getTransform:()=>S.getState().transform,getViewScale:()=>F.current}),()=>{var q;(q=W.current)==null||q.destroy()}},[B]),D.useEffect(()=>{var q;(q=W.current)==null||q.update({translateExtent:M,width:z,height:V,inversePan:_,pannable:x,zoomStep:p,zoomable:y})},[x,y,_,p,M,z,V]);const Q=h?q=>{var tt;const[et,nt]=((tt=W.current)==null?void 0:tt.pointer(q))||[0,0];h(q,{x:et,y:nt})}:void 0,U=g?D.useCallback((q,et)=>{const nt=S.getState().nodeLookup.get(et).internals.userNode;g(q,nt)},[]):void 0,Z=m??v["minimap.ariaLabel"];return T.jsx(Xe,{position:d,style:{...t,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof u=="number"?u*E:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:it(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:T.jsxs("svg",{width:I,height:b,viewBox:`${O} ${X} ${j} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":G,ref:N,onClick:Q,children:[Z&&T.jsx("title",{id:G,children:Z}),T.jsx(Yf,{onClick:U,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),T.jsx("path",{className:"react-flow__minimap-mask",d:`M${O-H},${X-H}h${j+H*2}v${K+H*2}h${-j-H*2}z
7
+ M${$.x},${$.y}h${$.width}v${$.height}h${-$.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}wi.displayName="MiniMap";const ah=D.memo(wi),Zf=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,Uf={[Xt.Line]:"right",[Xt.Handle]:"bottom-right"};function Qf({nodeId:t,position:e,variant:n=Xt.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:u=!1,resizeDirection:d,autoScale:h=!0,shouldResize:g,onResizeStart:x,onResize:y,onResizeEnd:m}){const _=Ur(),p=typeof t=="string"?t:_,w=rt(),S=D.useRef(null),N=n===Xt.Handle,A=J(D.useCallback(Zf(N&&h),[N,h]),ot),$=D.useRef(null),P=e??Uf[n];D.useEffect(()=>{if(!(!S.current||!p))return $.current||($.current=Du({domNode:S.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:M,transform:z,snapGrid:V,snapToGrid:v,nodeOrigin:I,domNode:b}=w.getState();return{nodeLookup:M,transform:z,snapGrid:V,snapToGrid:v,nodeOrigin:I,paneDomNode:b}},onChange:(M,z)=>{const{triggerNodeChanges:V,nodeLookup:v,parentLookup:I,nodeOrigin:b}=w.getState(),k=[],C={x:M.x,y:M.y},E=v.get(p);if(E&&E.expandParent&&E.parentId){const L=E.origin??b,R=M.width??E.measured.width??0,H=M.height??E.measured.height??0,O={id:E.id,parentId:E.parentId,rect:{width:R,height:H,...vr({x:M.x??E.position.x,y:M.y??E.position.y},{width:R,height:H},E.parentId,v,L)}},X=kn([O],v,I,b);k.push(...X),C.x=M.x?Math.max(L[0]*R,M.x):void 0,C.y=M.y?Math.max(L[1]*H,M.y):void 0}if(C.x!==void 0&&C.y!==void 0){const L={id:p,type:"position",position:{...C}};k.push(L)}if(M.width!==void 0&&M.height!==void 0){const R={id:p,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};k.push(R)}for(const L of z){const R={...L,type:"position"};k.push(R)}V(k)},onEnd:({width:M,height:z})=>{const V={id:p,type:"dimensions",resizing:!1,dimensions:{width:M,height:z}};w.getState().triggerNodeChanges([V])}})),$.current.update({controlPosition:P,boundaries:{minWidth:a,minHeight:c,maxWidth:l,maxHeight:f},keepAspectRatio:u,resizeDirection:d,onResizeStart:x,onResize:y,onResizeEnd:m,shouldResize:g}),()=>{var M;(M=$.current)==null||M.destroy()}},[P,a,c,l,f,u,x,y,m,g]);const B=P.split("-");return T.jsx("div",{className:it(["react-flow__resize-control","nodrag",...B,n,o]),ref:S,style:{...r,scale:A,...s&&{[N?"backgroundColor":"borderColor"]:s}},children:i})}D.memo(Qf);export{ih as B,sh as C,$e as H,Ae as M,Y as P,rh as a,St as b,ah as c,nh as i,oh as u};
@@ -0,0 +1 @@
1
+ function A(e,r,n){e.prototype=r.prototype=n,n.constructor=e}function G(e,r){var n=Object.create(e.prototype);for(var t in r)n[t]=r[t];return n}function y(){}var b=.7,N=1/b,g="\\s*([+-]?\\d+)\\s*",p="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",J=/^#([0-9a-f]{3,8})$/,K=new RegExp(`^rgb\\(${g},${g},${g}\\)$`),Q=new RegExp(`^rgb\\(${c},${c},${c}\\)$`),U=new RegExp(`^rgba\\(${g},${g},${g},${p}\\)$`),W=new RegExp(`^rgba\\(${c},${c},${c},${p}\\)$`),X=new RegExp(`^hsl\\(${p},${c},${c}\\)$`),Y=new RegExp(`^hsla\\(${p},${c},${c},${p}\\)$`),_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};A(y,m,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:P,formatHex:P,formatHex8:Z,formatHsl:ee,formatRgb:S,toString:S});function P(){return this.rgb().formatHex()}function Z(){return this.rgb().formatHex8()}function ee(){return L(this).formatHsl()}function S(){return this.rgb().formatRgb()}function m(e){var r,n;return e=(e+"").trim().toLowerCase(),(r=J.exec(e))?(n=r[1].length,r=parseInt(r[1],16),n===6?C(r):n===3?new o(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):n===8?w(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):n===4?w(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=K.exec(e))?new o(r[1],r[2],r[3],1):(r=Q.exec(e))?new o(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=U.exec(e))?w(r[1],r[2],r[3],r[4]):(r=W.exec(e))?w(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=X.exec(e))?z(r[1],r[2]/100,r[3]/100,1):(r=Y.exec(e))?z(r[1],r[2]/100,r[3]/100,r[4]):_.hasOwnProperty(e)?C(_[e]):e==="transparent"?new o(NaN,NaN,NaN,0):null}function C(e){return new o(e>>16&255,e>>8&255,e&255,1)}function w(e,r,n,t){return t<=0&&(e=r=n=NaN),new o(e,r,n,t)}function re(e){return e instanceof y||(e=m(e)),e?(e=e.rgb(),new o(e.r,e.g,e.b,e.opacity)):new o}function R(e,r,n,t){return arguments.length===1?re(e):new o(e,r,n,t??1)}function o(e,r,n,t){this.r=+e,this.g=+r,this.b=+n,this.opacity=+t}A(o,R,G(y,{brighter(e){return e=e==null?N:Math.pow(N,e),new o(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?b:Math.pow(b,e),new o(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new o(d(this.r),d(this.g),d(this.b),v(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:O,formatHex:O,formatHex8:ne,formatRgb:D,toString:D}));function O(){return`#${h(this.r)}${h(this.g)}${h(this.b)}`}function ne(){return`#${h(this.r)}${h(this.g)}${h(this.b)}${h((isNaN(this.opacity)?1:this.opacity)*255)}`}function D(){const e=v(this.opacity);return`${e===1?"rgb(":"rgba("}${d(this.r)}, ${d(this.g)}, ${d(this.b)}${e===1?")":`, ${e})`}`}function v(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function d(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function h(e){return e=d(e),(e<16?"0":"")+e.toString(16)}function z(e,r,n,t){return t<=0?e=r=n=NaN:n<=0||n>=1?e=r=NaN:r<=0&&(e=NaN),new l(e,r,n,t)}function L(e){if(e instanceof l)return new l(e.h,e.s,e.l,e.opacity);if(e instanceof y||(e=m(e)),!e)return new l;if(e instanceof l)return e;e=e.rgb();var r=e.r/255,n=e.g/255,t=e.b/255,f=Math.min(r,n,t),a=Math.max(r,n,t),i=NaN,x=a-f,s=(a+f)/2;return x?(r===a?i=(n-t)/x+(n<t)*6:n===a?i=(t-r)/x+2:i=(r-n)/x+4,x/=s<.5?a+f:2-a-f,i*=60):x=s>0&&s<1?0:i,new l(i,x,s,e.opacity)}function te(e,r,n,t){return arguments.length===1?L(e):new l(e,r,n,t??1)}function l(e,r,n,t){this.h=+e,this.s=+r,this.l=+n,this.opacity=+t}A(l,te,G(y,{brighter(e){return e=e==null?N:Math.pow(N,e),new l(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?b:Math.pow(b,e),new l(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,t=n+(n<.5?n:1-n)*r,f=2*n-t;return new o(H(e>=240?e-240:e+120,f,t),H(e,f,t),H(e<120?e+240:e-120,f,t),this.opacity)},clamp(){return new l(B(this.h),$(this.s),$(this.l),v(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=v(this.opacity);return`${e===1?"hsl(":"hsla("}${B(this.h)}, ${$(this.s)*100}%, ${$(this.l)*100}%${e===1?")":`, ${e})`}`}}));function B(e){return e=(e||0)%360,e<0?e+360:e}function $(e){return Math.max(0,Math.min(1,e||0))}function H(e,r,n){return(e<60?r+(n-r)*e/60:e<180?n:e<240?r+(n-r)*(240-e)/60:r)*255}const j=e=>()=>e;function fe(e,r){return function(n){return e+n*r}}function ie(e,r,n){return e=Math.pow(e,n),r=Math.pow(r,n)-e,n=1/n,function(t){return Math.pow(e+t*r,n)}}function ae(e){return(e=+e)==1?T:function(r,n){return n-r?ie(r,n,e):j(isNaN(r)?n:r)}}function T(e,r){var n=r-e;return n?fe(e,n):j(isNaN(e)?r:e)}const V=(function e(r){var n=ae(r);function t(f,a){var i=n((f=R(f)).r,(a=R(a)).r),x=n(f.g,a.g),s=n(f.b,a.b),k=T(f.opacity,a.opacity);return function(u){return f.r=i(u),f.g=x(u),f.b=s(u),f.opacity=k(u),f+""}}return t.gamma=e,t})(1);function xe(e,r){r||(r=[]);var n=e?Math.min(r.length,e.length):0,t=r.slice(),f;return function(a){for(f=0;f<n;++f)t[f]=e[f]*(1-a)+r[f]*a;return t}}function oe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function se(e,r){var n=r?r.length:0,t=e?Math.min(n,e.length):0,f=new Array(t),a=new Array(n),i;for(i=0;i<t;++i)f[i]=F(e[i],r[i]);for(;i<n;++i)a[i]=r[i];return function(x){for(i=0;i<t;++i)a[i]=f[i](x);return a}}function le(e,r){var n=new Date;return e=+e,r=+r,function(t){return n.setTime(e*(1-t)+r*t),n}}function q(e,r){return e=+e,r=+r,function(n){return e*(1-n)+r*n}}function ce(e,r){var n={},t={},f;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(f in r)f in e?n[f]=F(e[f],r[f]):t[f]=r[f];return function(a){for(f in n)t[f]=n[f](a);return t}}var E=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,M=new RegExp(E.source,"g");function ue(e){return function(){return e}}function he(e){return function(r){return e(r)+""}}function de(e,r){var n=E.lastIndex=M.lastIndex=0,t,f,a,i=-1,x=[],s=[];for(e=e+"",r=r+"";(t=E.exec(e))&&(f=M.exec(r));)(a=f.index)>n&&(a=r.slice(n,a),x[i]?x[i]+=a:x[++i]=a),(t=t[0])===(f=f[0])?x[i]?x[i]+=f:x[++i]=f:(x[++i]=null,s.push({i,x:q(t,f)})),n=M.lastIndex;return n<r.length&&(a=r.slice(n),x[i]?x[i]+=a:x[++i]=a),x.length<2?s[0]?he(s[0].x):ue(r):(r=s.length,function(k){for(var u=0,I;u<r;++u)x[(I=s[u]).i]=I.x(k);return x.join("")})}function F(e,r){var n=typeof r,t;return r==null||n==="boolean"?j(r):(n==="number"?q:n==="string"?(t=m(r))?(r=t,V):de:r instanceof m?V:r instanceof Date?le:oe(r)?xe:Array.isArray(r)?se:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?ce:q)(e,r)}export{q as a,V as b,m as c,de as d,F as i};
@@ -0,0 +1,17 @@
1
+ import{b as I,a as M}from"./index-DBeo9lgK.js";var w={exports:{}},R={},x={exports:{}},j={};/**
2
+ * @license React
3
+ * use-sync-external-store-shim.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var W;function U(){if(W)return j;W=1;var n=I();function S(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var m=typeof Object.is=="function"?Object.is:S,h=n.useState,p=n.useEffect,E=n.useLayoutEffect,y=n.useDebugValue;function b(e,r){var u=r(),o=h({inst:{value:u,getSnapshot:r}}),t=o[0].inst,f=o[1];return E(function(){t.value=u,t.getSnapshot=r,l(t)&&f({inst:t})},[e,u,r]),p(function(){return l(t)&&f({inst:t}),e(function(){l(t)&&f({inst:t})})},[e]),y(u),u}function l(e){var r=e.getSnapshot;e=e.value;try{var u=r();return!m(e,u)}catch{return!0}}function i(e,r){return r()}var a=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i:b;return j.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:a,j}var O;function C(){return O||(O=1,x.exports=U()),x.exports}/**
10
+ * @license React
11
+ * use-sync-external-store-shim/with-selector.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var g;function G(){if(g)return R;g=1;var n=I(),S=C();function m(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var h=typeof Object.is=="function"?Object.is:m,p=S.useSyncExternalStore,E=n.useRef,y=n.useEffect,b=n.useMemo,l=n.useDebugValue;return R.useSyncExternalStoreWithSelector=function(i,a,e,r,u){var o=E(null);if(o.current===null){var t={hasValue:!1,value:null};o.current=t}else t=o.current;o=b(function(){function V(c){if(!_){if(_=!0,v=c,c=r(c),u!==void 0&&t.hasValue){var s=t.value;if(u(s,c))return d=s}return d=c}if(s=d,h(v,c))return s;var D=r(c);return u!==void 0&&u(s,D)?(v=c,s):(v=c,d=D)}var _=!1,v,d,q=e===void 0?null:e;return[function(){return V(a())},q===null?void 0:function(){return V(q())}]},[a,e,r,u]);var f=p(i,o[0],o[1]);return y(function(){t.hasValue=!0,t.value=f},[f]),l(f),f},R}var z;function L(){return z||(z=1,w.exports=G()),w.exports}var $=L();const F=M($);export{C as r,F as u,$ as w};
@@ -16,8 +16,8 @@
16
16
  </script>
17
17
  <link rel="preconnect" href="https://fonts.googleapis.com" />
18
18
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
19
- <script type="module" crossorigin src="/assets/index-B27QeZaI.js"></script>
20
- <link rel="stylesheet" crossorigin href="/assets/index-BlJ7W4Dm.css">
19
+ <script type="module" crossorigin src="/assets/index-DBeo9lgK.js"></script>
20
+ <link rel="stylesheet" crossorigin href="/assets/index-DToMB-Fe.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>