>>1,te=z[Y];if(0>>1;Ys(xe,Q))je s(ke,xe)?(z[Y]=ke,z[je]=Q,Y=je):(z[Y]=xe,z[Ce]=Q,Y=Ce);else if(je s(ke,Q))z[Y]=ke,z[je]=Q,Y=je;else break e}}return j}function s(z,j){var Q=z.sortIndex-j.sortIndex;return Q!==0?Q:z.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var r=Date,a=r.now();n.unstable_now=function(){return r.now()-a}}var l=[],c=[],d=1,h=null,u=3,f=!1,g=!1,p=!1,m=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(z){for(var j=t(c);j!==null;){if(j.callback===null)i(c);else if(j.startTime<=z)i(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=t(c)}}function C(z){if(p=!1,w(z),!g)if(t(l)!==null)g=!0,V(S);else{var j=t(c);j!==null&&K(C,j.startTime-z)}}function S(z,j){g=!1,p&&(p=!1,b(E),E=-1),f=!0;var Q=u;try{for(w(j),h=t(l);h!==null&&(!(h.expirationTime>j)||z&&!M());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,u=h.priorityLevel;var te=Y(h.expirationTime<=j);j=n.unstable_now(),typeof te=="function"?h.callback=te:h===t(l)&&i(l),w(j)}else i(l);h=t(l)}if(h!==null)var ce=!0;else{var Ce=t(c);Ce!==null&&K(C,Ce.startTime-j),ce=!1}return ce}finally{h=null,u=Q,f=!1}}var L=!1,x=null,E=-1,I=5,R=-1;function M(){return!(n.unstable_now()-Rz||125 Y?(z.sortIndex=Q,e(c,z),t(l)===null&&z===t(c)&&(p?(b(E),E=-1):p=!0,K(C,Q-Y))):(z.sortIndex=te,e(l,z),g||f||(g=!0,V(S))),z},n.unstable_shouldYield=M,n.unstable_wrapCallback=function(z){var j=u;return function(){var Q=u;u=j;try{return z.apply(this,arguments)}finally{u=Q}}}})(Xce);Zce.exports=Xce;var ySe=Zce.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var Yye=Object.defineProperty;var Zye=(n,e,t)=>e in n?Yye(n,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var vSe=$,Zl=bSe;function je(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t "u"||typeof window.document>"u"||typeof window.document.createElement>"u"),H6=Object.prototype.hasOwnProperty,wSe=/^[: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]*$/,hJ={},uJ={};function CSe(n){return H6.call(uJ,n)?!0:H6.call(hJ,n)?!1:wSe.test(n)?uJ[n]=!0:(hJ[n]=!0,!1)}function ySe(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function SSe(n,e,t,i){if(e===null||typeof e>"u"||ySe(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Na(n,e,t,i,s,o,r){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=o,this.removeEmptyString=r}var _r={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){_r[n]=new Na(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];_r[e]=new Na(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){_r[n]=new Na(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){_r[n]=new Na(n,2,!1,n,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(n){_r[n]=new Na(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){_r[n]=new Na(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){_r[n]=new Na(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){_r[n]=new Na(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){_r[n]=new Na(n,5,!1,n.toLowerCase(),null,!1,!1)});var dK=/[\-:]([a-z])/g;function hK(n){return n[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(n){var e=n.replace(dK,hK);_r[e]=new Na(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(dK,hK);_r[e]=new Na(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(dK,hK);_r[e]=new Na(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){_r[n]=new Na(n,1,!1,n.toLowerCase(),null,!1,!1)});_r.xlinkHref=new Na("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){_r[n]=new Na(n,1,!1,n.toLowerCase(),null,!0,!0)});function uK(n,e,t,i){var s=_r.hasOwnProperty(e)?_r[e]:null;(s!==null?s.type!==0:i||!(2 "u"||typeof window.document>"u"||typeof window.document.createElement>"u"),V6=Object.prototype.hasOwnProperty,xSe=/^[: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]*$/,uJ={},fJ={};function LSe(n){return V6.call(fJ,n)?!0:V6.call(uJ,n)?!1:xSe.test(n)?fJ[n]=!0:(uJ[n]=!0,!1)}function kSe(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function ESe(n,e,t,i){if(e===null||typeof e>"u"||kSe(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ia(n,e,t,i,s,o,r){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=o,this.removeEmptyString=r}var pr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){pr[n]=new Ia(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];pr[e]=new Ia(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){pr[n]=new Ia(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){pr[n]=new Ia(n,2,!1,n,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(n){pr[n]=new Ia(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){pr[n]=new Ia(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){pr[n]=new Ia(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){pr[n]=new Ia(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){pr[n]=new Ia(n,5,!1,n.toLowerCase(),null,!1,!1)});var hK=/[\-:]([a-z])/g;function uK(n){return n[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(n){var e=n.replace(hK,uK);pr[e]=new Ia(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(hK,uK);pr[e]=new Ia(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(hK,uK);pr[e]=new Ia(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){pr[n]=new Ia(n,1,!1,n.toLowerCase(),null,!1,!1)});pr.xlinkHref=new Ia("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){pr[n]=new Ia(n,1,!1,n.toLowerCase(),null,!0,!0)});function fK(n,e,t,i){var s=pr.hasOwnProperty(e)?pr[e]:null;(s!==null?s.type!==0:i||!(2 a||s[r]!==o[a]){var l=` -`+s[r].replace(" at new "," at ");return n.displayName&&l.includes(" ")&&(l=l.replace(" ",n.displayName)),l}while(1<=r&&0<=a);break}}}finally{L8=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?vL(n):""}function xSe(n){switch(n.tag){case 5:return vL(n.type);case 16:return vL("Lazy");case 13:return vL("Suspense");case 19:return vL("SuspenseList");case 0:case 2:case 15:return n=k8(n.type,!1),n;case 11:return n=k8(n.type.render,!1),n;case 1:return n=k8(n.type,!0),n;default:return""}}function $6(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case HC:return"Fragment";case WC:return"Portal";case V6:return"Profiler";case fK:return"StrictMode";case z6:return"Suspense";case j6:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case Xce:return(n.displayName||"Context")+".Consumer";case Zce:return(n._context.displayName||"Context")+".Provider";case gK:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case pK:return e=n.displayName||null,e!==null?e:$6(n.type)||"Memo";case Cp:e=n._payload,n=n._init;try{return $6(n(e))}catch{}}return null}function LSe(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $6(e);case 8:return e===fK?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ym(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Jce(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function kSe(n){var e=Jce(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var s=t.get,o=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return s.call(this)},set:function(r){i=""+r,o.call(this,r)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(r){i=""+r},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function nT(n){n._valueTracker||(n._valueTracker=kSe(n))}function ede(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=Jce(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function uM(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function U6(n,e){var t=e.checked;return xs({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function gJ(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Ym(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function tde(n,e){e=e.checked,e!=null&&uK(n,"checked",e,!1)}function q6(n,e){tde(n,e);var t=Ym(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?K6(n,e.type,t):e.hasOwnProperty("defaultValue")&&K6(n,e.type,Ym(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function pJ(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function K6(n,e,t){(e!=="number"||uM(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var wL=Array.isArray;function j0(n,e,t,i){if(n=n.options,e){e={};for(var s=0;s "+e.valueOf().toString()+"",e=sT.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function xI(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var YL={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},ISe=["Webkit","ms","Moz","O"];Object.keys(YL).forEach(function(n){ISe.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),YL[e]=YL[n]})});function ode(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||YL.hasOwnProperty(n)&&YL[n]?(""+e).trim():e+"px"}function rde(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,s=ode(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,s):n[t]=s}}var ESe=xs({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 Z6(n,e){if(e){if(ESe[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(je(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(je(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(je(61))}if(e.style!=null&&typeof e.style!="object")throw Error(je(62))}}function X6(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){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 Q6=null;function mK(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var J6=null,$0=null,U0=null;function bJ(n){if(n=KN(n)){if(typeof J6!="function")throw Error(je(280));var e=n.stateNode;e&&(e=s5(e),J6(n.stateNode,n.type,e))}}function ade(n){$0?U0?U0.push(n):U0=[n]:$0=n}function lde(){if($0){var n=$0,e=U0;if(U0=$0=null,bJ(n),e)for(n=0;n >>=0,n===0?32:31-(WSe(n)/HSe|0)|0}var oT=64,rT=4194304;function CL(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function mM(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,s=n.suspendedLanes,o=n.pingedLanes,r=t&268435455;if(r!==0){var a=r&~s;a!==0?i=CL(a):(o&=r,o!==0&&(i=CL(o)))}else r=t&~s,r!==0?i=CL(r):o!==0&&(i=CL(o));if(i===0)return 0;if(e!==0&&e!==i&&!(e&s)&&(s=i&-i,o=e&-e,s>=o||s===16&&(o&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0 t;t++)e.push(n);return e}function UN(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-jd(e),n[e]=t}function $Se(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0 =XL),IJ=" ",EJ=!1;function Ede(n,e){switch(n){case"keyup":return bxe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nde(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var VC=!1;function wxe(n,e){switch(n){case"compositionend":return Nde(e);case"keypress":return e.which!==32?null:(EJ=!0,IJ);case"textInput":return n=e.data,n===IJ&&EJ?null:n;default:return null}}function Cxe(n,e){if(VC)return n==="compositionend"||!xK&&Ede(n,e)?(n=kde(),aR=CK=$p=null,VC=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1 =e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=RJ(t)}}function Mde(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?Mde(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function Ade(){for(var n=window,e=uM();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=uM(n.document)}return e}function LK(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function Dxe(n){var e=Ade(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&Mde(t.ownerDocument.documentElement,t)){if(i!==null&&LK(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var s=t.textContent.length,o=Math.min(i.start,s);i=i.end===void 0?o:Math.min(i.end,s),!n.extend&&o>i&&(s=i,i=o,o=s),s=MJ(t,o);var r=MJ(t,i);s&&r&&(n.rangeCount!==1||n.anchorNode!==s.node||n.anchorOffset!==s.offset||n.focusNode!==r.node||n.focusOffset!==r.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(e),n.extend(r.node,r.offset)):(e.setEnd(r.node,r.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t =document.documentMode,zC=null,oB=null,JL=null,rB=!1;function AJ(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;rB||zC==null||zC!==uM(i)||(i=zC,"selectionStart"in i&&LK(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),JL&&DI(JL,i)||(JL=i,i=vM(oB,"onSelect"),0 UC||(n.current=uB[UC],uB[UC]=null,UC--)}function zn(n,e){UC++,uB[UC]=n.current,n.current=e}var Zm={},$r=p_(Zm),il=p_(!1),P1=Zm;function Vy(n,e){var t=n.type.contextTypes;if(!t)return Zm;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in t)s[o]=e[o];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=s),s}function nl(n){return n=n.childContextTypes,n!=null}function CM(){Yn(il),Yn($r)}function VJ(n,e,t){if($r.current!==Zm)throw Error(je(168));zn($r,e),zn(il,t)}function jde(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var s in i)if(!(s in e))throw Error(je(108,LSe(n)||"Unknown",s));return xs({},t,i)}function yM(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Zm,P1=$r.current,zn($r,n),zn(il,il.current),!0}function zJ(n,e,t){var i=n.stateNode;if(!i)throw Error(je(169));t?(n=jde(n,e,P1),i.__reactInternalMemoizedMergedChildContext=n,Yn(il),Yn($r),zn($r,n)):Yn(il),zn(il,t)}var Sf=null,o5=!1,H8=!1;function $de(n){Sf===null?Sf=[n]:Sf.push(n)}function zxe(n){o5=!0,$de(n)}function m_(){if(!H8&&Sf!==null){H8=!0;var n=0,e=bn;try{var t=Sf;for(bn=1;n >=r,s-=r,Ff=1<<32-jd(e)+s|t< I?(E=x,x=null):E=x.sibling;var R=u(b,x,w[I],C);if(R===null){x===null&&(x=E);break}n&&x&&R.alternate===null&&e(b,x),v=o(R,v,I),L===null?S=R:L.sibling=R,L=R,x=E}if(I===w.length)return t(b,x),is&&ob(b,I),S;if(x===null){for(;II?(E=x,x=null):E=x.sibling;var M=u(b,x,R.value,C);if(M===null){x===null&&(x=E);break}n&&x&&M.alternate===null&&e(b,x),v=o(M,v,I),L===null?S=M:L.sibling=M,L=M,x=E}if(R.done)return t(b,x),is&&ob(b,I),S;if(x===null){for(;!R.done;I++,R=w.next())R=h(b,R.value,C),R!==null&&(v=o(R,v,I),L===null?S=R:L.sibling=R,L=R);return is&&ob(b,I),S}for(x=i(b,x);!R.done;I++,R=w.next())R=f(x,b,I,R.value,C),R!==null&&(n&&R.alternate!==null&&x.delete(R.key===null?I:R.key),v=o(R,v,I),L===null?S=R:L.sibling=R,L=R);return n&&x.forEach(function(A){return e(b,A)}),is&&ob(b,I),S}function m(b,v,w,C){if(typeof w=="object"&&w!==null&&w.type===HC&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case iT:e:{for(var S=w.key,L=v;L!==null;){if(L.key===S){if(S=w.type,S===HC){if(L.tag===7){t(b,L.sibling),v=s(L,w.props.children),v.return=b,b=v;break e}}else if(L.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Cp&&UJ(S)===L.type){t(b,L.sibling),v=s(L,w.props),v.ref=Mx(b,L,w),v.return=b,b=v;break e}t(b,L);break}else e(b,L);L=L.sibling}w.type===HC?(v=vv(w.props.children,b.mode,C,w.key),v.return=b,b=v):(C=pR(w.type,w.key,w.props,null,b.mode,C),C.ref=Mx(b,v,w),C.return=b,b=C)}return r(b);case WC:e:{for(L=w.key;v!==null;){if(v.key===L)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){t(b,v.sibling),v=s(v,w.children||[]),v.return=b,b=v;break e}else{t(b,v);break}else e(b,v);v=v.sibling}v=G8(w,b.mode,C),v.return=b,b=v}return r(b);case Cp:return L=w._init,m(b,v,L(w._payload),C)}if(wL(w))return g(b,v,w,C);if(Ex(w))return p(b,v,w,C);fT(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(t(b,v.sibling),v=s(v,w),v.return=b,b=v):(t(b,v),v=K8(w,b.mode,C),v.return=b,b=v),r(b)):t(b,v)}return m}var jy=Gde(!0),Yde=Gde(!1),LM=p_(null),kM=null,GC=null,NK=null;function DK(){NK=GC=kM=null}function TK(n){var e=LM.current;Yn(LM),n._currentValue=e}function pB(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function K0(n,e){kM=n,NK=GC=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Xa=!0),n.firstContext=null)}function qc(n){var e=n._currentValue;if(NK!==n)if(n={context:n,memoizedValue:e,next:null},GC===null){if(kM===null)throw Error(je(308));GC=n,kM.dependencies={lanes:0,firstContext:n}}else GC=GC.next=n;return e}var Qb=null;function RK(n){Qb===null?Qb=[n]:Qb.push(n)}function Zde(n,e,t,i){var s=e.interleaved;return s===null?(t.next=t,RK(e)):(t.next=s.next,s.next=t),e.interleaved=t,pg(n,i)}function pg(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var yp=!1;function MK(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xde(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function tg(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function pm(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,zi&2){var s=i.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),i.pending=e,pg(n,t)}return s=i.interleaved,s===null?(e.next=e,RK(i)):(e.next=s.next,s.next=e),i.interleaved=e,pg(n,t)}function cR(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,bK(n,t)}}function qJ(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var s=null,o=null;if(t=t.firstBaseUpdate,t!==null){do{var r={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};o===null?s=o=r:o=o.next=r,t=t.next}while(t!==null);o===null?s=o=e:o=o.next=e}else s=o=e;t={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function IM(n,e,t,i){var s=n.updateQueue;yp=!1;var o=s.firstBaseUpdate,r=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,r===null?o=c:r.next=c,r=l;var d=n.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==r&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(o!==null){var h=s.baseState;r=0,d=c=l=null,a=o;do{var u=a.lane,f=a.eventTime;if((i&u)===u){d!==null&&(d=d.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=n,p=a;switch(u=e,f=t,p.tag){case 1:if(g=p.payload,typeof g=="function"){h=g.call(f,h,u);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,u=typeof g=="function"?g.call(f,h,u):g,u==null)break e;h=xs({},h,u);break e;case 2:yp=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,u=s.effects,u===null?s.effects=[a]:u.push(a))}else f={eventTime:f,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=f,l=h):d=d.next=f,r|=u;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;u=a,a=u.next,u.next=null,s.lastBaseUpdate=u,s.shared.pending=null}}while(!0);if(d===null&&(l=h),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do r|=s.lane,s=s.next;while(s!==e)}else o===null&&(s.shared.lanes=0);B1|=r,n.lanes=r,n.memoizedState=h}}function KJ(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e t?t:4,n(!0);var i=z8.transition;z8.transition={};try{n(!1),e()}finally{bn=t,z8.transition=i}}function ghe(){return Kc().memoizedState}function qxe(n,e,t){var i=_m(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},phe(n))mhe(e,t);else if(t=Zde(n,e,t,i),t!==null){var s=pa();$d(t,n,i,s),_he(t,e,i)}}function Kxe(n,e,t){var i=_m(n),s={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(phe(n))mhe(e,s);else{var o=n.alternate;if(n.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var r=e.lastRenderedState,a=o(r,t);if(s.hasEagerState=!0,s.eagerState=a,Zd(a,r)){var l=e.interleaved;l===null?(s.next=s,RK(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}t=Zde(n,e,s,i),t!==null&&(s=pa(),$d(t,n,i,s),_he(t,e,i))}}function phe(n){var e=n.alternate;return n===ws||e!==null&&e===ws}function mhe(n,e){ek=NM=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function _he(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,bK(n,t)}}var DM={readContext:qc,useCallback:Tr,useContext:Tr,useEffect:Tr,useImperativeHandle:Tr,useInsertionEffect:Tr,useLayoutEffect:Tr,useMemo:Tr,useReducer:Tr,useRef:Tr,useState:Tr,useDebugValue:Tr,useDeferredValue:Tr,useTransition:Tr,useMutableSource:Tr,useSyncExternalStore:Tr,useId:Tr,unstable_isNewReconciler:!1},Gxe={readContext:qc,useCallback:function(n,e){return Rh().memoizedState=[n,e===void 0?null:e],n},useContext:qc,useEffect:YJ,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,hR(4194308,4,che.bind(null,e,n),t)},useLayoutEffect:function(n,e){return hR(4194308,4,n,e)},useInsertionEffect:function(n,e){return hR(4,2,n,e)},useMemo:function(n,e){var t=Rh();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Rh();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=qxe.bind(null,ws,n),[i.memoizedState,n]},useRef:function(n){var e=Rh();return n={current:n},e.memoizedState=n},useState:GJ,useDebugValue:VK,useDeferredValue:function(n){return Rh().memoizedState=n},useTransition:function(){var n=GJ(!1),e=n[0];return n=Uxe.bind(null,n[1]),Rh().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=ws,s=Rh();if(is){if(t===void 0)throw Error(je(407));t=t()}else{if(t=e(),Go===null)throw Error(je(349));F1&30||the(i,e,t)}s.memoizedState=t;var o={value:t,getSnapshot:e};return s.queue=o,YJ(nhe.bind(null,i,o,n),[n]),i.flags|=2048,BI(9,ihe.bind(null,i,o,t,e),void 0,null),t},useId:function(){var n=Rh(),e=Go.identifierPrefix;if(is){var t=Bf,i=Ff;t=(i&~(1<<32-jd(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=OI++,0 ")&&(l=l.replace(" ",n.displayName)),l}while(1<=r&&0<=a);break}}}finally{L8=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?vL(n):""}function ISe(n){switch(n.tag){case 5:return vL(n.type);case 16:return vL("Lazy");case 13:return vL("Suspense");case 19:return vL("SuspenseList");case 0:case 2:case 15:return n=k8(n.type,!1),n;case 11:return n=k8(n.type.render,!1),n;case 1:return n=k8(n.type,!0),n;default:return""}}function U6(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case UC:return"Fragment";case $C:return"Portal";case z6:return"Profiler";case gK:return"StrictMode";case j6:return"Suspense";case $6:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case ede:return(n.displayName||"Context")+".Consumer";case Jce:return(n._context.displayName||"Context")+".Provider";case pK:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case mK:return e=n.displayName||null,e!==null?e:U6(n.type)||"Memo";case Cp:e=n._payload,n=n._init;try{return U6(n(e))}catch{}}return null}function NSe(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U6(e);case 8:return e===gK?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Zm(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ide(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function DSe(n){var e=ide(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var s=t.get,o=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return s.call(this)},set:function(r){i=""+r,o.call(this,r)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(r){i=""+r},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function iT(n){n._valueTracker||(n._valueTracker=DSe(n))}function nde(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=ide(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function hM(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function q6(n,e){var t=e.checked;return Ss({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function pJ(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Zm(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function sde(n,e){e=e.checked,e!=null&&fK(n,"checked",e,!1)}function K6(n,e){sde(n,e);var t=Zm(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?G6(n,e.type,t):e.hasOwnProperty("defaultValue")&&G6(n,e.type,Zm(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function mJ(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function G6(n,e,t){(e!=="number"||hM(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var wL=Array.isArray;function U0(n,e,t,i){if(n=n.options,e){e={};for(var s=0;s "+e.valueOf().toString()+"",e=nT.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function xE(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var YL={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},TSe=["Webkit","ms","Moz","O"];Object.keys(YL).forEach(function(n){TSe.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),YL[e]=YL[n]})});function lde(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||YL.hasOwnProperty(n)&&YL[n]?(""+e).trim():e+"px"}function cde(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,s=lde(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,s):n[t]=s}}var RSe=Ss({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 X6(n,e){if(e){if(RSe[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error($e(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error($e(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error($e(61))}if(e.style!=null&&typeof e.style!="object")throw Error($e(62))}}function Q6(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){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 J6=null;function _K(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var eB=null,q0=null,K0=null;function vJ(n){if(n=KN(n)){if(typeof eB!="function")throw Error($e(280));var e=n.stateNode;e&&(e=s5(e),eB(n.stateNode,n.type,e))}}function dde(n){q0?K0?K0.push(n):K0=[n]:q0=n}function hde(){if(q0){var n=q0,e=K0;if(K0=q0=null,vJ(n),e)for(n=0;n >>=0,n===0?32:31-(jSe(n)/$Se|0)|0}var sT=64,oT=4194304;function CL(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function pM(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,s=n.suspendedLanes,o=n.pingedLanes,r=t&268435455;if(r!==0){var a=r&~s;a!==0?i=CL(a):(o&=r,o!==0&&(i=CL(o)))}else r=t&~s,r!==0?i=CL(r):o!==0&&(i=CL(o));if(i===0)return 0;if(e!==0&&e!==i&&!(e&s)&&(s=i&-i,o=e&-e,s>=o||s===16&&(o&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0 t;t++)e.push(n);return e}function UN(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Vd(e),n[e]=t}function GSe(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0 =XL),IJ=" ",NJ=!1;function Tde(n,e){switch(n){case"keyup":return yxe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rde(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var qC=!1;function xxe(n,e){switch(n){case"compositionend":return Rde(e);case"keypress":return e.which!==32?null:(NJ=!0,IJ);case"textInput":return n=e.data,n===IJ&&NJ?null:n;default:return null}}function Lxe(n,e){if(qC)return n==="compositionend"||!LK&&Tde(n,e)?(n=Nde(),rR=yK=Up=null,qC=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1 =e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=MJ(t)}}function Ode(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?Ode(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function Fde(){for(var n=window,e=hM();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=hM(n.document)}return e}function kK(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function Axe(n){var e=Fde(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&Ode(t.ownerDocument.documentElement,t)){if(i!==null&&kK(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var s=t.textContent.length,o=Math.min(i.start,s);i=i.end===void 0?o:Math.min(i.end,s),!n.extend&&o>i&&(s=i,i=o,o=s),s=AJ(t,o);var r=AJ(t,i);s&&r&&(n.rangeCount!==1||n.anchorNode!==s.node||n.anchorOffset!==s.offset||n.focusNode!==r.node||n.focusOffset!==r.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(e),n.extend(r.node,r.offset)):(e.setEnd(r.node,r.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t =document.documentMode,KC=null,rB=null,JL=null,aB=!1;function PJ(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;aB||KC==null||KC!==hM(i)||(i=KC,"selectionStart"in i&&kK(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),JL&&DE(JL,i)||(JL=i,i=bM(rB,"onSelect"),0 ZC||(n.current=fB[ZC],fB[ZC]=null,ZC--)}function $n(n,e){ZC++,fB[ZC]=n.current,n.current=e}var Xm={},zr=m_(Xm),il=m_(!1),B1=Xm;function jy(n,e){var t=n.type.contextTypes;if(!t)return Xm;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in t)s[o]=e[o];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=s),s}function nl(n){return n=n.childContextTypes,n!=null}function wM(){Zn(il),Zn(zr)}function zJ(n,e,t){if(zr.current!==Xm)throw Error($e(168));$n(zr,e),$n(il,t)}function qde(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var s in i)if(!(s in e))throw Error($e(108,NSe(n)||"Unknown",s));return Ss({},t,i)}function CM(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Xm,B1=zr.current,$n(zr,n),$n(il,il.current),!0}function jJ(n,e,t){var i=n.stateNode;if(!i)throw Error($e(169));t?(n=qde(n,e,B1),i.__reactInternalMemoizedMergedChildContext=n,Zn(il),Zn(zr),$n(zr,n)):Zn(il),$n(il,t)}var Sf=null,o5=!1,H8=!1;function Kde(n){Sf===null?Sf=[n]:Sf.push(n)}function qxe(n){o5=!0,Kde(n)}function __(){if(!H8&&Sf!==null){H8=!0;var n=0,e=bn;try{var t=Sf;for(bn=1;n >=r,s-=r,Of=1<<32-Vd(e)+s|t< E?(I=x,x=null):I=x.sibling;var R=u(b,x,w[E],C);if(R===null){x===null&&(x=I);break}n&&x&&R.alternate===null&&e(b,x),v=o(R,v,E),L===null?S=R:L.sibling=R,L=R,x=I}if(E===w.length)return t(b,x),es&&rb(b,E),S;if(x===null){for(;EE?(I=x,x=null):I=x.sibling;var M=u(b,x,R.value,C);if(M===null){x===null&&(x=I);break}n&&x&&M.alternate===null&&e(b,x),v=o(M,v,E),L===null?S=M:L.sibling=M,L=M,x=I}if(R.done)return t(b,x),es&&rb(b,E),S;if(x===null){for(;!R.done;E++,R=w.next())R=h(b,R.value,C),R!==null&&(v=o(R,v,E),L===null?S=R:L.sibling=R,L=R);return es&&rb(b,E),S}for(x=i(b,x);!R.done;E++,R=w.next())R=f(x,b,E,R.value,C),R!==null&&(n&&R.alternate!==null&&x.delete(R.key===null?E:R.key),v=o(R,v,E),L===null?S=R:L.sibling=R,L=R);return n&&x.forEach(function(A){return e(b,A)}),es&&rb(b,E),S}function m(b,v,w,C){if(typeof w=="object"&&w!==null&&w.type===UC&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case tT:e:{for(var S=w.key,L=v;L!==null;){if(L.key===S){if(S=w.type,S===UC){if(L.tag===7){t(b,L.sibling),v=s(L,w.props.children),v.return=b,b=v;break e}}else if(L.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Cp&&qJ(S)===L.type){t(b,L.sibling),v=s(L,w.props),v.ref=Mx(b,L,w),v.return=b,b=v;break e}t(b,L);break}else e(b,L);L=L.sibling}w.type===UC?(v=yv(w.props.children,b.mode,C,w.key),v.return=b,b=v):(C=gR(w.type,w.key,w.props,null,b.mode,C),C.ref=Mx(b,v,w),C.return=b,b=C)}return r(b);case $C:e:{for(L=w.key;v!==null;){if(v.key===L)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){t(b,v.sibling),v=s(v,w.children||[]),v.return=b,b=v;break e}else{t(b,v);break}else e(b,v);v=v.sibling}v=G8(w,b.mode,C),v.return=b,b=v}return r(b);case Cp:return L=w._init,m(b,v,L(w._payload),C)}if(wL(w))return g(b,v,w,C);if(Ix(w))return p(b,v,w,C);uT(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(t(b,v.sibling),v=s(v,w),v.return=b,b=v):(t(b,v),v=K8(w,b.mode,C),v.return=b,b=v),r(b)):t(b,v)}return m}var Uy=Xde(!0),Qde=Xde(!1),xM=m_(null),LM=null,JC=null,DK=null;function TK(){DK=JC=LM=null}function RK(n){var e=xM.current;Zn(xM),n._currentValue=e}function mB(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function Y0(n,e){LM=n,DK=JC=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Xa=!0),n.firstContext=null)}function Uc(n){var e=n._currentValue;if(DK!==n)if(n={context:n,memoizedValue:e,next:null},JC===null){if(LM===null)throw Error($e(308));JC=n,LM.dependencies={lanes:0,firstContext:n}}else JC=JC.next=n;return e}var Jb=null;function MK(n){Jb===null?Jb=[n]:Jb.push(n)}function Jde(n,e,t,i){var s=e.interleaved;return s===null?(t.next=t,MK(e)):(t.next=s.next,s.next=t),e.interleaved=t,pg(n,i)}function pg(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var yp=!1;function AK(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ehe(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function tg(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function mm(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,ji&2){var s=i.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),i.pending=e,pg(n,t)}return s=i.interleaved,s===null?(e.next=e,MK(i)):(e.next=s.next,s.next=e),i.interleaved=e,pg(n,t)}function lR(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,vK(n,t)}}function KJ(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var s=null,o=null;if(t=t.firstBaseUpdate,t!==null){do{var r={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};o===null?s=o=r:o=o.next=r,t=t.next}while(t!==null);o===null?s=o=e:o=o.next=e}else s=o=e;t={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function kM(n,e,t,i){var s=n.updateQueue;yp=!1;var o=s.firstBaseUpdate,r=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,r===null?o=c:r.next=c,r=l;var d=n.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==r&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(o!==null){var h=s.baseState;r=0,d=c=l=null,a=o;do{var u=a.lane,f=a.eventTime;if((i&u)===u){d!==null&&(d=d.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=n,p=a;switch(u=e,f=t,p.tag){case 1:if(g=p.payload,typeof g=="function"){h=g.call(f,h,u);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,u=typeof g=="function"?g.call(f,h,u):g,u==null)break e;h=Ss({},h,u);break e;case 2:yp=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,u=s.effects,u===null?s.effects=[a]:u.push(a))}else f={eventTime:f,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=f,l=h):d=d.next=f,r|=u;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;u=a,a=u.next,u.next=null,s.lastBaseUpdate=u,s.shared.pending=null}}while(!0);if(d===null&&(l=h),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do r|=s.lane,s=s.next;while(s!==e)}else o===null&&(s.shared.lanes=0);V1|=r,n.lanes=r,n.memoizedState=h}}function GJ(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e t?t:4,n(!0);var i=z8.transition;z8.transition={};try{n(!1),e()}finally{bn=t,z8.transition=i}}function _he(){return qc().memoizedState}function Zxe(n,e,t){var i=bm(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},bhe(n))vhe(e,t);else if(t=Jde(n,e,t,i),t!==null){var s=ga();zd(t,n,i,s),whe(t,e,i)}}function Xxe(n,e,t){var i=bm(n),s={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(bhe(n))vhe(e,s);else{var o=n.alternate;if(n.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var r=e.lastRenderedState,a=o(r,t);if(s.hasEagerState=!0,s.eagerState=a,Gd(a,r)){var l=e.interleaved;l===null?(s.next=s,MK(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}t=Jde(n,e,s,i),t!==null&&(s=ga(),zd(t,n,i,s),whe(t,e,i))}}function bhe(n){var e=n.alternate;return n===vs||e!==null&&e===vs}function vhe(n,e){ek=IM=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function whe(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,vK(n,t)}}var NM={readContext:Uc,useCallback:Nr,useContext:Nr,useEffect:Nr,useImperativeHandle:Nr,useInsertionEffect:Nr,useLayoutEffect:Nr,useMemo:Nr,useReducer:Nr,useRef:Nr,useState:Nr,useDebugValue:Nr,useDeferredValue:Nr,useTransition:Nr,useMutableSource:Nr,useSyncExternalStore:Nr,useId:Nr,unstable_isNewReconciler:!1},Qxe={readContext:Uc,useCallback:function(n,e){return Th().memoizedState=[n,e===void 0?null:e],n},useContext:Uc,useEffect:ZJ,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,dR(4194308,4,uhe.bind(null,e,n),t)},useLayoutEffect:function(n,e){return dR(4194308,4,n,e)},useInsertionEffect:function(n,e){return dR(4,2,n,e)},useMemo:function(n,e){var t=Th();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Th();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=Zxe.bind(null,vs,n),[i.memoizedState,n]},useRef:function(n){var e=Th();return n={current:n},e.memoizedState=n},useState:YJ,useDebugValue:zK,useDeferredValue:function(n){return Th().memoizedState=n},useTransition:function(){var n=YJ(!1),e=n[0];return n=Yxe.bind(null,n[1]),Th().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=vs,s=Th();if(es){if(t===void 0)throw Error($e(407));t=t()}else{if(t=e(),Ko===null)throw Error($e(349));H1&30||she(i,e,t)}s.memoizedState=t;var o={value:t,getSnapshot:e};return s.queue=o,ZJ(rhe.bind(null,i,o,n),[n]),i.flags|=2048,BE(9,ohe.bind(null,i,o,t,e),void 0,null),t},useId:function(){var n=Th(),e=Ko.identifierPrefix;if(es){var t=Ff,i=Of;t=(i&~(1<<32-Vd(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=OE++,0 <\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=r.createElement(t,{is:i.is}):(n=r.createElement(t),t==="select"&&(r=n,i.multiple?r.multiple=!0:i.size&&(r.size=i.size))):n=r.createElementNS(n,t),n[Zh]=e,n[MI]=i,Ihe(n,e,!1,!1),e.stateNode=n;e:{switch(r=X6(t,i),t){case"dialog":Kn("cancel",n),Kn("close",n),s=i;break;case"iframe":case"object":case"embed":Kn("load",n),s=i;break;case"video":case"audio":for(s=0;s qy&&(e.flags|=128,i=!0,Ax(o,!1),e.lanes=4194304)}else{if(!i)if(n=EM(r),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ax(o,!0),o.tail===null&&o.tailMode==="hidden"&&!r.alternate&&!is)return Rr(e),null}else 2*Hs()-o.renderingStartTime>qy&&t!==1073741824&&(e.flags|=128,i=!0,Ax(o,!1),e.lanes=4194304);o.isBackwards?(r.sibling=e.child,e.child=r):(t=o.last,t!==null?t.sibling=r:e.child=r,o.last=r)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Hs(),e.sibling=null,t=ps.current,zn(ps,i?t&1|2:t&1),e):(Rr(e),null);case 22:case 23:return KK(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?El&1073741824&&(Rr(e),e.subtreeFlags&6&&(e.flags|=8192)):Rr(e),null;case 24:return null;case 25:return null}throw Error(je(156,e.tag))}function iLe(n,e){switch(IK(e),e.tag){case 1:return nl(e.type)&&CM(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return $y(),Yn(il),Yn($r),OK(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return PK(e),null;case 13:if(Yn(ps),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(je(340));zy()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Yn(ps),null;case 4:return $y(),null;case 10:return TK(e.type._context),null;case 22:case 23:return KK(),null;case 24:return null;default:return null}}var pT=!1,Br=!1,nLe=typeof WeakSet=="function"?WeakSet:Set,ft=null;function YC(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Ds(n,e,i)}else t.current=null}function xB(n,e,t){try{t()}catch(i){Ds(n,e,i)}}var ree=!1;function sLe(n,e){if(aB=_M,n=Ade(),LK(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var s=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var r=0,a=-1,l=-1,c=0,d=0,h=n,u=null;t:for(;;){for(var f;h!==t||s!==0&&h.nodeType!==3||(a=r+s),h!==o||i!==0&&h.nodeType!==3||(l=r+i),h.nodeType===3&&(r+=h.nodeValue.length),(f=h.firstChild)!==null;)u=h,h=f;for(;;){if(h===n)break t;if(u===t&&++c===s&&(a=r),u===o&&++d===i&&(l=r),(f=h.nextSibling)!==null)break;h=u,u=h.parentNode}h=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(lB={focusedElem:n,selectionRange:t},_M=!1,ft=e;ft!==null;)if(e=ft,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,ft=n;else for(;ft!==null;){e=ft;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,m=g.memoizedState,b=e.stateNode,v=b.getSnapshotBeforeUpdate(e.elementType===e.type?p:wd(e.type,p),m);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(je(163))}}catch(C){Ds(e,e.return,C)}if(n=e.sibling,n!==null){n.return=e.return,ft=n;break}ft=e.return}return g=ree,ree=!1,g}function tk(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&n)===n){var o=s.destroy;s.destroy=void 0,o!==void 0&&xB(e,t,o)}s=s.next}while(s!==i)}}function l5(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function LB(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function Dhe(n){var e=n.alternate;e!==null&&(n.alternate=null,Dhe(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Zh],delete e[MI],delete e[hB],delete e[Hxe],delete e[Vxe])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function The(n){return n.tag===5||n.tag===3||n.tag===4}function aee(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||The(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function kB(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=wM));else if(i!==4&&(n=n.child,n!==null))for(kB(n,e,t),n=n.sibling;n!==null;)kB(n,e,t),n=n.sibling}function IB(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(IB(n,e,t),n=n.sibling;n!==null;)IB(n,e,t),n=n.sibling}var rr=null,Sd=!1;function sp(n,e,t){for(t=t.child;t!==null;)Rhe(n,e,t),t=t.sibling}function Rhe(n,e,t){if(du&&typeof du.onCommitFiberUnmount=="function")try{du.onCommitFiberUnmount(e5,t)}catch{}switch(t.tag){case 5:Br||YC(t,e);case 6:var i=rr,s=Sd;rr=null,sp(n,e,t),rr=i,Sd=s,rr!==null&&(Sd?(n=rr,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):rr.removeChild(t.stateNode));break;case 18:rr!==null&&(Sd?(n=rr,t=t.stateNode,n.nodeType===8?W8(n.parentNode,t):n.nodeType===1&&W8(n,t),EI(n)):W8(rr,t.stateNode));break;case 4:i=rr,s=Sd,rr=t.stateNode.containerInfo,Sd=!0,sp(n,e,t),rr=i,Sd=s;break;case 0:case 11:case 14:case 15:if(!Br&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var o=s,r=o.destroy;o=o.tag,r!==void 0&&(o&2||o&4)&&xB(t,e,r),s=s.next}while(s!==i)}sp(n,e,t);break;case 1:if(!Br&&(YC(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Ds(t,e,a)}sp(n,e,t);break;case 21:sp(n,e,t);break;case 22:t.mode&1?(Br=(i=Br)||t.memoizedState!==null,sp(n,e,t),Br=i):sp(n,e,t);break;default:sp(n,e,t)}}function lee(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new nLe),e.forEach(function(i){var s=fLe.bind(null,n,i);t.has(i)||(t.add(i),i.then(s,s))})}}function dd(n,e){var t=e.deletions;if(t!==null)for(var i=0;i s&&(s=r),i&=~o}if(i=s,i=Hs()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*rLe(i/1960))-i,10n?16:n,Up===null)var i=!1;else{if(n=Up,Up=null,MM=0,zi&6)throw Error(je(331));var s=zi;for(zi|=4,ft=n.current;ft!==null;){var o=ft,r=o.child;if(ft.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l Hs()-UK?bv(n,0):$K|=t),sl(n,e)}function Hhe(n,e){e===0&&(n.mode&1?(e=rT,rT<<=1,!(rT&130023424)&&(rT=4194304)):e=1);var t=pa();n=pg(n,e),n!==null&&(UN(n,e,t),sl(n,t))}function uLe(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),Hhe(n,t)}function fLe(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,s=n.memoizedState;s!==null&&(t=s.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(je(314))}i!==null&&i.delete(e),Hhe(n,t)}var Vhe;Vhe=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||il.current)Xa=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Xa=!1,eLe(n,e,t);Xa=!!(n.flags&131072)}else Xa=!1,is&&e.flags&1048576&&Ude(e,xM,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;uR(n,e),n=e.pendingProps;var s=Vy(e,$r.current);K0(e,t),s=BK(null,e,i,n,s,t);var o=WK();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,nl(i)?(o=!0,yM(e)):o=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,MK(e),s.updater=a5,e.stateNode=s,s._reactInternals=e,_B(e,i,n,t),e=wB(null,e,i,!0,o,t)):(e.tag=0,is&&o&&kK(e),ra(null,e,s,t),e=e.child),e;case 16:i=e.elementType;e:{switch(uR(n,e),n=e.pendingProps,s=i._init,i=s(i._payload),e.type=i,s=e.tag=pLe(i),n=wd(i,n),s){case 0:e=vB(null,e,i,n,t);break e;case 1:e=nee(null,e,i,n,t);break e;case 11:e=tee(null,e,i,n,t);break e;case 14:e=iee(null,e,i,wd(i.type,n),t);break e}throw Error(je(306,i,""))}return e;case 0:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:wd(i,s),vB(n,e,i,s,t);case 1:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:wd(i,s),nee(n,e,i,s,t);case 3:e:{if(xhe(e),n===null)throw Error(je(387));i=e.pendingProps,o=e.memoizedState,s=o.element,Xde(n,e),IM(e,i,null,t);var r=e.memoizedState;if(i=r.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:r.cache,pendingSuspenseBoundaries:r.pendingSuspenseBoundaries,transitions:r.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){s=Uy(Error(je(423)),e),e=see(n,e,i,t,s);break e}else if(i!==s){s=Uy(Error(je(424)),e),e=see(n,e,i,t,s);break e}else for(jl=gm(e.stateNode.containerInfo.firstChild),Ul=e,is=!0,Ed=null,t=Yde(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(zy(),i===s){e=mg(n,e,t);break e}ra(n,e,i,t)}e=e.child}return e;case 5:return Qde(e),n===null&&gB(e),i=e.type,s=e.pendingProps,o=n!==null?n.memoizedProps:null,r=s.children,cB(i,s)?r=null:o!==null&&cB(i,o)&&(e.flags|=32),She(n,e),ra(n,e,r,t),e.child;case 6:return n===null&&gB(e),null;case 13:return Lhe(n,e,t);case 4:return AK(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=jy(e,null,i,t):ra(n,e,i,t),e.child;case 11:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:wd(i,s),tee(n,e,i,s,t);case 7:return ra(n,e,e.pendingProps,t),e.child;case 8:return ra(n,e,e.pendingProps.children,t),e.child;case 12:return ra(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,s=e.pendingProps,o=e.memoizedProps,r=s.value,zn(LM,i._currentValue),i._currentValue=r,o!==null)if(Zd(o.value,r)){if(o.children===s.children&&!il.current){e=mg(n,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){r=o.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=tg(-1,t&-t),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),pB(o.return,t,e),a.lanes|=t;break}l=l.next}}else if(o.tag===10)r=o.type===e.type?null:o.child;else if(o.tag===18){if(r=o.return,r===null)throw Error(je(341));r.lanes|=t,a=r.alternate,a!==null&&(a.lanes|=t),pB(r,t,e),r=o.sibling}else r=o.child;if(r!==null)r.return=o;else for(r=o;r!==null;){if(r===e){r=null;break}if(o=r.sibling,o!==null){o.return=r.return,r=o;break}r=r.return}o=r}ra(n,e,s.children,t),e=e.child}return e;case 9:return s=e.type,i=e.pendingProps.children,K0(e,t),s=qc(s),i=i(s),e.flags|=1,ra(n,e,i,t),e.child;case 14:return i=e.type,s=wd(i,e.pendingProps),s=wd(i.type,s),iee(n,e,i,s,t);case 15:return Che(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:wd(i,s),uR(n,e),e.tag=1,nl(i)?(n=!0,yM(e)):n=!1,K0(e,t),bhe(e,i,s),_B(e,i,s,t),wB(null,e,i,!0,n,t);case 19:return khe(n,e,t);case 22:return yhe(n,e,t)}throw Error(je(156,e.tag))};function zhe(n,e){return pde(n,e)}function gLe(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wc(n,e,t,i){return new gLe(n,e,t,i)}function YK(n){return n=n.prototype,!(!n||!n.isReactComponent)}function pLe(n){if(typeof n=="function")return YK(n)?1:0;if(n!=null){if(n=n.$$typeof,n===gK)return 11;if(n===pK)return 14}return 2}function bm(n,e){var t=n.alternate;return t===null?(t=Wc(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function pR(n,e,t,i,s,o){var r=2;if(i=n,typeof n=="function")YK(n)&&(r=1);else if(typeof n=="string")r=5;else e:switch(n){case HC:return vv(t.children,s,o,e);case fK:r=8,s|=8;break;case V6:return n=Wc(12,t,e,s|2),n.elementType=V6,n.lanes=o,n;case z6:return n=Wc(13,t,e,s),n.elementType=z6,n.lanes=o,n;case j6:return n=Wc(19,t,e,s),n.elementType=j6,n.lanes=o,n;case Qce:return d5(t,s,o,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Zce:r=10;break e;case Xce:r=9;break e;case gK:r=11;break e;case pK:r=14;break e;case Cp:r=16,i=null;break e}throw Error(je(130,n==null?n:typeof n,""))}return e=Wc(r,t,e,s),e.elementType=n,e.type=i,e.lanes=o,e}function vv(n,e,t,i){return n=Wc(7,n,i,e),n.lanes=t,n}function d5(n,e,t,i){return n=Wc(22,n,i,e),n.elementType=Qce,n.lanes=t,n.stateNode={isHidden:!1},n}function K8(n,e,t){return n=Wc(6,n,null,e),n.lanes=t,n}function G8(n,e,t){return e=Wc(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function mLe(n,e,t,i,s){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=E8(0),this.expirationTimes=E8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=E8(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ZK(n,e,t,i,s,o,r,a,l){return n=new mLe(n,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Wc(3,null,null,e),n.current=o,o.stateNode=n,o.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},MK(o),n}function _Le(n,e,t){var i=3 "u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qhe)}catch(n){console.error(n)}}qhe(),qce.exports=rc;var yLe=qce.exports,mee=yLe;W6.createRoot=mee.createRoot,W6.hydrateRoot=mee.hydrateRoot;function fo(n){if(typeof n=="string"||typeof n=="number")return""+n;let e="";if(Array.isArray(n))for(let t=0,i;t {}};function p5(){for(var n=0,e=arguments.length,t={},i;n =0&&(i=t.slice(s+1),t=t.slice(0,s)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}})}mR.prototype=p5.prototype={constructor:mR,on:function(n,e){var t=this._,i=xLe(n+"",t),s,o=-1,r=i.length;if(arguments.length<2){for(;++o 0)for(var t=new Array(s),i=0,s,o;i =0&&(e=n.slice(0,t))!=="xmlns"&&(n=n.slice(t+1)),bee.hasOwnProperty(e)?{space:bee[e],local:n}:n}function kLe(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===RB&&e.documentElement.namespaceURI===RB?e.createElement(n):e.createElementNS(t,n)}}function ILe(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Khe(n){var e=m5(n);return(e.local?ILe:kLe)(e)}function ELe(){}function eG(n){return n==null?ELe:function(){return this.querySelector(n)}}function NLe(n){typeof n!="function"&&(n=eG(n));for(var e=this._groups,t=e.length,i=new Array(t),s=0;s=w&&(w=v+1);!(S=m[w])&&++w =0;)(r=i[s])&&(o&&r.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(r,o),o=r);return this}function eke(n){n||(n=tke);function e(h,u){return h&&u?n(h.__data__,u.__data__):!h-!u}for(var t=this._groups,i=t.length,s=new Array(i),o=0;oe?1:n>=e?0:NaN}function ike(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function nke(){return Array.from(this)}function ske(){for(var n=this._groups,e=0,t=n.length;e 1?this.each((e==null?pke:typeof e=="function"?_ke:mke)(n,e,t??"")):Ky(this.node(),n)}function Ky(n,e){return n.style.getPropertyValue(e)||Qhe(n).getComputedStyle(n,null).getPropertyValue(e)}function vke(n){return function(){delete this[n]}}function wke(n,e){return function(){this[n]=e}}function Cke(n,e){return function(){var t=e.apply(this,arguments);t==null?delete this[n]:this[n]=t}}function yke(n,e){return arguments.length>1?this.each((e==null?vke:typeof e=="function"?Cke:wke)(n,e)):this.node()[n]}function Jhe(n){return n.trim().split(/^|\s+/)}function tG(n){return n.classList||new eue(n)}function eue(n){this._node=n,this._names=Jhe(n.getAttribute("class")||"")}eue.prototype={add:function(n){var e=this._names.indexOf(n);e<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function tue(n,e){for(var t=tG(n),i=-1,s=e.length;++i =0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}})}function Zke(n){return function(){var e=this.__on;if(e){for(var t=0,i=-1,s=e.length,o;t()=>n;function MB(n,{sourceEvent:e,subject:t,target:i,identifier:s,active:o,x:r,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:r,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}MB.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function rIe(n){return!n.ctrlKey&&!n.button}function aIe(){return this.parentNode}function lIe(n,e){return e??{x:n.x,y:n.y}}function cIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function aue(){var n=rIe,e=aIe,t=lIe,i=cIe,s={},o=p5("start","drag","end"),r=0,a,l,c,d,h=0;function u(C){C.on("mousedown.drag",f).filter(i).on("touchstart.drag",m).on("touchmove.drag",b,oIe).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(C,S){if(!(d||!n.call(this,C,S))){var L=w(this,e.call(this,C,S),C,S,"mouse");L&&(Pl(C.view).on("mousemove.drag",g,HI).on("mouseup.drag",p,HI),oue(C.view),Y8(C),c=!1,a=C.clientX,l=C.clientY,L("start",C))}}function g(C){if(Y0(C),!c){var S=C.clientX-a,L=C.clientY-l;c=S*S+L*L>h}s.mouse("drag",C)}function p(C){Pl(C.view).on("mousemove.drag mouseup.drag",null),rue(C.view,c),Y0(C),s.mouse("end",C)}function m(C,S){if(n.call(this,C,S)){var L=C.changedTouches,x=e.call(this,C,S),I=L.length,E,R;for(E=0;E>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?vT(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?vT(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=hIe.exec(n))?new Qa(e[1],e[2],e[3],1):(e=uIe.exec(n))?new Qa(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=fIe.exec(n))?vT(e[1],e[2],e[3],e[4]):(e=gIe.exec(n))?vT(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=pIe.exec(n))?Lee(e[1],e[2]/100,e[3]/100,1):(e=mIe.exec(n))?Lee(e[1],e[2]/100,e[3]/100,e[4]):vee.hasOwnProperty(n)?yee(vee[n]):n==="transparent"?new Qa(NaN,NaN,NaN,0):null}function yee(n){return new Qa(n>>16&255,n>>8&255,n&255,1)}function vT(n,e,t,i){return i<=0&&(n=e=t=NaN),new Qa(n,e,t,i)}function vIe(n){return n instanceof ZN||(n=H1(n)),n?(n=n.rgb(),new Qa(n.r,n.g,n.b,n.opacity)):new Qa}function AB(n,e,t,i){return arguments.length===1?vIe(n):new Qa(n,e,t,i??1)}function Qa(n,e,t,i){this.r=+n,this.g=+e,this.b=+t,this.opacity=+i}iG(Qa,AB,lue(ZN,{brighter(n){return n=n==null?FM:Math.pow(FM,n),new Qa(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?VI:Math.pow(VI,n),new Qa(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Qa(wv(this.r),wv(this.g),wv(this.b),BM(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:See,formatHex:See,formatHex8:wIe,formatRgb:xee,toString:xee}));function See(){return`#${ev(this.r)}${ev(this.g)}${ev(this.b)}`}function wIe(){return`#${ev(this.r)}${ev(this.g)}${ev(this.b)}${ev((isNaN(this.opacity)?1:this.opacity)*255)}`}function xee(){const n=BM(this.opacity);return`${n===1?"rgb(":"rgba("}${wv(this.r)}, ${wv(this.g)}, ${wv(this.b)}${n===1?")":`, ${n})`}`}function BM(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function wv(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function ev(n){return n=wv(n),(n<16?"0":"")+n.toString(16)}function Lee(n,e,t,i){return i<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Od(n,e,t,i)}function cue(n){if(n instanceof Od)return new Od(n.h,n.s,n.l,n.opacity);if(n instanceof ZN||(n=H1(n)),!n)return new Od;if(n instanceof Od)return n;n=n.rgb();var e=n.r/255,t=n.g/255,i=n.b/255,s=Math.min(e,t,i),o=Math.max(e,t,i),r=NaN,a=o-s,l=(o+s)/2;return a?(e===o?r=(t-i)/a+(t0&&l<1?0:r,new Od(r,a,l,n.opacity)}function CIe(n,e,t,i){return arguments.length===1?cue(n):new Od(n,e,t,i??1)}function Od(n,e,t,i){this.h=+n,this.s=+e,this.l=+t,this.opacity=+i}iG(Od,CIe,lue(ZN,{brighter(n){return n=n==null?FM:Math.pow(FM,n),new Od(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?VI:Math.pow(VI,n),new Od(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,s=2*t-i;return new Qa(Z8(n>=240?n-240:n+120,s,i),Z8(n,s,i),Z8(n<120?n+240:n-120,s,i),this.opacity)},clamp(){return new Od(kee(this.h),wT(this.s),wT(this.l),BM(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 n=BM(this.opacity);return`${n===1?"hsl(":"hsla("}${kee(this.h)}, ${wT(this.s)*100}%, ${wT(this.l)*100}%${n===1?")":`, ${n})`}`}}));function kee(n){return n=(n||0)%360,n<0?n+360:n}function wT(n){return Math.max(0,Math.min(1,n||0))}function Z8(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const nG=n=>()=>n;function yIe(n,e){return function(t){return n+t*e}}function SIe(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(i){return Math.pow(n+i*e,t)}}function xIe(n){return(n=+n)==1?due:function(e,t){return t-e?SIe(e,t,n):nG(isNaN(e)?t:e)}}function due(n,e){var t=e-n;return t?yIe(n,t):nG(isNaN(n)?e:n)}const WM=function n(e){var t=xIe(e);function i(s,o){var r=t((s=AB(s)).r,(o=AB(o)).r),a=t(s.g,o.g),l=t(s.b,o.b),c=due(s.opacity,o.opacity);return function(d){return s.r=r(d),s.g=a(d),s.b=l(d),s.opacity=c(d),s+""}}return i.gamma=n,i}(1);function LIe(n,e){e||(e=[]);var t=n?Math.min(e.length,n.length):0,i=e.slice(),s;return function(o){for(s=0;st&&(o=e.slice(t,o),a[r]?a[r]+=o:a[++r]=o),(i=i[0])===(s=s[0])?a[r]?a[r]+=s:a[++r]=s:(a[++r]=null,l.push({i:r,x:jh(i,s)})),t=X8.lastIndex;return t 180?d+=360:d-c>180&&(c+=360),u.push({i:h.push(s(h)+"rotate(",null,i)-2,x:jh(c,d)})):d&&h.push(s(h)+"rotate("+d+i)}function a(c,d,h,u){c!==d?u.push({i:h.push(s(h)+"skewX(",null,i)-2,x:jh(c,d)}):d&&h.push(s(h)+"skewX("+d+i)}function l(c,d,h,u,f,g){if(c!==h||d!==u){var p=f.push(s(f)+"scale(",null,",",null,")");g.push({i:p-4,x:jh(c,h)},{i:p-2,x:jh(d,u)})}else(h!==1||u!==1)&&f.push(s(f)+"scale("+h+","+u+")")}return function(c,d){var h=[],u=[];return c=n(c),d=n(d),o(c.translateX,c.translateY,d.translateX,d.translateY,h,u),r(c.rotate,d.rotate,h,u),a(c.skewX,d.skewX,h,u),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,h,u),c=d=null,function(f){for(var g=-1,p=u.length,m;++g =0&&n._call.call(void 0,e),n=n._next;--Gy}function Nee(){V1=(VM=jI.now())+_5,Gy=SL=0;try{HIe()}finally{Gy=0,zIe(),V1=0}}function VIe(){var n=jI.now(),e=n-VM;e>gue&&(_5-=e,VM=n)}function zIe(){for(var n,e=HM,t,i=1/0;e;)e._call?(i>e._time&&(i=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:HM=t);xL=n,FB(i)}function FB(n){if(!Gy){SL&&(SL=clearTimeout(SL));var e=n-V1;e>24?(n<1/0&&(SL=setTimeout(Nee,n-jI.now()-_5)),Ox&&(Ox=clearInterval(Ox))):(Ox||(VM=jI.now(),Ox=setInterval(VIe,gue)),Gy=1,pue(Nee))}}function Dee(n,e,t){var i=new zM;return e=e==null?0:+e,i.restart(s=>{i.stop(),n(s+e)},e,t),i}var jIe=p5("start","end","cancel","interrupt"),$Ie=[],_ue=0,Tee=1,BB=2,bR=3,Ree=4,WB=5,vR=6;function b5(n,e,t,i,s,o){var r=n.__transition;if(!r)n.__transition={};else if(t in r)return;UIe(n,t,{name:e,index:i,group:s,on:jIe,tween:$Ie,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:_ue})}function oG(n,e){var t=ah(n,e);if(t.state>_ue)throw new Error("too late; already scheduled");return t}function Du(n,e){var t=ah(n,e);if(t.state>bR)throw new Error("too late; already running");return t}function ah(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function UIe(n,e,t){var i=n.__transition,s;i[e]=t,t.timer=mue(o,0,t.time);function o(c){t.state=Tee,t.timer.restart(r,t.delay,t.time),t.delay<=c&&r(c-t.delay)}function r(c){var d,h,u,f;if(t.state!==Tee)return l();for(d in i)if(f=i[d],f.name===t.name){if(f.state===bR)return Dee(r);f.state===Ree?(f.state=vR,f.timer.stop(),f.on.call("interrupt",n,n.__data__,f.index,f.group),delete i[d]):+d
BB&&i.state =0&&(e=e.slice(0,t)),!e||e==="start"})}function CEe(n,e,t){var i,s,o=wEe(e)?oG:Du;return function(){var r=o(this,n),a=r.on;a!==i&&(s=(i=a).copy()).on(e,t),r.on=s}}function yEe(n,e){var t=this._id;return arguments.length<2?ah(this.node(),t).on.on(n):this.each(CEe(t,n,e))}function SEe(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}function xEe(){return this.on("end.remove",SEe(this._id))}function LEe(n){var e=this._name,t=this._id;typeof n!="function"&&(n=eG(n));for(var i=this._groups,s=i.length,o=new Array(s),r=0;r ()=>n;function ZEe(n,{sourceEvent:e,target:t,transform:i,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function Wf(n,e,t){this.k=n,this.x=e,this.y=t}Wf.prototype={constructor:Wf,scale:function(n){return n===1?this:new Wf(this.k*n,this.x,this.y)},translate:function(n,e){return n===0&e===0?this:new Wf(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var v5=new Wf(1,0,0);Cue.prototype=Wf.prototype;function Cue(n){for(;!n.__zoom;)if(!(n=n.parentNode))return v5;return n.__zoom}function Q8(n){n.stopImmediatePropagation()}function Fx(n){n.preventDefault(),n.stopImmediatePropagation()}function XEe(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function QEe(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function Mee(){return this.__zoom||v5}function JEe(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function eNe(){return navigator.maxTouchPoints||"ontouchstart"in this}function tNe(n,e,t){var i=n.invertX(e[0][0])-t[0][0],s=n.invertX(e[1][0])-t[1][0],o=n.invertY(e[0][1])-t[0][1],r=n.invertY(e[1][1])-t[1][1];return n.translate(s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s),r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r))}function yue(){var n=XEe,e=QEe,t=tNe,i=JEe,s=eNe,o=[0,1/0],r=[[-1/0,-1/0],[1/0,1/0]],a=250,l=_R,c=p5("start","zoom","end"),d,h,u,f=500,g=150,p=0,m=10;function b(P){P.property("__zoom",Mee).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",R).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(P,B,V,K){var z=P.selection?P.selection():P;z.property("__zoom",Mee),P!==z?S(P,B,V,K):z.interrupt().each(function(){L(this,arguments).event(K).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},b.scaleBy=function(P,B,V,K){b.scaleTo(P,function(){var z=this.__zoom.k,j=typeof B=="function"?B.apply(this,arguments):B;return z*j},V,K)},b.scaleTo=function(P,B,V,K){b.transform(P,function(){var z=e.apply(this,arguments),j=this.__zoom,X=V==null?C(z):typeof V=="function"?V.apply(this,arguments):V,Y=j.invert(X),te=typeof B=="function"?B.apply(this,arguments):B;return t(w(v(j,te),X,Y),z,r)},V,K)},b.translateBy=function(P,B,V,K){b.transform(P,function(){return t(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof V=="function"?V.apply(this,arguments):V),e.apply(this,arguments),r)},null,K)},b.translateTo=function(P,B,V,K,z){b.transform(P,function(){var j=e.apply(this,arguments),X=this.__zoom,Y=K==null?C(j):typeof K=="function"?K.apply(this,arguments):K;return t(v5.translate(Y[0],Y[1]).scale(X.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof V=="function"?-V.apply(this,arguments):-V),j,r)},K,z)};function v(P,B){return B=Math.max(o[0],Math.min(o[1],B)),B===P.k?P:new Wf(B,P.x,P.y)}function w(P,B,V){var K=B[0]-V[0]*P.k,z=B[1]-V[1]*P.k;return K===P.x&&z===P.y?P:new Wf(P.k,K,z)}function C(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function S(P,B,V,K){P.on("start.zoom",function(){L(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(K).end()}).tween("zoom",function(){var z=this,j=arguments,X=L(z,j).event(K),Y=e.apply(z,j),te=V==null?C(Y):typeof V=="function"?V.apply(z,j):V,ce=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),Ce=z.__zoom,xe=typeof B=="function"?B.apply(z,j):B,Be=l(Ce.invert(te).concat(ce/Ce.k),xe.invert(te).concat(ce/xe.k));return function(Ee){if(Ee===1)Ee=xe;else{var Le=Be(Ee),ze=ce/Le[2];Ee=new Wf(ze,te[0]-Le[0]*ze,te[1]-Le[1]*ze)}X.zoom(null,Ee)}})}function L(P,B,V){return!V&&P.__zooming||new x(P,B)}function x(P,B){this.that=P,this.args=B,this.active=0,this.sourceEvent=null,this.extent=e.apply(P,B),this.taps=0}x.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,B){return this.mouse&&P!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var B=Pl(this.that).datum();c.call(P,this.that,new ZEe(P,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:c}),B)}};function I(P,...B){if(!n.apply(this,arguments))return;var V=L(this,B).event(P),K=this.__zoom,z=Math.max(o[0],Math.min(o[1],K.k*Math.pow(2,i.apply(this,arguments)))),j=xd(P);if(V.wheel)(V.mouse[0][0]!==j[0]||V.mouse[0][1]!==j[1])&&(V.mouse[1]=K.invert(V.mouse[0]=j)),clearTimeout(V.wheel);else{if(K.k===z)return;V.mouse=[j,K.invert(j)],wR(this),V.start()}Fx(P),V.wheel=setTimeout(X,g),V.zoom("mouse",t(w(v(K,z),V.mouse[0],V.mouse[1]),V.extent,r));function X(){V.wheel=null,V.end()}}function E(P,...B){if(u||!n.apply(this,arguments))return;var V=P.currentTarget,K=L(this,B,!0).event(P),z=Pl(P.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",ce,!0),j=xd(P,V),X=P.clientX,Y=P.clientY;oue(P.view),Q8(P),K.mouse=[j,this.__zoom.invert(j)],wR(this),K.start();function te(Ce){if(Fx(Ce),!K.moved){var xe=Ce.clientX-X,Be=Ce.clientY-Y;K.moved=xe*xe+Be*Be>p}K.event(Ce).zoom("mouse",t(w(K.that.__zoom,K.mouse[0]=xd(Ce,V),K.mouse[1]),K.extent,r))}function ce(Ce){z.on("mousemove.zoom mouseup.zoom",null),rue(Ce.view,K.moved),Fx(Ce),K.event(Ce).end()}}function R(P,...B){if(n.apply(this,arguments)){var V=this.__zoom,K=xd(P.changedTouches?P.changedTouches[0]:P,this),z=V.invert(K),j=V.k*(P.shiftKey?.5:2),X=t(w(v(V,j),K,z),e.apply(this,B),r);Fx(P),a>0?Pl(this).transition().duration(a).call(S,X,K,P):Pl(this).call(b.transform,X,K,P)}}function M(P,...B){if(n.apply(this,arguments)){var V=P.touches,K=V.length,z=L(this,B,P.changedTouches.length===K).event(P),j,X,Y,te;for(Q8(P),X=0;X"[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:n=>`Node type "${n}" 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:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,{id:e,sourceHandle:t,targetHandle:i})=>`Couldn't create edge for ${n} handle id: "${n==="source"?t:i}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(n="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${n}/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."},$I=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Sue=["Enter"," ","Escape"],xue={"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:n,x:e,y:t})=>`Moved selected node ${n}. New position, x: ${e}, y: ${t}`,"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 Yy;(function(n){n.Strict="strict",n.Loose="loose"})(Yy||(Yy={}));var Cv;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(Cv||(Cv={}));var UI;(function(n){n.Partial="partial",n.Full="full"})(UI||(UI={}));const Lue={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Df;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Df||(Df={}));var z1;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(z1||(z1={}));var Nt;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(Nt||(Nt={}));const Aee={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function kue(n){return n===null?null:n?"valid":"invalid"}const Iue=n=>"id"in n&&"source"in n&&"target"in n,iNe=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),aG=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),XN=(n,e=[0,0])=>{const{width:t,height:i}=Wg(n),s=n.origin??e,o=t*s[0],r=i*s[1];return{x:n.position.x-o,y:n.position.y-r}},nNe=(n,e={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const t=n.reduce((i,s)=>{const o=typeof s=="string";let r=!e.nodeLookup&&!o?s:void 0;e.nodeLookup&&(r=o?e.nodeLookup.get(s):aG(s)?s:e.nodeLookup.get(s.id));const a=r?jM(r,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return w5(i,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return C5(t)},QN=(n,e={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return n.forEach(s=>{(e.filter===void 0||e.filter(s))&&(t=w5(t,jM(s)),i=!0)}),i?C5(t):{x:0,y:0,width:0,height:0}},lG=(n,e,[t,i,s]=[0,0,1],o=!1,r=!1)=>{const a={...eD(e,[t,i,s]),width:e.width/s,height:e.height/s},l=[];for(const c of n.values()){const{measured:d,selectable:h=!0,hidden:u=!1}=c;if(r&&!h||u)continue;const f=d.width??c.width??c.initialWidth??null,g=d.height??c.height??c.initialHeight??null,p=qI(a,Xy(c)),m=(f??0)*(g??0),b=o&&p>0;(!c.internals.handleBounds||b||p>=m||c.dragging)&&l.push(c)}return l},sNe=(n,e)=>{const t=new Set;return n.forEach(i=>{t.add(i.id)}),e.filter(i=>t.has(i.source)||t.has(i.target))};function oNe(n,e){const t=new Map,i=e!=null&&e.nodes?new Set(e.nodes.map(s=>s.id)):null;return n.forEach(s=>{s.measured.width&&s.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!s.hidden)&&(!i||i.has(s.id))&&t.set(s.id,s)}),t}async function rNe({nodes:n,width:e,height:t,panZoom:i,minZoom:s,maxZoom:o},r){if(n.size===0)return Promise.resolve(!0);const a=oNe(n,r),l=QN(a),c=cG(l,e,t,(r==null?void 0:r.minZoom)??s,(r==null?void 0:r.maxZoom)??o,(r==null?void 0:r.padding)??.1);return await i.setViewport(c,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)}function Eue({nodeId:n,nextPosition:e,nodeLookup:t,nodeOrigin:i=[0,0],nodeExtent:s,onError:o}){const r=t.get(n),a=r.parentId?t.get(r.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},d=r.origin??i;let h=r.extent||s;if(r.extent==="parent"&&!r.expandParent)if(!a)o==null||o("005",bu.error005());else{const f=a.measured.width,g=a.measured.height;f&&g&&(h=[[l,c],[l+f,c+g]])}else a&&Qy(r.extent)&&(h=[[r.extent[0][0]+l,r.extent[0][1]+c],[r.extent[1][0]+l,r.extent[1][1]+c]]);const u=Qy(h)?j1(e,h,r.measured):e;return(r.measured.width===void 0||r.measured.height===void 0)&&(o==null||o("015",bu.error015())),{position:{x:u.x-l+(r.measured.width??0)*d[0],y:u.y-c+(r.measured.height??0)*d[1]},positionAbsolute:u}}async function aNe({nodesToRemove:n=[],edgesToRemove:e=[],nodes:t,edges:i,onBeforeDelete:s}){const o=new Set(n.map(u=>u.id)),r=[];for(const u of t){if(u.deletable===!1)continue;const f=o.has(u.id),g=!f&&u.parentId&&r.find(p=>p.id===u.parentId);(f||g)&&r.push(u)}const a=new Set(e.map(u=>u.id)),l=i.filter(u=>u.deletable!==!1),d=sNe(r,l);for(const u of l)a.has(u.id)&&!d.find(g=>g.id===u.id)&&d.push(u);if(!s)return{edges:d,nodes:r};const h=await s({nodes:r,edges:d});return typeof h=="boolean"?h?{edges:d,nodes:r}:{edges:[],nodes:[]}:h}const Zy=(n,e=0,t=1)=>Math.min(Math.max(n,e),t),j1=(n={x:0,y:0},e,t)=>({x:Zy(n.x,e[0][0],e[1][0]-((t==null?void 0:t.width)??0)),y:Zy(n.y,e[0][1],e[1][1]-((t==null?void 0:t.height)??0))});function Nue(n,e,t){const{width:i,height:s}=Wg(t),{x:o,y:r}=t.internals.positionAbsolute;return j1(n,[[o,r],[o+i,r+s]],e)}const Pee=(n,e,t)=>n t?-Zy(Math.abs(n-t),1,e)/e:0,Due=(n,e,t=15,i=40)=>{const s=Pee(n.x,i,e.width-i)*t,o=Pee(n.y,i,e.height-i)*t;return[s,o]},w5=(n,e)=>({x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}),HB=({x:n,y:e,width:t,height:i})=>({x:n,y:e,x2:n+t,y2:e+i}),C5=({x:n,y:e,x2:t,y2:i})=>({x:n,y:e,width:t-n,height:i-e}),Xy=(n,e=[0,0])=>{var s,o;const{x:t,y:i}=aG(n)?n.internals.positionAbsolute:XN(n,e);return{x:t,y:i,width:((s=n.measured)==null?void 0:s.width)??n.width??n.initialWidth??0,height:((o=n.measured)==null?void 0:o.height)??n.height??n.initialHeight??0}},jM=(n,e=[0,0])=>{var s,o;const{x:t,y:i}=aG(n)?n.internals.positionAbsolute:XN(n,e);return{x:t,y:i,x2:t+(((s=n.measured)==null?void 0:s.width)??n.width??n.initialWidth??0),y2:i+(((o=n.measured)==null?void 0:o.height)??n.height??n.initialHeight??0)}},Tue=(n,e)=>C5(w5(HB(n),HB(e))),qI=(n,e)=>{const t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),i=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return Math.ceil(t*i)},Oee=n=>Bd(n.width)&&Bd(n.height)&&Bd(n.x)&&Bd(n.y),Bd=n=>!isNaN(n)&&isFinite(n),lNe=(n,e)=>{},JN=(n,e=[1,1])=>({x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}),eD=({x:n,y:e},[t,i,s],o=!1,r=[1,1])=>{const a={x:(n-t)/s,y:(e-i)/s};return o?JN(a,r):a},$M=({x:n,y:e},[t,i,s])=>({x:n*s+t,y:e*s+i});function nC(n,e){if(typeof n=="number")return Math.floor((e-e/(1+n))*.5);if(typeof n=="string"&&n.endsWith("px")){const t=parseFloat(n);if(!Number.isNaN(t))return Math.floor(t)}if(typeof n=="string"&&n.endsWith("%")){const t=parseFloat(n);if(!Number.isNaN(t))return Math.floor(e*t*.01)}return console.error(`[React Flow] The padding value "${n}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function cNe(n,e,t){if(typeof n=="string"||typeof n=="number"){const i=nC(n,t),s=nC(n,e);return{top:i,right:s,bottom:i,left:s,x:s*2,y:i*2}}if(typeof n=="object"){const i=nC(n.top??n.y??0,t),s=nC(n.bottom??n.y??0,t),o=nC(n.left??n.x??0,e),r=nC(n.right??n.x??0,e);return{top:i,right:r,bottom:s,left:o,x:o+r,y:i+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function dNe(n,e,t,i,s,o){const{x:r,y:a}=$M(n,[e,t,i]),{x:l,y:c}=$M({x:n.x+n.width,y:n.y+n.height},[e,t,i]),d=s-l,h=o-c;return{left:Math.floor(r),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(h)}}const cG=(n,e,t,i,s,o)=>{const r=cNe(o,e,t),a=(e-r.x)/n.width,l=(t-r.y)/n.height,c=Math.min(a,l),d=Zy(c,i,s),h=n.x+n.width/2,u=n.y+n.height/2,f=e/2-h*d,g=t/2-u*d,p=dNe(n,f,g,d,e,t),m={left:Math.min(p.left-r.left,0),top:Math.min(p.top-r.top,0),right:Math.min(p.right-r.right,0),bottom:Math.min(p.bottom-r.bottom,0)};return{x:f-m.left+m.right,y:g-m.top+m.bottom,zoom:d}},KI=()=>{var n;return typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)==null?void 0:n.indexOf("Mac"))>=0};function Qy(n){return n!=null&&n!=="parent"}function Wg(n){var e,t;return{width:((e=n.measured)==null?void 0:e.width)??n.width??n.initialWidth??0,height:((t=n.measured)==null?void 0:t.height)??n.height??n.initialHeight??0}}function Rue(n){var e,t;return(((e=n.measured)==null?void 0:e.width)??n.width??n.initialWidth)!==void 0&&(((t=n.measured)==null?void 0:t.height)??n.height??n.initialHeight)!==void 0}function Mue(n,e={width:0,height:0},t,i,s){const o={...n},r=i.get(t);if(r){const a=r.origin||s;o.x+=r.internals.positionAbsolute.x-(e.width??0)*a[0],o.y+=r.internals.positionAbsolute.y-(e.height??0)*a[1]}return o}function Fee(n,e){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}function hNe(){let n,e;return{promise:new Promise((i,s)=>{n=i,e=s}),resolve:n,reject:e}}function uNe(n){return{...xue,...n||{}}}function ok(n,{snapGrid:e=[0,0],snapToGrid:t=!1,transform:i,containerBounds:s}){const{x:o,y:r}=Wd(n),a=eD({x:o-((s==null?void 0:s.left)??0),y:r-((s==null?void 0:s.top)??0)},i),{x:l,y:c}=t?JN(a,e):a;return{xSnapped:l,ySnapped:c,...a}}const dG=n=>({width:n.offsetWidth,height:n.offsetHeight}),Aue=n=>{var e;return((e=n==null?void 0:n.getRootNode)==null?void 0:e.call(n))||(window==null?void 0:window.document)},fNe=["INPUT","SELECT","TEXTAREA"];function Pue(n){var i,s;const e=((s=(i=n.composedPath)==null?void 0:i.call(n))==null?void 0:s[0])||n.target;return(e==null?void 0:e.nodeType)!==1?!1:fNe.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const Oue=n=>"clientX"in n,Wd=(n,e)=>{var o,r;const t=Oue(n),i=t?n.clientX:(o=n.touches)==null?void 0:o[0].clientX,s=t?n.clientY:(r=n.touches)==null?void 0:r[0].clientY;return{x:i-((e==null?void 0:e.left)??0),y:s-((e==null?void 0:e.top)??0)}},Bee=(n,e,t,i,s)=>{const o=e.querySelectorAll(`.${n}`);return!o||!o.length?null:Array.from(o).map(r=>{const a=r.getBoundingClientRect();return{id:r.getAttribute("data-handleid"),type:n,nodeId:s,position:r.getAttribute("data-handlepos"),x:(a.left-t.left)/i,y:(a.top-t.top)/i,...dG(r)}})};function Fue({sourceX:n,sourceY:e,targetX:t,targetY:i,sourceControlX:s,sourceControlY:o,targetControlX:r,targetControlY:a}){const l=n*.125+s*.375+r*.375+t*.125,c=e*.125+o*.375+a*.375+i*.125,d=Math.abs(l-n),h=Math.abs(c-e);return[l,c,d,h]}function ST(n,e){return n>=0?.5*n:e*25*Math.sqrt(-n)}function Wee({pos:n,x1:e,y1:t,x2:i,y2:s,c:o}){switch(n){case Nt.Left:return[e-ST(e-i,o),t];case Nt.Right:return[e+ST(i-e,o),t];case Nt.Top:return[e,t-ST(t-s,o)];case Nt.Bottom:return[e,t+ST(s-t,o)]}}function Bue({sourceX:n,sourceY:e,sourcePosition:t=Nt.Bottom,targetX:i,targetY:s,targetPosition:o=Nt.Top,curvature:r=.25}){const[a,l]=Wee({pos:t,x1:n,y1:e,x2:i,y2:s,c:r}),[c,d]=Wee({pos:o,x1:i,y1:s,x2:n,y2:e,c:r}),[h,u,f,g]=Fue({sourceX:n,sourceY:e,targetX:i,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${n},${e} C${a},${l} ${c},${d} ${i},${s}`,h,u,f,g]}function Wue({sourceX:n,sourceY:e,targetX:t,targetY:i}){const s=Math.abs(t-n)/2,o=t 0}const mNe=({source:n,sourceHandle:e,target:t,targetHandle:i})=>`xy-edge__${n}${e||""}-${t}${i||""}`,_Ne=(n,e)=>e.some(t=>t.source===n.source&&t.target===n.target&&(t.sourceHandle===n.sourceHandle||!t.sourceHandle&&!n.sourceHandle)&&(t.targetHandle===n.targetHandle||!t.targetHandle&&!n.targetHandle)),bNe=(n,e,t={})=>{if(!n.source||!n.target)return e;const i=t.getEdgeId||mNe;let s;return Iue(n)?s={...n}:s={...n,id:i(n)},_Ne(s,e)?e:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,e.concat(s))};function Hue({sourceX:n,sourceY:e,targetX:t,targetY:i}){const[s,o,r,a]=Wue({sourceX:n,sourceY:e,targetX:t,targetY:i});return[`M ${n},${e}L ${t},${i}`,s,o,r,a]}const Hee={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},vNe=({source:n,sourcePosition:e=Nt.Bottom,target:t})=>e===Nt.Left||e===Nt.Right?n.x Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2));function wNe({source:n,sourcePosition:e=Nt.Bottom,target:t,targetPosition:i=Nt.Top,center:s,offset:o,stepPosition:r}){const a=Hee[e],l=Hee[i],c={x:n.x+a.x*o,y:n.y+a.y*o},d={x:t.x+l.x*o,y:t.y+l.y*o},h=vNe({source:c,sourcePosition:e,target:d}),u=h.x!==0?"x":"y",f=h[u];let g=[],p,m;const b={x:0,y:0},v={x:0,y:0},[,,w,C]=Wue({sourceX:n.x,sourceY:n.y,targetX:t.x,targetY:t.y});if(a[u]*l[u]===-1){u==="x"?(p=s.x??c.x+(d.x-c.x)*r,m=s.y??(c.y+d.y)/2):(p=s.x??(c.x+d.x)/2,m=s.y??c.y+(d.y-c.y)*r);const L=[{x:p,y:c.y},{x:p,y:d.y}],x=[{x:c.x,y:m},{x:d.x,y:m}];a[u]===f?g=u==="x"?L:x:g=u==="x"?x:L}else{const L=[{x:c.x,y:d.y}],x=[{x:d.x,y:c.y}];if(u==="x"?g=a.x===f?x:L:g=a.y===f?L:x,e===i){const A=Math.abs(n[u]-t[u]);if(A<=o){const W=Math.min(o-1,o-A);a[u]===f?b[u]=(c[u]>n[u]?-1:1)*W:v[u]=(d[u]>t[u]?-1:1)*W}}if(e!==i){const A=u==="x"?"y":"x",W=a[u]===l[A],P=c[A]>d[A],B=c[A] =M?(p=(I.x+E.x)/2,m=g[0].y):(p=g[0].x,m=(I.y+E.y)/2)}return[[n,{x:c.x+b.x,y:c.y+b.y},...g,{x:d.x+v.x,y:d.y+v.y},t],p,m,w,C]}function CNe(n,e,t,i){const s=Math.min(Vee(n,e)/2,Vee(e,t)/2,i),{x:o,y:r}=e;if(n.x===o&&o===t.x||n.y===r&&r===t.y)return`L${o} ${r}`;if(n.y===r){const c=n.x {let C="";return w>0&&w t.id===e):n[0])||null}function zB(n,e){return n?typeof n=="string"?n:`${e?`${e}__`:""}${Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join("&")}`:""}function SNe(n,{id:e,defaultColor:t,defaultMarkerStart:i,defaultMarkerEnd:s}){const o=new Set;return n.reduce((r,a)=>([a.markerStart||i,a.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const c=zB(l,e);o.has(c)||(r.push({id:c,color:l.color||t,...l}),o.add(c))}}),r),[]).sort((r,a)=>r.id.localeCompare(a.id))}const Vue=1e3,xNe=10,hG={nodeOrigin:[0,0],nodeExtent:$I,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},LNe={...hG,checkEquality:!0};function uG(n,e){const t={...n};for(const i in e)e[i]!==void 0&&(t[i]=e[i]);return t}function kNe(n,e,t){const i=uG(hG,t);for(const s of n.values())if(s.parentId)gG(s,n,e,i);else{const o=XN(s,i.nodeOrigin),r=Qy(s.extent)?s.extent:i.nodeExtent,a=j1(o,r,Wg(s));s.internals.positionAbsolute=a}}function INe(n,e){if(!n.handles)return n.measured?e==null?void 0:e.internals.handleBounds:void 0;const t=[],i=[];for(const s of n.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:n.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(o):s.type==="target"&&i.push(o)}return{source:t,target:i}}function fG(n){return n==="manual"}function jB(n,e,t,i={}){var c,d;const s=uG(LNe,i),o={i:0},r=new Map(e),a=s!=null&&s.elevateNodesOnSelect&&!fG(s.zIndexMode)?Vue:0;let l=n.length>0;e.clear(),t.clear();for(const h of n){let u=r.get(h.id);if(s.checkEquality&&h===(u==null?void 0:u.internals.userNode))e.set(h.id,u);else{const f=XN(h,s.nodeOrigin),g=Qy(h.extent)?h.extent:s.nodeExtent,p=j1(f,g,Wg(h));u={...s.defaults,...h,measured:{width:(c=h.measured)==null?void 0:c.width,height:(d=h.measured)==null?void 0:d.height},internals:{positionAbsolute:p,handleBounds:INe(h,u),z:zue(h,a,s.zIndexMode),userNode:h}},e.set(h.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(l=!1),h.parentId&&gG(u,e,t,i,o)}return l}function ENe(n,e){if(!n.parentId)return;const t=e.get(n.parentId);t?t.set(n.id,n):e.set(n.parentId,new Map([[n.id,n]]))}function gG(n,e,t,i,s){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:a,zIndexMode:l}=uG(hG,i),c=n.parentId,d=e.get(c);if(!d){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}ENe(n,t),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*xNe),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const h=o&&!fG(l)?Vue:0,{x:u,y:f,z:g}=NNe(n,d,r,a,h,l),{positionAbsolute:p}=n.internals,m=u!==p.x||f!==p.y;(m||g!==n.internals.z)&&e.set(n.id,{...n,internals:{...n.internals,positionAbsolute:m?{x:u,y:f}:p,z:g}})}function zue(n,e,t){const i=Bd(n.zIndex)?n.zIndex:0;return fG(t)?i:i+(n.selected?e:0)}function NNe(n,e,t,i,s,o){const{x:r,y:a}=e.internals.positionAbsolute,l=Wg(n),c=XN(n,t),d=Qy(n.extent)?j1(c,n.extent,l):c;let h=j1({x:r+d.x,y:a+d.y},i,l);n.extent==="parent"&&(h=Nue(h,l,e));const u=zue(n,s,o),f=e.internals.z??0;return{x:h.x,y:h.y,z:f>=u?f+1:u}}function pG(n,e,t,i=[0,0]){var r;const s=[],o=new Map;for(const a of n){const l=e.get(a.parentId);if(!l)continue;const c=((r=o.get(a.parentId))==null?void 0:r.expandedRect)??Xy(l),d=Tue(c,a.rect);o.set(a.parentId,{expandedRect:d,parent:l})}return o.size>0&&o.forEach(({expandedRect:a,parent:l},c)=>{var w;const d=l.internals.positionAbsolute,h=Wg(l),u=l.origin??i,f=a.x 0||g>0||b||v)&&(s.push({id:c,type:"position",position:{x:l.position.x-f+b,y:l.position.y-g+v}}),(w=t.get(c))==null||w.forEach(C=>{n.some(S=>S.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+f,y:C.position.y+g}})})),(h.width 0){const f=pG(u,e,t,s);c.push(...f)}return{changes:c,updatedInternals:l}}async function TNe({delta:n,panZoom:e,transform:t,translateExtent:i,width:s,height:o}){if(!e||!n.x&&!n.y)return Promise.resolve(!1);const r=await e.setViewportConstrained({x:t[0]+n.x,y:t[1]+n.y,zoom:t[2]},[[0,0],[s,o]],i),a=!!r&&(r.x!==t[0]||r.y!==t[1]||r.k!==t[2]);return Promise.resolve(a)}function Uee(n,e,t,i,s,o){let r=s;const a=i.get(r)||new Map;i.set(r,a.set(t,e)),r=`${s}-${n}`;const l=i.get(r)||new Map;if(i.set(r,l.set(t,e)),o){r=`${s}-${n}-${o}`;const c=i.get(r)||new Map;i.set(r,c.set(t,e))}}function jue(n,e,t){n.clear(),e.clear();for(const i of t){const{source:s,target:o,sourceHandle:r=null,targetHandle:a=null}=i,l={edgeId:i.id,source:s,target:o,sourceHandle:r,targetHandle:a},c=`${s}-${r}--${o}-${a}`,d=`${o}-${a}--${s}-${r}`;Uee("source",l,d,n,s,r),Uee("target",l,c,n,o,a),e.set(i.id,i)}}function $ue(n,e){if(!n.parentId)return!1;const t=e.get(n.parentId);return t?t.selected?!0:$ue(t,e):!1}function qee(n,e,t){var s;let i=n;do{if((s=i==null?void 0:i.matches)!=null&&s.call(i,e))return!0;if(i===t)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function RNe(n,e,t,i){const s=new Map;for(const[o,r]of n)if((r.selected||r.id===i)&&(!r.parentId||!$ue(r,n))&&(r.draggable||e&&typeof r.draggable>"u")){const a=n.get(o);a&&s.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:t.x-a.internals.positionAbsolute.x,y:t.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return s}function J8({nodeId:n,dragItems:e,nodeLookup:t,dragging:i=!0}){var r,a,l;const s=[];for(const[c,d]of e){const h=(r=t.get(c))==null?void 0:r.internals.userNode;h&&s.push({...h,position:d.position,dragging:i})}if(!n)return[s[0],s];const o=(a=t.get(n))==null?void 0:a.internals.userNode;return[o?{...o,position:((l=e.get(n))==null?void 0:l.position)||o.position,dragging:i}:s[0],s]}function MNe({dragItems:n,snapGrid:e,x:t,y:i}){const s=n.values().next().value;if(!s)return null;const o={x:t-s.distance.x,y:i-s.distance.y},r=JN(o,e);return{x:r.x-o.x,y:r.y-o.y}}function ANe({onNodeMouseDown:n,getStoreItems:e,onDragStart:t,onDrag:i,onDragStop:s}){let o={x:null,y:null},r=0,a=new Map,l=!1,c={x:0,y:0},d=null,h=!1,u=null,f=!1,g=!1,p=null;function m({noDragClassName:v,handleSelector:w,domNode:C,isSelectable:S,nodeId:L,nodeClickDistance:x=0}){u=Pl(C);function I({x:A,y:W}){const{nodeLookup:P,nodeExtent:B,snapGrid:V,snapToGrid:K,nodeOrigin:z,onNodeDrag:j,onSelectionDrag:X,onError:Y,updateNodePositions:te}=e();o={x:A,y:W};let ce=!1;const Ce=a.size>1,xe=Ce&&B?HB(QN(a)):null,Be=Ce&&K?MNe({dragItems:a,snapGrid:V,x:A,y:W}):null;for(const[Ee,Le]of a){if(!P.has(Ee))continue;let ze={x:A-Le.distance.x,y:W-Le.distance.y};K&&(ze=Be?{x:Math.round(ze.x+Be.x),y:Math.round(ze.y+Be.y)}:JN(ze,V));let Ct=null;if(Ce&&B&&!Le.extent&&xe){const{positionAbsolute:tt}=Le.internals,_t=tt.x-xe.x+B[0][0],yi=tt.x+Le.measured.width-xe.x2+B[1][0],Pt=tt.y-xe.y+B[0][1],Cn=tt.y+Le.measured.height-xe.y2+B[1][1];Ct=[[_t,Pt],[yi,Cn]]}const{position:ct,positionAbsolute:Ue}=Eue({nodeId:Ee,nextPosition:ze,nodeLookup:P,nodeExtent:Ct||B,nodeOrigin:z,onError:Y});ce=ce||Le.position.x!==ct.x||Le.position.y!==ct.y,Le.position=ct,Le.internals.positionAbsolute=Ue}if(g=g||ce,!!ce&&(te(a,!0),p&&(i||j||!L&&X))){const[Ee,Le]=J8({nodeId:L,dragItems:a,nodeLookup:P});i==null||i(p,a,Ee,Le),j==null||j(p,Ee,Le),L||X==null||X(p,Le)}}async function E(){if(!d)return;const{transform:A,panBy:W,autoPanSpeed:P,autoPanOnNodeDrag:B}=e();if(!B){l=!1,cancelAnimationFrame(r);return}const[V,K]=Due(c,d,P);(V!==0||K!==0)&&(o.x=(o.x??0)-V/A[2],o.y=(o.y??0)-K/A[2],await W({x:V,y:K})&&I(o)),r=requestAnimationFrame(E)}function R(A){var Ce;const{nodeLookup:W,multiSelectionActive:P,nodesDraggable:B,transform:V,snapGrid:K,snapToGrid:z,selectNodesOnDrag:j,onNodeDragStart:X,onSelectionDragStart:Y,unselectNodesAndEdges:te}=e();h=!0,(!j||!S)&&!P&&L&&((Ce=W.get(L))!=null&&Ce.selected||te()),S&&j&&L&&(n==null||n(L));const ce=ok(A.sourceEvent,{transform:V,snapGrid:K,snapToGrid:z,containerBounds:d});if(o=ce,a=RNe(W,B,ce,L),a.size>0&&(t||X||!L&&Y)){const[xe,Be]=J8({nodeId:L,dragItems:a,nodeLookup:W});t==null||t(A.sourceEvent,a,xe,Be),X==null||X(A.sourceEvent,xe,Be),L||Y==null||Y(A.sourceEvent,Be)}}const M=aue().clickDistance(x).on("start",A=>{const{domNode:W,nodeDragThreshold:P,transform:B,snapGrid:V,snapToGrid:K}=e();d=(W==null?void 0:W.getBoundingClientRect())||null,f=!1,g=!1,p=A.sourceEvent,P===0&&R(A),o=ok(A.sourceEvent,{transform:B,snapGrid:V,snapToGrid:K,containerBounds:d}),c=Wd(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:W,transform:P,snapGrid:B,snapToGrid:V,nodeDragThreshold:K,nodeLookup:z}=e(),j=ok(A.sourceEvent,{transform:P,snapGrid:B,snapToGrid:V,containerBounds:d});if(p=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||L&&!z.has(L))&&(f=!0),!f){if(!l&&W&&h&&(l=!0,E()),!h){const X=Wd(A.sourceEvent,d),Y=X.x-c.x,te=X.y-c.y;Math.sqrt(Y*Y+te*te)>K&&R(A)}(o.x!==j.xSnapped||o.y!==j.ySnapped)&&a&&h&&(c=Wd(A.sourceEvent,d),I(j))}}).on("end",A=>{if(!(!h||f)&&(l=!1,h=!1,cancelAnimationFrame(r),a.size>0)){const{nodeLookup:W,updateNodePositions:P,onNodeDragStop:B,onSelectionDragStop:V}=e();if(g&&(P(a,!1),g=!1),s||B||!L&&V){const[K,z]=J8({nodeId:L,dragItems:a,nodeLookup:W,dragging:!1});s==null||s(A.sourceEvent,a,K,z),B==null||B(A.sourceEvent,K,z),L||V==null||V(A.sourceEvent,z)}}}).filter(A=>{const W=A.target;return!A.button&&(!v||!qee(W,`.${v}`,C))&&(!w||qee(W,w,C))});u.call(M)}function b(){u==null||u.on(".drag",null)}return{update:m,destroy:b}}function PNe(n,e,t){const i=[],s={x:n.x-t,y:n.y-t,width:t*2,height:t*2};for(const o of e.values())qI(s,Xy(o))>0&&i.push(o);return i}const ONe=250;function FNe(n,e,t,i){var a,l;let s=[],o=1/0;const r=PNe(n,t,e+ONe);for(const c of r){const d=[...((a=c.internals.handleBounds)==null?void 0:a.source)??[],...((l=c.internals.handleBounds)==null?void 0:l.target)??[]];for(const h of d){if(i.nodeId===h.nodeId&&i.type===h.type&&i.id===h.id)continue;const{x:u,y:f}=$1(c,h,h.position,!0),g=Math.sqrt(Math.pow(u-n.x,2)+Math.pow(f-n.y,2));g>e||(g 1){const c=i.type==="source"?"target":"source";return s.find(d=>d.type===c)??s[0]}return s[0]}function Uue(n,e,t,i,s,o=!1){var c,d,h;const r=i.get(n);if(!r)return null;const a=s==="strict"?(c=r.internals.handleBounds)==null?void 0:c[e]:[...((d=r.internals.handleBounds)==null?void 0:d.source)??[],...((h=r.internals.handleBounds)==null?void 0:h.target)??[]],l=(t?a==null?void 0:a.find(u=>u.id===t):a==null?void 0:a[0])??null;return l&&o?{...l,...$1(r,l,l.position,!0)}:l}function que(n,e){return n||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function BNe(n,e){let t=null;return e?t=!0:n&&!e&&(t=!1),t}const Kue=()=>!0;function WNe(n,{connectionMode:e,connectionRadius:t,handleId:i,nodeId:s,edgeUpdaterType:o,isTarget:r,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:d,flowId:h,panBy:u,cancelConnection:f,onConnectStart:g,onConnect:p,onConnectEnd:m,isValidConnection:b=Kue,onReconnectEnd:v,updateConnection:w,getTransform:C,getFromHandle:S,autoPanSpeed:L,dragThreshold:x=1,handleDomNode:I}){const E=Aue(n.target);let R=0,M;const{x:A,y:W}=Wd(n),P=que(o,I),B=a==null?void 0:a.getBoundingClientRect();let V=!1;if(!B||!P)return;const K=Uue(s,P,i,l,e);if(!K)return;let z=Wd(n,B),j=!1,X=null,Y=!1,te=null;function ce(){if(!d||!B)return;const[ct,Ue]=Due(z,B,L);u({x:ct,y:Ue}),R=requestAnimationFrame(ce)}const Ce={...K,nodeId:s,type:P,position:K.position},xe=l.get(s);let Ee={inProgress:!0,isValid:null,from:$1(xe,Ce,Nt.Left,!0),fromHandle:Ce,fromPosition:Ce.position,fromNode:xe,to:z,toHandle:null,toPosition:Aee[Ce.position],toNode:null,pointer:z};function Le(){V=!0,w(Ee),g==null||g(n,{nodeId:s,handleId:i,handleType:P})}x===0&&Le();function ze(ct){if(!V){const{x:Cn,y:Xn}=Wd(ct),Ks=Cn-A,kr=Xn-W;if(!(Ks*Ks+kr*kr>x*x))return;Le()}if(!S()||!Ce){Ct(ct);return}const Ue=C();z=Wd(ct,B),M=FNe(eD(z,Ue,!1,[1,1]),t,l,Ce),j||(ce(),j=!0);const tt=Gue(ct,{handle:M,connectionMode:e,fromNodeId:s,fromHandleId:i,fromType:r?"target":"source",isValidConnection:b,doc:E,lib:c,flowId:h,nodeLookup:l});te=tt.handleDomNode,X=tt.connection,Y=BNe(!!M,tt.isValid);const _t=l.get(s),yi=_t?$1(_t,Ce,Nt.Left,!0):Ee.from,Pt={...Ee,from:yi,isValid:Y,to:tt.toHandle&&Y?$M({x:tt.toHandle.x,y:tt.toHandle.y},Ue):z,toHandle:tt.toHandle,toPosition:Y&&tt.toHandle?tt.toHandle.position:Aee[Ce.position],toNode:tt.toHandle?l.get(tt.toHandle.nodeId):null,pointer:z};w(Pt),Ee=Pt}function Ct(ct){if(!("touches"in ct&&ct.touches.length>0)){if(V){(M||te)&&X&&Y&&(p==null||p(X));const{inProgress:Ue,...tt}=Ee,_t={...tt,toPosition:Ee.toHandle?Ee.toPosition:null};m==null||m(ct,_t),o&&(v==null||v(ct,_t))}f(),cancelAnimationFrame(R),j=!1,Y=!1,X=null,te=null,E.removeEventListener("mousemove",ze),E.removeEventListener("mouseup",Ct),E.removeEventListener("touchmove",ze),E.removeEventListener("touchend",Ct)}}E.addEventListener("mousemove",ze),E.addEventListener("mouseup",Ct),E.addEventListener("touchmove",ze),E.addEventListener("touchend",Ct)}function Gue(n,{handle:e,connectionMode:t,fromNodeId:i,fromHandleId:s,fromType:o,doc:r,lib:a,flowId:l,isValidConnection:c=Kue,nodeLookup:d}){const h=o==="target",u=e?r.querySelector(`.${a}-flow__handle[data-id="${l}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:f,y:g}=Wd(n),p=r.elementFromPoint(f,g),m=p!=null&&p.classList.contains(`${a}-flow__handle`)?p:u,b={handleDomNode:m,isValid:!1,connection:null,toHandle:null};if(m){const v=que(void 0,m),w=m.getAttribute("data-nodeid"),C=m.getAttribute("data-handleid"),S=m.classList.contains("connectable"),L=m.classList.contains("connectableend");if(!w||!v)return b;const x={source:h?w:i,sourceHandle:h?C:s,target:h?i:w,targetHandle:h?s:C};b.connection=x;const E=S&&L&&(t===Yy.Strict?h&&v==="source"||!h&&v==="target":w!==i||C!==s);b.isValid=E&&c(x),b.toHandle=Uue(w,v,C,d,t,!0)}return b}const $B={onPointerDown:WNe,isValid:Gue};function HNe({domNode:n,panZoom:e,getTransform:t,getViewScale:i}){const s=Pl(n);function o({translateExtent:a,width:l,height:c,zoomStep:d=1,pannable:h=!0,zoomable:u=!0,inversePan:f=!1}){const g=w=>{if(w.sourceEvent.type!=="wheel"||!e)return;const C=t(),S=w.sourceEvent.ctrlKey&&KI()?10:1,L=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*d,x=C[2]*Math.pow(2,L*S);e.scaleTo(x)};let p=[0,0];const m=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(p=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},b=w=>{const C=t();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!e)return;const S=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],L=[S[0]-p[0],S[1]-p[1]];p=S;const x=i()*Math.max(C[2],Math.log(C[2]))*(f?-1:1),I={x:C[0]-L[0]*x,y:C[1]-L[1]*x},E=[[0,0],[l,c]];e.setViewportConstrained({x:I.x,y:I.y,zoom:C[2]},E,a)},v=yue().on("start",m).on("zoom",h?b:null).on("zoom.wheel",u?g:null);s.call(v,{})}function r(){s.on("zoom",null)}return{update:o,destroy:r,pointer:xd}}const y5=n=>({x:n.x,y:n.y,zoom:n.k}),e7=({x:n,y:e,zoom:t})=>v5.translate(n,e).scale(t),XC=(n,e)=>n.target.closest(`.${e}`),Yue=(n,e)=>e===2&&Array.isArray(n)&&n.includes(2),VNe=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,t7=(n,e=0,t=VNe,i=()=>{})=>{const s=typeof e=="number"&&e>0;return s||i(),s?n.transition().duration(e).ease(t).on("end",i):n},Zue=n=>{const e=n.ctrlKey&&KI()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*e};function zNe({zoomPanValues:n,noWheelClassName:e,d3Selection:t,d3Zoom:i,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:r,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return d=>{if(XC(d,e))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const h=t.property("__zoom").k||1;if(d.ctrlKey&&r){const m=xd(d),b=Zue(d),v=h*Math.pow(2,b);i.scaleTo(t,v,m,d);return}const u=d.deltaMode===1?20:1;let f=s===Cv.Vertical?0:d.deltaX*u,g=s===Cv.Horizontal?0:d.deltaY*u;!KI()&&d.shiftKey&&s!==Cv.Vertical&&(f=d.deltaY*u,g=0),i.translateBy(t,-(f/h)*o,-(g/h)*o,{internal:!0});const p=y5(t.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?(l==null||l(d,p),n.panScrollTimeout=setTimeout(()=>{c==null||c(d,p),n.isPanScrolling=!1},150)):(n.isPanScrolling=!0,a==null||a(d,p))}}function jNe({noWheelClassName:n,preventScrolling:e,d3ZoomHandler:t}){return function(i,s){const o=i.type==="wheel",r=!e&&o&&!i.ctrlKey,a=XC(i,n);if(i.ctrlKey&&o&&a&&i.preventDefault(),r||a)return null;i.preventDefault(),t.call(this,i,s)}}function $Ne({zoomPanValues:n,onDraggingChange:e,onPanZoomStart:t}){return i=>{var o,r,a;if((o=i.sourceEvent)!=null&&o.internal)return;const s=y5(i.transform);n.mouseButton=((r=i.sourceEvent)==null?void 0:r.button)||0,n.isZoomingOrPanning=!0,n.prevViewport=s,((a=i.sourceEvent)==null?void 0:a.type)==="mousedown"&&e(!0),t&&(t==null||t(i.sourceEvent,s))}}function UNe({zoomPanValues:n,panOnDrag:e,onPaneContextMenu:t,onTransformChange:i,onPanZoom:s}){return o=>{var r,a;n.usedRightMouseButton=!!(t&&Yue(e,n.mouseButton??0)),(r=o.sourceEvent)!=null&&r.sync||i([o.transform.x,o.transform.y,o.transform.k]),s&&!((a=o.sourceEvent)!=null&&a.internal)&&(s==null||s(o.sourceEvent,y5(o.transform)))}}function qNe({zoomPanValues:n,panOnDrag:e,panOnScroll:t,onDraggingChange:i,onPanZoomEnd:s,onPaneContextMenu:o}){return r=>{var a;if(!((a=r.sourceEvent)!=null&&a.internal)&&(n.isZoomingOrPanning=!1,o&&Yue(e,n.mouseButton??0)&&!n.usedRightMouseButton&&r.sourceEvent&&o(r.sourceEvent),n.usedRightMouseButton=!1,i(!1),s)){const l=y5(r.transform);n.prevViewport=l,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{s==null||s(r.sourceEvent,l)},t?150:0)}}}function KNe({zoomActivationKeyPressed:n,zoomOnScroll:e,zoomOnPinch:t,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:r,noWheelClassName:a,noPanClassName:l,lib:c,connectionInProgress:d}){return h=>{var m;const u=n||e,f=t&&h.ctrlKey,g=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(XC(h,`${c}-flow__node`)||XC(h,`${c}-flow__edge`)))return!0;if(!i&&!u&&!s&&!o&&!t||r||d&&!g||XC(h,a)&&g||XC(h,l)&&(!g||s&&g&&!n)||!t&&h.ctrlKey&&g)return!1;if(!t&&h.type==="touchstart"&&((m=h.touches)==null?void 0:m.length)>1)return h.preventDefault(),!1;if(!u&&!s&&!f&&g||!i&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(i)&&!i.includes(h.button)&&h.type==="mousedown")return!1;const p=Array.isArray(i)&&i.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||g)&&p}}function GNe({domNode:n,minZoom:e,maxZoom:t,translateExtent:i,viewport:s,onPanZoom:o,onPanZoomStart:r,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=n.getBoundingClientRect(),h=yue().scaleExtent([e,t]).translateExtent(i),u=Pl(n).call(h);v({x:s.x,y:s.y,zoom:Zy(s.zoom,e,t)},[[0,0],[d.width,d.height]],i);const f=u.on("wheel.zoom"),g=u.on("dblclick.zoom");h.wheelDelta(Zue);function p(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:_R).transform(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function m({noWheelClassName:M,noPanClassName:A,onPaneContextMenu:W,userSelectionActive:P,panOnScroll:B,panOnDrag:V,panOnScrollMode:K,panOnScrollSpeed:z,preventScrolling:j,zoomOnPinch:X,zoomOnScroll:Y,zoomOnDoubleClick:te,zoomActivationKeyPressed:ce,lib:Ce,onTransformChange:xe,connectionInProgress:Be,paneClickDistance:Ee,selectionOnDrag:Le}){P&&!c.isZoomingOrPanning&&b();const ze=B&&!ce&&!P;h.clickDistance(Le?1/0:!Bd(Ee)||Ee<0?0:Ee);const Ct=ze?zNe({zoomPanValues:c,noWheelClassName:M,d3Selection:u,d3Zoom:h,panOnScrollMode:K,panOnScrollSpeed:z,zoomOnPinch:X,onPanZoomStart:r,onPanZoom:o,onPanZoomEnd:a}):jNe({noWheelClassName:M,preventScrolling:j,d3ZoomHandler:f});if(u.on("wheel.zoom",Ct,{passive:!1}),!P){const Ue=$Ne({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:r});h.on("start",Ue);const tt=UNe({zoomPanValues:c,panOnDrag:V,onPaneContextMenu:!!W,onPanZoom:o,onTransformChange:xe});h.on("zoom",tt);const _t=qNe({zoomPanValues:c,panOnDrag:V,panOnScroll:B,onPaneContextMenu:W,onPanZoomEnd:a,onDraggingChange:l});h.on("end",_t)}const ct=KNe({zoomActivationKeyPressed:ce,panOnDrag:V,zoomOnScroll:Y,panOnScroll:B,zoomOnDoubleClick:te,zoomOnPinch:X,userSelectionActive:P,noPanClassName:A,noWheelClassName:M,lib:Ce,connectionInProgress:Be});h.filter(ct),te?u.on("dblclick.zoom",g):u.on("dblclick.zoom",null)}function b(){h.on("zoom",null)}async function v(M,A,W){const P=e7(M),B=h==null?void 0:h.constrain()(P,A,W);return B&&await p(B),new Promise(V=>V(B))}async function w(M,A){const W=e7(M);return await p(W,A),new Promise(P=>P(W))}function C(M){if(u){const A=e7(M),W=u.property("__zoom");(W.k!==M.zoom||W.x!==M.x||W.y!==M.y)&&(h==null||h.transform(u,A,null,{sync:!0}))}}function S(){const M=u?Cue(u.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function L(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:_R).scaleTo(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function x(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:_R).scaleBy(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function I(M){h==null||h.scaleExtent(M)}function E(M){h==null||h.translateExtent(M)}function R(M){const A=!Bd(M)||M<0?0:M;h==null||h.clickDistance(A)}return{update:m,destroy:b,setViewport:w,setViewportConstrained:v,getViewport:S,scaleTo:L,scaleBy:x,setScaleExtent:I,setTranslateExtent:E,syncViewport:C,setClickDistance:R}}var Jy;(function(n){n.Line="line",n.Handle="handle"})(Jy||(Jy={}));function YNe({width:n,prevWidth:e,height:t,prevHeight:i,affectsX:s,affectsY:o}){const r=n-e,a=t-i,l=[r>0?1:r<0?-1:0,a>0?1:a<0?-1:0];return r&&s&&(l[0]=l[0]*-1),a&&o&&(l[1]=l[1]*-1),l}function Kee(n){const e=n.includes("right")||n.includes("left"),t=n.includes("bottom")||n.includes("top"),i=n.includes("left"),s=n.includes("top");return{isHorizontal:e,isVertical:t,affectsX:i,affectsY:s}}function op(n,e){return Math.max(0,e-n)}function rp(n,e){return Math.max(0,n-e)}function xT(n,e,t){return Math.max(0,e-n,n-t)}function Gee(n,e){return n?!e:e}function ZNe(n,e,t,i,s,o,r,a){let{affectsX:l,affectsY:c}=e;const{isHorizontal:d,isVertical:h}=e,u=d&&h,{xSnapped:f,ySnapped:g}=t,{minWidth:p,maxWidth:m,minHeight:b,maxHeight:v}=i,{x:w,y:C,width:S,height:L,aspectRatio:x}=n;let I=Math.floor(d?f-n.pointerX:0),E=Math.floor(h?g-n.pointerY:0);const R=S+(l?-I:I),M=L+(c?-E:E),A=-o[0]*S,W=-o[1]*L;let P=xT(R,p,m),B=xT(M,b,v);if(r){let z=0,j=0;l&&I<0?z=op(w+I+A,r[0][0]):!l&&I>0&&(z=rp(w+R+A,r[1][0])),c&&E<0?j=op(C+E+W,r[0][1]):!c&&E>0&&(j=rp(C+M+W,r[1][1])),P=Math.max(P,z),B=Math.max(B,j)}if(a){let z=0,j=0;l&&I>0?z=rp(w+I,a[0][0]):!l&&I<0&&(z=op(w+R,a[1][0])),c&&E>0?j=rp(C+E,a[0][1]):!c&&E<0&&(j=op(C+M,a[1][1])),P=Math.max(P,z),B=Math.max(B,j)}if(s){if(d){const z=xT(R/x,b,v)*x;if(P=Math.max(P,z),r){let j=0;!l&&!c||l&&!c&&u?j=rp(C+W+R/x,r[1][1])*x:j=op(C+W+(l?I:-I)/x,r[0][1])*x,P=Math.max(P,j)}if(a){let j=0;!l&&!c||l&&!c&&u?j=op(C+R/x,a[1][1])*x:j=rp(C+(l?I:-I)/x,a[0][1])*x,P=Math.max(P,j)}}if(h){const z=xT(M*x,p,m)/x;if(B=Math.max(B,z),r){let j=0;!l&&!c||c&&!l&&u?j=rp(w+M*x+A,r[1][0])/x:j=op(w+(c?E:-E)*x+A,r[0][0])/x,B=Math.max(B,j)}if(a){let j=0;!l&&!c||c&&!l&&u?j=op(w+M*x,a[1][0])/x:j=rp(w+(c?E:-E)*x,a[0][0])/x,B=Math.max(B,j)}}}E=E+(E<0?B:-B),I=I+(I<0?P:-P),s&&(u?R>M*x?E=(Gee(l,c)?-I:I)/x:I=(Gee(l,c)?-E:E)*x:d?(E=I/x,c=l):(I=E*x,l=c));const V=l?w+I:w,K=c?C+E:C;return{width:S+(l?-I:I),height:L+(c?-E:E),x:o[0]*I*(l?-1:1)+V,y:o[1]*E*(c?-1:1)+K}}const Xue={width:0,height:0,x:0,y:0},XNe={...Xue,pointerX:0,pointerY:0,aspectRatio:1};function QNe(n){return[[0,0],[n.measured.width,n.measured.height]]}function JNe(n,e,t){const i=e.position.x+n.position.x,s=e.position.y+n.position.y,o=n.measured.width??0,r=n.measured.height??0,a=t[0]*o,l=t[1]*r;return[[i-a,s-l],[i+o-a,s+r-l]]}function eDe({domNode:n,nodeId:e,getStoreItems:t,onChange:i,onEnd:s}){const o=Pl(n);let r={controlDirection:Kee("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:d,keepAspectRatio:h,resizeDirection:u,onResizeStart:f,onResize:g,onResizeEnd:p,shouldResize:m}){let b={...Xue},v={...XNe};r={boundaries:d,resizeDirection:u,keepAspectRatio:h,controlDirection:Kee(c)};let w,C=null,S=[],L,x,I,E=!1;const R=aue().on("start",M=>{const{nodeLookup:A,transform:W,snapGrid:P,snapToGrid:B,nodeOrigin:V,paneDomNode:K}=t();if(w=A.get(e),!w)return;C=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:j}=ok(M.sourceEvent,{transform:W,snapGrid:P,snapToGrid:B,containerBounds:C});b={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},v={...b,pointerX:z,pointerY:j,aspectRatio:b.width/b.height},L=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(L=A.get(w.parentId),x=L&&w.extent==="parent"?QNe(L):void 0),S=[],I=void 0;for(const[X,Y]of A)if(Y.parentId===e&&(S.push({id:X,position:{...Y.position},extent:Y.extent}),Y.extent==="parent"||Y.expandParent)){const te=JNe(Y,w,Y.origin??V);I?I=[[Math.min(te[0][0],I[0][0]),Math.min(te[0][1],I[0][1])],[Math.max(te[1][0],I[1][0]),Math.max(te[1][1],I[1][1])]]:I=te}f==null||f(M,{...b})}).on("drag",M=>{const{transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B}=t(),V=ok(M.sourceEvent,{transform:A,snapGrid:W,snapToGrid:P,containerBounds:C}),K=[];if(!w)return;const{x:z,y:j,width:X,height:Y}=b,te={},ce=w.origin??B,{width:Ce,height:xe,x:Be,y:Ee}=ZNe(v,r.controlDirection,V,r.boundaries,r.keepAspectRatio,ce,x,I),Le=Ce!==X,ze=xe!==Y,Ct=Be!==z&&Le,ct=Ee!==j&&ze;if(!Ct&&!ct&&!Le&&!ze)return;if((Ct||ct||ce[0]===1||ce[1]===1)&&(te.x=Ct?Be:b.x,te.y=ct?Ee:b.y,b.x=te.x,b.y=te.y,S.length>0)){const yi=Be-z,Pt=Ee-j;for(const Cn of S)Cn.position={x:Cn.position.x-yi+ce[0]*(Ce-X),y:Cn.position.y-Pt+ce[1]*(xe-Y)},K.push(Cn)}if((Le||ze)&&(te.width=Le&&(!r.resizeDirection||r.resizeDirection==="horizontal")?Ce:b.width,te.height=ze&&(!r.resizeDirection||r.resizeDirection==="vertical")?xe:b.height,b.width=te.width,b.height=te.height),L&&w.expandParent){const yi=ce[0]*(te.width??0);te.x&&te.x {E&&(p==null||p(M,{...b}),s==null||s({...b}),E=!1)});o.call(R)}function l(){o.on(".drag",null)}return{update:a,destroy:l}}var Que={exports:{}},Jue={},efe={exports:{}},tfe={};/** +`+o.stack}return{value:n,source:e,stack:s,digest:null}}function U8(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function vB(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var tLe=typeof WeakMap=="function"?WeakMap:Map;function yhe(n,e,t){t=tg(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){TM||(TM=!0,NB=i),vB(n,e)},t}function She(n,e,t){t=tg(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var s=e.value;t.payload=function(){return i(s)},t.callback=function(){vB(n,e)}}var o=n.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){vB(n,e),typeof i!="function"&&(_m===null?_m=new Set([this]):_m.add(this));var r=e.stack;this.componentDidCatch(e.value,{componentStack:r!==null?r:""})}),t}function JJ(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new tLe;var s=new Set;i.set(e,s)}else s=i.get(e),s===void 0&&(s=new Set,i.set(e,s));s.has(t)||(s.add(t),n=pLe.bind(null,n,e,t),e.then(n,n))}function eee(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function tee(n,e,t,i,s){return n.mode&1?(n.flags|=65536,n.lanes=s,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=tg(-1,1),e.tag=2,mm(t,e,1))),t.lanes|=1),n)}var iLe=Bg.ReactCurrentOwner,Xa=!1;function oa(n,e,t,i){e.child=n===null?Qde(e,null,t,i):Uy(e,n.child,t,i)}function iee(n,e,t,i,s){t=t.render;var o=e.ref;return Y0(e,s),i=WK(n,e,t,i,o,s),t=HK(),n!==null&&!Xa?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~s,mg(n,e,s)):(es&&t&&EK(e),e.flags|=1,oa(n,e,i,s),e.child)}function nee(n,e,t,i,s){if(n===null){var o=t.type;return typeof o=="function"&&!ZK(o)&&o.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=o,xhe(n,e,o,i,s)):(n=gR(t.type,null,i,e,e.mode,s),n.ref=e.ref,n.return=e,e.child=n)}if(o=n.child,!(n.lanes&s)){var r=o.memoizedProps;if(t=t.compare,t=t!==null?t:DE,t(r,i)&&n.ref===e.ref)return mg(n,e,s)}return e.flags|=1,n=vm(o,i),n.ref=e.ref,n.return=e,e.child=n}function xhe(n,e,t,i,s){if(n!==null){var o=n.memoizedProps;if(DE(o,i)&&n.ref===e.ref)if(Xa=!1,e.pendingProps=i=o,(n.lanes&s)!==0)n.flags&131072&&(Xa=!0);else return e.lanes=n.lanes,mg(n,e,s)}return wB(n,e,t,i,s)}function Lhe(n,e,t){var i=e.pendingProps,s=i.children,o=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},$n(t0,Rl),Rl|=t;else{if(!(t&1073741824))return n=o!==null?o.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,$n(t0,Rl),Rl|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=o!==null?o.baseLanes:t,$n(t0,Rl),Rl|=i}else o!==null?(i=o.baseLanes|t,e.memoizedState=null):i=t,$n(t0,Rl),Rl|=i;return oa(n,e,s,t),e.child}function khe(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function wB(n,e,t,i,s){var o=nl(t)?B1:zr.current;return o=jy(e,o),Y0(e,s),t=WK(n,e,t,i,o,s),i=HK(),n!==null&&!Xa?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~s,mg(n,e,s)):(es&&i&&EK(e),e.flags|=1,oa(n,e,t,s),e.child)}function see(n,e,t,i,s){if(nl(t)){var o=!0;CM(e)}else o=!1;if(Y0(e,s),e.stateNode===null)hR(n,e),Che(e,t,i),bB(e,t,i,s),i=!0;else if(n===null){var r=e.stateNode,a=e.memoizedProps;r.props=a;var l=r.context,c=t.contextType;typeof c=="object"&&c!==null?c=Uc(c):(c=nl(t)?B1:zr.current,c=jy(e,c));var d=t.getDerivedStateFromProps,h=typeof d=="function"||typeof r.getSnapshotBeforeUpdate=="function";h||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(a!==i||l!==c)&&QJ(e,r,i,c),yp=!1;var u=e.memoizedState;r.state=u,kM(e,i,r,s),l=e.memoizedState,a!==i||u!==l||il.current||yp?(typeof d=="function"&&(_B(e,t,d,i),l=e.memoizedState),(a=yp||XJ(e,t,a,i,u,l,c))?(h||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(e.flags|=4194308)):(typeof r.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),r.props=i,r.state=l,r.context=c,i=a):(typeof r.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{r=e.stateNode,ehe(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:bd(e.type,a),r.props=c,h=e.pendingProps,u=r.context,l=t.contextType,typeof l=="object"&&l!==null?l=Uc(l):(l=nl(t)?B1:zr.current,l=jy(e,l));var f=t.getDerivedStateFromProps;(d=typeof f=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(a!==h||u!==l)&&QJ(e,r,i,l),yp=!1,u=e.memoizedState,r.state=u,kM(e,i,r,s);var g=e.memoizedState;a!==h||u!==g||il.current||yp?(typeof f=="function"&&(_B(e,t,f,i),g=e.memoizedState),(c=yp||XJ(e,t,c,i,u,g,l)||!1)?(d||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(i,g,l),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(i,g,l)),typeof r.componentDidUpdate=="function"&&(e.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof r.componentDidUpdate!="function"||a===n.memoizedProps&&u===n.memoizedState||(e.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&u===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=g),r.props=i,r.state=g,r.context=l,i=c):(typeof r.componentDidUpdate!="function"||a===n.memoizedProps&&u===n.memoizedState||(e.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&u===n.memoizedState||(e.flags|=1024),i=!1)}return CB(n,e,t,i,o,s)}function CB(n,e,t,i,s,o){khe(n,e);var r=(e.flags&128)!==0;if(!i&&!r)return s&&jJ(e,t,!1),mg(n,e,o);i=e.stateNode,iLe.current=e;var a=r&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&r?(e.child=Uy(e,n.child,null,o),e.child=Uy(e,null,a,o)):oa(n,e,a,o),e.memoizedState=i.state,s&&jJ(e,t,!0),e.child}function Ehe(n){var e=n.stateNode;e.pendingContext?zJ(n,e.pendingContext,e.pendingContext!==e.context):e.context&&zJ(n,e.context,!1),PK(n,e.containerInfo)}function oee(n,e,t,i,s){return $y(),NK(s),e.flags|=256,oa(n,e,t,i),e.child}var yB={dehydrated:null,treeContext:null,retryLane:0};function SB(n){return{baseLanes:n,cachePool:null,transitions:null}}function Ihe(n,e,t){var i=e.pendingProps,s=gs.current,o=!1,r=(e.flags&128)!==0,a;if((a=r)||(a=n!==null&&n.memoizedState===null?!1:(s&2)!==0),a?(o=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(s|=1),$n(gs,s&1),n===null)return pB(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(r=i.children,n=i.fallback,o?(i=e.mode,o=e.child,r={mode:"hidden",children:r},!(i&1)&&o!==null?(o.childLanes=0,o.pendingProps=r):o=d5(r,i,0,null),n=yv(n,i,t,null),o.return=e,n.return=e,o.sibling=n,e.child=o,e.child.memoizedState=SB(t),e.memoizedState=yB,n):jK(e,r));if(s=n.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return nLe(n,e,r,i,a,s,t);if(o){o=i.fallback,r=e.mode,s=n.child,a=s.sibling;var l={mode:"hidden",children:i.children};return!(r&1)&&e.child!==s?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=vm(s,l),i.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=vm(a,o):(o=yv(o,r,t,null),o.flags|=2),o.return=e,i.return=e,i.sibling=o,e.child=i,i=o,o=e.child,r=n.child.memoizedState,r=r===null?SB(t):{baseLanes:r.baseLanes|t,cachePool:null,transitions:r.transitions},o.memoizedState=r,o.childLanes=n.childLanes&~t,e.memoizedState=yB,i}return o=n.child,n=o.sibling,i=vm(o,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function jK(n,e){return e=d5({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function fT(n,e,t,i){return i!==null&&NK(i),Uy(e,n.child,null,t),n=jK(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function nLe(n,e,t,i,s,o,r){if(t)return e.flags&256?(e.flags&=-257,i=U8(Error($e(422))),fT(n,e,r,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(o=i.fallback,s=e.mode,i=d5({mode:"visible",children:i.children},s,0,null),o=yv(o,s,r,null),o.flags|=2,i.return=e,o.return=e,i.sibling=o,e.child=i,e.mode&1&&Uy(e,n.child,null,r),e.child.memoizedState=SB(r),e.memoizedState=yB,o);if(!(e.mode&1))return fT(n,e,r,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var a=i.dgst;return i=a,o=Error($e(419)),i=U8(o,i,void 0),fT(n,e,r,i)}if(a=(r&n.childLanes)!==0,Xa||a){if(i=Ko,i!==null){switch(r&-r){case 4:s=2;break;case 16:s=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(i.suspendedLanes|r)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,pg(n,s),zd(i,n,s,-1))}return YK(),i=U8(Error($e(421))),fT(n,e,r,i)}return s.data==="$?"?(e.flags|=128,e.child=n.child,e=mLe.bind(null,n),s._reactRetry=e,null):(n=o.treeContext,Kl=pm(s.nextSibling),Yl=e,es=!0,kd=null,n!==null&&(Mc[Ac++]=Of,Mc[Ac++]=Ff,Mc[Ac++]=W1,Of=n.id,Ff=n.overflow,W1=e),e=jK(e,i.children),e.flags|=4096,e)}function ree(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),mB(n.return,e,t)}function q8(n,e,t,i,s){var o=n.memoizedState;o===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:s}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=t,o.tailMode=s)}function Nhe(n,e,t){var i=e.pendingProps,s=i.revealOrder,o=i.tail;if(oa(n,e,i.children,t),i=gs.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&ree(n,t,e);else if(n.tag===19)ree(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if($n(gs,i),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(t=e.child,s=null;t!==null;)n=t.alternate,n!==null&&EM(n)===null&&(s=t),t=t.sibling;t=s,t===null?(s=e.child,e.child=null):(s=t.sibling,t.sibling=null),q8(e,!1,s,t,o);break;case"backwards":for(t=null,s=e.child,e.child=null;s!==null;){if(n=s.alternate,n!==null&&EM(n)===null){e.child=s;break}n=s.sibling,s.sibling=t,t=s,s=n}q8(e,!0,t,null,o);break;case"together":q8(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function hR(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function mg(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),V1|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error($e(153));if(e.child!==null){for(n=e.child,t=vm(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=vm(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function sLe(n,e,t){switch(e.tag){case 3:Ehe(e),$y();break;case 5:the(e);break;case 1:nl(e.type)&&CM(e);break;case 4:PK(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,s=e.memoizedProps.value;$n(xM,i._currentValue),i._currentValue=s;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?($n(gs,gs.current&1),e.flags|=128,null):t&e.child.childLanes?Ihe(n,e,t):($n(gs,gs.current&1),n=mg(n,e,t),n!==null?n.sibling:null);$n(gs,gs.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return Nhe(n,e,t);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),$n(gs,gs.current),i)break;return null;case 22:case 23:return e.lanes=0,Lhe(n,e,t)}return mg(n,e,t)}var Dhe,xB,The,Rhe;Dhe=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};xB=function(){};The=function(n,e,t,i){var s=n.memoizedProps;if(s!==i){n=e.stateNode,ev(du.current);var o=null;switch(t){case"input":s=q6(n,s),i=q6(n,i),o=[];break;case"select":s=Ss({},s,{value:void 0}),i=Ss({},i,{value:void 0}),o=[];break;case"textarea":s=Y6(n,s),i=Y6(n,i),o=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=vM)}X6(t,i);var r;t=null;for(c in s)if(!i.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(r in a)a.hasOwnProperty(r)&&(t||(t={}),t[r]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(SE.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in i){var l=i[c];if(a=s!=null?s[c]:void 0,i.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(r in a)!a.hasOwnProperty(r)||l&&l.hasOwnProperty(r)||(t||(t={}),t[r]="");for(r in l)l.hasOwnProperty(r)&&a[r]!==l[r]&&(t||(t={}),t[r]=l[r])}else t||(o||(o=[]),o.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(SE.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Gn("scroll",n),o||a===l||(o=[])):(o=o||[]).push(c,l))}t&&(o=o||[]).push("style",t);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};Rhe=function(n,e,t,i){t!==i&&(e.flags|=4)};function Ax(n,e){if(!es)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function Dr(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var s=n.child;s!==null;)t|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=n,s=s.sibling;else for(s=n.child;s!==null;)t|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=n,s=s.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function oLe(n,e,t){var i=e.pendingProps;switch(IK(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dr(e),null;case 1:return nl(e.type)&&wM(),Dr(e),null;case 3:return i=e.stateNode,qy(),Zn(il),Zn(zr),FK(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(hT(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,kd!==null&&(RB(kd),kd=null))),xB(n,e),Dr(e),null;case 5:OK(e);var s=ev(PE.current);if(t=e.type,n!==null&&e.stateNode!=null)The(n,e,t,i,s),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error($e(166));return Dr(e),null}if(n=ev(du.current),hT(e)){i=e.stateNode,t=e.type;var o=e.memoizedProps;switch(i[Yh]=e,i[ME]=o,n=(e.mode&1)!==0,t){case"dialog":Gn("cancel",i),Gn("close",i);break;case"iframe":case"object":case"embed":Gn("load",i);break;case"video":case"audio":for(s=0;s <\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=r.createElement(t,{is:i.is}):(n=r.createElement(t),t==="select"&&(r=n,i.multiple?r.multiple=!0:i.size&&(r.size=i.size))):n=r.createElementNS(n,t),n[Yh]=e,n[ME]=i,Dhe(n,e,!1,!1),e.stateNode=n;e:{switch(r=Q6(t,i),t){case"dialog":Gn("cancel",n),Gn("close",n),s=i;break;case"iframe":case"object":case"embed":Gn("load",n),s=i;break;case"video":case"audio":for(s=0;s Gy&&(e.flags|=128,i=!0,Ax(o,!1),e.lanes=4194304)}else{if(!i)if(n=EM(r),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ax(o,!0),o.tail===null&&o.tailMode==="hidden"&&!r.alternate&&!es)return Dr(e),null}else 2*Hs()-o.renderingStartTime>Gy&&t!==1073741824&&(e.flags|=128,i=!0,Ax(o,!1),e.lanes=4194304);o.isBackwards?(r.sibling=e.child,e.child=r):(t=o.last,t!==null?t.sibling=r:e.child=r,o.last=r)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Hs(),e.sibling=null,t=gs.current,$n(gs,i?t&1|2:t&1),e):(Dr(e),null);case 22:case 23:return GK(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Rl&1073741824&&(Dr(e),e.subtreeFlags&6&&(e.flags|=8192)):Dr(e),null;case 24:return null;case 25:return null}throw Error($e(156,e.tag))}function rLe(n,e){switch(IK(e),e.tag){case 1:return nl(e.type)&&wM(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return qy(),Zn(il),Zn(zr),FK(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return OK(e),null;case 13:if(Zn(gs),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error($e(340));$y()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Zn(gs),null;case 4:return qy(),null;case 10:return RK(e.type._context),null;case 22:case 23:return GK(),null;case 24:return null;default:return null}}var gT=!1,Or=!1,aLe=typeof WeakSet=="function"?WeakSet:Set,ft=null;function e0(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Ds(n,e,i)}else t.current=null}function LB(n,e,t){try{t()}catch(i){Ds(n,e,i)}}var aee=!1;function lLe(n,e){if(lB=mM,n=Fde(),kK(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var s=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var r=0,a=-1,l=-1,c=0,d=0,h=n,u=null;t:for(;;){for(var f;h!==t||s!==0&&h.nodeType!==3||(a=r+s),h!==o||i!==0&&h.nodeType!==3||(l=r+i),h.nodeType===3&&(r+=h.nodeValue.length),(f=h.firstChild)!==null;)u=h,h=f;for(;;){if(h===n)break t;if(u===t&&++c===s&&(a=r),u===o&&++d===i&&(l=r),(f=h.nextSibling)!==null)break;h=u,u=h.parentNode}h=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(cB={focusedElem:n,selectionRange:t},mM=!1,ft=e;ft!==null;)if(e=ft,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,ft=n;else for(;ft!==null;){e=ft;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,m=g.memoizedState,b=e.stateNode,v=b.getSnapshotBeforeUpdate(e.elementType===e.type?p:bd(e.type,p),m);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($e(163))}}catch(C){Ds(e,e.return,C)}if(n=e.sibling,n!==null){n.return=e.return,ft=n;break}ft=e.return}return g=aee,aee=!1,g}function tk(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&n)===n){var o=s.destroy;s.destroy=void 0,o!==void 0&&LB(e,t,o)}s=s.next}while(s!==i)}}function l5(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function kB(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function Mhe(n){var e=n.alternate;e!==null&&(n.alternate=null,Mhe(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Yh],delete e[ME],delete e[uB],delete e[$xe],delete e[Uxe])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function Ahe(n){return n.tag===5||n.tag===3||n.tag===4}function lee(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Ahe(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function EB(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=vM));else if(i!==4&&(n=n.child,n!==null))for(EB(n,e,t),n=n.sibling;n!==null;)EB(n,e,t),n=n.sibling}function IB(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(IB(n,e,t),n=n.sibling;n!==null;)IB(n,e,t),n=n.sibling}var sr=null,Cd=!1;function sp(n,e,t){for(t=t.child;t!==null;)Phe(n,e,t),t=t.sibling}function Phe(n,e,t){if(cu&&typeof cu.onCommitFiberUnmount=="function")try{cu.onCommitFiberUnmount(e5,t)}catch{}switch(t.tag){case 5:Or||e0(t,e);case 6:var i=sr,s=Cd;sr=null,sp(n,e,t),sr=i,Cd=s,sr!==null&&(Cd?(n=sr,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):sr.removeChild(t.stateNode));break;case 18:sr!==null&&(Cd?(n=sr,t=t.stateNode,n.nodeType===8?W8(n.parentNode,t):n.nodeType===1&&W8(n,t),IE(n)):W8(sr,t.stateNode));break;case 4:i=sr,s=Cd,sr=t.stateNode.containerInfo,Cd=!0,sp(n,e,t),sr=i,Cd=s;break;case 0:case 11:case 14:case 15:if(!Or&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var o=s,r=o.destroy;o=o.tag,r!==void 0&&(o&2||o&4)&&LB(t,e,r),s=s.next}while(s!==i)}sp(n,e,t);break;case 1:if(!Or&&(e0(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Ds(t,e,a)}sp(n,e,t);break;case 21:sp(n,e,t);break;case 22:t.mode&1?(Or=(i=Or)||t.memoizedState!==null,sp(n,e,t),Or=i):sp(n,e,t);break;default:sp(n,e,t)}}function cee(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new aLe),e.forEach(function(i){var s=_Le.bind(null,n,i);t.has(i)||(t.add(i),i.then(s,s))})}}function ld(n,e){var t=e.deletions;if(t!==null)for(var i=0;i s&&(s=r),i&=~o}if(i=s,i=Hs()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*dLe(i/1960))-i,10n?16:n,qp===null)var i=!1;else{if(n=qp,qp=null,RM=0,ji&6)throw Error($e(331));var s=ji;for(ji|=4,ft=n.current;ft!==null;){var o=ft,r=o.child;if(ft.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l Hs()-qK?Cv(n,0):UK|=t),sl(n,e)}function jhe(n,e){e===0&&(n.mode&1?(e=oT,oT<<=1,!(oT&130023424)&&(oT=4194304)):e=1);var t=ga();n=pg(n,e),n!==null&&(UN(n,e,t),sl(n,t))}function mLe(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),jhe(n,t)}function _Le(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,s=n.memoizedState;s!==null&&(t=s.retryLane);break;case 19:i=n.stateNode;break;default:throw Error($e(314))}i!==null&&i.delete(e),jhe(n,t)}var $he;$he=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||il.current)Xa=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Xa=!1,sLe(n,e,t);Xa=!!(n.flags&131072)}else Xa=!1,es&&e.flags&1048576&&Gde(e,SM,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;hR(n,e),n=e.pendingProps;var s=jy(e,zr.current);Y0(e,t),s=WK(null,e,i,n,s,t);var o=HK();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,nl(i)?(o=!0,CM(e)):o=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,AK(e),s.updater=a5,e.stateNode=s,s._reactInternals=e,bB(e,i,n,t),e=CB(null,e,i,!0,o,t)):(e.tag=0,es&&o&&EK(e),oa(null,e,s,t),e=e.child),e;case 16:i=e.elementType;e:{switch(hR(n,e),n=e.pendingProps,s=i._init,i=s(i._payload),e.type=i,s=e.tag=vLe(i),n=bd(i,n),s){case 0:e=wB(null,e,i,n,t);break e;case 1:e=see(null,e,i,n,t);break e;case 11:e=iee(null,e,i,n,t);break e;case 14:e=nee(null,e,i,bd(i.type,n),t);break e}throw Error($e(306,i,""))}return e;case 0:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:bd(i,s),wB(n,e,i,s,t);case 1:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:bd(i,s),see(n,e,i,s,t);case 3:e:{if(Ehe(e),n===null)throw Error($e(387));i=e.pendingProps,o=e.memoizedState,s=o.element,ehe(n,e),kM(e,i,null,t);var r=e.memoizedState;if(i=r.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:r.cache,pendingSuspenseBoundaries:r.pendingSuspenseBoundaries,transitions:r.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){s=Ky(Error($e(423)),e),e=oee(n,e,i,t,s);break e}else if(i!==s){s=Ky(Error($e(424)),e),e=oee(n,e,i,t,s);break e}else for(Kl=pm(e.stateNode.containerInfo.firstChild),Yl=e,es=!0,kd=null,t=Qde(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if($y(),i===s){e=mg(n,e,t);break e}oa(n,e,i,t)}e=e.child}return e;case 5:return the(e),n===null&&pB(e),i=e.type,s=e.pendingProps,o=n!==null?n.memoizedProps:null,r=s.children,dB(i,s)?r=null:o!==null&&dB(i,o)&&(e.flags|=32),khe(n,e),oa(n,e,r,t),e.child;case 6:return n===null&&pB(e),null;case 13:return Ihe(n,e,t);case 4:return PK(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Uy(e,null,i,t):oa(n,e,i,t),e.child;case 11:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:bd(i,s),iee(n,e,i,s,t);case 7:return oa(n,e,e.pendingProps,t),e.child;case 8:return oa(n,e,e.pendingProps.children,t),e.child;case 12:return oa(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,s=e.pendingProps,o=e.memoizedProps,r=s.value,$n(xM,i._currentValue),i._currentValue=r,o!==null)if(Gd(o.value,r)){if(o.children===s.children&&!il.current){e=mg(n,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){r=o.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=tg(-1,t&-t),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),mB(o.return,t,e),a.lanes|=t;break}l=l.next}}else if(o.tag===10)r=o.type===e.type?null:o.child;else if(o.tag===18){if(r=o.return,r===null)throw Error($e(341));r.lanes|=t,a=r.alternate,a!==null&&(a.lanes|=t),mB(r,t,e),r=o.sibling}else r=o.child;if(r!==null)r.return=o;else for(r=o;r!==null;){if(r===e){r=null;break}if(o=r.sibling,o!==null){o.return=r.return,r=o;break}r=r.return}o=r}oa(n,e,s.children,t),e=e.child}return e;case 9:return s=e.type,i=e.pendingProps.children,Y0(e,t),s=Uc(s),i=i(s),e.flags|=1,oa(n,e,i,t),e.child;case 14:return i=e.type,s=bd(i,e.pendingProps),s=bd(i.type,s),nee(n,e,i,s,t);case 15:return xhe(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:bd(i,s),hR(n,e),e.tag=1,nl(i)?(n=!0,CM(e)):n=!1,Y0(e,t),Che(e,i,s),bB(e,i,s,t),CB(null,e,i,!0,n,t);case 19:return Nhe(n,e,t);case 22:return Lhe(n,e,t)}throw Error($e(156,e.tag))};function Uhe(n,e){return bde(n,e)}function bLe(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bc(n,e,t,i){return new bLe(n,e,t,i)}function ZK(n){return n=n.prototype,!(!n||!n.isReactComponent)}function vLe(n){if(typeof n=="function")return ZK(n)?1:0;if(n!=null){if(n=n.$$typeof,n===pK)return 11;if(n===mK)return 14}return 2}function vm(n,e){var t=n.alternate;return t===null?(t=Bc(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function gR(n,e,t,i,s,o){var r=2;if(i=n,typeof n=="function")ZK(n)&&(r=1);else if(typeof n=="string")r=5;else e:switch(n){case UC:return yv(t.children,s,o,e);case gK:r=8,s|=8;break;case z6:return n=Bc(12,t,e,s|2),n.elementType=z6,n.lanes=o,n;case j6:return n=Bc(13,t,e,s),n.elementType=j6,n.lanes=o,n;case $6:return n=Bc(19,t,e,s),n.elementType=$6,n.lanes=o,n;case tde:return d5(t,s,o,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Jce:r=10;break e;case ede:r=9;break e;case pK:r=11;break e;case mK:r=14;break e;case Cp:r=16,i=null;break e}throw Error($e(130,n==null?n:typeof n,""))}return e=Bc(r,t,e,s),e.elementType=n,e.type=i,e.lanes=o,e}function yv(n,e,t,i){return n=Bc(7,n,i,e),n.lanes=t,n}function d5(n,e,t,i){return n=Bc(22,n,i,e),n.elementType=tde,n.lanes=t,n.stateNode={isHidden:!1},n}function K8(n,e,t){return n=Bc(6,n,null,e),n.lanes=t,n}function G8(n,e,t){return e=Bc(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function wLe(n,e,t,i,s){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=I8(0),this.expirationTimes=I8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=I8(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function XK(n,e,t,i,s,o,r,a,l){return n=new wLe(n,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Bc(3,null,null,e),n.current=o,o.stateNode=n,o.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},AK(o),n}function CLe(n,e,t){var i=3 "u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Yhe)}catch(n){console.error(n)}}Yhe(),Yce.exports=dc;var kLe=Yce.exports,_ee=kLe;H6.createRoot=_ee.createRoot,H6.hydrateRoot=_ee.hydrateRoot;function uo(n){if(typeof n=="string"||typeof n=="number")return""+n;let e="";if(Array.isArray(n))for(let t=0,i;t {}};function p5(){for(var n=0,e=arguments.length,t={},i;n =0&&(i=t.slice(s+1),t=t.slice(0,s)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}})}pR.prototype=p5.prototype={constructor:pR,on:function(n,e){var t=this._,i=ILe(n+"",t),s,o=-1,r=i.length;if(arguments.length<2){for(;++o 0)for(var t=new Array(s),i=0,s,o;i =0&&(e=n.slice(0,t))!=="xmlns"&&(n=n.slice(t+1)),vee.hasOwnProperty(e)?{space:vee[e],local:n}:n}function DLe(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===MB&&e.documentElement.namespaceURI===MB?e.createElement(n):e.createElementNS(t,n)}}function TLe(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Zhe(n){var e=m5(n);return(e.local?TLe:DLe)(e)}function RLe(){}function tG(n){return n==null?RLe:function(){return this.querySelector(n)}}function MLe(n){typeof n!="function"&&(n=tG(n));for(var e=this._groups,t=e.length,i=new Array(t),s=0;s=w&&(w=v+1);!(S=m[w])&&++w =0;)(r=i[s])&&(o&&r.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(r,o),o=r);return this}function ske(n){n||(n=oke);function e(h,u){return h&&u?n(h.__data__,u.__data__):!h-!u}for(var t=this._groups,i=t.length,s=new Array(i),o=0;oe?1:n>=e?0:NaN}function rke(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function ake(){return Array.from(this)}function lke(){for(var n=this._groups,e=0,t=n.length;e 1?this.each((e==null?vke:typeof e=="function"?Cke:wke)(n,e,t??"")):Yy(this.node(),n)}function Yy(n,e){return n.style.getPropertyValue(e)||tue(n).getComputedStyle(n,null).getPropertyValue(e)}function Ske(n){return function(){delete this[n]}}function xke(n,e){return function(){this[n]=e}}function Lke(n,e){return function(){var t=e.apply(this,arguments);t==null?delete this[n]:this[n]=t}}function kke(n,e){return arguments.length>1?this.each((e==null?Ske:typeof e=="function"?Lke:xke)(n,e)):this.node()[n]}function iue(n){return n.trim().split(/^|\s+/)}function iG(n){return n.classList||new nue(n)}function nue(n){this._node=n,this._names=iue(n.getAttribute("class")||"")}nue.prototype={add:function(n){var e=this._names.indexOf(n);e<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function sue(n,e){for(var t=iG(n),i=-1,s=e.length;++i =0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}})}function eEe(n){return function(){var e=this.__on;if(e){for(var t=0,i=-1,s=e.length,o;t()=>n;function AB(n,{sourceEvent:e,subject:t,target:i,identifier:s,active:o,x:r,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:r,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}AB.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function dEe(n){return!n.ctrlKey&&!n.button}function hEe(){return this.parentNode}function uEe(n,e){return e??{x:n.x,y:n.y}}function fEe(){return navigator.maxTouchPoints||"ontouchstart"in this}function due(){var n=dEe,e=hEe,t=uEe,i=fEe,s={},o=p5("start","drag","end"),r=0,a,l,c,d,h=0;function u(C){C.on("mousedown.drag",f).filter(i).on("touchstart.drag",m).on("touchmove.drag",b,cEe).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(C,S){if(!(d||!n.call(this,C,S))){var L=w(this,e.call(this,C,S),C,S,"mouse");L&&(Wl(C.view).on("mousemove.drag",g,HE).on("mouseup.drag",p,HE),lue(C.view),Y8(C),c=!1,a=C.clientX,l=C.clientY,L("start",C))}}function g(C){if(X0(C),!c){var S=C.clientX-a,L=C.clientY-l;c=S*S+L*L>h}s.mouse("drag",C)}function p(C){Wl(C.view).on("mousemove.drag mouseup.drag",null),cue(C.view,c),X0(C),s.mouse("end",C)}function m(C,S){if(n.call(this,C,S)){var L=C.changedTouches,x=e.call(this,C,S),E=L.length,I,R;for(I=0;I>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?bT(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?bT(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=pEe.exec(n))?new Qa(e[1],e[2],e[3],1):(e=mEe.exec(n))?new Qa(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=_Ee.exec(n))?bT(e[1],e[2],e[3],e[4]):(e=bEe.exec(n))?bT(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=vEe.exec(n))?kee(e[1],e[2]/100,e[3]/100,1):(e=wEe.exec(n))?kee(e[1],e[2]/100,e[3]/100,e[4]):wee.hasOwnProperty(n)?See(wee[n]):n==="transparent"?new Qa(NaN,NaN,NaN,0):null}function See(n){return new Qa(n>>16&255,n>>8&255,n&255,1)}function bT(n,e,t,i){return i<=0&&(n=e=t=NaN),new Qa(n,e,t,i)}function SEe(n){return n instanceof ZN||(n=j1(n)),n?(n=n.rgb(),new Qa(n.r,n.g,n.b,n.opacity)):new Qa}function PB(n,e,t,i){return arguments.length===1?SEe(n):new Qa(n,e,t,i??1)}function Qa(n,e,t,i){this.r=+n,this.g=+e,this.b=+t,this.opacity=+i}nG(Qa,PB,hue(ZN,{brighter(n){return n=n==null?OM:Math.pow(OM,n),new Qa(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?VE:Math.pow(VE,n),new Qa(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Qa(Sv(this.r),Sv(this.g),Sv(this.b),FM(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:xee,formatHex:xee,formatHex8:xEe,formatRgb:Lee,toString:Lee}));function xee(){return`#${tv(this.r)}${tv(this.g)}${tv(this.b)}`}function xEe(){return`#${tv(this.r)}${tv(this.g)}${tv(this.b)}${tv((isNaN(this.opacity)?1:this.opacity)*255)}`}function Lee(){const n=FM(this.opacity);return`${n===1?"rgb(":"rgba("}${Sv(this.r)}, ${Sv(this.g)}, ${Sv(this.b)}${n===1?")":`, ${n})`}`}function FM(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Sv(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function tv(n){return n=Sv(n),(n<16?"0":"")+n.toString(16)}function kee(n,e,t,i){return i<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Ad(n,e,t,i)}function uue(n){if(n instanceof Ad)return new Ad(n.h,n.s,n.l,n.opacity);if(n instanceof ZN||(n=j1(n)),!n)return new Ad;if(n instanceof Ad)return n;n=n.rgb();var e=n.r/255,t=n.g/255,i=n.b/255,s=Math.min(e,t,i),o=Math.max(e,t,i),r=NaN,a=o-s,l=(o+s)/2;return a?(e===o?r=(t-i)/a+(t0&&l<1?0:r,new Ad(r,a,l,n.opacity)}function LEe(n,e,t,i){return arguments.length===1?uue(n):new Ad(n,e,t,i??1)}function Ad(n,e,t,i){this.h=+n,this.s=+e,this.l=+t,this.opacity=+i}nG(Ad,LEe,hue(ZN,{brighter(n){return n=n==null?OM:Math.pow(OM,n),new Ad(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?VE:Math.pow(VE,n),new Ad(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,s=2*t-i;return new Qa(Z8(n>=240?n-240:n+120,s,i),Z8(n,s,i),Z8(n<120?n+240:n-120,s,i),this.opacity)},clamp(){return new Ad(Eee(this.h),vT(this.s),vT(this.l),FM(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 n=FM(this.opacity);return`${n===1?"hsl(":"hsla("}${Eee(this.h)}, ${vT(this.s)*100}%, ${vT(this.l)*100}%${n===1?")":`, ${n})`}`}}));function Eee(n){return n=(n||0)%360,n<0?n+360:n}function vT(n){return Math.max(0,Math.min(1,n||0))}function Z8(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const sG=n=>()=>n;function kEe(n,e){return function(t){return n+t*e}}function EEe(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(i){return Math.pow(n+i*e,t)}}function IEe(n){return(n=+n)==1?fue:function(e,t){return t-e?EEe(e,t,n):sG(isNaN(e)?t:e)}}function fue(n,e){var t=e-n;return t?kEe(n,t):sG(isNaN(n)?e:n)}const BM=function n(e){var t=IEe(e);function i(s,o){var r=t((s=PB(s)).r,(o=PB(o)).r),a=t(s.g,o.g),l=t(s.b,o.b),c=fue(s.opacity,o.opacity);return function(d){return s.r=r(d),s.g=a(d),s.b=l(d),s.opacity=c(d),s+""}}return i.gamma=n,i}(1);function NEe(n,e){e||(e=[]);var t=n?Math.min(e.length,n.length):0,i=e.slice(),s;return function(o){for(s=0;s t&&(o=e.slice(t,o),a[r]?a[r]+=o:a[++r]=o),(i=i[0])===(s=s[0])?a[r]?a[r]+=s:a[++r]=s:(a[++r]=null,l.push({i:r,x:zh(i,s)})),t=X8.lastIndex;return t 180?d+=360:d-c>180&&(c+=360),u.push({i:h.push(s(h)+"rotate(",null,i)-2,x:zh(c,d)})):d&&h.push(s(h)+"rotate("+d+i)}function a(c,d,h,u){c!==d?u.push({i:h.push(s(h)+"skewX(",null,i)-2,x:zh(c,d)}):d&&h.push(s(h)+"skewX("+d+i)}function l(c,d,h,u,f,g){if(c!==h||d!==u){var p=f.push(s(f)+"scale(",null,",",null,")");g.push({i:p-4,x:zh(c,h)},{i:p-2,x:zh(d,u)})}else(h!==1||u!==1)&&f.push(s(f)+"scale("+h+","+u+")")}return function(c,d){var h=[],u=[];return c=n(c),d=n(d),o(c.translateX,c.translateY,d.translateX,d.translateY,h,u),r(c.rotate,d.rotate,h,u),a(c.skewX,d.skewX,h,u),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,h,u),c=d=null,function(f){for(var g=-1,p=u.length,m;++g =0&&n._call.call(void 0,e),n=n._next;--Zy}function Dee(){$1=(HM=jE.now())+_5,Zy=SL=0;try{$Ee()}finally{Zy=0,qEe(),$1=0}}function UEe(){var n=jE.now(),e=n-HM;e>_ue&&(_5-=e,HM=n)}function qEe(){for(var n,e=WM,t,i=1/0;e;)e._call?(i>e._time&&(i=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:WM=t);xL=n,BB(i)}function BB(n){if(!Zy){SL&&(SL=clearTimeout(SL));var e=n-$1;e>24?(n<1/0&&(SL=setTimeout(Dee,n-jE.now()-_5)),Ox&&(Ox=clearInterval(Ox))):(Ox||(HM=jE.now(),Ox=setInterval(UEe,_ue)),Zy=1,bue(Dee))}}function Tee(n,e,t){var i=new VM;return e=e==null?0:+e,i.restart(s=>{i.stop(),n(s+e)},e,t),i}var KEe=p5("start","end","cancel","interrupt"),GEe=[],wue=0,Ree=1,WB=2,_R=3,Mee=4,HB=5,bR=6;function b5(n,e,t,i,s,o){var r=n.__transition;if(!r)n.__transition={};else if(t in r)return;YEe(n,t,{name:e,index:i,group:s,on:KEe,tween:GEe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:wue})}function rG(n,e){var t=oh(n,e);if(t.state>wue)throw new Error("too late; already scheduled");return t}function Nu(n,e){var t=oh(n,e);if(t.state>_R)throw new Error("too late; already running");return t}function oh(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function YEe(n,e,t){var i=n.__transition,s;i[e]=t,t.timer=vue(o,0,t.time);function o(c){t.state=Ree,t.timer.restart(r,t.delay,t.time),t.delay<=c&&r(c-t.delay)}function r(c){var d,h,u,f;if(t.state!==Ree)return l();for(d in i)if(f=i[d],f.name===t.name){if(f.state===_R)return Tee(r);f.state===Mee?(f.state=bR,f.timer.stop(),f.on.call("interrupt",n,n.__data__,f.index,f.group),delete i[d]):+d
WB&&i.state =0&&(e=e.slice(0,t)),!e||e==="start"})}function LIe(n,e,t){var i,s,o=xIe(e)?rG:Nu;return function(){var r=o(this,n),a=r.on;a!==i&&(s=(i=a).copy()).on(e,t),r.on=s}}function kIe(n,e){var t=this._id;return arguments.length<2?oh(this.node(),t).on.on(n):this.each(LIe(t,n,e))}function EIe(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}function IIe(){return this.on("end.remove",EIe(this._id))}function NIe(n){var e=this._name,t=this._id;typeof n!="function"&&(n=tG(n));for(var i=this._groups,s=i.length,o=new Array(s),r=0;r ()=>n;function eNe(n,{sourceEvent:e,target:t,transform:i,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function Bf(n,e,t){this.k=n,this.x=e,this.y=t}Bf.prototype={constructor:Bf,scale:function(n){return n===1?this:new Bf(this.k*n,this.x,this.y)},translate:function(n,e){return n===0&e===0?this:new Bf(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var v5=new Bf(1,0,0);xue.prototype=Bf.prototype;function xue(n){for(;!n.__zoom;)if(!(n=n.parentNode))return v5;return n.__zoom}function Q8(n){n.stopImmediatePropagation()}function Fx(n){n.preventDefault(),n.stopImmediatePropagation()}function tNe(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function iNe(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function Aee(){return this.__zoom||v5}function nNe(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function sNe(){return navigator.maxTouchPoints||"ontouchstart"in this}function oNe(n,e,t){var i=n.invertX(e[0][0])-t[0][0],s=n.invertX(e[1][0])-t[1][0],o=n.invertY(e[0][1])-t[0][1],r=n.invertY(e[1][1])-t[1][1];return n.translate(s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s),r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r))}function Lue(){var n=tNe,e=iNe,t=oNe,i=nNe,s=sNe,o=[0,1/0],r=[[-1/0,-1/0],[1/0,1/0]],a=250,l=mR,c=p5("start","zoom","end"),d,h,u,f=500,g=150,p=0,m=10;function b(P){P.property("__zoom",Aee).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",R).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(P,B,V,K){var z=P.selection?P.selection():P;z.property("__zoom",Aee),P!==z?S(P,B,V,K):z.interrupt().each(function(){L(this,arguments).event(K).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},b.scaleBy=function(P,B,V,K){b.scaleTo(P,function(){var z=this.__zoom.k,j=typeof B=="function"?B.apply(this,arguments):B;return z*j},V,K)},b.scaleTo=function(P,B,V,K){b.transform(P,function(){var z=e.apply(this,arguments),j=this.__zoom,Q=V==null?C(z):typeof V=="function"?V.apply(this,arguments):V,Y=j.invert(Q),te=typeof B=="function"?B.apply(this,arguments):B;return t(w(v(j,te),Q,Y),z,r)},V,K)},b.translateBy=function(P,B,V,K){b.transform(P,function(){return t(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof V=="function"?V.apply(this,arguments):V),e.apply(this,arguments),r)},null,K)},b.translateTo=function(P,B,V,K,z){b.transform(P,function(){var j=e.apply(this,arguments),Q=this.__zoom,Y=K==null?C(j):typeof K=="function"?K.apply(this,arguments):K;return t(v5.translate(Y[0],Y[1]).scale(Q.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof V=="function"?-V.apply(this,arguments):-V),j,r)},K,z)};function v(P,B){return B=Math.max(o[0],Math.min(o[1],B)),B===P.k?P:new Bf(B,P.x,P.y)}function w(P,B,V){var K=B[0]-V[0]*P.k,z=B[1]-V[1]*P.k;return K===P.x&&z===P.y?P:new Bf(P.k,K,z)}function C(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function S(P,B,V,K){P.on("start.zoom",function(){L(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(K).end()}).tween("zoom",function(){var z=this,j=arguments,Q=L(z,j).event(K),Y=e.apply(z,j),te=V==null?C(Y):typeof V=="function"?V.apply(z,j):V,ce=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),Ce=z.__zoom,xe=typeof B=="function"?B.apply(z,j):B,je=l(Ce.invert(te).concat(ce/Ce.k),xe.invert(te).concat(ce/xe.k));return function(ke){if(ke===1)ke=xe;else{var Le=je(ke),Ve=ce/Le[2];ke=new Bf(Ve,te[0]-Le[0]*Ve,te[1]-Le[1]*Ve)}Q.zoom(null,ke)}})}function L(P,B,V){return!V&&P.__zooming||new x(P,B)}function x(P,B){this.that=P,this.args=B,this.active=0,this.sourceEvent=null,this.extent=e.apply(P,B),this.taps=0}x.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,B){return this.mouse&&P!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var B=Wl(this.that).datum();c.call(P,this.that,new eNe(P,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:c}),B)}};function E(P,...B){if(!n.apply(this,arguments))return;var V=L(this,B).event(P),K=this.__zoom,z=Math.max(o[0],Math.min(o[1],K.k*Math.pow(2,i.apply(this,arguments)))),j=yd(P);if(V.wheel)(V.mouse[0][0]!==j[0]||V.mouse[0][1]!==j[1])&&(V.mouse[1]=K.invert(V.mouse[0]=j)),clearTimeout(V.wheel);else{if(K.k===z)return;V.mouse=[j,K.invert(j)],vR(this),V.start()}Fx(P),V.wheel=setTimeout(Q,g),V.zoom("mouse",t(w(v(K,z),V.mouse[0],V.mouse[1]),V.extent,r));function Q(){V.wheel=null,V.end()}}function I(P,...B){if(u||!n.apply(this,arguments))return;var V=P.currentTarget,K=L(this,B,!0).event(P),z=Wl(P.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",ce,!0),j=yd(P,V),Q=P.clientX,Y=P.clientY;lue(P.view),Q8(P),K.mouse=[j,this.__zoom.invert(j)],vR(this),K.start();function te(Ce){if(Fx(Ce),!K.moved){var xe=Ce.clientX-Q,je=Ce.clientY-Y;K.moved=xe*xe+je*je>p}K.event(Ce).zoom("mouse",t(w(K.that.__zoom,K.mouse[0]=yd(Ce,V),K.mouse[1]),K.extent,r))}function ce(Ce){z.on("mousemove.zoom mouseup.zoom",null),cue(Ce.view,K.moved),Fx(Ce),K.event(Ce).end()}}function R(P,...B){if(n.apply(this,arguments)){var V=this.__zoom,K=yd(P.changedTouches?P.changedTouches[0]:P,this),z=V.invert(K),j=V.k*(P.shiftKey?.5:2),Q=t(w(v(V,j),K,z),e.apply(this,B),r);Fx(P),a>0?Wl(this).transition().duration(a).call(S,Q,K,P):Wl(this).call(b.transform,Q,K,P)}}function M(P,...B){if(n.apply(this,arguments)){var V=P.touches,K=V.length,z=L(this,B,P.changedTouches.length===K).event(P),j,Q,Y,te;for(Q8(P),Q=0;Q"[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:n=>`Node type "${n}" 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:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,{id:e,sourceHandle:t,targetHandle:i})=>`Couldn't create edge for ${n} handle id: "${n==="source"?t:i}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(n="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${n}/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."},$E=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],kue=["Enter"," ","Escape"],Eue={"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:n,x:e,y:t})=>`Moved selected node ${n}. New position, x: ${e}, y: ${t}`,"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 Xy;(function(n){n.Strict="strict",n.Loose="loose"})(Xy||(Xy={}));var xv;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(xv||(xv={}));var UE;(function(n){n.Partial="partial",n.Full="full"})(UE||(UE={}));const Iue={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Nf;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Nf||(Nf={}));var U1;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(U1||(U1={}));var It;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(It||(It={}));const Pee={[It.Left]:It.Right,[It.Right]:It.Left,[It.Top]:It.Bottom,[It.Bottom]:It.Top};function Nue(n){return n===null?null:n?"valid":"invalid"}const Due=n=>"id"in n&&"source"in n&&"target"in n,rNe=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),lG=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),XN=(n,e=[0,0])=>{const{width:t,height:i}=Wg(n),s=n.origin??e,o=t*s[0],r=i*s[1];return{x:n.position.x-o,y:n.position.y-r}},aNe=(n,e={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const t=n.reduce((i,s)=>{const o=typeof s=="string";let r=!e.nodeLookup&&!o?s:void 0;e.nodeLookup&&(r=o?e.nodeLookup.get(s):lG(s)?s:e.nodeLookup.get(s.id));const a=r?zM(r,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return w5(i,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return C5(t)},QN=(n,e={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return n.forEach(s=>{(e.filter===void 0||e.filter(s))&&(t=w5(t,zM(s)),i=!0)}),i?C5(t):{x:0,y:0,width:0,height:0}},cG=(n,e,[t,i,s]=[0,0,1],o=!1,r=!1)=>{const a={...eD(e,[t,i,s]),width:e.width/s,height:e.height/s},l=[];for(const c of n.values()){const{measured:d,selectable:h=!0,hidden:u=!1}=c;if(r&&!h||u)continue;const f=d.width??c.width??c.initialWidth??null,g=d.height??c.height??c.initialHeight??null,p=qE(a,Jy(c)),m=(f??0)*(g??0),b=o&&p>0;(!c.internals.handleBounds||b||p>=m||c.dragging)&&l.push(c)}return l},lNe=(n,e)=>{const t=new Set;return n.forEach(i=>{t.add(i.id)}),e.filter(i=>t.has(i.source)||t.has(i.target))};function cNe(n,e){const t=new Map,i=e!=null&&e.nodes?new Set(e.nodes.map(s=>s.id)):null;return n.forEach(s=>{s.measured.width&&s.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!s.hidden)&&(!i||i.has(s.id))&&t.set(s.id,s)}),t}async function dNe({nodes:n,width:e,height:t,panZoom:i,minZoom:s,maxZoom:o},r){if(n.size===0)return Promise.resolve(!0);const a=cNe(n,r),l=QN(a),c=dG(l,e,t,(r==null?void 0:r.minZoom)??s,(r==null?void 0:r.maxZoom)??o,(r==null?void 0:r.padding)??.1);return await i.setViewport(c,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)}function Tue({nodeId:n,nextPosition:e,nodeLookup:t,nodeOrigin:i=[0,0],nodeExtent:s,onError:o}){const r=t.get(n),a=r.parentId?t.get(r.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},d=r.origin??i;let h=r.extent||s;if(r.extent==="parent"&&!r.expandParent)if(!a)o==null||o("005",_u.error005());else{const f=a.measured.width,g=a.measured.height;f&&g&&(h=[[l,c],[l+f,c+g]])}else a&&eS(r.extent)&&(h=[[r.extent[0][0]+l,r.extent[0][1]+c],[r.extent[1][0]+l,r.extent[1][1]+c]]);const u=eS(h)?q1(e,h,r.measured):e;return(r.measured.width===void 0||r.measured.height===void 0)&&(o==null||o("015",_u.error015())),{position:{x:u.x-l+(r.measured.width??0)*d[0],y:u.y-c+(r.measured.height??0)*d[1]},positionAbsolute:u}}async function hNe({nodesToRemove:n=[],edgesToRemove:e=[],nodes:t,edges:i,onBeforeDelete:s}){const o=new Set(n.map(u=>u.id)),r=[];for(const u of t){if(u.deletable===!1)continue;const f=o.has(u.id),g=!f&&u.parentId&&r.find(p=>p.id===u.parentId);(f||g)&&r.push(u)}const a=new Set(e.map(u=>u.id)),l=i.filter(u=>u.deletable!==!1),d=lNe(r,l);for(const u of l)a.has(u.id)&&!d.find(g=>g.id===u.id)&&d.push(u);if(!s)return{edges:d,nodes:r};const h=await s({nodes:r,edges:d});return typeof h=="boolean"?h?{edges:d,nodes:r}:{edges:[],nodes:[]}:h}const Qy=(n,e=0,t=1)=>Math.min(Math.max(n,e),t),q1=(n={x:0,y:0},e,t)=>({x:Qy(n.x,e[0][0],e[1][0]-((t==null?void 0:t.width)??0)),y:Qy(n.y,e[0][1],e[1][1]-((t==null?void 0:t.height)??0))});function Rue(n,e,t){const{width:i,height:s}=Wg(t),{x:o,y:r}=t.internals.positionAbsolute;return q1(n,[[o,r],[o+i,r+s]],e)}const Oee=(n,e,t)=>n t?-Qy(Math.abs(n-t),1,e)/e:0,Mue=(n,e,t=15,i=40)=>{const s=Oee(n.x,i,e.width-i)*t,o=Oee(n.y,i,e.height-i)*t;return[s,o]},w5=(n,e)=>({x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}),VB=({x:n,y:e,width:t,height:i})=>({x:n,y:e,x2:n+t,y2:e+i}),C5=({x:n,y:e,x2:t,y2:i})=>({x:n,y:e,width:t-n,height:i-e}),Jy=(n,e=[0,0])=>{var s,o;const{x:t,y:i}=lG(n)?n.internals.positionAbsolute:XN(n,e);return{x:t,y:i,width:((s=n.measured)==null?void 0:s.width)??n.width??n.initialWidth??0,height:((o=n.measured)==null?void 0:o.height)??n.height??n.initialHeight??0}},zM=(n,e=[0,0])=>{var s,o;const{x:t,y:i}=lG(n)?n.internals.positionAbsolute:XN(n,e);return{x:t,y:i,x2:t+(((s=n.measured)==null?void 0:s.width)??n.width??n.initialWidth??0),y2:i+(((o=n.measured)==null?void 0:o.height)??n.height??n.initialHeight??0)}},Aue=(n,e)=>C5(w5(VB(n),VB(e))),qE=(n,e)=>{const t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),i=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return Math.ceil(t*i)},Fee=n=>Od(n.width)&&Od(n.height)&&Od(n.x)&&Od(n.y),Od=n=>!isNaN(n)&&isFinite(n),uNe=(n,e)=>{},JN=(n,e=[1,1])=>({x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}),eD=({x:n,y:e},[t,i,s],o=!1,r=[1,1])=>{const a={x:(n-t)/s,y:(e-i)/s};return o?JN(a,r):a},jM=({x:n,y:e},[t,i,s])=>({x:n*s+t,y:e*s+i});function lC(n,e){if(typeof n=="number")return Math.floor((e-e/(1+n))*.5);if(typeof n=="string"&&n.endsWith("px")){const t=parseFloat(n);if(!Number.isNaN(t))return Math.floor(t)}if(typeof n=="string"&&n.endsWith("%")){const t=parseFloat(n);if(!Number.isNaN(t))return Math.floor(e*t*.01)}return console.error(`[React Flow] The padding value "${n}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function fNe(n,e,t){if(typeof n=="string"||typeof n=="number"){const i=lC(n,t),s=lC(n,e);return{top:i,right:s,bottom:i,left:s,x:s*2,y:i*2}}if(typeof n=="object"){const i=lC(n.top??n.y??0,t),s=lC(n.bottom??n.y??0,t),o=lC(n.left??n.x??0,e),r=lC(n.right??n.x??0,e);return{top:i,right:r,bottom:s,left:o,x:o+r,y:i+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function gNe(n,e,t,i,s,o){const{x:r,y:a}=jM(n,[e,t,i]),{x:l,y:c}=jM({x:n.x+n.width,y:n.y+n.height},[e,t,i]),d=s-l,h=o-c;return{left:Math.floor(r),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(h)}}const dG=(n,e,t,i,s,o)=>{const r=fNe(o,e,t),a=(e-r.x)/n.width,l=(t-r.y)/n.height,c=Math.min(a,l),d=Qy(c,i,s),h=n.x+n.width/2,u=n.y+n.height/2,f=e/2-h*d,g=t/2-u*d,p=gNe(n,f,g,d,e,t),m={left:Math.min(p.left-r.left,0),top:Math.min(p.top-r.top,0),right:Math.min(p.right-r.right,0),bottom:Math.min(p.bottom-r.bottom,0)};return{x:f-m.left+m.right,y:g-m.top+m.bottom,zoom:d}},KE=()=>{var n;return typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)==null?void 0:n.indexOf("Mac"))>=0};function eS(n){return n!=null&&n!=="parent"}function Wg(n){var e,t;return{width:((e=n.measured)==null?void 0:e.width)??n.width??n.initialWidth??0,height:((t=n.measured)==null?void 0:t.height)??n.height??n.initialHeight??0}}function Pue(n){var e,t;return(((e=n.measured)==null?void 0:e.width)??n.width??n.initialWidth)!==void 0&&(((t=n.measured)==null?void 0:t.height)??n.height??n.initialHeight)!==void 0}function Oue(n,e={width:0,height:0},t,i,s){const o={...n},r=i.get(t);if(r){const a=r.origin||s;o.x+=r.internals.positionAbsolute.x-(e.width??0)*a[0],o.y+=r.internals.positionAbsolute.y-(e.height??0)*a[1]}return o}function Bee(n,e){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}function pNe(){let n,e;return{promise:new Promise((i,s)=>{n=i,e=s}),resolve:n,reject:e}}function mNe(n){return{...Eue,...n||{}}}function ok(n,{snapGrid:e=[0,0],snapToGrid:t=!1,transform:i,containerBounds:s}){const{x:o,y:r}=Fd(n),a=eD({x:o-((s==null?void 0:s.left)??0),y:r-((s==null?void 0:s.top)??0)},i),{x:l,y:c}=t?JN(a,e):a;return{xSnapped:l,ySnapped:c,...a}}const hG=n=>({width:n.offsetWidth,height:n.offsetHeight}),Fue=n=>{var e;return((e=n==null?void 0:n.getRootNode)==null?void 0:e.call(n))||(window==null?void 0:window.document)},_Ne=["INPUT","SELECT","TEXTAREA"];function Bue(n){var i,s;const e=((s=(i=n.composedPath)==null?void 0:i.call(n))==null?void 0:s[0])||n.target;return(e==null?void 0:e.nodeType)!==1?!1:_Ne.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const Wue=n=>"clientX"in n,Fd=(n,e)=>{var o,r;const t=Wue(n),i=t?n.clientX:(o=n.touches)==null?void 0:o[0].clientX,s=t?n.clientY:(r=n.touches)==null?void 0:r[0].clientY;return{x:i-((e==null?void 0:e.left)??0),y:s-((e==null?void 0:e.top)??0)}},Wee=(n,e,t,i,s)=>{const o=e.querySelectorAll(`.${n}`);return!o||!o.length?null:Array.from(o).map(r=>{const a=r.getBoundingClientRect();return{id:r.getAttribute("data-handleid"),type:n,nodeId:s,position:r.getAttribute("data-handlepos"),x:(a.left-t.left)/i,y:(a.top-t.top)/i,...hG(r)}})};function Hue({sourceX:n,sourceY:e,targetX:t,targetY:i,sourceControlX:s,sourceControlY:o,targetControlX:r,targetControlY:a}){const l=n*.125+s*.375+r*.375+t*.125,c=e*.125+o*.375+a*.375+i*.125,d=Math.abs(l-n),h=Math.abs(c-e);return[l,c,d,h]}function yT(n,e){return n>=0?.5*n:e*25*Math.sqrt(-n)}function Hee({pos:n,x1:e,y1:t,x2:i,y2:s,c:o}){switch(n){case It.Left:return[e-yT(e-i,o),t];case It.Right:return[e+yT(i-e,o),t];case It.Top:return[e,t-yT(t-s,o)];case It.Bottom:return[e,t+yT(s-t,o)]}}function Vue({sourceX:n,sourceY:e,sourcePosition:t=It.Bottom,targetX:i,targetY:s,targetPosition:o=It.Top,curvature:r=.25}){const[a,l]=Hee({pos:t,x1:n,y1:e,x2:i,y2:s,c:r}),[c,d]=Hee({pos:o,x1:i,y1:s,x2:n,y2:e,c:r}),[h,u,f,g]=Hue({sourceX:n,sourceY:e,targetX:i,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${n},${e} C${a},${l} ${c},${d} ${i},${s}`,h,u,f,g]}function zue({sourceX:n,sourceY:e,targetX:t,targetY:i}){const s=Math.abs(t-n)/2,o=t 0}const wNe=({source:n,sourceHandle:e,target:t,targetHandle:i})=>`xy-edge__${n}${e||""}-${t}${i||""}`,CNe=(n,e)=>e.some(t=>t.source===n.source&&t.target===n.target&&(t.sourceHandle===n.sourceHandle||!t.sourceHandle&&!n.sourceHandle)&&(t.targetHandle===n.targetHandle||!t.targetHandle&&!n.targetHandle)),yNe=(n,e,t={})=>{if(!n.source||!n.target)return e;const i=t.getEdgeId||wNe;let s;return Due(n)?s={...n}:s={...n,id:i(n)},CNe(s,e)?e:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,e.concat(s))};function jue({sourceX:n,sourceY:e,targetX:t,targetY:i}){const[s,o,r,a]=zue({sourceX:n,sourceY:e,targetX:t,targetY:i});return[`M ${n},${e}L ${t},${i}`,s,o,r,a]}const Vee={[It.Left]:{x:-1,y:0},[It.Right]:{x:1,y:0},[It.Top]:{x:0,y:-1},[It.Bottom]:{x:0,y:1}},SNe=({source:n,sourcePosition:e=It.Bottom,target:t})=>e===It.Left||e===It.Right?n.x Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2));function xNe({source:n,sourcePosition:e=It.Bottom,target:t,targetPosition:i=It.Top,center:s,offset:o,stepPosition:r}){const a=Vee[e],l=Vee[i],c={x:n.x+a.x*o,y:n.y+a.y*o},d={x:t.x+l.x*o,y:t.y+l.y*o},h=SNe({source:c,sourcePosition:e,target:d}),u=h.x!==0?"x":"y",f=h[u];let g=[],p,m;const b={x:0,y:0},v={x:0,y:0},[,,w,C]=zue({sourceX:n.x,sourceY:n.y,targetX:t.x,targetY:t.y});if(a[u]*l[u]===-1){u==="x"?(p=s.x??c.x+(d.x-c.x)*r,m=s.y??(c.y+d.y)/2):(p=s.x??(c.x+d.x)/2,m=s.y??c.y+(d.y-c.y)*r);const L=[{x:p,y:c.y},{x:p,y:d.y}],x=[{x:c.x,y:m},{x:d.x,y:m}];a[u]===f?g=u==="x"?L:x:g=u==="x"?x:L}else{const L=[{x:c.x,y:d.y}],x=[{x:d.x,y:c.y}];if(u==="x"?g=a.x===f?x:L:g=a.y===f?L:x,e===i){const A=Math.abs(n[u]-t[u]);if(A<=o){const W=Math.min(o-1,o-A);a[u]===f?b[u]=(c[u]>n[u]?-1:1)*W:v[u]=(d[u]>t[u]?-1:1)*W}}if(e!==i){const A=u==="x"?"y":"x",W=a[u]===l[A],P=c[A]>d[A],B=c[A] =M?(p=(E.x+I.x)/2,m=g[0].y):(p=g[0].x,m=(E.y+I.y)/2)}return[[n,{x:c.x+b.x,y:c.y+b.y},...g,{x:d.x+v.x,y:d.y+v.y},t],p,m,w,C]}function LNe(n,e,t,i){const s=Math.min(zee(n,e)/2,zee(e,t)/2,i),{x:o,y:r}=e;if(n.x===o&&o===t.x||n.y===r&&r===t.y)return`L${o} ${r}`;if(n.y===r){const c=n.x {let C="";return w>0&&w t.id===e):n[0])||null}function jB(n,e){return n?typeof n=="string"?n:`${e?`${e}__`:""}${Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join("&")}`:""}function ENe(n,{id:e,defaultColor:t,defaultMarkerStart:i,defaultMarkerEnd:s}){const o=new Set;return n.reduce((r,a)=>([a.markerStart||i,a.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const c=jB(l,e);o.has(c)||(r.push({id:c,color:l.color||t,...l}),o.add(c))}}),r),[]).sort((r,a)=>r.id.localeCompare(a.id))}const $ue=1e3,INe=10,uG={nodeOrigin:[0,0],nodeExtent:$E,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},NNe={...uG,checkEquality:!0};function fG(n,e){const t={...n};for(const i in e)e[i]!==void 0&&(t[i]=e[i]);return t}function DNe(n,e,t){const i=fG(uG,t);for(const s of n.values())if(s.parentId)pG(s,n,e,i);else{const o=XN(s,i.nodeOrigin),r=eS(s.extent)?s.extent:i.nodeExtent,a=q1(o,r,Wg(s));s.internals.positionAbsolute=a}}function TNe(n,e){if(!n.handles)return n.measured?e==null?void 0:e.internals.handleBounds:void 0;const t=[],i=[];for(const s of n.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:n.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(o):s.type==="target"&&i.push(o)}return{source:t,target:i}}function gG(n){return n==="manual"}function $B(n,e,t,i={}){var c,d;const s=fG(NNe,i),o={i:0},r=new Map(e),a=s!=null&&s.elevateNodesOnSelect&&!gG(s.zIndexMode)?$ue:0;let l=n.length>0;e.clear(),t.clear();for(const h of n){let u=r.get(h.id);if(s.checkEquality&&h===(u==null?void 0:u.internals.userNode))e.set(h.id,u);else{const f=XN(h,s.nodeOrigin),g=eS(h.extent)?h.extent:s.nodeExtent,p=q1(f,g,Wg(h));u={...s.defaults,...h,measured:{width:(c=h.measured)==null?void 0:c.width,height:(d=h.measured)==null?void 0:d.height},internals:{positionAbsolute:p,handleBounds:TNe(h,u),z:Uue(h,a,s.zIndexMode),userNode:h}},e.set(h.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(l=!1),h.parentId&&pG(u,e,t,i,o)}return l}function RNe(n,e){if(!n.parentId)return;const t=e.get(n.parentId);t?t.set(n.id,n):e.set(n.parentId,new Map([[n.id,n]]))}function pG(n,e,t,i,s){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:a,zIndexMode:l}=fG(uG,i),c=n.parentId,d=e.get(c);if(!d){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}RNe(n,t),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*INe),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const h=o&&!gG(l)?$ue:0,{x:u,y:f,z:g}=MNe(n,d,r,a,h,l),{positionAbsolute:p}=n.internals,m=u!==p.x||f!==p.y;(m||g!==n.internals.z)&&e.set(n.id,{...n,internals:{...n.internals,positionAbsolute:m?{x:u,y:f}:p,z:g}})}function Uue(n,e,t){const i=Od(n.zIndex)?n.zIndex:0;return gG(t)?i:i+(n.selected?e:0)}function MNe(n,e,t,i,s,o){const{x:r,y:a}=e.internals.positionAbsolute,l=Wg(n),c=XN(n,t),d=eS(n.extent)?q1(c,n.extent,l):c;let h=q1({x:r+d.x,y:a+d.y},i,l);n.extent==="parent"&&(h=Rue(h,l,e));const u=Uue(n,s,o),f=e.internals.z??0;return{x:h.x,y:h.y,z:f>=u?f+1:u}}function mG(n,e,t,i=[0,0]){var r;const s=[],o=new Map;for(const a of n){const l=e.get(a.parentId);if(!l)continue;const c=((r=o.get(a.parentId))==null?void 0:r.expandedRect)??Jy(l),d=Aue(c,a.rect);o.set(a.parentId,{expandedRect:d,parent:l})}return o.size>0&&o.forEach(({expandedRect:a,parent:l},c)=>{var w;const d=l.internals.positionAbsolute,h=Wg(l),u=l.origin??i,f=a.x 0||g>0||b||v)&&(s.push({id:c,type:"position",position:{x:l.position.x-f+b,y:l.position.y-g+v}}),(w=t.get(c))==null||w.forEach(C=>{n.some(S=>S.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+f,y:C.position.y+g}})})),(h.width 0){const f=mG(u,e,t,s);c.push(...f)}return{changes:c,updatedInternals:l}}async function PNe({delta:n,panZoom:e,transform:t,translateExtent:i,width:s,height:o}){if(!e||!n.x&&!n.y)return Promise.resolve(!1);const r=await e.setViewportConstrained({x:t[0]+n.x,y:t[1]+n.y,zoom:t[2]},[[0,0],[s,o]],i),a=!!r&&(r.x!==t[0]||r.y!==t[1]||r.k!==t[2]);return Promise.resolve(a)}function qee(n,e,t,i,s,o){let r=s;const a=i.get(r)||new Map;i.set(r,a.set(t,e)),r=`${s}-${n}`;const l=i.get(r)||new Map;if(i.set(r,l.set(t,e)),o){r=`${s}-${n}-${o}`;const c=i.get(r)||new Map;i.set(r,c.set(t,e))}}function que(n,e,t){n.clear(),e.clear();for(const i of t){const{source:s,target:o,sourceHandle:r=null,targetHandle:a=null}=i,l={edgeId:i.id,source:s,target:o,sourceHandle:r,targetHandle:a},c=`${s}-${r}--${o}-${a}`,d=`${o}-${a}--${s}-${r}`;qee("source",l,d,n,s,r),qee("target",l,c,n,o,a),e.set(i.id,i)}}function Kue(n,e){if(!n.parentId)return!1;const t=e.get(n.parentId);return t?t.selected?!0:Kue(t,e):!1}function Kee(n,e,t){var s;let i=n;do{if((s=i==null?void 0:i.matches)!=null&&s.call(i,e))return!0;if(i===t)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function ONe(n,e,t,i){const s=new Map;for(const[o,r]of n)if((r.selected||r.id===i)&&(!r.parentId||!Kue(r,n))&&(r.draggable||e&&typeof r.draggable>"u")){const a=n.get(o);a&&s.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:t.x-a.internals.positionAbsolute.x,y:t.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return s}function J8({nodeId:n,dragItems:e,nodeLookup:t,dragging:i=!0}){var r,a,l;const s=[];for(const[c,d]of e){const h=(r=t.get(c))==null?void 0:r.internals.userNode;h&&s.push({...h,position:d.position,dragging:i})}if(!n)return[s[0],s];const o=(a=t.get(n))==null?void 0:a.internals.userNode;return[o?{...o,position:((l=e.get(n))==null?void 0:l.position)||o.position,dragging:i}:s[0],s]}function FNe({dragItems:n,snapGrid:e,x:t,y:i}){const s=n.values().next().value;if(!s)return null;const o={x:t-s.distance.x,y:i-s.distance.y},r=JN(o,e);return{x:r.x-o.x,y:r.y-o.y}}function BNe({onNodeMouseDown:n,getStoreItems:e,onDragStart:t,onDrag:i,onDragStop:s}){let o={x:null,y:null},r=0,a=new Map,l=!1,c={x:0,y:0},d=null,h=!1,u=null,f=!1,g=!1,p=null;function m({noDragClassName:v,handleSelector:w,domNode:C,isSelectable:S,nodeId:L,nodeClickDistance:x=0}){u=Wl(C);function E({x:A,y:W}){const{nodeLookup:P,nodeExtent:B,snapGrid:V,snapToGrid:K,nodeOrigin:z,onNodeDrag:j,onSelectionDrag:Q,onError:Y,updateNodePositions:te}=e();o={x:A,y:W};let ce=!1;const Ce=a.size>1,xe=Ce&&B?VB(QN(a)):null,je=Ce&&K?FNe({dragItems:a,snapGrid:V,x:A,y:W}):null;for(const[ke,Le]of a){if(!P.has(ke))continue;let Ve={x:A-Le.distance.x,y:W-Le.distance.y};K&&(Ve=je?{x:Math.round(Ve.x+je.x),y:Math.round(Ve.y+je.y)}:JN(Ve,V));let ct=null;if(Ce&&B&&!Le.extent&&xe){const{positionAbsolute:tt}=Le.internals,Tt=tt.x-xe.x+B[0][0],Si=tt.x+Le.measured.width-xe.x2+B[1][0],Vt=tt.y-xe.y+B[0][1],In=tt.y+Le.measured.height-xe.y2+B[1][1];ct=[[Tt,Vt],[Si,In]]}const{position:dt,positionAbsolute:Be}=Tue({nodeId:ke,nextPosition:Ve,nodeLookup:P,nodeExtent:ct||B,nodeOrigin:z,onError:Y});ce=ce||Le.position.x!==dt.x||Le.position.y!==dt.y,Le.position=dt,Le.internals.positionAbsolute=Be}if(g=g||ce,!!ce&&(te(a,!0),p&&(i||j||!L&&Q))){const[ke,Le]=J8({nodeId:L,dragItems:a,nodeLookup:P});i==null||i(p,a,ke,Le),j==null||j(p,ke,Le),L||Q==null||Q(p,Le)}}async function I(){if(!d)return;const{transform:A,panBy:W,autoPanSpeed:P,autoPanOnNodeDrag:B}=e();if(!B){l=!1,cancelAnimationFrame(r);return}const[V,K]=Mue(c,d,P);(V!==0||K!==0)&&(o.x=(o.x??0)-V/A[2],o.y=(o.y??0)-K/A[2],await W({x:V,y:K})&&E(o)),r=requestAnimationFrame(I)}function R(A){var Ce;const{nodeLookup:W,multiSelectionActive:P,nodesDraggable:B,transform:V,snapGrid:K,snapToGrid:z,selectNodesOnDrag:j,onNodeDragStart:Q,onSelectionDragStart:Y,unselectNodesAndEdges:te}=e();h=!0,(!j||!S)&&!P&&L&&((Ce=W.get(L))!=null&&Ce.selected||te()),S&&j&&L&&(n==null||n(L));const ce=ok(A.sourceEvent,{transform:V,snapGrid:K,snapToGrid:z,containerBounds:d});if(o=ce,a=ONe(W,B,ce,L),a.size>0&&(t||Q||!L&&Y)){const[xe,je]=J8({nodeId:L,dragItems:a,nodeLookup:W});t==null||t(A.sourceEvent,a,xe,je),Q==null||Q(A.sourceEvent,xe,je),L||Y==null||Y(A.sourceEvent,je)}}const M=due().clickDistance(x).on("start",A=>{const{domNode:W,nodeDragThreshold:P,transform:B,snapGrid:V,snapToGrid:K}=e();d=(W==null?void 0:W.getBoundingClientRect())||null,f=!1,g=!1,p=A.sourceEvent,P===0&&R(A),o=ok(A.sourceEvent,{transform:B,snapGrid:V,snapToGrid:K,containerBounds:d}),c=Fd(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:W,transform:P,snapGrid:B,snapToGrid:V,nodeDragThreshold:K,nodeLookup:z}=e(),j=ok(A.sourceEvent,{transform:P,snapGrid:B,snapToGrid:V,containerBounds:d});if(p=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||L&&!z.has(L))&&(f=!0),!f){if(!l&&W&&h&&(l=!0,I()),!h){const Q=Fd(A.sourceEvent,d),Y=Q.x-c.x,te=Q.y-c.y;Math.sqrt(Y*Y+te*te)>K&&R(A)}(o.x!==j.xSnapped||o.y!==j.ySnapped)&&a&&h&&(c=Fd(A.sourceEvent,d),E(j))}}).on("end",A=>{if(!(!h||f)&&(l=!1,h=!1,cancelAnimationFrame(r),a.size>0)){const{nodeLookup:W,updateNodePositions:P,onNodeDragStop:B,onSelectionDragStop:V}=e();if(g&&(P(a,!1),g=!1),s||B||!L&&V){const[K,z]=J8({nodeId:L,dragItems:a,nodeLookup:W,dragging:!1});s==null||s(A.sourceEvent,a,K,z),B==null||B(A.sourceEvent,K,z),L||V==null||V(A.sourceEvent,z)}}}).filter(A=>{const W=A.target;return!A.button&&(!v||!Kee(W,`.${v}`,C))&&(!w||Kee(W,w,C))});u.call(M)}function b(){u==null||u.on(".drag",null)}return{update:m,destroy:b}}function WNe(n,e,t){const i=[],s={x:n.x-t,y:n.y-t,width:t*2,height:t*2};for(const o of e.values())qE(s,Jy(o))>0&&i.push(o);return i}const HNe=250;function VNe(n,e,t,i){var a,l;let s=[],o=1/0;const r=WNe(n,t,e+HNe);for(const c of r){const d=[...((a=c.internals.handleBounds)==null?void 0:a.source)??[],...((l=c.internals.handleBounds)==null?void 0:l.target)??[]];for(const h of d){if(i.nodeId===h.nodeId&&i.type===h.type&&i.id===h.id)continue;const{x:u,y:f}=K1(c,h,h.position,!0),g=Math.sqrt(Math.pow(u-n.x,2)+Math.pow(f-n.y,2));g>e||(g 1){const c=i.type==="source"?"target":"source";return s.find(d=>d.type===c)??s[0]}return s[0]}function Gue(n,e,t,i,s,o=!1){var c,d,h;const r=i.get(n);if(!r)return null;const a=s==="strict"?(c=r.internals.handleBounds)==null?void 0:c[e]:[...((d=r.internals.handleBounds)==null?void 0:d.source)??[],...((h=r.internals.handleBounds)==null?void 0:h.target)??[]],l=(t?a==null?void 0:a.find(u=>u.id===t):a==null?void 0:a[0])??null;return l&&o?{...l,...K1(r,l,l.position,!0)}:l}function Yue(n,e){return n||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function zNe(n,e){let t=null;return e?t=!0:n&&!e&&(t=!1),t}const Zue=()=>!0;function jNe(n,{connectionMode:e,connectionRadius:t,handleId:i,nodeId:s,edgeUpdaterType:o,isTarget:r,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:d,flowId:h,panBy:u,cancelConnection:f,onConnectStart:g,onConnect:p,onConnectEnd:m,isValidConnection:b=Zue,onReconnectEnd:v,updateConnection:w,getTransform:C,getFromHandle:S,autoPanSpeed:L,dragThreshold:x=1,handleDomNode:E}){const I=Fue(n.target);let R=0,M;const{x:A,y:W}=Fd(n),P=Yue(o,E),B=a==null?void 0:a.getBoundingClientRect();let V=!1;if(!B||!P)return;const K=Gue(s,P,i,l,e);if(!K)return;let z=Fd(n,B),j=!1,Q=null,Y=!1,te=null;function ce(){if(!d||!B)return;const[dt,Be]=Mue(z,B,L);u({x:dt,y:Be}),R=requestAnimationFrame(ce)}const Ce={...K,nodeId:s,type:P,position:K.position},xe=l.get(s);let ke={inProgress:!0,isValid:null,from:K1(xe,Ce,It.Left,!0),fromHandle:Ce,fromPosition:Ce.position,fromNode:xe,to:z,toHandle:null,toPosition:Pee[Ce.position],toNode:null,pointer:z};function Le(){V=!0,w(ke),g==null||g(n,{nodeId:s,handleId:i,handleType:P})}x===0&&Le();function Ve(dt){if(!V){const{x:In,y:Nn}=Fd(dt),Os=In-A,Da=Nn-W;if(!(Os*Os+Da*Da>x*x))return;Le()}if(!S()||!Ce){ct(dt);return}const Be=C();z=Fd(dt,B),M=VNe(eD(z,Be,!1,[1,1]),t,l,Ce),j||(ce(),j=!0);const tt=Xue(dt,{handle:M,connectionMode:e,fromNodeId:s,fromHandleId:i,fromType:r?"target":"source",isValidConnection:b,doc:I,lib:c,flowId:h,nodeLookup:l});te=tt.handleDomNode,Q=tt.connection,Y=zNe(!!M,tt.isValid);const Tt=l.get(s),Si=Tt?K1(Tt,Ce,It.Left,!0):ke.from,Vt={...ke,from:Si,isValid:Y,to:tt.toHandle&&Y?jM({x:tt.toHandle.x,y:tt.toHandle.y},Be):z,toHandle:tt.toHandle,toPosition:Y&&tt.toHandle?tt.toHandle.position:Pee[Ce.position],toNode:tt.toHandle?l.get(tt.toHandle.nodeId):null,pointer:z};w(Vt),ke=Vt}function ct(dt){if(!("touches"in dt&&dt.touches.length>0)){if(V){(M||te)&&Q&&Y&&(p==null||p(Q));const{inProgress:Be,...tt}=ke,Tt={...tt,toPosition:ke.toHandle?ke.toPosition:null};m==null||m(dt,Tt),o&&(v==null||v(dt,Tt))}f(),cancelAnimationFrame(R),j=!1,Y=!1,Q=null,te=null,I.removeEventListener("mousemove",Ve),I.removeEventListener("mouseup",ct),I.removeEventListener("touchmove",Ve),I.removeEventListener("touchend",ct)}}I.addEventListener("mousemove",Ve),I.addEventListener("mouseup",ct),I.addEventListener("touchmove",Ve),I.addEventListener("touchend",ct)}function Xue(n,{handle:e,connectionMode:t,fromNodeId:i,fromHandleId:s,fromType:o,doc:r,lib:a,flowId:l,isValidConnection:c=Zue,nodeLookup:d}){const h=o==="target",u=e?r.querySelector(`.${a}-flow__handle[data-id="${l}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:f,y:g}=Fd(n),p=r.elementFromPoint(f,g),m=p!=null&&p.classList.contains(`${a}-flow__handle`)?p:u,b={handleDomNode:m,isValid:!1,connection:null,toHandle:null};if(m){const v=Yue(void 0,m),w=m.getAttribute("data-nodeid"),C=m.getAttribute("data-handleid"),S=m.classList.contains("connectable"),L=m.classList.contains("connectableend");if(!w||!v)return b;const x={source:h?w:i,sourceHandle:h?C:s,target:h?i:w,targetHandle:h?s:C};b.connection=x;const I=S&&L&&(t===Xy.Strict?h&&v==="source"||!h&&v==="target":w!==i||C!==s);b.isValid=I&&c(x),b.toHandle=Gue(w,v,C,d,t,!0)}return b}const UB={onPointerDown:jNe,isValid:Xue};function $Ne({domNode:n,panZoom:e,getTransform:t,getViewScale:i}){const s=Wl(n);function o({translateExtent:a,width:l,height:c,zoomStep:d=1,pannable:h=!0,zoomable:u=!0,inversePan:f=!1}){const g=w=>{if(w.sourceEvent.type!=="wheel"||!e)return;const C=t(),S=w.sourceEvent.ctrlKey&&KE()?10:1,L=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*d,x=C[2]*Math.pow(2,L*S);e.scaleTo(x)};let p=[0,0];const m=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(p=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},b=w=>{const C=t();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!e)return;const S=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],L=[S[0]-p[0],S[1]-p[1]];p=S;const x=i()*Math.max(C[2],Math.log(C[2]))*(f?-1:1),E={x:C[0]-L[0]*x,y:C[1]-L[1]*x},I=[[0,0],[l,c]];e.setViewportConstrained({x:E.x,y:E.y,zoom:C[2]},I,a)},v=Lue().on("start",m).on("zoom",h?b:null).on("zoom.wheel",u?g:null);s.call(v,{})}function r(){s.on("zoom",null)}return{update:o,destroy:r,pointer:yd}}const y5=n=>({x:n.x,y:n.y,zoom:n.k}),e7=({x:n,y:e,zoom:t})=>v5.translate(n,e).scale(t),i0=(n,e)=>n.target.closest(`.${e}`),Que=(n,e)=>e===2&&Array.isArray(n)&&n.includes(2),UNe=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,t7=(n,e=0,t=UNe,i=()=>{})=>{const s=typeof e=="number"&&e>0;return s||i(),s?n.transition().duration(e).ease(t).on("end",i):n},Jue=n=>{const e=n.ctrlKey&&KE()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*e};function qNe({zoomPanValues:n,noWheelClassName:e,d3Selection:t,d3Zoom:i,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:r,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return d=>{if(i0(d,e))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const h=t.property("__zoom").k||1;if(d.ctrlKey&&r){const m=yd(d),b=Jue(d),v=h*Math.pow(2,b);i.scaleTo(t,v,m,d);return}const u=d.deltaMode===1?20:1;let f=s===xv.Vertical?0:d.deltaX*u,g=s===xv.Horizontal?0:d.deltaY*u;!KE()&&d.shiftKey&&s!==xv.Vertical&&(f=d.deltaY*u,g=0),i.translateBy(t,-(f/h)*o,-(g/h)*o,{internal:!0});const p=y5(t.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?(l==null||l(d,p),n.panScrollTimeout=setTimeout(()=>{c==null||c(d,p),n.isPanScrolling=!1},150)):(n.isPanScrolling=!0,a==null||a(d,p))}}function KNe({noWheelClassName:n,preventScrolling:e,d3ZoomHandler:t}){return function(i,s){const o=i.type==="wheel",r=!e&&o&&!i.ctrlKey,a=i0(i,n);if(i.ctrlKey&&o&&a&&i.preventDefault(),r||a)return null;i.preventDefault(),t.call(this,i,s)}}function GNe({zoomPanValues:n,onDraggingChange:e,onPanZoomStart:t}){return i=>{var o,r,a;if((o=i.sourceEvent)!=null&&o.internal)return;const s=y5(i.transform);n.mouseButton=((r=i.sourceEvent)==null?void 0:r.button)||0,n.isZoomingOrPanning=!0,n.prevViewport=s,((a=i.sourceEvent)==null?void 0:a.type)==="mousedown"&&e(!0),t&&(t==null||t(i.sourceEvent,s))}}function YNe({zoomPanValues:n,panOnDrag:e,onPaneContextMenu:t,onTransformChange:i,onPanZoom:s}){return o=>{var r,a;n.usedRightMouseButton=!!(t&&Que(e,n.mouseButton??0)),(r=o.sourceEvent)!=null&&r.sync||i([o.transform.x,o.transform.y,o.transform.k]),s&&!((a=o.sourceEvent)!=null&&a.internal)&&(s==null||s(o.sourceEvent,y5(o.transform)))}}function ZNe({zoomPanValues:n,panOnDrag:e,panOnScroll:t,onDraggingChange:i,onPanZoomEnd:s,onPaneContextMenu:o}){return r=>{var a;if(!((a=r.sourceEvent)!=null&&a.internal)&&(n.isZoomingOrPanning=!1,o&&Que(e,n.mouseButton??0)&&!n.usedRightMouseButton&&r.sourceEvent&&o(r.sourceEvent),n.usedRightMouseButton=!1,i(!1),s)){const l=y5(r.transform);n.prevViewport=l,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{s==null||s(r.sourceEvent,l)},t?150:0)}}}function XNe({zoomActivationKeyPressed:n,zoomOnScroll:e,zoomOnPinch:t,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:r,noWheelClassName:a,noPanClassName:l,lib:c,connectionInProgress:d}){return h=>{var m;const u=n||e,f=t&&h.ctrlKey,g=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(i0(h,`${c}-flow__node`)||i0(h,`${c}-flow__edge`)))return!0;if(!i&&!u&&!s&&!o&&!t||r||d&&!g||i0(h,a)&&g||i0(h,l)&&(!g||s&&g&&!n)||!t&&h.ctrlKey&&g)return!1;if(!t&&h.type==="touchstart"&&((m=h.touches)==null?void 0:m.length)>1)return h.preventDefault(),!1;if(!u&&!s&&!f&&g||!i&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(i)&&!i.includes(h.button)&&h.type==="mousedown")return!1;const p=Array.isArray(i)&&i.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||g)&&p}}function QNe({domNode:n,minZoom:e,maxZoom:t,translateExtent:i,viewport:s,onPanZoom:o,onPanZoomStart:r,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=n.getBoundingClientRect(),h=Lue().scaleExtent([e,t]).translateExtent(i),u=Wl(n).call(h);v({x:s.x,y:s.y,zoom:Qy(s.zoom,e,t)},[[0,0],[d.width,d.height]],i);const f=u.on("wheel.zoom"),g=u.on("dblclick.zoom");h.wheelDelta(Jue);function p(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:mR).transform(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function m({noWheelClassName:M,noPanClassName:A,onPaneContextMenu:W,userSelectionActive:P,panOnScroll:B,panOnDrag:V,panOnScrollMode:K,panOnScrollSpeed:z,preventScrolling:j,zoomOnPinch:Q,zoomOnScroll:Y,zoomOnDoubleClick:te,zoomActivationKeyPressed:ce,lib:Ce,onTransformChange:xe,connectionInProgress:je,paneClickDistance:ke,selectionOnDrag:Le}){P&&!c.isZoomingOrPanning&&b();const Ve=B&&!ce&&!P;h.clickDistance(Le?1/0:!Od(ke)||ke<0?0:ke);const ct=Ve?qNe({zoomPanValues:c,noWheelClassName:M,d3Selection:u,d3Zoom:h,panOnScrollMode:K,panOnScrollSpeed:z,zoomOnPinch:Q,onPanZoomStart:r,onPanZoom:o,onPanZoomEnd:a}):KNe({noWheelClassName:M,preventScrolling:j,d3ZoomHandler:f});if(u.on("wheel.zoom",ct,{passive:!1}),!P){const Be=GNe({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:r});h.on("start",Be);const tt=YNe({zoomPanValues:c,panOnDrag:V,onPaneContextMenu:!!W,onPanZoom:o,onTransformChange:xe});h.on("zoom",tt);const Tt=ZNe({zoomPanValues:c,panOnDrag:V,panOnScroll:B,onPaneContextMenu:W,onPanZoomEnd:a,onDraggingChange:l});h.on("end",Tt)}const dt=XNe({zoomActivationKeyPressed:ce,panOnDrag:V,zoomOnScroll:Y,panOnScroll:B,zoomOnDoubleClick:te,zoomOnPinch:Q,userSelectionActive:P,noPanClassName:A,noWheelClassName:M,lib:Ce,connectionInProgress:je});h.filter(dt),te?u.on("dblclick.zoom",g):u.on("dblclick.zoom",null)}function b(){h.on("zoom",null)}async function v(M,A,W){const P=e7(M),B=h==null?void 0:h.constrain()(P,A,W);return B&&await p(B),new Promise(V=>V(B))}async function w(M,A){const W=e7(M);return await p(W,A),new Promise(P=>P(W))}function C(M){if(u){const A=e7(M),W=u.property("__zoom");(W.k!==M.zoom||W.x!==M.x||W.y!==M.y)&&(h==null||h.transform(u,A,null,{sync:!0}))}}function S(){const M=u?xue(u.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function L(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:mR).scaleTo(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function x(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:mR).scaleBy(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function E(M){h==null||h.scaleExtent(M)}function I(M){h==null||h.translateExtent(M)}function R(M){const A=!Od(M)||M<0?0:M;h==null||h.clickDistance(A)}return{update:m,destroy:b,setViewport:w,setViewportConstrained:v,getViewport:S,scaleTo:L,scaleBy:x,setScaleExtent:E,setTranslateExtent:I,syncViewport:C,setClickDistance:R}}var tS;(function(n){n.Line="line",n.Handle="handle"})(tS||(tS={}));function JNe({width:n,prevWidth:e,height:t,prevHeight:i,affectsX:s,affectsY:o}){const r=n-e,a=t-i,l=[r>0?1:r<0?-1:0,a>0?1:a<0?-1:0];return r&&s&&(l[0]=l[0]*-1),a&&o&&(l[1]=l[1]*-1),l}function Gee(n){const e=n.includes("right")||n.includes("left"),t=n.includes("bottom")||n.includes("top"),i=n.includes("left"),s=n.includes("top");return{isHorizontal:e,isVertical:t,affectsX:i,affectsY:s}}function op(n,e){return Math.max(0,e-n)}function rp(n,e){return Math.max(0,n-e)}function ST(n,e,t){return Math.max(0,e-n,n-t)}function Yee(n,e){return n?!e:e}function eDe(n,e,t,i,s,o,r,a){let{affectsX:l,affectsY:c}=e;const{isHorizontal:d,isVertical:h}=e,u=d&&h,{xSnapped:f,ySnapped:g}=t,{minWidth:p,maxWidth:m,minHeight:b,maxHeight:v}=i,{x:w,y:C,width:S,height:L,aspectRatio:x}=n;let E=Math.floor(d?f-n.pointerX:0),I=Math.floor(h?g-n.pointerY:0);const R=S+(l?-E:E),M=L+(c?-I:I),A=-o[0]*S,W=-o[1]*L;let P=ST(R,p,m),B=ST(M,b,v);if(r){let z=0,j=0;l&&E<0?z=op(w+E+A,r[0][0]):!l&&E>0&&(z=rp(w+R+A,r[1][0])),c&&I<0?j=op(C+I+W,r[0][1]):!c&&I>0&&(j=rp(C+M+W,r[1][1])),P=Math.max(P,z),B=Math.max(B,j)}if(a){let z=0,j=0;l&&E>0?z=rp(w+E,a[0][0]):!l&&E<0&&(z=op(w+R,a[1][0])),c&&I>0?j=rp(C+I,a[0][1]):!c&&I<0&&(j=op(C+M,a[1][1])),P=Math.max(P,z),B=Math.max(B,j)}if(s){if(d){const z=ST(R/x,b,v)*x;if(P=Math.max(P,z),r){let j=0;!l&&!c||l&&!c&&u?j=rp(C+W+R/x,r[1][1])*x:j=op(C+W+(l?E:-E)/x,r[0][1])*x,P=Math.max(P,j)}if(a){let j=0;!l&&!c||l&&!c&&u?j=op(C+R/x,a[1][1])*x:j=rp(C+(l?E:-E)/x,a[0][1])*x,P=Math.max(P,j)}}if(h){const z=ST(M*x,p,m)/x;if(B=Math.max(B,z),r){let j=0;!l&&!c||c&&!l&&u?j=rp(w+M*x+A,r[1][0])/x:j=op(w+(c?I:-I)*x+A,r[0][0])/x,B=Math.max(B,j)}if(a){let j=0;!l&&!c||c&&!l&&u?j=op(w+M*x,a[1][0])/x:j=rp(w+(c?I:-I)*x,a[0][0])/x,B=Math.max(B,j)}}}I=I+(I<0?B:-B),E=E+(E<0?P:-P),s&&(u?R>M*x?I=(Yee(l,c)?-E:E)/x:E=(Yee(l,c)?-I:I)*x:d?(I=E/x,c=l):(E=I*x,l=c));const V=l?w+E:w,K=c?C+I:C;return{width:S+(l?-E:E),height:L+(c?-I:I),x:o[0]*E*(l?-1:1)+V,y:o[1]*I*(c?-1:1)+K}}const efe={width:0,height:0,x:0,y:0},tDe={...efe,pointerX:0,pointerY:0,aspectRatio:1};function iDe(n){return[[0,0],[n.measured.width,n.measured.height]]}function nDe(n,e,t){const i=e.position.x+n.position.x,s=e.position.y+n.position.y,o=n.measured.width??0,r=n.measured.height??0,a=t[0]*o,l=t[1]*r;return[[i-a,s-l],[i+o-a,s+r-l]]}function sDe({domNode:n,nodeId:e,getStoreItems:t,onChange:i,onEnd:s}){const o=Wl(n);let r={controlDirection:Gee("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:d,keepAspectRatio:h,resizeDirection:u,onResizeStart:f,onResize:g,onResizeEnd:p,shouldResize:m}){let b={...efe},v={...tDe};r={boundaries:d,resizeDirection:u,keepAspectRatio:h,controlDirection:Gee(c)};let w,C=null,S=[],L,x,E,I=!1;const R=due().on("start",M=>{const{nodeLookup:A,transform:W,snapGrid:P,snapToGrid:B,nodeOrigin:V,paneDomNode:K}=t();if(w=A.get(e),!w)return;C=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:j}=ok(M.sourceEvent,{transform:W,snapGrid:P,snapToGrid:B,containerBounds:C});b={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},v={...b,pointerX:z,pointerY:j,aspectRatio:b.width/b.height},L=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(L=A.get(w.parentId),x=L&&w.extent==="parent"?iDe(L):void 0),S=[],E=void 0;for(const[Q,Y]of A)if(Y.parentId===e&&(S.push({id:Q,position:{...Y.position},extent:Y.extent}),Y.extent==="parent"||Y.expandParent)){const te=nDe(Y,w,Y.origin??V);E?E=[[Math.min(te[0][0],E[0][0]),Math.min(te[0][1],E[0][1])],[Math.max(te[1][0],E[1][0]),Math.max(te[1][1],E[1][1])]]:E=te}f==null||f(M,{...b})}).on("drag",M=>{const{transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B}=t(),V=ok(M.sourceEvent,{transform:A,snapGrid:W,snapToGrid:P,containerBounds:C}),K=[];if(!w)return;const{x:z,y:j,width:Q,height:Y}=b,te={},ce=w.origin??B,{width:Ce,height:xe,x:je,y:ke}=eDe(v,r.controlDirection,V,r.boundaries,r.keepAspectRatio,ce,x,E),Le=Ce!==Q,Ve=xe!==Y,ct=je!==z&&Le,dt=ke!==j&&Ve;if(!ct&&!dt&&!Le&&!Ve)return;if((ct||dt||ce[0]===1||ce[1]===1)&&(te.x=ct?je:b.x,te.y=dt?ke:b.y,b.x=te.x,b.y=te.y,S.length>0)){const Si=je-z,Vt=ke-j;for(const In of S)In.position={x:In.position.x-Si+ce[0]*(Ce-Q),y:In.position.y-Vt+ce[1]*(xe-Y)},K.push(In)}if((Le||Ve)&&(te.width=Le&&(!r.resizeDirection||r.resizeDirection==="horizontal")?Ce:b.width,te.height=Ve&&(!r.resizeDirection||r.resizeDirection==="vertical")?xe:b.height,b.width=te.width,b.height=te.height),L&&w.expandParent){const Si=ce[0]*(te.width??0);te.x&&te.x {I&&(p==null||p(M,{...b}),s==null||s({...b}),I=!1)});o.call(R)}function l(){o.on(".drag",null)}return{update:a,destroy:l}}var tfe={exports:{}},ife={},nfe={exports:{}},sfe={};/** * @license React * use-sync-external-store-shim.production.js * @@ -45,7 +45,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var eS=$;function tDe(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var iDe=typeof Object.is=="function"?Object.is:tDe,nDe=eS.useState,sDe=eS.useEffect,oDe=eS.useLayoutEffect,rDe=eS.useDebugValue;function aDe(n,e){var t=e(),i=nDe({inst:{value:t,getSnapshot:e}}),s=i[0].inst,o=i[1];return oDe(function(){s.value=t,s.getSnapshot=e,i7(s)&&o({inst:s})},[n,t,e]),sDe(function(){return i7(s)&&o({inst:s}),n(function(){i7(s)&&o({inst:s})})},[n]),rDe(t),t}function i7(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!iDe(n,t)}catch{return!0}}function lDe(n,e){return e()}var cDe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?lDe:aDe;tfe.useSyncExternalStore=eS.useSyncExternalStore!==void 0?eS.useSyncExternalStore:cDe;efe.exports=tfe;var dDe=efe.exports;/** + */var iS=$;function oDe(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var rDe=typeof Object.is=="function"?Object.is:oDe,aDe=iS.useState,lDe=iS.useEffect,cDe=iS.useLayoutEffect,dDe=iS.useDebugValue;function hDe(n,e){var t=e(),i=aDe({inst:{value:t,getSnapshot:e}}),s=i[0].inst,o=i[1];return cDe(function(){s.value=t,s.getSnapshot=e,i7(s)&&o({inst:s})},[n,t,e]),lDe(function(){return i7(s)&&o({inst:s}),n(function(){i7(s)&&o({inst:s})})},[n]),dDe(t),t}function i7(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!rDe(n,t)}catch{return!0}}function uDe(n,e){return e()}var fDe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?uDe:hDe;sfe.useSyncExternalStore=iS.useSyncExternalStore!==void 0?iS.useSyncExternalStore:fDe;nfe.exports=sfe;var gDe=nfe.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -53,240 +53,245 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var S5=$,hDe=dDe;function uDe(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var fDe=typeof Object.is=="function"?Object.is:uDe,gDe=hDe.useSyncExternalStore,pDe=S5.useRef,mDe=S5.useEffect,_De=S5.useMemo,bDe=S5.useDebugValue;Jue.useSyncExternalStoreWithSelector=function(n,e,t,i,s){var o=pDe(null);if(o.current===null){var r={hasValue:!1,value:null};o.current=r}else r=o.current;o=_De(function(){function l(f){if(!c){if(c=!0,d=f,f=i(f),s!==void 0&&r.hasValue){var g=r.value;if(s(g,f))return h=g}return h=f}if(g=h,fDe(d,f))return g;var p=i(f);return s!==void 0&&s(g,p)?(d=f,g):(d=f,h=p)}var c=!1,d,h,u=t===void 0?null:t;return[function(){return l(e())},u===null?void 0:function(){return l(u())}]},[e,t,i,s]);var a=gDe(n,o[0],o[1]);return mDe(function(){r.hasValue=!0,r.value=a},[a]),bDe(a),a};Que.exports=Jue;var vDe=Que.exports;const wDe=Ace(vDe),CDe={},Yee=n=>{let e;const t=new Set,i=(d,h)=>{const u=typeof d=="function"?d(e):d;if(!Object.is(u,e)){const f=e;e=h??(typeof u!="object"||u===null)?u:Object.assign({},e,u),t.forEach(g=>g(e,f))}},s=()=>e,l={setState:i,getState:s,getInitialState:()=>c,subscribe:d=>(t.add(d),()=>t.delete(d)),destroy:()=>{(CDe?"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."),t.clear()}},c=e=n(i,s,l);return l},yDe=n=>n?Yee(n):Yee,{useDebugValue:SDe}=dm,{useSyncExternalStoreWithSelector:xDe}=wDe,LDe=n=>n;function ife(n,e=LDe,t){const i=xDe(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return SDe(i),i}const Zee=(n,e)=>{const t=yDe(n),i=(s,o=e)=>ife(t,s,o);return Object.assign(i,t),i},kDe=(n,e)=>n?Zee(n,e):Zee;function cs(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[i,s]of n)if(!Object.is(s,e.get(i)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const i of n)if(!e.has(i))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const i of t)if(!Object.prototype.hasOwnProperty.call(e,i)||!Object.is(n[i],e[i]))return!1;return!0}const x5=$.createContext(null),IDe=x5.Provider,nfe=bu.error001();function Ti(n,e){const t=$.useContext(x5);if(t===null)throw new Error(nfe);return ife(t,n,e)}function us(){const n=$.useContext(x5);if(n===null)throw new Error(nfe);return $.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const Xee={display:"none"},EDe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sfe="react-flow__node-desc",ofe="react-flow__edge-desc",NDe="react-flow__aria-live",DDe=n=>n.ariaLiveMessage,TDe=n=>n.ariaLabelConfig;function RDe({rfId:n}){const e=Ti(DDe);return y.jsx("div",{id:`${NDe}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:EDe,children:e})}function MDe({rfId:n,disableKeyboardA11y:e}){const t=Ti(TDe);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${sfe}-${n}`,style:Xee,children:e?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${ofe}-${n}`,style:Xee,children:t["edge.a11yDescription.default"]}),!e&&y.jsx(RDe,{rfId:n})]})}const L5=$.forwardRef(({position:n="top-left",children:e,className:t,style:i,...s},o)=>{const r=`${n}`.split("-");return y.jsx("div",{className:fo(["react-flow__panel",t,...r]),style:i,ref:o,...s,children:e})});L5.displayName="Panel";function ADe({proOptions:n,position:e="bottom-right"}){return n!=null&&n.hideAttribution?null:y.jsx(L5,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const PDe=n=>{const e=[],t=[];for(const[,i]of n.nodeLookup)i.selected&&e.push(i.internals.userNode);for(const[,i]of n.edgeLookup)i.selected&&t.push(i);return{selectedNodes:e,selectedEdges:t}},LT=n=>n.id;function ODe(n,e){return cs(n.selectedNodes.map(LT),e.selectedNodes.map(LT))&&cs(n.selectedEdges.map(LT),e.selectedEdges.map(LT))}function FDe({onSelectionChange:n}){const e=us(),{selectedNodes:t,selectedEdges:i}=Ti(PDe,ODe);return $.useEffect(()=>{const s={nodes:t,edges:i};n==null||n(s),e.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[t,i,n]),null}const BDe=n=>!!n.onSelectionChangeHandlers;function WDe({onSelectionChange:n}){const e=Ti(BDe);return n||e?y.jsx(FDe,{onSelectionChange:n}):null}const rfe=[0,0],HDe={x:0,y:0,zoom:1},VDe=["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"],Qee=[...VDe,"rfId"],zDe=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges}),Jee={translateExtent:$I,nodeOrigin:rfe,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function jDe(n){const{setNodes:e,setEdges:t,setMinZoom:i,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:r,reset:a,setDefaultNodesAndEdges:l}=Ti(zDe,cs),c=us();$.useEffect(()=>(l(n.defaultNodes,n.defaultEdges),()=>{d.current=Jee,a()}),[]);const d=$.useRef(Jee);return $.useEffect(()=>{for(const h of Qee){const u=n[h],f=d.current[h];u!==f&&(typeof n[h]>"u"||(h==="nodes"?e(u):h==="edges"?t(u):h==="minZoom"?i(u):h==="maxZoom"?s(u):h==="translateExtent"?o(u):h==="nodeExtent"?r(u):h==="ariaLabelConfig"?c.setState({ariaLabelConfig:uNe(u)}):h==="fitView"?c.setState({fitViewQueued:u}):h==="fitViewOptions"?c.setState({fitViewOptions:u}):c.setState({[h]:u})))}d.current=n},Qee.map(h=>n[h])),null}function ete(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function $De(n){var i;const[e,t]=$.useState(n==="system"?null:n);return $.useEffect(()=>{if(n!=="system"){t(n);return}const s=ete(),o=()=>t(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[n]),e!==null?e:(i=ete())!=null&&i.matches?"dark":"light"}const tte=typeof document<"u"?document:null;function GI(n=null,e={target:tte,actInsideInputWithModifier:!0}){const[t,i]=$.useState(!1),s=$.useRef(!1),o=$.useRef(new Set([])),[r,a]=$.useMemo(()=>{if(n!==null){const c=(Array.isArray(n)?n:[n]).filter(h=>typeof h=="string").map(h=>h.replace("+",` + */var S5=$,pDe=gDe;function mDe(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var _De=typeof Object.is=="function"?Object.is:mDe,bDe=pDe.useSyncExternalStore,vDe=S5.useRef,wDe=S5.useEffect,CDe=S5.useMemo,yDe=S5.useDebugValue;ife.useSyncExternalStoreWithSelector=function(n,e,t,i,s){var o=vDe(null);if(o.current===null){var r={hasValue:!1,value:null};o.current=r}else r=o.current;o=CDe(function(){function l(f){if(!c){if(c=!0,d=f,f=i(f),s!==void 0&&r.hasValue){var g=r.value;if(s(g,f))return h=g}return h=f}if(g=h,_De(d,f))return g;var p=i(f);return s!==void 0&&s(g,p)?(d=f,g):(d=f,h=p)}var c=!1,d,h,u=t===void 0?null:t;return[function(){return l(e())},u===null?void 0:function(){return l(u())}]},[e,t,i,s]);var a=bDe(n,o[0],o[1]);return wDe(function(){r.hasValue=!0,r.value=a},[a]),yDe(a),a};tfe.exports=ife;var SDe=tfe.exports;const xDe=Fce(SDe),LDe={},Zee=n=>{let e;const t=new Set,i=(d,h)=>{const u=typeof d=="function"?d(e):d;if(!Object.is(u,e)){const f=e;e=h??(typeof u!="object"||u===null)?u:Object.assign({},e,u),t.forEach(g=>g(e,f))}},s=()=>e,l={setState:i,getState:s,getInitialState:()=>c,subscribe:d=>(t.add(d),()=>t.delete(d)),destroy:()=>{(LDe?"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."),t.clear()}},c=e=n(i,s,l);return l},kDe=n=>n?Zee(n):Zee,{useDebugValue:EDe}=hm,{useSyncExternalStoreWithSelector:IDe}=xDe,NDe=n=>n;function ofe(n,e=NDe,t){const i=IDe(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return EDe(i),i}const Xee=(n,e)=>{const t=kDe(n),i=(s,o=e)=>ofe(t,s,o);return Object.assign(i,t),i},DDe=(n,e)=>n?Xee(n,e):Xee;function as(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[i,s]of n)if(!Object.is(s,e.get(i)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const i of n)if(!e.has(i))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const i of t)if(!Object.prototype.hasOwnProperty.call(e,i)||!Object.is(n[i],e[i]))return!1;return!0}const x5=$.createContext(null),TDe=x5.Provider,rfe=_u.error001();function Mi(n,e){const t=$.useContext(x5);if(t===null)throw new Error(rfe);return ofe(t,n,e)}function ds(){const n=$.useContext(x5);if(n===null)throw new Error(rfe);return $.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const Qee={display:"none"},RDe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},afe="react-flow__node-desc",lfe="react-flow__edge-desc",MDe="react-flow__aria-live",ADe=n=>n.ariaLiveMessage,PDe=n=>n.ariaLabelConfig;function ODe({rfId:n}){const e=Mi(ADe);return y.jsx("div",{id:`${MDe}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:RDe,children:e})}function FDe({rfId:n,disableKeyboardA11y:e}){const t=Mi(PDe);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${afe}-${n}`,style:Qee,children:e?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${lfe}-${n}`,style:Qee,children:t["edge.a11yDescription.default"]}),!e&&y.jsx(ODe,{rfId:n})]})}const L5=$.forwardRef(({position:n="top-left",children:e,className:t,style:i,...s},o)=>{const r=`${n}`.split("-");return y.jsx("div",{className:uo(["react-flow__panel",t,...r]),style:i,ref:o,...s,children:e})});L5.displayName="Panel";function BDe({proOptions:n,position:e="bottom-right"}){return n!=null&&n.hideAttribution?null:y.jsx(L5,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const WDe=n=>{const e=[],t=[];for(const[,i]of n.nodeLookup)i.selected&&e.push(i.internals.userNode);for(const[,i]of n.edgeLookup)i.selected&&t.push(i);return{selectedNodes:e,selectedEdges:t}},xT=n=>n.id;function HDe(n,e){return as(n.selectedNodes.map(xT),e.selectedNodes.map(xT))&&as(n.selectedEdges.map(xT),e.selectedEdges.map(xT))}function VDe({onSelectionChange:n}){const e=ds(),{selectedNodes:t,selectedEdges:i}=Mi(WDe,HDe);return $.useEffect(()=>{const s={nodes:t,edges:i};n==null||n(s),e.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[t,i,n]),null}const zDe=n=>!!n.onSelectionChangeHandlers;function jDe({onSelectionChange:n}){const e=Mi(zDe);return n||e?y.jsx(VDe,{onSelectionChange:n}):null}const cfe=[0,0],$De={x:0,y:0,zoom:1},UDe=["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"],Jee=[...UDe,"rfId"],qDe=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges}),ete={translateExtent:$E,nodeOrigin:cfe,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function KDe(n){const{setNodes:e,setEdges:t,setMinZoom:i,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:r,reset:a,setDefaultNodesAndEdges:l}=Mi(qDe,as),c=ds();$.useEffect(()=>(l(n.defaultNodes,n.defaultEdges),()=>{d.current=ete,a()}),[]);const d=$.useRef(ete);return $.useEffect(()=>{for(const h of Jee){const u=n[h],f=d.current[h];u!==f&&(typeof n[h]>"u"||(h==="nodes"?e(u):h==="edges"?t(u):h==="minZoom"?i(u):h==="maxZoom"?s(u):h==="translateExtent"?o(u):h==="nodeExtent"?r(u):h==="ariaLabelConfig"?c.setState({ariaLabelConfig:mNe(u)}):h==="fitView"?c.setState({fitViewQueued:u}):h==="fitViewOptions"?c.setState({fitViewOptions:u}):c.setState({[h]:u})))}d.current=n},Jee.map(h=>n[h])),null}function tte(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function GDe(n){var i;const[e,t]=$.useState(n==="system"?null:n);return $.useEffect(()=>{if(n!=="system"){t(n);return}const s=tte(),o=()=>t(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[n]),e!==null?e:(i=tte())!=null&&i.matches?"dark":"light"}const ite=typeof document<"u"?document:null;function GE(n=null,e={target:ite,actInsideInputWithModifier:!0}){const[t,i]=$.useState(!1),s=$.useRef(!1),o=$.useRef(new Set([])),[r,a]=$.useMemo(()=>{if(n!==null){const c=(Array.isArray(n)?n:[n]).filter(h=>typeof h=="string").map(h=>h.replace("+",` `).replace(` `,` +`).split(` -`)),d=c.reduce((h,u)=>h.concat(...u),[]);return[c,d]}return[[],[]]},[n]);return $.useEffect(()=>{const l=(e==null?void 0:e.target)??tte,c=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(n!==null){const d=f=>{var m,b;if(s.current=f.ctrlKey||f.metaKey||f.shiftKey||f.altKey,(!s.current||s.current&&!c)&&Pue(f))return!1;const p=nte(f.code,a);if(o.current.add(f[p]),ite(r,o.current,!1)){const v=((b=(m=f.composedPath)==null?void 0:m.call(f))==null?void 0:b[0])||f.target,w=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";e.preventDefault!==!1&&(s.current||!w)&&f.preventDefault(),i(!0)}},h=f=>{const g=nte(f.code,a);ite(r,o.current,!0)?(i(!1),o.current.clear()):o.current.delete(f[g]),f.key==="Meta"&&o.current.clear(),s.current=!1},u=()=>{o.current.clear(),i(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",h),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",h),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[n,i]),t}function ite(n,e,t){return n.filter(i=>t||i.length===e.size).some(i=>i.every(s=>e.has(s)))}function nte(n,e){return e.includes(n)?"code":"key"}const UDe=()=>{const n=us();return $.useMemo(()=>({zoomIn:e=>{const{panZoom:t}=n.getState();return t?t.scaleBy(1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:t}=n.getState();return t?t.scaleBy(1/1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomTo:(e,t)=>{const{panZoom:i}=n.getState();return i?i.scaleTo(e,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(e,t)=>{const{transform:[i,s,o],panZoom:r}=n.getState();return r?(await r.setViewport({x:e.x??i,y:e.y??s,zoom:e.zoom??o},t),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,t,i]=n.getState().transform;return{x:e,y:t,zoom:i}},setCenter:async(e,t,i)=>n.getState().setCenter(e,t,i),fitBounds:async(e,t)=>{const{width:i,height:s,minZoom:o,maxZoom:r,panZoom:a}=n.getState(),l=cG(e,i,s,o,r,(t==null?void 0:t.padding)??.1);return a?(await a.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,t={})=>{const{transform:i,snapGrid:s,snapToGrid:o,domNode:r}=n.getState();if(!r)return e;const{x:a,y:l}=r.getBoundingClientRect(),c={x:e.x-a,y:e.y-l},d=t.snapGrid??s,h=t.snapToGrid??o;return eD(c,i,h,d)},flowToScreenPosition:e=>{const{transform:t,domNode:i}=n.getState();if(!i)return e;const{x:s,y:o}=i.getBoundingClientRect(),r=$M(e,t);return{x:r.x+s,y:r.y+o}}}),[])};function afe(n,e){const t=[],i=new Map,s=[];for(const o of n)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")i.set(o.id,[o]);else{const r=i.get(o.id);r?r.push(o):i.set(o.id,[o])}for(const o of e){const r=i.get(o.id);if(!r){t.push(o);continue}if(r[0].type==="remove")continue;if(r[0].type==="replace"){t.push({...r[0].item});continue}const a={...o};for(const l of r)qDe(l,a);t.push(a)}return s.length&&s.forEach(o=>{o.index!==void 0?t.splice(o.index,0,{...o.item}):t.push({...o.item})}),t}function qDe(n,e){switch(n.type){case"select":{e.selected=n.selected;break}case"position":{typeof n.position<"u"&&(e.position=n.position),typeof n.dragging<"u"&&(e.dragging=n.dragging);break}case"dimensions":{typeof n.dimensions<"u"&&(e.measured={...n.dimensions},n.setAttributes&&((n.setAttributes===!0||n.setAttributes==="width")&&(e.width=n.dimensions.width),(n.setAttributes===!0||n.setAttributes==="height")&&(e.height=n.dimensions.height))),typeof n.resizing=="boolean"&&(e.resizing=n.resizing);break}}}function lfe(n,e){return afe(n,e)}function cfe(n,e){return afe(n,e)}function ab(n,e){return{id:n,type:"select",selected:e}}function QC(n,e=new Set,t=!1){const i=[];for(const[s,o]of n){const r=e.has(s);!(o.selected===void 0&&!r)&&o.selected!==r&&(t&&(o.selected=r),i.push(ab(o.id,r)))}return i}function ste({items:n=[],lookup:e}){var s;const t=[],i=new Map(n.map(o=>[o.id,o]));for(const[o,r]of n.entries()){const a=e.get(r.id),l=((s=a==null?void 0:a.internals)==null?void 0:s.userNode)??a;l!==void 0&&l!==r&&t.push({id:r.id,item:r,type:"replace"}),l===void 0&&t.push({item:r,type:"add",index:o})}for(const[o]of e)i.get(o)===void 0&&t.push({id:o,type:"remove"});return t}function ote(n){return{id:n.id,type:"remove"}}const rte=n=>iNe(n),KDe=n=>Iue(n);function dfe(n){return $.forwardRef(n)}const GDe=typeof window<"u"?$.useLayoutEffect:$.useEffect;function ate(n){const[e,t]=$.useState(BigInt(0)),[i]=$.useState(()=>YDe(()=>t(s=>s+BigInt(1))));return GDe(()=>{const s=i.get();s.length&&(n(s),i.reset())},[e]),i}function YDe(n){let e=[];return{get:()=>e,reset:()=>{e=[]},push:t=>{e.push(t),n()}}}const hfe=$.createContext(null);function ZDe({children:n}){const e=us(),t=$.useCallback(a=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:d,onNodesChange:h,nodeLookup:u,fitViewQueued:f,onNodesChangeMiddlewareMap:g}=e.getState();let p=l;for(const b of a)p=typeof b=="function"?b(p):b;let m=ste({items:p,lookup:u});for(const b of g.values())m=b(m);d&&c(p),m.length>0?h==null||h(m):f&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:v,setNodes:w}=e.getState();b&&w(v)})},[]),i=ate(t),s=$.useCallback(a=>{const{edges:l=[],setEdges:c,hasDefaultEdges:d,onEdgesChange:h,edgeLookup:u}=e.getState();let f=l;for(const g of a)f=typeof g=="function"?g(f):g;d?c(f):h&&h(ste({items:f,lookup:u}))},[]),o=ate(s),r=$.useMemo(()=>({nodeQueue:i,edgeQueue:o}),[]);return y.jsx(hfe.Provider,{value:r,children:n})}function XDe(){const n=$.useContext(hfe);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const QDe=n=>!!n.panZoom;function mG(){const n=UDe(),e=us(),t=XDe(),i=Ti(QDe),s=$.useMemo(()=>{const o=h=>e.getState().nodeLookup.get(h),r=h=>{t.nodeQueue.push(h)},a=h=>{t.edgeQueue.push(h)},l=h=>{var b,v;const{nodeLookup:u,nodeOrigin:f}=e.getState(),g=rte(h)?h:u.get(h.id),p=g.parentId?Mue(g.position,g.measured,g.parentId,u,f):g.position,m={...g,position:p,width:((b=g.measured)==null?void 0:b.width)??g.width,height:((v=g.measured)==null?void 0:v.height)??g.height};return Xy(m)},c=(h,u,f={replace:!1})=>{r(g=>g.map(p=>{if(p.id===h){const m=typeof u=="function"?u(p):u;return f.replace&&rte(m)?m:{...p,...m}}return p}))},d=(h,u,f={replace:!1})=>{a(g=>g.map(p=>{if(p.id===h){const m=typeof u=="function"?u(p):u;return f.replace&&KDe(m)?m:{...p,...m}}return p}))};return{getNodes:()=>e.getState().nodes.map(h=>({...h})),getNode:h=>{var u;return(u=o(h))==null?void 0:u.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:h=[]}=e.getState();return h.map(u=>({...u}))},getEdge:h=>e.getState().edgeLookup.get(h),setNodes:r,setEdges:a,addNodes:h=>{const u=Array.isArray(h)?h:[h];t.nodeQueue.push(f=>[...f,...u])},addEdges:h=>{const u=Array.isArray(h)?h:[h];t.edgeQueue.push(f=>[...f,...u])},toObject:()=>{const{nodes:h=[],edges:u=[],transform:f}=e.getState(),[g,p,m]=f;return{nodes:h.map(b=>({...b})),edges:u.map(b=>({...b})),viewport:{x:g,y:p,zoom:m}}},deleteElements:async({nodes:h=[],edges:u=[]})=>{const{nodes:f,edges:g,onNodesDelete:p,onEdgesDelete:m,triggerNodeChanges:b,triggerEdgeChanges:v,onDelete:w,onBeforeDelete:C}=e.getState(),{nodes:S,edges:L}=await aNe({nodesToRemove:h,edgesToRemove:u,nodes:f,edges:g,onBeforeDelete:C}),x=L.length>0,I=S.length>0;if(x){const E=L.map(ote);m==null||m(L),v(E)}if(I){const E=S.map(ote);p==null||p(S),b(E)}return(I||x)&&(w==null||w({nodes:S,edges:L})),{deletedNodes:S,deletedEdges:L}},getIntersectingNodes:(h,u=!0,f)=>{const g=Oee(h),p=g?h:l(h),m=f!==void 0;return p?(f||e.getState().nodes).filter(b=>{const v=e.getState().nodeLookup.get(b.id);if(v&&!g&&(b.id===h.id||!v.internals.positionAbsolute))return!1;const w=Xy(m?b:v),C=qI(w,p);return u&&C>0||C>=w.width*w.height||C>=p.width*p.height}):[]},isNodeIntersecting:(h,u,f=!0)=>{const p=Oee(h)?h:l(h);if(!p)return!1;const m=qI(p,u);return f&&m>0||m>=u.width*u.height||m>=p.width*p.height},updateNode:c,updateNodeData:(h,u,f={replace:!1})=>{c(h,g=>{const p=typeof u=="function"?u(g):u;return f.replace?{...g,data:p}:{...g,data:{...g.data,...p}}},f)},updateEdge:d,updateEdgeData:(h,u,f={replace:!1})=>{d(h,g=>{const p=typeof u=="function"?u(g):u;return f.replace?{...g,data:p}:{...g,data:{...g.data,...p}}},f)},getNodesBounds:h=>{const{nodeLookup:u,nodeOrigin:f}=e.getState();return nNe(h,{nodeLookup:u,nodeOrigin:f})},getHandleConnections:({type:h,id:u,nodeId:f})=>{var g;return Array.from(((g=e.getState().connectionLookup.get(`${f}-${h}${u?`-${u}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:h,handleId:u,nodeId:f})=>{var g;return Array.from(((g=e.getState().connectionLookup.get(`${f}${h?u?`-${h}-${u}`:`-${h}`:""}`))==null?void 0:g.values())??[])},fitView:async h=>{const u=e.getState().fitViewResolver??hNe();return e.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:u}),t.nodeQueue.push(f=>[...f]),u.promise}}},[]);return $.useMemo(()=>({...s,...n,viewportInitialized:i}),[i])}const lte=n=>n.selected,JDe=typeof window<"u"?window:void 0;function eTe({deleteKeyCode:n,multiSelectionKeyCode:e}){const t=us(),{deleteElements:i}=mG(),s=GI(n,{actInsideInputWithModifier:!1}),o=GI(e,{target:JDe});$.useEffect(()=>{if(s){const{edges:r,nodes:a}=t.getState();i({nodes:a.filter(lte),edges:r.filter(lte)}),t.setState({nodesSelectionActive:!1})}},[s]),$.useEffect(()=>{t.setState({multiSelectionActive:o})},[o])}function tTe(n){const e=us();$.useEffect(()=>{const t=()=>{var s,o,r,a;if(!n.current||!(((o=(s=n.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const i=dG(n.current);(i.height===0||i.width===0)&&((a=(r=e.getState()).onError)==null||a.call(r,"004",bu.error004())),e.setState({width:i.width||500,height:i.height||500})};if(n.current){t(),window.addEventListener("resize",t);const i=new ResizeObserver(()=>t());return i.observe(n.current),()=>{window.removeEventListener("resize",t),i&&n.current&&i.unobserve(n.current)}}},[])}const k5={position:"absolute",width:"100%",height:"100%",top:0,left:0},iTe=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function nTe({onPaneContextMenu:n,zoomOnScroll:e=!0,zoomOnPinch:t=!0,panOnScroll:i=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Cv.Free,zoomOnDoubleClick:r=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:c,minZoom:d,maxZoom:h,zoomActivationKeyCode:u,preventScrolling:f=!0,children:g,noWheelClassName:p,noPanClassName:m,onViewportChange:b,isControlledViewport:v,paneClickDistance:w,selectionOnDrag:C}){const S=us(),L=$.useRef(null),{userSelectionActive:x,lib:I,connectionInProgress:E}=Ti(iTe,cs),R=GI(u),M=$.useRef();tTe(L);const A=$.useCallback(W=>{b==null||b({x:W[0],y:W[1],zoom:W[2]}),v||S.setState({transform:W})},[b,v]);return $.useEffect(()=>{if(L.current){M.current=GNe({domNode:L.current,minZoom:d,maxZoom:h,translateExtent:c,viewport:l,onDraggingChange:V=>S.setState(K=>K.paneDragging===V?K:{paneDragging:V}),onPanZoomStart:(V,K)=>{const{onViewportChangeStart:z,onMoveStart:j}=S.getState();j==null||j(V,K),z==null||z(K)},onPanZoom:(V,K)=>{const{onViewportChange:z,onMove:j}=S.getState();j==null||j(V,K),z==null||z(K)},onPanZoomEnd:(V,K)=>{const{onViewportChangeEnd:z,onMoveEnd:j}=S.getState();j==null||j(V,K),z==null||z(K)}});const{x:W,y:P,zoom:B}=M.current.getViewport();return S.setState({panZoom:M.current,transform:[W,P,B],domNode:L.current.closest(".react-flow")}),()=>{var V;(V=M.current)==null||V.destroy()}}},[]),$.useEffect(()=>{var W;(W=M.current)==null||W.update({onPaneContextMenu:n,zoomOnScroll:e,zoomOnPinch:t,panOnScroll:i,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:r,panOnDrag:a,zoomActivationKeyPressed:R,preventScrolling:f,noPanClassName:m,userSelectionActive:x,noWheelClassName:p,lib:I,onTransformChange:A,connectionInProgress:E,selectionOnDrag:C,paneClickDistance:w})},[n,e,t,i,s,o,r,a,R,f,m,x,p,I,A,E,C,w]),y.jsx("div",{className:"react-flow__renderer",ref:L,style:k5,children:g})}const sTe=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function oTe(){const{userSelectionActive:n,userSelectionRect:e}=Ti(sTe,cs);return n&&e?y.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const n7=(n,e)=>t=>{t.target===e.current&&(n==null||n(t))},rTe=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function aTe({isSelecting:n,selectionKeyPressed:e,selectionMode:t=UI.Full,panOnDrag:i,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:r,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:h,onPaneMouseMove:u,onPaneMouseLeave:f,children:g}){const p=us(),{userSelectionActive:m,elementsSelectable:b,dragging:v,connectionInProgress:w}=Ti(rTe,cs),C=b&&(n||m),S=$.useRef(null),L=$.useRef(),x=$.useRef(new Set),I=$.useRef(new Set),E=$.useRef(!1),R=z=>{if(E.current||w){E.current=!1;return}l==null||l(z),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},M=z=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){z.preventDefault();return}c==null||c(z)},A=d?z=>d(z):void 0,W=z=>{E.current&&(z.stopPropagation(),E.current=!1)},P=z=>{var xe,Be;const{domNode:j}=p.getState();if(L.current=j==null?void 0:j.getBoundingClientRect(),!L.current)return;const X=z.target===S.current;if(!X&&!!z.target.closest(".nokey")||!n||!(o&&X||e)||z.button!==0||!z.isPrimary)return;(Be=(xe=z.target)==null?void 0:xe.setPointerCapture)==null||Be.call(xe,z.pointerId),E.current=!1;const{x:ce,y:Ce}=Wd(z.nativeEvent,L.current);p.setState({userSelectionRect:{width:0,height:0,startX:ce,startY:Ce,x:ce,y:Ce}}),X||(z.stopPropagation(),z.preventDefault())},B=z=>{const{userSelectionRect:j,transform:X,nodeLookup:Y,edgeLookup:te,connectionLookup:ce,triggerNodeChanges:Ce,triggerEdgeChanges:xe,defaultEdgeOptions:Be,resetSelectedElements:Ee}=p.getState();if(!L.current||!j)return;const{x:Le,y:ze}=Wd(z.nativeEvent,L.current),{startX:Ct,startY:ct}=j;if(!E.current){const Pt=e?0:s;if(Math.hypot(Le-Ct,ze-ct)<=Pt)return;Ee(),r==null||r(z)}E.current=!0;const Ue={startX:Ct,startY:ct,x:Le Pt.id)),I.current=new Set;const yi=(Be==null?void 0:Be.selectable)??!0;for(const Pt of x.current){const Cn=ce.get(Pt);if(Cn)for(const{edgeId:Xn}of Cn.values()){const Ks=te.get(Xn);Ks&&(Ks.selectable??yi)&&I.current.add(Xn)}}if(!Fee(tt,x.current)){const Pt=QC(Y,x.current,!0);Ce(Pt)}if(!Fee(_t,I.current)){const Pt=QC(te,I.current);xe(Pt)}p.setState({userSelectionRect:Ue,userSelectionActive:!0,nodesSelectionActive:!1})},V=z=>{var j,X;z.button===0&&((X=(j=z.target)==null?void 0:j.releasePointerCapture)==null||X.call(j,z.pointerId),!m&&z.target===S.current&&p.getState().userSelectionRect&&(R==null||R(z)),p.setState({userSelectionActive:!1,userSelectionRect:null}),E.current&&(a==null||a(z),p.setState({nodesSelectionActive:x.current.size>0})))},K=i===!0||Array.isArray(i)&&i.includes(0);return y.jsxs("div",{className:fo(["react-flow__pane",{draggable:K,dragging:v,selection:n}]),onClick:C?void 0:n7(R,S),onContextMenu:n7(M,S),onWheel:n7(A,S),onPointerEnter:C?void 0:h,onPointerMove:C?B:u,onPointerUp:C?V:void 0,onPointerDownCapture:C?P:void 0,onClickCapture:C?W:void 0,onPointerLeave:f,ref:S,style:k5,children:[g,y.jsx(oTe,{})]})}function UB({id:n,store:e,unselect:t=!1,nodeRef:i}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:r,nodeLookup:a,onError:l}=e.getState(),c=a.get(n);if(!c){l==null||l("012",bu.error012(n));return}e.setState({nodesSelectionActive:!1}),c.selected?(t||c.selected&&r)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):s([n])}function ufe({nodeRef:n,disabled:e=!1,noDragClassName:t,handleSelector:i,nodeId:s,isSelectable:o,nodeClickDistance:r}){const a=us(),[l,c]=$.useState(!1),d=$.useRef();return $.useEffect(()=>{d.current=ANe({getStoreItems:()=>a.getState(),onNodeMouseDown:h=>{UB({id:h,store:a,nodeRef:n})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),$.useEffect(()=>{if(!(e||!n.current||!d.current))return d.current.update({noDragClassName:t,handleSelector:i,domNode:n.current,isSelectable:o,nodeId:s,nodeClickDistance:r}),()=>{var h;(h=d.current)==null||h.destroy()}},[t,i,e,o,n,s,r]),l}const lTe=n=>e=>e.selected&&(e.draggable||n&&typeof e.draggable>"u");function ffe(){const n=us();return $.useCallback(t=>{const{nodeExtent:i,snapToGrid:s,snapGrid:o,nodesDraggable:r,onError:a,updateNodePositions:l,nodeLookup:c,nodeOrigin:d}=n.getState(),h=new Map,u=lTe(r),f=s?o[0]:5,g=s?o[1]:5,p=t.direction.x*f*t.factor,m=t.direction.y*g*t.factor;for(const[,b]of c){if(!u(b))continue;let v={x:b.internals.positionAbsolute.x+p,y:b.internals.positionAbsolute.y+m};s&&(v=JN(v,o));const{position:w,positionAbsolute:C}=Eue({nodeId:b.id,nextPosition:v,nodeLookup:c,nodeExtent:i,nodeOrigin:d,onError:a});b.position=w,b.internals.positionAbsolute=C,h.set(b.id,b)}l(h)},[])}const _G=$.createContext(null),cTe=_G.Provider;_G.Consumer;const gfe=()=>$.useContext(_G),dTe=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),hTe=(n,e,t)=>i=>{const{connectionClickStartHandle:s,connectionMode:o,connection:r}=i,{fromHandle:a,toHandle:l,isValid:c}=r,d=(l==null?void 0:l.nodeId)===n&&(l==null?void 0:l.id)===e&&(l==null?void 0:l.type)===t;return{connectingFrom:(a==null?void 0:a.nodeId)===n&&(a==null?void 0:a.id)===e&&(a==null?void 0:a.type)===t,connectingTo:d,clickConnecting:(s==null?void 0:s.nodeId)===n&&(s==null?void 0:s.id)===e&&(s==null?void 0:s.type)===t,isPossibleEndHandle:o===Yy.Strict?(a==null?void 0:a.type)!==t:n!==(a==null?void 0:a.nodeId)||e!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!s,valid:d&&c}};function uTe({type:n="source",position:e=Nt.Top,isValidConnection:t,isConnectable:i=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:r,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:h,...u},f){var B,V;const g=r||null,p=n==="target",m=us(),b=gfe(),{connectOnClick:v,noPanClassName:w,rfId:C}=Ti(dTe,cs),{connectingFrom:S,connectingTo:L,clickConnecting:x,isPossibleEndHandle:I,connectionInProcess:E,clickConnectionInProcess:R,valid:M}=Ti(hTe(b,g,n),cs);b||(V=(B=m.getState()).onError)==null||V.call(B,"010",bu.error010());const A=K=>{const{defaultEdgeOptions:z,onConnect:j,hasDefaultEdges:X}=m.getState(),Y={...z,...K};if(X){const{edges:te,setEdges:ce}=m.getState();ce(bNe(Y,te))}j==null||j(Y),a==null||a(Y)},W=K=>{if(!b)return;const z=Oue(K.nativeEvent);if(s&&(z&&K.button===0||!z)){const j=m.getState();$B.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:p,handleId:g,nodeId:b,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...X)=>{var Y,te;return(te=(Y=m.getState()).onConnectEnd)==null?void 0:te.call(Y,...X)},updateConnection:j.updateConnection,onConnect:A,isValidConnection:t||((...X)=>{var Y,te;return((te=(Y=m.getState()).isValidConnection)==null?void 0:te.call(Y,...X))??!0}),getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}z?d==null||d(K):h==null||h(K)},P=K=>{const{onClickConnectStart:z,onClickConnectEnd:j,connectionClickStartHandle:X,connectionMode:Y,isValidConnection:te,lib:ce,rfId:Ce,nodeLookup:xe,connection:Be}=m.getState();if(!b||!X&&!s)return;if(!X){z==null||z(K.nativeEvent,{nodeId:b,handleId:g,handleType:n}),m.setState({connectionClickStartHandle:{nodeId:b,type:n,id:g}});return}const Ee=Aue(K.target),Le=t||te,{connection:ze,isValid:Ct}=$B.isValid(K.nativeEvent,{handle:{nodeId:b,id:g,type:n},connectionMode:Y,fromNodeId:X.nodeId,fromHandleId:X.id||null,fromType:X.type,isValidConnection:Le,flowId:Ce,doc:Ee,lib:ce,nodeLookup:xe});Ct&&ze&&A(ze);const ct=structuredClone(Be);delete ct.inProgress,ct.toPosition=ct.toHandle?ct.toHandle.position:null,j==null||j(K,ct),m.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":e,"data-id":`${C}-${b}-${g}-${n}`,className:fo(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",w,c,{source:!p,target:p,connectable:i,connectablestart:s,connectableend:o,clickconnecting:x,connectingfrom:S,connectingto:L,valid:M,connectionindicator:i&&(!E||I)&&(E||R?o:s)}]),onMouseDown:W,onTouchStart:W,onClick:v?P:void 0,ref:f,...u,children:l})}const tS=$.memo(dfe(uTe));function fTe({data:n,isConnectable:e,sourcePosition:t=Nt.Bottom}){return y.jsxs(y.Fragment,{children:[n==null?void 0:n.label,y.jsx(tS,{type:"source",position:t,isConnectable:e})]})}function gTe({data:n,isConnectable:e,targetPosition:t=Nt.Top,sourcePosition:i=Nt.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(tS,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label,y.jsx(tS,{type:"source",position:i,isConnectable:e})]})}function pTe(){return null}function mTe({data:n,isConnectable:e,targetPosition:t=Nt.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(tS,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label]})}const UM={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},cte={input:fTe,default:gTe,output:mTe,group:pTe};function _Te(n){var e,t,i,s;return n.internals.handleBounds===void 0?{width:n.width??n.initialWidth??((e=n.style)==null?void 0:e.width),height:n.height??n.initialHeight??((t=n.style)==null?void 0:t.height)}:{width:n.width??((i=n.style)==null?void 0:i.width),height:n.height??((s=n.style)==null?void 0:s.height)}}const bTe=n=>{const{width:e,height:t,x:i,y:s}=QN(n.nodeLookup,{filter:o=>!!o.selected});return{width:Bd(e)?e:null,height:Bd(t)?t:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${i}px,${s}px)`}};function vTe({onSelectionContextMenu:n,noPanClassName:e,disableKeyboardA11y:t}){const i=us(),{width:s,height:o,transformString:r,userSelectionActive:a}=Ti(bTe,cs),l=ffe(),c=$.useRef(null);$.useEffect(()=>{var f;t||(f=c.current)==null||f.focus({preventScroll:!0})},[t]);const d=!a&&s!==null&&o!==null;if(ufe({nodeRef:c,disabled:!d}),!d)return null;const h=n?f=>{const g=i.getState().nodes.filter(p=>p.selected);n(f,g)}:void 0,u=f=>{Object.prototype.hasOwnProperty.call(UM,f.key)&&(f.preventDefault(),l({direction:UM[f.key],factor:f.shiftKey?4:1}))};return y.jsx("div",{className:fo(["react-flow__nodesselection","react-flow__container",e]),style:{transform:r},children:y.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:t?void 0:-1,onKeyDown:t?void 0:u,style:{width:s,height:o}})})}const dte=typeof window<"u"?window:void 0,wTe=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function pfe({children:n,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:r,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:d,selectionMode:h,onSelectionStart:u,onSelectionEnd:f,multiSelectionKeyCode:g,panActivationKeyCode:p,zoomActivationKeyCode:m,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:w,panOnScroll:C,panOnScrollSpeed:S,panOnScrollMode:L,zoomOnDoubleClick:x,panOnDrag:I,defaultViewport:E,translateExtent:R,minZoom:M,maxZoom:A,preventScrolling:W,onSelectionContextMenu:P,noWheelClassName:B,noPanClassName:V,disableKeyboardA11y:K,onViewportChange:z,isControlledViewport:j}){const{nodesSelectionActive:X,userSelectionActive:Y}=Ti(wTe,cs),te=GI(c,{target:dte}),ce=GI(p,{target:dte}),Ce=ce||I,xe=ce||C,Be=d&&Ce!==!0,Ee=te||Y||Be;return eTe({deleteKeyCode:l,multiSelectionKeyCode:g}),y.jsx(nTe,{onPaneContextMenu:o,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:w,panOnScroll:xe,panOnScrollSpeed:S,panOnScrollMode:L,zoomOnDoubleClick:x,panOnDrag:!te&&Ce,defaultViewport:E,translateExtent:R,minZoom:M,maxZoom:A,zoomActivationKeyCode:m,preventScrolling:W,noWheelClassName:B,noPanClassName:V,onViewportChange:z,isControlledViewport:j,paneClickDistance:a,selectionOnDrag:Be,children:y.jsxs(aTe,{onSelectionStart:u,onSelectionEnd:f,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:r,panOnDrag:Ce,isSelecting:!!Ee,selectionMode:h,selectionKeyPressed:te,paneClickDistance:a,selectionOnDrag:Be,children:[n,X&&y.jsx(vTe,{onSelectionContextMenu:P,noPanClassName:V,disableKeyboardA11y:K})]})})}pfe.displayName="FlowRenderer";const CTe=$.memo(pfe),yTe=n=>e=>n?lG(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(t=>t.id):Array.from(e.nodeLookup.keys());function STe(n){return Ti($.useCallback(yTe(n),[n]),cs)}const xTe=n=>n.updateNodeInternals;function LTe(){const n=Ti(xTe),[e]=$.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const i=new Map;t.forEach(s=>{const o=s.target.getAttribute("data-id");i.set(o,{id:o,nodeElement:s.target,force:!0})}),n(i)}));return $.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function kTe({node:n,nodeType:e,hasDimensions:t,resizeObserver:i}){const s=us(),o=$.useRef(null),r=$.useRef(null),a=$.useRef(n.sourcePosition),l=$.useRef(n.targetPosition),c=$.useRef(e),d=t&&!!n.internals.handleBounds;return $.useEffect(()=>{o.current&&!n.hidden&&(!d||r.current!==o.current)&&(r.current&&(i==null||i.unobserve(r.current)),i==null||i.observe(o.current),r.current=o.current)},[d,n.hidden]),$.useEffect(()=>()=>{r.current&&(i==null||i.unobserve(r.current),r.current=null)},[]),$.useEffect(()=>{if(o.current){const h=c.current!==e,u=a.current!==n.sourcePosition,f=l.current!==n.targetPosition;(h||u||f)&&(c.current=e,a.current=n.sourcePosition,l.current=n.targetPosition,s.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:o.current,force:!0}]])))}},[n.id,e,n.sourcePosition,n.targetPosition]),o}function ITe({id:n,onClick:e,onMouseEnter:t,onMouseMove:i,onMouseLeave:s,onContextMenu:o,onDoubleClick:r,nodesDraggable:a,elementsSelectable:l,nodesConnectable:c,nodesFocusable:d,resizeObserver:h,noDragClassName:u,noPanClassName:f,disableKeyboardA11y:g,rfId:p,nodeTypes:m,nodeClickDistance:b,onError:v}){const{node:w,internals:C,isParent:S}=Ti(Le=>{const ze=Le.nodeLookup.get(n),Ct=Le.parentLookup.has(n);return{node:ze,internals:ze.internals,isParent:Ct}},cs);let L=w.type||"default",x=(m==null?void 0:m[L])||cte[L];x===void 0&&(v==null||v("003",bu.error003(L)),L="default",x=(m==null?void 0:m.default)||cte.default);const I=!!(w.draggable||a&&typeof w.draggable>"u"),E=!!(w.selectable||l&&typeof w.selectable>"u"),R=!!(w.connectable||c&&typeof w.connectable>"u"),M=!!(w.focusable||d&&typeof w.focusable>"u"),A=us(),W=Rue(w),P=kTe({node:w,nodeType:L,hasDimensions:W,resizeObserver:h}),B=ufe({nodeRef:P,disabled:w.hidden||!I,noDragClassName:u,handleSelector:w.dragHandle,nodeId:n,isSelectable:E,nodeClickDistance:b}),V=ffe();if(w.hidden)return null;const K=Wg(w),z=_Te(w),j=E||I||e||t||i||s,X=t?Le=>t(Le,{...C.userNode}):void 0,Y=i?Le=>i(Le,{...C.userNode}):void 0,te=s?Le=>s(Le,{...C.userNode}):void 0,ce=o?Le=>o(Le,{...C.userNode}):void 0,Ce=r?Le=>r(Le,{...C.userNode}):void 0,xe=Le=>{const{selectNodesOnDrag:ze,nodeDragThreshold:Ct}=A.getState();E&&(!ze||!I||Ct>0)&&UB({id:n,store:A,nodeRef:P}),e&&e(Le,{...C.userNode})},Be=Le=>{if(!(Pue(Le.nativeEvent)||g)){if(Sue.includes(Le.key)&&E){const ze=Le.key==="Escape";UB({id:n,store:A,unselect:ze,nodeRef:P})}else if(I&&w.selected&&Object.prototype.hasOwnProperty.call(UM,Le.key)){Le.preventDefault();const{ariaLabelConfig:ze}=A.getState();A.setState({ariaLiveMessage:ze["node.a11yDescription.ariaLiveMessage"]({direction:Le.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:UM[Le.key],factor:Le.shiftKey?4:1})}}},Ee=()=>{var _t;if(g||!((_t=P.current)!=null&&_t.matches(":focus-visible")))return;const{transform:Le,width:ze,height:Ct,autoPanOnNodeFocus:ct,setCenter:Ue}=A.getState();if(!ct)return;lG(new Map([[n,w]]),{x:0,y:0,width:ze,height:Ct},Le,!0).length>0||Ue(w.position.x+K.width/2,w.position.y+K.height/2,{zoom:Le[2]})};return y.jsx("div",{className:fo(["react-flow__node",`react-flow__node-${L}`,{[f]:I},w.className,{selected:w.selected,selectable:E,parent:S,draggable:I,dragging:B}]),ref:P,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:W?"visible":"hidden",...w.style,...z},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:X,onMouseMove:Y,onMouseLeave:te,onContextMenu:ce,onClick:xe,onDoubleClick:Ce,onKeyDown:M?Be:void 0,tabIndex:M?0:void 0,onFocus:M?Ee:void 0,role:w.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${sfe}-${p}`,"aria-label":w.ariaLabel,...w.domAttributes,children:y.jsx(cTe,{value:n,children:y.jsx(x,{id:n,data:w.data,type:L,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:w.selected??!1,selectable:E,draggable:I,deletable:w.deletable??!0,isConnectable:R,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:B,dragHandle:w.dragHandle,zIndex:C.z,parentId:w.parentId,...K})})})}var ETe=$.memo(ITe);const NTe=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function mfe(n){const{nodesDraggable:e,nodesConnectable:t,nodesFocusable:i,elementsSelectable:s,onError:o}=Ti(NTe,cs),r=STe(n.onlyRenderVisibleElements),a=LTe();return y.jsx("div",{className:"react-flow__nodes",style:k5,children:r.map(l=>y.jsx(ETe,{id:l,nodeTypes:n.nodeTypes,nodeExtent:n.nodeExtent,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:a,nodesDraggable:e,nodesConnectable:t,nodesFocusable:i,elementsSelectable:s,nodeClickDistance:n.nodeClickDistance,onError:o},l))})}mfe.displayName="NodeRenderer";const DTe=$.memo(mfe);function TTe(n){return Ti($.useCallback(t=>{if(!n)return t.edges.map(s=>s.id);const i=[];if(t.width&&t.height)for(const s of t.edges){const o=t.nodeLookup.get(s.source),r=t.nodeLookup.get(s.target);o&&r&&pNe({sourceNode:o,targetNode:r,width:t.width,height:t.height,transform:t.transform})&&i.push(s.id)}return i},[n]),cs)}const RTe=({color:n="none",strokeWidth:e=1})=>{const t={strokeWidth:e,...n&&{stroke:n}};return y.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},MTe=({color:n="none",strokeWidth:e=1})=>{const t={strokeWidth:e,...n&&{stroke:n,fill:n}};return y.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},hte={[z1.Arrow]:RTe,[z1.ArrowClosed]:MTe};function ATe(n){const e=us();return $.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(hte,n)?hte[n]:((o=(s=e.getState()).onError)==null||o.call(s,"009",bu.error009(n)),null)},[n])}const PTe=({id:n,type:e,color:t,width:i=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:r,orient:a="auto-start-reverse"})=>{const l=ATe(e);return l?y.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${i}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:y.jsx(l,{color:t,strokeWidth:r})}):null},_fe=({defaultColor:n,rfId:e})=>{const t=Ti(o=>o.edges),i=Ti(o=>o.defaultEdgeOptions),s=$.useMemo(()=>SNe(t,{id:e,defaultColor:n,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[t,i,e,n]);return s.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:s.map(o=>y.jsx(PTe,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};_fe.displayName="MarkerDefinitions";var OTe=$.memo(_fe);function bfe({x:n,y:e,label:t,labelStyle:i,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:r=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d}){const[h,u]=$.useState({x:1,y:0,width:0,height:0}),f=fo(["react-flow__edge-textwrapper",c]),g=$.useRef(null);return $.useEffect(()=>{if(g.current){const p=g.current.getBBox();u({x:p.x,y:p.y,width:p.width,height:p.height})}},[t]),t?y.jsxs("g",{transform:`translate(${n-h.width/2} ${e-h.height/2})`,className:f,visibility:h.width?"visible":"hidden",...d,children:[s&&y.jsx("rect",{width:h.width+2*r[0],x:-r[0],y:-r[1],height:h.height+2*r[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),y.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:g,style:i,children:t}),l]}):null}bfe.displayName="EdgeText";const FTe=$.memo(bfe);function I5({path:n,labelX:e,labelY:t,label:i,labelStyle:s,labelShowBg:o,labelBgStyle:r,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:c=20,...d}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...d,d:n,fill:"none",className:fo(["react-flow__edge-path",d.className])}),c?y.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,i&&Bd(e)&&Bd(t)?y.jsx(FTe,{x:e,y:t,label:i,labelStyle:s,labelShowBg:o,labelBgStyle:r,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function ute({pos:n,x1:e,y1:t,x2:i,y2:s}){return n===Nt.Left||n===Nt.Right?[.5*(e+i),t]:[e,.5*(t+s)]}function vfe({sourceX:n,sourceY:e,sourcePosition:t=Nt.Bottom,targetX:i,targetY:s,targetPosition:o=Nt.Top}){const[r,a]=ute({pos:t,x1:n,y1:e,x2:i,y2:s}),[l,c]=ute({pos:o,x1:i,y1:s,x2:n,y2:e}),[d,h,u,f]=Fue({sourceX:n,sourceY:e,targetX:i,targetY:s,sourceControlX:r,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${n},${e} C${r},${a} ${l},${c} ${i},${s}`,d,h,u,f]}function wfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,sourcePosition:r,targetPosition:a,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:b})=>{const[v,w,C]=vfe({sourceX:t,sourceY:i,sourcePosition:r,targetX:s,targetY:o,targetPosition:a}),S=n.isInternal?void 0:e;return y.jsx(I5,{id:S,path:v,labelX:w,labelY:C,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:b})})}const BTe=wfe({isInternal:!1}),Cfe=wfe({isInternal:!0});BTe.displayName="SimpleBezierEdge";Cfe.displayName="SimpleBezierEdgeInternal";function yfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,sourcePosition:f=Nt.Bottom,targetPosition:g=Nt.Top,markerEnd:p,markerStart:m,pathOptions:b,interactionWidth:v})=>{const[w,C,S]=VB({sourceX:t,sourceY:i,sourcePosition:f,targetX:s,targetY:o,targetPosition:g,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),L=n.isInternal?void 0:e;return y.jsx(I5,{id:L,path:w,labelX:C,labelY:S,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:p,markerStart:m,interactionWidth:v})})}const Sfe=yfe({isInternal:!1}),xfe=yfe({isInternal:!0});Sfe.displayName="SmoothStepEdge";xfe.displayName="SmoothStepEdgeInternal";function Lfe(n){return $.memo(({id:e,...t})=>{var s;const i=n.isInternal?void 0:e;return y.jsx(Sfe,{...t,id:i,pathOptions:$.useMemo(()=>{var o;return{borderRadius:0,offset:(o=t.pathOptions)==null?void 0:o.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const WTe=Lfe({isInternal:!1}),kfe=Lfe({isInternal:!0});WTe.displayName="StepEdge";kfe.displayName="StepEdgeInternal";function Ife(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:f,markerStart:g,interactionWidth:p})=>{const[m,b,v]=Hue({sourceX:t,sourceY:i,targetX:s,targetY:o}),w=n.isInternal?void 0:e;return y.jsx(I5,{id:w,path:m,labelX:b,labelY:v,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:f,markerStart:g,interactionWidth:p})})}const HTe=Ife({isInternal:!1}),Efe=Ife({isInternal:!0});HTe.displayName="StraightEdge";Efe.displayName="StraightEdgeInternal";function Nfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,sourcePosition:r=Nt.Bottom,targetPosition:a=Nt.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,pathOptions:b,interactionWidth:v})=>{const[w,C,S]=Bue({sourceX:t,sourceY:i,sourcePosition:r,targetX:s,targetY:o,targetPosition:a,curvature:b==null?void 0:b.curvature}),L=n.isInternal?void 0:e;return y.jsx(I5,{id:L,path:w,labelX:C,labelY:S,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:v})})}const VTe=Nfe({isInternal:!1}),Dfe=Nfe({isInternal:!0});VTe.displayName="BezierEdge";Dfe.displayName="BezierEdgeInternal";const fte={default:Dfe,straight:Efe,step:kfe,smoothstep:xfe,simplebezier:Cfe},gte={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},zTe=(n,e,t)=>t===Nt.Left?n-e:t===Nt.Right?n+e:n,jTe=(n,e,t)=>t===Nt.Top?n-e:t===Nt.Bottom?n+e:n,pte="react-flow__edgeupdater";function mte({position:n,centerX:e,centerY:t,radius:i=10,onMouseDown:s,onMouseEnter:o,onMouseOut:r,type:a}){return y.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:r,className:fo([pte,`${pte}-${a}`]),cx:zTe(e,i,n),cy:jTe(t,i,n),r:i,stroke:"transparent",fill:"transparent"})}function $Te({isReconnectable:n,reconnectRadius:e,edge:t,sourceX:i,sourceY:s,targetX:o,targetY:r,sourcePosition:a,targetPosition:l,onReconnect:c,onReconnectStart:d,onReconnectEnd:h,setReconnecting:u,setUpdateHover:f}){const g=us(),p=(C,S)=>{if(C.button!==0)return;const{autoPanOnConnect:L,domNode:x,connectionMode:I,connectionRadius:E,lib:R,onConnectStart:M,cancelConnection:A,nodeLookup:W,rfId:P,panBy:B,updateConnection:V}=g.getState(),K=S.type==="target",z=(Y,te)=>{u(!1),h==null||h(Y,t,S.type,te)},j=Y=>c==null?void 0:c(t,Y),X=(Y,te)=>{u(!0),d==null||d(C,t,S.type),M==null||M(Y,te)};$B.onPointerDown(C.nativeEvent,{autoPanOnConnect:L,connectionMode:I,connectionRadius:E,domNode:x,handleId:S.id,nodeId:S.nodeId,nodeLookup:W,isTarget:K,edgeUpdaterType:S.type,lib:R,flowId:P,cancelConnection:A,panBy:B,isValidConnection:(...Y)=>{var te,ce;return((ce=(te=g.getState()).isValidConnection)==null?void 0:ce.call(te,...Y))??!0},onConnect:j,onConnectStart:X,onConnectEnd:(...Y)=>{var te,ce;return(ce=(te=g.getState()).onConnectEnd)==null?void 0:ce.call(te,...Y)},onReconnectEnd:z,updateConnection:V,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},m=C=>p(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>p(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),v=()=>f(!0),w=()=>f(!1);return y.jsxs(y.Fragment,{children:[(n===!0||n==="source")&&y.jsx(mte,{position:a,centerX:i,centerY:s,radius:e,onMouseDown:m,onMouseEnter:v,onMouseOut:w,type:"source"}),(n===!0||n==="target")&&y.jsx(mte,{position:l,centerX:o,centerY:r,radius:e,onMouseDown:b,onMouseEnter:v,onMouseOut:w,type:"target"})]})}function UTe({id:n,edgesFocusable:e,edgesReconnectable:t,elementsSelectable:i,onClick:s,onDoubleClick:o,onContextMenu:r,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,reconnectRadius:d,onReconnect:h,onReconnectStart:u,onReconnectEnd:f,rfId:g,edgeTypes:p,noPanClassName:m,onError:b,disableKeyboardA11y:v}){let w=Ti(Ue=>Ue.edgeLookup.get(n));const C=Ti(Ue=>Ue.defaultEdgeOptions);w=C?{...C,...w}:w;let S=w.type||"default",L=(p==null?void 0:p[S])||fte[S];L===void 0&&(b==null||b("011",bu.error011(S)),S="default",L=(p==null?void 0:p.default)||fte.default);const x=!!(w.focusable||e&&typeof w.focusable>"u"),I=typeof h<"u"&&(w.reconnectable||t&&typeof w.reconnectable>"u"),E=!!(w.selectable||i&&typeof w.selectable>"u"),R=$.useRef(null),[M,A]=$.useState(!1),[W,P]=$.useState(!1),B=us(),{zIndex:V,sourceX:K,sourceY:z,targetX:j,targetY:X,sourcePosition:Y,targetPosition:te}=Ti($.useCallback(Ue=>{const tt=Ue.nodeLookup.get(w.source),_t=Ue.nodeLookup.get(w.target);if(!tt||!_t)return{zIndex:w.zIndex,...gte};const yi=yNe({id:n,sourceNode:tt,targetNode:_t,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:Ue.connectionMode,onError:b});return{zIndex:gNe({selected:w.selected,zIndex:w.zIndex,sourceNode:tt,targetNode:_t,elevateOnSelect:Ue.elevateEdgesOnSelect,zIndexMode:Ue.zIndexMode}),...yi||gte}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),cs),ce=$.useMemo(()=>w.markerStart?`url('#${zB(w.markerStart,g)}')`:void 0,[w.markerStart,g]),Ce=$.useMemo(()=>w.markerEnd?`url('#${zB(w.markerEnd,g)}')`:void 0,[w.markerEnd,g]);if(w.hidden||K===null||z===null||j===null||X===null)return null;const xe=Ue=>{var Pt;const{addSelectedEdges:tt,unselectNodesAndEdges:_t,multiSelectionActive:yi}=B.getState();E&&(B.setState({nodesSelectionActive:!1}),w.selected&&yi?(_t({nodes:[],edges:[w]}),(Pt=R.current)==null||Pt.blur()):tt([n])),s&&s(Ue,w)},Be=o?Ue=>{o(Ue,{...w})}:void 0,Ee=r?Ue=>{r(Ue,{...w})}:void 0,Le=a?Ue=>{a(Ue,{...w})}:void 0,ze=l?Ue=>{l(Ue,{...w})}:void 0,Ct=c?Ue=>{c(Ue,{...w})}:void 0,ct=Ue=>{var tt;if(!v&&Sue.includes(Ue.key)&&E){const{unselectNodesAndEdges:_t,addSelectedEdges:yi}=B.getState();Ue.key==="Escape"?((tt=R.current)==null||tt.blur(),_t({edges:[w]})):yi([n])}};return y.jsx("svg",{style:{zIndex:V},children:y.jsxs("g",{className:fo(["react-flow__edge",`react-flow__edge-${S}`,w.className,m,{selected:w.selected,animated:w.animated,inactive:!E&&!s,updating:M,selectable:E}]),onClick:xe,onDoubleClick:Be,onContextMenu:Ee,onMouseEnter:Le,onMouseMove:ze,onMouseLeave:Ct,onKeyDown:x?ct:void 0,tabIndex:x?0:void 0,role:w.ariaRole??(x?"group":"img"),"aria-roledescription":"edge","data-id":n,"data-testid":`rf__edge-${n}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":x?`${ofe}-${g}`:void 0,ref:R,...w.domAttributes,children:[!W&&y.jsx(L,{id:n,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:E,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:K,sourceY:z,targetX:j,targetY:X,sourcePosition:Y,targetPosition:te,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:ce,markerEnd:Ce,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),I&&y.jsx($Te,{edge:w,isReconnectable:I,reconnectRadius:d,onReconnect:h,onReconnectStart:u,onReconnectEnd:f,sourceX:K,sourceY:z,targetX:j,targetY:X,sourcePosition:Y,targetPosition:te,setUpdateHover:A,setReconnecting:P})]})})}var qTe=$.memo(UTe);const KTe=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Tfe({defaultMarkerColor:n,onlyRenderVisibleElements:e,rfId:t,edgeTypes:i,noPanClassName:s,onReconnect:o,onEdgeContextMenu:r,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,reconnectRadius:h,onEdgeDoubleClick:u,onReconnectStart:f,onReconnectEnd:g,disableKeyboardA11y:p}){const{edgesFocusable:m,edgesReconnectable:b,elementsSelectable:v,onError:w}=Ti(KTe,cs),C=TTe(e);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(OTe,{defaultColor:n,rfId:t}),C.map(S=>y.jsx(qTe,{id:S,edgesFocusable:m,edgesReconnectable:b,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:r,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:d,reconnectRadius:h,onDoubleClick:u,onReconnectStart:f,onReconnectEnd:g,rfId:t,onError:w,edgeTypes:i,disableKeyboardA11y:p},S))]})}Tfe.displayName="EdgeRenderer";const GTe=$.memo(Tfe),YTe=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function ZTe({children:n}){const e=Ti(YTe);return y.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:n})}function XTe(n){const e=mG(),t=$.useRef(!1);$.useEffect(()=>{!t.current&&e.viewportInitialized&&n&&(setTimeout(()=>n(e),1),t.current=!0)},[n,e.viewportInitialized])}const QTe=n=>{var e;return(e=n.panZoom)==null?void 0:e.syncViewport};function JTe(n){const e=Ti(QTe),t=us();return $.useEffect(()=>{n&&(e==null||e(n),t.setState({transform:[n.x,n.y,n.zoom]}))},[n,e]),null}function e2e(n){return n.connection.inProgress?{...n.connection,to:eD(n.connection.to,n.transform)}:{...n.connection}}function t2e(n){return e2e}function i2e(n){const e=t2e();return Ti(e,cs)}const n2e=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function s2e({containerStyle:n,style:e,type:t,component:i}){const{nodesConnectable:s,width:o,height:r,isValid:a,inProgress:l}=Ti(n2e,cs);return!(o&&s&&l)?null:y.jsx("svg",{style:n,width:o,height:r,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:fo(["react-flow__connection",kue(a)]),children:y.jsx(Rfe,{style:e,type:t,CustomComponent:i,isValid:a})})})}const Rfe=({style:n,type:e=Df.Bezier,CustomComponent:t,isValid:i})=>{const{inProgress:s,from:o,fromNode:r,fromHandle:a,fromPosition:l,to:c,toNode:d,toHandle:h,toPosition:u,pointer:f}=i2e();if(!s)return;if(t)return y.jsx(t,{connectionLineType:e,connectionLineStyle:n,fromNode:r,fromHandle:a,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:u,connectionStatus:kue(i),toNode:d,toHandle:h,pointer:f});let g="";const p={sourceX:o.x,sourceY:o.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:u};switch(e){case Df.Bezier:[g]=Bue(p);break;case Df.SimpleBezier:[g]=vfe(p);break;case Df.Step:[g]=VB({...p,borderRadius:0});break;case Df.SmoothStep:[g]=VB(p);break;default:[g]=Hue(p)}return y.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:n})};Rfe.displayName="ConnectionLine";const o2e={};function _te(n=o2e){$.useRef(n),us(),$.useEffect(()=>{},[n])}function r2e(){us(),$.useRef(!1),$.useEffect(()=>{},[])}function Mfe({nodeTypes:n,edgeTypes:e,onInit:t,onNodeClick:i,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:r,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,onSelectionContextMenu:h,onSelectionStart:u,onSelectionEnd:f,connectionLineType:g,connectionLineStyle:p,connectionLineComponent:m,connectionLineContainerStyle:b,selectionKeyCode:v,selectionOnDrag:w,selectionMode:C,multiSelectionKeyCode:S,panActivationKeyCode:L,zoomActivationKeyCode:x,deleteKeyCode:I,onlyRenderVisibleElements:E,elementsSelectable:R,defaultViewport:M,translateExtent:A,minZoom:W,maxZoom:P,preventScrolling:B,defaultMarkerColor:V,zoomOnScroll:K,zoomOnPinch:z,panOnScroll:j,panOnScrollSpeed:X,panOnScrollMode:Y,zoomOnDoubleClick:te,panOnDrag:ce,onPaneClick:Ce,onPaneMouseEnter:xe,onPaneMouseMove:Be,onPaneMouseLeave:Ee,onPaneScroll:Le,onPaneContextMenu:ze,paneClickDistance:Ct,nodeClickDistance:ct,onEdgeContextMenu:Ue,onEdgeMouseEnter:tt,onEdgeMouseMove:_t,onEdgeMouseLeave:yi,reconnectRadius:Pt,onReconnect:Cn,onReconnectStart:Xn,onReconnectEnd:Ks,noDragClassName:kr,noWheelClassName:Ir,noPanClassName:fc,disableKeyboardA11y:Er,nodeExtent:Ta,rfId:po,viewport:gn,onViewportChange:yn}){return _te(n),_te(e),r2e(),XTe(t),JTe(gn),y.jsx(CTe,{onPaneClick:Ce,onPaneMouseEnter:xe,onPaneMouseMove:Be,onPaneMouseLeave:Ee,onPaneContextMenu:ze,onPaneScroll:Le,paneClickDistance:Ct,deleteKeyCode:I,selectionKeyCode:v,selectionOnDrag:w,selectionMode:C,onSelectionStart:u,onSelectionEnd:f,multiSelectionKeyCode:S,panActivationKeyCode:L,zoomActivationKeyCode:x,elementsSelectable:R,zoomOnScroll:K,zoomOnPinch:z,zoomOnDoubleClick:te,panOnScroll:j,panOnScrollSpeed:X,panOnScrollMode:Y,panOnDrag:ce,defaultViewport:M,translateExtent:A,minZoom:W,maxZoom:P,onSelectionContextMenu:h,preventScrolling:B,noDragClassName:kr,noWheelClassName:Ir,noPanClassName:fc,disableKeyboardA11y:Er,onViewportChange:yn,isControlledViewport:!!gn,children:y.jsxs(ZTe,{children:[y.jsx(GTe,{edgeTypes:e,onEdgeClick:s,onEdgeDoubleClick:r,onReconnect:Cn,onReconnectStart:Xn,onReconnectEnd:Ks,onlyRenderVisibleElements:E,onEdgeContextMenu:Ue,onEdgeMouseEnter:tt,onEdgeMouseMove:_t,onEdgeMouseLeave:yi,reconnectRadius:Pt,defaultMarkerColor:V,noPanClassName:fc,disableKeyboardA11y:Er,rfId:po}),y.jsx(s2e,{style:p,type:g,component:m,containerStyle:b}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(DTe,{nodeTypes:n,onNodeClick:i,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,nodeClickDistance:ct,onlyRenderVisibleElements:E,noPanClassName:fc,noDragClassName:kr,disableKeyboardA11y:Er,nodeExtent:Ta,rfId:po}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}Mfe.displayName="GraphView";const a2e=$.memo(Mfe),bte=({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l=.5,maxZoom:c=2,nodeOrigin:d,nodeExtent:h,zIndexMode:u="basic"}={})=>{const f=new Map,g=new Map,p=new Map,m=new Map,b=i??e??[],v=t??n??[],w=d??[0,0],C=h??$I;jue(p,m,b);const S=jB(v,f,g,{nodeOrigin:w,nodeExtent:C,zIndexMode:u});let L=[0,0,1];if(r&&s&&o){const x=QN(f,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:I,y:E,zoom:R}=cG(x,s,o,l,c,(a==null?void 0:a.padding)??.1);L=[I,E,R]}return{rfId:"1",width:s??0,height:o??0,transform:L,nodes:v,nodesInitialized:S,nodeLookup:f,parentLookup:g,edges:b,edgeLookup:m,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:$I,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Yy.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:w,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:r??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Lue},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:lNe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:xue,zIndexMode:u,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},l2e=({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:h,zIndexMode:u})=>kDe((f,g)=>{async function p(){const{nodeLookup:m,panZoom:b,fitViewOptions:v,fitViewResolver:w,width:C,height:S,minZoom:L,maxZoom:x}=g();b&&(await rNe({nodes:m,width:C,height:S,panZoom:b,minZoom:L,maxZoom:x},v),w==null||w.resolve(!0),f({fitViewResolver:null}))}return{...bte({nodes:n,edges:e,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:h,defaultNodes:t,defaultEdges:i,zIndexMode:u}),setNodes:m=>{const{nodeLookup:b,parentLookup:v,nodeOrigin:w,elevateNodesOnSelect:C,fitViewQueued:S,zIndexMode:L}=g(),x=jB(m,b,v,{nodeOrigin:w,nodeExtent:h,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:L});S&&x?(p(),f({nodes:m,nodesInitialized:x,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:m,nodesInitialized:x})},setEdges:m=>{const{connectionLookup:b,edgeLookup:v}=g();jue(b,v,m),f({edges:m})},setDefaultNodesAndEdges:(m,b)=>{if(m){const{setNodes:v}=g();v(m),f({hasDefaultNodes:!0})}if(b){const{setEdges:v}=g();v(b),f({hasDefaultEdges:!0})}},updateNodeInternals:m=>{const{triggerNodeChanges:b,nodeLookup:v,parentLookup:w,domNode:C,nodeOrigin:S,nodeExtent:L,debug:x,fitViewQueued:I,zIndexMode:E}=g(),{changes:R,updatedInternals:M}=DNe(m,v,w,C,S,L,E);M&&(kNe(v,w,{nodeOrigin:S,nodeExtent:L,zIndexMode:E}),I?(p(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),(R==null?void 0:R.length)>0&&(x&&console.log("React Flow: trigger node changes",R),b==null||b(R)))},updateNodePositions:(m,b=!1)=>{const v=[];let w=[];const{nodeLookup:C,triggerNodeChanges:S,connection:L,updateConnection:x,onNodesChangeMiddlewareMap:I}=g();for(const[E,R]of m){const M=C.get(E),A=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(R!=null&&R.position)),W={id:E,type:"position",position:A?{x:Math.max(0,R.position.x),y:Math.max(0,R.position.y)}:R.position,dragging:b};if(M&&L.inProgress&&L.fromNode.id===M.id){const P=$1(M,L.fromHandle,Nt.Left,!0);x({...L,from:P})}A&&M.parentId&&v.push({id:E,parentId:M.parentId,rect:{...R.internals.positionAbsolute,width:R.measured.width??0,height:R.measured.height??0}}),w.push(W)}if(v.length>0){const{parentLookup:E,nodeOrigin:R}=g(),M=pG(v,C,E,R);w.push(...M)}for(const E of I.values())w=E(w);S(w)},triggerNodeChanges:m=>{const{onNodesChange:b,setNodes:v,nodes:w,hasDefaultNodes:C,debug:S}=g();if(m!=null&&m.length){if(C){const L=lfe(m,w);v(L)}S&&console.log("React Flow: trigger node changes",m),b==null||b(m)}},triggerEdgeChanges:m=>{const{onEdgesChange:b,setEdges:v,edges:w,hasDefaultEdges:C,debug:S}=g();if(m!=null&&m.length){if(C){const L=cfe(m,w);v(L)}S&&console.log("React Flow: trigger edge changes",m),b==null||b(m)}},addSelectedNodes:m=>{const{multiSelectionActive:b,edgeLookup:v,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:S}=g();if(b){const L=m.map(x=>ab(x,!0));C(L);return}C(QC(w,new Set([...m]),!0)),S(QC(v))},addSelectedEdges:m=>{const{multiSelectionActive:b,edgeLookup:v,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:S}=g();if(b){const L=m.map(x=>ab(x,!0));S(L);return}S(QC(v,new Set([...m]))),C(QC(w,new Set,!0))},unselectNodesAndEdges:({nodes:m,edges:b}={})=>{const{edges:v,nodes:w,nodeLookup:C,triggerNodeChanges:S,triggerEdgeChanges:L}=g(),x=m||w,I=b||v,E=[];for(const M of x){if(!M.selected)continue;const A=C.get(M.id);A&&(A.selected=!1),E.push(ab(M.id,!1))}const R=[];for(const M of I)M.selected&&R.push(ab(M.id,!1));S(E),L(R)},setMinZoom:m=>{const{panZoom:b,maxZoom:v}=g();b==null||b.setScaleExtent([m,v]),f({minZoom:m})},setMaxZoom:m=>{const{panZoom:b,minZoom:v}=g();b==null||b.setScaleExtent([v,m]),f({maxZoom:m})},setTranslateExtent:m=>{var b;(b=g().panZoom)==null||b.setTranslateExtent(m),f({translateExtent:m})},resetSelectedElements:()=>{const{edges:m,nodes:b,triggerNodeChanges:v,triggerEdgeChanges:w,elementsSelectable:C}=g();if(!C)return;const S=b.reduce((x,I)=>I.selected?[...x,ab(I.id,!1)]:x,[]),L=m.reduce((x,I)=>I.selected?[...x,ab(I.id,!1)]:x,[]);v(S),w(L)},setNodeExtent:m=>{const{nodes:b,nodeLookup:v,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:S,nodeExtent:L,zIndexMode:x}=g();m[0][0]===L[0][0]&&m[0][1]===L[0][1]&&m[1][0]===L[1][0]&&m[1][1]===L[1][1]||(jB(b,v,w,{nodeOrigin:C,nodeExtent:m,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:x}),f({nodeExtent:m}))},panBy:m=>{const{transform:b,width:v,height:w,panZoom:C,translateExtent:S}=g();return TNe({delta:m,panZoom:C,transform:b,translateExtent:S,width:v,height:w})},setCenter:async(m,b,v)=>{const{width:w,height:C,maxZoom:S,panZoom:L}=g();if(!L)return Promise.resolve(!1);const x=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:S;return await L.setViewport({x:w/2-m*x,y:C/2-b*x,zoom:x},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{f({connection:{...Lue}})},updateConnection:m=>{f({connection:m})},reset:()=>f({...bte()})}},Object.is);function c2e({initialNodes:n,initialEdges:e,defaultNodes:t,defaultEdges:i,initialWidth:s,initialHeight:o,initialMinZoom:r,initialMaxZoom:a,initialFitViewOptions:l,fitView:c,nodeOrigin:d,nodeExtent:h,zIndexMode:u,children:f}){const[g]=$.useState(()=>l2e({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:c,minZoom:r,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:h,zIndexMode:u}));return y.jsx(IDe,{value:g,children:y.jsx(ZDe,{children:f})})}function d2e({children:n,nodes:e,edges:t,defaultNodes:i,defaultEdges:s,width:o,height:r,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:h,nodeExtent:u,zIndexMode:f}){return $.useContext(x5)?y.jsx(y.Fragment,{children:n}):y.jsx(c2e,{initialNodes:e,initialEdges:t,defaultNodes:i,defaultEdges:s,initialWidth:o,initialHeight:r,fitView:a,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:d,nodeOrigin:h,nodeExtent:u,zIndexMode:f,children:n})}const h2e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function u2e({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,className:s,nodeTypes:o,edgeTypes:r,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:h,onMoveEnd:u,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:m,onClickConnectEnd:b,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:S,onNodeDoubleClick:L,onNodeDragStart:x,onNodeDrag:I,onNodeDragStop:E,onNodesDelete:R,onEdgesDelete:M,onDelete:A,onSelectionChange:W,onSelectionDragStart:P,onSelectionDrag:B,onSelectionDragStop:V,onSelectionContextMenu:K,onSelectionStart:z,onSelectionEnd:j,onBeforeDelete:X,connectionMode:Y,connectionLineType:te=Df.Bezier,connectionLineStyle:ce,connectionLineComponent:Ce,connectionLineContainerStyle:xe,deleteKeyCode:Be="Backspace",selectionKeyCode:Ee="Shift",selectionOnDrag:Le=!1,selectionMode:ze=UI.Full,panActivationKeyCode:Ct="Space",multiSelectionKeyCode:ct=KI()?"Meta":"Control",zoomActivationKeyCode:Ue=KI()?"Meta":"Control",snapToGrid:tt,snapGrid:_t,onlyRenderVisibleElements:yi=!1,selectNodesOnDrag:Pt,nodesDraggable:Cn,autoPanOnNodeFocus:Xn,nodesConnectable:Ks,nodesFocusable:kr,nodeOrigin:Ir=rfe,edgesFocusable:fc,edgesReconnectable:Er,elementsSelectable:Ta=!0,defaultViewport:po=HDe,minZoom:gn=.5,maxZoom:yn=2,translateExtent:tn=$I,preventScrolling:Ra=!0,nodeExtent:gc,defaultMarkerColor:_l="#b1b1b7",zoomOnScroll:id=!0,zoomOnPinch:Os=!0,panOnScroll:Jr=!1,panOnScrollSpeed:er=.5,panOnScrollMode:pc=Cv.Free,zoomOnDoubleClick:Mi=!0,panOnDrag:Dn=!0,onPaneClick:ks,onPaneMouseEnter:Nr,onPaneMouseMove:nd,onPaneMouseLeave:Dr,onPaneScroll:fs,onPaneContextMenu:Bn,paneClickDistance:Sn=1,nodeClickDistance:mc=0,children:Q,onReconnect:hh,onReconnectStart:uh,onReconnectEnd:Ki,onEdgeContextMenu:tr,onEdgeDoubleClick:it,onEdgeMouseEnter:ir,onEdgeMouseMove:zt,onEdgeMouseLeave:li,reconnectRadius:Ro=10,onNodesChange:Qn,onEdgesChange:Mo,noDragClassName:Jn="nodrag",noWheelClassName:Yg="nowheel",noPanClassName:_c="nopan",fitView:sd,fitViewOptions:fh,connectOnClick:Hu,attributionPosition:Qe,proOptions:re,defaultEdgeOptions:ke,elevateNodesOnSelect:dt=!0,elevateEdgesOnSelect:Et=!1,disableKeyboardA11y:$n=!1,autoPanOnConnect:ci,autoPanOnNodeDrag:Un,autoPanSpeed:Gs,connectionRadius:Ao,isValidConnection:Vu,onError:es,style:od,id:gh,nodeDragThreshold:Yw,connectionDragThreshold:_x,viewport:bx,onViewportChange:bl,width:I_,height:Zg,colorMode:ph="light",debug:E_,onScroll:Xg,ariaLabelConfig:Zw,zIndexMode:Xw="basic",...Qw},N_){const mh=gh||"1",vx=$De(ph),D_=$.useCallback(Jw=>{Jw.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Xg==null||Xg(Jw)},[Xg]);return y.jsx("div",{"data-testid":"rf__wrapper",...Qw,onScroll:D_,style:{...od,...h2e},ref:N_,className:fo(["react-flow",s,vx]),id:gh,role:"application",children:y.jsxs(d2e,{nodes:n,edges:e,width:I_,height:Zg,fitView:sd,fitViewOptions:fh,minZoom:gn,maxZoom:yn,nodeOrigin:Ir,nodeExtent:gc,zIndexMode:Xw,children:[y.jsx(a2e,{onInit:c,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:S,onNodeDoubleClick:L,nodeTypes:o,edgeTypes:r,connectionLineType:te,connectionLineStyle:ce,connectionLineComponent:Ce,connectionLineContainerStyle:xe,selectionKeyCode:Ee,selectionOnDrag:Le,selectionMode:ze,deleteKeyCode:Be,multiSelectionKeyCode:ct,panActivationKeyCode:Ct,zoomActivationKeyCode:Ue,onlyRenderVisibleElements:yi,defaultViewport:po,translateExtent:tn,minZoom:gn,maxZoom:yn,preventScrolling:Ra,zoomOnScroll:id,zoomOnPinch:Os,zoomOnDoubleClick:Mi,panOnScroll:Jr,panOnScrollSpeed:er,panOnScrollMode:pc,panOnDrag:Dn,onPaneClick:ks,onPaneMouseEnter:Nr,onPaneMouseMove:nd,onPaneMouseLeave:Dr,onPaneScroll:fs,onPaneContextMenu:Bn,paneClickDistance:Sn,nodeClickDistance:mc,onSelectionContextMenu:K,onSelectionStart:z,onSelectionEnd:j,onReconnect:hh,onReconnectStart:uh,onReconnectEnd:Ki,onEdgeContextMenu:tr,onEdgeDoubleClick:it,onEdgeMouseEnter:ir,onEdgeMouseMove:zt,onEdgeMouseLeave:li,reconnectRadius:Ro,defaultMarkerColor:_l,noDragClassName:Jn,noWheelClassName:Yg,noPanClassName:_c,rfId:mh,disableKeyboardA11y:$n,nodeExtent:gc,viewport:bx,onViewportChange:bl}),y.jsx(jDe,{nodes:n,edges:e,defaultNodes:t,defaultEdges:i,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:m,onClickConnectEnd:b,nodesDraggable:Cn,autoPanOnNodeFocus:Xn,nodesConnectable:Ks,nodesFocusable:kr,edgesFocusable:fc,edgesReconnectable:Er,elementsSelectable:Ta,elevateNodesOnSelect:dt,elevateEdgesOnSelect:Et,minZoom:gn,maxZoom:yn,nodeExtent:gc,onNodesChange:Qn,onEdgesChange:Mo,snapToGrid:tt,snapGrid:_t,connectionMode:Y,translateExtent:tn,connectOnClick:Hu,defaultEdgeOptions:ke,fitView:sd,fitViewOptions:fh,onNodesDelete:R,onEdgesDelete:M,onDelete:A,onNodeDragStart:x,onNodeDrag:I,onNodeDragStop:E,onSelectionDrag:B,onSelectionDragStart:P,onSelectionDragStop:V,onMove:d,onMoveStart:h,onMoveEnd:u,noPanClassName:_c,nodeOrigin:Ir,rfId:mh,autoPanOnConnect:ci,autoPanOnNodeDrag:Un,autoPanSpeed:Gs,onError:es,connectionRadius:Ao,isValidConnection:Vu,selectNodesOnDrag:Pt,nodeDragThreshold:Yw,connectionDragThreshold:_x,onBeforeDelete:X,debug:E_,ariaLabelConfig:Zw,zIndexMode:Xw}),y.jsx(WDe,{onSelectionChange:W}),Q,y.jsx(ADe,{proOptions:re,position:Qe}),y.jsx(MDe,{rfId:mh,disableKeyboardA11y:$n})]})})}var f2e=dfe(u2e);function g2e({dimensions:n,lineWidth:e,variant:t,className:i}){return y.jsx("path",{strokeWidth:e,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:fo(["react-flow__background-pattern",t,i])})}function p2e({radius:n,className:e}){return y.jsx("circle",{cx:n,cy:n,r:n,className:fo(["react-flow__background-pattern","dots",e])})}var ig;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ig||(ig={}));const m2e={[ig.Dots]:1,[ig.Lines]:1,[ig.Cross]:6},_2e=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function Afe({id:n,variant:e=ig.Dots,gap:t=20,size:i,lineWidth:s=1,offset:o=0,color:r,bgColor:a,style:l,className:c,patternClassName:d}){const h=$.useRef(null),{transform:u,patternId:f}=Ti(_2e,cs),g=i||m2e[e],p=e===ig.Dots,m=e===ig.Cross,b=Array.isArray(t)?t:[t,t],v=[b[0]*u[2]||1,b[1]*u[2]||1],w=g*u[2],C=Array.isArray(o)?o:[o,o],S=m?[w,w]:v,L=[C[0]*u[2]||1+S[0]/2,C[1]*u[2]||1+S[1]/2],x=`${f}${n||""}`;return y.jsxs("svg",{className:fo(["react-flow__background",c]),style:{...l,...k5,"--xy-background-color-props":a,"--xy-background-pattern-color-props":r},ref:h,"data-testid":"rf__background",children:[y.jsx("pattern",{id:x,x:u[0]%v[0],y:u[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:p?y.jsx(p2e,{radius:w/2,className:d}):y.jsx(g2e,{dimensions:S,lineWidth:s,variant:e,className:d})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${x})`})]})}Afe.displayName="Background";const b2e=$.memo(Afe);function v2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function w2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function C2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.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 y2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.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 S2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.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 kT({children:n,className:e,...t}){return y.jsx("button",{type:"button",className:fo(["react-flow__controls-button",e]),...t,children:n})}const x2e=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function Pfe({style:n,showZoom:e=!0,showFitView:t=!0,showInteractive:i=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:r,onFitView:a,onInteractiveChange:l,className:c,children:d,position:h="bottom-left",orientation:u="vertical","aria-label":f}){const g=us(),{isInteractive:p,minZoomReached:m,maxZoomReached:b,ariaLabelConfig:v}=Ti(x2e,cs),{zoomIn:w,zoomOut:C,fitView:S}=mG(),L=()=>{w(),o==null||o()},x=()=>{C(),r==null||r()},I=()=>{S(s),a==null||a()},E=()=>{g.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),l==null||l(!p)},R=u==="horizontal"?"horizontal":"vertical";return y.jsxs(L5,{className:fo(["react-flow__controls",R,c]),position:h,style:n,"data-testid":"rf__controls","aria-label":f??v["controls.ariaLabel"],children:[e&&y.jsxs(y.Fragment,{children:[y.jsx(kT,{onClick:L,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:b,children:y.jsx(v2e,{})}),y.jsx(kT,{onClick:x,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:m,children:y.jsx(w2e,{})})]}),t&&y.jsx(kT,{className:"react-flow__controls-fitview",onClick:I,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:y.jsx(C2e,{})}),i&&y.jsx(kT,{className:"react-flow__controls-interactive",onClick:E,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:p?y.jsx(S2e,{}):y.jsx(y2e,{})}),d]})}Pfe.displayName="Controls";const L2e=$.memo(Pfe);function k2e({id:n,x:e,y:t,width:i,height:s,style:o,color:r,strokeColor:a,strokeWidth:l,className:c,borderRadius:d,shapeRendering:h,selected:u,onClick:f}){const{background:g,backgroundColor:p}=o||{},m=r||g||p;return y.jsx("rect",{className:fo(["react-flow__minimap-node",{selected:u},c]),x:e,y:t,rx:d,ry:d,width:i,height:s,style:{fill:m,stroke:a,strokeWidth:l},shapeRendering:h,onClick:f?b=>f(b,n):void 0})}const I2e=$.memo(k2e),E2e=n=>n.nodes.map(e=>e.id),s7=n=>n instanceof Function?n:()=>n;function N2e({nodeStrokeColor:n,nodeColor:e,nodeClassName:t="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:o=I2e,onClick:r}){const a=Ti(E2e,cs),l=s7(e),c=s7(n),d=s7(t),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:a.map(u=>y.jsx(T2e,{id:u,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:s,NodeComponent:o,onClick:r,shapeRendering:h},u))})}function D2e({id:n,nodeColorFunc:e,nodeStrokeColorFunc:t,nodeClassNameFunc:i,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:r,NodeComponent:a,onClick:l}){const{node:c,x:d,y:h,width:u,height:f}=Ti(g=>{const p=g.nodeLookup.get(n);if(!p)return{node:void 0,x:0,y:0,width:0,height:0};const m=p.internals.userNode,{x:b,y:v}=p.internals.positionAbsolute,{width:w,height:C}=Wg(m);return{node:m,x:b,y:v,width:w,height:C}},cs);return!c||c.hidden||!Rue(c)?null:y.jsx(a,{x:d,y:h,width:u,height:f,style:c.style,selected:!!c.selected,className:i(c),color:e(c),borderRadius:s,strokeColor:t(c),strokeWidth:o,shapeRendering:r,onClick:l,id:c.id})}const T2e=$.memo(D2e);var R2e=$.memo(N2e);const M2e=200,A2e=150,P2e=n=>!n.hidden,O2e=n=>{const e={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:e,boundingRect:n.nodeLookup.size>0?Tue(QN(n.nodeLookup,{filter:P2e}),e):e,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},F2e="react-flow__minimap-desc";function Ofe({style:n,className:e,nodeStrokeColor:t,nodeColor:i,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:a,bgColor:l,maskColor:c,maskStrokeColor:d,maskStrokeWidth:h,position:u="bottom-right",onClick:f,onNodeClick:g,pannable:p=!1,zoomable:m=!1,ariaLabel:b,inversePan:v,zoomStep:w=1,offsetScale:C=5}){const S=us(),L=$.useRef(null),{boundingRect:x,viewBB:I,rfId:E,panZoom:R,translateExtent:M,flowWidth:A,flowHeight:W,ariaLabelConfig:P}=Ti(O2e,cs),B=(n==null?void 0:n.width)??M2e,V=(n==null?void 0:n.height)??A2e,K=x.width/B,z=x.height/V,j=Math.max(K,z),X=j*B,Y=j*V,te=C*j,ce=x.x-(X-x.width)/2-te,Ce=x.y-(Y-x.height)/2-te,xe=X+te*2,Be=Y+te*2,Ee=`${F2e}-${E}`,Le=$.useRef(0),ze=$.useRef();Le.current=j,$.useEffect(()=>{if(L.current&&R)return ze.current=HNe({domNode:L.current,panZoom:R,getTransform:()=>S.getState().transform,getViewScale:()=>Le.current}),()=>{var tt;(tt=ze.current)==null||tt.destroy()}},[R]),$.useEffect(()=>{var tt;(tt=ze.current)==null||tt.update({translateExtent:M,width:A,height:W,inversePan:v,pannable:p,zoomStep:w,zoomable:m})},[p,m,v,w,M,A,W]);const Ct=f?tt=>{var Pt;const[_t,yi]=((Pt=ze.current)==null?void 0:Pt.pointer(tt))||[0,0];f(tt,{x:_t,y:yi})}:void 0,ct=g?$.useCallback((tt,_t)=>{const yi=S.getState().nodeLookup.get(_t).internals.userNode;g(tt,yi)},[]):void 0,Ue=b??P["minimap.ariaLabel"];return y.jsx(L5,{position:u,style:{...n,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*j:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof r=="number"?r:void 0},className:fo(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:B,height:V,viewBox:`${ce} ${Ce} ${xe} ${Be}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ee,ref:L,onClick:Ct,children:[Ue&&y.jsx("title",{id:Ee,children:Ue}),y.jsx(R2e,{onClick:ct,nodeColor:i,nodeStrokeColor:t,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:r,nodeComponent:a}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${ce-te},${Ce-te}h${xe+te*2}v${Be+te*2}h${-xe-te*2}z - M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Ofe.displayName="MiniMap";const B2e=$.memo(Ofe),W2e=n=>e=>n?`${Math.max(1/e.transform[2],1)}`:void 0,H2e={[Jy.Line]:"right",[Jy.Handle]:"bottom-right"};function V2e({nodeId:n,position:e,variant:t=Jy.Handle,className:i,style:s=void 0,children:o,color:r,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:u,autoScale:f=!0,shouldResize:g,onResizeStart:p,onResize:m,onResizeEnd:b}){const v=gfe(),w=typeof n=="string"?n:v,C=us(),S=$.useRef(null),L=t===Jy.Handle,x=Ti($.useCallback(W2e(L&&f),[L,f]),cs),I=$.useRef(null),E=e??H2e[t];$.useEffect(()=>{if(!(!S.current||!w))return I.current||(I.current=eDe({domNode:S.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:M,transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B,domNode:V}=C.getState();return{nodeLookup:M,transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B,paneDomNode:V}},onChange:(M,A)=>{const{triggerNodeChanges:W,nodeLookup:P,parentLookup:B,nodeOrigin:V}=C.getState(),K=[],z={x:M.x,y:M.y},j=P.get(w);if(j&&j.expandParent&&j.parentId){const X=j.origin??V,Y=M.width??j.measured.width??0,te=M.height??j.measured.height??0,ce={id:j.id,parentId:j.parentId,rect:{width:Y,height:te,...Mue({x:M.x??j.position.x,y:M.y??j.position.y},{width:Y,height:te},j.parentId,P,X)}},Ce=pG([ce],P,B,V);K.push(...Ce),z.x=M.x?Math.max(X[0]*Y,M.x):void 0,z.y=M.y?Math.max(X[1]*te,M.y):void 0}if(z.x!==void 0&&z.y!==void 0){const X={id:w,type:"position",position:{...z}};K.push(X)}if(M.width!==void 0&&M.height!==void 0){const Y={id:w,type:"dimensions",resizing:!0,setAttributes:u?u==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};K.push(Y)}for(const X of A){const Y={...X,type:"position"};K.push(Y)}W(K)},onEnd:({width:M,height:A})=>{const W={id:w,type:"dimensions",resizing:!1,dimensions:{width:M,height:A}};C.getState().triggerNodeChanges([W])}})),I.current.update({controlPosition:E,boundaries:{minWidth:a,minHeight:l,maxWidth:c,maxHeight:d},keepAspectRatio:h,resizeDirection:u,onResizeStart:p,onResize:m,onResizeEnd:b,shouldResize:g}),()=>{var M;(M=I.current)==null||M.destroy()}},[E,a,l,c,d,h,p,m,b,g]);const R=E.split("-");return y.jsx("div",{className:fo(["react-flow__resize-control","nodrag",...R,t,i]),ref:S,style:{...s,scale:x,...r&&{[L?"backgroundColor":"borderColor"]:r}},children:o})}$.memo(V2e);/** +`)),d=c.reduce((h,u)=>h.concat(...u),[]);return[c,d]}return[[],[]]},[n]);return $.useEffect(()=>{const l=(e==null?void 0:e.target)??ite,c=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(n!==null){const d=f=>{var m,b;if(s.current=f.ctrlKey||f.metaKey||f.shiftKey||f.altKey,(!s.current||s.current&&!c)&&Bue(f))return!1;const p=ste(f.code,a);if(o.current.add(f[p]),nte(r,o.current,!1)){const v=((b=(m=f.composedPath)==null?void 0:m.call(f))==null?void 0:b[0])||f.target,w=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";e.preventDefault!==!1&&(s.current||!w)&&f.preventDefault(),i(!0)}},h=f=>{const g=ste(f.code,a);nte(r,o.current,!0)?(i(!1),o.current.clear()):o.current.delete(f[g]),f.key==="Meta"&&o.current.clear(),s.current=!1},u=()=>{o.current.clear(),i(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",h),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",h),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[n,i]),t}function nte(n,e,t){return n.filter(i=>t||i.length===e.size).some(i=>i.every(s=>e.has(s)))}function ste(n,e){return e.includes(n)?"code":"key"}const YDe=()=>{const n=ds();return $.useMemo(()=>({zoomIn:e=>{const{panZoom:t}=n.getState();return t?t.scaleBy(1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:t}=n.getState();return t?t.scaleBy(1/1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomTo:(e,t)=>{const{panZoom:i}=n.getState();return i?i.scaleTo(e,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(e,t)=>{const{transform:[i,s,o],panZoom:r}=n.getState();return r?(await r.setViewport({x:e.x??i,y:e.y??s,zoom:e.zoom??o},t),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,t,i]=n.getState().transform;return{x:e,y:t,zoom:i}},setCenter:async(e,t,i)=>n.getState().setCenter(e,t,i),fitBounds:async(e,t)=>{const{width:i,height:s,minZoom:o,maxZoom:r,panZoom:a}=n.getState(),l=dG(e,i,s,o,r,(t==null?void 0:t.padding)??.1);return a?(await a.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,t={})=>{const{transform:i,snapGrid:s,snapToGrid:o,domNode:r}=n.getState();if(!r)return e;const{x:a,y:l}=r.getBoundingClientRect(),c={x:e.x-a,y:e.y-l},d=t.snapGrid??s,h=t.snapToGrid??o;return eD(c,i,h,d)},flowToScreenPosition:e=>{const{transform:t,domNode:i}=n.getState();if(!i)return e;const{x:s,y:o}=i.getBoundingClientRect(),r=jM(e,t);return{x:r.x+s,y:r.y+o}}}),[])};function dfe(n,e){const t=[],i=new Map,s=[];for(const o of n)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")i.set(o.id,[o]);else{const r=i.get(o.id);r?r.push(o):i.set(o.id,[o])}for(const o of e){const r=i.get(o.id);if(!r){t.push(o);continue}if(r[0].type==="remove")continue;if(r[0].type==="replace"){t.push({...r[0].item});continue}const a={...o};for(const l of r)ZDe(l,a);t.push(a)}return s.length&&s.forEach(o=>{o.index!==void 0?t.splice(o.index,0,{...o.item}):t.push({...o.item})}),t}function ZDe(n,e){switch(n.type){case"select":{e.selected=n.selected;break}case"position":{typeof n.position<"u"&&(e.position=n.position),typeof n.dragging<"u"&&(e.dragging=n.dragging);break}case"dimensions":{typeof n.dimensions<"u"&&(e.measured={...n.dimensions},n.setAttributes&&((n.setAttributes===!0||n.setAttributes==="width")&&(e.width=n.dimensions.width),(n.setAttributes===!0||n.setAttributes==="height")&&(e.height=n.dimensions.height))),typeof n.resizing=="boolean"&&(e.resizing=n.resizing);break}}}function hfe(n,e){return dfe(n,e)}function ufe(n,e){return dfe(n,e)}function lb(n,e){return{id:n,type:"select",selected:e}}function n0(n,e=new Set,t=!1){const i=[];for(const[s,o]of n){const r=e.has(s);!(o.selected===void 0&&!r)&&o.selected!==r&&(t&&(o.selected=r),i.push(lb(o.id,r)))}return i}function ote({items:n=[],lookup:e}){var s;const t=[],i=new Map(n.map(o=>[o.id,o]));for(const[o,r]of n.entries()){const a=e.get(r.id),l=((s=a==null?void 0:a.internals)==null?void 0:s.userNode)??a;l!==void 0&&l!==r&&t.push({id:r.id,item:r,type:"replace"}),l===void 0&&t.push({item:r,type:"add",index:o})}for(const[o]of e)i.get(o)===void 0&&t.push({id:o,type:"remove"});return t}function rte(n){return{id:n.id,type:"remove"}}const ate=n=>rNe(n),XDe=n=>Due(n);function ffe(n){return $.forwardRef(n)}const QDe=typeof window<"u"?$.useLayoutEffect:$.useEffect;function lte(n){const[e,t]=$.useState(BigInt(0)),[i]=$.useState(()=>JDe(()=>t(s=>s+BigInt(1))));return QDe(()=>{const s=i.get();s.length&&(n(s),i.reset())},[e]),i}function JDe(n){let e=[];return{get:()=>e,reset:()=>{e=[]},push:t=>{e.push(t),n()}}}const gfe=$.createContext(null);function eTe({children:n}){const e=ds(),t=$.useCallback(a=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:d,onNodesChange:h,nodeLookup:u,fitViewQueued:f,onNodesChangeMiddlewareMap:g}=e.getState();let p=l;for(const b of a)p=typeof b=="function"?b(p):b;let m=ote({items:p,lookup:u});for(const b of g.values())m=b(m);d&&c(p),m.length>0?h==null||h(m):f&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:v,setNodes:w}=e.getState();b&&w(v)})},[]),i=lte(t),s=$.useCallback(a=>{const{edges:l=[],setEdges:c,hasDefaultEdges:d,onEdgesChange:h,edgeLookup:u}=e.getState();let f=l;for(const g of a)f=typeof g=="function"?g(f):g;d?c(f):h&&h(ote({items:f,lookup:u}))},[]),o=lte(s),r=$.useMemo(()=>({nodeQueue:i,edgeQueue:o}),[]);return y.jsx(gfe.Provider,{value:r,children:n})}function tTe(){const n=$.useContext(gfe);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const iTe=n=>!!n.panZoom;function _G(){const n=YDe(),e=ds(),t=tTe(),i=Mi(iTe),s=$.useMemo(()=>{const o=h=>e.getState().nodeLookup.get(h),r=h=>{t.nodeQueue.push(h)},a=h=>{t.edgeQueue.push(h)},l=h=>{var b,v;const{nodeLookup:u,nodeOrigin:f}=e.getState(),g=ate(h)?h:u.get(h.id),p=g.parentId?Oue(g.position,g.measured,g.parentId,u,f):g.position,m={...g,position:p,width:((b=g.measured)==null?void 0:b.width)??g.width,height:((v=g.measured)==null?void 0:v.height)??g.height};return Jy(m)},c=(h,u,f={replace:!1})=>{r(g=>g.map(p=>{if(p.id===h){const m=typeof u=="function"?u(p):u;return f.replace&&ate(m)?m:{...p,...m}}return p}))},d=(h,u,f={replace:!1})=>{a(g=>g.map(p=>{if(p.id===h){const m=typeof u=="function"?u(p):u;return f.replace&&XDe(m)?m:{...p,...m}}return p}))};return{getNodes:()=>e.getState().nodes.map(h=>({...h})),getNode:h=>{var u;return(u=o(h))==null?void 0:u.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:h=[]}=e.getState();return h.map(u=>({...u}))},getEdge:h=>e.getState().edgeLookup.get(h),setNodes:r,setEdges:a,addNodes:h=>{const u=Array.isArray(h)?h:[h];t.nodeQueue.push(f=>[...f,...u])},addEdges:h=>{const u=Array.isArray(h)?h:[h];t.edgeQueue.push(f=>[...f,...u])},toObject:()=>{const{nodes:h=[],edges:u=[],transform:f}=e.getState(),[g,p,m]=f;return{nodes:h.map(b=>({...b})),edges:u.map(b=>({...b})),viewport:{x:g,y:p,zoom:m}}},deleteElements:async({nodes:h=[],edges:u=[]})=>{const{nodes:f,edges:g,onNodesDelete:p,onEdgesDelete:m,triggerNodeChanges:b,triggerEdgeChanges:v,onDelete:w,onBeforeDelete:C}=e.getState(),{nodes:S,edges:L}=await hNe({nodesToRemove:h,edgesToRemove:u,nodes:f,edges:g,onBeforeDelete:C}),x=L.length>0,E=S.length>0;if(x){const I=L.map(rte);m==null||m(L),v(I)}if(E){const I=S.map(rte);p==null||p(S),b(I)}return(E||x)&&(w==null||w({nodes:S,edges:L})),{deletedNodes:S,deletedEdges:L}},getIntersectingNodes:(h,u=!0,f)=>{const g=Fee(h),p=g?h:l(h),m=f!==void 0;return p?(f||e.getState().nodes).filter(b=>{const v=e.getState().nodeLookup.get(b.id);if(v&&!g&&(b.id===h.id||!v.internals.positionAbsolute))return!1;const w=Jy(m?b:v),C=qE(w,p);return u&&C>0||C>=w.width*w.height||C>=p.width*p.height}):[]},isNodeIntersecting:(h,u,f=!0)=>{const p=Fee(h)?h:l(h);if(!p)return!1;const m=qE(p,u);return f&&m>0||m>=u.width*u.height||m>=p.width*p.height},updateNode:c,updateNodeData:(h,u,f={replace:!1})=>{c(h,g=>{const p=typeof u=="function"?u(g):u;return f.replace?{...g,data:p}:{...g,data:{...g.data,...p}}},f)},updateEdge:d,updateEdgeData:(h,u,f={replace:!1})=>{d(h,g=>{const p=typeof u=="function"?u(g):u;return f.replace?{...g,data:p}:{...g,data:{...g.data,...p}}},f)},getNodesBounds:h=>{const{nodeLookup:u,nodeOrigin:f}=e.getState();return aNe(h,{nodeLookup:u,nodeOrigin:f})},getHandleConnections:({type:h,id:u,nodeId:f})=>{var g;return Array.from(((g=e.getState().connectionLookup.get(`${f}-${h}${u?`-${u}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:h,handleId:u,nodeId:f})=>{var g;return Array.from(((g=e.getState().connectionLookup.get(`${f}${h?u?`-${h}-${u}`:`-${h}`:""}`))==null?void 0:g.values())??[])},fitView:async h=>{const u=e.getState().fitViewResolver??pNe();return e.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:u}),t.nodeQueue.push(f=>[...f]),u.promise}}},[]);return $.useMemo(()=>({...s,...n,viewportInitialized:i}),[i])}const cte=n=>n.selected,nTe=typeof window<"u"?window:void 0;function sTe({deleteKeyCode:n,multiSelectionKeyCode:e}){const t=ds(),{deleteElements:i}=_G(),s=GE(n,{actInsideInputWithModifier:!1}),o=GE(e,{target:nTe});$.useEffect(()=>{if(s){const{edges:r,nodes:a}=t.getState();i({nodes:a.filter(cte),edges:r.filter(cte)}),t.setState({nodesSelectionActive:!1})}},[s]),$.useEffect(()=>{t.setState({multiSelectionActive:o})},[o])}function oTe(n){const e=ds();$.useEffect(()=>{const t=()=>{var s,o,r,a;if(!n.current||!(((o=(s=n.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const i=hG(n.current);(i.height===0||i.width===0)&&((a=(r=e.getState()).onError)==null||a.call(r,"004",_u.error004())),e.setState({width:i.width||500,height:i.height||500})};if(n.current){t(),window.addEventListener("resize",t);const i=new ResizeObserver(()=>t());return i.observe(n.current),()=>{window.removeEventListener("resize",t),i&&n.current&&i.unobserve(n.current)}}},[])}const k5={position:"absolute",width:"100%",height:"100%",top:0,left:0},rTe=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function aTe({onPaneContextMenu:n,zoomOnScroll:e=!0,zoomOnPinch:t=!0,panOnScroll:i=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=xv.Free,zoomOnDoubleClick:r=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:c,minZoom:d,maxZoom:h,zoomActivationKeyCode:u,preventScrolling:f=!0,children:g,noWheelClassName:p,noPanClassName:m,onViewportChange:b,isControlledViewport:v,paneClickDistance:w,selectionOnDrag:C}){const S=ds(),L=$.useRef(null),{userSelectionActive:x,lib:E,connectionInProgress:I}=Mi(rTe,as),R=GE(u),M=$.useRef();oTe(L);const A=$.useCallback(W=>{b==null||b({x:W[0],y:W[1],zoom:W[2]}),v||S.setState({transform:W})},[b,v]);return $.useEffect(()=>{if(L.current){M.current=QNe({domNode:L.current,minZoom:d,maxZoom:h,translateExtent:c,viewport:l,onDraggingChange:V=>S.setState(K=>K.paneDragging===V?K:{paneDragging:V}),onPanZoomStart:(V,K)=>{const{onViewportChangeStart:z,onMoveStart:j}=S.getState();j==null||j(V,K),z==null||z(K)},onPanZoom:(V,K)=>{const{onViewportChange:z,onMove:j}=S.getState();j==null||j(V,K),z==null||z(K)},onPanZoomEnd:(V,K)=>{const{onViewportChangeEnd:z,onMoveEnd:j}=S.getState();j==null||j(V,K),z==null||z(K)}});const{x:W,y:P,zoom:B}=M.current.getViewport();return S.setState({panZoom:M.current,transform:[W,P,B],domNode:L.current.closest(".react-flow")}),()=>{var V;(V=M.current)==null||V.destroy()}}},[]),$.useEffect(()=>{var W;(W=M.current)==null||W.update({onPaneContextMenu:n,zoomOnScroll:e,zoomOnPinch:t,panOnScroll:i,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:r,panOnDrag:a,zoomActivationKeyPressed:R,preventScrolling:f,noPanClassName:m,userSelectionActive:x,noWheelClassName:p,lib:E,onTransformChange:A,connectionInProgress:I,selectionOnDrag:C,paneClickDistance:w})},[n,e,t,i,s,o,r,a,R,f,m,x,p,E,A,I,C,w]),y.jsx("div",{className:"react-flow__renderer",ref:L,style:k5,children:g})}const lTe=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function cTe(){const{userSelectionActive:n,userSelectionRect:e}=Mi(lTe,as);return n&&e?y.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const n7=(n,e)=>t=>{t.target===e.current&&(n==null||n(t))},dTe=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function hTe({isSelecting:n,selectionKeyPressed:e,selectionMode:t=UE.Full,panOnDrag:i,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:r,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:h,onPaneMouseMove:u,onPaneMouseLeave:f,children:g}){const p=ds(),{userSelectionActive:m,elementsSelectable:b,dragging:v,connectionInProgress:w}=Mi(dTe,as),C=b&&(n||m),S=$.useRef(null),L=$.useRef(),x=$.useRef(new Set),E=$.useRef(new Set),I=$.useRef(!1),R=z=>{if(I.current||w){I.current=!1;return}l==null||l(z),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},M=z=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){z.preventDefault();return}c==null||c(z)},A=d?z=>d(z):void 0,W=z=>{I.current&&(z.stopPropagation(),I.current=!1)},P=z=>{var xe,je;const{domNode:j}=p.getState();if(L.current=j==null?void 0:j.getBoundingClientRect(),!L.current)return;const Q=z.target===S.current;if(!Q&&!!z.target.closest(".nokey")||!n||!(o&&Q||e)||z.button!==0||!z.isPrimary)return;(je=(xe=z.target)==null?void 0:xe.setPointerCapture)==null||je.call(xe,z.pointerId),I.current=!1;const{x:ce,y:Ce}=Fd(z.nativeEvent,L.current);p.setState({userSelectionRect:{width:0,height:0,startX:ce,startY:Ce,x:ce,y:Ce}}),Q||(z.stopPropagation(),z.preventDefault())},B=z=>{const{userSelectionRect:j,transform:Q,nodeLookup:Y,edgeLookup:te,connectionLookup:ce,triggerNodeChanges:Ce,triggerEdgeChanges:xe,defaultEdgeOptions:je,resetSelectedElements:ke}=p.getState();if(!L.current||!j)return;const{x:Le,y:Ve}=Fd(z.nativeEvent,L.current),{startX:ct,startY:dt}=j;if(!I.current){const Vt=e?0:s;if(Math.hypot(Le-ct,Ve-dt)<=Vt)return;ke(),r==null||r(z)}I.current=!0;const Be={startX:ct,startY:dt,x:Le Vt.id)),E.current=new Set;const Si=(je==null?void 0:je.selectable)??!0;for(const Vt of x.current){const In=ce.get(Vt);if(In)for(const{edgeId:Nn}of In.values()){const Os=te.get(Nn);Os&&(Os.selectable??Si)&&E.current.add(Nn)}}if(!Bee(tt,x.current)){const Vt=n0(Y,x.current,!0);Ce(Vt)}if(!Bee(Tt,E.current)){const Vt=n0(te,E.current);xe(Vt)}p.setState({userSelectionRect:Be,userSelectionActive:!0,nodesSelectionActive:!1})},V=z=>{var j,Q;z.button===0&&((Q=(j=z.target)==null?void 0:j.releasePointerCapture)==null||Q.call(j,z.pointerId),!m&&z.target===S.current&&p.getState().userSelectionRect&&(R==null||R(z)),p.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(a==null||a(z),p.setState({nodesSelectionActive:x.current.size>0})))},K=i===!0||Array.isArray(i)&&i.includes(0);return y.jsxs("div",{className:uo(["react-flow__pane",{draggable:K,dragging:v,selection:n}]),onClick:C?void 0:n7(R,S),onContextMenu:n7(M,S),onWheel:n7(A,S),onPointerEnter:C?void 0:h,onPointerMove:C?B:u,onPointerUp:C?V:void 0,onPointerDownCapture:C?P:void 0,onClickCapture:C?W:void 0,onPointerLeave:f,ref:S,style:k5,children:[g,y.jsx(cTe,{})]})}function qB({id:n,store:e,unselect:t=!1,nodeRef:i}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:r,nodeLookup:a,onError:l}=e.getState(),c=a.get(n);if(!c){l==null||l("012",_u.error012(n));return}e.setState({nodesSelectionActive:!1}),c.selected?(t||c.selected&&r)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):s([n])}function pfe({nodeRef:n,disabled:e=!1,noDragClassName:t,handleSelector:i,nodeId:s,isSelectable:o,nodeClickDistance:r}){const a=ds(),[l,c]=$.useState(!1),d=$.useRef();return $.useEffect(()=>{d.current=BNe({getStoreItems:()=>a.getState(),onNodeMouseDown:h=>{qB({id:h,store:a,nodeRef:n})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),$.useEffect(()=>{if(!(e||!n.current||!d.current))return d.current.update({noDragClassName:t,handleSelector:i,domNode:n.current,isSelectable:o,nodeId:s,nodeClickDistance:r}),()=>{var h;(h=d.current)==null||h.destroy()}},[t,i,e,o,n,s,r]),l}const uTe=n=>e=>e.selected&&(e.draggable||n&&typeof e.draggable>"u");function mfe(){const n=ds();return $.useCallback(t=>{const{nodeExtent:i,snapToGrid:s,snapGrid:o,nodesDraggable:r,onError:a,updateNodePositions:l,nodeLookup:c,nodeOrigin:d}=n.getState(),h=new Map,u=uTe(r),f=s?o[0]:5,g=s?o[1]:5,p=t.direction.x*f*t.factor,m=t.direction.y*g*t.factor;for(const[,b]of c){if(!u(b))continue;let v={x:b.internals.positionAbsolute.x+p,y:b.internals.positionAbsolute.y+m};s&&(v=JN(v,o));const{position:w,positionAbsolute:C}=Tue({nodeId:b.id,nextPosition:v,nodeLookup:c,nodeExtent:i,nodeOrigin:d,onError:a});b.position=w,b.internals.positionAbsolute=C,h.set(b.id,b)}l(h)},[])}const bG=$.createContext(null),fTe=bG.Provider;bG.Consumer;const _fe=()=>$.useContext(bG),gTe=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),pTe=(n,e,t)=>i=>{const{connectionClickStartHandle:s,connectionMode:o,connection:r}=i,{fromHandle:a,toHandle:l,isValid:c}=r,d=(l==null?void 0:l.nodeId)===n&&(l==null?void 0:l.id)===e&&(l==null?void 0:l.type)===t;return{connectingFrom:(a==null?void 0:a.nodeId)===n&&(a==null?void 0:a.id)===e&&(a==null?void 0:a.type)===t,connectingTo:d,clickConnecting:(s==null?void 0:s.nodeId)===n&&(s==null?void 0:s.id)===e&&(s==null?void 0:s.type)===t,isPossibleEndHandle:o===Xy.Strict?(a==null?void 0:a.type)!==t:n!==(a==null?void 0:a.nodeId)||e!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!s,valid:d&&c}};function mTe({type:n="source",position:e=It.Top,isValidConnection:t,isConnectable:i=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:r,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:h,...u},f){var B,V;const g=r||null,p=n==="target",m=ds(),b=_fe(),{connectOnClick:v,noPanClassName:w,rfId:C}=Mi(gTe,as),{connectingFrom:S,connectingTo:L,clickConnecting:x,isPossibleEndHandle:E,connectionInProcess:I,clickConnectionInProcess:R,valid:M}=Mi(pTe(b,g,n),as);b||(V=(B=m.getState()).onError)==null||V.call(B,"010",_u.error010());const A=K=>{const{defaultEdgeOptions:z,onConnect:j,hasDefaultEdges:Q}=m.getState(),Y={...z,...K};if(Q){const{edges:te,setEdges:ce}=m.getState();ce(yNe(Y,te))}j==null||j(Y),a==null||a(Y)},W=K=>{if(!b)return;const z=Wue(K.nativeEvent);if(s&&(z&&K.button===0||!z)){const j=m.getState();UB.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:p,handleId:g,nodeId:b,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...Q)=>{var Y,te;return(te=(Y=m.getState()).onConnectEnd)==null?void 0:te.call(Y,...Q)},updateConnection:j.updateConnection,onConnect:A,isValidConnection:t||((...Q)=>{var Y,te;return((te=(Y=m.getState()).isValidConnection)==null?void 0:te.call(Y,...Q))??!0}),getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}z?d==null||d(K):h==null||h(K)},P=K=>{const{onClickConnectStart:z,onClickConnectEnd:j,connectionClickStartHandle:Q,connectionMode:Y,isValidConnection:te,lib:ce,rfId:Ce,nodeLookup:xe,connection:je}=m.getState();if(!b||!Q&&!s)return;if(!Q){z==null||z(K.nativeEvent,{nodeId:b,handleId:g,handleType:n}),m.setState({connectionClickStartHandle:{nodeId:b,type:n,id:g}});return}const ke=Fue(K.target),Le=t||te,{connection:Ve,isValid:ct}=UB.isValid(K.nativeEvent,{handle:{nodeId:b,id:g,type:n},connectionMode:Y,fromNodeId:Q.nodeId,fromHandleId:Q.id||null,fromType:Q.type,isValidConnection:Le,flowId:Ce,doc:ke,lib:ce,nodeLookup:xe});ct&&Ve&&A(Ve);const dt=structuredClone(je);delete dt.inProgress,dt.toPosition=dt.toHandle?dt.toHandle.position:null,j==null||j(K,dt),m.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":e,"data-id":`${C}-${b}-${g}-${n}`,className:uo(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",w,c,{source:!p,target:p,connectable:i,connectablestart:s,connectableend:o,clickconnecting:x,connectingfrom:S,connectingto:L,valid:M,connectionindicator:i&&(!I||E)&&(I||R?o:s)}]),onMouseDown:W,onTouchStart:W,onClick:v?P:void 0,ref:f,...u,children:l})}const nS=$.memo(ffe(mTe));function _Te({data:n,isConnectable:e,sourcePosition:t=It.Bottom}){return y.jsxs(y.Fragment,{children:[n==null?void 0:n.label,y.jsx(nS,{type:"source",position:t,isConnectable:e})]})}function bTe({data:n,isConnectable:e,targetPosition:t=It.Top,sourcePosition:i=It.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(nS,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label,y.jsx(nS,{type:"source",position:i,isConnectable:e})]})}function vTe(){return null}function wTe({data:n,isConnectable:e,targetPosition:t=It.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(nS,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label]})}const $M={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},dte={input:_Te,default:bTe,output:wTe,group:vTe};function CTe(n){var e,t,i,s;return n.internals.handleBounds===void 0?{width:n.width??n.initialWidth??((e=n.style)==null?void 0:e.width),height:n.height??n.initialHeight??((t=n.style)==null?void 0:t.height)}:{width:n.width??((i=n.style)==null?void 0:i.width),height:n.height??((s=n.style)==null?void 0:s.height)}}const yTe=n=>{const{width:e,height:t,x:i,y:s}=QN(n.nodeLookup,{filter:o=>!!o.selected});return{width:Od(e)?e:null,height:Od(t)?t:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${i}px,${s}px)`}};function STe({onSelectionContextMenu:n,noPanClassName:e,disableKeyboardA11y:t}){const i=ds(),{width:s,height:o,transformString:r,userSelectionActive:a}=Mi(yTe,as),l=mfe(),c=$.useRef(null);$.useEffect(()=>{var f;t||(f=c.current)==null||f.focus({preventScroll:!0})},[t]);const d=!a&&s!==null&&o!==null;if(pfe({nodeRef:c,disabled:!d}),!d)return null;const h=n?f=>{const g=i.getState().nodes.filter(p=>p.selected);n(f,g)}:void 0,u=f=>{Object.prototype.hasOwnProperty.call($M,f.key)&&(f.preventDefault(),l({direction:$M[f.key],factor:f.shiftKey?4:1}))};return y.jsx("div",{className:uo(["react-flow__nodesselection","react-flow__container",e]),style:{transform:r},children:y.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:t?void 0:-1,onKeyDown:t?void 0:u,style:{width:s,height:o}})})}const hte=typeof window<"u"?window:void 0,xTe=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function bfe({children:n,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:r,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:d,selectionMode:h,onSelectionStart:u,onSelectionEnd:f,multiSelectionKeyCode:g,panActivationKeyCode:p,zoomActivationKeyCode:m,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:w,panOnScroll:C,panOnScrollSpeed:S,panOnScrollMode:L,zoomOnDoubleClick:x,panOnDrag:E,defaultViewport:I,translateExtent:R,minZoom:M,maxZoom:A,preventScrolling:W,onSelectionContextMenu:P,noWheelClassName:B,noPanClassName:V,disableKeyboardA11y:K,onViewportChange:z,isControlledViewport:j}){const{nodesSelectionActive:Q,userSelectionActive:Y}=Mi(xTe,as),te=GE(c,{target:hte}),ce=GE(p,{target:hte}),Ce=ce||E,xe=ce||C,je=d&&Ce!==!0,ke=te||Y||je;return sTe({deleteKeyCode:l,multiSelectionKeyCode:g}),y.jsx(aTe,{onPaneContextMenu:o,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:w,panOnScroll:xe,panOnScrollSpeed:S,panOnScrollMode:L,zoomOnDoubleClick:x,panOnDrag:!te&&Ce,defaultViewport:I,translateExtent:R,minZoom:M,maxZoom:A,zoomActivationKeyCode:m,preventScrolling:W,noWheelClassName:B,noPanClassName:V,onViewportChange:z,isControlledViewport:j,paneClickDistance:a,selectionOnDrag:je,children:y.jsxs(hTe,{onSelectionStart:u,onSelectionEnd:f,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:r,panOnDrag:Ce,isSelecting:!!ke,selectionMode:h,selectionKeyPressed:te,paneClickDistance:a,selectionOnDrag:je,children:[n,Q&&y.jsx(STe,{onSelectionContextMenu:P,noPanClassName:V,disableKeyboardA11y:K})]})})}bfe.displayName="FlowRenderer";const LTe=$.memo(bfe),kTe=n=>e=>n?cG(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(t=>t.id):Array.from(e.nodeLookup.keys());function ETe(n){return Mi($.useCallback(kTe(n),[n]),as)}const ITe=n=>n.updateNodeInternals;function NTe(){const n=Mi(ITe),[e]=$.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const i=new Map;t.forEach(s=>{const o=s.target.getAttribute("data-id");i.set(o,{id:o,nodeElement:s.target,force:!0})}),n(i)}));return $.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function DTe({node:n,nodeType:e,hasDimensions:t,resizeObserver:i}){const s=ds(),o=$.useRef(null),r=$.useRef(null),a=$.useRef(n.sourcePosition),l=$.useRef(n.targetPosition),c=$.useRef(e),d=t&&!!n.internals.handleBounds;return $.useEffect(()=>{o.current&&!n.hidden&&(!d||r.current!==o.current)&&(r.current&&(i==null||i.unobserve(r.current)),i==null||i.observe(o.current),r.current=o.current)},[d,n.hidden]),$.useEffect(()=>()=>{r.current&&(i==null||i.unobserve(r.current),r.current=null)},[]),$.useEffect(()=>{if(o.current){const h=c.current!==e,u=a.current!==n.sourcePosition,f=l.current!==n.targetPosition;(h||u||f)&&(c.current=e,a.current=n.sourcePosition,l.current=n.targetPosition,s.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:o.current,force:!0}]])))}},[n.id,e,n.sourcePosition,n.targetPosition]),o}function TTe({id:n,onClick:e,onMouseEnter:t,onMouseMove:i,onMouseLeave:s,onContextMenu:o,onDoubleClick:r,nodesDraggable:a,elementsSelectable:l,nodesConnectable:c,nodesFocusable:d,resizeObserver:h,noDragClassName:u,noPanClassName:f,disableKeyboardA11y:g,rfId:p,nodeTypes:m,nodeClickDistance:b,onError:v}){const{node:w,internals:C,isParent:S}=Mi(Le=>{const Ve=Le.nodeLookup.get(n),ct=Le.parentLookup.has(n);return{node:Ve,internals:Ve.internals,isParent:ct}},as);let L=w.type||"default",x=(m==null?void 0:m[L])||dte[L];x===void 0&&(v==null||v("003",_u.error003(L)),L="default",x=(m==null?void 0:m.default)||dte.default);const E=!!(w.draggable||a&&typeof w.draggable>"u"),I=!!(w.selectable||l&&typeof w.selectable>"u"),R=!!(w.connectable||c&&typeof w.connectable>"u"),M=!!(w.focusable||d&&typeof w.focusable>"u"),A=ds(),W=Pue(w),P=DTe({node:w,nodeType:L,hasDimensions:W,resizeObserver:h}),B=pfe({nodeRef:P,disabled:w.hidden||!E,noDragClassName:u,handleSelector:w.dragHandle,nodeId:n,isSelectable:I,nodeClickDistance:b}),V=mfe();if(w.hidden)return null;const K=Wg(w),z=CTe(w),j=I||E||e||t||i||s,Q=t?Le=>t(Le,{...C.userNode}):void 0,Y=i?Le=>i(Le,{...C.userNode}):void 0,te=s?Le=>s(Le,{...C.userNode}):void 0,ce=o?Le=>o(Le,{...C.userNode}):void 0,Ce=r?Le=>r(Le,{...C.userNode}):void 0,xe=Le=>{const{selectNodesOnDrag:Ve,nodeDragThreshold:ct}=A.getState();I&&(!Ve||!E||ct>0)&&qB({id:n,store:A,nodeRef:P}),e&&e(Le,{...C.userNode})},je=Le=>{if(!(Bue(Le.nativeEvent)||g)){if(kue.includes(Le.key)&&I){const Ve=Le.key==="Escape";qB({id:n,store:A,unselect:Ve,nodeRef:P})}else if(E&&w.selected&&Object.prototype.hasOwnProperty.call($M,Le.key)){Le.preventDefault();const{ariaLabelConfig:Ve}=A.getState();A.setState({ariaLiveMessage:Ve["node.a11yDescription.ariaLiveMessage"]({direction:Le.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:$M[Le.key],factor:Le.shiftKey?4:1})}}},ke=()=>{var Tt;if(g||!((Tt=P.current)!=null&&Tt.matches(":focus-visible")))return;const{transform:Le,width:Ve,height:ct,autoPanOnNodeFocus:dt,setCenter:Be}=A.getState();if(!dt)return;cG(new Map([[n,w]]),{x:0,y:0,width:Ve,height:ct},Le,!0).length>0||Be(w.position.x+K.width/2,w.position.y+K.height/2,{zoom:Le[2]})};return y.jsx("div",{className:uo(["react-flow__node",`react-flow__node-${L}`,{[f]:E},w.className,{selected:w.selected,selectable:I,parent:S,draggable:E,dragging:B}]),ref:P,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:W?"visible":"hidden",...w.style,...z},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:Q,onMouseMove:Y,onMouseLeave:te,onContextMenu:ce,onClick:xe,onDoubleClick:Ce,onKeyDown:M?je:void 0,tabIndex:M?0:void 0,onFocus:M?ke:void 0,role:w.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${afe}-${p}`,"aria-label":w.ariaLabel,...w.domAttributes,children:y.jsx(fTe,{value:n,children:y.jsx(x,{id:n,data:w.data,type:L,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:w.selected??!1,selectable:I,draggable:E,deletable:w.deletable??!0,isConnectable:R,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:B,dragHandle:w.dragHandle,zIndex:C.z,parentId:w.parentId,...K})})})}var RTe=$.memo(TTe);const MTe=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function vfe(n){const{nodesDraggable:e,nodesConnectable:t,nodesFocusable:i,elementsSelectable:s,onError:o}=Mi(MTe,as),r=ETe(n.onlyRenderVisibleElements),a=NTe();return y.jsx("div",{className:"react-flow__nodes",style:k5,children:r.map(l=>y.jsx(RTe,{id:l,nodeTypes:n.nodeTypes,nodeExtent:n.nodeExtent,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:a,nodesDraggable:e,nodesConnectable:t,nodesFocusable:i,elementsSelectable:s,nodeClickDistance:n.nodeClickDistance,onError:o},l))})}vfe.displayName="NodeRenderer";const ATe=$.memo(vfe);function PTe(n){return Mi($.useCallback(t=>{if(!n)return t.edges.map(s=>s.id);const i=[];if(t.width&&t.height)for(const s of t.edges){const o=t.nodeLookup.get(s.source),r=t.nodeLookup.get(s.target);o&&r&&vNe({sourceNode:o,targetNode:r,width:t.width,height:t.height,transform:t.transform})&&i.push(s.id)}return i},[n]),as)}const OTe=({color:n="none",strokeWidth:e=1})=>{const t={strokeWidth:e,...n&&{stroke:n}};return y.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},FTe=({color:n="none",strokeWidth:e=1})=>{const t={strokeWidth:e,...n&&{stroke:n,fill:n}};return y.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ute={[U1.Arrow]:OTe,[U1.ArrowClosed]:FTe};function BTe(n){const e=ds();return $.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(ute,n)?ute[n]:((o=(s=e.getState()).onError)==null||o.call(s,"009",_u.error009(n)),null)},[n])}const WTe=({id:n,type:e,color:t,width:i=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:r,orient:a="auto-start-reverse"})=>{const l=BTe(e);return l?y.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${i}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:y.jsx(l,{color:t,strokeWidth:r})}):null},wfe=({defaultColor:n,rfId:e})=>{const t=Mi(o=>o.edges),i=Mi(o=>o.defaultEdgeOptions),s=$.useMemo(()=>ENe(t,{id:e,defaultColor:n,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[t,i,e,n]);return s.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:s.map(o=>y.jsx(WTe,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};wfe.displayName="MarkerDefinitions";var HTe=$.memo(wfe);function Cfe({x:n,y:e,label:t,labelStyle:i,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:r=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d}){const[h,u]=$.useState({x:1,y:0,width:0,height:0}),f=uo(["react-flow__edge-textwrapper",c]),g=$.useRef(null);return $.useEffect(()=>{if(g.current){const p=g.current.getBBox();u({x:p.x,y:p.y,width:p.width,height:p.height})}},[t]),t?y.jsxs("g",{transform:`translate(${n-h.width/2} ${e-h.height/2})`,className:f,visibility:h.width?"visible":"hidden",...d,children:[s&&y.jsx("rect",{width:h.width+2*r[0],x:-r[0],y:-r[1],height:h.height+2*r[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),y.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:g,style:i,children:t}),l]}):null}Cfe.displayName="EdgeText";const VTe=$.memo(Cfe);function E5({path:n,labelX:e,labelY:t,label:i,labelStyle:s,labelShowBg:o,labelBgStyle:r,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:c=20,...d}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...d,d:n,fill:"none",className:uo(["react-flow__edge-path",d.className])}),c?y.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,i&&Od(e)&&Od(t)?y.jsx(VTe,{x:e,y:t,label:i,labelStyle:s,labelShowBg:o,labelBgStyle:r,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function fte({pos:n,x1:e,y1:t,x2:i,y2:s}){return n===It.Left||n===It.Right?[.5*(e+i),t]:[e,.5*(t+s)]}function yfe({sourceX:n,sourceY:e,sourcePosition:t=It.Bottom,targetX:i,targetY:s,targetPosition:o=It.Top}){const[r,a]=fte({pos:t,x1:n,y1:e,x2:i,y2:s}),[l,c]=fte({pos:o,x1:i,y1:s,x2:n,y2:e}),[d,h,u,f]=Hue({sourceX:n,sourceY:e,targetX:i,targetY:s,sourceControlX:r,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${n},${e} C${r},${a} ${l},${c} ${i},${s}`,d,h,u,f]}function Sfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,sourcePosition:r,targetPosition:a,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:b})=>{const[v,w,C]=yfe({sourceX:t,sourceY:i,sourcePosition:r,targetX:s,targetY:o,targetPosition:a}),S=n.isInternal?void 0:e;return y.jsx(E5,{id:S,path:v,labelX:w,labelY:C,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:b})})}const zTe=Sfe({isInternal:!1}),xfe=Sfe({isInternal:!0});zTe.displayName="SimpleBezierEdge";xfe.displayName="SimpleBezierEdgeInternal";function Lfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,sourcePosition:f=It.Bottom,targetPosition:g=It.Top,markerEnd:p,markerStart:m,pathOptions:b,interactionWidth:v})=>{const[w,C,S]=zB({sourceX:t,sourceY:i,sourcePosition:f,targetX:s,targetY:o,targetPosition:g,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),L=n.isInternal?void 0:e;return y.jsx(E5,{id:L,path:w,labelX:C,labelY:S,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:p,markerStart:m,interactionWidth:v})})}const kfe=Lfe({isInternal:!1}),Efe=Lfe({isInternal:!0});kfe.displayName="SmoothStepEdge";Efe.displayName="SmoothStepEdgeInternal";function Ife(n){return $.memo(({id:e,...t})=>{var s;const i=n.isInternal?void 0:e;return y.jsx(kfe,{...t,id:i,pathOptions:$.useMemo(()=>{var o;return{borderRadius:0,offset:(o=t.pathOptions)==null?void 0:o.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const jTe=Ife({isInternal:!1}),Nfe=Ife({isInternal:!0});jTe.displayName="StepEdge";Nfe.displayName="StepEdgeInternal";function Dfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:f,markerStart:g,interactionWidth:p})=>{const[m,b,v]=jue({sourceX:t,sourceY:i,targetX:s,targetY:o}),w=n.isInternal?void 0:e;return y.jsx(E5,{id:w,path:m,labelX:b,labelY:v,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:f,markerStart:g,interactionWidth:p})})}const $Te=Dfe({isInternal:!1}),Tfe=Dfe({isInternal:!0});$Te.displayName="StraightEdge";Tfe.displayName="StraightEdgeInternal";function Rfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,sourcePosition:r=It.Bottom,targetPosition:a=It.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,pathOptions:b,interactionWidth:v})=>{const[w,C,S]=Vue({sourceX:t,sourceY:i,sourcePosition:r,targetX:s,targetY:o,targetPosition:a,curvature:b==null?void 0:b.curvature}),L=n.isInternal?void 0:e;return y.jsx(E5,{id:L,path:w,labelX:C,labelY:S,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:v})})}const UTe=Rfe({isInternal:!1}),Mfe=Rfe({isInternal:!0});UTe.displayName="BezierEdge";Mfe.displayName="BezierEdgeInternal";const gte={default:Mfe,straight:Tfe,step:Nfe,smoothstep:Efe,simplebezier:xfe},pte={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},qTe=(n,e,t)=>t===It.Left?n-e:t===It.Right?n+e:n,KTe=(n,e,t)=>t===It.Top?n-e:t===It.Bottom?n+e:n,mte="react-flow__edgeupdater";function _te({position:n,centerX:e,centerY:t,radius:i=10,onMouseDown:s,onMouseEnter:o,onMouseOut:r,type:a}){return y.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:r,className:uo([mte,`${mte}-${a}`]),cx:qTe(e,i,n),cy:KTe(t,i,n),r:i,stroke:"transparent",fill:"transparent"})}function GTe({isReconnectable:n,reconnectRadius:e,edge:t,sourceX:i,sourceY:s,targetX:o,targetY:r,sourcePosition:a,targetPosition:l,onReconnect:c,onReconnectStart:d,onReconnectEnd:h,setReconnecting:u,setUpdateHover:f}){const g=ds(),p=(C,S)=>{if(C.button!==0)return;const{autoPanOnConnect:L,domNode:x,connectionMode:E,connectionRadius:I,lib:R,onConnectStart:M,cancelConnection:A,nodeLookup:W,rfId:P,panBy:B,updateConnection:V}=g.getState(),K=S.type==="target",z=(Y,te)=>{u(!1),h==null||h(Y,t,S.type,te)},j=Y=>c==null?void 0:c(t,Y),Q=(Y,te)=>{u(!0),d==null||d(C,t,S.type),M==null||M(Y,te)};UB.onPointerDown(C.nativeEvent,{autoPanOnConnect:L,connectionMode:E,connectionRadius:I,domNode:x,handleId:S.id,nodeId:S.nodeId,nodeLookup:W,isTarget:K,edgeUpdaterType:S.type,lib:R,flowId:P,cancelConnection:A,panBy:B,isValidConnection:(...Y)=>{var te,ce;return((ce=(te=g.getState()).isValidConnection)==null?void 0:ce.call(te,...Y))??!0},onConnect:j,onConnectStart:Q,onConnectEnd:(...Y)=>{var te,ce;return(ce=(te=g.getState()).onConnectEnd)==null?void 0:ce.call(te,...Y)},onReconnectEnd:z,updateConnection:V,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},m=C=>p(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>p(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),v=()=>f(!0),w=()=>f(!1);return y.jsxs(y.Fragment,{children:[(n===!0||n==="source")&&y.jsx(_te,{position:a,centerX:i,centerY:s,radius:e,onMouseDown:m,onMouseEnter:v,onMouseOut:w,type:"source"}),(n===!0||n==="target")&&y.jsx(_te,{position:l,centerX:o,centerY:r,radius:e,onMouseDown:b,onMouseEnter:v,onMouseOut:w,type:"target"})]})}function YTe({id:n,edgesFocusable:e,edgesReconnectable:t,elementsSelectable:i,onClick:s,onDoubleClick:o,onContextMenu:r,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,reconnectRadius:d,onReconnect:h,onReconnectStart:u,onReconnectEnd:f,rfId:g,edgeTypes:p,noPanClassName:m,onError:b,disableKeyboardA11y:v}){let w=Mi(Be=>Be.edgeLookup.get(n));const C=Mi(Be=>Be.defaultEdgeOptions);w=C?{...C,...w}:w;let S=w.type||"default",L=(p==null?void 0:p[S])||gte[S];L===void 0&&(b==null||b("011",_u.error011(S)),S="default",L=(p==null?void 0:p.default)||gte.default);const x=!!(w.focusable||e&&typeof w.focusable>"u"),E=typeof h<"u"&&(w.reconnectable||t&&typeof w.reconnectable>"u"),I=!!(w.selectable||i&&typeof w.selectable>"u"),R=$.useRef(null),[M,A]=$.useState(!1),[W,P]=$.useState(!1),B=ds(),{zIndex:V,sourceX:K,sourceY:z,targetX:j,targetY:Q,sourcePosition:Y,targetPosition:te}=Mi($.useCallback(Be=>{const tt=Be.nodeLookup.get(w.source),Tt=Be.nodeLookup.get(w.target);if(!tt||!Tt)return{zIndex:w.zIndex,...pte};const Si=kNe({id:n,sourceNode:tt,targetNode:Tt,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:Be.connectionMode,onError:b});return{zIndex:bNe({selected:w.selected,zIndex:w.zIndex,sourceNode:tt,targetNode:Tt,elevateOnSelect:Be.elevateEdgesOnSelect,zIndexMode:Be.zIndexMode}),...Si||pte}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),as),ce=$.useMemo(()=>w.markerStart?`url('#${jB(w.markerStart,g)}')`:void 0,[w.markerStart,g]),Ce=$.useMemo(()=>w.markerEnd?`url('#${jB(w.markerEnd,g)}')`:void 0,[w.markerEnd,g]);if(w.hidden||K===null||z===null||j===null||Q===null)return null;const xe=Be=>{var Vt;const{addSelectedEdges:tt,unselectNodesAndEdges:Tt,multiSelectionActive:Si}=B.getState();I&&(B.setState({nodesSelectionActive:!1}),w.selected&&Si?(Tt({nodes:[],edges:[w]}),(Vt=R.current)==null||Vt.blur()):tt([n])),s&&s(Be,w)},je=o?Be=>{o(Be,{...w})}:void 0,ke=r?Be=>{r(Be,{...w})}:void 0,Le=a?Be=>{a(Be,{...w})}:void 0,Ve=l?Be=>{l(Be,{...w})}:void 0,ct=c?Be=>{c(Be,{...w})}:void 0,dt=Be=>{var tt;if(!v&&kue.includes(Be.key)&&I){const{unselectNodesAndEdges:Tt,addSelectedEdges:Si}=B.getState();Be.key==="Escape"?((tt=R.current)==null||tt.blur(),Tt({edges:[w]})):Si([n])}};return y.jsx("svg",{style:{zIndex:V},children:y.jsxs("g",{className:uo(["react-flow__edge",`react-flow__edge-${S}`,w.className,m,{selected:w.selected,animated:w.animated,inactive:!I&&!s,updating:M,selectable:I}]),onClick:xe,onDoubleClick:je,onContextMenu:ke,onMouseEnter:Le,onMouseMove:Ve,onMouseLeave:ct,onKeyDown:x?dt:void 0,tabIndex:x?0:void 0,role:w.ariaRole??(x?"group":"img"),"aria-roledescription":"edge","data-id":n,"data-testid":`rf__edge-${n}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":x?`${lfe}-${g}`:void 0,ref:R,...w.domAttributes,children:[!W&&y.jsx(L,{id:n,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:I,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:K,sourceY:z,targetX:j,targetY:Q,sourcePosition:Y,targetPosition:te,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:ce,markerEnd:Ce,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),E&&y.jsx(GTe,{edge:w,isReconnectable:E,reconnectRadius:d,onReconnect:h,onReconnectStart:u,onReconnectEnd:f,sourceX:K,sourceY:z,targetX:j,targetY:Q,sourcePosition:Y,targetPosition:te,setUpdateHover:A,setReconnecting:P})]})})}var ZTe=$.memo(YTe);const XTe=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Afe({defaultMarkerColor:n,onlyRenderVisibleElements:e,rfId:t,edgeTypes:i,noPanClassName:s,onReconnect:o,onEdgeContextMenu:r,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,reconnectRadius:h,onEdgeDoubleClick:u,onReconnectStart:f,onReconnectEnd:g,disableKeyboardA11y:p}){const{edgesFocusable:m,edgesReconnectable:b,elementsSelectable:v,onError:w}=Mi(XTe,as),C=PTe(e);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(HTe,{defaultColor:n,rfId:t}),C.map(S=>y.jsx(ZTe,{id:S,edgesFocusable:m,edgesReconnectable:b,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:r,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:d,reconnectRadius:h,onDoubleClick:u,onReconnectStart:f,onReconnectEnd:g,rfId:t,onError:w,edgeTypes:i,disableKeyboardA11y:p},S))]})}Afe.displayName="EdgeRenderer";const QTe=$.memo(Afe),JTe=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function e2e({children:n}){const e=Mi(JTe);return y.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:n})}function t2e(n){const e=_G(),t=$.useRef(!1);$.useEffect(()=>{!t.current&&e.viewportInitialized&&n&&(setTimeout(()=>n(e),1),t.current=!0)},[n,e.viewportInitialized])}const i2e=n=>{var e;return(e=n.panZoom)==null?void 0:e.syncViewport};function n2e(n){const e=Mi(i2e),t=ds();return $.useEffect(()=>{n&&(e==null||e(n),t.setState({transform:[n.x,n.y,n.zoom]}))},[n,e]),null}function s2e(n){return n.connection.inProgress?{...n.connection,to:eD(n.connection.to,n.transform)}:{...n.connection}}function o2e(n){return s2e}function r2e(n){const e=o2e();return Mi(e,as)}const a2e=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function l2e({containerStyle:n,style:e,type:t,component:i}){const{nodesConnectable:s,width:o,height:r,isValid:a,inProgress:l}=Mi(a2e,as);return!(o&&s&&l)?null:y.jsx("svg",{style:n,width:o,height:r,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:uo(["react-flow__connection",Nue(a)]),children:y.jsx(Pfe,{style:e,type:t,CustomComponent:i,isValid:a})})})}const Pfe=({style:n,type:e=Nf.Bezier,CustomComponent:t,isValid:i})=>{const{inProgress:s,from:o,fromNode:r,fromHandle:a,fromPosition:l,to:c,toNode:d,toHandle:h,toPosition:u,pointer:f}=r2e();if(!s)return;if(t)return y.jsx(t,{connectionLineType:e,connectionLineStyle:n,fromNode:r,fromHandle:a,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:u,connectionStatus:Nue(i),toNode:d,toHandle:h,pointer:f});let g="";const p={sourceX:o.x,sourceY:o.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:u};switch(e){case Nf.Bezier:[g]=Vue(p);break;case Nf.SimpleBezier:[g]=yfe(p);break;case Nf.Step:[g]=zB({...p,borderRadius:0});break;case Nf.SmoothStep:[g]=zB(p);break;default:[g]=jue(p)}return y.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:n})};Pfe.displayName="ConnectionLine";const c2e={};function bte(n=c2e){$.useRef(n),ds(),$.useEffect(()=>{},[n])}function d2e(){ds(),$.useRef(!1),$.useEffect(()=>{},[])}function Ofe({nodeTypes:n,edgeTypes:e,onInit:t,onNodeClick:i,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:r,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,onSelectionContextMenu:h,onSelectionStart:u,onSelectionEnd:f,connectionLineType:g,connectionLineStyle:p,connectionLineComponent:m,connectionLineContainerStyle:b,selectionKeyCode:v,selectionOnDrag:w,selectionMode:C,multiSelectionKeyCode:S,panActivationKeyCode:L,zoomActivationKeyCode:x,deleteKeyCode:E,onlyRenderVisibleElements:I,elementsSelectable:R,defaultViewport:M,translateExtent:A,minZoom:W,maxZoom:P,preventScrolling:B,defaultMarkerColor:V,zoomOnScroll:K,zoomOnPinch:z,panOnScroll:j,panOnScrollSpeed:Q,panOnScrollMode:Y,zoomOnDoubleClick:te,panOnDrag:ce,onPaneClick:Ce,onPaneMouseEnter:xe,onPaneMouseMove:je,onPaneMouseLeave:ke,onPaneScroll:Le,onPaneContextMenu:Ve,paneClickDistance:ct,nodeClickDistance:dt,onEdgeContextMenu:Be,onEdgeMouseEnter:tt,onEdgeMouseMove:Tt,onEdgeMouseLeave:Si,reconnectRadius:Vt,onReconnect:In,onReconnectStart:Nn,onReconnectEnd:Os,noDragClassName:Da,noWheelClassName:Mo,noPanClassName:_l,disableKeyboardA11y:Ta,nodeExtent:xr,rfId:go,viewport:ei,onViewportChange:gn}){return bte(n),bte(e),d2e(),t2e(t),n2e(ei),y.jsx(LTe,{onPaneClick:Ce,onPaneMouseEnter:xe,onPaneMouseMove:je,onPaneMouseLeave:ke,onPaneContextMenu:Ve,onPaneScroll:Le,paneClickDistance:ct,deleteKeyCode:E,selectionKeyCode:v,selectionOnDrag:w,selectionMode:C,onSelectionStart:u,onSelectionEnd:f,multiSelectionKeyCode:S,panActivationKeyCode:L,zoomActivationKeyCode:x,elementsSelectable:R,zoomOnScroll:K,zoomOnPinch:z,zoomOnDoubleClick:te,panOnScroll:j,panOnScrollSpeed:Q,panOnScrollMode:Y,panOnDrag:ce,defaultViewport:M,translateExtent:A,minZoom:W,maxZoom:P,onSelectionContextMenu:h,preventScrolling:B,noDragClassName:Da,noWheelClassName:Mo,noPanClassName:_l,disableKeyboardA11y:Ta,onViewportChange:gn,isControlledViewport:!!ei,children:y.jsxs(e2e,{children:[y.jsx(QTe,{edgeTypes:e,onEdgeClick:s,onEdgeDoubleClick:r,onReconnect:In,onReconnectStart:Nn,onReconnectEnd:Os,onlyRenderVisibleElements:I,onEdgeContextMenu:Be,onEdgeMouseEnter:tt,onEdgeMouseMove:Tt,onEdgeMouseLeave:Si,reconnectRadius:Vt,defaultMarkerColor:V,noPanClassName:_l,disableKeyboardA11y:Ta,rfId:go}),y.jsx(l2e,{style:p,type:g,component:m,containerStyle:b}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(ATe,{nodeTypes:n,onNodeClick:i,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,nodeClickDistance:dt,onlyRenderVisibleElements:I,noPanClassName:_l,noDragClassName:Da,disableKeyboardA11y:Ta,nodeExtent:xr,rfId:go}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}Ofe.displayName="GraphView";const h2e=$.memo(Ofe),vte=({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l=.5,maxZoom:c=2,nodeOrigin:d,nodeExtent:h,zIndexMode:u="basic"}={})=>{const f=new Map,g=new Map,p=new Map,m=new Map,b=i??e??[],v=t??n??[],w=d??[0,0],C=h??$E;que(p,m,b);const S=$B(v,f,g,{nodeOrigin:w,nodeExtent:C,zIndexMode:u});let L=[0,0,1];if(r&&s&&o){const x=QN(f,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:E,y:I,zoom:R}=dG(x,s,o,l,c,(a==null?void 0:a.padding)??.1);L=[E,I,R]}return{rfId:"1",width:s??0,height:o??0,transform:L,nodes:v,nodesInitialized:S,nodeLookup:f,parentLookup:g,edges:b,edgeLookup:m,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:$E,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Xy.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:w,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:r??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Iue},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:uNe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Eue,zIndexMode:u,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},u2e=({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:h,zIndexMode:u})=>DDe((f,g)=>{async function p(){const{nodeLookup:m,panZoom:b,fitViewOptions:v,fitViewResolver:w,width:C,height:S,minZoom:L,maxZoom:x}=g();b&&(await dNe({nodes:m,width:C,height:S,panZoom:b,minZoom:L,maxZoom:x},v),w==null||w.resolve(!0),f({fitViewResolver:null}))}return{...vte({nodes:n,edges:e,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:h,defaultNodes:t,defaultEdges:i,zIndexMode:u}),setNodes:m=>{const{nodeLookup:b,parentLookup:v,nodeOrigin:w,elevateNodesOnSelect:C,fitViewQueued:S,zIndexMode:L}=g(),x=$B(m,b,v,{nodeOrigin:w,nodeExtent:h,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:L});S&&x?(p(),f({nodes:m,nodesInitialized:x,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:m,nodesInitialized:x})},setEdges:m=>{const{connectionLookup:b,edgeLookup:v}=g();que(b,v,m),f({edges:m})},setDefaultNodesAndEdges:(m,b)=>{if(m){const{setNodes:v}=g();v(m),f({hasDefaultNodes:!0})}if(b){const{setEdges:v}=g();v(b),f({hasDefaultEdges:!0})}},updateNodeInternals:m=>{const{triggerNodeChanges:b,nodeLookup:v,parentLookup:w,domNode:C,nodeOrigin:S,nodeExtent:L,debug:x,fitViewQueued:E,zIndexMode:I}=g(),{changes:R,updatedInternals:M}=ANe(m,v,w,C,S,L,I);M&&(DNe(v,w,{nodeOrigin:S,nodeExtent:L,zIndexMode:I}),E?(p(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),(R==null?void 0:R.length)>0&&(x&&console.log("React Flow: trigger node changes",R),b==null||b(R)))},updateNodePositions:(m,b=!1)=>{const v=[];let w=[];const{nodeLookup:C,triggerNodeChanges:S,connection:L,updateConnection:x,onNodesChangeMiddlewareMap:E}=g();for(const[I,R]of m){const M=C.get(I),A=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(R!=null&&R.position)),W={id:I,type:"position",position:A?{x:Math.max(0,R.position.x),y:Math.max(0,R.position.y)}:R.position,dragging:b};if(M&&L.inProgress&&L.fromNode.id===M.id){const P=K1(M,L.fromHandle,It.Left,!0);x({...L,from:P})}A&&M.parentId&&v.push({id:I,parentId:M.parentId,rect:{...R.internals.positionAbsolute,width:R.measured.width??0,height:R.measured.height??0}}),w.push(W)}if(v.length>0){const{parentLookup:I,nodeOrigin:R}=g(),M=mG(v,C,I,R);w.push(...M)}for(const I of E.values())w=I(w);S(w)},triggerNodeChanges:m=>{const{onNodesChange:b,setNodes:v,nodes:w,hasDefaultNodes:C,debug:S}=g();if(m!=null&&m.length){if(C){const L=hfe(m,w);v(L)}S&&console.log("React Flow: trigger node changes",m),b==null||b(m)}},triggerEdgeChanges:m=>{const{onEdgesChange:b,setEdges:v,edges:w,hasDefaultEdges:C,debug:S}=g();if(m!=null&&m.length){if(C){const L=ufe(m,w);v(L)}S&&console.log("React Flow: trigger edge changes",m),b==null||b(m)}},addSelectedNodes:m=>{const{multiSelectionActive:b,edgeLookup:v,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:S}=g();if(b){const L=m.map(x=>lb(x,!0));C(L);return}C(n0(w,new Set([...m]),!0)),S(n0(v))},addSelectedEdges:m=>{const{multiSelectionActive:b,edgeLookup:v,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:S}=g();if(b){const L=m.map(x=>lb(x,!0));S(L);return}S(n0(v,new Set([...m]))),C(n0(w,new Set,!0))},unselectNodesAndEdges:({nodes:m,edges:b}={})=>{const{edges:v,nodes:w,nodeLookup:C,triggerNodeChanges:S,triggerEdgeChanges:L}=g(),x=m||w,E=b||v,I=[];for(const M of x){if(!M.selected)continue;const A=C.get(M.id);A&&(A.selected=!1),I.push(lb(M.id,!1))}const R=[];for(const M of E)M.selected&&R.push(lb(M.id,!1));S(I),L(R)},setMinZoom:m=>{const{panZoom:b,maxZoom:v}=g();b==null||b.setScaleExtent([m,v]),f({minZoom:m})},setMaxZoom:m=>{const{panZoom:b,minZoom:v}=g();b==null||b.setScaleExtent([v,m]),f({maxZoom:m})},setTranslateExtent:m=>{var b;(b=g().panZoom)==null||b.setTranslateExtent(m),f({translateExtent:m})},resetSelectedElements:()=>{const{edges:m,nodes:b,triggerNodeChanges:v,triggerEdgeChanges:w,elementsSelectable:C}=g();if(!C)return;const S=b.reduce((x,E)=>E.selected?[...x,lb(E.id,!1)]:x,[]),L=m.reduce((x,E)=>E.selected?[...x,lb(E.id,!1)]:x,[]);v(S),w(L)},setNodeExtent:m=>{const{nodes:b,nodeLookup:v,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:S,nodeExtent:L,zIndexMode:x}=g();m[0][0]===L[0][0]&&m[0][1]===L[0][1]&&m[1][0]===L[1][0]&&m[1][1]===L[1][1]||($B(b,v,w,{nodeOrigin:C,nodeExtent:m,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:x}),f({nodeExtent:m}))},panBy:m=>{const{transform:b,width:v,height:w,panZoom:C,translateExtent:S}=g();return PNe({delta:m,panZoom:C,transform:b,translateExtent:S,width:v,height:w})},setCenter:async(m,b,v)=>{const{width:w,height:C,maxZoom:S,panZoom:L}=g();if(!L)return Promise.resolve(!1);const x=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:S;return await L.setViewport({x:w/2-m*x,y:C/2-b*x,zoom:x},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{f({connection:{...Iue}})},updateConnection:m=>{f({connection:m})},reset:()=>f({...vte()})}},Object.is);function f2e({initialNodes:n,initialEdges:e,defaultNodes:t,defaultEdges:i,initialWidth:s,initialHeight:o,initialMinZoom:r,initialMaxZoom:a,initialFitViewOptions:l,fitView:c,nodeOrigin:d,nodeExtent:h,zIndexMode:u,children:f}){const[g]=$.useState(()=>u2e({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:c,minZoom:r,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:h,zIndexMode:u}));return y.jsx(TDe,{value:g,children:y.jsx(eTe,{children:f})})}function g2e({children:n,nodes:e,edges:t,defaultNodes:i,defaultEdges:s,width:o,height:r,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:h,nodeExtent:u,zIndexMode:f}){return $.useContext(x5)?y.jsx(y.Fragment,{children:n}):y.jsx(f2e,{initialNodes:e,initialEdges:t,defaultNodes:i,defaultEdges:s,initialWidth:o,initialHeight:r,fitView:a,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:d,nodeOrigin:h,nodeExtent:u,zIndexMode:f,children:n})}const p2e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function m2e({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,className:s,nodeTypes:o,edgeTypes:r,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:h,onMoveEnd:u,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:m,onClickConnectEnd:b,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:S,onNodeDoubleClick:L,onNodeDragStart:x,onNodeDrag:E,onNodeDragStop:I,onNodesDelete:R,onEdgesDelete:M,onDelete:A,onSelectionChange:W,onSelectionDragStart:P,onSelectionDrag:B,onSelectionDragStop:V,onSelectionContextMenu:K,onSelectionStart:z,onSelectionEnd:j,onBeforeDelete:Q,connectionMode:Y,connectionLineType:te=Nf.Bezier,connectionLineStyle:ce,connectionLineComponent:Ce,connectionLineContainerStyle:xe,deleteKeyCode:je="Backspace",selectionKeyCode:ke="Shift",selectionOnDrag:Le=!1,selectionMode:Ve=UE.Full,panActivationKeyCode:ct="Space",multiSelectionKeyCode:dt=KE()?"Meta":"Control",zoomActivationKeyCode:Be=KE()?"Meta":"Control",snapToGrid:tt,snapGrid:Tt,onlyRenderVisibleElements:Si=!1,selectNodesOnDrag:Vt,nodesDraggable:In,autoPanOnNodeFocus:Nn,nodesConnectable:Os,nodesFocusable:Da,nodeOrigin:Mo=cfe,edgesFocusable:_l,edgesReconnectable:Ta,elementsSelectable:xr=!0,defaultViewport:go=$De,minZoom:ei=.5,maxZoom:gn=2,translateExtent:bl=$E,preventScrolling:Lr=!0,nodeExtent:td,defaultMarkerColor:vl="#b1b1b7",zoomOnScroll:ch=!0,zoomOnPinch:Ks=!0,panOnScroll:hs=!1,panOnScrollSpeed:qn=.5,panOnScrollMode:kr=xv.Free,zoomOnDoubleClick:tn=!0,panOnDrag:us=!0,onPaneClick:Xr,onPaneMouseEnter:Dn,onPaneMouseMove:Yg,onPaneMouseLeave:_c,onPaneScroll:X,onPaneContextMenu:wl,paneClickDistance:Cn=1,nodeClickDistance:Ii=0,children:Qr,onReconnect:Qe,onReconnectStart:dh,onReconnectEnd:fi,onEdgeContextMenu:gi,onEdgeDoubleClick:Ra,onEdgeMouseEnter:Jo,onEdgeMouseMove:po,onEdgeMouseLeave:er,reconnectRadius:id=10,onNodesChange:Tn,onEdgesChange:Er,noDragClassName:mo="nodrag",noWheelClassName:Wu="nowheel",noPanClassName:Hn="nopan",fitView:nd,fitViewOptions:hh,connectOnClick:Zg,attributionPosition:Ct,proOptions:ae,defaultEdgeOptions:Ee,elevateNodesOnSelect:rt=!0,elevateEdgesOnSelect:Et=!1,disableKeyboardA11y:Rn=!1,autoPanOnConnect:li,autoPanOnNodeDrag:Ls,autoPanSpeed:ks,connectionRadius:Ir,isValidConnection:Hu,onError:Qn,style:Vu,id:uh,nodeDragThreshold:I_,connectionDragThreshold:vx,viewport:wx,onViewportChange:Cl,width:Qw,height:Xg,colorMode:fh="light",debug:N_,onScroll:Qg,ariaLabelConfig:zu,zIndexMode:Jw="basic",...eC},D_){const T_=uh||"1",tC=GDe(fh),gh=$.useCallback(sd=>{sd.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Qg==null||Qg(sd)},[Qg]);return y.jsx("div",{"data-testid":"rf__wrapper",...eC,onScroll:gh,style:{...Vu,...p2e},ref:D_,className:uo(["react-flow",s,tC]),id:uh,role:"application",children:y.jsxs(g2e,{nodes:n,edges:e,width:Qw,height:Xg,fitView:nd,fitViewOptions:hh,minZoom:ei,maxZoom:gn,nodeOrigin:Mo,nodeExtent:td,zIndexMode:Jw,children:[y.jsx(h2e,{onInit:c,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:S,onNodeDoubleClick:L,nodeTypes:o,edgeTypes:r,connectionLineType:te,connectionLineStyle:ce,connectionLineComponent:Ce,connectionLineContainerStyle:xe,selectionKeyCode:ke,selectionOnDrag:Le,selectionMode:Ve,deleteKeyCode:je,multiSelectionKeyCode:dt,panActivationKeyCode:ct,zoomActivationKeyCode:Be,onlyRenderVisibleElements:Si,defaultViewport:go,translateExtent:bl,minZoom:ei,maxZoom:gn,preventScrolling:Lr,zoomOnScroll:ch,zoomOnPinch:Ks,zoomOnDoubleClick:tn,panOnScroll:hs,panOnScrollSpeed:qn,panOnScrollMode:kr,panOnDrag:us,onPaneClick:Xr,onPaneMouseEnter:Dn,onPaneMouseMove:Yg,onPaneMouseLeave:_c,onPaneScroll:X,onPaneContextMenu:wl,paneClickDistance:Cn,nodeClickDistance:Ii,onSelectionContextMenu:K,onSelectionStart:z,onSelectionEnd:j,onReconnect:Qe,onReconnectStart:dh,onReconnectEnd:fi,onEdgeContextMenu:gi,onEdgeDoubleClick:Ra,onEdgeMouseEnter:Jo,onEdgeMouseMove:po,onEdgeMouseLeave:er,reconnectRadius:id,defaultMarkerColor:vl,noDragClassName:mo,noWheelClassName:Wu,noPanClassName:Hn,rfId:T_,disableKeyboardA11y:Rn,nodeExtent:td,viewport:wx,onViewportChange:Cl}),y.jsx(KDe,{nodes:n,edges:e,defaultNodes:t,defaultEdges:i,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:m,onClickConnectEnd:b,nodesDraggable:In,autoPanOnNodeFocus:Nn,nodesConnectable:Os,nodesFocusable:Da,edgesFocusable:_l,edgesReconnectable:Ta,elementsSelectable:xr,elevateNodesOnSelect:rt,elevateEdgesOnSelect:Et,minZoom:ei,maxZoom:gn,nodeExtent:td,onNodesChange:Tn,onEdgesChange:Er,snapToGrid:tt,snapGrid:Tt,connectionMode:Y,translateExtent:bl,connectOnClick:Zg,defaultEdgeOptions:Ee,fitView:nd,fitViewOptions:hh,onNodesDelete:R,onEdgesDelete:M,onDelete:A,onNodeDragStart:x,onNodeDrag:E,onNodeDragStop:I,onSelectionDrag:B,onSelectionDragStart:P,onSelectionDragStop:V,onMove:d,onMoveStart:h,onMoveEnd:u,noPanClassName:Hn,nodeOrigin:Mo,rfId:T_,autoPanOnConnect:li,autoPanOnNodeDrag:Ls,autoPanSpeed:ks,onError:Qn,connectionRadius:Ir,isValidConnection:Hu,selectNodesOnDrag:Vt,nodeDragThreshold:I_,connectionDragThreshold:vx,onBeforeDelete:Q,debug:N_,ariaLabelConfig:zu,zIndexMode:Jw}),y.jsx(jDe,{onSelectionChange:W}),Qr,y.jsx(BDe,{proOptions:ae,position:Ct}),y.jsx(FDe,{rfId:T_,disableKeyboardA11y:Rn})]})})}var _2e=ffe(m2e);function b2e({dimensions:n,lineWidth:e,variant:t,className:i}){return y.jsx("path",{strokeWidth:e,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:uo(["react-flow__background-pattern",t,i])})}function v2e({radius:n,className:e}){return y.jsx("circle",{cx:n,cy:n,r:n,className:uo(["react-flow__background-pattern","dots",e])})}var ig;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ig||(ig={}));const w2e={[ig.Dots]:1,[ig.Lines]:1,[ig.Cross]:6},C2e=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function Ffe({id:n,variant:e=ig.Dots,gap:t=20,size:i,lineWidth:s=1,offset:o=0,color:r,bgColor:a,style:l,className:c,patternClassName:d}){const h=$.useRef(null),{transform:u,patternId:f}=Mi(C2e,as),g=i||w2e[e],p=e===ig.Dots,m=e===ig.Cross,b=Array.isArray(t)?t:[t,t],v=[b[0]*u[2]||1,b[1]*u[2]||1],w=g*u[2],C=Array.isArray(o)?o:[o,o],S=m?[w,w]:v,L=[C[0]*u[2]||1+S[0]/2,C[1]*u[2]||1+S[1]/2],x=`${f}${n||""}`;return y.jsxs("svg",{className:uo(["react-flow__background",c]),style:{...l,...k5,"--xy-background-color-props":a,"--xy-background-pattern-color-props":r},ref:h,"data-testid":"rf__background",children:[y.jsx("pattern",{id:x,x:u[0]%v[0],y:u[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:p?y.jsx(v2e,{radius:w/2,className:d}):y.jsx(b2e,{dimensions:S,lineWidth:s,variant:e,className:d})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${x})`})]})}Ffe.displayName="Background";const y2e=$.memo(Ffe);function S2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function x2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function L2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.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 k2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.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 E2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.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 LT({children:n,className:e,...t}){return y.jsx("button",{type:"button",className:uo(["react-flow__controls-button",e]),...t,children:n})}const I2e=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function Bfe({style:n,showZoom:e=!0,showFitView:t=!0,showInteractive:i=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:r,onFitView:a,onInteractiveChange:l,className:c,children:d,position:h="bottom-left",orientation:u="vertical","aria-label":f}){const g=ds(),{isInteractive:p,minZoomReached:m,maxZoomReached:b,ariaLabelConfig:v}=Mi(I2e,as),{zoomIn:w,zoomOut:C,fitView:S}=_G(),L=()=>{w(),o==null||o()},x=()=>{C(),r==null||r()},E=()=>{S(s),a==null||a()},I=()=>{g.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),l==null||l(!p)},R=u==="horizontal"?"horizontal":"vertical";return y.jsxs(L5,{className:uo(["react-flow__controls",R,c]),position:h,style:n,"data-testid":"rf__controls","aria-label":f??v["controls.ariaLabel"],children:[e&&y.jsxs(y.Fragment,{children:[y.jsx(LT,{onClick:L,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:b,children:y.jsx(S2e,{})}),y.jsx(LT,{onClick:x,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:m,children:y.jsx(x2e,{})})]}),t&&y.jsx(LT,{className:"react-flow__controls-fitview",onClick:E,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:y.jsx(L2e,{})}),i&&y.jsx(LT,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:p?y.jsx(E2e,{}):y.jsx(k2e,{})}),d]})}Bfe.displayName="Controls";const N2e=$.memo(Bfe);function D2e({id:n,x:e,y:t,width:i,height:s,style:o,color:r,strokeColor:a,strokeWidth:l,className:c,borderRadius:d,shapeRendering:h,selected:u,onClick:f}){const{background:g,backgroundColor:p}=o||{},m=r||g||p;return y.jsx("rect",{className:uo(["react-flow__minimap-node",{selected:u},c]),x:e,y:t,rx:d,ry:d,width:i,height:s,style:{fill:m,stroke:a,strokeWidth:l},shapeRendering:h,onClick:f?b=>f(b,n):void 0})}const T2e=$.memo(D2e),R2e=n=>n.nodes.map(e=>e.id),s7=n=>n instanceof Function?n:()=>n;function M2e({nodeStrokeColor:n,nodeColor:e,nodeClassName:t="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:o=T2e,onClick:r}){const a=Mi(R2e,as),l=s7(e),c=s7(n),d=s7(t),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:a.map(u=>y.jsx(P2e,{id:u,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:s,NodeComponent:o,onClick:r,shapeRendering:h},u))})}function A2e({id:n,nodeColorFunc:e,nodeStrokeColorFunc:t,nodeClassNameFunc:i,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:r,NodeComponent:a,onClick:l}){const{node:c,x:d,y:h,width:u,height:f}=Mi(g=>{const p=g.nodeLookup.get(n);if(!p)return{node:void 0,x:0,y:0,width:0,height:0};const m=p.internals.userNode,{x:b,y:v}=p.internals.positionAbsolute,{width:w,height:C}=Wg(m);return{node:m,x:b,y:v,width:w,height:C}},as);return!c||c.hidden||!Pue(c)?null:y.jsx(a,{x:d,y:h,width:u,height:f,style:c.style,selected:!!c.selected,className:i(c),color:e(c),borderRadius:s,strokeColor:t(c),strokeWidth:o,shapeRendering:r,onClick:l,id:c.id})}const P2e=$.memo(A2e);var O2e=$.memo(M2e);const F2e=200,B2e=150,W2e=n=>!n.hidden,H2e=n=>{const e={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:e,boundingRect:n.nodeLookup.size>0?Aue(QN(n.nodeLookup,{filter:W2e}),e):e,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},V2e="react-flow__minimap-desc";function Wfe({style:n,className:e,nodeStrokeColor:t,nodeColor:i,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:a,bgColor:l,maskColor:c,maskStrokeColor:d,maskStrokeWidth:h,position:u="bottom-right",onClick:f,onNodeClick:g,pannable:p=!1,zoomable:m=!1,ariaLabel:b,inversePan:v,zoomStep:w=1,offsetScale:C=5}){const S=ds(),L=$.useRef(null),{boundingRect:x,viewBB:E,rfId:I,panZoom:R,translateExtent:M,flowWidth:A,flowHeight:W,ariaLabelConfig:P}=Mi(H2e,as),B=(n==null?void 0:n.width)??F2e,V=(n==null?void 0:n.height)??B2e,K=x.width/B,z=x.height/V,j=Math.max(K,z),Q=j*B,Y=j*V,te=C*j,ce=x.x-(Q-x.width)/2-te,Ce=x.y-(Y-x.height)/2-te,xe=Q+te*2,je=Y+te*2,ke=`${V2e}-${I}`,Le=$.useRef(0),Ve=$.useRef();Le.current=j,$.useEffect(()=>{if(L.current&&R)return Ve.current=$Ne({domNode:L.current,panZoom:R,getTransform:()=>S.getState().transform,getViewScale:()=>Le.current}),()=>{var tt;(tt=Ve.current)==null||tt.destroy()}},[R]),$.useEffect(()=>{var tt;(tt=Ve.current)==null||tt.update({translateExtent:M,width:A,height:W,inversePan:v,pannable:p,zoomStep:w,zoomable:m})},[p,m,v,w,M,A,W]);const ct=f?tt=>{var Vt;const[Tt,Si]=((Vt=Ve.current)==null?void 0:Vt.pointer(tt))||[0,0];f(tt,{x:Tt,y:Si})}:void 0,dt=g?$.useCallback((tt,Tt)=>{const Si=S.getState().nodeLookup.get(Tt).internals.userNode;g(tt,Si)},[]):void 0,Be=b??P["minimap.ariaLabel"];return y.jsx(L5,{position:u,style:{...n,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*j:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof r=="number"?r:void 0},className:uo(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:B,height:V,viewBox:`${ce} ${Ce} ${xe} ${je}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ke,ref:L,onClick:ct,children:[Be&&y.jsx("title",{id:ke,children:Be}),y.jsx(O2e,{onClick:dt,nodeColor:i,nodeStrokeColor:t,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:r,nodeComponent:a}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${ce-te},${Ce-te}h${xe+te*2}v${je+te*2}h${-xe-te*2}z + M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Wfe.displayName="MiniMap";const z2e=$.memo(Wfe),j2e=n=>e=>n?`${Math.max(1/e.transform[2],1)}`:void 0,$2e={[tS.Line]:"right",[tS.Handle]:"bottom-right"};function U2e({nodeId:n,position:e,variant:t=tS.Handle,className:i,style:s=void 0,children:o,color:r,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:u,autoScale:f=!0,shouldResize:g,onResizeStart:p,onResize:m,onResizeEnd:b}){const v=_fe(),w=typeof n=="string"?n:v,C=ds(),S=$.useRef(null),L=t===tS.Handle,x=Mi($.useCallback(j2e(L&&f),[L,f]),as),E=$.useRef(null),I=e??$2e[t];$.useEffect(()=>{if(!(!S.current||!w))return E.current||(E.current=sDe({domNode:S.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:M,transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B,domNode:V}=C.getState();return{nodeLookup:M,transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B,paneDomNode:V}},onChange:(M,A)=>{const{triggerNodeChanges:W,nodeLookup:P,parentLookup:B,nodeOrigin:V}=C.getState(),K=[],z={x:M.x,y:M.y},j=P.get(w);if(j&&j.expandParent&&j.parentId){const Q=j.origin??V,Y=M.width??j.measured.width??0,te=M.height??j.measured.height??0,ce={id:j.id,parentId:j.parentId,rect:{width:Y,height:te,...Oue({x:M.x??j.position.x,y:M.y??j.position.y},{width:Y,height:te},j.parentId,P,Q)}},Ce=mG([ce],P,B,V);K.push(...Ce),z.x=M.x?Math.max(Q[0]*Y,M.x):void 0,z.y=M.y?Math.max(Q[1]*te,M.y):void 0}if(z.x!==void 0&&z.y!==void 0){const Q={id:w,type:"position",position:{...z}};K.push(Q)}if(M.width!==void 0&&M.height!==void 0){const Y={id:w,type:"dimensions",resizing:!0,setAttributes:u?u==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};K.push(Y)}for(const Q of A){const Y={...Q,type:"position"};K.push(Y)}W(K)},onEnd:({width:M,height:A})=>{const W={id:w,type:"dimensions",resizing:!1,dimensions:{width:M,height:A}};C.getState().triggerNodeChanges([W])}})),E.current.update({controlPosition:I,boundaries:{minWidth:a,minHeight:l,maxWidth:c,maxHeight:d},keepAspectRatio:h,resizeDirection:u,onResizeStart:p,onResize:m,onResizeEnd:b,shouldResize:g}),()=>{var M;(M=E.current)==null||M.destroy()}},[I,a,l,c,d,h,p,m,b,g]);const R=I.split("-");return y.jsx("div",{className:uo(["react-flow__resize-control","nodrag",...R,t,i]),ref:S,style:{...s,scale:x,...r&&{[L?"backgroundColor":"borderColor"]:r}},children:o})}$.memo(U2e);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const z2e=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ffe=(...n)=>n.filter((e,t,i)=>!!e&&i.indexOf(e)===t).join(" ");/** + */const q2e=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Hfe=(...n)=>n.filter((e,t,i)=>!!e&&i.indexOf(e)===t).join(" ");/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var j2e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var K2e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $2e=$.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:s="",children:o,iconNode:r,...a},l)=>$.createElement("svg",{ref:l,...j2e,width:e,height:e,stroke:n,strokeWidth:i?Number(t)*24/Number(e):t,className:Ffe("lucide",s),...a},[...r.map(([c,d])=>$.createElement(c,d)),...Array.isArray(o)?o:[o]]));/** + */const G2e=$.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:s="",children:o,iconNode:r,...a},l)=>$.createElement("svg",{ref:l,...K2e,width:e,height:e,stroke:n,strokeWidth:i?Number(t)*24/Number(e):t,className:Hfe("lucide",s),...a},[...r.map(([c,d])=>$.createElement(c,d)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fi=(n,e)=>{const t=$.forwardRef(({className:i,...s},o)=>$.createElement($2e,{ref:o,iconNode:e,className:Ffe(`lucide-${z2e(n)}`,i),...s}));return t.displayName=`${n}`,t};/** + */const ci=(n,e)=>{const t=$.forwardRef(({className:i,...s},o)=>$.createElement(G2e,{ref:o,iconNode:e,className:Hfe(`lucide-${q2e(n)}`,i),...s}));return t.displayName=`${n}`,t};/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CR=fi("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** + */const wR=ci("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JC=fi("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + */const iv=ci("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bfe=fi("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + */const Vfe=ci("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pp=fi("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Op=ci("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LL=fi("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const LL=ci("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vte=fi("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const UM=ci("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const U2e=fi("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + */const Y2e=ci("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const q2e=fi("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const Z2e=ci("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YI=fi("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** + */const X2e=ci("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yR=fi("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const YE=ci("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const K2e=fi("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const CR=ci("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const G2e=fi("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/** + */const Q2e=ci("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const e0=fi("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const wte=ci("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Y2e=fi("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + */const Wf=ci("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Z2e=fi("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + */const J2e=ci("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wte=fi("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const eRe=ci("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const X2e=fi("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** + */const Cte=ci("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Q2e=fi("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + */const tRe=ci("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cte=fi("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const iRe=ci("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yte=fi("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + */const yte=ci("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const J2e=fi("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** + */const Ste=ci("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eRe=fi("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + */const nRe=ci("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const t0=fi("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const sRe=ci("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xf=fi("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const s0=ci("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rk=fi("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const Sp=ci("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tRe=fi("Rows3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);/** + */const rk=ci("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iRe=fi("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** + */const zfe=ci("Rows3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lb=fi("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const oRe=ci("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nRe=fi("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const cb=ci("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZI=fi("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** + */const rRe=ci("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sRe=fi("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + */const ZE=ci("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oRe=fi("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/** + */const aRe=ci("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ste=fi("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + */const xte=ci("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rRe=fi("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + */const Lte=ci("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gp=fi("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const lRe=ci("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IT=fi("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + */const gp=ci("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kL=fi("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + */const kT=ci("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xte=fi("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/** + */const kL=ci("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aRe=fi("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + */const kte=ci("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const i0=fi("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Wfe="/api",qB="aevatar:auth-required";function Lte(n){const e=String(n||"").toLowerCase();return e.includes("application/json")||e.includes("+json")}function kte(n){const e=String(n||"").toLowerCase();return e.includes("text/html")||e.includes("application/xhtml+xml")}function ak(n){typeof window>"u"||window.dispatchEvent(new CustomEvent(qB,{detail:n}))}function lRe(n){if(typeof window>"u")return()=>{};const e=t=>{const i=t.detail||{};n(i)};return window.addEventListener(qB,e),()=>window.removeEventListener(qB,e)}async function Qt(n,e){const t=new Headers(e==null?void 0:e.headers);!(typeof FormData<"u"&&(e==null?void 0:e.body)instanceof FormData)&&!t.has("Content-Type")&&t.set("Content-Type","application/json");const s=await fetch(`${Wfe}${n}`,{...e,headers:t}),o=s.headers.get("content-type");if(!s.ok){const a=Lte(o)?await s.json().catch(()=>({})):{message:await s.text().catch(()=>"")};throw(s.status===401||a!=null&&a.loginUrl)&&ak({loginUrl:a==null?void 0:a.loginUrl,message:(a==null?void 0:a.message)||"Sign in to continue."}),{status:s.status,...a}}if(s.status===204)return;if(Lte(o))return s.json();s.redirected&&ak({loginUrl:s.url,message:"Sign in to continue."});const r=await s.text().catch(()=>"");throw(kte(o)||s.redirected)&&ak({loginUrl:s.redirected?s.url:null,message:"API returned HTML instead of JSON. Sign-in may be required."}),{status:s.redirected?401:s.status,message:kte(o)?"API returned HTML instead of JSON. Sign-in may be required.":"API returned an unexpected response format.",rawBody:r}}async function Ite(n,e,t,i){const s=await fetch(`${Wfe}${n}`,{method:"POST",headers:{Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(e),signal:i});if(s.redirected&&ak({loginUrl:s.url,message:"Sign in to continue."}),!s.ok){const l=await s.json().catch(()=>({}));throw(s.status===401||l!=null&&l.loginUrl)&&ak({loginUrl:(l==null?void 0:l.loginUrl)||(s.redirected?s.url:null),message:(l==null?void 0:l.message)||"Sign in to continue."}),{status:s.status,...l}}if(!s.body)return;const o=s.body.getReader(),r=new TextDecoder;let a="";for(;;){const{value:l,done:c}=await o.read();a+=r.decode(l||new Uint8Array,{stream:!c});let d=a.indexOf(` + */const cRe=ci("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + * @license lucide-react v0.400.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nv=ci("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),jfe="/api",KB="aevatar:auth-required";function Ete(n){const e=String(n||"").toLowerCase();return e.includes("application/json")||e.includes("+json")}function Ite(n){const e=String(n||"").toLowerCase();return e.includes("text/html")||e.includes("application/xhtml+xml")}function ak(n){typeof window>"u"||window.dispatchEvent(new CustomEvent(KB,{detail:n}))}function dRe(n){if(typeof window>"u")return()=>{};const e=t=>{const i=t.detail||{};n(i)};return window.addEventListener(KB,e),()=>window.removeEventListener(KB,e)}async function Xt(n,e){const t=new Headers(e==null?void 0:e.headers);!(typeof FormData<"u"&&(e==null?void 0:e.body)instanceof FormData)&&!t.has("Content-Type")&&t.set("Content-Type","application/json");const s=await fetch(`${jfe}${n}`,{...e,headers:t}),o=s.headers.get("content-type");if(!s.ok){const a=Ete(o)?await s.json().catch(()=>({})):{message:await s.text().catch(()=>"")};throw(s.status===401||a!=null&&a.loginUrl)&&ak({loginUrl:a==null?void 0:a.loginUrl,message:(a==null?void 0:a.message)||"Sign in to continue."}),{status:s.status,...a}}if(s.status===204)return;if(Ete(o))return s.json();s.redirected&&ak({loginUrl:s.url,message:"Sign in to continue."});const r=await s.text().catch(()=>"");throw(Ite(o)||s.redirected)&&ak({loginUrl:s.redirected?s.url:null,message:"API returned HTML instead of JSON. Sign-in may be required."}),{status:s.redirected?401:s.status,message:Ite(o)?"API returned HTML instead of JSON. Sign-in may be required.":"API returned an unexpected response format.",rawBody:r}}async function Nte(n,e,t,i){const s=await fetch(`${jfe}${n}`,{method:"POST",headers:{Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(e),signal:i});if(s.redirected&&ak({loginUrl:s.url,message:"Sign in to continue."}),!s.ok){const l=await s.json().catch(()=>({}));throw(s.status===401||l!=null&&l.loginUrl)&&ak({loginUrl:(l==null?void 0:l.loginUrl)||(s.redirected?s.url:null),message:(l==null?void 0:l.message)||"Sign in to continue."}),{status:s.status,...l}}if(!s.body)return;const o=s.body.getReader(),r=new TextDecoder;let a="";for(;;){const{value:l,done:c}=await o.read();a+=r.decode(l||new Uint8Array,{stream:!c});let d=a.indexOf(` `);for(;d>=0;){const h=a.slice(0,d);a=a.slice(d+2);const u=h.split(` `).filter(f=>f.startsWith("data:")).map(f=>f.slice(5).trim()).join(` `);u&&u!=="[DONE]"&&t(JSON.parse(u)),d=a.indexOf(` -`)}if(c)break}}function Ete(n){return!n||typeof n!="object"?null:n.type?n:n.textMessageContent?{type:"TEXT_MESSAGE_CONTENT",delta:n.textMessageContent.delta||""}:n.textMessageReasoning?{type:"TEXT_MESSAGE_REASONING",delta:n.textMessageReasoning.delta||""}:n.textMessageEnd?{type:"TEXT_MESSAGE_END",message:n.textMessageEnd.message||"",delta:n.textMessageEnd.delta||""}:n.runError?{type:"RUN_ERROR",message:n.runError.message||"Assistant run failed."}:n}const ap={parseYaml:(n,e)=>Qt("/editor/parse-yaml",{method:"POST",body:JSON.stringify({yaml:n,availableWorkflowNames:e})}),serializeYaml:(n,e)=>Qt("/editor/serialize-yaml",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),validate:(n,e)=>Qt("/editor/validate",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),normalize:(n,e)=>Qt("/editor/normalize",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),diff:(n,e)=>Qt("/editor/diff",{method:"POST",body:JSON.stringify({before:n,after:e})})},lp={getSettings:()=>Qt("/workspace"),updateSettings:n=>Qt("/workspace/settings",{method:"PUT",body:JSON.stringify(n)}),addDirectory:n=>Qt("/workspace/directories",{method:"POST",body:JSON.stringify(n)}),removeDirectory:n=>Qt(`/workspace/directories/${n}`,{method:"DELETE"}),listWorkflows:()=>Qt("/workspace/workflows"),getWorkflow:n=>Qt(`/workspace/workflows/${n}`),saveWorkflow:n=>Qt("/workspace/workflows",{method:"POST",body:JSON.stringify(n)})},sC={getCatalog:()=>Qt("/connectors"),saveCatalog:n=>Qt("/connectors",{method:"PUT",body:JSON.stringify(n)}),importCatalog:n=>{const e=new FormData;return e.set("file",n,n.name),Qt("/connectors/import",{method:"POST",body:e})},getDraft:()=>Qt("/connectors/draft"),saveDraft:n=>Qt("/connectors/draft",{method:"PUT",body:JSON.stringify(n)}),deleteDraft:()=>Qt("/connectors/draft",{method:"DELETE"})},oC={getCatalog:()=>Qt("/roles"),saveCatalog:n=>Qt("/roles",{method:"PUT",body:JSON.stringify(n)}),importCatalog:n=>{const e=new FormData;return e.set("file",n,n.name),Qt("/roles/import",{method:"POST",body:e})},getDraft:()=>Qt("/roles/draft"),saveDraft:n=>Qt("/roles/draft",{method:"PUT",body:JSON.stringify(n)}),deleteDraft:()=>Qt("/roles/draft",{method:"DELETE"})},ET={get:()=>Qt("/settings"),save:n=>Qt("/settings",{method:"PUT",body:JSON.stringify(n)}),testRuntime:n=>Qt("/settings/runtime/test",{method:"POST",body:JSON.stringify(n)})},V_={list:()=>Qt("/executions"),get:n=>Qt(`/executions/${n}`),start:n=>Qt("/executions",{method:"POST",body:JSON.stringify(n)}),resume:(n,e)=>Qt(`/executions/${n}/resume`,{method:"POST",body:JSON.stringify(e)}),stop:(n,e)=>Qt(`/executions/${n}/stop`,{method:"POST",body:JSON.stringify(e)})},Hfe={authorWorkflow:async(n,e)=>{let t="",i="";return await Ite("/app/workflow-generator",n,s=>{var r,a,l;const o=Ete(s);if(o){if(o.type==="TEXT_MESSAGE_CONTENT"){t+=o.delta||"",(r=e==null?void 0:e.onText)==null||r.call(e,t);return}if(o.type==="TEXT_MESSAGE_REASONING"){i+=o.delta||"",(a=e==null?void 0:e.onReasoning)==null||a.call(e,i);return}if(o.type==="TEXT_MESSAGE_END"){t=t||o.message||o.delta||"",(l=e==null?void 0:e.onText)==null||l.call(e,t);return}if(o.type==="RUN_ERROR")throw new Error(o.message||"Assistant run failed.")}},e==null?void 0:e.signal),t},authorScript:async(n,e)=>{let t="",i="",s=null,o="";return await Ite("/app/scripts/generator",n,r=>{var l,c,d;const a=Ete(r);if(a){if(a.type==="TEXT_MESSAGE_CONTENT"){t+=a.delta||"",(l=e==null?void 0:e.onText)==null||l.call(e,t);return}if(a.type==="TEXT_MESSAGE_REASONING"){i+=a.delta||"",(c=e==null?void 0:e.onReasoning)==null||c.call(e,i);return}if(a.type==="TEXT_MESSAGE_END"){t=t||a.message||a.delta||"",s=a.scriptPackage||null,o=a.currentFilePath||"",(d=e==null?void 0:e.onText)==null||d.call(e,t);return}if(a.type==="RUN_ERROR")throw new Error(a.message||"Assistant run failed.")}},e==null?void 0:e.signal),{text:t,scriptPackage:s,currentFilePath:o}}},cRe={getSession:()=>Qt("/auth/me")},wl={getContext:()=>Qt("/app/context"),validateDraftScript:(n,e)=>Qt("/app/scripts/validate",{method:"POST",body:JSON.stringify(n),signal:e}),listScripts:(n=!1)=>Qt(`/app/scripts?includeSource=${n?"true":"false"}`),getScript:n=>Qt(`/app/scripts/${encodeURIComponent(n)}`),getScriptCatalog:n=>Qt(`/app/scripts/${encodeURIComponent(n)}/catalog`),listScriptRuntimes:(n=24)=>Qt(`/app/scripts/runtimes?take=${n}`),getEvolutionDecision:n=>Qt(`/app/scripts/evolutions/${encodeURIComponent(n)}`),getRuntimeReadModel:n=>Qt(`/app/scripts/runtimes/${encodeURIComponent(n)}/readmodel`),saveScript:n=>Qt("/app/scripts",{method:"POST",body:JSON.stringify(n)}),runDraftScript:n=>Qt("/app/scripts/draft-run",{method:"POST",body:JSON.stringify(n)})},dRe={getReadModel:n=>Qt(`/app/scripts/runtimes/${encodeURIComponent(n)}/readmodel`),proposeEvolution:n=>Qt("/app/scripts/evolutions/proposals",{method:"POST",body:JSON.stringify(n)})};function Nte(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=Array(e);t =n.length?n.apply(this,s):function(){for(var r=arguments.length,a=new Array(r),l=0;l 1&&arguments[1]!==void 0?arguments[1]:{};NT.initial(n),NT.handler(e);var t={current:n},i=IL(ARe)(t,e),s=IL(MRe)(t),o=IL(NT.changes)(n),r=IL(RRe)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return NT.selector(c),c(t.current)}function l(c){yRe(i,s,o,r)(c)}return[a,l]}function RRe(n,e){return XI(e)?e(n.current):e}function MRe(n,e){return n.current=Mte(Mte({},n.current),e),e}function ARe(n,e,t){return XI(e)?e(n.current):Object.keys(t).forEach(function(i){var s;return(s=e[i])===null||s===void 0?void 0:s.call(e,n.current[i])}),t}var PRe={create:TRe},ORe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function FRe(n){return function e(){for(var t=this,i=arguments.length,s=new Array(i),o=0;o=n.length?n.apply(this,s):function(){for(var r=arguments.length,a=new Array(r),l=0;l Xt("/editor/parse-yaml",{method:"POST",body:JSON.stringify({yaml:n,availableWorkflowNames:e})}),serializeYaml:(n,e)=>Xt("/editor/serialize-yaml",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),validate:(n,e)=>Xt("/editor/validate",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),normalize:(n,e)=>Xt("/editor/normalize",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),diff:(n,e)=>Xt("/editor/diff",{method:"POST",body:JSON.stringify({before:n,after:e})})},lp={getSettings:()=>Xt("/workspace"),updateSettings:n=>Xt("/workspace/settings",{method:"PUT",body:JSON.stringify(n)}),addDirectory:n=>Xt("/workspace/directories",{method:"POST",body:JSON.stringify(n)}),removeDirectory:n=>Xt(`/workspace/directories/${n}`,{method:"DELETE"}),listWorkflows:()=>Xt("/workspace/workflows"),getWorkflow:n=>Xt(`/workspace/workflows/${n}`),saveWorkflow:n=>Xt("/workspace/workflows",{method:"POST",body:JSON.stringify(n)})},cC={getCatalog:()=>Xt("/connectors"),saveCatalog:n=>Xt("/connectors",{method:"PUT",body:JSON.stringify(n)}),importCatalog:n=>{const e=new FormData;return e.set("file",n,n.name),Xt("/connectors/import",{method:"POST",body:e})},getDraft:()=>Xt("/connectors/draft"),saveDraft:n=>Xt("/connectors/draft",{method:"PUT",body:JSON.stringify(n)}),deleteDraft:()=>Xt("/connectors/draft",{method:"DELETE"})},dC={getCatalog:()=>Xt("/roles"),saveCatalog:n=>Xt("/roles",{method:"PUT",body:JSON.stringify(n)}),importCatalog:n=>{const e=new FormData;return e.set("file",n,n.name),Xt("/roles/import",{method:"POST",body:e})},getDraft:()=>Xt("/roles/draft"),saveDraft:n=>Xt("/roles/draft",{method:"PUT",body:JSON.stringify(n)}),deleteDraft:()=>Xt("/roles/draft",{method:"DELETE"})},ET={get:()=>Xt("/settings"),save:n=>Xt("/settings",{method:"PUT",body:JSON.stringify(n)}),testRuntime:n=>Xt("/settings/runtime/test",{method:"POST",body:JSON.stringify(n)})},z_={list:()=>Xt("/executions"),get:n=>Xt(`/executions/${n}`),start:n=>Xt("/executions",{method:"POST",body:JSON.stringify(n)}),resume:(n,e)=>Xt(`/executions/${n}/resume`,{method:"POST",body:JSON.stringify(e)}),stop:(n,e)=>Xt(`/executions/${n}/stop`,{method:"POST",body:JSON.stringify(e)})},$fe={authorWorkflow:async(n,e)=>{let t="",i="";return await Nte("/app/workflow-generator",n,s=>{var r,a,l;const o=Dte(s);if(o){if(o.type==="TEXT_MESSAGE_CONTENT"){t+=o.delta||"",(r=e==null?void 0:e.onText)==null||r.call(e,t);return}if(o.type==="TEXT_MESSAGE_REASONING"){i+=o.delta||"",(a=e==null?void 0:e.onReasoning)==null||a.call(e,i);return}if(o.type==="TEXT_MESSAGE_END"){t=t||o.message||o.delta||"",(l=e==null?void 0:e.onText)==null||l.call(e,t);return}if(o.type==="RUN_ERROR")throw new Error(o.message||"Assistant run failed.")}},e==null?void 0:e.signal),t},authorScript:async(n,e)=>{let t="",i="",s=null,o="";return await Nte("/app/scripts/generator",n,r=>{var l,c,d;const a=Dte(r);if(a){if(a.type==="TEXT_MESSAGE_CONTENT"){t+=a.delta||"",(l=e==null?void 0:e.onText)==null||l.call(e,t);return}if(a.type==="TEXT_MESSAGE_REASONING"){i+=a.delta||"",(c=e==null?void 0:e.onReasoning)==null||c.call(e,i);return}if(a.type==="TEXT_MESSAGE_END"){t=t||a.message||a.delta||"",s=a.scriptPackage||null,o=a.currentFilePath||"",(d=e==null?void 0:e.onText)==null||d.call(e,t);return}if(a.type==="RUN_ERROR")throw new Error(a.message||"Assistant run failed.")}},e==null?void 0:e.signal),{text:t,scriptPackage:s,currentFilePath:o}}},hRe={getSession:()=>Xt("/auth/me")},xl={getContext:()=>Xt("/app/context"),validateDraftScript:(n,e)=>Xt("/app/scripts/validate",{method:"POST",body:JSON.stringify(n),signal:e}),listScripts:(n=!1)=>Xt(`/app/scripts?includeSource=${n?"true":"false"}`),getScript:n=>Xt(`/app/scripts/${encodeURIComponent(n)}`),getScriptCatalog:n=>Xt(`/app/scripts/${encodeURIComponent(n)}/catalog`),listScriptRuntimes:(n=24)=>Xt(`/app/scripts/runtimes?take=${n}`),getEvolutionDecision:n=>Xt(`/app/scripts/evolutions/${encodeURIComponent(n)}`),getRuntimeReadModel:n=>Xt(`/app/scripts/runtimes/${encodeURIComponent(n)}/readmodel`),saveScript:n=>Xt("/app/scripts",{method:"POST",body:JSON.stringify(n)}),runDraftScript:n=>Xt("/app/scripts/draft-run",{method:"POST",body:JSON.stringify(n)})},uRe={getReadModel:n=>Xt(`/app/scripts/runtimes/${encodeURIComponent(n)}/readmodel`),proposeEvolution:n=>Xt("/app/scripts/evolutions/proposals",{method:"POST",body:JSON.stringify(n)})};function Tte(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=Array(e);t =n.length?n.apply(this,s):function(){for(var r=arguments.length,a=new Array(r),l=0;l 1&&arguments[1]!==void 0?arguments[1]:{};IT.initial(n),IT.handler(e);var t={current:n},i=EL(ORe)(t,e),s=EL(PRe)(t),o=EL(IT.changes)(n),r=EL(ARe)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return IT.selector(c),c(t.current)}function l(c){xRe(i,s,o,r)(c)}return[a,l]}function ARe(n,e){return XE(e)?e(n.current):e}function PRe(n,e){return n.current=Pte(Pte({},n.current),e),e}function ORe(n,e,t){return XE(e)?e(n.current):Object.keys(t).forEach(function(i){var s;return(s=e[i])===null||s===void 0?void 0:s.call(e,n.current[i])}),t}var FRe={create:MRe},BRe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function WRe(n){return function e(){for(var t=this,i=arguments.length,s=new Array(i),o=0;o=n.length?n.apply(this,s):function(){for(var r=arguments.length,a=new Array(r),l=0;l {i.current=!1}:n,e)}var Dl=cMe;function lk(){}function n0(n,e,t,i){return dMe(n,i)||hMe(n,e,t,i)}function dMe(n,e){return n.editor.getModel(Kfe(n,e))}function hMe(n,e,t,i){return n.editor.createModel(e,t,i?Kfe(n,i):void 0)}function Kfe(n,e){return n.Uri.parse(e)}function uMe({original:n,modified:e,language:t,originalLanguage:i,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:r,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:h={},height:u="100%",width:f="100%",className:g,wrapperProps:p={},beforeMount:m=lk,onMount:b=lk}){let[v,w]=$.useState(!1),[C,S]=$.useState(!0),L=$.useRef(null),x=$.useRef(null),I=$.useRef(null),E=$.useRef(b),R=$.useRef(m),M=$.useRef(!1);qfe(()=>{let B=bG.init();return B.then(V=>(x.current=V)&&S(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>L.current?P():B.cancel()}),Dl(()=>{if(L.current&&x.current){let B=L.current.getOriginalEditor(),V=n0(x.current,n||"",i||t||"text",o||"");V!==B.getModel()&&B.setModel(V)}},[o],v),Dl(()=>{if(L.current&&x.current){let B=L.current.getModifiedEditor(),V=n0(x.current,e||"",s||t||"text",r||"");V!==B.getModel()&&B.setModel(V)}},[r],v),Dl(()=>{let B=L.current.getModifiedEditor();B.getOption(x.current.editor.EditorOption.readOnly)?B.setValue(e||""):e!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[e],v),Dl(()=>{var B,V;(V=(B=L.current)==null?void 0:B.getModel())==null||V.original.setValue(n||"")},[n],v),Dl(()=>{let{original:B,modified:V}=L.current.getModel();x.current.editor.setModelLanguage(B,i||t||"text"),x.current.editor.setModelLanguage(V,s||t||"text")},[t,i,s],v),Dl(()=>{var B;(B=x.current)==null||B.editor.setTheme(c)},[c],v),Dl(()=>{var B;(B=L.current)==null||B.updateOptions(h)},[h],v);let A=$.useCallback(()=>{var K;if(!x.current)return;R.current(x.current);let B=n0(x.current,n||"",i||t||"text",o||""),V=n0(x.current,e||"",s||t||"text",r||"");(K=L.current)==null||K.setModel({original:B,modified:V})},[t,e,s,n,i,o,r]),W=$.useCallback(()=>{var B;!M.current&&I.current&&(L.current=x.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...h}),A(),(B=x.current)==null||B.editor.setTheme(c),w(!0),M.current=!0)},[h,c,A]);$.useEffect(()=>{v&&E.current(L.current,x.current)},[v]),$.useEffect(()=>{!C&&!v&&W()},[C,v,W]);function P(){var V,K,z,j;let B=(V=L.current)==null?void 0:V.getModel();a||((K=B==null?void 0:B.original)==null||K.dispose()),l||((z=B==null?void 0:B.modified)==null||z.dispose()),(j=L.current)==null||j.dispose()}return dm.createElement(Ufe,{width:f,height:u,isEditorReady:v,loading:d,_ref:I,className:g,wrapperProps:p})}var fMe=uMe;$.memo(fMe);function gMe(n){let e=$.useRef();return $.useEffect(()=>{e.current=n},[n]),e.current}var pMe=gMe,DT=new Map;function mMe({defaultValue:n,defaultLanguage:e,defaultPath:t,value:i,language:s,path:o,theme:r="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:h=!0,keepCurrentModel:u=!1,width:f="100%",height:g="100%",className:p,wrapperProps:m={},beforeMount:b=lk,onMount:v=lk,onChange:w,onValidate:C=lk}){let[S,L]=$.useState(!1),[x,I]=$.useState(!0),E=$.useRef(null),R=$.useRef(null),M=$.useRef(null),A=$.useRef(v),W=$.useRef(b),P=$.useRef(),B=$.useRef(i),V=pMe(o),K=$.useRef(!1),z=$.useRef(!1);qfe(()=>{let Y=bG.init();return Y.then(te=>(E.current=te)&&I(!1)).catch(te=>(te==null?void 0:te.type)!=="cancelation"&&console.error("Monaco initialization: error:",te)),()=>R.current?X():Y.cancel()}),Dl(()=>{var te,ce,Ce,xe;let Y=n0(E.current,n||i||"",e||s||"",o||t||"");Y!==((te=R.current)==null?void 0:te.getModel())&&(h&&DT.set(V,(ce=R.current)==null?void 0:ce.saveViewState()),(Ce=R.current)==null||Ce.setModel(Y),h&&((xe=R.current)==null||xe.restoreViewState(DT.get(o))))},[o],S),Dl(()=>{var Y;(Y=R.current)==null||Y.updateOptions(c)},[c],S),Dl(()=>{!R.current||i===void 0||(R.current.getOption(E.current.editor.EditorOption.readOnly)?R.current.setValue(i):i!==R.current.getValue()&&(z.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),R.current.pushUndoStop(),z.current=!1))},[i],S),Dl(()=>{var te,ce;let Y=(te=R.current)==null?void 0:te.getModel();Y&&s&&((ce=E.current)==null||ce.editor.setModelLanguage(Y,s))},[s],S),Dl(()=>{var Y;a!==void 0&&((Y=R.current)==null||Y.revealLine(a))},[a],S),Dl(()=>{var Y;(Y=E.current)==null||Y.editor.setTheme(r)},[r],S);let j=$.useCallback(()=>{var Y;if(!(!M.current||!E.current)&&!K.current){W.current(E.current);let te=o||t,ce=n0(E.current,i||n||"",e||s||"",te||"");R.current=(Y=E.current)==null?void 0:Y.editor.create(M.current,{model:ce,automaticLayout:!0,...c},d),h&&R.current.restoreViewState(DT.get(te)),E.current.editor.setTheme(r),a!==void 0&&R.current.revealLine(a),L(!0),K.current=!0}},[n,e,t,i,s,o,c,d,h,r,a]);$.useEffect(()=>{S&&A.current(R.current,E.current)},[S]),$.useEffect(()=>{!x&&!S&&j()},[x,S,j]),B.current=i,$.useEffect(()=>{var Y,te;S&&w&&((Y=P.current)==null||Y.dispose(),P.current=(te=R.current)==null?void 0:te.onDidChangeModelContent(ce=>{z.current||w(R.current.getValue(),ce)}))},[S,w]),$.useEffect(()=>{if(S){let Y=E.current.editor.onDidChangeMarkers(te=>{var Ce;let ce=(Ce=R.current.getModel())==null?void 0:Ce.uri;if(ce&&te.find(xe=>xe.path===ce.path)){let xe=E.current.editor.getModelMarkers({resource:ce});C==null||C(xe)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[S,C]);function X(){var Y,te;(Y=P.current)==null||Y.dispose(),u?h&&DT.set(o,R.current.saveViewState()):(te=R.current.getModel())==null||te.dispose(),R.current.dispose()}return dm.createElement(Ufe,{width:f,height:g,isEditorReady:S,loading:l,_ref:M,className:p,wrapperProps:m})}var _Me=mMe,bMe=$.memo(_Me),vMe=bMe;function wMe(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Fi(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;i t(n[i],e))}function vG(n,e){let t=0,i=n-1;for(;t<=i;){const s=(t+i)/2|0,o=e(s);if(o<0)t=s+1;else if(o>0)i=s-1;else return s}return-(t+1)}function KB(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],s=[],o=[],r=[];for(const a of e){const l=t(a,i);l<0?s.push(a):l>0?o.push(a):r.push(a)}return n!!e)}function Ote(n){let e=0;for(let t=0;t 0}function bg(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function ar(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;s e;s--)i.push(s);return i}function N5(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function l7(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function TT(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function GB(n,e){for(const t of e)n.push(t)}function SMe(n,e){const t=[];for(const i of n){const s=e(i);s!==void 0&&t.push(s)}return t}function CG(n){return Array.isArray(n)?n:[n]}function xMe(n,e,t){const i=Zfe(n,e),s=n.length,o=t.length;n.length=s+o;for(let r=s-1;r>=i;r--)n[r+o]=n[r];for(let r=0;r 0}n.isGreaterThan=i;function s(o){return o===0}n.isNeitherLessOrGreaterThan=s,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(wm||(wm={}));function co(n,e){return(t,i)=>e(n(t),n(i))}function LMe(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!wm.isNeitherLessOrGreaterThan(s))return s}return wm.neitherLessOrGreaterThan}}const ma=(n,e)=>n-e,Xfe=(n,e)=>ma(n?1:0,e?1:0);function Qfe(n){return(e,t)=>-n(e,t)}function kMe(n){return(e,t)=>e===void 0?t===void 0?wm.neitherLessOrGreaterThan:wm.lessThan:t===void 0?wm.greaterThan:n(e,t)}class vg{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t =0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const E0=class E0{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new E0(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new E0(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(s=>((i||wm.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}};E0.empty=new E0(e=>{});let yv=E0;class YM{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((s,o)=>t(e[s],e[o]));return new YM(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;t e+t,0)}class IMe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?iS.isErrorNoTelemetry(e)?new iS(e.message+` + `},Ote=WRe(jRe)(Ufe),$Re={config:VRe},URe=function(){for(var e=arguments.length,t=new Array(e),i=0;i {i.current=!1}:n,e)}var Al=hMe;function lk(){}function o0(n,e,t,i){return uMe(n,i)||fMe(n,e,t,i)}function uMe(n,e){return n.editor.getModel(Xfe(n,e))}function fMe(n,e,t,i){return n.editor.createModel(e,t,i?Xfe(n,i):void 0)}function Xfe(n,e){return n.Uri.parse(e)}function gMe({original:n,modified:e,language:t,originalLanguage:i,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:r,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:h={},height:u="100%",width:f="100%",className:g,wrapperProps:p={},beforeMount:m=lk,onMount:b=lk}){let[v,w]=$.useState(!1),[C,S]=$.useState(!0),L=$.useRef(null),x=$.useRef(null),E=$.useRef(null),I=$.useRef(b),R=$.useRef(m),M=$.useRef(!1);Zfe(()=>{let B=vG.init();return B.then(V=>(x.current=V)&&S(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>L.current?P():B.cancel()}),Al(()=>{if(L.current&&x.current){let B=L.current.getOriginalEditor(),V=o0(x.current,n||"",i||t||"text",o||"");V!==B.getModel()&&B.setModel(V)}},[o],v),Al(()=>{if(L.current&&x.current){let B=L.current.getModifiedEditor(),V=o0(x.current,e||"",s||t||"text",r||"");V!==B.getModel()&&B.setModel(V)}},[r],v),Al(()=>{let B=L.current.getModifiedEditor();B.getOption(x.current.editor.EditorOption.readOnly)?B.setValue(e||""):e!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[e],v),Al(()=>{var B,V;(V=(B=L.current)==null?void 0:B.getModel())==null||V.original.setValue(n||"")},[n],v),Al(()=>{let{original:B,modified:V}=L.current.getModel();x.current.editor.setModelLanguage(B,i||t||"text"),x.current.editor.setModelLanguage(V,s||t||"text")},[t,i,s],v),Al(()=>{var B;(B=x.current)==null||B.editor.setTheme(c)},[c],v),Al(()=>{var B;(B=L.current)==null||B.updateOptions(h)},[h],v);let A=$.useCallback(()=>{var K;if(!x.current)return;R.current(x.current);let B=o0(x.current,n||"",i||t||"text",o||""),V=o0(x.current,e||"",s||t||"text",r||"");(K=L.current)==null||K.setModel({original:B,modified:V})},[t,e,s,n,i,o,r]),W=$.useCallback(()=>{var B;!M.current&&E.current&&(L.current=x.current.editor.createDiffEditor(E.current,{automaticLayout:!0,...h}),A(),(B=x.current)==null||B.editor.setTheme(c),w(!0),M.current=!0)},[h,c,A]);$.useEffect(()=>{v&&I.current(L.current,x.current)},[v]),$.useEffect(()=>{!C&&!v&&W()},[C,v,W]);function P(){var V,K,z,j;let B=(V=L.current)==null?void 0:V.getModel();a||((K=B==null?void 0:B.original)==null||K.dispose()),l||((z=B==null?void 0:B.modified)==null||z.dispose()),(j=L.current)==null||j.dispose()}return hm.createElement(Yfe,{width:f,height:u,isEditorReady:v,loading:d,_ref:E,className:g,wrapperProps:p})}var pMe=gMe;$.memo(pMe);function mMe(n){let e=$.useRef();return $.useEffect(()=>{e.current=n},[n]),e.current}var _Me=mMe,NT=new Map;function bMe({defaultValue:n,defaultLanguage:e,defaultPath:t,value:i,language:s,path:o,theme:r="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:h=!0,keepCurrentModel:u=!1,width:f="100%",height:g="100%",className:p,wrapperProps:m={},beforeMount:b=lk,onMount:v=lk,onChange:w,onValidate:C=lk}){let[S,L]=$.useState(!1),[x,E]=$.useState(!0),I=$.useRef(null),R=$.useRef(null),M=$.useRef(null),A=$.useRef(v),W=$.useRef(b),P=$.useRef(),B=$.useRef(i),V=_Me(o),K=$.useRef(!1),z=$.useRef(!1);Zfe(()=>{let Y=vG.init();return Y.then(te=>(I.current=te)&&E(!1)).catch(te=>(te==null?void 0:te.type)!=="cancelation"&&console.error("Monaco initialization: error:",te)),()=>R.current?Q():Y.cancel()}),Al(()=>{var te,ce,Ce,xe;let Y=o0(I.current,n||i||"",e||s||"",o||t||"");Y!==((te=R.current)==null?void 0:te.getModel())&&(h&&NT.set(V,(ce=R.current)==null?void 0:ce.saveViewState()),(Ce=R.current)==null||Ce.setModel(Y),h&&((xe=R.current)==null||xe.restoreViewState(NT.get(o))))},[o],S),Al(()=>{var Y;(Y=R.current)==null||Y.updateOptions(c)},[c],S),Al(()=>{!R.current||i===void 0||(R.current.getOption(I.current.editor.EditorOption.readOnly)?R.current.setValue(i):i!==R.current.getValue()&&(z.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),R.current.pushUndoStop(),z.current=!1))},[i],S),Al(()=>{var te,ce;let Y=(te=R.current)==null?void 0:te.getModel();Y&&s&&((ce=I.current)==null||ce.editor.setModelLanguage(Y,s))},[s],S),Al(()=>{var Y;a!==void 0&&((Y=R.current)==null||Y.revealLine(a))},[a],S),Al(()=>{var Y;(Y=I.current)==null||Y.editor.setTheme(r)},[r],S);let j=$.useCallback(()=>{var Y;if(!(!M.current||!I.current)&&!K.current){W.current(I.current);let te=o||t,ce=o0(I.current,i||n||"",e||s||"",te||"");R.current=(Y=I.current)==null?void 0:Y.editor.create(M.current,{model:ce,automaticLayout:!0,...c},d),h&&R.current.restoreViewState(NT.get(te)),I.current.editor.setTheme(r),a!==void 0&&R.current.revealLine(a),L(!0),K.current=!0}},[n,e,t,i,s,o,c,d,h,r,a]);$.useEffect(()=>{S&&A.current(R.current,I.current)},[S]),$.useEffect(()=>{!x&&!S&&j()},[x,S,j]),B.current=i,$.useEffect(()=>{var Y,te;S&&w&&((Y=P.current)==null||Y.dispose(),P.current=(te=R.current)==null?void 0:te.onDidChangeModelContent(ce=>{z.current||w(R.current.getValue(),ce)}))},[S,w]),$.useEffect(()=>{if(S){let Y=I.current.editor.onDidChangeMarkers(te=>{var Ce;let ce=(Ce=R.current.getModel())==null?void 0:Ce.uri;if(ce&&te.find(xe=>xe.path===ce.path)){let xe=I.current.editor.getModelMarkers({resource:ce});C==null||C(xe)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[S,C]);function Q(){var Y,te;(Y=P.current)==null||Y.dispose(),u?h&&NT.set(o,R.current.saveViewState()):(te=R.current.getModel())==null||te.dispose(),R.current.dispose()}return hm.createElement(Yfe,{width:f,height:g,isEditorReady:S,loading:l,_ref:M,className:p,wrapperProps:m})}var vMe=bMe,wMe=$.memo(vMe),CMe=wMe;function yMe(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Bi(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;i t(n[i],e))}function wG(n,e){let t=0,i=n-1;for(;t<=i;){const s=(t+i)/2|0,o=e(s);if(o<0)t=s+1;else if(o>0)i=s-1;else return s}return-(t+1)}function GB(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],s=[],o=[],r=[];for(const a of e){const l=t(a,i);l<0?s.push(a):l>0?o.push(a):r.push(a)}return n!!e)}function Bte(n){let e=0;for(let t=0;t 0}function bg(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function or(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;s e;s--)i.push(s);return i}function N5(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function l7(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function DT(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function YB(n,e){for(const t of e)n.push(t)}function LMe(n,e){const t=[];for(const i of n){const s=e(i);s!==void 0&&t.push(s)}return t}function yG(n){return Array.isArray(n)?n:[n]}function kMe(n,e,t){const i=ege(n,e),s=n.length,o=t.length;n.length=s+o;for(let r=s-1;r>=i;r--)n[r+o]=n[r];for(let r=0;r 0}n.isGreaterThan=i;function s(o){return o===0}n.isNeitherLessOrGreaterThan=s,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(Cm||(Cm={}));function lo(n,e){return(t,i)=>e(n(t),n(i))}function EMe(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!Cm.isNeitherLessOrGreaterThan(s))return s}return Cm.neitherLessOrGreaterThan}}const pa=(n,e)=>n-e,tge=(n,e)=>pa(n?1:0,e?1:0);function ige(n){return(e,t)=>-n(e,t)}function IMe(n){return(e,t)=>e===void 0?t===void 0?Cm.neitherLessOrGreaterThan:Cm.lessThan:t===void 0?Cm.greaterThan:n(e,t)}class vg{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t =0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const D0=class D0{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new D0(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new D0(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(s=>((i||Cm.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}};D0.empty=new D0(e=>{});let Lv=D0;class YM{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((s,o)=>t(e[s],e[o]));return new YM(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;t e+t,0)}class NMe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?sS.isErrorNoTelemetry(e)?new sS(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const yG=new IMe;function XM(n){yG.onUnexpectedError(n)}function Je(n){fl(n)||yG.onUnexpectedError(n)}function On(n){fl(n)||yG.onUnexpectedExternalError(n)}function YB(n){if(n instanceof Error){const{name:e,message:t,cause:i}=n,s=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:s,noTelemetry:iS.isErrorNoTelemetry(n),cause:i?YB(i):void 0,code:n.code}}return n}const QM="Canceled";function fl(n){return n instanceof Ql?!0:n instanceof Error&&n.name===QM&&n.message===QM}class Ql extends Error{constructor(){super(QM),this.name=this.message}}function EMe(){const n=new Error(QM);return n.name=n.message,n}function ql(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function JM(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class NMe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class iS extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof iS)return e;const t=new iS;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Ve extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Ve.prototype)}}function c7(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function iD(n,e="Unreachable"){throw new Error(e)}function QI(n,e="unexpected state"){if(!n)throw typeof e=="string"?new Ve(`Assertion Failed: ${e}`):e}function Fte(n,e="Soft Assertion Failed"){n||Je(new Ve(e))}function Xm(n){if(!n()){debugger;n(),Je(new Ve("Assertion Failed"))}}function nD(n,e){let t=0;for(;t "u"}function Ts(n){return!Ol(n)}function Ol(n){return Lo(n)||n===null}function Ft(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function qp(n){return QI(n!=null,"Argument is `undefined` or `null`."),n}function U1(n){return typeof n=="function"}function RMe(n,e){const t=Math.min(n.length,e.length);for(let i=0;i {e[t]=i&&typeof i=="object"?$h(i):i}),e}function AMe(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(Jfe.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!TMe(s)&&e.push(s)}}return n}const Jfe=Object.prototype.hasOwnProperty;function ege(n,e){return QB(n,e,new Set)}function QB(n,e,t){if(Ol(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const o of n)s.push(QB(o,e,t));return s}if(os(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)Jfe.call(n,o)&&(s[o]=QB(n[o],e,t));return t.delete(n),s}return n}function D5(n,e,t=!0){return os(n)?(os(e)&&Object.keys(e).forEach(i=>{i in n?t&&(os(n[i])&&os(e[i])?D5(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function _a(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t =0;function eA(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,s)=>{const o=s[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),PMe&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function _(n,e,...t){return eA(typeof n=="number"?ige(n,e):e,t)}function ige(n,e){var i;const t=(i=tge())==null?void 0:i[n];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${n} !!!`)}return t}function ie(n,e,...t){let i;typeof n=="number"?i=ige(n,e):i=e;const s=eA(i,t);return{value:s,original:e===i?s:eA(e,t)}}const tv="en";let JI=!1,eE=!1,ck=!1,nge=!1,xG=!1,LG=!1,sge=!1,RT,SR=tv,Bte=tv,OMe,fd;const ng=globalThis;let Wo;var Dce;typeof ng.vscode<"u"&&typeof ng.vscode.process<"u"?Wo=ng.vscode.process:typeof process<"u"&&typeof((Dce=process==null?void 0:process.versions)==null?void 0:Dce.node)=="string"&&(Wo=process);var Tce;const FMe=typeof((Tce=Wo==null?void 0:Wo.versions)==null?void 0:Tce.electron)=="string",BMe=FMe&&(Wo==null?void 0:Wo.type)==="renderer";var Rce;if(typeof Wo=="object"){JI=Wo.platform==="win32",eE=Wo.platform==="darwin",ck=Wo.platform==="linux",ck&&Wo.env.SNAP&&Wo.env.SNAP_REVISION,Wo.env.CI||Wo.env.BUILD_ARTIFACTSTAGINGDIRECTORY||Wo.env.GITHUB_WORKSPACE,RT=tv,SR=tv;const n=Wo.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n);RT=e.userLocale,Bte=e.osLocale,SR=e.resolvedLanguage||tv,OMe=(Rce=e.languagePack)==null?void 0:Rce.translationsConfigFile}catch{}nge=!0}else typeof navigator=="object"&&!BMe?(fd=navigator.userAgent,JI=fd.indexOf("Windows")>=0,eE=fd.indexOf("Macintosh")>=0,LG=(fd.indexOf("Macintosh")>=0||fd.indexOf("iPad")>=0||fd.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ck=fd.indexOf("Linux")>=0,sge=(fd==null?void 0:fd.indexOf("Mobi"))>=0,xG=!0,SR=SG()||tv,RT=navigator.language.toLowerCase(),Bte=RT):console.error("Unable to resolve platform.");let xR=0;eE?xR=1:JI?xR=3:ck&&(xR=2);const $s=JI,yt=eE,Ur=ck,Xd=nge,Tu=xG,WMe=xG&&typeof ng.importScripts=="function",HMe=WMe?ng.origin:void 0,Jl=LG,oge=sge,d7=xR,vu=fd,VMe=SR,zMe=typeof ng.postMessage=="function"&&!ng.importScripts,sD=(()=>{if(zMe){const n=[];ng.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=n.length;i {const i=++e;n.push({id:i,callback:t}),ng.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),ua=eE||LG?2:JI?1:3;let Wte=!0,Hte=!1;function rge(){if(!Hte){Hte=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,Wte=new Uint16Array(n.buffer)[0]===513}return Wte}const kG=!!(vu&&vu.indexOf("Chrome")>=0),jMe=!!(vu&&vu.indexOf("Firefox")>=0),$Me=!!(!kG&&vu&&vu.indexOf("Safari")>=0),age=!!(vu&&vu.indexOf("Edg/")>=0),UMe=!!(vu&&vu.indexOf("Android")>=0);function q1(n,e){const t=this;let i=!1,s;return function(){return i||(i=!0,s=n.apply(t,arguments)),s}}var Dt;(function(n){function e(x){return!!x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(x){yield x}n.single=s;function o(x){return e(x)?x:s(x)}n.wrap=o;function r(x){return x||t}n.from=r;function*a(x){for(let I=x.length-1;I>=0;I--)yield x[I]}n.reverse=a;function l(x){return!x||x[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(x){return x[Symbol.iterator]().next().value}n.first=c;function d(x,I){let E=0;for(const R of x)if(I(R,E++))return!0;return!1}n.some=d;function h(x,I){let E=0;for(const R of x)if(!I(R,E++))return!1;return!0}n.every=h;function u(x,I){for(const E of x)if(I(E))return E}n.find=u;function*f(x,I){for(const E of x)I(E)&&(yield E)}n.filter=f;function*g(x,I){let E=0;for(const R of x)yield I(R,E++)}n.map=g;function*p(x,I){let E=0;for(const R of x)yield*I(R,E++)}n.flatMap=p;function*m(...x){for(const I of x)ZB(I)?yield*I:yield I}n.concat=m;function b(x,I,E){let R=E;for(const M of x)R=I(R,M);return R}n.reduce=b;function v(x){let I=0;for(const E of x)I++;return I}n.length=v;function*w(x,I,E=x.length){for(I<-x.length&&(I=0),I<0&&(I+=x.length),E<0?E+=x.length:E>x.length&&(E=x.length);I1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function Vc(...n){return Re(()=>ei(n))}class qMe{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function Re(n){return new qMe(n)}const f4=class f4{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ei(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===G.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?f4.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};f4.DISABLE_DISPOSED_WARNING=!1;let ne=f4;const mQ=class mQ{constructor(){this._store=new ne,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};mQ.None=Object.freeze({dispose(){}});let G=mQ;class Gt{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}}class KMe{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class GMe{constructor(e){this.object=e}dispose(){}}class T5{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ei(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var s;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(s=this._store.get(e))==null||s.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))==null||t.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}var Yf;let gs=(Yf=class{constructor(e){this.element=e,this.next=Yf.Undefined,this.prev=Yf.Undefined}},Yf.Undefined=new Yf(void 0),Yf);class qo{constructor(){this._first=gs.Undefined,this._last=gs.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===gs.Undefined}clear(){let e=this._first;for(;e!==gs.Undefined;){const t=e.next;e.prev=gs.Undefined,e.next=gs.Undefined,e=t}this._first=gs.Undefined,this._last=gs.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new gs(e);if(this._first===gs.Undefined)this._first=i,this._last=i;else if(t){const o=this._last;this._last=i,i.prev=o,o.next=i}else{const o=this._first;this._first=i,i.next=o,o.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==gs.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==gs.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==gs.Undefined&&e.next!==gs.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===gs.Undefined&&e.next===gs.Undefined?(this._first=gs.Undefined,this._last=gs.Undefined):e.next===gs.Undefined?(this._last=this._last.prev,this._last.next=gs.Undefined):e.prev===gs.Undefined&&(this._first=this._first.next,this._first.prev=gs.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==gs.Undefined;)yield e.element,e=e.next}}const YMe=globalThis.performance.now.bind(globalThis.performance);class Ls{static create(e){return new Ls(e)}constructor(e){this._now=e===!1?Date.now:YMe,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var ve;(function(n){n.None=()=>G.None;function e(A,W){return u(A,()=>{},0,void 0,!0,void 0,W)}n.defer=e;function t(A){return(W,P=null,B)=>{let V=!1,K;return K=A(z=>{if(!V)return K?K.dispose():V=!0,W.call(P,z)},null,B),V&&K.dispose(),K}}n.once=t;function i(A,W){return n.once(n.filter(A,W))}n.onceIf=i;function s(A,W,P){return d((B,V=null,K)=>A(z=>B.call(V,W(z)),null,K),P)}n.map=s;function o(A,W,P){return d((B,V=null,K)=>A(z=>{W(z),B.call(V,z)},null,K),P)}n.forEach=o;function r(A,W,P){return d((B,V=null,K)=>A(z=>W(z)&&B.call(V,z),null,K),P)}n.filter=r;function a(A){return A}n.signal=a;function l(...A){return(W,P=null,B)=>{const V=Vc(...A.map(K=>K(z=>W.call(P,z))));return h(V,B)}}n.any=l;function c(A,W,P,B){let V=P;return s(A,K=>(V=W(V,K),V),B)}n.reduce=c;function d(A,W){let P;const B={onWillAddFirstListener(){P=A(V.fire,V)},onDidRemoveLastListener(){P==null||P.dispose()}},V=new q(B);return W==null||W.add(V),V.event}function h(A,W){return W instanceof Array?W.push(A):W&&W.add(A),A}function u(A,W,P=100,B=!1,V=!1,K,z){let j,X,Y,te=0,ce;const Ce={leakWarningThreshold:K,onWillAddFirstListener(){j=A(Be=>{te++,X=W(X,Be),B&&!Y&&(xe.fire(X),X=void 0),ce=()=>{const Ee=X;X=void 0,Y=void 0,(!B||te>1)&&xe.fire(Ee),te=0},typeof P=="number"?(Y&&clearTimeout(Y),Y=setTimeout(ce,P)):Y===void 0&&(Y=null,queueMicrotask(ce))})},onWillRemoveListener(){V&&te>0&&(ce==null||ce())},onDidRemoveLastListener(){ce=void 0,j.dispose()}},xe=new q(Ce);return z==null||z.add(xe),xe.event}n.debounce=u;function f(A,W=0,P){return n.debounce(A,(B,V)=>B?(B.push(V),B):[V],W,void 0,!0,void 0,P)}n.accumulate=f;function g(A,W=(B,V)=>B===V,P){let B=!0,V;return r(A,K=>{const z=B||!W(K,V);return B=!1,V=K,z},P)}n.latch=g;function p(A,W,P){return[n.filter(A,W,P),n.filter(A,B=>!W(B),P)]}n.split=p;function m(A,W=!1,P=[],B){let V=P.slice(),K=A(X=>{V?V.push(X):j.fire(X)});B&&B.add(K);const z=()=>{V==null||V.forEach(X=>j.fire(X)),V=null},j=new q({onWillAddFirstListener(){K||(K=A(X=>j.fire(X)),B&&B.add(K))},onDidAddFirstListener(){V&&(W?setTimeout(z):z())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return B&&B.add(j),j.event}n.buffer=m;function b(A,W){return(B,V,K)=>{const z=W(new w);return A(function(j){const X=z.evaluate(j);X!==v&&B.call(V,X)},void 0,K)}}n.chain=b;const v=Symbol("HaltChainable");class w{constructor(){this.steps=[]}map(W){return this.steps.push(W),this}forEach(W){return this.steps.push(P=>(W(P),P)),this}filter(W){return this.steps.push(P=>W(P)?P:v),this}reduce(W,P){let B=P;return this.steps.push(V=>(B=W(B,V),B)),this}latch(W=(P,B)=>P===B){let P=!0,B;return this.steps.push(V=>{const K=P||!W(V,B);return P=!1,B=V,K?V:v}),this}evaluate(W){for(const P of this.steps)if(W=P(W),W===v)break;return W}}function C(A,W,P=B=>B){const B=(...j)=>z.fire(P(...j)),V=()=>A.on(W,B),K=()=>A.removeListener(W,B),z=new q({onWillAddFirstListener:V,onDidRemoveLastListener:K});return z.event}n.fromNodeEventEmitter=C;function S(A,W,P=B=>B){const B=(...j)=>z.fire(P(...j)),V=()=>A.addEventListener(W,B),K=()=>A.removeEventListener(W,B),z=new q({onWillAddFirstListener:V,onDidRemoveLastListener:K});return z.event}n.fromDOMEventEmitter=S;function L(A,W){let P;const B=new Promise((V,K)=>{const z=t(A)(V,null,W);P=()=>z.dispose()});return B.cancel=P,B}n.toPromise=L;function x(A,W){return A(P=>W.fire(P))}n.forward=x;function I(A,W,P){return W(P),A(B=>W(B))}n.runAndSubscribe=I;class E{constructor(W,P){this._observable=W,this._counter=0,this._hasChanged=!1;const B={onWillAddFirstListener:()=>{W.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{W.removeObserver(this)}};this.emitter=new q(B),P&&P.add(this.emitter)}beginUpdate(W){this._counter++}handlePossibleChange(W){}handleChange(W,P){this._hasChanged=!0}endUpdate(W){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(A,W){return new E(A,W).emitter.event}n.fromObservable=R;function M(A){return(W,P,B)=>{let V=0,K=!1;const z={beginUpdate(){V++},endUpdate(){V--,V===0&&(A.reportChanges(),K&&(K=!1,W.call(P)))},handlePossibleChange(){},handleChange(){K=!0}};A.addObserver(z),A.reportChanges();const j={dispose(){A.removeObserver(z)}};return B instanceof ne?B.add(j):Array.isArray(B)&&B.push(j),j}}n.fromObservableLight=M})(ve||(ve={}));const N0=class N0{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${N0._idPool++}`,N0.all.add(this)}start(e){this._stopWatch=new Ls,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};N0.all=new Set,N0._idPool=0;let JB=N0,ZMe=-1;const g4=class g4{constructor(e,t,i=(g4._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,s]of this._stacks)(!e||t {t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const SG=new NMe;function XM(n){SG.onUnexpectedError(n)}function Je(n){fl(n)||SG.onUnexpectedError(n)}function Bn(n){fl(n)||SG.onUnexpectedExternalError(n)}function ZB(n){if(n instanceof Error){const{name:e,message:t,cause:i}=n,s=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:s,noTelemetry:sS.isErrorNoTelemetry(n),cause:i?ZB(i):void 0,code:n.code}}return n}const QM="Canceled";function fl(n){return n instanceof ic?!0:n instanceof Error&&n.name===QM&&n.message===QM}class ic extends Error{constructor(){super(QM),this.name=this.message}}function DMe(){const n=new Error(QM);return n.name=n.message,n}function Zl(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function JM(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class TMe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class sS extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof sS)return e;const t=new sS;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class ze extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,ze.prototype)}}function c7(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function iD(n,e="Unreachable"){throw new Error(e)}function QE(n,e="unexpected state"){if(!n)throw typeof e=="string"?new ze(`Assertion Failed: ${e}`):e}function Wte(n,e="Soft Assertion Failed"){n||Je(new ze(e))}function Qm(n){if(!n()){debugger;n(),Je(new ze("Assertion Failed"))}}function nD(n,e){let t=0;for(;t"u"}function Ts(n){return!Hl(n)}function Hl(n){return ko(n)||n===null}function Ot(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Kp(n){return QE(n!=null,"Argument is `undefined` or `null`."),n}function G1(n){return typeof n=="function"}function AMe(n,e){const t=Math.min(n.length,e.length);for(let i=0;i {e[t]=i&&typeof i=="object"?jh(i):i}),e}function OMe(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(nge.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!MMe(s)&&e.push(s)}}return n}const nge=Object.prototype.hasOwnProperty;function sge(n,e){return JB(n,e,new Set)}function JB(n,e,t){if(Hl(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const o of n)s.push(JB(o,e,t));return s}if(ns(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)nge.call(n,o)&&(s[o]=JB(n[o],e,t));return t.delete(n),s}return n}function D5(n,e,t=!0){return ns(n)?(ns(e)&&Object.keys(e).forEach(i=>{i in n?t&&(ns(n[i])&&ns(e[i])?D5(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function ma(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t =0;function eA(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,s)=>{const o=s[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),FMe&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function _(n,e,...t){return eA(typeof n=="number"?rge(n,e):e,t)}function rge(n,e){var i;const t=(i=oge())==null?void 0:i[n];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${n} !!!`)}return t}function ie(n,e,...t){let i;typeof n=="number"?i=rge(n,e):i=e;const s=eA(i,t);return{value:s,original:e===i?s:eA(e,t)}}const sv="en";let JE=!1,eI=!1,ck=!1,age=!1,LG=!1,kG=!1,lge=!1,TT,yR=sv,Hte=sv,BMe,hd;const ng=globalThis;let Bo;var Mce;typeof ng.vscode<"u"&&typeof ng.vscode.process<"u"?Bo=ng.vscode.process:typeof process<"u"&&typeof((Mce=process==null?void 0:process.versions)==null?void 0:Mce.node)=="string"&&(Bo=process);var Ace;const WMe=typeof((Ace=Bo==null?void 0:Bo.versions)==null?void 0:Ace.electron)=="string",HMe=WMe&&(Bo==null?void 0:Bo.type)==="renderer";var Pce;if(typeof Bo=="object"){JE=Bo.platform==="win32",eI=Bo.platform==="darwin",ck=Bo.platform==="linux",ck&&Bo.env.SNAP&&Bo.env.SNAP_REVISION,Bo.env.CI||Bo.env.BUILD_ARTIFACTSTAGINGDIRECTORY||Bo.env.GITHUB_WORKSPACE,TT=sv,yR=sv;const n=Bo.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n);TT=e.userLocale,Hte=e.osLocale,yR=e.resolvedLanguage||sv,BMe=(Pce=e.languagePack)==null?void 0:Pce.translationsConfigFile}catch{}age=!0}else typeof navigator=="object"&&!HMe?(hd=navigator.userAgent,JE=hd.indexOf("Windows")>=0,eI=hd.indexOf("Macintosh")>=0,kG=(hd.indexOf("Macintosh")>=0||hd.indexOf("iPad")>=0||hd.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ck=hd.indexOf("Linux")>=0,lge=(hd==null?void 0:hd.indexOf("Mobi"))>=0,LG=!0,yR=xG()||sv,TT=navigator.language.toLowerCase(),Hte=TT):console.error("Unable to resolve platform.");let SR=0;eI?SR=1:JE?SR=3:ck&&(SR=2);const $s=JE,wt=eI,jr=ck,Yd=age,Du=LG,VMe=LG&&typeof ng.importScripts=="function",zMe=VMe?ng.origin:void 0,nc=kG,cge=lge,d7=SR,bu=hd,jMe=yR,$Me=typeof ng.postMessage=="function"&&!ng.importScripts,sD=(()=>{if($Me){const n=[];ng.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=n.length;i {const i=++e;n.push({id:i,callback:t}),ng.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),ha=eI||kG?2:JE?1:3;let Vte=!0,zte=!1;function dge(){if(!zte){zte=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,Vte=new Uint16Array(n.buffer)[0]===513}return Vte}const EG=!!(bu&&bu.indexOf("Chrome")>=0),UMe=!!(bu&&bu.indexOf("Firefox")>=0),qMe=!!(!EG&&bu&&bu.indexOf("Safari")>=0),hge=!!(bu&&bu.indexOf("Edg/")>=0),KMe=!!(bu&&bu.indexOf("Android")>=0);function Y1(n,e){const t=this;let i=!1,s;return function(){return i||(i=!0,s=n.apply(t,arguments)),s}}var Nt;(function(n){function e(x){return!!x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(x){yield x}n.single=s;function o(x){return e(x)?x:s(x)}n.wrap=o;function r(x){return x||t}n.from=r;function*a(x){for(let E=x.length-1;E>=0;E--)yield x[E]}n.reverse=a;function l(x){return!x||x[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(x){return x[Symbol.iterator]().next().value}n.first=c;function d(x,E){let I=0;for(const R of x)if(E(R,I++))return!0;return!1}n.some=d;function h(x,E){let I=0;for(const R of x)if(!E(R,I++))return!1;return!0}n.every=h;function u(x,E){for(const I of x)if(E(I))return I}n.find=u;function*f(x,E){for(const I of x)E(I)&&(yield I)}n.filter=f;function*g(x,E){let I=0;for(const R of x)yield E(R,I++)}n.map=g;function*p(x,E){let I=0;for(const R of x)yield*E(R,I++)}n.flatMap=p;function*m(...x){for(const E of x)XB(E)?yield*E:yield E}n.concat=m;function b(x,E,I){let R=I;for(const M of x)R=E(R,M);return R}n.reduce=b;function v(x){let E=0;for(const I of x)E++;return E}n.length=v;function*w(x,E,I=x.length){for(E<-x.length&&(E=0),E<0&&(E+=x.length),I<0?I+=x.length:I>x.length&&(I=x.length);E1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function Hc(...n){return Re(()=>Jt(n))}class GMe{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function Re(n){return new GMe(n)}const f4=class f4{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Jt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===G.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?f4.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};f4.DISABLE_DISPOSED_WARNING=!1;let ne=f4;const _Q=class _Q{constructor(){this._store=new ne,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};_Q.None=Object.freeze({dispose(){}});let G=_Q;class Kt{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}}class YMe{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class ZMe{constructor(e){this.object=e}dispose(){}}class T5{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Jt(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var s;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(s=this._store.get(e))==null||s.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))==null||t.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}var Yf;let fs=(Yf=class{constructor(e){this.element=e,this.next=Yf.Undefined,this.prev=Yf.Undefined}},Yf.Undefined=new Yf(void 0),Yf);class Uo{constructor(){this._first=fs.Undefined,this._last=fs.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===fs.Undefined}clear(){let e=this._first;for(;e!==fs.Undefined;){const t=e.next;e.prev=fs.Undefined,e.next=fs.Undefined,e=t}this._first=fs.Undefined,this._last=fs.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new fs(e);if(this._first===fs.Undefined)this._first=i,this._last=i;else if(t){const o=this._last;this._last=i,i.prev=o,o.next=i}else{const o=this._first;this._first=i,i.next=o,o.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==fs.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==fs.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==fs.Undefined&&e.next!==fs.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===fs.Undefined&&e.next===fs.Undefined?(this._first=fs.Undefined,this._last=fs.Undefined):e.next===fs.Undefined?(this._last=this._last.prev,this._last.next=fs.Undefined):e.prev===fs.Undefined&&(this._first=this._first.next,this._first.prev=fs.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==fs.Undefined;)yield e.element,e=e.next}}const XMe=globalThis.performance.now.bind(globalThis.performance);class xs{static create(e){return new xs(e)}constructor(e){this._now=e===!1?Date.now:XMe,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var ve;(function(n){n.None=()=>G.None;function e(A,W){return u(A,()=>{},0,void 0,!0,void 0,W)}n.defer=e;function t(A){return(W,P=null,B)=>{let V=!1,K;return K=A(z=>{if(!V)return K?K.dispose():V=!0,W.call(P,z)},null,B),V&&K.dispose(),K}}n.once=t;function i(A,W){return n.once(n.filter(A,W))}n.onceIf=i;function s(A,W,P){return d((B,V=null,K)=>A(z=>B.call(V,W(z)),null,K),P)}n.map=s;function o(A,W,P){return d((B,V=null,K)=>A(z=>{W(z),B.call(V,z)},null,K),P)}n.forEach=o;function r(A,W,P){return d((B,V=null,K)=>A(z=>W(z)&&B.call(V,z),null,K),P)}n.filter=r;function a(A){return A}n.signal=a;function l(...A){return(W,P=null,B)=>{const V=Hc(...A.map(K=>K(z=>W.call(P,z))));return h(V,B)}}n.any=l;function c(A,W,P,B){let V=P;return s(A,K=>(V=W(V,K),V),B)}n.reduce=c;function d(A,W){let P;const B={onWillAddFirstListener(){P=A(V.fire,V)},onDidRemoveLastListener(){P==null||P.dispose()}},V=new q(B);return W==null||W.add(V),V.event}function h(A,W){return W instanceof Array?W.push(A):W&&W.add(A),A}function u(A,W,P=100,B=!1,V=!1,K,z){let j,Q,Y,te=0,ce;const Ce={leakWarningThreshold:K,onWillAddFirstListener(){j=A(je=>{te++,Q=W(Q,je),B&&!Y&&(xe.fire(Q),Q=void 0),ce=()=>{const ke=Q;Q=void 0,Y=void 0,(!B||te>1)&&xe.fire(ke),te=0},typeof P=="number"?(Y&&clearTimeout(Y),Y=setTimeout(ce,P)):Y===void 0&&(Y=null,queueMicrotask(ce))})},onWillRemoveListener(){V&&te>0&&(ce==null||ce())},onDidRemoveLastListener(){ce=void 0,j.dispose()}},xe=new q(Ce);return z==null||z.add(xe),xe.event}n.debounce=u;function f(A,W=0,P){return n.debounce(A,(B,V)=>B?(B.push(V),B):[V],W,void 0,!0,void 0,P)}n.accumulate=f;function g(A,W=(B,V)=>B===V,P){let B=!0,V;return r(A,K=>{const z=B||!W(K,V);return B=!1,V=K,z},P)}n.latch=g;function p(A,W,P){return[n.filter(A,W,P),n.filter(A,B=>!W(B),P)]}n.split=p;function m(A,W=!1,P=[],B){let V=P.slice(),K=A(Q=>{V?V.push(Q):j.fire(Q)});B&&B.add(K);const z=()=>{V==null||V.forEach(Q=>j.fire(Q)),V=null},j=new q({onWillAddFirstListener(){K||(K=A(Q=>j.fire(Q)),B&&B.add(K))},onDidAddFirstListener(){V&&(W?setTimeout(z):z())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return B&&B.add(j),j.event}n.buffer=m;function b(A,W){return(B,V,K)=>{const z=W(new w);return A(function(j){const Q=z.evaluate(j);Q!==v&&B.call(V,Q)},void 0,K)}}n.chain=b;const v=Symbol("HaltChainable");class w{constructor(){this.steps=[]}map(W){return this.steps.push(W),this}forEach(W){return this.steps.push(P=>(W(P),P)),this}filter(W){return this.steps.push(P=>W(P)?P:v),this}reduce(W,P){let B=P;return this.steps.push(V=>(B=W(B,V),B)),this}latch(W=(P,B)=>P===B){let P=!0,B;return this.steps.push(V=>{const K=P||!W(V,B);return P=!1,B=V,K?V:v}),this}evaluate(W){for(const P of this.steps)if(W=P(W),W===v)break;return W}}function C(A,W,P=B=>B){const B=(...j)=>z.fire(P(...j)),V=()=>A.on(W,B),K=()=>A.removeListener(W,B),z=new q({onWillAddFirstListener:V,onDidRemoveLastListener:K});return z.event}n.fromNodeEventEmitter=C;function S(A,W,P=B=>B){const B=(...j)=>z.fire(P(...j)),V=()=>A.addEventListener(W,B),K=()=>A.removeEventListener(W,B),z=new q({onWillAddFirstListener:V,onDidRemoveLastListener:K});return z.event}n.fromDOMEventEmitter=S;function L(A,W){let P;const B=new Promise((V,K)=>{const z=t(A)(V,null,W);P=()=>z.dispose()});return B.cancel=P,B}n.toPromise=L;function x(A,W){return A(P=>W.fire(P))}n.forward=x;function E(A,W,P){return W(P),A(B=>W(B))}n.runAndSubscribe=E;class I{constructor(W,P){this._observable=W,this._counter=0,this._hasChanged=!1;const B={onWillAddFirstListener:()=>{W.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{W.removeObserver(this)}};this.emitter=new q(B),P&&P.add(this.emitter)}beginUpdate(W){this._counter++}handlePossibleChange(W){}handleChange(W,P){this._hasChanged=!0}endUpdate(W){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(A,W){return new I(A,W).emitter.event}n.fromObservable=R;function M(A){return(W,P,B)=>{let V=0,K=!1;const z={beginUpdate(){V++},endUpdate(){V--,V===0&&(A.reportChanges(),K&&(K=!1,W.call(P)))},handlePossibleChange(){},handleChange(){K=!0}};A.addObserver(z),A.reportChanges();const j={dispose(){A.removeObserver(z)}};return B instanceof ne?B.add(j):Array.isArray(B)&&B.push(j),j}}n.fromObservableLight=M})(ve||(ve={}));const T0=class T0{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${T0._idPool++}`,T0.all.add(this)}start(e){this._stopWatch=new xs,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};T0.all=new Set,T0._idPool=0;let eW=T0,QMe=-1;const g4=class g4{constructor(e,t,i=(g4._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,s]of this._stacks)(!e||t{var a,l,c,d,h,u,f;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);const p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new QMe(`${g}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((a=this._options)==null?void 0:a.onListenerError)||Je)(m),G.None}if(this._disposed)return G.None;t&&(e=e.bind(t));const s=new h7(e);let o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=IG.create(),o=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof h7?(this._deliveryQueue??(this._deliveryQueue=new lge),this._listeners=[this._listeners,s]):this._listeners.push(s):((c=(l=this._options)==null?void 0:l.onWillAddFirstListener)==null||c.call(l,this),this._listeners=s,(h=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||h.call(d,this)),(f=(u=this._options)==null?void 0:u.onDidAddListener)==null||f.call(u,this),this._size++;const r=Re(()=>{o==null||o(),this._removeListener(s)});return i instanceof ne?i.add(r):Array.isArray(i)&&i.push(r),r}),this._event}_removeListener(e){var o,r,a,l;if((r=(o=this._options)==null?void 0:o.onWillRemoveListener)==null||r.call(o,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(l=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||l.call(a,this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const s=this._deliveryQueue.current===this;if(this._size*JMe<=t.length){let c=0;for(let d=0;d0}};const eAe=()=>new lge;class lge{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class K1 extends q{constructor(e){super(e),this._isPaused=0,this._eventQueue=new qo,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class cge extends K1{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class tAe extends q{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class iAe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new q({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Re(q1(()=>{this.hasListeners&&this.unhook(t);const s=this.events.indexOf(t);this.events.splice(s,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){var t;(t=e.listener)==null||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)==null||e.dispose();this.events=[]}}class oD{constructor(){this.data=[]}wrapEvent(e,t,i){return(s,o,r)=>e(a=>{const l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>s.call(o,a)):s.call(o,a);return}const c=l;if(!c){s.call(o,t(i,a));return}c.items??(c.items=[]),c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??(c.reducedResult=i?c.items.reduce(t,i):c.items.reduce(t)),s.call(o,c.reducedResult)})},void 0,r)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach(s=>s()),i}}class Bx{constructor(){this.listening=!1,this.inputEvent=ve.None,this.inputEventListener=G.None,this.emitter=new q({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const Fl=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(n){n=Math.min(Math.max(-5,n),20),this._zoomLevel!==n&&(this._zoomLevel=n,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},nAe=yt?1.5:1.35,u7=8;class G1{static _create(e,t,i,s,o,r,a,l,c){r===0?r=nAe*i:r /?";function lAe(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of iA)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const EG=lAe();function NG(n){let e=EG;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const uge=new qo;uge.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function tE(n,e,t,i,s){if(e=NG(e),s||(s=Dt.first(uge)),t.length>s.maxLen){let c=n-s.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+s.maxLen/2),tE(n,e,t,i,s)}const o=Date.now(),r=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=s.timeBudget);c++){const d=r-s.windowSize*c;e.lastIndex=Math.max(0,d);const h=cAe(e,t,r,a);if(!h&&l||(l=h,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function cAe(n,e,t,i){let s;for(;s=n.exec(e);){const o=s.index||0;if(o<=t&&n.lastIndex>=t)return s;if(i>0&&o>i)return null}return null}const kh=8;class fge{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class gge{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class ji{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return R5(e,t)}compute(e,t,i){return i}}class dk{constructor(e,t){this.newValue=e,this.didChange=t}}function R5(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new dk(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Fi(n,e);return new dk(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=R5(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new dk(n,t)}class __{constructor(e,t){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=t}applyUpdate(e,t){return R5(e,t)}validate(e){return this.defaultValue}}class $S{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return R5(e,t)}compute(e,t,i){return i}}function Fe(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class vt extends $S{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return Fe(e,this.defaultValue)}}function Lf(n,e,t,i){if(typeof n=="string"&&(n=parseInt(n,10)),typeof n!="number"||isNaN(n))return e;let s=n;return s=Math.max(t,s),s=Math.min(i,s),s|0}class oi extends $S{static clampedInt(e,t,i,s){return Lf(e,t,i,s)}constructor(e,t,i,s,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=s,r.maximum=o),super(e,t,i,r),this.minimum=s,this.maximum=o}validate(e){return oi.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function dAe(n,e,t,i){if(typeof n>"u")return e;const s=Hr.float(n,e);return Hr.clamp(s,t,i)}class Hr extends $S{static clamp(e,t,i){return e i?i:e}static float(e,t){return typeof e=="string"&&(e=parseFloat(e)),typeof e!="number"||isNaN(e)?t:e}constructor(e,t,i,s,o,r,a){typeof o<"u"&&(o.type="number",o.default=i,o.minimum=r,o.maximum=a),super(e,t,i,o),this.validationFn=s,this.minimum=r,this.maximum=a}validate(e){return this.validationFn(Hr.float(e,this.defaultValue))}}class zo extends $S{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return zo.string(e,this.defaultValue)}}function Ei(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class Vi extends $S{constructor(e,t,i,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s.slice(0),o.default=i),super(e,t,i,o),this._allowedValues=s}validate(e){return Ei(e,this.defaultValue,this._allowedValues)}}class Wx extends ji{constructor(e,t,i,s,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=s),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function hAe(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class uAe extends ji{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[_(201,"Use platform APIs to detect when a Screen Reader is attached."),_(202,"Optimize for usage with a Screen Reader."),_(203,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:_(204,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class fAe extends ji{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:_(205,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:_(206,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:Fe(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Fe(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function gAe(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var _s;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(_s||(_s={}));function Vte(n){switch(n){case"line":return _s.Line;case"block":return _s.Block;case"underline":return _s.Underline;case"line-thin":return _s.LineThin;case"block-outline":return _s.BlockOutline;case"underline-thin":return _s.UnderlineThin}}class pAe extends __{constructor(){super(162,"")}compute(e,t,i){const s=["monaco-editor"];return t.get(48)&&s.push(t.get(48)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(82)==="default"?s.push("mouse-default"):t.get(82)==="copy"&&s.push("mouse-copy"),t.get(127)&&s.push("showUnused"),t.get(157)&&s.push("showDeprecated"),s.join(" ")}}class mAe extends vt{constructor(){super(45,"emptySelectionClipboard",!0,{description:_(207,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class _Ae extends ji{constructor(){const e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:"workspace",replaceHistory:"workspace"};super(50,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:_(208,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[_(209,"Never seed search string from the editor selection."),_(210,"Always seed search string from the editor selection, including word at cursor position."),_(211,"Only seed search string from the editor selection.")],description:_(212,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[_(213,"Never turn on Find in Selection automatically (default)."),_(214,"Always turn on Find in Selection automatically."),_(215,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:_(216,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:_(217,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:yt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:_(218,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:_(219,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[_(220,"Do not store search history from the find widget."),_(221,"Store search history across the active workspace")],description:_(222,"Controls how the find widget history should be stored")},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[_(223,"Do not store history from the replace widget."),_(224,"Store replace history across the active workspace")],description:_(225,"Controls how the replace widget history should be stored")},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:_(226,"Controls whether the Find Widget should search as you type.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:Fe(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:Fe(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection=="boolean"?t.seedSearchStringFromSelection?"always":"never":Ei(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof t.autoFindInSelection=="boolean"?t.autoFindInSelection?"always":"never":Ei(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Fe(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Fe(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Fe(t.loop,this.defaultValue.loop),history:Ei(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:Ei(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}}const bf=class bf extends ji{constructor(){super(60,"fontLigatures",bf.OFF,{anyOf:[{type:"boolean",description:_(227,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:_(228,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:_(229,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?bf.OFF:e==="true"?bf.ON:e:e?bf.ON:bf.OFF}};bf.OFF='"liga" off, "calt" off',bf.ON='"liga" on, "calt" on';let Cg=bf;const vf=class vf extends ji{constructor(){super(63,"fontVariations",vf.OFF,{anyOf:[{type:"boolean",description:_(230,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:_(231,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:_(232,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?vf.OFF:e==="true"?vf.TRANSLATE:e:e?vf.TRANSLATE:vf.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};vf.OFF=dge,vf.TRANSLATE=hge;let tW=vf;class bAe extends __{constructor(){super(59,new tA({pixelRatio:0,fontFamily:"",fontWeight:"",fontSize:0,fontFeatureSettings:"",fontVariationSettings:"",lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,i){return e.fontInfo}}class vAe extends __{constructor(){super(161,_s.Line)}compute(e,t,i){return e.inputMode==="overtype"?t.get(92):t.get(34)}}class wAe extends __{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}}class CAe extends __{constructor(){super(172,!1)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}}class yAe extends $S{constructor(){super(61,"fontSize",zr.fontSize,{type:"number",minimum:6,maximum:100,default:zr.fontSize,description:_(233,"Controls the font size in pixels.")})}validate(e){const t=Hr.float(e,this.defaultValue);return t===0?zr.fontSize:Hr.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}const Ah=class Ah extends ji{constructor(){super(62,"fontWeight",zr.fontWeight,{anyOf:[{type:"number",minimum:Ah.MINIMUM_VALUE,maximum:Ah.MAXIMUM_VALUE,errorMessage:_(234,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Ah.SUGGESTION_VALUES}],default:zr.fontWeight,description:_(235,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(oi.clampedInt(e,zr.fontWeight,Ah.MINIMUM_VALUE,Ah.MAXIMUM_VALUE))}};Ah.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],Ah.MINIMUM_VALUE=1,Ah.MAXIMUM_VALUE=1e3;let iW=Ah;class SAe extends ji{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[_(236,"Show Peek view of the results (default)"),_(237,"Go to the primary result and show a Peek view"),_(238,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:_(239,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:_(240,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:_(241,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:_(242,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:_(243,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:_(244,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:_(245,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:_(246,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:_(247,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:_(248,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:_(249,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:Ei(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:Ei(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:Ei(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:Ei(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:Ei(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:Ei(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:Ei(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:zo.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:zo.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:zo.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:zo.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:zo.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:zo.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class xAe extends ji{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:_(250,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:_(251,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:_(252,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:_(253,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:_(254,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Fe(t.enabled,this.defaultValue.enabled),delay:oi.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Fe(t.sticky,this.defaultValue.sticky),hidingDelay:oi.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Fe(t.above,this.defaultValue.above)}}}class X0 extends __{constructor(){super(165,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(e,t,i){return X0.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,t-1));const o=(i+e.viewLineCount+s)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:s,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let u=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,b=e.viewLineCount,v=e.remainingWidth,w=e.isViewportWrapping,C=h?2:3;let S=Math.floor(o*s);const L=S/o;let x=!1,I=!1,E=C*u,R=u/o,M=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:z,extraLinesBeforeFirstLine:j,extraLinesBeyondLastLine:X,desiredRatio:Y,minimapLineCount:te}=X0.computeContainedMinimapLineCount({viewLineCount:b,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(b/te>1)x=!0,I=!0,u=1,E=1,R=u/o;else{let Ce=!1,xe=u+1;if(g==="fit"){const Be=Math.ceil((j+b+X)*E);w&&a&&v<=t.stableFitRemainingWidth?(Ce=!0,xe=t.stableFitMaxMinimapScale):Ce=Be>S}if(g==="fill"||Ce){x=!0;const Be=u;E=Math.min(l*o,Math.max(1,Math.floor(1/Y))),w&&a&&v<=t.stableFitRemainingWidth&&(xe=t.stableFitMaxMinimapScale),u=Math.min(xe,Math.max(1,Math.floor(E/C))),u>Be&&(M=Math.min(2,u/Be)),R=u/o/M,S=Math.ceil(Math.max(z,j+b+X)*E),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=v,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const A=Math.floor(f*R),W=Math.min(A,Math.max(0,Math.floor((v-m-2)*R/(c+R)))+kh);let P=Math.floor(o*W);const B=P/o;P=Math.floor(P*M);const V=h?1:2,K=p==="left"?0:i-W-m;return{renderMinimap:V,minimapLeft:K,minimapWidth:W,minimapHeightIsEditorHeight:x,minimapIsSampling:I,minimapScale:u,minimapLineHeight:E,minimapCanvasInnerWidth:P,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:B,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,h=e.get(154),u=h==="inherit"?e.get(153):h,f=u==="inherit"?e.get(149):u,g=e.get(152),p=t.isDominatedByLongLines,m=e.get(66),b=e.get(76).renderType!==0,v=e.get(77),w=e.get(119),C=e.get(96),S=e.get(81),L=e.get(117),x=L.verticalScrollbarSize,I=L.verticalHasArrows,E=L.arrowSize,R=L.horizontalScrollbarSize,M=e.get(52),A=e.get(126)!=="never";let W=e.get(74);M&&A&&(W+=16);let P=0;if(b){const Le=Math.max(r,v);P=Math.round(Le*l)}let B=0;m&&(B=o*t.glyphMarginDecorationLaneCount);let V=0,K=V+B,z=K+P,j=z+W;const X=i-B-P-W;let Y=!1,te=!1,ce=-1;e.get(2)===2&&u==="inherit"&&p?(Y=!0,te=!0):f==="on"||f==="bounded"?te=!0:f==="wordWrapColumn"&&(ce=g);const Ce=X0._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:C.top,paddingBottom:C.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:d,remainingWidth:X,isViewportWrapping:te},t.memory||new gge);Ce.renderMinimap!==0&&Ce.minimapLeft===0&&(V+=Ce.minimapWidth,K+=Ce.minimapWidth,z+=Ce.minimapWidth,j+=Ce.minimapWidth);const xe=X-Ce.minimapWidth,Be=Math.max(1,Math.floor((xe-x-2)/a)),Ee=I?E:0;return te&&(ce=Math.max(1,Be),f==="bounded"&&(ce=Math.min(ce,g))),{width:i,height:s,glyphMarginLeft:V,glyphMarginWidth:B,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:K,lineNumbersWidth:P,decorationsLeft:z,decorationsWidth:W,contentLeft:j,contentWidth:xe,minimap:Ce,viewportColumn:Be,isWordWrapMinified:Y,isViewportWrapping:te,wrappingColumn:ce,verticalScrollbarWidth:x,horizontalScrollbarHeight:R,overviewRuler:{top:Ee,width:x,height:s-2*Ee,right:0}}}}class LAe extends ji{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[_(255,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),_(256,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:_(257,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Ei(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var Tc;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(Tc||(Tc={}));class kAe extends ji{constructor(){const e={enabled:Tc.OnCode};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:[Tc.Off,Tc.OnCode,Tc.On],default:e.enabled,enumDescriptions:[_(258,"Disable the code action menu."),_(259,"Show the code action menu when the cursor is on lines with code."),_(260,"Show the code action menu when the cursor is on lines with code or on empty lines.")],description:_(261,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Ei(e.enabled,this.defaultValue.enabled,[Tc.Off,Tc.OnCode,Tc.On])}}}class IAe extends ji{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:_(262,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:_(263,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:_(264,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:_(265,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Fe(t.enabled,this.defaultValue.enabled),maxLineCount:oi.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Ei(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Fe(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class EAe extends ji{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:_(266,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[_(267,"Inlay hints are enabled"),_(268,"Inlay hints are showing by default and hide when holding {0}",yt?"Ctrl+Option":"Ctrl+Alt"),_(269,"Inlay hints are hidden by default and show when holding {0}",yt?"Ctrl+Option":"Ctrl+Alt"),_(270,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:_(271,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:_(272,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:_(273,"Enables the padding around the inlay hints in the editor.")},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:_(274,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Ei(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:oi.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:zo.string(t.fontFamily,this.defaultValue.fontFamily),padding:Fe(t.padding,this.defaultValue.padding),maximumLength:oi.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}}class NAe extends ji{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):oi.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?oi.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class DAe extends Hr{constructor(){super(75,"lineHeight",zr.lineHeight,e=>Hr.clamp(e,0,150),{markdownDescription:_(275,`Controls the line height. +`))}}class JMe extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class eAe extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class h7{constructor(e){this.value=e}}const tAe=2;let q=class{constructor(e){var t,i,s,o;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new tW((e==null?void 0:e.onListenerError)??Je,((i=this._options)==null?void 0:i.leakWarningThreshold)??QMe):void 0,this._perfMon=(s=this._options)!=null&&s._profName?new eW(this._options._profName):void 0,this._deliveryQueue=(o=this._options)==null?void 0:o.deliveryQueue}dispose(){var e,t,i,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||i.call(t),(s=this._leakageMon)==null||s.dispose())}get event(){return this._event??(this._event=(e,t,i)=>{var a,l,c,d,h,u,f;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);const p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new eAe(`${g}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((a=this._options)==null?void 0:a.onListenerError)||Je)(m),G.None}if(this._disposed)return G.None;t&&(e=e.bind(t));const s=new h7(e);let o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=IG.create(),o=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof h7?(this._deliveryQueue??(this._deliveryQueue=new uge),this._listeners=[this._listeners,s]):this._listeners.push(s):((c=(l=this._options)==null?void 0:l.onWillAddFirstListener)==null||c.call(l,this),this._listeners=s,(h=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||h.call(d,this)),(f=(u=this._options)==null?void 0:u.onDidAddListener)==null||f.call(u,this),this._size++;const r=Re(()=>{o==null||o(),this._removeListener(s)});return i instanceof ne?i.add(r):Array.isArray(i)&&i.push(r),r}),this._event}_removeListener(e){var o,r,a,l;if((r=(o=this._options)==null?void 0:o.onWillRemoveListener)==null||r.call(o,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(l=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||l.call(a,this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const s=this._deliveryQueue.current===this;if(this._size*tAe<=t.length){let c=0;for(let d=0;d 0}};const iAe=()=>new uge;class uge{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Z1 extends q{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Uo,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class fge extends Z1{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class nAe extends q{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class sAe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new q({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Re(Y1(()=>{this.hasListeners&&this.unhook(t);const s=this.events.indexOf(t);this.events.splice(s,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){var t;(t=e.listener)==null||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)==null||e.dispose();this.events=[]}}class oD{constructor(){this.data=[]}wrapEvent(e,t,i){return(s,o,r)=>e(a=>{const l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>s.call(o,a)):s.call(o,a);return}const c=l;if(!c){s.call(o,t(i,a));return}c.items??(c.items=[]),c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??(c.reducedResult=i?c.items.reduce(t,i):c.items.reduce(t)),s.call(o,c.reducedResult)})},void 0,r)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach(s=>s()),i}}class Bx{constructor(){this.listening=!1,this.inputEvent=ve.None,this.inputEventListener=G.None,this.emitter=new q({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const Vl=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(n){n=Math.min(Math.max(-5,n),20),this._zoomLevel!==n&&(this._zoomLevel=n,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},oAe=wt?1.5:1.35,u7=8;class X1{static _create(e,t,i,s,o,r,a,l,c){r===0?r=oAe*i:r /?";function dAe(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of iA)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const NG=dAe();function DG(n){let e=NG;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const mge=new Uo;mge.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function tI(n,e,t,i,s){if(e=DG(e),s||(s=Nt.first(mge)),t.length>s.maxLen){let c=n-s.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+s.maxLen/2),tI(n,e,t,i,s)}const o=Date.now(),r=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=s.timeBudget);c++){const d=r-s.windowSize*c;e.lastIndex=Math.max(0,d);const h=hAe(e,t,r,a);if(!h&&l||(l=h,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function hAe(n,e,t,i){let s;for(;s=n.exec(e);){const o=s.index||0;if(o<=t&&n.lastIndex>=t)return s;if(i>0&&o>i)return null}return null}const Lh=8;class _ge{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class bge{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class $i{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return R5(e,t)}compute(e,t,i){return i}}class dk{constructor(e,t){this.newValue=e,this.didChange=t}}function R5(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new dk(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Bi(n,e);return new dk(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=R5(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new dk(n,t)}class b_{constructor(e,t){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=t}applyUpdate(e,t){return R5(e,t)}validate(e){return this.defaultValue}}class qS{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return R5(e,t)}compute(e,t,i){return i}}function Fe(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class bt extends qS{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return Fe(e,this.defaultValue)}}function xf(n,e,t,i){if(typeof n=="string"&&(n=parseInt(n,10)),typeof n!="number"||isNaN(n))return e;let s=n;return s=Math.max(t,s),s=Math.min(i,s),s|0}class oi extends qS{static clampedInt(e,t,i,s){return xf(e,t,i,s)}constructor(e,t,i,s,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=s,r.maximum=o),super(e,t,i,r),this.minimum=s,this.maximum=o}validate(e){return oi.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function uAe(n,e,t,i){if(typeof n>"u")return e;const s=Br.float(n,e);return Br.clamp(s,t,i)}class Br extends qS{static clamp(e,t,i){return e i?i:e}static float(e,t){return typeof e=="string"&&(e=parseFloat(e)),typeof e!="number"||isNaN(e)?t:e}constructor(e,t,i,s,o,r,a){typeof o<"u"&&(o.type="number",o.default=i,o.minimum=r,o.maximum=a),super(e,t,i,o),this.validationFn=s,this.minimum=r,this.maximum=a}validate(e){return this.validationFn(Br.float(e,this.defaultValue))}}class Vo extends qS{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return Vo.string(e,this.defaultValue)}}function Di(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class zi extends qS{constructor(e,t,i,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s.slice(0),o.default=i),super(e,t,i,o),this._allowedValues=s}validate(e){return Di(e,this.defaultValue,this._allowedValues)}}class Wx extends $i{constructor(e,t,i,s,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=s),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function fAe(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class gAe extends $i{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[_(201,"Use platform APIs to detect when a Screen Reader is attached."),_(202,"Optimize for usage with a Screen Reader."),_(203,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:_(204,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class pAe extends $i{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:_(205,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:_(206,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:Fe(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Fe(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function mAe(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var ms;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(ms||(ms={}));function jte(n){switch(n){case"line":return ms.Line;case"block":return ms.Block;case"underline":return ms.Underline;case"line-thin":return ms.LineThin;case"block-outline":return ms.BlockOutline;case"underline-thin":return ms.UnderlineThin}}class _Ae extends b_{constructor(){super(162,"")}compute(e,t,i){const s=["monaco-editor"];return t.get(48)&&s.push(t.get(48)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(82)==="default"?s.push("mouse-default"):t.get(82)==="copy"&&s.push("mouse-copy"),t.get(127)&&s.push("showUnused"),t.get(157)&&s.push("showDeprecated"),s.join(" ")}}class bAe extends bt{constructor(){super(45,"emptySelectionClipboard",!0,{description:_(207,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class vAe extends $i{constructor(){const e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:"workspace",replaceHistory:"workspace"};super(50,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:_(208,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[_(209,"Never seed search string from the editor selection."),_(210,"Always seed search string from the editor selection, including word at cursor position."),_(211,"Only seed search string from the editor selection.")],description:_(212,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[_(213,"Never turn on Find in Selection automatically (default)."),_(214,"Always turn on Find in Selection automatically."),_(215,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:_(216,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:_(217,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:wt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:_(218,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:_(219,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[_(220,"Do not store search history from the find widget."),_(221,"Store search history across the active workspace")],description:_(222,"Controls how the find widget history should be stored")},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[_(223,"Do not store history from the replace widget."),_(224,"Store replace history across the active workspace")],description:_(225,"Controls how the replace widget history should be stored")},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:_(226,"Controls whether the Find Widget should search as you type.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:Fe(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:Fe(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection=="boolean"?t.seedSearchStringFromSelection?"always":"never":Di(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof t.autoFindInSelection=="boolean"?t.autoFindInSelection?"always":"never":Di(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Fe(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Fe(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Fe(t.loop,this.defaultValue.loop),history:Di(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:Di(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}}const bf=class bf extends $i{constructor(){super(60,"fontLigatures",bf.OFF,{anyOf:[{type:"boolean",description:_(227,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:_(228,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:_(229,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?bf.OFF:e==="true"?bf.ON:e:e?bf.ON:bf.OFF}};bf.OFF='"liga" off, "calt" off',bf.ON='"liga" on, "calt" on';let Cg=bf;const vf=class vf extends $i{constructor(){super(63,"fontVariations",vf.OFF,{anyOf:[{type:"boolean",description:_(230,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:_(231,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:_(232,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?vf.OFF:e==="true"?vf.TRANSLATE:e:e?vf.TRANSLATE:vf.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};vf.OFF=gge,vf.TRANSLATE=pge;let iW=vf;class wAe extends b_{constructor(){super(59,new tA({pixelRatio:0,fontFamily:"",fontWeight:"",fontSize:0,fontFeatureSettings:"",fontVariationSettings:"",lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,i){return e.fontInfo}}class CAe extends b_{constructor(){super(161,ms.Line)}compute(e,t,i){return e.inputMode==="overtype"?t.get(92):t.get(34)}}class yAe extends b_{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}}class SAe extends b_{constructor(){super(172,!1)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}}class xAe extends qS{constructor(){super(61,"fontSize",Hr.fontSize,{type:"number",minimum:6,maximum:100,default:Hr.fontSize,description:_(233,"Controls the font size in pixels.")})}validate(e){const t=Br.float(e,this.defaultValue);return t===0?Hr.fontSize:Br.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}const Mh=class Mh extends $i{constructor(){super(62,"fontWeight",Hr.fontWeight,{anyOf:[{type:"number",minimum:Mh.MINIMUM_VALUE,maximum:Mh.MAXIMUM_VALUE,errorMessage:_(234,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Mh.SUGGESTION_VALUES}],default:Hr.fontWeight,description:_(235,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(oi.clampedInt(e,Hr.fontWeight,Mh.MINIMUM_VALUE,Mh.MAXIMUM_VALUE))}};Mh.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],Mh.MINIMUM_VALUE=1,Mh.MAXIMUM_VALUE=1e3;let nW=Mh;class LAe extends $i{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[_(236,"Show Peek view of the results (default)"),_(237,"Go to the primary result and show a Peek view"),_(238,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:_(239,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:_(240,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:_(241,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:_(242,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:_(243,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:_(244,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:_(245,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:_(246,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:_(247,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:_(248,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:_(249,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:Di(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:Di(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:Di(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:Di(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:Di(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:Di(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:Di(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Vo.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Vo.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Vo.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Vo.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Vo.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Vo.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class kAe extends $i{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:_(250,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:_(251,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:_(252,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:_(253,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:_(254,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Fe(t.enabled,this.defaultValue.enabled),delay:oi.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Fe(t.sticky,this.defaultValue.sticky),hidingDelay:oi.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Fe(t.above,this.defaultValue.above)}}}class J0 extends b_{constructor(){super(165,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(e,t,i){return J0.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,t-1));const o=(i+e.viewLineCount+s)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:s,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let u=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,b=e.viewLineCount,v=e.remainingWidth,w=e.isViewportWrapping,C=h?2:3;let S=Math.floor(o*s);const L=S/o;let x=!1,E=!1,I=C*u,R=u/o,M=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:z,extraLinesBeforeFirstLine:j,extraLinesBeyondLastLine:Q,desiredRatio:Y,minimapLineCount:te}=J0.computeContainedMinimapLineCount({viewLineCount:b,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(b/te>1)x=!0,E=!0,u=1,I=1,R=u/o;else{let Ce=!1,xe=u+1;if(g==="fit"){const je=Math.ceil((j+b+Q)*I);w&&a&&v<=t.stableFitRemainingWidth?(Ce=!0,xe=t.stableFitMaxMinimapScale):Ce=je>S}if(g==="fill"||Ce){x=!0;const je=u;I=Math.min(l*o,Math.max(1,Math.floor(1/Y))),w&&a&&v<=t.stableFitRemainingWidth&&(xe=t.stableFitMaxMinimapScale),u=Math.min(xe,Math.max(1,Math.floor(I/C))),u>je&&(M=Math.min(2,u/je)),R=u/o/M,S=Math.ceil(Math.max(z,j+b+Q)*I),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=v,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const A=Math.floor(f*R),W=Math.min(A,Math.max(0,Math.floor((v-m-2)*R/(c+R)))+Lh);let P=Math.floor(o*W);const B=P/o;P=Math.floor(P*M);const V=h?1:2,K=p==="left"?0:i-W-m;return{renderMinimap:V,minimapLeft:K,minimapWidth:W,minimapHeightIsEditorHeight:x,minimapIsSampling:E,minimapScale:u,minimapLineHeight:I,minimapCanvasInnerWidth:P,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:B,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,h=e.get(154),u=h==="inherit"?e.get(153):h,f=u==="inherit"?e.get(149):u,g=e.get(152),p=t.isDominatedByLongLines,m=e.get(66),b=e.get(76).renderType!==0,v=e.get(77),w=e.get(119),C=e.get(96),S=e.get(81),L=e.get(117),x=L.verticalScrollbarSize,E=L.verticalHasArrows,I=L.arrowSize,R=L.horizontalScrollbarSize,M=e.get(52),A=e.get(126)!=="never";let W=e.get(74);M&&A&&(W+=16);let P=0;if(b){const Le=Math.max(r,v);P=Math.round(Le*l)}let B=0;m&&(B=o*t.glyphMarginDecorationLaneCount);let V=0,K=V+B,z=K+P,j=z+W;const Q=i-B-P-W;let Y=!1,te=!1,ce=-1;e.get(2)===2&&u==="inherit"&&p?(Y=!0,te=!0):f==="on"||f==="bounded"?te=!0:f==="wordWrapColumn"&&(ce=g);const Ce=J0._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:C.top,paddingBottom:C.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:d,remainingWidth:Q,isViewportWrapping:te},t.memory||new bge);Ce.renderMinimap!==0&&Ce.minimapLeft===0&&(V+=Ce.minimapWidth,K+=Ce.minimapWidth,z+=Ce.minimapWidth,j+=Ce.minimapWidth);const xe=Q-Ce.minimapWidth,je=Math.max(1,Math.floor((xe-x-2)/a)),ke=E?I:0;return te&&(ce=Math.max(1,je),f==="bounded"&&(ce=Math.min(ce,g))),{width:i,height:s,glyphMarginLeft:V,glyphMarginWidth:B,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:K,lineNumbersWidth:P,decorationsLeft:z,decorationsWidth:W,contentLeft:j,contentWidth:xe,minimap:Ce,viewportColumn:je,isWordWrapMinified:Y,isViewportWrapping:te,wrappingColumn:ce,verticalScrollbarWidth:x,horizontalScrollbarHeight:R,overviewRuler:{top:ke,width:x,height:s-2*ke,right:0}}}}class EAe extends $i{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[_(255,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),_(256,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:_(257,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Di(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var Dc;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(Dc||(Dc={}));class IAe extends $i{constructor(){const e={enabled:Dc.OnCode};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:[Dc.Off,Dc.OnCode,Dc.On],default:e.enabled,enumDescriptions:[_(258,"Disable the code action menu."),_(259,"Show the code action menu when the cursor is on lines with code."),_(260,"Show the code action menu when the cursor is on lines with code or on empty lines.")],description:_(261,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Di(e.enabled,this.defaultValue.enabled,[Dc.Off,Dc.OnCode,Dc.On])}}}class NAe extends $i{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:_(262,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:_(263,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:_(264,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:_(265,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Fe(t.enabled,this.defaultValue.enabled),maxLineCount:oi.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Di(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Fe(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class DAe extends $i{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:_(266,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[_(267,"Inlay hints are enabled"),_(268,"Inlay hints are showing by default and hide when holding {0}",wt?"Ctrl+Option":"Ctrl+Alt"),_(269,"Inlay hints are hidden by default and show when holding {0}",wt?"Ctrl+Option":"Ctrl+Alt"),_(270,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:_(271,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:_(272,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:_(273,"Enables the padding around the inlay hints in the editor.")},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:_(274,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Di(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:oi.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Vo.string(t.fontFamily,this.defaultValue.fontFamily),padding:Fe(t.padding,this.defaultValue.padding),maximumLength:oi.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}}class TAe extends $i{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):oi.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?oi.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class RAe extends Br{constructor(){super(75,"lineHeight",Hr.lineHeight,e=>Br.clamp(e,0,150),{markdownDescription:_(275,`Controls the line height. - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - - Values greater than or equal to 8 will be used as effective values.`)},0,150)}compute(e,t,i){return e.fontInfo.lineHeight}}class TAe extends ji{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(? -?)\\s*(?