codegraphy-lite 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ var qt=he;(function(e,t){for(var n=he,o=e();;)try{var r=-parseInt(n(503,"N$kv"))/1+parseInt(n(435,"M5Id"))/2*(parseInt(n(486,"u%ck"))/3)+parseInt(n(488,"Ldkg"))/4+parseInt(n(467,"Fl]y"))/5+parseInt(n(472,"Obzq"))/6+parseInt(n(434,"6^^v"))/7*(-parseInt(n(440,"iXKw"))/8)+-parseInt(n(439,"%@fG"))/9*(parseInt(n(442,"Obzq"))/10);if(r===t)break;o.push(o.shift())}catch{o.push(o.shift())}})(en,152175);function he(e,t){e=e-433;var n=en(),o=n[e];if(he.PmRyAA===void 0){var r=function(l){for(var u="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",c="",f="",h=0,g,m,v=0;m=l.charAt(v++);~m&&(g=h%4?g*64+m:m,h++%4)?c+=String.fromCharCode(255&g>>(-2*h&6)):0)m=u.indexOf(m);for(var y=0,E=c.length;y<E;y++)f+="%"+("00"+c.charCodeAt(y).toString(16)).slice(-2);return decodeURIComponent(f)},i=function(l,u){var c=[],f=0,h,g="";l=r(l);var m;for(m=0;m<256;m++)c[m]=m;for(m=0;m<256;m++)f=(f+c[m]+u.charCodeAt(m%u.length))%256,h=c[m],c[m]=c[f],c[f]=h;m=0,f=0;for(var v=0;v<l.length;v++)m=(m+1)%256,f=(f+c[m])%256,h=c[m],c[m]=c[f],c[f]=h,g+=String.fromCharCode(l.charCodeAt(v)^c[(c[m]+c[f])%256]);return g};he.jFSlXd=i,he.BUOuZB={},he.PmRyAA=!0}var s=n[0],a=e+s,d=he.BUOuZB[a];return d?o=d:(he.RwIKYR===void 0&&(he.RwIKYR=!0),o=he.jFSlXd(o,t),he.BUOuZB[a]=o),o}function en(){var e=["u8kCW5au","W7XUk0e","W7PqxNRcIHxcOmouwCkLC8kD","W6mqW4vJ","b8oCWPbvzuOVWOhdM8knWPuH","WPFcPH7dKW","WOVcUCoGBCkG","WPq2dJRdTeNcNSo2ySkl","CCkpWRejDa","vXJdLmos","W6KQWRmqW6S","ASoNWQ/dHmkYFmk3nCk/","smk6WOeIydtcOcBdOsG","WQOlb8kLW5DZDw9zdW","W7adW4z7WO0DWRdcKSo2","vmoQWRLZW6xdQa","gmk/aWZdVmk4EmoTWOT6","zCoDWOddQ8kn","WR7cPCkaW5ZcSa","m3OufmoakSoCW4iLhGVdMa","WR5KW5WNW6S","W7L0WOnKpMDaW4ngW4K","W6xdQhBcG8o2","W6JcSmoMF8kYsCoT","WRLaW4WsW7xdIwdcUGS","gJxcR0WS","WQmigaBdJKJcQSoXyCkE","WOyqDmoFW6fXuq","W7NdJmoormo5fCko","twXXWQfKbSkShCknk8kJBW","oCopmrru","Amk/CSkZ","W5NcH8oHWRy/W4pdPYTRstW","WRfaWPW2W5fqW7VcMmoAWRNdJ2JdLa","fXpcOKKJwCk4","W79FuCkDW4natgDu","BSkKWO8HrG","E8kdA8oQ","rSoBWPldQCk2","W4xdTKldRSk0qtxdNda","n8oMpZa","fmk7fIldVSk6xa","W6fNWP9FjN1PW4fm","fZSXW6C","mSoQo8o0AK0nirqVWRZcM8k8","WOhdH8k2vfK","WOldLZBcPa","WPageSkk","WO3dLYNcTSkAWQddPq","ESkuECoYWQzvma","WR7cKmo1B8kHvmoS","v8klW4vkceddLW","g8oKoa5/","D8kDW7rEoW","W6zqCCozWOu","WRSBbd3dLLlcG8oZAW","WO/dLmkGrgaNWP/cU8kDWRW","WOpcM8o+dLhdGCkxW4FdUmkT","Ax7cG8kfbq","vaxdKSoUxSkLpa","CXVcH0ygW5TyW7CXrmkPjSkX","WO7cImo5ogldISk0W5BdPCk0","vSk4lmkVjafH","r8kZlSkRnWr7rJW","WQDXWP/cNvldK8oz","W79DvSo9WOaKevLoc8k2sSkS","W4vVWPj+pq","lSk4W77cMmoNlmoRkSksCmkDemon","ysLbtq","vCkbW4OEjWanWPFdLSk6","nfXfhsW","mCoQkrHK","W7hdRLJcM8oNWQu2dSo0W4G","uddcUSkBnCkCWQNcGaj0fCkl","WQGibYu","wsVcPfK7","kXpcVcNdQujuWPddOa"];return en=function(){return e},en()}typeof globalThis!==qt(495,"EZ$X")||typeof window!==qt(508,"s9H7")||(typeof global<"u"?global:qt(470,"8b4z"));function di(e){var t=qt,n={KJdma:t(455,"!3M]")};return e&&e[t(491,"u%ck")]&&Object.prototype[t(500,"*eIr")+t(485,"GAiB")][t(489,"cx#%")](e,n.KJdma)?e[t(471,"LG7B")]:e}var Pn={exports:{}},yt={};var Zo;function hc(){if(Zo)return yt;Zo=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,r,i){var s=null;if(i!==void 0&&(s=""+i),r.key!==void 0&&(s=""+r.key),"key"in r){i={};for(var a in r)a!=="key"&&(i[a]=r[a])}else i=r;return r=i.ref,{$$typeof:e,type:o,key:s,ref:r!==void 0?r:null,props:i}}return yt.Fragment=t,yt.jsx=n,yt.jsxs=n,yt}var qo;function gc(){return qo||(qo=1,Pn.exports=hc()),Pn.exports}var $=gc(),$n={exports:{}},J={};var Go;function pc(){if(Go)return J;Go=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),f=Symbol.for("react.view_transition"),h=Symbol.iterator;function g(w){return w===null||typeof w!="object"?null:(w=h&&w[h]||w["@@iterator"],typeof w=="function"?w:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,y={};function E(w,T,F){this.props=w,this.context=T,this.refs=y,this.updater=F||m}E.prototype.isReactComponent={},E.prototype.setState=function(w,T){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,T,"setState")},E.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function p(){}p.prototype=E.prototype;function _(w,T,F){this.props=w,this.context=T,this.refs=y,this.updater=F||m}var N=_.prototype=new p;N.constructor=_,v(N,E.prototype),N.isPureReactComponent=!0;var S=Array.isArray;function C(){}var M={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function V(w,T,F){var B=F.ref;return{$$typeof:e,type:w,key:T,ref:B!==void 0?B:null,props:F}}function O(w,T){return V(w.type,T,w.props)}function j(w){return typeof w=="object"&&w!==null&&w.$$typeof===e}function z(w){var T={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(F){return T[F]})}var x=/\/+/g;function b(w,T){return typeof w=="object"&&w!==null&&w.key!=null?z(""+w.key):T.toString(36)}function k(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(C,C):(w.status="pending",w.then(function(T){w.status==="pending"&&(w.status="fulfilled",w.value=T)},function(T){w.status==="pending"&&(w.status="rejected",w.reason=T)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function I(w,T,F,B,A){var Y=typeof w;(Y==="undefined"||Y==="boolean")&&(w=null);var q=!1;if(w===null)q=!0;else switch(Y){case"bigint":case"string":case"number":q=!0;break;case"object":switch(w.$$typeof){case e:case t:q=!0;break;case u:return q=w._init,I(q(w._payload),T,F,B,A)}}if(q)return A=A(w),q=B===""?"."+b(w,0):B,S(A)?(F="",q!=null&&(F=q.replace(x,"$&/")+"/"),I(A,T,F,"",function(U){return U})):A!=null&&(j(A)&&(A=O(A,F+(A.key==null||w&&w.key===A.key?"":(""+A.key).replace(x,"$&/")+"/")+q)),T.push(A)),1;q=0;var G=B===""?".":B+":";if(S(w))for(var Z=0;Z<w.length;Z++)B=w[Z],Y=G+b(B,Z),q+=I(B,T,F,Y,A);else if(Z=g(w),typeof Z=="function")for(w=Z.call(w),Z=0;!(B=w.next()).done;)B=B.value,Y=G+b(B,Z++),q+=I(B,T,F,Y,A);else if(Y==="object"){if(typeof w.then=="function")return I(k(w),T,F,B,A);throw T=String(w),Error("Objects are not valid as a React child (found: "+(T==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":T)+"). If you meant to render a collection of children, use an array instead.")}return q}function P(w,T,F){if(w==null)return w;var B=[],A=0;return I(w,B,"","",function(Y){return T.call(F,Y,A++)}),B}function D(w){if(w._status===-1){var T=w._result,F=T();F.then(function(B){(w._status===0||w._status===-1)&&(w._status=1,w._result=B,F.status===void 0&&(F.status="fulfilled",F.value=B))},function(B){(w._status===0||w._status===-1)&&(w._status=2,w._result=B,F.status===void 0&&(F.status="rejected",F.reason=B))}),w._status===-1&&(w._status=0,w._result=F)}if(w._status===1)return w._result.default;throw w._result}var W=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var T=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(T))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)};function L(w){var T=M.T,F={};F.types=T!==null?T.types:null,M.T=F;try{var B=w(),A=M.S;A!==null&&A(F,B),typeof B=="object"&&B!==null&&typeof B.then=="function"&&B.then(C,W)}catch(Y){W(Y)}finally{T!==null&&F.types!==null&&(T.types=F.types),M.T=T}}function X(w){var T=M.T;if(T!==null){var F=T.types;F===null?T.types=[w]:F.indexOf(w)===-1&&F.push(w)}else L(X.bind(null,w))}var Q={map:P,forEach:function(w,T,F){P(w,function(){T.apply(this,arguments)},F)},count:function(w){var T=0;return P(w,function(){T++}),T},toArray:function(w){return P(w,function(T){return T})||[]},only:function(w){if(!j(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return J.Activity=c,J.Children=Q,J.Component=E,J.Fragment=n,J.Profiler=r,J.PureComponent=_,J.StrictMode=o,J.Suspense=d,J.ViewTransition=f,J.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,J.__COMPILER_RUNTIME={__proto__:null,c:function(w){return M.H.useMemoCache(w)}},J.addTransitionType=X,J.cache=function(w){return function(){return w.apply(null,arguments)}},J.cacheSignal=function(){return null},J.cloneElement=function(w,T,F){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var B=v({},w.props),A=w.key;if(T!=null)for(Y in T.key!==void 0&&(A=""+T.key),T)!R.call(T,Y)||Y==="key"||Y==="__self"||Y==="__source"||Y==="ref"&&T.ref===void 0||(B[Y]=T[Y]);var Y=arguments.length-2;if(Y===1)B.children=F;else if(1<Y){for(var q=Array(Y),G=0;G<Y;G++)q[G]=arguments[G+2];B.children=q}return V(w.type,A,B)},J.createContext=function(w){return w={$$typeof:s,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:i,_context:w},w},J.createElement=function(w,T,F){var B,A={},Y=null;if(T!=null)for(B in T.key!==void 0&&(Y=""+T.key),T)R.call(T,B)&&B!=="key"&&B!=="__self"&&B!=="__source"&&(A[B]=T[B]);var q=arguments.length-2;if(q===1)A.children=F;else if(1<q){for(var G=Array(q),Z=0;Z<q;Z++)G[Z]=arguments[Z+2];A.children=G}if(w&&w.defaultProps)for(B in q=w.defaultProps,q)A[B]===void 0&&(A[B]=q[B]);return V(w,Y,A)},J.createRef=function(){return{current:null}},J.forwardRef=function(w){return{$$typeof:a,render:w}},J.isValidElement=j,J.lazy=function(w){return{$$typeof:u,_payload:{_status:-1,_result:w},_init:D}},J.memo=function(w,T){return{$$typeof:l,type:w,compare:T===void 0?null:T}},J.startTransition=L,J.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},J.use=function(w){return M.H.use(w)},J.useActionState=function(w,T,F){return M.H.useActionState(w,T,F)},J.useCallback=function(w,T){return M.H.useCallback(w,T)},J.useContext=function(w){return M.H.useContext(w)},J.useDebugValue=function(){},J.useDeferredValue=function(w,T){return M.H.useDeferredValue(w,T)},J.useEffect=function(w,T){return M.H.useEffect(w,T)},J.useEffectEvent=function(w){return M.H.useEffectEvent(w)},J.useId=function(){return M.H.useId()},J.useImperativeHandle=function(w,T,F){return M.H.useImperativeHandle(w,T,F)},J.useInsertionEffect=function(w,T){return M.H.useInsertionEffect(w,T)},J.useLayoutEffect=function(w,T){return M.H.useLayoutEffect(w,T)},J.useMemo=function(w,T){return M.H.useMemo(w,T)},J.useOptimistic=function(w,T){return M.H.useOptimistic(w,T)},J.useReducer=function(w,T,F){return M.H.useReducer(w,T,F)},J.useRef=function(w){return M.H.useRef(w)},J.useState=function(w){return M.H.useState(w)},J.useSyncExternalStore=function(w,T,F){return M.H.useSyncExternalStore(w,T,F)},J.useTransition=function(){return M.H.useTransition()},J.version="19.3.1",J}var Uo;function pn(){return Uo||(Uo=1,$n.exports=pc()),$n.exports}var H=pn();const mc=di(H);var Dn={exports:{}},ue={};var Ko;function yc(){if(Ko)return ue;Ko=1;var e=pn();function t(u){var c="https://react.dev/errors/"+u;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+u+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var o={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal"),i=Symbol.for("react.recoverable"),s=Symbol.for("react.optimistic_key");function a(u,c,f){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:h==null?null:h===s?s:""+h,children:u,containerInfo:c,implementation:f}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,c){if(u==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return ue.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,ue.browser=function(u){return{$$typeof:i,_reason:u}},ue.createPortal=function(u,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(t(299));return a(u,c,null,f)},ue.flushSync=function(u){var c=d.T,f=o.p;try{if(d.T=null,o.p=2,u)return u()}finally{d.T=c,o.p=f,o.d.f()}},ue.preconnect=function(u,c){typeof u=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,o.d.C(u,c))},ue.prefetchDNS=function(u){typeof u=="string"&&o.d.D(u)},ue.preinit=function(u,c){if(typeof u=="string"&&c&&typeof c.as=="string"){var f=c.as,h=l(f,c.crossOrigin),g=typeof c.integrity=="string"?c.integrity:void 0,m=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;f==="style"?o.d.S(u,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:h,integrity:g,fetchPriority:m}):f==="script"&&o.d.X(u,{crossOrigin:h,integrity:g,fetchPriority:m,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},ue.preinitModule=function(u,c){if(typeof u=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var f=l(c.as,c.crossOrigin);o.d.M(u,{crossOrigin:f,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0})}}else c==null&&o.d.M(u)},ue.preload=function(u,c){if(typeof u=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var f=c.as,h=l(f,c.crossOrigin);o.d.L(u,f,{crossOrigin:h,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},ue.preloadModule=function(u,c){if(typeof u=="string")if(c){var f=l(c.as,c.crossOrigin);o.d.m(u,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:f,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0})}else o.d.m(u)},ue.requestFormReset=function(u){o.d.r(u)},ue.unstable_batchedUpdates=function(u,c){return u(c)},ue.useFormState=function(u,c,f){return d.H.useFormState(u,c,f)},ue.useFormStatus=function(){return d.H.useHostTransitionStatus()},ue.version="19.3.1",ue}var Qo;function xc(){if(Qo)return Dn.exports;Qo=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dn.exports=yc(),Dn.exports}function se(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=se(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var wc={value:()=>{}};function mn(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Gt(n)}function Gt(e){this._=e}function vc(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Gt.prototype=mn.prototype={constructor:Gt,on:function(e,t){var n=this._,o=vc(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=_c(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=Jo(n[r],e.name,t);else if(t==null)for(r in n)n[r]=Jo(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Gt(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function _c(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function Jo(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=wc,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var Jn="http://www.w3.org/1999/xhtml",er={svg:"http://www.w3.org/2000/svg",xhtml:Jn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function yn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),er.hasOwnProperty(t)?{space:er[t],local:e}:e}function Ec(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Jn&&t.documentElement.namespaceURI===Jn?t.createElement(e):t.createElementNS(n,e)}}function Sc(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function hi(e){var t=yn(e);return(t.local?Sc:Ec)(t)}function bc(){}function po(e){return e==null?bc:function(){return this.querySelector(e)}}function Cc(e){typeof e!="function"&&(e=po(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),d,l,u=0;u<s;++u)(d=i[u])&&(l=e.call(d,d.__data__,u,i))&&("__data__"in d&&(l.__data__=d.__data__),a[u]=l);return new fe(o,this._parents)}function Nc(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Mc(){return[]}function gi(e){return e==null?Mc:function(){return this.querySelectorAll(e)}}function kc(e){return function(){return Nc(e.apply(this,arguments))}}function Ic(e){typeof e=="function"?e=kc(e):e=gi(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,d,l=0;l<a;++l)(d=s[l])&&(o.push(e.call(d,d.__data__,l,s)),r.push(d));return new fe(o,r)}function pi(e){return function(){return this.matches(e)}}function mi(e){return function(t){return t.matches(e)}}var Ac=Array.prototype.find;function Rc(e){return function(){return Ac.call(this.children,e)}}function Tc(){return this.firstElementChild}function Pc(e){return this.select(e==null?Tc:Rc(typeof e=="function"?e:mi(e)))}var $c=Array.prototype.filter;function Dc(){return Array.from(this.children)}function Hc(e){return function(){return $c.call(this.children,e)}}function Oc(e){return this.selectAll(e==null?Dc:Hc(typeof e=="function"?e:mi(e)))}function zc(e){typeof e!="function"&&(e=pi(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],d,l=0;l<s;++l)(d=i[l])&&e.call(d,d.__data__,l,i)&&a.push(d);return new fe(o,this._parents)}function yi(e){return new Array(e.length)}function Lc(){return new fe(this._enter||this._groups.map(yi),this._parents)}function tn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}tn.prototype={constructor:tn,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 Wc(e){return function(){return e}}function Bc(e,t,n,o,r,i){for(var s=0,a,d=t.length,l=i.length;s<l;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new tn(e,i[s]);for(;s<d;++s)(a=t[s])&&(r[s]=a)}function Vc(e,t,n,o,r,i,s){var a,d,l=new Map,u=t.length,c=i.length,f=new Array(u),h;for(a=0;a<u;++a)(d=t[a])&&(f[a]=h=s.call(d,d.__data__,a,t)+"",l.has(h)?r[a]=d:l.set(h,d));for(a=0;a<c;++a)h=s.call(e,i[a],a,i)+"",(d=l.get(h))?(o[a]=d,d.__data__=i[a],l.delete(h)):n[a]=new tn(e,i[a]);for(a=0;a<u;++a)(d=t[a])&&l.get(f[a])===d&&(r[a]=d)}function jc(e){return e.__data__}function Fc(e,t){if(!arguments.length)return Array.from(this,jc);var n=t?Vc:Bc,o=this._parents,r=this._groups;typeof e!="function"&&(e=Wc(e));for(var i=r.length,s=new Array(i),a=new Array(i),d=new Array(i),l=0;l<i;++l){var u=o[l],c=r[l],f=c.length,h=Yc(e.call(u,u&&u.__data__,l,o)),g=h.length,m=a[l]=new Array(g),v=s[l]=new Array(g),y=d[l]=new Array(f);n(u,c,m,v,y,h,t);for(var E=0,p=0,_,N;E<g;++E)if(_=m[E]){for(E>=p&&(p=E+1);!(N=v[p])&&++p<g;);_._next=N||null}}return s=new fe(s,o),s._enter=a,s._exit=d,s}function Yc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Xc(){return new fe(this._exit||this._groups.map(yi),this._parents)}function Zc(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function qc(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),d=0;d<s;++d)for(var l=n[d],u=o[d],c=l.length,f=a[d]=new Array(c),h,g=0;g<c;++g)(h=l[g]||u[g])&&(f[g]=h);for(;d<r;++d)a[d]=n[d];return new fe(a,this._parents)}function Gc(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Uc(e){e||(e=Kc);function t(c,f){return c&&f?e(c.__data__,f.__data__):!c-!f}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,d=r[i]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(d[u]=l);d.sort(t)}return new fe(r,this._parents).order()}function Kc(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Qc(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Jc(){return Array.from(this)}function eu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function tu(){let e=0;for(const t of this)++e;return e}function nu(){return!this.node()}function ou(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function ru(e){return function(){this.removeAttribute(e)}}function iu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function su(e,t){return function(){this.setAttribute(e,t)}}function au(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function cu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function uu(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 lu(e,t){var n=yn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?iu:ru:typeof t=="function"?n.local?uu:cu:n.local?au:su)(n,t))}function xi(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function fu(e){return function(){this.style.removeProperty(e)}}function du(e,t,n){return function(){this.style.setProperty(e,t,n)}}function hu(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function gu(e,t,n){return arguments.length>1?this.each((t==null?fu:typeof t=="function"?hu:du)(e,t,n??"")):at(this.node(),e)}function at(e,t){return e.style.getPropertyValue(t)||xi(e).getComputedStyle(e,null).getPropertyValue(t)}function pu(e){return function(){delete this[e]}}function mu(e,t){return function(){this[e]=t}}function yu(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function xu(e,t){return arguments.length>1?this.each((t==null?pu:typeof t=="function"?yu:mu)(e,t)):this.node()[e]}function wi(e){return e.trim().split(/^|\s+/)}function mo(e){return e.classList||new vi(e)}function vi(e){this._node=e,this._names=wi(e.getAttribute("class")||"")}vi.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 _i(e,t){for(var n=mo(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Ei(e,t){for(var n=mo(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function wu(e){return function(){_i(this,e)}}function vu(e){return function(){Ei(this,e)}}function _u(e,t){return function(){(t.apply(this,arguments)?_i:Ei)(this,e)}}function Eu(e,t){var n=wi(e+"");if(arguments.length<2){for(var o=mo(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?_u:t?wu:vu)(n,t))}function Su(){this.textContent=""}function bu(e){return function(){this.textContent=e}}function Cu(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Nu(e){return arguments.length?this.each(e==null?Su:(typeof e=="function"?Cu:bu)(e)):this.node().textContent}function Mu(){this.innerHTML=""}function ku(e){return function(){this.innerHTML=e}}function Iu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Au(e){return arguments.length?this.each(e==null?Mu:(typeof e=="function"?Iu:ku)(e)):this.node().innerHTML}function Ru(){this.nextSibling&&this.parentNode.appendChild(this)}function Tu(){return this.each(Ru)}function Pu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $u(){return this.each(Pu)}function Du(e){var t=typeof e=="function"?e:hi(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Hu(){return null}function Ou(e,t){var n=typeof e=="function"?e:hi(e),o=t==null?Hu:typeof t=="function"?t:po(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function zu(){var e=this.parentNode;e&&e.removeChild(this)}function Lu(){return this.each(zu)}function Wu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Bu(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vu(e){return this.select(e?Bu:Wu)}function ju(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Fu(e){return function(t){e.call(this,t,this.__data__)}}function Yu(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function Xu(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function Zu(e,t,n){return function(){var o=this.__on,r,i=Fu(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function qu(e,t,n){var o=Yu(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var d=0,l=a.length,u;d<l;++d)for(r=0,u=a[d];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?Zu:Xu,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Si(e,t,n){var o=xi(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function Gu(e,t){return function(){return Si(this,e,t)}}function Uu(e,t){return function(){return Si(this,e,t.apply(this,arguments))}}function Ku(e,t){return this.each((typeof t=="function"?Uu:Gu)(e,t))}function*Qu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var bi=[null];function fe(e,t){this._groups=e,this._parents=t}function Pt(){return new fe([[document.documentElement]],bi)}function Ju(){return this}fe.prototype=Pt.prototype={constructor:fe,select:Cc,selectAll:Ic,selectChild:Pc,selectChildren:Oc,filter:zc,data:Fc,enter:Lc,exit:Xc,join:Zc,merge:qc,selection:Ju,order:Gc,sort:Uc,call:Qc,nodes:Jc,node:eu,size:tu,empty:nu,each:ou,attr:lu,style:gu,property:xu,classed:Eu,text:Nu,html:Au,raise:Tu,lower:$u,append:Du,insert:Ou,remove:Lu,clone:Vu,datum:ju,on:qu,dispatch:Ku,[Symbol.iterator]:Qu};function le(e){return typeof e=="string"?new fe([[document.querySelector(e)]],[document.documentElement]):new fe([[e]],bi)}var el=0;function tr(){this._="@"+(++el).toString(36)}tr.prototype={constructor:tr,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function tl(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ge(e,t){if(e=tl(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const nl={passive:!1},bt={capture:!0,passive:!1};function Hn(e){e.stopImmediatePropagation()}function ot(e){e.preventDefault(),e.stopImmediatePropagation()}function Ci(e){var t=e.document.documentElement,n=le(e).on("dragstart.drag",ot,bt);"onselectstart"in t?n.on("selectstart.drag",ot,bt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Ni(e,t){var n=e.document.documentElement,o=le(e).on("dragstart.drag",null);t&&(o.on("click.drag",ot,bt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Lt=e=>()=>e;function eo(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:d,dy:l,dispatch:u}){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:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}eo.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ol(e){return!e.ctrlKey&&!e.button}function rl(){return this.parentNode}function il(e,t){return t??{x:e.x,y:e.y}}function sl(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mi(){var e=ol,t=rl,n=il,o=sl,r={},i=mn("start","drag","end"),s=0,a,d,l,u,c=0;function f(_){_.on("mousedown.drag",h).filter(o).on("touchstart.drag",v).on("touchmove.drag",y,nl).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(_,N){if(!(u||!e.call(this,_,N))){var S=p(this,t.call(this,_,N),_,N,"mouse");S&&(le(_.view).on("mousemove.drag",g,bt).on("mouseup.drag",m,bt),Ci(_.view),Hn(_),l=!1,a=_.clientX,d=_.clientY,S("start",_))}}function g(_){if(ot(_),!l){var N=_.clientX-a,S=_.clientY-d;l=N*N+S*S>c}r.mouse("drag",_)}function m(_){le(_.view).on("mousemove.drag mouseup.drag",null),Ni(_.view,l),ot(_),r.mouse("end",_)}function v(_,N){if(e.call(this,_,N)){var S=_.changedTouches,C=t.call(this,_,N),M=S.length,R,V;for(R=0;R<M;++R)(V=p(this,C,_,N,S[R].identifier,S[R]))&&(Hn(_),V("start",_,S[R]))}}function y(_){var N=_.changedTouches,S=N.length,C,M;for(C=0;C<S;++C)(M=r[N[C].identifier])&&(ot(_),M("drag",_,N[C]))}function E(_){var N=_.changedTouches,S=N.length,C,M;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),C=0;C<S;++C)(M=r[N[C].identifier])&&(Hn(_),M("end",_,N[C]))}function p(_,N,S,C,M,R){var V=i.copy(),O=ge(R||S,N),j,z,x;if((x=n.call(_,new eo("beforestart",{sourceEvent:S,target:f,identifier:M,active:s,x:O[0],y:O[1],dx:0,dy:0,dispatch:V}),C))!=null)return j=x.x-O[0]||0,z=x.y-O[1]||0,function b(k,I,P){var D=O,W;switch(k){case"start":r[M]=b,W=s++;break;case"end":delete r[M],--s;case"drag":O=ge(P||I,N),W=s;break}V.call(k,_,new eo(k,{sourceEvent:I,subject:x,target:f,identifier:M,active:W,x:O[0]+j,y:O[1]+z,dx:O[0]-D[0],dy:O[1]-D[1],dispatch:V}),C)}}return f.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Lt(!!_),f):e},f.container=function(_){return arguments.length?(t=typeof _=="function"?_:Lt(_),f):t},f.subject=function(_){return arguments.length?(n=typeof _=="function"?_:Lt(_),f):n},f.touchable=function(_){return arguments.length?(o=typeof _=="function"?_:Lt(!!_),f):o},f.on=function(){var _=i.on.apply(i,arguments);return _===i?f:_},f.clickDistance=function(_){return arguments.length?(c=(_=+_)*_,f):Math.sqrt(c)},f}function pt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $t(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function We(){}var Ge=.7,ct=1/Ge,rt="\\s*([+-]?\\d+)\\s*",Ct="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",be="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",al=/^#([0-9a-f]{3,8})$/,cl=new RegExp(`^rgb\\(${rt},${rt},${rt}\\)$`),ul=new RegExp(`^rgb\\(${be},${be},${be}\\)$`),ll=new RegExp(`^rgba\\(${rt},${rt},${rt},${Ct}\\)$`),fl=new RegExp(`^rgba\\(${be},${be},${be},${Ct}\\)$`),dl=new RegExp(`^hsl\\(${Ct},${be},${be}\\)$`),hl=new RegExp(`^hsla\\(${Ct},${be},${be},${Ct}\\)$`),nr={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};pt(We,Ue,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:or,formatHex:or,formatHex8:gl,formatHsl:pl,formatRgb:rr,toString:rr});function or(){return this.rgb().formatHex()}function gl(){return this.rgb().formatHex8()}function pl(){return ki(this).formatHsl()}function rr(){return this.rgb().formatRgb()}function Ue(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=al.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?ir(t):n===3?new ae(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Wt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Wt(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=cl.exec(e))?new ae(t[1],t[2],t[3],1):(t=ul.exec(e))?new ae(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ll.exec(e))?Wt(t[1],t[2],t[3],t[4]):(t=fl.exec(e))?Wt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dl.exec(e))?cr(t[1],t[2]/100,t[3]/100,1):(t=hl.exec(e))?cr(t[1],t[2]/100,t[3]/100,t[4]):nr.hasOwnProperty(e)?ir(nr[e]):e==="transparent"?new ae(NaN,NaN,NaN,0):null}function ir(e){return new ae(e>>16&255,e>>8&255,e&255,1)}function Wt(e,t,n,o){return o<=0&&(e=t=n=NaN),new ae(e,t,n,o)}function yo(e){return e instanceof We||(e=Ue(e)),e?(e=e.rgb(),new ae(e.r,e.g,e.b,e.opacity)):new ae}function to(e,t,n,o){return arguments.length===1?yo(e):new ae(e,t,n,o??1)}function ae(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}pt(ae,to,$t(We,{brighter(e){return e=e==null?ct:Math.pow(ct,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ge:Math.pow(Ge,e),new ae(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ae(Xe(this.r),Xe(this.g),Xe(this.b),nn(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:sr,formatHex:sr,formatHex8:ml,formatRgb:ar,toString:ar}));function sr(){return`#${Ye(this.r)}${Ye(this.g)}${Ye(this.b)}`}function ml(){return`#${Ye(this.r)}${Ye(this.g)}${Ye(this.b)}${Ye((isNaN(this.opacity)?1:this.opacity)*255)}`}function ar(){const e=nn(this.opacity);return`${e===1?"rgb(":"rgba("}${Xe(this.r)}, ${Xe(this.g)}, ${Xe(this.b)}${e===1?")":`, ${e})`}`}function nn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ye(e){return e=Xe(e),(e<16?"0":"")+e.toString(16)}function cr(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pe(e,t,n,o)}function ki(e){if(e instanceof pe)return new pe(e.h,e.s,e.l,e.opacity);if(e instanceof We||(e=Ue(e)),!e)return new pe;if(e instanceof pe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,d=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=d<.5?i+r:2-i-r,s*=60):a=d>0&&d<1?0:s,new pe(s,a,d,e.opacity)}function yl(e,t,n,o){return arguments.length===1?ki(e):new pe(e,t,n,o??1)}function pe(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}pt(pe,yl,$t(We,{brighter(e){return e=e==null?ct:Math.pow(ct,e),new pe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ge:Math.pow(Ge,e),new pe(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,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new ae(On(e>=240?e-240:e+120,r,o),On(e,r,o),On(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new pe(ur(this.h),Bt(this.s),Bt(this.l),nn(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=nn(this.opacity);return`${e===1?"hsl(":"hsla("}${ur(this.h)}, ${Bt(this.s)*100}%, ${Bt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ur(e){return e=(e||0)%360,e<0?e+360:e}function Bt(e){return Math.max(0,Math.min(1,e||0))}function On(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 Ii=Math.PI/180,Ai=180/Math.PI,on=18,Ri=.96422,Ti=1,Pi=.82521,$i=4/29,it=6/29,Di=3*it*it,xl=it*it*it;function Hi(e){if(e instanceof Ce)return new Ce(e.l,e.a,e.b,e.opacity);if(e instanceof Te)return Oi(e);e instanceof ae||(e=yo(e));var t=Bn(e.r),n=Bn(e.g),o=Bn(e.b),r=zn((.2225045*t+.7168786*n+.0606169*o)/Ti),i,s;return t===n&&n===o?i=s=r:(i=zn((.4360747*t+.3850649*n+.1430804*o)/Ri),s=zn((.0139322*t+.0971045*n+.7141733*o)/Pi)),new Ce(116*r-16,500*(i-r),200*(r-s),e.opacity)}function wl(e,t,n,o){return arguments.length===1?Hi(e):new Ce(e,t,n,o??1)}function Ce(e,t,n,o){this.l=+e,this.a=+t,this.b=+n,this.opacity=+o}pt(Ce,wl,$t(We,{brighter(e){return new Ce(this.l+on*(e??1),this.a,this.b,this.opacity)},darker(e){return new Ce(this.l-on*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=Ri*Ln(t),e=Ti*Ln(e),n=Pi*Ln(n),new ae(Wn(3.1338561*t-1.6168667*e-.4906146*n),Wn(-.9787684*t+1.9161415*e+.033454*n),Wn(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function zn(e){return e>xl?Math.pow(e,1/3):e/Di+$i}function Ln(e){return e>it?e*e*e:Di*(e-$i)}function Wn(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Bn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function vl(e){if(e instanceof Te)return new Te(e.h,e.c,e.l,e.opacity);if(e instanceof Ce||(e=Hi(e)),e.a===0&&e.b===0)return new Te(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ai;return new Te(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function _l(e,t,n,o){return arguments.length===1?vl(e):new Te(e,t,n,o??1)}function Te(e,t,n,o){this.h=+e,this.c=+t,this.l=+n,this.opacity=+o}function Oi(e){if(isNaN(e.h))return new Ce(e.l,0,0,e.opacity);var t=e.h*Ii;return new Ce(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}pt(Te,_l,$t(We,{brighter(e){return new Te(this.h,this.c,this.l+on*(e??1),this.opacity)},darker(e){return new Te(this.h,this.c,this.l-on*(e??1),this.opacity)},rgb(){return Oi(this).rgb()}}));var zi=-.14861,xo=1.78277,wo=-.29227,xn=-.90649,Nt=1.97294,lr=Nt*xn,fr=Nt*xo,dr=xo*wo-xn*zi;function El(e){if(e instanceof Ze)return new Ze(e.h,e.s,e.l,e.opacity);e instanceof ae||(e=yo(e));var t=e.r/255,n=e.g/255,o=e.b/255,r=(dr*o+lr*t-fr*n)/(dr+lr-fr),i=o-r,s=(Nt*(n-r)-wo*i)/xn,a=Math.sqrt(s*s+i*i)/(Nt*r*(1-r)),d=a?Math.atan2(s,i)*Ai-120:NaN;return new Ze(d<0?d+360:d,a,r,e.opacity)}function no(e,t,n,o){return arguments.length===1?El(e):new Ze(e,t,n,o??1)}function Ze(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}pt(Ze,no,$t(We,{brighter(e){return e=e==null?ct:Math.pow(ct,e),new Ze(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ge:Math.pow(Ge,e),new Ze(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Ii,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),o=Math.cos(e),r=Math.sin(e);return new ae(255*(t+n*(zi*o+xo*r)),255*(t+n*(wo*o+xn*r)),255*(t+n*(Nt*o)),this.opacity)}}));var wn=e=>()=>e;function Li(e,t){return function(n){return e+n*t}}function Sl(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function bl(e,t){var n=t-e;return n?Li(e,n>180||n<-180?n-360*Math.round(n/360):n):wn(isNaN(e)?t:e)}function Cl(e){return(e=+e)==1?st:function(t,n){return n-t?Sl(t,n,e):wn(isNaN(t)?n:t)}}function st(e,t){var n=t-e;return n?Li(e,n):wn(isNaN(e)?t:e)}var rn=(function e(t){var n=Cl(t);function o(r,i){var s=n((r=to(r)).r,(i=to(i)).r),a=n(r.g,i.g),d=n(r.b,i.b),l=st(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=d(u),r.opacity=l(u),r+""}}return o.gamma=e,o})(1);function Nl(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function Ml(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kl(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=Et(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function Il(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Se(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Al(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=Et(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var oo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Vn=new RegExp(oo.source,"g");function Rl(e){return function(){return e}}function Tl(e){return function(t){return e(t)+""}}function Wi(e,t){var n=oo.lastIndex=Vn.lastIndex=0,o,r,i,s=-1,a=[],d=[];for(e=e+"",t=t+"";(o=oo.exec(e))&&(r=Vn.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,d.push({i:s,x:Se(o,r)})),n=Vn.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?d[0]?Tl(d[0].x):Rl(t):(t=d.length,function(l){for(var u=0,c;u<t;++u)a[(c=d[u]).i]=c.x(l);return a.join("")})}function Et(e,t){var n=typeof t,o;return t==null||n==="boolean"?wn(t):(n==="number"?Se:n==="string"?(o=Ue(t))?(t=o,rn):Wi:t instanceof Ue?rn:t instanceof Date?Il:Ml(t)?Nl:Array.isArray(t)?kl:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Al:Se)(e,t)}var hr=180/Math.PI,ro={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Bi(e,t,n,o,r,i){var s,a,d;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(d=e*n+t*o)&&(n-=e*d,o-=t*d),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,d/=a),e*o<t*n&&(e=-e,t=-t,d=-d,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*hr,skewX:Math.atan(d)*hr,scaleX:s,scaleY:a}}var Vt;function Pl(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ro:Bi(t.a,t.b,t.c,t.d,t.e,t.f)}function $l(e){return e==null||(Vt||(Vt=document.createElementNS("http://www.w3.org/2000/svg","g")),Vt.setAttribute("transform",e),!(e=Vt.transform.baseVal.consolidate()))?ro:(e=e.matrix,Bi(e.a,e.b,e.c,e.d,e.e,e.f))}function Vi(e,t,n,o){function r(l){return l.length?l.pop()+" ":""}function i(l,u,c,f,h,g){if(l!==c||u!==f){var m=h.push("translate(",null,t,null,n);g.push({i:m-4,x:Se(l,c)},{i:m-2,x:Se(u,f)})}else(c||f)&&h.push("translate("+c+t+f+n)}function s(l,u,c,f){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),f.push({i:c.push(r(c)+"rotate(",null,o)-2,x:Se(l,u)})):u&&c.push(r(c)+"rotate("+u+o)}function a(l,u,c,f){l!==u?f.push({i:c.push(r(c)+"skewX(",null,o)-2,x:Se(l,u)}):u&&c.push(r(c)+"skewX("+u+o)}function d(l,u,c,f,h,g){if(l!==c||u!==f){var m=h.push(r(h)+"scale(",null,",",null,")");g.push({i:m-4,x:Se(l,c)},{i:m-2,x:Se(u,f)})}else(c!==1||f!==1)&&h.push(r(h)+"scale("+c+","+f+")")}return function(l,u){var c=[],f=[];return l=e(l),u=e(u),i(l.translateX,l.translateY,u.translateX,u.translateY,c,f),s(l.rotate,u.rotate,c,f),a(l.skewX,u.skewX,c,f),d(l.scaleX,l.scaleY,u.scaleX,u.scaleY,c,f),l=u=null,function(h){for(var g=-1,m=f.length,v;++g<m;)c[(v=f[g]).i]=v.x(h);return c.join("")}}}var Dl=Vi(Pl,"px, ","px)","deg)"),Hl=Vi($l,", ",")",")"),Ol=1e-12;function gr(e){return((e=Math.exp(e))+1/e)/2}function zl(e){return((e=Math.exp(e))-1/e)/2}function Ll(e){return((e=Math.exp(2*e))-1)/(e+1)}var Ut=(function e(t,n,o){function r(i,s){var a=i[0],d=i[1],l=i[2],u=s[0],c=s[1],f=s[2],h=u-a,g=c-d,m=h*h+g*g,v,y;if(m<Ol)y=Math.log(f/l)/t,v=function(C){return[a+C*h,d+C*g,l*Math.exp(t*C*y)]};else{var E=Math.sqrt(m),p=(f*f-l*l+o*m)/(2*l*n*E),_=(f*f-l*l-o*m)/(2*f*n*E),N=Math.log(Math.sqrt(p*p+1)-p),S=Math.log(Math.sqrt(_*_+1)-_);y=(S-N)/t,v=function(C){var M=C*y,R=gr(N),V=l/(n*E)*(R*Ll(t*M+N)-zl(N));return[a+V*h,d+V*g,l*R/gr(t*M+N)]}}return v.duration=Math.abs(y)*1e3*t/Math.SQRT2,v}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,d=a*a;return e(s,a,d)},r})(Math.SQRT2,2,4);function ji(e){return(function t(n){n=+n;function o(r,i){var s=e((r=no(r)).h,(i=no(i)).h),a=st(r.s,i.s),d=st(r.l,i.l),l=st(r.opacity,i.opacity);return function(u){return r.h=s(u),r.s=a(u),r.l=d(Math.pow(u,n)),r.opacity=l(u),r+""}}return o.gamma=t,o})(1)}ji(bl);ji(st);var ut=0,vt=0,xt=0,Fi=1e3,sn,_t,an=0,Ke=0,vn=0,Mt=typeof performance=="object"&&performance.now?performance:Date,Yi=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function vo(){return Ke||(Yi(Wl),Ke=Mt.now()+vn)}function Wl(){Ke=0}function cn(){this._call=this._time=this._next=null}cn.prototype=Xi.prototype={constructor:cn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?vo():+n)+(t==null?0:+t),!this._next&&_t!==this&&(_t?_t._next=this:sn=this,_t=this),this._call=e,this._time=n,io()},stop:function(){this._call&&(this._call=null,this._time=1/0,io())}};function Xi(e,t,n){var o=new cn;return o.restart(e,t,n),o}function Bl(){vo(),++ut;for(var e=sn,t;e;)(t=Ke-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ut}function pr(){Ke=(an=Mt.now())+vn,ut=vt=0;try{Bl()}finally{ut=0,jl(),Ke=0}}function Vl(){var e=Mt.now(),t=e-an;t>Fi&&(vn-=t,an=e)}function jl(){for(var e,t=sn,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:sn=n);_t=e,io(o)}function io(e){if(!ut){vt&&(vt=clearTimeout(vt));var t=e-Ke;t>24?(e<1/0&&(vt=setTimeout(pr,Math.ceil(e-Mt.now()-vn)+1)),xt&&(xt=clearInterval(xt))):(xt||(an=Mt.now(),xt=setInterval(Vl,Fi)),ut=1,Yi(pr))}}function mr(e,t,n){var o=new cn;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}function Fl(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var _o=3;(function e(t){t=+t;function n(o){return Math.pow(o,t)}return n.exponent=e,n})(_o);(function e(t){t=+t;function n(o){return 1-Math.pow(1-o,t)}return n.exponent=e,n})(_o);(function e(t){t=+t;function n(o){return((o*=2)<=1?Math.pow(o,t):2-Math.pow(2-o,t))/2}return n.exponent=e,n})(_o);function un(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}var Eo=1.70158;(function e(t){t=+t;function n(o){return(o=+o)*o*(t*(o-1)+o)}return n.overshoot=e,n})(Eo);(function e(t){t=+t;function n(o){return--o*o*((o+1)*t+o)+1}return n.overshoot=e,n})(Eo);(function e(t){t=+t;function n(o){return((o*=2)<1?o*o*((t+1)*o-t):(o-=2)*o*((t+1)*o+t)+2)/2}return n.overshoot=e,n})(Eo);var lt=2*Math.PI,So=1,bo=.3;(function e(t,n){var o=Math.asin(1/(t=Math.max(1,t)))*(n/=lt);function r(i){return t*un(- --i)*Math.sin((o-i)/n)}return r.amplitude=function(i){return e(i,n*lt)},r.period=function(i){return e(t,i)},r})(So,bo);(function e(t,n){var o=Math.asin(1/(t=Math.max(1,t)))*(n/=lt);function r(i){return 1-t*un(i=+i)*Math.sin((i+o)/n)}return r.amplitude=function(i){return e(i,n*lt)},r.period=function(i){return e(t,i)},r})(So,bo);(function e(t,n){var o=Math.asin(1/(t=Math.max(1,t)))*(n/=lt);function r(i){return((i=i*2-1)<0?t*un(-i)*Math.sin((o-i)/n):2-t*un(i)*Math.sin((o+i)/n))/2}return r.amplitude=function(i){return e(i,n*lt)},r.period=function(i){return e(t,i)},r})(So,bo);var Yl=mn("start","end","cancel","interrupt"),Xl=[],Zi=0,yr=1,so=2,Kt=3,xr=4,ao=5,Qt=6;function _n(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Zl(e,n,{name:t,index:o,group:r,on:Yl,tween:Xl,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Zi})}function Co(e,t){var n=we(e,t);if(n.state>Zi)throw new Error("too late; already scheduled");return n}function Ne(e,t){var n=we(e,t);if(n.state>Kt)throw new Error("too late; already running");return n}function we(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Zl(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Xi(i,0,n.time);function i(l){n.state=yr,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,c,f,h;if(n.state!==yr)return d();for(u in o)if(h=o[u],h.name===n.name){if(h.state===Kt)return mr(s);h.state===xr?(h.state=Qt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[u]):+u<t&&(h.state=Qt,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[u])}if(mr(function(){n.state===Kt&&(n.state=xr,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=so,n.on.call("start",e,e.__data__,n.index,n.group),n.state===so){for(n.state=Kt,r=new Array(f=n.tween.length),u=0,c=-1;u<f;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++c]=h);r.length=c+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(d),n.state=ao,1),c=-1,f=r.length;++c<f;)r[c].call(e,u);n.state===ao&&(n.on.call("end",e,e.__data__,n.index,n.group),d())}function d(){n.state=Qt,n.timer.stop(),delete o[t];for(var l in o)return;delete e.__transition}}function Jt(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>so&&o.state<ao,o.state=Qt,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function ql(e){return this.each(function(){Jt(this,e)})}function Gl(e,t){var n,o;return function(){var r=Ne(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function Ul(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=Ne(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},d=0,l=r.length;d<l;++d)if(r[d].name===t){r[d]=a;break}d===l&&r.push(a)}i.tween=r}}function Kl(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=we(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?Gl:Ul)(n,e,t))}function No(e,t,n){var o=e._id;return e.each(function(){var r=Ne(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return we(r,o).value[t]}}function qi(e,t){var n;return(typeof t=="number"?Se:t instanceof Ue?rn:(n=Ue(t))?(t=n,rn):Wi)(e,t)}function Ql(e){return function(){this.removeAttribute(e)}}function Jl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ef(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function tf(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function nf(e,t,n){var o,r,i;return function(){var s,a=n(this),d;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),d=a+"",s===d?null:s===o&&d===r?i:(r=d,i=t(o=s,a)))}}function of(e,t,n){var o,r,i;return function(){var s,a=n(this),d;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),d=a+"",s===d?null:s===o&&d===r?i:(r=d,i=t(o=s,a)))}}function rf(e,t){var n=yn(e),o=n==="transform"?Hl:qi;return this.attrTween(e,typeof t=="function"?(n.local?of:nf)(n,o,No(this,"attr."+e,t)):t==null?(n.local?Jl:Ql)(n):(n.local?tf:ef)(n,o,t))}function sf(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function af(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function cf(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&af(e,i)),n}return r._value=t,r}function uf(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&sf(e,i)),n}return r._value=t,r}function lf(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 o=yn(e);return this.tween(n,(o.local?cf:uf)(o,t))}function ff(e,t){return function(){Co(this,e).delay=+t.apply(this,arguments)}}function df(e,t){return t=+t,function(){Co(this,e).delay=t}}function hf(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?ff:df)(t,e)):we(this.node(),t).delay}function gf(e,t){return function(){Ne(this,e).duration=+t.apply(this,arguments)}}function pf(e,t){return t=+t,function(){Ne(this,e).duration=t}}function mf(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?gf:pf)(t,e)):we(this.node(),t).duration}function yf(e,t){if(typeof t!="function")throw new Error;return function(){Ne(this,e).ease=t}}function xf(e){var t=this._id;return arguments.length?this.each(yf(t,e)):we(this.node(),t).ease}function wf(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ne(this,e).ease=n}}function vf(e){if(typeof e!="function")throw new Error;return this.each(wf(this._id,e))}function _f(e){typeof e!="function"&&(e=pi(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],d,l=0;l<s;++l)(d=i[l])&&e.call(d,d.__data__,l,i)&&a.push(d);return new $e(o,this._parents,this._name,this._id)}function Ef(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var d=t[a],l=n[a],u=d.length,c=s[a]=new Array(u),f,h=0;h<u;++h)(f=d[h]||l[h])&&(c[h]=f);for(;a<o;++a)s[a]=t[a];return new $e(s,this._parents,this._name,this._id)}function Sf(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 bf(e,t,n){var o,r,i=Sf(t)?Co:Ne;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function Cf(e,t){var n=this._id;return arguments.length<2?we(this.node(),n).on.on(e):this.each(bf(n,e,t))}function Nf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Mf(){return this.on("end.remove",Nf(this._id))}function kf(e){var t=this._name,n=this._id;typeof e!="function"&&(e=po(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],d=a.length,l=i[s]=new Array(d),u,c,f=0;f<d;++f)(u=a[f])&&(c=e.call(u,u.__data__,f,a))&&("__data__"in u&&(c.__data__=u.__data__),l[f]=c,_n(l[f],t,n,f,l,we(u,n)));return new $e(i,this._parents,t,n)}function If(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gi(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var d=o[a],l=d.length,u,c=0;c<l;++c)if(u=d[c]){for(var f=e.call(u,u.__data__,c,d),h,g=we(u,n),m=0,v=f.length;m<v;++m)(h=f[m])&&_n(h,t,n,m,f,g);i.push(f),s.push(u)}return new $e(i,s,t,n)}var Af=Pt.prototype.constructor;function Rf(){return new Af(this._groups,this._parents)}function Tf(e,t){var n,o,r;return function(){var i=at(this,e),s=(this.style.removeProperty(e),at(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function Gi(e){return function(){this.style.removeProperty(e)}}function Pf(e,t,n){var o,r=n+"",i;return function(){var s=at(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function $f(e,t,n){var o,r,i;return function(){var s=at(this,e),a=n(this),d=a+"";return a==null&&(d=a=(this.style.removeProperty(e),at(this,e))),s===d?null:s===o&&d===r?i:(r=d,i=t(o=s,a))}}function Df(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var d=Ne(this,e),l=d.on,u=d.value[i]==null?a||(a=Gi(t)):void 0;(l!==n||r!==u)&&(o=(n=l).copy()).on(s,r=u),d.on=o}}function Hf(e,t,n){var o=(e+="")=="transform"?Dl:qi;return t==null?this.styleTween(e,Tf(e,o)).on("end.style."+e,Gi(e)):typeof t=="function"?this.styleTween(e,$f(e,o,No(this,"style."+e,t))).each(Df(this._id,e)):this.styleTween(e,Pf(e,o,t),n).on("end.style."+e,null)}function Of(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function zf(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&Of(e,s,n)),o}return i._value=t,i}function Lf(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,zf(e,t,n??""))}function Wf(e){return function(){this.textContent=e}}function Bf(e){return function(){var t=e(this);this.textContent=t??""}}function Vf(e){return this.tween("text",typeof e=="function"?Bf(No(this,"text",e)):Wf(e==null?"":e+""))}function jf(e){return function(t){this.textContent=e.call(this,t)}}function Ff(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&jf(r)),t}return o._value=e,o}function Yf(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,Ff(e))}function Xf(){for(var e=this._name,t=this._id,n=Ui(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,d,l=0;l<a;++l)if(d=s[l]){var u=we(d,t);_n(d,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new $e(o,this._parents,e,n)}function Zf(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},d={value:function(){--r===0&&i()}};n.each(function(){var l=Ne(this,o),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(d)),l.on=t}),r===0&&i()})}var qf=0;function $e(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function Ui(){return++qf}var Re=Pt.prototype;$e.prototype={constructor:$e,select:kf,selectAll:If,selectChild:Re.selectChild,selectChildren:Re.selectChildren,filter:_f,merge:Ef,selection:Rf,transition:Xf,call:Re.call,nodes:Re.nodes,node:Re.node,size:Re.size,empty:Re.empty,each:Re.each,on:Cf,attr:rf,attrTween:lf,style:Hf,styleTween:Lf,text:Vf,textTween:Yf,remove:Mf,tween:Kl,delay:hf,duration:mf,ease:xf,easeVarying:vf,end:Zf,[Symbol.iterator]:Re[Symbol.iterator]};var Gf={time:null,delay:0,duration:250,ease:Fl};function Uf(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 Kf(e){var t,n;e instanceof $e?(t=e._id,e=e._name):(t=Ui(),(n=Gf).time=vo(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,d,l=0;l<a;++l)(d=s[l])&&_n(d,e,t,l,s,n||Uf(d,t));return new $e(o,this._parents,e,t)}Pt.prototype.interrupt=ql;Pt.prototype.transition=Kf;var jt=e=>()=>e;function Qf(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){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:o,enumerable:!0,configurable:!0},_:{value:r}})}function Pe(e,t,n){this.k=e,this.x=t,this.y=n}Pe.prototype={constructor:Pe,scale:function(e){return e===1?this:new Pe(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Pe(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 En=new Pe(1,0,0);Ki.prototype=Pe.prototype;function Ki(e){for(;!e.__zoom;)if(!(e=e.parentNode))return En;return e.__zoom}function jn(e){e.stopImmediatePropagation()}function wt(e){e.preventDefault(),e.stopImmediatePropagation()}function Jf(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ed(){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 wr(){return this.__zoom||En}function td(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function nd(){return navigator.maxTouchPoints||"ontouchstart"in this}function od(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Qi(){var e=Jf,t=ed,n=od,o=td,r=nd,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,d=Ut,l=mn("start","zoom","end"),u,c,f,h=500,g=150,m=0,v=10;function y(x){x.property("__zoom",wr).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",O).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(x,b,k,I){var P=x.selection?x.selection():x;P.property("__zoom",wr),x!==P?N(x,b,k,I):P.interrupt().each(function(){S(this,arguments).event(I).start().zoom(null,typeof b=="function"?b.apply(this,arguments):b).end()})},y.scaleBy=function(x,b,k,I){y.scaleTo(x,function(){var P=this.__zoom.k,D=typeof b=="function"?b.apply(this,arguments):b;return P*D},k,I)},y.scaleTo=function(x,b,k,I){y.transform(x,function(){var P=t.apply(this,arguments),D=this.__zoom,W=k==null?_(P):typeof k=="function"?k.apply(this,arguments):k,L=D.invert(W),X=typeof b=="function"?b.apply(this,arguments):b;return n(p(E(D,X),W,L),P,s)},k,I)},y.translateBy=function(x,b,k,I){y.transform(x,function(){return n(this.__zoom.translate(typeof b=="function"?b.apply(this,arguments):b,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),s)},null,I)},y.translateTo=function(x,b,k,I,P){y.transform(x,function(){var D=t.apply(this,arguments),W=this.__zoom,L=I==null?_(D):typeof I=="function"?I.apply(this,arguments):I;return n(En.translate(L[0],L[1]).scale(W.k).translate(typeof b=="function"?-b.apply(this,arguments):-b,typeof k=="function"?-k.apply(this,arguments):-k),D,s)},I,P)};function E(x,b){return b=Math.max(i[0],Math.min(i[1],b)),b===x.k?x:new Pe(b,x.x,x.y)}function p(x,b,k){var I=b[0]-k[0]*x.k,P=b[1]-k[1]*x.k;return I===x.x&&P===x.y?x:new Pe(x.k,I,P)}function _(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}function N(x,b,k,I){x.on("start.zoom",function(){S(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(I).end()}).tween("zoom",function(){var P=this,D=arguments,W=S(P,D).event(I),L=t.apply(P,D),X=k==null?_(L):typeof k=="function"?k.apply(P,D):k,Q=Math.max(L[1][0]-L[0][0],L[1][1]-L[0][1]),w=P.__zoom,T=typeof b=="function"?b.apply(P,D):b,F=d(w.invert(X).concat(Q/w.k),T.invert(X).concat(Q/T.k));return function(B){if(B===1)B=T;else{var A=F(B),Y=Q/A[2];B=new Pe(Y,X[0]-A[0]*Y,X[1]-A[1]*Y)}W.zoom(null,B)}})}function S(x,b,k){return!k&&x.__zooming||new C(x,b)}function C(x,b){this.that=x,this.args=b,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,b),this.taps=0}C.prototype={event:function(x){return x&&(this.sourceEvent=x),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(x,b){return this.mouse&&x!=="mouse"&&(this.mouse[1]=b.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=b.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=b.invert(this.touch1[0])),this.that.__zoom=b,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(x){var b=le(this.that).datum();l.call(x,this.that,new Qf(x,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:l}),b)}};function M(x,...b){if(!e.apply(this,arguments))return;var k=S(this,b).event(x),I=this.__zoom,P=Math.max(i[0],Math.min(i[1],I.k*Math.pow(2,o.apply(this,arguments)))),D=ge(x);if(k.wheel)(k.mouse[0][0]!==D[0]||k.mouse[0][1]!==D[1])&&(k.mouse[1]=I.invert(k.mouse[0]=D)),clearTimeout(k.wheel);else{if(I.k===P)return;k.mouse=[D,I.invert(D)],Jt(this),k.start()}wt(x),k.wheel=setTimeout(W,g),k.zoom("mouse",n(p(E(I,P),k.mouse[0],k.mouse[1]),k.extent,s));function W(){k.wheel=null,k.end()}}function R(x,...b){if(f||!e.apply(this,arguments))return;var k=x.currentTarget,I=S(this,b,!0).event(x),P=le(x.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",Q,!0),D=ge(x,k),W=x.clientX,L=x.clientY;Ci(x.view),jn(x),I.mouse=[D,this.__zoom.invert(D)],Jt(this),I.start();function X(w){if(wt(w),!I.moved){var T=w.clientX-W,F=w.clientY-L;I.moved=T*T+F*F>m}I.event(w).zoom("mouse",n(p(I.that.__zoom,I.mouse[0]=ge(w,k),I.mouse[1]),I.extent,s))}function Q(w){P.on("mousemove.zoom mouseup.zoom",null),Ni(w.view,I.moved),wt(w),I.event(w).end()}}function V(x,...b){if(e.apply(this,arguments)){var k=this.__zoom,I=ge(x.changedTouches?x.changedTouches[0]:x,this),P=k.invert(I),D=k.k*(x.shiftKey?.5:2),W=n(p(E(k,D),I,P),t.apply(this,b),s);wt(x),a>0?le(this).transition().duration(a).call(N,W,I,x):le(this).call(y.transform,W,I,x)}}function O(x,...b){if(e.apply(this,arguments)){var k=x.touches,I=k.length,P=S(this,b,x.changedTouches.length===I).event(x),D,W,L,X;for(jn(x),W=0;W<I;++W)L=k[W],X=ge(L,this),X=[X,this.__zoom.invert(X),L.identifier],P.touch0?!P.touch1&&P.touch0[2]!==X[2]&&(P.touch1=X,P.taps=0):(P.touch0=X,D=!0,P.taps=1+!!u);u&&(u=clearTimeout(u)),D&&(P.taps<2&&(c=X[0],u=setTimeout(function(){u=null},h)),Jt(this),P.start())}}function j(x,...b){if(this.__zooming){var k=S(this,b).event(x),I=x.changedTouches,P=I.length,D,W,L,X;for(wt(x),D=0;D<P;++D)W=I[D],L=ge(W,this),k.touch0&&k.touch0[2]===W.identifier?k.touch0[0]=L:k.touch1&&k.touch1[2]===W.identifier&&(k.touch1[0]=L);if(W=k.that.__zoom,k.touch1){var Q=k.touch0[0],w=k.touch0[1],T=k.touch1[0],F=k.touch1[1],B=(B=T[0]-Q[0])*B+(B=T[1]-Q[1])*B,A=(A=F[0]-w[0])*A+(A=F[1]-w[1])*A;W=E(W,Math.sqrt(B/A)),L=[(Q[0]+T[0])/2,(Q[1]+T[1])/2],X=[(w[0]+F[0])/2,(w[1]+F[1])/2]}else if(k.touch0)L=k.touch0[0],X=k.touch0[1];else return;k.zoom("touch",n(p(W,L,X),k.extent,s))}}function z(x,...b){if(this.__zooming){var k=S(this,b).event(x),I=x.changedTouches,P=I.length,D,W;for(jn(x),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),D=0;D<P;++D)W=I[D],k.touch0&&k.touch0[2]===W.identifier?delete k.touch0:k.touch1&&k.touch1[2]===W.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(W=ge(W,this),Math.hypot(c[0]-W[0],c[1]-W[1])<v)){var L=le(this).on("dblclick.zoom");L&&L.apply(this,arguments)}}}return y.wheelDelta=function(x){return arguments.length?(o=typeof x=="function"?x:jt(+x),y):o},y.filter=function(x){return arguments.length?(e=typeof x=="function"?x:jt(!!x),y):e},y.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:jt(!!x),y):r},y.extent=function(x){return arguments.length?(t=typeof x=="function"?x:jt([[+x[0][0],+x[0][1]],[+x[1][0],+x[1][1]]]),y):t},y.scaleExtent=function(x){return arguments.length?(i[0]=+x[0],i[1]=+x[1],y):[i[0],i[1]]},y.translateExtent=function(x){return arguments.length?(s[0][0]=+x[0][0],s[1][0]=+x[1][0],s[0][1]=+x[0][1],s[1][1]=+x[1][1],y):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},y.constrain=function(x){return arguments.length?(n=x,y):n},y.duration=function(x){return arguments.length?(a=+x,y):a},y.interpolate=function(x){return arguments.length?(d=x,y):d},y.on=function(){var x=l.on.apply(l,arguments);return x===l?y:x},y.clickDistance=function(x){return arguments.length?(m=(x=+x)*x,y):Math.sqrt(m)},y.tapDistance=function(x){return arguments.length?(v=+x,y):v},y}const xe={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.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 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,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", edge id: ${t}.`,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.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},kt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ji=["Enter"," ","Escape"],es={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var ft;(function(e){e.Strict="strict",e.Loose="loose"})(ft||(ft={}));var qe;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(qe||(qe={}));var It;(function(e){e.Partial="partial",e.Full="full"})(It||(It={}));const ts={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ze;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ze||(ze={}));var ln;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ln||(ln={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));const vr={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top},ns=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,rd=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mo=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Dt=(e,t=[0,0])=>{const{width:n,height:o}=ve(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},id=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const o=e.reduce((r,i)=>{const s=typeof i=="string";let a=!t.nodeLookup&&!s?i:void 0;return t.nodeLookup&&(a=s?t.nodeLookup.get(i):Mo(i)?i:t.nodeLookup.get(i.id)),a?(n=!0,Sn(r,fn(a,t.nodeOrigin))):r},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?bn(o):{x:0,y:0,width:0,height:0}},Ht=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(r=>{(t.filter===void 0||t.filter(r))&&(n=Sn(n,fn(r)),o=!0)}),o?bn(n):{x:0,y:0,width:0,height:0}},ko=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a=(t.x-n)/r,d=(t.y-o)/r,l=t.width/r,u=t.height/r,c=[];for(const f of e.values()){const{measured:h,selectable:g=!0,hidden:m=!1}=f;if(s&&!g||m)continue;const v=h.width??f.width??f.initialWidth??0,y=h.height??f.height??f.initialHeight??0,{x:E,y:p}=f.internals.positionAbsolute,_=ss(a,d,l,u,E,p,v,y),N=v*y,S=i&&_>0;(!f.internals.handleBounds||S||_>=N||f.dragging)&&c.push(f)}return c},sd=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function ad(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{let i;if(t?.includeHiddenNodes){const{width:s,height:a}=ve(r);i=s>0&&a>0}else i=!!(r.measured.width&&r.measured.height&&!r.hidden);i&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function cd({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return!0;const a=ad(e,s),d=Ht(a),l=Ao(d,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(l,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0}function os({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:d,y:l}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let c=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",xe.error005());else{const{width:h,height:g}=ve(a);h&&g&&(c=[[d,l],[d+h,l+g]])}else a&&Je(s.extent)&&(c=[[s.extent[0][0]+d,s.extent[0][1]+l],[s.extent[1][0]+d,s.extent[1][1]+l]]);const f=Je(c)?Qe(t,c,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",xe.error015()),{position:{x:f.x-d+(s.measured.width??0)*u[0],y:f.y-l+(s.measured.height??0)*u[1]},positionAbsolute:f}}async function ud({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const h=i.has(f.id),g=!h&&f.parentId&&s.find(m=>m.id===f.parentId);(h||g)&&s.push(f)}const a=new Set(t.map(f=>f.id)),d=o.filter(f=>f.deletable!==!1),u=sd(s,d);for(const f of d)a.has(f.id)&&!u.find(g=>g.id===f.id)&&u.push(f);if(!r)return{edges:u,nodes:s};const c=await r({nodes:s,edges:u});return typeof c=="boolean"?c?{edges:u,nodes:s}:{edges:[],nodes:[]}:c}const dt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Qe=(e={x:0,y:0},t,n)=>({x:dt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:dt(e.y,t[0][1],t[1][1]-(n?.height??0))});function rs(e,t,n){const{width:o,height:r}=ve(n),{x:i,y:s}=n.internals.positionAbsolute;return Qe(e,[[i,s],[i+o,s+r]],t)}const _r=(e,t,n)=>e<t?dt(Math.abs(e-t),1,t)/t:e>n?-dt(Math.abs(e-n),1,t)/t:0,Io=(e,t,n=15,o=40)=>{const r=_r(e.x,o,t.width-o)*n,i=_r(e.y,o,t.height-o)*n;return[r,i]},Sn=(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)}),co=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),bn=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),At=(e,t=[0,0])=>{const{x:n,y:o}=Mo(e)?e.internals.positionAbsolute:Dt(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},fn=(e,t=[0,0])=>{const{x:n,y:o}=Mo(e)?e.internals.positionAbsolute:Dt(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},is=(e,t)=>bn(Sn(co(e),co(t))),ss=(e,t,n,o,r,i,s,a)=>{const d=Math.max(0,Math.min(e+n,r+s)-Math.max(e,r)),l=Math.max(0,Math.min(t+o,i+a)-Math.max(t,i));return Math.ceil(d*l)},dn=(e,t)=>ss(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Er=e=>me(e.width)&&me(e.height)&&me(e.x)&&me(e.y),me=e=>!isNaN(e)&&isFinite(e),as=(e,t)=>(n,o)=>{},Ot=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),zt=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?Ot(a,s):a},ht=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function tt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function ld(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=tt(e,n),r=tt(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=tt(e.top??e.y??0,n),r=tt(e.bottom??e.y??0,n),i=tt(e.left??e.x??0,t),s=tt(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function fd(e,t,n,o,r,i){const{x:s,y:a}=ht(e,[t,n,o]),{x:d,y:l}=ht({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-d,c=i-l;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(c)}}const Ao=(e,t,n,o,r,i)=>{const s=ld(i,t,n),a=(t-s.x)/e.width,d=(n-s.y)/e.height,l=Math.min(a,d),u=dt(l,o,r),c=e.x+e.width/2,f=e.y+e.height/2,h=t/2-c*u,g=n/2-f*u,m=fd(e,h,g,u,t,n),v={left:Math.min(m.left-s.left,0),top:Math.min(m.top-s.top,0),right:Math.min(m.right-s.right,0),bottom:Math.min(m.bottom-s.bottom,0)};return{x:h-v.left+v.right,y:g-v.top+v.bottom,zoom:u}},Rt=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Je(e){return e!=null&&e!=="parent"}function ve(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function cs(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function us(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Sr(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function dd(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function hd(e){return{...es,...e||{}}}function ls(e){return e===null?null:e?"valid":"invalid"}function St(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=ye(e),a=zt({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:d,y:l}=n?Ot(a,t):a;return{xSnapped:d,ySnapped:l,...a}}const Ro=e=>({width:e.offsetWidth,height:e.offsetHeight}),fs=e=>e?.getRootNode?.()||window?.document,gd=["INPUT","SELECT","TEXTAREA"];function ds(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:gd.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const hs=e=>"clientX"in e,ye=(e,t)=>{const n=hs(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},br=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Ro(s)}})};function gs({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const d=e*.125+r*.375+s*.375+n*.125,l=t*.125+i*.375+a*.375+o*.125,u=Math.abs(d-e),c=Math.abs(l-t);return[d,l,u,c]}function Ft(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Cr({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case K.Left:return[t-Ft(t-o,i),n];case K.Right:return[t+Ft(o-t,i),n];case K.Top:return[t,n-Ft(n-r,i)];case K.Bottom:return[t,n+Ft(r-n,i)]}}function ps({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:o,targetY:r,targetPosition:i=K.Top,curvature:s=.25}){const[a,d]=Cr({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[l,u]=Cr({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[c,f,h,g]=gs({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:d,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${d} ${l},${u} ${o},${r}`,c,f,h,g]}function ms({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function pd({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const s=r&&n?o+1e3:o,a=Math.max(e.parentId||r&&e.selected?e.internals.z:0,t.parentId||r&&t.selected?t.internals.z:0);return s+a}function md({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=Sn(fn(e),fn(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return dn(s,bn(i))>0}const yd=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,xd=(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)),wd=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",xe.error006()),t;const o=n.getEdgeId||yd;let r;return ns(e)?r={...e}:r={...e,id:o(e)},xd(r,t)?t:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,t.concat(r))};function ys({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=ms({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const Nr={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},vd=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.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},Mr=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),_d=(e,t,n)=>e.x===t.x&&t.x===n.x&&(t.y-e.y)*(n.y-t.y)>=0||e.y===t.y&&t.y===n.y&&(t.x-e.x)*(n.x-t.x)>=0;function Ed({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:o=K.Top,center:r,offset:i,stepPosition:s}){const a=Nr[t],d=Nr[o],l={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+d.x*i,y:n.y+d.y*i},c=vd({source:l,sourcePosition:t,target:u}),f=c.x!==0?"x":"y",h=c[f];let g=[],m,v;const y={x:0,y:0},E={x:0,y:0},[,,p,_]=ms({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*d[f]===-1){f==="x"?(m=r.x??l.x+(u.x-l.x)*s,v=r.y??(l.y+u.y)/2):(m=r.x??(l.x+u.x)/2,v=r.y??l.y+(u.y-l.y)*s);const M=[{x:m,y:l.y},{x:m,y:u.y}],R=[{x:l.x,y:v},{x:u.x,y:v}];a[f]===h?g=f==="x"?M:R:g=f==="x"?R:M}else{const M=[{x:l.x,y:u.y}],R=[{x:u.x,y:l.y}];if(f==="x"?g=a.x===h?R:M:g=a.y===h?M:R,t===o){const x=Math.abs(e[f]-n[f]);if(x<=i){const b=Math.min(i-1,i-x);a[f]===h?y[f]=(l[f]>e[f]?-1:1)*b:E[f]=(u[f]>n[f]?-1:1)*b}}if(t!==o){const x=f==="x"?"y":"x",b=a[f]===d[x],k=l[x]>u[x],I=l[x]<u[x];(a[f]===1&&(!b&&k||b&&I)||a[f]!==1&&(!b&&I||b&&k))&&(g=f==="x"?M:R)}const V={x:l.x+y.x,y:l.y+y.y},O={x:u.x+E.x,y:u.y+E.y},j=Math.max(Math.abs(V.x-g[0].x),Math.abs(O.x-g[0].x)),z=Math.max(Math.abs(V.y-g[0].y),Math.abs(O.y-g[0].y));j>=z?(m=(V.x+O.x)/2,v=g[0].y):(m=g[0].x,v=(V.y+O.y)/2)}const N={x:l.x+y.x,y:l.y+y.y},S={x:u.x+E.x,y:u.y+E.y},C=[];for(const M of[e,N,...g,S,n]){const[R,V]=C.slice(-2);V&&_d(R,V,M)&&C.pop(),C.push(M)}return[C,m,v,p,_]}function Sd(e,t,n,o){const r=Math.min(Mr(e,t)/2,Mr(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const l=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*l},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,d=e.y<n.y?-1:1;return`L ${i},${s+r*d}Q ${i},${s} ${i+r*a},${s}`}function uo({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:o,targetY:r,targetPosition:i=K.Top,borderRadius:s=5,centerX:a,centerY:d,offset:l=20,stepPosition:u=.5}){const[c,f,h,g,m]=Ed({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:d},offset:l,stepPosition:u});let v=`M${c[0].x} ${c[0].y}`;for(let y=1;y<c.length-1;y++)v+=Sd(c[y-1],c[y],c[y+1],s);return v+=`L${c[c.length-1].x} ${c[c.length-1].y}`,[v,f,h,g,m]}function kr(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function bd(e){const{sourceNode:t,targetNode:n}=e;if(!kr(t)||!kr(n))return null;const o=t.internals.handleBounds||Ir(t.handles),r=n.internals.handleBounds||Ir(n.handles),i=Ar(o?.source??[],e.sourceHandle),s=Ar(e.connectionMode===ft.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",xe.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||K.Bottom,d=s?.position||K.Top,l=et(t,i,a),u=et(n,s,d);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:d}}function Ir(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function et(e,t,n=K.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??ve(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case K.Top:return{x:r+s/2,y:i};case K.Right:return{x:r+s,y:i+a/2};case K.Bottom:return{x:r+s/2,y:i+a};case K.Left:return{x:r,y:i+a/2}}}function Ar(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function lo(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function Cd(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(d=>{if(d&&typeof d=="object"){const l=lo(d,t);i.has(l)||(s.push({id:l,color:d.color||n,...d}),i.add(l))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const xs=1e3,Nd=10,To={nodeOrigin:[0,0],nodeExtent:kt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Md={...To,checkEquality:!0};function Po(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function kd(e,t,n){const o=Po(To,n);for(const r of e.values())if(r.parentId)Do(r,e,t,o);else{const i=Dt(r,o.nodeOrigin),s=Je(r.extent)?r.extent:o.nodeExtent,a=Qe(i,s,ve(r));r.internals.positionAbsolute=a}}function Id(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],o=[];for(const r of e.handles){const i={id:r.id,width:r.width??1,height:r.height??1,nodeId:e.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?n.push(i):r.type==="target"&&o.push(i)}return{source:n,target:o}}function $o(e){return e==="manual"}function fo(e,t,n,o={}){const r=Po(Md,o),i={i:0},s=new Map(t),a=r?.elevateNodesOnSelect&&!$o(r.zIndexMode)?xs:0;let d=e.length>0,l=!1;t.clear(),n.clear();for(const u of e){let c=s.get(u.id);if(r.checkEquality&&u===c?.internals.userNode)t.set(u.id,c);else{const f=Dt(u,r.nodeOrigin),h=Je(u.extent)?u.extent:r.nodeExtent,g=Qe(f,h,ve(u));c={...r.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:g,handleBounds:Id(u,c),z:ws(u,a,r.zIndexMode),userNode:u}},t.set(u.id,c)}(c.measured===void 0||c.measured.width===void 0||c.measured.height===void 0)&&!c.hidden&&(d=!1),u.parentId&&Do(c,t,n,o,i),l||=u.selected??!1}return{nodesInitialized:d,hasSelectedNodes:l}}function Ad(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Do(e,t,n,o,r){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:a,zIndexMode:d}=Po(To,o),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Ad(e,n),r&&!u.parentId&&u.internals.rootParentIndex===void 0&&d==="auto"&&(u.internals.rootParentIndex=++r.i,u.internals.z=u.internals.z+r.i*Nd),r&&u.internals.rootParentIndex!==void 0&&(r.i=u.internals.rootParentIndex);const c=i&&!$o(d)?xs:0,{x:f,y:h,z:g}=Rd(e,u,s,a,c,d),{positionAbsolute:m}=e.internals,v=f!==m.x||h!==m.y;(v||g!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:f,y:h}:m,z:g}})}function ws(e,t,n){const o=me(e.zIndex)?e.zIndex:0;return $o(n)?o:o+(e.selected?t:0)}function Rd(e,t,n,o,r,i){const{x:s,y:a}=t.internals.positionAbsolute,d=ve(e),l=Dt(e,n),u=Je(e.extent)?Qe(l,e.extent,d):l;let c=Qe({x:s+u.x,y:a+u.y},o,d);e.extent==="parent"&&(c=rs(c,d,t));const f=ws(e,r,i),h=t.internals.z??0;return{x:c.x,y:c.y,z:h>=f?h+1:f}}function Ho(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const d=i.get(s.parentId)?.expandedRect??At(a),l=is(d,s.rect);i.set(s.parentId,{expandedRect:l,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},d)=>{const l=a.internals.positionAbsolute,u=ve(a),c=a.origin??o,f=s.x<l.x?Math.round(Math.abs(l.x-s.x)):0,h=s.y<l.y?Math.round(Math.abs(l.y-s.y)):0,g=Math.max(u.width,Math.round(s.width)),m=Math.max(u.height,Math.round(s.height)),v=(g-u.width)*c[0],y=(m-u.height)*c[1];(f>0||h>0||v||y)&&(r.push({id:d,type:"position",position:{x:a.position.x-f+v,y:a.position.y-h+y}}),n.get(d)?.forEach(E=>{e.some(p=>p.id===E.id)||r.push({id:E.id,type:"position",position:{x:E.position.x+f,y:E.position.y+h}})})),(u.width<s.width||u.height<s.height||f||h)&&r.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:g+(f?c[0]*f-v:0),height:m+(h?c[1]*h-y:0)}})}),r}function Td(e,t,n,o,r,i,s){const a=o?.querySelector(".xyflow__viewport");let d=!1;if(!a)return{changes:[],updatedInternals:d};const l=[],u=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const h of e.values()){const g=t.get(h.id);if(!g)continue;if(g.hidden){t.set(g.id,{...g,internals:{...g.internals,handleBounds:void 0}}),d=!0;continue}const m=Ro(h.nodeElement),v=g.measured.width!==m.width||g.measured.height!==m.height;if(!!(m.width&&m.height&&(v||!g.internals.handleBounds||h.force))){const E=h.nodeElement.getBoundingClientRect(),p=Je(g.extent)?g.extent:i;let{positionAbsolute:_}=g.internals;if(g.parentId&&g.extent==="parent"){const S=t.get(g.parentId);S&&(_=rs(_,m,S))}else p&&(_=Qe(_,p,m));const N={...g,measured:m,internals:{...g.internals,positionAbsolute:_,handleBounds:{source:br("source",h.nodeElement,E,c,g.id),target:br("target",h.nodeElement,E,c,g.id)}}};t.set(g.id,N),g.parentId&&Do(N,t,n,{nodeOrigin:r,zIndexMode:s}),d=!0,v&&(l.push({id:g.id,type:"dimensions",dimensions:m}),g.expandParent&&g.parentId&&f.push({id:g.id,parentId:g.parentId,rect:At(N,r)}))}}if(f.length>0){const h=Ho(f,t,n,r);l.push(...h)}return{changes:l,updatedInternals:d}}async function Pd({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function Rr(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const d=o.get(s)||new Map;if(o.set(s,d.set(n,t)),i){s=`${r}-${e}-${i}`;const l=o.get(s)||new Map;o.set(s,l.set(n,t))}}function vs(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,d={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},l=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;Rr("source",d,u,e,r,s),Rr("target",d,l,e,i,a),t.set(o.id,o)}}function _s(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:_s(n,t):!1}function Tr(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function $d(e,t,n,o,r){const i=new Map;for(const[s,a]of e)if((r?a.id===o:a.selected||a.id===o)&&(r||!a.parentId||!_s(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(s);l&&i.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function Fn({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const d=n.get(s)?.internals.userNode;d&&r.push({...d,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function Dd({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=Ot(i,t);return{x:s.x-i.x,y:s.y-i.y}}function Hd({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,d=!1,l={x:0,y:0},u=null,c=!1,f=null,h=!1,g=!1,m=null;function v({noDragClassName:E,handleSelector:p,domNode:_,isSelectable:N,nodeId:S,nodeClickDistance:C=0}){f=le(_);function M({x:j,y:z}){const{nodeLookup:x,nodeExtent:b,snapGrid:k,snapToGrid:I,nodeOrigin:P,onNodeDrag:D,onSelectionDrag:W,onError:L,updateNodePositions:X}=t();i={x:j,y:z};let Q=!1;const w=a.size>1,T=w&&b?co(Ht(a)):null,F=w&&I?Dd({dragItems:a,snapGrid:k,x:j,y:z}):null;for(const[B,A]of a){if(!x.has(B))continue;let Y={x:j-A.distance.x,y:z-A.distance.y};I&&(Y=F?{x:Math.round(Y.x+F.x),y:Math.round(Y.y+F.y)}:Ot(Y,k));let q=null;if(w&&b&&!A.extent&&T){const{positionAbsolute:U}=A.internals,ee=U.x-T.x+b[0][0],te=U.x+A.measured.width-T.x2+b[1][0],oe=U.y-T.y+b[0][1],ce=U.y+A.measured.height-T.y2+b[1][1];q=[[ee,oe],[te,ce]]}const{position:G,positionAbsolute:Z}=os({nodeId:B,nextPosition:Y,nodeLookup:x,nodeExtent:q||b,nodeOrigin:P,onError:L});Q=Q||A.position.x!==G.x||A.position.y!==G.y,A.position=G,A.internals.positionAbsolute=Z}if(g=g||Q,!!Q&&(X(a,!0),m&&(o||D||!S&&W))){const[B,A]=Fn({nodeId:S,dragItems:a,nodeLookup:x});o?.(m,a,B,A),D?.(m,B,A),S||W?.(m,A)}}async function R(){if(!u)return;const{transform:j,panBy:z,autoPanSpeed:x,autoPanOnNodeDrag:b}=t();if(!b){d=!1,cancelAnimationFrame(s);return}const[k,I]=Io(l,u,x);(k!==0||I!==0)&&(i.x=(i.x??0)-k/j[2],i.y=(i.y??0)-I/j[2],await z({x:k,y:I})&&M(i)),s=requestAnimationFrame(R)}function V(j){const{nodeLookup:z,multiSelectionActive:x,nodesDraggable:b,transform:k,snapGrid:I,snapToGrid:P,selectNodesOnDrag:D,onNodeDragStart:W,onSelectionDragStart:L,unselectNodesAndEdges:X}=t();c=!0;const Q=!!S&&!x&&!z.get(S)?.selected;(!D||!N)&&!x&&S&&(z.get(S)?.selected||X()),N&&D&&S&&e?.(S);const w=St(j.sourceEvent,{transform:k,snapGrid:I,snapToGrid:P,containerBounds:u});if(i=w,a=$d(z,b,w,S,Q),a.size>0&&(n||W||!S&&L)){const[T,F]=Fn({nodeId:S,dragItems:a,nodeLookup:z});n?.(j.sourceEvent,a,T,F),W?.(j.sourceEvent,T,F),S||L?.(j.sourceEvent,F)}}const O=Mi().clickDistance(C).on("start",j=>{const{domNode:z,nodeDragThreshold:x,transform:b,snapGrid:k,snapToGrid:I}=t();u=z?.getBoundingClientRect()||null,h=!1,g=!1,m=j.sourceEvent,x===0&&V(j),i=St(j.sourceEvent,{transform:b,snapGrid:k,snapToGrid:I,containerBounds:u}),l=ye(j.sourceEvent,u)}).on("drag",j=>{const{autoPanOnNodeDrag:z,transform:x,snapGrid:b,snapToGrid:k,nodeDragThreshold:I,nodeLookup:P}=t(),D=St(j.sourceEvent,{transform:x,snapGrid:b,snapToGrid:k,containerBounds:u});if(m=j.sourceEvent,(j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||S&&!P.has(S))&&(h=!0),!h){if(!d&&z&&c&&(d=!0,R()),!c){const W=ye(j.sourceEvent,u),L=W.x-l.x,X=W.y-l.y;Math.sqrt(L*L+X*X)>I&&V(j)}(i.x!==D.xSnapped||i.y!==D.ySnapped)&&a&&c&&(l=ye(j.sourceEvent,u),M(D))}}).on("end",j=>{if(!c||h){h&&a.size>0&&t().updateNodePositions(a,!1);return}if(d=!1,c=!1,cancelAnimationFrame(s),a.size>0){const{nodeLookup:z,updateNodePositions:x,onNodeDragStop:b,onSelectionDragStop:k}=t();if(g&&(x(a,!1),g=!1),r||b||!S&&k){const[I,P]=Fn({nodeId:S,dragItems:a,nodeLookup:z,dragging:!1});r?.(j.sourceEvent,a,I,P),b?.(j.sourceEvent,I,P),S||k?.(j.sourceEvent,P)}}}).filter(j=>{const z=j.target;return!j.button&&(!E||!Tr(z,`.${E}`,_))&&(!p||Tr(z,p,_))});f.call(O)}function y(){f?.on(".drag",null)}return{update:v,destroy:y}}function Od(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())dn(r,At(i))>0&&o.push(i);return o}const zd=250;function Ld(e,t,n,o){let r=[],i=1/0;const s=Od(e,n,t+zd);for(const a of s){const d=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const l of d){if(o.nodeId===l.nodeId&&o.type===l.type&&o.id===l.id)continue;const{x:u,y:c}=et(a,l,l.position,!0),f=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(c-e.y,2));f>t||(f<i?(r=[{...l,x:u,y:c}],i=f):f===i&&r.push({...l,x:u,y:c}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(d=>d.type===a)??r[0]}return r[0]}function Es(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],d=(n?a?.find(l=>l.id===n):a?.[0])??null;return d&&i?{...d,...et(s,d,d.position,!0)}:d}function Ss(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Wd(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const bs=()=>!0;function Bd(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:d,lib:l,autoPanOnConnect:u,flowId:c,panBy:f,cancelConnection:h,onConnectStart:g,onConnect:m,onConnectEnd:v,isValidConnection:y=bs,onReconnectEnd:E,updateConnection:p,getTransform:_,getFromHandle:N,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:M}){const R=fs(e.target);let V=0,O;const{x:j,y:z}=ye(e),x=Ss(i,M),b=a?.getBoundingClientRect();let k=!1;if(!b||!x)return;const I=Es(r,x,o,d,t);if(!I)return;let P=ye(e,b),D=!1,W=null,L=!1,X=null;function Q(){if(!u||!b)return;const[G,Z]=Io(P,b,S);f({x:G,y:Z}),V=requestAnimationFrame(Q)}const w={...I,nodeId:r,type:x,position:I.position},T=d.get(r);let B={inProgress:!0,isValid:null,from:et(T,w,K.Left,!0),fromHandle:w,fromPosition:w.position,fromNode:T,to:P,toHandle:null,toPosition:vr[w.position],toNode:null,pointer:P};function A(){k=!0,p(B),g?.(e,{nodeId:r,handleId:o,handleType:x})}C===0&&A();function Y(G){if(!k){const{x:ce,y:Me}=ye(G),_e=ce-j,Ee=Me-z;if(!(_e*_e+Ee*Ee>C*C))return;A()}if(!N()||!w){q(G);return}const Z=_();P=ye(G,b),O=Ld(zt(P,Z,!1,[1,1]),n,d,w),D||(Q(),D=!0);const U=Cs(G,{handle:O,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:y,doc:R,lib:l,flowId:c,nodeLookup:d});X=U.handleDomNode,W=U.connection,L=Wd(!!O,U.isValid);const ee=d.get(r),te=ee?et(ee,w,K.Left,!0):B.from,oe={...B,from:te,isValid:L,to:U.toHandle&&L?ht({x:U.toHandle.x,y:U.toHandle.y},Z):P,toHandle:U.toHandle,toPosition:L&&U.toHandle?U.toHandle.position:vr[w.position],toNode:U.toHandle?d.get(U.toHandle.nodeId):null,pointer:P};p(oe),B=oe}function q(G){if(!("touches"in G&&G.touches.length>0)){if(k){(O||X)&&W&&L&&m?.(W);const{inProgress:Z,...U}=B,ee={...U,toPosition:B.toHandle?B.toPosition:null};v?.(G,ee),i&&E?.(G,ee)}h(),cancelAnimationFrame(V),D=!1,L=!1,W=null,X=null,R.removeEventListener("mousemove",Y),R.removeEventListener("mouseup",q),R.removeEventListener("touchmove",Y),R.removeEventListener("touchend",q)}}R.addEventListener("mousemove",Y),R.addEventListener("mouseup",q),R.addEventListener("touchmove",Y),R.addEventListener("touchend",q)}function Cs(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:d,isValidConnection:l=bs,nodeLookup:u}){const c=i==="target",f=t?s.querySelector(`.${a}-flow__handle[data-id="${d}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:h,y:g}=ye(e),m=s.elementFromPoint(h,g),v=m?.classList.contains(`${a}-flow__handle`)?m:f,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const E=Ss(void 0,v),p=v.getAttribute("data-nodeid"),_=v.getAttribute("data-handleid"),N=v.classList.contains("connectable"),S=v.classList.contains("connectableend");if(!p||!E)return y;const C={source:c?p:o,sourceHandle:c?_:r,target:c?o:p,targetHandle:c?r:_};y.connection=C;const R=N&&S&&(n===ft.Strict?c&&E==="source"||!c&&E==="target":p!==o||_!==r);y.isValid=R&&l(C),y.toHandle=Es(p,E,_,u,n,!0)}return y}const ho={onPointerDown:Bd,isValid:Cs};function Vd({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=le(e);function i({translateExtent:a,width:d,height:l,zoomStep:u=1,pannable:c=!0,zoomable:f=!0,inversePan:h=!1}){const g=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const _=n(),N=p.sourceEvent.ctrlKey&&Rt()?10:1,S=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*u,C=_[2]*Math.pow(2,S*N);t.scaleTo(C)};let m=[0,0];const v=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(m=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},y=p=>{const _=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const N=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],S=[N[0]-m[0],N[1]-m[1]];m=N;const C=o()*Math.max(_[2],Math.log(_[2]))*(h?-1:1),M={x:_[0]-S[0]*C,y:_[1]-S[1]*C},R=[[0,0],[d,l]];t.setViewportConstrained({x:M.x,y:M.y,zoom:_[2]},R,a)},E=Qi().on("start",v).on("zoom",c?y:null).on("zoom.wheel",f?g:null);r.call(E,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:ge}}const Cn=e=>({x:e.x,y:e.y,zoom:e.k}),Yn=({x:e,y:t,zoom:n})=>En.translate(e,t).scale(n),Oe=(e,t)=>e.target.closest(`.${t}`),Ns=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),jd=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Xn=(e,t=0,n=jd,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Ms=e=>{const t=e.ctrlKey&&Rt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Fd({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:d,onPanZoomEnd:l}){return u=>{if(Oe(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(u.ctrlKey&&s){const v=ge(u),y=Ms(u),E=c*Math.pow(2,y);o.scaleTo(n,E,v,u);return}const f=u.deltaMode===1?20:1;let h=r===qe.Vertical?0:u.deltaX*f,g=r===qe.Horizontal?0:u.deltaY*f;!Rt()&&u.shiftKey&&r!==qe.Vertical&&(h=u.deltaY*f,g=0),o.translateBy(n,-(h/c)*i,-(g/c)*i,{internal:!0});const m=Cn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?d?.(u,m):(e.isPanScrolling=!0,a?.(u,m)),e.panScrollTimeout=setTimeout(()=>{l?.(u,m),e.isPanScrolling=!1},150)}}function Yd({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=Oe(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function Xd({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=Cn(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function Zd({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&Ns(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,Cn(i.transform))}}function qd({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&Ns(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r)){const a=Cn(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function Gd({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:o,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:d,noPanClassName:l,lib:u,connectionInProgress:c}){return f=>{const h=t||n,g=o&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Oe(f,`${u}-flow__node`)||Oe(f,`${u}-flow__edge`)||Oe(f,`${u}-flow__selection`)||Oe(f,`${u}-flow__nodesselection`)))return!0;if(!r&&!h&&!i&&!s&&!o||a||c&&!m||Oe(f,d)&&m||Oe(f,l)&&(!m||i&&m&&!t)||!o&&f.ctrlKey&&m)return!1;if(!o&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!h&&!i&&!g&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m||e)&&v}}function Ud({domNode:e,minZoom:t,maxZoom:n,translateExtent:o,viewport:r,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:a,onDraggingChange:d}){const l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect();let c=[[0,0],[u.width,u.height]];const f=typeof ResizeObserver<"u"?new ResizeObserver(z=>{const x=z[0];x?.contentRect&&(c=[[0,0],[x.contentRect.width,x.contentRect.height]])}):null;f?.observe(e);const h=Qi().extent(()=>c).scaleExtent([t,n]).translateExtent(o),g=le(e).call(h);_({x:r.x,y:r.y,zoom:dt(r.zoom,t,n)},[[0,0],[u.width,u.height]],o);const m=g.on("wheel.zoom"),v=g.on("dblclick.zoom");h.wheelDelta(Ms);async function y(z,x){return g?new Promise(b=>{h?.interpolate(x?.interpolate==="linear"?Et:Ut).transform(Xn(g,x?.duration,x?.ease,()=>b(!0)),z)}):!1}function E({noWheelClassName:z,noPanClassName:x,onPaneContextMenu:b,userSelectionActive:k,panOnScroll:I,panOnDrag:P,panOnScrollMode:D,panOnScrollSpeed:W,preventScrolling:L,zoomOnPinch:X,zoomOnScroll:Q,zoomOnDoubleClick:w,panActivationKeyPressed:T=!1,zoomActivationKeyPressed:F,lib:B,onTransformChange:A,connectionInProgress:Y,paneClickDistance:q,selectionOnDrag:G}){k&&!l.isZoomingOrPanning&&h.on("zoom",null);const Z=I&&!F&&!k;h.clickDistance(G?1/0:!me(q)||q<0?0:q);const U=Z?Fd({zoomPanValues:l,noWheelClassName:z,d3Selection:g,d3Zoom:h,panOnScrollMode:D,panOnScrollSpeed:W,zoomOnPinch:X,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:a}):Yd({noWheelClassName:z,preventScrolling:L,d3ZoomHandler:m});g.on("wheel.zoom",U,{passive:!1});const ee=Xd({zoomPanValues:l,onDraggingChange:d,onPanZoomStart:s});h.on("start",ee);const te=Zd({zoomPanValues:l,panOnDrag:P,onPaneContextMenu:!!b,onPanZoom:i,onTransformChange:A});h.on("zoom",te);const oe=qd({zoomPanValues:l,panOnDrag:P,panOnScroll:I,onPaneContextMenu:b,onPanZoomEnd:a,onDraggingChange:d});h.on("end",oe);const ce=Gd({panActivationKeyPressed:T,zoomActivationKeyPressed:F,panOnDrag:P,zoomOnScroll:Q,panOnScroll:I,zoomOnDoubleClick:w,zoomOnPinch:X,userSelectionActive:k,noPanClassName:x,noWheelClassName:z,lib:B,connectionInProgress:Y});h.filter(ce),w?g.on("dblclick.zoom",v):g.on("dblclick.zoom",null)}function p(){h.on("zoom",null),f?.disconnect()}async function _(z,x,b){const k=Yn(z),I=h?.constrain()(k,x,b);return I&&await y(I),I}async function N(z,x){const b=Yn(z);return await y(b,x),b}function S(z){if(g){const x=Yn(z),b=g.property("__zoom");(b.k!==z.zoom||b.x!==z.x||b.y!==z.y)&&h?.transform(g,x,null,{sync:!0})}}function C(){const z=g?Ki(g.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}async function M(z,x){return g?new Promise(b=>{h?.interpolate(x?.interpolate==="linear"?Et:Ut).scaleTo(Xn(g,x?.duration,x?.ease,()=>b(!0)),z)}):!1}async function R(z,x){return g?new Promise(b=>{h?.interpolate(x?.interpolate==="linear"?Et:Ut).scaleBy(Xn(g,x?.duration,x?.ease,()=>b(!0)),z)}):!1}function V(z){h?.scaleExtent(z)}function O(z){h?.translateExtent(z)}function j(z){const x=!me(z)||z<0?0:z;h?.clickDistance(x)}return{update:E,destroy:p,setViewport:N,setViewportConstrained:_,getViewport:C,scaleTo:M,scaleBy:R,setScaleExtent:V,setTranslateExtent:O,syncViewport:S,setClickDistance:j}}var gt;(function(e){e.Line="line",e.Handle="handle"})(gt||(gt={}));function Kd({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,d=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(d[0]=d[0]*-1),a&&i&&(d[1]=d[1]*-1),d}function Pr(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function De(e,t){return Math.max(0,t-e)}function He(e,t){return Math.max(0,e-t)}function Yt(e,t,n){return Math.max(0,t-e,e-n)}function $r(e,t){return e?!t:t}function Qd(e,t,n,o,r,i,s,a){let{affectsX:d,affectsY:l}=t;const{isHorizontal:u,isVertical:c}=t,f=u&&c,{xSnapped:h,ySnapped:g}=n,{minWidth:m,maxWidth:v,minHeight:y,maxHeight:E}=o,{x:p,y:_,width:N,height:S,aspectRatio:C}=e;let M=Math.floor(u?h-e.pointerX:0),R=Math.floor(c?g-e.pointerY:0);const V=N+(d?-M:M),O=S+(l?-R:R),j=-i[0]*N,z=-i[1]*S;let x=Yt(V,m,v),b=Yt(O,y,E);if(s){let P=0,D=0;d&&M<0?P=De(p+M+j,s[0][0]):!d&&M>0&&(P=He(p+V+j,s[1][0])),l&&R<0?D=De(_+R+z,s[0][1]):!l&&R>0&&(D=He(_+O+z,s[1][1])),x=Math.max(x,P),b=Math.max(b,D)}if(a){let P=0,D=0;d&&M>0?P=He(p+M,a[0][0]):!d&&M<0&&(P=De(p+V,a[1][0])),l&&R>0?D=He(_+R,a[0][1]):!l&&R<0&&(D=De(_+O,a[1][1])),x=Math.max(x,P),b=Math.max(b,D)}if(r){if(u){const P=Yt(V/C,y,E)*C;if(x=Math.max(x,P),s){let D=0;!d&&!l||d&&!l&&f?D=He(_+z+V/C,s[1][1])*C:D=De(_+z+(d?M:-M)/C,s[0][1])*C,x=Math.max(x,D)}if(a){let D=0;!d&&!l||d&&!l&&f?D=De(_+V/C,a[1][1])*C:D=He(_+(d?M:-M)/C,a[0][1])*C,x=Math.max(x,D)}}if(c){const P=Yt(O*C,m,v)/C;if(b=Math.max(b,P),s){let D=0;!d&&!l||l&&!d&&f?D=He(p+O*C+j,s[1][0])/C:D=De(p+(l?R:-R)*C+j,s[0][0])/C,b=Math.max(b,D)}if(a){let D=0;!d&&!l||l&&!d&&f?D=De(p+O*C,a[1][0])/C:D=He(p+(l?R:-R)*C,a[0][0])/C,b=Math.max(b,D)}}}R=R+(R<0?b:-b),M=M+(M<0?x:-x),r&&(f?V>O*C?R=($r(d,l)?-M:M)/C:M=($r(d,l)?-R:R)*C:u?(R=M/C,l=d):(M=R*C,d=l));const k=d?p+M:p,I=l?_+R:_;return{width:N+(d?-M:M),height:S+(l?-R:R),x:i[0]*M*(d?-1:1)+k,y:i[1]*R*(l?-1:1)+I}}const ks={width:0,height:0,x:0,y:0},Jd={...ks,pointerX:0,pointerY:0,aspectRatio:1};function eh(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,d=n[1]*s;return[[o-a,r-d],[o+i-a,r+s-d]]}function th({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=le(e);let s={controlDirection:Pr("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:l,boundaries:u,keepAspectRatio:c,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:m,shouldResize:v}){let y={...ks},E={...Jd};s={boundaries:u,resizeDirection:f,keepAspectRatio:c,controlDirection:Pr(l)};let p,_=null,N=[],S,C,M;const R=Mi().on("start",V=>{const{nodeLookup:O,transform:j,snapGrid:z,snapToGrid:x,nodeOrigin:b,paneDomNode:k}=n();if(p=O.get(t),!p)return;_=k?.getBoundingClientRect()??null;const{xSnapped:I,ySnapped:P}=St(V.sourceEvent,{transform:j,snapGrid:z,snapToGrid:x,containerBounds:_});y={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},E={...y,pointerX:I,pointerY:P,aspectRatio:y.width/y.height},S=void 0,C=Je(p.extent)?p.extent:void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(S=O.get(p.parentId)),S&&p.extent==="parent"&&(C=[[0,0],[S.measured.width,S.measured.height]]),N=[],M=void 0;for(const[D,W]of O)if(W.parentId===t&&(N.push({id:D,position:{...W.position},extent:W.extent}),W.extent==="parent"||W.expandParent)){const L=eh(W,p,W.origin??b);M?M=[[Math.min(L[0][0],M[0][0]),Math.min(L[0][1],M[0][1])],[Math.max(L[1][0],M[1][0]),Math.max(L[1][1],M[1][1])]]:M=L}h?.(V,{...y})}).on("drag",V=>{const{transform:O,snapGrid:j,snapToGrid:z,nodeOrigin:x}=n(),b=St(V.sourceEvent,{transform:O,snapGrid:j,snapToGrid:z,containerBounds:_}),k=[];if(!p)return;const{x:I,y:P,width:D,height:W}=y,L={},X=p.origin??x,{width:Q,height:w,x:T,y:F}=Qd(E,s.controlDirection,b,s.boundaries,s.keepAspectRatio,X,C,M),B=Q!==D,A=w!==W,Y=T!==I&&B,q=F!==P&&A;if(!Y&&!q&&!B&&!A)return;const G={prevValues:{...y},startX:E.x,startY:E.y,childNodes:N.map(te=>({...te,position:{...te.position}}))};if((Y||q||X[0]===1||X[1]===1)&&(L.x=Y?T:y.x,L.y=q?F:y.y,y.x=L.x,y.y=L.y,N.length>0)){const te=T-I,oe=F-P;for(const ce of N)ce.position={x:ce.position.x-te+X[0]*(Q-D),y:ce.position.y-oe+X[1]*(w-W)},k.push(ce)}if((B||A)&&(L.width=B&&(!s.resizeDirection||s.resizeDirection==="horizontal")?Q:y.width,L.height=A&&(!s.resizeDirection||s.resizeDirection==="vertical")?w:y.height,y.width=L.width,y.height=L.height),S&&p.expandParent){const te=X[0]*(L.width??0);L.x&&L.x<te&&(y.x=te,E.x=E.x-(L.x-te));const oe=X[1]*(L.height??0);L.y&&L.y<oe&&(y.y=oe,E.y=E.y-(L.y-oe))}const Z=Kd({width:y.width,prevWidth:D,height:y.height,prevHeight:W,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),U={...y,direction:Z};if(v?.(V,U)===!1){y=G.prevValues,E.x=G.startX,E.y=G.startY,N.forEach((te,oe)=>{te.position=G.childNodes[oe].position});return}g?.(V,U),o(L,k)}).on("end",V=>{m?.(V,{...y}),r?.({...y})});i.call(R)}function d(){i.on(".drag",null)}return{update:a,destroy:d}}var Zn={exports:{}},qn={},Gn={exports:{}},Un={};var Dr;function nh(){if(Dr)return Un;Dr=1;var e=pn();function t(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(c,f){var h=f(),g=o({inst:{value:h,getSnapshot:f}}),m=g[0].inst,v=g[1];return i(function(){m.value=h,m.getSnapshot=f,d(m)&&v({inst:m})},[c,h,f]),r(function(){return d(m)&&v({inst:m}),c(function(){d(m)&&v({inst:m})})},[c]),s(h),h}function d(c){var f=c.getSnapshot;c=c.value;try{var h=f();return!n(c,h)}catch{return!0}}function l(c,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return Un.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Un}var Hr;function oh(){return Hr||(Hr=1,Gn.exports=nh()),Gn.exports}var Or;function rh(){if(Or)return qn;Or=1;var e=pn(),t=oh();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,d=e.useDebugValue;return qn.useSyncExternalStoreWithSelector=function(l,u,c,f,h){var g=i(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=a(function(){function y(S){if(!E){if(E=!0,p=S,S=f(S),h!==void 0&&m.hasValue){var C=m.value;if(h(C,S))return _=C}return _=S}if(C=_,o(p,S))return C;var M=f(S);return h!==void 0&&h(C,M)?(p=S,C):(p=S,_=M)}var E=!1,p,_,N=c===void 0?null:c;return[function(){return y(u())},N===null?void 0:function(){return y(N())}]},[u,c,f,h]);var v=r(l,g[0],g[1]);return s(function(){m.hasValue=!0,m.value=v},[v]),d(v),v},qn}var zr;function ih(){return zr||(zr=1,Zn.exports=rh()),Zn.exports}var sh=ih();const ah=di(sh),ch={},Lr=e=>{let t;const n=new Set,o=(u,c)=>{const f=typeof u=="function"?u(t):u;if(!Object.is(f,t)){const h=t;t=c??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,h))}},r=()=>t,d={setState:o,getState:r,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(ch?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},l=t=e(o,r,d);return d},uh=e=>e?Lr(e):Lr,{useDebugValue:lh}=mc,{useSyncExternalStoreWithSelector:fh}=ah,dh=e=>e;function Is(e,t=dh,n){const o=fh(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return lh(o),o}const Wr=(e,t)=>{const n=uh(e),o=(r,i=t)=>Is(n,r,i);return Object.assign(o,n),o},hh=(e,t)=>e?Wr(e,t):Wr;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[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var gh=xc();const Nn=H.createContext(null),ph=Nn.Provider,As=xe.error001("react");function ne(e,t){const n=H.useContext(Nn);if(n===null)throw new Error(As);return Is(n,e,t)}function re(){const e=H.useContext(Nn);if(e===null)throw new Error(As);return H.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Br={display:"none"},mh={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Rs="react-flow__node-desc",Ts="react-flow__edge-desc",yh="react-flow__aria-live",xh=e=>e.ariaLiveMessage,wh=e=>e.ariaLabelConfig;function vh({rfId:e}){const t=ne(xh);return $.jsx("div",{id:`${yh}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:mh,children:t})}function _h({rfId:e,disableKeyboardA11y:t}){const n=ne(wh);return $.jsxs($.Fragment,{children:[$.jsx("div",{id:`${Rs}-${e}`,style:Br,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),$.jsx("div",{id:`${Ts}-${e}`,style:Br,children:n["edge.a11yDescription.default"]}),!t&&$.jsx(vh,{rfId:e})]})}const Mn=H.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return $.jsx("div",{className:se(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});Mn.displayName="Panel";const Vr="https://reactflow.dev?utm_source=attribution";function Eh({proOptions:e,position:t="bottom-right"}){return H.useEffect(()=>{},[]),e?.hideAttribution?null:$.jsx(Mn,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Vr}`,children:$.jsx("a",{href:Vr,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Sh=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},Xt=e=>e.id;function bh(e,t){return ie(e.selectedNodes.map(Xt),t.selectedNodes.map(Xt))&&ie(e.selectedEdges.map(Xt),t.selectedEdges.map(Xt))}function Ch({onSelectionChange:e}){const t=re(),{selectedNodes:n,selectedEdges:o}=ne(Sh,bh);return H.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const Nh=e=>!!e.onSelectionChangeHandlers;function Mh({onSelectionChange:e}){const t=ne(Nh);return e||t?$.jsx(Ch,{onSelectionChange:e}):null}const Ps=[0,0],kh={x:0,y:0,zoom:1},Ih=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],jr=[...Ih,"rfId"],Ah=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Fr={translateExtent:kt,nodeOrigin:Ps,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Rh(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:d}=ne(Ah,ie),l=re();H.useEffect(()=>(d(e.defaultNodes,e.defaultEdges),()=>{u.current=Fr,a()}),[]);const u=H.useRef(Fr);return H.useEffect(()=>{for(const c of jr){const f=e[c],h=u.current[c];f!==h&&(typeof e[c]>"u"||(c==="nodes"?t(f):c==="edges"?n(f):c==="minZoom"?o(f):c==="maxZoom"?r(f):c==="translateExtent"?i(f):c==="nodeExtent"?s(f):c==="ariaLabelConfig"?l.setState({ariaLabelConfig:hd(f)}):c==="fitView"?l.setState({fitViewQueued:f}):c==="fitViewOptions"?l.setState({fitViewOptions:f}):l.setState({[c]:f})))}u.current=e},jr.map(c=>e[c])),null}function Yr(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Th(e){const[t,n]=H.useState(e==="system"?null:e);return H.useEffect(()=>{if(e!=="system"){n(e);return}const o=Yr(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:Yr()?.matches?"dark":"light"}const Xr=typeof document<"u"?document:null;function Tt(e=null,t={target:Xr,actInsideInputWithModifier:!0}){const[n,o]=H.useState(!1),r=H.useRef(!1),i=H.useRef(new Set([])),[s,a]=H.useMemo(()=>{if(e!==null){const l=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace(/\+/g,`
2
+ `).replace(`
3
+
4
+ `,`
5
+ +`).split(`
6
+ `)),u=l.reduce((c,f)=>c.concat(...f),[]);return[l,u]}return[[],[]]},[e]);return H.useEffect(()=>{const d=t?.target??Xr,l=t?.actInsideInputWithModifier??!0;if(e!==null){const u=h=>{if(r.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!r.current||r.current&&!l)&&ds(h))return!1;const m=qr(h.code,a);if(i.current.add(h[m]),Zr(s,i.current,!1)){const v=h.composedPath?.()?.[0]||h.target,y=v?.nodeName==="BUTTON"||v?.nodeName==="A";t.preventDefault!==!1&&(r.current||!y)&&h.preventDefault(),o(!0)}},c=h=>{const g=qr(h.code,a);Zr(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(h[g]),h.key==="Meta"&&i.current.clear(),r.current=!1},f=()=>{i.current.clear(),o(!1)};return d?.addEventListener("keydown",u),d?.addEventListener("keyup",c),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{d?.removeEventListener("keydown",u),d?.removeEventListener("keyup",c),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,o]),n}function Zr(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function qr(e,t){return t.includes(e)?"code":"key"}const Ph=()=>{const e=re();return H.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),d=Ao(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(d,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:d}=s.getBoundingClientRect(),l={x:t.x-a,y:t.y-d},u=n.snapGrid??r,c=n.snapToGrid??i;return zt(l,o,c,u)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=ht(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function $s(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const d of s)$h(d,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function $h(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Dh(e,t){return $s(e,t)}function Hh(e,t){return $s(e,t)}function Fe(e,t){return{id:e,type:"select",selected:t}}function nt(e,t=new Set){const n=[];for(const[o,r]of e){const i=t.has(o);!(r.selected===void 0&&!i)&&r.selected!==i&&n.push(Fe(r.id,i))}return n}function Gr({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function Ur(e){return{id:e.id,type:"remove"}}const Oh=as();function zh(e,t,n={}){return wd(e,t,{...n,onError:n.onError??Oh})}const Kr=e=>rd(e),Lh=e=>ns(e);function Ds(e){return H.forwardRef(e)}const Hs=typeof window<"u"?H.useLayoutEffect:H.useEffect;function Qr(e){const[t,n]=H.useState(BigInt(0)),[o]=H.useState(()=>Wh(()=>n(r=>r+BigInt(1))));return Hs(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function Wh(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Os=H.createContext(null);function Bh({children:e}){const t=re(),n=H.useCallback(a=>{const{nodes:d=[],setNodes:l,hasDefaultNodes:u,onNodesChange:c,nodeLookup:f,fitViewQueued:h,onNodesChangeMiddlewareMap:g}=t.getState();let m=d;for(const y of a)m=typeof y=="function"?y(m):y;let v=Gr({items:m,lookup:f});for(const y of g.values())v=y(v);u&&l(m),v.length>0?c?.(v):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:E,setNodes:p}=t.getState();y&&p(E)})},[]),o=Qr(n),r=H.useCallback(a=>{const{edges:d=[],setEdges:l,hasDefaultEdges:u,onEdgesChange:c,edgeLookup:f}=t.getState();let h=d;for(const g of a)h=typeof g=="function"?g(h):g;u?l(h):c&&c(Gr({items:h,lookup:f}))},[]),i=Qr(r),s=H.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return $.jsx(Os.Provider,{value:s,children:e})}function Vh(){const e=H.useContext(Os);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const jh=e=>!!e.panZoom;function Oo(){const e=Ph(),t=re(),n=Vh(),o=ne(jh),r=H.useMemo(()=>{const i=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},a=c=>{n.edgeQueue.push(c)},d=c=>{const{nodeLookup:f,nodeOrigin:h}=t.getState(),g=Kr(c)?c:f.get(c.id),m=g.parentId?us(g.position,g.measured,g.parentId,f,h):g.position,v={...g,position:m,width:g.measured?.width??g.width,height:g.measured?.height??g.height};return At(v,g.parentId?void 0:h)},l=(c,f,h={replace:!1})=>{s(g=>g.map(m=>{if(m.id===c){const v=typeof f=="function"?f(m):f;return h.replace&&Kr(v)?v:{...m,...v}}return m}))},u=(c,f,h={replace:!1})=>{a(g=>g.map(m=>{if(m.id===c){const v=typeof f=="function"?f(m):f;return h.replace&&Lh(v)?v:{...m,...v}}return m}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>i(c)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(f=>({...f}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:a,addNodes:c=>{const f=Array.isArray(c)?c:[c];n.nodeQueue.push(h=>[...h,...f])},addEdges:c=>{const f=Array.isArray(c)?c:[c];n.edgeQueue.push(h=>[...h,...f])},toObject:()=>{const{nodes:c=[],edges:f=[],transform:h}=t.getState(),[g,m,v]=h;return{nodes:c.map(y=>({...y})),edges:f.map(y=>({...y})),viewport:{x:g,y:m,zoom:v}}},deleteElements:async({nodes:c=[],edges:f=[]})=>{const{nodes:h,edges:g,onNodesDelete:m,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:E,onDelete:p,onBeforeDelete:_}=t.getState(),{nodes:N,edges:S}=await ud({nodesToRemove:c,edgesToRemove:f,nodes:h,edges:g,onBeforeDelete:_}),C=S.length>0,M=N.length>0;if(C){const R=S.map(Ur);v?.(S),E(R)}if(M){const R=N.map(Ur);m?.(N),y(R)}return(M||C)&&p?.({nodes:N,edges:S}),{deletedNodes:N,deletedEdges:S}},getIntersectingNodes:(c,f=!0,h)=>{const g=Er(c),m=g?c:d(c),v=h!==void 0;if(!m)return[];const{nodeOrigin:y}=t.getState();return(h||t.getState().nodes).filter(E=>{const p=t.getState().nodeLookup.get(E.id);if(p&&!g&&(E.id===c.id||!p.internals.positionAbsolute))return!1;const _=At(v?E:p,y),N=dn(_,m);return f&&N>0||N>=_.width*_.height||N>=m.width*m.height})},isNodeIntersecting:(c,f,h=!0)=>{const m=Er(c)?c:d(c);if(!m)return!1;const v=dn(m,f);return h&&v>0||v>=f.width*f.height||v>=m.width*m.height},updateNode:l,updateNodeData:(c,f,h={replace:!1})=>{l(c,g=>{const m=typeof f=="function"?f(g):f;return h.replace?{...g,data:m}:{...g,data:{...g.data,...m}}},h)},updateEdge:u,updateEdgeData:(c,f,h={replace:!1})=>{u(c,g=>{const m=typeof f=="function"?f(g):f;return h.replace?{...g,data:m}:{...g,data:{...g.data,...m}}},h)},getNodesBounds:c=>{const{nodeLookup:f,nodeOrigin:h}=t.getState();return id(c,{nodeLookup:f,nodeOrigin:h})},getHandleConnections:({type:c,id:f,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}-${c}${f?`-${f}`:""}`)?.values()??[]),getNodeConnections:({type:c,handleId:f,nodeId:h})=>Array.from(t.getState().connectionLookup.get(`${h}${c?f?`-${c}-${f}`:`-${c}`:""}`)?.values()??[]),fitView:async c=>{const f=t.getState().fitViewResolver??dd();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:f}),n.nodeQueue.push(h=>[...h]),f.promise}}},[]);return H.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const Jr=e=>e.selected,Fh=typeof window<"u"?window:void 0;function Yh({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=re(),{deleteElements:o}=Oo(),r=Tt(e,{actInsideInputWithModifier:!1}),i=Tt(t,{target:Fh});H.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(Jr),edges:s.filter(Jr)}),n.setState({nodesSelectionActive:!1})}},[r]),H.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Xh(e){const t=re();H.useEffect(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const o=Ro(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",xe.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o.disconnect()}}},[])}const kn={position:"absolute",width:"100%",height:"100%",top:0,left:0},Zh=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function qh({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panActivationKeyPressed:r,panOnScrollSpeed:i=.5,panOnScrollMode:s=qe.Free,zoomOnDoubleClick:a=!0,panOnDrag:d=!0,defaultViewport:l,translateExtent:u,minZoom:c,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:g=!0,children:m,noWheelClassName:v,noPanClassName:y,onViewportChange:E,isControlledViewport:p,paneClickDistance:_,selectionOnDrag:N}){const S=re(),C=H.useRef(null),{userSelectionActive:M,lib:R,connectionInProgress:V}=ne(Zh,ie),O=Tt(h),j=H.useRef();Xh(C);const z=H.useCallback(x=>{E?.({x:x[0],y:x[1],zoom:x[2]}),p||S.setState({transform:x})},[E,p]);return H.useEffect(()=>{if(C.current){j.current=Ud({domNode:C.current,minZoom:c,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:I=>S.setState(P=>P.paneDragging===I?P:{paneDragging:I}),onPanZoomStart:(I,P)=>{const{onViewportChangeStart:D,onMoveStart:W}=S.getState();W?.(I,P),D?.(P)},onPanZoom:(I,P)=>{const{onViewportChange:D,onMove:W}=S.getState();W?.(I,P),D?.(P)},onPanZoomEnd:(I,P)=>{const{onViewportChangeEnd:D,onMoveEnd:W}=S.getState();W?.(I,P),D?.(P)}});const{x,y:b,zoom:k}=j.current.getViewport();return S.setState({panZoom:j.current,transform:[x,b,k],domNode:C.current.closest(".react-flow")}),()=>{j.current?.destroy()}}},[]),H.useEffect(()=>{j.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panActivationKeyPressed:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:d,zoomActivationKeyPressed:O,preventScrolling:g,noPanClassName:y,userSelectionActive:M,noWheelClassName:v,lib:R,onTransformChange:z,connectionInProgress:V,selectionOnDrag:N,paneClickDistance:_})},[e,t,n,o,r,i,s,a,d,O,g,y,M,v,R,z,V,N,_]),$.jsx("div",{className:"react-flow__renderer",ref:C,style:kn,children:m})}const Gh=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Uh(){const{userSelectionActive:e,userSelectionRect:t}=ne(Gh,ie);return e&&t?$.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Kn=(e,t)=>n=>{n.target===t.current&&e?.(n)},Kh=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Qh({isSelecting:e,selectionKeyPressed:t,selectionMode:n=It.Full,panOnDrag:o,autoPanOnSelection:r,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:a,onSelectionEnd:d,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:c,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:g,children:m}){const v=H.useRef(0),y=re(),{userSelectionActive:E,elementsSelectable:p,dragging:_,panBy:N,autoPanSpeed:S}=ne(Kh,ie),C=p&&(e||E),M=H.useRef(null),R=H.useRef(),V=H.useRef(new Set),O=H.useRef(new Set),j=H.useRef(!1),z=H.useRef(!1),x=H.useRef({x:0,y:0}),b=H.useRef(!1),k=A=>{if(z.current||j.current||y.getState().connection.inProgress){z.current=!1,j.current=!1;return}const{connectionClickStartHandle:Y,connection:q,onClickConnectEnd:G,resetSelectedElements:Z}=y.getState();if(Y){const U=structuredClone(q);delete U.inProgress,U.toPosition=U.toHandle?U.toHandle.position:null,G?.(A.nativeEvent,U),y.setState({connectionClickStartHandle:null})}l?.(A),Z(),y.setState({nodesSelectionActive:!1})},I=A=>{if(Array.isArray(o)&&o?.includes(2)){A.preventDefault();return}u?.(A)},P=c?A=>c(A):void 0,D=A=>{z.current&&(A.stopPropagation(),z.current=!1)},W=A=>{if(A.pointerType==="touch"&&o!==!1&&!t)return;const{domNode:Y,transform:q}=y.getState();if(R.current=Y?.getBoundingClientRect(),!R.current)return;const G=A.target===M.current;if(!G&&!!A.target.closest(".nokey")||!e||!(s&&G||t)||A.button!==0||!A.isPrimary)return;A.target?.setPointerCapture?.(A.pointerId),z.current=!1;const{x:ee,y:te}=ye(A.nativeEvent,R.current),oe=zt({x:ee,y:te},q);y.setState({userSelectionRect:{width:0,height:0,startX:oe.x,startY:oe.y,x:ee,y:te}}),G||(A.stopPropagation(),A.preventDefault())};function L(A,Y){const{userSelectionRect:q}=y.getState();if(!q)return;const{transform:G,nodeLookup:Z,edgeLookup:U,connectionLookup:ee,triggerNodeChanges:te,triggerEdgeChanges:oe,defaultEdgeOptions:ce}=y.getState(),Me={x:q.startX,y:q.startY},{x:_e,y:Ee}=ht(Me,G),ke={startX:Me.x,startY:Me.y,x:A<_e?A:_e,y:Y<Ee?Y:Ee,width:Math.abs(A-_e),height:Math.abs(Y-Ee)},mt=V.current,Be=O.current;V.current=new Set(ko(Z,ke,G,n===It.Partial,!0).map(de=>de.id)),O.current=new Set;const Ve=ce?.selectable??!0;for(const de of V.current){const Ie=ee.get(de);if(Ie)for(const{edgeId:Ae}of Ie.values()){const je=U.get(Ae);je&&(je.selectable??Ve)&&O.current.add(Ae)}}if(!Sr(mt,V.current)){const de=nt(Z,V.current);te(de)}if(!Sr(Be,O.current)){const de=nt(U,O.current);oe(de)}y.setState({userSelectionRect:ke,userSelectionActive:!0,nodesSelectionActive:!1})}function X(){if(!r||!R.current)return;const[A,Y]=Io(x.current,R.current,S);N({x:A,y:Y}).then(q=>{if(!z.current||!q){v.current=requestAnimationFrame(X);return}const{x:G,y:Z}=x.current;L(G,Z),v.current=requestAnimationFrame(X)})}const Q=()=>{cancelAnimationFrame(v.current),v.current=0,b.current=!1};H.useEffect(()=>()=>Q(),[]);const w=A=>{const{userSelectionRect:Y,transform:q,resetSelectedElements:G}=y.getState();if(!R.current||!Y)return;const{x:Z,y:U}=ye(A.nativeEvent,R.current);x.current={x:Z,y:U};const ee=ht({x:Y.startX,y:Y.startY},q);if(!z.current){const te=t?0:i;if(Math.hypot(Z-ee.x,U-ee.y)<=te)return;G(),a?.(A)}z.current=!0,b.current||(X(),b.current=!0),L(Z,U)},T=A=>{if(!C){A.target===M.current&&y.getState().connection.inProgress&&(j.current=!0);return}A.button===0&&(A.target?.releasePointerCapture?.(A.pointerId),!E&&A.target===M.current&&y.getState().userSelectionRect&&k?.(A),y.setState({userSelectionActive:!1,userSelectionRect:null}),z.current&&(d?.(A),y.setState({nodesSelectionActive:V.current.size>0})),Q())},F=A=>{A.target?.releasePointerCapture?.(A.pointerId),Q()},B=o===!0||Array.isArray(o)&&o.includes(0);return $.jsxs("div",{className:se(["react-flow__pane",{draggable:B,dragging:_,selection:e}]),onClick:C?void 0:Kn(k,M),onContextMenu:Kn(I,M),onWheel:Kn(P,M),onPointerEnter:C?void 0:f,onPointerMove:C?w:h,onPointerUp:T,onPointerCancel:C?F:void 0,onPointerDownCapture:C?W:void 0,onClickCapture:C?D:void 0,onPointerLeave:g,ref:M,style:kn,children:[m,$.jsx(Uh,{})]})}function go({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:d}=t.getState(),l=a.get(e);if(!l){d?.("012",xe.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&s)&&(i({nodes:[l],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function zs({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=re(),[d,l]=H.useState(!1),u=H.useRef();return H.useEffect(()=>{if(!t)return u.current=Hd({getStoreItems:()=>a.getState(),onNodeMouseDown:c=>{go({id:c,store:a,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,a,e]),H.useEffect(()=>{t||!e.current||!u.current||u.current.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:s})},[n,o,t,i,e,r,s]),d}const Jh=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Ls(){const e=re();return H.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:d,nodeLookup:l,nodeOrigin:u}=e.getState(),c=new Map,f=Jh(s),h=r?i[0]:5,g=r?i[1]:5,m=n.direction.x*h*n.factor,v=n.direction.y*g*n.factor;for(const[,y]of l){if(!f(y))continue;let E={x:y.internals.positionAbsolute.x+m,y:y.internals.positionAbsolute.y+v};r&&(E=Ot(E,i));const{position:p,positionAbsolute:_}=os({nodeId:y.id,nextPosition:E,nodeLookup:l,nodeExtent:o,nodeOrigin:u,onError:a});y.position=p,y.internals.positionAbsolute=_,c.set(y.id,y)}d(c)},[])}const zo=H.createContext(null),eg=zo.Provider;zo.Consumer;const Ws=()=>H.useContext(zo),tg=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Bs=H.createContext(null);function ng({children:e}){const t=ne(tg,ie);return $.jsx(Bs.Provider,{value:t,children:e})}function og(){const e=H.useContext(Bs);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const rg={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},ig=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:d,isValid:l}=s;if(!a&&!r)return rg;const u=d?.nodeId===e&&d?.id===t&&d?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:u,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===ft.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:u&&l}};function sg({type:e="source",position:t=K.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:d,className:l,onMouseDown:u,onTouchStart:c,...f},h){const g=s||null,m=e==="target",v=re(),y=Ws(),{connectOnClick:E,noPanClassName:p,rfId:_}=og(),{connectingFrom:N,connectingTo:S,clickConnecting:C,isPossibleEndHandle:M,connectionInProcess:R,clickConnectionInProcess:V,valid:O}=ne(ig(y,g,e),ie);y||v.getState().onError?.("010",xe.error010());const j=b=>{const{defaultEdgeOptions:k,onConnect:I,hasDefaultEdges:P}=v.getState(),D={...k,...b};if(P){const{edges:W,setEdges:L,onError:X}=v.getState();L(zh(D,W,{onError:X}))}I?.(D),a?.(D)},z=b=>{if(!y)return;const k=hs(b.nativeEvent);if(r&&(k&&b.button===0||!k)){const I=v.getState();ho.onPointerDown(b.nativeEvent,{handleDomNode:b.currentTarget,autoPanOnConnect:I.autoPanOnConnect,connectionMode:I.connectionMode,connectionRadius:I.connectionRadius,domNode:I.domNode,nodeLookup:I.nodeLookup,lib:I.lib,isTarget:m,handleId:g,nodeId:y,flowId:I.rfId,panBy:I.panBy,cancelConnection:I.cancelConnection,onConnectStart:I.onConnectStart,onConnectEnd:(...P)=>v.getState().onConnectEnd?.(...P),updateConnection:I.updateConnection,onConnect:j,isValidConnection:n||((...P)=>v.getState().isValidConnection?.(...P)??!0),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:I.autoPanSpeed,dragThreshold:I.connectionDragThreshold})}k?u?.(b):c?.(b)},x=b=>{const{onClickConnectStart:k,onClickConnectEnd:I,connectionClickStartHandle:P,connectionMode:D,isValidConnection:W,lib:L,rfId:X,nodeLookup:Q,connection:w}=v.getState();if(!y||!P&&!r)return;if(!P){k?.(b.nativeEvent,{nodeId:y,handleId:g,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:g}});return}const T=fs(b.target),F=n||W,{connection:B,isValid:A}=ho.isValid(b.nativeEvent,{handle:{nodeId:y,id:g,type:e},connectionMode:D,fromNodeId:P.nodeId,fromHandleId:P.id||null,fromType:P.type,isValidConnection:F,flowId:X,doc:T,lib:L,nodeLookup:Q});A&&B&&j(B);const Y=structuredClone(w);delete Y.inProgress,Y.toPosition=Y.toHandle?Y.toHandle.position:null,I?.(b,Y),v.setState({connectionClickStartHandle:null})};return $.jsx("div",{"data-handleid":g,"data-nodeid":y,"data-handlepos":t,"data-id":`${_}-${y}-${g}-${e}`,className:se(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,l,{source:!m,target:m,connectable:o,connectablestart:r,connectableend:i,clickconnecting:C,connectingfrom:N,connectingto:S,valid:O,connectionindicator:o&&(!R||M)&&(R||V?i:r)}]),onMouseDown:z,onTouchStart:z,onClick:E?x:void 0,ref:h,...f,children:d})}const hn=H.memo(Ds(sg));function ag({data:e,isConnectable:t,sourcePosition:n=K.Bottom}){return $.jsxs($.Fragment,{children:[e?.label,$.jsx(hn,{type:"source",position:n,isConnectable:t})]})}function cg({data:e,isConnectable:t,targetPosition:n=K.Top,sourcePosition:o=K.Bottom}){return $.jsxs($.Fragment,{children:[$.jsx(hn,{type:"target",position:n,isConnectable:t}),e?.label,$.jsx(hn,{type:"source",position:o,isConnectable:t})]})}function ug(){return null}function lg({data:e,isConnectable:t,targetPosition:n=K.Top}){return $.jsxs($.Fragment,{children:[$.jsx(hn,{type:"target",position:n,isConnectable:t}),e?.label]})}const gn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ei={input:ag,default:cg,output:lg,group:ug};function fg(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const dg=e=>{const{width:t,height:n,x:o,y:r}=Ht(e.nodeLookup,{filter:i=>!!i.selected});return{width:me(t)?t:null,height:me(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function hg({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=re(),{width:r,height:i,transformString:s,userSelectionActive:a}=ne(dg,ie),d=Ls(),l=H.useRef(null);H.useEffect(()=>{n||l.current?.focus({preventScroll:!0})},[n]);const u=!a&&r!==null&&i!==null;if(zs({nodeRef:l,disabled:!u}),!u)return null;const c=e?h=>{const g=o.getState().nodes.filter(m=>m.selected);e(h,g)}:void 0,f=h=>{Object.prototype.hasOwnProperty.call(gn,h.key)&&(h.preventDefault(),d({direction:gn[h.key],factor:h.shiftKey?4:1}))};return $.jsx("div",{className:se(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:$.jsx("div",{ref:l,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:r,height:i}})})}const ti=typeof window<"u"?window:void 0,gg=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Vs({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:d,selectionKeyCode:l,selectionOnDrag:u,selectionMode:c,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:g,panActivationKeyCode:m,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:E,zoomOnPinch:p,panOnScroll:_,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:M,autoPanOnSelection:R,defaultViewport:V,translateExtent:O,minZoom:j,maxZoom:z,preventScrolling:x,onSelectionContextMenu:b,noWheelClassName:k,noPanClassName:I,disableKeyboardA11y:P,onViewportChange:D,isControlledViewport:W}){const{nodesSelectionActive:L,userSelectionActive:X}=ne(gg,ie),Q=Tt(l,{target:ti}),w=Tt(m,{target:ti}),T=w||M,F=w||_,B=u&&T!==!0,A=Q||X||B;return Yh({deleteKeyCode:d,multiSelectionKeyCode:g}),$.jsx(qh,{onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:E,zoomOnPinch:p,panOnScroll:F,panActivationKeyPressed:w,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!Q&&T,defaultViewport:V,translateExtent:O,minZoom:j,maxZoom:z,zoomActivationKeyCode:v,preventScrolling:x,noWheelClassName:k,noPanClassName:I,onViewportChange:D,isControlledViewport:W,paneClickDistance:a,selectionOnDrag:B,children:$.jsxs(Qh,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:T,autoPanOnSelection:R,isSelecting:!!A,selectionMode:c,selectionKeyPressed:Q,paneClickDistance:a,selectionOnDrag:B,children:[e,L&&$.jsx(hg,{onSelectionContextMenu:b,noPanClassName:I,disableKeyboardA11y:P})]})})}Vs.displayName="FlowRenderer";const pg=H.memo(Vs),mg=e=>t=>e?ko(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function yg(e){return ne(H.useCallback(mg(e),[e]),ie)}const xg=e=>e.updateNodeInternals;function wg(){const e=ne(xg),[t]=H.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),e(o)}));return H.useEffect(()=>()=>{t?.disconnect()},[t]),t}function vg({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=re(),i=H.useRef(null),s=H.useRef(null),a=H.useRef(e.sourcePosition),d=H.useRef(e.targetPosition),l=H.useRef(t),u=n&&!!e.internals.handleBounds;return H.useEffect(()=>{i.current&&!e.hidden&&(!u||s.current!==i.current)&&(s.current&&o?.unobserve(s.current),o?.observe(i.current),s.current=i.current)},[u,e.hidden]),H.useEffect(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),H.useEffect(()=>{if(i.current){const c=l.current!==t,f=a.current!==e.sourcePosition,h=d.current!==e.targetPosition;(c||f||h)&&(l.current=t,a.current=e.sourcePosition,d.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function _g({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:d,nodesConnectable:l,nodesFocusable:u,resizeObserver:c,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:g,rfId:m,nodeTypes:v,nodeClickDistance:y,onError:E}){const{node:p,internals:_,isParent:N}=ne(A=>{const Y=A.nodeLookup.get(e),q=A.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:q}},ie);let S=p.type||"default",C=v?.[S]||ei[S];C===void 0&&(E?.("003",xe.error003(S)),S="default",C=v?.default||ei.default);const M=!!(p.draggable||a&&typeof p.draggable>"u"),R=!!(p.selectable||d&&typeof p.selectable>"u"),V=!!(p.connectable||l&&typeof p.connectable>"u"),O=!!(p.focusable||u&&typeof p.focusable>"u"),j=re(),z=cs(p),x=vg({node:p,nodeType:S,hasDimensions:z,resizeObserver:c}),b=zs({nodeRef:x,disabled:p.hidden||!M,noDragClassName:f,handleSelector:p.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:y}),k=Ls();if(p.hidden)return null;const I=ve(p),P=fg(p),D=R||M||t||n||o||r,W=n?A=>n(A,{..._.userNode}):void 0,L=o?A=>o(A,{..._.userNode}):void 0,X=r?A=>r(A,{..._.userNode}):void 0,Q=i?A=>i(A,{..._.userNode}):void 0,w=s?A=>s(A,{..._.userNode}):void 0,T=A=>{const{selectNodesOnDrag:Y,nodeDragThreshold:q}=j.getState();R&&(!Y||!M||q>0)&&go({id:e,store:j,nodeRef:x}),t&&t(A,{..._.userNode})},F=A=>{if(!(ds(A.nativeEvent)||g)){if(Ji.includes(A.key)&&R){const Y=A.key==="Escape";go({id:e,store:j,unselect:Y,nodeRef:x})}else if(M&&p.selected&&Object.prototype.hasOwnProperty.call(gn,A.key)){A.preventDefault();const{ariaLabelConfig:Y}=j.getState();j.setState({ariaLiveMessage:Y["node.a11yDescription.ariaLiveMessage"]({direction:A.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),k({direction:gn[A.key],factor:A.shiftKey?4:1})}}},B=()=>{if(g||!x.current?.matches(":focus-visible"))return;const{transform:A,width:Y,height:q,autoPanOnNodeFocus:G,setCenter:Z}=j.getState();if(!G)return;ko(new Map([[e,p]]),{x:0,y:0,width:Y,height:q},A,!0).length>0||Z(p.position.x+I.width/2,p.position.y+I.height/2,{zoom:A[2]})};return $.jsx("div",{className:se(["react-flow__node",`react-flow__node-${S}`,{[h]:M},p.className,{selected:p.selected,selectable:R,parent:N,draggable:M,dragging:b}]),ref:x,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:z?"visible":"hidden",...p.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:W,onMouseMove:L,onMouseLeave:X,onContextMenu:Q,onClick:T,onDoubleClick:w,onKeyDown:O?F:void 0,tabIndex:O?0:void 0,onFocus:O?B:void 0,role:p.ariaRole??(O?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${Rs}-${m}`,"aria-label":p.ariaLabel,...p.domAttributes,children:$.jsx(eg,{value:e,children:$.jsx(C,{id:e,data:p.data,type:S,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:p.selected??!1,selectable:R,draggable:M,deletable:p.deletable??!0,isConnectable:V,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:b,dragHandle:p.dragHandle,zIndex:_.z,parentId:p.parentId,...I})})})}var Eg=H.memo(_g);const Sg=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function js(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,onError:r}=ne(Sg,ie),i=yg(e.onlyRenderVisibleElements),s=wg();return $.jsx("div",{className:"react-flow__nodes",style:kn,children:i.map(a=>$.jsx(Eg,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:r},a))})}js.displayName="NodeRenderer";const bg=H.memo(js);function Cg(e){return ne(H.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&md({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),ie)}const Ng=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return $.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Mg=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return $.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ni={[ln.Arrow]:Ng,[ln.ArrowClosed]:Mg};function kg(e){const t=re();return H.useMemo(()=>Object.prototype.hasOwnProperty.call(ni,e)?ni[e]:(t.getState().onError?.("009",xe.error009(e)),null),[e])}const Ig=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const d=kg(t);return d?$.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:$.jsx(d,{color:n,strokeWidth:s})}):null},Fs=({defaultColor:e,rfId:t})=>{const n=ne(i=>i.edges),o=ne(i=>i.defaultEdgeOptions),r=H.useMemo(()=>Cd(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?$.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:$.jsx("defs",{children:r.map(i=>$.jsx(Ig,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Fs.displayName="MarkerDefinitions";var Ag=H.memo(Fs);function Ys({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:d,className:l,...u}){const[c,f]=H.useState({x:1,y:0,width:0,height:0}),h=se(["react-flow__edge-textwrapper",l]),g=H.useRef(null);return H.useEffect(()=>{if(g.current){const m=g.current.getBBox();f({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),n?$.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:h,visibility:c.width?"visible":"hidden",...u,children:[r&&$.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),$.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:g,style:o,children:n}),d]}):null}Ys.displayName="EdgeText";const Rg=H.memo(Ys);function In({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:d,interactionWidth:l=20,...u}){return $.jsxs($.Fragment,{children:[$.jsx("path",{...u,d:e,fill:"none",className:se(["react-flow__edge-path",u.className])}),l?$.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:l,className:"react-flow__edge-interaction"}):null,o&&me(t)&&me(n)?$.jsx(Rg,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:d}):null]})}function oi({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===K.Left||e===K.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function Xs({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:o,targetY:r,targetPosition:i=K.Top}){const[s,a]=oi({pos:n,x1:e,y1:t,x2:o,y2:r}),[d,l]=oi({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,c,f,h]=gs({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:d,targetControlY:l});return[`M${e},${t} C${s},${a} ${d},${l} ${o},${r}`,u,c,f,h]}function Zs(e){return H.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,interactionWidth:y})=>{const[E,p,_]=Xs({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),N=e.isInternal?void 0:t;return $.jsx(In,{id:N,path:E,labelX:p,labelY:_,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,interactionWidth:y})})}const Tg=Zs({isInternal:!1}),qs=Zs({isInternal:!0});Tg.displayName="SimpleBezierEdge";qs.displayName="SimpleBezierEdgeInternal";function Gs(e){return H.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:d,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:c,style:f,sourcePosition:h=K.Bottom,targetPosition:g=K.Top,markerEnd:m,markerStart:v,pathOptions:y,interactionWidth:E})=>{const[p,_,N]=uo({sourceX:n,sourceY:o,sourcePosition:h,targetX:r,targetY:i,targetPosition:g,borderRadius:y?.borderRadius,offset:y?.offset,stepPosition:y?.stepPosition}),S=e.isInternal?void 0:t;return $.jsx(In,{id:S,path:p,labelX:_,labelY:N,label:s,labelStyle:a,labelShowBg:d,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:c,style:f,markerEnd:m,markerStart:v,interactionWidth:E})})}const Us=Gs({isInternal:!1}),Ks=Gs({isInternal:!0});Us.displayName="SmoothStepEdge";Ks.displayName="SmoothStepEdgeInternal";function Qs(e){return H.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return $.jsx(Us,{...n,id:o,pathOptions:H.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const Pg=Qs({isInternal:!1}),Js=Qs({isInternal:!0});Pg.displayName="StepEdge";Js.displayName="StepEdgeInternal";function ea(e){return H.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:d,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:c,style:f,markerEnd:h,markerStart:g,interactionWidth:m})=>{const[v,y,E]=ys({sourceX:n,sourceY:o,targetX:r,targetY:i}),p=e.isInternal?void 0:t;return $.jsx(In,{id:p,path:v,labelX:y,labelY:E,label:s,labelStyle:a,labelShowBg:d,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:c,style:f,markerEnd:h,markerStart:g,interactionWidth:m})})}const $g=ea({isInternal:!1}),ta=ea({isInternal:!0});$g.displayName="StraightEdge";ta.displayName="StraightEdgeInternal";function na(e){return H.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=K.Bottom,targetPosition:a=K.Top,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,pathOptions:y,interactionWidth:E})=>{const[p,_,N]=ps({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:y?.curvature}),S=e.isInternal?void 0:t;return $.jsx(In,{id:S,path:p,labelX:_,labelY:N,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:h,style:g,markerEnd:m,markerStart:v,interactionWidth:E})})}const Dg=na({isInternal:!1}),oa=na({isInternal:!0});Dg.displayName="BezierEdge";oa.displayName="BezierEdgeInternal";const ri={default:oa,straight:ta,step:Js,smoothstep:Ks,simplebezier:qs},ii={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},Hg=(e,t,n)=>n===K.Left?e-t:n===K.Right?e+t:e,Og=(e,t,n)=>n===K.Top?e-t:n===K.Bottom?e+t:e,si="react-flow__edgeupdater";function ai({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return $.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:se([si,`${si}-${a}`]),cx:Hg(t,o,e),cy:Og(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function zg({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:d,onReconnect:l,onReconnectStart:u,onReconnectEnd:c,setReconnecting:f,setUpdateHover:h}){const g=re(),m=(_,N)=>{if(_.button!==0)return;const{autoPanOnConnect:S,domNode:C,connectionMode:M,connectionRadius:R,lib:V,onConnectStart:O,cancelConnection:j,nodeLookup:z,rfId:x,panBy:b,updateConnection:k}=g.getState(),I=N.type==="target",P=(L,X)=>{f(!1),c?.(L,n,N.type,X)},D=L=>l?.(n,L),W=(L,X)=>{f(!0),u?.(_,n,N.type),O?.(L,X)};ho.onPointerDown(_.nativeEvent,{autoPanOnConnect:S,connectionMode:M,connectionRadius:R,domNode:C,handleId:N.id,nodeId:N.nodeId,nodeLookup:z,isTarget:I,edgeUpdaterType:N.type,lib:V,flowId:x,cancelConnection:j,panBy:b,isValidConnection:(...L)=>g.getState().isValidConnection?.(...L)??!0,onConnect:D,onConnectStart:W,onConnectEnd:(...L)=>g.getState().onConnectEnd?.(...L),onReconnectEnd:P,updateConnection:k,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},v=_=>m(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=_=>m(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),E=()=>h(!0),p=()=>h(!1);return $.jsxs($.Fragment,{children:[(e===!0||e==="source")&&$.jsx(ai,{position:a,centerX:o,centerY:r,radius:t,onMouseDown:v,onMouseEnter:E,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&$.jsx(ai,{position:d,centerX:i,centerY:s,radius:t,onMouseDown:y,onMouseEnter:E,onMouseOut:p,type:"target"})]})}function Lg({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:d,onMouseLeave:l,reconnectRadius:u,onReconnect:c,onReconnectStart:f,onReconnectEnd:h,rfId:g,edgeTypes:m,noPanClassName:v,onError:y,disableKeyboardA11y:E}){let p=ne(Z=>Z.edgeLookup.get(e));const _=ne(Z=>Z.defaultEdgeOptions);p=_?{..._,...p}:p;let N=p.type||"default",S=m?.[N]||ri[N];S===void 0&&(y?.("011",xe.error011(N)),N="default",S=m?.default||ri.default);const C=!!(p.focusable||t&&typeof p.focusable>"u"),M=typeof c<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),R=!!(p.selectable||o&&typeof p.selectable>"u"),V=H.useRef(null),[O,j]=H.useState(!1),[z,x]=H.useState(!1),b=re(),{zIndex:k=p.zIndex,sourceX:I,sourceY:P,targetX:D,targetY:W,sourcePosition:L,targetPosition:X}=ne(H.useCallback(Z=>{const U=Z.nodeLookup.get(p.source),ee=Z.nodeLookup.get(p.target);if(!U||!ee)return ii;const te=bd({id:e,sourceNode:U,targetNode:ee,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:Z.connectionMode,onError:y}),oe=pd({selected:p.selected,zIndex:p.zIndex,sourceNode:U,targetNode:ee,elevateOnSelect:Z.elevateEdgesOnSelect,zIndexMode:Z.zIndexMode});return{...te||ii,zIndex:oe}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex,y]),ie),Q=H.useMemo(()=>p.markerStart?`url('#${lo(p.markerStart,g)}')`:void 0,[p.markerStart,g]),w=H.useMemo(()=>p.markerEnd?`url('#${lo(p.markerEnd,g)}')`:void 0,[p.markerEnd,g]);if(p.hidden||I===null||P===null||D===null||W===null)return null;const T=Z=>{const{addSelectedEdges:U,unselectNodesAndEdges:ee,multiSelectionActive:te}=b.getState();R&&(b.setState({nodesSelectionActive:!1}),p.selected&&te?(ee({nodes:[],edges:[p]}),V.current?.blur()):U([e])),r&&r(Z,p)},F=i?Z=>{i(Z,{...p})}:void 0,B=s?Z=>{s(Z,{...p})}:void 0,A=a?Z=>{a(Z,{...p})}:void 0,Y=d?Z=>{d(Z,{...p})}:void 0,q=l?Z=>{l(Z,{...p})}:void 0,G=Z=>{if(!E&&Ji.includes(Z.key)&&R){const{unselectNodesAndEdges:U,addSelectedEdges:ee}=b.getState();Z.key==="Escape"?(V.current?.blur(),U({edges:[p]})):ee([e])}};return $.jsx("svg",{style:{zIndex:k},children:$.jsxs("g",{className:se(["react-flow__edge",`react-flow__edge-${N}`,p.className,v,{selected:p.selected,animated:p.animated,inactive:!R&&!r,updating:O,selectable:R}]),onClick:T,onDoubleClick:F,onContextMenu:B,onMouseEnter:A,onMouseMove:Y,onMouseLeave:q,onKeyDown:C?G:void 0,tabIndex:C?0:void 0,role:p.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":C?`${Ts}-${g}`:void 0,ref:V,...p.domAttributes,children:[!z&&$.jsx(S,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:R,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:I,sourceY:P,targetX:D,targetY:W,sourcePosition:L,targetPosition:X,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:Q,markerEnd:w,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),M&&$.jsx(zg,{edge:p,isReconnectable:M,reconnectRadius:u,onReconnect:c,onReconnectStart:f,onReconnectEnd:h,sourceX:I,sourceY:P,targetX:D,targetY:W,sourcePosition:L,targetPosition:X,setUpdateHover:j,setReconnecting:x})]})})}var Wg=H.memo(Lg);const Bg=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ra({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:d,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:c,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:g,disableKeyboardA11y:m}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:E,onError:p}=ne(Bg,ie),_=Cg(t);return $.jsxs("div",{className:"react-flow__edges",children:[$.jsx(Ag,{defaultColor:e,rfId:n}),_.map(N=>$.jsx(Wg,{id:N,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:E,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:d,onMouseLeave:l,onClick:u,reconnectRadius:c,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:g,rfId:n,onError:p,edgeTypes:o,disableKeyboardA11y:m},N))]})}ra.displayName="EdgeRenderer";const Vg=H.memo(ra),ci=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function jg({children:e}){const t=re(),n=H.useRef(null),[o]=H.useState(()=>t.getState().transform);return Hs(()=>{let r=null;const i=()=>{const s=t.getState().transform;r&&s[0]===r[0]&&s[1]===r[1]&&s[2]===r[2]||(r=s,n.current&&(n.current.style.transform=ci(s)))};return i(),t.subscribe(i)},[t]),$.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:ci(o)},children:e})}function Fg(e){const t=Oo(),n=H.useRef(!1);H.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Yg=e=>e.panZoom?.syncViewport;function Xg(e){const t=ne(Yg),n=re();return H.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Zg(e){return e.connection.inProgress?{...e.connection,to:zt(e.connection.to,e.transform)}:{...e.connection}}function qg(e){return Zg}function Gg(e){const t=qg();return ne(t,ie)}const Ug=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Kg({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:d}=ne(Ug,ie);return!(i&&r&&d)?null:$.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:$.jsx("g",{className:se(["react-flow__connection",ls(a)]),children:$.jsx(ia,{style:t,type:n,CustomComponent:o,isValid:a})})})}const ia=({style:e,type:t=ze.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:d,to:l,toNode:u,toHandle:c,toPosition:f,pointer:h}=Gg();if(!r)return;if(n)return $.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:l.x,toY:l.y,fromPosition:d,toPosition:f,connectionStatus:ls(o),toNode:u,toHandle:c,pointer:h});let g="";const m={sourceX:i.x,sourceY:i.y,sourcePosition:d,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case ze.Bezier:[g]=ps(m);break;case ze.SimpleBezier:[g]=Xs(m);break;case ze.Step:[g]=uo({...m,borderRadius:0});break;case ze.SmoothStep:[g]=uo(m);break;default:[g]=ys(m)}return $.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:e})};ia.displayName="ConnectionLine";const Qg={};function ui(e=Qg){H.useRef(e),re(),H.useEffect(()=>{},[e])}function Jg(){re(),H.useRef(!1),H.useEffect(()=>{},[])}function sa({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:d,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:c,onSelectionStart:f,onSelectionEnd:h,connectionLineType:g,connectionLineStyle:m,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:E,selectionOnDrag:p,selectionMode:_,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:M,onlyRenderVisibleElements:R,elementsSelectable:V,defaultViewport:O,translateExtent:j,minZoom:z,maxZoom:x,preventScrolling:b,defaultMarkerColor:k,zoomOnScroll:I,zoomOnPinch:P,panOnScroll:D,panOnScrollSpeed:W,panOnScrollMode:L,zoomOnDoubleClick:X,panOnDrag:Q,autoPanOnSelection:w,onPaneClick:T,onPaneMouseEnter:F,onPaneMouseMove:B,onPaneMouseLeave:A,onPaneScroll:Y,onPaneContextMenu:q,paneClickDistance:G,nodeClickDistance:Z,onEdgeContextMenu:U,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:oe,reconnectRadius:ce,onReconnect:Me,onReconnectStart:_e,onReconnectEnd:Ee,noDragClassName:ke,noWheelClassName:mt,noPanClassName:Be,disableKeyboardA11y:Ve,nodeExtent:de,rfId:Ie,viewport:Ae,onViewportChange:je,nodesDraggable:An}){return ui(e),ui(t),Jg(),Fg(n),Xg(Ae),$.jsx(pg,{onPaneClick:T,onPaneMouseEnter:F,onPaneMouseMove:B,onPaneMouseLeave:A,onPaneContextMenu:q,onPaneScroll:Y,paneClickDistance:G,deleteKeyCode:M,selectionKeyCode:E,selectionOnDrag:p,selectionMode:_,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:V,zoomOnScroll:I,zoomOnPinch:P,zoomOnDoubleClick:X,panOnScroll:D,panOnScrollSpeed:W,panOnScrollMode:L,panOnDrag:Q,autoPanOnSelection:w,defaultViewport:O,translateExtent:j,minZoom:z,maxZoom:x,onSelectionContextMenu:c,preventScrolling:b,noDragClassName:ke,noWheelClassName:mt,noPanClassName:Be,disableKeyboardA11y:Ve,onViewportChange:je,isControlledViewport:!!Ae,children:$.jsxs(jg,{children:[$.jsx(Vg,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:Me,onReconnectStart:_e,onReconnectEnd:Ee,onlyRenderVisibleElements:R,onEdgeContextMenu:U,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:oe,reconnectRadius:ce,defaultMarkerColor:k,noPanClassName:Be,disableKeyboardA11y:Ve,rfId:Ie}),$.jsx(Kg,{style:m,type:g,component:v,containerStyle:y}),$.jsx("div",{className:"react-flow__edgelabel-renderer"}),$.jsx(bg,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:d,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:Z,onlyRenderVisibleElements:R,noPanClassName:Be,noDragClassName:ke,disableKeyboardA11y:Ve,nodeExtent:de,rfId:Ie,nodesDraggable:An}),$.jsx("div",{className:"react-flow__viewport-portal"})]})})}sa.displayName="GraphView";const ep=H.memo(sa),tp=as(),li=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:d=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:c,zIndexMode:f="basic"}={})=>{const h=new Map,g=new Map,m=new Map,v=new Map,y=o??t??[],E=n??e??[],p=u??[0,0],_=c??kt;vs(m,v,y);const{nodesInitialized:N}=fo(E,h,g,{nodeOrigin:p,nodeExtent:_,zIndexMode:f});let S=[0,0,1];if(s&&r&&i){const C=Ht(h,{filter:O=>!!((O.width||O.initialWidth)&&(O.height||O.initialHeight))}),{x:M,y:R,zoom:V}=Ao(C,r,i,d,l,a?.padding??.1);S=[M,R,V]}return{rfId:"1",width:r??0,height:i??0,transform:S,nodes:E,nodesInitialized:N,nodeLookup:h,parentLookup:g,edges:y,edgeLookup:v,connectionLookup:m,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:d,maxZoom:l,translateExtent:kt,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ft.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:p,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...ts},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:tp,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:es,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},np=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:d,maxZoom:l,nodeOrigin:u,nodeExtent:c,zIndexMode:f})=>hh((h,g)=>{async function m(){const{nodeLookup:v,panZoom:y,fitViewOptions:E,fitViewResolver:p,width:_,height:N,minZoom:S,maxZoom:C}=g();y&&(await cd({nodes:v,width:_,height:N,panZoom:y,minZoom:S,maxZoom:C},E),p?.resolve(!0),h({fitViewResolver:null}))}return{...li({nodes:e,edges:t,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:d,maxZoom:l,nodeOrigin:u,nodeExtent:c,defaultNodes:n,defaultEdges:o,zIndexMode:f}),setNodes:v=>{const{nodeLookup:y,parentLookup:E,nodeOrigin:p,nodeExtent:_,elevateNodesOnSelect:N,fitViewQueued:S,zIndexMode:C,nodesSelectionActive:M}=g(),{nodesInitialized:R,hasSelectedNodes:V}=fo(v,y,E,{nodeOrigin:p,nodeExtent:_,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:C}),O=M&&V;S&&R?(m(),h({nodes:v,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):h({nodes:v,nodesInitialized:R,nodesSelectionActive:O})},setEdges:v=>{const{connectionLookup:y,edgeLookup:E}=g();vs(y,E,v),h({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:E}=g();E(v),h({hasDefaultNodes:!0})}if(y){const{setEdges:E}=g();E(y),h({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:E,parentLookup:p,domNode:_,nodeOrigin:N,nodeExtent:S,debug:C,fitViewQueued:M,zIndexMode:R}=g(),{changes:V,updatedInternals:O}=Td(v,E,p,_,N,S,R);O&&(kd(E,p,{nodeOrigin:N,nodeExtent:S,zIndexMode:R}),M?(m(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),V?.length>0&&(C&&console.log("React Flow: trigger node changes",V),y?.(V)))},updateNodePositions:(v,y=!1)=>{const E=[];let p=[];const{nodeLookup:_,triggerNodeChanges:N,connection:S,updateConnection:C,onNodesChangeMiddlewareMap:M}=g();for(const[R,V]of v){const O=_.get(R),j=!!(O?.expandParent&&O?.parentId&&V?.position),z={id:R,type:"position",position:j?{x:Math.max(0,V.position.x),y:Math.max(0,V.position.y)}:V.position,dragging:y};if(O&&S.inProgress&&S.fromNode.id===O.id){const x=et(O,S.fromHandle,K.Left,!0);C({...S,from:x})}j&&O.parentId&&E.push({id:R,parentId:O.parentId,rect:{...V.internals.positionAbsolute,width:V.measured.width??0,height:V.measured.height??0}}),p.push(z)}if(E.length>0){const{parentLookup:R,nodeOrigin:V}=g(),O=Ho(E,_,R,V);p.push(...O)}for(const R of M.values())p=R(p);N(p)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:E,nodes:p,hasDefaultNodes:_,debug:N}=g();if(v?.length){if(_){const S=Dh(v,p);E(S)}N&&console.log("React Flow: trigger node changes",v),y?.(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:E,edges:p,hasDefaultEdges:_,debug:N}=g();if(v?.length){if(_){const S=Hh(v,p);E(S)}N&&console.log("React Flow: trigger edge changes",v),y?.(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:E,nodeLookup:p,triggerNodeChanges:_,triggerEdgeChanges:N}=g();if(y){const S=v.map(C=>Fe(C,!0));_(S);return}_(nt(p,new Set([...v]))),N(nt(E))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:E,nodeLookup:p,triggerNodeChanges:_,triggerEdgeChanges:N}=g();if(y){const S=v.map(C=>Fe(C,!0));N(S);return}N(nt(E,new Set([...v]))),_(nt(p,new Set))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:E,nodes:p,nodeLookup:_,triggerNodeChanges:N,triggerEdgeChanges:S}=g(),C=v||p,M=y||E,R=[];for(const O of C)O.selected&&R.push(Fe(O.id,!1));const V=[];for(const O of M)O.selected&&V.push(Fe(O.id,!1));N(R),S(V)},setMinZoom:v=>{const{panZoom:y,maxZoom:E}=g();y?.setScaleExtent([v,E]),h({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:E}=g();y?.setScaleExtent([E,v]),h({maxZoom:v})},setTranslateExtent:v=>{g().panZoom?.setTranslateExtent(v),h({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:E,triggerEdgeChanges:p,elementsSelectable:_}=g();if(!_)return;const N=y.reduce((C,M)=>M.selected?[...C,Fe(M.id,!1)]:C,[]),S=v.reduce((C,M)=>M.selected?[...C,Fe(M.id,!1)]:C,[]);E(N),p(S)},setNodeExtent:v=>{const{nodes:y,nodeLookup:E,parentLookup:p,nodeOrigin:_,elevateNodesOnSelect:N,nodeExtent:S,zIndexMode:C}=g();v[0][0]===S[0][0]&&v[0][1]===S[0][1]&&v[1][0]===S[1][0]&&v[1][1]===S[1][1]||(fo(y,E,p,{nodeOrigin:_,nodeExtent:v,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:C}),h({nodeExtent:v}))},panBy:v=>{const{transform:y,width:E,height:p,panZoom:_,translateExtent:N}=g();return Pd({delta:v,panZoom:_,transform:y,translateExtent:N,width:E,height:p})},setCenter:async(v,y,E)=>{const{width:p,height:_,maxZoom:N,panZoom:S}=g();if(!S)return!1;const C=typeof E?.zoom<"u"?E.zoom:N;return await S.setViewport({x:p/2-v*C,y:_/2-y*C,zoom:C},{duration:E?.duration,ease:E?.ease,interpolate:E?.interpolate}),!0},cancelConnection:()=>{h({connection:{...ts}})},updateConnection:v=>{h({connection:v})},reset:()=>h({...li()})}},Object.is);function op({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:d,fitView:l,nodeOrigin:u,nodeExtent:c,zIndexMode:f,children:h}){const[g]=H.useState(()=>np({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:l,minZoom:s,maxZoom:a,fitViewOptions:d,nodeOrigin:u,nodeExtent:c,zIndexMode:f}));return $.jsx(ph,{value:g,children:$.jsx(Bh,{children:$.jsx(ng,{children:h})})})}function rp({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:d,minZoom:l,maxZoom:u,nodeOrigin:c,nodeExtent:f,zIndexMode:h}){return H.useContext(Nn)?$.jsx($.Fragment,{children:e}):$.jsx(op,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:d,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:c,nodeExtent:f,zIndexMode:h,children:e})}const ip={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function sp({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:d,onInit:l,onMove:u,onMoveStart:c,onMoveEnd:f,onConnect:h,onConnectStart:g,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:E,onNodeMouseMove:p,onNodeMouseLeave:_,onNodeContextMenu:N,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:M,onNodeDragStop:R,onNodesDelete:V,onEdgesDelete:O,onDelete:j,onSelectionChange:z,onSelectionDragStart:x,onSelectionDrag:b,onSelectionDragStop:k,onSelectionContextMenu:I,onSelectionStart:P,onSelectionEnd:D,onBeforeDelete:W,connectionMode:L,connectionLineType:X=ze.Bezier,connectionLineStyle:Q,connectionLineComponent:w,connectionLineContainerStyle:T,deleteKeyCode:F="Backspace",selectionKeyCode:B="Shift",selectionOnDrag:A=!1,selectionMode:Y=It.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:G=Rt()?"Meta":"Control",zoomActivationKeyCode:Z=Rt()?"Meta":"Control",snapToGrid:U,snapGrid:ee,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:oe,nodesDraggable:ce,autoPanOnNodeFocus:Me,nodesConnectable:_e,nodesFocusable:Ee,nodeOrigin:ke=Ps,edgesFocusable:mt,edgesReconnectable:Be,elementsSelectable:Ve=!0,defaultViewport:de=kh,minZoom:Ie=.5,maxZoom:Ae=2,translateExtent:je=kt,preventScrolling:An=!0,nodeExtent:Rn,defaultMarkerColor:la="#b1b1b7",zoomOnScroll:fa=!0,zoomOnPinch:da=!0,panOnScroll:ha=!1,panOnScrollSpeed:ga=.5,panOnScrollMode:pa=qe.Free,zoomOnDoubleClick:ma=!0,panOnDrag:ya=!0,onPaneClick:xa,onPaneMouseEnter:wa,onPaneMouseMove:va,onPaneMouseLeave:_a,onPaneScroll:Ea,onPaneContextMenu:Sa,paneClickDistance:ba=1,nodeClickDistance:Ca=0,children:Na,onReconnect:Ma,onReconnectStart:ka,onReconnectEnd:Ia,onEdgeContextMenu:Aa,onEdgeDoubleClick:Ra,onEdgeMouseEnter:Ta,onEdgeMouseMove:Pa,onEdgeMouseLeave:$a,reconnectRadius:Da=10,onNodesChange:Ha,onEdgesChange:Oa,noDragClassName:za="nodrag",noWheelClassName:La="nowheel",noPanClassName:Lo="nopan",fitView:Wo,fitViewOptions:Bo,connectOnClick:Wa,attributionPosition:Ba,proOptions:Va,defaultEdgeOptions:ja,elevateNodesOnSelect:Fa=!0,elevateEdgesOnSelect:Ya=!1,disableKeyboardA11y:Vo=!1,autoPanOnConnect:Xa,autoPanOnNodeDrag:Za,autoPanOnSelection:qa=!0,autoPanSpeed:Ga,connectionRadius:Ua,isValidConnection:Ka,onError:Qa,style:Ja,id:jo,nodeDragThreshold:ec,connectionDragThreshold:tc,viewport:nc,onViewportChange:oc,width:rc,height:ic,colorMode:sc="light",debug:ac,onScroll:Fo,ariaLabelConfig:cc,zIndexMode:Yo="basic",...uc},lc){const Tn=jo||"1",fc=Th(sc),dc=H.useCallback(Xo=>{Xo.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Fo?.(Xo)},[Fo]);return $.jsx("div",{"data-testid":"rf__wrapper",...uc,onScroll:dc,style:{...Ja,...ip},ref:lc,className:se(["react-flow",r,fc]),id:jo,role:"application",children:$.jsxs(rp,{nodes:e,edges:t,width:rc,height:ic,fitView:Wo,fitViewOptions:Bo,minZoom:Ie,maxZoom:Ae,nodeOrigin:ke,nodeExtent:Rn,zIndexMode:Yo,children:[$.jsx(Rh,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:h,onConnectStart:g,onConnectEnd:m,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:ce,autoPanOnNodeFocus:Me,nodesConnectable:_e,nodesFocusable:Ee,edgesFocusable:mt,edgesReconnectable:Be,elementsSelectable:Ve,elevateNodesOnSelect:Fa,elevateEdgesOnSelect:Ya,minZoom:Ie,maxZoom:Ae,nodeExtent:Rn,onNodesChange:Ha,onEdgesChange:Oa,snapToGrid:U,snapGrid:ee,connectionMode:L,translateExtent:je,connectOnClick:Wa,defaultEdgeOptions:ja,fitView:Wo,fitViewOptions:Bo,onNodesDelete:V,onEdgesDelete:O,onDelete:j,onNodeDragStart:C,onNodeDrag:M,onNodeDragStop:R,onSelectionDrag:b,onSelectionDragStart:x,onSelectionDragStop:k,onMove:u,onMoveStart:c,onMoveEnd:f,noPanClassName:Lo,nodeOrigin:ke,rfId:Tn,autoPanOnConnect:Xa,autoPanOnNodeDrag:Za,autoPanSpeed:Ga,onError:Qa,connectionRadius:Ua,isValidConnection:Ka,selectNodesOnDrag:oe,nodeDragThreshold:ec,connectionDragThreshold:tc,onBeforeDelete:W,debug:ac,ariaLabelConfig:cc,zIndexMode:Yo}),$.jsx(ep,{onInit:l,onNodeClick:a,onEdgeClick:d,onNodeMouseEnter:E,onNodeMouseMove:p,onNodeMouseLeave:_,onNodeContextMenu:N,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:s,connectionLineType:X,connectionLineStyle:Q,connectionLineComponent:w,connectionLineContainerStyle:T,selectionKeyCode:B,selectionOnDrag:A,selectionMode:Y,deleteKeyCode:F,multiSelectionKeyCode:G,panActivationKeyCode:q,zoomActivationKeyCode:Z,onlyRenderVisibleElements:te,defaultViewport:de,translateExtent:je,minZoom:Ie,maxZoom:Ae,preventScrolling:An,zoomOnScroll:fa,zoomOnPinch:da,zoomOnDoubleClick:ma,panOnScroll:ha,panOnScrollSpeed:ga,panOnScrollMode:pa,panOnDrag:ya,autoPanOnSelection:qa,onPaneClick:xa,onPaneMouseEnter:wa,onPaneMouseMove:va,onPaneMouseLeave:_a,onPaneScroll:Ea,onPaneContextMenu:Sa,paneClickDistance:ba,nodeClickDistance:Ca,onSelectionContextMenu:I,onSelectionStart:P,onSelectionEnd:D,onReconnect:Ma,onReconnectStart:ka,onReconnectEnd:Ia,onEdgeContextMenu:Aa,onEdgeDoubleClick:Ra,onEdgeMouseEnter:Ta,onEdgeMouseMove:Pa,onEdgeMouseLeave:$a,reconnectRadius:Da,defaultMarkerColor:la,noDragClassName:za,noWheelClassName:La,noPanClassName:Lo,rfId:Tn,disableKeyboardA11y:Vo,nodeExtent:Rn,viewport:nc,onViewportChange:oc,nodesDraggable:ce}),$.jsx(Mh,{onSelectionChange:z}),Na,$.jsx(Eh,{proOptions:Va,position:Ba}),$.jsx(_h,{rfId:Tn,disableKeyboardA11y:Vo})]})})}var Dp=Ds(sp);const ap=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function Hp({children:e}){const t=ne(ap);return t?gh.createPortal(e,t):null}const cp=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function Op(){return ne(cp,ie)}function up({dimensions:e,lineWidth:t,variant:n,className:o}){return $.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:se(["react-flow__background-pattern",n,o])})}function lp({radius:e,className:t}){return $.jsx("circle",{cx:e,cy:e,r:e,className:se(["react-flow__background-pattern","dots",t])})}var Le;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Le||(Le={}));const fp={[Le.Dots]:1,[Le.Lines]:1,[Le.Cross]:6},dp=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function aa({id:e,variant:t=Le.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:d,className:l,patternClassName:u}){const c=H.useRef(null),{transform:f,patternId:h}=ne(dp,ie),g=o||fp[t],m=t===Le.Dots,v=t===Le.Cross,y=Array.isArray(n)?n:[n,n],E=[y[0]*f[2]||1,y[1]*f[2]||1],p=g*f[2],_=Array.isArray(i)?i:[i,i],N=v?[p,p]:E,S=[_[0]*f[2]+N[0]/2,_[1]*f[2]+N[1]/2],C=`${h}${e||""}`;return $.jsxs("svg",{className:se(["react-flow__background",l]),style:{...d,...kn,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[$.jsx("pattern",{id:C,x:f[0]%E[0],y:f[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:m?$.jsx(lp,{radius:p/2,className:u}):$.jsx(up,{dimensions:N,lineWidth:r,variant:t,className:u})}),$.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}aa.displayName="Background";const zp=H.memo(aa);function hp(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:$.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function gp(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:$.jsx("path",{d:"M0 0h32v4.2H0z"})})}function pp(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:$.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function mp(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:$.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function yp(){return $.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:$.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Zt({children:e,className:t,...n}){return $.jsx("button",{type:"button",className:se(["react-flow__controls-button",t]),...n,children:e})}const xp=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ca({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:d,className:l,children:u,position:c="bottom-left",orientation:f="vertical","aria-label":h}){const g=re(),{isInteractive:m,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:E}=ne(xp,ie),{zoomIn:p,zoomOut:_,fitView:N}=Oo(),S=()=>{p(),i?.()},C=()=>{_(),s?.()},M=()=>{N(r),a?.()},R=()=>{g.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),d?.(!m)},V=f==="horizontal"?"horizontal":"vertical";return $.jsxs(Mn,{className:se(["react-flow__controls",V,l]),position:c,style:e,"data-testid":"rf__controls","aria-label":h??E["controls.ariaLabel"],children:[t&&$.jsxs($.Fragment,{children:[$.jsx(Zt,{onClick:S,className:"react-flow__controls-zoomin",title:E["controls.zoomIn.ariaLabel"],"aria-label":E["controls.zoomIn.ariaLabel"],disabled:y,children:$.jsx(hp,{})}),$.jsx(Zt,{onClick:C,className:"react-flow__controls-zoomout",title:E["controls.zoomOut.ariaLabel"],"aria-label":E["controls.zoomOut.ariaLabel"],disabled:v,children:$.jsx(gp,{})})]}),n&&$.jsx(Zt,{className:"react-flow__controls-fitview",onClick:M,title:E["controls.fitView.ariaLabel"],"aria-label":E["controls.fitView.ariaLabel"],children:$.jsx(pp,{})}),o&&$.jsx(Zt,{className:"react-flow__controls-interactive",onClick:R,title:E["controls.interactive.ariaLabel"],"aria-label":E["controls.interactive.ariaLabel"],children:m?$.jsx(yp,{}):$.jsx(mp,{})}),u]})}ca.displayName="Controls";H.memo(ca);function wp({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:d,className:l,borderRadius:u,shapeRendering:c,selected:f,onClick:h}){const{background:g,backgroundColor:m}=i||{},v=s||g||m;return $.jsx("rect",{className:se(["react-flow__minimap-node",{selected:f},l]),x:t,y:n,rx:u,ry:u,width:o,height:r,style:{fill:v,stroke:a,strokeWidth:d},shapeRendering:c,onClick:h?y=>h(y,e):void 0})}const vp=H.memo(wp),_p=e=>e.nodes.map(t=>t.id),Qn=e=>e instanceof Function?e:()=>e;function Ep({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=vp,onClick:s}){const a=ne(_p,ie),d=Qn(t),l=Qn(e),u=Qn(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return $.jsx($.Fragment,{children:a.map(f=>$.jsx(bp,{id:f,nodeColorFunc:d,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:c},f))})}function Sp({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:d}){const{node:l,x:u,y:c,width:f,height:h}=ne(g=>{const m=g.nodeLookup.get(e);if(!m)return{node:void 0,x:0,y:0,width:0,height:0};const v=m.internals.userNode,{x:y,y:E}=m.internals.positionAbsolute,{width:p,height:_}=ve(v);return{node:v,x:y,y:E,width:p,height:_}},ie);return!l||l.hidden||!cs(l)?null:$.jsx(a,{x:u,y:c,width:f,height:h,style:l.style,selected:!!l.selected,className:o(l),color:t(l),borderRadius:r,strokeColor:n(l),strokeWidth:i,shapeRendering:s,onClick:d,id:l.id})}const bp=H.memo(Sp);var Cp=H.memo(Ep);const Np=200,Mp=150,kp=e=>!e.hidden,Ip=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};let n=!1;for(const o of e.nodeLookup.values())if(!o.hidden){n=!0;break}return{viewBB:t,boundingRect:n?is(Ht(e.nodeLookup,{filter:kp}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},fi=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Ap=(e,t)=>fi(e.viewBB,t.viewBB)&&fi(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,Rp="react-flow__minimap-desc";function ua({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:d,maskColor:l,maskStrokeColor:u,maskStrokeWidth:c,position:f="bottom-right",onClick:h,onNodeClick:g,pannable:m=!1,zoomable:v=!1,ariaLabel:y,inversePan:E,zoomStep:p=1,offsetScale:_=5}){const N=re(),S=H.useRef(null),{boundingRect:C,panZoom:M,viewBB:R,rfId:V,translateExtent:O,flowWidth:j,flowHeight:z,ariaLabelConfig:x}=ne(Ip,Ap),b=e?.width??Np,k=e?.height??Mp,I=C.width/b,P=C.height/k,D=Math.max(I,P),W=D*b,L=D*k,X=_*D,Q=C.x-(W-C.width)/2-X,w=C.y-(L-C.height)/2-X,T=W+X*2,F=L+X*2,B=`${Rp}-${V}`,A=H.useRef(0),Y=H.useRef();A.current=D,H.useEffect(()=>{const ee=N.getState().panZoom;if(S.current&&ee)return Y.current=Vd({domNode:S.current,panZoom:ee,getTransform:()=>N.getState().transform,getViewScale:()=>A.current}),()=>{Y.current?.destroy()}},[M]),H.useEffect(()=>{Y.current?.update({translateExtent:O,width:j,height:z,inversePan:E,pannable:m,zoomStep:p,zoomable:v})},[m,v,E,p,O,j,z]);const q=h?ee=>{const[te,oe]=Y.current?.pointer(ee)||[0,0];h(ee,{x:te,y:oe})}:void 0,G=H.useCallback((ee,te)=>{const oe=N.getState().nodeLookup.get(te).internals.userNode;g?.(ee,oe)},[g]),Z=g?G:void 0,U=y??x["minimap.ariaLabel"];return $.jsx(Mn,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*D:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:se(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:$.jsxs("svg",{width:b,height:k,viewBox:`${Q} ${w} ${T} ${F}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":B,ref:S,onClick:q,children:[U&&$.jsx("title",{id:B,children:U}),$.jsx(Cp,{onClick:Z,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),$.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q-X},${w-X}h${T+X*2}v${F+X*2}h${-T-X*2}z
7
+ M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ua.displayName="MiniMap";const Lp=H.memo(ua),Tp=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Pp={[gt.Line]:"right",[gt.Handle]:"bottom-right"};function $p({nodeId:e,position:t,variant:n=gt.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:d=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:f,autoScale:h=!0,shouldResize:g,onResizeStart:m,onResize:v,onResizeEnd:y}){const E=Ws(),p=typeof e=="string"?e:E,_=re(),N=H.useRef(null),S=n===gt.Handle,C=ne(H.useCallback(Tp(S&&h),[S,h]),ie),M=H.useRef(null),R=t??Pp[n];H.useEffect(()=>{if(!(!N.current||!p))return M.current||(M.current=th({domNode:N.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:O,transform:j,snapGrid:z,snapToGrid:x,nodeOrigin:b,domNode:k}=_.getState();return{nodeLookup:O,transform:j,snapGrid:z,snapToGrid:x,nodeOrigin:b,paneDomNode:k}},onChange:(O,j)=>{const{triggerNodeChanges:z,nodeLookup:x,parentLookup:b,nodeOrigin:k}=_.getState(),I=[],P={x:O.x,y:O.y},D=x.get(p);if(D&&D.expandParent&&D.parentId){const W=D.origin??k,L=O.width??D.measured.width??0,X=O.height??D.measured.height??0,Q={id:D.id,parentId:D.parentId,rect:{width:L,height:X,...us({x:O.x??D.position.x,y:O.y??D.position.y},{width:L,height:X},D.parentId,x,W)}},w=Ho([Q],x,b,k);I.push(...w),P.x=O.x?Math.max(W[0]*L,O.x):void 0,P.y=O.y?Math.max(W[1]*X,O.y):void 0}if(P.x!==void 0&&P.y!==void 0){const W={id:p,type:"position",position:{...P}};I.push(W)}if(O.width!==void 0&&O.height!==void 0){const L={id:p,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:O.width,height:O.height}};I.push(L)}for(const W of j){const L={...W,type:"position"};I.push(L)}z(I)},onEnd:({width:O,height:j})=>{const z={id:p,type:"dimensions",resizing:!1,dimensions:{width:O,height:j}};_.getState().triggerNodeChanges([z])}})),M.current.update({controlPosition:R,boundaries:{minWidth:a,minHeight:d,maxWidth:l,maxHeight:u},keepAspectRatio:c,resizeDirection:f,onResizeStart:m,onResize:v,onResizeEnd:y,shouldResize:g}),()=>{M.current?.destroy()}},[R,a,d,l,u,c,m,v,y,g]);const V=R.split("-");return $.jsx("div",{className:se(["react-flow__resize-control","nodrag",...V,n,o]),ref:N,style:{...r,scale:C,...s&&{[S?"backgroundColor":"borderColor"]:s}},children:i})}H.memo($p);export{In as B,ze as C,Hp as E,hn as H,Lp as M,K as P,mc as R,pn as a,xc as b,zh as c,Hh as d,Dh as e,gh as f,di as g,uo as h,Oo as i,$ as j,re as k,Dp as l,zp as m,Le as n,Op as o,op as p,H as r,ne as u};
@@ -0,0 +1 @@
1
+ import{r as s}from"./graph-D7gaURIl.js";const i=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c=(...t)=>t.filter((a,h,y)=>!!a&&a.trim()!==""&&y.indexOf(a)===h).join(" ").trim();var M={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x=s.forwardRef(({color:t="currentColor",size:a=24,strokeWidth:h=2,absoluteStrokeWidth:y,className:o="",children:r,iconNode:d,...k},n)=>s.createElement("svg",{ref:n,...M,width:a,height:a,stroke:t,strokeWidth:y?Number(h)*24/Number(a):h,className:c("lucide",o),...k},[...d.map(([l,p])=>s.createElement(l,p)),...Array.isArray(r)?r:[r]]));const e=(t,a)=>{const h=s.forwardRef(({className:y,...o},r)=>s.createElement(x,{ref:r,iconNode:a,className:c(`lucide-${i(t)}`,y),...o}));return h.displayName=`${t}`,h};const m=e("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);const w=e("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);const g=e("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);const u=e("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);const C=e("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);const f=e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const q=e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const z=e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const A=e("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const L=e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const b=e("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const H=e("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const R=e("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);const j=e("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const V=e("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const P=e("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]);const S=e("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const E=e("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);const F=e("Focus",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);const U=e("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);const B=e("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);const D=e("GitBranch",[["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"}]]);const T=e("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const Z=e("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);const G=e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const N=e("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const $=e("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);const O=e("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const I=e("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const K=e("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);const W=e("MousePointer2",[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]);const X=e("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);const J=e("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const Q=e("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const Y=e("PanelRight",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);const _=e("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);const e1=e("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const a1=e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const t1=e("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);const h1=e("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);const y1=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const r1=e("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const s1=e("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const o1=e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const c1=e("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);const d1=e("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);const k1=e("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const n1=e("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const l1=e("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);const p1=e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const i1=e("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const M1=e("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const x1=e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const v1=e("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);export{R as $,g as A,C as B,q as C,V as D,P as E,B as F,D as G,H,c1 as I,K as J,l1 as K,Z as L,I as M,A as N,X as O,a1 as P,w as Q,y1 as R,s1 as S,p1 as T,M1 as U,h1 as V,F as W,x1 as X,$ as Y,v1 as Z,W as _,E as a,e1 as b,U as c,f as d,_ as e,G as f,T as g,o1 as h,z as i,b as j,j as k,N as l,S as m,L as n,i1 as o,d1 as p,Q as q,O as r,r1 as s,k1 as t,m as u,n1 as v,u as w,t1 as x,J as y,Y as z};