clustr-ai 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
`+P+t}var G=!1;function Z(t,n){if(!t||G)return"";G=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(oe){var g=oe}Reflect.construct(t,[],n)}else{try{n.call()}catch(oe){g=oe}t.call(n.prototype)}else{try{throw Error()}catch(oe){g=oe}t()}}catch(oe){if(oe&&g&&typeof oe.stack=="string"){for(var E=oe.stack.split(`
|
|
35
35
|
`),A=g.stack.split(`
|
|
36
36
|
`),$=E.length-1,Y=A.length-1;1<=$&&0<=Y&&E[$]!==A[Y];)Y--;for(;1<=$&&0<=Y;$--,Y--)if(E[$]!==A[Y]){if($!==1||Y!==1)do if($--,Y--,0>Y||E[$]!==A[Y]){var Q=`
|
|
37
|
-
`+E[$].replace(" at new "," at ");return t.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",t.displayName)),Q}while(1<=$&&0<=Y);break}}}finally{G=!1,Error.prepareStackTrace=s}return(t=t?t.displayName||t.name:"")?F(t):""}function ie(t){switch(t.tag){case 5:return F(t.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return t=Z(t.type,!1),t;case 11:return t=Z(t.type.render,!1),t;case 1:return t=Z(t.type,!0),t;default:return""}}function ae(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case D:return"Fragment";case R:return"Portal";case M:return"Profiler";case k:return"StrictMode";case N:return"Suspense";case I:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case z:return(t.displayName||"Context")+".Consumer";case W:return(t._context.displayName||"Context")+".Provider";case j:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case q:return n=t.displayName||null,n!==null?n:ae(t.type)||"Memo";case U:n=t._payload,t=t._init;try{return ae(t(n))}catch{}}return null}function X(t){var n=t.type;switch(t.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=n.render,t=t.displayName||t.name||"",n.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ae(n);case 8:return n===k?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function H(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function re(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function te(t){var n=re(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),g=""+t[n];if(!t.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var E=s.get,A=s.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return E.call(this)},set:function($){g=""+$,A.call(this,$)}}),Object.defineProperty(t,n,{enumerable:s.enumerable}),{getValue:function(){return g},setValue:function($){g=""+$},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function ce(t){t._valueTracker||(t._valueTracker=te(t))}function le(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),g="";return t&&(g=re(t)?t.checked?"true":"false":t.value),t=g,t!==s?(n.setValue(t),!0):!1}function pe(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Se(t,n){var s=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??t._wrapperState.initialChecked})}function be(t,n){var s=n.defaultValue==null?"":n.defaultValue,g=n.checked!=null?n.checked:n.defaultChecked;s=H(n.value!=null?n.value:s),t._wrapperState={initialChecked:g,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function ue(t,n){n=n.checked,n!=null&&u(t,"checked",n,!1)}function ge(t,n){ue(t,n);var s=H(n.value),g=n.type;if(s!=null)g==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+s):t.value!==""+s&&(t.value=""+s);else if(g==="submit"||g==="reset"){t.removeAttribute("value");return}n.hasOwnProperty("value")?Ie(t,n.type,s):n.hasOwnProperty("defaultValue")&&Ie(t,n.type,H(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(t.defaultChecked=!!n.defaultChecked)}function Re(t,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var g=n.type;if(!(g!=="submit"&&g!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+t._wrapperState.initialValue,s||n===t.value||(t.value=n),t.defaultValue=n}s=t.name,s!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,s!==""&&(t.name=s)}function Ie(t,n,s){(n!=="number"||pe(t.ownerDocument)!==t)&&(s==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+s&&(t.defaultValue=""+s))}var ze=Array.isArray;function Qe(t,n,s,g){if(t=t.options,n){n={};for(var E=0;E<s.length;E++)n["$"+s[E]]=!0;for(s=0;s<t.length;s++)E=n.hasOwnProperty("$"+t[s].value),t[s].selected!==E&&(t[s].selected=E),E&&g&&(t[s].defaultSelected=!0)}else{for(s=""+H(s),n=null,E=0;E<t.length;E++){if(t[E].value===s){t[E].selected=!0,g&&(t[E].defaultSelected=!0);return}n!==null||t[E].disabled||(n=t[E])}n!==null&&(n.selected=!0)}}function ut(t,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return B({},n,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function qe(t,n){var s=n.value;if(s==null){if(s=n.children,n=n.defaultValue,s!=null){if(n!=null)throw Error(i(92));if(ze(s)){if(1<s.length)throw Error(i(93));s=s[0]}n=s}n==null&&(n=""),s=n}t._wrapperState={initialValue:H(s)}}function pt(t,n){var s=H(n.value),g=H(n.defaultValue);s!=null&&(s=""+s,s!==t.value&&(t.value=s),n.defaultValue==null&&t.defaultValue!==s&&(t.defaultValue=s)),g!=null&&(t.defaultValue=""+g)}function Ne(t){var n=t.textContent;n===t._wrapperState.initialValue&&n!==""&&n!==null&&(t.value=n)}function Je(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ht(t,n){return t==null||t==="http://www.w3.org/1999/xhtml"?Je(n):t==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var $e,pr=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,s,g,E){MSApp.execUnsafeLocalFunction(function(){return t(n,s,g,E)})}:t})(function(t,n){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=n;else{for($e=$e||document.createElement("div"),$e.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=$e.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;n.firstChild;)t.appendChild(n.firstChild)}});function ot(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var Rt={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},Oe=["Webkit","ms","Moz","O"];Object.keys(Rt).forEach(function(t){Oe.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),Rt[n]=Rt[t]})});function Rn(t,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||Rt.hasOwnProperty(t)&&Rt[t]?(""+n).trim():n+"px"}function Ps(t,n){t=t.style;for(var s in n)if(n.hasOwnProperty(s)){var g=s.indexOf("--")===0,E=Rn(s,n[s],g);s==="float"&&(s="cssFloat"),g?t.setProperty(s,E):t[s]=E}}var Ka=B({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 vi(t,n){if(n){if(Ka[t]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,t));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function yi(t,n){if(t.indexOf("-")===-1)return typeof n.is=="string";switch(t){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 wi=null;function Si(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ci=null,Rr=null,Dr=null;function Ns(t){if(t=Ki(t)){if(typeof Ci!="function")throw Error(i(280));var n=t.stateNode;n&&(n=uo(n),Ci(t.stateNode,t.type,n))}}function Bs(t){Rr?Dr?Dr.push(t):Dr=[t]:Rr=t}function Is(){if(Rr){var t=Rr,n=Dr;if(Dr=Rr=null,Ns(t),n)for(t=0;t<n.length;t++)Ns(n[t])}}function Os(t,n){return t(n)}function Hs(){}var xi=!1;function Fs(t,n,s){if(xi)return t(n,s);xi=!0;try{return Os(t,n,s)}finally{xi=!1,(Rr!==null||Dr!==null)&&(Hs(),Is())}}function rn(t,n){var s=t.stateNode;if(s===null)return null;var g=uo(s);if(g===null)return null;s=g[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(t=t.type,g=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!g;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(i(231,n,typeof s));return s}var bi=!1;if(a)try{var nn={};Object.defineProperty(nn,"passive",{get:function(){bi=!0}}),window.addEventListener("test",nn,nn),window.removeEventListener("test",nn,nn)}catch{bi=!1}function Xa(t,n,s,g,E,A,$,Y,Q){var oe=Array.prototype.slice.call(arguments,3);try{n.apply(s,oe)}catch(de){this.onError(de)}}var sn=!1,Dn=null,An=!1,Ei=null,Ya={onError:function(t){sn=!0,Dn=t}};function Ga(t,n,s,g,E,A,$,Y,Q){sn=!1,Dn=null,Xa.apply(Ya,arguments)}function Qa(t,n,s,g,E,A,$,Y,Q){if(Ga.apply(this,arguments),sn){if(sn){var oe=Dn;sn=!1,Dn=null}else throw Error(i(198));An||(An=!0,Ei=oe)}}function rr(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function ki(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function Li(t){if(rr(t)!==t)throw Error(i(188))}function Ja(t){var n=t.alternate;if(!n){if(n=rr(t),n===null)throw Error(i(188));return n!==t?null:t}for(var s=t,g=n;;){var E=s.return;if(E===null)break;var A=E.alternate;if(A===null){if(g=E.return,g!==null){s=g;continue}break}if(E.child===A.child){for(A=E.child;A;){if(A===s)return Li(E),t;if(A===g)return Li(E),n;A=A.sibling}throw Error(i(188))}if(s.return!==g.return)s=E,g=A;else{for(var $=!1,Y=E.child;Y;){if(Y===s){$=!0,s=E,g=A;break}if(Y===g){$=!0,g=E,s=A;break}Y=Y.sibling}if(!$){for(Y=A.child;Y;){if(Y===s){$=!0,s=A,g=E;break}if(Y===g){$=!0,g=A,s=E;break}Y=Y.sibling}if(!$)throw Error(i(189))}}if(s.alternate!==g)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?t:n}function js(t){return t=Ja(t),t!==null?zs(t):null}function zs(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var n=zs(t);if(n!==null)return n;t=t.sibling}return null}var $s=r.unstable_scheduleCallback,Ws=r.unstable_cancelCallback,Za=r.unstable_shouldYield,Us=r.unstable_requestPaint,Ke=r.unstable_now,el=r.unstable_getCurrentPriorityLevel,Ri=r.unstable_ImmediatePriority,Vs=r.unstable_UserBlockingPriority,Tn=r.unstable_NormalPriority,tl=r.unstable_LowPriority,qs=r.unstable_IdlePriority,on=null,It=null;function rl(t){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(on,t,void 0,(t.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:sl,nl=Math.log,il=Math.LN2;function sl(t){return t>>>=0,t===0?32:31-(nl(t)/il|0)|0}var Mn=64,Pn=4194304;function nr(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Nn(t,n){var s=t.pendingLanes;if(s===0)return 0;var g=0,E=t.suspendedLanes,A=t.pingedLanes,$=s&268435455;if($!==0){var Y=$&~E;Y!==0?g=nr(Y):(A&=$,A!==0&&(g=nr(A)))}else $=s&~E,$!==0?g=nr($):A!==0&&(g=nr(A));if(g===0)return 0;if(n!==0&&n!==g&&(n&E)===0&&(E=g&-g,A=n&-n,E>=A||E===16&&(A&4194240)!==0))return n;if((g&4)!==0&&(g|=s&16),n=t.entangledLanes,n!==0)for(t=t.entanglements,n&=g;0<n;)s=31-Dt(n),E=1<<s,g|=t[s],n&=~E;return g}function Ks(t,n){switch(t){case 1:case 2:case 4:return n+250;case 8:case 16:case 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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ol(t,n){for(var s=t.suspendedLanes,g=t.pingedLanes,E=t.expirationTimes,A=t.pendingLanes;0<A;){var $=31-Dt(A),Y=1<<$,Q=E[$];Q===-1?((Y&s)===0||(Y&g)!==0)&&(E[$]=Ks(Y,n)):Q<=n&&(t.expiredLanes|=Y),A&=~Y}}function Di(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Bn(){var t=Mn;return Mn<<=1,(Mn&4194240)===0&&(Mn=64),t}function Ai(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function an(t,n,s){t.pendingLanes|=n,n!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,n=31-Dt(n),t[n]=s}function Xs(t,n){var s=t.pendingLanes&~n;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=n,t.mutableReadLanes&=n,t.entangledLanes&=n,n=t.entanglements;var g=t.eventTimes;for(t=t.expirationTimes;0<s;){var E=31-Dt(s),A=1<<E;n[E]=0,g[E]=-1,t[E]=-1,s&=~A}}function al(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var g=31-Dt(s),E=1<<g;E&n|t[g]&n&&(t[g]|=n),s&=~E}}var Be=0;function ch(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var uh,ll,hh,dh,fh,cl=!1,Ys=[],Ar=null,Tr=null,Mr=null,Ti=new Map,Mi=new Map,Pr=[],_m="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ph(t,n){switch(t){case"focusin":case"focusout":Ar=null;break;case"dragenter":case"dragleave":Tr=null;break;case"mouseover":case"mouseout":Mr=null;break;case"pointerover":case"pointerout":Ti.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mi.delete(n.pointerId)}}function Pi(t,n,s,g,E,A){return t===null||t.nativeEvent!==A?(t={blockedOn:n,domEventName:s,eventSystemFlags:g,nativeEvent:A,targetContainers:[E]},n!==null&&(n=Ki(n),n!==null&&ll(n)),t):(t.eventSystemFlags|=g,n=t.targetContainers,E!==null&&n.indexOf(E)===-1&&n.push(E),t)}function gm(t,n,s,g,E){switch(n){case"focusin":return Ar=Pi(Ar,t,n,s,g,E),!0;case"dragenter":return Tr=Pi(Tr,t,n,s,g,E),!0;case"mouseover":return Mr=Pi(Mr,t,n,s,g,E),!0;case"pointerover":var A=E.pointerId;return Ti.set(A,Pi(Ti.get(A)||null,t,n,s,g,E)),!0;case"gotpointercapture":return A=E.pointerId,Mi.set(A,Pi(Mi.get(A)||null,t,n,s,g,E)),!0}return!1}function _h(t){var n=ln(t.target);if(n!==null){var s=rr(n);if(s!==null){if(n=s.tag,n===13){if(n=ki(s),n!==null){t.blockedOn=n,fh(t.priority,function(){hh(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Gs(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=hl(t.domEventName,t.eventSystemFlags,n[0],t.nativeEvent);if(s===null){s=t.nativeEvent;var g=new s.constructor(s.type,s);wi=g,s.target.dispatchEvent(g),wi=null}else return n=Ki(s),n!==null&&ll(n),t.blockedOn=s,!1;n.shift()}return!0}function gh(t,n,s){Gs(t)&&s.delete(n)}function mm(){cl=!1,Ar!==null&&Gs(Ar)&&(Ar=null),Tr!==null&&Gs(Tr)&&(Tr=null),Mr!==null&&Gs(Mr)&&(Mr=null),Ti.forEach(gh),Mi.forEach(gh)}function Ni(t,n){t.blockedOn===n&&(t.blockedOn=null,cl||(cl=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,mm)))}function Bi(t){function n(E){return Ni(E,t)}if(0<Ys.length){Ni(Ys[0],t);for(var s=1;s<Ys.length;s++){var g=Ys[s];g.blockedOn===t&&(g.blockedOn=null)}}for(Ar!==null&&Ni(Ar,t),Tr!==null&&Ni(Tr,t),Mr!==null&&Ni(Mr,t),Ti.forEach(n),Mi.forEach(n),s=0;s<Pr.length;s++)g=Pr[s],g.blockedOn===t&&(g.blockedOn=null);for(;0<Pr.length&&(s=Pr[0],s.blockedOn===null);)_h(s),s.blockedOn===null&&Pr.shift()}var In=w.ReactCurrentBatchConfig,Qs=!0;function vm(t,n,s,g){var E=Be,A=In.transition;In.transition=null;try{Be=1,ul(t,n,s,g)}finally{Be=E,In.transition=A}}function ym(t,n,s,g){var E=Be,A=In.transition;In.transition=null;try{Be=4,ul(t,n,s,g)}finally{Be=E,In.transition=A}}function ul(t,n,s,g){if(Qs){var E=hl(t,n,s,g);if(E===null)Rl(t,n,g,Js,s),ph(t,g);else if(gm(E,t,n,s,g))g.stopPropagation();else if(ph(t,g),n&4&&-1<_m.indexOf(t)){for(;E!==null;){var A=Ki(E);if(A!==null&&uh(A),A=hl(t,n,s,g),A===null&&Rl(t,n,g,Js,s),A===E)break;E=A}E!==null&&g.stopPropagation()}else Rl(t,n,g,null,s)}}var Js=null;function hl(t,n,s,g){if(Js=null,t=Si(g),t=ln(t),t!==null)if(n=rr(t),n===null)t=null;else if(s=n.tag,s===13){if(t=ki(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null);return Js=t,null}function mh(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(el()){case Ri:return 1;case Vs:return 4;case Tn:case tl:return 16;case qs:return 536870912;default:return 16}default:return 16}}var Nr=null,dl=null,Zs=null;function vh(){if(Zs)return Zs;var t,n=dl,s=n.length,g,E="value"in Nr?Nr.value:Nr.textContent,A=E.length;for(t=0;t<s&&n[t]===E[t];t++);var $=s-t;for(g=1;g<=$&&n[s-g]===E[A-g];g++);return Zs=E.slice(t,1<g?1-g:void 0)}function eo(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function to(){return!0}function yh(){return!1}function At(t){function n(s,g,E,A,$){this._reactName=s,this._targetInst=E,this.type=g,this.nativeEvent=A,this.target=$,this.currentTarget=null;for(var Y in t)t.hasOwnProperty(Y)&&(s=t[Y],this[Y]=s?s(A):A[Y]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?to:yh,this.isPropagationStopped=yh,this}return B(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=to)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=to)},persist:function(){},isPersistent:to}),n}var On={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fl=At(On),Ii=B({},On,{view:0,detail:0}),wm=At(Ii),pl,_l,Oi,ro=B({},Ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ml,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Oi&&(Oi&&t.type==="mousemove"?(pl=t.screenX-Oi.screenX,_l=t.screenY-Oi.screenY):_l=pl=0,Oi=t),pl)},movementY:function(t){return"movementY"in t?t.movementY:_l}}),wh=At(ro),Sm=B({},ro,{dataTransfer:0}),Cm=At(Sm),xm=B({},Ii,{relatedTarget:0}),gl=At(xm),bm=B({},On,{animationName:0,elapsedTime:0,pseudoElement:0}),Em=At(bm),km=B({},On,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Lm=At(km),Rm=B({},On,{data:0}),Sh=At(Rm),Dm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Am={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Tm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mm(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Tm[t])?!!n[t]:!1}function ml(){return Mm}var Pm=B({},Ii,{key:function(t){if(t.key){var n=Dm[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=eo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Am[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ml,charCode:function(t){return t.type==="keypress"?eo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?eo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Nm=At(Pm),Bm=B({},ro,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ch=At(Bm),Im=B({},Ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ml}),Om=At(Im),Hm=B({},On,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fm=At(Hm),jm=B({},ro,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),zm=At(jm),$m=[9,13,27,32],vl=a&&"CompositionEvent"in window,Hi=null;a&&"documentMode"in document&&(Hi=document.documentMode);var Wm=a&&"TextEvent"in window&&!Hi,xh=a&&(!vl||Hi&&8<Hi&&11>=Hi),bh=" ",Eh=!1;function kh(t,n){switch(t){case"keyup":return $m.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Hn=!1;function Um(t,n){switch(t){case"compositionend":return Lh(n);case"keypress":return n.which!==32?null:(Eh=!0,bh);case"textInput":return t=n.data,t===bh&&Eh?null:t;default:return null}}function Vm(t,n){if(Hn)return t==="compositionend"||!vl&&kh(t,n)?(t=vh(),Zs=dl=Nr=null,Hn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return xh&&n.locale!=="ko"?null:n.data;default:return null}}var qm={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rh(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!qm[t.type]:n==="textarea"}function Dh(t,n,s,g){Bs(g),n=ao(n,"onChange"),0<n.length&&(s=new fl("onChange","change",null,s,g),t.push({event:s,listeners:n}))}var Fi=null,ji=null;function Km(t){Kh(t,0)}function no(t){var n=Wn(t);if(le(n))return t}function Xm(t,n){if(t==="change")return n}var Ah=!1;if(a){var yl;if(a){var wl="oninput"in document;if(!wl){var Th=document.createElement("div");Th.setAttribute("oninput","return;"),wl=typeof Th.oninput=="function"}yl=wl}else yl=!1;Ah=yl&&(!document.documentMode||9<document.documentMode)}function Mh(){Fi&&(Fi.detachEvent("onpropertychange",Ph),ji=Fi=null)}function Ph(t){if(t.propertyName==="value"&&no(ji)){var n=[];Dh(n,ji,t,Si(t)),Fs(Km,n)}}function Ym(t,n,s){t==="focusin"?(Mh(),Fi=n,ji=s,Fi.attachEvent("onpropertychange",Ph)):t==="focusout"&&Mh()}function Gm(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return no(ji)}function Qm(t,n){if(t==="click")return no(n)}function Jm(t,n){if(t==="input"||t==="change")return no(n)}function Zm(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Ut=typeof Object.is=="function"?Object.is:Zm;function zi(t,n){if(Ut(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),g=Object.keys(n);if(s.length!==g.length)return!1;for(g=0;g<s.length;g++){var E=s[g];if(!l.call(n,E)||!Ut(t[E],n[E]))return!1}return!0}function Nh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Bh(t,n){var s=Nh(t);t=0;for(var g;s;){if(s.nodeType===3){if(g=t+s.textContent.length,t<=n&&g>=n)return{node:s,offset:n-t};t=g}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Nh(s)}}function Ih(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Ih(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Oh(){for(var t=window,n=pe();n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=pe(t.document)}return n}function Sl(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}function e0(t){var n=Oh(),s=t.focusedElem,g=t.selectionRange;if(n!==s&&s&&s.ownerDocument&&Ih(s.ownerDocument.documentElement,s)){if(g!==null&&Sl(s)){if(n=g.start,t=g.end,t===void 0&&(t=n),"selectionStart"in s)s.selectionStart=n,s.selectionEnd=Math.min(t,s.value.length);else if(t=(n=s.ownerDocument||document)&&n.defaultView||window,t.getSelection){t=t.getSelection();var E=s.textContent.length,A=Math.min(g.start,E);g=g.end===void 0?A:Math.min(g.end,E),!t.extend&&A>g&&(E=g,g=A,A=E),E=Bh(s,A);var $=Bh(s,g);E&&$&&(t.rangeCount!==1||t.anchorNode!==E.node||t.anchorOffset!==E.offset||t.focusNode!==$.node||t.focusOffset!==$.offset)&&(n=n.createRange(),n.setStart(E.node,E.offset),t.removeAllRanges(),A>g?(t.addRange(n),t.extend($.node,$.offset)):(n.setEnd($.node,$.offset),t.addRange(n)))}}for(n=[],t=s;t=t.parentNode;)t.nodeType===1&&n.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<n.length;s++)t=n[s],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var t0=a&&"documentMode"in document&&11>=document.documentMode,Fn=null,Cl=null,$i=null,xl=!1;function Hh(t,n,s){var g=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;xl||Fn==null||Fn!==pe(g)||(g=Fn,"selectionStart"in g&&Sl(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),$i&&zi($i,g)||($i=g,g=ao(Cl,"onSelect"),0<g.length&&(n=new fl("onSelect","select",null,n,s),t.push({event:n,listeners:g}),n.target=Fn)))}function io(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var jn={animationend:io("Animation","AnimationEnd"),animationiteration:io("Animation","AnimationIteration"),animationstart:io("Animation","AnimationStart"),transitionend:io("Transition","TransitionEnd")},bl={},Fh={};a&&(Fh=document.createElement("div").style,"AnimationEvent"in window||(delete jn.animationend.animation,delete jn.animationiteration.animation,delete jn.animationstart.animation),"TransitionEvent"in window||delete jn.transitionend.transition);function so(t){if(bl[t])return bl[t];if(!jn[t])return t;var n=jn[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Fh)return bl[t]=n[s];return t}var jh=so("animationend"),zh=so("animationiteration"),$h=so("animationstart"),Wh=so("transitionend"),Uh=new Map,Vh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Br(t,n){Uh.set(t,n),S(n,[t])}for(var El=0;El<Vh.length;El++){var kl=Vh[El],r0=kl.toLowerCase(),n0=kl[0].toUpperCase()+kl.slice(1);Br(r0,"on"+n0)}Br(jh,"onAnimationEnd"),Br(zh,"onAnimationIteration"),Br($h,"onAnimationStart"),Br("dblclick","onDoubleClick"),Br("focusin","onFocus"),Br("focusout","onBlur"),Br(Wh,"onTransitionEnd"),y("onMouseEnter",["mouseout","mouseover"]),y("onMouseLeave",["mouseout","mouseover"]),y("onPointerEnter",["pointerout","pointerover"]),y("onPointerLeave",["pointerout","pointerover"]),S("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),S("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),S("onBeforeInput",["compositionend","keypress","textInput","paste"]),S("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),S("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),S("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),i0=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wi));function qh(t,n,s){var g=t.type||"unknown-event";t.currentTarget=s,Qa(g,n,void 0,t),t.currentTarget=null}function Kh(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var g=t[s],E=g.event;g=g.listeners;e:{var A=void 0;if(n)for(var $=g.length-1;0<=$;$--){var Y=g[$],Q=Y.instance,oe=Y.currentTarget;if(Y=Y.listener,Q!==A&&E.isPropagationStopped())break e;qh(E,Y,oe),A=Q}else for($=0;$<g.length;$++){if(Y=g[$],Q=Y.instance,oe=Y.currentTarget,Y=Y.listener,Q!==A&&E.isPropagationStopped())break e;qh(E,Y,oe),A=Q}}}if(An)throw t=Ei,An=!1,Ei=null,t}function Fe(t,n){var s=n[Nl];s===void 0&&(s=n[Nl]=new Set);var g=t+"__bubble";s.has(g)||(Xh(n,t,2,!1),s.add(g))}function Ll(t,n,s){var g=0;n&&(g|=4),Xh(s,t,g,n)}var oo="_reactListening"+Math.random().toString(36).slice(2);function Ui(t){if(!t[oo]){t[oo]=!0,o.forEach(function(s){s!=="selectionchange"&&(i0.has(s)||Ll(s,!1,t),Ll(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[oo]||(n[oo]=!0,Ll("selectionchange",!1,n))}}function Xh(t,n,s,g){switch(mh(n)){case 1:var E=vm;break;case 4:E=ym;break;default:E=ul}s=E.bind(null,n,s,t),E=void 0,!bi||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(E=!0),g?E!==void 0?t.addEventListener(n,s,{capture:!0,passive:E}):t.addEventListener(n,s,!0):E!==void 0?t.addEventListener(n,s,{passive:E}):t.addEventListener(n,s,!1)}function Rl(t,n,s,g,E){var A=g;if((n&1)===0&&(n&2)===0&&g!==null)e:for(;;){if(g===null)return;var $=g.tag;if($===3||$===4){var Y=g.stateNode.containerInfo;if(Y===E||Y.nodeType===8&&Y.parentNode===E)break;if($===4)for($=g.return;$!==null;){var Q=$.tag;if((Q===3||Q===4)&&(Q=$.stateNode.containerInfo,Q===E||Q.nodeType===8&&Q.parentNode===E))return;$=$.return}for(;Y!==null;){if($=ln(Y),$===null)return;if(Q=$.tag,Q===5||Q===6){g=A=$;continue e}Y=Y.parentNode}}g=g.return}Fs(function(){var oe=A,de=Si(s),fe=[];e:{var he=Uh.get(t);if(he!==void 0){var me=fl,ye=t;switch(t){case"keypress":if(eo(s)===0)break e;case"keydown":case"keyup":me=Nm;break;case"focusin":ye="focus",me=gl;break;case"focusout":ye="blur",me=gl;break;case"beforeblur":case"afterblur":me=gl;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=wh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=Cm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=Om;break;case jh:case zh:case $h:me=Em;break;case Wh:me=Fm;break;case"scroll":me=wm;break;case"wheel":me=zm;break;case"copy":case"cut":case"paste":me=Lm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Ch}var we=(n&4)!==0,Ze=!we&&t==="scroll",ne=we?he!==null?he+"Capture":null:he;we=[];for(var ee=oe,se;ee!==null;){se=ee;var _e=se.stateNode;if(se.tag===5&&_e!==null&&(se=_e,ne!==null&&(_e=rn(ee,ne),_e!=null&&we.push(Vi(ee,_e,se)))),Ze)break;ee=ee.return}0<we.length&&(he=new me(he,ye,null,s,de),fe.push({event:he,listeners:we}))}}if((n&7)===0){e:{if(he=t==="mouseover"||t==="pointerover",me=t==="mouseout"||t==="pointerout",he&&s!==wi&&(ye=s.relatedTarget||s.fromElement)&&(ln(ye)||ye[_r]))break e;if((me||he)&&(he=de.window===de?de:(he=de.ownerDocument)?he.defaultView||he.parentWindow:window,me?(ye=s.relatedTarget||s.toElement,me=oe,ye=ye?ln(ye):null,ye!==null&&(Ze=rr(ye),ye!==Ze||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(me=null,ye=oe),me!==ye)){if(we=wh,_e="onMouseLeave",ne="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&(we=Ch,_e="onPointerLeave",ne="onPointerEnter",ee="pointer"),Ze=me==null?he:Wn(me),se=ye==null?he:Wn(ye),he=new we(_e,ee+"leave",me,s,de),he.target=Ze,he.relatedTarget=se,_e=null,ln(de)===oe&&(we=new we(ne,ee+"enter",ye,s,de),we.target=se,we.relatedTarget=Ze,_e=we),Ze=_e,me&&ye)t:{for(we=me,ne=ye,ee=0,se=we;se;se=zn(se))ee++;for(se=0,_e=ne;_e;_e=zn(_e))se++;for(;0<ee-se;)we=zn(we),ee--;for(;0<se-ee;)ne=zn(ne),se--;for(;ee--;){if(we===ne||ne!==null&&we===ne.alternate)break t;we=zn(we),ne=zn(ne)}we=null}else we=null;me!==null&&Yh(fe,he,me,we,!1),ye!==null&&Ze!==null&&Yh(fe,Ze,ye,we,!0)}}e:{if(he=oe?Wn(oe):window,me=he.nodeName&&he.nodeName.toLowerCase(),me==="select"||me==="input"&&he.type==="file")var Ce=Xm;else if(Rh(he))if(Ah)Ce=Jm;else{Ce=Gm;var Ee=Ym}else(me=he.nodeName)&&me.toLowerCase()==="input"&&(he.type==="checkbox"||he.type==="radio")&&(Ce=Qm);if(Ce&&(Ce=Ce(t,oe))){Dh(fe,Ce,s,de);break e}Ee&&Ee(t,he,oe),t==="focusout"&&(Ee=he._wrapperState)&&Ee.controlled&&he.type==="number"&&Ie(he,"number",he.value)}switch(Ee=oe?Wn(oe):window,t){case"focusin":(Rh(Ee)||Ee.contentEditable==="true")&&(Fn=Ee,Cl=oe,$i=null);break;case"focusout":$i=Cl=Fn=null;break;case"mousedown":xl=!0;break;case"contextmenu":case"mouseup":case"dragend":xl=!1,Hh(fe,s,de);break;case"selectionchange":if(t0)break;case"keydown":case"keyup":Hh(fe,s,de)}var ke;if(vl)e:{switch(t){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Hn?kh(t,s)&&(Le="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Le="onCompositionStart");Le&&(xh&&s.locale!=="ko"&&(Hn||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Hn&&(ke=vh()):(Nr=de,dl="value"in Nr?Nr.value:Nr.textContent,Hn=!0)),Ee=ao(oe,Le),0<Ee.length&&(Le=new Sh(Le,t,null,s,de),fe.push({event:Le,listeners:Ee}),ke?Le.data=ke:(ke=Lh(s),ke!==null&&(Le.data=ke)))),(ke=Wm?Um(t,s):Vm(t,s))&&(oe=ao(oe,"onBeforeInput"),0<oe.length&&(de=new Sh("onBeforeInput","beforeinput",null,s,de),fe.push({event:de,listeners:oe}),de.data=ke))}Kh(fe,n)})}function Vi(t,n,s){return{instance:t,listener:n,currentTarget:s}}function ao(t,n){for(var s=n+"Capture",g=[];t!==null;){var E=t,A=E.stateNode;E.tag===5&&A!==null&&(E=A,A=rn(t,s),A!=null&&g.unshift(Vi(t,A,E)),A=rn(t,n),A!=null&&g.push(Vi(t,A,E))),t=t.return}return g}function zn(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Yh(t,n,s,g,E){for(var A=n._reactName,$=[];s!==null&&s!==g;){var Y=s,Q=Y.alternate,oe=Y.stateNode;if(Q!==null&&Q===g)break;Y.tag===5&&oe!==null&&(Y=oe,E?(Q=rn(s,A),Q!=null&&$.unshift(Vi(s,Q,Y))):E||(Q=rn(s,A),Q!=null&&$.push(Vi(s,Q,Y)))),s=s.return}$.length!==0&&t.push({event:n,listeners:$})}var s0=/\r\n?/g,o0=/\u0000|\uFFFD/g;function Gh(t){return(typeof t=="string"?t:""+t).replace(s0,`
|
|
38
|
-
`).replace(o0,"")}function lo(t,n,s){if(n=Gh(n),Gh(t)!==n&&s)throw Error(i(425))}function co(){}var Dl=null,Al=null;function Tl(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ml=typeof setTimeout=="function"?setTimeout:void 0,a0=typeof clearTimeout=="function"?clearTimeout:void 0,Qh=typeof Promise=="function"?Promise:void 0,l0=typeof queueMicrotask=="function"?queueMicrotask:typeof Qh<"u"?function(t){return Qh.resolve(null).then(t).catch(c0)}:Ml;function c0(t){setTimeout(function(){throw t})}function Pl(t,n){var s=n,g=0;do{var E=s.nextSibling;if(t.removeChild(s),E&&E.nodeType===8)if(s=E.data,s==="/$"){if(g===0){t.removeChild(E),Bi(n);return}g--}else s!=="$"&&s!=="$?"&&s!=="$!"||g++;s=E}while(s);Bi(n)}function Ir(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return t}function Jh(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return t;n--}else s==="/$"&&n++}t=t.previousSibling}return null}var $n=Math.random().toString(36).slice(2),ir="__reactFiber$"+$n,qi="__reactProps$"+$n,_r="__reactContainer$"+$n,Nl="__reactEvents$"+$n,u0="__reactListeners$"+$n,h0="__reactHandles$"+$n;function ln(t){var n=t[ir];if(n)return n;for(var s=t.parentNode;s;){if(n=s[_r]||s[ir]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Jh(t);t!==null;){if(s=t[ir])return s;t=Jh(t)}return n}t=s,s=t.parentNode}return null}function Ki(t){return t=t[ir]||t[_r],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Wn(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(i(33))}function uo(t){return t[qi]||null}var Bl=[],Un=-1;function Or(t){return{current:t}}function je(t){0>Un||(t.current=Bl[Un],Bl[Un]=null,Un--)}function He(t,n){Un++,Bl[Un]=t.current,t.current=n}var Hr={},_t=Or(Hr),St=Or(!1),cn=Hr;function Vn(t,n){var s=t.type.contextTypes;if(!s)return Hr;var g=t.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===n)return g.__reactInternalMemoizedMaskedChildContext;var E={},A;for(A in s)E[A]=n[A];return g&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=E),E}function Ct(t){return t=t.childContextTypes,t!=null}function ho(){je(St),je(_t)}function Zh(t,n,s){if(_t.current!==Hr)throw Error(i(168));He(_t,n),He(St,s)}function ed(t,n,s){var g=t.stateNode;if(n=n.childContextTypes,typeof g.getChildContext!="function")return s;g=g.getChildContext();for(var E in g)if(!(E in n))throw Error(i(108,X(t)||"Unknown",E));return B({},s,g)}function fo(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Hr,cn=_t.current,He(_t,t),He(St,St.current),!0}function td(t,n,s){var g=t.stateNode;if(!g)throw Error(i(169));s?(t=ed(t,n,cn),g.__reactInternalMemoizedMergedChildContext=t,je(St),je(_t),He(_t,t)):je(St),He(St,s)}var gr=null,po=!1,Il=!1;function rd(t){gr===null?gr=[t]:gr.push(t)}function d0(t){po=!0,rd(t)}function Fr(){if(!Il&&gr!==null){Il=!0;var t=0,n=Be;try{var s=gr;for(Be=1;t<s.length;t++){var g=s[t];do g=g(!0);while(g!==null)}gr=null,po=!1}catch(E){throw gr!==null&&(gr=gr.slice(t+1)),$s(Ri,Fr),E}finally{Be=n,Il=!1}}return null}var qn=[],Kn=0,_o=null,go=0,Ot=[],Ht=0,un=null,mr=1,vr="";function hn(t,n){qn[Kn++]=go,qn[Kn++]=_o,_o=t,go=n}function nd(t,n,s){Ot[Ht++]=mr,Ot[Ht++]=vr,Ot[Ht++]=un,un=t;var g=mr;t=vr;var E=32-Dt(g)-1;g&=~(1<<E),s+=1;var A=32-Dt(n)+E;if(30<A){var $=E-E%5;A=(g&(1<<$)-1).toString(32),g>>=$,E-=$,mr=1<<32-Dt(n)+E|s<<E|g,vr=A+t}else mr=1<<A|s<<E|g,vr=t}function Ol(t){t.return!==null&&(hn(t,1),nd(t,1,0))}function Hl(t){for(;t===_o;)_o=qn[--Kn],qn[Kn]=null,go=qn[--Kn],qn[Kn]=null;for(;t===un;)un=Ot[--Ht],Ot[Ht]=null,vr=Ot[--Ht],Ot[Ht]=null,mr=Ot[--Ht],Ot[Ht]=null}var Tt=null,Mt=null,We=!1,Vt=null;function id(t,n){var s=$t(5,null,null,0);s.elementType="DELETED",s.stateNode=n,s.return=t,n=t.deletions,n===null?(t.deletions=[s],t.flags|=16):n.push(s)}function sd(t,n){switch(t.tag){case 5:var s=t.type;return n=n.nodeType!==1||s.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(t.stateNode=n,Tt=t,Mt=Ir(n.firstChild),!0):!1;case 6:return n=t.pendingProps===""||n.nodeType!==3?null:n,n!==null?(t.stateNode=n,Tt=t,Mt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=un!==null?{id:mr,overflow:vr}:null,t.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=$t(18,null,null,0),s.stateNode=n,s.return=t,t.child=s,Tt=t,Mt=null,!0):!1;default:return!1}}function Fl(t){return(t.mode&1)!==0&&(t.flags&128)===0}function jl(t){if(We){var n=Mt;if(n){var s=n;if(!sd(t,n)){if(Fl(t))throw Error(i(418));n=Ir(s.nextSibling);var g=Tt;n&&sd(t,n)?id(g,s):(t.flags=t.flags&-4097|2,We=!1,Tt=t)}}else{if(Fl(t))throw Error(i(418));t.flags=t.flags&-4097|2,We=!1,Tt=t}}}function od(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Tt=t}function mo(t){if(t!==Tt)return!1;if(!We)return od(t),We=!0,!1;var n;if((n=t.tag!==3)&&!(n=t.tag!==5)&&(n=t.type,n=n!=="head"&&n!=="body"&&!Tl(t.type,t.memoizedProps)),n&&(n=Mt)){if(Fl(t))throw ad(),Error(i(418));for(;n;)id(t,n),n=Ir(n.nextSibling)}if(od(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));e:{for(t=t.nextSibling,n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"){if(n===0){Mt=Ir(t.nextSibling);break e}n--}else s!=="$"&&s!=="$!"&&s!=="$?"||n++}t=t.nextSibling}Mt=null}}else Mt=Tt?Ir(t.stateNode.nextSibling):null;return!0}function ad(){for(var t=Mt;t;)t=Ir(t.nextSibling)}function Xn(){Mt=Tt=null,We=!1}function zl(t){Vt===null?Vt=[t]:Vt.push(t)}var f0=w.ReactCurrentBatchConfig;function Xi(t,n,s){if(t=s.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(i(309));var g=s.stateNode}if(!g)throw Error(i(147,t));var E=g,A=""+t;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===A?n.ref:(n=function($){var Y=E.refs;$===null?delete Y[A]:Y[A]=$},n._stringRef=A,n)}if(typeof t!="string")throw Error(i(284));if(!s._owner)throw Error(i(290,t))}return t}function vo(t,n){throw t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t))}function ld(t){var n=t._init;return n(t._payload)}function cd(t){function n(ne,ee){if(t){var se=ne.deletions;se===null?(ne.deletions=[ee],ne.flags|=16):se.push(ee)}}function s(ne,ee){if(!t)return null;for(;ee!==null;)n(ne,ee),ee=ee.sibling;return null}function g(ne,ee){for(ne=new Map;ee!==null;)ee.key!==null?ne.set(ee.key,ee):ne.set(ee.index,ee),ee=ee.sibling;return ne}function E(ne,ee){return ne=Kr(ne,ee),ne.index=0,ne.sibling=null,ne}function A(ne,ee,se){return ne.index=se,t?(se=ne.alternate,se!==null?(se=se.index,se<ee?(ne.flags|=2,ee):se):(ne.flags|=2,ee)):(ne.flags|=1048576,ee)}function $(ne){return t&&ne.alternate===null&&(ne.flags|=2),ne}function Y(ne,ee,se,_e){return ee===null||ee.tag!==6?(ee=Mc(se,ne.mode,_e),ee.return=ne,ee):(ee=E(ee,se),ee.return=ne,ee)}function Q(ne,ee,se,_e){var Ce=se.type;return Ce===D?de(ne,ee,se.props.children,_e,se.key):ee!==null&&(ee.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===U&&ld(Ce)===ee.type)?(_e=E(ee,se.props),_e.ref=Xi(ne,ee,se),_e.return=ne,_e):(_e=$o(se.type,se.key,se.props,null,ne.mode,_e),_e.ref=Xi(ne,ee,se),_e.return=ne,_e)}function oe(ne,ee,se,_e){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==se.containerInfo||ee.stateNode.implementation!==se.implementation?(ee=Pc(se,ne.mode,_e),ee.return=ne,ee):(ee=E(ee,se.children||[]),ee.return=ne,ee)}function de(ne,ee,se,_e,Ce){return ee===null||ee.tag!==7?(ee=yn(se,ne.mode,_e,Ce),ee.return=ne,ee):(ee=E(ee,se),ee.return=ne,ee)}function fe(ne,ee,se){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=Mc(""+ee,ne.mode,se),ee.return=ne,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case L:return se=$o(ee.type,ee.key,ee.props,null,ne.mode,se),se.ref=Xi(ne,null,ee),se.return=ne,se;case R:return ee=Pc(ee,ne.mode,se),ee.return=ne,ee;case U:var _e=ee._init;return fe(ne,_e(ee._payload),se)}if(ze(ee)||T(ee))return ee=yn(ee,ne.mode,se,null),ee.return=ne,ee;vo(ne,ee)}return null}function he(ne,ee,se,_e){var Ce=ee!==null?ee.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return Ce!==null?null:Y(ne,ee,""+se,_e);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case L:return se.key===Ce?Q(ne,ee,se,_e):null;case R:return se.key===Ce?oe(ne,ee,se,_e):null;case U:return Ce=se._init,he(ne,ee,Ce(se._payload),_e)}if(ze(se)||T(se))return Ce!==null?null:de(ne,ee,se,_e,null);vo(ne,se)}return null}function me(ne,ee,se,_e,Ce){if(typeof _e=="string"&&_e!==""||typeof _e=="number")return ne=ne.get(se)||null,Y(ee,ne,""+_e,Ce);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case L:return ne=ne.get(_e.key===null?se:_e.key)||null,Q(ee,ne,_e,Ce);case R:return ne=ne.get(_e.key===null?se:_e.key)||null,oe(ee,ne,_e,Ce);case U:var Ee=_e._init;return me(ne,ee,se,Ee(_e._payload),Ce)}if(ze(_e)||T(_e))return ne=ne.get(se)||null,de(ee,ne,_e,Ce,null);vo(ee,_e)}return null}function ye(ne,ee,se,_e){for(var Ce=null,Ee=null,ke=ee,Le=ee=0,ct=null;ke!==null&&Le<se.length;Le++){ke.index>Le?(ct=ke,ke=null):ct=ke.sibling;var Pe=he(ne,ke,se[Le],_e);if(Pe===null){ke===null&&(ke=ct);break}t&&ke&&Pe.alternate===null&&n(ne,ke),ee=A(Pe,ee,Le),Ee===null?Ce=Pe:Ee.sibling=Pe,Ee=Pe,ke=ct}if(Le===se.length)return s(ne,ke),We&&hn(ne,Le),Ce;if(ke===null){for(;Le<se.length;Le++)ke=fe(ne,se[Le],_e),ke!==null&&(ee=A(ke,ee,Le),Ee===null?Ce=ke:Ee.sibling=ke,Ee=ke);return We&&hn(ne,Le),Ce}for(ke=g(ne,ke);Le<se.length;Le++)ct=me(ke,ne,Le,se[Le],_e),ct!==null&&(t&&ct.alternate!==null&&ke.delete(ct.key===null?Le:ct.key),ee=A(ct,ee,Le),Ee===null?Ce=ct:Ee.sibling=ct,Ee=ct);return t&&ke.forEach(function(Xr){return n(ne,Xr)}),We&&hn(ne,Le),Ce}function we(ne,ee,se,_e){var Ce=T(se);if(typeof Ce!="function")throw Error(i(150));if(se=Ce.call(se),se==null)throw Error(i(151));for(var Ee=Ce=null,ke=ee,Le=ee=0,ct=null,Pe=se.next();ke!==null&&!Pe.done;Le++,Pe=se.next()){ke.index>Le?(ct=ke,ke=null):ct=ke.sibling;var Xr=he(ne,ke,Pe.value,_e);if(Xr===null){ke===null&&(ke=ct);break}t&&ke&&Xr.alternate===null&&n(ne,ke),ee=A(Xr,ee,Le),Ee===null?Ce=Xr:Ee.sibling=Xr,Ee=Xr,ke=ct}if(Pe.done)return s(ne,ke),We&&hn(ne,Le),Ce;if(ke===null){for(;!Pe.done;Le++,Pe=se.next())Pe=fe(ne,Pe.value,_e),Pe!==null&&(ee=A(Pe,ee,Le),Ee===null?Ce=Pe:Ee.sibling=Pe,Ee=Pe);return We&&hn(ne,Le),Ce}for(ke=g(ne,ke);!Pe.done;Le++,Pe=se.next())Pe=me(ke,ne,Le,Pe.value,_e),Pe!==null&&(t&&Pe.alternate!==null&&ke.delete(Pe.key===null?Le:Pe.key),ee=A(Pe,ee,Le),Ee===null?Ce=Pe:Ee.sibling=Pe,Ee=Pe);return t&&ke.forEach(function(q0){return n(ne,q0)}),We&&hn(ne,Le),Ce}function Ze(ne,ee,se,_e){if(typeof se=="object"&&se!==null&&se.type===D&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case L:e:{for(var Ce=se.key,Ee=ee;Ee!==null;){if(Ee.key===Ce){if(Ce=se.type,Ce===D){if(Ee.tag===7){s(ne,Ee.sibling),ee=E(Ee,se.props.children),ee.return=ne,ne=ee;break e}}else if(Ee.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===U&&ld(Ce)===Ee.type){s(ne,Ee.sibling),ee=E(Ee,se.props),ee.ref=Xi(ne,Ee,se),ee.return=ne,ne=ee;break e}s(ne,Ee);break}else n(ne,Ee);Ee=Ee.sibling}se.type===D?(ee=yn(se.props.children,ne.mode,_e,se.key),ee.return=ne,ne=ee):(_e=$o(se.type,se.key,se.props,null,ne.mode,_e),_e.ref=Xi(ne,ee,se),_e.return=ne,ne=_e)}return $(ne);case R:e:{for(Ee=se.key;ee!==null;){if(ee.key===Ee)if(ee.tag===4&&ee.stateNode.containerInfo===se.containerInfo&&ee.stateNode.implementation===se.implementation){s(ne,ee.sibling),ee=E(ee,se.children||[]),ee.return=ne,ne=ee;break e}else{s(ne,ee);break}else n(ne,ee);ee=ee.sibling}ee=Pc(se,ne.mode,_e),ee.return=ne,ne=ee}return $(ne);case U:return Ee=se._init,Ze(ne,ee,Ee(se._payload),_e)}if(ze(se))return ye(ne,ee,se,_e);if(T(se))return we(ne,ee,se,_e);vo(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,ee!==null&&ee.tag===6?(s(ne,ee.sibling),ee=E(ee,se),ee.return=ne,ne=ee):(s(ne,ee),ee=Mc(se,ne.mode,_e),ee.return=ne,ne=ee),$(ne)):s(ne,ee)}return Ze}var Yn=cd(!0),ud=cd(!1),yo=Or(null),wo=null,Gn=null,$l=null;function Wl(){$l=Gn=wo=null}function Ul(t){var n=yo.current;je(yo),t._currentValue=n}function Vl(t,n,s){for(;t!==null;){var g=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,g!==null&&(g.childLanes|=n)):g!==null&&(g.childLanes&n)!==n&&(g.childLanes|=n),t===s)break;t=t.return}}function Qn(t,n){wo=t,$l=Gn=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&n)!==0&&(xt=!0),t.firstContext=null)}function Ft(t){var n=t._currentValue;if($l!==t)if(t={context:t,memoizedValue:n,next:null},Gn===null){if(wo===null)throw Error(i(308));Gn=t,wo.dependencies={lanes:0,firstContext:t}}else Gn=Gn.next=t;return n}var dn=null;function ql(t){dn===null?dn=[t]:dn.push(t)}function hd(t,n,s,g){var E=n.interleaved;return E===null?(s.next=s,ql(n)):(s.next=E.next,E.next=s),n.interleaved=s,yr(t,g)}function yr(t,n){t.lanes|=n;var s=t.alternate;for(s!==null&&(s.lanes|=n),s=t,t=t.return;t!==null;)t.childLanes|=n,s=t.alternate,s!==null&&(s.childLanes|=n),s=t,t=t.return;return s.tag===3?s.stateNode:null}var jr=!1;function Kl(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function wr(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function zr(t,n,s){var g=t.updateQueue;if(g===null)return null;if(g=g.shared,(Me&2)!==0){var E=g.pending;return E===null?n.next=n:(n.next=E.next,E.next=n),g.pending=n,yr(t,s)}return E=g.interleaved,E===null?(n.next=n,ql(g)):(n.next=E.next,E.next=n),g.interleaved=n,yr(t,s)}function So(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194240)!==0)){var g=n.lanes;g&=t.pendingLanes,s|=g,n.lanes=s,al(t,s)}}function fd(t,n){var s=t.updateQueue,g=t.alternate;if(g!==null&&(g=g.updateQueue,s===g)){var E=null,A=null;if(s=s.firstBaseUpdate,s!==null){do{var $={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};A===null?E=A=$:A=A.next=$,s=s.next}while(s!==null);A===null?E=A=n:A=A.next=n}else E=A=n;s={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:A,shared:g.shared,effects:g.effects},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}function Co(t,n,s,g){var E=t.updateQueue;jr=!1;var A=E.firstBaseUpdate,$=E.lastBaseUpdate,Y=E.shared.pending;if(Y!==null){E.shared.pending=null;var Q=Y,oe=Q.next;Q.next=null,$===null?A=oe:$.next=oe,$=Q;var de=t.alternate;de!==null&&(de=de.updateQueue,Y=de.lastBaseUpdate,Y!==$&&(Y===null?de.firstBaseUpdate=oe:Y.next=oe,de.lastBaseUpdate=Q))}if(A!==null){var fe=E.baseState;$=0,de=oe=Q=null,Y=A;do{var he=Y.lane,me=Y.eventTime;if((g&he)===he){de!==null&&(de=de.next={eventTime:me,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var ye=t,we=Y;switch(he=n,me=s,we.tag){case 1:if(ye=we.payload,typeof ye=="function"){fe=ye.call(me,fe,he);break e}fe=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=we.payload,he=typeof ye=="function"?ye.call(me,fe,he):ye,he==null)break e;fe=B({},fe,he);break e;case 2:jr=!0}}Y.callback!==null&&Y.lane!==0&&(t.flags|=64,he=E.effects,he===null?E.effects=[Y]:he.push(Y))}else me={eventTime:me,lane:he,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},de===null?(oe=de=me,Q=fe):de=de.next=me,$|=he;if(Y=Y.next,Y===null){if(Y=E.shared.pending,Y===null)break;he=Y,Y=he.next,he.next=null,E.lastBaseUpdate=he,E.shared.pending=null}}while(!0);if(de===null&&(Q=fe),E.baseState=Q,E.firstBaseUpdate=oe,E.lastBaseUpdate=de,n=E.shared.interleaved,n!==null){E=n;do $|=E.lane,E=E.next;while(E!==n)}else A===null&&(E.shared.lanes=0);_n|=$,t.lanes=$,t.memoizedState=fe}}function pd(t,n,s){if(t=n.effects,n.effects=null,t!==null)for(n=0;n<t.length;n++){var g=t[n],E=g.callback;if(E!==null){if(g.callback=null,g=s,typeof E!="function")throw Error(i(191,E));E.call(g)}}}var Yi={},sr=Or(Yi),Gi=Or(Yi),Qi=Or(Yi);function fn(t){if(t===Yi)throw Error(i(174));return t}function Xl(t,n){switch(He(Qi,n),He(Gi,t),He(sr,Yi),t=n.nodeType,t){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:ht(null,"");break;default:t=t===8?n.parentNode:n,n=t.namespaceURI||null,t=t.tagName,n=ht(n,t)}je(sr),He(sr,n)}function Jn(){je(sr),je(Gi),je(Qi)}function _d(t){fn(Qi.current);var n=fn(sr.current),s=ht(n,t.type);n!==s&&(He(Gi,t),He(sr,s))}function Yl(t){Gi.current===t&&(je(sr),je(Gi))}var Xe=Or(0);function xo(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Gl=[];function Ql(){for(var t=0;t<Gl.length;t++)Gl[t]._workInProgressVersionPrimary=null;Gl.length=0}var bo=w.ReactCurrentDispatcher,Jl=w.ReactCurrentBatchConfig,pn=0,Ye=null,nt=null,at=null,Eo=!1,Ji=!1,Zi=0,p0=0;function gt(){throw Error(i(321))}function Zl(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Ut(t[s],n[s]))return!1;return!0}function ec(t,n,s,g,E,A){if(pn=A,Ye=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,bo.current=t===null||t.memoizedState===null?v0:y0,t=s(g,E),Ji){A=0;do{if(Ji=!1,Zi=0,25<=A)throw Error(i(301));A+=1,at=nt=null,n.updateQueue=null,bo.current=w0,t=s(g,E)}while(Ji)}if(bo.current=Ro,n=nt!==null&&nt.next!==null,pn=0,at=nt=Ye=null,Eo=!1,n)throw Error(i(300));return t}function tc(){var t=Zi!==0;return Zi=0,t}function or(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?Ye.memoizedState=at=t:at=at.next=t,at}function jt(){if(nt===null){var t=Ye.alternate;t=t!==null?t.memoizedState:null}else t=nt.next;var n=at===null?Ye.memoizedState:at.next;if(n!==null)at=n,nt=t;else{if(t===null)throw Error(i(310));nt=t,t={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},at===null?Ye.memoizedState=at=t:at=at.next=t}return at}function es(t,n){return typeof n=="function"?n(t):n}function rc(t){var n=jt(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var g=nt,E=g.baseQueue,A=s.pending;if(A!==null){if(E!==null){var $=E.next;E.next=A.next,A.next=$}g.baseQueue=E=A,s.pending=null}if(E!==null){A=E.next,g=g.baseState;var Y=$=null,Q=null,oe=A;do{var de=oe.lane;if((pn&de)===de)Q!==null&&(Q=Q.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),g=oe.hasEagerState?oe.eagerState:t(g,oe.action);else{var fe={lane:de,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};Q===null?(Y=Q=fe,$=g):Q=Q.next=fe,Ye.lanes|=de,_n|=de}oe=oe.next}while(oe!==null&&oe!==A);Q===null?$=g:Q.next=Y,Ut(g,n.memoizedState)||(xt=!0),n.memoizedState=g,n.baseState=$,n.baseQueue=Q,s.lastRenderedState=g}if(t=s.interleaved,t!==null){E=t;do A=E.lane,Ye.lanes|=A,_n|=A,E=E.next;while(E!==t)}else E===null&&(s.lanes=0);return[n.memoizedState,s.dispatch]}function nc(t){var n=jt(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var g=s.dispatch,E=s.pending,A=n.memoizedState;if(E!==null){s.pending=null;var $=E=E.next;do A=t(A,$.action),$=$.next;while($!==E);Ut(A,n.memoizedState)||(xt=!0),n.memoizedState=A,n.baseQueue===null&&(n.baseState=A),s.lastRenderedState=A}return[A,g]}function gd(){}function md(t,n){var s=Ye,g=jt(),E=n(),A=!Ut(g.memoizedState,E);if(A&&(g.memoizedState=E,xt=!0),g=g.queue,ic(wd.bind(null,s,g,t),[t]),g.getSnapshot!==n||A||at!==null&&at.memoizedState.tag&1){if(s.flags|=2048,ts(9,yd.bind(null,s,g,E,n),void 0,null),lt===null)throw Error(i(349));(pn&30)!==0||vd(s,n,E)}return E}function vd(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Ye.updateQueue,n===null?(n={lastEffect:null,stores:null},Ye.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function yd(t,n,s,g){n.value=s,n.getSnapshot=g,Sd(n)&&Cd(t)}function wd(t,n,s){return s(function(){Sd(n)&&Cd(t)})}function Sd(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Ut(t,s)}catch{return!0}}function Cd(t){var n=yr(t,1);n!==null&&Yt(n,t,1,-1)}function xd(t){var n=or();return typeof t=="function"&&(t=t()),n.memoizedState=n.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:t},n.queue=t,t=t.dispatch=m0.bind(null,Ye,t),[n.memoizedState,t]}function ts(t,n,s,g){return t={tag:t,create:n,destroy:s,deps:g,next:null},n=Ye.updateQueue,n===null?(n={lastEffect:null,stores:null},Ye.updateQueue=n,n.lastEffect=t.next=t):(s=n.lastEffect,s===null?n.lastEffect=t.next=t:(g=s.next,s.next=t,t.next=g,n.lastEffect=t)),t}function bd(){return jt().memoizedState}function ko(t,n,s,g){var E=or();Ye.flags|=t,E.memoizedState=ts(1|n,s,void 0,g===void 0?null:g)}function Lo(t,n,s,g){var E=jt();g=g===void 0?null:g;var A=void 0;if(nt!==null){var $=nt.memoizedState;if(A=$.destroy,g!==null&&Zl(g,$.deps)){E.memoizedState=ts(n,s,A,g);return}}Ye.flags|=t,E.memoizedState=ts(1|n,s,A,g)}function Ed(t,n){return ko(8390656,8,t,n)}function ic(t,n){return Lo(2048,8,t,n)}function kd(t,n){return Lo(4,2,t,n)}function Ld(t,n){return Lo(4,4,t,n)}function Rd(t,n){if(typeof n=="function")return t=t(),n(t),function(){n(null)};if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Dd(t,n,s){return s=s!=null?s.concat([t]):null,Lo(4,4,Rd.bind(null,n,t),s)}function sc(){}function Ad(t,n){var s=jt();n=n===void 0?null:n;var g=s.memoizedState;return g!==null&&n!==null&&Zl(n,g[1])?g[0]:(s.memoizedState=[t,n],t)}function Td(t,n){var s=jt();n=n===void 0?null:n;var g=s.memoizedState;return g!==null&&n!==null&&Zl(n,g[1])?g[0]:(t=t(),s.memoizedState=[t,n],t)}function Md(t,n,s){return(pn&21)===0?(t.baseState&&(t.baseState=!1,xt=!0),t.memoizedState=s):(Ut(s,n)||(s=Bn(),Ye.lanes|=s,_n|=s,t.baseState=!0),n)}function _0(t,n){var s=Be;Be=s!==0&&4>s?s:4,t(!0);var g=Jl.transition;Jl.transition={};try{t(!1),n()}finally{Be=s,Jl.transition=g}}function Pd(){return jt().memoizedState}function g0(t,n,s){var g=Vr(t);if(s={lane:g,action:s,hasEagerState:!1,eagerState:null,next:null},Nd(t))Bd(n,s);else if(s=hd(t,n,s,g),s!==null){var E=wt();Yt(s,t,g,E),Id(s,n,g)}}function m0(t,n,s){var g=Vr(t),E={lane:g,action:s,hasEagerState:!1,eagerState:null,next:null};if(Nd(t))Bd(n,E);else{var A=t.alternate;if(t.lanes===0&&(A===null||A.lanes===0)&&(A=n.lastRenderedReducer,A!==null))try{var $=n.lastRenderedState,Y=A($,s);if(E.hasEagerState=!0,E.eagerState=Y,Ut(Y,$)){var Q=n.interleaved;Q===null?(E.next=E,ql(n)):(E.next=Q.next,Q.next=E),n.interleaved=E;return}}catch{}finally{}s=hd(t,n,E,g),s!==null&&(E=wt(),Yt(s,t,g,E),Id(s,n,g))}}function Nd(t){var n=t.alternate;return t===Ye||n!==null&&n===Ye}function Bd(t,n){Ji=Eo=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function Id(t,n,s){if((s&4194240)!==0){var g=n.lanes;g&=t.pendingLanes,s|=g,n.lanes=s,al(t,s)}}var Ro={readContext:Ft,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},v0={readContext:Ft,useCallback:function(t,n){return or().memoizedState=[t,n===void 0?null:n],t},useContext:Ft,useEffect:Ed,useImperativeHandle:function(t,n,s){return s=s!=null?s.concat([t]):null,ko(4194308,4,Rd.bind(null,n,t),s)},useLayoutEffect:function(t,n){return ko(4194308,4,t,n)},useInsertionEffect:function(t,n){return ko(4,2,t,n)},useMemo:function(t,n){var s=or();return n=n===void 0?null:n,t=t(),s.memoizedState=[t,n],t},useReducer:function(t,n,s){var g=or();return n=s!==void 0?s(n):n,g.memoizedState=g.baseState=n,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},g.queue=t,t=t.dispatch=g0.bind(null,Ye,t),[g.memoizedState,t]},useRef:function(t){var n=or();return t={current:t},n.memoizedState=t},useState:xd,useDebugValue:sc,useDeferredValue:function(t){return or().memoizedState=t},useTransition:function(){var t=xd(!1),n=t[0];return t=_0.bind(null,t[1]),or().memoizedState=t,[n,t]},useMutableSource:function(){},useSyncExternalStore:function(t,n,s){var g=Ye,E=or();if(We){if(s===void 0)throw Error(i(407));s=s()}else{if(s=n(),lt===null)throw Error(i(349));(pn&30)!==0||vd(g,n,s)}E.memoizedState=s;var A={value:s,getSnapshot:n};return E.queue=A,Ed(wd.bind(null,g,A,t),[t]),g.flags|=2048,ts(9,yd.bind(null,g,A,s,n),void 0,null),s},useId:function(){var t=or(),n=lt.identifierPrefix;if(We){var s=vr,g=mr;s=(g&~(1<<32-Dt(g)-1)).toString(32)+s,n=":"+n+"R"+s,s=Zi++,0<s&&(n+="H"+s.toString(32)),n+=":"}else s=p0++,n=":"+n+"r"+s.toString(32)+":";return t.memoizedState=n},unstable_isNewReconciler:!1},y0={readContext:Ft,useCallback:Ad,useContext:Ft,useEffect:ic,useImperativeHandle:Dd,useInsertionEffect:kd,useLayoutEffect:Ld,useMemo:Td,useReducer:rc,useRef:bd,useState:function(){return rc(es)},useDebugValue:sc,useDeferredValue:function(t){var n=jt();return Md(n,nt.memoizedState,t)},useTransition:function(){var t=rc(es)[0],n=jt().memoizedState;return[t,n]},useMutableSource:gd,useSyncExternalStore:md,useId:Pd,unstable_isNewReconciler:!1},w0={readContext:Ft,useCallback:Ad,useContext:Ft,useEffect:ic,useImperativeHandle:Dd,useInsertionEffect:kd,useLayoutEffect:Ld,useMemo:Td,useReducer:nc,useRef:bd,useState:function(){return nc(es)},useDebugValue:sc,useDeferredValue:function(t){var n=jt();return nt===null?n.memoizedState=t:Md(n,nt.memoizedState,t)},useTransition:function(){var t=nc(es)[0],n=jt().memoizedState;return[t,n]},useMutableSource:gd,useSyncExternalStore:md,useId:Pd,unstable_isNewReconciler:!1};function qt(t,n){if(t&&t.defaultProps){n=B({},n),t=t.defaultProps;for(var s in t)n[s]===void 0&&(n[s]=t[s]);return n}return n}function oc(t,n,s,g){n=t.memoizedState,s=s(g,n),s=s==null?n:B({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Do={isMounted:function(t){return(t=t._reactInternals)?rr(t)===t:!1},enqueueSetState:function(t,n,s){t=t._reactInternals;var g=wt(),E=Vr(t),A=wr(g,E);A.payload=n,s!=null&&(A.callback=s),n=zr(t,A,E),n!==null&&(Yt(n,t,E,g),So(n,t,E))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var g=wt(),E=Vr(t),A=wr(g,E);A.tag=1,A.payload=n,s!=null&&(A.callback=s),n=zr(t,A,E),n!==null&&(Yt(n,t,E,g),So(n,t,E))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=wt(),g=Vr(t),E=wr(s,g);E.tag=2,n!=null&&(E.callback=n),n=zr(t,E,g),n!==null&&(Yt(n,t,g,s),So(n,t,g))}};function Od(t,n,s,g,E,A,$){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(g,A,$):n.prototype&&n.prototype.isPureReactComponent?!zi(s,g)||!zi(E,A):!0}function Hd(t,n,s){var g=!1,E=Hr,A=n.contextType;return typeof A=="object"&&A!==null?A=Ft(A):(E=Ct(n)?cn:_t.current,g=n.contextTypes,A=(g=g!=null)?Vn(t,E):Hr),n=new n(s,A),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Do,t.stateNode=n,n._reactInternals=t,g&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=E,t.__reactInternalMemoizedMaskedChildContext=A),n}function Fd(t,n,s,g){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,g),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,g),n.state!==t&&Do.enqueueReplaceState(n,n.state,null)}function ac(t,n,s,g){var E=t.stateNode;E.props=s,E.state=t.memoizedState,E.refs={},Kl(t);var A=n.contextType;typeof A=="object"&&A!==null?E.context=Ft(A):(A=Ct(n)?cn:_t.current,E.context=Vn(t,A)),E.state=t.memoizedState,A=n.getDerivedStateFromProps,typeof A=="function"&&(oc(t,n,A,s),E.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(n=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),n!==E.state&&Do.enqueueReplaceState(E,E.state,null),Co(t,s,E,g),E.state=t.memoizedState),typeof E.componentDidMount=="function"&&(t.flags|=4194308)}function Zn(t,n){try{var s="",g=n;do s+=ie(g),g=g.return;while(g);var E=s}catch(A){E=`
|
|
37
|
+
`+E[$].replace(" at new "," at ");return t.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",t.displayName)),Q}while(1<=$&&0<=Y);break}}}finally{G=!1,Error.prepareStackTrace=s}return(t=t?t.displayName||t.name:"")?F(t):""}function ie(t){switch(t.tag){case 5:return F(t.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return t=Z(t.type,!1),t;case 11:return t=Z(t.type.render,!1),t;case 1:return t=Z(t.type,!0),t;default:return""}}function ae(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case D:return"Fragment";case R:return"Portal";case M:return"Profiler";case k:return"StrictMode";case N:return"Suspense";case I:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case z:return(t.displayName||"Context")+".Consumer";case W:return(t._context.displayName||"Context")+".Provider";case j:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case q:return n=t.displayName||null,n!==null?n:ae(t.type)||"Memo";case U:n=t._payload,t=t._init;try{return ae(t(n))}catch{}}return null}function X(t){var n=t.type;switch(t.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=n.render,t=t.displayName||t.name||"",n.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ae(n);case 8:return n===k?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function H(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function re(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function te(t){var n=re(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,n),g=""+t[n];if(!t.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var E=s.get,A=s.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return E.call(this)},set:function($){g=""+$,A.call(this,$)}}),Object.defineProperty(t,n,{enumerable:s.enumerable}),{getValue:function(){return g},setValue:function($){g=""+$},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function ce(t){t._valueTracker||(t._valueTracker=te(t))}function le(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),g="";return t&&(g=re(t)?t.checked?"true":"false":t.value),t=g,t!==s?(n.setValue(t),!0):!1}function pe(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Se(t,n){var s=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??t._wrapperState.initialChecked})}function be(t,n){var s=n.defaultValue==null?"":n.defaultValue,g=n.checked!=null?n.checked:n.defaultChecked;s=H(n.value!=null?n.value:s),t._wrapperState={initialChecked:g,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function ue(t,n){n=n.checked,n!=null&&u(t,"checked",n,!1)}function ge(t,n){ue(t,n);var s=H(n.value),g=n.type;if(s!=null)g==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+s):t.value!==""+s&&(t.value=""+s);else if(g==="submit"||g==="reset"){t.removeAttribute("value");return}n.hasOwnProperty("value")?Ie(t,n.type,s):n.hasOwnProperty("defaultValue")&&Ie(t,n.type,H(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(t.defaultChecked=!!n.defaultChecked)}function Re(t,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var g=n.type;if(!(g!=="submit"&&g!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+t._wrapperState.initialValue,s||n===t.value||(t.value=n),t.defaultValue=n}s=t.name,s!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,s!==""&&(t.name=s)}function Ie(t,n,s){(n!=="number"||pe(t.ownerDocument)!==t)&&(s==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+s&&(t.defaultValue=""+s))}var ze=Array.isArray;function Qe(t,n,s,g){if(t=t.options,n){n={};for(var E=0;E<s.length;E++)n["$"+s[E]]=!0;for(s=0;s<t.length;s++)E=n.hasOwnProperty("$"+t[s].value),t[s].selected!==E&&(t[s].selected=E),E&&g&&(t[s].defaultSelected=!0)}else{for(s=""+H(s),n=null,E=0;E<t.length;E++){if(t[E].value===s){t[E].selected=!0,g&&(t[E].defaultSelected=!0);return}n!==null||t[E].disabled||(n=t[E])}n!==null&&(n.selected=!0)}}function ut(t,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return B({},n,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function qe(t,n){var s=n.value;if(s==null){if(s=n.children,n=n.defaultValue,s!=null){if(n!=null)throw Error(i(92));if(ze(s)){if(1<s.length)throw Error(i(93));s=s[0]}n=s}n==null&&(n=""),s=n}t._wrapperState={initialValue:H(s)}}function pt(t,n){var s=H(n.value),g=H(n.defaultValue);s!=null&&(s=""+s,s!==t.value&&(t.value=s),n.defaultValue==null&&t.defaultValue!==s&&(t.defaultValue=s)),g!=null&&(t.defaultValue=""+g)}function Ne(t){var n=t.textContent;n===t._wrapperState.initialValue&&n!==""&&n!==null&&(t.value=n)}function Je(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ht(t,n){return t==null||t==="http://www.w3.org/1999/xhtml"?Je(n):t==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var $e,pr=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,s,g,E){MSApp.execUnsafeLocalFunction(function(){return t(n,s,g,E)})}:t})(function(t,n){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=n;else{for($e=$e||document.createElement("div"),$e.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=$e.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;n.firstChild;)t.appendChild(n.firstChild)}});function ot(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var Rt={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},Oe=["Webkit","ms","Moz","O"];Object.keys(Rt).forEach(function(t){Oe.forEach(function(n){n=n+t.charAt(0).toUpperCase()+t.substring(1),Rt[n]=Rt[t]})});function Rn(t,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||Rt.hasOwnProperty(t)&&Rt[t]?(""+n).trim():n+"px"}function Ps(t,n){t=t.style;for(var s in n)if(n.hasOwnProperty(s)){var g=s.indexOf("--")===0,E=Rn(s,n[s],g);s==="float"&&(s="cssFloat"),g?t.setProperty(s,E):t[s]=E}}var Ka=B({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 vi(t,n){if(n){if(Ka[t]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,t));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function yi(t,n){if(t.indexOf("-")===-1)return typeof n.is=="string";switch(t){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 wi=null;function Si(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ci=null,Dr=null,Ar=null;function Ns(t){if(t=Ki(t)){if(typeof Ci!="function")throw Error(i(280));var n=t.stateNode;n&&(n=uo(n),Ci(t.stateNode,t.type,n))}}function Bs(t){Dr?Ar?Ar.push(t):Ar=[t]:Dr=t}function Is(){if(Dr){var t=Dr,n=Ar;if(Ar=Dr=null,Ns(t),n)for(t=0;t<n.length;t++)Ns(n[t])}}function Os(t,n){return t(n)}function Hs(){}var xi=!1;function Fs(t,n,s){if(xi)return t(n,s);xi=!0;try{return Os(t,n,s)}finally{xi=!1,(Dr!==null||Ar!==null)&&(Hs(),Is())}}function rn(t,n){var s=t.stateNode;if(s===null)return null;var g=uo(s);if(g===null)return null;s=g[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(t=t.type,g=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!g;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(i(231,n,typeof s));return s}var bi=!1;if(a)try{var nn={};Object.defineProperty(nn,"passive",{get:function(){bi=!0}}),window.addEventListener("test",nn,nn),window.removeEventListener("test",nn,nn)}catch{bi=!1}function Xa(t,n,s,g,E,A,$,Y,Q){var oe=Array.prototype.slice.call(arguments,3);try{n.apply(s,oe)}catch(de){this.onError(de)}}var sn=!1,Dn=null,An=!1,Ei=null,Ya={onError:function(t){sn=!0,Dn=t}};function Ga(t,n,s,g,E,A,$,Y,Q){sn=!1,Dn=null,Xa.apply(Ya,arguments)}function Qa(t,n,s,g,E,A,$,Y,Q){if(Ga.apply(this,arguments),sn){if(sn){var oe=Dn;sn=!1,Dn=null}else throw Error(i(198));An||(An=!0,Ei=oe)}}function rr(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function ki(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function Li(t){if(rr(t)!==t)throw Error(i(188))}function Ja(t){var n=t.alternate;if(!n){if(n=rr(t),n===null)throw Error(i(188));return n!==t?null:t}for(var s=t,g=n;;){var E=s.return;if(E===null)break;var A=E.alternate;if(A===null){if(g=E.return,g!==null){s=g;continue}break}if(E.child===A.child){for(A=E.child;A;){if(A===s)return Li(E),t;if(A===g)return Li(E),n;A=A.sibling}throw Error(i(188))}if(s.return!==g.return)s=E,g=A;else{for(var $=!1,Y=E.child;Y;){if(Y===s){$=!0,s=E,g=A;break}if(Y===g){$=!0,g=E,s=A;break}Y=Y.sibling}if(!$){for(Y=A.child;Y;){if(Y===s){$=!0,s=A,g=E;break}if(Y===g){$=!0,g=A,s=E;break}Y=Y.sibling}if(!$)throw Error(i(189))}}if(s.alternate!==g)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?t:n}function js(t){return t=Ja(t),t!==null?zs(t):null}function zs(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var n=zs(t);if(n!==null)return n;t=t.sibling}return null}var $s=r.unstable_scheduleCallback,Ws=r.unstable_cancelCallback,Za=r.unstable_shouldYield,Us=r.unstable_requestPaint,Ke=r.unstable_now,el=r.unstable_getCurrentPriorityLevel,Ri=r.unstable_ImmediatePriority,Vs=r.unstable_UserBlockingPriority,Tn=r.unstable_NormalPriority,tl=r.unstable_LowPriority,qs=r.unstable_IdlePriority,on=null,It=null;function rl(t){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(on,t,void 0,(t.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:sl,nl=Math.log,il=Math.LN2;function sl(t){return t>>>=0,t===0?32:31-(nl(t)/il|0)|0}var Mn=64,Pn=4194304;function nr(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Nn(t,n){var s=t.pendingLanes;if(s===0)return 0;var g=0,E=t.suspendedLanes,A=t.pingedLanes,$=s&268435455;if($!==0){var Y=$&~E;Y!==0?g=nr(Y):(A&=$,A!==0&&(g=nr(A)))}else $=s&~E,$!==0?g=nr($):A!==0&&(g=nr(A));if(g===0)return 0;if(n!==0&&n!==g&&(n&E)===0&&(E=g&-g,A=n&-n,E>=A||E===16&&(A&4194240)!==0))return n;if((g&4)!==0&&(g|=s&16),n=t.entangledLanes,n!==0)for(t=t.entanglements,n&=g;0<n;)s=31-Dt(n),E=1<<s,g|=t[s],n&=~E;return g}function Ks(t,n){switch(t){case 1:case 2:case 4:return n+250;case 8:case 16:case 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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ol(t,n){for(var s=t.suspendedLanes,g=t.pingedLanes,E=t.expirationTimes,A=t.pendingLanes;0<A;){var $=31-Dt(A),Y=1<<$,Q=E[$];Q===-1?((Y&s)===0||(Y&g)!==0)&&(E[$]=Ks(Y,n)):Q<=n&&(t.expiredLanes|=Y),A&=~Y}}function Di(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Bn(){var t=Mn;return Mn<<=1,(Mn&4194240)===0&&(Mn=64),t}function Ai(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function an(t,n,s){t.pendingLanes|=n,n!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,n=31-Dt(n),t[n]=s}function Xs(t,n){var s=t.pendingLanes&~n;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=n,t.mutableReadLanes&=n,t.entangledLanes&=n,n=t.entanglements;var g=t.eventTimes;for(t=t.expirationTimes;0<s;){var E=31-Dt(s),A=1<<E;n[E]=0,g[E]=-1,t[E]=-1,s&=~A}}function al(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var g=31-Dt(s),E=1<<g;E&n|t[g]&n&&(t[g]|=n),s&=~E}}var Be=0;function ch(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var uh,ll,hh,dh,fh,cl=!1,Ys=[],Tr=null,Mr=null,Pr=null,Ti=new Map,Mi=new Map,Nr=[],_m="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ph(t,n){switch(t){case"focusin":case"focusout":Tr=null;break;case"dragenter":case"dragleave":Mr=null;break;case"mouseover":case"mouseout":Pr=null;break;case"pointerover":case"pointerout":Ti.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mi.delete(n.pointerId)}}function Pi(t,n,s,g,E,A){return t===null||t.nativeEvent!==A?(t={blockedOn:n,domEventName:s,eventSystemFlags:g,nativeEvent:A,targetContainers:[E]},n!==null&&(n=Ki(n),n!==null&&ll(n)),t):(t.eventSystemFlags|=g,n=t.targetContainers,E!==null&&n.indexOf(E)===-1&&n.push(E),t)}function gm(t,n,s,g,E){switch(n){case"focusin":return Tr=Pi(Tr,t,n,s,g,E),!0;case"dragenter":return Mr=Pi(Mr,t,n,s,g,E),!0;case"mouseover":return Pr=Pi(Pr,t,n,s,g,E),!0;case"pointerover":var A=E.pointerId;return Ti.set(A,Pi(Ti.get(A)||null,t,n,s,g,E)),!0;case"gotpointercapture":return A=E.pointerId,Mi.set(A,Pi(Mi.get(A)||null,t,n,s,g,E)),!0}return!1}function _h(t){var n=ln(t.target);if(n!==null){var s=rr(n);if(s!==null){if(n=s.tag,n===13){if(n=ki(s),n!==null){t.blockedOn=n,fh(t.priority,function(){hh(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Gs(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=hl(t.domEventName,t.eventSystemFlags,n[0],t.nativeEvent);if(s===null){s=t.nativeEvent;var g=new s.constructor(s.type,s);wi=g,s.target.dispatchEvent(g),wi=null}else return n=Ki(s),n!==null&&ll(n),t.blockedOn=s,!1;n.shift()}return!0}function gh(t,n,s){Gs(t)&&s.delete(n)}function mm(){cl=!1,Tr!==null&&Gs(Tr)&&(Tr=null),Mr!==null&&Gs(Mr)&&(Mr=null),Pr!==null&&Gs(Pr)&&(Pr=null),Ti.forEach(gh),Mi.forEach(gh)}function Ni(t,n){t.blockedOn===n&&(t.blockedOn=null,cl||(cl=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,mm)))}function Bi(t){function n(E){return Ni(E,t)}if(0<Ys.length){Ni(Ys[0],t);for(var s=1;s<Ys.length;s++){var g=Ys[s];g.blockedOn===t&&(g.blockedOn=null)}}for(Tr!==null&&Ni(Tr,t),Mr!==null&&Ni(Mr,t),Pr!==null&&Ni(Pr,t),Ti.forEach(n),Mi.forEach(n),s=0;s<Nr.length;s++)g=Nr[s],g.blockedOn===t&&(g.blockedOn=null);for(;0<Nr.length&&(s=Nr[0],s.blockedOn===null);)_h(s),s.blockedOn===null&&Nr.shift()}var In=w.ReactCurrentBatchConfig,Qs=!0;function vm(t,n,s,g){var E=Be,A=In.transition;In.transition=null;try{Be=1,ul(t,n,s,g)}finally{Be=E,In.transition=A}}function ym(t,n,s,g){var E=Be,A=In.transition;In.transition=null;try{Be=4,ul(t,n,s,g)}finally{Be=E,In.transition=A}}function ul(t,n,s,g){if(Qs){var E=hl(t,n,s,g);if(E===null)Rl(t,n,g,Js,s),ph(t,g);else if(gm(E,t,n,s,g))g.stopPropagation();else if(ph(t,g),n&4&&-1<_m.indexOf(t)){for(;E!==null;){var A=Ki(E);if(A!==null&&uh(A),A=hl(t,n,s,g),A===null&&Rl(t,n,g,Js,s),A===E)break;E=A}E!==null&&g.stopPropagation()}else Rl(t,n,g,null,s)}}var Js=null;function hl(t,n,s,g){if(Js=null,t=Si(g),t=ln(t),t!==null)if(n=rr(t),n===null)t=null;else if(s=n.tag,s===13){if(t=ki(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null);return Js=t,null}function mh(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(el()){case Ri:return 1;case Vs:return 4;case Tn:case tl:return 16;case qs:return 536870912;default:return 16}default:return 16}}var Br=null,dl=null,Zs=null;function vh(){if(Zs)return Zs;var t,n=dl,s=n.length,g,E="value"in Br?Br.value:Br.textContent,A=E.length;for(t=0;t<s&&n[t]===E[t];t++);var $=s-t;for(g=1;g<=$&&n[s-g]===E[A-g];g++);return Zs=E.slice(t,1<g?1-g:void 0)}function eo(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function to(){return!0}function yh(){return!1}function At(t){function n(s,g,E,A,$){this._reactName=s,this._targetInst=E,this.type=g,this.nativeEvent=A,this.target=$,this.currentTarget=null;for(var Y in t)t.hasOwnProperty(Y)&&(s=t[Y],this[Y]=s?s(A):A[Y]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?to:yh,this.isPropagationStopped=yh,this}return B(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=to)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=to)},persist:function(){},isPersistent:to}),n}var On={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fl=At(On),Ii=B({},On,{view:0,detail:0}),wm=At(Ii),pl,_l,Oi,ro=B({},Ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ml,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Oi&&(Oi&&t.type==="mousemove"?(pl=t.screenX-Oi.screenX,_l=t.screenY-Oi.screenY):_l=pl=0,Oi=t),pl)},movementY:function(t){return"movementY"in t?t.movementY:_l}}),wh=At(ro),Sm=B({},ro,{dataTransfer:0}),Cm=At(Sm),xm=B({},Ii,{relatedTarget:0}),gl=At(xm),bm=B({},On,{animationName:0,elapsedTime:0,pseudoElement:0}),Em=At(bm),km=B({},On,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Lm=At(km),Rm=B({},On,{data:0}),Sh=At(Rm),Dm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Am={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Tm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mm(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Tm[t])?!!n[t]:!1}function ml(){return Mm}var Pm=B({},Ii,{key:function(t){if(t.key){var n=Dm[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=eo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Am[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ml,charCode:function(t){return t.type==="keypress"?eo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?eo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Nm=At(Pm),Bm=B({},ro,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ch=At(Bm),Im=B({},Ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ml}),Om=At(Im),Hm=B({},On,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fm=At(Hm),jm=B({},ro,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),zm=At(jm),$m=[9,13,27,32],vl=a&&"CompositionEvent"in window,Hi=null;a&&"documentMode"in document&&(Hi=document.documentMode);var Wm=a&&"TextEvent"in window&&!Hi,xh=a&&(!vl||Hi&&8<Hi&&11>=Hi),bh=" ",Eh=!1;function kh(t,n){switch(t){case"keyup":return $m.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Hn=!1;function Um(t,n){switch(t){case"compositionend":return Lh(n);case"keypress":return n.which!==32?null:(Eh=!0,bh);case"textInput":return t=n.data,t===bh&&Eh?null:t;default:return null}}function Vm(t,n){if(Hn)return t==="compositionend"||!vl&&kh(t,n)?(t=vh(),Zs=dl=Br=null,Hn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return xh&&n.locale!=="ko"?null:n.data;default:return null}}var qm={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rh(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!qm[t.type]:n==="textarea"}function Dh(t,n,s,g){Bs(g),n=ao(n,"onChange"),0<n.length&&(s=new fl("onChange","change",null,s,g),t.push({event:s,listeners:n}))}var Fi=null,ji=null;function Km(t){Kh(t,0)}function no(t){var n=Wn(t);if(le(n))return t}function Xm(t,n){if(t==="change")return n}var Ah=!1;if(a){var yl;if(a){var wl="oninput"in document;if(!wl){var Th=document.createElement("div");Th.setAttribute("oninput","return;"),wl=typeof Th.oninput=="function"}yl=wl}else yl=!1;Ah=yl&&(!document.documentMode||9<document.documentMode)}function Mh(){Fi&&(Fi.detachEvent("onpropertychange",Ph),ji=Fi=null)}function Ph(t){if(t.propertyName==="value"&&no(ji)){var n=[];Dh(n,ji,t,Si(t)),Fs(Km,n)}}function Ym(t,n,s){t==="focusin"?(Mh(),Fi=n,ji=s,Fi.attachEvent("onpropertychange",Ph)):t==="focusout"&&Mh()}function Gm(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return no(ji)}function Qm(t,n){if(t==="click")return no(n)}function Jm(t,n){if(t==="input"||t==="change")return no(n)}function Zm(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var Ut=typeof Object.is=="function"?Object.is:Zm;function zi(t,n){if(Ut(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),g=Object.keys(n);if(s.length!==g.length)return!1;for(g=0;g<s.length;g++){var E=s[g];if(!l.call(n,E)||!Ut(t[E],n[E]))return!1}return!0}function Nh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Bh(t,n){var s=Nh(t);t=0;for(var g;s;){if(s.nodeType===3){if(g=t+s.textContent.length,t<=n&&g>=n)return{node:s,offset:n-t};t=g}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Nh(s)}}function Ih(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Ih(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Oh(){for(var t=window,n=pe();n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=pe(t.document)}return n}function Sl(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}function e0(t){var n=Oh(),s=t.focusedElem,g=t.selectionRange;if(n!==s&&s&&s.ownerDocument&&Ih(s.ownerDocument.documentElement,s)){if(g!==null&&Sl(s)){if(n=g.start,t=g.end,t===void 0&&(t=n),"selectionStart"in s)s.selectionStart=n,s.selectionEnd=Math.min(t,s.value.length);else if(t=(n=s.ownerDocument||document)&&n.defaultView||window,t.getSelection){t=t.getSelection();var E=s.textContent.length,A=Math.min(g.start,E);g=g.end===void 0?A:Math.min(g.end,E),!t.extend&&A>g&&(E=g,g=A,A=E),E=Bh(s,A);var $=Bh(s,g);E&&$&&(t.rangeCount!==1||t.anchorNode!==E.node||t.anchorOffset!==E.offset||t.focusNode!==$.node||t.focusOffset!==$.offset)&&(n=n.createRange(),n.setStart(E.node,E.offset),t.removeAllRanges(),A>g?(t.addRange(n),t.extend($.node,$.offset)):(n.setEnd($.node,$.offset),t.addRange(n)))}}for(n=[],t=s;t=t.parentNode;)t.nodeType===1&&n.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<n.length;s++)t=n[s],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var t0=a&&"documentMode"in document&&11>=document.documentMode,Fn=null,Cl=null,$i=null,xl=!1;function Hh(t,n,s){var g=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;xl||Fn==null||Fn!==pe(g)||(g=Fn,"selectionStart"in g&&Sl(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),$i&&zi($i,g)||($i=g,g=ao(Cl,"onSelect"),0<g.length&&(n=new fl("onSelect","select",null,n,s),t.push({event:n,listeners:g}),n.target=Fn)))}function io(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var jn={animationend:io("Animation","AnimationEnd"),animationiteration:io("Animation","AnimationIteration"),animationstart:io("Animation","AnimationStart"),transitionend:io("Transition","TransitionEnd")},bl={},Fh={};a&&(Fh=document.createElement("div").style,"AnimationEvent"in window||(delete jn.animationend.animation,delete jn.animationiteration.animation,delete jn.animationstart.animation),"TransitionEvent"in window||delete jn.transitionend.transition);function so(t){if(bl[t])return bl[t];if(!jn[t])return t;var n=jn[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in Fh)return bl[t]=n[s];return t}var jh=so("animationend"),zh=so("animationiteration"),$h=so("animationstart"),Wh=so("transitionend"),Uh=new Map,Vh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ir(t,n){Uh.set(t,n),S(n,[t])}for(var El=0;El<Vh.length;El++){var kl=Vh[El],r0=kl.toLowerCase(),n0=kl[0].toUpperCase()+kl.slice(1);Ir(r0,"on"+n0)}Ir(jh,"onAnimationEnd"),Ir(zh,"onAnimationIteration"),Ir($h,"onAnimationStart"),Ir("dblclick","onDoubleClick"),Ir("focusin","onFocus"),Ir("focusout","onBlur"),Ir(Wh,"onTransitionEnd"),y("onMouseEnter",["mouseout","mouseover"]),y("onMouseLeave",["mouseout","mouseover"]),y("onPointerEnter",["pointerout","pointerover"]),y("onPointerLeave",["pointerout","pointerover"]),S("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),S("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),S("onBeforeInput",["compositionend","keypress","textInput","paste"]),S("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),S("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),S("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),i0=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wi));function qh(t,n,s){var g=t.type||"unknown-event";t.currentTarget=s,Qa(g,n,void 0,t),t.currentTarget=null}function Kh(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var g=t[s],E=g.event;g=g.listeners;e:{var A=void 0;if(n)for(var $=g.length-1;0<=$;$--){var Y=g[$],Q=Y.instance,oe=Y.currentTarget;if(Y=Y.listener,Q!==A&&E.isPropagationStopped())break e;qh(E,Y,oe),A=Q}else for($=0;$<g.length;$++){if(Y=g[$],Q=Y.instance,oe=Y.currentTarget,Y=Y.listener,Q!==A&&E.isPropagationStopped())break e;qh(E,Y,oe),A=Q}}}if(An)throw t=Ei,An=!1,Ei=null,t}function Fe(t,n){var s=n[Nl];s===void 0&&(s=n[Nl]=new Set);var g=t+"__bubble";s.has(g)||(Xh(n,t,2,!1),s.add(g))}function Ll(t,n,s){var g=0;n&&(g|=4),Xh(s,t,g,n)}var oo="_reactListening"+Math.random().toString(36).slice(2);function Ui(t){if(!t[oo]){t[oo]=!0,o.forEach(function(s){s!=="selectionchange"&&(i0.has(s)||Ll(s,!1,t),Ll(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[oo]||(n[oo]=!0,Ll("selectionchange",!1,n))}}function Xh(t,n,s,g){switch(mh(n)){case 1:var E=vm;break;case 4:E=ym;break;default:E=ul}s=E.bind(null,n,s,t),E=void 0,!bi||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(E=!0),g?E!==void 0?t.addEventListener(n,s,{capture:!0,passive:E}):t.addEventListener(n,s,!0):E!==void 0?t.addEventListener(n,s,{passive:E}):t.addEventListener(n,s,!1)}function Rl(t,n,s,g,E){var A=g;if((n&1)===0&&(n&2)===0&&g!==null)e:for(;;){if(g===null)return;var $=g.tag;if($===3||$===4){var Y=g.stateNode.containerInfo;if(Y===E||Y.nodeType===8&&Y.parentNode===E)break;if($===4)for($=g.return;$!==null;){var Q=$.tag;if((Q===3||Q===4)&&(Q=$.stateNode.containerInfo,Q===E||Q.nodeType===8&&Q.parentNode===E))return;$=$.return}for(;Y!==null;){if($=ln(Y),$===null)return;if(Q=$.tag,Q===5||Q===6){g=A=$;continue e}Y=Y.parentNode}}g=g.return}Fs(function(){var oe=A,de=Si(s),fe=[];e:{var he=Uh.get(t);if(he!==void 0){var me=fl,ye=t;switch(t){case"keypress":if(eo(s)===0)break e;case"keydown":case"keyup":me=Nm;break;case"focusin":ye="focus",me=gl;break;case"focusout":ye="blur",me=gl;break;case"beforeblur":case"afterblur":me=gl;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=wh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=Cm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=Om;break;case jh:case zh:case $h:me=Em;break;case Wh:me=Fm;break;case"scroll":me=wm;break;case"wheel":me=zm;break;case"copy":case"cut":case"paste":me=Lm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Ch}var we=(n&4)!==0,Ze=!we&&t==="scroll",ne=we?he!==null?he+"Capture":null:he;we=[];for(var ee=oe,se;ee!==null;){se=ee;var _e=se.stateNode;if(se.tag===5&&_e!==null&&(se=_e,ne!==null&&(_e=rn(ee,ne),_e!=null&&we.push(Vi(ee,_e,se)))),Ze)break;ee=ee.return}0<we.length&&(he=new me(he,ye,null,s,de),fe.push({event:he,listeners:we}))}}if((n&7)===0){e:{if(he=t==="mouseover"||t==="pointerover",me=t==="mouseout"||t==="pointerout",he&&s!==wi&&(ye=s.relatedTarget||s.fromElement)&&(ln(ye)||ye[_r]))break e;if((me||he)&&(he=de.window===de?de:(he=de.ownerDocument)?he.defaultView||he.parentWindow:window,me?(ye=s.relatedTarget||s.toElement,me=oe,ye=ye?ln(ye):null,ye!==null&&(Ze=rr(ye),ye!==Ze||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(me=null,ye=oe),me!==ye)){if(we=wh,_e="onMouseLeave",ne="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&(we=Ch,_e="onPointerLeave",ne="onPointerEnter",ee="pointer"),Ze=me==null?he:Wn(me),se=ye==null?he:Wn(ye),he=new we(_e,ee+"leave",me,s,de),he.target=Ze,he.relatedTarget=se,_e=null,ln(de)===oe&&(we=new we(ne,ee+"enter",ye,s,de),we.target=se,we.relatedTarget=Ze,_e=we),Ze=_e,me&&ye)t:{for(we=me,ne=ye,ee=0,se=we;se;se=zn(se))ee++;for(se=0,_e=ne;_e;_e=zn(_e))se++;for(;0<ee-se;)we=zn(we),ee--;for(;0<se-ee;)ne=zn(ne),se--;for(;ee--;){if(we===ne||ne!==null&&we===ne.alternate)break t;we=zn(we),ne=zn(ne)}we=null}else we=null;me!==null&&Yh(fe,he,me,we,!1),ye!==null&&Ze!==null&&Yh(fe,Ze,ye,we,!0)}}e:{if(he=oe?Wn(oe):window,me=he.nodeName&&he.nodeName.toLowerCase(),me==="select"||me==="input"&&he.type==="file")var Ce=Xm;else if(Rh(he))if(Ah)Ce=Jm;else{Ce=Gm;var Ee=Ym}else(me=he.nodeName)&&me.toLowerCase()==="input"&&(he.type==="checkbox"||he.type==="radio")&&(Ce=Qm);if(Ce&&(Ce=Ce(t,oe))){Dh(fe,Ce,s,de);break e}Ee&&Ee(t,he,oe),t==="focusout"&&(Ee=he._wrapperState)&&Ee.controlled&&he.type==="number"&&Ie(he,"number",he.value)}switch(Ee=oe?Wn(oe):window,t){case"focusin":(Rh(Ee)||Ee.contentEditable==="true")&&(Fn=Ee,Cl=oe,$i=null);break;case"focusout":$i=Cl=Fn=null;break;case"mousedown":xl=!0;break;case"contextmenu":case"mouseup":case"dragend":xl=!1,Hh(fe,s,de);break;case"selectionchange":if(t0)break;case"keydown":case"keyup":Hh(fe,s,de)}var ke;if(vl)e:{switch(t){case"compositionstart":var Le="onCompositionStart";break e;case"compositionend":Le="onCompositionEnd";break e;case"compositionupdate":Le="onCompositionUpdate";break e}Le=void 0}else Hn?kh(t,s)&&(Le="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Le="onCompositionStart");Le&&(xh&&s.locale!=="ko"&&(Hn||Le!=="onCompositionStart"?Le==="onCompositionEnd"&&Hn&&(ke=vh()):(Br=de,dl="value"in Br?Br.value:Br.textContent,Hn=!0)),Ee=ao(oe,Le),0<Ee.length&&(Le=new Sh(Le,t,null,s,de),fe.push({event:Le,listeners:Ee}),ke?Le.data=ke:(ke=Lh(s),ke!==null&&(Le.data=ke)))),(ke=Wm?Um(t,s):Vm(t,s))&&(oe=ao(oe,"onBeforeInput"),0<oe.length&&(de=new Sh("onBeforeInput","beforeinput",null,s,de),fe.push({event:de,listeners:oe}),de.data=ke))}Kh(fe,n)})}function Vi(t,n,s){return{instance:t,listener:n,currentTarget:s}}function ao(t,n){for(var s=n+"Capture",g=[];t!==null;){var E=t,A=E.stateNode;E.tag===5&&A!==null&&(E=A,A=rn(t,s),A!=null&&g.unshift(Vi(t,A,E)),A=rn(t,n),A!=null&&g.push(Vi(t,A,E))),t=t.return}return g}function zn(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Yh(t,n,s,g,E){for(var A=n._reactName,$=[];s!==null&&s!==g;){var Y=s,Q=Y.alternate,oe=Y.stateNode;if(Q!==null&&Q===g)break;Y.tag===5&&oe!==null&&(Y=oe,E?(Q=rn(s,A),Q!=null&&$.unshift(Vi(s,Q,Y))):E||(Q=rn(s,A),Q!=null&&$.push(Vi(s,Q,Y)))),s=s.return}$.length!==0&&t.push({event:n,listeners:$})}var s0=/\r\n?/g,o0=/\u0000|\uFFFD/g;function Gh(t){return(typeof t=="string"?t:""+t).replace(s0,`
|
|
38
|
+
`).replace(o0,"")}function lo(t,n,s){if(n=Gh(n),Gh(t)!==n&&s)throw Error(i(425))}function co(){}var Dl=null,Al=null;function Tl(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ml=typeof setTimeout=="function"?setTimeout:void 0,a0=typeof clearTimeout=="function"?clearTimeout:void 0,Qh=typeof Promise=="function"?Promise:void 0,l0=typeof queueMicrotask=="function"?queueMicrotask:typeof Qh<"u"?function(t){return Qh.resolve(null).then(t).catch(c0)}:Ml;function c0(t){setTimeout(function(){throw t})}function Pl(t,n){var s=n,g=0;do{var E=s.nextSibling;if(t.removeChild(s),E&&E.nodeType===8)if(s=E.data,s==="/$"){if(g===0){t.removeChild(E),Bi(n);return}g--}else s!=="$"&&s!=="$?"&&s!=="$!"||g++;s=E}while(s);Bi(n)}function Or(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return t}function Jh(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return t;n--}else s==="/$"&&n++}t=t.previousSibling}return null}var $n=Math.random().toString(36).slice(2),ir="__reactFiber$"+$n,qi="__reactProps$"+$n,_r="__reactContainer$"+$n,Nl="__reactEvents$"+$n,u0="__reactListeners$"+$n,h0="__reactHandles$"+$n;function ln(t){var n=t[ir];if(n)return n;for(var s=t.parentNode;s;){if(n=s[_r]||s[ir]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Jh(t);t!==null;){if(s=t[ir])return s;t=Jh(t)}return n}t=s,s=t.parentNode}return null}function Ki(t){return t=t[ir]||t[_r],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Wn(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(i(33))}function uo(t){return t[qi]||null}var Bl=[],Un=-1;function Hr(t){return{current:t}}function je(t){0>Un||(t.current=Bl[Un],Bl[Un]=null,Un--)}function He(t,n){Un++,Bl[Un]=t.current,t.current=n}var Fr={},_t=Hr(Fr),St=Hr(!1),cn=Fr;function Vn(t,n){var s=t.type.contextTypes;if(!s)return Fr;var g=t.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===n)return g.__reactInternalMemoizedMaskedChildContext;var E={},A;for(A in s)E[A]=n[A];return g&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=n,t.__reactInternalMemoizedMaskedChildContext=E),E}function Ct(t){return t=t.childContextTypes,t!=null}function ho(){je(St),je(_t)}function Zh(t,n,s){if(_t.current!==Fr)throw Error(i(168));He(_t,n),He(St,s)}function ed(t,n,s){var g=t.stateNode;if(n=n.childContextTypes,typeof g.getChildContext!="function")return s;g=g.getChildContext();for(var E in g)if(!(E in n))throw Error(i(108,X(t)||"Unknown",E));return B({},s,g)}function fo(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Fr,cn=_t.current,He(_t,t),He(St,St.current),!0}function td(t,n,s){var g=t.stateNode;if(!g)throw Error(i(169));s?(t=ed(t,n,cn),g.__reactInternalMemoizedMergedChildContext=t,je(St),je(_t),He(_t,t)):je(St),He(St,s)}var gr=null,po=!1,Il=!1;function rd(t){gr===null?gr=[t]:gr.push(t)}function d0(t){po=!0,rd(t)}function jr(){if(!Il&&gr!==null){Il=!0;var t=0,n=Be;try{var s=gr;for(Be=1;t<s.length;t++){var g=s[t];do g=g(!0);while(g!==null)}gr=null,po=!1}catch(E){throw gr!==null&&(gr=gr.slice(t+1)),$s(Ri,jr),E}finally{Be=n,Il=!1}}return null}var qn=[],Kn=0,_o=null,go=0,Ot=[],Ht=0,un=null,mr=1,vr="";function hn(t,n){qn[Kn++]=go,qn[Kn++]=_o,_o=t,go=n}function nd(t,n,s){Ot[Ht++]=mr,Ot[Ht++]=vr,Ot[Ht++]=un,un=t;var g=mr;t=vr;var E=32-Dt(g)-1;g&=~(1<<E),s+=1;var A=32-Dt(n)+E;if(30<A){var $=E-E%5;A=(g&(1<<$)-1).toString(32),g>>=$,E-=$,mr=1<<32-Dt(n)+E|s<<E|g,vr=A+t}else mr=1<<A|s<<E|g,vr=t}function Ol(t){t.return!==null&&(hn(t,1),nd(t,1,0))}function Hl(t){for(;t===_o;)_o=qn[--Kn],qn[Kn]=null,go=qn[--Kn],qn[Kn]=null;for(;t===un;)un=Ot[--Ht],Ot[Ht]=null,vr=Ot[--Ht],Ot[Ht]=null,mr=Ot[--Ht],Ot[Ht]=null}var Tt=null,Mt=null,We=!1,Vt=null;function id(t,n){var s=$t(5,null,null,0);s.elementType="DELETED",s.stateNode=n,s.return=t,n=t.deletions,n===null?(t.deletions=[s],t.flags|=16):n.push(s)}function sd(t,n){switch(t.tag){case 5:var s=t.type;return n=n.nodeType!==1||s.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(t.stateNode=n,Tt=t,Mt=Or(n.firstChild),!0):!1;case 6:return n=t.pendingProps===""||n.nodeType!==3?null:n,n!==null?(t.stateNode=n,Tt=t,Mt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=un!==null?{id:mr,overflow:vr}:null,t.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=$t(18,null,null,0),s.stateNode=n,s.return=t,t.child=s,Tt=t,Mt=null,!0):!1;default:return!1}}function Fl(t){return(t.mode&1)!==0&&(t.flags&128)===0}function jl(t){if(We){var n=Mt;if(n){var s=n;if(!sd(t,n)){if(Fl(t))throw Error(i(418));n=Or(s.nextSibling);var g=Tt;n&&sd(t,n)?id(g,s):(t.flags=t.flags&-4097|2,We=!1,Tt=t)}}else{if(Fl(t))throw Error(i(418));t.flags=t.flags&-4097|2,We=!1,Tt=t}}}function od(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Tt=t}function mo(t){if(t!==Tt)return!1;if(!We)return od(t),We=!0,!1;var n;if((n=t.tag!==3)&&!(n=t.tag!==5)&&(n=t.type,n=n!=="head"&&n!=="body"&&!Tl(t.type,t.memoizedProps)),n&&(n=Mt)){if(Fl(t))throw ad(),Error(i(418));for(;n;)id(t,n),n=Or(n.nextSibling)}if(od(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));e:{for(t=t.nextSibling,n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"){if(n===0){Mt=Or(t.nextSibling);break e}n--}else s!=="$"&&s!=="$!"&&s!=="$?"||n++}t=t.nextSibling}Mt=null}}else Mt=Tt?Or(t.stateNode.nextSibling):null;return!0}function ad(){for(var t=Mt;t;)t=Or(t.nextSibling)}function Xn(){Mt=Tt=null,We=!1}function zl(t){Vt===null?Vt=[t]:Vt.push(t)}var f0=w.ReactCurrentBatchConfig;function Xi(t,n,s){if(t=s.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(i(309));var g=s.stateNode}if(!g)throw Error(i(147,t));var E=g,A=""+t;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===A?n.ref:(n=function($){var Y=E.refs;$===null?delete Y[A]:Y[A]=$},n._stringRef=A,n)}if(typeof t!="string")throw Error(i(284));if(!s._owner)throw Error(i(290,t))}return t}function vo(t,n){throw t=Object.prototype.toString.call(n),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t))}function ld(t){var n=t._init;return n(t._payload)}function cd(t){function n(ne,ee){if(t){var se=ne.deletions;se===null?(ne.deletions=[ee],ne.flags|=16):se.push(ee)}}function s(ne,ee){if(!t)return null;for(;ee!==null;)n(ne,ee),ee=ee.sibling;return null}function g(ne,ee){for(ne=new Map;ee!==null;)ee.key!==null?ne.set(ee.key,ee):ne.set(ee.index,ee),ee=ee.sibling;return ne}function E(ne,ee){return ne=Xr(ne,ee),ne.index=0,ne.sibling=null,ne}function A(ne,ee,se){return ne.index=se,t?(se=ne.alternate,se!==null?(se=se.index,se<ee?(ne.flags|=2,ee):se):(ne.flags|=2,ee)):(ne.flags|=1048576,ee)}function $(ne){return t&&ne.alternate===null&&(ne.flags|=2),ne}function Y(ne,ee,se,_e){return ee===null||ee.tag!==6?(ee=Mc(se,ne.mode,_e),ee.return=ne,ee):(ee=E(ee,se),ee.return=ne,ee)}function Q(ne,ee,se,_e){var Ce=se.type;return Ce===D?de(ne,ee,se.props.children,_e,se.key):ee!==null&&(ee.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===U&&ld(Ce)===ee.type)?(_e=E(ee,se.props),_e.ref=Xi(ne,ee,se),_e.return=ne,_e):(_e=$o(se.type,se.key,se.props,null,ne.mode,_e),_e.ref=Xi(ne,ee,se),_e.return=ne,_e)}function oe(ne,ee,se,_e){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==se.containerInfo||ee.stateNode.implementation!==se.implementation?(ee=Pc(se,ne.mode,_e),ee.return=ne,ee):(ee=E(ee,se.children||[]),ee.return=ne,ee)}function de(ne,ee,se,_e,Ce){return ee===null||ee.tag!==7?(ee=yn(se,ne.mode,_e,Ce),ee.return=ne,ee):(ee=E(ee,se),ee.return=ne,ee)}function fe(ne,ee,se){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=Mc(""+ee,ne.mode,se),ee.return=ne,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case L:return se=$o(ee.type,ee.key,ee.props,null,ne.mode,se),se.ref=Xi(ne,null,ee),se.return=ne,se;case R:return ee=Pc(ee,ne.mode,se),ee.return=ne,ee;case U:var _e=ee._init;return fe(ne,_e(ee._payload),se)}if(ze(ee)||T(ee))return ee=yn(ee,ne.mode,se,null),ee.return=ne,ee;vo(ne,ee)}return null}function he(ne,ee,se,_e){var Ce=ee!==null?ee.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return Ce!==null?null:Y(ne,ee,""+se,_e);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case L:return se.key===Ce?Q(ne,ee,se,_e):null;case R:return se.key===Ce?oe(ne,ee,se,_e):null;case U:return Ce=se._init,he(ne,ee,Ce(se._payload),_e)}if(ze(se)||T(se))return Ce!==null?null:de(ne,ee,se,_e,null);vo(ne,se)}return null}function me(ne,ee,se,_e,Ce){if(typeof _e=="string"&&_e!==""||typeof _e=="number")return ne=ne.get(se)||null,Y(ee,ne,""+_e,Ce);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case L:return ne=ne.get(_e.key===null?se:_e.key)||null,Q(ee,ne,_e,Ce);case R:return ne=ne.get(_e.key===null?se:_e.key)||null,oe(ee,ne,_e,Ce);case U:var Ee=_e._init;return me(ne,ee,se,Ee(_e._payload),Ce)}if(ze(_e)||T(_e))return ne=ne.get(se)||null,de(ee,ne,_e,Ce,null);vo(ee,_e)}return null}function ye(ne,ee,se,_e){for(var Ce=null,Ee=null,ke=ee,Le=ee=0,ct=null;ke!==null&&Le<se.length;Le++){ke.index>Le?(ct=ke,ke=null):ct=ke.sibling;var Pe=he(ne,ke,se[Le],_e);if(Pe===null){ke===null&&(ke=ct);break}t&&ke&&Pe.alternate===null&&n(ne,ke),ee=A(Pe,ee,Le),Ee===null?Ce=Pe:Ee.sibling=Pe,Ee=Pe,ke=ct}if(Le===se.length)return s(ne,ke),We&&hn(ne,Le),Ce;if(ke===null){for(;Le<se.length;Le++)ke=fe(ne,se[Le],_e),ke!==null&&(ee=A(ke,ee,Le),Ee===null?Ce=ke:Ee.sibling=ke,Ee=ke);return We&&hn(ne,Le),Ce}for(ke=g(ne,ke);Le<se.length;Le++)ct=me(ke,ne,Le,se[Le],_e),ct!==null&&(t&&ct.alternate!==null&&ke.delete(ct.key===null?Le:ct.key),ee=A(ct,ee,Le),Ee===null?Ce=ct:Ee.sibling=ct,Ee=ct);return t&&ke.forEach(function(Yr){return n(ne,Yr)}),We&&hn(ne,Le),Ce}function we(ne,ee,se,_e){var Ce=T(se);if(typeof Ce!="function")throw Error(i(150));if(se=Ce.call(se),se==null)throw Error(i(151));for(var Ee=Ce=null,ke=ee,Le=ee=0,ct=null,Pe=se.next();ke!==null&&!Pe.done;Le++,Pe=se.next()){ke.index>Le?(ct=ke,ke=null):ct=ke.sibling;var Yr=he(ne,ke,Pe.value,_e);if(Yr===null){ke===null&&(ke=ct);break}t&&ke&&Yr.alternate===null&&n(ne,ke),ee=A(Yr,ee,Le),Ee===null?Ce=Yr:Ee.sibling=Yr,Ee=Yr,ke=ct}if(Pe.done)return s(ne,ke),We&&hn(ne,Le),Ce;if(ke===null){for(;!Pe.done;Le++,Pe=se.next())Pe=fe(ne,Pe.value,_e),Pe!==null&&(ee=A(Pe,ee,Le),Ee===null?Ce=Pe:Ee.sibling=Pe,Ee=Pe);return We&&hn(ne,Le),Ce}for(ke=g(ne,ke);!Pe.done;Le++,Pe=se.next())Pe=me(ke,ne,Le,Pe.value,_e),Pe!==null&&(t&&Pe.alternate!==null&&ke.delete(Pe.key===null?Le:Pe.key),ee=A(Pe,ee,Le),Ee===null?Ce=Pe:Ee.sibling=Pe,Ee=Pe);return t&&ke.forEach(function(q0){return n(ne,q0)}),We&&hn(ne,Le),Ce}function Ze(ne,ee,se,_e){if(typeof se=="object"&&se!==null&&se.type===D&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case L:e:{for(var Ce=se.key,Ee=ee;Ee!==null;){if(Ee.key===Ce){if(Ce=se.type,Ce===D){if(Ee.tag===7){s(ne,Ee.sibling),ee=E(Ee,se.props.children),ee.return=ne,ne=ee;break e}}else if(Ee.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===U&&ld(Ce)===Ee.type){s(ne,Ee.sibling),ee=E(Ee,se.props),ee.ref=Xi(ne,Ee,se),ee.return=ne,ne=ee;break e}s(ne,Ee);break}else n(ne,Ee);Ee=Ee.sibling}se.type===D?(ee=yn(se.props.children,ne.mode,_e,se.key),ee.return=ne,ne=ee):(_e=$o(se.type,se.key,se.props,null,ne.mode,_e),_e.ref=Xi(ne,ee,se),_e.return=ne,ne=_e)}return $(ne);case R:e:{for(Ee=se.key;ee!==null;){if(ee.key===Ee)if(ee.tag===4&&ee.stateNode.containerInfo===se.containerInfo&&ee.stateNode.implementation===se.implementation){s(ne,ee.sibling),ee=E(ee,se.children||[]),ee.return=ne,ne=ee;break e}else{s(ne,ee);break}else n(ne,ee);ee=ee.sibling}ee=Pc(se,ne.mode,_e),ee.return=ne,ne=ee}return $(ne);case U:return Ee=se._init,Ze(ne,ee,Ee(se._payload),_e)}if(ze(se))return ye(ne,ee,se,_e);if(T(se))return we(ne,ee,se,_e);vo(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,ee!==null&&ee.tag===6?(s(ne,ee.sibling),ee=E(ee,se),ee.return=ne,ne=ee):(s(ne,ee),ee=Mc(se,ne.mode,_e),ee.return=ne,ne=ee),$(ne)):s(ne,ee)}return Ze}var Yn=cd(!0),ud=cd(!1),yo=Hr(null),wo=null,Gn=null,$l=null;function Wl(){$l=Gn=wo=null}function Ul(t){var n=yo.current;je(yo),t._currentValue=n}function Vl(t,n,s){for(;t!==null;){var g=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,g!==null&&(g.childLanes|=n)):g!==null&&(g.childLanes&n)!==n&&(g.childLanes|=n),t===s)break;t=t.return}}function Qn(t,n){wo=t,$l=Gn=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&n)!==0&&(xt=!0),t.firstContext=null)}function Ft(t){var n=t._currentValue;if($l!==t)if(t={context:t,memoizedValue:n,next:null},Gn===null){if(wo===null)throw Error(i(308));Gn=t,wo.dependencies={lanes:0,firstContext:t}}else Gn=Gn.next=t;return n}var dn=null;function ql(t){dn===null?dn=[t]:dn.push(t)}function hd(t,n,s,g){var E=n.interleaved;return E===null?(s.next=s,ql(n)):(s.next=E.next,E.next=s),n.interleaved=s,yr(t,g)}function yr(t,n){t.lanes|=n;var s=t.alternate;for(s!==null&&(s.lanes|=n),s=t,t=t.return;t!==null;)t.childLanes|=n,s=t.alternate,s!==null&&(s.childLanes|=n),s=t,t=t.return;return s.tag===3?s.stateNode:null}var zr=!1;function Kl(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function wr(t,n){return{eventTime:t,lane:n,tag:0,payload:null,callback:null,next:null}}function $r(t,n,s){var g=t.updateQueue;if(g===null)return null;if(g=g.shared,(Me&2)!==0){var E=g.pending;return E===null?n.next=n:(n.next=E.next,E.next=n),g.pending=n,yr(t,s)}return E=g.interleaved,E===null?(n.next=n,ql(g)):(n.next=E.next,E.next=n),g.interleaved=n,yr(t,s)}function So(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194240)!==0)){var g=n.lanes;g&=t.pendingLanes,s|=g,n.lanes=s,al(t,s)}}function fd(t,n){var s=t.updateQueue,g=t.alternate;if(g!==null&&(g=g.updateQueue,s===g)){var E=null,A=null;if(s=s.firstBaseUpdate,s!==null){do{var $={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};A===null?E=A=$:A=A.next=$,s=s.next}while(s!==null);A===null?E=A=n:A=A.next=n}else E=A=n;s={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:A,shared:g.shared,effects:g.effects},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}function Co(t,n,s,g){var E=t.updateQueue;zr=!1;var A=E.firstBaseUpdate,$=E.lastBaseUpdate,Y=E.shared.pending;if(Y!==null){E.shared.pending=null;var Q=Y,oe=Q.next;Q.next=null,$===null?A=oe:$.next=oe,$=Q;var de=t.alternate;de!==null&&(de=de.updateQueue,Y=de.lastBaseUpdate,Y!==$&&(Y===null?de.firstBaseUpdate=oe:Y.next=oe,de.lastBaseUpdate=Q))}if(A!==null){var fe=E.baseState;$=0,de=oe=Q=null,Y=A;do{var he=Y.lane,me=Y.eventTime;if((g&he)===he){de!==null&&(de=de.next={eventTime:me,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var ye=t,we=Y;switch(he=n,me=s,we.tag){case 1:if(ye=we.payload,typeof ye=="function"){fe=ye.call(me,fe,he);break e}fe=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=we.payload,he=typeof ye=="function"?ye.call(me,fe,he):ye,he==null)break e;fe=B({},fe,he);break e;case 2:zr=!0}}Y.callback!==null&&Y.lane!==0&&(t.flags|=64,he=E.effects,he===null?E.effects=[Y]:he.push(Y))}else me={eventTime:me,lane:he,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},de===null?(oe=de=me,Q=fe):de=de.next=me,$|=he;if(Y=Y.next,Y===null){if(Y=E.shared.pending,Y===null)break;he=Y,Y=he.next,he.next=null,E.lastBaseUpdate=he,E.shared.pending=null}}while(!0);if(de===null&&(Q=fe),E.baseState=Q,E.firstBaseUpdate=oe,E.lastBaseUpdate=de,n=E.shared.interleaved,n!==null){E=n;do $|=E.lane,E=E.next;while(E!==n)}else A===null&&(E.shared.lanes=0);_n|=$,t.lanes=$,t.memoizedState=fe}}function pd(t,n,s){if(t=n.effects,n.effects=null,t!==null)for(n=0;n<t.length;n++){var g=t[n],E=g.callback;if(E!==null){if(g.callback=null,g=s,typeof E!="function")throw Error(i(191,E));E.call(g)}}}var Yi={},sr=Hr(Yi),Gi=Hr(Yi),Qi=Hr(Yi);function fn(t){if(t===Yi)throw Error(i(174));return t}function Xl(t,n){switch(He(Qi,n),He(Gi,t),He(sr,Yi),t=n.nodeType,t){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:ht(null,"");break;default:t=t===8?n.parentNode:n,n=t.namespaceURI||null,t=t.tagName,n=ht(n,t)}je(sr),He(sr,n)}function Jn(){je(sr),je(Gi),je(Qi)}function _d(t){fn(Qi.current);var n=fn(sr.current),s=ht(n,t.type);n!==s&&(He(Gi,t),He(sr,s))}function Yl(t){Gi.current===t&&(je(sr),je(Gi))}var Xe=Hr(0);function xo(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Gl=[];function Ql(){for(var t=0;t<Gl.length;t++)Gl[t]._workInProgressVersionPrimary=null;Gl.length=0}var bo=w.ReactCurrentDispatcher,Jl=w.ReactCurrentBatchConfig,pn=0,Ye=null,nt=null,at=null,Eo=!1,Ji=!1,Zi=0,p0=0;function gt(){throw Error(i(321))}function Zl(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!Ut(t[s],n[s]))return!1;return!0}function ec(t,n,s,g,E,A){if(pn=A,Ye=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,bo.current=t===null||t.memoizedState===null?v0:y0,t=s(g,E),Ji){A=0;do{if(Ji=!1,Zi=0,25<=A)throw Error(i(301));A+=1,at=nt=null,n.updateQueue=null,bo.current=w0,t=s(g,E)}while(Ji)}if(bo.current=Ro,n=nt!==null&&nt.next!==null,pn=0,at=nt=Ye=null,Eo=!1,n)throw Error(i(300));return t}function tc(){var t=Zi!==0;return Zi=0,t}function or(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?Ye.memoizedState=at=t:at=at.next=t,at}function jt(){if(nt===null){var t=Ye.alternate;t=t!==null?t.memoizedState:null}else t=nt.next;var n=at===null?Ye.memoizedState:at.next;if(n!==null)at=n,nt=t;else{if(t===null)throw Error(i(310));nt=t,t={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},at===null?Ye.memoizedState=at=t:at=at.next=t}return at}function es(t,n){return typeof n=="function"?n(t):n}function rc(t){var n=jt(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var g=nt,E=g.baseQueue,A=s.pending;if(A!==null){if(E!==null){var $=E.next;E.next=A.next,A.next=$}g.baseQueue=E=A,s.pending=null}if(E!==null){A=E.next,g=g.baseState;var Y=$=null,Q=null,oe=A;do{var de=oe.lane;if((pn&de)===de)Q!==null&&(Q=Q.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),g=oe.hasEagerState?oe.eagerState:t(g,oe.action);else{var fe={lane:de,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};Q===null?(Y=Q=fe,$=g):Q=Q.next=fe,Ye.lanes|=de,_n|=de}oe=oe.next}while(oe!==null&&oe!==A);Q===null?$=g:Q.next=Y,Ut(g,n.memoizedState)||(xt=!0),n.memoizedState=g,n.baseState=$,n.baseQueue=Q,s.lastRenderedState=g}if(t=s.interleaved,t!==null){E=t;do A=E.lane,Ye.lanes|=A,_n|=A,E=E.next;while(E!==t)}else E===null&&(s.lanes=0);return[n.memoizedState,s.dispatch]}function nc(t){var n=jt(),s=n.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=t;var g=s.dispatch,E=s.pending,A=n.memoizedState;if(E!==null){s.pending=null;var $=E=E.next;do A=t(A,$.action),$=$.next;while($!==E);Ut(A,n.memoizedState)||(xt=!0),n.memoizedState=A,n.baseQueue===null&&(n.baseState=A),s.lastRenderedState=A}return[A,g]}function gd(){}function md(t,n){var s=Ye,g=jt(),E=n(),A=!Ut(g.memoizedState,E);if(A&&(g.memoizedState=E,xt=!0),g=g.queue,ic(wd.bind(null,s,g,t),[t]),g.getSnapshot!==n||A||at!==null&&at.memoizedState.tag&1){if(s.flags|=2048,ts(9,yd.bind(null,s,g,E,n),void 0,null),lt===null)throw Error(i(349));(pn&30)!==0||vd(s,n,E)}return E}function vd(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=Ye.updateQueue,n===null?(n={lastEffect:null,stores:null},Ye.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function yd(t,n,s,g){n.value=s,n.getSnapshot=g,Sd(n)&&Cd(t)}function wd(t,n,s){return s(function(){Sd(n)&&Cd(t)})}function Sd(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!Ut(t,s)}catch{return!0}}function Cd(t){var n=yr(t,1);n!==null&&Yt(n,t,1,-1)}function xd(t){var n=or();return typeof t=="function"&&(t=t()),n.memoizedState=n.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:t},n.queue=t,t=t.dispatch=m0.bind(null,Ye,t),[n.memoizedState,t]}function ts(t,n,s,g){return t={tag:t,create:n,destroy:s,deps:g,next:null},n=Ye.updateQueue,n===null?(n={lastEffect:null,stores:null},Ye.updateQueue=n,n.lastEffect=t.next=t):(s=n.lastEffect,s===null?n.lastEffect=t.next=t:(g=s.next,s.next=t,t.next=g,n.lastEffect=t)),t}function bd(){return jt().memoizedState}function ko(t,n,s,g){var E=or();Ye.flags|=t,E.memoizedState=ts(1|n,s,void 0,g===void 0?null:g)}function Lo(t,n,s,g){var E=jt();g=g===void 0?null:g;var A=void 0;if(nt!==null){var $=nt.memoizedState;if(A=$.destroy,g!==null&&Zl(g,$.deps)){E.memoizedState=ts(n,s,A,g);return}}Ye.flags|=t,E.memoizedState=ts(1|n,s,A,g)}function Ed(t,n){return ko(8390656,8,t,n)}function ic(t,n){return Lo(2048,8,t,n)}function kd(t,n){return Lo(4,2,t,n)}function Ld(t,n){return Lo(4,4,t,n)}function Rd(t,n){if(typeof n=="function")return t=t(),n(t),function(){n(null)};if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Dd(t,n,s){return s=s!=null?s.concat([t]):null,Lo(4,4,Rd.bind(null,n,t),s)}function sc(){}function Ad(t,n){var s=jt();n=n===void 0?null:n;var g=s.memoizedState;return g!==null&&n!==null&&Zl(n,g[1])?g[0]:(s.memoizedState=[t,n],t)}function Td(t,n){var s=jt();n=n===void 0?null:n;var g=s.memoizedState;return g!==null&&n!==null&&Zl(n,g[1])?g[0]:(t=t(),s.memoizedState=[t,n],t)}function Md(t,n,s){return(pn&21)===0?(t.baseState&&(t.baseState=!1,xt=!0),t.memoizedState=s):(Ut(s,n)||(s=Bn(),Ye.lanes|=s,_n|=s,t.baseState=!0),n)}function _0(t,n){var s=Be;Be=s!==0&&4>s?s:4,t(!0);var g=Jl.transition;Jl.transition={};try{t(!1),n()}finally{Be=s,Jl.transition=g}}function Pd(){return jt().memoizedState}function g0(t,n,s){var g=qr(t);if(s={lane:g,action:s,hasEagerState:!1,eagerState:null,next:null},Nd(t))Bd(n,s);else if(s=hd(t,n,s,g),s!==null){var E=wt();Yt(s,t,g,E),Id(s,n,g)}}function m0(t,n,s){var g=qr(t),E={lane:g,action:s,hasEagerState:!1,eagerState:null,next:null};if(Nd(t))Bd(n,E);else{var A=t.alternate;if(t.lanes===0&&(A===null||A.lanes===0)&&(A=n.lastRenderedReducer,A!==null))try{var $=n.lastRenderedState,Y=A($,s);if(E.hasEagerState=!0,E.eagerState=Y,Ut(Y,$)){var Q=n.interleaved;Q===null?(E.next=E,ql(n)):(E.next=Q.next,Q.next=E),n.interleaved=E;return}}catch{}finally{}s=hd(t,n,E,g),s!==null&&(E=wt(),Yt(s,t,g,E),Id(s,n,g))}}function Nd(t){var n=t.alternate;return t===Ye||n!==null&&n===Ye}function Bd(t,n){Ji=Eo=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function Id(t,n,s){if((s&4194240)!==0){var g=n.lanes;g&=t.pendingLanes,s|=g,n.lanes=s,al(t,s)}}var Ro={readContext:Ft,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useInsertionEffect:gt,useLayoutEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useMutableSource:gt,useSyncExternalStore:gt,useId:gt,unstable_isNewReconciler:!1},v0={readContext:Ft,useCallback:function(t,n){return or().memoizedState=[t,n===void 0?null:n],t},useContext:Ft,useEffect:Ed,useImperativeHandle:function(t,n,s){return s=s!=null?s.concat([t]):null,ko(4194308,4,Rd.bind(null,n,t),s)},useLayoutEffect:function(t,n){return ko(4194308,4,t,n)},useInsertionEffect:function(t,n){return ko(4,2,t,n)},useMemo:function(t,n){var s=or();return n=n===void 0?null:n,t=t(),s.memoizedState=[t,n],t},useReducer:function(t,n,s){var g=or();return n=s!==void 0?s(n):n,g.memoizedState=g.baseState=n,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:n},g.queue=t,t=t.dispatch=g0.bind(null,Ye,t),[g.memoizedState,t]},useRef:function(t){var n=or();return t={current:t},n.memoizedState=t},useState:xd,useDebugValue:sc,useDeferredValue:function(t){return or().memoizedState=t},useTransition:function(){var t=xd(!1),n=t[0];return t=_0.bind(null,t[1]),or().memoizedState=t,[n,t]},useMutableSource:function(){},useSyncExternalStore:function(t,n,s){var g=Ye,E=or();if(We){if(s===void 0)throw Error(i(407));s=s()}else{if(s=n(),lt===null)throw Error(i(349));(pn&30)!==0||vd(g,n,s)}E.memoizedState=s;var A={value:s,getSnapshot:n};return E.queue=A,Ed(wd.bind(null,g,A,t),[t]),g.flags|=2048,ts(9,yd.bind(null,g,A,s,n),void 0,null),s},useId:function(){var t=or(),n=lt.identifierPrefix;if(We){var s=vr,g=mr;s=(g&~(1<<32-Dt(g)-1)).toString(32)+s,n=":"+n+"R"+s,s=Zi++,0<s&&(n+="H"+s.toString(32)),n+=":"}else s=p0++,n=":"+n+"r"+s.toString(32)+":";return t.memoizedState=n},unstable_isNewReconciler:!1},y0={readContext:Ft,useCallback:Ad,useContext:Ft,useEffect:ic,useImperativeHandle:Dd,useInsertionEffect:kd,useLayoutEffect:Ld,useMemo:Td,useReducer:rc,useRef:bd,useState:function(){return rc(es)},useDebugValue:sc,useDeferredValue:function(t){var n=jt();return Md(n,nt.memoizedState,t)},useTransition:function(){var t=rc(es)[0],n=jt().memoizedState;return[t,n]},useMutableSource:gd,useSyncExternalStore:md,useId:Pd,unstable_isNewReconciler:!1},w0={readContext:Ft,useCallback:Ad,useContext:Ft,useEffect:ic,useImperativeHandle:Dd,useInsertionEffect:kd,useLayoutEffect:Ld,useMemo:Td,useReducer:nc,useRef:bd,useState:function(){return nc(es)},useDebugValue:sc,useDeferredValue:function(t){var n=jt();return nt===null?n.memoizedState=t:Md(n,nt.memoizedState,t)},useTransition:function(){var t=nc(es)[0],n=jt().memoizedState;return[t,n]},useMutableSource:gd,useSyncExternalStore:md,useId:Pd,unstable_isNewReconciler:!1};function qt(t,n){if(t&&t.defaultProps){n=B({},n),t=t.defaultProps;for(var s in t)n[s]===void 0&&(n[s]=t[s]);return n}return n}function oc(t,n,s,g){n=t.memoizedState,s=s(g,n),s=s==null?n:B({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Do={isMounted:function(t){return(t=t._reactInternals)?rr(t)===t:!1},enqueueSetState:function(t,n,s){t=t._reactInternals;var g=wt(),E=qr(t),A=wr(g,E);A.payload=n,s!=null&&(A.callback=s),n=$r(t,A,E),n!==null&&(Yt(n,t,E,g),So(n,t,E))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var g=wt(),E=qr(t),A=wr(g,E);A.tag=1,A.payload=n,s!=null&&(A.callback=s),n=$r(t,A,E),n!==null&&(Yt(n,t,E,g),So(n,t,E))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=wt(),g=qr(t),E=wr(s,g);E.tag=2,n!=null&&(E.callback=n),n=$r(t,E,g),n!==null&&(Yt(n,t,g,s),So(n,t,g))}};function Od(t,n,s,g,E,A,$){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(g,A,$):n.prototype&&n.prototype.isPureReactComponent?!zi(s,g)||!zi(E,A):!0}function Hd(t,n,s){var g=!1,E=Fr,A=n.contextType;return typeof A=="object"&&A!==null?A=Ft(A):(E=Ct(n)?cn:_t.current,g=n.contextTypes,A=(g=g!=null)?Vn(t,E):Fr),n=new n(s,A),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Do,t.stateNode=n,n._reactInternals=t,g&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=E,t.__reactInternalMemoizedMaskedChildContext=A),n}function Fd(t,n,s,g){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,g),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,g),n.state!==t&&Do.enqueueReplaceState(n,n.state,null)}function ac(t,n,s,g){var E=t.stateNode;E.props=s,E.state=t.memoizedState,E.refs={},Kl(t);var A=n.contextType;typeof A=="object"&&A!==null?E.context=Ft(A):(A=Ct(n)?cn:_t.current,E.context=Vn(t,A)),E.state=t.memoizedState,A=n.getDerivedStateFromProps,typeof A=="function"&&(oc(t,n,A,s),E.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(n=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),n!==E.state&&Do.enqueueReplaceState(E,E.state,null),Co(t,s,E,g),E.state=t.memoizedState),typeof E.componentDidMount=="function"&&(t.flags|=4194308)}function Zn(t,n){try{var s="",g=n;do s+=ie(g),g=g.return;while(g);var E=s}catch(A){E=`
|
|
39
39
|
Error generating stack: `+A.message+`
|
|
40
|
-
`+A.stack}return{value:t,source:n,stack:E,digest:null}}function lc(t,n,s){return{value:t,source:null,stack:s??null,digest:n??null}}function cc(t,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var S0=typeof WeakMap=="function"?WeakMap:Map;function jd(t,n,s){s=wr(-1,s),s.tag=3,s.payload={element:null};var g=n.value;return s.callback=function(){Io||(Io=!0,bc=g),cc(t,n)},s}function zd(t,n,s){s=wr(-1,s),s.tag=3;var g=t.type.getDerivedStateFromError;if(typeof g=="function"){var E=n.value;s.payload=function(){return g(E)},s.callback=function(){cc(t,n)}}var A=t.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(s.callback=function(){cc(t,n),typeof g!="function"&&(Wr===null?Wr=new Set([this]):Wr.add(this));var $=n.stack;this.componentDidCatch(n.value,{componentStack:$!==null?$:""})}),s}function $d(t,n,s){var g=t.pingCache;if(g===null){g=t.pingCache=new S0;var E=new Set;g.set(n,E)}else E=g.get(n),E===void 0&&(E=new Set,g.set(n,E));E.has(s)||(E.add(s),t=B0.bind(null,t,n,s),n.then(t,t))}function Wd(t){do{var n;if((n=t.tag===13)&&(n=t.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return t;t=t.return}while(t!==null);return null}function Ud(t,n,s,g,E){return(t.mode&1)===0?(t===n?t.flags|=65536:(t.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(n=wr(-1,1),n.tag=2,zr(s,n,1))),s.lanes|=1),t):(t.flags|=65536,t.lanes=E,t)}var C0=w.ReactCurrentOwner,xt=!1;function yt(t,n,s,g){n.child=t===null?ud(n,null,s,g):Yn(n,t.child,s,g)}function Vd(t,n,s,g,E){s=s.render;var A=n.ref;return Qn(n,E),g=ec(t,n,s,g,A,E),s=tc(),t!==null&&!xt?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~E,Sr(t,n,E)):(We&&s&&Ol(n),n.flags|=1,yt(t,n,g,E),n.child)}function qd(t,n,s,g,E){if(t===null){var A=s.type;return typeof A=="function"&&!Tc(A)&&A.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=A,Kd(t,n,A,g,E)):(t=$o(s.type,null,g,n,n.mode,E),t.ref=n.ref,t.return=n,n.child=t)}if(A=t.child,(t.lanes&E)===0){var $=A.memoizedProps;if(s=s.compare,s=s!==null?s:zi,s($,g)&&t.ref===n.ref)return Sr(t,n,E)}return n.flags|=1,t=Kr(A,g),t.ref=n.ref,t.return=n,n.child=t}function Kd(t,n,s,g,E){if(t!==null){var A=t.memoizedProps;if(zi(A,g)&&t.ref===n.ref)if(xt=!1,n.pendingProps=g=A,(t.lanes&E)!==0)(t.flags&131072)!==0&&(xt=!0);else return n.lanes=t.lanes,Sr(t,n,E)}return uc(t,n,s,g,E)}function Xd(t,n,s){var g=n.pendingProps,E=g.children,A=t!==null?t.memoizedState:null;if(g.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},He(ti,Pt),Pt|=s;else{if((s&1073741824)===0)return t=A!==null?A.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:t,cachePool:null,transitions:null},n.updateQueue=null,He(ti,Pt),Pt|=t,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=A!==null?A.baseLanes:s,He(ti,Pt),Pt|=g}else A!==null?(g=A.baseLanes|s,n.memoizedState=null):g=s,He(ti,Pt),Pt|=g;return yt(t,n,E,s),n.child}function Yd(t,n){var s=n.ref;(t===null&&s!==null||t!==null&&t.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function uc(t,n,s,g,E){var A=Ct(s)?cn:_t.current;return A=Vn(n,A),Qn(n,E),s=ec(t,n,s,g,A,E),g=tc(),t!==null&&!xt?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~E,Sr(t,n,E)):(We&&g&&Ol(n),n.flags|=1,yt(t,n,s,E),n.child)}function Gd(t,n,s,g,E){if(Ct(s)){var A=!0;fo(n)}else A=!1;if(Qn(n,E),n.stateNode===null)To(t,n),Hd(n,s,g),ac(n,s,g,E),g=!0;else if(t===null){var $=n.stateNode,Y=n.memoizedProps;$.props=Y;var Q=$.context,oe=s.contextType;typeof oe=="object"&&oe!==null?oe=Ft(oe):(oe=Ct(s)?cn:_t.current,oe=Vn(n,oe));var de=s.getDerivedStateFromProps,fe=typeof de=="function"||typeof $.getSnapshotBeforeUpdate=="function";fe||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Y!==g||Q!==oe)&&Fd(n,$,g,oe),jr=!1;var he=n.memoizedState;$.state=he,Co(n,g,$,E),Q=n.memoizedState,Y!==g||he!==Q||St.current||jr?(typeof de=="function"&&(oc(n,s,de,g),Q=n.memoizedState),(Y=jr||Od(n,s,Y,g,he,Q,oe))?(fe||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(n.flags|=4194308)):(typeof $.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=g,n.memoizedState=Q),$.props=g,$.state=Q,$.context=oe,g=Y):(typeof $.componentDidMount=="function"&&(n.flags|=4194308),g=!1)}else{$=n.stateNode,dd(t,n),Y=n.memoizedProps,oe=n.type===n.elementType?Y:qt(n.type,Y),$.props=oe,fe=n.pendingProps,he=$.context,Q=s.contextType,typeof Q=="object"&&Q!==null?Q=Ft(Q):(Q=Ct(s)?cn:_t.current,Q=Vn(n,Q));var me=s.getDerivedStateFromProps;(de=typeof me=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Y!==fe||he!==Q)&&Fd(n,$,g,Q),jr=!1,he=n.memoizedState,$.state=he,Co(n,g,$,E);var ye=n.memoizedState;Y!==fe||he!==ye||St.current||jr?(typeof me=="function"&&(oc(n,s,me,g),ye=n.memoizedState),(oe=jr||Od(n,s,oe,g,he,ye,Q)||!1)?(de||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(g,ye,Q),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(g,ye,Q)),typeof $.componentDidUpdate=="function"&&(n.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof $.componentDidUpdate!="function"||Y===t.memoizedProps&&he===t.memoizedState||(n.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Y===t.memoizedProps&&he===t.memoizedState||(n.flags|=1024),n.memoizedProps=g,n.memoizedState=ye),$.props=g,$.state=ye,$.context=Q,g=oe):(typeof $.componentDidUpdate!="function"||Y===t.memoizedProps&&he===t.memoizedState||(n.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Y===t.memoizedProps&&he===t.memoizedState||(n.flags|=1024),g=!1)}return hc(t,n,s,g,A,E)}function hc(t,n,s,g,E,A){Yd(t,n);var $=(n.flags&128)!==0;if(!g&&!$)return E&&td(n,s,!1),Sr(t,n,A);g=n.stateNode,C0.current=n;var Y=$&&typeof s.getDerivedStateFromError!="function"?null:g.render();return n.flags|=1,t!==null&&$?(n.child=Yn(n,t.child,null,A),n.child=Yn(n,null,Y,A)):yt(t,n,Y,A),n.memoizedState=g.state,E&&td(n,s,!0),n.child}function Qd(t){var n=t.stateNode;n.pendingContext?Zh(t,n.pendingContext,n.pendingContext!==n.context):n.context&&Zh(t,n.context,!1),Xl(t,n.containerInfo)}function Jd(t,n,s,g,E){return Xn(),zl(E),n.flags|=256,yt(t,n,s,g),n.child}var dc={dehydrated:null,treeContext:null,retryLane:0};function fc(t){return{baseLanes:t,cachePool:null,transitions:null}}function Zd(t,n,s){var g=n.pendingProps,E=Xe.current,A=!1,$=(n.flags&128)!==0,Y;if((Y=$)||(Y=t!==null&&t.memoizedState===null?!1:(E&2)!==0),Y?(A=!0,n.flags&=-129):(t===null||t.memoizedState!==null)&&(E|=1),He(Xe,E&1),t===null)return jl(n),t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((n.mode&1)===0?n.lanes=1:t.data==="$!"?n.lanes=8:n.lanes=1073741824,null):($=g.children,t=g.fallback,A?(g=n.mode,A=n.child,$={mode:"hidden",children:$},(g&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=$):A=Wo($,g,0,null),t=yn(t,g,s,null),A.return=n,t.return=n,A.sibling=t,n.child=A,n.child.memoizedState=fc(s),n.memoizedState=dc,t):pc(n,$));if(E=t.memoizedState,E!==null&&(Y=E.dehydrated,Y!==null))return x0(t,n,$,g,Y,E,s);if(A){A=g.fallback,$=n.mode,E=t.child,Y=E.sibling;var Q={mode:"hidden",children:g.children};return($&1)===0&&n.child!==E?(g=n.child,g.childLanes=0,g.pendingProps=Q,n.deletions=null):(g=Kr(E,Q),g.subtreeFlags=E.subtreeFlags&14680064),Y!==null?A=Kr(Y,A):(A=yn(A,$,s,null),A.flags|=2),A.return=n,g.return=n,g.sibling=A,n.child=g,g=A,A=n.child,$=t.child.memoizedState,$=$===null?fc(s):{baseLanes:$.baseLanes|s,cachePool:null,transitions:$.transitions},A.memoizedState=$,A.childLanes=t.childLanes&~s,n.memoizedState=dc,g}return A=t.child,t=A.sibling,g=Kr(A,{mode:"visible",children:g.children}),(n.mode&1)===0&&(g.lanes=s),g.return=n,g.sibling=null,t!==null&&(s=n.deletions,s===null?(n.deletions=[t],n.flags|=16):s.push(t)),n.child=g,n.memoizedState=null,g}function pc(t,n){return n=Wo({mode:"visible",children:n},t.mode,0,null),n.return=t,t.child=n}function Ao(t,n,s,g){return g!==null&&zl(g),Yn(n,t.child,null,s),t=pc(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function x0(t,n,s,g,E,A,$){if(s)return n.flags&256?(n.flags&=-257,g=lc(Error(i(422))),Ao(t,n,$,g)):n.memoizedState!==null?(n.child=t.child,n.flags|=128,null):(A=g.fallback,E=n.mode,g=Wo({mode:"visible",children:g.children},E,0,null),A=yn(A,E,$,null),A.flags|=2,g.return=n,A.return=n,g.sibling=A,n.child=g,(n.mode&1)!==0&&Yn(n,t.child,null,$),n.child.memoizedState=fc($),n.memoizedState=dc,A);if((n.mode&1)===0)return Ao(t,n,$,null);if(E.data==="$!"){if(g=E.nextSibling&&E.nextSibling.dataset,g)var Y=g.dgst;return g=Y,A=Error(i(419)),g=lc(A,g,void 0),Ao(t,n,$,g)}if(Y=($&t.childLanes)!==0,xt||Y){if(g=lt,g!==null){switch($&-$){case 4:E=2;break;case 16:E=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:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(g.suspendedLanes|$))!==0?0:E,E!==0&&E!==A.retryLane&&(A.retryLane=E,yr(t,E),Yt(g,t,E,-1))}return Ac(),g=lc(Error(i(421))),Ao(t,n,$,g)}return E.data==="$?"?(n.flags|=128,n.child=t.child,n=I0.bind(null,t),E._reactRetry=n,null):(t=A.treeContext,Mt=Ir(E.nextSibling),Tt=n,We=!0,Vt=null,t!==null&&(Ot[Ht++]=mr,Ot[Ht++]=vr,Ot[Ht++]=un,mr=t.id,vr=t.overflow,un=n),n=pc(n,g.children),n.flags|=4096,n)}function ef(t,n,s){t.lanes|=n;var g=t.alternate;g!==null&&(g.lanes|=n),Vl(t.return,n,s)}function _c(t,n,s,g,E){var A=t.memoizedState;A===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:g,tail:s,tailMode:E}:(A.isBackwards=n,A.rendering=null,A.renderingStartTime=0,A.last=g,A.tail=s,A.tailMode=E)}function tf(t,n,s){var g=n.pendingProps,E=g.revealOrder,A=g.tail;if(yt(t,n,g.children,s),g=Xe.current,(g&2)!==0)g=g&1|2,n.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ef(t,s,n);else if(t.tag===19)ef(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}g&=1}if(He(Xe,g),(n.mode&1)===0)n.memoizedState=null;else switch(E){case"forwards":for(s=n.child,E=null;s!==null;)t=s.alternate,t!==null&&xo(t)===null&&(E=s),s=s.sibling;s=E,s===null?(E=n.child,n.child=null):(E=s.sibling,s.sibling=null),_c(n,!1,E,s,A);break;case"backwards":for(s=null,E=n.child,n.child=null;E!==null;){if(t=E.alternate,t!==null&&xo(t)===null){n.child=E;break}t=E.sibling,E.sibling=s,s=E,E=t}_c(n,!0,s,null,A);break;case"together":_c(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function To(t,n){(n.mode&1)===0&&t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2)}function Sr(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),_n|=n.lanes,(s&n.childLanes)===0)return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,s=Kr(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=Kr(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function b0(t,n,s){switch(n.tag){case 3:Qd(n),Xn();break;case 5:_d(n);break;case 1:Ct(n.type)&&fo(n);break;case 4:Xl(n,n.stateNode.containerInfo);break;case 10:var g=n.type._context,E=n.memoizedProps.value;He(yo,g._currentValue),g._currentValue=E;break;case 13:if(g=n.memoizedState,g!==null)return g.dehydrated!==null?(He(Xe,Xe.current&1),n.flags|=128,null):(s&n.child.childLanes)!==0?Zd(t,n,s):(He(Xe,Xe.current&1),t=Sr(t,n,s),t!==null?t.sibling:null);He(Xe,Xe.current&1);break;case 19:if(g=(s&n.childLanes)!==0,(t.flags&128)!==0){if(g)return tf(t,n,s);n.flags|=128}if(E=n.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),He(Xe,Xe.current),g)break;return null;case 22:case 23:return n.lanes=0,Xd(t,n,s)}return Sr(t,n,s)}var rf,gc,nf,sf;rf=function(t,n){for(var s=n.child;s!==null;){if(s.tag===5||s.tag===6)t.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},gc=function(){},nf=function(t,n,s,g){var E=t.memoizedProps;if(E!==g){t=n.stateNode,fn(sr.current);var A=null;switch(s){case"input":E=Se(t,E),g=Se(t,g),A=[];break;case"select":E=B({},E,{value:void 0}),g=B({},g,{value:void 0}),A=[];break;case"textarea":E=ut(t,E),g=ut(t,g),A=[];break;default:typeof E.onClick!="function"&&typeof g.onClick=="function"&&(t.onclick=co)}vi(s,g);var $;s=null;for(oe in E)if(!g.hasOwnProperty(oe)&&E.hasOwnProperty(oe)&&E[oe]!=null)if(oe==="style"){var Y=E[oe];for($ in Y)Y.hasOwnProperty($)&&(s||(s={}),s[$]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(h.hasOwnProperty(oe)?A||(A=[]):(A=A||[]).push(oe,null));for(oe in g){var Q=g[oe];if(Y=E!=null?E[oe]:void 0,g.hasOwnProperty(oe)&&Q!==Y&&(Q!=null||Y!=null))if(oe==="style")if(Y){for($ in Y)!Y.hasOwnProperty($)||Q&&Q.hasOwnProperty($)||(s||(s={}),s[$]="");for($ in Q)Q.hasOwnProperty($)&&Y[$]!==Q[$]&&(s||(s={}),s[$]=Q[$])}else s||(A||(A=[]),A.push(oe,s)),s=Q;else oe==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Y=Y?Y.__html:void 0,Q!=null&&Y!==Q&&(A=A||[]).push(oe,Q)):oe==="children"?typeof Q!="string"&&typeof Q!="number"||(A=A||[]).push(oe,""+Q):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(h.hasOwnProperty(oe)?(Q!=null&&oe==="onScroll"&&Fe("scroll",t),A||Y===Q||(A=[])):(A=A||[]).push(oe,Q))}s&&(A=A||[]).push("style",s);var oe=A;(n.updateQueue=oe)&&(n.flags|=4)}},sf=function(t,n,s,g){s!==g&&(n.flags|=4)};function rs(t,n){if(!We)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var g=null;s!==null;)s.alternate!==null&&(g=s),s=s.sibling;g===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:g.sibling=null}}function mt(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,g=0;if(n)for(var E=t.child;E!==null;)s|=E.lanes|E.childLanes,g|=E.subtreeFlags&14680064,g|=E.flags&14680064,E.return=t,E=E.sibling;else for(E=t.child;E!==null;)s|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=t,E=E.sibling;return t.subtreeFlags|=g,t.childLanes=s,n}function E0(t,n,s){var g=n.pendingProps;switch(Hl(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(n),null;case 1:return Ct(n.type)&&ho(),mt(n),null;case 3:return g=n.stateNode,Jn(),je(St),je(_t),Ql(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(t===null||t.child===null)&&(mo(n)?n.flags|=4:t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Vt!==null&&(Lc(Vt),Vt=null))),gc(t,n),mt(n),null;case 5:Yl(n);var E=fn(Qi.current);if(s=n.type,t!==null&&n.stateNode!=null)nf(t,n,s,g,E),t.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!g){if(n.stateNode===null)throw Error(i(166));return mt(n),null}if(t=fn(sr.current),mo(n)){g=n.stateNode,s=n.type;var A=n.memoizedProps;switch(g[ir]=n,g[qi]=A,t=(n.mode&1)!==0,s){case"dialog":Fe("cancel",g),Fe("close",g);break;case"iframe":case"object":case"embed":Fe("load",g);break;case"video":case"audio":for(E=0;E<Wi.length;E++)Fe(Wi[E],g);break;case"source":Fe("error",g);break;case"img":case"image":case"link":Fe("error",g),Fe("load",g);break;case"details":Fe("toggle",g);break;case"input":be(g,A),Fe("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!A.multiple},Fe("invalid",g);break;case"textarea":qe(g,A),Fe("invalid",g)}vi(s,A),E=null;for(var $ in A)if(A.hasOwnProperty($)){var Y=A[$];$==="children"?typeof Y=="string"?g.textContent!==Y&&(A.suppressHydrationWarning!==!0&&lo(g.textContent,Y,t),E=["children",Y]):typeof Y=="number"&&g.textContent!==""+Y&&(A.suppressHydrationWarning!==!0&&lo(g.textContent,Y,t),E=["children",""+Y]):h.hasOwnProperty($)&&Y!=null&&$==="onScroll"&&Fe("scroll",g)}switch(s){case"input":ce(g),Re(g,A,!0);break;case"textarea":ce(g),Ne(g);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(g.onclick=co)}g=E,n.updateQueue=g,g!==null&&(n.flags|=4)}else{$=E.nodeType===9?E:E.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Je(s)),t==="http://www.w3.org/1999/xhtml"?s==="script"?(t=$.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof g.is=="string"?t=$.createElement(s,{is:g.is}):(t=$.createElement(s),s==="select"&&($=t,g.multiple?$.multiple=!0:g.size&&($.size=g.size))):t=$.createElementNS(t,s),t[ir]=n,t[qi]=g,rf(t,n,!1,!1),n.stateNode=t;e:{switch($=yi(s,g),s){case"dialog":Fe("cancel",t),Fe("close",t),E=g;break;case"iframe":case"object":case"embed":Fe("load",t),E=g;break;case"video":case"audio":for(E=0;E<Wi.length;E++)Fe(Wi[E],t);E=g;break;case"source":Fe("error",t),E=g;break;case"img":case"image":case"link":Fe("error",t),Fe("load",t),E=g;break;case"details":Fe("toggle",t),E=g;break;case"input":be(t,g),E=Se(t,g),Fe("invalid",t);break;case"option":E=g;break;case"select":t._wrapperState={wasMultiple:!!g.multiple},E=B({},g,{value:void 0}),Fe("invalid",t);break;case"textarea":qe(t,g),E=ut(t,g),Fe("invalid",t);break;default:E=g}vi(s,E),Y=E;for(A in Y)if(Y.hasOwnProperty(A)){var Q=Y[A];A==="style"?Ps(t,Q):A==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Q!=null&&pr(t,Q)):A==="children"?typeof Q=="string"?(s!=="textarea"||Q!=="")&&ot(t,Q):typeof Q=="number"&&ot(t,""+Q):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(h.hasOwnProperty(A)?Q!=null&&A==="onScroll"&&Fe("scroll",t):Q!=null&&u(t,A,Q,$))}switch(s){case"input":ce(t),Re(t,g,!1);break;case"textarea":ce(t),Ne(t);break;case"option":g.value!=null&&t.setAttribute("value",""+H(g.value));break;case"select":t.multiple=!!g.multiple,A=g.value,A!=null?Qe(t,!!g.multiple,A,!1):g.defaultValue!=null&&Qe(t,!!g.multiple,g.defaultValue,!0);break;default:typeof E.onClick=="function"&&(t.onclick=co)}switch(s){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return mt(n),null;case 6:if(t&&n.stateNode!=null)sf(t,n,t.memoizedProps,g);else{if(typeof g!="string"&&n.stateNode===null)throw Error(i(166));if(s=fn(Qi.current),fn(sr.current),mo(n)){if(g=n.stateNode,s=n.memoizedProps,g[ir]=n,(A=g.nodeValue!==s)&&(t=Tt,t!==null))switch(t.tag){case 3:lo(g.nodeValue,s,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&lo(g.nodeValue,s,(t.mode&1)!==0)}A&&(n.flags|=4)}else g=(s.nodeType===9?s:s.ownerDocument).createTextNode(g),g[ir]=n,n.stateNode=g}return mt(n),null;case 13:if(je(Xe),g=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(We&&Mt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)ad(),Xn(),n.flags|=98560,A=!1;else if(A=mo(n),g!==null&&g.dehydrated!==null){if(t===null){if(!A)throw Error(i(318));if(A=n.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(i(317));A[ir]=n}else Xn(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;mt(n),A=!1}else Vt!==null&&(Lc(Vt),Vt=null),A=!0;if(!A)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=s,n):(g=g!==null,g!==(t!==null&&t.memoizedState!==null)&&g&&(n.child.flags|=8192,(n.mode&1)!==0&&(t===null||(Xe.current&1)!==0?it===0&&(it=3):Ac())),n.updateQueue!==null&&(n.flags|=4),mt(n),null);case 4:return Jn(),gc(t,n),t===null&&Ui(n.stateNode.containerInfo),mt(n),null;case 10:return Ul(n.type._context),mt(n),null;case 17:return Ct(n.type)&&ho(),mt(n),null;case 19:if(je(Xe),A=n.memoizedState,A===null)return mt(n),null;if(g=(n.flags&128)!==0,$=A.rendering,$===null)if(g)rs(A,!1);else{if(it!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if($=xo(t),$!==null){for(n.flags|=128,rs(A,!1),g=$.updateQueue,g!==null&&(n.updateQueue=g,n.flags|=4),n.subtreeFlags=0,g=s,s=n.child;s!==null;)A=s,t=g,A.flags&=14680066,$=A.alternate,$===null?(A.childLanes=0,A.lanes=t,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=$.childLanes,A.lanes=$.lanes,A.child=$.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=$.memoizedProps,A.memoizedState=$.memoizedState,A.updateQueue=$.updateQueue,A.type=$.type,t=$.dependencies,A.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),s=s.sibling;return He(Xe,Xe.current&1|2),n.child}t=t.sibling}A.tail!==null&&Ke()>ri&&(n.flags|=128,g=!0,rs(A,!1),n.lanes=4194304)}else{if(!g)if(t=xo($),t!==null){if(n.flags|=128,g=!0,s=t.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),rs(A,!0),A.tail===null&&A.tailMode==="hidden"&&!$.alternate&&!We)return mt(n),null}else 2*Ke()-A.renderingStartTime>ri&&s!==1073741824&&(n.flags|=128,g=!0,rs(A,!1),n.lanes=4194304);A.isBackwards?($.sibling=n.child,n.child=$):(s=A.last,s!==null?s.sibling=$:n.child=$,A.last=$)}return A.tail!==null?(n=A.tail,A.rendering=n,A.tail=n.sibling,A.renderingStartTime=Ke(),n.sibling=null,s=Xe.current,He(Xe,g?s&1|2:s&1),n):(mt(n),null);case 22:case 23:return Dc(),g=n.memoizedState!==null,t!==null&&t.memoizedState!==null!==g&&(n.flags|=8192),g&&(n.mode&1)!==0?(Pt&1073741824)!==0&&(mt(n),n.subtreeFlags&6&&(n.flags|=8192)):mt(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function k0(t,n){switch(Hl(n),n.tag){case 1:return Ct(n.type)&&ho(),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Jn(),je(St),je(_t),Ql(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 5:return Yl(n),null;case 13:if(je(Xe),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Xn()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return je(Xe),null;case 4:return Jn(),null;case 10:return Ul(n.type._context),null;case 22:case 23:return Dc(),null;case 24:return null;default:return null}}var Mo=!1,vt=!1,L0=typeof WeakSet=="function"?WeakSet:Set,ve=null;function ei(t,n){var s=t.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(g){Ge(t,n,g)}else s.current=null}function mc(t,n,s){try{s()}catch(g){Ge(t,n,g)}}var of=!1;function R0(t,n){if(Dl=Qs,t=Oh(),Sl(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var g=s.getSelection&&s.getSelection();if(g&&g.rangeCount!==0){s=g.anchorNode;var E=g.anchorOffset,A=g.focusNode;g=g.focusOffset;try{s.nodeType,A.nodeType}catch{s=null;break e}var $=0,Y=-1,Q=-1,oe=0,de=0,fe=t,he=null;t:for(;;){for(var me;fe!==s||E!==0&&fe.nodeType!==3||(Y=$+E),fe!==A||g!==0&&fe.nodeType!==3||(Q=$+g),fe.nodeType===3&&($+=fe.nodeValue.length),(me=fe.firstChild)!==null;)he=fe,fe=me;for(;;){if(fe===t)break t;if(he===s&&++oe===E&&(Y=$),he===A&&++de===g&&(Q=$),(me=fe.nextSibling)!==null)break;fe=he,he=fe.parentNode}fe=me}s=Y===-1||Q===-1?null:{start:Y,end:Q}}else s=null}s=s||{start:0,end:0}}else s=null;for(Al={focusedElem:t,selectionRange:s},Qs=!1,ve=n;ve!==null;)if(n=ve,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,ve=t;else for(;ve!==null;){n=ve;try{var ye=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var we=ye.memoizedProps,Ze=ye.memoizedState,ne=n.stateNode,ee=ne.getSnapshotBeforeUpdate(n.elementType===n.type?we:qt(n.type,we),Ze);ne.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var se=n.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(_e){Ge(n,n.return,_e)}if(t=n.sibling,t!==null){t.return=n.return,ve=t;break}ve=n.return}return ye=of,of=!1,ye}function ns(t,n,s){var g=n.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var E=g=g.next;do{if((E.tag&t)===t){var A=E.destroy;E.destroy=void 0,A!==void 0&&mc(n,s,A)}E=E.next}while(E!==g)}}function Po(t,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&t)===t){var g=s.create;s.destroy=g()}s=s.next}while(s!==n)}}function vc(t){var n=t.ref;if(n!==null){var s=t.stateNode;switch(t.tag){case 5:t=s;break;default:t=s}typeof n=="function"?n(t):n.current=t}}function af(t){var n=t.alternate;n!==null&&(t.alternate=null,af(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&(delete n[ir],delete n[qi],delete n[Nl],delete n[u0],delete n[h0])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function lf(t){return t.tag===5||t.tag===3||t.tag===4}function cf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||lf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function yc(t,n,s){var g=t.tag;if(g===5||g===6)t=t.stateNode,n?s.nodeType===8?s.parentNode.insertBefore(t,n):s.insertBefore(t,n):(s.nodeType===8?(n=s.parentNode,n.insertBefore(t,s)):(n=s,n.appendChild(t)),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=co));else if(g!==4&&(t=t.child,t!==null))for(yc(t,n,s),t=t.sibling;t!==null;)yc(t,n,s),t=t.sibling}function wc(t,n,s){var g=t.tag;if(g===5||g===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(g!==4&&(t=t.child,t!==null))for(wc(t,n,s),t=t.sibling;t!==null;)wc(t,n,s),t=t.sibling}var dt=null,Kt=!1;function $r(t,n,s){for(s=s.child;s!==null;)uf(t,n,s),s=s.sibling}function uf(t,n,s){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(on,s)}catch{}switch(s.tag){case 5:vt||ei(s,n);case 6:var g=dt,E=Kt;dt=null,$r(t,n,s),dt=g,Kt=E,dt!==null&&(Kt?(t=dt,s=s.stateNode,t.nodeType===8?t.parentNode.removeChild(s):t.removeChild(s)):dt.removeChild(s.stateNode));break;case 18:dt!==null&&(Kt?(t=dt,s=s.stateNode,t.nodeType===8?Pl(t.parentNode,s):t.nodeType===1&&Pl(t,s),Bi(t)):Pl(dt,s.stateNode));break;case 4:g=dt,E=Kt,dt=s.stateNode.containerInfo,Kt=!0,$r(t,n,s),dt=g,Kt=E;break;case 0:case 11:case 14:case 15:if(!vt&&(g=s.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){E=g=g.next;do{var A=E,$=A.destroy;A=A.tag,$!==void 0&&((A&2)!==0||(A&4)!==0)&&mc(s,n,$),E=E.next}while(E!==g)}$r(t,n,s);break;case 1:if(!vt&&(ei(s,n),g=s.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=s.memoizedProps,g.state=s.memoizedState,g.componentWillUnmount()}catch(Y){Ge(s,n,Y)}$r(t,n,s);break;case 21:$r(t,n,s);break;case 22:s.mode&1?(vt=(g=vt)||s.memoizedState!==null,$r(t,n,s),vt=g):$r(t,n,s);break;default:$r(t,n,s)}}function hf(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var s=t.stateNode;s===null&&(s=t.stateNode=new L0),n.forEach(function(g){var E=O0.bind(null,t,g);s.has(g)||(s.add(g),g.then(E,E))})}}function Xt(t,n){var s=n.deletions;if(s!==null)for(var g=0;g<s.length;g++){var E=s[g];try{var A=t,$=n,Y=$;e:for(;Y!==null;){switch(Y.tag){case 5:dt=Y.stateNode,Kt=!1;break e;case 3:dt=Y.stateNode.containerInfo,Kt=!0;break e;case 4:dt=Y.stateNode.containerInfo,Kt=!0;break e}Y=Y.return}if(dt===null)throw Error(i(160));uf(A,$,E),dt=null,Kt=!1;var Q=E.alternate;Q!==null&&(Q.return=null),E.return=null}catch(oe){Ge(E,n,oe)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)df(n,t),n=n.sibling}function df(t,n){var s=t.alternate,g=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Xt(n,t),ar(t),g&4){try{ns(3,t,t.return),Po(3,t)}catch(we){Ge(t,t.return,we)}try{ns(5,t,t.return)}catch(we){Ge(t,t.return,we)}}break;case 1:Xt(n,t),ar(t),g&512&&s!==null&&ei(s,s.return);break;case 5:if(Xt(n,t),ar(t),g&512&&s!==null&&ei(s,s.return),t.flags&32){var E=t.stateNode;try{ot(E,"")}catch(we){Ge(t,t.return,we)}}if(g&4&&(E=t.stateNode,E!=null)){var A=t.memoizedProps,$=s!==null?s.memoizedProps:A,Y=t.type,Q=t.updateQueue;if(t.updateQueue=null,Q!==null)try{Y==="input"&&A.type==="radio"&&A.name!=null&&ue(E,A),yi(Y,$);var oe=yi(Y,A);for($=0;$<Q.length;$+=2){var de=Q[$],fe=Q[$+1];de==="style"?Ps(E,fe):de==="dangerouslySetInnerHTML"?pr(E,fe):de==="children"?ot(E,fe):u(E,de,fe,oe)}switch(Y){case"input":ge(E,A);break;case"textarea":pt(E,A);break;case"select":var he=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!A.multiple;var me=A.value;me!=null?Qe(E,!!A.multiple,me,!1):he!==!!A.multiple&&(A.defaultValue!=null?Qe(E,!!A.multiple,A.defaultValue,!0):Qe(E,!!A.multiple,A.multiple?[]:"",!1))}E[qi]=A}catch(we){Ge(t,t.return,we)}}break;case 6:if(Xt(n,t),ar(t),g&4){if(t.stateNode===null)throw Error(i(162));E=t.stateNode,A=t.memoizedProps;try{E.nodeValue=A}catch(we){Ge(t,t.return,we)}}break;case 3:if(Xt(n,t),ar(t),g&4&&s!==null&&s.memoizedState.isDehydrated)try{Bi(n.containerInfo)}catch(we){Ge(t,t.return,we)}break;case 4:Xt(n,t),ar(t);break;case 13:Xt(n,t),ar(t),E=t.child,E.flags&8192&&(A=E.memoizedState!==null,E.stateNode.isHidden=A,!A||E.alternate!==null&&E.alternate.memoizedState!==null||(xc=Ke())),g&4&&hf(t);break;case 22:if(de=s!==null&&s.memoizedState!==null,t.mode&1?(vt=(oe=vt)||de,Xt(n,t),vt=oe):Xt(n,t),ar(t),g&8192){if(oe=t.memoizedState!==null,(t.stateNode.isHidden=oe)&&!de&&(t.mode&1)!==0)for(ve=t,de=t.child;de!==null;){for(fe=ve=de;ve!==null;){switch(he=ve,me=he.child,he.tag){case 0:case 11:case 14:case 15:ns(4,he,he.return);break;case 1:ei(he,he.return);var ye=he.stateNode;if(typeof ye.componentWillUnmount=="function"){g=he,s=he.return;try{n=g,ye.props=n.memoizedProps,ye.state=n.memoizedState,ye.componentWillUnmount()}catch(we){Ge(g,s,we)}}break;case 5:ei(he,he.return);break;case 22:if(he.memoizedState!==null){_f(fe);continue}}me!==null?(me.return=he,ve=me):_f(fe)}de=de.sibling}e:for(de=null,fe=t;;){if(fe.tag===5){if(de===null){de=fe;try{E=fe.stateNode,oe?(A=E.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):(Y=fe.stateNode,Q=fe.memoizedProps.style,$=Q!=null&&Q.hasOwnProperty("display")?Q.display:null,Y.style.display=Rn("display",$))}catch(we){Ge(t,t.return,we)}}}else if(fe.tag===6){if(de===null)try{fe.stateNode.nodeValue=oe?"":fe.memoizedProps}catch(we){Ge(t,t.return,we)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===t)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===t)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===t)break e;de===fe&&(de=null),fe=fe.return}de===fe&&(de=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:Xt(n,t),ar(t),g&4&&hf(t);break;case 21:break;default:Xt(n,t),ar(t)}}function ar(t){var n=t.flags;if(n&2){try{e:{for(var s=t.return;s!==null;){if(lf(s)){var g=s;break e}s=s.return}throw Error(i(160))}switch(g.tag){case 5:var E=g.stateNode;g.flags&32&&(ot(E,""),g.flags&=-33);var A=cf(t);wc(t,A,E);break;case 3:case 4:var $=g.stateNode.containerInfo,Y=cf(t);yc(t,Y,$);break;default:throw Error(i(161))}}catch(Q){Ge(t,t.return,Q)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function D0(t,n,s){ve=t,ff(t)}function ff(t,n,s){for(var g=(t.mode&1)!==0;ve!==null;){var E=ve,A=E.child;if(E.tag===22&&g){var $=E.memoizedState!==null||Mo;if(!$){var Y=E.alternate,Q=Y!==null&&Y.memoizedState!==null||vt;Y=Mo;var oe=vt;if(Mo=$,(vt=Q)&&!oe)for(ve=E;ve!==null;)$=ve,Q=$.child,$.tag===22&&$.memoizedState!==null?gf(E):Q!==null?(Q.return=$,ve=Q):gf(E);for(;A!==null;)ve=A,ff(A),A=A.sibling;ve=E,Mo=Y,vt=oe}pf(t)}else(E.subtreeFlags&8772)!==0&&A!==null?(A.return=E,ve=A):pf(t)}}function pf(t){for(;ve!==null;){var n=ve;if((n.flags&8772)!==0){var s=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:vt||Po(5,n);break;case 1:var g=n.stateNode;if(n.flags&4&&!vt)if(s===null)g.componentDidMount();else{var E=n.elementType===n.type?s.memoizedProps:qt(n.type,s.memoizedProps);g.componentDidUpdate(E,s.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var A=n.updateQueue;A!==null&&pd(n,A,g);break;case 3:var $=n.updateQueue;if($!==null){if(s=null,n.child!==null)switch(n.child.tag){case 5:s=n.child.stateNode;break;case 1:s=n.child.stateNode}pd(n,$,s)}break;case 5:var Y=n.stateNode;if(s===null&&n.flags&4){s=Y;var Q=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":Q.autoFocus&&s.focus();break;case"img":Q.src&&(s.src=Q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var oe=n.alternate;if(oe!==null){var de=oe.memoizedState;if(de!==null){var fe=de.dehydrated;fe!==null&&Bi(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}vt||n.flags&512&&vc(n)}catch(he){Ge(n,n.return,he)}}if(n===t){ve=null;break}if(s=n.sibling,s!==null){s.return=n.return,ve=s;break}ve=n.return}}function _f(t){for(;ve!==null;){var n=ve;if(n===t){ve=null;break}var s=n.sibling;if(s!==null){s.return=n.return,ve=s;break}ve=n.return}}function gf(t){for(;ve!==null;){var n=ve;try{switch(n.tag){case 0:case 11:case 15:var s=n.return;try{Po(4,n)}catch(Q){Ge(n,s,Q)}break;case 1:var g=n.stateNode;if(typeof g.componentDidMount=="function"){var E=n.return;try{g.componentDidMount()}catch(Q){Ge(n,E,Q)}}var A=n.return;try{vc(n)}catch(Q){Ge(n,A,Q)}break;case 5:var $=n.return;try{vc(n)}catch(Q){Ge(n,$,Q)}}}catch(Q){Ge(n,n.return,Q)}if(n===t){ve=null;break}var Y=n.sibling;if(Y!==null){Y.return=n.return,ve=Y;break}ve=n.return}}var A0=Math.ceil,No=w.ReactCurrentDispatcher,Sc=w.ReactCurrentOwner,zt=w.ReactCurrentBatchConfig,Me=0,lt=null,et=null,ft=0,Pt=0,ti=Or(0),it=0,is=null,_n=0,Bo=0,Cc=0,ss=null,bt=null,xc=0,ri=1/0,Cr=null,Io=!1,bc=null,Wr=null,Oo=!1,Ur=null,Ho=0,os=0,Ec=null,Fo=-1,jo=0;function wt(){return(Me&6)!==0?Ke():Fo!==-1?Fo:Fo=Ke()}function Vr(t){return(t.mode&1)===0?1:(Me&2)!==0&&ft!==0?ft&-ft:f0.transition!==null?(jo===0&&(jo=Bn()),jo):(t=Be,t!==0||(t=window.event,t=t===void 0?16:mh(t.type)),t)}function Yt(t,n,s,g){if(50<os)throw os=0,Ec=null,Error(i(185));an(t,s,g),((Me&2)===0||t!==lt)&&(t===lt&&((Me&2)===0&&(Bo|=s),it===4&&qr(t,ft)),Et(t,g),s===1&&Me===0&&(n.mode&1)===0&&(ri=Ke()+500,po&&Fr()))}function Et(t,n){var s=t.callbackNode;ol(t,n);var g=Nn(t,t===lt?ft:0);if(g===0)s!==null&&Ws(s),t.callbackNode=null,t.callbackPriority=0;else if(n=g&-g,t.callbackPriority!==n){if(s!=null&&Ws(s),n===1)t.tag===0?d0(vf.bind(null,t)):rd(vf.bind(null,t)),l0(function(){(Me&6)===0&&Fr()}),s=null;else{switch(ch(g)){case 1:s=Ri;break;case 4:s=Vs;break;case 16:s=Tn;break;case 536870912:s=qs;break;default:s=Tn}s=kf(s,mf.bind(null,t))}t.callbackPriority=n,t.callbackNode=s}}function mf(t,n){if(Fo=-1,jo=0,(Me&6)!==0)throw Error(i(327));var s=t.callbackNode;if(ni()&&t.callbackNode!==s)return null;var g=Nn(t,t===lt?ft:0);if(g===0)return null;if((g&30)!==0||(g&t.expiredLanes)!==0||n)n=zo(t,g);else{n=g;var E=Me;Me|=2;var A=wf();(lt!==t||ft!==n)&&(Cr=null,ri=Ke()+500,mn(t,n));do try{P0();break}catch(Y){yf(t,Y)}while(!0);Wl(),No.current=A,Me=E,et!==null?n=0:(lt=null,ft=0,n=it)}if(n!==0){if(n===2&&(E=Di(t),E!==0&&(g=E,n=kc(t,E))),n===1)throw s=is,mn(t,0),qr(t,g),Et(t,Ke()),s;if(n===6)qr(t,g);else{if(E=t.current.alternate,(g&30)===0&&!T0(E)&&(n=zo(t,g),n===2&&(A=Di(t),A!==0&&(g=A,n=kc(t,A))),n===1))throw s=is,mn(t,0),qr(t,g),Et(t,Ke()),s;switch(t.finishedWork=E,t.finishedLanes=g,n){case 0:case 1:throw Error(i(345));case 2:vn(t,bt,Cr);break;case 3:if(qr(t,g),(g&130023424)===g&&(n=xc+500-Ke(),10<n)){if(Nn(t,0)!==0)break;if(E=t.suspendedLanes,(E&g)!==g){wt(),t.pingedLanes|=t.suspendedLanes&E;break}t.timeoutHandle=Ml(vn.bind(null,t,bt,Cr),n);break}vn(t,bt,Cr);break;case 4:if(qr(t,g),(g&4194240)===g)break;for(n=t.eventTimes,E=-1;0<g;){var $=31-Dt(g);A=1<<$,$=n[$],$>E&&(E=$),g&=~A}if(g=E,g=Ke()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*A0(g/1960))-g,10<g){t.timeoutHandle=Ml(vn.bind(null,t,bt,Cr),g);break}vn(t,bt,Cr);break;case 5:vn(t,bt,Cr);break;default:throw Error(i(329))}}}return Et(t,Ke()),t.callbackNode===s?mf.bind(null,t):null}function kc(t,n){var s=ss;return t.current.memoizedState.isDehydrated&&(mn(t,n).flags|=256),t=zo(t,n),t!==2&&(n=bt,bt=s,n!==null&&Lc(n)),t}function Lc(t){bt===null?bt=t:bt.push.apply(bt,t)}function T0(t){for(var n=t;;){if(n.flags&16384){var s=n.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var g=0;g<s.length;g++){var E=s[g],A=E.getSnapshot;E=E.value;try{if(!Ut(A(),E))return!1}catch{return!1}}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function qr(t,n){for(n&=~Cc,n&=~Bo,t.suspendedLanes|=n,t.pingedLanes&=~n,t=t.expirationTimes;0<n;){var s=31-Dt(n),g=1<<s;t[s]=-1,n&=~g}}function vf(t){if((Me&6)!==0)throw Error(i(327));ni();var n=Nn(t,0);if((n&1)===0)return Et(t,Ke()),null;var s=zo(t,n);if(t.tag!==0&&s===2){var g=Di(t);g!==0&&(n=g,s=kc(t,g))}if(s===1)throw s=is,mn(t,0),qr(t,n),Et(t,Ke()),s;if(s===6)throw Error(i(345));return t.finishedWork=t.current.alternate,t.finishedLanes=n,vn(t,bt,Cr),Et(t,Ke()),null}function Rc(t,n){var s=Me;Me|=1;try{return t(n)}finally{Me=s,Me===0&&(ri=Ke()+500,po&&Fr())}}function gn(t){Ur!==null&&Ur.tag===0&&(Me&6)===0&&ni();var n=Me;Me|=1;var s=zt.transition,g=Be;try{if(zt.transition=null,Be=1,t)return t()}finally{Be=g,zt.transition=s,Me=n,(Me&6)===0&&Fr()}}function Dc(){Pt=ti.current,je(ti)}function mn(t,n){t.finishedWork=null,t.finishedLanes=0;var s=t.timeoutHandle;if(s!==-1&&(t.timeoutHandle=-1,a0(s)),et!==null)for(s=et.return;s!==null;){var g=s;switch(Hl(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&ho();break;case 3:Jn(),je(St),je(_t),Ql();break;case 5:Yl(g);break;case 4:Jn();break;case 13:je(Xe);break;case 19:je(Xe);break;case 10:Ul(g.type._context);break;case 22:case 23:Dc()}s=s.return}if(lt=t,et=t=Kr(t.current,null),ft=Pt=n,it=0,is=null,Cc=Bo=_n=0,bt=ss=null,dn!==null){for(n=0;n<dn.length;n++)if(s=dn[n],g=s.interleaved,g!==null){s.interleaved=null;var E=g.next,A=s.pending;if(A!==null){var $=A.next;A.next=E,g.next=$}s.pending=g}dn=null}return t}function yf(t,n){do{var s=et;try{if(Wl(),bo.current=Ro,Eo){for(var g=Ye.memoizedState;g!==null;){var E=g.queue;E!==null&&(E.pending=null),g=g.next}Eo=!1}if(pn=0,at=nt=Ye=null,Ji=!1,Zi=0,Sc.current=null,s===null||s.return===null){it=1,is=n,et=null;break}e:{var A=t,$=s.return,Y=s,Q=n;if(n=ft,Y.flags|=32768,Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var oe=Q,de=Y,fe=de.tag;if((de.mode&1)===0&&(fe===0||fe===11||fe===15)){var he=de.alternate;he?(de.updateQueue=he.updateQueue,de.memoizedState=he.memoizedState,de.lanes=he.lanes):(de.updateQueue=null,de.memoizedState=null)}var me=Wd($);if(me!==null){me.flags&=-257,Ud(me,$,Y,A,n),me.mode&1&&$d(A,oe,n),n=me,Q=oe;var ye=n.updateQueue;if(ye===null){var we=new Set;we.add(Q),n.updateQueue=we}else ye.add(Q);break e}else{if((n&1)===0){$d(A,oe,n),Ac();break e}Q=Error(i(426))}}else if(We&&Y.mode&1){var Ze=Wd($);if(Ze!==null){(Ze.flags&65536)===0&&(Ze.flags|=256),Ud(Ze,$,Y,A,n),zl(Zn(Q,Y));break e}}A=Q=Zn(Q,Y),it!==4&&(it=2),ss===null?ss=[A]:ss.push(A),A=$;do{switch(A.tag){case 3:A.flags|=65536,n&=-n,A.lanes|=n;var ne=jd(A,Q,n);fd(A,ne);break e;case 1:Y=Q;var ee=A.type,se=A.stateNode;if((A.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(Wr===null||!Wr.has(se)))){A.flags|=65536,n&=-n,A.lanes|=n;var _e=zd(A,Y,n);fd(A,_e);break e}}A=A.return}while(A!==null)}Cf(s)}catch(Ce){n=Ce,et===s&&s!==null&&(et=s=s.return);continue}break}while(!0)}function wf(){var t=No.current;return No.current=Ro,t===null?Ro:t}function Ac(){(it===0||it===3||it===2)&&(it=4),lt===null||(_n&268435455)===0&&(Bo&268435455)===0||qr(lt,ft)}function zo(t,n){var s=Me;Me|=2;var g=wf();(lt!==t||ft!==n)&&(Cr=null,mn(t,n));do try{M0();break}catch(E){yf(t,E)}while(!0);if(Wl(),Me=s,No.current=g,et!==null)throw Error(i(261));return lt=null,ft=0,it}function M0(){for(;et!==null;)Sf(et)}function P0(){for(;et!==null&&!Za();)Sf(et)}function Sf(t){var n=Ef(t.alternate,t,Pt);t.memoizedProps=t.pendingProps,n===null?Cf(t):et=n,Sc.current=null}function Cf(t){var n=t;do{var s=n.alternate;if(t=n.return,(n.flags&32768)===0){if(s=E0(s,n,Pt),s!==null){et=s;return}}else{if(s=k0(s,n),s!==null){s.flags&=32767,et=s;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{it=6,et=null;return}}if(n=n.sibling,n!==null){et=n;return}et=n=t}while(n!==null);it===0&&(it=5)}function vn(t,n,s){var g=Be,E=zt.transition;try{zt.transition=null,Be=1,N0(t,n,s,g)}finally{zt.transition=E,Be=g}return null}function N0(t,n,s,g){do ni();while(Ur!==null);if((Me&6)!==0)throw Error(i(327));s=t.finishedWork;var E=t.finishedLanes;if(s===null)return null;if(t.finishedWork=null,t.finishedLanes=0,s===t.current)throw Error(i(177));t.callbackNode=null,t.callbackPriority=0;var A=s.lanes|s.childLanes;if(Xs(t,A),t===lt&&(et=lt=null,ft=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Oo||(Oo=!0,kf(Tn,function(){return ni(),null})),A=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||A){A=zt.transition,zt.transition=null;var $=Be;Be=1;var Y=Me;Me|=4,Sc.current=null,R0(t,s),df(s,t),e0(Al),Qs=!!Dl,Al=Dl=null,t.current=s,D0(s),Us(),Me=Y,Be=$,zt.transition=A}else t.current=s;if(Oo&&(Oo=!1,Ur=t,Ho=E),A=t.pendingLanes,A===0&&(Wr=null),rl(s.stateNode),Et(t,Ke()),n!==null)for(g=t.onRecoverableError,s=0;s<n.length;s++)E=n[s],g(E.value,{componentStack:E.stack,digest:E.digest});if(Io)throw Io=!1,t=bc,bc=null,t;return(Ho&1)!==0&&t.tag!==0&&ni(),A=t.pendingLanes,(A&1)!==0?t===Ec?os++:(os=0,Ec=t):os=0,Fr(),null}function ni(){if(Ur!==null){var t=ch(Ho),n=zt.transition,s=Be;try{if(zt.transition=null,Be=16>t?16:t,Ur===null)var g=!1;else{if(t=Ur,Ur=null,Ho=0,(Me&6)!==0)throw Error(i(331));var E=Me;for(Me|=4,ve=t.current;ve!==null;){var A=ve,$=A.child;if((ve.flags&16)!==0){var Y=A.deletions;if(Y!==null){for(var Q=0;Q<Y.length;Q++){var oe=Y[Q];for(ve=oe;ve!==null;){var de=ve;switch(de.tag){case 0:case 11:case 15:ns(8,de,A)}var fe=de.child;if(fe!==null)fe.return=de,ve=fe;else for(;ve!==null;){de=ve;var he=de.sibling,me=de.return;if(af(de),de===oe){ve=null;break}if(he!==null){he.return=me,ve=he;break}ve=me}}}var ye=A.alternate;if(ye!==null){var we=ye.child;if(we!==null){ye.child=null;do{var Ze=we.sibling;we.sibling=null,we=Ze}while(we!==null)}}ve=A}}if((A.subtreeFlags&2064)!==0&&$!==null)$.return=A,ve=$;else e:for(;ve!==null;){if(A=ve,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:ns(9,A,A.return)}var ne=A.sibling;if(ne!==null){ne.return=A.return,ve=ne;break e}ve=A.return}}var ee=t.current;for(ve=ee;ve!==null;){$=ve;var se=$.child;if(($.subtreeFlags&2064)!==0&&se!==null)se.return=$,ve=se;else e:for($=ee;ve!==null;){if(Y=ve,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:Po(9,Y)}}catch(Ce){Ge(Y,Y.return,Ce)}if(Y===$){ve=null;break e}var _e=Y.sibling;if(_e!==null){_e.return=Y.return,ve=_e;break e}ve=Y.return}}if(Me=E,Fr(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(on,t)}catch{}g=!0}return g}finally{Be=s,zt.transition=n}}return!1}function xf(t,n,s){n=Zn(s,n),n=jd(t,n,1),t=zr(t,n,1),n=wt(),t!==null&&(an(t,1,n),Et(t,n))}function Ge(t,n,s){if(t.tag===3)xf(t,t,s);else for(;n!==null;){if(n.tag===3){xf(n,t,s);break}else if(n.tag===1){var g=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Wr===null||!Wr.has(g))){t=Zn(s,t),t=zd(n,t,1),n=zr(n,t,1),t=wt(),n!==null&&(an(n,1,t),Et(n,t));break}}n=n.return}}function B0(t,n,s){var g=t.pingCache;g!==null&&g.delete(n),n=wt(),t.pingedLanes|=t.suspendedLanes&s,lt===t&&(ft&s)===s&&(it===4||it===3&&(ft&130023424)===ft&&500>Ke()-xc?mn(t,0):Cc|=s),Et(t,n)}function bf(t,n){n===0&&((t.mode&1)===0?n=1:(n=Pn,Pn<<=1,(Pn&130023424)===0&&(Pn=4194304)));var s=wt();t=yr(t,n),t!==null&&(an(t,n,s),Et(t,s))}function I0(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),bf(t,s)}function O0(t,n){var s=0;switch(t.tag){case 13:var g=t.stateNode,E=t.memoizedState;E!==null&&(s=E.retryLane);break;case 19:g=t.stateNode;break;default:throw Error(i(314))}g!==null&&g.delete(n),bf(t,s)}var Ef;Ef=function(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps||St.current)xt=!0;else{if((t.lanes&s)===0&&(n.flags&128)===0)return xt=!1,b0(t,n,s);xt=(t.flags&131072)!==0}else xt=!1,We&&(n.flags&1048576)!==0&&nd(n,go,n.index);switch(n.lanes=0,n.tag){case 2:var g=n.type;To(t,n),t=n.pendingProps;var E=Vn(n,_t.current);Qn(n,s),E=ec(null,n,g,t,E,s);var A=tc();return n.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Ct(g)?(A=!0,fo(n)):A=!1,n.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Kl(n),E.updater=Do,n.stateNode=E,E._reactInternals=n,ac(n,g,t,s),n=hc(null,n,g,!0,A,s)):(n.tag=0,We&&A&&Ol(n),yt(null,n,E,s),n=n.child),n;case 16:g=n.elementType;e:{switch(To(t,n),t=n.pendingProps,E=g._init,g=E(g._payload),n.type=g,E=n.tag=F0(g),t=qt(g,t),E){case 0:n=uc(null,n,g,t,s);break e;case 1:n=Gd(null,n,g,t,s);break e;case 11:n=Vd(null,n,g,t,s);break e;case 14:n=qd(null,n,g,qt(g.type,t),s);break e}throw Error(i(306,g,""))}return n;case 0:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),uc(t,n,g,E,s);case 1:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),Gd(t,n,g,E,s);case 3:e:{if(Qd(n),t===null)throw Error(i(387));g=n.pendingProps,A=n.memoizedState,E=A.element,dd(t,n),Co(n,g,null,s);var $=n.memoizedState;if(g=$.element,A.isDehydrated)if(A={element:g,isDehydrated:!1,cache:$.cache,pendingSuspenseBoundaries:$.pendingSuspenseBoundaries,transitions:$.transitions},n.updateQueue.baseState=A,n.memoizedState=A,n.flags&256){E=Zn(Error(i(423)),n),n=Jd(t,n,g,s,E);break e}else if(g!==E){E=Zn(Error(i(424)),n),n=Jd(t,n,g,s,E);break e}else for(Mt=Ir(n.stateNode.containerInfo.firstChild),Tt=n,We=!0,Vt=null,s=ud(n,null,g,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Xn(),g===E){n=Sr(t,n,s);break e}yt(t,n,g,s)}n=n.child}return n;case 5:return _d(n),t===null&&jl(n),g=n.type,E=n.pendingProps,A=t!==null?t.memoizedProps:null,$=E.children,Tl(g,E)?$=null:A!==null&&Tl(g,A)&&(n.flags|=32),Yd(t,n),yt(t,n,$,s),n.child;case 6:return t===null&&jl(n),null;case 13:return Zd(t,n,s);case 4:return Xl(n,n.stateNode.containerInfo),g=n.pendingProps,t===null?n.child=Yn(n,null,g,s):yt(t,n,g,s),n.child;case 11:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),Vd(t,n,g,E,s);case 7:return yt(t,n,n.pendingProps,s),n.child;case 8:return yt(t,n,n.pendingProps.children,s),n.child;case 12:return yt(t,n,n.pendingProps.children,s),n.child;case 10:e:{if(g=n.type._context,E=n.pendingProps,A=n.memoizedProps,$=E.value,He(yo,g._currentValue),g._currentValue=$,A!==null)if(Ut(A.value,$)){if(A.children===E.children&&!St.current){n=Sr(t,n,s);break e}}else for(A=n.child,A!==null&&(A.return=n);A!==null;){var Y=A.dependencies;if(Y!==null){$=A.child;for(var Q=Y.firstContext;Q!==null;){if(Q.context===g){if(A.tag===1){Q=wr(-1,s&-s),Q.tag=2;var oe=A.updateQueue;if(oe!==null){oe=oe.shared;var de=oe.pending;de===null?Q.next=Q:(Q.next=de.next,de.next=Q),oe.pending=Q}}A.lanes|=s,Q=A.alternate,Q!==null&&(Q.lanes|=s),Vl(A.return,s,n),Y.lanes|=s;break}Q=Q.next}}else if(A.tag===10)$=A.type===n.type?null:A.child;else if(A.tag===18){if($=A.return,$===null)throw Error(i(341));$.lanes|=s,Y=$.alternate,Y!==null&&(Y.lanes|=s),Vl($,s,n),$=A.sibling}else $=A.child;if($!==null)$.return=A;else for($=A;$!==null;){if($===n){$=null;break}if(A=$.sibling,A!==null){A.return=$.return,$=A;break}$=$.return}A=$}yt(t,n,E.children,s),n=n.child}return n;case 9:return E=n.type,g=n.pendingProps.children,Qn(n,s),E=Ft(E),g=g(E),n.flags|=1,yt(t,n,g,s),n.child;case 14:return g=n.type,E=qt(g,n.pendingProps),E=qt(g.type,E),qd(t,n,g,E,s);case 15:return Kd(t,n,n.type,n.pendingProps,s);case 17:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),To(t,n),n.tag=1,Ct(g)?(t=!0,fo(n)):t=!1,Qn(n,s),Hd(n,g,E),ac(n,g,E,s),hc(null,n,g,!0,t,s);case 19:return tf(t,n,s);case 22:return Xd(t,n,s)}throw Error(i(156,n.tag))};function kf(t,n){return $s(t,n)}function H0(t,n,s,g){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(t,n,s,g){return new H0(t,n,s,g)}function Tc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function F0(t){if(typeof t=="function")return Tc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===j)return 11;if(t===q)return 14}return 2}function Kr(t,n){var s=t.alternate;return s===null?(s=$t(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&14680064,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s}function $o(t,n,s,g,E,A){var $=2;if(g=t,typeof t=="function")Tc(t)&&($=1);else if(typeof t=="string")$=5;else e:switch(t){case D:return yn(s.children,E,A,n);case k:$=8,E|=8;break;case M:return t=$t(12,s,n,E|2),t.elementType=M,t.lanes=A,t;case N:return t=$t(13,s,n,E),t.elementType=N,t.lanes=A,t;case I:return t=$t(19,s,n,E),t.elementType=I,t.lanes=A,t;case K:return Wo(s,E,A,n);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case W:$=10;break e;case z:$=9;break e;case j:$=11;break e;case q:$=14;break e;case U:$=16,g=null;break e}throw Error(i(130,t==null?t:typeof t,""))}return n=$t($,s,n,E),n.elementType=t,n.type=g,n.lanes=A,n}function yn(t,n,s,g){return t=$t(7,t,g,n),t.lanes=s,t}function Wo(t,n,s,g){return t=$t(22,t,g,n),t.elementType=K,t.lanes=s,t.stateNode={isHidden:!1},t}function Mc(t,n,s){return t=$t(6,t,null,n),t.lanes=s,t}function Pc(t,n,s){return n=$t(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function j0(t,n,s,g,E){this.tag=n,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ai(0),this.expirationTimes=Ai(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ai(0),this.identifierPrefix=g,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function Nc(t,n,s,g,E,A,$,Y,Q){return t=new j0(t,n,s,Y,Q),n===1?(n=1,A===!0&&(n|=8)):n=0,A=$t(3,null,null,n),t.current=A,A.stateNode=t,A.memoizedState={element:g,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Kl(A),t}function z0(t,n,s){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:g==null?null:""+g,children:t,containerInfo:n,implementation:s}}function Lf(t){if(!t)return Hr;t=t._reactInternals;e:{if(rr(t)!==t||t.tag!==1)throw Error(i(170));var n=t;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Ct(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(t.tag===1){var s=t.type;if(Ct(s))return ed(t,s,n)}return n}function Rf(t,n,s,g,E,A,$,Y,Q){return t=Nc(s,g,!0,t,E,A,$,Y,Q),t.context=Lf(null),s=t.current,g=wt(),E=Vr(s),A=wr(g,E),A.callback=n??null,zr(s,A,E),t.current.lanes=E,an(t,E,g),Et(t,g),t}function Uo(t,n,s,g){var E=n.current,A=wt(),$=Vr(E);return s=Lf(s),n.context===null?n.context=s:n.pendingContext=s,n=wr(A,$),n.payload={element:t},g=g===void 0?null:g,g!==null&&(n.callback=g),t=zr(E,n,$),t!==null&&(Yt(t,E,$,A),So(t,E,$)),$}function Vo(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Df(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function Bc(t,n){Df(t,n),(t=t.alternate)&&Df(t,n)}function $0(){return null}var Af=typeof reportError=="function"?reportError:function(t){console.error(t)};function Ic(t){this._internalRoot=t}qo.prototype.render=Ic.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));Uo(t,n,null,null)},qo.prototype.unmount=Ic.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;gn(function(){Uo(null,t,null,null)}),n[_r]=null}};function qo(t){this._internalRoot=t}qo.prototype.unstable_scheduleHydration=function(t){if(t){var n=dh();t={blockedOn:null,target:t,priority:n};for(var s=0;s<Pr.length&&n!==0&&n<Pr[s].priority;s++);Pr.splice(s,0,t),s===0&&_h(t)}};function Oc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ko(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Tf(){}function W0(t,n,s,g,E){if(E){if(typeof g=="function"){var A=g;g=function(){var oe=Vo($);A.call(oe)}}var $=Rf(n,g,t,0,null,!1,!1,"",Tf);return t._reactRootContainer=$,t[_r]=$.current,Ui(t.nodeType===8?t.parentNode:t),gn(),$}for(;E=t.lastChild;)t.removeChild(E);if(typeof g=="function"){var Y=g;g=function(){var oe=Vo(Q);Y.call(oe)}}var Q=Nc(t,0,!1,null,null,!1,!1,"",Tf);return t._reactRootContainer=Q,t[_r]=Q.current,Ui(t.nodeType===8?t.parentNode:t),gn(function(){Uo(n,Q,s,g)}),Q}function Xo(t,n,s,g,E){var A=s._reactRootContainer;if(A){var $=A;if(typeof E=="function"){var Y=E;E=function(){var Q=Vo($);Y.call(Q)}}Uo(n,$,t,E)}else $=W0(s,n,t,E,g);return Vo($)}uh=function(t){switch(t.tag){case 3:var n=t.stateNode;if(n.current.memoizedState.isDehydrated){var s=nr(n.pendingLanes);s!==0&&(al(n,s|1),Et(n,Ke()),(Me&6)===0&&(ri=Ke()+500,Fr()))}break;case 13:gn(function(){var g=yr(t,1);if(g!==null){var E=wt();Yt(g,t,1,E)}}),Bc(t,1)}},ll=function(t){if(t.tag===13){var n=yr(t,134217728);if(n!==null){var s=wt();Yt(n,t,134217728,s)}Bc(t,134217728)}},hh=function(t){if(t.tag===13){var n=Vr(t),s=yr(t,n);if(s!==null){var g=wt();Yt(s,t,n,g)}Bc(t,n)}},dh=function(){return Be},fh=function(t,n){var s=Be;try{return Be=t,n()}finally{Be=s}},Ci=function(t,n,s){switch(n){case"input":if(ge(t,s),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<s.length;n++){var g=s[n];if(g!==t&&g.form===t.form){var E=uo(g);if(!E)throw Error(i(90));le(g),ge(g,E)}}}break;case"textarea":pt(t,s);break;case"select":n=s.value,n!=null&&Qe(t,!!s.multiple,n,!1)}},Os=Rc,Hs=gn;var U0={usingClientEntryPoint:!1,Events:[Ki,Wn,uo,Bs,Is,Rc]},as={findFiberByHostInstance:ln,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},V0={bundleType:as.bundleType,version:as.version,rendererPackageName:as.rendererPackageName,rendererConfig:as.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=js(t),t===null?null:t.stateNode},findFiberByHostInstance:as.findFiberByHostInstance||$0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yo.isDisabled&&Yo.supportsFiber)try{on=Yo.inject(V0),It=Yo}catch{}}return kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U0,kt.createPortal=function(t,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Oc(n))throw Error(i(200));return z0(t,n,null,s)},kt.createRoot=function(t,n){if(!Oc(t))throw Error(i(299));var s=!1,g="",E=Af;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(g=n.identifierPrefix),n.onRecoverableError!==void 0&&(E=n.onRecoverableError)),n=Nc(t,1,!1,null,null,s,!1,g,E),t[_r]=n.current,Ui(t.nodeType===8?t.parentNode:t),new Ic(n)},kt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=js(n),t=t===null?null:t.stateNode,t},kt.flushSync=function(t){return gn(t)},kt.hydrate=function(t,n,s){if(!Ko(n))throw Error(i(200));return Xo(null,t,n,!0,s)},kt.hydrateRoot=function(t,n,s){if(!Oc(t))throw Error(i(405));var g=s!=null&&s.hydratedSources||null,E=!1,A="",$=Af;if(s!=null&&(s.unstable_strictMode===!0&&(E=!0),s.identifierPrefix!==void 0&&(A=s.identifierPrefix),s.onRecoverableError!==void 0&&($=s.onRecoverableError)),n=Rf(n,null,t,1,s??null,E,!1,A,$),t[_r]=n.current,Ui(t),g)for(t=0;t<g.length;t++)s=g[t],E=s._getVersion,E=E(s._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[s,E]:n.mutableSourceEagerHydrationData.push(s,E);return new qo(n)},kt.render=function(t,n,s){if(!Ko(n))throw Error(i(200));return Xo(null,t,n,!1,s)},kt.unmountComponentAtNode=function(t){if(!Ko(t))throw Error(i(40));return t._reactRootContainer?(gn(function(){Xo(null,null,t,!1,function(){t._reactRootContainer=null,t[_r]=null})}),!0):!1},kt.unstable_batchedUpdates=Rc,kt.unstable_renderSubtreeIntoContainer=function(t,n,s,g){if(!Ko(s))throw Error(i(200));if(t==null||t._reactInternals===void 0)throw Error(i(38));return Xo(t,n,s,!1,g)},kt.version="18.3.1-next-f1338f8080-20240426",kt}var Ff;function r_(){if(Ff)return jc.exports;Ff=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),jc.exports=J0(),jc.exports}var jf;function Z0(){if(jf)return Go;jf=1;var e=r_();return Go.createRoot=e.createRoot,Go.hydrateRoot=e.hydrateRoot,Go}var ev=Z0();const tv=Ou(ev),hr=Object.create(null);hr.open="0";hr.close="1";hr.ping="2";hr.pong="3";hr.message="4";hr.upgrade="5";hr.noop="6";const ca=Object.create(null);Object.keys(hr).forEach(e=>{ca[hr[e]]=e});const du={type:"error",data:"parser error"},n_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",i_=typeof ArrayBuffer=="function",s_=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Fu=({type:e,data:r},i,o)=>n_&&r instanceof Blob?i?o(r):zf(r,o):i_&&(r instanceof ArrayBuffer||s_(r))?i?o(r):zf(new Blob([r]),o):o(hr[e]+(r||"")),zf=(e,r)=>{const i=new FileReader;return i.onload=function(){const o=i.result.split(",")[1];r("b"+(o||""))},i.readAsDataURL(e)};function $f(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Wc;function rv(e,r){if(n_&&e.data instanceof Blob)return e.data.arrayBuffer().then($f).then(r);if(i_&&(e.data instanceof ArrayBuffer||s_(e.data)))return r($f(e.data));Fu(e,!1,i=>{Wc||(Wc=new TextEncoder),r(Wc.encode(i))})}const Wf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ds=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Wf.length;e++)ds[Wf.charCodeAt(e)]=e;const nv=e=>{let r=e.length*.75,i=e.length,o,h=0,S,y,a,l;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const _=new ArrayBuffer(r),v=new Uint8Array(_);for(o=0;o<i;o+=4)S=ds[e.charCodeAt(o)],y=ds[e.charCodeAt(o+1)],a=ds[e.charCodeAt(o+2)],l=ds[e.charCodeAt(o+3)],v[h++]=S<<2|y>>4,v[h++]=(y&15)<<4|a>>2,v[h++]=(a&3)<<6|l&63;return _},iv=typeof ArrayBuffer=="function",ju=(e,r)=>{if(typeof e!="string")return{type:"message",data:o_(e,r)};const i=e.charAt(0);return i==="b"?{type:"message",data:sv(e.substring(1),r)}:ca[i]?e.length>1?{type:ca[i],data:e.substring(1)}:{type:ca[i]}:du},sv=(e,r)=>{if(iv){const i=nv(e);return o_(i,r)}else return{base64:!0,data:e}},o_=(e,r)=>{switch(r){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},a_="",ov=(e,r)=>{const i=e.length,o=new Array(i);let h=0;e.forEach((S,y)=>{Fu(S,!1,a=>{o[y]=a,++h===i&&r(o.join(a_))})})},av=(e,r)=>{const i=e.split(a_),o=[];for(let h=0;h<i.length;h++){const S=ju(i[h],r);if(o.push(S),S.type==="error")break}return o};function lv(){return new TransformStream({transform(e,r){rv(e,i=>{const o=i.length;let h;if(o<126)h=new Uint8Array(1),new DataView(h.buffer).setUint8(0,o);else if(o<65536){h=new Uint8Array(3);const S=new DataView(h.buffer);S.setUint8(0,126),S.setUint16(1,o)}else{h=new Uint8Array(9);const S=new DataView(h.buffer);S.setUint8(0,127),S.setBigUint64(1,BigInt(o))}e.data&&typeof e.data!="string"&&(h[0]|=128),r.enqueue(h),r.enqueue(i)})}})}let Uc;function Qo(e){return e.reduce((r,i)=>r+i.length,0)}function Jo(e,r){if(e[0].length===r)return e.shift();const i=new Uint8Array(r);let o=0;for(let h=0;h<r;h++)i[h]=e[0][o++],o===e[0].length&&(e.shift(),o=0);return e.length&&o<e[0].length&&(e[0]=e[0].slice(o)),i}function cv(e,r){Uc||(Uc=new TextDecoder);const i=[];let o=0,h=-1,S=!1;return new TransformStream({transform(y,a){for(i.push(y);;){if(o===0){if(Qo(i)<1)break;const l=Jo(i,1);S=(l[0]&128)===128,h=l[0]&127,h<126?o=3:h===126?o=1:o=2}else if(o===1){if(Qo(i)<2)break;const l=Jo(i,2);h=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),o=3}else if(o===2){if(Qo(i)<8)break;const l=Jo(i,8),_=new DataView(l.buffer,l.byteOffset,l.length),v=_.getUint32(0);if(v>Math.pow(2,21)-1){a.enqueue(du);break}h=v*Math.pow(2,32)+_.getUint32(4),o=3}else{if(Qo(i)<h)break;const l=Jo(i,h);a.enqueue(ju(S?l:Uc.decode(l),r)),o=0}if(h===0||h>e){a.enqueue(du);break}}}})}const l_=4;function tt(e){if(e)return uv(e)}function uv(e){for(var r in tt.prototype)e[r]=tt.prototype[r];return e}tt.prototype.on=tt.prototype.addEventListener=function(e,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(r),this};tt.prototype.once=function(e,r){function i(){this.off(e,i),r.apply(this,arguments)}return i.fn=r,this.on(e,i),this};tt.prototype.off=tt.prototype.removeListener=tt.prototype.removeAllListeners=tt.prototype.removeEventListener=function(e,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+e];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var o,h=0;h<i.length;h++)if(o=i[h],o===r||o.fn===r){i.splice(h,1);break}return i.length===0&&delete this._callbacks["$"+e],this};tt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+e],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(i){i=i.slice(0);for(var o=0,h=i.length;o<h;++o)i[o].apply(this,r)}return this};tt.prototype.emitReserved=tt.prototype.emit;tt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};tt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Pa=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),Wt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),hv="arraybuffer";function c_(e,...r){return r.reduce((i,o)=>(e.hasOwnProperty(o)&&(i[o]=e[o]),i),{})}const dv=Wt.setTimeout,fv=Wt.clearTimeout;function Na(e,r){r.useNativeTimers?(e.setTimeoutFn=dv.bind(Wt),e.clearTimeoutFn=fv.bind(Wt)):(e.setTimeoutFn=Wt.setTimeout.bind(Wt),e.clearTimeoutFn=Wt.clearTimeout.bind(Wt))}const pv=1.33;function _v(e){return typeof e=="string"?gv(e):Math.ceil((e.byteLength||e.size)*pv)}function gv(e){let r=0,i=0;for(let o=0,h=e.length;o<h;o++)r=e.charCodeAt(o),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(o++,i+=4);return i}function u_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function mv(e){let r="";for(let i in e)e.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return r}function vv(e){let r={},i=e.split("&");for(let o=0,h=i.length;o<h;o++){let S=i[o].split("=");r[decodeURIComponent(S[0])]=decodeURIComponent(S[1])}return r}class yv extends Error{constructor(r,i,o){super(r),this.description=i,this.context=o,this.type="TransportError"}}class zu extends tt{constructor(r){super(),this.writable=!1,Na(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,o){return super.emitReserved("error",new yv(r,i,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const i=ju(r,this.socket.binaryType);this.onPacket(i)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,i={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const i=mv(r);return i.length?"?"+i:""}}class wv extends zu{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const i=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||i()})),this.writable||(o++,this.once("drain",function(){--o||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};av(r,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,ov(r,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=u_()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let h_=!1;try{h_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Sv=h_;function Cv(){}class xv extends wv{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let o=location.port;o||(o=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||o!==r.port}}doWrite(r,i){const o=this.request({method:"POST",data:r});o.on("success",i),o.on("error",(h,S)=>{this.onError("xhr post error",h,S)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,o)=>{this.onError("xhr poll error",i,o)}),this.pollXhr=r}}class cr extends tt{constructor(r,i,o){super(),this.createRequest=r,Na(this,o),this._opts=o,this._method=o.method||"GET",this._uri=i,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var r;const i=c_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(i);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let h in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(h)&&o.setRequestHeader(h,this._opts.extraHeaders[h])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var h;o.readyState===3&&((h=this._opts.cookieJar)===null||h===void 0||h.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(h){this.setTimeoutFn(()=>{this._onError(h)},0);return}typeof document<"u"&&(this._index=cr.requestsCount++,cr.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Cv,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete cr.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}cr.requestsCount=0;cr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Uf);else if(typeof addEventListener=="function"){const e="onpagehide"in Wt?"pagehide":"unload";addEventListener(e,Uf,!1)}}function Uf(){for(let e in cr.requests)cr.requests.hasOwnProperty(e)&&cr.requests[e].abort()}const bv=(function(){const e=d_({xdomain:!1});return e&&e.responseType!==null})();class Ev extends xv{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=bv&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new cr(d_,this.uri(),r)}}function d_(e){const r=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||Sv))return new XMLHttpRequest}catch{}if(!r)try{return new Wt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const f_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class kv extends zu{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,o=f_?{}:c_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,o)}catch(h){return this.emitReserved("error",h)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const o=r[i],h=i===r.length-1;Fu(o,this.supportsBinary,S=>{try{this.doWrite(o,S)}catch{}h&&Pa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=u_()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const Vc=Wt.WebSocket||Wt.MozWebSocket;class Lv extends kv{createSocket(r,i,o){return f_?new Vc(r,i,o):i?new Vc(r,i):new Vc(r)}doWrite(r,i){this.ws.send(i)}}class Rv extends zu{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const i=cv(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=r.readable.pipeThrough(i).getReader(),h=lv();h.readable.pipeTo(r.writable),this._writer=h.writable.getWriter();const S=()=>{o.read().then(({done:a,value:l})=>{a||(this.onPacket(l),S())}).catch(a=>{})};S();const y={type:"open"};this.query.sid&&(y.data=`{"sid":"${this.query.sid}"}`),this._writer.write(y).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const o=r[i],h=i===r.length-1;this._writer.write(o).then(()=>{h&&Pa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const Dv={websocket:Lv,webtransport:Rv,polling:Ev},Av=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Tv=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function fu(e){if(e.length>8e3)throw"URI too long";const r=e,i=e.indexOf("["),o=e.indexOf("]");i!=-1&&o!=-1&&(e=e.substring(0,i)+e.substring(i,o).replace(/:/g,";")+e.substring(o,e.length));let h=Av.exec(e||""),S={},y=14;for(;y--;)S[Tv[y]]=h[y]||"";return i!=-1&&o!=-1&&(S.source=r,S.host=S.host.substring(1,S.host.length-1).replace(/;/g,":"),S.authority=S.authority.replace("[","").replace("]","").replace(/;/g,":"),S.ipv6uri=!0),S.pathNames=Mv(S,S.path),S.queryKey=Pv(S,S.query),S}function Mv(e,r){const i=/\/{2,9}/g,o=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&o.splice(0,1),r.slice(-1)=="/"&&o.splice(o.length-1,1),o}function Pv(e,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,h,S){h&&(i[h]=S)}),i}const pu=typeof addEventListener=="function"&&typeof removeEventListener=="function",ua=[];pu&&addEventListener("offline",()=>{ua.forEach(e=>e())},!1);class en extends tt{constructor(r,i){if(super(),this.binaryType=hv,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(i=r,r=null),r){const o=fu(r);i.hostname=o.host,i.secure=o.protocol==="https"||o.protocol==="wss",i.port=o.port,o.query&&(i.query=o.query)}else i.host&&(i.hostname=fu(i.host).host);Na(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(o=>{const h=o.prototype.name;this.transports.push(h),this._transportsByName[h]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=vv(this.opts.query)),pu&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ua.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=l_,i.transport=r,this.id&&(i.sid=this.id);const o=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&en.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(r);i.open(),this.setTransport(i)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",en.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=r.data,this._onError(i);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let o=0;o<this.writeBuffer.length;o++){const h=this.writeBuffer[o].data;if(h&&(i+=_v(h)),o>0&&i>this._maxPayload)return this.writeBuffer.slice(0,o);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,Pa(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,o){return this._sendPacket("message",r,i,o),this}send(r,i,o){return this._sendPacket("message",r,i,o),this}_sendPacket(r,i,o,h){if(typeof i=="function"&&(h=i,i=void 0),typeof o=="function"&&(h=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const S={type:r,data:i,options:o};this.emitReserved("packetCreate",S),this.writeBuffer.push(S),h&&this.once("flush",h),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},o=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():r()}):this.upgrading?o():r()),this}_onError(r){if(en.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),pu&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=ua.indexOf(this._offlineEventListener);o!==-1&&ua.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}en.protocol=l_;class Nv extends en{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let i=this.createTransport(r),o=!1;en.priorWebsocketSuccess=!1;const h=()=>{o||(i.send([{type:"ping",data:"probe"}]),i.once("packet",c=>{if(!o)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;en.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(v(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=i.name,this.emitReserved("upgradeError",m)}}))};function S(){o||(o=!0,v(),i.close(),i=null)}const y=c=>{const m=new Error("probe error: "+c);m.transport=i.name,S(),this.emitReserved("upgradeError",m)};function a(){y("transport closed")}function l(){y("socket closed")}function _(c){i&&c.name!==i.name&&S()}const v=()=>{i.removeListener("open",h),i.removeListener("error",y),i.removeListener("close",a),this.off("close",l),this.off("upgrading",_)};i.once("open",h),i.once("error",y),i.once("close",a),this.once("close",l),this.once("upgrading",_),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{o||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let o=0;o<r.length;o++)~this.transports.indexOf(r[o])&&i.push(r[o]);return i}}let Bv=class extends Nv{constructor(r,i={}){const o=typeof r=="object"?r:i;(!o.transports||o.transports&&typeof o.transports[0]=="string")&&(o.transports=(o.transports||["polling","websocket","webtransport"]).map(h=>Dv[h]).filter(h=>!!h)),super(r,o)}};function Iv(e,r="",i){let o=e;i=i||typeof location<"u"&&location,e==null&&(e=i.protocol+"//"+i.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=i.protocol+e:e=i.host+e),/^(https?|wss?):\/\//.test(e)||(typeof i<"u"?e=i.protocol+"//"+e:e="https://"+e),o=fu(e)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const S=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+S+":"+o.port+r,o.href=o.protocol+"://"+S+(i&&i.port===o.port?"":":"+o.port),o}const Ov=typeof ArrayBuffer=="function",Hv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,p_=Object.prototype.toString,Fv=typeof Blob=="function"||typeof Blob<"u"&&p_.call(Blob)==="[object BlobConstructor]",jv=typeof File=="function"||typeof File<"u"&&p_.call(File)==="[object FileConstructor]";function $u(e){return Ov&&(e instanceof ArrayBuffer||Hv(e))||Fv&&e instanceof Blob||jv&&e instanceof File}function ha(e,r){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let i=0,o=e.length;i<o;i++)if(ha(e[i]))return!0;return!1}if($u(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ha(e.toJSON(),!0);for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&ha(e[i]))return!0;return!1}function zv(e){const r=[],i=e.data,o=e;return o.data=_u(i,r),o.attachments=r.length,{packet:o,buffers:r}}function _u(e,r){if(!e)return e;if($u(e)){const i={_placeholder:!0,num:r.length};return r.push(e),i}else if(Array.isArray(e)){const i=new Array(e.length);for(let o=0;o<e.length;o++)i[o]=_u(e[o],r);return i}else if(typeof e=="object"&&!(e instanceof Date)){const i={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=_u(e[o],r));return i}return e}function $v(e,r){return e.data=gu(e.data,r),delete e.attachments,e}function gu(e,r){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<r.length)return r[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i]=gu(e[i],r);else if(typeof e=="object")for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=gu(e[i],r));return e}const Wv=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ae;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ae||(Ae={}));class Uv{constructor(r){this.replacer=r}encode(r){return(r.type===Ae.EVENT||r.type===Ae.ACK)&&ha(r)?this.encodeAsBinary({type:r.type===Ae.EVENT?Ae.BINARY_EVENT:Ae.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Ae.BINARY_EVENT||r.type===Ae.BINARY_ACK)&&(i+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(i+=r.nsp+","),r.id!=null&&(i+=r.id),r.data!=null&&(i+=JSON.stringify(r.data,this.replacer)),i}encodeAsBinary(r){const i=zv(r),o=this.encodeAsString(i.packet),h=i.buffers;return h.unshift(o),h}}class Wu extends tt{constructor(r){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof r=="function"?{reviver:r}:r)}add(r){let i;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(r);const o=i.type===Ae.BINARY_EVENT;o||i.type===Ae.BINARY_ACK?(i.type=o?Ae.EVENT:Ae.ACK,this.reconstructor=new Vv(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if($u(r)||r.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(r),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let i=0;const o={type:Number(r.charAt(0))};if(Ae[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===Ae.BINARY_EVENT||o.type===Ae.BINARY_ACK){const S=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const y=r.substring(S,i);if(y!=Number(y)||r.charAt(i)!=="-")throw new Error("Illegal attachments");const a=Number(y);if(!qv(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=a}if(r.charAt(i+1)==="/"){const S=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););o.nsp=r.substring(S,i)}else o.nsp="/";const h=r.charAt(i+1);if(h!==""&&Number(h)==h){const S=i+1;for(;++i;){const y=r.charAt(i);if(y==null||Number(y)!=y){--i;break}if(i===r.length)break}o.id=Number(r.substring(S,i+1))}if(r.charAt(++i)){const S=this.tryParse(r.substr(i));if(Wu.isPayloadValid(o.type,S))o.data=S;else throw new Error("invalid payload")}return o}tryParse(r){try{return JSON.parse(r,this.opts.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Ae.CONNECT:return Vf(i);case Ae.DISCONNECT:return i===void 0;case Ae.CONNECT_ERROR:return typeof i=="string"||Vf(i);case Ae.EVENT:case Ae.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&Wv.indexOf(i[0])===-1);case Ae.ACK:case Ae.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Vv{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const i=$v(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const qv=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function Vf(e){return Object.prototype.toString.call(e)==="[object Object]"}const Kv=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Wu,Encoder:Uv,get PacketType(){return Ae}},Symbol.toStringTag,{value:"Module"}));function Gt(e,r,i){return e.on(r,i),function(){e.off(r,i)}}const Xv=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class __ extends tt{constructor(r,i,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=i,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[Gt(r,"open",this.onopen.bind(this)),Gt(r,"packet",this.onpacket.bind(this)),Gt(r,"error",this.onerror.bind(this)),Gt(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...i){var o,h,S;if(Xv.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(i.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const y={type:Ae.EVENT,data:i};if(y.options={},y.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const v=this.ids++,c=i.pop();this._registerAckCallback(v,c),y.id=v}const a=(h=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||h===void 0?void 0:h.writable,l=this.connected&&!(!((S=this.io.engine)===null||S===void 0)&&S._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(y),this.packet(y)):this.sendBuffer.push(y)),this.flags={},this}_registerAckCallback(r,i){var o;const h=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(h===void 0){this.acks[r]=i;return}const S=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===r&&this.sendBuffer.splice(a,1);i.call(this,new Error("operation has timed out"))},h),y=(...a)=>{this.io.clearTimeoutFn(S),i.apply(this,a)};y.withError=!0,this.acks[r]=y}emitWithAck(r,...i){return new Promise((o,h)=>{const S=(y,a)=>y?h(y):o(a);S.withError=!0,i.push(S),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((h,...S)=>(this._queue[0],h!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(h)):(this._queue.shift(),i&&i(null,...S)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!r||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:Ae.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(o=>String(o.id)===r)){const o=this.acks[r];delete this.acks[r],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ae.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ae.EVENT:case Ae.BINARY_EVENT:this.onevent(r);break;case Ae.ACK:case Ae.BINARY_ACK:this.onack(r);break;case Ae.DISCONNECT:this.ondisconnect();break;case Ae.CONNECT_ERROR:this.destroy();const o=new Error(r.data.message);o.data=r.data.data,this.emitReserved("connect_error",o);break}}onevent(r){const i=r.data||[];r.id!=null&&i.push(this.ack(r.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const o of i)o.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const i=this;let o=!1;return function(...h){o||(o=!0,i.packet({type:Ae.ACK,id:r,data:h}))}}onack(r){const i=this.acks[r.id];typeof i=="function"&&(delete this.acks[r.id],i.withError&&r.data.unshift(null),i.apply(this,r.data))}onconnect(r,i){this.id=r,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ae.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const i=this._anyListeners;for(let o=0;o<i.length;o++)if(r===i[o])return i.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const i=this._anyOutgoingListeners;for(let o=0;o<i.length;o++)if(r===i[o])return i.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const o of i)o.apply(this,r.data)}}}function mi(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}mi.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*e);e=(Math.floor(r*10)&1)==0?e-i:e+i}return Math.min(e,this.max)|0};mi.prototype.reset=function(){this.attempts=0};mi.prototype.setMin=function(e){this.ms=e};mi.prototype.setMax=function(e){this.max=e};mi.prototype.setJitter=function(e){this.jitter=e};class mu extends tt{constructor(r,i){var o;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(i=r,r=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Na(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((o=i.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new mi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const h=i.parser||Kv;this.encoder=new h.Encoder,this.decoder=new h.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var i;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(i=this.backoff)===null||i===void 0||i.setMin(r),this)}randomizationFactor(r){var i;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(i=this.backoff)===null||i===void 0||i.setJitter(r),this)}reconnectionDelayMax(r){var i;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(i=this.backoff)===null||i===void 0||i.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new Bv(this.uri,this.opts);const i=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const h=Gt(i,"open",function(){o.onopen(),r&&r()}),S=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),r?r(a):this.maybeReconnectOnOpen()},y=Gt(i,"error",S);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{h(),S(new Error("timeout")),i.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(h),this.subs.push(y),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(Gt(r,"ping",this.onping.bind(this)),Gt(r,"data",this.ondata.bind(this)),Gt(r,"error",this.onerror.bind(this)),Gt(r,"close",this.onclose.bind(this)),Gt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(i){this.onclose("parse error",i)}}ondecoded(r){Pa(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let o=this.nsps[r];return o?this._autoConnect&&!o.active&&o.connect():(o=new __(this,r,i),this.nsps[r]=o),o}_destroy(r){const i=Object.keys(this.nsps);for(const o of i)if(this.nsps[o].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let o=0;o<i.length;o++)this.engine.write(i[o],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,i){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(h=>{h?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",h)):r.onreconnect()}))},i);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const cs={};function da(e,r){typeof e=="object"&&(r=e,e=void 0),r=r||{};const i=Iv(e,r.path||"/socket.io"),o=i.source,h=i.id,S=i.path,y=cs[h]&&S in cs[h].nsps,a=r.forceNew||r["force new connection"]||r.multiplex===!1||y;let l;return a?l=new mu(o,r):(cs[h]||(cs[h]=new mu(o,r)),l=cs[h]),i.query&&!r.query&&(r.query=i.queryKey),l.socket(i.path,r)}Object.assign(da,{Manager:mu,Socket:__,io:da,connect:da});function g_(){return new URLSearchParams(window.location.search).get("token")||""}function Jr(e,r){const i=g_(),o=e.includes("?")?"&":"?";return fetch(i?`${e}${o}token=${encodeURIComponent(i)}`:e,r)}function Yv(){const e=J.useRef(null),[r,i]=J.useState([]),[o,h]=J.useState([]),[S,y]=J.useState([]),[a,l]=J.useState(""),[_,v]=J.useState([]);return J.useEffect(()=>{const c=g_(),m=da(window.location.origin,{path:"/socket.io",auth:c?{token:c}:void 0,query:c?{token:c}:void 0});return e.current=m,m.on("agents:updated",C=>{Array.isArray(C)&&i(C)}),m.on("messages:new",C=>{h(b=>[C,...b])}),m.on("messages:all",C=>{Array.isArray(C)&&h(C)}),m.on("context:updated",C=>{y(b=>{const x=b.findIndex(f=>f.key===C.key);if(x>=0){const f=[...b];return f[x]=C,f}return[...b,C]})}),m.on("context:removed",({key:C})=>{y(b=>b.filter(x=>x.key!==C))}),m.on("crewmd:updated",C=>{typeof C=="string"&&l(C)}),m.on("agent:cost",C=>{i(b=>b.map(x=>x.id===C.id?{...x,total_cost:C.total_cost,total_tokens:C.total_tokens}:x))}),m.on("file:changed",C=>{v(b=>[C,...b].slice(0,500))}),m.on("file:changes:cleared",()=>{v([])}),Jr("/api/file-changes").then(C=>C.json()).then(C=>{Array.isArray(C)&&v(C)}).catch(()=>{}),Jr("/api/context").then(C=>C.json()).then(C=>{Array.isArray(C)&&y(C)}).catch(()=>{}),()=>{m.disconnect()}},[]),{socket:e,agents:r,messages:o,contextEntries:S,crewMd:a,setCrewMd:l,fileChanges:_,setFileChanges:v}}const Gv={running:"var(--green)",starting:"var(--yellow)",idle:"var(--yellow)",done:"var(--text-muted)",dead:"var(--red)"};function Qv({agents:e,selectedId:r,onSelect:i,onKill:o,onRemove:h,onRollback:S,onRestart:y}){return O.jsxs("div",{className:"agent-list",children:[O.jsxs("div",{className:"agent-list-header",children:["Agents (",e.length,")"]}),e.length===0&&O.jsx("div",{className:"agent-list-empty",children:"No agents running"}),e.map(a=>O.jsxs("div",{className:`agent-item ${a.id===r?"selected":""}`,onClick:()=>i(a),children:[O.jsxs("div",{className:"agent-item-header",children:[O.jsx("span",{className:"status-dot",style:{background:Gv[a.status]||"var(--text-muted)"}}),O.jsx("span",{className:"agent-name",children:a.name}),O.jsx("span",{className:`agent-service-badge service-${a.service||"claude"}`,children:a.service||"claude"}),a.total_cost>0&&O.jsxs("span",{className:"agent-cost",children:["$",a.total_cost.toFixed(4)]}),O.jsx("span",{className:"agent-status",children:a.status})]}),O.jsx("div",{className:"agent-task",children:a.task}),(a.status==="running"||a.status==="starting")&&O.jsx("div",{className:"agent-running-actions",children:O.jsx("button",{className:"stop-btn",onClick:l=>{l.stopPropagation(),o(a.id)},children:"Stop"})}),(a.status==="done"||a.status==="dead")&&O.jsxs("div",{className:"agent-done-actions",children:[O.jsx("button",{className:"restart-btn",onClick:l=>{l.stopPropagation(),y(a)},children:"Restart"}),a.checkpoint_hash&&O.jsx("button",{className:"rollback-btn",onClick:l=>{l.stopPropagation(),confirm(`Rollback all changes made by "${a.name}"? This will reset files to the state before the agent started.`)&&S(a.id)},children:"Rollback"}),O.jsx("button",{className:"remove-btn",onClick:l=>{l.stopPropagation(),h(a.id)},children:"Remove"})]})]},a.id))]})}function rt(e){if(typeof e=="string"||typeof e=="number")return""+e;let r="";if(Array.isArray(e))for(let i=0,o;i<e.length;i++)(o=rt(e[i]))!==""&&(r+=(r&&" ")+o);else for(let i in e)e[i]&&(r+=(r&&" ")+i);return r}var Jv={value:()=>{}};function Ba(){for(var e=0,r=arguments.length,i={},o;e<r;++e){if(!(o=arguments[e]+"")||o in i||/[\s.]/.test(o))throw new Error("illegal type: "+o);i[o]=[]}return new fa(i)}function fa(e){this._=e}function Zv(e,r){return e.trim().split(/^|\s+/).map(function(i){var o="",h=i.indexOf(".");if(h>=0&&(o=i.slice(h+1),i=i.slice(0,h)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:o}})}fa.prototype=Ba.prototype={constructor:fa,on:function(e,r){var i=this._,o=Zv(e+"",i),h,S=-1,y=o.length;if(arguments.length<2){for(;++S<y;)if((h=(e=o[S]).type)&&(h=ey(i[h],e.name)))return h;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++S<y;)if(h=(e=o[S]).type)i[h]=qf(i[h],e.name,r);else if(r==null)for(h in i)i[h]=qf(i[h],e.name,null);return this},copy:function(){var e={},r=this._;for(var i in r)e[i]=r[i].slice();return new fa(e)},call:function(e,r){if((h=arguments.length-2)>0)for(var i=new Array(h),o=0,h,S;o<h;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(S=this._[e],o=0,h=S.length;o<h;++o)S[o].value.apply(r,i)},apply:function(e,r,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],h=0,S=o.length;h<S;++h)o[h].value.apply(r,i)}};function ey(e,r){for(var i=0,o=e.length,h;i<o;++i)if((h=e[i]).name===r)return h.value}function qf(e,r,i){for(var o=0,h=e.length;o<h;++o)if(e[o].name===r){e[o]=Jv,e=e.slice(0,o).concat(e.slice(o+1));break}return i!=null&&e.push({name:r,value:i}),e}var vu="http://www.w3.org/1999/xhtml";const Kf={svg:"http://www.w3.org/2000/svg",xhtml:vu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ia(e){var r=e+="",i=r.indexOf(":");return i>=0&&(r=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Kf.hasOwnProperty(r)?{space:Kf[r],local:e}:e}function ty(e){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===vu&&r.documentElement.namespaceURI===vu?r.createElement(e):r.createElementNS(i,e)}}function ry(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function m_(e){var r=Ia(e);return(r.local?ry:ty)(r)}function ny(){}function Uu(e){return e==null?ny:function(){return this.querySelector(e)}}function iy(e){typeof e!="function"&&(e=Uu(e));for(var r=this._groups,i=r.length,o=new Array(i),h=0;h<i;++h)for(var S=r[h],y=S.length,a=o[h]=new Array(y),l,_,v=0;v<y;++v)(l=S[v])&&(_=e.call(l,l.__data__,v,S))&&("__data__"in l&&(_.__data__=l.__data__),a[v]=_);return new Bt(o,this._parents)}function sy(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function oy(){return[]}function v_(e){return e==null?oy:function(){return this.querySelectorAll(e)}}function ay(e){return function(){return sy(e.apply(this,arguments))}}function ly(e){typeof e=="function"?e=ay(e):e=v_(e);for(var r=this._groups,i=r.length,o=[],h=[],S=0;S<i;++S)for(var y=r[S],a=y.length,l,_=0;_<a;++_)(l=y[_])&&(o.push(e.call(l,l.__data__,_,y)),h.push(l));return new Bt(o,h)}function y_(e){return function(){return this.matches(e)}}function w_(e){return function(r){return r.matches(e)}}var cy=Array.prototype.find;function uy(e){return function(){return cy.call(this.children,e)}}function hy(){return this.firstElementChild}function dy(e){return this.select(e==null?hy:uy(typeof e=="function"?e:w_(e)))}var fy=Array.prototype.filter;function py(){return Array.from(this.children)}function _y(e){return function(){return fy.call(this.children,e)}}function gy(e){return this.selectAll(e==null?py:_y(typeof e=="function"?e:w_(e)))}function my(e){typeof e!="function"&&(e=y_(e));for(var r=this._groups,i=r.length,o=new Array(i),h=0;h<i;++h)for(var S=r[h],y=S.length,a=o[h]=[],l,_=0;_<y;++_)(l=S[_])&&e.call(l,l.__data__,_,S)&&a.push(l);return new Bt(o,this._parents)}function S_(e){return new Array(e.length)}function vy(){return new Bt(this._enter||this._groups.map(S_),this._parents)}function wa(e,r){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=r}wa.prototype={constructor:wa,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,r){return this._parent.insertBefore(e,r)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function yy(e){return function(){return e}}function wy(e,r,i,o,h,S){for(var y=0,a,l=r.length,_=S.length;y<_;++y)(a=r[y])?(a.__data__=S[y],o[y]=a):i[y]=new wa(e,S[y]);for(;y<l;++y)(a=r[y])&&(h[y]=a)}function Sy(e,r,i,o,h,S,y){var a,l,_=new Map,v=r.length,c=S.length,m=new Array(v),C;for(a=0;a<v;++a)(l=r[a])&&(m[a]=C=y.call(l,l.__data__,a,r)+"",_.has(C)?h[a]=l:_.set(C,l));for(a=0;a<c;++a)C=y.call(e,S[a],a,S)+"",(l=_.get(C))?(o[a]=l,l.__data__=S[a],_.delete(C)):i[a]=new wa(e,S[a]);for(a=0;a<v;++a)(l=r[a])&&_.get(m[a])===l&&(h[a]=l)}function Cy(e){return e.__data__}function xy(e,r){if(!arguments.length)return Array.from(this,Cy);var i=r?Sy:wy,o=this._parents,h=this._groups;typeof e!="function"&&(e=yy(e));for(var S=h.length,y=new Array(S),a=new Array(S),l=new Array(S),_=0;_<S;++_){var v=o[_],c=h[_],m=c.length,C=by(e.call(v,v&&v.__data__,_,o)),b=C.length,x=a[_]=new Array(b),f=y[_]=new Array(b),p=l[_]=new Array(m);i(v,c,x,f,p,C,r);for(var d=0,u=0,w,L;d<b;++d)if(w=x[d]){for(d>=u&&(u=d+1);!(L=f[u])&&++u<b;);w._next=L||null}}return y=new Bt(y,o),y._enter=a,y._exit=l,y}function by(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ey(){return new Bt(this._exit||this._groups.map(S_),this._parents)}function ky(e,r,i){var o=this.enter(),h=this,S=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),r!=null&&(h=r(h),h&&(h=h.selection())),i==null?S.remove():i(S),o&&h?o.merge(h).order():h}function Ly(e){for(var r=e.selection?e.selection():e,i=this._groups,o=r._groups,h=i.length,S=o.length,y=Math.min(h,S),a=new Array(h),l=0;l<y;++l)for(var _=i[l],v=o[l],c=_.length,m=a[l]=new Array(c),C,b=0;b<c;++b)(C=_[b]||v[b])&&(m[b]=C);for(;l<h;++l)a[l]=i[l];return new Bt(a,this._parents)}function Ry(){for(var e=this._groups,r=-1,i=e.length;++r<i;)for(var o=e[r],h=o.length-1,S=o[h],y;--h>=0;)(y=o[h])&&(S&&y.compareDocumentPosition(S)^4&&S.parentNode.insertBefore(y,S),S=y);return this}function Dy(e){e||(e=Ay);function r(c,m){return c&&m?e(c.__data__,m.__data__):!c-!m}for(var i=this._groups,o=i.length,h=new Array(o),S=0;S<o;++S){for(var y=i[S],a=y.length,l=h[S]=new Array(a),_,v=0;v<a;++v)(_=y[v])&&(l[v]=_);l.sort(r)}return new Bt(h,this._parents).order()}function Ay(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function Ty(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function My(){return Array.from(this)}function Py(){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var o=e[r],h=0,S=o.length;h<S;++h){var y=o[h];if(y)return y}return null}function Ny(){let e=0;for(const r of this)++e;return e}function By(){return!this.node()}function Iy(e){for(var r=this._groups,i=0,o=r.length;i<o;++i)for(var h=r[i],S=0,y=h.length,a;S<y;++S)(a=h[S])&&e.call(a,a.__data__,S,h);return this}function Oy(e){return function(){this.removeAttribute(e)}}function Hy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Fy(e,r){return function(){this.setAttribute(e,r)}}function jy(e,r){return function(){this.setAttributeNS(e.space,e.local,r)}}function zy(e,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function $y(e,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function Wy(e,r){var i=Ia(e);if(arguments.length<2){var o=this.node();return i.local?o.getAttributeNS(i.space,i.local):o.getAttribute(i)}return this.each((r==null?i.local?Hy:Oy:typeof r=="function"?i.local?$y:zy:i.local?jy:Fy)(i,r))}function C_(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Uy(e){return function(){this.style.removeProperty(e)}}function Vy(e,r,i){return function(){this.style.setProperty(e,r,i)}}function qy(e,r,i){return function(){var o=r.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,i)}}function Ky(e,r,i){return arguments.length>1?this.each((r==null?Uy:typeof r=="function"?qy:Vy)(e,r,i??"")):ci(this.node(),e)}function ci(e,r){return e.style.getPropertyValue(r)||C_(e).getComputedStyle(e,null).getPropertyValue(r)}function Xy(e){return function(){delete this[e]}}function Yy(e,r){return function(){this[e]=r}}function Gy(e,r){return function(){var i=r.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function Qy(e,r){return arguments.length>1?this.each((r==null?Xy:typeof r=="function"?Gy:Yy)(e,r)):this.node()[e]}function x_(e){return e.trim().split(/^|\s+/)}function Vu(e){return e.classList||new b_(e)}function b_(e){this._node=e,this._names=x_(e.getAttribute("class")||"")}b_.prototype={add:function(e){var r=this._names.indexOf(e);r<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var r=this._names.indexOf(e);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function E_(e,r){for(var i=Vu(e),o=-1,h=r.length;++o<h;)i.add(r[o])}function k_(e,r){for(var i=Vu(e),o=-1,h=r.length;++o<h;)i.remove(r[o])}function Jy(e){return function(){E_(this,e)}}function Zy(e){return function(){k_(this,e)}}function e1(e,r){return function(){(r.apply(this,arguments)?E_:k_)(this,e)}}function t1(e,r){var i=x_(e+"");if(arguments.length<2){for(var o=Vu(this.node()),h=-1,S=i.length;++h<S;)if(!o.contains(i[h]))return!1;return!0}return this.each((typeof r=="function"?e1:r?Jy:Zy)(i,r))}function r1(){this.textContent=""}function n1(e){return function(){this.textContent=e}}function i1(e){return function(){var r=e.apply(this,arguments);this.textContent=r??""}}function s1(e){return arguments.length?this.each(e==null?r1:(typeof e=="function"?i1:n1)(e)):this.node().textContent}function o1(){this.innerHTML=""}function a1(e){return function(){this.innerHTML=e}}function l1(e){return function(){var r=e.apply(this,arguments);this.innerHTML=r??""}}function c1(e){return arguments.length?this.each(e==null?o1:(typeof e=="function"?l1:a1)(e)):this.node().innerHTML}function u1(){this.nextSibling&&this.parentNode.appendChild(this)}function h1(){return this.each(u1)}function d1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function f1(){return this.each(d1)}function p1(e){var r=typeof e=="function"?e:m_(e);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function _1(){return null}function g1(e,r){var i=typeof e=="function"?e:m_(e),o=r==null?_1:typeof r=="function"?r:Uu(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),o.apply(this,arguments)||null)})}function m1(){var e=this.parentNode;e&&e.removeChild(this)}function v1(){return this.each(m1)}function y1(){var e=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function w1(){var e=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function S1(e){return this.select(e?w1:y1)}function C1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function x1(e){return function(r){e.call(this,r,this.__data__)}}function b1(e){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");return o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),{type:r,name:i}})}function E1(e){return function(){var r=this.__on;if(r){for(var i=0,o=-1,h=r.length,S;i<h;++i)S=r[i],(!e.type||S.type===e.type)&&S.name===e.name?this.removeEventListener(S.type,S.listener,S.options):r[++o]=S;++o?r.length=o:delete this.__on}}}function k1(e,r,i){return function(){var o=this.__on,h,S=x1(r);if(o){for(var y=0,a=o.length;y<a;++y)if((h=o[y]).type===e.type&&h.name===e.name){this.removeEventListener(h.type,h.listener,h.options),this.addEventListener(h.type,h.listener=S,h.options=i),h.value=r;return}}this.addEventListener(e.type,S,i),h={type:e.type,name:e.name,value:r,listener:S,options:i},o?o.push(h):this.__on=[h]}}function L1(e,r,i){var o=b1(e+""),h,S=o.length,y;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,_=a.length,v;l<_;++l)for(h=0,v=a[l];h<S;++h)if((y=o[h]).type===v.type&&y.name===v.name)return v.value}return}for(a=r?k1:E1,h=0;h<S;++h)this.each(a(o[h],r,i));return this}function L_(e,r,i){var o=C_(e),h=o.CustomEvent;typeof h=="function"?h=new h(r,i):(h=o.document.createEvent("Event"),i?(h.initEvent(r,i.bubbles,i.cancelable),h.detail=i.detail):h.initEvent(r,!1,!1)),e.dispatchEvent(h)}function R1(e,r){return function(){return L_(this,e,r)}}function D1(e,r){return function(){return L_(this,e,r.apply(this,arguments))}}function A1(e,r){return this.each((typeof r=="function"?D1:R1)(e,r))}function*T1(){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var o=e[r],h=0,S=o.length,y;h<S;++h)(y=o[h])&&(yield y)}var R_=[null];function Bt(e,r){this._groups=e,this._parents=r}function Ls(){return new Bt([[document.documentElement]],R_)}function M1(){return this}Bt.prototype=Ls.prototype={constructor:Bt,select:iy,selectAll:ly,selectChild:dy,selectChildren:gy,filter:my,data:xy,enter:vy,exit:Ey,join:ky,merge:Ly,selection:M1,order:Ry,sort:Dy,call:Ty,nodes:My,node:Py,size:Ny,empty:By,each:Iy,attr:Wy,style:Ky,property:Qy,classed:t1,text:s1,html:c1,raise:h1,lower:f1,append:p1,insert:g1,remove:v1,clone:S1,datum:C1,on:L1,dispatch:A1,[Symbol.iterator]:T1};function Nt(e){return typeof e=="string"?new Bt([[document.querySelector(e)]],[document.documentElement]):new Bt([[e]],R_)}function P1(e){let r;for(;r=e.sourceEvent;)e=r;return e}function Qt(e,r){if(e=P1(e),r===void 0&&(r=e.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var o=i.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(r.getScreenCTM().inverse()),[o.x,o.y]}if(r.getBoundingClientRect){var h=r.getBoundingClientRect();return[e.clientX-h.left-r.clientLeft,e.clientY-h.top-r.clientTop]}}return[e.pageX,e.pageY]}const N1={passive:!1},ms={capture:!0,passive:!1};function qc(e){e.stopImmediatePropagation()}function ai(e){e.preventDefault(),e.stopImmediatePropagation()}function D_(e){var r=e.document.documentElement,i=Nt(e).on("dragstart.drag",ai,ms);"onselectstart"in r?i.on("selectstart.drag",ai,ms):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function A_(e,r){var i=e.document.documentElement,o=Nt(e).on("dragstart.drag",null);r&&(o.on("click.drag",ai,ms),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in i?o.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Zo=e=>()=>e;function yu(e,{sourceEvent:r,subject:i,target:o,identifier:h,active:S,x:y,y:a,dx:l,dy:_,dispatch:v}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:h,enumerable:!0,configurable:!0},active:{value:S,enumerable:!0,configurable:!0},x:{value:y,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:v}})}yu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function B1(e){return!e.ctrlKey&&!e.button}function I1(){return this.parentNode}function O1(e,r){return r??{x:e.x,y:e.y}}function H1(){return navigator.maxTouchPoints||"ontouchstart"in this}function T_(){var e=B1,r=I1,i=O1,o=H1,h={},S=Ba("start","drag","end"),y=0,a,l,_,v,c=0;function m(w){w.on("mousedown.drag",C).filter(o).on("touchstart.drag",f).on("touchmove.drag",p,N1).on("touchend.drag touchcancel.drag",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(w,L){if(!(v||!e.call(this,w,L))){var R=u(this,r.call(this,w,L),w,L,"mouse");R&&(Nt(w.view).on("mousemove.drag",b,ms).on("mouseup.drag",x,ms),D_(w.view),qc(w),_=!1,a=w.clientX,l=w.clientY,R("start",w))}}function b(w){if(ai(w),!_){var L=w.clientX-a,R=w.clientY-l;_=L*L+R*R>c}h.mouse("drag",w)}function x(w){Nt(w.view).on("mousemove.drag mouseup.drag",null),A_(w.view,_),ai(w),h.mouse("end",w)}function f(w,L){if(e.call(this,w,L)){var R=w.changedTouches,D=r.call(this,w,L),k=R.length,M,W;for(M=0;M<k;++M)(W=u(this,D,w,L,R[M].identifier,R[M]))&&(qc(w),W("start",w,R[M]))}}function p(w){var L=w.changedTouches,R=L.length,D,k;for(D=0;D<R;++D)(k=h[L[D].identifier])&&(ai(w),k("drag",w,L[D]))}function d(w){var L=w.changedTouches,R=L.length,D,k;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),D=0;D<R;++D)(k=h[L[D].identifier])&&(qc(w),k("end",w,L[D]))}function u(w,L,R,D,k,M){var W=S.copy(),z=Qt(M||R,L),j,N,I;if((I=i.call(w,new yu("beforestart",{sourceEvent:R,target:m,identifier:k,active:y,x:z[0],y:z[1],dx:0,dy:0,dispatch:W}),D))!=null)return j=I.x-z[0]||0,N=I.y-z[1]||0,function q(U,K,V){var T=z,B;switch(U){case"start":h[k]=q,B=y++;break;case"end":delete h[k],--y;case"drag":z=Qt(V||K,L),B=y;break}W.call(U,w,new yu(U,{sourceEvent:K,subject:I,target:m,identifier:k,active:B,x:z[0]+j,y:z[1]+N,dx:z[0]-T[0],dy:z[1]-T[1],dispatch:W}),D)}}return m.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Zo(!!w),m):e},m.container=function(w){return arguments.length?(r=typeof w=="function"?w:Zo(w),m):r},m.subject=function(w){return arguments.length?(i=typeof w=="function"?w:Zo(w),m):i},m.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:Zo(!!w),m):o},m.on=function(){var w=S.on.apply(S,arguments);return w===S?m:w},m.clickDistance=function(w){return arguments.length?(c=(w=+w)*w,m):Math.sqrt(c)},m}function qu(e,r,i){e.prototype=r.prototype=i,i.constructor=e}function M_(e,r){var i=Object.create(e.prototype);for(var o in r)i[o]=r[o];return i}function Rs(){}var vs=.7,Sa=1/vs,li="\\s*([+-]?\\d+)\\s*",ys="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ur="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",F1=/^#([0-9a-f]{3,8})$/,j1=new RegExp(`^rgb\\(${li},${li},${li}\\)$`),z1=new RegExp(`^rgb\\(${ur},${ur},${ur}\\)$`),$1=new RegExp(`^rgba\\(${li},${li},${li},${ys}\\)$`),W1=new RegExp(`^rgba\\(${ur},${ur},${ur},${ys}\\)$`),U1=new RegExp(`^hsl\\(${ys},${ur},${ur}\\)$`),V1=new RegExp(`^hsla\\(${ys},${ur},${ur},${ys}\\)$`),Xf={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};qu(Rs,bn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Yf,formatHex:Yf,formatHex8:q1,formatHsl:K1,formatRgb:Gf,toString:Gf});function Yf(){return this.rgb().formatHex()}function q1(){return this.rgb().formatHex8()}function K1(){return P_(this).formatHsl()}function Gf(){return this.rgb().formatRgb()}function bn(e){var r,i;return e=(e+"").trim().toLowerCase(),(r=F1.exec(e))?(i=r[1].length,r=parseInt(r[1],16),i===6?Qf(r):i===3?new Lt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?ea(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?ea(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=j1.exec(e))?new Lt(r[1],r[2],r[3],1):(r=z1.exec(e))?new Lt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=$1.exec(e))?ea(r[1],r[2],r[3],r[4]):(r=W1.exec(e))?ea(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=U1.exec(e))?ep(r[1],r[2]/100,r[3]/100,1):(r=V1.exec(e))?ep(r[1],r[2]/100,r[3]/100,r[4]):Xf.hasOwnProperty(e)?Qf(Xf[e]):e==="transparent"?new Lt(NaN,NaN,NaN,0):null}function Qf(e){return new Lt(e>>16&255,e>>8&255,e&255,1)}function ea(e,r,i,o){return o<=0&&(e=r=i=NaN),new Lt(e,r,i,o)}function X1(e){return e instanceof Rs||(e=bn(e)),e?(e=e.rgb(),new Lt(e.r,e.g,e.b,e.opacity)):new Lt}function wu(e,r,i,o){return arguments.length===1?X1(e):new Lt(e,r,i,o??1)}function Lt(e,r,i,o){this.r=+e,this.g=+r,this.b=+i,this.opacity=+o}qu(Lt,wu,M_(Rs,{brighter(e){return e=e==null?Sa:Math.pow(Sa,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vs:Math.pow(vs,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lt(Cn(this.r),Cn(this.g),Cn(this.b),Ca(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:Jf,formatHex:Jf,formatHex8:Y1,formatRgb:Zf,toString:Zf}));function Jf(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}`}function Y1(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}${Sn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Zf(){const e=Ca(this.opacity);return`${e===1?"rgb(":"rgba("}${Cn(this.r)}, ${Cn(this.g)}, ${Cn(this.b)}${e===1?")":`, ${e})`}`}function Ca(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Cn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sn(e){return e=Cn(e),(e<16?"0":"")+e.toString(16)}function ep(e,r,i,o){return o<=0?e=r=i=NaN:i<=0||i>=1?e=r=NaN:r<=0&&(e=NaN),new Jt(e,r,i,o)}function P_(e){if(e instanceof Jt)return new Jt(e.h,e.s,e.l,e.opacity);if(e instanceof Rs||(e=bn(e)),!e)return new Jt;if(e instanceof Jt)return e;e=e.rgb();var r=e.r/255,i=e.g/255,o=e.b/255,h=Math.min(r,i,o),S=Math.max(r,i,o),y=NaN,a=S-h,l=(S+h)/2;return a?(r===S?y=(i-o)/a+(i<o)*6:i===S?y=(o-r)/a+2:y=(r-i)/a+4,a/=l<.5?S+h:2-S-h,y*=60):a=l>0&&l<1?0:y,new Jt(y,a,l,e.opacity)}function G1(e,r,i,o){return arguments.length===1?P_(e):new Jt(e,r,i,o??1)}function Jt(e,r,i,o){this.h=+e,this.s=+r,this.l=+i,this.opacity=+o}qu(Jt,G1,M_(Rs,{brighter(e){return e=e==null?Sa:Math.pow(Sa,e),new Jt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vs:Math.pow(vs,e),new Jt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,o=i+(i<.5?i:1-i)*r,h=2*i-o;return new Lt(Kc(e>=240?e-240:e+120,h,o),Kc(e,h,o),Kc(e<120?e+240:e-120,h,o),this.opacity)},clamp(){return new Jt(tp(this.h),ta(this.s),ta(this.l),Ca(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ca(this.opacity);return`${e===1?"hsl(":"hsla("}${tp(this.h)}, ${ta(this.s)*100}%, ${ta(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tp(e){return e=(e||0)%360,e<0?e+360:e}function ta(e){return Math.max(0,Math.min(1,e||0))}function Kc(e,r,i){return(e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r)*255}const Ku=e=>()=>e;function Q1(e,r){return function(i){return e+i*r}}function J1(e,r,i){return e=Math.pow(e,i),r=Math.pow(r,i)-e,i=1/i,function(o){return Math.pow(e+o*r,i)}}function Z1(e){return(e=+e)==1?N_:function(r,i){return i-r?J1(r,i,e):Ku(isNaN(r)?i:r)}}function N_(e,r){var i=r-e;return i?Q1(e,i):Ku(isNaN(e)?r:e)}const xa=(function e(r){var i=Z1(r);function o(h,S){var y=i((h=wu(h)).r,(S=wu(S)).r),a=i(h.g,S.g),l=i(h.b,S.b),_=N_(h.opacity,S.opacity);return function(v){return h.r=y(v),h.g=a(v),h.b=l(v),h.opacity=_(v),h+""}}return o.gamma=e,o})(1);function ew(e,r){r||(r=[]);var i=e?Math.min(r.length,e.length):0,o=r.slice(),h;return function(S){for(h=0;h<i;++h)o[h]=e[h]*(1-S)+r[h]*S;return o}}function tw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rw(e,r){var i=r?r.length:0,o=e?Math.min(i,e.length):0,h=new Array(o),S=new Array(i),y;for(y=0;y<o;++y)h[y]=_s(e[y],r[y]);for(;y<i;++y)S[y]=r[y];return function(a){for(y=0;y<o;++y)S[y]=h[y](a);return S}}function nw(e,r){var i=new Date;return e=+e,r=+r,function(o){return i.setTime(e*(1-o)+r*o),i}}function lr(e,r){return e=+e,r=+r,function(i){return e*(1-i)+r*i}}function iw(e,r){var i={},o={},h;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(h in r)h in e?i[h]=_s(e[h],r[h]):o[h]=r[h];return function(S){for(h in i)o[h]=i[h](S);return o}}var Su=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xc=new RegExp(Su.source,"g");function sw(e){return function(){return e}}function ow(e){return function(r){return e(r)+""}}function B_(e,r){var i=Su.lastIndex=Xc.lastIndex=0,o,h,S,y=-1,a=[],l=[];for(e=e+"",r=r+"";(o=Su.exec(e))&&(h=Xc.exec(r));)(S=h.index)>i&&(S=r.slice(i,S),a[y]?a[y]+=S:a[++y]=S),(o=o[0])===(h=h[0])?a[y]?a[y]+=h:a[++y]=h:(a[++y]=null,l.push({i:y,x:lr(o,h)})),i=Xc.lastIndex;return i<r.length&&(S=r.slice(i),a[y]?a[y]+=S:a[++y]=S),a.length<2?l[0]?ow(l[0].x):sw(r):(r=l.length,function(_){for(var v=0,c;v<r;++v)a[(c=l[v]).i]=c.x(_);return a.join("")})}function _s(e,r){var i=typeof r,o;return r==null||i==="boolean"?Ku(r):(i==="number"?lr:i==="string"?(o=bn(r))?(r=o,xa):B_:r instanceof bn?xa:r instanceof Date?nw:tw(r)?ew:Array.isArray(r)?rw:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?iw:lr)(e,r)}var rp=180/Math.PI,Cu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function I_(e,r,i,o,h,S){var y,a,l;return(y=Math.sqrt(e*e+r*r))&&(e/=y,r/=y),(l=e*i+r*o)&&(i-=e*l,o-=r*l),(a=Math.sqrt(i*i+o*o))&&(i/=a,o/=a,l/=a),e*o<r*i&&(e=-e,r=-r,l=-l,y=-y),{translateX:h,translateY:S,rotate:Math.atan2(r,e)*rp,skewX:Math.atan(l)*rp,scaleX:y,scaleY:a}}var ra;function aw(e){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?Cu:I_(r.a,r.b,r.c,r.d,r.e,r.f)}function lw(e){return e==null||(ra||(ra=document.createElementNS("http://www.w3.org/2000/svg","g")),ra.setAttribute("transform",e),!(e=ra.transform.baseVal.consolidate()))?Cu:(e=e.matrix,I_(e.a,e.b,e.c,e.d,e.e,e.f))}function O_(e,r,i,o){function h(_){return _.length?_.pop()+" ":""}function S(_,v,c,m,C,b){if(_!==c||v!==m){var x=C.push("translate(",null,r,null,i);b.push({i:x-4,x:lr(_,c)},{i:x-2,x:lr(v,m)})}else(c||m)&&C.push("translate("+c+r+m+i)}function y(_,v,c,m){_!==v?(_-v>180?v+=360:v-_>180&&(_+=360),m.push({i:c.push(h(c)+"rotate(",null,o)-2,x:lr(_,v)})):v&&c.push(h(c)+"rotate("+v+o)}function a(_,v,c,m){_!==v?m.push({i:c.push(h(c)+"skewX(",null,o)-2,x:lr(_,v)}):v&&c.push(h(c)+"skewX("+v+o)}function l(_,v,c,m,C,b){if(_!==c||v!==m){var x=C.push(h(C)+"scale(",null,",",null,")");b.push({i:x-4,x:lr(_,c)},{i:x-2,x:lr(v,m)})}else(c!==1||m!==1)&&C.push(h(C)+"scale("+c+","+m+")")}return function(_,v){var c=[],m=[];return _=e(_),v=e(v),S(_.translateX,_.translateY,v.translateX,v.translateY,c,m),y(_.rotate,v.rotate,c,m),a(_.skewX,v.skewX,c,m),l(_.scaleX,_.scaleY,v.scaleX,v.scaleY,c,m),_=v=null,function(C){for(var b=-1,x=m.length,f;++b<x;)c[(f=m[b]).i]=f.x(C);return c.join("")}}}var cw=O_(aw,"px, ","px)","deg)"),uw=O_(lw,", ",")",")"),hw=1e-12;function np(e){return((e=Math.exp(e))+1/e)/2}function dw(e){return((e=Math.exp(e))-1/e)/2}function fw(e){return((e=Math.exp(2*e))-1)/(e+1)}const pa=(function e(r,i,o){function h(S,y){var a=S[0],l=S[1],_=S[2],v=y[0],c=y[1],m=y[2],C=v-a,b=c-l,x=C*C+b*b,f,p;if(x<hw)p=Math.log(m/_)/r,f=function(D){return[a+D*C,l+D*b,_*Math.exp(r*D*p)]};else{var d=Math.sqrt(x),u=(m*m-_*_+o*x)/(2*_*i*d),w=(m*m-_*_-o*x)/(2*m*i*d),L=Math.log(Math.sqrt(u*u+1)-u),R=Math.log(Math.sqrt(w*w+1)-w);p=(R-L)/r,f=function(D){var k=D*p,M=np(L),W=_/(i*d)*(M*fw(r*k+L)-dw(L));return[a+W*C,l+W*b,_*M/np(r*k+L)]}}return f.duration=p*1e3*r/Math.SQRT2,f}return h.rho=function(S){var y=Math.max(.001,+S),a=y*y,l=a*a;return e(y,a,l)},h})(Math.SQRT2,2,4);var ui=0,fs=0,us=0,H_=1e3,ba,ps,Ea=0,En=0,Oa=0,ws=typeof performance=="object"&&performance.now?performance:Date,F_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Xu(){return En||(F_(pw),En=ws.now()+Oa)}function pw(){En=0}function ka(){this._call=this._time=this._next=null}ka.prototype=j_.prototype={constructor:ka,restart:function(e,r,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Xu():+i)+(r==null?0:+r),!this._next&&ps!==this&&(ps?ps._next=this:ba=this,ps=this),this._call=e,this._time=i,xu()},stop:function(){this._call&&(this._call=null,this._time=1/0,xu())}};function j_(e,r,i){var o=new ka;return o.restart(e,r,i),o}function _w(){Xu(),++ui;for(var e=ba,r;e;)(r=En-e._time)>=0&&e._call.call(void 0,r),e=e._next;--ui}function ip(){En=(Ea=ws.now())+Oa,ui=fs=0;try{_w()}finally{ui=0,mw(),En=0}}function gw(){var e=ws.now(),r=e-Ea;r>H_&&(Oa-=r,Ea=e)}function mw(){for(var e,r=ba,i,o=1/0;r;)r._call?(o>r._time&&(o=r._time),e=r,r=r._next):(i=r._next,r._next=null,r=e?e._next=i:ba=i);ps=e,xu(o)}function xu(e){if(!ui){fs&&(fs=clearTimeout(fs));var r=e-En;r>24?(e<1/0&&(fs=setTimeout(ip,e-ws.now()-Oa)),us&&(us=clearInterval(us))):(us||(Ea=ws.now(),us=setInterval(gw,H_)),ui=1,F_(ip))}}function sp(e,r,i){var o=new ka;return r=r==null?0:+r,o.restart(h=>{o.stop(),e(h+r)},r,i),o}var vw=Ba("start","end","cancel","interrupt"),yw=[],z_=0,op=1,bu=2,_a=3,ap=4,Eu=5,ga=6;function Ha(e,r,i,o,h,S){var y=e.__transition;if(!y)e.__transition={};else if(i in y)return;ww(e,i,{name:r,index:o,group:h,on:vw,tween:yw,time:S.time,delay:S.delay,duration:S.duration,ease:S.ease,timer:null,state:z_})}function Yu(e,r){var i=tr(e,r);if(i.state>z_)throw new Error("too late; already scheduled");return i}function fr(e,r){var i=tr(e,r);if(i.state>_a)throw new Error("too late; already running");return i}function tr(e,r){var i=e.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function ww(e,r,i){var o=e.__transition,h;o[r]=i,i.timer=j_(S,0,i.time);function S(_){i.state=op,i.timer.restart(y,i.delay,i.time),i.delay<=_&&y(_-i.delay)}function y(_){var v,c,m,C;if(i.state!==op)return l();for(v in o)if(C=o[v],C.name===i.name){if(C.state===_a)return sp(y);C.state===ap?(C.state=ga,C.timer.stop(),C.on.call("interrupt",e,e.__data__,C.index,C.group),delete o[v]):+v<r&&(C.state=ga,C.timer.stop(),C.on.call("cancel",e,e.__data__,C.index,C.group),delete o[v])}if(sp(function(){i.state===_a&&(i.state=ap,i.timer.restart(a,i.delay,i.time),a(_))}),i.state=bu,i.on.call("start",e,e.__data__,i.index,i.group),i.state===bu){for(i.state=_a,h=new Array(m=i.tween.length),v=0,c=-1;v<m;++v)(C=i.tween[v].value.call(e,e.__data__,i.index,i.group))&&(h[++c]=C);h.length=c+1}}function a(_){for(var v=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(l),i.state=Eu,1),c=-1,m=h.length;++c<m;)h[c].call(e,v);i.state===Eu&&(i.on.call("end",e,e.__data__,i.index,i.group),l())}function l(){i.state=ga,i.timer.stop(),delete o[r];for(var _ in o)return;delete e.__transition}}function ma(e,r){var i=e.__transition,o,h,S=!0,y;if(i){r=r==null?null:r+"";for(y in i){if((o=i[y]).name!==r){S=!1;continue}h=o.state>bu&&o.state<Eu,o.state=ga,o.timer.stop(),o.on.call(h?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete i[y]}S&&delete e.__transition}}function Sw(e){return this.each(function(){ma(this,e)})}function Cw(e,r){var i,o;return function(){var h=fr(this,e),S=h.tween;if(S!==i){o=i=S;for(var y=0,a=o.length;y<a;++y)if(o[y].name===r){o=o.slice(),o.splice(y,1);break}}h.tween=o}}function xw(e,r,i){var o,h;if(typeof i!="function")throw new Error;return function(){var S=fr(this,e),y=S.tween;if(y!==o){h=(o=y).slice();for(var a={name:r,value:i},l=0,_=h.length;l<_;++l)if(h[l].name===r){h[l]=a;break}l===_&&h.push(a)}S.tween=h}}function bw(e,r){var i=this._id;if(e+="",arguments.length<2){for(var o=tr(this.node(),i).tween,h=0,S=o.length,y;h<S;++h)if((y=o[h]).name===e)return y.value;return null}return this.each((r==null?Cw:xw)(i,e,r))}function Gu(e,r,i){var o=e._id;return e.each(function(){var h=fr(this,o);(h.value||(h.value={}))[r]=i.apply(this,arguments)}),function(h){return tr(h,o).value[r]}}function $_(e,r){var i;return(typeof r=="number"?lr:r instanceof bn?xa:(i=bn(r))?(r=i,xa):B_)(e,r)}function Ew(e){return function(){this.removeAttribute(e)}}function kw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lw(e,r,i){var o,h=i+"",S;return function(){var y=this.getAttribute(e);return y===h?null:y===o?S:S=r(o=y,i)}}function Rw(e,r,i){var o,h=i+"",S;return function(){var y=this.getAttributeNS(e.space,e.local);return y===h?null:y===o?S:S=r(o=y,i)}}function Dw(e,r,i){var o,h,S;return function(){var y,a=i(this),l;return a==null?void this.removeAttribute(e):(y=this.getAttribute(e),l=a+"",y===l?null:y===o&&l===h?S:(h=l,S=r(o=y,a)))}}function Aw(e,r,i){var o,h,S;return function(){var y,a=i(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(y=this.getAttributeNS(e.space,e.local),l=a+"",y===l?null:y===o&&l===h?S:(h=l,S=r(o=y,a)))}}function Tw(e,r){var i=Ia(e),o=i==="transform"?uw:$_;return this.attrTween(e,typeof r=="function"?(i.local?Aw:Dw)(i,o,Gu(this,"attr."+e,r)):r==null?(i.local?kw:Ew)(i):(i.local?Rw:Lw)(i,o,r))}function Mw(e,r){return function(i){this.setAttribute(e,r.call(this,i))}}function Pw(e,r){return function(i){this.setAttributeNS(e.space,e.local,r.call(this,i))}}function Nw(e,r){var i,o;function h(){var S=r.apply(this,arguments);return S!==o&&(i=(o=S)&&Pw(e,S)),i}return h._value=r,h}function Bw(e,r){var i,o;function h(){var S=r.apply(this,arguments);return S!==o&&(i=(o=S)&&Mw(e,S)),i}return h._value=r,h}function Iw(e,r){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var o=Ia(e);return this.tween(i,(o.local?Nw:Bw)(o,r))}function Ow(e,r){return function(){Yu(this,e).delay=+r.apply(this,arguments)}}function Hw(e,r){return r=+r,function(){Yu(this,e).delay=r}}function Fw(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?Ow:Hw)(r,e)):tr(this.node(),r).delay}function jw(e,r){return function(){fr(this,e).duration=+r.apply(this,arguments)}}function zw(e,r){return r=+r,function(){fr(this,e).duration=r}}function $w(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?jw:zw)(r,e)):tr(this.node(),r).duration}function Ww(e,r){if(typeof r!="function")throw new Error;return function(){fr(this,e).ease=r}}function Uw(e){var r=this._id;return arguments.length?this.each(Ww(r,e)):tr(this.node(),r).ease}function Vw(e,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;fr(this,e).ease=i}}function qw(e){if(typeof e!="function")throw new Error;return this.each(Vw(this._id,e))}function Kw(e){typeof e!="function"&&(e=y_(e));for(var r=this._groups,i=r.length,o=new Array(i),h=0;h<i;++h)for(var S=r[h],y=S.length,a=o[h]=[],l,_=0;_<y;++_)(l=S[_])&&e.call(l,l.__data__,_,S)&&a.push(l);return new kr(o,this._parents,this._name,this._id)}function Xw(e){if(e._id!==this._id)throw new Error;for(var r=this._groups,i=e._groups,o=r.length,h=i.length,S=Math.min(o,h),y=new Array(o),a=0;a<S;++a)for(var l=r[a],_=i[a],v=l.length,c=y[a]=new Array(v),m,C=0;C<v;++C)(m=l[C]||_[C])&&(c[C]=m);for(;a<o;++a)y[a]=r[a];return new kr(y,this._parents,this._name,this._id)}function Yw(e){return(e+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function Gw(e,r,i){var o,h,S=Yw(r)?Yu:fr;return function(){var y=S(this,e),a=y.on;a!==o&&(h=(o=a).copy()).on(r,i),y.on=h}}function Qw(e,r){var i=this._id;return arguments.length<2?tr(this.node(),i).on.on(e):this.each(Gw(i,e,r))}function Jw(e){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==e)return;r&&r.removeChild(this)}}function Zw(){return this.on("end.remove",Jw(this._id))}function eS(e){var r=this._name,i=this._id;typeof e!="function"&&(e=Uu(e));for(var o=this._groups,h=o.length,S=new Array(h),y=0;y<h;++y)for(var a=o[y],l=a.length,_=S[y]=new Array(l),v,c,m=0;m<l;++m)(v=a[m])&&(c=e.call(v,v.__data__,m,a))&&("__data__"in v&&(c.__data__=v.__data__),_[m]=c,Ha(_[m],r,i,m,_,tr(v,i)));return new kr(S,this._parents,r,i)}function tS(e){var r=this._name,i=this._id;typeof e!="function"&&(e=v_(e));for(var o=this._groups,h=o.length,S=[],y=[],a=0;a<h;++a)for(var l=o[a],_=l.length,v,c=0;c<_;++c)if(v=l[c]){for(var m=e.call(v,v.__data__,c,l),C,b=tr(v,i),x=0,f=m.length;x<f;++x)(C=m[x])&&Ha(C,r,i,x,m,b);S.push(m),y.push(v)}return new kr(S,y,r,i)}var rS=Ls.prototype.constructor;function nS(){return new rS(this._groups,this._parents)}function iS(e,r){var i,o,h;return function(){var S=ci(this,e),y=(this.style.removeProperty(e),ci(this,e));return S===y?null:S===i&&y===o?h:h=r(i=S,o=y)}}function W_(e){return function(){this.style.removeProperty(e)}}function sS(e,r,i){var o,h=i+"",S;return function(){var y=ci(this,e);return y===h?null:y===o?S:S=r(o=y,i)}}function oS(e,r,i){var o,h,S;return function(){var y=ci(this,e),a=i(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),ci(this,e))),y===l?null:y===o&&l===h?S:(h=l,S=r(o=y,a))}}function aS(e,r){var i,o,h,S="style."+r,y="end."+S,a;return function(){var l=fr(this,e),_=l.on,v=l.value[S]==null?a||(a=W_(r)):void 0;(_!==i||h!==v)&&(o=(i=_).copy()).on(y,h=v),l.on=o}}function lS(e,r,i){var o=(e+="")=="transform"?cw:$_;return r==null?this.styleTween(e,iS(e,o)).on("end.style."+e,W_(e)):typeof r=="function"?this.styleTween(e,oS(e,o,Gu(this,"style."+e,r))).each(aS(this._id,e)):this.styleTween(e,sS(e,o,r),i).on("end.style."+e,null)}function cS(e,r,i){return function(o){this.style.setProperty(e,r.call(this,o),i)}}function uS(e,r,i){var o,h;function S(){var y=r.apply(this,arguments);return y!==h&&(o=(h=y)&&cS(e,y,i)),o}return S._value=r,S}function hS(e,r,i){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;return this.tween(o,uS(e,r,i??""))}function dS(e){return function(){this.textContent=e}}function fS(e){return function(){var r=e(this);this.textContent=r??""}}function pS(e){return this.tween("text",typeof e=="function"?fS(Gu(this,"text",e)):dS(e==null?"":e+""))}function _S(e){return function(r){this.textContent=e.call(this,r)}}function gS(e){var r,i;function o(){var h=e.apply(this,arguments);return h!==i&&(r=(i=h)&&_S(h)),r}return o._value=e,o}function mS(e){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,gS(e))}function vS(){for(var e=this._name,r=this._id,i=U_(),o=this._groups,h=o.length,S=0;S<h;++S)for(var y=o[S],a=y.length,l,_=0;_<a;++_)if(l=y[_]){var v=tr(l,r);Ha(l,e,i,_,y,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new kr(o,this._parents,e,i)}function yS(){var e,r,i=this,o=i._id,h=i.size();return new Promise(function(S,y){var a={value:y},l={value:function(){--h===0&&S()}};i.each(function(){var _=fr(this,o),v=_.on;v!==e&&(r=(e=v).copy(),r._.cancel.push(a),r._.interrupt.push(a),r._.end.push(l)),_.on=r}),h===0&&S()})}var wS=0;function kr(e,r,i,o){this._groups=e,this._parents=r,this._name=i,this._id=o}function U_(){return++wS}var xr=Ls.prototype;kr.prototype={constructor:kr,select:eS,selectAll:tS,selectChild:xr.selectChild,selectChildren:xr.selectChildren,filter:Kw,merge:Xw,selection:nS,transition:vS,call:xr.call,nodes:xr.nodes,node:xr.node,size:xr.size,empty:xr.empty,each:xr.each,on:Qw,attr:Tw,attrTween:Iw,style:lS,styleTween:hS,text:pS,textTween:mS,remove:Zw,tween:bw,delay:Fw,duration:$w,ease:Uw,easeVarying:qw,end:yS,[Symbol.iterator]:xr[Symbol.iterator]};function SS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var CS={time:null,delay:0,duration:250,ease:SS};function xS(e,r){for(var i;!(i=e.__transition)||!(i=i[r]);)if(!(e=e.parentNode))throw new Error(`transition ${r} not found`);return i}function bS(e){var r,i;e instanceof kr?(r=e._id,e=e._name):(r=U_(),(i=CS).time=Xu(),e=e==null?null:e+"");for(var o=this._groups,h=o.length,S=0;S<h;++S)for(var y=o[S],a=y.length,l,_=0;_<a;++_)(l=y[_])&&Ha(l,e,r,_,y,i||xS(l,r));return new kr(o,this._parents,e,r)}Ls.prototype.interrupt=Sw;Ls.prototype.transition=bS;const na=e=>()=>e;function ES(e,{sourceEvent:r,target:i,transform:o,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:h}})}function Er(e,r,i){this.k=e,this.x=r,this.y=i}Er.prototype={constructor:Er,scale:function(e){return e===1?this:new Er(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new Er(this.k,this.x+this.k*e,this.y+this.k*r)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fa=new Er(1,0,0);V_.prototype=Er.prototype;function V_(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fa;return e.__zoom}function Yc(e){e.stopImmediatePropagation()}function hs(e){e.preventDefault(),e.stopImmediatePropagation()}function kS(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function LS(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function lp(){return this.__zoom||Fa}function RS(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function DS(){return navigator.maxTouchPoints||"ontouchstart"in this}function AS(e,r,i){var o=e.invertX(r[0][0])-i[0][0],h=e.invertX(r[1][0])-i[1][0],S=e.invertY(r[0][1])-i[0][1],y=e.invertY(r[1][1])-i[1][1];return e.translate(h>o?(o+h)/2:Math.min(0,o)||Math.max(0,h),y>S?(S+y)/2:Math.min(0,S)||Math.max(0,y))}function q_(){var e=kS,r=LS,i=AS,o=RS,h=DS,S=[0,1/0],y=[[-1/0,-1/0],[1/0,1/0]],a=250,l=pa,_=Ba("start","zoom","end"),v,c,m,C=500,b=150,x=0,f=10;function p(I){I.property("__zoom",lp).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",W).filter(h).on("touchstart.zoom",z).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(I,q,U,K){var V=I.selection?I.selection():I;V.property("__zoom",lp),I!==V?L(I,q,U,K):V.interrupt().each(function(){R(this,arguments).event(K).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},p.scaleBy=function(I,q,U,K){p.scaleTo(I,function(){var V=this.__zoom.k,T=typeof q=="function"?q.apply(this,arguments):q;return V*T},U,K)},p.scaleTo=function(I,q,U,K){p.transform(I,function(){var V=r.apply(this,arguments),T=this.__zoom,B=U==null?w(V):typeof U=="function"?U.apply(this,arguments):U,P=T.invert(B),F=typeof q=="function"?q.apply(this,arguments):q;return i(u(d(T,F),B,P),V,y)},U,K)},p.translateBy=function(I,q,U,K){p.transform(I,function(){return i(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof U=="function"?U.apply(this,arguments):U),r.apply(this,arguments),y)},null,K)},p.translateTo=function(I,q,U,K,V){p.transform(I,function(){var T=r.apply(this,arguments),B=this.__zoom,P=K==null?w(T):typeof K=="function"?K.apply(this,arguments):K;return i(Fa.translate(P[0],P[1]).scale(B.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof U=="function"?-U.apply(this,arguments):-U),T,y)},K,V)};function d(I,q){return q=Math.max(S[0],Math.min(S[1],q)),q===I.k?I:new Er(q,I.x,I.y)}function u(I,q,U){var K=q[0]-U[0]*I.k,V=q[1]-U[1]*I.k;return K===I.x&&V===I.y?I:new Er(I.k,K,V)}function w(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function L(I,q,U,K){I.on("start.zoom",function(){R(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(K).end()}).tween("zoom",function(){var V=this,T=arguments,B=R(V,T).event(K),P=r.apply(V,T),F=U==null?w(P):typeof U=="function"?U.apply(V,T):U,G=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),Z=V.__zoom,ie=typeof q=="function"?q.apply(V,T):q,ae=l(Z.invert(F).concat(G/Z.k),ie.invert(F).concat(G/ie.k));return function(X){if(X===1)X=ie;else{var H=ae(X),re=G/H[2];X=new Er(re,F[0]-H[0]*re,F[1]-H[1]*re)}B.zoom(null,X)}})}function R(I,q,U){return!U&&I.__zooming||new D(I,q)}function D(I,q){this.that=I,this.args=q,this.active=0,this.sourceEvent=null,this.extent=r.apply(I,q),this.taps=0}D.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,q){return this.mouse&&I!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var q=Nt(this.that).datum();_.call(I,this.that,new ES(I,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:_}),q)}};function k(I,...q){if(!e.apply(this,arguments))return;var U=R(this,q).event(I),K=this.__zoom,V=Math.max(S[0],Math.min(S[1],K.k*Math.pow(2,o.apply(this,arguments)))),T=Qt(I);if(U.wheel)(U.mouse[0][0]!==T[0]||U.mouse[0][1]!==T[1])&&(U.mouse[1]=K.invert(U.mouse[0]=T)),clearTimeout(U.wheel);else{if(K.k===V)return;U.mouse=[T,K.invert(T)],ma(this),U.start()}hs(I),U.wheel=setTimeout(B,b),U.zoom("mouse",i(u(d(K,V),U.mouse[0],U.mouse[1]),U.extent,y));function B(){U.wheel=null,U.end()}}function M(I,...q){if(m||!e.apply(this,arguments))return;var U=I.currentTarget,K=R(this,q,!0).event(I),V=Nt(I.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",G,!0),T=Qt(I,U),B=I.clientX,P=I.clientY;D_(I.view),Yc(I),K.mouse=[T,this.__zoom.invert(T)],ma(this),K.start();function F(Z){if(hs(Z),!K.moved){var ie=Z.clientX-B,ae=Z.clientY-P;K.moved=ie*ie+ae*ae>x}K.event(Z).zoom("mouse",i(u(K.that.__zoom,K.mouse[0]=Qt(Z,U),K.mouse[1]),K.extent,y))}function G(Z){V.on("mousemove.zoom mouseup.zoom",null),A_(Z.view,K.moved),hs(Z),K.event(Z).end()}}function W(I,...q){if(e.apply(this,arguments)){var U=this.__zoom,K=Qt(I.changedTouches?I.changedTouches[0]:I,this),V=U.invert(K),T=U.k*(I.shiftKey?.5:2),B=i(u(d(U,T),K,V),r.apply(this,q),y);hs(I),a>0?Nt(this).transition().duration(a).call(L,B,K,I):Nt(this).call(p.transform,B,K,I)}}function z(I,...q){if(e.apply(this,arguments)){var U=I.touches,K=U.length,V=R(this,q,I.changedTouches.length===K).event(I),T,B,P,F;for(Yc(I),B=0;B<K;++B)P=U[B],F=Qt(P,this),F=[F,this.__zoom.invert(F),P.identifier],V.touch0?!V.touch1&&V.touch0[2]!==F[2]&&(V.touch1=F,V.taps=0):(V.touch0=F,T=!0,V.taps=1+!!v);v&&(v=clearTimeout(v)),T&&(V.taps<2&&(c=F[0],v=setTimeout(function(){v=null},C)),ma(this),V.start())}}function j(I,...q){if(this.__zooming){var U=R(this,q).event(I),K=I.changedTouches,V=K.length,T,B,P,F;for(hs(I),T=0;T<V;++T)B=K[T],P=Qt(B,this),U.touch0&&U.touch0[2]===B.identifier?U.touch0[0]=P:U.touch1&&U.touch1[2]===B.identifier&&(U.touch1[0]=P);if(B=U.that.__zoom,U.touch1){var G=U.touch0[0],Z=U.touch0[1],ie=U.touch1[0],ae=U.touch1[1],X=(X=ie[0]-G[0])*X+(X=ie[1]-G[1])*X,H=(H=ae[0]-Z[0])*H+(H=ae[1]-Z[1])*H;B=d(B,Math.sqrt(X/H)),P=[(G[0]+ie[0])/2,(G[1]+ie[1])/2],F=[(Z[0]+ae[0])/2,(Z[1]+ae[1])/2]}else if(U.touch0)P=U.touch0[0],F=U.touch0[1];else return;U.zoom("touch",i(u(B,P,F),U.extent,y))}}function N(I,...q){if(this.__zooming){var U=R(this,q).event(I),K=I.changedTouches,V=K.length,T,B;for(Yc(I),m&&clearTimeout(m),m=setTimeout(function(){m=null},C),T=0;T<V;++T)B=K[T],U.touch0&&U.touch0[2]===B.identifier?delete U.touch0:U.touch1&&U.touch1[2]===B.identifier&&delete U.touch1;if(U.touch1&&!U.touch0&&(U.touch0=U.touch1,delete U.touch1),U.touch0)U.touch0[1]=this.__zoom.invert(U.touch0[0]);else if(U.end(),U.taps===2&&(B=Qt(B,this),Math.hypot(c[0]-B[0],c[1]-B[1])<f)){var P=Nt(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return p.wheelDelta=function(I){return arguments.length?(o=typeof I=="function"?I:na(+I),p):o},p.filter=function(I){return arguments.length?(e=typeof I=="function"?I:na(!!I),p):e},p.touchable=function(I){return arguments.length?(h=typeof I=="function"?I:na(!!I),p):h},p.extent=function(I){return arguments.length?(r=typeof I=="function"?I:na([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),p):r},p.scaleExtent=function(I){return arguments.length?(S[0]=+I[0],S[1]=+I[1],p):[S[0],S[1]]},p.translateExtent=function(I){return arguments.length?(y[0][0]=+I[0][0],y[1][0]=+I[1][0],y[0][1]=+I[0][1],y[1][1]=+I[1][1],p):[[y[0][0],y[0][1]],[y[1][0],y[1][1]]]},p.constrain=function(I){return arguments.length?(i=I,p):i},p.duration=function(I){return arguments.length?(a=+I,p):a},p.interpolate=function(I){return arguments.length?(l=I,p):l},p.on=function(){var I=_.on.apply(_,arguments);return I===_?p:I},p.clickDistance=function(I){return arguments.length?(x=(I=+I)*I,p):Math.sqrt(x)},p.tapDistance=function(I){return arguments.length?(f=+I,p):f},p}const dr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:r,sourceHandle:i,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:o}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Ss=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],K_=["Enter"," ","Escape"],X_={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:r,y:i})=>`Moved selected node ${e}. New position, x: ${r}, y: ${i}`,"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 hi;(function(e){e.Strict="strict",e.Loose="loose"})(hi||(hi={}));var xn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(xn||(xn={}));var Cs;(function(e){e.Partial="partial",e.Full="full"})(Cs||(Cs={}));const Y_={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Zr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Zr||(Zr={}));var La;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(La||(La={}));var xe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(xe||(xe={}));const cp={[xe.Left]:xe.Right,[xe.Right]:xe.Left,[xe.Top]:xe.Bottom,[xe.Bottom]:xe.Top};function G_(e){return e===null?null:e?"valid":"invalid"}const Q_=e=>"id"in e&&"source"in e&&"target"in e,TS=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Qu=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ds=(e,r=[0,0])=>{const{width:i,height:o}=Lr(e),h=e.origin??r,S=i*h[0],y=o*h[1];return{x:e.position.x-S,y:e.position.y-y}},MS=(e,r={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((o,h)=>{const S=typeof h=="string";let y=!r.nodeLookup&&!S?h:void 0;r.nodeLookup&&(y=S?r.nodeLookup.get(h):Qu(h)?h:r.nodeLookup.get(h.id));const a=y?Ra(y,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ja(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return za(i)},As=(e,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(h=>{(r.filter===void 0||r.filter(h))&&(i=ja(i,Ra(h)),o=!0)}),o?za(i):{x:0,y:0,width:0,height:0}},Ju=(e,r,[i,o,h]=[0,0,1],S=!1,y=!1)=>{const a={...Ms(r,[i,o,h]),width:r.width/h,height:r.height/h},l=[];for(const _ of e.values()){const{measured:v,selectable:c=!0,hidden:m=!1}=_;if(y&&!c||m)continue;const C=v.width??_.width??_.initialWidth??null,b=v.height??_.height??_.initialHeight??null,x=xs(a,fi(_)),f=(C??0)*(b??0),p=S&&x>0;(!_.internals.handleBounds||p||x>=f||_.dragging)&&l.push(_)}return l},PS=(e,r)=>{const i=new Set;return e.forEach(o=>{i.add(o.id)}),r.filter(o=>i.has(o.source)||i.has(o.target))};function NS(e,r){const i=new Map,o=r!=null&&r.nodes?new Set(r.nodes.map(h=>h.id)):null;return e.forEach(h=>{h.measured.width&&h.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!h.hidden)&&(!o||o.has(h.id))&&i.set(h.id,h)}),i}async function BS({nodes:e,width:r,height:i,panZoom:o,minZoom:h,maxZoom:S},y){if(e.size===0)return Promise.resolve(!0);const a=NS(e,y),l=As(a),_=Zu(l,r,i,(y==null?void 0:y.minZoom)??h,(y==null?void 0:y.maxZoom)??S,(y==null?void 0:y.padding)??.1);return await o.setViewport(_,{duration:y==null?void 0:y.duration,ease:y==null?void 0:y.ease,interpolate:y==null?void 0:y.interpolate}),Promise.resolve(!0)}function J_({nodeId:e,nextPosition:r,nodeLookup:i,nodeOrigin:o=[0,0],nodeExtent:h,onError:S}){const y=i.get(e),a=y.parentId?i.get(y.parentId):void 0,{x:l,y:_}=a?a.internals.positionAbsolute:{x:0,y:0},v=y.origin??o;let c=y.extent||h;if(y.extent==="parent"&&!y.expandParent)if(!a)S==null||S("005",dr.error005());else{const C=a.measured.width,b=a.measured.height;C&&b&&(c=[[l,_],[l+C,_+b]])}else a&&pi(y.extent)&&(c=[[y.extent[0][0]+l,y.extent[0][1]+_],[y.extent[1][0]+l,y.extent[1][1]+_]]);const m=pi(c)?kn(r,c,y.measured):r;return(y.measured.width===void 0||y.measured.height===void 0)&&(S==null||S("015",dr.error015())),{position:{x:m.x-l+(y.measured.width??0)*v[0],y:m.y-_+(y.measured.height??0)*v[1]},positionAbsolute:m}}async function IS({nodesToRemove:e=[],edgesToRemove:r=[],nodes:i,edges:o,onBeforeDelete:h}){const S=new Set(e.map(m=>m.id)),y=[];for(const m of i){if(m.deletable===!1)continue;const C=S.has(m.id),b=!C&&m.parentId&&y.find(x=>x.id===m.parentId);(C||b)&&y.push(m)}const a=new Set(r.map(m=>m.id)),l=o.filter(m=>m.deletable!==!1),v=PS(y,l);for(const m of l)a.has(m.id)&&!v.find(b=>b.id===m.id)&&v.push(m);if(!h)return{edges:v,nodes:y};const c=await h({nodes:y,edges:v});return typeof c=="boolean"?c?{edges:v,nodes:y}:{edges:[],nodes:[]}:c}const di=(e,r=0,i=1)=>Math.min(Math.max(e,r),i),kn=(e={x:0,y:0},r,i)=>({x:di(e.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:di(e.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function Z_(e,r,i){const{width:o,height:h}=Lr(i),{x:S,y}=i.internals.positionAbsolute;return kn(e,[[S,y],[S+o,y+h]],r)}const up=(e,r,i)=>e<r?di(Math.abs(e-r),1,r)/r:e>i?-di(Math.abs(e-i),1,r)/r:0,eg=(e,r,i=15,o=40)=>{const h=up(e.x,o,r.width-o)*i,S=up(e.y,o,r.height-o)*i;return[h,S]},ja=(e,r)=>({x:Math.min(e.x,r.x),y:Math.min(e.y,r.y),x2:Math.max(e.x2,r.x2),y2:Math.max(e.y2,r.y2)}),ku=({x:e,y:r,width:i,height:o})=>({x:e,y:r,x2:e+i,y2:r+o}),za=({x:e,y:r,x2:i,y2:o})=>({x:e,y:r,width:i-e,height:o-r}),fi=(e,r=[0,0])=>{var h,S;const{x:i,y:o}=Qu(e)?e.internals.positionAbsolute:Ds(e,r);return{x:i,y:o,width:((h=e.measured)==null?void 0:h.width)??e.width??e.initialWidth??0,height:((S=e.measured)==null?void 0:S.height)??e.height??e.initialHeight??0}},Ra=(e,r=[0,0])=>{var h,S;const{x:i,y:o}=Qu(e)?e.internals.positionAbsolute:Ds(e,r);return{x:i,y:o,x2:i+(((h=e.measured)==null?void 0:h.width)??e.width??e.initialWidth??0),y2:o+(((S=e.measured)==null?void 0:S.height)??e.height??e.initialHeight??0)}},tg=(e,r)=>za(ja(ku(e),ku(r))),xs=(e,r)=>{const i=Math.max(0,Math.min(e.x+e.width,r.x+r.width)-Math.max(e.x,r.x)),o=Math.max(0,Math.min(e.y+e.height,r.y+r.height)-Math.max(e.y,r.y));return Math.ceil(i*o)},hp=e=>Zt(e.width)&&Zt(e.height)&&Zt(e.x)&&Zt(e.y),Zt=e=>!isNaN(e)&&isFinite(e),OS=(e,r)=>{},Ts=(e,r=[1,1])=>({x:r[0]*Math.round(e.x/r[0]),y:r[1]*Math.round(e.y/r[1])}),Ms=({x:e,y:r},[i,o,h],S=!1,y=[1,1])=>{const a={x:(e-i)/h,y:(r-o)/h};return S?Ts(a,y):a},Da=({x:e,y:r},[i,o,h])=>({x:e*h+i,y:r*h+o});function ii(e,r){if(typeof e=="number")return Math.floor((r-r/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function HS(e,r,i){if(typeof e=="string"||typeof e=="number"){const o=ii(e,i),h=ii(e,r);return{top:o,right:h,bottom:o,left:h,x:h*2,y:o*2}}if(typeof e=="object"){const o=ii(e.top??e.y??0,i),h=ii(e.bottom??e.y??0,i),S=ii(e.left??e.x??0,r),y=ii(e.right??e.x??0,r);return{top:o,right:y,bottom:h,left:S,x:S+y,y:o+h}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function FS(e,r,i,o,h,S){const{x:y,y:a}=Da(e,[r,i,o]),{x:l,y:_}=Da({x:e.x+e.width,y:e.y+e.height},[r,i,o]),v=h-l,c=S-_;return{left:Math.floor(y),top:Math.floor(a),right:Math.floor(v),bottom:Math.floor(c)}}const Zu=(e,r,i,o,h,S)=>{const y=HS(S,r,i),a=(r-y.x)/e.width,l=(i-y.y)/e.height,_=Math.min(a,l),v=di(_,o,h),c=e.x+e.width/2,m=e.y+e.height/2,C=r/2-c*v,b=i/2-m*v,x=FS(e,C,b,v,r,i),f={left:Math.min(x.left-y.left,0),top:Math.min(x.top-y.top,0),right:Math.min(x.right-y.right,0),bottom:Math.min(x.bottom-y.bottom,0)};return{x:C-f.left+f.right,y:b-f.top+f.bottom,zoom:v}},bs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function pi(e){return e!=null&&e!=="parent"}function Lr(e){var r,i;return{width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}}function rg(e){var r,i;return(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth)!==void 0&&(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight)!==void 0}function ng(e,r={width:0,height:0},i,o,h){const S={...e},y=o.get(i);if(y){const a=y.origin||h;S.x+=y.internals.positionAbsolute.x-(r.width??0)*a[0],S.y+=y.internals.positionAbsolute.y-(r.height??0)*a[1]}return S}function dp(e,r){if(e.size!==r.size)return!1;for(const i of e)if(!r.has(i))return!1;return!0}function jS(){let e,r;return{promise:new Promise((o,h)=>{e=o,r=h}),resolve:e,reject:r}}function zS(e){return{...X_,...e||{}}}function gs(e,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:o,containerBounds:h}){const{x:S,y}=er(e),a=Ms({x:S-((h==null?void 0:h.left)??0),y:y-((h==null?void 0:h.top)??0)},o),{x:l,y:_}=i?Ts(a,r):a;return{xSnapped:l,ySnapped:_,...a}}const eh=e=>({width:e.offsetWidth,height:e.offsetHeight}),ig=e=>{var r;return((r=e==null?void 0:e.getRootNode)==null?void 0:r.call(e))||(window==null?void 0:window.document)},$S=["INPUT","SELECT","TEXTAREA"];function sg(e){var o,h;const r=((h=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:h[0])||e.target;return(r==null?void 0:r.nodeType)!==1?!1:$S.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const og=e=>"clientX"in e,er=(e,r)=>{var S,y;const i=og(e),o=i?e.clientX:(S=e.touches)==null?void 0:S[0].clientX,h=i?e.clientY:(y=e.touches)==null?void 0:y[0].clientY;return{x:o-((r==null?void 0:r.left)??0),y:h-((r==null?void 0:r.top)??0)}},fp=(e,r,i,o,h)=>{const S=r.querySelectorAll(`.${e}`);return!S||!S.length?null:Array.from(S).map(y=>{const a=y.getBoundingClientRect();return{id:y.getAttribute("data-handleid"),type:e,nodeId:h,position:y.getAttribute("data-handlepos"),x:(a.left-i.left)/o,y:(a.top-i.top)/o,...eh(y)}})};function ag({sourceX:e,sourceY:r,targetX:i,targetY:o,sourceControlX:h,sourceControlY:S,targetControlX:y,targetControlY:a}){const l=e*.125+h*.375+y*.375+i*.125,_=r*.125+S*.375+a*.375+o*.125,v=Math.abs(l-e),c=Math.abs(_-r);return[l,_,v,c]}function ia(e,r){return e>=0?.5*e:r*25*Math.sqrt(-e)}function pp({pos:e,x1:r,y1:i,x2:o,y2:h,c:S}){switch(e){case xe.Left:return[r-ia(r-o,S),i];case xe.Right:return[r+ia(o-r,S),i];case xe.Top:return[r,i-ia(i-h,S)];case xe.Bottom:return[r,i+ia(h-i,S)]}}function lg({sourceX:e,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:h,targetPosition:S=xe.Top,curvature:y=.25}){const[a,l]=pp({pos:i,x1:e,y1:r,x2:o,y2:h,c:y}),[_,v]=pp({pos:S,x1:o,y1:h,x2:e,y2:r,c:y}),[c,m,C,b]=ag({sourceX:e,sourceY:r,targetX:o,targetY:h,sourceControlX:a,sourceControlY:l,targetControlX:_,targetControlY:v});return[`M${e},${r} C${a},${l} ${_},${v} ${o},${h}`,c,m,C,b]}function cg({sourceX:e,sourceY:r,targetX:i,targetY:o}){const h=Math.abs(i-e)/2,S=i<e?i+h:i-h,y=Math.abs(o-r)/2,a=o<r?o+y:o-y;return[S,a,h,y]}function WS({sourceNode:e,targetNode:r,selected:i=!1,zIndex:o=0,elevateOnSelect:h=!1,zIndexMode:S="basic"}){if(S==="manual")return o;const y=h&&i?o+1e3:o,a=Math.max(e.parentId||h&&e.selected?e.internals.z:0,r.parentId||h&&r.selected?r.internals.z:0);return y+a}function US({sourceNode:e,targetNode:r,width:i,height:o,transform:h}){const S=ja(Ra(e),Ra(r));S.x===S.x2&&(S.x2+=1),S.y===S.y2&&(S.y2+=1);const y={x:-h[0]/h[2],y:-h[1]/h[2],width:i/h[2],height:o/h[2]};return xs(y,za(S))>0}const VS=({source:e,sourceHandle:r,target:i,targetHandle:o})=>`xy-edge__${e}${r||""}-${i}${o||""}`,qS=(e,r)=>r.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),KS=(e,r,i={})=>{if(!e.source||!e.target)return r;const o=i.getEdgeId||VS;let h;return Q_(e)?h={...e}:h={...e,id:o(e)},qS(h,r)?r:(h.sourceHandle===null&&delete h.sourceHandle,h.targetHandle===null&&delete h.targetHandle,r.concat(h))};function ug({sourceX:e,sourceY:r,targetX:i,targetY:o}){const[h,S,y,a]=cg({sourceX:e,sourceY:r,targetX:i,targetY:o});return[`M ${e},${r}L ${i},${o}`,h,S,y,a]}const _p={[xe.Left]:{x:-1,y:0},[xe.Right]:{x:1,y:0},[xe.Top]:{x:0,y:-1},[xe.Bottom]:{x:0,y:1}},XS=({source:e,sourcePosition:r=xe.Bottom,target:i})=>r===xe.Left||r===xe.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},gp=(e,r)=>Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2));function YS({source:e,sourcePosition:r=xe.Bottom,target:i,targetPosition:o=xe.Top,center:h,offset:S,stepPosition:y}){const a=_p[r],l=_p[o],_={x:e.x+a.x*S,y:e.y+a.y*S},v={x:i.x+l.x*S,y:i.y+l.y*S},c=XS({source:_,sourcePosition:r,target:v}),m=c.x!==0?"x":"y",C=c[m];let b=[],x,f;const p={x:0,y:0},d={x:0,y:0},[,,u,w]=cg({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(a[m]*l[m]===-1){m==="x"?(x=h.x??_.x+(v.x-_.x)*y,f=h.y??(_.y+v.y)/2):(x=h.x??(_.x+v.x)/2,f=h.y??_.y+(v.y-_.y)*y);const k=[{x,y:_.y},{x,y:v.y}],M=[{x:_.x,y:f},{x:v.x,y:f}];a[m]===C?b=m==="x"?k:M:b=m==="x"?M:k}else{const k=[{x:_.x,y:v.y}],M=[{x:v.x,y:_.y}];if(m==="x"?b=a.x===C?M:k:b=a.y===C?k:M,r===o){const I=Math.abs(e[m]-i[m]);if(I<=S){const q=Math.min(S-1,S-I);a[m]===C?p[m]=(_[m]>e[m]?-1:1)*q:d[m]=(v[m]>i[m]?-1:1)*q}}if(r!==o){const I=m==="x"?"y":"x",q=a[m]===l[I],U=_[I]>v[I],K=_[I]<v[I];(a[m]===1&&(!q&&U||q&&K)||a[m]!==1&&(!q&&K||q&&U))&&(b=m==="x"?k:M)}const W={x:_.x+p.x,y:_.y+p.y},z={x:v.x+d.x,y:v.y+d.y},j=Math.max(Math.abs(W.x-b[0].x),Math.abs(z.x-b[0].x)),N=Math.max(Math.abs(W.y-b[0].y),Math.abs(z.y-b[0].y));j>=N?(x=(W.x+z.x)/2,f=b[0].y):(x=b[0].x,f=(W.y+z.y)/2)}const L={x:_.x+p.x,y:_.y+p.y},R={x:v.x+d.x,y:v.y+d.y};return[[e,...L.x!==b[0].x||L.y!==b[0].y?[L]:[],...b,...R.x!==b[b.length-1].x||R.y!==b[b.length-1].y?[R]:[],i],x,f,u,w]}function GS(e,r,i,o){const h=Math.min(gp(e,r)/2,gp(r,i)/2,o),{x:S,y}=r;if(e.x===S&&S===i.x||e.y===y&&y===i.y)return`L${S} ${y}`;if(e.y===y){const _=e.x<i.x?-1:1,v=e.y<i.y?1:-1;return`L ${S+h*_},${y}Q ${S},${y} ${S},${y+h*v}`}const a=e.x<i.x?1:-1,l=e.y<i.y?-1:1;return`L ${S},${y+h*l}Q ${S},${y} ${S+h*a},${y}`}function Lu({sourceX:e,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:h,targetPosition:S=xe.Top,borderRadius:y=5,centerX:a,centerY:l,offset:_=20,stepPosition:v=.5}){const[c,m,C,b,x]=YS({source:{x:e,y:r},sourcePosition:i,target:{x:o,y:h},targetPosition:S,center:{x:a,y:l},offset:_,stepPosition:v});let f=`M${c[0].x} ${c[0].y}`;for(let p=1;p<c.length-1;p++)f+=GS(c[p-1],c[p],c[p+1],y);return f+=`L${c[c.length-1].x} ${c[c.length-1].y}`,[f,m,C,b,x]}function mp(e){var r;return e&&!!(e.internals.handleBounds||(r=e.handles)!=null&&r.length)&&!!(e.measured.width||e.width||e.initialWidth)}function QS(e){var c;const{sourceNode:r,targetNode:i}=e;if(!mp(r)||!mp(i))return null;const o=r.internals.handleBounds||vp(r.handles),h=i.internals.handleBounds||vp(i.handles),S=yp((o==null?void 0:o.source)??[],e.sourceHandle),y=yp(e.connectionMode===hi.Strict?(h==null?void 0:h.target)??[]:((h==null?void 0:h.target)??[]).concat((h==null?void 0:h.source)??[]),e.targetHandle);if(!S||!y)return(c=e.onError)==null||c.call(e,"008",dr.error008(S?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(S==null?void 0:S.position)||xe.Bottom,l=(y==null?void 0:y.position)||xe.Top,_=Ln(r,S,a),v=Ln(i,y,l);return{sourceX:_.x,sourceY:_.y,targetX:v.x,targetY:v.y,sourcePosition:a,targetPosition:l}}function vp(e){if(!e)return null;const r=[],i=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?r.push(o):o.type==="target"&&i.push(o);return{source:r,target:i}}function Ln(e,r,i=xe.Left,o=!1){const h=((r==null?void 0:r.x)??0)+e.internals.positionAbsolute.x,S=((r==null?void 0:r.y)??0)+e.internals.positionAbsolute.y,{width:y,height:a}=r??Lr(e);if(o)return{x:h+y/2,y:S+a/2};switch((r==null?void 0:r.position)??i){case xe.Top:return{x:h+y/2,y:S};case xe.Right:return{x:h+y,y:S+a/2};case xe.Bottom:return{x:h+y/2,y:S+a};case xe.Left:return{x:h,y:S+a/2}}}function yp(e,r){return e&&(r?e.find(i=>i.id===r):e[0])||null}function Ru(e,r){return e?typeof e=="string"?e:`${r?`${r}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function JS(e,{id:r,defaultColor:i,defaultMarkerStart:o,defaultMarkerEnd:h}){const S=new Set;return e.reduce((y,a)=>([a.markerStart||o,a.markerEnd||h].forEach(l=>{if(l&&typeof l=="object"){const _=Ru(l,r);S.has(_)||(y.push({id:_,color:l.color||i,...l}),S.add(_))}}),y),[]).sort((y,a)=>y.id.localeCompare(a.id))}const hg=1e3,ZS=10,th={nodeOrigin:[0,0],nodeExtent:Ss,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},eC={...th,checkEquality:!0};function rh(e,r){const i={...e};for(const o in r)r[o]!==void 0&&(i[o]=r[o]);return i}function tC(e,r,i){const o=rh(th,i);for(const h of e.values())if(h.parentId)ih(h,e,r,o);else{const S=Ds(h,o.nodeOrigin),y=pi(h.extent)?h.extent:o.nodeExtent,a=kn(S,y,Lr(h));h.internals.positionAbsolute=a}}function rC(e,r){if(!e.handles)return e.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],o=[];for(const h of e.handles){const S={id:h.id,width:h.width??1,height:h.height??1,nodeId:e.id,x:h.x,y:h.y,position:h.position,type:h.type};h.type==="source"?i.push(S):h.type==="target"&&o.push(S)}return{source:i,target:o}}function nh(e){return e==="manual"}function Du(e,r,i,o={}){var v,c;const h=rh(eC,o),S={i:0},y=new Map(r),a=h!=null&&h.elevateNodesOnSelect&&!nh(h.zIndexMode)?hg:0;let l=e.length>0,_=!1;r.clear(),i.clear();for(const m of e){let C=y.get(m.id);if(h.checkEquality&&m===(C==null?void 0:C.internals.userNode))r.set(m.id,C);else{const b=Ds(m,h.nodeOrigin),x=pi(m.extent)?m.extent:h.nodeExtent,f=kn(b,x,Lr(m));C={...h.defaults,...m,measured:{width:(v=m.measured)==null?void 0:v.width,height:(c=m.measured)==null?void 0:c.height},internals:{positionAbsolute:f,handleBounds:rC(m,C),z:dg(m,a,h.zIndexMode),userNode:m}},r.set(m.id,C)}(C.measured===void 0||C.measured.width===void 0||C.measured.height===void 0)&&!C.hidden&&(l=!1),m.parentId&&ih(C,r,i,o,S),_||(_=m.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:_}}function nC(e,r){if(!e.parentId)return;const i=r.get(e.parentId);i?i.set(e.id,e):r.set(e.parentId,new Map([[e.id,e]]))}function ih(e,r,i,o,h){const{elevateNodesOnSelect:S,nodeOrigin:y,nodeExtent:a,zIndexMode:l}=rh(th,o),_=e.parentId,v=r.get(_);if(!v){console.warn(`Parent node ${_} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}nC(e,i),h&&!v.parentId&&v.internals.rootParentIndex===void 0&&l==="auto"&&(v.internals.rootParentIndex=++h.i,v.internals.z=v.internals.z+h.i*ZS),h&&v.internals.rootParentIndex!==void 0&&(h.i=v.internals.rootParentIndex);const c=S&&!nh(l)?hg:0,{x:m,y:C,z:b}=iC(e,v,y,a,c,l),{positionAbsolute:x}=e.internals,f=m!==x.x||C!==x.y;(f||b!==e.internals.z)&&r.set(e.id,{...e,internals:{...e.internals,positionAbsolute:f?{x:m,y:C}:x,z:b}})}function dg(e,r,i){const o=Zt(e.zIndex)?e.zIndex:0;return nh(i)?o:o+(e.selected?r:0)}function iC(e,r,i,o,h,S){const{x:y,y:a}=r.internals.positionAbsolute,l=Lr(e),_=Ds(e,i),v=pi(e.extent)?kn(_,e.extent,l):_;let c=kn({x:y+v.x,y:a+v.y},o,l);e.extent==="parent"&&(c=Z_(c,l,r));const m=dg(e,h,S),C=r.internals.z??0;return{x:c.x,y:c.y,z:C>=m?C+1:m}}function sh(e,r,i,o=[0,0]){var y;const h=[],S=new Map;for(const a of e){const l=r.get(a.parentId);if(!l)continue;const _=((y=S.get(a.parentId))==null?void 0:y.expandedRect)??fi(l),v=tg(_,a.rect);S.set(a.parentId,{expandedRect:v,parent:l})}return S.size>0&&S.forEach(({expandedRect:a,parent:l},_)=>{var u;const v=l.internals.positionAbsolute,c=Lr(l),m=l.origin??o,C=a.x<v.x?Math.round(Math.abs(v.x-a.x)):0,b=a.y<v.y?Math.round(Math.abs(v.y-a.y)):0,x=Math.max(c.width,Math.round(a.width)),f=Math.max(c.height,Math.round(a.height)),p=(x-c.width)*m[0],d=(f-c.height)*m[1];(C>0||b>0||p||d)&&(h.push({id:_,type:"position",position:{x:l.position.x-C+p,y:l.position.y-b+d}}),(u=i.get(_))==null||u.forEach(w=>{e.some(L=>L.id===w.id)||h.push({id:w.id,type:"position",position:{x:w.position.x+C,y:w.position.y+b}})})),(c.width<a.width||c.height<a.height||C||b)&&h.push({id:_,type:"dimensions",setAttributes:!0,dimensions:{width:x+(C?m[0]*C-p:0),height:f+(b?m[1]*b-d:0)}})}),h}function sC(e,r,i,o,h,S,y){const a=o==null?void 0:o.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const _=[],v=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(v.transform),m=[];for(const C of e.values()){const b=r.get(C.id);if(!b)continue;if(b.hidden){r.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),l=!0;continue}const x=eh(C.nodeElement),f=b.measured.width!==x.width||b.measured.height!==x.height;if(!!(x.width&&x.height&&(f||!b.internals.handleBounds||C.force))){const d=C.nodeElement.getBoundingClientRect(),u=pi(b.extent)?b.extent:S;let{positionAbsolute:w}=b.internals;b.parentId&&b.extent==="parent"?w=Z_(w,x,r.get(b.parentId)):u&&(w=kn(w,u,x));const L={...b,measured:x,internals:{...b.internals,positionAbsolute:w,handleBounds:{source:fp("source",C.nodeElement,d,c,b.id),target:fp("target",C.nodeElement,d,c,b.id)}}};r.set(b.id,L),b.parentId&&ih(L,r,i,{nodeOrigin:h,zIndexMode:y}),l=!0,f&&(_.push({id:b.id,type:"dimensions",dimensions:x}),b.expandParent&&b.parentId&&m.push({id:b.id,parentId:b.parentId,rect:fi(L,h)}))}}if(m.length>0){const C=sh(m,r,i,h);_.push(...C)}return{changes:_,updatedInternals:l}}async function oC({delta:e,panZoom:r,transform:i,translateExtent:o,width:h,height:S}){if(!r||!e.x&&!e.y)return Promise.resolve(!1);const y=await r.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[h,S]],o),a=!!y&&(y.x!==i[0]||y.y!==i[1]||y.k!==i[2]);return Promise.resolve(a)}function wp(e,r,i,o,h,S){let y=h;const a=o.get(y)||new Map;o.set(y,a.set(i,r)),y=`${h}-${e}`;const l=o.get(y)||new Map;if(o.set(y,l.set(i,r)),S){y=`${h}-${e}-${S}`;const _=o.get(y)||new Map;o.set(y,_.set(i,r))}}function fg(e,r,i){e.clear(),r.clear();for(const o of i){const{source:h,target:S,sourceHandle:y=null,targetHandle:a=null}=o,l={edgeId:o.id,source:h,target:S,sourceHandle:y,targetHandle:a},_=`${h}-${y}--${S}-${a}`,v=`${S}-${a}--${h}-${y}`;wp("source",l,v,e,h,y),wp("target",l,_,e,S,a),r.set(o.id,o)}}function pg(e,r){if(!e.parentId)return!1;const i=r.get(e.parentId);return i?i.selected?!0:pg(i,r):!1}function Sp(e,r,i){var h;let o=e;do{if((h=o==null?void 0:o.matches)!=null&&h.call(o,r))return!0;if(o===i)return!1;o=o==null?void 0:o.parentElement}while(o);return!1}function aC(e,r,i,o){const h=new Map;for(const[S,y]of e)if((y.selected||y.id===o)&&(!y.parentId||!pg(y,e))&&(y.draggable||r&&typeof y.draggable>"u")){const a=e.get(S);a&&h.set(S,{id:S,position:a.position||{x:0,y:0},distance:{x:i.x-a.internals.positionAbsolute.x,y:i.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 h}function Gc({nodeId:e,dragItems:r,nodeLookup:i,dragging:o=!0}){var y,a,l;const h=[];for(const[_,v]of r){const c=(y=i.get(_))==null?void 0:y.internals.userNode;c&&h.push({...c,position:v.position,dragging:o})}if(!e)return[h[0],h];const S=(a=i.get(e))==null?void 0:a.internals.userNode;return[S?{...S,position:((l=r.get(e))==null?void 0:l.position)||S.position,dragging:o}:h[0],h]}function lC({dragItems:e,snapGrid:r,x:i,y:o}){const h=e.values().next().value;if(!h)return null;const S={x:i-h.distance.x,y:o-h.distance.y},y=Ts(S,r);return{x:y.x-S.x,y:y.y-S.y}}function cC({onNodeMouseDown:e,getStoreItems:r,onDragStart:i,onDrag:o,onDragStop:h}){let S={x:null,y:null},y=0,a=new Map,l=!1,_={x:0,y:0},v=null,c=!1,m=null,C=!1,b=!1,x=null;function f({noDragClassName:d,handleSelector:u,domNode:w,isSelectable:L,nodeId:R,nodeClickDistance:D=0}){m=Nt(w);function k({x:j,y:N}){const{nodeLookup:I,nodeExtent:q,snapGrid:U,snapToGrid:K,nodeOrigin:V,onNodeDrag:T,onSelectionDrag:B,onError:P,updateNodePositions:F}=r();S={x:j,y:N};let G=!1;const Z=a.size>1,ie=Z&&q?ku(As(a)):null,ae=Z&&K?lC({dragItems:a,snapGrid:U,x:j,y:N}):null;for(const[X,H]of a){if(!I.has(X))continue;let re={x:j-H.distance.x,y:N-H.distance.y};K&&(re=ae?{x:Math.round(re.x+ae.x),y:Math.round(re.y+ae.y)}:Ts(re,U));let te=null;if(Z&&q&&!H.extent&&ie){const{positionAbsolute:pe}=H.internals,Se=pe.x-ie.x+q[0][0],be=pe.x+H.measured.width-ie.x2+q[1][0],ue=pe.y-ie.y+q[0][1],ge=pe.y+H.measured.height-ie.y2+q[1][1];te=[[Se,ue],[be,ge]]}const{position:ce,positionAbsolute:le}=J_({nodeId:X,nextPosition:re,nodeLookup:I,nodeExtent:te||q,nodeOrigin:V,onError:P});G=G||H.position.x!==ce.x||H.position.y!==ce.y,H.position=ce,H.internals.positionAbsolute=le}if(b=b||G,!!G&&(F(a,!0),x&&(o||T||!R&&B))){const[X,H]=Gc({nodeId:R,dragItems:a,nodeLookup:I});o==null||o(x,a,X,H),T==null||T(x,X,H),R||B==null||B(x,H)}}async function M(){if(!v)return;const{transform:j,panBy:N,autoPanSpeed:I,autoPanOnNodeDrag:q}=r();if(!q){l=!1,cancelAnimationFrame(y);return}const[U,K]=eg(_,v,I);(U!==0||K!==0)&&(S.x=(S.x??0)-U/j[2],S.y=(S.y??0)-K/j[2],await N({x:U,y:K})&&k(S)),y=requestAnimationFrame(M)}function W(j){var Z;const{nodeLookup:N,multiSelectionActive:I,nodesDraggable:q,transform:U,snapGrid:K,snapToGrid:V,selectNodesOnDrag:T,onNodeDragStart:B,onSelectionDragStart:P,unselectNodesAndEdges:F}=r();c=!0,(!T||!L)&&!I&&R&&((Z=N.get(R))!=null&&Z.selected||F()),L&&T&&R&&(e==null||e(R));const G=gs(j.sourceEvent,{transform:U,snapGrid:K,snapToGrid:V,containerBounds:v});if(S=G,a=aC(N,q,G,R),a.size>0&&(i||B||!R&&P)){const[ie,ae]=Gc({nodeId:R,dragItems:a,nodeLookup:N});i==null||i(j.sourceEvent,a,ie,ae),B==null||B(j.sourceEvent,ie,ae),R||P==null||P(j.sourceEvent,ae)}}const z=T_().clickDistance(D).on("start",j=>{const{domNode:N,nodeDragThreshold:I,transform:q,snapGrid:U,snapToGrid:K}=r();v=(N==null?void 0:N.getBoundingClientRect())||null,C=!1,b=!1,x=j.sourceEvent,I===0&&W(j),S=gs(j.sourceEvent,{transform:q,snapGrid:U,snapToGrid:K,containerBounds:v}),_=er(j.sourceEvent,v)}).on("drag",j=>{const{autoPanOnNodeDrag:N,transform:I,snapGrid:q,snapToGrid:U,nodeDragThreshold:K,nodeLookup:V}=r(),T=gs(j.sourceEvent,{transform:I,snapGrid:q,snapToGrid:U,containerBounds:v});if(x=j.sourceEvent,(j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||R&&!V.has(R))&&(C=!0),!C){if(!l&&N&&c&&(l=!0,M()),!c){const B=er(j.sourceEvent,v),P=B.x-_.x,F=B.y-_.y;Math.sqrt(P*P+F*F)>K&&W(j)}(S.x!==T.xSnapped||S.y!==T.ySnapped)&&a&&c&&(_=er(j.sourceEvent,v),k(T))}}).on("end",j=>{if(!(!c||C)&&(l=!1,c=!1,cancelAnimationFrame(y),a.size>0)){const{nodeLookup:N,updateNodePositions:I,onNodeDragStop:q,onSelectionDragStop:U}=r();if(b&&(I(a,!1),b=!1),h||q||!R&&U){const[K,V]=Gc({nodeId:R,dragItems:a,nodeLookup:N,dragging:!1});h==null||h(j.sourceEvent,a,K,V),q==null||q(j.sourceEvent,K,V),R||U==null||U(j.sourceEvent,V)}}}).filter(j=>{const N=j.target;return!j.button&&(!d||!Sp(N,`.${d}`,w))&&(!u||Sp(N,u,w))});m.call(z)}function p(){m==null||m.on(".drag",null)}return{update:f,destroy:p}}function uC(e,r,i){const o=[],h={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const S of r.values())xs(h,fi(S))>0&&o.push(S);return o}const hC=250;function dC(e,r,i,o){var a,l;let h=[],S=1/0;const y=uC(e,i,r+hC);for(const _ of y){const v=[...((a=_.internals.handleBounds)==null?void 0:a.source)??[],...((l=_.internals.handleBounds)==null?void 0:l.target)??[]];for(const c of v){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:m,y:C}=Ln(_,c,c.position,!0),b=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(C-e.y,2));b>r||(b<S?(h=[{...c,x:m,y:C}],S=b):b===S&&h.push({...c,x:m,y:C}))}}if(!h.length)return null;if(h.length>1){const _=o.type==="source"?"target":"source";return h.find(v=>v.type===_)??h[0]}return h[0]}function _g(e,r,i,o,h,S=!1){var _,v,c;const y=o.get(e);if(!y)return null;const a=h==="strict"?(_=y.internals.handleBounds)==null?void 0:_[r]:[...((v=y.internals.handleBounds)==null?void 0:v.source)??[],...((c=y.internals.handleBounds)==null?void 0:c.target)??[]],l=(i?a==null?void 0:a.find(m=>m.id===i):a==null?void 0:a[0])??null;return l&&S?{...l,...Ln(y,l,l.position,!0)}:l}function gg(e,r){return e||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function fC(e,r){let i=null;return r?i=!0:e&&!r&&(i=!1),i}const mg=()=>!0;function pC(e,{connectionMode:r,connectionRadius:i,handleId:o,nodeId:h,edgeUpdaterType:S,isTarget:y,domNode:a,nodeLookup:l,lib:_,autoPanOnConnect:v,flowId:c,panBy:m,cancelConnection:C,onConnectStart:b,onConnect:x,onConnectEnd:f,isValidConnection:p=mg,onReconnectEnd:d,updateConnection:u,getTransform:w,getFromHandle:L,autoPanSpeed:R,dragThreshold:D=1,handleDomNode:k}){const M=ig(e.target);let W=0,z;const{x:j,y:N}=er(e),I=gg(S,k),q=a==null?void 0:a.getBoundingClientRect();let U=!1;if(!q||!I)return;const K=_g(h,I,o,l,r);if(!K)return;let V=er(e,q),T=!1,B=null,P=!1,F=null;function G(){if(!v||!q)return;const[ce,le]=eg(V,q,R);m({x:ce,y:le}),W=requestAnimationFrame(G)}const Z={...K,nodeId:h,type:I,position:K.position},ie=l.get(h);let X={inProgress:!0,isValid:null,from:Ln(ie,Z,xe.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ie,to:V,toHandle:null,toPosition:cp[Z.position],toNode:null,pointer:V};function H(){U=!0,u(X),b==null||b(e,{nodeId:h,handleId:o,handleType:I})}D===0&&H();function re(ce){if(!U){const{x:ge,y:Re}=er(ce),Ie=ge-j,ze=Re-N;if(!(Ie*Ie+ze*ze>D*D))return;H()}if(!L()||!Z){te(ce);return}const le=w();V=er(ce,q),z=dC(Ms(V,le,!1,[1,1]),i,l,Z),T||(G(),T=!0);const pe=vg(ce,{handle:z,connectionMode:r,fromNodeId:h,fromHandleId:o,fromType:y?"target":"source",isValidConnection:p,doc:M,lib:_,flowId:c,nodeLookup:l});F=pe.handleDomNode,B=pe.connection,P=fC(!!z,pe.isValid);const Se=l.get(h),be=Se?Ln(Se,Z,xe.Left,!0):X.from,ue={...X,from:be,isValid:P,to:pe.toHandle&&P?Da({x:pe.toHandle.x,y:pe.toHandle.y},le):V,toHandle:pe.toHandle,toPosition:P&&pe.toHandle?pe.toHandle.position:cp[Z.position],toNode:pe.toHandle?l.get(pe.toHandle.nodeId):null,pointer:V};u(ue),X=ue}function te(ce){if(!("touches"in ce&&ce.touches.length>0)){if(U){(z||F)&&B&&P&&(x==null||x(B));const{inProgress:le,...pe}=X,Se={...pe,toPosition:X.toHandle?X.toPosition:null};f==null||f(ce,Se),S&&(d==null||d(ce,Se))}C(),cancelAnimationFrame(W),T=!1,P=!1,B=null,F=null,M.removeEventListener("mousemove",re),M.removeEventListener("mouseup",te),M.removeEventListener("touchmove",re),M.removeEventListener("touchend",te)}}M.addEventListener("mousemove",re),M.addEventListener("mouseup",te),M.addEventListener("touchmove",re),M.addEventListener("touchend",te)}function vg(e,{handle:r,connectionMode:i,fromNodeId:o,fromHandleId:h,fromType:S,doc:y,lib:a,flowId:l,isValidConnection:_=mg,nodeLookup:v}){const c=S==="target",m=r?y.querySelector(`.${a}-flow__handle[data-id="${l}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:b}=er(e),x=y.elementFromPoint(C,b),f=x!=null&&x.classList.contains(`${a}-flow__handle`)?x:m,p={handleDomNode:f,isValid:!1,connection:null,toHandle:null};if(f){const d=gg(void 0,f),u=f.getAttribute("data-nodeid"),w=f.getAttribute("data-handleid"),L=f.classList.contains("connectable"),R=f.classList.contains("connectableend");if(!u||!d)return p;const D={source:c?u:o,sourceHandle:c?w:h,target:c?o:u,targetHandle:c?h:w};p.connection=D;const M=L&&R&&(i===hi.Strict?c&&d==="source"||!c&&d==="target":u!==o||w!==h);p.isValid=M&&_(D),p.toHandle=_g(u,d,w,v,i,!0)}return p}const Au={onPointerDown:pC,isValid:vg};function _C({domNode:e,panZoom:r,getTransform:i,getViewScale:o}){const h=Nt(e);function S({translateExtent:a,width:l,height:_,zoomStep:v=1,pannable:c=!0,zoomable:m=!0,inversePan:C=!1}){const b=u=>{if(u.sourceEvent.type!=="wheel"||!r)return;const w=i(),L=u.sourceEvent.ctrlKey&&bs()?10:1,R=-u.sourceEvent.deltaY*(u.sourceEvent.deltaMode===1?.05:u.sourceEvent.deltaMode?1:.002)*v,D=w[2]*Math.pow(2,R*L);r.scaleTo(D)};let x=[0,0];const f=u=>{(u.sourceEvent.type==="mousedown"||u.sourceEvent.type==="touchstart")&&(x=[u.sourceEvent.clientX??u.sourceEvent.touches[0].clientX,u.sourceEvent.clientY??u.sourceEvent.touches[0].clientY])},p=u=>{const w=i();if(u.sourceEvent.type!=="mousemove"&&u.sourceEvent.type!=="touchmove"||!r)return;const L=[u.sourceEvent.clientX??u.sourceEvent.touches[0].clientX,u.sourceEvent.clientY??u.sourceEvent.touches[0].clientY],R=[L[0]-x[0],L[1]-x[1]];x=L;const D=o()*Math.max(w[2],Math.log(w[2]))*(C?-1:1),k={x:w[0]-R[0]*D,y:w[1]-R[1]*D},M=[[0,0],[l,_]];r.setViewportConstrained({x:k.x,y:k.y,zoom:w[2]},M,a)},d=q_().on("start",f).on("zoom",c?p:null).on("zoom.wheel",m?b:null);h.call(d,{})}function y(){h.on("zoom",null)}return{update:S,destroy:y,pointer:Qt}}const $a=e=>({x:e.x,y:e.y,zoom:e.k}),Qc=({x:e,y:r,zoom:i})=>Fa.translate(e,r).scale(i),si=(e,r)=>e.target.closest(`.${r}`),yg=(e,r)=>r===2&&Array.isArray(e)&&e.includes(2),gC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Jc=(e,r=0,i=gC,o=()=>{})=>{const h=typeof r=="number"&&r>0;return h||o(),h?e.transition().duration(r).ease(i).on("end",o):e},wg=e=>{const r=e.ctrlKey&&bs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*r};function mC({zoomPanValues:e,noWheelClassName:r,d3Selection:i,d3Zoom:o,panOnScrollMode:h,panOnScrollSpeed:S,zoomOnPinch:y,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:_}){return v=>{if(si(v,r))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const c=i.property("__zoom").k||1;if(v.ctrlKey&&y){const f=Qt(v),p=wg(v),d=c*Math.pow(2,p);o.scaleTo(i,d,f,v);return}const m=v.deltaMode===1?20:1;let C=h===xn.Vertical?0:v.deltaX*m,b=h===xn.Horizontal?0:v.deltaY*m;!bs()&&v.shiftKey&&h!==xn.Vertical&&(C=v.deltaY*m,b=0),o.translateBy(i,-(C/c)*S,-(b/c)*S,{internal:!0});const x=$a(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(v,x),e.panScrollTimeout=setTimeout(()=>{_==null||_(v,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(v,x))}}function vC({noWheelClassName:e,preventScrolling:r,d3ZoomHandler:i}){return function(o,h){const S=o.type==="wheel",y=!r&&S&&!o.ctrlKey,a=si(o,e);if(o.ctrlKey&&S&&a&&o.preventDefault(),y||a)return null;o.preventDefault(),i.call(this,o,h)}}function yC({zoomPanValues:e,onDraggingChange:r,onPanZoomStart:i}){return o=>{var S,y,a;if((S=o.sourceEvent)!=null&&S.internal)return;const h=$a(o.transform);e.mouseButton=((y=o.sourceEvent)==null?void 0:y.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=h,((a=o.sourceEvent)==null?void 0:a.type)==="mousedown"&&r(!0),i&&(i==null||i(o.sourceEvent,h))}}function wC({zoomPanValues:e,panOnDrag:r,onPaneContextMenu:i,onTransformChange:o,onPanZoom:h}){return S=>{var y,a;e.usedRightMouseButton=!!(i&&yg(r,e.mouseButton??0)),(y=S.sourceEvent)!=null&&y.sync||o([S.transform.x,S.transform.y,S.transform.k]),h&&!((a=S.sourceEvent)!=null&&a.internal)&&(h==null||h(S.sourceEvent,$a(S.transform)))}}function SC({zoomPanValues:e,panOnDrag:r,panOnScroll:i,onDraggingChange:o,onPanZoomEnd:h,onPaneContextMenu:S}){return y=>{var a;if(!((a=y.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,S&&yg(r,e.mouseButton??0)&&!e.usedRightMouseButton&&y.sourceEvent&&S(y.sourceEvent),e.usedRightMouseButton=!1,o(!1),h)){const l=$a(y.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{h==null||h(y.sourceEvent,l)},i?150:0)}}}function CC({zoomActivationKeyPressed:e,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:o,panOnScroll:h,zoomOnDoubleClick:S,userSelectionActive:y,noWheelClassName:a,noPanClassName:l,lib:_,connectionInProgress:v}){return c=>{var f;const m=e||r,C=i&&c.ctrlKey,b=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(si(c,`${_}-flow__node`)||si(c,`${_}-flow__edge`)))return!0;if(!o&&!m&&!h&&!S&&!i||y||v&&!b||si(c,a)&&b||si(c,l)&&(!b||h&&b&&!e)||!i&&c.ctrlKey&&b)return!1;if(!i&&c.type==="touchstart"&&((f=c.touches)==null?void 0:f.length)>1)return c.preventDefault(),!1;if(!m&&!h&&!C&&b||!o&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(o)&&!o.includes(c.button)&&c.type==="mousedown")return!1;const x=Array.isArray(o)&&o.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||b)&&x}}function xC({domNode:e,minZoom:r,maxZoom:i,translateExtent:o,viewport:h,onPanZoom:S,onPanZoomStart:y,onPanZoomEnd:a,onDraggingChange:l}){const _={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=e.getBoundingClientRect(),c=q_().scaleExtent([r,i]).translateExtent(o),m=Nt(e).call(c);d({x:h.x,y:h.y,zoom:di(h.zoom,r,i)},[[0,0],[v.width,v.height]],o);const C=m.on("wheel.zoom"),b=m.on("dblclick.zoom");c.wheelDelta(wg);function x(z,j){return m?new Promise(N=>{c==null||c.interpolate((j==null?void 0:j.interpolate)==="linear"?_s:pa).transform(Jc(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>N(!0)),z)}):Promise.resolve(!1)}function f({noWheelClassName:z,noPanClassName:j,onPaneContextMenu:N,userSelectionActive:I,panOnScroll:q,panOnDrag:U,panOnScrollMode:K,panOnScrollSpeed:V,preventScrolling:T,zoomOnPinch:B,zoomOnScroll:P,zoomOnDoubleClick:F,zoomActivationKeyPressed:G,lib:Z,onTransformChange:ie,connectionInProgress:ae,paneClickDistance:X,selectionOnDrag:H}){I&&!_.isZoomingOrPanning&&p();const re=q&&!G&&!I;c.clickDistance(H?1/0:!Zt(X)||X<0?0:X);const te=re?mC({zoomPanValues:_,noWheelClassName:z,d3Selection:m,d3Zoom:c,panOnScrollMode:K,panOnScrollSpeed:V,zoomOnPinch:B,onPanZoomStart:y,onPanZoom:S,onPanZoomEnd:a}):vC({noWheelClassName:z,preventScrolling:T,d3ZoomHandler:C});if(m.on("wheel.zoom",te,{passive:!1}),!I){const le=yC({zoomPanValues:_,onDraggingChange:l,onPanZoomStart:y});c.on("start",le);const pe=wC({zoomPanValues:_,panOnDrag:U,onPaneContextMenu:!!N,onPanZoom:S,onTransformChange:ie});c.on("zoom",pe);const Se=SC({zoomPanValues:_,panOnDrag:U,panOnScroll:q,onPaneContextMenu:N,onPanZoomEnd:a,onDraggingChange:l});c.on("end",Se)}const ce=CC({zoomActivationKeyPressed:G,panOnDrag:U,zoomOnScroll:P,panOnScroll:q,zoomOnDoubleClick:F,zoomOnPinch:B,userSelectionActive:I,noPanClassName:j,noWheelClassName:z,lib:Z,connectionInProgress:ae});c.filter(ce),F?m.on("dblclick.zoom",b):m.on("dblclick.zoom",null)}function p(){c.on("zoom",null)}async function d(z,j,N){const I=Qc(z),q=c==null?void 0:c.constrain()(I,j,N);return q&&await x(q),new Promise(U=>U(q))}async function u(z,j){const N=Qc(z);return await x(N,j),new Promise(I=>I(N))}function w(z){if(m){const j=Qc(z),N=m.property("__zoom");(N.k!==z.zoom||N.x!==z.x||N.y!==z.y)&&(c==null||c.transform(m,j,null,{sync:!0}))}}function L(){const z=m?V_(m.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}function R(z,j){return m?new Promise(N=>{c==null||c.interpolate((j==null?void 0:j.interpolate)==="linear"?_s:pa).scaleTo(Jc(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>N(!0)),z)}):Promise.resolve(!1)}function D(z,j){return m?new Promise(N=>{c==null||c.interpolate((j==null?void 0:j.interpolate)==="linear"?_s:pa).scaleBy(Jc(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>N(!0)),z)}):Promise.resolve(!1)}function k(z){c==null||c.scaleExtent(z)}function M(z){c==null||c.translateExtent(z)}function W(z){const j=!Zt(z)||z<0?0:z;c==null||c.clickDistance(j)}return{update:f,destroy:p,setViewport:u,setViewportConstrained:d,getViewport:L,scaleTo:R,scaleBy:D,setScaleExtent:k,setTranslateExtent:M,syncViewport:w,setClickDistance:W}}var _i;(function(e){e.Line="line",e.Handle="handle"})(_i||(_i={}));function bC({width:e,prevWidth:r,height:i,prevHeight:o,affectsX:h,affectsY:S}){const y=e-r,a=i-o,l=[y>0?1:y<0?-1:0,a>0?1:a<0?-1:0];return y&&h&&(l[0]=l[0]*-1),a&&S&&(l[1]=l[1]*-1),l}function Cp(e){const r=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),o=e.includes("left"),h=e.includes("top");return{isHorizontal:r,isVertical:i,affectsX:o,affectsY:h}}function Yr(e,r){return Math.max(0,r-e)}function Gr(e,r){return Math.max(0,e-r)}function sa(e,r,i){return Math.max(0,r-e,e-i)}function xp(e,r){return e?!r:r}function EC(e,r,i,o,h,S,y,a){let{affectsX:l,affectsY:_}=r;const{isHorizontal:v,isVertical:c}=r,m=v&&c,{xSnapped:C,ySnapped:b}=i,{minWidth:x,maxWidth:f,minHeight:p,maxHeight:d}=o,{x:u,y:w,width:L,height:R,aspectRatio:D}=e;let k=Math.floor(v?C-e.pointerX:0),M=Math.floor(c?b-e.pointerY:0);const W=L+(l?-k:k),z=R+(_?-M:M),j=-S[0]*L,N=-S[1]*R;let I=sa(W,x,f),q=sa(z,p,d);if(y){let V=0,T=0;l&&k<0?V=Yr(u+k+j,y[0][0]):!l&&k>0&&(V=Gr(u+W+j,y[1][0])),_&&M<0?T=Yr(w+M+N,y[0][1]):!_&&M>0&&(T=Gr(w+z+N,y[1][1])),I=Math.max(I,V),q=Math.max(q,T)}if(a){let V=0,T=0;l&&k>0?V=Gr(u+k,a[0][0]):!l&&k<0&&(V=Yr(u+W,a[1][0])),_&&M>0?T=Gr(w+M,a[0][1]):!_&&M<0&&(T=Yr(w+z,a[1][1])),I=Math.max(I,V),q=Math.max(q,T)}if(h){if(v){const V=sa(W/D,p,d)*D;if(I=Math.max(I,V),y){let T=0;!l&&!_||l&&!_&&m?T=Gr(w+N+W/D,y[1][1])*D:T=Yr(w+N+(l?k:-k)/D,y[0][1])*D,I=Math.max(I,T)}if(a){let T=0;!l&&!_||l&&!_&&m?T=Yr(w+W/D,a[1][1])*D:T=Gr(w+(l?k:-k)/D,a[0][1])*D,I=Math.max(I,T)}}if(c){const V=sa(z*D,x,f)/D;if(q=Math.max(q,V),y){let T=0;!l&&!_||_&&!l&&m?T=Gr(u+z*D+j,y[1][0])/D:T=Yr(u+(_?M:-M)*D+j,y[0][0])/D,q=Math.max(q,T)}if(a){let T=0;!l&&!_||_&&!l&&m?T=Yr(u+z*D,a[1][0])/D:T=Gr(u+(_?M:-M)*D,a[0][0])/D,q=Math.max(q,T)}}}M=M+(M<0?q:-q),k=k+(k<0?I:-I),h&&(m?W>z*D?M=(xp(l,_)?-k:k)/D:k=(xp(l,_)?-M:M)*D:v?(M=k/D,_=l):(k=M*D,l=_));const U=l?u+k:u,K=_?w+M:w;return{width:L+(l?-k:k),height:R+(_?-M:M),x:S[0]*k*(l?-1:1)+U,y:S[1]*M*(_?-1:1)+K}}const Sg={width:0,height:0,x:0,y:0},kC={...Sg,pointerX:0,pointerY:0,aspectRatio:1};function LC(e){return[[0,0],[e.measured.width,e.measured.height]]}function RC(e,r,i){const o=r.position.x+e.position.x,h=r.position.y+e.position.y,S=e.measured.width??0,y=e.measured.height??0,a=i[0]*S,l=i[1]*y;return[[o-a,h-l],[o+S-a,h+y-l]]}function DC({domNode:e,nodeId:r,getStoreItems:i,onChange:o,onEnd:h}){const S=Nt(e);let y={controlDirection:Cp("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:_,boundaries:v,keepAspectRatio:c,resizeDirection:m,onResizeStart:C,onResize:b,onResizeEnd:x,shouldResize:f}){let p={...Sg},d={...kC};y={boundaries:v,resizeDirection:m,keepAspectRatio:c,controlDirection:Cp(_)};let u,w=null,L=[],R,D,k,M=!1;const W=T_().on("start",z=>{const{nodeLookup:j,transform:N,snapGrid:I,snapToGrid:q,nodeOrigin:U,paneDomNode:K}=i();if(u=j.get(r),!u)return;w=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:V,ySnapped:T}=gs(z.sourceEvent,{transform:N,snapGrid:I,snapToGrid:q,containerBounds:w});p={width:u.measured.width??0,height:u.measured.height??0,x:u.position.x??0,y:u.position.y??0},d={...p,pointerX:V,pointerY:T,aspectRatio:p.width/p.height},R=void 0,u.parentId&&(u.extent==="parent"||u.expandParent)&&(R=j.get(u.parentId),D=R&&u.extent==="parent"?LC(R):void 0),L=[],k=void 0;for(const[B,P]of j)if(P.parentId===r&&(L.push({id:B,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const F=RC(P,u,P.origin??U);k?k=[[Math.min(F[0][0],k[0][0]),Math.min(F[0][1],k[0][1])],[Math.max(F[1][0],k[1][0]),Math.max(F[1][1],k[1][1])]]:k=F}C==null||C(z,{...p})}).on("drag",z=>{const{transform:j,snapGrid:N,snapToGrid:I,nodeOrigin:q}=i(),U=gs(z.sourceEvent,{transform:j,snapGrid:N,snapToGrid:I,containerBounds:w}),K=[];if(!u)return;const{x:V,y:T,width:B,height:P}=p,F={},G=u.origin??q,{width:Z,height:ie,x:ae,y:X}=EC(d,y.controlDirection,U,y.boundaries,y.keepAspectRatio,G,D,k),H=Z!==B,re=ie!==P,te=ae!==V&&H,ce=X!==T&&re;if(!te&&!ce&&!H&&!re)return;if((te||ce||G[0]===1||G[1]===1)&&(F.x=te?ae:p.x,F.y=ce?X:p.y,p.x=F.x,p.y=F.y,L.length>0)){const be=ae-V,ue=X-T;for(const ge of L)ge.position={x:ge.position.x-be+G[0]*(Z-B),y:ge.position.y-ue+G[1]*(ie-P)},K.push(ge)}if((H||re)&&(F.width=H&&(!y.resizeDirection||y.resizeDirection==="horizontal")?Z:p.width,F.height=re&&(!y.resizeDirection||y.resizeDirection==="vertical")?ie:p.height,p.width=F.width,p.height=F.height),R&&u.expandParent){const be=G[0]*(F.width??0);F.x&&F.x<be&&(p.x=be,d.x=d.x-(F.x-be));const ue=G[1]*(F.height??0);F.y&&F.y<ue&&(p.y=ue,d.y=d.y-(F.y-ue))}const le=bC({width:p.width,prevWidth:B,height:p.height,prevHeight:P,affectsX:y.controlDirection.affectsX,affectsY:y.controlDirection.affectsY}),pe={...p,direction:le};(f==null?void 0:f(z,pe))!==!1&&(M=!0,b==null||b(z,pe),o(F,K))}).on("end",z=>{M&&(x==null||x(z,{...p}),h==null||h({...p}),M=!1)});S.call(W)}function l(){S.on(".drag",null)}return{update:a,destroy:l}}var Zc={exports:{}},eu={},tu={exports:{}},ru={};/**
|
|
40
|
+
`+A.stack}return{value:t,source:n,stack:E,digest:null}}function lc(t,n,s){return{value:t,source:null,stack:s??null,digest:n??null}}function cc(t,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var S0=typeof WeakMap=="function"?WeakMap:Map;function jd(t,n,s){s=wr(-1,s),s.tag=3,s.payload={element:null};var g=n.value;return s.callback=function(){Io||(Io=!0,bc=g),cc(t,n)},s}function zd(t,n,s){s=wr(-1,s),s.tag=3;var g=t.type.getDerivedStateFromError;if(typeof g=="function"){var E=n.value;s.payload=function(){return g(E)},s.callback=function(){cc(t,n)}}var A=t.stateNode;return A!==null&&typeof A.componentDidCatch=="function"&&(s.callback=function(){cc(t,n),typeof g!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var $=n.stack;this.componentDidCatch(n.value,{componentStack:$!==null?$:""})}),s}function $d(t,n,s){var g=t.pingCache;if(g===null){g=t.pingCache=new S0;var E=new Set;g.set(n,E)}else E=g.get(n),E===void 0&&(E=new Set,g.set(n,E));E.has(s)||(E.add(s),t=B0.bind(null,t,n,s),n.then(t,t))}function Wd(t){do{var n;if((n=t.tag===13)&&(n=t.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return t;t=t.return}while(t!==null);return null}function Ud(t,n,s,g,E){return(t.mode&1)===0?(t===n?t.flags|=65536:(t.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(n=wr(-1,1),n.tag=2,$r(s,n,1))),s.lanes|=1),t):(t.flags|=65536,t.lanes=E,t)}var C0=w.ReactCurrentOwner,xt=!1;function yt(t,n,s,g){n.child=t===null?ud(n,null,s,g):Yn(n,t.child,s,g)}function Vd(t,n,s,g,E){s=s.render;var A=n.ref;return Qn(n,E),g=ec(t,n,s,g,A,E),s=tc(),t!==null&&!xt?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~E,Sr(t,n,E)):(We&&s&&Ol(n),n.flags|=1,yt(t,n,g,E),n.child)}function qd(t,n,s,g,E){if(t===null){var A=s.type;return typeof A=="function"&&!Tc(A)&&A.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=A,Kd(t,n,A,g,E)):(t=$o(s.type,null,g,n,n.mode,E),t.ref=n.ref,t.return=n,n.child=t)}if(A=t.child,(t.lanes&E)===0){var $=A.memoizedProps;if(s=s.compare,s=s!==null?s:zi,s($,g)&&t.ref===n.ref)return Sr(t,n,E)}return n.flags|=1,t=Xr(A,g),t.ref=n.ref,t.return=n,n.child=t}function Kd(t,n,s,g,E){if(t!==null){var A=t.memoizedProps;if(zi(A,g)&&t.ref===n.ref)if(xt=!1,n.pendingProps=g=A,(t.lanes&E)!==0)(t.flags&131072)!==0&&(xt=!0);else return n.lanes=t.lanes,Sr(t,n,E)}return uc(t,n,s,g,E)}function Xd(t,n,s){var g=n.pendingProps,E=g.children,A=t!==null?t.memoizedState:null;if(g.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},He(ti,Pt),Pt|=s;else{if((s&1073741824)===0)return t=A!==null?A.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:t,cachePool:null,transitions:null},n.updateQueue=null,He(ti,Pt),Pt|=t,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=A!==null?A.baseLanes:s,He(ti,Pt),Pt|=g}else A!==null?(g=A.baseLanes|s,n.memoizedState=null):g=s,He(ti,Pt),Pt|=g;return yt(t,n,E,s),n.child}function Yd(t,n){var s=n.ref;(t===null&&s!==null||t!==null&&t.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function uc(t,n,s,g,E){var A=Ct(s)?cn:_t.current;return A=Vn(n,A),Qn(n,E),s=ec(t,n,s,g,A,E),g=tc(),t!==null&&!xt?(n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~E,Sr(t,n,E)):(We&&g&&Ol(n),n.flags|=1,yt(t,n,s,E),n.child)}function Gd(t,n,s,g,E){if(Ct(s)){var A=!0;fo(n)}else A=!1;if(Qn(n,E),n.stateNode===null)To(t,n),Hd(n,s,g),ac(n,s,g,E),g=!0;else if(t===null){var $=n.stateNode,Y=n.memoizedProps;$.props=Y;var Q=$.context,oe=s.contextType;typeof oe=="object"&&oe!==null?oe=Ft(oe):(oe=Ct(s)?cn:_t.current,oe=Vn(n,oe));var de=s.getDerivedStateFromProps,fe=typeof de=="function"||typeof $.getSnapshotBeforeUpdate=="function";fe||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Y!==g||Q!==oe)&&Fd(n,$,g,oe),zr=!1;var he=n.memoizedState;$.state=he,Co(n,g,$,E),Q=n.memoizedState,Y!==g||he!==Q||St.current||zr?(typeof de=="function"&&(oc(n,s,de,g),Q=n.memoizedState),(Y=zr||Od(n,s,Y,g,he,Q,oe))?(fe||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(n.flags|=4194308)):(typeof $.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=g,n.memoizedState=Q),$.props=g,$.state=Q,$.context=oe,g=Y):(typeof $.componentDidMount=="function"&&(n.flags|=4194308),g=!1)}else{$=n.stateNode,dd(t,n),Y=n.memoizedProps,oe=n.type===n.elementType?Y:qt(n.type,Y),$.props=oe,fe=n.pendingProps,he=$.context,Q=s.contextType,typeof Q=="object"&&Q!==null?Q=Ft(Q):(Q=Ct(s)?cn:_t.current,Q=Vn(n,Q));var me=s.getDerivedStateFromProps;(de=typeof me=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(Y!==fe||he!==Q)&&Fd(n,$,g,Q),zr=!1,he=n.memoizedState,$.state=he,Co(n,g,$,E);var ye=n.memoizedState;Y!==fe||he!==ye||St.current||zr?(typeof me=="function"&&(oc(n,s,me,g),ye=n.memoizedState),(oe=zr||Od(n,s,oe,g,he,ye,Q)||!1)?(de||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(g,ye,Q),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(g,ye,Q)),typeof $.componentDidUpdate=="function"&&(n.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof $.componentDidUpdate!="function"||Y===t.memoizedProps&&he===t.memoizedState||(n.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Y===t.memoizedProps&&he===t.memoizedState||(n.flags|=1024),n.memoizedProps=g,n.memoizedState=ye),$.props=g,$.state=ye,$.context=Q,g=oe):(typeof $.componentDidUpdate!="function"||Y===t.memoizedProps&&he===t.memoizedState||(n.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||Y===t.memoizedProps&&he===t.memoizedState||(n.flags|=1024),g=!1)}return hc(t,n,s,g,A,E)}function hc(t,n,s,g,E,A){Yd(t,n);var $=(n.flags&128)!==0;if(!g&&!$)return E&&td(n,s,!1),Sr(t,n,A);g=n.stateNode,C0.current=n;var Y=$&&typeof s.getDerivedStateFromError!="function"?null:g.render();return n.flags|=1,t!==null&&$?(n.child=Yn(n,t.child,null,A),n.child=Yn(n,null,Y,A)):yt(t,n,Y,A),n.memoizedState=g.state,E&&td(n,s,!0),n.child}function Qd(t){var n=t.stateNode;n.pendingContext?Zh(t,n.pendingContext,n.pendingContext!==n.context):n.context&&Zh(t,n.context,!1),Xl(t,n.containerInfo)}function Jd(t,n,s,g,E){return Xn(),zl(E),n.flags|=256,yt(t,n,s,g),n.child}var dc={dehydrated:null,treeContext:null,retryLane:0};function fc(t){return{baseLanes:t,cachePool:null,transitions:null}}function Zd(t,n,s){var g=n.pendingProps,E=Xe.current,A=!1,$=(n.flags&128)!==0,Y;if((Y=$)||(Y=t!==null&&t.memoizedState===null?!1:(E&2)!==0),Y?(A=!0,n.flags&=-129):(t===null||t.memoizedState!==null)&&(E|=1),He(Xe,E&1),t===null)return jl(n),t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((n.mode&1)===0?n.lanes=1:t.data==="$!"?n.lanes=8:n.lanes=1073741824,null):($=g.children,t=g.fallback,A?(g=n.mode,A=n.child,$={mode:"hidden",children:$},(g&1)===0&&A!==null?(A.childLanes=0,A.pendingProps=$):A=Wo($,g,0,null),t=yn(t,g,s,null),A.return=n,t.return=n,A.sibling=t,n.child=A,n.child.memoizedState=fc(s),n.memoizedState=dc,t):pc(n,$));if(E=t.memoizedState,E!==null&&(Y=E.dehydrated,Y!==null))return x0(t,n,$,g,Y,E,s);if(A){A=g.fallback,$=n.mode,E=t.child,Y=E.sibling;var Q={mode:"hidden",children:g.children};return($&1)===0&&n.child!==E?(g=n.child,g.childLanes=0,g.pendingProps=Q,n.deletions=null):(g=Xr(E,Q),g.subtreeFlags=E.subtreeFlags&14680064),Y!==null?A=Xr(Y,A):(A=yn(A,$,s,null),A.flags|=2),A.return=n,g.return=n,g.sibling=A,n.child=g,g=A,A=n.child,$=t.child.memoizedState,$=$===null?fc(s):{baseLanes:$.baseLanes|s,cachePool:null,transitions:$.transitions},A.memoizedState=$,A.childLanes=t.childLanes&~s,n.memoizedState=dc,g}return A=t.child,t=A.sibling,g=Xr(A,{mode:"visible",children:g.children}),(n.mode&1)===0&&(g.lanes=s),g.return=n,g.sibling=null,t!==null&&(s=n.deletions,s===null?(n.deletions=[t],n.flags|=16):s.push(t)),n.child=g,n.memoizedState=null,g}function pc(t,n){return n=Wo({mode:"visible",children:n},t.mode,0,null),n.return=t,t.child=n}function Ao(t,n,s,g){return g!==null&&zl(g),Yn(n,t.child,null,s),t=pc(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function x0(t,n,s,g,E,A,$){if(s)return n.flags&256?(n.flags&=-257,g=lc(Error(i(422))),Ao(t,n,$,g)):n.memoizedState!==null?(n.child=t.child,n.flags|=128,null):(A=g.fallback,E=n.mode,g=Wo({mode:"visible",children:g.children},E,0,null),A=yn(A,E,$,null),A.flags|=2,g.return=n,A.return=n,g.sibling=A,n.child=g,(n.mode&1)!==0&&Yn(n,t.child,null,$),n.child.memoizedState=fc($),n.memoizedState=dc,A);if((n.mode&1)===0)return Ao(t,n,$,null);if(E.data==="$!"){if(g=E.nextSibling&&E.nextSibling.dataset,g)var Y=g.dgst;return g=Y,A=Error(i(419)),g=lc(A,g,void 0),Ao(t,n,$,g)}if(Y=($&t.childLanes)!==0,xt||Y){if(g=lt,g!==null){switch($&-$){case 4:E=2;break;case 16:E=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:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(g.suspendedLanes|$))!==0?0:E,E!==0&&E!==A.retryLane&&(A.retryLane=E,yr(t,E),Yt(g,t,E,-1))}return Ac(),g=lc(Error(i(421))),Ao(t,n,$,g)}return E.data==="$?"?(n.flags|=128,n.child=t.child,n=I0.bind(null,t),E._reactRetry=n,null):(t=A.treeContext,Mt=Or(E.nextSibling),Tt=n,We=!0,Vt=null,t!==null&&(Ot[Ht++]=mr,Ot[Ht++]=vr,Ot[Ht++]=un,mr=t.id,vr=t.overflow,un=n),n=pc(n,g.children),n.flags|=4096,n)}function ef(t,n,s){t.lanes|=n;var g=t.alternate;g!==null&&(g.lanes|=n),Vl(t.return,n,s)}function _c(t,n,s,g,E){var A=t.memoizedState;A===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:g,tail:s,tailMode:E}:(A.isBackwards=n,A.rendering=null,A.renderingStartTime=0,A.last=g,A.tail=s,A.tailMode=E)}function tf(t,n,s){var g=n.pendingProps,E=g.revealOrder,A=g.tail;if(yt(t,n,g.children,s),g=Xe.current,(g&2)!==0)g=g&1|2,n.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ef(t,s,n);else if(t.tag===19)ef(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}g&=1}if(He(Xe,g),(n.mode&1)===0)n.memoizedState=null;else switch(E){case"forwards":for(s=n.child,E=null;s!==null;)t=s.alternate,t!==null&&xo(t)===null&&(E=s),s=s.sibling;s=E,s===null?(E=n.child,n.child=null):(E=s.sibling,s.sibling=null),_c(n,!1,E,s,A);break;case"backwards":for(s=null,E=n.child,n.child=null;E!==null;){if(t=E.alternate,t!==null&&xo(t)===null){n.child=E;break}t=E.sibling,E.sibling=s,s=E,E=t}_c(n,!0,s,null,A);break;case"together":_c(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function To(t,n){(n.mode&1)===0&&t!==null&&(t.alternate=null,n.alternate=null,n.flags|=2)}function Sr(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),_n|=n.lanes,(s&n.childLanes)===0)return null;if(t!==null&&n.child!==t.child)throw Error(i(153));if(n.child!==null){for(t=n.child,s=Xr(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=Xr(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function b0(t,n,s){switch(n.tag){case 3:Qd(n),Xn();break;case 5:_d(n);break;case 1:Ct(n.type)&&fo(n);break;case 4:Xl(n,n.stateNode.containerInfo);break;case 10:var g=n.type._context,E=n.memoizedProps.value;He(yo,g._currentValue),g._currentValue=E;break;case 13:if(g=n.memoizedState,g!==null)return g.dehydrated!==null?(He(Xe,Xe.current&1),n.flags|=128,null):(s&n.child.childLanes)!==0?Zd(t,n,s):(He(Xe,Xe.current&1),t=Sr(t,n,s),t!==null?t.sibling:null);He(Xe,Xe.current&1);break;case 19:if(g=(s&n.childLanes)!==0,(t.flags&128)!==0){if(g)return tf(t,n,s);n.flags|=128}if(E=n.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),He(Xe,Xe.current),g)break;return null;case 22:case 23:return n.lanes=0,Xd(t,n,s)}return Sr(t,n,s)}var rf,gc,nf,sf;rf=function(t,n){for(var s=n.child;s!==null;){if(s.tag===5||s.tag===6)t.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},gc=function(){},nf=function(t,n,s,g){var E=t.memoizedProps;if(E!==g){t=n.stateNode,fn(sr.current);var A=null;switch(s){case"input":E=Se(t,E),g=Se(t,g),A=[];break;case"select":E=B({},E,{value:void 0}),g=B({},g,{value:void 0}),A=[];break;case"textarea":E=ut(t,E),g=ut(t,g),A=[];break;default:typeof E.onClick!="function"&&typeof g.onClick=="function"&&(t.onclick=co)}vi(s,g);var $;s=null;for(oe in E)if(!g.hasOwnProperty(oe)&&E.hasOwnProperty(oe)&&E[oe]!=null)if(oe==="style"){var Y=E[oe];for($ in Y)Y.hasOwnProperty($)&&(s||(s={}),s[$]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(h.hasOwnProperty(oe)?A||(A=[]):(A=A||[]).push(oe,null));for(oe in g){var Q=g[oe];if(Y=E!=null?E[oe]:void 0,g.hasOwnProperty(oe)&&Q!==Y&&(Q!=null||Y!=null))if(oe==="style")if(Y){for($ in Y)!Y.hasOwnProperty($)||Q&&Q.hasOwnProperty($)||(s||(s={}),s[$]="");for($ in Q)Q.hasOwnProperty($)&&Y[$]!==Q[$]&&(s||(s={}),s[$]=Q[$])}else s||(A||(A=[]),A.push(oe,s)),s=Q;else oe==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Y=Y?Y.__html:void 0,Q!=null&&Y!==Q&&(A=A||[]).push(oe,Q)):oe==="children"?typeof Q!="string"&&typeof Q!="number"||(A=A||[]).push(oe,""+Q):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(h.hasOwnProperty(oe)?(Q!=null&&oe==="onScroll"&&Fe("scroll",t),A||Y===Q||(A=[])):(A=A||[]).push(oe,Q))}s&&(A=A||[]).push("style",s);var oe=A;(n.updateQueue=oe)&&(n.flags|=4)}},sf=function(t,n,s,g){s!==g&&(n.flags|=4)};function rs(t,n){if(!We)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var g=null;s!==null;)s.alternate!==null&&(g=s),s=s.sibling;g===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:g.sibling=null}}function mt(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,g=0;if(n)for(var E=t.child;E!==null;)s|=E.lanes|E.childLanes,g|=E.subtreeFlags&14680064,g|=E.flags&14680064,E.return=t,E=E.sibling;else for(E=t.child;E!==null;)s|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=t,E=E.sibling;return t.subtreeFlags|=g,t.childLanes=s,n}function E0(t,n,s){var g=n.pendingProps;switch(Hl(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(n),null;case 1:return Ct(n.type)&&ho(),mt(n),null;case 3:return g=n.stateNode,Jn(),je(St),je(_t),Ql(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(t===null||t.child===null)&&(mo(n)?n.flags|=4:t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Vt!==null&&(Lc(Vt),Vt=null))),gc(t,n),mt(n),null;case 5:Yl(n);var E=fn(Qi.current);if(s=n.type,t!==null&&n.stateNode!=null)nf(t,n,s,g,E),t.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!g){if(n.stateNode===null)throw Error(i(166));return mt(n),null}if(t=fn(sr.current),mo(n)){g=n.stateNode,s=n.type;var A=n.memoizedProps;switch(g[ir]=n,g[qi]=A,t=(n.mode&1)!==0,s){case"dialog":Fe("cancel",g),Fe("close",g);break;case"iframe":case"object":case"embed":Fe("load",g);break;case"video":case"audio":for(E=0;E<Wi.length;E++)Fe(Wi[E],g);break;case"source":Fe("error",g);break;case"img":case"image":case"link":Fe("error",g),Fe("load",g);break;case"details":Fe("toggle",g);break;case"input":be(g,A),Fe("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!A.multiple},Fe("invalid",g);break;case"textarea":qe(g,A),Fe("invalid",g)}vi(s,A),E=null;for(var $ in A)if(A.hasOwnProperty($)){var Y=A[$];$==="children"?typeof Y=="string"?g.textContent!==Y&&(A.suppressHydrationWarning!==!0&&lo(g.textContent,Y,t),E=["children",Y]):typeof Y=="number"&&g.textContent!==""+Y&&(A.suppressHydrationWarning!==!0&&lo(g.textContent,Y,t),E=["children",""+Y]):h.hasOwnProperty($)&&Y!=null&&$==="onScroll"&&Fe("scroll",g)}switch(s){case"input":ce(g),Re(g,A,!0);break;case"textarea":ce(g),Ne(g);break;case"select":case"option":break;default:typeof A.onClick=="function"&&(g.onclick=co)}g=E,n.updateQueue=g,g!==null&&(n.flags|=4)}else{$=E.nodeType===9?E:E.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Je(s)),t==="http://www.w3.org/1999/xhtml"?s==="script"?(t=$.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof g.is=="string"?t=$.createElement(s,{is:g.is}):(t=$.createElement(s),s==="select"&&($=t,g.multiple?$.multiple=!0:g.size&&($.size=g.size))):t=$.createElementNS(t,s),t[ir]=n,t[qi]=g,rf(t,n,!1,!1),n.stateNode=t;e:{switch($=yi(s,g),s){case"dialog":Fe("cancel",t),Fe("close",t),E=g;break;case"iframe":case"object":case"embed":Fe("load",t),E=g;break;case"video":case"audio":for(E=0;E<Wi.length;E++)Fe(Wi[E],t);E=g;break;case"source":Fe("error",t),E=g;break;case"img":case"image":case"link":Fe("error",t),Fe("load",t),E=g;break;case"details":Fe("toggle",t),E=g;break;case"input":be(t,g),E=Se(t,g),Fe("invalid",t);break;case"option":E=g;break;case"select":t._wrapperState={wasMultiple:!!g.multiple},E=B({},g,{value:void 0}),Fe("invalid",t);break;case"textarea":qe(t,g),E=ut(t,g),Fe("invalid",t);break;default:E=g}vi(s,E),Y=E;for(A in Y)if(Y.hasOwnProperty(A)){var Q=Y[A];A==="style"?Ps(t,Q):A==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Q!=null&&pr(t,Q)):A==="children"?typeof Q=="string"?(s!=="textarea"||Q!=="")&&ot(t,Q):typeof Q=="number"&&ot(t,""+Q):A!=="suppressContentEditableWarning"&&A!=="suppressHydrationWarning"&&A!=="autoFocus"&&(h.hasOwnProperty(A)?Q!=null&&A==="onScroll"&&Fe("scroll",t):Q!=null&&u(t,A,Q,$))}switch(s){case"input":ce(t),Re(t,g,!1);break;case"textarea":ce(t),Ne(t);break;case"option":g.value!=null&&t.setAttribute("value",""+H(g.value));break;case"select":t.multiple=!!g.multiple,A=g.value,A!=null?Qe(t,!!g.multiple,A,!1):g.defaultValue!=null&&Qe(t,!!g.multiple,g.defaultValue,!0);break;default:typeof E.onClick=="function"&&(t.onclick=co)}switch(s){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return mt(n),null;case 6:if(t&&n.stateNode!=null)sf(t,n,t.memoizedProps,g);else{if(typeof g!="string"&&n.stateNode===null)throw Error(i(166));if(s=fn(Qi.current),fn(sr.current),mo(n)){if(g=n.stateNode,s=n.memoizedProps,g[ir]=n,(A=g.nodeValue!==s)&&(t=Tt,t!==null))switch(t.tag){case 3:lo(g.nodeValue,s,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&lo(g.nodeValue,s,(t.mode&1)!==0)}A&&(n.flags|=4)}else g=(s.nodeType===9?s:s.ownerDocument).createTextNode(g),g[ir]=n,n.stateNode=g}return mt(n),null;case 13:if(je(Xe),g=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(We&&Mt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)ad(),Xn(),n.flags|=98560,A=!1;else if(A=mo(n),g!==null&&g.dehydrated!==null){if(t===null){if(!A)throw Error(i(318));if(A=n.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(i(317));A[ir]=n}else Xn(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;mt(n),A=!1}else Vt!==null&&(Lc(Vt),Vt=null),A=!0;if(!A)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=s,n):(g=g!==null,g!==(t!==null&&t.memoizedState!==null)&&g&&(n.child.flags|=8192,(n.mode&1)!==0&&(t===null||(Xe.current&1)!==0?it===0&&(it=3):Ac())),n.updateQueue!==null&&(n.flags|=4),mt(n),null);case 4:return Jn(),gc(t,n),t===null&&Ui(n.stateNode.containerInfo),mt(n),null;case 10:return Ul(n.type._context),mt(n),null;case 17:return Ct(n.type)&&ho(),mt(n),null;case 19:if(je(Xe),A=n.memoizedState,A===null)return mt(n),null;if(g=(n.flags&128)!==0,$=A.rendering,$===null)if(g)rs(A,!1);else{if(it!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if($=xo(t),$!==null){for(n.flags|=128,rs(A,!1),g=$.updateQueue,g!==null&&(n.updateQueue=g,n.flags|=4),n.subtreeFlags=0,g=s,s=n.child;s!==null;)A=s,t=g,A.flags&=14680066,$=A.alternate,$===null?(A.childLanes=0,A.lanes=t,A.child=null,A.subtreeFlags=0,A.memoizedProps=null,A.memoizedState=null,A.updateQueue=null,A.dependencies=null,A.stateNode=null):(A.childLanes=$.childLanes,A.lanes=$.lanes,A.child=$.child,A.subtreeFlags=0,A.deletions=null,A.memoizedProps=$.memoizedProps,A.memoizedState=$.memoizedState,A.updateQueue=$.updateQueue,A.type=$.type,t=$.dependencies,A.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),s=s.sibling;return He(Xe,Xe.current&1|2),n.child}t=t.sibling}A.tail!==null&&Ke()>ri&&(n.flags|=128,g=!0,rs(A,!1),n.lanes=4194304)}else{if(!g)if(t=xo($),t!==null){if(n.flags|=128,g=!0,s=t.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),rs(A,!0),A.tail===null&&A.tailMode==="hidden"&&!$.alternate&&!We)return mt(n),null}else 2*Ke()-A.renderingStartTime>ri&&s!==1073741824&&(n.flags|=128,g=!0,rs(A,!1),n.lanes=4194304);A.isBackwards?($.sibling=n.child,n.child=$):(s=A.last,s!==null?s.sibling=$:n.child=$,A.last=$)}return A.tail!==null?(n=A.tail,A.rendering=n,A.tail=n.sibling,A.renderingStartTime=Ke(),n.sibling=null,s=Xe.current,He(Xe,g?s&1|2:s&1),n):(mt(n),null);case 22:case 23:return Dc(),g=n.memoizedState!==null,t!==null&&t.memoizedState!==null!==g&&(n.flags|=8192),g&&(n.mode&1)!==0?(Pt&1073741824)!==0&&(mt(n),n.subtreeFlags&6&&(n.flags|=8192)):mt(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function k0(t,n){switch(Hl(n),n.tag){case 1:return Ct(n.type)&&ho(),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Jn(),je(St),je(_t),Ql(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 5:return Yl(n),null;case 13:if(je(Xe),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Xn()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return je(Xe),null;case 4:return Jn(),null;case 10:return Ul(n.type._context),null;case 22:case 23:return Dc(),null;case 24:return null;default:return null}}var Mo=!1,vt=!1,L0=typeof WeakSet=="function"?WeakSet:Set,ve=null;function ei(t,n){var s=t.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(g){Ge(t,n,g)}else s.current=null}function mc(t,n,s){try{s()}catch(g){Ge(t,n,g)}}var of=!1;function R0(t,n){if(Dl=Qs,t=Oh(),Sl(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var g=s.getSelection&&s.getSelection();if(g&&g.rangeCount!==0){s=g.anchorNode;var E=g.anchorOffset,A=g.focusNode;g=g.focusOffset;try{s.nodeType,A.nodeType}catch{s=null;break e}var $=0,Y=-1,Q=-1,oe=0,de=0,fe=t,he=null;t:for(;;){for(var me;fe!==s||E!==0&&fe.nodeType!==3||(Y=$+E),fe!==A||g!==0&&fe.nodeType!==3||(Q=$+g),fe.nodeType===3&&($+=fe.nodeValue.length),(me=fe.firstChild)!==null;)he=fe,fe=me;for(;;){if(fe===t)break t;if(he===s&&++oe===E&&(Y=$),he===A&&++de===g&&(Q=$),(me=fe.nextSibling)!==null)break;fe=he,he=fe.parentNode}fe=me}s=Y===-1||Q===-1?null:{start:Y,end:Q}}else s=null}s=s||{start:0,end:0}}else s=null;for(Al={focusedElem:t,selectionRange:s},Qs=!1,ve=n;ve!==null;)if(n=ve,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,ve=t;else for(;ve!==null;){n=ve;try{var ye=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var we=ye.memoizedProps,Ze=ye.memoizedState,ne=n.stateNode,ee=ne.getSnapshotBeforeUpdate(n.elementType===n.type?we:qt(n.type,we),Ze);ne.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var se=n.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(_e){Ge(n,n.return,_e)}if(t=n.sibling,t!==null){t.return=n.return,ve=t;break}ve=n.return}return ye=of,of=!1,ye}function ns(t,n,s){var g=n.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var E=g=g.next;do{if((E.tag&t)===t){var A=E.destroy;E.destroy=void 0,A!==void 0&&mc(n,s,A)}E=E.next}while(E!==g)}}function Po(t,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&t)===t){var g=s.create;s.destroy=g()}s=s.next}while(s!==n)}}function vc(t){var n=t.ref;if(n!==null){var s=t.stateNode;switch(t.tag){case 5:t=s;break;default:t=s}typeof n=="function"?n(t):n.current=t}}function af(t){var n=t.alternate;n!==null&&(t.alternate=null,af(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&(delete n[ir],delete n[qi],delete n[Nl],delete n[u0],delete n[h0])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function lf(t){return t.tag===5||t.tag===3||t.tag===4}function cf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||lf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function yc(t,n,s){var g=t.tag;if(g===5||g===6)t=t.stateNode,n?s.nodeType===8?s.parentNode.insertBefore(t,n):s.insertBefore(t,n):(s.nodeType===8?(n=s.parentNode,n.insertBefore(t,s)):(n=s,n.appendChild(t)),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=co));else if(g!==4&&(t=t.child,t!==null))for(yc(t,n,s),t=t.sibling;t!==null;)yc(t,n,s),t=t.sibling}function wc(t,n,s){var g=t.tag;if(g===5||g===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(g!==4&&(t=t.child,t!==null))for(wc(t,n,s),t=t.sibling;t!==null;)wc(t,n,s),t=t.sibling}var dt=null,Kt=!1;function Wr(t,n,s){for(s=s.child;s!==null;)uf(t,n,s),s=s.sibling}function uf(t,n,s){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(on,s)}catch{}switch(s.tag){case 5:vt||ei(s,n);case 6:var g=dt,E=Kt;dt=null,Wr(t,n,s),dt=g,Kt=E,dt!==null&&(Kt?(t=dt,s=s.stateNode,t.nodeType===8?t.parentNode.removeChild(s):t.removeChild(s)):dt.removeChild(s.stateNode));break;case 18:dt!==null&&(Kt?(t=dt,s=s.stateNode,t.nodeType===8?Pl(t.parentNode,s):t.nodeType===1&&Pl(t,s),Bi(t)):Pl(dt,s.stateNode));break;case 4:g=dt,E=Kt,dt=s.stateNode.containerInfo,Kt=!0,Wr(t,n,s),dt=g,Kt=E;break;case 0:case 11:case 14:case 15:if(!vt&&(g=s.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){E=g=g.next;do{var A=E,$=A.destroy;A=A.tag,$!==void 0&&((A&2)!==0||(A&4)!==0)&&mc(s,n,$),E=E.next}while(E!==g)}Wr(t,n,s);break;case 1:if(!vt&&(ei(s,n),g=s.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=s.memoizedProps,g.state=s.memoizedState,g.componentWillUnmount()}catch(Y){Ge(s,n,Y)}Wr(t,n,s);break;case 21:Wr(t,n,s);break;case 22:s.mode&1?(vt=(g=vt)||s.memoizedState!==null,Wr(t,n,s),vt=g):Wr(t,n,s);break;default:Wr(t,n,s)}}function hf(t){var n=t.updateQueue;if(n!==null){t.updateQueue=null;var s=t.stateNode;s===null&&(s=t.stateNode=new L0),n.forEach(function(g){var E=O0.bind(null,t,g);s.has(g)||(s.add(g),g.then(E,E))})}}function Xt(t,n){var s=n.deletions;if(s!==null)for(var g=0;g<s.length;g++){var E=s[g];try{var A=t,$=n,Y=$;e:for(;Y!==null;){switch(Y.tag){case 5:dt=Y.stateNode,Kt=!1;break e;case 3:dt=Y.stateNode.containerInfo,Kt=!0;break e;case 4:dt=Y.stateNode.containerInfo,Kt=!0;break e}Y=Y.return}if(dt===null)throw Error(i(160));uf(A,$,E),dt=null,Kt=!1;var Q=E.alternate;Q!==null&&(Q.return=null),E.return=null}catch(oe){Ge(E,n,oe)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)df(n,t),n=n.sibling}function df(t,n){var s=t.alternate,g=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Xt(n,t),ar(t),g&4){try{ns(3,t,t.return),Po(3,t)}catch(we){Ge(t,t.return,we)}try{ns(5,t,t.return)}catch(we){Ge(t,t.return,we)}}break;case 1:Xt(n,t),ar(t),g&512&&s!==null&&ei(s,s.return);break;case 5:if(Xt(n,t),ar(t),g&512&&s!==null&&ei(s,s.return),t.flags&32){var E=t.stateNode;try{ot(E,"")}catch(we){Ge(t,t.return,we)}}if(g&4&&(E=t.stateNode,E!=null)){var A=t.memoizedProps,$=s!==null?s.memoizedProps:A,Y=t.type,Q=t.updateQueue;if(t.updateQueue=null,Q!==null)try{Y==="input"&&A.type==="radio"&&A.name!=null&&ue(E,A),yi(Y,$);var oe=yi(Y,A);for($=0;$<Q.length;$+=2){var de=Q[$],fe=Q[$+1];de==="style"?Ps(E,fe):de==="dangerouslySetInnerHTML"?pr(E,fe):de==="children"?ot(E,fe):u(E,de,fe,oe)}switch(Y){case"input":ge(E,A);break;case"textarea":pt(E,A);break;case"select":var he=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!A.multiple;var me=A.value;me!=null?Qe(E,!!A.multiple,me,!1):he!==!!A.multiple&&(A.defaultValue!=null?Qe(E,!!A.multiple,A.defaultValue,!0):Qe(E,!!A.multiple,A.multiple?[]:"",!1))}E[qi]=A}catch(we){Ge(t,t.return,we)}}break;case 6:if(Xt(n,t),ar(t),g&4){if(t.stateNode===null)throw Error(i(162));E=t.stateNode,A=t.memoizedProps;try{E.nodeValue=A}catch(we){Ge(t,t.return,we)}}break;case 3:if(Xt(n,t),ar(t),g&4&&s!==null&&s.memoizedState.isDehydrated)try{Bi(n.containerInfo)}catch(we){Ge(t,t.return,we)}break;case 4:Xt(n,t),ar(t);break;case 13:Xt(n,t),ar(t),E=t.child,E.flags&8192&&(A=E.memoizedState!==null,E.stateNode.isHidden=A,!A||E.alternate!==null&&E.alternate.memoizedState!==null||(xc=Ke())),g&4&&hf(t);break;case 22:if(de=s!==null&&s.memoizedState!==null,t.mode&1?(vt=(oe=vt)||de,Xt(n,t),vt=oe):Xt(n,t),ar(t),g&8192){if(oe=t.memoizedState!==null,(t.stateNode.isHidden=oe)&&!de&&(t.mode&1)!==0)for(ve=t,de=t.child;de!==null;){for(fe=ve=de;ve!==null;){switch(he=ve,me=he.child,he.tag){case 0:case 11:case 14:case 15:ns(4,he,he.return);break;case 1:ei(he,he.return);var ye=he.stateNode;if(typeof ye.componentWillUnmount=="function"){g=he,s=he.return;try{n=g,ye.props=n.memoizedProps,ye.state=n.memoizedState,ye.componentWillUnmount()}catch(we){Ge(g,s,we)}}break;case 5:ei(he,he.return);break;case 22:if(he.memoizedState!==null){_f(fe);continue}}me!==null?(me.return=he,ve=me):_f(fe)}de=de.sibling}e:for(de=null,fe=t;;){if(fe.tag===5){if(de===null){de=fe;try{E=fe.stateNode,oe?(A=E.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none"):(Y=fe.stateNode,Q=fe.memoizedProps.style,$=Q!=null&&Q.hasOwnProperty("display")?Q.display:null,Y.style.display=Rn("display",$))}catch(we){Ge(t,t.return,we)}}}else if(fe.tag===6){if(de===null)try{fe.stateNode.nodeValue=oe?"":fe.memoizedProps}catch(we){Ge(t,t.return,we)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===t)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===t)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===t)break e;de===fe&&(de=null),fe=fe.return}de===fe&&(de=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:Xt(n,t),ar(t),g&4&&hf(t);break;case 21:break;default:Xt(n,t),ar(t)}}function ar(t){var n=t.flags;if(n&2){try{e:{for(var s=t.return;s!==null;){if(lf(s)){var g=s;break e}s=s.return}throw Error(i(160))}switch(g.tag){case 5:var E=g.stateNode;g.flags&32&&(ot(E,""),g.flags&=-33);var A=cf(t);wc(t,A,E);break;case 3:case 4:var $=g.stateNode.containerInfo,Y=cf(t);yc(t,Y,$);break;default:throw Error(i(161))}}catch(Q){Ge(t,t.return,Q)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function D0(t,n,s){ve=t,ff(t)}function ff(t,n,s){for(var g=(t.mode&1)!==0;ve!==null;){var E=ve,A=E.child;if(E.tag===22&&g){var $=E.memoizedState!==null||Mo;if(!$){var Y=E.alternate,Q=Y!==null&&Y.memoizedState!==null||vt;Y=Mo;var oe=vt;if(Mo=$,(vt=Q)&&!oe)for(ve=E;ve!==null;)$=ve,Q=$.child,$.tag===22&&$.memoizedState!==null?gf(E):Q!==null?(Q.return=$,ve=Q):gf(E);for(;A!==null;)ve=A,ff(A),A=A.sibling;ve=E,Mo=Y,vt=oe}pf(t)}else(E.subtreeFlags&8772)!==0&&A!==null?(A.return=E,ve=A):pf(t)}}function pf(t){for(;ve!==null;){var n=ve;if((n.flags&8772)!==0){var s=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:vt||Po(5,n);break;case 1:var g=n.stateNode;if(n.flags&4&&!vt)if(s===null)g.componentDidMount();else{var E=n.elementType===n.type?s.memoizedProps:qt(n.type,s.memoizedProps);g.componentDidUpdate(E,s.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var A=n.updateQueue;A!==null&&pd(n,A,g);break;case 3:var $=n.updateQueue;if($!==null){if(s=null,n.child!==null)switch(n.child.tag){case 5:s=n.child.stateNode;break;case 1:s=n.child.stateNode}pd(n,$,s)}break;case 5:var Y=n.stateNode;if(s===null&&n.flags&4){s=Y;var Q=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":Q.autoFocus&&s.focus();break;case"img":Q.src&&(s.src=Q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var oe=n.alternate;if(oe!==null){var de=oe.memoizedState;if(de!==null){var fe=de.dehydrated;fe!==null&&Bi(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}vt||n.flags&512&&vc(n)}catch(he){Ge(n,n.return,he)}}if(n===t){ve=null;break}if(s=n.sibling,s!==null){s.return=n.return,ve=s;break}ve=n.return}}function _f(t){for(;ve!==null;){var n=ve;if(n===t){ve=null;break}var s=n.sibling;if(s!==null){s.return=n.return,ve=s;break}ve=n.return}}function gf(t){for(;ve!==null;){var n=ve;try{switch(n.tag){case 0:case 11:case 15:var s=n.return;try{Po(4,n)}catch(Q){Ge(n,s,Q)}break;case 1:var g=n.stateNode;if(typeof g.componentDidMount=="function"){var E=n.return;try{g.componentDidMount()}catch(Q){Ge(n,E,Q)}}var A=n.return;try{vc(n)}catch(Q){Ge(n,A,Q)}break;case 5:var $=n.return;try{vc(n)}catch(Q){Ge(n,$,Q)}}}catch(Q){Ge(n,n.return,Q)}if(n===t){ve=null;break}var Y=n.sibling;if(Y!==null){Y.return=n.return,ve=Y;break}ve=n.return}}var A0=Math.ceil,No=w.ReactCurrentDispatcher,Sc=w.ReactCurrentOwner,zt=w.ReactCurrentBatchConfig,Me=0,lt=null,et=null,ft=0,Pt=0,ti=Hr(0),it=0,is=null,_n=0,Bo=0,Cc=0,ss=null,bt=null,xc=0,ri=1/0,Cr=null,Io=!1,bc=null,Ur=null,Oo=!1,Vr=null,Ho=0,os=0,Ec=null,Fo=-1,jo=0;function wt(){return(Me&6)!==0?Ke():Fo!==-1?Fo:Fo=Ke()}function qr(t){return(t.mode&1)===0?1:(Me&2)!==0&&ft!==0?ft&-ft:f0.transition!==null?(jo===0&&(jo=Bn()),jo):(t=Be,t!==0||(t=window.event,t=t===void 0?16:mh(t.type)),t)}function Yt(t,n,s,g){if(50<os)throw os=0,Ec=null,Error(i(185));an(t,s,g),((Me&2)===0||t!==lt)&&(t===lt&&((Me&2)===0&&(Bo|=s),it===4&&Kr(t,ft)),Et(t,g),s===1&&Me===0&&(n.mode&1)===0&&(ri=Ke()+500,po&&jr()))}function Et(t,n){var s=t.callbackNode;ol(t,n);var g=Nn(t,t===lt?ft:0);if(g===0)s!==null&&Ws(s),t.callbackNode=null,t.callbackPriority=0;else if(n=g&-g,t.callbackPriority!==n){if(s!=null&&Ws(s),n===1)t.tag===0?d0(vf.bind(null,t)):rd(vf.bind(null,t)),l0(function(){(Me&6)===0&&jr()}),s=null;else{switch(ch(g)){case 1:s=Ri;break;case 4:s=Vs;break;case 16:s=Tn;break;case 536870912:s=qs;break;default:s=Tn}s=kf(s,mf.bind(null,t))}t.callbackPriority=n,t.callbackNode=s}}function mf(t,n){if(Fo=-1,jo=0,(Me&6)!==0)throw Error(i(327));var s=t.callbackNode;if(ni()&&t.callbackNode!==s)return null;var g=Nn(t,t===lt?ft:0);if(g===0)return null;if((g&30)!==0||(g&t.expiredLanes)!==0||n)n=zo(t,g);else{n=g;var E=Me;Me|=2;var A=wf();(lt!==t||ft!==n)&&(Cr=null,ri=Ke()+500,mn(t,n));do try{P0();break}catch(Y){yf(t,Y)}while(!0);Wl(),No.current=A,Me=E,et!==null?n=0:(lt=null,ft=0,n=it)}if(n!==0){if(n===2&&(E=Di(t),E!==0&&(g=E,n=kc(t,E))),n===1)throw s=is,mn(t,0),Kr(t,g),Et(t,Ke()),s;if(n===6)Kr(t,g);else{if(E=t.current.alternate,(g&30)===0&&!T0(E)&&(n=zo(t,g),n===2&&(A=Di(t),A!==0&&(g=A,n=kc(t,A))),n===1))throw s=is,mn(t,0),Kr(t,g),Et(t,Ke()),s;switch(t.finishedWork=E,t.finishedLanes=g,n){case 0:case 1:throw Error(i(345));case 2:vn(t,bt,Cr);break;case 3:if(Kr(t,g),(g&130023424)===g&&(n=xc+500-Ke(),10<n)){if(Nn(t,0)!==0)break;if(E=t.suspendedLanes,(E&g)!==g){wt(),t.pingedLanes|=t.suspendedLanes&E;break}t.timeoutHandle=Ml(vn.bind(null,t,bt,Cr),n);break}vn(t,bt,Cr);break;case 4:if(Kr(t,g),(g&4194240)===g)break;for(n=t.eventTimes,E=-1;0<g;){var $=31-Dt(g);A=1<<$,$=n[$],$>E&&(E=$),g&=~A}if(g=E,g=Ke()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*A0(g/1960))-g,10<g){t.timeoutHandle=Ml(vn.bind(null,t,bt,Cr),g);break}vn(t,bt,Cr);break;case 5:vn(t,bt,Cr);break;default:throw Error(i(329))}}}return Et(t,Ke()),t.callbackNode===s?mf.bind(null,t):null}function kc(t,n){var s=ss;return t.current.memoizedState.isDehydrated&&(mn(t,n).flags|=256),t=zo(t,n),t!==2&&(n=bt,bt=s,n!==null&&Lc(n)),t}function Lc(t){bt===null?bt=t:bt.push.apply(bt,t)}function T0(t){for(var n=t;;){if(n.flags&16384){var s=n.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var g=0;g<s.length;g++){var E=s[g],A=E.getSnapshot;E=E.value;try{if(!Ut(A(),E))return!1}catch{return!1}}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Kr(t,n){for(n&=~Cc,n&=~Bo,t.suspendedLanes|=n,t.pingedLanes&=~n,t=t.expirationTimes;0<n;){var s=31-Dt(n),g=1<<s;t[s]=-1,n&=~g}}function vf(t){if((Me&6)!==0)throw Error(i(327));ni();var n=Nn(t,0);if((n&1)===0)return Et(t,Ke()),null;var s=zo(t,n);if(t.tag!==0&&s===2){var g=Di(t);g!==0&&(n=g,s=kc(t,g))}if(s===1)throw s=is,mn(t,0),Kr(t,n),Et(t,Ke()),s;if(s===6)throw Error(i(345));return t.finishedWork=t.current.alternate,t.finishedLanes=n,vn(t,bt,Cr),Et(t,Ke()),null}function Rc(t,n){var s=Me;Me|=1;try{return t(n)}finally{Me=s,Me===0&&(ri=Ke()+500,po&&jr())}}function gn(t){Vr!==null&&Vr.tag===0&&(Me&6)===0&&ni();var n=Me;Me|=1;var s=zt.transition,g=Be;try{if(zt.transition=null,Be=1,t)return t()}finally{Be=g,zt.transition=s,Me=n,(Me&6)===0&&jr()}}function Dc(){Pt=ti.current,je(ti)}function mn(t,n){t.finishedWork=null,t.finishedLanes=0;var s=t.timeoutHandle;if(s!==-1&&(t.timeoutHandle=-1,a0(s)),et!==null)for(s=et.return;s!==null;){var g=s;switch(Hl(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&ho();break;case 3:Jn(),je(St),je(_t),Ql();break;case 5:Yl(g);break;case 4:Jn();break;case 13:je(Xe);break;case 19:je(Xe);break;case 10:Ul(g.type._context);break;case 22:case 23:Dc()}s=s.return}if(lt=t,et=t=Xr(t.current,null),ft=Pt=n,it=0,is=null,Cc=Bo=_n=0,bt=ss=null,dn!==null){for(n=0;n<dn.length;n++)if(s=dn[n],g=s.interleaved,g!==null){s.interleaved=null;var E=g.next,A=s.pending;if(A!==null){var $=A.next;A.next=E,g.next=$}s.pending=g}dn=null}return t}function yf(t,n){do{var s=et;try{if(Wl(),bo.current=Ro,Eo){for(var g=Ye.memoizedState;g!==null;){var E=g.queue;E!==null&&(E.pending=null),g=g.next}Eo=!1}if(pn=0,at=nt=Ye=null,Ji=!1,Zi=0,Sc.current=null,s===null||s.return===null){it=1,is=n,et=null;break}e:{var A=t,$=s.return,Y=s,Q=n;if(n=ft,Y.flags|=32768,Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var oe=Q,de=Y,fe=de.tag;if((de.mode&1)===0&&(fe===0||fe===11||fe===15)){var he=de.alternate;he?(de.updateQueue=he.updateQueue,de.memoizedState=he.memoizedState,de.lanes=he.lanes):(de.updateQueue=null,de.memoizedState=null)}var me=Wd($);if(me!==null){me.flags&=-257,Ud(me,$,Y,A,n),me.mode&1&&$d(A,oe,n),n=me,Q=oe;var ye=n.updateQueue;if(ye===null){var we=new Set;we.add(Q),n.updateQueue=we}else ye.add(Q);break e}else{if((n&1)===0){$d(A,oe,n),Ac();break e}Q=Error(i(426))}}else if(We&&Y.mode&1){var Ze=Wd($);if(Ze!==null){(Ze.flags&65536)===0&&(Ze.flags|=256),Ud(Ze,$,Y,A,n),zl(Zn(Q,Y));break e}}A=Q=Zn(Q,Y),it!==4&&(it=2),ss===null?ss=[A]:ss.push(A),A=$;do{switch(A.tag){case 3:A.flags|=65536,n&=-n,A.lanes|=n;var ne=jd(A,Q,n);fd(A,ne);break e;case 1:Y=Q;var ee=A.type,se=A.stateNode;if((A.flags&128)===0&&(typeof ee.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(Ur===null||!Ur.has(se)))){A.flags|=65536,n&=-n,A.lanes|=n;var _e=zd(A,Y,n);fd(A,_e);break e}}A=A.return}while(A!==null)}Cf(s)}catch(Ce){n=Ce,et===s&&s!==null&&(et=s=s.return);continue}break}while(!0)}function wf(){var t=No.current;return No.current=Ro,t===null?Ro:t}function Ac(){(it===0||it===3||it===2)&&(it=4),lt===null||(_n&268435455)===0&&(Bo&268435455)===0||Kr(lt,ft)}function zo(t,n){var s=Me;Me|=2;var g=wf();(lt!==t||ft!==n)&&(Cr=null,mn(t,n));do try{M0();break}catch(E){yf(t,E)}while(!0);if(Wl(),Me=s,No.current=g,et!==null)throw Error(i(261));return lt=null,ft=0,it}function M0(){for(;et!==null;)Sf(et)}function P0(){for(;et!==null&&!Za();)Sf(et)}function Sf(t){var n=Ef(t.alternate,t,Pt);t.memoizedProps=t.pendingProps,n===null?Cf(t):et=n,Sc.current=null}function Cf(t){var n=t;do{var s=n.alternate;if(t=n.return,(n.flags&32768)===0){if(s=E0(s,n,Pt),s!==null){et=s;return}}else{if(s=k0(s,n),s!==null){s.flags&=32767,et=s;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{it=6,et=null;return}}if(n=n.sibling,n!==null){et=n;return}et=n=t}while(n!==null);it===0&&(it=5)}function vn(t,n,s){var g=Be,E=zt.transition;try{zt.transition=null,Be=1,N0(t,n,s,g)}finally{zt.transition=E,Be=g}return null}function N0(t,n,s,g){do ni();while(Vr!==null);if((Me&6)!==0)throw Error(i(327));s=t.finishedWork;var E=t.finishedLanes;if(s===null)return null;if(t.finishedWork=null,t.finishedLanes=0,s===t.current)throw Error(i(177));t.callbackNode=null,t.callbackPriority=0;var A=s.lanes|s.childLanes;if(Xs(t,A),t===lt&&(et=lt=null,ft=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Oo||(Oo=!0,kf(Tn,function(){return ni(),null})),A=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||A){A=zt.transition,zt.transition=null;var $=Be;Be=1;var Y=Me;Me|=4,Sc.current=null,R0(t,s),df(s,t),e0(Al),Qs=!!Dl,Al=Dl=null,t.current=s,D0(s),Us(),Me=Y,Be=$,zt.transition=A}else t.current=s;if(Oo&&(Oo=!1,Vr=t,Ho=E),A=t.pendingLanes,A===0&&(Ur=null),rl(s.stateNode),Et(t,Ke()),n!==null)for(g=t.onRecoverableError,s=0;s<n.length;s++)E=n[s],g(E.value,{componentStack:E.stack,digest:E.digest});if(Io)throw Io=!1,t=bc,bc=null,t;return(Ho&1)!==0&&t.tag!==0&&ni(),A=t.pendingLanes,(A&1)!==0?t===Ec?os++:(os=0,Ec=t):os=0,jr(),null}function ni(){if(Vr!==null){var t=ch(Ho),n=zt.transition,s=Be;try{if(zt.transition=null,Be=16>t?16:t,Vr===null)var g=!1;else{if(t=Vr,Vr=null,Ho=0,(Me&6)!==0)throw Error(i(331));var E=Me;for(Me|=4,ve=t.current;ve!==null;){var A=ve,$=A.child;if((ve.flags&16)!==0){var Y=A.deletions;if(Y!==null){for(var Q=0;Q<Y.length;Q++){var oe=Y[Q];for(ve=oe;ve!==null;){var de=ve;switch(de.tag){case 0:case 11:case 15:ns(8,de,A)}var fe=de.child;if(fe!==null)fe.return=de,ve=fe;else for(;ve!==null;){de=ve;var he=de.sibling,me=de.return;if(af(de),de===oe){ve=null;break}if(he!==null){he.return=me,ve=he;break}ve=me}}}var ye=A.alternate;if(ye!==null){var we=ye.child;if(we!==null){ye.child=null;do{var Ze=we.sibling;we.sibling=null,we=Ze}while(we!==null)}}ve=A}}if((A.subtreeFlags&2064)!==0&&$!==null)$.return=A,ve=$;else e:for(;ve!==null;){if(A=ve,(A.flags&2048)!==0)switch(A.tag){case 0:case 11:case 15:ns(9,A,A.return)}var ne=A.sibling;if(ne!==null){ne.return=A.return,ve=ne;break e}ve=A.return}}var ee=t.current;for(ve=ee;ve!==null;){$=ve;var se=$.child;if(($.subtreeFlags&2064)!==0&&se!==null)se.return=$,ve=se;else e:for($=ee;ve!==null;){if(Y=ve,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:Po(9,Y)}}catch(Ce){Ge(Y,Y.return,Ce)}if(Y===$){ve=null;break e}var _e=Y.sibling;if(_e!==null){_e.return=Y.return,ve=_e;break e}ve=Y.return}}if(Me=E,jr(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(on,t)}catch{}g=!0}return g}finally{Be=s,zt.transition=n}}return!1}function xf(t,n,s){n=Zn(s,n),n=jd(t,n,1),t=$r(t,n,1),n=wt(),t!==null&&(an(t,1,n),Et(t,n))}function Ge(t,n,s){if(t.tag===3)xf(t,t,s);else for(;n!==null;){if(n.tag===3){xf(n,t,s);break}else if(n.tag===1){var g=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Ur===null||!Ur.has(g))){t=Zn(s,t),t=zd(n,t,1),n=$r(n,t,1),t=wt(),n!==null&&(an(n,1,t),Et(n,t));break}}n=n.return}}function B0(t,n,s){var g=t.pingCache;g!==null&&g.delete(n),n=wt(),t.pingedLanes|=t.suspendedLanes&s,lt===t&&(ft&s)===s&&(it===4||it===3&&(ft&130023424)===ft&&500>Ke()-xc?mn(t,0):Cc|=s),Et(t,n)}function bf(t,n){n===0&&((t.mode&1)===0?n=1:(n=Pn,Pn<<=1,(Pn&130023424)===0&&(Pn=4194304)));var s=wt();t=yr(t,n),t!==null&&(an(t,n,s),Et(t,s))}function I0(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),bf(t,s)}function O0(t,n){var s=0;switch(t.tag){case 13:var g=t.stateNode,E=t.memoizedState;E!==null&&(s=E.retryLane);break;case 19:g=t.stateNode;break;default:throw Error(i(314))}g!==null&&g.delete(n),bf(t,s)}var Ef;Ef=function(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps||St.current)xt=!0;else{if((t.lanes&s)===0&&(n.flags&128)===0)return xt=!1,b0(t,n,s);xt=(t.flags&131072)!==0}else xt=!1,We&&(n.flags&1048576)!==0&&nd(n,go,n.index);switch(n.lanes=0,n.tag){case 2:var g=n.type;To(t,n),t=n.pendingProps;var E=Vn(n,_t.current);Qn(n,s),E=ec(null,n,g,t,E,s);var A=tc();return n.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Ct(g)?(A=!0,fo(n)):A=!1,n.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,Kl(n),E.updater=Do,n.stateNode=E,E._reactInternals=n,ac(n,g,t,s),n=hc(null,n,g,!0,A,s)):(n.tag=0,We&&A&&Ol(n),yt(null,n,E,s),n=n.child),n;case 16:g=n.elementType;e:{switch(To(t,n),t=n.pendingProps,E=g._init,g=E(g._payload),n.type=g,E=n.tag=F0(g),t=qt(g,t),E){case 0:n=uc(null,n,g,t,s);break e;case 1:n=Gd(null,n,g,t,s);break e;case 11:n=Vd(null,n,g,t,s);break e;case 14:n=qd(null,n,g,qt(g.type,t),s);break e}throw Error(i(306,g,""))}return n;case 0:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),uc(t,n,g,E,s);case 1:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),Gd(t,n,g,E,s);case 3:e:{if(Qd(n),t===null)throw Error(i(387));g=n.pendingProps,A=n.memoizedState,E=A.element,dd(t,n),Co(n,g,null,s);var $=n.memoizedState;if(g=$.element,A.isDehydrated)if(A={element:g,isDehydrated:!1,cache:$.cache,pendingSuspenseBoundaries:$.pendingSuspenseBoundaries,transitions:$.transitions},n.updateQueue.baseState=A,n.memoizedState=A,n.flags&256){E=Zn(Error(i(423)),n),n=Jd(t,n,g,s,E);break e}else if(g!==E){E=Zn(Error(i(424)),n),n=Jd(t,n,g,s,E);break e}else for(Mt=Or(n.stateNode.containerInfo.firstChild),Tt=n,We=!0,Vt=null,s=ud(n,null,g,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Xn(),g===E){n=Sr(t,n,s);break e}yt(t,n,g,s)}n=n.child}return n;case 5:return _d(n),t===null&&jl(n),g=n.type,E=n.pendingProps,A=t!==null?t.memoizedProps:null,$=E.children,Tl(g,E)?$=null:A!==null&&Tl(g,A)&&(n.flags|=32),Yd(t,n),yt(t,n,$,s),n.child;case 6:return t===null&&jl(n),null;case 13:return Zd(t,n,s);case 4:return Xl(n,n.stateNode.containerInfo),g=n.pendingProps,t===null?n.child=Yn(n,null,g,s):yt(t,n,g,s),n.child;case 11:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),Vd(t,n,g,E,s);case 7:return yt(t,n,n.pendingProps,s),n.child;case 8:return yt(t,n,n.pendingProps.children,s),n.child;case 12:return yt(t,n,n.pendingProps.children,s),n.child;case 10:e:{if(g=n.type._context,E=n.pendingProps,A=n.memoizedProps,$=E.value,He(yo,g._currentValue),g._currentValue=$,A!==null)if(Ut(A.value,$)){if(A.children===E.children&&!St.current){n=Sr(t,n,s);break e}}else for(A=n.child,A!==null&&(A.return=n);A!==null;){var Y=A.dependencies;if(Y!==null){$=A.child;for(var Q=Y.firstContext;Q!==null;){if(Q.context===g){if(A.tag===1){Q=wr(-1,s&-s),Q.tag=2;var oe=A.updateQueue;if(oe!==null){oe=oe.shared;var de=oe.pending;de===null?Q.next=Q:(Q.next=de.next,de.next=Q),oe.pending=Q}}A.lanes|=s,Q=A.alternate,Q!==null&&(Q.lanes|=s),Vl(A.return,s,n),Y.lanes|=s;break}Q=Q.next}}else if(A.tag===10)$=A.type===n.type?null:A.child;else if(A.tag===18){if($=A.return,$===null)throw Error(i(341));$.lanes|=s,Y=$.alternate,Y!==null&&(Y.lanes|=s),Vl($,s,n),$=A.sibling}else $=A.child;if($!==null)$.return=A;else for($=A;$!==null;){if($===n){$=null;break}if(A=$.sibling,A!==null){A.return=$.return,$=A;break}$=$.return}A=$}yt(t,n,E.children,s),n=n.child}return n;case 9:return E=n.type,g=n.pendingProps.children,Qn(n,s),E=Ft(E),g=g(E),n.flags|=1,yt(t,n,g,s),n.child;case 14:return g=n.type,E=qt(g,n.pendingProps),E=qt(g.type,E),qd(t,n,g,E,s);case 15:return Kd(t,n,n.type,n.pendingProps,s);case 17:return g=n.type,E=n.pendingProps,E=n.elementType===g?E:qt(g,E),To(t,n),n.tag=1,Ct(g)?(t=!0,fo(n)):t=!1,Qn(n,s),Hd(n,g,E),ac(n,g,E,s),hc(null,n,g,!0,t,s);case 19:return tf(t,n,s);case 22:return Xd(t,n,s)}throw Error(i(156,n.tag))};function kf(t,n){return $s(t,n)}function H0(t,n,s,g){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $t(t,n,s,g){return new H0(t,n,s,g)}function Tc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function F0(t){if(typeof t=="function")return Tc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===j)return 11;if(t===q)return 14}return 2}function Xr(t,n){var s=t.alternate;return s===null?(s=$t(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&14680064,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s}function $o(t,n,s,g,E,A){var $=2;if(g=t,typeof t=="function")Tc(t)&&($=1);else if(typeof t=="string")$=5;else e:switch(t){case D:return yn(s.children,E,A,n);case k:$=8,E|=8;break;case M:return t=$t(12,s,n,E|2),t.elementType=M,t.lanes=A,t;case N:return t=$t(13,s,n,E),t.elementType=N,t.lanes=A,t;case I:return t=$t(19,s,n,E),t.elementType=I,t.lanes=A,t;case K:return Wo(s,E,A,n);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case W:$=10;break e;case z:$=9;break e;case j:$=11;break e;case q:$=14;break e;case U:$=16,g=null;break e}throw Error(i(130,t==null?t:typeof t,""))}return n=$t($,s,n,E),n.elementType=t,n.type=g,n.lanes=A,n}function yn(t,n,s,g){return t=$t(7,t,g,n),t.lanes=s,t}function Wo(t,n,s,g){return t=$t(22,t,g,n),t.elementType=K,t.lanes=s,t.stateNode={isHidden:!1},t}function Mc(t,n,s){return t=$t(6,t,null,n),t.lanes=s,t}function Pc(t,n,s){return n=$t(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function j0(t,n,s,g,E){this.tag=n,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ai(0),this.expirationTimes=Ai(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ai(0),this.identifierPrefix=g,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function Nc(t,n,s,g,E,A,$,Y,Q){return t=new j0(t,n,s,Y,Q),n===1?(n=1,A===!0&&(n|=8)):n=0,A=$t(3,null,null,n),t.current=A,A.stateNode=t,A.memoizedState={element:g,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Kl(A),t}function z0(t,n,s){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:g==null?null:""+g,children:t,containerInfo:n,implementation:s}}function Lf(t){if(!t)return Fr;t=t._reactInternals;e:{if(rr(t)!==t||t.tag!==1)throw Error(i(170));var n=t;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Ct(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(t.tag===1){var s=t.type;if(Ct(s))return ed(t,s,n)}return n}function Rf(t,n,s,g,E,A,$,Y,Q){return t=Nc(s,g,!0,t,E,A,$,Y,Q),t.context=Lf(null),s=t.current,g=wt(),E=qr(s),A=wr(g,E),A.callback=n??null,$r(s,A,E),t.current.lanes=E,an(t,E,g),Et(t,g),t}function Uo(t,n,s,g){var E=n.current,A=wt(),$=qr(E);return s=Lf(s),n.context===null?n.context=s:n.pendingContext=s,n=wr(A,$),n.payload={element:t},g=g===void 0?null:g,g!==null&&(n.callback=g),t=$r(E,n,$),t!==null&&(Yt(t,E,$,A),So(t,E,$)),$}function Vo(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Df(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function Bc(t,n){Df(t,n),(t=t.alternate)&&Df(t,n)}function $0(){return null}var Af=typeof reportError=="function"?reportError:function(t){console.error(t)};function Ic(t){this._internalRoot=t}qo.prototype.render=Ic.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(i(409));Uo(t,n,null,null)},qo.prototype.unmount=Ic.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;gn(function(){Uo(null,t,null,null)}),n[_r]=null}};function qo(t){this._internalRoot=t}qo.prototype.unstable_scheduleHydration=function(t){if(t){var n=dh();t={blockedOn:null,target:t,priority:n};for(var s=0;s<Nr.length&&n!==0&&n<Nr[s].priority;s++);Nr.splice(s,0,t),s===0&&_h(t)}};function Oc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ko(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Tf(){}function W0(t,n,s,g,E){if(E){if(typeof g=="function"){var A=g;g=function(){var oe=Vo($);A.call(oe)}}var $=Rf(n,g,t,0,null,!1,!1,"",Tf);return t._reactRootContainer=$,t[_r]=$.current,Ui(t.nodeType===8?t.parentNode:t),gn(),$}for(;E=t.lastChild;)t.removeChild(E);if(typeof g=="function"){var Y=g;g=function(){var oe=Vo(Q);Y.call(oe)}}var Q=Nc(t,0,!1,null,null,!1,!1,"",Tf);return t._reactRootContainer=Q,t[_r]=Q.current,Ui(t.nodeType===8?t.parentNode:t),gn(function(){Uo(n,Q,s,g)}),Q}function Xo(t,n,s,g,E){var A=s._reactRootContainer;if(A){var $=A;if(typeof E=="function"){var Y=E;E=function(){var Q=Vo($);Y.call(Q)}}Uo(n,$,t,E)}else $=W0(s,n,t,E,g);return Vo($)}uh=function(t){switch(t.tag){case 3:var n=t.stateNode;if(n.current.memoizedState.isDehydrated){var s=nr(n.pendingLanes);s!==0&&(al(n,s|1),Et(n,Ke()),(Me&6)===0&&(ri=Ke()+500,jr()))}break;case 13:gn(function(){var g=yr(t,1);if(g!==null){var E=wt();Yt(g,t,1,E)}}),Bc(t,1)}},ll=function(t){if(t.tag===13){var n=yr(t,134217728);if(n!==null){var s=wt();Yt(n,t,134217728,s)}Bc(t,134217728)}},hh=function(t){if(t.tag===13){var n=qr(t),s=yr(t,n);if(s!==null){var g=wt();Yt(s,t,n,g)}Bc(t,n)}},dh=function(){return Be},fh=function(t,n){var s=Be;try{return Be=t,n()}finally{Be=s}},Ci=function(t,n,s){switch(n){case"input":if(ge(t,s),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<s.length;n++){var g=s[n];if(g!==t&&g.form===t.form){var E=uo(g);if(!E)throw Error(i(90));le(g),ge(g,E)}}}break;case"textarea":pt(t,s);break;case"select":n=s.value,n!=null&&Qe(t,!!s.multiple,n,!1)}},Os=Rc,Hs=gn;var U0={usingClientEntryPoint:!1,Events:[Ki,Wn,uo,Bs,Is,Rc]},as={findFiberByHostInstance:ln,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},V0={bundleType:as.bundleType,version:as.version,rendererPackageName:as.rendererPackageName,rendererConfig:as.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=js(t),t===null?null:t.stateNode},findFiberByHostInstance:as.findFiberByHostInstance||$0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yo.isDisabled&&Yo.supportsFiber)try{on=Yo.inject(V0),It=Yo}catch{}}return kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U0,kt.createPortal=function(t,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Oc(n))throw Error(i(200));return z0(t,n,null,s)},kt.createRoot=function(t,n){if(!Oc(t))throw Error(i(299));var s=!1,g="",E=Af;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(g=n.identifierPrefix),n.onRecoverableError!==void 0&&(E=n.onRecoverableError)),n=Nc(t,1,!1,null,null,s,!1,g,E),t[_r]=n.current,Ui(t.nodeType===8?t.parentNode:t),new Ic(n)},kt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=js(n),t=t===null?null:t.stateNode,t},kt.flushSync=function(t){return gn(t)},kt.hydrate=function(t,n,s){if(!Ko(n))throw Error(i(200));return Xo(null,t,n,!0,s)},kt.hydrateRoot=function(t,n,s){if(!Oc(t))throw Error(i(405));var g=s!=null&&s.hydratedSources||null,E=!1,A="",$=Af;if(s!=null&&(s.unstable_strictMode===!0&&(E=!0),s.identifierPrefix!==void 0&&(A=s.identifierPrefix),s.onRecoverableError!==void 0&&($=s.onRecoverableError)),n=Rf(n,null,t,1,s??null,E,!1,A,$),t[_r]=n.current,Ui(t),g)for(t=0;t<g.length;t++)s=g[t],E=s._getVersion,E=E(s._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[s,E]:n.mutableSourceEagerHydrationData.push(s,E);return new qo(n)},kt.render=function(t,n,s){if(!Ko(n))throw Error(i(200));return Xo(null,t,n,!1,s)},kt.unmountComponentAtNode=function(t){if(!Ko(t))throw Error(i(40));return t._reactRootContainer?(gn(function(){Xo(null,null,t,!1,function(){t._reactRootContainer=null,t[_r]=null})}),!0):!1},kt.unstable_batchedUpdates=Rc,kt.unstable_renderSubtreeIntoContainer=function(t,n,s,g){if(!Ko(s))throw Error(i(200));if(t==null||t._reactInternals===void 0)throw Error(i(38));return Xo(t,n,s,!1,g)},kt.version="18.3.1-next-f1338f8080-20240426",kt}var Ff;function r_(){if(Ff)return jc.exports;Ff=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),jc.exports=J0(),jc.exports}var jf;function Z0(){if(jf)return Go;jf=1;var e=r_();return Go.createRoot=e.createRoot,Go.hydrateRoot=e.hydrateRoot,Go}var ev=Z0();const tv=Ou(ev),hr=Object.create(null);hr.open="0";hr.close="1";hr.ping="2";hr.pong="3";hr.message="4";hr.upgrade="5";hr.noop="6";const ca=Object.create(null);Object.keys(hr).forEach(e=>{ca[hr[e]]=e});const du={type:"error",data:"parser error"},n_=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",i_=typeof ArrayBuffer=="function",s_=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Fu=({type:e,data:r},i,o)=>n_&&r instanceof Blob?i?o(r):zf(r,o):i_&&(r instanceof ArrayBuffer||s_(r))?i?o(r):zf(new Blob([r]),o):o(hr[e]+(r||"")),zf=(e,r)=>{const i=new FileReader;return i.onload=function(){const o=i.result.split(",")[1];r("b"+(o||""))},i.readAsDataURL(e)};function $f(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Wc;function rv(e,r){if(n_&&e.data instanceof Blob)return e.data.arrayBuffer().then($f).then(r);if(i_&&(e.data instanceof ArrayBuffer||s_(e.data)))return r($f(e.data));Fu(e,!1,i=>{Wc||(Wc=new TextEncoder),r(Wc.encode(i))})}const Wf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ds=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Wf.length;e++)ds[Wf.charCodeAt(e)]=e;const nv=e=>{let r=e.length*.75,i=e.length,o,h=0,S,y,a,l;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const _=new ArrayBuffer(r),v=new Uint8Array(_);for(o=0;o<i;o+=4)S=ds[e.charCodeAt(o)],y=ds[e.charCodeAt(o+1)],a=ds[e.charCodeAt(o+2)],l=ds[e.charCodeAt(o+3)],v[h++]=S<<2|y>>4,v[h++]=(y&15)<<4|a>>2,v[h++]=(a&3)<<6|l&63;return _},iv=typeof ArrayBuffer=="function",ju=(e,r)=>{if(typeof e!="string")return{type:"message",data:o_(e,r)};const i=e.charAt(0);return i==="b"?{type:"message",data:sv(e.substring(1),r)}:ca[i]?e.length>1?{type:ca[i],data:e.substring(1)}:{type:ca[i]}:du},sv=(e,r)=>{if(iv){const i=nv(e);return o_(i,r)}else return{base64:!0,data:e}},o_=(e,r)=>{switch(r){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},a_="",ov=(e,r)=>{const i=e.length,o=new Array(i);let h=0;e.forEach((S,y)=>{Fu(S,!1,a=>{o[y]=a,++h===i&&r(o.join(a_))})})},av=(e,r)=>{const i=e.split(a_),o=[];for(let h=0;h<i.length;h++){const S=ju(i[h],r);if(o.push(S),S.type==="error")break}return o};function lv(){return new TransformStream({transform(e,r){rv(e,i=>{const o=i.length;let h;if(o<126)h=new Uint8Array(1),new DataView(h.buffer).setUint8(0,o);else if(o<65536){h=new Uint8Array(3);const S=new DataView(h.buffer);S.setUint8(0,126),S.setUint16(1,o)}else{h=new Uint8Array(9);const S=new DataView(h.buffer);S.setUint8(0,127),S.setBigUint64(1,BigInt(o))}e.data&&typeof e.data!="string"&&(h[0]|=128),r.enqueue(h),r.enqueue(i)})}})}let Uc;function Qo(e){return e.reduce((r,i)=>r+i.length,0)}function Jo(e,r){if(e[0].length===r)return e.shift();const i=new Uint8Array(r);let o=0;for(let h=0;h<r;h++)i[h]=e[0][o++],o===e[0].length&&(e.shift(),o=0);return e.length&&o<e[0].length&&(e[0]=e[0].slice(o)),i}function cv(e,r){Uc||(Uc=new TextDecoder);const i=[];let o=0,h=-1,S=!1;return new TransformStream({transform(y,a){for(i.push(y);;){if(o===0){if(Qo(i)<1)break;const l=Jo(i,1);S=(l[0]&128)===128,h=l[0]&127,h<126?o=3:h===126?o=1:o=2}else if(o===1){if(Qo(i)<2)break;const l=Jo(i,2);h=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),o=3}else if(o===2){if(Qo(i)<8)break;const l=Jo(i,8),_=new DataView(l.buffer,l.byteOffset,l.length),v=_.getUint32(0);if(v>Math.pow(2,21)-1){a.enqueue(du);break}h=v*Math.pow(2,32)+_.getUint32(4),o=3}else{if(Qo(i)<h)break;const l=Jo(i,h);a.enqueue(ju(S?l:Uc.decode(l),r)),o=0}if(h===0||h>e){a.enqueue(du);break}}}})}const l_=4;function tt(e){if(e)return uv(e)}function uv(e){for(var r in tt.prototype)e[r]=tt.prototype[r];return e}tt.prototype.on=tt.prototype.addEventListener=function(e,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(r),this};tt.prototype.once=function(e,r){function i(){this.off(e,i),r.apply(this,arguments)}return i.fn=r,this.on(e,i),this};tt.prototype.off=tt.prototype.removeListener=tt.prototype.removeAllListeners=tt.prototype.removeEventListener=function(e,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+e];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var o,h=0;h<i.length;h++)if(o=i[h],o===r||o.fn===r){i.splice(h,1);break}return i.length===0&&delete this._callbacks["$"+e],this};tt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),i=this._callbacks["$"+e],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(i){i=i.slice(0);for(var o=0,h=i.length;o<h;++o)i[o].apply(this,r)}return this};tt.prototype.emitReserved=tt.prototype.emit;tt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};tt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Pa=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,i)=>i(r,0),Wt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),hv="arraybuffer";function c_(e,...r){return r.reduce((i,o)=>(e.hasOwnProperty(o)&&(i[o]=e[o]),i),{})}const dv=Wt.setTimeout,fv=Wt.clearTimeout;function Na(e,r){r.useNativeTimers?(e.setTimeoutFn=dv.bind(Wt),e.clearTimeoutFn=fv.bind(Wt)):(e.setTimeoutFn=Wt.setTimeout.bind(Wt),e.clearTimeoutFn=Wt.clearTimeout.bind(Wt))}const pv=1.33;function _v(e){return typeof e=="string"?gv(e):Math.ceil((e.byteLength||e.size)*pv)}function gv(e){let r=0,i=0;for(let o=0,h=e.length;o<h;o++)r=e.charCodeAt(o),r<128?i+=1:r<2048?i+=2:r<55296||r>=57344?i+=3:(o++,i+=4);return i}function u_(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function mv(e){let r="";for(let i in e)e.hasOwnProperty(i)&&(r.length&&(r+="&"),r+=encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return r}function vv(e){let r={},i=e.split("&");for(let o=0,h=i.length;o<h;o++){let S=i[o].split("=");r[decodeURIComponent(S[0])]=decodeURIComponent(S[1])}return r}class yv extends Error{constructor(r,i,o){super(r),this.description=i,this.context=o,this.type="TransportError"}}class zu extends tt{constructor(r){super(),this.writable=!1,Na(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,i,o){return super.emitReserved("error",new yv(r,i,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const i=ju(r,this.socket.binaryType);this.onPacket(i)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,i={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const i=mv(r);return i.length?"?"+i:""}}class wv extends zu{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const i=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let o=0;this._polling&&(o++,this.once("pollComplete",function(){--o||i()})),this.writable||(o++,this.once("drain",function(){--o||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const i=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};av(r,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,ov(r,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=u_()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(r,i)}}let h_=!1;try{h_=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Sv=h_;function Cv(){}class xv extends wv{constructor(r){if(super(r),typeof location<"u"){const i=location.protocol==="https:";let o=location.port;o||(o=i?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||o!==r.port}}doWrite(r,i){const o=this.request({method:"POST",data:r});o.on("success",i),o.on("error",(h,S)=>{this.onError("xhr post error",h,S)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(i,o)=>{this.onError("xhr poll error",i,o)}),this.pollXhr=r}}class cr extends tt{constructor(r,i,o){super(),this.createRequest=r,Na(this,o),this._opts=o,this._method=o.method||"GET",this._uri=i,this._data=o.data!==void 0?o.data:null,this._create()}_create(){var r;const i=c_(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const o=this._xhr=this.createRequest(i);try{o.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let h in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(h)&&o.setRequestHeader(h,this._opts.extraHeaders[h])}}catch{}if(this._method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(o),"withCredentials"in o&&(o.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(o.timeout=this._opts.requestTimeout),o.onreadystatechange=()=>{var h;o.readyState===3&&((h=this._opts.cookieJar)===null||h===void 0||h.parseCookies(o.getResponseHeader("set-cookie"))),o.readyState===4&&(o.status===200||o.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof o.status=="number"?o.status:0)},0))},o.send(this._data)}catch(h){this.setTimeoutFn(()=>{this._onError(h)},0);return}typeof document<"u"&&(this._index=cr.requestsCount++,cr.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Cv,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete cr.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}cr.requestsCount=0;cr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Uf);else if(typeof addEventListener=="function"){const e="onpagehide"in Wt?"pagehide":"unload";addEventListener(e,Uf,!1)}}function Uf(){for(let e in cr.requests)cr.requests.hasOwnProperty(e)&&cr.requests[e].abort()}const bv=(function(){const e=d_({xdomain:!1});return e&&e.responseType!==null})();class Ev extends xv{constructor(r){super(r);const i=r&&r.forceBase64;this.supportsBinary=bv&&!i}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new cr(d_,this.uri(),r)}}function d_(e){const r=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||Sv))return new XMLHttpRequest}catch{}if(!r)try{return new Wt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const f_=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class kv extends zu{get name(){return"websocket"}doOpen(){const r=this.uri(),i=this.opts.protocols,o=f_?{}:c_(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,i,o)}catch(h){return this.emitReserved("error",h)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const o=r[i],h=i===r.length-1;Fu(o,this.supportsBinary,S=>{try{this.doWrite(o,S)}catch{}h&&Pa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=u_()),this.supportsBinary||(i.b64=1),this.createUri(r,i)}}const Vc=Wt.WebSocket||Wt.MozWebSocket;class Lv extends kv{createSocket(r,i,o){return f_?new Vc(r,i,o):i?new Vc(r,i):new Vc(r)}doWrite(r,i){this.ws.send(i)}}class Rv extends zu{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const i=cv(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=r.readable.pipeThrough(i).getReader(),h=lv();h.readable.pipeTo(r.writable),this._writer=h.writable.getWriter();const S=()=>{o.read().then(({done:a,value:l})=>{a||(this.onPacket(l),S())}).catch(a=>{})};S();const y={type:"open"};this.query.sid&&(y.data=`{"sid":"${this.query.sid}"}`),this._writer.write(y).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let i=0;i<r.length;i++){const o=r[i],h=i===r.length-1;this._writer.write(o).then(()=>{h&&Pa(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const Dv={websocket:Lv,webtransport:Rv,polling:Ev},Av=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Tv=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function fu(e){if(e.length>8e3)throw"URI too long";const r=e,i=e.indexOf("["),o=e.indexOf("]");i!=-1&&o!=-1&&(e=e.substring(0,i)+e.substring(i,o).replace(/:/g,";")+e.substring(o,e.length));let h=Av.exec(e||""),S={},y=14;for(;y--;)S[Tv[y]]=h[y]||"";return i!=-1&&o!=-1&&(S.source=r,S.host=S.host.substring(1,S.host.length-1).replace(/;/g,":"),S.authority=S.authority.replace("[","").replace("]","").replace(/;/g,":"),S.ipv6uri=!0),S.pathNames=Mv(S,S.path),S.queryKey=Pv(S,S.query),S}function Mv(e,r){const i=/\/{2,9}/g,o=r.replace(i,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&o.splice(0,1),r.slice(-1)=="/"&&o.splice(o.length-1,1),o}function Pv(e,r){const i={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,h,S){h&&(i[h]=S)}),i}const pu=typeof addEventListener=="function"&&typeof removeEventListener=="function",ua=[];pu&&addEventListener("offline",()=>{ua.forEach(e=>e())},!1);class en extends tt{constructor(r,i){if(super(),this.binaryType=hv,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(i=r,r=null),r){const o=fu(r);i.hostname=o.host,i.secure=o.protocol==="https"||o.protocol==="wss",i.port=o.port,o.query&&(i.query=o.query)}else i.host&&(i.hostname=fu(i.host).host);Na(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(o=>{const h=o.prototype.name;this.transports.push(h),this._transportsByName[h]=o}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=vv(this.opts.query)),pu&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ua.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const i=Object.assign({},this.opts.query);i.EIO=l_,i.transport=r,this.id&&(i.sid=this.id);const o=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](o)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&en.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(r);i.open(),this.setTransport(i)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",en.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=r.data,this._onError(i);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let o=0;o<this.writeBuffer.length;o++){const h=this.writeBuffer[o].data;if(h&&(i+=_v(h)),o>0&&i>this._maxPayload)return this.writeBuffer.slice(0,o);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,Pa(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,i,o){return this._sendPacket("message",r,i,o),this}send(r,i,o){return this._sendPacket("message",r,i,o),this}_sendPacket(r,i,o,h){if(typeof i=="function"&&(h=i,i=void 0),typeof o=="function"&&(h=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const S={type:r,data:i,options:o};this.emitReserved("packetCreate",S),this.writeBuffer.push(S),h&&this.once("flush",h),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),r()},o=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():r()}):this.upgrading?o():r()),this}_onError(r){if(en.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),pu&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const o=ua.indexOf(this._offlineEventListener);o!==-1&&ua.splice(o,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,i),this.writeBuffer=[],this._prevBufferLen=0}}}en.protocol=l_;class Nv extends en{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let i=this.createTransport(r),o=!1;en.priorWebsocketSuccess=!1;const h=()=>{o||(i.send([{type:"ping",data:"probe"}]),i.once("packet",c=>{if(!o)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;en.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(v(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=i.name,this.emitReserved("upgradeError",m)}}))};function S(){o||(o=!0,v(),i.close(),i=null)}const y=c=>{const m=new Error("probe error: "+c);m.transport=i.name,S(),this.emitReserved("upgradeError",m)};function a(){y("transport closed")}function l(){y("socket closed")}function _(c){i&&c.name!==i.name&&S()}const v=()=>{i.removeListener("open",h),i.removeListener("error",y),i.removeListener("close",a),this.off("close",l),this.off("upgrading",_)};i.once("open",h),i.once("error",y),i.once("close",a),this.once("close",l),this.once("upgrading",_),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{o||i.open()},200):i.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const i=[];for(let o=0;o<r.length;o++)~this.transports.indexOf(r[o])&&i.push(r[o]);return i}}let Bv=class extends Nv{constructor(r,i={}){const o=typeof r=="object"?r:i;(!o.transports||o.transports&&typeof o.transports[0]=="string")&&(o.transports=(o.transports||["polling","websocket","webtransport"]).map(h=>Dv[h]).filter(h=>!!h)),super(r,o)}};function Iv(e,r="",i){let o=e;i=i||typeof location<"u"&&location,e==null&&(e=i.protocol+"//"+i.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=i.protocol+e:e=i.host+e),/^(https?|wss?):\/\//.test(e)||(typeof i<"u"?e=i.protocol+"//"+e:e="https://"+e),o=fu(e)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const S=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+S+":"+o.port+r,o.href=o.protocol+"://"+S+(i&&i.port===o.port?"":":"+o.port),o}const Ov=typeof ArrayBuffer=="function",Hv=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,p_=Object.prototype.toString,Fv=typeof Blob=="function"||typeof Blob<"u"&&p_.call(Blob)==="[object BlobConstructor]",jv=typeof File=="function"||typeof File<"u"&&p_.call(File)==="[object FileConstructor]";function $u(e){return Ov&&(e instanceof ArrayBuffer||Hv(e))||Fv&&e instanceof Blob||jv&&e instanceof File}function ha(e,r){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let i=0,o=e.length;i<o;i++)if(ha(e[i]))return!0;return!1}if($u(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ha(e.toJSON(),!0);for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&ha(e[i]))return!0;return!1}function zv(e){const r=[],i=e.data,o=e;return o.data=_u(i,r),o.attachments=r.length,{packet:o,buffers:r}}function _u(e,r){if(!e)return e;if($u(e)){const i={_placeholder:!0,num:r.length};return r.push(e),i}else if(Array.isArray(e)){const i=new Array(e.length);for(let o=0;o<e.length;o++)i[o]=_u(e[o],r);return i}else if(typeof e=="object"&&!(e instanceof Date)){const i={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=_u(e[o],r));return i}return e}function $v(e,r){return e.data=gu(e.data,r),delete e.attachments,e}function gu(e,r){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<r.length)return r[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i]=gu(e[i],r);else if(typeof e=="object")for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(e[i]=gu(e[i],r));return e}const Wv=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ae;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ae||(Ae={}));class Uv{constructor(r){this.replacer=r}encode(r){return(r.type===Ae.EVENT||r.type===Ae.ACK)&&ha(r)?this.encodeAsBinary({type:r.type===Ae.EVENT?Ae.BINARY_EVENT:Ae.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let i=""+r.type;return(r.type===Ae.BINARY_EVENT||r.type===Ae.BINARY_ACK)&&(i+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(i+=r.nsp+","),r.id!=null&&(i+=r.id),r.data!=null&&(i+=JSON.stringify(r.data,this.replacer)),i}encodeAsBinary(r){const i=zv(r),o=this.encodeAsString(i.packet),h=i.buffers;return h.unshift(o),h}}class Wu extends tt{constructor(r){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof r=="function"?{reviver:r}:r)}add(r){let i;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(r);const o=i.type===Ae.BINARY_EVENT;o||i.type===Ae.BINARY_ACK?(i.type=o?Ae.EVENT:Ae.ACK,this.reconstructor=new Vv(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if($u(r)||r.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(r),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let i=0;const o={type:Number(r.charAt(0))};if(Ae[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===Ae.BINARY_EVENT||o.type===Ae.BINARY_ACK){const S=i+1;for(;r.charAt(++i)!=="-"&&i!=r.length;);const y=r.substring(S,i);if(y!=Number(y)||r.charAt(i)!=="-")throw new Error("Illegal attachments");const a=Number(y);if(!qv(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");o.attachments=a}if(r.charAt(i+1)==="/"){const S=i+1;for(;++i&&!(r.charAt(i)===","||i===r.length););o.nsp=r.substring(S,i)}else o.nsp="/";const h=r.charAt(i+1);if(h!==""&&Number(h)==h){const S=i+1;for(;++i;){const y=r.charAt(i);if(y==null||Number(y)!=y){--i;break}if(i===r.length)break}o.id=Number(r.substring(S,i+1))}if(r.charAt(++i)){const S=this.tryParse(r.substr(i));if(Wu.isPayloadValid(o.type,S))o.data=S;else throw new Error("invalid payload")}return o}tryParse(r){try{return JSON.parse(r,this.opts.reviver)}catch{return!1}}static isPayloadValid(r,i){switch(r){case Ae.CONNECT:return Vf(i);case Ae.DISCONNECT:return i===void 0;case Ae.CONNECT_ERROR:return typeof i=="string"||Vf(i);case Ae.EVENT:case Ae.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&Wv.indexOf(i[0])===-1);case Ae.ACK:case Ae.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Vv{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const i=$v(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const qv=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};function Vf(e){return Object.prototype.toString.call(e)==="[object Object]"}const Kv=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Wu,Encoder:Uv,get PacketType(){return Ae}},Symbol.toStringTag,{value:"Module"}));function Gt(e,r,i){return e.on(r,i),function(){e.off(r,i)}}const Xv=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class __ extends tt{constructor(r,i,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=i,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[Gt(r,"open",this.onopen.bind(this)),Gt(r,"packet",this.onpacket.bind(this)),Gt(r,"error",this.onerror.bind(this)),Gt(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...i){var o,h,S;if(Xv.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(i.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const y={type:Ae.EVENT,data:i};if(y.options={},y.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const v=this.ids++,c=i.pop();this._registerAckCallback(v,c),y.id=v}const a=(h=(o=this.io.engine)===null||o===void 0?void 0:o.transport)===null||h===void 0?void 0:h.writable,l=this.connected&&!(!((S=this.io.engine)===null||S===void 0)&&S._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(y),this.packet(y)):this.sendBuffer.push(y)),this.flags={},this}_registerAckCallback(r,i){var o;const h=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(h===void 0){this.acks[r]=i;return}const S=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===r&&this.sendBuffer.splice(a,1);i.call(this,new Error("operation has timed out"))},h),y=(...a)=>{this.io.clearTimeoutFn(S),i.apply(this,a)};y.withError=!0,this.acks[r]=y}emitWithAck(r,...i){return new Promise((o,h)=>{const S=(y,a)=>y?h(y):o(a);S.withError=!0,i.push(S),this.emit(r,...i)})}_addToQueue(r){let i;typeof r[r.length-1]=="function"&&(i=r.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((h,...S)=>(this._queue[0],h!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(h)):(this._queue.shift(),i&&i(null,...S)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!r||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:Ae.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(o=>String(o.id)===r)){const o=this.acks[r];delete this.acks[r],o.withError&&o.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case Ae.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ae.EVENT:case Ae.BINARY_EVENT:this.onevent(r);break;case Ae.ACK:case Ae.BINARY_ACK:this.onack(r);break;case Ae.DISCONNECT:this.ondisconnect();break;case Ae.CONNECT_ERROR:this.destroy();const o=new Error(r.data.message);o.data=r.data.data,this.emitReserved("connect_error",o);break}}onevent(r){const i=r.data||[];r.id!=null&&i.push(this.ack(r.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const o of i)o.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const i=this;let o=!1;return function(...h){o||(o=!0,i.packet({type:Ae.ACK,id:r,data:h}))}}onack(r){const i=this.acks[r.id];typeof i=="function"&&(delete this.acks[r.id],i.withError&&r.data.unshift(null),i.apply(this,r.data))}onconnect(r,i){this.id=r,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ae.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const i=this._anyListeners;for(let o=0;o<i.length;o++)if(r===i[o])return i.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const i=this._anyOutgoingListeners;for(let o=0;o<i.length;o++)if(r===i[o])return i.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const o of i)o.apply(this,r.data)}}}function mi(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}mi.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),i=Math.floor(r*this.jitter*e);e=(Math.floor(r*10)&1)==0?e-i:e+i}return Math.min(e,this.max)|0};mi.prototype.reset=function(){this.attempts=0};mi.prototype.setMin=function(e){this.ms=e};mi.prototype.setMax=function(e){this.max=e};mi.prototype.setJitter=function(e){this.jitter=e};class mu extends tt{constructor(r,i){var o;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(i=r,r=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Na(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((o=i.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new mi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=r;const h=i.parser||Kv;this.encoder=new h.Encoder,this.decoder=new h.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var i;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(i=this.backoff)===null||i===void 0||i.setMin(r),this)}randomizationFactor(r){var i;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(i=this.backoff)===null||i===void 0||i.setJitter(r),this)}reconnectionDelayMax(r){var i;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(i=this.backoff)===null||i===void 0||i.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new Bv(this.uri,this.opts);const i=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const h=Gt(i,"open",function(){o.onopen(),r&&r()}),S=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),r?r(a):this.maybeReconnectOnOpen()},y=Gt(i,"error",S);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{h(),S(new Error("timeout")),i.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(h),this.subs.push(y),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(Gt(r,"ping",this.onping.bind(this)),Gt(r,"data",this.ondata.bind(this)),Gt(r,"error",this.onerror.bind(this)),Gt(r,"close",this.onclose.bind(this)),Gt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(i){this.onclose("parse error",i)}}ondecoded(r){Pa(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,i){let o=this.nsps[r];return o?this._autoConnect&&!o.active&&o.connect():(o=new __(this,r,i),this.nsps[r]=o),o}_destroy(r){const i=Object.keys(this.nsps);for(const o of i)if(this.nsps[o].active)return;this._close()}_packet(r){const i=this.encoder.encode(r);for(let o=0;o<i.length;o++)this.engine.write(i[o],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,i){var o;this.cleanup(),(o=this.engine)===null||o===void 0||o.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(h=>{h?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",h)):r.onreconnect()}))},i);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const cs={};function da(e,r){typeof e=="object"&&(r=e,e=void 0),r=r||{};const i=Iv(e,r.path||"/socket.io"),o=i.source,h=i.id,S=i.path,y=cs[h]&&S in cs[h].nsps,a=r.forceNew||r["force new connection"]||r.multiplex===!1||y;let l;return a?l=new mu(o,r):(cs[h]||(cs[h]=new mu(o,r)),l=cs[h]),i.query&&!r.query&&(r.query=i.queryKey),l.socket(i.path,r)}Object.assign(da,{Manager:mu,Socket:__,io:da,connect:da});function g_(){return new URLSearchParams(window.location.search).get("token")||""}function Er(e,r){const i=g_(),o=e.includes("?")?"&":"?";return fetch(i?`${e}${o}token=${encodeURIComponent(i)}`:e,r)}function Yv(){const e=J.useRef(null),[r,i]=J.useState([]),[o,h]=J.useState([]),[S,y]=J.useState([]),[a,l]=J.useState(""),[_,v]=J.useState([]);return J.useEffect(()=>{const c=g_(),m=da(window.location.origin,{path:"/socket.io",auth:c?{token:c}:void 0,query:c?{token:c}:void 0});return e.current=m,m.on("agents:updated",C=>{Array.isArray(C)&&i(C)}),m.on("messages:new",C=>{h(b=>[C,...b])}),m.on("messages:all",C=>{Array.isArray(C)&&h(C)}),m.on("context:updated",C=>{y(b=>{const x=b.findIndex(f=>f.key===C.key);if(x>=0){const f=[...b];return f[x]=C,f}return[...b,C]})}),m.on("context:removed",({key:C})=>{y(b=>b.filter(x=>x.key!==C))}),m.on("crewmd:updated",C=>{typeof C=="string"&&l(C)}),m.on("agent:cost",C=>{i(b=>b.map(x=>x.id===C.id?{...x,total_cost:C.total_cost,total_tokens:C.total_tokens}:x))}),m.on("file:changed",C=>{v(b=>[C,...b].slice(0,500))}),m.on("file:changes:cleared",()=>{v([])}),Er("/api/agents").then(C=>C.json()).then(C=>{Array.isArray(C)&&i(C)}).catch(()=>{}),Er("/api/file-changes").then(C=>C.json()).then(C=>{Array.isArray(C)&&v(C)}).catch(()=>{}),Er("/api/context").then(C=>C.json()).then(C=>{Array.isArray(C)&&y(C)}).catch(()=>{}),()=>{m.disconnect()}},[]),{socket:e,agents:r,messages:o,contextEntries:S,crewMd:a,setCrewMd:l,fileChanges:_,setFileChanges:v}}const Gv={running:"var(--green)",starting:"var(--yellow)",idle:"var(--yellow)",done:"var(--text-muted)",dead:"var(--red)"};function Qv({agents:e,selectedId:r,onSelect:i,onKill:o,onRemove:h,onRollback:S,onRestart:y}){return O.jsxs("div",{className:"agent-list",children:[O.jsxs("div",{className:"agent-list-header",children:["Agents (",e.length,")"]}),e.length===0&&O.jsx("div",{className:"agent-list-empty",children:"No agents running"}),e.map(a=>O.jsxs("div",{className:`agent-item ${a.id===r?"selected":""}`,onClick:()=>i(a),children:[O.jsxs("div",{className:"agent-item-header",children:[O.jsx("span",{className:"status-dot",style:{background:Gv[a.status]||"var(--text-muted)"}}),O.jsx("span",{className:"agent-name",children:a.name}),O.jsx("span",{className:`agent-service-badge service-${a.service||"claude"}`,children:a.service||"claude"}),a.total_cost>0&&O.jsxs("span",{className:"agent-cost",children:["$",a.total_cost.toFixed(4)]}),O.jsx("span",{className:"agent-status",children:a.status})]}),O.jsx("div",{className:"agent-task",children:a.task}),(a.status==="running"||a.status==="starting")&&O.jsx("div",{className:"agent-running-actions",children:O.jsx("button",{className:"stop-btn",onClick:l=>{l.stopPropagation(),o(a.id)},children:"Stop"})}),(a.status==="done"||a.status==="dead")&&O.jsxs("div",{className:"agent-done-actions",children:[O.jsx("button",{className:"restart-btn",onClick:l=>{l.stopPropagation(),y(a)},children:"Restart"}),a.checkpoint_hash&&O.jsx("button",{className:"rollback-btn",onClick:l=>{l.stopPropagation(),confirm(`Rollback all changes made by "${a.name}"? This will reset files to the state before the agent started.`)&&S(a.id)},children:"Rollback"}),O.jsx("button",{className:"remove-btn",onClick:l=>{l.stopPropagation(),h(a.id)},children:"Remove"})]})]},a.id))]})}function rt(e){if(typeof e=="string"||typeof e=="number")return""+e;let r="";if(Array.isArray(e))for(let i=0,o;i<e.length;i++)(o=rt(e[i]))!==""&&(r+=(r&&" ")+o);else for(let i in e)e[i]&&(r+=(r&&" ")+i);return r}var Jv={value:()=>{}};function Ba(){for(var e=0,r=arguments.length,i={},o;e<r;++e){if(!(o=arguments[e]+"")||o in i||/[\s.]/.test(o))throw new Error("illegal type: "+o);i[o]=[]}return new fa(i)}function fa(e){this._=e}function Zv(e,r){return e.trim().split(/^|\s+/).map(function(i){var o="",h=i.indexOf(".");if(h>=0&&(o=i.slice(h+1),i=i.slice(0,h)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:o}})}fa.prototype=Ba.prototype={constructor:fa,on:function(e,r){var i=this._,o=Zv(e+"",i),h,S=-1,y=o.length;if(arguments.length<2){for(;++S<y;)if((h=(e=o[S]).type)&&(h=ey(i[h],e.name)))return h;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++S<y;)if(h=(e=o[S]).type)i[h]=qf(i[h],e.name,r);else if(r==null)for(h in i)i[h]=qf(i[h],e.name,null);return this},copy:function(){var e={},r=this._;for(var i in r)e[i]=r[i].slice();return new fa(e)},call:function(e,r){if((h=arguments.length-2)>0)for(var i=new Array(h),o=0,h,S;o<h;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(S=this._[e],o=0,h=S.length;o<h;++o)S[o].value.apply(r,i)},apply:function(e,r,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],h=0,S=o.length;h<S;++h)o[h].value.apply(r,i)}};function ey(e,r){for(var i=0,o=e.length,h;i<o;++i)if((h=e[i]).name===r)return h.value}function qf(e,r,i){for(var o=0,h=e.length;o<h;++o)if(e[o].name===r){e[o]=Jv,e=e.slice(0,o).concat(e.slice(o+1));break}return i!=null&&e.push({name:r,value:i}),e}var vu="http://www.w3.org/1999/xhtml";const Kf={svg:"http://www.w3.org/2000/svg",xhtml:vu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ia(e){var r=e+="",i=r.indexOf(":");return i>=0&&(r=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Kf.hasOwnProperty(r)?{space:Kf[r],local:e}:e}function ty(e){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===vu&&r.documentElement.namespaceURI===vu?r.createElement(e):r.createElementNS(i,e)}}function ry(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function m_(e){var r=Ia(e);return(r.local?ry:ty)(r)}function ny(){}function Uu(e){return e==null?ny:function(){return this.querySelector(e)}}function iy(e){typeof e!="function"&&(e=Uu(e));for(var r=this._groups,i=r.length,o=new Array(i),h=0;h<i;++h)for(var S=r[h],y=S.length,a=o[h]=new Array(y),l,_,v=0;v<y;++v)(l=S[v])&&(_=e.call(l,l.__data__,v,S))&&("__data__"in l&&(_.__data__=l.__data__),a[v]=_);return new Bt(o,this._parents)}function sy(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function oy(){return[]}function v_(e){return e==null?oy:function(){return this.querySelectorAll(e)}}function ay(e){return function(){return sy(e.apply(this,arguments))}}function ly(e){typeof e=="function"?e=ay(e):e=v_(e);for(var r=this._groups,i=r.length,o=[],h=[],S=0;S<i;++S)for(var y=r[S],a=y.length,l,_=0;_<a;++_)(l=y[_])&&(o.push(e.call(l,l.__data__,_,y)),h.push(l));return new Bt(o,h)}function y_(e){return function(){return this.matches(e)}}function w_(e){return function(r){return r.matches(e)}}var cy=Array.prototype.find;function uy(e){return function(){return cy.call(this.children,e)}}function hy(){return this.firstElementChild}function dy(e){return this.select(e==null?hy:uy(typeof e=="function"?e:w_(e)))}var fy=Array.prototype.filter;function py(){return Array.from(this.children)}function _y(e){return function(){return fy.call(this.children,e)}}function gy(e){return this.selectAll(e==null?py:_y(typeof e=="function"?e:w_(e)))}function my(e){typeof e!="function"&&(e=y_(e));for(var r=this._groups,i=r.length,o=new Array(i),h=0;h<i;++h)for(var S=r[h],y=S.length,a=o[h]=[],l,_=0;_<y;++_)(l=S[_])&&e.call(l,l.__data__,_,S)&&a.push(l);return new Bt(o,this._parents)}function S_(e){return new Array(e.length)}function vy(){return new Bt(this._enter||this._groups.map(S_),this._parents)}function wa(e,r){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=r}wa.prototype={constructor:wa,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,r){return this._parent.insertBefore(e,r)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function yy(e){return function(){return e}}function wy(e,r,i,o,h,S){for(var y=0,a,l=r.length,_=S.length;y<_;++y)(a=r[y])?(a.__data__=S[y],o[y]=a):i[y]=new wa(e,S[y]);for(;y<l;++y)(a=r[y])&&(h[y]=a)}function Sy(e,r,i,o,h,S,y){var a,l,_=new Map,v=r.length,c=S.length,m=new Array(v),C;for(a=0;a<v;++a)(l=r[a])&&(m[a]=C=y.call(l,l.__data__,a,r)+"",_.has(C)?h[a]=l:_.set(C,l));for(a=0;a<c;++a)C=y.call(e,S[a],a,S)+"",(l=_.get(C))?(o[a]=l,l.__data__=S[a],_.delete(C)):i[a]=new wa(e,S[a]);for(a=0;a<v;++a)(l=r[a])&&_.get(m[a])===l&&(h[a]=l)}function Cy(e){return e.__data__}function xy(e,r){if(!arguments.length)return Array.from(this,Cy);var i=r?Sy:wy,o=this._parents,h=this._groups;typeof e!="function"&&(e=yy(e));for(var S=h.length,y=new Array(S),a=new Array(S),l=new Array(S),_=0;_<S;++_){var v=o[_],c=h[_],m=c.length,C=by(e.call(v,v&&v.__data__,_,o)),b=C.length,x=a[_]=new Array(b),f=y[_]=new Array(b),p=l[_]=new Array(m);i(v,c,x,f,p,C,r);for(var d=0,u=0,w,L;d<b;++d)if(w=x[d]){for(d>=u&&(u=d+1);!(L=f[u])&&++u<b;);w._next=L||null}}return y=new Bt(y,o),y._enter=a,y._exit=l,y}function by(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ey(){return new Bt(this._exit||this._groups.map(S_),this._parents)}function ky(e,r,i){var o=this.enter(),h=this,S=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),r!=null&&(h=r(h),h&&(h=h.selection())),i==null?S.remove():i(S),o&&h?o.merge(h).order():h}function Ly(e){for(var r=e.selection?e.selection():e,i=this._groups,o=r._groups,h=i.length,S=o.length,y=Math.min(h,S),a=new Array(h),l=0;l<y;++l)for(var _=i[l],v=o[l],c=_.length,m=a[l]=new Array(c),C,b=0;b<c;++b)(C=_[b]||v[b])&&(m[b]=C);for(;l<h;++l)a[l]=i[l];return new Bt(a,this._parents)}function Ry(){for(var e=this._groups,r=-1,i=e.length;++r<i;)for(var o=e[r],h=o.length-1,S=o[h],y;--h>=0;)(y=o[h])&&(S&&y.compareDocumentPosition(S)^4&&S.parentNode.insertBefore(y,S),S=y);return this}function Dy(e){e||(e=Ay);function r(c,m){return c&&m?e(c.__data__,m.__data__):!c-!m}for(var i=this._groups,o=i.length,h=new Array(o),S=0;S<o;++S){for(var y=i[S],a=y.length,l=h[S]=new Array(a),_,v=0;v<a;++v)(_=y[v])&&(l[v]=_);l.sort(r)}return new Bt(h,this._parents).order()}function Ay(e,r){return e<r?-1:e>r?1:e>=r?0:NaN}function Ty(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function My(){return Array.from(this)}function Py(){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var o=e[r],h=0,S=o.length;h<S;++h){var y=o[h];if(y)return y}return null}function Ny(){let e=0;for(const r of this)++e;return e}function By(){return!this.node()}function Iy(e){for(var r=this._groups,i=0,o=r.length;i<o;++i)for(var h=r[i],S=0,y=h.length,a;S<y;++S)(a=h[S])&&e.call(a,a.__data__,S,h);return this}function Oy(e){return function(){this.removeAttribute(e)}}function Hy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Fy(e,r){return function(){this.setAttribute(e,r)}}function jy(e,r){return function(){this.setAttributeNS(e.space,e.local,r)}}function zy(e,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function $y(e,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function Wy(e,r){var i=Ia(e);if(arguments.length<2){var o=this.node();return i.local?o.getAttributeNS(i.space,i.local):o.getAttribute(i)}return this.each((r==null?i.local?Hy:Oy:typeof r=="function"?i.local?$y:zy:i.local?jy:Fy)(i,r))}function C_(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Uy(e){return function(){this.style.removeProperty(e)}}function Vy(e,r,i){return function(){this.style.setProperty(e,r,i)}}function qy(e,r,i){return function(){var o=r.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,i)}}function Ky(e,r,i){return arguments.length>1?this.each((r==null?Uy:typeof r=="function"?qy:Vy)(e,r,i??"")):ci(this.node(),e)}function ci(e,r){return e.style.getPropertyValue(r)||C_(e).getComputedStyle(e,null).getPropertyValue(r)}function Xy(e){return function(){delete this[e]}}function Yy(e,r){return function(){this[e]=r}}function Gy(e,r){return function(){var i=r.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function Qy(e,r){return arguments.length>1?this.each((r==null?Xy:typeof r=="function"?Gy:Yy)(e,r)):this.node()[e]}function x_(e){return e.trim().split(/^|\s+/)}function Vu(e){return e.classList||new b_(e)}function b_(e){this._node=e,this._names=x_(e.getAttribute("class")||"")}b_.prototype={add:function(e){var r=this._names.indexOf(e);r<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var r=this._names.indexOf(e);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function E_(e,r){for(var i=Vu(e),o=-1,h=r.length;++o<h;)i.add(r[o])}function k_(e,r){for(var i=Vu(e),o=-1,h=r.length;++o<h;)i.remove(r[o])}function Jy(e){return function(){E_(this,e)}}function Zy(e){return function(){k_(this,e)}}function e1(e,r){return function(){(r.apply(this,arguments)?E_:k_)(this,e)}}function t1(e,r){var i=x_(e+"");if(arguments.length<2){for(var o=Vu(this.node()),h=-1,S=i.length;++h<S;)if(!o.contains(i[h]))return!1;return!0}return this.each((typeof r=="function"?e1:r?Jy:Zy)(i,r))}function r1(){this.textContent=""}function n1(e){return function(){this.textContent=e}}function i1(e){return function(){var r=e.apply(this,arguments);this.textContent=r??""}}function s1(e){return arguments.length?this.each(e==null?r1:(typeof e=="function"?i1:n1)(e)):this.node().textContent}function o1(){this.innerHTML=""}function a1(e){return function(){this.innerHTML=e}}function l1(e){return function(){var r=e.apply(this,arguments);this.innerHTML=r??""}}function c1(e){return arguments.length?this.each(e==null?o1:(typeof e=="function"?l1:a1)(e)):this.node().innerHTML}function u1(){this.nextSibling&&this.parentNode.appendChild(this)}function h1(){return this.each(u1)}function d1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function f1(){return this.each(d1)}function p1(e){var r=typeof e=="function"?e:m_(e);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function _1(){return null}function g1(e,r){var i=typeof e=="function"?e:m_(e),o=r==null?_1:typeof r=="function"?r:Uu(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),o.apply(this,arguments)||null)})}function m1(){var e=this.parentNode;e&&e.removeChild(this)}function v1(){return this.each(m1)}function y1(){var e=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function w1(){var e=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(e,this.nextSibling):e}function S1(e){return this.select(e?w1:y1)}function C1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function x1(e){return function(r){e.call(this,r,this.__data__)}}function b1(e){return e.trim().split(/^|\s+/).map(function(r){var i="",o=r.indexOf(".");return o>=0&&(i=r.slice(o+1),r=r.slice(0,o)),{type:r,name:i}})}function E1(e){return function(){var r=this.__on;if(r){for(var i=0,o=-1,h=r.length,S;i<h;++i)S=r[i],(!e.type||S.type===e.type)&&S.name===e.name?this.removeEventListener(S.type,S.listener,S.options):r[++o]=S;++o?r.length=o:delete this.__on}}}function k1(e,r,i){return function(){var o=this.__on,h,S=x1(r);if(o){for(var y=0,a=o.length;y<a;++y)if((h=o[y]).type===e.type&&h.name===e.name){this.removeEventListener(h.type,h.listener,h.options),this.addEventListener(h.type,h.listener=S,h.options=i),h.value=r;return}}this.addEventListener(e.type,S,i),h={type:e.type,name:e.name,value:r,listener:S,options:i},o?o.push(h):this.__on=[h]}}function L1(e,r,i){var o=b1(e+""),h,S=o.length,y;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,_=a.length,v;l<_;++l)for(h=0,v=a[l];h<S;++h)if((y=o[h]).type===v.type&&y.name===v.name)return v.value}return}for(a=r?k1:E1,h=0;h<S;++h)this.each(a(o[h],r,i));return this}function L_(e,r,i){var o=C_(e),h=o.CustomEvent;typeof h=="function"?h=new h(r,i):(h=o.document.createEvent("Event"),i?(h.initEvent(r,i.bubbles,i.cancelable),h.detail=i.detail):h.initEvent(r,!1,!1)),e.dispatchEvent(h)}function R1(e,r){return function(){return L_(this,e,r)}}function D1(e,r){return function(){return L_(this,e,r.apply(this,arguments))}}function A1(e,r){return this.each((typeof r=="function"?D1:R1)(e,r))}function*T1(){for(var e=this._groups,r=0,i=e.length;r<i;++r)for(var o=e[r],h=0,S=o.length,y;h<S;++h)(y=o[h])&&(yield y)}var R_=[null];function Bt(e,r){this._groups=e,this._parents=r}function Ls(){return new Bt([[document.documentElement]],R_)}function M1(){return this}Bt.prototype=Ls.prototype={constructor:Bt,select:iy,selectAll:ly,selectChild:dy,selectChildren:gy,filter:my,data:xy,enter:vy,exit:Ey,join:ky,merge:Ly,selection:M1,order:Ry,sort:Dy,call:Ty,nodes:My,node:Py,size:Ny,empty:By,each:Iy,attr:Wy,style:Ky,property:Qy,classed:t1,text:s1,html:c1,raise:h1,lower:f1,append:p1,insert:g1,remove:v1,clone:S1,datum:C1,on:L1,dispatch:A1,[Symbol.iterator]:T1};function Nt(e){return typeof e=="string"?new Bt([[document.querySelector(e)]],[document.documentElement]):new Bt([[e]],R_)}function P1(e){let r;for(;r=e.sourceEvent;)e=r;return e}function Qt(e,r){if(e=P1(e),r===void 0&&(r=e.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var o=i.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(r.getScreenCTM().inverse()),[o.x,o.y]}if(r.getBoundingClientRect){var h=r.getBoundingClientRect();return[e.clientX-h.left-r.clientLeft,e.clientY-h.top-r.clientTop]}}return[e.pageX,e.pageY]}const N1={passive:!1},ms={capture:!0,passive:!1};function qc(e){e.stopImmediatePropagation()}function ai(e){e.preventDefault(),e.stopImmediatePropagation()}function D_(e){var r=e.document.documentElement,i=Nt(e).on("dragstart.drag",ai,ms);"onselectstart"in r?i.on("selectstart.drag",ai,ms):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function A_(e,r){var i=e.document.documentElement,o=Nt(e).on("dragstart.drag",null);r&&(o.on("click.drag",ai,ms),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in i?o.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Zo=e=>()=>e;function yu(e,{sourceEvent:r,subject:i,target:o,identifier:h,active:S,x:y,y:a,dx:l,dy:_,dispatch:v}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:h,enumerable:!0,configurable:!0},active:{value:S,enumerable:!0,configurable:!0},x:{value:y,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:_,enumerable:!0,configurable:!0},_:{value:v}})}yu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function B1(e){return!e.ctrlKey&&!e.button}function I1(){return this.parentNode}function O1(e,r){return r??{x:e.x,y:e.y}}function H1(){return navigator.maxTouchPoints||"ontouchstart"in this}function T_(){var e=B1,r=I1,i=O1,o=H1,h={},S=Ba("start","drag","end"),y=0,a,l,_,v,c=0;function m(w){w.on("mousedown.drag",C).filter(o).on("touchstart.drag",f).on("touchmove.drag",p,N1).on("touchend.drag touchcancel.drag",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(w,L){if(!(v||!e.call(this,w,L))){var R=u(this,r.call(this,w,L),w,L,"mouse");R&&(Nt(w.view).on("mousemove.drag",b,ms).on("mouseup.drag",x,ms),D_(w.view),qc(w),_=!1,a=w.clientX,l=w.clientY,R("start",w))}}function b(w){if(ai(w),!_){var L=w.clientX-a,R=w.clientY-l;_=L*L+R*R>c}h.mouse("drag",w)}function x(w){Nt(w.view).on("mousemove.drag mouseup.drag",null),A_(w.view,_),ai(w),h.mouse("end",w)}function f(w,L){if(e.call(this,w,L)){var R=w.changedTouches,D=r.call(this,w,L),k=R.length,M,W;for(M=0;M<k;++M)(W=u(this,D,w,L,R[M].identifier,R[M]))&&(qc(w),W("start",w,R[M]))}}function p(w){var L=w.changedTouches,R=L.length,D,k;for(D=0;D<R;++D)(k=h[L[D].identifier])&&(ai(w),k("drag",w,L[D]))}function d(w){var L=w.changedTouches,R=L.length,D,k;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),D=0;D<R;++D)(k=h[L[D].identifier])&&(qc(w),k("end",w,L[D]))}function u(w,L,R,D,k,M){var W=S.copy(),z=Qt(M||R,L),j,N,I;if((I=i.call(w,new yu("beforestart",{sourceEvent:R,target:m,identifier:k,active:y,x:z[0],y:z[1],dx:0,dy:0,dispatch:W}),D))!=null)return j=I.x-z[0]||0,N=I.y-z[1]||0,function q(U,K,V){var T=z,B;switch(U){case"start":h[k]=q,B=y++;break;case"end":delete h[k],--y;case"drag":z=Qt(V||K,L),B=y;break}W.call(U,w,new yu(U,{sourceEvent:K,subject:I,target:m,identifier:k,active:B,x:z[0]+j,y:z[1]+N,dx:z[0]-T[0],dy:z[1]-T[1],dispatch:W}),D)}}return m.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Zo(!!w),m):e},m.container=function(w){return arguments.length?(r=typeof w=="function"?w:Zo(w),m):r},m.subject=function(w){return arguments.length?(i=typeof w=="function"?w:Zo(w),m):i},m.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:Zo(!!w),m):o},m.on=function(){var w=S.on.apply(S,arguments);return w===S?m:w},m.clickDistance=function(w){return arguments.length?(c=(w=+w)*w,m):Math.sqrt(c)},m}function qu(e,r,i){e.prototype=r.prototype=i,i.constructor=e}function M_(e,r){var i=Object.create(e.prototype);for(var o in r)i[o]=r[o];return i}function Rs(){}var vs=.7,Sa=1/vs,li="\\s*([+-]?\\d+)\\s*",ys="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ur="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",F1=/^#([0-9a-f]{3,8})$/,j1=new RegExp(`^rgb\\(${li},${li},${li}\\)$`),z1=new RegExp(`^rgb\\(${ur},${ur},${ur}\\)$`),$1=new RegExp(`^rgba\\(${li},${li},${li},${ys}\\)$`),W1=new RegExp(`^rgba\\(${ur},${ur},${ur},${ys}\\)$`),U1=new RegExp(`^hsl\\(${ys},${ur},${ur}\\)$`),V1=new RegExp(`^hsla\\(${ys},${ur},${ur},${ys}\\)$`),Xf={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};qu(Rs,bn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Yf,formatHex:Yf,formatHex8:q1,formatHsl:K1,formatRgb:Gf,toString:Gf});function Yf(){return this.rgb().formatHex()}function q1(){return this.rgb().formatHex8()}function K1(){return P_(this).formatHsl()}function Gf(){return this.rgb().formatRgb()}function bn(e){var r,i;return e=(e+"").trim().toLowerCase(),(r=F1.exec(e))?(i=r[1].length,r=parseInt(r[1],16),i===6?Qf(r):i===3?new Lt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?ea(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?ea(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=j1.exec(e))?new Lt(r[1],r[2],r[3],1):(r=z1.exec(e))?new Lt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=$1.exec(e))?ea(r[1],r[2],r[3],r[4]):(r=W1.exec(e))?ea(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=U1.exec(e))?ep(r[1],r[2]/100,r[3]/100,1):(r=V1.exec(e))?ep(r[1],r[2]/100,r[3]/100,r[4]):Xf.hasOwnProperty(e)?Qf(Xf[e]):e==="transparent"?new Lt(NaN,NaN,NaN,0):null}function Qf(e){return new Lt(e>>16&255,e>>8&255,e&255,1)}function ea(e,r,i,o){return o<=0&&(e=r=i=NaN),new Lt(e,r,i,o)}function X1(e){return e instanceof Rs||(e=bn(e)),e?(e=e.rgb(),new Lt(e.r,e.g,e.b,e.opacity)):new Lt}function wu(e,r,i,o){return arguments.length===1?X1(e):new Lt(e,r,i,o??1)}function Lt(e,r,i,o){this.r=+e,this.g=+r,this.b=+i,this.opacity=+o}qu(Lt,wu,M_(Rs,{brighter(e){return e=e==null?Sa:Math.pow(Sa,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vs:Math.pow(vs,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lt(Cn(this.r),Cn(this.g),Cn(this.b),Ca(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:Jf,formatHex:Jf,formatHex8:Y1,formatRgb:Zf,toString:Zf}));function Jf(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}`}function Y1(){return`#${Sn(this.r)}${Sn(this.g)}${Sn(this.b)}${Sn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Zf(){const e=Ca(this.opacity);return`${e===1?"rgb(":"rgba("}${Cn(this.r)}, ${Cn(this.g)}, ${Cn(this.b)}${e===1?")":`, ${e})`}`}function Ca(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Cn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sn(e){return e=Cn(e),(e<16?"0":"")+e.toString(16)}function ep(e,r,i,o){return o<=0?e=r=i=NaN:i<=0||i>=1?e=r=NaN:r<=0&&(e=NaN),new Jt(e,r,i,o)}function P_(e){if(e instanceof Jt)return new Jt(e.h,e.s,e.l,e.opacity);if(e instanceof Rs||(e=bn(e)),!e)return new Jt;if(e instanceof Jt)return e;e=e.rgb();var r=e.r/255,i=e.g/255,o=e.b/255,h=Math.min(r,i,o),S=Math.max(r,i,o),y=NaN,a=S-h,l=(S+h)/2;return a?(r===S?y=(i-o)/a+(i<o)*6:i===S?y=(o-r)/a+2:y=(r-i)/a+4,a/=l<.5?S+h:2-S-h,y*=60):a=l>0&&l<1?0:y,new Jt(y,a,l,e.opacity)}function G1(e,r,i,o){return arguments.length===1?P_(e):new Jt(e,r,i,o??1)}function Jt(e,r,i,o){this.h=+e,this.s=+r,this.l=+i,this.opacity=+o}qu(Jt,G1,M_(Rs,{brighter(e){return e=e==null?Sa:Math.pow(Sa,e),new Jt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vs:Math.pow(vs,e),new Jt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,r=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,o=i+(i<.5?i:1-i)*r,h=2*i-o;return new Lt(Kc(e>=240?e-240:e+120,h,o),Kc(e,h,o),Kc(e<120?e+240:e-120,h,o),this.opacity)},clamp(){return new Jt(tp(this.h),ta(this.s),ta(this.l),Ca(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ca(this.opacity);return`${e===1?"hsl(":"hsla("}${tp(this.h)}, ${ta(this.s)*100}%, ${ta(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tp(e){return e=(e||0)%360,e<0?e+360:e}function ta(e){return Math.max(0,Math.min(1,e||0))}function Kc(e,r,i){return(e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r)*255}const Ku=e=>()=>e;function Q1(e,r){return function(i){return e+i*r}}function J1(e,r,i){return e=Math.pow(e,i),r=Math.pow(r,i)-e,i=1/i,function(o){return Math.pow(e+o*r,i)}}function Z1(e){return(e=+e)==1?N_:function(r,i){return i-r?J1(r,i,e):Ku(isNaN(r)?i:r)}}function N_(e,r){var i=r-e;return i?Q1(e,i):Ku(isNaN(e)?r:e)}const xa=(function e(r){var i=Z1(r);function o(h,S){var y=i((h=wu(h)).r,(S=wu(S)).r),a=i(h.g,S.g),l=i(h.b,S.b),_=N_(h.opacity,S.opacity);return function(v){return h.r=y(v),h.g=a(v),h.b=l(v),h.opacity=_(v),h+""}}return o.gamma=e,o})(1);function ew(e,r){r||(r=[]);var i=e?Math.min(r.length,e.length):0,o=r.slice(),h;return function(S){for(h=0;h<i;++h)o[h]=e[h]*(1-S)+r[h]*S;return o}}function tw(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rw(e,r){var i=r?r.length:0,o=e?Math.min(i,e.length):0,h=new Array(o),S=new Array(i),y;for(y=0;y<o;++y)h[y]=_s(e[y],r[y]);for(;y<i;++y)S[y]=r[y];return function(a){for(y=0;y<o;++y)S[y]=h[y](a);return S}}function nw(e,r){var i=new Date;return e=+e,r=+r,function(o){return i.setTime(e*(1-o)+r*o),i}}function lr(e,r){return e=+e,r=+r,function(i){return e*(1-i)+r*i}}function iw(e,r){var i={},o={},h;(e===null||typeof e!="object")&&(e={}),(r===null||typeof r!="object")&&(r={});for(h in r)h in e?i[h]=_s(e[h],r[h]):o[h]=r[h];return function(S){for(h in i)o[h]=i[h](S);return o}}var Su=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xc=new RegExp(Su.source,"g");function sw(e){return function(){return e}}function ow(e){return function(r){return e(r)+""}}function B_(e,r){var i=Su.lastIndex=Xc.lastIndex=0,o,h,S,y=-1,a=[],l=[];for(e=e+"",r=r+"";(o=Su.exec(e))&&(h=Xc.exec(r));)(S=h.index)>i&&(S=r.slice(i,S),a[y]?a[y]+=S:a[++y]=S),(o=o[0])===(h=h[0])?a[y]?a[y]+=h:a[++y]=h:(a[++y]=null,l.push({i:y,x:lr(o,h)})),i=Xc.lastIndex;return i<r.length&&(S=r.slice(i),a[y]?a[y]+=S:a[++y]=S),a.length<2?l[0]?ow(l[0].x):sw(r):(r=l.length,function(_){for(var v=0,c;v<r;++v)a[(c=l[v]).i]=c.x(_);return a.join("")})}function _s(e,r){var i=typeof r,o;return r==null||i==="boolean"?Ku(r):(i==="number"?lr:i==="string"?(o=bn(r))?(r=o,xa):B_:r instanceof bn?xa:r instanceof Date?nw:tw(r)?ew:Array.isArray(r)?rw:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?iw:lr)(e,r)}var rp=180/Math.PI,Cu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function I_(e,r,i,o,h,S){var y,a,l;return(y=Math.sqrt(e*e+r*r))&&(e/=y,r/=y),(l=e*i+r*o)&&(i-=e*l,o-=r*l),(a=Math.sqrt(i*i+o*o))&&(i/=a,o/=a,l/=a),e*o<r*i&&(e=-e,r=-r,l=-l,y=-y),{translateX:h,translateY:S,rotate:Math.atan2(r,e)*rp,skewX:Math.atan(l)*rp,scaleX:y,scaleY:a}}var ra;function aw(e){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return r.isIdentity?Cu:I_(r.a,r.b,r.c,r.d,r.e,r.f)}function lw(e){return e==null||(ra||(ra=document.createElementNS("http://www.w3.org/2000/svg","g")),ra.setAttribute("transform",e),!(e=ra.transform.baseVal.consolidate()))?Cu:(e=e.matrix,I_(e.a,e.b,e.c,e.d,e.e,e.f))}function O_(e,r,i,o){function h(_){return _.length?_.pop()+" ":""}function S(_,v,c,m,C,b){if(_!==c||v!==m){var x=C.push("translate(",null,r,null,i);b.push({i:x-4,x:lr(_,c)},{i:x-2,x:lr(v,m)})}else(c||m)&&C.push("translate("+c+r+m+i)}function y(_,v,c,m){_!==v?(_-v>180?v+=360:v-_>180&&(_+=360),m.push({i:c.push(h(c)+"rotate(",null,o)-2,x:lr(_,v)})):v&&c.push(h(c)+"rotate("+v+o)}function a(_,v,c,m){_!==v?m.push({i:c.push(h(c)+"skewX(",null,o)-2,x:lr(_,v)}):v&&c.push(h(c)+"skewX("+v+o)}function l(_,v,c,m,C,b){if(_!==c||v!==m){var x=C.push(h(C)+"scale(",null,",",null,")");b.push({i:x-4,x:lr(_,c)},{i:x-2,x:lr(v,m)})}else(c!==1||m!==1)&&C.push(h(C)+"scale("+c+","+m+")")}return function(_,v){var c=[],m=[];return _=e(_),v=e(v),S(_.translateX,_.translateY,v.translateX,v.translateY,c,m),y(_.rotate,v.rotate,c,m),a(_.skewX,v.skewX,c,m),l(_.scaleX,_.scaleY,v.scaleX,v.scaleY,c,m),_=v=null,function(C){for(var b=-1,x=m.length,f;++b<x;)c[(f=m[b]).i]=f.x(C);return c.join("")}}}var cw=O_(aw,"px, ","px)","deg)"),uw=O_(lw,", ",")",")"),hw=1e-12;function np(e){return((e=Math.exp(e))+1/e)/2}function dw(e){return((e=Math.exp(e))-1/e)/2}function fw(e){return((e=Math.exp(2*e))-1)/(e+1)}const pa=(function e(r,i,o){function h(S,y){var a=S[0],l=S[1],_=S[2],v=y[0],c=y[1],m=y[2],C=v-a,b=c-l,x=C*C+b*b,f,p;if(x<hw)p=Math.log(m/_)/r,f=function(D){return[a+D*C,l+D*b,_*Math.exp(r*D*p)]};else{var d=Math.sqrt(x),u=(m*m-_*_+o*x)/(2*_*i*d),w=(m*m-_*_-o*x)/(2*m*i*d),L=Math.log(Math.sqrt(u*u+1)-u),R=Math.log(Math.sqrt(w*w+1)-w);p=(R-L)/r,f=function(D){var k=D*p,M=np(L),W=_/(i*d)*(M*fw(r*k+L)-dw(L));return[a+W*C,l+W*b,_*M/np(r*k+L)]}}return f.duration=p*1e3*r/Math.SQRT2,f}return h.rho=function(S){var y=Math.max(.001,+S),a=y*y,l=a*a;return e(y,a,l)},h})(Math.SQRT2,2,4);var ui=0,fs=0,us=0,H_=1e3,ba,ps,Ea=0,En=0,Oa=0,ws=typeof performance=="object"&&performance.now?performance:Date,F_=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Xu(){return En||(F_(pw),En=ws.now()+Oa)}function pw(){En=0}function ka(){this._call=this._time=this._next=null}ka.prototype=j_.prototype={constructor:ka,restart:function(e,r,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Xu():+i)+(r==null?0:+r),!this._next&&ps!==this&&(ps?ps._next=this:ba=this,ps=this),this._call=e,this._time=i,xu()},stop:function(){this._call&&(this._call=null,this._time=1/0,xu())}};function j_(e,r,i){var o=new ka;return o.restart(e,r,i),o}function _w(){Xu(),++ui;for(var e=ba,r;e;)(r=En-e._time)>=0&&e._call.call(void 0,r),e=e._next;--ui}function ip(){En=(Ea=ws.now())+Oa,ui=fs=0;try{_w()}finally{ui=0,mw(),En=0}}function gw(){var e=ws.now(),r=e-Ea;r>H_&&(Oa-=r,Ea=e)}function mw(){for(var e,r=ba,i,o=1/0;r;)r._call?(o>r._time&&(o=r._time),e=r,r=r._next):(i=r._next,r._next=null,r=e?e._next=i:ba=i);ps=e,xu(o)}function xu(e){if(!ui){fs&&(fs=clearTimeout(fs));var r=e-En;r>24?(e<1/0&&(fs=setTimeout(ip,e-ws.now()-Oa)),us&&(us=clearInterval(us))):(us||(Ea=ws.now(),us=setInterval(gw,H_)),ui=1,F_(ip))}}function sp(e,r,i){var o=new ka;return r=r==null?0:+r,o.restart(h=>{o.stop(),e(h+r)},r,i),o}var vw=Ba("start","end","cancel","interrupt"),yw=[],z_=0,op=1,bu=2,_a=3,ap=4,Eu=5,ga=6;function Ha(e,r,i,o,h,S){var y=e.__transition;if(!y)e.__transition={};else if(i in y)return;ww(e,i,{name:r,index:o,group:h,on:vw,tween:yw,time:S.time,delay:S.delay,duration:S.duration,ease:S.ease,timer:null,state:z_})}function Yu(e,r){var i=tr(e,r);if(i.state>z_)throw new Error("too late; already scheduled");return i}function fr(e,r){var i=tr(e,r);if(i.state>_a)throw new Error("too late; already running");return i}function tr(e,r){var i=e.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function ww(e,r,i){var o=e.__transition,h;o[r]=i,i.timer=j_(S,0,i.time);function S(_){i.state=op,i.timer.restart(y,i.delay,i.time),i.delay<=_&&y(_-i.delay)}function y(_){var v,c,m,C;if(i.state!==op)return l();for(v in o)if(C=o[v],C.name===i.name){if(C.state===_a)return sp(y);C.state===ap?(C.state=ga,C.timer.stop(),C.on.call("interrupt",e,e.__data__,C.index,C.group),delete o[v]):+v<r&&(C.state=ga,C.timer.stop(),C.on.call("cancel",e,e.__data__,C.index,C.group),delete o[v])}if(sp(function(){i.state===_a&&(i.state=ap,i.timer.restart(a,i.delay,i.time),a(_))}),i.state=bu,i.on.call("start",e,e.__data__,i.index,i.group),i.state===bu){for(i.state=_a,h=new Array(m=i.tween.length),v=0,c=-1;v<m;++v)(C=i.tween[v].value.call(e,e.__data__,i.index,i.group))&&(h[++c]=C);h.length=c+1}}function a(_){for(var v=_<i.duration?i.ease.call(null,_/i.duration):(i.timer.restart(l),i.state=Eu,1),c=-1,m=h.length;++c<m;)h[c].call(e,v);i.state===Eu&&(i.on.call("end",e,e.__data__,i.index,i.group),l())}function l(){i.state=ga,i.timer.stop(),delete o[r];for(var _ in o)return;delete e.__transition}}function ma(e,r){var i=e.__transition,o,h,S=!0,y;if(i){r=r==null?null:r+"";for(y in i){if((o=i[y]).name!==r){S=!1;continue}h=o.state>bu&&o.state<Eu,o.state=ga,o.timer.stop(),o.on.call(h?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete i[y]}S&&delete e.__transition}}function Sw(e){return this.each(function(){ma(this,e)})}function Cw(e,r){var i,o;return function(){var h=fr(this,e),S=h.tween;if(S!==i){o=i=S;for(var y=0,a=o.length;y<a;++y)if(o[y].name===r){o=o.slice(),o.splice(y,1);break}}h.tween=o}}function xw(e,r,i){var o,h;if(typeof i!="function")throw new Error;return function(){var S=fr(this,e),y=S.tween;if(y!==o){h=(o=y).slice();for(var a={name:r,value:i},l=0,_=h.length;l<_;++l)if(h[l].name===r){h[l]=a;break}l===_&&h.push(a)}S.tween=h}}function bw(e,r){var i=this._id;if(e+="",arguments.length<2){for(var o=tr(this.node(),i).tween,h=0,S=o.length,y;h<S;++h)if((y=o[h]).name===e)return y.value;return null}return this.each((r==null?Cw:xw)(i,e,r))}function Gu(e,r,i){var o=e._id;return e.each(function(){var h=fr(this,o);(h.value||(h.value={}))[r]=i.apply(this,arguments)}),function(h){return tr(h,o).value[r]}}function $_(e,r){var i;return(typeof r=="number"?lr:r instanceof bn?xa:(i=bn(r))?(r=i,xa):B_)(e,r)}function Ew(e){return function(){this.removeAttribute(e)}}function kw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lw(e,r,i){var o,h=i+"",S;return function(){var y=this.getAttribute(e);return y===h?null:y===o?S:S=r(o=y,i)}}function Rw(e,r,i){var o,h=i+"",S;return function(){var y=this.getAttributeNS(e.space,e.local);return y===h?null:y===o?S:S=r(o=y,i)}}function Dw(e,r,i){var o,h,S;return function(){var y,a=i(this),l;return a==null?void this.removeAttribute(e):(y=this.getAttribute(e),l=a+"",y===l?null:y===o&&l===h?S:(h=l,S=r(o=y,a)))}}function Aw(e,r,i){var o,h,S;return function(){var y,a=i(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(y=this.getAttributeNS(e.space,e.local),l=a+"",y===l?null:y===o&&l===h?S:(h=l,S=r(o=y,a)))}}function Tw(e,r){var i=Ia(e),o=i==="transform"?uw:$_;return this.attrTween(e,typeof r=="function"?(i.local?Aw:Dw)(i,o,Gu(this,"attr."+e,r)):r==null?(i.local?kw:Ew)(i):(i.local?Rw:Lw)(i,o,r))}function Mw(e,r){return function(i){this.setAttribute(e,r.call(this,i))}}function Pw(e,r){return function(i){this.setAttributeNS(e.space,e.local,r.call(this,i))}}function Nw(e,r){var i,o;function h(){var S=r.apply(this,arguments);return S!==o&&(i=(o=S)&&Pw(e,S)),i}return h._value=r,h}function Bw(e,r){var i,o;function h(){var S=r.apply(this,arguments);return S!==o&&(i=(o=S)&&Mw(e,S)),i}return h._value=r,h}function Iw(e,r){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var o=Ia(e);return this.tween(i,(o.local?Nw:Bw)(o,r))}function Ow(e,r){return function(){Yu(this,e).delay=+r.apply(this,arguments)}}function Hw(e,r){return r=+r,function(){Yu(this,e).delay=r}}function Fw(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?Ow:Hw)(r,e)):tr(this.node(),r).delay}function jw(e,r){return function(){fr(this,e).duration=+r.apply(this,arguments)}}function zw(e,r){return r=+r,function(){fr(this,e).duration=r}}function $w(e){var r=this._id;return arguments.length?this.each((typeof e=="function"?jw:zw)(r,e)):tr(this.node(),r).duration}function Ww(e,r){if(typeof r!="function")throw new Error;return function(){fr(this,e).ease=r}}function Uw(e){var r=this._id;return arguments.length?this.each(Ww(r,e)):tr(this.node(),r).ease}function Vw(e,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;fr(this,e).ease=i}}function qw(e){if(typeof e!="function")throw new Error;return this.each(Vw(this._id,e))}function Kw(e){typeof e!="function"&&(e=y_(e));for(var r=this._groups,i=r.length,o=new Array(i),h=0;h<i;++h)for(var S=r[h],y=S.length,a=o[h]=[],l,_=0;_<y;++_)(l=S[_])&&e.call(l,l.__data__,_,S)&&a.push(l);return new Lr(o,this._parents,this._name,this._id)}function Xw(e){if(e._id!==this._id)throw new Error;for(var r=this._groups,i=e._groups,o=r.length,h=i.length,S=Math.min(o,h),y=new Array(o),a=0;a<S;++a)for(var l=r[a],_=i[a],v=l.length,c=y[a]=new Array(v),m,C=0;C<v;++C)(m=l[C]||_[C])&&(c[C]=m);for(;a<o;++a)y[a]=r[a];return new Lr(y,this._parents,this._name,this._id)}function Yw(e){return(e+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function Gw(e,r,i){var o,h,S=Yw(r)?Yu:fr;return function(){var y=S(this,e),a=y.on;a!==o&&(h=(o=a).copy()).on(r,i),y.on=h}}function Qw(e,r){var i=this._id;return arguments.length<2?tr(this.node(),i).on.on(e):this.each(Gw(i,e,r))}function Jw(e){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==e)return;r&&r.removeChild(this)}}function Zw(){return this.on("end.remove",Jw(this._id))}function eS(e){var r=this._name,i=this._id;typeof e!="function"&&(e=Uu(e));for(var o=this._groups,h=o.length,S=new Array(h),y=0;y<h;++y)for(var a=o[y],l=a.length,_=S[y]=new Array(l),v,c,m=0;m<l;++m)(v=a[m])&&(c=e.call(v,v.__data__,m,a))&&("__data__"in v&&(c.__data__=v.__data__),_[m]=c,Ha(_[m],r,i,m,_,tr(v,i)));return new Lr(S,this._parents,r,i)}function tS(e){var r=this._name,i=this._id;typeof e!="function"&&(e=v_(e));for(var o=this._groups,h=o.length,S=[],y=[],a=0;a<h;++a)for(var l=o[a],_=l.length,v,c=0;c<_;++c)if(v=l[c]){for(var m=e.call(v,v.__data__,c,l),C,b=tr(v,i),x=0,f=m.length;x<f;++x)(C=m[x])&&Ha(C,r,i,x,m,b);S.push(m),y.push(v)}return new Lr(S,y,r,i)}var rS=Ls.prototype.constructor;function nS(){return new rS(this._groups,this._parents)}function iS(e,r){var i,o,h;return function(){var S=ci(this,e),y=(this.style.removeProperty(e),ci(this,e));return S===y?null:S===i&&y===o?h:h=r(i=S,o=y)}}function W_(e){return function(){this.style.removeProperty(e)}}function sS(e,r,i){var o,h=i+"",S;return function(){var y=ci(this,e);return y===h?null:y===o?S:S=r(o=y,i)}}function oS(e,r,i){var o,h,S;return function(){var y=ci(this,e),a=i(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),ci(this,e))),y===l?null:y===o&&l===h?S:(h=l,S=r(o=y,a))}}function aS(e,r){var i,o,h,S="style."+r,y="end."+S,a;return function(){var l=fr(this,e),_=l.on,v=l.value[S]==null?a||(a=W_(r)):void 0;(_!==i||h!==v)&&(o=(i=_).copy()).on(y,h=v),l.on=o}}function lS(e,r,i){var o=(e+="")=="transform"?cw:$_;return r==null?this.styleTween(e,iS(e,o)).on("end.style."+e,W_(e)):typeof r=="function"?this.styleTween(e,oS(e,o,Gu(this,"style."+e,r))).each(aS(this._id,e)):this.styleTween(e,sS(e,o,r),i).on("end.style."+e,null)}function cS(e,r,i){return function(o){this.style.setProperty(e,r.call(this,o),i)}}function uS(e,r,i){var o,h;function S(){var y=r.apply(this,arguments);return y!==h&&(o=(h=y)&&cS(e,y,i)),o}return S._value=r,S}function hS(e,r,i){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;return this.tween(o,uS(e,r,i??""))}function dS(e){return function(){this.textContent=e}}function fS(e){return function(){var r=e(this);this.textContent=r??""}}function pS(e){return this.tween("text",typeof e=="function"?fS(Gu(this,"text",e)):dS(e==null?"":e+""))}function _S(e){return function(r){this.textContent=e.call(this,r)}}function gS(e){var r,i;function o(){var h=e.apply(this,arguments);return h!==i&&(r=(i=h)&&_S(h)),r}return o._value=e,o}function mS(e){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,gS(e))}function vS(){for(var e=this._name,r=this._id,i=U_(),o=this._groups,h=o.length,S=0;S<h;++S)for(var y=o[S],a=y.length,l,_=0;_<a;++_)if(l=y[_]){var v=tr(l,r);Ha(l,e,i,_,y,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Lr(o,this._parents,e,i)}function yS(){var e,r,i=this,o=i._id,h=i.size();return new Promise(function(S,y){var a={value:y},l={value:function(){--h===0&&S()}};i.each(function(){var _=fr(this,o),v=_.on;v!==e&&(r=(e=v).copy(),r._.cancel.push(a),r._.interrupt.push(a),r._.end.push(l)),_.on=r}),h===0&&S()})}var wS=0;function Lr(e,r,i,o){this._groups=e,this._parents=r,this._name=i,this._id=o}function U_(){return++wS}var xr=Ls.prototype;Lr.prototype={constructor:Lr,select:eS,selectAll:tS,selectChild:xr.selectChild,selectChildren:xr.selectChildren,filter:Kw,merge:Xw,selection:nS,transition:vS,call:xr.call,nodes:xr.nodes,node:xr.node,size:xr.size,empty:xr.empty,each:xr.each,on:Qw,attr:Tw,attrTween:Iw,style:lS,styleTween:hS,text:pS,textTween:mS,remove:Zw,tween:bw,delay:Fw,duration:$w,ease:Uw,easeVarying:qw,end:yS,[Symbol.iterator]:xr[Symbol.iterator]};function SS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var CS={time:null,delay:0,duration:250,ease:SS};function xS(e,r){for(var i;!(i=e.__transition)||!(i=i[r]);)if(!(e=e.parentNode))throw new Error(`transition ${r} not found`);return i}function bS(e){var r,i;e instanceof Lr?(r=e._id,e=e._name):(r=U_(),(i=CS).time=Xu(),e=e==null?null:e+"");for(var o=this._groups,h=o.length,S=0;S<h;++S)for(var y=o[S],a=y.length,l,_=0;_<a;++_)(l=y[_])&&Ha(l,e,r,_,y,i||xS(l,r));return new Lr(o,this._parents,e,r)}Ls.prototype.interrupt=Sw;Ls.prototype.transition=bS;const na=e=>()=>e;function ES(e,{sourceEvent:r,target:i,transform:o,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:h}})}function kr(e,r,i){this.k=e,this.x=r,this.y=i}kr.prototype={constructor:kr,scale:function(e){return e===1?this:new kr(this.k*e,this.x,this.y)},translate:function(e,r){return e===0&r===0?this:new kr(this.k,this.x+this.k*e,this.y+this.k*r)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Fa=new kr(1,0,0);V_.prototype=kr.prototype;function V_(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Fa;return e.__zoom}function Yc(e){e.stopImmediatePropagation()}function hs(e){e.preventDefault(),e.stopImmediatePropagation()}function kS(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function LS(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function lp(){return this.__zoom||Fa}function RS(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function DS(){return navigator.maxTouchPoints||"ontouchstart"in this}function AS(e,r,i){var o=e.invertX(r[0][0])-i[0][0],h=e.invertX(r[1][0])-i[1][0],S=e.invertY(r[0][1])-i[0][1],y=e.invertY(r[1][1])-i[1][1];return e.translate(h>o?(o+h)/2:Math.min(0,o)||Math.max(0,h),y>S?(S+y)/2:Math.min(0,S)||Math.max(0,y))}function q_(){var e=kS,r=LS,i=AS,o=RS,h=DS,S=[0,1/0],y=[[-1/0,-1/0],[1/0,1/0]],a=250,l=pa,_=Ba("start","zoom","end"),v,c,m,C=500,b=150,x=0,f=10;function p(I){I.property("__zoom",lp).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",W).filter(h).on("touchstart.zoom",z).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(I,q,U,K){var V=I.selection?I.selection():I;V.property("__zoom",lp),I!==V?L(I,q,U,K):V.interrupt().each(function(){R(this,arguments).event(K).start().zoom(null,typeof q=="function"?q.apply(this,arguments):q).end()})},p.scaleBy=function(I,q,U,K){p.scaleTo(I,function(){var V=this.__zoom.k,T=typeof q=="function"?q.apply(this,arguments):q;return V*T},U,K)},p.scaleTo=function(I,q,U,K){p.transform(I,function(){var V=r.apply(this,arguments),T=this.__zoom,B=U==null?w(V):typeof U=="function"?U.apply(this,arguments):U,P=T.invert(B),F=typeof q=="function"?q.apply(this,arguments):q;return i(u(d(T,F),B,P),V,y)},U,K)},p.translateBy=function(I,q,U,K){p.transform(I,function(){return i(this.__zoom.translate(typeof q=="function"?q.apply(this,arguments):q,typeof U=="function"?U.apply(this,arguments):U),r.apply(this,arguments),y)},null,K)},p.translateTo=function(I,q,U,K,V){p.transform(I,function(){var T=r.apply(this,arguments),B=this.__zoom,P=K==null?w(T):typeof K=="function"?K.apply(this,arguments):K;return i(Fa.translate(P[0],P[1]).scale(B.k).translate(typeof q=="function"?-q.apply(this,arguments):-q,typeof U=="function"?-U.apply(this,arguments):-U),T,y)},K,V)};function d(I,q){return q=Math.max(S[0],Math.min(S[1],q)),q===I.k?I:new kr(q,I.x,I.y)}function u(I,q,U){var K=q[0]-U[0]*I.k,V=q[1]-U[1]*I.k;return K===I.x&&V===I.y?I:new kr(I.k,K,V)}function w(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function L(I,q,U,K){I.on("start.zoom",function(){R(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(K).end()}).tween("zoom",function(){var V=this,T=arguments,B=R(V,T).event(K),P=r.apply(V,T),F=U==null?w(P):typeof U=="function"?U.apply(V,T):U,G=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),Z=V.__zoom,ie=typeof q=="function"?q.apply(V,T):q,ae=l(Z.invert(F).concat(G/Z.k),ie.invert(F).concat(G/ie.k));return function(X){if(X===1)X=ie;else{var H=ae(X),re=G/H[2];X=new kr(re,F[0]-H[0]*re,F[1]-H[1]*re)}B.zoom(null,X)}})}function R(I,q,U){return!U&&I.__zooming||new D(I,q)}function D(I,q){this.that=I,this.args=q,this.active=0,this.sourceEvent=null,this.extent=r.apply(I,q),this.taps=0}D.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,q){return this.mouse&&I!=="mouse"&&(this.mouse[1]=q.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=q.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=q.invert(this.touch1[0])),this.that.__zoom=q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var q=Nt(this.that).datum();_.call(I,this.that,new ES(I,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:_}),q)}};function k(I,...q){if(!e.apply(this,arguments))return;var U=R(this,q).event(I),K=this.__zoom,V=Math.max(S[0],Math.min(S[1],K.k*Math.pow(2,o.apply(this,arguments)))),T=Qt(I);if(U.wheel)(U.mouse[0][0]!==T[0]||U.mouse[0][1]!==T[1])&&(U.mouse[1]=K.invert(U.mouse[0]=T)),clearTimeout(U.wheel);else{if(K.k===V)return;U.mouse=[T,K.invert(T)],ma(this),U.start()}hs(I),U.wheel=setTimeout(B,b),U.zoom("mouse",i(u(d(K,V),U.mouse[0],U.mouse[1]),U.extent,y));function B(){U.wheel=null,U.end()}}function M(I,...q){if(m||!e.apply(this,arguments))return;var U=I.currentTarget,K=R(this,q,!0).event(I),V=Nt(I.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",G,!0),T=Qt(I,U),B=I.clientX,P=I.clientY;D_(I.view),Yc(I),K.mouse=[T,this.__zoom.invert(T)],ma(this),K.start();function F(Z){if(hs(Z),!K.moved){var ie=Z.clientX-B,ae=Z.clientY-P;K.moved=ie*ie+ae*ae>x}K.event(Z).zoom("mouse",i(u(K.that.__zoom,K.mouse[0]=Qt(Z,U),K.mouse[1]),K.extent,y))}function G(Z){V.on("mousemove.zoom mouseup.zoom",null),A_(Z.view,K.moved),hs(Z),K.event(Z).end()}}function W(I,...q){if(e.apply(this,arguments)){var U=this.__zoom,K=Qt(I.changedTouches?I.changedTouches[0]:I,this),V=U.invert(K),T=U.k*(I.shiftKey?.5:2),B=i(u(d(U,T),K,V),r.apply(this,q),y);hs(I),a>0?Nt(this).transition().duration(a).call(L,B,K,I):Nt(this).call(p.transform,B,K,I)}}function z(I,...q){if(e.apply(this,arguments)){var U=I.touches,K=U.length,V=R(this,q,I.changedTouches.length===K).event(I),T,B,P,F;for(Yc(I),B=0;B<K;++B)P=U[B],F=Qt(P,this),F=[F,this.__zoom.invert(F),P.identifier],V.touch0?!V.touch1&&V.touch0[2]!==F[2]&&(V.touch1=F,V.taps=0):(V.touch0=F,T=!0,V.taps=1+!!v);v&&(v=clearTimeout(v)),T&&(V.taps<2&&(c=F[0],v=setTimeout(function(){v=null},C)),ma(this),V.start())}}function j(I,...q){if(this.__zooming){var U=R(this,q).event(I),K=I.changedTouches,V=K.length,T,B,P,F;for(hs(I),T=0;T<V;++T)B=K[T],P=Qt(B,this),U.touch0&&U.touch0[2]===B.identifier?U.touch0[0]=P:U.touch1&&U.touch1[2]===B.identifier&&(U.touch1[0]=P);if(B=U.that.__zoom,U.touch1){var G=U.touch0[0],Z=U.touch0[1],ie=U.touch1[0],ae=U.touch1[1],X=(X=ie[0]-G[0])*X+(X=ie[1]-G[1])*X,H=(H=ae[0]-Z[0])*H+(H=ae[1]-Z[1])*H;B=d(B,Math.sqrt(X/H)),P=[(G[0]+ie[0])/2,(G[1]+ie[1])/2],F=[(Z[0]+ae[0])/2,(Z[1]+ae[1])/2]}else if(U.touch0)P=U.touch0[0],F=U.touch0[1];else return;U.zoom("touch",i(u(B,P,F),U.extent,y))}}function N(I,...q){if(this.__zooming){var U=R(this,q).event(I),K=I.changedTouches,V=K.length,T,B;for(Yc(I),m&&clearTimeout(m),m=setTimeout(function(){m=null},C),T=0;T<V;++T)B=K[T],U.touch0&&U.touch0[2]===B.identifier?delete U.touch0:U.touch1&&U.touch1[2]===B.identifier&&delete U.touch1;if(U.touch1&&!U.touch0&&(U.touch0=U.touch1,delete U.touch1),U.touch0)U.touch0[1]=this.__zoom.invert(U.touch0[0]);else if(U.end(),U.taps===2&&(B=Qt(B,this),Math.hypot(c[0]-B[0],c[1]-B[1])<f)){var P=Nt(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return p.wheelDelta=function(I){return arguments.length?(o=typeof I=="function"?I:na(+I),p):o},p.filter=function(I){return arguments.length?(e=typeof I=="function"?I:na(!!I),p):e},p.touchable=function(I){return arguments.length?(h=typeof I=="function"?I:na(!!I),p):h},p.extent=function(I){return arguments.length?(r=typeof I=="function"?I:na([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),p):r},p.scaleExtent=function(I){return arguments.length?(S[0]=+I[0],S[1]=+I[1],p):[S[0],S[1]]},p.translateExtent=function(I){return arguments.length?(y[0][0]=+I[0][0],y[1][0]=+I[1][0],y[0][1]=+I[0][1],y[1][1]=+I[1][1],p):[[y[0][0],y[0][1]],[y[1][0],y[1][1]]]},p.constrain=function(I){return arguments.length?(i=I,p):i},p.duration=function(I){return arguments.length?(a=+I,p):a},p.interpolate=function(I){return arguments.length?(l=I,p):l},p.on=function(){var I=_.on.apply(_,arguments);return I===_?p:I},p.clickDistance=function(I){return arguments.length?(x=(I=+I)*I,p):Math.sqrt(x)},p.tapDistance=function(I){return arguments.length?(f=+I,p):f},p}const dr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:r,sourceHandle:i,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:o}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Ss=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],K_=["Enter"," ","Escape"],X_={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:r,y:i})=>`Moved selected node ${e}. New position, x: ${r}, y: ${i}`,"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 hi;(function(e){e.Strict="strict",e.Loose="loose"})(hi||(hi={}));var xn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(xn||(xn={}));var Cs;(function(e){e.Partial="partial",e.Full="full"})(Cs||(Cs={}));const Y_={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Zr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Zr||(Zr={}));var La;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(La||(La={}));var xe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(xe||(xe={}));const cp={[xe.Left]:xe.Right,[xe.Right]:xe.Left,[xe.Top]:xe.Bottom,[xe.Bottom]:xe.Top};function G_(e){return e===null?null:e?"valid":"invalid"}const Q_=e=>"id"in e&&"source"in e&&"target"in e,TS=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Qu=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ds=(e,r=[0,0])=>{const{width:i,height:o}=Rr(e),h=e.origin??r,S=i*h[0],y=o*h[1];return{x:e.position.x-S,y:e.position.y-y}},MS=(e,r={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((o,h)=>{const S=typeof h=="string";let y=!r.nodeLookup&&!S?h:void 0;r.nodeLookup&&(y=S?r.nodeLookup.get(h):Qu(h)?h:r.nodeLookup.get(h.id));const a=y?Ra(y,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ja(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return za(i)},As=(e,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return e.forEach(h=>{(r.filter===void 0||r.filter(h))&&(i=ja(i,Ra(h)),o=!0)}),o?za(i):{x:0,y:0,width:0,height:0}},Ju=(e,r,[i,o,h]=[0,0,1],S=!1,y=!1)=>{const a={...Ms(r,[i,o,h]),width:r.width/h,height:r.height/h},l=[];for(const _ of e.values()){const{measured:v,selectable:c=!0,hidden:m=!1}=_;if(y&&!c||m)continue;const C=v.width??_.width??_.initialWidth??null,b=v.height??_.height??_.initialHeight??null,x=xs(a,fi(_)),f=(C??0)*(b??0),p=S&&x>0;(!_.internals.handleBounds||p||x>=f||_.dragging)&&l.push(_)}return l},PS=(e,r)=>{const i=new Set;return e.forEach(o=>{i.add(o.id)}),r.filter(o=>i.has(o.source)||i.has(o.target))};function NS(e,r){const i=new Map,o=r!=null&&r.nodes?new Set(r.nodes.map(h=>h.id)):null;return e.forEach(h=>{h.measured.width&&h.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!h.hidden)&&(!o||o.has(h.id))&&i.set(h.id,h)}),i}async function BS({nodes:e,width:r,height:i,panZoom:o,minZoom:h,maxZoom:S},y){if(e.size===0)return Promise.resolve(!0);const a=NS(e,y),l=As(a),_=Zu(l,r,i,(y==null?void 0:y.minZoom)??h,(y==null?void 0:y.maxZoom)??S,(y==null?void 0:y.padding)??.1);return await o.setViewport(_,{duration:y==null?void 0:y.duration,ease:y==null?void 0:y.ease,interpolate:y==null?void 0:y.interpolate}),Promise.resolve(!0)}function J_({nodeId:e,nextPosition:r,nodeLookup:i,nodeOrigin:o=[0,0],nodeExtent:h,onError:S}){const y=i.get(e),a=y.parentId?i.get(y.parentId):void 0,{x:l,y:_}=a?a.internals.positionAbsolute:{x:0,y:0},v=y.origin??o;let c=y.extent||h;if(y.extent==="parent"&&!y.expandParent)if(!a)S==null||S("005",dr.error005());else{const C=a.measured.width,b=a.measured.height;C&&b&&(c=[[l,_],[l+C,_+b]])}else a&&pi(y.extent)&&(c=[[y.extent[0][0]+l,y.extent[0][1]+_],[y.extent[1][0]+l,y.extent[1][1]+_]]);const m=pi(c)?kn(r,c,y.measured):r;return(y.measured.width===void 0||y.measured.height===void 0)&&(S==null||S("015",dr.error015())),{position:{x:m.x-l+(y.measured.width??0)*v[0],y:m.y-_+(y.measured.height??0)*v[1]},positionAbsolute:m}}async function IS({nodesToRemove:e=[],edgesToRemove:r=[],nodes:i,edges:o,onBeforeDelete:h}){const S=new Set(e.map(m=>m.id)),y=[];for(const m of i){if(m.deletable===!1)continue;const C=S.has(m.id),b=!C&&m.parentId&&y.find(x=>x.id===m.parentId);(C||b)&&y.push(m)}const a=new Set(r.map(m=>m.id)),l=o.filter(m=>m.deletable!==!1),v=PS(y,l);for(const m of l)a.has(m.id)&&!v.find(b=>b.id===m.id)&&v.push(m);if(!h)return{edges:v,nodes:y};const c=await h({nodes:y,edges:v});return typeof c=="boolean"?c?{edges:v,nodes:y}:{edges:[],nodes:[]}:c}const di=(e,r=0,i=1)=>Math.min(Math.max(e,r),i),kn=(e={x:0,y:0},r,i)=>({x:di(e.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:di(e.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function Z_(e,r,i){const{width:o,height:h}=Rr(i),{x:S,y}=i.internals.positionAbsolute;return kn(e,[[S,y],[S+o,y+h]],r)}const up=(e,r,i)=>e<r?di(Math.abs(e-r),1,r)/r:e>i?-di(Math.abs(e-i),1,r)/r:0,eg=(e,r,i=15,o=40)=>{const h=up(e.x,o,r.width-o)*i,S=up(e.y,o,r.height-o)*i;return[h,S]},ja=(e,r)=>({x:Math.min(e.x,r.x),y:Math.min(e.y,r.y),x2:Math.max(e.x2,r.x2),y2:Math.max(e.y2,r.y2)}),ku=({x:e,y:r,width:i,height:o})=>({x:e,y:r,x2:e+i,y2:r+o}),za=({x:e,y:r,x2:i,y2:o})=>({x:e,y:r,width:i-e,height:o-r}),fi=(e,r=[0,0])=>{var h,S;const{x:i,y:o}=Qu(e)?e.internals.positionAbsolute:Ds(e,r);return{x:i,y:o,width:((h=e.measured)==null?void 0:h.width)??e.width??e.initialWidth??0,height:((S=e.measured)==null?void 0:S.height)??e.height??e.initialHeight??0}},Ra=(e,r=[0,0])=>{var h,S;const{x:i,y:o}=Qu(e)?e.internals.positionAbsolute:Ds(e,r);return{x:i,y:o,x2:i+(((h=e.measured)==null?void 0:h.width)??e.width??e.initialWidth??0),y2:o+(((S=e.measured)==null?void 0:S.height)??e.height??e.initialHeight??0)}},tg=(e,r)=>za(ja(ku(e),ku(r))),xs=(e,r)=>{const i=Math.max(0,Math.min(e.x+e.width,r.x+r.width)-Math.max(e.x,r.x)),o=Math.max(0,Math.min(e.y+e.height,r.y+r.height)-Math.max(e.y,r.y));return Math.ceil(i*o)},hp=e=>Zt(e.width)&&Zt(e.height)&&Zt(e.x)&&Zt(e.y),Zt=e=>!isNaN(e)&&isFinite(e),OS=(e,r)=>{},Ts=(e,r=[1,1])=>({x:r[0]*Math.round(e.x/r[0]),y:r[1]*Math.round(e.y/r[1])}),Ms=({x:e,y:r},[i,o,h],S=!1,y=[1,1])=>{const a={x:(e-i)/h,y:(r-o)/h};return S?Ts(a,y):a},Da=({x:e,y:r},[i,o,h])=>({x:e*h+i,y:r*h+o});function ii(e,r){if(typeof e=="number")return Math.floor((r-r/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function HS(e,r,i){if(typeof e=="string"||typeof e=="number"){const o=ii(e,i),h=ii(e,r);return{top:o,right:h,bottom:o,left:h,x:h*2,y:o*2}}if(typeof e=="object"){const o=ii(e.top??e.y??0,i),h=ii(e.bottom??e.y??0,i),S=ii(e.left??e.x??0,r),y=ii(e.right??e.x??0,r);return{top:o,right:y,bottom:h,left:S,x:S+y,y:o+h}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function FS(e,r,i,o,h,S){const{x:y,y:a}=Da(e,[r,i,o]),{x:l,y:_}=Da({x:e.x+e.width,y:e.y+e.height},[r,i,o]),v=h-l,c=S-_;return{left:Math.floor(y),top:Math.floor(a),right:Math.floor(v),bottom:Math.floor(c)}}const Zu=(e,r,i,o,h,S)=>{const y=HS(S,r,i),a=(r-y.x)/e.width,l=(i-y.y)/e.height,_=Math.min(a,l),v=di(_,o,h),c=e.x+e.width/2,m=e.y+e.height/2,C=r/2-c*v,b=i/2-m*v,x=FS(e,C,b,v,r,i),f={left:Math.min(x.left-y.left,0),top:Math.min(x.top-y.top,0),right:Math.min(x.right-y.right,0),bottom:Math.min(x.bottom-y.bottom,0)};return{x:C-f.left+f.right,y:b-f.top+f.bottom,zoom:v}},bs=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function pi(e){return e!=null&&e!=="parent"}function Rr(e){var r,i;return{width:((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}}function rg(e){var r,i;return(((r=e.measured)==null?void 0:r.width)??e.width??e.initialWidth)!==void 0&&(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight)!==void 0}function ng(e,r={width:0,height:0},i,o,h){const S={...e},y=o.get(i);if(y){const a=y.origin||h;S.x+=y.internals.positionAbsolute.x-(r.width??0)*a[0],S.y+=y.internals.positionAbsolute.y-(r.height??0)*a[1]}return S}function dp(e,r){if(e.size!==r.size)return!1;for(const i of e)if(!r.has(i))return!1;return!0}function jS(){let e,r;return{promise:new Promise((o,h)=>{e=o,r=h}),resolve:e,reject:r}}function zS(e){return{...X_,...e||{}}}function gs(e,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:o,containerBounds:h}){const{x:S,y}=er(e),a=Ms({x:S-((h==null?void 0:h.left)??0),y:y-((h==null?void 0:h.top)??0)},o),{x:l,y:_}=i?Ts(a,r):a;return{xSnapped:l,ySnapped:_,...a}}const eh=e=>({width:e.offsetWidth,height:e.offsetHeight}),ig=e=>{var r;return((r=e==null?void 0:e.getRootNode)==null?void 0:r.call(e))||(window==null?void 0:window.document)},$S=["INPUT","SELECT","TEXTAREA"];function sg(e){var o,h;const r=((h=(o=e.composedPath)==null?void 0:o.call(e))==null?void 0:h[0])||e.target;return(r==null?void 0:r.nodeType)!==1?!1:$S.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const og=e=>"clientX"in e,er=(e,r)=>{var S,y;const i=og(e),o=i?e.clientX:(S=e.touches)==null?void 0:S[0].clientX,h=i?e.clientY:(y=e.touches)==null?void 0:y[0].clientY;return{x:o-((r==null?void 0:r.left)??0),y:h-((r==null?void 0:r.top)??0)}},fp=(e,r,i,o,h)=>{const S=r.querySelectorAll(`.${e}`);return!S||!S.length?null:Array.from(S).map(y=>{const a=y.getBoundingClientRect();return{id:y.getAttribute("data-handleid"),type:e,nodeId:h,position:y.getAttribute("data-handlepos"),x:(a.left-i.left)/o,y:(a.top-i.top)/o,...eh(y)}})};function ag({sourceX:e,sourceY:r,targetX:i,targetY:o,sourceControlX:h,sourceControlY:S,targetControlX:y,targetControlY:a}){const l=e*.125+h*.375+y*.375+i*.125,_=r*.125+S*.375+a*.375+o*.125,v=Math.abs(l-e),c=Math.abs(_-r);return[l,_,v,c]}function ia(e,r){return e>=0?.5*e:r*25*Math.sqrt(-e)}function pp({pos:e,x1:r,y1:i,x2:o,y2:h,c:S}){switch(e){case xe.Left:return[r-ia(r-o,S),i];case xe.Right:return[r+ia(o-r,S),i];case xe.Top:return[r,i-ia(i-h,S)];case xe.Bottom:return[r,i+ia(h-i,S)]}}function lg({sourceX:e,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:h,targetPosition:S=xe.Top,curvature:y=.25}){const[a,l]=pp({pos:i,x1:e,y1:r,x2:o,y2:h,c:y}),[_,v]=pp({pos:S,x1:o,y1:h,x2:e,y2:r,c:y}),[c,m,C,b]=ag({sourceX:e,sourceY:r,targetX:o,targetY:h,sourceControlX:a,sourceControlY:l,targetControlX:_,targetControlY:v});return[`M${e},${r} C${a},${l} ${_},${v} ${o},${h}`,c,m,C,b]}function cg({sourceX:e,sourceY:r,targetX:i,targetY:o}){const h=Math.abs(i-e)/2,S=i<e?i+h:i-h,y=Math.abs(o-r)/2,a=o<r?o+y:o-y;return[S,a,h,y]}function WS({sourceNode:e,targetNode:r,selected:i=!1,zIndex:o=0,elevateOnSelect:h=!1,zIndexMode:S="basic"}){if(S==="manual")return o;const y=h&&i?o+1e3:o,a=Math.max(e.parentId||h&&e.selected?e.internals.z:0,r.parentId||h&&r.selected?r.internals.z:0);return y+a}function US({sourceNode:e,targetNode:r,width:i,height:o,transform:h}){const S=ja(Ra(e),Ra(r));S.x===S.x2&&(S.x2+=1),S.y===S.y2&&(S.y2+=1);const y={x:-h[0]/h[2],y:-h[1]/h[2],width:i/h[2],height:o/h[2]};return xs(y,za(S))>0}const VS=({source:e,sourceHandle:r,target:i,targetHandle:o})=>`xy-edge__${e}${r||""}-${i}${o||""}`,qS=(e,r)=>r.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),KS=(e,r,i={})=>{if(!e.source||!e.target)return r;const o=i.getEdgeId||VS;let h;return Q_(e)?h={...e}:h={...e,id:o(e)},qS(h,r)?r:(h.sourceHandle===null&&delete h.sourceHandle,h.targetHandle===null&&delete h.targetHandle,r.concat(h))};function ug({sourceX:e,sourceY:r,targetX:i,targetY:o}){const[h,S,y,a]=cg({sourceX:e,sourceY:r,targetX:i,targetY:o});return[`M ${e},${r}L ${i},${o}`,h,S,y,a]}const _p={[xe.Left]:{x:-1,y:0},[xe.Right]:{x:1,y:0},[xe.Top]:{x:0,y:-1},[xe.Bottom]:{x:0,y:1}},XS=({source:e,sourcePosition:r=xe.Bottom,target:i})=>r===xe.Left||r===xe.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},gp=(e,r)=>Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2));function YS({source:e,sourcePosition:r=xe.Bottom,target:i,targetPosition:o=xe.Top,center:h,offset:S,stepPosition:y}){const a=_p[r],l=_p[o],_={x:e.x+a.x*S,y:e.y+a.y*S},v={x:i.x+l.x*S,y:i.y+l.y*S},c=XS({source:_,sourcePosition:r,target:v}),m=c.x!==0?"x":"y",C=c[m];let b=[],x,f;const p={x:0,y:0},d={x:0,y:0},[,,u,w]=cg({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(a[m]*l[m]===-1){m==="x"?(x=h.x??_.x+(v.x-_.x)*y,f=h.y??(_.y+v.y)/2):(x=h.x??(_.x+v.x)/2,f=h.y??_.y+(v.y-_.y)*y);const k=[{x,y:_.y},{x,y:v.y}],M=[{x:_.x,y:f},{x:v.x,y:f}];a[m]===C?b=m==="x"?k:M:b=m==="x"?M:k}else{const k=[{x:_.x,y:v.y}],M=[{x:v.x,y:_.y}];if(m==="x"?b=a.x===C?M:k:b=a.y===C?k:M,r===o){const I=Math.abs(e[m]-i[m]);if(I<=S){const q=Math.min(S-1,S-I);a[m]===C?p[m]=(_[m]>e[m]?-1:1)*q:d[m]=(v[m]>i[m]?-1:1)*q}}if(r!==o){const I=m==="x"?"y":"x",q=a[m]===l[I],U=_[I]>v[I],K=_[I]<v[I];(a[m]===1&&(!q&&U||q&&K)||a[m]!==1&&(!q&&K||q&&U))&&(b=m==="x"?k:M)}const W={x:_.x+p.x,y:_.y+p.y},z={x:v.x+d.x,y:v.y+d.y},j=Math.max(Math.abs(W.x-b[0].x),Math.abs(z.x-b[0].x)),N=Math.max(Math.abs(W.y-b[0].y),Math.abs(z.y-b[0].y));j>=N?(x=(W.x+z.x)/2,f=b[0].y):(x=b[0].x,f=(W.y+z.y)/2)}const L={x:_.x+p.x,y:_.y+p.y},R={x:v.x+d.x,y:v.y+d.y};return[[e,...L.x!==b[0].x||L.y!==b[0].y?[L]:[],...b,...R.x!==b[b.length-1].x||R.y!==b[b.length-1].y?[R]:[],i],x,f,u,w]}function GS(e,r,i,o){const h=Math.min(gp(e,r)/2,gp(r,i)/2,o),{x:S,y}=r;if(e.x===S&&S===i.x||e.y===y&&y===i.y)return`L${S} ${y}`;if(e.y===y){const _=e.x<i.x?-1:1,v=e.y<i.y?1:-1;return`L ${S+h*_},${y}Q ${S},${y} ${S},${y+h*v}`}const a=e.x<i.x?1:-1,l=e.y<i.y?-1:1;return`L ${S},${y+h*l}Q ${S},${y} ${S+h*a},${y}`}function Lu({sourceX:e,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:h,targetPosition:S=xe.Top,borderRadius:y=5,centerX:a,centerY:l,offset:_=20,stepPosition:v=.5}){const[c,m,C,b,x]=YS({source:{x:e,y:r},sourcePosition:i,target:{x:o,y:h},targetPosition:S,center:{x:a,y:l},offset:_,stepPosition:v});let f=`M${c[0].x} ${c[0].y}`;for(let p=1;p<c.length-1;p++)f+=GS(c[p-1],c[p],c[p+1],y);return f+=`L${c[c.length-1].x} ${c[c.length-1].y}`,[f,m,C,b,x]}function mp(e){var r;return e&&!!(e.internals.handleBounds||(r=e.handles)!=null&&r.length)&&!!(e.measured.width||e.width||e.initialWidth)}function QS(e){var c;const{sourceNode:r,targetNode:i}=e;if(!mp(r)||!mp(i))return null;const o=r.internals.handleBounds||vp(r.handles),h=i.internals.handleBounds||vp(i.handles),S=yp((o==null?void 0:o.source)??[],e.sourceHandle),y=yp(e.connectionMode===hi.Strict?(h==null?void 0:h.target)??[]:((h==null?void 0:h.target)??[]).concat((h==null?void 0:h.source)??[]),e.targetHandle);if(!S||!y)return(c=e.onError)==null||c.call(e,"008",dr.error008(S?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(S==null?void 0:S.position)||xe.Bottom,l=(y==null?void 0:y.position)||xe.Top,_=Ln(r,S,a),v=Ln(i,y,l);return{sourceX:_.x,sourceY:_.y,targetX:v.x,targetY:v.y,sourcePosition:a,targetPosition:l}}function vp(e){if(!e)return null;const r=[],i=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?r.push(o):o.type==="target"&&i.push(o);return{source:r,target:i}}function Ln(e,r,i=xe.Left,o=!1){const h=((r==null?void 0:r.x)??0)+e.internals.positionAbsolute.x,S=((r==null?void 0:r.y)??0)+e.internals.positionAbsolute.y,{width:y,height:a}=r??Rr(e);if(o)return{x:h+y/2,y:S+a/2};switch((r==null?void 0:r.position)??i){case xe.Top:return{x:h+y/2,y:S};case xe.Right:return{x:h+y,y:S+a/2};case xe.Bottom:return{x:h+y/2,y:S+a};case xe.Left:return{x:h,y:S+a/2}}}function yp(e,r){return e&&(r?e.find(i=>i.id===r):e[0])||null}function Ru(e,r){return e?typeof e=="string"?e:`${r?`${r}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function JS(e,{id:r,defaultColor:i,defaultMarkerStart:o,defaultMarkerEnd:h}){const S=new Set;return e.reduce((y,a)=>([a.markerStart||o,a.markerEnd||h].forEach(l=>{if(l&&typeof l=="object"){const _=Ru(l,r);S.has(_)||(y.push({id:_,color:l.color||i,...l}),S.add(_))}}),y),[]).sort((y,a)=>y.id.localeCompare(a.id))}const hg=1e3,ZS=10,th={nodeOrigin:[0,0],nodeExtent:Ss,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},eC={...th,checkEquality:!0};function rh(e,r){const i={...e};for(const o in r)r[o]!==void 0&&(i[o]=r[o]);return i}function tC(e,r,i){const o=rh(th,i);for(const h of e.values())if(h.parentId)ih(h,e,r,o);else{const S=Ds(h,o.nodeOrigin),y=pi(h.extent)?h.extent:o.nodeExtent,a=kn(S,y,Rr(h));h.internals.positionAbsolute=a}}function rC(e,r){if(!e.handles)return e.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],o=[];for(const h of e.handles){const S={id:h.id,width:h.width??1,height:h.height??1,nodeId:e.id,x:h.x,y:h.y,position:h.position,type:h.type};h.type==="source"?i.push(S):h.type==="target"&&o.push(S)}return{source:i,target:o}}function nh(e){return e==="manual"}function Du(e,r,i,o={}){var v,c;const h=rh(eC,o),S={i:0},y=new Map(r),a=h!=null&&h.elevateNodesOnSelect&&!nh(h.zIndexMode)?hg:0;let l=e.length>0,_=!1;r.clear(),i.clear();for(const m of e){let C=y.get(m.id);if(h.checkEquality&&m===(C==null?void 0:C.internals.userNode))r.set(m.id,C);else{const b=Ds(m,h.nodeOrigin),x=pi(m.extent)?m.extent:h.nodeExtent,f=kn(b,x,Rr(m));C={...h.defaults,...m,measured:{width:(v=m.measured)==null?void 0:v.width,height:(c=m.measured)==null?void 0:c.height},internals:{positionAbsolute:f,handleBounds:rC(m,C),z:dg(m,a,h.zIndexMode),userNode:m}},r.set(m.id,C)}(C.measured===void 0||C.measured.width===void 0||C.measured.height===void 0)&&!C.hidden&&(l=!1),m.parentId&&ih(C,r,i,o,S),_||(_=m.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:_}}function nC(e,r){if(!e.parentId)return;const i=r.get(e.parentId);i?i.set(e.id,e):r.set(e.parentId,new Map([[e.id,e]]))}function ih(e,r,i,o,h){const{elevateNodesOnSelect:S,nodeOrigin:y,nodeExtent:a,zIndexMode:l}=rh(th,o),_=e.parentId,v=r.get(_);if(!v){console.warn(`Parent node ${_} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}nC(e,i),h&&!v.parentId&&v.internals.rootParentIndex===void 0&&l==="auto"&&(v.internals.rootParentIndex=++h.i,v.internals.z=v.internals.z+h.i*ZS),h&&v.internals.rootParentIndex!==void 0&&(h.i=v.internals.rootParentIndex);const c=S&&!nh(l)?hg:0,{x:m,y:C,z:b}=iC(e,v,y,a,c,l),{positionAbsolute:x}=e.internals,f=m!==x.x||C!==x.y;(f||b!==e.internals.z)&&r.set(e.id,{...e,internals:{...e.internals,positionAbsolute:f?{x:m,y:C}:x,z:b}})}function dg(e,r,i){const o=Zt(e.zIndex)?e.zIndex:0;return nh(i)?o:o+(e.selected?r:0)}function iC(e,r,i,o,h,S){const{x:y,y:a}=r.internals.positionAbsolute,l=Rr(e),_=Ds(e,i),v=pi(e.extent)?kn(_,e.extent,l):_;let c=kn({x:y+v.x,y:a+v.y},o,l);e.extent==="parent"&&(c=Z_(c,l,r));const m=dg(e,h,S),C=r.internals.z??0;return{x:c.x,y:c.y,z:C>=m?C+1:m}}function sh(e,r,i,o=[0,0]){var y;const h=[],S=new Map;for(const a of e){const l=r.get(a.parentId);if(!l)continue;const _=((y=S.get(a.parentId))==null?void 0:y.expandedRect)??fi(l),v=tg(_,a.rect);S.set(a.parentId,{expandedRect:v,parent:l})}return S.size>0&&S.forEach(({expandedRect:a,parent:l},_)=>{var u;const v=l.internals.positionAbsolute,c=Rr(l),m=l.origin??o,C=a.x<v.x?Math.round(Math.abs(v.x-a.x)):0,b=a.y<v.y?Math.round(Math.abs(v.y-a.y)):0,x=Math.max(c.width,Math.round(a.width)),f=Math.max(c.height,Math.round(a.height)),p=(x-c.width)*m[0],d=(f-c.height)*m[1];(C>0||b>0||p||d)&&(h.push({id:_,type:"position",position:{x:l.position.x-C+p,y:l.position.y-b+d}}),(u=i.get(_))==null||u.forEach(w=>{e.some(L=>L.id===w.id)||h.push({id:w.id,type:"position",position:{x:w.position.x+C,y:w.position.y+b}})})),(c.width<a.width||c.height<a.height||C||b)&&h.push({id:_,type:"dimensions",setAttributes:!0,dimensions:{width:x+(C?m[0]*C-p:0),height:f+(b?m[1]*b-d:0)}})}),h}function sC(e,r,i,o,h,S,y){const a=o==null?void 0:o.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const _=[],v=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(v.transform),m=[];for(const C of e.values()){const b=r.get(C.id);if(!b)continue;if(b.hidden){r.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),l=!0;continue}const x=eh(C.nodeElement),f=b.measured.width!==x.width||b.measured.height!==x.height;if(!!(x.width&&x.height&&(f||!b.internals.handleBounds||C.force))){const d=C.nodeElement.getBoundingClientRect(),u=pi(b.extent)?b.extent:S;let{positionAbsolute:w}=b.internals;b.parentId&&b.extent==="parent"?w=Z_(w,x,r.get(b.parentId)):u&&(w=kn(w,u,x));const L={...b,measured:x,internals:{...b.internals,positionAbsolute:w,handleBounds:{source:fp("source",C.nodeElement,d,c,b.id),target:fp("target",C.nodeElement,d,c,b.id)}}};r.set(b.id,L),b.parentId&&ih(L,r,i,{nodeOrigin:h,zIndexMode:y}),l=!0,f&&(_.push({id:b.id,type:"dimensions",dimensions:x}),b.expandParent&&b.parentId&&m.push({id:b.id,parentId:b.parentId,rect:fi(L,h)}))}}if(m.length>0){const C=sh(m,r,i,h);_.push(...C)}return{changes:_,updatedInternals:l}}async function oC({delta:e,panZoom:r,transform:i,translateExtent:o,width:h,height:S}){if(!r||!e.x&&!e.y)return Promise.resolve(!1);const y=await r.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[h,S]],o),a=!!y&&(y.x!==i[0]||y.y!==i[1]||y.k!==i[2]);return Promise.resolve(a)}function wp(e,r,i,o,h,S){let y=h;const a=o.get(y)||new Map;o.set(y,a.set(i,r)),y=`${h}-${e}`;const l=o.get(y)||new Map;if(o.set(y,l.set(i,r)),S){y=`${h}-${e}-${S}`;const _=o.get(y)||new Map;o.set(y,_.set(i,r))}}function fg(e,r,i){e.clear(),r.clear();for(const o of i){const{source:h,target:S,sourceHandle:y=null,targetHandle:a=null}=o,l={edgeId:o.id,source:h,target:S,sourceHandle:y,targetHandle:a},_=`${h}-${y}--${S}-${a}`,v=`${S}-${a}--${h}-${y}`;wp("source",l,v,e,h,y),wp("target",l,_,e,S,a),r.set(o.id,o)}}function pg(e,r){if(!e.parentId)return!1;const i=r.get(e.parentId);return i?i.selected?!0:pg(i,r):!1}function Sp(e,r,i){var h;let o=e;do{if((h=o==null?void 0:o.matches)!=null&&h.call(o,r))return!0;if(o===i)return!1;o=o==null?void 0:o.parentElement}while(o);return!1}function aC(e,r,i,o){const h=new Map;for(const[S,y]of e)if((y.selected||y.id===o)&&(!y.parentId||!pg(y,e))&&(y.draggable||r&&typeof y.draggable>"u")){const a=e.get(S);a&&h.set(S,{id:S,position:a.position||{x:0,y:0},distance:{x:i.x-a.internals.positionAbsolute.x,y:i.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 h}function Gc({nodeId:e,dragItems:r,nodeLookup:i,dragging:o=!0}){var y,a,l;const h=[];for(const[_,v]of r){const c=(y=i.get(_))==null?void 0:y.internals.userNode;c&&h.push({...c,position:v.position,dragging:o})}if(!e)return[h[0],h];const S=(a=i.get(e))==null?void 0:a.internals.userNode;return[S?{...S,position:((l=r.get(e))==null?void 0:l.position)||S.position,dragging:o}:h[0],h]}function lC({dragItems:e,snapGrid:r,x:i,y:o}){const h=e.values().next().value;if(!h)return null;const S={x:i-h.distance.x,y:o-h.distance.y},y=Ts(S,r);return{x:y.x-S.x,y:y.y-S.y}}function cC({onNodeMouseDown:e,getStoreItems:r,onDragStart:i,onDrag:o,onDragStop:h}){let S={x:null,y:null},y=0,a=new Map,l=!1,_={x:0,y:0},v=null,c=!1,m=null,C=!1,b=!1,x=null;function f({noDragClassName:d,handleSelector:u,domNode:w,isSelectable:L,nodeId:R,nodeClickDistance:D=0}){m=Nt(w);function k({x:j,y:N}){const{nodeLookup:I,nodeExtent:q,snapGrid:U,snapToGrid:K,nodeOrigin:V,onNodeDrag:T,onSelectionDrag:B,onError:P,updateNodePositions:F}=r();S={x:j,y:N};let G=!1;const Z=a.size>1,ie=Z&&q?ku(As(a)):null,ae=Z&&K?lC({dragItems:a,snapGrid:U,x:j,y:N}):null;for(const[X,H]of a){if(!I.has(X))continue;let re={x:j-H.distance.x,y:N-H.distance.y};K&&(re=ae?{x:Math.round(re.x+ae.x),y:Math.round(re.y+ae.y)}:Ts(re,U));let te=null;if(Z&&q&&!H.extent&&ie){const{positionAbsolute:pe}=H.internals,Se=pe.x-ie.x+q[0][0],be=pe.x+H.measured.width-ie.x2+q[1][0],ue=pe.y-ie.y+q[0][1],ge=pe.y+H.measured.height-ie.y2+q[1][1];te=[[Se,ue],[be,ge]]}const{position:ce,positionAbsolute:le}=J_({nodeId:X,nextPosition:re,nodeLookup:I,nodeExtent:te||q,nodeOrigin:V,onError:P});G=G||H.position.x!==ce.x||H.position.y!==ce.y,H.position=ce,H.internals.positionAbsolute=le}if(b=b||G,!!G&&(F(a,!0),x&&(o||T||!R&&B))){const[X,H]=Gc({nodeId:R,dragItems:a,nodeLookup:I});o==null||o(x,a,X,H),T==null||T(x,X,H),R||B==null||B(x,H)}}async function M(){if(!v)return;const{transform:j,panBy:N,autoPanSpeed:I,autoPanOnNodeDrag:q}=r();if(!q){l=!1,cancelAnimationFrame(y);return}const[U,K]=eg(_,v,I);(U!==0||K!==0)&&(S.x=(S.x??0)-U/j[2],S.y=(S.y??0)-K/j[2],await N({x:U,y:K})&&k(S)),y=requestAnimationFrame(M)}function W(j){var Z;const{nodeLookup:N,multiSelectionActive:I,nodesDraggable:q,transform:U,snapGrid:K,snapToGrid:V,selectNodesOnDrag:T,onNodeDragStart:B,onSelectionDragStart:P,unselectNodesAndEdges:F}=r();c=!0,(!T||!L)&&!I&&R&&((Z=N.get(R))!=null&&Z.selected||F()),L&&T&&R&&(e==null||e(R));const G=gs(j.sourceEvent,{transform:U,snapGrid:K,snapToGrid:V,containerBounds:v});if(S=G,a=aC(N,q,G,R),a.size>0&&(i||B||!R&&P)){const[ie,ae]=Gc({nodeId:R,dragItems:a,nodeLookup:N});i==null||i(j.sourceEvent,a,ie,ae),B==null||B(j.sourceEvent,ie,ae),R||P==null||P(j.sourceEvent,ae)}}const z=T_().clickDistance(D).on("start",j=>{const{domNode:N,nodeDragThreshold:I,transform:q,snapGrid:U,snapToGrid:K}=r();v=(N==null?void 0:N.getBoundingClientRect())||null,C=!1,b=!1,x=j.sourceEvent,I===0&&W(j),S=gs(j.sourceEvent,{transform:q,snapGrid:U,snapToGrid:K,containerBounds:v}),_=er(j.sourceEvent,v)}).on("drag",j=>{const{autoPanOnNodeDrag:N,transform:I,snapGrid:q,snapToGrid:U,nodeDragThreshold:K,nodeLookup:V}=r(),T=gs(j.sourceEvent,{transform:I,snapGrid:q,snapToGrid:U,containerBounds:v});if(x=j.sourceEvent,(j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||R&&!V.has(R))&&(C=!0),!C){if(!l&&N&&c&&(l=!0,M()),!c){const B=er(j.sourceEvent,v),P=B.x-_.x,F=B.y-_.y;Math.sqrt(P*P+F*F)>K&&W(j)}(S.x!==T.xSnapped||S.y!==T.ySnapped)&&a&&c&&(_=er(j.sourceEvent,v),k(T))}}).on("end",j=>{if(!(!c||C)&&(l=!1,c=!1,cancelAnimationFrame(y),a.size>0)){const{nodeLookup:N,updateNodePositions:I,onNodeDragStop:q,onSelectionDragStop:U}=r();if(b&&(I(a,!1),b=!1),h||q||!R&&U){const[K,V]=Gc({nodeId:R,dragItems:a,nodeLookup:N,dragging:!1});h==null||h(j.sourceEvent,a,K,V),q==null||q(j.sourceEvent,K,V),R||U==null||U(j.sourceEvent,V)}}}).filter(j=>{const N=j.target;return!j.button&&(!d||!Sp(N,`.${d}`,w))&&(!u||Sp(N,u,w))});m.call(z)}function p(){m==null||m.on(".drag",null)}return{update:f,destroy:p}}function uC(e,r,i){const o=[],h={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const S of r.values())xs(h,fi(S))>0&&o.push(S);return o}const hC=250;function dC(e,r,i,o){var a,l;let h=[],S=1/0;const y=uC(e,i,r+hC);for(const _ of y){const v=[...((a=_.internals.handleBounds)==null?void 0:a.source)??[],...((l=_.internals.handleBounds)==null?void 0:l.target)??[]];for(const c of v){if(o.nodeId===c.nodeId&&o.type===c.type&&o.id===c.id)continue;const{x:m,y:C}=Ln(_,c,c.position,!0),b=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(C-e.y,2));b>r||(b<S?(h=[{...c,x:m,y:C}],S=b):b===S&&h.push({...c,x:m,y:C}))}}if(!h.length)return null;if(h.length>1){const _=o.type==="source"?"target":"source";return h.find(v=>v.type===_)??h[0]}return h[0]}function _g(e,r,i,o,h,S=!1){var _,v,c;const y=o.get(e);if(!y)return null;const a=h==="strict"?(_=y.internals.handleBounds)==null?void 0:_[r]:[...((v=y.internals.handleBounds)==null?void 0:v.source)??[],...((c=y.internals.handleBounds)==null?void 0:c.target)??[]],l=(i?a==null?void 0:a.find(m=>m.id===i):a==null?void 0:a[0])??null;return l&&S?{...l,...Ln(y,l,l.position,!0)}:l}function gg(e,r){return e||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function fC(e,r){let i=null;return r?i=!0:e&&!r&&(i=!1),i}const mg=()=>!0;function pC(e,{connectionMode:r,connectionRadius:i,handleId:o,nodeId:h,edgeUpdaterType:S,isTarget:y,domNode:a,nodeLookup:l,lib:_,autoPanOnConnect:v,flowId:c,panBy:m,cancelConnection:C,onConnectStart:b,onConnect:x,onConnectEnd:f,isValidConnection:p=mg,onReconnectEnd:d,updateConnection:u,getTransform:w,getFromHandle:L,autoPanSpeed:R,dragThreshold:D=1,handleDomNode:k}){const M=ig(e.target);let W=0,z;const{x:j,y:N}=er(e),I=gg(S,k),q=a==null?void 0:a.getBoundingClientRect();let U=!1;if(!q||!I)return;const K=_g(h,I,o,l,r);if(!K)return;let V=er(e,q),T=!1,B=null,P=!1,F=null;function G(){if(!v||!q)return;const[ce,le]=eg(V,q,R);m({x:ce,y:le}),W=requestAnimationFrame(G)}const Z={...K,nodeId:h,type:I,position:K.position},ie=l.get(h);let X={inProgress:!0,isValid:null,from:Ln(ie,Z,xe.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:ie,to:V,toHandle:null,toPosition:cp[Z.position],toNode:null,pointer:V};function H(){U=!0,u(X),b==null||b(e,{nodeId:h,handleId:o,handleType:I})}D===0&&H();function re(ce){if(!U){const{x:ge,y:Re}=er(ce),Ie=ge-j,ze=Re-N;if(!(Ie*Ie+ze*ze>D*D))return;H()}if(!L()||!Z){te(ce);return}const le=w();V=er(ce,q),z=dC(Ms(V,le,!1,[1,1]),i,l,Z),T||(G(),T=!0);const pe=vg(ce,{handle:z,connectionMode:r,fromNodeId:h,fromHandleId:o,fromType:y?"target":"source",isValidConnection:p,doc:M,lib:_,flowId:c,nodeLookup:l});F=pe.handleDomNode,B=pe.connection,P=fC(!!z,pe.isValid);const Se=l.get(h),be=Se?Ln(Se,Z,xe.Left,!0):X.from,ue={...X,from:be,isValid:P,to:pe.toHandle&&P?Da({x:pe.toHandle.x,y:pe.toHandle.y},le):V,toHandle:pe.toHandle,toPosition:P&&pe.toHandle?pe.toHandle.position:cp[Z.position],toNode:pe.toHandle?l.get(pe.toHandle.nodeId):null,pointer:V};u(ue),X=ue}function te(ce){if(!("touches"in ce&&ce.touches.length>0)){if(U){(z||F)&&B&&P&&(x==null||x(B));const{inProgress:le,...pe}=X,Se={...pe,toPosition:X.toHandle?X.toPosition:null};f==null||f(ce,Se),S&&(d==null||d(ce,Se))}C(),cancelAnimationFrame(W),T=!1,P=!1,B=null,F=null,M.removeEventListener("mousemove",re),M.removeEventListener("mouseup",te),M.removeEventListener("touchmove",re),M.removeEventListener("touchend",te)}}M.addEventListener("mousemove",re),M.addEventListener("mouseup",te),M.addEventListener("touchmove",re),M.addEventListener("touchend",te)}function vg(e,{handle:r,connectionMode:i,fromNodeId:o,fromHandleId:h,fromType:S,doc:y,lib:a,flowId:l,isValidConnection:_=mg,nodeLookup:v}){const c=S==="target",m=r?y.querySelector(`.${a}-flow__handle[data-id="${l}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:b}=er(e),x=y.elementFromPoint(C,b),f=x!=null&&x.classList.contains(`${a}-flow__handle`)?x:m,p={handleDomNode:f,isValid:!1,connection:null,toHandle:null};if(f){const d=gg(void 0,f),u=f.getAttribute("data-nodeid"),w=f.getAttribute("data-handleid"),L=f.classList.contains("connectable"),R=f.classList.contains("connectableend");if(!u||!d)return p;const D={source:c?u:o,sourceHandle:c?w:h,target:c?o:u,targetHandle:c?h:w};p.connection=D;const M=L&&R&&(i===hi.Strict?c&&d==="source"||!c&&d==="target":u!==o||w!==h);p.isValid=M&&_(D),p.toHandle=_g(u,d,w,v,i,!0)}return p}const Au={onPointerDown:pC,isValid:vg};function _C({domNode:e,panZoom:r,getTransform:i,getViewScale:o}){const h=Nt(e);function S({translateExtent:a,width:l,height:_,zoomStep:v=1,pannable:c=!0,zoomable:m=!0,inversePan:C=!1}){const b=u=>{if(u.sourceEvent.type!=="wheel"||!r)return;const w=i(),L=u.sourceEvent.ctrlKey&&bs()?10:1,R=-u.sourceEvent.deltaY*(u.sourceEvent.deltaMode===1?.05:u.sourceEvent.deltaMode?1:.002)*v,D=w[2]*Math.pow(2,R*L);r.scaleTo(D)};let x=[0,0];const f=u=>{(u.sourceEvent.type==="mousedown"||u.sourceEvent.type==="touchstart")&&(x=[u.sourceEvent.clientX??u.sourceEvent.touches[0].clientX,u.sourceEvent.clientY??u.sourceEvent.touches[0].clientY])},p=u=>{const w=i();if(u.sourceEvent.type!=="mousemove"&&u.sourceEvent.type!=="touchmove"||!r)return;const L=[u.sourceEvent.clientX??u.sourceEvent.touches[0].clientX,u.sourceEvent.clientY??u.sourceEvent.touches[0].clientY],R=[L[0]-x[0],L[1]-x[1]];x=L;const D=o()*Math.max(w[2],Math.log(w[2]))*(C?-1:1),k={x:w[0]-R[0]*D,y:w[1]-R[1]*D},M=[[0,0],[l,_]];r.setViewportConstrained({x:k.x,y:k.y,zoom:w[2]},M,a)},d=q_().on("start",f).on("zoom",c?p:null).on("zoom.wheel",m?b:null);h.call(d,{})}function y(){h.on("zoom",null)}return{update:S,destroy:y,pointer:Qt}}const $a=e=>({x:e.x,y:e.y,zoom:e.k}),Qc=({x:e,y:r,zoom:i})=>Fa.translate(e,r).scale(i),si=(e,r)=>e.target.closest(`.${r}`),yg=(e,r)=>r===2&&Array.isArray(e)&&e.includes(2),gC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Jc=(e,r=0,i=gC,o=()=>{})=>{const h=typeof r=="number"&&r>0;return h||o(),h?e.transition().duration(r).ease(i).on("end",o):e},wg=e=>{const r=e.ctrlKey&&bs()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*r};function mC({zoomPanValues:e,noWheelClassName:r,d3Selection:i,d3Zoom:o,panOnScrollMode:h,panOnScrollSpeed:S,zoomOnPinch:y,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:_}){return v=>{if(si(v,r))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const c=i.property("__zoom").k||1;if(v.ctrlKey&&y){const f=Qt(v),p=wg(v),d=c*Math.pow(2,p);o.scaleTo(i,d,f,v);return}const m=v.deltaMode===1?20:1;let C=h===xn.Vertical?0:v.deltaX*m,b=h===xn.Horizontal?0:v.deltaY*m;!bs()&&v.shiftKey&&h!==xn.Vertical&&(C=v.deltaY*m,b=0),o.translateBy(i,-(C/c)*S,-(b/c)*S,{internal:!0});const x=$a(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(v,x),e.panScrollTimeout=setTimeout(()=>{_==null||_(v,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(v,x))}}function vC({noWheelClassName:e,preventScrolling:r,d3ZoomHandler:i}){return function(o,h){const S=o.type==="wheel",y=!r&&S&&!o.ctrlKey,a=si(o,e);if(o.ctrlKey&&S&&a&&o.preventDefault(),y||a)return null;o.preventDefault(),i.call(this,o,h)}}function yC({zoomPanValues:e,onDraggingChange:r,onPanZoomStart:i}){return o=>{var S,y,a;if((S=o.sourceEvent)!=null&&S.internal)return;const h=$a(o.transform);e.mouseButton=((y=o.sourceEvent)==null?void 0:y.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=h,((a=o.sourceEvent)==null?void 0:a.type)==="mousedown"&&r(!0),i&&(i==null||i(o.sourceEvent,h))}}function wC({zoomPanValues:e,panOnDrag:r,onPaneContextMenu:i,onTransformChange:o,onPanZoom:h}){return S=>{var y,a;e.usedRightMouseButton=!!(i&&yg(r,e.mouseButton??0)),(y=S.sourceEvent)!=null&&y.sync||o([S.transform.x,S.transform.y,S.transform.k]),h&&!((a=S.sourceEvent)!=null&&a.internal)&&(h==null||h(S.sourceEvent,$a(S.transform)))}}function SC({zoomPanValues:e,panOnDrag:r,panOnScroll:i,onDraggingChange:o,onPanZoomEnd:h,onPaneContextMenu:S}){return y=>{var a;if(!((a=y.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,S&&yg(r,e.mouseButton??0)&&!e.usedRightMouseButton&&y.sourceEvent&&S(y.sourceEvent),e.usedRightMouseButton=!1,o(!1),h)){const l=$a(y.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{h==null||h(y.sourceEvent,l)},i?150:0)}}}function CC({zoomActivationKeyPressed:e,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:o,panOnScroll:h,zoomOnDoubleClick:S,userSelectionActive:y,noWheelClassName:a,noPanClassName:l,lib:_,connectionInProgress:v}){return c=>{var f;const m=e||r,C=i&&c.ctrlKey,b=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(si(c,`${_}-flow__node`)||si(c,`${_}-flow__edge`)))return!0;if(!o&&!m&&!h&&!S&&!i||y||v&&!b||si(c,a)&&b||si(c,l)&&(!b||h&&b&&!e)||!i&&c.ctrlKey&&b)return!1;if(!i&&c.type==="touchstart"&&((f=c.touches)==null?void 0:f.length)>1)return c.preventDefault(),!1;if(!m&&!h&&!C&&b||!o&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(o)&&!o.includes(c.button)&&c.type==="mousedown")return!1;const x=Array.isArray(o)&&o.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||b)&&x}}function xC({domNode:e,minZoom:r,maxZoom:i,translateExtent:o,viewport:h,onPanZoom:S,onPanZoomStart:y,onPanZoomEnd:a,onDraggingChange:l}){const _={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=e.getBoundingClientRect(),c=q_().scaleExtent([r,i]).translateExtent(o),m=Nt(e).call(c);d({x:h.x,y:h.y,zoom:di(h.zoom,r,i)},[[0,0],[v.width,v.height]],o);const C=m.on("wheel.zoom"),b=m.on("dblclick.zoom");c.wheelDelta(wg);function x(z,j){return m?new Promise(N=>{c==null||c.interpolate((j==null?void 0:j.interpolate)==="linear"?_s:pa).transform(Jc(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>N(!0)),z)}):Promise.resolve(!1)}function f({noWheelClassName:z,noPanClassName:j,onPaneContextMenu:N,userSelectionActive:I,panOnScroll:q,panOnDrag:U,panOnScrollMode:K,panOnScrollSpeed:V,preventScrolling:T,zoomOnPinch:B,zoomOnScroll:P,zoomOnDoubleClick:F,zoomActivationKeyPressed:G,lib:Z,onTransformChange:ie,connectionInProgress:ae,paneClickDistance:X,selectionOnDrag:H}){I&&!_.isZoomingOrPanning&&p();const re=q&&!G&&!I;c.clickDistance(H?1/0:!Zt(X)||X<0?0:X);const te=re?mC({zoomPanValues:_,noWheelClassName:z,d3Selection:m,d3Zoom:c,panOnScrollMode:K,panOnScrollSpeed:V,zoomOnPinch:B,onPanZoomStart:y,onPanZoom:S,onPanZoomEnd:a}):vC({noWheelClassName:z,preventScrolling:T,d3ZoomHandler:C});if(m.on("wheel.zoom",te,{passive:!1}),!I){const le=yC({zoomPanValues:_,onDraggingChange:l,onPanZoomStart:y});c.on("start",le);const pe=wC({zoomPanValues:_,panOnDrag:U,onPaneContextMenu:!!N,onPanZoom:S,onTransformChange:ie});c.on("zoom",pe);const Se=SC({zoomPanValues:_,panOnDrag:U,panOnScroll:q,onPaneContextMenu:N,onPanZoomEnd:a,onDraggingChange:l});c.on("end",Se)}const ce=CC({zoomActivationKeyPressed:G,panOnDrag:U,zoomOnScroll:P,panOnScroll:q,zoomOnDoubleClick:F,zoomOnPinch:B,userSelectionActive:I,noPanClassName:j,noWheelClassName:z,lib:Z,connectionInProgress:ae});c.filter(ce),F?m.on("dblclick.zoom",b):m.on("dblclick.zoom",null)}function p(){c.on("zoom",null)}async function d(z,j,N){const I=Qc(z),q=c==null?void 0:c.constrain()(I,j,N);return q&&await x(q),new Promise(U=>U(q))}async function u(z,j){const N=Qc(z);return await x(N,j),new Promise(I=>I(N))}function w(z){if(m){const j=Qc(z),N=m.property("__zoom");(N.k!==z.zoom||N.x!==z.x||N.y!==z.y)&&(c==null||c.transform(m,j,null,{sync:!0}))}}function L(){const z=m?V_(m.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}function R(z,j){return m?new Promise(N=>{c==null||c.interpolate((j==null?void 0:j.interpolate)==="linear"?_s:pa).scaleTo(Jc(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>N(!0)),z)}):Promise.resolve(!1)}function D(z,j){return m?new Promise(N=>{c==null||c.interpolate((j==null?void 0:j.interpolate)==="linear"?_s:pa).scaleBy(Jc(m,j==null?void 0:j.duration,j==null?void 0:j.ease,()=>N(!0)),z)}):Promise.resolve(!1)}function k(z){c==null||c.scaleExtent(z)}function M(z){c==null||c.translateExtent(z)}function W(z){const j=!Zt(z)||z<0?0:z;c==null||c.clickDistance(j)}return{update:f,destroy:p,setViewport:u,setViewportConstrained:d,getViewport:L,scaleTo:R,scaleBy:D,setScaleExtent:k,setTranslateExtent:M,syncViewport:w,setClickDistance:W}}var _i;(function(e){e.Line="line",e.Handle="handle"})(_i||(_i={}));function bC({width:e,prevWidth:r,height:i,prevHeight:o,affectsX:h,affectsY:S}){const y=e-r,a=i-o,l=[y>0?1:y<0?-1:0,a>0?1:a<0?-1:0];return y&&h&&(l[0]=l[0]*-1),a&&S&&(l[1]=l[1]*-1),l}function Cp(e){const r=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),o=e.includes("left"),h=e.includes("top");return{isHorizontal:r,isVertical:i,affectsX:o,affectsY:h}}function Gr(e,r){return Math.max(0,r-e)}function Qr(e,r){return Math.max(0,e-r)}function sa(e,r,i){return Math.max(0,r-e,e-i)}function xp(e,r){return e?!r:r}function EC(e,r,i,o,h,S,y,a){let{affectsX:l,affectsY:_}=r;const{isHorizontal:v,isVertical:c}=r,m=v&&c,{xSnapped:C,ySnapped:b}=i,{minWidth:x,maxWidth:f,minHeight:p,maxHeight:d}=o,{x:u,y:w,width:L,height:R,aspectRatio:D}=e;let k=Math.floor(v?C-e.pointerX:0),M=Math.floor(c?b-e.pointerY:0);const W=L+(l?-k:k),z=R+(_?-M:M),j=-S[0]*L,N=-S[1]*R;let I=sa(W,x,f),q=sa(z,p,d);if(y){let V=0,T=0;l&&k<0?V=Gr(u+k+j,y[0][0]):!l&&k>0&&(V=Qr(u+W+j,y[1][0])),_&&M<0?T=Gr(w+M+N,y[0][1]):!_&&M>0&&(T=Qr(w+z+N,y[1][1])),I=Math.max(I,V),q=Math.max(q,T)}if(a){let V=0,T=0;l&&k>0?V=Qr(u+k,a[0][0]):!l&&k<0&&(V=Gr(u+W,a[1][0])),_&&M>0?T=Qr(w+M,a[0][1]):!_&&M<0&&(T=Gr(w+z,a[1][1])),I=Math.max(I,V),q=Math.max(q,T)}if(h){if(v){const V=sa(W/D,p,d)*D;if(I=Math.max(I,V),y){let T=0;!l&&!_||l&&!_&&m?T=Qr(w+N+W/D,y[1][1])*D:T=Gr(w+N+(l?k:-k)/D,y[0][1])*D,I=Math.max(I,T)}if(a){let T=0;!l&&!_||l&&!_&&m?T=Gr(w+W/D,a[1][1])*D:T=Qr(w+(l?k:-k)/D,a[0][1])*D,I=Math.max(I,T)}}if(c){const V=sa(z*D,x,f)/D;if(q=Math.max(q,V),y){let T=0;!l&&!_||_&&!l&&m?T=Qr(u+z*D+j,y[1][0])/D:T=Gr(u+(_?M:-M)*D+j,y[0][0])/D,q=Math.max(q,T)}if(a){let T=0;!l&&!_||_&&!l&&m?T=Gr(u+z*D,a[1][0])/D:T=Qr(u+(_?M:-M)*D,a[0][0])/D,q=Math.max(q,T)}}}M=M+(M<0?q:-q),k=k+(k<0?I:-I),h&&(m?W>z*D?M=(xp(l,_)?-k:k)/D:k=(xp(l,_)?-M:M)*D:v?(M=k/D,_=l):(k=M*D,l=_));const U=l?u+k:u,K=_?w+M:w;return{width:L+(l?-k:k),height:R+(_?-M:M),x:S[0]*k*(l?-1:1)+U,y:S[1]*M*(_?-1:1)+K}}const Sg={width:0,height:0,x:0,y:0},kC={...Sg,pointerX:0,pointerY:0,aspectRatio:1};function LC(e){return[[0,0],[e.measured.width,e.measured.height]]}function RC(e,r,i){const o=r.position.x+e.position.x,h=r.position.y+e.position.y,S=e.measured.width??0,y=e.measured.height??0,a=i[0]*S,l=i[1]*y;return[[o-a,h-l],[o+S-a,h+y-l]]}function DC({domNode:e,nodeId:r,getStoreItems:i,onChange:o,onEnd:h}){const S=Nt(e);let y={controlDirection:Cp("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:_,boundaries:v,keepAspectRatio:c,resizeDirection:m,onResizeStart:C,onResize:b,onResizeEnd:x,shouldResize:f}){let p={...Sg},d={...kC};y={boundaries:v,resizeDirection:m,keepAspectRatio:c,controlDirection:Cp(_)};let u,w=null,L=[],R,D,k,M=!1;const W=T_().on("start",z=>{const{nodeLookup:j,transform:N,snapGrid:I,snapToGrid:q,nodeOrigin:U,paneDomNode:K}=i();if(u=j.get(r),!u)return;w=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:V,ySnapped:T}=gs(z.sourceEvent,{transform:N,snapGrid:I,snapToGrid:q,containerBounds:w});p={width:u.measured.width??0,height:u.measured.height??0,x:u.position.x??0,y:u.position.y??0},d={...p,pointerX:V,pointerY:T,aspectRatio:p.width/p.height},R=void 0,u.parentId&&(u.extent==="parent"||u.expandParent)&&(R=j.get(u.parentId),D=R&&u.extent==="parent"?LC(R):void 0),L=[],k=void 0;for(const[B,P]of j)if(P.parentId===r&&(L.push({id:B,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const F=RC(P,u,P.origin??U);k?k=[[Math.min(F[0][0],k[0][0]),Math.min(F[0][1],k[0][1])],[Math.max(F[1][0],k[1][0]),Math.max(F[1][1],k[1][1])]]:k=F}C==null||C(z,{...p})}).on("drag",z=>{const{transform:j,snapGrid:N,snapToGrid:I,nodeOrigin:q}=i(),U=gs(z.sourceEvent,{transform:j,snapGrid:N,snapToGrid:I,containerBounds:w}),K=[];if(!u)return;const{x:V,y:T,width:B,height:P}=p,F={},G=u.origin??q,{width:Z,height:ie,x:ae,y:X}=EC(d,y.controlDirection,U,y.boundaries,y.keepAspectRatio,G,D,k),H=Z!==B,re=ie!==P,te=ae!==V&&H,ce=X!==T&&re;if(!te&&!ce&&!H&&!re)return;if((te||ce||G[0]===1||G[1]===1)&&(F.x=te?ae:p.x,F.y=ce?X:p.y,p.x=F.x,p.y=F.y,L.length>0)){const be=ae-V,ue=X-T;for(const ge of L)ge.position={x:ge.position.x-be+G[0]*(Z-B),y:ge.position.y-ue+G[1]*(ie-P)},K.push(ge)}if((H||re)&&(F.width=H&&(!y.resizeDirection||y.resizeDirection==="horizontal")?Z:p.width,F.height=re&&(!y.resizeDirection||y.resizeDirection==="vertical")?ie:p.height,p.width=F.width,p.height=F.height),R&&u.expandParent){const be=G[0]*(F.width??0);F.x&&F.x<be&&(p.x=be,d.x=d.x-(F.x-be));const ue=G[1]*(F.height??0);F.y&&F.y<ue&&(p.y=ue,d.y=d.y-(F.y-ue))}const le=bC({width:p.width,prevWidth:B,height:p.height,prevHeight:P,affectsX:y.controlDirection.affectsX,affectsY:y.controlDirection.affectsY}),pe={...p,direction:le};(f==null?void 0:f(z,pe))!==!1&&(M=!0,b==null||b(z,pe),o(F,K))}).on("end",z=>{M&&(x==null||x(z,{...p}),h==null||h({...p}),M=!1)});S.call(W)}function l(){S.on(".drag",null)}return{update:a,destroy:l}}var Zc={exports:{}},eu={},tu={exports:{}},ru={};/**
|
|
41
41
|
* @license React
|
|
42
42
|
* use-sync-external-store-shim.production.js
|
|
43
43
|
*
|
|
@@ -58,7 +58,7 @@ Error generating stack: `+A.message+`
|
|
|
58
58
|
|
|
59
59
|
`,`
|
|
60
60
|
+`).split(`
|
|
61
|
-
`)),v=_.reduce((c,m)=>c.concat(...m),[]);return[_,v]}return[[],[]]},[e]);return J.useEffect(()=>{const l=(r==null?void 0:r.target)??Np,_=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(e!==null){const v=C=>{var f,p;if(h.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!h.current||h.current&&!_)&&sg(C))return!1;const x=Ip(C.code,a);if(S.current.add(C[x]),Bp(y,S.current,!1)){const d=((p=(f=C.composedPath)==null?void 0:f.call(C))==null?void 0:p[0])||C.target,u=(d==null?void 0:d.nodeName)==="BUTTON"||(d==null?void 0:d.nodeName)==="A";r.preventDefault!==!1&&(h.current||!u)&&C.preventDefault(),o(!0)}},c=C=>{const b=Ip(C.code,a);Bp(y,S.current,!0)?(o(!1),S.current.clear()):S.current.delete(C[b]),C.key==="Meta"&&S.current.clear(),h.current=!1},m=()=>{S.current.clear(),o(!1)};return l==null||l.addEventListener("keydown",v),l==null||l.addEventListener("keyup",c),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{l==null||l.removeEventListener("keydown",v),l==null||l.removeEventListener("keyup",c),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,o]),i}function Bp(e,r,i){return e.filter(o=>i||o.length===r.size).some(o=>o.every(h=>r.has(h)))}function Ip(e,r){return r.includes(e)?"code":"key"}const ox=()=>{const e=Ve();return J.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(r,i)=>{const{transform:[o,h,S],panZoom:y}=e.getState();return y?(await y.setViewport({x:r.x??o,y:r.y??h,zoom:r.zoom??S},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,o]=e.getState().transform;return{x:r,y:i,zoom:o}},setCenter:async(r,i,o)=>e.getState().setCenter(r,i,o),fitBounds:async(r,i)=>{const{width:o,height:h,minZoom:S,maxZoom:y,panZoom:a}=e.getState(),l=Zu(r,o,h,S,y,(i==null?void 0:i.padding)??.1);return a?(await a.setViewport(l,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:o,snapGrid:h,snapToGrid:S,domNode:y}=e.getState();if(!y)return r;const{x:a,y:l}=y.getBoundingClientRect(),_={x:r.x-a,y:r.y-l},v=i.snapGrid??h,c=i.snapToGrid??S;return Ms(_,o,c,v)},flowToScreenPosition:r=>{const{transform:i,domNode:o}=e.getState();if(!o)return r;const{x:h,y:S}=o.getBoundingClientRect(),y=Da(r,i);return{x:y.x+h,y:y.y+S}}}),[])};function Lg(e,r){const i=[],o=new Map,h=[];for(const S of e)if(S.type==="add"){h.push(S);continue}else if(S.type==="remove"||S.type==="replace")o.set(S.id,[S]);else{const y=o.get(S.id);y?y.push(S):o.set(S.id,[S])}for(const S of r){const y=o.get(S.id);if(!y){i.push(S);continue}if(y[0].type==="remove")continue;if(y[0].type==="replace"){i.push({...y[0].item});continue}const a={...S};for(const l of y)ax(l,a);i.push(a)}return h.length&&h.forEach(S=>{S.index!==void 0?i.splice(S.index,0,{...S.item}):i.push({...S.item})}),i}function ax(e,r){switch(e.type){case"select":{r.selected=e.selected;break}case"position":{typeof e.position<"u"&&(r.position=e.position),typeof e.dragging<"u"&&(r.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(r.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(r.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(r.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(r.resizing=e.resizing);break}}}function lx(e,r){return Lg(e,r)}function cx(e,r){return Lg(e,r)}function wn(e,r){return{id:e,type:"select",selected:r}}function oi(e,r=new Set,i=!1){const o=[];for(const[h,S]of e){const y=r.has(h);!(S.selected===void 0&&!y)&&S.selected!==y&&(i&&(S.selected=y),o.push(wn(S.id,y)))}return o}function Op({items:e=[],lookup:r}){var h;const i=[],o=new Map(e.map(S=>[S.id,S]));for(const[S,y]of e.entries()){const a=r.get(y.id),l=((h=a==null?void 0:a.internals)==null?void 0:h.userNode)??a;l!==void 0&&l!==y&&i.push({id:y.id,item:y,type:"replace"}),l===void 0&&i.push({item:y,type:"add",index:S})}for(const[S]of r)o.get(S)===void 0&&i.push({id:S,type:"remove"});return i}function Hp(e){return{id:e.id,type:"remove"}}const Fp=e=>TS(e),ux=e=>Q_(e);function Rg(e){return J.forwardRef(e)}function jp(e){const[r,i]=J.useState(BigInt(0)),[o]=J.useState(()=>hx(()=>i(h=>h+BigInt(1))));return Tu(()=>{const h=o.get();h.length&&(e(h),o.reset())},[r]),o}function hx(e){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),e()}}}const Dg=J.createContext(null);function dx({children:e}){const r=Ve(),i=J.useCallback(a=>{const{nodes:l=[],setNodes:_,hasDefaultNodes:v,onNodesChange:c,nodeLookup:m,fitViewQueued:C,onNodesChangeMiddlewareMap:b}=r.getState();let x=l;for(const p of a)x=typeof p=="function"?p(x):p;let f=Op({items:x,lookup:m});for(const p of b.values())f=p(f);v&&_(x),f.length>0?c==null||c(f):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:d,setNodes:u}=r.getState();p&&u(d)})},[]),o=jp(i),h=J.useCallback(a=>{const{edges:l=[],setEdges:_,hasDefaultEdges:v,onEdgesChange:c,edgeLookup:m}=r.getState();let C=l;for(const b of a)C=typeof b=="function"?b(C):b;v?_(C):c&&c(Op({items:C,lookup:m}))},[]),S=jp(h),y=J.useMemo(()=>({nodeQueue:o,edgeQueue:S}),[]);return O.jsx(Dg.Provider,{value:y,children:e})}function fx(){const e=J.useContext(Dg);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const px=e=>!!e.panZoom;function oh(){const e=ox(),r=Ve(),i=fx(),o=Te(px),h=J.useMemo(()=>{const S=c=>r.getState().nodeLookup.get(c),y=c=>{i.nodeQueue.push(c)},a=c=>{i.edgeQueue.push(c)},l=c=>{var p,d;const{nodeLookup:m,nodeOrigin:C}=r.getState(),b=Fp(c)?c:m.get(c.id),x=b.parentId?ng(b.position,b.measured,b.parentId,m,C):b.position,f={...b,position:x,width:((p=b.measured)==null?void 0:p.width)??b.width,height:((d=b.measured)==null?void 0:d.height)??b.height};return fi(f)},_=(c,m,C={replace:!1})=>{y(b=>b.map(x=>{if(x.id===c){const f=typeof m=="function"?m(x):m;return C.replace&&Fp(f)?f:{...x,...f}}return x}))},v=(c,m,C={replace:!1})=>{a(b=>b.map(x=>{if(x.id===c){const f=typeof m=="function"?m(x):m;return C.replace&&ux(f)?f:{...x,...f}}return x}))};return{getNodes:()=>r.getState().nodes.map(c=>({...c})),getNode:c=>{var m;return(m=S(c))==null?void 0:m.internals.userNode},getInternalNode:S,getEdges:()=>{const{edges:c=[]}=r.getState();return c.map(m=>({...m}))},getEdge:c=>r.getState().edgeLookup.get(c),setNodes:y,setEdges:a,addNodes:c=>{const m=Array.isArray(c)?c:[c];i.nodeQueue.push(C=>[...C,...m])},addEdges:c=>{const m=Array.isArray(c)?c:[c];i.edgeQueue.push(C=>[...C,...m])},toObject:()=>{const{nodes:c=[],edges:m=[],transform:C}=r.getState(),[b,x,f]=C;return{nodes:c.map(p=>({...p})),edges:m.map(p=>({...p})),viewport:{x:b,y:x,zoom:f}}},deleteElements:async({nodes:c=[],edges:m=[]})=>{const{nodes:C,edges:b,onNodesDelete:x,onEdgesDelete:f,triggerNodeChanges:p,triggerEdgeChanges:d,onDelete:u,onBeforeDelete:w}=r.getState(),{nodes:L,edges:R}=await IS({nodesToRemove:c,edgesToRemove:m,nodes:C,edges:b,onBeforeDelete:w}),D=R.length>0,k=L.length>0;if(D){const M=R.map(Hp);f==null||f(R),d(M)}if(k){const M=L.map(Hp);x==null||x(L),p(M)}return(k||D)&&(u==null||u({nodes:L,edges:R})),{deletedNodes:L,deletedEdges:R}},getIntersectingNodes:(c,m=!0,C)=>{const b=hp(c),x=b?c:l(c),f=C!==void 0;return x?(C||r.getState().nodes).filter(p=>{const d=r.getState().nodeLookup.get(p.id);if(d&&!b&&(p.id===c.id||!d.internals.positionAbsolute))return!1;const u=fi(f?p:d),w=xs(u,x);return m&&w>0||w>=u.width*u.height||w>=x.width*x.height}):[]},isNodeIntersecting:(c,m,C=!0)=>{const x=hp(c)?c:l(c);if(!x)return!1;const f=xs(x,m);return C&&f>0||f>=m.width*m.height||f>=x.width*x.height},updateNode:_,updateNodeData:(c,m,C={replace:!1})=>{_(c,b=>{const x=typeof m=="function"?m(b):m;return C.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},C)},updateEdge:v,updateEdgeData:(c,m,C={replace:!1})=>{v(c,b=>{const x=typeof m=="function"?m(b):m;return C.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},C)},getNodesBounds:c=>{const{nodeLookup:m,nodeOrigin:C}=r.getState();return MS(c,{nodeLookup:m,nodeOrigin:C})},getHandleConnections:({type:c,id:m,nodeId:C})=>{var b;return Array.from(((b=r.getState().connectionLookup.get(`${C}-${c}${m?`-${m}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:c,handleId:m,nodeId:C})=>{var b;return Array.from(((b=r.getState().connectionLookup.get(`${C}${c?m?`-${c}-${m}`:`-${c}`:""}`))==null?void 0:b.values())??[])},fitView:async c=>{const m=r.getState().fitViewResolver??jS();return r.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:m}),i.nodeQueue.push(C=>[...C]),m.promise}}},[]);return J.useMemo(()=>({...h,...e,viewportInitialized:o}),[o])}const zp=e=>e.selected,_x=typeof window<"u"?window:void 0;function gx({deleteKeyCode:e,multiSelectionKeyCode:r}){const i=Ve(),{deleteElements:o}=oh(),h=Es(e,{actInsideInputWithModifier:!1}),S=Es(r,{target:_x});J.useEffect(()=>{if(h){const{edges:y,nodes:a}=i.getState();o({nodes:a.filter(zp),edges:y.filter(zp)}),i.setState({nodesSelectionActive:!1})}},[h]),J.useEffect(()=>{i.setState({multiSelectionActive:S})},[S])}function mx(e){const r=Ve();J.useEffect(()=>{const i=()=>{var h,S,y,a;if(!e.current||!(((S=(h=e.current).checkVisibility)==null?void 0:S.call(h))??!0))return!1;const o=eh(e.current);(o.height===0||o.width===0)&&((a=(y=r.getState()).onError)==null||a.call(y,"004",dr.error004())),r.setState({width:o.width||500,height:o.height||500})};if(e.current){i(),window.addEventListener("resize",i);const o=new ResizeObserver(()=>i());return o.observe(e.current),()=>{window.removeEventListener("resize",i),o&&e.current&&o.unobserve(e.current)}}},[])}const Va={position:"absolute",width:"100%",height:"100%",top:0,left:0},vx=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function yx({onPaneContextMenu:e,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:o=!1,panOnScrollSpeed:h=.5,panOnScrollMode:S=xn.Free,zoomOnDoubleClick:y=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:_,minZoom:v,maxZoom:c,zoomActivationKeyCode:m,preventScrolling:C=!0,children:b,noWheelClassName:x,noPanClassName:f,onViewportChange:p,isControlledViewport:d,paneClickDistance:u,selectionOnDrag:w}){const L=Ve(),R=J.useRef(null),{userSelectionActive:D,lib:k,connectionInProgress:M}=Te(vx,Ue),W=Es(m),z=J.useRef();mx(R);const j=J.useCallback(N=>{p==null||p({x:N[0],y:N[1],zoom:N[2]}),d||L.setState({transform:N})},[p,d]);return J.useEffect(()=>{if(R.current){z.current=xC({domNode:R.current,minZoom:v,maxZoom:c,translateExtent:_,viewport:l,onDraggingChange:U=>L.setState(K=>K.paneDragging===U?K:{paneDragging:U}),onPanZoomStart:(U,K)=>{const{onViewportChangeStart:V,onMoveStart:T}=L.getState();T==null||T(U,K),V==null||V(K)},onPanZoom:(U,K)=>{const{onViewportChange:V,onMove:T}=L.getState();T==null||T(U,K),V==null||V(K)},onPanZoomEnd:(U,K)=>{const{onViewportChangeEnd:V,onMoveEnd:T}=L.getState();T==null||T(U,K),V==null||V(K)}});const{x:N,y:I,zoom:q}=z.current.getViewport();return L.setState({panZoom:z.current,transform:[N,I,q],domNode:R.current.closest(".react-flow")}),()=>{var U;(U=z.current)==null||U.destroy()}}},[]),J.useEffect(()=>{var N;(N=z.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:o,panOnScrollSpeed:h,panOnScrollMode:S,zoomOnDoubleClick:y,panOnDrag:a,zoomActivationKeyPressed:W,preventScrolling:C,noPanClassName:f,userSelectionActive:D,noWheelClassName:x,lib:k,onTransformChange:j,connectionInProgress:M,selectionOnDrag:w,paneClickDistance:u})},[e,r,i,o,h,S,y,a,W,C,f,D,x,k,j,M,w,u]),O.jsx("div",{className:"react-flow__renderer",ref:R,style:Va,children:b})}const wx=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Sx(){const{userSelectionActive:e,userSelectionRect:r}=Te(wx,Ue);return e&&r?O.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const nu=(e,r)=>i=>{i.target===r.current&&(e==null||e(i))},Cx=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function xx({isSelecting:e,selectionKeyPressed:r,selectionMode:i=Cs.Full,panOnDrag:o,paneClickDistance:h,selectionOnDrag:S,onSelectionStart:y,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:_,onPaneScroll:v,onPaneMouseEnter:c,onPaneMouseMove:m,onPaneMouseLeave:C,children:b}){const x=Ve(),{userSelectionActive:f,elementsSelectable:p,dragging:d,connectionInProgress:u}=Te(Cx,Ue),w=p&&(e||f),L=J.useRef(null),R=J.useRef(),D=J.useRef(new Set),k=J.useRef(new Set),M=J.useRef(!1),W=V=>{if(M.current||u){M.current=!1;return}l==null||l(V),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},z=V=>{if(Array.isArray(o)&&(o!=null&&o.includes(2))){V.preventDefault();return}_==null||_(V)},j=v?V=>v(V):void 0,N=V=>{M.current&&(V.stopPropagation(),M.current=!1)},I=V=>{var ie,ae;const{domNode:T}=x.getState();if(R.current=T==null?void 0:T.getBoundingClientRect(),!R.current)return;const B=V.target===L.current;if(!B&&!!V.target.closest(".nokey")||!e||!(S&&B||r)||V.button!==0||!V.isPrimary)return;(ae=(ie=V.target)==null?void 0:ie.setPointerCapture)==null||ae.call(ie,V.pointerId),M.current=!1;const{x:G,y:Z}=er(V.nativeEvent,R.current);x.setState({userSelectionRect:{width:0,height:0,startX:G,startY:Z,x:G,y:Z}}),B||(V.stopPropagation(),V.preventDefault())},q=V=>{const{userSelectionRect:T,transform:B,nodeLookup:P,edgeLookup:F,connectionLookup:G,triggerNodeChanges:Z,triggerEdgeChanges:ie,defaultEdgeOptions:ae,resetSelectedElements:X}=x.getState();if(!R.current||!T)return;const{x:H,y:re}=er(V.nativeEvent,R.current),{startX:te,startY:ce}=T;if(!M.current){const ue=r?0:h;if(Math.hypot(H-te,re-ce)<=ue)return;X(),y==null||y(V)}M.current=!0;const le={startX:te,startY:ce,x:H<te?H:te,y:re<ce?re:ce,width:Math.abs(H-te),height:Math.abs(re-ce)},pe=D.current,Se=k.current;D.current=new Set(Ju(P,le,B,i===Cs.Partial,!0).map(ue=>ue.id)),k.current=new Set;const be=(ae==null?void 0:ae.selectable)??!0;for(const ue of D.current){const ge=G.get(ue);if(ge)for(const{edgeId:Re}of ge.values()){const Ie=F.get(Re);Ie&&(Ie.selectable??be)&&k.current.add(Re)}}if(!dp(pe,D.current)){const ue=oi(P,D.current,!0);Z(ue)}if(!dp(Se,k.current)){const ue=oi(F,k.current);ie(ue)}x.setState({userSelectionRect:le,userSelectionActive:!0,nodesSelectionActive:!1})},U=V=>{var T,B;V.button===0&&((B=(T=V.target)==null?void 0:T.releasePointerCapture)==null||B.call(T,V.pointerId),!f&&V.target===L.current&&x.getState().userSelectionRect&&(W==null||W(V)),x.setState({userSelectionActive:!1,userSelectionRect:null}),M.current&&(a==null||a(V),x.setState({nodesSelectionActive:D.current.size>0})))},K=o===!0||Array.isArray(o)&&o.includes(0);return O.jsxs("div",{className:rt(["react-flow__pane",{draggable:K,dragging:d,selection:e}]),onClick:w?void 0:nu(W,L),onContextMenu:nu(z,L),onWheel:nu(j,L),onPointerEnter:w?void 0:c,onPointerMove:w?q:m,onPointerUp:w?U:void 0,onPointerDownCapture:w?I:void 0,onClickCapture:w?N:void 0,onPointerLeave:C,ref:L,style:Va,children:[b,O.jsx(Sx,{})]})}function Mu({id:e,store:r,unselect:i=!1,nodeRef:o}){const{addSelectedNodes:h,unselectNodesAndEdges:S,multiSelectionActive:y,nodeLookup:a,onError:l}=r.getState(),_=a.get(e);if(!_){l==null||l("012",dr.error012(e));return}r.setState({nodesSelectionActive:!1}),_.selected?(i||_.selected&&y)&&(S({nodes:[_],edges:[]}),requestAnimationFrame(()=>{var v;return(v=o==null?void 0:o.current)==null?void 0:v.blur()})):h([e])}function Ag({nodeRef:e,disabled:r=!1,noDragClassName:i,handleSelector:o,nodeId:h,isSelectable:S,nodeClickDistance:y}){const a=Ve(),[l,_]=J.useState(!1),v=J.useRef();return J.useEffect(()=>{v.current=cC({getStoreItems:()=>a.getState(),onNodeMouseDown:c=>{Mu({id:c,store:a,nodeRef:e})},onDragStart:()=>{_(!0)},onDragStop:()=>{_(!1)}})},[]),J.useEffect(()=>{if(!(r||!e.current||!v.current))return v.current.update({noDragClassName:i,handleSelector:o,domNode:e.current,isSelectable:S,nodeId:h,nodeClickDistance:y}),()=>{var c;(c=v.current)==null||c.destroy()}},[i,o,r,S,e,h,y]),l}const bx=e=>r=>r.selected&&(r.draggable||e&&typeof r.draggable>"u");function Tg(){const e=Ve();return J.useCallback(i=>{const{nodeExtent:o,snapToGrid:h,snapGrid:S,nodesDraggable:y,onError:a,updateNodePositions:l,nodeLookup:_,nodeOrigin:v}=e.getState(),c=new Map,m=bx(y),C=h?S[0]:5,b=h?S[1]:5,x=i.direction.x*C*i.factor,f=i.direction.y*b*i.factor;for(const[,p]of _){if(!m(p))continue;let d={x:p.internals.positionAbsolute.x+x,y:p.internals.positionAbsolute.y+f};h&&(d=Ts(d,S));const{position:u,positionAbsolute:w}=J_({nodeId:p.id,nextPosition:d,nodeLookup:_,nodeExtent:o,nodeOrigin:v,onError:a});p.position=u,p.internals.positionAbsolute=w,c.set(p.id,p)}l(c)},[])}const ah=J.createContext(null),Ex=ah.Provider;ah.Consumer;const Mg=()=>J.useContext(ah),kx=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Lx=(e,r,i)=>o=>{const{connectionClickStartHandle:h,connectionMode:S,connection:y}=o,{fromHandle:a,toHandle:l,isValid:_}=y,v=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===r&&(l==null?void 0:l.type)===i;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===r&&(a==null?void 0:a.type)===i,connectingTo:v,clickConnecting:(h==null?void 0:h.nodeId)===e&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===i,isPossibleEndHandle:S===hi.Strict?(a==null?void 0:a.type)!==i:e!==(a==null?void 0:a.nodeId)||r!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!h,valid:v&&_}};function Rx({type:e="source",position:r=xe.Top,isValidConnection:i,isConnectable:o=!0,isConnectableStart:h=!0,isConnectableEnd:S=!0,id:y,onConnect:a,children:l,className:_,onMouseDown:v,onTouchStart:c,...m},C){var q,U;const b=y||null,x=e==="target",f=Ve(),p=Mg(),{connectOnClick:d,noPanClassName:u,rfId:w}=Te(kx,Ue),{connectingFrom:L,connectingTo:R,clickConnecting:D,isPossibleEndHandle:k,connectionInProcess:M,clickConnectionInProcess:W,valid:z}=Te(Lx(p,b,e),Ue);p||(U=(q=f.getState()).onError)==null||U.call(q,"010",dr.error010());const j=K=>{const{defaultEdgeOptions:V,onConnect:T,hasDefaultEdges:B}=f.getState(),P={...V,...K};if(B){const{edges:F,setEdges:G}=f.getState();G(KS(P,F))}T==null||T(P),a==null||a(P)},N=K=>{if(!p)return;const V=og(K.nativeEvent);if(h&&(V&&K.button===0||!V)){const T=f.getState();Au.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:T.autoPanOnConnect,connectionMode:T.connectionMode,connectionRadius:T.connectionRadius,domNode:T.domNode,nodeLookup:T.nodeLookup,lib:T.lib,isTarget:x,handleId:b,nodeId:p,flowId:T.rfId,panBy:T.panBy,cancelConnection:T.cancelConnection,onConnectStart:T.onConnectStart,onConnectEnd:(...B)=>{var P,F;return(F=(P=f.getState()).onConnectEnd)==null?void 0:F.call(P,...B)},updateConnection:T.updateConnection,onConnect:j,isValidConnection:i||((...B)=>{var P,F;return((F=(P=f.getState()).isValidConnection)==null?void 0:F.call(P,...B))??!0}),getTransform:()=>f.getState().transform,getFromHandle:()=>f.getState().connection.fromHandle,autoPanSpeed:T.autoPanSpeed,dragThreshold:T.connectionDragThreshold})}V?v==null||v(K):c==null||c(K)},I=K=>{const{onClickConnectStart:V,onClickConnectEnd:T,connectionClickStartHandle:B,connectionMode:P,isValidConnection:F,lib:G,rfId:Z,nodeLookup:ie,connection:ae}=f.getState();if(!p||!B&&!h)return;if(!B){V==null||V(K.nativeEvent,{nodeId:p,handleId:b,handleType:e}),f.setState({connectionClickStartHandle:{nodeId:p,type:e,id:b}});return}const X=ig(K.target),H=i||F,{connection:re,isValid:te}=Au.isValid(K.nativeEvent,{handle:{nodeId:p,id:b,type:e},connectionMode:P,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:H,flowId:Z,doc:X,lib:G,nodeLookup:ie});te&&re&&j(re);const ce=structuredClone(ae);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,T==null||T(K,ce),f.setState({connectionClickStartHandle:null})};return O.jsx("div",{"data-handleid":b,"data-nodeid":p,"data-handlepos":r,"data-id":`${w}-${p}-${b}-${e}`,className:rt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",u,_,{source:!x,target:x,connectable:o,connectablestart:h,connectableend:S,clickconnecting:D,connectingfrom:L,connectingto:R,valid:z,connectionindicator:o&&(!M||k)&&(M||W?S:h)}]),onMouseDown:N,onTouchStart:N,onClick:d?I:void 0,ref:C,...m,children:l})}const gi=J.memo(Rg(Rx));function Dx({data:e,isConnectable:r,sourcePosition:i=xe.Bottom}){return O.jsxs(O.Fragment,{children:[e==null?void 0:e.label,O.jsx(gi,{type:"source",position:i,isConnectable:r})]})}function Ax({data:e,isConnectable:r,targetPosition:i=xe.Top,sourcePosition:o=xe.Bottom}){return O.jsxs(O.Fragment,{children:[O.jsx(gi,{type:"target",position:i,isConnectable:r}),e==null?void 0:e.label,O.jsx(gi,{type:"source",position:o,isConnectable:r})]})}function Tx(){return null}function Mx({data:e,isConnectable:r,targetPosition:i=xe.Top}){return O.jsxs(O.Fragment,{children:[O.jsx(gi,{type:"target",position:i,isConnectable:r}),e==null?void 0:e.label]})}const Aa={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$p={input:Dx,default:Ax,output:Mx,group:Tx};function Px(e){var r,i,o,h;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((r=e.style)==null?void 0:r.width),height:e.height??e.initialHeight??((i=e.style)==null?void 0:i.height)}:{width:e.width??((o=e.style)==null?void 0:o.width),height:e.height??((h=e.style)==null?void 0:h.height)}}const Nx=e=>{const{width:r,height:i,x:o,y:h}=As(e.nodeLookup,{filter:S=>!!S.selected});return{width:Zt(r)?r:null,height:Zt(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${h}px)`}};function Bx({onSelectionContextMenu:e,noPanClassName:r,disableKeyboardA11y:i}){const o=Ve(),{width:h,height:S,transformString:y,userSelectionActive:a}=Te(Nx,Ue),l=Tg(),_=J.useRef(null);J.useEffect(()=>{var C;i||(C=_.current)==null||C.focus({preventScroll:!0})},[i]);const v=!a&&h!==null&&S!==null;if(Ag({nodeRef:_,disabled:!v}),!v)return null;const c=e?C=>{const b=o.getState().nodes.filter(x=>x.selected);e(C,b)}:void 0,m=C=>{Object.prototype.hasOwnProperty.call(Aa,C.key)&&(C.preventDefault(),l({direction:Aa[C.key],factor:C.shiftKey?4:1}))};return O.jsx("div",{className:rt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:y},children:O.jsx("div",{ref:_,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:h,height:S}})})}const Wp=typeof window<"u"?window:void 0,Ix=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Pg({children:e,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:h,onPaneContextMenu:S,onPaneScroll:y,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:_,selectionOnDrag:v,selectionMode:c,onSelectionStart:m,onSelectionEnd:C,multiSelectionKeyCode:b,panActivationKeyCode:x,zoomActivationKeyCode:f,elementsSelectable:p,zoomOnScroll:d,zoomOnPinch:u,panOnScroll:w,panOnScrollSpeed:L,panOnScrollMode:R,zoomOnDoubleClick:D,panOnDrag:k,defaultViewport:M,translateExtent:W,minZoom:z,maxZoom:j,preventScrolling:N,onSelectionContextMenu:I,noWheelClassName:q,noPanClassName:U,disableKeyboardA11y:K,onViewportChange:V,isControlledViewport:T}){const{nodesSelectionActive:B,userSelectionActive:P}=Te(Ix,Ue),F=Es(_,{target:Wp}),G=Es(x,{target:Wp}),Z=G||k,ie=G||w,ae=v&&Z!==!0,X=F||P||ae;return gx({deleteKeyCode:l,multiSelectionKeyCode:b}),O.jsx(yx,{onPaneContextMenu:S,elementsSelectable:p,zoomOnScroll:d,zoomOnPinch:u,panOnScroll:ie,panOnScrollSpeed:L,panOnScrollMode:R,zoomOnDoubleClick:D,panOnDrag:!F&&Z,defaultViewport:M,translateExtent:W,minZoom:z,maxZoom:j,zoomActivationKeyCode:f,preventScrolling:N,noWheelClassName:q,noPanClassName:U,onViewportChange:V,isControlledViewport:T,paneClickDistance:a,selectionOnDrag:ae,children:O.jsxs(xx,{onSelectionStart:m,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:h,onPaneContextMenu:S,onPaneScroll:y,panOnDrag:Z,isSelecting:!!X,selectionMode:c,selectionKeyPressed:F,paneClickDistance:a,selectionOnDrag:ae,children:[e,B&&O.jsx(Bx,{onSelectionContextMenu:I,noPanClassName:U,disableKeyboardA11y:K})]})})}Pg.displayName="FlowRenderer";const Ox=J.memo(Pg),Hx=e=>r=>e?Ju(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function Fx(e){return Te(J.useCallback(Hx(e),[e]),Ue)}const jx=e=>e.updateNodeInternals;function zx(){const e=Te(jx),[r]=J.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const o=new Map;i.forEach(h=>{const S=h.target.getAttribute("data-id");o.set(S,{id:S,nodeElement:h.target,force:!0})}),e(o)}));return J.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function $x({node:e,nodeType:r,hasDimensions:i,resizeObserver:o}){const h=Ve(),S=J.useRef(null),y=J.useRef(null),a=J.useRef(e.sourcePosition),l=J.useRef(e.targetPosition),_=J.useRef(r),v=i&&!!e.internals.handleBounds;return J.useEffect(()=>{S.current&&!e.hidden&&(!v||y.current!==S.current)&&(y.current&&(o==null||o.unobserve(y.current)),o==null||o.observe(S.current),y.current=S.current)},[v,e.hidden]),J.useEffect(()=>()=>{y.current&&(o==null||o.unobserve(y.current),y.current=null)},[]),J.useEffect(()=>{if(S.current){const c=_.current!==r,m=a.current!==e.sourcePosition,C=l.current!==e.targetPosition;(c||m||C)&&(_.current=r,a.current=e.sourcePosition,l.current=e.targetPosition,h.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:S.current,force:!0}]])))}},[e.id,r,e.sourcePosition,e.targetPosition]),S}function Wx({id:e,onClick:r,onMouseEnter:i,onMouseMove:o,onMouseLeave:h,onContextMenu:S,onDoubleClick:y,nodesDraggable:a,elementsSelectable:l,nodesConnectable:_,nodesFocusable:v,resizeObserver:c,noDragClassName:m,noPanClassName:C,disableKeyboardA11y:b,rfId:x,nodeTypes:f,nodeClickDistance:p,onError:d}){const{node:u,internals:w,isParent:L}=Te(H=>{const re=H.nodeLookup.get(e),te=H.parentLookup.has(e);return{node:re,internals:re.internals,isParent:te}},Ue);let R=u.type||"default",D=(f==null?void 0:f[R])||$p[R];D===void 0&&(d==null||d("003",dr.error003(R)),R="default",D=(f==null?void 0:f.default)||$p.default);const k=!!(u.draggable||a&&typeof u.draggable>"u"),M=!!(u.selectable||l&&typeof u.selectable>"u"),W=!!(u.connectable||_&&typeof u.connectable>"u"),z=!!(u.focusable||v&&typeof u.focusable>"u"),j=Ve(),N=rg(u),I=$x({node:u,nodeType:R,hasDimensions:N,resizeObserver:c}),q=Ag({nodeRef:I,disabled:u.hidden||!k,noDragClassName:m,handleSelector:u.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:p}),U=Tg();if(u.hidden)return null;const K=Lr(u),V=Px(u),T=M||k||r||i||o||h,B=i?H=>i(H,{...w.userNode}):void 0,P=o?H=>o(H,{...w.userNode}):void 0,F=h?H=>h(H,{...w.userNode}):void 0,G=S?H=>S(H,{...w.userNode}):void 0,Z=y?H=>y(H,{...w.userNode}):void 0,ie=H=>{const{selectNodesOnDrag:re,nodeDragThreshold:te}=j.getState();M&&(!re||!k||te>0)&&Mu({id:e,store:j,nodeRef:I}),r&&r(H,{...w.userNode})},ae=H=>{if(!(sg(H.nativeEvent)||b)){if(K_.includes(H.key)&&M){const re=H.key==="Escape";Mu({id:e,store:j,unselect:re,nodeRef:I})}else if(k&&u.selected&&Object.prototype.hasOwnProperty.call(Aa,H.key)){H.preventDefault();const{ariaLabelConfig:re}=j.getState();j.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),U({direction:Aa[H.key],factor:H.shiftKey?4:1})}}},X=()=>{var Se;if(b||!((Se=I.current)!=null&&Se.matches(":focus-visible")))return;const{transform:H,width:re,height:te,autoPanOnNodeFocus:ce,setCenter:le}=j.getState();if(!ce)return;Ju(new Map([[e,u]]),{x:0,y:0,width:re,height:te},H,!0).length>0||le(u.position.x+K.width/2,u.position.y+K.height/2,{zoom:H[2]})};return O.jsx("div",{className:rt(["react-flow__node",`react-flow__node-${R}`,{[C]:k},u.className,{selected:u.selected,selectable:M,parent:L,draggable:k,dragging:q}]),ref:I,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:T?"all":"none",visibility:N?"visible":"hidden",...u.style,...V},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:P,onMouseLeave:F,onContextMenu:G,onClick:ie,onDoubleClick:Z,onKeyDown:z?ae:void 0,tabIndex:z?0:void 0,onFocus:z?X:void 0,role:u.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${bg}-${x}`,"aria-label":u.ariaLabel,...u.domAttributes,children:O.jsx(Ex,{value:e,children:O.jsx(D,{id:e,data:u.data,type:R,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:u.selected??!1,selectable:M,draggable:k,deletable:u.deletable??!0,isConnectable:W,sourcePosition:u.sourcePosition,targetPosition:u.targetPosition,dragging:q,dragHandle:u.dragHandle,zIndex:w.z,parentId:u.parentId,...K})})})}var Ux=J.memo(Wx);const Vx=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Ng(e){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:o,elementsSelectable:h,onError:S}=Te(Vx,Ue),y=Fx(e.onlyRenderVisibleElements),a=zx();return O.jsx("div",{className:"react-flow__nodes",style:Va,children:y.map(l=>O.jsx(Ux,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:r,nodesConnectable:i,nodesFocusable:o,elementsSelectable:h,nodeClickDistance:e.nodeClickDistance,onError:S},l))})}Ng.displayName="NodeRenderer";const qx=J.memo(Ng);function Kx(e){return Te(J.useCallback(i=>{if(!e)return i.edges.map(h=>h.id);const o=[];if(i.width&&i.height)for(const h of i.edges){const S=i.nodeLookup.get(h.source),y=i.nodeLookup.get(h.target);S&&y&&US({sourceNode:S,targetNode:y,width:i.width,height:i.height,transform:i.transform})&&o.push(h.id)}return o},[e]),Ue)}const Xx=({color:e="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...e&&{stroke:e}};return O.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Yx=({color:e="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...e&&{stroke:e,fill:e}};return O.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Up={[La.Arrow]:Xx,[La.ArrowClosed]:Yx};function Gx(e){const r=Ve();return J.useMemo(()=>{var h,S;return Object.prototype.hasOwnProperty.call(Up,e)?Up[e]:((S=(h=r.getState()).onError)==null||S.call(h,"009",dr.error009(e)),null)},[e])}const Qx=({id:e,type:r,color:i,width:o=12.5,height:h=12.5,markerUnits:S="strokeWidth",strokeWidth:y,orient:a="auto-start-reverse"})=>{const l=Gx(r);return l?O.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${h}`,viewBox:"-10 -10 20 20",markerUnits:S,orient:a,refX:"0",refY:"0",children:O.jsx(l,{color:i,strokeWidth:y})}):null},Bg=({defaultColor:e,rfId:r})=>{const i=Te(S=>S.edges),o=Te(S=>S.defaultEdgeOptions),h=J.useMemo(()=>JS(i,{id:r,defaultColor:e,defaultMarkerStart:o==null?void 0:o.markerStart,defaultMarkerEnd:o==null?void 0:o.markerEnd}),[i,o,r,e]);return h.length?O.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:O.jsx("defs",{children:h.map(S=>O.jsx(Qx,{id:S.id,type:S.type,color:S.color,width:S.width,height:S.height,markerUnits:S.markerUnits,strokeWidth:S.strokeWidth,orient:S.orient},S.id))})}):null};Bg.displayName="MarkerDefinitions";var Jx=J.memo(Bg);function Ig({x:e,y:r,label:i,labelStyle:o,labelShowBg:h=!0,labelBgStyle:S,labelBgPadding:y=[2,4],labelBgBorderRadius:a=2,children:l,className:_,...v}){const[c,m]=J.useState({x:1,y:0,width:0,height:0}),C=rt(["react-flow__edge-textwrapper",_]),b=J.useRef(null);return J.useEffect(()=>{if(b.current){const x=b.current.getBBox();m({x:x.x,y:x.y,width:x.width,height:x.height})}},[i]),i?O.jsxs("g",{transform:`translate(${e-c.width/2} ${r-c.height/2})`,className:C,visibility:c.width?"visible":"hidden",...v,children:[h&&O.jsx("rect",{width:c.width+2*y[0],x:-y[0],y:-y[1],height:c.height+2*y[1],className:"react-flow__edge-textbg",style:S,rx:a,ry:a}),O.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:b,style:o,children:i}),l]}):null}Ig.displayName="EdgeText";const Zx=J.memo(Ig);function qa({path:e,labelX:r,labelY:i,label:o,labelStyle:h,labelShowBg:S,labelBgStyle:y,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:_=20,...v}){return O.jsxs(O.Fragment,{children:[O.jsx("path",{...v,d:e,fill:"none",className:rt(["react-flow__edge-path",v.className])}),_?O.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:_,className:"react-flow__edge-interaction"}):null,o&&Zt(r)&&Zt(i)?O.jsx(Zx,{x:r,y:i,label:o,labelStyle:h,labelShowBg:S,labelBgStyle:y,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function Vp({pos:e,x1:r,y1:i,x2:o,y2:h}){return e===xe.Left||e===xe.Right?[.5*(r+o),i]:[r,.5*(i+h)]}function Og({sourceX:e,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:h,targetPosition:S=xe.Top}){const[y,a]=Vp({pos:i,x1:e,y1:r,x2:o,y2:h}),[l,_]=Vp({pos:S,x1:o,y1:h,x2:e,y2:r}),[v,c,m,C]=ag({sourceX:e,sourceY:r,targetX:o,targetY:h,sourceControlX:y,sourceControlY:a,targetControlX:l,targetControlY:_});return[`M${e},${r} C${y},${a} ${l},${_} ${o},${h}`,v,c,m,C]}function Hg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:h,targetY:S,sourcePosition:y,targetPosition:a,label:l,labelStyle:_,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,interactionWidth:p})=>{const[d,u,w]=Og({sourceX:i,sourceY:o,sourcePosition:y,targetX:h,targetY:S,targetPosition:a}),L=e.isInternal?void 0:r;return O.jsx(qa,{id:L,path:d,labelX:u,labelY:w,label:l,labelStyle:_,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,interactionWidth:p})})}const e2=Hg({isInternal:!1}),Fg=Hg({isInternal:!0});e2.displayName="SimpleBezierEdge";Fg.displayName="SimpleBezierEdgeInternal";function jg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:h,targetY:S,label:y,labelStyle:a,labelShowBg:l,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:c,style:m,sourcePosition:C=xe.Bottom,targetPosition:b=xe.Top,markerEnd:x,markerStart:f,pathOptions:p,interactionWidth:d})=>{const[u,w,L]=Lu({sourceX:i,sourceY:o,sourcePosition:C,targetX:h,targetY:S,targetPosition:b,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),R=e.isInternal?void 0:r;return O.jsx(qa,{id:R,path:u,labelX:w,labelY:L,label:y,labelStyle:a,labelShowBg:l,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:c,style:m,markerEnd:x,markerStart:f,interactionWidth:d})})}const zg=jg({isInternal:!1}),$g=jg({isInternal:!0});zg.displayName="SmoothStepEdge";$g.displayName="SmoothStepEdgeInternal";function Wg(e){return J.memo(({id:r,...i})=>{var h;const o=e.isInternal?void 0:r;return O.jsx(zg,{...i,id:o,pathOptions:J.useMemo(()=>{var S;return{borderRadius:0,offset:(S=i.pathOptions)==null?void 0:S.offset}},[(h=i.pathOptions)==null?void 0:h.offset])})})}const t2=Wg({isInternal:!1}),Ug=Wg({isInternal:!0});t2.displayName="StepEdge";Ug.displayName="StepEdgeInternal";function Vg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:h,targetY:S,label:y,labelStyle:a,labelShowBg:l,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:c,style:m,markerEnd:C,markerStart:b,interactionWidth:x})=>{const[f,p,d]=ug({sourceX:i,sourceY:o,targetX:h,targetY:S}),u=e.isInternal?void 0:r;return O.jsx(qa,{id:u,path:f,labelX:p,labelY:d,label:y,labelStyle:a,labelShowBg:l,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:c,style:m,markerEnd:C,markerStart:b,interactionWidth:x})})}const r2=Vg({isInternal:!1}),qg=Vg({isInternal:!0});r2.displayName="StraightEdge";qg.displayName="StraightEdgeInternal";function Kg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:h,targetY:S,sourcePosition:y=xe.Bottom,targetPosition:a=xe.Top,label:l,labelStyle:_,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,pathOptions:p,interactionWidth:d})=>{const[u,w,L]=lg({sourceX:i,sourceY:o,sourcePosition:y,targetX:h,targetY:S,targetPosition:a,curvature:p==null?void 0:p.curvature}),R=e.isInternal?void 0:r;return O.jsx(qa,{id:R,path:u,labelX:w,labelY:L,label:l,labelStyle:_,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,interactionWidth:d})})}const n2=Kg({isInternal:!1}),Xg=Kg({isInternal:!0});n2.displayName="BezierEdge";Xg.displayName="BezierEdgeInternal";const qp={default:Xg,straight:qg,step:Ug,smoothstep:$g,simplebezier:Fg},Kp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},i2=(e,r,i)=>i===xe.Left?e-r:i===xe.Right?e+r:e,s2=(e,r,i)=>i===xe.Top?e-r:i===xe.Bottom?e+r:e,Xp="react-flow__edgeupdater";function Yp({position:e,centerX:r,centerY:i,radius:o=10,onMouseDown:h,onMouseEnter:S,onMouseOut:y,type:a}){return O.jsx("circle",{onMouseDown:h,onMouseEnter:S,onMouseOut:y,className:rt([Xp,`${Xp}-${a}`]),cx:i2(r,o,e),cy:s2(i,o,e),r:o,stroke:"transparent",fill:"transparent"})}function o2({isReconnectable:e,reconnectRadius:r,edge:i,sourceX:o,sourceY:h,targetX:S,targetY:y,sourcePosition:a,targetPosition:l,onReconnect:_,onReconnectStart:v,onReconnectEnd:c,setReconnecting:m,setUpdateHover:C}){const b=Ve(),x=(w,L)=>{if(w.button!==0)return;const{autoPanOnConnect:R,domNode:D,connectionMode:k,connectionRadius:M,lib:W,onConnectStart:z,cancelConnection:j,nodeLookup:N,rfId:I,panBy:q,updateConnection:U}=b.getState(),K=L.type==="target",V=(P,F)=>{m(!1),c==null||c(P,i,L.type,F)},T=P=>_==null?void 0:_(i,P),B=(P,F)=>{m(!0),v==null||v(w,i,L.type),z==null||z(P,F)};Au.onPointerDown(w.nativeEvent,{autoPanOnConnect:R,connectionMode:k,connectionRadius:M,domNode:D,handleId:L.id,nodeId:L.nodeId,nodeLookup:N,isTarget:K,edgeUpdaterType:L.type,lib:W,flowId:I,cancelConnection:j,panBy:q,isValidConnection:(...P)=>{var F,G;return((G=(F=b.getState()).isValidConnection)==null?void 0:G.call(F,...P))??!0},onConnect:T,onConnectStart:B,onConnectEnd:(...P)=>{var F,G;return(G=(F=b.getState()).onConnectEnd)==null?void 0:G.call(F,...P)},onReconnectEnd:V,updateConnection:U,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},f=w=>x(w,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),p=w=>x(w,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),d=()=>C(!0),u=()=>C(!1);return O.jsxs(O.Fragment,{children:[(e===!0||e==="source")&&O.jsx(Yp,{position:a,centerX:o,centerY:h,radius:r,onMouseDown:f,onMouseEnter:d,onMouseOut:u,type:"source"}),(e===!0||e==="target")&&O.jsx(Yp,{position:l,centerX:S,centerY:y,radius:r,onMouseDown:p,onMouseEnter:d,onMouseOut:u,type:"target"})]})}function a2({id:e,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:o,onClick:h,onDoubleClick:S,onContextMenu:y,onMouseEnter:a,onMouseMove:l,onMouseLeave:_,reconnectRadius:v,onReconnect:c,onReconnectStart:m,onReconnectEnd:C,rfId:b,edgeTypes:x,noPanClassName:f,onError:p,disableKeyboardA11y:d}){let u=Te(le=>le.edgeLookup.get(e));const w=Te(le=>le.defaultEdgeOptions);u=w?{...w,...u}:u;let L=u.type||"default",R=(x==null?void 0:x[L])||qp[L];R===void 0&&(p==null||p("011",dr.error011(L)),L="default",R=(x==null?void 0:x.default)||qp.default);const D=!!(u.focusable||r&&typeof u.focusable>"u"),k=typeof c<"u"&&(u.reconnectable||i&&typeof u.reconnectable>"u"),M=!!(u.selectable||o&&typeof u.selectable>"u"),W=J.useRef(null),[z,j]=J.useState(!1),[N,I]=J.useState(!1),q=Ve(),{zIndex:U,sourceX:K,sourceY:V,targetX:T,targetY:B,sourcePosition:P,targetPosition:F}=Te(J.useCallback(le=>{const pe=le.nodeLookup.get(u.source),Se=le.nodeLookup.get(u.target);if(!pe||!Se)return{zIndex:u.zIndex,...Kp};const be=QS({id:e,sourceNode:pe,targetNode:Se,sourceHandle:u.sourceHandle||null,targetHandle:u.targetHandle||null,connectionMode:le.connectionMode,onError:p});return{zIndex:WS({selected:u.selected,zIndex:u.zIndex,sourceNode:pe,targetNode:Se,elevateOnSelect:le.elevateEdgesOnSelect,zIndexMode:le.zIndexMode}),...be||Kp}},[u.source,u.target,u.sourceHandle,u.targetHandle,u.selected,u.zIndex]),Ue),G=J.useMemo(()=>u.markerStart?`url('#${Ru(u.markerStart,b)}')`:void 0,[u.markerStart,b]),Z=J.useMemo(()=>u.markerEnd?`url('#${Ru(u.markerEnd,b)}')`:void 0,[u.markerEnd,b]);if(u.hidden||K===null||V===null||T===null||B===null)return null;const ie=le=>{var ue;const{addSelectedEdges:pe,unselectNodesAndEdges:Se,multiSelectionActive:be}=q.getState();M&&(q.setState({nodesSelectionActive:!1}),u.selected&&be?(Se({nodes:[],edges:[u]}),(ue=W.current)==null||ue.blur()):pe([e])),h&&h(le,u)},ae=S?le=>{S(le,{...u})}:void 0,X=y?le=>{y(le,{...u})}:void 0,H=a?le=>{a(le,{...u})}:void 0,re=l?le=>{l(le,{...u})}:void 0,te=_?le=>{_(le,{...u})}:void 0,ce=le=>{var pe;if(!d&&K_.includes(le.key)&&M){const{unselectNodesAndEdges:Se,addSelectedEdges:be}=q.getState();le.key==="Escape"?((pe=W.current)==null||pe.blur(),Se({edges:[u]})):be([e])}};return O.jsx("svg",{style:{zIndex:U},children:O.jsxs("g",{className:rt(["react-flow__edge",`react-flow__edge-${L}`,u.className,f,{selected:u.selected,animated:u.animated,inactive:!M&&!h,updating:z,selectable:M}]),onClick:ie,onDoubleClick:ae,onContextMenu:X,onMouseEnter:H,onMouseMove:re,onMouseLeave:te,onKeyDown:D?ce:void 0,tabIndex:D?0:void 0,role:u.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":u.ariaLabel===null?void 0:u.ariaLabel||`Edge from ${u.source} to ${u.target}`,"aria-describedby":D?`${Eg}-${b}`:void 0,ref:W,...u.domAttributes,children:[!N&&O.jsx(R,{id:e,source:u.source,target:u.target,type:u.type,selected:u.selected,animated:u.animated,selectable:M,deletable:u.deletable??!0,label:u.label,labelStyle:u.labelStyle,labelShowBg:u.labelShowBg,labelBgStyle:u.labelBgStyle,labelBgPadding:u.labelBgPadding,labelBgBorderRadius:u.labelBgBorderRadius,sourceX:K,sourceY:V,targetX:T,targetY:B,sourcePosition:P,targetPosition:F,data:u.data,style:u.style,sourceHandleId:u.sourceHandle,targetHandleId:u.targetHandle,markerStart:G,markerEnd:Z,pathOptions:"pathOptions"in u?u.pathOptions:void 0,interactionWidth:u.interactionWidth}),k&&O.jsx(o2,{edge:u,isReconnectable:k,reconnectRadius:v,onReconnect:c,onReconnectStart:m,onReconnectEnd:C,sourceX:K,sourceY:V,targetX:T,targetY:B,sourcePosition:P,targetPosition:F,setUpdateHover:j,setReconnecting:I})]})})}var l2=J.memo(a2);const c2=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Yg({defaultMarkerColor:e,onlyRenderVisibleElements:r,rfId:i,edgeTypes:o,noPanClassName:h,onReconnect:S,onEdgeContextMenu:y,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:_,onEdgeClick:v,reconnectRadius:c,onEdgeDoubleClick:m,onReconnectStart:C,onReconnectEnd:b,disableKeyboardA11y:x}){const{edgesFocusable:f,edgesReconnectable:p,elementsSelectable:d,onError:u}=Te(c2,Ue),w=Kx(r);return O.jsxs("div",{className:"react-flow__edges",children:[O.jsx(Jx,{defaultColor:e,rfId:i}),w.map(L=>O.jsx(l2,{id:L,edgesFocusable:f,edgesReconnectable:p,elementsSelectable:d,noPanClassName:h,onReconnect:S,onContextMenu:y,onMouseEnter:a,onMouseMove:l,onMouseLeave:_,onClick:v,reconnectRadius:c,onDoubleClick:m,onReconnectStart:C,onReconnectEnd:b,rfId:i,onError:u,edgeTypes:o,disableKeyboardA11y:x},L))]})}Yg.displayName="EdgeRenderer";const u2=J.memo(Yg),h2=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function d2({children:e}){const r=Te(h2);return O.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:e})}function f2(e){const r=oh(),i=J.useRef(!1);J.useEffect(()=>{!i.current&&r.viewportInitialized&&e&&(setTimeout(()=>e(r),1),i.current=!0)},[e,r.viewportInitialized])}const p2=e=>{var r;return(r=e.panZoom)==null?void 0:r.syncViewport};function _2(e){const r=Te(p2),i=Ve();return J.useEffect(()=>{e&&(r==null||r(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,r]),null}function g2(e){return e.connection.inProgress?{...e.connection,to:Ms(e.connection.to,e.transform)}:{...e.connection}}function m2(e){return g2}function v2(e){const r=m2();return Te(r,Ue)}const y2=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function w2({containerStyle:e,style:r,type:i,component:o}){const{nodesConnectable:h,width:S,height:y,isValid:a,inProgress:l}=Te(y2,Ue);return!(S&&h&&l)?null:O.jsx("svg",{style:e,width:S,height:y,className:"react-flow__connectionline react-flow__container",children:O.jsx("g",{className:rt(["react-flow__connection",G_(a)]),children:O.jsx(Gg,{style:r,type:i,CustomComponent:o,isValid:a})})})}const Gg=({style:e,type:r=Zr.Bezier,CustomComponent:i,isValid:o})=>{const{inProgress:h,from:S,fromNode:y,fromHandle:a,fromPosition:l,to:_,toNode:v,toHandle:c,toPosition:m,pointer:C}=v2();if(!h)return;if(i)return O.jsx(i,{connectionLineType:r,connectionLineStyle:e,fromNode:y,fromHandle:a,fromX:S.x,fromY:S.y,toX:_.x,toY:_.y,fromPosition:l,toPosition:m,connectionStatus:G_(o),toNode:v,toHandle:c,pointer:C});let b="";const x={sourceX:S.x,sourceY:S.y,sourcePosition:l,targetX:_.x,targetY:_.y,targetPosition:m};switch(r){case Zr.Bezier:[b]=lg(x);break;case Zr.SimpleBezier:[b]=Og(x);break;case Zr.Step:[b]=Lu({...x,borderRadius:0});break;case Zr.SmoothStep:[b]=Lu(x);break;default:[b]=ug(x)}return O.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};Gg.displayName="ConnectionLine";const S2={};function Gp(e=S2){J.useRef(e),Ve(),J.useEffect(()=>{},[e])}function C2(){Ve(),J.useRef(!1),J.useEffect(()=>{},[])}function Qg({nodeTypes:e,edgeTypes:r,onInit:i,onNodeClick:o,onEdgeClick:h,onNodeDoubleClick:S,onEdgeDoubleClick:y,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:_,onNodeContextMenu:v,onSelectionContextMenu:c,onSelectionStart:m,onSelectionEnd:C,connectionLineType:b,connectionLineStyle:x,connectionLineComponent:f,connectionLineContainerStyle:p,selectionKeyCode:d,selectionOnDrag:u,selectionMode:w,multiSelectionKeyCode:L,panActivationKeyCode:R,zoomActivationKeyCode:D,deleteKeyCode:k,onlyRenderVisibleElements:M,elementsSelectable:W,defaultViewport:z,translateExtent:j,minZoom:N,maxZoom:I,preventScrolling:q,defaultMarkerColor:U,zoomOnScroll:K,zoomOnPinch:V,panOnScroll:T,panOnScrollSpeed:B,panOnScrollMode:P,zoomOnDoubleClick:F,panOnDrag:G,onPaneClick:Z,onPaneMouseEnter:ie,onPaneMouseMove:ae,onPaneMouseLeave:X,onPaneScroll:H,onPaneContextMenu:re,paneClickDistance:te,nodeClickDistance:ce,onEdgeContextMenu:le,onEdgeMouseEnter:pe,onEdgeMouseMove:Se,onEdgeMouseLeave:be,reconnectRadius:ue,onReconnect:ge,onReconnectStart:Re,onReconnectEnd:Ie,noDragClassName:ze,noWheelClassName:Qe,noPanClassName:ut,disableKeyboardA11y:qe,nodeExtent:pt,rfId:Ne,viewport:Je,onViewportChange:ht}){return Gp(e),Gp(r),C2(),f2(i),_2(Je),O.jsx(Ox,{onPaneClick:Z,onPaneMouseEnter:ie,onPaneMouseMove:ae,onPaneMouseLeave:X,onPaneContextMenu:re,onPaneScroll:H,paneClickDistance:te,deleteKeyCode:k,selectionKeyCode:d,selectionOnDrag:u,selectionMode:w,onSelectionStart:m,onSelectionEnd:C,multiSelectionKeyCode:L,panActivationKeyCode:R,zoomActivationKeyCode:D,elementsSelectable:W,zoomOnScroll:K,zoomOnPinch:V,zoomOnDoubleClick:F,panOnScroll:T,panOnScrollSpeed:B,panOnScrollMode:P,panOnDrag:G,defaultViewport:z,translateExtent:j,minZoom:N,maxZoom:I,onSelectionContextMenu:c,preventScrolling:q,noDragClassName:ze,noWheelClassName:Qe,noPanClassName:ut,disableKeyboardA11y:qe,onViewportChange:ht,isControlledViewport:!!Je,children:O.jsxs(d2,{children:[O.jsx(u2,{edgeTypes:r,onEdgeClick:h,onEdgeDoubleClick:y,onReconnect:ge,onReconnectStart:Re,onReconnectEnd:Ie,onlyRenderVisibleElements:M,onEdgeContextMenu:le,onEdgeMouseEnter:pe,onEdgeMouseMove:Se,onEdgeMouseLeave:be,reconnectRadius:ue,defaultMarkerColor:U,noPanClassName:ut,disableKeyboardA11y:qe,rfId:Ne}),O.jsx(w2,{style:x,type:b,component:f,containerStyle:p}),O.jsx("div",{className:"react-flow__edgelabel-renderer"}),O.jsx(qx,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:S,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:_,onNodeContextMenu:v,nodeClickDistance:ce,onlyRenderVisibleElements:M,noPanClassName:ut,noDragClassName:ze,disableKeyboardA11y:qe,nodeExtent:pt,rfId:Ne}),O.jsx("div",{className:"react-flow__viewport-portal"})]})})}Qg.displayName="GraphView";const x2=J.memo(Qg),Qp=({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:h,height:S,fitView:y,fitViewOptions:a,minZoom:l=.5,maxZoom:_=2,nodeOrigin:v,nodeExtent:c,zIndexMode:m="basic"}={})=>{const C=new Map,b=new Map,x=new Map,f=new Map,p=o??r??[],d=i??e??[],u=v??[0,0],w=c??Ss;fg(x,f,p);const{nodesInitialized:L}=Du(d,C,b,{nodeOrigin:u,nodeExtent:w,zIndexMode:m});let R=[0,0,1];if(y&&h&&S){const D=As(C,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:k,y:M,zoom:W}=Zu(D,h,S,l,_,(a==null?void 0:a.padding)??.1);R=[k,M,W]}return{rfId:"1",width:h??0,height:S??0,transform:R,nodes:d,nodesInitialized:L,nodeLookup:C,parentLookup:b,edges:p,edgeLookup:f,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:l,maxZoom:_,translateExtent:Ss,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:hi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:u,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:y??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Y_},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:OS,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:X_,zIndexMode:m,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},b2=({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:h,height:S,fitView:y,fitViewOptions:a,minZoom:l,maxZoom:_,nodeOrigin:v,nodeExtent:c,zIndexMode:m})=>zC((C,b)=>{async function x(){const{nodeLookup:f,panZoom:p,fitViewOptions:d,fitViewResolver:u,width:w,height:L,minZoom:R,maxZoom:D}=b();p&&(await BS({nodes:f,width:w,height:L,panZoom:p,minZoom:R,maxZoom:D},d),u==null||u.resolve(!0),C({fitViewResolver:null}))}return{...Qp({nodes:e,edges:r,width:h,height:S,fitView:y,fitViewOptions:a,minZoom:l,maxZoom:_,nodeOrigin:v,nodeExtent:c,defaultNodes:i,defaultEdges:o,zIndexMode:m}),setNodes:f=>{const{nodeLookup:p,parentLookup:d,nodeOrigin:u,elevateNodesOnSelect:w,fitViewQueued:L,zIndexMode:R,nodesSelectionActive:D}=b(),{nodesInitialized:k,hasSelectedNodes:M}=Du(f,p,d,{nodeOrigin:u,nodeExtent:c,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:R}),W=D&&M;L&&k?(x(),C({nodes:f,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:W})):C({nodes:f,nodesInitialized:k,nodesSelectionActive:W})},setEdges:f=>{const{connectionLookup:p,edgeLookup:d}=b();fg(p,d,f),C({edges:f})},setDefaultNodesAndEdges:(f,p)=>{if(f){const{setNodes:d}=b();d(f),C({hasDefaultNodes:!0})}if(p){const{setEdges:d}=b();d(p),C({hasDefaultEdges:!0})}},updateNodeInternals:f=>{const{triggerNodeChanges:p,nodeLookup:d,parentLookup:u,domNode:w,nodeOrigin:L,nodeExtent:R,debug:D,fitViewQueued:k,zIndexMode:M}=b(),{changes:W,updatedInternals:z}=sC(f,d,u,w,L,R,M);z&&(tC(d,u,{nodeOrigin:L,nodeExtent:R,zIndexMode:M}),k?(x(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(W==null?void 0:W.length)>0&&(D&&console.log("React Flow: trigger node changes",W),p==null||p(W)))},updateNodePositions:(f,p=!1)=>{const d=[];let u=[];const{nodeLookup:w,triggerNodeChanges:L,connection:R,updateConnection:D,onNodesChangeMiddlewareMap:k}=b();for(const[M,W]of f){const z=w.get(M),j=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(W!=null&&W.position)),N={id:M,type:"position",position:j?{x:Math.max(0,W.position.x),y:Math.max(0,W.position.y)}:W.position,dragging:p};if(z&&R.inProgress&&R.fromNode.id===z.id){const I=Ln(z,R.fromHandle,xe.Left,!0);D({...R,from:I})}j&&z.parentId&&d.push({id:M,parentId:z.parentId,rect:{...W.internals.positionAbsolute,width:W.measured.width??0,height:W.measured.height??0}}),u.push(N)}if(d.length>0){const{parentLookup:M,nodeOrigin:W}=b(),z=sh(d,w,M,W);u.push(...z)}for(const M of k.values())u=M(u);L(u)},triggerNodeChanges:f=>{const{onNodesChange:p,setNodes:d,nodes:u,hasDefaultNodes:w,debug:L}=b();if(f!=null&&f.length){if(w){const R=lx(f,u);d(R)}L&&console.log("React Flow: trigger node changes",f),p==null||p(f)}},triggerEdgeChanges:f=>{const{onEdgesChange:p,setEdges:d,edges:u,hasDefaultEdges:w,debug:L}=b();if(f!=null&&f.length){if(w){const R=cx(f,u);d(R)}L&&console.log("React Flow: trigger edge changes",f),p==null||p(f)}},addSelectedNodes:f=>{const{multiSelectionActive:p,edgeLookup:d,nodeLookup:u,triggerNodeChanges:w,triggerEdgeChanges:L}=b();if(p){const R=f.map(D=>wn(D,!0));w(R);return}w(oi(u,new Set([...f]),!0)),L(oi(d))},addSelectedEdges:f=>{const{multiSelectionActive:p,edgeLookup:d,nodeLookup:u,triggerNodeChanges:w,triggerEdgeChanges:L}=b();if(p){const R=f.map(D=>wn(D,!0));L(R);return}L(oi(d,new Set([...f]))),w(oi(u,new Set,!0))},unselectNodesAndEdges:({nodes:f,edges:p}={})=>{const{edges:d,nodes:u,nodeLookup:w,triggerNodeChanges:L,triggerEdgeChanges:R}=b(),D=f||u,k=p||d,M=[];for(const z of D){if(!z.selected)continue;const j=w.get(z.id);j&&(j.selected=!1),M.push(wn(z.id,!1))}const W=[];for(const z of k)z.selected&&W.push(wn(z.id,!1));L(M),R(W)},setMinZoom:f=>{const{panZoom:p,maxZoom:d}=b();p==null||p.setScaleExtent([f,d]),C({minZoom:f})},setMaxZoom:f=>{const{panZoom:p,minZoom:d}=b();p==null||p.setScaleExtent([d,f]),C({maxZoom:f})},setTranslateExtent:f=>{var p;(p=b().panZoom)==null||p.setTranslateExtent(f),C({translateExtent:f})},resetSelectedElements:()=>{const{edges:f,nodes:p,triggerNodeChanges:d,triggerEdgeChanges:u,elementsSelectable:w}=b();if(!w)return;const L=p.reduce((D,k)=>k.selected?[...D,wn(k.id,!1)]:D,[]),R=f.reduce((D,k)=>k.selected?[...D,wn(k.id,!1)]:D,[]);d(L),u(R)},setNodeExtent:f=>{const{nodes:p,nodeLookup:d,parentLookup:u,nodeOrigin:w,elevateNodesOnSelect:L,nodeExtent:R,zIndexMode:D}=b();f[0][0]===R[0][0]&&f[0][1]===R[0][1]&&f[1][0]===R[1][0]&&f[1][1]===R[1][1]||(Du(p,d,u,{nodeOrigin:w,nodeExtent:f,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:D}),C({nodeExtent:f}))},panBy:f=>{const{transform:p,width:d,height:u,panZoom:w,translateExtent:L}=b();return oC({delta:f,panZoom:w,transform:p,translateExtent:L,width:d,height:u})},setCenter:async(f,p,d)=>{const{width:u,height:w,maxZoom:L,panZoom:R}=b();if(!R)return Promise.resolve(!1);const D=typeof(d==null?void 0:d.zoom)<"u"?d.zoom:L;return await R.setViewport({x:u/2-f*D,y:w/2-p*D,zoom:D},{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...Y_}})},updateConnection:f=>{C({connection:f})},reset:()=>C({...Qp()})}},Object.is);function E2({initialNodes:e,initialEdges:r,defaultNodes:i,defaultEdges:o,initialWidth:h,initialHeight:S,initialMinZoom:y,initialMaxZoom:a,initialFitViewOptions:l,fitView:_,nodeOrigin:v,nodeExtent:c,zIndexMode:m,children:C}){const[b]=J.useState(()=>b2({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:h,height:S,fitView:_,minZoom:y,maxZoom:a,fitViewOptions:l,nodeOrigin:v,nodeExtent:c,zIndexMode:m}));return O.jsx($C,{value:b,children:O.jsx(dx,{children:C})})}function k2({children:e,nodes:r,edges:i,defaultNodes:o,defaultEdges:h,width:S,height:y,fitView:a,fitViewOptions:l,minZoom:_,maxZoom:v,nodeOrigin:c,nodeExtent:m,zIndexMode:C}){return J.useContext(Wa)?O.jsx(O.Fragment,{children:e}):O.jsx(E2,{initialNodes:r,initialEdges:i,defaultNodes:o,defaultEdges:h,initialWidth:S,initialHeight:y,fitView:a,initialFitViewOptions:l,initialMinZoom:_,initialMaxZoom:v,nodeOrigin:c,nodeExtent:m,zIndexMode:C,children:e})}const L2={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function R2({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,className:h,nodeTypes:S,edgeTypes:y,onNodeClick:a,onEdgeClick:l,onInit:_,onMove:v,onMoveStart:c,onMoveEnd:m,onConnect:C,onConnectStart:b,onConnectEnd:x,onClickConnectStart:f,onClickConnectEnd:p,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:R,onNodeDragStart:D,onNodeDrag:k,onNodeDragStop:M,onNodesDelete:W,onEdgesDelete:z,onDelete:j,onSelectionChange:N,onSelectionDragStart:I,onSelectionDrag:q,onSelectionDragStop:U,onSelectionContextMenu:K,onSelectionStart:V,onSelectionEnd:T,onBeforeDelete:B,connectionMode:P,connectionLineType:F=Zr.Bezier,connectionLineStyle:G,connectionLineComponent:Z,connectionLineContainerStyle:ie,deleteKeyCode:ae="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:H=!1,selectionMode:re=Cs.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:ce=bs()?"Meta":"Control",zoomActivationKeyCode:le=bs()?"Meta":"Control",snapToGrid:pe,snapGrid:Se,onlyRenderVisibleElements:be=!1,selectNodesOnDrag:ue,nodesDraggable:ge,autoPanOnNodeFocus:Re,nodesConnectable:Ie,nodesFocusable:ze,nodeOrigin:Qe=kg,edgesFocusable:ut,edgesReconnectable:qe,elementsSelectable:pt=!0,defaultViewport:Ne=tx,minZoom:Je=.5,maxZoom:ht=2,translateExtent:$e=Ss,preventScrolling:pr=!0,nodeExtent:ot,defaultMarkerColor:Rt="#b1b1b7",zoomOnScroll:Oe=!0,zoomOnPinch:Rn=!0,panOnScroll:Ps=!1,panOnScrollSpeed:Ka=.5,panOnScrollMode:vi=xn.Free,zoomOnDoubleClick:yi=!0,panOnDrag:wi=!0,onPaneClick:Si,onPaneMouseEnter:Ci,onPaneMouseMove:Rr,onPaneMouseLeave:Dr,onPaneScroll:Ns,onPaneContextMenu:Bs,paneClickDistance:Is=1,nodeClickDistance:Os=0,children:Hs,onReconnect:xi,onReconnectStart:Fs,onReconnectEnd:rn,onEdgeContextMenu:bi,onEdgeDoubleClick:nn,onEdgeMouseEnter:Xa,onEdgeMouseMove:sn,onEdgeMouseLeave:Dn,reconnectRadius:An=10,onNodesChange:Ei,onEdgesChange:Ya,noDragClassName:Ga="nodrag",noWheelClassName:Qa="nowheel",noPanClassName:rr="nopan",fitView:ki,fitViewOptions:Li,connectOnClick:Ja,attributionPosition:js,proOptions:zs,defaultEdgeOptions:$s,elevateNodesOnSelect:Ws=!0,elevateEdgesOnSelect:Za=!1,disableKeyboardA11y:Us=!1,autoPanOnConnect:Ke,autoPanOnNodeDrag:el,autoPanSpeed:Ri,connectionRadius:Vs,isValidConnection:Tn,onError:tl,style:qs,id:on,nodeDragThreshold:It,connectionDragThreshold:rl,viewport:Dt,onViewportChange:nl,width:il,height:sl,colorMode:Mn="light",debug:Pn,onScroll:nr,ariaLabelConfig:Nn,zIndexMode:Ks="basic",...ol},Di){const Bn=on||"1",Ai=sx(Mn),an=J.useCallback(Xs=>{Xs.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),nr==null||nr(Xs)},[nr]);return O.jsx("div",{"data-testid":"rf__wrapper",...ol,onScroll:an,style:{...qs,...L2},ref:Di,className:rt(["react-flow",h,Ai]),id:on,role:"application",children:O.jsxs(k2,{nodes:e,edges:r,width:il,height:sl,fitView:ki,fitViewOptions:Li,minZoom:Je,maxZoom:ht,nodeOrigin:Qe,nodeExtent:ot,zIndexMode:Ks,children:[O.jsx(ix,{nodes:e,edges:r,defaultNodes:i,defaultEdges:o,onConnect:C,onConnectStart:b,onConnectEnd:x,onClickConnectStart:f,onClickConnectEnd:p,nodesDraggable:ge,autoPanOnNodeFocus:Re,nodesConnectable:Ie,nodesFocusable:ze,edgesFocusable:ut,edgesReconnectable:qe,elementsSelectable:pt,elevateNodesOnSelect:Ws,elevateEdgesOnSelect:Za,minZoom:Je,maxZoom:ht,nodeExtent:ot,onNodesChange:Ei,onEdgesChange:Ya,snapToGrid:pe,snapGrid:Se,connectionMode:P,translateExtent:$e,connectOnClick:Ja,defaultEdgeOptions:$s,fitView:ki,fitViewOptions:Li,onNodesDelete:W,onEdgesDelete:z,onDelete:j,onNodeDragStart:D,onNodeDrag:k,onNodeDragStop:M,onSelectionDrag:q,onSelectionDragStart:I,onSelectionDragStop:U,onMove:v,onMoveStart:c,onMoveEnd:m,noPanClassName:rr,nodeOrigin:Qe,rfId:Bn,autoPanOnConnect:Ke,autoPanOnNodeDrag:el,autoPanSpeed:Ri,onError:tl,connectionRadius:Vs,isValidConnection:Tn,selectNodesOnDrag:ue,nodeDragThreshold:It,connectionDragThreshold:rl,onBeforeDelete:B,debug:Pn,ariaLabelConfig:Nn,zIndexMode:Ks}),O.jsx(x2,{onInit:_,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:R,nodeTypes:S,edgeTypes:y,connectionLineType:F,connectionLineStyle:G,connectionLineComponent:Z,connectionLineContainerStyle:ie,selectionKeyCode:X,selectionOnDrag:H,selectionMode:re,deleteKeyCode:ae,multiSelectionKeyCode:ce,panActivationKeyCode:te,zoomActivationKeyCode:le,onlyRenderVisibleElements:be,defaultViewport:Ne,translateExtent:$e,minZoom:Je,maxZoom:ht,preventScrolling:pr,zoomOnScroll:Oe,zoomOnPinch:Rn,zoomOnDoubleClick:yi,panOnScroll:Ps,panOnScrollSpeed:Ka,panOnScrollMode:vi,panOnDrag:wi,onPaneClick:Si,onPaneMouseEnter:Ci,onPaneMouseMove:Rr,onPaneMouseLeave:Dr,onPaneScroll:Ns,onPaneContextMenu:Bs,paneClickDistance:Is,nodeClickDistance:Os,onSelectionContextMenu:K,onSelectionStart:V,onSelectionEnd:T,onReconnect:xi,onReconnectStart:Fs,onReconnectEnd:rn,onEdgeContextMenu:bi,onEdgeDoubleClick:nn,onEdgeMouseEnter:Xa,onEdgeMouseMove:sn,onEdgeMouseLeave:Dn,reconnectRadius:An,defaultMarkerColor:Rt,noDragClassName:Ga,noWheelClassName:Qa,noPanClassName:rr,rfId:Bn,disableKeyboardA11y:Us,nodeExtent:ot,viewport:Dt,onViewportChange:nl}),O.jsx(ex,{onSelectionChange:N}),Hs,O.jsx(YC,{proOptions:zs,position:js}),O.jsx(XC,{rfId:Bn,disableKeyboardA11y:Us})]})})}var D2=Rg(R2);function A2({dimensions:e,lineWidth:r,variant:i,className:o}){return O.jsx("path",{strokeWidth:r,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rt(["react-flow__background-pattern",i,o])})}function T2({radius:e,className:r}){return O.jsx("circle",{cx:e,cy:e,r:e,className:rt(["react-flow__background-pattern","dots",r])})}var tn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(tn||(tn={}));const M2={[tn.Dots]:1,[tn.Lines]:1,[tn.Cross]:6},P2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Jg({id:e,variant:r=tn.Dots,gap:i=20,size:o,lineWidth:h=1,offset:S=0,color:y,bgColor:a,style:l,className:_,patternClassName:v}){const c=J.useRef(null),{transform:m,patternId:C}=Te(P2,Ue),b=o||M2[r],x=r===tn.Dots,f=r===tn.Cross,p=Array.isArray(i)?i:[i,i],d=[p[0]*m[2]||1,p[1]*m[2]||1],u=b*m[2],w=Array.isArray(S)?S:[S,S],L=f?[u,u]:d,R=[w[0]*m[2]||1+L[0]/2,w[1]*m[2]||1+L[1]/2],D=`${C}${e||""}`;return O.jsxs("svg",{className:rt(["react-flow__background",_]),style:{...l,...Va,"--xy-background-color-props":a,"--xy-background-pattern-color-props":y},ref:c,"data-testid":"rf__background",children:[O.jsx("pattern",{id:D,x:m[0]%d[0],y:m[1]%d[1],width:d[0],height:d[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:x?O.jsx(T2,{radius:u/2,className:v}):O.jsx(A2,{dimensions:L,lineWidth:h,variant:r,className:v})}),O.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}Jg.displayName="Background";const N2=J.memo(Jg);function B2(){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:O.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function I2(){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:O.jsx("path",{d:"M0 0h32v4.2H0z"})})}function O2(){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:O.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 H2(){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:O.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 F2(){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:O.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 aa({children:e,className:r,...i}){return O.jsx("button",{type:"button",className:rt(["react-flow__controls-button",r]),...i,children:e})}const j2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Zg({style:e,showZoom:r=!0,showFitView:i=!0,showInteractive:o=!0,fitViewOptions:h,onZoomIn:S,onZoomOut:y,onFitView:a,onInteractiveChange:l,className:_,children:v,position:c="bottom-left",orientation:m="vertical","aria-label":C}){const b=Ve(),{isInteractive:x,minZoomReached:f,maxZoomReached:p,ariaLabelConfig:d}=Te(j2,Ue),{zoomIn:u,zoomOut:w,fitView:L}=oh(),R=()=>{u(),S==null||S()},D=()=>{w(),y==null||y()},k=()=>{L(h),a==null||a()},M=()=>{b.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),l==null||l(!x)},W=m==="horizontal"?"horizontal":"vertical";return O.jsxs(Ua,{className:rt(["react-flow__controls",W,_]),position:c,style:e,"data-testid":"rf__controls","aria-label":C??d["controls.ariaLabel"],children:[r&&O.jsxs(O.Fragment,{children:[O.jsx(aa,{onClick:R,className:"react-flow__controls-zoomin",title:d["controls.zoomIn.ariaLabel"],"aria-label":d["controls.zoomIn.ariaLabel"],disabled:p,children:O.jsx(B2,{})}),O.jsx(aa,{onClick:D,className:"react-flow__controls-zoomout",title:d["controls.zoomOut.ariaLabel"],"aria-label":d["controls.zoomOut.ariaLabel"],disabled:f,children:O.jsx(I2,{})})]}),i&&O.jsx(aa,{className:"react-flow__controls-fitview",onClick:k,title:d["controls.fitView.ariaLabel"],"aria-label":d["controls.fitView.ariaLabel"],children:O.jsx(O2,{})}),o&&O.jsx(aa,{className:"react-flow__controls-interactive",onClick:M,title:d["controls.interactive.ariaLabel"],"aria-label":d["controls.interactive.ariaLabel"],children:x?O.jsx(F2,{}):O.jsx(H2,{})}),v]})}Zg.displayName="Controls";const z2=J.memo(Zg);function $2({id:e,x:r,y:i,width:o,height:h,style:S,color:y,strokeColor:a,strokeWidth:l,className:_,borderRadius:v,shapeRendering:c,selected:m,onClick:C}){const{background:b,backgroundColor:x}=S||{},f=y||b||x;return O.jsx("rect",{className:rt(["react-flow__minimap-node",{selected:m},_]),x:r,y:i,rx:v,ry:v,width:o,height:h,style:{fill:f,stroke:a,strokeWidth:l},shapeRendering:c,onClick:C?p=>C(p,e):void 0})}const W2=J.memo($2),U2=e=>e.nodes.map(r=>r.id),iu=e=>e instanceof Function?e:()=>e;function V2({nodeStrokeColor:e,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:h,nodeComponent:S=W2,onClick:y}){const a=Te(U2,Ue),l=iu(r),_=iu(e),v=iu(i),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return O.jsx(O.Fragment,{children:a.map(m=>O.jsx(K2,{id:m,nodeColorFunc:l,nodeStrokeColorFunc:_,nodeClassNameFunc:v,nodeBorderRadius:o,nodeStrokeWidth:h,NodeComponent:S,onClick:y,shapeRendering:c},m))})}function q2({id:e,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:o,nodeBorderRadius:h,nodeStrokeWidth:S,shapeRendering:y,NodeComponent:a,onClick:l}){const{node:_,x:v,y:c,width:m,height:C}=Te(b=>{const x=b.nodeLookup.get(e);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const f=x.internals.userNode,{x:p,y:d}=x.internals.positionAbsolute,{width:u,height:w}=Lr(f);return{node:f,x:p,y:d,width:u,height:w}},Ue);return!_||_.hidden||!rg(_)?null:O.jsx(a,{x:v,y:c,width:m,height:C,style:_.style,selected:!!_.selected,className:o(_),color:r(_),borderRadius:h,strokeColor:i(_),strokeWidth:S,shapeRendering:y,onClick:l,id:_.id})}const K2=J.memo(q2);var X2=J.memo(V2);const Y2=200,G2=150,Q2=e=>!e.hidden,J2=e=>{const r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:e.nodeLookup.size>0?tg(As(e.nodeLookup,{filter:Q2}),r):r,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Z2="react-flow__minimap-desc";function em({style:e,className:r,nodeStrokeColor:i,nodeColor:o,nodeClassName:h="",nodeBorderRadius:S=5,nodeStrokeWidth:y,nodeComponent:a,bgColor:l,maskColor:_,maskStrokeColor:v,maskStrokeWidth:c,position:m="bottom-right",onClick:C,onNodeClick:b,pannable:x=!1,zoomable:f=!1,ariaLabel:p,inversePan:d,zoomStep:u=1,offsetScale:w=5}){const L=Ve(),R=J.useRef(null),{boundingRect:D,viewBB:k,rfId:M,panZoom:W,translateExtent:z,flowWidth:j,flowHeight:N,ariaLabelConfig:I}=Te(J2,Ue),q=(e==null?void 0:e.width)??Y2,U=(e==null?void 0:e.height)??G2,K=D.width/q,V=D.height/U,T=Math.max(K,V),B=T*q,P=T*U,F=w*T,G=D.x-(B-D.width)/2-F,Z=D.y-(P-D.height)/2-F,ie=B+F*2,ae=P+F*2,X=`${Z2}-${M}`,H=J.useRef(0),re=J.useRef();H.current=T,J.useEffect(()=>{if(R.current&&W)return re.current=_C({domNode:R.current,panZoom:W,getTransform:()=>L.getState().transform,getViewScale:()=>H.current}),()=>{var pe;(pe=re.current)==null||pe.destroy()}},[W]),J.useEffect(()=>{var pe;(pe=re.current)==null||pe.update({translateExtent:z,width:j,height:N,inversePan:d,pannable:x,zoomStep:u,zoomable:f})},[x,f,d,u,z,j,N]);const te=C?pe=>{var ue;const[Se,be]=((ue=re.current)==null?void 0:ue.pointer(pe))||[0,0];C(pe,{x:Se,y:be})}:void 0,ce=b?J.useCallback((pe,Se)=>{const be=L.getState().nodeLookup.get(Se).internals.userNode;b(pe,be)},[]):void 0,le=p??I["minimap.ariaLabel"];return O.jsx(Ua,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*T:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof y=="number"?y:void 0},className:rt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:O.jsxs("svg",{width:q,height:U,viewBox:`${G} ${Z} ${ie} ${ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:R,onClick:te,children:[le&&O.jsx("title",{id:X,children:le}),O.jsx(X2,{onClick:ce,nodeColor:o,nodeStrokeColor:i,nodeBorderRadius:S,nodeClassName:h,nodeStrokeWidth:y,nodeComponent:a}),O.jsx("path",{className:"react-flow__minimap-mask",d:`M${G-F},${Z-F}h${ie+F*2}v${ae+F*2}h${-ie-F*2}z
|
|
61
|
+
`)),v=_.reduce((c,m)=>c.concat(...m),[]);return[_,v]}return[[],[]]},[e]);return J.useEffect(()=>{const l=(r==null?void 0:r.target)??Np,_=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(e!==null){const v=C=>{var f,p;if(h.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!h.current||h.current&&!_)&&sg(C))return!1;const x=Ip(C.code,a);if(S.current.add(C[x]),Bp(y,S.current,!1)){const d=((p=(f=C.composedPath)==null?void 0:f.call(C))==null?void 0:p[0])||C.target,u=(d==null?void 0:d.nodeName)==="BUTTON"||(d==null?void 0:d.nodeName)==="A";r.preventDefault!==!1&&(h.current||!u)&&C.preventDefault(),o(!0)}},c=C=>{const b=Ip(C.code,a);Bp(y,S.current,!0)?(o(!1),S.current.clear()):S.current.delete(C[b]),C.key==="Meta"&&S.current.clear(),h.current=!1},m=()=>{S.current.clear(),o(!1)};return l==null||l.addEventListener("keydown",v),l==null||l.addEventListener("keyup",c),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{l==null||l.removeEventListener("keydown",v),l==null||l.removeEventListener("keyup",c),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,o]),i}function Bp(e,r,i){return e.filter(o=>i||o.length===r.size).some(o=>o.every(h=>r.has(h)))}function Ip(e,r){return r.includes(e)?"code":"key"}const ox=()=>{const e=Ve();return J.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(r,i)=>{const{transform:[o,h,S],panZoom:y}=e.getState();return y?(await y.setViewport({x:r.x??o,y:r.y??h,zoom:r.zoom??S},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,o]=e.getState().transform;return{x:r,y:i,zoom:o}},setCenter:async(r,i,o)=>e.getState().setCenter(r,i,o),fitBounds:async(r,i)=>{const{width:o,height:h,minZoom:S,maxZoom:y,panZoom:a}=e.getState(),l=Zu(r,o,h,S,y,(i==null?void 0:i.padding)??.1);return a?(await a.setViewport(l,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:o,snapGrid:h,snapToGrid:S,domNode:y}=e.getState();if(!y)return r;const{x:a,y:l}=y.getBoundingClientRect(),_={x:r.x-a,y:r.y-l},v=i.snapGrid??h,c=i.snapToGrid??S;return Ms(_,o,c,v)},flowToScreenPosition:r=>{const{transform:i,domNode:o}=e.getState();if(!o)return r;const{x:h,y:S}=o.getBoundingClientRect(),y=Da(r,i);return{x:y.x+h,y:y.y+S}}}),[])};function Lg(e,r){const i=[],o=new Map,h=[];for(const S of e)if(S.type==="add"){h.push(S);continue}else if(S.type==="remove"||S.type==="replace")o.set(S.id,[S]);else{const y=o.get(S.id);y?y.push(S):o.set(S.id,[S])}for(const S of r){const y=o.get(S.id);if(!y){i.push(S);continue}if(y[0].type==="remove")continue;if(y[0].type==="replace"){i.push({...y[0].item});continue}const a={...S};for(const l of y)ax(l,a);i.push(a)}return h.length&&h.forEach(S=>{S.index!==void 0?i.splice(S.index,0,{...S.item}):i.push({...S.item})}),i}function ax(e,r){switch(e.type){case"select":{r.selected=e.selected;break}case"position":{typeof e.position<"u"&&(r.position=e.position),typeof e.dragging<"u"&&(r.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(r.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(r.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(r.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(r.resizing=e.resizing);break}}}function lx(e,r){return Lg(e,r)}function cx(e,r){return Lg(e,r)}function wn(e,r){return{id:e,type:"select",selected:r}}function oi(e,r=new Set,i=!1){const o=[];for(const[h,S]of e){const y=r.has(h);!(S.selected===void 0&&!y)&&S.selected!==y&&(i&&(S.selected=y),o.push(wn(S.id,y)))}return o}function Op({items:e=[],lookup:r}){var h;const i=[],o=new Map(e.map(S=>[S.id,S]));for(const[S,y]of e.entries()){const a=r.get(y.id),l=((h=a==null?void 0:a.internals)==null?void 0:h.userNode)??a;l!==void 0&&l!==y&&i.push({id:y.id,item:y,type:"replace"}),l===void 0&&i.push({item:y,type:"add",index:S})}for(const[S]of r)o.get(S)===void 0&&i.push({id:S,type:"remove"});return i}function Hp(e){return{id:e.id,type:"remove"}}const Fp=e=>TS(e),ux=e=>Q_(e);function Rg(e){return J.forwardRef(e)}function jp(e){const[r,i]=J.useState(BigInt(0)),[o]=J.useState(()=>hx(()=>i(h=>h+BigInt(1))));return Tu(()=>{const h=o.get();h.length&&(e(h),o.reset())},[r]),o}function hx(e){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),e()}}}const Dg=J.createContext(null);function dx({children:e}){const r=Ve(),i=J.useCallback(a=>{const{nodes:l=[],setNodes:_,hasDefaultNodes:v,onNodesChange:c,nodeLookup:m,fitViewQueued:C,onNodesChangeMiddlewareMap:b}=r.getState();let x=l;for(const p of a)x=typeof p=="function"?p(x):p;let f=Op({items:x,lookup:m});for(const p of b.values())f=p(f);v&&_(x),f.length>0?c==null||c(f):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:d,setNodes:u}=r.getState();p&&u(d)})},[]),o=jp(i),h=J.useCallback(a=>{const{edges:l=[],setEdges:_,hasDefaultEdges:v,onEdgesChange:c,edgeLookup:m}=r.getState();let C=l;for(const b of a)C=typeof b=="function"?b(C):b;v?_(C):c&&c(Op({items:C,lookup:m}))},[]),S=jp(h),y=J.useMemo(()=>({nodeQueue:o,edgeQueue:S}),[]);return O.jsx(Dg.Provider,{value:y,children:e})}function fx(){const e=J.useContext(Dg);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const px=e=>!!e.panZoom;function oh(){const e=ox(),r=Ve(),i=fx(),o=Te(px),h=J.useMemo(()=>{const S=c=>r.getState().nodeLookup.get(c),y=c=>{i.nodeQueue.push(c)},a=c=>{i.edgeQueue.push(c)},l=c=>{var p,d;const{nodeLookup:m,nodeOrigin:C}=r.getState(),b=Fp(c)?c:m.get(c.id),x=b.parentId?ng(b.position,b.measured,b.parentId,m,C):b.position,f={...b,position:x,width:((p=b.measured)==null?void 0:p.width)??b.width,height:((d=b.measured)==null?void 0:d.height)??b.height};return fi(f)},_=(c,m,C={replace:!1})=>{y(b=>b.map(x=>{if(x.id===c){const f=typeof m=="function"?m(x):m;return C.replace&&Fp(f)?f:{...x,...f}}return x}))},v=(c,m,C={replace:!1})=>{a(b=>b.map(x=>{if(x.id===c){const f=typeof m=="function"?m(x):m;return C.replace&&ux(f)?f:{...x,...f}}return x}))};return{getNodes:()=>r.getState().nodes.map(c=>({...c})),getNode:c=>{var m;return(m=S(c))==null?void 0:m.internals.userNode},getInternalNode:S,getEdges:()=>{const{edges:c=[]}=r.getState();return c.map(m=>({...m}))},getEdge:c=>r.getState().edgeLookup.get(c),setNodes:y,setEdges:a,addNodes:c=>{const m=Array.isArray(c)?c:[c];i.nodeQueue.push(C=>[...C,...m])},addEdges:c=>{const m=Array.isArray(c)?c:[c];i.edgeQueue.push(C=>[...C,...m])},toObject:()=>{const{nodes:c=[],edges:m=[],transform:C}=r.getState(),[b,x,f]=C;return{nodes:c.map(p=>({...p})),edges:m.map(p=>({...p})),viewport:{x:b,y:x,zoom:f}}},deleteElements:async({nodes:c=[],edges:m=[]})=>{const{nodes:C,edges:b,onNodesDelete:x,onEdgesDelete:f,triggerNodeChanges:p,triggerEdgeChanges:d,onDelete:u,onBeforeDelete:w}=r.getState(),{nodes:L,edges:R}=await IS({nodesToRemove:c,edgesToRemove:m,nodes:C,edges:b,onBeforeDelete:w}),D=R.length>0,k=L.length>0;if(D){const M=R.map(Hp);f==null||f(R),d(M)}if(k){const M=L.map(Hp);x==null||x(L),p(M)}return(k||D)&&(u==null||u({nodes:L,edges:R})),{deletedNodes:L,deletedEdges:R}},getIntersectingNodes:(c,m=!0,C)=>{const b=hp(c),x=b?c:l(c),f=C!==void 0;return x?(C||r.getState().nodes).filter(p=>{const d=r.getState().nodeLookup.get(p.id);if(d&&!b&&(p.id===c.id||!d.internals.positionAbsolute))return!1;const u=fi(f?p:d),w=xs(u,x);return m&&w>0||w>=u.width*u.height||w>=x.width*x.height}):[]},isNodeIntersecting:(c,m,C=!0)=>{const x=hp(c)?c:l(c);if(!x)return!1;const f=xs(x,m);return C&&f>0||f>=m.width*m.height||f>=x.width*x.height},updateNode:_,updateNodeData:(c,m,C={replace:!1})=>{_(c,b=>{const x=typeof m=="function"?m(b):m;return C.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},C)},updateEdge:v,updateEdgeData:(c,m,C={replace:!1})=>{v(c,b=>{const x=typeof m=="function"?m(b):m;return C.replace?{...b,data:x}:{...b,data:{...b.data,...x}}},C)},getNodesBounds:c=>{const{nodeLookup:m,nodeOrigin:C}=r.getState();return MS(c,{nodeLookup:m,nodeOrigin:C})},getHandleConnections:({type:c,id:m,nodeId:C})=>{var b;return Array.from(((b=r.getState().connectionLookup.get(`${C}-${c}${m?`-${m}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:c,handleId:m,nodeId:C})=>{var b;return Array.from(((b=r.getState().connectionLookup.get(`${C}${c?m?`-${c}-${m}`:`-${c}`:""}`))==null?void 0:b.values())??[])},fitView:async c=>{const m=r.getState().fitViewResolver??jS();return r.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:m}),i.nodeQueue.push(C=>[...C]),m.promise}}},[]);return J.useMemo(()=>({...h,...e,viewportInitialized:o}),[o])}const zp=e=>e.selected,_x=typeof window<"u"?window:void 0;function gx({deleteKeyCode:e,multiSelectionKeyCode:r}){const i=Ve(),{deleteElements:o}=oh(),h=Es(e,{actInsideInputWithModifier:!1}),S=Es(r,{target:_x});J.useEffect(()=>{if(h){const{edges:y,nodes:a}=i.getState();o({nodes:a.filter(zp),edges:y.filter(zp)}),i.setState({nodesSelectionActive:!1})}},[h]),J.useEffect(()=>{i.setState({multiSelectionActive:S})},[S])}function mx(e){const r=Ve();J.useEffect(()=>{const i=()=>{var h,S,y,a;if(!e.current||!(((S=(h=e.current).checkVisibility)==null?void 0:S.call(h))??!0))return!1;const o=eh(e.current);(o.height===0||o.width===0)&&((a=(y=r.getState()).onError)==null||a.call(y,"004",dr.error004())),r.setState({width:o.width||500,height:o.height||500})};if(e.current){i(),window.addEventListener("resize",i);const o=new ResizeObserver(()=>i());return o.observe(e.current),()=>{window.removeEventListener("resize",i),o&&e.current&&o.unobserve(e.current)}}},[])}const Va={position:"absolute",width:"100%",height:"100%",top:0,left:0},vx=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function yx({onPaneContextMenu:e,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:o=!1,panOnScrollSpeed:h=.5,panOnScrollMode:S=xn.Free,zoomOnDoubleClick:y=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:_,minZoom:v,maxZoom:c,zoomActivationKeyCode:m,preventScrolling:C=!0,children:b,noWheelClassName:x,noPanClassName:f,onViewportChange:p,isControlledViewport:d,paneClickDistance:u,selectionOnDrag:w}){const L=Ve(),R=J.useRef(null),{userSelectionActive:D,lib:k,connectionInProgress:M}=Te(vx,Ue),W=Es(m),z=J.useRef();mx(R);const j=J.useCallback(N=>{p==null||p({x:N[0],y:N[1],zoom:N[2]}),d||L.setState({transform:N})},[p,d]);return J.useEffect(()=>{if(R.current){z.current=xC({domNode:R.current,minZoom:v,maxZoom:c,translateExtent:_,viewport:l,onDraggingChange:U=>L.setState(K=>K.paneDragging===U?K:{paneDragging:U}),onPanZoomStart:(U,K)=>{const{onViewportChangeStart:V,onMoveStart:T}=L.getState();T==null||T(U,K),V==null||V(K)},onPanZoom:(U,K)=>{const{onViewportChange:V,onMove:T}=L.getState();T==null||T(U,K),V==null||V(K)},onPanZoomEnd:(U,K)=>{const{onViewportChangeEnd:V,onMoveEnd:T}=L.getState();T==null||T(U,K),V==null||V(K)}});const{x:N,y:I,zoom:q}=z.current.getViewport();return L.setState({panZoom:z.current,transform:[N,I,q],domNode:R.current.closest(".react-flow")}),()=>{var U;(U=z.current)==null||U.destroy()}}},[]),J.useEffect(()=>{var N;(N=z.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:o,panOnScrollSpeed:h,panOnScrollMode:S,zoomOnDoubleClick:y,panOnDrag:a,zoomActivationKeyPressed:W,preventScrolling:C,noPanClassName:f,userSelectionActive:D,noWheelClassName:x,lib:k,onTransformChange:j,connectionInProgress:M,selectionOnDrag:w,paneClickDistance:u})},[e,r,i,o,h,S,y,a,W,C,f,D,x,k,j,M,w,u]),O.jsx("div",{className:"react-flow__renderer",ref:R,style:Va,children:b})}const wx=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Sx(){const{userSelectionActive:e,userSelectionRect:r}=Te(wx,Ue);return e&&r?O.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const nu=(e,r)=>i=>{i.target===r.current&&(e==null||e(i))},Cx=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function xx({isSelecting:e,selectionKeyPressed:r,selectionMode:i=Cs.Full,panOnDrag:o,paneClickDistance:h,selectionOnDrag:S,onSelectionStart:y,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:_,onPaneScroll:v,onPaneMouseEnter:c,onPaneMouseMove:m,onPaneMouseLeave:C,children:b}){const x=Ve(),{userSelectionActive:f,elementsSelectable:p,dragging:d,connectionInProgress:u}=Te(Cx,Ue),w=p&&(e||f),L=J.useRef(null),R=J.useRef(),D=J.useRef(new Set),k=J.useRef(new Set),M=J.useRef(!1),W=V=>{if(M.current||u){M.current=!1;return}l==null||l(V),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},z=V=>{if(Array.isArray(o)&&(o!=null&&o.includes(2))){V.preventDefault();return}_==null||_(V)},j=v?V=>v(V):void 0,N=V=>{M.current&&(V.stopPropagation(),M.current=!1)},I=V=>{var ie,ae;const{domNode:T}=x.getState();if(R.current=T==null?void 0:T.getBoundingClientRect(),!R.current)return;const B=V.target===L.current;if(!B&&!!V.target.closest(".nokey")||!e||!(S&&B||r)||V.button!==0||!V.isPrimary)return;(ae=(ie=V.target)==null?void 0:ie.setPointerCapture)==null||ae.call(ie,V.pointerId),M.current=!1;const{x:G,y:Z}=er(V.nativeEvent,R.current);x.setState({userSelectionRect:{width:0,height:0,startX:G,startY:Z,x:G,y:Z}}),B||(V.stopPropagation(),V.preventDefault())},q=V=>{const{userSelectionRect:T,transform:B,nodeLookup:P,edgeLookup:F,connectionLookup:G,triggerNodeChanges:Z,triggerEdgeChanges:ie,defaultEdgeOptions:ae,resetSelectedElements:X}=x.getState();if(!R.current||!T)return;const{x:H,y:re}=er(V.nativeEvent,R.current),{startX:te,startY:ce}=T;if(!M.current){const ue=r?0:h;if(Math.hypot(H-te,re-ce)<=ue)return;X(),y==null||y(V)}M.current=!0;const le={startX:te,startY:ce,x:H<te?H:te,y:re<ce?re:ce,width:Math.abs(H-te),height:Math.abs(re-ce)},pe=D.current,Se=k.current;D.current=new Set(Ju(P,le,B,i===Cs.Partial,!0).map(ue=>ue.id)),k.current=new Set;const be=(ae==null?void 0:ae.selectable)??!0;for(const ue of D.current){const ge=G.get(ue);if(ge)for(const{edgeId:Re}of ge.values()){const Ie=F.get(Re);Ie&&(Ie.selectable??be)&&k.current.add(Re)}}if(!dp(pe,D.current)){const ue=oi(P,D.current,!0);Z(ue)}if(!dp(Se,k.current)){const ue=oi(F,k.current);ie(ue)}x.setState({userSelectionRect:le,userSelectionActive:!0,nodesSelectionActive:!1})},U=V=>{var T,B;V.button===0&&((B=(T=V.target)==null?void 0:T.releasePointerCapture)==null||B.call(T,V.pointerId),!f&&V.target===L.current&&x.getState().userSelectionRect&&(W==null||W(V)),x.setState({userSelectionActive:!1,userSelectionRect:null}),M.current&&(a==null||a(V),x.setState({nodesSelectionActive:D.current.size>0})))},K=o===!0||Array.isArray(o)&&o.includes(0);return O.jsxs("div",{className:rt(["react-flow__pane",{draggable:K,dragging:d,selection:e}]),onClick:w?void 0:nu(W,L),onContextMenu:nu(z,L),onWheel:nu(j,L),onPointerEnter:w?void 0:c,onPointerMove:w?q:m,onPointerUp:w?U:void 0,onPointerDownCapture:w?I:void 0,onClickCapture:w?N:void 0,onPointerLeave:C,ref:L,style:Va,children:[b,O.jsx(Sx,{})]})}function Mu({id:e,store:r,unselect:i=!1,nodeRef:o}){const{addSelectedNodes:h,unselectNodesAndEdges:S,multiSelectionActive:y,nodeLookup:a,onError:l}=r.getState(),_=a.get(e);if(!_){l==null||l("012",dr.error012(e));return}r.setState({nodesSelectionActive:!1}),_.selected?(i||_.selected&&y)&&(S({nodes:[_],edges:[]}),requestAnimationFrame(()=>{var v;return(v=o==null?void 0:o.current)==null?void 0:v.blur()})):h([e])}function Ag({nodeRef:e,disabled:r=!1,noDragClassName:i,handleSelector:o,nodeId:h,isSelectable:S,nodeClickDistance:y}){const a=Ve(),[l,_]=J.useState(!1),v=J.useRef();return J.useEffect(()=>{v.current=cC({getStoreItems:()=>a.getState(),onNodeMouseDown:c=>{Mu({id:c,store:a,nodeRef:e})},onDragStart:()=>{_(!0)},onDragStop:()=>{_(!1)}})},[]),J.useEffect(()=>{if(!(r||!e.current||!v.current))return v.current.update({noDragClassName:i,handleSelector:o,domNode:e.current,isSelectable:S,nodeId:h,nodeClickDistance:y}),()=>{var c;(c=v.current)==null||c.destroy()}},[i,o,r,S,e,h,y]),l}const bx=e=>r=>r.selected&&(r.draggable||e&&typeof r.draggable>"u");function Tg(){const e=Ve();return J.useCallback(i=>{const{nodeExtent:o,snapToGrid:h,snapGrid:S,nodesDraggable:y,onError:a,updateNodePositions:l,nodeLookup:_,nodeOrigin:v}=e.getState(),c=new Map,m=bx(y),C=h?S[0]:5,b=h?S[1]:5,x=i.direction.x*C*i.factor,f=i.direction.y*b*i.factor;for(const[,p]of _){if(!m(p))continue;let d={x:p.internals.positionAbsolute.x+x,y:p.internals.positionAbsolute.y+f};h&&(d=Ts(d,S));const{position:u,positionAbsolute:w}=J_({nodeId:p.id,nextPosition:d,nodeLookup:_,nodeExtent:o,nodeOrigin:v,onError:a});p.position=u,p.internals.positionAbsolute=w,c.set(p.id,p)}l(c)},[])}const ah=J.createContext(null),Ex=ah.Provider;ah.Consumer;const Mg=()=>J.useContext(ah),kx=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Lx=(e,r,i)=>o=>{const{connectionClickStartHandle:h,connectionMode:S,connection:y}=o,{fromHandle:a,toHandle:l,isValid:_}=y,v=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===r&&(l==null?void 0:l.type)===i;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===r&&(a==null?void 0:a.type)===i,connectingTo:v,clickConnecting:(h==null?void 0:h.nodeId)===e&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===i,isPossibleEndHandle:S===hi.Strict?(a==null?void 0:a.type)!==i:e!==(a==null?void 0:a.nodeId)||r!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!h,valid:v&&_}};function Rx({type:e="source",position:r=xe.Top,isValidConnection:i,isConnectable:o=!0,isConnectableStart:h=!0,isConnectableEnd:S=!0,id:y,onConnect:a,children:l,className:_,onMouseDown:v,onTouchStart:c,...m},C){var q,U;const b=y||null,x=e==="target",f=Ve(),p=Mg(),{connectOnClick:d,noPanClassName:u,rfId:w}=Te(kx,Ue),{connectingFrom:L,connectingTo:R,clickConnecting:D,isPossibleEndHandle:k,connectionInProcess:M,clickConnectionInProcess:W,valid:z}=Te(Lx(p,b,e),Ue);p||(U=(q=f.getState()).onError)==null||U.call(q,"010",dr.error010());const j=K=>{const{defaultEdgeOptions:V,onConnect:T,hasDefaultEdges:B}=f.getState(),P={...V,...K};if(B){const{edges:F,setEdges:G}=f.getState();G(KS(P,F))}T==null||T(P),a==null||a(P)},N=K=>{if(!p)return;const V=og(K.nativeEvent);if(h&&(V&&K.button===0||!V)){const T=f.getState();Au.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:T.autoPanOnConnect,connectionMode:T.connectionMode,connectionRadius:T.connectionRadius,domNode:T.domNode,nodeLookup:T.nodeLookup,lib:T.lib,isTarget:x,handleId:b,nodeId:p,flowId:T.rfId,panBy:T.panBy,cancelConnection:T.cancelConnection,onConnectStart:T.onConnectStart,onConnectEnd:(...B)=>{var P,F;return(F=(P=f.getState()).onConnectEnd)==null?void 0:F.call(P,...B)},updateConnection:T.updateConnection,onConnect:j,isValidConnection:i||((...B)=>{var P,F;return((F=(P=f.getState()).isValidConnection)==null?void 0:F.call(P,...B))??!0}),getTransform:()=>f.getState().transform,getFromHandle:()=>f.getState().connection.fromHandle,autoPanSpeed:T.autoPanSpeed,dragThreshold:T.connectionDragThreshold})}V?v==null||v(K):c==null||c(K)},I=K=>{const{onClickConnectStart:V,onClickConnectEnd:T,connectionClickStartHandle:B,connectionMode:P,isValidConnection:F,lib:G,rfId:Z,nodeLookup:ie,connection:ae}=f.getState();if(!p||!B&&!h)return;if(!B){V==null||V(K.nativeEvent,{nodeId:p,handleId:b,handleType:e}),f.setState({connectionClickStartHandle:{nodeId:p,type:e,id:b}});return}const X=ig(K.target),H=i||F,{connection:re,isValid:te}=Au.isValid(K.nativeEvent,{handle:{nodeId:p,id:b,type:e},connectionMode:P,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:H,flowId:Z,doc:X,lib:G,nodeLookup:ie});te&&re&&j(re);const ce=structuredClone(ae);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,T==null||T(K,ce),f.setState({connectionClickStartHandle:null})};return O.jsx("div",{"data-handleid":b,"data-nodeid":p,"data-handlepos":r,"data-id":`${w}-${p}-${b}-${e}`,className:rt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",u,_,{source:!x,target:x,connectable:o,connectablestart:h,connectableend:S,clickconnecting:D,connectingfrom:L,connectingto:R,valid:z,connectionindicator:o&&(!M||k)&&(M||W?S:h)}]),onMouseDown:N,onTouchStart:N,onClick:d?I:void 0,ref:C,...m,children:l})}const gi=J.memo(Rg(Rx));function Dx({data:e,isConnectable:r,sourcePosition:i=xe.Bottom}){return O.jsxs(O.Fragment,{children:[e==null?void 0:e.label,O.jsx(gi,{type:"source",position:i,isConnectable:r})]})}function Ax({data:e,isConnectable:r,targetPosition:i=xe.Top,sourcePosition:o=xe.Bottom}){return O.jsxs(O.Fragment,{children:[O.jsx(gi,{type:"target",position:i,isConnectable:r}),e==null?void 0:e.label,O.jsx(gi,{type:"source",position:o,isConnectable:r})]})}function Tx(){return null}function Mx({data:e,isConnectable:r,targetPosition:i=xe.Top}){return O.jsxs(O.Fragment,{children:[O.jsx(gi,{type:"target",position:i,isConnectable:r}),e==null?void 0:e.label]})}const Aa={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$p={input:Dx,default:Ax,output:Mx,group:Tx};function Px(e){var r,i,o,h;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((r=e.style)==null?void 0:r.width),height:e.height??e.initialHeight??((i=e.style)==null?void 0:i.height)}:{width:e.width??((o=e.style)==null?void 0:o.width),height:e.height??((h=e.style)==null?void 0:h.height)}}const Nx=e=>{const{width:r,height:i,x:o,y:h}=As(e.nodeLookup,{filter:S=>!!S.selected});return{width:Zt(r)?r:null,height:Zt(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${h}px)`}};function Bx({onSelectionContextMenu:e,noPanClassName:r,disableKeyboardA11y:i}){const o=Ve(),{width:h,height:S,transformString:y,userSelectionActive:a}=Te(Nx,Ue),l=Tg(),_=J.useRef(null);J.useEffect(()=>{var C;i||(C=_.current)==null||C.focus({preventScroll:!0})},[i]);const v=!a&&h!==null&&S!==null;if(Ag({nodeRef:_,disabled:!v}),!v)return null;const c=e?C=>{const b=o.getState().nodes.filter(x=>x.selected);e(C,b)}:void 0,m=C=>{Object.prototype.hasOwnProperty.call(Aa,C.key)&&(C.preventDefault(),l({direction:Aa[C.key],factor:C.shiftKey?4:1}))};return O.jsx("div",{className:rt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:y},children:O.jsx("div",{ref:_,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:h,height:S}})})}const Wp=typeof window<"u"?window:void 0,Ix=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Pg({children:e,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:h,onPaneContextMenu:S,onPaneScroll:y,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:_,selectionOnDrag:v,selectionMode:c,onSelectionStart:m,onSelectionEnd:C,multiSelectionKeyCode:b,panActivationKeyCode:x,zoomActivationKeyCode:f,elementsSelectable:p,zoomOnScroll:d,zoomOnPinch:u,panOnScroll:w,panOnScrollSpeed:L,panOnScrollMode:R,zoomOnDoubleClick:D,panOnDrag:k,defaultViewport:M,translateExtent:W,minZoom:z,maxZoom:j,preventScrolling:N,onSelectionContextMenu:I,noWheelClassName:q,noPanClassName:U,disableKeyboardA11y:K,onViewportChange:V,isControlledViewport:T}){const{nodesSelectionActive:B,userSelectionActive:P}=Te(Ix,Ue),F=Es(_,{target:Wp}),G=Es(x,{target:Wp}),Z=G||k,ie=G||w,ae=v&&Z!==!0,X=F||P||ae;return gx({deleteKeyCode:l,multiSelectionKeyCode:b}),O.jsx(yx,{onPaneContextMenu:S,elementsSelectable:p,zoomOnScroll:d,zoomOnPinch:u,panOnScroll:ie,panOnScrollSpeed:L,panOnScrollMode:R,zoomOnDoubleClick:D,panOnDrag:!F&&Z,defaultViewport:M,translateExtent:W,minZoom:z,maxZoom:j,zoomActivationKeyCode:f,preventScrolling:N,noWheelClassName:q,noPanClassName:U,onViewportChange:V,isControlledViewport:T,paneClickDistance:a,selectionOnDrag:ae,children:O.jsxs(xx,{onSelectionStart:m,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:o,onPaneMouseLeave:h,onPaneContextMenu:S,onPaneScroll:y,panOnDrag:Z,isSelecting:!!X,selectionMode:c,selectionKeyPressed:F,paneClickDistance:a,selectionOnDrag:ae,children:[e,B&&O.jsx(Bx,{onSelectionContextMenu:I,noPanClassName:U,disableKeyboardA11y:K})]})})}Pg.displayName="FlowRenderer";const Ox=J.memo(Pg),Hx=e=>r=>e?Ju(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function Fx(e){return Te(J.useCallback(Hx(e),[e]),Ue)}const jx=e=>e.updateNodeInternals;function zx(){const e=Te(jx),[r]=J.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const o=new Map;i.forEach(h=>{const S=h.target.getAttribute("data-id");o.set(S,{id:S,nodeElement:h.target,force:!0})}),e(o)}));return J.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function $x({node:e,nodeType:r,hasDimensions:i,resizeObserver:o}){const h=Ve(),S=J.useRef(null),y=J.useRef(null),a=J.useRef(e.sourcePosition),l=J.useRef(e.targetPosition),_=J.useRef(r),v=i&&!!e.internals.handleBounds;return J.useEffect(()=>{S.current&&!e.hidden&&(!v||y.current!==S.current)&&(y.current&&(o==null||o.unobserve(y.current)),o==null||o.observe(S.current),y.current=S.current)},[v,e.hidden]),J.useEffect(()=>()=>{y.current&&(o==null||o.unobserve(y.current),y.current=null)},[]),J.useEffect(()=>{if(S.current){const c=_.current!==r,m=a.current!==e.sourcePosition,C=l.current!==e.targetPosition;(c||m||C)&&(_.current=r,a.current=e.sourcePosition,l.current=e.targetPosition,h.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:S.current,force:!0}]])))}},[e.id,r,e.sourcePosition,e.targetPosition]),S}function Wx({id:e,onClick:r,onMouseEnter:i,onMouseMove:o,onMouseLeave:h,onContextMenu:S,onDoubleClick:y,nodesDraggable:a,elementsSelectable:l,nodesConnectable:_,nodesFocusable:v,resizeObserver:c,noDragClassName:m,noPanClassName:C,disableKeyboardA11y:b,rfId:x,nodeTypes:f,nodeClickDistance:p,onError:d}){const{node:u,internals:w,isParent:L}=Te(H=>{const re=H.nodeLookup.get(e),te=H.parentLookup.has(e);return{node:re,internals:re.internals,isParent:te}},Ue);let R=u.type||"default",D=(f==null?void 0:f[R])||$p[R];D===void 0&&(d==null||d("003",dr.error003(R)),R="default",D=(f==null?void 0:f.default)||$p.default);const k=!!(u.draggable||a&&typeof u.draggable>"u"),M=!!(u.selectable||l&&typeof u.selectable>"u"),W=!!(u.connectable||_&&typeof u.connectable>"u"),z=!!(u.focusable||v&&typeof u.focusable>"u"),j=Ve(),N=rg(u),I=$x({node:u,nodeType:R,hasDimensions:N,resizeObserver:c}),q=Ag({nodeRef:I,disabled:u.hidden||!k,noDragClassName:m,handleSelector:u.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:p}),U=Tg();if(u.hidden)return null;const K=Rr(u),V=Px(u),T=M||k||r||i||o||h,B=i?H=>i(H,{...w.userNode}):void 0,P=o?H=>o(H,{...w.userNode}):void 0,F=h?H=>h(H,{...w.userNode}):void 0,G=S?H=>S(H,{...w.userNode}):void 0,Z=y?H=>y(H,{...w.userNode}):void 0,ie=H=>{const{selectNodesOnDrag:re,nodeDragThreshold:te}=j.getState();M&&(!re||!k||te>0)&&Mu({id:e,store:j,nodeRef:I}),r&&r(H,{...w.userNode})},ae=H=>{if(!(sg(H.nativeEvent)||b)){if(K_.includes(H.key)&&M){const re=H.key==="Escape";Mu({id:e,store:j,unselect:re,nodeRef:I})}else if(k&&u.selected&&Object.prototype.hasOwnProperty.call(Aa,H.key)){H.preventDefault();const{ariaLabelConfig:re}=j.getState();j.setState({ariaLiveMessage:re["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),U({direction:Aa[H.key],factor:H.shiftKey?4:1})}}},X=()=>{var Se;if(b||!((Se=I.current)!=null&&Se.matches(":focus-visible")))return;const{transform:H,width:re,height:te,autoPanOnNodeFocus:ce,setCenter:le}=j.getState();if(!ce)return;Ju(new Map([[e,u]]),{x:0,y:0,width:re,height:te},H,!0).length>0||le(u.position.x+K.width/2,u.position.y+K.height/2,{zoom:H[2]})};return O.jsx("div",{className:rt(["react-flow__node",`react-flow__node-${R}`,{[C]:k},u.className,{selected:u.selected,selectable:M,parent:L,draggable:k,dragging:q}]),ref:I,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:T?"all":"none",visibility:N?"visible":"hidden",...u.style,...V},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:B,onMouseMove:P,onMouseLeave:F,onContextMenu:G,onClick:ie,onDoubleClick:Z,onKeyDown:z?ae:void 0,tabIndex:z?0:void 0,onFocus:z?X:void 0,role:u.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${bg}-${x}`,"aria-label":u.ariaLabel,...u.domAttributes,children:O.jsx(Ex,{value:e,children:O.jsx(D,{id:e,data:u.data,type:R,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:u.selected??!1,selectable:M,draggable:k,deletable:u.deletable??!0,isConnectable:W,sourcePosition:u.sourcePosition,targetPosition:u.targetPosition,dragging:q,dragHandle:u.dragHandle,zIndex:w.z,parentId:u.parentId,...K})})})}var Ux=J.memo(Wx);const Vx=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Ng(e){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:o,elementsSelectable:h,onError:S}=Te(Vx,Ue),y=Fx(e.onlyRenderVisibleElements),a=zx();return O.jsx("div",{className:"react-flow__nodes",style:Va,children:y.map(l=>O.jsx(Ux,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:a,nodesDraggable:r,nodesConnectable:i,nodesFocusable:o,elementsSelectable:h,nodeClickDistance:e.nodeClickDistance,onError:S},l))})}Ng.displayName="NodeRenderer";const qx=J.memo(Ng);function Kx(e){return Te(J.useCallback(i=>{if(!e)return i.edges.map(h=>h.id);const o=[];if(i.width&&i.height)for(const h of i.edges){const S=i.nodeLookup.get(h.source),y=i.nodeLookup.get(h.target);S&&y&&US({sourceNode:S,targetNode:y,width:i.width,height:i.height,transform:i.transform})&&o.push(h.id)}return o},[e]),Ue)}const Xx=({color:e="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...e&&{stroke:e}};return O.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Yx=({color:e="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...e&&{stroke:e,fill:e}};return O.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Up={[La.Arrow]:Xx,[La.ArrowClosed]:Yx};function Gx(e){const r=Ve();return J.useMemo(()=>{var h,S;return Object.prototype.hasOwnProperty.call(Up,e)?Up[e]:((S=(h=r.getState()).onError)==null||S.call(h,"009",dr.error009(e)),null)},[e])}const Qx=({id:e,type:r,color:i,width:o=12.5,height:h=12.5,markerUnits:S="strokeWidth",strokeWidth:y,orient:a="auto-start-reverse"})=>{const l=Gx(r);return l?O.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${h}`,viewBox:"-10 -10 20 20",markerUnits:S,orient:a,refX:"0",refY:"0",children:O.jsx(l,{color:i,strokeWidth:y})}):null},Bg=({defaultColor:e,rfId:r})=>{const i=Te(S=>S.edges),o=Te(S=>S.defaultEdgeOptions),h=J.useMemo(()=>JS(i,{id:r,defaultColor:e,defaultMarkerStart:o==null?void 0:o.markerStart,defaultMarkerEnd:o==null?void 0:o.markerEnd}),[i,o,r,e]);return h.length?O.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:O.jsx("defs",{children:h.map(S=>O.jsx(Qx,{id:S.id,type:S.type,color:S.color,width:S.width,height:S.height,markerUnits:S.markerUnits,strokeWidth:S.strokeWidth,orient:S.orient},S.id))})}):null};Bg.displayName="MarkerDefinitions";var Jx=J.memo(Bg);function Ig({x:e,y:r,label:i,labelStyle:o,labelShowBg:h=!0,labelBgStyle:S,labelBgPadding:y=[2,4],labelBgBorderRadius:a=2,children:l,className:_,...v}){const[c,m]=J.useState({x:1,y:0,width:0,height:0}),C=rt(["react-flow__edge-textwrapper",_]),b=J.useRef(null);return J.useEffect(()=>{if(b.current){const x=b.current.getBBox();m({x:x.x,y:x.y,width:x.width,height:x.height})}},[i]),i?O.jsxs("g",{transform:`translate(${e-c.width/2} ${r-c.height/2})`,className:C,visibility:c.width?"visible":"hidden",...v,children:[h&&O.jsx("rect",{width:c.width+2*y[0],x:-y[0],y:-y[1],height:c.height+2*y[1],className:"react-flow__edge-textbg",style:S,rx:a,ry:a}),O.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:b,style:o,children:i}),l]}):null}Ig.displayName="EdgeText";const Zx=J.memo(Ig);function qa({path:e,labelX:r,labelY:i,label:o,labelStyle:h,labelShowBg:S,labelBgStyle:y,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:_=20,...v}){return O.jsxs(O.Fragment,{children:[O.jsx("path",{...v,d:e,fill:"none",className:rt(["react-flow__edge-path",v.className])}),_?O.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:_,className:"react-flow__edge-interaction"}):null,o&&Zt(r)&&Zt(i)?O.jsx(Zx,{x:r,y:i,label:o,labelStyle:h,labelShowBg:S,labelBgStyle:y,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function Vp({pos:e,x1:r,y1:i,x2:o,y2:h}){return e===xe.Left||e===xe.Right?[.5*(r+o),i]:[r,.5*(i+h)]}function Og({sourceX:e,sourceY:r,sourcePosition:i=xe.Bottom,targetX:o,targetY:h,targetPosition:S=xe.Top}){const[y,a]=Vp({pos:i,x1:e,y1:r,x2:o,y2:h}),[l,_]=Vp({pos:S,x1:o,y1:h,x2:e,y2:r}),[v,c,m,C]=ag({sourceX:e,sourceY:r,targetX:o,targetY:h,sourceControlX:y,sourceControlY:a,targetControlX:l,targetControlY:_});return[`M${e},${r} C${y},${a} ${l},${_} ${o},${h}`,v,c,m,C]}function Hg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:h,targetY:S,sourcePosition:y,targetPosition:a,label:l,labelStyle:_,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,interactionWidth:p})=>{const[d,u,w]=Og({sourceX:i,sourceY:o,sourcePosition:y,targetX:h,targetY:S,targetPosition:a}),L=e.isInternal?void 0:r;return O.jsx(qa,{id:L,path:d,labelX:u,labelY:w,label:l,labelStyle:_,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,interactionWidth:p})})}const e2=Hg({isInternal:!1}),Fg=Hg({isInternal:!0});e2.displayName="SimpleBezierEdge";Fg.displayName="SimpleBezierEdgeInternal";function jg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:h,targetY:S,label:y,labelStyle:a,labelShowBg:l,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:c,style:m,sourcePosition:C=xe.Bottom,targetPosition:b=xe.Top,markerEnd:x,markerStart:f,pathOptions:p,interactionWidth:d})=>{const[u,w,L]=Lu({sourceX:i,sourceY:o,sourcePosition:C,targetX:h,targetY:S,targetPosition:b,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),R=e.isInternal?void 0:r;return O.jsx(qa,{id:R,path:u,labelX:w,labelY:L,label:y,labelStyle:a,labelShowBg:l,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:c,style:m,markerEnd:x,markerStart:f,interactionWidth:d})})}const zg=jg({isInternal:!1}),$g=jg({isInternal:!0});zg.displayName="SmoothStepEdge";$g.displayName="SmoothStepEdgeInternal";function Wg(e){return J.memo(({id:r,...i})=>{var h;const o=e.isInternal?void 0:r;return O.jsx(zg,{...i,id:o,pathOptions:J.useMemo(()=>{var S;return{borderRadius:0,offset:(S=i.pathOptions)==null?void 0:S.offset}},[(h=i.pathOptions)==null?void 0:h.offset])})})}const t2=Wg({isInternal:!1}),Ug=Wg({isInternal:!0});t2.displayName="StepEdge";Ug.displayName="StepEdgeInternal";function Vg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:h,targetY:S,label:y,labelStyle:a,labelShowBg:l,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:c,style:m,markerEnd:C,markerStart:b,interactionWidth:x})=>{const[f,p,d]=ug({sourceX:i,sourceY:o,targetX:h,targetY:S}),u=e.isInternal?void 0:r;return O.jsx(qa,{id:u,path:f,labelX:p,labelY:d,label:y,labelStyle:a,labelShowBg:l,labelBgStyle:_,labelBgPadding:v,labelBgBorderRadius:c,style:m,markerEnd:C,markerStart:b,interactionWidth:x})})}const r2=Vg({isInternal:!1}),qg=Vg({isInternal:!0});r2.displayName="StraightEdge";qg.displayName="StraightEdgeInternal";function Kg(e){return J.memo(({id:r,sourceX:i,sourceY:o,targetX:h,targetY:S,sourcePosition:y=xe.Bottom,targetPosition:a=xe.Top,label:l,labelStyle:_,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,pathOptions:p,interactionWidth:d})=>{const[u,w,L]=lg({sourceX:i,sourceY:o,sourcePosition:y,targetX:h,targetY:S,targetPosition:a,curvature:p==null?void 0:p.curvature}),R=e.isInternal?void 0:r;return O.jsx(qa,{id:R,path:u,labelX:w,labelY:L,label:l,labelStyle:_,labelShowBg:v,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:C,style:b,markerEnd:x,markerStart:f,interactionWidth:d})})}const n2=Kg({isInternal:!1}),Xg=Kg({isInternal:!0});n2.displayName="BezierEdge";Xg.displayName="BezierEdgeInternal";const qp={default:Xg,straight:qg,step:Ug,smoothstep:$g,simplebezier:Fg},Kp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},i2=(e,r,i)=>i===xe.Left?e-r:i===xe.Right?e+r:e,s2=(e,r,i)=>i===xe.Top?e-r:i===xe.Bottom?e+r:e,Xp="react-flow__edgeupdater";function Yp({position:e,centerX:r,centerY:i,radius:o=10,onMouseDown:h,onMouseEnter:S,onMouseOut:y,type:a}){return O.jsx("circle",{onMouseDown:h,onMouseEnter:S,onMouseOut:y,className:rt([Xp,`${Xp}-${a}`]),cx:i2(r,o,e),cy:s2(i,o,e),r:o,stroke:"transparent",fill:"transparent"})}function o2({isReconnectable:e,reconnectRadius:r,edge:i,sourceX:o,sourceY:h,targetX:S,targetY:y,sourcePosition:a,targetPosition:l,onReconnect:_,onReconnectStart:v,onReconnectEnd:c,setReconnecting:m,setUpdateHover:C}){const b=Ve(),x=(w,L)=>{if(w.button!==0)return;const{autoPanOnConnect:R,domNode:D,connectionMode:k,connectionRadius:M,lib:W,onConnectStart:z,cancelConnection:j,nodeLookup:N,rfId:I,panBy:q,updateConnection:U}=b.getState(),K=L.type==="target",V=(P,F)=>{m(!1),c==null||c(P,i,L.type,F)},T=P=>_==null?void 0:_(i,P),B=(P,F)=>{m(!0),v==null||v(w,i,L.type),z==null||z(P,F)};Au.onPointerDown(w.nativeEvent,{autoPanOnConnect:R,connectionMode:k,connectionRadius:M,domNode:D,handleId:L.id,nodeId:L.nodeId,nodeLookup:N,isTarget:K,edgeUpdaterType:L.type,lib:W,flowId:I,cancelConnection:j,panBy:q,isValidConnection:(...P)=>{var F,G;return((G=(F=b.getState()).isValidConnection)==null?void 0:G.call(F,...P))??!0},onConnect:T,onConnectStart:B,onConnectEnd:(...P)=>{var F,G;return(G=(F=b.getState()).onConnectEnd)==null?void 0:G.call(F,...P)},onReconnectEnd:V,updateConnection:U,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},f=w=>x(w,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),p=w=>x(w,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),d=()=>C(!0),u=()=>C(!1);return O.jsxs(O.Fragment,{children:[(e===!0||e==="source")&&O.jsx(Yp,{position:a,centerX:o,centerY:h,radius:r,onMouseDown:f,onMouseEnter:d,onMouseOut:u,type:"source"}),(e===!0||e==="target")&&O.jsx(Yp,{position:l,centerX:S,centerY:y,radius:r,onMouseDown:p,onMouseEnter:d,onMouseOut:u,type:"target"})]})}function a2({id:e,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:o,onClick:h,onDoubleClick:S,onContextMenu:y,onMouseEnter:a,onMouseMove:l,onMouseLeave:_,reconnectRadius:v,onReconnect:c,onReconnectStart:m,onReconnectEnd:C,rfId:b,edgeTypes:x,noPanClassName:f,onError:p,disableKeyboardA11y:d}){let u=Te(le=>le.edgeLookup.get(e));const w=Te(le=>le.defaultEdgeOptions);u=w?{...w,...u}:u;let L=u.type||"default",R=(x==null?void 0:x[L])||qp[L];R===void 0&&(p==null||p("011",dr.error011(L)),L="default",R=(x==null?void 0:x.default)||qp.default);const D=!!(u.focusable||r&&typeof u.focusable>"u"),k=typeof c<"u"&&(u.reconnectable||i&&typeof u.reconnectable>"u"),M=!!(u.selectable||o&&typeof u.selectable>"u"),W=J.useRef(null),[z,j]=J.useState(!1),[N,I]=J.useState(!1),q=Ve(),{zIndex:U,sourceX:K,sourceY:V,targetX:T,targetY:B,sourcePosition:P,targetPosition:F}=Te(J.useCallback(le=>{const pe=le.nodeLookup.get(u.source),Se=le.nodeLookup.get(u.target);if(!pe||!Se)return{zIndex:u.zIndex,...Kp};const be=QS({id:e,sourceNode:pe,targetNode:Se,sourceHandle:u.sourceHandle||null,targetHandle:u.targetHandle||null,connectionMode:le.connectionMode,onError:p});return{zIndex:WS({selected:u.selected,zIndex:u.zIndex,sourceNode:pe,targetNode:Se,elevateOnSelect:le.elevateEdgesOnSelect,zIndexMode:le.zIndexMode}),...be||Kp}},[u.source,u.target,u.sourceHandle,u.targetHandle,u.selected,u.zIndex]),Ue),G=J.useMemo(()=>u.markerStart?`url('#${Ru(u.markerStart,b)}')`:void 0,[u.markerStart,b]),Z=J.useMemo(()=>u.markerEnd?`url('#${Ru(u.markerEnd,b)}')`:void 0,[u.markerEnd,b]);if(u.hidden||K===null||V===null||T===null||B===null)return null;const ie=le=>{var ue;const{addSelectedEdges:pe,unselectNodesAndEdges:Se,multiSelectionActive:be}=q.getState();M&&(q.setState({nodesSelectionActive:!1}),u.selected&&be?(Se({nodes:[],edges:[u]}),(ue=W.current)==null||ue.blur()):pe([e])),h&&h(le,u)},ae=S?le=>{S(le,{...u})}:void 0,X=y?le=>{y(le,{...u})}:void 0,H=a?le=>{a(le,{...u})}:void 0,re=l?le=>{l(le,{...u})}:void 0,te=_?le=>{_(le,{...u})}:void 0,ce=le=>{var pe;if(!d&&K_.includes(le.key)&&M){const{unselectNodesAndEdges:Se,addSelectedEdges:be}=q.getState();le.key==="Escape"?((pe=W.current)==null||pe.blur(),Se({edges:[u]})):be([e])}};return O.jsx("svg",{style:{zIndex:U},children:O.jsxs("g",{className:rt(["react-flow__edge",`react-flow__edge-${L}`,u.className,f,{selected:u.selected,animated:u.animated,inactive:!M&&!h,updating:z,selectable:M}]),onClick:ie,onDoubleClick:ae,onContextMenu:X,onMouseEnter:H,onMouseMove:re,onMouseLeave:te,onKeyDown:D?ce:void 0,tabIndex:D?0:void 0,role:u.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":u.ariaLabel===null?void 0:u.ariaLabel||`Edge from ${u.source} to ${u.target}`,"aria-describedby":D?`${Eg}-${b}`:void 0,ref:W,...u.domAttributes,children:[!N&&O.jsx(R,{id:e,source:u.source,target:u.target,type:u.type,selected:u.selected,animated:u.animated,selectable:M,deletable:u.deletable??!0,label:u.label,labelStyle:u.labelStyle,labelShowBg:u.labelShowBg,labelBgStyle:u.labelBgStyle,labelBgPadding:u.labelBgPadding,labelBgBorderRadius:u.labelBgBorderRadius,sourceX:K,sourceY:V,targetX:T,targetY:B,sourcePosition:P,targetPosition:F,data:u.data,style:u.style,sourceHandleId:u.sourceHandle,targetHandleId:u.targetHandle,markerStart:G,markerEnd:Z,pathOptions:"pathOptions"in u?u.pathOptions:void 0,interactionWidth:u.interactionWidth}),k&&O.jsx(o2,{edge:u,isReconnectable:k,reconnectRadius:v,onReconnect:c,onReconnectStart:m,onReconnectEnd:C,sourceX:K,sourceY:V,targetX:T,targetY:B,sourcePosition:P,targetPosition:F,setUpdateHover:j,setReconnecting:I})]})})}var l2=J.memo(a2);const c2=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Yg({defaultMarkerColor:e,onlyRenderVisibleElements:r,rfId:i,edgeTypes:o,noPanClassName:h,onReconnect:S,onEdgeContextMenu:y,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:_,onEdgeClick:v,reconnectRadius:c,onEdgeDoubleClick:m,onReconnectStart:C,onReconnectEnd:b,disableKeyboardA11y:x}){const{edgesFocusable:f,edgesReconnectable:p,elementsSelectable:d,onError:u}=Te(c2,Ue),w=Kx(r);return O.jsxs("div",{className:"react-flow__edges",children:[O.jsx(Jx,{defaultColor:e,rfId:i}),w.map(L=>O.jsx(l2,{id:L,edgesFocusable:f,edgesReconnectable:p,elementsSelectable:d,noPanClassName:h,onReconnect:S,onContextMenu:y,onMouseEnter:a,onMouseMove:l,onMouseLeave:_,onClick:v,reconnectRadius:c,onDoubleClick:m,onReconnectStart:C,onReconnectEnd:b,rfId:i,onError:u,edgeTypes:o,disableKeyboardA11y:x},L))]})}Yg.displayName="EdgeRenderer";const u2=J.memo(Yg),h2=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function d2({children:e}){const r=Te(h2);return O.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:e})}function f2(e){const r=oh(),i=J.useRef(!1);J.useEffect(()=>{!i.current&&r.viewportInitialized&&e&&(setTimeout(()=>e(r),1),i.current=!0)},[e,r.viewportInitialized])}const p2=e=>{var r;return(r=e.panZoom)==null?void 0:r.syncViewport};function _2(e){const r=Te(p2),i=Ve();return J.useEffect(()=>{e&&(r==null||r(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,r]),null}function g2(e){return e.connection.inProgress?{...e.connection,to:Ms(e.connection.to,e.transform)}:{...e.connection}}function m2(e){return g2}function v2(e){const r=m2();return Te(r,Ue)}const y2=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function w2({containerStyle:e,style:r,type:i,component:o}){const{nodesConnectable:h,width:S,height:y,isValid:a,inProgress:l}=Te(y2,Ue);return!(S&&h&&l)?null:O.jsx("svg",{style:e,width:S,height:y,className:"react-flow__connectionline react-flow__container",children:O.jsx("g",{className:rt(["react-flow__connection",G_(a)]),children:O.jsx(Gg,{style:r,type:i,CustomComponent:o,isValid:a})})})}const Gg=({style:e,type:r=Zr.Bezier,CustomComponent:i,isValid:o})=>{const{inProgress:h,from:S,fromNode:y,fromHandle:a,fromPosition:l,to:_,toNode:v,toHandle:c,toPosition:m,pointer:C}=v2();if(!h)return;if(i)return O.jsx(i,{connectionLineType:r,connectionLineStyle:e,fromNode:y,fromHandle:a,fromX:S.x,fromY:S.y,toX:_.x,toY:_.y,fromPosition:l,toPosition:m,connectionStatus:G_(o),toNode:v,toHandle:c,pointer:C});let b="";const x={sourceX:S.x,sourceY:S.y,sourcePosition:l,targetX:_.x,targetY:_.y,targetPosition:m};switch(r){case Zr.Bezier:[b]=lg(x);break;case Zr.SimpleBezier:[b]=Og(x);break;case Zr.Step:[b]=Lu({...x,borderRadius:0});break;case Zr.SmoothStep:[b]=Lu(x);break;default:[b]=ug(x)}return O.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};Gg.displayName="ConnectionLine";const S2={};function Gp(e=S2){J.useRef(e),Ve(),J.useEffect(()=>{},[e])}function C2(){Ve(),J.useRef(!1),J.useEffect(()=>{},[])}function Qg({nodeTypes:e,edgeTypes:r,onInit:i,onNodeClick:o,onEdgeClick:h,onNodeDoubleClick:S,onEdgeDoubleClick:y,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:_,onNodeContextMenu:v,onSelectionContextMenu:c,onSelectionStart:m,onSelectionEnd:C,connectionLineType:b,connectionLineStyle:x,connectionLineComponent:f,connectionLineContainerStyle:p,selectionKeyCode:d,selectionOnDrag:u,selectionMode:w,multiSelectionKeyCode:L,panActivationKeyCode:R,zoomActivationKeyCode:D,deleteKeyCode:k,onlyRenderVisibleElements:M,elementsSelectable:W,defaultViewport:z,translateExtent:j,minZoom:N,maxZoom:I,preventScrolling:q,defaultMarkerColor:U,zoomOnScroll:K,zoomOnPinch:V,panOnScroll:T,panOnScrollSpeed:B,panOnScrollMode:P,zoomOnDoubleClick:F,panOnDrag:G,onPaneClick:Z,onPaneMouseEnter:ie,onPaneMouseMove:ae,onPaneMouseLeave:X,onPaneScroll:H,onPaneContextMenu:re,paneClickDistance:te,nodeClickDistance:ce,onEdgeContextMenu:le,onEdgeMouseEnter:pe,onEdgeMouseMove:Se,onEdgeMouseLeave:be,reconnectRadius:ue,onReconnect:ge,onReconnectStart:Re,onReconnectEnd:Ie,noDragClassName:ze,noWheelClassName:Qe,noPanClassName:ut,disableKeyboardA11y:qe,nodeExtent:pt,rfId:Ne,viewport:Je,onViewportChange:ht}){return Gp(e),Gp(r),C2(),f2(i),_2(Je),O.jsx(Ox,{onPaneClick:Z,onPaneMouseEnter:ie,onPaneMouseMove:ae,onPaneMouseLeave:X,onPaneContextMenu:re,onPaneScroll:H,paneClickDistance:te,deleteKeyCode:k,selectionKeyCode:d,selectionOnDrag:u,selectionMode:w,onSelectionStart:m,onSelectionEnd:C,multiSelectionKeyCode:L,panActivationKeyCode:R,zoomActivationKeyCode:D,elementsSelectable:W,zoomOnScroll:K,zoomOnPinch:V,zoomOnDoubleClick:F,panOnScroll:T,panOnScrollSpeed:B,panOnScrollMode:P,panOnDrag:G,defaultViewport:z,translateExtent:j,minZoom:N,maxZoom:I,onSelectionContextMenu:c,preventScrolling:q,noDragClassName:ze,noWheelClassName:Qe,noPanClassName:ut,disableKeyboardA11y:qe,onViewportChange:ht,isControlledViewport:!!Je,children:O.jsxs(d2,{children:[O.jsx(u2,{edgeTypes:r,onEdgeClick:h,onEdgeDoubleClick:y,onReconnect:ge,onReconnectStart:Re,onReconnectEnd:Ie,onlyRenderVisibleElements:M,onEdgeContextMenu:le,onEdgeMouseEnter:pe,onEdgeMouseMove:Se,onEdgeMouseLeave:be,reconnectRadius:ue,defaultMarkerColor:U,noPanClassName:ut,disableKeyboardA11y:qe,rfId:Ne}),O.jsx(w2,{style:x,type:b,component:f,containerStyle:p}),O.jsx("div",{className:"react-flow__edgelabel-renderer"}),O.jsx(qx,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:S,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:_,onNodeContextMenu:v,nodeClickDistance:ce,onlyRenderVisibleElements:M,noPanClassName:ut,noDragClassName:ze,disableKeyboardA11y:qe,nodeExtent:pt,rfId:Ne}),O.jsx("div",{className:"react-flow__viewport-portal"})]})})}Qg.displayName="GraphView";const x2=J.memo(Qg),Qp=({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:h,height:S,fitView:y,fitViewOptions:a,minZoom:l=.5,maxZoom:_=2,nodeOrigin:v,nodeExtent:c,zIndexMode:m="basic"}={})=>{const C=new Map,b=new Map,x=new Map,f=new Map,p=o??r??[],d=i??e??[],u=v??[0,0],w=c??Ss;fg(x,f,p);const{nodesInitialized:L}=Du(d,C,b,{nodeOrigin:u,nodeExtent:w,zIndexMode:m});let R=[0,0,1];if(y&&h&&S){const D=As(C,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:k,y:M,zoom:W}=Zu(D,h,S,l,_,(a==null?void 0:a.padding)??.1);R=[k,M,W]}return{rfId:"1",width:h??0,height:S??0,transform:R,nodes:d,nodesInitialized:L,nodeLookup:C,parentLookup:b,edges:p,edgeLookup:f,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:l,maxZoom:_,translateExtent:Ss,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:hi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:u,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:y??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Y_},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:OS,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:X_,zIndexMode:m,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},b2=({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:h,height:S,fitView:y,fitViewOptions:a,minZoom:l,maxZoom:_,nodeOrigin:v,nodeExtent:c,zIndexMode:m})=>zC((C,b)=>{async function x(){const{nodeLookup:f,panZoom:p,fitViewOptions:d,fitViewResolver:u,width:w,height:L,minZoom:R,maxZoom:D}=b();p&&(await BS({nodes:f,width:w,height:L,panZoom:p,minZoom:R,maxZoom:D},d),u==null||u.resolve(!0),C({fitViewResolver:null}))}return{...Qp({nodes:e,edges:r,width:h,height:S,fitView:y,fitViewOptions:a,minZoom:l,maxZoom:_,nodeOrigin:v,nodeExtent:c,defaultNodes:i,defaultEdges:o,zIndexMode:m}),setNodes:f=>{const{nodeLookup:p,parentLookup:d,nodeOrigin:u,elevateNodesOnSelect:w,fitViewQueued:L,zIndexMode:R,nodesSelectionActive:D}=b(),{nodesInitialized:k,hasSelectedNodes:M}=Du(f,p,d,{nodeOrigin:u,nodeExtent:c,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:R}),W=D&&M;L&&k?(x(),C({nodes:f,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:W})):C({nodes:f,nodesInitialized:k,nodesSelectionActive:W})},setEdges:f=>{const{connectionLookup:p,edgeLookup:d}=b();fg(p,d,f),C({edges:f})},setDefaultNodesAndEdges:(f,p)=>{if(f){const{setNodes:d}=b();d(f),C({hasDefaultNodes:!0})}if(p){const{setEdges:d}=b();d(p),C({hasDefaultEdges:!0})}},updateNodeInternals:f=>{const{triggerNodeChanges:p,nodeLookup:d,parentLookup:u,domNode:w,nodeOrigin:L,nodeExtent:R,debug:D,fitViewQueued:k,zIndexMode:M}=b(),{changes:W,updatedInternals:z}=sC(f,d,u,w,L,R,M);z&&(tC(d,u,{nodeOrigin:L,nodeExtent:R,zIndexMode:M}),k?(x(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(W==null?void 0:W.length)>0&&(D&&console.log("React Flow: trigger node changes",W),p==null||p(W)))},updateNodePositions:(f,p=!1)=>{const d=[];let u=[];const{nodeLookup:w,triggerNodeChanges:L,connection:R,updateConnection:D,onNodesChangeMiddlewareMap:k}=b();for(const[M,W]of f){const z=w.get(M),j=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(W!=null&&W.position)),N={id:M,type:"position",position:j?{x:Math.max(0,W.position.x),y:Math.max(0,W.position.y)}:W.position,dragging:p};if(z&&R.inProgress&&R.fromNode.id===z.id){const I=Ln(z,R.fromHandle,xe.Left,!0);D({...R,from:I})}j&&z.parentId&&d.push({id:M,parentId:z.parentId,rect:{...W.internals.positionAbsolute,width:W.measured.width??0,height:W.measured.height??0}}),u.push(N)}if(d.length>0){const{parentLookup:M,nodeOrigin:W}=b(),z=sh(d,w,M,W);u.push(...z)}for(const M of k.values())u=M(u);L(u)},triggerNodeChanges:f=>{const{onNodesChange:p,setNodes:d,nodes:u,hasDefaultNodes:w,debug:L}=b();if(f!=null&&f.length){if(w){const R=lx(f,u);d(R)}L&&console.log("React Flow: trigger node changes",f),p==null||p(f)}},triggerEdgeChanges:f=>{const{onEdgesChange:p,setEdges:d,edges:u,hasDefaultEdges:w,debug:L}=b();if(f!=null&&f.length){if(w){const R=cx(f,u);d(R)}L&&console.log("React Flow: trigger edge changes",f),p==null||p(f)}},addSelectedNodes:f=>{const{multiSelectionActive:p,edgeLookup:d,nodeLookup:u,triggerNodeChanges:w,triggerEdgeChanges:L}=b();if(p){const R=f.map(D=>wn(D,!0));w(R);return}w(oi(u,new Set([...f]),!0)),L(oi(d))},addSelectedEdges:f=>{const{multiSelectionActive:p,edgeLookup:d,nodeLookup:u,triggerNodeChanges:w,triggerEdgeChanges:L}=b();if(p){const R=f.map(D=>wn(D,!0));L(R);return}L(oi(d,new Set([...f]))),w(oi(u,new Set,!0))},unselectNodesAndEdges:({nodes:f,edges:p}={})=>{const{edges:d,nodes:u,nodeLookup:w,triggerNodeChanges:L,triggerEdgeChanges:R}=b(),D=f||u,k=p||d,M=[];for(const z of D){if(!z.selected)continue;const j=w.get(z.id);j&&(j.selected=!1),M.push(wn(z.id,!1))}const W=[];for(const z of k)z.selected&&W.push(wn(z.id,!1));L(M),R(W)},setMinZoom:f=>{const{panZoom:p,maxZoom:d}=b();p==null||p.setScaleExtent([f,d]),C({minZoom:f})},setMaxZoom:f=>{const{panZoom:p,minZoom:d}=b();p==null||p.setScaleExtent([d,f]),C({maxZoom:f})},setTranslateExtent:f=>{var p;(p=b().panZoom)==null||p.setTranslateExtent(f),C({translateExtent:f})},resetSelectedElements:()=>{const{edges:f,nodes:p,triggerNodeChanges:d,triggerEdgeChanges:u,elementsSelectable:w}=b();if(!w)return;const L=p.reduce((D,k)=>k.selected?[...D,wn(k.id,!1)]:D,[]),R=f.reduce((D,k)=>k.selected?[...D,wn(k.id,!1)]:D,[]);d(L),u(R)},setNodeExtent:f=>{const{nodes:p,nodeLookup:d,parentLookup:u,nodeOrigin:w,elevateNodesOnSelect:L,nodeExtent:R,zIndexMode:D}=b();f[0][0]===R[0][0]&&f[0][1]===R[0][1]&&f[1][0]===R[1][0]&&f[1][1]===R[1][1]||(Du(p,d,u,{nodeOrigin:w,nodeExtent:f,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:D}),C({nodeExtent:f}))},panBy:f=>{const{transform:p,width:d,height:u,panZoom:w,translateExtent:L}=b();return oC({delta:f,panZoom:w,transform:p,translateExtent:L,width:d,height:u})},setCenter:async(f,p,d)=>{const{width:u,height:w,maxZoom:L,panZoom:R}=b();if(!R)return Promise.resolve(!1);const D=typeof(d==null?void 0:d.zoom)<"u"?d.zoom:L;return await R.setViewport({x:u/2-f*D,y:w/2-p*D,zoom:D},{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...Y_}})},updateConnection:f=>{C({connection:f})},reset:()=>C({...Qp()})}},Object.is);function E2({initialNodes:e,initialEdges:r,defaultNodes:i,defaultEdges:o,initialWidth:h,initialHeight:S,initialMinZoom:y,initialMaxZoom:a,initialFitViewOptions:l,fitView:_,nodeOrigin:v,nodeExtent:c,zIndexMode:m,children:C}){const[b]=J.useState(()=>b2({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,width:h,height:S,fitView:_,minZoom:y,maxZoom:a,fitViewOptions:l,nodeOrigin:v,nodeExtent:c,zIndexMode:m}));return O.jsx($C,{value:b,children:O.jsx(dx,{children:C})})}function k2({children:e,nodes:r,edges:i,defaultNodes:o,defaultEdges:h,width:S,height:y,fitView:a,fitViewOptions:l,minZoom:_,maxZoom:v,nodeOrigin:c,nodeExtent:m,zIndexMode:C}){return J.useContext(Wa)?O.jsx(O.Fragment,{children:e}):O.jsx(E2,{initialNodes:r,initialEdges:i,defaultNodes:o,defaultEdges:h,initialWidth:S,initialHeight:y,fitView:a,initialFitViewOptions:l,initialMinZoom:_,initialMaxZoom:v,nodeOrigin:c,nodeExtent:m,zIndexMode:C,children:e})}const L2={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function R2({nodes:e,edges:r,defaultNodes:i,defaultEdges:o,className:h,nodeTypes:S,edgeTypes:y,onNodeClick:a,onEdgeClick:l,onInit:_,onMove:v,onMoveStart:c,onMoveEnd:m,onConnect:C,onConnectStart:b,onConnectEnd:x,onClickConnectStart:f,onClickConnectEnd:p,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:R,onNodeDragStart:D,onNodeDrag:k,onNodeDragStop:M,onNodesDelete:W,onEdgesDelete:z,onDelete:j,onSelectionChange:N,onSelectionDragStart:I,onSelectionDrag:q,onSelectionDragStop:U,onSelectionContextMenu:K,onSelectionStart:V,onSelectionEnd:T,onBeforeDelete:B,connectionMode:P,connectionLineType:F=Zr.Bezier,connectionLineStyle:G,connectionLineComponent:Z,connectionLineContainerStyle:ie,deleteKeyCode:ae="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:H=!1,selectionMode:re=Cs.Full,panActivationKeyCode:te="Space",multiSelectionKeyCode:ce=bs()?"Meta":"Control",zoomActivationKeyCode:le=bs()?"Meta":"Control",snapToGrid:pe,snapGrid:Se,onlyRenderVisibleElements:be=!1,selectNodesOnDrag:ue,nodesDraggable:ge,autoPanOnNodeFocus:Re,nodesConnectable:Ie,nodesFocusable:ze,nodeOrigin:Qe=kg,edgesFocusable:ut,edgesReconnectable:qe,elementsSelectable:pt=!0,defaultViewport:Ne=tx,minZoom:Je=.5,maxZoom:ht=2,translateExtent:$e=Ss,preventScrolling:pr=!0,nodeExtent:ot,defaultMarkerColor:Rt="#b1b1b7",zoomOnScroll:Oe=!0,zoomOnPinch:Rn=!0,panOnScroll:Ps=!1,panOnScrollSpeed:Ka=.5,panOnScrollMode:vi=xn.Free,zoomOnDoubleClick:yi=!0,panOnDrag:wi=!0,onPaneClick:Si,onPaneMouseEnter:Ci,onPaneMouseMove:Dr,onPaneMouseLeave:Ar,onPaneScroll:Ns,onPaneContextMenu:Bs,paneClickDistance:Is=1,nodeClickDistance:Os=0,children:Hs,onReconnect:xi,onReconnectStart:Fs,onReconnectEnd:rn,onEdgeContextMenu:bi,onEdgeDoubleClick:nn,onEdgeMouseEnter:Xa,onEdgeMouseMove:sn,onEdgeMouseLeave:Dn,reconnectRadius:An=10,onNodesChange:Ei,onEdgesChange:Ya,noDragClassName:Ga="nodrag",noWheelClassName:Qa="nowheel",noPanClassName:rr="nopan",fitView:ki,fitViewOptions:Li,connectOnClick:Ja,attributionPosition:js,proOptions:zs,defaultEdgeOptions:$s,elevateNodesOnSelect:Ws=!0,elevateEdgesOnSelect:Za=!1,disableKeyboardA11y:Us=!1,autoPanOnConnect:Ke,autoPanOnNodeDrag:el,autoPanSpeed:Ri,connectionRadius:Vs,isValidConnection:Tn,onError:tl,style:qs,id:on,nodeDragThreshold:It,connectionDragThreshold:rl,viewport:Dt,onViewportChange:nl,width:il,height:sl,colorMode:Mn="light",debug:Pn,onScroll:nr,ariaLabelConfig:Nn,zIndexMode:Ks="basic",...ol},Di){const Bn=on||"1",Ai=sx(Mn),an=J.useCallback(Xs=>{Xs.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),nr==null||nr(Xs)},[nr]);return O.jsx("div",{"data-testid":"rf__wrapper",...ol,onScroll:an,style:{...qs,...L2},ref:Di,className:rt(["react-flow",h,Ai]),id:on,role:"application",children:O.jsxs(k2,{nodes:e,edges:r,width:il,height:sl,fitView:ki,fitViewOptions:Li,minZoom:Je,maxZoom:ht,nodeOrigin:Qe,nodeExtent:ot,zIndexMode:Ks,children:[O.jsx(ix,{nodes:e,edges:r,defaultNodes:i,defaultEdges:o,onConnect:C,onConnectStart:b,onConnectEnd:x,onClickConnectStart:f,onClickConnectEnd:p,nodesDraggable:ge,autoPanOnNodeFocus:Re,nodesConnectable:Ie,nodesFocusable:ze,edgesFocusable:ut,edgesReconnectable:qe,elementsSelectable:pt,elevateNodesOnSelect:Ws,elevateEdgesOnSelect:Za,minZoom:Je,maxZoom:ht,nodeExtent:ot,onNodesChange:Ei,onEdgesChange:Ya,snapToGrid:pe,snapGrid:Se,connectionMode:P,translateExtent:$e,connectOnClick:Ja,defaultEdgeOptions:$s,fitView:ki,fitViewOptions:Li,onNodesDelete:W,onEdgesDelete:z,onDelete:j,onNodeDragStart:D,onNodeDrag:k,onNodeDragStop:M,onSelectionDrag:q,onSelectionDragStart:I,onSelectionDragStop:U,onMove:v,onMoveStart:c,onMoveEnd:m,noPanClassName:rr,nodeOrigin:Qe,rfId:Bn,autoPanOnConnect:Ke,autoPanOnNodeDrag:el,autoPanSpeed:Ri,onError:tl,connectionRadius:Vs,isValidConnection:Tn,selectNodesOnDrag:ue,nodeDragThreshold:It,connectionDragThreshold:rl,onBeforeDelete:B,debug:Pn,ariaLabelConfig:Nn,zIndexMode:Ks}),O.jsx(x2,{onInit:_,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:d,onNodeMouseMove:u,onNodeMouseLeave:w,onNodeContextMenu:L,onNodeDoubleClick:R,nodeTypes:S,edgeTypes:y,connectionLineType:F,connectionLineStyle:G,connectionLineComponent:Z,connectionLineContainerStyle:ie,selectionKeyCode:X,selectionOnDrag:H,selectionMode:re,deleteKeyCode:ae,multiSelectionKeyCode:ce,panActivationKeyCode:te,zoomActivationKeyCode:le,onlyRenderVisibleElements:be,defaultViewport:Ne,translateExtent:$e,minZoom:Je,maxZoom:ht,preventScrolling:pr,zoomOnScroll:Oe,zoomOnPinch:Rn,zoomOnDoubleClick:yi,panOnScroll:Ps,panOnScrollSpeed:Ka,panOnScrollMode:vi,panOnDrag:wi,onPaneClick:Si,onPaneMouseEnter:Ci,onPaneMouseMove:Dr,onPaneMouseLeave:Ar,onPaneScroll:Ns,onPaneContextMenu:Bs,paneClickDistance:Is,nodeClickDistance:Os,onSelectionContextMenu:K,onSelectionStart:V,onSelectionEnd:T,onReconnect:xi,onReconnectStart:Fs,onReconnectEnd:rn,onEdgeContextMenu:bi,onEdgeDoubleClick:nn,onEdgeMouseEnter:Xa,onEdgeMouseMove:sn,onEdgeMouseLeave:Dn,reconnectRadius:An,defaultMarkerColor:Rt,noDragClassName:Ga,noWheelClassName:Qa,noPanClassName:rr,rfId:Bn,disableKeyboardA11y:Us,nodeExtent:ot,viewport:Dt,onViewportChange:nl}),O.jsx(ex,{onSelectionChange:N}),Hs,O.jsx(YC,{proOptions:zs,position:js}),O.jsx(XC,{rfId:Bn,disableKeyboardA11y:Us})]})})}var D2=Rg(R2);function A2({dimensions:e,lineWidth:r,variant:i,className:o}){return O.jsx("path",{strokeWidth:r,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:rt(["react-flow__background-pattern",i,o])})}function T2({radius:e,className:r}){return O.jsx("circle",{cx:e,cy:e,r:e,className:rt(["react-flow__background-pattern","dots",r])})}var tn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(tn||(tn={}));const M2={[tn.Dots]:1,[tn.Lines]:1,[tn.Cross]:6},P2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Jg({id:e,variant:r=tn.Dots,gap:i=20,size:o,lineWidth:h=1,offset:S=0,color:y,bgColor:a,style:l,className:_,patternClassName:v}){const c=J.useRef(null),{transform:m,patternId:C}=Te(P2,Ue),b=o||M2[r],x=r===tn.Dots,f=r===tn.Cross,p=Array.isArray(i)?i:[i,i],d=[p[0]*m[2]||1,p[1]*m[2]||1],u=b*m[2],w=Array.isArray(S)?S:[S,S],L=f?[u,u]:d,R=[w[0]*m[2]||1+L[0]/2,w[1]*m[2]||1+L[1]/2],D=`${C}${e||""}`;return O.jsxs("svg",{className:rt(["react-flow__background",_]),style:{...l,...Va,"--xy-background-color-props":a,"--xy-background-pattern-color-props":y},ref:c,"data-testid":"rf__background",children:[O.jsx("pattern",{id:D,x:m[0]%d[0],y:m[1]%d[1],width:d[0],height:d[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:x?O.jsx(T2,{radius:u/2,className:v}):O.jsx(A2,{dimensions:L,lineWidth:h,variant:r,className:v})}),O.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}Jg.displayName="Background";const N2=J.memo(Jg);function B2(){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:O.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function I2(){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:O.jsx("path",{d:"M0 0h32v4.2H0z"})})}function O2(){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:O.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 H2(){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:O.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 F2(){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:O.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 aa({children:e,className:r,...i}){return O.jsx("button",{type:"button",className:rt(["react-flow__controls-button",r]),...i,children:e})}const j2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Zg({style:e,showZoom:r=!0,showFitView:i=!0,showInteractive:o=!0,fitViewOptions:h,onZoomIn:S,onZoomOut:y,onFitView:a,onInteractiveChange:l,className:_,children:v,position:c="bottom-left",orientation:m="vertical","aria-label":C}){const b=Ve(),{isInteractive:x,minZoomReached:f,maxZoomReached:p,ariaLabelConfig:d}=Te(j2,Ue),{zoomIn:u,zoomOut:w,fitView:L}=oh(),R=()=>{u(),S==null||S()},D=()=>{w(),y==null||y()},k=()=>{L(h),a==null||a()},M=()=>{b.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),l==null||l(!x)},W=m==="horizontal"?"horizontal":"vertical";return O.jsxs(Ua,{className:rt(["react-flow__controls",W,_]),position:c,style:e,"data-testid":"rf__controls","aria-label":C??d["controls.ariaLabel"],children:[r&&O.jsxs(O.Fragment,{children:[O.jsx(aa,{onClick:R,className:"react-flow__controls-zoomin",title:d["controls.zoomIn.ariaLabel"],"aria-label":d["controls.zoomIn.ariaLabel"],disabled:p,children:O.jsx(B2,{})}),O.jsx(aa,{onClick:D,className:"react-flow__controls-zoomout",title:d["controls.zoomOut.ariaLabel"],"aria-label":d["controls.zoomOut.ariaLabel"],disabled:f,children:O.jsx(I2,{})})]}),i&&O.jsx(aa,{className:"react-flow__controls-fitview",onClick:k,title:d["controls.fitView.ariaLabel"],"aria-label":d["controls.fitView.ariaLabel"],children:O.jsx(O2,{})}),o&&O.jsx(aa,{className:"react-flow__controls-interactive",onClick:M,title:d["controls.interactive.ariaLabel"],"aria-label":d["controls.interactive.ariaLabel"],children:x?O.jsx(F2,{}):O.jsx(H2,{})}),v]})}Zg.displayName="Controls";const z2=J.memo(Zg);function $2({id:e,x:r,y:i,width:o,height:h,style:S,color:y,strokeColor:a,strokeWidth:l,className:_,borderRadius:v,shapeRendering:c,selected:m,onClick:C}){const{background:b,backgroundColor:x}=S||{},f=y||b||x;return O.jsx("rect",{className:rt(["react-flow__minimap-node",{selected:m},_]),x:r,y:i,rx:v,ry:v,width:o,height:h,style:{fill:f,stroke:a,strokeWidth:l},shapeRendering:c,onClick:C?p=>C(p,e):void 0})}const W2=J.memo($2),U2=e=>e.nodes.map(r=>r.id),iu=e=>e instanceof Function?e:()=>e;function V2({nodeStrokeColor:e,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:h,nodeComponent:S=W2,onClick:y}){const a=Te(U2,Ue),l=iu(r),_=iu(e),v=iu(i),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return O.jsx(O.Fragment,{children:a.map(m=>O.jsx(K2,{id:m,nodeColorFunc:l,nodeStrokeColorFunc:_,nodeClassNameFunc:v,nodeBorderRadius:o,nodeStrokeWidth:h,NodeComponent:S,onClick:y,shapeRendering:c},m))})}function q2({id:e,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:o,nodeBorderRadius:h,nodeStrokeWidth:S,shapeRendering:y,NodeComponent:a,onClick:l}){const{node:_,x:v,y:c,width:m,height:C}=Te(b=>{const x=b.nodeLookup.get(e);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const f=x.internals.userNode,{x:p,y:d}=x.internals.positionAbsolute,{width:u,height:w}=Rr(f);return{node:f,x:p,y:d,width:u,height:w}},Ue);return!_||_.hidden||!rg(_)?null:O.jsx(a,{x:v,y:c,width:m,height:C,style:_.style,selected:!!_.selected,className:o(_),color:r(_),borderRadius:h,strokeColor:i(_),strokeWidth:S,shapeRendering:y,onClick:l,id:_.id})}const K2=J.memo(q2);var X2=J.memo(V2);const Y2=200,G2=150,Q2=e=>!e.hidden,J2=e=>{const r={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:r,boundingRect:e.nodeLookup.size>0?tg(As(e.nodeLookup,{filter:Q2}),r):r,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Z2="react-flow__minimap-desc";function em({style:e,className:r,nodeStrokeColor:i,nodeColor:o,nodeClassName:h="",nodeBorderRadius:S=5,nodeStrokeWidth:y,nodeComponent:a,bgColor:l,maskColor:_,maskStrokeColor:v,maskStrokeWidth:c,position:m="bottom-right",onClick:C,onNodeClick:b,pannable:x=!1,zoomable:f=!1,ariaLabel:p,inversePan:d,zoomStep:u=1,offsetScale:w=5}){const L=Ve(),R=J.useRef(null),{boundingRect:D,viewBB:k,rfId:M,panZoom:W,translateExtent:z,flowWidth:j,flowHeight:N,ariaLabelConfig:I}=Te(J2,Ue),q=(e==null?void 0:e.width)??Y2,U=(e==null?void 0:e.height)??G2,K=D.width/q,V=D.height/U,T=Math.max(K,V),B=T*q,P=T*U,F=w*T,G=D.x-(B-D.width)/2-F,Z=D.y-(P-D.height)/2-F,ie=B+F*2,ae=P+F*2,X=`${Z2}-${M}`,H=J.useRef(0),re=J.useRef();H.current=T,J.useEffect(()=>{if(R.current&&W)return re.current=_C({domNode:R.current,panZoom:W,getTransform:()=>L.getState().transform,getViewScale:()=>H.current}),()=>{var pe;(pe=re.current)==null||pe.destroy()}},[W]),J.useEffect(()=>{var pe;(pe=re.current)==null||pe.update({translateExtent:z,width:j,height:N,inversePan:d,pannable:x,zoomStep:u,zoomable:f})},[x,f,d,u,z,j,N]);const te=C?pe=>{var ue;const[Se,be]=((ue=re.current)==null?void 0:ue.pointer(pe))||[0,0];C(pe,{x:Se,y:be})}:void 0,ce=b?J.useCallback((pe,Se)=>{const be=L.getState().nodeLookup.get(Se).internals.userNode;b(pe,be)},[]):void 0,le=p??I["minimap.ariaLabel"];return O.jsx(Ua,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*T:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof y=="number"?y:void 0},className:rt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:O.jsxs("svg",{width:q,height:U,viewBox:`${G} ${Z} ${ie} ${ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:R,onClick:te,children:[le&&O.jsx("title",{id:X,children:le}),O.jsx(X2,{onClick:ce,nodeColor:o,nodeStrokeColor:i,nodeBorderRadius:S,nodeClassName:h,nodeStrokeWidth:y,nodeComponent:a}),O.jsx("path",{className:"react-flow__minimap-mask",d:`M${G-F},${Z-F}h${ie+F*2}v${ae+F*2}h${-ie-F*2}z
|
|
62
62
|
M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}em.displayName="MiniMap";J.memo(em);const eb=e=>r=>e?`${Math.max(1/r.transform[2],1)}`:void 0,tb={[_i.Line]:"right",[_i.Handle]:"bottom-right"};function rb({nodeId:e,position:r,variant:i=_i.Handle,className:o,style:h=void 0,children:S,color:y,minWidth:a=10,minHeight:l=10,maxWidth:_=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:m,autoScale:C=!0,shouldResize:b,onResizeStart:x,onResize:f,onResizeEnd:p}){const d=Mg(),u=typeof e=="string"?e:d,w=Ve(),L=J.useRef(null),R=i===_i.Handle,D=Te(J.useCallback(eb(R&&C),[R,C]),Ue),k=J.useRef(null),M=r??tb[i];J.useEffect(()=>{if(!(!L.current||!u))return k.current||(k.current=DC({domNode:L.current,nodeId:u,getStoreItems:()=>{const{nodeLookup:z,transform:j,snapGrid:N,snapToGrid:I,nodeOrigin:q,domNode:U}=w.getState();return{nodeLookup:z,transform:j,snapGrid:N,snapToGrid:I,nodeOrigin:q,paneDomNode:U}},onChange:(z,j)=>{const{triggerNodeChanges:N,nodeLookup:I,parentLookup:q,nodeOrigin:U}=w.getState(),K=[],V={x:z.x,y:z.y},T=I.get(u);if(T&&T.expandParent&&T.parentId){const B=T.origin??U,P=z.width??T.measured.width??0,F=z.height??T.measured.height??0,G={id:T.id,parentId:T.parentId,rect:{width:P,height:F,...ng({x:z.x??T.position.x,y:z.y??T.position.y},{width:P,height:F},T.parentId,I,B)}},Z=sh([G],I,q,U);K.push(...Z),V.x=z.x?Math.max(B[0]*P,z.x):void 0,V.y=z.y?Math.max(B[1]*F,z.y):void 0}if(V.x!==void 0&&V.y!==void 0){const B={id:u,type:"position",position:{...V}};K.push(B)}if(z.width!==void 0&&z.height!==void 0){const P={id:u,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};K.push(P)}for(const B of j){const P={...B,type:"position"};K.push(P)}N(K)},onEnd:({width:z,height:j})=>{const N={id:u,type:"dimensions",resizing:!1,dimensions:{width:z,height:j}};w.getState().triggerNodeChanges([N])}})),k.current.update({controlPosition:M,boundaries:{minWidth:a,minHeight:l,maxWidth:_,maxHeight:v},keepAspectRatio:c,resizeDirection:m,onResizeStart:x,onResize:f,onResizeEnd:p,shouldResize:b}),()=>{var z;(z=k.current)==null||z.destroy()}},[M,a,l,_,v,c,x,f,p,b]);const W=M.split("-");return O.jsx("div",{className:rt(["react-flow__resize-control","nodrag",...W,i,o]),ref:L,style:{...h,scale:D,...y&&{[R?"backgroundColor":"borderColor"]:y}},children:S})}J.memo(rb);const nb={running:"#4ade80",starting:"#fbbf24",idle:"#fbbf24",done:"#555",dead:"#f87171"};function ib({data:e}){const r=e,i=nb[r.status]||"#555",o=r.status==="running"||r.status==="starting";return O.jsxs("div",{style:{background:"#0a0a0a",border:`1px solid ${o?"#333":"#1e1e1e"}`,borderRadius:8,padding:"12px 16px",minWidth:160,position:"relative",transition:"border-color 180ms ease"},children:[O.jsx(gi,{type:"target",position:xe.Left,style:{background:"#333",border:"none",width:6,height:6}}),O.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:5},children:[O.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:i,boxShadow:o?`0 0 6px ${i}40`:"none"}}),O.jsx("span",{style:{fontSize:13,fontWeight:500,color:"#e8e8e8",fontFamily:"'DM Sans', sans-serif"},children:r.label}),r.service&&r.service!=="claude"&&O.jsx("span",{style:{fontSize:9,fontWeight:600,color:r.service==="codex"?"#10b981":"#888",background:r.service==="codex"?"#10b98118":"#88888818",padding:"1px 5px",borderRadius:4,fontFamily:"'JetBrains Mono', monospace",textTransform:"uppercase",letterSpacing:"0.5px"},children:r.service})]}),O.jsx("div",{style:{fontSize:11,color:"#555",maxWidth:180,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"'DM Sans', sans-serif",lineHeight:1.4},children:r.task}),r.messageCount&&r.messageCount>0&&O.jsxs("div",{title:`${r.messageCount} message${r.messageCount>1?"s":""} received`,style:{position:"absolute",top:-6,right:-6,background:"#4ade80",color:"#000",borderRadius:8,padding:"2px 5px",display:"flex",alignItems:"center",justifyContent:"center",gap:2,fontSize:9,fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:"default"},children:[O.jsx("span",{style:{fontSize:8},children:"✉"}),r.messageCount]}),O.jsx(gi,{type:"source",position:xe.Right,style:{background:"#333",border:"none",width:6,height:6}})]})}const sb={agent:ib};function ob({agents:e,messages:r,onSelectAgent:i}){const[o,h]=J.useState([]),S=J.useMemo(()=>{const _={};for(const v of r)v.to_agent&&v.to_agent!=="all"&&(_[v.to_agent]=(_[v.to_agent]||0)+1);return _},[r]),y=J.useMemo(()=>{const _=new Map,v=new Set(e.map(c=>c.id));for(const c of r){if(!v.has(c.from_agent)||!v.has(c.to_agent)||c.to_agent==="all")continue;const m=[c.from_agent,c.to_agent].sort().join("|");_.set(m,(_.get(m)||0)+1)}return Array.from(_.entries()).map(([c,m])=>{const[C,b]=c.split("|");return{id:`collab-${c}`,source:C,target:b,style:{stroke:"#333",strokeWidth:Math.min(1+m*.3,3)},label:`${m}`,labelStyle:{fill:"#666",fontSize:9},labelBgStyle:{fill:"#0a0a0a",fillOpacity:.9},labelBgPadding:[4,2]}})},[e,r]),a=J.useMemo(()=>{const _=Math.max(Math.ceil(Math.sqrt(e.length)),1);return e.map((v,c)=>({id:v.id,type:"agent",position:{x:80+c%_*240,y:80+Math.floor(c/_)*130},data:{label:v.name,status:v.status,task:v.task||"",service:v.service||"claude",messageCount:S[v.id]||0}}))},[e,S]);J.useEffect(()=>{if(r.length===0)return;const _=r[0];if(!_)return;const v=new Set(e.map(b=>b.id));if(!v.has(_.from_agent)||!v.has(_.to_agent))return;const c=`msg-${_.id}`,m={id:c,source:_.from_agent,target:_.to_agent,animated:!0,style:{stroke:"#4ade80",strokeWidth:1.5}};h(b=>[...b,m]);const C=setTimeout(()=>{h(b=>b.filter(x=>x.id!==c))},3e3);return()=>clearTimeout(C)},[r,e]);const l=J.useCallback((_,v)=>{const c=e.find(m=>m.id===v.id);c&&i(c)},[e,i]);return O.jsx("div",{style:{width:"100%",height:"100%"},children:O.jsxs(D2,{nodes:a,edges:[...y,...o],nodeTypes:sb,onNodeClick:l,fitView:!0,proOptions:{hideAttribution:!0},children:[O.jsx(N2,{color:"#1a1a1a",gap:24,size:1}),O.jsx(z2,{style:{background:"#0a0a0a",border:"1px solid #1e1e1e",borderRadius:6}})]})})}var su={exports:{}},Jp;function ab(){return Jp||(Jp=1,(function(e,r){(function(i,o){e.exports=o()})(globalThis,(()=>(()=>{var i={4567:function(y,a,l){var _=this&&this.__decorate||function(d,u,w,L){var R,D=arguments.length,k=D<3?u:L===null?L=Object.getOwnPropertyDescriptor(u,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,u,w,L);else for(var M=d.length-1;M>=0;M--)(R=d[M])&&(k=(D<3?R(k):D>3?R(u,w,k):R(u,w))||k);return D>3&&k&&Object.defineProperty(u,w,k),k},v=this&&this.__param||function(d,u){return function(w,L){u(w,L,d)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const c=l(9042),m=l(9924),C=l(844),b=l(4725),x=l(2585),f=l(3656);let p=a.AccessibilityManager=class extends C.Disposable{constructor(d,u,w,L){super(),this._terminal=d,this._coreBrowserService=w,this._renderService=L,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
63
63
|
`)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,f.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(d){for(let u=0;u<d;u++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
|
64
64
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=c.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,u){this._liveRegionDebouncer.refresh(d,u,this._terminal.rows)}_renderRows(d,u){const w=this._terminal.buffer,L=w.lines.length.toString();for(let R=d;R<=u;R++){const D=w.lines.get(w.ydisp+R),k=[],M=(D==null?void 0:D.translateToString(!0,void 0,void 0,k))||"",W=(w.ydisp+R+1).toString(),z=this._rowElements[R];z&&(M.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=M,this._rowColumns.set(z,k)),z.setAttribute("aria-posinset",W),z.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,u){const w=d.target,L=this._rowElements[u===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(u===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==L)return;let R,D;if(u===0?(R=w,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=w,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),u===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(u===0?-1:1),this._rowElements[u===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let u={node:d.anchorNode,offset:d.anchorOffset},w={node:d.focusNode,offset:d.focusOffset};if((u.node.compareDocumentPosition(w.node)&Node.DOCUMENT_POSITION_PRECEDING||u.node===w.node&&u.offset>w.offset)&&([u,w]=[w,u]),u.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(u={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(u.node))return;const L=this._rowElements.slice(-1)[0];if(w.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(w={node:L,offset:((M=L.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(w.node))return;const R=({node:W,offset:z})=>{const j=W instanceof Text?W.parentNode:W;let N=parseInt(j==null?void 0:j.getAttribute("aria-posinset"),10)-1;if(isNaN(N))return console.warn("row is invalid. Race condition?"),null;const I=this._rowColumns.get(j);if(!I)return console.warn("columns is null. Race condition?"),null;let q=z<I.length?I[z]:I.slice(-1)[0]+1;return q>=this._terminal.cols&&(++N,q=0),{row:N,column:q}},D=R(u),k=R(w);if(D&&k){if(D.row>k.row||D.row===k.row&&D.column>=k.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(k.row-D.row)*this._terminal.cols-D.column+k.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let u=this._rowContainer.children.length;u<this._terminal.rows;u++)this._rowElements[u]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[u]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=p=_([v(1,x.IInstantiationService),v(2,b.ICoreBrowserService),v(3,b.IRenderService)],p)},3614:(y,a)=>{function l(m){return m.replace(/\r?\n/g,"\r")}function _(m,C){return C?"\x1B[200~"+m+"\x1B[201~":m}function v(m,C,b,x){m=_(m=l(m),b.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),b.triggerDataEvent(m,!0),C.value=""}function c(m,C,b){const x=b.getBoundingClientRect(),f=m.clientX-x.left-10,p=m.clientY-x.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${f}px`,C.style.top=`${p}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=l,a.bracketTextForPaste=_,a.copyHandler=function(m,C){m.clipboardData&&m.clipboardData.setData("text/plain",C.selectionText),m.preventDefault()},a.handlePasteEvent=function(m,C,b,x){m.stopPropagation(),m.clipboardData&&v(m.clipboardData.getData("text/plain"),C,b,x)},a.paste=v,a.moveTextAreaUnderMouseCursor=c,a.rightClickHandler=function(m,C,b,x,f){c(m,C,b),f&&x.rightClickSelect(m),C.value=x.selectionText,C.select()}},7239:(y,a,l)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const _=l(1505);a.ColorContrastCache=class{constructor(){this._color=new _.TwoKeyMap,this._css=new _.TwoKeyMap}setCss(v,c,m){this._css.set(v,c,m)}getCss(v,c){return this._css.get(v,c)}setColor(v,c,m){this._color.set(v,c,m)}getColor(v,c){return this._color.get(v,c)}clear(){this._color.clear(),this._css.clear()}}},3656:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(l,_,v,c){l.addEventListener(_,v,c);let m=!1;return{dispose:()=>{m||(m=!0,l.removeEventListener(_,v,c))}}}},3551:function(y,a,l){var _=this&&this.__decorate||function(p,d,u,w){var L,R=arguments.length,D=R<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,u):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(p,d,u,w);else for(var k=p.length-1;k>=0;k--)(L=p[k])&&(D=(R<3?L(D):R>3?L(d,u,D):L(d,u))||D);return R>3&&D&&Object.defineProperty(d,u,D),D},v=this&&this.__param||function(p,d){return function(u,w){d(u,w,p)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const c=l(3656),m=l(8460),C=l(844),b=l(2585),x=l(4725);let f=a.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(p,d,u,w,L){super(),this._element=p,this._mouseService=d,this._renderService=u,this._bufferService=w,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,c.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,c.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){this._lastMouseEvent=p;const d=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const u=p.composedPath();for(let w=0;w<u.length;w++){const L=u[w];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,d){var w,L;this._activeProviderReplies&&d||((w=this._activeProviderReplies)==null||w.forEach((R=>{R==null||R.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let u=!1;for(const[R,D]of this._linkProviderService.linkProviders.entries())d?(L=this._activeProviderReplies)!=null&&L.get(R)&&(u=this._checkLinkProviderResult(R,p,u)):D.provideLinks(p.y,(k=>{var W,z;if(this._isMouseOut)return;const M=k==null?void 0:k.map((j=>({link:j})));(W=this._activeProviderReplies)==null||W.set(R,M),u=this._checkLinkProviderResult(R,p,u),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,d){const u=new Set;for(let w=0;w<d.size;w++){const L=d.get(w);if(L)for(let R=0;R<L.length;R++){const D=L[R],k=D.link.range.start.y<p?0:D.link.range.start.x,M=D.link.range.end.y>p?this._bufferService.cols:D.link.range.end.x;for(let W=k;W<=M;W++){if(u.has(W)){L.splice(R--,1);break}u.add(W)}}}}_checkLinkProviderResult(p,d,u){var R;if(!this._activeProviderReplies)return u;const w=this._activeProviderReplies.get(p);let L=!1;for(let D=0;D<p;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(L=!0);if(!L&&w){const D=w.find((k=>this._linkAtPosition(k.link,d)));D&&(u=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!u)for(let D=0;D<this._activeProviderReplies.size;D++){const k=(R=this._activeProviderReplies.get(D))==null?void 0:R.find((M=>this._linkAtPosition(M.link,d)));if(k){u=!0,this._handleNewLink(k);break}}return u}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._currentLink)return;const d=this._positionFromMouseEvent(p,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,d){this._currentLink&&this._lastMouseEvent&&(!p||!d||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(p.link,d)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>{var u,w;return(w=(u=this._currentLink)==null?void 0:u.state)==null?void 0:w.decorations.pointerCursor},set:u=>{var w;(w=this._currentLink)!=null&&w.state&&this._currentLink.state.decorations.pointerCursor!==u&&(this._currentLink.state.decorations.pointerCursor=u,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",u))}},underline:{get:()=>{var u,w;return(w=(u=this._currentLink)==null?void 0:u.state)==null?void 0:w.decorations.underline},set:u=>{var w,L,R;(w=this._currentLink)!=null&&w.state&&((R=(L=this._currentLink)==null?void 0:L.state)==null?void 0:R.decorations.underline)!==u&&(this._currentLink.state.decorations.underline=u,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,u))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((u=>{if(!this._currentLink)return;const w=u.start===0?0:u.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+u.end;if(this._currentLink.link.range.start.y>=w&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(w,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(p,d,u){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(u,d.text)}_fireUnderlineEvent(p,d){const u=p.range,w=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(u.start.x-1,u.start.y-w-1,u.end.x,u.end.y-w-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(p,d,u){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(u,d.text)}_linkAtPosition(p,d){const u=p.range.start.y*this._bufferService.cols+p.range.start.x,w=p.range.end.y*this._bufferService.cols+p.range.end.x,L=d.y*this._bufferService.cols+d.x;return u<=L&&L<=w}_positionFromMouseEvent(p,d,u){const w=u.getCoords(p,d,this._bufferService.cols,this._bufferService.rows);if(w)return{x:w[0],y:w[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,d,u,w,L){return{x1:p,y1:d,x2:u,y2:w,cols:this._bufferService.cols,fg:L}}};a.Linkifier=f=_([v(1,x.IMouseService),v(2,x.IRenderService),v(3,b.IBufferService),v(4,x.ILinkProviderService)],f)},9042:(y,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(y,a,l){var _=this&&this.__decorate||function(x,f,p,d){var u,w=arguments.length,L=w<3?f:d===null?d=Object.getOwnPropertyDescriptor(f,p):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,f,p,d);else for(var R=x.length-1;R>=0;R--)(u=x[R])&&(L=(w<3?u(L):w>3?u(f,p,L):u(f,p))||L);return w>3&&L&&Object.defineProperty(f,p,L),L},v=this&&this.__param||function(x,f){return function(p,d){f(p,d,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const c=l(511),m=l(2585);let C=a.OscLinkProvider=class{constructor(x,f,p){this._bufferService=x,this._optionsService=f,this._oscLinkService=p}provideLinks(x,f){var M;const p=this._bufferService.buffer.lines.get(x-1);if(!p)return void f(void 0);const d=[],u=this._optionsService.rawOptions.linkHandler,w=new c.CellData,L=p.getTrimmedLength();let R=-1,D=-1,k=!1;for(let W=0;W<L;W++)if(D!==-1||p.hasContent(W)){if(p.loadCell(W,w),w.hasExtendedAttrs()&&w.extended.urlId){if(D===-1){D=W,R=w.extended.urlId;continue}k=w.extended.urlId!==R}else D!==-1&&(k=!0);if(k||D!==-1&&W===L-1){const z=(M=this._oscLinkService.getLinkData(R))==null?void 0:M.uri;if(z){const j={start:{x:D+1,y:x},end:{x:W+(k||W!==L-1?0:1),y:x}};let N=!1;if(!(u!=null&&u.allowNonHttpProtocols))try{const I=new URL(z);["http:","https:"].includes(I.protocol)||(N=!0)}catch{N=!0}N||d.push({text:z,range:j,activate:(I,q)=>u?u.activate(I,q,j):b(0,q),hover:(I,q)=>{var U;return(U=u==null?void 0:u.hover)==null?void 0:U.call(u,I,q,j)},leave:(I,q)=>{var U;return(U=u==null?void 0:u.leave)==null?void 0:U.call(u,I,q,j)}})}k=!1,w.hasExtendedAttrs()&&w.extended.urlId?(D=W,R=w.extended.urlId):(D=-1,R=-1)}}f(d)}};function b(x,f){if(confirm(`Do you want to navigate to ${f}?
|
|
@@ -82,9 +82,9 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
82
82
|
|
|
83
83
|
`+e.stack):new Error(e.message+`
|
|
84
84
|
|
|
85
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},fb=new db;function lu(e){pb(e)||fb.onUnexpectedError(e)}var Pu="Canceled";function pb(e){return e instanceof _b?!0:e instanceof Error&&e.name===Pu&&e.message===Pu}var _b=class extends Error{constructor(){super(Pu),this.name=this.message}},e_=class Nu extends Error{constructor(r){super(r),this.name="CodeExpectedError"}static fromError(r){if(r instanceof Nu)return r;let i=new Nu;return i.message=r.message,i.stack=r.stack,i}static isErrorNoTelemetry(r){return r.name==="CodeExpectedError"}};function gb(e,r){let i=this,o=!1,h;return function(){return o||(o=!0,r||(h=e.apply(i,arguments))),h}}var mb;(e=>{function r(S){return S<0}e.isLessThan=r;function i(S){return S<=0}e.isLessThanOrEqual=i;function o(S){return S>0}e.isGreaterThan=o;function h(S){return S===0}e.isNeitherLessOrGreaterThan=h,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(mb||(mb={}));var im;(e=>{function r(w){return w&&typeof w=="object"&&typeof w[Symbol.iterator]=="function"}e.is=r;let i=Object.freeze([]);function o(){return i}e.empty=o;function*h(w){yield w}e.single=h;function S(w){return r(w)?w:h(w)}e.wrap=S;function y(w){return w||i}e.from=y;function*a(w){for(let L=w.length-1;L>=0;L--)yield w[L]}e.reverse=a;function l(w){return!w||w[Symbol.iterator]().next().done===!0}e.isEmpty=l;function _(w){return w[Symbol.iterator]().next().value}e.first=_;function v(w,L){let R=0;for(let D of w)if(L(D,R++))return!0;return!1}e.some=v;function c(w,L){for(let R of w)if(L(R))return R}e.find=c;function*m(w,L){for(let R of w)L(R)&&(yield R)}e.filter=m;function*C(w,L){let R=0;for(let D of w)yield L(D,R++)}e.map=C;function*b(w,L){let R=0;for(let D of w)yield*L(D,R++)}e.flatMap=b;function*x(...w){for(let L of w)yield*L}e.concat=x;function f(w,L,R){let D=R;for(let k of w)D=L(D,k);return D}e.reduce=f;function*p(w,L,R=w.length){for(L<0&&(L+=w.length),R<0?R+=w.length:R>w.length&&(R=w.length);L<R;L++)yield w[L]}e.slice=p;function d(w,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,w];let D=w[Symbol.iterator]();for(let k=0;k<L;k++){let M=D.next();if(M.done)return[R,e.empty()];R.push(M.value)}return[R,{[Symbol.iterator](){return D}}]}e.consume=d;async function u(w){let L=[];for await(let R of w)L.push(R);return Promise.resolve(L)}e.asyncToArray=u})(im||(im={}));function sm(e){if(im.is(e)){let r=[];for(let i of e)if(i)try{i.dispose()}catch(o){r.push(o)}if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function vb(...e){return om(()=>sm(e))}function om(e){return{dispose:gb(()=>{e()})}}var am=class lm{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{sm(this._toDispose)}finally{this._toDispose.clear()}}add(r){if(!r)return r;if(r===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?lm.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(r),r}delete(r){if(r){if(r===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(r),r.dispose()}}deleteAndLeak(r){r&&this._toDispose.has(r)&&(this._toDispose.delete(r),void 0)}};am.DISABLE_DISPOSED_WARNING=!1;var lh=am,Ta=class{constructor(){this._store=new lh,this._store}dispose(){this._store.dispose()}_register(r){if(r===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(r)}};Ta.None=Object.freeze({dispose(){}});var yb=globalThis.performance&&typeof globalThis.performance.now=="function",wb=class cm{static create(r){return new cm(r)}constructor(r){this._now=yb&&r===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),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}},Sb;(e=>{e.None=()=>Ta.None;function r(j,N){return c(j,()=>{},0,void 0,!0,void 0,N)}e.defer=r;function i(j){return(N,I=null,q)=>{let U=!1,K;return K=j(V=>{if(!U)return K?K.dispose():U=!0,N.call(I,V)},null,q),U&&K.dispose(),K}}e.once=i;function o(j,N,I){return _((q,U=null,K)=>j(V=>q.call(U,N(V)),null,K),I)}e.map=o;function h(j,N,I){return _((q,U=null,K)=>j(V=>{N(V),q.call(U,V)},null,K),I)}e.forEach=h;function S(j,N,I){return _((q,U=null,K)=>j(V=>N(V)&&q.call(U,V),null,K),I)}e.filter=S;function y(j){return j}e.signal=y;function a(...j){return(N,I=null,q)=>{let U=vb(...j.map(K=>K(V=>N.call(I,V))));return v(U,q)}}e.any=a;function l(j,N,I,q){let U=I;return o(j,K=>(U=N(U,K),U),q)}e.reduce=l;function _(j,N){let I,q={onWillAddFirstListener(){I=j(U.fire,U)},onDidRemoveLastListener(){I==null||I.dispose()}},U=new Qr(q);return N==null||N.add(U),U.event}function v(j,N){return N instanceof Array?N.push(j):N&&N.add(j),j}function c(j,N,I=100,q=!1,U=!1,K,V){let T,B,P,F=0,G,Z={leakWarningThreshold:K,onWillAddFirstListener(){T=j(ae=>{F++,B=N(B,ae),q&&!P&&(ie.fire(B),B=void 0),G=()=>{let X=B;B=void 0,P=void 0,(!q||F>1)&&ie.fire(X),F=0},typeof I=="number"?(clearTimeout(P),P=setTimeout(G,I)):P===void 0&&(P=0,queueMicrotask(G))})},onWillRemoveListener(){U&&F>0&&(G==null||G())},onDidRemoveLastListener(){G=void 0,T.dispose()}},ie=new Qr(Z);return V==null||V.add(ie),ie.event}e.debounce=c;function m(j,N=0,I){return e.debounce(j,(q,U)=>q?(q.push(U),q):[U],N,void 0,!0,void 0,I)}e.accumulate=m;function C(j,N=(q,U)=>q===U,I){let q=!0,U;return S(j,K=>{let V=q||!N(K,U);return q=!1,U=K,V},I)}e.latch=C;function b(j,N,I){return[e.filter(j,N,I),e.filter(j,q=>!N(q),I)]}e.split=b;function x(j,N=!1,I=[],q){let U=I.slice(),K=j(B=>{U?U.push(B):T.fire(B)});q&&q.add(K);let V=()=>{U==null||U.forEach(B=>T.fire(B)),U=null},T=new Qr({onWillAddFirstListener(){K||(K=j(B=>T.fire(B)),q&&q.add(K))},onDidAddFirstListener(){U&&(N?setTimeout(V):V())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return q&&q.add(T),T.event}e.buffer=x;function f(j,N){return(I,q,U)=>{let K=N(new d);return j(function(V){let T=K.evaluate(V);T!==p&&I.call(q,T)},void 0,U)}}e.chain=f;let p=Symbol("HaltChainable");class d{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(I=>(N(I),I)),this}filter(N){return this.steps.push(I=>N(I)?I:p),this}reduce(N,I){let q=I;return this.steps.push(U=>(q=N(q,U),q)),this}latch(N=(I,q)=>I===q){let I=!0,q;return this.steps.push(U=>{let K=I||!N(U,q);return I=!1,q=U,K?U:p}),this}evaluate(N){for(let I of this.steps)if(N=I(N),N===p)break;return N}}function u(j,N,I=q=>q){let q=(...T)=>V.fire(I(...T)),U=()=>j.on(N,q),K=()=>j.removeListener(N,q),V=new Qr({onWillAddFirstListener:U,onDidRemoveLastListener:K});return V.event}e.fromNodeEventEmitter=u;function w(j,N,I=q=>q){let q=(...T)=>V.fire(I(...T)),U=()=>j.addEventListener(N,q),K=()=>j.removeEventListener(N,q),V=new Qr({onWillAddFirstListener:U,onDidRemoveLastListener:K});return V.event}e.fromDOMEventEmitter=w;function L(j){return new Promise(N=>i(j)(N))}e.toPromise=L;function R(j){let N=new Qr;return j.then(I=>{N.fire(I)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}e.fromPromise=R;function D(j,N){return j(I=>N.fire(I))}e.forward=D;function k(j,N,I){return N(I),j(q=>N(q))}e.runAndSubscribe=k;class M{constructor(N,I){this._observable=N,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new Qr(q),I&&I.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,I){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(j,N){return new M(j,N).emitter.event}e.fromObservable=W;function z(j){return(N,I,q)=>{let U=0,K=!1,V={beginUpdate(){U++},endUpdate(){U--,U===0&&(j.reportChanges(),K&&(K=!1,N.call(I)))},handlePossibleChange(){},handleChange(){K=!0}};j.addObserver(V),j.reportChanges();let T={dispose(){j.removeObserver(V)}};return q instanceof lh?q.add(T):Array.isArray(q)&&q.push(T),T}}e.fromObservableLight=z})(Sb||(Sb={}));var Bu=class Iu{constructor(r){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${r}_${Iu._idPool++}`,Iu.all.add(this)}start(r){this._stopWatch=new wb,this.listenerCount=r}stop(){if(this._stopWatch){let r=this._stopWatch.elapsed();this.durations.push(r),this.elapsedOverall+=r,this.invocationCount+=1,this._stopWatch=void 0}}};Bu.all=new Set,Bu._idPool=0;var Cb=Bu,xb=-1,um=class hm{constructor(r,i,o=(hm._idPool++).toString(16).padStart(3,"0")){this._errorHandler=r,this.threshold=i,this.name=o,this._warnCountdown=0}dispose(){var r;(r=this._stacks)==null||r.clear()}check(r,i){let o=this.threshold;if(o<=0||i<o)return;this._stacks||(this._stacks=new Map);let h=this._stacks.get(r.value)||0;if(this._stacks.set(r.value,h+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let[S,y]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${y}):`;console.warn(a),console.warn(S);let l=new kb(a,S);this._errorHandler(l)}return()=>{let S=this._stacks.get(r.value)||0;this._stacks.set(r.value,S-1)}}getMostFrequentStack(){if(!this._stacks)return;let r,i=0;for(let[o,h]of this._stacks)(!r||i<h)&&(r=[o,h],i=h);return r}};um._idPool=1;var bb=um,Eb=class dm{constructor(r){this.value=r}static create(){let r=new Error;return new dm(r.stack??"")}print(){console.warn(this.value.split(`
|
|
85
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(r=>{r(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},fb=new db;function lu(e){pb(e)||fb.onUnexpectedError(e)}var Pu="Canceled";function pb(e){return e instanceof _b?!0:e instanceof Error&&e.name===Pu&&e.message===Pu}var _b=class extends Error{constructor(){super(Pu),this.name=this.message}},e_=class Nu extends Error{constructor(r){super(r),this.name="CodeExpectedError"}static fromError(r){if(r instanceof Nu)return r;let i=new Nu;return i.message=r.message,i.stack=r.stack,i}static isErrorNoTelemetry(r){return r.name==="CodeExpectedError"}};function gb(e,r){let i=this,o=!1,h;return function(){return o||(o=!0,r||(h=e.apply(i,arguments))),h}}var mb;(e=>{function r(S){return S<0}e.isLessThan=r;function i(S){return S<=0}e.isLessThanOrEqual=i;function o(S){return S>0}e.isGreaterThan=o;function h(S){return S===0}e.isNeitherLessOrGreaterThan=h,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(mb||(mb={}));var im;(e=>{function r(w){return w&&typeof w=="object"&&typeof w[Symbol.iterator]=="function"}e.is=r;let i=Object.freeze([]);function o(){return i}e.empty=o;function*h(w){yield w}e.single=h;function S(w){return r(w)?w:h(w)}e.wrap=S;function y(w){return w||i}e.from=y;function*a(w){for(let L=w.length-1;L>=0;L--)yield w[L]}e.reverse=a;function l(w){return!w||w[Symbol.iterator]().next().done===!0}e.isEmpty=l;function _(w){return w[Symbol.iterator]().next().value}e.first=_;function v(w,L){let R=0;for(let D of w)if(L(D,R++))return!0;return!1}e.some=v;function c(w,L){for(let R of w)if(L(R))return R}e.find=c;function*m(w,L){for(let R of w)L(R)&&(yield R)}e.filter=m;function*C(w,L){let R=0;for(let D of w)yield L(D,R++)}e.map=C;function*b(w,L){let R=0;for(let D of w)yield*L(D,R++)}e.flatMap=b;function*x(...w){for(let L of w)yield*L}e.concat=x;function f(w,L,R){let D=R;for(let k of w)D=L(D,k);return D}e.reduce=f;function*p(w,L,R=w.length){for(L<0&&(L+=w.length),R<0?R+=w.length:R>w.length&&(R=w.length);L<R;L++)yield w[L]}e.slice=p;function d(w,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,w];let D=w[Symbol.iterator]();for(let k=0;k<L;k++){let M=D.next();if(M.done)return[R,e.empty()];R.push(M.value)}return[R,{[Symbol.iterator](){return D}}]}e.consume=d;async function u(w){let L=[];for await(let R of w)L.push(R);return Promise.resolve(L)}e.asyncToArray=u})(im||(im={}));function sm(e){if(im.is(e)){let r=[];for(let i of e)if(i)try{i.dispose()}catch(o){r.push(o)}if(r.length===1)throw r[0];if(r.length>1)throw new AggregateError(r,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function vb(...e){return om(()=>sm(e))}function om(e){return{dispose:gb(()=>{e()})}}var am=class lm{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{sm(this._toDispose)}finally{this._toDispose.clear()}}add(r){if(!r)return r;if(r===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?lm.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(r),r}delete(r){if(r){if(r===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(r),r.dispose()}}deleteAndLeak(r){r&&this._toDispose.has(r)&&(this._toDispose.delete(r),void 0)}};am.DISABLE_DISPOSED_WARNING=!1;var lh=am,Ta=class{constructor(){this._store=new lh,this._store}dispose(){this._store.dispose()}_register(r){if(r===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(r)}};Ta.None=Object.freeze({dispose(){}});var yb=globalThis.performance&&typeof globalThis.performance.now=="function",wb=class cm{static create(r){return new cm(r)}constructor(r){this._now=yb&&r===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),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}},Sb;(e=>{e.None=()=>Ta.None;function r(j,N){return c(j,()=>{},0,void 0,!0,void 0,N)}e.defer=r;function i(j){return(N,I=null,q)=>{let U=!1,K;return K=j(V=>{if(!U)return K?K.dispose():U=!0,N.call(I,V)},null,q),U&&K.dispose(),K}}e.once=i;function o(j,N,I){return _((q,U=null,K)=>j(V=>q.call(U,N(V)),null,K),I)}e.map=o;function h(j,N,I){return _((q,U=null,K)=>j(V=>{N(V),q.call(U,V)},null,K),I)}e.forEach=h;function S(j,N,I){return _((q,U=null,K)=>j(V=>N(V)&&q.call(U,V),null,K),I)}e.filter=S;function y(j){return j}e.signal=y;function a(...j){return(N,I=null,q)=>{let U=vb(...j.map(K=>K(V=>N.call(I,V))));return v(U,q)}}e.any=a;function l(j,N,I,q){let U=I;return o(j,K=>(U=N(U,K),U),q)}e.reduce=l;function _(j,N){let I,q={onWillAddFirstListener(){I=j(U.fire,U)},onDidRemoveLastListener(){I==null||I.dispose()}},U=new Jr(q);return N==null||N.add(U),U.event}function v(j,N){return N instanceof Array?N.push(j):N&&N.add(j),j}function c(j,N,I=100,q=!1,U=!1,K,V){let T,B,P,F=0,G,Z={leakWarningThreshold:K,onWillAddFirstListener(){T=j(ae=>{F++,B=N(B,ae),q&&!P&&(ie.fire(B),B=void 0),G=()=>{let X=B;B=void 0,P=void 0,(!q||F>1)&&ie.fire(X),F=0},typeof I=="number"?(clearTimeout(P),P=setTimeout(G,I)):P===void 0&&(P=0,queueMicrotask(G))})},onWillRemoveListener(){U&&F>0&&(G==null||G())},onDidRemoveLastListener(){G=void 0,T.dispose()}},ie=new Jr(Z);return V==null||V.add(ie),ie.event}e.debounce=c;function m(j,N=0,I){return e.debounce(j,(q,U)=>q?(q.push(U),q):[U],N,void 0,!0,void 0,I)}e.accumulate=m;function C(j,N=(q,U)=>q===U,I){let q=!0,U;return S(j,K=>{let V=q||!N(K,U);return q=!1,U=K,V},I)}e.latch=C;function b(j,N,I){return[e.filter(j,N,I),e.filter(j,q=>!N(q),I)]}e.split=b;function x(j,N=!1,I=[],q){let U=I.slice(),K=j(B=>{U?U.push(B):T.fire(B)});q&&q.add(K);let V=()=>{U==null||U.forEach(B=>T.fire(B)),U=null},T=new Jr({onWillAddFirstListener(){K||(K=j(B=>T.fire(B)),q&&q.add(K))},onDidAddFirstListener(){U&&(N?setTimeout(V):V())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return q&&q.add(T),T.event}e.buffer=x;function f(j,N){return(I,q,U)=>{let K=N(new d);return j(function(V){let T=K.evaluate(V);T!==p&&I.call(q,T)},void 0,U)}}e.chain=f;let p=Symbol("HaltChainable");class d{constructor(){this.steps=[]}map(N){return this.steps.push(N),this}forEach(N){return this.steps.push(I=>(N(I),I)),this}filter(N){return this.steps.push(I=>N(I)?I:p),this}reduce(N,I){let q=I;return this.steps.push(U=>(q=N(q,U),q)),this}latch(N=(I,q)=>I===q){let I=!0,q;return this.steps.push(U=>{let K=I||!N(U,q);return I=!1,q=U,K?U:p}),this}evaluate(N){for(let I of this.steps)if(N=I(N),N===p)break;return N}}function u(j,N,I=q=>q){let q=(...T)=>V.fire(I(...T)),U=()=>j.on(N,q),K=()=>j.removeListener(N,q),V=new Jr({onWillAddFirstListener:U,onDidRemoveLastListener:K});return V.event}e.fromNodeEventEmitter=u;function w(j,N,I=q=>q){let q=(...T)=>V.fire(I(...T)),U=()=>j.addEventListener(N,q),K=()=>j.removeEventListener(N,q),V=new Jr({onWillAddFirstListener:U,onDidRemoveLastListener:K});return V.event}e.fromDOMEventEmitter=w;function L(j){return new Promise(N=>i(j)(N))}e.toPromise=L;function R(j){let N=new Jr;return j.then(I=>{N.fire(I)},()=>{N.fire(void 0)}).finally(()=>{N.dispose()}),N.event}e.fromPromise=R;function D(j,N){return j(I=>N.fire(I))}e.forward=D;function k(j,N,I){return N(I),j(q=>N(q))}e.runAndSubscribe=k;class M{constructor(N,I){this._observable=N,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{N.addObserver(this)},onDidRemoveLastListener:()=>{N.removeObserver(this)}};this.emitter=new Jr(q),I&&I.add(this.emitter)}beginUpdate(N){this._counter++}handlePossibleChange(N){}handleChange(N,I){this._hasChanged=!0}endUpdate(N){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(j,N){return new M(j,N).emitter.event}e.fromObservable=W;function z(j){return(N,I,q)=>{let U=0,K=!1,V={beginUpdate(){U++},endUpdate(){U--,U===0&&(j.reportChanges(),K&&(K=!1,N.call(I)))},handlePossibleChange(){},handleChange(){K=!0}};j.addObserver(V),j.reportChanges();let T={dispose(){j.removeObserver(V)}};return q instanceof lh?q.add(T):Array.isArray(q)&&q.push(T),T}}e.fromObservableLight=z})(Sb||(Sb={}));var Bu=class Iu{constructor(r){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${r}_${Iu._idPool++}`,Iu.all.add(this)}start(r){this._stopWatch=new wb,this.listenerCount=r}stop(){if(this._stopWatch){let r=this._stopWatch.elapsed();this.durations.push(r),this.elapsedOverall+=r,this.invocationCount+=1,this._stopWatch=void 0}}};Bu.all=new Set,Bu._idPool=0;var Cb=Bu,xb=-1,um=class hm{constructor(r,i,o=(hm._idPool++).toString(16).padStart(3,"0")){this._errorHandler=r,this.threshold=i,this.name=o,this._warnCountdown=0}dispose(){var r;(r=this._stacks)==null||r.clear()}check(r,i){let o=this.threshold;if(o<=0||i<o)return;this._stacks||(this._stacks=new Map);let h=this._stacks.get(r.value)||0;if(this._stacks.set(r.value,h+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=o*.5;let[S,y]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${y}):`;console.warn(a),console.warn(S);let l=new kb(a,S);this._errorHandler(l)}return()=>{let S=this._stacks.get(r.value)||0;this._stacks.set(r.value,S-1)}}getMostFrequentStack(){if(!this._stacks)return;let r,i=0;for(let[o,h]of this._stacks)(!r||i<h)&&(r=[o,h],i=h);return r}};um._idPool=1;var bb=um,Eb=class dm{constructor(r){this.value=r}static create(){let r=new Error;return new dm(r.stack??"")}print(){console.warn(this.value.split(`
|
|
86
86
|
`).slice(2).join(`
|
|
87
|
-
`))}},kb=class extends Error{constructor(e,r){super(e),this.name="ListenerLeakError",this.stack=r}},Lb=class extends Error{constructor(e,r){super(e),this.name="ListenerRefusalError",this.stack=r}},Rb=0,cu=class{constructor(e){this.value=e,this.id=Rb++}},Db=2,Ab,Qr=class{constructor(e){var r,i,o,h;this._size=0,this._options=e,this._leakageMon=(r=this._options)!=null&&r.leakWarningThreshold?new bb((e==null?void 0:e.onListenerError)??lu,((i=this._options)==null?void 0:i.leakWarningThreshold)??xb):void 0,this._perfMon=(o=this._options)!=null&&o._profName?new Cb(this._options._profName):void 0,this._deliveryQueue=(h=this._options)==null?void 0:h.deliveryQueue}dispose(){var e,r,i,o;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=(r=this._options)==null?void 0:r.onDidRemoveLastListener)==null||i.call(r),(o=this._leakageMon)==null||o.dispose())}get event(){return this._event??(this._event=(e,r,i)=>{var y,a,l,_,v;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let m=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],C=new Lb(`${c}. HINT: Stack shows most frequent listener (${m[1]}-times)`,m[0]);return(((y=this._options)==null?void 0:y.onListenerError)||lu)(C),Ta.None}if(this._disposed)return Ta.None;r&&(e=e.bind(r));let o=new cu(e),h;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Eb.create(),h=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof cu?(this._deliveryQueue??(this._deliveryQueue=new Tb),this._listeners=[this._listeners,o]):this._listeners.push(o):((l=(a=this._options)==null?void 0:a.onWillAddFirstListener)==null||l.call(a,this),this._listeners=o,(v=(_=this._options)==null?void 0:_.onDidAddFirstListener)==null||v.call(_,this)),this._size++;let S=om(()=>{h==null||h(),this._removeListener(o)});return i instanceof lh?i.add(S):Array.isArray(i)&&i.push(S),S}),this._event}_removeListener(e){var h,S,y,a;if((S=(h=this._options)==null?void 0:h.onWillRemoveListener)==null||S.call(h,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(a=(y=this._options)==null?void 0:y.onDidRemoveLastListener)==null||a.call(y,this),this._size=0;return}let r=this._listeners,i=r.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--,r[i]=void 0;let o=this._deliveryQueue.current===this;if(this._size*Db<=r.length){let l=0;for(let _=0;_<r.length;_++)r[_]?r[l++]=r[_]:o&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=l}}_deliver(e,r){var o;if(!e)return;let i=((o=this._options)==null?void 0:o.onListenerError)||lu;if(!i){e.value(r);return}try{e.value(r)}catch(h){i(h)}}_deliverQueue(e){let r=e.current._listeners;for(;e.i<e.end;)this._deliver(r[e.i++],e.value);e.reset()}fire(e){var r,i,o,h;if((r=this._deliveryQueue)!=null&&r.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)==null||i.stop()),(o=this._perfMon)==null||o.start(this._size),this._listeners)if(this._listeners instanceof cu)this._deliver(this._listeners,e);else{let S=this._deliveryQueue;S.enqueue(this,e,this._listeners.length),this._deliverQueue(S)}(h=this._perfMon)==null||h.stop()}hasListeners(){return this._size>0}},Tb=class{constructor(){this.i=-1,this.end=0}enqueue(e,r,i){this.i=0,this.end=i,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ma=class va{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Qr,this.onChange=this._onChange.event;let r=new hb;this.register(r),this._active=r.version,this._activeProvider=r}static extractShouldJoin(r){return(r&1)!==0}static extractWidth(r){return r>>1&3}static extractCharKind(r){return r>>3}static createPropertyValue(r,i,o=!1){return(r&16777215)<<3|(i&3)<<1|(o?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(r){if(!this._providers[r])throw new Error(`unknown Unicode version "${r}"`);this._active=r,this._activeProvider=this._providers[r],this._onChange.fire(r)}register(r){this._providers[r.version]=r}wcwidth(r){return this._activeProvider.wcwidth(r)}getStringCellWidth(r){let i=0,o=0,h=r.length;for(let S=0;S<h;++S){let y=r.charCodeAt(S);if(55296<=y&&y<=56319){if(++S>=h)return i+this.wcwidth(y);let _=r.charCodeAt(S);56320<=_&&_<=57343?y=(y-55296)*1024+_-56320+65536:i+=this.wcwidth(_)}let a=this.charProperties(y,o),l=va.extractWidth(a);va.extractShouldJoin(a)&&(l-=va.extractWidth(o)),i+=l,o=a}return i}charProperties(r,i){return this._activeProvider.charProperties(r,i)}},uu=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],Mb=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],hu=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],Pb=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],br;function t_(e,r){let i=0,o=r.length-1,h;if(e<r[0][0]||e>r[o][1])return!1;for(;o>=i;)if(h=i+o>>1,e>r[h][1])i=h+1;else if(e<r[h][0])o=h-1;else return!0;return!1}var Nb=class{constructor(){if(this.version="11",!br){br=new Uint8Array(65536),br.fill(1),br[0]=0,br.fill(0,1,32),br.fill(0,127,160);for(let e=0;e<uu.length;++e)br.fill(0,uu[e][0],uu[e][1]+1);for(let e=0;e<hu.length;++e)br.fill(2,hu[e][0],hu[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?br[e]:t_(e,Mb)?0:t_(e,Pb)?2:1}charProperties(e,r){let i=this.wcwidth(e),o=i===0&&r!==0;if(o){let h=Ma.extractWidth(r);h===0?o=!1:h>i&&(i=h)}return Ma.createPropertyValue(0,i,o)}},fm=class{activate(e){e.unicode.register(new Nb)}dispose(){}};/**
|
|
87
|
+
`))}},kb=class extends Error{constructor(e,r){super(e),this.name="ListenerLeakError",this.stack=r}},Lb=class extends Error{constructor(e,r){super(e),this.name="ListenerRefusalError",this.stack=r}},Rb=0,cu=class{constructor(e){this.value=e,this.id=Rb++}},Db=2,Ab,Jr=class{constructor(e){var r,i,o,h;this._size=0,this._options=e,this._leakageMon=(r=this._options)!=null&&r.leakWarningThreshold?new bb((e==null?void 0:e.onListenerError)??lu,((i=this._options)==null?void 0:i.leakWarningThreshold)??xb):void 0,this._perfMon=(o=this._options)!=null&&o._profName?new Cb(this._options._profName):void 0,this._deliveryQueue=(h=this._options)==null?void 0:h.deliveryQueue}dispose(){var e,r,i,o;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=(r=this._options)==null?void 0:r.onDidRemoveLastListener)==null||i.call(r),(o=this._leakageMon)==null||o.dispose())}get event(){return this._event??(this._event=(e,r,i)=>{var y,a,l,_,v;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let m=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],C=new Lb(`${c}. HINT: Stack shows most frequent listener (${m[1]}-times)`,m[0]);return(((y=this._options)==null?void 0:y.onListenerError)||lu)(C),Ta.None}if(this._disposed)return Ta.None;r&&(e=e.bind(r));let o=new cu(e),h;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=Eb.create(),h=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof cu?(this._deliveryQueue??(this._deliveryQueue=new Tb),this._listeners=[this._listeners,o]):this._listeners.push(o):((l=(a=this._options)==null?void 0:a.onWillAddFirstListener)==null||l.call(a,this),this._listeners=o,(v=(_=this._options)==null?void 0:_.onDidAddFirstListener)==null||v.call(_,this)),this._size++;let S=om(()=>{h==null||h(),this._removeListener(o)});return i instanceof lh?i.add(S):Array.isArray(i)&&i.push(S),S}),this._event}_removeListener(e){var h,S,y,a;if((S=(h=this._options)==null?void 0:h.onWillRemoveListener)==null||S.call(h,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(a=(y=this._options)==null?void 0:y.onDidRemoveLastListener)==null||a.call(y,this),this._size=0;return}let r=this._listeners,i=r.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--,r[i]=void 0;let o=this._deliveryQueue.current===this;if(this._size*Db<=r.length){let l=0;for(let _=0;_<r.length;_++)r[_]?r[l++]=r[_]:o&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=l}}_deliver(e,r){var o;if(!e)return;let i=((o=this._options)==null?void 0:o.onListenerError)||lu;if(!i){e.value(r);return}try{e.value(r)}catch(h){i(h)}}_deliverQueue(e){let r=e.current._listeners;for(;e.i<e.end;)this._deliver(r[e.i++],e.value);e.reset()}fire(e){var r,i,o,h;if((r=this._deliveryQueue)!=null&&r.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)==null||i.stop()),(o=this._perfMon)==null||o.start(this._size),this._listeners)if(this._listeners instanceof cu)this._deliver(this._listeners,e);else{let S=this._deliveryQueue;S.enqueue(this,e,this._listeners.length),this._deliverQueue(S)}(h=this._perfMon)==null||h.stop()}hasListeners(){return this._size>0}},Tb=class{constructor(){this.i=-1,this.end=0}enqueue(e,r,i){this.i=0,this.end=i,this.current=e,this.value=r}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ma=class va{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Jr,this.onChange=this._onChange.event;let r=new hb;this.register(r),this._active=r.version,this._activeProvider=r}static extractShouldJoin(r){return(r&1)!==0}static extractWidth(r){return r>>1&3}static extractCharKind(r){return r>>3}static createPropertyValue(r,i,o=!1){return(r&16777215)<<3|(i&3)<<1|(o?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(r){if(!this._providers[r])throw new Error(`unknown Unicode version "${r}"`);this._active=r,this._activeProvider=this._providers[r],this._onChange.fire(r)}register(r){this._providers[r.version]=r}wcwidth(r){return this._activeProvider.wcwidth(r)}getStringCellWidth(r){let i=0,o=0,h=r.length;for(let S=0;S<h;++S){let y=r.charCodeAt(S);if(55296<=y&&y<=56319){if(++S>=h)return i+this.wcwidth(y);let _=r.charCodeAt(S);56320<=_&&_<=57343?y=(y-55296)*1024+_-56320+65536:i+=this.wcwidth(_)}let a=this.charProperties(y,o),l=va.extractWidth(a);va.extractShouldJoin(a)&&(l-=va.extractWidth(o)),i+=l,o=a}return i}charProperties(r,i){return this._activeProvider.charProperties(r,i)}},uu=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],Mb=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],hu=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],Pb=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],br;function t_(e,r){let i=0,o=r.length-1,h;if(e<r[0][0]||e>r[o][1])return!1;for(;o>=i;)if(h=i+o>>1,e>r[h][1])i=h+1;else if(e<r[h][0])o=h-1;else return!0;return!1}var Nb=class{constructor(){if(this.version="11",!br){br=new Uint8Array(65536),br.fill(1),br[0]=0,br.fill(0,1,32),br.fill(0,127,160);for(let e=0;e<uu.length;++e)br.fill(0,uu[e][0],uu[e][1]+1);for(let e=0;e<hu.length;++e)br.fill(2,hu[e][0],hu[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?br[e]:t_(e,Mb)?0:t_(e,Pb)?2:1}charProperties(e,r){let i=this.wcwidth(e),o=i===0&&r!==0;if(o){let h=Ma.extractWidth(r);h===0?o=!1:h>i&&(i=h)}return Ma.createPropertyValue(0,i,o)}},fm=class{activate(e){e.unicode.register(new Nb)}dispose(){}};/**
|
|
88
88
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
89
89
|
* @license MIT
|
|
90
90
|
*
|
|
@@ -106,4 +106,4 @@ WARNING: This link could potentially be dangerous`)){const p=window.open();if(p)
|
|
|
106
106
|
`)):M.write(`\r
|
|
107
107
|
\x1B[31mFailed to upload image\x1B[0m\r
|
|
108
108
|
`)},T=G=>{var ie;const Z=(ie=G.clipboardData)==null?void 0:ie.items;if(Z){for(const ae of Z)if(ae.type.startsWith("image/")){G.preventDefault(),G.stopPropagation();const X=ae.getAsFile();X&&V(X);return}}},B=G=>{var Z,ie;(ie=(Z=G.dataTransfer)==null?void 0:Z.types)!=null&&ie.includes("Files")&&(G.preventDefault(),G.stopPropagation())},P=G=>{var ie;const Z=(ie=G.dataTransfer)==null?void 0:ie.files;if(!(!Z||Z.length===0)){for(const ae of Z)if(ae.type.startsWith("image/")){G.preventDefault(),G.stopPropagation(),V(ae);return}}};U==null||U.addEventListener("paste",T,!0),U==null||U.addEventListener("dragover",B,!0),U==null||U.addEventListener("drop",P,!0);const F=()=>{d.off(j,N),I.dispose(),q.disconnect(),U==null||U.removeEventListener("paste",T,!0),U==null||U.removeEventListener("dragover",B,!0),U==null||U.removeEventListener("drop",P,!0)};w.set(D.id,{term:M,fit:W,cleanup:F})}return()=>{var D;for(const[,k]of w)(D=k.cleanup)==null||D.call(k),k.term.dispose();w.clear()}},[c.map(d=>d.id).join(","),r.current]);const b=J.useCallback(d=>{a(d.id);const u=o.current.get(d.id);u&&u.term.focus(),i==null||i(d)},[i]),x=J.useCallback((d,u)=>{if(!S.current)return;const w=S.current.offsetWidth,L=u/w*100;_(R=>{const D=[...R],k=10,M=D[d]+L,W=D[d+1]-L;return M>=k&&W>=k&&(D[d]=M,D[d+1]=W),D})},[]),f=c.length;if(f===0)return O.jsxs("div",{className:"multi-term-empty",children:[O.jsx("div",{className:"multi-term-empty-icon",children:"_"}),O.jsx("div",{className:"multi-term-empty-text",children:"No running agents"})]});const p=l.length===f?l:Array(f).fill(100/f);return O.jsx("div",{className:"multi-term-container",ref:S,children:c.map((d,u)=>O.jsxs(Hu.Fragment,{children:[O.jsxs("div",{className:`multi-term-pane ${y===d.id?"focused":""}`,style:{flexBasis:`${p[u]}%`},onClick:()=>b(d),children:[O.jsxs("div",{className:"multi-term-pane-header",children:[O.jsx("span",{className:"multi-term-status-dot",style:{background:Ub(d.status)}}),O.jsx("span",{className:"multi-term-pane-name",children:d.name}),O.jsx("span",{className:"multi-term-pane-task",children:d.task})]}),O.jsx("div",{className:"multi-term-pane-body",ref:C(d.id)})]}),u<f-1&&O.jsx(Vb,{orientation:"horizontal",onDrag:w=>x(u,w)})]},d.id))})}function Kb({messages:e,agents:r,selectedAgentId:i,onClear:o}){const h=J.useRef(null),S=J.useMemo(()=>{const a={user:"User"};return r.forEach(l=>{a[l.id]=l.name}),a},[r]),y=J.useMemo(()=>i?e.filter(a=>a.from_agent===i||a.to_agent===i):e,[e,i]);return J.useEffect(()=>{var a;(a=h.current)==null||a.scrollIntoView({behavior:"smooth"})},[y]),O.jsxs("div",{className:"message-feed",children:[O.jsxs("div",{className:"message-feed-header",children:[O.jsx("span",{children:i?`Messages for ${S[i]||i}`:"All Messages"}),y.length>0&&O.jsx("button",{className:"clear-messages-btn",onClick:o,children:"Clear All"})]}),O.jsxs("div",{className:"message-feed-list",children:[y.length===0&&O.jsx("div",{className:"message-feed-empty",children:"No messages yet"}),[...y].reverse().map(a=>O.jsxs("div",{className:"message-item",children:[O.jsxs("div",{className:"message-meta",children:[O.jsx("span",{className:"message-from",children:S[a.from_agent]||a.from_agent.slice(0,8)}),O.jsx("span",{className:"message-arrow",children:" → "}),O.jsx("span",{className:"message-to",children:a.to_agent==="all"?"All":S[a.to_agent]||a.to_agent.slice(0,8)}),O.jsx("span",{className:"message-time",children:new Date(a.created_at).toLocaleTimeString()})]}),O.jsx("div",{className:"message-content",children:a.content})]},a.id)),O.jsx("div",{ref:h})]})]})}function Xb({entries:e,onRemove:r}){return O.jsxs("div",{className:"context-viewer",children:[O.jsx("div",{className:"context-header",children:"Shared Context"}),e.length===0&&O.jsx("div",{className:"context-empty",children:"No context entries yet"}),O.jsxs("table",{className:"context-table",children:[O.jsx("thead",{children:O.jsxs("tr",{children:[O.jsx("th",{children:"Key"}),O.jsx("th",{children:"Value"}),O.jsx("th",{children:"Updated By"}),O.jsx("th",{children:"Updated At"}),O.jsx("th",{})]})}),O.jsx("tbody",{children:e.map(i=>O.jsxs("tr",{children:[O.jsx("td",{className:"context-key",children:i.key}),O.jsx("td",{className:"context-value",children:i.value}),O.jsx("td",{children:i.updated_by||"—"}),O.jsx("td",{className:"context-time",children:i.updated_at?new Date(i.updated_at).toLocaleTimeString():"—"}),O.jsx("td",{children:O.jsx("button",{className:"context-remove-btn",onClick:()=>r(i.key),title:`Remove "${i.key}"`,children:"✕"})})]},i.key))})]})]})}function Yb({diff:e,fileName:r}){const i=e.split(`
|
|
109
|
-
`);return O.jsxs("div",{className:"diff-viewer",children:[r&&O.jsx("div",{className:"diff-filename",children:r}),O.jsx("pre",{className:"diff-content",children:i.map((o,h)=>{let S="diff-line";return o.startsWith("+")&&!o.startsWith("+++")?S+=" diff-add":o.startsWith("-")&&!o.startsWith("---")?S+=" diff-del":o.startsWith("@@")?S+=" diff-hunk":o.startsWith("\\")&&(S+=" diff-meta"),O.jsx("div",{className:S,children:o},h)})})]})}function Gb(e){switch(e){case"add":return"A";case"change":return"M";case"unlink":return"D";default:return"?"}}function Qb(e){switch(e){case"add":return"#4ade80";case"change":return"#fbbf24";case"unlink":return"#f87171";default:return"#666"}}function Jb({changes:e,agents:r,onClear:i}){const[o,h]=J.useState(null),S=J.useMemo(()=>{const y=new Map;for(const a of r)y.set(a.id,a.name);return y},[r]);return O.jsxs("div",{className:"file-changes",children:[O.jsxs("div",{className:"file-changes-header",children:[O.jsxs("span",{children:["File Changes (",e.length,")"]}),e.length>0&&O.jsx("button",{className:"file-changes-clear-btn",onClick:i,children:"Clear"})]}),O.jsxs("div",{className:"file-changes-list",children:[e.length===0&&O.jsx("div",{className:"file-changes-empty",children:"No file changes detected yet. Changes will appear here as agents edit files."}),e.map(y=>{const a=y.agent_id?S.get(y.agent_id):null;return O.jsxs("div",{className:"file-change-item",children:[O.jsxs("div",{className:"file-change-row",onClick:()=>h(o===y.id?null:y.id),children:[O.jsx("span",{className:"file-change-type",style:{color:Qb(y.change_type)},children:Gb(y.change_type)}),O.jsx("span",{className:"file-change-path",children:y.file_path}),a&&O.jsx("span",{className:"file-change-agent",title:"Agent that made this change",children:a}),O.jsx("span",{className:"file-change-time",children:new Date(y.created_at).toLocaleTimeString()}),O.jsx("span",{className:"file-change-expand",children:y.diff_text?o===y.id?"▼":"▶":""})]}),o===y.id&&y.diff_text&&O.jsx(Yb,{diff:y.diff_text})]},y.id)})]})]})}function la(e){const r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const h=Math.floor(o/24);return h<30?`${h}d ago`:`${Math.floor(h/30)}mo ago`}function Zb(e){return!e||e.length===0?{icon:"",cls:""}:e.some(o=>o.conclusion==="FAILURE"||o.conclusion==="failure")?{icon:"✗",cls:"failure"}:e.some(o=>!o.conclusion||o.status==="IN_PROGRESS"||o.status==="QUEUED")?{icon:"○",cls:"pending"}:{icon:"✓",cls:"success"}}function eE(e){switch(e){case"APPROVED":return{text:"Approved",cls:"approved"};case"CHANGES_REQUESTED":return{text:"Changes",cls:"changes_requested"};case"REVIEW_REQUIRED":return{text:"Review",cls:"review_required"};default:return null}}function tE({prs:e,branches:r,currentBranch:i,ghAvailable:o,repoInfo:h,agents:S,fetchPRDetail:y}){const[a,l]=J.useState("all"),[_,v]=J.useState(null),[c,m]=J.useState(null),[C,b]=J.useState(!1),[x,f]=J.useState(!0),p=J.useMemo(()=>a==="all"?e:e.filter(L=>L.state.toUpperCase()===a.toUpperCase()),[e,a]),d=J.useMemo(()=>new Set(S.map(L=>L.name.toLowerCase())),[S]),u=async L=>{if(_===L){v(null),m(null);return}v(L),m(null),b(!0);const R=await y(L);m(R),b(!1)},w=L=>{const R=L.name.toLowerCase();for(const k of d)if(R.includes(k))return k;const D=L.author.toLowerCase();for(const k of d)if(D.includes(k))return k;return null};return O.jsxs("div",{className:"prs-tab",children:[O.jsxs("div",{className:"prs-header",children:[O.jsxs("div",{className:"prs-header-left",children:[O.jsxs("span",{children:["Pull Requests (",p.length,")"]}),O.jsxs("select",{className:"prs-filter",value:a,onChange:L=>l(L.target.value),children:[O.jsx("option",{value:"all",children:"All"}),O.jsx("option",{value:"open",children:"Open"}),O.jsx("option",{value:"closed",children:"Closed"}),O.jsx("option",{value:"merged",children:"Merged"})]})]}),h&&O.jsx("a",{className:"prs-repo-link",href:h.url,target:"_blank",rel:"noopener noreferrer",onClick:L=>{L.preventDefault(),window.open(h.url,"_blank")},children:h.nameWithOwner})]}),O.jsxs("div",{className:"prs-list",children:[o===!1&&O.jsxs("div",{className:"prs-unavailable",children:["GitHub CLI not available.",O.jsx("br",{}),"Install ",O.jsx("code",{children:"gh"})," and run ",O.jsx("code",{children:"gh auth login"})," to see PRs."]}),o!==!1&&p.length===0&&O.jsx("div",{className:"prs-empty",children:"No pull requests found."}),p.map(L=>{const R=L.isDraft?"draft":L.state.toLowerCase(),D=Zb(L.statusCheckRollup),k=eE(L.reviewDecision),M=_===L.number;return O.jsxs("div",{className:"pr-item",children:[O.jsxs("div",{className:"pr-row",onClick:()=>u(L.number),children:[O.jsx("span",{className:"pr-expand",children:M?"▼":"▶"}),O.jsx("span",{className:`pr-status-badge ${R}`}),O.jsxs("span",{className:"pr-number",children:["#",L.number]}),O.jsx("span",{className:"pr-title",children:L.title}),k&&O.jsx("span",{className:`pr-review ${k.cls}`,children:k.text}),D.icon&&O.jsx("span",{className:`pr-ci ${D.cls}`,children:D.icon}),O.jsx("span",{className:"pr-branch",title:L.headRefName,children:L.headRefName}),O.jsx("span",{className:"pr-author",children:L.author.login}),O.jsx("span",{className:"pr-time",children:la(L.createdAt)}),O.jsx("button",{className:"pr-link-btn",title:"Open in GitHub",onClick:W=>{W.stopPropagation(),window.open(L.url,"_blank")},children:"↗"})]}),M&&O.jsxs("div",{className:"pr-detail",children:[C&&O.jsx("div",{className:"pr-detail-loading",children:"Loading..."}),c&&c.number===L.number&&O.jsxs(O.Fragment,{children:[c.body&&O.jsx("div",{className:"pr-detail-body",children:c.body}),c.statusCheckRollup&&c.statusCheckRollup.length>0&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"pr-detail-section-title",children:"Checks"}),O.jsx("div",{className:"pr-detail-checks",children:c.statusCheckRollup.map((W,z)=>{var j,N,I,q;return O.jsxs("span",{className:`pr-check ${((j=W.conclusion)==null?void 0:j.toLowerCase())==="success"?"success":((N=W.conclusion)==null?void 0:N.toLowerCase())==="failure"?"failure":"pending"}`,children:[((I=W.conclusion)==null?void 0:I.toLowerCase())==="success"?"✓":((q=W.conclusion)==null?void 0:q.toLowerCase())==="failure"?"✗":"○"," ",W.name]},z)})})]}),c.reviews&&c.reviews.length>0&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"pr-detail-section-title",children:"Reviews"}),c.reviews.map((W,z)=>O.jsxs("div",{className:"pr-comment",children:[O.jsxs("div",{className:"pr-comment-header",children:[O.jsx("strong",{children:W.author.login})," ",W.state.toLowerCase().replace("_"," ")," ",la(W.submittedAt)]}),W.body&&O.jsx("div",{className:"pr-comment-body",children:W.body})]},z))]}),c.comments&&c.comments.length>0&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"pr-detail-section-title",children:"Comments"}),c.comments.map((W,z)=>O.jsxs("div",{className:"pr-comment",children:[O.jsxs("div",{className:"pr-comment-header",children:[O.jsx("strong",{children:W.author.login})," ",la(W.createdAt)]}),O.jsx("div",{className:"pr-comment-body",children:W.body})]},z))]}),(!c.reviews||c.reviews.length===0)&&(!c.comments||c.comments.length===0)&&!c.body&&O.jsx("div",{className:"pr-detail-loading",children:"No details available."})]})]})]},L.number)})]}),O.jsxs("div",{className:"branches-section",children:[O.jsxs("div",{className:"branches-header",onClick:()=>f(L=>!L),children:[O.jsxs("span",{children:["Branches (",r.length,")",i?` — ${i}`:""]}),O.jsx("span",{className:"branches-toggle",children:x?"▼":"▶"})]}),x&&O.jsxs("div",{className:"branches-list",children:[r.length===0&&O.jsx("div",{className:"prs-empty",children:"No branches found."}),r.map(L=>{const R=w(L);return O.jsxs("div",{className:`branch-item ${L.isCurrent?"current":""}`,children:[O.jsx("span",{className:"branch-current-marker",children:L.isCurrent?"●":""}),O.jsx("span",{className:`branch-name ${L.isCurrent?"current":""}`,title:L.name,children:L.name}),O.jsx("span",{className:"branch-message",children:L.lastCommitMessage}),R&&O.jsx("span",{className:"pr-branch",children:R}),O.jsx("span",{className:"branch-author",children:L.author}),O.jsxs("div",{className:"branch-ahead-behind",children:[L.ahead>0&&O.jsxs("span",{className:"branch-badge ahead",children:[L.ahead,"\\u2191"]}),L.behind>0&&O.jsxs("span",{className:"branch-badge behind",children:[L.behind,"\\u2193"]})]}),O.jsx("span",{className:"branch-time",children:L.lastCommitDate?la(L.lastCommitDate):""})]},L.name)})]})]})]})}function rE({content:e,onChange:r}){const[i,o]=J.useState(e),[h,S]=J.useState(!1),[y,a]=J.useState(!1),l=J.useRef(null);J.useEffect(()=>{y||o(e)},[e,y]);const _=m=>{o(m),a(!0)},v=async()=>{S(!0);try{await fetch("/api/crewmd",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:i})}),r(i),a(!1)}catch{}S(!1)},c=m=>{(m.metaKey||m.ctrlKey)&&m.key==="s"&&(m.preventDefault(),y&&v())};return O.jsxs("div",{className:"crewmd-editor",children:[O.jsxs("div",{className:"crewmd-header",children:[O.jsx("span",{className:"crewmd-title",children:"Rules"}),O.jsxs("div",{className:"crewmd-actions",children:[y&&O.jsx("span",{className:"crewmd-dirty",children:"unsaved"}),O.jsx("button",{className:"crewmd-save-btn",onClick:v,disabled:!y||h,children:h?"Saving...":"Save"})]})]}),O.jsx("textarea",{ref:l,className:"crewmd-textarea",value:i,onChange:m=>_(m.target.value),onKeyDown:c,spellCheck:!1,placeholder:"Write global instructions for all agents..."})]})}function nE(e){const[r,i]=J.useState([]),[o,h]=J.useState([]),[S,y]=J.useState(""),[a,l]=J.useState(null),[_,v]=J.useState(null),[c,m]=J.useState(!0);J.useEffect(()=>{fetch("/api/github/status").then(b=>b.json()).then(b=>{l(b.available),v(b.repo||null)}).catch(()=>l(!1)),fetch("/api/github/prs?state=all").then(b=>b.json()).then(b=>{Array.isArray(b)&&i(b)}).catch(()=>{}),fetch("/api/git/branches").then(b=>b.json()).then(b=>{b.current&&y(b.current),Array.isArray(b.branches)&&h(b.branches)}).catch(()=>{}).finally(()=>m(!1))},[]),J.useEffect(()=>{const b=e.current;if(!b)return;const x=p=>{Array.isArray(p)&&i(p)},f=p=>{p.current&&y(p.current),Array.isArray(p.branches)&&h(p.branches)};return b.on("github:prs:updated",x),b.on("git:branches:updated",f),()=>{b.off("github:prs:updated",x),b.off("git:branches:updated",f)}},[e]);const C=J.useCallback(async b=>{try{const x=await fetch(`/api/github/prs/${b}`);return x.ok?await x.json():null}catch{return null}},[]);return{prs:r,branches:o,currentBranch:S,ghAvailable:a,repoInfo:_,loading:c,fetchPRDetail:C}}function iE({onSpawn:e,onClose:r,initialMode:i="spawn",error:o}){const[h,S]=J.useState(i),[y,a]=J.useState(""),[l,_]=J.useState(""),[v,c]=J.useState(""),[m,C]=J.useState("claude"),[b,x]=J.useState(!1),f=async()=>{x(!0);try{const u=await(await fetch("/api/pick-folder",{method:"POST"})).json();u.path&&c(u.path)}catch{}x(!1)},p=()=>{if(h==="open"){if(!v.trim())return;const d=v.trim().split("/").filter(Boolean).pop()||"project";e(y.trim()||d,l.trim()||`Work on the project at ${v.trim()}. Explore the codebase and wait for instructions.`,v.trim(),m)}else{if(!y.trim()||!l.trim())return;e(y.trim(),l.trim(),v.trim()||void 0,m)}};return O.jsx("div",{className:"dialog-overlay",onClick:r,children:O.jsxs("div",{className:"dialog",onClick:d=>d.stopPropagation(),children:[O.jsxs("div",{className:"dialog-mode-tabs",children:[O.jsx("button",{className:`dialog-mode-tab ${h==="spawn"?"active":""}`,onClick:()=>S("spawn"),children:"Spawn Agent"}),O.jsx("button",{className:`dialog-mode-tab ${h==="open"?"active":""}`,onClick:()=>S("open"),children:"Open Project"})]}),O.jsxs("label",{children:["Agent Service",O.jsxs("div",{className:"service-selector",children:[O.jsx("button",{type:"button",className:`service-btn ${m==="claude"?"active":""}`,onClick:()=>C("claude"),children:"Claude"}),O.jsx("button",{type:"button",className:`service-btn ${m==="codex"?"active":""}`,onClick:()=>C("codex"),children:"Codex"})]})]}),h==="open"?O.jsxs(O.Fragment,{children:[O.jsxs("label",{children:["Project Directory",O.jsxs("div",{className:"browse-row",children:[O.jsx("input",{type:"text",value:v,onChange:d=>c(d.target.value),placeholder:"/Users/you/your-project",autoFocus:!0}),O.jsx("button",{type:"button",className:"browse-btn",onClick:f,disabled:b,children:b?"...":"Browse"})]})]}),O.jsxs("label",{children:["Agent Name ",O.jsx("span",{className:"optional",children:"(optional)"}),O.jsx("input",{type:"text",value:y,onChange:d=>a(d.target.value),placeholder:"Auto-detected from path"})]}),O.jsxs("label",{children:["Initial Task ",O.jsx("span",{className:"optional",children:"(optional)"}),O.jsx("textarea",{value:l,onChange:d=>_(d.target.value),placeholder:"Explore the codebase and wait for instructions...",rows:3})]})]}):O.jsxs(O.Fragment,{children:[O.jsxs("label",{children:["Name",O.jsx("input",{type:"text",value:y,onChange:d=>a(d.target.value),placeholder:"e.g. researcher",autoFocus:!0})]}),O.jsxs("label",{children:["Task",O.jsx("textarea",{value:l,onChange:d=>_(d.target.value),placeholder:"Describe what this agent should do...",rows:4})]}),O.jsxs("label",{children:["Working Directory ",O.jsx("span",{className:"optional",children:"(optional)"}),O.jsxs("div",{className:"browse-row",children:[O.jsx("input",{type:"text",value:v,onChange:d=>c(d.target.value),placeholder:"e.g. /Users/you/project (leave blank for server cwd)"}),O.jsx("button",{type:"button",className:"browse-btn",onClick:f,disabled:b,children:b?"...":"Browse"})]})]})]}),o&&O.jsx("div",{className:"dialog-error",children:o}),O.jsxs("div",{className:"dialog-actions",children:[O.jsx("button",{onClick:r,children:"Cancel"}),O.jsx("button",{className:"primary",onClick:p,children:h==="open"?"Open":"Spawn"})]})]})})}function sE({size:e=28}){return O.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[O.jsx("path",{d:"M50 5 A45 45 0 1 1 15 75",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",fill:"none"}),O.jsx("path",{d:"M30 18 Q55 45 78 30",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),O.jsx("path",{d:"M20 55 Q50 35 75 65",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),O.jsx("path",{d:"M22 72 Q50 60 50 90",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),O.jsx("circle",{cx:"30",cy:"18",r:"6",fill:"currentColor"}),O.jsx("circle",{cx:"78",cy:"30",r:"6",fill:"currentColor"}),O.jsx("circle",{cx:"75",cy:"65",r:"6",fill:"currentColor"}),O.jsx("circle",{cx:"22",cy:"72",r:"6",fill:"currentColor"}),O.jsx("circle",{cx:"50",cy:"90",r:"5.5",fill:"currentColor"})]})}function oE(){var be;const{socket:e,agents:r,messages:i,contextEntries:o,crewMd:h,setCrewMd:S,fileChanges:y}=Yv(),{prs:a,branches:l,currentBranch:_,ghAvailable:v,repoInfo:c,fetchPRDetail:m}=nE(e),[C,b]=J.useState(null),x=r.find(ue=>ue.id===C)??null,[f,p]=J.useState("graph"),[d,u]=J.useState(!1),[w,L]=J.useState("spawn"),[R,D]=J.useState(""),[k,M]=J.useState("all"),[W,z]=J.useState("multi"),[j,N]=J.useState(()=>window.innerWidth>=768),[I,q]=J.useState(!1),[U,K]=J.useState(null),[V,T]=J.useState(null),B=J.useCallback(async()=>{q(!0),T(null);try{const ue=await fetch("/api/pair");if(!ue.ok){const Re=await ue.text();T(Re||`Error ${ue.status}`);return}const ge=await ue.json();K(ge)}catch(ue){T(ue.message||"Failed to load pairing info")}},[]),[P,F]=J.useState(null),G=J.useCallback(async(ue,ge,Re,Ie)=>{F(null);try{const ze=await Jr("/api/spawn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ue,task:ge,cwd:Re,service:Ie||"claude"})}),Qe=await ze.json();if(!ze.ok){F(Qe.error||"Unknown error");return}u(!1),F(null)}catch(ze){F(ze.message||"Failed to connect to server")}},[]),Z=J.useCallback(async ue=>{await fetch(`/api/agents/${ue}`,{method:"DELETE"})},[]),ie=J.useCallback(async ue=>{await fetch(`/api/agents/${ue}/remove`,{method:"DELETE"}),C===ue&&b(null)},[C]),ae=J.useCallback(async ue=>{await fetch(`/api/agents/${ue}/rollback`,{method:"POST"})},[]),X=J.useCallback(async ue=>{await fetch(`/api/agents/${ue.id}/remove`,{method:"DELETE"});const Re=await(await Jr("/api/spawn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ue.name,task:ue.task,cwd:ue.agent_cwd||void 0,service:ue.service||"claude"})})).json();Re.id&&(b(Re.id),p("terminal"))},[]),H=J.useCallback(async ue=>{await fetch(`/api/context/${encodeURIComponent(ue)}`,{method:"DELETE"})},[]),re=J.useCallback(async()=>{if(!R.trim())return;const ue=k,ge=R;if(D(""),ue!=="all")await fetch(`/api/agents/${ue}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:ge})}).catch(()=>{}),await Jr("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:"user",to:ue,content:ge})});else{const Re=r.filter(Ie=>Ie.status==="running");await Promise.all(Re.map(Ie=>fetch(`/api/agents/${Ie.id}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:ge})}).catch(()=>{}))),await Jr("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:"user",to:"all",content:ge})})}},[R,k,r]),te=J.useCallback(async()=>{await Jr("/api/messages",{method:"DELETE"})},[]),ce=J.useCallback(async()=>{await Jr("/api/file-changes",{method:"DELETE"})},[]),le=J.useCallback(ue=>{b(ue.id),p("terminal")},[]),pe=J.useCallback(ue=>{L(ue),u(!0)},[]);J.useEffect(()=>{const ue=["graph","terminal","files","prs","messages","context","crewmd"],ge=Re=>{const Ie=Re.target,ze=Ie.tagName==="INPUT"||Ie.tagName==="TEXTAREA"||Ie.tagName==="SELECT",Qe=Ie.closest(".xterm"),ut=Re.metaKey||Re.ctrlKey;if(Re.key==="Escape"){u(!1);return}const qe=ut&&(Re.key==="["||Re.key==="]"||Re.key==="\\");if(Qe&&qe)Re.stopPropagation();else if(ze||Qe)return;if(!ut)return;const pt=parseInt(Re.key);if(pt>=1&&pt<=ue.length){Re.preventDefault(),p(ue[pt-1]);return}switch(Re.key){case"n":Re.preventDefault(),L("spawn"),u(!0);break;case"o":Re.preventDefault(),L("open"),u(!0);break;case"[":{Re.preventDefault();const Ne=r.filter($e=>$e.status!=="dead");if(Ne.length===0)break;const Je=Ne.findIndex($e=>$e.id===C),ht=Je<=0?Ne.length-1:Je-1;b(Ne[ht].id),p("terminal");break}case"]":{Re.preventDefault();const Ne=r.filter($e=>$e.status!=="dead");if(Ne.length===0)break;const Je=Ne.findIndex($e=>$e.id===C),ht=Je>=Ne.length-1?0:Je+1;b(Ne[ht].id),p("terminal");break}case"\\":Re.preventDefault(),z(Ne=>Ne==="multi"?"single":"multi");break}};return document.addEventListener("keydown",ge,!0),()=>document.removeEventListener("keydown",ge,!0)},[r,C]);const Se=[{key:"graph",label:"Graph"},{key:"terminal",label:"Terminal"},{key:"files",label:"Files"},{key:"prs",label:"PRs"},{key:"messages",label:"Messages"},{key:"context",label:"Context"},{key:"crewmd",label:"Rules"}];return O.jsxs("div",{className:"app",children:[O.jsxs("header",{className:"app-header",children:[O.jsx("button",{className:"header-hamburger",onClick:()=>N(ue=>!ue),title:"Toggle sidebar",children:"☰"}),O.jsxs("div",{className:"header-brand",children:[O.jsx(sE,{size:26}),O.jsx("h1",{children:"Clustr"})]}),(()=>{const ue=r.reduce((ge,Re)=>ge+(Re.total_cost||0),0);return ue>0?O.jsxs("span",{className:"header-total-cost",children:["Total: $",ue.toFixed(4)]}):null})(),O.jsxs("div",{className:"header-actions",children:[window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?O.jsx("button",{className:"header-connect-phone",onClick:B,title:"Connect phone",children:"Connect Phone"}):null,O.jsx("button",{onClick:()=>pe("open"),children:"Open Project"}),O.jsx("button",{className:"primary",onClick:()=>pe("spawn"),children:"New Agent"})]})]}),O.jsxs("div",{className:"app-body",children:[j&&O.jsx("div",{className:"sidebar-backdrop",onClick:()=>N(!1)}),O.jsxs("aside",{className:`sidebar ${j?"":"collapsed"}`,children:[O.jsx("button",{className:"sidebar-toggle",onClick:()=>N(ue=>!ue),title:j?"Collapse sidebar":"Expand sidebar",children:j?"‹":"›"}),j&&O.jsx(Qv,{agents:r,selectedId:C,onSelect:ue=>{b(ue.id),p("terminal"),window.innerWidth<768&&N(!1)},onKill:Z,onRemove:ie,onRollback:ae,onRestart:X})]}),O.jsxs("main",{className:"main-content",children:[O.jsxs("nav",{className:"tabs",children:[Se.map(ue=>O.jsx("button",{className:f===ue.key?"tab active":"tab",onClick:()=>p(ue.key),children:ue.label},ue.key)),f==="terminal"&&O.jsxs("div",{className:"terminal-view-toggle",children:[O.jsx("button",{className:`view-toggle-btn ${W==="multi"?"active":""}`,onClick:()=>z("multi"),title:"Split view — all agents",children:"⊞"}),O.jsx("button",{className:`view-toggle-btn ${W==="single"?"active":""}`,onClick:()=>z("single"),title:"Single view — selected agent",children:"☐"})]})]}),O.jsxs("div",{className:"tab-content",children:[f==="graph"&&O.jsx(ob,{agents:r,messages:i,onSelectAgent:le}),f==="terminal"&&W==="multi"&&O.jsx(qb,{agents:r,socket:e,onSelectAgent:ue=>b(ue.id)}),f==="terminal"&&W==="single"&&O.jsx(zb,{agent:x,socket:e}),f==="messages"&&O.jsx(Kb,{messages:i,agents:r,selectedAgentId:(x==null?void 0:x.id)??null,onClear:te}),f==="context"&&O.jsx(Xb,{entries:o,onRemove:H}),f==="files"&&O.jsx(Jb,{changes:y,agents:r,onClear:ce}),f==="prs"&&O.jsx(tE,{prs:a,branches:l,currentBranch:_,ghAvailable:v,repoInfo:c,agents:r,fetchPRDetail:m}),f==="crewmd"&&O.jsx(rE,{content:h,onChange:S})]})]})]}),O.jsxs("footer",{className:"app-footer",children:[O.jsxs("select",{value:k,onChange:ue=>M(ue.target.value),children:[O.jsx("option",{value:"all",children:"All Agents"}),r.filter(ue=>ue.status==="running").map(ue=>O.jsx("option",{value:ue.id,children:ue.name},ue.id))]}),O.jsx("input",{type:"text",placeholder:k==="all"?"Broadcast message to all agents...":`Send message to ${((be=r.find(ue=>ue.id===k))==null?void 0:be.name)||"agent"}...`,value:R,onChange:ue=>D(ue.target.value),onKeyDown:ue=>ue.key==="Enter"&&re()}),O.jsx("button",{className:"primary",onClick:re,disabled:!R.trim(),children:"Send"})]}),d&&O.jsx(iE,{onSpawn:G,onClose:()=>{u(!1),F(null)},initialMode:w,error:P}),I&&O.jsx("div",{className:"pair-modal-overlay",onClick:()=>q(!1),children:O.jsxs("div",{className:"pair-modal",onClick:ue=>ue.stopPropagation(),children:[O.jsxs("div",{className:"pair-modal-header",children:[O.jsx("h2",{children:"Connect Phone"}),O.jsx("button",{className:"pair-modal-close",onClick:()=>q(!1),children:"✕"})]}),V?O.jsx("p",{className:"pair-modal-error",children:V}):U?O.jsxs(O.Fragment,{children:[O.jsx("p",{className:"pair-modal-hint",children:"Scan to open Clustr on your phone's browser"}),O.jsx("img",{className:"pair-qr",src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(U.qrSvg)}`,alt:"QR code to connect phone"}),O.jsxs("div",{className:"pair-urls",children:[O.jsxs("div",{className:"pair-url-row",children:[O.jsx("span",{className:"pair-url-label",children:"Local"}),O.jsxs("span",{className:"pair-url-text",children:[U.localUrl,"?token=…"]}),O.jsx("button",{onClick:()=>navigator.clipboard.writeText(`${U.localUrl}?token=${U.token}`),children:"Copy"})]}),U.remoteUrl&&O.jsxs("div",{className:"pair-url-row",children:[O.jsx("span",{className:"pair-url-label",children:"Remote"}),O.jsxs("span",{className:"pair-url-text",children:[U.remoteUrl,"?token=…"]}),O.jsx("button",{onClick:()=>navigator.clipboard.writeText(`${U.remoteUrl}?token=${U.token}`),children:"Copy"})]}),!U.remoteUrl&&O.jsxs("p",{className:"pair-tunnel-hint",children:["Set ",O.jsx("code",{children:"CLUSTR_TUNNEL=1"})," to enable remote access via Cloudflare Tunnel."]})]})]}):O.jsx("p",{className:"pair-modal-loading",children:"Loading pairing info…"})]})})]})}tv.createRoot(document.getElementById("root")).render(O.jsx(Hu.StrictMode,{children:O.jsx(oE,{})}));
|
|
109
|
+
`);return O.jsxs("div",{className:"diff-viewer",children:[r&&O.jsx("div",{className:"diff-filename",children:r}),O.jsx("pre",{className:"diff-content",children:i.map((o,h)=>{let S="diff-line";return o.startsWith("+")&&!o.startsWith("+++")?S+=" diff-add":o.startsWith("-")&&!o.startsWith("---")?S+=" diff-del":o.startsWith("@@")?S+=" diff-hunk":o.startsWith("\\")&&(S+=" diff-meta"),O.jsx("div",{className:S,children:o},h)})})]})}function Gb(e){switch(e){case"add":return"A";case"change":return"M";case"unlink":return"D";default:return"?"}}function Qb(e){switch(e){case"add":return"#4ade80";case"change":return"#fbbf24";case"unlink":return"#f87171";default:return"#666"}}function Jb({changes:e,agents:r,onClear:i}){const[o,h]=J.useState(null),S=J.useMemo(()=>{const y=new Map;for(const a of r)y.set(a.id,a.name);return y},[r]);return O.jsxs("div",{className:"file-changes",children:[O.jsxs("div",{className:"file-changes-header",children:[O.jsxs("span",{children:["File Changes (",e.length,")"]}),e.length>0&&O.jsx("button",{className:"file-changes-clear-btn",onClick:i,children:"Clear"})]}),O.jsxs("div",{className:"file-changes-list",children:[e.length===0&&O.jsx("div",{className:"file-changes-empty",children:"No file changes detected yet. Changes will appear here as agents edit files."}),e.map(y=>{const a=y.agent_id?S.get(y.agent_id):null;return O.jsxs("div",{className:"file-change-item",children:[O.jsxs("div",{className:"file-change-row",onClick:()=>h(o===y.id?null:y.id),children:[O.jsx("span",{className:"file-change-type",style:{color:Qb(y.change_type)},children:Gb(y.change_type)}),O.jsx("span",{className:"file-change-path",children:y.file_path}),a&&O.jsx("span",{className:"file-change-agent",title:"Agent that made this change",children:a}),O.jsx("span",{className:"file-change-time",children:new Date(y.created_at).toLocaleTimeString()}),O.jsx("span",{className:"file-change-expand",children:y.diff_text?o===y.id?"▼":"▶":""})]}),o===y.id&&y.diff_text&&O.jsx(Yb,{diff:y.diff_text})]},y.id)})]})]})}function la(e){const r=Date.now()-new Date(e).getTime(),i=Math.floor(r/6e4);if(i<1)return"just now";if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const h=Math.floor(o/24);return h<30?`${h}d ago`:`${Math.floor(h/30)}mo ago`}function Zb(e){return!e||e.length===0?{icon:"",cls:""}:e.some(o=>o.conclusion==="FAILURE"||o.conclusion==="failure")?{icon:"✗",cls:"failure"}:e.some(o=>!o.conclusion||o.status==="IN_PROGRESS"||o.status==="QUEUED")?{icon:"○",cls:"pending"}:{icon:"✓",cls:"success"}}function eE(e){switch(e){case"APPROVED":return{text:"Approved",cls:"approved"};case"CHANGES_REQUESTED":return{text:"Changes",cls:"changes_requested"};case"REVIEW_REQUIRED":return{text:"Review",cls:"review_required"};default:return null}}function tE({prs:e,branches:r,currentBranch:i,ghAvailable:o,repoInfo:h,agents:S,fetchPRDetail:y}){const[a,l]=J.useState("all"),[_,v]=J.useState(null),[c,m]=J.useState(null),[C,b]=J.useState(!1),[x,f]=J.useState(!0),p=J.useMemo(()=>a==="all"?e:e.filter(L=>L.state.toUpperCase()===a.toUpperCase()),[e,a]),d=J.useMemo(()=>new Set(S.map(L=>L.name.toLowerCase())),[S]),u=async L=>{if(_===L){v(null),m(null);return}v(L),m(null),b(!0);const R=await y(L);m(R),b(!1)},w=L=>{const R=L.name.toLowerCase();for(const k of d)if(R.includes(k))return k;const D=L.author.toLowerCase();for(const k of d)if(D.includes(k))return k;return null};return O.jsxs("div",{className:"prs-tab",children:[O.jsxs("div",{className:"prs-header",children:[O.jsxs("div",{className:"prs-header-left",children:[O.jsxs("span",{children:["Pull Requests (",p.length,")"]}),O.jsxs("select",{className:"prs-filter",value:a,onChange:L=>l(L.target.value),children:[O.jsx("option",{value:"all",children:"All"}),O.jsx("option",{value:"open",children:"Open"}),O.jsx("option",{value:"closed",children:"Closed"}),O.jsx("option",{value:"merged",children:"Merged"})]})]}),h&&O.jsx("a",{className:"prs-repo-link",href:h.url,target:"_blank",rel:"noopener noreferrer",onClick:L=>{L.preventDefault(),window.open(h.url,"_blank")},children:h.nameWithOwner})]}),O.jsxs("div",{className:"prs-list",children:[o===!1&&O.jsxs("div",{className:"prs-unavailable",children:["GitHub CLI not available.",O.jsx("br",{}),"Install ",O.jsx("code",{children:"gh"})," and run ",O.jsx("code",{children:"gh auth login"})," to see PRs."]}),o!==!1&&p.length===0&&O.jsx("div",{className:"prs-empty",children:"No pull requests found."}),p.map(L=>{const R=L.isDraft?"draft":L.state.toLowerCase(),D=Zb(L.statusCheckRollup),k=eE(L.reviewDecision),M=_===L.number;return O.jsxs("div",{className:"pr-item",children:[O.jsxs("div",{className:"pr-row",onClick:()=>u(L.number),children:[O.jsx("span",{className:"pr-expand",children:M?"▼":"▶"}),O.jsx("span",{className:`pr-status-badge ${R}`}),O.jsxs("span",{className:"pr-number",children:["#",L.number]}),O.jsx("span",{className:"pr-title",children:L.title}),k&&O.jsx("span",{className:`pr-review ${k.cls}`,children:k.text}),D.icon&&O.jsx("span",{className:`pr-ci ${D.cls}`,children:D.icon}),O.jsx("span",{className:"pr-branch",title:L.headRefName,children:L.headRefName}),O.jsx("span",{className:"pr-author",children:L.author.login}),O.jsx("span",{className:"pr-time",children:la(L.createdAt)}),O.jsx("button",{className:"pr-link-btn",title:"Open in GitHub",onClick:W=>{W.stopPropagation(),window.open(L.url,"_blank")},children:"↗"})]}),M&&O.jsxs("div",{className:"pr-detail",children:[C&&O.jsx("div",{className:"pr-detail-loading",children:"Loading..."}),c&&c.number===L.number&&O.jsxs(O.Fragment,{children:[c.body&&O.jsx("div",{className:"pr-detail-body",children:c.body}),c.statusCheckRollup&&c.statusCheckRollup.length>0&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"pr-detail-section-title",children:"Checks"}),O.jsx("div",{className:"pr-detail-checks",children:c.statusCheckRollup.map((W,z)=>{var j,N,I,q;return O.jsxs("span",{className:`pr-check ${((j=W.conclusion)==null?void 0:j.toLowerCase())==="success"?"success":((N=W.conclusion)==null?void 0:N.toLowerCase())==="failure"?"failure":"pending"}`,children:[((I=W.conclusion)==null?void 0:I.toLowerCase())==="success"?"✓":((q=W.conclusion)==null?void 0:q.toLowerCase())==="failure"?"✗":"○"," ",W.name]},z)})})]}),c.reviews&&c.reviews.length>0&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"pr-detail-section-title",children:"Reviews"}),c.reviews.map((W,z)=>O.jsxs("div",{className:"pr-comment",children:[O.jsxs("div",{className:"pr-comment-header",children:[O.jsx("strong",{children:W.author.login})," ",W.state.toLowerCase().replace("_"," ")," ",la(W.submittedAt)]}),W.body&&O.jsx("div",{className:"pr-comment-body",children:W.body})]},z))]}),c.comments&&c.comments.length>0&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"pr-detail-section-title",children:"Comments"}),c.comments.map((W,z)=>O.jsxs("div",{className:"pr-comment",children:[O.jsxs("div",{className:"pr-comment-header",children:[O.jsx("strong",{children:W.author.login})," ",la(W.createdAt)]}),O.jsx("div",{className:"pr-comment-body",children:W.body})]},z))]}),(!c.reviews||c.reviews.length===0)&&(!c.comments||c.comments.length===0)&&!c.body&&O.jsx("div",{className:"pr-detail-loading",children:"No details available."})]})]})]},L.number)})]}),O.jsxs("div",{className:"branches-section",children:[O.jsxs("div",{className:"branches-header",onClick:()=>f(L=>!L),children:[O.jsxs("span",{children:["Branches (",r.length,")",i?` — ${i}`:""]}),O.jsx("span",{className:"branches-toggle",children:x?"▼":"▶"})]}),x&&O.jsxs("div",{className:"branches-list",children:[r.length===0&&O.jsx("div",{className:"prs-empty",children:"No branches found."}),r.map(L=>{const R=w(L);return O.jsxs("div",{className:`branch-item ${L.isCurrent?"current":""}`,children:[O.jsx("span",{className:"branch-current-marker",children:L.isCurrent?"●":""}),O.jsx("span",{className:`branch-name ${L.isCurrent?"current":""}`,title:L.name,children:L.name}),O.jsx("span",{className:"branch-message",children:L.lastCommitMessage}),R&&O.jsx("span",{className:"pr-branch",children:R}),O.jsx("span",{className:"branch-author",children:L.author}),O.jsxs("div",{className:"branch-ahead-behind",children:[L.ahead>0&&O.jsxs("span",{className:"branch-badge ahead",children:[L.ahead,"\\u2191"]}),L.behind>0&&O.jsxs("span",{className:"branch-badge behind",children:[L.behind,"\\u2193"]})]}),O.jsx("span",{className:"branch-time",children:L.lastCommitDate?la(L.lastCommitDate):""})]},L.name)})]})]})]})}function rE({content:e,onChange:r}){const[i,o]=J.useState(e),[h,S]=J.useState(!1),[y,a]=J.useState(!1),l=J.useRef(null);J.useEffect(()=>{y||o(e)},[e,y]);const _=m=>{o(m),a(!0)},v=async()=>{S(!0);try{await fetch("/api/crewmd",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:i})}),r(i),a(!1)}catch{}S(!1)},c=m=>{(m.metaKey||m.ctrlKey)&&m.key==="s"&&(m.preventDefault(),y&&v())};return O.jsxs("div",{className:"crewmd-editor",children:[O.jsxs("div",{className:"crewmd-header",children:[O.jsx("span",{className:"crewmd-title",children:"Rules"}),O.jsxs("div",{className:"crewmd-actions",children:[y&&O.jsx("span",{className:"crewmd-dirty",children:"unsaved"}),O.jsx("button",{className:"crewmd-save-btn",onClick:v,disabled:!y||h,children:h?"Saving...":"Save"})]})]}),O.jsx("textarea",{ref:l,className:"crewmd-textarea",value:i,onChange:m=>_(m.target.value),onKeyDown:c,spellCheck:!1,placeholder:"Write global instructions for all agents..."})]})}function nE(e){const[r,i]=J.useState([]),[o,h]=J.useState([]),[S,y]=J.useState(""),[a,l]=J.useState(null),[_,v]=J.useState(null),[c,m]=J.useState(!0);J.useEffect(()=>{fetch("/api/github/status").then(b=>b.json()).then(b=>{l(b.available),v(b.repo||null)}).catch(()=>l(!1)),fetch("/api/github/prs?state=all").then(b=>b.json()).then(b=>{Array.isArray(b)&&i(b)}).catch(()=>{}),fetch("/api/git/branches").then(b=>b.json()).then(b=>{b.current&&y(b.current),Array.isArray(b.branches)&&h(b.branches)}).catch(()=>{}).finally(()=>m(!1))},[]),J.useEffect(()=>{const b=e.current;if(!b)return;const x=p=>{Array.isArray(p)&&i(p)},f=p=>{p.current&&y(p.current),Array.isArray(p.branches)&&h(p.branches)};return b.on("github:prs:updated",x),b.on("git:branches:updated",f),()=>{b.off("github:prs:updated",x),b.off("git:branches:updated",f)}},[e]);const C=J.useCallback(async b=>{try{const x=await fetch(`/api/github/prs/${b}`);return x.ok?await x.json():null}catch{return null}},[]);return{prs:r,branches:o,currentBranch:S,ghAvailable:a,repoInfo:_,loading:c,fetchPRDetail:C}}function iE({onSpawn:e,onClose:r,initialMode:i="spawn",error:o}){const[h,S]=J.useState(i),[y,a]=J.useState(""),[l,_]=J.useState(""),[v,c]=J.useState(""),[m,C]=J.useState("claude"),[b,x]=J.useState(!1),f=async()=>{x(!0);try{const u=await(await fetch("/api/pick-folder",{method:"POST"})).json();u.path&&c(u.path)}catch{}x(!1)},p=()=>{if(h==="open"){if(!v.trim())return;const d=v.trim().split("/").filter(Boolean).pop()||"project";e(y.trim()||d,l.trim()||`Work on the project at ${v.trim()}. Explore the codebase and wait for instructions.`,v.trim(),m)}else{if(!y.trim()||!l.trim())return;e(y.trim(),l.trim(),v.trim()||void 0,m)}};return O.jsx("div",{className:"dialog-overlay",onClick:r,children:O.jsxs("div",{className:"dialog",onClick:d=>d.stopPropagation(),children:[O.jsxs("div",{className:"dialog-mode-tabs",children:[O.jsx("button",{className:`dialog-mode-tab ${h==="spawn"?"active":""}`,onClick:()=>S("spawn"),children:"Spawn Agent"}),O.jsx("button",{className:`dialog-mode-tab ${h==="open"?"active":""}`,onClick:()=>S("open"),children:"Open Project"})]}),O.jsxs("label",{children:["Agent Service",O.jsxs("div",{className:"service-selector",children:[O.jsx("button",{type:"button",className:`service-btn ${m==="claude"?"active":""}`,onClick:()=>C("claude"),children:"Claude"}),O.jsx("button",{type:"button",className:`service-btn ${m==="codex"?"active":""}`,onClick:()=>C("codex"),children:"Codex"})]})]}),h==="open"?O.jsxs(O.Fragment,{children:[O.jsxs("label",{children:["Project Directory",O.jsxs("div",{className:"browse-row",children:[O.jsx("input",{type:"text",value:v,onChange:d=>c(d.target.value),placeholder:"/Users/you/your-project",autoFocus:!0}),O.jsx("button",{type:"button",className:"browse-btn",onClick:f,disabled:b,children:b?"...":"Browse"})]})]}),O.jsxs("label",{children:["Agent Name ",O.jsx("span",{className:"optional",children:"(optional)"}),O.jsx("input",{type:"text",value:y,onChange:d=>a(d.target.value),placeholder:"Auto-detected from path"})]}),O.jsxs("label",{children:["Initial Task ",O.jsx("span",{className:"optional",children:"(optional)"}),O.jsx("textarea",{value:l,onChange:d=>_(d.target.value),placeholder:"Explore the codebase and wait for instructions...",rows:3})]})]}):O.jsxs(O.Fragment,{children:[O.jsxs("label",{children:["Name",O.jsx("input",{type:"text",value:y,onChange:d=>a(d.target.value),placeholder:"e.g. researcher",autoFocus:!0})]}),O.jsxs("label",{children:["Task",O.jsx("textarea",{value:l,onChange:d=>_(d.target.value),placeholder:"Describe what this agent should do...",rows:4})]}),O.jsxs("label",{children:["Working Directory ",O.jsx("span",{className:"optional",children:"(optional)"}),O.jsxs("div",{className:"browse-row",children:[O.jsx("input",{type:"text",value:v,onChange:d=>c(d.target.value),placeholder:"e.g. /Users/you/project (leave blank for server cwd)"}),O.jsx("button",{type:"button",className:"browse-btn",onClick:f,disabled:b,children:b?"...":"Browse"})]})]})]}),o&&O.jsx("div",{className:"dialog-error",children:o}),O.jsxs("div",{className:"dialog-actions",children:[O.jsx("button",{onClick:r,children:"Cancel"}),O.jsx("button",{className:"primary",onClick:p,children:h==="open"?"Open":"Spawn"})]})]})})}function sE({size:e=28}){return O.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[O.jsx("path",{d:"M50 5 A45 45 0 1 1 15 75",stroke:"currentColor",strokeWidth:"6",strokeLinecap:"round",fill:"none"}),O.jsx("path",{d:"M30 18 Q55 45 78 30",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),O.jsx("path",{d:"M20 55 Q50 35 75 65",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),O.jsx("path",{d:"M22 72 Q50 60 50 90",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round",fill:"none"}),O.jsx("circle",{cx:"30",cy:"18",r:"6",fill:"currentColor"}),O.jsx("circle",{cx:"78",cy:"30",r:"6",fill:"currentColor"}),O.jsx("circle",{cx:"75",cy:"65",r:"6",fill:"currentColor"}),O.jsx("circle",{cx:"22",cy:"72",r:"6",fill:"currentColor"}),O.jsx("circle",{cx:"50",cy:"90",r:"5.5",fill:"currentColor"})]})}function oE(){var be;const{socket:e,agents:r,messages:i,contextEntries:o,crewMd:h,setCrewMd:S,fileChanges:y}=Yv(),{prs:a,branches:l,currentBranch:_,ghAvailable:v,repoInfo:c,fetchPRDetail:m}=nE(e),[C,b]=J.useState(null),x=r.find(ue=>ue.id===C)??null,[f,p]=J.useState("graph"),[d,u]=J.useState(!1),[w,L]=J.useState("spawn"),[R,D]=J.useState(""),[k,M]=J.useState("all"),[W,z]=J.useState("multi"),[j,N]=J.useState(()=>window.innerWidth>=768),[I,q]=J.useState(!1),[U,K]=J.useState(null),[V,T]=J.useState(null),B=J.useCallback(async()=>{q(!0),T(null);try{const ue=await fetch("/api/pair");if(!ue.ok){const Re=await ue.text();T(Re||`Error ${ue.status}`);return}const ge=await ue.json();K(ge)}catch(ue){T(ue.message||"Failed to load pairing info")}},[]),[P,F]=J.useState(null),G=J.useCallback(async(ue,ge,Re,Ie)=>{F(null);try{const ze=await Er("/api/spawn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ue,task:ge,cwd:Re,service:Ie||"claude"})}),Qe=await ze.json();if(!ze.ok){F(Qe.error||"Unknown error");return}u(!1),F(null)}catch(ze){F(ze.message||"Failed to connect to server")}},[]),Z=J.useCallback(async ue=>{await fetch(`/api/agents/${ue}`,{method:"DELETE"})},[]),ie=J.useCallback(async ue=>{await fetch(`/api/agents/${ue}/remove`,{method:"DELETE"}),C===ue&&b(null)},[C]),ae=J.useCallback(async ue=>{await fetch(`/api/agents/${ue}/rollback`,{method:"POST"})},[]),X=J.useCallback(async ue=>{await fetch(`/api/agents/${ue.id}/remove`,{method:"DELETE"});const Re=await(await Er("/api/spawn",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ue.name,task:ue.task,cwd:ue.agent_cwd||void 0,service:ue.service||"claude"})})).json();Re.id&&(b(Re.id),p("terminal"))},[]),H=J.useCallback(async ue=>{await fetch(`/api/context/${encodeURIComponent(ue)}`,{method:"DELETE"})},[]),re=J.useCallback(async()=>{if(!R.trim())return;const ue=k,ge=R;if(D(""),ue!=="all")await fetch(`/api/agents/${ue}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:ge})}).catch(()=>{}),await Er("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:"user",to:ue,content:ge})});else{const Re=r.filter(Ie=>Ie.status==="running");await Promise.all(Re.map(Ie=>fetch(`/api/agents/${Ie.id}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:ge})}).catch(()=>{}))),await Er("/api/messages",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:"user",to:"all",content:ge})})}},[R,k,r]),te=J.useCallback(async()=>{await Er("/api/messages",{method:"DELETE"})},[]),ce=J.useCallback(async()=>{await Er("/api/file-changes",{method:"DELETE"})},[]),le=J.useCallback(ue=>{b(ue.id),p("terminal")},[]),pe=J.useCallback(ue=>{L(ue),u(!0)},[]);J.useEffect(()=>{const ue=["graph","terminal","files","prs","messages","context","crewmd"],ge=Re=>{const Ie=Re.target,ze=Ie.tagName==="INPUT"||Ie.tagName==="TEXTAREA"||Ie.tagName==="SELECT",Qe=Ie.closest(".xterm"),ut=Re.metaKey||Re.ctrlKey;if(Re.key==="Escape"){u(!1);return}const qe=ut&&(Re.key==="["||Re.key==="]"||Re.key==="\\");if(Qe&&qe)Re.stopPropagation();else if(ze||Qe)return;if(!ut)return;const pt=parseInt(Re.key);if(pt>=1&&pt<=ue.length){Re.preventDefault(),p(ue[pt-1]);return}switch(Re.key){case"n":Re.preventDefault(),L("spawn"),u(!0);break;case"o":Re.preventDefault(),L("open"),u(!0);break;case"[":{Re.preventDefault();const Ne=r.filter($e=>$e.status!=="dead");if(Ne.length===0)break;const Je=Ne.findIndex($e=>$e.id===C),ht=Je<=0?Ne.length-1:Je-1;b(Ne[ht].id),p("terminal");break}case"]":{Re.preventDefault();const Ne=r.filter($e=>$e.status!=="dead");if(Ne.length===0)break;const Je=Ne.findIndex($e=>$e.id===C),ht=Je>=Ne.length-1?0:Je+1;b(Ne[ht].id),p("terminal");break}case"\\":Re.preventDefault(),z(Ne=>Ne==="multi"?"single":"multi");break}};return document.addEventListener("keydown",ge,!0),()=>document.removeEventListener("keydown",ge,!0)},[r,C]);const Se=[{key:"graph",label:"Graph"},{key:"terminal",label:"Terminal"},{key:"files",label:"Files"},{key:"prs",label:"PRs"},{key:"messages",label:"Messages"},{key:"context",label:"Context"},{key:"crewmd",label:"Rules"}];return O.jsxs("div",{className:"app",children:[O.jsxs("header",{className:"app-header",children:[O.jsx("button",{className:"header-hamburger",onClick:()=>N(ue=>!ue),title:"Toggle sidebar",children:"☰"}),O.jsxs("div",{className:"header-brand",children:[O.jsx(sE,{size:26}),O.jsx("h1",{children:"Clustr"})]}),(()=>{const ue=r.reduce((ge,Re)=>ge+(Re.total_cost||0),0);return ue>0?O.jsxs("span",{className:"header-total-cost",children:["Total: $",ue.toFixed(4)]}):null})(),O.jsxs("div",{className:"header-actions",children:[window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?O.jsx("button",{className:"header-connect-phone",onClick:B,title:"Connect phone",children:"Connect Phone"}):null,O.jsx("button",{onClick:()=>pe("open"),children:"Open Project"}),O.jsx("button",{className:"primary",onClick:()=>pe("spawn"),children:"New Agent"})]})]}),O.jsxs("div",{className:"app-body",children:[j&&O.jsx("div",{className:"sidebar-backdrop",onClick:()=>N(!1)}),O.jsxs("aside",{className:`sidebar ${j?"":"collapsed"}`,children:[O.jsx("button",{className:"sidebar-toggle",onClick:()=>N(ue=>!ue),title:j?"Collapse sidebar":"Expand sidebar",children:j?"‹":"›"}),j&&O.jsx(Qv,{agents:r,selectedId:C,onSelect:ue=>{b(ue.id),p("terminal"),window.innerWidth<768&&N(!1)},onKill:Z,onRemove:ie,onRollback:ae,onRestart:X})]}),O.jsxs("main",{className:"main-content",children:[O.jsxs("nav",{className:"tabs",children:[Se.map(ue=>O.jsx("button",{className:f===ue.key?"tab active":"tab",onClick:()=>p(ue.key),children:ue.label},ue.key)),f==="terminal"&&O.jsxs("div",{className:"terminal-view-toggle",children:[O.jsx("button",{className:`view-toggle-btn ${W==="multi"?"active":""}`,onClick:()=>z("multi"),title:"Split view — all agents",children:"⊞"}),O.jsx("button",{className:`view-toggle-btn ${W==="single"?"active":""}`,onClick:()=>z("single"),title:"Single view — selected agent",children:"☐"})]})]}),O.jsxs("div",{className:"tab-content",children:[f==="graph"&&O.jsx(ob,{agents:r,messages:i,onSelectAgent:le}),f==="terminal"&&W==="multi"&&O.jsx(qb,{agents:r,socket:e,onSelectAgent:ue=>b(ue.id)}),f==="terminal"&&W==="single"&&O.jsx(zb,{agent:x,socket:e}),f==="messages"&&O.jsx(Kb,{messages:i,agents:r,selectedAgentId:(x==null?void 0:x.id)??null,onClear:te}),f==="context"&&O.jsx(Xb,{entries:o,onRemove:H}),f==="files"&&O.jsx(Jb,{changes:y,agents:r,onClear:ce}),f==="prs"&&O.jsx(tE,{prs:a,branches:l,currentBranch:_,ghAvailable:v,repoInfo:c,agents:r,fetchPRDetail:m}),f==="crewmd"&&O.jsx(rE,{content:h,onChange:S})]})]})]}),O.jsxs("footer",{className:"app-footer",children:[O.jsxs("select",{value:k,onChange:ue=>M(ue.target.value),children:[O.jsx("option",{value:"all",children:"All Agents"}),r.filter(ue=>ue.status==="running").map(ue=>O.jsx("option",{value:ue.id,children:ue.name},ue.id))]}),O.jsx("input",{type:"text",placeholder:k==="all"?"Broadcast message to all agents...":`Send message to ${((be=r.find(ue=>ue.id===k))==null?void 0:be.name)||"agent"}...`,value:R,onChange:ue=>D(ue.target.value),onKeyDown:ue=>ue.key==="Enter"&&re()}),O.jsx("button",{className:"primary",onClick:re,disabled:!R.trim(),children:"Send"})]}),d&&O.jsx(iE,{onSpawn:G,onClose:()=>{u(!1),F(null)},initialMode:w,error:P}),I&&O.jsx("div",{className:"pair-modal-overlay",onClick:()=>q(!1),children:O.jsxs("div",{className:"pair-modal",onClick:ue=>ue.stopPropagation(),children:[O.jsxs("div",{className:"pair-modal-header",children:[O.jsx("h2",{children:"Connect Phone"}),O.jsx("button",{className:"pair-modal-close",onClick:()=>q(!1),children:"✕"})]}),V?O.jsx("p",{className:"pair-modal-error",children:V}):U?O.jsxs(O.Fragment,{children:[O.jsx("p",{className:"pair-modal-hint",children:"Scan to open Clustr on your phone's browser"}),O.jsx("img",{className:"pair-qr",src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(U.qrSvg)}`,alt:"QR code to connect phone"}),O.jsxs("div",{className:"pair-urls",children:[O.jsxs("div",{className:"pair-url-row",children:[O.jsx("span",{className:"pair-url-label",children:"Local"}),O.jsxs("span",{className:"pair-url-text",children:[U.localUrl,"?token=…"]}),O.jsx("button",{onClick:()=>navigator.clipboard.writeText(`${U.localUrl}?token=${U.token}`),children:"Copy"})]}),U.remoteUrl&&O.jsxs("div",{className:"pair-url-row",children:[O.jsx("span",{className:"pair-url-label",children:"Remote"}),O.jsxs("span",{className:"pair-url-text",children:[U.remoteUrl,"?token=…"]}),O.jsx("button",{onClick:()=>navigator.clipboard.writeText(`${U.remoteUrl}?token=${U.token}`),children:"Copy"})]}),!U.remoteUrl&&O.jsxs("p",{className:"pair-tunnel-hint",children:["Set ",O.jsx("code",{children:"CLUSTR_TUNNEL=1"})," to enable remote access via Cloudflare Tunnel."]})]})]}):O.jsx("p",{className:"pair-modal-loading",children:"Loading pairing info…"})]})})]})}tv.createRoot(document.getElementById("root")).render(O.jsx(Hu.StrictMode,{children:O.jsx(oE,{})}));
|