archbyte 0.4.2 → 0.5.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.
Files changed (38) hide show
  1. package/README.md +9 -25
  2. package/bin/archbyte.js +6 -41
  3. package/dist/agents/static/component-detector.js +71 -107
  4. package/dist/agents/static/connection-mapper.js +24 -25
  5. package/dist/agents/static/deep-drill.d.ts +72 -0
  6. package/dist/agents/static/deep-drill.js +388 -0
  7. package/dist/agents/static/doc-parser.js +73 -48
  8. package/dist/agents/static/env-detector.js +3 -6
  9. package/dist/agents/static/event-detector.js +20 -26
  10. package/dist/agents/static/infra-analyzer.js +15 -1
  11. package/dist/agents/static/structure-scanner.js +56 -57
  12. package/dist/agents/static/taxonomy.d.ts +19 -0
  13. package/dist/agents/static/taxonomy.js +147 -0
  14. package/dist/agents/tools/local-fs.js +5 -2
  15. package/dist/cli/analyze.js +49 -27
  16. package/dist/cli/license-gate.js +47 -19
  17. package/dist/cli/run.js +117 -1
  18. package/dist/cli/setup.d.ts +6 -1
  19. package/dist/cli/setup.js +35 -16
  20. package/dist/cli/shared.d.ts +0 -11
  21. package/dist/cli/shared.js +0 -61
  22. package/dist/cli/workflow.js +8 -15
  23. package/dist/server/src/index.js +276 -168
  24. package/package.json +2 -2
  25. package/templates/archbyte.yaml +28 -7
  26. package/ui/dist/assets/index-BQouokNH.css +1 -0
  27. package/ui/dist/assets/index-QllGSFhe.js +72 -0
  28. package/ui/dist/index.html +2 -2
  29. package/dist/cli/arch-diff.d.ts +0 -38
  30. package/dist/cli/arch-diff.js +0 -61
  31. package/dist/cli/diff.d.ts +0 -10
  32. package/dist/cli/diff.js +0 -144
  33. package/dist/cli/patrol.d.ts +0 -18
  34. package/dist/cli/patrol.js +0 -596
  35. package/dist/cli/validate.d.ts +0 -53
  36. package/dist/cli/validate.js +0 -299
  37. package/ui/dist/assets/index-DDCNauh7.css +0 -1
  38. package/ui/dist/assets/index-DO4t5Xu1.js +0 -72
