@enruana/claude-orka 0.8.2 → 0.8.3
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.
- package/dist/electron/main/main.js +2 -2
- package/dist/electron/main/main.js.map +1 -1
- package/dist/electron/renderer/assets/icon-DCcMpdAg.png +0 -0
- package/dist/electron/renderer/assets/main-vhzrm_Sy.js +122 -0
- package/dist/electron/renderer/icon.png +0 -0
- package/dist/electron/renderer/index.html +1 -1
- package/package.json +1 -1
- package/dist/electron/renderer/assets/main-HIgPFlZ_.js +0 -66
|
@@ -1818,9 +1818,9 @@ function createWindow(sessionId, projectPath) {
|
|
|
1818
1818
|
uiLogger.info(`Preload path: ${preloadPath}`);
|
|
1819
1819
|
uiLogger.info(`Preload exists: ${fs6.existsSync(preloadPath)}`);
|
|
1820
1820
|
const mainWindow = new BrowserWindow({
|
|
1821
|
-
width:
|
|
1821
|
+
width: 1200,
|
|
1822
1822
|
height: 800,
|
|
1823
|
-
minWidth:
|
|
1823
|
+
minWidth: 800,
|
|
1824
1824
|
minHeight: 600,
|
|
1825
1825
|
frame: false,
|
|
1826
1826
|
transparent: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../electron/main/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CA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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 wi(){if(hr)return wn;hr=1;var e=co();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,s=e.useLayoutEffect,i=e.useDebugValue;function a(f,d){var p=d(),v=r({inst:{value:p,getSnapshot:d}}),g=v[0].inst,b=v[1];return s(function(){g.value=p,g.getSnapshot=d,u(g)&&b({inst:g})},[f,p,d]),o(function(){return u(g)&&b({inst:g}),f(function(){u(g)&&b({inst:g})})},[f]),i(p),p}function u(f){var d=f.getSnapshot;f=f.value;try{var p=d();return!n(f,p)}catch{return!0}}function c(f,d){return d()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return wn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,wn}var pr;function vi(){return pr||(pr=1,xn.exports=wi()),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 gr;function bi(){if(gr)return yn;gr=1;var e=co(),t=vi();function n(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,u=e.useDebugValue;return yn.useSyncExternalStoreWithSelector=function(c,l,f,d,p){var v=s(null);if(v.current===null){var g={hasValue:!1,value:null};v.current=g}else g=v.current;v=a(function(){function y(A){if(!_){if(_=!0,x=A,A=d(A),p!==void 0&&g.hasValue){var D=g.value;if(p(D,A))return m=D}return m=A}if(D=m,r(x,A))return D;var j=d(A);return p!==void 0&&p(D,j)?(x=A,D):(x=A,m=j)}var _=!1,x,m,C=f===void 0?null:f;return[function(){return y(l())},C===null?void 0:function(){return y(C())}]},[l,f,d,p]);var b=o(c,v[0],v[1]);return i(function(){g.hasValue=!0,g.value=b},[b]),u(b),b},yn}var mr;function _i(){return mr||(mr=1,mn.exports=bi()),mn.exports}var Si=_i();const Ei=pi(Si),Ni={},yr=e=>{let t;const n=new Set,r=(l,f)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(v=>v(t,p))}},o=()=>t,u={setState:r,getState:o,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(Ni?"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()}},c=t=e(r,o,u);return u},ki=e=>e?yr(e):yr,{useDebugValue:$i}=M,{useSyncExternalStoreWithSelector:Ci}=Ei,Mi=e=>e;function lo(e,t=Mi,n){const r=Ci(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return $i(r),r}const xr=(e,t)=>{const n=ki(e),r=(o,s=t)=>lo(n,o,s);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 Ii={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 qt(n)}function qt(e){this._=e}function Ti(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}})}qt.prototype=an.prototype={constructor:qt,on:function(e,t){var n=this._,r=Ti(e+"",n),o,s=-1,i=r.length;if(arguments.length<2){for(;++s<i;)if((o=(e=r[s]).type)&&(o=zi(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<i;)if(o=(e=r[s]).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 qt(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,s;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,o=s.length;r<o;++r)s[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,s=r.length;o<s;++o)r[o].value.apply(t,n)}};function zi(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]=Ii,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 Ri(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 Di(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function uo(e){var t=cn(e);return(t.local?Di:Ri)(t)}function Pi(){}function Yn(e){return e==null?Pi:function(){return this.querySelector(e)}}function ji(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 s=t[o],i=s.length,a=r[o]=new Array(i),u,c,l=0;l<i;++l)(u=s[l])&&(c=e.call(u,u.__data__,l,s))&&("__data__"in u&&(c.__data__=u.__data__),a[l]=c);return new ue(r,this._parents)}function Hi(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Fi(){return[]}function fo(e){return e==null?Fi:function(){return this.querySelectorAll(e)}}function Li(e){return function(){return Hi(e.apply(this,arguments))}}function Bi(e){typeof e=="function"?e=Li(e):e=fo(e);for(var t=this._groups,n=t.length,r=[],o=[],s=0;s<n;++s)for(var i=t[s],a=i.length,u,c=0;c<a;++c)(u=i[c])&&(r.push(e.call(u,u.__data__,c,i)),o.push(u));return new ue(r,o)}function ho(e){return function(){return this.matches(e)}}function po(e){return function(t){return t.matches(e)}}var Vi=Array.prototype.find;function Oi(e){return function(){return Vi.call(this.children,e)}}function Wi(){return this.firstElementChild}function Yi(e){return this.select(e==null?Wi:Oi(typeof e=="function"?e:po(e)))}var Ui=Array.prototype.filter;function Xi(){return Array.from(this.children)}function qi(e){return function(){return Ui.call(this.children,e)}}function Gi(e){return this.selectAll(e==null?Xi:qi(typeof e=="function"?e:po(e)))}function Zi(e){typeof e!="function"&&(e=ho(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],i=s.length,a=r[o]=[],u,c=0;c<i;++c)(u=s[c])&&e.call(u,u.__data__,c,s)&&a.push(u);return new ue(r,this._parents)}function go(e){return new Array(e.length)}function Ki(){return new ue(this._enter||this._groups.map(go),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 Qi(e){return function(){return e}}function Ji(e,t,n,r,o,s){for(var i=0,a,u=t.length,c=s.length;i<c;++i)(a=t[i])?(a.__data__=s[i],r[i]=a):n[i]=new Qt(e,s[i]);for(;i<u;++i)(a=t[i])&&(o[i]=a)}function ea(e,t,n,r,o,s,i){var a,u,c=new Map,l=t.length,f=s.length,d=new Array(l),p;for(a=0;a<l;++a)(u=t[a])&&(d[a]=p=i.call(u,u.__data__,a,t)+"",c.has(p)?o[a]=u:c.set(p,u));for(a=0;a<f;++a)p=i.call(e,s[a],a,s)+"",(u=c.get(p))?(r[a]=u,u.__data__=s[a],c.delete(p)):n[a]=new Qt(e,s[a]);for(a=0;a<l;++a)(u=t[a])&&c.get(d[a])===u&&(o[a]=u)}function ta(e){return e.__data__}function na(e,t){if(!arguments.length)return Array.from(this,ta);var n=t?ea:Ji,r=this._parents,o=this._groups;typeof e!="function"&&(e=Qi(e));for(var s=o.length,i=new Array(s),a=new Array(s),u=new Array(s),c=0;c<s;++c){var l=r[c],f=o[c],d=f.length,p=ra(e.call(l,l&&l.__data__,c,r)),v=p.length,g=a[c]=new Array(v),b=i[c]=new Array(v),y=u[c]=new Array(d);n(l,f,g,b,y,p,t);for(var _=0,x=0,m,C;_<v;++_)if(m=g[_]){for(_>=x&&(x=_+1);!(C=b[x])&&++x<v;);m._next=C||null}}return i=new ue(i,r),i._enter=a,i._exit=u,i}function ra(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oa(){return new ue(this._exit||this._groups.map(go),this._parents)}function sa(e,t,n){var r=this.enter(),o=this,s=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?s.remove():n(s),r&&o?r.merge(o).order():o}function ia(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,s=r.length,i=Math.min(o,s),a=new Array(o),u=0;u<i;++u)for(var c=n[u],l=r[u],f=c.length,d=a[u]=new Array(f),p,v=0;v<f;++v)(p=c[v]||l[v])&&(d[v]=p);for(;u<o;++u)a[u]=n[u];return new ue(a,this._parents)}function aa(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,s=r[o],i;--o>=0;)(i=r[o])&&(s&&i.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(i,s),s=i);return this}function ca(e){e||(e=la);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),s=0;s<r;++s){for(var i=n[s],a=i.length,u=o[s]=new Array(a),c,l=0;l<a;++l)(c=i[l])&&(u[l]=c);u.sort(t)}return new ue(o,this._parents).order()}function la(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ua(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function fa(){return Array.from(this)}function da(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,s=r.length;o<s;++o){var i=r[o];if(i)return i}return null}function ha(){let e=0;for(const t of this)++e;return e}function pa(){return!this.node()}function ga(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],s=0,i=o.length,a;s<i;++s)(a=o[s])&&e.call(a,a.__data__,s,o);return this}function ma(e){return function(){this.removeAttribute(e)}}function ya(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xa(e,t){return function(){this.setAttribute(e,t)}}function wa(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function va(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function ba(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 _a(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?ya:ma:typeof t=="function"?n.local?ba:va:n.local?wa:xa)(n,t))}function mo(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Sa(e){return function(){this.style.removeProperty(e)}}function Ea(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Na(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function ka(e,t,n){return arguments.length>1?this.each((t==null?Sa:typeof t=="function"?Na:Ea)(e,t,n??"")):ht(this.node(),e)}function ht(e,t){return e.style.getPropertyValue(t)||mo(e).getComputedStyle(e,null).getPropertyValue(t)}function $a(e){return function(){delete this[e]}}function Ca(e,t){return function(){this[e]=t}}function Ma(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?$a:typeof t=="function"?Ma:Ca)(e,t)):this.node()[e]}function yo(e){return e.trim().split(/^|\s+/)}function Un(e){return e.classList||new xo(e)}function xo(e){this._node=e,this._names=yo(e.getAttribute("class")||"")}xo.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 wo(e,t){for(var n=Un(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function vo(e,t){for(var n=Un(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Ia(e){return function(){wo(this,e)}}function Ta(e){return function(){vo(this,e)}}function za(e,t){return function(){(t.apply(this,arguments)?wo:vo)(this,e)}}function Ra(e,t){var n=yo(e+"");if(arguments.length<2){for(var r=Un(this.node()),o=-1,s=n.length;++o<s;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?za:t?Ia:Ta)(n,t))}function Da(){this.textContent=""}function Pa(e){return function(){this.textContent=e}}function ja(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ha(e){return arguments.length?this.each(e==null?Da:(typeof e=="function"?ja:Pa)(e)):this.node().textContent}function Fa(){this.innerHTML=""}function La(e){return function(){this.innerHTML=e}}function Ba(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Va(e){return arguments.length?this.each(e==null?Fa:(typeof e=="function"?Ba:La)(e)):this.node().innerHTML}function Oa(){this.nextSibling&&this.parentNode.appendChild(this)}function Wa(){return this.each(Oa)}function Ya(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ua(){return this.each(Ya)}function Xa(e){var t=typeof e=="function"?e:uo(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qa(){return null}function Ga(e,t){var n=typeof e=="function"?e:uo(e),r=t==null?qa:typeof t=="function"?t:Yn(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Za(){var e=this.parentNode;e&&e.removeChild(this)}function Ka(){return this.each(Za)}function Qa(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ja(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ec(e){return this.select(e?Ja:Qa)}function tc(e){return arguments.length?this.property("__data__",e):this.node().__data__}function nc(e){return function(t){e.call(this,t,this.__data__)}}function rc(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 oc(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,s;n<o;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function sc(e,t,n){return function(){var r=this.__on,o,s=nc(t);if(r){for(var i=0,a=r.length;i<a;++i)if((o=r[i]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=n),o.value=t;return}}this.addEventListener(e.type,s,n),o={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(o):this.__on=[o]}}function ic(e,t,n){var r=rc(e+""),o,s=r.length,i;if(arguments.length<2){var a=this.node().__on;if(a){for(var u=0,c=a.length,l;u<c;++u)for(o=0,l=a[u];o<s;++o)if((i=r[o]).type===l.type&&i.name===l.name)return l.value}return}for(a=t?sc:oc,o=0;o<s;++o)this.each(a(r[o],t,n));return this}function bo(e,t,n){var r=mo(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 ac(e,t){return function(){return bo(this,e,t)}}function cc(e,t){return function(){return bo(this,e,t.apply(this,arguments))}}function lc(e,t){return this.each((typeof t=="function"?cc:ac)(e,t))}function*uc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,s=r.length,i;o<s;++o)(i=r[o])&&(yield i)}var _o=[null];function ue(e,t){this._groups=e,this._parents=t}function Pt(){return new ue([[document.documentElement]],_o)}function fc(){return this}ue.prototype=Pt.prototype={constructor:ue,select:ji,selectAll:Bi,selectChild:Yi,selectChildren:Gi,filter:Zi,data:na,enter:Ki,exit:oa,join:sa,merge:ia,selection:fc,order:aa,sort:ca,call:ua,nodes:fa,node:da,size:ha,empty:pa,each:ga,attr:_a,style:ka,property:Aa,classed:Ra,text:Ha,html:Va,raise:Wa,lower:Ua,append:Xa,insert:Ga,remove:Ka,clone:ec,datum:tc,on:ic,dispatch:lc,[Symbol.iterator]:uc};function ye(e){return typeof e=="string"?new ue([[document.querySelector(e)]],[document.documentElement]):new ue([[e]],_o)}function dc(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Se(e,t){if(e=dc(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 hc={passive:!1},Ct={capture:!0,passive:!1};function vn(e){e.stopImmediatePropagation()}function lt(e){e.preventDefault(),e.stopImmediatePropagation()}function So(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 Eo(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 Ft=e=>()=>e;function An(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:s,x:i,y:a,dx:u,dy:c,dispatch:l}){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:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:l}})}An.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function pc(e){return!e.ctrlKey&&!e.button}function gc(){return this.parentNode}function mc(e,t){return t??{x:e.x,y:e.y}}function yc(){return navigator.maxTouchPoints||"ontouchstart"in this}function xc(){var e=pc,t=gc,n=mc,r=yc,o={},s=an("start","drag","end"),i=0,a,u,c,l,f=0;function d(m){m.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",y,hc).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(m,C){if(!(l||!e.call(this,m,C))){var A=x(this,t.call(this,m,C),m,C,"mouse");A&&(ye(m.view).on("mousemove.drag",v,Ct).on("mouseup.drag",g,Ct),So(m.view),vn(m),c=!1,a=m.clientX,u=m.clientY,A("start",m))}}function v(m){if(lt(m),!c){var C=m.clientX-a,A=m.clientY-u;c=C*C+A*A>f}o.mouse("drag",m)}function g(m){ye(m.view).on("mousemove.drag mouseup.drag",null),Eo(m.view,c),lt(m),o.mouse("end",m)}function b(m,C){if(e.call(this,m,C)){var A=m.changedTouches,D=t.call(this,m,C),j=A.length,I,R;for(I=0;I<j;++I)(R=x(this,D,m,C,A[I].identifier,A[I]))&&(vn(m),R("start",m,A[I]))}}function y(m){var C=m.changedTouches,A=C.length,D,j;for(D=0;D<A;++D)(j=o[C[D].identifier])&&(lt(m),j("drag",m,C[D]))}function _(m){var C=m.changedTouches,A=C.length,D,j;for(l&&clearTimeout(l),l=setTimeout(function(){l=null},500),D=0;D<A;++D)(j=o[C[D].identifier])&&(vn(m),j("end",m,C[D]))}function x(m,C,A,D,j,I){var R=s.copy(),P=Se(I||A,C),B,L,h;if((h=n.call(m,new An("beforestart",{sourceEvent:A,target:d,identifier:j,active:i,x:P[0],y:P[1],dx:0,dy:0,dispatch:R}),D))!=null)return B=h.x-P[0]||0,L=h.y-P[1]||0,function $(N,z,H){var S=P,T;switch(N){case"start":o[j]=$,T=i++;break;case"end":delete o[j],--i;case"drag":P=Se(H||z,C),T=i;break}R.call(N,m,new An(N,{sourceEvent:z,subject:h,target:d,identifier:j,active:T,x:P[0]+B,y:P[1]+L,dx:P[0]-S[0],dy:P[1]-S[1],dispatch:R}),D)}}return d.filter=function(m){return arguments.length?(e=typeof m=="function"?m:Ft(!!m),d):e},d.container=function(m){return arguments.length?(t=typeof m=="function"?m:Ft(m),d):t},d.subject=function(m){return arguments.length?(n=typeof m=="function"?m:Ft(m),d):n},d.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:Ft(!!m),d):r},d.on=function(){var m=s.on.apply(s,arguments);return m===s?d:m},d.clickDistance=function(m){return arguments.length?(f=(m=+m)*m,d):Math.sqrt(f)},d}function Xn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function No(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function jt(){}var Mt=.7,Jt=1/Mt,ut="\\s*([+-]?\\d+)\\s*",At="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ee="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wc=/^#([0-9a-f]{3,8})$/,vc=new RegExp(`^rgb\\(${ut},${ut},${ut}\\)$`),bc=new RegExp(`^rgb\\(${Ee},${Ee},${Ee}\\)$`),_c=new RegExp(`^rgba\\(${ut},${ut},${ut},${At}\\)$`),Sc=new RegExp(`^rgba\\(${Ee},${Ee},${Ee},${At}\\)$`),Ec=new RegExp(`^hsl\\(${At},${Ee},${Ee}\\)$`),Nc=new RegExp(`^hsla\\(${At},${Ee},${Ee},${At}\\)$`),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};Xn(jt,It,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_r,formatHex:_r,formatHex8:kc,formatHsl:$c,formatRgb:Sr,toString:Sr});function _r(){return this.rgb().formatHex()}function kc(){return this.rgb().formatHex8()}function $c(){return ko(this).formatHsl()}function Sr(){return this.rgb().formatRgb()}function It(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=wc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Er(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=vc.exec(e))?new ce(t[1],t[2],t[3],1):(t=bc.exec(e))?new ce(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=_c.exec(e))?Lt(t[1],t[2],t[3],t[4]):(t=Sc.exec(e))?Lt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ec.exec(e))?$r(t[1],t[2]/100,t[3]/100,1):(t=Nc.exec(e))?$r(t[1],t[2]/100,t[3]/100,t[4]):br.hasOwnProperty(e)?Er(br[e]):e==="transparent"?new ce(NaN,NaN,NaN,0):null}function Er(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 Cc(e){return e instanceof jt||(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?Cc(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}Xn(ce,In,No(jt,{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:Mc,formatRgb:kr,toString:kr}));function Nr(){return`#${qe(this.r)}${qe(this.g)}${qe(this.b)}`}function Mc(){return`#${qe(this.r)}${qe(this.g)}${qe(this.b)}${qe((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 qe(e){return e=Ze(e),(e<16?"0":"")+e.toString(16)}function $r(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 ko(e){if(e instanceof xe)return new xe(e.h,e.s,e.l,e.opacity);if(e instanceof jt||(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),s=Math.max(t,n,r),i=NaN,a=s-o,u=(s+o)/2;return a?(t===s?i=(n-r)/a+(n<r)*6:n===s?i=(r-t)/a+2:i=(t-n)/a+4,a/=u<.5?s+o:2-s-o,i*=60):a=u>0&&u<1?0:i,new xe(i,a,u,e.opacity)}function Ac(e,t,n,r){return arguments.length===1?ko(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}Xn(xe,Ac,No(jt,{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 $o=e=>()=>e;function Ic(e,t){return function(n){return e+n*t}}function Tc(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 zc(e){return(e=+e)==1?Co:function(t,n){return n-t?Tc(t,n,e):$o(isNaN(t)?n:t)}}function Co(e,t){var n=t-e;return n?Ic(e,n):$o(isNaN(e)?t:e)}const Mr=(function e(t){var n=zc(t);function r(o,s){var i=n((o=In(o)).r,(s=In(s)).r),a=n(o.g,s.g),u=n(o.b,s.b),c=Co(o.opacity,s.opacity);return function(l){return o.r=i(l),o.g=a(l),o.b=u(l),o.opacity=c(l),o+""}}return r.gamma=e,r})(1);function Re(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 Rc(e){return function(){return e}}function Dc(e){return function(t){return e(t)+""}}function Pc(e,t){var n=Tn.lastIndex=_n.lastIndex=0,r,o,s,i=-1,a=[],u=[];for(e=e+"",t=t+"";(r=Tn.exec(e))&&(o=_n.exec(t));)(s=o.index)>n&&(s=t.slice(n,s),a[i]?a[i]+=s:a[++i]=s),(r=r[0])===(o=o[0])?a[i]?a[i]+=o:a[++i]=o:(a[++i]=null,u.push({i,x:Re(r,o)})),n=_n.lastIndex;return n<t.length&&(s=t.slice(n),a[i]?a[i]+=s:a[++i]=s),a.length<2?u[0]?Dc(u[0].x):Rc(t):(t=u.length,function(c){for(var l=0,f;l<t;++l)a[(f=u[l]).i]=f.x(c);return a.join("")})}var Ar=180/Math.PI,zn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Mo(e,t,n,r,o,s){var i,a,u;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,u/=a),e*r<t*n&&(e=-e,t=-t,u=-u,i=-i),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*Ar,skewX:Math.atan(u)*Ar,scaleX:i,scaleY:a}}var Vt;function jc(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?zn:Mo(t.a,t.b,t.c,t.d,t.e,t.f)}function Hc(e){return e==null||(Vt||(Vt=document.createElementNS("http://www.w3.org/2000/svg","g")),Vt.setAttribute("transform",e),!(e=Vt.transform.baseVal.consolidate()))?zn:(e=e.matrix,Mo(e.a,e.b,e.c,e.d,e.e,e.f))}function Ao(e,t,n,r){function o(c){return c.length?c.pop()+" ":""}function s(c,l,f,d,p,v){if(c!==f||l!==d){var g=p.push("translate(",null,t,null,n);v.push({i:g-4,x:Re(c,f)},{i:g-2,x:Re(l,d)})}else(f||d)&&p.push("translate("+f+t+d+n)}function i(c,l,f,d){c!==l?(c-l>180?l+=360:l-c>180&&(c+=360),d.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Re(c,l)})):l&&f.push(o(f)+"rotate("+l+r)}function a(c,l,f,d){c!==l?d.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Re(c,l)}):l&&f.push(o(f)+"skewX("+l+r)}function u(c,l,f,d,p,v){if(c!==f||l!==d){var g=p.push(o(p)+"scale(",null,",",null,")");v.push({i:g-4,x:Re(c,f)},{i:g-2,x:Re(l,d)})}else(f!==1||d!==1)&&p.push(o(p)+"scale("+f+","+d+")")}return function(c,l){var f=[],d=[];return c=e(c),l=e(l),s(c.translateX,c.translateY,l.translateX,l.translateY,f,d),i(c.rotate,l.rotate,f,d),a(c.skewX,l.skewX,f,d),u(c.scaleX,c.scaleY,l.scaleX,l.scaleY,f,d),c=l=null,function(p){for(var v=-1,g=d.length,b;++v<g;)f[(b=d[v]).i]=b.x(p);return f.join("")}}}var Fc=Ao(jc,"px, ","px)","deg)"),Lc=Ao(Hc,", ",")",")"),Bc=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 Oc(e){return((e=Math.exp(2*e))-1)/(e+1)}const Wc=(function e(t,n,r){function o(s,i){var a=s[0],u=s[1],c=s[2],l=i[0],f=i[1],d=i[2],p=l-a,v=f-u,g=p*p+v*v,b,y;if(g<Bc)y=Math.log(d/c)/t,b=function(D){return[a+D*p,u+D*v,c*Math.exp(t*D*y)]};else{var _=Math.sqrt(g),x=(d*d-c*c+r*g)/(2*c*n*_),m=(d*d-c*c-r*g)/(2*d*n*_),C=Math.log(Math.sqrt(x*x+1)-x),A=Math.log(Math.sqrt(m*m+1)-m);y=(A-C)/t,b=function(D){var j=D*y,I=Ir(C),R=c/(n*_)*(I*Oc(t*j+C)-Vc(C));return[a+R*p,u+R*v,c*I/Ir(t*j+C)]}}return b.duration=y*1e3*t/Math.SQRT2,b}return o.rho=function(s){var i=Math.max(.001,+s),a=i*i,u=a*a;return e(i,a,u)},o})(Math.SQRT2,2,4);var pt=0,Nt=0,vt=0,Io=1e3,tn,kt,nn=0,Ke=0,ln=0,Tt=typeof performance=="object"&&performance.now?performance:Date,To=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function qn(){return Ke||(To(Yc),Ke=Tt.now()+ln)}function Yc(){Ke=0}function rn(){this._call=this._time=this._next=null}rn.prototype=zo.prototype={constructor:rn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?qn():+n)+(t==null?0:+t),!this._next&&kt!==this&&(kt?kt._next=this:tn=this,kt=this),this._call=e,this._time=n,Rn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Rn())}};function zo(e,t,n){var r=new rn;return r.restart(e,t,n),r}function Uc(){qn(),++pt;for(var e=tn,t;e;)(t=Ke-e._time)>=0&&e._call.call(void 0,t),e=e._next;--pt}function Tr(){Ke=(nn=Tt.now())+ln,pt=Nt=0;try{Uc()}finally{pt=0,qc(),Ke=0}}function Xc(){var e=Tt.now(),t=e-nn;t>Io&&(ln-=t,nn=e)}function qc(){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,Rn(r)}function Rn(e){if(!pt){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,Io)),pt=1,To(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 Gc=an("start","end","cancel","interrupt"),Zc=[],Ro=0,Rr=1,Dn=2,Gt=3,Dr=4,Pn=5,Zt=6;function un(e,t,n,r,o,s){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;Kc(e,n,{name:t,index:r,group:o,on:Gc,tween:Zc,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Ro})}function Gn(e,t){var n=ve(e,t);if(n.state>Ro)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 Kc(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=zo(s,0,n.time);function s(c){n.state=Rr,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var l,f,d,p;if(n.state!==Rr)return u();for(l in r)if(p=r[l],p.name===n.name){if(p.state===Gt)return zr(i);p.state===Dr?(p.state=Zt,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[l]):+l<t&&(p.state=Zt,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[l])}if(zr(function(){n.state===Gt&&(n.state=Dr,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Dn,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Dn){for(n.state=Gt,o=new Array(d=n.tween.length),l=0,f=-1;l<d;++l)(p=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=p);o.length=f+1}}function a(c){for(var l=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(u),n.state=Pn,1),f=-1,d=o.length;++f<d;)o[f].call(e,l);n.state===Pn&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Zt,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function Kt(e,t){var n=e.__transition,r,o,s=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){s=!1;continue}o=r.state>Dn&&r.state<Pn,r.state=Zt,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}s&&delete e.__transition}}function Qc(e){return this.each(function(){Kt(this,e)})}function Jc(e,t){var n,r;return function(){var o=Ne(this,e),s=o.tween;if(s!==n){r=n=s;for(var i=0,a=r.length;i<a;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}o.tween=r}}function el(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var s=Ne(this,e),i=s.tween;if(i!==r){o=(r=i).slice();for(var a={name:t,value:n},u=0,c=o.length;u<c;++u)if(o[u].name===t){o[u]=a;break}u===c&&o.push(a)}s.tween=o}}function tl(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ve(this.node(),n).tween,o=0,s=r.length,i;o<s;++o)if((i=r[o]).name===e)return i.value;return null}return this.each((t==null?Jc:el)(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 Do(e,t){var n;return(typeof t=="number"?Re:t instanceof It?Mr:(n=It(t))?(t=n,Mr):Pc)(e,t)}function nl(e){return function(){this.removeAttribute(e)}}function rl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ol(e,t,n){var r,o=n+"",s;return function(){var i=this.getAttribute(e);return i===o?null:i===r?s:s=t(r=i,n)}}function sl(e,t,n){var r,o=n+"",s;return function(){var i=this.getAttributeNS(e.space,e.local);return i===o?null:i===r?s:s=t(r=i,n)}}function il(e,t,n){var r,o,s;return function(){var i,a=n(this),u;return a==null?void this.removeAttribute(e):(i=this.getAttribute(e),u=a+"",i===u?null:i===r&&u===o?s:(o=u,s=t(r=i,a)))}}function al(e,t,n){var r,o,s;return function(){var i,a=n(this),u;return a==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),u=a+"",i===u?null:i===r&&u===o?s:(o=u,s=t(r=i,a)))}}function cl(e,t){var n=cn(e),r=n==="transform"?Lc:Do;return this.attrTween(e,typeof t=="function"?(n.local?al:il)(n,r,Zn(this,"attr."+e,t)):t==null?(n.local?rl:nl)(n):(n.local?sl:ol)(n,r,t))}function ll(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ul(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function fl(e,t){var n,r;function o(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ul(e,s)),n}return o._value=t,o}function dl(e,t){var n,r;function o(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ll(e,s)),n}return o._value=t,o}function hl(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?fl:dl)(r,t))}function pl(e,t){return function(){Gn(this,e).delay=+t.apply(this,arguments)}}function gl(e,t){return t=+t,function(){Gn(this,e).delay=t}}function ml(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pl:gl)(t,e)):ve(this.node(),t).delay}function yl(e,t){return function(){Ne(this,e).duration=+t.apply(this,arguments)}}function xl(e,t){return t=+t,function(){Ne(this,e).duration=t}}function wl(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yl:xl)(t,e)):ve(this.node(),t).duration}function vl(e,t){if(typeof t!="function")throw new Error;return function(){Ne(this,e).ease=t}}function bl(e){var t=this._id;return arguments.length?this.each(vl(t,e)):ve(this.node(),t).ease}function _l(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ne(this,e).ease=n}}function Sl(e){if(typeof e!="function")throw new Error;return this.each(_l(this._id,e))}function El(e){typeof e!="function"&&(e=ho(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],i=s.length,a=r[o]=[],u,c=0;c<i;++c)(u=s[c])&&e.call(u,u.__data__,c,s)&&a.push(u);return new Ae(r,this._parents,this._name,this._id)}function Nl(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,s=Math.min(r,o),i=new Array(r),a=0;a<s;++a)for(var u=t[a],c=n[a],l=u.length,f=i[a]=new Array(l),d,p=0;p<l;++p)(d=u[p]||c[p])&&(f[p]=d);for(;a<r;++a)i[a]=t[a];return new Ae(i,this._parents,this._name,this._id)}function kl(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 $l(e,t,n){var r,o,s=kl(t)?Gn:Ne;return function(){var i=s(this,e),a=i.on;a!==r&&(o=(r=a).copy()).on(t,n),i.on=o}}function Cl(e,t){var n=this._id;return arguments.length<2?ve(this.node(),n).on.on(e):this.each($l(n,e,t))}function Ml(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",Ml(this._id))}function Il(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Yn(e));for(var r=this._groups,o=r.length,s=new Array(o),i=0;i<o;++i)for(var a=r[i],u=a.length,c=s[i]=new Array(u),l,f,d=0;d<u;++d)(l=a[d])&&(f=e.call(l,l.__data__,d,a))&&("__data__"in l&&(f.__data__=l.__data__),c[d]=f,un(c[d],t,n,d,c,ve(l,n)));return new Ae(s,this._parents,t,n)}function Tl(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fo(e));for(var r=this._groups,o=r.length,s=[],i=[],a=0;a<o;++a)for(var u=r[a],c=u.length,l,f=0;f<c;++f)if(l=u[f]){for(var d=e.call(l,l.__data__,f,u),p,v=ve(l,n),g=0,b=d.length;g<b;++g)(p=d[g])&&un(p,t,n,g,d,v);s.push(d),i.push(l)}return new Ae(s,i,t,n)}var zl=Pt.prototype.constructor;function Rl(){return new zl(this._groups,this._parents)}function Dl(e,t){var n,r,o;return function(){var s=ht(this,e),i=(this.style.removeProperty(e),ht(this,e));return s===i?null:s===n&&i===r?o:o=t(n=s,r=i)}}function Po(e){return function(){this.style.removeProperty(e)}}function Pl(e,t,n){var r,o=n+"",s;return function(){var i=ht(this,e);return i===o?null:i===r?s:s=t(r=i,n)}}function jl(e,t,n){var r,o,s;return function(){var i=ht(this,e),a=n(this),u=a+"";return a==null&&(u=a=(this.style.removeProperty(e),ht(this,e))),i===u?null:i===r&&u===o?s:(o=u,s=t(r=i,a))}}function Hl(e,t){var n,r,o,s="style."+t,i="end."+s,a;return function(){var u=Ne(this,e),c=u.on,l=u.value[s]==null?a||(a=Po(t)):void 0;(c!==n||o!==l)&&(r=(n=c).copy()).on(i,o=l),u.on=r}}function Fl(e,t,n){var r=(e+="")=="transform"?Fc:Do;return t==null?this.styleTween(e,Dl(e,r)).on("end.style."+e,Po(e)):typeof t=="function"?this.styleTween(e,jl(e,r,Zn(this,"style."+e,t))).each(Hl(this._id,e)):this.styleTween(e,Pl(e,r,t),n).on("end.style."+e,null)}function Ll(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Bl(e,t,n){var r,o;function s(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&Ll(e,i,n)),r}return s._value=t,s}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,Bl(e,t,n??""))}function Ol(e){return function(){this.textContent=e}}function Wl(e){return function(){var t=e(this);this.textContent=t??""}}function Yl(e){return this.tween("text",typeof e=="function"?Wl(Zn(this,"text",e)):Ol(e==null?"":e+""))}function Ul(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)&&Ul(o)),t}return r._value=e,r}function ql(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 Gl(){for(var e=this._name,t=this._id,n=jo(),r=this._groups,o=r.length,s=0;s<o;++s)for(var i=r[s],a=i.length,u,c=0;c<a;++c)if(u=i[c]){var l=ve(u,t);un(u,e,n,c,i,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Ae(r,this._parents,e,n)}function Zl(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(s,i){var a={value:i},u={value:function(){--o===0&&s()}};n.each(function(){var c=Ne(this,r),l=c.on;l!==e&&(t=(e=l).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(u)),c.on=t}),o===0&&s()})}var Kl=0;function Ae(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function jo(){return++Kl}var Ce=Pt.prototype;Ae.prototype={constructor:Ae,select:Il,selectAll:Tl,selectChild:Ce.selectChild,selectChildren:Ce.selectChildren,filter:El,merge:Nl,selection:Rl,transition:Gl,call:Ce.call,nodes:Ce.nodes,node:Ce.node,size:Ce.size,empty:Ce.empty,each:Ce.each,on:Cl,attr:cl,attrTween:hl,style:Fl,styleTween:Vl,text:Yl,textTween:ql,remove:Al,tween:tl,delay:ml,duration:wl,ease:bl,easeVarying:Sl,end:Zl,[Symbol.iterator]:Ce[Symbol.iterator]};function Ql(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Jl={time:null,delay:0,duration:250,ease:Ql};function eu(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 tu(e){var t,n;e instanceof Ae?(t=e._id,e=e._name):(t=jo(),(n=Jl).time=qn(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,s=0;s<o;++s)for(var i=r[s],a=i.length,u,c=0;c<a;++c)(u=i[c])&&un(u,e,t,c,i,n||eu(u,t));return new Ae(r,this._parents,e,t)}Pt.prototype.interrupt=Qc;Pt.prototype.transition=tu;const Ot=e=>()=>e;function nu(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 je=new Me(1,0,0);Me.prototype;function Sn(e){e.stopImmediatePropagation()}function bt(e){e.preventDefault(),e.stopImmediatePropagation()}function ru(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ou(){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 Pr(){return this.__zoom||je}function su(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function iu(){return navigator.maxTouchPoints||"ontouchstart"in this}function au(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}function cu(){var e=ru,t=ou,n=au,r=su,o=iu,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],a=250,u=Wc,c=an("start","zoom","end"),l,f,d,p=500,v=150,g=0,b=10;function y(h){h.property("__zoom",Pr).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",R).filter(o).on("touchstart.zoom",P).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(h,$,N,z){var H=h.selection?h.selection():h;H.property("__zoom",Pr),h!==H?C(h,$,N,z):H.interrupt().each(function(){A(this,arguments).event(z).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},y.scaleBy=function(h,$,N,z){y.scaleTo(h,function(){var H=this.__zoom.k,S=typeof $=="function"?$.apply(this,arguments):$;return H*S},N,z)},y.scaleTo=function(h,$,N,z){y.transform(h,function(){var H=t.apply(this,arguments),S=this.__zoom,T=N==null?m(H):typeof N=="function"?N.apply(this,arguments):N,F=S.invert(T),k=typeof $=="function"?$.apply(this,arguments):$;return n(x(_(S,k),T,F),H,i)},N,z)},y.translateBy=function(h,$,N,z){y.transform(h,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof N=="function"?N.apply(this,arguments):N),t.apply(this,arguments),i)},null,z)},y.translateTo=function(h,$,N,z,H){y.transform(h,function(){var S=t.apply(this,arguments),T=this.__zoom,F=z==null?m(S):typeof z=="function"?z.apply(this,arguments):z;return n(je.translate(F[0],F[1]).scale(T.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof N=="function"?-N.apply(this,arguments):-N),S,i)},z,H)};function _(h,$){return $=Math.max(s[0],Math.min(s[1],$)),$===h.k?h:new Me($,h.x,h.y)}function x(h,$,N){var z=$[0]-N[0]*h.k,H=$[1]-N[1]*h.k;return z===h.x&&H===h.y?h:new Me(h.k,z,H)}function m(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function C(h,$,N,z){h.on("start.zoom",function(){A(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(z).end()}).tween("zoom",function(){var H=this,S=arguments,T=A(H,S).event(z),F=t.apply(H,S),k=N==null?m(F):typeof N=="function"?N.apply(H,S):N,V=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),O=H.__zoom,U=typeof $=="function"?$.apply(H,S):$,q=u(O.invert(k).concat(V/O.k),U.invert(k).concat(V/U.k));return function(G){if(G===1)G=U;else{var Z=q(G),ee=V/Z[2];G=new Me(ee,k[0]-Z[0]*ee,k[1]-Z[1]*ee)}T.zoom(null,G)}})}function A(h,$,N){return!N&&h.__zooming||new D(h,$)}function D(h,$){this.that=h,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(h,$),this.taps=0}D.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,$){return this.mouse&&h!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&h!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&h!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(h){var $=ye(this.that).datum();c.call(h,this.that,new nu(h,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:c}),$)}};function j(h,...$){if(!e.apply(this,arguments))return;var N=A(this,$).event(h),z=this.__zoom,H=Math.max(s[0],Math.min(s[1],z.k*Math.pow(2,r.apply(this,arguments)))),S=Se(h);if(N.wheel)(N.mouse[0][0]!==S[0]||N.mouse[0][1]!==S[1])&&(N.mouse[1]=z.invert(N.mouse[0]=S)),clearTimeout(N.wheel);else{if(z.k===H)return;N.mouse=[S,z.invert(S)],Kt(this),N.start()}bt(h),N.wheel=setTimeout(T,v),N.zoom("mouse",n(x(_(z,H),N.mouse[0],N.mouse[1]),N.extent,i));function T(){N.wheel=null,N.end()}}function I(h,...$){if(d||!e.apply(this,arguments))return;var N=h.currentTarget,z=A(this,$,!0).event(h),H=ye(h.view).on("mousemove.zoom",k,!0).on("mouseup.zoom",V,!0),S=Se(h,N),T=h.clientX,F=h.clientY;So(h.view),Sn(h),z.mouse=[S,this.__zoom.invert(S)],Kt(this),z.start();function k(O){if(bt(O),!z.moved){var U=O.clientX-T,q=O.clientY-F;z.moved=U*U+q*q>g}z.event(O).zoom("mouse",n(x(z.that.__zoom,z.mouse[0]=Se(O,N),z.mouse[1]),z.extent,i))}function V(O){H.on("mousemove.zoom mouseup.zoom",null),Eo(O.view,z.moved),bt(O),z.event(O).end()}}function R(h,...$){if(e.apply(this,arguments)){var N=this.__zoom,z=Se(h.changedTouches?h.changedTouches[0]:h,this),H=N.invert(z),S=N.k*(h.shiftKey?.5:2),T=n(x(_(N,S),z,H),t.apply(this,$),i);bt(h),a>0?ye(this).transition().duration(a).call(C,T,z,h):ye(this).call(y.transform,T,z,h)}}function P(h,...$){if(e.apply(this,arguments)){var N=h.touches,z=N.length,H=A(this,$,h.changedTouches.length===z).event(h),S,T,F,k;for(Sn(h),T=0;T<z;++T)F=N[T],k=Se(F,this),k=[k,this.__zoom.invert(k),F.identifier],H.touch0?!H.touch1&&H.touch0[2]!==k[2]&&(H.touch1=k,H.taps=0):(H.touch0=k,S=!0,H.taps=1+!!l);l&&(l=clearTimeout(l)),S&&(H.taps<2&&(f=k[0],l=setTimeout(function(){l=null},p)),Kt(this),H.start())}}function B(h,...$){if(this.__zooming){var N=A(this,$).event(h),z=h.changedTouches,H=z.length,S,T,F,k;for(bt(h),S=0;S<H;++S)T=z[S],F=Se(T,this),N.touch0&&N.touch0[2]===T.identifier?N.touch0[0]=F:N.touch1&&N.touch1[2]===T.identifier&&(N.touch1[0]=F);if(T=N.that.__zoom,N.touch1){var V=N.touch0[0],O=N.touch0[1],U=N.touch1[0],q=N.touch1[1],G=(G=U[0]-V[0])*G+(G=U[1]-V[1])*G,Z=(Z=q[0]-O[0])*Z+(Z=q[1]-O[1])*Z;T=_(T,Math.sqrt(G/Z)),F=[(V[0]+U[0])/2,(V[1]+U[1])/2],k=[(O[0]+q[0])/2,(O[1]+q[1])/2]}else if(N.touch0)F=N.touch0[0],k=N.touch0[1];else return;N.zoom("touch",n(x(T,F,k),N.extent,i))}}function L(h,...$){if(this.__zooming){var N=A(this,$).event(h),z=h.changedTouches,H=z.length,S,T;for(Sn(h),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),S=0;S<H;++S)T=z[S],N.touch0&&N.touch0[2]===T.identifier?delete N.touch0:N.touch1&&N.touch1[2]===T.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(T=Se(T,this),Math.hypot(f[0]-T[0],f[1]-T[1])<b)){var F=ye(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return y.wheelDelta=function(h){return arguments.length?(r=typeof h=="function"?h:Ot(+h),y):r},y.filter=function(h){return arguments.length?(e=typeof h=="function"?h:Ot(!!h),y):e},y.touchable=function(h){return arguments.length?(o=typeof h=="function"?h:Ot(!!h),y):o},y.extent=function(h){return arguments.length?(t=typeof h=="function"?h:Ot([[+h[0][0],+h[0][1]],[+h[1][0],+h[1][1]]]),y):t},y.scaleExtent=function(h){return arguments.length?(s[0]=+h[0],s[1]=+h[1],y):[s[0],s[1]]},y.translateExtent=function(h){return arguments.length?(i[0][0]=+h[0][0],i[1][0]=+h[1][0],i[0][1]=+h[0][1],i[1][1]=+h[1][1],y):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},y.constrain=function(h){return arguments.length?(n=h,y):n},y.duration=function(h){return arguments.length?(a=+h,y):a},y.interpolate=function(h){return arguments.length?(u=h,y):u},y.on=function(){var h=c.on.apply(c,arguments);return h===c?y:h},y.clickDistance=function(h){return arguments.length?(g=(h=+h)*h,y):Math.sqrt(g)},y.tapDistance=function(h){return arguments.length?(b=+h,y):b},y}gi();const fn=E.createContext(null),lu=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.`},Ho=Ie.error001();function J(e,t){const n=E.useContext(fn);if(n===null)throw new Error(Ho);return lo(n,e,t)}const oe=()=>{const e=E.useContext(fn);if(e===null)throw new Error(Ho);return E.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},uu=e=>e.userSelectionActive?"none":"all";function Fo({position:e,children:t,className:n,style:r,...o}){const s=J(uu),i=`${e}`.split("-");return M.createElement("div",{className:ae(["react-flow__panel",n,...i]),style:{...r,pointerEvents:s},...o},t)}function fu({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:M.createElement(Fo,{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"},M.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const du=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:s={},labelBgPadding:i=[2,4],labelBgBorderRadius:a=2,children:u,className:c,...l})=>{const f=E.useRef(null),[d,p]=E.useState({x:0,y:0,width:0,height:0}),v=ae(["react-flow__edge-textwrapper",c]);return E.useEffect(()=>{if(f.current){const g=f.current.getBBox();p({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),typeof n>"u"||!n?null:M.createElement("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:v,visibility:d.width?"visible":"hidden",...l},o&&M.createElement("rect",{width:d.width+2*i[0],x:-i[0],y:-i[1],height:d.height+2*i[1],className:"react-flow__edge-textbg",style:s,rx:a,ry:a}),M.createElement("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:f,style:r},n),u)};var hu=E.memo(du);const Kn=e=>({width:e.offsetWidth,height:e.offsetHeight}),gt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Qn=(e={x:0,y:0},t)=>({x:gt(e.x,t[0][0],t[1][0]),y:gt(e.y,t[0][1],t[1][1])}),jr=(e,t,n)=>e<t?gt(Math.abs(e-t),1,50)/50:e>n?-gt(Math.abs(e-n),1,50)/50:0,Lo=(e,t)=>{const n=jr(e.x,35,t.width-35)*20,r=jr(e.y,35,t.height-35)*20;return[n,r]},Bo=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},pu=(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}),gu=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Hr=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),jn=(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)},mu=e=>he(e.width)&&he(e.height)&&he(e.x)&&he(e.y),he=e=>!isNaN(e)&&isFinite(e),te=Symbol.for("internals"),Vo=["Enter"," ","Escape"],yu=(e,t)=>{},xu=e=>"nativeEvent"in e;function Hn(e){var o,s;const t=xu(e)?e.nativeEvent:e,n=((s=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:s[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 Oo=e=>"clientX"in e,He=(e,t)=>{var s,i;const n=Oo(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,o=n?e.clientY:(i=e.touches)==null?void 0:i[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},Ht=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:l,markerEnd:f,markerStart:d,interactionWidth:p=20})=>M.createElement(M.Fragment,null,M.createElement("path",{id:e,style:l,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:d}),p&&M.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}),o&&he(n)&&he(r)?M.createElement(hu,{x:n,y:r,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c}):null);Ht.displayName="BaseEdge";function _t(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(s=>s.id===e);o&&n(r,{...o})}}function Wo({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,s=n<e?n+o:n-o,i=Math.abs(r-t)/2,a=r<t?r+i:r-i;return[s,a,o,i]}function Yo({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:s,targetControlX:i,targetControlY:a}){const u=e*.125+o*.375+i*.375+n*.125,c=t*.125+s*.375+a*.375+r*.125,l=Math.abs(u-e),f=Math.abs(c-t);return[u,c,l,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 Pe;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Pe||(Pe={}));var Rt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Rt||(Rt={}));var W;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(W||(W={}));function Fr({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===W.Left||e===W.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Uo({sourceX:e,sourceY:t,sourcePosition:n=W.Bottom,targetX:r,targetY:o,targetPosition:s=W.Top}){const[i,a]=Fr({pos:n,x1:e,y1:t,x2:r,y2:o}),[u,c]=Fr({pos:s,x1:r,y1:o,x2:e,y2:t}),[l,f,d,p]=Yo({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${i},${a} ${u},${c} ${r},${o}`,l,f,d,p]}const er=E.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=W.Bottom,targetPosition:s=W.Top,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:p,markerStart:v,interactionWidth:g})=>{const[b,y,_]=Uo({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return M.createElement(Ht,{path:b,labelX:y,labelY:_,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:p,markerStart:v,interactionWidth:g})});er.displayName="SimpleBezierEdge";const Lr={[W.Left]:{x:-1,y:0},[W.Right]:{x:1,y:0},[W.Top]:{x:0,y:-1},[W.Bottom]:{x:0,y:1}},wu=({source:e,sourcePosition:t=W.Bottom,target:n})=>t===W.Left||t===W.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 vu({source:e,sourcePosition:t=W.Bottom,target:n,targetPosition:r=W.Top,center:o,offset:s}){const i=Lr[t],a=Lr[r],u={x:e.x+i.x*s,y:e.y+i.y*s},c={x:n.x+a.x*s,y:n.y+a.y*s},l=wu({source:u,sourcePosition:t,target:c}),f=l.x!==0?"x":"y",d=l[f];let p=[],v,g;const b={x:0,y:0},y={x:0,y:0},[_,x,m,C]=Wo({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[f]*a[f]===-1){v=o.x??_,g=o.y??x;const D=[{x:v,y:u.y},{x:v,y:c.y}],j=[{x:u.x,y:g},{x:c.x,y:g}];i[f]===d?p=f==="x"?D:j:p=f==="x"?j:D}else{const D=[{x:u.x,y:c.y}],j=[{x:c.x,y:u.y}];if(f==="x"?p=i.x===d?j:D:p=i.y===d?D:j,t===r){const L=Math.abs(e[f]-n[f]);if(L<=s){const h=Math.min(s-1,s-L);i[f]===d?b[f]=(u[f]>e[f]?-1:1)*h:y[f]=(c[f]>n[f]?-1:1)*h}}if(t!==r){const L=f==="x"?"y":"x",h=i[f]===a[L],$=u[L]>c[L],N=u[L]<c[L];(i[f]===1&&(!h&&$||h&&N)||i[f]!==1&&(!h&&N||h&&$))&&(p=f==="x"?D:j)}const I={x:u.x+b.x,y:u.y+b.y},R={x:c.x+y.x,y:c.y+y.y},P=Math.max(Math.abs(I.x-p[0].x),Math.abs(R.x-p[0].x)),B=Math.max(Math.abs(I.y-p[0].y),Math.abs(R.y-p[0].y));P>=B?(v=(I.x+R.x)/2,g=p[0].y):(v=p[0].x,g=(I.y+R.y)/2)}return[[e,{x:u.x+b.x,y:u.y+b.y},...p,{x:c.x+y.x,y:c.y+y.y},n],v,g,m,C]}function bu(e,t,n,r){const o=Math.min(Br(e,t)/2,Br(t,n)/2,r),{x:s,y:i}=t;if(e.x===s&&s===n.x||e.y===i&&i===n.y)return`L${s} ${i}`;if(e.y===i){const c=e.x<n.x?-1:1,l=e.y<n.y?1:-1;return`L ${s+o*c},${i}Q ${s},${i} ${s},${i+o*l}`}const a=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${s},${i+o*u}Q ${s},${i} ${s+o*a},${i}`}function Fn({sourceX:e,sourceY:t,sourcePosition:n=W.Bottom,targetX:r,targetY:o,targetPosition:s=W.Top,borderRadius:i=5,centerX:a,centerY:u,offset:c=20}){const[l,f,d,p,v]=vu({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:s,center:{x:a,y:u},offset:c});return[l.reduce((b,y,_)=>{let x="";return _>0&&_<l.length-1?x=bu(l[_-1],y,l[_+1],i):x=`${_===0?"M":"L"}${y.x} ${y.y}`,b+=x,b},""),f,d,p,v]}const dn=E.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:l,sourcePosition:f=W.Bottom,targetPosition:d=W.Top,markerEnd:p,markerStart:v,pathOptions:g,interactionWidth:b})=>{const[y,_,x]=Fn({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:d,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset});return M.createElement(Ht,{path:y,labelX:_,labelY:x,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:l,markerEnd:p,markerStart:v,interactionWidth:b})});dn.displayName="SmoothStepEdge";const tr=E.memo(e=>{var t;return M.createElement(dn,{...e,pathOptions:E.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 _u({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,s,i,a]=Wo({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,s,i,a]}const nr=E.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:l,markerEnd:f,markerStart:d,interactionWidth:p})=>{const[v,g,b]=_u({sourceX:e,sourceY:t,targetX:n,targetY:r});return M.createElement(Ht,{path:v,labelX:g,labelY:b,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:u,labelBgBorderRadius:c,style:l,markerEnd:f,markerStart:d,interactionWidth:p})});nr.displayName="StraightEdge";function Wt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Vr({pos:e,x1:t,y1:n,x2:r,y2:o,c:s}){switch(e){case W.Left:return[t-Wt(t-r,s),n];case W.Right:return[t+Wt(r-t,s),n];case W.Top:return[t,n-Wt(n-o,s)];case W.Bottom:return[t,n+Wt(o-n,s)]}}function Xo({sourceX:e,sourceY:t,sourcePosition:n=W.Bottom,targetX:r,targetY:o,targetPosition:s=W.Top,curvature:i=.25}){const[a,u]=Vr({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,l]=Vr({pos:s,x1:r,y1:o,x2:e,y2:t,c:i}),[f,d,p,v]=Yo({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:l});return[`M${e},${t} C${a},${u} ${c},${l} ${r},${o}`,f,d,p,v]}const sn=E.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=W.Bottom,targetPosition:s=W.Top,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:p,markerStart:v,pathOptions:g,interactionWidth:b})=>{const[y,_,x]=Xo({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s,curvature:g==null?void 0:g.curvature});return M.createElement(Ht,{path:y,labelX:_,labelY:x,label:i,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:p,markerStart:v,interactionWidth:b})});sn.displayName="BezierEdge";const rr=E.createContext(null),Su=rr.Provider;rr.Consumer;const Eu=()=>E.useContext(rr),Nu=e=>"id"in e&&"source"in e&&"target"in e,ku=({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("&")}`,$u=(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)),Cu=(e,t)=>{if(!e.source||!e.target)return t;let n;return Nu(e)?n={...e}:n={...e,id:ku(e)},$u(n,t)?t:t.concat(n)},Bn=({x:e,y:t},[n,r,o],s,[i,a])=>{const u={x:(e-n)/o,y:(t-r)/o};return s?{x:i*Math.round(u.x/i),y:a*Math.round(u.y/a)}:u},qo=({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:s,y:i}=ft(o,t).positionAbsolute;return pu(r,Jn({x:s,y:i,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return gu(n)},Go=(e,t,[n,r,o]=[0,0,1],s=!1,i=!1,a=[0,0])=>{const u={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach(l=>{const{width:f,height:d,selectable:p=!0,hidden:v=!1}=l;if(i&&!p||v)return!1;const{positionAbsolute:g}=ft(l,a),b={x:g.x,y:g.y,width:f||0,height:d||0},y=jn(u,b),_=typeof f>"u"||typeof d>"u"||f===null||d===null,x=s&&y>0,m=(f||0)*(d||0);(_||x||y>=m||l.dragging)&&c.push(l)}),c},Zo=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},Ko=(e,t,n,r,o,s=.1)=>{const i=t/(e.width*(1+s)),a=n/(e.height*(1+s)),u=Math.min(i,a),c=gt(u,r,o),l=e.x+e.width/2,f=e.y+e.height/2,d=t/2-l*c,p=n/2-f*c;return{x:d,y:p,zoom:c}},Xe=(e,t=0)=>e.transition().duration(t);function Or(e,t,n,r){return(t[n]||[]).reduce((o,s)=>{var i,a;return`${e.id}-${s.id}-${n}`!==r&&o.push({id:s.id||null,type:n,nodeId:e.id,x:(((i=e.positionAbsolute)==null?void 0:i.x)??0)+s.x+s.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+s.y+s.height/2}),o},[])}function Mu(e,t,n,r,o,s){const{x:i,y:a}=He(e),c=t.elementsFromPoint(i,a).find(v=>v.classList.contains("react-flow__handle"));if(c){const v=c.getAttribute("data-nodeid");if(v){const g=sr(void 0,c),b=c.getAttribute("data-handleid"),y=s({nodeId:v,id:b,type:g});if(y){const _=o.find(x=>x.nodeId===v&&x.type===g&&x.id===b);return{handle:{id:b,type:g,nodeId:v,x:(_==null?void 0:_.x)||n.x,y:(_==null?void 0:_.y)||n.y},validHandleResult:y}}}}let l=[],f=1/0;if(o.forEach(v=>{const g=Math.sqrt((v.x-n.x)**2+(v.y-n.y)**2);if(g<=r){const b=s(v);g<=f&&(g<f?l=[{handle:v,validHandleResult:b}]:g===f&&l.push({handle:v,validHandleResult:b}),f=g)}}),!l.length)return{handle:null,validHandleResult:Qo()};if(l.length===1)return l[0];const d=l.some(({validHandleResult:v})=>v.isValid),p=l.some(({handle:v})=>v.type==="target");return l.find(({handle:v,validHandleResult:g})=>p?v.type==="target":d?g.isValid:!0)||l[0]}const Au={source:null,target:null,sourceHandle:null,targetHandle:null},Qo=()=>({handleDomNode:null,isValid:!1,connection:Au,endHandle:null});function Jo(e,t,n,r,o,s,i){const a=o==="target",u=i.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),c={...Qo(),handleDomNode:u};if(u){const l=sr(void 0,u),f=u.getAttribute("data-nodeid"),d=u.getAttribute("data-handleid"),p=u.classList.contains("connectable"),v=u.classList.contains("connectableend"),g={source:a?f:n,sourceHandle:a?d:r,target:a?n:f,targetHandle:a?r:d};c.connection=g,p&&v&&(t===Qe.Strict?a&&l==="source"||!a&&l==="target":f!==n||d!==r)&&(c.endHandle={nodeId:f,handleId:d,type:l},c.isValid=s(g))}return c}function Iu({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,s)=>{if(s[te]){const{handleBounds:i}=s[te];let a=[],u=[];i&&(a=Or(s,i,"source",`${t}-${n}-${r}`),u=Or(s,i,"target",`${t}-${n}-${r}`)),o.push(...a,...u)}return o},[])}function sr(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function En(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Tu(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function es({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:s,setState:i,isValidConnection:a,edgeUpdaterType:u,onReconnectEnd:c}){const l=Bo(e.target),{connectionMode:f,domNode:d,autoPanOnConnect:p,connectionRadius:v,onConnectStart:g,panBy:b,getNodes:y,cancelConnection:_}=s();let x=0,m;const{x:C,y:A}=He(e),D=l==null?void 0:l.elementFromPoint(C,A),j=sr(u,D),I=d==null?void 0:d.getBoundingClientRect();if(!I||!j)return;let R,P=He(e,I),B=!1,L=null,h=!1,$=null;const N=Iu({nodes:y(),nodeId:n,handleId:t,handleType:j}),z=()=>{if(!p)return;const[T,F]=Lo(P,I);b({x:T,y:F}),x=requestAnimationFrame(z)};i({connectionPosition:P,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:j,connectionStartHandle:{nodeId:n,handleId:t,type:j},connectionEndHandle:null}),g==null||g(e,{nodeId:n,handleId:t,handleType:j});function H(T){const{transform:F}=s();P=He(T,I);const{handle:k,validHandleResult:V}=Mu(T,l,Bn(P,F,!1,[1,1]),v,N,O=>Jo(O,f,n,t,o?"target":"source",a,l));if(m=k,B||(z(),B=!0),$=V.handleDomNode,L=V.connection,h=V.isValid,i({connectionPosition:m&&h?qo({x:m.x,y:m.y},F):P,connectionStatus:Tu(!!m,h),connectionEndHandle:V.endHandle}),!m&&!h&&!$)return En(R);L.source!==L.target&&$&&(En(R),R=$,$.classList.add("connecting","react-flow__handle-connecting"),$.classList.toggle("valid",h),$.classList.toggle("react-flow__handle-valid",h))}function S(T){var F,k;(m||$)&&L&&h&&(r==null||r(L)),(k=(F=s()).onConnectEnd)==null||k.call(F,T),u&&(c==null||c(T)),En(R),_(),cancelAnimationFrame(x),B=!1,h=!1,L=null,$=null,l.removeEventListener("mousemove",H),l.removeEventListener("mouseup",S),l.removeEventListener("touchmove",H),l.removeEventListener("touchend",S)}l.addEventListener("mousemove",H),l.addEventListener("mouseup",S),l.addEventListener("touchmove",H),l.addEventListener("touchend",S)}const Wr=()=>!0,zu=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Ru=(e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:s,connectionClickStartHandle:i}=r;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n||(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n}},ts=E.forwardRef(({type:e="source",position:t=W.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:s=!0,id:i,onConnect:a,children:u,className:c,onMouseDown:l,onTouchStart:f,...d},p)=>{var I,R;const v=i||null,g=e==="target",b=oe(),y=Eu(),{connectOnClick:_,noPanClassName:x}=J(zu,ie),{connecting:m,clickConnecting:C}=J(Ru(y,v,e),ie);y||(R=(I=b.getState()).onError)==null||R.call(I,"010",Ie.error010());const A=P=>{const{defaultEdgeOptions:B,onConnect:L,hasDefaultEdges:h}=b.getState(),$={...B,...P};if(h){const{edges:N,setEdges:z}=b.getState();z(Cu($,N))}L==null||L($),a==null||a($)},D=P=>{if(!y)return;const B=Oo(P);o&&(B&&P.button===0||!B)&&es({event:P,handleId:v,nodeId:y,onConnect:A,isTarget:g,getState:b.getState,setState:b.setState,isValidConnection:n||b.getState().isValidConnection||Wr}),B?l==null||l(P):f==null||f(P)},j=P=>{const{onClickConnectStart:B,onClickConnectEnd:L,connectionClickStartHandle:h,connectionMode:$,isValidConnection:N}=b.getState();if(!y||!h&&!o)return;if(!h){B==null||B(P,{nodeId:y,handleId:v,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:y,type:e,handleId:v}});return}const z=Bo(P.target),H=n||N||Wr,{connection:S,isValid:T}=Jo({nodeId:y,id:v,type:e},$,h.nodeId,h.handleId||null,h.type,H,z);T&&A(S),L==null||L(P),b.setState({connectionClickStartHandle:null})};return M.createElement("div",{"data-handleid":v,"data-nodeid":y,"data-handlepos":t,"data-id":`${y}-${v}-${e}`,className:ae(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",x,c,{source:!g,target:g,connectable:r,connectablestart:o,connectableend:s,connecting:C,connectionindicator:r&&(o&&!m||s&&m)}]),onMouseDown:D,onTouchStart:D,onClick:_?j:void 0,ref:p,...d},u)});ts.displayName="Handle";var Fe=E.memo(ts);const ns=({data:e,isConnectable:t,targetPosition:n=W.Top,sourcePosition:r=W.Bottom})=>M.createElement(M.Fragment,null,M.createElement(Fe,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,M.createElement(Fe,{type:"source",position:r,isConnectable:t}));ns.displayName="DefaultNode";var Vn=E.memo(ns);const rs=({data:e,isConnectable:t,sourcePosition:n=W.Bottom})=>M.createElement(M.Fragment,null,e==null?void 0:e.label,M.createElement(Fe,{type:"source",position:n,isConnectable:t}));rs.displayName="InputNode";var os=E.memo(rs);const ss=({data:e,isConnectable:t,targetPosition:n=W.Top})=>M.createElement(M.Fragment,null,M.createElement(Fe,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);ss.displayName="OutputNode";var is=E.memo(ss);const ir=()=>null;ir.displayName="GroupNode";const Du=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Yt=e=>e.id;function Pu(e,t){return ie(e.selectedNodes.map(Yt),t.selectedNodes.map(Yt))&&ie(e.selectedEdges.map(Yt),t.selectedEdges.map(Yt))}const as=E.memo(({onSelectionChange:e})=>{const t=oe(),{selectedNodes:n,selectedEdges:r}=J(Du,Pu);return E.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChange.forEach(s=>s(o))},[n,r,e]),null});as.displayName="SelectionListener";const ju=e=>!!e.onSelectionChange;function Hu({onSelectionChange:e}){const t=J(ju);return e||t?M.createElement(as,{onSelectionChange:e}):null}const Fu=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){E.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function X(e,t,n){E.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const Lu=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:s,onConnectEnd:i,onClickConnectStart:a,onClickConnectEnd:u,nodesDraggable:c,nodesConnectable:l,nodesFocusable:f,edgesFocusable:d,edgesUpdatable:p,elevateNodesOnSelect:v,minZoom:g,maxZoom:b,nodeExtent:y,onNodesChange:_,onEdgesChange:x,elementsSelectable:m,connectionMode:C,snapGrid:A,snapToGrid:D,translateExtent:j,connectOnClick:I,defaultEdgeOptions:R,fitView:P,fitViewOptions:B,onNodesDelete:L,onEdgesDelete:h,onNodeDrag:$,onNodeDragStart:N,onNodeDragStop:z,onSelectionDrag:H,onSelectionDragStart:S,onSelectionDragStop:T,noPanClassName:F,nodeOrigin:k,rfId:V,autoPanOnConnect:O,autoPanOnNodeDrag:U,onError:q,connectionRadius:G,isValidConnection:Z,nodeDragThreshold:ee})=>{const{setNodes:K,setEdges:pe,setDefaultNodesAndEdges:fe,setMinZoom:ge,setMaxZoom:de,setTranslateExtent:ne,setNodeExtent:be,reset:Q}=J(Fu,ie),Y=oe();return E.useEffect(()=>{const le=r==null?void 0:r.map(Le=>({...Le,...R}));return fe(n,le),()=>{Q()}},[]),X("defaultEdgeOptions",R,Y.setState),X("connectionMode",C,Y.setState),X("onConnect",o,Y.setState),X("onConnectStart",s,Y.setState),X("onConnectEnd",i,Y.setState),X("onClickConnectStart",a,Y.setState),X("onClickConnectEnd",u,Y.setState),X("nodesDraggable",c,Y.setState),X("nodesConnectable",l,Y.setState),X("nodesFocusable",f,Y.setState),X("edgesFocusable",d,Y.setState),X("edgesUpdatable",p,Y.setState),X("elementsSelectable",m,Y.setState),X("elevateNodesOnSelect",v,Y.setState),X("snapToGrid",D,Y.setState),X("snapGrid",A,Y.setState),X("onNodesChange",_,Y.setState),X("onEdgesChange",x,Y.setState),X("connectOnClick",I,Y.setState),X("fitViewOnInit",P,Y.setState),X("fitViewOnInitOptions",B,Y.setState),X("onNodesDelete",L,Y.setState),X("onEdgesDelete",h,Y.setState),X("onNodeDrag",$,Y.setState),X("onNodeDragStart",N,Y.setState),X("onNodeDragStop",z,Y.setState),X("onSelectionDrag",H,Y.setState),X("onSelectionDragStart",S,Y.setState),X("onSelectionDragStop",T,Y.setState),X("noPanClassName",F,Y.setState),X("nodeOrigin",k,Y.setState),X("rfId",V,Y.setState),X("autoPanOnConnect",O,Y.setState),X("autoPanOnNodeDrag",U,Y.setState),X("onError",q,Y.setState),X("connectionRadius",G,Y.setState),X("isValidConnection",Z,Y.setState),X("nodeDragThreshold",ee,Y.setState),ot(e,K),ot(t,pe),ot(g,ge),ot(b,de),ot(j,ne),ot(y,be),null},Yr={display:"none"},Bu={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},cs="react-flow__node-desc",ls="react-flow__edge-desc",Vu="react-flow__aria-live",Ou=e=>e.ariaLiveMessage;function Wu({rfId:e}){const t=J(Ou);return M.createElement("div",{id:`${Vu}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Bu},t)}function Yu({rfId:e,disableKeyboardA11y:t}){return M.createElement(M.Fragment,null,M.createElement("div",{id:`${cs}-${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."," "),M.createElement("div",{id:`${ls}-${e}`,style:Yr},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&M.createElement(Wu,{rfId:e}))}var Dt=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=E.useState(!1),o=E.useRef(!1),s=E.useRef(new Set([])),[i,a]=E.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),l=c.reduce((f,d)=>f.concat(...d),[]);return[c,l]}return[[],[]]},[e]);return E.useEffect(()=>{const u=typeof document<"u"?document:null,c=(t==null?void 0:t.target)||u;if(e!==null){const l=p=>{if(o.current=p.ctrlKey||p.metaKey||p.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&Hn(p))return!1;const g=Xr(p.code,a);s.current.add(p[g]),Ur(i,s.current,!1)&&(p.preventDefault(),r(!0))},f=p=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&Hn(p))return!1;const g=Xr(p.code,a);Ur(i,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(p[g]),p.key==="Meta"&&s.current.clear(),o.current=!1},d=()=>{s.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",l),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",d),()=>{c==null||c.removeEventListener("keydown",l),c==null||c.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 Xr(e,t){return t.includes(e)?"code":"key"}function us(e,t,n,r){var a,u;const o=e.parentNode||e.parentId;if(!o)return n;const s=t.get(o),i=ft(s,r);return us(s,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((a=s[te])==null?void 0:a.z)??0)>(n.z??0)?((u=s[te])==null?void 0:u.z)??0:n.z??0},r)}function fs(e,t,n){e.forEach(r=>{var s;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:i,y:a,z:u}=us(r,e,{...r.position,z:((s=r[te])==null?void 0:s.z)??0},t);r.positionAbsolute={x:i,y:a},r[te].z=u,n!=null&&n[r.id]&&(r[te].isParent=!0)}})}function Nn(e,t,n,r){const o=new Map,s={},i=r?1e3:0;return e.forEach(a=>{var p;const u=(he(a.zIndex)?a.zIndex:0)+(a.selected?i:0),c=t.get(a.id),l={...a,positionAbsolute:{x:a.position.x,y:a.position.y}},f=a.parentNode||a.parentId;f&&(s[f]=!0);const d=(c==null?void 0:c.type)&&(c==null?void 0:c.type)!==a.type;Object.defineProperty(l,te,{enumerable:!1,value:{handleBounds:d||(p=c==null?void 0:c[te])==null?void 0:p.handleBounds,z:u}}),o.set(a.id,l)}),fs(o,n,s),o}function ds(e,t={}){const{getNodes:n,width:r,height:o,minZoom:s,maxZoom:i,d3Zoom:a,d3Selection:u,fitViewOnInitDone:c,fitViewOnInit:l,nodeOrigin:f}=e(),d=t.initial&&!c&&l;if(a&&u&&(d||!t.initial)){const v=n().filter(b=>{var _;const y=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return(_=t.nodes)!=null&&_.length?y&&t.nodes.some(x=>x.id===b.id):y}),g=v.every(b=>b.width&&b.height);if(v.length>0&&g){const b=or(v,f),{x:y,y:_,zoom:x}=Ko(b,r,o,t.minZoom??s,t.maxZoom??i,t.padding??.1),m=je.translate(y,_).scale(x);return typeof t.duration=="number"&&t.duration>0?a.transform(Xe(u,t.duration),m):a.transform(u,m),!0}}return!1}function Uu(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:s,onNodesChange:i,onEdgesChange:a,hasDefaultNodes:u,hasDefaultEdges:c}=n();e!=null&&e.length&&(u&&r({nodeInternals:Uu(e,o)}),i==null||i(e)),t!=null&&t.length&&(c&&r({edges:Xu(t,s)}),a==null||a(t))}const st=()=>{},qu={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},Gu=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Zu=()=>{const e=oe(),{d3Zoom:t,d3Selection:n}=J(Gu,ie);return E.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(Xe(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(Xe(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,s)=>t.scaleTo(Xe(n,s==null?void 0:s.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,s)=>{const[i,a,u]=e.getState().transform,c=je.translate(o.x??i,o.y??a).scale(o.zoom??u);t.transform(Xe(n,s==null?void 0:s.duration),c)},getViewport:()=>{const[o,s,i]=e.getState().transform;return{x:o,y:s,zoom:i}},fitView:o=>ds(e.getState,o),setCenter:(o,s,i)=>{const{width:a,height:u,maxZoom:c}=e.getState(),l=typeof(i==null?void 0:i.zoom)<"u"?i.zoom:c,f=a/2-o*l,d=u/2-s*l,p=je.translate(f,d).scale(l);t.transform(Xe(n,i==null?void 0:i.duration),p)},fitBounds:(o,s)=>{const{width:i,height:a,minZoom:u,maxZoom:c}=e.getState(),{x:l,y:f,zoom:d}=Ko(o,i,a,u,c,(s==null?void 0:s.padding)??.1),p=je.translate(l,f).scale(d);t.transform(Xe(n,s==null?void 0:s.duration),p)},project:o=>{const{transform:s,snapToGrid:i,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,s,i,a)},screenToFlowPosition:o=>{const{transform:s,snapToGrid:i,snapGrid:a,domNode:u}=e.getState();if(!u)return o;const{x:c,y:l}=u.getBoundingClientRect(),f={x:o.x-c,y:o.y-l};return Bn(f,s,i,a)},flowToScreenPosition:o=>{const{transform:s,domNode:i}=e.getState();if(!i)return o;const{x:a,y:u}=i.getBoundingClientRect(),c=qo(o,s);return{x:c.x+a,y:c.y+u}},viewportInitialized:!0}:qu,[t,n])};function ar(){const e=Zu(),t=oe(),n=E.useCallback(()=>t.getState().getNodes().map(g=>({...g})),[]),r=E.useCallback(g=>t.getState().nodeInternals.get(g),[]),o=E.useCallback(()=>{const{edges:g=[]}=t.getState();return g.map(b=>({...b}))},[]),s=E.useCallback(g=>{const{edges:b=[]}=t.getState();return b.find(y=>y.id===g)},[]),i=E.useCallback(g=>{const{getNodes:b,setNodes:y,hasDefaultNodes:_,onNodesChange:x}=t.getState(),m=b(),C=typeof g=="function"?g(m):g;if(_)y(C);else if(x){const A=C.length===0?m.map(D=>({type:"remove",id:D.id})):C.map(D=>({item:D,type:"reset"}));x(A)}},[]),a=E.useCallback(g=>{const{edges:b=[],setEdges:y,hasDefaultEdges:_,onEdgesChange:x}=t.getState(),m=typeof g=="function"?g(b):g;if(_)y(m);else if(x){const C=m.length===0?b.map(A=>({type:"remove",id:A.id})):m.map(A=>({item:A,type:"reset"}));x(C)}},[]),u=E.useCallback(g=>{const b=Array.isArray(g)?g:[g],{getNodes:y,setNodes:_,hasDefaultNodes:x,onNodesChange:m}=t.getState();if(x){const A=[...y(),...b];_(A)}else if(m){const C=b.map(A=>({item:A,type:"add"}));m(C)}},[]),c=E.useCallback(g=>{const b=Array.isArray(g)?g:[g],{edges:y=[],setEdges:_,hasDefaultEdges:x,onEdgesChange:m}=t.getState();if(x)_([...y,...b]);else if(m){const C=b.map(A=>({item:A,type:"add"}));m(C)}},[]),l=E.useCallback(()=>{const{getNodes:g,edges:b=[],transform:y}=t.getState(),[_,x,m]=y;return{nodes:g().map(C=>({...C})),edges:b.map(C=>({...C})),viewport:{x:_,y:x,zoom:m}}},[]),f=E.useCallback(({nodes:g,edges:b})=>{const{nodeInternals:y,getNodes:_,edges:x,hasDefaultNodes:m,hasDefaultEdges:C,onNodesDelete:A,onEdgesDelete:D,onNodesChange:j,onEdgesChange:I}=t.getState(),R=(g||[]).map($=>$.id),P=(b||[]).map($=>$.id),B=_().reduce(($,N)=>{const z=N.parentNode||N.parentId,H=!R.includes(N.id)&&z&&$.find(T=>T.id===z);return(typeof N.deletable=="boolean"?N.deletable:!0)&&(R.includes(N.id)||H)&&$.push(N),$},[]),L=x.filter($=>typeof $.deletable=="boolean"?$.deletable:!0),h=L.filter($=>P.includes($.id));if(B||h){const $=Zo(B,L),N=[...h,...$],z=N.reduce((H,S)=>(H.includes(S.id)||H.push(S.id),H),[]);if((C||m)&&(C&&t.setState({edges:x.filter(H=>!z.includes(H.id))}),m&&(B.forEach(H=>{y.delete(H.id)}),t.setState({nodeInternals:new Map(y)}))),z.length>0&&(D==null||D(N),I&&I(z.map(H=>({id:H,type:"remove"})))),B.length>0&&(A==null||A(B),j)){const H=B.map(S=>({id:S.id,type:"remove"}));j(H)}}},[]),d=E.useCallback(g=>{const b=mu(g),y=b?null:t.getState().nodeInternals.get(g.id);return!b&&!y?[null,null,b]:[b?g:Hr(y),y,b]},[]),p=E.useCallback((g,b=!0,y)=>{const[_,x,m]=d(g);return _?(y||t.getState().getNodes()).filter(C=>{if(!m&&(C.id===x.id||!C.positionAbsolute))return!1;const A=Hr(C),D=jn(A,_);return b&&D>0||D>=_.width*_.height}):[]},[]),v=E.useCallback((g,b,y=!0)=>{const[_]=d(g);if(!_)return!1;const x=jn(_,b);return y&&x>0||x>=_.width*_.height},[]);return E.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:s,setNodes:i,setEdges:a,addNodes:u,addEdges:c,toObject:l,deleteElements:f,getIntersectingNodes:p,isNodeIntersecting:v}),[e,n,r,o,s,i,a,u,c,l,f,p,v])}const Ku={actInsideInputWithModifier:!1};var Qu=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=oe(),{deleteElements:r}=ar(),o=Dt(e,Ku),s=Dt(t);E.useEffect(()=>{if(o){const{edges:i,getNodes:a}=n.getState(),u=a().filter(l=>l.selected),c=i.filter(l=>l.selected);r({nodes:u,edges:c}),n.setState({nodesSelectionActive:!1})}},[o]),E.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])};function Ju(e){const t=oe();E.useEffect(()=>{let n;const r=()=>{var s,i;if(!e.current)return;const o=Kn(e.current);(o.height===0||o.width===0)&&((i=(s=t.getState()).onError)==null||i.call(s,"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},ef=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Xt=e=>({x:e.x,y:e.y,zoom:e.k}),it=(e,t)=>e.target.closest(`.${t}`),qr=(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},tf=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),nf=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:s=!0,panOnScroll:i=!1,panOnScrollSpeed:a=.5,panOnScrollMode:u=Ge.Free,zoomOnDoubleClick:c=!0,elementsSelectable:l,panOnDrag:f=!0,defaultViewport:d,translateExtent:p,minZoom:v,maxZoom:g,zoomActivationKeyCode:b,preventScrolling:y=!0,children:_,noWheelClassName:x,noPanClassName:m})=>{const C=E.useRef(),A=oe(),D=E.useRef(!1),j=E.useRef(!1),I=E.useRef(null),R=E.useRef({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:B,d3ZoomHandler:L,userSelectionActive:h}=J(tf,ie),$=Dt(b),N=E.useRef(0),z=E.useRef(!1),H=E.useRef();return Ju(I),E.useEffect(()=>{if(I.current){const S=I.current.getBoundingClientRect(),T=cu().scaleExtent([v,g]).translateExtent(p),F=ye(I.current).call(T),k=je.translate(d.x,d.y).scale(gt(d.zoom,v,g)),V=[[0,0],[S.width,S.height]],O=T.constrain()(k,V,p);T.transform(F,O),T.wheelDelta(Gr),A.setState({d3Zoom:T,d3Selection:F,d3ZoomHandler:F.on("wheel.zoom"),transform:[O.x,O.y,O.k],domNode:I.current.closest(".react-flow")})}},[]),E.useEffect(()=>{B&&P&&(i&&!$&&!h?B.on("wheel.zoom",S=>{if(it(S,x))return!1;S.preventDefault(),S.stopImmediatePropagation();const T=B.property("__zoom").k||1;if(S.ctrlKey&&s){const Z=Se(S),ee=Gr(S),K=T*Math.pow(2,ee);P.scaleTo(B,K,Z,S);return}const F=S.deltaMode===1?20:1;let k=u===Ge.Vertical?0:S.deltaX*F,V=u===Ge.Horizontal?0:S.deltaY*F;!on()&&S.shiftKey&&u!==Ge.Vertical&&(k=S.deltaY*F,V=0),P.translateBy(B,-(k/T)*a,-(V/T)*a,{internal:!0});const O=Xt(B.property("__zoom")),{onViewportChangeStart:U,onViewportChange:q,onViewportChangeEnd:G}=A.getState();clearTimeout(H.current),z.current||(z.current=!0,t==null||t(S,O),U==null||U(O)),z.current&&(e==null||e(S,O),q==null||q(O),H.current=setTimeout(()=>{n==null||n(S,O),G==null||G(O),z.current=!1},150))},{passive:!1}):typeof L<"u"&&B.on("wheel.zoom",function(S,T){if(!y&&S.type==="wheel"&&!S.ctrlKey||it(S,x))return null;S.preventDefault(),L.call(this,S,T)},{passive:!1}))},[h,i,u,B,P,L,$,s,y,x,t,e,n]),E.useEffect(()=>{P&&P.on("start",S=>{var k,V;if(!S.sourceEvent||S.sourceEvent.internal)return null;N.current=(k=S.sourceEvent)==null?void 0:k.button;const{onViewportChangeStart:T}=A.getState(),F=Xt(S.transform);D.current=!0,R.current=F,((V=S.sourceEvent)==null?void 0:V.type)==="mousedown"&&A.setState({paneDragging:!0}),T==null||T(F),t==null||t(S.sourceEvent,F)})},[P,t]),E.useEffect(()=>{P&&(h&&!D.current?P.on("zoom",null):h||P.on("zoom",S=>{var F;const{onViewportChange:T}=A.getState();if(A.setState({transform:[S.transform.x,S.transform.y,S.transform.k]}),j.current=!!(r&&qr(f,N.current??0)),(e||T)&&!((F=S.sourceEvent)!=null&&F.internal)){const k=Xt(S.transform);T==null||T(k),e==null||e(S.sourceEvent,k)}}))},[h,P,e,f,r]),E.useEffect(()=>{P&&P.on("end",S=>{if(!S.sourceEvent||S.sourceEvent.internal)return null;const{onViewportChangeEnd:T}=A.getState();if(D.current=!1,A.setState({paneDragging:!1}),r&&qr(f,N.current??0)&&!j.current&&r(S.sourceEvent),j.current=!1,(n||T)&&ef(R.current,S.transform)){const F=Xt(S.transform);R.current=F,clearTimeout(C.current),C.current=setTimeout(()=>{T==null||T(F),n==null||n(S.sourceEvent,F)},i?150:0)}})},[P,i,f,n,r]),E.useEffect(()=>{P&&P.filter(S=>{const T=$||o,F=s&&S.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&S.button===1&&S.type==="mousedown"&&(it(S,"react-flow__node")||it(S,"react-flow__edge")))return!0;if(!f&&!T&&!i&&!c&&!s||h||!c&&S.type==="dblclick"||it(S,x)&&S.type==="wheel"||it(S,m)&&(S.type!=="wheel"||i&&S.type==="wheel"&&!$)||!s&&S.ctrlKey&&S.type==="wheel"||!T&&!i&&!F&&S.type==="wheel"||!f&&(S.type==="mousedown"||S.type==="touchstart")||Array.isArray(f)&&!f.includes(S.button)&&S.type==="mousedown")return!1;const k=Array.isArray(f)&&f.includes(S.button)||!S.button||S.button<=1;return(!S.ctrlKey||S.type==="wheel")&&k})},[h,P,o,s,i,c,f,l,$]),M.createElement("div",{className:"react-flow__renderer",ref:I,style:cr},_)},rf=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function of(){const{userSelectionActive:e,userSelectionRect:t}=J(rf,ie);return e&&t?M.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,s=t.position.y+t.height-r.height;if(o>0||s>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),s>0&&(r.style.height+=s),t.position.x<0){const i=Math.abs(t.position.x);r.position.x=r.position.x-i,r.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);r.position.y=r.position.y-i,r.style.height+=i,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function hs(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 s=e.filter(a=>a.id===o.id);if(s.length===0)return r.push(o),r;const i={...o};for(const a of s)if(a)switch(a.type){case"select":{i.selected=a.selected;break}case"position":{typeof a.position<"u"&&(i.position=a.position),typeof a.positionAbsolute<"u"&&(i.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(i.dragging=a.dragging),i.expandParent&&Zr(r,i);break}case"dimensions":{typeof a.dimensions<"u"&&(i.width=a.dimensions.width,i.height=a.dimensions.height),typeof a.updateStyle<"u"&&(i.style={...i.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(i.resizing=a.resizing),i.expandParent&&Zr(r,i);break}case"remove":return r}return r.push(i),r},n)}function ps(e,t){return hs(e,t)}function sf(e,t){return hs(e,t)}const De=(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(De(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(De(r.id,!1))),n},[])}const kn=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},af=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),gs=E.memo(({isSelecting:e,selectionMode:t=zt.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:s,onPaneContextMenu:i,onPaneScroll:a,onPaneMouseEnter:u,onPaneMouseMove:c,onPaneMouseLeave:l,children:f})=>{const d=E.useRef(null),p=oe(),v=E.useRef(0),g=E.useRef(0),b=E.useRef(),{userSelectionActive:y,elementsSelectable:_,dragging:x}=J(af,ie),m=()=>{p.setState({userSelectionActive:!1,userSelectionRect:null}),v.current=0,g.current=0},C=L=>{s==null||s(L),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},A=L=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){L.preventDefault();return}i==null||i(L)},D=a?L=>a(L):void 0,j=L=>{const{resetSelectedElements:h,domNode:$}=p.getState();if(b.current=$==null?void 0:$.getBoundingClientRect(),!_||!e||L.button!==0||L.target!==d.current||!b.current)return;const{x:N,y:z}=He(L,b.current);h(),p.setState({userSelectionRect:{width:0,height:0,startX:N,startY:z,x:N,y:z}}),r==null||r(L)},I=L=>{const{userSelectionRect:h,nodeInternals:$,edges:N,transform:z,onNodesChange:H,onEdgesChange:S,nodeOrigin:T,getNodes:F}=p.getState();if(!e||!b.current||!h)return;p.setState({userSelectionActive:!0,nodesSelectionActive:!1});const k=He(L,b.current),V=h.startX??0,O=h.startY??0,U={...h,x:k.x<V?k.x:V,y:k.y<O?k.y:O,width:Math.abs(k.x-V),height:Math.abs(k.y-O)},q=F(),G=Go($,U,z,t===zt.Partial,!0,T),Z=Zo(G,N).map(K=>K.id),ee=G.map(K=>K.id);if(v.current!==ee.length){v.current=ee.length;const K=ct(q,ee);K.length&&(H==null||H(K))}if(g.current!==Z.length){g.current=Z.length;const K=ct(N,Z);K.length&&(S==null||S(K))}p.setState({userSelectionRect:U})},R=L=>{if(L.button!==0)return;const{userSelectionRect:h}=p.getState();!y&&h&&L.target===d.current&&(C==null||C(L)),p.setState({nodesSelectionActive:v.current>0}),m(),o==null||o(L)},P=L=>{y&&(p.setState({nodesSelectionActive:v.current>0}),o==null||o(L)),m()},B=_&&(e||y);return M.createElement("div",{className:ae(["react-flow__pane",{dragging:x,selection:e}]),onClick:B?void 0:kn(C,d),onContextMenu:kn(A,d),onWheel:kn(D,d),onMouseEnter:B?void 0:u,onMouseDown:B?j:void 0,onMouseMove:B?I:c,onMouseUp:B?R:void 0,onMouseLeave:B?P:l,ref:d,style:cr},f,M.createElement(of,null))});gs.displayName="Pane";function ms(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return r?r.selected?!0:ms(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 cf(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||o.parentId||!ms(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var s,i;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((s=o.positionAbsolute)==null?void 0:s.x)??0),y:n.y-(((i=o.positionAbsolute)==null?void 0:i.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 lf(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function ys(e,t,n,r,o=[0,0],s){const i=lf(e,e.extent||r);let a=i;const u=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(u&&e.width&&e.height){const f=n.get(u),{x:d,y:p}=ft(f,o).positionAbsolute;a=f&&he(d)&&he(p)&&he(f.width)&&he(f.height)?[[d+e.width*o[0],p+e.height*o[1]],[d+f.width-e.width+e.width*o[0],p+f.height-e.height+e.height*o[1]]]:a}else s==null||s("005",Ie.error005()),a=i;else if(e.extent&&u&&e.extent!=="parent"){const f=n.get(u),{x:d,y:p}=ft(f,o).positionAbsolute;a=[[e.extent[0][0]+d,e.extent[0][1]+p],[e.extent[1][0]+d,e.extent[1][1]+p]]}let c={x:0,y:0};if(u){const f=n.get(u);c=ft(f,o).positionAbsolute}const l=a&&a!=="parent"?Qn(t,a):t;return{position:{x:l.x-c.x,y:l.y-c.y},positionAbsolute:l}}function $n({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 s=Array.from(o),i=t.getBoundingClientRect(),a={x:i.width*r[0],y:i.height*r[1]};return s.map(u=>{const c=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),position:u.getAttribute("data-handlepos"),x:(c.left-i.left-a.x)/n,y:(c.top-i.top-a.y)/n,...Kn(u)}})};function St(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:s,multiSelectionActive:i,nodeInternals:a,onError:u}=t.getState(),c=a.get(e);if(!c){u==null||u("012",Ie.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(s({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var l;return(l=r==null?void 0:r.current)==null?void 0:l.blur()})):o([e])}function uf(){const e=oe();return E.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:s}=e.getState(),i=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,u={x:(i-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:s?o[0]*Math.round(u.x/o[0]):u.x,ySnapped:s?o[1]*Math.round(u.y/o[1]):u.y,...u}},[])}function Cn(e){return(t,n,r)=>e==null?void 0:e(t,r)}function xs({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:s,selectNodesOnDrag:i}){const a=oe(),[u,c]=E.useState(!1),l=E.useRef([]),f=E.useRef({x:null,y:null}),d=E.useRef(0),p=E.useRef(null),v=E.useRef({x:0,y:0}),g=E.useRef(null),b=E.useRef(!1),y=E.useRef(!1),_=E.useRef(!1),x=uf();return E.useEffect(()=>{if(e!=null&&e.current){const m=ye(e.current),C=({x:j,y:I})=>{const{nodeInternals:R,onNodeDrag:P,onSelectionDrag:B,updateNodePositions:L,nodeExtent:h,snapGrid:$,snapToGrid:N,nodeOrigin:z,onError:H}=a.getState();f.current={x:j,y:I};let S=!1,T={x:0,y:0,x2:0,y2:0};if(l.current.length>1&&h){const k=or(l.current,z);T=Jn(k)}if(l.current=l.current.map(k=>{const V={x:j-k.distance.x,y:I-k.distance.y};N&&(V.x=$[0]*Math.round(V.x/$[0]),V.y=$[1]*Math.round(V.y/$[1]));const O=[[h[0][0],h[0][1]],[h[1][0],h[1][1]]];l.current.length>1&&h&&!k.extent&&(O[0][0]=k.positionAbsolute.x-T.x+h[0][0],O[1][0]=k.positionAbsolute.x+(k.width??0)-T.x2+h[1][0],O[0][1]=k.positionAbsolute.y-T.y+h[0][1],O[1][1]=k.positionAbsolute.y+(k.height??0)-T.y2+h[1][1]);const U=ys(k,V,R,O,z,H);return S=S||k.position.x!==U.position.x||k.position.y!==U.position.y,k.position=U.position,k.positionAbsolute=U.positionAbsolute,k}),!S)return;L(l.current,!0,!0),c(!0);const F=o?P:Cn(B);if(F&&g.current){const[k,V]=$n({nodeId:o,dragItems:l.current,nodeInternals:R});F(g.current,k,V)}},A=()=>{if(!p.current)return;const[j,I]=Lo(v.current,p.current);if(j!==0||I!==0){const{transform:R,panBy:P}=a.getState();f.current.x=(f.current.x??0)-j/R[2],f.current.y=(f.current.y??0)-I/R[2],P({x:j,y:I})&&C(f.current)}d.current=requestAnimationFrame(A)},D=j=>{var z;const{nodeInternals:I,multiSelectionActive:R,nodesDraggable:P,unselectNodesAndEdges:B,onNodeDragStart:L,onSelectionDragStart:h}=a.getState();y.current=!0;const $=o?L:Cn(h);(!i||!s)&&!R&&o&&((z=I.get(o))!=null&&z.selected||B()),o&&s&&i&&On({id:o,store:a,nodeRef:e});const N=x(j);if(f.current=N,l.current=cf(I,P,N,o),$&&l.current){const[H,S]=$n({nodeId:o,dragItems:l.current,nodeInternals:I});$(j.sourceEvent,H,S)}};if(t)m.on(".drag",null);else{const j=xc().on("start",I=>{const{domNode:R,nodeDragThreshold:P}=a.getState();P===0&&D(I),_.current=!1;const B=x(I);f.current=B,p.current=(R==null?void 0:R.getBoundingClientRect())||null,v.current=He(I.sourceEvent,p.current)}).on("drag",I=>{var L,h;const R=x(I),{autoPanOnNodeDrag:P,nodeDragThreshold:B}=a.getState();if(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1&&(_.current=!0),!_.current){if(!b.current&&y.current&&P&&(b.current=!0,A()),!y.current){const $=R.xSnapped-(((L=f==null?void 0:f.current)==null?void 0:L.x)??0),N=R.ySnapped-(((h=f==null?void 0:f.current)==null?void 0:h.y)??0);Math.sqrt($*$+N*N)>B&&D(I)}(f.current.x!==R.xSnapped||f.current.y!==R.ySnapped)&&l.current&&y.current&&(g.current=I.sourceEvent,v.current=He(I.sourceEvent,p.current),C(R))}}).on("end",I=>{if(!(!y.current||_.current)&&(c(!1),b.current=!1,y.current=!1,cancelAnimationFrame(d.current),l.current)){const{updateNodePositions:R,nodeInternals:P,onNodeDragStop:B,onSelectionDragStop:L}=a.getState(),h=o?B:Cn(L);if(R(l.current,!1,!1),h){const[$,N]=$n({nodeId:o,dragItems:l.current,nodeInternals:P});h(I.sourceEvent,$,N)}}}).filter(I=>{const R=I.target;return!I.button&&(!n||!Kr(R,`.${n}`,e))&&(!r||Kr(R,r,e))});return m.call(j),()=>{m.on(".drag",null)}}}},[e,t,n,r,s,a,o,i,x]),u}function ws(){const e=oe();return E.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:s,getNodes:i,snapToGrid:a,snapGrid:u,onError:c,nodesDraggable:l}=e.getState(),f=i().filter(_=>_.selected&&(_.draggable||l&&typeof _.draggable>"u")),d=a?u[0]:5,p=a?u[1]:5,v=n.isShiftPressed?4:1,g=n.x*d*v,b=n.y*p*v,y=f.map(_=>{if(_.positionAbsolute){const x={x:_.positionAbsolute.x+g,y:_.positionAbsolute.y+b};a&&(x.x=u[0]*Math.round(x.x/u[0]),x.y=u[1]*Math.round(x.y/u[1]));const{positionAbsolute:m,position:C}=ys(_,x,r,o,void 0,c);_.position=C,_.positionAbsolute=m}return _});s(y,!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 Et=e=>{const t=({id:n,type:r,data:o,xPos:s,yPos:i,xPosOrigin:a,yPosOrigin:u,selected:c,onClick:l,onMouseEnter:f,onMouseMove:d,onMouseLeave:p,onContextMenu:v,onDoubleClick:g,style:b,className:y,isDraggable:_,isSelectable:x,isConnectable:m,isFocusable:C,selectNodesOnDrag:A,sourcePosition:D,targetPosition:j,hidden:I,resizeObserver:R,dragHandle:P,zIndex:B,isParent:L,noDragClassName:h,noPanClassName:$,initialized:N,disableKeyboardA11y:z,ariaLabel:H,rfId:S,hasHandleBounds:T})=>{const F=oe(),k=E.useRef(null),V=E.useRef(null),O=E.useRef(D),U=E.useRef(j),q=E.useRef(r),G=x||_||l||f||d||p,Z=ws(),ee=St(n,F.getState,f),K=St(n,F.getState,d),pe=St(n,F.getState,p),fe=St(n,F.getState,v),ge=St(n,F.getState,g),de=Q=>{const{nodeDragThreshold:Y}=F.getState();if(x&&(!A||!_||Y>0)&&On({id:n,store:F,nodeRef:k}),l){const le=F.getState().nodeInternals.get(n);le&&l(Q,{...le})}},ne=Q=>{if(!Hn(Q)&&!z)if(Vo.includes(Q.key)&&x){const Y=Q.key==="Escape";On({id:n,store:F,unselect:Y,nodeRef:k})}else _&&c&&Object.prototype.hasOwnProperty.call(dt,Q.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${Q.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~s}, y: ${~~i}`}),Z({x:dt[Q.key].x,y:dt[Q.key].y,isShiftPressed:Q.shiftKey}))};E.useEffect(()=>()=>{V.current&&(R==null||R.unobserve(V.current),V.current=null)},[]),E.useEffect(()=>{if(k.current&&!I){const Q=k.current;(!N||!T||V.current!==Q)&&(V.current&&(R==null||R.unobserve(V.current)),R==null||R.observe(Q),V.current=Q)}},[I,N,T]),E.useEffect(()=>{const Q=q.current!==r,Y=O.current!==D,le=U.current!==j;k.current&&(Q||Y||le)&&(Q&&(q.current=r),Y&&(O.current=D),le&&(U.current=j),F.getState().updateNodeDimensions([{id:n,nodeElement:k.current,forceUpdate:!0}]))},[n,r,D,j]);const be=xs({nodeRef:k,disabled:I||!_,noDragClassName:h,handleSelector:P,nodeId:n,isSelectable:x,selectNodesOnDrag:A});return I?null:M.createElement("div",{className:ae(["react-flow__node",`react-flow__node-${r}`,{[$]:_},y,{selected:c,selectable:x,parent:L,dragging:be}]),ref:k,style:{zIndex:B,transform:`translate(${a}px,${u}px)`,pointerEvents:G?"all":"none",visibility:N?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:ee,onMouseMove:K,onMouseLeave:pe,onContextMenu:fe,onClick:de,onDoubleClick:ge,onKeyDown:C?ne:void 0,tabIndex:C?0:void 0,role:C?"button":void 0,"aria-describedby":z?void 0:`${cs}-${S}`,"aria-label":H},M.createElement(Su,{value:n},M.createElement(e,{id:n,data:o,type:r,xPos:s,yPos:i,selected:c,isConnectable:m,sourcePosition:D,targetPosition:j,dragging:be,dragHandle:P,zIndex:B})))};return t.displayName="NodeWrapper",E.memo(t)};const ff=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 df({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=oe(),{width:o,height:s,x:i,y:a,transformString:u,userSelectionActive:c}=J(ff,ie),l=ws(),f=E.useRef(null);if(E.useEffect(()=>{var v;n||(v=f.current)==null||v.focus({preventScroll:!0})},[n]),xs({nodeRef:f}),c||!o||!s)return null;const d=e?v=>{const g=r.getState().getNodes().filter(b=>b.selected);e(v,g)}:void 0,p=v=>{Object.prototype.hasOwnProperty.call(dt,v.key)&&l({x:dt[v.key].x,y:dt[v.key].y,isShiftPressed:v.shiftKey})};return M.createElement("div",{className:ae(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u}},M.createElement("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:p,style:{width:o,height:s,top:a,left:i}}))}var hf=E.memo(df);const pf=e=>e.nodesSelectionActive,vs=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:i,deleteKeyCode:a,onMove:u,onMoveStart:c,onMoveEnd:l,selectionKeyCode:f,selectionOnDrag:d,selectionMode:p,onSelectionStart:v,onSelectionEnd:g,multiSelectionKeyCode:b,panActivationKeyCode:y,zoomActivationKeyCode:_,elementsSelectable:x,zoomOnScroll:m,zoomOnPinch:C,panOnScroll:A,panOnScrollSpeed:D,panOnScrollMode:j,zoomOnDoubleClick:I,panOnDrag:R,defaultViewport:P,translateExtent:B,minZoom:L,maxZoom:h,preventScrolling:$,onSelectionContextMenu:N,noWheelClassName:z,noPanClassName:H,disableKeyboardA11y:S})=>{const T=J(pf),F=Dt(f),k=Dt(y),V=k||R,O=k||A,U=F||d&&V!==!0;return Qu({deleteKeyCode:a,multiSelectionKeyCode:b}),M.createElement(nf,{onMove:u,onMoveStart:c,onMoveEnd:l,onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:m,zoomOnPinch:C,panOnScroll:O,panOnScrollSpeed:D,panOnScrollMode:j,zoomOnDoubleClick:I,panOnDrag:!F&&V,defaultViewport:P,translateExtent:B,minZoom:L,maxZoom:h,zoomActivationKeyCode:_,preventScrolling:$,noWheelClassName:z,noPanClassName:H},M.createElement(gs,{onSelectionStart:v,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:V,isSelecting:!!U,selectionMode:p},e,T&&M.createElement(hf,{onSelectionContextMenu:N,noPanClassName:H,disableKeyboardA11y:S})))};vs.displayName="FlowRenderer";var gf=E.memo(vs);function mf(e){return J(E.useCallback(n=>e?Go(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function yf(e){const t={input:Et(e.input||os),default:Et(e.default||Vn),output:Et(e.output||is),group:Et(e.group||ir)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,s)=>(o[s]=Et(e[s]||Vn),o),n);return{...t,...r}}const xf=({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]},wf=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),bs=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:s,onError:i}=J(wf,ie),a=mf(e.onlyRenderVisibleElements),u=E.useRef(),c=E.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const l=new ResizeObserver(f=>{const d=f.map(p=>({id:p.target.getAttribute("data-id"),nodeElement:p.target,forceUpdate:!0}));s(d)});return u.current=l,l},[]);return E.useEffect(()=>()=>{var l;(l=u==null?void 0:u.current)==null||l.disconnect()},[]),M.createElement("div",{className:"react-flow__nodes",style:cr},a.map(l=>{var C,A,D;let f=l.type||"default";e.nodeTypes[f]||(i==null||i("003",Ie.error003(f)),f="default");const d=e.nodeTypes[f]||e.nodeTypes.default,p=!!(l.draggable||t&&typeof l.draggable>"u"),v=!!(l.selectable||o&&typeof l.selectable>"u"),g=!!(l.connectable||n&&typeof l.connectable>"u"),b=!!(l.focusable||r&&typeof l.focusable>"u"),y=e.nodeExtent?Qn(l.positionAbsolute,e.nodeExtent):l.positionAbsolute,_=(y==null?void 0:y.x)??0,x=(y==null?void 0:y.y)??0,m=xf({x:_,y:x,width:l.width??0,height:l.height??0,origin:e.nodeOrigin});return M.createElement(d,{key:l.id,id:l.id,className:l.className,style:l.style,type:f,data:l.data,sourcePosition:l.sourcePosition||W.Bottom,targetPosition:l.targetPosition||W.Top,hidden:l.hidden,xPos:_,yPos:x,xPosOrigin:m.x,yPosOrigin:m.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!l.selected,isDraggable:p,isSelectable:v,isConnectable:g,isFocusable:b,resizeObserver:c,dragHandle:l.dragHandle,zIndex:((C=l[te])==null?void 0:C.z)??0,isParent:!!((A=l[te])!=null&&A.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!l.width&&!!l.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:l.ariaLabel,hasHandleBounds:!!((D=l[te])!=null&&D.handleBounds)})}))};bs.displayName="NodeRenderer";var vf=E.memo(bs);const bf=(e,t,n)=>n===W.Left?e-t:n===W.Right?e+t:e,_f=(e,t,n)=>n===W.Top?e-t:n===W.Bottom?e+t:e,Jr="react-flow__edgeupdater",eo=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:s,onMouseOut:i,type:a})=>M.createElement("circle",{onMouseDown:o,onMouseEnter:s,onMouseOut:i,className:ae([Jr,`${Jr}-${a}`]),cx:bf(t,r,e),cy:_f(n,r,e),r,stroke:"transparent",fill:"transparent"}),Sf=()=>!0;var at=e=>{const t=({id:n,className:r,type:o,data:s,onClick:i,onEdgeDoubleClick:a,selected:u,animated:c,label:l,labelStyle:f,labelShowBg:d,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:b,source:y,target:_,sourceX:x,sourceY:m,targetX:C,targetY:A,sourcePosition:D,targetPosition:j,elementsSelectable:I,hidden:R,sourceHandleId:P,targetHandleId:B,onContextMenu:L,onMouseEnter:h,onMouseMove:$,onMouseLeave:N,reconnectRadius:z,onReconnect:H,onReconnectStart:S,onReconnectEnd:T,markerEnd:F,markerStart:k,rfId:V,ariaLabel:O,isFocusable:U,isReconnectable:q,pathOptions:G,interactionWidth:Z,disableKeyboardA11y:ee})=>{const K=E.useRef(null),[pe,fe]=E.useState(!1),[ge,de]=E.useState(!1),ne=oe(),be=E.useMemo(()=>`url('#${Ln(k,V)}')`,[k,V]),Q=E.useMemo(()=>`url('#${Ln(F,V)}')`,[F,V]);if(R)return null;const Y=se=>{var _e;const{edges:me,addSelectedEdges:Oe,unselectNodesAndEdges:We,multiSelectionActive:Ye}=ne.getState(),$e=me.find(xt=>xt.id===n);$e&&(I&&(ne.setState({nodesSelectionActive:!1}),$e.selected&&Ye?(We({nodes:[],edges:[$e]}),(_e=K.current)==null||_e.blur()):Oe([n])),i&&i(se,$e))},le=_t(n,ne.getState,a),Le=_t(n,ne.getState,L),mt=_t(n,ne.getState,h),Je=_t(n,ne.getState,$),et=_t(n,ne.getState,N),ke=(se,me)=>{if(se.button!==0)return;const{edges:Oe,isValidConnection:We}=ne.getState(),Ye=me?_:y,$e=(me?B:P)||null,_e=me?"target":"source",xt=We||Sf,hn=me,wt=Oe.find(Ue=>Ue.id===n);de(!0),S==null||S(se,wt,_e);const pn=Ue=>{de(!1),T==null||T(Ue,wt,_e)};es({event:se,handleId:$e,nodeId:Ye,onConnect:Ue=>H==null?void 0:H(wt,Ue),isTarget:hn,getState:ne.getState,setState:ne.setState,isValidConnection:xt,edgeUpdaterType:_e,onReconnectEnd:pn})},tt=se=>ke(se,!0),Be=se=>ke(se,!1),Ve=()=>fe(!0),nt=()=>fe(!1),rt=!I&&!i,yt=se=>{var me;if(!ee&&Vo.includes(se.key)&&I){const{unselectNodesAndEdges:Oe,addSelectedEdges:We,edges:Ye}=ne.getState();se.key==="Escape"?((me=K.current)==null||me.blur(),Oe({edges:[Ye.find(_e=>_e.id===n)]})):We([n])}};return M.createElement("g",{className:ae(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:u,animated:c,inactive:rt,updating:pe}]),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 ${y} to ${_}`,"aria-describedby":U?`${ls}-${V}`:void 0,ref:K},!ge&&M.createElement(e,{id:n,source:y,target:_,selected:u,animated:c,label:l,labelStyle:f,labelShowBg:d,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,data:s,style:b,sourceX:x,sourceY:m,targetX:C,targetY:A,sourcePosition:D,targetPosition:j,sourceHandleId:P,targetHandleId:B,markerStart:be,markerEnd:Q,pathOptions:G,interactionWidth:Z}),q&&M.createElement(M.Fragment,null,(q==="source"||q===!0)&&M.createElement(eo,{position:D,centerX:x,centerY:m,radius:z,onMouseDown:tt,onMouseEnter:Ve,onMouseOut:nt,type:"source"}),(q==="target"||q===!0)&&M.createElement(eo,{position:j,centerX:C,centerY:A,radius:z,onMouseDown:Be,onMouseEnter:Ve,onMouseOut:nt,type:"target"})))};return t.displayName="EdgeWrapper",E.memo(t)};function Ef(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,s)=>(o[s]=at(e[s]||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,s=(n==null?void 0:n.width)||t.width,i=(n==null?void 0:n.height)||t.height;switch(e){case W.Top:return{x:r+s/2,y:o};case W.Right:return{x:r+s,y:o+i/2};case W.Bottom:return{x:r+s/2,y:o+i};case W.Left:return{x:r,y:o+i/2}}}function no(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const Nf=(e,t,n,r,o,s)=>{const i=to(n,e,t),a=to(s,r,o);return{sourceX:i.x,sourceY:i.y,targetX:a.x,targetY:a.y}};function kf({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:s,width:i,height:a,transform:u}){const c={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+s)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const l=Jn({x:(0-u[0])/u[2],y:(0-u[1])/u[2],width:i/u[2],height:a/u[2]}),f=Math.max(0,Math.min(l.x2,c.x2)-Math.max(l.x,c.x)),d=Math.max(0,Math.min(l.y2,c.y2)-Math.max(l.y,c.y));return Math.ceil(f*d)>0}function ro(e){var r,o,s,i,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((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.y)<"u";return[{x:((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.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 $f=[{level:0,isMaxLevel:!0,edges:[]}];function Cf(e,t,n=!1){let r=-1;const o=e.reduce((i,a)=>{var l,f;const u=he(a.zIndex);let c=u?a.zIndex:0;if(n){const d=t.get(a.target),p=t.get(a.source),v=a.selected||(d==null?void 0:d.selected)||(p==null?void 0:p.selected),g=Math.max(((l=p==null?void 0:p[te])==null?void 0:l.z)||0,((f=d==null?void 0:d[te])==null?void 0:f.z)||0,1e3);c=(u?a.zIndex:0)+(v?g:0)}return i[c]?i[c].push(a):i[c]=[a],r=c>r?c:r,i},{}),s=Object.entries(o).map(([i,a])=>{const u=+i;return{edges:a,level:u,isMaxLevel:u===r}});return s.length===0?$f:s}function Mf(e,t,n){const r=J(E.useCallback(o=>e?o.edges.filter(s=>{const i=t.get(s.source),a=t.get(s.target);return(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&kf({sourcePos:i.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:i.width,sourceHeight:i.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return Cf(r,t,n)}const Af=({color:e="none",strokeWidth:t=1})=>M.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),If=({color:e="none",strokeWidth:t=1})=>M.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),oo={[Rt.Arrow]:Af,[Rt.ArrowClosed]:If};function Tf(e){const t=oe();return E.useMemo(()=>{var o,s;return Object.prototype.hasOwnProperty.call(oo,e)?oo[e]:((s=(o=t.getState()).onError)==null||s.call(o,"009",Ie.error009(e)),null)},[e])}const zf=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:s="strokeWidth",strokeWidth:i,orient:a="auto-start-reverse"})=>{const u=Tf(t);return u?M.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:a,refX:"0",refY:"0"},M.createElement(u,{color:n,strokeWidth:i})):null},Rf=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,s)=>([s.markerStart,s.markerEnd].forEach(i=>{if(i&&typeof i=="object"){const a=Ln(i,t);r.includes(a)||(o.push({id:a,color:i.color||e,...i}),r.push(a))}}),o),[]).sort((o,s)=>o.id.localeCompare(s.id))},_s=({defaultColor:e,rfId:t})=>{const n=J(E.useCallback(Rf({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((s,i)=>s.id!==o[i].id)));return M.createElement("defs",null,n.map(r=>M.createElement(zf,{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})))};_s.displayName="MarkerDefinitions";var Df=E.memo(_s);const Pf=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}),Ss=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:s,onEdgeContextMenu:i,onEdgeMouseEnter:a,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:l,onEdgeDoubleClick:f,onReconnect:d,onReconnectStart:p,onReconnectEnd:v,reconnectRadius:g,children:b,disableKeyboardA11y:y})=>{const{edgesFocusable:_,edgesUpdatable:x,elementsSelectable:m,width:C,height:A,connectionMode:D,nodeInternals:j,onError:I}=J(Pf,ie),R=Mf(t,j,n);return C?M.createElement(M.Fragment,null,R.map(({level:P,edges:B,isMaxLevel:L})=>M.createElement("svg",{key:P,style:{zIndex:P},width:C,height:A,className:"react-flow__edges react-flow__container"},L&&M.createElement(Df,{defaultColor:e,rfId:r}),M.createElement("g",null,B.map(h=>{const[$,N,z]=ro(j.get(h.source)),[H,S,T]=ro(j.get(h.target));if(!z||!T)return null;let F=h.type||"default";o[F]||(I==null||I("011",Ie.error011(F)),F="default");const k=o[F]||o.default,V=D===Qe.Strict?S.target:(S.target??[]).concat(S.source??[]),O=no(N.source,h.sourceHandle),U=no(V,h.targetHandle),q=(O==null?void 0:O.position)||W.Bottom,G=(U==null?void 0:U.position)||W.Top,Z=!!(h.focusable||_&&typeof h.focusable>"u"),ee=h.reconnectable||h.updatable,K=typeof d<"u"&&(ee||x&&typeof ee>"u");if(!O||!U)return I==null||I("008",Ie.error008(O,h)),null;const{sourceX:pe,sourceY:fe,targetX:ge,targetY:de}=Nf($,O,q,H,U,G);return M.createElement(k,{key:h.id,id:h.id,className:ae([h.className,s]),type:F,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:pe,sourceY:fe,targetX:ge,targetY:de,sourcePosition:q,targetPosition:G,elementsSelectable:m,onContextMenu:i,onMouseEnter:a,onMouseMove:u,onMouseLeave:c,onClick:l,onEdgeDoubleClick:f,onReconnect:d,onReconnectStart:p,onReconnectEnd:v,reconnectRadius:g,rfId:r,ariaLabel:h.ariaLabel,isFocusable:Z,isReconnectable:K,pathOptions:"pathOptions"in h?h.pathOptions:void 0,interactionWidth:h.interactionWidth,disableKeyboardA11y:y})})))),b):null};Ss.displayName="EdgeRenderer";var jf=E.memo(Ss);const Hf=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ff({children:e}){const t=J(Hf);return M.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function Lf(e){const t=ar(),n=E.useRef(!1);E.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Bf={[W.Left]:W.Right,[W.Right]:W.Left,[W.Top]:W.Bottom,[W.Bottom]:W.Top},Es=({nodeId:e,handleType:t,style:n,type:r=Pe.Bezier,CustomComponent:o,connectionStatus:s})=>{var A,D,j;const{fromNode:i,handleId:a,toX:u,toY:c,connectionMode:l}=J(E.useCallback(I=>({fromNode:I.nodeInternals.get(e),handleId:I.connectionHandleId,toX:(I.connectionPosition.x-I.transform[0])/I.transform[2],toY:(I.connectionPosition.y-I.transform[1])/I.transform[2],connectionMode:I.connectionMode}),[e]),ie),f=(A=i==null?void 0:i[te])==null?void 0:A.handleBounds;let d=f==null?void 0:f[t];if(l===Qe.Loose&&(d=d||(f==null?void 0:f[t==="source"?"target":"source"])),!i||!d)return null;const p=a?d.find(I=>I.id===a):d[0],v=p?p.x+p.width/2:(i.width??0)/2,g=p?p.y+p.height/2:i.height??0,b=(((D=i.positionAbsolute)==null?void 0:D.x)??0)+v,y=(((j=i.positionAbsolute)==null?void 0:j.y)??0)+g,_=p==null?void 0:p.position,x=_?Bf[_]:null;if(!_||!x)return null;if(o)return M.createElement(o,{connectionLineType:r,connectionLineStyle:n,fromNode:i,fromHandle:p,fromX:b,fromY:y,toX:u,toY:c,fromPosition:_,toPosition:x,connectionStatus:s});let m="";const C={sourceX:b,sourceY:y,sourcePosition:_,targetX:u,targetY:c,targetPosition:x};return r===Pe.Bezier?[m]=Xo(C):r===Pe.Step?[m]=Fn({...C,borderRadius:0}):r===Pe.SmoothStep?[m]=Fn(C):r===Pe.SimpleBezier?[m]=Uo(C):m=`M${b},${y} ${u},${c}`,M.createElement("path",{d:m,fill:"none",className:"react-flow__connection-path",style:n})};Es.displayName="ConnectionLine";const Vf=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Of({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:s,nodesConnectable:i,width:a,height:u,connectionStatus:c}=J(Vf,ie);return!(o&&s&&a&&i)?null:M.createElement("svg",{style:e,width:a,height:u,className:"react-flow__edges react-flow__connectionline react-flow__container"},M.createElement("g",{className:ae(["react-flow__connection",c])},M.createElement(Es,{nodeId:o,handleType:s,style:t,type:n,CustomComponent:r,connectionStatus:c})))}function so(e,t){return E.useRef(null),oe(),E.useMemo(()=>t(e),[e])}const Ns=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:s,onNodeClick:i,onEdgeClick:a,onNodeDoubleClick:u,onEdgeDoubleClick:c,onNodeMouseEnter:l,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:p,onSelectionContextMenu:v,onSelectionStart:g,onSelectionEnd:b,connectionLineType:y,connectionLineStyle:_,connectionLineComponent:x,connectionLineContainerStyle:m,selectionKeyCode:C,selectionOnDrag:A,selectionMode:D,multiSelectionKeyCode:j,panActivationKeyCode:I,zoomActivationKeyCode:R,deleteKeyCode:P,onlyRenderVisibleElements:B,elementsSelectable:L,selectNodesOnDrag:h,defaultViewport:$,translateExtent:N,minZoom:z,maxZoom:H,preventScrolling:S,defaultMarkerColor:T,zoomOnScroll:F,zoomOnPinch:k,panOnScroll:V,panOnScrollSpeed:O,panOnScrollMode:U,zoomOnDoubleClick:q,panOnDrag:G,onPaneClick:Z,onPaneMouseEnter:ee,onPaneMouseMove:K,onPaneMouseLeave:pe,onPaneScroll:fe,onPaneContextMenu:ge,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:Ve,nodeExtent:nt,rfId:rt})=>{const yt=so(e,yf),se=so(t,Ef);return Lf(s),M.createElement(gf,{onPaneClick:Z,onPaneMouseEnter:ee,onPaneMouseMove:K,onPaneMouseLeave:pe,onPaneContextMenu:ge,onPaneScroll:fe,deleteKeyCode:P,selectionKeyCode:C,selectionOnDrag:A,selectionMode:D,onSelectionStart:g,onSelectionEnd:b,multiSelectionKeyCode:j,panActivationKeyCode:I,zoomActivationKeyCode:R,elementsSelectable:L,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:F,zoomOnPinch:k,zoomOnDoubleClick:q,panOnScroll:V,panOnScrollSpeed:O,panOnScrollMode:U,panOnDrag:G,defaultViewport:$,translateExtent:N,minZoom:z,maxZoom:H,onSelectionContextMenu:v,preventScrolling:S,noDragClassName:Je,noWheelClassName:et,noPanClassName:ke,disableKeyboardA11y:Be},M.createElement(Ff,null,M.createElement(jf,{edgeTypes:se,onEdgeClick:a,onEdgeDoubleClick:c,onlyRenderVisibleElements:B,onEdgeContextMenu:de,onEdgeMouseEnter:ne,onEdgeMouseMove:be,onEdgeMouseLeave:Q,onReconnect:Y,onReconnectStart:le,onReconnectEnd:Le,reconnectRadius:mt,defaultMarkerColor:T,noPanClassName:ke,elevateEdgesOnSelect:!!tt,disableKeyboardA11y:Be,rfId:rt},M.createElement(Of,{style:_,type:y,component:x,containerStyle:m})),M.createElement("div",{className:"react-flow__edgelabel-renderer"}),M.createElement(vf,{nodeTypes:yt,onNodeClick:i,onNodeDoubleClick:u,onNodeMouseEnter:l,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:p,selectNodesOnDrag:h,onlyRenderVisibleElements:B,noPanClassName:ke,noDragClassName:Je,disableKeyboardA11y:Be,nodeOrigin:Ve,nodeExtent:nt,rfId:rt})))};Ns.displayName="GraphView";var Wf=E.memo(Ns);const Wn=[[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:Wn,nodeExtent:Wn,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:yu,isValidConnection:void 0},Yf=()=>Ai((e,t)=>({...ze,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:s}=t();e({nodeInternals:Nn(n,r,o,s)})},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",s=typeof r<"u",i=o?Nn(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:s?r:[],hasDefaultNodes:o,hasDefaultEdges:s})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:s,fitViewOnInitDone:i,fitViewOnInitOptions:a,domNode:u,nodeOrigin:c}=t(),l=u==null?void 0:u.querySelector(".react-flow__viewport");if(!l)return;const f=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(f.transform),p=n.reduce((g,b)=>{const y=o.get(b.id);if(y!=null&&y.hidden)o.set(y.id,{...y,[te]:{...y[te],handleBounds:void 0}});else if(y){const _=Kn(b.nodeElement);!!(_.width&&_.height&&(y.width!==_.width||y.height!==_.height||b.forceUpdate))&&(o.set(y.id,{...y,[te]:{...y[te],handleBounds:{source:Qr(".source",b.nodeElement,d,c),target:Qr(".target",b.nodeElement,d,c)}},..._}),g.push({id:y.id,type:"dimensions",dimensions:_}))}return g},[]);fs(o,c);const v=i||s&&!i&&ds(t,{initial:!0,...a});e({nodeInternals:new Map(o),fitViewOnInitDone:v}),(p==null?void 0:p.length)>0&&(r==null||r(p))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:s}=t(),i=n.map(a=>{const u={id:a.id,type:"position",dragging:o};return r&&(u.positionAbsolute=a.positionAbsolute,u.position=a.position),u});s(i)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:s,nodeOrigin:i,getNodes:a,elevateNodesOnSelect:u}=t();if(n!=null&&n.length){if(s){const c=ps(n,a()),l=Nn(c,o,i,u);e({nodeInternals:l})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:s}=t();let i,a=null;r?i=n.map(u=>De(u,!0)):(i=ct(s(),n),a=ct(o,[])),Ut({changedNodes:i,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:s}=t();let i,a=null;r?i=n.map(u=>De(u,!0)):(i=ct(o,n),a=ct(s(),[])),Ut({changedNodes:a,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:s}=t(),i=n||s(),a=r||o,u=i.map(l=>(l.selected=!1,De(l.id,!1))),c=a.map(l=>De(l.id,!1));Ut({changedNodes:u,changedEdges:c,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(),s=r().filter(a=>a.selected).map(a=>De(a.id,!1)),i=n.filter(a=>a.selected).map(a=>De(a.id,!1));Ut({changedNodes:s,changedEdges:i,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:s,d3Zoom:i,d3Selection:a,translateExtent:u}=t();if(!i||!a||!n.x&&!n.y)return!1;const c=je.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),l=[[0,0],[o,s]],f=i==null?void 0:i.constrain()(c,l,u);return i.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),ks=({children:e})=>{const t=E.useRef(null);return t.current||(t.current=Yf()),M.createElement(lu,{value:t.current},e)};ks.displayName="ReactFlowProvider";const $s=({children:e})=>E.useContext(fn)?M.createElement(M.Fragment,null,e):M.createElement(ks,null,e);$s.displayName="ReactFlowWrapper";const Uf={input:os,default:Vn,output:is,group:ir},Xf={default:sn,straight:nr,step:tr,smoothstep:dn,simplebezier:er},qf=[0,0],Gf=[15,15],Zf={x:0,y:0,zoom:1},Kf={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Cs=E.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:s=Uf,edgeTypes:i=Xf,onNodeClick:a,onEdgeClick:u,onInit:c,onMove:l,onMoveStart:f,onMoveEnd:d,onConnect:p,onConnectStart:v,onConnectEnd:g,onClickConnectStart:b,onClickConnectEnd:y,onNodeMouseEnter:_,onNodeMouseMove:x,onNodeMouseLeave:m,onNodeContextMenu:C,onNodeDoubleClick:A,onNodeDragStart:D,onNodeDrag:j,onNodeDragStop:I,onNodesDelete:R,onEdgesDelete:P,onSelectionChange:B,onSelectionDragStart:L,onSelectionDrag:h,onSelectionDragStop:$,onSelectionContextMenu:N,onSelectionStart:z,onSelectionEnd:H,connectionMode:S=Qe.Strict,connectionLineType:T=Pe.Bezier,connectionLineStyle:F,connectionLineComponent:k,connectionLineContainerStyle:V,deleteKeyCode:O="Backspace",selectionKeyCode:U="Shift",selectionOnDrag:q=!1,selectionMode:G=zt.Full,panActivationKeyCode:Z="Space",multiSelectionKeyCode:ee=on()?"Meta":"Control",zoomActivationKeyCode:K=on()?"Meta":"Control",snapToGrid:pe=!1,snapGrid:fe=Gf,onlyRenderVisibleElements:ge=!1,selectNodesOnDrag:de=!0,nodesDraggable:ne,nodesConnectable:be,nodesFocusable:Q,nodeOrigin:Y=qf,edgesFocusable:le,edgesUpdatable:Le,elementsSelectable:mt,defaultViewport:Je=Zf,minZoom:et=.5,maxZoom:ke=2,translateExtent:tt=Wn,preventScrolling:Be=!0,nodeExtent:Ve,defaultMarkerColor:nt="#b1b1b7",zoomOnScroll:rt=!0,zoomOnPinch:yt=!0,panOnScroll:se=!1,panOnScrollSpeed:me=.5,panOnScrollMode:Oe=Ge.Free,zoomOnDoubleClick:We=!0,panOnDrag:Ye=!0,onPaneClick:$e,onPaneMouseEnter:_e,onPaneMouseMove:xt,onPaneMouseLeave:hn,onPaneScroll:wt,onPaneContextMenu:pn,children:lr,onEdgeContextMenu:Ue,onEdgeDoubleClick:Ds,onEdgeMouseEnter:Ps,onEdgeMouseMove:js,onEdgeMouseLeave:Hs,onEdgeUpdate:Fs,onEdgeUpdateStart:Ls,onEdgeUpdateEnd:Bs,onReconnect:Vs,onReconnectStart:Os,onReconnectEnd:Ws,reconnectRadius:Ys=10,edgeUpdaterRadius:Us=10,onNodesChange:Xs,onEdgesChange:qs,noDragClassName:Gs="nodrag",noWheelClassName:Zs="nowheel",noPanClassName:ur="nopan",fitView:Ks=!1,fitViewOptions:Qs,connectOnClick:Js=!0,attributionPosition:ei,proOptions:ti,defaultEdgeOptions:ni,elevateNodesOnSelect:ri=!0,elevateEdgesOnSelect:oi=!1,disableKeyboardA11y:fr=!1,autoPanOnConnect:si=!0,autoPanOnNodeDrag:ii=!0,connectionRadius:ai=20,isValidConnection:ci,onError:li,style:ui,id:dr,nodeDragThreshold:fi,...di},hi)=>{const gn=dr||"1";return M.createElement("div",{...di,style:{...ui,...Kf},ref:hi,className:ae(["react-flow",o]),"data-testid":"rf__wrapper",id:dr},M.createElement($s,null,M.createElement(Wf,{onInit:c,onMove:l,onMoveStart:f,onMoveEnd:d,onNodeClick:a,onEdgeClick:u,onNodeMouseEnter:_,onNodeMouseMove:x,onNodeMouseLeave:m,onNodeContextMenu:C,onNodeDoubleClick:A,nodeTypes:s,edgeTypes:i,connectionLineType:T,connectionLineStyle:F,connectionLineComponent:k,connectionLineContainerStyle:V,selectionKeyCode:U,selectionOnDrag:q,selectionMode:G,deleteKeyCode:O,multiSelectionKeyCode:ee,panActivationKeyCode:Z,zoomActivationKeyCode:K,onlyRenderVisibleElements:ge,selectNodesOnDrag:de,defaultViewport:Je,translateExtent:tt,minZoom:et,maxZoom:ke,preventScrolling:Be,zoomOnScroll:rt,zoomOnPinch:yt,zoomOnDoubleClick:We,panOnScroll:se,panOnScrollSpeed:me,panOnScrollMode:Oe,panOnDrag:Ye,onPaneClick:$e,onPaneMouseEnter:_e,onPaneMouseMove:xt,onPaneMouseLeave:hn,onPaneScroll:wt,onPaneContextMenu:pn,onSelectionContextMenu:N,onSelectionStart:z,onSelectionEnd:H,onEdgeContextMenu:Ue,onEdgeDoubleClick:Ds,onEdgeMouseEnter:Ps,onEdgeMouseMove:js,onEdgeMouseLeave:Hs,onReconnect:Vs??Fs,onReconnectStart:Os??Ls,onReconnectEnd:Ws??Bs,reconnectRadius:Ys??Us,defaultMarkerColor:nt,noDragClassName:Gs,noWheelClassName:Zs,noPanClassName:ur,elevateEdgesOnSelect:oi,rfId:gn,disableKeyboardA11y:fr,nodeOrigin:Y,nodeExtent:Ve}),M.createElement(Lu,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:v,onConnectEnd:g,onClickConnectStart:b,onClickConnectEnd:y,nodesDraggable:ne,nodesConnectable:be,nodesFocusable:Q,edgesFocusable:le,edgesUpdatable:Le,elementsSelectable:mt,elevateNodesOnSelect:ri,minZoom:et,maxZoom:ke,nodeExtent:Ve,onNodesChange:Xs,onEdgesChange:qs,snapToGrid:pe,snapGrid:fe,connectionMode:S,translateExtent:tt,connectOnClick:Js,defaultEdgeOptions:ni,fitView:Ks,fitViewOptions:Qs,onNodesDelete:R,onEdgesDelete:P,onNodeDragStart:D,onNodeDrag:j,onNodeDragStop:I,onSelectionDrag:h,onSelectionDragStart:L,onSelectionDragStop:$,noPanClassName:ur,nodeOrigin:Y,rfId:gn,autoPanOnConnect:si,autoPanOnNodeDrag:ii,onError:li,connectionRadius:ai,isValidConnection:ci,nodeDragThreshold:fi}),M.createElement(Hu,{onSelectionChange:B}),lr,M.createElement(fu,{proOptions:ti,position:ei}),M.createElement(Yu,{rfId:gn,disableKeyboardA11y:fr})))});Cs.displayName="ReactFlow";function Ms(e){return t=>{const[n,r]=E.useState(t),o=E.useCallback(s=>r(i=>e(s,i)),[]);return[n,r,o]}}const Qf=Ms(ps),Jf=Ms(sf);function ed(){return M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},M.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function td(){return M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},M.createElement("path",{d:"M0 0h32v4.2H0z"}))}function nd(){return M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},M.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 rd(){return M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},M.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 od(){return M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},M.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 $t=({children:e,className:t,...n})=>M.createElement("button",{type:"button",className:ae(["react-flow__controls-button",t]),...n},e);$t.displayName="ControlButton";const sd=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),As=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:s,onZoomOut:i,onFitView:a,onInteractiveChange:u,className:c,children:l,position:f="bottom-left"})=>{const d=oe(),[p,v]=E.useState(!1),{isInteractive:g,minZoomReached:b,maxZoomReached:y}=J(sd,ie),{zoomIn:_,zoomOut:x,fitView:m}=ar();if(E.useEffect(()=>{v(!0)},[]),!p)return null;const C=()=>{_(),s==null||s()},A=()=>{x(),i==null||i()},D=()=>{m(o),a==null||a()},j=()=>{d.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),u==null||u(!g)};return M.createElement(Fo,{className:ae(["react-flow__controls",c]),position:f,style:e,"data-testid":"rf__controls"},t&&M.createElement(M.Fragment,null,M.createElement($t,{onClick:C,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:y},M.createElement(ed,null)),M.createElement($t,{onClick:A,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b},M.createElement(td,null))),n&&M.createElement($t,{className:"react-flow__controls-fitview",onClick:D,title:"fit view","aria-label":"fit view"},M.createElement(nd,null)),r&&M.createElement($t,{className:"react-flow__controls-interactive",onClick:j,title:"toggle interactivity","aria-label":"toggle interactivity"},g?M.createElement(od,null):M.createElement(rd,null)),l)};As.displayName="Controls";var id=E.memo(As),we;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(we||(we={}));function ad({color:e,dimensions:t,lineWidth:n}){return M.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function cd({color:e,radius:t}){return M.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const ld={[we.Dots]:"#91919a",[we.Lines]:"#eee",[we.Cross]:"#e2e2e2"},ud={[we.Dots]:1,[we.Lines]:1,[we.Cross]:6},fd=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Is({id:e,variant:t=we.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:a,className:u}){const c=E.useRef(null),{transform:l,patternId:f}=J(fd,ie),d=i||ld[t],p=r||ud[t],v=t===we.Dots,g=t===we.Cross,b=Array.isArray(n)?n:[n,n],y=[b[0]*l[2]||1,b[1]*l[2]||1],_=p*l[2],x=g?[_,_]:y,m=v?[_/s,_/s]:[x[0]/s,x[1]/s];return M.createElement("svg",{className:ae(["react-flow__background",u]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},M.createElement("pattern",{id:f+e,x:l[0]%y[0],y:l[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${m[0]},-${m[1]})`},v?M.createElement(cd,{color:d,radius:_/s}):M.createElement(ad,{dimensions:x,color:d,lineWidth:o})),M.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}Is.displayName="Background";var dd=E.memo(Is);/**
|
|
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 hd=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],pd=Te("circle-check-big",hd);/**
|
|
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 gd=[["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"}]],md=Te("circle-play",gd);/**
|
|
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 yd=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],xd=Te("circle",yd);/**
|
|
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 wd=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],vd=Te("clock",wd);/**
|
|
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 bd=[["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"}]],_d=Te("file-text",bd);/**
|
|
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 Sd=[["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"}]],Ts=Te("git-branch",Sd);/**
|
|
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 Ed=[["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"}]],Nd=Te("git-merge",Ed);/**
|
|
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 kd=[["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"}]],$d=Te("upload",kd);/**
|
|
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 Cd=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zs=Te("x",Cd);function Md({data:e}){const t=()=>{switch(e.status){case"active":return w.jsx(md,{className:"status-icon active",size:16});case"saved":return w.jsx(pd,{className:"status-icon saved",size:16});default:return w.jsx(xd,{className:"status-icon",size:16})}},n=()=>{switch(e.status){case"active":return"active";case"saved":return"saved";case"merged":return"merged";default:return""}};return w.jsxs("div",{className:`node-card ${e.selected?"selected":""} ${n()}`,children:[w.jsx(Fe,{type:"target",position:W.Top,className:"node-handle"}),w.jsxs("div",{className:"node-header",children:[t(),w.jsx("span",{className:"node-label",children:e.label})]}),e.claudeSessionId&&w.jsxs("div",{className:"node-id",children:[e.claudeSessionId.slice(0,8),"..."]}),w.jsx("div",{className:"node-status-badge",children:e.status}),w.jsx(Fe,{type:"source",position:W.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 w.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:[w.jsx(Fe,{type:"target",position:W.Top}),w.jsx("span",{style:{fontSize:"10px",fontWeight:600,color:t,textAlign:"center"},children:e.status==="merged"?"M":"C"}),w.jsx(Fe,{type:"source",position:W.Bottom})]})}const Id={sessionNode:Md,compactNode:Ad};function Td({session:e,selectedNode:t,onNodeClick:n}){var b,y;const r=E.useMemo(()=>(e.forks||[]).map(x=>`${x.id}:${x.status}:${x.parentId}`).join(","),[e.forks]),o=E.useMemo(()=>JSON.stringify(e.nodePositions||{}),[e.nodePositions]),s=E.useCallback((_,x,m=new Set)=>{if(_==="main"||m.has(_))return 0;const C=x.find(A=>A.id===_);return C?(m.add(_),1+s(C.parentId,x,m)):0},[]),i=E.useMemo(()=>{var j,I;const _=e.forks||[],x=e.nodePositions||{},m=new Map;_.forEach(R=>{const P=s(R.id,_);m.has(P)||m.set(P,[]),m.get(P).push(R)});const C=R=>{if(R==="main")return{x:250,y:50};const P=_.find($=>$.id===R);if(!P)return{x:250,y:50};const B=s(P.id,_),L=m.get(B)||[];return{x:100+L.indexOf(P)*150-L.length*75+250,y:50+B*150}},A=R=>x[R]||C(R),D=[{id:"main",type:"sessionNode",position:A("main"),draggable:!0,data:{label:"MAIN",status:((j=e.main)==null?void 0:j.status)||e.status,claudeSessionId:(I=e.main)==null?void 0:I.claudeSessionId,selected:!1}}];return _.forEach(R=>{const P=R.status==="closed"||R.status==="merged"?"compactNode":"sessionNode";D.push({id:R.id,type:P,position:A(R.id),draggable:!0,data:{label:R.name,status:R.status,claudeSessionId:R.claudeSessionId,selected:!1}})}),D},[e.id,e.status,(b=e.main)==null?void 0:b.status,(y=e.main)==null?void 0:y.claudeSessionId,r,o,s]),a=E.useMemo(()=>(e.forks||[]).map(x=>({id:`${x.parentId}-${x.id}`,source:x.parentId,target:x.id,animated:x.status==="active",markerEnd:{type:Rt.ArrowClosed},style:{stroke:x.status==="active"?"#a6e3a1":"#585b70",strokeWidth:2}})),[r]),[u,c,l]=Qf(i),[f,d,p]=Jf(a);E.useEffect(()=>{c(i),d(a)},[r]);const v=E.useMemo(()=>u.map(_=>({..._,data:{..._.data,selected:_.id===t}})),[u,t]),g=E.useCallback((_,x)=>{n(x.id)},[n]);return w.jsx("div",{style:{width:"100%",height:"100%"},children:w.jsxs(Cs,{nodes:v,edges:f,nodeTypes:Id,onNodesChange:l,onEdgesChange:p,onNodeClick:g,fitView:!0,minZoom:.5,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:1},proOptions:{hideAttribution:!0},children:[w.jsx(dd,{}),w.jsx(id,{})]})})}function zd({session:e}){const t=i=>{const a=new Date(i),c=new Date().getTime()-a.getTime(),l=Math.floor(c/(1e3*60*60)),f=Math.floor(l/24);return f>0?`${f} day${f>1?"s":""} ago`:l>0?`${l} hour${l>1?"s":""} ago`:"Just now"},n=async()=>{try{await window.electronAPI.openProjectFolder()}catch(i){console.error("Error opening project folder:",i)}},r=async()=>{try{await window.electronAPI.focusTerminal()}catch(i){console.error("Error focusing terminal:",i)}},o=e.forks.filter(i=>i.status==="active").length,s=e.forks.filter(i=>i.status==="saved").length;return w.jsxs("div",{className:"session-info",children:[w.jsxs("div",{className:"session-info-header",children:[w.jsx("h2",{className:"session-name",children:e.name||"Unnamed Session"}),w.jsx("div",{className:`session-status-badge ${e.status}`,children:e.status})]}),w.jsxs("div",{className:"session-meta",children:[w.jsxs("div",{className:"session-meta-item",children:[w.jsx(vd,{size:14}),w.jsx("span",{children:t(e.createdAt)})]}),w.jsxs("button",{className:"session-meta-item folder-button",onClick:n,title:"Open project folder (tries Cursor, VSCode, or Finder)",children:[w.jsx(mi,{size:14}),w.jsx("span",{children:"Code"})]}),w.jsxs("button",{className:"session-meta-item terminal-button",onClick:r,title:"Focus terminal window",children:[w.jsx(yi,{size:14}),w.jsx("span",{children:"Terminal"})]}),w.jsxs("div",{className:"session-meta-item",children:[w.jsx(Ts,{size:14}),w.jsxs("span",{children:[o+s," fork",o+s!==1?"s":""]})]})]})]})}function Rd({selectedNode:e,onCreateFork:t,onExportFork:n,onMergeFork:r,onCloseFork:o,isCreatingFork:s,isExporting:i,isMerging:a,isClosing:u,canCreateFork:c,hasExport:l}){const f=e!=="main",d=s||i||a||u;return w.jsxs("div",{className:"action-panel",children:[w.jsx("div",{className:"action-panel-header",children:w.jsxs("span",{className:"action-panel-title",children:["Actions for: ",w.jsxs("strong",{children:[e==="main"?"MAIN":e.slice(0,8),"..."]})]})}),w.jsxs("div",{className:"action-buttons",children:[w.jsxs("button",{className:"action-button primary",onClick:t,disabled:!c||d,title:c?"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:[w.jsx(Ts,{size:18}),w.jsx("span",{children:s?"Creating...":"New Fork"})]}),w.jsxs("button",{className:"action-button",onClick:n,disabled:!f||d,title:"Export fork summary",children:[w.jsx($d,{size:18}),w.jsx("span",{children:i?"Exporting...":"Export"})]}),w.jsxs("button",{className:"action-button",onClick:r,disabled:!f||d||!l,title:l?"Merge fork back to parent":"Export the fork first before merging",children:[w.jsx(Nd,{size:18}),w.jsx("span",{children:a?"Merging...":"Merge"})]}),w.jsxs("button",{className:"action-button danger",onClick:o,disabled:!f||d,title:"Close fork (abandon experiment)",children:[w.jsx(zs,{size:18}),w.jsx("span",{children:u?"Closing...":"Close"})]})]})]})}function Dd({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 w.jsx("div",{className:"modal-overlay",onClick:t,children:w.jsxs("div",{className:"modal fork-info-modal",onClick:s=>s.stopPropagation(),children:[w.jsxs("div",{className:"modal-header",children:[w.jsx("h3",{children:"Fork Details"}),w.jsx("button",{className:"modal-close-btn",onClick:t,children:w.jsx(zs,{size:18})})]}),w.jsxs("div",{className:"fork-info-content",children:[w.jsxs("div",{className:"info-row",children:[w.jsx("span",{className:"info-label",children:"Name:"}),w.jsx("span",{className:"info-value",children:e.name})]}),w.jsxs("div",{className:"info-row",children:[w.jsx("span",{className:"info-label",children:"ID:"}),w.jsx("span",{className:"info-value fork-id",children:e.id})]}),w.jsxs("div",{className:"info-row",children:[w.jsx("span",{className:"info-label",children:"Claude Session ID:"}),w.jsx("span",{className:"info-value fork-id",children:e.claudeSessionId})]}),w.jsxs("div",{className:"info-row",children:[w.jsx("span",{className:"info-label",children:"Status:"}),w.jsx("span",{className:"info-value",children:w.jsx("span",{className:"status-badge",style:{borderColor:r,color:r},children:o})})]}),w.jsxs("div",{className:"info-row",children:[w.jsx("span",{className:"info-label",children:"Created:"}),w.jsx("span",{className:"info-value",children:new Date(e.createdAt).toLocaleString()})]}),e.status==="merged"&&e.mergedAt&&w.jsxs("div",{className:"info-row",children:[w.jsx("span",{className:"info-label",children:"Merged:"}),w.jsx("span",{className:"info-value",children:new Date(e.mergedAt).toLocaleString()})]}),e.contextPath&&w.jsxs("div",{className:"info-row",children:[w.jsx("span",{className:"info-label",children:"Export Path:"}),w.jsx("span",{className:"info-value export-path",children:e.contextPath})]})]}),e.status==="merged"&&e.contextPath&&n&&w.jsx("div",{className:"modal-actions",children:w.jsxs("button",{className:"button-primary",onClick:n,children:[w.jsx(_d,{size:16}),"Open Export File"]})})]})})}const Rs={rowHeight:44,laneWidth:50,nodeRadius:9,padding:40,labelColumnWidth:220,infoColumnWidth:300},io=["#a6e3a1","#89b4fa","#f9e2af","#cba6f7","#f38ba8","#94e2d5","#fab387","#74c7ec"];function ao(e){return io[e%io.length]}function Pd(e){var r;const t=[];t.push({id:"main-start",type:"session-start",branchId:"main",timestamp:e.createdAt,label:e.name,description:"Session started",status:((r=e.main)==null?void 0:r.status)||e.status});const n=e.forks||[];for(const o of n)t.push({id:`${o.id}-create`,type:"fork-create",branchId:o.id,parentBranchId:o.parentId,timestamp:o.createdAt,label:o.name,description:`Forked from ${o.parentId==="main"?"MAIN":o.parentId}`,status:o.status}),o.status==="merged"&&o.closedAt?t.push({id:`${o.id}-merge`,type:"fork-merge",branchId:o.id,parentBranchId:o.parentId,timestamp:o.closedAt,label:`Merged: ${o.name}`,description:`Merged back to ${o.parentId==="main"?"MAIN":o.parentId}`,status:"merged"}):o.status==="closed"&&o.closedAt?t.push({id:`${o.id}-close`,type:"fork-close",branchId:o.id,timestamp:o.closedAt,label:`Closed: ${o.name}`,description:"Fork closed without merge",status:"closed"}):o.status;return t.sort((o,s)=>new Date(o.timestamp).getTime()-new Date(s.timestamp).getTime())}function jd(e,t){var u;const n=[],r=t.forks||[],o=new Set;o.add("main");for(const c of r)c.parentId&&c.parentId!=="main"&&o.add(c.parentId);for(const c of r)(c.status==="active"||c.status==="saved")&&o.add(c.id);const s=new Map;s.set("main",0);const i=[...r].sort((c,l)=>new Date(c.createdAt).getTime()-new Date(l.createdAt).getTime());let a=1;for(const c of i)o.has(c.id)&&(s.set(c.id,a),a++);for(const c of i)s.has(c.id)||(s.get(c.parentId),s.set(c.id,a),a++);n.push({id:"main",name:"MAIN",color:ao(0),lane:0,parentId:"",status:((u=t.main)==null?void 0:u.status)||t.status,startEventIndex:0});for(const c of i){const l=e.findIndex(p=>p.id===`${c.id}-create`),f=e.findIndex(p=>p.id===`${c.id}-merge`||p.id===`${c.id}-close`),d=s.get(c.id)??1;n.push({id:c.id,name:c.name,color:ao(d),lane:d,parentId:c.parentId,status:c.status,startEventIndex:l>=0?l:0,endEventIndex:f>=0?f:void 0})}return n}function Hd(e,t={}){return E.useMemo(()=>{if(!e)return null;const n={...Rs,...t},{rowHeight:r,laneWidth:o,padding:s,nodeRadius:i}=n,a=Pd(e);if(a.length===0)return null;const u=jd(a,e),c=new Map;for(const x of u)c.set(x.id,x);const l=a.map((x,m)=>{const C=c.get(x.branchId),A=(C==null?void 0:C.lane)??0;return{event:x,x:s+A*o,y:s+m*r,lane:A,branch:C??u[0]}}),f=[],d=new Map;for(const x of l){const m=x.event.branchId;d.has(m)||d.set(m,[]),d.get(m).push(x)}const p=l.length>0?l[l.length-1].y:s,v=new Set;v.add("main");for(const x of u)x.parentId&&x.parentId!=="main"&&v.add(x.parentId);const g=new Map;for(const x of l){const m=x.event.parentBranchId;m&&(g.has(m)||g.set(m,[]),g.get(m).push(x))}for(const x of u){const m=d.get(x.id)||[];if(m.length===0)continue;const C=s+x.lane*o,A=[...m].sort((B,L)=>B.y-L.y),D=A[0];let I=A[A.length-1].y;const R=g.get(x.id)||[];if(R.length>0){const B=Math.max(...R.map(L=>L.y));I=Math.max(I,B)}(x.status==="active"||x.status==="saved")&&(I=Math.max(I,p+r/2)),x.id==="main"&&(I=p+r/2);const P=D.y+i;I>P&&f.push({id:`backbone-${x.id}`,type:"continuation",fromX:C,fromY:P,toX:C,toY:I,color:x.color,animated:x.status==="active"})}for(const x of l){const{event:m}=x;if(m.type==="fork-create"&&m.parentBranchId){const C=c.get(m.parentBranchId);if(C){const A=s+C.lane*o;f.push({id:`fork-${m.id}`,type:"fork",fromX:A,fromY:x.y,toX:x.x-i,toY:x.y,color:x.branch.color,animated:x.branch.status==="active"})}}if(m.type==="fork-create"&&x.branch.status==="merged"&&m.parentBranchId){const C=c.get(m.parentBranchId);if(C){const A=s+C.lane*o;f.push({id:`merge-${m.id}`,type:"merge",fromX:x.x,fromY:x.y+i,toX:A,toY:x.y,color:x.branch.color,animated:!1})}}}const b=Math.max(...u.map(x=>x.lane)),y=s*2+(b+1)*o,_=s*2+a.length*r;return{nodes:l,connections:f,branches:u,totalHeight:_,totalWidth:y}},[e,t])}const Fd=""+new URL("icon-DCcMpdAg.png",import.meta.url).href,Ld=({x:e,y:t,radius:n,color:r,type:o,isSelected:s=!1,isActive:i=!1,onClick:a,nodeId:u})=>{const c=n*1.8,l=`clip-${u}`;return w.jsxs(w.Fragment,{children:[w.jsx("style",{children:`
|
|
63
|
+
@keyframes pulse {
|
|
64
|
+
0%, 100% {
|
|
65
|
+
opacity: 1;
|
|
66
|
+
transform: scale(1);
|
|
67
|
+
}
|
|
68
|
+
50% {
|
|
69
|
+
opacity: 0.7;
|
|
70
|
+
transform: scale(1.05);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.timeline-node {
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
transition: transform 0.15s ease-in-out;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.timeline-node:hover {
|
|
80
|
+
transform: scale(1.1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.timeline-node-active {
|
|
84
|
+
animation: pulse 1.5s ease-in-out infinite;
|
|
85
|
+
transform-origin: ${e}px ${t}px;
|
|
86
|
+
}
|
|
87
|
+
`}),w.jsx("defs",{children:w.jsx("clipPath",{id:l,children:w.jsx("circle",{cx:e,cy:t,r:n-2})})}),w.jsxs("g",{className:`timeline-node ${i?"timeline-node-active":""}`,onClick:a,style:{transformOrigin:`${e}px ${t}px`},children:[s&&w.jsx("circle",{cx:e,cy:t,r:n+6,fill:"none",stroke:r,strokeWidth:3,opacity:.4}),s&&w.jsx("circle",{cx:e,cy:t,r:n+10,fill:"none",stroke:r,strokeWidth:2,opacity:.2}),w.jsx("circle",{cx:e,cy:t,r:n,fill:"#1e1e2e"}),w.jsx("image",{href:Fd,x:e-c/2,y:t-c/2,width:c,height:c,clipPath:`url(#${l})`}),w.jsx("circle",{cx:e,cy:t,r:n,fill:"none",stroke:r,strokeWidth:2.5})]})]})};function Bd(e,t){const n=e.replace("#","");return`arrow-${t}-${n}`}function Vd({fromX:e,fromY:t,toX:n,toY:r,color:o,type:s,animated:i=!1,strokeWidth:a=2}){const u=Bd(o,s);let c;switch(s){case"continuation":c=`M ${e} ${t} L ${n} ${r}`;break;case"fork":{c=`M ${e} ${t} L ${n} ${r}`;break}case"merge":{const v=n<e;Math.abs(e-n)<24?c=`M ${e} ${t} L ${n} ${r}`:v?c=`M ${e} ${t}
|
|
88
|
+
L ${e} ${t+20-12}
|
|
89
|
+
Q ${e} ${t+20}, ${e-12} ${t+20}
|
|
90
|
+
L ${n} ${t+20}`:c=`M ${e} ${t}
|
|
91
|
+
L ${e} ${t+20-12}
|
|
92
|
+
Q ${e} ${t+20}, ${e+12} ${t+20}
|
|
93
|
+
L ${n} ${t+20}`;break}default:c=`M ${e} ${t} L ${n} ${r}`}const l={stroke:o,strokeWidth:a,fill:"none",strokeLinecap:"round"},f=w.jsx("defs",{children:w.jsx("marker",{id:u,markerWidth:"6",markerHeight:"6",refX:"5",refY:"3",orient:"auto",markerUnits:"strokeWidth",children:w.jsx("path",{d:"M 0 0 L 6 3 L 0 6 Z",fill:o})})});return i?w.jsxs(w.Fragment,{children:[w.jsx("style",{children:`
|
|
94
|
+
@keyframes dash-animation {
|
|
95
|
+
to {
|
|
96
|
+
stroke-dashoffset: -20;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
`}),f,w.jsx("path",{d:c,style:{...l,strokeDasharray:"5, 5",animation:"dash-animation 0.5s linear infinite"},markerEnd:`url(#${u})`})]}):w.jsxs(w.Fragment,{children:[f,w.jsx("path",{d:c,style:l,markerEnd:`url(#${u})`})]})}function Od({layout:e,config:t,selectedNodeId:n,onNodeClick:r}){const{nodes:o,connections:s}=e,{nodeRadius:i}=t;return w.jsxs("svg",{width:e.totalWidth,height:e.totalHeight,style:{display:"block",overflow:"visible"},children:[w.jsx("defs",{children:w.jsx("pattern",{id:"grid",width:t.laneWidth,height:t.rowHeight,patternUnits:"userSpaceOnUse",children:w.jsx("path",{d:`M ${t.laneWidth} 0 L 0 0 0 ${t.rowHeight}`,fill:"none",stroke:"rgba(255,255,255,0.03)",strokeWidth:"1"})})}),w.jsx("g",{className:"connections-layer",children:s.map(a=>w.jsx(Vd,{fromX:a.fromX,fromY:a.fromY,toX:a.toX,toY:a.toY,color:a.color,type:a.type,animated:a.animated,strokeWidth:2},a.id))}),w.jsx("g",{className:"nodes-layer",children:o.map(a=>{const u=a.event.id===n||a.event.branchId===n;return w.jsx(Ld,{nodeId:a.event.id,x:a.x,y:a.y,radius:i,color:a.branch.color,type:a.event.type,isSelected:u,isActive:a.branch.status==="active",onClick:()=>r==null?void 0:r(a.event.branchId)},a.event.id)})})]})}function Wd({node:e,rowHeight:t,isSelected:n=!1,onClick:r}){const{event:o,branch:s}=e,i=l=>{switch(l){case"active":return"●";case"saved":return"◐";case"merged":return"◆";case"closed":return"○";default:return"●"}},a=l=>{switch(l){case"active":return"#a6e3a1";case"saved":return"#f9e2af";case"merged":return"#94e2d5";case"closed":return"#6c7086";default:return"#cdd6f4"}},u=()=>{switch(o.type){case"session-start":return"Session";case"fork-create":return"Fork";case"fork-merge":return"Merge";case"fork-close":return"Close";case"fork-save":return"Save";default:return""}},c=l=>{const f=new Date(l),p=new Date().getTime()-f.getTime(),v=Math.floor(p/6e4),g=Math.floor(p/36e5),b=Math.floor(p/864e5);return v<1?"just now":v<60?`${v}m ago`:g<24?`${g}h ago`:b<7?`${b}d ago`:f.toLocaleDateString()};return w.jsxs("div",{className:`timeline-row ${n?"selected":""}`,style:{height:t,display:"flex",alignItems:"center",padding:"0 12px",cursor:"pointer",backgroundColor:n?"rgba(137, 180, 250, 0.15)":"transparent",borderLeft:`3px solid ${n?s.color:"transparent"}`,transition:"background-color 0.15s ease"},onClick:r,onMouseEnter:l=>{n||(l.currentTarget.style.backgroundColor="rgba(255, 255, 255, 0.05)")},onMouseLeave:l=>{n||(l.currentTarget.style.backgroundColor="transparent")},children:[w.jsx("span",{style:{color:a(o.status),marginRight:8,fontSize:10},children:i(o.status)}),w.jsx("span",{style:{backgroundColor:s.color,color:"#1e1e2e",padding:"2px 6px",borderRadius:4,fontSize:10,fontWeight:600,marginRight:8,minWidth:45,textAlign:"center"},children:u()}),w.jsx("span",{style:{flex:1,color:"#cdd6f4",fontSize:13,fontWeight:n?500:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.label}),w.jsx("span",{style:{color:"#6c7086",fontSize:11,marginLeft:8},children:c(o.timestamp)})]})}function Yd({branch:e,y:t,isVisible:n=!0,onClick:r}){if(!n)return null;const s=(i=>{switch(i){case"active":return{text:"",color:""};case"saved":return{text:"SAVED",color:"#f9e2af"};case"merged":return{text:"MERGED",color:"#94e2d5"};case"closed":return{text:"CLOSED",color:"#6c7086"};default:return{text:"",color:""}}})(e.status);return w.jsxs("div",{style:{position:"absolute",left:24,top:t-12,display:"flex",alignItems:"center",gap:6,cursor:r?"pointer":"default"},onClick:r,children:[w.jsx("span",{style:{backgroundColor:e.color,color:"#1e1e2e",padding:"3px 8px",borderRadius:4,fontSize:11,fontWeight:600,maxWidth:120,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),s.text&&w.jsx("span",{style:{backgroundColor:s.color,color:"#1e1e2e",padding:"2px 5px",borderRadius:3,fontSize:9,fontWeight:700},children:s.text})]})}const Ud=`
|
|
100
|
+
.timeline-scroll-container::-webkit-scrollbar {
|
|
101
|
+
width: 8px;
|
|
102
|
+
height: 8px;
|
|
103
|
+
}
|
|
104
|
+
.timeline-scroll-container::-webkit-scrollbar-track {
|
|
105
|
+
background: #181825;
|
|
106
|
+
border-radius: 4px;
|
|
107
|
+
}
|
|
108
|
+
.timeline-scroll-container::-webkit-scrollbar-thumb {
|
|
109
|
+
background: #45475a;
|
|
110
|
+
border-radius: 4px;
|
|
111
|
+
}
|
|
112
|
+
.timeline-scroll-container::-webkit-scrollbar-thumb:hover {
|
|
113
|
+
background: #585b70;
|
|
114
|
+
}
|
|
115
|
+
.timeline-scroll-container::-webkit-scrollbar-corner {
|
|
116
|
+
background: #181825;
|
|
117
|
+
}
|
|
118
|
+
`;function Xd({session:e,selectedNode:t,onNodeClick:n,config:r={}}){const o=E.useRef(null),s={...Rs,...r},i=Hd(e,s),u=E.useCallback(()=>{if(!i)return new Set;const c=new Set,l=new Set;for(const f of i.nodes)c.has(f.event.branchId)||(c.add(f.event.branchId),l.add(f.event.id));return l},[i])();return!i||i.nodes.length===0?w.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"#6c7086"},children:"No timeline events"}):w.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",backgroundColor:"#1e1e2e",overflow:"hidden"},children:[w.jsx("style",{children:Ud}),w.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"10px 14px",backgroundColor:"#181825",borderBottom:"1px solid #313244"},children:[w.jsx("span",{style:{color:"#cdd6f4",fontSize:12,fontWeight:500},children:"Timeline"}),w.jsxs("span",{style:{color:"#6c7086",fontSize:11,marginLeft:8},children:[i.nodes.length," events"]})]}),w.jsxs("div",{ref:o,className:"timeline-scroll-container",style:{flex:1,display:"flex",overflow:"auto",backgroundColor:"#11111b"},children:[w.jsxs("div",{style:{width:s.labelColumnWidth,flexShrink:0,position:"relative",borderRight:"1px solid #313244",paddingTop:s.padding},children:[i.nodes.map(c=>u.has(c.event.id)&&w.jsx(Yd,{branch:c.branch,y:c.y+s.nodeRadius,isVisible:!0,onClick:()=>n(c.event.branchId)},`label-${c.event.id}`)),w.jsx("div",{style:{height:i.totalHeight}})]}),w.jsx("div",{style:{width:i.totalWidth+20,flexShrink:0,borderRight:"1px solid #313244"},children:w.jsx(Od,{layout:i,config:s,selectedNodeId:t,onNodeClick:n})}),w.jsx("div",{style:{flex:1,minWidth:s.infoColumnWidth,paddingTop:s.padding-s.rowHeight/2+s.nodeRadius,paddingRight:16},children:i.nodes.map(c=>w.jsx(Wd,{node:c,rowHeight:s.rowHeight,isSelected:c.event.branchId===t,onClick:()=>n(c.event.branchId)},`row-${c.event.id}`))})]})]})}function qd({currentView:e,onViewChange:t}){return w.jsxs("div",{style:{display:"flex",backgroundColor:"#313244",borderRadius:6,padding:2,gap:2,WebkitAppRegion:"no-drag"},children:[w.jsx("button",{onClick:()=>t("timeline"),style:{padding:"4px 10px",fontSize:11,fontWeight:500,border:"none",borderRadius:4,cursor:"pointer",transition:"all 0.15s ease",backgroundColor:e==="timeline"?"#89b4fa":"transparent",color:e==="timeline"?"#1e1e2e":"#a6adc8"},title:"Timeline View (GitKraken style)",children:"Timeline"}),w.jsx("button",{onClick:()=>t("tree"),style:{padding:"4px 10px",fontSize:11,fontWeight:500,border:"none",borderRadius:4,cursor:"pointer",transition:"all 0.15s ease",backgroundColor:e==="tree"?"#89b4fa":"transparent",color:e==="tree"?"#1e1e2e":"#a6adc8"},title:"Tree View (ReactFlow)",children:"Tree"})]})}const re={info:(...e)=>console.log("[App]",...e),error:(...e)=>console.error("[App]",...e),warn:(...e)=>console.warn("[App]",...e)};re.info("=== App module loaded ===");function Gd(){var F;re.info("App component rendering...");const[e,t]=E.useState(null),[n,r]=E.useState("main"),[o,s]=E.useState(!0),[i,a]=E.useState(null),[u,c]=E.useState("timeline"),[l,f]=E.useState(!1),[d,p]=E.useState(""),[v,g]=E.useState(!1),[b,y]=E.useState(!1),[_,x]=E.useState(!1),[m,C]=E.useState(!1),[A,D]=E.useState(!1),[j,I]=E.useState(null);E.useEffect(()=>{if(re.info("useEffect: Initializing app..."),re.info("electronAPI available:",!!window.electronAPI),!window.electronAPI){re.error("electronAPI is not available! Preload script may have failed."),a("electronAPI not available - preload script may have failed"),s(!1);return}re.info("Requesting session data from main process..."),window.electronAPI.getSession().then(k=>{var V;re.info("Session data received:",k==null?void 0:k.id,k==null?void 0:k.name),re.info("Session has",((V=k==null?void 0:k.forks)==null?void 0:V.length)||0,"forks"),t(k),s(!1),re.info("Loading state set to false")}).catch(k=>{re.error("Failed to get session:",k.message),a(`Failed to get session: ${k.message}`),s(!1)}),re.info("Setting up state update listener..."),window.electronAPI.onStateUpdate(k=>{var V;re.info("State update received:",k==null?void 0:k.id,"forks:",(V=k==null?void 0:k.forks)==null?void 0:V.length),k!=null&&k.forks&&re.info("Fork details:",k.forks.map(O=>`${O.name}:${O.status}`).join(", ")),t(k)}),re.info("useEffect: Initialization complete")},[]);const R=async k=>{if(!e)return;const V=e.forks.find(O=>O.id===k);if(V&&(V.status==="closed"||V.status==="merged")){I(V),D(!0);return}r(k),await window.electronAPI.selectNode(k)},P=()=>{var V;if(!e){alert("No session available");return}if(e.forks.filter(O=>O.parentId===n&&O.status==="active").length>0){const O=n==="main"?"MAIN":((V=e.forks.find(U=>U.id===n))==null?void 0:V.name)||n;alert(`Claude Code limitation: Only one active fork can exist from each branch.
|
|
119
|
+
|
|
120
|
+
The branch "${O}" already has an active fork. Close or merge the existing fork first, or create a fork from it.`);return}f(!0)},B=async()=>{if(!d.trim()){alert("Please enter a fork name");return}g(!0);try{await window.electronAPI.createFork(e.id,d,n),f(!1),p(""),alert("Fork created successfully!")}catch(k){alert(`Failed to create fork: ${k.message}`),console.error("Create fork error:",k)}finally{g(!1)}},L=()=>{f(!1),p("")},h=async()=>{if(!(!e||n==="main")){y(!0);try{await window.electronAPI.exportFork(e.id,n),alert("Export completed successfully!")}catch(k){alert(`Export failed: ${k.message}`),console.error("Export error:",k)}finally{y(!1)}}},$=async()=>{if(!(!e||n==="main"||!window.confirm(`Are you sure you want to merge "${n}" to main?`))){x(!0);try{await window.electronAPI.mergeFork(e.id,n),alert("Merge completed successfully!")}catch(V){alert(`Merge failed: ${V.message}`),console.error("Merge error:",V)}finally{x(!1)}}},N=async()=>{if(!e||n==="main")return;const k=e.forks.find(O=>O.id===n);if(window.confirm(`Are you sure you want to close "${(k==null?void 0:k.name)||n}"?
|
|
121
|
+
|
|
122
|
+
The fork will be saved and can be resumed later, but it will no longer be active.`)){C(!0);try{await window.electronAPI.closeFork(e.id,n),alert("Fork closed successfully!")}catch(O){alert(`Close failed: ${O.message}`),console.error("Close error:",O)}finally{C(!1)}}},z=async()=>{if(j!=null&&j.contextPath)try{await window.electronAPI.openExportFile(j.contextPath)}catch(k){alert(`Failed to open export file: ${k.message}`),console.error("Open export error:",k)}};if(o)return re.info("Rendering loading state..."),w.jsxs("div",{className:"loading",children:[w.jsx("div",{className:"spinner"}),w.jsx("p",{children:"Loading session..."})]});if(i)return re.error("Rendering error state:",i),w.jsxs("div",{className:"error",children:[w.jsx("p",{children:"Error loading session"}),w.jsx("p",{style:{fontSize:"12px",color:"#888"},children:i})]});if(!e)return re.warn("Rendering no-session state"),w.jsx("div",{className:"error",children:w.jsx("p",{children:"No session data available"})});re.info("Rendering main UI with session:",e.id);const H=e.forks||[],S=async()=>{await window.electronAPI.saveAndClose()},T=async()=>{await window.electronAPI.minimizeToTaskbar()};return w.jsxs("div",{className:"app",children:[w.jsxs("div",{className:"titlebar","data-tauri-drag-region":!0,children:[w.jsx("span",{className:"titlebar-text",children:"🎭 Claude-Orka"}),w.jsx(qd,{currentView:u,onViewChange:c}),w.jsxs("div",{className:"titlebar-buttons",children:[w.jsx("button",{className:"titlebar-button minimize",onClick:T,children:"Minimize"}),w.jsx("button",{className:"titlebar-button save-close",onClick:S,children:"Save & Close"})]})]}),w.jsx(zd,{session:e}),w.jsx("div",{className:"content",children:u==="timeline"?w.jsx(Xd,{session:e,selectedNode:n,onNodeClick:R}):w.jsx(Td,{session:e,selectedNode:n,onNodeClick:R})}),w.jsx(Rd,{selectedNode:n,onCreateFork:P,onExportFork:h,onMergeFork:$,onCloseFork:N,isCreatingFork:v,isExporting:b,isMerging:_,isClosing:m,canCreateFork:H.filter(k=>k.parentId===n&&k.status==="active").length===0,hasExport:n==="main"?!1:!!((F=H.find(k=>k.id===n))!=null&&F.contextPath)}),l&&w.jsx("div",{className:"modal-overlay",children:w.jsxs("div",{className:"modal",children:[w.jsx("h3",{children:"Create New Fork"}),w.jsx("input",{type:"text",value:d,onChange:k=>p(k.target.value),placeholder:"Enter fork name...",autoFocus:!0,disabled:v,onKeyPress:k=>k.key==="Enter"&&!v&&B()}),w.jsxs("div",{className:"modal-buttons",children:[w.jsx("button",{onClick:L,className:"button-secondary",disabled:v,children:"Cancel"}),w.jsx("button",{onClick:B,className:"button-primary",disabled:v,children:v?"Creating...":"Create"})]})]})}),A&&j&&w.jsx(Dd,{fork:j,onClose:()=>{D(!1),I(null)},onOpenExport:j.status==="merged"?z:void 0})]})}class Zd extends E.Component{constructor(t){super(t),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t,errorInfo:null}}componentDidCatch(t,n){console.error("[ErrorBoundary] Caught error:",t,n),this.setState({error:t,errorInfo:n})}render(){var t,n;return this.state.hasError?w.jsxs("div",{style:{padding:"20px",backgroundColor:"#1e1e2e",color:"#cdd6f4",fontFamily:"monospace",height:"100vh",overflow:"auto"},children:[w.jsx("h2",{style:{color:"#f38ba8"},children:"Something went wrong"}),w.jsxs("details",{style:{whiteSpace:"pre-wrap",marginTop:"10px"},children:[w.jsx("summary",{style:{cursor:"pointer",color:"#fab387"},children:(t=this.state.error)==null?void 0:t.toString()}),w.jsx("pre",{style:{marginTop:"10px",padding:"10px",backgroundColor:"#313244",borderRadius:"4px",fontSize:"12px",overflow:"auto"},children:(n=this.state.errorInfo)==null?void 0:n.componentStack})]}),w.jsx("button",{onClick:()=>window.location.reload(),style:{marginTop:"20px",padding:"10px 20px",backgroundColor:"#89b4fa",color:"#1e1e2e",border:"none",borderRadius:"4px",cursor:"pointer"},children:"Reload"})]}):this.props.children}}xi.createRoot(document.getElementById("root")).render(w.jsx(M.StrictMode,{children:w.jsx(Zd,{children:w.jsx(Gd,{})})}));
|
|
Binary file
|
|
@@ -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-
|
|
7
|
+
<script type="module" crossorigin src="./assets/main-vhzrm_Sy.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,66 +0,0 @@
|
|
|
1
|
-
import{r as io,g as fi,R as C,a as di,b as S,c as Te,j as A,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,b=x[1];return i(function(){p.value=g,p.getSnapshot=d,c(p)&&b({inst:p})},[f,g,d]),o(function(){return c(p)&&b({inst:p}),f(function(){c(p)&&b({inst:p})})},[f]),s(g),g}function c(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 l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return wn.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,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,l){return u===l&&(u!==0||1/u===1/l)||u!==u&&l!==l}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;return yn.useSyncExternalStoreWithSelector=function(u,l,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($){if(!w){if(w=!0,N=$,$=d($),g!==void 0&&p.hasValue){var D=p.value;if(g(D,$))return y=D}return y=$}if(D=y,r(N,$))return D;var V=d($);return g!==void 0&&g(D,V)?(N=$,D):(N=$,y=V)}var w=!1,N,y,M=f===void 0?null:f;return[function(){return m(l())},M===null?void 0:function(){return m(M())}]},[l,f,d,g]);var b=o(u,x[0],x[1]);return s(function(){p.hasValue=!0,p.value=b},[b]),c(b),b},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=(l,f)=>{const d=typeof l=="function"?l(t):l;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,c={setState:r,getState:o,getInitialState:()=>u,subscribe:l=>(n.add(l),()=>n.delete(l)),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,c);return c},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},Ci=(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 Ai={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]=Ai,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),c,u,l=0;l<s;++l)(c=i[l])&&(u=e.call(c,c.__data__,l,i))&&("__data__"in c&&(u.__data__=c.__data__),a[l]=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,c,u=0;u<a;++u)(c=s[u])&&(r.push(e.call(c,c.__data__,u,s)),o.push(c));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 Bi(e){return function(){return Vi.call(this.children,e)}}function Li(){return this.firstElementChild}function ji(e){return this.select(e==null?Li:Bi(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]=[],c,u=0;u<s;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&a.push(c);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,c=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<c;++s)(a=t[s])&&(o[s]=a)}function Ki(e,t,n,r,o,i,s){var a,c,u=new Map,l=t.length,f=i.length,d=new Array(l),g;for(a=0;a<l;++a)(c=t[a])&&(d[a]=g=s.call(c,c.__data__,a,t)+"",u.has(g)?o[a]=c:u.set(g,c));for(a=0;a<f;++a)g=s.call(e,i[a],a,i)+"",(c=u.get(g))?(r[a]=c,c.__data__=i[a],u.delete(g)):n[a]=new Qt(e,i[a]);for(a=0;a<l;++a)(c=t[a])&&u.get(d[a])===c&&(o[a]=c)}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),c=new Array(i),u=0;u<i;++u){var l=r[u],f=o[u],d=f.length,g=ea(e.call(l,l&&l.__data__,u,r)),x=g.length,p=a[u]=new Array(x),b=s[u]=new Array(x),m=c[u]=new Array(d);n(l,f,p,b,m,g,t);for(var w=0,N=0,y,M;w<x;++w)if(y=p[w]){for(w>=N&&(N=w+1);!(M=b[N])&&++N<x;);y._next=M||null}}return s=new ue(s,r),s._enter=a,s._exit=c,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),c=0;c<s;++c)for(var u=n[c],l=r[c],f=u.length,d=a[c]=new Array(f),g,x=0;x<f;++x)(g=u[x]||l[x])&&(d[x]=g);for(;c<o;++c)a[c]=n[c];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,c=o[i]=new Array(a),u,l=0;l<a;++l)(u=s[l])&&(c[l]=u);c.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 Ca(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 Aa(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?Aa: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 Ba(){this.nextSibling&&this.parentNode.appendChild(this)}function La(){return this.each(Ba)}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 c=0,u=a.length,l;c<u;++c)for(o=0,l=a[c];o<i;++o)if((s=r[o]).type===l.type&&s.name===l.name)return l.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:Ca,classed:Ia,text:Ra,html:Va,raise:La,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},At={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,At);"onselectstart"in t?n.on("selectstart.drag",lt,At):(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,At),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:c,dy:u,dispatch:l}){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:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:l}})}$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,c,u,l,f=0;function d(y){y.on("mousedown.drag",g).filter(r).on("touchstart.drag",b).on("touchmove.drag",m,uc).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(y,M){if(!(l||!e.call(this,y,M))){var $=N(this,t.call(this,y,M),y,M,"mouse");$&&(ye(y.view).on("mousemove.drag",x,At).on("mouseup.drag",p,At),bo(y.view),vn(y),u=!1,a=y.clientX,c=y.clientY,$("start",y))}}function x(y){if(lt(y),!u){var M=y.clientX-a,$=y.clientY-c;u=M*M+$*$>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 b(y,M){if(e.call(this,y,M)){var $=y.changedTouches,D=t.call(this,y,M),V=$.length,T,R;for(T=0;T<V;++T)(R=N(this,D,y,M,$[T].identifier,$[T]))&&(vn(y),R("start",y,$[T]))}}function m(y){var M=y.changedTouches,$=M.length,D,V;for(D=0;D<$;++D)(V=o[M[D].identifier])&&(lt(y),V("drag",y,M[D]))}function w(y){var M=y.changedTouches,$=M.length,D,V;for(l&&clearTimeout(l),l=setTimeout(function(){l=null},500),D=0;D<$;++D)(V=o[M[D].identifier])&&(vn(y),V("end",y,M[D]))}function N(y,M,$,D,V,T){var R=i.copy(),H=Ee(T||$,M),L,B,h;if((h=n.call(y,new $n("beforestart",{sourceEvent:$,target:d,identifier:V,active:s,x:H[0],y:H[1],dx:0,dy:0,dispatch:R}),D))!=null)return L=h.x-H[0]||0,B=h.y-H[1]||0,function k(E,z,F){var _=H,v;switch(E){case"start":o[V]=k,v=s++;break;case"end":delete o[V],--s;case"drag":H=Ee(F||z,M),v=s;break}R.call(E,y,new $n(E,{sourceEvent:z,subject:h,target:d,identifier:V,active:v,x:H[0]+L,y:H[1]+B,dx:H[0]-_[0],dy:H[1]-_[1],dispatch:R}),D)}}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?Bt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Bt(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))?Bt(t[1],t[2],t[3],t[4]):(t=vc.exec(e))?Bt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bc.exec(e))?Cr(t[1],t[2]/100,t[3]/100,1):(t=_c.exec(e))?Cr(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 Bt(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 Cr(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,c=(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/=c<.5?i+o:2-i-o,s*=60):a=c>0&&c<1?0:s,new xe(s,a,c,e.opacity)}function Cc(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,Cc,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(Ar(this.h),Lt(this.s),Lt(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("}${Ar(this.h)}, ${Lt(this.s)*100}%, ${Lt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ar(e){return e=(e||0)%360,e<0?e+360:e}function Lt(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 Ac(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?Ac(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),c=n(o.b,i.b),u=ko(o.opacity,i.opacity);return function(l){return o.r=s(l),o.g=a(l),o.b=c(l),o.opacity=u(l),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=[],c=[];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,c.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?c[0]?Tc(c[0].x):Ic(t):(t=c.length,function(u){for(var l=0,f;l<t;++l)a[(f=c[l]).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 Co(e,t,n,r,o,i){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*$r,skewX:Math.atan(c)*$r,scaleX:s,scaleY:a}}var jt;function Pc(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?zn:Co(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,Co(e.a,e.b,e.c,e.d,e.e,e.f))}function Ao(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,l,f,d,g,x){if(u!==f||l!==d){var p=g.push("translate(",null,t,null,n);x.push({i:p-4,x:Pe(u,f)},{i:p-2,x:Pe(l,d)})}else(f||d)&&g.push("translate("+f+t+d+n)}function s(u,l,f,d){u!==l?(u-l>180?l+=360:l-u>180&&(u+=360),d.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Pe(u,l)})):l&&f.push(o(f)+"rotate("+l+r)}function a(u,l,f,d){u!==l?d.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Pe(u,l)}):l&&f.push(o(f)+"skewX("+l+r)}function c(u,l,f,d,g,x){if(u!==f||l!==d){var p=g.push(o(g)+"scale(",null,",",null,")");x.push({i:p-4,x:Pe(u,f)},{i:p-2,x:Pe(l,d)})}else(f!==1||d!==1)&&g.push(o(g)+"scale("+f+","+d+")")}return function(u,l){var f=[],d=[];return u=e(u),l=e(l),i(u.translateX,u.translateY,l.translateX,l.translateY,f,d),s(u.rotate,l.rotate,f,d),a(u.skewX,l.skewX,f,d),c(u.scaleX,u.scaleY,l.scaleX,l.scaleY,f,d),u=l=null,function(g){for(var x=-1,p=d.length,b;++x<p;)f[(b=d[x]).i]=b.x(g);return f.join("")}}}var Dc=Ao(Pc,"px, ","px)","deg)"),Hc=Ao(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 Bc(e){return((e=Math.exp(2*e))-1)/(e+1)}const Lc=(function e(t,n,r){function o(i,s){var a=i[0],c=i[1],u=i[2],l=s[0],f=s[1],d=s[2],g=l-a,x=f-c,p=g*g+x*x,b,m;if(p<Fc)m=Math.log(d/u)/t,b=function(D){return[a+D*g,c+D*x,u*Math.exp(t*D*m)]};else{var w=Math.sqrt(p),N=(d*d-u*u+r*p)/(2*u*n*w),y=(d*d-u*u-r*p)/(2*d*n*w),M=Math.log(Math.sqrt(N*N+1)-N),$=Math.log(Math.sqrt(y*y+1)-y);m=($-M)/t,b=function(D){var V=D*m,T=Ir(M),R=u/(n*w)*(T*Bc(t*V+M)-Vc(M));return[a+R*g,c+R*x,u*T/Ir(t*V+M)]}}return b.duration=m*1e3*t/Math.SQRT2,b}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return e(s,a,c)},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 l,f,d,g;if(n.state!==Pr)return c();for(l in r)if(g=r[l],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[l]):+l<t&&(g.state=Zt,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[l])}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),l=0,f=-1;l<d;++l)(g=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=g);o.length=f+1}}function a(u){for(var l=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=Dn,1),f=-1,d=o.length;++f<d;)o[f].call(e,l);n.state===Dn&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){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},c=0,u=o.length;c<u;++c)if(o[c].name===t){o[c]=a;break}c===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),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a)))}}function ol(e,t,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===r&&c===o?i:(o=c,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]=[],c,u=0;u<s;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&a.push(c);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 c=t[a],u=n[a],l=c.length,f=s[a]=new Array(l),d,g=0;g<l;++g)(d=c[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 Cl(){return this.on("end.remove",kl(this._id))}function Al(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],c=a.length,u=i[s]=new Array(c),l,f,d=0;d<c;++d)(l=a[d])&&(f=e.call(l,l.__data__,d,a))&&("__data__"in l&&(f.__data__=l.__data__),u[d]=f,un(u[d],t,n,d,u,ve(l,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 c=r[a],u=c.length,l,f=0;f<u;++f)if(l=c[f]){for(var d=e.call(l,l.__data__,f,c),g,x=ve(l,n),p=0,b=d.length;p<b;++p)(g=d[p])&&un(g,t,n,p,d,x);i.push(d),s.push(l)}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),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),ht(this,e))),s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a))}}function Rl(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var c=Ne(this,e),u=c.on,l=c.value[i]==null?a||(a=Po(t)):void 0;(u!==n||o!==l)&&(r=(n=u).copy()).on(s,o=l),c.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 Bl(e){return function(){this.textContent=e}}function Ll(e){return function(){var t=e(this);this.textContent=t??""}}function jl(e){return this.tween("text",typeof e=="function"?Ll(Zn(this,"text",e)):Bl(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,c,u=0;u<a;++u)if(c=s[u]){var l=ve(c,t);un(c,e,n,u,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.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},c={value:function(){--o===0&&i()}};n.each(function(){var u=Ne(this,r),l=u.on;l!==e&&(t=(e=l).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),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 Ae=Dt.prototype;$e.prototype={constructor:$e,select:Al,selectAll:Ml,selectChild:Ae.selectChild,selectChildren:Ae.selectChildren,filter:bl,merge:_l,selection:Il,transition:Ul,call:Ae.call,nodes:Ae.nodes,node:Ae.node,size:Ae.size,empty:Ae.empty,each:Ae.each,on:Nl,attr:sl,attrTween:ul,style:Dl,styleTween:Vl,text:jl,textTween:Yl,remove:Cl,tween:Qc,delay:hl,duration:ml,ease:xl,easeVarying:vl,end:ql,[Symbol.iterator]:Ae[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,c,u=0;u<a;++u)(c=s[u])&&un(c,e,t,u,s,n||Kl(c,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,c=Lc,u=an("start","zoom","end"),l,f,d,g=500,x=150,p=0,b=10;function m(h){h.property("__zoom",Dr).on("wheel.zoom",V,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",R).filter(o).on("touchstart.zoom",H).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(h,k,E,z){var F=h.selection?h.selection():h;F.property("__zoom",Dr),h!==F?M(h,k,E,z):F.interrupt().each(function(){$(this,arguments).event(z).start().zoom(null,typeof k=="function"?k.apply(this,arguments):k).end()})},m.scaleBy=function(h,k,E,z){m.scaleTo(h,function(){var F=this.__zoom.k,_=typeof k=="function"?k.apply(this,arguments):k;return F*_},E,z)},m.scaleTo=function(h,k,E,z){m.transform(h,function(){var F=t.apply(this,arguments),_=this.__zoom,v=E==null?y(F):typeof E=="function"?E.apply(this,arguments):E,I=_.invert(v),P=typeof k=="function"?k.apply(this,arguments):k;return n(N(w(_,P),v,I),F,s)},E,z)},m.translateBy=function(h,k,E,z){m.transform(h,function(){return n(this.__zoom.translate(typeof k=="function"?k.apply(this,arguments):k,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),s)},null,z)},m.translateTo=function(h,k,E,z,F){m.transform(h,function(){var _=t.apply(this,arguments),v=this.__zoom,I=z==null?y(_):typeof z=="function"?z.apply(this,arguments):z;return n(He.translate(I[0],I[1]).scale(v.k).translate(typeof k=="function"?-k.apply(this,arguments):-k,typeof E=="function"?-E.apply(this,arguments):-E),_,s)},z,F)};function w(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 N(h,k,E){var z=k[0]-E[0]*h.k,F=k[1]-E[1]*h.k;return z===h.x&&F===h.y?h:new Me(h.k,z,F)}function y(h){return[(+h[0][0]+ +h[1][0])/2,(+h[0][1]+ +h[1][1])/2]}function M(h,k,E,z){h.on("start.zoom",function(){$(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){$(this,arguments).event(z).end()}).tween("zoom",function(){var F=this,_=arguments,v=$(F,_).event(z),I=t.apply(F,_),P=E==null?y(I):typeof E=="function"?E.apply(F,_):E,j=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),O=F.__zoom,U=typeof k=="function"?k.apply(F,_):k,W=c(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 $(h,k,E){return!E&&h.__zooming||new D(h,k)}function D(h,k){this.that=h,this.args=k,this.active=0,this.sourceEvent=null,this.extent=t.apply(h,k),this.taps=0}D.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 V(h,...k){if(!e.apply(this,arguments))return;var E=$(this,k).event(h),z=this.__zoom,F=Math.max(i[0],Math.min(i[1],z.k*Math.pow(2,r.apply(this,arguments)))),_=Ee(h);if(E.wheel)(E.mouse[0][0]!==_[0]||E.mouse[0][1]!==_[1])&&(E.mouse[1]=z.invert(E.mouse[0]=_)),clearTimeout(E.wheel);else{if(z.k===F)return;E.mouse=[_,z.invert(_)],Kt(this),E.start()}bt(h),E.wheel=setTimeout(v,x),E.zoom("mouse",n(N(w(z,F),E.mouse[0],E.mouse[1]),E.extent,s));function v(){E.wheel=null,E.end()}}function T(h,...k){if(d||!e.apply(this,arguments))return;var E=h.currentTarget,z=$(this,k,!0).event(h),F=ye(h.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",j,!0),_=Ee(h,E),v=h.clientX,I=h.clientY;bo(h.view),En(h),z.mouse=[_,this.__zoom.invert(_)],Kt(this),z.start();function P(O){if(bt(O),!z.moved){var U=O.clientX-v,W=O.clientY-I;z.moved=U*U+W*W>p}z.event(O).zoom("mouse",n(N(z.that.__zoom,z.mouse[0]=Ee(O,E),z.mouse[1]),z.extent,s))}function j(O){F.on("mousemove.zoom mouseup.zoom",null),_o(O.view,z.moved),bt(O),z.event(O).end()}}function R(h,...k){if(e.apply(this,arguments)){var E=this.__zoom,z=Ee(h.changedTouches?h.changedTouches[0]:h,this),F=E.invert(z),_=E.k*(h.shiftKey?.5:2),v=n(N(w(E,_),z,F),t.apply(this,k),s);bt(h),a>0?ye(this).transition().duration(a).call(M,v,z,h):ye(this).call(m.transform,v,z,h)}}function H(h,...k){if(e.apply(this,arguments)){var E=h.touches,z=E.length,F=$(this,k,h.changedTouches.length===z).event(h),_,v,I,P;for(En(h),v=0;v<z;++v)I=E[v],P=Ee(I,this),P=[P,this.__zoom.invert(P),I.identifier],F.touch0?!F.touch1&&F.touch0[2]!==P[2]&&(F.touch1=P,F.taps=0):(F.touch0=P,_=!0,F.taps=1+!!l);l&&(l=clearTimeout(l)),_&&(F.taps<2&&(f=P[0],l=setTimeout(function(){l=null},g)),Kt(this),F.start())}}function L(h,...k){if(this.__zooming){var E=$(this,k).event(h),z=h.changedTouches,F=z.length,_,v,I,P;for(bt(h),_=0;_<F;++_)v=z[_],I=Ee(v,this),E.touch0&&E.touch0[2]===v.identifier?E.touch0[0]=I:E.touch1&&E.touch1[2]===v.identifier&&(E.touch1[0]=I);if(v=E.that.__zoom,E.touch1){var j=E.touch0[0],O=E.touch0[1],U=E.touch1[0],W=E.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=w(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(E.touch0)I=E.touch0[0],P=E.touch0[1];else return;E.zoom("touch",n(N(v,I,P),E.extent,s))}}function B(h,...k){if(this.__zooming){var E=$(this,k).event(h),z=h.changedTouches,F=z.length,_,v;for(En(h),d&&clearTimeout(d),d=setTimeout(function(){d=null},g),_=0;_<F;++_)v=z[_],E.touch0&&E.touch0[2]===v.identifier?delete E.touch0:E.touch1&&E.touch1[2]===v.identifier&&delete E.touch1;if(E.touch1&&!E.touch0&&(E.touch0=E.touch1,delete E.touch1),E.touch0)E.touch0[1]=this.__zoom.invert(E.touch0[0]);else if(E.end(),E.taps===2&&(v=Ee(v,this),Math.hypot(f[0]-v[0],f[1]-v[1])<b)){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?(c=h,m):c},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?(b=+h,m):b},m}di();const fn=S.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=S.useContext(fn);if(n===null)throw new Error(Do);return ao(n,e,t)}const oe=()=>{const e=S.useContext(fn);if(e===null)throw new Error(Do);return S.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:c,className:u,...l})=>{const f=S.useRef(null),[d,g]=S.useState({x:0,y:0,width:0,height:0}),x=ae(["react-flow__edge-textwrapper",u]);return S.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",...l},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),c)};var uu=S.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"),Bo=["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 Lo=e=>"clientX"in e,Fe=(e,t)=>{var i,s;const n=Lo(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:c,labelBgBorderRadius:u,style:l,markerEnd:f,markerStart:d,interactionWidth:g=20})=>C.createElement(C.Fragment,null,C.createElement("path",{id:e,style:l,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:c,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 c=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+r*.125,l=Math.abs(c-e),f=Math.abs(u-t);return[c,u,l,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}),[c,u]=Vr({pos:i,x1:r,y1:o,x2:e,y2:t}),[l,f,d,g]=Oo({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${a} ${c},${u} ${r},${o}`,l,f,d,g]}const er=S.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=X.Bottom,targetPosition:i=X.Top,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:g,markerStart:x,interactionWidth:p})=>{const[b,m,w]=Xo({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return C.createElement(Ft,{path:b,labelX:m,labelY:w,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:g,markerStart:x,interactionWidth:p})});er.displayName="SimpleBezierEdge";const Br={[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},Lr=(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=Br[t],a=Br[r],c={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},l=mu({source:c,sourcePosition:t,target:u}),f=l.x!==0?"x":"y",d=l[f];let g=[],x,p;const b={x:0,y:0},m={x:0,y:0},[w,N,y,M]=jo({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*a[f]===-1){x=o.x??w,p=o.y??N;const D=[{x,y:c.y},{x,y:u.y}],V=[{x:c.x,y:p},{x:u.x,y:p}];s[f]===d?g=f==="x"?D:V:g=f==="x"?V:D}else{const D=[{x:c.x,y:u.y}],V=[{x:u.x,y:c.y}];if(f==="x"?g=s.x===d?V:D:g=s.y===d?D:V,t===r){const B=Math.abs(e[f]-n[f]);if(B<=i){const h=Math.min(i-1,i-B);s[f]===d?b[f]=(c[f]>e[f]?-1:1)*h:m[f]=(u[f]>n[f]?-1:1)*h}}if(t!==r){const B=f==="x"?"y":"x",h=s[f]===a[B],k=c[B]>u[B],E=c[B]<u[B];(s[f]===1&&(!h&&k||h&&E)||s[f]!==1&&(!h&&E||h&&k))&&(g=f==="x"?D:V)}const T={x:c.x+b.x,y:c.y+b.y},R={x:u.x+m.x,y:u.y+m.y},H=Math.max(Math.abs(T.x-g[0].x),Math.abs(R.x-g[0].x)),L=Math.max(Math.abs(T.y-g[0].y),Math.abs(R.y-g[0].y));H>=L?(x=(T.x+R.x)/2,p=g[0].y):(x=g[0].x,p=(T.y+R.y)/2)}return[[e,{x:c.x+b.x,y:c.y+b.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(Lr(e,t)/2,Lr(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,l=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*l}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${s+o*c}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:c,offset:u=20}){const[l,f,d,g,x]=yu({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:c},offset:u});return[l.reduce((b,m,w)=>{let N="";return w>0&&w<l.length-1?N=xu(l[w-1],m,l[w+1],s):N=`${w===0?"M":"L"}${m.x} ${m.y}`,b+=N,b},""),f,d,g,x]}const dn=S.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,style:l,sourcePosition:f=X.Bottom,targetPosition:d=X.Top,markerEnd:g,markerStart:x,pathOptions:p,interactionWidth:b})=>{const[m,w,N]=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:w,labelY:N,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,style:l,markerEnd:g,markerStart:x,interactionWidth:b})});dn.displayName="SmoothStepEdge";const tr=S.memo(e=>{var t;return C.createElement(dn,{...e,pathOptions:S.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=S.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,style:l,markerEnd:f,markerStart:d,interactionWidth:g})=>{const[x,p,b]=wu({sourceX:e,sourceY:t,targetX:n,targetY:r});return C.createElement(Ft,{path:x,labelX:p,labelY:b,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,style:l,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,c]=jr({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,l]=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:c,targetControlX:u,targetControlY:l});return[`M${e},${t} C${a},${c} ${u},${l} ${r},${o}`,f,d,g,x]}const sn=S.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=X.Bottom,targetPosition:i=X.Top,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:g,markerStart:x,pathOptions:p,interactionWidth:b})=>{const[m,w,N]=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:w,labelY:N,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:g,markerStart:x,interactionWidth:b})});sn.displayName="BezierEdge";const rr=S.createContext(null),vu=rr.Provider;rr.Consumer;const bu=()=>S.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||""}`,Bn=(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)},Ln=({x:e,y:t},[n,r,o],i,[s,a])=>{const c={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(c.x/s),y:a*Math.round(c.y/a)}:c},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 c={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(l=>{const{width:f,height:d,selectable:g=!0,hidden:x=!1}=l;if(s&&!g||x)return!1;const{positionAbsolute:p}=ft(l,a),b={x:p.x,y:p.y,width:f||0,height:d||0},m=Hn(c,b),w=typeof f>"u"||typeof d>"u"||f===null||d===null,N=i&&m>0,y=(f||0)*(d||0);(w||N||m>=y||l.dragging)&&u.push(l)}),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)),c=Math.min(s,a),u=pt(c,r,o),l=e.x+e.width/2,f=e.y+e.height/2,d=t/2-l*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),b=u.getAttribute("data-handleid"),m=i({nodeId:x,id:b,type:p});if(m){const w=o.find(N=>N.nodeId===x&&N.type===p&&N.id===b);return{handle:{id:b,type:p,nodeId:x,x:(w==null?void 0:w.x)||n.x,y:(w==null?void 0:w.y)||n.y},validHandleResult:m}}}}let l=[],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 b=i(x);p<=f&&(p<f?l=[{handle:x,validHandleResult:b}]:p===f&&l.push({handle:x,validHandleResult:b}),f=p)}}),!l.length)return{handle:null,validHandleResult:Zo()};if(l.length===1)return l[0];const d=l.some(({validHandleResult:x})=>x.isValid),g=l.some(({handle:x})=>x.type==="target");return l.find(({handle:x,validHandleResult:p})=>g?x.type==="target":d?p.isValid:!0)||l[0]}const Cu={source:null,target:null,sourceHandle:null,targetHandle:null},Zo=()=>({handleDomNode:null,isValid:!1,connection:Cu,endHandle:null});function Ko(e,t,n,r,o,i,s){const a=o==="target",c=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:c};if(c){const l=sr(void 0,c),f=c.getAttribute("data-nodeid"),d=c.getAttribute("data-handleid"),g=c.classList.contains("connectable"),x=c.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&&l==="source"||!a&&l==="target":f!==n||d!==r)&&(u.endHandle={nodeId:f,handleId:d,type:l},u.isValid=i(p))}return u}function Au({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[te]){const{handleBounds:s}=i[te];let a=[],c=[];s&&(a=Or(i,s,"source",`${t}-${n}-${r}`),c=Or(i,s,"target",`${t}-${n}-${r}`)),o.push(...a,...c)}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:c,onReconnectEnd:u}){const l=Vo(e.target),{connectionMode:f,domNode:d,autoPanOnConnect:g,connectionRadius:x,onConnectStart:p,panBy:b,getNodes:m,cancelConnection:w}=i();let N=0,y;const{x:M,y:$}=Fe(e),D=l==null?void 0:l.elementFromPoint(M,$),V=sr(c,D),T=d==null?void 0:d.getBoundingClientRect();if(!T||!V)return;let R,H=Fe(e,T),L=!1,B=null,h=!1,k=null;const E=Au({nodes:m(),nodeId:n,handleId:t,handleType:V}),z=()=>{if(!g)return;const[v,I]=Fo(H,T);b({x:v,y:I}),N=requestAnimationFrame(z)};s({connectionPosition:H,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:V,connectionStartHandle:{nodeId:n,handleId:t,type:V},connectionEndHandle:null}),p==null||p(e,{nodeId:n,handleId:t,handleType:V});function F(v){const{transform:I}=i();H=Fe(v,T);const{handle:P,validHandleResult:j}=ku(v,l,Ln(H,I,!1,[1,1]),x,E,O=>Ko(O,f,n,t,o?"target":"source",a,l));if(y=P,L||(z(),L=!0),k=j.handleDomNode,B=j.connection,h=j.isValid,s({connectionPosition:y&&h?Uo({x:y.x,y:y.y},I):H,connectionStatus:Mu(!!y,h),connectionEndHandle:j.endHandle}),!y&&!h&&!k)return Sn(R);B.source!==B.target&&k&&(Sn(R),R=k,k.classList.add("connecting","react-flow__handle-connecting"),k.classList.toggle("valid",h),k.classList.toggle("react-flow__handle-valid",h))}function _(v){var I,P;(y||k)&&B&&h&&(r==null||r(B)),(P=(I=i()).onConnectEnd)==null||P.call(I,v),c&&(u==null||u(v)),Sn(R),w(),cancelAnimationFrame(N),L=!1,h=!1,B=null,k=null,l.removeEventListener("mousemove",F),l.removeEventListener("mouseup",_),l.removeEventListener("touchmove",F),l.removeEventListener("touchend",_)}l.addEventListener("mousemove",F),l.addEventListener("mouseup",_),l.addEventListener("touchmove",F),l.addEventListener("touchend",_)}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=S.forwardRef(({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:c,className:u,onMouseDown:l,onTouchStart:f,...d},g)=>{var T,R;const x=s||null,p=e==="target",b=oe(),m=bu(),{connectOnClick:w,noPanClassName:N}=J($u,ie),{connecting:y,clickConnecting:M}=J(Iu(m,x,e),ie);m||(R=(T=b.getState()).onError)==null||R.call(T,"010",Ie.error010());const $=H=>{const{defaultEdgeOptions:L,onConnect:B,hasDefaultEdges:h}=b.getState(),k={...L,...H};if(h){const{edges:E,setEdges:z}=b.getState();z(Nu(k,E))}B==null||B(k),a==null||a(k)},D=H=>{if(!m)return;const L=Lo(H);o&&(L&&H.button===0||!L)&&Qo({event:H,handleId:x,nodeId:m,onConnect:$,isTarget:p,getState:b.getState,setState:b.setState,isValidConnection:n||b.getState().isValidConnection||Xr}),L?l==null||l(H):f==null||f(H)},V=H=>{const{onClickConnectStart:L,onClickConnectEnd:B,connectionClickStartHandle:h,connectionMode:k,isValidConnection:E}=b.getState();if(!m||!h&&!o)return;if(!h){L==null||L(H,{nodeId:m,handleId:x,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:m,type:e,handleId:x}});return}const z=Vo(H.target),F=n||E||Xr,{connection:_,isValid:v}=Ko({nodeId:m,id:x,type:e},k,h.nodeId,h.handleId||null,h.type,F,z);v&&$(_),B==null||B(H),b.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",N,u,{source:!p,target:p,connectable:r,connectablestart:o,connectableend:i,connecting:M,connectionindicator:r&&(o&&!y||i&&y)}]),onMouseDown:D,onTouchStart:D,onClick:w?V:void 0,ref:g,...d},c)});Jo.displayName="Handle";var Ve=S.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=S.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=S.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=S.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=S.memo(({onSelectionChange:e})=>{const t=oe(),{selectedNodes:n,selectedEdges:r}=J(Tu,zu);return S.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){S.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function q(e,t,n){S.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:c,nodesDraggable:u,nodesConnectable:l,nodesFocusable:f,edgesFocusable:d,edgesUpdatable:g,elevateNodesOnSelect:x,minZoom:p,maxZoom:b,nodeExtent:m,onNodesChange:w,onEdgesChange:N,elementsSelectable:y,connectionMode:M,snapGrid:$,snapToGrid:D,translateExtent:V,connectOnClick:T,defaultEdgeOptions:R,fitView:H,fitViewOptions:L,onNodesDelete:B,onEdgesDelete:h,onNodeDrag:k,onNodeDragStart:E,onNodeDragStop:z,onSelectionDrag:F,onSelectionDragStart:_,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=oe();return S.useEffect(()=>{const le=r==null?void 0:r.map(Be=>({...Be,...R}));return fe(n,le),()=>{Q()}},[]),q("defaultEdgeOptions",R,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",c,Y.setState),q("nodesDraggable",u,Y.setState),q("nodesConnectable",l,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",D,Y.setState),q("snapGrid",$,Y.setState),q("onNodesChange",w,Y.setState),q("onEdgesChange",N,Y.setState),q("connectOnClick",T,Y.setState),q("fitViewOnInit",H,Y.setState),q("fitViewOnInitOptions",L,Y.setState),q("onNodesDelete",B,Y.setState),q("onEdgesDelete",h,Y.setState),q("onNodeDrag",k,Y.setState),q("onNodeDragStart",E,Y.setState),q("onNodeDragStop",z,Y.setState),q("onSelectionDrag",F,Y.setState),q("onSelectionDragStart",_,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(b,de),ot(V,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",Bu=e=>e.ariaLiveMessage;function Lu({rfId:e}){const t=J(Bu);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(Lu,{rfId:e}))}var Rt=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=S.useState(!1),o=S.useRef(!1),i=S.useRef(new Set([])),[s,a]=S.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),l=u.reduce((f,d)=>f.concat(...d),[]);return[u,l]}return[[],[]]},[e]);return S.useEffect(()=>{const c=typeof document<"u"?document:null,u=(t==null?void 0:t.target)||c;if(e!==null){const l=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",l),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",d),()=>{u==null||u.removeEventListener("keydown",l),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,c;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)?((c=i[te])==null?void 0:c.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:c}=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=c,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 c=(he(a.zIndex)?a.zIndex:0)+(a.selected?s:0),u=t.get(a.id),l={...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(l,te,{enumerable:!1,value:{handleBounds:d||(g=u==null?void 0:u[te])==null?void 0:g.handleBounds,z:c}}),o.set(a.id,l)}),ls(o,n,i),o}function us(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:c,fitViewOnInitDone:u,fitViewOnInit:l,nodeOrigin:f}=e(),d=t.initial&&!u&&l;if(a&&c&&(d||!t.initial)){const x=n().filter(b=>{var w;const m=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return(w=t.nodes)!=null&&w.length?m&&t.nodes.some(N=>N.id===b.id):m}),p=x.every(b=>b.width&&b.height);if(x.length>0&&p){const b=or(x,f),{x:m,y:w,zoom:N}=Go(b,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),y=He.translate(m,w).scale(N);return typeof t.duration=="number"&&t.duration>0?a.transform(qe(c,t.duration),y):a.transform(c,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:c,hasDefaultEdges:u}=n();e!=null&&e.length&&(c&&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=oe(),{d3Zoom:t,d3Selection:n}=J(Uu,ie);return S.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,c]=e.getState().transform,u=He.translate(o.x??s,o.y??a).scale(o.zoom??c);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:c,maxZoom:u}=e.getState(),l=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,f=a/2-o*l,d=c/2-i*l,g=He.translate(f,d).scale(l);t.transform(qe(n,s==null?void 0:s.duration),g)},fitBounds:(o,i)=>{const{width:s,height:a,minZoom:c,maxZoom:u}=e.getState(),{x:l,y:f,zoom:d}=Go(o,s,a,c,u,(i==null?void 0:i.padding)??.1),g=He.translate(l,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"),Ln(o,i,s,a)},screenToFlowPosition:o=>{const{transform:i,snapToGrid:s,snapGrid:a,domNode:c}=e.getState();if(!c)return o;const{x:u,y:l}=c.getBoundingClientRect(),f={x:o.x-u,y:o.y-l};return Ln(f,i,s,a)},flowToScreenPosition:o=>{const{transform:i,domNode:s}=e.getState();if(!s)return o;const{x:a,y:c}=s.getBoundingClientRect(),u=Uo(o,i);return{x:u.x+a,y:u.y+c}},viewportInitialized:!0}:Yu,[t,n])};function ar(){const e=qu(),t=oe(),n=S.useCallback(()=>t.getState().getNodes().map(p=>({...p})),[]),r=S.useCallback(p=>t.getState().nodeInternals.get(p),[]),o=S.useCallback(()=>{const{edges:p=[]}=t.getState();return p.map(b=>({...b}))},[]),i=S.useCallback(p=>{const{edges:b=[]}=t.getState();return b.find(m=>m.id===p)},[]),s=S.useCallback(p=>{const{getNodes:b,setNodes:m,hasDefaultNodes:w,onNodesChange:N}=t.getState(),y=b(),M=typeof p=="function"?p(y):p;if(w)m(M);else if(N){const $=M.length===0?y.map(D=>({type:"remove",id:D.id})):M.map(D=>({item:D,type:"reset"}));N($)}},[]),a=S.useCallback(p=>{const{edges:b=[],setEdges:m,hasDefaultEdges:w,onEdgesChange:N}=t.getState(),y=typeof p=="function"?p(b):p;if(w)m(y);else if(N){const M=y.length===0?b.map($=>({type:"remove",id:$.id})):y.map($=>({item:$,type:"reset"}));N(M)}},[]),c=S.useCallback(p=>{const b=Array.isArray(p)?p:[p],{getNodes:m,setNodes:w,hasDefaultNodes:N,onNodesChange:y}=t.getState();if(N){const $=[...m(),...b];w($)}else if(y){const M=b.map($=>({item:$,type:"add"}));y(M)}},[]),u=S.useCallback(p=>{const b=Array.isArray(p)?p:[p],{edges:m=[],setEdges:w,hasDefaultEdges:N,onEdgesChange:y}=t.getState();if(N)w([...m,...b]);else if(y){const M=b.map($=>({item:$,type:"add"}));y(M)}},[]),l=S.useCallback(()=>{const{getNodes:p,edges:b=[],transform:m}=t.getState(),[w,N,y]=m;return{nodes:p().map(M=>({...M})),edges:b.map(M=>({...M})),viewport:{x:w,y:N,zoom:y}}},[]),f=S.useCallback(({nodes:p,edges:b})=>{const{nodeInternals:m,getNodes:w,edges:N,hasDefaultNodes:y,hasDefaultEdges:M,onNodesDelete:$,onEdgesDelete:D,onNodesChange:V,onEdgesChange:T}=t.getState(),R=(p||[]).map(k=>k.id),H=(b||[]).map(k=>k.id),L=w().reduce((k,E)=>{const z=E.parentNode||E.parentId,F=!R.includes(E.id)&&z&&k.find(v=>v.id===z);return(typeof E.deletable=="boolean"?E.deletable:!0)&&(R.includes(E.id)||F)&&k.push(E),k},[]),B=N.filter(k=>typeof k.deletable=="boolean"?k.deletable:!0),h=B.filter(k=>H.includes(k.id));if(L||h){const k=Wo(L,B),E=[...h,...k],z=E.reduce((F,_)=>(F.includes(_.id)||F.push(_.id),F),[]);if((M||y)&&(M&&t.setState({edges:N.filter(F=>!z.includes(F.id))}),y&&(L.forEach(F=>{m.delete(F.id)}),t.setState({nodeInternals:new Map(m)}))),z.length>0&&(D==null||D(E),T&&T(z.map(F=>({id:F,type:"remove"})))),L.length>0&&($==null||$(L),V)){const F=L.map(_=>({id:_.id,type:"remove"}));V(F)}}},[]),d=S.useCallback(p=>{const b=hu(p),m=b?null:t.getState().nodeInternals.get(p.id);return!b&&!m?[null,null,b]:[b?p:Fr(m),m,b]},[]),g=S.useCallback((p,b=!0,m)=>{const[w,N,y]=d(p);return w?(m||t.getState().getNodes()).filter(M=>{if(!y&&(M.id===N.id||!M.positionAbsolute))return!1;const $=Fr(M),D=Hn($,w);return b&&D>0||D>=w.width*w.height}):[]},[]),x=S.useCallback((p,b,m=!0)=>{const[w]=d(p);if(!w)return!1;const N=Hn(w,b);return m&&N>0||N>=w.width*w.height},[]);return S.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:a,addNodes:c,addEdges:u,toObject:l,deleteElements:f,getIntersectingNodes:g,isNodeIntersecting:x}),[e,n,r,o,i,s,a,c,u,l,f,g,x])}const Wu={actInsideInputWithModifier:!1};var Gu=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=oe(),{deleteElements:r}=ar(),o=Rt(e,Wu),i=Rt(t);S.useEffect(()=>{if(o){const{edges:s,getNodes:a}=n.getState(),c=a().filter(l=>l.selected),u=s.filter(l=>l.selected);r({nodes:c,edges:u}),n.setState({nodesSelectionActive:!1})}},[o]),S.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function Zu(e){const t=oe();S.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:c=Ge.Free,zoomOnDoubleClick:u=!0,elementsSelectable:l,panOnDrag:f=!0,defaultViewport:d,translateExtent:g,minZoom:x,maxZoom:p,zoomActivationKeyCode:b,preventScrolling:m=!0,children:w,noWheelClassName:N,noPanClassName:y})=>{const M=S.useRef(),$=oe(),D=S.useRef(!1),V=S.useRef(!1),T=S.useRef(null),R=S.useRef({x:0,y:0,zoom:0}),{d3Zoom:H,d3Selection:L,d3ZoomHandler:B,userSelectionActive:h}=J(Qu,ie),k=Rt(b),E=S.useRef(0),z=S.useRef(!1),F=S.useRef();return Zu(T),S.useEffect(()=>{if(T.current){const _=T.current.getBoundingClientRect(),v=su().scaleExtent([x,p]).translateExtent(g),I=ye(T.current).call(v),P=He.translate(d.x,d.y).scale(pt(d.zoom,x,p)),j=[[0,0],[_.width,_.height]],O=v.constrain()(P,j,g);v.transform(I,O),v.wheelDelta(Gr),$.setState({d3Zoom:v,d3Selection:I,d3ZoomHandler:I.on("wheel.zoom"),transform:[O.x,O.y,O.k],domNode:T.current.closest(".react-flow")})}},[]),S.useEffect(()=>{L&&H&&(s&&!k&&!h?L.on("wheel.zoom",_=>{if(it(_,N))return!1;_.preventDefault(),_.stopImmediatePropagation();const v=L.property("__zoom").k||1;if(_.ctrlKey&&i){const Z=Ee(_),ee=Gr(_),K=v*Math.pow(2,ee);H.scaleTo(L,K,Z,_);return}const I=_.deltaMode===1?20:1;let P=c===Ge.Vertical?0:_.deltaX*I,j=c===Ge.Horizontal?0:_.deltaY*I;!on()&&_.shiftKey&&c!==Ge.Vertical&&(P=_.deltaY*I,j=0),H.translateBy(L,-(P/v)*a,-(j/v)*a,{internal:!0});const O=qt(L.property("__zoom")),{onViewportChangeStart:U,onViewportChange:W,onViewportChangeEnd:G}=$.getState();clearTimeout(F.current),z.current||(z.current=!0,t==null||t(_,O),U==null||U(O)),z.current&&(e==null||e(_,O),W==null||W(O),F.current=setTimeout(()=>{n==null||n(_,O),G==null||G(O),z.current=!1},150))},{passive:!1}):typeof B<"u"&&L.on("wheel.zoom",function(_,v){if(!m&&_.type==="wheel"&&!_.ctrlKey||it(_,N))return null;_.preventDefault(),B.call(this,_,v)},{passive:!1}))},[h,s,c,L,H,B,k,i,m,N,t,e,n]),S.useEffect(()=>{H&&H.on("start",_=>{var P,j;if(!_.sourceEvent||_.sourceEvent.internal)return null;E.current=(P=_.sourceEvent)==null?void 0:P.button;const{onViewportChangeStart:v}=$.getState(),I=qt(_.transform);D.current=!0,R.current=I,((j=_.sourceEvent)==null?void 0:j.type)==="mousedown"&&$.setState({paneDragging:!0}),v==null||v(I),t==null||t(_.sourceEvent,I)})},[H,t]),S.useEffect(()=>{H&&(h&&!D.current?H.on("zoom",null):h||H.on("zoom",_=>{var I;const{onViewportChange:v}=$.getState();if($.setState({transform:[_.transform.x,_.transform.y,_.transform.k]}),V.current=!!(r&&Wr(f,E.current??0)),(e||v)&&!((I=_.sourceEvent)!=null&&I.internal)){const P=qt(_.transform);v==null||v(P),e==null||e(_.sourceEvent,P)}}))},[h,H,e,f,r]),S.useEffect(()=>{H&&H.on("end",_=>{if(!_.sourceEvent||_.sourceEvent.internal)return null;const{onViewportChangeEnd:v}=$.getState();if(D.current=!1,$.setState({paneDragging:!1}),r&&Wr(f,E.current??0)&&!V.current&&r(_.sourceEvent),V.current=!1,(n||v)&&Ku(R.current,_.transform)){const I=qt(_.transform);R.current=I,clearTimeout(M.current),M.current=setTimeout(()=>{v==null||v(I),n==null||n(_.sourceEvent,I)},s?150:0)}})},[H,s,f,n,r]),S.useEffect(()=>{H&&H.filter(_=>{const v=k||o,I=i&&_.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&_.button===1&&_.type==="mousedown"&&(it(_,"react-flow__node")||it(_,"react-flow__edge")))return!0;if(!f&&!v&&!s&&!u&&!i||h||!u&&_.type==="dblclick"||it(_,N)&&_.type==="wheel"||it(_,y)&&(_.type!=="wheel"||s&&_.type==="wheel"&&!k)||!i&&_.ctrlKey&&_.type==="wheel"||!v&&!s&&!I&&_.type==="wheel"||!f&&(_.type==="mousedown"||_.type==="touchstart")||Array.isArray(f)&&!f.includes(_.button)&&_.type==="mousedown")return!1;const P=Array.isArray(f)&&f.includes(_.button)||!_.button||_.button<=1;return(!_.ctrlKey||_.type==="wheel")&&P})},[h,H,o,i,s,u,f,l,k]),C.createElement("div",{className:"react-flow__renderer",ref:T,style:cr},w)},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=S.memo(({isSelecting:e,selectionMode:t=zt.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:c,onPaneMouseMove:u,onPaneMouseLeave:l,children:f})=>{const d=S.useRef(null),g=oe(),x=S.useRef(0),p=S.useRef(0),b=S.useRef(),{userSelectionActive:m,elementsSelectable:w,dragging:N}=J(rf,ie),y=()=>{g.setState({userSelectionActive:!1,userSelectionRect:null}),x.current=0,p.current=0},M=B=>{i==null||i(B),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},$=B=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){B.preventDefault();return}s==null||s(B)},D=a?B=>a(B):void 0,V=B=>{const{resetSelectedElements:h,domNode:k}=g.getState();if(b.current=k==null?void 0:k.getBoundingClientRect(),!w||!e||B.button!==0||B.target!==d.current||!b.current)return;const{x:E,y:z}=Fe(B,b.current);h(),g.setState({userSelectionRect:{width:0,height:0,startX:E,startY:z,x:E,y:z}}),r==null||r(B)},T=B=>{const{userSelectionRect:h,nodeInternals:k,edges:E,transform:z,onNodesChange:F,onEdgesChange:_,nodeOrigin:v,getNodes:I}=g.getState();if(!e||!b.current||!h)return;g.setState({userSelectionActive:!0,nodesSelectionActive:!1});const P=Fe(B,b.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,z,t===zt.Partial,!0,v),Z=Wo(G,E).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&&(F==null||F(K))}if(p.current!==Z.length){p.current=Z.length;const K=ct(E,Z);K.length&&(_==null||_(K))}g.setState({userSelectionRect:U})},R=B=>{if(B.button!==0)return;const{userSelectionRect:h}=g.getState();!m&&h&&B.target===d.current&&(M==null||M(B)),g.setState({nodesSelectionActive:x.current>0}),y(),o==null||o(B)},H=B=>{m&&(g.setState({nodesSelectionActive:x.current>0}),o==null||o(B)),y()},L=w&&(e||m);return C.createElement("div",{className:ae(["react-flow__pane",{dragging:N,selection:e}]),onClick:L?void 0:kn(M,d),onContextMenu:kn($,d),onWheel:kn(D,d),onMouseEnter:L?void 0:c,onMouseDown:L?V:void 0,onMouseMove:L?T:u,onMouseUp:L?R:void 0,onMouseLeave:L?H:l,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 c=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(c&&e.width&&e.height){const f=n.get(c),{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&&c&&e.extent!=="parent"){const f=n.get(c),{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(c){const f=n.get(c);u=ft(f,o).positionAbsolute}const l=a&&a!=="parent"?Qn(t,a):t;return{position:{x:l.x-u.x,y:l.y-u.y},positionAbsolute:l}}function Cn({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(c=>{const u=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(u.left-s.left-a.x)/n,y:(u.top-s.top-a.y)/n,...Kn(c)}})};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:c}=t.getState(),u=a.get(e);if(!u){c==null||c("012",Ie.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var l;return(l=r==null?void 0:r.current)==null?void 0:l.blur()})):o([e])}function af(){const e=oe();return S.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,c={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(c.x/o[0]):c.x,ySnapped:i?o[1]*Math.round(c.y/o[1]):c.y,...c}},[])}function An(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=oe(),[c,u]=S.useState(!1),l=S.useRef([]),f=S.useRef({x:null,y:null}),d=S.useRef(0),g=S.useRef(null),x=S.useRef({x:0,y:0}),p=S.useRef(null),b=S.useRef(!1),m=S.useRef(!1),w=S.useRef(!1),N=af();return S.useEffect(()=>{if(e!=null&&e.current){const y=ye(e.current),M=({x:V,y:T})=>{const{nodeInternals:R,onNodeDrag:H,onSelectionDrag:L,updateNodePositions:B,nodeExtent:h,snapGrid:k,snapToGrid:E,nodeOrigin:z,onError:F}=a.getState();f.current={x:V,y:T};let _=!1,v={x:0,y:0,x2:0,y2:0};if(l.current.length>1&&h){const P=or(l.current,z);v=Jn(P)}if(l.current=l.current.map(P=>{const j={x:V-P.distance.x,y:T-P.distance.y};E&&(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]]];l.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,R,O,z,F);return _=_||P.position.x!==U.position.x||P.position.y!==U.position.y,P.position=U.position,P.positionAbsolute=U.positionAbsolute,P}),!_)return;B(l.current,!0,!0),u(!0);const I=o?H:An(L);if(I&&p.current){const[P,j]=Cn({nodeId:o,dragItems:l.current,nodeInternals:R});I(p.current,P,j)}},$=()=>{if(!g.current)return;const[V,T]=Fo(x.current,g.current);if(V!==0||T!==0){const{transform:R,panBy:H}=a.getState();f.current.x=(f.current.x??0)-V/R[2],f.current.y=(f.current.y??0)-T/R[2],H({x:V,y:T})&&M(f.current)}d.current=requestAnimationFrame($)},D=V=>{var z;const{nodeInternals:T,multiSelectionActive:R,nodesDraggable:H,unselectNodesAndEdges:L,onNodeDragStart:B,onSelectionDragStart:h}=a.getState();m.current=!0;const k=o?B:An(h);(!s||!i)&&!R&&o&&((z=T.get(o))!=null&&z.selected||L()),o&&i&&s&&On({id:o,store:a,nodeRef:e});const E=N(V);if(f.current=E,l.current=of(T,H,E,o),k&&l.current){const[F,_]=Cn({nodeId:o,dragItems:l.current,nodeInternals:T});k(V.sourceEvent,F,_)}};if(t)y.on(".drag",null);else{const V=pc().on("start",T=>{const{domNode:R,nodeDragThreshold:H}=a.getState();H===0&&D(T),w.current=!1;const L=N(T);f.current=L,g.current=(R==null?void 0:R.getBoundingClientRect())||null,x.current=Fe(T.sourceEvent,g.current)}).on("drag",T=>{var B,h;const R=N(T),{autoPanOnNodeDrag:H,nodeDragThreshold:L}=a.getState();if(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1&&(w.current=!0),!w.current){if(!b.current&&m.current&&H&&(b.current=!0,$()),!m.current){const k=R.xSnapped-(((B=f==null?void 0:f.current)==null?void 0:B.x)??0),E=R.ySnapped-(((h=f==null?void 0:f.current)==null?void 0:h.y)??0);Math.sqrt(k*k+E*E)>L&&D(T)}(f.current.x!==R.xSnapped||f.current.y!==R.ySnapped)&&l.current&&m.current&&(p.current=T.sourceEvent,x.current=Fe(T.sourceEvent,g.current),M(R))}}).on("end",T=>{if(!(!m.current||w.current)&&(u(!1),b.current=!1,m.current=!1,cancelAnimationFrame(d.current),l.current)){const{updateNodePositions:R,nodeInternals:H,onNodeDragStop:L,onSelectionDragStop:B}=a.getState(),h=o?L:An(B);if(R(l.current,!1,!1),h){const[k,E]=Cn({nodeId:o,dragItems:l.current,nodeInternals:H});h(T.sourceEvent,k,E)}}}).filter(T=>{const R=T.target;return!T.button&&(!n||!Kr(R,`.${n}`,e))&&(!r||Kr(R,r,e))});return y.call(V),()=>{y.on(".drag",null)}}}},[e,t,n,r,i,a,o,s,N]),c}function ys(){const e=oe();return S.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:c,onError:u,nodesDraggable:l}=e.getState(),f=s().filter(w=>w.selected&&(w.draggable||l&&typeof w.draggable>"u")),d=a?c[0]:5,g=a?c[1]:5,x=n.isShiftPressed?4:1,p=n.x*d*x,b=n.y*g*x,m=f.map(w=>{if(w.positionAbsolute){const N={x:w.positionAbsolute.x+p,y:w.positionAbsolute.y+b};a&&(N.x=c[0]*Math.round(N.x/c[0]),N.y=c[1]*Math.round(N.y/c[1]));const{positionAbsolute:y,position:M}=ps(w,N,r,o,void 0,u);w.position=M,w.positionAbsolute=y}return w});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:c,selected:u,onClick:l,onMouseEnter:f,onMouseMove:d,onMouseLeave:g,onContextMenu:x,onDoubleClick:p,style:b,className:m,isDraggable:w,isSelectable:N,isConnectable:y,isFocusable:M,selectNodesOnDrag:$,sourcePosition:D,targetPosition:V,hidden:T,resizeObserver:R,dragHandle:H,zIndex:L,isParent:B,noDragClassName:h,noPanClassName:k,initialized:E,disableKeyboardA11y:z,ariaLabel:F,rfId:_,hasHandleBounds:v})=>{const I=oe(),P=S.useRef(null),j=S.useRef(null),O=S.useRef(D),U=S.useRef(V),W=S.useRef(r),G=N||w||l||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(N&&(!$||!w||Y>0)&&On({id:n,store:I,nodeRef:P}),l){const le=I.getState().nodeInternals.get(n);le&&l(Q,{...le})}},ne=Q=>{if(!Fn(Q)&&!z)if(Bo.includes(Q.key)&&N){const Y=Q.key==="Escape";On({id:n,store:I,unselect:Y,nodeRef:P})}else w&&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}))};S.useEffect(()=>()=>{j.current&&(R==null||R.unobserve(j.current),j.current=null)},[]),S.useEffect(()=>{if(P.current&&!T){const Q=P.current;(!E||!v||j.current!==Q)&&(j.current&&(R==null||R.unobserve(j.current)),R==null||R.observe(Q),j.current=Q)}},[T,E,v]),S.useEffect(()=>{const Q=W.current!==r,Y=O.current!==D,le=U.current!==V;P.current&&(Q||Y||le)&&(Q&&(W.current=r),Y&&(O.current=D),le&&(U.current=V),I.getState().updateNodeDimensions([{id:n,nodeElement:P.current,forceUpdate:!0}]))},[n,r,D,V]);const be=ms({nodeRef:P,disabled:T||!w,noDragClassName:h,handleSelector:H,nodeId:n,isSelectable:N,selectNodesOnDrag:$});return T?null:C.createElement("div",{className:ae(["react-flow__node",`react-flow__node-${r}`,{[k]:w},m,{selected:u,selectable:N,parent:B,dragging:be}]),ref:P,style:{zIndex:L,transform:`translate(${a}px,${c}px)`,pointerEvents:G?"all":"none",visibility:E?"visible":"hidden",...b},"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":z?void 0:`${is}-${_}`,"aria-label":F},C.createElement(vu,{value:n},C.createElement(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:u,isConnectable:y,sourcePosition:D,targetPosition:V,dragging:be,dragHandle:H,zIndex:L})))};return t.displayName="NodeWrapper",S.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=oe(),{width:o,height:i,x:s,y:a,transformString:c,userSelectionActive:u}=J(cf,ie),l=ys(),f=S.useRef(null);if(S.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(b=>b.selected);e(x,p)}:void 0,g=x=>{Object.prototype.hasOwnProperty.call(dt,x.key)&&l({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:c}},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=S.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:c,onMoveStart:u,onMoveEnd:l,selectionKeyCode:f,selectionOnDrag:d,selectionMode:g,onSelectionStart:x,onSelectionEnd:p,multiSelectionKeyCode:b,panActivationKeyCode:m,zoomActivationKeyCode:w,elementsSelectable:N,zoomOnScroll:y,zoomOnPinch:M,panOnScroll:$,panOnScrollSpeed:D,panOnScrollMode:V,zoomOnDoubleClick:T,panOnDrag:R,defaultViewport:H,translateExtent:L,minZoom:B,maxZoom:h,preventScrolling:k,onSelectionContextMenu:E,noWheelClassName:z,noPanClassName:F,disableKeyboardA11y:_})=>{const v=J(ff),I=Rt(f),P=Rt(m),j=P||R,O=P||$,U=I||d&&j!==!0;return Gu({deleteKeyCode:a,multiSelectionKeyCode:b}),C.createElement(Ju,{onMove:c,onMoveStart:u,onMoveEnd:l,onPaneContextMenu:i,elementsSelectable:N,zoomOnScroll:y,zoomOnPinch:M,panOnScroll:O,panOnScrollSpeed:D,panOnScrollMode:V,zoomOnDoubleClick:T,panOnDrag:!I&&j,defaultViewport:H,translateExtent:L,minZoom:B,maxZoom:h,zoomActivationKeyCode:w,preventScrolling:k,noWheelClassName:z,noPanClassName:F},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:E,noPanClassName:F,disableKeyboardA11y:_})))};xs.displayName="FlowRenderer";var df=S.memo(xs);function hf(e){return J(S.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),c=S.useRef(),u=S.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const l=new ResizeObserver(f=>{const d=f.map(g=>({id:g.target.getAttribute("data-id"),nodeElement:g.target,forceUpdate:!0}));i(d)});return c.current=l,l},[]);return S.useEffect(()=>()=>{var l;(l=c==null?void 0:c.current)==null||l.disconnect()},[]),C.createElement("div",{className:"react-flow__nodes",style:cr},a.map(l=>{var M,$,D;let f=l.type||"default";e.nodeTypes[f]||(s==null||s("003",Ie.error003(f)),f="default");const d=e.nodeTypes[f]||e.nodeTypes.default,g=!!(l.draggable||t&&typeof l.draggable>"u"),x=!!(l.selectable||o&&typeof l.selectable>"u"),p=!!(l.connectable||n&&typeof l.connectable>"u"),b=!!(l.focusable||r&&typeof l.focusable>"u"),m=e.nodeExtent?Qn(l.positionAbsolute,e.nodeExtent):l.positionAbsolute,w=(m==null?void 0:m.x)??0,N=(m==null?void 0:m.y)??0,y=pf({x:w,y:N,width:l.width??0,height:l.height??0,origin:e.nodeOrigin});return C.createElement(d,{key:l.id,id:l.id,className:l.className,style:l.style,type:f,data:l.data,sourcePosition:l.sourcePosition||X.Bottom,targetPosition:l.targetPosition||X.Top,hidden:l.hidden,xPos:w,yPos:N,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:!!l.selected,isDraggable:g,isSelectable:x,isConnectable:p,isFocusable:b,resizeObserver:u,dragHandle:l.dragHandle,zIndex:((M=l[te])==null?void 0:M.z)??0,isParent:!!(($=l[te])!=null&&$.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!l.width&&!!l.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:l.ariaLabel,hasHandleBounds:!!((D=l[te])!=null&&D.handleBounds)})}))};ws.displayName="NodeRenderer";var yf=S.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:c,animated:u,label:l,labelStyle:f,labelShowBg:d,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:p,style:b,source:m,target:w,sourceX:N,sourceY:y,targetX:M,targetY:$,sourcePosition:D,targetPosition:V,elementsSelectable:T,hidden:R,sourceHandleId:H,targetHandleId:L,onContextMenu:B,onMouseEnter:h,onMouseMove:k,onMouseLeave:E,reconnectRadius:z,onReconnect:F,onReconnectStart:_,onReconnectEnd:v,markerEnd:I,markerStart:P,rfId:j,ariaLabel:O,isFocusable:U,isReconnectable:W,pathOptions:G,interactionWidth:Z,disableKeyboardA11y:ee})=>{const K=S.useRef(null),[ge,fe]=S.useState(!1),[pe,de]=S.useState(!1),ne=oe(),be=S.useMemo(()=>`url('#${Bn(P,j)}')`,[P,j]),Q=S.useMemo(()=>`url('#${Bn(I,j)}')`,[I,j]);if(R)return null;const Y=se=>{var _e;const{edges:me,addSelectedEdges:Oe,unselectNodesAndEdges:Xe,multiSelectionActive:Ye}=ne.getState(),Ce=me.find(xt=>xt.id===n);Ce&&(T&&(ne.setState({nodesSelectionActive:!1}),Ce.selected&&Ye?(Xe({nodes:[],edges:[Ce]}),(_e=K.current)==null||_e.blur()):Oe([n])),s&&s(se,Ce))},le=_t(n,ne.getState,a),Be=_t(n,ne.getState,B),mt=_t(n,ne.getState,h),Je=_t(n,ne.getState,k),et=_t(n,ne.getState,E),ke=(se,me)=>{if(se.button!==0)return;const{edges:Oe,isValidConnection:Xe}=ne.getState(),Ye=me?w:m,Ce=(me?L:H)||null,_e=me?"target":"source",xt=Xe||vf,hn=me,wt=Oe.find(Ue=>Ue.id===n);de(!0),_==null||_(se,wt,_e);const gn=Ue=>{de(!1),v==null||v(Ue,wt,_e)};Qo({event:se,handleId:Ce,nodeId:Ye,onConnect:Ue=>F==null?void 0:F(wt,Ue),isTarget:hn,getState:ne.getState,setState:ne.setState,isValidConnection:xt,edgeUpdaterType:_e,onReconnectEnd:gn})},tt=se=>ke(se,!0),Le=se=>ke(se,!1),je=()=>fe(!0),nt=()=>fe(!1),rt=!T&&!s,yt=se=>{var me;if(!ee&&Bo.includes(se.key)&&T){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:c,animated:u,inactive:rt,updating:ge}]),onClick:Y,onDoubleClick:le,onContextMenu:Be,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 ${w}`,"aria-describedby":U?`${as}-${j}`:void 0,ref:K},!pe&&C.createElement(e,{id:n,source:m,target:w,selected:c,animated:u,label:l,labelStyle:f,labelShowBg:d,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:p,data:i,style:b,sourceX:N,sourceY:y,targetX:M,targetY:$,sourcePosition:D,targetPosition:V,sourceHandleId:H,targetHandleId:L,markerStart:be,markerEnd:Q,pathOptions:G,interactionWidth:Z}),W&&C.createElement(C.Fragment,null,(W==="source"||W===!0)&&C.createElement(eo,{position:D,centerX:N,centerY:y,radius:z,onMouseDown:tt,onMouseEnter:je,onMouseOut:nt,type:"source"}),(W==="target"||W===!0)&&C.createElement(eo,{position:V,centerX:M,centerY:$,radius:z,onMouseDown:Le,onMouseEnter:je,onMouseOut:nt,type:"target"})))};return t.displayName="EdgeWrapper",S.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:c}){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 l=Jn({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:s/c[2],height:a/c[2]}),f=Math.max(0,Math.min(l.x2,u.x2)-Math.max(l.x,u.x)),d=Math.max(0,Math.min(l.y2,u.y2)-Math.max(l.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 l,f;const c=he(a.zIndex);let u=c?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(((l=g==null?void 0:g[te])==null?void 0:l.z)||0,((f=d==null?void 0:d[te])==null?void 0:f.z)||0,1e3);u=(c?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 c=+s;return{edges:a,level:c,isMaxLevel:c===r}});return i.length===0?Sf:i}function kf(e,t,n){const r=J(S.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 Cf=({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"}),Af=({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]:Cf,[Pt.ArrowClosed]:Af};function Mf(e){const t=oe();return S.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 c=Mf(t);return c?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(c,{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=Bn(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(S.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=S.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:c,onEdgeMouseLeave:u,onEdgeClick:l,onEdgeDoubleClick:f,onReconnect:d,onReconnectStart:g,onReconnectEnd:x,reconnectRadius:p,children:b,disableKeyboardA11y:m})=>{const{edgesFocusable:w,edgesUpdatable:N,elementsSelectable:y,width:M,height:$,connectionMode:D,nodeInternals:V,onError:T}=J(zf,ie),R=kf(t,V,n);return M?C.createElement(C.Fragment,null,R.map(({level:H,edges:L,isMaxLevel:B})=>C.createElement("svg",{key:H,style:{zIndex:H},width:M,height:$,className:"react-flow__edges react-flow__container"},B&&C.createElement(Tf,{defaultColor:e,rfId:r}),C.createElement("g",null,L.map(h=>{const[k,E,z]=ro(V.get(h.source)),[F,_,v]=ro(V.get(h.target));if(!z||!v)return null;let I=h.type||"default";o[I]||(T==null||T("011",Ie.error011(I)),I="default");const P=o[I]||o.default,j=D===Qe.Strict?_.target:(_.target??[]).concat(_.source??[]),O=no(E.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||w&&typeof h.focusable>"u"),ee=h.reconnectable||h.updatable,K=typeof d<"u"&&(ee||N&&typeof ee>"u");if(!O||!U)return T==null||T("008",Ie.error008(O,h)),null;const{sourceX:ge,sourceY:fe,targetX:pe,targetY:de}=_f(k,O,W,F,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:c,onMouseLeave:u,onClick:l,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})})))),b):null};bs.displayName="EdgeRenderer";var Pf=S.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=S.useRef(!1);S.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 $,D,V;const{fromNode:s,handleId:a,toX:c,toY:u,connectionMode:l}=J(S.useCallback(T=>({fromNode:T.nodeInternals.get(e),handleId:T.connectionHandleId,toX:(T.connectionPosition.x-T.transform[0])/T.transform[2],toY:(T.connectionPosition.y-T.transform[1])/T.transform[2],connectionMode:T.connectionMode}),[e]),ie),f=($=s==null?void 0:s[te])==null?void 0:$.handleBounds;let d=f==null?void 0:f[t];if(l===Qe.Loose&&(d=d||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!d)return null;const g=a?d.find(T=>T.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,b=(((D=s.positionAbsolute)==null?void 0:D.x)??0)+x,m=(((V=s.positionAbsolute)==null?void 0:V.y)??0)+p,w=g==null?void 0:g.position,N=w?Ff[w]:null;if(!w||!N)return null;if(o)return C.createElement(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:g,fromX:b,fromY:m,toX:c,toY:u,fromPosition:w,toPosition:N,connectionStatus:i});let y="";const M={sourceX:b,sourceY:m,sourcePosition:w,targetX:c,targetY:u,targetPosition:N};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${b},${m} ${c},${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 Bf({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:a,height:c,connectionStatus:u}=J(Vf,ie);return!(o&&i&&a&&s)?null:C.createElement("svg",{style:e,width:a,height:c,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 S.useRef(null),oe(),S.useMemo(()=>t(e),[e])}const Es=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:l,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:g,onSelectionContextMenu:x,onSelectionStart:p,onSelectionEnd:b,connectionLineType:m,connectionLineStyle:w,connectionLineComponent:N,connectionLineContainerStyle:y,selectionKeyCode:M,selectionOnDrag:$,selectionMode:D,multiSelectionKeyCode:V,panActivationKeyCode:T,zoomActivationKeyCode:R,deleteKeyCode:H,onlyRenderVisibleElements:L,elementsSelectable:B,selectNodesOnDrag:h,defaultViewport:k,translateExtent:E,minZoom:z,maxZoom:F,preventScrolling:_,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:Be,reconnectRadius:mt,noDragClassName:Je,noWheelClassName:et,noPanClassName:ke,elevateEdgesOnSelect:tt,disableKeyboardA11y:Le,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:H,selectionKeyCode:M,selectionOnDrag:$,selectionMode:D,onSelectionStart:p,onSelectionEnd:b,multiSelectionKeyCode:V,panActivationKeyCode:T,zoomActivationKeyCode:R,elementsSelectable:B,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:I,zoomOnPinch:P,zoomOnDoubleClick:W,panOnScroll:j,panOnScrollSpeed:O,panOnScrollMode:U,panOnDrag:G,defaultViewport:k,translateExtent:E,minZoom:z,maxZoom:F,onSelectionContextMenu:x,preventScrolling:_,noDragClassName:Je,noWheelClassName:et,noPanClassName:ke,disableKeyboardA11y:Le},C.createElement(Df,null,C.createElement(Pf,{edgeTypes:se,onEdgeClick:a,onEdgeDoubleClick:u,onlyRenderVisibleElements:L,onEdgeContextMenu:de,onEdgeMouseEnter:ne,onEdgeMouseMove:be,onEdgeMouseLeave:Q,onReconnect:Y,onReconnectStart:le,onReconnectEnd:Be,reconnectRadius:mt,defaultMarkerColor:v,noPanClassName:ke,elevateEdgesOnSelect:!!tt,disableKeyboardA11y:Le,rfId:rt},C.createElement(Bf,{style:w,type:m,component:N,containerStyle:y})),C.createElement("div",{className:"react-flow__edgelabel-renderer"}),C.createElement(yf,{nodeTypes:yt,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:l,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:g,selectNodesOnDrag:h,onlyRenderVisibleElements:L,noPanClassName:ke,noDragClassName:Je,disableKeyboardA11y:Le,nodeOrigin:je,nodeExtent:nt,rfId:rt})))};Es.displayName="GraphView";var Lf=S.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=()=>Ci((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:c,nodeOrigin:u}=t(),l=c==null?void 0:c.querySelector(".react-flow__viewport");if(!l)return;const f=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(f.transform),g=n.reduce((p,b)=>{const m=o.get(b.id);if(m!=null&&m.hidden)o.set(m.id,{...m,[te]:{...m[te],handleBounds:void 0}});else if(m){const w=Kn(b.nodeElement);!!(w.width&&w.height&&(m.width!==w.width||m.height!==w.height||b.forceUpdate))&&(o.set(m.id,{...m,[te]:{...m[te],handleBounds:{source:Qr(".source",b.nodeElement,d,u),target:Qr(".target",b.nodeElement,d,u)}},...w}),p.push({id:m.id,type:"dimensions",dimensions:w}))}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 c={id:a.id,type:"position",dragging:o};return r&&(c.positionAbsolute=a.positionAbsolute,c.position=a.position),c});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:c}=t();if(n!=null&&n.length){if(i){const u=ds(n,a()),l=Nn(u,o,s,c);e({nodeInternals:l})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(c=>Re(c,!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(c=>Re(c,!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,c=s.map(l=>(l.selected=!1,Re(l.id,!1))),u=a.map(l=>Re(l.id,!1));Ut({changedNodes:c,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:c}=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]),l=[[0,0],[o,i]],f=s==null?void 0:s.constrain()(u,l,c);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=S.useRef(null);return t.current||(t.current=jf()),C.createElement(iu,{value:t.current},e)};Ss.displayName="ReactFlowProvider";const Ns=({children:e})=>S.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=S.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=Of,edgeTypes:s=Xf,onNodeClick:a,onEdgeClick:c,onInit:u,onMove:l,onMoveStart:f,onMoveEnd:d,onConnect:g,onConnectStart:x,onConnectEnd:p,onClickConnectStart:b,onClickConnectEnd:m,onNodeMouseEnter:w,onNodeMouseMove:N,onNodeMouseLeave:y,onNodeContextMenu:M,onNodeDoubleClick:$,onNodeDragStart:D,onNodeDrag:V,onNodeDragStop:T,onNodesDelete:R,onEdgesDelete:H,onSelectionChange:L,onSelectionDragStart:B,onSelectionDrag:h,onSelectionDragStop:k,onSelectionContextMenu:E,onSelectionStart:z,onSelectionEnd:F,connectionMode:_=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:Be,elementsSelectable:mt,defaultViewport:Je=qf,minZoom:et=.5,maxZoom:ke=2,translateExtent:tt=Xn,preventScrolling:Le=!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:Ce,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:Bs,onReconnectEnd:Ls,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(Lf,{onInit:u,onMove:l,onMoveStart:f,onMoveEnd:d,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:N,onNodeMouseLeave:y,onNodeContextMenu:M,onNodeDoubleClick:$,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:Le,zoomOnScroll:rt,zoomOnPinch:yt,zoomOnDoubleClick:Xe,panOnScroll:se,panOnScrollSpeed:me,panOnScrollMode:Oe,panOnDrag:Ye,onPaneClick:Ce,onPaneMouseEnter:_e,onPaneMouseMove:xt,onPaneMouseLeave:hn,onPaneScroll:wt,onPaneContextMenu:gn,onSelectionContextMenu:E,onSelectionStart:z,onSelectionEnd:F,onEdgeContextMenu:Ue,onEdgeDoubleClick:Ts,onEdgeMouseEnter:zs,onEdgeMouseMove:Ps,onEdgeMouseLeave:Rs,onReconnect:Vs??Ds,onReconnectStart:Bs??Hs,onReconnectEnd:Ls??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:b,onClickConnectEnd:m,nodesDraggable:ne,nodesConnectable:be,nodesFocusable:Q,edgesFocusable:le,edgesUpdatable:Be,elementsSelectable:mt,elevateNodesOnSelect:ei,minZoom:et,maxZoom:ke,nodeExtent:je,onNodesChange:Xs,onEdgesChange:Ys,snapToGrid:ge,snapGrid:fe,connectionMode:_,translateExtent:tt,connectOnClick:Zs,defaultEdgeOptions:Js,fitView:Ws,fitViewOptions:Gs,onNodesDelete:R,onEdgesDelete:H,onNodeDragStart:D,onNodeDrag:V,onNodeDragStop:T,onSelectionDrag:h,onSelectionDragStart:B,onSelectionDragStop:k,noPanClassName:ur,nodeOrigin:Y,rfId:pn,autoPanOnConnect:ni,autoPanOnNodeDrag:ri,onError:ii,connectionRadius:oi,isValidConnection:si,nodeDragThreshold:ci}),C.createElement(Ru,{onSelectionChange:L}),lr,C.createElement(cu,{proOptions:Qs,position:Ks}),C.createElement(ju,{rfId:pn,disableKeyboardA11y:fr})))});ks.displayName="ReactFlow";function Cs(e){return t=>{const[n,r]=S.useState(t),o=S.useCallback(i=>r(s=>e(i,s)),[]);return[n,r,o]}}const Gf=Cs(ds),Zf=Cs(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 Ct=({children:e,className:t,...n})=>C.createElement("button",{type:"button",className:ae(["react-flow__controls-button",t]),...n},e);Ct.displayName="ControlButton";const nd=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),As=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:c,className:u,children:l,position:f="bottom-left"})=>{const d=oe(),[g,x]=S.useState(!1),{isInteractive:p,minZoomReached:b,maxZoomReached:m}=J(nd,ie),{zoomIn:w,zoomOut:N,fitView:y}=ar();if(S.useEffect(()=>{x(!0)},[]),!g)return null;const M=()=>{w(),i==null||i()},$=()=>{N(),s==null||s()},D=()=>{y(o),a==null||a()},V=()=>{d.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),c==null||c(!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(Ct,{onClick:M,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m},C.createElement(Kf,null)),C.createElement(Ct,{onClick:$,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b},C.createElement(Qf,null))),n&&C.createElement(Ct,{className:"react-flow__controls-fitview",onClick:D,title:"fit view","aria-label":"fit view"},C.createElement(Jf,null)),r&&C.createElement(Ct,{className:"react-flow__controls-interactive",onClick:V,title:"toggle interactivity","aria-label":"toggle interactivity"},p?C.createElement(td,null):C.createElement(ed,null)),l)};As.displayName="Controls";var rd=S.memo(As),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:c}){const u=S.useRef(null),{transform:l,patternId:f}=J(cd,ie),d=s||id[t],g=r||ad[t],x=t===we.Dots,p=t===we.Cross,b=Array.isArray(n)?n:[n,n],m=[b[0]*l[2]||1,b[1]*l[2]||1],w=g*l[2],N=p?[w,w]:m,y=x?[w/i,w/i]:[N[0]/i,N[1]/i];return C.createElement("svg",{className:ae(["react-flow__background",c]),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:l[0]%m[0],y:l[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${y[0]},-${y[1]})`},x?C.createElement(sd,{color:d,radius:w/i}):C.createElement(od,{dimensions:N,color:d,lineWidth:o})),C.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}Ms.displayName="Background";var ld=S.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 A.jsx(hd,{className:"status-icon active",size:16});case"saved":return A.jsx(fd,{className:"status-icon saved",size:16});default:return A.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 A.jsxs("div",{className:`node-card ${e.selected?"selected":""} ${n()}`,children:[A.jsx(Ve,{type:"target",position:X.Top,className:"node-handle"}),A.jsxs("div",{className:"node-header",children:[t(),A.jsx("span",{className:"node-label",children:e.label})]}),e.claudeSessionId&&A.jsxs("div",{className:"node-id",children:[e.claudeSessionId.slice(0,8),"..."]}),A.jsx("div",{className:"node-status-badge",children:e.status}),A.jsx(Ve,{type:"source",position:X.Bottom,className:"node-handle"})]})}function Cd({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 A.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:[A.jsx(Ve,{type:"target",position:X.Top}),A.jsx("span",{style:{fontSize:"10px",fontWeight:600,color:t,textAlign:"center"},children:e.status==="merged"?"M":"C"}),A.jsx(Ve,{type:"source",position:X.Bottom})]})}const Ad={sessionNode:kd,compactNode:Cd};function Md({session:e,selectedNode:t,onNodeClick:n}){var b,m;const r=S.useMemo(()=>(e.forks||[]).map(N=>`${N.id}:${N.status}:${N.parentId}`).join(","),[e.forks]),o=S.useMemo(()=>JSON.stringify(e.nodePositions||{}),[e.nodePositions]),i=S.useCallback((w,N,y=new Set)=>{if(w==="main"||y.has(w))return 0;const M=N.find($=>$.id===w);return M?(y.add(w),1+i(M.parentId,N,y)):0},[]),s=S.useMemo(()=>{var V,T;const w=e.forks||[],N=e.nodePositions||{},y=new Map;w.forEach(R=>{const H=i(R.id,w);y.has(H)||y.set(H,[]),y.get(H).push(R)});const M=R=>{if(R==="main")return{x:250,y:50};const H=w.find(k=>k.id===R);if(!H)return{x:250,y:50};const L=i(H.id,w),B=y.get(L)||[];return{x:100+B.indexOf(H)*150-B.length*75+250,y:50+L*150}},$=R=>N[R]||M(R),D=[{id:"main",type:"sessionNode",position:$("main"),draggable:!0,data:{label:"MAIN",status:((V=e.main)==null?void 0:V.status)||e.status,claudeSessionId:(T=e.main)==null?void 0:T.claudeSessionId,selected:!1}}];return w.forEach(R=>{const H=R.status==="closed"||R.status==="merged"?"compactNode":"sessionNode";D.push({id:R.id,type:H,position:$(R.id),draggable:!0,data:{label:R.name,status:R.status,claudeSessionId:R.claudeSessionId,selected:!1}})}),D},[e.id,e.status,(b=e.main)==null?void 0:b.status,(m=e.main)==null?void 0:m.claudeSessionId,r,o,i]),a=S.useMemo(()=>(e.forks||[]).map(N=>({id:`${N.parentId}-${N.id}`,source:N.parentId,target:N.id,animated:N.status==="active",markerEnd:{type:Pt.ArrowClosed},style:{stroke:N.status==="active"?"#a6e3a1":"#585b70",strokeWidth:2}})),[r]),[c,u,l]=Gf(s),[f,d,g]=Zf(a);S.useEffect(()=>{u(s),d(a)},[r]);const x=S.useMemo(()=>c.map(w=>({...w,data:{...w.data,selected:w.id===t}})),[c,t]),p=S.useCallback((w,N)=>{n(N.id)},[n]);return A.jsx("div",{style:{width:"100%",height:"100%"},children:A.jsxs(ks,{nodes:x,edges:f,nodeTypes:Ad,onNodesChange:l,onEdgesChange:g,onNodeClick:p,fitView:!0,minZoom:.5,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:1},proOptions:{hideAttribution:!0},children:[A.jsx(ld,{}),A.jsx(rd,{})]})})}function $d({session:e}){const t=s=>{const a=new Date(s),u=new Date().getTime()-a.getTime(),l=Math.floor(u/(1e3*60*60)),f=Math.floor(l/24);return f>0?`${f} day${f>1?"s":""} ago`:l>0?`${l} hour${l>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 A.jsxs("div",{className:"session-info",children:[A.jsxs("div",{className:"session-info-header",children:[A.jsx("h2",{className:"session-name",children:e.name||"Unnamed Session"}),A.jsx("div",{className:`session-status-badge ${e.status}`,children:e.status})]}),A.jsxs("div",{className:"session-meta",children:[A.jsxs("div",{className:"session-meta-item",children:[A.jsx(yd,{size:14}),A.jsx("span",{children:t(e.createdAt)})]}),A.jsxs("button",{className:"session-meta-item folder-button",onClick:n,title:"Open project folder (tries Cursor, VSCode, or Finder)",children:[A.jsx(hi,{size:14}),A.jsx("span",{children:"Code"})]}),A.jsxs("button",{className:"session-meta-item terminal-button",onClick:r,title:"Focus terminal window",children:[A.jsx(gi,{size:14}),A.jsx("span",{children:"Terminal"})]}),A.jsxs("div",{className:"session-meta-item",children:[A.jsx($s,{size:14}),A.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:c,canCreateFork:u,hasExport:l}){const f=e!=="main",d=i||s||a||c;return A.jsxs("div",{className:"action-panel",children:[A.jsx("div",{className:"action-panel-header",children:A.jsxs("span",{className:"action-panel-title",children:["Actions for: ",A.jsxs("strong",{children:[e==="main"?"MAIN":e.slice(0,8),"..."]})]})}),A.jsxs("div",{className:"action-buttons",children:[A.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:[A.jsx($s,{size:18}),A.jsx("span",{children:i?"Creating...":"New Fork"})]}),A.jsxs("button",{className:"action-button",onClick:n,disabled:!f||d,title:"Export fork summary",children:[A.jsx(Sd,{size:18}),A.jsx("span",{children:s?"Exporting...":"Export"})]}),A.jsxs("button",{className:"action-button",onClick:r,disabled:!f||d||!l,title:l?"Merge fork back to parent":"Export the fork first before merging",children:[A.jsx(_d,{size:18}),A.jsx("span",{children:a?"Merging...":"Merge"})]}),A.jsxs("button",{className:"action-button danger",onClick:o,disabled:!f||d,title:"Close fork (abandon experiment)",children:[A.jsx(Is,{size:18}),A.jsx("span",{children:c?"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 A.jsx("div",{className:"modal-overlay",onClick:t,children:A.jsxs("div",{className:"modal fork-info-modal",onClick:i=>i.stopPropagation(),children:[A.jsxs("div",{className:"modal-header",children:[A.jsx("h3",{children:"Fork Details"}),A.jsx("button",{className:"modal-close-btn",onClick:t,children:A.jsx(Is,{size:18})})]}),A.jsxs("div",{className:"fork-info-content",children:[A.jsxs("div",{className:"info-row",children:[A.jsx("span",{className:"info-label",children:"Name:"}),A.jsx("span",{className:"info-value",children:e.name})]}),A.jsxs("div",{className:"info-row",children:[A.jsx("span",{className:"info-label",children:"ID:"}),A.jsx("span",{className:"info-value fork-id",children:e.id})]}),A.jsxs("div",{className:"info-row",children:[A.jsx("span",{className:"info-label",children:"Claude Session ID:"}),A.jsx("span",{className:"info-value fork-id",children:e.claudeSessionId})]}),A.jsxs("div",{className:"info-row",children:[A.jsx("span",{className:"info-label",children:"Status:"}),A.jsx("span",{className:"info-value",children:A.jsx("span",{className:"status-badge",style:{borderColor:r,color:r},children:o})})]}),A.jsxs("div",{className:"info-row",children:[A.jsx("span",{className:"info-label",children:"Created:"}),A.jsx("span",{className:"info-value",children:new Date(e.createdAt).toLocaleString()})]}),e.status==="merged"&&e.mergedAt&&A.jsxs("div",{className:"info-row",children:[A.jsx("span",{className:"info-label",children:"Merged:"}),A.jsx("span",{className:"info-value",children:new Date(e.mergedAt).toLocaleString()})]}),e.contextPath&&A.jsxs("div",{className:"info-row",children:[A.jsx("span",{className:"info-label",children:"Export Path:"}),A.jsx("span",{className:"info-value export-path",children:e.contextPath})]})]}),e.status==="merged"&&e.contextPath&&n&&A.jsx("div",{className:"modal-actions",children:A.jsxs("button",{className:"button-primary",onClick:n,children:[A.jsx(wd,{size:16}),"Open Export File"]})})]})})}const re={info:(...e)=>console.log("[App]",...e),error:(...e)=>console.error("[App]",...e),warn:(...e)=>console.warn("[App]",...e)};re.info("=== App module loaded ===");function zd(){var _;re.info("App component rendering...");const[e,t]=S.useState(null),[n,r]=S.useState("main"),[o,i]=S.useState(!0),[s,a]=S.useState(null),[c,u]=S.useState(!1),[l,f]=S.useState(""),[d,g]=S.useState(!1),[x,p]=S.useState(!1),[b,m]=S.useState(!1),[w,N]=S.useState(!1),[y,M]=S.useState(!1),[$,D]=S.useState(null);S.useEffect(()=>{if(re.info("useEffect: Initializing app..."),re.info("electronAPI available:",!!window.electronAPI),!window.electronAPI){re.error("electronAPI is not available! Preload script may have failed."),a("electronAPI not available - preload script may have failed"),i(!1);return}re.info("Requesting session data from main process..."),window.electronAPI.getSession().then(v=>{var I;re.info("Session data received:",v==null?void 0:v.id,v==null?void 0:v.name),re.info("Session has",((I=v==null?void 0:v.forks)==null?void 0:I.length)||0,"forks"),t(v),i(!1),re.info("Loading state set to false")}).catch(v=>{re.error("Failed to get session:",v.message),a(`Failed to get session: ${v.message}`),i(!1)}),re.info("Setting up state update listener..."),window.electronAPI.onStateUpdate(v=>{var I;re.info("State update received:",v==null?void 0:v.id,"forks:",(I=v==null?void 0:v.forks)==null?void 0:I.length),v!=null&&v.forks&&re.info("Fork details:",v.forks.map(P=>`${P.name}:${P.status}`).join(", ")),t(v)}),re.info("useEffect: Initialization complete")},[]);const V=async v=>{if(!e)return;const I=e.forks.find(P=>P.id===v);if(I&&(I.status==="closed"||I.status==="merged")){D(I),M(!0);return}r(v),await window.electronAPI.selectNode(v)},T=()=>{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)},R=async()=>{if(!l.trim()){alert("Please enter a fork name");return}g(!0);try{await window.electronAPI.createFork(e.id,l,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)}},H=()=>{u(!1),f("")},L=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)}}},B=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.`)){N(!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{N(!1)}}},k=async()=>{if($!=null&&$.contextPath)try{await window.electronAPI.openExportFile($.contextPath)}catch(v){alert(`Failed to open export file: ${v.message}`),console.error("Open export error:",v)}};if(o)return re.info("Rendering loading state..."),A.jsxs("div",{className:"loading",children:[A.jsx("div",{className:"spinner"}),A.jsx("p",{children:"Loading session..."})]});if(s)return re.error("Rendering error state:",s),A.jsxs("div",{className:"error",children:[A.jsx("p",{children:"Error loading session"}),A.jsx("p",{style:{fontSize:"12px",color:"#888"},children:s})]});if(!e)return re.warn("Rendering no-session state"),A.jsx("div",{className:"error",children:A.jsx("p",{children:"No session data available"})});re.info("Rendering main UI with session:",e.id);const E=e.forks||[],z=async()=>{await window.electronAPI.saveAndClose()},F=async()=>{await window.electronAPI.minimizeToTaskbar()};return A.jsxs("div",{className:"app",children:[A.jsxs("div",{className:"titlebar","data-tauri-drag-region":!0,children:[A.jsx("span",{className:"titlebar-text",children:"🎭 Claude-Orka"}),A.jsxs("div",{className:"titlebar-buttons",children:[A.jsx("button",{className:"titlebar-button minimize",onClick:F,children:"Minimize"}),A.jsx("button",{className:"titlebar-button save-close",onClick:z,children:"Save & Close"})]})]}),A.jsx($d,{session:e}),A.jsx("div",{className:"content",children:A.jsx(Md,{session:e,selectedNode:n,onNodeClick:V})}),A.jsx(Id,{selectedNode:n,onCreateFork:T,onExportFork:L,onMergeFork:B,onCloseFork:h,isCreatingFork:d,isExporting:x,isMerging:b,isClosing:w,canCreateFork:E.filter(v=>v.parentId===n&&v.status==="active").length===0,hasExport:n==="main"?!1:!!((_=E.find(v=>v.id===n))!=null&&_.contextPath)}),c&&A.jsx("div",{className:"modal-overlay",children:A.jsxs("div",{className:"modal",children:[A.jsx("h3",{children:"Create New Fork"}),A.jsx("input",{type:"text",value:l,onChange:v=>f(v.target.value),placeholder:"Enter fork name...",autoFocus:!0,disabled:d,onKeyPress:v=>v.key==="Enter"&&!d&&R()}),A.jsxs("div",{className:"modal-buttons",children:[A.jsx("button",{onClick:H,className:"button-secondary",disabled:d,children:"Cancel"}),A.jsx("button",{onClick:R,className:"button-primary",disabled:d,children:d?"Creating...":"Create"})]})]})}),y&&$&&A.jsx(Td,{fork:$,onClose:()=>{M(!1),D(null)},onOpenExport:$.status==="merged"?k:void 0})]})}class Pd extends S.Component{constructor(t){super(t),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t,errorInfo:null}}componentDidCatch(t,n){console.error("[ErrorBoundary] Caught error:",t,n),this.setState({error:t,errorInfo:n})}render(){var t,n;return this.state.hasError?A.jsxs("div",{style:{padding:"20px",backgroundColor:"#1e1e2e",color:"#cdd6f4",fontFamily:"monospace",height:"100vh",overflow:"auto"},children:[A.jsx("h2",{style:{color:"#f38ba8"},children:"Something went wrong"}),A.jsxs("details",{style:{whiteSpace:"pre-wrap",marginTop:"10px"},children:[A.jsx("summary",{style:{cursor:"pointer",color:"#fab387"},children:(t=this.state.error)==null?void 0:t.toString()}),A.jsx("pre",{style:{marginTop:"10px",padding:"10px",backgroundColor:"#313244",borderRadius:"4px",fontSize:"12px",overflow:"auto"},children:(n=this.state.errorInfo)==null?void 0:n.componentStack})]}),A.jsx("button",{onClick:()=>window.location.reload(),style:{marginTop:"20px",padding:"10px 20px",backgroundColor:"#89b4fa",color:"#1e1e2e",border:"none",borderRadius:"4px",cursor:"pointer"},children:"Reload"})]}):this.props.children}}pi.createRoot(document.getElementById("root")).render(A.jsx(C.StrictMode,{children:A.jsx(Pd,{children:A.jsx(zd,{})})}));
|