archbyte 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,72 @@
1
+ (function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(a){if(a.ep)return;a.ep=!0;const c=i(a);fetch(a.href,c)}})();function vu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Dc={exports:{}},Zo={},$c={exports:{}},De={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var eh;function o0(){if(eh)return De;eh=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function x(P){return P===null||typeof P!="object"?null:(P=y&&P[y]||P["@@iterator"],typeof P=="function"?P:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,k={};function _(P,O,oe){this.props=P,this.context=O,this.refs=k,this.updater=oe||C}_.prototype.isReactComponent={},_.prototype.setState=function(P,O){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,O,"setState")},_.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function N(){}N.prototype=_.prototype;function j(P,O,oe){this.props=P,this.context=O,this.refs=k,this.updater=oe||C}var S=j.prototype=new N;S.constructor=j,E(S,_.prototype),S.isPureReactComponent=!0;var M=Array.isArray,$=Object.prototype.hasOwnProperty,L={current:null},H={key:!0,ref:!0,__self:!0,__source:!0};function Z(P,O,oe){var se,he={},de=null,pe=null;if(O!=null)for(se in O.ref!==void 0&&(pe=O.ref),O.key!==void 0&&(de=""+O.key),O)$.call(O,se)&&!H.hasOwnProperty(se)&&(he[se]=O[se]);var ie=arguments.length-2;if(ie===1)he.children=oe;else if(1<ie){for(var me=Array(ie),ke=0;ke<ie;ke++)me[ke]=arguments[ke+2];he.children=me}if(P&&P.defaultProps)for(se in ie=P.defaultProps,ie)he[se]===void 0&&(he[se]=ie[se]);return{$$typeof:t,type:P,key:de,ref:pe,props:he,_owner:L.current}}function B(P,O){return{$$typeof:t,type:P.type,key:O,ref:P.ref,props:P.props,_owner:P._owner}}function J(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function W(P){var O={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(oe){return O[oe]})}var G=/\/+/g;function te(P,O){return typeof P=="object"&&P!==null&&P.key!=null?W(""+P.key):O.toString(36)}function z(P,O,oe,se,he){var de=typeof P;(de==="undefined"||de==="boolean")&&(P=null);var pe=!1;if(P===null)pe=!0;else switch(de){case"string":case"number":pe=!0;break;case"object":switch(P.$$typeof){case t:case r:pe=!0}}if(pe)return pe=P,he=he(pe),P=se===""?"."+te(pe,0):se,M(he)?(oe="",P!=null&&(oe=P.replace(G,"$&/")+"/"),z(he,O,oe,"",function(ke){return ke})):he!=null&&(J(he)&&(he=B(he,oe+(!he.key||pe&&pe.key===he.key?"":(""+he.key).replace(G,"$&/")+"/")+P)),O.push(he)),1;if(pe=0,se=se===""?".":se+":",M(P))for(var ie=0;ie<P.length;ie++){de=P[ie];var me=se+te(de,ie);pe+=z(de,O,oe,me,he)}else if(me=x(P),typeof me=="function")for(P=me.call(P),ie=0;!(de=P.next()).done;)de=de.value,me=se+te(de,ie++),pe+=z(de,O,oe,me,he);else if(de==="object")throw O=String(P),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.");return pe}function Q(P,O,oe){if(P==null)return P;var se=[],he=0;return z(P,se,"","",function(de){return O.call(oe,de,he++)}),se}function T(P){if(P._status===-1){var O=P._result;O=O(),O.then(function(oe){(P._status===0||P._status===-1)&&(P._status=1,P._result=oe)},function(oe){(P._status===0||P._status===-1)&&(P._status=2,P._result=oe)}),P._status===-1&&(P._status=0,P._result=O)}if(P._status===1)return P._result.default;throw P._result}var K={current:null},R={transition:null},A={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:R,ReactCurrentOwner:L};function U(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:Q,forEach:function(P,O,oe){Q(P,function(){O.apply(this,arguments)},oe)},count:function(P){var O=0;return Q(P,function(){O++}),O},toArray:function(P){return Q(P,function(O){return O})||[]},only:function(P){if(!J(P))throw Error("React.Children.only expected to receive a single React element child.");return P}},De.Component=_,De.Fragment=i,De.Profiler=a,De.PureComponent=j,De.StrictMode=s,De.Suspense=m,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,De.act=U,De.cloneElement=function(P,O,oe){if(P==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+P+".");var se=E({},P.props),he=P.key,de=P.ref,pe=P._owner;if(O!=null){if(O.ref!==void 0&&(de=O.ref,pe=L.current),O.key!==void 0&&(he=""+O.key),P.type&&P.type.defaultProps)var ie=P.type.defaultProps;for(me in O)$.call(O,me)&&!H.hasOwnProperty(me)&&(se[me]=O[me]===void 0&&ie!==void 0?ie[me]:O[me])}var me=arguments.length-2;if(me===1)se.children=oe;else if(1<me){ie=Array(me);for(var ke=0;ke<me;ke++)ie[ke]=arguments[ke+2];se.children=ie}return{$$typeof:t,type:P.type,key:he,ref:de,props:se,_owner:pe}},De.createContext=function(P){return P={$$typeof:u,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},P.Provider={$$typeof:c,_context:P},P.Consumer=P},De.createElement=Z,De.createFactory=function(P){var O=Z.bind(null,P);return O.type=P,O},De.createRef=function(){return{current:null}},De.forwardRef=function(P){return{$$typeof:h,render:P}},De.isValidElement=J,De.lazy=function(P){return{$$typeof:v,_payload:{_status:-1,_result:P},_init:T}},De.memo=function(P,O){return{$$typeof:g,type:P,compare:O===void 0?null:O}},De.startTransition=function(P){var O=R.transition;R.transition={};try{P()}finally{R.transition=O}},De.unstable_act=U,De.useCallback=function(P,O){return K.current.useCallback(P,O)},De.useContext=function(P){return K.current.useContext(P)},De.useDebugValue=function(){},De.useDeferredValue=function(P){return K.current.useDeferredValue(P)},De.useEffect=function(P,O){return K.current.useEffect(P,O)},De.useId=function(){return K.current.useId()},De.useImperativeHandle=function(P,O,oe){return K.current.useImperativeHandle(P,O,oe)},De.useInsertionEffect=function(P,O){return K.current.useInsertionEffect(P,O)},De.useLayoutEffect=function(P,O){return K.current.useLayoutEffect(P,O)},De.useMemo=function(P,O){return K.current.useMemo(P,O)},De.useReducer=function(P,O,oe){return K.current.useReducer(P,O,oe)},De.useRef=function(P){return K.current.useRef(P)},De.useState=function(P){return K.current.useState(P)},De.useSyncExternalStore=function(P,O,oe){return K.current.useSyncExternalStore(P,O,oe)},De.useTransition=function(){return K.current.useTransition()},De.version="18.3.1",De}var th;function ms(){return th||(th=1,$c.exports=o0()),$c.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var nh;function s0(){if(nh)return Zo;nh=1;var t=ms(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(h,m,g){var v,y={},x=null,C=null;g!==void 0&&(x=""+g),m.key!==void 0&&(x=""+m.key),m.ref!==void 0&&(C=m.ref);for(v in m)s.call(m,v)&&!c.hasOwnProperty(v)&&(y[v]=m[v]);if(h&&h.defaultProps)for(v in m=h.defaultProps,m)y[v]===void 0&&(y[v]=m[v]);return{$$typeof:r,type:h,key:x,ref:C,props:y,_owner:a.current}}return Zo.Fragment=i,Zo.jsx=u,Zo.jsxs=u,Zo}var rh;function l0(){return rh||(rh=1,Dc.exports=s0()),Dc.exports}var d=l0(),b=ms();const jp=vu(b);var El={},Oc={exports:{}},Ht={},Fc={exports:{}},Hc={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var ih;function a0(){return ih||(ih=1,(function(t){function r(R,A){var U=R.length;R.push(A);e:for(;0<U;){var P=U-1>>>1,O=R[P];if(0<a(O,A))R[P]=A,R[U]=O,U=P;else break e}}function i(R){return R.length===0?null:R[0]}function s(R){if(R.length===0)return null;var A=R[0],U=R.pop();if(U!==A){R[0]=U;e:for(var P=0,O=R.length,oe=O>>>1;P<oe;){var se=2*(P+1)-1,he=R[se],de=se+1,pe=R[de];if(0>a(he,U))de<O&&0>a(pe,he)?(R[P]=pe,R[de]=U,P=de):(R[P]=he,R[se]=U,P=se);else if(de<O&&0>a(pe,U))R[P]=pe,R[de]=U,P=de;else break e}}return A}function a(R,A){var U=R.sortIndex-A.sortIndex;return U!==0?U:R.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var u=Date,h=u.now();t.unstable_now=function(){return u.now()-h}}var m=[],g=[],v=1,y=null,x=3,C=!1,E=!1,k=!1,_=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(R){for(var A=i(g);A!==null;){if(A.callback===null)s(g);else if(A.startTime<=R)s(g),A.sortIndex=A.expirationTime,r(m,A);else break;A=i(g)}}function M(R){if(k=!1,S(R),!E)if(i(m)!==null)E=!0,T($);else{var A=i(g);A!==null&&K(M,A.startTime-R)}}function $(R,A){E=!1,k&&(k=!1,N(Z),Z=-1),C=!0;var U=x;try{for(S(A),y=i(m);y!==null&&(!(y.expirationTime>A)||R&&!W());){var P=y.callback;if(typeof P=="function"){y.callback=null,x=y.priorityLevel;var O=P(y.expirationTime<=A);A=t.unstable_now(),typeof O=="function"?y.callback=O:y===i(m)&&s(m),S(A)}else s(m);y=i(m)}if(y!==null)var oe=!0;else{var se=i(g);se!==null&&K(M,se.startTime-A),oe=!1}return oe}finally{y=null,x=U,C=!1}}var L=!1,H=null,Z=-1,B=5,J=-1;function W(){return!(t.unstable_now()-J<B)}function G(){if(H!==null){var R=t.unstable_now();J=R;var A=!0;try{A=H(!0,R)}finally{A?te():(L=!1,H=null)}}else L=!1}var te;if(typeof j=="function")te=function(){j(G)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,Q=z.port2;z.port1.onmessage=G,te=function(){Q.postMessage(null)}}else te=function(){_(G,0)};function T(R){H=R,L||(L=!0,te())}function K(R,A){Z=_(function(){R(t.unstable_now())},A)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(R){R.callback=null},t.unstable_continueExecution=function(){E||C||(E=!0,T($))},t.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<R?Math.floor(1e3/R):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_getFirstCallbackNode=function(){return i(m)},t.unstable_next=function(R){switch(x){case 1:case 2:case 3:var A=3;break;default:A=x}var U=x;x=A;try{return R()}finally{x=U}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(R,A){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var U=x;x=R;try{return A()}finally{x=U}},t.unstable_scheduleCallback=function(R,A,U){var P=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?P+U:P):U=P,R){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=U+O,R={id:v++,callback:A,priorityLevel:R,startTime:U,expirationTime:O,sortIndex:-1},U>P?(R.sortIndex=U,r(g,R),i(m)===null&&R===i(g)&&(k?(N(Z),Z=-1):k=!0,K(M,U-P))):(R.sortIndex=O,r(m,R),E||C||(E=!0,T($))),R},t.unstable_shouldYield=W,t.unstable_wrapCallback=function(R){var A=x;return function(){var U=x;x=A;try{return R.apply(this,arguments)}finally{x=U}}}})(Hc)),Hc}var oh;function c0(){return oh||(oh=1,Fc.exports=a0()),Fc.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var sh;function u0(){if(sh)return Ht;sh=1;var t=ms(),r=c0();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function c(e,n){u(e,n),u(e+"Capture",n)}function u(e,n){for(a[e]=n,e=0;e<n.length;e++)s.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},y={};function x(e){return m.call(y,e)?!0:m.call(v,e)?!1:g.test(e)?y[e]=!0:(v[e]=!0,!1)}function C(e,n,o,l){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,n,o,l){if(n===null||typeof n>"u"||C(e,n,o,l))return!0;if(l)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function k(e,n,o,l,f,p,w){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=f,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=p,this.removeEmptyString=w}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_[e]=new k(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];_[n]=new k(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){_[e]=new k(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_[e]=new k(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){_[e]=new k(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){_[e]=new k(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){_[e]=new k(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){_[e]=new k(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){_[e]=new k(e,5,!1,e.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function j(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(N,j);_[n]=new k(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(N,j);_[n]=new k(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(N,j);_[n]=new k(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){_[e]=new k(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){_[e]=new k(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,n,o,l){var f=_.hasOwnProperty(n)?_[n]:null;(f!==null?f.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(E(n,o,f,l)&&(o=null),l||f===null?x(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):f.mustUseProperty?e[f.propertyName]=o===null?f.type===3?!1:"":o:(n=f.attributeName,l=f.attributeNamespace,o===null?e.removeAttribute(n):(f=f.type,o=f===3||f===4&&o===!0?"":""+o,l?e.setAttributeNS(l,n,o):e.setAttribute(n,o))))}var M=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),L=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),J=Symbol.for("react.provider"),W=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),R=Symbol.iterator;function A(e){return e===null||typeof e!="object"?null:(e=R&&e[R]||e["@@iterator"],typeof e=="function"?e:null)}var U=Object.assign,P;function O(e){if(P===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);P=n&&n[1]||""}return`
34
+ `+P+e}var oe=!1;function se(e,n){if(!e||oe)return"";oe=!0;var o=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(ee){var l=ee}Reflect.construct(e,[],n)}else{try{n.call()}catch(ee){l=ee}e.call(n.prototype)}else{try{throw Error()}catch(ee){l=ee}e()}}catch(ee){if(ee&&l&&typeof ee.stack=="string"){for(var f=ee.stack.split(`
35
+ `),p=l.stack.split(`
36
+ `),w=f.length-1,I=p.length-1;1<=w&&0<=I&&f[w]!==p[I];)I--;for(;1<=w&&0<=I;w--,I--)if(f[w]!==p[I]){if(w!==1||I!==1)do if(w--,I--,0>I||f[w]!==p[I]){var D=`
37
+ `+f[w].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),D}while(1<=w&&0<=I);break}}}finally{oe=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?O(e):""}function he(e){switch(e.tag){case 5:return O(e.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return e=se(e.type,!1),e;case 11:return e=se(e.type.render,!1),e;case 1:return e=se(e.type,!0),e;default:return""}}function de(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case H:return"Fragment";case L:return"Portal";case B:return"Profiler";case Z:return"StrictMode";case te:return"Suspense";case z:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case W:return(e.displayName||"Context")+".Consumer";case J:return(e._context.displayName||"Context")+".Provider";case G:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Q:return n=e.displayName||null,n!==null?n:de(e.type)||"Memo";case T:n=e._payload,e=e._init;try{return de(e(n))}catch{}}return null}function pe(e){var n=e.type;switch(e.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 e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return de(n);case 8:return n===Z?"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 ie(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function me(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ke(e){var n=me(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,p=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(w){l=""+w,p.call(this,w)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function je(e){e._valueTracker||(e._valueTracker=ke(e))}function be(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=me(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function Ne(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ze(e,n){var o=n.checked;return U({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function Be(e,n){var o=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;o=ie(n.value!=null?n.value:o),e._wrapperState={initialChecked:l,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Ae(e,n){n=n.checked,n!=null&&S(e,"checked",n,!1)}function et(e,n){Ae(e,n);var o=ie(n.value),l=n.type;if(o!=null)l==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?pt(e,n.type,o):n.hasOwnProperty("defaultValue")&&pt(e,n.type,ie(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Mt(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function pt(e,n,o){(n!=="number"||Ne(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var xt=Array.isArray;function wt(e,n,o,l){if(e=e.options,n){n={};for(var f=0;f<o.length;f++)n["$"+o[f]]=!0;for(o=0;o<e.length;o++)f=n.hasOwnProperty("$"+e[o].value),e[o].selected!==f&&(e[o].selected=f),f&&l&&(e[o].defaultSelected=!0)}else{for(o=""+ie(o),n=null,f=0;f<e.length;f++){if(e[f].value===o){e[f].selected=!0,l&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function Wt(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return U({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function zt(e,n){var o=n.value;if(o==null){if(o=n.children,n=n.defaultValue,o!=null){if(n!=null)throw Error(i(92));if(xt(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:ie(o)}}function hr(e,n){var o=ie(n.value),l=ie(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),l!=null&&(e.defaultValue=""+l)}function Wn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function ut(e){switch(e){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 en(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?ut(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var jn,Gr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,l,f){MSApp.execUnsafeLocalFunction(function(){return e(n,o,l,f)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(jn=jn||document.createElement("div"),jn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=jn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function lt(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var bn={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},Ci=["Webkit","ms","Moz","O"];Object.keys(bn).forEach(function(e){Ci.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),bn[n]=bn[e]})});function _i(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||bn.hasOwnProperty(e)&&bn[e]?(""+n).trim():n+"px"}function Kr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,f=_i(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,f):e[o]=f}}var ji=U({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 pr(e,n){if(n){if(ji[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));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 Ut(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Qr=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var At=null,nn=null,pn=null;function mn(e){if(e=Do(e)){if(typeof At!="function")throw Error(i(280));var n=e.stateNode;n&&(n=Os(n),At(e.stateNode,e.type,n))}}function mr(e){nn?pn?pn.push(e):pn=[e]:nn=e}function bi(){if(nn){var e=nn,n=pn;if(pn=nn=null,mn(e),n)for(e=0;e<n.length;e++)mn(n[e])}}function Mi(e,n){return e(n)}function gr(){}var Un=!1;function Yn(e,n,o){if(Un)return e(n,o);Un=!0;try{return Mi(e,n,o)}finally{Un=!1,(nn!==null||pn!==null)&&(gr(),bi())}}function yr(e,n){var o=e.stateNode;if(o===null)return null;var l=Os(o);if(l===null)return null;o=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var Nt=!1;if(h)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){Nt=!0}}),window.addEventListener("test",Mn,Mn),window.removeEventListener("test",Mn,Mn)}catch{Nt=!1}function mt(e,n,o,l,f,p,w,I,D){var ee=Array.prototype.slice.call(arguments,3);try{n.apply(o,ee)}catch(ce){this.onError(ce)}}var Xn=!1,Pt=null,Gn=!1,rn=null,Kn={onError:function(e){Xn=!0,Pt=e}};function Pi(e,n,o,l,f,p,w,I,D){Xn=!1,Pt=null,mt.apply(Kn,arguments)}function xo(e,n,o,l,f,p,w,I,D){if(Pi.apply(this,arguments),Xn){if(Xn){var ee=Pt;Xn=!1,Pt=null}else throw Error(i(198));Gn||(Gn=!0,rn=ee)}}function Et(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function Ye(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function vr(e){if(Et(e)!==e)throw Error(i(188))}function Qn(e){var n=e.alternate;if(!n){if(n=Et(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,l=n;;){var f=o.return;if(f===null)break;var p=f.alternate;if(p===null){if(l=f.return,l!==null){o=l;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===o)return vr(f),e;if(p===l)return vr(f),n;p=p.sibling}throw Error(i(188))}if(o.return!==l.return)o=f,l=p;else{for(var w=!1,I=f.child;I;){if(I===o){w=!0,o=f,l=p;break}if(I===l){w=!0,l=f,o=p;break}I=I.sibling}if(!w){for(I=p.child;I;){if(I===o){w=!0,o=p,l=f;break}if(I===l){w=!0,l=p,o=f;break}I=I.sibling}if(!w)throw Error(i(189))}}if(o.alternate!==l)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function qr(e){return e=Qn(e),e!==null?Zr(e):null}function Zr(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=Zr(e);if(n!==null)return n;e=e.sibling}return null}var Yt=r.unstable_scheduleCallback,Pn=r.unstable_cancelCallback,wo=r.unstable_shouldYield,Ii=r.unstable_requestPaint,Xe=r.unstable_now,Ti=r.unstable_getCurrentPriorityLevel,xr=r.unstable_ImmediatePriority,Ri=r.unstable_UserBlockingPriority,qn=r.unstable_NormalPriority,Jr=r.unstable_LowPriority,Zn=r.unstable_IdlePriority,In=null,dt=null;function So(e){if(dt&&typeof dt.onCommitFiberRoot=="function")try{dt.onCommitFiberRoot(In,e,void 0,(e.current.flags&128)===128)}catch{}}var It=Math.clz32?Math.clz32:zi,wr=Math.log,Qe=Math.LN2;function zi(e){return e>>>=0,e===0?32:31-(wr(e)/Qe|0)|0}var Sr=64,kr=4194304;function on(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Nr(e,n){var o=e.pendingLanes;if(o===0)return 0;var l=0,f=e.suspendedLanes,p=e.pingedLanes,w=o&268435455;if(w!==0){var I=w&~f;I!==0?l=on(I):(p&=w,p!==0&&(l=on(p)))}else w=o&~f,w!==0?l=on(w):p!==0&&(l=on(p));if(l===0)return 0;if(n!==0&&n!==l&&(n&f)===0&&(f=l&-l,p=n&-n,f>=p||f===16&&(p&4194240)!==0))return n;if((l&4)!==0&&(l|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0<n;)o=31-It(n),f=1<<o,l|=e[o],n&=~f;return l}function Er(e,n){switch(e){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 ko(e,n){for(var o=e.suspendedLanes,l=e.pingedLanes,f=e.expirationTimes,p=e.pendingLanes;0<p;){var w=31-It(p),I=1<<w,D=f[w];D===-1?((I&o)===0||(I&l)!==0)&&(f[w]=Er(I,n)):D<=n&&(e.expiredLanes|=I),p&=~I}}function Cr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Jn(){var e=Sr;return Sr<<=1,(Sr&4194240)===0&&(Sr=64),e}function ei(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function Tn(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-It(n),e[n]=o}function ti(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<o;){var f=31-It(o),p=1<<f;n[f]=0,l[f]=-1,e[f]=-1,o&=~p}}function Ai(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var l=31-It(o),f=1<<l;f&n|e[l]&n&&(e[l]|=n),o&=~f}}var $e=0;function Ns(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Es,No,Cs,er,_s,Eo=!1,Li=[],sn=null,Rn=null,ln=null,_r=new Map,V=new Map,Y=[],re="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 le(e,n){switch(e){case"focusin":case"focusout":sn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":ln=null;break;case"pointerover":case"pointerout":_r.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":V.delete(n.pointerId)}}function ne(e,n,o,l,f,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:o,eventSystemFlags:l,nativeEvent:p,targetContainers:[f]},n!==null&&(n=Do(n),n!==null&&No(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function ge(e,n,o,l,f){switch(n){case"focusin":return sn=ne(sn,e,n,o,l,f),!0;case"dragenter":return Rn=ne(Rn,e,n,o,l,f),!0;case"mouseover":return ln=ne(ln,e,n,o,l,f),!0;case"pointerover":var p=f.pointerId;return _r.set(p,ne(_r.get(p)||null,e,n,o,l,f)),!0;case"gotpointercapture":return p=f.pointerId,V.set(p,ne(V.get(p)||null,e,n,o,l,f)),!0}return!1}function Ce(e){var n=ni(e.target);if(n!==null){var o=Et(n);if(o!==null){if(n=o.tag,n===13){if(n=Ye(o),n!==null){e.blockedOn=n,_s(e.priority,function(){Cs(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function we(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=ua(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var l=new o.constructor(o.type,o);Qr=l,o.target.dispatchEvent(l),Qr=null}else return n=Do(o),n!==null&&No(n),e.blockedOn=o,!1;n.shift()}return!0}function Ie(e,n,o){we(e)&&o.delete(n)}function We(){Eo=!1,sn!==null&&we(sn)&&(sn=null),Rn!==null&&we(Rn)&&(Rn=null),ln!==null&&we(ln)&&(ln=null),_r.forEach(Ie),V.forEach(Ie)}function Ve(e,n){e.blockedOn===n&&(e.blockedOn=null,Eo||(Eo=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,We)))}function it(e){function n(f){return Ve(f,e)}if(0<Li.length){Ve(Li[0],e);for(var o=1;o<Li.length;o++){var l=Li[o];l.blockedOn===e&&(l.blockedOn=null)}}for(sn!==null&&Ve(sn,e),Rn!==null&&Ve(Rn,e),ln!==null&&Ve(ln,e),_r.forEach(n),V.forEach(n),o=0;o<Y.length;o++)l=Y[o],l.blockedOn===e&&(l.blockedOn=null);for(;0<Y.length&&(o=Y[0],o.blockedOn===null);)Ce(o),o.blockedOn===null&&Y.shift()}var Le=M.ReactCurrentBatchConfig,tt=!0;function zn(e,n,o,l){var f=$e,p=Le.transition;Le.transition=null;try{$e=1,Co(e,n,o,l)}finally{$e=f,Le.transition=p}}function Di(e,n,o,l){var f=$e,p=Le.transition;Le.transition=null;try{$e=4,Co(e,n,o,l)}finally{$e=f,Le.transition=p}}function Co(e,n,o,l){if(tt){var f=ua(e,n,o,l);if(f===null)ja(e,n,l,js,o),le(e,l);else if(ge(f,e,n,o,l))l.stopPropagation();else if(le(e,l),n&4&&-1<re.indexOf(e)){for(;f!==null;){var p=Do(f);if(p!==null&&Es(p),p=ua(e,n,o,l),p===null&&ja(e,n,l,js,o),p===f)break;f=p}f!==null&&l.stopPropagation()}else ja(e,n,l,null,o)}}var js=null;function ua(e,n,o,l){if(js=null,e=tn(l),e=ni(e),e!==null)if(n=Et(e),n===null)e=null;else if(o=n.tag,o===13){if(e=Ye(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return js=e,null}function Ou(e){switch(e){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(Ti()){case xr:return 1;case Ri:return 4;case qn:case Jr:return 16;case Zn:return 536870912;default:return 16}default:return 16}}var jr=null,da=null,bs=null;function Fu(){if(bs)return bs;var e,n=da,o=n.length,l,f="value"in jr?jr.value:jr.textContent,p=f.length;for(e=0;e<o&&n[e]===f[e];e++);var w=o-e;for(l=1;l<=w&&n[o-l]===f[p-l];l++);return bs=f.slice(e,1<l?1-l:void 0)}function Ms(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Ps(){return!0}function Hu(){return!1}function Xt(e){function n(o,l,f,p,w){this._reactName=o,this._targetInst=f,this.type=l,this.nativeEvent=p,this.target=w,this.currentTarget=null;for(var I in e)e.hasOwnProperty(I)&&(o=e[I],this[I]=o?o(p):p[I]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Ps:Hu,this.isPropagationStopped=Hu,this}return U(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Ps)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Ps)},persist:function(){},isPersistent:Ps}),n}var $i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fa=Xt($i),_o=U({},$i,{view:0,detail:0}),Tg=Xt(_o),ha,pa,jo,Is=U({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ga,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==jo&&(jo&&e.type==="mousemove"?(ha=e.screenX-jo.screenX,pa=e.screenY-jo.screenY):pa=ha=0,jo=e),ha)},movementY:function(e){return"movementY"in e?e.movementY:pa}}),Bu=Xt(Is),Rg=U({},Is,{dataTransfer:0}),zg=Xt(Rg),Ag=U({},_o,{relatedTarget:0}),ma=Xt(Ag),Lg=U({},$i,{animationName:0,elapsedTime:0,pseudoElement:0}),Dg=Xt(Lg),$g=U({},$i,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Og=Xt($g),Fg=U({},$i,{data:0}),Vu=Xt(Fg),Hg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bg={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"},Vg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wg(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Vg[e])?!!n[e]:!1}function ga(){return Wg}var Ug=U({},_o,{key:function(e){if(e.key){var n=Hg[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Ms(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ga,charCode:function(e){return e.type==="keypress"?Ms(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ms(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Yg=Xt(Ug),Xg=U({},Is,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wu=Xt(Xg),Gg=U({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ga}),Kg=Xt(Gg),Qg=U({},$i,{propertyName:0,elapsedTime:0,pseudoElement:0}),qg=Xt(Qg),Zg=U({},Is,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Jg=Xt(Zg),ey=[9,13,27,32],ya=h&&"CompositionEvent"in window,bo=null;h&&"documentMode"in document&&(bo=document.documentMode);var ty=h&&"TextEvent"in window&&!bo,Uu=h&&(!ya||bo&&8<bo&&11>=bo),Yu=" ",Xu=!1;function Gu(e,n){switch(e){case"keyup":return ey.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ku(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Oi=!1;function ny(e,n){switch(e){case"compositionend":return Ku(n);case"keypress":return n.which!==32?null:(Xu=!0,Yu);case"textInput":return e=n.data,e===Yu&&Xu?null:e;default:return null}}function ry(e,n){if(Oi)return e==="compositionend"||!ya&&Gu(e,n)?(e=Fu(),bs=da=jr=null,Oi=!1,e):null;switch(e){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 Uu&&n.locale!=="ko"?null:n.data;default:return null}}var iy={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 Qu(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!iy[e.type]:n==="textarea"}function qu(e,n,o,l){mr(l),n=Ls(n,"onChange"),0<n.length&&(o=new fa("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var Mo=null,Po=null;function oy(e){md(e,0)}function Ts(e){var n=Wi(e);if(be(n))return e}function sy(e,n){if(e==="change")return n}var Zu=!1;if(h){var va;if(h){var xa="oninput"in document;if(!xa){var Ju=document.createElement("div");Ju.setAttribute("oninput","return;"),xa=typeof Ju.oninput=="function"}va=xa}else va=!1;Zu=va&&(!document.documentMode||9<document.documentMode)}function ed(){Mo&&(Mo.detachEvent("onpropertychange",td),Po=Mo=null)}function td(e){if(e.propertyName==="value"&&Ts(Po)){var n=[];qu(n,Po,e,tn(e)),Yn(oy,n)}}function ly(e,n,o){e==="focusin"?(ed(),Mo=n,Po=o,Mo.attachEvent("onpropertychange",td)):e==="focusout"&&ed()}function ay(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ts(Po)}function cy(e,n){if(e==="click")return Ts(n)}function uy(e,n){if(e==="input"||e==="change")return Ts(n)}function dy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var gn=typeof Object.is=="function"?Object.is:dy;function Io(e,n){if(gn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),l=Object.keys(n);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var f=o[l];if(!m.call(n,f)||!gn(e[f],n[f]))return!1}return!0}function nd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rd(e,n){var o=nd(e);e=0;for(var l;o;){if(o.nodeType===3){if(l=e+o.textContent.length,e<=n&&l>=n)return{node:o,offset:n-e};e=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=nd(o)}}function id(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?id(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function od(){for(var e=window,n=Ne();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=Ne(e.document)}return n}function wa(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function fy(e){var n=od(),o=e.focusedElem,l=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&id(o.ownerDocument.documentElement,o)){if(l!==null&&wa(o)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var f=o.textContent.length,p=Math.min(l.start,f);l=l.end===void 0?p:Math.min(l.end,f),!e.extend&&p>l&&(f=l,l=p,p=f),f=rd(o,p);var w=rd(o,l);f&&w&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(n=n.createRange(),n.setStart(f.node,f.offset),e.removeAllRanges(),p>l?(e.addRange(n),e.extend(w.node,w.offset)):(n.setEnd(w.node,w.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<n.length;o++)e=n[o],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var hy=h&&"documentMode"in document&&11>=document.documentMode,Fi=null,Sa=null,To=null,ka=!1;function sd(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;ka||Fi==null||Fi!==Ne(l)||(l=Fi,"selectionStart"in l&&wa(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),To&&Io(To,l)||(To=l,l=Ls(Sa,"onSelect"),0<l.length&&(n=new fa("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=Fi)))}function Rs(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Hi={animationend:Rs("Animation","AnimationEnd"),animationiteration:Rs("Animation","AnimationIteration"),animationstart:Rs("Animation","AnimationStart"),transitionend:Rs("Transition","TransitionEnd")},Na={},ld={};h&&(ld=document.createElement("div").style,"AnimationEvent"in window||(delete Hi.animationend.animation,delete Hi.animationiteration.animation,delete Hi.animationstart.animation),"TransitionEvent"in window||delete Hi.transitionend.transition);function zs(e){if(Na[e])return Na[e];if(!Hi[e])return e;var n=Hi[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in ld)return Na[e]=n[o];return e}var ad=zs("animationend"),cd=zs("animationiteration"),ud=zs("animationstart"),dd=zs("transitionend"),fd=new Map,hd="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(e,n){fd.set(e,n),c(n,[e])}for(var Ea=0;Ea<hd.length;Ea++){var Ca=hd[Ea],py=Ca.toLowerCase(),my=Ca[0].toUpperCase()+Ca.slice(1);br(py,"on"+my)}br(ad,"onAnimationEnd"),br(cd,"onAnimationIteration"),br(ud,"onAnimationStart"),br("dblclick","onDoubleClick"),br("focusin","onFocus"),br("focusout","onBlur"),br(dd,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ro="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(" "),gy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ro));function pd(e,n,o){var l=e.type||"unknown-event";e.currentTarget=o,xo(l,n,void 0,e),e.currentTarget=null}function md(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var l=e[o],f=l.event;l=l.listeners;e:{var p=void 0;if(n)for(var w=l.length-1;0<=w;w--){var I=l[w],D=I.instance,ee=I.currentTarget;if(I=I.listener,D!==p&&f.isPropagationStopped())break e;pd(f,I,ee),p=D}else for(w=0;w<l.length;w++){if(I=l[w],D=I.instance,ee=I.currentTarget,I=I.listener,D!==p&&f.isPropagationStopped())break e;pd(f,I,ee),p=D}}}if(Gn)throw e=rn,Gn=!1,rn=null,e}function Ge(e,n){var o=n[Ra];o===void 0&&(o=n[Ra]=new Set);var l=e+"__bubble";o.has(l)||(gd(n,e,2,!1),o.add(l))}function _a(e,n,o){var l=0;n&&(l|=4),gd(o,e,l,n)}var As="_reactListening"+Math.random().toString(36).slice(2);function zo(e){if(!e[As]){e[As]=!0,s.forEach(function(o){o!=="selectionchange"&&(gy.has(o)||_a(o,!1,e),_a(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[As]||(n[As]=!0,_a("selectionchange",!1,n))}}function gd(e,n,o,l){switch(Ou(n)){case 1:var f=zn;break;case 4:f=Di;break;default:f=Co}o=f.bind(null,n,o,e),f=void 0,!Nt||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),l?f!==void 0?e.addEventListener(n,o,{capture:!0,passive:f}):e.addEventListener(n,o,!0):f!==void 0?e.addEventListener(n,o,{passive:f}):e.addEventListener(n,o,!1)}function ja(e,n,o,l,f){var p=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var w=l.tag;if(w===3||w===4){var I=l.stateNode.containerInfo;if(I===f||I.nodeType===8&&I.parentNode===f)break;if(w===4)for(w=l.return;w!==null;){var D=w.tag;if((D===3||D===4)&&(D=w.stateNode.containerInfo,D===f||D.nodeType===8&&D.parentNode===f))return;w=w.return}for(;I!==null;){if(w=ni(I),w===null)return;if(D=w.tag,D===5||D===6){l=p=w;continue e}I=I.parentNode}}l=l.return}Yn(function(){var ee=p,ce=tn(o),ue=[];e:{var ae=fd.get(e);if(ae!==void 0){var ye=fa,xe=e;switch(e){case"keypress":if(Ms(o)===0)break e;case"keydown":case"keyup":ye=Yg;break;case"focusin":xe="focus",ye=ma;break;case"focusout":xe="blur",ye=ma;break;case"beforeblur":case"afterblur":ye=ma;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=Bu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=zg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=Kg;break;case ad:case cd:case ud:ye=Dg;break;case dd:ye=qg;break;case"scroll":ye=Tg;break;case"wheel":ye=Jg;break;case"copy":case"cut":case"paste":ye=Og;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=Wu}var Se=(n&4)!==0,st=!Se&&e==="scroll",X=Se?ae!==null?ae+"Capture":null:ae;Se=[];for(var F=ee,q;F!==null;){q=F;var fe=q.stateNode;if(q.tag===5&&fe!==null&&(q=fe,X!==null&&(fe=yr(F,X),fe!=null&&Se.push(Ao(F,fe,q)))),st)break;F=F.return}0<Se.length&&(ae=new ye(ae,xe,null,o,ce),ue.push({event:ae,listeners:Se}))}}if((n&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",ye=e==="mouseout"||e==="pointerout",ae&&o!==Qr&&(xe=o.relatedTarget||o.fromElement)&&(ni(xe)||xe[tr]))break e;if((ye||ae)&&(ae=ce.window===ce?ce:(ae=ce.ownerDocument)?ae.defaultView||ae.parentWindow:window,ye?(xe=o.relatedTarget||o.toElement,ye=ee,xe=xe?ni(xe):null,xe!==null&&(st=Et(xe),xe!==st||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(ye=null,xe=ee),ye!==xe)){if(Se=Bu,fe="onMouseLeave",X="onMouseEnter",F="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Wu,fe="onPointerLeave",X="onPointerEnter",F="pointer"),st=ye==null?ae:Wi(ye),q=xe==null?ae:Wi(xe),ae=new Se(fe,F+"leave",ye,o,ce),ae.target=st,ae.relatedTarget=q,fe=null,ni(ce)===ee&&(Se=new Se(X,F+"enter",xe,o,ce),Se.target=q,Se.relatedTarget=st,fe=Se),st=fe,ye&&xe)t:{for(Se=ye,X=xe,F=0,q=Se;q;q=Bi(q))F++;for(q=0,fe=X;fe;fe=Bi(fe))q++;for(;0<F-q;)Se=Bi(Se),F--;for(;0<q-F;)X=Bi(X),q--;for(;F--;){if(Se===X||X!==null&&Se===X.alternate)break t;Se=Bi(Se),X=Bi(X)}Se=null}else Se=null;ye!==null&&yd(ue,ae,ye,Se,!1),xe!==null&&st!==null&&yd(ue,st,xe,Se,!0)}}e:{if(ae=ee?Wi(ee):window,ye=ae.nodeName&&ae.nodeName.toLowerCase(),ye==="select"||ye==="input"&&ae.type==="file")var Ee=sy;else if(Qu(ae))if(Zu)Ee=uy;else{Ee=ay;var Me=ly}else(ye=ae.nodeName)&&ye.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(Ee=cy);if(Ee&&(Ee=Ee(e,ee))){qu(ue,Ee,o,ce);break e}Me&&Me(e,ae,ee),e==="focusout"&&(Me=ae._wrapperState)&&Me.controlled&&ae.type==="number"&&pt(ae,"number",ae.value)}switch(Me=ee?Wi(ee):window,e){case"focusin":(Qu(Me)||Me.contentEditable==="true")&&(Fi=Me,Sa=ee,To=null);break;case"focusout":To=Sa=Fi=null;break;case"mousedown":ka=!0;break;case"contextmenu":case"mouseup":case"dragend":ka=!1,sd(ue,o,ce);break;case"selectionchange":if(hy)break;case"keydown":case"keyup":sd(ue,o,ce)}var Pe;if(ya)e:{switch(e){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else Oi?Gu(e,o)&&(Re="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(Re="onCompositionStart");Re&&(Uu&&o.locale!=="ko"&&(Oi||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&Oi&&(Pe=Fu()):(jr=ce,da="value"in jr?jr.value:jr.textContent,Oi=!0)),Me=Ls(ee,Re),0<Me.length&&(Re=new Vu(Re,e,null,o,ce),ue.push({event:Re,listeners:Me}),Pe?Re.data=Pe:(Pe=Ku(o),Pe!==null&&(Re.data=Pe)))),(Pe=ty?ny(e,o):ry(e,o))&&(ee=Ls(ee,"onBeforeInput"),0<ee.length&&(ce=new Vu("onBeforeInput","beforeinput",null,o,ce),ue.push({event:ce,listeners:ee}),ce.data=Pe))}md(ue,n)})}function Ao(e,n,o){return{instance:e,listener:n,currentTarget:o}}function Ls(e,n){for(var o=n+"Capture",l=[];e!==null;){var f=e,p=f.stateNode;f.tag===5&&p!==null&&(f=p,p=yr(e,o),p!=null&&l.unshift(Ao(e,p,f)),p=yr(e,n),p!=null&&l.push(Ao(e,p,f))),e=e.return}return l}function Bi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yd(e,n,o,l,f){for(var p=n._reactName,w=[];o!==null&&o!==l;){var I=o,D=I.alternate,ee=I.stateNode;if(D!==null&&D===l)break;I.tag===5&&ee!==null&&(I=ee,f?(D=yr(o,p),D!=null&&w.unshift(Ao(o,D,I))):f||(D=yr(o,p),D!=null&&w.push(Ao(o,D,I)))),o=o.return}w.length!==0&&e.push({event:n,listeners:w})}var yy=/\r\n?/g,vy=/\u0000|\uFFFD/g;function vd(e){return(typeof e=="string"?e:""+e).replace(yy,`
38
+ `).replace(vy,"")}function Ds(e,n,o){if(n=vd(n),vd(e)!==n&&o)throw Error(i(425))}function $s(){}var ba=null,Ma=null;function Pa(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ia=typeof setTimeout=="function"?setTimeout:void 0,xy=typeof clearTimeout=="function"?clearTimeout:void 0,xd=typeof Promise=="function"?Promise:void 0,wy=typeof queueMicrotask=="function"?queueMicrotask:typeof xd<"u"?function(e){return xd.resolve(null).then(e).catch(Sy)}:Ia;function Sy(e){setTimeout(function(){throw e})}function Ta(e,n){var o=n,l=0;do{var f=o.nextSibling;if(e.removeChild(o),f&&f.nodeType===8)if(o=f.data,o==="/$"){if(l===0){e.removeChild(f),it(n);return}l--}else o!=="$"&&o!=="$?"&&o!=="$!"||l++;o=f}while(o);it(n)}function Mr(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function wd(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}var Vi=Math.random().toString(36).slice(2),An="__reactFiber$"+Vi,Lo="__reactProps$"+Vi,tr="__reactContainer$"+Vi,Ra="__reactEvents$"+Vi,ky="__reactListeners$"+Vi,Ny="__reactHandles$"+Vi;function ni(e){var n=e[An];if(n)return n;for(var o=e.parentNode;o;){if(n=o[tr]||o[An]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=wd(e);e!==null;){if(o=e[An])return o;e=wd(e)}return n}e=o,o=e.parentNode}return null}function Do(e){return e=e[An]||e[tr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Wi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function Os(e){return e[Lo]||null}var za=[],Ui=-1;function Pr(e){return{current:e}}function Ke(e){0>Ui||(e.current=za[Ui],za[Ui]=null,Ui--)}function Ue(e,n){Ui++,za[Ui]=e.current,e.current=n}var Ir={},Ct=Pr(Ir),Lt=Pr(!1),ri=Ir;function Yi(e,n){var o=e.type.contextTypes;if(!o)return Ir;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var f={},p;for(p in o)f[p]=n[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=f),f}function Dt(e){return e=e.childContextTypes,e!=null}function Fs(){Ke(Lt),Ke(Ct)}function Sd(e,n,o){if(Ct.current!==Ir)throw Error(i(168));Ue(Ct,n),Ue(Lt,o)}function kd(e,n,o){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var f in l)if(!(f in n))throw Error(i(108,pe(e)||"Unknown",f));return U({},o,l)}function Hs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ir,ri=Ct.current,Ue(Ct,e),Ue(Lt,Lt.current),!0}function Nd(e,n,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=kd(e,n,ri),l.__reactInternalMemoizedMergedChildContext=e,Ke(Lt),Ke(Ct),Ue(Ct,e)):Ke(Lt),Ue(Lt,o)}var nr=null,Bs=!1,Aa=!1;function Ed(e){nr===null?nr=[e]:nr.push(e)}function Ey(e){Bs=!0,Ed(e)}function Tr(){if(!Aa&&nr!==null){Aa=!0;var e=0,n=$e;try{var o=nr;for($e=1;e<o.length;e++){var l=o[e];do l=l(!0);while(l!==null)}nr=null,Bs=!1}catch(f){throw nr!==null&&(nr=nr.slice(e+1)),Yt(xr,Tr),f}finally{$e=n,Aa=!1}}return null}var Xi=[],Gi=0,Vs=null,Ws=0,an=[],cn=0,ii=null,rr=1,ir="";function oi(e,n){Xi[Gi++]=Ws,Xi[Gi++]=Vs,Vs=e,Ws=n}function Cd(e,n,o){an[cn++]=rr,an[cn++]=ir,an[cn++]=ii,ii=e;var l=rr;e=ir;var f=32-It(l)-1;l&=~(1<<f),o+=1;var p=32-It(n)+f;if(30<p){var w=f-f%5;p=(l&(1<<w)-1).toString(32),l>>=w,f-=w,rr=1<<32-It(n)+f|o<<f|l,ir=p+e}else rr=1<<p|o<<f|l,ir=e}function La(e){e.return!==null&&(oi(e,1),Cd(e,1,0))}function Da(e){for(;e===Vs;)Vs=Xi[--Gi],Xi[Gi]=null,Ws=Xi[--Gi],Xi[Gi]=null;for(;e===ii;)ii=an[--cn],an[cn]=null,ir=an[--cn],an[cn]=null,rr=an[--cn],an[cn]=null}var Gt=null,Kt=null,qe=!1,yn=null;function _d(e,n){var o=hn(5,null,null,0);o.elementType="DELETED",o.stateNode=n,o.return=e,n=e.deletions,n===null?(e.deletions=[o],e.flags|=16):n.push(o)}function jd(e,n){switch(e.tag){case 5:var o=e.type;return n=n.nodeType!==1||o.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Gt=e,Kt=Mr(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Gt=e,Kt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=ii!==null?{id:rr,overflow:ir}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=hn(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,Gt=e,Kt=null,!0):!1;default:return!1}}function $a(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Oa(e){if(qe){var n=Kt;if(n){var o=n;if(!jd(e,n)){if($a(e))throw Error(i(418));n=Mr(o.nextSibling);var l=Gt;n&&jd(e,n)?_d(l,o):(e.flags=e.flags&-4097|2,qe=!1,Gt=e)}}else{if($a(e))throw Error(i(418));e.flags=e.flags&-4097|2,qe=!1,Gt=e}}}function bd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gt=e}function Us(e){if(e!==Gt)return!1;if(!qe)return bd(e),qe=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Pa(e.type,e.memoizedProps)),n&&(n=Kt)){if($a(e))throw Md(),Error(i(418));for(;n;)_d(e,n),n=Mr(n.nextSibling)}if(bd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(n===0){Kt=Mr(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Kt=null}}else Kt=Gt?Mr(e.stateNode.nextSibling):null;return!0}function Md(){for(var e=Kt;e;)e=Mr(e.nextSibling)}function Ki(){Kt=Gt=null,qe=!1}function Fa(e){yn===null?yn=[e]:yn.push(e)}var Cy=M.ReactCurrentBatchConfig;function $o(e,n,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(i(309));var l=o.stateNode}if(!l)throw Error(i(147,e));var f=l,p=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===p?n.ref:(n=function(w){var I=f.refs;w===null?delete I[p]:I[p]=w},n._stringRef=p,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function Ys(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Pd(e){var n=e._init;return n(e._payload)}function Id(e){function n(X,F){if(e){var q=X.deletions;q===null?(X.deletions=[F],X.flags|=16):q.push(F)}}function o(X,F){if(!e)return null;for(;F!==null;)n(X,F),F=F.sibling;return null}function l(X,F){for(X=new Map;F!==null;)F.key!==null?X.set(F.key,F):X.set(F.index,F),F=F.sibling;return X}function f(X,F){return X=Fr(X,F),X.index=0,X.sibling=null,X}function p(X,F,q){return X.index=q,e?(q=X.alternate,q!==null?(q=q.index,q<F?(X.flags|=2,F):q):(X.flags|=2,F)):(X.flags|=1048576,F)}function w(X){return e&&X.alternate===null&&(X.flags|=2),X}function I(X,F,q,fe){return F===null||F.tag!==6?(F=Ic(q,X.mode,fe),F.return=X,F):(F=f(F,q),F.return=X,F)}function D(X,F,q,fe){var Ee=q.type;return Ee===H?ce(X,F,q.props.children,fe,q.key):F!==null&&(F.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===T&&Pd(Ee)===F.type)?(fe=f(F,q.props),fe.ref=$o(X,F,q),fe.return=X,fe):(fe=gl(q.type,q.key,q.props,null,X.mode,fe),fe.ref=$o(X,F,q),fe.return=X,fe)}function ee(X,F,q,fe){return F===null||F.tag!==4||F.stateNode.containerInfo!==q.containerInfo||F.stateNode.implementation!==q.implementation?(F=Tc(q,X.mode,fe),F.return=X,F):(F=f(F,q.children||[]),F.return=X,F)}function ce(X,F,q,fe,Ee){return F===null||F.tag!==7?(F=hi(q,X.mode,fe,Ee),F.return=X,F):(F=f(F,q),F.return=X,F)}function ue(X,F,q){if(typeof F=="string"&&F!==""||typeof F=="number")return F=Ic(""+F,X.mode,q),F.return=X,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case $:return q=gl(F.type,F.key,F.props,null,X.mode,q),q.ref=$o(X,null,F),q.return=X,q;case L:return F=Tc(F,X.mode,q),F.return=X,F;case T:var fe=F._init;return ue(X,fe(F._payload),q)}if(xt(F)||A(F))return F=hi(F,X.mode,q,null),F.return=X,F;Ys(X,F)}return null}function ae(X,F,q,fe){var Ee=F!==null?F.key:null;if(typeof q=="string"&&q!==""||typeof q=="number")return Ee!==null?null:I(X,F,""+q,fe);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case $:return q.key===Ee?D(X,F,q,fe):null;case L:return q.key===Ee?ee(X,F,q,fe):null;case T:return Ee=q._init,ae(X,F,Ee(q._payload),fe)}if(xt(q)||A(q))return Ee!==null?null:ce(X,F,q,fe,null);Ys(X,q)}return null}function ye(X,F,q,fe,Ee){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return X=X.get(q)||null,I(F,X,""+fe,Ee);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case $:return X=X.get(fe.key===null?q:fe.key)||null,D(F,X,fe,Ee);case L:return X=X.get(fe.key===null?q:fe.key)||null,ee(F,X,fe,Ee);case T:var Me=fe._init;return ye(X,F,q,Me(fe._payload),Ee)}if(xt(fe)||A(fe))return X=X.get(q)||null,ce(F,X,fe,Ee,null);Ys(F,fe)}return null}function xe(X,F,q,fe){for(var Ee=null,Me=null,Pe=F,Re=F=0,vt=null;Pe!==null&&Re<q.length;Re++){Pe.index>Re?(vt=Pe,Pe=null):vt=Pe.sibling;var He=ae(X,Pe,q[Re],fe);if(He===null){Pe===null&&(Pe=vt);break}e&&Pe&&He.alternate===null&&n(X,Pe),F=p(He,F,Re),Me===null?Ee=He:Me.sibling=He,Me=He,Pe=vt}if(Re===q.length)return o(X,Pe),qe&&oi(X,Re),Ee;if(Pe===null){for(;Re<q.length;Re++)Pe=ue(X,q[Re],fe),Pe!==null&&(F=p(Pe,F,Re),Me===null?Ee=Pe:Me.sibling=Pe,Me=Pe);return qe&&oi(X,Re),Ee}for(Pe=l(X,Pe);Re<q.length;Re++)vt=ye(Pe,X,Re,q[Re],fe),vt!==null&&(e&&vt.alternate!==null&&Pe.delete(vt.key===null?Re:vt.key),F=p(vt,F,Re),Me===null?Ee=vt:Me.sibling=vt,Me=vt);return e&&Pe.forEach(function(Hr){return n(X,Hr)}),qe&&oi(X,Re),Ee}function Se(X,F,q,fe){var Ee=A(q);if(typeof Ee!="function")throw Error(i(150));if(q=Ee.call(q),q==null)throw Error(i(151));for(var Me=Ee=null,Pe=F,Re=F=0,vt=null,He=q.next();Pe!==null&&!He.done;Re++,He=q.next()){Pe.index>Re?(vt=Pe,Pe=null):vt=Pe.sibling;var Hr=ae(X,Pe,He.value,fe);if(Hr===null){Pe===null&&(Pe=vt);break}e&&Pe&&Hr.alternate===null&&n(X,Pe),F=p(Hr,F,Re),Me===null?Ee=Hr:Me.sibling=Hr,Me=Hr,Pe=vt}if(He.done)return o(X,Pe),qe&&oi(X,Re),Ee;if(Pe===null){for(;!He.done;Re++,He=q.next())He=ue(X,He.value,fe),He!==null&&(F=p(He,F,Re),Me===null?Ee=He:Me.sibling=He,Me=He);return qe&&oi(X,Re),Ee}for(Pe=l(X,Pe);!He.done;Re++,He=q.next())He=ye(Pe,X,Re,He.value,fe),He!==null&&(e&&He.alternate!==null&&Pe.delete(He.key===null?Re:He.key),F=p(He,F,Re),Me===null?Ee=He:Me.sibling=He,Me=He);return e&&Pe.forEach(function(i0){return n(X,i0)}),qe&&oi(X,Re),Ee}function st(X,F,q,fe){if(typeof q=="object"&&q!==null&&q.type===H&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case $:e:{for(var Ee=q.key,Me=F;Me!==null;){if(Me.key===Ee){if(Ee=q.type,Ee===H){if(Me.tag===7){o(X,Me.sibling),F=f(Me,q.props.children),F.return=X,X=F;break e}}else if(Me.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===T&&Pd(Ee)===Me.type){o(X,Me.sibling),F=f(Me,q.props),F.ref=$o(X,Me,q),F.return=X,X=F;break e}o(X,Me);break}else n(X,Me);Me=Me.sibling}q.type===H?(F=hi(q.props.children,X.mode,fe,q.key),F.return=X,X=F):(fe=gl(q.type,q.key,q.props,null,X.mode,fe),fe.ref=$o(X,F,q),fe.return=X,X=fe)}return w(X);case L:e:{for(Me=q.key;F!==null;){if(F.key===Me)if(F.tag===4&&F.stateNode.containerInfo===q.containerInfo&&F.stateNode.implementation===q.implementation){o(X,F.sibling),F=f(F,q.children||[]),F.return=X,X=F;break e}else{o(X,F);break}else n(X,F);F=F.sibling}F=Tc(q,X.mode,fe),F.return=X,X=F}return w(X);case T:return Me=q._init,st(X,F,Me(q._payload),fe)}if(xt(q))return xe(X,F,q,fe);if(A(q))return Se(X,F,q,fe);Ys(X,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,F!==null&&F.tag===6?(o(X,F.sibling),F=f(F,q),F.return=X,X=F):(o(X,F),F=Ic(q,X.mode,fe),F.return=X,X=F),w(X)):o(X,F)}return st}var Qi=Id(!0),Td=Id(!1),Xs=Pr(null),Gs=null,qi=null,Ha=null;function Ba(){Ha=qi=Gs=null}function Va(e){var n=Xs.current;Ke(Xs),e._currentValue=n}function Wa(e,n,o){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===o)break;e=e.return}}function Zi(e,n){Gs=e,Ha=qi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&($t=!0),e.firstContext=null)}function un(e){var n=e._currentValue;if(Ha!==e)if(e={context:e,memoizedValue:n,next:null},qi===null){if(Gs===null)throw Error(i(308));qi=e,Gs.dependencies={lanes:0,firstContext:e}}else qi=qi.next=e;return n}var si=null;function Ua(e){si===null?si=[e]:si.push(e)}function Rd(e,n,o,l){var f=n.interleaved;return f===null?(o.next=o,Ua(n)):(o.next=f.next,f.next=o),n.interleaved=o,or(e,l)}function or(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var Rr=!1;function Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zd(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function sr(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function zr(e,n,o){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Fe&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,or(e,o)}return f=l.interleaved,f===null?(n.next=n,Ua(l)):(n.next=f.next,f.next=n),l.interleaved=n,or(e,o)}function Ks(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Ai(e,o)}}function Ad(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var f=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var w={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};p===null?f=p=w:p=p.next=w,o=o.next}while(o!==null);p===null?f=p=n:p=p.next=n}else f=p=n;o={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:l.shared,effects:l.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function Qs(e,n,o,l){var f=e.updateQueue;Rr=!1;var p=f.firstBaseUpdate,w=f.lastBaseUpdate,I=f.shared.pending;if(I!==null){f.shared.pending=null;var D=I,ee=D.next;D.next=null,w===null?p=ee:w.next=ee,w=D;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,I=ce.lastBaseUpdate,I!==w&&(I===null?ce.firstBaseUpdate=ee:I.next=ee,ce.lastBaseUpdate=D))}if(p!==null){var ue=f.baseState;w=0,ce=ee=D=null,I=p;do{var ae=I.lane,ye=I.eventTime;if((l&ae)===ae){ce!==null&&(ce=ce.next={eventTime:ye,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var xe=e,Se=I;switch(ae=n,ye=o,Se.tag){case 1:if(xe=Se.payload,typeof xe=="function"){ue=xe.call(ye,ue,ae);break e}ue=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Se.payload,ae=typeof xe=="function"?xe.call(ye,ue,ae):xe,ae==null)break e;ue=U({},ue,ae);break e;case 2:Rr=!0}}I.callback!==null&&I.lane!==0&&(e.flags|=64,ae=f.effects,ae===null?f.effects=[I]:ae.push(I))}else ye={eventTime:ye,lane:ae,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ce===null?(ee=ce=ye,D=ue):ce=ce.next=ye,w|=ae;if(I=I.next,I===null){if(I=f.shared.pending,I===null)break;ae=I,I=ae.next,ae.next=null,f.lastBaseUpdate=ae,f.shared.pending=null}}while(!0);if(ce===null&&(D=ue),f.baseState=D,f.firstBaseUpdate=ee,f.lastBaseUpdate=ce,n=f.shared.interleaved,n!==null){f=n;do w|=f.lane,f=f.next;while(f!==n)}else p===null&&(f.shared.lanes=0);ci|=w,e.lanes=w,e.memoizedState=ue}}function Ld(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var l=e[n],f=l.callback;if(f!==null){if(l.callback=null,l=o,typeof f!="function")throw Error(i(191,f));f.call(l)}}}var Oo={},Ln=Pr(Oo),Fo=Pr(Oo),Ho=Pr(Oo);function li(e){if(e===Oo)throw Error(i(174));return e}function Xa(e,n){switch(Ue(Ho,n),Ue(Fo,e),Ue(Ln,Oo),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:en(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=en(n,e)}Ke(Ln),Ue(Ln,n)}function Ji(){Ke(Ln),Ke(Fo),Ke(Ho)}function Dd(e){li(Ho.current);var n=li(Ln.current),o=en(n,e.type);n!==o&&(Ue(Fo,e),Ue(Ln,o))}function Ga(e){Fo.current===e&&(Ke(Ln),Ke(Fo))}var nt=Pr(0);function qs(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.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===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Ka=[];function Qa(){for(var e=0;e<Ka.length;e++)Ka[e]._workInProgressVersionPrimary=null;Ka.length=0}var Zs=M.ReactCurrentDispatcher,qa=M.ReactCurrentBatchConfig,ai=0,rt=null,ft=null,gt=null,Js=!1,Bo=!1,Vo=0,_y=0;function _t(){throw Error(i(321))}function Za(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!gn(e[o],n[o]))return!1;return!0}function Ja(e,n,o,l,f,p){if(ai=p,rt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Zs.current=e===null||e.memoizedState===null?Py:Iy,e=o(l,f),Bo){p=0;do{if(Bo=!1,Vo=0,25<=p)throw Error(i(301));p+=1,gt=ft=null,n.updateQueue=null,Zs.current=Ty,e=o(l,f)}while(Bo)}if(Zs.current=nl,n=ft!==null&&ft.next!==null,ai=0,gt=ft=rt=null,Js=!1,n)throw Error(i(300));return e}function ec(){var e=Vo!==0;return Vo=0,e}function Dn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?rt.memoizedState=gt=e:gt=gt.next=e,gt}function dn(){if(ft===null){var e=rt.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var n=gt===null?rt.memoizedState:gt.next;if(n!==null)gt=n,ft=e;else{if(e===null)throw Error(i(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},gt===null?rt.memoizedState=gt=e:gt=gt.next=e}return gt}function Wo(e,n){return typeof n=="function"?n(e):n}function tc(e){var n=dn(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=ft,f=l.baseQueue,p=o.pending;if(p!==null){if(f!==null){var w=f.next;f.next=p.next,p.next=w}l.baseQueue=f=p,o.pending=null}if(f!==null){p=f.next,l=l.baseState;var I=w=null,D=null,ee=p;do{var ce=ee.lane;if((ai&ce)===ce)D!==null&&(D=D.next={lane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),l=ee.hasEagerState?ee.eagerState:e(l,ee.action);else{var ue={lane:ce,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null};D===null?(I=D=ue,w=l):D=D.next=ue,rt.lanes|=ce,ci|=ce}ee=ee.next}while(ee!==null&&ee!==p);D===null?w=l:D.next=I,gn(l,n.memoizedState)||($t=!0),n.memoizedState=l,n.baseState=w,n.baseQueue=D,o.lastRenderedState=l}if(e=o.interleaved,e!==null){f=e;do p=f.lane,rt.lanes|=p,ci|=p,f=f.next;while(f!==e)}else f===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function nc(e){var n=dn(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=o.dispatch,f=o.pending,p=n.memoizedState;if(f!==null){o.pending=null;var w=f=f.next;do p=e(p,w.action),w=w.next;while(w!==f);gn(p,n.memoizedState)||($t=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),o.lastRenderedState=p}return[p,l]}function $d(){}function Od(e,n){var o=rt,l=dn(),f=n(),p=!gn(l.memoizedState,f);if(p&&(l.memoizedState=f,$t=!0),l=l.queue,rc(Bd.bind(null,o,l,e),[e]),l.getSnapshot!==n||p||gt!==null&&gt.memoizedState.tag&1){if(o.flags|=2048,Uo(9,Hd.bind(null,o,l,f,n),void 0,null),yt===null)throw Error(i(349));(ai&30)!==0||Fd(o,n,f)}return f}function Fd(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=rt.updateQueue,n===null?(n={lastEffect:null,stores:null},rt.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Hd(e,n,o,l){n.value=o,n.getSnapshot=l,Vd(n)&&Wd(e)}function Bd(e,n,o){return o(function(){Vd(n)&&Wd(e)})}function Vd(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!gn(e,o)}catch{return!0}}function Wd(e){var n=or(e,1);n!==null&&Sn(n,e,1,-1)}function Ud(e){var n=Dn();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wo,lastRenderedState:e},n.queue=e,e=e.dispatch=My.bind(null,rt,e),[n.memoizedState,e]}function Uo(e,n,o,l){return e={tag:e,create:n,destroy:o,deps:l,next:null},n=rt.updateQueue,n===null?(n={lastEffect:null,stores:null},rt.updateQueue=n,n.lastEffect=e.next=e):(o=n.lastEffect,o===null?n.lastEffect=e.next=e:(l=o.next,o.next=e,e.next=l,n.lastEffect=e)),e}function Yd(){return dn().memoizedState}function el(e,n,o,l){var f=Dn();rt.flags|=e,f.memoizedState=Uo(1|n,o,void 0,l===void 0?null:l)}function tl(e,n,o,l){var f=dn();l=l===void 0?null:l;var p=void 0;if(ft!==null){var w=ft.memoizedState;if(p=w.destroy,l!==null&&Za(l,w.deps)){f.memoizedState=Uo(n,o,p,l);return}}rt.flags|=e,f.memoizedState=Uo(1|n,o,p,l)}function Xd(e,n){return el(8390656,8,e,n)}function rc(e,n){return tl(2048,8,e,n)}function Gd(e,n){return tl(4,2,e,n)}function Kd(e,n){return tl(4,4,e,n)}function Qd(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function qd(e,n,o){return o=o!=null?o.concat([e]):null,tl(4,4,Qd.bind(null,n,e),o)}function ic(){}function Zd(e,n){var o=dn();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&Za(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function Jd(e,n){var o=dn();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&Za(n,l[1])?l[0]:(e=e(),o.memoizedState=[e,n],e)}function ef(e,n,o){return(ai&21)===0?(e.baseState&&(e.baseState=!1,$t=!0),e.memoizedState=o):(gn(o,n)||(o=Jn(),rt.lanes|=o,ci|=o,e.baseState=!0),n)}function jy(e,n){var o=$e;$e=o!==0&&4>o?o:4,e(!0);var l=qa.transition;qa.transition={};try{e(!1),n()}finally{$e=o,qa.transition=l}}function tf(){return dn().memoizedState}function by(e,n,o){var l=$r(e);if(o={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null},nf(e))rf(n,o);else if(o=Rd(e,n,o,l),o!==null){var f=Rt();Sn(o,e,l,f),of(o,n,l)}}function My(e,n,o){var l=$r(e),f={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null};if(nf(e))rf(n,f);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var w=n.lastRenderedState,I=p(w,o);if(f.hasEagerState=!0,f.eagerState=I,gn(I,w)){var D=n.interleaved;D===null?(f.next=f,Ua(n)):(f.next=D.next,D.next=f),n.interleaved=f;return}}catch{}finally{}o=Rd(e,n,f,l),o!==null&&(f=Rt(),Sn(o,e,l,f),of(o,n,l))}}function nf(e){var n=e.alternate;return e===rt||n!==null&&n===rt}function rf(e,n){Bo=Js=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function of(e,n,o){if((o&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Ai(e,o)}}var nl={readContext:un,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useInsertionEffect:_t,useLayoutEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useMutableSource:_t,useSyncExternalStore:_t,useId:_t,unstable_isNewReconciler:!1},Py={readContext:un,useCallback:function(e,n){return Dn().memoizedState=[e,n===void 0?null:n],e},useContext:un,useEffect:Xd,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,el(4194308,4,Qd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return el(4194308,4,e,n)},useInsertionEffect:function(e,n){return el(4,2,e,n)},useMemo:function(e,n){var o=Dn();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var l=Dn();return n=o!==void 0?o(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=by.bind(null,rt,e),[l.memoizedState,e]},useRef:function(e){var n=Dn();return e={current:e},n.memoizedState=e},useState:Ud,useDebugValue:ic,useDeferredValue:function(e){return Dn().memoizedState=e},useTransition:function(){var e=Ud(!1),n=e[0];return e=jy.bind(null,e[1]),Dn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var l=rt,f=Dn();if(qe){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),yt===null)throw Error(i(349));(ai&30)!==0||Fd(l,n,o)}f.memoizedState=o;var p={value:o,getSnapshot:n};return f.queue=p,Xd(Bd.bind(null,l,p,e),[e]),l.flags|=2048,Uo(9,Hd.bind(null,l,p,o,n),void 0,null),o},useId:function(){var e=Dn(),n=yt.identifierPrefix;if(qe){var o=ir,l=rr;o=(l&~(1<<32-It(l)-1)).toString(32)+o,n=":"+n+"R"+o,o=Vo++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=_y++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Iy={readContext:un,useCallback:Zd,useContext:un,useEffect:rc,useImperativeHandle:qd,useInsertionEffect:Gd,useLayoutEffect:Kd,useMemo:Jd,useReducer:tc,useRef:Yd,useState:function(){return tc(Wo)},useDebugValue:ic,useDeferredValue:function(e){var n=dn();return ef(n,ft.memoizedState,e)},useTransition:function(){var e=tc(Wo)[0],n=dn().memoizedState;return[e,n]},useMutableSource:$d,useSyncExternalStore:Od,useId:tf,unstable_isNewReconciler:!1},Ty={readContext:un,useCallback:Zd,useContext:un,useEffect:rc,useImperativeHandle:qd,useInsertionEffect:Gd,useLayoutEffect:Kd,useMemo:Jd,useReducer:nc,useRef:Yd,useState:function(){return nc(Wo)},useDebugValue:ic,useDeferredValue:function(e){var n=dn();return ft===null?n.memoizedState=e:ef(n,ft.memoizedState,e)},useTransition:function(){var e=nc(Wo)[0],n=dn().memoizedState;return[e,n]},useMutableSource:$d,useSyncExternalStore:Od,useId:tf,unstable_isNewReconciler:!1};function vn(e,n){if(e&&e.defaultProps){n=U({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function oc(e,n,o,l){n=e.memoizedState,o=o(l,n),o=o==null?n:U({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var rl={isMounted:function(e){return(e=e._reactInternals)?Et(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var l=Rt(),f=$r(e),p=sr(l,f);p.payload=n,o!=null&&(p.callback=o),n=zr(e,p,f),n!==null&&(Sn(n,e,f,l),Ks(n,e,f))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=Rt(),f=$r(e),p=sr(l,f);p.tag=1,p.payload=n,o!=null&&(p.callback=o),n=zr(e,p,f),n!==null&&(Sn(n,e,f,l),Ks(n,e,f))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Rt(),l=$r(e),f=sr(o,l);f.tag=2,n!=null&&(f.callback=n),n=zr(e,f,l),n!==null&&(Sn(n,e,l,o),Ks(n,e,l))}};function sf(e,n,o,l,f,p,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,w):n.prototype&&n.prototype.isPureReactComponent?!Io(o,l)||!Io(f,p):!0}function lf(e,n,o){var l=!1,f=Ir,p=n.contextType;return typeof p=="object"&&p!==null?p=un(p):(f=Dt(n)?ri:Ct.current,l=n.contextTypes,p=(l=l!=null)?Yi(e,f):Ir),n=new n(o,p),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=rl,e.stateNode=n,n._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=f,e.__reactInternalMemoizedMaskedChildContext=p),n}function af(e,n,o,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,l),n.state!==e&&rl.enqueueReplaceState(n,n.state,null)}function sc(e,n,o,l){var f=e.stateNode;f.props=o,f.state=e.memoizedState,f.refs={},Ya(e);var p=n.contextType;typeof p=="object"&&p!==null?f.context=un(p):(p=Dt(n)?ri:Ct.current,f.context=Yi(e,p)),f.state=e.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(oc(e,n,p,o),f.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(n=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),n!==f.state&&rl.enqueueReplaceState(f,f.state,null),Qs(e,o,f,l),f.state=e.memoizedState),typeof f.componentDidMount=="function"&&(e.flags|=4194308)}function eo(e,n){try{var o="",l=n;do o+=he(l),l=l.return;while(l);var f=o}catch(p){f=`
39
+ Error generating stack: `+p.message+`
40
+ `+p.stack}return{value:e,source:n,stack:f,digest:null}}function lc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function ac(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var Ry=typeof WeakMap=="function"?WeakMap:Map;function cf(e,n,o){o=sr(-1,o),o.tag=3,o.payload={element:null};var l=n.value;return o.callback=function(){ul||(ul=!0,Nc=l),ac(e,n)},o}function uf(e,n,o){o=sr(-1,o),o.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var f=n.value;o.payload=function(){return l(f)},o.callback=function(){ac(e,n)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(o.callback=function(){ac(e,n),typeof l!="function"&&(Lr===null?Lr=new Set([this]):Lr.add(this));var w=n.stack;this.componentDidCatch(n.value,{componentStack:w!==null?w:""})}),o}function df(e,n,o){var l=e.pingCache;if(l===null){l=e.pingCache=new Ry;var f=new Set;l.set(n,f)}else f=l.get(n),f===void 0&&(f=new Set,l.set(n,f));f.has(o)||(f.add(o),e=Xy.bind(null,e,n,o),n.then(e,e))}function ff(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function hf(e,n,o,l,f){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(n=sr(-1,1),n.tag=2,zr(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var zy=M.ReactCurrentOwner,$t=!1;function Tt(e,n,o,l){n.child=e===null?Td(n,null,o,l):Qi(n,e.child,o,l)}function pf(e,n,o,l,f){o=o.render;var p=n.ref;return Zi(n,f),l=Ja(e,n,o,l,p,f),o=ec(),e!==null&&!$t?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,lr(e,n,f)):(qe&&o&&La(n),n.flags|=1,Tt(e,n,l,f),n.child)}function mf(e,n,o,l,f){if(e===null){var p=o.type;return typeof p=="function"&&!Pc(p)&&p.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=p,gf(e,n,p,l,f)):(e=gl(o.type,null,l,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,(e.lanes&f)===0){var w=p.memoizedProps;if(o=o.compare,o=o!==null?o:Io,o(w,l)&&e.ref===n.ref)return lr(e,n,f)}return n.flags|=1,e=Fr(p,l),e.ref=n.ref,e.return=n,n.child=e}function gf(e,n,o,l,f){if(e!==null){var p=e.memoizedProps;if(Io(p,l)&&e.ref===n.ref)if($t=!1,n.pendingProps=l=p,(e.lanes&f)!==0)(e.flags&131072)!==0&&($t=!0);else return n.lanes=e.lanes,lr(e,n,f)}return cc(e,n,o,l,f)}function yf(e,n,o){var l=n.pendingProps,f=l.children,p=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(no,Qt),Qt|=o;else{if((o&1073741824)===0)return e=p!==null?p.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Ue(no,Qt),Qt|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:o,Ue(no,Qt),Qt|=l}else p!==null?(l=p.baseLanes|o,n.memoizedState=null):l=o,Ue(no,Qt),Qt|=l;return Tt(e,n,f,o),n.child}function vf(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function cc(e,n,o,l,f){var p=Dt(o)?ri:Ct.current;return p=Yi(n,p),Zi(n,f),o=Ja(e,n,o,l,p,f),l=ec(),e!==null&&!$t?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,lr(e,n,f)):(qe&&l&&La(n),n.flags|=1,Tt(e,n,o,f),n.child)}function xf(e,n,o,l,f){if(Dt(o)){var p=!0;Hs(n)}else p=!1;if(Zi(n,f),n.stateNode===null)ol(e,n),lf(n,o,l),sc(n,o,l,f),l=!0;else if(e===null){var w=n.stateNode,I=n.memoizedProps;w.props=I;var D=w.context,ee=o.contextType;typeof ee=="object"&&ee!==null?ee=un(ee):(ee=Dt(o)?ri:Ct.current,ee=Yi(n,ee));var ce=o.getDerivedStateFromProps,ue=typeof ce=="function"||typeof w.getSnapshotBeforeUpdate=="function";ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(I!==l||D!==ee)&&af(n,w,l,ee),Rr=!1;var ae=n.memoizedState;w.state=ae,Qs(n,l,w,f),D=n.memoizedState,I!==l||ae!==D||Lt.current||Rr?(typeof ce=="function"&&(oc(n,o,ce,l),D=n.memoizedState),(I=Rr||sf(n,o,I,l,ae,D,ee))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(n.flags|=4194308)):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=D),w.props=l,w.state=D,w.context=ee,l=I):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{w=n.stateNode,zd(e,n),I=n.memoizedProps,ee=n.type===n.elementType?I:vn(n.type,I),w.props=ee,ue=n.pendingProps,ae=w.context,D=o.contextType,typeof D=="object"&&D!==null?D=un(D):(D=Dt(o)?ri:Ct.current,D=Yi(n,D));var ye=o.getDerivedStateFromProps;(ce=typeof ye=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(I!==ue||ae!==D)&&af(n,w,l,D),Rr=!1,ae=n.memoizedState,w.state=ae,Qs(n,l,w,f);var xe=n.memoizedState;I!==ue||ae!==xe||Lt.current||Rr?(typeof ye=="function"&&(oc(n,o,ye,l),xe=n.memoizedState),(ee=Rr||sf(n,o,ee,l,ae,xe,D)||!1)?(ce||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,xe,D),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,xe,D)),typeof w.componentDidUpdate=="function"&&(n.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof w.componentDidUpdate!="function"||I===e.memoizedProps&&ae===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||I===e.memoizedProps&&ae===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=xe),w.props=l,w.state=xe,w.context=D,l=ee):(typeof w.componentDidUpdate!="function"||I===e.memoizedProps&&ae===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||I===e.memoizedProps&&ae===e.memoizedState||(n.flags|=1024),l=!1)}return uc(e,n,o,l,p,f)}function uc(e,n,o,l,f,p){vf(e,n);var w=(n.flags&128)!==0;if(!l&&!w)return f&&Nd(n,o,!1),lr(e,n,p);l=n.stateNode,zy.current=n;var I=w&&typeof o.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&w?(n.child=Qi(n,e.child,null,p),n.child=Qi(n,null,I,p)):Tt(e,n,I,p),n.memoizedState=l.state,f&&Nd(n,o,!0),n.child}function wf(e){var n=e.stateNode;n.pendingContext?Sd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&Sd(e,n.context,!1),Xa(e,n.containerInfo)}function Sf(e,n,o,l,f){return Ki(),Fa(f),n.flags|=256,Tt(e,n,o,l),n.child}var dc={dehydrated:null,treeContext:null,retryLane:0};function fc(e){return{baseLanes:e,cachePool:null,transitions:null}}function kf(e,n,o){var l=n.pendingProps,f=nt.current,p=!1,w=(n.flags&128)!==0,I;if((I=w)||(I=e!==null&&e.memoizedState===null?!1:(f&2)!==0),I?(p=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(f|=1),Ue(nt,f&1),e===null)return Oa(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(w=l.children,e=l.fallback,p?(l=n.mode,p=n.child,w={mode:"hidden",children:w},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=w):p=yl(w,l,0,null),e=hi(e,l,o,null),p.return=n,e.return=n,p.sibling=e,n.child=p,n.child.memoizedState=fc(o),n.memoizedState=dc,e):hc(n,w));if(f=e.memoizedState,f!==null&&(I=f.dehydrated,I!==null))return Ay(e,n,w,l,I,f,o);if(p){p=l.fallback,w=n.mode,f=e.child,I=f.sibling;var D={mode:"hidden",children:l.children};return(w&1)===0&&n.child!==f?(l=n.child,l.childLanes=0,l.pendingProps=D,n.deletions=null):(l=Fr(f,D),l.subtreeFlags=f.subtreeFlags&14680064),I!==null?p=Fr(I,p):(p=hi(p,w,o,null),p.flags|=2),p.return=n,l.return=n,l.sibling=p,n.child=l,l=p,p=n.child,w=e.child.memoizedState,w=w===null?fc(o):{baseLanes:w.baseLanes|o,cachePool:null,transitions:w.transitions},p.memoizedState=w,p.childLanes=e.childLanes&~o,n.memoizedState=dc,l}return p=e.child,e=p.sibling,l=Fr(p,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=o),l.return=n,l.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=l,n.memoizedState=null,l}function hc(e,n){return n=yl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function il(e,n,o,l){return l!==null&&Fa(l),Qi(n,e.child,null,o),e=hc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Ay(e,n,o,l,f,p,w){if(o)return n.flags&256?(n.flags&=-257,l=lc(Error(i(422))),il(e,n,w,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(p=l.fallback,f=n.mode,l=yl({mode:"visible",children:l.children},f,0,null),p=hi(p,f,w,null),p.flags|=2,l.return=n,p.return=n,l.sibling=p,n.child=l,(n.mode&1)!==0&&Qi(n,e.child,null,w),n.child.memoizedState=fc(w),n.memoizedState=dc,p);if((n.mode&1)===0)return il(e,n,w,null);if(f.data==="$!"){if(l=f.nextSibling&&f.nextSibling.dataset,l)var I=l.dgst;return l=I,p=Error(i(419)),l=lc(p,l,void 0),il(e,n,w,l)}if(I=(w&e.childLanes)!==0,$t||I){if(l=yt,l!==null){switch(w&-w){case 4:f=2;break;case 16:f=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:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(l.suspendedLanes|w))!==0?0:f,f!==0&&f!==p.retryLane&&(p.retryLane=f,or(e,f),Sn(l,e,f,-1))}return Mc(),l=lc(Error(i(421))),il(e,n,w,l)}return f.data==="$?"?(n.flags|=128,n.child=e.child,n=Gy.bind(null,e),f._reactRetry=n,null):(e=p.treeContext,Kt=Mr(f.nextSibling),Gt=n,qe=!0,yn=null,e!==null&&(an[cn++]=rr,an[cn++]=ir,an[cn++]=ii,rr=e.id,ir=e.overflow,ii=n),n=hc(n,l.children),n.flags|=4096,n)}function Nf(e,n,o){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),Wa(e.return,n,o)}function pc(e,n,o,l,f){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:f}:(p.isBackwards=n,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=o,p.tailMode=f)}function Ef(e,n,o){var l=n.pendingProps,f=l.revealOrder,p=l.tail;if(Tt(e,n,l.children,o),l=nt.current,(l&2)!==0)l=l&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Nf(e,o,n);else if(e.tag===19)Nf(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(Ue(nt,l),(n.mode&1)===0)n.memoizedState=null;else switch(f){case"forwards":for(o=n.child,f=null;o!==null;)e=o.alternate,e!==null&&qs(e)===null&&(f=o),o=o.sibling;o=f,o===null?(f=n.child,n.child=null):(f=o.sibling,o.sibling=null),pc(n,!1,f,o,p);break;case"backwards":for(o=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&qs(e)===null){n.child=f;break}e=f.sibling,f.sibling=o,o=f,f=e}pc(n,!0,o,null,p);break;case"together":pc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function ol(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function lr(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),ci|=n.lanes,(o&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,o=Fr(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=Fr(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Ly(e,n,o){switch(n.tag){case 3:wf(n),Ki();break;case 5:Dd(n);break;case 1:Dt(n.type)&&Hs(n);break;case 4:Xa(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,f=n.memoizedProps.value;Ue(Xs,l._currentValue),l._currentValue=f;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(Ue(nt,nt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?kf(e,n,o):(Ue(nt,nt.current&1),e=lr(e,n,o),e!==null?e.sibling:null);Ue(nt,nt.current&1);break;case 19:if(l=(o&n.childLanes)!==0,(e.flags&128)!==0){if(l)return Ef(e,n,o);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Ue(nt,nt.current),l)break;return null;case 22:case 23:return n.lanes=0,yf(e,n,o)}return lr(e,n,o)}var Cf,mc,_f,jf;Cf=function(e,n){for(var o=n.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},mc=function(){},_f=function(e,n,o,l){var f=e.memoizedProps;if(f!==l){e=n.stateNode,li(Ln.current);var p=null;switch(o){case"input":f=ze(e,f),l=ze(e,l),p=[];break;case"select":f=U({},f,{value:void 0}),l=U({},l,{value:void 0}),p=[];break;case"textarea":f=Wt(e,f),l=Wt(e,l),p=[];break;default:typeof f.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=$s)}pr(o,l);var w;o=null;for(ee in f)if(!l.hasOwnProperty(ee)&&f.hasOwnProperty(ee)&&f[ee]!=null)if(ee==="style"){var I=f[ee];for(w in I)I.hasOwnProperty(w)&&(o||(o={}),o[w]="")}else ee!=="dangerouslySetInnerHTML"&&ee!=="children"&&ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&ee!=="autoFocus"&&(a.hasOwnProperty(ee)?p||(p=[]):(p=p||[]).push(ee,null));for(ee in l){var D=l[ee];if(I=f!=null?f[ee]:void 0,l.hasOwnProperty(ee)&&D!==I&&(D!=null||I!=null))if(ee==="style")if(I){for(w in I)!I.hasOwnProperty(w)||D&&D.hasOwnProperty(w)||(o||(o={}),o[w]="");for(w in D)D.hasOwnProperty(w)&&I[w]!==D[w]&&(o||(o={}),o[w]=D[w])}else o||(p||(p=[]),p.push(ee,o)),o=D;else ee==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,I=I?I.__html:void 0,D!=null&&I!==D&&(p=p||[]).push(ee,D)):ee==="children"?typeof D!="string"&&typeof D!="number"||(p=p||[]).push(ee,""+D):ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&(a.hasOwnProperty(ee)?(D!=null&&ee==="onScroll"&&Ge("scroll",e),p||I===D||(p=[])):(p=p||[]).push(ee,D))}o&&(p=p||[]).push("style",o);var ee=p;(n.updateQueue=ee)&&(n.flags|=4)}},jf=function(e,n,o,l){o!==l&&(n.flags|=4)};function Yo(e,n){if(!qe)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function jt(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,l=0;if(n)for(var f=e.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags&14680064,l|=f.flags&14680064,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=l,e.childLanes=o,n}function Dy(e,n,o){var l=n.pendingProps;switch(Da(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(n),null;case 1:return Dt(n.type)&&Fs(),jt(n),null;case 3:return l=n.stateNode,Ji(),Ke(Lt),Ke(Ct),Qa(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Us(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,yn!==null&&(_c(yn),yn=null))),mc(e,n),jt(n),null;case 5:Ga(n);var f=li(Ho.current);if(o=n.type,e!==null&&n.stateNode!=null)_f(e,n,o,l,f),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(i(166));return jt(n),null}if(e=li(Ln.current),Us(n)){l=n.stateNode,o=n.type;var p=n.memoizedProps;switch(l[An]=n,l[Lo]=p,e=(n.mode&1)!==0,o){case"dialog":Ge("cancel",l),Ge("close",l);break;case"iframe":case"object":case"embed":Ge("load",l);break;case"video":case"audio":for(f=0;f<Ro.length;f++)Ge(Ro[f],l);break;case"source":Ge("error",l);break;case"img":case"image":case"link":Ge("error",l),Ge("load",l);break;case"details":Ge("toggle",l);break;case"input":Be(l,p),Ge("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},Ge("invalid",l);break;case"textarea":zt(l,p),Ge("invalid",l)}pr(o,p),f=null;for(var w in p)if(p.hasOwnProperty(w)){var I=p[w];w==="children"?typeof I=="string"?l.textContent!==I&&(p.suppressHydrationWarning!==!0&&Ds(l.textContent,I,e),f=["children",I]):typeof I=="number"&&l.textContent!==""+I&&(p.suppressHydrationWarning!==!0&&Ds(l.textContent,I,e),f=["children",""+I]):a.hasOwnProperty(w)&&I!=null&&w==="onScroll"&&Ge("scroll",l)}switch(o){case"input":je(l),Mt(l,p,!0);break;case"textarea":je(l),Wn(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=$s)}l=f,n.updateQueue=l,l!==null&&(n.flags|=4)}else{w=f.nodeType===9?f:f.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ut(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=w.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=w.createElement(o,{is:l.is}):(e=w.createElement(o),o==="select"&&(w=e,l.multiple?w.multiple=!0:l.size&&(w.size=l.size))):e=w.createElementNS(e,o),e[An]=n,e[Lo]=l,Cf(e,n,!1,!1),n.stateNode=e;e:{switch(w=Ut(o,l),o){case"dialog":Ge("cancel",e),Ge("close",e),f=l;break;case"iframe":case"object":case"embed":Ge("load",e),f=l;break;case"video":case"audio":for(f=0;f<Ro.length;f++)Ge(Ro[f],e);f=l;break;case"source":Ge("error",e),f=l;break;case"img":case"image":case"link":Ge("error",e),Ge("load",e),f=l;break;case"details":Ge("toggle",e),f=l;break;case"input":Be(e,l),f=ze(e,l),Ge("invalid",e);break;case"option":f=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},f=U({},l,{value:void 0}),Ge("invalid",e);break;case"textarea":zt(e,l),f=Wt(e,l),Ge("invalid",e);break;default:f=l}pr(o,f),I=f;for(p in I)if(I.hasOwnProperty(p)){var D=I[p];p==="style"?Kr(e,D):p==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,D!=null&&Gr(e,D)):p==="children"?typeof D=="string"?(o!=="textarea"||D!=="")&&lt(e,D):typeof D=="number"&&lt(e,""+D):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?D!=null&&p==="onScroll"&&Ge("scroll",e):D!=null&&S(e,p,D,w))}switch(o){case"input":je(e),Mt(e,l,!1);break;case"textarea":je(e),Wn(e);break;case"option":l.value!=null&&e.setAttribute("value",""+ie(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?wt(e,!!l.multiple,p,!1):l.defaultValue!=null&&wt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof f.onClick=="function"&&(e.onclick=$s)}switch(o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return jt(n),null;case 6:if(e&&n.stateNode!=null)jf(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(i(166));if(o=li(Ho.current),li(Ln.current),Us(n)){if(l=n.stateNode,o=n.memoizedProps,l[An]=n,(p=l.nodeValue!==o)&&(e=Gt,e!==null))switch(e.tag){case 3:Ds(l.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ds(l.nodeValue,o,(e.mode&1)!==0)}p&&(n.flags|=4)}else l=(o.nodeType===9?o:o.ownerDocument).createTextNode(l),l[An]=n,n.stateNode=l}return jt(n),null;case 13:if(Ke(nt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qe&&Kt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Md(),Ki(),n.flags|=98560,p=!1;else if(p=Us(n),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(i(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[An]=n}else Ki(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;jt(n),p=!1}else yn!==null&&(_c(yn),yn=null),p=!0;if(!p)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(nt.current&1)!==0?ht===0&&(ht=3):Mc())),n.updateQueue!==null&&(n.flags|=4),jt(n),null);case 4:return Ji(),mc(e,n),e===null&&zo(n.stateNode.containerInfo),jt(n),null;case 10:return Va(n.type._context),jt(n),null;case 17:return Dt(n.type)&&Fs(),jt(n),null;case 19:if(Ke(nt),p=n.memoizedState,p===null)return jt(n),null;if(l=(n.flags&128)!==0,w=p.rendering,w===null)if(l)Yo(p,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(w=qs(e),w!==null){for(n.flags|=128,Yo(p,!1),l=w.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=o,o=n.child;o!==null;)p=o,e=l,p.flags&=14680066,w=p.alternate,w===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=w.childLanes,p.lanes=w.lanes,p.child=w.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=w.memoizedProps,p.memoizedState=w.memoizedState,p.updateQueue=w.updateQueue,p.type=w.type,e=w.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return Ue(nt,nt.current&1|2),n.child}e=e.sibling}p.tail!==null&&Xe()>ro&&(n.flags|=128,l=!0,Yo(p,!1),n.lanes=4194304)}else{if(!l)if(e=qs(w),e!==null){if(n.flags|=128,l=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),Yo(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!qe)return jt(n),null}else 2*Xe()-p.renderingStartTime>ro&&o!==1073741824&&(n.flags|=128,l=!0,Yo(p,!1),n.lanes=4194304);p.isBackwards?(w.sibling=n.child,n.child=w):(o=p.last,o!==null?o.sibling=w:n.child=w,p.last=w)}return p.tail!==null?(n=p.tail,p.rendering=n,p.tail=n.sibling,p.renderingStartTime=Xe(),n.sibling=null,o=nt.current,Ue(nt,l?o&1|2:o&1),n):(jt(n),null);case 22:case 23:return bc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Qt&1073741824)!==0&&(jt(n),n.subtreeFlags&6&&(n.flags|=8192)):jt(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function $y(e,n){switch(Da(n),n.tag){case 1:return Dt(n.type)&&Fs(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Ji(),Ke(Lt),Ke(Ct),Qa(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Ga(n),null;case 13:if(Ke(nt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Ki()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Ke(nt),null;case 4:return Ji(),null;case 10:return Va(n.type._context),null;case 22:case 23:return bc(),null;case 24:return null;default:return null}}var sl=!1,bt=!1,Oy=typeof WeakSet=="function"?WeakSet:Set,ve=null;function to(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(l){ot(e,n,l)}else o.current=null}function gc(e,n,o){try{o()}catch(l){ot(e,n,l)}}var bf=!1;function Fy(e,n){if(ba=tt,e=od(),wa(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var f=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var w=0,I=-1,D=-1,ee=0,ce=0,ue=e,ae=null;t:for(;;){for(var ye;ue!==o||f!==0&&ue.nodeType!==3||(I=w+f),ue!==p||l!==0&&ue.nodeType!==3||(D=w+l),ue.nodeType===3&&(w+=ue.nodeValue.length),(ye=ue.firstChild)!==null;)ae=ue,ue=ye;for(;;){if(ue===e)break t;if(ae===o&&++ee===f&&(I=w),ae===p&&++ce===l&&(D=w),(ye=ue.nextSibling)!==null)break;ue=ae,ae=ue.parentNode}ue=ye}o=I===-1||D===-1?null:{start:I,end:D}}else o=null}o=o||{start:0,end:0}}else o=null;for(Ma={focusedElem:e,selectionRange:o},tt=!1,ve=n;ve!==null;)if(n=ve,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ve=e;else for(;ve!==null;){n=ve;try{var xe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var Se=xe.memoizedProps,st=xe.memoizedState,X=n.stateNode,F=X.getSnapshotBeforeUpdate(n.elementType===n.type?Se:vn(n.type,Se),st);X.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var q=n.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(fe){ot(n,n.return,fe)}if(e=n.sibling,e!==null){e.return=n.return,ve=e;break}ve=n.return}return xe=bf,bf=!1,xe}function Xo(e,n,o){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&e)===e){var p=f.destroy;f.destroy=void 0,p!==void 0&&gc(n,o,p)}f=f.next}while(f!==l)}}function ll(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var l=o.create;o.destroy=l()}o=o.next}while(o!==n)}}function yc(e){var n=e.ref;if(n!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof n=="function"?n(e):n.current=e}}function Mf(e){var n=e.alternate;n!==null&&(e.alternate=null,Mf(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[An],delete n[Lo],delete n[Ra],delete n[ky],delete n[Ny])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Pf(e){return e.tag===5||e.tag===3||e.tag===4}function If(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Pf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function vc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=$s));else if(l!==4&&(e=e.child,e!==null))for(vc(e,n,o),e=e.sibling;e!==null;)vc(e,n,o),e=e.sibling}function xc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(xc(e,n,o),e=e.sibling;e!==null;)xc(e,n,o),e=e.sibling}var St=null,xn=!1;function Ar(e,n,o){for(o=o.child;o!==null;)Tf(e,n,o),o=o.sibling}function Tf(e,n,o){if(dt&&typeof dt.onCommitFiberUnmount=="function")try{dt.onCommitFiberUnmount(In,o)}catch{}switch(o.tag){case 5:bt||to(o,n);case 6:var l=St,f=xn;St=null,Ar(e,n,o),St=l,xn=f,St!==null&&(xn?(e=St,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):St.removeChild(o.stateNode));break;case 18:St!==null&&(xn?(e=St,o=o.stateNode,e.nodeType===8?Ta(e.parentNode,o):e.nodeType===1&&Ta(e,o),it(e)):Ta(St,o.stateNode));break;case 4:l=St,f=xn,St=o.stateNode.containerInfo,xn=!0,Ar(e,n,o),St=l,xn=f;break;case 0:case 11:case 14:case 15:if(!bt&&(l=o.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){f=l=l.next;do{var p=f,w=p.destroy;p=p.tag,w!==void 0&&((p&2)!==0||(p&4)!==0)&&gc(o,n,w),f=f.next}while(f!==l)}Ar(e,n,o);break;case 1:if(!bt&&(to(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=o.memoizedProps,l.state=o.memoizedState,l.componentWillUnmount()}catch(I){ot(o,n,I)}Ar(e,n,o);break;case 21:Ar(e,n,o);break;case 22:o.mode&1?(bt=(l=bt)||o.memoizedState!==null,Ar(e,n,o),bt=l):Ar(e,n,o);break;default:Ar(e,n,o)}}function Rf(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Oy),n.forEach(function(l){var f=Ky.bind(null,e,l);o.has(l)||(o.add(l),l.then(f,f))})}}function wn(e,n){var o=n.deletions;if(o!==null)for(var l=0;l<o.length;l++){var f=o[l];try{var p=e,w=n,I=w;e:for(;I!==null;){switch(I.tag){case 5:St=I.stateNode,xn=!1;break e;case 3:St=I.stateNode.containerInfo,xn=!0;break e;case 4:St=I.stateNode.containerInfo,xn=!0;break e}I=I.return}if(St===null)throw Error(i(160));Tf(p,w,f),St=null,xn=!1;var D=f.alternate;D!==null&&(D.return=null),f.return=null}catch(ee){ot(f,n,ee)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)zf(n,e),n=n.sibling}function zf(e,n){var o=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wn(n,e),$n(e),l&4){try{Xo(3,e,e.return),ll(3,e)}catch(Se){ot(e,e.return,Se)}try{Xo(5,e,e.return)}catch(Se){ot(e,e.return,Se)}}break;case 1:wn(n,e),$n(e),l&512&&o!==null&&to(o,o.return);break;case 5:if(wn(n,e),$n(e),l&512&&o!==null&&to(o,o.return),e.flags&32){var f=e.stateNode;try{lt(f,"")}catch(Se){ot(e,e.return,Se)}}if(l&4&&(f=e.stateNode,f!=null)){var p=e.memoizedProps,w=o!==null?o.memoizedProps:p,I=e.type,D=e.updateQueue;if(e.updateQueue=null,D!==null)try{I==="input"&&p.type==="radio"&&p.name!=null&&Ae(f,p),Ut(I,w);var ee=Ut(I,p);for(w=0;w<D.length;w+=2){var ce=D[w],ue=D[w+1];ce==="style"?Kr(f,ue):ce==="dangerouslySetInnerHTML"?Gr(f,ue):ce==="children"?lt(f,ue):S(f,ce,ue,ee)}switch(I){case"input":et(f,p);break;case"textarea":hr(f,p);break;case"select":var ae=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!p.multiple;var ye=p.value;ye!=null?wt(f,!!p.multiple,ye,!1):ae!==!!p.multiple&&(p.defaultValue!=null?wt(f,!!p.multiple,p.defaultValue,!0):wt(f,!!p.multiple,p.multiple?[]:"",!1))}f[Lo]=p}catch(Se){ot(e,e.return,Se)}}break;case 6:if(wn(n,e),$n(e),l&4){if(e.stateNode===null)throw Error(i(162));f=e.stateNode,p=e.memoizedProps;try{f.nodeValue=p}catch(Se){ot(e,e.return,Se)}}break;case 3:if(wn(n,e),$n(e),l&4&&o!==null&&o.memoizedState.isDehydrated)try{it(n.containerInfo)}catch(Se){ot(e,e.return,Se)}break;case 4:wn(n,e),$n(e);break;case 13:wn(n,e),$n(e),f=e.child,f.flags&8192&&(p=f.memoizedState!==null,f.stateNode.isHidden=p,!p||f.alternate!==null&&f.alternate.memoizedState!==null||(kc=Xe())),l&4&&Rf(e);break;case 22:if(ce=o!==null&&o.memoizedState!==null,e.mode&1?(bt=(ee=bt)||ce,wn(n,e),bt=ee):wn(n,e),$n(e),l&8192){if(ee=e.memoizedState!==null,(e.stateNode.isHidden=ee)&&!ce&&(e.mode&1)!==0)for(ve=e,ce=e.child;ce!==null;){for(ue=ve=ce;ve!==null;){switch(ae=ve,ye=ae.child,ae.tag){case 0:case 11:case 14:case 15:Xo(4,ae,ae.return);break;case 1:to(ae,ae.return);var xe=ae.stateNode;if(typeof xe.componentWillUnmount=="function"){l=ae,o=ae.return;try{n=l,xe.props=n.memoizedProps,xe.state=n.memoizedState,xe.componentWillUnmount()}catch(Se){ot(l,o,Se)}}break;case 5:to(ae,ae.return);break;case 22:if(ae.memoizedState!==null){Df(ue);continue}}ye!==null?(ye.return=ae,ve=ye):Df(ue)}ce=ce.sibling}e:for(ce=null,ue=e;;){if(ue.tag===5){if(ce===null){ce=ue;try{f=ue.stateNode,ee?(p=f.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(I=ue.stateNode,D=ue.memoizedProps.style,w=D!=null&&D.hasOwnProperty("display")?D.display:null,I.style.display=_i("display",w))}catch(Se){ot(e,e.return,Se)}}}else if(ue.tag===6){if(ce===null)try{ue.stateNode.nodeValue=ee?"":ue.memoizedProps}catch(Se){ot(e,e.return,Se)}}else if((ue.tag!==22&&ue.tag!==23||ue.memoizedState===null||ue===e)&&ue.child!==null){ue.child.return=ue,ue=ue.child;continue}if(ue===e)break e;for(;ue.sibling===null;){if(ue.return===null||ue.return===e)break e;ce===ue&&(ce=null),ue=ue.return}ce===ue&&(ce=null),ue.sibling.return=ue.return,ue=ue.sibling}}break;case 19:wn(n,e),$n(e),l&4&&Rf(e);break;case 21:break;default:wn(n,e),$n(e)}}function $n(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(Pf(o)){var l=o;break e}o=o.return}throw Error(i(160))}switch(l.tag){case 5:var f=l.stateNode;l.flags&32&&(lt(f,""),l.flags&=-33);var p=If(e);xc(e,p,f);break;case 3:case 4:var w=l.stateNode.containerInfo,I=If(e);vc(e,I,w);break;default:throw Error(i(161))}}catch(D){ot(e,e.return,D)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Hy(e,n,o){ve=e,Af(e)}function Af(e,n,o){for(var l=(e.mode&1)!==0;ve!==null;){var f=ve,p=f.child;if(f.tag===22&&l){var w=f.memoizedState!==null||sl;if(!w){var I=f.alternate,D=I!==null&&I.memoizedState!==null||bt;I=sl;var ee=bt;if(sl=w,(bt=D)&&!ee)for(ve=f;ve!==null;)w=ve,D=w.child,w.tag===22&&w.memoizedState!==null?$f(f):D!==null?(D.return=w,ve=D):$f(f);for(;p!==null;)ve=p,Af(p),p=p.sibling;ve=f,sl=I,bt=ee}Lf(e)}else(f.subtreeFlags&8772)!==0&&p!==null?(p.return=f,ve=p):Lf(e)}}function Lf(e){for(;ve!==null;){var n=ve;if((n.flags&8772)!==0){var o=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:bt||ll(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!bt)if(o===null)l.componentDidMount();else{var f=n.elementType===n.type?o.memoizedProps:vn(n.type,o.memoizedProps);l.componentDidUpdate(f,o.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=n.updateQueue;p!==null&&Ld(n,p,l);break;case 3:var w=n.updateQueue;if(w!==null){if(o=null,n.child!==null)switch(n.child.tag){case 5:o=n.child.stateNode;break;case 1:o=n.child.stateNode}Ld(n,w,o)}break;case 5:var I=n.stateNode;if(o===null&&n.flags&4){o=I;var D=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":D.autoFocus&&o.focus();break;case"img":D.src&&(o.src=D.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ee=n.alternate;if(ee!==null){var ce=ee.memoizedState;if(ce!==null){var ue=ce.dehydrated;ue!==null&&it(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}bt||n.flags&512&&yc(n)}catch(ae){ot(n,n.return,ae)}}if(n===e){ve=null;break}if(o=n.sibling,o!==null){o.return=n.return,ve=o;break}ve=n.return}}function Df(e){for(;ve!==null;){var n=ve;if(n===e){ve=null;break}var o=n.sibling;if(o!==null){o.return=n.return,ve=o;break}ve=n.return}}function $f(e){for(;ve!==null;){var n=ve;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{ll(4,n)}catch(D){ot(n,o,D)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var f=n.return;try{l.componentDidMount()}catch(D){ot(n,f,D)}}var p=n.return;try{yc(n)}catch(D){ot(n,p,D)}break;case 5:var w=n.return;try{yc(n)}catch(D){ot(n,w,D)}}}catch(D){ot(n,n.return,D)}if(n===e){ve=null;break}var I=n.sibling;if(I!==null){I.return=n.return,ve=I;break}ve=n.return}}var By=Math.ceil,al=M.ReactCurrentDispatcher,wc=M.ReactCurrentOwner,fn=M.ReactCurrentBatchConfig,Fe=0,yt=null,at=null,kt=0,Qt=0,no=Pr(0),ht=0,Go=null,ci=0,cl=0,Sc=0,Ko=null,Ot=null,kc=0,ro=1/0,ar=null,ul=!1,Nc=null,Lr=null,dl=!1,Dr=null,fl=0,Qo=0,Ec=null,hl=-1,pl=0;function Rt(){return(Fe&6)!==0?Xe():hl!==-1?hl:hl=Xe()}function $r(e){return(e.mode&1)===0?1:(Fe&2)!==0&&kt!==0?kt&-kt:Cy.transition!==null?(pl===0&&(pl=Jn()),pl):(e=$e,e!==0||(e=window.event,e=e===void 0?16:Ou(e.type)),e)}function Sn(e,n,o,l){if(50<Qo)throw Qo=0,Ec=null,Error(i(185));Tn(e,o,l),((Fe&2)===0||e!==yt)&&(e===yt&&((Fe&2)===0&&(cl|=o),ht===4&&Or(e,kt)),Ft(e,l),o===1&&Fe===0&&(n.mode&1)===0&&(ro=Xe()+500,Bs&&Tr()))}function Ft(e,n){var o=e.callbackNode;ko(e,n);var l=Nr(e,e===yt?kt:0);if(l===0)o!==null&&Pn(o),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(o!=null&&Pn(o),n===1)e.tag===0?Ey(Ff.bind(null,e)):Ed(Ff.bind(null,e)),wy(function(){(Fe&6)===0&&Tr()}),o=null;else{switch(Ns(l)){case 1:o=xr;break;case 4:o=Ri;break;case 16:o=qn;break;case 536870912:o=Zn;break;default:o=qn}o=Gf(o,Of.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Of(e,n){if(hl=-1,pl=0,(Fe&6)!==0)throw Error(i(327));var o=e.callbackNode;if(io()&&e.callbackNode!==o)return null;var l=Nr(e,e===yt?kt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=ml(e,l);else{n=l;var f=Fe;Fe|=2;var p=Bf();(yt!==e||kt!==n)&&(ar=null,ro=Xe()+500,di(e,n));do try{Uy();break}catch(I){Hf(e,I)}while(!0);Ba(),al.current=p,Fe=f,at!==null?n=0:(yt=null,kt=0,n=ht)}if(n!==0){if(n===2&&(f=Cr(e),f!==0&&(l=f,n=Cc(e,f))),n===1)throw o=Go,di(e,0),Or(e,l),Ft(e,Xe()),o;if(n===6)Or(e,l);else{if(f=e.current.alternate,(l&30)===0&&!Vy(f)&&(n=ml(e,l),n===2&&(p=Cr(e),p!==0&&(l=p,n=Cc(e,p))),n===1))throw o=Go,di(e,0),Or(e,l),Ft(e,Xe()),o;switch(e.finishedWork=f,e.finishedLanes=l,n){case 0:case 1:throw Error(i(345));case 2:fi(e,Ot,ar);break;case 3:if(Or(e,l),(l&130023424)===l&&(n=kc+500-Xe(),10<n)){if(Nr(e,0)!==0)break;if(f=e.suspendedLanes,(f&l)!==l){Rt(),e.pingedLanes|=e.suspendedLanes&f;break}e.timeoutHandle=Ia(fi.bind(null,e,Ot,ar),n);break}fi(e,Ot,ar);break;case 4:if(Or(e,l),(l&4194240)===l)break;for(n=e.eventTimes,f=-1;0<l;){var w=31-It(l);p=1<<w,w=n[w],w>f&&(f=w),l&=~p}if(l=f,l=Xe()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*By(l/1960))-l,10<l){e.timeoutHandle=Ia(fi.bind(null,e,Ot,ar),l);break}fi(e,Ot,ar);break;case 5:fi(e,Ot,ar);break;default:throw Error(i(329))}}}return Ft(e,Xe()),e.callbackNode===o?Of.bind(null,e):null}function Cc(e,n){var o=Ko;return e.current.memoizedState.isDehydrated&&(di(e,n).flags|=256),e=ml(e,n),e!==2&&(n=Ot,Ot=o,n!==null&&_c(n)),e}function _c(e){Ot===null?Ot=e:Ot.push.apply(Ot,e)}function Vy(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var l=0;l<o.length;l++){var f=o[l],p=f.getSnapshot;f=f.value;try{if(!gn(p(),f))return!1}catch{return!1}}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Or(e,n){for(n&=~Sc,n&=~cl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-It(n),l=1<<o;e[o]=-1,n&=~l}}function Ff(e){if((Fe&6)!==0)throw Error(i(327));io();var n=Nr(e,0);if((n&1)===0)return Ft(e,Xe()),null;var o=ml(e,n);if(e.tag!==0&&o===2){var l=Cr(e);l!==0&&(n=l,o=Cc(e,l))}if(o===1)throw o=Go,di(e,0),Or(e,n),Ft(e,Xe()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,fi(e,Ot,ar),Ft(e,Xe()),null}function jc(e,n){var o=Fe;Fe|=1;try{return e(n)}finally{Fe=o,Fe===0&&(ro=Xe()+500,Bs&&Tr())}}function ui(e){Dr!==null&&Dr.tag===0&&(Fe&6)===0&&io();var n=Fe;Fe|=1;var o=fn.transition,l=$e;try{if(fn.transition=null,$e=1,e)return e()}finally{$e=l,fn.transition=o,Fe=n,(Fe&6)===0&&Tr()}}function bc(){Qt=no.current,Ke(no)}function di(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,xy(o)),at!==null)for(o=at.return;o!==null;){var l=o;switch(Da(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Fs();break;case 3:Ji(),Ke(Lt),Ke(Ct),Qa();break;case 5:Ga(l);break;case 4:Ji();break;case 13:Ke(nt);break;case 19:Ke(nt);break;case 10:Va(l.type._context);break;case 22:case 23:bc()}o=o.return}if(yt=e,at=e=Fr(e.current,null),kt=Qt=n,ht=0,Go=null,Sc=cl=ci=0,Ot=Ko=null,si!==null){for(n=0;n<si.length;n++)if(o=si[n],l=o.interleaved,l!==null){o.interleaved=null;var f=l.next,p=o.pending;if(p!==null){var w=p.next;p.next=f,l.next=w}o.pending=l}si=null}return e}function Hf(e,n){do{var o=at;try{if(Ba(),Zs.current=nl,Js){for(var l=rt.memoizedState;l!==null;){var f=l.queue;f!==null&&(f.pending=null),l=l.next}Js=!1}if(ai=0,gt=ft=rt=null,Bo=!1,Vo=0,wc.current=null,o===null||o.return===null){ht=1,Go=n,at=null;break}e:{var p=e,w=o.return,I=o,D=n;if(n=kt,I.flags|=32768,D!==null&&typeof D=="object"&&typeof D.then=="function"){var ee=D,ce=I,ue=ce.tag;if((ce.mode&1)===0&&(ue===0||ue===11||ue===15)){var ae=ce.alternate;ae?(ce.updateQueue=ae.updateQueue,ce.memoizedState=ae.memoizedState,ce.lanes=ae.lanes):(ce.updateQueue=null,ce.memoizedState=null)}var ye=ff(w);if(ye!==null){ye.flags&=-257,hf(ye,w,I,p,n),ye.mode&1&&df(p,ee,n),n=ye,D=ee;var xe=n.updateQueue;if(xe===null){var Se=new Set;Se.add(D),n.updateQueue=Se}else xe.add(D);break e}else{if((n&1)===0){df(p,ee,n),Mc();break e}D=Error(i(426))}}else if(qe&&I.mode&1){var st=ff(w);if(st!==null){(st.flags&65536)===0&&(st.flags|=256),hf(st,w,I,p,n),Fa(eo(D,I));break e}}p=D=eo(D,I),ht!==4&&(ht=2),Ko===null?Ko=[p]:Ko.push(p),p=w;do{switch(p.tag){case 3:p.flags|=65536,n&=-n,p.lanes|=n;var X=cf(p,D,n);Ad(p,X);break e;case 1:I=D;var F=p.type,q=p.stateNode;if((p.flags&128)===0&&(typeof F.getDerivedStateFromError=="function"||q!==null&&typeof q.componentDidCatch=="function"&&(Lr===null||!Lr.has(q)))){p.flags|=65536,n&=-n,p.lanes|=n;var fe=uf(p,I,n);Ad(p,fe);break e}}p=p.return}while(p!==null)}Wf(o)}catch(Ee){n=Ee,at===o&&o!==null&&(at=o=o.return);continue}break}while(!0)}function Bf(){var e=al.current;return al.current=nl,e===null?nl:e}function Mc(){(ht===0||ht===3||ht===2)&&(ht=4),yt===null||(ci&268435455)===0&&(cl&268435455)===0||Or(yt,kt)}function ml(e,n){var o=Fe;Fe|=2;var l=Bf();(yt!==e||kt!==n)&&(ar=null,di(e,n));do try{Wy();break}catch(f){Hf(e,f)}while(!0);if(Ba(),Fe=o,al.current=l,at!==null)throw Error(i(261));return yt=null,kt=0,ht}function Wy(){for(;at!==null;)Vf(at)}function Uy(){for(;at!==null&&!wo();)Vf(at)}function Vf(e){var n=Xf(e.alternate,e,Qt);e.memoizedProps=e.pendingProps,n===null?Wf(e):at=n,wc.current=null}function Wf(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=Dy(o,n,Qt),o!==null){at=o;return}}else{if(o=$y(o,n),o!==null){o.flags&=32767,at=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ht=6,at=null;return}}if(n=n.sibling,n!==null){at=n;return}at=n=e}while(n!==null);ht===0&&(ht=5)}function fi(e,n,o){var l=$e,f=fn.transition;try{fn.transition=null,$e=1,Yy(e,n,o,l)}finally{fn.transition=f,$e=l}return null}function Yy(e,n,o,l){do io();while(Dr!==null);if((Fe&6)!==0)throw Error(i(327));o=e.finishedWork;var f=e.finishedLanes;if(o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var p=o.lanes|o.childLanes;if(ti(e,p),e===yt&&(at=yt=null,kt=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||dl||(dl=!0,Gf(qn,function(){return io(),null})),p=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||p){p=fn.transition,fn.transition=null;var w=$e;$e=1;var I=Fe;Fe|=4,wc.current=null,Fy(e,o),zf(o,e),fy(Ma),tt=!!ba,Ma=ba=null,e.current=o,Hy(o),Ii(),Fe=I,$e=w,fn.transition=p}else e.current=o;if(dl&&(dl=!1,Dr=e,fl=f),p=e.pendingLanes,p===0&&(Lr=null),So(o.stateNode),Ft(e,Xe()),n!==null)for(l=e.onRecoverableError,o=0;o<n.length;o++)f=n[o],l(f.value,{componentStack:f.stack,digest:f.digest});if(ul)throw ul=!1,e=Nc,Nc=null,e;return(fl&1)!==0&&e.tag!==0&&io(),p=e.pendingLanes,(p&1)!==0?e===Ec?Qo++:(Qo=0,Ec=e):Qo=0,Tr(),null}function io(){if(Dr!==null){var e=Ns(fl),n=fn.transition,o=$e;try{if(fn.transition=null,$e=16>e?16:e,Dr===null)var l=!1;else{if(e=Dr,Dr=null,fl=0,(Fe&6)!==0)throw Error(i(331));var f=Fe;for(Fe|=4,ve=e.current;ve!==null;){var p=ve,w=p.child;if((ve.flags&16)!==0){var I=p.deletions;if(I!==null){for(var D=0;D<I.length;D++){var ee=I[D];for(ve=ee;ve!==null;){var ce=ve;switch(ce.tag){case 0:case 11:case 15:Xo(8,ce,p)}var ue=ce.child;if(ue!==null)ue.return=ce,ve=ue;else for(;ve!==null;){ce=ve;var ae=ce.sibling,ye=ce.return;if(Mf(ce),ce===ee){ve=null;break}if(ae!==null){ae.return=ye,ve=ae;break}ve=ye}}}var xe=p.alternate;if(xe!==null){var Se=xe.child;if(Se!==null){xe.child=null;do{var st=Se.sibling;Se.sibling=null,Se=st}while(Se!==null)}}ve=p}}if((p.subtreeFlags&2064)!==0&&w!==null)w.return=p,ve=w;else e:for(;ve!==null;){if(p=ve,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Xo(9,p,p.return)}var X=p.sibling;if(X!==null){X.return=p.return,ve=X;break e}ve=p.return}}var F=e.current;for(ve=F;ve!==null;){w=ve;var q=w.child;if((w.subtreeFlags&2064)!==0&&q!==null)q.return=w,ve=q;else e:for(w=F;ve!==null;){if(I=ve,(I.flags&2048)!==0)try{switch(I.tag){case 0:case 11:case 15:ll(9,I)}}catch(Ee){ot(I,I.return,Ee)}if(I===w){ve=null;break e}var fe=I.sibling;if(fe!==null){fe.return=I.return,ve=fe;break e}ve=I.return}}if(Fe=f,Tr(),dt&&typeof dt.onPostCommitFiberRoot=="function")try{dt.onPostCommitFiberRoot(In,e)}catch{}l=!0}return l}finally{$e=o,fn.transition=n}}return!1}function Uf(e,n,o){n=eo(o,n),n=cf(e,n,1),e=zr(e,n,1),n=Rt(),e!==null&&(Tn(e,1,n),Ft(e,n))}function ot(e,n,o){if(e.tag===3)Uf(e,e,o);else for(;n!==null;){if(n.tag===3){Uf(n,e,o);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Lr===null||!Lr.has(l))){e=eo(o,e),e=uf(n,e,1),n=zr(n,e,1),e=Rt(),n!==null&&(Tn(n,1,e),Ft(n,e));break}}n=n.return}}function Xy(e,n,o){var l=e.pingCache;l!==null&&l.delete(n),n=Rt(),e.pingedLanes|=e.suspendedLanes&o,yt===e&&(kt&o)===o&&(ht===4||ht===3&&(kt&130023424)===kt&&500>Xe()-kc?di(e,0):Sc|=o),Ft(e,n)}function Yf(e,n){n===0&&((e.mode&1)===0?n=1:(n=kr,kr<<=1,(kr&130023424)===0&&(kr=4194304)));var o=Rt();e=or(e,n),e!==null&&(Tn(e,n,o),Ft(e,o))}function Gy(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Yf(e,o)}function Ky(e,n){var o=0;switch(e.tag){case 13:var l=e.stateNode,f=e.memoizedState;f!==null&&(o=f.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(n),Yf(e,o)}var Xf;Xf=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||Lt.current)$t=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return $t=!1,Ly(e,n,o);$t=(e.flags&131072)!==0}else $t=!1,qe&&(n.flags&1048576)!==0&&Cd(n,Ws,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;ol(e,n),e=n.pendingProps;var f=Yi(n,Ct.current);Zi(n,o),f=Ja(null,n,l,e,f,o);var p=ec();return n.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Dt(l)?(p=!0,Hs(n)):p=!1,n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Ya(n),f.updater=rl,n.stateNode=f,f._reactInternals=n,sc(n,l,e,o),n=uc(null,n,l,!0,p,o)):(n.tag=0,qe&&p&&La(n),Tt(null,n,f,o),n=n.child),n;case 16:l=n.elementType;e:{switch(ol(e,n),e=n.pendingProps,f=l._init,l=f(l._payload),n.type=l,f=n.tag=qy(l),e=vn(l,e),f){case 0:n=cc(null,n,l,e,o);break e;case 1:n=xf(null,n,l,e,o);break e;case 11:n=pf(null,n,l,e,o);break e;case 14:n=mf(null,n,l,vn(l.type,e),o);break e}throw Error(i(306,l,""))}return n;case 0:return l=n.type,f=n.pendingProps,f=n.elementType===l?f:vn(l,f),cc(e,n,l,f,o);case 1:return l=n.type,f=n.pendingProps,f=n.elementType===l?f:vn(l,f),xf(e,n,l,f,o);case 3:e:{if(wf(n),e===null)throw Error(i(387));l=n.pendingProps,p=n.memoizedState,f=p.element,zd(e,n),Qs(n,l,null,o);var w=n.memoizedState;if(l=w.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){f=eo(Error(i(423)),n),n=Sf(e,n,l,o,f);break e}else if(l!==f){f=eo(Error(i(424)),n),n=Sf(e,n,l,o,f);break e}else for(Kt=Mr(n.stateNode.containerInfo.firstChild),Gt=n,qe=!0,yn=null,o=Td(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Ki(),l===f){n=lr(e,n,o);break e}Tt(e,n,l,o)}n=n.child}return n;case 5:return Dd(n),e===null&&Oa(n),l=n.type,f=n.pendingProps,p=e!==null?e.memoizedProps:null,w=f.children,Pa(l,f)?w=null:p!==null&&Pa(l,p)&&(n.flags|=32),vf(e,n),Tt(e,n,w,o),n.child;case 6:return e===null&&Oa(n),null;case 13:return kf(e,n,o);case 4:return Xa(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=Qi(n,null,l,o):Tt(e,n,l,o),n.child;case 11:return l=n.type,f=n.pendingProps,f=n.elementType===l?f:vn(l,f),pf(e,n,l,f,o);case 7:return Tt(e,n,n.pendingProps,o),n.child;case 8:return Tt(e,n,n.pendingProps.children,o),n.child;case 12:return Tt(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(l=n.type._context,f=n.pendingProps,p=n.memoizedProps,w=f.value,Ue(Xs,l._currentValue),l._currentValue=w,p!==null)if(gn(p.value,w)){if(p.children===f.children&&!Lt.current){n=lr(e,n,o);break e}}else for(p=n.child,p!==null&&(p.return=n);p!==null;){var I=p.dependencies;if(I!==null){w=p.child;for(var D=I.firstContext;D!==null;){if(D.context===l){if(p.tag===1){D=sr(-1,o&-o),D.tag=2;var ee=p.updateQueue;if(ee!==null){ee=ee.shared;var ce=ee.pending;ce===null?D.next=D:(D.next=ce.next,ce.next=D),ee.pending=D}}p.lanes|=o,D=p.alternate,D!==null&&(D.lanes|=o),Wa(p.return,o,n),I.lanes|=o;break}D=D.next}}else if(p.tag===10)w=p.type===n.type?null:p.child;else if(p.tag===18){if(w=p.return,w===null)throw Error(i(341));w.lanes|=o,I=w.alternate,I!==null&&(I.lanes|=o),Wa(w,o,n),w=p.sibling}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===n){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}Tt(e,n,f.children,o),n=n.child}return n;case 9:return f=n.type,l=n.pendingProps.children,Zi(n,o),f=un(f),l=l(f),n.flags|=1,Tt(e,n,l,o),n.child;case 14:return l=n.type,f=vn(l,n.pendingProps),f=vn(l.type,f),mf(e,n,l,f,o);case 15:return gf(e,n,n.type,n.pendingProps,o);case 17:return l=n.type,f=n.pendingProps,f=n.elementType===l?f:vn(l,f),ol(e,n),n.tag=1,Dt(l)?(e=!0,Hs(n)):e=!1,Zi(n,o),lf(n,l,f),sc(n,l,f,o),uc(null,n,l,!0,e,o);case 19:return Ef(e,n,o);case 22:return yf(e,n,o)}throw Error(i(156,n.tag))};function Gf(e,n){return Yt(e,n)}function Qy(e,n,o,l){this.tag=e,this.key=o,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hn(e,n,o,l){return new Qy(e,n,o,l)}function Pc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qy(e){if(typeof e=="function")return Pc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===G)return 11;if(e===Q)return 14}return 2}function Fr(e,n){var o=e.alternate;return o===null?(o=hn(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function gl(e,n,o,l,f,p){var w=2;if(l=e,typeof e=="function")Pc(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case H:return hi(o.children,f,p,n);case Z:w=8,f|=8;break;case B:return e=hn(12,o,n,f|2),e.elementType=B,e.lanes=p,e;case te:return e=hn(13,o,n,f),e.elementType=te,e.lanes=p,e;case z:return e=hn(19,o,n,f),e.elementType=z,e.lanes=p,e;case K:return yl(o,f,p,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:w=10;break e;case W:w=9;break e;case G:w=11;break e;case Q:w=14;break e;case T:w=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=hn(w,o,n,f),n.elementType=e,n.type=l,n.lanes=p,n}function hi(e,n,o,l){return e=hn(7,e,l,n),e.lanes=o,e}function yl(e,n,o,l){return e=hn(22,e,l,n),e.elementType=K,e.lanes=o,e.stateNode={isHidden:!1},e}function Ic(e,n,o){return e=hn(6,e,null,n),e.lanes=o,e}function Tc(e,n,o){return n=hn(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Zy(e,n,o,l,f){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ei(0),this.expirationTimes=ei(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ei(0),this.identifierPrefix=l,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function Rc(e,n,o,l,f,p,w,I,D){return e=new Zy(e,n,o,I,D),n===1?(n=1,p===!0&&(n|=8)):n=0,p=hn(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ya(p),e}function Jy(e,n,o){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:l==null?null:""+l,children:e,containerInfo:n,implementation:o}}function Kf(e){if(!e)return Ir;e=e._reactInternals;e:{if(Et(e)!==e||e.tag!==1)throw Error(i(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Dt(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(e.tag===1){var o=e.type;if(Dt(o))return kd(e,o,n)}return n}function Qf(e,n,o,l,f,p,w,I,D){return e=Rc(o,l,!0,e,f,p,w,I,D),e.context=Kf(null),o=e.current,l=Rt(),f=$r(o),p=sr(l,f),p.callback=n??null,zr(o,p,f),e.current.lanes=f,Tn(e,f,l),Ft(e,l),e}function vl(e,n,o,l){var f=n.current,p=Rt(),w=$r(f);return o=Kf(o),n.context===null?n.context=o:n.pendingContext=o,n=sr(p,w),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=zr(f,n,w),e!==null&&(Sn(e,f,w,p),Ks(e,f,w)),w}function xl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function qf(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function zc(e,n){qf(e,n),(e=e.alternate)&&qf(e,n)}function e0(){return null}var Zf=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ac(e){this._internalRoot=e}wl.prototype.render=Ac.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));vl(e,n,null,null)},wl.prototype.unmount=Ac.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;ui(function(){vl(null,e,null,null)}),n[tr]=null}};function wl(e){this._internalRoot=e}wl.prototype.unstable_scheduleHydration=function(e){if(e){var n=er();e={blockedOn:null,target:e,priority:n};for(var o=0;o<Y.length&&n!==0&&n<Y[o].priority;o++);Y.splice(o,0,e),o===0&&Ce(e)}};function Lc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Sl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Jf(){}function t0(e,n,o,l,f){if(f){if(typeof l=="function"){var p=l;l=function(){var ee=xl(w);p.call(ee)}}var w=Qf(n,l,e,0,null,!1,!1,"",Jf);return e._reactRootContainer=w,e[tr]=w.current,zo(e.nodeType===8?e.parentNode:e),ui(),w}for(;f=e.lastChild;)e.removeChild(f);if(typeof l=="function"){var I=l;l=function(){var ee=xl(D);I.call(ee)}}var D=Rc(e,0,!1,null,null,!1,!1,"",Jf);return e._reactRootContainer=D,e[tr]=D.current,zo(e.nodeType===8?e.parentNode:e),ui(function(){vl(n,D,o,l)}),D}function kl(e,n,o,l,f){var p=o._reactRootContainer;if(p){var w=p;if(typeof f=="function"){var I=f;f=function(){var D=xl(w);I.call(D)}}vl(n,w,e,f)}else w=t0(o,n,e,f,l);return xl(w)}Es=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=on(n.pendingLanes);o!==0&&(Ai(n,o|1),Ft(n,Xe()),(Fe&6)===0&&(ro=Xe()+500,Tr()))}break;case 13:ui(function(){var l=or(e,1);if(l!==null){var f=Rt();Sn(l,e,1,f)}}),zc(e,1)}},No=function(e){if(e.tag===13){var n=or(e,134217728);if(n!==null){var o=Rt();Sn(n,e,134217728,o)}zc(e,134217728)}},Cs=function(e){if(e.tag===13){var n=$r(e),o=or(e,n);if(o!==null){var l=Rt();Sn(o,e,n,l)}zc(e,n)}},er=function(){return $e},_s=function(e,n){var o=$e;try{return $e=e,n()}finally{$e=o}},At=function(e,n,o){switch(n){case"input":if(et(e,o),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<o.length;n++){var l=o[n];if(l!==e&&l.form===e.form){var f=Os(l);if(!f)throw Error(i(90));be(l),et(l,f)}}}break;case"textarea":hr(e,o);break;case"select":n=o.value,n!=null&&wt(e,!!o.multiple,n,!1)}},Mi=jc,gr=ui;var n0={usingClientEntryPoint:!1,Events:[Do,Wi,Os,mr,bi,jc]},qo={findFiberByHostInstance:ni,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},r0={bundleType:qo.bundleType,version:qo.version,rendererPackageName:qo.rendererPackageName,rendererConfig:qo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:M.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=qr(e),e===null?null:e.stateNode},findFiberByHostInstance:qo.findFiberByHostInstance||e0,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 Nl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nl.isDisabled&&Nl.supportsFiber)try{In=Nl.inject(r0),dt=Nl}catch{}}return Ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=n0,Ht.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lc(n))throw Error(i(200));return Jy(e,n,null,o)},Ht.createRoot=function(e,n){if(!Lc(e))throw Error(i(299));var o=!1,l="",f=Zf;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(f=n.onRecoverableError)),n=Rc(e,1,!1,null,null,o,!1,l,f),e[tr]=n.current,zo(e.nodeType===8?e.parentNode:e),new Ac(n)},Ht.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=qr(n),e=e===null?null:e.stateNode,e},Ht.flushSync=function(e){return ui(e)},Ht.hydrate=function(e,n,o){if(!Sl(n))throw Error(i(200));return kl(null,e,n,!0,o)},Ht.hydrateRoot=function(e,n,o){if(!Lc(e))throw Error(i(405));var l=o!=null&&o.hydratedSources||null,f=!1,p="",w=Zf;if(o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onRecoverableError!==void 0&&(w=o.onRecoverableError)),n=Qf(n,null,e,1,o??null,f,!1,p,w),e[tr]=n.current,zo(e),l)for(e=0;e<l.length;e++)o=l[e],f=o._getVersion,f=f(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,f]:n.mutableSourceEagerHydrationData.push(o,f);return new wl(n)},Ht.render=function(e,n,o){if(!Sl(n))throw Error(i(200));return kl(null,e,n,!1,o)},Ht.unmountComponentAtNode=function(e){if(!Sl(e))throw Error(i(40));return e._reactRootContainer?(ui(function(){kl(null,null,e,!1,function(){e._reactRootContainer=null,e[tr]=null})}),!0):!1},Ht.unstable_batchedUpdates=jc,Ht.unstable_renderSubtreeIntoContainer=function(e,n,o,l){if(!Sl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return kl(e,n,o,!1,l)},Ht.version="18.3.1-next-f1338f8080-20240426",Ht}var lh;function bp(){if(lh)return Oc.exports;lh=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Oc.exports=u0(),Oc.exports}var ah;function d0(){if(ah)return El;ah=1;var t=bp();return El.createRoot=t.createRoot,El.hydrateRoot=t.hydrateRoot,El}var f0=d0();const h0=vu(f0);function ct(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,s;i<t.length;i++)(s=ct(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var p0={value:()=>{}};function ql(){for(var t=0,r=arguments.length,i={},s;t<r;++t){if(!(s=arguments[t]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new zl(i)}function zl(t){this._=t}function m0(t,r){return t.trim().split(/^|\s+/).map(function(i){var s="",a=i.indexOf(".");if(a>=0&&(s=i.slice(a+1),i=i.slice(0,a)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}zl.prototype=ql.prototype={constructor:zl,on:function(t,r){var i=this._,s=m0(t+"",i),a,c=-1,u=s.length;if(arguments.length<2){for(;++c<u;)if((a=(t=s[c]).type)&&(a=g0(i[a],t.name)))return a;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++c<u;)if(a=(t=s[c]).type)i[a]=ch(i[a],t.name,r);else if(r==null)for(a in i)i[a]=ch(i[a],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new zl(t)},call:function(t,r){if((a=arguments.length-2)>0)for(var i=new Array(a),s=0,a,c;s<a;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(c=this._[t],s=0,a=c.length;s<a;++s)c[s].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],a=0,c=s.length;a<c;++a)s[a].value.apply(r,i)}};function g0(t,r){for(var i=0,s=t.length,a;i<s;++i)if((a=t[i]).name===r)return a.value}function ch(t,r,i){for(var s=0,a=t.length;s<a;++s)if(t[s].name===r){t[s]=p0,t=t.slice(0,s).concat(t.slice(s+1));break}return i!=null&&t.push({name:r,value:i}),t}var ru="http://www.w3.org/1999/xhtml";const uh={svg:"http://www.w3.org/2000/svg",xhtml:ru,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zl(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),uh.hasOwnProperty(r)?{space:uh[r],local:t}:t}function y0(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===ru&&r.documentElement.namespaceURI===ru?r.createElement(t):r.createElementNS(i,t)}}function v0(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Mp(t){var r=Zl(t);return(r.local?v0:y0)(r)}function x0(){}function xu(t){return t==null?x0:function(){return this.querySelector(t)}}function w0(t){typeof t!="function"&&(t=xu(t));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],u=c.length,h=s[a]=new Array(u),m,g,v=0;v<u;++v)(m=c[v])&&(g=t.call(m,m.__data__,v,c))&&("__data__"in m&&(g.__data__=m.__data__),h[v]=g);return new Jt(s,this._parents)}function S0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function k0(){return[]}function Pp(t){return t==null?k0:function(){return this.querySelectorAll(t)}}function N0(t){return function(){return S0(t.apply(this,arguments))}}function E0(t){typeof t=="function"?t=N0(t):t=Pp(t);for(var r=this._groups,i=r.length,s=[],a=[],c=0;c<i;++c)for(var u=r[c],h=u.length,m,g=0;g<h;++g)(m=u[g])&&(s.push(t.call(m,m.__data__,g,u)),a.push(m));return new Jt(s,a)}function Ip(t){return function(){return this.matches(t)}}function Tp(t){return function(r){return r.matches(t)}}var C0=Array.prototype.find;function _0(t){return function(){return C0.call(this.children,t)}}function j0(){return this.firstElementChild}function b0(t){return this.select(t==null?j0:_0(typeof t=="function"?t:Tp(t)))}var M0=Array.prototype.filter;function P0(){return Array.from(this.children)}function I0(t){return function(){return M0.call(this.children,t)}}function T0(t){return this.selectAll(t==null?P0:I0(typeof t=="function"?t:Tp(t)))}function R0(t){typeof t!="function"&&(t=Ip(t));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],u=c.length,h=s[a]=[],m,g=0;g<u;++g)(m=c[g])&&t.call(m,m.__data__,g,c)&&h.push(m);return new Jt(s,this._parents)}function Rp(t){return new Array(t.length)}function z0(){return new Jt(this._enter||this._groups.map(Rp),this._parents)}function Ol(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}Ol.prototype={constructor:Ol,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,r){return this._parent.insertBefore(t,r)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function A0(t){return function(){return t}}function L0(t,r,i,s,a,c){for(var u=0,h,m=r.length,g=c.length;u<g;++u)(h=r[u])?(h.__data__=c[u],s[u]=h):i[u]=new Ol(t,c[u]);for(;u<m;++u)(h=r[u])&&(a[u]=h)}function D0(t,r,i,s,a,c,u){var h,m,g=new Map,v=r.length,y=c.length,x=new Array(v),C;for(h=0;h<v;++h)(m=r[h])&&(x[h]=C=u.call(m,m.__data__,h,r)+"",g.has(C)?a[h]=m:g.set(C,m));for(h=0;h<y;++h)C=u.call(t,c[h],h,c)+"",(m=g.get(C))?(s[h]=m,m.__data__=c[h],g.delete(C)):i[h]=new Ol(t,c[h]);for(h=0;h<v;++h)(m=r[h])&&g.get(x[h])===m&&(a[h]=m)}function $0(t){return t.__data__}function O0(t,r){if(!arguments.length)return Array.from(this,$0);var i=r?D0:L0,s=this._parents,a=this._groups;typeof t!="function"&&(t=A0(t));for(var c=a.length,u=new Array(c),h=new Array(c),m=new Array(c),g=0;g<c;++g){var v=s[g],y=a[g],x=y.length,C=F0(t.call(v,v&&v.__data__,g,s)),E=C.length,k=h[g]=new Array(E),_=u[g]=new Array(E),N=m[g]=new Array(x);i(v,y,k,_,N,C,r);for(var j=0,S=0,M,$;j<E;++j)if(M=k[j]){for(j>=S&&(S=j+1);!($=_[S])&&++S<E;);M._next=$||null}}return u=new Jt(u,s),u._enter=h,u._exit=m,u}function F0(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function H0(){return new Jt(this._exit||this._groups.map(Rp),this._parents)}function B0(t,r,i){var s=this.enter(),a=this,c=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),r!=null&&(a=r(a),a&&(a=a.selection())),i==null?c.remove():i(c),s&&a?s.merge(a).order():a}function V0(t){for(var r=t.selection?t.selection():t,i=this._groups,s=r._groups,a=i.length,c=s.length,u=Math.min(a,c),h=new Array(a),m=0;m<u;++m)for(var g=i[m],v=s[m],y=g.length,x=h[m]=new Array(y),C,E=0;E<y;++E)(C=g[E]||v[E])&&(x[E]=C);for(;m<a;++m)h[m]=i[m];return new Jt(h,this._parents)}function W0(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var s=t[r],a=s.length-1,c=s[a],u;--a>=0;)(u=s[a])&&(c&&u.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(u,c),c=u);return this}function U0(t){t||(t=Y0);function r(y,x){return y&&x?t(y.__data__,x.__data__):!y-!x}for(var i=this._groups,s=i.length,a=new Array(s),c=0;c<s;++c){for(var u=i[c],h=u.length,m=a[c]=new Array(h),g,v=0;v<h;++v)(g=u[v])&&(m[v]=g);m.sort(r)}return new Jt(a,this._parents).order()}function Y0(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function X0(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function G0(){return Array.from(this)}function K0(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],a=0,c=s.length;a<c;++a){var u=s[a];if(u)return u}return null}function Q0(){let t=0;for(const r of this)++t;return t}function q0(){return!this.node()}function Z0(t){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var a=r[i],c=0,u=a.length,h;c<u;++c)(h=a[c])&&t.call(h,h.__data__,c,a);return this}function J0(t){return function(){this.removeAttribute(t)}}function ev(t){return function(){this.removeAttributeNS(t.space,t.local)}}function tv(t,r){return function(){this.setAttribute(t,r)}}function nv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function rv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function iv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function ov(t,r){var i=Zl(t);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((r==null?i.local?ev:J0:typeof r=="function"?i.local?iv:rv:i.local?nv:tv)(i,r))}function zp(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function sv(t){return function(){this.style.removeProperty(t)}}function lv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function av(t,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,i)}}function cv(t,r,i){return arguments.length>1?this.each((r==null?sv:typeof r=="function"?av:lv)(t,r,i??"")):po(this.node(),t)}function po(t,r){return t.style.getPropertyValue(r)||zp(t).getComputedStyle(t,null).getPropertyValue(r)}function uv(t){return function(){delete this[t]}}function dv(t,r){return function(){this[t]=r}}function fv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function hv(t,r){return arguments.length>1?this.each((r==null?uv:typeof r=="function"?fv:dv)(t,r)):this.node()[t]}function Ap(t){return t.trim().split(/^|\s+/)}function wu(t){return t.classList||new Lp(t)}function Lp(t){this._node=t,this._names=Ap(t.getAttribute("class")||"")}Lp.prototype={add:function(t){var r=this._names.indexOf(t);r<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var r=this._names.indexOf(t);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function Dp(t,r){for(var i=wu(t),s=-1,a=r.length;++s<a;)i.add(r[s])}function $p(t,r){for(var i=wu(t),s=-1,a=r.length;++s<a;)i.remove(r[s])}function pv(t){return function(){Dp(this,t)}}function mv(t){return function(){$p(this,t)}}function gv(t,r){return function(){(r.apply(this,arguments)?Dp:$p)(this,t)}}function yv(t,r){var i=Ap(t+"");if(arguments.length<2){for(var s=wu(this.node()),a=-1,c=i.length;++a<c;)if(!s.contains(i[a]))return!1;return!0}return this.each((typeof r=="function"?gv:r?pv:mv)(i,r))}function vv(){this.textContent=""}function xv(t){return function(){this.textContent=t}}function wv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function Sv(t){return arguments.length?this.each(t==null?vv:(typeof t=="function"?wv:xv)(t)):this.node().textContent}function kv(){this.innerHTML=""}function Nv(t){return function(){this.innerHTML=t}}function Ev(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function Cv(t){return arguments.length?this.each(t==null?kv:(typeof t=="function"?Ev:Nv)(t)):this.node().innerHTML}function _v(){this.nextSibling&&this.parentNode.appendChild(this)}function jv(){return this.each(_v)}function bv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Mv(){return this.each(bv)}function Pv(t){var r=typeof t=="function"?t:Mp(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Iv(){return null}function Tv(t,r){var i=typeof t=="function"?t:Mp(t),s=r==null?Iv:typeof r=="function"?r:xu(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function Rv(){var t=this.parentNode;t&&t.removeChild(this)}function zv(){return this.each(Rv)}function Av(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Lv(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Dv(t){return this.select(t?Lv:Av)}function $v(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Ov(t){return function(r){t.call(this,r,this.__data__)}}function Fv(t){return t.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");return s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),{type:r,name:i}})}function Hv(t){return function(){var r=this.__on;if(r){for(var i=0,s=-1,a=r.length,c;i<a;++i)c=r[i],(!t.type||c.type===t.type)&&c.name===t.name?this.removeEventListener(c.type,c.listener,c.options):r[++s]=c;++s?r.length=s:delete this.__on}}}function Bv(t,r,i){return function(){var s=this.__on,a,c=Ov(r);if(s){for(var u=0,h=s.length;u<h;++u)if((a=s[u]).type===t.type&&a.name===t.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=c,a.options=i),a.value=r;return}}this.addEventListener(t.type,c,i),a={type:t.type,name:t.name,value:r,listener:c,options:i},s?s.push(a):this.__on=[a]}}function Vv(t,r,i){var s=Fv(t+""),a,c=s.length,u;if(arguments.length<2){var h=this.node().__on;if(h){for(var m=0,g=h.length,v;m<g;++m)for(a=0,v=h[m];a<c;++a)if((u=s[a]).type===v.type&&u.name===v.name)return v.value}return}for(h=r?Bv:Hv,a=0;a<c;++a)this.each(h(s[a],r,i));return this}function Op(t,r,i){var s=zp(t),a=s.CustomEvent;typeof a=="function"?a=new a(r,i):(a=s.document.createEvent("Event"),i?(a.initEvent(r,i.bubbles,i.cancelable),a.detail=i.detail):a.initEvent(r,!1,!1)),t.dispatchEvent(a)}function Wv(t,r){return function(){return Op(this,t,r)}}function Uv(t,r){return function(){return Op(this,t,r.apply(this,arguments))}}function Yv(t,r){return this.each((typeof r=="function"?Uv:Wv)(t,r))}function*Xv(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],a=0,c=s.length,u;a<c;++a)(u=s[a])&&(yield u)}var Fp=[null];function Jt(t,r){this._groups=t,this._parents=r}function gs(){return new Jt([[document.documentElement]],Fp)}function Gv(){return this}Jt.prototype=gs.prototype={constructor:Jt,select:w0,selectAll:E0,selectChild:b0,selectChildren:T0,filter:R0,data:O0,enter:z0,exit:H0,join:B0,merge:V0,selection:Gv,order:W0,sort:U0,call:X0,nodes:G0,node:K0,size:Q0,empty:q0,each:Z0,attr:ov,style:cv,property:hv,classed:yv,text:Sv,html:Cv,raise:jv,lower:Mv,append:Pv,insert:Tv,remove:zv,clone:Dv,datum:$v,on:Vv,dispatch:Yv,[Symbol.iterator]:Xv};function Zt(t){return typeof t=="string"?new Jt([[document.querySelector(t)]],[document.documentElement]):new Jt([[t]],Fp)}function Kv(t){let r;for(;r=t.sourceEvent;)t=r;return t}function kn(t,r){if(t=Kv(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(r.getScreenCTM().inverse()),[s.x,s.y]}if(r.getBoundingClientRect){var a=r.getBoundingClientRect();return[t.clientX-a.left-r.clientLeft,t.clientY-a.top-r.clientTop]}}return[t.pageX,t.pageY]}const Qv={passive:!1},os={capture:!0,passive:!1};function Bc(t){t.stopImmediatePropagation()}function fo(t){t.preventDefault(),t.stopImmediatePropagation()}function Hp(t){var r=t.document.documentElement,i=Zt(t).on("dragstart.drag",fo,os);"onselectstart"in r?i.on("selectstart.drag",fo,os):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Bp(t,r){var i=t.document.documentElement,s=Zt(t).on("dragstart.drag",null);r&&(s.on("click.drag",fo,os),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Cl=t=>()=>t;function iu(t,{sourceEvent:r,subject:i,target:s,identifier:a,active:c,x:u,y:h,dx:m,dy:g,dispatch:v}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:v}})}iu.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function qv(t){return!t.ctrlKey&&!t.button}function Zv(){return this.parentNode}function Jv(t,r){return r??{x:t.x,y:t.y}}function ex(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vp(){var t=qv,r=Zv,i=Jv,s=ex,a={},c=ql("start","drag","end"),u=0,h,m,g,v,y=0;function x(M){M.on("mousedown.drag",C).filter(s).on("touchstart.drag",_).on("touchmove.drag",N,Qv).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(M,$){if(!(v||!t.call(this,M,$))){var L=S(this,r.call(this,M,$),M,$,"mouse");L&&(Zt(M.view).on("mousemove.drag",E,os).on("mouseup.drag",k,os),Hp(M.view),Bc(M),g=!1,h=M.clientX,m=M.clientY,L("start",M))}}function E(M){if(fo(M),!g){var $=M.clientX-h,L=M.clientY-m;g=$*$+L*L>y}a.mouse("drag",M)}function k(M){Zt(M.view).on("mousemove.drag mouseup.drag",null),Bp(M.view,g),fo(M),a.mouse("end",M)}function _(M,$){if(t.call(this,M,$)){var L=M.changedTouches,H=r.call(this,M,$),Z=L.length,B,J;for(B=0;B<Z;++B)(J=S(this,H,M,$,L[B].identifier,L[B]))&&(Bc(M),J("start",M,L[B]))}}function N(M){var $=M.changedTouches,L=$.length,H,Z;for(H=0;H<L;++H)(Z=a[$[H].identifier])&&(fo(M),Z("drag",M,$[H]))}function j(M){var $=M.changedTouches,L=$.length,H,Z;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),H=0;H<L;++H)(Z=a[$[H].identifier])&&(Bc(M),Z("end",M,$[H]))}function S(M,$,L,H,Z,B){var J=c.copy(),W=kn(B||L,$),G,te,z;if((z=i.call(M,new iu("beforestart",{sourceEvent:L,target:x,identifier:Z,active:u,x:W[0],y:W[1],dx:0,dy:0,dispatch:J}),H))!=null)return G=z.x-W[0]||0,te=z.y-W[1]||0,function Q(T,K,R){var A=W,U;switch(T){case"start":a[Z]=Q,U=u++;break;case"end":delete a[Z],--u;case"drag":W=kn(R||K,$),U=u;break}J.call(T,M,new iu(T,{sourceEvent:K,subject:z,target:x,identifier:Z,active:U,x:W[0]+G,y:W[1]+te,dx:W[0]-A[0],dy:W[1]-A[1],dispatch:J}),H)}}return x.filter=function(M){return arguments.length?(t=typeof M=="function"?M:Cl(!!M),x):t},x.container=function(M){return arguments.length?(r=typeof M=="function"?M:Cl(M),x):r},x.subject=function(M){return arguments.length?(i=typeof M=="function"?M:Cl(M),x):i},x.touchable=function(M){return arguments.length?(s=typeof M=="function"?M:Cl(!!M),x):s},x.on=function(){var M=c.on.apply(c,arguments);return M===c?x:M},x.clickDistance=function(M){return arguments.length?(y=(M=+M)*M,x):Math.sqrt(y)},x}function Su(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Wp(t,r){var i=Object.create(t.prototype);for(var s in r)i[s]=r[s];return i}function ys(){}var ss=.7,Fl=1/ss,ho="\\s*([+-]?\\d+)\\s*",ls="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tx=/^#([0-9a-f]{3,8})$/,nx=new RegExp(`^rgb\\(${ho},${ho},${ho}\\)$`),rx=new RegExp(`^rgb\\(${Fn},${Fn},${Fn}\\)$`),ix=new RegExp(`^rgba\\(${ho},${ho},${ho},${ls}\\)$`),ox=new RegExp(`^rgba\\(${Fn},${Fn},${Fn},${ls}\\)$`),sx=new RegExp(`^hsl\\(${ls},${Fn},${Fn}\\)$`),lx=new RegExp(`^hsla\\(${ls},${Fn},${Fn},${ls}\\)$`),dh={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};Su(ys,xi,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:fh,formatHex:fh,formatHex8:ax,formatHsl:cx,formatRgb:hh,toString:hh});function fh(){return this.rgb().formatHex()}function ax(){return this.rgb().formatHex8()}function cx(){return Up(this).formatHsl()}function hh(){return this.rgb().formatRgb()}function xi(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=tx.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?ph(r):i===3?new Bt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?_l(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?_l(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=nx.exec(t))?new Bt(r[1],r[2],r[3],1):(r=rx.exec(t))?new Bt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=ix.exec(t))?_l(r[1],r[2],r[3],r[4]):(r=ox.exec(t))?_l(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=sx.exec(t))?yh(r[1],r[2]/100,r[3]/100,1):(r=lx.exec(t))?yh(r[1],r[2]/100,r[3]/100,r[4]):dh.hasOwnProperty(t)?ph(dh[t]):t==="transparent"?new Bt(NaN,NaN,NaN,0):null}function ph(t){return new Bt(t>>16&255,t>>8&255,t&255,1)}function _l(t,r,i,s){return s<=0&&(t=r=i=NaN),new Bt(t,r,i,s)}function ux(t){return t instanceof ys||(t=xi(t)),t?(t=t.rgb(),new Bt(t.r,t.g,t.b,t.opacity)):new Bt}function ou(t,r,i,s){return arguments.length===1?ux(t):new Bt(t,r,i,s??1)}function Bt(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}Su(Bt,ou,Wp(ys,{brighter(t){return t=t==null?Fl:Math.pow(Fl,t),new Bt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?ss:Math.pow(ss,t),new Bt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Bt(gi(this.r),gi(this.g),gi(this.b),Hl(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:mh,formatHex:mh,formatHex8:dx,formatRgb:gh,toString:gh}));function mh(){return`#${mi(this.r)}${mi(this.g)}${mi(this.b)}`}function dx(){return`#${mi(this.r)}${mi(this.g)}${mi(this.b)}${mi((isNaN(this.opacity)?1:this.opacity)*255)}`}function gh(){const t=Hl(this.opacity);return`${t===1?"rgb(":"rgba("}${gi(this.r)}, ${gi(this.g)}, ${gi(this.b)}${t===1?")":`, ${t})`}`}function Hl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function gi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mi(t){return t=gi(t),(t<16?"0":"")+t.toString(16)}function yh(t,r,i,s){return s<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new Nn(t,r,i,s)}function Up(t){if(t instanceof Nn)return new Nn(t.h,t.s,t.l,t.opacity);if(t instanceof ys||(t=xi(t)),!t)return new Nn;if(t instanceof Nn)return t;t=t.rgb();var r=t.r/255,i=t.g/255,s=t.b/255,a=Math.min(r,i,s),c=Math.max(r,i,s),u=NaN,h=c-a,m=(c+a)/2;return h?(r===c?u=(i-s)/h+(i<s)*6:i===c?u=(s-r)/h+2:u=(r-i)/h+4,h/=m<.5?c+a:2-c-a,u*=60):h=m>0&&m<1?0:u,new Nn(u,h,m,t.opacity)}function fx(t,r,i,s){return arguments.length===1?Up(t):new Nn(t,r,i,s??1)}function Nn(t,r,i,s){this.h=+t,this.s=+r,this.l=+i,this.opacity=+s}Su(Nn,fx,Wp(ys,{brighter(t){return t=t==null?Fl:Math.pow(Fl,t),new Nn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?ss:Math.pow(ss,t),new Nn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*r,a=2*i-s;return new Bt(Vc(t>=240?t-240:t+120,a,s),Vc(t,a,s),Vc(t<120?t+240:t-120,a,s),this.opacity)},clamp(){return new Nn(vh(this.h),jl(this.s),jl(this.l),Hl(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 t=Hl(this.opacity);return`${t===1?"hsl(":"hsla("}${vh(this.h)}, ${jl(this.s)*100}%, ${jl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function vh(t){return t=(t||0)%360,t<0?t+360:t}function jl(t){return Math.max(0,Math.min(1,t||0))}function Vc(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}const ku=t=>()=>t;function hx(t,r){return function(i){return t+i*r}}function px(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(s){return Math.pow(t+s*r,i)}}function mx(t){return(t=+t)==1?Yp:function(r,i){return i-r?px(r,i,t):ku(isNaN(r)?i:r)}}function Yp(t,r){var i=r-t;return i?hx(t,i):ku(isNaN(t)?r:t)}const Bl=(function t(r){var i=mx(r);function s(a,c){var u=i((a=ou(a)).r,(c=ou(c)).r),h=i(a.g,c.g),m=i(a.b,c.b),g=Yp(a.opacity,c.opacity);return function(v){return a.r=u(v),a.g=h(v),a.b=m(v),a.opacity=g(v),a+""}}return s.gamma=t,s})(1);function gx(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,s=r.slice(),a;return function(c){for(a=0;a<i;++a)s[a]=t[a]*(1-c)+r[a]*c;return s}}function yx(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function vx(t,r){var i=r?r.length:0,s=t?Math.min(i,t.length):0,a=new Array(s),c=new Array(i),u;for(u=0;u<s;++u)a[u]=rs(t[u],r[u]);for(;u<i;++u)c[u]=r[u];return function(h){for(u=0;u<s;++u)c[u]=a[u](h);return c}}function xx(t,r){var i=new Date;return t=+t,r=+r,function(s){return i.setTime(t*(1-s)+r*s),i}}function On(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function wx(t,r){var i={},s={},a;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(a in r)a in t?i[a]=rs(t[a],r[a]):s[a]=r[a];return function(c){for(a in i)s[a]=i[a](c);return s}}var su=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wc=new RegExp(su.source,"g");function Sx(t){return function(){return t}}function kx(t){return function(r){return t(r)+""}}function Xp(t,r){var i=su.lastIndex=Wc.lastIndex=0,s,a,c,u=-1,h=[],m=[];for(t=t+"",r=r+"";(s=su.exec(t))&&(a=Wc.exec(r));)(c=a.index)>i&&(c=r.slice(i,c),h[u]?h[u]+=c:h[++u]=c),(s=s[0])===(a=a[0])?h[u]?h[u]+=a:h[++u]=a:(h[++u]=null,m.push({i:u,x:On(s,a)})),i=Wc.lastIndex;return i<r.length&&(c=r.slice(i),h[u]?h[u]+=c:h[++u]=c),h.length<2?m[0]?kx(m[0].x):Sx(r):(r=m.length,function(g){for(var v=0,y;v<r;++v)h[(y=m[v]).i]=y.x(g);return h.join("")})}function rs(t,r){var i=typeof r,s;return r==null||i==="boolean"?ku(r):(i==="number"?On:i==="string"?(s=xi(r))?(r=s,Bl):Xp:r instanceof xi?Bl:r instanceof Date?xx:yx(r)?gx:Array.isArray(r)?vx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?wx:On)(t,r)}var xh=180/Math.PI,lu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Gp(t,r,i,s,a,c){var u,h,m;return(u=Math.sqrt(t*t+r*r))&&(t/=u,r/=u),(m=t*i+r*s)&&(i-=t*m,s-=r*m),(h=Math.sqrt(i*i+s*s))&&(i/=h,s/=h,m/=h),t*s<r*i&&(t=-t,r=-r,m=-m,u=-u),{translateX:a,translateY:c,rotate:Math.atan2(r,t)*xh,skewX:Math.atan(m)*xh,scaleX:u,scaleY:h}}var bl;function Nx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?lu:Gp(r.a,r.b,r.c,r.d,r.e,r.f)}function Ex(t){return t==null||(bl||(bl=document.createElementNS("http://www.w3.org/2000/svg","g")),bl.setAttribute("transform",t),!(t=bl.transform.baseVal.consolidate()))?lu:(t=t.matrix,Gp(t.a,t.b,t.c,t.d,t.e,t.f))}function Kp(t,r,i,s){function a(g){return g.length?g.pop()+" ":""}function c(g,v,y,x,C,E){if(g!==y||v!==x){var k=C.push("translate(",null,r,null,i);E.push({i:k-4,x:On(g,y)},{i:k-2,x:On(v,x)})}else(y||x)&&C.push("translate("+y+r+x+i)}function u(g,v,y,x){g!==v?(g-v>180?v+=360:v-g>180&&(g+=360),x.push({i:y.push(a(y)+"rotate(",null,s)-2,x:On(g,v)})):v&&y.push(a(y)+"rotate("+v+s)}function h(g,v,y,x){g!==v?x.push({i:y.push(a(y)+"skewX(",null,s)-2,x:On(g,v)}):v&&y.push(a(y)+"skewX("+v+s)}function m(g,v,y,x,C,E){if(g!==y||v!==x){var k=C.push(a(C)+"scale(",null,",",null,")");E.push({i:k-4,x:On(g,y)},{i:k-2,x:On(v,x)})}else(y!==1||x!==1)&&C.push(a(C)+"scale("+y+","+x+")")}return function(g,v){var y=[],x=[];return g=t(g),v=t(v),c(g.translateX,g.translateY,v.translateX,v.translateY,y,x),u(g.rotate,v.rotate,y,x),h(g.skewX,v.skewX,y,x),m(g.scaleX,g.scaleY,v.scaleX,v.scaleY,y,x),g=v=null,function(C){for(var E=-1,k=x.length,_;++E<k;)y[(_=x[E]).i]=_.x(C);return y.join("")}}}var Cx=Kp(Nx,"px, ","px)","deg)"),_x=Kp(Ex,", ",")",")"),jx=1e-12;function wh(t){return((t=Math.exp(t))+1/t)/2}function bx(t){return((t=Math.exp(t))-1/t)/2}function Mx(t){return((t=Math.exp(2*t))-1)/(t+1)}const Al=(function t(r,i,s){function a(c,u){var h=c[0],m=c[1],g=c[2],v=u[0],y=u[1],x=u[2],C=v-h,E=y-m,k=C*C+E*E,_,N;if(k<jx)N=Math.log(x/g)/r,_=function(H){return[h+H*C,m+H*E,g*Math.exp(r*H*N)]};else{var j=Math.sqrt(k),S=(x*x-g*g+s*k)/(2*g*i*j),M=(x*x-g*g-s*k)/(2*x*i*j),$=Math.log(Math.sqrt(S*S+1)-S),L=Math.log(Math.sqrt(M*M+1)-M);N=(L-$)/r,_=function(H){var Z=H*N,B=wh($),J=g/(i*j)*(B*Mx(r*Z+$)-bx($));return[h+J*C,m+J*E,g*B/wh(r*Z+$)]}}return _.duration=N*1e3*r/Math.SQRT2,_}return a.rho=function(c){var u=Math.max(.001,+c),h=u*u,m=h*h;return t(u,h,m)},a})(Math.SQRT2,2,4);var mo=0,ts=0,Jo=0,Qp=1e3,Vl,ns,Wl=0,wi=0,Jl=0,as=typeof performance=="object"&&performance.now?performance:Date,qp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Nu(){return wi||(qp(Px),wi=as.now()+Jl)}function Px(){wi=0}function Ul(){this._call=this._time=this._next=null}Ul.prototype=Zp.prototype={constructor:Ul,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Nu():+i)+(r==null?0:+r),!this._next&&ns!==this&&(ns?ns._next=this:Vl=this,ns=this),this._call=t,this._time=i,au()},stop:function(){this._call&&(this._call=null,this._time=1/0,au())}};function Zp(t,r,i){var s=new Ul;return s.restart(t,r,i),s}function Ix(){Nu(),++mo;for(var t=Vl,r;t;)(r=wi-t._time)>=0&&t._call.call(void 0,r),t=t._next;--mo}function Sh(){wi=(Wl=as.now())+Jl,mo=ts=0;try{Ix()}finally{mo=0,Rx(),wi=0}}function Tx(){var t=as.now(),r=t-Wl;r>Qp&&(Jl-=r,Wl=t)}function Rx(){for(var t,r=Vl,i,s=1/0;r;)r._call?(s>r._time&&(s=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:Vl=i);ns=t,au(s)}function au(t){if(!mo){ts&&(ts=clearTimeout(ts));var r=t-wi;r>24?(t<1/0&&(ts=setTimeout(Sh,t-as.now()-Jl)),Jo&&(Jo=clearInterval(Jo))):(Jo||(Wl=as.now(),Jo=setInterval(Tx,Qp)),mo=1,qp(Sh))}}function kh(t,r,i){var s=new Ul;return r=r==null?0:+r,s.restart(a=>{s.stop(),t(a+r)},r,i),s}var zx=ql("start","end","cancel","interrupt"),Ax=[],Jp=0,Nh=1,cu=2,Ll=3,Eh=4,uu=5,Dl=6;function ea(t,r,i,s,a,c){var u=t.__transition;if(!u)t.__transition={};else if(i in u)return;Lx(t,i,{name:r,index:s,group:a,on:zx,tween:Ax,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Jp})}function Eu(t,r){var i=_n(t,r);if(i.state>Jp)throw new Error("too late; already scheduled");return i}function Vn(t,r){var i=_n(t,r);if(i.state>Ll)throw new Error("too late; already running");return i}function _n(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function Lx(t,r,i){var s=t.__transition,a;s[r]=i,i.timer=Zp(c,0,i.time);function c(g){i.state=Nh,i.timer.restart(u,i.delay,i.time),i.delay<=g&&u(g-i.delay)}function u(g){var v,y,x,C;if(i.state!==Nh)return m();for(v in s)if(C=s[v],C.name===i.name){if(C.state===Ll)return kh(u);C.state===Eh?(C.state=Dl,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[v]):+v<r&&(C.state=Dl,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[v])}if(kh(function(){i.state===Ll&&(i.state=Eh,i.timer.restart(h,i.delay,i.time),h(g))}),i.state=cu,i.on.call("start",t,t.__data__,i.index,i.group),i.state===cu){for(i.state=Ll,a=new Array(x=i.tween.length),v=0,y=-1;v<x;++v)(C=i.tween[v].value.call(t,t.__data__,i.index,i.group))&&(a[++y]=C);a.length=y+1}}function h(g){for(var v=g<i.duration?i.ease.call(null,g/i.duration):(i.timer.restart(m),i.state=uu,1),y=-1,x=a.length;++y<x;)a[y].call(t,v);i.state===uu&&(i.on.call("end",t,t.__data__,i.index,i.group),m())}function m(){i.state=Dl,i.timer.stop(),delete s[r];for(var g in s)return;delete t.__transition}}function $l(t,r){var i=t.__transition,s,a,c=!0,u;if(i){r=r==null?null:r+"";for(u in i){if((s=i[u]).name!==r){c=!1;continue}a=s.state>cu&&s.state<uu,s.state=Dl,s.timer.stop(),s.on.call(a?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[u]}c&&delete t.__transition}}function Dx(t){return this.each(function(){$l(this,t)})}function $x(t,r){var i,s;return function(){var a=Vn(this,t),c=a.tween;if(c!==i){s=i=c;for(var u=0,h=s.length;u<h;++u)if(s[u].name===r){s=s.slice(),s.splice(u,1);break}}a.tween=s}}function Ox(t,r,i){var s,a;if(typeof i!="function")throw new Error;return function(){var c=Vn(this,t),u=c.tween;if(u!==s){a=(s=u).slice();for(var h={name:r,value:i},m=0,g=a.length;m<g;++m)if(a[m].name===r){a[m]=h;break}m===g&&a.push(h)}c.tween=a}}function Fx(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=_n(this.node(),i).tween,a=0,c=s.length,u;a<c;++a)if((u=s[a]).name===t)return u.value;return null}return this.each((r==null?$x:Ox)(i,t,r))}function Cu(t,r,i){var s=t._id;return t.each(function(){var a=Vn(this,s);(a.value||(a.value={}))[r]=i.apply(this,arguments)}),function(a){return _n(a,s).value[r]}}function em(t,r){var i;return(typeof r=="number"?On:r instanceof xi?Bl:(i=xi(r))?(r=i,Bl):Xp)(t,r)}function Hx(t){return function(){this.removeAttribute(t)}}function Bx(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Vx(t,r,i){var s,a=i+"",c;return function(){var u=this.getAttribute(t);return u===a?null:u===s?c:c=r(s=u,i)}}function Wx(t,r,i){var s,a=i+"",c;return function(){var u=this.getAttributeNS(t.space,t.local);return u===a?null:u===s?c:c=r(s=u,i)}}function Ux(t,r,i){var s,a,c;return function(){var u,h=i(this),m;return h==null?void this.removeAttribute(t):(u=this.getAttribute(t),m=h+"",u===m?null:u===s&&m===a?c:(a=m,c=r(s=u,h)))}}function Yx(t,r,i){var s,a,c;return function(){var u,h=i(this),m;return h==null?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),m=h+"",u===m?null:u===s&&m===a?c:(a=m,c=r(s=u,h)))}}function Xx(t,r){var i=Zl(t),s=i==="transform"?_x:em;return this.attrTween(t,typeof r=="function"?(i.local?Yx:Ux)(i,s,Cu(this,"attr."+t,r)):r==null?(i.local?Bx:Hx)(i):(i.local?Wx:Vx)(i,s,r))}function Gx(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function Kx(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function Qx(t,r){var i,s;function a(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Kx(t,c)),i}return a._value=r,a}function qx(t,r){var i,s;function a(){var c=r.apply(this,arguments);return c!==s&&(i=(s=c)&&Gx(t,c)),i}return a._value=r,a}function Zx(t,r){var i="attr."+t;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 s=Zl(t);return this.tween(i,(s.local?Qx:qx)(s,r))}function Jx(t,r){return function(){Eu(this,t).delay=+r.apply(this,arguments)}}function ew(t,r){return r=+r,function(){Eu(this,t).delay=r}}function tw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Jx:ew)(r,t)):_n(this.node(),r).delay}function nw(t,r){return function(){Vn(this,t).duration=+r.apply(this,arguments)}}function rw(t,r){return r=+r,function(){Vn(this,t).duration=r}}function iw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?nw:rw)(r,t)):_n(this.node(),r).duration}function ow(t,r){if(typeof r!="function")throw new Error;return function(){Vn(this,t).ease=r}}function sw(t){var r=this._id;return arguments.length?this.each(ow(r,t)):_n(this.node(),r).ease}function lw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;Vn(this,t).ease=i}}function aw(t){if(typeof t!="function")throw new Error;return this.each(lw(this._id,t))}function cw(t){typeof t!="function"&&(t=Ip(t));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var c=r[a],u=c.length,h=s[a]=[],m,g=0;g<u;++g)(m=c[g])&&t.call(m,m.__data__,g,c)&&h.push(m);return new dr(s,this._parents,this._name,this._id)}function uw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,s=r.length,a=i.length,c=Math.min(s,a),u=new Array(s),h=0;h<c;++h)for(var m=r[h],g=i[h],v=m.length,y=u[h]=new Array(v),x,C=0;C<v;++C)(x=m[C]||g[C])&&(y[C]=x);for(;h<s;++h)u[h]=r[h];return new dr(u,this._parents,this._name,this._id)}function dw(t){return(t+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function fw(t,r,i){var s,a,c=dw(r)?Eu:Vn;return function(){var u=c(this,t),h=u.on;h!==s&&(a=(s=h).copy()).on(r,i),u.on=a}}function hw(t,r){var i=this._id;return arguments.length<2?_n(this.node(),i).on.on(t):this.each(fw(i,t,r))}function pw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function mw(){return this.on("end.remove",pw(this._id))}function gw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=xu(t));for(var s=this._groups,a=s.length,c=new Array(a),u=0;u<a;++u)for(var h=s[u],m=h.length,g=c[u]=new Array(m),v,y,x=0;x<m;++x)(v=h[x])&&(y=t.call(v,v.__data__,x,h))&&("__data__"in v&&(y.__data__=v.__data__),g[x]=y,ea(g[x],r,i,x,g,_n(v,i)));return new dr(c,this._parents,r,i)}function yw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Pp(t));for(var s=this._groups,a=s.length,c=[],u=[],h=0;h<a;++h)for(var m=s[h],g=m.length,v,y=0;y<g;++y)if(v=m[y]){for(var x=t.call(v,v.__data__,y,m),C,E=_n(v,i),k=0,_=x.length;k<_;++k)(C=x[k])&&ea(C,r,i,k,x,E);c.push(x),u.push(v)}return new dr(c,u,r,i)}var vw=gs.prototype.constructor;function xw(){return new vw(this._groups,this._parents)}function ww(t,r){var i,s,a;return function(){var c=po(this,t),u=(this.style.removeProperty(t),po(this,t));return c===u?null:c===i&&u===s?a:a=r(i=c,s=u)}}function tm(t){return function(){this.style.removeProperty(t)}}function Sw(t,r,i){var s,a=i+"",c;return function(){var u=po(this,t);return u===a?null:u===s?c:c=r(s=u,i)}}function kw(t,r,i){var s,a,c;return function(){var u=po(this,t),h=i(this),m=h+"";return h==null&&(m=h=(this.style.removeProperty(t),po(this,t))),u===m?null:u===s&&m===a?c:(a=m,c=r(s=u,h))}}function Nw(t,r){var i,s,a,c="style."+r,u="end."+c,h;return function(){var m=Vn(this,t),g=m.on,v=m.value[c]==null?h||(h=tm(r)):void 0;(g!==i||a!==v)&&(s=(i=g).copy()).on(u,a=v),m.on=s}}function Ew(t,r,i){var s=(t+="")=="transform"?Cx:em;return r==null?this.styleTween(t,ww(t,s)).on("end.style."+t,tm(t)):typeof r=="function"?this.styleTween(t,kw(t,s,Cu(this,"style."+t,r))).each(Nw(this._id,t)):this.styleTween(t,Sw(t,s,r),i).on("end.style."+t,null)}function Cw(t,r,i){return function(s){this.style.setProperty(t,r.call(this,s),i)}}function _w(t,r,i){var s,a;function c(){var u=r.apply(this,arguments);return u!==a&&(s=(a=u)&&Cw(t,u,i)),s}return c._value=r,c}function jw(t,r,i){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(r==null)return this.tween(s,null);if(typeof r!="function")throw new Error;return this.tween(s,_w(t,r,i??""))}function bw(t){return function(){this.textContent=t}}function Mw(t){return function(){var r=t(this);this.textContent=r??""}}function Pw(t){return this.tween("text",typeof t=="function"?Mw(Cu(this,"text",t)):bw(t==null?"":t+""))}function Iw(t){return function(r){this.textContent=t.call(this,r)}}function Tw(t){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Iw(a)),r}return s._value=t,s}function Rw(t){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Tw(t))}function zw(){for(var t=this._name,r=this._id,i=nm(),s=this._groups,a=s.length,c=0;c<a;++c)for(var u=s[c],h=u.length,m,g=0;g<h;++g)if(m=u[g]){var v=_n(m,r);ea(m,t,i,g,u,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new dr(s,this._parents,t,i)}function Aw(){var t,r,i=this,s=i._id,a=i.size();return new Promise(function(c,u){var h={value:u},m={value:function(){--a===0&&c()}};i.each(function(){var g=Vn(this,s),v=g.on;v!==t&&(r=(t=v).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(m)),g.on=r}),a===0&&c()})}var Lw=0;function dr(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function nm(){return++Lw}var cr=gs.prototype;dr.prototype={constructor:dr,select:gw,selectAll:yw,selectChild:cr.selectChild,selectChildren:cr.selectChildren,filter:cw,merge:uw,selection:xw,transition:zw,call:cr.call,nodes:cr.nodes,node:cr.node,size:cr.size,empty:cr.empty,each:cr.each,on:hw,attr:Xx,attrTween:Zx,style:Ew,styleTween:jw,text:Pw,textTween:Rw,remove:mw,tween:Fx,delay:tw,duration:iw,ease:sw,easeVarying:aw,end:Aw,[Symbol.iterator]:cr[Symbol.iterator]};function Dw(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var $w={time:null,delay:0,duration:250,ease:Dw};function Ow(t,r){for(var i;!(i=t.__transition)||!(i=i[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return i}function Fw(t){var r,i;t instanceof dr?(r=t._id,t=t._name):(r=nm(),(i=$w).time=Nu(),t=t==null?null:t+"");for(var s=this._groups,a=s.length,c=0;c<a;++c)for(var u=s[c],h=u.length,m,g=0;g<h;++g)(m=u[g])&&ea(m,t,r,g,u,i||Ow(m,r));return new dr(s,this._parents,t,r)}gs.prototype.interrupt=Dx;gs.prototype.transition=Fw;const Ml=t=>()=>t;function Hw(t,{sourceEvent:r,target:i,transform:s,dispatch:a}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:a}})}function ur(t,r,i){this.k=t,this.x=r,this.y=i}ur.prototype={constructor:ur,scale:function(t){return t===1?this:new ur(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new ur(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ta=new ur(1,0,0);rm.prototype=ur.prototype;function rm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ta;return t.__zoom}function Uc(t){t.stopImmediatePropagation()}function es(t){t.preventDefault(),t.stopImmediatePropagation()}function Bw(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Vw(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function Ch(){return this.__zoom||ta}function Ww(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Uw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Yw(t,r,i){var s=t.invertX(r[0][0])-i[0][0],a=t.invertX(r[1][0])-i[1][0],c=t.invertY(r[0][1])-i[0][1],u=t.invertY(r[1][1])-i[1][1];return t.translate(a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a),u>c?(c+u)/2:Math.min(0,c)||Math.max(0,u))}function im(){var t=Bw,r=Vw,i=Yw,s=Ww,a=Uw,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],h=250,m=Al,g=ql("start","zoom","end"),v,y,x,C=500,E=150,k=0,_=10;function N(z){z.property("__zoom",Ch).on("wheel.zoom",Z,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",J).filter(a).on("touchstart.zoom",W).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(z,Q,T,K){var R=z.selection?z.selection():z;R.property("__zoom",Ch),z!==R?$(z,Q,T,K):R.interrupt().each(function(){L(this,arguments).event(K).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},N.scaleBy=function(z,Q,T,K){N.scaleTo(z,function(){var R=this.__zoom.k,A=typeof Q=="function"?Q.apply(this,arguments):Q;return R*A},T,K)},N.scaleTo=function(z,Q,T,K){N.transform(z,function(){var R=r.apply(this,arguments),A=this.__zoom,U=T==null?M(R):typeof T=="function"?T.apply(this,arguments):T,P=A.invert(U),O=typeof Q=="function"?Q.apply(this,arguments):Q;return i(S(j(A,O),U,P),R,u)},T,K)},N.translateBy=function(z,Q,T,K){N.transform(z,function(){return i(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof T=="function"?T.apply(this,arguments):T),r.apply(this,arguments),u)},null,K)},N.translateTo=function(z,Q,T,K,R){N.transform(z,function(){var A=r.apply(this,arguments),U=this.__zoom,P=K==null?M(A):typeof K=="function"?K.apply(this,arguments):K;return i(ta.translate(P[0],P[1]).scale(U.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof T=="function"?-T.apply(this,arguments):-T),A,u)},K,R)};function j(z,Q){return Q=Math.max(c[0],Math.min(c[1],Q)),Q===z.k?z:new ur(Q,z.x,z.y)}function S(z,Q,T){var K=Q[0]-T[0]*z.k,R=Q[1]-T[1]*z.k;return K===z.x&&R===z.y?z:new ur(z.k,K,R)}function M(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function $(z,Q,T,K){z.on("start.zoom",function(){L(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(K).end()}).tween("zoom",function(){var R=this,A=arguments,U=L(R,A).event(K),P=r.apply(R,A),O=T==null?M(P):typeof T=="function"?T.apply(R,A):T,oe=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),se=R.__zoom,he=typeof Q=="function"?Q.apply(R,A):Q,de=m(se.invert(O).concat(oe/se.k),he.invert(O).concat(oe/he.k));return function(pe){if(pe===1)pe=he;else{var ie=de(pe),me=oe/ie[2];pe=new ur(me,O[0]-ie[0]*me,O[1]-ie[1]*me)}U.zoom(null,pe)}})}function L(z,Q,T){return!T&&z.__zooming||new H(z,Q)}function H(z,Q){this.that=z,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=r.apply(z,Q),this.taps=0}H.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,Q){return this.mouse&&z!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&z!=="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(z){var Q=Zt(this.that).datum();g.call(z,this.that,new Hw(z,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:g}),Q)}};function Z(z,...Q){if(!t.apply(this,arguments))return;var T=L(this,Q).event(z),K=this.__zoom,R=Math.max(c[0],Math.min(c[1],K.k*Math.pow(2,s.apply(this,arguments)))),A=kn(z);if(T.wheel)(T.mouse[0][0]!==A[0]||T.mouse[0][1]!==A[1])&&(T.mouse[1]=K.invert(T.mouse[0]=A)),clearTimeout(T.wheel);else{if(K.k===R)return;T.mouse=[A,K.invert(A)],$l(this),T.start()}es(z),T.wheel=setTimeout(U,E),T.zoom("mouse",i(S(j(K,R),T.mouse[0],T.mouse[1]),T.extent,u));function U(){T.wheel=null,T.end()}}function B(z,...Q){if(x||!t.apply(this,arguments))return;var T=z.currentTarget,K=L(this,Q,!0).event(z),R=Zt(z.view).on("mousemove.zoom",O,!0).on("mouseup.zoom",oe,!0),A=kn(z,T),U=z.clientX,P=z.clientY;Hp(z.view),Uc(z),K.mouse=[A,this.__zoom.invert(A)],$l(this),K.start();function O(se){if(es(se),!K.moved){var he=se.clientX-U,de=se.clientY-P;K.moved=he*he+de*de>k}K.event(se).zoom("mouse",i(S(K.that.__zoom,K.mouse[0]=kn(se,T),K.mouse[1]),K.extent,u))}function oe(se){R.on("mousemove.zoom mouseup.zoom",null),Bp(se.view,K.moved),es(se),K.event(se).end()}}function J(z,...Q){if(t.apply(this,arguments)){var T=this.__zoom,K=kn(z.changedTouches?z.changedTouches[0]:z,this),R=T.invert(K),A=T.k*(z.shiftKey?.5:2),U=i(S(j(T,A),K,R),r.apply(this,Q),u);es(z),h>0?Zt(this).transition().duration(h).call($,U,K,z):Zt(this).call(N.transform,U,K,z)}}function W(z,...Q){if(t.apply(this,arguments)){var T=z.touches,K=T.length,R=L(this,Q,z.changedTouches.length===K).event(z),A,U,P,O;for(Uc(z),U=0;U<K;++U)P=T[U],O=kn(P,this),O=[O,this.__zoom.invert(O),P.identifier],R.touch0?!R.touch1&&R.touch0[2]!==O[2]&&(R.touch1=O,R.taps=0):(R.touch0=O,A=!0,R.taps=1+!!v);v&&(v=clearTimeout(v)),A&&(R.taps<2&&(y=O[0],v=setTimeout(function(){v=null},C)),$l(this),R.start())}}function G(z,...Q){if(this.__zooming){var T=L(this,Q).event(z),K=z.changedTouches,R=K.length,A,U,P,O;for(es(z),A=0;A<R;++A)U=K[A],P=kn(U,this),T.touch0&&T.touch0[2]===U.identifier?T.touch0[0]=P:T.touch1&&T.touch1[2]===U.identifier&&(T.touch1[0]=P);if(U=T.that.__zoom,T.touch1){var oe=T.touch0[0],se=T.touch0[1],he=T.touch1[0],de=T.touch1[1],pe=(pe=he[0]-oe[0])*pe+(pe=he[1]-oe[1])*pe,ie=(ie=de[0]-se[0])*ie+(ie=de[1]-se[1])*ie;U=j(U,Math.sqrt(pe/ie)),P=[(oe[0]+he[0])/2,(oe[1]+he[1])/2],O=[(se[0]+de[0])/2,(se[1]+de[1])/2]}else if(T.touch0)P=T.touch0[0],O=T.touch0[1];else return;T.zoom("touch",i(S(U,P,O),T.extent,u))}}function te(z,...Q){if(this.__zooming){var T=L(this,Q).event(z),K=z.changedTouches,R=K.length,A,U;for(Uc(z),x&&clearTimeout(x),x=setTimeout(function(){x=null},C),A=0;A<R;++A)U=K[A],T.touch0&&T.touch0[2]===U.identifier?delete T.touch0:T.touch1&&T.touch1[2]===U.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(U=kn(U,this),Math.hypot(y[0]-U[0],y[1]-U[1])<_)){var P=Zt(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return N.wheelDelta=function(z){return arguments.length?(s=typeof z=="function"?z:Ml(+z),N):s},N.filter=function(z){return arguments.length?(t=typeof z=="function"?z:Ml(!!z),N):t},N.touchable=function(z){return arguments.length?(a=typeof z=="function"?z:Ml(!!z),N):a},N.extent=function(z){return arguments.length?(r=typeof z=="function"?z:Ml([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),N):r},N.scaleExtent=function(z){return arguments.length?(c[0]=+z[0],c[1]=+z[1],N):[c[0],c[1]]},N.translateExtent=function(z){return arguments.length?(u[0][0]=+z[0][0],u[1][0]=+z[1][0],u[0][1]=+z[0][1],u[1][1]=+z[1][1],N):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},N.constrain=function(z){return arguments.length?(i=z,N):i},N.duration=function(z){return arguments.length?(h=+z,N):h},N.interpolate=function(z){return arguments.length?(m=z,N):m},N.on=function(){var z=g.on.apply(g,arguments);return z===g?N:z},N.clickDistance=function(z){return arguments.length?(k=(z=+z)*z,N):Math.sqrt(k)},N.tapDistance=function(z){return arguments.length?(_=+z,N):_},N}const Bn={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:t=>`Node type "${t}" 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:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:i,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:s}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/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."},cs=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],om=["Enter"," ","Escape"],sm={"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:t,x:r,y:i})=>`Moved selected node ${t}. 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 Si;(function(t){t.Strict="strict",t.Loose="loose"})(Si||(Si={}));var yi;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(yi||(yi={}));var us;(function(t){t.Partial="partial",t.Full="full"})(us||(us={}));const lm={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Wr;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Wr||(Wr={}));var ds;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(ds||(ds={}));var _e;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(_e||(_e={}));const _h={[_e.Left]:_e.Right,[_e.Right]:_e.Left,[_e.Top]:_e.Bottom,[_e.Bottom]:_e.Top};function am(t){return t===null?null:t?"valid":"invalid"}const cm=t=>"id"in t&&"source"in t&&"target"in t,Xw=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),_u=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),vs=(t,r=[0,0])=>{const{width:i,height:s}=fr(t),a=t.origin??r,c=i*a[0],u=s*a[1];return{x:t.position.x-c,y:t.position.y-u}},Gw=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((s,a)=>{const c=typeof a=="string";let u=!r.nodeLookup&&!c?a:void 0;r.nodeLookup&&(u=c?r.nodeLookup.get(a):_u(a)?a:r.nodeLookup.get(a.id));const h=u?Yl(u,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return na(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ra(i)},xs=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(a=>{(r.filter===void 0||r.filter(a))&&(i=na(i,Yl(a)),s=!0)}),s?ra(i):{x:0,y:0,width:0,height:0}},ju=(t,r,[i,s,a]=[0,0,1],c=!1,u=!1)=>{const h={...Ss(r,[i,s,a]),width:r.width/a,height:r.height/a},m=[];for(const g of t.values()){const{measured:v,selectable:y=!0,hidden:x=!1}=g;if(u&&!y||x)continue;const C=v.width??g.width??g.initialWidth??null,E=v.height??g.height??g.initialHeight??null,k=fs(h,yo(g)),_=(C??0)*(E??0),N=c&&k>0;(!g.internals.handleBounds||N||k>=_||g.dragging)&&m.push(g)}return m},Kw=(t,r)=>{const i=new Set;return t.forEach(s=>{i.add(s.id)}),r.filter(s=>i.has(s.source)||i.has(s.target))};function Qw(t,r){const i=new Map,s=r!=null&&r.nodes?new Set(r.nodes.map(a=>a.id)):null;return t.forEach(a=>{a.measured.width&&a.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!a.hidden)&&(!s||s.has(a.id))&&i.set(a.id,a)}),i}async function qw({nodes:t,width:r,height:i,panZoom:s,minZoom:a,maxZoom:c},u){if(t.size===0)return Promise.resolve(!0);const h=Qw(t,u),m=xs(h),g=bu(m,r,i,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??c,(u==null?void 0:u.padding)??.1);return await s.setViewport(g,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),Promise.resolve(!0)}function um({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:a,onError:c}){const u=i.get(t),h=u.parentId?i.get(u.parentId):void 0,{x:m,y:g}=h?h.internals.positionAbsolute:{x:0,y:0},v=u.origin??s;let y=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!h)c==null||c("005",Bn.error005());else{const C=h.measured.width,E=h.measured.height;C&&E&&(y=[[m,g],[m+C,g+E]])}else h&&vo(u.extent)&&(y=[[u.extent[0][0]+m,u.extent[0][1]+g],[u.extent[1][0]+m,u.extent[1][1]+g]]);const x=vo(y)?ki(r,y,u.measured):r;return(u.measured.width===void 0||u.measured.height===void 0)&&(c==null||c("015",Bn.error015())),{position:{x:x.x-m+(u.measured.width??0)*v[0],y:x.y-g+(u.measured.height??0)*v[1]},positionAbsolute:x}}async function Zw({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:s,onBeforeDelete:a}){const c=new Set(t.map(x=>x.id)),u=[];for(const x of i){if(x.deletable===!1)continue;const C=c.has(x.id),E=!C&&x.parentId&&u.find(k=>k.id===x.parentId);(C||E)&&u.push(x)}const h=new Set(r.map(x=>x.id)),m=s.filter(x=>x.deletable!==!1),v=Kw(u,m);for(const x of m)h.has(x.id)&&!v.find(E=>E.id===x.id)&&v.push(x);if(!a)return{edges:v,nodes:u};const y=await a({nodes:u,edges:v});return typeof y=="boolean"?y?{edges:v,nodes:u}:{edges:[],nodes:[]}:y}const go=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),ki=(t={x:0,y:0},r,i)=>({x:go(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:go(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function dm(t,r,i){const{width:s,height:a}=fr(i),{x:c,y:u}=i.internals.positionAbsolute;return ki(t,[[c,u],[c+s,u+a]],r)}const jh=(t,r,i)=>t<r?go(Math.abs(t-r),1,r)/r:t>i?-go(Math.abs(t-i),1,r)/r:0,fm=(t,r,i=15,s=40)=>{const a=jh(t.x,s,r.width-s)*i,c=jh(t.y,s,r.height-s)*i;return[a,c]},na=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),du=({x:t,y:r,width:i,height:s})=>({x:t,y:r,x2:t+i,y2:r+s}),ra=({x:t,y:r,x2:i,y2:s})=>({x:t,y:r,width:i-t,height:s-r}),yo=(t,r=[0,0])=>{var a,c;const{x:i,y:s}=_u(t)?t.internals.positionAbsolute:vs(t,r);return{x:i,y:s,width:((a=t.measured)==null?void 0:a.width)??t.width??t.initialWidth??0,height:((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0}},Yl=(t,r=[0,0])=>{var a,c;const{x:i,y:s}=_u(t)?t.internals.positionAbsolute:vs(t,r);return{x:i,y:s,x2:i+(((a=t.measured)==null?void 0:a.width)??t.width??t.initialWidth??0),y2:s+(((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0)}},hm=(t,r)=>ra(na(du(t),du(r))),fs=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),s=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*s)},bh=t=>En(t.width)&&En(t.height)&&En(t.x)&&En(t.y),En=t=>!isNaN(t)&&isFinite(t),Jw=(t,r)=>{},ws=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),Ss=({x:t,y:r},[i,s,a],c=!1,u=[1,1])=>{const h={x:(t-i)/a,y:(r-s)/a};return c?ws(h,u):h},Xl=({x:t,y:r},[i,s,a])=>({x:t*a+i,y:r*a+s});function oo(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function e1(t,r,i){if(typeof t=="string"||typeof t=="number"){const s=oo(t,i),a=oo(t,r);return{top:s,right:a,bottom:s,left:a,x:a*2,y:s*2}}if(typeof t=="object"){const s=oo(t.top??t.y??0,i),a=oo(t.bottom??t.y??0,i),c=oo(t.left??t.x??0,r),u=oo(t.right??t.x??0,r);return{top:s,right:u,bottom:a,left:c,x:c+u,y:s+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function t1(t,r,i,s,a,c){const{x:u,y:h}=Xl(t,[r,i,s]),{x:m,y:g}=Xl({x:t.x+t.width,y:t.y+t.height},[r,i,s]),v=a-m,y=c-g;return{left:Math.floor(u),top:Math.floor(h),right:Math.floor(v),bottom:Math.floor(y)}}const bu=(t,r,i,s,a,c)=>{const u=e1(c,r,i),h=(r-u.x)/t.width,m=(i-u.y)/t.height,g=Math.min(h,m),v=go(g,s,a),y=t.x+t.width/2,x=t.y+t.height/2,C=r/2-y*v,E=i/2-x*v,k=t1(t,C,E,v,r,i),_={left:Math.min(k.left-u.left,0),top:Math.min(k.top-u.top,0),right:Math.min(k.right-u.right,0),bottom:Math.min(k.bottom-u.bottom,0)};return{x:C-_.left+_.right,y:E-_.top+_.bottom,zoom:v}},hs=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function vo(t){return t!=null&&t!=="parent"}function fr(t){var r,i;return{width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0}}function pm(t){var r,i;return(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth)!==void 0&&(((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight)!==void 0}function mm(t,r={width:0,height:0},i,s,a){const c={...t},u=s.get(i);if(u){const h=u.origin||a;c.x+=u.internals.positionAbsolute.x-(r.width??0)*h[0],c.y+=u.internals.positionAbsolute.y-(r.height??0)*h[1]}return c}function Mh(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function n1(){let t,r;return{promise:new Promise((s,a)=>{t=s,r=a}),resolve:t,reject:r}}function r1(t){return{...sm,...t||{}}}function is(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:a}){const{x:c,y:u}=Cn(t),h=Ss({x:c-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},s),{x:m,y:g}=i?ws(h,r):h;return{xSnapped:m,ySnapped:g,...h}}const Mu=t=>({width:t.offsetWidth,height:t.offsetHeight}),gm=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},i1=["INPUT","SELECT","TEXTAREA"];function ym(t){var s,a;const r=((a=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:a[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:i1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const vm=t=>"clientX"in t,Cn=(t,r)=>{var c,u;const i=vm(t),s=i?t.clientX:(c=t.touches)==null?void 0:c[0].clientX,a=i?t.clientY:(u=t.touches)==null?void 0:u[0].clientY;return{x:s-((r==null?void 0:r.left)??0),y:a-((r==null?void 0:r.top)??0)}},Ph=(t,r,i,s,a)=>{const c=r.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(u=>{const h=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:t,nodeId:a,position:u.getAttribute("data-handlepos"),x:(h.left-i.left)/s,y:(h.top-i.top)/s,...Mu(u)}})};function xm({sourceX:t,sourceY:r,targetX:i,targetY:s,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:h}){const m=t*.125+a*.375+u*.375+i*.125,g=r*.125+c*.375+h*.375+s*.125,v=Math.abs(m-t),y=Math.abs(g-r);return[m,g,v,y]}function Pl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function Ih({pos:t,x1:r,y1:i,x2:s,y2:a,c}){switch(t){case _e.Left:return[r-Pl(r-s,c),i];case _e.Right:return[r+Pl(s-r,c),i];case _e.Top:return[r,i-Pl(i-a,c)];case _e.Bottom:return[r,i+Pl(a-i,c)]}}function wm({sourceX:t,sourceY:r,sourcePosition:i=_e.Bottom,targetX:s,targetY:a,targetPosition:c=_e.Top,curvature:u=.25}){const[h,m]=Ih({pos:i,x1:t,y1:r,x2:s,y2:a,c:u}),[g,v]=Ih({pos:c,x1:s,y1:a,x2:t,y2:r,c:u}),[y,x,C,E]=xm({sourceX:t,sourceY:r,targetX:s,targetY:a,sourceControlX:h,sourceControlY:m,targetControlX:g,targetControlY:v});return[`M${t},${r} C${h},${m} ${g},${v} ${s},${a}`,y,x,C,E]}function Sm({sourceX:t,sourceY:r,targetX:i,targetY:s}){const a=Math.abs(i-t)/2,c=i<t?i+a:i-a,u=Math.abs(s-r)/2,h=s<r?s+u:s-u;return[c,h,a,u]}function o1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:s=0,elevateOnSelect:a=!1,zIndexMode:c="basic"}){if(c==="manual")return s;const u=a&&i?s+1e3:s,h=Math.max(t.parentId||a&&t.selected?t.internals.z:0,r.parentId||a&&r.selected?r.internals.z:0);return u+h}function s1({sourceNode:t,targetNode:r,width:i,height:s,transform:a}){const c=na(Yl(t),Yl(r));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u={x:-a[0]/a[2],y:-a[1]/a[2],width:i/a[2],height:s/a[2]};return fs(u,ra(c))>0}const km=({source:t,sourceHandle:r,target:i,targetHandle:s})=>`xy-edge__${t}${r||""}-${i}${s||""}`,l1=(t,r)=>r.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),Nm=(t,r,i={})=>{if(!t.source||!t.target)return r;const s=i.getEdgeId||km;let a;return cm(t)?a={...t}:a={...t,id:s(t)},l1(a,r)?r:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,r.concat(a))},a1=(t,r,i,s={shouldReplaceId:!0})=>{const{id:a,...c}=t;if(!r.source||!r.target||!i.find(g=>g.id===t.id))return i;const h=s.getEdgeId||km,m={...c,id:s.shouldReplaceId?h(r):a,source:r.source,target:r.target,sourceHandle:r.sourceHandle,targetHandle:r.targetHandle};return i.filter(g=>g.id!==a).concat(m)};function Em({sourceX:t,sourceY:r,targetX:i,targetY:s}){const[a,c,u,h]=Sm({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,a,c,u,h]}const Th={[_e.Left]:{x:-1,y:0},[_e.Right]:{x:1,y:0},[_e.Top]:{x:0,y:-1},[_e.Bottom]:{x:0,y:1}},c1=({source:t,sourcePosition:r=_e.Bottom,target:i})=>r===_e.Left||r===_e.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},Rh=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function u1({source:t,sourcePosition:r=_e.Bottom,target:i,targetPosition:s=_e.Top,center:a,offset:c,stepPosition:u}){const h=Th[r],m=Th[s],g={x:t.x+h.x*c,y:t.y+h.y*c},v={x:i.x+m.x*c,y:i.y+m.y*c},y=c1({source:g,sourcePosition:r,target:v}),x=y.x!==0?"x":"y",C=y[x];let E=[],k,_;const N={x:0,y:0},j={x:0,y:0},[,,S,M]=Sm({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(h[x]*m[x]===-1){x==="x"?(k=a.x??g.x+(v.x-g.x)*u,_=a.y??(g.y+v.y)/2):(k=a.x??(g.x+v.x)/2,_=a.y??g.y+(v.y-g.y)*u);const L=[{x:k,y:g.y},{x:k,y:v.y}],H=[{x:g.x,y:_},{x:v.x,y:_}];h[x]===C?E=x==="x"?L:H:E=x==="x"?H:L}else{const L=[{x:g.x,y:v.y}],H=[{x:v.x,y:g.y}];if(x==="x"?E=h.x===C?H:L:E=h.y===C?L:H,r===s){const G=Math.abs(t[x]-i[x]);if(G<=c){const te=Math.min(c-1,c-G);h[x]===C?N[x]=(g[x]>t[x]?-1:1)*te:j[x]=(v[x]>i[x]?-1:1)*te}}if(r!==s){const G=x==="x"?"y":"x",te=h[x]===m[G],z=g[G]>v[G],Q=g[G]<v[G];(h[x]===1&&(!te&&z||te&&Q)||h[x]!==1&&(!te&&Q||te&&z))&&(E=x==="x"?L:H)}const Z={x:g.x+N.x,y:g.y+N.y},B={x:v.x+j.x,y:v.y+j.y},J=Math.max(Math.abs(Z.x-E[0].x),Math.abs(B.x-E[0].x)),W=Math.max(Math.abs(Z.y-E[0].y),Math.abs(B.y-E[0].y));J>=W?(k=(Z.x+B.x)/2,_=E[0].y):(k=E[0].x,_=(Z.y+B.y)/2)}return[[t,{x:g.x+N.x,y:g.y+N.y},...E,{x:v.x+j.x,y:v.y+j.y},i],k,_,S,M]}function d1(t,r,i,s){const a=Math.min(Rh(t,r)/2,Rh(r,i)/2,s),{x:c,y:u}=r;if(t.x===c&&c===i.x||t.y===u&&u===i.y)return`L${c} ${u}`;if(t.y===u){const g=t.x<i.x?-1:1,v=t.y<i.y?1:-1;return`L ${c+a*g},${u}Q ${c},${u} ${c},${u+a*v}`}const h=t.x<i.x?1:-1,m=t.y<i.y?-1:1;return`L ${c},${u+a*m}Q ${c},${u} ${c+a*h},${u}`}function fu({sourceX:t,sourceY:r,sourcePosition:i=_e.Bottom,targetX:s,targetY:a,targetPosition:c=_e.Top,borderRadius:u=5,centerX:h,centerY:m,offset:g=20,stepPosition:v=.5}){const[y,x,C,E,k]=u1({source:{x:t,y:r},sourcePosition:i,target:{x:s,y:a},targetPosition:c,center:{x:h,y:m},offset:g,stepPosition:v});return[y.reduce((N,j,S)=>{let M="";return S>0&&S<y.length-1?M=d1(y[S-1],j,y[S+1],u):M=`${S===0?"M":"L"}${j.x} ${j.y}`,N+=M,N},""),x,C,E,k]}function zh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function f1(t){var y;const{sourceNode:r,targetNode:i}=t;if(!zh(r)||!zh(i))return null;const s=r.internals.handleBounds||Ah(r.handles),a=i.internals.handleBounds||Ah(i.handles),c=Lh((s==null?void 0:s.source)??[],t.sourceHandle),u=Lh(t.connectionMode===Si.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),t.targetHandle);if(!c||!u)return(y=t.onError)==null||y.call(t,"008",Bn.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=(c==null?void 0:c.position)||_e.Bottom,m=(u==null?void 0:u.position)||_e.Top,g=Ni(r,c,h),v=Ni(i,u,m);return{sourceX:g.x,sourceY:g.y,targetX:v.x,targetY:v.y,sourcePosition:h,targetPosition:m}}function Ah(t){if(!t)return null;const r=[],i=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?r.push(s):s.type==="target"&&i.push(s);return{source:r,target:i}}function Ni(t,r,i=_e.Left,s=!1){const a=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,c=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:u,height:h}=r??fr(t);if(s)return{x:a+u/2,y:c+h/2};switch((r==null?void 0:r.position)??i){case _e.Top:return{x:a+u/2,y:c};case _e.Right:return{x:a+u,y:c+h/2};case _e.Bottom:return{x:a+u/2,y:c+h};case _e.Left:return{x:a,y:c+h/2}}}function Lh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function hu(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function h1(t,{id:r,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:a}){const c=new Set;return t.reduce((u,h)=>([h.markerStart||s,h.markerEnd||a].forEach(m=>{if(m&&typeof m=="object"){const g=hu(m,r);c.has(g)||(u.push({id:g,color:m.color||i,...m}),c.add(g))}}),u),[]).sort((u,h)=>u.id.localeCompare(h.id))}const Cm=1e3,p1=10,Pu={nodeOrigin:[0,0],nodeExtent:cs,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},m1={...Pu,checkEquality:!0};function Iu(t,r){const i={...t};for(const s in r)r[s]!==void 0&&(i[s]=r[s]);return i}function g1(t,r,i){const s=Iu(Pu,i);for(const a of t.values())if(a.parentId)Ru(a,t,r,s);else{const c=vs(a,s.nodeOrigin),u=vo(a.extent)?a.extent:s.nodeExtent,h=ki(c,u,fr(a));a.internals.positionAbsolute=h}}function y1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],s=[];for(const a of t.handles){const c={id:a.id,width:a.width??1,height:a.height??1,nodeId:t.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?i.push(c):a.type==="target"&&s.push(c)}return{source:i,target:s}}function Tu(t){return t==="manual"}function pu(t,r,i,s={}){var g,v;const a=Iu(m1,s),c={i:0},u=new Map(r),h=a!=null&&a.elevateNodesOnSelect&&!Tu(a.zIndexMode)?Cm:0;let m=t.length>0;r.clear(),i.clear();for(const y of t){let x=u.get(y.id);if(a.checkEquality&&y===(x==null?void 0:x.internals.userNode))r.set(y.id,x);else{const C=vs(y,a.nodeOrigin),E=vo(y.extent)?y.extent:a.nodeExtent,k=ki(C,E,fr(y));x={...a.defaults,...y,measured:{width:(g=y.measured)==null?void 0:g.width,height:(v=y.measured)==null?void 0:v.height},internals:{positionAbsolute:k,handleBounds:y1(y,x),z:_m(y,h,a.zIndexMode),userNode:y}},r.set(y.id,x)}(x.measured===void 0||x.measured.width===void 0||x.measured.height===void 0)&&!x.hidden&&(m=!1),y.parentId&&Ru(x,r,i,s,c)}return m}function v1(t,r){if(!t.parentId)return;const i=r.get(t.parentId);i?i.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function Ru(t,r,i,s,a){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:h,zIndexMode:m}=Iu(Pu,s),g=t.parentId,v=r.get(g);if(!v){console.warn(`Parent node ${g} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}v1(t,i),a&&!v.parentId&&v.internals.rootParentIndex===void 0&&m==="auto"&&(v.internals.rootParentIndex=++a.i,v.internals.z=v.internals.z+a.i*p1),a&&v.internals.rootParentIndex!==void 0&&(a.i=v.internals.rootParentIndex);const y=c&&!Tu(m)?Cm:0,{x,y:C,z:E}=x1(t,v,u,h,y,m),{positionAbsolute:k}=t.internals,_=x!==k.x||C!==k.y;(_||E!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:_?{x,y:C}:k,z:E}})}function _m(t,r,i){const s=En(t.zIndex)?t.zIndex:0;return Tu(i)?s:s+(t.selected?r:0)}function x1(t,r,i,s,a,c){const{x:u,y:h}=r.internals.positionAbsolute,m=fr(t),g=vs(t,i),v=vo(t.extent)?ki(g,t.extent,m):g;let y=ki({x:u+v.x,y:h+v.y},s,m);t.extent==="parent"&&(y=dm(y,m,r));const x=_m(t,a,c),C=r.internals.z??0;return{x:y.x,y:y.y,z:C>=x?C+1:x}}function zu(t,r,i,s=[0,0]){var u;const a=[],c=new Map;for(const h of t){const m=r.get(h.parentId);if(!m)continue;const g=((u=c.get(h.parentId))==null?void 0:u.expandedRect)??yo(m),v=hm(g,h.rect);c.set(h.parentId,{expandedRect:v,parent:m})}return c.size>0&&c.forEach(({expandedRect:h,parent:m},g)=>{var S;const v=m.internals.positionAbsolute,y=fr(m),x=m.origin??s,C=h.x<v.x?Math.round(Math.abs(v.x-h.x)):0,E=h.y<v.y?Math.round(Math.abs(v.y-h.y)):0,k=Math.max(y.width,Math.round(h.width)),_=Math.max(y.height,Math.round(h.height)),N=(k-y.width)*x[0],j=(_-y.height)*x[1];(C>0||E>0||N||j)&&(a.push({id:g,type:"position",position:{x:m.position.x-C+N,y:m.position.y-E+j}}),(S=i.get(g))==null||S.forEach(M=>{t.some($=>$.id===M.id)||a.push({id:M.id,type:"position",position:{x:M.position.x+C,y:M.position.y+E}})})),(y.width<h.width||y.height<h.height||C||E)&&a.push({id:g,type:"dimensions",setAttributes:!0,dimensions:{width:k+(C?x[0]*C-N:0),height:_+(E?x[1]*E-j:0)}})}),a}function w1(t,r,i,s,a,c,u){const h=s==null?void 0:s.querySelector(".xyflow__viewport");let m=!1;if(!h)return{changes:[],updatedInternals:m};const g=[],v=window.getComputedStyle(h),{m22:y}=new window.DOMMatrixReadOnly(v.transform),x=[];for(const C of t.values()){const E=r.get(C.id);if(!E)continue;if(E.hidden){r.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),m=!0;continue}const k=Mu(C.nodeElement),_=E.measured.width!==k.width||E.measured.height!==k.height;if(!!(k.width&&k.height&&(_||!E.internals.handleBounds||C.force))){const j=C.nodeElement.getBoundingClientRect(),S=vo(E.extent)?E.extent:c;let{positionAbsolute:M}=E.internals;E.parentId&&E.extent==="parent"?M=dm(M,k,r.get(E.parentId)):S&&(M=ki(M,S,k));const $={...E,measured:k,internals:{...E.internals,positionAbsolute:M,handleBounds:{source:Ph("source",C.nodeElement,j,y,E.id),target:Ph("target",C.nodeElement,j,y,E.id)}}};r.set(E.id,$),E.parentId&&Ru($,r,i,{nodeOrigin:a,zIndexMode:u}),m=!0,_&&(g.push({id:E.id,type:"dimensions",dimensions:k}),E.expandParent&&E.parentId&&x.push({id:E.id,parentId:E.parentId,rect:yo($,a)}))}}if(x.length>0){const C=zu(x,r,i,a);g.push(...C)}return{changes:g,updatedInternals:m}}async function S1({delta:t,panZoom:r,transform:i,translateExtent:s,width:a,height:c}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const u=await r.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[a,c]],s),h=!!u&&(u.x!==i[0]||u.y!==i[1]||u.k!==i[2]);return Promise.resolve(h)}function Dh(t,r,i,s,a,c){let u=a;const h=s.get(u)||new Map;s.set(u,h.set(i,r)),u=`${a}-${t}`;const m=s.get(u)||new Map;if(s.set(u,m.set(i,r)),c){u=`${a}-${t}-${c}`;const g=s.get(u)||new Map;s.set(u,g.set(i,r))}}function jm(t,r,i){t.clear(),r.clear();for(const s of i){const{source:a,target:c,sourceHandle:u=null,targetHandle:h=null}=s,m={edgeId:s.id,source:a,target:c,sourceHandle:u,targetHandle:h},g=`${a}-${u}--${c}-${h}`,v=`${c}-${h}--${a}-${u}`;Dh("source",m,v,t,a,u),Dh("target",m,g,t,c,h),r.set(s.id,s)}}function bm(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:bm(i,r):!1}function $h(t,r,i){var a;let s=t;do{if((a=s==null?void 0:s.matches)!=null&&a.call(s,r))return!0;if(s===i)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function k1(t,r,i,s){const a=new Map;for(const[c,u]of t)if((u.selected||u.id===s)&&(!u.parentId||!bm(u,t))&&(u.draggable||r&&typeof u.draggable>"u")){const h=t.get(c);h&&a.set(c,{id:c,position:h.position||{x:0,y:0},distance:{x:i.x-h.internals.positionAbsolute.x,y:i.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return a}function Yc({nodeId:t,dragItems:r,nodeLookup:i,dragging:s=!0}){var u,h,m;const a=[];for(const[g,v]of r){const y=(u=i.get(g))==null?void 0:u.internals.userNode;y&&a.push({...y,position:v.position,dragging:s})}if(!t)return[a[0],a];const c=(h=i.get(t))==null?void 0:h.internals.userNode;return[c?{...c,position:((m=r.get(t))==null?void 0:m.position)||c.position,dragging:s}:a[0],a]}function N1({dragItems:t,snapGrid:r,x:i,y:s}){const a=t.values().next().value;if(!a)return null;const c={x:i-a.distance.x,y:s-a.distance.y},u=ws(c,r);return{x:u.x-c.x,y:u.y-c.y}}function E1({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:s,onDragStop:a}){let c={x:null,y:null},u=0,h=new Map,m=!1,g={x:0,y:0},v=null,y=!1,x=null,C=!1,E=!1,k=null;function _({noDragClassName:j,handleSelector:S,domNode:M,isSelectable:$,nodeId:L,nodeClickDistance:H=0}){x=Zt(M);function Z({x:G,y:te}){const{nodeLookup:z,nodeExtent:Q,snapGrid:T,snapToGrid:K,nodeOrigin:R,onNodeDrag:A,onSelectionDrag:U,onError:P,updateNodePositions:O}=r();c={x:G,y:te};let oe=!1;const se=h.size>1,he=se&&Q?du(xs(h)):null,de=se&&K?N1({dragItems:h,snapGrid:T,x:G,y:te}):null;for(const[pe,ie]of h){if(!z.has(pe))continue;let me={x:G-ie.distance.x,y:te-ie.distance.y};K&&(me=de?{x:Math.round(me.x+de.x),y:Math.round(me.y+de.y)}:ws(me,T));let ke=null;if(se&&Q&&!ie.extent&&he){const{positionAbsolute:Ne}=ie.internals,ze=Ne.x-he.x+Q[0][0],Be=Ne.x+ie.measured.width-he.x2+Q[1][0],Ae=Ne.y-he.y+Q[0][1],et=Ne.y+ie.measured.height-he.y2+Q[1][1];ke=[[ze,Ae],[Be,et]]}const{position:je,positionAbsolute:be}=um({nodeId:pe,nextPosition:me,nodeLookup:z,nodeExtent:ke||Q,nodeOrigin:R,onError:P});oe=oe||ie.position.x!==je.x||ie.position.y!==je.y,ie.position=je,ie.internals.positionAbsolute=be}if(E=E||oe,!!oe&&(O(h,!0),k&&(s||A||!L&&U))){const[pe,ie]=Yc({nodeId:L,dragItems:h,nodeLookup:z});s==null||s(k,h,pe,ie),A==null||A(k,pe,ie),L||U==null||U(k,ie)}}async function B(){if(!v)return;const{transform:G,panBy:te,autoPanSpeed:z,autoPanOnNodeDrag:Q}=r();if(!Q){m=!1,cancelAnimationFrame(u);return}const[T,K]=fm(g,v,z);(T!==0||K!==0)&&(c.x=(c.x??0)-T/G[2],c.y=(c.y??0)-K/G[2],await te({x:T,y:K})&&Z(c)),u=requestAnimationFrame(B)}function J(G){var se;const{nodeLookup:te,multiSelectionActive:z,nodesDraggable:Q,transform:T,snapGrid:K,snapToGrid:R,selectNodesOnDrag:A,onNodeDragStart:U,onSelectionDragStart:P,unselectNodesAndEdges:O}=r();y=!0,(!A||!$)&&!z&&L&&((se=te.get(L))!=null&&se.selected||O()),$&&A&&L&&(t==null||t(L));const oe=is(G.sourceEvent,{transform:T,snapGrid:K,snapToGrid:R,containerBounds:v});if(c=oe,h=k1(te,Q,oe,L),h.size>0&&(i||U||!L&&P)){const[he,de]=Yc({nodeId:L,dragItems:h,nodeLookup:te});i==null||i(G.sourceEvent,h,he,de),U==null||U(G.sourceEvent,he,de),L||P==null||P(G.sourceEvent,de)}}const W=Vp().clickDistance(H).on("start",G=>{const{domNode:te,nodeDragThreshold:z,transform:Q,snapGrid:T,snapToGrid:K}=r();v=(te==null?void 0:te.getBoundingClientRect())||null,C=!1,E=!1,k=G.sourceEvent,z===0&&J(G),c=is(G.sourceEvent,{transform:Q,snapGrid:T,snapToGrid:K,containerBounds:v}),g=Cn(G.sourceEvent,v)}).on("drag",G=>{const{autoPanOnNodeDrag:te,transform:z,snapGrid:Q,snapToGrid:T,nodeDragThreshold:K,nodeLookup:R}=r(),A=is(G.sourceEvent,{transform:z,snapGrid:Q,snapToGrid:T,containerBounds:v});if(k=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||L&&!R.has(L))&&(C=!0),!C){if(!m&&te&&y&&(m=!0,B()),!y){const U=Cn(G.sourceEvent,v),P=U.x-g.x,O=U.y-g.y;Math.sqrt(P*P+O*O)>K&&J(G)}(c.x!==A.xSnapped||c.y!==A.ySnapped)&&h&&y&&(g=Cn(G.sourceEvent,v),Z(A))}}).on("end",G=>{if(!(!y||C)&&(m=!1,y=!1,cancelAnimationFrame(u),h.size>0)){const{nodeLookup:te,updateNodePositions:z,onNodeDragStop:Q,onSelectionDragStop:T}=r();if(E&&(z(h,!1),E=!1),a||Q||!L&&T){const[K,R]=Yc({nodeId:L,dragItems:h,nodeLookup:te,dragging:!1});a==null||a(G.sourceEvent,h,K,R),Q==null||Q(G.sourceEvent,K,R),L||T==null||T(G.sourceEvent,R)}}}).filter(G=>{const te=G.target;return!G.button&&(!j||!$h(te,`.${j}`,M))&&(!S||$h(te,S,M))});x.call(W)}function N(){x==null||x.on(".drag",null)}return{update:_,destroy:N}}function C1(t,r,i){const s=[],a={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const c of r.values())fs(a,yo(c))>0&&s.push(c);return s}const _1=250;function j1(t,r,i,s){var h,m;let a=[],c=1/0;const u=C1(t,i,r+_1);for(const g of u){const v=[...((h=g.internals.handleBounds)==null?void 0:h.source)??[],...((m=g.internals.handleBounds)==null?void 0:m.target)??[]];for(const y of v){if(s.nodeId===y.nodeId&&s.type===y.type&&s.id===y.id)continue;const{x,y:C}=Ni(g,y,y.position,!0),E=Math.sqrt(Math.pow(x-t.x,2)+Math.pow(C-t.y,2));E>r||(E<c?(a=[{...y,x,y:C}],c=E):E===c&&a.push({...y,x,y:C}))}}if(!a.length)return null;if(a.length>1){const g=s.type==="source"?"target":"source";return a.find(v=>v.type===g)??a[0]}return a[0]}function Mm(t,r,i,s,a,c=!1){var g,v,y;const u=s.get(t);if(!u)return null;const h=a==="strict"?(g=u.internals.handleBounds)==null?void 0:g[r]:[...((v=u.internals.handleBounds)==null?void 0:v.source)??[],...((y=u.internals.handleBounds)==null?void 0:y.target)??[]],m=(i?h==null?void 0:h.find(x=>x.id===i):h==null?void 0:h[0])??null;return m&&c?{...m,...Ni(u,m,m.position,!0)}:m}function Pm(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function b1(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const Im=()=>!0;function M1(t,{connectionMode:r,connectionRadius:i,handleId:s,nodeId:a,edgeUpdaterType:c,isTarget:u,domNode:h,nodeLookup:m,lib:g,autoPanOnConnect:v,flowId:y,panBy:x,cancelConnection:C,onConnectStart:E,onConnect:k,onConnectEnd:_,isValidConnection:N=Im,onReconnectEnd:j,updateConnection:S,getTransform:M,getFromHandle:$,autoPanSpeed:L,dragThreshold:H=1,handleDomNode:Z}){const B=gm(t.target);let J=0,W;const{x:G,y:te}=Cn(t),z=Pm(c,Z),Q=h==null?void 0:h.getBoundingClientRect();let T=!1;if(!Q||!z)return;const K=Mm(a,z,s,m,r);if(!K)return;let R=Cn(t,Q),A=!1,U=null,P=!1,O=null;function oe(){if(!v||!Q)return;const[je,be]=fm(R,Q,L);x({x:je,y:be}),J=requestAnimationFrame(oe)}const se={...K,nodeId:a,type:z,position:K.position},he=m.get(a);let pe={inProgress:!0,isValid:null,from:Ni(he,se,_e.Left,!0),fromHandle:se,fromPosition:se.position,fromNode:he,to:R,toHandle:null,toPosition:_h[se.position],toNode:null,pointer:R};function ie(){T=!0,S(pe),E==null||E(t,{nodeId:a,handleId:s,handleType:z})}H===0&&ie();function me(je){if(!T){const{x:et,y:Mt}=Cn(je),pt=et-G,xt=Mt-te;if(!(pt*pt+xt*xt>H*H))return;ie()}if(!$()||!se){ke(je);return}const be=M();R=Cn(je,Q),W=j1(Ss(R,be,!1,[1,1]),i,m,se),A||(oe(),A=!0);const Ne=Tm(je,{handle:W,connectionMode:r,fromNodeId:a,fromHandleId:s,fromType:u?"target":"source",isValidConnection:N,doc:B,lib:g,flowId:y,nodeLookup:m});O=Ne.handleDomNode,U=Ne.connection,P=b1(!!W,Ne.isValid);const ze=m.get(a),Be=ze?Ni(ze,se,_e.Left,!0):pe.from,Ae={...pe,from:Be,isValid:P,to:Ne.toHandle&&P?Xl({x:Ne.toHandle.x,y:Ne.toHandle.y},be):R,toHandle:Ne.toHandle,toPosition:P&&Ne.toHandle?Ne.toHandle.position:_h[se.position],toNode:Ne.toHandle?m.get(Ne.toHandle.nodeId):null,pointer:R};S(Ae),pe=Ae}function ke(je){if(!("touches"in je&&je.touches.length>0)){if(T){(W||O)&&U&&P&&(k==null||k(U));const{inProgress:be,...Ne}=pe,ze={...Ne,toPosition:pe.toHandle?pe.toPosition:null};_==null||_(je,ze),c&&(j==null||j(je,ze))}C(),cancelAnimationFrame(J),A=!1,P=!1,U=null,O=null,B.removeEventListener("mousemove",me),B.removeEventListener("mouseup",ke),B.removeEventListener("touchmove",me),B.removeEventListener("touchend",ke)}}B.addEventListener("mousemove",me),B.addEventListener("mouseup",ke),B.addEventListener("touchmove",me),B.addEventListener("touchend",ke)}function Tm(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:a,fromType:c,doc:u,lib:h,flowId:m,isValidConnection:g=Im,nodeLookup:v}){const y=c==="target",x=r?u.querySelector(`.${h}-flow__handle[data-id="${m}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:E}=Cn(t),k=u.elementFromPoint(C,E),_=k!=null&&k.classList.contains(`${h}-flow__handle`)?k:x,N={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const j=Pm(void 0,_),S=_.getAttribute("data-nodeid"),M=_.getAttribute("data-handleid"),$=_.classList.contains("connectable"),L=_.classList.contains("connectableend");if(!S||!j)return N;const H={source:y?S:s,sourceHandle:y?M:a,target:y?s:S,targetHandle:y?a:M};N.connection=H;const B=$&&L&&(i===Si.Strict?y&&j==="source"||!y&&j==="target":S!==s||M!==a);N.isValid=B&&g(H),N.toHandle=Mm(S,j,M,v,i,!0)}return N}const mu={onPointerDown:M1,isValid:Tm};function P1({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const a=Zt(t);function c({translateExtent:h,width:m,height:g,zoomStep:v=1,pannable:y=!0,zoomable:x=!0,inversePan:C=!1}){const E=S=>{if(S.sourceEvent.type!=="wheel"||!r)return;const M=i(),$=S.sourceEvent.ctrlKey&&hs()?10:1,L=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*v,H=M[2]*Math.pow(2,L*$);r.scaleTo(H)};let k=[0,0];const _=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(k=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},N=S=>{const M=i();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!r)return;const $=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],L=[$[0]-k[0],$[1]-k[1]];k=$;const H=s()*Math.max(M[2],Math.log(M[2]))*(C?-1:1),Z={x:M[0]-L[0]*H,y:M[1]-L[1]*H},B=[[0,0],[m,g]];r.setViewportConstrained({x:Z.x,y:Z.y,zoom:M[2]},B,h)},j=im().on("start",_).on("zoom",y?N:null).on("zoom.wheel",x?E:null);a.call(j,{})}function u(){a.on("zoom",null)}return{update:c,destroy:u,pointer:kn}}const ia=t=>({x:t.x,y:t.y,zoom:t.k}),Xc=({x:t,y:r,zoom:i})=>ta.translate(t,r).scale(i),co=(t,r)=>t.target.closest(`.${r}`),Rm=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),I1=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Gc=(t,r=0,i=I1,s=()=>{})=>{const a=typeof r=="number"&&r>0;return a||s(),a?t.transition().duration(r).ease(i).on("end",s):t},zm=t=>{const r=t.ctrlKey&&hs()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function T1({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:s,panOnScrollMode:a,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:h,onPanZoom:m,onPanZoomEnd:g}){return v=>{if(co(v,r))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const y=i.property("__zoom").k||1;if(v.ctrlKey&&u){const _=kn(v),N=zm(v),j=y*Math.pow(2,N);s.scaleTo(i,j,_,v);return}const x=v.deltaMode===1?20:1;let C=a===yi.Vertical?0:v.deltaX*x,E=a===yi.Horizontal?0:v.deltaY*x;!hs()&&v.shiftKey&&a!==yi.Vertical&&(C=v.deltaY*x,E=0),s.translateBy(i,-(C/y)*c,-(E/y)*c,{internal:!0});const k=ia(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(m==null||m(v,k),t.panScrollTimeout=setTimeout(()=>{g==null||g(v,k),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(v,k))}}function R1({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,a){const c=s.type==="wheel",u=!r&&c&&!s.ctrlKey,h=co(s,t);if(s.ctrlKey&&c&&h&&s.preventDefault(),u||h)return null;s.preventDefault(),i.call(this,s,a)}}function z1({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return s=>{var c,u,h;if((c=s.sourceEvent)!=null&&c.internal)return;const a=ia(s.transform);t.mouseButton=((u=s.sourceEvent)==null?void 0:u.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=a,((h=s.sourceEvent)==null?void 0:h.type)==="mousedown"&&r(!0),i&&(i==null||i(s.sourceEvent,a))}}function A1({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:s,onPanZoom:a}){return c=>{var u,h;t.usedRightMouseButton=!!(i&&Rm(r,t.mouseButton??0)),(u=c.sourceEvent)!=null&&u.sync||s([c.transform.x,c.transform.y,c.transform.k]),a&&!((h=c.sourceEvent)!=null&&h.internal)&&(a==null||a(c.sourceEvent,ia(c.transform)))}}function L1({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:a,onPaneContextMenu:c}){return u=>{var h;if(!((h=u.sourceEvent)!=null&&h.internal)&&(t.isZoomingOrPanning=!1,c&&Rm(r,t.mouseButton??0)&&!t.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),t.usedRightMouseButton=!1,s(!1),a)){const m=ia(u.transform);t.prevViewport=m,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,m)},i?150:0)}}}function D1({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:s,panOnScroll:a,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:h,noPanClassName:m,lib:g,connectionInProgress:v}){return y=>{var _;const x=t||r,C=i&&y.ctrlKey,E=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(co(y,`${g}-flow__node`)||co(y,`${g}-flow__edge`)))return!0;if(!s&&!x&&!a&&!c&&!i||u||v&&!E||co(y,h)&&E||co(y,m)&&(!E||a&&E&&!t)||!i&&y.ctrlKey&&E)return!1;if(!i&&y.type==="touchstart"&&((_=y.touches)==null?void 0:_.length)>1)return y.preventDefault(),!1;if(!x&&!a&&!C&&E||!s&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(s)&&!s.includes(y.button)&&y.type==="mousedown")return!1;const k=Array.isArray(s)&&s.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||E)&&k}}function $1({domNode:t,minZoom:r,maxZoom:i,translateExtent:s,viewport:a,onPanZoom:c,onPanZoomStart:u,onPanZoomEnd:h,onDraggingChange:m}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=t.getBoundingClientRect(),y=im().scaleExtent([r,i]).translateExtent(s),x=Zt(t).call(y);j({x:a.x,y:a.y,zoom:go(a.zoom,r,i)},[[0,0],[v.width,v.height]],s);const C=x.on("wheel.zoom"),E=x.on("dblclick.zoom");y.wheelDelta(zm);function k(W,G){return x?new Promise(te=>{y==null||y.interpolate((G==null?void 0:G.interpolate)==="linear"?rs:Al).transform(Gc(x,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),W)}):Promise.resolve(!1)}function _({noWheelClassName:W,noPanClassName:G,onPaneContextMenu:te,userSelectionActive:z,panOnScroll:Q,panOnDrag:T,panOnScrollMode:K,panOnScrollSpeed:R,preventScrolling:A,zoomOnPinch:U,zoomOnScroll:P,zoomOnDoubleClick:O,zoomActivationKeyPressed:oe,lib:se,onTransformChange:he,connectionInProgress:de,paneClickDistance:pe,selectionOnDrag:ie}){z&&!g.isZoomingOrPanning&&N();const me=Q&&!oe&&!z;y.clickDistance(ie?1/0:!En(pe)||pe<0?0:pe);const ke=me?T1({zoomPanValues:g,noWheelClassName:W,d3Selection:x,d3Zoom:y,panOnScrollMode:K,panOnScrollSpeed:R,zoomOnPinch:U,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:h}):R1({noWheelClassName:W,preventScrolling:A,d3ZoomHandler:C});if(x.on("wheel.zoom",ke,{passive:!1}),!z){const be=z1({zoomPanValues:g,onDraggingChange:m,onPanZoomStart:u});y.on("start",be);const Ne=A1({zoomPanValues:g,panOnDrag:T,onPaneContextMenu:!!te,onPanZoom:c,onTransformChange:he});y.on("zoom",Ne);const ze=L1({zoomPanValues:g,panOnDrag:T,panOnScroll:Q,onPaneContextMenu:te,onPanZoomEnd:h,onDraggingChange:m});y.on("end",ze)}const je=D1({zoomActivationKeyPressed:oe,panOnDrag:T,zoomOnScroll:P,panOnScroll:Q,zoomOnDoubleClick:O,zoomOnPinch:U,userSelectionActive:z,noPanClassName:G,noWheelClassName:W,lib:se,connectionInProgress:de});y.filter(je),O?x.on("dblclick.zoom",E):x.on("dblclick.zoom",null)}function N(){y.on("zoom",null)}async function j(W,G,te){const z=Xc(W),Q=y==null?void 0:y.constrain()(z,G,te);return Q&&await k(Q),new Promise(T=>T(Q))}async function S(W,G){const te=Xc(W);return await k(te,G),new Promise(z=>z(te))}function M(W){if(x){const G=Xc(W),te=x.property("__zoom");(te.k!==W.zoom||te.x!==W.x||te.y!==W.y)&&(y==null||y.transform(x,G,null,{sync:!0}))}}function $(){const W=x?rm(x.node()):{x:0,y:0,k:1};return{x:W.x,y:W.y,zoom:W.k}}function L(W,G){return x?new Promise(te=>{y==null||y.interpolate((G==null?void 0:G.interpolate)==="linear"?rs:Al).scaleTo(Gc(x,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),W)}):Promise.resolve(!1)}function H(W,G){return x?new Promise(te=>{y==null||y.interpolate((G==null?void 0:G.interpolate)==="linear"?rs:Al).scaleBy(Gc(x,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),W)}):Promise.resolve(!1)}function Z(W){y==null||y.scaleExtent(W)}function B(W){y==null||y.translateExtent(W)}function J(W){const G=!En(W)||W<0?0:W;y==null||y.clickDistance(G)}return{update:_,destroy:N,setViewport:S,setViewportConstrained:j,getViewport:$,scaleTo:L,scaleBy:H,setScaleExtent:Z,setTranslateExtent:B,syncViewport:M,setClickDistance:J}}var Ei;(function(t){t.Line="line",t.Handle="handle"})(Ei||(Ei={}));const O1=["top-left","top-right","bottom-left","bottom-right"],F1=["top","right","bottom","left"];function H1({width:t,prevWidth:r,height:i,prevHeight:s,affectsX:a,affectsY:c}){const u=t-r,h=i-s,m=[u>0?1:u<0?-1:0,h>0?1:h<0?-1:0];return u&&a&&(m[0]=m[0]*-1),h&&c&&(m[1]=m[1]*-1),m}function Oh(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),s=t.includes("left"),a=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:s,affectsY:a}}function Br(t,r){return Math.max(0,r-t)}function Vr(t,r){return Math.max(0,t-r)}function Il(t,r,i){return Math.max(0,r-t,t-i)}function Fh(t,r){return t?!r:r}function B1(t,r,i,s,a,c,u,h){let{affectsX:m,affectsY:g}=r;const{isHorizontal:v,isVertical:y}=r,x=v&&y,{xSnapped:C,ySnapped:E}=i,{minWidth:k,maxWidth:_,minHeight:N,maxHeight:j}=s,{x:S,y:M,width:$,height:L,aspectRatio:H}=t;let Z=Math.floor(v?C-t.pointerX:0),B=Math.floor(y?E-t.pointerY:0);const J=$+(m?-Z:Z),W=L+(g?-B:B),G=-c[0]*$,te=-c[1]*L;let z=Il(J,k,_),Q=Il(W,N,j);if(u){let R=0,A=0;m&&Z<0?R=Br(S+Z+G,u[0][0]):!m&&Z>0&&(R=Vr(S+J+G,u[1][0])),g&&B<0?A=Br(M+B+te,u[0][1]):!g&&B>0&&(A=Vr(M+W+te,u[1][1])),z=Math.max(z,R),Q=Math.max(Q,A)}if(h){let R=0,A=0;m&&Z>0?R=Vr(S+Z,h[0][0]):!m&&Z<0&&(R=Br(S+J,h[1][0])),g&&B>0?A=Vr(M+B,h[0][1]):!g&&B<0&&(A=Br(M+W,h[1][1])),z=Math.max(z,R),Q=Math.max(Q,A)}if(a){if(v){const R=Il(J/H,N,j)*H;if(z=Math.max(z,R),u){let A=0;!m&&!g||m&&!g&&x?A=Vr(M+te+J/H,u[1][1])*H:A=Br(M+te+(m?Z:-Z)/H,u[0][1])*H,z=Math.max(z,A)}if(h){let A=0;!m&&!g||m&&!g&&x?A=Br(M+J/H,h[1][1])*H:A=Vr(M+(m?Z:-Z)/H,h[0][1])*H,z=Math.max(z,A)}}if(y){const R=Il(W*H,k,_)/H;if(Q=Math.max(Q,R),u){let A=0;!m&&!g||g&&!m&&x?A=Vr(S+W*H+G,u[1][0])/H:A=Br(S+(g?B:-B)*H+G,u[0][0])/H,Q=Math.max(Q,A)}if(h){let A=0;!m&&!g||g&&!m&&x?A=Br(S+W*H,h[1][0])/H:A=Vr(S+(g?B:-B)*H,h[0][0])/H,Q=Math.max(Q,A)}}}B=B+(B<0?Q:-Q),Z=Z+(Z<0?z:-z),a&&(x?J>W*H?B=(Fh(m,g)?-Z:Z)/H:Z=(Fh(m,g)?-B:B)*H:v?(B=Z/H,g=m):(Z=B*H,m=g));const T=m?S+Z:S,K=g?M+B:M;return{width:$+(m?-Z:Z),height:L+(g?-B:B),x:c[0]*Z*(m?-1:1)+T,y:c[1]*B*(g?-1:1)+K}}const Am={width:0,height:0,x:0,y:0},V1={...Am,pointerX:0,pointerY:0,aspectRatio:1};function W1(t){return[[0,0],[t.measured.width,t.measured.height]]}function U1(t,r,i){const s=r.position.x+t.position.x,a=r.position.y+t.position.y,c=t.measured.width??0,u=t.measured.height??0,h=i[0]*c,m=i[1]*u;return[[s-h,a-m],[s+c-h,a+u-m]]}function Y1({domNode:t,nodeId:r,getStoreItems:i,onChange:s,onEnd:a}){const c=Zt(t);let u={controlDirection:Oh("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:g,boundaries:v,keepAspectRatio:y,resizeDirection:x,onResizeStart:C,onResize:E,onResizeEnd:k,shouldResize:_}){let N={...Am},j={...V1};u={boundaries:v,resizeDirection:x,keepAspectRatio:y,controlDirection:Oh(g)};let S,M=null,$=[],L,H,Z,B=!1;const J=Vp().on("start",W=>{const{nodeLookup:G,transform:te,snapGrid:z,snapToGrid:Q,nodeOrigin:T,paneDomNode:K}=i();if(S=G.get(r),!S)return;M=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:R,ySnapped:A}=is(W.sourceEvent,{transform:te,snapGrid:z,snapToGrid:Q,containerBounds:M});N={width:S.measured.width??0,height:S.measured.height??0,x:S.position.x??0,y:S.position.y??0},j={...N,pointerX:R,pointerY:A,aspectRatio:N.width/N.height},L=void 0,S.parentId&&(S.extent==="parent"||S.expandParent)&&(L=G.get(S.parentId),H=L&&S.extent==="parent"?W1(L):void 0),$=[],Z=void 0;for(const[U,P]of G)if(P.parentId===r&&($.push({id:U,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const O=U1(P,S,P.origin??T);Z?Z=[[Math.min(O[0][0],Z[0][0]),Math.min(O[0][1],Z[0][1])],[Math.max(O[1][0],Z[1][0]),Math.max(O[1][1],Z[1][1])]]:Z=O}C==null||C(W,{...N})}).on("drag",W=>{const{transform:G,snapGrid:te,snapToGrid:z,nodeOrigin:Q}=i(),T=is(W.sourceEvent,{transform:G,snapGrid:te,snapToGrid:z,containerBounds:M}),K=[];if(!S)return;const{x:R,y:A,width:U,height:P}=N,O={},oe=S.origin??Q,{width:se,height:he,x:de,y:pe}=B1(j,u.controlDirection,T,u.boundaries,u.keepAspectRatio,oe,H,Z),ie=se!==U,me=he!==P,ke=de!==R&&ie,je=pe!==A&&me;if(!ke&&!je&&!ie&&!me)return;if((ke||je||oe[0]===1||oe[1]===1)&&(O.x=ke?de:N.x,O.y=je?pe:N.y,N.x=O.x,N.y=O.y,$.length>0)){const Be=de-R,Ae=pe-A;for(const et of $)et.position={x:et.position.x-Be+oe[0]*(se-U),y:et.position.y-Ae+oe[1]*(he-P)},K.push(et)}if((ie||me)&&(O.width=ie&&(!u.resizeDirection||u.resizeDirection==="horizontal")?se:N.width,O.height=me&&(!u.resizeDirection||u.resizeDirection==="vertical")?he:N.height,N.width=O.width,N.height=O.height),L&&S.expandParent){const Be=oe[0]*(O.width??0);O.x&&O.x<Be&&(N.x=Be,j.x=j.x-(O.x-Be));const Ae=oe[1]*(O.height??0);O.y&&O.y<Ae&&(N.y=Ae,j.y=j.y-(O.y-Ae))}const be=H1({width:N.width,prevWidth:U,height:N.height,prevHeight:P,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={...N,direction:be};(_==null?void 0:_(W,Ne))!==!1&&(B=!0,E==null||E(W,Ne),s(O,K))}).on("end",W=>{B&&(k==null||k(W,{...N}),a==null||a({...N}),B=!1)});c.call(J)}function m(){c.on(".drag",null)}return{update:h,destroy:m}}var Kc={exports:{}},Qc={},qc={exports:{}},Zc={};/**
41
+ * @license React
42
+ * use-sync-external-store-shim.production.js
43
+ *
44
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
45
+ *
46
+ * This source code is licensed under the MIT license found in the
47
+ * LICENSE file in the root directory of this source tree.
48
+ */var Hh;function X1(){if(Hh)return Zc;Hh=1;var t=ms();function r(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var i=typeof Object.is=="function"?Object.is:r,s=t.useState,a=t.useEffect,c=t.useLayoutEffect,u=t.useDebugValue;function h(y,x){var C=x(),E=s({inst:{value:C,getSnapshot:x}}),k=E[0].inst,_=E[1];return c(function(){k.value=C,k.getSnapshot=x,m(k)&&_({inst:k})},[y,C,x]),a(function(){return m(k)&&_({inst:k}),y(function(){m(k)&&_({inst:k})})},[y]),u(C),C}function m(y){var x=y.getSnapshot;y=y.value;try{var C=x();return!i(y,C)}catch{return!0}}function g(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:h;return Zc.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,Zc}var Bh;function G1(){return Bh||(Bh=1,qc.exports=X1()),qc.exports}/**
49
+ * @license React
50
+ * use-sync-external-store-shim/with-selector.production.js
51
+ *
52
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE file in the root directory of this source tree.
56
+ */var Vh;function K1(){if(Vh)return Qc;Vh=1;var t=ms(),r=G1();function i(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var s=typeof Object.is=="function"?Object.is:i,a=r.useSyncExternalStore,c=t.useRef,u=t.useEffect,h=t.useMemo,m=t.useDebugValue;return Qc.useSyncExternalStoreWithSelector=function(g,v,y,x,C){var E=c(null);if(E.current===null){var k={hasValue:!1,value:null};E.current=k}else k=E.current;E=h(function(){function N(L){if(!j){if(j=!0,S=L,L=x(L),C!==void 0&&k.hasValue){var H=k.value;if(C(H,L))return M=H}return M=L}if(H=M,s(S,L))return H;var Z=x(L);return C!==void 0&&C(H,Z)?(S=L,H):(S=L,M=Z)}var j=!1,S,M,$=y===void 0?null:y;return[function(){return N(v())},$===null?void 0:function(){return N($())}]},[v,y,x,C]);var _=a(g,E[0],E[1]);return u(function(){k.hasValue=!0,k.value=_},[_]),m(_),_},Qc}var Wh;function Q1(){return Wh||(Wh=1,Kc.exports=K1()),Kc.exports}var q1=Q1();const Z1=vu(q1),J1={},Uh=t=>{let r;const i=new Set,s=(v,y)=>{const x=typeof v=="function"?v(r):v;if(!Object.is(x,r)){const C=r;r=y??(typeof x!="object"||x===null)?x:Object.assign({},r,x),i.forEach(E=>E(r,C))}},a=()=>r,m={setState:s,getState:a,getInitialState:()=>g,subscribe:v=>(i.add(v),()=>i.delete(v)),destroy:()=>{(J1?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},g=r=t(s,a,m);return m},eS=t=>t?Uh(t):Uh,{useDebugValue:tS}=jp,{useSyncExternalStoreWithSelector:nS}=Z1,rS=t=>t;function Lm(t,r=rS,i){const s=nS(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return tS(s),s}const Yh=(t,r)=>{const i=eS(t),s=(a,c=r)=>Lm(i,a,c);return Object.assign(s,i),s},iS=(t,r)=>t?Yh(t,r):Yh;function Ze(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[s,a]of t)if(!Object.is(a,r.get(s)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const s of t)if(!r.has(s))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(r,s)||!Object.is(t[s],r[s]))return!1;return!0}bp();const oa=b.createContext(null),oS=oa.Provider,Dm=Bn.error001();function Oe(t,r){const i=b.useContext(oa);if(i===null)throw new Error(Dm);return Lm(i,t,r)}function Je(){const t=b.useContext(oa);if(t===null)throw new Error(Dm);return b.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Xh={display:"none"},sS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},$m="react-flow__node-desc",Om="react-flow__edge-desc",lS="react-flow__aria-live",aS=t=>t.ariaLiveMessage,cS=t=>t.ariaLabelConfig;function uS({rfId:t}){const r=Oe(aS);return d.jsx("div",{id:`${lS}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:sS,children:r})}function dS({rfId:t,disableKeyboardA11y:r}){const i=Oe(cS);return d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`${$m}-${t}`,style:Xh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${Om}-${t}`,style:Xh,children:i["edge.a11yDescription.default"]}),!r&&d.jsx(uS,{rfId:t})]})}const sa=b.forwardRef(({position:t="top-left",children:r,className:i,style:s,...a},c)=>{const u=`${t}`.split("-");return d.jsx("div",{className:ct(["react-flow__panel",i,...u]),style:s,ref:c,...a,children:r})});sa.displayName="Panel";function fS({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:d.jsx(sa,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:d.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const hS=t=>{const r=[],i=[];for(const[,s]of t.nodeLookup)s.selected&&r.push(s.internals.userNode);for(const[,s]of t.edgeLookup)s.selected&&i.push(s);return{selectedNodes:r,selectedEdges:i}},Tl=t=>t.id;function pS(t,r){return Ze(t.selectedNodes.map(Tl),r.selectedNodes.map(Tl))&&Ze(t.selectedEdges.map(Tl),r.selectedEdges.map(Tl))}function mS({onSelectionChange:t}){const r=Je(),{selectedNodes:i,selectedEdges:s}=Oe(hS,pS);return b.useEffect(()=>{const a={nodes:i,edges:s};t==null||t(a),r.getState().onSelectionChangeHandlers.forEach(c=>c(a))},[i,s,t]),null}const gS=t=>!!t.onSelectionChangeHandlers;function yS({onSelectionChange:t}){const r=Oe(gS);return t||r?d.jsx(mS,{onSelectionChange:t}):null}const Fm=[0,0],vS={x:0,y:0,zoom:1},xS=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Gh=[...xS,"rfId"],wS=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),Kh={translateExtent:cs,nodeOrigin:Fm,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function SS(t){const{setNodes:r,setEdges:i,setMinZoom:s,setMaxZoom:a,setTranslateExtent:c,setNodeExtent:u,reset:h,setDefaultNodesAndEdges:m}=Oe(wS,Ze),g=Je();b.useEffect(()=>(m(t.defaultNodes,t.defaultEdges),()=>{v.current=Kh,h()}),[]);const v=b.useRef(Kh);return b.useEffect(()=>{for(const y of Gh){const x=t[y],C=v.current[y];x!==C&&(typeof t[y]>"u"||(y==="nodes"?r(x):y==="edges"?i(x):y==="minZoom"?s(x):y==="maxZoom"?a(x):y==="translateExtent"?c(x):y==="nodeExtent"?u(x):y==="ariaLabelConfig"?g.setState({ariaLabelConfig:r1(x)}):y==="fitView"?g.setState({fitViewQueued:x}):y==="fitViewOptions"?g.setState({fitViewOptions:x}):g.setState({[y]:x})))}v.current=t},Gh.map(y=>t[y])),null}function Qh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function kS(t){var s;const[r,i]=b.useState(t==="system"?null:t);return b.useEffect(()=>{if(t!=="system"){i(t);return}const a=Qh(),c=()=>i(a!=null&&a.matches?"dark":"light");return c(),a==null||a.addEventListener("change",c),()=>{a==null||a.removeEventListener("change",c)}},[t]),r!==null?r:(s=Qh())!=null&&s.matches?"dark":"light"}const qh=typeof document<"u"?document:null;function ps(t=null,r={target:qh,actInsideInputWithModifier:!0}){const[i,s]=b.useState(!1),a=b.useRef(!1),c=b.useRef(new Set([])),[u,h]=b.useMemo(()=>{if(t!==null){const g=(Array.isArray(t)?t:[t]).filter(y=>typeof y=="string").map(y=>y.replace("+",`
57
+ `).replace(`
58
+
59
+ `,`
60
+ +`).split(`
61
+ `)),v=g.reduce((y,x)=>y.concat(...x),[]);return[g,v]}return[[],[]]},[t]);return b.useEffect(()=>{const m=(r==null?void 0:r.target)??qh,g=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const v=C=>{var _,N;if(a.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!a.current||a.current&&!g)&&ym(C))return!1;const k=Jh(C.code,h);if(c.current.add(C[k]),Zh(u,c.current,!1)){const j=((N=(_=C.composedPath)==null?void 0:_.call(C))==null?void 0:N[0])||C.target,S=(j==null?void 0:j.nodeName)==="BUTTON"||(j==null?void 0:j.nodeName)==="A";r.preventDefault!==!1&&(a.current||!S)&&C.preventDefault(),s(!0)}},y=C=>{const E=Jh(C.code,h);Zh(u,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(C[E]),C.key==="Meta"&&c.current.clear(),a.current=!1},x=()=>{c.current.clear(),s(!1)};return m==null||m.addEventListener("keydown",v),m==null||m.addEventListener("keyup",y),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{m==null||m.removeEventListener("keydown",v),m==null||m.removeEventListener("keyup",y),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[t,s]),i}function Zh(t,r,i){return t.filter(s=>i||s.length===r.size).some(s=>s.every(a=>r.has(a)))}function Jh(t,r){return r.includes(t)?"code":"key"}const NS=()=>{const t=Je();return b.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:s}=t.getState();return s?s.scaleTo(r,{duration:i==null?void 0:i.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[s,a,c],panZoom:u}=t.getState();return u?(await u.setViewport({x:r.x??s,y:r.y??a,zoom:r.zoom??c},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,s]=t.getState().transform;return{x:r,y:i,zoom:s}},setCenter:async(r,i,s)=>t.getState().setCenter(r,i,s),fitBounds:async(r,i)=>{const{width:s,height:a,minZoom:c,maxZoom:u,panZoom:h}=t.getState(),m=bu(r,s,a,c,u,(i==null?void 0:i.padding)??.1);return h?(await h.setViewport(m,{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:s,snapGrid:a,snapToGrid:c,domNode:u}=t.getState();if(!u)return r;const{x:h,y:m}=u.getBoundingClientRect(),g={x:r.x-h,y:r.y-m},v=i.snapGrid??a,y=i.snapToGrid??c;return Ss(g,s,y,v)},flowToScreenPosition:r=>{const{transform:i,domNode:s}=t.getState();if(!s)return r;const{x:a,y:c}=s.getBoundingClientRect(),u=Xl(r,i);return{x:u.x+a,y:u.y+c}}}),[])};function Hm(t,r){const i=[],s=new Map,a=[];for(const c of t)if(c.type==="add"){a.push(c);continue}else if(c.type==="remove"||c.type==="replace")s.set(c.id,[c]);else{const u=s.get(c.id);u?u.push(c):s.set(c.id,[c])}for(const c of r){const u=s.get(c.id);if(!u){i.push(c);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){i.push({...u[0].item});continue}const h={...c};for(const m of u)ES(m,h);i.push(h)}return a.length&&a.forEach(c=>{c.index!==void 0?i.splice(c.index,0,{...c.item}):i.push({...c.item})}),i}function ES(t,r){switch(t.type){case"select":{r.selected=t.selected;break}case"position":{typeof t.position<"u"&&(r.position=t.position),typeof t.dragging<"u"&&(r.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(r.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(r.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(r.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(r.resizing=t.resizing);break}}}function Bm(t,r){return Hm(t,r)}function Vm(t,r){return Hm(t,r)}function pi(t,r){return{id:t,type:"select",selected:r}}function uo(t,r=new Set,i=!1){const s=[];for(const[a,c]of t){const u=r.has(a);!(c.selected===void 0&&!u)&&c.selected!==u&&(i&&(c.selected=u),s.push(pi(c.id,u)))}return s}function ep({items:t=[],lookup:r}){var a;const i=[],s=new Map(t.map(c=>[c.id,c]));for(const[c,u]of t.entries()){const h=r.get(u.id),m=((a=h==null?void 0:h.internals)==null?void 0:a.userNode)??h;m!==void 0&&m!==u&&i.push({id:u.id,item:u,type:"replace"}),m===void 0&&i.push({item:u,type:"add",index:c})}for(const[c]of r)s.get(c)===void 0&&i.push({id:c,type:"remove"});return i}function tp(t){return{id:t.id,type:"remove"}}const np=t=>Xw(t),CS=t=>cm(t);function Wm(t){return b.forwardRef(t)}const _S=typeof window<"u"?b.useLayoutEffect:b.useEffect;function rp(t){const[r,i]=b.useState(BigInt(0)),[s]=b.useState(()=>jS(()=>i(a=>a+BigInt(1))));return _S(()=>{const a=s.get();a.length&&(t(a),s.reset())},[r]),s}function jS(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const Um=b.createContext(null);function bS({children:t}){const r=Je(),i=b.useCallback(h=>{const{nodes:m=[],setNodes:g,hasDefaultNodes:v,onNodesChange:y,nodeLookup:x,fitViewQueued:C,onNodesChangeMiddlewareMap:E}=r.getState();let k=m;for(const N of h)k=typeof N=="function"?N(k):N;let _=ep({items:k,lookup:x});for(const N of E.values())_=N(_);v&&g(k),_.length>0?y==null||y(_):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:j,setNodes:S}=r.getState();N&&S(j)})},[]),s=rp(i),a=b.useCallback(h=>{const{edges:m=[],setEdges:g,hasDefaultEdges:v,onEdgesChange:y,edgeLookup:x}=r.getState();let C=m;for(const E of h)C=typeof E=="function"?E(C):E;v?g(C):y&&y(ep({items:C,lookup:x}))},[]),c=rp(a),u=b.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return d.jsx(Um.Provider,{value:u,children:t})}function MS(){const t=b.useContext(Um);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const PS=t=>!!t.panZoom;function Au(){const t=NS(),r=Je(),i=MS(),s=Oe(PS),a=b.useMemo(()=>{const c=y=>r.getState().nodeLookup.get(y),u=y=>{i.nodeQueue.push(y)},h=y=>{i.edgeQueue.push(y)},m=y=>{var N,j;const{nodeLookup:x,nodeOrigin:C}=r.getState(),E=np(y)?y:x.get(y.id),k=E.parentId?mm(E.position,E.measured,E.parentId,x,C):E.position,_={...E,position:k,width:((N=E.measured)==null?void 0:N.width)??E.width,height:((j=E.measured)==null?void 0:j.height)??E.height};return yo(_)},g=(y,x,C={replace:!1})=>{u(E=>E.map(k=>{if(k.id===y){const _=typeof x=="function"?x(k):x;return C.replace&&np(_)?_:{...k,..._}}return k}))},v=(y,x,C={replace:!1})=>{h(E=>E.map(k=>{if(k.id===y){const _=typeof x=="function"?x(k):x;return C.replace&&CS(_)?_:{...k,..._}}return k}))};return{getNodes:()=>r.getState().nodes.map(y=>({...y})),getNode:y=>{var x;return(x=c(y))==null?void 0:x.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:y=[]}=r.getState();return y.map(x=>({...x}))},getEdge:y=>r.getState().edgeLookup.get(y),setNodes:u,setEdges:h,addNodes:y=>{const x=Array.isArray(y)?y:[y];i.nodeQueue.push(C=>[...C,...x])},addEdges:y=>{const x=Array.isArray(y)?y:[y];i.edgeQueue.push(C=>[...C,...x])},toObject:()=>{const{nodes:y=[],edges:x=[],transform:C}=r.getState(),[E,k,_]=C;return{nodes:y.map(N=>({...N})),edges:x.map(N=>({...N})),viewport:{x:E,y:k,zoom:_}}},deleteElements:async({nodes:y=[],edges:x=[]})=>{const{nodes:C,edges:E,onNodesDelete:k,onEdgesDelete:_,triggerNodeChanges:N,triggerEdgeChanges:j,onDelete:S,onBeforeDelete:M}=r.getState(),{nodes:$,edges:L}=await Zw({nodesToRemove:y,edgesToRemove:x,nodes:C,edges:E,onBeforeDelete:M}),H=L.length>0,Z=$.length>0;if(H){const B=L.map(tp);_==null||_(L),j(B)}if(Z){const B=$.map(tp);k==null||k($),N(B)}return(Z||H)&&(S==null||S({nodes:$,edges:L})),{deletedNodes:$,deletedEdges:L}},getIntersectingNodes:(y,x=!0,C)=>{const E=bh(y),k=E?y:m(y),_=C!==void 0;return k?(C||r.getState().nodes).filter(N=>{const j=r.getState().nodeLookup.get(N.id);if(j&&!E&&(N.id===y.id||!j.internals.positionAbsolute))return!1;const S=yo(_?N:j),M=fs(S,k);return x&&M>0||M>=S.width*S.height||M>=k.width*k.height}):[]},isNodeIntersecting:(y,x,C=!0)=>{const k=bh(y)?y:m(y);if(!k)return!1;const _=fs(k,x);return C&&_>0||_>=x.width*x.height||_>=k.width*k.height},updateNode:g,updateNodeData:(y,x,C={replace:!1})=>{g(y,E=>{const k=typeof x=="function"?x(E):x;return C.replace?{...E,data:k}:{...E,data:{...E.data,...k}}},C)},updateEdge:v,updateEdgeData:(y,x,C={replace:!1})=>{v(y,E=>{const k=typeof x=="function"?x(E):x;return C.replace?{...E,data:k}:{...E,data:{...E.data,...k}}},C)},getNodesBounds:y=>{const{nodeLookup:x,nodeOrigin:C}=r.getState();return Gw(y,{nodeLookup:x,nodeOrigin:C})},getHandleConnections:({type:y,id:x,nodeId:C})=>{var E;return Array.from(((E=r.getState().connectionLookup.get(`${C}-${y}${x?`-${x}`:""}`))==null?void 0:E.values())??[])},getNodeConnections:({type:y,handleId:x,nodeId:C})=>{var E;return Array.from(((E=r.getState().connectionLookup.get(`${C}${y?x?`-${y}-${x}`:`-${y}`:""}`))==null?void 0:E.values())??[])},fitView:async y=>{const x=r.getState().fitViewResolver??n1();return r.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:x}),i.nodeQueue.push(C=>[...C]),x.promise}}},[]);return b.useMemo(()=>({...a,...t,viewportInitialized:s}),[s])}const ip=t=>t.selected,IS=typeof window<"u"?window:void 0;function TS({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=Je(),{deleteElements:s}=Au(),a=ps(t,{actInsideInputWithModifier:!1}),c=ps(r,{target:IS});b.useEffect(()=>{if(a){const{edges:u,nodes:h}=i.getState();s({nodes:h.filter(ip),edges:u.filter(ip)}),i.setState({nodesSelectionActive:!1})}},[a]),b.useEffect(()=>{i.setState({multiSelectionActive:c})},[c])}function RS(t){const r=Je();b.useEffect(()=>{const i=()=>{var a,c,u,h;if(!t.current||!(((c=(a=t.current).checkVisibility)==null?void 0:c.call(a))??!0))return!1;const s=Mu(t.current);(s.height===0||s.width===0)&&((h=(u=r.getState()).onError)==null||h.call(u,"004",Bn.error004())),r.setState({width:s.width||500,height:s.height||500})};if(t.current){i(),window.addEventListener("resize",i);const s=new ResizeObserver(()=>i());return s.observe(t.current),()=>{window.removeEventListener("resize",i),s&&t.current&&s.unobserve(t.current)}}},[])}const la={position:"absolute",width:"100%",height:"100%",top:0,left:0},zS=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function AS({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:c=yi.Free,zoomOnDoubleClick:u=!0,panOnDrag:h=!0,defaultViewport:m,translateExtent:g,minZoom:v,maxZoom:y,zoomActivationKeyCode:x,preventScrolling:C=!0,children:E,noWheelClassName:k,noPanClassName:_,onViewportChange:N,isControlledViewport:j,paneClickDistance:S,selectionOnDrag:M}){const $=Je(),L=b.useRef(null),{userSelectionActive:H,lib:Z,connectionInProgress:B}=Oe(zS,Ze),J=ps(x),W=b.useRef();RS(L);const G=b.useCallback(te=>{N==null||N({x:te[0],y:te[1],zoom:te[2]}),j||$.setState({transform:te})},[N,j]);return b.useEffect(()=>{if(L.current){W.current=$1({domNode:L.current,minZoom:v,maxZoom:y,translateExtent:g,viewport:m,onDraggingChange:T=>$.setState({paneDragging:T}),onPanZoomStart:(T,K)=>{const{onViewportChangeStart:R,onMoveStart:A}=$.getState();A==null||A(T,K),R==null||R(K)},onPanZoom:(T,K)=>{const{onViewportChange:R,onMove:A}=$.getState();A==null||A(T,K),R==null||R(K)},onPanZoomEnd:(T,K)=>{const{onViewportChangeEnd:R,onMoveEnd:A}=$.getState();A==null||A(T,K),R==null||R(K)}});const{x:te,y:z,zoom:Q}=W.current.getViewport();return $.setState({panZoom:W.current,transform:[te,z,Q],domNode:L.current.closest(".react-flow")}),()=>{var T;(T=W.current)==null||T.destroy()}}},[]),b.useEffect(()=>{var te;(te=W.current)==null||te.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:a,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:h,zoomActivationKeyPressed:J,preventScrolling:C,noPanClassName:_,userSelectionActive:H,noWheelClassName:k,lib:Z,onTransformChange:G,connectionInProgress:B,selectionOnDrag:M,paneClickDistance:S})},[t,r,i,s,a,c,u,h,J,C,_,H,k,Z,G,B,M,S]),d.jsx("div",{className:"react-flow__renderer",ref:L,style:la,children:E})}const LS=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function DS(){const{userSelectionActive:t,userSelectionRect:r}=Oe(LS,Ze);return t&&r?d.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 Jc=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},$S=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function OS({isSelecting:t,selectionKeyPressed:r,selectionMode:i=us.Full,panOnDrag:s,paneClickDistance:a,selectionOnDrag:c,onSelectionStart:u,onSelectionEnd:h,onPaneClick:m,onPaneContextMenu:g,onPaneScroll:v,onPaneMouseEnter:y,onPaneMouseMove:x,onPaneMouseLeave:C,children:E}){const k=Je(),{userSelectionActive:_,elementsSelectable:N,dragging:j,connectionInProgress:S}=Oe($S,Ze),M=N&&(t||_),$=b.useRef(null),L=b.useRef(),H=b.useRef(new Set),Z=b.useRef(new Set),B=b.useRef(!1),J=R=>{if(B.current||S){B.current=!1;return}m==null||m(R),k.getState().resetSelectedElements(),k.setState({nodesSelectionActive:!1})},W=R=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){R.preventDefault();return}g==null||g(R)},G=v?R=>v(R):void 0,te=R=>{B.current&&(R.stopPropagation(),B.current=!1)},z=R=>{var he,de;const{domNode:A}=k.getState();if(L.current=A==null?void 0:A.getBoundingClientRect(),!L.current)return;const U=R.target===$.current;if(!U&&!!R.target.closest(".nokey")||!t||!(c&&U||r)||R.button!==0||!R.isPrimary)return;(de=(he=R.target)==null?void 0:he.setPointerCapture)==null||de.call(he,R.pointerId),B.current=!1;const{x:oe,y:se}=Cn(R.nativeEvent,L.current);k.setState({userSelectionRect:{width:0,height:0,startX:oe,startY:se,x:oe,y:se}}),U||(R.stopPropagation(),R.preventDefault())},Q=R=>{const{userSelectionRect:A,transform:U,nodeLookup:P,edgeLookup:O,connectionLookup:oe,triggerNodeChanges:se,triggerEdgeChanges:he,defaultEdgeOptions:de,resetSelectedElements:pe}=k.getState();if(!L.current||!A)return;const{x:ie,y:me}=Cn(R.nativeEvent,L.current),{startX:ke,startY:je}=A;if(!B.current){const Ae=r?0:a;if(Math.hypot(ie-ke,me-je)<=Ae)return;pe(),u==null||u(R)}B.current=!0;const be={startX:ke,startY:je,x:ie<ke?ie:ke,y:me<je?me:je,width:Math.abs(ie-ke),height:Math.abs(me-je)},Ne=H.current,ze=Z.current;H.current=new Set(ju(P,be,U,i===us.Partial,!0).map(Ae=>Ae.id)),Z.current=new Set;const Be=(de==null?void 0:de.selectable)??!0;for(const Ae of H.current){const et=oe.get(Ae);if(et)for(const{edgeId:Mt}of et.values()){const pt=O.get(Mt);pt&&(pt.selectable??Be)&&Z.current.add(Mt)}}if(!Mh(Ne,H.current)){const Ae=uo(P,H.current,!0);se(Ae)}if(!Mh(ze,Z.current)){const Ae=uo(O,Z.current);he(Ae)}k.setState({userSelectionRect:be,userSelectionActive:!0,nodesSelectionActive:!1})},T=R=>{var A,U;R.button===0&&((U=(A=R.target)==null?void 0:A.releasePointerCapture)==null||U.call(A,R.pointerId),!_&&R.target===$.current&&k.getState().userSelectionRect&&(J==null||J(R)),k.setState({userSelectionActive:!1,userSelectionRect:null}),B.current&&(h==null||h(R),k.setState({nodesSelectionActive:H.current.size>0})))},K=s===!0||Array.isArray(s)&&s.includes(0);return d.jsxs("div",{className:ct(["react-flow__pane",{draggable:K,dragging:j,selection:t}]),onClick:M?void 0:Jc(J,$),onContextMenu:Jc(W,$),onWheel:Jc(G,$),onPointerEnter:M?void 0:y,onPointerMove:M?Q:x,onPointerUp:M?T:void 0,onPointerDownCapture:M?z:void 0,onClickCapture:M?te:void 0,onPointerLeave:C,ref:$,style:la,children:[E,d.jsx(DS,{})]})}function gu({id:t,store:r,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:a,unselectNodesAndEdges:c,multiSelectionActive:u,nodeLookup:h,onError:m}=r.getState(),g=h.get(t);if(!g){m==null||m("012",Bn.error012(t));return}r.setState({nodesSelectionActive:!1}),g.selected?(i||g.selected&&u)&&(c({nodes:[g],edges:[]}),requestAnimationFrame(()=>{var v;return(v=s==null?void 0:s.current)==null?void 0:v.blur()})):a([t])}function Ym({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:s,nodeId:a,isSelectable:c,nodeClickDistance:u}){const h=Je(),[m,g]=b.useState(!1),v=b.useRef();return b.useEffect(()=>{v.current=E1({getStoreItems:()=>h.getState(),onNodeMouseDown:y=>{gu({id:y,store:h,nodeRef:t})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),b.useEffect(()=>{var y,x;if(r)(y=v.current)==null||y.destroy();else if(t.current)return(x=v.current)==null||x.update({noDragClassName:i,handleSelector:s,domNode:t.current,isSelectable:c,nodeId:a,nodeClickDistance:u}),()=>{var C;(C=v.current)==null||C.destroy()}},[i,s,r,c,t,a]),m}const FS=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Xm(){const t=Je();return b.useCallback(i=>{const{nodeExtent:s,snapToGrid:a,snapGrid:c,nodesDraggable:u,onError:h,updateNodePositions:m,nodeLookup:g,nodeOrigin:v}=t.getState(),y=new Map,x=FS(u),C=a?c[0]:5,E=a?c[1]:5,k=i.direction.x*C*i.factor,_=i.direction.y*E*i.factor;for(const[,N]of g){if(!x(N))continue;let j={x:N.internals.positionAbsolute.x+k,y:N.internals.positionAbsolute.y+_};a&&(j=ws(j,c));const{position:S,positionAbsolute:M}=um({nodeId:N.id,nextPosition:j,nodeLookup:g,nodeExtent:s,nodeOrigin:v,onError:h});N.position=S,N.internals.positionAbsolute=M,y.set(N.id,N)}m(y)},[])}const Lu=b.createContext(null),HS=Lu.Provider;Lu.Consumer;const Gm=()=>b.useContext(Lu),BS=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),VS=(t,r,i)=>s=>{const{connectionClickStartHandle:a,connectionMode:c,connection:u}=s,{fromHandle:h,toHandle:m,isValid:g}=u,v=(m==null?void 0:m.nodeId)===t&&(m==null?void 0:m.id)===r&&(m==null?void 0:m.type)===i;return{connectingFrom:(h==null?void 0:h.nodeId)===t&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===i,connectingTo:v,clickConnecting:(a==null?void 0:a.nodeId)===t&&(a==null?void 0:a.id)===r&&(a==null?void 0:a.type)===i,isPossibleEndHandle:c===Si.Strict?(h==null?void 0:h.type)!==i:t!==(h==null?void 0:h.nodeId)||r!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!a,valid:v&&g}};function WS({type:t="source",position:r=_e.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:a=!0,isConnectableEnd:c=!0,id:u,onConnect:h,children:m,className:g,onMouseDown:v,onTouchStart:y,...x},C){var Q,T;const E=u||null,k=t==="target",_=Je(),N=Gm(),{connectOnClick:j,noPanClassName:S,rfId:M}=Oe(BS,Ze),{connectingFrom:$,connectingTo:L,clickConnecting:H,isPossibleEndHandle:Z,connectionInProcess:B,clickConnectionInProcess:J,valid:W}=Oe(VS(N,E,t),Ze);N||(T=(Q=_.getState()).onError)==null||T.call(Q,"010",Bn.error010());const G=K=>{const{defaultEdgeOptions:R,onConnect:A,hasDefaultEdges:U}=_.getState(),P={...R,...K};if(U){const{edges:O,setEdges:oe}=_.getState();oe(Nm(P,O))}A==null||A(P),h==null||h(P)},te=K=>{if(!N)return;const R=vm(K.nativeEvent);if(a&&(R&&K.button===0||!R)){const A=_.getState();mu.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:A.autoPanOnConnect,connectionMode:A.connectionMode,connectionRadius:A.connectionRadius,domNode:A.domNode,nodeLookup:A.nodeLookup,lib:A.lib,isTarget:k,handleId:E,nodeId:N,flowId:A.rfId,panBy:A.panBy,cancelConnection:A.cancelConnection,onConnectStart:A.onConnectStart,onConnectEnd:A.onConnectEnd,updateConnection:A.updateConnection,onConnect:G,isValidConnection:i||A.isValidConnection,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:A.autoPanSpeed,dragThreshold:A.connectionDragThreshold})}R?v==null||v(K):y==null||y(K)},z=K=>{const{onClickConnectStart:R,onClickConnectEnd:A,connectionClickStartHandle:U,connectionMode:P,isValidConnection:O,lib:oe,rfId:se,nodeLookup:he,connection:de}=_.getState();if(!N||!U&&!a)return;if(!U){R==null||R(K.nativeEvent,{nodeId:N,handleId:E,handleType:t}),_.setState({connectionClickStartHandle:{nodeId:N,type:t,id:E}});return}const pe=gm(K.target),ie=i||O,{connection:me,isValid:ke}=mu.isValid(K.nativeEvent,{handle:{nodeId:N,id:E,type:t},connectionMode:P,fromNodeId:U.nodeId,fromHandleId:U.id||null,fromType:U.type,isValidConnection:ie,flowId:se,doc:pe,lib:oe,nodeLookup:he});ke&&me&&G(me);const je=structuredClone(de);delete je.inProgress,je.toPosition=je.toHandle?je.toHandle.position:null,A==null||A(K,je),_.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":E,"data-nodeid":N,"data-handlepos":r,"data-id":`${M}-${N}-${E}-${t}`,className:ct(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",S,g,{source:!k,target:k,connectable:s,connectablestart:a,connectableend:c,clickconnecting:H,connectingfrom:$,connectingto:L,valid:W,connectionindicator:s&&(!B||Z)&&(B||J?c:a)}]),onMouseDown:te,onTouchStart:te,onClick:j?z:void 0,ref:C,...x,children:m})}const Ur=b.memo(Wm(WS));function US({data:t,isConnectable:r,sourcePosition:i=_e.Bottom}){return d.jsxs(d.Fragment,{children:[t==null?void 0:t.label,d.jsx(Ur,{type:"source",position:i,isConnectable:r})]})}function YS({data:t,isConnectable:r,targetPosition:i=_e.Top,sourcePosition:s=_e.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(Ur,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,d.jsx(Ur,{type:"source",position:s,isConnectable:r})]})}function XS(){return null}function GS({data:t,isConnectable:r,targetPosition:i=_e.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(Ur,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const Gl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},op={input:US,default:YS,output:GS,group:XS};function KS(t){var r,i,s,a;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((r=t.style)==null?void 0:r.width),height:t.height??t.initialHeight??((i=t.style)==null?void 0:i.height)}:{width:t.width??((s=t.style)==null?void 0:s.width),height:t.height??((a=t.style)==null?void 0:a.height)}}const QS=t=>{const{width:r,height:i,x:s,y:a}=xs(t.nodeLookup,{filter:c=>!!c.selected});return{width:En(r)?r:null,height:En(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${a}px)`}};function qS({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const s=Je(),{width:a,height:c,transformString:u,userSelectionActive:h}=Oe(QS,Ze),m=Xm(),g=b.useRef(null);if(b.useEffect(()=>{var x;i||(x=g.current)==null||x.focus({preventScroll:!0})},[i]),Ym({nodeRef:g}),h||!a||!c)return null;const v=t?x=>{const C=s.getState().nodes.filter(E=>E.selected);t(x,C)}:void 0,y=x=>{Object.prototype.hasOwnProperty.call(Gl,x.key)&&(x.preventDefault(),m({direction:Gl[x.key],factor:x.shiftKey?4:1}))};return d.jsx("div",{className:ct(["react-flow__nodesselection","react-flow__container",r]),style:{transform:u},children:d.jsx("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:v,tabIndex:i?void 0:-1,onKeyDown:i?void 0:y,style:{width:a,height:c}})})}const sp=typeof window<"u"?window:void 0,ZS=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Km({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:h,deleteKeyCode:m,selectionKeyCode:g,selectionOnDrag:v,selectionMode:y,onSelectionStart:x,onSelectionEnd:C,multiSelectionKeyCode:E,panActivationKeyCode:k,zoomActivationKeyCode:_,elementsSelectable:N,zoomOnScroll:j,zoomOnPinch:S,panOnScroll:M,panOnScrollSpeed:$,panOnScrollMode:L,zoomOnDoubleClick:H,panOnDrag:Z,defaultViewport:B,translateExtent:J,minZoom:W,maxZoom:G,preventScrolling:te,onSelectionContextMenu:z,noWheelClassName:Q,noPanClassName:T,disableKeyboardA11y:K,onViewportChange:R,isControlledViewport:A}){const{nodesSelectionActive:U,userSelectionActive:P}=Oe(ZS,Ze),O=ps(g,{target:sp}),oe=ps(k,{target:sp}),se=oe||Z,he=oe||M,de=v&&se!==!0,pe=O||P||de;return TS({deleteKeyCode:m,multiSelectionKeyCode:E}),d.jsx(AS,{onPaneContextMenu:c,elementsSelectable:N,zoomOnScroll:j,zoomOnPinch:S,panOnScroll:he,panOnScrollSpeed:$,panOnScrollMode:L,zoomOnDoubleClick:H,panOnDrag:!O&&se,defaultViewport:B,translateExtent:J,minZoom:W,maxZoom:G,zoomActivationKeyCode:_,preventScrolling:te,noWheelClassName:Q,noPanClassName:T,onViewportChange:R,isControlledViewport:A,paneClickDistance:h,selectionOnDrag:de,children:d.jsxs(OS,{onSelectionStart:x,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:se,isSelecting:!!pe,selectionMode:y,selectionKeyPressed:O,paneClickDistance:h,selectionOnDrag:de,children:[t,U&&d.jsx(qS,{onSelectionContextMenu:z,noPanClassName:T,disableKeyboardA11y:K})]})})}Km.displayName="FlowRenderer";const JS=b.memo(Km),ek=t=>r=>t?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 tk(t){return Oe(b.useCallback(ek(t),[t]),Ze)}const nk=t=>t.updateNodeInternals;function rk(){const t=Oe(nk),[r]=b.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(a=>{const c=a.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:a.target,force:!0})}),t(s)}));return b.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function ik({node:t,nodeType:r,hasDimensions:i,resizeObserver:s}){const a=Je(),c=b.useRef(null),u=b.useRef(null),h=b.useRef(t.sourcePosition),m=b.useRef(t.targetPosition),g=b.useRef(r),v=i&&!!t.internals.handleBounds;return b.useEffect(()=>{c.current&&!t.hidden&&(!v||u.current!==c.current)&&(u.current&&(s==null||s.unobserve(u.current)),s==null||s.observe(c.current),u.current=c.current)},[v,t.hidden]),b.useEffect(()=>()=>{u.current&&(s==null||s.unobserve(u.current),u.current=null)},[]),b.useEffect(()=>{if(c.current){const y=g.current!==r,x=h.current!==t.sourcePosition,C=m.current!==t.targetPosition;(y||x||C)&&(g.current=r,h.current=t.sourcePosition,m.current=t.targetPosition,a.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),c}function ok({id:t,onClick:r,onMouseEnter:i,onMouseMove:s,onMouseLeave:a,onContextMenu:c,onDoubleClick:u,nodesDraggable:h,elementsSelectable:m,nodesConnectable:g,nodesFocusable:v,resizeObserver:y,noDragClassName:x,noPanClassName:C,disableKeyboardA11y:E,rfId:k,nodeTypes:_,nodeClickDistance:N,onError:j}){const{node:S,internals:M,isParent:$}=Oe(ie=>{const me=ie.nodeLookup.get(t),ke=ie.parentLookup.has(t);return{node:me,internals:me.internals,isParent:ke}},Ze);let L=S.type||"default",H=(_==null?void 0:_[L])||op[L];H===void 0&&(j==null||j("003",Bn.error003(L)),L="default",H=(_==null?void 0:_.default)||op.default);const Z=!!(S.draggable||h&&typeof S.draggable>"u"),B=!!(S.selectable||m&&typeof S.selectable>"u"),J=!!(S.connectable||g&&typeof S.connectable>"u"),W=!!(S.focusable||v&&typeof S.focusable>"u"),G=Je(),te=pm(S),z=ik({node:S,nodeType:L,hasDimensions:te,resizeObserver:y}),Q=Ym({nodeRef:z,disabled:S.hidden||!Z,noDragClassName:x,handleSelector:S.dragHandle,nodeId:t,isSelectable:B,nodeClickDistance:N}),T=Xm();if(S.hidden)return null;const K=fr(S),R=KS(S),A=B||Z||r||i||s||a,U=i?ie=>i(ie,{...M.userNode}):void 0,P=s?ie=>s(ie,{...M.userNode}):void 0,O=a?ie=>a(ie,{...M.userNode}):void 0,oe=c?ie=>c(ie,{...M.userNode}):void 0,se=u?ie=>u(ie,{...M.userNode}):void 0,he=ie=>{const{selectNodesOnDrag:me,nodeDragThreshold:ke}=G.getState();B&&(!me||!Z||ke>0)&&gu({id:t,store:G,nodeRef:z}),r&&r(ie,{...M.userNode})},de=ie=>{if(!(ym(ie.nativeEvent)||E)){if(om.includes(ie.key)&&B){const me=ie.key==="Escape";gu({id:t,store:G,unselect:me,nodeRef:z})}else if(Z&&S.selected&&Object.prototype.hasOwnProperty.call(Gl,ie.key)){ie.preventDefault();const{ariaLabelConfig:me}=G.getState();G.setState({ariaLiveMessage:me["node.a11yDescription.ariaLiveMessage"]({direction:ie.key.replace("Arrow","").toLowerCase(),x:~~M.positionAbsolute.x,y:~~M.positionAbsolute.y})}),T({direction:Gl[ie.key],factor:ie.shiftKey?4:1})}}},pe=()=>{var ze;if(E||!((ze=z.current)!=null&&ze.matches(":focus-visible")))return;const{transform:ie,width:me,height:ke,autoPanOnNodeFocus:je,setCenter:be}=G.getState();if(!je)return;ju(new Map([[t,S]]),{x:0,y:0,width:me,height:ke},ie,!0).length>0||be(S.position.x+K.width/2,S.position.y+K.height/2,{zoom:ie[2]})};return d.jsx("div",{className:ct(["react-flow__node",`react-flow__node-${L}`,{[C]:Z},S.className,{selected:S.selected,selectable:B,parent:$,draggable:Z,dragging:Q}]),ref:z,style:{zIndex:M.z,transform:`translate(${M.positionAbsolute.x}px,${M.positionAbsolute.y}px)`,pointerEvents:A?"all":"none",visibility:te?"visible":"hidden",...S.style,...R},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:U,onMouseMove:P,onMouseLeave:O,onContextMenu:oe,onClick:he,onDoubleClick:se,onKeyDown:W?de:void 0,tabIndex:W?0:void 0,onFocus:W?pe:void 0,role:S.ariaRole??(W?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${$m}-${k}`,"aria-label":S.ariaLabel,...S.domAttributes,children:d.jsx(HS,{value:t,children:d.jsx(H,{id:t,data:S.data,type:L,positionAbsoluteX:M.positionAbsolute.x,positionAbsoluteY:M.positionAbsolute.y,selected:S.selected??!1,selectable:B,draggable:Z,deletable:S.deletable??!0,isConnectable:J,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:Q,dragHandle:S.dragHandle,zIndex:M.z,parentId:S.parentId,...K})})})}var sk=b.memo(ok);const lk=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Qm(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:a,onError:c}=Oe(lk,Ze),u=tk(t.onlyRenderVisibleElements),h=rk();return d.jsx("div",{className:"react-flow__nodes",style:la,children:u.map(m=>d.jsx(sk,{id:m,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:h,nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:a,nodeClickDistance:t.nodeClickDistance,onError:c},m))})}Qm.displayName="NodeRenderer";const ak=b.memo(Qm);function ck(t){return Oe(b.useCallback(i=>{if(!t)return i.edges.map(a=>a.id);const s=[];if(i.width&&i.height)for(const a of i.edges){const c=i.nodeLookup.get(a.source),u=i.nodeLookup.get(a.target);c&&u&&s1({sourceNode:c,targetNode:u,width:i.width,height:i.height,transform:i.transform})&&s.push(a.id)}return s},[t]),Ze)}const uk=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return d.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},dk=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return d.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},lp={[ds.Arrow]:uk,[ds.ArrowClosed]:dk};function fk(t){const r=Je();return b.useMemo(()=>{var a,c;return Object.prototype.hasOwnProperty.call(lp,t)?lp[t]:((c=(a=r.getState()).onError)==null||c.call(a,"009",Bn.error009(t)),null)},[t])}const hk=({id:t,type:r,color:i,width:s=12.5,height:a=12.5,markerUnits:c="strokeWidth",strokeWidth:u,orient:h="auto-start-reverse"})=>{const m=fk(r);return m?d.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:h,refX:"0",refY:"0",children:d.jsx(m,{color:i,strokeWidth:u})}):null},qm=({defaultColor:t,rfId:r})=>{const i=Oe(c=>c.edges),s=Oe(c=>c.defaultEdgeOptions),a=b.useMemo(()=>h1(i,{id:r,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[i,s,r,t]);return a.length?d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:a.map(c=>d.jsx(hk,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};qm.displayName="MarkerDefinitions";var pk=b.memo(qm);function Zm({x:t,y:r,label:i,labelStyle:s,labelShowBg:a=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:h=2,children:m,className:g,...v}){const[y,x]=b.useState({x:1,y:0,width:0,height:0}),C=ct(["react-flow__edge-textwrapper",g]),E=b.useRef(null);return b.useEffect(()=>{if(E.current){const k=E.current.getBBox();x({x:k.x,y:k.y,width:k.width,height:k.height})}},[i]),i?d.jsxs("g",{transform:`translate(${t-y.width/2} ${r-y.height/2})`,className:C,visibility:y.width?"visible":"hidden",...v,children:[a&&d.jsx("rect",{width:y.width+2*u[0],x:-u[0],y:-u[1],height:y.height+2*u[1],className:"react-flow__edge-textbg",style:c,rx:h,ry:h}),d.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:E,style:s,children:i}),m]}):null}Zm.displayName="EdgeText";const mk=b.memo(Zm);function aa({path:t,labelX:r,labelY:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,interactionWidth:g=20,...v}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...v,d:t,fill:"none",className:ct(["react-flow__edge-path",v.className])}),g?d.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,s&&En(r)&&En(i)?d.jsx(mk,{x:r,y:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m}):null]})}function ap({pos:t,x1:r,y1:i,x2:s,y2:a}){return t===_e.Left||t===_e.Right?[.5*(r+s),i]:[r,.5*(i+a)]}function Jm({sourceX:t,sourceY:r,sourcePosition:i=_e.Bottom,targetX:s,targetY:a,targetPosition:c=_e.Top}){const[u,h]=ap({pos:i,x1:t,y1:r,x2:s,y2:a}),[m,g]=ap({pos:c,x1:s,y1:a,x2:t,y2:r}),[v,y,x,C]=xm({sourceX:t,sourceY:r,targetX:s,targetY:a,sourceControlX:u,sourceControlY:h,targetControlX:m,targetControlY:g});return[`M${t},${r} C${u},${h} ${m},${g} ${s},${a}`,v,y,x,C]}function eg(t){return b.memo(({id:r,sourceX:i,sourceY:s,targetX:a,targetY:c,sourcePosition:u,targetPosition:h,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:E,markerEnd:k,markerStart:_,interactionWidth:N})=>{const[j,S,M]=Jm({sourceX:i,sourceY:s,sourcePosition:u,targetX:a,targetY:c,targetPosition:h}),$=t.isInternal?void 0:r;return d.jsx(aa,{id:$,path:j,labelX:S,labelY:M,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:E,markerEnd:k,markerStart:_,interactionWidth:N})})}const gk=eg({isInternal:!1}),tg=eg({isInternal:!0});gk.displayName="SimpleBezierEdge";tg.displayName="SimpleBezierEdgeInternal";function ng(t){return b.memo(({id:r,sourceX:i,sourceY:s,targetX:a,targetY:c,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,sourcePosition:C=_e.Bottom,targetPosition:E=_e.Top,markerEnd:k,markerStart:_,pathOptions:N,interactionWidth:j})=>{const[S,M,$]=fu({sourceX:i,sourceY:s,sourcePosition:C,targetX:a,targetY:c,targetPosition:E,borderRadius:N==null?void 0:N.borderRadius,offset:N==null?void 0:N.offset,stepPosition:N==null?void 0:N.stepPosition}),L=t.isInternal?void 0:r;return d.jsx(aa,{id:L,path:S,labelX:M,labelY:$,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:k,markerStart:_,interactionWidth:j})})}const rg=ng({isInternal:!1}),ig=ng({isInternal:!0});rg.displayName="SmoothStepEdge";ig.displayName="SmoothStepEdgeInternal";function og(t){return b.memo(({id:r,...i})=>{var a;const s=t.isInternal?void 0:r;return d.jsx(rg,{...i,id:s,pathOptions:b.useMemo(()=>{var c;return{borderRadius:0,offset:(c=i.pathOptions)==null?void 0:c.offset}},[(a=i.pathOptions)==null?void 0:a.offset])})})}const yk=og({isInternal:!1}),sg=og({isInternal:!0});yk.displayName="StepEdge";sg.displayName="StepEdgeInternal";function lg(t){return b.memo(({id:r,sourceX:i,sourceY:s,targetX:a,targetY:c,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:C,markerStart:E,interactionWidth:k})=>{const[_,N,j]=Em({sourceX:i,sourceY:s,targetX:a,targetY:c}),S=t.isInternal?void 0:r;return d.jsx(aa,{id:S,path:_,labelX:N,labelY:j,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:C,markerStart:E,interactionWidth:k})})}const vk=lg({isInternal:!1}),ag=lg({isInternal:!0});vk.displayName="StraightEdge";ag.displayName="StraightEdgeInternal";function cg(t){return b.memo(({id:r,sourceX:i,sourceY:s,targetX:a,targetY:c,sourcePosition:u=_e.Bottom,targetPosition:h=_e.Top,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:E,markerEnd:k,markerStart:_,pathOptions:N,interactionWidth:j})=>{const[S,M,$]=wm({sourceX:i,sourceY:s,sourcePosition:u,targetX:a,targetY:c,targetPosition:h,curvature:N==null?void 0:N.curvature}),L=t.isInternal?void 0:r;return d.jsx(aa,{id:L,path:S,labelX:M,labelY:$,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:E,markerEnd:k,markerStart:_,interactionWidth:j})})}const xk=cg({isInternal:!1}),ug=cg({isInternal:!0});xk.displayName="BezierEdge";ug.displayName="BezierEdgeInternal";const cp={default:ug,straight:ag,step:sg,smoothstep:ig,simplebezier:tg},up={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},wk=(t,r,i)=>i===_e.Left?t-r:i===_e.Right?t+r:t,Sk=(t,r,i)=>i===_e.Top?t-r:i===_e.Bottom?t+r:t,dp="react-flow__edgeupdater";function fp({position:t,centerX:r,centerY:i,radius:s=10,onMouseDown:a,onMouseEnter:c,onMouseOut:u,type:h}){return d.jsx("circle",{onMouseDown:a,onMouseEnter:c,onMouseOut:u,className:ct([dp,`${dp}-${h}`]),cx:wk(r,s,t),cy:Sk(i,s,t),r:s,stroke:"transparent",fill:"transparent"})}function kk({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:s,sourceY:a,targetX:c,targetY:u,sourcePosition:h,targetPosition:m,onReconnect:g,onReconnectStart:v,onReconnectEnd:y,setReconnecting:x,setUpdateHover:C}){const E=Je(),k=(M,$)=>{if(M.button!==0)return;const{autoPanOnConnect:L,domNode:H,isValidConnection:Z,connectionMode:B,connectionRadius:J,lib:W,onConnectStart:G,onConnectEnd:te,cancelConnection:z,nodeLookup:Q,rfId:T,panBy:K,updateConnection:R}=E.getState(),A=$.type==="target",U=(oe,se)=>{x(!1),y==null||y(oe,i,$.type,se)},P=oe=>g==null?void 0:g(i,oe),O=(oe,se)=>{x(!0),v==null||v(M,i,$.type),G==null||G(oe,se)};mu.onPointerDown(M.nativeEvent,{autoPanOnConnect:L,connectionMode:B,connectionRadius:J,domNode:H,handleId:$.id,nodeId:$.nodeId,nodeLookup:Q,isTarget:A,edgeUpdaterType:$.type,lib:W,flowId:T,cancelConnection:z,panBy:K,isValidConnection:Z,onConnect:P,onConnectStart:O,onConnectEnd:te,onReconnectEnd:U,updateConnection:R,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:M.currentTarget})},_=M=>k(M,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),N=M=>k(M,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),j=()=>C(!0),S=()=>C(!1);return d.jsxs(d.Fragment,{children:[(t===!0||t==="source")&&d.jsx(fp,{position:h,centerX:s,centerY:a,radius:r,onMouseDown:_,onMouseEnter:j,onMouseOut:S,type:"source"}),(t===!0||t==="target")&&d.jsx(fp,{position:m,centerX:c,centerY:u,radius:r,onMouseDown:N,onMouseEnter:j,onMouseOut:S,type:"target"})]})}function Nk({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:s,onClick:a,onDoubleClick:c,onContextMenu:u,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:C,rfId:E,edgeTypes:k,noPanClassName:_,onError:N,disableKeyboardA11y:j}){let S=Oe(be=>be.edgeLookup.get(t));const M=Oe(be=>be.defaultEdgeOptions);S=M?{...M,...S}:S;let $=S.type||"default",L=(k==null?void 0:k[$])||cp[$];L===void 0&&(N==null||N("011",Bn.error011($)),$="default",L=(k==null?void 0:k.default)||cp.default);const H=!!(S.focusable||r&&typeof S.focusable>"u"),Z=typeof y<"u"&&(S.reconnectable||i&&typeof S.reconnectable>"u"),B=!!(S.selectable||s&&typeof S.selectable>"u"),J=b.useRef(null),[W,G]=b.useState(!1),[te,z]=b.useState(!1),Q=Je(),{zIndex:T,sourceX:K,sourceY:R,targetX:A,targetY:U,sourcePosition:P,targetPosition:O}=Oe(b.useCallback(be=>{const Ne=be.nodeLookup.get(S.source),ze=be.nodeLookup.get(S.target);if(!Ne||!ze)return{zIndex:S.zIndex,...up};const Be=f1({id:t,sourceNode:Ne,targetNode:ze,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:be.connectionMode,onError:N});return{zIndex:o1({selected:S.selected,zIndex:S.zIndex,sourceNode:Ne,targetNode:ze,elevateOnSelect:be.elevateEdgesOnSelect,zIndexMode:be.zIndexMode}),...Be||up}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),Ze),oe=b.useMemo(()=>S.markerStart?`url('#${hu(S.markerStart,E)}')`:void 0,[S.markerStart,E]),se=b.useMemo(()=>S.markerEnd?`url('#${hu(S.markerEnd,E)}')`:void 0,[S.markerEnd,E]);if(S.hidden||K===null||R===null||A===null||U===null)return null;const he=be=>{var Ae;const{addSelectedEdges:Ne,unselectNodesAndEdges:ze,multiSelectionActive:Be}=Q.getState();B&&(Q.setState({nodesSelectionActive:!1}),S.selected&&Be?(ze({nodes:[],edges:[S]}),(Ae=J.current)==null||Ae.blur()):Ne([t])),a&&a(be,S)},de=c?be=>{c(be,{...S})}:void 0,pe=u?be=>{u(be,{...S})}:void 0,ie=h?be=>{h(be,{...S})}:void 0,me=m?be=>{m(be,{...S})}:void 0,ke=g?be=>{g(be,{...S})}:void 0,je=be=>{var Ne;if(!j&&om.includes(be.key)&&B){const{unselectNodesAndEdges:ze,addSelectedEdges:Be}=Q.getState();be.key==="Escape"?((Ne=J.current)==null||Ne.blur(),ze({edges:[S]})):Be([t])}};return d.jsx("svg",{style:{zIndex:T},children:d.jsxs("g",{className:ct(["react-flow__edge",`react-flow__edge-${$}`,S.className,_,{selected:S.selected,animated:S.animated,inactive:!B&&!a,updating:W,selectable:B}]),onClick:he,onDoubleClick:de,onContextMenu:pe,onMouseEnter:ie,onMouseMove:me,onMouseLeave:ke,onKeyDown:H?je:void 0,tabIndex:H?0:void 0,role:S.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":H?`${Om}-${E}`:void 0,ref:J,...S.domAttributes,children:[!te&&d.jsx(L,{id:t,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:B,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:K,sourceY:R,targetX:A,targetY:U,sourcePosition:P,targetPosition:O,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:oe,markerEnd:se,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),Z&&d.jsx(kk,{edge:S,isReconnectable:Z,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:C,sourceX:K,sourceY:R,targetX:A,targetY:U,sourcePosition:P,targetPosition:O,setUpdateHover:G,setReconnecting:z})]})})}var Ek=b.memo(Nk);const Ck=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function dg({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:s,noPanClassName:a,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:h,onEdgeMouseMove:m,onEdgeMouseLeave:g,onEdgeClick:v,reconnectRadius:y,onEdgeDoubleClick:x,onReconnectStart:C,onReconnectEnd:E,disableKeyboardA11y:k}){const{edgesFocusable:_,edgesReconnectable:N,elementsSelectable:j,onError:S}=Oe(Ck,Ze),M=ck(r);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(pk,{defaultColor:t,rfId:i}),M.map($=>d.jsx(Ek,{id:$,edgesFocusable:_,edgesReconnectable:N,elementsSelectable:j,noPanClassName:a,onReconnect:c,onContextMenu:u,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,onClick:v,reconnectRadius:y,onDoubleClick:x,onReconnectStart:C,onReconnectEnd:E,rfId:i,onError:S,edgeTypes:s,disableKeyboardA11y:k},$))]})}dg.displayName="EdgeRenderer";const _k=b.memo(dg),jk=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function bk({children:t}){const r=Oe(jk);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function Mk(t){const r=Au(),i=b.useRef(!1);b.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const Pk=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function Ik(t){const r=Oe(Pk),i=Je();return b.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function Tk(t){return t.connection.inProgress?{...t.connection,to:Ss(t.connection.to,t.transform)}:{...t.connection}}function Rk(t){return Tk}function zk(t){const r=Rk();return Oe(r,Ze)}const Ak=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function Lk({containerStyle:t,style:r,type:i,component:s}){const{nodesConnectable:a,width:c,height:u,isValid:h,inProgress:m}=Oe(Ak,Ze);return!(c&&a&&m)?null:d.jsx("svg",{style:t,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:ct(["react-flow__connection",am(h)]),children:d.jsx(fg,{style:r,type:i,CustomComponent:s,isValid:h})})})}const fg=({style:t,type:r=Wr.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:a,from:c,fromNode:u,fromHandle:h,fromPosition:m,to:g,toNode:v,toHandle:y,toPosition:x,pointer:C}=zk();if(!a)return;if(i)return d.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:u,fromHandle:h,fromX:c.x,fromY:c.y,toX:g.x,toY:g.y,fromPosition:m,toPosition:x,connectionStatus:am(s),toNode:v,toHandle:y,pointer:C});let E="";const k={sourceX:c.x,sourceY:c.y,sourcePosition:m,targetX:g.x,targetY:g.y,targetPosition:x};switch(r){case Wr.Bezier:[E]=wm(k);break;case Wr.SimpleBezier:[E]=Jm(k);break;case Wr.Step:[E]=fu({...k,borderRadius:0});break;case Wr.SmoothStep:[E]=fu(k);break;default:[E]=Em(k)}return d.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:t})};fg.displayName="ConnectionLine";const Dk={};function hp(t=Dk){b.useRef(t),Je(),b.useEffect(()=>{},[t])}function $k(){Je(),b.useRef(!1),b.useEffect(()=>{},[])}function hg({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:v,onSelectionContextMenu:y,onSelectionStart:x,onSelectionEnd:C,connectionLineType:E,connectionLineStyle:k,connectionLineComponent:_,connectionLineContainerStyle:N,selectionKeyCode:j,selectionOnDrag:S,selectionMode:M,multiSelectionKeyCode:$,panActivationKeyCode:L,zoomActivationKeyCode:H,deleteKeyCode:Z,onlyRenderVisibleElements:B,elementsSelectable:J,defaultViewport:W,translateExtent:G,minZoom:te,maxZoom:z,preventScrolling:Q,defaultMarkerColor:T,zoomOnScroll:K,zoomOnPinch:R,panOnScroll:A,panOnScrollSpeed:U,panOnScrollMode:P,zoomOnDoubleClick:O,panOnDrag:oe,onPaneClick:se,onPaneMouseEnter:he,onPaneMouseMove:de,onPaneMouseLeave:pe,onPaneScroll:ie,onPaneContextMenu:me,paneClickDistance:ke,nodeClickDistance:je,onEdgeContextMenu:be,onEdgeMouseEnter:Ne,onEdgeMouseMove:ze,onEdgeMouseLeave:Be,reconnectRadius:Ae,onReconnect:et,onReconnectStart:Mt,onReconnectEnd:pt,noDragClassName:xt,noWheelClassName:wt,noPanClassName:Wt,disableKeyboardA11y:zt,nodeExtent:hr,rfId:Wn,viewport:ut,onViewportChange:en}){return hp(t),hp(r),$k(),Mk(i),Ik(ut),d.jsx(JS,{onPaneClick:se,onPaneMouseEnter:he,onPaneMouseMove:de,onPaneMouseLeave:pe,onPaneContextMenu:me,onPaneScroll:ie,paneClickDistance:ke,deleteKeyCode:Z,selectionKeyCode:j,selectionOnDrag:S,selectionMode:M,onSelectionStart:x,onSelectionEnd:C,multiSelectionKeyCode:$,panActivationKeyCode:L,zoomActivationKeyCode:H,elementsSelectable:J,zoomOnScroll:K,zoomOnPinch:R,zoomOnDoubleClick:O,panOnScroll:A,panOnScrollSpeed:U,panOnScrollMode:P,panOnDrag:oe,defaultViewport:W,translateExtent:G,minZoom:te,maxZoom:z,onSelectionContextMenu:y,preventScrolling:Q,noDragClassName:xt,noWheelClassName:wt,noPanClassName:Wt,disableKeyboardA11y:zt,onViewportChange:en,isControlledViewport:!!ut,children:d.jsxs(bk,{children:[d.jsx(_k,{edgeTypes:r,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:et,onReconnectStart:Mt,onReconnectEnd:pt,onlyRenderVisibleElements:B,onEdgeContextMenu:be,onEdgeMouseEnter:Ne,onEdgeMouseMove:ze,onEdgeMouseLeave:Be,reconnectRadius:Ae,defaultMarkerColor:T,noPanClassName:Wt,disableKeyboardA11y:zt,rfId:Wn}),d.jsx(Lk,{style:k,type:E,component:_,containerStyle:N}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(ak,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:v,nodeClickDistance:je,onlyRenderVisibleElements:B,noPanClassName:Wt,noDragClassName:xt,disableKeyboardA11y:zt,nodeExtent:hr,rfId:Wn}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}hg.displayName="GraphView";const Ok=b.memo(hg),pp=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:a,height:c,fitView:u,fitViewOptions:h,minZoom:m=.5,maxZoom:g=2,nodeOrigin:v,nodeExtent:y,zIndexMode:x="basic"}={})=>{const C=new Map,E=new Map,k=new Map,_=new Map,N=s??r??[],j=i??t??[],S=v??[0,0],M=y??cs;jm(k,_,N);const $=pu(j,C,E,{nodeOrigin:S,nodeExtent:M,zIndexMode:x});let L=[0,0,1];if(u&&a&&c){const H=xs(C,{filter:W=>!!((W.width||W.initialWidth)&&(W.height||W.initialHeight))}),{x:Z,y:B,zoom:J}=bu(H,a,c,m,g,(h==null?void 0:h.padding)??.1);L=[Z,B,J]}return{rfId:"1",width:a??0,height:c??0,transform:L,nodes:j,nodesInitialized:$,nodeLookup:C,parentLookup:E,edges:N,edgeLookup:_,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:m,maxZoom:g,translateExtent:cs,nodeExtent:M,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Si.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,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:u??!1,fitViewOptions:h,fitViewResolver:null,connection:{...lm},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Jw,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:sm,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Fk=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:a,height:c,fitView:u,fitViewOptions:h,minZoom:m,maxZoom:g,nodeOrigin:v,nodeExtent:y,zIndexMode:x})=>iS((C,E)=>{async function k(){const{nodeLookup:_,panZoom:N,fitViewOptions:j,fitViewResolver:S,width:M,height:$,minZoom:L,maxZoom:H}=E();N&&(await qw({nodes:_,width:M,height:$,panZoom:N,minZoom:L,maxZoom:H},j),S==null||S.resolve(!0),C({fitViewResolver:null}))}return{...pp({nodes:t,edges:r,width:a,height:c,fitView:u,fitViewOptions:h,minZoom:m,maxZoom:g,nodeOrigin:v,nodeExtent:y,defaultNodes:i,defaultEdges:s,zIndexMode:x}),setNodes:_=>{const{nodeLookup:N,parentLookup:j,nodeOrigin:S,elevateNodesOnSelect:M,fitViewQueued:$,zIndexMode:L}=E(),H=pu(_,N,j,{nodeOrigin:S,nodeExtent:y,elevateNodesOnSelect:M,checkEquality:!0,zIndexMode:L});$&&H?(k(),C({nodes:_,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0})):C({nodes:_,nodesInitialized:H})},setEdges:_=>{const{connectionLookup:N,edgeLookup:j}=E();jm(N,j,_),C({edges:_})},setDefaultNodesAndEdges:(_,N)=>{if(_){const{setNodes:j}=E();j(_),C({hasDefaultNodes:!0})}if(N){const{setEdges:j}=E();j(N),C({hasDefaultEdges:!0})}},updateNodeInternals:_=>{const{triggerNodeChanges:N,nodeLookup:j,parentLookup:S,domNode:M,nodeOrigin:$,nodeExtent:L,debug:H,fitViewQueued:Z,zIndexMode:B}=E(),{changes:J,updatedInternals:W}=w1(_,j,S,M,$,L,B);W&&(g1(j,S,{nodeOrigin:$,nodeExtent:L,zIndexMode:B}),Z?(k(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(J==null?void 0:J.length)>0&&(H&&console.log("React Flow: trigger node changes",J),N==null||N(J)))},updateNodePositions:(_,N=!1)=>{const j=[];let S=[];const{nodeLookup:M,triggerNodeChanges:$,connection:L,updateConnection:H,onNodesChangeMiddlewareMap:Z}=E();for(const[B,J]of _){const W=M.get(B),G=!!(W!=null&&W.expandParent&&(W!=null&&W.parentId)&&(J!=null&&J.position)),te={id:B,type:"position",position:G?{x:Math.max(0,J.position.x),y:Math.max(0,J.position.y)}:J.position,dragging:N};if(W&&L.inProgress&&L.fromNode.id===W.id){const z=Ni(W,L.fromHandle,_e.Left,!0);H({...L,from:z})}G&&W.parentId&&j.push({id:B,parentId:W.parentId,rect:{...J.internals.positionAbsolute,width:J.measured.width??0,height:J.measured.height??0}}),S.push(te)}if(j.length>0){const{parentLookup:B,nodeOrigin:J}=E(),W=zu(j,M,B,J);S.push(...W)}for(const B of Z.values())S=B(S);$(S)},triggerNodeChanges:_=>{const{onNodesChange:N,setNodes:j,nodes:S,hasDefaultNodes:M,debug:$}=E();if(_!=null&&_.length){if(M){const L=Bm(_,S);j(L)}$&&console.log("React Flow: trigger node changes",_),N==null||N(_)}},triggerEdgeChanges:_=>{const{onEdgesChange:N,setEdges:j,edges:S,hasDefaultEdges:M,debug:$}=E();if(_!=null&&_.length){if(M){const L=Vm(_,S);j(L)}$&&console.log("React Flow: trigger edge changes",_),N==null||N(_)}},addSelectedNodes:_=>{const{multiSelectionActive:N,edgeLookup:j,nodeLookup:S,triggerNodeChanges:M,triggerEdgeChanges:$}=E();if(N){const L=_.map(H=>pi(H,!0));M(L);return}M(uo(S,new Set([..._]),!0)),$(uo(j))},addSelectedEdges:_=>{const{multiSelectionActive:N,edgeLookup:j,nodeLookup:S,triggerNodeChanges:M,triggerEdgeChanges:$}=E();if(N){const L=_.map(H=>pi(H,!0));$(L);return}$(uo(j,new Set([..._]))),M(uo(S,new Set,!0))},unselectNodesAndEdges:({nodes:_,edges:N}={})=>{const{edges:j,nodes:S,nodeLookup:M,triggerNodeChanges:$,triggerEdgeChanges:L}=E(),H=_||S,Z=N||j,B=H.map(W=>{const G=M.get(W.id);return G&&(G.selected=!1),pi(W.id,!1)}),J=Z.map(W=>pi(W.id,!1));$(B),L(J)},setMinZoom:_=>{const{panZoom:N,maxZoom:j}=E();N==null||N.setScaleExtent([_,j]),C({minZoom:_})},setMaxZoom:_=>{const{panZoom:N,minZoom:j}=E();N==null||N.setScaleExtent([j,_]),C({maxZoom:_})},setTranslateExtent:_=>{var N;(N=E().panZoom)==null||N.setTranslateExtent(_),C({translateExtent:_})},resetSelectedElements:()=>{const{edges:_,nodes:N,triggerNodeChanges:j,triggerEdgeChanges:S,elementsSelectable:M}=E();if(!M)return;const $=N.reduce((H,Z)=>Z.selected?[...H,pi(Z.id,!1)]:H,[]),L=_.reduce((H,Z)=>Z.selected?[...H,pi(Z.id,!1)]:H,[]);j($),S(L)},setNodeExtent:_=>{const{nodes:N,nodeLookup:j,parentLookup:S,nodeOrigin:M,elevateNodesOnSelect:$,nodeExtent:L,zIndexMode:H}=E();_[0][0]===L[0][0]&&_[0][1]===L[0][1]&&_[1][0]===L[1][0]&&_[1][1]===L[1][1]||(pu(N,j,S,{nodeOrigin:M,nodeExtent:_,elevateNodesOnSelect:$,checkEquality:!1,zIndexMode:H}),C({nodeExtent:_}))},panBy:_=>{const{transform:N,width:j,height:S,panZoom:M,translateExtent:$}=E();return S1({delta:_,panZoom:M,transform:N,translateExtent:$,width:j,height:S})},setCenter:async(_,N,j)=>{const{width:S,height:M,maxZoom:$,panZoom:L}=E();if(!L)return Promise.resolve(!1);const H=typeof(j==null?void 0:j.zoom)<"u"?j.zoom:$;return await L.setViewport({x:S/2-_*H,y:M/2-N*H,zoom:H},{duration:j==null?void 0:j.duration,ease:j==null?void 0:j.ease,interpolate:j==null?void 0:j.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...lm}})},updateConnection:_=>{C({connection:_})},reset:()=>C({...pp()})}},Object.is);function pg({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:s,initialWidth:a,initialHeight:c,initialMinZoom:u,initialMaxZoom:h,initialFitViewOptions:m,fitView:g,nodeOrigin:v,nodeExtent:y,zIndexMode:x,children:C}){const[E]=b.useState(()=>Fk({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:a,height:c,fitView:g,minZoom:u,maxZoom:h,fitViewOptions:m,nodeOrigin:v,nodeExtent:y,zIndexMode:x}));return d.jsx(oS,{value:E,children:d.jsx(bS,{children:C})})}function Hk({children:t,nodes:r,edges:i,defaultNodes:s,defaultEdges:a,width:c,height:u,fitView:h,fitViewOptions:m,minZoom:g,maxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:C}){return b.useContext(oa)?d.jsx(d.Fragment,{children:t}):d.jsx(pg,{initialNodes:r,initialEdges:i,defaultNodes:s,defaultEdges:a,initialWidth:c,initialHeight:u,fitView:h,initialFitViewOptions:m,initialMinZoom:g,initialMaxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:C,children:t})}const Bk={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Vk({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,className:a,nodeTypes:c,edgeTypes:u,onNodeClick:h,onEdgeClick:m,onInit:g,onMove:v,onMoveStart:y,onMoveEnd:x,onConnect:C,onConnectStart:E,onConnectEnd:k,onClickConnectStart:_,onClickConnectEnd:N,onNodeMouseEnter:j,onNodeMouseMove:S,onNodeMouseLeave:M,onNodeContextMenu:$,onNodeDoubleClick:L,onNodeDragStart:H,onNodeDrag:Z,onNodeDragStop:B,onNodesDelete:J,onEdgesDelete:W,onDelete:G,onSelectionChange:te,onSelectionDragStart:z,onSelectionDrag:Q,onSelectionDragStop:T,onSelectionContextMenu:K,onSelectionStart:R,onSelectionEnd:A,onBeforeDelete:U,connectionMode:P,connectionLineType:O=Wr.Bezier,connectionLineStyle:oe,connectionLineComponent:se,connectionLineContainerStyle:he,deleteKeyCode:de="Backspace",selectionKeyCode:pe="Shift",selectionOnDrag:ie=!1,selectionMode:me=us.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:je=hs()?"Meta":"Control",zoomActivationKeyCode:be=hs()?"Meta":"Control",snapToGrid:Ne,snapGrid:ze,onlyRenderVisibleElements:Be=!1,selectNodesOnDrag:Ae,nodesDraggable:et,autoPanOnNodeFocus:Mt,nodesConnectable:pt,nodesFocusable:xt,nodeOrigin:wt=Fm,edgesFocusable:Wt,edgesReconnectable:zt,elementsSelectable:hr=!0,defaultViewport:Wn=vS,minZoom:ut=.5,maxZoom:en=2,translateExtent:jn=cs,preventScrolling:Gr=!0,nodeExtent:lt,defaultMarkerColor:bn="#b1b1b7",zoomOnScroll:Ci=!0,zoomOnPinch:_i=!0,panOnScroll:Kr=!1,panOnScrollSpeed:ji=.5,panOnScrollMode:pr=yi.Free,zoomOnDoubleClick:Ut=!0,panOnDrag:Qr=!0,onPaneClick:tn,onPaneMouseEnter:At,onPaneMouseMove:nn,onPaneMouseLeave:pn,onPaneScroll:mn,onPaneContextMenu:mr,paneClickDistance:bi=1,nodeClickDistance:Mi=0,children:gr,onReconnect:Un,onReconnectStart:Yn,onReconnectEnd:yr,onEdgeContextMenu:Nt,onEdgeDoubleClick:Mn,onEdgeMouseEnter:mt,onEdgeMouseMove:Xn,onEdgeMouseLeave:Pt,reconnectRadius:Gn=10,onNodesChange:rn,onEdgesChange:Kn,noDragClassName:Pi="nodrag",noWheelClassName:xo="nowheel",noPanClassName:Et="nopan",fitView:Ye,fitViewOptions:vr,connectOnClick:Qn,attributionPosition:qr,proOptions:Zr,defaultEdgeOptions:Yt,elevateNodesOnSelect:Pn=!0,elevateEdgesOnSelect:wo=!1,disableKeyboardA11y:Ii=!1,autoPanOnConnect:Xe,autoPanOnNodeDrag:Ti,autoPanSpeed:xr,connectionRadius:Ri,isValidConnection:qn,onError:Jr,style:Zn,id:In,nodeDragThreshold:dt,connectionDragThreshold:So,viewport:It,onViewportChange:wr,width:Qe,height:zi,colorMode:Sr="light",debug:kr,onScroll:on,ariaLabelConfig:Nr,zIndexMode:Er="basic",...ko},Cr){const Jn=In||"1",ei=kS(Sr),Tn=b.useCallback(ti=>{ti.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),on==null||on(ti)},[on]);return d.jsx("div",{"data-testid":"rf__wrapper",...ko,onScroll:Tn,style:{...Zn,...Bk},ref:Cr,className:ct(["react-flow",a,ei]),id:In,role:"application",children:d.jsxs(Hk,{nodes:t,edges:r,width:Qe,height:zi,fitView:Ye,fitViewOptions:vr,minZoom:ut,maxZoom:en,nodeOrigin:wt,nodeExtent:lt,zIndexMode:Er,children:[d.jsx(Ok,{onInit:g,onNodeClick:h,onEdgeClick:m,onNodeMouseEnter:j,onNodeMouseMove:S,onNodeMouseLeave:M,onNodeContextMenu:$,onNodeDoubleClick:L,nodeTypes:c,edgeTypes:u,connectionLineType:O,connectionLineStyle:oe,connectionLineComponent:se,connectionLineContainerStyle:he,selectionKeyCode:pe,selectionOnDrag:ie,selectionMode:me,deleteKeyCode:de,multiSelectionKeyCode:je,panActivationKeyCode:ke,zoomActivationKeyCode:be,onlyRenderVisibleElements:Be,defaultViewport:Wn,translateExtent:jn,minZoom:ut,maxZoom:en,preventScrolling:Gr,zoomOnScroll:Ci,zoomOnPinch:_i,zoomOnDoubleClick:Ut,panOnScroll:Kr,panOnScrollSpeed:ji,panOnScrollMode:pr,panOnDrag:Qr,onPaneClick:tn,onPaneMouseEnter:At,onPaneMouseMove:nn,onPaneMouseLeave:pn,onPaneScroll:mn,onPaneContextMenu:mr,paneClickDistance:bi,nodeClickDistance:Mi,onSelectionContextMenu:K,onSelectionStart:R,onSelectionEnd:A,onReconnect:Un,onReconnectStart:Yn,onReconnectEnd:yr,onEdgeContextMenu:Nt,onEdgeDoubleClick:Mn,onEdgeMouseEnter:mt,onEdgeMouseMove:Xn,onEdgeMouseLeave:Pt,reconnectRadius:Gn,defaultMarkerColor:bn,noDragClassName:Pi,noWheelClassName:xo,noPanClassName:Et,rfId:Jn,disableKeyboardA11y:Ii,nodeExtent:lt,viewport:It,onViewportChange:wr}),d.jsx(SS,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:E,onConnectEnd:k,onClickConnectStart:_,onClickConnectEnd:N,nodesDraggable:et,autoPanOnNodeFocus:Mt,nodesConnectable:pt,nodesFocusable:xt,edgesFocusable:Wt,edgesReconnectable:zt,elementsSelectable:hr,elevateNodesOnSelect:Pn,elevateEdgesOnSelect:wo,minZoom:ut,maxZoom:en,nodeExtent:lt,onNodesChange:rn,onEdgesChange:Kn,snapToGrid:Ne,snapGrid:ze,connectionMode:P,translateExtent:jn,connectOnClick:Qn,defaultEdgeOptions:Yt,fitView:Ye,fitViewOptions:vr,onNodesDelete:J,onEdgesDelete:W,onDelete:G,onNodeDragStart:H,onNodeDrag:Z,onNodeDragStop:B,onSelectionDrag:Q,onSelectionDragStart:z,onSelectionDragStop:T,onMove:v,onMoveStart:y,onMoveEnd:x,noPanClassName:Et,nodeOrigin:wt,rfId:Jn,autoPanOnConnect:Xe,autoPanOnNodeDrag:Ti,autoPanSpeed:xr,onError:Jr,connectionRadius:Ri,isValidConnection:qn,selectNodesOnDrag:Ae,nodeDragThreshold:dt,connectionDragThreshold:So,onBeforeDelete:U,debug:kr,ariaLabelConfig:Nr,zIndexMode:Er}),d.jsx(yS,{onSelectionChange:te}),gr,d.jsx(fS,{proOptions:Zr,position:qr}),d.jsx(dS,{rfId:Jn,disableKeyboardA11y:Ii})]})})}var mg=Wm(Vk);function Wk(t){const[r,i]=b.useState(t),s=b.useCallback(a=>i(c=>Bm(a,c)),[]);return[r,i,s]}function Uk(t){const[r,i]=b.useState(t),s=b.useCallback(a=>i(c=>Vm(a,c)),[]);return[r,i,s]}function Yk({dimensions:t,lineWidth:r,variant:i,className:s}){return d.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:ct(["react-flow__background-pattern",i,s])})}function Xk({radius:t,className:r}){return d.jsx("circle",{cx:t,cy:t,r:t,className:ct(["react-flow__background-pattern","dots",r])})}var Hn;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Hn||(Hn={}));const Gk={[Hn.Dots]:1,[Hn.Lines]:1,[Hn.Cross]:6},Kk=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function gg({id:t,variant:r=Hn.Dots,gap:i=20,size:s,lineWidth:a=1,offset:c=0,color:u,bgColor:h,style:m,className:g,patternClassName:v}){const y=b.useRef(null),{transform:x,patternId:C}=Oe(Kk,Ze),E=s||Gk[r],k=r===Hn.Dots,_=r===Hn.Cross,N=Array.isArray(i)?i:[i,i],j=[N[0]*x[2]||1,N[1]*x[2]||1],S=E*x[2],M=Array.isArray(c)?c:[c,c],$=_?[S,S]:j,L=[M[0]*x[2]||1+$[0]/2,M[1]*x[2]||1+$[1]/2],H=`${C}${t||""}`;return d.jsxs("svg",{className:ct(["react-flow__background",g]),style:{...m,...la,"--xy-background-color-props":h,"--xy-background-pattern-color-props":u},ref:y,"data-testid":"rf__background",children:[d.jsx("pattern",{id:H,x:x[0]%j[0],y:x[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:k?d.jsx(Xk,{radius:S/2,className:v}):d.jsx(Yk,{dimensions:$,lineWidth:a,variant:r,className:v})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}gg.displayName="Background";const yg=b.memo(gg);function Qk(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function qk(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Zk(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.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 Jk(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 eN(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 Rl({children:t,className:r,...i}){return d.jsx("button",{type:"button",className:ct(["react-flow__controls-button",r]),...i,children:t})}const tN=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function vg({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:a,onZoomIn:c,onZoomOut:u,onFitView:h,onInteractiveChange:m,className:g,children:v,position:y="bottom-left",orientation:x="vertical","aria-label":C}){const E=Je(),{isInteractive:k,minZoomReached:_,maxZoomReached:N,ariaLabelConfig:j}=Oe(tN,Ze),{zoomIn:S,zoomOut:M,fitView:$}=Au(),L=()=>{S(),c==null||c()},H=()=>{M(),u==null||u()},Z=()=>{$(a),h==null||h()},B=()=>{E.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),m==null||m(!k)},J=x==="horizontal"?"horizontal":"vertical";return d.jsxs(sa,{className:ct(["react-flow__controls",J,g]),position:y,style:t,"data-testid":"rf__controls","aria-label":C??j["controls.ariaLabel"],children:[r&&d.jsxs(d.Fragment,{children:[d.jsx(Rl,{onClick:L,className:"react-flow__controls-zoomin",title:j["controls.zoomIn.ariaLabel"],"aria-label":j["controls.zoomIn.ariaLabel"],disabled:N,children:d.jsx(Qk,{})}),d.jsx(Rl,{onClick:H,className:"react-flow__controls-zoomout",title:j["controls.zoomOut.ariaLabel"],"aria-label":j["controls.zoomOut.ariaLabel"],disabled:_,children:d.jsx(qk,{})})]}),i&&d.jsx(Rl,{className:"react-flow__controls-fitview",onClick:Z,title:j["controls.fitView.ariaLabel"],"aria-label":j["controls.fitView.ariaLabel"],children:d.jsx(Zk,{})}),s&&d.jsx(Rl,{className:"react-flow__controls-interactive",onClick:B,title:j["controls.interactive.ariaLabel"],"aria-label":j["controls.interactive.ariaLabel"],children:k?d.jsx(eN,{}):d.jsx(Jk,{})}),v]})}vg.displayName="Controls";const xg=b.memo(vg);function nN({id:t,x:r,y:i,width:s,height:a,style:c,color:u,strokeColor:h,strokeWidth:m,className:g,borderRadius:v,shapeRendering:y,selected:x,onClick:C}){const{background:E,backgroundColor:k}=c||{},_=u||E||k;return d.jsx("rect",{className:ct(["react-flow__minimap-node",{selected:x},g]),x:r,y:i,rx:v,ry:v,width:s,height:a,style:{fill:_,stroke:h,strokeWidth:m},shapeRendering:y,onClick:C?N=>C(N,t):void 0})}const rN=b.memo(nN),iN=t=>t.nodes.map(r=>r.id),eu=t=>t instanceof Function?t:()=>t;function oN({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:c=rN,onClick:u}){const h=Oe(iN,Ze),m=eu(r),g=eu(t),v=eu(i),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:h.map(x=>d.jsx(lN,{id:x,nodeColorFunc:m,nodeStrokeColorFunc:g,nodeClassNameFunc:v,nodeBorderRadius:s,nodeStrokeWidth:a,NodeComponent:c,onClick:u,shapeRendering:y},x))})}function sN({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:a,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:h,onClick:m}){const{node:g,x:v,y,width:x,height:C}=Oe(E=>{const{internals:k}=E.nodeLookup.get(t),_=k.userNode,{x:N,y:j}=k.positionAbsolute,{width:S,height:M}=fr(_);return{node:_,x:N,y:j,width:S,height:M}},Ze);return!g||g.hidden||!pm(g)?null:d.jsx(h,{x:v,y,width:x,height:C,style:g.style,selected:!!g.selected,className:s(g),color:r(g),borderRadius:a,strokeColor:i(g),strokeWidth:c,shapeRendering:u,onClick:m,id:g.id})}const lN=b.memo(sN);var aN=b.memo(oN);const cN=200,uN=150,dN=t=>!t.hidden,fN=t=>{const r={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:r,boundingRect:t.nodeLookup.size>0?hm(xs(t.nodeLookup,{filter:dN}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},hN="react-flow__minimap-desc";function wg({style:t,className:r,nodeStrokeColor:i,nodeColor:s,nodeClassName:a="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:h,bgColor:m,maskColor:g,maskStrokeColor:v,maskStrokeWidth:y,position:x="bottom-right",onClick:C,onNodeClick:E,pannable:k=!1,zoomable:_=!1,ariaLabel:N,inversePan:j,zoomStep:S=1,offsetScale:M=5}){const $=Je(),L=b.useRef(null),{boundingRect:H,viewBB:Z,rfId:B,panZoom:J,translateExtent:W,flowWidth:G,flowHeight:te,ariaLabelConfig:z}=Oe(fN,Ze),Q=(t==null?void 0:t.width)??cN,T=(t==null?void 0:t.height)??uN,K=H.width/Q,R=H.height/T,A=Math.max(K,R),U=A*Q,P=A*T,O=M*A,oe=H.x-(U-H.width)/2-O,se=H.y-(P-H.height)/2-O,he=U+O*2,de=P+O*2,pe=`${hN}-${B}`,ie=b.useRef(0),me=b.useRef();ie.current=A,b.useEffect(()=>{if(L.current&&J)return me.current=P1({domNode:L.current,panZoom:J,getTransform:()=>$.getState().transform,getViewScale:()=>ie.current}),()=>{var Ne;(Ne=me.current)==null||Ne.destroy()}},[J]),b.useEffect(()=>{var Ne;(Ne=me.current)==null||Ne.update({translateExtent:W,width:G,height:te,inversePan:j,pannable:k,zoomStep:S,zoomable:_})},[k,_,j,S,W,G,te]);const ke=C?Ne=>{var Ae;const[ze,Be]=((Ae=me.current)==null?void 0:Ae.pointer(Ne))||[0,0];C(Ne,{x:ze,y:Be})}:void 0,je=E?b.useCallback((Ne,ze)=>{const Be=$.getState().nodeLookup.get(ze).internals.userNode;E(Ne,Be)},[]):void 0,be=N??z["minimap.ariaLabel"];return d.jsx(sa,{position:x,style:{...t,"--xy-minimap-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-background-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof y=="number"?y*A:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:ct(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:Q,height:T,viewBox:`${oe} ${se} ${he} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":pe,ref:L,onClick:ke,children:[be&&d.jsx("title",{id:pe,children:be}),d.jsx(aN,{onClick:je,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:c,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:h}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${oe-O},${se-O}h${he+O*2}v${de+O*2}h${-he-O*2}z
62
+ M${Z.x},${Z.y}h${Z.width}v${Z.height}h${-Z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}wg.displayName="MiniMap";b.memo(wg);const pN=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,mN={[Ei.Line]:"right",[Ei.Handle]:"bottom-right"};function gN({nodeId:t,position:r,variant:i=Ei.Handle,className:s,style:a=void 0,children:c,color:u,minWidth:h=10,minHeight:m=10,maxWidth:g=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:y=!1,resizeDirection:x,autoScale:C=!0,shouldResize:E,onResizeStart:k,onResize:_,onResizeEnd:N}){const j=Gm(),S=typeof t=="string"?t:j,M=Je(),$=b.useRef(null),L=i===Ei.Handle,H=Oe(b.useCallback(pN(L&&C),[L,C]),Ze),Z=b.useRef(null),B=r??mN[i];b.useEffect(()=>{if(!(!$.current||!S))return Z.current||(Z.current=Y1({domNode:$.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:W,transform:G,snapGrid:te,snapToGrid:z,nodeOrigin:Q,domNode:T}=M.getState();return{nodeLookup:W,transform:G,snapGrid:te,snapToGrid:z,nodeOrigin:Q,paneDomNode:T}},onChange:(W,G)=>{const{triggerNodeChanges:te,nodeLookup:z,parentLookup:Q,nodeOrigin:T}=M.getState(),K=[],R={x:W.x,y:W.y},A=z.get(S);if(A&&A.expandParent&&A.parentId){const U=A.origin??T,P=W.width??A.measured.width??0,O=W.height??A.measured.height??0,oe={id:A.id,parentId:A.parentId,rect:{width:P,height:O,...mm({x:W.x??A.position.x,y:W.y??A.position.y},{width:P,height:O},A.parentId,z,U)}},se=zu([oe],z,Q,T);K.push(...se),R.x=W.x?Math.max(U[0]*P,W.x):void 0,R.y=W.y?Math.max(U[1]*O,W.y):void 0}if(R.x!==void 0&&R.y!==void 0){const U={id:S,type:"position",position:{...R}};K.push(U)}if(W.width!==void 0&&W.height!==void 0){const P={id:S,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:W.width,height:W.height}};K.push(P)}for(const U of G){const P={...U,type:"position"};K.push(P)}te(K)},onEnd:({width:W,height:G})=>{const te={id:S,type:"dimensions",resizing:!1,dimensions:{width:W,height:G}};M.getState().triggerNodeChanges([te])}})),Z.current.update({controlPosition:B,boundaries:{minWidth:h,minHeight:m,maxWidth:g,maxHeight:v},keepAspectRatio:y,resizeDirection:x,onResizeStart:k,onResize:_,onResizeEnd:N,shouldResize:E}),()=>{var W;(W=Z.current)==null||W.destroy()}},[B,h,m,g,v,y,k,_,N,E]);const J=B.split("-");return d.jsx("div",{className:ct(["react-flow__resize-control","nodrag",...J,i,s]),ref:$,style:{...a,scale:H,...u&&{[L?"backgroundColor":"borderColor"]:u}},children:c})}const mp=b.memo(gN);function yN({nodeId:t,isVisible:r=!0,handleClassName:i,handleStyle:s,lineClassName:a,lineStyle:c,color:u,minWidth:h=10,minHeight:m=10,maxWidth:g=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:y=!1,autoScale:x=!0,shouldResize:C,onResizeStart:E,onResize:k,onResizeEnd:_}){return r?d.jsxs(d.Fragment,{children:[F1.map(N=>d.jsx(mp,{className:a,style:c,nodeId:t,position:N,variant:Ei.Line,color:u,minWidth:h,minHeight:m,maxWidth:g,maxHeight:v,onResizeStart:E,keepAspectRatio:y,autoScale:x,shouldResize:C,onResize:k,onResizeEnd:_},N)),O1.map(N=>d.jsx(mp,{className:i,style:s,nodeId:t,position:N,color:u,minWidth:h,minHeight:m,maxWidth:g,maxHeight:v,onResizeStart:E,keepAspectRatio:y,autoScale:x,shouldResize:C,onResize:k,onResizeEnd:_},N))]}):null}function vN(t,r){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const i=document.implementation.createHTMLDocument(),s=i.createElement("base"),a=i.createElement("a");return i.head.appendChild(s),i.body.appendChild(a),r&&(s.href=r),a.href=t,a.href}const xN=(()=>{let t=0;const r=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${r()}${t}`)})();function Yr(t){const r=[];for(let i=0,s=t.length;i<s;i++)r.push(t[i]);return r}let so=null;function Sg(t={}){return so||(t.includeStyleProperties?(so=t.includeStyleProperties,so):(so=Yr(window.getComputedStyle(document.documentElement)),so))}function Kl(t,r){const s=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(r);return s?parseFloat(s.replace("px","")):0}function wN(t){const r=Kl(t,"border-left-width"),i=Kl(t,"border-right-width");return t.clientWidth+r+i}function SN(t){const r=Kl(t,"border-top-width"),i=Kl(t,"border-bottom-width");return t.clientHeight+r+i}function kg(t,r={}){const i=r.width||wN(t),s=r.height||SN(t);return{width:i,height:s}}function kN(){let t,r;try{r=process}catch{}const i=r&&r.env?r.env.devicePixelRatio:null;return i&&(t=parseInt(i,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const qt=16384;function NN(t){(t.width>qt||t.height>qt)&&(t.width>qt&&t.height>qt?t.width>t.height?(t.height*=qt/t.width,t.width=qt):(t.width*=qt/t.height,t.height=qt):t.width>qt?(t.height*=qt/t.width,t.width=qt):(t.width*=qt/t.height,t.height=qt))}function Ql(t){return new Promise((r,i)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>r(s))})},s.onerror=i,s.crossOrigin="anonymous",s.decoding="async",s.src=t})}async function EN(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(r=>`data:image/svg+xml;charset=utf-8,${r}`)}async function CN(t,r,i){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),c=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${r}`),a.setAttribute("height",`${i}`),a.setAttribute("viewBox",`0 0 ${r} ${i}`),c.setAttribute("width","100%"),c.setAttribute("height","100%"),c.setAttribute("x","0"),c.setAttribute("y","0"),c.setAttribute("externalResourcesRequired","true"),a.appendChild(c),c.appendChild(t),EN(a)}const Vt=(t,r)=>{if(t instanceof r)return!0;const i=Object.getPrototypeOf(t);return i===null?!1:i.constructor.name===r.name||Vt(i,r)};function _N(t){const r=t.getPropertyValue("content");return`${t.cssText} content: '${r.replace(/'|"/g,"")}';`}function jN(t,r){return Sg(r).map(i=>{const s=t.getPropertyValue(i),a=t.getPropertyPriority(i);return`${i}: ${s}${a?" !important":""};`}).join(" ")}function bN(t,r,i,s){const a=`.${t}:${r}`,c=i.cssText?_N(i):jN(i,s);return document.createTextNode(`${a}{${c}}`)}function gp(t,r,i,s){const a=window.getComputedStyle(t,i),c=a.getPropertyValue("content");if(c===""||c==="none")return;const u=xN();try{r.className=`${r.className} ${u}`}catch{return}const h=document.createElement("style");h.appendChild(bN(u,i,a,s)),r.appendChild(h)}function MN(t,r,i){gp(t,r,":before",i),gp(t,r,":after",i)}const yp="application/font-woff",vp="image/jpeg",PN={woff:yp,woff2:yp,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:vp,jpeg:vp,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function IN(t){const r=/\.([^./]*?)$/g.exec(t);return r?r[1]:""}function Du(t){const r=IN(t).toLowerCase();return PN[r]||""}function TN(t){return t.split(/,/)[1]}function yu(t){return t.search(/^(data:)/)!==-1}function RN(t,r){return`data:${r};base64,${t}`}async function Ng(t,r,i){const s=await fetch(t,r);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((c,u)=>{const h=new FileReader;h.onerror=u,h.onloadend=()=>{try{c(i({res:s,result:h.result}))}catch(m){u(m)}},h.readAsDataURL(a)})}const tu={};function zN(t,r,i){let s=t.replace(/\?.*/,"");return i&&(s=t),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),r?`[${r}]${s}`:s}async function $u(t,r,i){const s=zN(t,r,i.includeQueryParams);if(tu[s]!=null)return tu[s];i.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let a;try{const c=await Ng(t,i.fetchRequestInit,({res:u,result:h})=>(r||(r=u.headers.get("Content-Type")||""),TN(h)));a=RN(c,r)}catch(c){a=i.imagePlaceholder||"";let u=`Failed to fetch resource: ${t}`;c&&(u=typeof c=="string"?c:c.message),u&&console.warn(u)}return tu[s]=a,a}async function AN(t){const r=t.toDataURL();return r==="data:,"?t.cloneNode(!1):Ql(r)}async function LN(t,r){if(t.currentSrc){const c=document.createElement("canvas"),u=c.getContext("2d");c.width=t.clientWidth,c.height=t.clientHeight,u==null||u.drawImage(t,0,0,c.width,c.height);const h=c.toDataURL();return Ql(h)}const i=t.poster,s=Du(i),a=await $u(i,s,r);return Ql(a)}async function DN(t,r){var i;try{if(!((i=t==null?void 0:t.contentDocument)===null||i===void 0)&&i.body)return await ca(t.contentDocument.body,r,!0)}catch{}return t.cloneNode(!1)}async function $N(t,r){return Vt(t,HTMLCanvasElement)?AN(t):Vt(t,HTMLVideoElement)?LN(t,r):Vt(t,HTMLIFrameElement)?DN(t,r):t.cloneNode(Eg(t))}const ON=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",Eg=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function FN(t,r,i){var s,a;if(Eg(r))return r;let c=[];return ON(t)&&t.assignedNodes?c=Yr(t.assignedNodes()):Vt(t,HTMLIFrameElement)&&(!((s=t.contentDocument)===null||s===void 0)&&s.body)?c=Yr(t.contentDocument.body.childNodes):c=Yr(((a=t.shadowRoot)!==null&&a!==void 0?a:t).childNodes),c.length===0||Vt(t,HTMLVideoElement)||await c.reduce((u,h)=>u.then(()=>ca(h,i)).then(m=>{m&&r.appendChild(m)}),Promise.resolve()),r}function HN(t,r,i){const s=r.style;if(!s)return;const a=window.getComputedStyle(t);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):Sg(i).forEach(c=>{let u=a.getPropertyValue(c);c==="font-size"&&u.endsWith("px")&&(u=`${Math.floor(parseFloat(u.substring(0,u.length-2)))-.1}px`),Vt(t,HTMLIFrameElement)&&c==="display"&&u==="inline"&&(u="block"),c==="d"&&r.getAttribute("d")&&(u=`path(${r.getAttribute("d")})`),s.setProperty(c,u,a.getPropertyPriority(c))})}function BN(t,r){Vt(t,HTMLTextAreaElement)&&(r.innerHTML=t.value),Vt(t,HTMLInputElement)&&r.setAttribute("value",t.value)}function VN(t,r){if(Vt(t,HTMLSelectElement)){const s=Array.from(r.children).find(a=>t.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function WN(t,r,i){return Vt(r,Element)&&(HN(t,r,i),MN(t,r,i),BN(t,r),VN(t,r)),r}async function UN(t,r){const i=t.querySelectorAll?t.querySelectorAll("use"):[];if(i.length===0)return t;const s={};for(let c=0;c<i.length;c++){const h=i[c].getAttribute("xlink:href");if(h){const m=t.querySelector(h),g=document.querySelector(h);!m&&g&&!s[h]&&(s[h]=await ca(g,r,!0))}}const a=Object.values(s);if(a.length){const c="http://www.w3.org/1999/xhtml",u=document.createElementNS(c,"svg");u.setAttribute("xmlns",c),u.style.position="absolute",u.style.width="0",u.style.height="0",u.style.overflow="hidden",u.style.display="none";const h=document.createElementNS(c,"defs");u.appendChild(h);for(let m=0;m<a.length;m++)h.appendChild(a[m]);t.appendChild(u)}return t}async function ca(t,r,i){return!i&&r.filter&&!r.filter(t)?null:Promise.resolve(t).then(s=>$N(s,r)).then(s=>FN(t,s,r)).then(s=>WN(t,s,r)).then(s=>UN(s,r))}const Cg=/url\((['"]?)([^'"]+?)\1\)/g,YN=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,XN=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function GN(t){const r=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${r})(['"]?\\))`,"g")}function KN(t){const r=[];return t.replace(Cg,(i,s,a)=>(r.push(a),i)),r.filter(i=>!yu(i))}async function QN(t,r,i,s,a){try{const c=i?vN(r,i):r,u=Du(r);let h;return a||(h=await $u(c,u,s)),t.replace(GN(r),`$1${h}$3`)}catch{}return t}function qN(t,{preferredFontFormat:r}){return r?t.replace(XN,i=>{for(;;){const[s,,a]=YN.exec(i)||[];if(!a)return"";if(a===r)return`src: ${s};`}}):t}function _g(t){return t.search(Cg)!==-1}async function jg(t,r,i){if(!_g(t))return t;const s=qN(t,i);return KN(s).reduce((c,u)=>c.then(h=>QN(h,u,r,i)),Promise.resolve(s))}async function lo(t,r,i){var s;const a=(s=r.style)===null||s===void 0?void 0:s.getPropertyValue(t);if(a){const c=await jg(a,null,i);return r.style.setProperty(t,c,r.style.getPropertyPriority(t)),!0}return!1}async function ZN(t,r){await lo("background",t,r)||await lo("background-image",t,r),await lo("mask",t,r)||await lo("-webkit-mask",t,r)||await lo("mask-image",t,r)||await lo("-webkit-mask-image",t,r)}async function JN(t,r){const i=Vt(t,HTMLImageElement);if(!(i&&!yu(t.src))&&!(Vt(t,SVGImageElement)&&!yu(t.href.baseVal)))return;const s=i?t.src:t.href.baseVal,a=await $u(s,Du(s),r);await new Promise((c,u)=>{t.onload=c,t.onerror=r.onImageErrorHandler?(...m)=>{try{c(r.onImageErrorHandler(...m))}catch(g){u(g)}}:u;const h=t;h.decode&&(h.decode=c),h.loading==="lazy"&&(h.loading="eager"),i?(t.srcset="",t.src=a):t.href.baseVal=a})}async function eE(t,r){const s=Yr(t.childNodes).map(a=>bg(a,r));await Promise.all(s).then(()=>t)}async function bg(t,r){Vt(t,Element)&&(await ZN(t,r),await JN(t,r),await eE(t,r))}function tE(t,r){const{style:i}=t;r.backgroundColor&&(i.backgroundColor=r.backgroundColor),r.width&&(i.width=`${r.width}px`),r.height&&(i.height=`${r.height}px`);const s=r.style;return s!=null&&Object.keys(s).forEach(a=>{i[a]=s[a]}),t}const xp={};async function wp(t){let r=xp[t];if(r!=null)return r;const s=await(await fetch(t)).text();return r={url:t,cssText:s},xp[t]=r,r}async function Sp(t,r){let i=t.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,c=(i.match(/url\([^)]+\)/g)||[]).map(async u=>{let h=u.replace(s,"$1");return h.startsWith("https://")||(h=new URL(h,t.url).href),Ng(h,r.fetchRequestInit,({result:m})=>(i=i.replace(u,`url(${m})`),[u,m]))});return Promise.all(c).then(()=>i)}function kp(t){if(t==null)return[];const r=[],i=/(\/\*[\s\S]*?\*\/)/gi;let s=t.replace(i,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const m=a.exec(s);if(m===null)break;r.push(m[0])}s=s.replace(a,"");const c=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,u="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",h=new RegExp(u,"gi");for(;;){let m=c.exec(s);if(m===null){if(m=h.exec(s),m===null)break;c.lastIndex=h.lastIndex}else h.lastIndex=c.lastIndex;r.push(m[0])}return r}async function nE(t,r){const i=[],s=[];return t.forEach(a=>{if("cssRules"in a)try{Yr(a.cssRules||[]).forEach((c,u)=>{if(c.type===CSSRule.IMPORT_RULE){let h=u+1;const m=c.href,g=wp(m).then(v=>Sp(v,r)).then(v=>kp(v).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?h+=1:a.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:y,error:x})}})).catch(v=>{console.error("Error loading remote css",v.toString())});s.push(g)}})}catch(c){const u=t.find(h=>h.href==null)||document.styleSheets[0];a.href!=null&&s.push(wp(a.href).then(h=>Sp(h,r)).then(h=>kp(h).forEach(m=>{u.insertRule(m,u.cssRules.length)})).catch(h=>{console.error("Error loading remote stylesheet",h)})),console.error("Error inlining remote css file",c)}}),Promise.all(s).then(()=>(t.forEach(a=>{if("cssRules"in a)try{Yr(a.cssRules||[]).forEach(c=>{i.push(c)})}catch(c){console.error(`Error while reading CSS rules from ${a.href}`,c)}}),i))}function rE(t){return t.filter(r=>r.type===CSSRule.FONT_FACE_RULE).filter(r=>_g(r.style.getPropertyValue("src")))}async function iE(t,r){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const i=Yr(t.ownerDocument.styleSheets),s=await nE(i,r);return rE(s)}function Mg(t){return t.trim().replace(/["']/g,"")}function oE(t){const r=new Set;function i(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(c=>{r.add(Mg(c))}),Array.from(s.children).forEach(c=>{c instanceof HTMLElement&&i(c)})}return i(t),r}async function sE(t,r){const i=await iE(t,r),s=oE(t);return(await Promise.all(i.filter(c=>s.has(Mg(c.style.fontFamily))).map(c=>{const u=c.parentStyleSheet?c.parentStyleSheet.href:null;return jg(c.cssText,u,r)}))).join(`
63
+ `)}async function lE(t,r){const i=r.fontEmbedCSS!=null?r.fontEmbedCSS:r.skipFonts?null:await sE(t,r);if(i){const s=document.createElement("style"),a=document.createTextNode(i);s.appendChild(a),t.firstChild?t.insertBefore(s,t.firstChild):t.appendChild(s)}}async function Pg(t,r={}){const{width:i,height:s}=kg(t,r),a=await ca(t,r,!0);return await lE(a,r),await bg(a,r),tE(a,r),await CN(a,i,s)}async function aE(t,r={}){const{width:i,height:s}=kg(t,r),a=await Pg(t,r),c=await Ql(a),u=document.createElement("canvas"),h=u.getContext("2d"),m=r.pixelRatio||kN(),g=r.canvasWidth||i,v=r.canvasHeight||s;return u.width=g*m,u.height=v*m,r.skipAutoScale||NN(u),u.style.width=`${g}`,u.style.height=`${v}`,r.backgroundColor&&(h.fillStyle=r.backgroundColor,h.fillRect(0,0,u.width,u.height)),h.drawImage(c,0,0,u.width,u.height),u}async function cE(t,r={}){return(await aE(t,r)).toDataURL()}function uE({feature:t,onClose:r}){return d.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:r,children:d.jsxs("div",{style:{background:"#1e1e2e",border:"1px solid #444",borderRadius:12,padding:"32px 40px",maxWidth:420,textAlign:"center"},onClick:i=>i.stopPropagation(),children:[d.jsx("div",{style:{fontSize:32,marginBottom:12},children:"🔒"}),d.jsxs("h2",{style:{color:"#fff",margin:"0 0 8px",fontSize:20},children:[t," is a Pro feature"]}),d.jsxs("p",{style:{color:"#aaa",margin:"0 0 24px",fontSize:14,lineHeight:1.5},children:["Upgrade to Pro for ",t.toLowerCase(),", drift detection, premium agents, and more."]}),d.jsx("a",{href:"https://heartbyte.io/archbyte/pricing",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",background:"#7c3aed",color:"#fff",padding:"10px 28px",borderRadius:8,textDecoration:"none",fontWeight:600,fontSize:14},children:"Upgrade to Pro"}),d.jsx("button",{onClick:r,style:{display:"block",margin:"16px auto 0",background:"none",border:"none",color:"#888",cursor:"pointer",fontSize:13},children:"Maybe later"})]})})}function Np({trigger:t,triggerClassName:r,contentClassName:i,children:s,disabled:a}){const[c,u]=b.useState(!1),h=b.useRef(null);return b.useEffect(()=>{if(!c)return;const m=v=>{h.current&&!h.current.contains(v.target)&&u(!1)},g=()=>u(!1);return document.addEventListener("mousedown",m),document.addEventListener("dropdown:closeall",g),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("dropdown:closeall",g)}},[c]),d.jsxs("div",{ref:h,className:"dropdown-wrapper",children:[d.jsx("button",{className:r,onClick:()=>!a&&u(!c),disabled:a,children:t}),c&&d.jsx("div",{className:`dropdown-menu ${i||""}`,onClick:()=>u(!1),children:s})]})}const dE={presentation:"#1971c2",application:"#e67700",data:"#2f9e44",external:"#9c36b5",deployment:"#c92a2a"},Ep={frontend:"■",backend:"⬡",service:"⬡",worker:"⚙",gateway:"⬥",database:"⎕",external:"☁",component:"●",cli:"❯",library:"≡"};function fE({data:t,selected:r}){var g,v,y,x;const i=t,s=i.label.split(`
64
+ `),a=s[0],c=s.slice(1).join(`
65
+ `),u=["arch-node",i.layer,i.active?"active":"",i.highlighted?"highlighted":"",i.locked?"locked":"",i.isConnected===!0?"connected":"",i.isConnected===!1?"dimmed":"",i.isSearchMatch===!0?"search-match":"",i.isSearchMatch===!1?"search-no-match":"",i.changeType?`change-${i.changeType}`:"",i.impactDepth!=null?`impact-depth-${Math.min(i.impactDepth,3)}`:"",i.impactDirection?`impact-${i.impactDirection}`:"",i.healthScore!=null?i.healthScore>=75?"health-green":i.healthScore>=50?"health-amber":"health-red":"",(g=i.healthFlags)!=null&&g.isOrphan?"health-orphan":"",(v=i.healthFlags)!=null&&v.isHub?"health-hub":"",(y=i.healthFlags)!=null&&y.inCycle?"health-cycle":""].filter(Boolean).join(" "),h=dE[i.layer]||"#868e96",m=Ep[i.nodeType]||Ep.component;return d.jsxs(d.Fragment,{children:[d.jsx(yN,{color:h,isVisible:r,minWidth:100,minHeight:60}),d.jsxs("div",{className:u,style:{minWidth:i.width||130,width:"100%",height:"100%"},children:[d.jsx(Ur,{type:"target",position:_e.Top}),d.jsx(Ur,{type:"target",position:_e.Left}),d.jsx("div",{className:"node-type-icon",children:m}),d.jsxs("div",{className:"node-content",children:[d.jsx("div",{className:"label",children:a}),c&&d.jsx("div",{className:"sublabel",children:c}),i.description&&d.jsx("div",{className:"node-desc",children:i.description})]}),i.techStack&&i.techStack.length>0&&d.jsx("div",{className:"node-tech-row",children:i.techStack.slice(0,3).map((C,E)=>d.jsx("span",{className:"node-tech-pill",children:C},E))}),i.changeType&&d.jsx("div",{className:`change-indicator change-${i.changeType}`,children:i.changeType==="added"?"+":i.changeType==="modified"?"~":"-"}),((x=i.healthFlags)==null?void 0:x.isHub)&&i.healthScore!=null&&d.jsx("div",{className:"health-hub-badge",children:"HUB"}),d.jsx(Ur,{type:"source",position:_e.Bottom}),d.jsx(Ur,{type:"source",position:_e.Right})]})]})}const Ig=b.memo(fE),hE={develop:"#2f9e44",development:"#2f9e44",dev:"#2f9e44",staging:"#e67700",stage:"#e67700",production:"#c92a2a",prod:"#c92a2a"};function pE({selectedEnvironment:t,environments:r,onSelectEnvironment:i}){if(!r||Object.keys(r).length===0)return null;const s=Object.keys(r);return d.jsx("div",{className:"environment-tabs",children:s.map(a=>{var g;const c=t===a,u=r==null?void 0:r[a],h=(u==null?void 0:u.color)||hE[a]||"#6b7280",m=(u==null?void 0:u.label)||a.charAt(0).toUpperCase()+a.slice(1);return d.jsxs("button",{className:`env-tab ${c?"selected":""}`,onClick:()=>i(a),style:{"--env-color":h},children:[d.jsx("span",{className:"env-indicator"}),d.jsx("span",{className:"env-label",children:m}),c&&u&&d.jsx("span",{className:"env-meta",children:[u.deployment,u.scaling,(g=u.urlPatterns||u.urls)==null?void 0:g[0]].filter(Boolean).join(" | ")})]},a)})})}const mE=b.memo(pE);function vi({children:t,className:r,style:i}){const s=b.useRef(null),[a,c]=b.useState({x:0,y:0}),u=b.useRef(!1),h=b.useRef({x:0,y:0}),m=b.useRef({x:0,y:0}),g=b.useCallback(v=>{const y=v.target;if(!y.closest("[data-drag-handle]")||y.closest("button"))return;u.current=!0,h.current={x:v.clientX,y:v.clientY},m.current={...a},v.preventDefault();const C=k=>{u.current&&c({x:m.current.x+(k.clientX-h.current.x),y:m.current.y+(k.clientY-h.current.y)})},E=()=>{u.current=!1,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",E)},[a]);return d.jsx("div",{ref:s,className:r,style:{...i,transform:`translate(${a.x}px, ${a.y}px)`},onMouseDown:g,children:t})}function gE(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function yE(t){return new Date(t).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function vE({visible:t,onClose:r}){const[i,s]=b.useState(null),a=b.useCallback(async()=>{try{const c=await fetch("/api/stats");c.ok&&s(await c.json())}catch{}},[]);return b.useEffect(()=>{t&&a()},[t,a]),!t||!i?null:d.jsxs(vi,{className:"stats-overlay",children:[d.jsxs("div",{className:"stats-overlay-header","data-drag-handle":!0,children:[d.jsx("span",{className:"stats-overlay-title",children:"Architecture Stats"}),d.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]}),(i.durationMs||i.filesScanned||i.analyzedAt)&&d.jsxs("div",{className:"stats-scan-info",children:[i.durationMs!=null&&d.jsx("span",{className:"scan-info-item",children:gE(i.durationMs)}),i.filesScanned!=null&&d.jsxs("span",{className:"scan-info-item",children:[i.filesScanned.toLocaleString()," files"]}),i.tokenUsage&&d.jsxs("span",{className:"scan-info-item",children:[(i.tokenUsage.input+i.tokenUsage.output).toLocaleString()," tokens"]}),i.analyzedAt&&d.jsx("span",{className:"scan-info-item",children:yE(i.analyzedAt)})]}),d.jsxs("div",{className:"stats-grid",children:[d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-value",children:i.components}),d.jsx("div",{className:"stat-label",children:"Components"})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-value",children:i.totalConnections}),d.jsx("div",{className:"stat-label",children:"Connections"})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-value",children:i.databases}),d.jsx("div",{className:"stat-label",children:"Databases"})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-value",children:i.externalServices}),d.jsx("div",{className:"stat-label",children:"External"})]}),d.jsxs("div",{className:`stat-card ${i.orphans>0?"highlight":""}`,children:[d.jsx("div",{className:"stat-value",children:i.orphans}),d.jsx("div",{className:"stat-label",children:"Orphans"})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-value",children:i.flows}),d.jsx("div",{className:"stat-label",children:"Flows"})]})]})]})}const xE=b.memo(vE);function wE({visible:t,onClose:r,builtinRules:i,customRules:s,onAddRule:a,onDeleteRule:c,onSave:u,saving:h}){const[m,g]=b.useState("builtin"),[v,y]=b.useState(""),[x,C]=b.useState(""),[E,k]=b.useState(""),[_,N]=b.useState("warn");if(!t)return null;const j=()=>{!v.trim()||!x.trim()||!E.trim()||(a({name:v.trim(),from:x.trim(),to:E.trim(),level:_}),y(""),C(""),k(""),N("warn"))};return d.jsxs(d.Fragment,{children:[d.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:999},onClick:r}),d.jsxs("div",{className:"rules-config-modal",children:[d.jsxs("div",{className:"rules-modal-header",children:[d.jsx("span",{className:"rules-modal-title",children:"Configure Rules"}),d.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]}),d.jsxs("div",{className:"rules-modal-tabs",children:[d.jsx("button",{className:`rules-modal-tab ${m==="builtin"?"active":""}`,onClick:()=>g("builtin"),children:"Built-in"}),d.jsx("button",{className:`rules-modal-tab ${m==="custom"?"active":""}`,onClick:()=>g("custom"),children:"Custom"})]}),d.jsxs("div",{className:"rules-modal-content",children:[m==="builtin"&&d.jsxs("div",{children:[d.jsx("div",{className:"rules-section-title",children:"Built-in Architecture Rules"}),i.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"12px 0"},children:"No built-in rules available"}):i.map(S=>d.jsxs("div",{className:"rule-config-item",children:[d.jsx("div",{className:"rule-config-name",children:S.name}),d.jsx("div",{className:"rule-config-desc",children:S.description||"No description"})]},S.name))]}),m==="custom"&&d.jsxs("div",{children:[d.jsx("div",{className:"rules-section-title",children:"Custom Rules"}),s.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"12px 0"},children:"No custom rules yet"}):s.map((S,M)=>d.jsxs("div",{className:"rule-config-item custom",children:[d.jsxs("div",{className:"rule-config-name",children:[S.name,d.jsx("span",{className:`rule-level-badge ${S.level}`,children:S.level})]}),d.jsxs("div",{className:"rule-config-matcher",children:[S.from," → ",S.to]}),d.jsx("button",{className:"panel-btn red small rule-delete-btn",onClick:()=>c(M),children:"x"})]},M)),d.jsxs("div",{className:"rule-add-form",children:[d.jsx("div",{className:"rule-add-title",children:"Add Custom Rule"}),d.jsx("input",{type:"text",placeholder:"Rule name",value:v,onChange:S=>y(S.target.value),className:"rule-input"}),d.jsxs("div",{className:"rule-add-row",children:[d.jsx("input",{type:"text",placeholder:"From (e.g. layer:presentation)",value:x,onChange:S=>C(S.target.value),className:"rule-input"}),d.jsx("span",{className:"rule-arrow",children:"→"}),d.jsx("input",{type:"text",placeholder:"To (e.g. layer:data)",value:E,onChange:S=>k(S.target.value),className:"rule-input"})]}),d.jsxs("div",{className:"rule-add-row",children:[d.jsxs("select",{value:_,onChange:S=>N(S.target.value),className:"rule-select",children:[d.jsx("option",{value:"warn",children:"warn"}),d.jsx("option",{value:"error",children:"error"})]}),d.jsx("button",{className:"panel-btn green small",onClick:j,children:"Add"})]})]}),d.jsx("div",{className:"rules-save-row",children:d.jsx("button",{className:"panel-btn cyan",onClick:u,disabled:h,children:h?"Saving...":"Save & Re-audit"})})]})]})]})]})}const SE=b.memo(wE);function kE(t){return t>=75?"var(--accent-green)":t>=50?"var(--accent-amber)":"var(--accent-red)"}function NE({visible:t,onClose:r,onHighlightNode:i}){var Z;const[s,a]=b.useState(null),[c,u]=b.useState(!1),[h,m]=b.useState(!1),[g,v]=b.useState([]),[y,x]=b.useState(!1),[C,E]=b.useState("issues"),[k,_]=b.useState({issues:{rules:!1,structural:!1},metrics:{metrics:!1,components:!1}}),N=(B,J)=>{_(W=>({...W,[B]:{...W[B],[J]:!W[B][J]}}))},j=b.useCallback(async()=>{var B;u(!0);try{const J=await fetch("/api/audit");if(J.ok){const W=await J.json();a(W),(B=W.rules)!=null&&B.custom&&v(W.rules.custom)}}catch{}u(!1)},[]);b.useEffect(()=>{t&&j()},[t,j]);const S=async()=>{x(!0);try{await fetch("/api/rules",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:g})}),await j()}catch{}x(!1)},M=B=>{v(g.filter((J,W)=>W!==B))};if(!t)return null;const $=(s==null?void 0:s.issues.filter(B=>B.type==="rule-violation"))||[],L=(s==null?void 0:s.issues.filter(B=>B.type==="structural"))||[],H=s?[...s.nodes].sort((B,J)=>B.modularityIndex-J.modularityIndex):[];return d.jsxs(vi,{className:"audit-panel",children:[d.jsxs("div",{className:"audit-header","data-drag-handle":!0,children:[d.jsx("span",{className:"audit-title",children:"Architecture Audit"}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("button",{className:"panel-btn cyan small",onClick:j,disabled:c,children:c?"...":"Re-audit"}),d.jsx("button",{className:`panel-btn small ${h?"cyan":""}`,onClick:()=>m(!h),children:"Config"}),d.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]})]}),d.jsxs("div",{className:"audit-tabs",children:[d.jsx("button",{className:`audit-tab ${C==="issues"?"active":""}`,onClick:()=>E("issues"),children:"Issues"}),d.jsx("button",{className:`audit-tab ${C==="metrics"?"active":""}`,onClick:()=>E("metrics"),children:"Metrics"})]}),c&&!s?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:12},children:"Auditing..."}):s?d.jsxs(d.Fragment,{children:[C==="issues"&&d.jsxs(d.Fragment,{children:[$.length>0&&d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>N("issues","rules"),children:[d.jsx("span",{className:"audit-section-toggle",children:k.issues.rules?"▼":"▶"}),d.jsxs("span",{className:"audit-section-title",children:["Rule Violations (",$.length,")"]})]}),k.issues.rules&&d.jsx("div",{className:"audit-section-content",children:$.map((B,J)=>d.jsxs("div",{className:`audit-issue ${B.level}`,onClick:()=>{B.nodeIds&&B.nodeIds.length>0&&i(B.nodeIds[0])},children:[d.jsxs("div",{className:"audit-issue-rule",children:[B.rule,B.ruleType==="custom"&&d.jsx("span",{className:"rule-type-badge custom",children:"custom"})]}),d.jsx("div",{className:"audit-issue-message",children:B.message})]},J))})]}),L.length>0&&d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>N("issues","structural"),children:[d.jsx("span",{className:"audit-section-toggle",children:k.issues.structural?"▼":"▶"}),d.jsxs("span",{className:"audit-section-title",children:["Structural Issues (",L.length,")"]})]}),k.issues.structural&&d.jsx("div",{className:"audit-section-content",children:L.map((B,J)=>d.jsxs("div",{className:`audit-issue ${B.level}`,onClick:()=>{B.nodeIds&&B.nodeIds.length>0&&i(B.nodeIds[0])},children:[d.jsx("div",{className:"audit-issue-rule",children:B.metric}),d.jsx("div",{className:"audit-issue-message",children:B.message})]},J))})]})]}),C==="metrics"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>N("metrics","metrics"),children:[d.jsx("span",{className:"audit-section-toggle",children:k.metrics.metrics?"▼":"▶"}),d.jsx("span",{className:"audit-section-title",children:"Architecture Metrics"})]}),k.metrics.metrics&&d.jsx("div",{className:"audit-section-content",children:d.jsxs("div",{className:"audit-metrics",children:[d.jsxs("div",{className:"audit-metric-row",children:[d.jsx("span",{className:"audit-metric-label",children:"Circular Dependencies"}),d.jsx("span",{style:{color:s.metrics.circularDependencies>0?"var(--accent-red)":"var(--accent-green)"},children:s.metrics.circularDependencies})]}),d.jsxs("div",{className:"audit-metric-row",children:[d.jsx("span",{className:"audit-metric-label",children:"High-Degree Hubs"}),d.jsx("span",{style:{color:s.metrics.highDegreeHubCount>0?"var(--accent-amber)":"var(--accent-green)"},children:s.metrics.highDegreeHubCount})]}),d.jsxs("div",{className:"audit-metric-row",children:[d.jsx("span",{className:"audit-metric-label",children:"Disconnected"}),d.jsx("span",{style:{color:s.metrics.disconnectedComponentCount>0?"var(--accent-amber)":"var(--accent-green)"},children:s.metrics.disconnectedComponentCount})]})]})})]}),d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>N("metrics","components"),children:[d.jsx("span",{className:"audit-section-toggle",children:k.metrics.components?"▼":"▶"}),d.jsxs("span",{className:"audit-section-title",children:["Component Health (",s.nodes.length,")"]})]}),k.metrics.components&&d.jsx("div",{className:"audit-section-content",children:H.map(B=>d.jsxs("div",{className:"audit-component-item",onClick:()=>i(B.id),children:[d.jsx("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:kE(B.modularityIndex),flexShrink:0},title:`Health: ${B.modularityIndex}/100`}),d.jsxs("div",{className:"audit-component-info",children:[d.jsx("div",{className:"audit-component-name",children:B.label}),d.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)"},children:[B.inDegree,"↓ ",B.outDegree,"↑"]})]})]},B.id))})]})]}),d.jsx(SE,{visible:h,onClose:()=>m(!1),builtinRules:((Z=s.rules)==null?void 0:Z.builtin)||[],customRules:g,onAddRule:B=>{v([...g,B])},onDeleteRule:B=>M(B),onSave:S,saving:y})]}):null]})}const EE=b.memo(NE),Cp=[{label:"30s",value:"30s"},{label:"1m",value:"1m"},{label:"5m",value:"5m"},{label:"15m",value:"15m"}];function nu(t){return t?t.addedNodes.length+t.removedNodes.length+t.modifiedNodes.length+t.addedEdges.length+t.removedEdges.length>0:!1}function CE({visible:t}){const[r,i]=b.useState(null),[s,a]=b.useState([]),[c,u]=b.useState(!0),[h,m]=b.useState(!1),[g,v]=b.useState("5m"),y=b.useCallback(async()=>{try{const[j,S]=await Promise.all([fetch("/api/patrol/latest"),fetch("/api/patrol/history")]);j.ok&&i(await j.json()),S.ok&&a(await S.json())}catch{}u(!1)},[]),x=b.useCallback(async()=>{try{const j=await fetch("/api/patrol/running");if(j.ok){const S=await j.json();m(S.running)}}catch{}},[]);b.useEffect(()=>{if(t){y(),x();const j=setInterval(()=>{y(),x()},h?3e3:1e4);return()=>clearInterval(j)}},[t,y,x,h]);const C=async()=>{try{(await fetch("/api/patrol/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({interval:g})})).ok&&m(!0)}catch{}},E=async()=>{try{(await fetch("/api/patrol/stop",{method:"POST"})).ok&&m(!1)}catch{}};if(!t)return null;if(c)return d.jsx("div",{className:"ops-section",children:d.jsx("div",{className:"ops-empty",children:"Loading..."})});if(!r&&s.length===0)return d.jsxs("div",{className:"ops-section",children:[d.jsxs("div",{className:"ops-empty",children:["No patrol data yet.",d.jsx("span",{className:"ops-hint",children:"Start continuous patrol to begin"})]}),d.jsx("div",{className:"patrol-actions",children:d.jsxs("div",{className:"patrol-interval-row",children:[d.jsx("select",{className:"patrol-interval-select",value:g,onChange:j=>v(j.target.value),children:Cp.map(j=>d.jsx("option",{value:j.value,children:j.label},j.value))}),d.jsx("button",{className:"panel-btn green",onClick:C,disabled:h,children:h?"Running...":"Start Patrol"})]})})]});const k=s.slice(-20),_=k.filter(j=>j.passed).length,N=k.length>0?Math.round(_/k.length*100):0;return d.jsxs("div",{className:"ops-section",children:[d.jsx("div",{className:"patrol-actions",children:d.jsxs("div",{className:"patrol-interval-row",children:[d.jsx("select",{className:"patrol-interval-select",value:g,onChange:j=>v(j.target.value),children:Cp.map(j=>d.jsx("option",{value:j.value,children:j.label},j.value))}),h?d.jsx("button",{className:"panel-btn red",onClick:E,children:"Stop"}):d.jsx("button",{className:"panel-btn green",onClick:C,children:"Start"})]})}),k.length>0&&d.jsxs("div",{className:"patrol-sparkline-row",children:[d.jsx("div",{className:"patrol-sparkline",children:k.map((j,S)=>d.jsx("div",{className:`spark-dot ${j.passed?"healthy":"violation"}`,title:`${new Date(j.timestamp).toLocaleTimeString()} - ${j.passed?"Healthy":"Violation"}`},S))}),d.jsxs("span",{className:"patrol-health-pct",children:[N,"%"]})]}),r&&d.jsxs("div",{className:`patrol-status-card ${r.passed?"healthy":"violation"}`,children:[d.jsxs("div",{className:"patrol-status-row",children:[d.jsx("span",{className:`patrol-badge ${r.passed?"healthy":"violation"}`,children:r.passed?"HEALTHY":"VIOLATION"}),d.jsx("span",{className:"patrol-time",children:new Date(r.timestamp).toLocaleTimeString()})]}),d.jsxs("div",{className:"patrol-counts",children:[r.errors>0&&d.jsxs("span",{className:"patrol-count error",children:[r.errors," err"]}),r.warnings>0&&d.jsxs("span",{className:"patrol-count warn",children:[r.warnings," warn"]}),r.errors===0&&r.warnings===0&&!nu(r.structuralDiff)&&d.jsx("span",{className:"patrol-count ok",children:"All clear"}),nu(r.structuralDiff)&&d.jsx("span",{className:"patrol-count warn",children:"Drift detected"})]}),r.totalNodes!=null&&d.jsxs("div",{className:"patrol-arch-counts",children:[d.jsxs("span",{children:[r.totalNodes," nodes"]}),d.jsxs("span",{children:[r.totalEdges," edges"]}),r.durationMs!=null&&d.jsxs("span",{children:[(r.durationMs/1e3).toFixed(1),"s"]})]})]}),r&&nu(r.structuralDiff)&&d.jsxs("div",{className:"patrol-violations",children:[d.jsx("div",{className:"patrol-violations-label",children:"Architecture drift"}),r.structuralDiff.addedNodes.map((j,S)=>d.jsxs("div",{className:"patrol-violation-item resolved",children:[d.jsx("span",{className:"patrol-v-rule",children:"+"}),d.jsxs("span",{className:"patrol-v-msg",children:[j.label," (",j.type,")"]})]},`add-${S}`)),r.structuralDiff.removedNodes.map((j,S)=>d.jsxs("div",{className:"patrol-violation-item error",children:[d.jsx("span",{className:"patrol-v-rule",children:"-"}),d.jsxs("span",{className:"patrol-v-msg",children:[j.label," (",j.type,")"]})]},`rem-${S}`)),r.structuralDiff.modifiedNodes.slice(0,5).map((j,S)=>d.jsxs("div",{className:"patrol-violation-item warn",children:[d.jsx("span",{className:"patrol-v-rule",children:"~"}),d.jsxs("span",{className:"patrol-v-msg",children:[j.id,": ",j.field," changed"]})]},`mod-${S}`)),(r.structuralDiff.addedEdges.length>0||r.structuralDiff.removedEdges.length>0)&&d.jsxs("div",{className:"patrol-violation-item warn",children:[d.jsx("span",{className:"patrol-v-rule",children:"Δ"}),d.jsxs("span",{className:"patrol-v-msg",children:["+",r.structuralDiff.addedEdges.length," / -",r.structuralDiff.removedEdges.length," connections"]})]})]}),(r==null?void 0:r.git)&&(r.git.commitCount>0||r.git.changedFileCount>0)&&d.jsxs("div",{className:"patrol-git-info",children:[d.jsx("div",{className:"patrol-violations-label",children:"Git changes"}),d.jsxs("div",{className:"patrol-git-summary",children:[r.git.commitCount>0&&d.jsxs("span",{children:[r.git.commitCount," commit(s)"]}),d.jsxs("span",{children:[r.git.changedFileCount," file(s) changed"]})]}),r.git.changedFiles&&r.git.changedFiles.length>0&&d.jsxs("div",{className:"patrol-git-files",children:[r.git.changedFiles.slice(0,8).map((j,S)=>d.jsx("div",{className:"patrol-git-file",children:j},S)),r.git.changedFiles.length>8&&d.jsxs("div",{className:"patrol-git-file",style:{opacity:.5},children:["+",r.git.changedFiles.length-8," more"]})]})]}),r&&r.newViolations.length>0&&d.jsxs("div",{className:"patrol-violations",children:[d.jsx("div",{className:"patrol-violations-label",children:"New violations"}),r.newViolations.slice(0,5).map((j,S)=>d.jsxs("div",{className:`patrol-violation-item ${j.level}`,children:[d.jsx("span",{className:"patrol-v-rule",children:j.rule}),d.jsx("span",{className:"patrol-v-msg",children:j.message})]},S))]}),r&&r.resolvedViolations.length>0&&d.jsxs("div",{className:"patrol-violations resolved",children:[d.jsx("div",{className:"patrol-violations-label",children:"Resolved"}),r.resolvedViolations.slice(0,3).map((j,S)=>d.jsxs("div",{className:"patrol-violation-item resolved",children:[d.jsx("span",{className:"patrol-v-rule",children:j.rule}),d.jsx("span",{className:"patrol-v-msg",children:j.message})]},S))]}),d.jsxs("div",{className:"patrol-summary",children:[s.length," patrols total"]})]})}const _E=b.memo(CE);function jE({visible:t}){const[r,i]=b.useState([]),[s,a]=b.useState(null),[c,u]=b.useState(null),[h,m]=b.useState(!0),[g,v]=b.useState(null),[y,x]=b.useState(null),C=b.useRef(null),E=b.useCallback(async()=>{try{const j=await fetch("/api/workflow/list");j.ok&&i(await j.json())}catch{}m(!1)},[]),k=b.useCallback(async j=>{try{const S=await fetch(`/api/workflow/status/${j}`);if(S.ok){const M=await S.json();u(M),M&&g===j&&(M.status==="completed"||M.status==="failed")&&(v(null),E())}}catch{}},[g,E]);b.useEffect(()=>{if(t){E();const j=setInterval(E,g?3e3:1e4);return()=>clearInterval(j)}},[t,E,g]),b.useEffect(()=>(C.current&&clearInterval(C.current),s&&(k(s),C.current=setInterval(()=>k(s),g?3e3:1e4)),()=>{C.current&&clearInterval(C.current)}),[s,k,g]);const _=async j=>{x(null);try{const S=await fetch(`/api/workflow/run/${j}`,{method:"POST"});if(S.ok)v(j);else{const M=await S.json();x(M.error||"Failed to start workflow")}}catch{x("Failed to connect to server")}},N=async j=>{x(null);try{(await fetch("/api/workflow/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:j})})).ok&&(u(null),E())}catch{}};return t?h?d.jsx("div",{className:"ops-section",children:d.jsx("div",{className:"ops-empty",children:"Loading..."})}):r.length===0?d.jsx("div",{className:"ops-section",children:d.jsxs("div",{className:"ops-empty",children:["No workflows available.",d.jsx("span",{className:"ops-hint",children:"Run: archbyte workflow --list"})]})}):d.jsxs("div",{className:"ops-section",children:[y&&d.jsx("div",{className:"wf-error",children:y}),r.map(j=>{const S=s===j.id,M=g===j.id;return d.jsxs("div",{className:"wf-item",children:[d.jsxs("div",{className:"wf-header",onClick:()=>a(S?null:j.id),children:[d.jsxs("div",{className:"wf-header-left",children:[d.jsx("span",{className:"wf-expand",children:S?"−":"+"}),d.jsx("span",{className:"wf-name",children:j.name}),j.builtin&&d.jsx("span",{className:"wf-tag",children:"built-in"})]}),(M||j.status)&&d.jsx("span",{className:`wf-status ${M?"running":j.status}`,children:M?"running":j.status==="completed"?"done":j.status})]}),S&&d.jsxs("div",{className:"wf-detail",children:[d.jsx("div",{className:"wf-desc",children:j.description}),c&&c.workflowId===j.id?d.jsxs("div",{className:"wf-steps",children:[Object.entries(c.steps).map(([$,L])=>d.jsxs("div",{className:`wf-step ${L.status}`,children:[d.jsx("span",{className:"wf-step-icon",children:L.status==="completed"?"✓":L.status==="running"?"▶":L.status==="failed"?"✗":"○"}),d.jsx("span",{className:"wf-step-id",children:$})]},$)),(()=>{const $=Object.keys(c.steps).length,L=Object.values(c.steps).filter(Z=>Z.status==="completed").length,H=$>0?Math.round(L/$*100):0;return d.jsxs("div",{className:"wf-progress",children:[d.jsx("div",{className:"wf-progress-bar",children:d.jsx("div",{className:"wf-progress-fill",style:{width:`${H}%`}})}),d.jsxs("span",{className:"wf-progress-label",children:[H,"%"]})]})})()]}):d.jsx("div",{className:"wf-steps-preview",children:j.steps.length>0?j.steps.join(" → "):"No state yet"}),d.jsxs("div",{className:"wf-actions",children:[d.jsx("button",{className:"panel-btn cyan",disabled:M,onClick:()=>_(j.id),children:M?"Running...":"Run"}),(j.status==="completed"||j.status==="failed")&&!M&&d.jsx("button",{className:"panel-btn amber",onClick:()=>N(j.id),children:"Reset"})]})]})]},j.id)})]}):null}const bE=b.memo(jE);function ME({projectInfo:t}){const[r,i]=b.useState(!1),s=b.useRef(null);return b.useEffect(()=>{if(!r)return;const a=c=>{s.current&&!s.current.contains(c.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r]),t?d.jsxs("div",{className:"project-info-wrapper",ref:s,children:[d.jsx("button",{className:"project-info-trigger",onClick:()=>i(!r),children:t.name}),r&&d.jsxs("div",{className:"project-info-popup",children:[d.jsxs("div",{className:"project-info-header",children:[d.jsx("span",{className:"project-info-name",children:t.name}),t.primaryLanguage&&d.jsx("span",{className:"project-info-lang",children:t.primaryLanguage})]}),t.description&&d.jsx("p",{className:"project-info-desc",children:t.description}),t.isMonorepo&&d.jsx("div",{className:"project-info-badge",children:"Monorepo"}),t.workspacePath&&d.jsxs("a",{className:"project-info-vscode",href:`vscode://file${t.workspacePath}`,title:"Open folder in VS Code",children:[d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:d.jsx("path",{d:"M17.583 2.214L12.52 6.768 7.84 3.96 2.4 5.88v12.24l5.44 1.92 4.68-2.808 5.063 4.554L21.6 19.8V4.2l-4.017-1.986zM7.84 15.12V8.88l4.68 3.12-4.68 3.12zm9.743 2.544l-3.96-3.564 3.96-3.564v7.128z"})}),"Open in VS Code"]})]})]}):null}const PE={architecture:Ig},IE=1500;function TE({flow:t,architecture:r,onClose:i}){var C;const[s,a]=b.useState(0),[c,u]=b.useState(new Set([(C=t.steps[0])==null?void 0:C.edge])),[h,m]=b.useState(!0),{flowNodeIds:g,flowEdges:v}=b.useMemo(()=>{const E=new Set(t.steps.map(N=>N.edge)),k=r.edges.filter(N=>E.has(N.id)),_=new Set;return k.forEach(N=>{_.add(N.source),_.add(N.target)}),{flowNodeIds:_,flowEdges:k}},[t,r]),y=b.useMemo(()=>{const E=r.nodes.filter(J=>g.has(J.id)),k=320,_=140,N=80,j=80,S=new Map,M=new Map;g.forEach(J=>{S.set(J,0),M.set(J,[])}),v.forEach(J=>{g.has(J.source)&&g.has(J.target)&&(M.get(J.source).push(J.target),S.set(J.target,(S.get(J.target)||0)+1))});const $=new Map,L=[];for(S.forEach((J,W)=>{J===0&&(L.push(W),$.set(W,0))});L.length>0;){const J=L.shift(),W=$.get(J);for(const G of M.get(J)||[]){const te=W+1;(!$.has(G)||$.get(G)<te)&&$.set(G,te),S.set(G,S.get(G)-1),S.get(G)===0&&L.push(G)}}E.forEach(J=>{$.has(J.id)||$.set(J.id,0)});const H=new Map;E.forEach(J=>{const W=$.get(J.id);H.has(W)||H.set(W,[]),H.get(W).push(J)});const Z=[...H.keys()].sort((J,W)=>J-W),B=new Map;return Z.forEach((J,W)=>{H.get(J).forEach((te,z)=>{B.set(te.id,{x:N+W*k,y:j+z*_})})}),E.map(J=>{const W=B.get(J.id)||{x:N,y:j};return{id:J.id,type:"architecture",position:W,data:{label:J.label,layer:J.layer,nodeType:J.type,width:J.width,height:J.height,path:J.path,techStack:J.techStack,description:J.description},style:{width:J.width,zIndex:1}}})},[r,g,v]);b.useEffect(()=>{if(!h)return;const E=setInterval(()=>{a(k=>{const _=k+1;if(_>=t.steps.length)return u(new Set([t.steps[0].edge])),0;const N=new Set;for(let j=0;j<=_;j++)N.add(t.steps[j].edge);return u(N),_})},IE);return()=>clearInterval(E)},[h,t]);const x=b.useMemo(()=>{const E=new Map;return t.steps.forEach((k,_)=>{E.has(k.edge)||E.set(k.edge,_+1)}),v.map(k=>{const _=c.has(k.id),N=E.get(k.id);return{id:k.id,source:k.source,target:k.target,label:_&&N?`${N}`:void 0,labelStyle:_&&N?{fill:"#fff",fontWeight:700,fontSize:13,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:_&&N?{fill:t.color,fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:_?t.color:k.color||"var(--border-color)",strokeWidth:_?5:2,opacity:_?1:.3,filter:_?"brightness(0.85) saturate(1.4)":void 0},animated:_,type:"smoothstep"}})},[v,c,t]);return d.jsx("div",{className:"flow-hud-overlay",children:d.jsxs(vi,{className:"flow-hud-panel",children:[d.jsxs("div",{className:"flow-hud-header","data-drag-handle":!0,children:[d.jsxs("div",{className:"flow-hud-title",children:[d.jsx("span",{className:"flow-hud-dot",style:{background:t.color}}),d.jsx("span",{children:t.name})]}),d.jsxs("div",{className:"flow-hud-controls",children:[h?d.jsx("button",{className:"flow-hud-btn",onClick:()=>m(!1),title:"Pause",children:"⏸"}):d.jsx("button",{className:"flow-hud-btn",onClick:()=>m(!0),title:"Play",children:"▶"}),d.jsx("button",{className:"flow-hud-close",onClick:i,title:"Close",children:"✕"})]})]}),d.jsx("div",{className:"flow-hud-description",children:t.description}),d.jsx("div",{className:"flow-hud-canvas",children:d.jsxs(mg,{nodes:y,edges:x,nodeTypes:PE,fitView:!0,fitViewOptions:{padding:.3},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,minZoom:.3,maxZoom:2,proOptions:{hideAttribution:!0},children:[d.jsx(yg,{variant:Hn.Dots,gap:20,size:1,color:"var(--grid-color)"}),d.jsx(xg,{showInteractive:!1})]})}),d.jsx("div",{className:"flow-hud-steps",children:t.steps.map((E,k)=>d.jsxs("div",{className:`flow-hud-step ${k<=s?"active":""} ${k===s?"current":""}`,style:{borderColor:k<=s?t.color:void 0},children:[d.jsx("span",{className:"flow-hud-step-num",style:{background:k<=s?t.color:void 0},children:k+1}),E.label]},k))})]})})}function RE(t){return d.jsx(pg,{children:d.jsx(TE,{...t})})}const zE=b.memo(RE),AE=[{key:"anthropic",name:"Anthropic",icon:"A",models:"Claude 3.5 Sonnet, Claude 3 Opus",description:"Advanced reasoning and code analysis",requiresKey:!0},{key:"openai",name:"OpenAI",icon:"O",models:"GPT-4o, GPT-4 Turbo",description:"Versatile general-purpose models",requiresKey:!0},{key:"google",name:"Google",icon:"G",models:"Gemini 1.5 Pro, Gemini 1.5 Flash",description:"Fast multimodal analysis",requiresKey:!0}];function LE({onComplete:t}){const[r,i]=b.useState(1),[s,a]=b.useState(null),[c,u]=b.useState(""),[h,m]=b.useState(!1),[g,v]=b.useState(null),y=k=>{a(k),u(""),v(null),k.requiresKey?i(2):i(3)},x=()=>{if(!c.trim()){v("API key is required");return}v(null),i(3)},C=async()=>{if(s){m(!0),v(null);try{const k={provider:s.key};s.requiresKey&&c.trim()&&(k.apiKey=c.trim());const _=await fetch("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)});if(!_.ok){const N=await _.json();throw new Error(N.error||"Failed to save configuration")}t()}catch(k){v(k instanceof Error?k.message:"Failed to save configuration"),m(!1)}}},E=()=>{v(null),r===3&&(s!=null&&s.requiresKey)?i(2):r===3&&!(s!=null&&s.requiresKey)?i(1):(i(1),a(null),u(""))};return d.jsx("div",{style:Te.overlay,onClick:k=>k.stopPropagation(),children:d.jsxs("div",{style:Te.modal,children:[d.jsxs("div",{style:Te.header,children:[d.jsx("div",{style:Te.headerIcon,children:"⚙"}),d.jsx("h2",{style:Te.title,children:"Set Up Your AI Provider"}),d.jsx("p",{style:Te.subtitle,children:"ArchByte uses AI to analyze your codebase and generate architecture diagrams. Choose a provider to get started."})]}),d.jsx("div",{style:Te.stepIndicator,children:[1,2,3].map(k=>d.jsxs("div",{style:Te.stepRow,children:[d.jsx("div",{style:{...Te.stepDot,background:k<=r?"#7c3aed":"#3a3a4a",color:k<=r?"#fff":"#888"},children:k}),d.jsx("span",{style:{...Te.stepLabel,color:k<=r?"#ccc":"#666"},children:k===1?"Provider":k===2?"API Key":"Confirm"}),k<3&&d.jsx("div",{style:{...Te.stepLine,background:k<r?"#7c3aed":"#3a3a4a"}})]},k))}),r===1&&d.jsx("div",{style:Te.stepContent,children:d.jsx("div",{style:Te.providerGrid,children:AE.map(k=>d.jsxs("button",{style:{...Te.providerCard,borderColor:(s==null?void 0:s.key)===k.key?"#7c3aed":"#5a5a7a"},onClick:()=>y(k),onMouseEnter:_=>{_.currentTarget.style.borderColor="#7c3aed",_.currentTarget.style.background="#2a2a3e"},onMouseLeave:_=>{(s==null?void 0:s.key)!==k.key&&(_.currentTarget.style.borderColor="#5a5a7a"),_.currentTarget.style.background="#252536"},children:[d.jsx("div",{style:Te.providerIcon,children:k.icon}),d.jsx("div",{style:Te.providerName,children:k.name}),d.jsx("div",{style:Te.providerModels,children:k.models}),d.jsx("div",{style:Te.providerDesc,children:k.description}),!k.requiresKey&&d.jsx("div",{style:Te.noKeyBadge,children:"No API key needed"})]},k.key))})}),r===2&&s&&d.jsx("div",{style:Te.stepContent,children:d.jsxs("div",{style:Te.keySection,children:[d.jsxs("div",{style:Te.selectedProviderBadge,children:[d.jsx("span",{style:Te.providerIconSmall,children:s.icon}),d.jsx("span",{children:s.name})]}),d.jsx("label",{style:Te.label,children:"API Key"}),d.jsx("input",{type:"password",value:c,onChange:k=>{u(k.target.value),v(null)},placeholder:`Enter your ${s.name} API key`,style:Te.input,autoFocus:!0,onKeyDown:k=>{k.key==="Enter"&&x()}}),d.jsxs("p",{style:Te.keyHint,children:["Your key is stored locally in ",d.jsx("code",{style:Te.code,children:".archbyte/config.json"})," and never sent to external servers."]}),g&&d.jsx("div",{style:Te.error,children:g}),d.jsxs("div",{style:Te.buttonRow,children:[d.jsx("button",{style:Te.backBtn,onClick:E,children:"Back"}),d.jsx("button",{style:{...Te.primaryBtn,opacity:c.trim()?1:.5,cursor:c.trim()?"pointer":"not-allowed"},onClick:x,disabled:!c.trim(),children:"Continue"})]})]})}),r===3&&s&&d.jsx("div",{style:Te.stepContent,children:d.jsxs("div",{style:Te.confirmSection,children:[d.jsx("div",{style:Te.confirmIcon,children:"✓"}),d.jsx("h3",{style:Te.confirmTitle,children:"Ready to Analyze"}),d.jsxs("div",{style:Te.confirmDetails,children:[d.jsxs("div",{style:Te.confirmRow,children:[d.jsx("span",{style:Te.confirmLabel,children:"Provider"}),d.jsxs("span",{style:Te.confirmValue,children:[d.jsx("span",{style:Te.providerIconSmall,children:s.icon}),s.name]})]}),d.jsxs("div",{style:Te.confirmRow,children:[d.jsx("span",{style:Te.confirmLabel,children:"Models"}),d.jsx("span",{style:Te.confirmValue,children:s.models})]}),s.requiresKey&&d.jsxs("div",{style:Te.confirmRow,children:[d.jsx("span",{style:Te.confirmLabel,children:"API Key"}),d.jsxs("span",{style:Te.confirmValue,children:["*".repeat(Math.min(c.length,8)),"...",c.slice(-4)]})]})]}),g&&d.jsx("div",{style:Te.error,children:g}),d.jsxs("div",{style:Te.buttonRow,children:[d.jsx("button",{style:Te.backBtn,onClick:E,children:"Back"}),d.jsx("button",{style:{...Te.runBtn,opacity:h?.6:1,cursor:h?"wait":"pointer"},onClick:C,disabled:h,children:h?"Saving...":"Run First Analysis"})]})]})})]})})}const Te={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,backdropFilter:"blur(4px)"},modal:{background:"#1e1e2e",border:"1px solid #5a5a7a",borderRadius:16,padding:"36px 40px",maxWidth:600,width:"90vw",maxHeight:"90vh",overflowY:"auto"},header:{textAlign:"center",marginBottom:24},headerIcon:{fontSize:36,marginBottom:8,color:"#7c3aed"},title:{color:"#fff",margin:"0 0 8px",fontSize:22,fontWeight:700},subtitle:{color:"#999",margin:0,fontSize:14,lineHeight:1.5},stepIndicator:{display:"flex",alignItems:"center",justifyContent:"center",gap:0,marginBottom:28},stepRow:{display:"flex",alignItems:"center",gap:6},stepDot:{width:26,height:26,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,flexShrink:0},stepLabel:{fontSize:12,fontWeight:500},stepLine:{width:40,height:2,marginLeft:6,marginRight:6,borderRadius:1},stepContent:{minHeight:200},providerGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:14},providerCard:{background:"#252536",border:"1px solid #5a5a7a",borderRadius:12,padding:"20px 16px",cursor:"pointer",textAlign:"left",transition:"border-color 0.15s, background 0.15s",display:"flex",flexDirection:"column",gap:6},providerIcon:{width:40,height:40,borderRadius:10,background:"#3a3a5a",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:800,color:"#7c3aed",marginBottom:4},providerName:{color:"#fff",fontSize:16,fontWeight:600},providerModels:{color:"#aaa",fontSize:12,lineHeight:1.4},providerDesc:{color:"#777",fontSize:11,lineHeight:1.4},noKeyBadge:{marginTop:4,fontSize:10,color:"#4ade80",fontWeight:600,textTransform:"uppercase",letterSpacing:.5},keySection:{display:"flex",flexDirection:"column",gap:14},selectedProviderBadge:{display:"inline-flex",alignItems:"center",gap:8,background:"#2a2a3e",border:"1px solid #5a5a7a",borderRadius:8,padding:"8px 14px",color:"#ccc",fontSize:14,fontWeight:500,alignSelf:"flex-start"},providerIconSmall:{width:22,height:22,borderRadius:6,background:"#3a3a5a",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:800,color:"#7c3aed"},label:{color:"#ccc",fontSize:13,fontWeight:600},input:{width:"100%",padding:"12px 14px",background:"#161622",border:"1px solid #5a5a7a",borderRadius:8,color:"#fff",fontSize:14,outline:"none",fontFamily:"'JetBrains Mono', monospace",boxSizing:"border-box"},keyHint:{color:"#777",fontSize:12,margin:0,lineHeight:1.4},code:{background:"#2a2a3e",padding:"2px 6px",borderRadius:4,fontSize:11,color:"#aaa"},error:{color:"#f87171",fontSize:13,padding:"8px 12px",background:"rgba(248, 113, 113, 0.1)",border:"1px solid rgba(248, 113, 113, 0.3)",borderRadius:8},buttonRow:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:8},backBtn:{padding:"10px 20px",background:"transparent",border:"1px solid #5a5a7a",borderRadius:8,color:"#aaa",fontSize:14,cursor:"pointer",fontWeight:500},primaryBtn:{padding:"10px 24px",background:"#7c3aed",border:"none",borderRadius:8,color:"#fff",fontSize:14,cursor:"pointer",fontWeight:600},confirmSection:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:12},confirmIcon:{width:52,height:52,borderRadius:"50%",background:"rgba(124, 58, 237, 0.15)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:26,color:"#7c3aed"},confirmTitle:{color:"#fff",fontSize:18,fontWeight:600,margin:0},confirmDetails:{width:"100%",maxWidth:360,background:"#252536",border:"1px solid #5a5a7a",borderRadius:10,padding:"14px 18px",display:"flex",flexDirection:"column",gap:10,textAlign:"left"},confirmRow:{display:"flex",justifyContent:"space-between",alignItems:"center"},confirmLabel:{color:"#888",fontSize:13},confirmValue:{color:"#ddd",fontSize:13,fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},runBtn:{padding:"12px 28px",background:"linear-gradient(135deg, #7c3aed, #6d28d9)",border:"none",borderRadius:8,color:"#fff",fontSize:15,cursor:"pointer",fontWeight:700,letterSpacing:.3}},DE={"security-audit":{label:"Security Audit",icon:"⚠",color:"var(--accent-red)"},compliance:{label:"Compliance",icon:"☑",color:"var(--accent-cyan)"},performance:{label:"Performance",icon:"⚡",color:"var(--accent-amber)"},"dependency-risk":{label:"Dependency Risk",icon:"⬢",color:"#c084fc"},migration:{label:"Migration Plan",icon:"→",color:"var(--accent-green)"},"api-contracts":{label:"API Contracts",icon:"↔",color:"#60a5fa"},"drift-detection":{label:"Drift Detection",icon:"◎",color:"#f472b6"}},Xr={critical:0,high:1,medium:2,low:3};function ks({severity:t}){const r={critical:"var(--accent-red)",high:"hsl(25 95% 53%)",medium:"var(--accent-amber)",low:"var(--accent-green)"},i={critical:"hsl(0 90% 55% / 0.15)",high:"hsl(25 95% 53% / 0.15)",medium:"hsl(38 92% 50% / 0.15)",low:"hsl(142 76% 42% / 0.15)"},s={critical:"hsl(0 90% 55% / 0.3)",high:"hsl(25 95% 53% / 0.3)",medium:"hsl(38 92% 50% / 0.3)",low:"hsl(142 76% 42% / 0.3)"};return d.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r[t],background:i[t],border:`1px solid ${s[t]}`,whiteSpace:"nowrap"},children:t})}function $E({value:t}){const r=Math.round(t*100);return d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[d.jsx("div",{style:{flex:1,height:3,borderRadius:2,background:"var(--bg-hover)"},children:d.jsx("div",{style:{width:`${r}%`,height:"100%",borderRadius:2,background:r>=80?"var(--accent-green)":r>=50?"var(--accent-amber)":"var(--accent-red)"}})}),d.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600,minWidth:28},children:[r,"%"]})]})}function OE({status:t}){const i={compliant:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},partial:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},"non-compliant":{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"}}[t];return d.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:i.color,background:i.bg,border:`1px solid ${i.border}`},children:t})}function FE({status:t}){const i={completed:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},"in-progress":{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",border:"var(--border-color)"}}[t];return d.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:i.color,background:i.bg,border:`1px solid ${i.border}`},children:t})}function HE({driftType:t}){const i={added:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},removed:{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"},modified:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"}}[t];return d.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:i.color,background:i.bg,border:`1px solid ${i.border}`},children:t})}function BE({data:t}){const r=[...t.findings].sort((i,s)=>Xr[i.severity]-Xr[s.severity]);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No findings"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${i.severity==="critical"?"var(--accent-red)":i.severity==="high"?"hsl(25 95% 53%)":i.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:i.owaspId}),d.jsx(ks,{severity:i.severity})]}),d.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:i.title}),d.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:i.description}),i.affectedComponent&&d.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Component: ",i.affectedComponent]})]},s))})}function VE({data:t}){return t.statuses.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No compliance data"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.statuses.map((r,i)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[d.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:r.framework}),d.jsx(OE,{status:r.status})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[d.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:d.jsx("div",{style:{width:r.controls>0?`${Math.round(r.passing/r.controls*100)}%`:"0%",height:"100%",borderRadius:2,background:r.status==="compliant"?"var(--accent-green)":r.status==="partial"?"var(--accent-amber)":"var(--accent-red)",transition:"width 0.3s"}})}),d.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:500,minWidth:40,textAlign:"right"},children:[r.passing,"/",r.controls]})]}),r.findings.length>0&&d.jsx("div",{style:{marginTop:4},children:r.findings.map((s,a)=>d.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"2px 0",lineHeight:1.4},children:["- ",s]},a))})]},i))})}function WE({data:t}){const r=[...t.bottlenecks].sort((i,s)=>Xr[i.severity]-Xr[s.severity]);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No bottlenecks detected"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${i.severity==="critical"?"var(--accent-red)":i.severity==="high"?"hsl(25 95% 53%)":i.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:i.component}),d.jsx(ks,{severity:i.severity})]}),d.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:i.metric}),d.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:i.description}),i.recommendation&&d.jsx("div",{style:{fontSize:10,color:"var(--accent-cyan)",marginTop:4,fontStyle:"italic"},children:i.recommendation})]},s))})}function UE({data:t}){const r=[...t.risks].sort((i,s)=>s.riskScore-i.riskScore);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No risks identified"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsxs("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:[i.package,d.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",marginLeft:4},children:["@",i.version]})]}),d.jsx(ks,{severity:i.severity})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[d.jsx("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600},children:"Risk"}),d.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:d.jsx("div",{style:{width:`${i.riskScore}%`,height:"100%",borderRadius:2,background:i.riskScore>=75?"var(--accent-red)":i.riskScore>=50?"var(--accent-amber)":"var(--accent-green)",transition:"width 0.3s"}})}),d.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",minWidth:28},children:i.riskScore})]}),i.reasons.length>0&&d.jsx("div",{style:{marginTop:2},children:i.reasons.map((a,c)=>d.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"1px 0",lineHeight:1.4},children:["- ",a]},c))})]},s))})}function YE({data:t}){const r=[...t.steps].sort((i,s)=>i.order-s.order);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No migration plan"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${i.status==="completed"?"var(--accent-green)":i.status==="in-progress"?"var(--accent-amber)":"var(--border-color)"}`,opacity:i.status==="completed"?.7:1},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsxs("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)"},children:["Step ",i.order]}),d.jsx(FE,{status:i.status})]}),d.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:i.title}),d.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:i.description}),i.estimatedEffort&&d.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Effort: ",i.estimatedEffort]})]},s))})}function XE({data:t}){const r=[...t.mismatches].sort((i,s)=>Xr[i.severity]-Xr[s.severity]);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No mismatches found"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${i.severity==="critical"?"var(--accent-red)":i.severity==="high"?"hsl(25 95% 53%)":i.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--accent-cyan)",fontFamily:"'JetBrains Mono', monospace"},children:i.endpoint}),d.jsx(ks,{severity:i.severity})]}),d.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:4},children:i.field}),d.jsxs("div",{style:{display:"flex",gap:8,fontSize:10},children:[d.jsxs("div",{style:{flex:1},children:[d.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Spec"}),d.jsx("div",{style:{color:"var(--accent-green)",fontFamily:"'JetBrains Mono', monospace",fontSize:10,padding:"3px 6px",background:"hsl(142 76% 42% / 0.08)",borderRadius:3},children:i.specValue})]}),d.jsxs("div",{style:{flex:1},children:[d.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Impl"}),d.jsx("div",{style:{color:"var(--accent-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:10,padding:"3px 6px",background:"hsl(0 90% 55% / 0.08)",borderRadius:3},children:i.implValue})]})]})]},s))})}function GE({data:t}){const r=[...t.detections].sort((i,s)=>Xr[i.severity]-Xr[s.severity]);return r.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No drift detected"}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((i,s)=>d.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${i.severity==="critical"?"var(--accent-red)":i.severity==="high"?"hsl(25 95% 53%)":i.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[d.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:i.component}),d.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[d.jsx(HE,{driftType:i.driftType}),d.jsx(ks,{severity:i.severity})]})]}),d.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:i.description}),d.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:new Date(i.detectedAt).toLocaleString()})]},s))})}function KE({visible:t,onClose:r,results:i}){const[s,a]=b.useState(new Set),[c,u]=b.useState(!1),[h,m]=b.useState([]),g=b.useCallback(_=>{a(N=>{const j=new Set(N);return j.has(_)?j.delete(_):j.add(_),j})},[]),v=b.useCallback(async()=>{u(!0);try{const _=await fetch("/api/premium-agents/results");if(_.ok){const N=await _.json();Array.isArray(N)&&m(N)}}catch{}u(!1)},[]);b.useEffect(()=>{t&&v()},[t,v]);const y=i.length>0?i:h,x=new Map;y.forEach(_=>{x.set(_.agentId,_)});const C=["security-audit","compliance","performance","dependency-risk","migration","api-contracts","drift-detection"];function E(_){const N=_.data;switch(N.agentId){case"security-audit":return N.findings.length;case"compliance":return N.statuses.length;case"performance":return N.bottlenecks.length;case"dependency-risk":return N.risks.length;case"migration":return N.steps.length;case"api-contracts":return N.mismatches.length;case"drift-detection":return N.detections.length}}function k(_){const N=_.data;switch(N.agentId){case"security-audit":return d.jsx(BE,{data:N});case"compliance":return d.jsx(VE,{data:N});case"performance":return d.jsx(WE,{data:N});case"dependency-risk":return d.jsx(UE,{data:N});case"migration":return d.jsx(YE,{data:N});case"api-contracts":return d.jsx(XE,{data:N});case"drift-detection":return d.jsx(GE,{data:N})}}return t?d.jsxs(vi,{style:{position:"absolute",top:60,right:16,background:"var(--bg-secondary)",backdropFilter:"blur(12px)",borderRadius:12,border:"1px solid var(--border-color)",zIndex:10,width:320,maxHeight:"calc(100vh - 200px)",overflowY:"auto",boxShadow:"0 2px 12px var(--shadow-color)"},children:[d.jsxs("div",{"data-drag-handle":!0,style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 14px 8px",borderBottom:"1px solid var(--border-color)",cursor:"grab"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"1px",color:"var(--text-muted)"},children:"Pro Agents"}),d.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:3,background:"#7c3aed",color:"#fff"},children:"PRO"})]}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[d.jsx("button",{className:"panel-btn cyan small",onClick:v,disabled:c,children:c?"...":"Refresh"}),d.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]})]}),d.jsx("div",{style:{padding:"8px 10px 12px"},children:c&&y.length===0?d.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:"Loading agent results..."}):y.length===0?d.jsxs("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:["No premium agent results yet.",d.jsx("span",{style:{display:"block",marginTop:6,fontSize:10,color:"var(--accent-cyan)",opacity:.7,fontFamily:"'JetBrains Mono', monospace"},children:"Run agents to see results here"})]}):d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:C.map(_=>{const N=x.get(_);if(!N)return null;const j=DE[_],S=s.has(_),M=E(N);return d.jsxs("div",{style:{borderRadius:8,border:"1px solid var(--border-color)",overflow:"hidden"},children:[d.jsxs("div",{onClick:()=>g(_),style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 10px",background:S?"var(--bg-tertiary)":"transparent",cursor:"pointer",transition:"background 0.15s",userSelect:"none"},onMouseEnter:$=>{S||($.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:$=>{S||($.currentTarget.style.background="transparent")},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("span",{style:{fontSize:12},children:j.icon}),d.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)"},children:j.label}),M>0&&d.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"0px 5px",borderRadius:8,background:"var(--bg-hover)",color:"var(--text-secondary)"},children:M})]}),d.jsx("div",{style:{display:"flex",alignItems:"center",gap:6},children:d.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace",transition:"transform 0.2s",transform:S?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"})})]}),S&&d.jsxs("div",{style:{padding:"6px 10px 10px"},children:[d.jsxs("div",{style:{marginBottom:8},children:[d.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginBottom:3,fontWeight:500},children:"Confidence"}),d.jsx($E,{value:N.confidence})]}),k(N),d.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:8,textAlign:"right",fontFamily:"'JetBrains Mono', monospace"},children:new Date(N.timestamp).toLocaleString()})]})]},_)})})}),y.length>0&&d.jsxs("div",{style:{padding:"8px 14px",borderTop:"1px solid var(--border-color)",fontSize:10,color:"var(--text-muted)",textAlign:"center"},children:[y.length," of ",C.length," agents reporting"]})]}):null}const QE=b.memo(KE);function ao(t,r){return!t||t.length===0?!0:t.includes(r)}const qE=1500,ZE={architecture:Ig};function JE(t,r){const u=["presentation","application","data","external","deployment"],h={};t.forEach(v=>{const y=v.layer||"application";h[y]||(h[y]=[]),h[y].push(v)});const m=new Map;let g=100;return u.forEach(v=>{const y=h[v]||[];y.forEach((x,C)=>{m.set(x.id,{x:100+C*250,y:g})}),y.length>0&&(g+=180)}),Object.entries(h).forEach(([v,y])=>{u.includes(v)||(y.forEach((x,C)=>{m.set(x.id,{x:100+C*250,y:g})}),g+=180)}),t.map(v=>{const y=v.userPositioned?{x:v.x,y:v.y}:m.get(v.id)||{x:100,y:100};return{id:v.id,type:"architecture",position:y,data:{label:v.label,layer:v.layer,nodeType:v.type,width:v.width,height:v.height,path:v.path,techStack:v.techStack,description:v.description},style:{width:v.width,zIndex:1}}})}function _p(t,r="#64748b"){return t.map(i=>({id:i.id,source:i.source,target:i.target,label:void 0,labelStyle:void 0,labelBgStyle:void 0,labelBgPadding:[4,3],style:{stroke:i.color||r,strokeWidth:2,...i.style==="dashed"&&{strokeDasharray:"8 4"}},animated:i.animated||!1,type:"smoothstep",markerEnd:{type:ds.ArrowClosed,width:16,height:16,color:i.color||r}}))}function eC(){var _r;const[t,r,i]=Wk([]),[s,a,c]=Uk([]),[u,h]=b.useState(null),[m,g]=b.useState(!1),[v,y]=b.useState(null),[x]=b.useState([]),[C,E]=b.useState(!0),[k,_]=b.useState(null),[N,j]=b.useState({loggedIn:!1,email:null,tier:"free",features:{analyze:!0,validate:!0,patrol:!1,workflows:!1,chat:!1,premiumAgents:!1}}),[S,M]=b.useState(!1),[$,L]=b.useState(null),[H,Z]=b.useState(!1),[B,J]=b.useState(null),[W,G]=b.useState(!1),[,te]=b.useState(null),[z,Q]=b.useState(null),[T,K]=b.useState(null),[R,A]=b.useState(-1),[U,P]=b.useState(!1),[O,oe]=b.useState(new Set),[se,he]=b.useState(!1),[de,pe]=b.useState(new Set),[ie,me]=b.useState(new Set),[ke,je]=b.useState(null),[be,Ne]=b.useState("layer"),[ze,Be]=b.useState(!1),[Ae,et]=b.useState(!1),[Mt,pt]=b.useState(!1),[xt,wt]=b.useState(!1),[Wt,zt]=b.useState(!1),[hr,Wn]=b.useState([]),[ut,en]=b.useState(null),[jn,Gr]=b.useState(!1),[lt,bn]=b.useState("develop"),[,Ci]=b.useState([]),[_i,Kr]=b.useState(),[ji,pr]=b.useState(null),[Ut,Qr]=b.useState(null),[tn,At]=b.useState(new Map),[nn,pn]=b.useState(!1),mn=b.useRef([]),[mr,bi]=b.useState([]),Mi=50,[,gr]=b.useState([]),[,Un]=b.useState([]),[Yn,yr]=b.useState(new Set),[Nt,Mn]=b.useState(new Set),[mt,Xn]=b.useState(()=>{const V=localStorage.getItem("archbyte-theme");return V==="dark"||V==="light"?V:"light"});b.useEffect(()=>{document.documentElement.setAttribute("data-theme",mt),localStorage.setItem("archbyte-theme",mt)},[mt]);const[Pt]=b.useState(()=>!!window.__ARCHBYTE_DATA__),[Gn,rn]=b.useState(!1),[Kn,Pi]=b.useState(""),[xo,Et]=b.useState(!1),[Ye,vr]=b.useState(null),Qn=mt==="dark"?"#64748b":"#94a3b8",qr="#fff",Zr=20,Yt=10,Pn=b.useCallback(async()=>{const V=window.__ARCHBYTE_DATA__;if(V){Zn(V),j({loggedIn:!0,email:null,tier:"premium",features:{analyze:!0,validate:!0,patrol:!0,workflows:!0,chat:!0,premiumAgents:!0}}),M(!0),g(!0),E(!1);return}try{await Ri()}catch(Y){console.error("Failed to load architecture:",Y),_("Failed to connect to server"),Jr()}finally{E(!1)}},[]),wo=async()=>{try{const V=await fetch("/api/tools-git");if(V.ok){const Y=await V.json();Qr(Y)}}catch{}},Ii=async()=>{try{const V=await fetch("/api/config");if(V.ok){const Y=await V.json();if(te(Y),Y.environments){Kr(Y.environments);const re=Object.keys(Y.environments);re.length>0&&!re.includes(lt)&&bn(re[0])}}}catch{}},Xe=async()=>{try{const V=await fetch("/api/license");if(V.ok){const Y=await V.json();j(Y),M(!0)}}catch{M(!0)}},Ti=async()=>{try{const V=await fetch("/api/project");if(V.ok){const Y=await V.json();Y&&Q(Y)}}catch{}},xr=async()=>{try{const V=await fetch("/api/analysis-status");if(V.ok){const Y=await V.json();(Y==null?void 0:Y.status)==="error"&&Y.error?J(Y.error):J(null)}}catch{}},Ri=async()=>{const V="/events",Y="/api/architecture";wo(),Ii(),Ti(),Xe(),xr();try{const re=new EventSource(V);return re.onopen=()=>{console.log("SSE connected"),g(!0),_(null)},re.onmessage=le=>{try{const ne=JSON.parse(le.data);console.log("SSE message:",ne.type),ne.architecture&&Zn(ne.architecture),ne.type==="git_update"&&ne.gitInfo&&Ci(ne.gitInfo),ne.type==="premium_agent_result"&&ne.premiumResults&&Wn(ne.premiumResults),ne.type==="analyzing:started"&&G(!0),ne.type==="analyzing:finished"&&(G(!1),Ti(),xr())}catch(ne){console.error("Failed to parse SSE message:",ne)}},re.onerror=le=>{console.error("SSE error:",le),re.close(),g(!1),qn(Y)},()=>re.close()}catch{qn(Y)}},qn=async V=>{try{const Y=await fetch(V);if(Y.ok){const re=await Y.json();Zn(re),g(!0)}else Jr()}catch{Jr()}},Jr=()=>{const V={nodes:[{id:"frontend",type:"component",label:`Frontend
66
+ (Web App)`,layer:"presentation",x:150,y:170,width:200,height:100,color:"#d0ebff"},{id:"backend",type:"service",label:`Backend
67
+ (API)`,layer:"application",x:150,y:370,width:200,height:100,color:"#ffe8cc"},{id:"database",type:"database",label:"Database",layer:"data",x:150,y:570,width:200,height:80,color:"#b2f2bb"}],edges:[{id:"e1",source:"frontend",target:"backend",color:"#1971c2"},{id:"e2",source:"backend",target:"database",color:"#2f9e44"}],flows:[],lastUpdated:new Date().toISOString(),version:1};Zn(V)},Zn=V=>{h(V),y(V.lastUpdated),V.gitInfo&&Ci(V.gitInfo),V.environments&&Kr(V.environments)};b.useEffect(()=>{if(!u)return;const V=u.nodes.filter(ne=>ao(ne.environments,lt)&&!de.has(ne.id)&&!ie.has(ne.layer)),Y=new Set(V.map(ne=>ne.id)),re=u.edges.filter(ne=>ao(ne.environments,lt)&&Y.has(ne.source)&&Y.has(ne.target)),le=JE(V);if(ut){const ne=new Map;ne.set(ut.nodeId,{depth:0,direction:"origin"});for(const ge of ut.upstream)ne.set(ge.id,{depth:ge.depth,direction:"upstream"});for(const ge of ut.downstream)ne.set(ge.id,{depth:ge.depth,direction:"downstream"});for(const ge of le){const Ce=ne.get(ge.id);Ce&&(ge.data={...ge.data,impactDepth:Ce.depth,impactDirection:Ce.direction})}}r(le),a(_p(re,Qn))},[u,lt,de,ie,Qn,ut]),b.useEffect(()=>{Pn()},[Pn]),b.useEffect(()=>{if(!U||!T)return;const V=setInterval(()=>{A(Y=>{const re=Y+1;if(re>=T.steps.length)return oe(new Set([T.steps[0].edge])),0;const le=new Set;for(let ne=0;ne<=re;ne++)le.add(T.steps[ne].edge);return oe(le),re})},qE);return()=>clearInterval(V)},[U,T]),b.useEffect(()=>{if(!u)return;const V=u.nodes.filter(ge=>ao(ge.environments,lt)),Y=new Set(V.map(ge=>ge.id)),re=u.edges.filter(ge=>ao(ge.environments,lt)&&Y.has(ge.source)&&Y.has(ge.target)),le=new Map;T&&T.steps.forEach((ge,Ce)=>{le.has(ge.edge)||le.set(ge.edge,Ce+1)});const ne=re.map(ge=>{const Ce=O.has(ge.id),we=T==null?void 0:T.steps.some(We=>We.edge===ge.id),Ie=le.get(ge.id);return{id:ge.id,source:ge.source,target:ge.target,label:Ce&&Ie?`${Ie}`:void 0,labelStyle:Ce&&Ie?{fill:qr,fontWeight:700,fontSize:12,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:Ce&&Ie?{fill:(T==null?void 0:T.color)||"#3b82f6",fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:Ce?(T==null?void 0:T.color)||ge.color:ge.color||Qn,strokeWidth:Ce?6:3,opacity:T?we?1:.15:1,filter:Ce?"brightness(0.85) saturate(1.4)":void 0},animated:Ce,type:"smoothstep"}});a(ne)},[O,T,u,lt,Qn,qr]);const In=V=>{K(V),A(0),oe(new Set([V.steps[0].edge])),P(!0),he(!0)},dt=()=>{if(P(!1),K(null),A(-1),oe(new Set),he(!1),u){const V=u.nodes.filter(le=>ao(le.environments,lt)),Y=new Set(V.map(le=>le.id)),re=u.edges.filter(le=>ao(le.environments,lt)&&Y.has(le.source)&&Y.has(le.target));a(_p(re,Qn))}},So=()=>{P(!1)},It=()=>{T&&P(!0)},wr=b.useRef(de);b.useEffect(()=>{wr.current=de},[de]);const Qe=b.useCallback(()=>{gr(V=>{const Y={nodes:[...mn.current],edges:[...s],hiddenNodeIds:new Set(wr.current)},re=[...V,Y];return re.length>Mi&&re.shift(),re}),Un([])},[s]),zi=b.useCallback(V=>{pr(V),setTimeout(()=>pr(null),3e3)},[]),Sr=b.useCallback(()=>{pe(new Set)},[]);b.useCallback(V=>{me(Y=>{const re=new Set(Y);return re.has(V)?re.delete(V):re.add(V),re})},[]);const kr=b.useCallback((V,Y)=>{if(!u)return;const re=u.nodes.find(le=>le.id===Y.id);re&&(vr(re),Et(!0))},[u]),on=b.useCallback(()=>{je(null)},[]);b.useEffect(()=>{mn.current=t},[t]);const Nr=b.useCallback(V=>{i(V);const Y=V.some(le=>le.type==="position"&&le.dragging===!1&&le.position),re=V.some(le=>le.type==="dimensions"&&le.dimensions&&le.resizing===!1);(Y||re)&&Qe(),V.forEach(le=>{if(le.type==="position"&&le.dragging===!1&&le.position){const ne=mn.current.find(ge=>ge.id===le.id);ne&&At(ge=>{var Ie,We,Ve,it;const Ce=new Map(ge),we=Ce.get(le.id);return Ce.set(le.id,{id:le.id,x:le.position.x,y:le.position.y,width:(we==null?void 0:we.width)??((Ie=ne.style)==null?void 0:Ie.width)??((We=ne.data)==null?void 0:We.width)??100,height:(we==null?void 0:we.height)??((Ve=ne.style)==null?void 0:Ve.height)??((it=ne.data)==null?void 0:it.height)??60}),Ce})}if(le.type==="dimensions"&&le.dimensions&&le.resizing===!1){const ne=mn.current.find(ge=>ge.id===le.id);ne&&At(ge=>{const Ce=new Map(ge),we=Ce.get(le.id);return Ce.set(le.id,{id:le.id,x:(we==null?void 0:we.x)??ne.position.x,y:(we==null?void 0:we.y)??ne.position.y,width:le.dimensions.width,height:le.dimensions.height}),Ce})}})},[i,Qe]),Er=b.useCallback(async()=>{if(tn.size!==0){pn(!0);try{const V=Array.from(tn.values()),Y=await fetch("/api/update-positions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:V})});if(Y.ok)At(new Map),console.log("Changes saved successfully");else{const re=await Y.json();console.error("Failed to save changes:",re)}}catch(V){console.error("Error saving changes:",V)}finally{pn(!1)}}},[tn]),ko=b.useCallback(()=>{At(new Map),Pn()},[Pn]),Cr=b.useCallback(()=>{gr(V=>{if(V.length===0)return V;const Y=[...V],re=Y.pop();if(Un(le=>[...le,{nodes:[...mn.current],edges:[...s],hiddenNodeIds:new Set(wr.current)}]),r(re.nodes),a(re.edges),pe(re.hiddenNodeIds),u){const le=new Map;re.nodes.forEach(ne=>{var Ce,we,Ie,We;const ge=u.nodes.find(Ve=>Ve.id===ne.id);if(ge){const Ve=ne.position.x,it=ne.position.y,Le=((Ce=ne.style)==null?void 0:Ce.width)??((we=ne.data)==null?void 0:we.width)??100,tt=((Ie=ne.style)==null?void 0:Ie.height)??((We=ne.data)==null?void 0:We.height)??60;(Ve!==ge.x||it!==ge.y||Le!==ge.width||tt!==ge.height)&&le.set(ne.id,{id:ne.id,x:Ve,y:it,width:Le,height:tt})}}),At(le)}return Y})},[s,r,a,u]),Jn=b.useCallback(()=>{Un(V=>{if(V.length===0)return V;const Y=[...V],re=Y.pop();if(gr(le=>[...le,{nodes:[...mn.current],edges:[...s],hiddenNodeIds:new Set(wr.current)}]),r(re.nodes),a(re.edges),pe(re.hiddenNodeIds),u){const le=new Map;re.nodes.forEach(ne=>{var Ce,we,Ie,We;const ge=u.nodes.find(Ve=>Ve.id===ne.id);if(ge){const Ve=ne.position.x,it=ne.position.y,Le=((Ce=ne.style)==null?void 0:Ce.width)??((we=ne.data)==null?void 0:we.width)??100,tt=((Ie=ne.style)==null?void 0:Ie.height)??((We=ne.data)==null?void 0:We.height)??60;(Ve!==ge.x||it!==ge.y||Le!==ge.width||tt!==ge.height)&&le.set(ne.id,{id:ne.id,x:Ve,y:it,width:Le,height:tt})}}),At(le)}return Y})},[s,r,a,u]),ei=b.useCallback(({nodes:V})=>{Mn(new Set(V.map(Y=>Y.id))),V.length===1?je(V[0].id):V.length===0&&je(null)},[]),Tn=b.useCallback(()=>{if(Nt.size===0&&!ke)return;Qe();const V=Nt.size>0?Nt:new Set([ke]);pe(Y=>new Set([...Y,...V])),Mn(new Set),je(null)},[Nt,ke,Qe]),ti=b.useCallback(()=>{const V=Nt.size>0?Nt:ke?new Set([ke]):new Set;if(V.size===0)return;const Y=t.filter(re=>V.has(re.id));bi(Y)},[t,Nt,ke]),Ai=b.useCallback(()=>{if(mr.length===0)return;Qe();const V=50,Y=mr.map((re,le)=>{var ne;return{...re,id:`${re.id}-copy-${Date.now()}-${le}`,position:{x:re.position.x+V,y:re.position.y+V},selected:!0,data:{...re.data,label:`${((ne=re.data)==null?void 0:ne.label)||re.id} (copy)`}}});r(re=>[...re.map(le=>({...le,selected:!1})),...Y]),Y.forEach(re=>{At(le=>{var ge,Ce,we,Ie;const ne=new Map(le);return ne.set(re.id,{id:re.id,x:re.position.x,y:re.position.y,width:((ge=re.style)==null?void 0:ge.width)||((Ce=re.data)==null?void 0:Ce.width)||100,height:((we=re.style)==null?void 0:we.height)||((Ie=re.data)==null?void 0:Ie.height)||60}),ne})})},[mr,r,Qe]),$e=b.useCallback((V,Y)=>{const re=Nt.size>0?Nt:ke?new Set([ke]):new Set;re.size!==0&&(Qe(),r(le=>le.map(ne=>{if(re.has(ne.id)&&!Yn.has(ne.id)){const ge={x:ne.position.x+V,y:ne.position.y+Y};return At(Ce=>{var Ie,We,Ve,it;const we=new Map(Ce);return we.set(ne.id,{id:ne.id,x:ge.x,y:ge.y,width:((Ie=ne.style)==null?void 0:Ie.width)||((We=ne.data)==null?void 0:We.width)||100,height:((Ve=ne.style)==null?void 0:Ve.height)||((it=ne.data)==null?void 0:it.height)||60}),we}),{...ne,position:ge}}return ne})))},[Nt,ke,Yn,r,Qe]),Ns=b.useCallback(V=>{const Y={id:`edge-${V.source}-${V.target}-${Date.now()}`,source:V.source,target:V.target,type:"smoothstep",animated:!0,style:{stroke:mt==="dark"?"#868e96":"#6b7280",strokeWidth:2}};a(re=>Nm(Y,re))},[a,mt]),Es=b.useCallback((V,Y)=>{Qe(),a(re=>a1(V,Y,re))},[a,Qe]),No=b.useCallback(async()=>{const V=document.querySelector(".react-flow");if(V){rn(!0);try{const Y=await cE(V,{backgroundColor:mt==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)",quality:1,pixelRatio:2}),re=document.createElement("a");re.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.png`,re.href=Y,re.click()}catch(Y){console.error("Failed to export PNG:",Y)}finally{rn(!1)}}},[mt]),Cs=b.useCallback(async()=>{const V=document.querySelector(".react-flow");if(V){rn(!0);try{const Y=await Pg(V,{backgroundColor:mt==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)"}),re=document.createElement("a");re.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.svg`,re.href=Y,re.click()}catch(Y){console.error("Failed to export SVG:",Y)}finally{rn(!1)}}},[mt]),er=b.useCallback(async V=>{rn(!0);try{const Y=await fetch(`/api/export?format=${V}`);if(!Y.ok)throw new Error("Export failed");const re=await Y.blob(),le=V==="mermaid"?"mmd":V==="plantuml"?"puml":V==="markdown"?"md":V,ne=document.createElement("a");ne.download=`architecture.${le}`,ne.href=URL.createObjectURL(re),ne.click(),URL.revokeObjectURL(ne.href)}catch(Y){console.error(`Failed to export ${V}:`,Y)}finally{rn(!1)}},[]);b.useCallback(()=>{if(!u)return;Qe();const V=250,Y=100,re=100,le=t.map((ne,ge)=>({...ne,position:{x:Y+ge*V,y:re}}));r(le),Ne("horizontal")},[u,t,r,Qe]),b.useCallback(()=>{if(!u)return;Qe();const V=150,Y=100,re=100,le=t.map((ne,ge)=>({...ne,position:{x:Y,y:re+ge*V}}));r(le),Ne("vertical")},[u,t,r,Qe]),b.useCallback(()=>{if(!u)return;Qe();const V=280,Y=180,re=100,le=100,ne=Math.ceil(Math.sqrt(t.length)),ge=t.map((Ce,we)=>({...Ce,position:{x:re+we%ne*V,y:le+Math.floor(we/ne)*Y}}));r(ge),Ne("grid")},[u,t,r,Qe]),b.useCallback(()=>{if(!u)return;Qe();const V=320,Y=160,re=100,le=100,ne=new Set(t.map(Le=>Le.id)),ge=new Map,Ce=new Map;ne.forEach(Le=>{ge.set(Le,0),Ce.set(Le,[])}),s.forEach(Le=>{ne.has(Le.source)&&ne.has(Le.target)&&(Ce.get(Le.source).push(Le.target),ge.set(Le.target,(ge.get(Le.target)||0)+1))});const we=new Map,Ie=[];for(ge.forEach((Le,tt)=>{Le===0&&(Ie.push(tt),we.set(tt,0))});Ie.length>0;){const Le=Ie.shift(),tt=we.get(Le);for(const zn of Ce.get(Le)||[]){const Di=tt+1;(!we.has(zn)||we.get(zn)<Di)&&we.set(zn,Di),ge.set(zn,ge.get(zn)-1),ge.get(zn)===0&&Ie.push(zn)}}t.forEach(Le=>{we.has(Le.id)||we.set(Le.id,0)});const We=new Map;t.forEach(Le=>{const tt=we.get(Le.id);We.has(tt)||We.set(tt,[]),We.get(tt).push(Le)});const Ve=[];[...We.keys()].sort((Le,tt)=>Le-tt).forEach((Le,tt)=>{We.get(Le).forEach((Di,Co)=>{Ve.push({...Di,position:{x:re+tt*V,y:le+Co*Y}})})}),r(Ve),Ne("flow")},[u,t,s,r,Qe]),b.useCallback(()=>{if(!u)return;Qe();const V=250,Y=180,re=100,le=100,ne={};t.forEach(Ie=>{var Ve;const We=((Ve=Ie.data)==null?void 0:Ve.layer)||"application";ne[We]||(ne[We]=[]),ne[We].push(Ie)});const ge=["presentation","application","data","external","deployment"];let Ce=le;const we=[];ge.forEach(Ie=>{const We=ne[Ie]||[];We.forEach((Ve,it)=>{we.push({...Ve,position:{x:re+it*V,y:Ce}})}),We.length>0&&(Ce+=Y)}),Object.entries(ne).forEach(([Ie,We])=>{ge.includes(Ie)||(We.forEach((Ve,it)=>{we.push({...Ve,position:{x:re+it*V,y:Ce}})}),Ce+=Y)}),r(we),Ne("layer")},[u,t,r,Qe]);const _s=b.useMemo(()=>{if(!Kn.trim())return new Set;const V=Kn.toLowerCase(),Y=new Set;return t.forEach(re=>{var ne;(((ne=re.data)==null?void 0:ne.label)||"").toLowerCase().includes(V)&&Y.add(re.id)}),Y},[Kn,t]),Eo=b.useCallback(async V=>{try{await fetch("/api/open-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:V})})}catch(Y){console.error("Failed to open file:",Y)}},[]),Li=b.useCallback(async V=>{Gr(!0);try{const Y=await fetch(`/api/impact/${encodeURIComponent(V)}?depth=2&direction=both`);if(Y.ok){const re=await Y.json();en(re)}}catch{}Gr(!1)},[]),sn=b.useCallback(()=>{en(null)},[]),Rn=b.useCallback((V,Y)=>{if(!u)return;const re=u.nodes.find(le=>le.id===Y.id);re&&(vr(re),Et(!0))},[u]);b.useEffect(()=>{const V=Y=>{if(Y.target instanceof HTMLInputElement||Y.target instanceof HTMLTextAreaElement)return;const le=navigator.platform.toUpperCase().indexOf("MAC")>=0?Y.metaKey:Y.ctrlKey;if(Y.key==="Backspace"||Y.key==="Delete"){Y.preventDefault(),Tn();return}if(le&&Y.key==="c"){Y.preventDefault(),ti();return}if(le&&Y.key==="v"){Y.preventDefault(),Ai();return}if(le&&Y.shiftKey&&Y.key==="z"){Y.preventDefault(),Jn();return}if(le&&Y.key==="z"){Y.preventDefault(),Cr();return}if(le&&Y.key==="s"){Y.preventDefault(),Er();return}if(Y.key==="Escape"){Pi(""),setHighlightedConnections(new Set),Et(!1),sn(),dt();return}if(Y.key==="ArrowUp"){Y.preventDefault(),$e(0,Y.shiftKey?-Yt*5:-Yt);return}if(Y.key==="ArrowDown"){Y.preventDefault(),$e(0,Y.shiftKey?Yt*5:Yt);return}if(Y.key==="ArrowLeft"){Y.preventDefault(),$e(Y.shiftKey?-Yt*5:-Yt,0);return}if(Y.key==="ArrowRight"){Y.preventDefault(),$e(Y.shiftKey?Yt*5:Yt,0);return}};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[Tn,ti,Ai,Er,$e,Cr,Jn,sn]);const ln=b.useMemo(()=>u?u.nodes.filter(V=>de.has(V.id)):[],[u,de]);return b.useEffect(()=>{u&&r(V=>V.map(Y=>({...Y,data:{...Y.data,highlighted:Y.id===ji}})))},[ji,u]),C?d.jsx("div",{className:"app",children:d.jsxs("div",{className:"loading",children:[d.jsx("div",{className:"loading-spinner"}),"Loading architecture..."]})}):d.jsxs("div",{className:"app",children:[d.jsxs("div",{className:"branding-header",children:[d.jsxs("div",{className:"archbyte-brand",children:[d.jsx("span",{className:"archbyte-name",children:"ArchByte"}),z?d.jsx(ME,{projectInfo:z}):d.jsx("span",{className:"archbyte-tagline",children:"See what agents build. As they build it."})]}),N.loggedIn&&d.jsx("div",{className:"branding-account",children:N.email&&d.jsxs("span",{className:"account-email",children:[N.email,N.tier==="premium"&&d.jsx("span",{className:"account-pro-tag",children:"PRO"})]})})]}),d.jsxs("div",{className:"toolbar",children:[d.jsxs("div",{className:"toolbar-left",children:[d.jsxs("div",{className:"toolbar-section",children:[d.jsx("span",{className:"toolbar-section-label",children:"View"}),d.jsx("div",{className:"toolbar-section-items",children:d.jsx("input",{type:"text",placeholder:"Filter nodes...",value:Kn,onChange:V=>Pi(V.target.value),className:"toolbar-search"})})]}),d.jsxs("div",{className:"toolbar-section",children:[d.jsx("span",{className:"toolbar-section-label",children:"Analyze"}),d.jsxs("div",{className:"toolbar-section-items",children:[d.jsxs(Np,{trigger:T?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flow-dot-inline",style:{background:T.color}}),T.name]}):d.jsx(d.Fragment,{children:"▶ Flows ▾"}),triggerClassName:`toolbar-btn ${T?"has-active-flow":""}`,children:[T&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"dropdown-item flow-clear",onClick:dt,children:"⏹ Clear active flow"}),d.jsx("div",{className:"dropdown-separator"})]}),u!=null&&u.flows&&u.flows.length>0?(()=>{const V=["user-journey","data-pipeline","system","deployment","error-recovery"],Y={"user-journey":"User Journey","data-pipeline":"Data Pipeline",system:"System",deployment:"Deployment","error-recovery":"Error / Recovery"},re={"user-journey":"#3b82f6","data-pipeline":"#22c55e",system:"#f59e0b",deployment:"#a855f7","error-recovery":"#ef4444"},le={};for(const Ce of u.flows){const we=Ce.category||"system";le[we]||(le[we]=[]),le[we].push(Ce)}const ne=[];for(const Ce of V){const we=le[Ce];if(we!=null&&we.length){ne.push(d.jsxs("div",{className:"flow-category-header",children:[d.jsx("span",{className:"flow-dot-inline",style:{background:re[Ce]}}),Y[Ce]||Ce]},`cat-${Ce}`));for(const Ie of we)ne.push(d.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(T==null?void 0:T.id)===Ie.id?"active":""}`,onClick:()=>{(T==null?void 0:T.id)===Ie.id?dt():In(Ie)},children:[d.jsx("span",{className:"flow-dot-inline",style:{background:Ie.color}}),d.jsx("span",{className:"flow-dropdown-name",children:Ie.name}),(T==null?void 0:T.id)===Ie.id&&d.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Ie.id))}}const ge=new Set(V);for(const[Ce,we]of Object.entries(le))if(!ge.has(Ce)&&we!=null&&we.length){ne.push(d.jsxs("div",{className:"flow-category-header",children:[d.jsx("span",{className:"flow-dot-inline",style:{background:"#6b7280"}}),Ce]},`cat-${Ce}`));for(const Ie of we)ne.push(d.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(T==null?void 0:T.id)===Ie.id?"active":""}`,onClick:()=>{(T==null?void 0:T.id)===Ie.id?dt():In(Ie)},children:[d.jsx("span",{className:"flow-dot-inline",style:{background:Ie.color}}),d.jsx("span",{className:"flow-dropdown-name",children:Ie.name}),(T==null?void 0:T.id)===Ie.id&&d.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Ie.id))}return ne})():d.jsx("span",{className:"dropdown-item disabled",children:"No flows defined"})]}),d.jsx("button",{className:`toolbar-btn premium-btn ${N.features.validate?"":"premium-locked"} ${Ae?"active":""}`,onClick:()=>{if(!N.features.validate){L("Validate");return}et(!Ae)},children:"Audit"})]})]}),!Pt&&d.jsxs("div",{className:"toolbar-section",children:[d.jsx("span",{className:"toolbar-section-label",children:"Ops"}),d.jsxs("div",{className:"toolbar-section-items",children:[d.jsx("button",{className:`toolbar-btn premium-btn ${N.features.patrol?"":"premium-locked"} ${Mt?"active":""}`,title:N.features.patrol?"":"Available in Pro",onClick:()=>{if(!N.features.patrol){L("Patrol");return}pt(!Mt),wt(!1),zt(!1)},children:"Patrol"}),d.jsx("button",{className:`toolbar-btn premium-btn ${N.features.patrol?"":"premium-locked"} ${xt?"active":""}`,title:N.features.patrol?"":"Available in Pro",onClick:()=>{if(!N.features.patrol){L("Workflows");return}wt(!xt),pt(!1),zt(!1)},children:"Workflows"}),d.jsx("button",{className:`toolbar-btn premium-btn ${N.features.premiumAgents?"":"premium-locked"} ${Wt?"active":""}`,title:N.features.premiumAgents?"":"Available in Pro",onClick:()=>{if(!N.features.premiumAgents){L("Pro Agents");return}Wt?zt(!1):(zt(!0),pt(!1),wt(!1))},children:"Agents"})]})]})]}),d.jsxs("div",{className:"toolbar-right",children:[W&&!Pt&&d.jsxs("span",{className:"toolbar-analyzing",children:[d.jsx("span",{className:"analyzing-pulse"}),"Re-analyzing..."]}),B&&!Pt&&d.jsx("button",{className:"toolbar-btn toolbar-error-btn",onClick:()=>J(null),title:B,children:"Analysis failed"}),d.jsx("button",{className:`toolbar-btn ${ze?"active":""}`,onClick:()=>Be(!ze),children:"Stats"}),d.jsxs(Np,{trigger:Gn?"Exporting...":"↓ Export ▾",triggerClassName:"toolbar-btn",disabled:Gn,children:[d.jsx("div",{className:"dropdown-label",children:"Image"}),d.jsx("button",{className:"dropdown-item",onClick:No,children:"PNG"}),d.jsx("button",{className:"dropdown-item",onClick:Cs,children:"SVG"}),d.jsx("div",{className:"dropdown-separator"}),d.jsx("div",{className:"dropdown-label",children:"Diagram"}),d.jsx("button",{className:"dropdown-item",onClick:()=>er("mermaid"),children:"Mermaid"}),d.jsx("button",{className:"dropdown-item",onClick:()=>er("plantuml"),children:"PlantUML"}),d.jsx("button",{className:"dropdown-item",onClick:()=>er("dot"),children:"DOT"}),d.jsx("div",{className:"dropdown-separator"}),d.jsx("div",{className:"dropdown-label",children:"Document"}),d.jsx("button",{className:"dropdown-item",onClick:()=>er("markdown"),children:"Markdown"}),d.jsx("button",{className:"dropdown-item",onClick:()=>er("json"),children:"JSON"}),d.jsx("div",{className:"dropdown-separator"}),d.jsx("div",{className:"dropdown-label",children:"Interactive"}),d.jsx("button",{className:`dropdown-item ${N.tier!=="premium"?"premium-locked":""}`,onClick:()=>{if(N.tier!=="premium"){L("HTML Export");return}er("html")},children:"HTML"})]}),d.jsx("button",{className:"toolbar-btn-icon",onClick:()=>Xn(mt==="dark"?"light":"dark"),title:`Switch to ${mt==="dark"?"light":"dark"} mode`,children:mt==="dark"?"☀":"☽"})]})]}),d.jsx(mE,{selectedEnvironment:lt,environments:_i,onSelectEnvironment:bn}),d.jsxs("div",{className:"canvas-container",children:[d.jsx("div",{className:"watermark",children:"archbyte"}),d.jsxs(mg,{nodes:t.map(V=>({...V,draggable:!Yn.has(V.id),data:{...V.data,locked:Yn.has(V.id),isSearchMatch:Kn?_s.has(V.id):null}})),edges:s.map(V=>{var Y;return{...V,style:{...V.style,opacity:1,strokeWidth:((Y=V.style)==null?void 0:Y.strokeWidth)||2}}}),onNodesChange:Nr,onEdgesChange:c,onNodeClick:(V,Y)=>{kr(V,Y)},onNodeDoubleClick:Rn,onPaneClick:()=>{on(),document.dispatchEvent(new Event("dropdown:closeall"))},onConnect:Ns,onReconnect:Es,edgesReconnectable:!0,onSelectionChange:ei,nodeTypes:ZE,connectionMode:Si.Loose,snapToGrid:!0,snapGrid:[Zr,Zr],selectionOnDrag:!0,selectNodesOnDrag:!1,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,attributionPosition:"bottom-left",deleteKeyCode:null,children:[d.jsx(yg,{color:mt==="dark"?"hsl(220 25% 15%)":"hsl(220 15% 82%)",gap:20,variant:Hn.Dots}),d.jsx(xg,{})]}),ut&&d.jsxs("div",{className:"impact-badge",children:[d.jsxs("span",{className:"impact-badge-count",children:[ut.totalAffected," affected"]}),d.jsxs("span",{className:"impact-badge-detail",children:[ut.upstream.length," upstream, ",ut.downstream.length," downstream"]}),d.jsx("button",{className:"panel-btn small",onClick:sn,children:"Clear"})]}),xo&&Ye&&d.jsxs(vi,{className:"node-details-panel",children:[d.jsxs("div",{className:"node-details-header","data-drag-handle":!0,children:[d.jsxs("div",{children:[d.jsx("div",{className:"node-details-title",children:Ye.label.split(`
68
+ `)[0]}),d.jsxs("div",{className:"node-details-type",children:[Ye.layer," • ",Ye.type]})]}),d.jsxs("div",{style:{display:"flex",gap:4},children:[d.jsx("button",{className:"panel-btn small cyan",onClick:()=>navigator.clipboard.writeText(Ye.label.split(`
69
+ `)[0]),title:"Copy node name",children:"📋"}),d.jsx("button",{className:"panel-close-btn",onClick:()=>Et(!1),children:"×"})]})]}),Ye.path&&d.jsxs("div",{className:"node-details-section",children:[d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[d.jsx("div",{className:"node-details-section-title",children:"Path"}),d.jsx("button",{className:"panel-btn small cyan",onClick:()=>navigator.clipboard.writeText(Ye.path),title:"Copy path",style:{fontSize:10,padding:"2px 6px"},children:"📋"})]}),d.jsx("div",{className:"node-details-path",style:{userSelect:"text"},children:Ye.path})]}),Ye.techStack&&Ye.techStack.length>0&&d.jsxs("div",{className:"node-details-section",children:[d.jsx("div",{className:"node-details-section-title",children:"Tech Stack"}),d.jsx("div",{className:"node-details-tech-stack",children:Ye.techStack.map((V,Y)=>d.jsx("span",{className:"tech-badge",children:V},Y))})]}),d.jsxs("div",{className:"node-details-section",children:[d.jsx("div",{className:"node-details-section-title",children:"Connections"}),d.jsxs("div",{className:"node-details-connections",children:[u==null?void 0:u.edges.filter(V=>V.source===Ye.id||V.target===Ye.id).map(V=>{const Y=V.source===Ye.id,re=Y?V.target:V.source,le=u==null?void 0:u.nodes.find(ne=>ne.id===re);return d.jsxs("div",{className:"connection-item-detailed",onClick:()=>zi(re),style:{cursor:"pointer"},title:`Click to highlight ${(le==null?void 0:le.label.split(`
70
+ `)[0])||re}`,children:[d.jsxs("div",{className:"connection-header",children:[d.jsx("span",{className:"connection-arrow",children:Y?"→":"←"}),d.jsx("span",{className:"connection-target",children:(le==null?void 0:le.label.split(`
71
+ `)[0])||re})]}),V.label&&d.jsx("div",{className:"connection-label",children:V.label})]},V.id)}),(u==null?void 0:u.edges.filter(V=>V.source===Ye.id||V.target===Ye.id).length)===0&&d.jsx("span",{style:{color:"var(--text-muted)"},children:"No connections"})]})]}),d.jsxs("div",{className:"node-details-actions",children:[Ye.path&&d.jsx("button",{className:"panel-btn cyan",onClick:()=>Eo(Ye.path),children:"Open in VS Code"}),d.jsx("button",{className:"panel-btn amber",onClick:()=>{Li(Ye.id),Et(!1)},disabled:jn,children:jn?"...":"Blast Radius"})]})]}),tn.size>0&&!Pt&&d.jsxs("div",{className:"save-panel",children:[d.jsxs("span",{className:"save-panel-text",children:[tn.size," unsaved change",tn.size!==1?"s":""]}),d.jsx("button",{className:"save-btn",onClick:Er,disabled:nn,children:nn?"Saving...":"Save Changes"}),d.jsx("button",{className:"discard-btn",onClick:ko,disabled:nn,children:"Discard"})]}),ln.length>0&&d.jsxs("div",{className:"hidden-nodes-panel",children:[d.jsxs("div",{className:"hidden-nodes-title",children:["Hidden (",ln.length,")",d.jsx("button",{className:"panel-btn cyan small",onClick:Sr,children:"Show All"})]}),d.jsx("div",{className:"hidden-nodes-list",style:{maxHeight:220,overflowY:"auto"},children:ln.map(V=>d.jsxs("div",{className:"hidden-node-item",children:[d.jsx("span",{className:"hidden-node-name",children:V.label.split(`
72
+ `)[0]}),d.jsx("button",{className:"panel-btn green small",onClick:()=>showNode(V.id),children:"Show"})]},V.id))})]}),T&&d.jsxs("div",{className:"flow-progress-bar",children:[d.jsx("span",{className:"flow-progress-dot",style:{background:T.color}}),d.jsx("span",{className:"flow-progress-name",children:T.name}),d.jsx("div",{className:"flow-progress-steps",children:T.steps.map((V,Y)=>d.jsx("div",{className:`flow-progress-step ${Y<=R?"active":""} ${Y===R?"current":""}`,style:{borderColor:Y<=R?T.color:void 0},title:V.label,children:V.label},Y))}),d.jsxs("div",{className:"flow-progress-controls",children:[U?d.jsx("button",{className:"flow-progress-btn",onClick:So,title:"Pause",children:"⏸"}):d.jsx("button",{className:"flow-progress-btn",onClick:It,title:"Resume",children:"▶"}),d.jsx("button",{className:"flow-progress-btn stop",onClick:dt,title:"Stop",children:"⏹"})]})]}),se&&T&&u&&d.jsx(zE,{flow:T,architecture:u,onClose:dt}),d.jsx(xE,{visible:ze,onClose:()=>Be(!1)}),d.jsx(EE,{visible:Ae,onClose:()=>et(!1),onHighlightNode:V=>{zi(V)}}),Mt&&d.jsxs(vi,{className:"ops-panel",children:[d.jsxs("div",{className:"ops-header","data-drag-handle":!0,children:[d.jsx("span",{className:"ops-panel-title",children:"Patrol"}),d.jsx("button",{className:"panel-close-btn",onClick:()=>pt(!1),children:"x"})]}),d.jsx(_E,{visible:!0})]}),xt&&d.jsxs(vi,{className:"ops-panel",children:[d.jsxs("div",{className:"ops-header","data-drag-handle":!0,children:[d.jsx("span",{className:"ops-panel-title",children:"Workflows"}),d.jsx("button",{className:"panel-close-btn",onClick:()=>wt(!1),children:"x"})]}),d.jsx(bE,{visible:!0})]}),d.jsx(QE,{visible:Wt,onClose:()=>zt(!1),results:hr}),x.length>0&&d.jsxs("div",{className:"agent-panel",children:[d.jsx("div",{className:"agent-panel-title",children:"Agent Activity"}),x.map((V,Y)=>d.jsxs("div",{className:"agent-item",children:[d.jsx("div",{className:`agent-dot ${Y===0?"active":""}`}),d.jsx("span",{className:"agent-name",children:V.agentName}),d.jsx("span",{className:"agent-target",children:V.targetComponent||V.action})]},Y))]})]}),Pt&&d.jsxs("a",{href:"https://archbyte.heartbyte.io",target:"_blank",rel:"noopener noreferrer",style:{position:"fixed",bottom:6,right:8,display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",fontSize:11,fontWeight:500,color:"hsl(185 75% 50%)",background:"hsla(222, 47%, 8%, 0.85)",backdropFilter:"blur(8px)",border:"1px solid hsla(185, 75%, 50%, 0.25)",borderRadius:6,textDecoration:"none",zIndex:50,fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.02em"},children:[d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),d.jsx("path",{d:"M2 17l10 5 10-5"}),d.jsx("path",{d:"M2 12l10 5 10-5"})]}),"archbyte.heartbyte.io"]}),d.jsxs("div",{className:"status-bar",children:[d.jsxs("div",{className:"status-left",children:[!Pt&&d.jsxs("div",{className:"status-indicator",children:[d.jsx("div",{className:`status-dot ${m?"":"disconnected"}`}),d.jsx("span",{children:m?"Live":"Offline"})]}),Pt&&d.jsx("span",{style:{color:"var(--text-dim)",fontSize:11},children:"Standalone Export"}),k&&!Pt&&d.jsx("span",{style:{color:"var(--accent-red)"},children:k})]}),d.jsx("div",{className:"status-center",children:d.jsx("a",{href:"mailto:archbyte@heartbyte.io",style:{color:"var(--text-dim)",fontSize:11,textDecoration:"none"},children:"archbyte@heartbyte.io"})}),d.jsxs("div",{className:"status-right",children:[d.jsx("span",{children:v?`Updated ${new Date(v).toLocaleTimeString()}`:"Waiting..."}),Ut?d.jsxs("span",{className:"git-status",children:[Ut.repo&&d.jsx("a",{href:((_r=Ut.remoteUrl)==null?void 0:_r.replace(/^git@([^:]+):/,"https://$1/").replace(/\.git$/,""))||"#",target:"_blank",rel:"noopener noreferrer",className:"git-repo-badge",title:Ut.remoteUrl||"",children:Ut.repo}),d.jsx("span",{className:"git-branch",children:Ut.branch}),d.jsx("span",{className:"git-hash",children:Ut.commit})]}):d.jsxs("span",{children:["v",(u==null?void 0:u.version)||1]})]})]}),H&&d.jsx(LE,{onComplete:()=>{Z(!1),Pn()}}),$&&d.jsx(uE,{feature:$,onClose:()=>L(null)})]})}h0.createRoot(document.getElementById("root")).render(d.jsx(jp.StrictMode,{children:d.jsx(eC,{})}));