@@ -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 $c={exports:{}},es={},Fc={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(I){return I===null||typeof I!="object"?null:(I=y&&I[y]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,S={};function _(I,$,se){this.props=I,this.context=$,this.refs=S,this.updater=se||C}_.prototype.isReactComponent={},_.prototype.setState=function(I,$){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,$,"setState")},_.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function E(){}E.prototype=_.prototype;function P(I,$,se){this.props=I,this.context=$,this.refs=S,this.updater=se||C}var k=P.prototype=new E;k.constructor=P,N(k,_.prototype),k.isPureReactComponent=!0;var j=Array.isArray,F=Object.prototype.hasOwnProperty,L={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function Z(I,$,se){var le,de={},he=null,me=null;if($!=null)for(le in $.ref!==void 0&&(me=$.ref),$.key!==void 0&&(he=""+$.key),$)F.call($,le)&&!B.hasOwnProperty(le)&&(de[le]=$[le]);var oe=arguments.length-2;if(oe===1)de.children=se;else if(1<oe){for(var pe=Array(oe),je=0;je<oe;je++)pe[je]=arguments[je+2];de.children=pe}if(I&&I.defaultProps)for(le in oe=I.defaultProps,oe)de[le]===void 0&&(de[le]=oe[le]);return{$$typeof:t,type:I,key:he,ref:me,props:de,_owner:L.current}}function V(I,$){return{$$typeof:t,type:I.type,key:$,ref:I.ref,props:I.props,_owner:I._owner}}function J(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function U(I){var $={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(se){return $[se]})}var G=/\/+/g;function te(I,$){return typeof I=="object"&&I!==null&&I.key!=null?U(""+I.key):$.toString(36)}function z(I,$,se,le,de){var he=typeof I;(he==="undefined"||he==="boolean")&&(I=null);var me=!1;if(I===null)me=!0;else switch(he){case"string":case"number":me=!0;break;case"object":switch(I.$$typeof){case t:case r:me=!0}}if(me)return me=I,de=de(me),I=le===""?"."+te(me,0):le,j(de)?(se="",I!=null&&(se=I.replace(G,"$&/")+"/"),z(de,$,se,"",function(je){return je})):de!=null&&(J(de)&&(de=V(de,se+(!de.key||me&&me.key===de.key?"":(""+de.key).replace(G,"$&/")+"/")+I)),$.push(de)),1;if(me=0,le=le===""?".":le+":",j(I))for(var oe=0;oe<I.length;oe++){he=I[oe];var pe=le+te(he,oe);me+=z(he,$,se,pe,de)}else if(pe=x(I),typeof pe=="function")for(I=pe.call(I),oe=0;!(he=I.next()).done;)he=he.value,pe=le+te(he,oe++),me+=z(he,$,se,pe,de);else if(he==="object")throw $=String(I),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return me}function Q(I,$,se){if(I==null)return I;var le=[],de=0;return z(I,le,"","",function(he){return $.call(se,he,de++)}),le}function W(I){if(I._status===-1){var $=I._result;$=$(),$.then(function(se){(I._status===0||I._status===-1)&&(I._status=1,I._result=se)},function(se){(I._status===0||I._status===-1)&&(I._status=2,I._result=se)}),I._status===-1&&(I._status=0,I._result=$)}if(I._status===1)return I._result.default;throw I._result}var K={current:null},M={transition:null},A={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:M,ReactCurrentOwner:L};function Y(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:Q,forEach:function(I,$,se){Q(I,function(){$.apply(this,arguments)},se)},count:function(I){var $=0;return Q(I,function(){$++}),$},toArray:function(I){return Q(I,function($){return $})||[]},only:function(I){if(!J(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},De.Component=_,De.Fragment=i,De.Profiler=a,De.PureComponent=P,De.StrictMode=s,De.Suspense=m,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,De.act=Y,De.cloneElement=function(I,$,se){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var le=N({},I.props),de=I.key,he=I.ref,me=I._owner;if($!=null){if($.ref!==void 0&&(he=$.ref,me=L.current),$.key!==void 0&&(de=""+$.key),I.type&&I.type.defaultProps)var oe=I.type.defaultProps;for(pe in $)F.call($,pe)&&!B.hasOwnProperty(pe)&&(le[pe]=$[pe]===void 0&&oe!==void 0?oe[pe]:$[pe])}var pe=arguments.length-2;if(pe===1)le.children=se;else if(1<pe){oe=Array(pe);for(var je=0;je<pe;je++)oe[je]=arguments[je+2];le.children=oe}return{$$typeof:t,type:I.type,key:de,ref:he,props:le,_owner:me}},De.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:c,_context:I},I.Consumer=I},De.createElement=Z,De.createFactory=function(I){var $=Z.bind(null,I);return $.type=I,$},De.createRef=function(){return{current:null}},De.forwardRef=function(I){return{$$typeof:h,render:I}},De.isValidElement=J,De.lazy=function(I){return{$$typeof:v,_payload:{_status:-1,_result:I},_init:W}},De.memo=function(I,$){return{$$typeof:g,type:I,compare:$===void 0?null:$}},De.startTransition=function(I){var $=M.transition;M.transition={};try{I()}finally{M.transition=$}},De.unstable_act=Y,De.useCallback=function(I,$){return K.current.useCallback(I,$)},De.useContext=function(I){return K.current.useContext(I)},De.useDebugValue=function(){},De.useDeferredValue=function(I){return K.current.useDeferredValue(I)},De.useEffect=function(I,$){return K.current.useEffect(I,$)},De.useId=function(){return K.current.useId()},De.useImperativeHandle=function(I,$,se){return K.current.useImperativeHandle(I,$,se)},De.useInsertionEffect=function(I,$){return K.current.useInsertionEffect(I,$)},De.useLayoutEffect=function(I,$){return K.current.useLayoutEffect(I,$)},De.useMemo=function(I,$){return K.current.useMemo(I,$)},De.useReducer=function(I,$,se){return K.current.useReducer(I,$,se)},De.useRef=function(I){return K.current.useRef(I)},De.useState=function(I){return K.current.useState(I)},De.useSyncExternalStore=function(I,$,se){return K.current.useSyncExternalStore(I,$,se)},De.useTransition=function(){return K.current.useTransition()},De.version="18.3.1",De}var th;function ys(){return th||(th=1,Fc.exports=o0()),Fc.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 es;nh=1;var t=ys(),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 es.Fragment=i,es.jsx=u,es.jsxs=u,es}var rh;function l0(){return rh||(rh=1,$c.exports=s0()),$c.exports}var d=l0(),b=ys();const _p=vu(b);var Cl={},Oc={exports:{}},Bt={},Hc={exports:{}},Bc={};/**
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(M,A){var Y=M.length;M.push(A);e:for(;0<Y;){var I=Y-1>>>1,$=M[I];if(0<a($,A))M[I]=A,M[Y]=$,Y=I;else break e}}function i(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var A=M[0],Y=M.pop();if(Y!==A){M[0]=Y;e:for(var I=0,$=M.length,se=$>>>1;I<se;){var le=2*(I+1)-1,de=M[le],he=le+1,me=M[he];if(0>a(de,Y))he<$&&0>a(me,de)?(M[I]=me,M[he]=Y,I=he):(M[I]=de,M[le]=Y,I=le);else if(he<$&&0>a(me,Y))M[I]=me,M[he]=Y,I=he;else break e}}return A}function a(M,A){var Y=M.sortIndex-A.sortIndex;return Y!==0?Y:M.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,N=!1,S=!1,_=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(M){for(var A=i(g);A!==null;){if(A.callback===null)s(g);else if(A.startTime<=M)s(g),A.sortIndex=A.expirationTime,r(m,A);else break;A=i(g)}}function j(M){if(S=!1,k(M),!N)if(i(m)!==null)N=!0,W(F);else{var A=i(g);A!==null&&K(j,A.startTime-M)}}function F(M,A){N=!1,S&&(S=!1,E(Z),Z=-1),C=!0;var Y=x;try{for(k(A),y=i(m);y!==null&&(!(y.expirationTime>A)||M&&!U());){var I=y.callback;if(typeof I=="function"){y.callback=null,x=y.priorityLevel;var $=I(y.expirationTime<=A);A=t.unstable_now(),typeof $=="function"?y.callback=$:y===i(m)&&s(m),k(A)}else s(m);y=i(m)}if(y!==null)var se=!0;else{var le=i(g);le!==null&&K(j,le.startTime-A),se=!1}return se}finally{y=null,x=Y,C=!1}}var L=!1,B=null,Z=-1,V=5,J=-1;function U(){return!(t.unstable_now()-J<V)}function G(){if(B!==null){var M=t.unstable_now();J=M;var A=!0;try{A=B(!0,M)}finally{A?te():(L=!1,B=null)}}else L=!1}var te;if(typeof P=="function")te=function(){P(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 W(M){B=M,L||(L=!0,te())}function K(M,A){Z=_(function(){M(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(M){M.callback=null},t.unstable_continueExecution=function(){N||C||(N=!0,W(F))},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_getFirstCallbackNode=function(){return i(m)},t.unstable_next=function(M){switch(x){case 1:case 2:case 3:var A=3;break;default:A=x}var Y=x;x=A;try{return M()}finally{x=Y}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(M,A){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var Y=x;x=M;try{return A()}finally{x=Y}},t.unstable_scheduleCallback=function(M,A,Y){var I=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?I+Y:I):Y=I,M){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=Y+$,M={id:v++,callback:A,priorityLevel:M,startTime:Y,expirationTime:$,sortIndex:-1},Y>I?(M.sortIndex=Y,r(g,M),i(m)===null&&M===i(g)&&(S?(E(Z),Z=-1):S=!0,K(j,Y-I))):(M.sortIndex=$,r(m,M),N||C||(N=!0,W(F))),M},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(M){var A=x;return function(){var Y=x;x=A;try{return M.apply(this,arguments)}finally{x=Y}}}})(Bc)),Bc}var oh;function c0(){return oh||(oh=1,Hc.exports=a0()),Hc.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 Bt;sh=1;var t=ys(),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 N(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 S(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 S(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 S(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){_[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_[e]=new S(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 S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){_[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){_[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){_[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){_[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var E=/[\-:]([a-z])/g;function P(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(E,P);_[n]=new S(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(E,P);_[n]=new S(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(E,P);_[n]=new S(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){_[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){_[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function k(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")&&(N(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 j=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,F=Symbol.for("react.element"),L=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),J=Symbol.for("react.provider"),U=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"),W=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),M=Symbol.iterator;function A(e){return e===null||typeof e!="object"?null:(e=M&&e[M]||e["@@iterator"],typeof e=="function"?e:null)}var Y=Object.assign,I;function $(e){if(I===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);I=n&&n[1]||""}return`
34
+ `+I+e}var se=!1;function le(e,n){if(!e||se)return"";se=!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,T=p.length-1;1<=w&&0<=T&&f[w]!==p[T];)T--;for(;1<=w&&0<=T;w--,T--)if(f[w]!==p[T]){if(w!==1||T!==1)do if(w--,T--,0>T||f[w]!==p[T]){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<=T);break}}}finally{se=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?$(e):""}function de(e){switch(e.tag){case 5:return $(e.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return e=le(e.type,!1),e;case 11:return e=le(e.type.render,!1),e;case 1:return e=le(e.type,!0),e;default:return""}}function he(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 B:return"Fragment";case L:return"Portal";case V:return"Profiler";case Z:return"StrictMode";case te:return"Suspense";case z:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U: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:he(e.type)||"Memo";case W:n=e._payload,e=e._init;try{return he(e(n))}catch{}}return null}function me(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 he(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 oe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pe(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function je(e){var n=pe(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 Ie(e){e._valueTracker||(e._valueTracker=je(e))}function ke(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=pe(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 $e(e,n){var o=n.checked;return Y({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function Fe(e,n){var o=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;o=oe(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&&k(e,"checked",n,!1)}function et(e,n){Ae(e,n);var o=oe(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")?wt(e,n.type,o):n.hasOwnProperty("defaultValue")&&wt(e,n.type,oe(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Pt(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 wt(e,n,o){(n!=="number"||Ne(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var gt=Array.isArray;function St(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=""+oe(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 Ut(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return Y({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Yt(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(gt(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:oe(o)}}function ur(e,n){var o=oe(n.value),l=oe(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 Kn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function be(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 nn(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?be(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var rn,Yr=(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(rn=rn||document.createElement("div"),rn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=rn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function fn(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var hn={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},zt=["Webkit","ms","Moz","O"];Object.keys(hn).forEach(function(e){zt.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),hn[n]=hn[e]})});function Xr(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||hn.hasOwnProperty(e)&&hn[e]?(""+n).trim():n+"px"}function Gr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,f=Xr(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,f):e[o]=f}}var go=Y({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 dr(e,n){if(n){if(go[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 fr(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 hr=null;function Xt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kr=null,It=null,yt=null;function pr(e){if(e=Fo(e)){if(typeof Kr!="function")throw Error(i(280));var n=e.stateNode;n&&(n=Os(n),Kr(e.stateNode,e.type,n))}}function Qr(e){It?yt?yt.push(e):yt=[e]:It=e}function pn(){if(It){var e=It,n=yt;if(yt=It=null,pr(e),n)for(e=0;e<n.length;e++)pr(n[e])}}function mr(e,n){return e(n)}function _i(){}var qr=!1;function gr(e,n,o){if(qr)return e(n,o);qr=!0;try{return mr(e,n,o)}finally{qr=!1,(It!==null||yt!==null)&&(_i(),pn())}}function mn(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 Mn=!1;if(h)try{var yr={};Object.defineProperty(yr,"passive",{get:function(){Mn=!0}}),window.addEventListener("test",yr,yr),window.removeEventListener("test",yr,yr)}catch{Mn=!1}function At(e,n,o,l,f,p,w,T,D){var ee=Array.prototype.slice.call(arguments,3);try{n.apply(o,ee)}catch(ce){this.onError(ce)}}var Pn=!1,lt=null,vr=!1,kt=null,ji={onError:function(e){Pn=!0,lt=e}};function In(e,n,o,l,f,p,w,T,D){Pn=!1,lt=null,At.apply(ji,arguments)}function yo(e,n,o,l,f,p,w,T,D){if(In.apply(this,arguments),Pn){if(Pn){var ee=lt;Pn=!1,lt=null}else throw Error(i(198));vr||(vr=!0,kt=ee)}}function Nt(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 tt(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 xr(e){if(Nt(e)!==e)throw Error(i(188))}function Qn(e){var n=e.alternate;if(!n){if(n=Nt(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 xr(f),e;if(p===l)return xr(f),n;p=p.sibling}throw Error(i(188))}if(o.return!==l.return)o=f,l=p;else{for(var w=!1,T=f.child;T;){if(T===o){w=!0,o=f,l=p;break}if(T===l){w=!0,l=f,o=p;break}T=T.sibling}if(!w){for(T=p.child;T;){if(T===o){w=!0,o=p,l=f;break}if(T===l){w=!0,l=p,o=f;break}T=T.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 Zr(e){return e=Qn(e),e!==null?Jr(e):null}function Jr(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=Jr(e);if(n!==null)return n;e=e.sibling}return null}var Gt=r.unstable_scheduleCallback,Tn=r.unstable_cancelCallback,vo=r.unstable_shouldYield,bi=r.unstable_requestPaint,Ge=r.unstable_now,Mi=r.unstable_getCurrentPriorityLevel,wr=r.unstable_ImmediatePriority,Pi=r.unstable_UserBlockingPriority,Sr=r.unstable_NormalPriority,xo=r.unstable_LowPriority,Ii=r.unstable_IdlePriority,Rn=null,Et=null;function kr(e){if(Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Rn,e,void 0,(e.current.flags&128)===128)}catch{}}var Ct=Math.clz32?Math.clz32:So,zn=Math.log,wo=Math.LN2;function So(e){return e>>>=0,e===0?32:31-(zn(e)/wo|0)|0}var gn=64,Ye=4194304;function Lt(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 T=w&~f;T!==0?l=Lt(T):(p&=w,p!==0&&(l=Lt(p)))}else w=o&~f,w!==0?l=Lt(w):p!==0&&(l=Lt(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-Ct(n),f=1<<o,l|=e[o],n&=~f;return l}function Ti(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-Ct(p),T=1<<w,D=f[w];D===-1?((T&o)===0||(T&l)!==0)&&(f[w]=Ti(T,n)):D<=n&&(e.expiredLanes|=T),p&=~T}}function ei(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function An(){var e=gn;return gn<<=1,(gn&4194240)===0&&(gn=64),e}function ti(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function Ln(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Ct(n),e[n]=o}function ni(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-Ct(o),p=1<<f;n[f]=0,l[f]=-1,e[f]=-1,o&=~p}}function No(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var l=31-Ct(o),f=1<<l;f&n|e[l]&n&&(e[l]|=n),o&=~f}}var Be=0;function Eo(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Co,qn,Cs,_s,js,_o=!1,yn=[],Dn=null,$n=null,on=null,Er=new Map,R=new Map,H=[],ne="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 ie(e,n){switch(e){case"focusin":case"focusout":Dn=null;break;case"dragenter":case"dragleave":$n=null;break;case"mouseover":case"mouseout":on=null;break;case"pointerover":case"pointerout":Er.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":R.delete(n.pointerId)}}function re(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=Fo(n),n!==null&&qn(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function ye(e,n,o,l,f){switch(n){case"focusin":return Dn=re(Dn,e,n,o,l,f),!0;case"dragenter":return $n=re($n,e,n,o,l,f),!0;case"mouseover":return on=re(on,e,n,o,l,f),!0;case"pointerover":var p=f.pointerId;return Er.set(p,re(Er.get(p)||null,e,n,o,l,f)),!0;case"gotpointercapture":return p=f.pointerId,R.set(p,re(R.get(p)||null,e,n,o,l,f)),!0}return!1}function _e(e){var n=ri(e.target);if(n!==null){var o=Nt(n);if(o!==null){if(n=o.tag,n===13){if(n=tt(o),n!==null){e.blockedOn=n,js(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=da(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var l=new o.constructor(o.type,o);hr=l,o.target.dispatchEvent(l),hr=null}else return n=Fo(o),n!==null&&qn(n),e.blockedOn=o,!1;n.shift()}return!0}function Te(e,n,o){we(e)&&o.delete(n)}function Ue(){_o=!1,Dn!==null&&we(Dn)&&(Dn=null),$n!==null&&we($n)&&($n=null),on!==null&&we(on)&&(on=null),Er.forEach(Te),R.forEach(Te)}function We(e,n){e.blockedOn===n&&(e.blockedOn=null,_o||(_o=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ue)))}function ot(e){function n(f){return We(f,e)}if(0<yn.length){We(yn[0],e);for(var o=1;o<yn.length;o++){var l=yn[o];l.blockedOn===e&&(l.blockedOn=null)}}for(Dn!==null&&We(Dn,e),$n!==null&&We($n,e),on!==null&&We(on,e),Er.forEach(n),R.forEach(n),o=0;o<H.length;o++)l=H[o],l.blockedOn===e&&(l.blockedOn=null);for(;0<H.length&&(o=H[0],o.blockedOn===null);)_e(o),o.blockedOn===null&&H.shift()}var Le=j.ReactCurrentBatchConfig,nt=!0;function Fn(e,n,o,l){var f=Be,p=Le.transition;Le.transition=null;try{Be=1,jo(e,n,o,l)}finally{Be=f,Le.transition=p}}function Ri(e,n,o,l){var f=Be,p=Le.transition;Le.transition=null;try{Be=4,jo(e,n,o,l)}finally{Be=f,Le.transition=p}}function jo(e,n,o,l){if(nt){var f=da(e,n,o,l);if(f===null)ba(e,n,l,bs,o),ie(e,l);else if(ye(f,e,n,o,l))l.stopPropagation();else if(ie(e,l),n&4&&-1<ne.indexOf(e)){for(;f!==null;){var p=Fo(f);if(p!==null&&Co(p),p=da(e,n,o,l),p===null&&ba(e,n,l,bs,o),p===f)break;f=p}f!==null&&l.stopPropagation()}else ba(e,n,l,null,o)}}var bs=null;function da(e,n,o,l){if(bs=null,e=Xt(l),e=ri(e),e!==null)if(n=Nt(e),n===null)e=null;else if(o=n.tag,o===13){if(e=tt(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 bs=e,null}function Fu(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(Mi()){case wr:return 1;case Pi:return 4;case Sr:case xo:return 16;case Ii:return 536870912;default:return 16}default:return 16}}var Cr=null,fa=null,Ms=null;function Ou(){if(Ms)return Ms;var e,n=fa,o=n.length,l,f="value"in Cr?Cr.value:Cr.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 Ms=f.slice(e,1<l?1-l:void 0)}function Ps(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 Is(){return!0}function Hu(){return!1}function Kt(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 T in e)e.hasOwnProperty(T)&&(o=e[T],this[T]=o?o(p):p[T]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Is:Hu,this.isPropagationStopped=Hu,this}return Y(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=Is)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Is)},persist:function(){},isPersistent:Is}),n}var zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ha=Kt(zi),bo=Y({},zi,{view:0,detail:0}),Tg=Kt(bo),pa,ma,Mo,Ts=Y({},bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ya,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!==Mo&&(Mo&&e.type==="mousemove"?(pa=e.screenX-Mo.screenX,ma=e.screenY-Mo.screenY):ma=pa=0,Mo=e),pa)},movementY:function(e){return"movementY"in e?e.movementY:ma}}),Bu=Kt(Ts),Rg=Y({},Ts,{dataTransfer:0}),zg=Kt(Rg),Ag=Y({},bo,{relatedTarget:0}),ga=Kt(Ag),Lg=Y({},zi,{animationName:0,elapsedTime:0,pseudoElement:0}),Dg=Kt(Lg),$g=Y({},zi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Fg=Kt($g),Og=Y({},zi,{data:0}),Vu=Kt(Og),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 ya(){return Wg}var Ug=Y({},bo,{key:function(e){if(e.key){var n=Hg[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Ps(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:ya,charCode:function(e){return e.type==="keypress"?Ps(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ps(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Yg=Kt(Ug),Xg=Y({},Ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wu=Kt(Xg),Gg=Y({},bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ya}),Kg=Kt(Gg),Qg=Y({},zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),qg=Kt(Qg),Zg=Y({},Ts,{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=Kt(Zg),ey=[9,13,27,32],va=h&&"CompositionEvent"in window,Po=null;h&&"documentMode"in document&&(Po=document.documentMode);var ty=h&&"TextEvent"in window&&!Po,Uu=h&&(!va||Po&&8<Po&&11>=Po),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 Ai=!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(Ai)return e==="compositionend"||!va&&Gu(e,n)?(e=Ou(),Ms=fa=Cr=null,Ai=!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){Qr(l),n=Ds(n,"onChange"),0<n.length&&(o=new ha("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var Io=null,To=null;function oy(e){md(e,0)}function Rs(e){var n=Oi(e);if(ke(n))return e}function sy(e,n){if(e==="change")return n}var Zu=!1;if(h){var xa;if(h){var wa="oninput"in document;if(!wa){var Ju=document.createElement("div");Ju.setAttribute("oninput","return;"),wa=typeof Ju.oninput=="function"}xa=wa}else xa=!1;Zu=xa&&(!document.documentMode||9<document.documentMode)}function ed(){Io&&(Io.detachEvent("onpropertychange",td),To=Io=null)}function td(e){if(e.propertyName==="value"&&Rs(To)){var n=[];qu(n,To,e,Xt(e)),gr(oy,n)}}function ly(e,n,o){e==="focusin"?(ed(),Io=n,To=o,Io.attachEvent("onpropertychange",td)):e==="focusout"&&ed()}function ay(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rs(To)}function cy(e,n){if(e==="click")return Rs(n)}function uy(e,n){if(e==="input"||e==="change")return Rs(n)}function dy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var vn=typeof Object.is=="function"?Object.is:dy;function Ro(e,n){if(vn(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)||!vn(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 Sa(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&&Sa(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,Li=null,ka=null,zo=null,Na=!1;function sd(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Na||Li==null||Li!==Ne(l)||(l=Li,"selectionStart"in l&&Sa(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}),zo&&Ro(zo,l)||(zo=l,l=Ds(ka,"onSelect"),0<l.length&&(n=new ha("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=Li)))}function zs(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Di={animationend:zs("Animation","AnimationEnd"),animationiteration:zs("Animation","AnimationIteration"),animationstart:zs("Animation","AnimationStart"),transitionend:zs("Transition","TransitionEnd")},Ea={},ld={};h&&(ld=document.createElement("div").style,"AnimationEvent"in window||(delete Di.animationend.animation,delete Di.animationiteration.animation,delete Di.animationstart.animation),"TransitionEvent"in window||delete Di.transitionend.transition);function As(e){if(Ea[e])return Ea[e];if(!Di[e])return e;var n=Di[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in ld)return Ea[e]=n[o];return e}var ad=As("animationend"),cd=As("animationiteration"),ud=As("animationstart"),dd=As("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 _r(e,n){fd.set(e,n),c(n,[e])}for(var Ca=0;Ca<hd.length;Ca++){var _a=hd[Ca],py=_a.toLowerCase(),my=_a[0].toUpperCase()+_a.slice(1);_r(py,"on"+my)}_r(ad,"onAnimationEnd"),_r(cd,"onAnimationIteration"),_r(ud,"onAnimationStart"),_r("dblclick","onDoubleClick"),_r("focusin","onFocus"),_r("focusout","onBlur"),_r(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 Ao="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(Ao));function pd(e,n,o){var l=e.type||"unknown-event";e.currentTarget=o,yo(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 T=l[w],D=T.instance,ee=T.currentTarget;if(T=T.listener,D!==p&&f.isPropagationStopped())break e;pd(f,T,ee),p=D}else for(w=0;w<l.length;w++){if(T=l[w],D=T.instance,ee=T.currentTarget,T=T.listener,D!==p&&f.isPropagationStopped())break e;pd(f,T,ee),p=D}}}if(vr)throw e=kt,vr=!1,kt=null,e}function Ke(e,n){var o=n[za];o===void 0&&(o=n[za]=new Set);var l=e+"__bubble";o.has(l)||(gd(n,e,2,!1),o.add(l))}function ja(e,n,o){var l=0;n&&(l|=4),gd(o,e,l,n)}var Ls="_reactListening"+Math.random().toString(36).slice(2);function Lo(e){if(!e[Ls]){e[Ls]=!0,s.forEach(function(o){o!=="selectionchange"&&(gy.has(o)||ja(o,!1,e),ja(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Ls]||(n[Ls]=!0,ja("selectionchange",!1,n))}}function gd(e,n,o,l){switch(Fu(n)){case 1:var f=Fn;break;case 4:f=Ri;break;default:f=jo}o=f.bind(null,n,o,e),f=void 0,!Mn||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 ba(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 T=l.stateNode.containerInfo;if(T===f||T.nodeType===8&&T.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(;T!==null;){if(w=ri(T),w===null)return;if(D=w.tag,D===5||D===6){l=p=w;continue e}T=T.parentNode}}l=l.return}gr(function(){var ee=p,ce=Xt(o),ue=[];e:{var ae=fd.get(e);if(ae!==void 0){var ge=ha,xe=e;switch(e){case"keypress":if(Ps(o)===0)break e;case"keydown":case"keyup":ge=Yg;break;case"focusin":xe="focus",ge=ga;break;case"focusout":xe="blur",ge=ga;break;case"beforeblur":case"afterblur":ge=ga;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":ge=Bu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=zg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=Kg;break;case ad:case cd:case ud:ge=Dg;break;case dd:ge=qg;break;case"scroll":ge=Tg;break;case"wheel":ge=Jg;break;case"copy":case"cut":case"paste":ge=Fg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=Wu}var Se=(n&4)!==0,at=!Se&&e==="scroll",X=Se?ae!==null?ae+"Capture":null:ae;Se=[];for(var O=ee,q;O!==null;){q=O;var fe=q.stateNode;if(q.tag===5&&fe!==null&&(q=fe,X!==null&&(fe=mn(O,X),fe!=null&&Se.push(Do(O,fe,q)))),at)break;O=O.return}0<Se.length&&(ae=new ge(ae,xe,null,o,ce),ue.push({event:ae,listeners:Se}))}}if((n&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",ge=e==="mouseout"||e==="pointerout",ae&&o!==hr&&(xe=o.relatedTarget||o.fromElement)&&(ri(xe)||xe[Zn]))break e;if((ge||ae)&&(ae=ce.window===ce?ce:(ae=ce.ownerDocument)?ae.defaultView||ae.parentWindow:window,ge?(xe=o.relatedTarget||o.toElement,ge=ee,xe=xe?ri(xe):null,xe!==null&&(at=Nt(xe),xe!==at||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(ge=null,xe=ee),ge!==xe)){if(Se=Bu,fe="onMouseLeave",X="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Wu,fe="onPointerLeave",X="onPointerEnter",O="pointer"),at=ge==null?ae:Oi(ge),q=xe==null?ae:Oi(xe),ae=new Se(fe,O+"leave",ge,o,ce),ae.target=at,ae.relatedTarget=q,fe=null,ri(ce)===ee&&(Se=new Se(X,O+"enter",xe,o,ce),Se.target=q,Se.relatedTarget=at,fe=Se),at=fe,ge&&xe)t:{for(Se=ge,X=xe,O=0,q=Se;q;q=$i(q))O++;for(q=0,fe=X;fe;fe=$i(fe))q++;for(;0<O-q;)Se=$i(Se),O--;for(;0<q-O;)X=$i(X),q--;for(;O--;){if(Se===X||X!==null&&Se===X.alternate)break t;Se=$i(Se),X=$i(X)}Se=null}else Se=null;ge!==null&&yd(ue,ae,ge,Se,!1),xe!==null&&at!==null&&yd(ue,at,xe,Se,!0)}}e:{if(ae=ee?Oi(ee):window,ge=ae.nodeName&&ae.nodeName.toLowerCase(),ge==="select"||ge==="input"&&ae.type==="file")var Ee=sy;else if(Qu(ae))if(Zu)Ee=uy;else{Ee=ay;var Me=ly}else(ge=ae.nodeName)&&ge.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"&&wt(ae,"number",ae.value)}switch(Me=ee?Oi(ee):window,e){case"focusin":(Qu(Me)||Me.contentEditable==="true")&&(Li=Me,ka=ee,zo=null);break;case"focusout":zo=ka=Li=null;break;case"mousedown":Na=!0;break;case"contextmenu":case"mouseup":case"dragend":Na=!1,sd(ue,o,ce);break;case"selectionchange":if(hy)break;case"keydown":case"keyup":sd(ue,o,ce)}var Pe;if(va)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Ai?Gu(e,o)&&(ze="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(ze="onCompositionStart");ze&&(Uu&&o.locale!=="ko"&&(Ai||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Ai&&(Pe=Ou()):(Cr=ce,fa="value"in Cr?Cr.value:Cr.textContent,Ai=!0)),Me=Ds(ee,ze),0<Me.length&&(ze=new Vu(ze,e,null,o,ce),ue.push({event:ze,listeners:Me}),Pe?ze.data=Pe:(Pe=Ku(o),Pe!==null&&(ze.data=Pe)))),(Pe=ty?ny(e,o):ry(e,o))&&(ee=Ds(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 Do(e,n,o){return{instance:e,listener:n,currentTarget:o}}function Ds(e,n){for(var o=n+"Capture",l=[];e!==null;){var f=e,p=f.stateNode;f.tag===5&&p!==null&&(f=p,p=mn(e,o),p!=null&&l.unshift(Do(e,p,f)),p=mn(e,n),p!=null&&l.push(Do(e,p,f))),e=e.return}return l}function $i(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 T=o,D=T.alternate,ee=T.stateNode;if(D!==null&&D===l)break;T.tag===5&&ee!==null&&(T=ee,f?(D=mn(o,p),D!=null&&w.unshift(Do(o,D,T))):f||(D=mn(o,p),D!=null&&w.push(Do(o,D,T)))),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 $s(e,n,o){if(n=vd(n),vd(e)!==n&&o)throw Error(i(425))}function Fs(){}var Ma=null,Pa=null;function Ia(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 Ta=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)}:Ta;function Sy(e){setTimeout(function(){throw e})}function Ra(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),ot(n);return}l--}else o!=="$"&&o!=="$?"&&o!=="$!"||l++;o=f}while(o);ot(n)}function jr(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 Fi=Math.random().toString(36).slice(2),On="__reactFiber$"+Fi,$o="__reactProps$"+Fi,Zn="__reactContainer$"+Fi,za="__reactEvents$"+Fi,ky="__reactListeners$"+Fi,Ny="__reactHandles$"+Fi;function ri(e){var n=e[On];if(n)return n;for(var o=e.parentNode;o;){if(n=o[Zn]||o[On]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=wd(e);e!==null;){if(o=e[On])return o;e=wd(e)}return n}e=o,o=e.parentNode}return null}function Fo(e){return e=e[On]||e[Zn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Oi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function Os(e){return e[$o]||null}var Aa=[],Hi=-1;function br(e){return{current:e}}function Qe(e){0>Hi||(e.current=Aa[Hi],Aa[Hi]=null,Hi--)}function Xe(e,n){Hi++,Aa[Hi]=e.current,e.current=n}var Mr={},_t=br(Mr),Dt=br(!1),ii=Mr;function Bi(e,n){var o=e.type.contextTypes;if(!o)return Mr;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 $t(e){return e=e.childContextTypes,e!=null}function Hs(){Qe(Dt),Qe(_t)}function Sd(e,n,o){if(_t.current!==Mr)throw Error(i(168));Xe(_t,n),Xe(Dt,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,me(e)||"Unknown",f));return Y({},o,l)}function Bs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Mr,ii=_t.current,Xe(_t,e),Xe(Dt,Dt.current),!0}function Nd(e,n,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=kd(e,n,ii),l.__reactInternalMemoizedMergedChildContext=e,Qe(Dt),Qe(_t),Xe(_t,e)):Qe(Dt),Xe(Dt,o)}var Jn=null,Vs=!1,La=!1;function Ed(e){Jn===null?Jn=[e]:Jn.push(e)}function Ey(e){Vs=!0,Ed(e)}function Pr(){if(!La&&Jn!==null){La=!0;var e=0,n=Be;try{var o=Jn;for(Be=1;e<o.length;e++){var l=o[e];do l=l(!0);while(l!==null)}Jn=null,Vs=!1}catch(f){throw Jn!==null&&(Jn=Jn.slice(e+1)),Gt(wr,Pr),f}finally{Be=n,La=!1}}return null}var Vi=[],Wi=0,Ws=null,Us=0,sn=[],ln=0,oi=null,er=1,tr="";function si(e,n){Vi[Wi++]=Us,Vi[Wi++]=Ws,Ws=e,Us=n}function Cd(e,n,o){sn[ln++]=er,sn[ln++]=tr,sn[ln++]=oi,oi=e;var l=er;e=tr;var f=32-Ct(l)-1;l&=~(1<<f),o+=1;var p=32-Ct(n)+f;if(30<p){var w=f-f%5;p=(l&(1<<w)-1).toString(32),l>>=w,f-=w,er=1<<32-Ct(n)+f|o<<f|l,tr=p+e}else er=1<<p|o<<f|l,tr=e}function Da(e){e.return!==null&&(si(e,1),Cd(e,1,0))}function $a(e){for(;e===Ws;)Ws=Vi[--Wi],Vi[Wi]=null,Us=Vi[--Wi],Vi[Wi]=null;for(;e===oi;)oi=sn[--ln],sn[ln]=null,tr=sn[--ln],sn[ln]=null,er=sn[--ln],sn[ln]=null}var Qt=null,qt=null,qe=!1,xn=null;function _d(e,n){var o=dn(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,Qt=e,qt=jr(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Qt=e,qt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=oi!==null?{id:er,overflow:tr}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=dn(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,Qt=e,qt=null,!0):!1;default:return!1}}function Fa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Oa(e){if(qe){var n=qt;if(n){var o=n;if(!jd(e,n)){if(Fa(e))throw Error(i(418));n=jr(o.nextSibling);var l=Qt;n&&jd(e,n)?_d(l,o):(e.flags=e.flags&-4097|2,qe=!1,Qt=e)}}else{if(Fa(e))throw Error(i(418));e.flags=e.flags&-4097|2,qe=!1,Qt=e}}}function bd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qt=e}function Ys(e){if(e!==Qt)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"&&!Ia(e.type,e.memoizedProps)),n&&(n=qt)){if(Fa(e))throw Md(),Error(i(418));for(;n;)_d(e,n),n=jr(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){qt=jr(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}qt=null}}else qt=Qt?jr(e.stateNode.nextSibling):null;return!0}function Md(){for(var e=qt;e;)e=jr(e.nextSibling)}function Ui(){qt=Qt=null,qe=!1}function Ha(e){xn===null?xn=[e]:xn.push(e)}var Cy=j.ReactCurrentBatchConfig;function Oo(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 T=f.refs;w===null?delete T[p]:T[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 Xs(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,O){if(e){var q=X.deletions;q===null?(X.deletions=[O],X.flags|=16):q.push(O)}}function o(X,O){if(!e)return null;for(;O!==null;)n(X,O),O=O.sibling;return null}function l(X,O){for(X=new Map;O!==null;)O.key!==null?X.set(O.key,O):X.set(O.index,O),O=O.sibling;return X}function f(X,O){return X=$r(X,O),X.index=0,X.sibling=null,X}function p(X,O,q){return X.index=q,e?(q=X.alternate,q!==null?(q=q.index,q<O?(X.flags|=2,O):q):(X.flags|=2,O)):(X.flags|=1048576,O)}function w(X){return e&&X.alternate===null&&(X.flags|=2),X}function T(X,O,q,fe){return O===null||O.tag!==6?(O=Tc(q,X.mode,fe),O.return=X,O):(O=f(O,q),O.return=X,O)}function D(X,O,q,fe){var Ee=q.type;return Ee===B?ce(X,O,q.props.children,fe,q.key):O!==null&&(O.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===W&&Pd(Ee)===O.type)?(fe=f(O,q.props),fe.ref=Oo(X,O,q),fe.return=X,fe):(fe=yl(q.type,q.key,q.props,null,X.mode,fe),fe.ref=Oo(X,O,q),fe.return=X,fe)}function ee(X,O,q,fe){return O===null||O.tag!==4||O.stateNode.containerInfo!==q.containerInfo||O.stateNode.implementation!==q.implementation?(O=Rc(q,X.mode,fe),O.return=X,O):(O=f(O,q.children||[]),O.return=X,O)}function ce(X,O,q,fe,Ee){return O===null||O.tag!==7?(O=pi(q,X.mode,fe,Ee),O.return=X,O):(O=f(O,q),O.return=X,O)}function ue(X,O,q){if(typeof O=="string"&&O!==""||typeof O=="number")return O=Tc(""+O,X.mode,q),O.return=X,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case F:return q=yl(O.type,O.key,O.props,null,X.mode,q),q.ref=Oo(X,null,O),q.return=X,q;case L:return O=Rc(O,X.mode,q),O.return=X,O;case W:var fe=O._init;return ue(X,fe(O._payload),q)}if(gt(O)||A(O))return O=pi(O,X.mode,q,null),O.return=X,O;Xs(X,O)}return null}function ae(X,O,q,fe){var Ee=O!==null?O.key:null;if(typeof q=="string"&&q!==""||typeof q=="number")return Ee!==null?null:T(X,O,""+q,fe);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case F:return q.key===Ee?D(X,O,q,fe):null;case L:return q.key===Ee?ee(X,O,q,fe):null;case W:return Ee=q._init,ae(X,O,Ee(q._payload),fe)}if(gt(q)||A(q))return Ee!==null?null:ce(X,O,q,fe,null);Xs(X,q)}return null}function ge(X,O,q,fe,Ee){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return X=X.get(q)||null,T(O,X,""+fe,Ee);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case F:return X=X.get(fe.key===null?q:fe.key)||null,D(O,X,fe,Ee);case L:return X=X.get(fe.key===null?q:fe.key)||null,ee(O,X,fe,Ee);case W:var Me=fe._init;return ge(X,O,q,Me(fe._payload),Ee)}if(gt(fe)||A(fe))return X=X.get(q)||null,ce(O,X,fe,Ee,null);Xs(O,fe)}return null}function xe(X,O,q,fe){for(var Ee=null,Me=null,Pe=O,ze=O=0,mt=null;Pe!==null&&ze<q.length;ze++){Pe.index>ze?(mt=Pe,Pe=null):mt=Pe.sibling;var Ve=ae(X,Pe,q[ze],fe);if(Ve===null){Pe===null&&(Pe=mt);break}e&&Pe&&Ve.alternate===null&&n(X,Pe),O=p(Ve,O,ze),Me===null?Ee=Ve:Me.sibling=Ve,Me=Ve,Pe=mt}if(ze===q.length)return o(X,Pe),qe&&si(X,ze),Ee;if(Pe===null){for(;ze<q.length;ze++)Pe=ue(X,q[ze],fe),Pe!==null&&(O=p(Pe,O,ze),Me===null?Ee=Pe:Me.sibling=Pe,Me=Pe);return qe&&si(X,ze),Ee}for(Pe=l(X,Pe);ze<q.length;ze++)mt=ge(Pe,X,ze,q[ze],fe),mt!==null&&(e&&mt.alternate!==null&&Pe.delete(mt.key===null?ze:mt.key),O=p(mt,O,ze),Me===null?Ee=mt:Me.sibling=mt,Me=mt);return e&&Pe.forEach(function(Fr){return n(X,Fr)}),qe&&si(X,ze),Ee}function Se(X,O,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=O,ze=O=0,mt=null,Ve=q.next();Pe!==null&&!Ve.done;ze++,Ve=q.next()){Pe.index>ze?(mt=Pe,Pe=null):mt=Pe.sibling;var Fr=ae(X,Pe,Ve.value,fe);if(Fr===null){Pe===null&&(Pe=mt);break}e&&Pe&&Fr.alternate===null&&n(X,Pe),O=p(Fr,O,ze),Me===null?Ee=Fr:Me.sibling=Fr,Me=Fr,Pe=mt}if(Ve.done)return o(X,Pe),qe&&si(X,ze),Ee;if(Pe===null){for(;!Ve.done;ze++,Ve=q.next())Ve=ue(X,Ve.value,fe),Ve!==null&&(O=p(Ve,O,ze),Me===null?Ee=Ve:Me.sibling=Ve,Me=Ve);return qe&&si(X,ze),Ee}for(Pe=l(X,Pe);!Ve.done;ze++,Ve=q.next())Ve=ge(Pe,X,ze,Ve.value,fe),Ve!==null&&(e&&Ve.alternate!==null&&Pe.delete(Ve.key===null?ze:Ve.key),O=p(Ve,O,ze),Me===null?Ee=Ve:Me.sibling=Ve,Me=Ve);return e&&Pe.forEach(function(i0){return n(X,i0)}),qe&&si(X,ze),Ee}function at(X,O,q,fe){if(typeof q=="object"&&q!==null&&q.type===B&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case F:e:{for(var Ee=q.key,Me=O;Me!==null;){if(Me.key===Ee){if(Ee=q.type,Ee===B){if(Me.tag===7){o(X,Me.sibling),O=f(Me,q.props.children),O.return=X,X=O;break e}}else if(Me.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===W&&Pd(Ee)===Me.type){o(X,Me.sibling),O=f(Me,q.props),O.ref=Oo(X,Me,q),O.return=X,X=O;break e}o(X,Me);break}else n(X,Me);Me=Me.sibling}q.type===B?(O=pi(q.props.children,X.mode,fe,q.key),O.return=X,X=O):(fe=yl(q.type,q.key,q.props,null,X.mode,fe),fe.ref=Oo(X,O,q),fe.return=X,X=fe)}return w(X);case L:e:{for(Me=q.key;O!==null;){if(O.key===Me)if(O.tag===4&&O.stateNode.containerInfo===q.containerInfo&&O.stateNode.implementation===q.implementation){o(X,O.sibling),O=f(O,q.children||[]),O.return=X,X=O;break e}else{o(X,O);break}else n(X,O);O=O.sibling}O=Rc(q,X.mode,fe),O.return=X,X=O}return w(X);case W:return Me=q._init,at(X,O,Me(q._payload),fe)}if(gt(q))return xe(X,O,q,fe);if(A(q))return Se(X,O,q,fe);Xs(X,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,O!==null&&O.tag===6?(o(X,O.sibling),O=f(O,q),O.return=X,X=O):(o(X,O),O=Tc(q,X.mode,fe),O.return=X,X=O),w(X)):o(X,O)}return at}var Yi=Id(!0),Td=Id(!1),Gs=br(null),Ks=null,Xi=null,Ba=null;function Va(){Ba=Xi=Ks=null}function Wa(e){var n=Gs.current;Qe(Gs),e._currentValue=n}function Ua(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 Gi(e,n){Ks=e,Ba=Xi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Ft=!0),e.firstContext=null)}function an(e){var n=e._currentValue;if(Ba!==e)if(e={context:e,memoizedValue:n,next:null},Xi===null){if(Ks===null)throw Error(i(308));Xi=e,Ks.dependencies={lanes:0,firstContext:e}}else Xi=Xi.next=e;return n}var li=null;function Ya(e){li===null?li=[e]:li.push(e)}function Rd(e,n,o,l){var f=n.interleaved;return f===null?(o.next=o,Ya(n)):(o.next=f.next,f.next=o),n.interleaved=o,nr(e,l)}function nr(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 Ir=!1;function Xa(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 rr(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Tr(e,n,o){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(He&2)!==0){var f=l.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),l.pending=n,nr(e,o)}return f=l.interleaved,f===null?(n.next=n,Ya(l)):(n.next=f.next,f.next=n),l.interleaved=n,nr(e,o)}function Qs(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,No(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;Ir=!1;var p=f.firstBaseUpdate,w=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var D=T,ee=D.next;D.next=null,w===null?p=ee:w.next=ee,w=D;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,T=ce.lastBaseUpdate,T!==w&&(T===null?ce.firstBaseUpdate=ee:T.next=ee,ce.lastBaseUpdate=D))}if(p!==null){var ue=f.baseState;w=0,ce=ee=D=null,T=p;do{var ae=T.lane,ge=T.eventTime;if((l&ae)===ae){ce!==null&&(ce=ce.next={eventTime:ge,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var xe=e,Se=T;switch(ae=n,ge=o,Se.tag){case 1:if(xe=Se.payload,typeof xe=="function"){ue=xe.call(ge,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(ge,ue,ae):xe,ae==null)break e;ue=Y({},ue,ae);break e;case 2:Ir=!0}}T.callback!==null&&T.lane!==0&&(e.flags|=64,ae=f.effects,ae===null?f.effects=[T]:ae.push(T))}else ge={eventTime:ge,lane:ae,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ce===null?(ee=ce=ge,D=ue):ce=ce.next=ge,w|=ae;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;ae=T,T=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);ui|=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 Ho={},Hn=br(Ho),Bo=br(Ho),Vo=br(Ho);function ai(e){if(e===Ho)throw Error(i(174));return e}function Ga(e,n){switch(Xe(Vo,n),Xe(Bo,e),Xe(Hn,Ho),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:nn(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=nn(n,e)}Qe(Hn),Xe(Hn,n)}function Ki(){Qe(Hn),Qe(Bo),Qe(Vo)}function Dd(e){ai(Vo.current);var n=ai(Hn.current),o=nn(n,e.type);n!==o&&(Xe(Bo,e),Xe(Hn,o))}function Ka(e){Bo.current===e&&(Qe(Hn),Qe(Bo))}var rt=br(0);function Zs(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 Qa=[];function qa(){for(var e=0;e<Qa.length;e++)Qa[e]._workInProgressVersionPrimary=null;Qa.length=0}var Js=j.ReactCurrentDispatcher,Za=j.ReactCurrentBatchConfig,ci=0,it=null,dt=null,ht=null,el=!1,Wo=!1,Uo=0,_y=0;function jt(){throw Error(i(321))}function Ja(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!vn(e[o],n[o]))return!1;return!0}function ec(e,n,o,l,f,p){if(ci=p,it=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Js.current=e===null||e.memoizedState===null?Py:Iy,e=o(l,f),Wo){p=0;do{if(Wo=!1,Uo=0,25<=p)throw Error(i(301));p+=1,ht=dt=null,n.updateQueue=null,Js.current=Ty,e=o(l,f)}while(Wo)}if(Js.current=rl,n=dt!==null&&dt.next!==null,ci=0,ht=dt=it=null,el=!1,n)throw Error(i(300));return e}function tc(){var e=Uo!==0;return Uo=0,e}function Bn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?it.memoizedState=ht=e:ht=ht.next=e,ht}function cn(){if(dt===null){var e=it.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var n=ht===null?it.memoizedState:ht.next;if(n!==null)ht=n,dt=e;else{if(e===null)throw Error(i(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},ht===null?it.memoizedState=ht=e:ht=ht.next=e}return ht}function Yo(e,n){return typeof n=="function"?n(e):n}function nc(e){var n=cn(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=dt,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 T=w=null,D=null,ee=p;do{var ce=ee.lane;if((ci&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?(T=D=ue,w=l):D=D.next=ue,it.lanes|=ce,ui|=ce}ee=ee.next}while(ee!==null&&ee!==p);D===null?w=l:D.next=T,vn(l,n.memoizedState)||(Ft=!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,it.lanes|=p,ui|=p,f=f.next;while(f!==e)}else f===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function rc(e){var n=cn(),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);vn(p,n.memoizedState)||(Ft=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),o.lastRenderedState=p}return[p,l]}function $d(){}function Fd(e,n){var o=it,l=cn(),f=n(),p=!vn(l.memoizedState,f);if(p&&(l.memoizedState=f,Ft=!0),l=l.queue,ic(Bd.bind(null,o,l,e),[e]),l.getSnapshot!==n||p||ht!==null&&ht.memoizedState.tag&1){if(o.flags|=2048,Xo(9,Hd.bind(null,o,l,f,n),void 0,null),pt===null)throw Error(i(349));(ci&30)!==0||Od(o,n,f)}return f}function Od(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=it.updateQueue,n===null?(n={lastEffect:null,stores:null},it.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!vn(e,o)}catch{return!0}}function Wd(e){var n=nr(e,1);n!==null&&Nn(n,e,1,-1)}function Ud(e){var n=Bn();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:e},n.queue=e,e=e.dispatch=My.bind(null,it,e),[n.memoizedState,e]}function Xo(e,n,o,l){return e={tag:e,create:n,destroy:o,deps:l,next:null},n=it.updateQueue,n===null?(n={lastEffect:null,stores:null},it.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 cn().memoizedState}function tl(e,n,o,l){var f=Bn();it.flags|=e,f.memoizedState=Xo(1|n,o,void 0,l===void 0?null:l)}function nl(e,n,o,l){var f=cn();l=l===void 0?null:l;var p=void 0;if(dt!==null){var w=dt.memoizedState;if(p=w.destroy,l!==null&&Ja(l,w.deps)){f.memoizedState=Xo(n,o,p,l);return}}it.flags|=e,f.memoizedState=Xo(1|n,o,p,l)}function Xd(e,n){return tl(8390656,8,e,n)}function ic(e,n){return nl(2048,8,e,n)}function Gd(e,n){return nl(4,2,e,n)}function Kd(e,n){return nl(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,nl(4,4,Qd.bind(null,n,e),o)}function oc(){}function Zd(e,n){var o=cn();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&Ja(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function Jd(e,n){var o=cn();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&Ja(n,l[1])?l[0]:(e=e(),o.memoizedState=[e,n],e)}function ef(e,n,o){return(ci&21)===0?(e.baseState&&(e.baseState=!1,Ft=!0),e.memoizedState=o):(vn(o,n)||(o=An(),it.lanes|=o,ui|=o,e.baseState=!0),n)}function jy(e,n){var o=Be;Be=o!==0&&4>o?o:4,e(!0);var l=Za.transition;Za.transition={};try{e(!1),n()}finally{Be=o,Za.transition=l}}function tf(){return cn().memoizedState}function by(e,n,o){var l=Lr(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();Nn(o,e,l,f),of(o,n,l)}}function My(e,n,o){var l=Lr(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,T=p(w,o);if(f.hasEagerState=!0,f.eagerState=T,vn(T,w)){var D=n.interleaved;D===null?(f.next=f,Ya(n)):(f.next=D.next,D.next=f),n.interleaved=f;return}}catch{}finally{}o=Rd(e,n,f,l),o!==null&&(f=Rt(),Nn(o,e,l,f),of(o,n,l))}}function nf(e){var n=e.alternate;return e===it||n!==null&&n===it}function rf(e,n){Wo=el=!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,No(e,o)}}var rl={readContext:an,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useInsertionEffect:jt,useLayoutEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useMutableSource:jt,useSyncExternalStore:jt,useId:jt,unstable_isNewReconciler:!1},Py={readContext:an,useCallback:function(e,n){return Bn().memoizedState=[e,n===void 0?null:n],e},useContext:an,useEffect:Xd,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,tl(4194308,4,Qd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return tl(4194308,4,e,n)},useInsertionEffect:function(e,n){return tl(4,2,e,n)},useMemo:function(e,n){var o=Bn();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var l=Bn();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,it,e),[l.memoizedState,e]},useRef:function(e){var n=Bn();return e={current:e},n.memoizedState=e},useState:Ud,useDebugValue:oc,useDeferredValue:function(e){return Bn().memoizedState=e},useTransition:function(){var e=Ud(!1),n=e[0];return e=jy.bind(null,e[1]),Bn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var l=it,f=Bn();if(qe){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),pt===null)throw Error(i(349));(ci&30)!==0||Od(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,Xo(9,Hd.bind(null,l,p,o,n),void 0,null),o},useId:function(){var e=Bn(),n=pt.identifierPrefix;if(qe){var o=tr,l=er;o=(l&~(1<<32-Ct(l)-1)).toString(32)+o,n=":"+n+"R"+o,o=Uo++,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:an,useCallback:Zd,useContext:an,useEffect:ic,useImperativeHandle:qd,useInsertionEffect:Gd,useLayoutEffect:Kd,useMemo:Jd,useReducer:nc,useRef:Yd,useState:function(){return nc(Yo)},useDebugValue:oc,useDeferredValue:function(e){var n=cn();return ef(n,dt.memoizedState,e)},useTransition:function(){var e=nc(Yo)[0],n=cn().memoizedState;return[e,n]},useMutableSource:$d,useSyncExternalStore:Fd,useId:tf,unstable_isNewReconciler:!1},Ty={readContext:an,useCallback:Zd,useContext:an,useEffect:ic,useImperativeHandle:qd,useInsertionEffect:Gd,useLayoutEffect:Kd,useMemo:Jd,useReducer:rc,useRef:Yd,useState:function(){return rc(Yo)},useDebugValue:oc,useDeferredValue:function(e){var n=cn();return dt===null?n.memoizedState=e:ef(n,dt.memoizedState,e)},useTransition:function(){var e=rc(Yo)[0],n=cn().memoizedState;return[e,n]},useMutableSource:$d,useSyncExternalStore:Fd,useId:tf,unstable_isNewReconciler:!1};function wn(e,n){if(e&&e.defaultProps){n=Y({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function sc(e,n,o,l){n=e.memoizedState,o=o(l,n),o=o==null?n:Y({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var il={isMounted:function(e){return(e=e._reactInternals)?Nt(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var l=Rt(),f=Lr(e),p=rr(l,f);p.payload=n,o!=null&&(p.callback=o),n=Tr(e,p,f),n!==null&&(Nn(n,e,f,l),Qs(n,e,f))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=Rt(),f=Lr(e),p=rr(l,f);p.tag=1,p.payload=n,o!=null&&(p.callback=o),n=Tr(e,p,f),n!==null&&(Nn(n,e,f,l),Qs(n,e,f))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=Rt(),l=Lr(e),f=rr(o,l);f.tag=2,n!=null&&(f.callback=n),n=Tr(e,f,l),n!==null&&(Nn(n,e,l,o),Qs(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?!Ro(o,l)||!Ro(f,p):!0}function lf(e,n,o){var l=!1,f=Mr,p=n.contextType;return typeof p=="object"&&p!==null?p=an(p):(f=$t(n)?ii:_t.current,l=n.contextTypes,p=(l=l!=null)?Bi(e,f):Mr),n=new n(o,p),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=il,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&&il.enqueueReplaceState(n,n.state,null)}function lc(e,n,o,l){var f=e.stateNode;f.props=o,f.state=e.memoizedState,f.refs={},Xa(e);var p=n.contextType;typeof p=="object"&&p!==null?f.context=an(p):(p=$t(n)?ii:_t.current,f.context=Bi(e,p)),f.state=e.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(sc(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&&il.enqueueReplaceState(f,f.state,null),qs(e,o,f,l),f.state=e.memoizedState),typeof f.componentDidMount=="function"&&(e.flags|=4194308)}function Qi(e,n){try{var o="",l=n;do o+=de(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 ac(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function cc(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=rr(-1,o),o.tag=3,o.payload={element:null};var l=n.value;return o.callback=function(){dl||(dl=!0,Ec=l),cc(e,n)},o}function uf(e,n,o){o=rr(-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(){cc(e,n)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(o.callback=function(){cc(e,n),typeof l!="function"&&(zr===null?zr=new Set([this]):zr.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=rr(-1,1),n.tag=2,Tr(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var zy=j.ReactCurrentOwner,Ft=!1;function Tt(e,n,o,l){n.child=e===null?Td(n,null,o,l):Yi(n,e.child,o,l)}function pf(e,n,o,l,f){o=o.render;var p=n.ref;return Gi(n,f),l=ec(e,n,o,l,p,f),o=tc(),e!==null&&!Ft?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,ir(e,n,f)):(qe&&o&&Da(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"&&!Ic(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=yl(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:Ro,o(w,l)&&e.ref===n.ref)return ir(e,n,f)}return n.flags|=1,e=$r(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(Ro(p,l)&&e.ref===n.ref)if(Ft=!1,n.pendingProps=l=p,(e.lanes&f)!==0)(e.flags&131072)!==0&&(Ft=!0);else return n.lanes=e.lanes,ir(e,n,f)}return uc(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},Xe(Zi,Zt),Zt|=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,Xe(Zi,Zt),Zt|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:o,Xe(Zi,Zt),Zt|=l}else p!==null?(l=p.baseLanes|o,n.memoizedState=null):l=o,Xe(Zi,Zt),Zt|=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 uc(e,n,o,l,f){var p=$t(o)?ii:_t.current;return p=Bi(n,p),Gi(n,f),o=ec(e,n,o,l,p,f),l=tc(),e!==null&&!Ft?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~f,ir(e,n,f)):(qe&&l&&Da(n),n.flags|=1,Tt(e,n,o,f),n.child)}function xf(e,n,o,l,f){if($t(o)){var p=!0;Bs(n)}else p=!1;if(Gi(n,f),n.stateNode===null)sl(e,n),lf(n,o,l),lc(n,o,l,f),l=!0;else if(e===null){var w=n.stateNode,T=n.memoizedProps;w.props=T;var D=w.context,ee=o.contextType;typeof ee=="object"&&ee!==null?ee=an(ee):(ee=$t(o)?ii:_t.current,ee=Bi(n,ee));var ce=o.getDerivedStateFromProps,ue=typeof ce=="function"||typeof w.getSnapshotBeforeUpdate=="function";ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==l||D!==ee)&&af(n,w,l,ee),Ir=!1;var ae=n.memoizedState;w.state=ae,qs(n,l,w,f),D=n.memoizedState,T!==l||ae!==D||Dt.current||Ir?(typeof ce=="function"&&(sc(n,o,ce,l),D=n.memoizedState),(T=Ir||sf(n,o,T,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=T):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{w=n.stateNode,zd(e,n),T=n.memoizedProps,ee=n.type===n.elementType?T:wn(n.type,T),w.props=ee,ue=n.pendingProps,ae=w.context,D=o.contextType,typeof D=="object"&&D!==null?D=an(D):(D=$t(o)?ii:_t.current,D=Bi(n,D));var ge=o.getDerivedStateFromProps;(ce=typeof ge=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==ue||ae!==D)&&af(n,w,l,D),Ir=!1,ae=n.memoizedState,w.state=ae,qs(n,l,w,f);var xe=n.memoizedState;T!==ue||ae!==xe||Dt.current||Ir?(typeof ge=="function"&&(sc(n,o,ge,l),xe=n.memoizedState),(ee=Ir||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"||T===e.memoizedProps&&ae===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===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"||T===e.memoizedProps&&ae===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&ae===e.memoizedState||(n.flags|=1024),l=!1)}return dc(e,n,o,l,p,f)}function dc(e,n,o,l,f,p){vf(e,n);var w=(n.flags&128)!==0;if(!l&&!w)return f&&Nd(n,o,!1),ir(e,n,p);l=n.stateNode,zy.current=n;var T=w&&typeof o.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&w?(n.child=Yi(n,e.child,null,p),n.child=Yi(n,null,T,p)):Tt(e,n,T,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),Ga(e,n.containerInfo)}function Sf(e,n,o,l,f){return Ui(),Ha(f),n.flags|=256,Tt(e,n,o,l),n.child}var fc={dehydrated:null,treeContext:null,retryLane:0};function hc(e){return{baseLanes:e,cachePool:null,transitions:null}}function kf(e,n,o){var l=n.pendingProps,f=rt.current,p=!1,w=(n.flags&128)!==0,T;if((T=w)||(T=e!==null&&e.memoizedState===null?!1:(f&2)!==0),T?(p=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(f|=1),Xe(rt,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=vl(w,l,0,null),e=pi(e,l,o,null),p.return=n,e.return=n,p.sibling=e,n.child=p,n.child.memoizedState=hc(o),n.memoizedState=fc,e):pc(n,w));if(f=e.memoizedState,f!==null&&(T=f.dehydrated,T!==null))return Ay(e,n,w,l,T,f,o);if(p){p=l.fallback,w=n.mode,f=e.child,T=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=$r(f,D),l.subtreeFlags=f.subtreeFlags&14680064),T!==null?p=$r(T,p):(p=pi(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?hc(o):{baseLanes:w.baseLanes|o,cachePool:null,transitions:w.transitions},p.memoizedState=w,p.childLanes=e.childLanes&~o,n.memoizedState=fc,l}return p=e.child,e=p.sibling,l=$r(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 pc(e,n){return n=vl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function ol(e,n,o,l){return l!==null&&Ha(l),Yi(n,e.child,null,o),e=pc(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=ac(Error(i(422))),ol(e,n,w,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(p=l.fallback,f=n.mode,l=vl({mode:"visible",children:l.children},f,0,null),p=pi(p,f,w,null),p.flags|=2,l.return=n,p.return=n,l.sibling=p,n.child=l,(n.mode&1)!==0&&Yi(n,e.child,null,w),n.child.memoizedState=hc(w),n.memoizedState=fc,p);if((n.mode&1)===0)return ol(e,n,w,null);if(f.data==="$!"){if(l=f.nextSibling&&f.nextSibling.dataset,l)var T=l.dgst;return l=T,p=Error(i(419)),l=ac(p,l,void 0),ol(e,n,w,l)}if(T=(w&e.childLanes)!==0,Ft||T){if(l=pt,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,nr(e,f),Nn(l,e,f,-1))}return Pc(),l=ac(Error(i(421))),ol(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,qt=jr(f.nextSibling),Qt=n,qe=!0,xn=null,e!==null&&(sn[ln++]=er,sn[ln++]=tr,sn[ln++]=oi,er=e.id,tr=e.overflow,oi=n),n=pc(n,l.children),n.flags|=4096,n)}function Nf(e,n,o){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),Ua(e.return,n,o)}function mc(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=rt.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(Xe(rt,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&&Zs(e)===null&&(f=o),o=o.sibling;o=f,o===null?(f=n.child,n.child=null):(f=o.sibling,o.sibling=null),mc(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&&Zs(e)===null){n.child=f;break}e=f.sibling,f.sibling=o,o=f,f=e}mc(n,!0,o,null,p);break;case"together":mc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function sl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function ir(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),ui|=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=$r(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=$r(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Ly(e,n,o){switch(n.tag){case 3:wf(n),Ui();break;case 5:Dd(n);break;case 1:$t(n.type)&&Bs(n);break;case 4:Ga(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,f=n.memoizedProps.value;Xe(Gs,l._currentValue),l._currentValue=f;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(Xe(rt,rt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?kf(e,n,o):(Xe(rt,rt.current&1),e=ir(e,n,o),e!==null?e.sibling:null);Xe(rt,rt.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),Xe(rt,rt.current),l)break;return null;case 22:case 23:return n.lanes=0,yf(e,n,o)}return ir(e,n,o)}var Cf,gc,_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}},gc=function(){},_f=function(e,n,o,l){var f=e.memoizedProps;if(f!==l){e=n.stateNode,ai(Hn.current);var p=null;switch(o){case"input":f=$e(e,f),l=$e(e,l),p=[];break;case"select":f=Y({},f,{value:void 0}),l=Y({},l,{value:void 0}),p=[];break;case"textarea":f=Ut(e,f),l=Ut(e,l),p=[];break;default:typeof f.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Fs)}dr(o,l);var w;o=null;for(ee in f)if(!l.hasOwnProperty(ee)&&f.hasOwnProperty(ee)&&f[ee]!=null)if(ee==="style"){var T=f[ee];for(w in T)T.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(T=f!=null?f[ee]:void 0,l.hasOwnProperty(ee)&&D!==T&&(D!=null||T!=null))if(ee==="style")if(T){for(w in T)!T.hasOwnProperty(w)||D&&D.hasOwnProperty(w)||(o||(o={}),o[w]="");for(w in D)D.hasOwnProperty(w)&&T[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,T=T?T.__html:void 0,D!=null&&T!==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"&&Ke("scroll",e),p||T===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 Go(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 bt(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($a(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(n),null;case 1:return $t(n.type)&&Hs(),bt(n),null;case 3:return l=n.stateNode,Ki(),Qe(Dt),Qe(_t),qa(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ys(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,xn!==null&&(jc(xn),xn=null))),gc(e,n),bt(n),null;case 5:Ka(n);var f=ai(Vo.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 bt(n),null}if(e=ai(Hn.current),Ys(n)){l=n.stateNode,o=n.type;var p=n.memoizedProps;switch(l[On]=n,l[$o]=p,e=(n.mode&1)!==0,o){case"dialog":Ke("cancel",l),Ke("close",l);break;case"iframe":case"object":case"embed":Ke("load",l);break;case"video":case"audio":for(f=0;f<Ao.length;f++)Ke(Ao[f],l);break;case"source":Ke("error",l);break;case"img":case"image":case"link":Ke("error",l),Ke("load",l);break;case"details":Ke("toggle",l);break;case"input":Fe(l,p),Ke("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},Ke("invalid",l);break;case"textarea":Yt(l,p),Ke("invalid",l)}dr(o,p),f=null;for(var w in p)if(p.hasOwnProperty(w)){var T=p[w];w==="children"?typeof T=="string"?l.textContent!==T&&(p.suppressHydrationWarning!==!0&&$s(l.textContent,T,e),f=["children",T]):typeof T=="number"&&l.textContent!==""+T&&(p.suppressHydrationWarning!==!0&&$s(l.textContent,T,e),f=["children",""+T]):a.hasOwnProperty(w)&&T!=null&&w==="onScroll"&&Ke("scroll",l)}switch(o){case"input":Ie(l),Pt(l,p,!0);break;case"textarea":Ie(l),Kn(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Fs)}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=be(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[On]=n,e[$o]=l,Cf(e,n,!1,!1),n.stateNode=e;e:{switch(w=fr(o,l),o){case"dialog":Ke("cancel",e),Ke("close",e),f=l;break;case"iframe":case"object":case"embed":Ke("load",e),f=l;break;case"video":case"audio":for(f=0;f<Ao.length;f++)Ke(Ao[f],e);f=l;break;case"source":Ke("error",e),f=l;break;case"img":case"image":case"link":Ke("error",e),Ke("load",e),f=l;break;case"details":Ke("toggle",e),f=l;break;case"input":Fe(e,l),f=$e(e,l),Ke("invalid",e);break;case"option":f=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},f=Y({},l,{value:void 0}),Ke("invalid",e);break;case"textarea":Yt(e,l),f=Ut(e,l),Ke("invalid",e);break;default:f=l}dr(o,f),T=f;for(p in T)if(T.hasOwnProperty(p)){var D=T[p];p==="style"?Gr(e,D):p==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,D!=null&&Yr(e,D)):p==="children"?typeof D=="string"?(o!=="textarea"||D!=="")&&fn(e,D):typeof D=="number"&&fn(e,""+D):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?D!=null&&p==="onScroll"&&Ke("scroll",e):D!=null&&k(e,p,D,w))}switch(o){case"input":Ie(e),Pt(e,l,!1);break;case"textarea":Ie(e),Kn(e);break;case"option":l.value!=null&&e.setAttribute("value",""+oe(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?St(e,!!l.multiple,p,!1):l.defaultValue!=null&&St(e,!!l.multiple,l.defaultValue,!0);break;default:typeof f.onClick=="function"&&(e.onclick=Fs)}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 bt(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=ai(Vo.current),ai(Hn.current),Ys(n)){if(l=n.stateNode,o=n.memoizedProps,l[On]=n,(p=l.nodeValue!==o)&&(e=Qt,e!==null))switch(e.tag){case 3:$s(l.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$s(l.nodeValue,o,(e.mode&1)!==0)}p&&(n.flags|=4)}else l=(o.nodeType===9?o:o.ownerDocument).createTextNode(l),l[On]=n,n.stateNode=l}return bt(n),null;case 13:if(Qe(rt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qe&&qt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Md(),Ui(),n.flags|=98560,p=!1;else if(p=Ys(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[On]=n}else Ui(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;bt(n),p=!1}else xn!==null&&(jc(xn),xn=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||(rt.current&1)!==0?ft===0&&(ft=3):Pc())),n.updateQueue!==null&&(n.flags|=4),bt(n),null);case 4:return Ki(),gc(e,n),e===null&&Lo(n.stateNode.containerInfo),bt(n),null;case 10:return Wa(n.type._context),bt(n),null;case 17:return $t(n.type)&&Hs(),bt(n),null;case 19:if(Qe(rt),p=n.memoizedState,p===null)return bt(n),null;if(l=(n.flags&128)!==0,w=p.rendering,w===null)if(l)Go(p,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(w=Zs(e),w!==null){for(n.flags|=128,Go(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 Xe(rt,rt.current&1|2),n.child}e=e.sibling}p.tail!==null&&Ge()>Ji&&(n.flags|=128,l=!0,Go(p,!1),n.lanes=4194304)}else{if(!l)if(e=Zs(w),e!==null){if(n.flags|=128,l=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),Go(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!qe)return bt(n),null}else 2*Ge()-p.renderingStartTime>Ji&&o!==1073741824&&(n.flags|=128,l=!0,Go(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=Ge(),n.sibling=null,o=rt.current,Xe(rt,l?o&1|2:o&1),n):(bt(n),null);case 22:case 23:return Mc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Zt&1073741824)!==0&&(bt(n),n.subtreeFlags&6&&(n.flags|=8192)):bt(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function $y(e,n){switch($a(n),n.tag){case 1:return $t(n.type)&&Hs(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Ki(),Qe(Dt),Qe(_t),qa(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Ka(n),null;case 13:if(Qe(rt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));Ui()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Qe(rt),null;case 4:return Ki(),null;case 10:return Wa(n.type._context),null;case 22:case 23:return Mc(),null;case 24:return null;default:return null}}var ll=!1,Mt=!1,Fy=typeof WeakSet=="function"?WeakSet:Set,ve=null;function qi(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(l){st(e,n,l)}else o.current=null}function yc(e,n,o){try{o()}catch(l){st(e,n,l)}}var bf=!1;function Oy(e,n){if(Ma=nt,e=od(),Sa(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,T=-1,D=-1,ee=0,ce=0,ue=e,ae=null;t:for(;;){for(var ge;ue!==o||f!==0&&ue.nodeType!==3||(T=w+f),ue!==p||l!==0&&ue.nodeType!==3||(D=w+l),ue.nodeType===3&&(w+=ue.nodeValue.length),(ge=ue.firstChild)!==null;)ae=ue,ue=ge;for(;;){if(ue===e)break t;if(ae===o&&++ee===f&&(T=w),ae===p&&++ce===l&&(D=w),(ge=ue.nextSibling)!==null)break;ue=ae,ae=ue.parentNode}ue=ge}o=T===-1||D===-1?null:{start:T,end:D}}else o=null}o=o||{start:0,end:0}}else o=null;for(Pa={focusedElem:e,selectionRange:o},nt=!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,at=xe.memoizedState,X=n.stateNode,O=X.getSnapshotBeforeUpdate(n.elementType===n.type?Se:wn(n.type,Se),at);X.__reactInternalSnapshotBeforeUpdate=O}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){st(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 Ko(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&&yc(n,o,p)}f=f.next}while(f!==l)}}function al(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 vc(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[On],delete n[$o],delete n[za],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 xc(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=Fs));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}function wc(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(wc(e,n,o),e=e.sibling;e!==null;)wc(e,n,o),e=e.sibling}var vt=null,Sn=!1;function Rr(e,n,o){for(o=o.child;o!==null;)Tf(e,n,o),o=o.sibling}function Tf(e,n,o){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Rn,o)}catch{}switch(o.tag){case 5:Mt||qi(o,n);case 6:var l=vt,f=Sn;vt=null,Rr(e,n,o),vt=l,Sn=f,vt!==null&&(Sn?(e=vt,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):vt.removeChild(o.stateNode));break;case 18:vt!==null&&(Sn?(e=vt,o=o.stateNode,e.nodeType===8?Ra(e.parentNode,o):e.nodeType===1&&Ra(e,o),ot(e)):Ra(vt,o.stateNode));break;case 4:l=vt,f=Sn,vt=o.stateNode.containerInfo,Sn=!0,Rr(e,n,o),vt=l,Sn=f;break;case 0:case 11:case 14:case 15:if(!Mt&&(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)&&yc(o,n,w),f=f.next}while(f!==l)}Rr(e,n,o);break;case 1:if(!Mt&&(qi(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=o.memoizedProps,l.state=o.memoizedState,l.componentWillUnmount()}catch(T){st(o,n,T)}Rr(e,n,o);break;case 21:Rr(e,n,o);break;case 22:o.mode&1?(Mt=(l=Mt)||o.memoizedState!==null,Rr(e,n,o),Mt=l):Rr(e,n,o);break;default:Rr(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 Fy),n.forEach(function(l){var f=Ky.bind(null,e,l);o.has(l)||(o.add(l),l.then(f,f))})}}function kn(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,T=w;e:for(;T!==null;){switch(T.tag){case 5:vt=T.stateNode,Sn=!1;break e;case 3:vt=T.stateNode.containerInfo,Sn=!0;break e;case 4:vt=T.stateNode.containerInfo,Sn=!0;break e}T=T.return}if(vt===null)throw Error(i(160));Tf(p,w,f),vt=null,Sn=!1;var D=f.alternate;D!==null&&(D.return=null),f.return=null}catch(ee){st(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(kn(n,e),Vn(e),l&4){try{Ko(3,e,e.return),al(3,e)}catch(Se){st(e,e.return,Se)}try{Ko(5,e,e.return)}catch(Se){st(e,e.return,Se)}}break;case 1:kn(n,e),Vn(e),l&512&&o!==null&&qi(o,o.return);break;case 5:if(kn(n,e),Vn(e),l&512&&o!==null&&qi(o,o.return),e.flags&32){var f=e.stateNode;try{fn(f,"")}catch(Se){st(e,e.return,Se)}}if(l&4&&(f=e.stateNode,f!=null)){var p=e.memoizedProps,w=o!==null?o.memoizedProps:p,T=e.type,D=e.updateQueue;if(e.updateQueue=null,D!==null)try{T==="input"&&p.type==="radio"&&p.name!=null&&Ae(f,p),fr(T,w);var ee=fr(T,p);for(w=0;w<D.length;w+=2){var ce=D[w],ue=D[w+1];ce==="style"?Gr(f,ue):ce==="dangerouslySetInnerHTML"?Yr(f,ue):ce==="children"?fn(f,ue):k(f,ce,ue,ee)}switch(T){case"input":et(f,p);break;case"textarea":ur(f,p);break;case"select":var ae=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!p.multiple;var ge=p.value;ge!=null?St(f,!!p.multiple,ge,!1):ae!==!!p.multiple&&(p.defaultValue!=null?St(f,!!p.multiple,p.defaultValue,!0):St(f,!!p.multiple,p.multiple?[]:"",!1))}f[$o]=p}catch(Se){st(e,e.return,Se)}}break;case 6:if(kn(n,e),Vn(e),l&4){if(e.stateNode===null)throw Error(i(162));f=e.stateNode,p=e.memoizedProps;try{f.nodeValue=p}catch(Se){st(e,e.return,Se)}}break;case 3:if(kn(n,e),Vn(e),l&4&&o!==null&&o.memoizedState.isDehydrated)try{ot(n.containerInfo)}catch(Se){st(e,e.return,Se)}break;case 4:kn(n,e),Vn(e);break;case 13:kn(n,e),Vn(e),f=e.child,f.flags&8192&&(p=f.memoizedState!==null,f.stateNode.isHidden=p,!p||f.alternate!==null&&f.alternate.memoizedState!==null||(Nc=Ge())),l&4&&Rf(e);break;case 22:if(ce=o!==null&&o.memoizedState!==null,e.mode&1?(Mt=(ee=Mt)||ce,kn(n,e),Mt=ee):kn(n,e),Vn(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,ge=ae.child,ae.tag){case 0:case 11:case 14:case 15:Ko(4,ae,ae.return);break;case 1:qi(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){st(l,o,Se)}}break;case 5:qi(ae,ae.return);break;case 22:if(ae.memoizedState!==null){Df(ue);continue}}ge!==null?(ge.return=ae,ve=ge):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"):(T=ue.stateNode,D=ue.memoizedProps.style,w=D!=null&&D.hasOwnProperty("display")?D.display:null,T.style.display=Xr("display",w))}catch(Se){st(e,e.return,Se)}}}else if(ue.tag===6){if(ce===null)try{ue.stateNode.nodeValue=ee?"":ue.memoizedProps}catch(Se){st(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:kn(n,e),Vn(e),l&4&&Rf(e);break;case 21:break;default:kn(n,e),Vn(e)}}function Vn(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&&(fn(f,""),l.flags&=-33);var p=If(e);wc(e,p,f);break;case 3:case 4:var w=l.stateNode.containerInfo,T=If(e);xc(e,T,w);break;default:throw Error(i(161))}}catch(D){st(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||ll;if(!w){var T=f.alternate,D=T!==null&&T.memoizedState!==null||Mt;T=ll;var ee=Mt;if(ll=w,(Mt=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,ll=T,Mt=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:Mt||al(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!Mt)if(o===null)l.componentDidMount();else{var f=n.elementType===n.type?o.memoizedProps:wn(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 T=n.stateNode;if(o===null&&n.flags&4){o=T;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&&ot(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}Mt||n.flags&512&&vc(n)}catch(ae){st(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{al(4,n)}catch(D){st(n,o,D)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var f=n.return;try{l.componentDidMount()}catch(D){st(n,f,D)}}var p=n.return;try{vc(n)}catch(D){st(n,p,D)}break;case 5:var w=n.return;try{vc(n)}catch(D){st(n,w,D)}}}catch(D){st(n,n.return,D)}if(n===e){ve=null;break}var T=n.sibling;if(T!==null){T.return=n.return,ve=T;break}ve=n.return}}var By=Math.ceil,cl=j.ReactCurrentDispatcher,Sc=j.ReactCurrentOwner,un=j.ReactCurrentBatchConfig,He=0,pt=null,ct=null,xt=0,Zt=0,Zi=br(0),ft=0,Qo=null,ui=0,ul=0,kc=0,qo=null,Ot=null,Nc=0,Ji=1/0,or=null,dl=!1,Ec=null,zr=null,fl=!1,Ar=null,hl=0,Zo=0,Cc=null,pl=-1,ml=0;function Rt(){return(He&6)!==0?Ge():pl!==-1?pl:pl=Ge()}function Lr(e){return(e.mode&1)===0?1:(He&2)!==0&&xt!==0?xt&-xt:Cy.transition!==null?(ml===0&&(ml=An()),ml):(e=Be,e!==0||(e=window.event,e=e===void 0?16:Fu(e.type)),e)}function Nn(e,n,o,l){if(50<Zo)throw Zo=0,Cc=null,Error(i(185));Ln(e,o,l),((He&2)===0||e!==pt)&&(e===pt&&((He&2)===0&&(ul|=o),ft===4&&Dr(e,xt)),Ht(e,l),o===1&&He===0&&(n.mode&1)===0&&(Ji=Ge()+500,Vs&&Pr()))}function Ht(e,n){var o=e.callbackNode;ko(e,n);var l=Nr(e,e===pt?xt:0);if(l===0)o!==null&&Tn(o),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(o!=null&&Tn(o),n===1)e.tag===0?Ey(Of.bind(null,e)):Ed(Of.bind(null,e)),wy(function(){(He&6)===0&&Pr()}),o=null;else{switch(Eo(l)){case 1:o=wr;break;case 4:o=Pi;break;case 16:o=Sr;break;case 536870912:o=Ii;break;default:o=Sr}o=Gf(o,Ff.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function Ff(e,n){if(pl=-1,ml=0,(He&6)!==0)throw Error(i(327));var o=e.callbackNode;if(eo()&&e.callbackNode!==o)return null;var l=Nr(e,e===pt?xt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=gl(e,l);else{n=l;var f=He;He|=2;var p=Bf();(pt!==e||xt!==n)&&(or=null,Ji=Ge()+500,fi(e,n));do try{Uy();break}catch(T){Hf(e,T)}while(!0);Va(),cl.current=p,He=f,ct!==null?n=0:(pt=null,xt=0,n=ft)}if(n!==0){if(n===2&&(f=ei(e),f!==0&&(l=f,n=_c(e,f))),n===1)throw o=Qo,fi(e,0),Dr(e,l),Ht(e,Ge()),o;if(n===6)Dr(e,l);else{if(f=e.current.alternate,(l&30)===0&&!Vy(f)&&(n=gl(e,l),n===2&&(p=ei(e),p!==0&&(l=p,n=_c(e,p))),n===1))throw o=Qo,fi(e,0),Dr(e,l),Ht(e,Ge()),o;switch(e.finishedWork=f,e.finishedLanes=l,n){case 0:case 1:throw Error(i(345));case 2:hi(e,Ot,or);break;case 3:if(Dr(e,l),(l&130023424)===l&&(n=Nc+500-Ge(),10<n)){if(Nr(e,0)!==0)break;if(f=e.suspendedLanes,(f&l)!==l){Rt(),e.pingedLanes|=e.suspendedLanes&f;break}e.timeoutHandle=Ta(hi.bind(null,e,Ot,or),n);break}hi(e,Ot,or);break;case 4:if(Dr(e,l),(l&4194240)===l)break;for(n=e.eventTimes,f=-1;0<l;){var w=31-Ct(l);p=1<<w,w=n[w],w>f&&(f=w),l&=~p}if(l=f,l=Ge()-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=Ta(hi.bind(null,e,Ot,or),l);break}hi(e,Ot,or);break;case 5:hi(e,Ot,or);break;default:throw Error(i(329))}}}return Ht(e,Ge()),e.callbackNode===o?Ff.bind(null,e):null}function _c(e,n){var o=qo;return e.current.memoizedState.isDehydrated&&(fi(e,n).flags|=256),e=gl(e,n),e!==2&&(n=Ot,Ot=o,n!==null&&jc(n)),e}function jc(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(!vn(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 Dr(e,n){for(n&=~kc,n&=~ul,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-Ct(n),l=1<<o;e[o]=-1,n&=~l}}function Of(e){if((He&6)!==0)throw Error(i(327));eo();var n=Nr(e,0);if((n&1)===0)return Ht(e,Ge()),null;var o=gl(e,n);if(e.tag!==0&&o===2){var l=ei(e);l!==0&&(n=l,o=_c(e,l))}if(o===1)throw o=Qo,fi(e,0),Dr(e,n),Ht(e,Ge()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,hi(e,Ot,or),Ht(e,Ge()),null}function bc(e,n){var o=He;He|=1;try{return e(n)}finally{He=o,He===0&&(Ji=Ge()+500,Vs&&Pr())}}function di(e){Ar!==null&&Ar.tag===0&&(He&6)===0&&eo();var n=He;He|=1;var o=un.transition,l=Be;try{if(un.transition=null,Be=1,e)return e()}finally{Be=l,un.transition=o,He=n,(He&6)===0&&Pr()}}function Mc(){Zt=Zi.current,Qe(Zi)}function fi(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,xy(o)),ct!==null)for(o=ct.return;o!==null;){var l=o;switch($a(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Hs();break;case 3:Ki(),Qe(Dt),Qe(_t),qa();break;case 5:Ka(l);break;case 4:Ki();break;case 13:Qe(rt);break;case 19:Qe(rt);break;case 10:Wa(l.type._context);break;case 22:case 23:Mc()}o=o.return}if(pt=e,ct=e=$r(e.current,null),xt=Zt=n,ft=0,Qo=null,kc=ul=ui=0,Ot=qo=null,li!==null){for(n=0;n<li.length;n++)if(o=li[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}li=null}return e}function Hf(e,n){do{var o=ct;try{if(Va(),Js.current=rl,el){for(var l=it.memoizedState;l!==null;){var f=l.queue;f!==null&&(f.pending=null),l=l.next}el=!1}if(ci=0,ht=dt=it=null,Wo=!1,Uo=0,Sc.current=null,o===null||o.return===null){ft=1,Qo=n,ct=null;break}e:{var p=e,w=o.return,T=o,D=n;if(n=xt,T.flags|=32768,D!==null&&typeof D=="object"&&typeof D.then=="function"){var ee=D,ce=T,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 ge=ff(w);if(ge!==null){ge.flags&=-257,hf(ge,w,T,p,n),ge.mode&1&&df(p,ee,n),n=ge,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),Pc();break e}D=Error(i(426))}}else if(qe&&T.mode&1){var at=ff(w);if(at!==null){(at.flags&65536)===0&&(at.flags|=256),hf(at,w,T,p,n),Ha(Qi(D,T));break e}}p=D=Qi(D,T),ft!==4&&(ft=2),qo===null?qo=[p]:qo.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:T=D;var O=p.type,q=p.stateNode;if((p.flags&128)===0&&(typeof O.getDerivedStateFromError=="function"||q!==null&&typeof q.componentDidCatch=="function"&&(zr===null||!zr.has(q)))){p.flags|=65536,n&=-n,p.lanes|=n;var fe=uf(p,T,n);Ad(p,fe);break e}}p=p.return}while(p!==null)}Wf(o)}catch(Ee){n=Ee,ct===o&&o!==null&&(ct=o=o.return);continue}break}while(!0)}function Bf(){var e=cl.current;return cl.current=rl,e===null?rl:e}function Pc(){(ft===0||ft===3||ft===2)&&(ft=4),pt===null||(ui&268435455)===0&&(ul&268435455)===0||Dr(pt,xt)}function gl(e,n){var o=He;He|=2;var l=Bf();(pt!==e||xt!==n)&&(or=null,fi(e,n));do try{Wy();break}catch(f){Hf(e,f)}while(!0);if(Va(),He=o,cl.current=l,ct!==null)throw Error(i(261));return pt=null,xt=0,ft}function Wy(){for(;ct!==null;)Vf(ct)}function Uy(){for(;ct!==null&&!vo();)Vf(ct)}function Vf(e){var n=Xf(e.alternate,e,Zt);e.memoizedProps=e.pendingProps,n===null?Wf(e):ct=n,Sc.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,Zt),o!==null){ct=o;return}}else{if(o=$y(o,n),o!==null){o.flags&=32767,ct=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ft=6,ct=null;return}}if(n=n.sibling,n!==null){ct=n;return}ct=n=e}while(n!==null);ft===0&&(ft=5)}function hi(e,n,o){var l=Be,f=un.transition;try{un.transition=null,Be=1,Yy(e,n,o,l)}finally{un.transition=f,Be=l}return null}function Yy(e,n,o,l){do eo();while(Ar!==null);if((He&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(ni(e,p),e===pt&&(ct=pt=null,xt=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||fl||(fl=!0,Gf(Sr,function(){return eo(),null})),p=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||p){p=un.transition,un.transition=null;var w=Be;Be=1;var T=He;He|=4,Sc.current=null,Oy(e,o),zf(o,e),fy(Pa),nt=!!Ma,Pa=Ma=null,e.current=o,Hy(o),bi(),He=T,Be=w,un.transition=p}else e.current=o;if(fl&&(fl=!1,Ar=e,hl=f),p=e.pendingLanes,p===0&&(zr=null),kr(o.stateNode),Ht(e,Ge()),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(dl)throw dl=!1,e=Ec,Ec=null,e;return(hl&1)!==0&&e.tag!==0&&eo(),p=e.pendingLanes,(p&1)!==0?e===Cc?Zo++:(Zo=0,Cc=e):Zo=0,Pr(),null}function eo(){if(Ar!==null){var e=Eo(hl),n=un.transition,o=Be;try{if(un.transition=null,Be=16>e?16:e,Ar===null)var l=!1;else{if(e=Ar,Ar=null,hl=0,(He&6)!==0)throw Error(i(331));var f=He;for(He|=4,ve=e.current;ve!==null;){var p=ve,w=p.child;if((ve.flags&16)!==0){var T=p.deletions;if(T!==null){for(var D=0;D<T.length;D++){var ee=T[D];for(ve=ee;ve!==null;){var ce=ve;switch(ce.tag){case 0:case 11:case 15:Ko(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,ge=ce.return;if(Mf(ce),ce===ee){ve=null;break}if(ae!==null){ae.return=ge,ve=ae;break}ve=ge}}}var xe=p.alternate;if(xe!==null){var Se=xe.child;if(Se!==null){xe.child=null;do{var at=Se.sibling;Se.sibling=null,Se=at}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:Ko(9,p,p.return)}var X=p.sibling;if(X!==null){X.return=p.return,ve=X;break e}ve=p.return}}var O=e.current;for(ve=O;ve!==null;){w=ve;var q=w.child;if((w.subtreeFlags&2064)!==0&&q!==null)q.return=w,ve=q;else e:for(w=O;ve!==null;){if(T=ve,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:al(9,T)}}catch(Ee){st(T,T.return,Ee)}if(T===w){ve=null;break e}var fe=T.sibling;if(fe!==null){fe.return=T.return,ve=fe;break e}ve=T.return}}if(He=f,Pr(),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Rn,e)}catch{}l=!0}return l}finally{Be=o,un.transition=n}}return!1}function Uf(e,n,o){n=Qi(o,n),n=cf(e,n,1),e=Tr(e,n,1),n=Rt(),e!==null&&(Ln(e,1,n),Ht(e,n))}function st(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"&&(zr===null||!zr.has(l))){e=Qi(o,e),e=uf(n,e,1),n=Tr(n,e,1),e=Rt(),n!==null&&(Ln(n,1,e),Ht(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,pt===e&&(xt&o)===o&&(ft===4||ft===3&&(xt&130023424)===xt&&500>Ge()-Nc?fi(e,0):kc|=o),Ht(e,n)}function Yf(e,n){n===0&&((e.mode&1)===0?n=1:(n=Ye,Ye<<=1,(Ye&130023424)===0&&(Ye=4194304)));var o=Rt();e=nr(e,n),e!==null&&(Ln(e,n,o),Ht(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||Dt.current)Ft=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Ft=!1,Ly(e,n,o);Ft=(e.flags&131072)!==0}else Ft=!1,qe&&(n.flags&1048576)!==0&&Cd(n,Us,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;sl(e,n),e=n.pendingProps;var f=Bi(n,_t.current);Gi(n,o),f=ec(null,n,l,e,f,o);var p=tc();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,$t(l)?(p=!0,Bs(n)):p=!1,n.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Xa(n),f.updater=il,n.stateNode=f,f._reactInternals=n,lc(n,l,e,o),n=dc(null,n,l,!0,p,o)):(n.tag=0,qe&&p&&Da(n),Tt(null,n,f,o),n=n.child),n;case 16:l=n.elementType;e:{switch(sl(e,n),e=n.pendingProps,f=l._init,l=f(l._payload),n.type=l,f=n.tag=qy(l),e=wn(l,e),f){case 0:n=uc(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,wn(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:wn(l,f),uc(e,n,l,f,o);case 1:return l=n.type,f=n.pendingProps,f=n.elementType===l?f:wn(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=Qi(Error(i(423)),n),n=Sf(e,n,l,o,f);break e}else if(l!==f){f=Qi(Error(i(424)),n),n=Sf(e,n,l,o,f);break e}else for(qt=jr(n.stateNode.containerInfo.firstChild),Qt=n,qe=!0,xn=null,o=Td(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Ui(),l===f){n=ir(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,Ia(l,f)?w=null:p!==null&&Ia(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 Ga(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=Yi(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:wn(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,Xe(Gs,l._currentValue),l._currentValue=w,p!==null)if(vn(p.value,w)){if(p.children===f.children&&!Dt.current){n=ir(e,n,o);break e}}else for(p=n.child,p!==null&&(p.return=n);p!==null;){var T=p.dependencies;if(T!==null){w=p.child;for(var D=T.firstContext;D!==null;){if(D.context===l){if(p.tag===1){D=rr(-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),Ua(p.return,o,n),T.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,T=w.alternate,T!==null&&(T.lanes|=o),Ua(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,Gi(n,o),f=an(f),l=l(f),n.flags|=1,Tt(e,n,l,o),n.child;case 14:return l=n.type,f=wn(l,n.pendingProps),f=wn(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:wn(l,f),sl(e,n),n.tag=1,$t(l)?(e=!0,Bs(n)):e=!1,Gi(n,o),lf(n,l,f),lc(n,l,f,o),dc(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 Gt(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 dn(e,n,o,l){return new Qy(e,n,o,l)}function Ic(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qy(e){if(typeof e=="function")return Ic(e)?1:0;if(e!=null){if(e=e.$$typeof,e===G)return 11;if(e===Q)return 14}return 2}function $r(e,n){var o=e.alternate;return o===null?(o=dn(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 yl(e,n,o,l,f,p){var w=2;if(l=e,typeof e=="function")Ic(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case B:return pi(o.children,f,p,n);case Z:w=8,f|=8;break;case V:return e=dn(12,o,n,f|2),e.elementType=V,e.lanes=p,e;case te:return e=dn(13,o,n,f),e.elementType=te,e.lanes=p,e;case z:return e=dn(19,o,n,f),e.elementType=z,e.lanes=p,e;case K:return vl(o,f,p,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:w=10;break e;case U:w=9;break e;case G:w=11;break e;case Q:w=14;break e;case W:w=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=dn(w,o,n,f),n.elementType=e,n.type=l,n.lanes=p,n}function pi(e,n,o,l){return e=dn(7,e,l,n),e.lanes=o,e}function vl(e,n,o,l){return e=dn(22,e,l,n),e.elementType=K,e.lanes=o,e.stateNode={isHidden:!1},e}function Tc(e,n,o){return e=dn(6,e,null,n),e.lanes=o,e}function Rc(e,n,o){return n=dn(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=ti(0),this.expirationTimes=ti(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ti(0),this.identifierPrefix=l,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function zc(e,n,o,l,f,p,w,T,D){return e=new Zy(e,n,o,T,D),n===1?(n=1,p===!0&&(n|=8)):n=0,p=dn(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xa(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 Mr;e=e._reactInternals;e:{if(Nt(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($t(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($t(o))return kd(e,o,n)}return n}function Qf(e,n,o,l,f,p,w,T,D){return e=zc(o,l,!0,e,f,p,w,T,D),e.context=Kf(null),o=e.current,l=Rt(),f=Lr(o),p=rr(l,f),p.callback=n??null,Tr(o,p,f),e.current.lanes=f,Ln(e,f,l),Ht(e,l),e}function xl(e,n,o,l){var f=n.current,p=Rt(),w=Lr(f);return o=Kf(o),n.context===null?n.context=o:n.pendingContext=o,n=rr(p,w),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=Tr(f,n,w),e!==null&&(Nn(e,f,w,p),Qs(e,f,w)),w}function wl(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 Ac(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 Lc(e){this._internalRoot=e}Sl.prototype.render=Lc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));xl(e,n,null,null)},Sl.prototype.unmount=Lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;di(function(){xl(null,e,null,null)}),n[Zn]=null}};function Sl(e){this._internalRoot=e}Sl.prototype.unstable_scheduleHydration=function(e){if(e){var n=_s();e={blockedOn:null,target:e,priority:n};for(var o=0;o<H.length&&n!==0&&n<H[o].priority;o++);H.splice(o,0,e),o===0&&_e(e)}};function Dc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kl(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=wl(w);p.call(ee)}}var w=Qf(n,l,e,0,null,!1,!1,"",Jf);return e._reactRootContainer=w,e[Zn]=w.current,Lo(e.nodeType===8?e.parentNode:e),di(),w}for(;f=e.lastChild;)e.removeChild(f);if(typeof l=="function"){var T=l;l=function(){var ee=wl(D);T.call(ee)}}var D=zc(e,0,!1,null,null,!1,!1,"",Jf);return e._reactRootContainer=D,e[Zn]=D.current,Lo(e.nodeType===8?e.parentNode:e),di(function(){xl(n,D,o,l)}),D}function Nl(e,n,o,l,f){var p=o._reactRootContainer;if(p){var w=p;if(typeof f=="function"){var T=f;f=function(){var D=wl(w);T.call(D)}}xl(n,w,e,f)}else w=t0(o,n,e,f,l);return wl(w)}Co=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=Lt(n.pendingLanes);o!==0&&(No(n,o|1),Ht(n,Ge()),(He&6)===0&&(Ji=Ge()+500,Pr()))}break;case 13:di(function(){var l=nr(e,1);if(l!==null){var f=Rt();Nn(l,e,1,f)}}),Ac(e,1)}},qn=function(e){if(e.tag===13){var n=nr(e,134217728);if(n!==null){var o=Rt();Nn(n,e,134217728,o)}Ac(e,134217728)}},Cs=function(e){if(e.tag===13){var n=Lr(e),o=nr(e,n);if(o!==null){var l=Rt();Nn(o,e,n,l)}Ac(e,n)}},_s=function(){return Be},js=function(e,n){var o=Be;try{return Be=e,n()}finally{Be=o}},Kr=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));ke(l),et(l,f)}}}break;case"textarea":ur(e,o);break;case"select":n=o.value,n!=null&&St(e,!!o.multiple,n,!1)}},mr=bc,_i=di;var n0={usingClientEntryPoint:!1,Events:[Fo,Oi,Os,Qr,pn,bc]},Jo={findFiberByHostInstance:ri,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},r0={bundleType:Jo.bundleType,version:Jo.version,rendererPackageName:Jo.rendererPackageName,rendererConfig:Jo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:j.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Zr(e),e===null?null:e.stateNode},findFiberByHostInstance:Jo.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 El=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!El.isDisabled&&El.supportsFiber)try{Rn=El.inject(r0),Et=El}catch{}}return Bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=n0,Bt.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dc(n))throw Error(i(200));return Jy(e,n,null,o)},Bt.createRoot=function(e,n){if(!Dc(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=zc(e,1,!1,null,null,o,!1,l,f),e[Zn]=n.current,Lo(e.nodeType===8?e.parentNode:e),new Lc(n)},Bt.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=Zr(n),e=e===null?null:e.stateNode,e},Bt.flushSync=function(e){return di(e)},Bt.hydrate=function(e,n,o){if(!kl(n))throw Error(i(200));return Nl(null,e,n,!0,o)},Bt.hydrateRoot=function(e,n,o){if(!Dc(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[Zn]=n.current,Lo(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 Sl(n)},Bt.render=function(e,n,o){if(!kl(n))throw Error(i(200));return Nl(null,e,n,!1,o)},Bt.unmountComponentAtNode=function(e){if(!kl(e))throw Error(i(40));return e._reactRootContainer?(di(function(){Nl(null,null,e,!1,function(){e._reactRootContainer=null,e[Zn]=null})}),!0):!1},Bt.unstable_batchedUpdates=bc,Bt.unstable_renderSubtreeIntoContainer=function(e,n,o,l){if(!kl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Nl(e,n,o,!1,l)},Bt.version="18.3.1-next-f1338f8080-20240426",Bt}var lh;function jp(){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 Cl;ah=1;var t=jp();return Cl.createRoot=t.createRoot,Cl.hydrateRoot=t.hydrateRoot,Cl}var f0=d0();const h0=vu(f0);function ut(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=ut(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var p0={value:()=>{}};function Zl(){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 Al(i)}function Al(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}})}Al.prototype=Zl.prototype={constructor:Al,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 Al(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 Jl(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 bp(t){var r=Jl(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 tn(s,this._parents)}function S0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function k0(){return[]}function Mp(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=Mp(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 tn(s,a)}function Pp(t){return function(){return this.matches(t)}}function Ip(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:Ip(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:Ip(t)))}function R0(t){typeof t!="function"&&(t=Pp(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 tn(s,this._parents)}function Tp(t){return new Array(t.length)}function z0(){return new tn(this._enter||this._groups.map(Tp),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 F0(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=O0(t.call(v,v&&v.__data__,g,s)),N=C.length,S=h[g]=new Array(N),_=u[g]=new Array(N),E=m[g]=new Array(x);i(v,y,S,_,E,C,r);for(var P=0,k=0,j,F;P<N;++P)if(j=S[P]){for(P>=k&&(k=P+1);!(F=_[k])&&++k<N;);j._next=F||null}}return u=new tn(u,s),u._enter=h,u._exit=m,u}function O0(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function H0(){return new tn(this._exit||this._groups.map(Tp),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,N=0;N<y;++N)(C=g[N]||v[N])&&(x[N]=C);for(;m<a;++m)h[m]=i[m];return new tn(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 tn(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=Jl(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 Rp(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??"")):uo(this.node(),t)}function uo(t,r){return t.style.getPropertyValue(r)||Rp(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 zp(t){return t.trim().split(/^|\s+/)}function wu(t){return t.classList||new Ap(t)}function Ap(t){this._node=t,this._names=zp(t.getAttribute("class")||"")}Ap.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 Lp(t,r){for(var i=wu(t),s=-1,a=r.length;++s<a;)i.add(r[s])}function Dp(t,r){for(var i=wu(t),s=-1,a=r.length;++s<a;)i.remove(r[s])}function pv(t){return function(){Lp(this,t)}}function mv(t){return function(){Dp(this,t)}}function gv(t,r){return function(){(r.apply(this,arguments)?Lp:Dp)(this,t)}}function yv(t,r){var i=zp(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:bp(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:bp(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 Fv(t){return function(r){t.call(this,r,this.__data__)}}function Ov(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=Fv(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=Ov(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 $p(t,r,i){var s=Rp(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 $p(this,t,r)}}function Uv(t,r){return function(){return $p(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 tn(t,r){this._groups=t,this._parents=r}function vs(){return new tn([[document.documentElement]],Fp)}function Gv(){return this}tn.prototype=vs.prototype={constructor:tn,select:w0,selectAll:E0,selectChild:b0,selectChildren:T0,filter:R0,data:F0,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 en(t){return typeof t=="string"?new tn([[document.querySelector(t)]],[document.documentElement]):new tn([[t]],Fp)}function Kv(t){let r;for(;r=t.sourceEvent;)t=r;return t}function En(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},ls={capture:!0,passive:!1};function Vc(t){t.stopImmediatePropagation()}function ao(t){t.preventDefault(),t.stopImmediatePropagation()}function Op(t){var r=t.document.documentElement,i=en(t).on("dragstart.drag",ao,ls);"onselectstart"in r?i.on("selectstart.drag",ao,ls):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Hp(t,r){var i=t.document.documentElement,s=en(t).on("dragstart.drag",null);r&&(s.on("click.drag",ao,ls),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 _l=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 Bp(){var t=qv,r=Zv,i=Jv,s=ex,a={},c=Zl("start","drag","end"),u=0,h,m,g,v,y=0;function x(j){j.on("mousedown.drag",C).filter(s).on("touchstart.drag",_).on("touchmove.drag",E,Qv).on("touchend.drag touchcancel.drag",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(j,F){if(!(v||!t.call(this,j,F))){var L=k(this,r.call(this,j,F),j,F,"mouse");L&&(en(j.view).on("mousemove.drag",N,ls).on("mouseup.drag",S,ls),Op(j.view),Vc(j),g=!1,h=j.clientX,m=j.clientY,L("start",j))}}function N(j){if(ao(j),!g){var F=j.clientX-h,L=j.clientY-m;g=F*F+L*L>y}a.mouse("drag",j)}function S(j){en(j.view).on("mousemove.drag mouseup.drag",null),Hp(j.view,g),ao(j),a.mouse("end",j)}function _(j,F){if(t.call(this,j,F)){var L=j.changedTouches,B=r.call(this,j,F),Z=L.length,V,J;for(V=0;V<Z;++V)(J=k(this,B,j,F,L[V].identifier,L[V]))&&(Vc(j),J("start",j,L[V]))}}function E(j){var F=j.changedTouches,L=F.length,B,Z;for(B=0;B<L;++B)(Z=a[F[B].identifier])&&(ao(j),Z("drag",j,F[B]))}function P(j){var F=j.changedTouches,L=F.length,B,Z;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),B=0;B<L;++B)(Z=a[F[B].identifier])&&(Vc(j),Z("end",j,F[B]))}function k(j,F,L,B,Z,V){var J=c.copy(),U=En(V||L,F),G,te,z;if((z=i.call(j,new iu("beforestart",{sourceEvent:L,target:x,identifier:Z,active:u,x:U[0],y:U[1],dx:0,dy:0,dispatch:J}),B))!=null)return G=z.x-U[0]||0,te=z.y-U[1]||0,function Q(W,K,M){var A=U,Y;switch(W){case"start":a[Z]=Q,Y=u++;break;case"end":delete a[Z],--u;case"drag":U=En(M||K,F),Y=u;break}J.call(W,j,new iu(W,{sourceEvent:K,subject:z,target:x,identifier:Z,active:Y,x:U[0]+G,y:U[1]+te,dx:U[0]-A[0],dy:U[1]-A[1],dispatch:J}),B)}}return x.filter=function(j){return arguments.length?(t=typeof j=="function"?j:_l(!!j),x):t},x.container=function(j){return arguments.length?(r=typeof j=="function"?j:_l(j),x):r},x.subject=function(j){return arguments.length?(i=typeof j=="function"?j:_l(j),x):i},x.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:_l(!!j),x):s},x.on=function(){var j=c.on.apply(c,arguments);return j===c?x:j},x.clickDistance=function(j){return arguments.length?(y=(j=+j)*j,x):Math.sqrt(y)},x}function Su(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Vp(t,r){var i=Object.create(t.prototype);for(var s in r)i[s]=r[s];return i}function xs(){}var as=.7,Hl=1/as,co="\\s*([+-]?\\d+)\\s*",cs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tx=/^#([0-9a-f]{3,8})$/,nx=new RegExp(`^rgb\\(${co},${co},${co}\\)$`),rx=new RegExp(`^rgb\\(${Un},${Un},${Un}\\)$`),ix=new RegExp(`^rgba\\(${co},${co},${co},${cs}\\)$`),ox=new RegExp(`^rgba\\(${Un},${Un},${Un},${cs}\\)$`),sx=new RegExp(`^hsl\\(${cs},${Un},${Un}\\)$`),lx=new RegExp(`^hsla\\(${cs},${Un},${Un},${cs}\\)$`),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(xs,wi,{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 Wp(this).formatHsl()}function hh(){return this.rgb().formatRgb()}function wi(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 Vt(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?jl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?jl(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 Vt(r[1],r[2],r[3],1):(r=rx.exec(t))?new Vt(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=ix.exec(t))?jl(r[1],r[2],r[3],r[4]):(r=ox.exec(t))?jl(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 Vt(NaN,NaN,NaN,0):null}function ph(t){return new Vt(t>>16&255,t>>8&255,t&255,1)}function jl(t,r,i,s){return s<=0&&(t=r=i=NaN),new Vt(t,r,i,s)}function ux(t){return t instanceof xs||(t=wi(t)),t?(t=t.rgb(),new Vt(t.r,t.g,t.b,t.opacity)):new Vt}function ou(t,r,i,s){return arguments.length===1?ux(t):new Vt(t,r,i,s??1)}function Vt(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}Su(Vt,ou,Vp(xs,{brighter(t){return t=t==null?Hl:Math.pow(Hl,t),new Vt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?as:Math.pow(as,t),new Vt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Vt(yi(this.r),yi(this.g),yi(this.b),Bl(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`#${gi(this.r)}${gi(this.g)}${gi(this.b)}`}function dx(){return`#${gi(this.r)}${gi(this.g)}${gi(this.b)}${gi((isNaN(this.opacity)?1:this.opacity)*255)}`}function gh(){const t=Bl(this.opacity);return`${t===1?"rgb(":"rgba("}${yi(this.r)}, ${yi(this.g)}, ${yi(this.b)}${t===1?")":`, ${t})`}`}function Bl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function yi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function gi(t){return t=yi(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 Cn(t,r,i,s)}function Wp(t){if(t instanceof Cn)return new Cn(t.h,t.s,t.l,t.opacity);if(t instanceof xs||(t=wi(t)),!t)return new Cn;if(t instanceof Cn)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 Cn(u,h,m,t.opacity)}function fx(t,r,i,s){return arguments.length===1?Wp(t):new Cn(t,r,i,s??1)}function Cn(t,r,i,s){this.h=+t,this.s=+r,this.l=+i,this.opacity=+s}Su(Cn,fx,Vp(xs,{brighter(t){return t=t==null?Hl:Math.pow(Hl,t),new Cn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?as:Math.pow(as,t),new Cn(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 Vt(Wc(t>=240?t-240:t+120,a,s),Wc(t,a,s),Wc(t<120?t+240:t-120,a,s),this.opacity)},clamp(){return new Cn(vh(this.h),bl(this.s),bl(this.l),Bl(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=Bl(this.opacity);return`${t===1?"hsl(":"hsla("}${vh(this.h)}, ${bl(this.s)*100}%, ${bl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function vh(t){return t=(t||0)%360,t<0?t+360:t}function bl(t){return Math.max(0,Math.min(1,t||0))}function Wc(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?Up:function(r,i){return i-r?px(r,i,t):ku(isNaN(r)?i:r)}}function Up(t,r){var i=r-t;return i?hx(t,i):ku(isNaN(t)?r:t)}const Vl=(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=Up(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]=os(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 Wn(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]=os(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,Uc=new RegExp(su.source,"g");function Sx(t){return function(){return t}}function kx(t){return function(r){return t(r)+""}}function Yp(t,r){var i=su.lastIndex=Uc.lastIndex=0,s,a,c,u=-1,h=[],m=[];for(t=t+"",r=r+"";(s=su.exec(t))&&(a=Uc.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:Wn(s,a)})),i=Uc.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 os(t,r){var i=typeof r,s;return r==null||i==="boolean"?ku(r):(i==="number"?Wn:i==="string"?(s=wi(r))?(r=s,Vl):Yp:r instanceof wi?Vl:r instanceof Date?xx:yx(r)?gx:Array.isArray(r)?vx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?wx:Wn)(t,r)}var xh=180/Math.PI,lu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xp(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 Ml;function Nx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?lu:Xp(r.a,r.b,r.c,r.d,r.e,r.f)}function Ex(t){return t==null||(Ml||(Ml=document.createElementNS("http://www.w3.org/2000/svg","g")),Ml.setAttribute("transform",t),!(t=Ml.transform.baseVal.consolidate()))?lu:(t=t.matrix,Xp(t.a,t.b,t.c,t.d,t.e,t.f))}function Gp(t,r,i,s){function a(g){return g.length?g.pop()+" ":""}function c(g,v,y,x,C,N){if(g!==y||v!==x){var S=C.push("translate(",null,r,null,i);N.push({i:S-4,x:Wn(g,y)},{i:S-2,x:Wn(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:Wn(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:Wn(g,v)}):v&&y.push(a(y)+"skewX("+v+s)}function m(g,v,y,x,C,N){if(g!==y||v!==x){var S=C.push(a(C)+"scale(",null,",",null,")");N.push({i:S-4,x:Wn(g,y)},{i:S-2,x:Wn(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 N=-1,S=x.length,_;++N<S;)y[(_=x[N]).i]=_.x(C);return y.join("")}}}var Cx=Gp(Nx,"px, ","px)","deg)"),_x=Gp(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 Ll=(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,N=y-m,S=C*C+N*N,_,E;if(S<jx)E=Math.log(x/g)/r,_=function(B){return[h+B*C,m+B*N,g*Math.exp(r*B*E)]};else{var P=Math.sqrt(S),k=(x*x-g*g+s*S)/(2*g*i*P),j=(x*x-g*g-s*S)/(2*x*i*P),F=Math.log(Math.sqrt(k*k+1)-k),L=Math.log(Math.sqrt(j*j+1)-j);E=(L-F)/r,_=function(B){var Z=B*E,V=wh(F),J=g/(i*P)*(V*Mx(r*Z+F)-bx(F));return[h+J*C,m+J*N,g*V/wh(r*Z+F)]}}return _.duration=E*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 fo=0,rs=0,ts=0,Kp=1e3,Wl,is,Ul=0,Si=0,ea=0,us=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 Si||(Qp(Px),Si=us.now()+ea)}function Px(){Si=0}function Yl(){this._call=this._time=this._next=null}Yl.prototype=qp.prototype={constructor:Yl,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&&is!==this&&(is?is._next=this:Wl=this,is=this),this._call=t,this._time=i,au()},stop:function(){this._call&&(this._call=null,this._time=1/0,au())}};function qp(t,r,i){var s=new Yl;return s.restart(t,r,i),s}function Ix(){Nu(),++fo;for(var t=Wl,r;t;)(r=Si-t._time)>=0&&t._call.call(void 0,r),t=t._next;--fo}function Sh(){Si=(Ul=us.now())+ea,fo=rs=0;try{Ix()}finally{fo=0,Rx(),Si=0}}function Tx(){var t=us.now(),r=t-Ul;r>Kp&&(ea-=r,Ul=t)}function Rx(){for(var t,r=Wl,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:Wl=i);is=t,au(s)}function au(t){if(!fo){rs&&(rs=clearTimeout(rs));var r=t-Si;r>24?(t<1/0&&(rs=setTimeout(Sh,t-us.now()-ea)),ts&&(ts=clearInterval(ts))):(ts||(Ul=us.now(),ts=setInterval(Tx,Kp)),fo=1,Qp(Sh))}}function kh(t,r,i){var s=new Yl;return r=r==null?0:+r,s.restart(a=>{s.stop(),t(a+r)},r,i),s}var zx=Zl("start","end","cancel","interrupt"),Ax=[],Zp=0,Nh=1,cu=2,Dl=3,Eh=4,uu=5,$l=6;function ta(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:Zp})}function Eu(t,r){var i=bn(t,r);if(i.state>Zp)throw new Error("too late; already scheduled");return i}function Gn(t,r){var i=bn(t,r);if(i.state>Dl)throw new Error("too late; already running");return i}function bn(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=qp(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===Dl)return kh(u);C.state===Eh?(C.state=$l,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[v]):+v<r&&(C.state=$l,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[v])}if(kh(function(){i.state===Dl&&(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=Dl,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=$l,i.timer.stop(),delete s[r];for(var g in s)return;delete t.__transition}}function Fl(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=$l,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(){Fl(this,t)})}function $x(t,r){var i,s;return function(){var a=Gn(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 Fx(t,r,i){var s,a;if(typeof i!="function")throw new Error;return function(){var c=Gn(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 Ox(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=bn(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:Fx)(i,t,r))}function Cu(t,r,i){var s=t._id;return t.each(function(){var a=Gn(this,s);(a.value||(a.value={}))[r]=i.apply(this,arguments)}),function(a){return bn(a,s).value[r]}}function Jp(t,r){var i;return(typeof r=="number"?Wn:r instanceof wi?Vl:(i=wi(r))?(r=i,Vl):Yp)(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=Jl(t),s=i==="transform"?_x:Jp;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=Jl(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)):bn(this.node(),r).delay}function nw(t,r){return function(){Gn(this,t).duration=+r.apply(this,arguments)}}function rw(t,r){return r=+r,function(){Gn(this,t).duration=r}}function iw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?nw:rw)(r,t)):bn(this.node(),r).duration}function ow(t,r){if(typeof r!="function")throw new Error;return function(){Gn(this,t).ease=r}}function sw(t){var r=this._id;return arguments.length?this.each(ow(r,t)):bn(this.node(),r).ease}function lw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;Gn(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=Pp(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 ar(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 ar(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:Gn;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?bn(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,ta(g[x],r,i,x,g,bn(v,i)));return new ar(c,this._parents,r,i)}function yw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Mp(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,N=bn(v,i),S=0,_=x.length;S<_;++S)(C=x[S])&&ta(C,r,i,S,x,N);c.push(x),u.push(v)}return new ar(c,u,r,i)}var vw=vs.prototype.constructor;function xw(){return new vw(this._groups,this._parents)}function ww(t,r){var i,s,a;return function(){var c=uo(this,t),u=(this.style.removeProperty(t),uo(this,t));return c===u?null:c===i&&u===s?a:a=r(i=c,s=u)}}function em(t){return function(){this.style.removeProperty(t)}}function Sw(t,r,i){var s,a=i+"",c;return function(){var u=uo(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=uo(this,t),h=i(this),m=h+"";return h==null&&(m=h=(this.style.removeProperty(t),uo(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=Gn(this,t),g=m.on,v=m.value[c]==null?h||(h=em(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:Jp;return r==null?this.styleTween(t,ww(t,s)).on("end.style."+t,em(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=tm(),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=bn(m,r);ta(m,t,i,g,u,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new ar(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=Gn(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 ar(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function tm(){return++Lw}var sr=vs.prototype;ar.prototype={constructor:ar,select:gw,selectAll:yw,selectChild:sr.selectChild,selectChildren:sr.selectChildren,filter:cw,merge:uw,selection:xw,transition:zw,call:sr.call,nodes:sr.nodes,node:sr.node,size:sr.size,empty:sr.empty,each:sr.each,on:hw,attr:Xx,attrTween:Zx,style:Ew,styleTween:jw,text:Pw,textTween:Rw,remove:mw,tween:Ox,delay:tw,duration:iw,ease:sw,easeVarying:aw,end:Aw,[Symbol.iterator]:sr[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 Fw(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 Ow(t){var r,i;t instanceof ar?(r=t._id,t=t._name):(r=tm(),(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])&&ta(m,t,r,g,u,i||Fw(m,r));return new ar(s,this._parents,t,r)}vs.prototype.interrupt=Dx;vs.prototype.transition=Ow;const Pl=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 lr(t,r,i){this.k=t,this.x=r,this.y=i}lr.prototype={constructor:lr,scale:function(t){return t===1?this:new lr(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new lr(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 na=new lr(1,0,0);nm.prototype=lr.prototype;function nm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return na;return t.__zoom}function Yc(t){t.stopImmediatePropagation()}function ns(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||na}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 rm(){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=Ll,g=Zl("start","zoom","end"),v,y,x,C=500,N=150,S=0,_=10;function E(z){z.property("__zoom",Ch).on("wheel.zoom",Z,{passive:!1}).on("mousedown.zoom",V).on("dblclick.zoom",J).filter(a).on("touchstart.zoom",U).on("touchmove.zoom",G).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(z,Q,W,K){var M=z.selection?z.selection():z;M.property("__zoom",Ch),z!==M?F(z,Q,W,K):M.interrupt().each(function(){L(this,arguments).event(K).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},E.scaleBy=function(z,Q,W,K){E.scaleTo(z,function(){var M=this.__zoom.k,A=typeof Q=="function"?Q.apply(this,arguments):Q;return M*A},W,K)},E.scaleTo=function(z,Q,W,K){E.transform(z,function(){var M=r.apply(this,arguments),A=this.__zoom,Y=W==null?j(M):typeof W=="function"?W.apply(this,arguments):W,I=A.invert(Y),$=typeof Q=="function"?Q.apply(this,arguments):Q;return i(k(P(A,$),Y,I),M,u)},W,K)},E.translateBy=function(z,Q,W,K){E.transform(z,function(){return i(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof W=="function"?W.apply(this,arguments):W),r.apply(this,arguments),u)},null,K)},E.translateTo=function(z,Q,W,K,M){E.transform(z,function(){var A=r.apply(this,arguments),Y=this.__zoom,I=K==null?j(A):typeof K=="function"?K.apply(this,arguments):K;return i(na.translate(I[0],I[1]).scale(Y.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof W=="function"?-W.apply(this,arguments):-W),A,u)},K,M)};function P(z,Q){return Q=Math.max(c[0],Math.min(c[1],Q)),Q===z.k?z:new lr(Q,z.x,z.y)}function k(z,Q,W){var K=Q[0]-W[0]*z.k,M=Q[1]-W[1]*z.k;return K===z.x&&M===z.y?z:new lr(z.k,K,M)}function j(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function F(z,Q,W,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 M=this,A=arguments,Y=L(M,A).event(K),I=r.apply(M,A),$=W==null?j(I):typeof W=="function"?W.apply(M,A):W,se=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),le=M.__zoom,de=typeof Q=="function"?Q.apply(M,A):Q,he=m(le.invert($).concat(se/le.k),de.invert($).concat(se/de.k));return function(me){if(me===1)me=de;else{var oe=he(me),pe=se/oe[2];me=new lr(pe,$[0]-oe[0]*pe,$[1]-oe[1]*pe)}Y.zoom(null,me)}})}function L(z,Q,W){return!W&&z.__zooming||new B(z,Q)}function B(z,Q){this.that=z,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=r.apply(z,Q),this.taps=0}B.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=en(this.that).datum();g.call(z,this.that,new Hw(z,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:g}),Q)}};function Z(z,...Q){if(!t.apply(this,arguments))return;var W=L(this,Q).event(z),K=this.__zoom,M=Math.max(c[0],Math.min(c[1],K.k*Math.pow(2,s.apply(this,arguments)))),A=En(z);if(W.wheel)(W.mouse[0][0]!==A[0]||W.mouse[0][1]!==A[1])&&(W.mouse[1]=K.invert(W.mouse[0]=A)),clearTimeout(W.wheel);else{if(K.k===M)return;W.mouse=[A,K.invert(A)],Fl(this),W.start()}ns(z),W.wheel=setTimeout(Y,N),W.zoom("mouse",i(k(P(K,M),W.mouse[0],W.mouse[1]),W.extent,u));function Y(){W.wheel=null,W.end()}}function V(z,...Q){if(x||!t.apply(this,arguments))return;var W=z.currentTarget,K=L(this,Q,!0).event(z),M=en(z.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",se,!0),A=En(z,W),Y=z.clientX,I=z.clientY;Op(z.view),Yc(z),K.mouse=[A,this.__zoom.invert(A)],Fl(this),K.start();function $(le){if(ns(le),!K.moved){var de=le.clientX-Y,he=le.clientY-I;K.moved=de*de+he*he>S}K.event(le).zoom("mouse",i(k(K.that.__zoom,K.mouse[0]=En(le,W),K.mouse[1]),K.extent,u))}function se(le){M.on("mousemove.zoom mouseup.zoom",null),Hp(le.view,K.moved),ns(le),K.event(le).end()}}function J(z,...Q){if(t.apply(this,arguments)){var W=this.__zoom,K=En(z.changedTouches?z.changedTouches[0]:z,this),M=W.invert(K),A=W.k*(z.shiftKey?.5:2),Y=i(k(P(W,A),K,M),r.apply(this,Q),u);ns(z),h>0?en(this).transition().duration(h).call(F,Y,K,z):en(this).call(E.transform,Y,K,z)}}function U(z,...Q){if(t.apply(this,arguments)){var W=z.touches,K=W.length,M=L(this,Q,z.changedTouches.length===K).event(z),A,Y,I,$;for(Yc(z),Y=0;Y<K;++Y)I=W[Y],$=En(I,this),$=[$,this.__zoom.invert($),I.identifier],M.touch0?!M.touch1&&M.touch0[2]!==$[2]&&(M.touch1=$,M.taps=0):(M.touch0=$,A=!0,M.taps=1+!!v);v&&(v=clearTimeout(v)),A&&(M.taps<2&&(y=$[0],v=setTimeout(function(){v=null},C)),Fl(this),M.start())}}function G(z,...Q){if(this.__zooming){var W=L(this,Q).event(z),K=z.changedTouches,M=K.length,A,Y,I,$;for(ns(z),A=0;A<M;++A)Y=K[A],I=En(Y,this),W.touch0&&W.touch0[2]===Y.identifier?W.touch0[0]=I:W.touch1&&W.touch1[2]===Y.identifier&&(W.touch1[0]=I);if(Y=W.that.__zoom,W.touch1){var se=W.touch0[0],le=W.touch0[1],de=W.touch1[0],he=W.touch1[1],me=(me=de[0]-se[0])*me+(me=de[1]-se[1])*me,oe=(oe=he[0]-le[0])*oe+(oe=he[1]-le[1])*oe;Y=P(Y,Math.sqrt(me/oe)),I=[(se[0]+de[0])/2,(se[1]+de[1])/2],$=[(le[0]+he[0])/2,(le[1]+he[1])/2]}else if(W.touch0)I=W.touch0[0],$=W.touch0[1];else return;W.zoom("touch",i(k(Y,I,$),W.extent,u))}}function te(z,...Q){if(this.__zooming){var W=L(this,Q).event(z),K=z.changedTouches,M=K.length,A,Y;for(Yc(z),x&&clearTimeout(x),x=setTimeout(function(){x=null},C),A=0;A<M;++A)Y=K[A],W.touch0&&W.touch0[2]===Y.identifier?delete W.touch0:W.touch1&&W.touch1[2]===Y.identifier&&delete W.touch1;if(W.touch1&&!W.touch0&&(W.touch0=W.touch1,delete W.touch1),W.touch0)W.touch0[1]=this.__zoom.invert(W.touch0[0]);else if(W.end(),W.taps===2&&(Y=En(Y,this),Math.hypot(y[0]-Y[0],y[1]-Y[1])<_)){var I=en(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return E.wheelDelta=function(z){return arguments.length?(s=typeof z=="function"?z:Pl(+z),E):s},E.filter=function(z){return arguments.length?(t=typeof z=="function"?z:Pl(!!z),E):t},E.touchable=function(z){return arguments.length?(a=typeof z=="function"?z:Pl(!!z),E):a},E.extent=function(z){return arguments.length?(r=typeof z=="function"?z:Pl([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),E):r},E.scaleExtent=function(z){return arguments.length?(c[0]=+z[0],c[1]=+z[1],E):[c[0],c[1]]},E.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],E):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},E.constrain=function(z){return arguments.length?(i=z,E):i},E.duration=function(z){return arguments.length?(h=+z,E):h},E.interpolate=function(z){return arguments.length?(m=z,E):m},E.on=function(){var z=g.on.apply(g,arguments);return z===g?E:z},E.clickDistance=function(z){return arguments.length?(S=(z=+z)*z,E):Math.sqrt(S)},E.tapDistance=function(z){return arguments.length?(_=+z,E):_},E}const Xn={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."},ds=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],im=["Enter"," ","Escape"],om={"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 ki;(function(t){t.Strict="strict",t.Loose="loose"})(ki||(ki={}));var vi;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(vi||(vi={}));var fs;(function(t){t.Partial="partial",t.Full="full"})(fs||(fs={}));const sm={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Br;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Br||(Br={}));var hs;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(hs||(hs={}));var Ce;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ce||(Ce={}));const _h={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top};function lm(t){return t===null?null:t?"valid":"invalid"}const am=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),ws=(t,r=[0,0])=>{const{width:i,height:s}=cr(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?Xl(u,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ra(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ia(i)},Ss=(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=ra(i,Xl(a)),s=!0)}),s?ia(i):{x:0,y:0,width:0,height:0}},ju=(t,r,[i,s,a]=[0,0,1],c=!1,u=!1)=>{const h={...Ns(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,N=v.height??g.height??g.initialHeight??null,S=ps(h,po(g)),_=(C??0)*(N??0),E=c&&S>0;(!g.internals.handleBounds||E||S>=_||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=Ss(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 cm({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",Xn.error005());else{const C=h.measured.width,N=h.measured.height;C&&N&&(y=[[m,g],[m+C,g+N]])}else h&&mo(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=mo(y)?Ni(r,y,u.measured):r;return(u.measured.width===void 0||u.measured.height===void 0)&&(c==null||c("015",Xn.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),N=!C&&x.parentId&&u.find(S=>S.id===x.parentId);(C||N)&&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(N=>N.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 ho=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Ni=(t={x:0,y:0},r,i)=>({x:ho(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:ho(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function um(t,r,i){const{width:s,height:a}=cr(i),{x:c,y:u}=i.internals.positionAbsolute;return Ni(t,[[c,u],[c+s,u+a]],r)}const jh=(t,r,i)=>t<r?ho(Math.abs(t-r),1,r)/r:t>i?-ho(Math.abs(t-i),1,r)/r:0,dm=(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]},ra=(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}),ia=({x:t,y:r,x2:i,y2:s})=>({x:t,y:r,width:i-t,height:s-r}),po=(t,r=[0,0])=>{var a,c;const{x:i,y:s}=_u(t)?t.internals.positionAbsolute:ws(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}},Xl=(t,r=[0,0])=>{var a,c;const{x:i,y:s}=_u(t)?t.internals.positionAbsolute:ws(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)}},fm=(t,r)=>ia(ra(du(t),du(r))),ps=(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=>_n(t.width)&&_n(t.height)&&_n(t.x)&&_n(t.y),_n=t=>!isNaN(t)&&isFinite(t),Jw=(t,r)=>{},ks=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),Ns=({x:t,y:r},[i,s,a],c=!1,u=[1,1])=>{const h={x:(t-i)/a,y:(r-s)/a};return c?ks(h,u):h},Gl=({x:t,y:r},[i,s,a])=>({x:t*a+i,y:r*a+s});function to(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=to(t,i),a=to(t,r);return{top:s,right:a,bottom:s,left:a,x:a*2,y:s*2}}if(typeof t=="object"){const s=to(t.top??t.y??0,i),a=to(t.bottom??t.y??0,i),c=to(t.left??t.x??0,r),u=to(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}=Gl(t,[r,i,s]),{x:m,y:g}=Gl({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=ho(g,s,a),y=t.x+t.width/2,x=t.y+t.height/2,C=r/2-y*v,N=i/2-x*v,S=t1(t,C,N,v,r,i),_={left:Math.min(S.left-u.left,0),top:Math.min(S.top-u.top,0),right:Math.min(S.right-u.right,0),bottom:Math.min(S.bottom-u.bottom,0)};return{x:C-_.left+_.right,y:N-_.top+_.bottom,zoom:v}},ms=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function mo(t){return t!=null&&t!=="parent"}function cr(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 hm(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 pm(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{...om,...t||{}}}function ss(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:a}){const{x:c,y:u}=jn(t),h=Ns({x:c-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},s),{x:m,y:g}=i?ks(h,r):h;return{xSnapped:m,ySnapped:g,...h}}const Mu=t=>({width:t.offsetWidth,height:t.offsetHeight}),mm=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 gm(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 ym=t=>"clientX"in t,jn=(t,r)=>{var c,u;const i=ym(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 vm({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 Il(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 Ce.Left:return[r-Il(r-s,c),i];case Ce.Right:return[r+Il(s-r,c),i];case Ce.Top:return[r,i-Il(i-a,c)];case Ce.Bottom:return[r,i+Il(a-i,c)]}}function xm({sourceX:t,sourceY:r,sourcePosition:i=Ce.Bottom,targetX:s,targetY:a,targetPosition:c=Ce.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,N]=vm({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,N]}function wm({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=ra(Xl(t),Xl(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 ps(u,ia(c))>0}const Sm=({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)),km=(t,r,i={})=>{if(!t.source||!t.target)return r;const s=i.getEdgeId||Sm;let a;return am(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||Sm,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 Nm({sourceX:t,sourceY:r,targetX:i,targetY:s}){const[a,c,u,h]=wm({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,a,c,u,h]}const Th={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},c1=({source:t,sourcePosition:r=Ce.Bottom,target:i})=>r===Ce.Left||r===Ce.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=Ce.Bottom,target:i,targetPosition:s=Ce.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 N=[],S,_;const E={x:0,y:0},P={x:0,y:0},[,,k,j]=wm({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(h[x]*m[x]===-1){x==="x"?(S=a.x??g.x+(v.x-g.x)*u,_=a.y??(g.y+v.y)/2):(S=a.x??(g.x+v.x)/2,_=a.y??g.y+(v.y-g.y)*u);const L=[{x:S,y:g.y},{x:S,y:v.y}],B=[{x:g.x,y:_},{x:v.x,y:_}];h[x]===C?N=x==="x"?L:B:N=x==="x"?B:L}else{const L=[{x:g.x,y:v.y}],B=[{x:v.x,y:g.y}];if(x==="x"?N=h.x===C?B:L:N=h.y===C?L:B,r===s){const G=Math.abs(t[x]-i[x]);if(G<=c){const te=Math.min(c-1,c-G);h[x]===C?E[x]=(g[x]>t[x]?-1:1)*te:P[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))&&(N=x==="x"?L:B)}const Z={x:g.x+E.x,y:g.y+E.y},V={x:v.x+P.x,y:v.y+P.y},J=Math.max(Math.abs(Z.x-N[0].x),Math.abs(V.x-N[0].x)),U=Math.max(Math.abs(Z.y-N[0].y),Math.abs(V.y-N[0].y));J>=U?(S=(Z.x+V.x)/2,_=N[0].y):(S=N[0].x,_=(Z.y+V.y)/2)}return[[t,{x:g.x+E.x,y:g.y+E.y},...N,{x:v.x+P.x,y:v.y+P.y},i],S,_,k,j]}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=Ce.Bottom,targetX:s,targetY:a,targetPosition:c=Ce.Top,borderRadius:u=5,centerX:h,centerY:m,offset:g=20,stepPosition:v=.5}){const[y,x,C,N,S]=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((E,P,k)=>{let j="";return k>0&&k<y.length-1?j=d1(y[k-1],P,y[k+1],u):j=`${k===0?"M":"L"}${P.x} ${P.y}`,E+=j,E},""),x,C,N,S]}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===ki.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",Xn.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=(c==null?void 0:c.position)||Ce.Bottom,m=(u==null?void 0:u.position)||Ce.Top,g=Ei(r,c,h),v=Ei(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 Ei(t,r,i=Ce.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??cr(t);if(s)return{x:a+u/2,y:c+h/2};switch((r==null?void 0:r.position)??i){case Ce.Top:return{x:a+u/2,y:c};case Ce.Right:return{x:a+u,y:c+h/2};case Ce.Bottom:return{x:a+u/2,y:c+h};case Ce.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 Em=1e3,p1=10,Pu={nodeOrigin:[0,0],nodeExtent:ds,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=ws(a,s.nodeOrigin),u=mo(a.extent)?a.extent:s.nodeExtent,h=Ni(c,u,cr(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)?Em: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=ws(y,a.nodeOrigin),N=mo(y.extent)?y.extent:a.nodeExtent,S=Ni(C,N,cr(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:S,handleBounds:y1(y,x),z:Cm(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)?Em:0,{x,y:C,z:N}=x1(t,v,u,h,y,m),{positionAbsolute:S}=t.internals,_=x!==S.x||C!==S.y;(_||N!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:_?{x,y:C}:S,z:N}})}function Cm(t,r,i){const s=_n(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=cr(t),g=ws(t,i),v=mo(t.extent)?Ni(g,t.extent,m):g;let y=Ni({x:u+v.x,y:h+v.y},s,m);t.extent==="parent"&&(y=um(y,m,r));const x=Cm(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)??po(m),v=fm(g,h.rect);c.set(h.parentId,{expandedRect:v,parent:m})}return c.size>0&&c.forEach(({expandedRect:h,parent:m},g)=>{var k;const v=m.internals.positionAbsolute,y=cr(m),x=m.origin??s,C=h.x<v.x?Math.round(Math.abs(v.x-h.x)):0,N=h.y<v.y?Math.round(Math.abs(v.y-h.y)):0,S=Math.max(y.width,Math.round(h.width)),_=Math.max(y.height,Math.round(h.height)),E=(S-y.width)*x[0],P=(_-y.height)*x[1];(C>0||N>0||E||P)&&(a.push({id:g,type:"position",position:{x:m.position.x-C+E,y:m.position.y-N+P}}),(k=i.get(g))==null||k.forEach(j=>{t.some(F=>F.id===j.id)||a.push({id:j.id,type:"position",position:{x:j.position.x+C,y:j.position.y+N}})})),(y.width<h.width||y.height<h.height||C||N)&&a.push({id:g,type:"dimensions",setAttributes:!0,dimensions:{width:S+(C?x[0]*C-E:0),height:_+(N?x[1]*N-P: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 N=r.get(C.id);if(!N)continue;if(N.hidden){r.set(N.id,{...N,internals:{...N.internals,handleBounds:void 0}}),m=!0;continue}const S=Mu(C.nodeElement),_=N.measured.width!==S.width||N.measured.height!==S.height;if(!!(S.width&&S.height&&(_||!N.internals.handleBounds||C.force))){const P=C.nodeElement.getBoundingClientRect(),k=mo(N.extent)?N.extent:c;let{positionAbsolute:j}=N.internals;N.parentId&&N.extent==="parent"?j=um(j,S,r.get(N.parentId)):k&&(j=Ni(j,k,S));const F={...N,measured:S,internals:{...N.internals,positionAbsolute:j,handleBounds:{source:Ph("source",C.nodeElement,P,y,N.id),target:Ph("target",C.nodeElement,P,y,N.id)}}};r.set(N.id,F),N.parentId&&Ru(F,r,i,{nodeOrigin:a,zIndexMode:u}),m=!0,_&&(g.push({id:N.id,type:"dimensions",dimensions:S}),N.expandParent&&N.parentId&&x.push({id:N.id,parentId:N.parentId,rect:po(F,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 _m(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 jm(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:jm(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||!jm(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 Xc({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=ks(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,N=!1,S=null;function _({noDragClassName:P,handleSelector:k,domNode:j,isSelectable:F,nodeId:L,nodeClickDistance:B=0}){x=en(j);function Z({x:G,y:te}){const{nodeLookup:z,nodeExtent:Q,snapGrid:W,snapToGrid:K,nodeOrigin:M,onNodeDrag:A,onSelectionDrag:Y,onError:I,updateNodePositions:$}=r();c={x:G,y:te};let se=!1;const le=h.size>1,de=le&&Q?du(Ss(h)):null,he=le&&K?N1({dragItems:h,snapGrid:W,x:G,y:te}):null;for(const[me,oe]of h){if(!z.has(me))continue;let pe={x:G-oe.distance.x,y:te-oe.distance.y};K&&(pe=he?{x:Math.round(pe.x+he.x),y:Math.round(pe.y+he.y)}:ks(pe,W));let je=null;if(le&&Q&&!oe.extent&&de){const{positionAbsolute:Ne}=oe.internals,$e=Ne.x-de.x+Q[0][0],Fe=Ne.x+oe.measured.width-de.x2+Q[1][0],Ae=Ne.y-de.y+Q[0][1],et=Ne.y+oe.measured.height-de.y2+Q[1][1];je=[[$e,Ae],[Fe,et]]}const{position:Ie,positionAbsolute:ke}=cm({nodeId:me,nextPosition:pe,nodeLookup:z,nodeExtent:je||Q,nodeOrigin:M,onError:I});se=se||oe.position.x!==Ie.x||oe.position.y!==Ie.y,oe.position=Ie,oe.internals.positionAbsolute=ke}if(N=N||se,!!se&&($(h,!0),S&&(s||A||!L&&Y))){const[me,oe]=Xc({nodeId:L,dragItems:h,nodeLookup:z});s==null||s(S,h,me,oe),A==null||A(S,me,oe),L||Y==null||Y(S,oe)}}async function V(){if(!v)return;const{transform:G,panBy:te,autoPanSpeed:z,autoPanOnNodeDrag:Q}=r();if(!Q){m=!1,cancelAnimationFrame(u);return}const[W,K]=dm(g,v,z);(W!==0||K!==0)&&(c.x=(c.x??0)-W/G[2],c.y=(c.y??0)-K/G[2],await te({x:W,y:K})&&Z(c)),u=requestAnimationFrame(V)}function J(G){var le;const{nodeLookup:te,multiSelectionActive:z,nodesDraggable:Q,transform:W,snapGrid:K,snapToGrid:M,selectNodesOnDrag:A,onNodeDragStart:Y,onSelectionDragStart:I,unselectNodesAndEdges:$}=r();y=!0,(!A||!F)&&!z&&L&&((le=te.get(L))!=null&&le.selected||$()),F&&A&&L&&(t==null||t(L));const se=ss(G.sourceEvent,{transform:W,snapGrid:K,snapToGrid:M,containerBounds:v});if(c=se,h=k1(te,Q,se,L),h.size>0&&(i||Y||!L&&I)){const[de,he]=Xc({nodeId:L,dragItems:h,nodeLookup:te});i==null||i(G.sourceEvent,h,de,he),Y==null||Y(G.sourceEvent,de,he),L||I==null||I(G.sourceEvent,he)}}const U=Bp().clickDistance(B).on("start",G=>{const{domNode:te,nodeDragThreshold:z,transform:Q,snapGrid:W,snapToGrid:K}=r();v=(te==null?void 0:te.getBoundingClientRect())||null,C=!1,N=!1,S=G.sourceEvent,z===0&&J(G),c=ss(G.sourceEvent,{transform:Q,snapGrid:W,snapToGrid:K,containerBounds:v}),g=jn(G.sourceEvent,v)}).on("drag",G=>{const{autoPanOnNodeDrag:te,transform:z,snapGrid:Q,snapToGrid:W,nodeDragThreshold:K,nodeLookup:M}=r(),A=ss(G.sourceEvent,{transform:z,snapGrid:Q,snapToGrid:W,containerBounds:v});if(S=G.sourceEvent,(G.sourceEvent.type==="touchmove"&&G.sourceEvent.touches.length>1||L&&!M.has(L))&&(C=!0),!C){if(!m&&te&&y&&(m=!0,V()),!y){const Y=jn(G.sourceEvent,v),I=Y.x-g.x,$=Y.y-g.y;Math.sqrt(I*I+$*$)>K&&J(G)}(c.x!==A.xSnapped||c.y!==A.ySnapped)&&h&&y&&(g=jn(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:W}=r();if(N&&(z(h,!1),N=!1),a||Q||!L&&W){const[K,M]=Xc({nodeId:L,dragItems:h,nodeLookup:te,dragging:!1});a==null||a(G.sourceEvent,h,K,M),Q==null||Q(G.sourceEvent,K,M),L||W==null||W(G.sourceEvent,M)}}}).filter(G=>{const te=G.target;return!G.button&&(!P||!$h(te,`.${P}`,j))&&(!k||$h(te,k,j))});x.call(U)}function E(){x==null||x.on(".drag",null)}return{update:_,destroy:E}}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())ps(a,po(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}=Ei(g,y,y.position,!0),N=Math.sqrt(Math.pow(x-t.x,2)+Math.pow(C-t.y,2));N>r||(N<c?(a=[{...y,x,y:C}],c=N):N===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 bm(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,...Ei(u,m,m.position,!0)}:m}function Mm(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 Pm=()=>!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:N,onConnect:S,onConnectEnd:_,isValidConnection:E=Pm,onReconnectEnd:P,updateConnection:k,getTransform:j,getFromHandle:F,autoPanSpeed:L,dragThreshold:B=1,handleDomNode:Z}){const V=mm(t.target);let J=0,U;const{x:G,y:te}=jn(t),z=Mm(c,Z),Q=h==null?void 0:h.getBoundingClientRect();let W=!1;if(!Q||!z)return;const K=bm(a,z,s,m,r);if(!K)return;let M=jn(t,Q),A=!1,Y=null,I=!1,$=null;function se(){if(!v||!Q)return;const[Ie,ke]=dm(M,Q,L);x({x:Ie,y:ke}),J=requestAnimationFrame(se)}const le={...K,nodeId:a,type:z,position:K.position},de=m.get(a);let me={inProgress:!0,isValid:null,from:Ei(de,le,Ce.Left,!0),fromHandle:le,fromPosition:le.position,fromNode:de,to:M,toHandle:null,toPosition:_h[le.position],toNode:null,pointer:M};function oe(){W=!0,k(me),N==null||N(t,{nodeId:a,handleId:s,handleType:z})}B===0&&oe();function pe(Ie){if(!W){const{x:et,y:Pt}=jn(Ie),wt=et-G,gt=Pt-te;if(!(wt*wt+gt*gt>B*B))return;oe()}if(!F()||!le){je(Ie);return}const ke=j();M=jn(Ie,Q),U=j1(Ns(M,ke,!1,[1,1]),i,m,le),A||(se(),A=!0);const Ne=Im(Ie,{handle:U,connectionMode:r,fromNodeId:a,fromHandleId:s,fromType:u?"target":"source",isValidConnection:E,doc:V,lib:g,flowId:y,nodeLookup:m});$=Ne.handleDomNode,Y=Ne.connection,I=b1(!!U,Ne.isValid);const $e=m.get(a),Fe=$e?Ei($e,le,Ce.Left,!0):me.from,Ae={...me,from:Fe,isValid:I,to:Ne.toHandle&&I?Gl({x:Ne.toHandle.x,y:Ne.toHandle.y},ke):M,toHandle:Ne.toHandle,toPosition:I&&Ne.toHandle?Ne.toHandle.position:_h[le.position],toNode:Ne.toHandle?m.get(Ne.toHandle.nodeId):null,pointer:M};k(Ae),me=Ae}function je(Ie){if(!("touches"in Ie&&Ie.touches.length>0)){if(W){(U||$)&&Y&&I&&(S==null||S(Y));const{inProgress:ke,...Ne}=me,$e={...Ne,toPosition:me.toHandle?me.toPosition:null};_==null||_(Ie,$e),c&&(P==null||P(Ie,$e))}C(),cancelAnimationFrame(J),A=!1,I=!1,Y=null,$=null,V.removeEventListener("mousemove",pe),V.removeEventListener("mouseup",je),V.removeEventListener("touchmove",pe),V.removeEventListener("touchend",je)}}V.addEventListener("mousemove",pe),V.addEventListener("mouseup",je),V.addEventListener("touchmove",pe),V.addEventListener("touchend",je)}function Im(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:a,fromType:c,doc:u,lib:h,flowId:m,isValidConnection:g=Pm,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:N}=jn(t),S=u.elementFromPoint(C,N),_=S!=null&&S.classList.contains(`${h}-flow__handle`)?S:x,E={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const P=Mm(void 0,_),k=_.getAttribute("data-nodeid"),j=_.getAttribute("data-handleid"),F=_.classList.contains("connectable"),L=_.classList.contains("connectableend");if(!k||!P)return E;const B={source:y?k:s,sourceHandle:y?j:a,target:y?s:k,targetHandle:y?a:j};E.connection=B;const V=F&&L&&(i===ki.Strict?y&&P==="source"||!y&&P==="target":k!==s||j!==a);E.isValid=V&&g(B),E.toHandle=bm(k,P,j,v,i,!0)}return E}const mu={onPointerDown:M1,isValid:Im};function P1({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const a=en(t);function c({translateExtent:h,width:m,height:g,zoomStep:v=1,pannable:y=!0,zoomable:x=!0,inversePan:C=!1}){const N=k=>{if(k.sourceEvent.type!=="wheel"||!r)return;const j=i(),F=k.sourceEvent.ctrlKey&&ms()?10:1,L=-k.sourceEvent.deltaY*(k.sourceEvent.deltaMode===1?.05:k.sourceEvent.deltaMode?1:.002)*v,B=j[2]*Math.pow(2,L*F);r.scaleTo(B)};let S=[0,0];const _=k=>{(k.sourceEvent.type==="mousedown"||k.sourceEvent.type==="touchstart")&&(S=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY])},E=k=>{const j=i();if(k.sourceEvent.type!=="mousemove"&&k.sourceEvent.type!=="touchmove"||!r)return;const F=[k.sourceEvent.clientX??k.sourceEvent.touches[0].clientX,k.sourceEvent.clientY??k.sourceEvent.touches[0].clientY],L=[F[0]-S[0],F[1]-S[1]];S=F;const B=s()*Math.max(j[2],Math.log(j[2]))*(C?-1:1),Z={x:j[0]-L[0]*B,y:j[1]-L[1]*B},V=[[0,0],[m,g]];r.setViewportConstrained({x:Z.x,y:Z.y,zoom:j[2]},V,h)},P=rm().on("start",_).on("zoom",y?E:null).on("zoom.wheel",x?N:null);a.call(P,{})}function u(){a.on("zoom",null)}return{update:c,destroy:u,pointer:En}}const oa=t=>({x:t.x,y:t.y,zoom:t.k}),Gc=({x:t,y:r,zoom:i})=>na.translate(t,r).scale(i),so=(t,r)=>t.target.closest(`.${r}`),Tm=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),I1=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Kc=(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},Rm=t=>{const r=t.ctrlKey&&ms()?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(so(v,r))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const y=i.property("__zoom").k||1;if(v.ctrlKey&&u){const _=En(v),E=Rm(v),P=y*Math.pow(2,E);s.scaleTo(i,P,_,v);return}const x=v.deltaMode===1?20:1;let C=a===vi.Vertical?0:v.deltaX*x,N=a===vi.Horizontal?0:v.deltaY*x;!ms()&&v.shiftKey&&a!==vi.Vertical&&(C=v.deltaY*x,N=0),s.translateBy(i,-(C/y)*c,-(N/y)*c,{internal:!0});const S=oa(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(m==null||m(v,S),t.panScrollTimeout=setTimeout(()=>{g==null||g(v,S),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(v,S))}}function R1({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,a){const c=s.type==="wheel",u=!r&&c&&!s.ctrlKey,h=so(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=oa(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&&Tm(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,oa(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&&Tm(r,t.mouseButton??0)&&!t.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),t.usedRightMouseButton=!1,s(!1),a)){const m=oa(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,N=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(so(y,`${g}-flow__node`)||so(y,`${g}-flow__edge`)))return!0;if(!s&&!x&&!a&&!c&&!i||u||v&&!N||so(y,h)&&N||so(y,m)&&(!N||a&&N&&!t)||!i&&y.ctrlKey&&N)return!1;if(!i&&y.type==="touchstart"&&((_=y.touches)==null?void 0:_.length)>1)return y.preventDefault(),!1;if(!x&&!a&&!C&&N||!s&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(s)&&!s.includes(y.button)&&y.type==="mousedown")return!1;const S=Array.isArray(s)&&s.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||N)&&S}}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=rm().scaleExtent([r,i]).translateExtent(s),x=en(t).call(y);P({x:a.x,y:a.y,zoom:ho(a.zoom,r,i)},[[0,0],[v.width,v.height]],s);const C=x.on("wheel.zoom"),N=x.on("dblclick.zoom");y.wheelDelta(Rm);function S(U,G){return x?new Promise(te=>{y==null||y.interpolate((G==null?void 0:G.interpolate)==="linear"?os:Ll).transform(Kc(x,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),U)}):Promise.resolve(!1)}function _({noWheelClassName:U,noPanClassName:G,onPaneContextMenu:te,userSelectionActive:z,panOnScroll:Q,panOnDrag:W,panOnScrollMode:K,panOnScrollSpeed:M,preventScrolling:A,zoomOnPinch:Y,zoomOnScroll:I,zoomOnDoubleClick:$,zoomActivationKeyPressed:se,lib:le,onTransformChange:de,connectionInProgress:he,paneClickDistance:me,selectionOnDrag:oe}){z&&!g.isZoomingOrPanning&&E();const pe=Q&&!se&&!z;y.clickDistance(oe?1/0:!_n(me)||me<0?0:me);const je=pe?T1({zoomPanValues:g,noWheelClassName:U,d3Selection:x,d3Zoom:y,panOnScrollMode:K,panOnScrollSpeed:M,zoomOnPinch:Y,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:h}):R1({noWheelClassName:U,preventScrolling:A,d3ZoomHandler:C});if(x.on("wheel.zoom",je,{passive:!1}),!z){const ke=z1({zoomPanValues:g,onDraggingChange:m,onPanZoomStart:u});y.on("start",ke);const Ne=A1({zoomPanValues:g,panOnDrag:W,onPaneContextMenu:!!te,onPanZoom:c,onTransformChange:de});y.on("zoom",Ne);const $e=L1({zoomPanValues:g,panOnDrag:W,panOnScroll:Q,onPaneContextMenu:te,onPanZoomEnd:h,onDraggingChange:m});y.on("end",$e)}const Ie=D1({zoomActivationKeyPressed:se,panOnDrag:W,zoomOnScroll:I,panOnScroll:Q,zoomOnDoubleClick:$,zoomOnPinch:Y,userSelectionActive:z,noPanClassName:G,noWheelClassName:U,lib:le,connectionInProgress:he});y.filter(Ie),$?x.on("dblclick.zoom",N):x.on("dblclick.zoom",null)}function E(){y.on("zoom",null)}async function P(U,G,te){const z=Gc(U),Q=y==null?void 0:y.constrain()(z,G,te);return Q&&await S(Q),new Promise(W=>W(Q))}async function k(U,G){const te=Gc(U);return await S(te,G),new Promise(z=>z(te))}function j(U){if(x){const G=Gc(U),te=x.property("__zoom");(te.k!==U.zoom||te.x!==U.x||te.y!==U.y)&&(y==null||y.transform(x,G,null,{sync:!0}))}}function F(){const U=x?nm(x.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function L(U,G){return x?new Promise(te=>{y==null||y.interpolate((G==null?void 0:G.interpolate)==="linear"?os:Ll).scaleTo(Kc(x,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),U)}):Promise.resolve(!1)}function B(U,G){return x?new Promise(te=>{y==null||y.interpolate((G==null?void 0:G.interpolate)==="linear"?os:Ll).scaleBy(Kc(x,G==null?void 0:G.duration,G==null?void 0:G.ease,()=>te(!0)),U)}):Promise.resolve(!1)}function Z(U){y==null||y.scaleExtent(U)}function V(U){y==null||y.translateExtent(U)}function J(U){const G=!_n(U)||U<0?0:U;y==null||y.clickDistance(G)}return{update:_,destroy:E,setViewport:k,setViewportConstrained:P,getViewport:F,scaleTo:L,scaleBy:B,setScaleExtent:Z,setTranslateExtent:V,syncViewport:j,setClickDistance:J}}var Ci;(function(t){t.Line="line",t.Handle="handle"})(Ci||(Ci={}));const F1=["top-left","top-right","bottom-left","bottom-right"],O1=["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 Fh(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 Or(t,r){return Math.max(0,r-t)}function Hr(t,r){return Math.max(0,t-r)}function Tl(t,r,i){return Math.max(0,r-t,t-i)}function Oh(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:N}=i,{minWidth:S,maxWidth:_,minHeight:E,maxHeight:P}=s,{x:k,y:j,width:F,height:L,aspectRatio:B}=t;let Z=Math.floor(v?C-t.pointerX:0),V=Math.floor(y?N-t.pointerY:0);const J=F+(m?-Z:Z),U=L+(g?-V:V),G=-c[0]*F,te=-c[1]*L;let z=Tl(J,S,_),Q=Tl(U,E,P);if(u){let M=0,A=0;m&&Z<0?M=Or(k+Z+G,u[0][0]):!m&&Z>0&&(M=Hr(k+J+G,u[1][0])),g&&V<0?A=Or(j+V+te,u[0][1]):!g&&V>0&&(A=Hr(j+U+te,u[1][1])),z=Math.max(z,M),Q=Math.max(Q,A)}if(h){let M=0,A=0;m&&Z>0?M=Hr(k+Z,h[0][0]):!m&&Z<0&&(M=Or(k+J,h[1][0])),g&&V>0?A=Hr(j+V,h[0][1]):!g&&V<0&&(A=Or(j+U,h[1][1])),z=Math.max(z,M),Q=Math.max(Q,A)}if(a){if(v){const M=Tl(J/B,E,P)*B;if(z=Math.max(z,M),u){let A=0;!m&&!g||m&&!g&&x?A=Hr(j+te+J/B,u[1][1])*B:A=Or(j+te+(m?Z:-Z)/B,u[0][1])*B,z=Math.max(z,A)}if(h){let A=0;!m&&!g||m&&!g&&x?A=Or(j+J/B,h[1][1])*B:A=Hr(j+(m?Z:-Z)/B,h[0][1])*B,z=Math.max(z,A)}}if(y){const M=Tl(U*B,S,_)/B;if(Q=Math.max(Q,M),u){let A=0;!m&&!g||g&&!m&&x?A=Hr(k+U*B+G,u[1][0])/B:A=Or(k+(g?V:-V)*B+G,u[0][0])/B,Q=Math.max(Q,A)}if(h){let A=0;!m&&!g||g&&!m&&x?A=Or(k+U*B,h[1][0])/B:A=Hr(k+(g?V:-V)*B,h[0][0])/B,Q=Math.max(Q,A)}}}V=V+(V<0?Q:-Q),Z=Z+(Z<0?z:-z),a&&(x?J>U*B?V=(Oh(m,g)?-Z:Z)/B:Z=(Oh(m,g)?-V:V)*B:v?(V=Z/B,g=m):(Z=V*B,m=g));const W=m?k+Z:k,K=g?j+V:j;return{width:F+(m?-Z:Z),height:L+(g?-V:V),x:c[0]*Z*(m?-1:1)+W,y:c[1]*V*(g?-1:1)+K}}const zm={width:0,height:0,x:0,y:0},V1={...zm,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=en(t);let u={controlDirection:Fh("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:N,onResizeEnd:S,shouldResize:_}){let E={...zm},P={...V1};u={boundaries:v,resizeDirection:x,keepAspectRatio:y,controlDirection:Fh(g)};let k,j=null,F=[],L,B,Z,V=!1;const J=Bp().on("start",U=>{const{nodeLookup:G,transform:te,snapGrid:z,snapToGrid:Q,nodeOrigin:W,paneDomNode:K}=i();if(k=G.get(r),!k)return;j=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:A}=ss(U.sourceEvent,{transform:te,snapGrid:z,snapToGrid:Q,containerBounds:j});E={width:k.measured.width??0,height:k.measured.height??0,x:k.position.x??0,y:k.position.y??0},P={...E,pointerX:M,pointerY:A,aspectRatio:E.width/E.height},L=void 0,k.parentId&&(k.extent==="parent"||k.expandParent)&&(L=G.get(k.parentId),B=L&&k.extent==="parent"?W1(L):void 0),F=[],Z=void 0;for(const[Y,I]of G)if(I.parentId===r&&(F.push({id:Y,position:{...I.position},extent:I.extent}),I.extent==="parent"||I.expandParent)){const $=U1(I,k,I.origin??W);Z?Z=[[Math.min($[0][0],Z[0][0]),Math.min($[0][1],Z[0][1])],[Math.max($[1][0],Z[1][0]),Math.max($[1][1],Z[1][1])]]:Z=$}C==null||C(U,{...E})}).on("drag",U=>{const{transform:G,snapGrid:te,snapToGrid:z,nodeOrigin:Q}=i(),W=ss(U.sourceEvent,{transform:G,snapGrid:te,snapToGrid:z,containerBounds:j}),K=[];if(!k)return;const{x:M,y:A,width:Y,height:I}=E,$={},se=k.origin??Q,{width:le,height:de,x:he,y:me}=B1(P,u.controlDirection,W,u.boundaries,u.keepAspectRatio,se,B,Z),oe=le!==Y,pe=de!==I,je=he!==M&&oe,Ie=me!==A&&pe;if(!je&&!Ie&&!oe&&!pe)return;if((je||Ie||se[0]===1||se[1]===1)&&($.x=je?he:E.x,$.y=Ie?me:E.y,E.x=$.x,E.y=$.y,F.length>0)){const Fe=he-M,Ae=me-A;for(const et of F)et.position={x:et.position.x-Fe+se[0]*(le-Y),y:et.position.y-Ae+se[1]*(de-I)},K.push(et)}if((oe||pe)&&($.width=oe&&(!u.resizeDirection||u.resizeDirection==="horizontal")?le:E.width,$.height=pe&&(!u.resizeDirection||u.resizeDirection==="vertical")?de:E.height,E.width=$.width,E.height=$.height),L&&k.expandParent){const Fe=se[0]*($.width??0);$.x&&$.x<Fe&&(E.x=Fe,P.x=P.x-($.x-Fe));const Ae=se[1]*($.height??0);$.y&&$.y<Ae&&(E.y=Ae,P.y=P.y-($.y-Ae))}const ke=H1({width:E.width,prevWidth:Y,height:E.height,prevHeight:I,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ne={...E,direction:ke};(_==null?void 0:_(U,Ne))!==!1&&(V=!0,N==null||N(U,Ne),s($,K))}).on("end",U=>{V&&(S==null||S(U,{...E}),a==null||a({...E}),V=!1)});c.call(J)}function m(){c.on(".drag",null)}return{update:h,destroy:m}}var Qc={exports:{}},qc={},Zc={exports:{}},Jc={};/**
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 Jc;Hh=1;var t=ys();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(),N=s({inst:{value:C,getSnapshot:x}}),S=N[0].inst,_=N[1];return c(function(){S.value=C,S.getSnapshot=x,m(S)&&_({inst:S})},[y,C,x]),a(function(){return m(S)&&_({inst:S}),y(function(){m(S)&&_({inst:S})})},[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 Jc.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,Jc}var Bh;function G1(){return Bh||(Bh=1,Zc.exports=X1()),Zc.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=ys(),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 N=c(null);if(N.current===null){var S={hasValue:!1,value:null};N.current=S}else S=N.current;N=h(function(){function E(L){if(!P){if(P=!0,k=L,L=x(L),C!==void 0&&S.hasValue){var B=S.value;if(C(B,L))return j=B}return j=L}if(B=j,s(k,L))return B;var Z=x(L);return C!==void 0&&C(B,Z)?(k=L,B):(k=L,j=Z)}var P=!1,k,j,F=y===void 0?null:y;return[function(){return E(v())},F===null?void 0:function(){return E(F())}]},[v,y,x,C]);var _=a(g,N[0],N[1]);return u(function(){S.hasValue=!0,S.value=_},[_]),m(_),_},qc}var Wh;function Q1(){return Wh||(Wh=1,Qc.exports=K1()),Qc.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(N=>N(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}=_p,{useSyncExternalStoreWithSelector:nS}=Z1,rS=t=>t;function Am(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)=>Am(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}jp();const sa=b.createContext(null),oS=sa.Provider,Lm=Xn.error001();function Oe(t,r){const i=b.useContext(sa);if(i===null)throw new Error(Lm);return Am(i,t,r)}function Je(){const t=b.useContext(sa);if(t===null)throw new Error(Lm);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%)"},Dm="react-flow__node-desc",$m="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:`${Dm}-${t}`,style:Xh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${$m}-${t}`,style:Xh,children:i["edge.a11yDescription.default"]}),!r&&d.jsx(uS,{rfId:t})]})}const la=b.forwardRef(({position:t="top-left",children:r,className:i,style:s,...a},c)=>{const u=`${t}`.split("-");return d.jsx("div",{className:ut(["react-flow__panel",i,...u]),style:s,ref:c,...a,children:r})});la.displayName="Panel";function fS({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:d.jsx(la,{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}},Rl=t=>t.id;function pS(t,r){return Ze(t.selectedNodes.map(Rl),r.selectedNodes.map(Rl))&&Ze(t.selectedEdges.map(Rl),r.selectedEdges.map(Rl))}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:ds,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 gs(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 _,E;if(a.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!a.current||a.current&&!g)&&gm(C))return!1;const S=Jh(C.code,h);if(c.current.add(C[S]),Zh(u,c.current,!1)){const P=((E=(_=C.composedPath)==null?void 0:_.call(C))==null?void 0:E[0])||C.target,k=(P==null?void 0:P.nodeName)==="BUTTON"||(P==null?void 0:P.nodeName)==="A";r.preventDefault!==!1&&(a.current||!k)&&C.preventDefault(),s(!0)}},y=C=>{const N=Jh(C.code,h);Zh(u,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(C[N]),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 Ns(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=Gl(r,i);return{x:u.x+a,y:u.y+c}}}),[])};function Om(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 Hm(t,r){return Om(t,r)}function Bm(t,r){return Om(t,r)}function mi(t,r){return{id:t,type:"select",selected:r}}function lo(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(mi(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=>am(t);function Vm(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 Wm=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:N}=r.getState();let S=m;for(const E of h)S=typeof E=="function"?E(S):E;let _=ep({items:S,lookup:x});for(const E of N.values())_=E(_);v&&g(S),_.length>0?y==null||y(_):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:P,setNodes:k}=r.getState();E&&k(P)})},[]),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 N of h)C=typeof N=="function"?N(C):N;v?g(C):y&&y(ep({items:C,lookup:x}))},[]),c=rp(a),u=b.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return d.jsx(Wm.Provider,{value:u,children:t})}function MS(){const t=b.useContext(Wm);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 E,P;const{nodeLookup:x,nodeOrigin:C}=r.getState(),N=np(y)?y:x.get(y.id),S=N.parentId?pm(N.position,N.measured,N.parentId,x,C):N.position,_={...N,position:S,width:((E=N.measured)==null?void 0:E.width)??N.width,height:((P=N.measured)==null?void 0:P.height)??N.height};return po(_)},g=(y,x,C={replace:!1})=>{u(N=>N.map(S=>{if(S.id===y){const _=typeof x=="function"?x(S):x;return C.replace&&np(_)?_:{...S,..._}}return S}))},v=(y,x,C={replace:!1})=>{h(N=>N.map(S=>{if(S.id===y){const _=typeof x=="function"?x(S):x;return C.replace&&CS(_)?_:{...S,..._}}return S}))};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(),[N,S,_]=C;return{nodes:y.map(E=>({...E})),edges:x.map(E=>({...E})),viewport:{x:N,y:S,zoom:_}}},deleteElements:async({nodes:y=[],edges:x=[]})=>{const{nodes:C,edges:N,onNodesDelete:S,onEdgesDelete:_,triggerNodeChanges:E,triggerEdgeChanges:P,onDelete:k,onBeforeDelete:j}=r.getState(),{nodes:F,edges:L}=await Zw({nodesToRemove:y,edgesToRemove:x,nodes:C,edges:N,onBeforeDelete:j}),B=L.length>0,Z=F.length>0;if(B){const V=L.map(tp);_==null||_(L),P(V)}if(Z){const V=F.map(tp);S==null||S(F),E(V)}return(Z||B)&&(k==null||k({nodes:F,edges:L})),{deletedNodes:F,deletedEdges:L}},getIntersectingNodes:(y,x=!0,C)=>{const N=bh(y),S=N?y:m(y),_=C!==void 0;return S?(C||r.getState().nodes).filter(E=>{const P=r.getState().nodeLookup.get(E.id);if(P&&!N&&(E.id===y.id||!P.internals.positionAbsolute))return!1;const k=po(_?E:P),j=ps(k,S);return x&&j>0||j>=k.width*k.height||j>=S.width*S.height}):[]},isNodeIntersecting:(y,x,C=!0)=>{const S=bh(y)?y:m(y);if(!S)return!1;const _=ps(S,x);return C&&_>0||_>=x.width*x.height||_>=S.width*S.height},updateNode:g,updateNodeData:(y,x,C={replace:!1})=>{g(y,N=>{const S=typeof x=="function"?x(N):x;return C.replace?{...N,data:S}:{...N,data:{...N.data,...S}}},C)},updateEdge:v,updateEdgeData:(y,x,C={replace:!1})=>{v(y,N=>{const S=typeof x=="function"?x(N):x;return C.replace?{...N,data:S}:{...N,data:{...N.data,...S}}},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 N;return Array.from(((N=r.getState().connectionLookup.get(`${C}-${y}${x?`-${x}`:""}`))==null?void 0:N.values())??[])},getNodeConnections:({type:y,handleId:x,nodeId:C})=>{var N;return Array.from(((N=r.getState().connectionLookup.get(`${C}${y?x?`-${y}-${x}`:`-${y}`:""}`))==null?void 0:N.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=gs(t,{actInsideInputWithModifier:!1}),c=gs(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",Xn.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 aa={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=vi.Free,zoomOnDoubleClick:u=!0,panOnDrag:h=!0,defaultViewport:m,translateExtent:g,minZoom:v,maxZoom:y,zoomActivationKeyCode:x,preventScrolling:C=!0,children:N,noWheelClassName:S,noPanClassName:_,onViewportChange:E,isControlledViewport:P,paneClickDistance:k,selectionOnDrag:j}){const F=Je(),L=b.useRef(null),{userSelectionActive:B,lib:Z,connectionInProgress:V}=Oe(zS,Ze),J=gs(x),U=b.useRef();RS(L);const G=b.useCallback(te=>{E==null||E({x:te[0],y:te[1],zoom:te[2]}),P||F.setState({transform:te})},[E,P]);return b.useEffect(()=>{if(L.current){U.current=$1({domNode:L.current,minZoom:v,maxZoom:y,translateExtent:g,viewport:m,onDraggingChange:W=>F.setState({paneDragging:W}),onPanZoomStart:(W,K)=>{const{onViewportChangeStart:M,onMoveStart:A}=F.getState();A==null||A(W,K),M==null||M(K)},onPanZoom:(W,K)=>{const{onViewportChange:M,onMove:A}=F.getState();A==null||A(W,K),M==null||M(K)},onPanZoomEnd:(W,K)=>{const{onViewportChangeEnd:M,onMoveEnd:A}=F.getState();A==null||A(W,K),M==null||M(K)}});const{x:te,y:z,zoom:Q}=U.current.getViewport();return F.setState({panZoom:U.current,transform:[te,z,Q],domNode:L.current.closest(".react-flow")}),()=>{var W;(W=U.current)==null||W.destroy()}}},[]),b.useEffect(()=>{var te;(te=U.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:B,noWheelClassName:S,lib:Z,onTransformChange:G,connectionInProgress:V,selectionOnDrag:j,paneClickDistance:k})},[t,r,i,s,a,c,u,h,J,C,_,B,S,Z,G,V,j,k]),d.jsx("div",{className:"react-flow__renderer",ref:L,style:aa,children:N})}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 eu=(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 FS({isSelecting:t,selectionKeyPressed:r,selectionMode:i=fs.Full,panOnDrag:s,paneClickDistance:a,selectionOnDrag:c,onSelectionStart:u,onSelectionEnd:h,onPaneClick:m,onPaneContextMenu:g,onPaneScroll:v,onPaneMouseEnter:y,onPaneMouseMove:x,onPaneMouseLeave:C,children:N}){const S=Je(),{userSelectionActive:_,elementsSelectable:E,dragging:P,connectionInProgress:k}=Oe($S,Ze),j=E&&(t||_),F=b.useRef(null),L=b.useRef(),B=b.useRef(new Set),Z=b.useRef(new Set),V=b.useRef(!1),J=M=>{if(V.current||k){V.current=!1;return}m==null||m(M),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},U=M=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){M.preventDefault();return}g==null||g(M)},G=v?M=>v(M):void 0,te=M=>{V.current&&(M.stopPropagation(),V.current=!1)},z=M=>{var de,he;const{domNode:A}=S.getState();if(L.current=A==null?void 0:A.getBoundingClientRect(),!L.current)return;const Y=M.target===F.current;if(!Y&&!!M.target.closest(".nokey")||!t||!(c&&Y||r)||M.button!==0||!M.isPrimary)return;(he=(de=M.target)==null?void 0:de.setPointerCapture)==null||he.call(de,M.pointerId),V.current=!1;const{x:se,y:le}=jn(M.nativeEvent,L.current);S.setState({userSelectionRect:{width:0,height:0,startX:se,startY:le,x:se,y:le}}),Y||(M.stopPropagation(),M.preventDefault())},Q=M=>{const{userSelectionRect:A,transform:Y,nodeLookup:I,edgeLookup:$,connectionLookup:se,triggerNodeChanges:le,triggerEdgeChanges:de,defaultEdgeOptions:he,resetSelectedElements:me}=S.getState();if(!L.current||!A)return;const{x:oe,y:pe}=jn(M.nativeEvent,L.current),{startX:je,startY:Ie}=A;if(!V.current){const Ae=r?0:a;if(Math.hypot(oe-je,pe-Ie)<=Ae)return;me(),u==null||u(M)}V.current=!0;const ke={startX:je,startY:Ie,x:oe<je?oe:je,y:pe<Ie?pe:Ie,width:Math.abs(oe-je),height:Math.abs(pe-Ie)},Ne=B.current,$e=Z.current;B.current=new Set(ju(I,ke,Y,i===fs.Partial,!0).map(Ae=>Ae.id)),Z.current=new Set;const Fe=(he==null?void 0:he.selectable)??!0;for(const Ae of B.current){const et=se.get(Ae);if(et)for(const{edgeId:Pt}of et.values()){const wt=$.get(Pt);wt&&(wt.selectable??Fe)&&Z.current.add(Pt)}}if(!Mh(Ne,B.current)){const Ae=lo(I,B.current,!0);le(Ae)}if(!Mh($e,Z.current)){const Ae=lo($,Z.current);de(Ae)}S.setState({userSelectionRect:ke,userSelectionActive:!0,nodesSelectionActive:!1})},W=M=>{var A,Y;M.button===0&&((Y=(A=M.target)==null?void 0:A.releasePointerCapture)==null||Y.call(A,M.pointerId),!_&&M.target===F.current&&S.getState().userSelectionRect&&(J==null||J(M)),S.setState({userSelectionActive:!1,userSelectionRect:null}),V.current&&(h==null||h(M),S.setState({nodesSelectionActive:B.current.size>0})))},K=s===!0||Array.isArray(s)&&s.includes(0);return d.jsxs("div",{className:ut(["react-flow__pane",{draggable:K,dragging:P,selection:t}]),onClick:j?void 0:eu(J,F),onContextMenu:eu(U,F),onWheel:eu(G,F),onPointerEnter:j?void 0:y,onPointerMove:j?Q:x,onPointerUp:j?W:void 0,onPointerDownCapture:j?z:void 0,onClickCapture:j?te:void 0,onPointerLeave:C,ref:F,style:aa,children:[N,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",Xn.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 Um({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 OS=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Ym(){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=OS(u),C=a?c[0]:5,N=a?c[1]:5,S=i.direction.x*C*i.factor,_=i.direction.y*N*i.factor;for(const[,E]of g){if(!x(E))continue;let P={x:E.internals.positionAbsolute.x+S,y:E.internals.positionAbsolute.y+_};a&&(P=ks(P,c));const{position:k,positionAbsolute:j}=cm({nodeId:E.id,nextPosition:P,nodeLookup:g,nodeExtent:s,nodeOrigin:v,onError:h});E.position=k,E.internals.positionAbsolute=j,y.set(E.id,E)}m(y)},[])}const Lu=b.createContext(null),HS=Lu.Provider;Lu.Consumer;const Xm=()=>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===ki.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=Ce.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,W;const N=u||null,S=t==="target",_=Je(),E=Xm(),{connectOnClick:P,noPanClassName:k,rfId:j}=Oe(BS,Ze),{connectingFrom:F,connectingTo:L,clickConnecting:B,isPossibleEndHandle:Z,connectionInProcess:V,clickConnectionInProcess:J,valid:U}=Oe(VS(E,N,t),Ze);E||(W=(Q=_.getState()).onError)==null||W.call(Q,"010",Xn.error010());const G=K=>{const{defaultEdgeOptions:M,onConnect:A,hasDefaultEdges:Y}=_.getState(),I={...M,...K};if(Y){const{edges:$,setEdges:se}=_.getState();se(km(I,$))}A==null||A(I),h==null||h(I)},te=K=>{if(!E)return;const M=ym(K.nativeEvent);if(a&&(M&&K.button===0||!M)){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:S,handleId:N,nodeId:E,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})}M?v==null||v(K):y==null||y(K)},z=K=>{const{onClickConnectStart:M,onClickConnectEnd:A,connectionClickStartHandle:Y,connectionMode:I,isValidConnection:$,lib:se,rfId:le,nodeLookup:de,connection:he}=_.getState();if(!E||!Y&&!a)return;if(!Y){M==null||M(K.nativeEvent,{nodeId:E,handleId:N,handleType:t}),_.setState({connectionClickStartHandle:{nodeId:E,type:t,id:N}});return}const me=mm(K.target),oe=i||$,{connection:pe,isValid:je}=mu.isValid(K.nativeEvent,{handle:{nodeId:E,id:N,type:t},connectionMode:I,fromNodeId:Y.nodeId,fromHandleId:Y.id||null,fromType:Y.type,isValidConnection:oe,flowId:le,doc:me,lib:se,nodeLookup:de});je&&pe&&G(pe);const Ie=structuredClone(he);delete Ie.inProgress,Ie.toPosition=Ie.toHandle?Ie.toHandle.position:null,A==null||A(K,Ie),_.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":N,"data-nodeid":E,"data-handlepos":r,"data-id":`${j}-${E}-${N}-${t}`,className:ut(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",k,g,{source:!S,target:S,connectable:s,connectablestart:a,connectableend:c,clickconnecting:B,connectingfrom:F,connectingto:L,valid:U,connectionindicator:s&&(!V||Z)&&(V||J?c:a)}]),onMouseDown:te,onTouchStart:te,onClick:P?z:void 0,ref:C,...x,children:m})}const Vr=b.memo(Vm(WS));function US({data:t,isConnectable:r,sourcePosition:i=Ce.Bottom}){return d.jsxs(d.Fragment,{children:[t==null?void 0:t.label,d.jsx(Vr,{type:"source",position:i,isConnectable:r})]})}function YS({data:t,isConnectable:r,targetPosition:i=Ce.Top,sourcePosition:s=Ce.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(Vr,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,d.jsx(Vr,{type:"source",position:s,isConnectable:r})]})}function XS(){return null}function GS({data:t,isConnectable:r,targetPosition:i=Ce.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(Vr,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const Kl={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}=Ss(t.nodeLookup,{filter:c=>!!c.selected});return{width:_n(r)?r:null,height:_n(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=Ym(),g=b.useRef(null);if(b.useEffect(()=>{var x;i||(x=g.current)==null||x.focus({preventScroll:!0})},[i]),Um({nodeRef:g}),h||!a||!c)return null;const v=t?x=>{const C=s.getState().nodes.filter(N=>N.selected);t(x,C)}:void 0,y=x=>{Object.prototype.hasOwnProperty.call(Kl,x.key)&&(x.preventDefault(),m({direction:Kl[x.key],factor:x.shiftKey?4:1}))};return d.jsx("div",{className:ut(["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 Gm({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:N,panActivationKeyCode:S,zoomActivationKeyCode:_,elementsSelectable:E,zoomOnScroll:P,zoomOnPinch:k,panOnScroll:j,panOnScrollSpeed:F,panOnScrollMode:L,zoomOnDoubleClick:B,panOnDrag:Z,defaultViewport:V,translateExtent:J,minZoom:U,maxZoom:G,preventScrolling:te,onSelectionContextMenu:z,noWheelClassName:Q,noPanClassName:W,disableKeyboardA11y:K,onViewportChange:M,isControlledViewport:A}){const{nodesSelectionActive:Y,userSelectionActive:I}=Oe(ZS,Ze),$=gs(g,{target:sp}),se=gs(S,{target:sp}),le=se||Z,de=se||j,he=v&&le!==!0,me=$||I||he;return TS({deleteKeyCode:m,multiSelectionKeyCode:N}),d.jsx(AS,{onPaneContextMenu:c,elementsSelectable:E,zoomOnScroll:P,zoomOnPinch:k,panOnScroll:de,panOnScrollSpeed:F,panOnScrollMode:L,zoomOnDoubleClick:B,panOnDrag:!$&&le,defaultViewport:V,translateExtent:J,minZoom:U,maxZoom:G,zoomActivationKeyCode:_,preventScrolling:te,noWheelClassName:Q,noPanClassName:W,onViewportChange:M,isControlledViewport:A,paneClickDistance:h,selectionOnDrag:he,children:d.jsxs(FS,{onSelectionStart:x,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:le,isSelecting:!!me,selectionMode:y,selectionKeyPressed:$,paneClickDistance:h,selectionOnDrag:he,children:[t,Y&&d.jsx(qS,{onSelectionContextMenu:z,noPanClassName:W,disableKeyboardA11y:K})]})})}Gm.displayName="FlowRenderer";const JS=b.memo(Gm),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:N,rfId:S,nodeTypes:_,nodeClickDistance:E,onError:P}){const{node:k,internals:j,isParent:F}=Oe(oe=>{const pe=oe.nodeLookup.get(t),je=oe.parentLookup.has(t);return{node:pe,internals:pe.internals,isParent:je}},Ze);let L=k.type||"default",B=(_==null?void 0:_[L])||op[L];B===void 0&&(P==null||P("003",Xn.error003(L)),L="default",B=(_==null?void 0:_.default)||op.default);const Z=!!(k.draggable||h&&typeof k.draggable>"u"),V=!!(k.selectable||m&&typeof k.selectable>"u"),J=!!(k.connectable||g&&typeof k.connectable>"u"),U=!!(k.focusable||v&&typeof k.focusable>"u"),G=Je(),te=hm(k),z=ik({node:k,nodeType:L,hasDimensions:te,resizeObserver:y}),Q=Um({nodeRef:z,disabled:k.hidden||!Z,noDragClassName:x,handleSelector:k.dragHandle,nodeId:t,isSelectable:V,nodeClickDistance:E}),W=Ym();if(k.hidden)return null;const K=cr(k),M=KS(k),A=V||Z||r||i||s||a,Y=i?oe=>i(oe,{...j.userNode}):void 0,I=s?oe=>s(oe,{...j.userNode}):void 0,$=a?oe=>a(oe,{...j.userNode}):void 0,se=c?oe=>c(oe,{...j.userNode}):void 0,le=u?oe=>u(oe,{...j.userNode}):void 0,de=oe=>{const{selectNodesOnDrag:pe,nodeDragThreshold:je}=G.getState();V&&(!pe||!Z||je>0)&&gu({id:t,store:G,nodeRef:z}),r&&r(oe,{...j.userNode})},he=oe=>{if(!(gm(oe.nativeEvent)||N)){if(im.includes(oe.key)&&V){const pe=oe.key==="Escape";gu({id:t,store:G,unselect:pe,nodeRef:z})}else if(Z&&k.selected&&Object.prototype.hasOwnProperty.call(Kl,oe.key)){oe.preventDefault();const{ariaLabelConfig:pe}=G.getState();G.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:oe.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),W({direction:Kl[oe.key],factor:oe.shiftKey?4:1})}}},me=()=>{var $e;if(N||!(($e=z.current)!=null&&$e.matches(":focus-visible")))return;const{transform:oe,width:pe,height:je,autoPanOnNodeFocus:Ie,setCenter:ke}=G.getState();if(!Ie)return;ju(new Map([[t,k]]),{x:0,y:0,width:pe,height:je},oe,!0).length>0||ke(k.position.x+K.width/2,k.position.y+K.height/2,{zoom:oe[2]})};return d.jsx("div",{className:ut(["react-flow__node",`react-flow__node-${L}`,{[C]:Z},k.className,{selected:k.selected,selectable:V,parent:F,draggable:Z,dragging:Q}]),ref:z,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:A?"all":"none",visibility:te?"visible":"hidden",...k.style,...M},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:Y,onMouseMove:I,onMouseLeave:$,onContextMenu:se,onClick:de,onDoubleClick:le,onKeyDown:U?he:void 0,tabIndex:U?0:void 0,onFocus:U?me:void 0,role:k.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":N?void 0:`${Dm}-${S}`,"aria-label":k.ariaLabel,...k.domAttributes,children:d.jsx(HS,{value:t,children:d.jsx(B,{id:t,data:k.data,type:L,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:k.selected??!1,selectable:V,draggable:Z,deletable:k.deletable??!0,isConnectable:J,sourcePosition:k.sourcePosition,targetPosition:k.targetPosition,dragging:Q,dragHandle:k.dragHandle,zIndex:j.z,parentId:k.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 Km(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:aa,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))})}Km.displayName="NodeRenderer";const ak=b.memo(Km);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={[hs.Arrow]:uk,[hs.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",Xn.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 qm({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=ut(["react-flow__edge-textwrapper",g]),N=b.useRef(null);return b.useEffect(()=>{if(N.current){const S=N.current.getBBox();x({x:S.x,y:S.y,width:S.width,height:S.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:N,style:s,children:i}),m]}):null}qm.displayName="EdgeText";const mk=b.memo(qm);function ca({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:ut(["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&&_n(r)&&_n(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===Ce.Left||t===Ce.Right?[.5*(r+s),i]:[r,.5*(i+a)]}function Zm({sourceX:t,sourceY:r,sourcePosition:i=Ce.Bottom,targetX:s,targetY:a,targetPosition:c=Ce.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]=vm({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 Jm(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:N,markerEnd:S,markerStart:_,interactionWidth:E})=>{const[P,k,j]=Zm({sourceX:i,sourceY:s,sourcePosition:u,targetX:a,targetY:c,targetPosition:h}),F=t.isInternal?void 0:r;return d.jsx(ca,{id:F,path:P,labelX:k,labelY:j,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:N,markerEnd:S,markerStart:_,interactionWidth:E})})}const gk=Jm({isInternal:!1}),eg=Jm({isInternal:!0});gk.displayName="SimpleBezierEdge";eg.displayName="SimpleBezierEdgeInternal";function tg(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=Ce.Bottom,targetPosition:N=Ce.Top,markerEnd:S,markerStart:_,pathOptions:E,interactionWidth:P})=>{const[k,j,F]=fu({sourceX:i,sourceY:s,sourcePosition:C,targetX:a,targetY:c,targetPosition:N,borderRadius:E==null?void 0:E.borderRadius,offset:E==null?void 0:E.offset,stepPosition:E==null?void 0:E.stepPosition}),L=t.isInternal?void 0:r;return d.jsx(ca,{id:L,path:k,labelX:j,labelY:F,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:S,markerStart:_,interactionWidth:P})})}const ng=tg({isInternal:!1}),rg=tg({isInternal:!0});ng.displayName="SmoothStepEdge";rg.displayName="SmoothStepEdgeInternal";function ig(t){return b.memo(({id:r,...i})=>{var a;const s=t.isInternal?void 0:r;return d.jsx(ng,{...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=ig({isInternal:!1}),og=ig({isInternal:!0});yk.displayName="StepEdge";og.displayName="StepEdgeInternal";function sg(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:N,interactionWidth:S})=>{const[_,E,P]=Nm({sourceX:i,sourceY:s,targetX:a,targetY:c}),k=t.isInternal?void 0:r;return d.jsx(ca,{id:k,path:_,labelX:E,labelY:P,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:C,markerStart:N,interactionWidth:S})})}const vk=sg({isInternal:!1}),lg=sg({isInternal:!0});vk.displayName="StraightEdge";lg.displayName="StraightEdgeInternal";function ag(t){return b.memo(({id:r,sourceX:i,sourceY:s,targetX:a,targetY:c,sourcePosition:u=Ce.Bottom,targetPosition:h=Ce.Top,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:N,markerEnd:S,markerStart:_,pathOptions:E,interactionWidth:P})=>{const[k,j,F]=xm({sourceX:i,sourceY:s,sourcePosition:u,targetX:a,targetY:c,targetPosition:h,curvature:E==null?void 0:E.curvature}),L=t.isInternal?void 0:r;return d.jsx(ca,{id:L,path:k,labelX:j,labelY:F,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:C,style:N,markerEnd:S,markerStart:_,interactionWidth:P})})}const xk=ag({isInternal:!1}),cg=ag({isInternal:!0});xk.displayName="BezierEdge";cg.displayName="BezierEdgeInternal";const cp={default:cg,straight:lg,step:og,smoothstep:rg,simplebezier:eg},up={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},wk=(t,r,i)=>i===Ce.Left?t-r:i===Ce.Right?t+r:t,Sk=(t,r,i)=>i===Ce.Top?t-r:i===Ce.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:ut([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 N=Je(),S=(j,F)=>{if(j.button!==0)return;const{autoPanOnConnect:L,domNode:B,isValidConnection:Z,connectionMode:V,connectionRadius:J,lib:U,onConnectStart:G,onConnectEnd:te,cancelConnection:z,nodeLookup:Q,rfId:W,panBy:K,updateConnection:M}=N.getState(),A=F.type==="target",Y=(se,le)=>{x(!1),y==null||y(se,i,F.type,le)},I=se=>g==null?void 0:g(i,se),$=(se,le)=>{x(!0),v==null||v(j,i,F.type),G==null||G(se,le)};mu.onPointerDown(j.nativeEvent,{autoPanOnConnect:L,connectionMode:V,connectionRadius:J,domNode:B,handleId:F.id,nodeId:F.nodeId,nodeLookup:Q,isTarget:A,edgeUpdaterType:F.type,lib:U,flowId:W,cancelConnection:z,panBy:K,isValidConnection:Z,onConnect:I,onConnectStart:$,onConnectEnd:te,onReconnectEnd:Y,updateConnection:M,getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,dragThreshold:N.getState().connectionDragThreshold,handleDomNode:j.currentTarget})},_=j=>S(j,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),E=j=>S(j,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),P=()=>C(!0),k=()=>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:P,onMouseOut:k,type:"source"}),(t===!0||t==="target")&&d.jsx(fp,{position:m,centerX:c,centerY:u,radius:r,onMouseDown:E,onMouseEnter:P,onMouseOut:k,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:N,edgeTypes:S,noPanClassName:_,onError:E,disableKeyboardA11y:P}){let k=Oe(ke=>ke.edgeLookup.get(t));const j=Oe(ke=>ke.defaultEdgeOptions);k=j?{...j,...k}:k;let F=k.type||"default",L=(S==null?void 0:S[F])||cp[F];L===void 0&&(E==null||E("011",Xn.error011(F)),F="default",L=(S==null?void 0:S.default)||cp.default);const B=!!(k.focusable||r&&typeof k.focusable>"u"),Z=typeof y<"u"&&(k.reconnectable||i&&typeof k.reconnectable>"u"),V=!!(k.selectable||s&&typeof k.selectable>"u"),J=b.useRef(null),[U,G]=b.useState(!1),[te,z]=b.useState(!1),Q=Je(),{zIndex:W,sourceX:K,sourceY:M,targetX:A,targetY:Y,sourcePosition:I,targetPosition:$}=Oe(b.useCallback(ke=>{const Ne=ke.nodeLookup.get(k.source),$e=ke.nodeLookup.get(k.target);if(!Ne||!$e)return{zIndex:k.zIndex,...up};const Fe=f1({id:t,sourceNode:Ne,targetNode:$e,sourceHandle:k.sourceHandle||null,targetHandle:k.targetHandle||null,connectionMode:ke.connectionMode,onError:E});return{zIndex:o1({selected:k.selected,zIndex:k.zIndex,sourceNode:Ne,targetNode:$e,elevateOnSelect:ke.elevateEdgesOnSelect,zIndexMode:ke.zIndexMode}),...Fe||up}},[k.source,k.target,k.sourceHandle,k.targetHandle,k.selected,k.zIndex]),Ze),se=b.useMemo(()=>k.markerStart?`url('#${hu(k.markerStart,N)}')`:void 0,[k.markerStart,N]),le=b.useMemo(()=>k.markerEnd?`url('#${hu(k.markerEnd,N)}')`:void 0,[k.markerEnd,N]);if(k.hidden||K===null||M===null||A===null||Y===null)return null;const de=ke=>{var Ae;const{addSelectedEdges:Ne,unselectNodesAndEdges:$e,multiSelectionActive:Fe}=Q.getState();V&&(Q.setState({nodesSelectionActive:!1}),k.selected&&Fe?($e({nodes:[],edges:[k]}),(Ae=J.current)==null||Ae.blur()):Ne([t])),a&&a(ke,k)},he=c?ke=>{c(ke,{...k})}:void 0,me=u?ke=>{u(ke,{...k})}:void 0,oe=h?ke=>{h(ke,{...k})}:void 0,pe=m?ke=>{m(ke,{...k})}:void 0,je=g?ke=>{g(ke,{...k})}:void 0,Ie=ke=>{var Ne;if(!P&&im.includes(ke.key)&&V){const{unselectNodesAndEdges:$e,addSelectedEdges:Fe}=Q.getState();ke.key==="Escape"?((Ne=J.current)==null||Ne.blur(),$e({edges:[k]})):Fe([t])}};return d.jsx("svg",{style:{zIndex:W},children:d.jsxs("g",{className:ut(["react-flow__edge",`react-flow__edge-${F}`,k.className,_,{selected:k.selected,animated:k.animated,inactive:!V&&!a,updating:U,selectable:V}]),onClick:de,onDoubleClick:he,onContextMenu:me,onMouseEnter:oe,onMouseMove:pe,onMouseLeave:je,onKeyDown:B?Ie:void 0,tabIndex:B?0:void 0,role:k.ariaRole??(B?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":k.ariaLabel===null?void 0:k.ariaLabel||`Edge from ${k.source} to ${k.target}`,"aria-describedby":B?`${$m}-${N}`:void 0,ref:J,...k.domAttributes,children:[!te&&d.jsx(L,{id:t,source:k.source,target:k.target,type:k.type,selected:k.selected,animated:k.animated,selectable:V,deletable:k.deletable??!0,label:k.label,labelStyle:k.labelStyle,labelShowBg:k.labelShowBg,labelBgStyle:k.labelBgStyle,labelBgPadding:k.labelBgPadding,labelBgBorderRadius:k.labelBgBorderRadius,sourceX:K,sourceY:M,targetX:A,targetY:Y,sourcePosition:I,targetPosition:$,data:k.data,style:k.style,sourceHandleId:k.sourceHandle,targetHandleId:k.targetHandle,markerStart:se,markerEnd:le,pathOptions:"pathOptions"in k?k.pathOptions:void 0,interactionWidth:k.interactionWidth}),Z&&d.jsx(kk,{edge:k,isReconnectable:Z,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:C,sourceX:K,sourceY:M,targetX:A,targetY:Y,sourcePosition:I,targetPosition:$,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 ug({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:N,disableKeyboardA11y:S}){const{edgesFocusable:_,edgesReconnectable:E,elementsSelectable:P,onError:k}=Oe(Ck,Ze),j=ck(r);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(pk,{defaultColor:t,rfId:i}),j.map(F=>d.jsx(Ek,{id:F,edgesFocusable:_,edgesReconnectable:E,elementsSelectable:P,noPanClassName:a,onReconnect:c,onContextMenu:u,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,onClick:v,reconnectRadius:y,onDoubleClick:x,onReconnectStart:C,onReconnectEnd:N,rfId:i,onError:k,edgeTypes:s,disableKeyboardA11y:S},F))]})}ug.displayName="EdgeRenderer";const _k=b.memo(ug),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:Ns(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:ut(["react-flow__connection",lm(h)]),children:d.jsx(dg,{style:r,type:i,CustomComponent:s,isValid:h})})})}const dg=({style:t,type:r=Br.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:lm(s),toNode:v,toHandle:y,pointer:C});let N="";const S={sourceX:c.x,sourceY:c.y,sourcePosition:m,targetX:g.x,targetY:g.y,targetPosition:x};switch(r){case Br.Bezier:[N]=xm(S);break;case Br.SimpleBezier:[N]=Zm(S);break;case Br.Step:[N]=fu({...S,borderRadius:0});break;case Br.SmoothStep:[N]=fu(S);break;default:[N]=Nm(S)}return d.jsx("path",{d:N,fill:"none",className:"react-flow__connection-path",style:t})};dg.displayName="ConnectionLine";const Dk={};function hp(t=Dk){b.useRef(t),Je(),b.useEffect(()=>{},[t])}function $k(){Je(),b.useRef(!1),b.useEffect(()=>{},[])}function fg({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:N,connectionLineStyle:S,connectionLineComponent:_,connectionLineContainerStyle:E,selectionKeyCode:P,selectionOnDrag:k,selectionMode:j,multiSelectionKeyCode:F,panActivationKeyCode:L,zoomActivationKeyCode:B,deleteKeyCode:Z,onlyRenderVisibleElements:V,elementsSelectable:J,defaultViewport:U,translateExtent:G,minZoom:te,maxZoom:z,preventScrolling:Q,defaultMarkerColor:W,zoomOnScroll:K,zoomOnPinch:M,panOnScroll:A,panOnScrollSpeed:Y,panOnScrollMode:I,zoomOnDoubleClick:$,panOnDrag:se,onPaneClick:le,onPaneMouseEnter:de,onPaneMouseMove:he,onPaneMouseLeave:me,onPaneScroll:oe,onPaneContextMenu:pe,paneClickDistance:je,nodeClickDistance:Ie,onEdgeContextMenu:ke,onEdgeMouseEnter:Ne,onEdgeMouseMove:$e,onEdgeMouseLeave:Fe,reconnectRadius:Ae,onReconnect:et,onReconnectStart:Pt,onReconnectEnd:wt,noDragClassName:gt,noWheelClassName:St,noPanClassName:Ut,disableKeyboardA11y:Yt,nodeExtent:ur,rfId:Kn,viewport:be,onViewportChange:nn}){return hp(t),hp(r),$k(),Mk(i),Ik(be),d.jsx(JS,{onPaneClick:le,onPaneMouseEnter:de,onPaneMouseMove:he,onPaneMouseLeave:me,onPaneContextMenu:pe,onPaneScroll:oe,paneClickDistance:je,deleteKeyCode:Z,selectionKeyCode:P,selectionOnDrag:k,selectionMode:j,onSelectionStart:x,onSelectionEnd:C,multiSelectionKeyCode:F,panActivationKeyCode:L,zoomActivationKeyCode:B,elementsSelectable:J,zoomOnScroll:K,zoomOnPinch:M,zoomOnDoubleClick:$,panOnScroll:A,panOnScrollSpeed:Y,panOnScrollMode:I,panOnDrag:se,defaultViewport:U,translateExtent:G,minZoom:te,maxZoom:z,onSelectionContextMenu:y,preventScrolling:Q,noDragClassName:gt,noWheelClassName:St,noPanClassName:Ut,disableKeyboardA11y:Yt,onViewportChange:nn,isControlledViewport:!!be,children:d.jsxs(bk,{children:[d.jsx(_k,{edgeTypes:r,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:et,onReconnectStart:Pt,onReconnectEnd:wt,onlyRenderVisibleElements:V,onEdgeContextMenu:ke,onEdgeMouseEnter:Ne,onEdgeMouseMove:$e,onEdgeMouseLeave:Fe,reconnectRadius:Ae,defaultMarkerColor:W,noPanClassName:Ut,disableKeyboardA11y:Yt,rfId:Kn}),d.jsx(Lk,{style:S,type:N,component:_,containerStyle:E}),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:Ie,onlyRenderVisibleElements:V,noPanClassName:Ut,noDragClassName:gt,disableKeyboardA11y:Yt,nodeExtent:ur,rfId:Kn}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}fg.displayName="GraphView";const Fk=b.memo(fg),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,N=new Map,S=new Map,_=new Map,E=s??r??[],P=i??t??[],k=v??[0,0],j=y??ds;_m(S,_,E);const F=pu(P,C,N,{nodeOrigin:k,nodeExtent:j,zIndexMode:x});let L=[0,0,1];if(u&&a&&c){const B=Ss(C,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:Z,y:V,zoom:J}=bu(B,a,c,m,g,(h==null?void 0:h.padding)??.1);L=[Z,V,J]}return{rfId:"1",width:a??0,height:c??0,transform:L,nodes:P,nodesInitialized:F,nodeLookup:C,parentLookup:N,edges:E,edgeLookup:_,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:m,maxZoom:g,translateExtent:ds,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ki.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:k,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:{...sm},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:om,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Ok=({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,N)=>{async function S(){const{nodeLookup:_,panZoom:E,fitViewOptions:P,fitViewResolver:k,width:j,height:F,minZoom:L,maxZoom:B}=N();E&&(await qw({nodes:_,width:j,height:F,panZoom:E,minZoom:L,maxZoom:B},P),k==null||k.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:E,parentLookup:P,nodeOrigin:k,elevateNodesOnSelect:j,fitViewQueued:F,zIndexMode:L}=N(),B=pu(_,E,P,{nodeOrigin:k,nodeExtent:y,elevateNodesOnSelect:j,checkEquality:!0,zIndexMode:L});F&&B?(S(),C({nodes:_,nodesInitialized:B,fitViewQueued:!1,fitViewOptions:void 0})):C({nodes:_,nodesInitialized:B})},setEdges:_=>{const{connectionLookup:E,edgeLookup:P}=N();_m(E,P,_),C({edges:_})},setDefaultNodesAndEdges:(_,E)=>{if(_){const{setNodes:P}=N();P(_),C({hasDefaultNodes:!0})}if(E){const{setEdges:P}=N();P(E),C({hasDefaultEdges:!0})}},updateNodeInternals:_=>{const{triggerNodeChanges:E,nodeLookup:P,parentLookup:k,domNode:j,nodeOrigin:F,nodeExtent:L,debug:B,fitViewQueued:Z,zIndexMode:V}=N(),{changes:J,updatedInternals:U}=w1(_,P,k,j,F,L,V);U&&(g1(P,k,{nodeOrigin:F,nodeExtent:L,zIndexMode:V}),Z?(S(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(J==null?void 0:J.length)>0&&(B&&console.log("React Flow: trigger node changes",J),E==null||E(J)))},updateNodePositions:(_,E=!1)=>{const P=[];let k=[];const{nodeLookup:j,triggerNodeChanges:F,connection:L,updateConnection:B,onNodesChangeMiddlewareMap:Z}=N();for(const[V,J]of _){const U=j.get(V),G=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(J!=null&&J.position)),te={id:V,type:"position",position:G?{x:Math.max(0,J.position.x),y:Math.max(0,J.position.y)}:J.position,dragging:E};if(U&&L.inProgress&&L.fromNode.id===U.id){const z=Ei(U,L.fromHandle,Ce.Left,!0);B({...L,from:z})}G&&U.parentId&&P.push({id:V,parentId:U.parentId,rect:{...J.internals.positionAbsolute,width:J.measured.width??0,height:J.measured.height??0}}),k.push(te)}if(P.length>0){const{parentLookup:V,nodeOrigin:J}=N(),U=zu(P,j,V,J);k.push(...U)}for(const V of Z.values())k=V(k);F(k)},triggerNodeChanges:_=>{const{onNodesChange:E,setNodes:P,nodes:k,hasDefaultNodes:j,debug:F}=N();if(_!=null&&_.length){if(j){const L=Hm(_,k);P(L)}F&&console.log("React Flow: trigger node changes",_),E==null||E(_)}},triggerEdgeChanges:_=>{const{onEdgesChange:E,setEdges:P,edges:k,hasDefaultEdges:j,debug:F}=N();if(_!=null&&_.length){if(j){const L=Bm(_,k);P(L)}F&&console.log("React Flow: trigger edge changes",_),E==null||E(_)}},addSelectedNodes:_=>{const{multiSelectionActive:E,edgeLookup:P,nodeLookup:k,triggerNodeChanges:j,triggerEdgeChanges:F}=N();if(E){const L=_.map(B=>mi(B,!0));j(L);return}j(lo(k,new Set([..._]),!0)),F(lo(P))},addSelectedEdges:_=>{const{multiSelectionActive:E,edgeLookup:P,nodeLookup:k,triggerNodeChanges:j,triggerEdgeChanges:F}=N();if(E){const L=_.map(B=>mi(B,!0));F(L);return}F(lo(P,new Set([..._]))),j(lo(k,new Set,!0))},unselectNodesAndEdges:({nodes:_,edges:E}={})=>{const{edges:P,nodes:k,nodeLookup:j,triggerNodeChanges:F,triggerEdgeChanges:L}=N(),B=_||k,Z=E||P,V=B.map(U=>{const G=j.get(U.id);return G&&(G.selected=!1),mi(U.id,!1)}),J=Z.map(U=>mi(U.id,!1));F(V),L(J)},setMinZoom:_=>{const{panZoom:E,maxZoom:P}=N();E==null||E.setScaleExtent([_,P]),C({minZoom:_})},setMaxZoom:_=>{const{panZoom:E,minZoom:P}=N();E==null||E.setScaleExtent([P,_]),C({maxZoom:_})},setTranslateExtent:_=>{var E;(E=N().panZoom)==null||E.setTranslateExtent(_),C({translateExtent:_})},resetSelectedElements:()=>{const{edges:_,nodes:E,triggerNodeChanges:P,triggerEdgeChanges:k,elementsSelectable:j}=N();if(!j)return;const F=E.reduce((B,Z)=>Z.selected?[...B,mi(Z.id,!1)]:B,[]),L=_.reduce((B,Z)=>Z.selected?[...B,mi(Z.id,!1)]:B,[]);P(F),k(L)},setNodeExtent:_=>{const{nodes:E,nodeLookup:P,parentLookup:k,nodeOrigin:j,elevateNodesOnSelect:F,nodeExtent:L,zIndexMode:B}=N();_[0][0]===L[0][0]&&_[0][1]===L[0][1]&&_[1][0]===L[1][0]&&_[1][1]===L[1][1]||(pu(E,P,k,{nodeOrigin:j,nodeExtent:_,elevateNodesOnSelect:F,checkEquality:!1,zIndexMode:B}),C({nodeExtent:_}))},panBy:_=>{const{transform:E,width:P,height:k,panZoom:j,translateExtent:F}=N();return S1({delta:_,panZoom:j,transform:E,translateExtent:F,width:P,height:k})},setCenter:async(_,E,P)=>{const{width:k,height:j,maxZoom:F,panZoom:L}=N();if(!L)return Promise.resolve(!1);const B=typeof(P==null?void 0:P.zoom)<"u"?P.zoom:F;return await L.setViewport({x:k/2-_*B,y:j/2-E*B,zoom:B},{duration:P==null?void 0:P.duration,ease:P==null?void 0:P.ease,interpolate:P==null?void 0:P.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...sm}})},updateConnection:_=>{C({connection:_})},reset:()=>C({...pp()})}},Object.is);function hg({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[N]=b.useState(()=>Ok({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:N,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(sa)?d.jsx(d.Fragment,{children:t}):d.jsx(hg,{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:N,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:E,onNodeMouseEnter:P,onNodeMouseMove:k,onNodeMouseLeave:j,onNodeContextMenu:F,onNodeDoubleClick:L,onNodeDragStart:B,onNodeDrag:Z,onNodeDragStop:V,onNodesDelete:J,onEdgesDelete:U,onDelete:G,onSelectionChange:te,onSelectionDragStart:z,onSelectionDrag:Q,onSelectionDragStop:W,onSelectionContextMenu:K,onSelectionStart:M,onSelectionEnd:A,onBeforeDelete:Y,connectionMode:I,connectionLineType:$=Br.Bezier,connectionLineStyle:se,connectionLineComponent:le,connectionLineContainerStyle:de,deleteKeyCode:he="Backspace",selectionKeyCode:me="Shift",selectionOnDrag:oe=!1,selectionMode:pe=fs.Full,panActivationKeyCode:je="Space",multiSelectionKeyCode:Ie=ms()?"Meta":"Control",zoomActivationKeyCode:ke=ms()?"Meta":"Control",snapToGrid:Ne,snapGrid:$e,onlyRenderVisibleElements:Fe=!1,selectNodesOnDrag:Ae,nodesDraggable:et,autoPanOnNodeFocus:Pt,nodesConnectable:wt,nodesFocusable:gt,nodeOrigin:St=Fm,edgesFocusable:Ut,edgesReconnectable:Yt,elementsSelectable:ur=!0,defaultViewport:Kn=vS,minZoom:be=.5,maxZoom:nn=2,translateExtent:rn=ds,preventScrolling:Yr=!0,nodeExtent:fn,defaultMarkerColor:hn="#b1b1b7",zoomOnScroll:zt=!0,zoomOnPinch:Xr=!0,panOnScroll:Gr=!1,panOnScrollSpeed:go=.5,panOnScrollMode:dr=vi.Free,zoomOnDoubleClick:fr=!0,panOnDrag:hr=!0,onPaneClick:Xt,onPaneMouseEnter:Kr,onPaneMouseMove:It,onPaneMouseLeave:yt,onPaneScroll:pr,onPaneContextMenu:Qr,paneClickDistance:pn=1,nodeClickDistance:mr=0,children:_i,onReconnect:qr,onReconnectStart:gr,onReconnectEnd:mn,onEdgeContextMenu:Mn,onEdgeDoubleClick:yr,onEdgeMouseEnter:At,onEdgeMouseMove:Pn,onEdgeMouseLeave:lt,reconnectRadius:vr=10,onNodesChange:kt,onEdgesChange:ji,noDragClassName:In="nodrag",noWheelClassName:yo="nowheel",noPanClassName:Nt="nopan",fitView:tt,fitViewOptions:xr,connectOnClick:Qn,attributionPosition:Zr,proOptions:Jr,defaultEdgeOptions:Gt,elevateNodesOnSelect:Tn=!0,elevateEdgesOnSelect:vo=!1,disableKeyboardA11y:bi=!1,autoPanOnConnect:Ge,autoPanOnNodeDrag:Mi,autoPanSpeed:wr,connectionRadius:Pi,isValidConnection:Sr,onError:xo,style:Ii,id:Rn,nodeDragThreshold:Et,connectionDragThreshold:kr,viewport:Ct,onViewportChange:zn,width:wo,height:So,colorMode:gn="light",debug:Ye,onScroll:Lt,ariaLabelConfig:Nr,zIndexMode:Ti="basic",...ko},ei){const An=Rn||"1",ti=kS(gn),Ln=b.useCallback(ni=>{ni.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Lt==null||Lt(ni)},[Lt]);return d.jsx("div",{"data-testid":"rf__wrapper",...ko,onScroll:Ln,style:{...Ii,...Bk},ref:ei,className:ut(["react-flow",a,ti]),id:Rn,role:"application",children:d.jsxs(Hk,{nodes:t,edges:r,width:wo,height:So,fitView:tt,fitViewOptions:xr,minZoom:be,maxZoom:nn,nodeOrigin:St,nodeExtent:fn,zIndexMode:Ti,children:[d.jsx(Fk,{onInit:g,onNodeClick:h,onEdgeClick:m,onNodeMouseEnter:P,onNodeMouseMove:k,onNodeMouseLeave:j,onNodeContextMenu:F,onNodeDoubleClick:L,nodeTypes:c,edgeTypes:u,connectionLineType:$,connectionLineStyle:se,connectionLineComponent:le,connectionLineContainerStyle:de,selectionKeyCode:me,selectionOnDrag:oe,selectionMode:pe,deleteKeyCode:he,multiSelectionKeyCode:Ie,panActivationKeyCode:je,zoomActivationKeyCode:ke,onlyRenderVisibleElements:Fe,defaultViewport:Kn,translateExtent:rn,minZoom:be,maxZoom:nn,preventScrolling:Yr,zoomOnScroll:zt,zoomOnPinch:Xr,zoomOnDoubleClick:fr,panOnScroll:Gr,panOnScrollSpeed:go,panOnScrollMode:dr,panOnDrag:hr,onPaneClick:Xt,onPaneMouseEnter:Kr,onPaneMouseMove:It,onPaneMouseLeave:yt,onPaneScroll:pr,onPaneContextMenu:Qr,paneClickDistance:pn,nodeClickDistance:mr,onSelectionContextMenu:K,onSelectionStart:M,onSelectionEnd:A,onReconnect:qr,onReconnectStart:gr,onReconnectEnd:mn,onEdgeContextMenu:Mn,onEdgeDoubleClick:yr,onEdgeMouseEnter:At,onEdgeMouseMove:Pn,onEdgeMouseLeave:lt,reconnectRadius:vr,defaultMarkerColor:hn,noDragClassName:In,noWheelClassName:yo,noPanClassName:Nt,rfId:An,disableKeyboardA11y:bi,nodeExtent:fn,viewport:Ct,onViewportChange:zn}),d.jsx(SS,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:N,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:E,nodesDraggable:et,autoPanOnNodeFocus:Pt,nodesConnectable:wt,nodesFocusable:gt,edgesFocusable:Ut,edgesReconnectable:Yt,elementsSelectable:ur,elevateNodesOnSelect:Tn,elevateEdgesOnSelect:vo,minZoom:be,maxZoom:nn,nodeExtent:fn,onNodesChange:kt,onEdgesChange:ji,snapToGrid:Ne,snapGrid:$e,connectionMode:I,translateExtent:rn,connectOnClick:Qn,defaultEdgeOptions:Gt,fitView:tt,fitViewOptions:xr,onNodesDelete:J,onEdgesDelete:U,onDelete:G,onNodeDragStart:B,onNodeDrag:Z,onNodeDragStop:V,onSelectionDrag:Q,onSelectionDragStart:z,onSelectionDragStop:W,onMove:v,onMoveStart:y,onMoveEnd:x,noPanClassName:Nt,nodeOrigin:St,rfId:An,autoPanOnConnect:Ge,autoPanOnNodeDrag:Mi,autoPanSpeed:wr,onError:xo,connectionRadius:Pi,isValidConnection:Sr,selectNodesOnDrag:Ae,nodeDragThreshold:Et,connectionDragThreshold:kr,onBeforeDelete:Y,debug:Ye,ariaLabelConfig:Nr,zIndexMode:Ti}),d.jsx(yS,{onSelectionChange:te}),_i,d.jsx(fS,{proOptions:Jr,position:Zr}),d.jsx(dS,{rfId:An,disableKeyboardA11y:bi})]})})}var pg=Vm(Vk);function Wk(t){const[r,i]=b.useState(t),s=b.useCallback(a=>i(c=>Hm(a,c)),[]);return[r,i,s]}function Uk(t){const[r,i]=b.useState(t),s=b.useCallback(a=>i(c=>Bm(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:ut(["react-flow__background-pattern",i,s])})}function Xk({radius:t,className:r}){return d.jsx("circle",{cx:t,cy:t,r:t,className:ut(["react-flow__background-pattern","dots",r])})}var Yn;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Yn||(Yn={}));const Gk={[Yn.Dots]:1,[Yn.Lines]:1,[Yn.Cross]:6},Kk=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function mg({id:t,variant:r=Yn.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),N=s||Gk[r],S=r===Yn.Dots,_=r===Yn.Cross,E=Array.isArray(i)?i:[i,i],P=[E[0]*x[2]||1,E[1]*x[2]||1],k=N*x[2],j=Array.isArray(c)?c:[c,c],F=_?[k,k]:P,L=[j[0]*x[2]||1+F[0]/2,j[1]*x[2]||1+F[1]/2],B=`${C}${t||""}`;return d.jsxs("svg",{className:ut(["react-flow__background",g]),style:{...m,...aa,"--xy-background-color-props":h,"--xy-background-pattern-color-props":u},ref:y,"data-testid":"rf__background",children:[d.jsx("pattern",{id:B,x:x[0]%P[0],y:x[1]%P[1],width:P[0],height:P[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:S?d.jsx(Xk,{radius:k/2,className:v}):d.jsx(Yk,{dimensions:F,lineWidth:a,variant:r,className:v})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${B})`})]})}mg.displayName="Background";const gg=b.memo(mg);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 zl({children:t,className:r,...i}){return d.jsx("button",{type:"button",className:ut(["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 yg({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 N=Je(),{isInteractive:S,minZoomReached:_,maxZoomReached:E,ariaLabelConfig:P}=Oe(tN,Ze),{zoomIn:k,zoomOut:j,fitView:F}=Au(),L=()=>{k(),c==null||c()},B=()=>{j(),u==null||u()},Z=()=>{F(a),h==null||h()},V=()=>{N.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),m==null||m(!S)},J=x==="horizontal"?"horizontal":"vertical";return d.jsxs(la,{className:ut(["react-flow__controls",J,g]),position:y,style:t,"data-testid":"rf__controls","aria-label":C??P["controls.ariaLabel"],children:[r&&d.jsxs(d.Fragment,{children:[d.jsx(zl,{onClick:L,className:"react-flow__controls-zoomin",title:P["controls.zoomIn.ariaLabel"],"aria-label":P["controls.zoomIn.ariaLabel"],disabled:E,children:d.jsx(Qk,{})}),d.jsx(zl,{onClick:B,className:"react-flow__controls-zoomout",title:P["controls.zoomOut.ariaLabel"],"aria-label":P["controls.zoomOut.ariaLabel"],disabled:_,children:d.jsx(qk,{})})]}),i&&d.jsx(zl,{className:"react-flow__controls-fitview",onClick:Z,title:P["controls.fitView.ariaLabel"],"aria-label":P["controls.fitView.ariaLabel"],children:d.jsx(Zk,{})}),s&&d.jsx(zl,{className:"react-flow__controls-interactive",onClick:V,title:P["controls.interactive.ariaLabel"],"aria-label":P["controls.interactive.ariaLabel"],children:S?d.jsx(eN,{}):d.jsx(Jk,{})}),v]})}yg.displayName="Controls";const vg=b.memo(yg);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:N,backgroundColor:S}=c||{},_=u||N||S;return d.jsx("rect",{className:ut(["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?E=>C(E,t):void 0})}const rN=b.memo(nN),iN=t=>t.nodes.map(r=>r.id),tu=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=tu(r),g=tu(t),v=tu(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(N=>{const{internals:S}=N.nodeLookup.get(t),_=S.userNode,{x:E,y:P}=S.positionAbsolute,{width:k,height:j}=cr(_);return{node:_,x:E,y:P,width:k,height:j}},Ze);return!g||g.hidden||!hm(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?fm(Ss(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 xg({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:N,pannable:S=!1,zoomable:_=!1,ariaLabel:E,inversePan:P,zoomStep:k=1,offsetScale:j=5}){const F=Je(),L=b.useRef(null),{boundingRect:B,viewBB:Z,rfId:V,panZoom:J,translateExtent:U,flowWidth:G,flowHeight:te,ariaLabelConfig:z}=Oe(fN,Ze),Q=(t==null?void 0:t.width)??cN,W=(t==null?void 0:t.height)??uN,K=B.width/Q,M=B.height/W,A=Math.max(K,M),Y=A*Q,I=A*W,$=j*A,se=B.x-(Y-B.width)/2-$,le=B.y-(I-B.height)/2-$,de=Y+$*2,he=I+$*2,me=`${hN}-${V}`,oe=b.useRef(0),pe=b.useRef();oe.current=A,b.useEffect(()=>{if(L.current&&J)return pe.current=P1({domNode:L.current,panZoom:J,getTransform:()=>F.getState().transform,getViewScale:()=>oe.current}),()=>{var Ne;(Ne=pe.current)==null||Ne.destroy()}},[J]),b.useEffect(()=>{var Ne;(Ne=pe.current)==null||Ne.update({translateExtent:U,width:G,height:te,inversePan:P,pannable:S,zoomStep:k,zoomable:_})},[S,_,P,k,U,G,te]);const je=C?Ne=>{var Ae;const[$e,Fe]=((Ae=pe.current)==null?void 0:Ae.pointer(Ne))||[0,0];C(Ne,{x:$e,y:Fe})}:void 0,Ie=N?b.useCallback((Ne,$e)=>{const Fe=F.getState().nodeLookup.get($e).internals.userNode;N(Ne,Fe)},[]):void 0,ke=E??z["minimap.ariaLabel"];return d.jsx(la,{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:ut(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:Q,height:W,viewBox:`${se} ${le} ${de} ${he}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":me,ref:L,onClick:je,children:[ke&&d.jsx("title",{id:me,children:ke}),d.jsx(aN,{onClick:Ie,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:c,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:h}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${se-$},${le-$}h${de+$*2}v${he+$*2}h${-de-$*2}z
62
+ M${Z.x},${Z.y}h${Z.width}v${Z.height}h${-Z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}xg.displayName="MiniMap";b.memo(xg);const pN=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,mN={[Ci.Line]:"right",[Ci.Handle]:"bottom-right"};function gN({nodeId:t,position:r,variant:i=Ci.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:N,onResizeStart:S,onResize:_,onResizeEnd:E}){const P=Xm(),k=typeof t=="string"?t:P,j=Je(),F=b.useRef(null),L=i===Ci.Handle,B=Oe(b.useCallback(pN(L&&C),[L,C]),Ze),Z=b.useRef(null),V=r??mN[i];b.useEffect(()=>{if(!(!F.current||!k))return Z.current||(Z.current=Y1({domNode:F.current,nodeId:k,getStoreItems:()=>{const{nodeLookup:U,transform:G,snapGrid:te,snapToGrid:z,nodeOrigin:Q,domNode:W}=j.getState();return{nodeLookup:U,transform:G,snapGrid:te,snapToGrid:z,nodeOrigin:Q,paneDomNode:W}},onChange:(U,G)=>{const{triggerNodeChanges:te,nodeLookup:z,parentLookup:Q,nodeOrigin:W}=j.getState(),K=[],M={x:U.x,y:U.y},A=z.get(k);if(A&&A.expandParent&&A.parentId){const Y=A.origin??W,I=U.width??A.measured.width??0,$=U.height??A.measured.height??0,se={id:A.id,parentId:A.parentId,rect:{width:I,height:$,...pm({x:U.x??A.position.x,y:U.y??A.position.y},{width:I,height:$},A.parentId,z,Y)}},le=zu([se],z,Q,W);K.push(...le),M.x=U.x?Math.max(Y[0]*I,U.x):void 0,M.y=U.y?Math.max(Y[1]*$,U.y):void 0}if(M.x!==void 0&&M.y!==void 0){const Y={id:k,type:"position",position:{...M}};K.push(Y)}if(U.width!==void 0&&U.height!==void 0){const I={id:k,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};K.push(I)}for(const Y of G){const I={...Y,type:"position"};K.push(I)}te(K)},onEnd:({width:U,height:G})=>{const te={id:k,type:"dimensions",resizing:!1,dimensions:{width:U,height:G}};j.getState().triggerNodeChanges([te])}})),Z.current.update({controlPosition:V,boundaries:{minWidth:h,minHeight:m,maxWidth:g,maxHeight:v},keepAspectRatio:y,resizeDirection:x,onResizeStart:S,onResize:_,onResizeEnd:E,shouldResize:N}),()=>{var U;(U=Z.current)==null||U.destroy()}},[V,h,m,g,v,y,S,_,E,N]);const J=V.split("-");return d.jsx("div",{className:ut(["react-flow__resize-control","nodrag",...J,i,s]),ref:F,style:{...a,scale:B,...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:N,onResize:S,onResizeEnd:_}){return r?d.jsxs(d.Fragment,{children:[O1.map(E=>d.jsx(mp,{className:a,style:c,nodeId:t,position:E,variant:Ci.Line,color:u,minWidth:h,minHeight:m,maxWidth:g,maxHeight:v,onResizeStart:N,keepAspectRatio:y,autoScale:x,shouldResize:C,onResize:S,onResizeEnd:_},E)),F1.map(E=>d.jsx(mp,{className:i,style:s,nodeId:t,position:E,color:u,minWidth:h,minHeight:m,maxWidth:g,maxHeight:v,onResizeStart:N,keepAspectRatio:y,autoScale:x,shouldResize:C,onResize:S,onResizeEnd:_},E))]}):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 Wr(t){const r=[];for(let i=0,s=t.length;i<s;i++)r.push(t[i]);return r}let no=null;function wg(t={}){return no||(t.includeStyleProperties?(no=t.includeStyleProperties,no):(no=Wr(window.getComputedStyle(document.documentElement)),no))}function Ql(t,r){const s=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(r);return s?parseFloat(s.replace("px","")):0}function wN(t){const r=Ql(t,"border-left-width"),i=Ql(t,"border-right-width");return t.clientWidth+r+i}function SN(t){const r=Ql(t,"border-top-width"),i=Ql(t,"border-bottom-width");return t.clientHeight+r+i}function Sg(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 Jt=16384;function NN(t){(t.width>Jt||t.height>Jt)&&(t.width>Jt&&t.height>Jt?t.width>t.height?(t.height*=Jt/t.width,t.width=Jt):(t.width*=Jt/t.height,t.height=Jt):t.width>Jt?(t.height*=Jt/t.width,t.width=Jt):(t.width*=Jt/t.height,t.height=Jt))}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 Wt=(t,r)=>{if(t instanceof r)return!0;const i=Object.getPrototypeOf(t);return i===null?!1:i.constructor.name===r.name||Wt(i,r)};function _N(t){const r=t.getPropertyValue("content");return`${t.cssText} content: '${r.replace(/'|"/g,"")}';`}function jN(t,r){return wg(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 kg(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 nu={};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(nu[s]!=null)return nu[s];i.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let a;try{const c=await kg(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 nu[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 ua(t.contentDocument.body,r,!0)}catch{}return t.cloneNode(!1)}async function $N(t,r){return Wt(t,HTMLCanvasElement)?AN(t):Wt(t,HTMLVideoElement)?LN(t,r):Wt(t,HTMLIFrameElement)?DN(t,r):t.cloneNode(Ng(t))}const FN=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",Ng=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function ON(t,r,i){var s,a;if(Ng(r))return r;let c=[];return FN(t)&&t.assignedNodes?c=Wr(t.assignedNodes()):Wt(t,HTMLIFrameElement)&&(!((s=t.contentDocument)===null||s===void 0)&&s.body)?c=Wr(t.contentDocument.body.childNodes):c=Wr(((a=t.shadowRoot)!==null&&a!==void 0?a:t).childNodes),c.length===0||Wt(t,HTMLVideoElement)||await c.reduce((u,h)=>u.then(()=>ua(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):wg(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`),Wt(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){Wt(t,HTMLTextAreaElement)&&(r.innerHTML=t.value),Wt(t,HTMLInputElement)&&r.setAttribute("value",t.value)}function VN(t,r){if(Wt(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 Wt(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 ua(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 ua(t,r,i){return!i&&r.filter&&!r.filter(t)?null:Promise.resolve(t).then(s=>$N(s,r)).then(s=>ON(t,s,r)).then(s=>WN(t,s,r)).then(s=>UN(s,r))}const Eg=/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(Eg,(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 Cg(t){return t.search(Eg)!==-1}async function _g(t,r,i){if(!Cg(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 ro(t,r,i){var s;const a=(s=r.style)===null||s===void 0?void 0:s.getPropertyValue(t);if(a){const c=await _g(a,null,i);return r.style.setProperty(t,c,r.style.getPropertyPriority(t)),!0}return!1}async function ZN(t,r){await ro("background",t,r)||await ro("background-image",t,r),await ro("mask",t,r)||await ro("-webkit-mask",t,r)||await ro("mask-image",t,r)||await ro("-webkit-mask-image",t,r)}async function JN(t,r){const i=Wt(t,HTMLImageElement);if(!(i&&!yu(t.src))&&!(Wt(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=Wr(t.childNodes).map(a=>jg(a,r));await Promise.all(s).then(()=>t)}async function jg(t,r){Wt(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),kg(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{Wr(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{Wr(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=>Cg(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=Wr(t.ownerDocument.styleSheets),s=await nE(i,r);return rE(s)}function bg(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(bg(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(bg(c.style.fontFamily))).map(c=>{const u=c.parentStyleSheet?c.parentStyleSheet.href:null;return _g(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 Mg(t,r={}){const{width:i,height:s}=Sg(t,r),a=await ua(t,r,!0);return await lE(a,r),await jg(a,r),tE(a,r),await CN(a,i,s)}async function aE(t,r={}){const{width:i,height:s}=Sg(t,r),a=await Mg(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,C;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.changeType?`change-${i.changeType}`:"",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":"",(x=i.pendingFiles)!=null&&x.length?"has-pending-changes":""].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(Vr,{type:"target",position:Ce.Top}),d.jsx(Vr,{type:"target",position:Ce.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((N,S)=>d.jsx("span",{className:"node-tech-pill",children:N},S))}),i.changeType&&d.jsx("div",{className:`change-indicator change-${i.changeType}`,children:i.changeType==="added"?"+":i.changeType==="modified"?"~":"-"}),i.pendingFiles&&i.pendingFiles.length>0&&d.jsxs("div",{className:"pending-change-badge",children:[i.pendingFiles.some(N=>N.event==="add")?"+":"~",i.pendingFiles.length]}),((C=i.healthFlags)==null?void 0:C.isHub)&&i.healthScore!=null&&d.jsx("div",{className:"health-hub-badge",children:"HUB"}),d.jsx(Vr,{type:"source",position:Ce.Bottom}),d.jsx(Vr,{type:"source",position:Ce.Right})]})]})}const Pg=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 xi({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=S=>{u.current&&c({x:m.current.x+(S.clientX-h.current.x),y:m.current.y+(S.clientY-h.current.y)})},N=()=>{u.current=!1,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",N)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",N)},[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(xi,{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(""),[N,S]=b.useState(""),[_,E]=b.useState("warn");if(!t)return null;const P=()=>{!v.trim()||!x.trim()||!N.trim()||(a({name:v.trim(),from:x.trim(),to:N.trim(),level:_}),y(""),C(""),S(""),E("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(k=>d.jsxs("div",{className:"rule-config-item",children:[d.jsx("div",{className:"rule-config-name",children:k.name}),d.jsx("div",{className:"rule-config-desc",children:k.description||"No description"})]},k.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((k,j)=>d.jsxs("div",{className:"rule-config-item custom",children:[d.jsxs("div",{className:"rule-config-name",children:[k.name,d.jsx("span",{className:`rule-level-badge ${k.level}`,children:k.level})]}),d.jsxs("div",{className:"rule-config-matcher",children:[k.from," → ",k.to]}),d.jsx("button",{className:"panel-btn red small rule-delete-btn",onClick:()=>c(j),children:"x"})]},j)),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:k=>y(k.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:k=>C(k.target.value),className:"rule-input"}),d.jsx("span",{className:"rule-arrow",children:"→"}),d.jsx("input",{type:"text",placeholder:"To (e.g. layer:data)",value:N,onChange:k=>S(k.target.value),className:"rule-input"})]}),d.jsxs("div",{className:"rule-add-row",children:[d.jsxs("select",{value:_,onChange:k=>E(k.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:P,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,N]=b.useState("issues"),[S,_]=b.useState({issues:{rules:!1,structural:!1},metrics:{metrics:!1,components:!1}}),E=(V,J)=>{_(U=>({...U,[V]:{...U[V],[J]:!U[V][J]}}))},P=b.useCallback(async()=>{var V;u(!0);try{const J=await fetch("/api/audit");if(J.ok){const U=await J.json();a(U),(V=U.rules)!=null&&V.custom&&v(U.rules.custom)}}catch{}u(!1)},[]);b.useEffect(()=>{t&&P()},[t,P]);const k=async()=>{x(!0);try{await fetch("/api/rules",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:g})}),await P()}catch{}x(!1)},j=V=>{v(g.filter((J,U)=>U!==V))};if(!t)return null;const F=(s==null?void 0:s.issues.filter(V=>V.type==="rule-violation"))||[],L=(s==null?void 0:s.issues.filter(V=>V.type==="structural"))||[],B=s?[...s.nodes].sort((V,J)=>V.modularityIndex-J.modularityIndex):[];return d.jsxs(xi,{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:P,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:()=>N("issues"),children:"Issues"}),d.jsx("button",{className:`audit-tab ${C==="metrics"?"active":""}`,onClick:()=>N("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:[F.length>0&&d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>E("issues","rules"),children:[d.jsx("span",{className:"audit-section-toggle",children:S.issues.rules?"▼":"▶"}),d.jsxs("span",{className:"audit-section-title",children:["Rule Violations (",F.length,")"]})]}),S.issues.rules&&d.jsx("div",{className:"audit-section-content",children:F.map((V,J)=>d.jsxs("div",{className:`audit-issue ${V.level}`,onClick:()=>{V.nodeIds&&V.nodeIds.length>0&&i(V.nodeIds[0])},children:[d.jsxs("div",{className:"audit-issue-rule",children:[V.rule,V.ruleType==="custom"&&d.jsx("span",{className:"rule-type-badge custom",children:"custom"})]}),d.jsx("div",{className:"audit-issue-message",children:V.message})]},J))})]}),L.length>0&&d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>E("issues","structural"),children:[d.jsx("span",{className:"audit-section-toggle",children:S.issues.structural?"▼":"▶"}),d.jsxs("span",{className:"audit-section-title",children:["Structural Issues (",L.length,")"]})]}),S.issues.structural&&d.jsx("div",{className:"audit-section-content",children:L.map((V,J)=>d.jsxs("div",{className:`audit-issue ${V.level}`,onClick:()=>{V.nodeIds&&V.nodeIds.length>0&&i(V.nodeIds[0])},children:[d.jsx("div",{className:"audit-issue-rule",children:V.metric}),d.jsx("div",{className:"audit-issue-message",children:V.message})]},J))})]})]}),C==="metrics"&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"audit-section",children:[d.jsxs("div",{className:"audit-section-header",onClick:()=>E("metrics","metrics"),children:[d.jsx("span",{className:"audit-section-toggle",children:S.metrics.metrics?"▼":"▶"}),d.jsx("span",{className:"audit-section-title",children:"Architecture Metrics"})]}),S.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:()=>E("metrics","components"),children:[d.jsx("span",{className:"audit-section-toggle",children:S.metrics.components?"▼":"▶"}),d.jsxs("span",{className:"audit-section-title",children:["Component Health (",s.nodes.length,")"]})]}),S.metrics.components&&d.jsx("div",{className:"audit-section-content",children:B.map(V=>d.jsxs("div",{className:"audit-component-item",onClick:()=>i(V.id),children:[d.jsx("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:kE(V.modularityIndex),flexShrink:0},title:`Health: ${V.modularityIndex}/100`}),d.jsxs("div",{className:"audit-component-info",children:[d.jsx("div",{className:"audit-component-name",children:V.label}),d.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)"},children:[V.inDegree,"↓ ",V.outDegree,"↑"]})]})]},V.id))})]})]}),d.jsx(SE,{visible:h,onClose:()=>m(!1),builtinRules:((Z=s.rules)==null?void 0:Z.builtin)||[],customRules:g,onAddRule:V=>{v([...g,V])},onDeleteRule:V=>j(V),onSave:k,saving:y})]}):null]})}const EE=b.memo(NE);function CE({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),N=b.useCallback(async()=>{try{const P=await fetch("/api/workflow/list");P.ok&&i(await P.json())}catch{}m(!1)},[]),S=b.useCallback(async P=>{try{const k=await fetch(`/api/workflow/status/${P}`);if(k.ok){const j=await k.json();u(j),j&&g===P&&(j.status==="completed"||j.status==="failed")&&(v(null),N())}}catch{}},[g,N]);b.useEffect(()=>{if(t){N();const P=setInterval(N,g?3e3:1e4);return()=>clearInterval(P)}},[t,N,g]),b.useEffect(()=>(C.current&&clearInterval(C.current),s&&(S(s),C.current=setInterval(()=>S(s),g?3e3:1e4)),()=>{C.current&&clearInterval(C.current)}),[s,S,g]);const _=async P=>{x(null);try{const k=await fetch(`/api/workflow/run/${P}`,{method:"POST"});if(k.ok)v(P);else{const j=await k.json();x(j.error||"Failed to start workflow")}}catch{x("Failed to connect to server")}},E=async P=>{x(null);try{(await fetch("/api/workflow/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:P})})).ok&&(u(null),N())}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(P=>{const k=s===P.id,j=g===P.id;return d.jsxs("div",{className:"wf-item",children:[d.jsxs("div",{className:"wf-header",onClick:()=>a(k?null:P.id),children:[d.jsxs("div",{className:"wf-header-left",children:[d.jsx("span",{className:"wf-expand",children:k?"−":"+"}),d.jsx("span",{className:"wf-name",children:P.name}),P.builtin&&d.jsx("span",{className:"wf-tag",children:"built-in"})]}),(j||P.status)&&d.jsx("span",{className:`wf-status ${j?"running":P.status}`,children:j?"running":P.status==="completed"?"done":P.status})]}),k&&d.jsxs("div",{className:"wf-detail",children:[d.jsx("div",{className:"wf-desc",children:P.description}),c&&c.workflowId===P.id?d.jsxs("div",{className:"wf-steps",children:[Object.entries(c.steps).map(([F,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:F})]},F)),(()=>{const F=Object.keys(c.steps).length,L=Object.values(c.steps).filter(Z=>Z.status==="completed").length,B=F>0?Math.round(L/F*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:`${B}%`}})}),d.jsxs("span",{className:"wf-progress-label",children:[B,"%"]})]})})()]}):d.jsx("div",{className:"wf-steps-preview",children:P.steps.length>0?P.steps.join(" → "):"No state yet"}),d.jsxs("div",{className:"wf-actions",children:[d.jsx("button",{className:"panel-btn cyan",disabled:j,onClick:()=>_(P.id),children:j?"Running...":"Run"}),(P.status==="completed"||P.status==="failed")&&!j&&d.jsx("button",{className:"panel-btn amber",onClick:()=>E(P.id),children:"Reset"})]})]})]},P.id)})]}):null}const _E=b.memo(CE);function jE({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 bE={architecture:Pg},ME=1500;function PE({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 N=new Set(t.steps.map(E=>E.edge)),S=r.edges.filter(E=>N.has(E.id)),_=new Set;return S.forEach(E=>{_.add(E.source),_.add(E.target)}),{flowNodeIds:_,flowEdges:S}},[t,r]),y=b.useMemo(()=>{const N=r.nodes.filter(J=>g.has(J.id)),S=320,_=140,E=80,P=80,k=new Map,j=new Map;g.forEach(J=>{k.set(J,0),j.set(J,[])}),v.forEach(J=>{g.has(J.source)&&g.has(J.target)&&(j.get(J.source).push(J.target),k.set(J.target,(k.get(J.target)||0)+1))});const F=new Map,L=[];for(k.forEach((J,U)=>{J===0&&(L.push(U),F.set(U,0))});L.length>0;){const J=L.shift(),U=F.get(J);for(const G of j.get(J)||[]){const te=U+1;(!F.has(G)||F.get(G)<te)&&F.set(G,te),k.set(G,k.get(G)-1),k.get(G)===0&&L.push(G)}}N.forEach(J=>{F.has(J.id)||F.set(J.id,0)});const B=new Map;N.forEach(J=>{const U=F.get(J.id);B.has(U)||B.set(U,[]),B.get(U).push(J)});const Z=[...B.keys()].sort((J,U)=>J-U),V=new Map;return Z.forEach((J,U)=>{B.get(J).forEach((te,z)=>{V.set(te.id,{x:E+U*S,y:P+z*_})})}),N.map(J=>{const U=V.get(J.id)||{x:E,y:P};return{id:J.id,type:"architecture",position:U,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 N=setInterval(()=>{a(S=>{const _=S+1;if(_>=t.steps.length)return u(new Set([t.steps[0].edge])),0;const E=new Set;for(let P=0;P<=_;P++)E.add(t.steps[P].edge);return u(E),_})},ME);return()=>clearInterval(N)},[h,t]);const x=b.useMemo(()=>{const N=new Map;return t.steps.forEach((S,_)=>{N.has(S.edge)||N.set(S.edge,_+1)}),v.map(S=>{const _=c.has(S.id),E=N.get(S.id);return{id:S.id,source:S.source,target:S.target,label:_&&E?`${E}`:void 0,labelStyle:_&&E?{fill:"#fff",fontWeight:700,fontSize:13,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:_&&E?{fill:t.color,fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:_?t.color:S.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(xi,{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(pg,{nodes:y,edges:x,nodeTypes:bE,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(gg,{variant:Yn.Dots,gap:20,size:1,color:"var(--grid-color)"}),d.jsx(vg,{showInteractive:!1})]})}),d.jsx("div",{className:"flow-hud-steps",children:t.steps.map((N,S)=>d.jsxs("div",{className:`flow-hud-step ${S<=s?"active":""} ${S===s?"current":""}`,style:{borderColor:S<=s?t.color:void 0},children:[d.jsx("span",{className:"flow-hud-step-num",style:{background:S<=s?t.color:void 0},children:S+1}),N.label]},S))})]})})}function IE(t){return d.jsx(hg,{children:d.jsx(PE,{...t})})}const TE=b.memo(IE),RE=[{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 zE({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=S=>{a(S),u(""),v(null),S.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 S={provider:s.key};s.requiresKey&&c.trim()&&(S.apiKey=c.trim());const _=await fetch("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)});if(!_.ok){const E=await _.json();throw new Error(E.error||"Failed to save configuration")}t()}catch(S){v(S instanceof Error?S.message:"Failed to save configuration"),m(!1)}}},N=()=>{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:Re.overlay,onClick:S=>S.stopPropagation(),children:d.jsxs("div",{style:Re.modal,children:[d.jsxs("div",{style:Re.header,children:[d.jsx("div",{style:Re.headerIcon,children:"⚙"}),d.jsx("h2",{style:Re.title,children:"Set Up Your AI Provider"}),d.jsx("p",{style:Re.subtitle,children:"ArchByte uses AI to analyze your codebase and generate architecture diagrams. Choose a provider to get started."})]}),d.jsx("div",{style:Re.stepIndicator,children:[1,2,3].map(S=>d.jsxs("div",{style:Re.stepRow,children:[d.jsx("div",{style:{...Re.stepDot,background:S<=r?"#7c3aed":"#3a3a4a",color:S<=r?"#fff":"#888"},children:S}),d.jsx("span",{style:{...Re.stepLabel,color:S<=r?"#ccc":"#666"},children:S===1?"Provider":S===2?"API Key":"Confirm"}),S<3&&d.jsx("div",{style:{...Re.stepLine,background:S<r?"#7c3aed":"#3a3a4a"}})]},S))}),r===1&&d.jsx("div",{style:Re.stepContent,children:d.jsx("div",{style:Re.providerGrid,children:RE.map(S=>d.jsxs("button",{style:{...Re.providerCard,borderColor:(s==null?void 0:s.key)===S.key?"#7c3aed":"#5a5a7a"},onClick:()=>y(S),onMouseEnter:_=>{_.currentTarget.style.borderColor="#7c3aed",_.currentTarget.style.background="#2a2a3e"},onMouseLeave:_=>{(s==null?void 0:s.key)!==S.key&&(_.currentTarget.style.borderColor="#5a5a7a"),_.currentTarget.style.background="#252536"},children:[d.jsx("div",{style:Re.providerIcon,children:S.icon}),d.jsx("div",{style:Re.providerName,children:S.name}),d.jsx("div",{style:Re.providerModels,children:S.models}),d.jsx("div",{style:Re.providerDesc,children:S.description}),!S.requiresKey&&d.jsx("div",{style:Re.noKeyBadge,children:"No API key needed"})]},S.key))})}),r===2&&s&&d.jsx("div",{style:Re.stepContent,children:d.jsxs("div",{style:Re.keySection,children:[d.jsxs("div",{style:Re.selectedProviderBadge,children:[d.jsx("span",{style:Re.providerIconSmall,children:s.icon}),d.jsx("span",{children:s.name})]}),d.jsx("label",{style:Re.label,children:"API Key"}),d.jsx("input",{type:"password",value:c,onChange:S=>{u(S.target.value),v(null)},placeholder:`Enter your ${s.name} API key`,style:Re.input,autoFocus:!0,onKeyDown:S=>{S.key==="Enter"&&x()}}),d.jsxs("p",{style:Re.keyHint,children:["Your key is stored locally in ",d.jsx("code",{style:Re.code,children:".archbyte/config.json"})," and never sent to external servers."]}),g&&d.jsx("div",{style:Re.error,children:g}),d.jsxs("div",{style:Re.buttonRow,children:[d.jsx("button",{style:Re.backBtn,onClick:N,children:"Back"}),d.jsx("button",{style:{...Re.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:Re.stepContent,children:d.jsxs("div",{style:Re.confirmSection,children:[d.jsx("div",{style:Re.confirmIcon,children:"✓"}),d.jsx("h3",{style:Re.confirmTitle,children:"Ready to Analyze"}),d.jsxs("div",{style:Re.confirmDetails,children:[d.jsxs("div",{style:Re.confirmRow,children:[d.jsx("span",{style:Re.confirmLabel,children:"Provider"}),d.jsxs("span",{style:Re.confirmValue,children:[d.jsx("span",{style:Re.providerIconSmall,children:s.icon}),s.name]})]}),d.jsxs("div",{style:Re.confirmRow,children:[d.jsx("span",{style:Re.confirmLabel,children:"Models"}),d.jsx("span",{style:Re.confirmValue,children:s.models})]}),s.requiresKey&&d.jsxs("div",{style:Re.confirmRow,children:[d.jsx("span",{style:Re.confirmLabel,children:"API Key"}),d.jsxs("span",{style:Re.confirmValue,children:["*".repeat(Math.min(c.length,8)),"...",c.slice(-4)]})]})]}),g&&d.jsx("div",{style:Re.error,children:g}),d.jsxs("div",{style:Re.buttonRow,children:[d.jsx("button",{style:Re.backBtn,onClick:N,children:"Back"}),d.jsx("button",{style:{...Re.runBtn,opacity:h?.6:1,cursor:h?"wait":"pointer"},onClick:C,disabled:h,children:h?"Saving...":"Run First Analysis"})]})]})})]})})}const Re={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}},AE={"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"}},Ur={critical:0,high:1,medium:2,low:3};function Es({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 LE({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 DE({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 $E({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 FE({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 OE({data:t}){const r=[...t.findings].sort((i,s)=>Ur[i.severity]-Ur[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(Es,{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 HE({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(DE,{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 BE({data:t}){const r=[...t.bottlenecks].sort((i,s)=>Ur[i.severity]-Ur[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(Es,{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 VE({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(Es,{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 WE({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($E,{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 UE({data:t}){const r=[...t.mismatches].sort((i,s)=>Ur[i.severity]-Ur[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(Es,{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 YE({data:t}){const r=[...t.detections].sort((i,s)=>Ur[i.severity]-Ur[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(FE,{driftType:i.driftType}),d.jsx(Es,{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 XE({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(E=>{const P=new Set(E);return P.has(_)?P.delete(_):P.add(_),P})},[]),v=b.useCallback(async()=>{u(!0);try{const _=await fetch("/api/premium-agents/results");if(_.ok){const E=await _.json();Array.isArray(E)&&m(E)}}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 N(_){const E=_.data;switch(E.agentId){case"security-audit":return E.findings.length;case"compliance":return E.statuses.length;case"performance":return E.bottlenecks.length;case"dependency-risk":return E.risks.length;case"migration":return E.steps.length;case"api-contracts":return E.mismatches.length;case"drift-detection":return E.detections.length}}function S(_){const E=_.data;switch(E.agentId){case"security-audit":return d.jsx(OE,{data:E});case"compliance":return d.jsx(HE,{data:E});case"performance":return d.jsx(BE,{data:E});case"dependency-risk":return d.jsx(VE,{data:E});case"migration":return d.jsx(WE,{data:E});case"api-contracts":return d.jsx(UE,{data:E});case"drift-detection":return d.jsx(YE,{data:E})}}return t?d.jsxs(xi,{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 E=x.get(_);if(!E)return null;const P=AE[_],k=s.has(_),j=N(E);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:k?"var(--bg-tertiary)":"transparent",cursor:"pointer",transition:"background 0.15s",userSelect:"none"},onMouseEnter:F=>{k||(F.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:F=>{k||(F.currentTarget.style.background="transparent")},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[d.jsx("span",{style:{fontSize:12},children:P.icon}),d.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)"},children:P.label}),j>0&&d.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"0px 5px",borderRadius:8,background:"var(--bg-hover)",color:"var(--text-secondary)"},children:j})]}),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:k?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"})})]}),k&&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(LE,{value:E.confidence})]}),S(E),d.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:8,textAlign:"right",fontFamily:"'JetBrains Mono', monospace"},children:new Date(E.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 GE=b.memo(XE);function io(t,r){return!t||t.length===0?!0:t.includes(r)}const KE=1500,QE={architecture:Pg};function qE(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 Cp(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:hs.ArrowClosed,width:16,height:16,color:i.color||r}}))}function oo({title:t,defaultOpen:r,children:i}){const[s,a]=b.useState(r??!1);return d.jsxs("div",{className:`dd-section ${s?"open":""}`,children:[d.jsxs("button",{className:"dd-section-header",onClick:()=>a(!s),children:[d.jsx("span",{className:"dd-section-chevron",children:s?"▾":"▸"}),d.jsx("span",{className:"dd-section-title",children:t})]}),s&&d.jsx("div",{className:"dd-section-content",children:i})]})}function Ig(t,r,i=0){return t.slice(0,50).map((s,a)=>{const c=s.path.replace(r+"/","").split("/").pop()||s.path,u=i*12;return s.type==="directory"?d.jsxs("div",{children:[d.jsxs("div",{className:"dd-tree-entry dir",style:{paddingLeft:u},children:[d.jsx("span",{className:"dd-tree-icon",children:"📁"})," ",c,"/"]}),s.children&&Ig(s.children,r,i+1)]},a):d.jsxs("div",{className:"dd-tree-entry file",style:{paddingLeft:u},children:[d.jsx("span",{className:"dd-tree-icon",children:"📄"})," ",c]},a)})}function ZE(){var Er;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,N]=b.useState(!0),[S,_]=b.useState(null),[E,P]=b.useState({loggedIn:!1,email:null,tier:"free",features:{analyze:!0,validate:!0,workflows:!1,chat:!1,premiumAgents:!1}}),[k,j]=b.useState(!1),[F,L]=b.useState(null),[B,Z]=b.useState(!1),[V,J]=b.useState(null),[U,G]=b.useState(!1),[te,z]=b.useState(null),[,Q]=b.useState(null),[W,K]=b.useState(null),[M,A]=b.useState(null),[Y,I]=b.useState(-1),[$,se]=b.useState(!1),[le,de]=b.useState(new Set),[he,me]=b.useState(!1),[oe,pe]=b.useState(new Set),[je,Ie]=b.useState(new Set),[ke,Ne]=b.useState(null),[$e,Fe]=b.useState("layer"),[Ae,et]=b.useState(!1),[Pt,wt]=b.useState(!1),[gt,St]=b.useState(!1),[Ut,Yt]=b.useState(!1),[ur,Kn]=b.useState([]),[be,nn]=b.useState(null),[rn,Yr]=b.useState(!1),[fn,hn]=b.useState(!1),[zt,Xr]=b.useState("develop"),[,Gr]=b.useState([]),[go,dr]=b.useState(),[fr,hr]=b.useState(null),[Xt,Kr]=b.useState(null),[It,yt]=b.useState(new Map),[pr,Qr]=b.useState(!1),pn=b.useRef([]),[mr,_i]=b.useState([]),qr=50,[,gr]=b.useState([]),[,mn]=b.useState([]),[Mn,yr]=b.useState(new Set),[At,Pn]=b.useState(new Set),[lt,vr]=b.useState(()=>{const R=localStorage.getItem("archbyte-theme");return R==="dark"||R==="light"?R:"light"});b.useEffect(()=>{document.documentElement.setAttribute("data-theme",lt),localStorage.setItem("archbyte-theme",lt)},[lt]);const[kt]=b.useState(()=>!!window.__ARCHBYTE_DATA__),[ji,In]=b.useState(!1),[yo,Nt]=b.useState(!1),[tt,xr]=b.useState(null),Qn=lt==="dark"?"#64748b":"#94a3b8",Zr="#fff",Jr=20,Gt=10,Tn=b.useCallback(async()=>{const R=window.__ARCHBYTE_DATA__;if(R){kr(R),P({loggedIn:!0,email:null,tier:"premium",features:{analyze:!0,validate:!0,workflows:!0,chat:!0,premiumAgents:!0}}),j(!0),g(!0),N(!1);return}try{await Ii()}catch(H){console.error("Failed to load architecture:",H),_("Failed to connect to server"),Et()}finally{N(!1)}},[]),vo=async()=>{try{const R=await fetch("/api/tools-git");if(R.ok){const H=await R.json();Kr(H)}}catch{}},bi=async()=>{try{const R=await fetch("/api/config");if(R.ok){const H=await R.json();if(Q(H),H.environments){dr(H.environments);const ne=Object.keys(H.environments);ne.length>0&&!ne.includes(zt)&&Xr(ne[0])}}}catch{}},Ge=async()=>{try{const R=await fetch("/api/license");if(R.ok){const H=await R.json();P(H),j(!0)}}catch{j(!0)}},Mi=async()=>{try{const R=await fetch("/api/project");if(R.ok){const H=await R.json();H&&K(H)}}catch{}},wr=async()=>{try{const R=await fetch("/api/analysis-status");if(R.ok){const H=await R.json();(H==null?void 0:H.status)==="error"&&H.error?J(H.error):J(null)}}catch{}},Pi=async()=>{try{const R=await fetch("/api/changes/pending");if(R.ok){const H=await R.json();H.count>0&&z({count:H.count,files:H.files||[],componentChanges:H.componentChanges||[],unmapped:H.unmapped||[]})}}catch{}},Sr=b.useCallback(async()=>{try{await fetch("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"static"})})}catch(R){console.error("Failed to start quick re-analysis:",R)}},[]),xo=b.useCallback(async()=>{try{await fetch("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"llm"})})}catch(R){console.error("Failed to start full re-analysis:",R)}},[]),Ii=async()=>{const R="/events",H="/api/architecture";vo(),bi(),Mi(),Ge(),wr(),Pi();try{const ne=new EventSource(R);return ne.onopen=()=>{console.log("SSE connected"),g(!0),_(null)},ne.onmessage=ie=>{try{const re=JSON.parse(ie.data);console.log("SSE message:",re.type),re.architecture&&kr(re.architecture),re.type==="git_update"&&re.gitInfo&&Gr(re.gitInfo),re.type==="premium_agent_result"&&re.premiumResults&&Kn(re.premiumResults),re.type==="changes:detected"&&z({count:re.count,files:re.files||[],componentChanges:re.componentChanges||[],unmapped:re.unmapped||[]}),re.type==="changes:cleared"&&z(null),re.type==="analyzing:started"&&(G(!0),z(null)),re.type==="analyzing:finished"&&(G(!1),re.success===!1&&re.error?J(re.error):(J(null),Mi(),wr()))}catch(re){console.error("Failed to parse SSE message:",re)}},ne.onerror=ie=>{console.error("SSE error:",ie),ne.close(),g(!1),Rn(H)},()=>ne.close()}catch{Rn(H)}},Rn=async R=>{try{const H=await fetch(R);if(H.ok){const ne=await H.json();kr(ne),g(!0)}else Et()}catch{Et()}},Et=()=>{const R={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};kr(R)},kr=R=>{h(R),y(R.lastUpdated),R.gitInfo&&Gr(R.gitInfo),R.environments&&dr(R.environments)};b.useEffect(()=>{if(!u)return;const R=u.nodes.filter(re=>io(re.environments,zt)&&!oe.has(re.id)&&!je.has(re.layer)),H=new Set(R.map(re=>re.id)),ne=u.edges.filter(re=>io(re.environments,zt)&&H.has(re.source)&&H.has(re.target)),ie=qE(R);r(ie),a(Cp(ne,Qn))},[u,zt,oe,je,Qn]),b.useEffect(()=>{var H;if(!((H=te==null?void 0:te.componentChanges)!=null&&H.length))return;const R=new Map;for(const ne of te.componentChanges)R.set(ne.componentId,ne.files);r(ne=>ne.map(ie=>{const re=R.get(ie.id);return re?{...ie,data:{...ie.data,pendingFiles:re}}:ie.data.pendingFiles?{...ie,data:{...ie.data,pendingFiles:null}}:ie}))},[te,r]),b.useEffect(()=>{Tn()},[Tn]),b.useEffect(()=>{if(!$||!M)return;const R=setInterval(()=>{I(H=>{const ne=H+1;if(ne>=M.steps.length)return de(new Set([M.steps[0].edge])),0;const ie=new Set;for(let re=0;re<=ne;re++)ie.add(M.steps[re].edge);return de(ie),ne})},KE);return()=>clearInterval(R)},[$,M]),b.useEffect(()=>{if(!u)return;const R=u.nodes.filter(ye=>io(ye.environments,zt)),H=new Set(R.map(ye=>ye.id)),ne=u.edges.filter(ye=>io(ye.environments,zt)&&H.has(ye.source)&&H.has(ye.target)),ie=new Map;M&&M.steps.forEach((ye,_e)=>{ie.has(ye.edge)||ie.set(ye.edge,_e+1)});const re=ne.map(ye=>{const _e=le.has(ye.id),we=M==null?void 0:M.steps.some(Ue=>Ue.edge===ye.id),Te=ie.get(ye.id);return{id:ye.id,source:ye.source,target:ye.target,label:_e&&Te?`${Te}`:void 0,labelStyle:_e&&Te?{fill:Zr,fontWeight:700,fontSize:12,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:_e&&Te?{fill:(M==null?void 0:M.color)||"#3b82f6",fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:_e?(M==null?void 0:M.color)||ye.color:ye.color||Qn,strokeWidth:_e?6:3,opacity:M?we?1:.15:1,filter:_e?"brightness(0.85) saturate(1.4)":void 0},animated:_e,type:"smoothstep"}});a(re)},[le,M,u,zt,Qn,Zr]);const Ct=R=>{A(R),I(0),de(new Set([R.steps[0].edge])),se(!0),me(!0)},zn=()=>{if(se(!1),A(null),I(-1),de(new Set),me(!1),u){const R=u.nodes.filter(ie=>io(ie.environments,zt)),H=new Set(R.map(ie=>ie.id)),ne=u.edges.filter(ie=>io(ie.environments,zt)&&H.has(ie.source)&&H.has(ie.target));a(Cp(ne,Qn))}},wo=()=>{se(!1)},So=()=>{M&&se(!0)},gn=b.useRef(oe);b.useEffect(()=>{gn.current=oe},[oe]);const Ye=b.useCallback(()=>{gr(R=>{const H={nodes:[...pn.current],edges:[...s],hiddenNodeIds:new Set(gn.current)},ne=[...R,H];return ne.length>qr&&ne.shift(),ne}),mn([])},[s]),Lt=b.useCallback(R=>{hr(R),setTimeout(()=>hr(null),3e3)},[]),Nr=b.useCallback(()=>{pe(new Set)},[]);b.useCallback(R=>{Ie(H=>{const ne=new Set(H);return ne.has(R)?ne.delete(R):ne.add(R),ne})},[]);const Ti=b.useCallback((R,H)=>{if(!u)return;const ne=u.nodes.find(ie=>ie.id===H.id);ne&&(xr(ne),Nt(!0))},[u]),ko=b.useCallback(()=>{Ne(null)},[]);b.useEffect(()=>{pn.current=t},[t]);const ei=b.useCallback(R=>{i(R);const H=R.some(ie=>ie.type==="position"&&ie.dragging===!1&&ie.position),ne=R.some(ie=>ie.type==="dimensions"&&ie.dimensions&&ie.resizing===!1);(H||ne)&&Ye(),R.forEach(ie=>{if(ie.type==="position"&&ie.dragging===!1&&ie.position){const re=pn.current.find(ye=>ye.id===ie.id);re&&yt(ye=>{var Te,Ue,We,ot;const _e=new Map(ye),we=_e.get(ie.id);return _e.set(ie.id,{id:ie.id,x:ie.position.x,y:ie.position.y,width:(we==null?void 0:we.width)??((Te=re.style)==null?void 0:Te.width)??((Ue=re.data)==null?void 0:Ue.width)??100,height:(we==null?void 0:we.height)??((We=re.style)==null?void 0:We.height)??((ot=re.data)==null?void 0:ot.height)??60}),_e})}if(ie.type==="dimensions"&&ie.dimensions&&ie.resizing===!1){const re=pn.current.find(ye=>ye.id===ie.id);re&&yt(ye=>{const _e=new Map(ye),we=_e.get(ie.id);return _e.set(ie.id,{id:ie.id,x:(we==null?void 0:we.x)??re.position.x,y:(we==null?void 0:we.y)??re.position.y,width:ie.dimensions.width,height:ie.dimensions.height}),_e})}})},[i,Ye]),An=b.useCallback(async()=>{if(It.size!==0){Qr(!0);try{const R=Array.from(It.values()),H=await fetch("/api/update-positions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:R})});if(H.ok)yt(new Map),console.log("Changes saved successfully");else{const ne=await H.json();console.error("Failed to save changes:",ne)}}catch(R){console.error("Error saving changes:",R)}finally{Qr(!1)}}},[It]),ti=b.useCallback(()=>{yt(new Map),Tn()},[Tn]),Ln=b.useCallback(()=>{gr(R=>{if(R.length===0)return R;const H=[...R],ne=H.pop();if(mn(ie=>[...ie,{nodes:[...pn.current],edges:[...s],hiddenNodeIds:new Set(gn.current)}]),r(ne.nodes),a(ne.edges),pe(ne.hiddenNodeIds),u){const ie=new Map;ne.nodes.forEach(re=>{var _e,we,Te,Ue;const ye=u.nodes.find(We=>We.id===re.id);if(ye){const We=re.position.x,ot=re.position.y,Le=((_e=re.style)==null?void 0:_e.width)??((we=re.data)==null?void 0:we.width)??100,nt=((Te=re.style)==null?void 0:Te.height)??((Ue=re.data)==null?void 0:Ue.height)??60;(We!==ye.x||ot!==ye.y||Le!==ye.width||nt!==ye.height)&&ie.set(re.id,{id:re.id,x:We,y:ot,width:Le,height:nt})}}),yt(ie)}return H})},[s,r,a,u]),ni=b.useCallback(()=>{mn(R=>{if(R.length===0)return R;const H=[...R],ne=H.pop();if(gr(ie=>[...ie,{nodes:[...pn.current],edges:[...s],hiddenNodeIds:new Set(gn.current)}]),r(ne.nodes),a(ne.edges),pe(ne.hiddenNodeIds),u){const ie=new Map;ne.nodes.forEach(re=>{var _e,we,Te,Ue;const ye=u.nodes.find(We=>We.id===re.id);if(ye){const We=re.position.x,ot=re.position.y,Le=((_e=re.style)==null?void 0:_e.width)??((we=re.data)==null?void 0:we.width)??100,nt=((Te=re.style)==null?void 0:Te.height)??((Ue=re.data)==null?void 0:Ue.height)??60;(We!==ye.x||ot!==ye.y||Le!==ye.width||nt!==ye.height)&&ie.set(re.id,{id:re.id,x:We,y:ot,width:Le,height:nt})}}),yt(ie)}return H})},[s,r,a,u]),No=b.useCallback(({nodes:R})=>{Pn(new Set(R.map(H=>H.id))),R.length===1?Ne(R[0].id):R.length===0&&Ne(null)},[]),Be=b.useCallback(()=>{if(At.size===0&&!ke)return;Ye();const R=At.size>0?At:new Set([ke]);pe(H=>new Set([...H,...R])),Pn(new Set),Ne(null)},[At,ke,Ye]),Eo=b.useCallback(()=>{const R=At.size>0?At:ke?new Set([ke]):new Set;if(R.size===0)return;const H=t.filter(ne=>R.has(ne.id));_i(H)},[t,At,ke]),Co=b.useCallback(()=>{if(mr.length===0)return;Ye();const R=50,H=mr.map((ne,ie)=>{var re;return{...ne,id:`${ne.id}-copy-${Date.now()}-${ie}`,position:{x:ne.position.x+R,y:ne.position.y+R},selected:!0,data:{...ne.data,label:`${((re=ne.data)==null?void 0:re.label)||ne.id} (copy)`}}});r(ne=>[...ne.map(ie=>({...ie,selected:!1})),...H]),H.forEach(ne=>{yt(ie=>{var ye,_e,we,Te;const re=new Map(ie);return re.set(ne.id,{id:ne.id,x:ne.position.x,y:ne.position.y,width:((ye=ne.style)==null?void 0:ye.width)||((_e=ne.data)==null?void 0:_e.width)||100,height:((we=ne.style)==null?void 0:we.height)||((Te=ne.data)==null?void 0:Te.height)||60}),re})})},[mr,r,Ye]),qn=b.useCallback((R,H)=>{const ne=At.size>0?At:ke?new Set([ke]):new Set;ne.size!==0&&(Ye(),r(ie=>ie.map(re=>{if(ne.has(re.id)&&!Mn.has(re.id)){const ye={x:re.position.x+R,y:re.position.y+H};return yt(_e=>{var Te,Ue,We,ot;const we=new Map(_e);return we.set(re.id,{id:re.id,x:ye.x,y:ye.y,width:((Te=re.style)==null?void 0:Te.width)||((Ue=re.data)==null?void 0:Ue.width)||100,height:((We=re.style)==null?void 0:We.height)||((ot=re.data)==null?void 0:ot.height)||60}),we}),{...re,position:ye}}return re})))},[At,ke,Mn,r,Ye]),Cs=b.useCallback(R=>{const H={id:`edge-${R.source}-${R.target}-${Date.now()}`,source:R.source,target:R.target,type:"smoothstep",animated:!0,style:{stroke:lt==="dark"?"#868e96":"#6b7280",strokeWidth:2}};a(ne=>km(H,ne))},[a,lt]),_s=b.useCallback((R,H)=>{Ye(),a(ne=>a1(R,H,ne))},[a,Ye]),js=b.useCallback(async()=>{const R=document.querySelector(".react-flow");if(R){In(!0);try{const H=await cE(R,{backgroundColor:lt==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)",quality:1,pixelRatio:2}),ne=document.createElement("a");ne.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.png`,ne.href=H,ne.click()}catch(H){console.error("Failed to export PNG:",H)}finally{In(!1)}}},[lt]),_o=b.useCallback(async()=>{const R=document.querySelector(".react-flow");if(R){In(!0);try{const H=await Mg(R,{backgroundColor:lt==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)"}),ne=document.createElement("a");ne.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.svg`,ne.href=H,ne.click()}catch(H){console.error("Failed to export SVG:",H)}finally{In(!1)}}},[lt]),yn=b.useCallback(async R=>{In(!0);try{const H=await fetch(`/api/export?format=${R}`);if(!H.ok)throw new Error("Export failed");const ne=await H.blob(),ie=R==="mermaid"?"mmd":R==="plantuml"?"puml":R==="markdown"?"md":R,re=document.createElement("a");re.download=`architecture.${ie}`,re.href=URL.createObjectURL(ne),re.click(),URL.revokeObjectURL(re.href)}catch(H){console.error(`Failed to export ${R}:`,H)}finally{In(!1)}},[]);b.useCallback(()=>{if(!u)return;Ye();const R=250,H=100,ne=100,ie=t.map((re,ye)=>({...re,position:{x:H+ye*R,y:ne}}));r(ie),Fe("horizontal")},[u,t,r,Ye]),b.useCallback(()=>{if(!u)return;Ye();const R=150,H=100,ne=100,ie=t.map((re,ye)=>({...re,position:{x:H,y:ne+ye*R}}));r(ie),Fe("vertical")},[u,t,r,Ye]),b.useCallback(()=>{if(!u)return;Ye();const R=280,H=180,ne=100,ie=100,re=Math.ceil(Math.sqrt(t.length)),ye=t.map((_e,we)=>({..._e,position:{x:ne+we%re*R,y:ie+Math.floor(we/re)*H}}));r(ye),Fe("grid")},[u,t,r,Ye]),b.useCallback(()=>{if(!u)return;Ye();const R=320,H=160,ne=100,ie=100,re=new Set(t.map(Le=>Le.id)),ye=new Map,_e=new Map;re.forEach(Le=>{ye.set(Le,0),_e.set(Le,[])}),s.forEach(Le=>{re.has(Le.source)&&re.has(Le.target)&&(_e.get(Le.source).push(Le.target),ye.set(Le.target,(ye.get(Le.target)||0)+1))});const we=new Map,Te=[];for(ye.forEach((Le,nt)=>{Le===0&&(Te.push(nt),we.set(nt,0))});Te.length>0;){const Le=Te.shift(),nt=we.get(Le);for(const Fn of _e.get(Le)||[]){const Ri=nt+1;(!we.has(Fn)||we.get(Fn)<Ri)&&we.set(Fn,Ri),ye.set(Fn,ye.get(Fn)-1),ye.get(Fn)===0&&Te.push(Fn)}}t.forEach(Le=>{we.has(Le.id)||we.set(Le.id,0)});const Ue=new Map;t.forEach(Le=>{const nt=we.get(Le.id);Ue.has(nt)||Ue.set(nt,[]),Ue.get(nt).push(Le)});const We=[];[...Ue.keys()].sort((Le,nt)=>Le-nt).forEach((Le,nt)=>{Ue.get(Le).forEach((Ri,jo)=>{We.push({...Ri,position:{x:ne+nt*R,y:ie+jo*H}})})}),r(We),Fe("flow")},[u,t,s,r,Ye]),b.useCallback(()=>{if(!u)return;Ye();const R=250,H=180,ne=100,ie=100,re={};t.forEach(Te=>{var We;const Ue=((We=Te.data)==null?void 0:We.layer)||"application";re[Ue]||(re[Ue]=[]),re[Ue].push(Te)});const ye=["presentation","application","data","external","deployment"];let _e=ie;const we=[];ye.forEach(Te=>{const Ue=re[Te]||[];Ue.forEach((We,ot)=>{we.push({...We,position:{x:ne+ot*R,y:_e}})}),Ue.length>0&&(_e+=H)}),Object.entries(re).forEach(([Te,Ue])=>{ye.includes(Te)||(Ue.forEach((We,ot)=>{we.push({...We,position:{x:ne+ot*R,y:_e}})}),_e+=H)}),r(we),Fe("layer")},[u,t,r,Ye]);const Dn=b.useCallback(async R=>{Yr(!0),hn(!0),nn(null);try{const H=await fetch(`/api/component/${encodeURIComponent(R)}/deep`);if(H.ok){const ne=await H.json();nn(ne)}}catch{}Yr(!1)},[]),$n=b.useCallback((R,H)=>{if(!u)return;const ne=u.nodes.find(ie=>ie.id===H.id);ne&&(xr(ne),Nt(!0))},[u]);b.useEffect(()=>{const R=H=>{if(H.target instanceof HTMLInputElement||H.target instanceof HTMLTextAreaElement)return;const ie=navigator.platform.toUpperCase().indexOf("MAC")>=0?H.metaKey:H.ctrlKey;if(H.key==="Backspace"||H.key==="Delete"){H.preventDefault(),Be();return}if(ie&&H.key==="c"){H.preventDefault(),Eo();return}if(ie&&H.key==="v"){H.preventDefault(),Co();return}if(ie&&H.shiftKey&&H.key==="z"){H.preventDefault(),ni();return}if(ie&&H.key==="z"){H.preventDefault(),Ln();return}if(ie&&H.key==="s"){H.preventDefault(),An();return}if(H.key==="Escape"){Nt(!1),hn(!1),zn();return}if(H.key==="ArrowUp"){H.preventDefault(),qn(0,H.shiftKey?-Gt*5:-Gt);return}if(H.key==="ArrowDown"){H.preventDefault(),qn(0,H.shiftKey?Gt*5:Gt);return}if(H.key==="ArrowLeft"){H.preventDefault(),qn(H.shiftKey?-Gt*5:-Gt,0);return}if(H.key==="ArrowRight"){H.preventDefault(),qn(H.shiftKey?Gt*5:Gt,0);return}};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[Be,Eo,Co,An,qn,Ln,ni]);const on=b.useMemo(()=>u?u.nodes.filter(R=>oe.has(R.id)):[],[u,oe]);return b.useEffect(()=>{u&&r(R=>R.map(H=>({...H,data:{...H.data,highlighted:H.id===fr}})))},[fr,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"}),W?d.jsx(jE,{projectInfo:W}):d.jsx("span",{className:"archbyte-tagline",children:"See what agents build. As they build it."})]}),E.loggedIn&&d.jsx("div",{className:"branding-account",children:E.email&&d.jsxs("span",{className:"account-email",children:[E.email,E.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:"Analyze"}),d.jsxs("div",{className:"toolbar-section-items",children:[d.jsxs(Np,{trigger:M?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"flow-dot-inline",style:{background:M.color}}),M.name]}):d.jsx(d.Fragment,{children:"▶ Flows ▾"}),triggerClassName:`toolbar-btn ${M?"has-active-flow":""}`,children:[M&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"dropdown-item flow-clear",onClick:zn,children:"⏹ Clear active flow"}),d.jsx("div",{className:"dropdown-separator"})]}),u!=null&&u.flows&&u.flows.length>0?(()=>{const R=["user-journey","data-pipeline","system","deployment","error-recovery"],H={"user-journey":"User Journey","data-pipeline":"Data Pipeline",system:"System",deployment:"Deployment","error-recovery":"Error / Recovery"},ne={"user-journey":"#3b82f6","data-pipeline":"#22c55e",system:"#f59e0b",deployment:"#a855f7","error-recovery":"#ef4444"},ie={};for(const _e of u.flows){const we=_e.category||"system";ie[we]||(ie[we]=[]),ie[we].push(_e)}const re=[];for(const _e of R){const we=ie[_e];if(we!=null&&we.length){re.push(d.jsxs("div",{className:"flow-category-header",children:[d.jsx("span",{className:"flow-dot-inline",style:{background:ne[_e]}}),H[_e]||_e]},`cat-${_e}`));for(const Te of we)re.push(d.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(M==null?void 0:M.id)===Te.id?"active":""}`,onClick:()=>{(M==null?void 0:M.id)===Te.id?zn():Ct(Te)},children:[d.jsx("span",{className:"flow-dot-inline",style:{background:Te.color}}),d.jsx("span",{className:"flow-dropdown-name",children:Te.name}),(M==null?void 0:M.id)===Te.id&&d.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Te.id))}}const ye=new Set(R);for(const[_e,we]of Object.entries(ie))if(!ye.has(_e)&&we!=null&&we.length){re.push(d.jsxs("div",{className:"flow-category-header",children:[d.jsx("span",{className:"flow-dot-inline",style:{background:"#6b7280"}}),_e]},`cat-${_e}`));for(const Te of we)re.push(d.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(M==null?void 0:M.id)===Te.id?"active":""}`,onClick:()=>{(M==null?void 0:M.id)===Te.id?zn():Ct(Te)},children:[d.jsx("span",{className:"flow-dot-inline",style:{background:Te.color}}),d.jsx("span",{className:"flow-dropdown-name",children:Te.name}),(M==null?void 0:M.id)===Te.id&&d.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Te.id))}return re})():d.jsx("span",{className:"dropdown-item disabled",children:"No flows defined"})]}),d.jsx("button",{className:`toolbar-btn premium-btn ${E.features.audit?"":"premium-locked"} ${Pt?"active":""}`,onClick:()=>{if(!E.features.audit){L("Audit");return}wt(!Pt)},children:"Audit"})]})]}),!kt&&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 ${E.features.workflows?"":"premium-locked"} ${gt?"active":""}`,title:E.features.workflows?"":"Available in Pro",onClick:()=>{if(!E.features.workflows){L("Workflows");return}St(!gt),Yt(!1)},children:"Workflows"}),d.jsx("button",{className:`toolbar-btn premium-btn ${E.features.premiumAgents?"":"premium-locked"} ${Ut?"active":""}`,title:E.features.premiumAgents?"":"Available in Pro",onClick:()=>{if(!E.features.premiumAgents){L("Pro Agents");return}Ut?Yt(!1):(Yt(!0),St(!1))},children:"Agents"})]})]})]}),d.jsxs("div",{className:"toolbar-right",children:[U&&!kt&&d.jsxs("span",{className:"toolbar-analyzing",children:[d.jsx("span",{className:"analyzing-pulse"}),"Re-analyzing..."]}),V&&!kt&&d.jsx("button",{className:"toolbar-btn toolbar-error-btn",onClick:()=>J(null),title:V,children:"Analysis failed"}),!kt&&d.jsx("button",{className:"toolbar-btn",onClick:async()=>{await fetch("/api/reload",{method:"POST"})},title:"Reload architecture and refresh pending changes",children:"Reload"}),d.jsx("button",{className:`toolbar-btn ${Ae?"active":""}`,onClick:()=>et(!Ae),children:"Stats"}),d.jsxs(Np,{trigger:ji?"Exporting...":"↓ Export ▾",triggerClassName:"toolbar-btn",disabled:ji,children:[d.jsx("div",{className:"dropdown-label",children:"Image"}),d.jsx("button",{className:"dropdown-item",onClick:js,children:"PNG"}),d.jsx("button",{className:"dropdown-item",onClick:_o,children:"SVG"}),d.jsx("div",{className:"dropdown-separator"}),d.jsx("div",{className:"dropdown-label",children:"Diagram"}),d.jsx("button",{className:"dropdown-item",onClick:()=>yn("mermaid"),children:"Mermaid"}),d.jsx("button",{className:"dropdown-item",onClick:()=>yn("plantuml"),children:"PlantUML"}),d.jsx("button",{className:"dropdown-item",onClick:()=>yn("dot"),children:"DOT"}),d.jsx("div",{className:"dropdown-separator"}),d.jsx("div",{className:"dropdown-label",children:"Document"}),d.jsx("button",{className:"dropdown-item",onClick:()=>yn("markdown"),children:"Markdown"}),d.jsx("button",{className:"dropdown-item",onClick:()=>yn("json"),children:"JSON"}),d.jsx("div",{className:"dropdown-separator"}),d.jsx("div",{className:"dropdown-label",children:"Interactive"}),d.jsx("button",{className:`dropdown-item ${E.tier!=="premium"?"premium-locked":""}`,onClick:()=>{if(E.tier!=="premium"){L("HTML Export");return}yn("html")},children:"HTML"})]}),d.jsx("button",{className:"toolbar-btn-icon",onClick:()=>vr(lt==="dark"?"light":"dark"),title:`Switch to ${lt==="dark"?"light":"dark"} mode`,children:lt==="dark"?"☀":"☽"})]})]}),te&&te.count>0&&!U&&!kt&&d.jsxs("div",{className:"changes-banner",children:[d.jsx("span",{className:"changes-banner-pulse"}),d.jsxs("span",{className:"changes-banner-text",children:[te.componentChanges.length>0?`${te.componentChanges.length} component${te.componentChanges.length!==1?"s":""} affected`:`${te.count} file${te.count!==1?"s":""} changed`,d.jsxs("span",{className:"changes-banner-file-count",children:["(",te.count," file",te.count!==1?"s":"",")"]})]}),te.componentChanges.length>0&&d.jsxs("div",{className:"changes-banner-components",children:[te.componentChanges.map(R=>{const H=R.files.some(ie=>ie.event==="add"),ne=R.files.some(ie=>ie.event==="unlink");return d.jsxs("button",{className:"changes-component-chip",onClick:()=>Lt(R.componentId),children:[H&&d.jsx("span",{className:"changes-event-dot new"}),ne&&d.jsx("span",{className:"changes-event-dot del"}),!H&&!ne&&d.jsx("span",{className:"changes-event-dot mod"}),R.componentName,d.jsx("span",{className:"changes-component-count",children:R.files.length})]},R.componentId)}),te.unmapped.length>0&&d.jsxs("span",{className:"changes-component-chip unmapped",title:te.unmapped.map(R=>`${R.event==="add"?"+":R.event==="unlink"?"-":"~"} ${R.path}`).join(`
68
+ `),children:["Other",d.jsx("span",{className:"changes-component-count",children:te.unmapped.length})]})]}),d.jsxs("div",{className:"changes-banner-actions",children:[d.jsx("button",{className:"changes-banner-btn quick",onClick:Sr,title:"Fast re-scan using static analysis only (~2s)",children:"Quick Scan"}),d.jsx("button",{className:"changes-banner-btn full",onClick:xo,title:"Full re-scan using AI agents for deeper analysis",children:"Re-analyze"})]}),d.jsx("button",{className:"changes-banner-dismiss",onClick:()=>z(null),title:"Dismiss",children:"x"})]}),d.jsx(mE,{selectedEnvironment:zt,environments:go,onSelectEnvironment:Xr}),d.jsxs("div",{className:"canvas-container",children:[d.jsx("div",{className:"watermark",children:"archbyte"}),d.jsxs(pg,{nodes:t.map(R=>({...R,draggable:!Mn.has(R.id),data:{...R.data,locked:Mn.has(R.id)}})),edges:s.map(R=>{var H;return{...R,style:{...R.style,opacity:1,strokeWidth:((H=R.style)==null?void 0:H.strokeWidth)||2}}}),onNodesChange:ei,onEdgesChange:c,onNodeClick:(R,H)=>{Ti(R,H)},onNodeDoubleClick:$n,onPaneClick:()=>{ko(),document.dispatchEvent(new Event("dropdown:closeall"))},onConnect:Cs,onReconnect:_s,edgesReconnectable:!0,onSelectionChange:No,nodeTypes:QE,connectionMode:ki.Loose,snapToGrid:!0,snapGrid:[Jr,Jr],selectionOnDrag:!0,selectNodesOnDrag:!1,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,attributionPosition:"bottom-left",deleteKeyCode:null,children:[d.jsx(gg,{color:lt==="dark"?"hsl(220 25% 15%)":"hsl(220 15% 82%)",gap:20,variant:Yn.Dots}),d.jsx(vg,{})]}),yo&&tt&&d.jsxs(xi,{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:tt.label.split(`
69
+ `)[0]}),d.jsxs("div",{className:"node-details-type-row",children:[d.jsxs("span",{children:[tt.layer," • ",tt.type]}),tt.path&&d.jsx("button",{className:"panel-btn small green",onClick:()=>{Dn(tt.id),Nt(!1)},disabled:rn,children:rn?"...":"INSPECT"})]})]}),d.jsx("button",{className:"panel-close-btn",onClick:()=>Nt(!1),children:"×"})]}),tt.path&&d.jsxs("div",{className:"node-details-section",children:[d.jsx("div",{className:"node-details-section-title",children:"Path"}),d.jsx("div",{className:"node-details-path",style:{userSelect:"text"},children:tt.path})]}),tt.techStack&&tt.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:tt.techStack.map((R,H)=>d.jsx("span",{className:"tech-badge",children:R},H))})]}),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(R=>R.source===tt.id||R.target===tt.id).map(R=>{const H=R.source===tt.id,ne=H?R.target:R.source,ie=u==null?void 0:u.nodes.find(re=>re.id===ne);return d.jsxs("div",{className:"connection-item-detailed",onClick:()=>Lt(ne),style:{cursor:"pointer"},title:`Click to highlight ${(ie==null?void 0:ie.label.split(`
70
+ `)[0])||ne}`,children:[d.jsxs("div",{className:"connection-header",children:[d.jsx("span",{className:"connection-arrow",children:H?"→":"←"}),d.jsx("span",{className:"connection-target",children:(ie==null?void 0:ie.label.split(`
71
+ `)[0])||ne})]}),R.label&&d.jsx("div",{className:"connection-label",children:R.label})]},R.id)}),(u==null?void 0:u.edges.filter(R=>R.source===tt.id||R.target===tt.id).length)===0&&d.jsx("span",{style:{color:"var(--text-muted)"},children:"No connections"})]})]}),(()=>{var H;const R=(H=te==null?void 0:te.componentChanges)==null?void 0:H.find(ne=>ne.componentId===tt.id);return!R||R.files.length===0?null:d.jsxs("div",{className:"pending-sticky-note",children:[d.jsxs("div",{className:"pending-sticky-header",children:[R.files.length," file",R.files.length!==1?"s":""," changed"]}),R.files.slice(0,8).map((ne,ie)=>d.jsxs("div",{className:`pending-file-row ${ne.event}`,children:[d.jsx("span",{className:"pending-file-event",children:ne.event==="add"?"+":ne.event==="unlink"?"-":"~"}),d.jsx("span",{className:"pending-file-name",children:ne.path.split("/").pop()})]},ie)),R.files.length>8&&d.jsxs("div",{className:"pending-file-more",children:["+",R.files.length-8," more"]})]})})()]}),fn&&d.jsxs(xi,{className:"deep-drill-panel",children:[d.jsxs("div",{className:"deep-drill-header","data-drag-handle":!0,children:[d.jsxs("div",{children:[d.jsx("div",{className:"deep-drill-title",children:(be==null?void 0:be.componentName)||"INSPECT"}),d.jsx("div",{className:"deep-drill-subtitle",children:(be==null?void 0:be.componentPath)||"Scanning..."})]}),d.jsx("button",{className:"panel-close-btn",onClick:()=>hn(!1),children:"x"})]}),rn&&d.jsxs("div",{className:"deep-drill-loading",children:[d.jsx("div",{className:"loading-spinner"}),"Scanning component..."]}),be&&!rn&&d.jsxs("div",{className:"deep-drill-body",children:[d.jsxs("div",{className:"deep-drill-meta",children:["Scanned in ",be.durationMs,"ms"]}),d.jsxs(oo,{title:"Metrics",defaultOpen:!0,children:[d.jsxs("div",{className:"dd-metric-grid",children:[d.jsxs("div",{className:"dd-metric-card",children:[d.jsx("div",{className:"dd-metric-value",children:be.metrics.fileCount}),d.jsx("div",{className:"dd-metric-label",children:"Files"})]}),d.jsxs("div",{className:"dd-metric-card",children:[d.jsx("div",{className:"dd-metric-value",children:be.metrics.codeFileCount}),d.jsx("div",{className:"dd-metric-label",children:"Code Files"})]}),d.jsxs("div",{className:"dd-metric-card",children:[d.jsx("div",{className:"dd-metric-value",children:be.metrics.totalLines.toLocaleString()}),d.jsx("div",{className:"dd-metric-label",children:"Lines"})]})]}),be.metrics.languages.length>0&&d.jsx("div",{className:"dd-lang-badges",children:be.metrics.languages.map(R=>d.jsxs("span",{className:"dd-lang-badge",children:[R.language," (",R.files,")"]},R.language))})]}),(be.structure.keyFiles.length>0||be.structure.publicExports.length>0)&&d.jsxs(oo,{title:"Internal Structure",children:[be.structure.keyFiles.length>0&&d.jsx("div",{className:"dd-key-files",children:be.structure.keyFiles.slice(0,10).map((R,H)=>d.jsxs("div",{className:"dd-key-file-item",children:[d.jsx("span",{className:"dd-role-badge",children:R.role}),d.jsx("span",{className:"dd-file-path",children:R.path.replace(be.componentPath+"/","")})]},H))}),be.structure.publicExports.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"dd-subsection-title",children:"Public Exports"}),d.jsx("div",{className:"dd-exports",children:be.structure.publicExports.slice(0,15).map((R,H)=>d.jsx("span",{className:"dd-export-name",children:R},H))})]})]}),be.dependencies.manifest&&d.jsxs(oo,{title:`Dependencies (${be.dependencies.manifest})`,children:[be.dependencies.production.length>0&&d.jsxs("div",{className:"dd-dep-list",children:[be.dependencies.production.slice(0,15).map((R,H)=>d.jsx("span",{className:`dd-dep-badge ${R.category?"categorized":""}`,title:R.category||R.name,children:R.displayName},H)),be.dependencies.production.length>15&&d.jsxs("span",{className:"dd-dep-more",children:["+",be.dependencies.production.length-15," more"]})]}),be.dependencies.development.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"dd-subsection-title",children:"Dev Dependencies"}),d.jsxs("div",{className:"dd-dep-list",children:[be.dependencies.development.slice(0,10).map((R,H)=>d.jsx("span",{className:"dd-dep-badge dev",title:R.category||R.name,children:R.displayName},H)),be.dependencies.development.length>10&&d.jsxs("span",{className:"dd-dep-more",children:["+",be.dependencies.development.length-10," more"]})]})]})]}),be.patterns.length>0&&d.jsx(oo,{title:"Code Patterns",children:be.patterns.map((R,H)=>d.jsxs("div",{className:"dd-pattern-group",children:[d.jsxs("div",{className:"dd-pattern-header",children:[d.jsx("span",{className:"dd-pattern-label",children:R.label}),d.jsx("span",{className:"dd-pattern-count",children:R.count})]}),d.jsx("div",{className:"dd-pattern-matches",children:R.matches.slice(0,3).map((ne,ie)=>d.jsxs("div",{className:"dd-pattern-match",children:[d.jsxs("span",{className:"dd-match-file",children:[ne.file.replace(be.componentPath+"/",""),":",ne.line]}),d.jsx("span",{className:"dd-match-content",children:ne.content})]},ie))})]},H))}),(be.connections.outgoing.length>0||be.connections.incoming.length>0)&&d.jsxs(oo,{title:"Connections",children:[be.connections.outgoing.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"dd-subsection-title",children:"Outgoing"}),be.connections.outgoing.map((R,H)=>d.jsxs("div",{className:"dd-connection-item",children:[d.jsx("span",{className:"dd-conn-arrow",children:"->"}),d.jsx("span",{className:"dd-conn-name",children:R.targetName}),R.type&&d.jsx("span",{className:"dd-conn-type",children:R.type})]},H))]}),be.connections.incoming.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"dd-subsection-title",children:"Incoming"}),be.connections.incoming.map((R,H)=>d.jsxs("div",{className:"dd-connection-item",children:[d.jsx("span",{className:"dd-conn-arrow",children:"<-"}),d.jsx("span",{className:"dd-conn-name",children:R.sourceName}),R.type&&d.jsx("span",{className:"dd-conn-type",children:R.type})]},H))]})]}),be.fileTree.length>0&&d.jsx(oo,{title:"File Tree",children:d.jsx("div",{className:"dd-file-tree",children:Ig(be.fileTree,be.componentPath)})})]})]}),It.size>0&&!kt&&d.jsxs("div",{className:"save-panel",children:[d.jsxs("span",{className:"save-panel-text",children:[It.size," unsaved change",It.size!==1?"s":""]}),d.jsx("button",{className:"save-btn",onClick:An,disabled:pr,children:pr?"Saving...":"Save Changes"}),d.jsx("button",{className:"discard-btn",onClick:ti,disabled:pr,children:"Discard"})]}),on.length>0&&d.jsxs("div",{className:"hidden-nodes-panel",children:[d.jsxs("div",{className:"hidden-nodes-title",children:["Hidden (",on.length,")",d.jsx("button",{className:"panel-btn cyan small",onClick:Nr,children:"Show All"})]}),d.jsx("div",{className:"hidden-nodes-list",style:{maxHeight:220,overflowY:"auto"},children:on.map(R=>d.jsxs("div",{className:"hidden-node-item",children:[d.jsx("span",{className:"hidden-node-name",children:R.label.split(`
72
+ `)[0]}),d.jsx("button",{className:"panel-btn green small",onClick:()=>showNode(R.id),children:"Show"})]},R.id))})]}),M&&d.jsxs("div",{className:"flow-progress-bar",children:[d.jsx("span",{className:"flow-progress-dot",style:{background:M.color}}),d.jsx("span",{className:"flow-progress-name",children:M.name}),d.jsx("div",{className:"flow-progress-steps",children:M.steps.map((R,H)=>d.jsx("div",{className:`flow-progress-step ${H<=Y?"active":""} ${H===Y?"current":""}`,style:{borderColor:H<=Y?M.color:void 0},title:R.label,children:R.label},H))}),d.jsxs("div",{className:"flow-progress-controls",children:[$?d.jsx("button",{className:"flow-progress-btn",onClick:wo,title:"Pause",children:"⏸"}):d.jsx("button",{className:"flow-progress-btn",onClick:So,title:"Resume",children:"▶"}),d.jsx("button",{className:"flow-progress-btn stop",onClick:zn,title:"Stop",children:"⏹"})]})]}),he&&M&&u&&d.jsx(TE,{flow:M,architecture:u,onClose:zn}),d.jsx(xE,{visible:Ae,onClose:()=>et(!1)}),d.jsx(EE,{visible:Pt,onClose:()=>wt(!1),onHighlightNode:R=>{Lt(R)}}),gt&&d.jsxs(xi,{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:()=>St(!1),children:"x"})]}),d.jsx(_E,{visible:!0})]}),d.jsx(GE,{visible:Ut,onClose:()=>Yt(!1),results:ur}),x.length>0&&d.jsxs("div",{className:"agent-panel",children:[d.jsx("div",{className:"agent-panel-title",children:"Agent Activity"}),x.map((R,H)=>d.jsxs("div",{className:"agent-item",children:[d.jsx("div",{className:`agent-dot ${H===0?"active":""}`}),d.jsx("span",{className:"agent-name",children:R.agentName}),d.jsx("span",{className:"agent-target",children:R.targetComponent||R.action})]},H))]})]}),kt&&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:[!kt&&d.jsxs("div",{className:"status-indicator",children:[d.jsx("div",{className:`status-dot ${m?"":"disconnected"}`}),d.jsx("span",{children:m?"Live":"Offline"})]}),kt&&d.jsx("span",{style:{color:"var(--text-dim)",fontSize:11},children:"Standalone Export"}),S&&!kt&&d.jsx("span",{style:{color:"var(--accent-red)"},children:S})]}),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..."}),Xt?d.jsxs("span",{className:"git-status",children:[Xt.repo&&d.jsx("a",{href:((Er=Xt.remoteUrl)==null?void 0:Er.replace(/^git@([^:]+):/,"https://$1/").replace(/\.git$/,""))||"#",target:"_blank",rel:"noopener noreferrer",className:"git-repo-badge",title:Xt.remoteUrl||"",children:Xt.repo}),d.jsx("span",{className:"git-branch",children:Xt.branch}),d.jsx("span",{className:"git-hash",children:Xt.commit})]}):d.jsxs("span",{children:["v",(u==null?void 0:u.version)||1]})]})]}),B&&d.jsx(zE,{onComplete:()=>{Z(!1),Tn()}}),F&&d.jsx(uE,{feature:F,onClose:()=>L(null)})]})}h0.createRoot(document.getElementById("root")).render(d.jsx(_p.StrictMode,{children:d.jsx(ZE,{})}));