@enruana/claude-orka 0.8.1 → 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/.tmux.orka.conf +15 -5
- package/dist/cli.js +18 -0
- package/dist/electron/main/main.js +20 -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/dist/src/core/SessionManager.d.ts.map +1 -1
- package/dist/src/core/SessionManager.js +8 -0
- package/dist/src/core/SessionManager.js.map +1 -1
- package/dist/src/utils/tmux.d.ts +6 -0
- package/dist/src/utils/tmux.d.ts.map +1 -1
- package/dist/src/utils/tmux.js +16 -0
- package/dist/src/utils/tmux.js.map +1 -1
- package/package.json +1 -1
- package/dist/electron/renderer/assets/main-HIgPFlZ_.js +0 -66
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import{r as co,g as pi,R as M,a as gi,b as E,c as Te,j as w,F as mi,T as yi,d as xi}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 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>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionManager.d.ts","sourceRoot":"","sources":["../../../src/core/SessionManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AA2BzD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yBAAyB,CAAC,EAAE,MAAM,CAAA;CACnC;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,WAAW,CAAQ;gBAEf,WAAW,EAAE,MAAM;IAK/B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC;;OAEG;IACG,QAAQ;IAQd;;OAEG;IACG,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SessionManager.d.ts","sourceRoot":"","sources":["../../../src/core/SessionManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AA2BzD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yBAAyB,CAAC,EAAE,MAAM,CAAA;CACnC;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,WAAW,CAAQ;gBAEf,WAAW,EAAE,MAAM;IAK/B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC;;OAEG;IACG,QAAQ;IAQd;;OAEG;IACG,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC;IA4EzE;;OAEG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,UAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IA4F7E;;OAEG;IACG,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BpD;;OAEG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBrD;;OAEG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIhE;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAQ5D;;OAEG;IACG,UAAU,CACd,SAAS,EAAE,MAAM,EACjB,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,GAAE,MAAe,EACzB,QAAQ,UAAQ,GACf,OAAO,CAAC,IAAI,CAAC;IAkEhB;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwDlE;;OAEG;IACG,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BjE;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+BlE;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBnE;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BnF;;;OAGG;IACG,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAuE5E;;;OAGG;IACG,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkGjE;;OAEG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IASpE;;;;;OAKG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB5G;;OAEG;YACW,gBAAgB;IA0C9B;;OAEG;YACW,QAAQ;CAgFvB"}
|