(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Dd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fd={exports:{}},_s={},Od={exports:{}},te={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ro=Symbol.for("react.element"),ry=Symbol.for("react.portal"),oy=Symbol.for("react.fragment"),iy=Symbol.for("react.strict_mode"),sy=Symbol.for("react.profiler"),ly=Symbol.for("react.provider"),uy=Symbol.for("react.context"),ay=Symbol.for("react.forward_ref"),cy=Symbol.for("react.suspense"),fy=Symbol.for("react.memo"),dy=Symbol.for("react.lazy"),mc=Symbol.iterator;function hy(e){return e===null||typeof e!="object"?null:(e=mc&&e[mc]||e["@@iterator"],typeof e=="function"?e:null)}var jd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Hd=Object.assign,Vd={};function Mr(e,t,n){this.props=e,this.context=t,this.refs=Vd,this.updater=n||jd}Mr.prototype.isReactComponent={};Mr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Mr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function bd(){}bd.prototype=Mr.prototype;function Gu(e,t,n){this.props=e,this.context=t,this.refs=Vd,this.updater=n||jd}var Ku=Gu.prototype=new bd;Ku.constructor=Gu;Hd(Ku,Mr.prototype);Ku.isPureReactComponent=!0;var yc=Array.isArray,Bd=Object.prototype.hasOwnProperty,Zu={current:null},Wd={key:!0,ref:!0,__self:!0,__source:!0};function Ud(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Bd.call(t,r)&&!Wd.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1>>1,F=k[O];if(0>>1;Oo(U,T))Yo(Q,U)?(k[O]=Q,k[Y]=T,O=Y):(k[O]=U,k[V]=T,O=V);else if(Yo(Q,T))k[O]=Q,k[Y]=T,O=Y;else break e}}return S}function o(k,S){var T=k.sortIndex-S.sortIndex;return T!==0?T:k.id-S.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],a=[],d=1,c=null,f=3,m=!1,y=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(k){for(var S=n(a);S!==null;){if(S.callback===null)r(a);else if(S.startTime<=k)r(a),S.sortIndex=S.expirationTime,t(u,S);else break;S=n(a)}}function v(k){if(w=!1,p(k),!y)if(n(u)!==null)y=!0,I(E);else{var S=n(a);S!==null&&D(v,S.startTime-k)}}function E(k,S){y=!1,w&&(w=!1,h(P),P=-1),m=!0;var T=f;try{for(p(S),c=n(u);c!==null&&(!(c.expirationTime>S)||k&&!z());){var O=c.callback;if(typeof O=="function"){c.callback=null,f=c.priorityLevel;var F=O(c.expirationTime<=S);S=e.unstable_now(),typeof F=="function"?c.callback=F:c===n(u)&&r(u),p(S)}else r(u);c=n(u)}if(c!==null)var W=!0;else{var V=n(a);V!==null&&D(v,V.startTime-S),W=!1}return W}finally{c=null,f=T,m=!1}}var _=!1,N=null,P=-1,L=5,j=-1;function z(){return!(e.unstable_now()-jk||125O?(k.sortIndex=T,t(a,k),n(u)===null&&k===n(a)&&(w?(h(P),P=-1):w=!0,D(v,T-O))):(k.sortIndex=F,t(u,k),y||m||(y=!0,I(E))),k},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(k){var S=f;return function(){var T=f;f=S;try{return k.apply(this,arguments)}finally{f=T}}}})(Kd);Gd.exports=Kd;var Cy=Gd.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ny=$,Ge=Cy;function b(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bl=Object.prototype.hasOwnProperty,My=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,wc={},xc={};function Py(e){return bl.call(xc,e)?!0:bl.call(wc,e)?!1:My.test(e)?xc[e]=!0:(wc[e]=!0,!1)}function Ty(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Iy(e,t,n,r){if(t===null||typeof t>"u"||Ty(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function De(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Me={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Me[e]=new De(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Me[t]=new De(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Me[e]=new De(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Me[e]=new De(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Me[e]=new De(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Me[e]=new De(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Me[e]=new De(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Me[e]=new De(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Me[e]=new De(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ju=/[\-:]([a-z])/g;function ea(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ju,ea);Me[t]=new De(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ju,ea);Me[t]=new De(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ju,ea);Me[t]=new De(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Me[e]=new De(e,1,!1,e.toLowerCase(),null,!1,!1)});Me.xlinkHref=new De("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Me[e]=new De(e,1,!1,e.toLowerCase(),null,!0,!0)});function ta(e,t,n,r){var o=Me.hasOwnProperty(t)?Me[t]:null;(o!==null?o.type!==0:r||!(2l||o[s]!==i[l]){var u=` `+o[s].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{il=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wr(e):""}function zy(e){switch(e.tag){case 5:return Wr(e.type);case 16:return Wr("Lazy");case 13:return Wr("Suspense");case 19:return Wr("SuspenseList");case 0:case 2:case 15:return e=sl(e.type,!1),e;case 11:return e=sl(e.type.render,!1),e;case 1:return e=sl(e.type,!0),e;default:return""}}function Yl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Bn:return"Fragment";case bn:return"Portal";case Bl:return"Profiler";case na:return"StrictMode";case Wl:return"Suspense";case Ul:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Jd:return(e.displayName||"Context")+".Consumer";case qd:return(e._context.displayName||"Context")+".Provider";case ra:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oa:return t=e.displayName||null,t!==null?t:Yl(e.type)||"Memo";case Ut:t=e._payload,e=e._init;try{return Yl(e(t))}catch{}}return null}function Ly(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Yl(t);case 8:return t===na?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function an(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function th(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ay(e){var t=th(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ko(e){e._valueTracker||(e._valueTracker=Ay(e))}function nh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=th(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Hi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Xl(e,t){var n=t.checked;return me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ec(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=an(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rh(e,t){t=t.checked,t!=null&&ta(e,"checked",t,!1)}function Ql(e,t){rh(e,t);var n=an(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Gl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Gl(e,t.type,an(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _c(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Gl(e,t,n){(t!=="number"||Hi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ur=Array.isArray;function nr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Zo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function uo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ry=["Webkit","ms","Moz","O"];Object.keys(Kr).forEach(function(e){Ry.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kr[t]=Kr[e]})});function lh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Kr.hasOwnProperty(e)&&Kr[e]?(""+t).trim():t+"px"}function uh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=lh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var $y=me({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ql(e,t){if(t){if($y[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(b(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(b(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(b(61))}if(t.style!=null&&typeof t.style!="object")throw Error(b(62))}}function Jl(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var eu=null;function ia(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tu=null,rr=null,or=null;function Nc(e){if(e=Fo(e)){if(typeof tu!="function")throw Error(b(280));var t=e.stateNode;t&&(t=Ps(t),tu(e.stateNode,e.type,t))}}function ah(e){rr?or?or.push(e):or=[e]:rr=e}function ch(){if(rr){var e=rr,t=or;if(or=rr=null,Nc(e),t)for(e=0;e>>=0,e===0?32:31-(Yy(e)/Xy|0)|0}var qo=64,Jo=4194304;function Yr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=Yr(l):(i&=s,i!==0&&(r=Yr(i)))}else s=n&~o,s!==0?r=Yr(s):i!==0&&(r=Yr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function $o(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ht(t),e[t]=n}function Zy(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=qr),$c=" ",Dc=!1;function Ih(e,t){switch(e){case"keyup":return Cv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wn=!1;function Mv(e,t){switch(e){case"compositionend":return zh(t);case"keypress":return t.which!==32?null:(Dc=!0,$c);case"textInput":return e=t.data,e===$c&&Dc?null:e;default:return null}}function Pv(e,t){if(Wn)return e==="compositionend"||!ha&&Ih(e,t)?(e=Ph(),Ni=ca=Kt=null,Wn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Hc(n)}}function $h(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$h(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dh(){for(var e=window,t=Hi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hi(e.document)}return t}function pa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Fv(e){var t=Dh(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&$h(n.ownerDocument.documentElement,n)){if(r!==null&&pa(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Vc(n,i);var s=Vc(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Un=null,lu=null,eo=null,uu=!1;function bc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uu||Un==null||Un!==Hi(r)||(r=Un,"selectionStart"in r&&pa(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),eo&&go(eo,r)||(eo=r,r=Xi(lu,"onSelect"),0Qn||(e.current=pu[Qn],pu[Qn]=null,Qn--)}function le(e,t){Qn++,pu[Qn]=e.current,e.current=t}var cn={},Le=dn(cn),He=dn(!1),Nn=cn;function fr(e,t){var n=e.type.contextTypes;if(!n)return cn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ve(e){return e=e.childContextTypes,e!=null}function Gi(){ce(He),ce(Le)}function Gc(e,t,n){if(Le.current!==cn)throw Error(b(168));le(Le,t),le(He,n)}function Uh(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(b(108,Ly(e)||"Unknown",o));return me({},n,r)}function Ki(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cn,Nn=Le.current,le(Le,e),le(He,He.current),!0}function Kc(e,t,n){var r=e.stateNode;if(!r)throw Error(b(169));n?(e=Uh(e,t,Nn),r.__reactInternalMemoizedMergedChildContext=e,ce(He),ce(Le),le(Le,e)):ce(He),le(He,n)}var Tt=null,Ts=!1,xl=!1;function Yh(e){Tt===null?Tt=[e]:Tt.push(e)}function Gv(e){Ts=!0,Yh(e)}function hn(){if(!xl&&Tt!==null){xl=!0;var e=0,t=se;try{var n=Tt;for(se=1;e>=s,o-=s,It=1<<32-ht(t)+o|n<P?(L=N,N=null):L=N.sibling;var j=f(h,N,p[P],v);if(j===null){N===null&&(N=L);break}e&&N&&j.alternate===null&&t(h,N),g=i(j,g,P),_===null?E=j:_.sibling=j,_=j,N=L}if(P===p.length)return n(h,N),fe&&gn(h,P),E;if(N===null){for(;PP?(L=N,N=null):L=N.sibling;var z=f(h,N,j.value,v);if(z===null){N===null&&(N=L);break}e&&N&&z.alternate===null&&t(h,N),g=i(z,g,P),_===null?E=z:_.sibling=z,_=z,N=L}if(j.done)return n(h,N),fe&&gn(h,P),E;if(N===null){for(;!j.done;P++,j=p.next())j=c(h,j.value,v),j!==null&&(g=i(j,g,P),_===null?E=j:_.sibling=j,_=j);return fe&&gn(h,P),E}for(N=r(h,N);!j.done;P++,j=p.next())j=m(N,h,P,j.value,v),j!==null&&(e&&j.alternate!==null&&N.delete(j.key===null?P:j.key),g=i(j,g,P),_===null?E=j:_.sibling=j,_=j);return e&&N.forEach(function(R){return t(h,R)}),fe&&gn(h,P),E}function x(h,g,p,v){if(typeof p=="object"&&p!==null&&p.type===Bn&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Go:e:{for(var E=p.key,_=g;_!==null;){if(_.key===E){if(E=p.type,E===Bn){if(_.tag===7){n(h,_.sibling),g=o(_,p.props.children),g.return=h,h=g;break e}}else if(_.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ut&&Jc(E)===_.type){n(h,_.sibling),g=o(_,p.props),g.ref=jr(h,_,p),g.return=h,h=g;break e}n(h,_);break}else t(h,_);_=_.sibling}p.type===Bn?(g=_n(p.props.children,h.mode,v,p.key),g.return=h,h=g):(v=Ri(p.type,p.key,p.props,null,h.mode,v),v.ref=jr(h,g,p),v.return=h,h=v)}return s(h);case bn:e:{for(_=p.key;g!==null;){if(g.key===_)if(g.tag===4&&g.stateNode.containerInfo===p.containerInfo&&g.stateNode.implementation===p.implementation){n(h,g.sibling),g=o(g,p.children||[]),g.return=h,h=g;break e}else{n(h,g);break}else t(h,g);g=g.sibling}g=Pl(p,h.mode,v),g.return=h,h=g}return s(h);case Ut:return _=p._init,x(h,g,_(p._payload),v)}if(Ur(p))return y(h,g,p,v);if(Rr(p))return w(h,g,p,v);si(h,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,g!==null&&g.tag===6?(n(h,g.sibling),g=o(g,p),g.return=h,h=g):(n(h,g),g=Ml(p,h.mode,v),g.return=h,h=g),s(h)):n(h,g)}return x}var hr=Kh(!0),Zh=Kh(!1),Ji=dn(null),es=null,Zn=null,va=null;function wa(){va=Zn=es=null}function xa(e){var t=Ji.current;ce(Ji),e._currentValue=t}function yu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function sr(e,t){es=e,va=Zn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Oe=!0),e.firstContext=null)}function rt(e){var t=e._currentValue;if(va!==e)if(e={context:e,memoizedValue:t,next:null},Zn===null){if(es===null)throw Error(b(308));Zn=e,es.dependencies={lanes:0,firstContext:e}}else Zn=Zn.next=e;return t}var wn=null;function Sa(e){wn===null?wn=[e]:wn.push(e)}function qh(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Sa(t)):(n.next=o.next,o.next=n),t.interleaved=n,Dt(e,r)}function Dt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Yt=!1;function Ea(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function At(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function nn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,re&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Dt(e,n)}return o=r.interleaved,o===null?(t.next=t,Sa(r)):(t.next=o.next,o.next=t),r.interleaved=t,Dt(e,n)}function Pi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,la(e,n)}}function ef(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ts(e,t,n,r){var o=e.updateQueue;Yt=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var u=l,a=u.next;u.next=null,s===null?i=a:s.next=a,s=u;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=a:l.next=a,d.lastBaseUpdate=u))}if(i!==null){var c=o.baseState;s=0,d=a=u=null,l=i;do{var f=l.lane,m=l.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,w=l;switch(f=t,m=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){c=y.call(m,c,f);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,f=typeof y=="function"?y.call(m,c,f):y,f==null)break e;c=me({},c,f);break e;case 2:Yt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[l]:f.push(l))}else m={eventTime:m,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(a=d=m,u=c):d=d.next=m,s|=f;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;f=l,l=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(u=c),o.baseState=u,o.firstBaseUpdate=a,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Tn|=s,e.lanes=s,e.memoizedState=c}}function tf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=El.transition;El.transition={};try{e(!1),t()}finally{se=n,El.transition=r}}function mp(){return ot().memoizedState}function Jv(e,t,n){var r=on(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},yp(e))vp(t,n);else if(n=qh(e,t,n,r),n!==null){var o=Re();pt(n,e,r,o),wp(n,t,r)}}function ew(e,t,n){var r=on(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(yp(e))vp(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,gt(l,s)){var u=t.interleaved;u===null?(o.next=o,Sa(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=qh(e,t,o,r),n!==null&&(o=Re(),pt(n,e,r,o),wp(n,t,r))}}function yp(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function vp(e,t){to=rs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,la(e,n)}}var os={readContext:rt,useCallback:Te,useContext:Te,useEffect:Te,useImperativeHandle:Te,useInsertionEffect:Te,useLayoutEffect:Te,useMemo:Te,useReducer:Te,useRef:Te,useState:Te,useDebugValue:Te,useDeferredValue:Te,useTransition:Te,useMutableSource:Te,useSyncExternalStore:Te,useId:Te,unstable_isNewReconciler:!1},tw={readContext:rt,useCallback:function(e,t){return vt().memoizedState=[e,t===void 0?null:t],e},useContext:rt,useEffect:rf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ii(4194308,4,fp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ii(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ii(4,2,e,t)},useMemo:function(e,t){var n=vt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=vt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Jv.bind(null,ge,e),[r.memoizedState,e]},useRef:function(e){var t=vt();return e={current:e},t.memoizedState=e},useState:nf,useDebugValue:Ia,useDeferredValue:function(e){return vt().memoizedState=e},useTransition:function(){var e=nf(!1),t=e[0];return e=qv.bind(null,e[1]),vt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ge,o=vt();if(fe){if(n===void 0)throw Error(b(407));n=n()}else{if(n=t(),ke===null)throw Error(b(349));Pn&30||rp(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,rf(ip.bind(null,r,i,e),[e]),r.flags|=2048,_o(9,op.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=vt(),t=ke.identifierPrefix;if(fe){var n=zt,r=It;n=(r&~(1<<32-ht(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=So++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[xt]=t,e[vo]=r,Tp(e,t,!1,!1),t.stateNode=e;e:{switch(s=Jl(n,r),n){case"dialog":ae("cancel",e),ae("close",e),o=r;break;case"iframe":case"object":case"embed":ae("load",e),o=r;break;case"video":case"audio":for(o=0;omr&&(t.flags|=128,r=!0,Hr(i,!1),t.lanes=4194304)}else{if(!r)if(e=ns(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Hr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!fe)return Ie(t),null}else 2*ve()-i.renderingStartTime>mr&&n!==1073741824&&(t.flags|=128,r=!0,Hr(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ve(),t.sibling=null,n=pe.current,le(pe,r?n&1|2:n&1),t):(Ie(t),null);case 22:case 23:return Da(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ue&1073741824&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),null;case 24:return null;case 25:return null}throw Error(b(156,t.tag))}function aw(e,t){switch(ma(t),t.tag){case 1:return Ve(t.type)&&Gi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pr(),ce(He),ce(Le),Ca(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ka(t),null;case 13:if(ce(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(b(340));dr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(pe),null;case 4:return pr(),null;case 10:return xa(t.type._context),null;case 22:case 23:return Da(),null;case 24:return null;default:return null}}var ui=!1,ze=!1,cw=typeof WeakSet=="function"?WeakSet:Set,X=null;function qn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ye(e,t,r)}else n.current=null}function Nu(e,t,n){try{n()}catch(r){ye(e,t,r)}}var gf=!1;function fw(e,t){if(au=Ui,e=Dh(),pa(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,u=-1,a=0,d=0,c=e,f=null;t:for(;;){for(var m;c!==n||o!==0&&c.nodeType!==3||(l=s+o),c!==i||r!==0&&c.nodeType!==3||(u=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(m=c.firstChild)!==null;)f=c,c=m;for(;;){if(c===e)break t;if(f===n&&++a===o&&(l=s),f===i&&++d===r&&(u=s),(m=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=m}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(cu={focusedElem:e,selectionRange:n},Ui=!1,X=t;X!==null;)if(t=X,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,X=e;else for(;X!==null;){t=X;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,x=y.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?w:st(t.type,w),x);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(b(163))}}catch(v){ye(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,X=e;break}X=t.return}return y=gf,gf=!1,y}function no(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Nu(t,n,i)}o=o.next}while(o!==r)}}function Ls(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Mu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Lp(e){var t=e.alternate;t!==null&&(e.alternate=null,Lp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xt],delete t[vo],delete t[hu],delete t[Xv],delete t[Qv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ap(e){return e.tag===5||e.tag===3||e.tag===4}function mf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ap(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qi));else if(r!==4&&(e=e.child,e!==null))for(Pu(e,t,n),e=e.sibling;e!==null;)Pu(e,t,n),e=e.sibling}function Tu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Tu(e,t,n),e=e.sibling;e!==null;)Tu(e,t,n),e=e.sibling}var Ce=null,lt=!1;function bt(e,t,n){for(n=n.child;n!==null;)Rp(e,t,n),n=n.sibling}function Rp(e,t,n){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(ks,n)}catch{}switch(n.tag){case 5:ze||qn(n,t);case 6:var r=Ce,o=lt;Ce=null,bt(e,t,n),Ce=r,lt=o,Ce!==null&&(lt?(e=Ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ce.removeChild(n.stateNode));break;case 18:Ce!==null&&(lt?(e=Ce,n=n.stateNode,e.nodeType===8?wl(e.parentNode,n):e.nodeType===1&&wl(e,n),ho(e)):wl(Ce,n.stateNode));break;case 4:r=Ce,o=lt,Ce=n.stateNode.containerInfo,lt=!0,bt(e,t,n),Ce=r,lt=o;break;case 0:case 11:case 14:case 15:if(!ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Nu(n,t,s),o=o.next}while(o!==r)}bt(e,t,n);break;case 1:if(!ze&&(qn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){ye(n,t,l)}bt(e,t,n);break;case 21:bt(e,t,n);break;case 22:n.mode&1?(ze=(r=ze)||n.memoizedState!==null,bt(e,t,n),ze=r):bt(e,t,n);break;default:bt(e,t,n)}}function yf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cw),t.forEach(function(r){var o=xw.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function it(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=ve()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*hw(r/1960))-r,10e?16:e,Zt===null)var r=!1;else{if(e=Zt,Zt=null,ls=0,re&6)throw Error(b(331));var o=re;for(re|=4,X=e.current;X!==null;){var i=X,s=i.child;if(X.flags&16){var l=i.deletions;if(l!==null){for(var u=0;uve()-Ra?En(e,0):Aa|=n),be(e,t)}function bp(e,t){t===0&&(e.mode&1?(t=Jo,Jo<<=1,!(Jo&130023424)&&(Jo=4194304)):t=1);var n=Re();e=Dt(e,t),e!==null&&($o(e,t,n),be(e,n))}function ww(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bp(e,n)}function xw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(b(314))}r!==null&&r.delete(t),bp(e,n)}var Bp;Bp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||He.current)Oe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Oe=!1,lw(e,t,n);Oe=!!(e.flags&131072)}else Oe=!1,fe&&t.flags&1048576&&Xh(t,qi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;zi(e,t),e=t.pendingProps;var o=fr(t,Le.current);sr(t,n),o=Ma(null,t,r,e,o,n);var i=Pa();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ve(r)?(i=!0,Ki(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Ea(t),o.updater=zs,t.stateNode=o,o._reactInternals=t,wu(t,r,e,n),t=Eu(null,t,r,!0,i,n)):(t.tag=0,fe&&i&&ga(t),Ae(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(zi(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Ew(r),e=st(r,e),o){case 0:t=Su(null,t,r,e,n);break e;case 1:t=df(null,t,r,e,n);break e;case 11:t=cf(null,t,r,e,n);break e;case 14:t=ff(null,t,r,st(r.type,e),n);break e}throw Error(b(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:st(r,o),Su(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:st(r,o),df(e,t,r,o,n);case 3:e:{if(Np(t),e===null)throw Error(b(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Jh(e,t),ts(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=gr(Error(b(423)),t),t=hf(e,t,r,n,o);break e}else if(r!==o){o=gr(Error(b(424)),t),t=hf(e,t,r,n,o);break e}else for(Xe=tn(t.stateNode.containerInfo.firstChild),Qe=t,fe=!0,at=null,n=Zh(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(dr(),r===o){t=Ft(e,t,n);break e}Ae(e,t,r,n)}t=t.child}return t;case 5:return ep(t),e===null&&mu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,fu(r,o)?s=null:i!==null&&fu(r,i)&&(t.flags|=32),Cp(e,t),Ae(e,t,s,n),t.child;case 6:return e===null&&mu(t),null;case 13:return Mp(e,t,n);case 4:return _a(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hr(t,null,r,n):Ae(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:st(r,o),cf(e,t,r,o,n);case 7:return Ae(e,t,t.pendingProps,n),t.child;case 8:return Ae(e,t,t.pendingProps.children,n),t.child;case 12:return Ae(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,le(Ji,r._currentValue),r._currentValue=s,i!==null)if(gt(i.value,s)){if(i.children===o.children&&!He.current){t=Ft(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=At(-1,n&-n),u.tag=2;var a=i.updateQueue;if(a!==null){a=a.shared;var d=a.pending;d===null?u.next=u:(u.next=d.next,d.next=u),a.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),yu(i.return,n,t),l.lanes|=n;break}u=u.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(b(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),yu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Ae(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,sr(t,n),o=rt(o),r=r(o),t.flags|=1,Ae(e,t,r,n),t.child;case 14:return r=t.type,o=st(r,t.pendingProps),o=st(r.type,o),ff(e,t,r,o,n);case 15:return _p(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:st(r,o),zi(e,t),t.tag=1,Ve(r)?(e=!0,Ki(t)):e=!1,sr(t,n),xp(t,r,o),wu(t,r,o,n),Eu(null,t,r,!0,e,n);case 19:return Pp(e,t,n);case 22:return kp(e,t,n)}throw Error(b(156,t.tag))};function Wp(e,t){return yh(e,t)}function Sw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tt(e,t,n,r){return new Sw(e,t,n,r)}function Oa(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ew(e){if(typeof e=="function")return Oa(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ra)return 11;if(e===oa)return 14}return 2}function sn(e,t){var n=e.alternate;return n===null?(n=tt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ri(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Oa(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Bn:return _n(n.children,o,i,t);case na:s=8,o|=8;break;case Bl:return e=tt(12,n,t,o|2),e.elementType=Bl,e.lanes=i,e;case Wl:return e=tt(13,n,t,o),e.elementType=Wl,e.lanes=i,e;case Ul:return e=tt(19,n,t,o),e.elementType=Ul,e.lanes=i,e;case eh:return Rs(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qd:s=10;break e;case Jd:s=9;break e;case ra:s=11;break e;case oa:s=14;break e;case Ut:s=16,r=null;break e}throw Error(b(130,e==null?e:typeof e,""))}return t=tt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function _n(e,t,n,r){return e=tt(7,e,r,t),e.lanes=n,e}function Rs(e,t,n,r){return e=tt(22,e,r,t),e.elementType=eh,e.lanes=n,e.stateNode={isHidden:!1},e}function Ml(e,t,n){return e=tt(6,e,null,t),e.lanes=n,e}function Pl(e,t,n){return t=tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _w(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ul(0),this.expirationTimes=ul(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ul(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ja(e,t,n,r,o,i,s,l,u){return e=new _w(e,t,n,l,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=tt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ea(i),e}function kw(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qp)}catch(e){console.error(e)}}Qp(),Qd.exports=Ze;var Tw=Qd.exports,Gp,Cf=Tw;Gp=Cf.createRoot,Cf.hydrateRoot;function xe(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function js(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}$i.prototype=js.prototype={constructor:$i,on:function(e,t){var n=this._,r=zw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i0)for(var n=new Array(o),r=0,o,i;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Mf.hasOwnProperty(t)?{space:Mf[t],local:e}:e}function Aw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ru&&t.documentElement.namespaceURI===Ru?t.createElement(e):t.createElementNS(n,e)}}function Rw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Kp(e){var t=Hs(e);return(t.local?Rw:Aw)(t)}function $w(){}function Ba(e){return e==null?$w:function(){return this.querySelector(e)}}function Dw(e){typeof e!="function"&&(e=Ba(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o=p&&(p=g+1);!(E=x[p])&&++p=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function lx(e){e||(e=ux);function t(c,f){return c&&f?e(c.__data__,f.__data__):!c-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;it?1:e>=t?0:NaN}function ax(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cx(){return Array.from(this)}function fx(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Ex:typeof t=="function"?kx:_x)(e,t,n??"")):yr(this.node(),e)}function yr(e,t){return e.style.getPropertyValue(t)||tg(e).getComputedStyle(e,null).getPropertyValue(t)}function Nx(e){return function(){delete this[e]}}function Mx(e,t){return function(){this[e]=t}}function Px(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Tx(e,t){return arguments.length>1?this.each((t==null?Nx:typeof t=="function"?Px:Mx)(e,t)):this.node()[e]}function ng(e){return e.trim().split(/^|\s+/)}function Wa(e){return e.classList||new rg(e)}function rg(e){this._node=e,this._names=ng(e.getAttribute("class")||"")}rg.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 og(e,t){for(var n=Wa(e),r=-1,o=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function r1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n()=>e;function $u(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:u,dy:a,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:a,enumerable:!0,configurable:!0},_:{value:d}})}$u.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function h1(e){return!e.ctrlKey&&!e.button}function p1(){return this.parentNode}function g1(e,t){return t??{x:e.x,y:e.y}}function m1(){return navigator.maxTouchPoints||"ontouchstart"in this}function cg(){var e=h1,t=p1,n=g1,r=m1,o={},i=js("start","drag","end"),s=0,l,u,a,d,c=0;function f(v){v.on("mousedown.drag",m).filter(r).on("touchstart.drag",x).on("touchmove.drag",h,d1).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(v,E){if(!(d||!e.call(this,v,E))){var _=p(this,t.call(this,v,E),v,E,"mouse");_&&(Ye(v.view).on("mousemove.drag",y,Co).on("mouseup.drag",w,Co),ug(v.view),Tl(v),a=!1,l=v.clientX,u=v.clientY,_("start",v))}}function y(v){if(ur(v),!a){var E=v.clientX-l,_=v.clientY-u;a=E*E+_*_>c}o.mouse("drag",v)}function w(v){Ye(v.view).on("mousemove.drag mouseup.drag",null),ag(v.view,a),ur(v),o.mouse("end",v)}function x(v,E){if(e.call(this,v,E)){var _=v.changedTouches,N=t.call(this,v,E),P=_.length,L,j;for(L=0;L>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?di(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?di(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=v1.exec(e))?new je(t[1],t[2],t[3],1):(t=w1.exec(e))?new je(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=x1.exec(e))?di(t[1],t[2],t[3],t[4]):(t=S1.exec(e))?di(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=E1.exec(e))?Rf(t[1],t[2]/100,t[3]/100,1):(t=_1.exec(e))?Rf(t[1],t[2]/100,t[3]/100,t[4]):Pf.hasOwnProperty(e)?zf(Pf[e]):e==="transparent"?new je(NaN,NaN,NaN,0):null}function zf(e){return new je(e>>16&255,e>>8&255,e&255,1)}function di(e,t,n,r){return r<=0&&(e=t=n=NaN),new je(e,t,n,r)}function N1(e){return e instanceof Ho||(e=zn(e)),e?(e=e.rgb(),new je(e.r,e.g,e.b,e.opacity)):new je}function Du(e,t,n,r){return arguments.length===1?N1(e):new je(e,t,n,r??1)}function je(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ua(je,Du,fg(Ho,{brighter(e){return e=e==null?fs:Math.pow(fs,e),new je(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?No:Math.pow(No,e),new je(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new je(kn(this.r),kn(this.g),kn(this.b),ds(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:Lf,formatHex:Lf,formatHex8:M1,formatRgb:Af,toString:Af}));function Lf(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}`}function M1(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}${Sn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Af(){const e=ds(this.opacity);return`${e===1?"rgb(":"rgba("}${kn(this.r)}, ${kn(this.g)}, ${kn(this.b)}${e===1?")":`, ${e})`}`}function ds(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function kn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sn(e){return e=kn(e),(e<16?"0":"")+e.toString(16)}function Rf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ct(e,t,n,r)}function dg(e){if(e instanceof ct)return new ct(e.h,e.s,e.l,e.opacity);if(e instanceof Ho||(e=zn(e)),!e)return new ct;if(e instanceof ct)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,u=(i+o)/2;return l?(t===i?s=(n-r)/l+(n0&&u<1?0:s,new ct(s,l,u,e.opacity)}function P1(e,t,n,r){return arguments.length===1?dg(e):new ct(e,t,n,r??1)}function ct(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ua(ct,P1,fg(Ho,{brighter(e){return e=e==null?fs:Math.pow(fs,e),new ct(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?No:Math.pow(No,e),new ct(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new je(Il(e>=240?e-240:e+120,o,r),Il(e,o,r),Il(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new ct($f(this.h),hi(this.s),hi(this.l),ds(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=ds(this.opacity);return`${e===1?"hsl(":"hsla("}${$f(this.h)}, ${hi(this.s)*100}%, ${hi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function $f(e){return e=(e||0)%360,e<0?e+360:e}function hi(e){return Math.max(0,Math.min(1,e||0))}function Il(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 Ya=e=>()=>e;function T1(e,t){return function(n){return e+n*t}}function I1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function z1(e){return(e=+e)==1?hg:function(t,n){return n-t?I1(t,n,e):Ya(isNaN(t)?n:t)}}function hg(e,t){var n=t-e;return n?T1(e,n):Ya(isNaN(e)?t:e)}const hs=function e(t){var n=z1(t);function r(o,i){var s=n((o=Du(o)).r,(i=Du(i)).r),l=n(o.g,i.g),u=n(o.b,i.b),a=hg(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=l(d),o.b=u(d),o.opacity=a(d),o+""}}return r.gamma=e,r}(1);function L1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;on&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,u.push({i:s,x:wt(r,o)})),n=zl.lastIndex;return n180?d+=360:d-a>180&&(a+=360),f.push({i:c.push(o(c)+"rotate(",null,r)-2,x:wt(a,d)})):d&&c.push(o(c)+"rotate("+d+r)}function l(a,d,c,f){a!==d?f.push({i:c.push(o(c)+"skewX(",null,r)-2,x:wt(a,d)}):d&&c.push(o(c)+"skewX("+d+r)}function u(a,d,c,f,m,y){if(a!==c||d!==f){var w=m.push(o(m)+"scale(",null,",",null,")");y.push({i:w-4,x:wt(a,c)},{i:w-2,x:wt(d,f)})}else(c!==1||f!==1)&&m.push(o(m)+"scale("+c+","+f+")")}return function(a,d){var c=[],f=[];return a=e(a),d=e(d),i(a.translateX,a.translateY,d.translateX,d.translateY,c,f),s(a.rotate,d.rotate,c,f),l(a.skewX,d.skewX,c,f),u(a.scaleX,a.scaleY,d.scaleX,d.scaleY,c,f),a=d=null,function(m){for(var y=-1,w=f.length,x;++y=0&&e._call.call(void 0,t),e=e._next;--vr}function Of(){Ln=(gs=Po.now())+Vs,vr=Qr=0;try{X1()}finally{vr=0,G1(),Ln=0}}function Q1(){var e=Po.now(),t=e-gs;t>yg&&(Vs-=t,gs=e)}function G1(){for(var e,t=ps,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ps=n);Gr=e,ju(r)}function ju(e){if(!vr){Qr&&(Qr=clearTimeout(Qr));var t=e-Ln;t>24?(e<1/0&&(Qr=setTimeout(Of,e-Po.now()-Vs)),br&&(br=clearInterval(br))):(br||(gs=Po.now(),br=setInterval(Q1,yg)),vr=1,vg(Of))}}function jf(e,t,n){var r=new ms;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var K1=js("start","end","cancel","interrupt"),Z1=[],xg=0,Hf=1,Hu=2,Fi=3,Vf=4,Vu=5,Oi=6;function bs(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;q1(e,n,{name:t,index:r,group:o,on:K1,tween:Z1,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:xg})}function Qa(e,t){var n=mt(e,t);if(n.state>xg)throw new Error("too late; already scheduled");return n}function Ct(e,t){var n=mt(e,t);if(n.state>Fi)throw new Error("too late; already running");return n}function mt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function q1(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=wg(i,0,n.time);function i(a){n.state=Hf,n.timer.restart(s,n.delay,n.time),n.delay<=a&&s(a-n.delay)}function s(a){var d,c,f,m;if(n.state!==Hf)return u();for(d in r)if(m=r[d],m.name===n.name){if(m.state===Fi)return jf(s);m.state===Vf?(m.state=Oi,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[d]):+dHu&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function PS(e,t,n){var r,o,i=MS(t)?Qa:Ct;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function TS(e,t){var n=this._id;return arguments.length<2?mt(this.node(),n).on.on(e):this.each(PS(n,e,t))}function IS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function zS(){return this.on("end.remove",IS(this._id))}function LS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ba(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s()=>e;function rE(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Lt(e,t,n){this.k=e,this.x=t,this.y=n}Lt.prototype={constructor:Lt,scale:function(e){return e===1?this:new Lt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Lt(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 Bs=new Lt(1,0,0);kg.prototype=Lt.prototype;function kg(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Bs;return e.__zoom}function Ll(e){e.stopImmediatePropagation()}function Br(e){e.preventDefault(),e.stopImmediatePropagation()}function oE(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function iE(){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 bf(){return this.__zoom||Bs}function sE(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lE(){return navigator.maxTouchPoints||"ontouchstart"in this}function uE(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Cg(){var e=oE,t=iE,n=uE,r=sE,o=lE,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=Di,a=js("start","zoom","end"),d,c,f,m=500,y=150,w=0,x=10;function h(C){C.property("__zoom",bf).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",j).filter(o).on("touchstart.zoom",z).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}h.transform=function(C,A,I,D){var k=C.selection?C.selection():C;k.property("__zoom",bf),C!==k?E(C,A,I,D):k.interrupt().each(function(){_(this,arguments).event(D).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},h.scaleBy=function(C,A,I,D){h.scaleTo(C,function(){var k=this.__zoom.k,S=typeof A=="function"?A.apply(this,arguments):A;return k*S},I,D)},h.scaleTo=function(C,A,I,D){h.transform(C,function(){var k=t.apply(this,arguments),S=this.__zoom,T=I==null?v(k):typeof I=="function"?I.apply(this,arguments):I,O=S.invert(T),F=typeof A=="function"?A.apply(this,arguments):A;return n(p(g(S,F),T,O),k,s)},I,D)},h.translateBy=function(C,A,I,D){h.transform(C,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof I=="function"?I.apply(this,arguments):I),t.apply(this,arguments),s)},null,D)},h.translateTo=function(C,A,I,D,k){h.transform(C,function(){var S=t.apply(this,arguments),T=this.__zoom,O=D==null?v(S):typeof D=="function"?D.apply(this,arguments):D;return n(Bs.translate(O[0],O[1]).scale(T.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof I=="function"?-I.apply(this,arguments):-I),S,s)},D,k)};function g(C,A){return A=Math.max(i[0],Math.min(i[1],A)),A===C.k?C:new Lt(A,C.x,C.y)}function p(C,A,I){var D=A[0]-I[0]*C.k,k=A[1]-I[1]*C.k;return D===C.x&&k===C.y?C:new Lt(C.k,D,k)}function v(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function E(C,A,I,D){C.on("start.zoom",function(){_(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(D).end()}).tween("zoom",function(){var k=this,S=arguments,T=_(k,S).event(D),O=t.apply(k,S),F=I==null?v(O):typeof I=="function"?I.apply(k,S):I,W=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),V=k.__zoom,U=typeof A=="function"?A.apply(k,S):A,Y=u(V.invert(F).concat(W/V.k),U.invert(F).concat(W/U.k));return function(Q){if(Q===1)Q=U;else{var B=Y(Q),K=W/B[2];Q=new Lt(K,F[0]-B[0]*K,F[1]-B[1]*K)}T.zoom(null,Q)}})}function _(C,A,I){return!I&&C.__zooming||new N(C,A)}function N(C,A){this.that=C,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,A),this.taps=0}N.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,A){return this.mouse&&C!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var A=Ye(this.that).datum();a.call(C,this.that,new rE(C,{sourceEvent:this.sourceEvent,target:h,transform:this.that.__zoom,dispatch:a}),A)}};function P(C,...A){if(!e.apply(this,arguments))return;var I=_(this,A).event(C),D=this.__zoom,k=Math.max(i[0],Math.min(i[1],D.k*Math.pow(2,r.apply(this,arguments)))),S=ut(C);if(I.wheel)(I.mouse[0][0]!==S[0]||I.mouse[0][1]!==S[1])&&(I.mouse[1]=D.invert(I.mouse[0]=S)),clearTimeout(I.wheel);else{if(D.k===k)return;I.mouse=[S,D.invert(S)],ji(this),I.start()}Br(C),I.wheel=setTimeout(T,y),I.zoom("mouse",n(p(g(D,k),I.mouse[0],I.mouse[1]),I.extent,s));function T(){I.wheel=null,I.end()}}function L(C,...A){if(f||!e.apply(this,arguments))return;var I=C.currentTarget,D=_(this,A,!0).event(C),k=Ye(C.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",W,!0),S=ut(C,I),T=C.clientX,O=C.clientY;ug(C.view),Ll(C),D.mouse=[S,this.__zoom.invert(S)],ji(this),D.start();function F(V){if(Br(V),!D.moved){var U=V.clientX-T,Y=V.clientY-O;D.moved=U*U+Y*Y>w}D.event(V).zoom("mouse",n(p(D.that.__zoom,D.mouse[0]=ut(V,I),D.mouse[1]),D.extent,s))}function W(V){k.on("mousemove.zoom mouseup.zoom",null),ag(V.view,D.moved),Br(V),D.event(V).end()}}function j(C,...A){if(e.apply(this,arguments)){var I=this.__zoom,D=ut(C.changedTouches?C.changedTouches[0]:C,this),k=I.invert(D),S=I.k*(C.shiftKey?.5:2),T=n(p(g(I,S),D,k),t.apply(this,A),s);Br(C),l>0?Ye(this).transition().duration(l).call(E,T,D,C):Ye(this).call(h.transform,T,D,C)}}function z(C,...A){if(e.apply(this,arguments)){var I=C.touches,D=I.length,k=_(this,A,C.changedTouches.length===D).event(C),S,T,O,F;for(Ll(C),T=0;T"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", 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."},To=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ng=["Enter"," ","Escape"],Mg={"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 wr;(function(e){e.Strict="strict",e.Loose="loose"})(wr||(wr={}));var Cn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Cn||(Cn={}));var Io;(function(e){e.Partial="partial",e.Full="full"})(Io||(Io={}));const Pg={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Gt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Gt||(Gt={}));var xr;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(xr||(xr={}));var G;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(G||(G={}));const Bf={[G.Left]:G.Right,[G.Right]:G.Left,[G.Top]:G.Bottom,[G.Bottom]:G.Top};function Tg(e){return e===null?null:e?"valid":"invalid"}const Ig=e=>"id"in e&&"source"in e&&"target"in e,aE=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ka=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Vo=(e,t=[0,0])=>{const{width:n,height:r}=Ht(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},zg=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):Ka(o)?o:t.nodeLookup.get(o.id));const l=s?ys(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ws(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Us(n)},bo=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=Ws(n,ys(o)),r=!0)}),r?Us(n):{x:0,y:0,width:0,height:0}},Za=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l={...Wo(t,[n,r,o]),width:t.width/o,height:t.height/o},u=[];for(const a of e.values()){const{measured:d,selectable:c=!0,hidden:f=!1}=a;if(s&&!c||f)continue;const m=d.width??a.width??a.initialWidth??null,y=d.height??a.height??a.initialHeight??null,w=zo(l,Er(a)),x=(m??0)*(y??0),h=i&&w>0;(!a.internals.handleBounds||h||w>=x||a.dragging)&&u.push(a)}return u},cE=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function fE(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function dE({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const l=fE(e,s),u=bo(l),a=Ys(u,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(a,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function Lg({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:u,y:a}=l?l.internals.positionAbsolute:{x:0,y:0},d=s.origin??r;let c=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",kt.error005());else{const m=l.measured.width,y=l.measured.height;m&&y&&(c=[[u,a],[u+m,a+y]])}else l&&_r(s.extent)&&(c=[[s.extent[0][0]+u,s.extent[0][1]+a],[s.extent[1][0]+u,s.extent[1][1]+a]]);const f=_r(c)?An(t,c,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",kt.error015())),{position:{x:f.x-u+(s.measured.width??0)*d[0],y:f.y-a+(s.measured.height??0)*d[1]},positionAbsolute:f}}async function hE({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const m=i.has(f.id),y=!m&&f.parentId&&s.find(w=>w.id===f.parentId);(m||y)&&s.push(f)}const l=new Set(t.map(f=>f.id)),u=r.filter(f=>f.deletable!==!1),d=cE(s,u);for(const f of u)l.has(f.id)&&!d.find(y=>y.id===f.id)&&d.push(f);if(!o)return{edges:d,nodes:s};const c=await o({nodes:s,edges:d});return typeof c=="boolean"?c?{edges:d,nodes:s}:{edges:[],nodes:[]}:c}const Sr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),An=(e={x:0,y:0},t,n)=>({x:Sr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Sr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Ag(e,t,n){const{width:r,height:o}=Ht(n),{x:i,y:s}=n.internals.positionAbsolute;return An(e,[[i,s],[i+r,s+o]],t)}const Wf=(e,t,n)=>en?-Sr(Math.abs(e-n),1,t)/t:0,Rg=(e,t,n=15,r=40)=>{const o=Wf(e.x,r,t.width-r)*n,i=Wf(e.y,r,t.height-r)*n;return[o,i]},Ws=(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)}),bu=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Us=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Er=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Ka(e)?e.internals.positionAbsolute:Vo(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},ys=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Ka(e)?e.internals.positionAbsolute:Vo(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},$g=(e,t)=>Us(Ws(bu(e),bu(t))),zo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Uf=e=>ft(e.width)&&ft(e.height)&&ft(e.x)&&ft(e.y),ft=e=>!isNaN(e)&&isFinite(e),pE=(e,t)=>{},Bo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Wo=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?Bo(l,s):l},vs=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function jn(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(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function gE(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=jn(e,n),o=jn(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=jn(e.top??e.y??0,n),o=jn(e.bottom??e.y??0,n),i=jn(e.left??e.x??0,t),s=jn(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function mE(e,t,n,r,o,i){const{x:s,y:l}=vs(e,[t,n,r]),{x:u,y:a}=vs({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=o-u,c=i-a;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(c)}}const Ys=(e,t,n,r,o,i)=>{const s=gE(i,t,n),l=(t-s.x)/e.width,u=(n-s.y)/e.height,a=Math.min(l,u),d=Sr(a,r,o),c=e.x+e.width/2,f=e.y+e.height/2,m=t/2-c*d,y=n/2-f*d,w=mE(e,m,y,d,t,n),x={left:Math.min(w.left-s.left,0),top:Math.min(w.top-s.top,0),right:Math.min(w.right-s.right,0),bottom:Math.min(w.bottom-s.bottom,0)};return{x:m-x.left+x.right,y:y-x.top+x.bottom,zoom:d}},Lo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function _r(e){return e!=null&&e!=="parent"}function Ht(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Dg(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Fg(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const l=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function Yf(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function yE(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function vE(e){return{...Mg,...e||{}}}function so(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=dt(e),l=Wo({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:u,y:a}=n?Bo(l,t):l;return{xSnapped:u,ySnapped:a,...l}}const qa=e=>({width:e.offsetWidth,height:e.offsetHeight}),Og=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},wE=["INPUT","SELECT","TEXTAREA"];function jg(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:wE.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Hg=e=>"clientX"in e,dt=(e,t)=>{var i,s;const n=Hg(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Xf=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...qa(s)}})};function Vg({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const u=e*.125+o*.375+s*.375+n*.125,a=t*.125+i*.375+l*.375+r*.125,d=Math.abs(u-e),c=Math.abs(a-t);return[u,a,d,c]}function mi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Qf({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case G.Left:return[t-mi(t-r,i),n];case G.Right:return[t+mi(r-t,i),n];case G.Top:return[t,n-mi(n-o,i)];case G.Bottom:return[t,n+mi(o-n,i)]}}function bg({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top,curvature:s=.25}){const[l,u]=Qf({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[a,d]=Qf({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[c,f,m,y]=Vg({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:u,targetControlX:a,targetControlY:d});return[`M${e},${t} C${l},${u} ${a},${d} ${r},${o}`,c,f,m,y]}function Bg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n0}const EE=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,_E=(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)),kE=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||EE;let o;return Ig(e)?o={...e}:o={...e,id:r(e)},_E(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function Wg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=Bg({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const Gf={[G.Left]:{x:-1,y:0},[G.Right]:{x:1,y:0},[G.Top]:{x:0,y:-1},[G.Bottom]:{x:0,y:1}},CE=({source:e,sourcePosition:t=G.Bottom,target:n})=>t===G.Left||t===G.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function NE({source:e,sourcePosition:t=G.Bottom,target:n,targetPosition:r=G.Top,center:o,offset:i,stepPosition:s}){const l=Gf[t],u=Gf[r],a={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+u.x*i,y:n.y+u.y*i},c=CE({source:a,sourcePosition:t,target:d}),f=c.x!==0?"x":"y",m=c[f];let y=[],w,x;const h={x:0,y:0},g={x:0,y:0},[,,p,v]=Bg({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*u[f]===-1){f==="x"?(w=o.x??a.x+(d.x-a.x)*s,x=o.y??(a.y+d.y)/2):(w=o.x??(a.x+d.x)/2,x=o.y??a.y+(d.y-a.y)*s);const _=[{x:w,y:a.y},{x:w,y:d.y}],N=[{x:a.x,y:x},{x:d.x,y:x}];l[f]===m?y=f==="x"?_:N:y=f==="x"?N:_}else{const _=[{x:a.x,y:d.y}],N=[{x:d.x,y:a.y}];if(f==="x"?y=l.x===m?N:_:y=l.y===m?_:N,t===r){const R=Math.abs(e[f]-n[f]);if(R<=i){const H=Math.min(i-1,i-R);l[f]===m?h[f]=(a[f]>e[f]?-1:1)*H:g[f]=(d[f]>n[f]?-1:1)*H}}if(t!==r){const R=f==="x"?"y":"x",H=l[f]===u[R],C=a[R]>d[R],A=a[R]=z?(w=(P.x+L.x)/2,x=y[0].y):(w=y[0].x,x=(P.y+L.y)/2)}return[[e,{x:a.x+h.x,y:a.y+h.y},...y,{x:d.x+g.x,y:d.y+g.y},n],w,x,p,v]}function ME(e,t,n,r){const o=Math.min(Kf(e,t)/2,Kf(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const a=e.x{let v="";return p>0&&pn.id===t):e[0])||null}function Wu(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function TE(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||o].forEach(u=>{if(u&&typeof u=="object"){const a=Wu(u,t);i.has(a)||(s.push({id:a,color:u.color||n,...u}),i.add(a))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const Ug=1e3,IE=10,Ja={nodeOrigin:[0,0],nodeExtent:To,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},zE={...Ja,checkEquality:!0};function ec(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function LE(e,t,n){const r=ec(Ja,n);for(const o of e.values())if(o.parentId)nc(o,e,t,r);else{const i=Vo(o,r.nodeOrigin),s=_r(o.extent)?o.extent:r.nodeExtent,l=An(i,s,Ht(o));o.internals.positionAbsolute=l}}function AE(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function tc(e){return e==="manual"}function Uu(e,t,n,r={}){var a,d;const o=ec(zE,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!tc(o.zIndexMode)?Ug:0;let u=e.length>0;t.clear(),n.clear();for(const c of e){let f=s.get(c.id);if(o.checkEquality&&c===(f==null?void 0:f.internals.userNode))t.set(c.id,f);else{const m=Vo(c,o.nodeOrigin),y=_r(c.extent)?c.extent:o.nodeExtent,w=An(m,y,Ht(c));f={...o.defaults,...c,measured:{width:(a=c.measured)==null?void 0:a.width,height:(d=c.measured)==null?void 0:d.height},internals:{positionAbsolute:w,handleBounds:AE(c,f),z:Yg(c,l,o.zIndexMode),userNode:c}},t.set(c.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(u=!1),c.parentId&&nc(f,t,n,r,i)}return u}function RE(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 nc(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:u}=ec(Ja,r),a=e.parentId,d=t.get(a);if(!d){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}RE(e,n),o&&!d.parentId&&d.internals.rootParentIndex===void 0&&u==="auto"&&(d.internals.rootParentIndex=++o.i,d.internals.z=d.internals.z+o.i*IE),o&&d.internals.rootParentIndex!==void 0&&(o.i=d.internals.rootParentIndex);const c=i&&!tc(u)?Ug:0,{x:f,y:m,z:y}=$E(e,d,s,l,c,u),{positionAbsolute:w}=e.internals,x=f!==w.x||m!==w.y;(x||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:m}:w,z:y}})}function Yg(e,t,n){const r=ft(e.zIndex)?e.zIndex:0;return tc(n)?r:r+(e.selected?t:0)}function $E(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,u=Ht(e),a=Vo(e,n),d=_r(e.extent)?An(a,e.extent,u):a;let c=An({x:s+d.x,y:l+d.y},r,u);e.extent==="parent"&&(c=Ag(c,u,t));const f=Yg(e,o,i),m=t.internals.z??0;return{x:c.x,y:c.y,z:m>=f?m+1:f}}function rc(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const a=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??Er(u),d=$g(a,l.rect);i.set(l.parentId,{expandedRect:d,parent:u})}return i.size>0&&i.forEach(({expandedRect:l,parent:u},a)=>{var p;const d=u.internals.positionAbsolute,c=Ht(u),f=u.origin??r,m=l.x0||y>0||h||g)&&(o.push({id:a,type:"position",position:{x:u.position.x-m+h,y:u.position.y-y+g}}),(p=n.get(a))==null||p.forEach(v=>{e.some(E=>E.id===v.id)||o.push({id:v.id,type:"position",position:{x:v.position.x+m,y:v.position.y+y}})})),(c.width0){const m=rc(f,t,n,o);a.push(...m)}return{changes:a,updatedInternals:u}}async function FE({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),l=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(l)}function ed(e,t,n,r,o,i){let s=o;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${o}-${e}`;const u=r.get(s)||new Map;if(r.set(s,u.set(n,t)),i){s=`${o}-${e}-${i}`;const a=r.get(s)||new Map;r.set(s,a.set(n,t))}}function Xg(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,u={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l},a=`${o}-${s}--${i}-${l}`,d=`${i}-${l}--${o}-${s}`;ed("source",u,d,e,o,s),ed("target",u,a,e,i,l),t.set(r.id,r)}}function Qg(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Qg(n,t):!1}function td(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function OE(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Qg(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(i);l&&o.set(i,{id:i,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 o}function Al({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,u;const o=[];for(const[a,d]of t){const c=(s=n.get(a))==null?void 0:s.internals.userNode;c&&o.push({...c,position:d.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((u=t.get(e))==null?void 0:u.position)||i.position,dragging:r}:o[0],o]}function jE({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=Bo(i,t);return{x:s.x-i.x,y:s.y-i.y}}function HE({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,u=!1,a={x:0,y:0},d=null,c=!1,f=null,m=!1,y=!1,w=null;function x({noDragClassName:g,handleSelector:p,domNode:v,isSelectable:E,nodeId:_,nodeClickDistance:N=0}){f=Ye(v);function P({x:R,y:H}){const{nodeLookup:C,nodeExtent:A,snapGrid:I,snapToGrid:D,nodeOrigin:k,onNodeDrag:S,onSelectionDrag:T,onError:O,updateNodePositions:F}=t();i={x:R,y:H};let W=!1;const V=l.size>1,U=V&&A?bu(bo(l)):null,Y=V&&D?jE({dragItems:l,snapGrid:I,x:R,y:H}):null;for(const[Q,B]of l){if(!C.has(Q))continue;let K={x:R-B.distance.x,y:H-B.distance.y};D&&(K=Y?{x:Math.round(K.x+Y.x),y:Math.round(K.y+Y.y)}:Bo(K,I));let ee=null;if(V&&A&&!B.extent&&U){const{positionAbsolute:Z}=B.internals,ie=Z.x-U.x+A[0][0],ue=Z.x+B.measured.width-U.x2+A[1][0],oe=Z.y-U.y+A[0][1],Pe=Z.y+B.measured.height-U.y2+A[1][1];ee=[[ie,oe],[ue,Pe]]}const{position:J,positionAbsolute:q}=Lg({nodeId:Q,nextPosition:K,nodeLookup:C,nodeExtent:ee||A,nodeOrigin:k,onError:O});W=W||B.position.x!==J.x||B.position.y!==J.y,B.position=J,B.internals.positionAbsolute=q}if(y=y||W,!!W&&(F(l,!0),w&&(r||S||!_&&T))){const[Q,B]=Al({nodeId:_,dragItems:l,nodeLookup:C});r==null||r(w,l,Q,B),S==null||S(w,Q,B),_||T==null||T(w,B)}}async function L(){if(!d)return;const{transform:R,panBy:H,autoPanSpeed:C,autoPanOnNodeDrag:A}=t();if(!A){u=!1,cancelAnimationFrame(s);return}const[I,D]=Rg(a,d,C);(I!==0||D!==0)&&(i.x=(i.x??0)-I/R[2],i.y=(i.y??0)-D/R[2],await H({x:I,y:D})&&P(i)),s=requestAnimationFrame(L)}function j(R){var V;const{nodeLookup:H,multiSelectionActive:C,nodesDraggable:A,transform:I,snapGrid:D,snapToGrid:k,selectNodesOnDrag:S,onNodeDragStart:T,onSelectionDragStart:O,unselectNodesAndEdges:F}=t();c=!0,(!S||!E)&&!C&&_&&((V=H.get(_))!=null&&V.selected||F()),E&&S&&_&&(e==null||e(_));const W=so(R.sourceEvent,{transform:I,snapGrid:D,snapToGrid:k,containerBounds:d});if(i=W,l=OE(H,A,W,_),l.size>0&&(n||T||!_&&O)){const[U,Y]=Al({nodeId:_,dragItems:l,nodeLookup:H});n==null||n(R.sourceEvent,l,U,Y),T==null||T(R.sourceEvent,U,Y),_||O==null||O(R.sourceEvent,Y)}}const z=cg().clickDistance(N).on("start",R=>{const{domNode:H,nodeDragThreshold:C,transform:A,snapGrid:I,snapToGrid:D}=t();d=(H==null?void 0:H.getBoundingClientRect())||null,m=!1,y=!1,w=R.sourceEvent,C===0&&j(R),i=so(R.sourceEvent,{transform:A,snapGrid:I,snapToGrid:D,containerBounds:d}),a=dt(R.sourceEvent,d)}).on("drag",R=>{const{autoPanOnNodeDrag:H,transform:C,snapGrid:A,snapToGrid:I,nodeDragThreshold:D,nodeLookup:k}=t(),S=so(R.sourceEvent,{transform:C,snapGrid:A,snapToGrid:I,containerBounds:d});if(w=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||_&&!k.has(_))&&(m=!0),!m){if(!u&&H&&c&&(u=!0,L()),!c){const T=dt(R.sourceEvent,d),O=T.x-a.x,F=T.y-a.y;Math.sqrt(O*O+F*F)>D&&j(R)}(i.x!==S.xSnapped||i.y!==S.ySnapped)&&l&&c&&(a=dt(R.sourceEvent,d),P(S))}}).on("end",R=>{if(!(!c||m)&&(u=!1,c=!1,cancelAnimationFrame(s),l.size>0)){const{nodeLookup:H,updateNodePositions:C,onNodeDragStop:A,onSelectionDragStop:I}=t();if(y&&(C(l,!1),y=!1),o||A||!_&&I){const[D,k]=Al({nodeId:_,dragItems:l,nodeLookup:H,dragging:!1});o==null||o(R.sourceEvent,l,D,k),A==null||A(R.sourceEvent,D,k),_||I==null||I(R.sourceEvent,k)}}}).filter(R=>{const H=R.target;return!R.button&&(!g||!td(H,`.${g}`,v))&&(!p||td(H,p,v))});f.call(z)}function h(){f==null||f.on(".drag",null)}return{update:x,destroy:h}}function VE(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())zo(o,Er(i))>0&&r.push(i);return r}const bE=250;function BE(e,t,n,r){var l,u;let o=[],i=1/0;const s=VE(e,n,t+bE);for(const a of s){const d=[...((l=a.internals.handleBounds)==null?void 0:l.source)??[],...((u=a.internals.handleBounds)==null?void 0:u.target)??[]];for(const c of d){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:f,y:m}=Rn(a,c,c.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(m-e.y,2));y>t||(y1){const a=r.type==="source"?"target":"source";return o.find(d=>d.type===a)??o[0]}return o[0]}function Gg(e,t,n,r,o,i=!1){var a,d,c;const s=r.get(e);if(!s)return null;const l=o==="strict"?(a=s.internals.handleBounds)==null?void 0:a[t]:[...((d=s.internals.handleBounds)==null?void 0:d.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],u=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return u&&i?{...u,...Rn(s,u,u.position,!0)}:u}function Kg(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function WE(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Zg=()=>!0;function UE(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:u,lib:a,autoPanOnConnect:d,flowId:c,panBy:f,cancelConnection:m,onConnectStart:y,onConnect:w,onConnectEnd:x,isValidConnection:h=Zg,onReconnectEnd:g,updateConnection:p,getTransform:v,getFromHandle:E,autoPanSpeed:_,dragThreshold:N=1,handleDomNode:P}){const L=Og(e.target);let j=0,z;const{x:R,y:H}=dt(e),C=Kg(i,P),A=l==null?void 0:l.getBoundingClientRect();let I=!1;if(!A||!C)return;const D=Gg(o,C,r,u,t);if(!D)return;let k=dt(e,A),S=!1,T=null,O=!1,F=null;function W(){if(!d||!A)return;const[J,q]=Rg(k,A,_);f({x:J,y:q}),j=requestAnimationFrame(W)}const V={...D,nodeId:o,type:C,position:D.position},U=u.get(o);let Q={inProgress:!0,isValid:null,from:Rn(U,V,G.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:U,to:k,toHandle:null,toPosition:Bf[V.position],toNode:null,pointer:k};function B(){I=!0,p(Q),y==null||y(e,{nodeId:o,handleId:r,handleType:C})}N===0&&B();function K(J){if(!I){const{x:Pe,y:Vt}=dt(J),Nt=Pe-R,pn=Vt-H;if(!(Nt*Nt+pn*pn>N*N))return;B()}if(!E()||!V){ee(J);return}const q=v();k=dt(J,A),z=BE(Wo(k,q,!1,[1,1]),n,u,V),S||(W(),S=!0);const Z=qg(J,{handle:z,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:h,doc:L,lib:a,flowId:c,nodeLookup:u});F=Z.handleDomNode,T=Z.connection,O=WE(!!z,Z.isValid);const ie=u.get(o),ue=ie?Rn(ie,V,G.Left,!0):Q.from,oe={...Q,from:ue,isValid:O,to:Z.toHandle&&O?vs({x:Z.toHandle.x,y:Z.toHandle.y},q):k,toHandle:Z.toHandle,toPosition:O&&Z.toHandle?Z.toHandle.position:Bf[V.position],toNode:Z.toHandle?u.get(Z.toHandle.nodeId):null,pointer:k};p(oe),Q=oe}function ee(J){if(!("touches"in J&&J.touches.length>0)){if(I){(z||F)&&T&&O&&(w==null||w(T));const{inProgress:q,...Z}=Q,ie={...Z,toPosition:Q.toHandle?Q.toPosition:null};x==null||x(J,ie),i&&(g==null||g(J,ie))}m(),cancelAnimationFrame(j),S=!1,O=!1,T=null,F=null,L.removeEventListener("mousemove",K),L.removeEventListener("mouseup",ee),L.removeEventListener("touchmove",K),L.removeEventListener("touchend",ee)}}L.addEventListener("mousemove",K),L.addEventListener("mouseup",ee),L.addEventListener("touchmove",K),L.addEventListener("touchend",ee)}function qg(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:u,isValidConnection:a=Zg,nodeLookup:d}){const c=i==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y}=dt(e),w=s.elementFromPoint(m,y),x=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:f,h={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const g=Kg(void 0,x),p=x.getAttribute("data-nodeid"),v=x.getAttribute("data-handleid"),E=x.classList.contains("connectable"),_=x.classList.contains("connectableend");if(!p||!g)return h;const N={source:c?p:r,sourceHandle:c?v:o,target:c?r:p,targetHandle:c?o:v};h.connection=N;const L=E&&_&&(n===wr.Strict?c&&g==="source"||!c&&g==="target":p!==r||v!==o);h.isValid=L&&a(N),h.toHandle=Gg(p,g,v,d,n,!0)}return h}const Yu={onPointerDown:UE,isValid:qg};function YE({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=Ye(e);function i({translateExtent:l,width:u,height:a,zoomStep:d=1,pannable:c=!0,zoomable:f=!0,inversePan:m=!1}){const y=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const v=n(),E=p.sourceEvent.ctrlKey&&Lo()?10:1,_=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*d,N=v[2]*Math.pow(2,_*E);t.scaleTo(N)};let w=[0,0];const x=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(w=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},h=p=>{const v=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const E=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],_=[E[0]-w[0],E[1]-w[1]];w=E;const N=r()*Math.max(v[2],Math.log(v[2]))*(m?-1:1),P={x:v[0]-_[0]*N,y:v[1]-_[1]*N},L=[[0,0],[u,a]];t.setViewportConstrained({x:P.x,y:P.y,zoom:v[2]},L,l)},g=Cg().on("start",x).on("zoom",c?h:null).on("zoom.wheel",f?y:null);o.call(g,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:ut}}const Xs=e=>({x:e.x,y:e.y,zoom:e.k}),Rl=({x:e,y:t,zoom:n})=>Bs.translate(e,t).scale(n),er=(e,t)=>e.target.closest(`.${t}`),Jg=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),XE=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,$l=(e,t=0,n=XE,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},em=e=>{const t=e.ctrlKey&&Lo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function QE({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:a}){return d=>{if(er(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(d.ctrlKey&&s){const x=ut(d),h=em(d),g=c*Math.pow(2,h);r.scaleTo(n,g,x,d);return}const f=d.deltaMode===1?20:1;let m=o===Cn.Vertical?0:d.deltaX*f,y=o===Cn.Horizontal?0:d.deltaY*f;!Lo()&&d.shiftKey&&o!==Cn.Vertical&&(m=d.deltaY*f,y=0),r.translateBy(n,-(m/c)*i,-(y/c)*i,{internal:!0});const w=Xs(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(d,w),e.panScrollTimeout=setTimeout(()=>{a==null||a(d,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,w))}}function GE({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=er(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function KE({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=Xs(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function ZE({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&Jg(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((l=i.sourceEvent)!=null&&l.internal)&&(o==null||o(i.sourceEvent,Xs(i.transform)))}}function qE({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&Jg(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const u=Xs(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,u)},n?150:0)}}}function JE({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:l,noPanClassName:u,lib:a,connectionInProgress:d}){return c=>{var x;const f=e||t,m=n&&c.ctrlKey,y=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(er(c,`${a}-flow__node`)||er(c,`${a}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||s||d&&!y||er(c,l)&&y||er(c,u)&&(!y||o&&y&&!e)||!n&&c.ctrlKey&&y)return!1;if(!n&&c.type==="touchstart"&&((x=c.touches)==null?void 0:x.length)>1)return c.preventDefault(),!1;if(!f&&!o&&!m&&y||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||y)&&w}}function e_({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:u}){const a={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),c=Cg().scaleExtent([t,n]).translateExtent(r),f=Ye(e).call(c);g({x:o.x,y:o.y,zoom:Sr(o.zoom,t,n)},[[0,0],[d.width,d.height]],r);const m=f.on("wheel.zoom"),y=f.on("dblclick.zoom");c.wheelDelta(em);function w(z,R){return f?new Promise(H=>{c==null||c.interpolate((R==null?void 0:R.interpolate)==="linear"?io:Di).transform($l(f,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>H(!0)),z)}):Promise.resolve(!1)}function x({noWheelClassName:z,noPanClassName:R,onPaneContextMenu:H,userSelectionActive:C,panOnScroll:A,panOnDrag:I,panOnScrollMode:D,panOnScrollSpeed:k,preventScrolling:S,zoomOnPinch:T,zoomOnScroll:O,zoomOnDoubleClick:F,zoomActivationKeyPressed:W,lib:V,onTransformChange:U,connectionInProgress:Y,paneClickDistance:Q,selectionOnDrag:B}){C&&!a.isZoomingOrPanning&&h();const K=A&&!W&&!C;c.clickDistance(B?1/0:!ft(Q)||Q<0?0:Q);const ee=K?QE({zoomPanValues:a,noWheelClassName:z,d3Selection:f,d3Zoom:c,panOnScrollMode:D,panOnScrollSpeed:k,zoomOnPinch:T,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):GE({noWheelClassName:z,preventScrolling:S,d3ZoomHandler:m});if(f.on("wheel.zoom",ee,{passive:!1}),!C){const q=KE({zoomPanValues:a,onDraggingChange:u,onPanZoomStart:s});c.on("start",q);const Z=ZE({zoomPanValues:a,panOnDrag:I,onPaneContextMenu:!!H,onPanZoom:i,onTransformChange:U});c.on("zoom",Z);const ie=qE({zoomPanValues:a,panOnDrag:I,panOnScroll:A,onPaneContextMenu:H,onPanZoomEnd:l,onDraggingChange:u});c.on("end",ie)}const J=JE({zoomActivationKeyPressed:W,panOnDrag:I,zoomOnScroll:O,panOnScroll:A,zoomOnDoubleClick:F,zoomOnPinch:T,userSelectionActive:C,noPanClassName:R,noWheelClassName:z,lib:V,connectionInProgress:Y});c.filter(J),F?f.on("dblclick.zoom",y):f.on("dblclick.zoom",null)}function h(){c.on("zoom",null)}async function g(z,R,H){const C=Rl(z),A=c==null?void 0:c.constrain()(C,R,H);return A&&await w(A),new Promise(I=>I(A))}async function p(z,R){const H=Rl(z);return await w(H,R),new Promise(C=>C(H))}function v(z){if(f){const R=Rl(z),H=f.property("__zoom");(H.k!==z.zoom||H.x!==z.x||H.y!==z.y)&&(c==null||c.transform(f,R,null,{sync:!0}))}}function E(){const z=f?kg(f.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}function _(z,R){return f?new Promise(H=>{c==null||c.interpolate((R==null?void 0:R.interpolate)==="linear"?io:Di).scaleTo($l(f,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>H(!0)),z)}):Promise.resolve(!1)}function N(z,R){return f?new Promise(H=>{c==null||c.interpolate((R==null?void 0:R.interpolate)==="linear"?io:Di).scaleBy($l(f,R==null?void 0:R.duration,R==null?void 0:R.ease,()=>H(!0)),z)}):Promise.resolve(!1)}function P(z){c==null||c.scaleExtent(z)}function L(z){c==null||c.translateExtent(z)}function j(z){const R=!ft(z)||z<0?0:z;c==null||c.clickDistance(R)}return{update:x,destroy:h,setViewport:p,setViewportConstrained:g,getViewport:E,scaleTo:_,scaleBy:N,setScaleExtent:P,setTranslateExtent:L,syncViewport:v,setClickDistance:j}}var kr;(function(e){e.Line="line",e.Handle="handle"})(kr||(kr={}));function t_({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,l=n-r,u=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&o&&(u[0]=u[0]*-1),l&&i&&(u[1]=u[1]*-1),u}function nd(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Bt(e,t){return Math.max(0,t-e)}function Wt(e,t){return Math.max(0,e-t)}function yi(e,t,n){return Math.max(0,t-e,e-n)}function rd(e,t){return e?!t:t}function n_(e,t,n,r,o,i,s,l){let{affectsX:u,affectsY:a}=t;const{isHorizontal:d,isVertical:c}=t,f=d&&c,{xSnapped:m,ySnapped:y}=n,{minWidth:w,maxWidth:x,minHeight:h,maxHeight:g}=r,{x:p,y:v,width:E,height:_,aspectRatio:N}=e;let P=Math.floor(d?m-e.pointerX:0),L=Math.floor(c?y-e.pointerY:0);const j=E+(u?-P:P),z=_+(a?-L:L),R=-i[0]*E,H=-i[1]*_;let C=yi(j,w,x),A=yi(z,h,g);if(s){let k=0,S=0;u&&P<0?k=Bt(p+P+R,s[0][0]):!u&&P>0&&(k=Wt(p+j+R,s[1][0])),a&&L<0?S=Bt(v+L+H,s[0][1]):!a&&L>0&&(S=Wt(v+z+H,s[1][1])),C=Math.max(C,k),A=Math.max(A,S)}if(l){let k=0,S=0;u&&P>0?k=Wt(p+P,l[0][0]):!u&&P<0&&(k=Bt(p+j,l[1][0])),a&&L>0?S=Wt(v+L,l[0][1]):!a&&L<0&&(S=Bt(v+z,l[1][1])),C=Math.max(C,k),A=Math.max(A,S)}if(o){if(d){const k=yi(j/N,h,g)*N;if(C=Math.max(C,k),s){let S=0;!u&&!a||u&&!a&&f?S=Wt(v+H+j/N,s[1][1])*N:S=Bt(v+H+(u?P:-P)/N,s[0][1])*N,C=Math.max(C,S)}if(l){let S=0;!u&&!a||u&&!a&&f?S=Bt(v+j/N,l[1][1])*N:S=Wt(v+(u?P:-P)/N,l[0][1])*N,C=Math.max(C,S)}}if(c){const k=yi(z*N,w,x)/N;if(A=Math.max(A,k),s){let S=0;!u&&!a||a&&!u&&f?S=Wt(p+z*N+R,s[1][0])/N:S=Bt(p+(a?L:-L)*N+R,s[0][0])/N,A=Math.max(A,S)}if(l){let S=0;!u&&!a||a&&!u&&f?S=Bt(p+z*N,l[1][0])/N:S=Wt(p+(a?L:-L)*N,l[0][0])/N,A=Math.max(A,S)}}}L=L+(L<0?A:-A),P=P+(P<0?C:-C),o&&(f?j>z*N?L=(rd(u,a)?-P:P)/N:P=(rd(u,a)?-L:L)*N:d?(L=P/N,a=u):(P=L*N,u=a));const I=u?p+P:p,D=a?v+L:v;return{width:E+(u?-P:P),height:_+(a?-L:L),x:i[0]*P*(u?-1:1)+I,y:i[1]*L*(a?-1:1)+D}}const tm={width:0,height:0,x:0,y:0},r_={...tm,pointerX:0,pointerY:0,aspectRatio:1};function o_(e){return[[0,0],[e.measured.width,e.measured.height]]}function i_(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,l=n[0]*i,u=n[1]*s;return[[r-l,o-u],[r+i-l,o+s-u]]}function s_({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=Ye(e);let s={controlDirection:nd("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:a,boundaries:d,keepAspectRatio:c,resizeDirection:f,onResizeStart:m,onResize:y,onResizeEnd:w,shouldResize:x}){let h={...tm},g={...r_};s={boundaries:d,resizeDirection:f,keepAspectRatio:c,controlDirection:nd(a)};let p,v=null,E=[],_,N,P,L=!1;const j=cg().on("start",z=>{const{nodeLookup:R,transform:H,snapGrid:C,snapToGrid:A,nodeOrigin:I,paneDomNode:D}=n();if(p=R.get(t),!p)return;v=(D==null?void 0:D.getBoundingClientRect())??null;const{xSnapped:k,ySnapped:S}=so(z.sourceEvent,{transform:H,snapGrid:C,snapToGrid:A,containerBounds:v});h={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},g={...h,pointerX:k,pointerY:S,aspectRatio:h.width/h.height},_=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(_=R.get(p.parentId),N=_&&p.extent==="parent"?o_(_):void 0),E=[],P=void 0;for(const[T,O]of R)if(O.parentId===t&&(E.push({id:T,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const F=i_(O,p,O.origin??I);P?P=[[Math.min(F[0][0],P[0][0]),Math.min(F[0][1],P[0][1])],[Math.max(F[1][0],P[1][0]),Math.max(F[1][1],P[1][1])]]:P=F}m==null||m(z,{...h})}).on("drag",z=>{const{transform:R,snapGrid:H,snapToGrid:C,nodeOrigin:A}=n(),I=so(z.sourceEvent,{transform:R,snapGrid:H,snapToGrid:C,containerBounds:v}),D=[];if(!p)return;const{x:k,y:S,width:T,height:O}=h,F={},W=p.origin??A,{width:V,height:U,x:Y,y:Q}=n_(g,s.controlDirection,I,s.boundaries,s.keepAspectRatio,W,N,P),B=V!==T,K=U!==O,ee=Y!==k&&B,J=Q!==S&&K;if(!ee&&!J&&!B&&!K)return;if((ee||J||W[0]===1||W[1]===1)&&(F.x=ee?Y:h.x,F.y=J?Q:h.y,h.x=F.x,h.y=F.y,E.length>0)){const ue=Y-k,oe=Q-S;for(const Pe of E)Pe.position={x:Pe.position.x-ue+W[0]*(V-T),y:Pe.position.y-oe+W[1]*(U-O)},D.push(Pe)}if((B||K)&&(F.width=B&&(!s.resizeDirection||s.resizeDirection==="horizontal")?V:h.width,F.height=K&&(!s.resizeDirection||s.resizeDirection==="vertical")?U:h.height,h.width=F.width,h.height=F.height),_&&p.expandParent){const ue=W[0]*(F.width??0);F.x&&F.x{L&&(w==null||w(z,{...h}),o==null||o({...h}),L=!1)});i.call(j)}function u(){i.on(".drag",null)}return{update:l,destroy:u}}var nm={exports:{}},rm={},om={exports:{}},im={};/** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Cr=$;function l_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var u_=typeof Object.is=="function"?Object.is:l_,a_=Cr.useState,c_=Cr.useEffect,f_=Cr.useLayoutEffect,d_=Cr.useDebugValue;function h_(e,t){var n=t(),r=a_({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return f_(function(){o.value=n,o.getSnapshot=t,Dl(o)&&i({inst:o})},[e,n,t]),c_(function(){return Dl(o)&&i({inst:o}),e(function(){Dl(o)&&i({inst:o})})},[e]),d_(n),n}function Dl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!u_(e,n)}catch{return!0}}function p_(e,t){return t()}var g_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p_:h_;im.useSyncExternalStore=Cr.useSyncExternalStore!==void 0?Cr.useSyncExternalStore:g_;om.exports=im;var m_=om.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Qs=$,y_=m_;function v_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var w_=typeof Object.is=="function"?Object.is:v_,x_=y_.useSyncExternalStore,S_=Qs.useRef,E_=Qs.useEffect,__=Qs.useMemo,k_=Qs.useDebugValue;rm.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=S_(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=__(function(){function u(m){if(!a){if(a=!0,d=m,m=r(m),o!==void 0&&s.hasValue){var y=s.value;if(o(y,m))return c=y}return c=m}if(y=c,w_(d,m))return y;var w=r(m);return o!==void 0&&o(y,w)?(d=m,y):(d=m,c=w)}var a=!1,d,c,f=n===void 0?null:n;return[function(){return u(t())},f===null?void 0:function(){return u(f())}]},[t,n,r,o]);var l=x_(e,i[0],i[1]);return E_(function(){s.hasValue=!0,s.value=l},[l]),k_(l),l};nm.exports=rm;var C_=nm.exports;const N_=Dd(C_),M_={},od=e=>{let t;const n=new Set,r=(d,c)=>{const f=typeof d=="function"?d(t):d;if(!Object.is(f,t)){const m=t;t=c??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,m))}},o=()=>t,u={setState:r,getState:o,getInitialState:()=>a,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(M_?"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()}},a=t=e(r,o,u);return u},P_=e=>e?od(e):od,{useDebugValue:T_}=vy,{useSyncExternalStoreWithSelector:I_}=N_,z_=e=>e;function sm(e,t=z_,n){const r=I_(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return T_(r),r}const id=(e,t)=>{const n=P_(e),r=(o,i=t)=>sm(n,o,i);return Object.assign(r,n),r},L_=(e,t)=>e?id(e,t):id;function de(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Gs=$.createContext(null),A_=Gs.Provider,lm=kt.error001();function ne(e,t){const n=$.useContext(Gs);if(n===null)throw new Error(lm);return sm(n,e,t)}function he(){const e=$.useContext(Gs);if(e===null)throw new Error(lm);return $.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const sd={display:"none"},R_={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},um="react-flow__node-desc",am="react-flow__edge-desc",$_="react-flow__aria-live",D_=e=>e.ariaLiveMessage,F_=e=>e.ariaLabelConfig;function O_({rfId:e}){const t=ne(D_);return M.jsx("div",{id:`${$_}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:R_,children:t})}function j_({rfId:e,disableKeyboardA11y:t}){const n=ne(F_);return M.jsxs(M.Fragment,{children:[M.jsx("div",{id:`${um}-${e}`,style:sd,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),M.jsx("div",{id:`${am}-${e}`,style:sd,children:n["edge.a11yDescription.default"]}),!t&&M.jsx(O_,{rfId:e})]})}const Ks=$.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return M.jsx("div",{className:xe(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});Ks.displayName="Panel";function H_({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:M.jsx(Ks,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:M.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const V_=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},vi=e=>e.id;function b_(e,t){return de(e.selectedNodes.map(vi),t.selectedNodes.map(vi))&&de(e.selectedEdges.map(vi),t.selectedEdges.map(vi))}function B_({onSelectionChange:e}){const t=he(),{selectedNodes:n,selectedEdges:r}=ne(V_,b_);return $.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const W_=e=>!!e.onSelectionChangeHandlers;function U_({onSelectionChange:e}){const t=ne(W_);return e||t?M.jsx(B_,{onSelectionChange:e}):null}const cm=[0,0],Y_={x:0,y:0,zoom:1},X_=["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"],ld=[...X_,"rfId"],Q_=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}),ud={translateExtent:To,nodeOrigin:cm,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function G_(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:u}=ne(Q_,de),a=he();$.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{d.current=ud,l()}),[]);const d=$.useRef(ud);return $.useEffect(()=>{for(const c of ld){const f=e[c],m=d.current[c];f!==m&&(typeof e[c]>"u"||(c==="nodes"?t(f):c==="edges"?n(f):c==="minZoom"?r(f):c==="maxZoom"?o(f):c==="translateExtent"?i(f):c==="nodeExtent"?s(f):c==="ariaLabelConfig"?a.setState({ariaLabelConfig:vE(f)}):c==="fitView"?a.setState({fitViewQueued:f}):c==="fitViewOptions"?a.setState({fitViewOptions:f}):a.setState({[c]:f})))}d.current=e},ld.map(c=>e[c])),null}function ad(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function K_(e){var r;const[t,n]=$.useState(e==="system"?null:e);return $.useEffect(()=>{if(e!=="system"){n(e);return}const o=ad(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=ad())!=null&&r.matches?"dark":"light"}const cd=typeof document<"u"?document:null;function Ao(e=null,t={target:cd,actInsideInputWithModifier:!0}){const[n,r]=$.useState(!1),o=$.useRef(!1),i=$.useRef(new Set([])),[s,l]=$.useMemo(()=>{if(e!==null){const a=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",` `).replace(` `,` +`).split(` `)),d=a.reduce((c,f)=>c.concat(...f),[]);return[a,d]}return[[],[]]},[e]);return $.useEffect(()=>{const u=(t==null?void 0:t.target)??cd,a=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var x,h;if(o.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!o.current||o.current&&!a)&&jg(m))return!1;const w=dd(m.code,l);if(i.current.add(m[w]),fd(s,i.current,!1)){const g=((h=(x=m.composedPath)==null?void 0:x.call(m))==null?void 0:h[0])||m.target,p=(g==null?void 0:g.nodeName)==="BUTTON"||(g==null?void 0:g.nodeName)==="A";t.preventDefault!==!1&&(o.current||!p)&&m.preventDefault(),r(!0)}},c=m=>{const y=dd(m.code,l);fd(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[y]),m.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",d),u==null||u.addEventListener("keyup",c),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{u==null||u.removeEventListener("keydown",d),u==null||u.removeEventListener("keyup",c),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function fd(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function dd(e,t){return t.includes(e)?"code":"key"}const Z_=()=>{const e=he();return $.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:l}=e.getState(),u=Ys(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:u}=s.getBoundingClientRect(),a={x:t.x-l,y:t.y-u},d=n.snapGrid??o,c=n.snapToGrid??i;return Wo(a,r,c,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=vs(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function fm(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.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 l={...i};for(const u of s)q_(u,l);n.push(l)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function q_(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 dm(e,t){return fm(e,t)}function hm(e,t){return fm(e,t)}function yn(e,t){return{id:e,type:"select",selected:t}}function tr(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(yn(i.id,s)))}return r}function hd({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const l=t.get(s.id),u=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;u!==void 0&&u!==s&&n.push({id:s.id,item:s,type:"replace"}),u===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function pd(e){return{id:e.id,type:"remove"}}const gd=e=>aE(e),J_=e=>Ig(e);function pm(e){return $.forwardRef(e)}const e2=typeof window<"u"?$.useLayoutEffect:$.useEffect;function md(e){const[t,n]=$.useState(BigInt(0)),[r]=$.useState(()=>t2(()=>n(o=>o+BigInt(1))));return e2(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function t2(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const gm=$.createContext(null);function n2({children:e}){const t=he(),n=$.useCallback(l=>{const{nodes:u=[],setNodes:a,hasDefaultNodes:d,onNodesChange:c,nodeLookup:f,fitViewQueued:m,onNodesChangeMiddlewareMap:y}=t.getState();let w=u;for(const h of l)w=typeof h=="function"?h(w):h;let x=hd({items:w,lookup:f});for(const h of y.values())x=h(x);d&&a(w),x.length>0?c==null||c(x):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:h,nodes:g,setNodes:p}=t.getState();h&&p(g)})},[]),r=md(n),o=$.useCallback(l=>{const{edges:u=[],setEdges:a,hasDefaultEdges:d,onEdgesChange:c,edgeLookup:f}=t.getState();let m=u;for(const y of l)m=typeof y=="function"?y(m):y;d?a(m):c&&c(hd({items:m,lookup:f}))},[]),i=md(o),s=$.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return M.jsx(gm.Provider,{value:s,children:e})}function r2(){const e=$.useContext(gm);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const o2=e=>!!e.panZoom;function Uo(){const e=Z_(),t=he(),n=r2(),r=ne(o2),o=$.useMemo(()=>{const i=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},l=c=>{n.edgeQueue.push(c)},u=c=>{var h,g;const{nodeLookup:f,nodeOrigin:m}=t.getState(),y=gd(c)?c:f.get(c.id),w=y.parentId?Fg(y.position,y.measured,y.parentId,f,m):y.position,x={...y,position:w,width:((h=y.measured)==null?void 0:h.width)??y.width,height:((g=y.measured)==null?void 0:g.height)??y.height};return Er(x)},a=(c,f,m={replace:!1})=>{s(y=>y.map(w=>{if(w.id===c){const x=typeof f=="function"?f(w):f;return m.replace&&gd(x)?x:{...w,...x}}return w}))},d=(c,f,m={replace:!1})=>{l(y=>y.map(w=>{if(w.id===c){const x=typeof f=="function"?f(w):f;return m.replace&&J_(x)?x:{...w,...x}}return w}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var f;return(f=i(c))==null?void 0:f.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:l,addNodes:c=>{const f=Array.isArray(c)?c:[c];n.nodeQueue.push(m=>[...m,...f])},addEdges:c=>{const f=Array.isArray(c)?c:[c];n.edgeQueue.push(m=>[...m,...f])},toObject:()=>{const{nodes:c=[],edges:f=[],transform:m}=t.getState(),[y,w,x]=m;return{nodes:c.map(h=>({...h})),edges:f.map(h=>({...h})),viewport:{x:y,y:w,zoom:x}}},deleteElements:async({nodes:c=[],edges:f=[]})=>{const{nodes:m,edges:y,onNodesDelete:w,onEdgesDelete:x,triggerNodeChanges:h,triggerEdgeChanges:g,onDelete:p,onBeforeDelete:v}=t.getState(),{nodes:E,edges:_}=await hE({nodesToRemove:c,edgesToRemove:f,nodes:m,edges:y,onBeforeDelete:v}),N=_.length>0,P=E.length>0;if(N){const L=_.map(pd);x==null||x(_),g(L)}if(P){const L=E.map(pd);w==null||w(E),h(L)}return(P||N)&&(p==null||p({nodes:E,edges:_})),{deletedNodes:E,deletedEdges:_}},getIntersectingNodes:(c,f=!0,m)=>{const y=Uf(c),w=y?c:u(c),x=m!==void 0;return w?(m||t.getState().nodes).filter(h=>{const g=t.getState().nodeLookup.get(h.id);if(g&&!y&&(h.id===c.id||!g.internals.positionAbsolute))return!1;const p=Er(x?h:g),v=zo(p,w);return f&&v>0||v>=p.width*p.height||v>=w.width*w.height}):[]},isNodeIntersecting:(c,f,m=!0)=>{const w=Uf(c)?c:u(c);if(!w)return!1;const x=zo(w,f);return m&&x>0||x>=f.width*f.height||x>=w.width*w.height},updateNode:a,updateNodeData:(c,f,m={replace:!1})=>{a(c,y=>{const w=typeof f=="function"?f(y):f;return m.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},m)},updateEdge:d,updateEdgeData:(c,f,m={replace:!1})=>{d(c,y=>{const w=typeof f=="function"?f(y):f;return m.replace?{...y,data:w}:{...y,data:{...y.data,...w}}},m)},getNodesBounds:c=>{const{nodeLookup:f,nodeOrigin:m}=t.getState();return zg(c,{nodeLookup:f,nodeOrigin:m})},getHandleConnections:({type:c,id:f,nodeId:m})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${m}-${c}${f?`-${f}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:c,handleId:f,nodeId:m})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${m}${c?f?`-${c}-${f}`:`-${c}`:""}`))==null?void 0:y.values())??[])},fitView:async c=>{const f=t.getState().fitViewResolver??yE();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:f}),n.nodeQueue.push(m=>[...m]),f.promise}}},[]);return $.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const yd=e=>e.selected,i2=typeof window<"u"?window:void 0;function s2({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=he(),{deleteElements:r}=Uo(),o=Ao(e,{actInsideInputWithModifier:!1}),i=Ao(t,{target:i2});$.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(yd),edges:s.filter(yd)}),n.setState({nodesSelectionActive:!1})}},[o]),$.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function l2(e){const t=he();$.useEffect(()=>{const n=()=>{var o,i,s,l;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=qa(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",kt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Zs={position:"absolute",width:"100%",height:"100%",top:0,left:0},u2=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function a2({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=Cn.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:a,minZoom:d,maxZoom:c,zoomActivationKeyCode:f,preventScrolling:m=!0,children:y,noWheelClassName:w,noPanClassName:x,onViewportChange:h,isControlledViewport:g,paneClickDistance:p,selectionOnDrag:v}){const E=he(),_=$.useRef(null),{userSelectionActive:N,lib:P,connectionInProgress:L}=ne(u2,de),j=Ao(f),z=$.useRef();l2(_);const R=$.useCallback(H=>{h==null||h({x:H[0],y:H[1],zoom:H[2]}),g||E.setState({transform:H})},[h,g]);return $.useEffect(()=>{if(_.current){z.current=e_({domNode:_.current,minZoom:d,maxZoom:c,translateExtent:a,viewport:u,onDraggingChange:I=>E.setState(D=>D.paneDragging===I?D:{paneDragging:I}),onPanZoomStart:(I,D)=>{const{onViewportChangeStart:k,onMoveStart:S}=E.getState();S==null||S(I,D),k==null||k(D)},onPanZoom:(I,D)=>{const{onViewportChange:k,onMove:S}=E.getState();S==null||S(I,D),k==null||k(D)},onPanZoomEnd:(I,D)=>{const{onViewportChangeEnd:k,onMoveEnd:S}=E.getState();S==null||S(I,D),k==null||k(D)}});const{x:H,y:C,zoom:A}=z.current.getViewport();return E.setState({panZoom:z.current,transform:[H,C,A],domNode:_.current.closest(".react-flow")}),()=>{var I;(I=z.current)==null||I.destroy()}}},[]),$.useEffect(()=>{var H;(H=z.current)==null||H.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:j,preventScrolling:m,noPanClassName:x,userSelectionActive:N,noWheelClassName:w,lib:P,onTransformChange:R,connectionInProgress:L,selectionOnDrag:v,paneClickDistance:p})},[e,t,n,r,o,i,s,l,j,m,x,N,w,P,R,L,v,p]),M.jsx("div",{className:"react-flow__renderer",ref:_,style:Zs,children:y})}const c2=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function f2(){const{userSelectionActive:e,userSelectionRect:t}=ne(c2,de);return e&&t?M.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 Fl=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},d2=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function h2({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Io.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:a,onPaneScroll:d,onPaneMouseEnter:c,onPaneMouseMove:f,onPaneMouseLeave:m,children:y}){const w=he(),{userSelectionActive:x,elementsSelectable:h,dragging:g,connectionInProgress:p}=ne(d2,de),v=h&&(e||x),E=$.useRef(null),_=$.useRef(),N=$.useRef(new Set),P=$.useRef(new Set),L=$.useRef(!1),j=k=>{if(L.current||p){L.current=!1;return}u==null||u(k),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},z=k=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){k.preventDefault();return}a==null||a(k)},R=d?k=>d(k):void 0,H=k=>{L.current&&(k.stopPropagation(),L.current=!1)},C=k=>{var U,Y;const{domNode:S}=w.getState();if(_.current=S==null?void 0:S.getBoundingClientRect(),!_.current)return;const T=k.target===E.current;if(!T&&!!k.target.closest(".nokey")||!e||!(i&&T||t)||k.button!==0||!k.isPrimary)return;(Y=(U=k.target)==null?void 0:U.setPointerCapture)==null||Y.call(U,k.pointerId),L.current=!1;const{x:W,y:V}=dt(k.nativeEvent,_.current);w.setState({userSelectionRect:{width:0,height:0,startX:W,startY:V,x:W,y:V}}),T||(k.stopPropagation(),k.preventDefault())},A=k=>{const{userSelectionRect:S,transform:T,nodeLookup:O,edgeLookup:F,connectionLookup:W,triggerNodeChanges:V,triggerEdgeChanges:U,defaultEdgeOptions:Y,resetSelectedElements:Q}=w.getState();if(!_.current||!S)return;const{x:B,y:K}=dt(k.nativeEvent,_.current),{startX:ee,startY:J}=S;if(!L.current){const oe=t?0:o;if(Math.hypot(B-ee,K-J)<=oe)return;Q(),s==null||s(k)}L.current=!0;const q={startX:ee,startY:J,x:Boe.id)),P.current=new Set;const ue=(Y==null?void 0:Y.selectable)??!0;for(const oe of N.current){const Pe=W.get(oe);if(Pe)for(const{edgeId:Vt}of Pe.values()){const Nt=F.get(Vt);Nt&&(Nt.selectable??ue)&&P.current.add(Vt)}}if(!Yf(Z,N.current)){const oe=tr(O,N.current,!0);V(oe)}if(!Yf(ie,P.current)){const oe=tr(F,P.current);U(oe)}w.setState({userSelectionRect:q,userSelectionActive:!0,nodesSelectionActive:!1})},I=k=>{var S,T;k.button===0&&((T=(S=k.target)==null?void 0:S.releasePointerCapture)==null||T.call(S,k.pointerId),!x&&k.target===E.current&&w.getState().userSelectionRect&&(j==null||j(k)),w.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(l==null||l(k),w.setState({nodesSelectionActive:N.current.size>0})))},D=r===!0||Array.isArray(r)&&r.includes(0);return M.jsxs("div",{className:xe(["react-flow__pane",{draggable:D,dragging:g,selection:e}]),onClick:v?void 0:Fl(j,E),onContextMenu:Fl(z,E),onWheel:Fl(R,E),onPointerEnter:v?void 0:c,onPointerMove:v?A:f,onPointerUp:v?I:void 0,onPointerDownCapture:v?C:void 0,onClickCapture:v?H:void 0,onPointerLeave:m,ref:E,style:Zs,children:[y,M.jsx(f2,{})]})}function Xu({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:l,onError:u}=t.getState(),a=l.get(e);if(!a){u==null||u("012",kt.error012(e));return}t.setState({nodesSelectionActive:!1}),a.selected?(n||a.selected&&s)&&(i({nodes:[a],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):o([e])}function mm({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=he(),[u,a]=$.useState(!1),d=$.useRef();return $.useEffect(()=>{d.current=HE({getStoreItems:()=>l.getState(),onNodeMouseDown:c=>{Xu({id:c,store:l,nodeRef:e})},onDragStart:()=>{a(!0)},onDragStop:()=>{a(!1)}})},[]),$.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s}),()=>{var c;(c=d.current)==null||c.destroy()}},[n,r,t,i,e,o,s]),u}const p2=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ym(){const e=he();return $.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:u,nodeLookup:a,nodeOrigin:d}=e.getState(),c=new Map,f=p2(s),m=o?i[0]:5,y=o?i[1]:5,w=n.direction.x*m*n.factor,x=n.direction.y*y*n.factor;for(const[,h]of a){if(!f(h))continue;let g={x:h.internals.positionAbsolute.x+w,y:h.internals.positionAbsolute.y+x};o&&(g=Bo(g,i));const{position:p,positionAbsolute:v}=Lg({nodeId:h.id,nextPosition:g,nodeLookup:a,nodeExtent:r,nodeOrigin:d,onError:l});h.position=p,h.internals.positionAbsolute=v,c.set(h.id,h)}u(c)},[])}const oc=$.createContext(null),g2=oc.Provider;oc.Consumer;const vm=()=>$.useContext(oc),m2=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),y2=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:u,isValid:a}=s,d=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===wr.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!o,valid:d&&a}};function v2({type:e="source",position:t=G.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:u,className:a,onMouseDown:d,onTouchStart:c,...f},m){var A,I;const y=s||null,w=e==="target",x=he(),h=vm(),{connectOnClick:g,noPanClassName:p,rfId:v}=ne(m2,de),{connectingFrom:E,connectingTo:_,clickConnecting:N,isPossibleEndHandle:P,connectionInProcess:L,clickConnectionInProcess:j,valid:z}=ne(y2(h,y,e),de);h||(I=(A=x.getState()).onError)==null||I.call(A,"010",kt.error010());const R=D=>{const{defaultEdgeOptions:k,onConnect:S,hasDefaultEdges:T}=x.getState(),O={...k,...D};if(T){const{edges:F,setEdges:W}=x.getState();W(kE(O,F))}S==null||S(O),l==null||l(O)},H=D=>{if(!h)return;const k=Hg(D.nativeEvent);if(o&&(k&&D.button===0||!k)){const S=x.getState();Yu.onPointerDown(D.nativeEvent,{handleDomNode:D.currentTarget,autoPanOnConnect:S.autoPanOnConnect,connectionMode:S.connectionMode,connectionRadius:S.connectionRadius,domNode:S.domNode,nodeLookup:S.nodeLookup,lib:S.lib,isTarget:w,handleId:y,nodeId:h,flowId:S.rfId,panBy:S.panBy,cancelConnection:S.cancelConnection,onConnectStart:S.onConnectStart,onConnectEnd:(...T)=>{var O,F;return(F=(O=x.getState()).onConnectEnd)==null?void 0:F.call(O,...T)},updateConnection:S.updateConnection,onConnect:R,isValidConnection:n||((...T)=>{var O,F;return((F=(O=x.getState()).isValidConnection)==null?void 0:F.call(O,...T))??!0}),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:S.autoPanSpeed,dragThreshold:S.connectionDragThreshold})}k?d==null||d(D):c==null||c(D)},C=D=>{const{onClickConnectStart:k,onClickConnectEnd:S,connectionClickStartHandle:T,connectionMode:O,isValidConnection:F,lib:W,rfId:V,nodeLookup:U,connection:Y}=x.getState();if(!h||!T&&!o)return;if(!T){k==null||k(D.nativeEvent,{nodeId:h,handleId:y,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:h,type:e,id:y}});return}const Q=Og(D.target),B=n||F,{connection:K,isValid:ee}=Yu.isValid(D.nativeEvent,{handle:{nodeId:h,id:y,type:e},connectionMode:O,fromNodeId:T.nodeId,fromHandleId:T.id||null,fromType:T.type,isValidConnection:B,flowId:V,doc:Q,lib:W,nodeLookup:U});ee&&K&&R(K);const J=structuredClone(Y);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,S==null||S(D,J),x.setState({connectionClickStartHandle:null})};return M.jsx("div",{"data-handleid":y,"data-nodeid":h,"data-handlepos":t,"data-id":`${v}-${h}-${y}-${e}`,className:xe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,a,{source:!w,target:w,connectable:r,connectablestart:o,connectableend:i,clickconnecting:N,connectingfrom:E,connectingto:_,valid:z,connectionindicator:r&&(!L||P)&&(L||j?i:o)}]),onMouseDown:H,onTouchStart:H,onClick:g?C:void 0,ref:m,...f,children:u})}const Nr=$.memo(pm(v2));function w2({data:e,isConnectable:t,sourcePosition:n=G.Bottom}){return M.jsxs(M.Fragment,{children:[e==null?void 0:e.label,M.jsx(Nr,{type:"source",position:n,isConnectable:t})]})}function x2({data:e,isConnectable:t,targetPosition:n=G.Top,sourcePosition:r=G.Bottom}){return M.jsxs(M.Fragment,{children:[M.jsx(Nr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,M.jsx(Nr,{type:"source",position:r,isConnectable:t})]})}function S2(){return null}function E2({data:e,isConnectable:t,targetPosition:n=G.Top}){return M.jsxs(M.Fragment,{children:[M.jsx(Nr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ws={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vd={input:w2,default:x2,output:E2,group:S2};function _2(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const k2=e=>{const{width:t,height:n,x:r,y:o}=bo(e.nodeLookup,{filter:i=>!!i.selected});return{width:ft(t)?t:null,height:ft(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function C2({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=he(),{width:o,height:i,transformString:s,userSelectionActive:l}=ne(k2,de),u=ym(),a=$.useRef(null);$.useEffect(()=>{var m;n||(m=a.current)==null||m.focus({preventScroll:!0})},[n]);const d=!l&&o!==null&&i!==null;if(mm({nodeRef:a,disabled:!d}),!d)return null;const c=e?m=>{const y=r.getState().nodes.filter(w=>w.selected);e(m,y)}:void 0,f=m=>{Object.prototype.hasOwnProperty.call(ws,m.key)&&(m.preventDefault(),u({direction:ws[m.key],factor:m.shiftKey?4:1}))};return M.jsx("div",{className:xe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:M.jsx("div",{ref:a,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:o,height:i}})})}const wd=typeof window<"u"?window:void 0,N2=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function wm({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:a,selectionOnDrag:d,selectionMode:c,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:y,panActivationKeyCode:w,zoomActivationKeyCode:x,elementsSelectable:h,zoomOnScroll:g,zoomOnPinch:p,panOnScroll:v,panOnScrollSpeed:E,panOnScrollMode:_,zoomOnDoubleClick:N,panOnDrag:P,defaultViewport:L,translateExtent:j,minZoom:z,maxZoom:R,preventScrolling:H,onSelectionContextMenu:C,noWheelClassName:A,noPanClassName:I,disableKeyboardA11y:D,onViewportChange:k,isControlledViewport:S}){const{nodesSelectionActive:T,userSelectionActive:O}=ne(N2,de),F=Ao(a,{target:wd}),W=Ao(w,{target:wd}),V=W||P,U=W||v,Y=d&&V!==!0,Q=F||O||Y;return s2({deleteKeyCode:u,multiSelectionKeyCode:y}),M.jsx(a2,{onPaneContextMenu:i,elementsSelectable:h,zoomOnScroll:g,zoomOnPinch:p,panOnScroll:U,panOnScrollSpeed:E,panOnScrollMode:_,zoomOnDoubleClick:N,panOnDrag:!F&&V,defaultViewport:L,translateExtent:j,minZoom:z,maxZoom:R,zoomActivationKeyCode:x,preventScrolling:H,noWheelClassName:A,noPanClassName:I,onViewportChange:k,isControlledViewport:S,paneClickDistance:l,selectionOnDrag:Y,children:M.jsxs(h2,{onSelectionStart:f,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:V,isSelecting:!!Q,selectionMode:c,selectionKeyPressed:F,paneClickDistance:l,selectionOnDrag:Y,children:[e,T&&M.jsx(C2,{onSelectionContextMenu:C,noPanClassName:I,disableKeyboardA11y:D})]})})}wm.displayName="FlowRenderer";const M2=$.memo(wm),P2=e=>t=>e?Za(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 T2(e){return ne($.useCallback(P2(e),[e]),de)}const I2=e=>e.updateNodeInternals;function z2(){const e=ne(I2),[t]=$.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return $.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function L2({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=he(),i=$.useRef(null),s=$.useRef(null),l=$.useRef(e.sourcePosition),u=$.useRef(e.targetPosition),a=$.useRef(t),d=n&&!!e.internals.handleBounds;return $.useEffect(()=>{i.current&&!e.hidden&&(!d||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[d,e.hidden]),$.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),$.useEffect(()=>{if(i.current){const c=a.current!==t,f=l.current!==e.sourcePosition,m=u.current!==e.targetPosition;(c||f||m)&&(a.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function A2({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:u,nodesConnectable:a,nodesFocusable:d,resizeObserver:c,noDragClassName:f,noPanClassName:m,disableKeyboardA11y:y,rfId:w,nodeTypes:x,nodeClickDistance:h,onError:g}){const{node:p,internals:v,isParent:E}=ne(B=>{const K=B.nodeLookup.get(e),ee=B.parentLookup.has(e);return{node:K,internals:K.internals,isParent:ee}},de);let _=p.type||"default",N=(x==null?void 0:x[_])||vd[_];N===void 0&&(g==null||g("003",kt.error003(_)),_="default",N=(x==null?void 0:x.default)||vd.default);const P=!!(p.draggable||l&&typeof p.draggable>"u"),L=!!(p.selectable||u&&typeof p.selectable>"u"),j=!!(p.connectable||a&&typeof p.connectable>"u"),z=!!(p.focusable||d&&typeof p.focusable>"u"),R=he(),H=Dg(p),C=L2({node:p,nodeType:_,hasDimensions:H,resizeObserver:c}),A=mm({nodeRef:C,disabled:p.hidden||!P,noDragClassName:f,handleSelector:p.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:h}),I=ym();if(p.hidden)return null;const D=Ht(p),k=_2(p),S=L||P||t||n||r||o,T=n?B=>n(B,{...v.userNode}):void 0,O=r?B=>r(B,{...v.userNode}):void 0,F=o?B=>o(B,{...v.userNode}):void 0,W=i?B=>i(B,{...v.userNode}):void 0,V=s?B=>s(B,{...v.userNode}):void 0,U=B=>{const{selectNodesOnDrag:K,nodeDragThreshold:ee}=R.getState();L&&(!K||!P||ee>0)&&Xu({id:e,store:R,nodeRef:C}),t&&t(B,{...v.userNode})},Y=B=>{if(!(jg(B.nativeEvent)||y)){if(Ng.includes(B.key)&&L){const K=B.key==="Escape";Xu({id:e,store:R,unselect:K,nodeRef:C})}else if(P&&p.selected&&Object.prototype.hasOwnProperty.call(ws,B.key)){B.preventDefault();const{ariaLabelConfig:K}=R.getState();R.setState({ariaLiveMessage:K["node.a11yDescription.ariaLiveMessage"]({direction:B.key.replace("Arrow","").toLowerCase(),x:~~v.positionAbsolute.x,y:~~v.positionAbsolute.y})}),I({direction:ws[B.key],factor:B.shiftKey?4:1})}}},Q=()=>{var ie;if(y||!((ie=C.current)!=null&&ie.matches(":focus-visible")))return;const{transform:B,width:K,height:ee,autoPanOnNodeFocus:J,setCenter:q}=R.getState();if(!J)return;Za(new Map([[e,p]]),{x:0,y:0,width:K,height:ee},B,!0).length>0||q(p.position.x+D.width/2,p.position.y+D.height/2,{zoom:B[2]})};return M.jsx("div",{className:xe(["react-flow__node",`react-flow__node-${_}`,{[m]:P},p.className,{selected:p.selected,selectable:L,parent:E,draggable:P,dragging:A}]),ref:C,style:{zIndex:v.z,transform:`translate(${v.positionAbsolute.x}px,${v.positionAbsolute.y}px)`,pointerEvents:S?"all":"none",visibility:H?"visible":"hidden",...p.style,...k},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:T,onMouseMove:O,onMouseLeave:F,onContextMenu:W,onClick:U,onDoubleClick:V,onKeyDown:z?Y:void 0,tabIndex:z?0:void 0,onFocus:z?Q:void 0,role:p.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${um}-${w}`,"aria-label":p.ariaLabel,...p.domAttributes,children:M.jsx(g2,{value:e,children:M.jsx(N,{id:e,data:p.data,type:_,positionAbsoluteX:v.positionAbsolute.x,positionAbsoluteY:v.positionAbsolute.y,selected:p.selected??!1,selectable:L,draggable:P,deletable:p.deletable??!0,isConnectable:j,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:A,dragHandle:p.dragHandle,zIndex:v.z,parentId:p.parentId,...D})})})}var R2=$.memo(A2);const $2=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function xm(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:i}=ne($2,de),s=T2(e.onlyRenderVisibleElements),l=z2();return M.jsx("div",{className:"react-flow__nodes",style:Zs,children:s.map(u=>M.jsx(R2,{id:u,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:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:i},u))})}xm.displayName="NodeRenderer";const D2=$.memo(xm);function F2(e){return ne($.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&SE({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),de)}const O2=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return M.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},j2=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return M.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},xd={[xr.Arrow]:O2,[xr.ArrowClosed]:j2};function H2(e){const t=he();return $.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(xd,e)?xd[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",kt.error009(e)),null)},[e])}const V2=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const u=H2(t);return u?M.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:M.jsx(u,{color:n,strokeWidth:s})}):null},Sm=({defaultColor:e,rfId:t})=>{const n=ne(i=>i.edges),r=ne(i=>i.defaultEdgeOptions),o=$.useMemo(()=>TE(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?M.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:M.jsx("defs",{children:o.map(i=>M.jsx(V2,{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};Sm.displayName="MarkerDefinitions";var b2=$.memo(Sm);function Em({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:u,className:a,...d}){const[c,f]=$.useState({x:1,y:0,width:0,height:0}),m=xe(["react-flow__edge-textwrapper",a]),y=$.useRef(null);return $.useEffect(()=>{if(y.current){const w=y.current.getBBox();f({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?M.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:m,visibility:c.width?"visible":"hidden",...d,children:[o&&M.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:l,ry:l}),M.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:y,style:r,children:n}),u]}):null}Em.displayName="EdgeText";const B2=$.memo(Em);function qs({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:a=20,...d}){return M.jsxs(M.Fragment,{children:[M.jsx("path",{...d,d:e,fill:"none",className:xe(["react-flow__edge-path",d.className])}),a?M.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:a,className:"react-flow__edge-interaction"}):null,r&&ft(t)&&ft(n)?M.jsx(B2,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function Sd({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===G.Left||e===G.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function _m({sourceX:e,sourceY:t,sourcePosition:n=G.Bottom,targetX:r,targetY:o,targetPosition:i=G.Top}){const[s,l]=Sd({pos:n,x1:e,y1:t,x2:r,y2:o}),[u,a]=Sd({pos:i,x1:r,y1:o,x2:e,y2:t}),[d,c,f,m]=Vg({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:a});return[`M${e},${t} C${s},${l} ${u},${a} ${r},${o}`,d,c,f,m]}function km(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:m,style:y,markerEnd:w,markerStart:x,interactionWidth:h})=>{const[g,p,v]=_m({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),E=e.isInternal?void 0:t;return M.jsx(qs,{id:E,path:g,labelX:p,labelY:v,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:m,style:y,markerEnd:w,markerStart:x,interactionWidth:h})})}const W2=km({isInternal:!1}),Cm=km({isInternal:!0});W2.displayName="SimpleBezierEdge";Cm.displayName="SimpleBezierEdgeInternal";function Nm(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,sourcePosition:m=G.Bottom,targetPosition:y=G.Top,markerEnd:w,markerStart:x,pathOptions:h,interactionWidth:g})=>{const[p,v,E]=Bu({sourceX:n,sourceY:r,sourcePosition:m,targetX:o,targetY:i,targetPosition:y,borderRadius:h==null?void 0:h.borderRadius,offset:h==null?void 0:h.offset,stepPosition:h==null?void 0:h.stepPosition}),_=e.isInternal?void 0:t;return M.jsx(qs,{id:_,path:p,labelX:v,labelY:E,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:w,markerStart:x,interactionWidth:g})})}const Mm=Nm({isInternal:!1}),Pm=Nm({isInternal:!0});Mm.displayName="SmoothStepEdge";Pm.displayName="SmoothStepEdgeInternal";function Tm(e){return $.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return M.jsx(Mm,{...n,id:r,pathOptions:$.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const U2=Tm({isInternal:!1}),Im=Tm({isInternal:!0});U2.displayName="StepEdge";Im.displayName="StepEdgeInternal";function zm(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:m,markerStart:y,interactionWidth:w})=>{const[x,h,g]=Wg({sourceX:n,sourceY:r,targetX:o,targetY:i}),p=e.isInternal?void 0:t;return M.jsx(qs,{id:p,path:x,labelX:h,labelY:g,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:d,labelBgBorderRadius:c,style:f,markerEnd:m,markerStart:y,interactionWidth:w})})}const Y2=zm({isInternal:!1}),Lm=zm({isInternal:!0});Y2.displayName="StraightEdge";Lm.displayName="StraightEdgeInternal";function Am(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=G.Bottom,targetPosition:l=G.Top,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:m,style:y,markerEnd:w,markerStart:x,pathOptions:h,interactionWidth:g})=>{const[p,v,E]=bg({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:h==null?void 0:h.curvature}),_=e.isInternal?void 0:t;return M.jsx(qs,{id:_,path:p,labelX:v,labelY:E,label:u,labelStyle:a,labelShowBg:d,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:m,style:y,markerEnd:w,markerStart:x,interactionWidth:g})})}const X2=Am({isInternal:!1}),Rm=Am({isInternal:!0});X2.displayName="BezierEdge";Rm.displayName="BezierEdgeInternal";const Ed={default:Rm,straight:Lm,step:Im,smoothstep:Pm,simplebezier:Cm},_d={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Q2=(e,t,n)=>n===G.Left?e-t:n===G.Right?e+t:e,G2=(e,t,n)=>n===G.Top?e-t:n===G.Bottom?e+t:e,kd="react-flow__edgeupdater";function Cd({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return M.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:xe([kd,`${kd}-${l}`]),cx:Q2(t,r,e),cy:G2(n,r,e),r,stroke:"transparent",fill:"transparent"})}function K2({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:u,onReconnect:a,onReconnectStart:d,onReconnectEnd:c,setReconnecting:f,setUpdateHover:m}){const y=he(),w=(v,E)=>{if(v.button!==0)return;const{autoPanOnConnect:_,domNode:N,connectionMode:P,connectionRadius:L,lib:j,onConnectStart:z,cancelConnection:R,nodeLookup:H,rfId:C,panBy:A,updateConnection:I}=y.getState(),D=E.type==="target",k=(O,F)=>{f(!1),c==null||c(O,n,E.type,F)},S=O=>a==null?void 0:a(n,O),T=(O,F)=>{f(!0),d==null||d(v,n,E.type),z==null||z(O,F)};Yu.onPointerDown(v.nativeEvent,{autoPanOnConnect:_,connectionMode:P,connectionRadius:L,domNode:N,handleId:E.id,nodeId:E.nodeId,nodeLookup:H,isTarget:D,edgeUpdaterType:E.type,lib:j,flowId:C,cancelConnection:R,panBy:A,isValidConnection:(...O)=>{var F,W;return((W=(F=y.getState()).isValidConnection)==null?void 0:W.call(F,...O))??!0},onConnect:S,onConnectStart:T,onConnectEnd:(...O)=>{var F,W;return(W=(F=y.getState()).onConnectEnd)==null?void 0:W.call(F,...O)},onReconnectEnd:k,updateConnection:I,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:v.currentTarget})},x=v=>w(v,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),h=v=>w(v,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),g=()=>m(!0),p=()=>m(!1);return M.jsxs(M.Fragment,{children:[(e===!0||e==="source")&&M.jsx(Cd,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:x,onMouseEnter:g,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&M.jsx(Cd,{position:u,centerX:i,centerY:s,radius:t,onMouseDown:h,onMouseEnter:g,onMouseOut:p,type:"target"})]})}function Z2({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:m,rfId:y,edgeTypes:w,noPanClassName:x,onError:h,disableKeyboardA11y:g}){let p=ne(q=>q.edgeLookup.get(e));const v=ne(q=>q.defaultEdgeOptions);p=v?{...v,...p}:p;let E=p.type||"default",_=(w==null?void 0:w[E])||Ed[E];_===void 0&&(h==null||h("011",kt.error011(E)),E="default",_=(w==null?void 0:w.default)||Ed.default);const N=!!(p.focusable||t&&typeof p.focusable>"u"),P=typeof c<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),L=!!(p.selectable||r&&typeof p.selectable>"u"),j=$.useRef(null),[z,R]=$.useState(!1),[H,C]=$.useState(!1),A=he(),{zIndex:I,sourceX:D,sourceY:k,targetX:S,targetY:T,sourcePosition:O,targetPosition:F}=ne($.useCallback(q=>{const Z=q.nodeLookup.get(p.source),ie=q.nodeLookup.get(p.target);if(!Z||!ie)return{zIndex:p.zIndex,..._d};const ue=PE({id:e,sourceNode:Z,targetNode:ie,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:q.connectionMode,onError:h});return{zIndex:xE({selected:p.selected,zIndex:p.zIndex,sourceNode:Z,targetNode:ie,elevateOnSelect:q.elevateEdgesOnSelect,zIndexMode:q.zIndexMode}),...ue||_d}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),de),W=$.useMemo(()=>p.markerStart?`url('#${Wu(p.markerStart,y)}')`:void 0,[p.markerStart,y]),V=$.useMemo(()=>p.markerEnd?`url('#${Wu(p.markerEnd,y)}')`:void 0,[p.markerEnd,y]);if(p.hidden||D===null||k===null||S===null||T===null)return null;const U=q=>{var oe;const{addSelectedEdges:Z,unselectNodesAndEdges:ie,multiSelectionActive:ue}=A.getState();L&&(A.setState({nodesSelectionActive:!1}),p.selected&&ue?(ie({nodes:[],edges:[p]}),(oe=j.current)==null||oe.blur()):Z([e])),o&&o(q,p)},Y=i?q=>{i(q,{...p})}:void 0,Q=s?q=>{s(q,{...p})}:void 0,B=l?q=>{l(q,{...p})}:void 0,K=u?q=>{u(q,{...p})}:void 0,ee=a?q=>{a(q,{...p})}:void 0,J=q=>{var Z;if(!g&&Ng.includes(q.key)&&L){const{unselectNodesAndEdges:ie,addSelectedEdges:ue}=A.getState();q.key==="Escape"?((Z=j.current)==null||Z.blur(),ie({edges:[p]})):ue([e])}};return M.jsx("svg",{style:{zIndex:I},children:M.jsxs("g",{className:xe(["react-flow__edge",`react-flow__edge-${E}`,p.className,x,{selected:p.selected,animated:p.animated,inactive:!L&&!o,updating:z,selectable:L}]),onClick:U,onDoubleClick:Y,onContextMenu:Q,onMouseEnter:B,onMouseMove:K,onMouseLeave:ee,onKeyDown:N?J:void 0,tabIndex:N?0:void 0,role:p.ariaRole??(N?"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":N?`${am}-${y}`:void 0,ref:j,...p.domAttributes,children:[!H&&M.jsx(_,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:L,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:D,sourceY:k,targetX:S,targetY:T,sourcePosition:O,targetPosition:F,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:W,markerEnd:V,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),P&&M.jsx(K2,{edge:p,isReconnectable:P,reconnectRadius:d,onReconnect:c,onReconnectStart:f,onReconnectEnd:m,sourceX:D,sourceY:k,targetX:S,targetY:T,sourcePosition:O,targetPosition:F,setUpdateHover:R,setReconnecting:C})]})})}var q2=$.memo(Z2);const J2=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function $m({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:a,onEdgeClick:d,reconnectRadius:c,onEdgeDoubleClick:f,onReconnectStart:m,onReconnectEnd:y,disableKeyboardA11y:w}){const{edgesFocusable:x,edgesReconnectable:h,elementsSelectable:g,onError:p}=ne(J2,de),v=F2(t);return M.jsxs("div",{className:"react-flow__edges",children:[M.jsx(b2,{defaultColor:e,rfId:n}),v.map(E=>M.jsx(q2,{id:E,edgesFocusable:x,edgesReconnectable:h,elementsSelectable:g,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,onClick:d,reconnectRadius:c,onDoubleClick:f,onReconnectStart:m,onReconnectEnd:y,rfId:n,onError:p,edgeTypes:r,disableKeyboardA11y:w},E))]})}$m.displayName="EdgeRenderer";const ek=$.memo($m),tk=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function nk({children:e}){const t=ne(tk);return M.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function rk(e){const t=Uo(),n=$.useRef(!1);$.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const ok=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function ik(e){const t=ne(ok),n=he();return $.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function sk(e){return e.connection.inProgress?{...e.connection,to:Wo(e.connection.to,e.transform)}:{...e.connection}}function lk(e){return sk}function uk(e){const t=lk();return ne(t,de)}const ak=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function ck({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:u}=ne(ak,de);return!(i&&o&&u)?null:M.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:M.jsx("g",{className:xe(["react-flow__connection",Tg(l)]),children:M.jsx(Dm,{style:t,type:n,CustomComponent:r,isValid:l})})})}const Dm=({style:e,type:t=Gt.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:u,to:a,toNode:d,toHandle:c,toPosition:f,pointer:m}=uk();if(!o)return;if(n)return M.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:i.x,fromY:i.y,toX:a.x,toY:a.y,fromPosition:u,toPosition:f,connectionStatus:Tg(r),toNode:d,toHandle:c,pointer:m});let y="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:u,targetX:a.x,targetY:a.y,targetPosition:f};switch(t){case Gt.Bezier:[y]=bg(w);break;case Gt.SimpleBezier:[y]=_m(w);break;case Gt.Step:[y]=Bu({...w,borderRadius:0});break;case Gt.SmoothStep:[y]=Bu(w);break;default:[y]=Wg(w)}return M.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};Dm.displayName="ConnectionLine";const fk={};function Nd(e=fk){$.useRef(e),he(),$.useEffect(()=>{},[e])}function dk(){he(),$.useRef(!1),$.useEffect(()=>{},[])}function Fm({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:d,onSelectionContextMenu:c,onSelectionStart:f,onSelectionEnd:m,connectionLineType:y,connectionLineStyle:w,connectionLineComponent:x,connectionLineContainerStyle:h,selectionKeyCode:g,selectionOnDrag:p,selectionMode:v,multiSelectionKeyCode:E,panActivationKeyCode:_,zoomActivationKeyCode:N,deleteKeyCode:P,onlyRenderVisibleElements:L,elementsSelectable:j,defaultViewport:z,translateExtent:R,minZoom:H,maxZoom:C,preventScrolling:A,defaultMarkerColor:I,zoomOnScroll:D,zoomOnPinch:k,panOnScroll:S,panOnScrollSpeed:T,panOnScrollMode:O,zoomOnDoubleClick:F,panOnDrag:W,onPaneClick:V,onPaneMouseEnter:U,onPaneMouseMove:Y,onPaneMouseLeave:Q,onPaneScroll:B,onPaneContextMenu:K,paneClickDistance:ee,nodeClickDistance:J,onEdgeContextMenu:q,onEdgeMouseEnter:Z,onEdgeMouseMove:ie,onEdgeMouseLeave:ue,reconnectRadius:oe,onReconnect:Pe,onReconnectStart:Vt,onReconnectEnd:Nt,noDragClassName:pn,noWheelClassName:Ir,noPanClassName:zr,disableKeyboardA11y:Lr,nodeExtent:el,rfId:Yo,viewport:Fn,onViewportChange:Ar}){return Nd(e),Nd(t),dk(),rk(n),ik(Fn),M.jsx(M2,{onPaneClick:V,onPaneMouseEnter:U,onPaneMouseMove:Y,onPaneMouseLeave:Q,onPaneContextMenu:K,onPaneScroll:B,paneClickDistance:ee,deleteKeyCode:P,selectionKeyCode:g,selectionOnDrag:p,selectionMode:v,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:E,panActivationKeyCode:_,zoomActivationKeyCode:N,elementsSelectable:j,zoomOnScroll:D,zoomOnPinch:k,zoomOnDoubleClick:F,panOnScroll:S,panOnScrollSpeed:T,panOnScrollMode:O,panOnDrag:W,defaultViewport:z,translateExtent:R,minZoom:H,maxZoom:C,onSelectionContextMenu:c,preventScrolling:A,noDragClassName:pn,noWheelClassName:Ir,noPanClassName:zr,disableKeyboardA11y:Lr,onViewportChange:Ar,isControlledViewport:!!Fn,children:M.jsxs(nk,{children:[M.jsx(ek,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:Pe,onReconnectStart:Vt,onReconnectEnd:Nt,onlyRenderVisibleElements:L,onEdgeContextMenu:q,onEdgeMouseEnter:Z,onEdgeMouseMove:ie,onEdgeMouseLeave:ue,reconnectRadius:oe,defaultMarkerColor:I,noPanClassName:zr,disableKeyboardA11y:Lr,rfId:Yo}),M.jsx(ck,{style:w,type:y,component:x,containerStyle:h}),M.jsx("div",{className:"react-flow__edgelabel-renderer"}),M.jsx(D2,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:d,nodeClickDistance:J,onlyRenderVisibleElements:L,noPanClassName:zr,noDragClassName:pn,disableKeyboardA11y:Lr,nodeExtent:el,rfId:Yo}),M.jsx("div",{className:"react-flow__viewport-portal"})]})})}Fm.displayName="GraphView";const hk=$.memo(Fm),Md=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:u=.5,maxZoom:a=2,nodeOrigin:d,nodeExtent:c,zIndexMode:f="basic"}={})=>{const m=new Map,y=new Map,w=new Map,x=new Map,h=r??t??[],g=n??e??[],p=d??[0,0],v=c??To;Xg(w,x,h);const E=Uu(g,m,y,{nodeOrigin:p,nodeExtent:v,zIndexMode:f});let _=[0,0,1];if(s&&o&&i){const N=bo(m,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:P,y:L,zoom:j}=Ys(N,o,i,u,a,(l==null?void 0:l.padding)??.1);_=[P,L,j]}return{rfId:"1",width:o??0,height:i??0,transform:_,nodes:g,nodesInitialized:E,nodeLookup:m,parentLookup:y,edges:h,edgeLookup:x,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:a,translateExtent:To,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:wr.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:l,fitViewResolver:null,connection:{...Pg},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:pE,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Mg,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},pk=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:u,maxZoom:a,nodeOrigin:d,nodeExtent:c,zIndexMode:f})=>L_((m,y)=>{async function w(){const{nodeLookup:x,panZoom:h,fitViewOptions:g,fitViewResolver:p,width:v,height:E,minZoom:_,maxZoom:N}=y();h&&(await dE({nodes:x,width:v,height:E,panZoom:h,minZoom:_,maxZoom:N},g),p==null||p.resolve(!0),m({fitViewResolver:null}))}return{...Md({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:u,maxZoom:a,nodeOrigin:d,nodeExtent:c,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:x=>{const{nodeLookup:h,parentLookup:g,nodeOrigin:p,elevateNodesOnSelect:v,fitViewQueued:E,zIndexMode:_}=y(),N=Uu(x,h,g,{nodeOrigin:p,nodeExtent:c,elevateNodesOnSelect:v,checkEquality:!0,zIndexMode:_});E&&N?(w(),m({nodes:x,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:x,nodesInitialized:N})},setEdges:x=>{const{connectionLookup:h,edgeLookup:g}=y();Xg(h,g,x),m({edges:x})},setDefaultNodesAndEdges:(x,h)=>{if(x){const{setNodes:g}=y();g(x),m({hasDefaultNodes:!0})}if(h){const{setEdges:g}=y();g(h),m({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:h,nodeLookup:g,parentLookup:p,domNode:v,nodeOrigin:E,nodeExtent:_,debug:N,fitViewQueued:P,zIndexMode:L}=y(),{changes:j,updatedInternals:z}=DE(x,g,p,v,E,_,L);z&&(LE(g,p,{nodeOrigin:E,nodeExtent:_,zIndexMode:L}),P?(w(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(j==null?void 0:j.length)>0&&(N&&console.log("React Flow: trigger node changes",j),h==null||h(j)))},updateNodePositions:(x,h=!1)=>{const g=[];let p=[];const{nodeLookup:v,triggerNodeChanges:E,connection:_,updateConnection:N,onNodesChangeMiddlewareMap:P}=y();for(const[L,j]of x){const z=v.get(L),R=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(j!=null&&j.position)),H={id:L,type:"position",position:R?{x:Math.max(0,j.position.x),y:Math.max(0,j.position.y)}:j.position,dragging:h};if(z&&_.inProgress&&_.fromNode.id===z.id){const C=Rn(z,_.fromHandle,G.Left,!0);N({..._,from:C})}R&&z.parentId&&g.push({id:L,parentId:z.parentId,rect:{...j.internals.positionAbsolute,width:j.measured.width??0,height:j.measured.height??0}}),p.push(H)}if(g.length>0){const{parentLookup:L,nodeOrigin:j}=y(),z=rc(g,v,L,j);p.push(...z)}for(const L of P.values())p=L(p);E(p)},triggerNodeChanges:x=>{const{onNodesChange:h,setNodes:g,nodes:p,hasDefaultNodes:v,debug:E}=y();if(x!=null&&x.length){if(v){const _=dm(x,p);g(_)}E&&console.log("React Flow: trigger node changes",x),h==null||h(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:h,setEdges:g,edges:p,hasDefaultEdges:v,debug:E}=y();if(x!=null&&x.length){if(v){const _=hm(x,p);g(_)}E&&console.log("React Flow: trigger edge changes",x),h==null||h(x)}},addSelectedNodes:x=>{const{multiSelectionActive:h,edgeLookup:g,nodeLookup:p,triggerNodeChanges:v,triggerEdgeChanges:E}=y();if(h){const _=x.map(N=>yn(N,!0));v(_);return}v(tr(p,new Set([...x]),!0)),E(tr(g))},addSelectedEdges:x=>{const{multiSelectionActive:h,edgeLookup:g,nodeLookup:p,triggerNodeChanges:v,triggerEdgeChanges:E}=y();if(h){const _=x.map(N=>yn(N,!0));E(_);return}E(tr(g,new Set([...x]))),v(tr(p,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:h}={})=>{const{edges:g,nodes:p,nodeLookup:v,triggerNodeChanges:E,triggerEdgeChanges:_}=y(),N=x||p,P=h||g,L=[];for(const z of N){if(!z.selected)continue;const R=v.get(z.id);R&&(R.selected=!1),L.push(yn(z.id,!1))}const j=[];for(const z of P)z.selected&&j.push(yn(z.id,!1));E(L),_(j)},setMinZoom:x=>{const{panZoom:h,maxZoom:g}=y();h==null||h.setScaleExtent([x,g]),m({minZoom:x})},setMaxZoom:x=>{const{panZoom:h,minZoom:g}=y();h==null||h.setScaleExtent([g,x]),m({maxZoom:x})},setTranslateExtent:x=>{var h;(h=y().panZoom)==null||h.setTranslateExtent(x),m({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:h,triggerNodeChanges:g,triggerEdgeChanges:p,elementsSelectable:v}=y();if(!v)return;const E=h.reduce((N,P)=>P.selected?[...N,yn(P.id,!1)]:N,[]),_=x.reduce((N,P)=>P.selected?[...N,yn(P.id,!1)]:N,[]);g(E),p(_)},setNodeExtent:x=>{const{nodes:h,nodeLookup:g,parentLookup:p,nodeOrigin:v,elevateNodesOnSelect:E,nodeExtent:_,zIndexMode:N}=y();x[0][0]===_[0][0]&&x[0][1]===_[0][1]&&x[1][0]===_[1][0]&&x[1][1]===_[1][1]||(Uu(h,g,p,{nodeOrigin:v,nodeExtent:x,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:N}),m({nodeExtent:x}))},panBy:x=>{const{transform:h,width:g,height:p,panZoom:v,translateExtent:E}=y();return FE({delta:x,panZoom:v,transform:h,translateExtent:E,width:g,height:p})},setCenter:async(x,h,g)=>{const{width:p,height:v,maxZoom:E,panZoom:_}=y();if(!_)return Promise.resolve(!1);const N=typeof(g==null?void 0:g.zoom)<"u"?g.zoom:E;return await _.setViewport({x:p/2-x*N,y:v/2-h*N,zoom:N},{duration:g==null?void 0:g.duration,ease:g==null?void 0:g.ease,interpolate:g==null?void 0:g.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{...Pg}})},updateConnection:x=>{m({connection:x})},reset:()=>m({...Md()})}},Object.is);function Om({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:u,fitView:a,nodeOrigin:d,nodeExtent:c,zIndexMode:f,children:m}){const[y]=$.useState(()=>pk({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:a,minZoom:s,maxZoom:l,fitViewOptions:u,nodeOrigin:d,nodeExtent:c,zIndexMode:f}));return M.jsx(A_,{value:y,children:M.jsx(n2,{children:m})})}function gk({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:u,minZoom:a,maxZoom:d,nodeOrigin:c,nodeExtent:f,zIndexMode:m}){return $.useContext(Gs)?M.jsx(M.Fragment,{children:e}):M.jsx(Om,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:u,initialMinZoom:a,initialMaxZoom:d,nodeOrigin:c,nodeExtent:f,zIndexMode:m,children:e})}const mk={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function yk({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:u,onInit:a,onMove:d,onMoveStart:c,onMoveEnd:f,onConnect:m,onConnectStart:y,onConnectEnd:w,onClickConnectStart:x,onClickConnectEnd:h,onNodeMouseEnter:g,onNodeMouseMove:p,onNodeMouseLeave:v,onNodeContextMenu:E,onNodeDoubleClick:_,onNodeDragStart:N,onNodeDrag:P,onNodeDragStop:L,onNodesDelete:j,onEdgesDelete:z,onDelete:R,onSelectionChange:H,onSelectionDragStart:C,onSelectionDrag:A,onSelectionDragStop:I,onSelectionContextMenu:D,onSelectionStart:k,onSelectionEnd:S,onBeforeDelete:T,connectionMode:O,connectionLineType:F=Gt.Bezier,connectionLineStyle:W,connectionLineComponent:V,connectionLineContainerStyle:U,deleteKeyCode:Y="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:B=!1,selectionMode:K=Io.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:J=Lo()?"Meta":"Control",zoomActivationKeyCode:q=Lo()?"Meta":"Control",snapToGrid:Z,snapGrid:ie,onlyRenderVisibleElements:ue=!1,selectNodesOnDrag:oe,nodesDraggable:Pe,autoPanOnNodeFocus:Vt,nodesConnectable:Nt,nodesFocusable:pn,nodeOrigin:Ir=cm,edgesFocusable:zr,edgesReconnectable:Lr,elementsSelectable:el=!0,defaultViewport:Yo=Y_,minZoom:Fn=.5,maxZoom:Ar=2,translateExtent:uc=To,preventScrolling:e0=!0,nodeExtent:tl,defaultMarkerColor:t0="#b1b1b7",zoomOnScroll:n0=!0,zoomOnPinch:r0=!0,panOnScroll:o0=!1,panOnScrollSpeed:i0=.5,panOnScrollMode:s0=Cn.Free,zoomOnDoubleClick:l0=!0,panOnDrag:u0=!0,onPaneClick:a0,onPaneMouseEnter:c0,onPaneMouseMove:f0,onPaneMouseLeave:d0,onPaneScroll:h0,onPaneContextMenu:p0,paneClickDistance:g0=1,nodeClickDistance:m0=0,children:y0,onReconnect:v0,onReconnectStart:w0,onReconnectEnd:x0,onEdgeContextMenu:S0,onEdgeDoubleClick:E0,onEdgeMouseEnter:_0,onEdgeMouseMove:k0,onEdgeMouseLeave:C0,reconnectRadius:N0=10,onNodesChange:M0,onEdgesChange:P0,noDragClassName:T0="nodrag",noWheelClassName:I0="nowheel",noPanClassName:ac="nopan",fitView:cc,fitViewOptions:fc,connectOnClick:z0,attributionPosition:L0,proOptions:A0,defaultEdgeOptions:R0,elevateNodesOnSelect:$0=!0,elevateEdgesOnSelect:D0=!1,disableKeyboardA11y:dc=!1,autoPanOnConnect:F0,autoPanOnNodeDrag:O0,autoPanSpeed:j0,connectionRadius:H0,isValidConnection:V0,onError:b0,style:B0,id:hc,nodeDragThreshold:W0,connectionDragThreshold:U0,viewport:Y0,onViewportChange:X0,width:Q0,height:G0,colorMode:K0="light",debug:Z0,onScroll:Xo,ariaLabelConfig:q0,zIndexMode:pc="basic",...J0},ey){const nl=hc||"1",ty=K_(K0),ny=$.useCallback(gc=>{gc.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Xo==null||Xo(gc)},[Xo]);return M.jsx("div",{"data-testid":"rf__wrapper",...J0,onScroll:ny,style:{...B0,...mk},ref:ey,className:xe(["react-flow",o,ty]),id:hc,role:"application",children:M.jsxs(gk,{nodes:e,edges:t,width:Q0,height:G0,fitView:cc,fitViewOptions:fc,minZoom:Fn,maxZoom:Ar,nodeOrigin:Ir,nodeExtent:tl,zIndexMode:pc,children:[M.jsx(hk,{onInit:a,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:g,onNodeMouseMove:p,onNodeMouseLeave:v,onNodeContextMenu:E,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:F,connectionLineStyle:W,connectionLineComponent:V,connectionLineContainerStyle:U,selectionKeyCode:Q,selectionOnDrag:B,selectionMode:K,deleteKeyCode:Y,multiSelectionKeyCode:J,panActivationKeyCode:ee,zoomActivationKeyCode:q,onlyRenderVisibleElements:ue,defaultViewport:Yo,translateExtent:uc,minZoom:Fn,maxZoom:Ar,preventScrolling:e0,zoomOnScroll:n0,zoomOnPinch:r0,zoomOnDoubleClick:l0,panOnScroll:o0,panOnScrollSpeed:i0,panOnScrollMode:s0,panOnDrag:u0,onPaneClick:a0,onPaneMouseEnter:c0,onPaneMouseMove:f0,onPaneMouseLeave:d0,onPaneScroll:h0,onPaneContextMenu:p0,paneClickDistance:g0,nodeClickDistance:m0,onSelectionContextMenu:D,onSelectionStart:k,onSelectionEnd:S,onReconnect:v0,onReconnectStart:w0,onReconnectEnd:x0,onEdgeContextMenu:S0,onEdgeDoubleClick:E0,onEdgeMouseEnter:_0,onEdgeMouseMove:k0,onEdgeMouseLeave:C0,reconnectRadius:N0,defaultMarkerColor:t0,noDragClassName:T0,noWheelClassName:I0,noPanClassName:ac,rfId:nl,disableKeyboardA11y:dc,nodeExtent:tl,viewport:Y0,onViewportChange:X0}),M.jsx(G_,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:y,onConnectEnd:w,onClickConnectStart:x,onClickConnectEnd:h,nodesDraggable:Pe,autoPanOnNodeFocus:Vt,nodesConnectable:Nt,nodesFocusable:pn,edgesFocusable:zr,edgesReconnectable:Lr,elementsSelectable:el,elevateNodesOnSelect:$0,elevateEdgesOnSelect:D0,minZoom:Fn,maxZoom:Ar,nodeExtent:tl,onNodesChange:M0,onEdgesChange:P0,snapToGrid:Z,snapGrid:ie,connectionMode:O,translateExtent:uc,connectOnClick:z0,defaultEdgeOptions:R0,fitView:cc,fitViewOptions:fc,onNodesDelete:j,onEdgesDelete:z,onDelete:R,onNodeDragStart:N,onNodeDrag:P,onNodeDragStop:L,onSelectionDrag:A,onSelectionDragStart:C,onSelectionDragStop:I,onMove:d,onMoveStart:c,onMoveEnd:f,noPanClassName:ac,nodeOrigin:Ir,rfId:nl,autoPanOnConnect:F0,autoPanOnNodeDrag:O0,autoPanSpeed:j0,onError:b0,connectionRadius:H0,isValidConnection:V0,selectNodesOnDrag:oe,nodeDragThreshold:W0,connectionDragThreshold:U0,onBeforeDelete:T,debug:Z0,ariaLabelConfig:q0,zIndexMode:pc}),M.jsx(U_,{onSelectionChange:H}),y0,M.jsx(H_,{proOptions:A0,position:L0}),M.jsx(j_,{rfId:nl,disableKeyboardA11y:dc})]})})}var vk=pm(yk);function wk(e){const[t,n]=$.useState(e),r=$.useCallback(o=>n(i=>dm(o,i)),[]);return[t,n,r]}function xk(e){const[t,n]=$.useState(e),r=$.useCallback(o=>n(i=>hm(o,i)),[]);return[t,n,r]}function Sk({dimensions:e,lineWidth:t,variant:n,className:r}){return M.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xe(["react-flow__background-pattern",n,r])})}function Ek({radius:e,className:t}){return M.jsx("circle",{cx:e,cy:e,r:e,className:xe(["react-flow__background-pattern","dots",t])})}var ln;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ln||(ln={}));const _k={[ln.Dots]:1,[ln.Lines]:1,[ln.Cross]:6},kk=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function jm({id:e,variant:t=ln.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:u,className:a,patternClassName:d}){const c=$.useRef(null),{transform:f,patternId:m}=ne(kk,de),y=r||_k[t],w=t===ln.Dots,x=t===ln.Cross,h=Array.isArray(n)?n:[n,n],g=[h[0]*f[2]||1,h[1]*f[2]||1],p=y*f[2],v=Array.isArray(i)?i:[i,i],E=x?[p,p]:g,_=[v[0]*f[2]||1+E[0]/2,v[1]*f[2]||1+E[1]/2],N=`${m}${e||""}`;return M.jsxs("svg",{className:xe(["react-flow__background",a]),style:{...u,...Zs,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[M.jsx("pattern",{id:N,x:f[0]%g[0],y:f[1]%g[1],width:g[0],height:g[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:w?M.jsx(Ek,{radius:p/2,className:d}):M.jsx(Sk,{dimensions:E,lineWidth:o,variant:t,className:d})}),M.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}jm.displayName="Background";const Ck=$.memo(jm);function Nk(){return M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:M.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Mk(){return M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:M.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Pk(){return M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:M.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 Tk(){return M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:M.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 Ik(){return M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:M.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 wi({children:e,className:t,...n}){return M.jsx("button",{type:"button",className:xe(["react-flow__controls-button",t]),...n,children:e})}const zk=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Hm({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:u,className:a,children:d,position:c="bottom-left",orientation:f="vertical","aria-label":m}){const y=he(),{isInteractive:w,minZoomReached:x,maxZoomReached:h,ariaLabelConfig:g}=ne(zk,de),{zoomIn:p,zoomOut:v,fitView:E}=Uo(),_=()=>{p(),i==null||i()},N=()=>{v(),s==null||s()},P=()=>{E(o),l==null||l()},L=()=>{y.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),u==null||u(!w)},j=f==="horizontal"?"horizontal":"vertical";return M.jsxs(Ks,{className:xe(["react-flow__controls",j,a]),position:c,style:e,"data-testid":"rf__controls","aria-label":m??g["controls.ariaLabel"],children:[t&&M.jsxs(M.Fragment,{children:[M.jsx(wi,{onClick:_,className:"react-flow__controls-zoomin",title:g["controls.zoomIn.ariaLabel"],"aria-label":g["controls.zoomIn.ariaLabel"],disabled:h,children:M.jsx(Nk,{})}),M.jsx(wi,{onClick:N,className:"react-flow__controls-zoomout",title:g["controls.zoomOut.ariaLabel"],"aria-label":g["controls.zoomOut.ariaLabel"],disabled:x,children:M.jsx(Mk,{})})]}),n&&M.jsx(wi,{className:"react-flow__controls-fitview",onClick:P,title:g["controls.fitView.ariaLabel"],"aria-label":g["controls.fitView.ariaLabel"],children:M.jsx(Pk,{})}),r&&M.jsx(wi,{className:"react-flow__controls-interactive",onClick:L,title:g["controls.interactive.ariaLabel"],"aria-label":g["controls.interactive.ariaLabel"],children:w?M.jsx(Ik,{}):M.jsx(Tk,{})}),d]})}Hm.displayName="Controls";const Lk=$.memo(Hm);function Ak({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:u,className:a,borderRadius:d,shapeRendering:c,selected:f,onClick:m}){const{background:y,backgroundColor:w}=i||{},x=s||y||w;return M.jsx("rect",{className:xe(["react-flow__minimap-node",{selected:f},a]),x:t,y:n,rx:d,ry:d,width:r,height:o,style:{fill:x,stroke:l,strokeWidth:u},shapeRendering:c,onClick:m?h=>m(h,e):void 0})}const Rk=$.memo(Ak),$k=e=>e.nodes.map(t=>t.id),Ol=e=>e instanceof Function?e:()=>e;function Dk({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=Rk,onClick:s}){const l=ne($k,de),u=Ol(t),a=Ol(e),d=Ol(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return M.jsx(M.Fragment,{children:l.map(f=>M.jsx(Ok,{id:f,nodeColorFunc:u,nodeStrokeColorFunc:a,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:c},f))})}function Fk({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:u}){const{node:a,x:d,y:c,width:f,height:m}=ne(y=>{const w=y.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const x=w.internals.userNode,{x:h,y:g}=w.internals.positionAbsolute,{width:p,height:v}=Ht(x);return{node:x,x:h,y:g,width:p,height:v}},de);return!a||a.hidden||!Dg(a)?null:M.jsx(l,{x:d,y:c,width:f,height:m,style:a.style,selected:!!a.selected,className:r(a),color:t(a),borderRadius:o,strokeColor:n(a),strokeWidth:i,shapeRendering:s,onClick:u,id:a.id})}const Ok=$.memo(Fk);var jk=$.memo(Dk);const Hk=200,Vk=150,bk=e=>!e.hidden,Bk=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]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?$g(bo(e.nodeLookup,{filter:bk}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Wk="react-flow__minimap-desc";function Vm({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:u,maskColor:a,maskStrokeColor:d,maskStrokeWidth:c,position:f="bottom-right",onClick:m,onNodeClick:y,pannable:w=!1,zoomable:x=!1,ariaLabel:h,inversePan:g,zoomStep:p=1,offsetScale:v=5}){const E=he(),_=$.useRef(null),{boundingRect:N,viewBB:P,rfId:L,panZoom:j,translateExtent:z,flowWidth:R,flowHeight:H,ariaLabelConfig:C}=ne(Bk,de),A=(e==null?void 0:e.width)??Hk,I=(e==null?void 0:e.height)??Vk,D=N.width/A,k=N.height/I,S=Math.max(D,k),T=S*A,O=S*I,F=v*S,W=N.x-(T-N.width)/2-F,V=N.y-(O-N.height)/2-F,U=T+F*2,Y=O+F*2,Q=`${Wk}-${L}`,B=$.useRef(0),K=$.useRef();B.current=S,$.useEffect(()=>{if(_.current&&j)return K.current=YE({domNode:_.current,panZoom:j,getTransform:()=>E.getState().transform,getViewScale:()=>B.current}),()=>{var Z;(Z=K.current)==null||Z.destroy()}},[j]),$.useEffect(()=>{var Z;(Z=K.current)==null||Z.update({translateExtent:z,width:R,height:H,inversePan:g,pannable:w,zoomStep:p,zoomable:x})},[w,x,g,p,z,R,H]);const ee=m?Z=>{var oe;const[ie,ue]=((oe=K.current)==null?void 0:oe.pointer(Z))||[0,0];m(Z,{x:ie,y:ue})}:void 0,J=y?$.useCallback((Z,ie)=>{const ue=E.getState().nodeLookup.get(ie).internals.userNode;y(Z,ue)},[]):void 0,q=h??C["minimap.ariaLabel"];return M.jsx(Ks,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*S:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r: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:xe(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:M.jsxs("svg",{width:A,height:I,viewBox:`${W} ${V} ${U} ${Y}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Q,ref:_,onClick:ee,children:[q&&M.jsx("title",{id:Q,children:q}),M.jsx(jk,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),M.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-F},${V-F}h${U+F*2}v${Y+F*2}h${-U-F*2}z M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Vm.displayName="MiniMap";const Uk=$.memo(Vm),Yk=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Xk={[kr.Line]:"right",[kr.Handle]:"bottom-right"};function Qk({nodeId:e,position:t,variant:n=kr.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:u=10,maxWidth:a=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:f,autoScale:m=!0,shouldResize:y,onResizeStart:w,onResize:x,onResizeEnd:h}){const g=vm(),p=typeof e=="string"?e:g,v=he(),E=$.useRef(null),_=n===kr.Handle,N=ne($.useCallback(Yk(_&&m),[_,m]),de),P=$.useRef(null),L=t??Xk[n];$.useEffect(()=>{if(!(!E.current||!p))return P.current||(P.current=s_({domNode:E.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:z,transform:R,snapGrid:H,snapToGrid:C,nodeOrigin:A,domNode:I}=v.getState();return{nodeLookup:z,transform:R,snapGrid:H,snapToGrid:C,nodeOrigin:A,paneDomNode:I}},onChange:(z,R)=>{const{triggerNodeChanges:H,nodeLookup:C,parentLookup:A,nodeOrigin:I}=v.getState(),D=[],k={x:z.x,y:z.y},S=C.get(p);if(S&&S.expandParent&&S.parentId){const T=S.origin??I,O=z.width??S.measured.width??0,F=z.height??S.measured.height??0,W={id:S.id,parentId:S.parentId,rect:{width:O,height:F,...Fg({x:z.x??S.position.x,y:z.y??S.position.y},{width:O,height:F},S.parentId,C,T)}},V=rc([W],C,A,I);D.push(...V),k.x=z.x?Math.max(T[0]*O,z.x):void 0,k.y=z.y?Math.max(T[1]*F,z.y):void 0}if(k.x!==void 0&&k.y!==void 0){const T={id:p,type:"position",position:{...k}};D.push(T)}if(z.width!==void 0&&z.height!==void 0){const O={id:p,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};D.push(O)}for(const T of R){const O={...T,type:"position"};D.push(O)}H(D)},onEnd:({width:z,height:R})=>{const H={id:p,type:"dimensions",resizing:!1,dimensions:{width:z,height:R}};v.getState().triggerNodeChanges([H])}})),P.current.update({controlPosition:L,boundaries:{minWidth:l,minHeight:u,maxWidth:a,maxHeight:d},keepAspectRatio:c,resizeDirection:f,onResizeStart:w,onResize:x,onResizeEnd:h,shouldResize:y}),()=>{var z;(z=P.current)==null||z.destroy()}},[L,l,u,a,d,c,w,x,h,y]);const j=L.split("-");return M.jsx("div",{className:xe(["react-flow__resize-control","nodrag",...j,n,r]),ref:E,style:{...o,scale:N,...s&&{[_?"backgroundColor":"borderColor"]:s}},children:i})}$.memo(Qk);function Gk(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const n=document.implementation.createHTMLDocument(),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),t&&(r.href=t),o.href=e,o.href}const Kk=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function un(e){const t=[];for(let n=0,r=e.length;nWe||e.height>We)&&(e.width>We&&e.height>We?e.width>e.height?(e.height*=We/e.width,e.width=We):(e.width*=We/e.height,e.height=We):e.width>We?(e.height*=We/e.width,e.width=We):(e.width*=We/e.height,e.height=We))}function Ss(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{r.decode().then(()=>{requestAnimationFrame(()=>t(r))})},r.onerror=n,r.crossOrigin="anonymous",r.decoding="async",r.src=e})}async function tC(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function nC(e,t,n){const r="http://www.w3.org/2000/svg",o=document.createElementNS(r,"svg"),i=document.createElementNS(r,"foreignObject");return o.setAttribute("width",`${t}`),o.setAttribute("height",`${n}`),o.setAttribute("viewBox",`0 0 ${t} ${n}`),i.setAttribute("width","100%"),i.setAttribute("height","100%"),i.setAttribute("x","0"),i.setAttribute("y","0"),i.setAttribute("externalResourcesRequired","true"),o.appendChild(i),i.appendChild(e),tC(o)}const Be=(e,t)=>{if(e instanceof t)return!0;const n=Object.getPrototypeOf(e);return n===null?!1:n.constructor.name===t.name||Be(n,t)};function rC(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function oC(e,t){return bm(t).map(n=>{const r=e.getPropertyValue(n),o=e.getPropertyPriority(n);return`${n}: ${r}${o?" !important":""};`}).join(" ")}function iC(e,t,n,r){const o=`.${e}:${t}`,i=n.cssText?rC(n):oC(n,r);return document.createTextNode(`${o}{${i}}`)}function Pd(e,t,n,r){const o=window.getComputedStyle(e,n),i=o.getPropertyValue("content");if(i===""||i==="none")return;const s=Kk();try{t.className=`${t.className} ${s}`}catch{return}const l=document.createElement("style");l.appendChild(iC(s,n,o,r)),t.appendChild(l)}function sC(e,t,n){Pd(e,t,":before",n),Pd(e,t,":after",n)}const Td="application/font-woff",Id="image/jpeg",lC={woff:Td,woff2:Td,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Id,jpeg:Id,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function uC(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function ic(e){const t=uC(e).toLowerCase();return lC[t]||""}function aC(e){return e.split(/,/)[1]}function Qu(e){return e.search(/^(data:)/)!==-1}function cC(e,t){return`data:${t};base64,${e}`}async function Wm(e,t,n){const r=await fetch(e,t);if(r.status===404)throw new Error(`Resource "${r.url}" not found`);const o=await r.blob();return new Promise((i,s)=>{const l=new FileReader;l.onerror=s,l.onloadend=()=>{try{i(n({res:r,result:l.result}))}catch(u){s(u)}},l.readAsDataURL(o)})}const jl={};function fC(e,t,n){let r=e.replace(/\?.*/,"");return n&&(r=e),/ttf|otf|eot|woff2?/i.test(r)&&(r=r.replace(/.*\//,"")),t?`[${t}]${r}`:r}async function sc(e,t,n){const r=fC(e,t,n.includeQueryParams);if(jl[r]!=null)return jl[r];n.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let o;try{const i=await Wm(e,n.fetchRequestInit,({res:s,result:l})=>(t||(t=s.headers.get("Content-Type")||""),aC(l)));o=cC(i,t)}catch(i){o=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${e}`;i&&(s=typeof i=="string"?i:i.message),s&&console.warn(s)}return jl[r]=o,o}async function dC(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):Ss(t)}async function hC(e,t){if(e.currentSrc){const i=document.createElement("canvas"),s=i.getContext("2d");i.width=e.clientWidth,i.height=e.clientHeight,s==null||s.drawImage(e,0,0,i.width,i.height);const l=i.toDataURL();return Ss(l)}const n=e.poster,r=ic(n),o=await sc(n,r,t);return Ss(o)}async function pC(e,t){var n;try{if(!((n=e==null?void 0:e.contentDocument)===null||n===void 0)&&n.body)return await Js(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function gC(e,t){return Be(e,HTMLCanvasElement)?dC(e):Be(e,HTMLVideoElement)?hC(e,t):Be(e,HTMLIFrameElement)?pC(e,t):e.cloneNode(Um(e))}const mC=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Um=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function yC(e,t,n){var r,o;if(Um(t))return t;let i=[];return mC(e)&&e.assignedNodes?i=un(e.assignedNodes()):Be(e,HTMLIFrameElement)&&(!((r=e.contentDocument)===null||r===void 0)&&r.body)?i=un(e.contentDocument.body.childNodes):i=un(((o=e.shadowRoot)!==null&&o!==void 0?o:e).childNodes),i.length===0||Be(e,HTMLVideoElement)||await i.reduce((s,l)=>s.then(()=>Js(l,n)).then(u=>{u&&t.appendChild(u)}),Promise.resolve()),t}function vC(e,t,n){const r=t.style;if(!r)return;const o=window.getComputedStyle(e);o.cssText?(r.cssText=o.cssText,r.transformOrigin=o.transformOrigin):bm(n).forEach(i=>{let s=o.getPropertyValue(i);i==="font-size"&&s.endsWith("px")&&(s=`${Math.floor(parseFloat(s.substring(0,s.length-2)))-.1}px`),Be(e,HTMLIFrameElement)&&i==="display"&&s==="inline"&&(s="block"),i==="d"&&t.getAttribute("d")&&(s=`path(${t.getAttribute("d")})`),r.setProperty(i,s,o.getPropertyPriority(i))})}function wC(e,t){Be(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),Be(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function xC(e,t){if(Be(e,HTMLSelectElement)){const n=t,r=Array.from(n.children).find(o=>e.value===o.getAttribute("value"));r&&r.setAttribute("selected","")}}function SC(e,t,n){return Be(t,Element)&&(vC(e,t,n),sC(e,t,n),wC(e,t),xC(e,t)),t}async function EC(e,t){const n=e.querySelectorAll?e.querySelectorAll("use"):[];if(n.length===0)return e;const r={};for(let i=0;igC(r,t)).then(r=>yC(e,r,t)).then(r=>SC(e,r,t)).then(r=>EC(r,t))}const Ym=/url\((['"]?)([^'"]+?)\1\)/g,_C=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,kC=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function CC(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function NC(e){const t=[];return e.replace(Ym,(n,r,o)=>(t.push(o),n)),t.filter(n=>!Qu(n))}async function MC(e,t,n,r,o){try{const i=n?Gk(t,n):t,s=ic(t);let l;return o||(l=await sc(i,s,r)),e.replace(CC(t),`$1${l}$3`)}catch{}return e}function PC(e,{preferredFontFormat:t}){return t?e.replace(kC,n=>{for(;;){const[r,,o]=_C.exec(n)||[];if(!o)return"";if(o===t)return`src: ${r};`}}):e}function Xm(e){return e.search(Ym)!==-1}async function Qm(e,t,n){if(!Xm(e))return e;const r=PC(e,n);return NC(r).reduce((i,s)=>i.then(l=>MC(l,s,t,n)),Promise.resolve(r))}async function Vn(e,t,n){var r;const o=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue(e);if(o){const i=await Qm(o,null,n);return t.style.setProperty(e,i,t.style.getPropertyPriority(e)),!0}return!1}async function TC(e,t){await Vn("background",e,t)||await Vn("background-image",e,t),await Vn("mask",e,t)||await Vn("-webkit-mask",e,t)||await Vn("mask-image",e,t)||await Vn("-webkit-mask-image",e,t)}async function IC(e,t){const n=Be(e,HTMLImageElement);if(!(n&&!Qu(e.src))&&!(Be(e,SVGImageElement)&&!Qu(e.href.baseVal)))return;const r=n?e.src:e.href.baseVal,o=await sc(r,ic(r),t);await new Promise((i,s)=>{e.onload=i,e.onerror=t.onImageErrorHandler?(...u)=>{try{i(t.onImageErrorHandler(...u))}catch(a){s(a)}}:s;const l=e;l.decode&&(l.decode=i),l.loading==="lazy"&&(l.loading="eager"),n?(e.srcset="",e.src=o):e.href.baseVal=o})}async function zC(e,t){const r=un(e.childNodes).map(o=>Gm(o,t));await Promise.all(r).then(()=>e)}async function Gm(e,t){Be(e,Element)&&(await TC(e,t),await IC(e,t),await zC(e,t))}function LC(e,t){const{style:n}=e;t.backgroundColor&&(n.backgroundColor=t.backgroundColor),t.width&&(n.width=`${t.width}px`),t.height&&(n.height=`${t.height}px`);const r=t.style;return r!=null&&Object.keys(r).forEach(o=>{n[o]=r[o]}),e}const zd={};async function Ld(e){let t=zd[e];if(t!=null)return t;const r=await(await fetch(e)).text();return t={url:e,cssText:r},zd[e]=t,t}async function Ad(e,t){let n=e.cssText;const r=/url\(["']?([^"')]+)["']?\)/g,i=(n.match(/url\([^)]+\)/g)||[]).map(async s=>{let l=s.replace(r,"$1");return l.startsWith("https://")||(l=new URL(l,e.url).href),Wm(l,t.fetchRequestInit,({result:u})=>(n=n.replace(s,`url(${u})`),[s,u]))});return Promise.all(i).then(()=>n)}function Rd(e){if(e==null)return[];const t=[],n=/(\/\*[\s\S]*?\*\/)/gi;let r=e.replace(n,"");const o=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const u=o.exec(r);if(u===null)break;t.push(u[0])}r=r.replace(o,"");const i=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",l=new RegExp(s,"gi");for(;;){let u=i.exec(r);if(u===null){if(u=l.exec(r),u===null)break;i.lastIndex=l.lastIndex}else l.lastIndex=i.lastIndex;t.push(u[0])}return t}async function AC(e,t){const n=[],r=[];return e.forEach(o=>{if("cssRules"in o)try{un(o.cssRules||[]).forEach((i,s)=>{if(i.type===CSSRule.IMPORT_RULE){let l=s+1;const u=i.href,a=Ld(u).then(d=>Ad(d,t)).then(d=>Rd(d).forEach(c=>{try{o.insertRule(c,c.startsWith("@import")?l+=1:o.cssRules.length)}catch(f){console.error("Error inserting rule from remote css",{rule:c,error:f})}})).catch(d=>{console.error("Error loading remote css",d.toString())});r.push(a)}})}catch(i){const s=e.find(l=>l.href==null)||document.styleSheets[0];o.href!=null&&r.push(Ld(o.href).then(l=>Ad(l,t)).then(l=>Rd(l).forEach(u=>{s.insertRule(u,s.cssRules.length)})).catch(l=>{console.error("Error loading remote stylesheet",l)})),console.error("Error inlining remote css file",i)}}),Promise.all(r).then(()=>(e.forEach(o=>{if("cssRules"in o)try{un(o.cssRules||[]).forEach(i=>{n.push(i)})}catch(i){console.error(`Error while reading CSS rules from ${o.href}`,i)}}),n))}function RC(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Xm(t.style.getPropertyValue("src")))}async function $C(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=un(e.ownerDocument.styleSheets),r=await AC(n,t);return RC(r)}function Km(e){return e.trim().replace(/["']/g,"")}function DC(e){const t=new Set;function n(r){(r.style.fontFamily||getComputedStyle(r).fontFamily).split(",").forEach(i=>{t.add(Km(i))}),Array.from(r.children).forEach(i=>{i instanceof HTMLElement&&n(i)})}return n(e),t}async function FC(e,t){const n=await $C(e,t),r=DC(e);return(await Promise.all(n.filter(i=>r.has(Km(i.style.fontFamily))).map(i=>{const s=i.parentStyleSheet?i.parentStyleSheet.href:null;return Qm(i.cssText,s,t)}))).join(` `)}async function OC(e,t){const n=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await FC(e,t);if(n){const r=document.createElement("style"),o=document.createTextNode(n);r.appendChild(o),e.firstChild?e.insertBefore(r,e.firstChild):e.appendChild(r)}}async function jC(e,t={}){const{width:n,height:r}=Bm(e,t),o=await Js(e,t,!0);return await OC(o,t),await Gm(o,t),LC(o,t),await nC(o,n,r)}async function HC(e,t={}){const{width:n,height:r}=Bm(e,t),o=await jC(e,t),i=await Ss(o),s=document.createElement("canvas"),l=s.getContext("2d"),u=t.pixelRatio||Jk(),a=t.canvasWidth||n,d=t.canvasHeight||r;return s.width=a*u,s.height=d*u,t.skipAutoScale||eC(s),s.style.width=`${a}`,s.style.height=`${d}`,t.backgroundColor&&(l.fillStyle=t.backgroundColor,l.fillRect(0,0,s.width,s.height)),l.drawImage(i,0,0,s.width,s.height),s}async function VC(e,t={}){return(await HC(e,t)).toDataURL()}function bC(e,t){const n=Object.fromEntries(e.map(h=>[h.id,h])),r=h=>e.filter(g=>g.type===h),o=r("route");r("handler");const i=new Map;o.forEach(h=>{var g,p;i.set(h.id,{method:((g=h.data)==null?void 0:g.method)||"GET",path:((p=h.data)==null?void 0:p.path)||"/",middleware:[]})});const s=t.filter(h=>h.edgeType==="wraps"),l=new Map;s.forEach(h=>l.set(h.target,h.source)),o.forEach(h=>{var v;const g=[];let p=l.get(h.id);for(;p&&((v=n[p])==null?void 0:v.type)==="middleware";)g.unshift(n[p].data.name),p=l.get(p);g.length&&(i.get(h.id).middleware=g)});const u=new Map;t.filter(h=>h.edgeType==="extends").forEach(h=>{var v,E;const g=n[h.source],p=n[h.target];(v=g==null?void 0:g.data)!=null&&v.name&&((E=p==null?void 0:p.data)!=null&&E.name)&&u.set(g.data.name,p.data.name)});const d=t.filter(h=>h.edgeType==="handles"),c=new Map;d.forEach(h=>{var p;const g=n[h.target];if((p=g==null?void 0:g.data)!=null&&p.name){const v=[];let E=g.data.name;for(;E;)v.push(E),E=u.get(E);c.set(h.source,v)}}),o.forEach(h=>{c.has(h.id)||c.set(h.id,[])});const f=new Set;c.forEach(h=>h.forEach(g=>f.add(g)));const m=new Map;[...f].forEach(h=>{const g="class:"+h;m.set(g,{id:g,name:h,isAbstract:!0,routes:[],parentId:null,isLambda:!1})}),u.forEach((h,g)=>{const p="class:"+g,v="class:"+h;m.has(p)&&m.has(v)&&(m.get(p).parentId=v)}),c.forEach((h,g)=>{if(h.length===0){const p=i.get(g),v="class:Lambda:"+p.method+":"+encodeURIComponent(p.path);m.set(v,{id:v,name:"Lambda Handler",isAbstract:!1,isLambda:!0,method:p.method,path:p.path,routes:[{method:p.method,path:p.path,middleware:p.middleware}],parentId:null})}else{const v="class:"+h[0];if(m.has(v)){const E=m.get(v);E.isAbstract=!1;const _=i.get(g);E.routes.push({method:_.method,path:_.path,middleware:_.middleware})}}});const y=[...m.values()].map(h=>({id:h.id,type:"handler",data:{name:h.name,isAbstract:h.isAbstract,isLambda:h.isLambda,method:h.method,path:h.path,routes:h.routes,middleware:h.routes.length>0?[...new Set(h.routes.flatMap(g=>g.middleware))]:[]}})),w=new Set,x=[];return m.forEach((h,g)=>{if(h.parentId){const p=h.parentId+"->"+g;w.has(p)||(w.add(p),x.push({id:p,source:h.parentId,target:g,edgeType:"extends"}))}}),{nodes:y,edges:x}}const BC=60,Zm=12,WC=48,xi=60,$d=60,UC=160,YC=50,XC=260,QC=230,GC=80;function qm(e){var t;return(t=e.data)!=null&&t.isAbstract?UC:XC}function lc(e){var r,o,i,s,l;if((r=e.data)!=null&&r.isAbstract)return YC;const t=((i=(o=e.data)==null?void 0:o.routes)==null?void 0:i.length)||1,n=(((l=(s=e.data)==null?void 0:s.middleware)==null?void 0:l.length)||0)>0;return 53+t*22+(n?22:0)+20}function Es(e,t,n){const r=t.get(e)||[],o=lc(n[e]);if(!r.length)return o;const i=r.reduce((s,l,u)=>s+Es(l,t,n)+(u>0?Zm:0),0);return Math.max(o,i)}function Jm(e,t,n,r,o,i){const s=o[e],l=r.get(e)||[],u=lc(s),a=qm(s),d=Es(e,r,o);if(i.set(e,{x:t,y:n+(d-u)/2}),l.length){const c=t+a+BC;let f=n;l.forEach(m=>{const y=Es(m,r,o);Jm(m,c,f,r,o,i),f+=y+Zm})}}function KC(e,t){const n=e.filter(w=>{var x;return(x=w.data)==null?void 0:x.isLambda}),r=e.filter(w=>{var x;return!((x=w.data)!=null&&x.isLambda)}),o=Object.fromEntries(r.map(w=>[w.id,w])),i=new Map,s=new Set;t.forEach(w=>{w.edgeType==="extends"&&(i.has(w.source)||i.set(w.source,[]),i.get(w.source).push(w.target),s.add(w.target))});const l=r.filter(w=>!s.has(w.id)),u=new Map;let a=$d;l.forEach(w=>{const x=Es(w.id,i,o);Jm(w.id,xi,a,i,o,u),a+=x+WC});let d=-1/0,c=-1/0,f=1/0;const m=r.map(w=>{const x=u.get(w.id)||{x:xi,y:$d},h=x.x+qm(w),g=x.y+lc(w);return h>d&&(d=h),g>c&&(c=g),x.y{m.push({..._,position:{x:v+N%x*h,y:E+Math.floor(N/x)*g}})})}const y=t.filter(w=>w.edgeType==="extends").map((w,x)=>({...w,id:w.id||`ext-${x}`,type:"bezier",pathOptions:{curvature:.35},style:{stroke:"#2e3347",strokeWidth:1.5},markerEnd:{type:"arrowclosed",width:11,height:11,color:"#2e3347"},animated:!1}));return{nodes:m,edges:y}}const Si={GET:{bg:"#0d4429",color:"#4ade80"},POST:{bg:"#172554",color:"#60a5fa"},PUT:{bg:"#451a03",color:"#fb923c"},PATCH:{bg:"#2e1065",color:"#c084fc"},DELETE:{bg:"#450a0a",color:"#f87171"},OPTIONS:{bg:"#1c1917",color:"#a8a29e"},HEAD:{bg:"#1c1917",color:"#a8a29e"}},Hl=M.jsx(Nr,{type:"target",position:G.Left,style:{left:0,top:"50%",transform:"translateY(-50%)"}}),Vl=M.jsx(Nr,{type:"source",position:G.Right,style:{right:0,top:"50%",transform:"translateY(-50%)"}});function ZC({data:e,selected:t}){var n,r,o,i;if(e.isAbstract)return M.jsxs("div",{style:{background:"rgba(239,68,68,0.05)",border:t?"2px solid #60a5fa":"1px solid #ef4444",borderRadius:8,padding:"8px 14px",width:160,fontFamily:"system-ui, sans-serif",boxSizing:"border-box"},children:[Hl,Vl,M.jsx("div",{style:{fontSize:9,color:"#ef4444",fontWeight:700,letterSpacing:.5,marginBottom:3},children:"ABSTRACT"}),M.jsx("div",{style:{fontSize:12,fontWeight:600,color:"#e2e8f0",fontFamily:"monospace"},children:e.name})]});if(e.isLambda){const s=e.method||"GET",l=e.path||"/",u=Si[s]||Si.OPTIONS,a=l.replace(/\{([^}]+)\}/g,'{$1}');return M.jsxs("div",{style:{background:"#1a1d27",border:t?"2px solid #60a5fa":"1px solid #3b82f6",borderRadius:8,padding:"10px 12px",width:230,fontFamily:"system-ui, sans-serif",boxSizing:"border-box"},children:[Hl,Vl,M.jsx("div",{style:{fontSize:9,color:"#60a5fa",fontWeight:700,letterSpacing:.5,marginBottom:7},children:"LAMBDA"}),M.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[M.jsx("span",{style:{background:u.bg,color:u.color,fontSize:9,fontWeight:700,padding:"2px 5px",borderRadius:3,fontFamily:"monospace",flexShrink:0},children:s}),M.jsx("span",{style:{fontSize:10,fontFamily:"monospace",color:"#8892a4"},dangerouslySetInnerHTML:{__html:a}})]}),((n=e.middleware)==null?void 0:n.length)>0&&M.jsx("div",{style:{display:"flex",gap:3,flexWrap:"wrap",marginTop:7},children:e.middleware.map(d=>M.jsx("span",{style:{background:"#1f1a0e",color:"#f6ad55",fontSize:8,fontWeight:600,padding:"1px 4px",borderRadius:2,fontFamily:"monospace"},children:d},d))})]})}return M.jsxs("div",{style:{background:"#1a1d27",border:t?"2px solid #60a5fa":"1px solid #3b82f6",borderRadius:8,padding:"10px 12px",width:260,fontFamily:"system-ui, sans-serif",boxSizing:"border-box"},children:[Hl,Vl,M.jsxs("div",{style:{marginBottom:8},children:[M.jsx("div",{style:{fontSize:9,color:"#60a5fa",fontWeight:700,letterSpacing:.5,marginBottom:2},children:"HANDLER"}),M.jsx("div",{style:{fontSize:12,fontWeight:700,color:"#e2e8f0",fontFamily:"monospace"},children:e.name})]}),M.jsx("div",{style:{height:1,background:"#2e3347",marginBottom:8}}),M.jsx("div",{style:{marginBottom:((r=e.middleware)==null?void 0:r.length)>0?8:0},children:(o=e.routes)==null?void 0:o.map((s,l)=>{const u=Si[s.method]||Si.OPTIONS,a=(s.path||"/").replace(/\{([^}]+)\}/g,'{$1}');return M.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:l0&&M.jsx("div",{style:{display:"flex",gap:3,flexWrap:"wrap"},children:e.middleware.map(s=>M.jsx("span",{style:{background:"#1f1a0e",color:"#f6ad55",fontSize:8,fontWeight:600,padding:"1px 4px",borderRadius:2,fontFamily:"monospace"},children:s},s))})]})}const qC={handler:ZC};function JC(e){const{getNodes:t}=Uo();$.useEffect(()=>{e.current=()=>{const n=t();if(!n.length)return;const r=zg(n),o=60,i=Math.max(1920,r.width+o*2),s=Math.max(1080,r.height+o*2),l=Ys(r,i,s,.1,4,o);VC(document.querySelector(".react-flow__viewport"),{backgroundColor:"#0f1117",width:i,height:s,style:{width:i+"px",height:s+"px",transform:`translate(${l.x}px,${l.y}px) scale(${l.zoom})`}}).then(u=>{const a=document.createElement("a");a.download="flash-routes.png",a.href=u,a.click()}).catch(console.error)}},[t,e])}function eN({styledNodes:e,styledEdges:t,onNodesChange:n,onEdgesChange:r,onNodeMouseEnter:o,onNodeMouseLeave:i,showLambdas:s,searchQuery:l,exportRef:u}){const{fitView:a}=Uo();return JC(u),$.useEffect(()=>{setTimeout(()=>a({padding:.15,duration:300}),50)},[s,l,a]),M.jsxs(vk,{nodes:e,edges:t,onNodesChange:n,onEdgesChange:r,onNodeMouseEnter:o,onNodeMouseLeave:i,nodeTypes:qC,fitView:!0,fitViewOptions:{padding:.15},colorMode:"dark",minZoom:.03,maxZoom:2,panOnDrag:!0,panOnScroll:!0,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,zoomOnDoubleClick:!0,children:[M.jsx(Ck,{color:"#161822",gap:32,size:1}),M.jsx(Lk,{showInteractive:!1,style:{background:"#12141c",border:"1px solid #1e2235"}}),M.jsx(Uk,{style:{background:"#12141c",border:"1px solid #1e2235"},maskColor:"rgba(0,0,0,0.5)",nodeColor:d=>{var c;return(c=d.data)!=null&&c.isAbstract?"#ef444499":"#3b82f666"}})]})}function tN(){const[e,t]=$.useState([]),[n,r]=$.useState([]),[o,i,s]=wk([]),[l,u,a]=xk([]),[d,c]=$.useState(!0),[f,m]=$.useState(null),[y,w]=$.useState(null),[x,h]=$.useState(null),[g,p]=$.useState({nodes:new Set,edges:new Set}),[v,E]=$.useState(!1),[_,N]=$.useState(""),[P,L]=$.useState(!1),j=$.useRef(null);$.useEffect(()=>{fetch("/routeviewer/data").then(S=>{if(!S.ok)throw new Error(S.statusText);return S.json()}).then(S=>{const T=S.nodes.filter(U=>U.type==="route").length,{nodes:O,edges:F}=bC(S.nodes,S.edges),{nodes:W,edges:V}=KC(O,F);t(W),r(V),w({routes:T}),c(!1)}).catch(S=>{m(S.message),c(!1)})},[]);const z=$.useMemo(()=>{const S=new Map;return n.forEach(T=>{T.edgeType==="extends"&&S.set(T.target,T.source)}),T=>{const O=new Set;let F=S.get(T);for(;F;)O.add(F),F=S.get(F);return O}},[n]);$.useEffect(()=>{const S=_.trim().toLowerCase(),T=new Set(e.filter(V=>{var U;return(U=V.data)==null?void 0:U.isLambda}).map(V=>V.id));let O=new Set(e.map(V=>V.id));if(S){const V=new Set(e.filter(Y=>{var Q,B;return(((Q=Y.data)==null?void 0:Q.name)||"").toLowerCase().includes(S)||(((B=Y.data)==null?void 0:B.routes)||[]).some(K=>K.path.toLowerCase().includes(S))}).map(Y=>Y.id)),U=new Set(V);V.forEach(Y=>z(Y).forEach(Q=>U.add(Q))),O=U}const F=e.filter(V=>T.has(V.id)&&!v?!1:O.has(V.id)),W=new Set(F.map(V=>V.id));i(F),u(n.filter(V=>W.has(V.source)&&W.has(V.target)))},[v,_,e,n,i,u,z]);const R=$.useCallback((S,T)=>{const O=new Map;l.forEach(U=>{U.edgeType==="extends"&&O.set(U.target,{pid:U.source,eid:U.id})});const F=new Set([T.id]),W=new Set,V=[T.id];for(;V.length;){const U=V.shift(),Y=O.get(U);Y&&!F.has(Y.pid)&&(W.add(Y.eid),F.add(Y.pid),V.push(Y.pid))}h(T.id),p({nodes:F,edges:W})},[l]),H=$.useCallback(()=>{h(null),p({nodes:new Set,edges:new Set})},[]),C=o.map(S=>({...S,style:{opacity:x&&!g.nodes.has(S.id)?.1:1,transition:"opacity 0.15s"}})),A=l.map(S=>{const T={type:"bezier",pathOptions:{curvature:.35},style:{stroke:"#1e2235",strokeWidth:1.5},markerEnd:{type:xr.ArrowClosed,width:10,height:10,color:"#1e2235"}};return x?g.edges.has(S.id)?{...S,type:"bezier",pathOptions:{curvature:.35},style:{stroke:"#60a5fa",strokeWidth:2.5},markerEnd:{type:xr.ArrowClosed,width:13,height:13,color:"#60a5fa"}}:{...S,...T,style:{...T.style,opacity:.04}}:{...S,...T}}),I=e.filter(S=>{var T;return(T=S.data)==null?void 0:T.isLambda}).length,D=e.filter(S=>{var T;return!((T=S.data)!=null&&T.isLambda)}).length,k=$.useCallback(()=>{L(!0),setTimeout(()=>{var S;(S=j.current)==null||S.call(j),setTimeout(()=>L(!1),1200)},50)},[]);return M.jsxs("div",{style:{display:"flex",width:"100vw",height:"100vh",overflow:"hidden",background:"#0f1117"},children:[M.jsxs("aside",{style:{width:"240px",minWidth:"240px",flexShrink:0,display:"flex",flexDirection:"column",background:"#0c0e15",borderRight:"1px solid #1a1d2a",fontFamily:"system-ui, sans-serif",color:"#c8cfe0"},children:[M.jsx("div",{style:{padding:"14px 16px 12px",borderBottom:"1px solid #1a1d2a",display:"flex",alignItems:"center",gap:8},children:M.jsx("span",{style:{fontSize:15,fontWeight:700,letterSpacing:"-0.3px"},children:"⚡ Route Viewer"})}),M.jsxs("div",{style:{padding:"14px 14px",overflowY:"auto",flex:1},children:[M.jsxs(Ei,{label:"SEARCH",children:[M.jsx("input",{type:"text",placeholder:"handler or path…",value:_,onChange:S=>N(S.target.value),style:{width:"100%",boxSizing:"border-box",background:"#12141e",border:"1px solid #1e2235",borderRadius:5,padding:"6px 9px",color:"#c8cfe0",fontSize:12,fontFamily:"monospace",outline:"none"}}),_&&M.jsxs("div",{style:{fontSize:11,color:"#4a5370",marginTop:5},children:[o.length," node",o.length!==1?"s":""," visible"]})]}),M.jsxs(Ei,{label:"DISPLAY",children:[M.jsxs("label",{style:{display:"flex",alignItems:"center",gap:9,cursor:"pointer",fontSize:12},children:[M.jsx("input",{type:"checkbox",checked:v,onChange:S=>E(S.target.checked),style:{cursor:"pointer",accentColor:"#3b82f6"}}),M.jsx("span",{style:{color:"#8892a4"},children:"Show lambda handlers"})]}),M.jsxs("div",{style:{fontSize:11,color:"#343b54",marginTop:4,paddingLeft:21},children:[I," lambda",I!==1?"s":""]})]}),M.jsx(Ei,{label:"STATS",children:[["Routes",(y==null?void 0:y.routes)||0],["Handlers",D],["Lambdas",I]].map(([S,T])=>M.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:12,marginBottom:5},children:[M.jsx("span",{style:{color:"#4a5370"},children:S}),M.jsx("span",{style:{color:"#e2e8f0",fontWeight:600,fontFamily:"monospace"},children:T})]},S))}),M.jsx(Ei,{label:"LEGEND",children:[{dot:"#3b82f6",border:"#3b82f6",label:"Handler"},{dot:"#ef4444",border:"#ef4444",label:"Abstract"},{dot:"#f6ad55",border:"#f6ad55",label:"Middleware"}].map(({dot:S,label:T})=>M.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[M.jsx("div",{style:{width:9,height:9,borderRadius:2,background:S,flexShrink:0,opacity:.8}}),M.jsx("span",{style:{fontSize:12,color:"#4a5370"},children:T})]},T))}),M.jsxs("div",{style:{fontSize:11,color:"#2d3347",lineHeight:1.65,marginTop:4},children:["Hover a node to trace its ancestry.",M.jsx("br",{}),"Search filters nodes + parents."]})]}),M.jsx("div",{style:{padding:"12px 14px",borderTop:"1px solid #1a1d2a"},children:M.jsx("button",{onClick:k,disabled:P||d,style:{width:"100%",padding:"8px 0",background:P?"#1e2235":"#12141e",border:"1px solid #1e2235",borderRadius:6,color:P?"#4a5370":"#8892a4",fontSize:12,cursor:P?"default":"pointer",fontFamily:"system-ui, sans-serif",transition:"all 0.15s",display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:P?"⏳ Exporting…":"⬇ Export PNG"})})]}),M.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},children:[M.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"9px 18px",background:"#0c0e15",borderBottom:"1px solid #1a1d2a",flexShrink:0,zIndex:10},children:[M.jsx("span",{style:{fontSize:13,fontWeight:700,color:"#e2e8f0",letterSpacing:"-0.2px"},children:"Flash Route Graph"}),M.jsx("span",{style:{marginLeft:"auto",display:"flex",gap:18,fontSize:11,color:"#2d3347",fontFamily:"system-ui"},children:[["#3b82f6","handler"],["#ef4444","abstract"],["#f6ad55","middleware"]].map(([S,T])=>M.jsxs("span",{style:{display:"flex",alignItems:"center",gap:5},children:[M.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:S,display:"inline-block",opacity:.8}}),T]},T))})]}),d&&M.jsx("div",{className:"center muted",children:"Loading…"}),f&&M.jsxs("div",{className:"center error",children:["Error: ",f]}),!d&&!f&&M.jsx("div",{style:{flex:1,position:"relative"},children:M.jsx(Om,{children:M.jsx(eN,{styledNodes:C,styledEdges:A,onNodesChange:s,onEdgesChange:a,onNodeMouseEnter:R,onNodeMouseLeave:H,showLambdas:v,searchQuery:_,exportRef:j})})})]})]})}function Ei({label:e,children:t}){return M.jsxs("div",{style:{marginBottom:18},children:[M.jsx("div",{style:{fontSize:9,fontWeight:700,letterSpacing:1,color:"#272d42",marginBottom:8,fontFamily:"monospace"},children:e}),t]})}Gp(document.getElementById("root")).render(M.jsx($.StrictMode,{children:M.jsx(tN,{})}));