@enruana/claude-orka 0.7.4 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ import{r as io,g as fi,R as C,a as di,b as N,c as Te,j as $,F as hi,T as gi,d as pi}from"./terminal-BTLiXhkP.js";function ae(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ae(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var mn={exports:{}},yn={},xn={exports:{}},wn={};/**
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 hr;function mi(){if(hr)return wn;hr=1;var e=io();function t(f,d){return f===d&&(f!==0||1/f===1/d)||f!==f&&d!==d}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(f,d){var g=d(),x=r({inst:{value:g,getSnapshot:d}}),p=x[0].inst,w=x[1];return i(function(){p.value=g,p.getSnapshot=d,l(p)&&w({inst:p})},[f,g,d]),o(function(){return l(p)&&w({inst:p}),f(function(){l(p)&&w({inst:p})})},[f]),s(g),g}function l(f){var d=f.getSnapshot;f=f.value;try{var g=d();return!n(f,g)}catch{return!0}}function u(f,d){return d()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return wn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:c,wn}var gr;function yi(){return gr||(gr=1,xn.exports=mi()),xn.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 pr;function xi(){if(pr)return yn;pr=1;var e=io(),t=yi();function n(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return yn.useSyncExternalStoreWithSelector=function(u,c,f,d,g){var x=i(null);if(x.current===null){var p={hasValue:!1,value:null};x.current=p}else p=x.current;x=a(function(){function m(A){if(!S){if(S=!0,E=A,A=d(A),g!==void 0&&p.hasValue){var R=p.value;if(g(R,A))return y=R}return y=A}if(R=y,r(E,A))return R;var H=d(A);return g!==void 0&&g(R,H)?(E=A,R):(E=A,y=H)}var S=!1,E,y,M=f===void 0?null:f;return[function(){return m(c())},M===null?void 0:function(){return m(M())}]},[c,f,d,g]);var w=o(u,x[0],x[1]);return s(function(){p.hasValue=!0,p.value=w},[w]),l(w),w},yn}var mr;function wi(){return mr||(mr=1,mn.exports=xi()),mn.exports}var vi=wi();const bi=fi(vi),_i={},yr=e=>{let t;const n=new Set,r=(c,f)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const g=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(x=>x(t,g))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(_i?"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()}},u=t=e(r,o,l);return l},Ei=e=>e?yr(e):yr,{useDebugValue:Si}=C,{useSyncExternalStoreWithSelector:Ni}=bi,ki=e=>e;function ao(e,t=ki,n){const r=Ni(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Si(r),r}const xr=(e,t)=>{const n=Ei(e),r=(o,i=t)=>ao(n,o,i);return Object.assign(r,n),r},Ai=(e,t)=>e?xr(e,t):xr;function ie(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var Ci={value:()=>{}};function an(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Wt(n)}function Wt(e){this._=e}function Mi(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Wt.prototype=an.prototype={constructor:Wt,on:function(e,t){var n=this._,r=Mi(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=$i(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=wr(n[o],e.name,t);else if(t==null)for(o in n)n[o]=wr(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Wt(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function $i(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function wr(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Ci,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Mn="http://www.w3.org/1999/xhtml";const vr={svg:"http://www.w3.org/2000/svg",xhtml:Mn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function cn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),vr.hasOwnProperty(t)?{space:vr[t],local:e}:e}function Ii(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Mn&&t.documentElement.namespaceURI===Mn?t.createElement(e):t.createElementNS(n,e)}}function Ti(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function co(e){var t=cn(e);return(t.local?Ti:Ii)(t)}function zi(){}function Yn(e){return e==null?zi:function(){return this.querySelector(e)}}function Pi(e){typeof e!="function"&&(e=Yn(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),l,u,c=0;c<s;++c)(l=i[c])&&(u=e.call(l,l.__data__,c,i))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new ue(r,this._parents)}function Ri(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Di(){return[]}function lo(e){return e==null?Di:function(){return this.querySelectorAll(e)}}function Hi(e){return function(){return Ri(e.apply(this,arguments))}}function Fi(e){typeof e=="function"?e=Hi(e):e=lo(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&(r.push(e.call(l,l.__data__,u,s)),o.push(l));return new ue(r,o)}function uo(e){return function(){return this.matches(e)}}function fo(e){return function(t){return t.matches(e)}}var Vi=Array.prototype.find;function Li(e){return function(){return Vi.call(this.children,e)}}function Bi(){return this.firstElementChild}function ji(e){return this.select(e==null?Bi:Li(typeof e=="function"?e:fo(e)))}var Oi=Array.prototype.filter;function Xi(){return Array.from(this.children)}function Yi(e){return function(){return Oi.call(this.children,e)}}function Ui(e){return this.selectAll(e==null?Xi:Yi(typeof e=="function"?e:fo(e)))}function qi(e){typeof e!="function"&&(e=uo(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new ue(r,this._parents)}function ho(e){return new Array(e.length)}function Wi(){return new ue(this._enter||this._groups.map(ho),this._parents)}function Qt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Qt.prototype={constructor:Qt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Gi(e){return function(){return e}}function Zi(e,t,n,r,o,i){for(var s=0,a,l=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Qt(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function Ki(e,t,n,r,o,i,s){var a,l,u=new Map,c=t.length,f=i.length,d=new Array(c),g;for(a=0;a<c;++a)(l=t[a])&&(d[a]=g=s.call(l,l.__data__,a,t)+"",u.has(g)?o[a]=l:u.set(g,l));for(a=0;a<f;++a)g=s.call(e,i[a],a,i)+"",(l=u.get(g))?(r[a]=l,l.__data__=i[a],u.delete(g)):n[a]=new Qt(e,i[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(d[a])===l&&(o[a]=l)}function Qi(e){return e.__data__}function Ji(e,t){if(!arguments.length)return Array.from(this,Qi);var n=t?Ki:Zi,r=this._parents,o=this._groups;typeof e!="function"&&(e=Gi(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),u=0;u<i;++u){var c=r[u],f=o[u],d=f.length,g=ea(e.call(c,c&&c.__data__,u,r)),x=g.length,p=a[u]=new Array(x),w=s[u]=new Array(x),m=l[u]=new Array(d);n(c,f,p,w,m,g,t);for(var S=0,E=0,y,M;S<x;++S)if(y=p[S]){for(S>=E&&(E=S+1);!(M=w[E])&&++E<x;);y._next=M||null}}return s=new ue(s,r),s._enter=a,s._exit=l,s}function ea(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ta(){return new ue(this._exit||this._groups.map(ho),this._parents)}function na(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function ra(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),l=0;l<s;++l)for(var u=n[l],c=r[l],f=u.length,d=a[l]=new Array(f),g,x=0;x<f;++x)(g=u[x]||c[x])&&(d[x]=g);for(;l<o;++l)a[l]=n[l];return new ue(a,this._parents)}function oa(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function sa(e){e||(e=ia);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,l=o[i]=new Array(a),u,c=0;c<a;++c)(u=s[c])&&(l[c]=u);l.sort(t)}return new ue(o,this._parents).order()}function ia(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function aa(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ca(){return Array.from(this)}function la(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function ua(){let e=0;for(const t of this)++e;return e}function fa(){return!this.node()}function da(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function ha(e){return function(){this.removeAttribute(e)}}function ga(e){return function(){this.removeAttributeNS(e.space,e.local)}}function pa(e,t){return function(){this.setAttribute(e,t)}}function ma(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ya(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function xa(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function wa(e,t){var n=cn(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?ga:ha:typeof t=="function"?n.local?xa:ya:n.local?ma:pa)(n,t))}function go(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function va(e){return function(){this.style.removeProperty(e)}}function ba(e,t,n){return function(){this.style.setProperty(e,t,n)}}function _a(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ea(e,t,n){return arguments.length>1?this.each((t==null?va:typeof t=="function"?_a:ba)(e,t,n??"")):ht(this.node(),e)}function ht(e,t){return e.style.getPropertyValue(t)||go(e).getComputedStyle(e,null).getPropertyValue(t)}function Sa(e){return function(){delete this[e]}}function Na(e,t){return function(){this[e]=t}}function ka(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Aa(e,t){return arguments.length>1?this.each((t==null?Sa:typeof t=="function"?ka:Na)(e,t)):this.node()[e]}function po(e){return e.trim().split(/^|\s+/)}function Un(e){return e.classList||new mo(e)}function mo(e){this._node=e,this._names=po(e.getAttribute("class")||"")}mo.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function yo(e,t){for(var n=Un(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function xo(e,t){for(var n=Un(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Ca(e){return function(){yo(this,e)}}function Ma(e){return function(){xo(this,e)}}function $a(e,t){return function(){(t.apply(this,arguments)?yo:xo)(this,e)}}function Ia(e,t){var n=po(e+"");if(arguments.length<2){for(var r=Un(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?$a:t?Ca:Ma)(n,t))}function Ta(){this.textContent=""}function za(e){return function(){this.textContent=e}}function Pa(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ra(e){return arguments.length?this.each(e==null?Ta:(typeof e=="function"?Pa:za)(e)):this.node().textContent}function Da(){this.innerHTML=""}function Ha(e){return function(){this.innerHTML=e}}function Fa(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Va(e){return arguments.length?this.each(e==null?Da:(typeof e=="function"?Fa:Ha)(e)):this.node().innerHTML}function La(){this.nextSibling&&this.parentNode.appendChild(this)}function Ba(){return this.each(La)}function ja(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Oa(){return this.each(ja)}function Xa(e){var t=typeof e=="function"?e:co(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ya(){return null}function Ua(e,t){var n=typeof e=="function"?e:co(e),r=t==null?Ya:typeof t=="function"?t:Yn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function qa(){var e=this.parentNode;e&&e.removeChild(this)}function Wa(){return this.each(qa)}function Ga(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Za(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ka(e){return this.select(e?Za:Ga)}function Qa(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Ja(e){return function(t){e.call(this,t,this.__data__)}}function ec(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function tc(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function nc(e,t,n){return function(){var r=this.__on,o,i=Ja(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function rc(e,t,n){var r=ec(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(o=0,c=a[l];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(a=t?nc:tc,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function wo(e,t,n){var r=go(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function oc(e,t){return function(){return wo(this,e,t)}}function sc(e,t){return function(){return wo(this,e,t.apply(this,arguments))}}function ic(e,t){return this.each((typeof t=="function"?sc:oc)(e,t))}function*ac(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var vo=[null];function ue(e,t){this._groups=e,this._parents=t}function Dt(){return new ue([[document.documentElement]],vo)}function cc(){return this}ue.prototype=Dt.prototype={constructor:ue,select:Pi,selectAll:Fi,selectChild:ji,selectChildren:Ui,filter:qi,data:Ji,enter:Wi,exit:ta,join:na,merge:ra,selection:cc,order:oa,sort:sa,call:aa,nodes:ca,node:la,size:ua,empty:fa,each:da,attr:wa,style:Ea,property:Aa,classed:Ia,text:Ra,html:Va,raise:Ba,lower:Oa,append:Xa,insert:Ua,remove:Wa,clone:Ka,datum:Qa,on:rc,dispatch:ic,[Symbol.iterator]:ac};function ye(e){return typeof e=="string"?new ue([[document.querySelector(e)]],[document.documentElement]):new ue([[e]],vo)}function lc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ee(e,t){if(e=lc(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const uc={passive:!1},Ct={capture:!0,passive:!1};function vn(e){e.stopImmediatePropagation()}function lt(e){e.preventDefault(),e.stopImmediatePropagation()}function bo(e){var t=e.document.documentElement,n=ye(e).on("dragstart.drag",lt,Ct);"onselectstart"in t?n.on("selectstart.drag",lt,Ct):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function _o(e,t){var n=e.document.documentElement,r=ye(e).on("dragstart.drag",null);t&&(r.on("click.drag",lt,Ct),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Vt=e=>()=>e;function $n(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,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:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}$n.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function fc(e){return!e.ctrlKey&&!e.button}function dc(){return this.parentNode}function hc(e,t){return t??{x:e.x,y:e.y}}function gc(){return navigator.maxTouchPoints||"ontouchstart"in this}function pc(){var e=fc,t=dc,n=hc,r=gc,o={},i=an("start","drag","end"),s=0,a,l,u,c,f=0;function d(y){y.on("mousedown.drag",g).filter(r).on("touchstart.drag",w).on("touchmove.drag",m,uc).on("touchend.drag touchcancel.drag",S).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(y,M){if(!(c||!e.call(this,y,M))){var A=E(this,t.call(this,y,M),y,M,"mouse");A&&(ye(y.view).on("mousemove.drag",x,Ct).on("mouseup.drag",p,Ct),bo(y.view),vn(y),u=!1,a=y.clientX,l=y.clientY,A("start",y))}}function x(y){if(lt(y),!u){var M=y.clientX-a,A=y.clientY-l;u=M*M+A*A>f}o.mouse("drag",y)}function p(y){ye(y.view).on("mousemove.drag mouseup.drag",null),_o(y.view,u),lt(y),o.mouse("end",y)}function w(y,M){if(e.call(this,y,M)){var A=y.changedTouches,R=t.call(this,y,M),H=A.length,z,V;for(z=0;z<H;++z)(V=E(this,R,y,M,A[z].identifier,A[z]))&&(vn(y),V("start",y,A[z]))}}function m(y){var M=y.changedTouches,A=M.length,R,H;for(R=0;R<A;++R)(H=o[M[R].identifier])&&(lt(y),H("drag",y,M[R]))}function S(y){var M=y.changedTouches,A=M.length,R,H;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),R=0;R<A;++R)(H=o[M[R].identifier])&&(vn(y),H("end",y,M[R]))}function E(y,M,A,R,H,z){var V=i.copy(),F=Ee(z||A,M),B,L,h;if((h=n.call(y,new $n("beforestart",{sourceEvent:A,target:d,identifier:H,active:s,x:F[0],y:F[1],dx:0,dy:0,dispatch:V}),R))!=null)return B=h.x-F[0]||0,L=h.y-F[1]||0,function k(_,T,D){var b=F,v;switch(_){case"start":o[H]=k,v=s++;break;case"end":delete o[H],--s;case"drag":F=Ee(D||T,M),v=s;break}V.call(_,y,new $n(_,{sourceEvent:T,subject:h,target:d,identifier:H,active:v,x:F[0]+B,y:F[1]+L,dx:F[0]-b[0],dy:F[1]-b[1],dispatch:V}),R)}}return d.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Vt(!!y),d):e},d.container=function(y){return arguments.length?(t=typeof y=="function"?y:Vt(y),d):t},d.subject=function(y){return arguments.length?(n=typeof y=="function"?y:Vt(y),d):n},d.touchable=function(y){return arguments.length?(r=typeof y=="function"?y:Vt(!!y),d):r},d.on=function(){var y=i.on.apply(i,arguments);return y===i?d:y},d.clickDistance=function(y){return arguments.length?(f=(y=+y)*y,d):Math.sqrt(f)},d}function qn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Eo(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ht(){}var Mt=.7,Jt=1/Mt,ut="\\s*([+-]?\\d+)\\s*",$t="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Se="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mc=/^#([0-9a-f]{3,8})$/,yc=new RegExp(`^rgb\\(${ut},${ut},${ut}\\)$`),xc=new RegExp(`^rgb\\(${Se},${Se},${Se}\\)$`),wc=new RegExp(`^rgba\\(${ut},${ut},${ut},${$t}\\)$`),vc=new RegExp(`^rgba\\(${Se},${Se},${Se},${$t}\\)$`),bc=new RegExp(`^hsl\\(${$t},${Se},${Se}\\)$`),_c=new RegExp(`^hsla\\(${$t},${Se},${Se},${$t}\\)$`),br={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};qn(Ht,It,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_r,formatHex:_r,formatHex8:Ec,formatHsl:Sc,formatRgb:Er,toString:Er});function _r(){return this.rgb().formatHex()}function Ec(){return this.rgb().formatHex8()}function Sc(){return So(this).formatHsl()}function Er(){return this.rgb().formatRgb()}function It(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=mc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Sr(t):n===3?new ce(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Lt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Lt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=yc.exec(e))?new ce(t[1],t[2],t[3],1):(t=xc.exec(e))?new ce(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wc.exec(e))?Lt(t[1],t[2],t[3],t[4]):(t=vc.exec(e))?Lt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bc.exec(e))?Ar(t[1],t[2]/100,t[3]/100,1):(t=_c.exec(e))?Ar(t[1],t[2]/100,t[3]/100,t[4]):br.hasOwnProperty(e)?Sr(br[e]):e==="transparent"?new ce(NaN,NaN,NaN,0):null}function Sr(e){return new ce(e>>16&255,e>>8&255,e&255,1)}function Lt(e,t,n,r){return r<=0&&(e=t=n=NaN),new ce(e,t,n,r)}function Nc(e){return e instanceof Ht||(e=It(e)),e?(e=e.rgb(),new ce(e.r,e.g,e.b,e.opacity)):new ce}function In(e,t,n,r){return arguments.length===1?Nc(e):new ce(e,t,n,r??1)}function ce(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}qn(ce,In,Eo(Ht,{brighter(e){return e=e==null?Jt:Math.pow(Jt,e),new ce(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mt:Math.pow(Mt,e),new ce(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ce(Ze(this.r),Ze(this.g),Ze(this.b),en(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:Nr,formatHex:Nr,formatHex8:kc,formatRgb:kr,toString:kr}));function Nr(){return`#${We(this.r)}${We(this.g)}${We(this.b)}`}function kc(){return`#${We(this.r)}${We(this.g)}${We(this.b)}${We((isNaN(this.opacity)?1:this.opacity)*255)}`}function kr(){const e=en(this.opacity);return`${e===1?"rgb(":"rgba("}${Ze(this.r)}, ${Ze(this.g)}, ${Ze(this.b)}${e===1?")":`, ${e})`}`}function en(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ze(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function We(e){return e=Ze(e),(e<16?"0":"")+e.toString(16)}function Ar(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xe(e,t,n,r)}function So(e){if(e instanceof xe)return new xe(e.h,e.s,e.l,e.opacity);if(e instanceof Ht||(e=It(e)),!e)return new xe;if(e instanceof xe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new xe(s,a,l,e.opacity)}function Ac(e,t,n,r){return arguments.length===1?So(e):new xe(e,t,n,r??1)}function xe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}qn(xe,Ac,Eo(Ht,{brighter(e){return e=e==null?Jt:Math.pow(Jt,e),new xe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Mt:Math.pow(Mt,e),new xe(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new ce(bn(e>=240?e-240:e+120,o,r),bn(e,o,r),bn(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new xe(Cr(this.h),Bt(this.s),Bt(this.l),en(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=en(this.opacity);return`${e===1?"hsl(":"hsla("}${Cr(this.h)}, ${Bt(this.s)*100}%, ${Bt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Cr(e){return e=(e||0)%360,e<0?e+360:e}function Bt(e){return Math.max(0,Math.min(1,e||0))}function bn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const No=e=>()=>e;function Cc(e,t){return function(n){return e+n*t}}function Mc(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function $c(e){return(e=+e)==1?ko:function(t,n){return n-t?Mc(t,n,e):No(isNaN(t)?n:t)}}function ko(e,t){var n=t-e;return n?Cc(e,n):No(isNaN(e)?t:e)}const Mr=(function e(t){var n=$c(t);function r(o,i){var s=n((o=In(o)).r,(i=In(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),u=ko(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=a(c),o.b=l(c),o.opacity=u(c),o+""}}return r.gamma=e,r})(1);function Pe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Tn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_n=new RegExp(Tn.source,"g");function Ic(e){return function(){return e}}function Tc(e){return function(t){return e(t)+""}}function zc(e,t){var n=Tn.lastIndex=_n.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Tn.exec(e))&&(o=_n.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:Pe(r,o)})),n=_n.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?Tc(l[0].x):Ic(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)a[(f=l[c]).i]=f.x(u);return a.join("")})}var $r=180/Math.PI,zn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ao(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*$r,skewX:Math.atan(l)*$r,scaleX:s,scaleY:a}}var jt;function Pc(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?zn:Ao(t.a,t.b,t.c,t.d,t.e,t.f)}function Rc(e){return e==null||(jt||(jt=document.createElementNS("http://www.w3.org/2000/svg","g")),jt.setAttribute("transform",e),!(e=jt.transform.baseVal.consolidate()))?zn:(e=e.matrix,Ao(e.a,e.b,e.c,e.d,e.e,e.f))}function Co(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,f,d,g,x){if(u!==f||c!==d){var p=g.push("translate(",null,t,null,n);x.push({i:p-4,x:Pe(u,f)},{i:p-2,x:Pe(c,d)})}else(f||d)&&g.push("translate("+f+t+d+n)}function s(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Pe(u,c)})):c&&f.push(o(f)+"rotate("+c+r)}function a(u,c,f,d){u!==c?d.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Pe(u,c)}):c&&f.push(o(f)+"skewX("+c+r)}function l(u,c,f,d,g,x){if(u!==f||c!==d){var p=g.push(o(g)+"scale(",null,",",null,")");x.push({i:p-4,x:Pe(u,f)},{i:p-2,x:Pe(c,d)})}else(f!==1||d!==1)&&g.push(o(g)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,f,d),s(u.rotate,c.rotate,f,d),a(u.skewX,c.skewX,f,d),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(g){for(var x=-1,p=d.length,w;++x<p;)f[(w=d[x]).i]=w.x(g);return f.join("")}}}var Dc=Co(Pc,"px, ","px)","deg)"),Hc=Co(Rc,", ",")",")"),Fc=1e-12;function Ir(e){return((e=Math.exp(e))+1/e)/2}function Vc(e){return((e=Math.exp(e))-1/e)/2}function Lc(e){return((e=Math.exp(2*e))-1)/(e+1)}const Bc=(function e(t,n,r){function o(i,s){var a=i[0],l=i[1],u=i[2],c=s[0],f=s[1],d=s[2],g=c-a,x=f-l,p=g*g+x*x,w,m;if(p<Fc)m=Math.log(d/u)/t,w=function(R){return[a+R*g,l+R*x,u*Math.exp(t*R*m)]};else{var S=Math.sqrt(p),E=(d*d-u*u+r*p)/(2*u*n*S),y=(d*d-u*u-r*p)/(2*d*n*S),M=Math.log(Math.sqrt(E*E+1)-E),A=Math.log(Math.sqrt(y*y+1)-y);m=(A-M)/t,w=function(R){var H=R*m,z=Ir(M),V=u/(n*S)*(z*Lc(t*H+M)-Vc(M));return[a+V*g,l+V*x,u*z/Ir(t*H+M)]}}return w.duration=m*1e3*t/Math.SQRT2,w}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o})(Math.SQRT2,2,4);var gt=0,Nt=0,vt=0,Mo=1e3,tn,kt,nn=0,Ke=0,ln=0,Tt=typeof performance=="object"&&performance.now?performance:Date,$o=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wn(){return Ke||($o(jc),Ke=Tt.now()+ln)}function jc(){Ke=0}function rn(){this._call=this._time=this._next=null}rn.prototype=Io.prototype={constructor:rn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Wn():+n)+(t==null?0:+t),!this._next&&kt!==this&&(kt?kt._next=this:tn=this,kt=this),this._call=e,this._time=n,Pn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Pn())}};function Io(e,t,n){var r=new rn;return r.restart(e,t,n),r}function Oc(){Wn(),++gt;for(var e=tn,t;e;)(t=Ke-e._time)>=0&&e._call.call(void 0,t),e=e._next;--gt}function Tr(){Ke=(nn=Tt.now())+ln,gt=Nt=0;try{Oc()}finally{gt=0,Yc(),Ke=0}}function Xc(){var e=Tt.now(),t=e-nn;t>Mo&&(ln-=t,nn=e)}function Yc(){for(var e,t=tn,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:tn=n);kt=e,Pn(r)}function Pn(e){if(!gt){Nt&&(Nt=clearTimeout(Nt));var t=e-Ke;t>24?(e<1/0&&(Nt=setTimeout(Tr,e-Tt.now()-ln)),vt&&(vt=clearInterval(vt))):(vt||(nn=Tt.now(),vt=setInterval(Xc,Mo)),gt=1,$o(Tr))}}function zr(e,t,n){var r=new rn;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Uc=an("start","end","cancel","interrupt"),qc=[],To=0,Pr=1,Rn=2,Gt=3,Rr=4,Dn=5,Zt=6;function un(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Wc(e,n,{name:t,index:r,group:o,on:Uc,tween:qc,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:To})}function Gn(e,t){var n=ve(e,t);if(n.state>To)throw new Error("too late; already scheduled");return n}function Ne(e,t){var n=ve(e,t);if(n.state>Gt)throw new Error("too late; already running");return n}function ve(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Wc(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Io(i,0,n.time);function i(u){n.state=Pr,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,f,d,g;if(n.state!==Pr)return l();for(c in r)if(g=r[c],g.name===n.name){if(g.state===Gt)return zr(s);g.state===Rr?(g.state=Zt,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[c]):+c<t&&(g.state=Zt,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[c])}if(zr(function(){n.state===Gt&&(n.state=Rr,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=Rn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Rn){for(n.state=Gt,o=new Array(d=n.tween.length),c=0,f=-1;c<d;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=g);o.length=f+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=Dn,1),f=-1,d=o.length;++f<d;)o[f].call(e,c);n.state===Dn&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=Zt,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Kt(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>Rn&&r.state<Dn,r.state=Zt,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Gc(e){return this.each(function(){Kt(this,e)})}function Zc(e,t){var n,r;return function(){var o=Ne(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function Kc(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Ne(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,u=o.length;l<u;++l)if(o[l].name===t){o[l]=a;break}l===u&&o.push(a)}i.tween=o}}function Qc(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ve(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?Zc:Kc)(n,e,t))}function Zn(e,t,n){var r=e._id;return e.each(function(){var o=Ne(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return ve(o,r).value[t]}}function zo(e,t){var n;return(typeof t=="number"?Pe:t instanceof It?Mr:(n=It(t))?(t=n,Mr):zc)(e,t)}function Jc(e){return function(){this.removeAttribute(e)}}function el(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tl(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function nl(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function rl(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function ol(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function sl(e,t){var n=cn(e),r=n==="transform"?Hc:zo;return this.attrTween(e,typeof t=="function"?(n.local?ol:rl)(n,r,Zn(this,"attr."+e,t)):t==null?(n.local?el:Jc)(n):(n.local?nl:tl)(n,r,t))}function il(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function al(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function cl(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&al(e,i)),n}return o._value=t,o}function ll(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&il(e,i)),n}return o._value=t,o}function ul(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=cn(e);return this.tween(n,(r.local?cl:ll)(r,t))}function fl(e,t){return function(){Gn(this,e).delay=+t.apply(this,arguments)}}function dl(e,t){return t=+t,function(){Gn(this,e).delay=t}}function hl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?fl:dl)(t,e)):ve(this.node(),t).delay}function gl(e,t){return function(){Ne(this,e).duration=+t.apply(this,arguments)}}function pl(e,t){return t=+t,function(){Ne(this,e).duration=t}}function ml(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?gl:pl)(t,e)):ve(this.node(),t).duration}function yl(e,t){if(typeof t!="function")throw new Error;return function(){Ne(this,e).ease=t}}function xl(e){var t=this._id;return arguments.length?this.each(yl(t,e)):ve(this.node(),t).ease}function wl(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ne(this,e).ease=n}}function vl(e){if(typeof e!="function")throw new Error;return this.each(wl(this._id,e))}function bl(e){typeof e!="function"&&(e=uo(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],l,u=0;u<s;++u)(l=i[u])&&e.call(l,l.__data__,u,i)&&a.push(l);return new $e(r,this._parents,this._name,this._id)}function _l(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var l=t[a],u=n[a],c=l.length,f=s[a]=new Array(c),d,g=0;g<c;++g)(d=l[g]||u[g])&&(f[g]=d);for(;a<r;++a)s[a]=t[a];return new $e(s,this._parents,this._name,this._id)}function El(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Sl(e,t,n){var r,o,i=El(t)?Gn:Ne;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function Nl(e,t){var n=this._id;return arguments.length<2?ve(this.node(),n).on.on(e):this.each(Sl(n,e,t))}function kl(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Al(){return this.on("end.remove",kl(this._id))}function Cl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yn(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,u=i[s]=new Array(l),c,f,d=0;d<l;++d)(c=a[d])&&(f=e.call(c,c.__data__,d,a))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,un(u[d],t,n,d,u,ve(c,n)));return new $e(i,this._parents,t,n)}function Ml(e){var t=this._name,n=this._id;typeof e!="function"&&(e=lo(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],u=l.length,c,f=0;f<u;++f)if(c=l[f]){for(var d=e.call(c,c.__data__,f,l),g,x=ve(c,n),p=0,w=d.length;p<w;++p)(g=d[p])&&un(g,t,n,p,d,x);i.push(d),s.push(c)}return new $e(i,s,t,n)}var $l=Dt.prototype.constructor;function Il(){return new $l(this._groups,this._parents)}function Tl(e,t){var n,r,o;return function(){var i=ht(this,e),s=(this.style.removeProperty(e),ht(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Po(e){return function(){this.style.removeProperty(e)}}function zl(e,t,n){var r,o=n+"",i;return function(){var s=ht(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function Pl(e,t,n){var r,o,i;return function(){var s=ht(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),ht(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function Rl(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=Ne(this,e),u=l.on,c=l.value[i]==null?a||(a=Po(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),l.on=r}}function Dl(e,t,n){var r=(e+="")=="transform"?Dc:zo;return t==null?this.styleTween(e,Tl(e,r)).on("end.style."+e,Po(e)):typeof t=="function"?this.styleTween(e,Pl(e,r,Zn(this,"style."+e,t))).each(Rl(this._id,e)):this.styleTween(e,zl(e,r,t),n).on("end.style."+e,null)}function Hl(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Fl(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&Hl(e,s,n)),r}return i._value=t,i}function Vl(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Fl(e,t,n??""))}function Ll(e){return function(){this.textContent=e}}function Bl(e){return function(){var t=e(this);this.textContent=t??""}}function jl(e){return this.tween("text",typeof e=="function"?Bl(Zn(this,"text",e)):Ll(e==null?"":e+""))}function Ol(e){return function(t){this.textContent=e.call(this,t)}}function Xl(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&Ol(o)),t}return r._value=e,r}function Yl(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Xl(e))}function Ul(){for(var e=this._name,t=this._id,n=Ro(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)if(l=s[u]){var c=ve(l,t);un(l,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new $e(r,this._parents,e,n)}function ql(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var u=Ne(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),o===0&&i()})}var Wl=0;function $e(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ro(){return++Wl}var Ce=Dt.prototype;$e.prototype={constructor:$e,select:Cl,selectAll:Ml,selectChild:Ce.selectChild,selectChildren:Ce.selectChildren,filter:bl,merge:_l,selection:Il,transition:Ul,call:Ce.call,nodes:Ce.nodes,node:Ce.node,size:Ce.size,empty:Ce.empty,each:Ce.each,on:Nl,attr:sl,attrTween:ul,style:Dl,styleTween:Vl,text:jl,textTween:Yl,remove:Al,tween:Qc,delay:hl,duration:ml,ease:xl,easeVarying:vl,end:ql,[Symbol.iterator]:Ce[Symbol.iterator]};function Gl(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Zl={time:null,delay:0,duration:250,ease:Gl};function Kl(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Ql(e){var t,n;e instanceof $e?(t=e._id,e=e._name):(t=Ro(),(n=Zl).time=Wn(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,u=0;u<a;++u)(l=s[u])&&un(l,e,t,u,s,n||Kl(l,t));return new $e(r,this._parents,e,t)}Dt.prototype.interrupt=Gc;Dt.prototype.transition=Ql;const Ot=e=>()=>e;function Jl(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Me(e,t,n){this.k=e,this.x=t,this.y=n}Me.prototype={constructor:Me,scale:function(e){return e===1?this:new Me(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Me(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var He=new Me(1,0,0);Me.prototype;function En(e){e.stopImmediatePropagation()}function bt(e){e.preventDefault(),e.stopImmediatePropagation()}function eu(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tu(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Dr(){return this.__zoom||He}function nu(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ru(){return navigator.maxTouchPoints||"ontouchstart"in this}function ou(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function su(){var e=eu,t=tu,n=ou,r=nu,o=ru,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Bc,u=an("start","zoom","end"),c,f,d,g=500,x=150,p=0,w=10;function m(h){h.property("__zoom",Dr).on("wheel.zoom",H,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",V).filter(o).on("touchstart.zoom",F).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(h,k,_,T){var D=h.selection?h.selection():h;D.property("__zoom",Dr),h!==D?M(h,k,_,T):D.interrupt().each(function(){A(this,arguments).event(T).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},m.scaleBy=function(h,k,_,T){m.scaleTo(h,function(){var D=this.__zoom.k,b=typeof k=="function"?k.apply(this,arguments):k;return D*b},_,T)},m.scaleTo=function(h,k,_,T){m.transform(h,function(){var D=t.apply(this,arguments),b=this.__zoom,v=_==null?y(D):typeof _=="function"?_.apply(this,arguments):_,I=b.invert(v),P=typeof k=="function"?k.apply(this,arguments):k;return n(E(S(b,P),v,I),D,s)},_,T)},m.translateBy=function(h,k,_,T){m.transform(h,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),s)},null,T)},m.translateTo=function(h,k,_,T,D){m.transform(h,function(){var b=t.apply(this,arguments),v=this.__zoom,I=T==null?y(b):typeof T=="function"?T.apply(this,arguments):T;return n(He.translate(I[0],I[1]).scale(v.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof _=="function"?-_.apply(this,arguments):-_),b,s)},T,D)};function S(h,k){return k=Math.max(i[0],Math.min(i[1],k)),k===h.k?h:new Me(k,h.x,h.y)}function E(h,k,_){var T=k[0]-_[0]*h.k,D=k[1]-_[1]*h.k;return T===h.x&&D===h.y?h:new Me(h.k,T,D)}function y(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function M(h,k,_,T){h.on("start.zoom",function(){A(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(T).end()}).tween("zoom",function(){var D=this,b=arguments,v=A(D,b).event(T),I=t.apply(D,b),P=_==null?y(I):typeof _=="function"?_.apply(D,b):_,j=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),O=D.__zoom,U=typeof k=="function"?k.apply(D,b):k,W=l(O.invert(P).concat(j/O.k),U.invert(P).concat(j/U.k));return function(G){if(G===1)G=U;else{var Z=W(G),ee=j/Z[2];G=new Me(ee,P[0]-Z[0]*ee,P[1]-Z[1]*ee)}v.zoom(null,G)}})}function A(h,k,_){return!_&&h.__zooming||new R(h,k)}function R(h,k){this.that=h,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(h,k),this.taps=0}R.prototype={event:function(h){return h&&(this.sourceEvent=h),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(h,k){return this.mouse&&h!=="mouse"&&(this.mouse[1]=k.invert(this.mouse[0])),this.touch0&&h!=="touch"&&(this.touch0[1]=k.invert(this.touch0[0])),this.touch1&&h!=="touch"&&(this.touch1[1]=k.invert(this.touch1[0])),this.that.__zoom=k,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(h){var k=ye(this.that).datum();u.call(h,this.that,new Jl(h,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),k)}};function H(h,...k){if(!e.apply(this,arguments))return;var _=A(this,k).event(h),T=this.__zoom,D=Math.max(i[0],Math.min(i[1],T.k*Math.pow(2,r.apply(this,arguments)))),b=Ee(h);if(_.wheel)(_.mouse[0][0]!==b[0]||_.mouse[0][1]!==b[1])&&(_.mouse[1]=T.invert(_.mouse[0]=b)),clearTimeout(_.wheel);else{if(T.k===D)return;_.mouse=[b,T.invert(b)],Kt(this),_.start()}bt(h),_.wheel=setTimeout(v,x),_.zoom("mouse",n(E(S(T,D),_.mouse[0],_.mouse[1]),_.extent,s));function v(){_.wheel=null,_.end()}}function z(h,...k){if(d||!e.apply(this,arguments))return;var _=h.currentTarget,T=A(this,k,!0).event(h),D=ye(h.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",j,!0),b=Ee(h,_),v=h.clientX,I=h.clientY;bo(h.view),En(h),T.mouse=[b,this.__zoom.invert(b)],Kt(this),T.start();function P(O){if(bt(O),!T.moved){var U=O.clientX-v,W=O.clientY-I;T.moved=U*U+W*W>p}T.event(O).zoom("mouse",n(E(T.that.__zoom,T.mouse[0]=Ee(O,_),T.mouse[1]),T.extent,s))}function j(O){D.on("mousemove.zoom mouseup.zoom",null),_o(O.view,T.moved),bt(O),T.event(O).end()}}function V(h,...k){if(e.apply(this,arguments)){var _=this.__zoom,T=Ee(h.changedTouches?h.changedTouches[0]:h,this),D=_.invert(T),b=_.k*(h.shiftKey?.5:2),v=n(E(S(_,b),T,D),t.apply(this,k),s);bt(h),a>0?ye(this).transition().duration(a).call(M,v,T,h):ye(this).call(m.transform,v,T,h)}}function F(h,...k){if(e.apply(this,arguments)){var _=h.touches,T=_.length,D=A(this,k,h.changedTouches.length===T).event(h),b,v,I,P;for(En(h),v=0;v<T;++v)I=_[v],P=Ee(I,this),P=[P,this.__zoom.invert(P),I.identifier],D.touch0?!D.touch1&&D.touch0[2]!==P[2]&&(D.touch1=P,D.taps=0):(D.touch0=P,b=!0,D.taps=1+!!c);c&&(c=clearTimeout(c)),b&&(D.taps<2&&(f=P[0],c=setTimeout(function(){c=null},g)),Kt(this),D.start())}}function B(h,...k){if(this.__zooming){var _=A(this,k).event(h),T=h.changedTouches,D=T.length,b,v,I,P;for(bt(h),b=0;b<D;++b)v=T[b],I=Ee(v,this),_.touch0&&_.touch0[2]===v.identifier?_.touch0[0]=I:_.touch1&&_.touch1[2]===v.identifier&&(_.touch1[0]=I);if(v=_.that.__zoom,_.touch1){var j=_.touch0[0],O=_.touch0[1],U=_.touch1[0],W=_.touch1[1],G=(G=U[0]-j[0])*G+(G=U[1]-j[1])*G,Z=(Z=W[0]-O[0])*Z+(Z=W[1]-O[1])*Z;v=S(v,Math.sqrt(G/Z)),I=[(j[0]+U[0])/2,(j[1]+U[1])/2],P=[(O[0]+W[0])/2,(O[1]+W[1])/2]}else if(_.touch0)I=_.touch0[0],P=_.touch0[1];else return;_.zoom("touch",n(E(v,I,P),_.extent,s))}}function L(h,...k){if(this.__zooming){var _=A(this,k).event(h),T=h.changedTouches,D=T.length,b,v;for(En(h),d&&clearTimeout(d),d=setTimeout(function(){d=null},g),b=0;b<D;++b)v=T[b],_.touch0&&_.touch0[2]===v.identifier?delete _.touch0:_.touch1&&_.touch1[2]===v.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(v=Ee(v,this),Math.hypot(f[0]-v[0],f[1]-v[1])<w)){var I=ye(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return m.wheelDelta=function(h){return arguments.length?(r=typeof h=="function"?h:Ot(+h),m):r},m.filter=function(h){return arguments.length?(e=typeof h=="function"?h:Ot(!!h),m):e},m.touchable=function(h){return arguments.length?(o=typeof h=="function"?h:Ot(!!h),m):o},m.extent=function(h){return arguments.length?(t=typeof h=="function"?h:Ot([[+h[0][0],+h[0][1]],[+h[1][0],+h[1][1]]]),m):t},m.scaleExtent=function(h){return arguments.length?(i[0]=+h[0],i[1]=+h[1],m):[i[0],i[1]]},m.translateExtent=function(h){return arguments.length?(s[0][0]=+h[0][0],s[1][0]=+h[1][0],s[0][1]=+h[0][1],s[1][1]=+h[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(h){return arguments.length?(n=h,m):n},m.duration=function(h){return arguments.length?(a=+h,m):a},m.interpolate=function(h){return arguments.length?(l=h,m):l},m.on=function(){var h=u.on.apply(u,arguments);return h===u?m:h},m.clickDistance=function(h){return arguments.length?(p=(h=+h)*h,m):Math.sqrt(p)},m.tapDistance=function(h){return arguments.length?(w=+h,m):w},m}di();const fn=N.createContext(null),iu=fn.Provider,Ie={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},Do=Ie.error001();function J(e,t){const n=N.useContext(fn);if(n===null)throw new Error(Do);return ao(n,e,t)}const re=()=>{const e=N.useContext(fn);if(e===null)throw new Error(Do);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},au=e=>e.userSelectionActive?"none":"all";function Ho({position:e,children:t,className:n,style:r,...o}){const i=J(au),s=`${e}`.split("-");return C.createElement("div",{className:ae(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o},t)}function cu({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:C.createElement(Ho,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},C.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const lu=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...c})=>{const f=N.useRef(null),[d,g]=N.useState({x:0,y:0,width:0,height:0}),x=ae(["react-flow__edge-textwrapper",u]);return N.useEffect(()=>{if(f.current){const p=f.current.getBBox();g({x:p.x,y:p.y,width:p.width,height:p.height})}},[n]),typeof n>"u"||!n?null:C.createElement("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:x,visibility:d.width?"visible":"hidden",...c},o&&C.createElement("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),C.createElement("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:f,style:r},n),l)};var uu=N.memo(lu);const Kn=e=>({width:e.offsetWidth,height:e.offsetHeight}),pt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Qn=(e={x:0,y:0},t)=>({x:pt(e.x,t[0][0],t[1][0]),y:pt(e.y,t[0][1],t[1][1])}),Hr=(e,t,n)=>e<t?pt(Math.abs(e-t),1,50)/50:e>n?-pt(Math.abs(e-n),1,50)/50:0,Fo=(e,t)=>{const n=Hr(e.x,35,t.width-35)*20,r=Hr(e.y,35,t.height-35)*20;return[n,r]},Vo=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},fu=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Jn=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),du=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Fr=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Hn=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},hu=e=>he(e.width)&&he(e.height)&&he(e.x)&&he(e.y),he=e=>!isNaN(e)&&isFinite(e),te=Symbol.for("internals"),Lo=["Enter"," ","Escape"],gu=(e,t)=>{},pu=e=>"nativeEvent"in e;function Fn(e){var o,i;const t=pu(e)?e.nativeEvent:e,n=((i=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:i[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const Bo=e=>"clientX"in e,Fe=(e,t)=>{var i,s;const n=Bo(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},on=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Ft=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:f,markerStart:d,interactionWidth:g=20})=>C.createElement(C.Fragment,null,C.createElement("path",{id:e,style:c,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:d}),g&&C.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}),o&&he(n)&&he(r)?C.createElement(uu,{x:n,y:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u}):null);Ft.displayName="BaseEdge";function _t(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function jo({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function Oo({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+r*.125,c=Math.abs(l-e),f=Math.abs(u-t);return[l,u,c,f]}var Qe;(function(e){e.Strict="strict",e.Loose="loose"})(Qe||(Qe={}));var Ge;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ge||(Ge={}));var zt;(function(e){e.Partial="partial",e.Full="full"})(zt||(zt={}));var De;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(De||(De={}));var Pt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Pt||(Pt={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));function Vr({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===X.Left||e===X.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Xo({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top}){const[s,a]=Vr({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,u]=Vr({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,f,d,g]=Oo({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${a} ${l},${u} ${r},${o}`,c,f,d,g]}const er=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=X.Bottom,targetPosition:i=X.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:g,markerStart:x,interactionWidth:p})=>{const[w,m,S]=Xo({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return C.createElement(Ft,{path:w,labelX:m,labelY:S,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:g,markerStart:x,interactionWidth:p})});er.displayName="SimpleBezierEdge";const Lr={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},mu=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Br=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function yu({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:o,offset:i}){const s=Lr[t],a=Lr[r],l={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+a.x*i,y:n.y+a.y*i},c=mu({source:l,sourcePosition:t,target:u}),f=c.x!==0?"x":"y",d=c[f];let g=[],x,p;const w={x:0,y:0},m={x:0,y:0},[S,E,y,M]=jo({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*a[f]===-1){x=o.x??S,p=o.y??E;const R=[{x,y:l.y},{x,y:u.y}],H=[{x:l.x,y:p},{x:u.x,y:p}];s[f]===d?g=f==="x"?R:H:g=f==="x"?H:R}else{const R=[{x:l.x,y:u.y}],H=[{x:u.x,y:l.y}];if(f==="x"?g=s.x===d?H:R:g=s.y===d?R:H,t===r){const L=Math.abs(e[f]-n[f]);if(L<=i){const h=Math.min(i-1,i-L);s[f]===d?w[f]=(l[f]>e[f]?-1:1)*h:m[f]=(u[f]>n[f]?-1:1)*h}}if(t!==r){const L=f==="x"?"y":"x",h=s[f]===a[L],k=l[L]>u[L],_=l[L]<u[L];(s[f]===1&&(!h&&k||h&&_)||s[f]!==1&&(!h&&_||h&&k))&&(g=f==="x"?R:H)}const z={x:l.x+w.x,y:l.y+w.y},V={x:u.x+m.x,y:u.y+m.y},F=Math.max(Math.abs(z.x-g[0].x),Math.abs(V.x-g[0].x)),B=Math.max(Math.abs(z.y-g[0].y),Math.abs(V.y-g[0].y));F>=B?(x=(z.x+V.x)/2,p=g[0].y):(x=g[0].x,p=(z.y+V.y)/2)}return[[e,{x:l.x+w.x,y:l.y+w.y},...g,{x:u.x+m.x,y:u.y+m.y},n],x,p,y,M]}function xu(e,t,n,r){const o=Math.min(Br(e,t)/2,Br(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function Vn({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top,borderRadius:s=5,centerX:a,centerY:l,offset:u=20}){const[c,f,d,g,x]=yu({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:u});return[c.reduce((w,m,S)=>{let E="";return S>0&&S<c.length-1?E=xu(c[S-1],m,c[S+1],s):E=`${S===0?"M":"L"}${m.x} ${m.y}`,w+=E,w},""),f,d,g,x]}const dn=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,sourcePosition:f=X.Bottom,targetPosition:d=X.Top,markerEnd:g,markerStart:x,pathOptions:p,interactionWidth:w})=>{const[m,S,E]=Vn({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:d,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset});return C.createElement(Ft,{path:m,labelX:S,labelY:E,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:g,markerStart:x,interactionWidth:w})});dn.displayName="SmoothStepEdge";const tr=N.memo(e=>{var t;return C.createElement(dn,{...e,pathOptions:N.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});tr.displayName="StepEdge";function wu({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=jo({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const nr=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:f,markerStart:d,interactionWidth:g})=>{const[x,p,w]=wu({sourceX:e,sourceY:t,targetX:n,targetY:r});return C.createElement(Ft,{path:x,labelX:p,labelY:w,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:f,markerStart:d,interactionWidth:g})});nr.displayName="StraightEdge";function Xt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function jr({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case X.Left:return[t-Xt(t-r,i),n];case X.Right:return[t+Xt(r-t,i),n];case X.Top:return[t,n-Xt(n-o,i)];case X.Bottom:return[t,n+Xt(o-n,i)]}}function Yo({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top,curvature:s=.25}){const[a,l]=jr({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=jr({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[f,d,g,x]=Oo({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${a},${l} ${u},${c} ${r},${o}`,f,d,g,x]}const sn=N.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=X.Bottom,targetPosition:i=X.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:g,markerStart:x,pathOptions:p,interactionWidth:w})=>{const[m,S,E]=Yo({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:p==null?void 0:p.curvature});return C.createElement(Ft,{path:m,labelX:S,labelY:E,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:g,markerStart:x,interactionWidth:w})});sn.displayName="BezierEdge";const rr=N.createContext(null),vu=rr.Provider;rr.Consumer;const bu=()=>N.useContext(rr),_u=e=>"id"in e&&"source"in e&&"target"in e,Eu=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Ln=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,Su=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Nu=(e,t)=>{if(!e.source||!e.target)return t;let n;return _u(e)?n={...e}:n={...e,id:Eu(e)},Su(n,t)?t:t.concat(n)},Bn=({x:e,y:t},[n,r,o],i,[s,a])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},Uo=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),ft=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},or=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const{x:i,y:s}=ft(o,t).positionAbsolute;return fu(r,Jn({x:i,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return du(n)},qo=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1,a=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(c=>{const{width:f,height:d,selectable:g=!0,hidden:x=!1}=c;if(s&&!g||x)return!1;const{positionAbsolute:p}=ft(c,a),w={x:p.x,y:p.y,width:f||0,height:d||0},m=Hn(l,w),S=typeof f>"u"||typeof d>"u"||f===null||d===null,E=i&&m>0,y=(f||0)*(d||0);(S||E||m>=y||c.dragging)&&u.push(c)}),u},Wo=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},Go=(e,t,n,r,o,i=.1)=>{const s=t/(e.width*(1+i)),a=n/(e.height*(1+i)),l=Math.min(s,a),u=pt(l,r,o),c=e.x+e.width/2,f=e.y+e.height/2,d=t/2-c*u,g=n/2-f*u;return{x:d,y:g,zoom:u}},qe=(e,t=0)=>e.transition().duration(t);function Or(e,t,n,r){return(t[n]||[]).reduce((o,i)=>{var s,a;return`${e.id}-${i.id}-${n}`!==r&&o.push({id:i.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+i.x+i.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+i.y+i.height/2}),o},[])}function ku(e,t,n,r,o,i){const{x:s,y:a}=Fe(e),u=t.elementsFromPoint(s,a).find(x=>x.classList.contains("react-flow__handle"));if(u){const x=u.getAttribute("data-nodeid");if(x){const p=sr(void 0,u),w=u.getAttribute("data-handleid"),m=i({nodeId:x,id:w,type:p});if(m){const S=o.find(E=>E.nodeId===x&&E.type===p&&E.id===w);return{handle:{id:w,type:p,nodeId:x,x:(S==null?void 0:S.x)||n.x,y:(S==null?void 0:S.y)||n.y},validHandleResult:m}}}}let c=[],f=1/0;if(o.forEach(x=>{const p=Math.sqrt((x.x-n.x)**2+(x.y-n.y)**2);if(p<=r){const w=i(x);p<=f&&(p<f?c=[{handle:x,validHandleResult:w}]:p===f&&c.push({handle:x,validHandleResult:w}),f=p)}}),!c.length)return{handle:null,validHandleResult:Zo()};if(c.length===1)return c[0];const d=c.some(({validHandleResult:x})=>x.isValid),g=c.some(({handle:x})=>x.type==="target");return c.find(({handle:x,validHandleResult:p})=>g?x.type==="target":d?p.isValid:!0)||c[0]}const Au={source:null,target:null,sourceHandle:null,targetHandle:null},Zo=()=>({handleDomNode:null,isValid:!1,connection:Au,endHandle:null});function Ko(e,t,n,r,o,i,s){const a=o==="target",l=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...Zo(),handleDomNode:l};if(l){const c=sr(void 0,l),f=l.getAttribute("data-nodeid"),d=l.getAttribute("data-handleid"),g=l.classList.contains("connectable"),x=l.classList.contains("connectableend"),p={source:a?f:n,sourceHandle:a?d:r,target:a?n:f,targetHandle:a?r:d};u.connection=p,g&&x&&(t===Qe.Strict?a&&c==="source"||!a&&c==="target":f!==n||d!==r)&&(u.endHandle={nodeId:f,handleId:d,type:c},u.isValid=i(p))}return u}function Cu({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[te]){const{handleBounds:s}=i[te];let a=[],l=[];s&&(a=Or(i,s,"source",`${t}-${n}-${r}`),l=Or(i,s,"target",`${t}-${n}-${r}`)),o.push(...a,...l)}return o},[])}function sr(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Sn(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Mu(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Qo({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:a,edgeUpdaterType:l,onReconnectEnd:u}){const c=Vo(e.target),{connectionMode:f,domNode:d,autoPanOnConnect:g,connectionRadius:x,onConnectStart:p,panBy:w,getNodes:m,cancelConnection:S}=i();let E=0,y;const{x:M,y:A}=Fe(e),R=c==null?void 0:c.elementFromPoint(M,A),H=sr(l,R),z=d==null?void 0:d.getBoundingClientRect();if(!z||!H)return;let V,F=Fe(e,z),B=!1,L=null,h=!1,k=null;const _=Cu({nodes:m(),nodeId:n,handleId:t,handleType:H}),T=()=>{if(!g)return;const[v,I]=Fo(F,z);w({x:v,y:I}),E=requestAnimationFrame(T)};s({connectionPosition:F,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:H,connectionStartHandle:{nodeId:n,handleId:t,type:H},connectionEndHandle:null}),p==null||p(e,{nodeId:n,handleId:t,handleType:H});function D(v){const{transform:I}=i();F=Fe(v,z);const{handle:P,validHandleResult:j}=ku(v,c,Bn(F,I,!1,[1,1]),x,_,O=>Ko(O,f,n,t,o?"target":"source",a,c));if(y=P,B||(T(),B=!0),k=j.handleDomNode,L=j.connection,h=j.isValid,s({connectionPosition:y&&h?Uo({x:y.x,y:y.y},I):F,connectionStatus:Mu(!!y,h),connectionEndHandle:j.endHandle}),!y&&!h&&!k)return Sn(V);L.source!==L.target&&k&&(Sn(V),V=k,k.classList.add("connecting","react-flow__handle-connecting"),k.classList.toggle("valid",h),k.classList.toggle("react-flow__handle-valid",h))}function b(v){var I,P;(y||k)&&L&&h&&(r==null||r(L)),(P=(I=i()).onConnectEnd)==null||P.call(I,v),l&&(u==null||u(v)),Sn(V),S(),cancelAnimationFrame(E),B=!1,h=!1,L=null,k=null,c.removeEventListener("mousemove",D),c.removeEventListener("mouseup",b),c.removeEventListener("touchmove",D),c.removeEventListener("touchend",b)}c.addEventListener("mousemove",D),c.addEventListener("mouseup",b),c.addEventListener("touchmove",D),c.addEventListener("touchend",b)}const Xr=()=>!0,$u=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Iu=(e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:s}=r;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n||(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},Jo=N.forwardRef(({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:u,onMouseDown:c,onTouchStart:f,...d},g)=>{var z,V;const x=s||null,p=e==="target",w=re(),m=bu(),{connectOnClick:S,noPanClassName:E}=J($u,ie),{connecting:y,clickConnecting:M}=J(Iu(m,x,e),ie);m||(V=(z=w.getState()).onError)==null||V.call(z,"010",Ie.error010());const A=F=>{const{defaultEdgeOptions:B,onConnect:L,hasDefaultEdges:h}=w.getState(),k={...B,...F};if(h){const{edges:_,setEdges:T}=w.getState();T(Nu(k,_))}L==null||L(k),a==null||a(k)},R=F=>{if(!m)return;const B=Bo(F);o&&(B&&F.button===0||!B)&&Qo({event:F,handleId:x,nodeId:m,onConnect:A,isTarget:p,getState:w.getState,setState:w.setState,isValidConnection:n||w.getState().isValidConnection||Xr}),B?c==null||c(F):f==null||f(F)},H=F=>{const{onClickConnectStart:B,onClickConnectEnd:L,connectionClickStartHandle:h,connectionMode:k,isValidConnection:_}=w.getState();if(!m||!h&&!o)return;if(!h){B==null||B(F,{nodeId:m,handleId:x,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:m,type:e,handleId:x}});return}const T=Vo(F.target),D=n||_||Xr,{connection:b,isValid:v}=Ko({nodeId:m,id:x,type:e},k,h.nodeId,h.handleId||null,h.type,D,T);v&&A(b),L==null||L(F),w.setState({connectionClickStartHandle:null})};return C.createElement("div",{"data-handleid":x,"data-nodeid":m,"data-handlepos":t,"data-id":`${m}-${x}-${e}`,className:ae(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,u,{source:!p,target:p,connectable:r,connectablestart:o,connectableend:i,connecting:M,connectionindicator:r&&(o&&!y||i&&y)}]),onMouseDown:R,onTouchStart:R,onClick:S?H:void 0,ref:g,...d},l)});Jo.displayName="Handle";var Ve=N.memo(Jo);const es=({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:r=X.Bottom})=>C.createElement(C.Fragment,null,C.createElement(Ve,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,C.createElement(Ve,{type:"source",position:r,isConnectable:t}));es.displayName="DefaultNode";var jn=N.memo(es);const ts=({data:e,isConnectable:t,sourcePosition:n=X.Bottom})=>C.createElement(C.Fragment,null,e==null?void 0:e.label,C.createElement(Ve,{type:"source",position:n,isConnectable:t}));ts.displayName="InputNode";var ns=N.memo(ts);const rs=({data:e,isConnectable:t,targetPosition:n=X.Top})=>C.createElement(C.Fragment,null,C.createElement(Ve,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);rs.displayName="OutputNode";var os=N.memo(rs);const ir=()=>null;ir.displayName="GroupNode";const Tu=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Yt=e=>e.id;function zu(e,t){return ie(e.selectedNodes.map(Yt),t.selectedNodes.map(Yt))&&ie(e.selectedEdges.map(Yt),t.selectedEdges.map(Yt))}const ss=N.memo(({onSelectionChange:e})=>{const t=re(),{selectedNodes:n,selectedEdges:r}=J(Tu,zu);return N.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChange.forEach(i=>i(o))},[n,r,e]),null});ss.displayName="SelectionListener";const Pu=e=>!!e.onSelectionChange;function Ru({onSelectionChange:e}){const t=J(Pu);return e||t?C.createElement(ss,{onSelectionChange:e}):null}const Du=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function ot(e,t){N.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function q(e,t,n){N.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const Hu=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:c,nodesFocusable:f,edgesFocusable:d,edgesUpdatable:g,elevateNodesOnSelect:x,minZoom:p,maxZoom:w,nodeExtent:m,onNodesChange:S,onEdgesChange:E,elementsSelectable:y,connectionMode:M,snapGrid:A,snapToGrid:R,translateExtent:H,connectOnClick:z,defaultEdgeOptions:V,fitView:F,fitViewOptions:B,onNodesDelete:L,onEdgesDelete:h,onNodeDrag:k,onNodeDragStart:_,onNodeDragStop:T,onSelectionDrag:D,onSelectionDragStart:b,onSelectionDragStop:v,noPanClassName:I,nodeOrigin:P,rfId:j,autoPanOnConnect:O,autoPanOnNodeDrag:U,onError:W,connectionRadius:G,isValidConnection:Z,nodeDragThreshold:ee})=>{const{setNodes:K,setEdges:ge,setDefaultNodesAndEdges:fe,setMinZoom:pe,setMaxZoom:de,setTranslateExtent:ne,setNodeExtent:be,reset:Q}=J(Du,ie),Y=re();return N.useEffect(()=>{const le=r==null?void 0:r.map(Le=>({...Le,...V}));return fe(n,le),()=>{Q()}},[]),q("defaultEdgeOptions",V,Y.setState),q("connectionMode",M,Y.setState),q("onConnect",o,Y.setState),q("onConnectStart",i,Y.setState),q("onConnectEnd",s,Y.setState),q("onClickConnectStart",a,Y.setState),q("onClickConnectEnd",l,Y.setState),q("nodesDraggable",u,Y.setState),q("nodesConnectable",c,Y.setState),q("nodesFocusable",f,Y.setState),q("edgesFocusable",d,Y.setState),q("edgesUpdatable",g,Y.setState),q("elementsSelectable",y,Y.setState),q("elevateNodesOnSelect",x,Y.setState),q("snapToGrid",R,Y.setState),q("snapGrid",A,Y.setState),q("onNodesChange",S,Y.setState),q("onEdgesChange",E,Y.setState),q("connectOnClick",z,Y.setState),q("fitViewOnInit",F,Y.setState),q("fitViewOnInitOptions",B,Y.setState),q("onNodesDelete",L,Y.setState),q("onEdgesDelete",h,Y.setState),q("onNodeDrag",k,Y.setState),q("onNodeDragStart",_,Y.setState),q("onNodeDragStop",T,Y.setState),q("onSelectionDrag",D,Y.setState),q("onSelectionDragStart",b,Y.setState),q("onSelectionDragStop",v,Y.setState),q("noPanClassName",I,Y.setState),q("nodeOrigin",P,Y.setState),q("rfId",j,Y.setState),q("autoPanOnConnect",O,Y.setState),q("autoPanOnNodeDrag",U,Y.setState),q("onError",W,Y.setState),q("connectionRadius",G,Y.setState),q("isValidConnection",Z,Y.setState),q("nodeDragThreshold",ee,Y.setState),ot(e,K),ot(t,ge),ot(p,pe),ot(w,de),ot(H,ne),ot(m,be),null},Yr={display:"none"},Fu={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},is="react-flow__node-desc",as="react-flow__edge-desc",Vu="react-flow__aria-live",Lu=e=>e.ariaLiveMessage;function Bu({rfId:e}){const t=J(Lu);return C.createElement("div",{id:`${Vu}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Fu},t)}function ju({rfId:e,disableKeyboardA11y:t}){return C.createElement(C.Fragment,null,C.createElement("div",{id:`${is}-${e}`,style:Yr},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),C.createElement("div",{id:`${as}-${e}`,style:Yr},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&C.createElement(Bu,{rfId:e}))}var Rt=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=N.useState(!1),o=N.useRef(!1),i=N.useRef(new Set([])),[s,a]=N.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),c=u.reduce((f,d)=>f.concat(...d),[]);return[u,c]}return[[],[]]},[e]);return N.useEffect(()=>{const l=typeof document<"u"?document:null,u=(t==null?void 0:t.target)||l;if(e!==null){const c=g=>{if(o.current=g.ctrlKey||g.metaKey||g.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&Fn(g))return!1;const p=qr(g.code,a);i.current.add(g[p]),Ur(s,i.current,!1)&&(g.preventDefault(),r(!0))},f=g=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&Fn(g))return!1;const p=qr(g.code,a);Ur(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(g[p]),g.key==="Meta"&&i.current.clear(),o.current=!1},d=()=>{i.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",c),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",d),()=>{u==null||u.removeEventListener("keydown",c),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",d)}}},[e,r]),n};function Ur(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function qr(e,t){return t.includes(e)?"code":"key"}function cs(e,t,n,r){var a,l;const o=e.parentNode||e.parentId;if(!o)return n;const i=t.get(o),s=ft(i,r);return cs(i,t,{x:(n.x??0)+s.x,y:(n.y??0)+s.y,z:(((a=i[te])==null?void 0:a.z)??0)>(n.z??0)?((l=i[te])==null?void 0:l.z)??0:n.z??0},r)}function ls(e,t,n){e.forEach(r=>{var i;const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n!=null&&n[r.id]){const{x:s,y:a,z:l}=cs(r,e,{...r.position,z:((i=r[te])==null?void 0:i.z)??0},t);r.positionAbsolute={x:s,y:a},r[te].z=l,n!=null&&n[r.id]&&(r[te].isParent=!0)}})}function Nn(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(a=>{var g;const l=(he(a.zIndex)?a.zIndex:0)+(a.selected?s:0),u=t.get(a.id),c={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},f=a.parentNode||a.parentId;f&&(i[f]=!0);const d=(u==null?void 0:u.type)&&(u==null?void 0:u.type)!==a.type;Object.defineProperty(c,te,{enumerable:!1,value:{handleBounds:d||(g=u==null?void 0:u[te])==null?void 0:g.handleBounds,z:l}}),o.set(a.id,c)}),ls(o,n,i),o}function us(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:f}=e(),d=t.initial&&!u&&c;if(a&&l&&(d||!t.initial)){const x=n().filter(w=>{var S;const m=t.includeHiddenNodes?w.width&&w.height:!w.hidden;return(S=t.nodes)!=null&&S.length?m&&t.nodes.some(E=>E.id===w.id):m}),p=x.every(w=>w.width&&w.height);if(x.length>0&&p){const w=or(x,f),{x:m,y:S,zoom:E}=Go(w,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),y=He.translate(m,S).scale(E);return typeof t.duration=="number"&&t.duration>0?a.transform(qe(l,t.duration),y):a.transform(l,y),!0}}return!1}function Ou(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[te]:r[te],selected:n.selected})}),new Map(t)}function Xu(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function Ut({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:Ou(e,o)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:Xu(t,i)}),a==null||a(t))}const st=()=>{},Yu={zoomIn:st,zoomOut:st,zoomTo:st,getZoom:()=>1,setViewport:st,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:st,fitBounds:st,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Uu=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),qu=()=>{const e=re(),{d3Zoom:t,d3Selection:n}=J(Uu,ie);return N.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(qe(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(qe(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(qe(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,a,l]=e.getState().transform,u=He.translate(o.x??s,o.y??a).scale(o.zoom??l);t.transform(qe(n,i==null?void 0:i.duration),u)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>us(e.getState,o),setCenter:(o,i,s)=>{const{width:a,height:l,maxZoom:u}=e.getState(),c=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,f=a/2-o*c,d=l/2-i*c,g=He.translate(f,d).scale(c);t.transform(qe(n,s==null?void 0:s.duration),g)},fitBounds:(o,i)=>{const{width:s,height:a,minZoom:l,maxZoom:u}=e.getState(),{x:c,y:f,zoom:d}=Go(o,s,a,l,u,(i==null?void 0:i.padding)??.1),g=He.translate(c,f).scale(d);t.transform(qe(n,i==null?void 0:i.duration),g)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:a}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Bn(o,i,s,a)},screenToFlowPosition:o=>{const{transform:i,snapToGrid:s,snapGrid:a,domNode:l}=e.getState();if(!l)return o;const{x:u,y:c}=l.getBoundingClientRect(),f={x:o.x-u,y:o.y-c};return Bn(f,i,s,a)},flowToScreenPosition:o=>{const{transform:i,domNode:s}=e.getState();if(!s)return o;const{x:a,y:l}=s.getBoundingClientRect(),u=Uo(o,i);return{x:u.x+a,y:u.y+l}},viewportInitialized:!0}:Yu,[t,n])};function ar(){const e=qu(),t=re(),n=N.useCallback(()=>t.getState().getNodes().map(p=>({...p})),[]),r=N.useCallback(p=>t.getState().nodeInternals.get(p),[]),o=N.useCallback(()=>{const{edges:p=[]}=t.getState();return p.map(w=>({...w}))},[]),i=N.useCallback(p=>{const{edges:w=[]}=t.getState();return w.find(m=>m.id===p)},[]),s=N.useCallback(p=>{const{getNodes:w,setNodes:m,hasDefaultNodes:S,onNodesChange:E}=t.getState(),y=w(),M=typeof p=="function"?p(y):p;if(S)m(M);else if(E){const A=M.length===0?y.map(R=>({type:"remove",id:R.id})):M.map(R=>({item:R,type:"reset"}));E(A)}},[]),a=N.useCallback(p=>{const{edges:w=[],setEdges:m,hasDefaultEdges:S,onEdgesChange:E}=t.getState(),y=typeof p=="function"?p(w):p;if(S)m(y);else if(E){const M=y.length===0?w.map(A=>({type:"remove",id:A.id})):y.map(A=>({item:A,type:"reset"}));E(M)}},[]),l=N.useCallback(p=>{const w=Array.isArray(p)?p:[p],{getNodes:m,setNodes:S,hasDefaultNodes:E,onNodesChange:y}=t.getState();if(E){const A=[...m(),...w];S(A)}else if(y){const M=w.map(A=>({item:A,type:"add"}));y(M)}},[]),u=N.useCallback(p=>{const w=Array.isArray(p)?p:[p],{edges:m=[],setEdges:S,hasDefaultEdges:E,onEdgesChange:y}=t.getState();if(E)S([...m,...w]);else if(y){const M=w.map(A=>({item:A,type:"add"}));y(M)}},[]),c=N.useCallback(()=>{const{getNodes:p,edges:w=[],transform:m}=t.getState(),[S,E,y]=m;return{nodes:p().map(M=>({...M})),edges:w.map(M=>({...M})),viewport:{x:S,y:E,zoom:y}}},[]),f=N.useCallback(({nodes:p,edges:w})=>{const{nodeInternals:m,getNodes:S,edges:E,hasDefaultNodes:y,hasDefaultEdges:M,onNodesDelete:A,onEdgesDelete:R,onNodesChange:H,onEdgesChange:z}=t.getState(),V=(p||[]).map(k=>k.id),F=(w||[]).map(k=>k.id),B=S().reduce((k,_)=>{const T=_.parentNode||_.parentId,D=!V.includes(_.id)&&T&&k.find(v=>v.id===T);return(typeof _.deletable=="boolean"?_.deletable:!0)&&(V.includes(_.id)||D)&&k.push(_),k},[]),L=E.filter(k=>typeof k.deletable=="boolean"?k.deletable:!0),h=L.filter(k=>F.includes(k.id));if(B||h){const k=Wo(B,L),_=[...h,...k],T=_.reduce((D,b)=>(D.includes(b.id)||D.push(b.id),D),[]);if((M||y)&&(M&&t.setState({edges:E.filter(D=>!T.includes(D.id))}),y&&(B.forEach(D=>{m.delete(D.id)}),t.setState({nodeInternals:new Map(m)}))),T.length>0&&(R==null||R(_),z&&z(T.map(D=>({id:D,type:"remove"})))),B.length>0&&(A==null||A(B),H)){const D=B.map(b=>({id:b.id,type:"remove"}));H(D)}}},[]),d=N.useCallback(p=>{const w=hu(p),m=w?null:t.getState().nodeInternals.get(p.id);return!w&&!m?[null,null,w]:[w?p:Fr(m),m,w]},[]),g=N.useCallback((p,w=!0,m)=>{const[S,E,y]=d(p);return S?(m||t.getState().getNodes()).filter(M=>{if(!y&&(M.id===E.id||!M.positionAbsolute))return!1;const A=Fr(M),R=Hn(A,S);return w&&R>0||R>=S.width*S.height}):[]},[]),x=N.useCallback((p,w,m=!0)=>{const[S]=d(p);if(!S)return!1;const E=Hn(S,w);return m&&E>0||E>=S.width*S.height},[]);return N.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:a,addNodes:l,addEdges:u,toObject:c,deleteElements:f,getIntersectingNodes:g,isNodeIntersecting:x}),[e,n,r,o,i,s,a,l,u,c,f,g,x])}const Wu={actInsideInputWithModifier:!1};var Gu=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=re(),{deleteElements:r}=ar(),o=Rt(e,Wu),i=Rt(t);N.useEffect(()=>{if(o){const{edges:s,getNodes:a}=n.getState(),l=a().filter(c=>c.selected),u=s.filter(c=>c.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[o]),N.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function Zu(e){const t=re();N.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=Kn(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",Ie.error004())),t.setState({width:o.width||500,height:o.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const cr={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ku=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,qt=e=>({x:e.x,y:e.y,zoom:e.k}),it=(e,t)=>e.target.closest(`.${t}`),Wr=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Gr=e=>{const t=e.ctrlKey&&on()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Qu=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Ju=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=Ge.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:f=!0,defaultViewport:d,translateExtent:g,minZoom:x,maxZoom:p,zoomActivationKeyCode:w,preventScrolling:m=!0,children:S,noWheelClassName:E,noPanClassName:y})=>{const M=N.useRef(),A=re(),R=N.useRef(!1),H=N.useRef(!1),z=N.useRef(null),V=N.useRef({x:0,y:0,zoom:0}),{d3Zoom:F,d3Selection:B,d3ZoomHandler:L,userSelectionActive:h}=J(Qu,ie),k=Rt(w),_=N.useRef(0),T=N.useRef(!1),D=N.useRef();return Zu(z),N.useEffect(()=>{if(z.current){const b=z.current.getBoundingClientRect(),v=su().scaleExtent([x,p]).translateExtent(g),I=ye(z.current).call(v),P=He.translate(d.x,d.y).scale(pt(d.zoom,x,p)),j=[[0,0],[b.width,b.height]],O=v.constrain()(P,j,g);v.transform(I,O),v.wheelDelta(Gr),A.setState({d3Zoom:v,d3Selection:I,d3ZoomHandler:I.on("wheel.zoom"),transform:[O.x,O.y,O.k],domNode:z.current.closest(".react-flow")})}},[]),N.useEffect(()=>{B&&F&&(s&&!k&&!h?B.on("wheel.zoom",b=>{if(it(b,E))return!1;b.preventDefault(),b.stopImmediatePropagation();const v=B.property("__zoom").k||1;if(b.ctrlKey&&i){const Z=Ee(b),ee=Gr(b),K=v*Math.pow(2,ee);F.scaleTo(B,K,Z,b);return}const I=b.deltaMode===1?20:1;let P=l===Ge.Vertical?0:b.deltaX*I,j=l===Ge.Horizontal?0:b.deltaY*I;!on()&&b.shiftKey&&l!==Ge.Vertical&&(P=b.deltaY*I,j=0),F.translateBy(B,-(P/v)*a,-(j/v)*a,{internal:!0});const O=qt(B.property("__zoom")),{onViewportChangeStart:U,onViewportChange:W,onViewportChangeEnd:G}=A.getState();clearTimeout(D.current),T.current||(T.current=!0,t==null||t(b,O),U==null||U(O)),T.current&&(e==null||e(b,O),W==null||W(O),D.current=setTimeout(()=>{n==null||n(b,O),G==null||G(O),T.current=!1},150))},{passive:!1}):typeof L<"u"&&B.on("wheel.zoom",function(b,v){if(!m&&b.type==="wheel"&&!b.ctrlKey||it(b,E))return null;b.preventDefault(),L.call(this,b,v)},{passive:!1}))},[h,s,l,B,F,L,k,i,m,E,t,e,n]),N.useEffect(()=>{F&&F.on("start",b=>{var P,j;if(!b.sourceEvent||b.sourceEvent.internal)return null;_.current=(P=b.sourceEvent)==null?void 0:P.button;const{onViewportChangeStart:v}=A.getState(),I=qt(b.transform);R.current=!0,V.current=I,((j=b.sourceEvent)==null?void 0:j.type)==="mousedown"&&A.setState({paneDragging:!0}),v==null||v(I),t==null||t(b.sourceEvent,I)})},[F,t]),N.useEffect(()=>{F&&(h&&!R.current?F.on("zoom",null):h||F.on("zoom",b=>{var I;const{onViewportChange:v}=A.getState();if(A.setState({transform:[b.transform.x,b.transform.y,b.transform.k]}),H.current=!!(r&&Wr(f,_.current??0)),(e||v)&&!((I=b.sourceEvent)!=null&&I.internal)){const P=qt(b.transform);v==null||v(P),e==null||e(b.sourceEvent,P)}}))},[h,F,e,f,r]),N.useEffect(()=>{F&&F.on("end",b=>{if(!b.sourceEvent||b.sourceEvent.internal)return null;const{onViewportChangeEnd:v}=A.getState();if(R.current=!1,A.setState({paneDragging:!1}),r&&Wr(f,_.current??0)&&!H.current&&r(b.sourceEvent),H.current=!1,(n||v)&&Ku(V.current,b.transform)){const I=qt(b.transform);V.current=I,clearTimeout(M.current),M.current=setTimeout(()=>{v==null||v(I),n==null||n(b.sourceEvent,I)},s?150:0)}})},[F,s,f,n,r]),N.useEffect(()=>{F&&F.filter(b=>{const v=k||o,I=i&&b.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&b.button===1&&b.type==="mousedown"&&(it(b,"react-flow__node")||it(b,"react-flow__edge")))return!0;if(!f&&!v&&!s&&!u&&!i||h||!u&&b.type==="dblclick"||it(b,E)&&b.type==="wheel"||it(b,y)&&(b.type!=="wheel"||s&&b.type==="wheel"&&!k)||!i&&b.ctrlKey&&b.type==="wheel"||!v&&!s&&!I&&b.type==="wheel"||!f&&(b.type==="mousedown"||b.type==="touchstart")||Array.isArray(f)&&!f.includes(b.button)&&b.type==="mousedown")return!1;const P=Array.isArray(f)&&f.includes(b.button)||!b.button||b.button<=1;return(!b.ctrlKey||b.type==="wheel")&&P})},[h,F,o,i,s,u,f,c,k]),C.createElement("div",{className:"react-flow__renderer",ref:z,style:cr},S)},ef=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function tf(){const{userSelectionActive:e,userSelectionRect:t}=J(ef,ie);return e&&t?C.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Zr(e,t){const n=t.parentNode||t.parentId,r=e.find(o=>o.id===n);if(r){const o=t.position.x+t.width-r.width,i=t.position.y+t.height-r.height;if(o>0||i>0||t.position.x<0||t.position.y<0){if(r.style={...r.style},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,o>0&&(r.style.width+=o),i>0&&(r.style.height+=i),t.position.x<0){const s=Math.abs(t.position.x);r.position.x=r.position.x-s,r.style.width+=s,t.position.x=0}if(t.position.y<0){const s=Math.abs(t.position.y);r.position.y=r.position.y-s,r.style.height+=s,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function fs(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,o)=>{const i=e.filter(a=>a.id===o.id);if(i.length===0)return r.push(o),r;const s={...o};for(const a of i)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&Zr(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&Zr(r,s);break}case"remove":return r}return r.push(s),r},n)}function ds(e,t){return fs(e,t)}function nf(e,t){return fs(e,t)}const Re=(e,t)=>({id:e,type:"select",selected:t});function ct(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Re(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Re(r.id,!1))),n},[])}const kn=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},rf=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),hs=N.memo(({isSelecting:e,selectionMode:t=zt.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:c,children:f})=>{const d=N.useRef(null),g=re(),x=N.useRef(0),p=N.useRef(0),w=N.useRef(),{userSelectionActive:m,elementsSelectable:S,dragging:E}=J(rf,ie),y=()=>{g.setState({userSelectionActive:!1,userSelectionRect:null}),x.current=0,p.current=0},M=L=>{i==null||i(L),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},A=L=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){L.preventDefault();return}s==null||s(L)},R=a?L=>a(L):void 0,H=L=>{const{resetSelectedElements:h,domNode:k}=g.getState();if(w.current=k==null?void 0:k.getBoundingClientRect(),!S||!e||L.button!==0||L.target!==d.current||!w.current)return;const{x:_,y:T}=Fe(L,w.current);h(),g.setState({userSelectionRect:{width:0,height:0,startX:_,startY:T,x:_,y:T}}),r==null||r(L)},z=L=>{const{userSelectionRect:h,nodeInternals:k,edges:_,transform:T,onNodesChange:D,onEdgesChange:b,nodeOrigin:v,getNodes:I}=g.getState();if(!e||!w.current||!h)return;g.setState({userSelectionActive:!0,nodesSelectionActive:!1});const P=Fe(L,w.current),j=h.startX??0,O=h.startY??0,U={...h,x:P.x<j?P.x:j,y:P.y<O?P.y:O,width:Math.abs(P.x-j),height:Math.abs(P.y-O)},W=I(),G=qo(k,U,T,t===zt.Partial,!0,v),Z=Wo(G,_).map(K=>K.id),ee=G.map(K=>K.id);if(x.current!==ee.length){x.current=ee.length;const K=ct(W,ee);K.length&&(D==null||D(K))}if(p.current!==Z.length){p.current=Z.length;const K=ct(_,Z);K.length&&(b==null||b(K))}g.setState({userSelectionRect:U})},V=L=>{if(L.button!==0)return;const{userSelectionRect:h}=g.getState();!m&&h&&L.target===d.current&&(M==null||M(L)),g.setState({nodesSelectionActive:x.current>0}),y(),o==null||o(L)},F=L=>{m&&(g.setState({nodesSelectionActive:x.current>0}),o==null||o(L)),y()},B=S&&(e||m);return C.createElement("div",{className:ae(["react-flow__pane",{dragging:E,selection:e}]),onClick:B?void 0:kn(M,d),onContextMenu:kn(A,d),onWheel:kn(R,d),onMouseEnter:B?void 0:l,onMouseDown:B?H:void 0,onMouseMove:B?z:u,onMouseUp:B?V:void 0,onMouseLeave:B?F:c,ref:d,style:cr},f,C.createElement(tf,null))});hs.displayName="Pane";function gs(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return r?r.selected?!0:gs(r,t):!1}function Kr(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function of(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||o.parentId||!gs(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var i,s;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((i=o.positionAbsolute)==null?void 0:i.x)??0),y:n.y-(((s=o.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode||o.parentId,parentId:o.parentNode||o.parentId,width:o.width,height:o.height,expandParent:o.expandParent}})}function sf(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function ps(e,t,n,r,o=[0,0],i){const s=sf(e,e.extent||r);let a=s;const l=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(l&&e.width&&e.height){const f=n.get(l),{x:d,y:g}=ft(f,o).positionAbsolute;a=f&&he(d)&&he(g)&&he(f.width)&&he(f.height)?[[d+e.width*o[0],g+e.height*o[1]],[d+f.width-e.width+e.width*o[0],g+f.height-e.height+e.height*o[1]]]:a}else i==null||i("005",Ie.error005()),a=s;else if(e.extent&&l&&e.extent!=="parent"){const f=n.get(l),{x:d,y:g}=ft(f,o).positionAbsolute;a=[[e.extent[0][0]+d,e.extent[0][1]+g],[e.extent[1][0]+d,e.extent[1][1]+g]]}let u={x:0,y:0};if(l){const f=n.get(l);u=ft(f,o).positionAbsolute}const c=a&&a!=="parent"?Qn(t,a):t;return{position:{x:c.x-u.x,y:c.y-u.y},positionAbsolute:c}}function An({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(o=>({...n.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?r.find(o=>o.id===e):r[0],r]}const Qr=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return i.map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(u.left-s.left-a.x)/n,y:(u.top-s.top-a.y)/n,...Kn(l)}})};function Et(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function On({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:a,onError:l}=t.getState(),u=a.get(e);if(!u){l==null||l("012",Ie.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):o([e])}function af(){const e=re();return N.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,l={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(l.x/o[0]):l.x,ySnapped:i?o[1]*Math.round(l.y/o[1]):l.y,...l}},[])}function Cn(e){return(t,n,r)=>e==null?void 0:e(t,r)}function ms({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const a=re(),[l,u]=N.useState(!1),c=N.useRef([]),f=N.useRef({x:null,y:null}),d=N.useRef(0),g=N.useRef(null),x=N.useRef({x:0,y:0}),p=N.useRef(null),w=N.useRef(!1),m=N.useRef(!1),S=N.useRef(!1),E=af();return N.useEffect(()=>{if(e!=null&&e.current){const y=ye(e.current),M=({x:H,y:z})=>{const{nodeInternals:V,onNodeDrag:F,onSelectionDrag:B,updateNodePositions:L,nodeExtent:h,snapGrid:k,snapToGrid:_,nodeOrigin:T,onError:D}=a.getState();f.current={x:H,y:z};let b=!1,v={x:0,y:0,x2:0,y2:0};if(c.current.length>1&&h){const P=or(c.current,T);v=Jn(P)}if(c.current=c.current.map(P=>{const j={x:H-P.distance.x,y:z-P.distance.y};_&&(j.x=k[0]*Math.round(j.x/k[0]),j.y=k[1]*Math.round(j.y/k[1]));const O=[[h[0][0],h[0][1]],[h[1][0],h[1][1]]];c.current.length>1&&h&&!P.extent&&(O[0][0]=P.positionAbsolute.x-v.x+h[0][0],O[1][0]=P.positionAbsolute.x+(P.width??0)-v.x2+h[1][0],O[0][1]=P.positionAbsolute.y-v.y+h[0][1],O[1][1]=P.positionAbsolute.y+(P.height??0)-v.y2+h[1][1]);const U=ps(P,j,V,O,T,D);return b=b||P.position.x!==U.position.x||P.position.y!==U.position.y,P.position=U.position,P.positionAbsolute=U.positionAbsolute,P}),!b)return;L(c.current,!0,!0),u(!0);const I=o?F:Cn(B);if(I&&p.current){const[P,j]=An({nodeId:o,dragItems:c.current,nodeInternals:V});I(p.current,P,j)}},A=()=>{if(!g.current)return;const[H,z]=Fo(x.current,g.current);if(H!==0||z!==0){const{transform:V,panBy:F}=a.getState();f.current.x=(f.current.x??0)-H/V[2],f.current.y=(f.current.y??0)-z/V[2],F({x:H,y:z})&&M(f.current)}d.current=requestAnimationFrame(A)},R=H=>{var T;const{nodeInternals:z,multiSelectionActive:V,nodesDraggable:F,unselectNodesAndEdges:B,onNodeDragStart:L,onSelectionDragStart:h}=a.getState();m.current=!0;const k=o?L:Cn(h);(!s||!i)&&!V&&o&&((T=z.get(o))!=null&&T.selected||B()),o&&i&&s&&On({id:o,store:a,nodeRef:e});const _=E(H);if(f.current=_,c.current=of(z,F,_,o),k&&c.current){const[D,b]=An({nodeId:o,dragItems:c.current,nodeInternals:z});k(H.sourceEvent,D,b)}};if(t)y.on(".drag",null);else{const H=pc().on("start",z=>{const{domNode:V,nodeDragThreshold:F}=a.getState();F===0&&R(z),S.current=!1;const B=E(z);f.current=B,g.current=(V==null?void 0:V.getBoundingClientRect())||null,x.current=Fe(z.sourceEvent,g.current)}).on("drag",z=>{var L,h;const V=E(z),{autoPanOnNodeDrag:F,nodeDragThreshold:B}=a.getState();if(z.sourceEvent.type==="touchmove"&&z.sourceEvent.touches.length>1&&(S.current=!0),!S.current){if(!w.current&&m.current&&F&&(w.current=!0,A()),!m.current){const k=V.xSnapped-(((L=f==null?void 0:f.current)==null?void 0:L.x)??0),_=V.ySnapped-(((h=f==null?void 0:f.current)==null?void 0:h.y)??0);Math.sqrt(k*k+_*_)>B&&R(z)}(f.current.x!==V.xSnapped||f.current.y!==V.ySnapped)&&c.current&&m.current&&(p.current=z.sourceEvent,x.current=Fe(z.sourceEvent,g.current),M(V))}}).on("end",z=>{if(!(!m.current||S.current)&&(u(!1),w.current=!1,m.current=!1,cancelAnimationFrame(d.current),c.current)){const{updateNodePositions:V,nodeInternals:F,onNodeDragStop:B,onSelectionDragStop:L}=a.getState(),h=o?B:Cn(L);if(V(c.current,!1,!1),h){const[k,_]=An({nodeId:o,dragItems:c.current,nodeInternals:F});h(z.sourceEvent,k,_)}}}).filter(z=>{const V=z.target;return!z.button&&(!n||!Kr(V,`.${n}`,e))&&(!r||Kr(V,r,e))});return y.call(H),()=>{y.on(".drag",null)}}}},[e,t,n,r,i,a,o,s,E]),l}function ys(){const e=re();return N.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:l,onError:u,nodesDraggable:c}=e.getState(),f=s().filter(S=>S.selected&&(S.draggable||c&&typeof S.draggable>"u")),d=a?l[0]:5,g=a?l[1]:5,x=n.isShiftPressed?4:1,p=n.x*d*x,w=n.y*g*x,m=f.map(S=>{if(S.positionAbsolute){const E={x:S.positionAbsolute.x+p,y:S.positionAbsolute.y+w};a&&(E.x=l[0]*Math.round(E.x/l[0]),E.y=l[1]*Math.round(E.y/l[1]));const{positionAbsolute:y,position:M}=ps(S,E,r,o,void 0,u);S.position=M,S.positionAbsolute=y}return S});i(m,!0,!1)},[])}const dt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var St=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:u,onClick:c,onMouseEnter:f,onMouseMove:d,onMouseLeave:g,onContextMenu:x,onDoubleClick:p,style:w,className:m,isDraggable:S,isSelectable:E,isConnectable:y,isFocusable:M,selectNodesOnDrag:A,sourcePosition:R,targetPosition:H,hidden:z,resizeObserver:V,dragHandle:F,zIndex:B,isParent:L,noDragClassName:h,noPanClassName:k,initialized:_,disableKeyboardA11y:T,ariaLabel:D,rfId:b,hasHandleBounds:v})=>{const I=re(),P=N.useRef(null),j=N.useRef(null),O=N.useRef(R),U=N.useRef(H),W=N.useRef(r),G=E||S||c||f||d||g,Z=ys(),ee=Et(n,I.getState,f),K=Et(n,I.getState,d),ge=Et(n,I.getState,g),fe=Et(n,I.getState,x),pe=Et(n,I.getState,p),de=Q=>{const{nodeDragThreshold:Y}=I.getState();if(E&&(!A||!S||Y>0)&&On({id:n,store:I,nodeRef:P}),c){const le=I.getState().nodeInternals.get(n);le&&c(Q,{...le})}},ne=Q=>{if(!Fn(Q)&&!T)if(Lo.includes(Q.key)&&E){const Y=Q.key==="Escape";On({id:n,store:I,unselect:Y,nodeRef:P})}else S&&u&&Object.prototype.hasOwnProperty.call(dt,Q.key)&&(I.setState({ariaLiveMessage:`Moved selected node ${Q.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),Z({x:dt[Q.key].x,y:dt[Q.key].y,isShiftPressed:Q.shiftKey}))};N.useEffect(()=>()=>{j.current&&(V==null||V.unobserve(j.current),j.current=null)},[]),N.useEffect(()=>{if(P.current&&!z){const Q=P.current;(!_||!v||j.current!==Q)&&(j.current&&(V==null||V.unobserve(j.current)),V==null||V.observe(Q),j.current=Q)}},[z,_,v]),N.useEffect(()=>{const Q=W.current!==r,Y=O.current!==R,le=U.current!==H;P.current&&(Q||Y||le)&&(Q&&(W.current=r),Y&&(O.current=R),le&&(U.current=H),I.getState().updateNodeDimensions([{id:n,nodeElement:P.current,forceUpdate:!0}]))},[n,r,R,H]);const be=ms({nodeRef:P,disabled:z||!S,noDragClassName:h,handleSelector:F,nodeId:n,isSelectable:E,selectNodesOnDrag:A});return z?null:C.createElement("div",{className:ae(["react-flow__node",`react-flow__node-${r}`,{[k]:S},m,{selected:u,selectable:E,parent:L,dragging:be}]),ref:P,style:{zIndex:B,transform:`translate(${a}px,${l}px)`,pointerEvents:G?"all":"none",visibility:_?"visible":"hidden",...w},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:ee,onMouseMove:K,onMouseLeave:ge,onContextMenu:fe,onClick:de,onDoubleClick:pe,onKeyDown:M?ne:void 0,tabIndex:M?0:void 0,role:M?"button":void 0,"aria-describedby":T?void 0:`${is}-${b}`,"aria-label":D},C.createElement(vu,{value:n},C.createElement(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:u,isConnectable:y,sourcePosition:R,targetPosition:H,dragging:be,dragHandle:F,zIndex:B})))};return t.displayName="NodeWrapper",N.memo(t)};const cf=e=>{const t=e.getNodes().filter(n=>n.selected);return{...or(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function lf({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=re(),{width:o,height:i,x:s,y:a,transformString:l,userSelectionActive:u}=J(cf,ie),c=ys(),f=N.useRef(null);if(N.useEffect(()=>{var x;n||(x=f.current)==null||x.focus({preventScroll:!0})},[n]),ms({nodeRef:f}),u||!o||!i)return null;const d=e?x=>{const p=r.getState().getNodes().filter(w=>w.selected);e(x,p)}:void 0,g=x=>{Object.prototype.hasOwnProperty.call(dt,x.key)&&c({x:dt[x.key].x,y:dt[x.key].y,isShiftPressed:x.shiftKey})};return C.createElement("div",{className:ae(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l}},C.createElement("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:o,height:i,top:a,left:s}}))}var uf=N.memo(lf);const ff=e=>e.nodesSelectionActive,xs=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:u,onMoveEnd:c,selectionKeyCode:f,selectionOnDrag:d,selectionMode:g,onSelectionStart:x,onSelectionEnd:p,multiSelectionKeyCode:w,panActivationKeyCode:m,zoomActivationKeyCode:S,elementsSelectable:E,zoomOnScroll:y,zoomOnPinch:M,panOnScroll:A,panOnScrollSpeed:R,panOnScrollMode:H,zoomOnDoubleClick:z,panOnDrag:V,defaultViewport:F,translateExtent:B,minZoom:L,maxZoom:h,preventScrolling:k,onSelectionContextMenu:_,noWheelClassName:T,noPanClassName:D,disableKeyboardA11y:b})=>{const v=J(ff),I=Rt(f),P=Rt(m),j=P||V,O=P||A,U=I||d&&j!==!0;return Gu({deleteKeyCode:a,multiSelectionKeyCode:w}),C.createElement(Ju,{onMove:l,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:i,elementsSelectable:E,zoomOnScroll:y,zoomOnPinch:M,panOnScroll:O,panOnScrollSpeed:R,panOnScrollMode:H,zoomOnDoubleClick:z,panOnDrag:!I&&j,defaultViewport:F,translateExtent:B,minZoom:L,maxZoom:h,zoomActivationKeyCode:S,preventScrolling:k,noWheelClassName:T,noPanClassName:D},C.createElement(hs,{onSelectionStart:x,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:j,isSelecting:!!U,selectionMode:g},e,v&&C.createElement(uf,{onSelectionContextMenu:_,noPanClassName:D,disableKeyboardA11y:b})))};xs.displayName="FlowRenderer";var df=N.memo(xs);function hf(e){return J(N.useCallback(n=>e?qo(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function gf(e){const t={input:St(e.input||ns),default:St(e.default||jn),output:St(e.output||os),group:St(e.group||ir)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=St(e[i]||jn),o),n);return{...t,...r}}const pf=({x:e,y:t,width:n,height:r,origin:o})=>!n||!r?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]},mf=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),ws=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=J(mf,ie),a=hf(e.onlyRenderVisibleElements),l=N.useRef(),u=N.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(f=>{const d=f.map(g=>({id:g.target.getAttribute("data-id"),nodeElement:g.target,forceUpdate:!0}));i(d)});return l.current=c,c},[]);return N.useEffect(()=>()=>{var c;(c=l==null?void 0:l.current)==null||c.disconnect()},[]),C.createElement("div",{className:"react-flow__nodes",style:cr},a.map(c=>{var M,A,R;let f=c.type||"default";e.nodeTypes[f]||(s==null||s("003",Ie.error003(f)),f="default");const d=e.nodeTypes[f]||e.nodeTypes.default,g=!!(c.draggable||t&&typeof c.draggable>"u"),x=!!(c.selectable||o&&typeof c.selectable>"u"),p=!!(c.connectable||n&&typeof c.connectable>"u"),w=!!(c.focusable||r&&typeof c.focusable>"u"),m=e.nodeExtent?Qn(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,S=(m==null?void 0:m.x)??0,E=(m==null?void 0:m.y)??0,y=pf({x:S,y:E,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return C.createElement(d,{key:c.id,id:c.id,className:c.className,style:c.style,type:f,data:c.data,sourcePosition:c.sourcePosition||X.Bottom,targetPosition:c.targetPosition||X.Top,hidden:c.hidden,xPos:S,yPos:E,xPosOrigin:y.x,yPosOrigin:y.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:g,isSelectable:x,isConnectable:p,isFocusable:w,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((M=c[te])==null?void 0:M.z)??0,isParent:!!((A=c[te])!=null&&A.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel,hasHandleBounds:!!((R=c[te])!=null&&R.handleBounds)})}))};ws.displayName="NodeRenderer";var yf=N.memo(ws);const xf=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,wf=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,Jr="react-flow__edgeupdater",eo=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a})=>C.createElement("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:ae([Jr,`${Jr}-${a}`]),cx:xf(t,r,e),cy:wf(n,r,e),r,stroke:"transparent",fill:"transparent"}),vf=()=>!0;var at=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:a,selected:l,animated:u,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:p,style:w,source:m,target:S,sourceX:E,sourceY:y,targetX:M,targetY:A,sourcePosition:R,targetPosition:H,elementsSelectable:z,hidden:V,sourceHandleId:F,targetHandleId:B,onContextMenu:L,onMouseEnter:h,onMouseMove:k,onMouseLeave:_,reconnectRadius:T,onReconnect:D,onReconnectStart:b,onReconnectEnd:v,markerEnd:I,markerStart:P,rfId:j,ariaLabel:O,isFocusable:U,isReconnectable:W,pathOptions:G,interactionWidth:Z,disableKeyboardA11y:ee})=>{const K=N.useRef(null),[ge,fe]=N.useState(!1),[pe,de]=N.useState(!1),ne=re(),be=N.useMemo(()=>`url('#${Ln(P,j)}')`,[P,j]),Q=N.useMemo(()=>`url('#${Ln(I,j)}')`,[I,j]);if(V)return null;const Y=se=>{var _e;const{edges:me,addSelectedEdges:Oe,unselectNodesAndEdges:Xe,multiSelectionActive:Ye}=ne.getState(),Ae=me.find(xt=>xt.id===n);Ae&&(z&&(ne.setState({nodesSelectionActive:!1}),Ae.selected&&Ye?(Xe({nodes:[],edges:[Ae]}),(_e=K.current)==null||_e.blur()):Oe([n])),s&&s(se,Ae))},le=_t(n,ne.getState,a),Le=_t(n,ne.getState,L),mt=_t(n,ne.getState,h),Je=_t(n,ne.getState,k),et=_t(n,ne.getState,_),ke=(se,me)=>{if(se.button!==0)return;const{edges:Oe,isValidConnection:Xe}=ne.getState(),Ye=me?S:m,Ae=(me?B:F)||null,_e=me?"target":"source",xt=Xe||vf,hn=me,wt=Oe.find(Ue=>Ue.id===n);de(!0),b==null||b(se,wt,_e);const gn=Ue=>{de(!1),v==null||v(Ue,wt,_e)};Qo({event:se,handleId:Ae,nodeId:Ye,onConnect:Ue=>D==null?void 0:D(wt,Ue),isTarget:hn,getState:ne.getState,setState:ne.setState,isValidConnection:xt,edgeUpdaterType:_e,onReconnectEnd:gn})},tt=se=>ke(se,!0),Be=se=>ke(se,!1),je=()=>fe(!0),nt=()=>fe(!1),rt=!z&&!s,yt=se=>{var me;if(!ee&&Lo.includes(se.key)&&z){const{unselectNodesAndEdges:Oe,addSelectedEdges:Xe,edges:Ye}=ne.getState();se.key==="Escape"?((me=K.current)==null||me.blur(),Oe({edges:[Ye.find(_e=>_e.id===n)]})):Xe([n])}};return C.createElement("g",{className:ae(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:l,animated:u,inactive:rt,updating:ge}]),onClick:Y,onDoubleClick:le,onContextMenu:Le,onMouseEnter:mt,onMouseMove:Je,onMouseLeave:et,onKeyDown:U?yt:void 0,tabIndex:U?0:void 0,role:U?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":O===null?void 0:O||`Edge from ${m} to ${S}`,"aria-describedby":U?`${as}-${j}`:void 0,ref:K},!pe&&C.createElement(e,{id:n,source:m,target:S,selected:l,animated:u,label:c,labelStyle:f,labelShowBg:d,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:p,data:i,style:w,sourceX:E,sourceY:y,targetX:M,targetY:A,sourcePosition:R,targetPosition:H,sourceHandleId:F,targetHandleId:B,markerStart:be,markerEnd:Q,pathOptions:G,interactionWidth:Z}),W&&C.createElement(C.Fragment,null,(W==="source"||W===!0)&&C.createElement(eo,{position:R,centerX:E,centerY:y,radius:T,onMouseDown:tt,onMouseEnter:je,onMouseOut:nt,type:"source"}),(W==="target"||W===!0)&&C.createElement(eo,{position:H,centerX:M,centerY:A,radius:T,onMouseDown:Be,onMouseEnter:je,onMouseOut:nt,type:"target"})))};return t.displayName="EdgeWrapper",N.memo(t)};function bf(e){const t={default:at(e.default||sn),straight:at(e.bezier||nr),step:at(e.step||tr),smoothstep:at(e.step||dn),simplebezier:at(e.simplebezier||er)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=at(e[i]||sn),o),n);return{...t,...r}}function to(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,o=((n==null?void 0:n.y)||0)+t.y,i=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case X.Top:return{x:r+i/2,y:o};case X.Right:return{x:r+i,y:o+s/2};case X.Bottom:return{x:r+i/2,y:o+s};case X.Left:return{x:r,y:o+s/2}}}function no(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const _f=(e,t,n,r,o,i)=>{const s=to(n,e,t),a=to(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function Ef({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:a,transform:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=Jn({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),f=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),d=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(f*d)>0}function ro(e){var r,o,i,s,a;const t=((r=e==null?void 0:e[te])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const Sf=[{level:0,isMaxLevel:!0,edges:[]}];function Nf(e,t,n=!1){let r=-1;const o=e.reduce((s,a)=>{var c,f;const l=he(a.zIndex);let u=l?a.zIndex:0;if(n){const d=t.get(a.target),g=t.get(a.source),x=a.selected||(d==null?void 0:d.selected)||(g==null?void 0:g.selected),p=Math.max(((c=g==null?void 0:g[te])==null?void 0:c.z)||0,((f=d==null?void 0:d[te])==null?void 0:f.z)||0,1e3);u=(l?a.zIndex:0)+(x?p:0)}return s[u]?s[u].push(a):s[u]=[a],r=u>r?u:r,s},{}),i=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return i.length===0?Sf:i}function kf(e,t,n){const r=J(N.useCallback(o=>e?o.edges.filter(i=>{const s=t.get(i.source),a=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&Ef({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return Nf(r,t,n)}const Af=({color:e="none",strokeWidth:t=1})=>C.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),Cf=({color:e="none",strokeWidth:t=1})=>C.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),oo={[Pt.Arrow]:Af,[Pt.ArrowClosed]:Cf};function Mf(e){const t=re();return N.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(oo,e)?oo[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Ie.error009(e)),null)},[e])}const $f=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=Mf(t);return l?C.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0"},C.createElement(l,{color:n,strokeWidth:s})):null},If=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=Ln(s,t);r.includes(a)||(o.push({id:a,color:s.color||e,...s}),r.push(a))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},vs=({defaultColor:e,rfId:t})=>{const n=J(N.useCallback(If({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return C.createElement("defs",null,n.map(r=>C.createElement($f,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};vs.displayName="MarkerDefinitions";var Tf=N.memo(vs);const zf=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),bs=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:c,onEdgeDoubleClick:f,onReconnect:d,onReconnectStart:g,onReconnectEnd:x,reconnectRadius:p,children:w,disableKeyboardA11y:m})=>{const{edgesFocusable:S,edgesUpdatable:E,elementsSelectable:y,width:M,height:A,connectionMode:R,nodeInternals:H,onError:z}=J(zf,ie),V=kf(t,H,n);return M?C.createElement(C.Fragment,null,V.map(({level:F,edges:B,isMaxLevel:L})=>C.createElement("svg",{key:F,style:{zIndex:F},width:M,height:A,className:"react-flow__edges react-flow__container"},L&&C.createElement(Tf,{defaultColor:e,rfId:r}),C.createElement("g",null,B.map(h=>{const[k,_,T]=ro(H.get(h.source)),[D,b,v]=ro(H.get(h.target));if(!T||!v)return null;let I=h.type||"default";o[I]||(z==null||z("011",Ie.error011(I)),I="default");const P=o[I]||o.default,j=R===Qe.Strict?b.target:(b.target??[]).concat(b.source??[]),O=no(_.source,h.sourceHandle),U=no(j,h.targetHandle),W=(O==null?void 0:O.position)||X.Bottom,G=(U==null?void 0:U.position)||X.Top,Z=!!(h.focusable||S&&typeof h.focusable>"u"),ee=h.reconnectable||h.updatable,K=typeof d<"u"&&(ee||E&&typeof ee>"u");if(!O||!U)return z==null||z("008",Ie.error008(O,h)),null;const{sourceX:ge,sourceY:fe,targetX:pe,targetY:de}=_f(k,O,W,D,U,G);return C.createElement(P,{key:h.id,id:h.id,className:ae([h.className,i]),type:I,data:h.data,selected:!!h.selected,animated:!!h.animated,hidden:!!h.hidden,label:h.label,labelStyle:h.labelStyle,labelShowBg:h.labelShowBg,labelBgStyle:h.labelBgStyle,labelBgPadding:h.labelBgPadding,labelBgBorderRadius:h.labelBgBorderRadius,style:h.style,source:h.source,target:h.target,sourceHandleId:h.sourceHandle,targetHandleId:h.targetHandle,markerEnd:h.markerEnd,markerStart:h.markerStart,sourceX:ge,sourceY:fe,targetX:pe,targetY:de,sourcePosition:W,targetPosition:G,elementsSelectable:y,onContextMenu:s,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,onClick:c,onEdgeDoubleClick:f,onReconnect:d,onReconnectStart:g,onReconnectEnd:x,reconnectRadius:p,rfId:r,ariaLabel:h.ariaLabel,isFocusable:Z,isReconnectable:K,pathOptions:"pathOptions"in h?h.pathOptions:void 0,interactionWidth:h.interactionWidth,disableKeyboardA11y:m})})))),w):null};bs.displayName="EdgeRenderer";var Pf=N.memo(bs);const Rf=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Df({children:e}){const t=J(Rf);return C.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function Hf(e){const t=ar(),n=N.useRef(!1);N.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Ff={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top},_s=({nodeId:e,handleType:t,style:n,type:r=De.Bezier,CustomComponent:o,connectionStatus:i})=>{var A,R,H;const{fromNode:s,handleId:a,toX:l,toY:u,connectionMode:c}=J(N.useCallback(z=>({fromNode:z.nodeInternals.get(e),handleId:z.connectionHandleId,toX:(z.connectionPosition.x-z.transform[0])/z.transform[2],toY:(z.connectionPosition.y-z.transform[1])/z.transform[2],connectionMode:z.connectionMode}),[e]),ie),f=(A=s==null?void 0:s[te])==null?void 0:A.handleBounds;let d=f==null?void 0:f[t];if(c===Qe.Loose&&(d=d||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!d)return null;const g=a?d.find(z=>z.id===a):d[0],x=g?g.x+g.width/2:(s.width??0)/2,p=g?g.y+g.height/2:s.height??0,w=(((R=s.positionAbsolute)==null?void 0:R.x)??0)+x,m=(((H=s.positionAbsolute)==null?void 0:H.y)??0)+p,S=g==null?void 0:g.position,E=S?Ff[S]:null;if(!S||!E)return null;if(o)return C.createElement(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:g,fromX:w,fromY:m,toX:l,toY:u,fromPosition:S,toPosition:E,connectionStatus:i});let y="";const M={sourceX:w,sourceY:m,sourcePosition:S,targetX:l,targetY:u,targetPosition:E};return r===De.Bezier?[y]=Yo(M):r===De.Step?[y]=Vn({...M,borderRadius:0}):r===De.SmoothStep?[y]=Vn(M):r===De.SimpleBezier?[y]=Xo(M):y=`M${w},${m} ${l},${u}`,C.createElement("path",{d:y,fill:"none",className:"react-flow__connection-path",style:n})};_s.displayName="ConnectionLine";const Vf=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Lf({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:a,height:l,connectionStatus:u}=J(Vf,ie);return!(o&&i&&a&&s)?null:C.createElement("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container"},C.createElement("g",{className:ae(["react-flow__connection",u])},C.createElement(_s,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u})))}function so(e,t){return N.useRef(null),re(),N.useMemo(()=>t(e),[e])}const Es=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:g,onSelectionContextMenu:x,onSelectionStart:p,onSelectionEnd:w,connectionLineType:m,connectionLineStyle:S,connectionLineComponent:E,connectionLineContainerStyle:y,selectionKeyCode:M,selectionOnDrag:A,selectionMode:R,multiSelectionKeyCode:H,panActivationKeyCode:z,zoomActivationKeyCode:V,deleteKeyCode:F,onlyRenderVisibleElements:B,elementsSelectable:L,selectNodesOnDrag:h,defaultViewport:k,translateExtent:_,minZoom:T,maxZoom:D,preventScrolling:b,defaultMarkerColor:v,zoomOnScroll:I,zoomOnPinch:P,panOnScroll:j,panOnScrollSpeed:O,panOnScrollMode:U,zoomOnDoubleClick:W,panOnDrag:G,onPaneClick:Z,onPaneMouseEnter:ee,onPaneMouseMove:K,onPaneMouseLeave:ge,onPaneScroll:fe,onPaneContextMenu:pe,onEdgeContextMenu:de,onEdgeMouseEnter:ne,onEdgeMouseMove:be,onEdgeMouseLeave:Q,onReconnect:Y,onReconnectStart:le,onReconnectEnd:Le,reconnectRadius:mt,noDragClassName:Je,noWheelClassName:et,noPanClassName:ke,elevateEdgesOnSelect:tt,disableKeyboardA11y:Be,nodeOrigin:je,nodeExtent:nt,rfId:rt})=>{const yt=so(e,gf),se=so(t,bf);return Hf(i),C.createElement(df,{onPaneClick:Z,onPaneMouseEnter:ee,onPaneMouseMove:K,onPaneMouseLeave:ge,onPaneContextMenu:pe,onPaneScroll:fe,deleteKeyCode:F,selectionKeyCode:M,selectionOnDrag:A,selectionMode:R,onSelectionStart:p,onSelectionEnd:w,multiSelectionKeyCode:H,panActivationKeyCode:z,zoomActivationKeyCode:V,elementsSelectable:L,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:I,zoomOnPinch:P,zoomOnDoubleClick:W,panOnScroll:j,panOnScrollSpeed:O,panOnScrollMode:U,panOnDrag:G,defaultViewport:k,translateExtent:_,minZoom:T,maxZoom:D,onSelectionContextMenu:x,preventScrolling:b,noDragClassName:Je,noWheelClassName:et,noPanClassName:ke,disableKeyboardA11y:Be},C.createElement(Df,null,C.createElement(Pf,{edgeTypes:se,onEdgeClick:a,onEdgeDoubleClick:u,onlyRenderVisibleElements:B,onEdgeContextMenu:de,onEdgeMouseEnter:ne,onEdgeMouseMove:be,onEdgeMouseLeave:Q,onReconnect:Y,onReconnectStart:le,onReconnectEnd:Le,reconnectRadius:mt,defaultMarkerColor:v,noPanClassName:ke,elevateEdgesOnSelect:!!tt,disableKeyboardA11y:Be,rfId:rt},C.createElement(Lf,{style:S,type:m,component:E,containerStyle:y})),C.createElement("div",{className:"react-flow__edgelabel-renderer"}),C.createElement(yf,{nodeTypes:yt,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:g,selectNodesOnDrag:h,onlyRenderVisibleElements:B,noPanClassName:ke,noDragClassName:Je,disableKeyboardA11y:Be,nodeOrigin:je,nodeExtent:nt,rfId:rt})))};Es.displayName="GraphView";var Bf=N.memo(Es);const Xn=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ze={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Xn,nodeExtent:Xn,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Qe.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:gu,isValidConnection:void 0},jf=()=>Ai((e,t)=>({...ze,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Nn(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(o=>({...r,...o}))})},setDefaultNodesAndEdges:(n,r)=>{const o=typeof n<"u",i=typeof r<"u",s=o?Nn(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:l,nodeOrigin:u}=t(),c=l==null?void 0:l.querySelector(".react-flow__viewport");if(!c)return;const f=window.getComputedStyle(c),{m22:d}=new window.DOMMatrixReadOnly(f.transform),g=n.reduce((p,w)=>{const m=o.get(w.id);if(m!=null&&m.hidden)o.set(m.id,{...m,[te]:{...m[te],handleBounds:void 0}});else if(m){const S=Kn(w.nodeElement);!!(S.width&&S.height&&(m.width!==S.width||m.height!==S.height||w.forceUpdate))&&(o.set(m.id,{...m,[te]:{...m[te],handleBounds:{source:Qr(".source",w.nodeElement,d,u),target:Qr(".target",w.nodeElement,d,u)}},...S}),p.push({id:m.id,type:"dimensions",dimensions:S}))}return p},[]);ls(o,u);const x=s||i&&!s&&us(t,{initial:!0,...a});e({nodeInternals:new Map(o),fitViewOnInitDone:x}),(g==null?void 0:g.length)>0&&(r==null||r(g))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(a=>{const l={id:a.id,type:"position",dragging:o};return r&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(i){const u=ds(n,a()),c=Nn(u,o,s,l);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>Re(l,!0)):(s=ct(i(),n),a=ct(o,[])),Ut({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>Re(l,!0)):(s=ct(o,n),a=ct(i(),[])),Ut({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),s=n||i(),a=r||o,l=s.map(c=>(c.selected=!1,Re(c.id,!1))),u=a.map(c=>Re(c.id,!1));Ut({changedNodes:l,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r==null||r.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r==null||r.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),i=r().filter(a=>a.selected).map(a=>Re(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Re(a.id,!1));Ut({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=Qn(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:i,d3Zoom:s,d3Selection:a,translateExtent:l}=t();if(!s||!a||!n.x&&!n.y)return!1;const u=He.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[o,i]],f=s==null?void 0:s.constrain()(u,c,l);return s.transform(a,f),r[0]!==f.x||r[1]!==f.y||r[2]!==f.k},cancelConnection:()=>e({connectionNodeId:ze.connectionNodeId,connectionHandleId:ze.connectionHandleId,connectionHandleType:ze.connectionHandleType,connectionStatus:ze.connectionStatus,connectionStartHandle:ze.connectionStartHandle,connectionEndHandle:ze.connectionEndHandle}),reset:()=>e({...ze})}),Object.is),Ss=({children:e})=>{const t=N.useRef(null);return t.current||(t.current=jf()),C.createElement(iu,{value:t.current},e)};Ss.displayName="ReactFlowProvider";const Ns=({children:e})=>N.useContext(fn)?C.createElement(C.Fragment,null,e):C.createElement(Ss,null,e);Ns.displayName="ReactFlowWrapper";const Of={input:ns,default:jn,output:os,group:ir},Xf={default:sn,straight:nr,step:tr,smoothstep:dn,simplebezier:er},Yf=[0,0],Uf=[15,15],qf={x:0,y:0,zoom:1},Wf={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},ks=N.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=Of,edgeTypes:s=Xf,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:f,onMoveEnd:d,onConnect:g,onConnectStart:x,onConnectEnd:p,onClickConnectStart:w,onClickConnectEnd:m,onNodeMouseEnter:S,onNodeMouseMove:E,onNodeMouseLeave:y,onNodeContextMenu:M,onNodeDoubleClick:A,onNodeDragStart:R,onNodeDrag:H,onNodeDragStop:z,onNodesDelete:V,onEdgesDelete:F,onSelectionChange:B,onSelectionDragStart:L,onSelectionDrag:h,onSelectionDragStop:k,onSelectionContextMenu:_,onSelectionStart:T,onSelectionEnd:D,connectionMode:b=Qe.Strict,connectionLineType:v=De.Bezier,connectionLineStyle:I,connectionLineComponent:P,connectionLineContainerStyle:j,deleteKeyCode:O="Backspace",selectionKeyCode:U="Shift",selectionOnDrag:W=!1,selectionMode:G=zt.Full,panActivationKeyCode:Z="Space",multiSelectionKeyCode:ee=on()?"Meta":"Control",zoomActivationKeyCode:K=on()?"Meta":"Control",snapToGrid:ge=!1,snapGrid:fe=Uf,onlyRenderVisibleElements:pe=!1,selectNodesOnDrag:de=!0,nodesDraggable:ne,nodesConnectable:be,nodesFocusable:Q,nodeOrigin:Y=Yf,edgesFocusable:le,edgesUpdatable:Le,elementsSelectable:mt,defaultViewport:Je=qf,minZoom:et=.5,maxZoom:ke=2,translateExtent:tt=Xn,preventScrolling:Be=!0,nodeExtent:je,defaultMarkerColor:nt="#b1b1b7",zoomOnScroll:rt=!0,zoomOnPinch:yt=!0,panOnScroll:se=!1,panOnScrollSpeed:me=.5,panOnScrollMode:Oe=Ge.Free,zoomOnDoubleClick:Xe=!0,panOnDrag:Ye=!0,onPaneClick:Ae,onPaneMouseEnter:_e,onPaneMouseMove:xt,onPaneMouseLeave:hn,onPaneScroll:wt,onPaneContextMenu:gn,children:lr,onEdgeContextMenu:Ue,onEdgeDoubleClick:Ts,onEdgeMouseEnter:zs,onEdgeMouseMove:Ps,onEdgeMouseLeave:Rs,onEdgeUpdate:Ds,onEdgeUpdateStart:Hs,onEdgeUpdateEnd:Fs,onReconnect:Vs,onReconnectStart:Ls,onReconnectEnd:Bs,reconnectRadius:js=10,edgeUpdaterRadius:Os=10,onNodesChange:Xs,onEdgesChange:Ys,noDragClassName:Us="nodrag",noWheelClassName:qs="nowheel",noPanClassName:ur="nopan",fitView:Ws=!1,fitViewOptions:Gs,connectOnClick:Zs=!0,attributionPosition:Ks,proOptions:Qs,defaultEdgeOptions:Js,elevateNodesOnSelect:ei=!0,elevateEdgesOnSelect:ti=!1,disableKeyboardA11y:fr=!1,autoPanOnConnect:ni=!0,autoPanOnNodeDrag:ri=!0,connectionRadius:oi=20,isValidConnection:si,onError:ii,style:ai,id:dr,nodeDragThreshold:ci,...li},ui)=>{const pn=dr||"1";return C.createElement("div",{...li,style:{...ai,...Wf},ref:ui,className:ae(["react-flow",o]),"data-testid":"rf__wrapper",id:dr},C.createElement(Ns,null,C.createElement(Bf,{onInit:u,onMove:c,onMoveStart:f,onMoveEnd:d,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:S,onNodeMouseMove:E,onNodeMouseLeave:y,onNodeContextMenu:M,onNodeDoubleClick:A,nodeTypes:i,edgeTypes:s,connectionLineType:v,connectionLineStyle:I,connectionLineComponent:P,connectionLineContainerStyle:j,selectionKeyCode:U,selectionOnDrag:W,selectionMode:G,deleteKeyCode:O,multiSelectionKeyCode:ee,panActivationKeyCode:Z,zoomActivationKeyCode:K,onlyRenderVisibleElements:pe,selectNodesOnDrag:de,defaultViewport:Je,translateExtent:tt,minZoom:et,maxZoom:ke,preventScrolling:Be,zoomOnScroll:rt,zoomOnPinch:yt,zoomOnDoubleClick:Xe,panOnScroll:se,panOnScrollSpeed:me,panOnScrollMode:Oe,panOnDrag:Ye,onPaneClick:Ae,onPaneMouseEnter:_e,onPaneMouseMove:xt,onPaneMouseLeave:hn,onPaneScroll:wt,onPaneContextMenu:gn,onSelectionContextMenu:_,onSelectionStart:T,onSelectionEnd:D,onEdgeContextMenu:Ue,onEdgeDoubleClick:Ts,onEdgeMouseEnter:zs,onEdgeMouseMove:Ps,onEdgeMouseLeave:Rs,onReconnect:Vs??Ds,onReconnectStart:Ls??Hs,onReconnectEnd:Bs??Fs,reconnectRadius:js??Os,defaultMarkerColor:nt,noDragClassName:Us,noWheelClassName:qs,noPanClassName:ur,elevateEdgesOnSelect:ti,rfId:pn,disableKeyboardA11y:fr,nodeOrigin:Y,nodeExtent:je}),C.createElement(Hu,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:x,onConnectEnd:p,onClickConnectStart:w,onClickConnectEnd:m,nodesDraggable:ne,nodesConnectable:be,nodesFocusable:Q,edgesFocusable:le,edgesUpdatable:Le,elementsSelectable:mt,elevateNodesOnSelect:ei,minZoom:et,maxZoom:ke,nodeExtent:je,onNodesChange:Xs,onEdgesChange:Ys,snapToGrid:ge,snapGrid:fe,connectionMode:b,translateExtent:tt,connectOnClick:Zs,defaultEdgeOptions:Js,fitView:Ws,fitViewOptions:Gs,onNodesDelete:V,onEdgesDelete:F,onNodeDragStart:R,onNodeDrag:H,onNodeDragStop:z,onSelectionDrag:h,onSelectionDragStart:L,onSelectionDragStop:k,noPanClassName:ur,nodeOrigin:Y,rfId:pn,autoPanOnConnect:ni,autoPanOnNodeDrag:ri,onError:ii,connectionRadius:oi,isValidConnection:si,nodeDragThreshold:ci}),C.createElement(Ru,{onSelectionChange:B}),lr,C.createElement(cu,{proOptions:Qs,position:Ks}),C.createElement(ju,{rfId:pn,disableKeyboardA11y:fr})))});ks.displayName="ReactFlow";function As(e){return t=>{const[n,r]=N.useState(t),o=N.useCallback(i=>r(s=>e(i,s)),[]);return[n,r,o]}}const Gf=As(ds),Zf=As(nf);function Kf(){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},C.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function Qf(){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},C.createElement("path",{d:"M0 0h32v4.2H0z"}))}function Jf(){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},C.createElement("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 ed(){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},C.createElement("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 td(){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},C.createElement("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"}))}const At=({children:e,className:t,...n})=>C.createElement("button",{type:"button",className:ae(["react-flow__controls-button",t]),...n},e);At.displayName="ControlButton";const nd=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),Cs=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:u,children:c,position:f="bottom-left"})=>{const d=re(),[g,x]=N.useState(!1),{isInteractive:p,minZoomReached:w,maxZoomReached:m}=J(nd,ie),{zoomIn:S,zoomOut:E,fitView:y}=ar();if(N.useEffect(()=>{x(!0)},[]),!g)return null;const M=()=>{S(),i==null||i()},A=()=>{E(),s==null||s()},R=()=>{y(o),a==null||a()},H=()=>{d.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),l==null||l(!p)};return C.createElement(Ho,{className:ae(["react-flow__controls",u]),position:f,style:e,"data-testid":"rf__controls"},t&&C.createElement(C.Fragment,null,C.createElement(At,{onClick:M,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m},C.createElement(Kf,null)),C.createElement(At,{onClick:A,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:w},C.createElement(Qf,null))),n&&C.createElement(At,{className:"react-flow__controls-fitview",onClick:R,title:"fit view","aria-label":"fit view"},C.createElement(Jf,null)),r&&C.createElement(At,{className:"react-flow__controls-interactive",onClick:H,title:"toggle interactivity","aria-label":"toggle interactivity"},p?C.createElement(td,null):C.createElement(ed,null)),c)};Cs.displayName="Controls";var rd=N.memo(Cs),we;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(we||(we={}));function od({color:e,dimensions:t,lineWidth:n}){return C.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function sd({color:e,radius:t}){return C.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const id={[we.Dots]:"#91919a",[we.Lines]:"#eee",[we.Cross]:"#e2e2e2"},ad={[we.Dots]:1,[we.Lines]:1,[we.Cross]:6},cd=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Ms({id:e,variant:t=we.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:s,style:a,className:l}){const u=N.useRef(null),{transform:c,patternId:f}=J(cd,ie),d=s||id[t],g=r||ad[t],x=t===we.Dots,p=t===we.Cross,w=Array.isArray(n)?n:[n,n],m=[w[0]*c[2]||1,w[1]*c[2]||1],S=g*c[2],E=p?[S,S]:m,y=x?[S/i,S/i]:[E[0]/i,E[1]/i];return C.createElement("svg",{className:ae(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:u,"data-testid":"rf__background"},C.createElement("pattern",{id:f+e,x:c[0]%m[0],y:c[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${y[0]},-${y[1]})`},x?C.createElement(sd,{color:d,radius:S/i}):C.createElement(od,{dimensions:E,color:d,lineWidth:o})),C.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}Ms.displayName="Background";var ld=N.memo(Ms);/**
18
+ * @license lucide-react v0.554.0 - ISC
19
+ *
20
+ * This source code is licensed under the ISC license.
21
+ * See the LICENSE file in the root directory of this source tree.
22
+ */const ud=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],fd=Te("circle-check-big",ud);/**
23
+ * @license lucide-react v0.554.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */const dd=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],hd=Te("circle-play",dd);/**
28
+ * @license lucide-react v0.554.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */const gd=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],pd=Te("circle",gd);/**
33
+ * @license lucide-react v0.554.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */const md=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],yd=Te("clock",md);/**
38
+ * @license lucide-react v0.554.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */const xd=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],wd=Te("file-text",xd);/**
43
+ * @license lucide-react v0.554.0 - ISC
44
+ *
45
+ * This source code is licensed under the ISC license.
46
+ * See the LICENSE file in the root directory of this source tree.
47
+ */const vd=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],$s=Te("git-branch",vd);/**
48
+ * @license lucide-react v0.554.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */const bd=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],_d=Te("git-merge",bd);/**
53
+ * @license lucide-react v0.554.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */const Ed=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Sd=Te("upload",Ed);/**
58
+ * @license lucide-react v0.554.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const Nd=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Is=Te("x",Nd);function kd({data:e}){const t=()=>{switch(e.status){case"active":return $.jsx(hd,{className:"status-icon active",size:16});case"saved":return $.jsx(fd,{className:"status-icon saved",size:16});default:return $.jsx(pd,{className:"status-icon",size:16})}},n=()=>{switch(e.status){case"active":return"active";case"saved":return"saved";case"merged":return"merged";default:return""}};return $.jsxs("div",{className:`node-card ${e.selected?"selected":""} ${n()}`,children:[$.jsx(Ve,{type:"target",position:X.Top,className:"node-handle"}),$.jsxs("div",{className:"node-header",children:[t(),$.jsx("span",{className:"node-label",children:e.label})]}),e.claudeSessionId&&$.jsxs("div",{className:"node-id",children:[e.claudeSessionId.slice(0,8),"..."]}),$.jsx("div",{className:"node-status-badge",children:e.status}),$.jsx(Ve,{type:"source",position:X.Bottom,className:"node-handle"})]})}function Ad({data:e}){const t=e.status==="merged"?"#94e2d5":"#f38ba8",n=e.status==="merged"?"rgba(148, 226, 213, 0.1)":"rgba(243, 139, 168, 0.1)";return $.jsxs("div",{style:{width:"48px",height:"48px",borderRadius:"50%",border:`3px solid ${t}`,background:e.selected?n:"rgba(30, 30, 46, 0.95)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",backdropFilter:"blur(10px)"},title:`${e.label} (${e.status})`,children:[$.jsx(Ve,{type:"target",position:X.Top}),$.jsx("span",{style:{fontSize:"10px",fontWeight:600,color:t,textAlign:"center"},children:e.status==="merged"?"M":"C"}),$.jsx(Ve,{type:"source",position:X.Bottom})]})}const Cd={sessionNode:kd,compactNode:Ad};function Md({session:e,selectedNode:t,onNodeClick:n,onNodePositionChange:r}){const o=e.forks||[],i=e.nodePositions||{},s=(E,y=new Set)=>{if(E==="main"||y.has(E))return 0;const M=o.find(A=>A.id===E);return M?(y.add(E),1+s(M.parentId,y)):0},a=new Map;o.forEach(E=>{const y=s(E.id);a.has(y)||a.set(y,[]),a.get(y).push(E)});const l=E=>{if(E==="main")return{x:250,y:50};const y=o.find(H=>H.id===E);if(!y)return{x:250,y:50};const M=s(y.id),A=a.get(M)||[];return{x:100+A.indexOf(y)*150-A.length*75+250,y:50+M*150}},u=E=>i[E]||l(E),c=N.useMemo(()=>{var y,M;const E=[{id:"main",type:"sessionNode",position:u("main"),draggable:!0,data:{label:"MAIN",status:((y=e.main)==null?void 0:y.status)||e.status,claudeSessionId:(M=e.main)==null?void 0:M.claudeSessionId,selected:t==="main"}}];return o.forEach(A=>{const R=A.status==="closed"||A.status==="merged"?"compactNode":"sessionNode";E.push({id:A.id,type:R,position:u(A.id),draggable:!0,data:{label:A.name,status:A.status,claudeSessionId:A.claudeSessionId,selected:t===A.id}})}),E},[e.id,o.length,t,JSON.stringify(i)]),f=N.useMemo(()=>o.map(E=>({id:`${E.parentId}-${E.id}`,source:E.parentId,target:E.id,animated:E.status==="active",markerEnd:{type:Pt.ArrowClosed},style:{stroke:E.status==="active"?"#a6e3a1":"#585b70",strokeWidth:2}})),[o]),[d,g,x]=Gf(c),[p,w,m]=Zf(f);N.useMemo(()=>{g(c),w(f)},[c,f]);const S=N.useCallback((E,y)=>{r&&r(y.id,{x:y.position.x,y:y.position.y})},[r]);return $.jsx("div",{style:{width:"100%",height:"100%"},children:$.jsxs(ks,{nodes:d,edges:p,nodeTypes:Cd,onNodesChange:x,onEdgesChange:m,onNodeClick:(E,y)=>n(y.id),onNodeDragStop:S,fitView:!0,minZoom:.5,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:1},proOptions:{hideAttribution:!0},children:[$.jsx(ld,{}),$.jsx(rd,{})]})})}function $d({session:e}){const t=s=>{const a=new Date(s),u=new Date().getTime()-a.getTime(),c=Math.floor(u/(1e3*60*60)),f=Math.floor(c/24);return f>0?`${f} day${f>1?"s":""} ago`:c>0?`${c} hour${c>1?"s":""} ago`:"Just now"},n=async()=>{try{await window.electronAPI.openProjectFolder()}catch(s){console.error("Error opening project folder:",s)}},r=async()=>{try{await window.electronAPI.focusTerminal()}catch(s){console.error("Error focusing terminal:",s)}},o=e.forks.filter(s=>s.status==="active").length,i=e.forks.filter(s=>s.status==="saved").length;return $.jsxs("div",{className:"session-info",children:[$.jsxs("div",{className:"session-info-header",children:[$.jsx("h2",{className:"session-name",children:e.name||"Unnamed Session"}),$.jsx("div",{className:`session-status-badge ${e.status}`,children:e.status})]}),$.jsxs("div",{className:"session-meta",children:[$.jsxs("div",{className:"session-meta-item",children:[$.jsx(yd,{size:14}),$.jsx("span",{children:t(e.createdAt)})]}),$.jsxs("button",{className:"session-meta-item folder-button",onClick:n,title:"Open project folder (tries Cursor, VSCode, or Finder)",children:[$.jsx(hi,{size:14}),$.jsx("span",{children:"Code"})]}),$.jsxs("button",{className:"session-meta-item terminal-button",onClick:r,title:"Focus terminal window",children:[$.jsx(gi,{size:14}),$.jsx("span",{children:"Terminal"})]}),$.jsxs("div",{className:"session-meta-item",children:[$.jsx($s,{size:14}),$.jsxs("span",{children:[o+i," fork",o+i!==1?"s":""]})]})]})]})}function Id({selectedNode:e,onCreateFork:t,onExportFork:n,onMergeFork:r,onCloseFork:o,isCreatingFork:i,isExporting:s,isMerging:a,isClosing:l,canCreateFork:u,hasExport:c}){const f=e!=="main",d=i||s||a||l;return $.jsxs("div",{className:"action-panel",children:[$.jsx("div",{className:"action-panel-header",children:$.jsxs("span",{className:"action-panel-title",children:["Actions for: ",$.jsxs("strong",{children:[e==="main"?"MAIN":e.slice(0,8),"..."]})]})}),$.jsxs("div",{className:"action-buttons",children:[$.jsxs("button",{className:"action-button primary",onClick:t,disabled:!u||d,title:u?"Create a new fork from the current branch":"Claude Code limitation: Only one active fork allowed per branch. Merge the existing fork or create from it.",children:[$.jsx($s,{size:18}),$.jsx("span",{children:i?"Creating...":"New Fork"})]}),$.jsxs("button",{className:"action-button",onClick:n,disabled:!f||d,title:"Export fork summary",children:[$.jsx(Sd,{size:18}),$.jsx("span",{children:s?"Exporting...":"Export"})]}),$.jsxs("button",{className:"action-button",onClick:r,disabled:!f||d||!c,title:c?"Merge fork back to parent":"Export the fork first before merging",children:[$.jsx(_d,{size:18}),$.jsx("span",{children:a?"Merging...":"Merge"})]}),$.jsxs("button",{className:"action-button danger",onClick:o,disabled:!f||d,title:"Close fork (abandon experiment)",children:[$.jsx(Is,{size:18}),$.jsx("span",{children:l?"Closing...":"Close"})]})]})]})}function Td({fork:e,onClose:t,onOpenExport:n}){const r={active:"#a6e3a1",saved:"#f9e2af",closed:"#f38ba8",merged:"#94e2d5"}[e.status],o={active:"Active",saved:"Saved",closed:"Closed",merged:"Merged"}[e.status];return $.jsx("div",{className:"modal-overlay",onClick:t,children:$.jsxs("div",{className:"modal fork-info-modal",onClick:i=>i.stopPropagation(),children:[$.jsxs("div",{className:"modal-header",children:[$.jsx("h3",{children:"Fork Details"}),$.jsx("button",{className:"modal-close-btn",onClick:t,children:$.jsx(Is,{size:18})})]}),$.jsxs("div",{className:"fork-info-content",children:[$.jsxs("div",{className:"info-row",children:[$.jsx("span",{className:"info-label",children:"Name:"}),$.jsx("span",{className:"info-value",children:e.name})]}),$.jsxs("div",{className:"info-row",children:[$.jsx("span",{className:"info-label",children:"ID:"}),$.jsx("span",{className:"info-value fork-id",children:e.id})]}),$.jsxs("div",{className:"info-row",children:[$.jsx("span",{className:"info-label",children:"Claude Session ID:"}),$.jsx("span",{className:"info-value fork-id",children:e.claudeSessionId})]}),$.jsxs("div",{className:"info-row",children:[$.jsx("span",{className:"info-label",children:"Status:"}),$.jsx("span",{className:"info-value",children:$.jsx("span",{className:"status-badge",style:{borderColor:r,color:r},children:o})})]}),$.jsxs("div",{className:"info-row",children:[$.jsx("span",{className:"info-label",children:"Created:"}),$.jsx("span",{className:"info-value",children:new Date(e.createdAt).toLocaleString()})]}),e.status==="merged"&&e.mergedAt&&$.jsxs("div",{className:"info-row",children:[$.jsx("span",{className:"info-label",children:"Merged:"}),$.jsx("span",{className:"info-value",children:new Date(e.mergedAt).toLocaleString()})]}),e.contextPath&&$.jsxs("div",{className:"info-row",children:[$.jsx("span",{className:"info-label",children:"Export Path:"}),$.jsx("span",{className:"info-value export-path",children:e.contextPath})]})]}),e.status==="merged"&&e.contextPath&&n&&$.jsx("div",{className:"modal-actions",children:$.jsxs("button",{className:"button-primary",onClick:n,children:[$.jsx(wd,{size:16}),"Open Export File"]})})]})})}const oe={info:(...e)=>console.log("[App]",...e),error:(...e)=>console.error("[App]",...e),warn:(...e)=>console.warn("[App]",...e)};oe.info("=== App module loaded ===");function zd(){var b;oe.info("App component rendering...");const[e,t]=N.useState(null),[n,r]=N.useState("main"),[o,i]=N.useState(!0),[s,a]=N.useState(null),[l,u]=N.useState(!1),[c,f]=N.useState(""),[d,g]=N.useState(!1),[x,p]=N.useState(!1),[w,m]=N.useState(!1),[S,E]=N.useState(!1),[y,M]=N.useState(!1),[A,R]=N.useState(null);N.useEffect(()=>{if(oe.info("useEffect: Initializing app..."),oe.info("electronAPI available:",!!window.electronAPI),!window.electronAPI){oe.error("electronAPI is not available! Preload script may have failed."),a("electronAPI not available - preload script may have failed"),i(!1);return}oe.info("Requesting session data from main process..."),window.electronAPI.getSession().then(v=>{var I;oe.info("Session data received:",v==null?void 0:v.id,v==null?void 0:v.name),oe.info("Session has",((I=v==null?void 0:v.forks)==null?void 0:I.length)||0,"forks"),t(v),i(!1),oe.info("Loading state set to false")}).catch(v=>{oe.error("Failed to get session:",v.message),a(`Failed to get session: ${v.message}`),i(!1)}),oe.info("Setting up state update listener..."),window.electronAPI.onStateUpdate(v=>{oe.info("State update received:",v==null?void 0:v.id),t(v)}),oe.info("useEffect: Initialization complete")},[]);const H=async v=>{if(!e)return;const I=e.forks.find(P=>P.id===v);if(I&&(I.status==="closed"||I.status==="merged")){R(I),M(!0);return}r(v),await window.electronAPI.selectNode(v)},z=()=>{var I;if(!e){alert("No session available");return}if(e.forks.filter(P=>P.parentId===n&&P.status==="active").length>0){const P=n==="main"?"MAIN":((I=e.forks.find(j=>j.id===n))==null?void 0:I.name)||n;alert(`Claude Code limitation: Only one active fork can exist from each branch.
63
+
64
+ The branch "${P}" already has an active fork. Close or merge the existing fork first, or create a fork from it.`);return}u(!0)},V=async()=>{if(!c.trim()){alert("Please enter a fork name");return}g(!0);try{await window.electronAPI.createFork(e.id,c,n),u(!1),f(""),alert("Fork created successfully!")}catch(v){alert(`Failed to create fork: ${v.message}`),console.error("Create fork error:",v)}finally{g(!1)}},F=()=>{u(!1),f("")},B=async()=>{if(!(!e||n==="main")){p(!0);try{await window.electronAPI.exportFork(e.id,n),alert("Export completed successfully!")}catch(v){alert(`Export failed: ${v.message}`),console.error("Export error:",v)}finally{p(!1)}}},L=async()=>{if(!(!e||n==="main"||!window.confirm(`Are you sure you want to merge "${n}" to main?`))){m(!0);try{await window.electronAPI.mergeFork(e.id,n),alert("Merge completed successfully!")}catch(I){alert(`Merge failed: ${I.message}`),console.error("Merge error:",I)}finally{m(!1)}}},h=async()=>{if(!e||n==="main")return;const v=e.forks.find(P=>P.id===n);if(window.confirm(`Are you sure you want to close "${(v==null?void 0:v.name)||n}"?
65
+
66
+ The fork will be saved and can be resumed later, but it will no longer be active.`)){E(!0);try{await window.electronAPI.closeFork(e.id,n),alert("Fork closed successfully!")}catch(P){alert(`Close failed: ${P.message}`),console.error("Close error:",P)}finally{E(!1)}}},k=async()=>{if(A!=null&&A.contextPath)try{await window.electronAPI.openExportFile(A.contextPath)}catch(v){alert(`Failed to open export file: ${v.message}`),console.error("Open export error:",v)}};if(o)return oe.info("Rendering loading state..."),$.jsxs("div",{className:"loading",children:[$.jsx("div",{className:"spinner"}),$.jsx("p",{children:"Loading session..."})]});if(s)return oe.error("Rendering error state:",s),$.jsxs("div",{className:"error",children:[$.jsx("p",{children:"Error loading session"}),$.jsx("p",{style:{fontSize:"12px",color:"#888"},children:s})]});if(!e)return oe.warn("Rendering no-session state"),$.jsx("div",{className:"error",children:$.jsx("p",{children:"No session data available"})});oe.info("Rendering main UI with session:",e.id);const _=async()=>{await window.electronAPI.saveAndClose()},T=async()=>{await window.electronAPI.minimizeToTaskbar()},D=N.useCallback(async(v,I)=>{if(e)try{await window.electronAPI.saveNodePosition(e.id,v,I)}catch(P){console.error("Failed to save node position:",P)}},[e]);return $.jsxs("div",{className:"app",children:[$.jsxs("div",{className:"titlebar","data-tauri-drag-region":!0,children:[$.jsx("span",{className:"titlebar-text",children:"🎭 Claude-Orka"}),$.jsxs("div",{className:"titlebar-buttons",children:[$.jsx("button",{className:"titlebar-button minimize",onClick:T,children:"Minimize"}),$.jsx("button",{className:"titlebar-button save-close",onClick:_,children:"Save & Close"})]})]}),$.jsx($d,{session:e}),$.jsx("div",{className:"content",children:$.jsx(Md,{session:e,selectedNode:n,onNodeClick:H,onNodePositionChange:D})}),$.jsx(Id,{selectedNode:n,onCreateFork:z,onExportFork:B,onMergeFork:L,onCloseFork:h,isCreatingFork:d,isExporting:x,isMerging:w,isClosing:S,canCreateFork:e.forks.filter(v=>v.parentId===n&&v.status==="active").length===0,hasExport:n==="main"?!1:!!((b=e.forks.find(v=>v.id===n))!=null&&b.contextPath)}),l&&$.jsx("div",{className:"modal-overlay",children:$.jsxs("div",{className:"modal",children:[$.jsx("h3",{children:"Create New Fork"}),$.jsx("input",{type:"text",value:c,onChange:v=>f(v.target.value),placeholder:"Enter fork name...",autoFocus:!0,disabled:d,onKeyPress:v=>v.key==="Enter"&&!d&&V()}),$.jsxs("div",{className:"modal-buttons",children:[$.jsx("button",{onClick:F,className:"button-secondary",disabled:d,children:"Cancel"}),$.jsx("button",{onClick:V,className:"button-primary",disabled:d,children:d?"Creating...":"Create"})]})]})}),y&&A&&$.jsx(Td,{fork:A,onClose:()=>{M(!1),R(null)},onOpenExport:A.status==="merged"?k:void 0})]})}pi.createRoot(document.getElementById("root")).render($.jsx(C.StrictMode,{children:$.jsx(zd,{})}));
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Claude-Orka</title>
7
- <script type="module" crossorigin src="./assets/main-BMC8JuEx.js"></script>
7
+ <script type="module" crossorigin src="./assets/main-C9VElgAd.js"></script>
8
8
  <link rel="modulepreload" crossorigin href="./assets/terminal-BTLiXhkP.js">
9
9
  <link rel="stylesheet" crossorigin href="./assets/main-DqAO9n-6.css">
10
10
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enruana/claude-orka",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "SDK for orchestrating Claude Code sessions with tmux - Branch management for conversations",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",