archbyte 0.2.2 → 0.2.3
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.
- package/bin/archbyte.js +28 -6
- package/dist/agents/prompt-data.js +4 -4
- package/dist/agents/providers/router.js +1 -16
- package/dist/agents/runtime/types.d.ts +5 -1
- package/dist/agents/runtime/types.js +3 -3
- package/dist/agents/static/code-sampler.js +1 -4
- package/dist/agents/static/component-detector.js +1 -4
- package/dist/agents/static/event-detector.js +2 -1
- package/dist/agents/static/excluded-dirs.d.ts +3 -0
- package/dist/agents/static/excluded-dirs.js +11 -0
- package/dist/agents/static/file-tree-collector.js +1 -5
- package/dist/agents/tools/claude-code.js +2 -5
- package/dist/agents/tools/local-fs.js +2 -6
- package/dist/cli/analyze.d.ts +1 -0
- package/dist/cli/analyze.js +1 -2
- package/dist/cli/auth.js +2 -5
- package/dist/cli/config.d.ts +1 -0
- package/dist/cli/config.js +76 -57
- package/dist/cli/constants.d.ts +13 -0
- package/dist/cli/constants.js +20 -0
- package/dist/cli/gate.js +3 -3
- package/dist/cli/generate.js +2 -1
- package/dist/cli/license-gate.js +3 -3
- package/dist/cli/run.d.ts +1 -0
- package/dist/cli/run.js +3 -7
- package/dist/cli/serve.js +3 -2
- package/dist/cli/setup.js +112 -72
- package/dist/cli/version.d.ts +2 -0
- package/dist/cli/version.js +84 -0
- package/dist/server/src/index.js +40 -0
- package/package.json +1 -1
- package/ui/dist/assets/{index-Bl1r8zrI.css → index-0_XpUUZQ.css} +1 -1
- package/ui/dist/assets/index-BdfGbhpp.js +70 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-CqbB6DOK.js +0 -70
|
@@ -1,70 +0,0 @@
|
|
|
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 o(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=o(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={},Oc={exports:{}},Le={};/**
|
|
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 Jf;function n0(){if(Jf)return Le;Jf=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=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(M){return M===null||typeof M!="object"?null:(M=y&&M[y]||M["@@iterator"],typeof M=="function"?M:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function k(M,$,se){this.props=M,this.context=$,this.refs=N,this.updater=se||_}k.prototype.isReactComponent={},k.prototype.setState=function(M,$){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,$,"setState")},k.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function S(){}S.prototype=k.prototype;function I(M,$,se){this.props=M,this.context=$,this.refs=N,this.updater=se||_}var C=I.prototype=new S;C.constructor=I,E(C,k.prototype),C.isPureReactComponent=!0;var j=Array.isArray,O=Object.prototype.hasOwnProperty,A={current:null},H={key:!0,ref:!0,__self:!0,__source:!0};function q(M,$,se){var oe,de={},fe=null,me=null;if($!=null)for(oe in $.ref!==void 0&&(me=$.ref),$.key!==void 0&&(fe=""+$.key),$)O.call($,oe)&&!H.hasOwnProperty(oe)&&(de[oe]=$[oe]);var te=arguments.length-2;if(te===1)de.children=se;else if(1<te){for(var pe=Array(te),_e=0;_e<te;_e++)pe[_e]=arguments[_e+2];de.children=pe}if(M&&M.defaultProps)for(oe in te=M.defaultProps,te)de[oe]===void 0&&(de[oe]=te[oe]);return{$$typeof:t,type:M,key:fe,ref:me,props:de,_owner:A.current}}function J(M,$){return{$$typeof:t,type:M.type,key:$,ref:M.ref,props:M.props,_owner:M._owner}}function ee(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function U(M){var $={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(se){return $[se]})}var X=/\/+/g;function re(M,$){return typeof M=="object"&&M!==null&&M.key!=null?U(""+M.key):$.toString(36)}function b(M,$,se,oe,de){var fe=typeof M;(fe==="undefined"||fe==="boolean")&&(M=null);var me=!1;if(M===null)me=!0;else switch(fe){case"string":case"number":me=!0;break;case"object":switch(M.$$typeof){case t:case r:me=!0}}if(me)return me=M,de=de(me),M=oe===""?"."+re(me,0):oe,j(de)?(se="",M!=null&&(se=M.replace(X,"$&/")+"/"),b(de,$,se,"",function(_e){return _e})):de!=null&&(ee(de)&&(de=J(de,se+(!de.key||me&&me.key===de.key?"":(""+de.key).replace(X,"$&/")+"/")+M)),$.push(de)),1;if(me=0,oe=oe===""?".":oe+":",j(M))for(var te=0;te<M.length;te++){fe=M[te];var pe=oe+re(fe,te);me+=b(fe,$,se,pe,de)}else if(pe=x(M),typeof pe=="function")for(M=pe.call(M),te=0;!(fe=M.next()).done;)fe=fe.value,pe=oe+re(fe,te++),me+=b(fe,$,se,pe,de);else if(fe==="object")throw $=String(M),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return me}function K(M,$,se){if(M==null)return M;var oe=[],de=0;return b(M,oe,"","",function(fe){return $.call(se,fe,de++)}),oe}function V(M){if(M._status===-1){var $=M._result;$=$(),$.then(function(se){(M._status===0||M._status===-1)&&(M._status=1,M._result=se)},function(se){(M._status===0||M._status===-1)&&(M._status=2,M._result=se)}),M._status===-1&&(M._status=0,M._result=$)}if(M._status===1)return M._result.default;throw M._result}var G={current:null},z={transition:null},R={ReactCurrentDispatcher:G,ReactCurrentBatchConfig:z,ReactCurrentOwner:A};function B(){throw Error("act(...) is not supported in production builds of React.")}return Le.Children={map:K,forEach:function(M,$,se){K(M,function(){$.apply(this,arguments)},se)},count:function(M){var $=0;return K(M,function(){$++}),$},toArray:function(M){return K(M,function($){return $})||[]},only:function(M){if(!ee(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Le.Component=k,Le.Fragment=o,Le.Profiler=a,Le.PureComponent=I,Le.StrictMode=s,Le.Suspense=m,Le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,Le.act=B,Le.cloneElement=function(M,$,se){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var oe=E({},M.props),de=M.key,fe=M.ref,me=M._owner;if($!=null){if($.ref!==void 0&&(fe=$.ref,me=A.current),$.key!==void 0&&(de=""+$.key),M.type&&M.type.defaultProps)var te=M.type.defaultProps;for(pe in $)O.call($,pe)&&!H.hasOwnProperty(pe)&&(oe[pe]=$[pe]===void 0&&te!==void 0?te[pe]:$[pe])}var pe=arguments.length-2;if(pe===1)oe.children=se;else if(1<pe){te=Array(pe);for(var _e=0;_e<pe;_e++)te[_e]=arguments[_e+2];oe.children=te}return{$$typeof:t,type:M.type,key:de,ref:fe,props:oe,_owner:me}},Le.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:c,_context:M},M.Consumer=M},Le.createElement=q,Le.createFactory=function(M){var $=q.bind(null,M);return $.type=M,$},Le.createRef=function(){return{current:null}},Le.forwardRef=function(M){return{$$typeof:h,render:M}},Le.isValidElement=ee,Le.lazy=function(M){return{$$typeof:v,_payload:{_status:-1,_result:M},_init:V}},Le.memo=function(M,$){return{$$typeof:g,type:M,compare:$===void 0?null:$}},Le.startTransition=function(M){var $=z.transition;z.transition={};try{M()}finally{z.transition=$}},Le.unstable_act=B,Le.useCallback=function(M,$){return G.current.useCallback(M,$)},Le.useContext=function(M){return G.current.useContext(M)},Le.useDebugValue=function(){},Le.useDeferredValue=function(M){return G.current.useDeferredValue(M)},Le.useEffect=function(M,$){return G.current.useEffect(M,$)},Le.useId=function(){return G.current.useId()},Le.useImperativeHandle=function(M,$,se){return G.current.useImperativeHandle(M,$,se)},Le.useInsertionEffect=function(M,$){return G.current.useInsertionEffect(M,$)},Le.useLayoutEffect=function(M,$){return G.current.useLayoutEffect(M,$)},Le.useMemo=function(M,$){return G.current.useMemo(M,$)},Le.useReducer=function(M,$,se){return G.current.useReducer(M,$,se)},Le.useRef=function(M){return G.current.useRef(M)},Le.useState=function(M){return G.current.useState(M)},Le.useSyncExternalStore=function(M,$,se){return G.current.useSyncExternalStore(M,$,se)},Le.useTransition=function(){return G.current.useTransition()},Le.version="18.3.1",Le}var eh;function ys(){return eh||(eh=1,Oc.exports=n0()),Oc.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 th;function r0(){if(th)return es;th=1;var t=ys(),r=Symbol.for("react.element"),o=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,_=null;g!==void 0&&(x=""+g),m.key!==void 0&&(x=""+m.key),m.ref!==void 0&&(_=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:_,props:y,_owner:a.current}}return es.Fragment=o,es.jsx=u,es.jsxs=u,es}var nh;function o0(){return nh||(nh=1,$c.exports=r0()),$c.exports}var f=o0(),P=ys();const Np=vu(P);var _l={},Fc={exports:{}},Ft={},Hc={exports:{}},Vc={};/**
|
|
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 rh;function i0(){return rh||(rh=1,(function(t){function r(z,R){var B=z.length;z.push(R);e:for(;0<B;){var M=B-1>>>1,$=z[M];if(0<a($,R))z[M]=R,z[B]=$,B=M;else break e}}function o(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var R=z[0],B=z.pop();if(B!==R){z[0]=B;e:for(var M=0,$=z.length,se=$>>>1;M<se;){var oe=2*(M+1)-1,de=z[oe],fe=oe+1,me=z[fe];if(0>a(de,B))fe<$&&0>a(me,de)?(z[M]=me,z[fe]=B,M=fe):(z[M]=de,z[oe]=B,M=oe);else if(fe<$&&0>a(me,B))z[M]=me,z[fe]=B,M=fe;else break e}}return R}function a(z,R){var B=z.sortIndex-R.sortIndex;return B!==0?B:z.id-R.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,_=!1,E=!1,N=!1,k=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(z){for(var R=o(g);R!==null;){if(R.callback===null)s(g);else if(R.startTime<=z)s(g),R.sortIndex=R.expirationTime,r(m,R);else break;R=o(g)}}function j(z){if(N=!1,C(z),!E)if(o(m)!==null)E=!0,V(O);else{var R=o(g);R!==null&&G(j,R.startTime-z)}}function O(z,R){E=!1,N&&(N=!1,S(q),q=-1),_=!0;var B=x;try{for(C(R),y=o(m);y!==null&&(!(y.expirationTime>R)||z&&!U());){var M=y.callback;if(typeof M=="function"){y.callback=null,x=y.priorityLevel;var $=M(y.expirationTime<=R);R=t.unstable_now(),typeof $=="function"?y.callback=$:y===o(m)&&s(m),C(R)}else s(m);y=o(m)}if(y!==null)var se=!0;else{var oe=o(g);oe!==null&&G(j,oe.startTime-R),se=!1}return se}finally{y=null,x=B,_=!1}}var A=!1,H=null,q=-1,J=5,ee=-1;function U(){return!(t.unstable_now()-ee<J)}function X(){if(H!==null){var z=t.unstable_now();ee=z;var R=!0;try{R=H(!0,z)}finally{R?re():(A=!1,H=null)}}else A=!1}var re;if(typeof I=="function")re=function(){I(X)};else if(typeof MessageChannel<"u"){var b=new MessageChannel,K=b.port2;b.port1.onmessage=X,re=function(){K.postMessage(null)}}else re=function(){k(X,0)};function V(z){H=z,A||(A=!0,re())}function G(z,R){q=k(function(){z(t.unstable_now())},R)}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(z){z.callback=null},t.unstable_continueExecution=function(){E||_||(E=!0,V(O))},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_getFirstCallbackNode=function(){return o(m)},t.unstable_next=function(z){switch(x){case 1:case 2:case 3:var R=3;break;default:R=x}var B=x;x=R;try{return z()}finally{x=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(z,R){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var B=x;x=z;try{return R()}finally{x=B}},t.unstable_scheduleCallback=function(z,R,B){var M=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?M+B:M):B=M,z){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=B+$,z={id:v++,callback:R,priorityLevel:z,startTime:B,expirationTime:$,sortIndex:-1},B>M?(z.sortIndex=B,r(g,z),o(m)===null&&z===o(g)&&(N?(S(q),q=-1):N=!0,G(j,B-M))):(z.sortIndex=$,r(m,z),E||_||(E=!0,V(O))),z},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(z){var R=x;return function(){var B=x;x=R;try{return z.apply(this,arguments)}finally{x=B}}}})(Vc)),Vc}var oh;function s0(){return oh||(oh=1,Hc.exports=i0()),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 ih;function l0(){if(ih)return Ft;ih=1;var t=ys(),r=s0();function o(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i]);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 _(e,n,i,l){if(i!==null&&i.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,n,i,l){if(n===null||typeof n>"u"||_(e,n,i,l))return!0;if(l)return!1;if(i!==null)switch(i.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 N(e,n,i,l,d,p,w){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=d,this.mustUseProperty=i,this.propertyName=e,this.type=n,this.sanitizeURL=p,this.removeEmptyString=w}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){k[e]=new N(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];k[n]=new N(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){k[e]=new N(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){k[e]=new N(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){k[e]=new N(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){k[e]=new N(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){k[e]=new N(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){k[e]=new N(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){k[e]=new N(e,5,!1,e.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function I(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(S,I);k[n]=new N(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(S,I);k[n]=new N(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(S,I);k[n]=new N(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){k[e]=new N(e,1,!1,e.toLowerCase(),null,!1,!1)}),k.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){k[e]=new N(e,1,!1,e.toLowerCase(),null,!0,!0)});function C(e,n,i,l){var d=k.hasOwnProperty(n)?k[n]:null;(d!==null?d.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(E(n,i,d,l)&&(i=null),l||d===null?x(n)&&(i===null?e.removeAttribute(n):e.setAttribute(n,""+i)):d.mustUseProperty?e[d.propertyName]=i===null?d.type===3?!1:"":i:(n=d.attributeName,l=d.attributeNamespace,i===null?e.removeAttribute(n):(d=d.type,i=d===3||d===4&&i===!0?"":""+i,l?e.setAttributeNS(l,n,i):e.setAttribute(n,i))))}var j=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,O=Symbol.for("react.element"),A=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),ee=Symbol.for("react.provider"),U=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),z=Symbol.iterator;function R(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var B=Object.assign,M;function $(e){if(M===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);M=n&&n[1]||""}return`
|
|
34
|
-
`+M+e}var se=!1;function oe(e,n){if(!e||se)return"";se=!0;var i=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(Z){var l=Z}Reflect.construct(e,[],n)}else{try{n.call()}catch(Z){l=Z}e.call(n.prototype)}else{try{throw Error()}catch(Z){l=Z}e()}}catch(Z){if(Z&&l&&typeof Z.stack=="string"){for(var d=Z.stack.split(`
|
|
35
|
-
`),p=l.stack.split(`
|
|
36
|
-
`),w=d.length-1,T=p.length-1;1<=w&&0<=T&&d[w]!==p[T];)T--;for(;1<=w&&0<=T;w--,T--)if(d[w]!==p[T]){if(w!==1||T!==1)do if(w--,T--,0>T||d[w]!==p[T]){var L=`
|
|
37
|
-
`+d[w].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=w&&0<=T);break}}}finally{se=!1,Error.prepareStackTrace=i}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=oe(e.type,!1),e;case 11:return e=oe(e.type.render,!1),e;case 1:return e=oe(e.type,!0),e;default:return""}}function fe(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case H:return"Fragment";case A:return"Portal";case J:return"Profiler";case q:return"StrictMode";case re:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U:return(e.displayName||"Context")+".Consumer";case ee:return(e._context.displayName||"Context")+".Provider";case X:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return n=e.displayName||null,n!==null?n:fe(e.type)||"Memo";case V:n=e._payload,e=e._init;try{return fe(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 fe(n);case 8:return n===q?"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 te(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 _e(e){var n=pe(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,p=i.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(w){l=""+w,p.call(this,w)}}),Object.defineProperty(e,n,{enumerable:i.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function be(e){e._valueTracker||(e._valueTracker=_e(e))}function je(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),l="";return e&&(l=pe(e)?e.checked?"true":"false":e.value),e=l,e!==i?(n.setValue(e),!0):!1}function Ee(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 Ae(e,n){var i=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function He(e,n){var i=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;i=te(n.value!=null?n.value:i),e._wrapperState={initialChecked:l,initialValue:i,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Re(e,n){n=n.checked,n!=null&&C(e,"checked",n,!1)}function Ue(e,n){Re(e,n);var i=te(n.value),l=n.type;if(i!=null)l==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?ht(e,n.type,i):n.hasOwnProperty("defaultValue")&&ht(e,n.type,te(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function st(e,n,i){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,i||n===e.value||(e.value=n),e.defaultValue=n}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function ht(e,n,i){(n!=="number"||Ee(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var vt=Array.isArray;function pt(e,n,i,l){if(e=e.options,n){n={};for(var d=0;d<i.length;d++)n["$"+i[d]]=!0;for(i=0;i<e.length;i++)d=n.hasOwnProperty("$"+e[i].value),e[i].selected!==d&&(e[i].selected=d),d&&l&&(e[i].defaultSelected=!0)}else{for(i=""+te(i),n=null,d=0;d<e.length;d++){if(e[d].value===i){e[d].selected=!0,l&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function pn(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(o(91));return B({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function zn(e,n){var i=n.value;if(i==null){if(i=n.children,n=n.defaultValue,i!=null){if(n!=null)throw Error(o(92));if(vt(i)){if(1<i.length)throw Error(o(93));i=i[0]}n=i}n==null&&(n=""),i=n}e._wrapperState={initialValue:te(i)}}function xt(e,n){var i=te(n.value),l=te(n.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),n.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),l!=null&&(e.defaultValue=""+l)}function Rn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function en(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 mn(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?en(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var An,Wr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,i,l,d){MSApp.execUnsafeLocalFunction(function(){return e(n,i,l,d)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(An=An||document.createElement("div"),An.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=An.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function tn(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var _t={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},mi=["Webkit","ms","Moz","O"];Object.keys(_t).forEach(function(e){mi.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),_t[n]=_t[e]})});function gn(e,n,i){return n==null||typeof n=="boolean"||n===""?"":i||typeof n!="number"||n===0||_t.hasOwnProperty(e)&&_t[e]?(""+n).trim():n+"px"}function Bt(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=gn(i,n[i],l);i==="float"&&(i="cssFloat"),l?e.setProperty(i,d):e[i]=d}}var Ur=B({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pr(e,n){if(n){if(Ur[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(o(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(o(61))}if(n.style!=null&&typeof n.style!="object")throw Error(o(62))}}function nn(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 qn=null;function Yr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xr=null,rn=null,on=null;function sn(e){if(e=Oi(e)){if(typeof Xr!="function")throw Error(o(280));var n=e.stateNode;n&&(n=Hs(n),Xr(e.stateNode,e.type,n))}}function jo(e){rn?on?on.push(e):on=[e]:rn=e}function jt(){if(rn){var e=rn,n=on;if(on=rn=null,sn(e),n)for(e=0;e<n.length;e++)sn(n[e])}}function Gr(e,n){return e(n)}function ut(){}var Kr=!1;function Qr(e,n,i){if(Kr)return e(n,i);Kr=!0;try{return Gr(e,n,i)}finally{Kr=!1,(rn!==null||on!==null)&&(ut(),jt())}}function It(e,n){var i=e.stateNode;if(i===null)return null;var l=Hs(i);if(l===null)return null;i=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(i&&typeof i!="function")throw Error(o(231,n,typeof i));return i}var yn=!1;if(h)try{var Ln={};Object.defineProperty(Ln,"passive",{get:function(){yn=!0}}),window.addEventListener("test",Ln,Ln),window.removeEventListener("test",Ln,Ln)}catch{yn=!1}function Zn(e,n,i,l,d,p,w,T,L){var Z=Array.prototype.slice.call(arguments,3);try{n.apply(i,Z)}catch(ce){this.onError(ce)}}var vn=!1,mr=null,xn=!1,et=null,gi={onError:function(e){vn=!0,mr=e}};function Jn(e,n,i,l,d,p,w,T,L){vn=!1,mr=null,Zn.apply(gi,arguments)}function bo(e,n,i,l,d,p,w,T,L){if(Jn.apply(this,arguments),vn){if(vn){var Z=mr;vn=!1,mr=null}else throw Error(o(198));xn||(xn=!0,et=Z)}}function Wt(e){var n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i: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 wn(e){if(Wt(e)!==e)throw Error(o(188))}function yi(e){var n=e.alternate;if(!n){if(n=Wt(e),n===null)throw Error(o(188));return n!==e?null:e}for(var i=e,l=n;;){var d=i.return;if(d===null)break;var p=d.alternate;if(p===null){if(l=d.return,l!==null){i=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===i)return wn(d),e;if(p===l)return wn(d),n;p=p.sibling}throw Error(o(188))}if(i.return!==l.return)i=d,l=p;else{for(var w=!1,T=d.child;T;){if(T===i){w=!0,i=d,l=p;break}if(T===l){w=!0,l=d,i=p;break}T=T.sibling}if(!w){for(T=p.child;T;){if(T===i){w=!0,i=p,l=d;break}if(T===l){w=!0,l=p,i=d;break}T=T.sibling}if(!w)throw Error(o(189))}}if(i.alternate!==l)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:n}function Po(e){return e=yi(e),e!==null?Mo(e):null}function Mo(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=Mo(e);if(n!==null)return n;e=e.sibling}return null}var Io=r.unstable_scheduleCallback,To=r.unstable_cancelCallback,vi=r.unstable_shouldYield,qr=r.unstable_requestPaint,Ye=r.unstable_now,Zr=r.unstable_getCurrentPriorityLevel,gr=r.unstable_ImmediatePriority,Dn=r.unstable_UserBlockingPriority,yr=r.unstable_NormalPriority,xi=r.unstable_LowPriority,er=r.unstable_IdlePriority,Be=null,zt=null;function wi(e){if(zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(Be,e,void 0,(e.current.flags&128)===128)}catch{}}var bt=Math.clz32?Math.clz32:Ei,Si=Math.log,ki=Math.LN2;function Ei(e){return e>>>=0,e===0?32:31-(Si(e)/ki|0)|0}var vr=64,xr=4194304;function Rt(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 wr(e,n){var i=e.pendingLanes;if(i===0)return 0;var l=0,d=e.suspendedLanes,p=e.pingedLanes,w=i&268435455;if(w!==0){var T=w&~d;T!==0?l=Rt(T):(p&=w,p!==0&&(l=Rt(p)))}else w=i&~d,w!==0?l=Rt(w):p!==0&&(l=Rt(p));if(l===0)return 0;if(n!==0&&n!==l&&(n&d)===0&&(d=l&-l,p=n&-n,d>=p||d===16&&(p&4194240)!==0))return n;if((l&4)!==0&&(l|=i&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0<n;)i=31-bt(n),d=1<<i,l|=e[i],n&=~d;return l}function Jr(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 zo(e,n){for(var i=e.suspendedLanes,l=e.pingedLanes,d=e.expirationTimes,p=e.pendingLanes;0<p;){var w=31-bt(p),T=1<<w,L=d[w];L===-1?((T&i)===0||(T&l)!==0)&&(d[w]=Jr(T,n)):L<=n&&(e.expiredLanes|=T),p&=~T}}function eo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function tr(){var e=vr;return vr<<=1,(vr&4194240)===0&&(vr=64),e}function Sr(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function $n(e,n,i){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-bt(n),e[n]=i}function On(e,n){var i=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<i;){var d=31-bt(i),p=1<<d;n[d]=0,l[d]=-1,e[d]=-1,i&=~p}}function to(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var l=31-bt(i),d=1<<l;d&n|e[l]&n&&(e[l]|=n),i&=~d}}var Ve=0;function Cs(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var _s,Ni,kr,js,bs,Ci=!1,Ro=[],Fn=null,Ut=null,Hn=null,no=new Map,ro=new Map,ln=[],Ps="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 _i(e,n){switch(e){case"focusin":case"focusout":Fn=null;break;case"dragenter":case"dragleave":Ut=null;break;case"mouseover":case"mouseout":Hn=null;break;case"pointerover":case"pointerout":no.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":ro.delete(n.pointerId)}}function Er(e,n,i,l,d,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:i,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},n!==null&&(n=Oi(n),n!==null&&Ni(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function D(e,n,i,l,d){switch(n){case"focusin":return Fn=Er(Fn,e,n,i,l,d),!0;case"dragenter":return Ut=Er(Ut,e,n,i,l,d),!0;case"mouseover":return Hn=Er(Hn,e,n,i,l,d),!0;case"pointerover":var p=d.pointerId;return no.set(p,Er(no.get(p)||null,e,n,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,ro.set(p,Er(ro.get(p)||null,e,n,i,l,d)),!0}return!1}function W(e){var n=oo(e.target);if(n!==null){var i=Wt(n);if(i!==null){if(n=i.tag,n===13){if(n=Tt(i),n!==null){e.blockedOn=n,bs(e.priority,function(){kr(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ne(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=rt(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);qn=l,i.target.dispatchEvent(l),qn=null}else return n=Oi(i),n!==null&&Ni(n),e.blockedOn=i,!1;n.shift()}return!0}function ie(e,n,i){ne(e)&&i.delete(n)}function ae(){Ci=!1,Fn!==null&&ne(Fn)&&(Fn=null),Ut!==null&&ne(Ut)&&(Ut=null),Hn!==null&&ne(Hn)&&(Hn=null),no.forEach(ie),ro.forEach(ie)}function ge(e,n){e.blockedOn===n&&(e.blockedOn=null,Ci||(Ci=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,ae)))}function Ne(e){function n(d){return ge(d,e)}if(0<Ro.length){ge(Ro[0],e);for(var i=1;i<Ro.length;i++){var l=Ro[i];l.blockedOn===e&&(l.blockedOn=null)}}for(Fn!==null&&ge(Fn,e),Ut!==null&&ge(Ut,e),Hn!==null&&ge(Hn,e),no.forEach(n),ro.forEach(n),i=0;i<ln.length;i++)l=ln[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<ln.length&&(i=ln[0],i.blockedOn===null);)W(i),i.blockedOn===null&&ln.shift()}var xe=j.ReactCurrentBatchConfig,Pe=!0;function We(e,n,i,l){var d=Ve,p=xe.transition;xe.transition=null;try{Ve=1,lt(e,n,i,l)}finally{Ve=d,xe.transition=p}}function Xe(e,n,i,l){var d=Ve,p=xe.transition;xe.transition=null;try{Ve=4,lt(e,n,i,l)}finally{Ve=d,xe.transition=p}}function lt(e,n,i,l){if(Pe){var d=rt(e,n,i,l);if(d===null)ba(e,n,l,De,i),_i(e,l);else if(D(d,e,n,i,l))l.stopPropagation();else if(_i(e,l),n&4&&-1<Ps.indexOf(e)){for(;d!==null;){var p=Oi(d);if(p!==null&&_s(p),p=rt(e,n,i,l),p===null&&ba(e,n,l,De,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else ba(e,n,l,null,i)}}var De=null;function rt(e,n,i,l){if(De=null,e=Yr(l),e=oo(e),e!==null)if(n=Wt(e),n===null)e=null;else if(i=n.tag,i===13){if(e=Tt(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return De=e,null}function Sn(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(Zr()){case gr:return 1;case Dn:return 4;case yr:case xi:return 16;case er:return 536870912;default:return 16}default:return 16}}var Yt=null,ji=null,Ms=null;function Ou(){if(Ms)return Ms;var e,n=ji,i=n.length,l,d="value"in Yt?Yt.value:Yt.textContent,p=d.length;for(e=0;e<i&&n[e]===d[e];e++);var w=i-e;for(l=1;l<=w&&n[i-l]===d[p-l];l++);return Ms=d.slice(e,1<l?1-l:void 0)}function Is(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 Ts(){return!0}function Fu(){return!1}function Xt(e){function n(i,l,d,p,w){this._reactName=i,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=w,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(i=e[T],this[T]=i?i(p):p[T]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Ts:Fu,this.isPropagationStopped=Fu,this}return B(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ts)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ts)},persist:function(){},isPersistent:Ts}),n}var Ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ha=Xt(Ao),bi=B({},Ao,{view:0,detail:0}),Pg=Xt(bi),pa,ma,Pi,zs=B({},bi,{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!==Pi&&(Pi&&e.type==="mousemove"?(pa=e.screenX-Pi.screenX,ma=e.screenY-Pi.screenY):ma=pa=0,Pi=e),pa)},movementY:function(e){return"movementY"in e?e.movementY:ma}}),Hu=Xt(zs),Mg=B({},zs,{dataTransfer:0}),Ig=Xt(Mg),Tg=B({},bi,{relatedTarget:0}),ga=Xt(Tg),zg=B({},Ao,{animationName:0,elapsedTime:0,pseudoElement:0}),Rg=Xt(zg),Ag=B({},Ao,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lg=Xt(Ag),Dg=B({},Ao,{data:0}),Vu=Xt(Dg),$g={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Og={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"},Fg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hg(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Fg[e])?!!n[e]:!1}function ya(){return Hg}var Vg=B({},bi,{key:function(e){if(e.key){var n=$g[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Is(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Og[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"?Is(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Is(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Bg=Xt(Vg),Wg=B({},zs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bu=Xt(Wg),Ug=B({},bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ya}),Yg=Xt(Ug),Xg=B({},Ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gg=Xt(Xg),Kg=B({},zs,{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}),Qg=Xt(Kg),qg=[9,13,27,32],va=h&&"CompositionEvent"in window,Mi=null;h&&"documentMode"in document&&(Mi=document.documentMode);var Zg=h&&"TextEvent"in window&&!Mi,Wu=h&&(!va||Mi&&8<Mi&&11>=Mi),Uu=" ",Yu=!1;function Xu(e,n){switch(e){case"keyup":return qg.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Lo=!1;function Jg(e,n){switch(e){case"compositionend":return Gu(n);case"keypress":return n.which!==32?null:(Yu=!0,Uu);case"textInput":return e=n.data,e===Uu&&Yu?null:e;default:return null}}function ey(e,n){if(Lo)return e==="compositionend"||!va&&Xu(e,n)?(e=Ou(),Ms=ji=Yt=null,Lo=!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 Wu&&n.locale!=="ko"?null:n.data;default:return null}}var ty={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 Ku(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!ty[e.type]:n==="textarea"}function Qu(e,n,i,l){jo(l),n=$s(n,"onChange"),0<n.length&&(i=new ha("onChange","change",null,i,l),e.push({event:i,listeners:n}))}var Ii=null,Ti=null;function ny(e){pd(e,0)}function Rs(e){var n=Ho(e);if(je(n))return e}function ry(e,n){if(e==="change")return n}var qu=!1;if(h){var xa;if(h){var wa="oninput"in document;if(!wa){var Zu=document.createElement("div");Zu.setAttribute("oninput","return;"),wa=typeof Zu.oninput=="function"}xa=wa}else xa=!1;qu=xa&&(!document.documentMode||9<document.documentMode)}function Ju(){Ii&&(Ii.detachEvent("onpropertychange",ed),Ti=Ii=null)}function ed(e){if(e.propertyName==="value"&&Rs(Ti)){var n=[];Qu(n,Ti,e,Yr(e)),Qr(ny,n)}}function oy(e,n,i){e==="focusin"?(Ju(),Ii=n,Ti=i,Ii.attachEvent("onpropertychange",ed)):e==="focusout"&&Ju()}function iy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Rs(Ti)}function sy(e,n){if(e==="click")return Rs(n)}function ly(e,n){if(e==="input"||e==="change")return Rs(n)}function ay(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var kn=typeof Object.is=="function"?Object.is:ay;function zi(e,n){if(kn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),l=Object.keys(n);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var d=i[l];if(!m.call(n,d)||!kn(e[d],n[d]))return!1}return!0}function td(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nd(e,n){var i=td(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=n&&l>=n)return{node:i,offset:n-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=td(i)}}function rd(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?rd(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function od(){for(var e=window,n=Ee();n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=Ee(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 cy(e){var n=od(),i=e.focusedElem,l=e.selectionRange;if(n!==i&&i&&i.ownerDocument&&rd(i.ownerDocument.documentElement,i)){if(l!==null&&Sa(i)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in i)i.selectionStart=n,i.selectionEnd=Math.min(e,i.value.length);else if(e=(n=i.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var d=i.textContent.length,p=Math.min(l.start,d);l=l.end===void 0?p:Math.min(l.end,d),!e.extend&&p>l&&(d=l,l=p,p=d),d=nd(i,p);var w=nd(i,l);d&&w&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(n=n.createRange(),n.setStart(d.node,d.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=i;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<n.length;i++)e=n[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var uy=h&&"documentMode"in document&&11>=document.documentMode,Do=null,ka=null,Ri=null,Ea=!1;function id(e,n,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ea||Do==null||Do!==Ee(l)||(l=Do,"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}),Ri&&zi(Ri,l)||(Ri=l,l=$s(ka,"onSelect"),0<l.length&&(n=new ha("onSelect","select",null,n,i),e.push({event:n,listeners:l}),n.target=Do)))}function As(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var $o={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionend:As("Transition","TransitionEnd")},Na={},sd={};h&&(sd=document.createElement("div").style,"AnimationEvent"in window||(delete $o.animationend.animation,delete $o.animationiteration.animation,delete $o.animationstart.animation),"TransitionEvent"in window||delete $o.transitionend.transition);function Ls(e){if(Na[e])return Na[e];if(!$o[e])return e;var n=$o[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in sd)return Na[e]=n[i];return e}var ld=Ls("animationend"),ad=Ls("animationiteration"),cd=Ls("animationstart"),ud=Ls("transitionend"),dd=new Map,fd="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 Nr(e,n){dd.set(e,n),c(n,[e])}for(var Ca=0;Ca<fd.length;Ca++){var _a=fd[Ca],dy=_a.toLowerCase(),fy=_a[0].toUpperCase()+_a.slice(1);Nr(dy,"on"+fy)}Nr(ld,"onAnimationEnd"),Nr(ad,"onAnimationIteration"),Nr(cd,"onAnimationStart"),Nr("dblclick","onDoubleClick"),Nr("focusin","onFocus"),Nr("focusout","onBlur"),Nr(ud,"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 Ai="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(" "),hy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ai));function hd(e,n,i){var l=e.type||"unknown-event";e.currentTarget=i,bo(l,n,void 0,e),e.currentTarget=null}function pd(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],d=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],L=T.instance,Z=T.currentTarget;if(T=T.listener,L!==p&&d.isPropagationStopped())break e;hd(d,T,Z),p=L}else for(w=0;w<l.length;w++){if(T=l[w],L=T.instance,Z=T.currentTarget,T=T.listener,L!==p&&d.isPropagationStopped())break e;hd(d,T,Z),p=L}}}if(xn)throw e=et,xn=!1,et=null,e}function Ke(e,n){var i=n[Ra];i===void 0&&(i=n[Ra]=new Set);var l=e+"__bubble";i.has(l)||(md(n,e,2,!1),i.add(l))}function ja(e,n,i){var l=0;n&&(l|=4),md(i,e,l,n)}var Ds="_reactListening"+Math.random().toString(36).slice(2);function Li(e){if(!e[Ds]){e[Ds]=!0,s.forEach(function(i){i!=="selectionchange"&&(hy.has(i)||ja(i,!1,e),ja(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Ds]||(n[Ds]=!0,ja("selectionchange",!1,n))}}function md(e,n,i,l){switch(Sn(n)){case 1:var d=We;break;case 4:d=Xe;break;default:d=lt}i=d.bind(null,n,i,e),d=void 0,!yn||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),l?d!==void 0?e.addEventListener(n,i,{capture:!0,passive:d}):e.addEventListener(n,i,!0):d!==void 0?e.addEventListener(n,i,{passive:d}):e.addEventListener(n,i,!1)}function ba(e,n,i,l,d){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===d||T.nodeType===8&&T.parentNode===d)break;if(w===4)for(w=l.return;w!==null;){var L=w.tag;if((L===3||L===4)&&(L=w.stateNode.containerInfo,L===d||L.nodeType===8&&L.parentNode===d))return;w=w.return}for(;T!==null;){if(w=oo(T),w===null)return;if(L=w.tag,L===5||L===6){l=p=w;continue e}T=T.parentNode}}l=l.return}Qr(function(){var Z=p,ce=Yr(i),ue=[];e:{var le=dd.get(e);if(le!==void 0){var ye=ha,we=e;switch(e){case"keypress":if(Is(i)===0)break e;case"keydown":case"keyup":ye=Bg;break;case"focusin":we="focus",ye=ga;break;case"focusout":we="blur",ye=ga;break;case"beforeblur":case"afterblur":ye=ga;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=Hu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=Ig;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=Yg;break;case ld:case ad:case cd:ye=Rg;break;case ud:ye=Gg;break;case"scroll":ye=Pg;break;case"wheel":ye=Qg;break;case"copy":case"cut":case"paste":ye=Lg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=Bu}var Se=(n&4)!==0,it=!Se&&e==="scroll",Y=Se?le!==null?le+"Capture":null:le;Se=[];for(var F=Z,Q;F!==null;){Q=F;var he=Q.stateNode;if(Q.tag===5&&he!==null&&(Q=he,Y!==null&&(he=It(F,Y),he!=null&&Se.push(Di(F,he,Q)))),it)break;F=F.return}0<Se.length&&(le=new ye(le,we,null,i,ce),ue.push({event:le,listeners:Se}))}}if((n&7)===0){e:{if(le=e==="mouseover"||e==="pointerover",ye=e==="mouseout"||e==="pointerout",le&&i!==qn&&(we=i.relatedTarget||i.fromElement)&&(oo(we)||we[nr]))break e;if((ye||le)&&(le=ce.window===ce?ce:(le=ce.ownerDocument)?le.defaultView||le.parentWindow:window,ye?(we=i.relatedTarget||i.toElement,ye=Z,we=we?oo(we):null,we!==null&&(it=Wt(we),we!==it||we.tag!==5&&we.tag!==6)&&(we=null)):(ye=null,we=Z),ye!==we)){if(Se=Hu,he="onMouseLeave",Y="onMouseEnter",F="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Bu,he="onPointerLeave",Y="onPointerEnter",F="pointer"),it=ye==null?le:Ho(ye),Q=we==null?le:Ho(we),le=new Se(he,F+"leave",ye,i,ce),le.target=it,le.relatedTarget=Q,he=null,oo(ce)===Z&&(Se=new Se(Y,F+"enter",we,i,ce),Se.target=Q,Se.relatedTarget=it,he=Se),it=he,ye&&we)t:{for(Se=ye,Y=we,F=0,Q=Se;Q;Q=Oo(Q))F++;for(Q=0,he=Y;he;he=Oo(he))Q++;for(;0<F-Q;)Se=Oo(Se),F--;for(;0<Q-F;)Y=Oo(Y),Q--;for(;F--;){if(Se===Y||Y!==null&&Se===Y.alternate)break t;Se=Oo(Se),Y=Oo(Y)}Se=null}else Se=null;ye!==null&&gd(ue,le,ye,Se,!1),we!==null&&it!==null&&gd(ue,it,we,Se,!0)}}e:{if(le=Z?Ho(Z):window,ye=le.nodeName&&le.nodeName.toLowerCase(),ye==="select"||ye==="input"&&le.type==="file")var ke=ry;else if(Ku(le))if(qu)ke=ly;else{ke=iy;var Me=oy}else(ye=le.nodeName)&&ye.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(ke=sy);if(ke&&(ke=ke(e,Z))){Qu(ue,ke,i,ce);break e}Me&&Me(e,le,Z),e==="focusout"&&(Me=le._wrapperState)&&Me.controlled&&le.type==="number"&&ht(le,"number",le.value)}switch(Me=Z?Ho(Z):window,e){case"focusin":(Ku(Me)||Me.contentEditable==="true")&&(Do=Me,ka=Z,Ri=null);break;case"focusout":Ri=ka=Do=null;break;case"mousedown":Ea=!0;break;case"contextmenu":case"mouseup":case"dragend":Ea=!1,id(ue,i,ce);break;case"selectionchange":if(uy)break;case"keydown":case"keyup":id(ue,i,ce)}var Ie;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 Lo?Xu(e,i)&&(ze="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ze="onCompositionStart");ze&&(Wu&&i.locale!=="ko"&&(Lo||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Lo&&(Ie=Ou()):(Yt=ce,ji="value"in Yt?Yt.value:Yt.textContent,Lo=!0)),Me=$s(Z,ze),0<Me.length&&(ze=new Vu(ze,e,null,i,ce),ue.push({event:ze,listeners:Me}),Ie?ze.data=Ie:(Ie=Gu(i),Ie!==null&&(ze.data=Ie)))),(Ie=Zg?Jg(e,i):ey(e,i))&&(Z=$s(Z,"onBeforeInput"),0<Z.length&&(ce=new Vu("onBeforeInput","beforeinput",null,i,ce),ue.push({event:ce,listeners:Z}),ce.data=Ie))}pd(ue,n)})}function Di(e,n,i){return{instance:e,listener:n,currentTarget:i}}function $s(e,n){for(var i=n+"Capture",l=[];e!==null;){var d=e,p=d.stateNode;d.tag===5&&p!==null&&(d=p,p=It(e,i),p!=null&&l.unshift(Di(e,p,d)),p=It(e,n),p!=null&&l.push(Di(e,p,d))),e=e.return}return l}function Oo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gd(e,n,i,l,d){for(var p=n._reactName,w=[];i!==null&&i!==l;){var T=i,L=T.alternate,Z=T.stateNode;if(L!==null&&L===l)break;T.tag===5&&Z!==null&&(T=Z,d?(L=It(i,p),L!=null&&w.unshift(Di(i,L,T))):d||(L=It(i,p),L!=null&&w.push(Di(i,L,T)))),i=i.return}w.length!==0&&e.push({event:n,listeners:w})}var py=/\r\n?/g,my=/\u0000|\uFFFD/g;function yd(e){return(typeof e=="string"?e:""+e).replace(py,`
|
|
38
|
-
`).replace(my,"")}function Os(e,n,i){if(n=yd(n),yd(e)!==n&&i)throw Error(o(425))}function Fs(){}var Pa=null,Ma=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,gy=typeof clearTimeout=="function"?clearTimeout:void 0,vd=typeof Promise=="function"?Promise:void 0,yy=typeof queueMicrotask=="function"?queueMicrotask:typeof vd<"u"?function(e){return vd.resolve(null).then(e).catch(vy)}:Ta;function vy(e){setTimeout(function(){throw e})}function za(e,n){var i=n,l=0;do{var d=i.nextSibling;if(e.removeChild(i),d&&d.nodeType===8)if(i=d.data,i==="/$"){if(l===0){e.removeChild(d),Ne(n);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);Ne(n)}function Cr(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 xd(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(n===0)return e;n--}else i==="/$"&&n++}e=e.previousSibling}return null}var Fo=Math.random().toString(36).slice(2),Vn="__reactFiber$"+Fo,$i="__reactProps$"+Fo,nr="__reactContainer$"+Fo,Ra="__reactEvents$"+Fo,xy="__reactListeners$"+Fo,wy="__reactHandles$"+Fo;function oo(e){var n=e[Vn];if(n)return n;for(var i=e.parentNode;i;){if(n=i[nr]||i[Vn]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=xd(e);e!==null;){if(i=e[Vn])return i;e=xd(e)}return n}e=i,i=e.parentNode}return null}function Oi(e){return e=e[Vn]||e[nr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ho(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function Hs(e){return e[$i]||null}var Aa=[],Vo=-1;function _r(e){return{current:e}}function Qe(e){0>Vo||(e.current=Aa[Vo],Aa[Vo]=null,Vo--)}function Ge(e,n){Vo++,Aa[Vo]=e.current,e.current=n}var jr={},kt=_r(jr),At=_r(!1),io=jr;function Bo(e,n){var i=e.type.contextTypes;if(!i)return jr;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in i)d[p]=n[p];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=d),d}function Lt(e){return e=e.childContextTypes,e!=null}function Vs(){Qe(At),Qe(kt)}function wd(e,n,i){if(kt.current!==jr)throw Error(o(168));Ge(kt,n),Ge(At,i)}function Sd(e,n,i){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return i;l=l.getChildContext();for(var d in l)if(!(d in n))throw Error(o(108,me(e)||"Unknown",d));return B({},i,l)}function Bs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||jr,io=kt.current,Ge(kt,e),Ge(At,At.current),!0}function kd(e,n,i){var l=e.stateNode;if(!l)throw Error(o(169));i?(e=Sd(e,n,io),l.__reactInternalMemoizedMergedChildContext=e,Qe(At),Qe(kt),Ge(kt,e)):Qe(At),Ge(At,i)}var rr=null,Ws=!1,La=!1;function Ed(e){rr===null?rr=[e]:rr.push(e)}function Sy(e){Ws=!0,Ed(e)}function br(){if(!La&&rr!==null){La=!0;var e=0,n=Ve;try{var i=rr;for(Ve=1;e<i.length;e++){var l=i[e];do l=l(!0);while(l!==null)}rr=null,Ws=!1}catch(d){throw rr!==null&&(rr=rr.slice(e+1)),Io(gr,br),d}finally{Ve=n,La=!1}}return null}var Wo=[],Uo=0,Us=null,Ys=0,an=[],cn=0,so=null,or=1,ir="";function lo(e,n){Wo[Uo++]=Ys,Wo[Uo++]=Us,Us=e,Ys=n}function Nd(e,n,i){an[cn++]=or,an[cn++]=ir,an[cn++]=so,so=e;var l=or;e=ir;var d=32-bt(l)-1;l&=~(1<<d),i+=1;var p=32-bt(n)+d;if(30<p){var w=d-d%5;p=(l&(1<<w)-1).toString(32),l>>=w,d-=w,or=1<<32-bt(n)+d|i<<d|l,ir=p+e}else or=1<<p|i<<d|l,ir=e}function Da(e){e.return!==null&&(lo(e,1),Nd(e,1,0))}function $a(e){for(;e===Us;)Us=Wo[--Uo],Wo[Uo]=null,Ys=Wo[--Uo],Wo[Uo]=null;for(;e===so;)so=an[--cn],an[cn]=null,ir=an[--cn],an[cn]=null,or=an[--cn],an[cn]=null}var Gt=null,Kt=null,qe=!1,En=null;function Cd(e,n){var i=hn(5,null,null,0);i.elementType="DELETED",i.stateNode=n,i.return=e,n=e.deletions,n===null?(e.deletions=[i],e.flags|=16):n.push(i)}function _d(e,n){switch(e.tag){case 5:var i=e.type;return n=n.nodeType!==1||i.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Gt=e,Kt=Cr(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Gt=e,Kt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(i=so!==null?{id:or,overflow:ir}:null,e.memoizedState={dehydrated:n,treeContext:i,retryLane:1073741824},i=hn(18,null,null,0),i.stateNode=n,i.return=e,e.child=i,Gt=e,Kt=null,!0):!1;default:return!1}}function Oa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Fa(e){if(qe){var n=Kt;if(n){var i=n;if(!_d(e,n)){if(Oa(e))throw Error(o(418));n=Cr(i.nextSibling);var l=Gt;n&&_d(e,n)?Cd(l,i):(e.flags=e.flags&-4097|2,qe=!1,Gt=e)}}else{if(Oa(e))throw Error(o(418));e.flags=e.flags&-4097|2,qe=!1,Gt=e}}}function jd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Gt=e}function Xs(e){if(e!==Gt)return!1;if(!qe)return jd(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=Kt)){if(Oa(e))throw bd(),Error(o(418));for(;n;)Cd(e,n),n=Cr(n.nextSibling)}if(jd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(n===0){Kt=Cr(e.nextSibling);break e}n--}else i!=="$"&&i!=="$!"&&i!=="$?"||n++}e=e.nextSibling}Kt=null}}else Kt=Gt?Cr(e.stateNode.nextSibling):null;return!0}function bd(){for(var e=Kt;e;)e=Cr(e.nextSibling)}function Yo(){Kt=Gt=null,qe=!1}function Ha(e){En===null?En=[e]:En.push(e)}var ky=j.ReactCurrentBatchConfig;function Fi(e,n,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(o(309));var l=i.stateNode}if(!l)throw Error(o(147,e));var d=l,p=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===p?n.ref:(n=function(w){var T=d.refs;w===null?delete T[p]:T[p]=w},n._stringRef=p,n)}if(typeof e!="string")throw Error(o(284));if(!i._owner)throw Error(o(290,e))}return e}function Gs(e,n){throw e=Object.prototype.toString.call(n),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Pd(e){var n=e._init;return n(e._payload)}function Md(e){function n(Y,F){if(e){var Q=Y.deletions;Q===null?(Y.deletions=[F],Y.flags|=16):Q.push(F)}}function i(Y,F){if(!e)return null;for(;F!==null;)n(Y,F),F=F.sibling;return null}function l(Y,F){for(Y=new Map;F!==null;)F.key!==null?Y.set(F.key,F):Y.set(F.index,F),F=F.sibling;return Y}function d(Y,F){return Y=Lr(Y,F),Y.index=0,Y.sibling=null,Y}function p(Y,F,Q){return Y.index=Q,e?(Q=Y.alternate,Q!==null?(Q=Q.index,Q<F?(Y.flags|=2,F):Q):(Y.flags|=2,F)):(Y.flags|=1048576,F)}function w(Y){return e&&Y.alternate===null&&(Y.flags|=2),Y}function T(Y,F,Q,he){return F===null||F.tag!==6?(F=Tc(Q,Y.mode,he),F.return=Y,F):(F=d(F,Q),F.return=Y,F)}function L(Y,F,Q,he){var ke=Q.type;return ke===H?ce(Y,F,Q.props.children,he,Q.key):F!==null&&(F.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===V&&Pd(ke)===F.type)?(he=d(F,Q.props),he.ref=Fi(Y,F,Q),he.return=Y,he):(he=vl(Q.type,Q.key,Q.props,null,Y.mode,he),he.ref=Fi(Y,F,Q),he.return=Y,he)}function Z(Y,F,Q,he){return F===null||F.tag!==4||F.stateNode.containerInfo!==Q.containerInfo||F.stateNode.implementation!==Q.implementation?(F=zc(Q,Y.mode,he),F.return=Y,F):(F=d(F,Q.children||[]),F.return=Y,F)}function ce(Y,F,Q,he,ke){return F===null||F.tag!==7?(F=go(Q,Y.mode,he,ke),F.return=Y,F):(F=d(F,Q),F.return=Y,F)}function ue(Y,F,Q){if(typeof F=="string"&&F!==""||typeof F=="number")return F=Tc(""+F,Y.mode,Q),F.return=Y,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case O:return Q=vl(F.type,F.key,F.props,null,Y.mode,Q),Q.ref=Fi(Y,null,F),Q.return=Y,Q;case A:return F=zc(F,Y.mode,Q),F.return=Y,F;case V:var he=F._init;return ue(Y,he(F._payload),Q)}if(vt(F)||R(F))return F=go(F,Y.mode,Q,null),F.return=Y,F;Gs(Y,F)}return null}function le(Y,F,Q,he){var ke=F!==null?F.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number")return ke!==null?null:T(Y,F,""+Q,he);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case O:return Q.key===ke?L(Y,F,Q,he):null;case A:return Q.key===ke?Z(Y,F,Q,he):null;case V:return ke=Q._init,le(Y,F,ke(Q._payload),he)}if(vt(Q)||R(Q))return ke!==null?null:ce(Y,F,Q,he,null);Gs(Y,Q)}return null}function ye(Y,F,Q,he,ke){if(typeof he=="string"&&he!==""||typeof he=="number")return Y=Y.get(Q)||null,T(F,Y,""+he,ke);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case O:return Y=Y.get(he.key===null?Q:he.key)||null,L(F,Y,he,ke);case A:return Y=Y.get(he.key===null?Q:he.key)||null,Z(F,Y,he,ke);case V:var Me=he._init;return ye(Y,F,Q,Me(he._payload),ke)}if(vt(he)||R(he))return Y=Y.get(Q)||null,ce(F,Y,he,ke,null);Gs(F,he)}return null}function we(Y,F,Q,he){for(var ke=null,Me=null,Ie=F,ze=F=0,yt=null;Ie!==null&&ze<Q.length;ze++){Ie.index>ze?(yt=Ie,Ie=null):yt=Ie.sibling;var Fe=le(Y,Ie,Q[ze],he);if(Fe===null){Ie===null&&(Ie=yt);break}e&&Ie&&Fe.alternate===null&&n(Y,Ie),F=p(Fe,F,ze),Me===null?ke=Fe:Me.sibling=Fe,Me=Fe,Ie=yt}if(ze===Q.length)return i(Y,Ie),qe&&lo(Y,ze),ke;if(Ie===null){for(;ze<Q.length;ze++)Ie=ue(Y,Q[ze],he),Ie!==null&&(F=p(Ie,F,ze),Me===null?ke=Ie:Me.sibling=Ie,Me=Ie);return qe&&lo(Y,ze),ke}for(Ie=l(Y,Ie);ze<Q.length;ze++)yt=ye(Ie,Y,ze,Q[ze],he),yt!==null&&(e&&yt.alternate!==null&&Ie.delete(yt.key===null?ze:yt.key),F=p(yt,F,ze),Me===null?ke=yt:Me.sibling=yt,Me=yt);return e&&Ie.forEach(function(Dr){return n(Y,Dr)}),qe&&lo(Y,ze),ke}function Se(Y,F,Q,he){var ke=R(Q);if(typeof ke!="function")throw Error(o(150));if(Q=ke.call(Q),Q==null)throw Error(o(151));for(var Me=ke=null,Ie=F,ze=F=0,yt=null,Fe=Q.next();Ie!==null&&!Fe.done;ze++,Fe=Q.next()){Ie.index>ze?(yt=Ie,Ie=null):yt=Ie.sibling;var Dr=le(Y,Ie,Fe.value,he);if(Dr===null){Ie===null&&(Ie=yt);break}e&&Ie&&Dr.alternate===null&&n(Y,Ie),F=p(Dr,F,ze),Me===null?ke=Dr:Me.sibling=Dr,Me=Dr,Ie=yt}if(Fe.done)return i(Y,Ie),qe&&lo(Y,ze),ke;if(Ie===null){for(;!Fe.done;ze++,Fe=Q.next())Fe=ue(Y,Fe.value,he),Fe!==null&&(F=p(Fe,F,ze),Me===null?ke=Fe:Me.sibling=Fe,Me=Fe);return qe&&lo(Y,ze),ke}for(Ie=l(Y,Ie);!Fe.done;ze++,Fe=Q.next())Fe=ye(Ie,Y,ze,Fe.value,he),Fe!==null&&(e&&Fe.alternate!==null&&Ie.delete(Fe.key===null?ze:Fe.key),F=p(Fe,F,ze),Me===null?ke=Fe:Me.sibling=Fe,Me=Fe);return e&&Ie.forEach(function(t0){return n(Y,t0)}),qe&&lo(Y,ze),ke}function it(Y,F,Q,he){if(typeof Q=="object"&&Q!==null&&Q.type===H&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case O:e:{for(var ke=Q.key,Me=F;Me!==null;){if(Me.key===ke){if(ke=Q.type,ke===H){if(Me.tag===7){i(Y,Me.sibling),F=d(Me,Q.props.children),F.return=Y,Y=F;break e}}else if(Me.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===V&&Pd(ke)===Me.type){i(Y,Me.sibling),F=d(Me,Q.props),F.ref=Fi(Y,Me,Q),F.return=Y,Y=F;break e}i(Y,Me);break}else n(Y,Me);Me=Me.sibling}Q.type===H?(F=go(Q.props.children,Y.mode,he,Q.key),F.return=Y,Y=F):(he=vl(Q.type,Q.key,Q.props,null,Y.mode,he),he.ref=Fi(Y,F,Q),he.return=Y,Y=he)}return w(Y);case A:e:{for(Me=Q.key;F!==null;){if(F.key===Me)if(F.tag===4&&F.stateNode.containerInfo===Q.containerInfo&&F.stateNode.implementation===Q.implementation){i(Y,F.sibling),F=d(F,Q.children||[]),F.return=Y,Y=F;break e}else{i(Y,F);break}else n(Y,F);F=F.sibling}F=zc(Q,Y.mode,he),F.return=Y,Y=F}return w(Y);case V:return Me=Q._init,it(Y,F,Me(Q._payload),he)}if(vt(Q))return we(Y,F,Q,he);if(R(Q))return Se(Y,F,Q,he);Gs(Y,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"?(Q=""+Q,F!==null&&F.tag===6?(i(Y,F.sibling),F=d(F,Q),F.return=Y,Y=F):(i(Y,F),F=Tc(Q,Y.mode,he),F.return=Y,Y=F),w(Y)):i(Y,F)}return it}var Xo=Md(!0),Id=Md(!1),Ks=_r(null),Qs=null,Go=null,Va=null;function Ba(){Va=Go=Qs=null}function Wa(e){var n=Ks.current;Qe(Ks),e._currentValue=n}function Ua(e,n,i){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===i)break;e=e.return}}function Ko(e,n){Qs=e,Va=Go=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Dt=!0),e.firstContext=null)}function un(e){var n=e._currentValue;if(Va!==e)if(e={context:e,memoizedValue:n,next:null},Go===null){if(Qs===null)throw Error(o(308));Go=e,Qs.dependencies={lanes:0,firstContext:e}}else Go=Go.next=e;return n}var ao=null;function Ya(e){ao===null?ao=[e]:ao.push(e)}function Td(e,n,i,l){var d=n.interleaved;return d===null?(i.next=i,Ya(n)):(i.next=d.next,d.next=i),n.interleaved=i,sr(e,l)}function sr(e,n){e.lanes|=n;var i=e.alternate;for(i!==null&&(i.lanes|=n),i=e,e=e.return;e!==null;)e.childLanes|=n,i=e.alternate,i!==null&&(i.childLanes|=n),i=e,e=e.return;return i.tag===3?i.stateNode:null}var Pr=!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 lr(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Mr(e,n,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Oe&2)!==0){var d=l.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),l.pending=n,sr(e,i)}return d=l.interleaved,d===null?(n.next=n,Ya(l)):(n.next=d.next,d.next=n),l.interleaved=n,sr(e,i)}function qs(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,to(e,i)}}function Rd(e,n){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var w={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?d=p=w:p=p.next=w,i=i.next}while(i!==null);p===null?d=p=n:p=p.next=n}else d=p=n;i={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,effects:l.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}function Zs(e,n,i,l){var d=e.updateQueue;Pr=!1;var p=d.firstBaseUpdate,w=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var L=T,Z=L.next;L.next=null,w===null?p=Z:w.next=Z,w=L;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,T=ce.lastBaseUpdate,T!==w&&(T===null?ce.firstBaseUpdate=Z:T.next=Z,ce.lastBaseUpdate=L))}if(p!==null){var ue=d.baseState;w=0,ce=Z=L=null,T=p;do{var le=T.lane,ye=T.eventTime;if((l&le)===le){ce!==null&&(ce=ce.next={eventTime:ye,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var we=e,Se=T;switch(le=n,ye=i,Se.tag){case 1:if(we=Se.payload,typeof we=="function"){ue=we.call(ye,ue,le);break e}ue=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Se.payload,le=typeof we=="function"?we.call(ye,ue,le):we,le==null)break e;ue=B({},ue,le);break e;case 2:Pr=!0}}T.callback!==null&&T.lane!==0&&(e.flags|=64,le=d.effects,le===null?d.effects=[T]:le.push(T))}else ye={eventTime:ye,lane:le,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ce===null?(Z=ce=ye,L=ue):ce=ce.next=ye,w|=le;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;le=T,T=le.next,le.next=null,d.lastBaseUpdate=le,d.shared.pending=null}}while(!0);if(ce===null&&(L=ue),d.baseState=L,d.firstBaseUpdate=Z,d.lastBaseUpdate=ce,n=d.shared.interleaved,n!==null){d=n;do w|=d.lane,d=d.next;while(d!==n)}else p===null&&(d.shared.lanes=0);fo|=w,e.lanes=w,e.memoizedState=ue}}function Ad(e,n,i){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var l=e[n],d=l.callback;if(d!==null){if(l.callback=null,l=i,typeof d!="function")throw Error(o(191,d));d.call(l)}}}var Hi={},Bn=_r(Hi),Vi=_r(Hi),Bi=_r(Hi);function co(e){if(e===Hi)throw Error(o(174));return e}function Ga(e,n){switch(Ge(Bi,n),Ge(Vi,e),Ge(Bn,Hi),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:mn(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=mn(n,e)}Qe(Bn),Ge(Bn,n)}function Qo(){Qe(Bn),Qe(Vi),Qe(Bi)}function Ld(e){co(Bi.current);var n=co(Bn.current),i=mn(n,e.type);n!==i&&(Ge(Vi,e),Ge(Bn,i))}function Ka(e){Vi.current===e&&(Qe(Bn),Qe(Vi))}var tt=_r(0);function Js(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.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 el=j.ReactCurrentDispatcher,Za=j.ReactCurrentBatchConfig,uo=0,nt=null,dt=null,mt=null,tl=!1,Wi=!1,Ui=0,Ey=0;function Et(){throw Error(o(321))}function Ja(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!kn(e[i],n[i]))return!1;return!0}function ec(e,n,i,l,d,p){if(uo=p,nt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,el.current=e===null||e.memoizedState===null?jy:by,e=i(l,d),Wi){p=0;do{if(Wi=!1,Ui=0,25<=p)throw Error(o(301));p+=1,mt=dt=null,n.updateQueue=null,el.current=Py,e=i(l,d)}while(Wi)}if(el.current=ol,n=dt!==null&&dt.next!==null,uo=0,mt=dt=nt=null,tl=!1,n)throw Error(o(300));return e}function tc(){var e=Ui!==0;return Ui=0,e}function Wn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?nt.memoizedState=mt=e:mt=mt.next=e,mt}function dn(){if(dt===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var n=mt===null?nt.memoizedState:mt.next;if(n!==null)mt=n,dt=e;else{if(e===null)throw Error(o(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},mt===null?nt.memoizedState=mt=e:mt=mt.next=e}return mt}function Yi(e,n){return typeof n=="function"?n(e):n}function nc(e){var n=dn(),i=n.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var l=dt,d=l.baseQueue,p=i.pending;if(p!==null){if(d!==null){var w=d.next;d.next=p.next,p.next=w}l.baseQueue=d=p,i.pending=null}if(d!==null){p=d.next,l=l.baseState;var T=w=null,L=null,Z=p;do{var ce=Z.lane;if((uo&ce)===ce)L!==null&&(L=L.next={lane:0,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),l=Z.hasEagerState?Z.eagerState:e(l,Z.action);else{var ue={lane:ce,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null};L===null?(T=L=ue,w=l):L=L.next=ue,nt.lanes|=ce,fo|=ce}Z=Z.next}while(Z!==null&&Z!==p);L===null?w=l:L.next=T,kn(l,n.memoizedState)||(Dt=!0),n.memoizedState=l,n.baseState=w,n.baseQueue=L,i.lastRenderedState=l}if(e=i.interleaved,e!==null){d=e;do p=d.lane,nt.lanes|=p,fo|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[n.memoizedState,i.dispatch]}function rc(e){var n=dn(),i=n.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var l=i.dispatch,d=i.pending,p=n.memoizedState;if(d!==null){i.pending=null;var w=d=d.next;do p=e(p,w.action),w=w.next;while(w!==d);kn(p,n.memoizedState)||(Dt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),i.lastRenderedState=p}return[p,l]}function Dd(){}function $d(e,n){var i=nt,l=dn(),d=n(),p=!kn(l.memoizedState,d);if(p&&(l.memoizedState=d,Dt=!0),l=l.queue,oc(Hd.bind(null,i,l,e),[e]),l.getSnapshot!==n||p||mt!==null&&mt.memoizedState.tag&1){if(i.flags|=2048,Xi(9,Fd.bind(null,i,l,d,n),void 0,null),gt===null)throw Error(o(349));(uo&30)!==0||Od(i,n,d)}return d}function Od(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=nt.updateQueue,n===null?(n={lastEffect:null,stores:null},nt.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function Fd(e,n,i,l){n.value=i,n.getSnapshot=l,Vd(n)&&Bd(e)}function Hd(e,n,i){return i(function(){Vd(n)&&Bd(e)})}function Vd(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!kn(e,i)}catch{return!0}}function Bd(e){var n=sr(e,1);n!==null&&jn(n,e,1,-1)}function Wd(e){var n=Wn();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Yi,lastRenderedState:e},n.queue=e,e=e.dispatch=_y.bind(null,nt,e),[n.memoizedState,e]}function Xi(e,n,i,l){return e={tag:e,create:n,destroy:i,deps:l,next:null},n=nt.updateQueue,n===null?(n={lastEffect:null,stores:null},nt.updateQueue=n,n.lastEffect=e.next=e):(i=n.lastEffect,i===null?n.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,n.lastEffect=e)),e}function Ud(){return dn().memoizedState}function nl(e,n,i,l){var d=Wn();nt.flags|=e,d.memoizedState=Xi(1|n,i,void 0,l===void 0?null:l)}function rl(e,n,i,l){var d=dn();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)){d.memoizedState=Xi(n,i,p,l);return}}nt.flags|=e,d.memoizedState=Xi(1|n,i,p,l)}function Yd(e,n){return nl(8390656,8,e,n)}function oc(e,n){return rl(2048,8,e,n)}function Xd(e,n){return rl(4,2,e,n)}function Gd(e,n){return rl(4,4,e,n)}function Kd(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,i){return i=i!=null?i.concat([e]):null,rl(4,4,Kd.bind(null,n,e),i)}function ic(){}function qd(e,n){var i=dn();n=n===void 0?null:n;var l=i.memoizedState;return l!==null&&n!==null&&Ja(n,l[1])?l[0]:(i.memoizedState=[e,n],e)}function Zd(e,n){var i=dn();n=n===void 0?null:n;var l=i.memoizedState;return l!==null&&n!==null&&Ja(n,l[1])?l[0]:(e=e(),i.memoizedState=[e,n],e)}function Jd(e,n,i){return(uo&21)===0?(e.baseState&&(e.baseState=!1,Dt=!0),e.memoizedState=i):(kn(i,n)||(i=tr(),nt.lanes|=i,fo|=i,e.baseState=!0),n)}function Ny(e,n){var i=Ve;Ve=i!==0&&4>i?i:4,e(!0);var l=Za.transition;Za.transition={};try{e(!1),n()}finally{Ve=i,Za.transition=l}}function ef(){return dn().memoizedState}function Cy(e,n,i){var l=Rr(e);if(i={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null},tf(e))nf(n,i);else if(i=Td(e,n,i,l),i!==null){var d=Mt();jn(i,e,l,d),rf(i,n,l)}}function _y(e,n,i){var l=Rr(e),d={lane:l,action:i,hasEagerState:!1,eagerState:null,next:null};if(tf(e))nf(n,d);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,i);if(d.hasEagerState=!0,d.eagerState=T,kn(T,w)){var L=n.interleaved;L===null?(d.next=d,Ya(n)):(d.next=L.next,L.next=d),n.interleaved=d;return}}catch{}finally{}i=Td(e,n,d,l),i!==null&&(d=Mt(),jn(i,e,l,d),rf(i,n,l))}}function tf(e){var n=e.alternate;return e===nt||n!==null&&n===nt}function nf(e,n){Wi=tl=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function rf(e,n,i){if((i&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,i|=l,n.lanes=i,to(e,i)}}var ol={readContext:un,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useInsertionEffect:Et,useLayoutEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useMutableSource:Et,useSyncExternalStore:Et,useId:Et,unstable_isNewReconciler:!1},jy={readContext:un,useCallback:function(e,n){return Wn().memoizedState=[e,n===void 0?null:n],e},useContext:un,useEffect:Yd,useImperativeHandle:function(e,n,i){return i=i!=null?i.concat([e]):null,nl(4194308,4,Kd.bind(null,n,e),i)},useLayoutEffect:function(e,n){return nl(4194308,4,e,n)},useInsertionEffect:function(e,n){return nl(4,2,e,n)},useMemo:function(e,n){var i=Wn();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var l=Wn();return n=i!==void 0?i(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=Cy.bind(null,nt,e),[l.memoizedState,e]},useRef:function(e){var n=Wn();return e={current:e},n.memoizedState=e},useState:Wd,useDebugValue:ic,useDeferredValue:function(e){return Wn().memoizedState=e},useTransition:function(){var e=Wd(!1),n=e[0];return e=Ny.bind(null,e[1]),Wn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var l=nt,d=Wn();if(qe){if(i===void 0)throw Error(o(407));i=i()}else{if(i=n(),gt===null)throw Error(o(349));(uo&30)!==0||Od(l,n,i)}d.memoizedState=i;var p={value:i,getSnapshot:n};return d.queue=p,Yd(Hd.bind(null,l,p,e),[e]),l.flags|=2048,Xi(9,Fd.bind(null,l,p,i,n),void 0,null),i},useId:function(){var e=Wn(),n=gt.identifierPrefix;if(qe){var i=ir,l=or;i=(l&~(1<<32-bt(l)-1)).toString(32)+i,n=":"+n+"R"+i,i=Ui++,0<i&&(n+="H"+i.toString(32)),n+=":"}else i=Ey++,n=":"+n+"r"+i.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},by={readContext:un,useCallback:qd,useContext:un,useEffect:oc,useImperativeHandle:Qd,useInsertionEffect:Xd,useLayoutEffect:Gd,useMemo:Zd,useReducer:nc,useRef:Ud,useState:function(){return nc(Yi)},useDebugValue:ic,useDeferredValue:function(e){var n=dn();return Jd(n,dt.memoizedState,e)},useTransition:function(){var e=nc(Yi)[0],n=dn().memoizedState;return[e,n]},useMutableSource:Dd,useSyncExternalStore:$d,useId:ef,unstable_isNewReconciler:!1},Py={readContext:un,useCallback:qd,useContext:un,useEffect:oc,useImperativeHandle:Qd,useInsertionEffect:Xd,useLayoutEffect:Gd,useMemo:Zd,useReducer:rc,useRef:Ud,useState:function(){return rc(Yi)},useDebugValue:ic,useDeferredValue:function(e){var n=dn();return dt===null?n.memoizedState=e:Jd(n,dt.memoizedState,e)},useTransition:function(){var e=rc(Yi)[0],n=dn().memoizedState;return[e,n]},useMutableSource:Dd,useSyncExternalStore:$d,useId:ef,unstable_isNewReconciler:!1};function Nn(e,n){if(e&&e.defaultProps){n=B({},n),e=e.defaultProps;for(var i in e)n[i]===void 0&&(n[i]=e[i]);return n}return n}function sc(e,n,i,l){n=e.memoizedState,i=i(l,n),i=i==null?n:B({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var il={isMounted:function(e){return(e=e._reactInternals)?Wt(e)===e:!1},enqueueSetState:function(e,n,i){e=e._reactInternals;var l=Mt(),d=Rr(e),p=lr(l,d);p.payload=n,i!=null&&(p.callback=i),n=Mr(e,p,d),n!==null&&(jn(n,e,d,l),qs(n,e,d))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var l=Mt(),d=Rr(e),p=lr(l,d);p.tag=1,p.payload=n,i!=null&&(p.callback=i),n=Mr(e,p,d),n!==null&&(jn(n,e,d,l),qs(n,e,d))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=Mt(),l=Rr(e),d=lr(i,l);d.tag=2,n!=null&&(d.callback=n),n=Mr(e,d,l),n!==null&&(jn(n,e,l,i),qs(n,e,l))}};function of(e,n,i,l,d,p,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,p,w):n.prototype&&n.prototype.isPureReactComponent?!zi(i,l)||!zi(d,p):!0}function sf(e,n,i){var l=!1,d=jr,p=n.contextType;return typeof p=="object"&&p!==null?p=un(p):(d=Lt(n)?io:kt.current,l=n.contextTypes,p=(l=l!=null)?Bo(e,d):jr),n=new n(i,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=d,e.__reactInternalMemoizedMaskedChildContext=p),n}function lf(e,n,i,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,l),n.state!==e&&il.enqueueReplaceState(n,n.state,null)}function lc(e,n,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},Xa(e);var p=n.contextType;typeof p=="object"&&p!==null?d.context=un(p):(p=Lt(n)?io:kt.current,d.context=Bo(e,p)),d.state=e.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(sc(e,n,p,i),d.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(n=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),n!==d.state&&il.enqueueReplaceState(d,d.state,null),Zs(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function qo(e,n){try{var i="",l=n;do i+=de(l),l=l.return;while(l);var d=i}catch(p){d=`
|
|
39
|
-
Error generating stack: `+p.message+`
|
|
40
|
-
`+p.stack}return{value:e,source:n,stack:d,digest:null}}function ac(e,n,i){return{value:e,source:null,stack:i??null,digest:n??null}}function cc(e,n){try{console.error(n.value)}catch(i){setTimeout(function(){throw i})}}var My=typeof WeakMap=="function"?WeakMap:Map;function af(e,n,i){i=lr(-1,i),i.tag=3,i.payload={element:null};var l=n.value;return i.callback=function(){fl||(fl=!0,Nc=l),cc(e,n)},i}function cf(e,n,i){i=lr(-1,i),i.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var d=n.value;i.payload=function(){return l(d)},i.callback=function(){cc(e,n)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){cc(e,n),typeof l!="function"&&(Tr===null?Tr=new Set([this]):Tr.add(this));var w=n.stack;this.componentDidCatch(n.value,{componentStack:w!==null?w:""})}),i}function uf(e,n,i){var l=e.pingCache;if(l===null){l=e.pingCache=new My;var d=new Set;l.set(n,d)}else d=l.get(n),d===void 0&&(d=new Set,l.set(n,d));d.has(i)||(d.add(i),e=Wy.bind(null,e,n,i),n.then(e,e))}function df(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 ff(e,n,i,l,d){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(n=lr(-1,1),n.tag=2,Mr(i,n,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var Iy=j.ReactCurrentOwner,Dt=!1;function Pt(e,n,i,l){n.child=e===null?Id(n,null,i,l):Xo(n,e.child,i,l)}function hf(e,n,i,l,d){i=i.render;var p=n.ref;return Ko(n,d),l=ec(e,n,i,l,p,d),i=tc(),e!==null&&!Dt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~d,ar(e,n,d)):(qe&&i&&Da(n),n.flags|=1,Pt(e,n,l,d),n.child)}function pf(e,n,i,l,d){if(e===null){var p=i.type;return typeof p=="function"&&!Ic(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(n.tag=15,n.type=p,mf(e,n,p,l,d)):(e=vl(i.type,null,l,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,(e.lanes&d)===0){var w=p.memoizedProps;if(i=i.compare,i=i!==null?i:zi,i(w,l)&&e.ref===n.ref)return ar(e,n,d)}return n.flags|=1,e=Lr(p,l),e.ref=n.ref,e.return=n,n.child=e}function mf(e,n,i,l,d){if(e!==null){var p=e.memoizedProps;if(zi(p,l)&&e.ref===n.ref)if(Dt=!1,n.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Dt=!0);else return n.lanes=e.lanes,ar(e,n,d)}return uc(e,n,i,l,d)}function gf(e,n,i){var l=n.pendingProps,d=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},Ge(Jo,Qt),Qt|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Ge(Jo,Qt),Qt|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,Ge(Jo,Qt),Qt|=l}else p!==null?(l=p.baseLanes|i,n.memoizedState=null):l=i,Ge(Jo,Qt),Qt|=l;return Pt(e,n,d,i),n.child}function yf(e,n){var i=n.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(n.flags|=512,n.flags|=2097152)}function uc(e,n,i,l,d){var p=Lt(i)?io:kt.current;return p=Bo(n,p),Ko(n,d),i=ec(e,n,i,l,p,d),l=tc(),e!==null&&!Dt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~d,ar(e,n,d)):(qe&&l&&Da(n),n.flags|=1,Pt(e,n,i,d),n.child)}function vf(e,n,i,l,d){if(Lt(i)){var p=!0;Bs(n)}else p=!1;if(Ko(n,d),n.stateNode===null)ll(e,n),sf(n,i,l),lc(n,i,l,d),l=!0;else if(e===null){var w=n.stateNode,T=n.memoizedProps;w.props=T;var L=w.context,Z=i.contextType;typeof Z=="object"&&Z!==null?Z=un(Z):(Z=Lt(i)?io:kt.current,Z=Bo(n,Z));var ce=i.getDerivedStateFromProps,ue=typeof ce=="function"||typeof w.getSnapshotBeforeUpdate=="function";ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==l||L!==Z)&&lf(n,w,l,Z),Pr=!1;var le=n.memoizedState;w.state=le,Zs(n,l,w,d),L=n.memoizedState,T!==l||le!==L||At.current||Pr?(typeof ce=="function"&&(sc(n,i,ce,l),L=n.memoizedState),(T=Pr||of(n,i,T,l,le,L,Z))?(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=L),w.props=l,w.state=L,w.context=Z,l=T):(typeof w.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{w=n.stateNode,zd(e,n),T=n.memoizedProps,Z=n.type===n.elementType?T:Nn(n.type,T),w.props=Z,ue=n.pendingProps,le=w.context,L=i.contextType,typeof L=="object"&&L!==null?L=un(L):(L=Lt(i)?io:kt.current,L=Bo(n,L));var ye=i.getDerivedStateFromProps;(ce=typeof ye=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==ue||le!==L)&&lf(n,w,l,L),Pr=!1,le=n.memoizedState,w.state=le,Zs(n,l,w,d);var we=n.memoizedState;T!==ue||le!==we||At.current||Pr?(typeof ye=="function"&&(sc(n,i,ye,l),we=n.memoizedState),(Z=Pr||of(n,i,Z,l,le,we,L)||!1)?(ce||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,we,L),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,we,L)),typeof w.componentDidUpdate=="function"&&(n.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof w.componentDidUpdate!="function"||T===e.memoizedProps&&le===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&le===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=we),w.props=l,w.state=we,w.context=L,l=Z):(typeof w.componentDidUpdate!="function"||T===e.memoizedProps&&le===e.memoizedState||(n.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&le===e.memoizedState||(n.flags|=1024),l=!1)}return dc(e,n,i,l,p,d)}function dc(e,n,i,l,d,p){yf(e,n);var w=(n.flags&128)!==0;if(!l&&!w)return d&&kd(n,i,!1),ar(e,n,p);l=n.stateNode,Iy.current=n;var T=w&&typeof i.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&w?(n.child=Xo(n,e.child,null,p),n.child=Xo(n,null,T,p)):Pt(e,n,T,p),n.memoizedState=l.state,d&&kd(n,i,!0),n.child}function xf(e){var n=e.stateNode;n.pendingContext?wd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&wd(e,n.context,!1),Ga(e,n.containerInfo)}function wf(e,n,i,l,d){return Yo(),Ha(d),n.flags|=256,Pt(e,n,i,l),n.child}var fc={dehydrated:null,treeContext:null,retryLane:0};function hc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Sf(e,n,i){var l=n.pendingProps,d=tt.current,p=!1,w=(n.flags&128)!==0,T;if((T=w)||(T=e!==null&&e.memoizedState===null?!1:(d&2)!==0),T?(p=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),Ge(tt,d&1),e===null)return Fa(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=xl(w,l,0,null),e=go(e,l,i,null),p.return=n,e.return=n,p.sibling=e,n.child=p,n.child.memoizedState=hc(i),n.memoizedState=fc,e):pc(n,w));if(d=e.memoizedState,d!==null&&(T=d.dehydrated,T!==null))return Ty(e,n,w,l,T,d,i);if(p){p=l.fallback,w=n.mode,d=e.child,T=d.sibling;var L={mode:"hidden",children:l.children};return(w&1)===0&&n.child!==d?(l=n.child,l.childLanes=0,l.pendingProps=L,n.deletions=null):(l=Lr(d,L),l.subtreeFlags=d.subtreeFlags&14680064),T!==null?p=Lr(T,p):(p=go(p,w,i,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(i):{baseLanes:w.baseLanes|i,cachePool:null,transitions:w.transitions},p.memoizedState=w,p.childLanes=e.childLanes&~i,n.memoizedState=fc,l}return p=e.child,e=p.sibling,l=Lr(p,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=i),l.return=n,l.sibling=null,e!==null&&(i=n.deletions,i===null?(n.deletions=[e],n.flags|=16):i.push(e)),n.child=l,n.memoizedState=null,l}function pc(e,n){return n=xl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function sl(e,n,i,l){return l!==null&&Ha(l),Xo(n,e.child,null,i),e=pc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Ty(e,n,i,l,d,p,w){if(i)return n.flags&256?(n.flags&=-257,l=ac(Error(o(422))),sl(e,n,w,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(p=l.fallback,d=n.mode,l=xl({mode:"visible",children:l.children},d,0,null),p=go(p,d,w,null),p.flags|=2,l.return=n,p.return=n,l.sibling=p,n.child=l,(n.mode&1)!==0&&Xo(n,e.child,null,w),n.child.memoizedState=hc(w),n.memoizedState=fc,p);if((n.mode&1)===0)return sl(e,n,w,null);if(d.data==="$!"){if(l=d.nextSibling&&d.nextSibling.dataset,l)var T=l.dgst;return l=T,p=Error(o(419)),l=ac(p,l,void 0),sl(e,n,w,l)}if(T=(w&e.childLanes)!==0,Dt||T){if(l=gt,l!==null){switch(w&-w){case 4:d=2;break;case 16:d=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:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(l.suspendedLanes|w))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,sr(e,d),jn(l,e,d,-1))}return Mc(),l=ac(Error(o(421))),sl(e,n,w,l)}return d.data==="$?"?(n.flags|=128,n.child=e.child,n=Uy.bind(null,e),d._reactRetry=n,null):(e=p.treeContext,Kt=Cr(d.nextSibling),Gt=n,qe=!0,En=null,e!==null&&(an[cn++]=or,an[cn++]=ir,an[cn++]=so,or=e.id,ir=e.overflow,so=n),n=pc(n,l.children),n.flags|=4096,n)}function kf(e,n,i){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),Ua(e.return,n,i)}function mc(e,n,i,l,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:d}:(p.isBackwards=n,p.rendering=null,p.renderingStartTime=0,p.last=l,p.tail=i,p.tailMode=d)}function Ef(e,n,i){var l=n.pendingProps,d=l.revealOrder,p=l.tail;if(Pt(e,n,l.children,i),l=tt.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&&kf(e,i,n);else if(e.tag===19)kf(e,i,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(Ge(tt,l),(n.mode&1)===0)n.memoizedState=null;else switch(d){case"forwards":for(i=n.child,d=null;i!==null;)e=i.alternate,e!==null&&Js(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=n.child,n.child=null):(d=i.sibling,i.sibling=null),mc(n,!1,d,i,p);break;case"backwards":for(i=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&Js(e)===null){n.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}mc(n,!0,i,null,p);break;case"together":mc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function ll(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function ar(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),fo|=n.lanes,(i&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(o(153));if(n.child!==null){for(e=n.child,i=Lr(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=Lr(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function zy(e,n,i){switch(n.tag){case 3:xf(n),Yo();break;case 5:Ld(n);break;case 1:Lt(n.type)&&Bs(n);break;case 4:Ga(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,d=n.memoizedProps.value;Ge(Ks,l._currentValue),l._currentValue=d;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(Ge(tt,tt.current&1),n.flags|=128,null):(i&n.child.childLanes)!==0?Sf(e,n,i):(Ge(tt,tt.current&1),e=ar(e,n,i),e!==null?e.sibling:null);Ge(tt,tt.current&1);break;case 19:if(l=(i&n.childLanes)!==0,(e.flags&128)!==0){if(l)return Ef(e,n,i);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Ge(tt,tt.current),l)break;return null;case 22:case 23:return n.lanes=0,gf(e,n,i)}return ar(e,n,i)}var Nf,gc,Cf,_f;Nf=function(e,n){for(var i=n.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},gc=function(){},Cf=function(e,n,i,l){var d=e.memoizedProps;if(d!==l){e=n.stateNode,co(Bn.current);var p=null;switch(i){case"input":d=Ae(e,d),l=Ae(e,l),p=[];break;case"select":d=B({},d,{value:void 0}),l=B({},l,{value:void 0}),p=[];break;case"textarea":d=pn(e,d),l=pn(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Fs)}pr(i,l);var w;i=null;for(Z in d)if(!l.hasOwnProperty(Z)&&d.hasOwnProperty(Z)&&d[Z]!=null)if(Z==="style"){var T=d[Z];for(w in T)T.hasOwnProperty(w)&&(i||(i={}),i[w]="")}else Z!=="dangerouslySetInnerHTML"&&Z!=="children"&&Z!=="suppressContentEditableWarning"&&Z!=="suppressHydrationWarning"&&Z!=="autoFocus"&&(a.hasOwnProperty(Z)?p||(p=[]):(p=p||[]).push(Z,null));for(Z in l){var L=l[Z];if(T=d!=null?d[Z]:void 0,l.hasOwnProperty(Z)&&L!==T&&(L!=null||T!=null))if(Z==="style")if(T){for(w in T)!T.hasOwnProperty(w)||L&&L.hasOwnProperty(w)||(i||(i={}),i[w]="");for(w in L)L.hasOwnProperty(w)&&T[w]!==L[w]&&(i||(i={}),i[w]=L[w])}else i||(p||(p=[]),p.push(Z,i)),i=L;else Z==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,T=T?T.__html:void 0,L!=null&&T!==L&&(p=p||[]).push(Z,L)):Z==="children"?typeof L!="string"&&typeof L!="number"||(p=p||[]).push(Z,""+L):Z!=="suppressContentEditableWarning"&&Z!=="suppressHydrationWarning"&&(a.hasOwnProperty(Z)?(L!=null&&Z==="onScroll"&&Ke("scroll",e),p||T===L||(p=[])):(p=p||[]).push(Z,L))}i&&(p=p||[]).push("style",i);var Z=p;(n.updateQueue=Z)&&(n.flags|=4)}},_f=function(e,n,i,l){i!==l&&(n.flags|=4)};function Gi(e,n){if(!qe)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function Nt(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(n)for(var d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags&14680064,l|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)i|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=l,e.childLanes=i,n}function Ry(e,n,i){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 Nt(n),null;case 1:return Lt(n.type)&&Vs(),Nt(n),null;case 3:return l=n.stateNode,Qo(),Qe(At),Qe(kt),qa(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Xs(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,En!==null&&(jc(En),En=null))),gc(e,n),Nt(n),null;case 5:Ka(n);var d=co(Bi.current);if(i=n.type,e!==null&&n.stateNode!=null)Cf(e,n,i,l,d),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(o(166));return Nt(n),null}if(e=co(Bn.current),Xs(n)){l=n.stateNode,i=n.type;var p=n.memoizedProps;switch(l[Vn]=n,l[$i]=p,e=(n.mode&1)!==0,i){case"dialog":Ke("cancel",l),Ke("close",l);break;case"iframe":case"object":case"embed":Ke("load",l);break;case"video":case"audio":for(d=0;d<Ai.length;d++)Ke(Ai[d],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":He(l,p),Ke("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},Ke("invalid",l);break;case"textarea":zn(l,p),Ke("invalid",l)}pr(i,p),d=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&&Os(l.textContent,T,e),d=["children",T]):typeof T=="number"&&l.textContent!==""+T&&(p.suppressHydrationWarning!==!0&&Os(l.textContent,T,e),d=["children",""+T]):a.hasOwnProperty(w)&&T!=null&&w==="onScroll"&&Ke("scroll",l)}switch(i){case"input":be(l),st(l,p,!0);break;case"textarea":be(l),Rn(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Fs)}l=d,n.updateQueue=l,l!==null&&(n.flags|=4)}else{w=d.nodeType===9?d:d.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=en(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=w.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=w.createElement(i,{is:l.is}):(e=w.createElement(i),i==="select"&&(w=e,l.multiple?w.multiple=!0:l.size&&(w.size=l.size))):e=w.createElementNS(e,i),e[Vn]=n,e[$i]=l,Nf(e,n,!1,!1),n.stateNode=e;e:{switch(w=nn(i,l),i){case"dialog":Ke("cancel",e),Ke("close",e),d=l;break;case"iframe":case"object":case"embed":Ke("load",e),d=l;break;case"video":case"audio":for(d=0;d<Ai.length;d++)Ke(Ai[d],e);d=l;break;case"source":Ke("error",e),d=l;break;case"img":case"image":case"link":Ke("error",e),Ke("load",e),d=l;break;case"details":Ke("toggle",e),d=l;break;case"input":He(e,l),d=Ae(e,l),Ke("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=B({},l,{value:void 0}),Ke("invalid",e);break;case"textarea":zn(e,l),d=pn(e,l),Ke("invalid",e);break;default:d=l}pr(i,d),T=d;for(p in T)if(T.hasOwnProperty(p)){var L=T[p];p==="style"?Bt(e,L):p==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,L!=null&&Wr(e,L)):p==="children"?typeof L=="string"?(i!=="textarea"||L!=="")&&tn(e,L):typeof L=="number"&&tn(e,""+L):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?L!=null&&p==="onScroll"&&Ke("scroll",e):L!=null&&C(e,p,L,w))}switch(i){case"input":be(e),st(e,l,!1);break;case"textarea":be(e),Rn(e);break;case"option":l.value!=null&&e.setAttribute("value",""+te(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?pt(e,!!l.multiple,p,!1):l.defaultValue!=null&&pt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Fs)}switch(i){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 Nt(n),null;case 6:if(e&&n.stateNode!=null)_f(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(o(166));if(i=co(Bi.current),co(Bn.current),Xs(n)){if(l=n.stateNode,i=n.memoizedProps,l[Vn]=n,(p=l.nodeValue!==i)&&(e=Gt,e!==null))switch(e.tag){case 3:Os(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Os(l.nodeValue,i,(e.mode&1)!==0)}p&&(n.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[Vn]=n,n.stateNode=l}return Nt(n),null;case 13:if(Qe(tt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(qe&&Kt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)bd(),Yo(),n.flags|=98560,p=!1;else if(p=Xs(n),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(o(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[Vn]=n}else Yo(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Nt(n),p=!1}else En!==null&&(jc(En),En=null),p=!0;if(!p)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=i,n):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(tt.current&1)!==0?ft===0&&(ft=3):Mc())),n.updateQueue!==null&&(n.flags|=4),Nt(n),null);case 4:return Qo(),gc(e,n),e===null&&Li(n.stateNode.containerInfo),Nt(n),null;case 10:return Wa(n.type._context),Nt(n),null;case 17:return Lt(n.type)&&Vs(),Nt(n),null;case 19:if(Qe(tt),p=n.memoizedState,p===null)return Nt(n),null;if(l=(n.flags&128)!==0,w=p.rendering,w===null)if(l)Gi(p,!1);else{if(ft!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(w=Js(e),w!==null){for(n.flags|=128,Gi(p,!1),l=w.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=i,i=n.child;i!==null;)p=i,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}),i=i.sibling;return Ge(tt,tt.current&1|2),n.child}e=e.sibling}p.tail!==null&&Ye()>ei&&(n.flags|=128,l=!0,Gi(p,!1),n.lanes=4194304)}else{if(!l)if(e=Js(w),e!==null){if(n.flags|=128,l=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),Gi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!qe)return Nt(n),null}else 2*Ye()-p.renderingStartTime>ei&&i!==1073741824&&(n.flags|=128,l=!0,Gi(p,!1),n.lanes=4194304);p.isBackwards?(w.sibling=n.child,n.child=w):(i=p.last,i!==null?i.sibling=w:n.child=w,p.last=w)}return p.tail!==null?(n=p.tail,p.rendering=n,p.tail=n.sibling,p.renderingStartTime=Ye(),n.sibling=null,i=tt.current,Ge(tt,l?i&1|2:i&1),n):(Nt(n),null);case 22:case 23:return Pc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Qt&1073741824)!==0&&(Nt(n),n.subtreeFlags&6&&(n.flags|=8192)):Nt(n),null;case 24:return null;case 25:return null}throw Error(o(156,n.tag))}function Ay(e,n){switch($a(n),n.tag){case 1:return Lt(n.type)&&Vs(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Qo(),Qe(At),Qe(kt),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(tt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));Yo()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Qe(tt),null;case 4:return Qo(),null;case 10:return Wa(n.type._context),null;case 22:case 23:return Pc(),null;case 24:return null;default:return null}}var al=!1,Ct=!1,Ly=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Zo(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){ot(e,n,l)}else i.current=null}function yc(e,n,i){try{i()}catch(l){ot(e,n,l)}}var jf=!1;function Dy(e,n){if(Pa=Pe,e=od(),Sa(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var w=0,T=-1,L=-1,Z=0,ce=0,ue=e,le=null;t:for(;;){for(var ye;ue!==i||d!==0&&ue.nodeType!==3||(T=w+d),ue!==p||l!==0&&ue.nodeType!==3||(L=w+l),ue.nodeType===3&&(w+=ue.nodeValue.length),(ye=ue.firstChild)!==null;)le=ue,ue=ye;for(;;){if(ue===e)break t;if(le===i&&++Z===d&&(T=w),le===p&&++ce===l&&(L=w),(ye=ue.nextSibling)!==null)break;ue=le,le=ue.parentNode}ue=ye}i=T===-1||L===-1?null:{start:T,end:L}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ma={focusedElem:e,selectionRange:i},Pe=!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 we=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var Se=we.memoizedProps,it=we.memoizedState,Y=n.stateNode,F=Y.getSnapshotBeforeUpdate(n.elementType===n.type?Se:Nn(n.type,Se),it);Y.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var Q=n.stateNode.containerInfo;Q.nodeType===1?Q.textContent="":Q.nodeType===9&&Q.documentElement&&Q.removeChild(Q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(he){ot(n,n.return,he)}if(e=n.sibling,e!==null){e.return=n.return,ve=e;break}ve=n.return}return we=jf,jf=!1,we}function Ki(e,n,i){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var d=l=l.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&yc(n,i,p)}d=d.next}while(d!==l)}}function cl(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var l=i.create;i.destroy=l()}i=i.next}while(i!==n)}}function vc(e){var n=e.ref;if(n!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof n=="function"?n(e):n.current=e}}function bf(e){var n=e.alternate;n!==null&&(e.alternate=null,bf(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Vn],delete n[$i],delete n[Ra],delete n[xy],delete n[wy])),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 Mf(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,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?i.nodeType===8?i.parentNode.insertBefore(e,n):i.insertBefore(e,n):(i.nodeType===8?(n=i.parentNode,n.insertBefore(e,i)):(n=i,n.appendChild(e)),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Fs));else if(l!==4&&(e=e.child,e!==null))for(xc(e,n,i),e=e.sibling;e!==null;)xc(e,n,i),e=e.sibling}function wc(e,n,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(wc(e,n,i),e=e.sibling;e!==null;)wc(e,n,i),e=e.sibling}var wt=null,Cn=!1;function Ir(e,n,i){for(i=i.child;i!==null;)If(e,n,i),i=i.sibling}function If(e,n,i){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(Be,i)}catch{}switch(i.tag){case 5:Ct||Zo(i,n);case 6:var l=wt,d=Cn;wt=null,Ir(e,n,i),wt=l,Cn=d,wt!==null&&(Cn?(e=wt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):wt.removeChild(i.stateNode));break;case 18:wt!==null&&(Cn?(e=wt,i=i.stateNode,e.nodeType===8?za(e.parentNode,i):e.nodeType===1&&za(e,i),Ne(e)):za(wt,i.stateNode));break;case 4:l=wt,d=Cn,wt=i.stateNode.containerInfo,Cn=!0,Ir(e,n,i),wt=l,Cn=d;break;case 0:case 11:case 14:case 15:if(!Ct&&(l=i.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){d=l=l.next;do{var p=d,w=p.destroy;p=p.tag,w!==void 0&&((p&2)!==0||(p&4)!==0)&&yc(i,n,w),d=d.next}while(d!==l)}Ir(e,n,i);break;case 1:if(!Ct&&(Zo(i,n),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(T){ot(i,n,T)}Ir(e,n,i);break;case 21:Ir(e,n,i);break;case 22:i.mode&1?(Ct=(l=Ct)||i.memoizedState!==null,Ir(e,n,i),Ct=l):Ir(e,n,i);break;default:Ir(e,n,i)}}function Tf(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Ly),n.forEach(function(l){var d=Yy.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function _n(e,n){var i=n.deletions;if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];try{var p=e,w=n,T=w;e:for(;T!==null;){switch(T.tag){case 5:wt=T.stateNode,Cn=!1;break e;case 3:wt=T.stateNode.containerInfo,Cn=!0;break e;case 4:wt=T.stateNode.containerInfo,Cn=!0;break e}T=T.return}if(wt===null)throw Error(o(160));If(p,w,d),wt=null,Cn=!1;var L=d.alternate;L!==null&&(L.return=null),d.return=null}catch(Z){ot(d,n,Z)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)zf(n,e),n=n.sibling}function zf(e,n){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(_n(n,e),Un(e),l&4){try{Ki(3,e,e.return),cl(3,e)}catch(Se){ot(e,e.return,Se)}try{Ki(5,e,e.return)}catch(Se){ot(e,e.return,Se)}}break;case 1:_n(n,e),Un(e),l&512&&i!==null&&Zo(i,i.return);break;case 5:if(_n(n,e),Un(e),l&512&&i!==null&&Zo(i,i.return),e.flags&32){var d=e.stateNode;try{tn(d,"")}catch(Se){ot(e,e.return,Se)}}if(l&4&&(d=e.stateNode,d!=null)){var p=e.memoizedProps,w=i!==null?i.memoizedProps:p,T=e.type,L=e.updateQueue;if(e.updateQueue=null,L!==null)try{T==="input"&&p.type==="radio"&&p.name!=null&&Re(d,p),nn(T,w);var Z=nn(T,p);for(w=0;w<L.length;w+=2){var ce=L[w],ue=L[w+1];ce==="style"?Bt(d,ue):ce==="dangerouslySetInnerHTML"?Wr(d,ue):ce==="children"?tn(d,ue):C(d,ce,ue,Z)}switch(T){case"input":Ue(d,p);break;case"textarea":xt(d,p);break;case"select":var le=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var ye=p.value;ye!=null?pt(d,!!p.multiple,ye,!1):le!==!!p.multiple&&(p.defaultValue!=null?pt(d,!!p.multiple,p.defaultValue,!0):pt(d,!!p.multiple,p.multiple?[]:"",!1))}d[$i]=p}catch(Se){ot(e,e.return,Se)}}break;case 6:if(_n(n,e),Un(e),l&4){if(e.stateNode===null)throw Error(o(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(Se){ot(e,e.return,Se)}}break;case 3:if(_n(n,e),Un(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Ne(n.containerInfo)}catch(Se){ot(e,e.return,Se)}break;case 4:_n(n,e),Un(e);break;case 13:_n(n,e),Un(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(Ec=Ye())),l&4&&Tf(e);break;case 22:if(ce=i!==null&&i.memoizedState!==null,e.mode&1?(Ct=(Z=Ct)||ce,_n(n,e),Ct=Z):_n(n,e),Un(e),l&8192){if(Z=e.memoizedState!==null,(e.stateNode.isHidden=Z)&&!ce&&(e.mode&1)!==0)for(ve=e,ce=e.child;ce!==null;){for(ue=ve=ce;ve!==null;){switch(le=ve,ye=le.child,le.tag){case 0:case 11:case 14:case 15:Ki(4,le,le.return);break;case 1:Zo(le,le.return);var we=le.stateNode;if(typeof we.componentWillUnmount=="function"){l=le,i=le.return;try{n=l,we.props=n.memoizedProps,we.state=n.memoizedState,we.componentWillUnmount()}catch(Se){ot(l,i,Se)}}break;case 5:Zo(le,le.return);break;case 22:if(le.memoizedState!==null){Lf(ue);continue}}ye!==null?(ye.return=le,ve=ye):Lf(ue)}ce=ce.sibling}e:for(ce=null,ue=e;;){if(ue.tag===5){if(ce===null){ce=ue;try{d=ue.stateNode,Z?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(T=ue.stateNode,L=ue.memoizedProps.style,w=L!=null&&L.hasOwnProperty("display")?L.display:null,T.style.display=gn("display",w))}catch(Se){ot(e,e.return,Se)}}}else if(ue.tag===6){if(ce===null)try{ue.stateNode.nodeValue=Z?"":ue.memoizedProps}catch(Se){ot(e,e.return,Se)}}else if((ue.tag!==22&&ue.tag!==23||ue.memoizedState===null||ue===e)&&ue.child!==null){ue.child.return=ue,ue=ue.child;continue}if(ue===e)break e;for(;ue.sibling===null;){if(ue.return===null||ue.return===e)break e;ce===ue&&(ce=null),ue=ue.return}ce===ue&&(ce=null),ue.sibling.return=ue.return,ue=ue.sibling}}break;case 19:_n(n,e),Un(e),l&4&&Tf(e);break;case 21:break;default:_n(n,e),Un(e)}}function Un(e){var n=e.flags;if(n&2){try{e:{for(var i=e.return;i!==null;){if(Pf(i)){var l=i;break e}i=i.return}throw Error(o(160))}switch(l.tag){case 5:var d=l.stateNode;l.flags&32&&(tn(d,""),l.flags&=-33);var p=Mf(e);wc(e,p,d);break;case 3:case 4:var w=l.stateNode.containerInfo,T=Mf(e);xc(e,T,w);break;default:throw Error(o(161))}}catch(L){ot(e,e.return,L)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function $y(e,n,i){ve=e,Rf(e)}function Rf(e,n,i){for(var l=(e.mode&1)!==0;ve!==null;){var d=ve,p=d.child;if(d.tag===22&&l){var w=d.memoizedState!==null||al;if(!w){var T=d.alternate,L=T!==null&&T.memoizedState!==null||Ct;T=al;var Z=Ct;if(al=w,(Ct=L)&&!Z)for(ve=d;ve!==null;)w=ve,L=w.child,w.tag===22&&w.memoizedState!==null?Df(d):L!==null?(L.return=w,ve=L):Df(d);for(;p!==null;)ve=p,Rf(p),p=p.sibling;ve=d,al=T,Ct=Z}Af(e)}else(d.subtreeFlags&8772)!==0&&p!==null?(p.return=d,ve=p):Af(e)}}function Af(e){for(;ve!==null;){var n=ve;if((n.flags&8772)!==0){var i=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:Ct||cl(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!Ct)if(i===null)l.componentDidMount();else{var d=n.elementType===n.type?i.memoizedProps:Nn(n.type,i.memoizedProps);l.componentDidUpdate(d,i.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var p=n.updateQueue;p!==null&&Ad(n,p,l);break;case 3:var w=n.updateQueue;if(w!==null){if(i=null,n.child!==null)switch(n.child.tag){case 5:i=n.child.stateNode;break;case 1:i=n.child.stateNode}Ad(n,w,i)}break;case 5:var T=n.stateNode;if(i===null&&n.flags&4){i=T;var L=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":L.autoFocus&&i.focus();break;case"img":L.src&&(i.src=L.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var Z=n.alternate;if(Z!==null){var ce=Z.memoizedState;if(ce!==null){var ue=ce.dehydrated;ue!==null&&Ne(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Ct||n.flags&512&&vc(n)}catch(le){ot(n,n.return,le)}}if(n===e){ve=null;break}if(i=n.sibling,i!==null){i.return=n.return,ve=i;break}ve=n.return}}function Lf(e){for(;ve!==null;){var n=ve;if(n===e){ve=null;break}var i=n.sibling;if(i!==null){i.return=n.return,ve=i;break}ve=n.return}}function Df(e){for(;ve!==null;){var n=ve;try{switch(n.tag){case 0:case 11:case 15:var i=n.return;try{cl(4,n)}catch(L){ot(n,i,L)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var d=n.return;try{l.componentDidMount()}catch(L){ot(n,d,L)}}var p=n.return;try{vc(n)}catch(L){ot(n,p,L)}break;case 5:var w=n.return;try{vc(n)}catch(L){ot(n,w,L)}}}catch(L){ot(n,n.return,L)}if(n===e){ve=null;break}var T=n.sibling;if(T!==null){T.return=n.return,ve=T;break}ve=n.return}}var Oy=Math.ceil,ul=j.ReactCurrentDispatcher,Sc=j.ReactCurrentOwner,fn=j.ReactCurrentBatchConfig,Oe=0,gt=null,at=null,St=0,Qt=0,Jo=_r(0),ft=0,Qi=null,fo=0,dl=0,kc=0,qi=null,$t=null,Ec=0,ei=1/0,cr=null,fl=!1,Nc=null,Tr=null,hl=!1,zr=null,pl=0,Zi=0,Cc=null,ml=-1,gl=0;function Mt(){return(Oe&6)!==0?Ye():ml!==-1?ml:ml=Ye()}function Rr(e){return(e.mode&1)===0?1:(Oe&2)!==0&&St!==0?St&-St:ky.transition!==null?(gl===0&&(gl=tr()),gl):(e=Ve,e!==0||(e=window.event,e=e===void 0?16:Sn(e.type)),e)}function jn(e,n,i,l){if(50<Zi)throw Zi=0,Cc=null,Error(o(185));$n(e,i,l),((Oe&2)===0||e!==gt)&&(e===gt&&((Oe&2)===0&&(dl|=i),ft===4&&Ar(e,St)),Ot(e,l),i===1&&Oe===0&&(n.mode&1)===0&&(ei=Ye()+500,Ws&&br()))}function Ot(e,n){var i=e.callbackNode;zo(e,n);var l=wr(e,e===gt?St:0);if(l===0)i!==null&&To(i),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(i!=null&&To(i),n===1)e.tag===0?Sy(Of.bind(null,e)):Ed(Of.bind(null,e)),yy(function(){(Oe&6)===0&&br()}),i=null;else{switch(Cs(l)){case 1:i=gr;break;case 4:i=Dn;break;case 16:i=yr;break;case 536870912:i=er;break;default:i=yr}i=Xf(i,$f.bind(null,e))}e.callbackPriority=n,e.callbackNode=i}}function $f(e,n){if(ml=-1,gl=0,(Oe&6)!==0)throw Error(o(327));var i=e.callbackNode;if(ti()&&e.callbackNode!==i)return null;var l=wr(e,e===gt?St:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=yl(e,l);else{n=l;var d=Oe;Oe|=2;var p=Hf();(gt!==e||St!==n)&&(cr=null,ei=Ye()+500,po(e,n));do try{Vy();break}catch(T){Ff(e,T)}while(!0);Ba(),ul.current=p,Oe=d,at!==null?n=0:(gt=null,St=0,n=ft)}if(n!==0){if(n===2&&(d=eo(e),d!==0&&(l=d,n=_c(e,d))),n===1)throw i=Qi,po(e,0),Ar(e,l),Ot(e,Ye()),i;if(n===6)Ar(e,l);else{if(d=e.current.alternate,(l&30)===0&&!Fy(d)&&(n=yl(e,l),n===2&&(p=eo(e),p!==0&&(l=p,n=_c(e,p))),n===1))throw i=Qi,po(e,0),Ar(e,l),Ot(e,Ye()),i;switch(e.finishedWork=d,e.finishedLanes=l,n){case 0:case 1:throw Error(o(345));case 2:mo(e,$t,cr);break;case 3:if(Ar(e,l),(l&130023424)===l&&(n=Ec+500-Ye(),10<n)){if(wr(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){Mt(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Ta(mo.bind(null,e,$t,cr),n);break}mo(e,$t,cr);break;case 4:if(Ar(e,l),(l&4194240)===l)break;for(n=e.eventTimes,d=-1;0<l;){var w=31-bt(l);p=1<<w,w=n[w],w>d&&(d=w),l&=~p}if(l=d,l=Ye()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Oy(l/1960))-l,10<l){e.timeoutHandle=Ta(mo.bind(null,e,$t,cr),l);break}mo(e,$t,cr);break;case 5:mo(e,$t,cr);break;default:throw Error(o(329))}}}return Ot(e,Ye()),e.callbackNode===i?$f.bind(null,e):null}function _c(e,n){var i=qi;return e.current.memoizedState.isDehydrated&&(po(e,n).flags|=256),e=yl(e,n),e!==2&&(n=$t,$t=i,n!==null&&jc(n)),e}function jc(e){$t===null?$t=e:$t.push.apply($t,e)}function Fy(e){for(var n=e;;){if(n.flags&16384){var i=n.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var l=0;l<i.length;l++){var d=i[l],p=d.getSnapshot;d=d.value;try{if(!kn(p(),d))return!1}catch{return!1}}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;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 Ar(e,n){for(n&=~kc,n&=~dl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var i=31-bt(n),l=1<<i;e[i]=-1,n&=~l}}function Of(e){if((Oe&6)!==0)throw Error(o(327));ti();var n=wr(e,0);if((n&1)===0)return Ot(e,Ye()),null;var i=yl(e,n);if(e.tag!==0&&i===2){var l=eo(e);l!==0&&(n=l,i=_c(e,l))}if(i===1)throw i=Qi,po(e,0),Ar(e,n),Ot(e,Ye()),i;if(i===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,mo(e,$t,cr),Ot(e,Ye()),null}function bc(e,n){var i=Oe;Oe|=1;try{return e(n)}finally{Oe=i,Oe===0&&(ei=Ye()+500,Ws&&br())}}function ho(e){zr!==null&&zr.tag===0&&(Oe&6)===0&&ti();var n=Oe;Oe|=1;var i=fn.transition,l=Ve;try{if(fn.transition=null,Ve=1,e)return e()}finally{Ve=l,fn.transition=i,Oe=n,(Oe&6)===0&&br()}}function Pc(){Qt=Jo.current,Qe(Jo)}function po(e,n){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,gy(i)),at!==null)for(i=at.return;i!==null;){var l=i;switch($a(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&Vs();break;case 3:Qo(),Qe(At),Qe(kt),qa();break;case 5:Ka(l);break;case 4:Qo();break;case 13:Qe(tt);break;case 19:Qe(tt);break;case 10:Wa(l.type._context);break;case 22:case 23:Pc()}i=i.return}if(gt=e,at=e=Lr(e.current,null),St=Qt=n,ft=0,Qi=null,kc=dl=fo=0,$t=qi=null,ao!==null){for(n=0;n<ao.length;n++)if(i=ao[n],l=i.interleaved,l!==null){i.interleaved=null;var d=l.next,p=i.pending;if(p!==null){var w=p.next;p.next=d,l.next=w}i.pending=l}ao=null}return e}function Ff(e,n){do{var i=at;try{if(Ba(),el.current=ol,tl){for(var l=nt.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}tl=!1}if(uo=0,mt=dt=nt=null,Wi=!1,Ui=0,Sc.current=null,i===null||i.return===null){ft=1,Qi=n,at=null;break}e:{var p=e,w=i.return,T=i,L=n;if(n=St,T.flags|=32768,L!==null&&typeof L=="object"&&typeof L.then=="function"){var Z=L,ce=T,ue=ce.tag;if((ce.mode&1)===0&&(ue===0||ue===11||ue===15)){var le=ce.alternate;le?(ce.updateQueue=le.updateQueue,ce.memoizedState=le.memoizedState,ce.lanes=le.lanes):(ce.updateQueue=null,ce.memoizedState=null)}var ye=df(w);if(ye!==null){ye.flags&=-257,ff(ye,w,T,p,n),ye.mode&1&&uf(p,Z,n),n=ye,L=Z;var we=n.updateQueue;if(we===null){var Se=new Set;Se.add(L),n.updateQueue=Se}else we.add(L);break e}else{if((n&1)===0){uf(p,Z,n),Mc();break e}L=Error(o(426))}}else if(qe&&T.mode&1){var it=df(w);if(it!==null){(it.flags&65536)===0&&(it.flags|=256),ff(it,w,T,p,n),Ha(qo(L,T));break e}}p=L=qo(L,T),ft!==4&&(ft=2),qi===null?qi=[p]:qi.push(p),p=w;do{switch(p.tag){case 3:p.flags|=65536,n&=-n,p.lanes|=n;var Y=af(p,L,n);Rd(p,Y);break e;case 1:T=L;var F=p.type,Q=p.stateNode;if((p.flags&128)===0&&(typeof F.getDerivedStateFromError=="function"||Q!==null&&typeof Q.componentDidCatch=="function"&&(Tr===null||!Tr.has(Q)))){p.flags|=65536,n&=-n,p.lanes|=n;var he=cf(p,T,n);Rd(p,he);break e}}p=p.return}while(p!==null)}Bf(i)}catch(ke){n=ke,at===i&&i!==null&&(at=i=i.return);continue}break}while(!0)}function Hf(){var e=ul.current;return ul.current=ol,e===null?ol:e}function Mc(){(ft===0||ft===3||ft===2)&&(ft=4),gt===null||(fo&268435455)===0&&(dl&268435455)===0||Ar(gt,St)}function yl(e,n){var i=Oe;Oe|=2;var l=Hf();(gt!==e||St!==n)&&(cr=null,po(e,n));do try{Hy();break}catch(d){Ff(e,d)}while(!0);if(Ba(),Oe=i,ul.current=l,at!==null)throw Error(o(261));return gt=null,St=0,ft}function Hy(){for(;at!==null;)Vf(at)}function Vy(){for(;at!==null&&!vi();)Vf(at)}function Vf(e){var n=Yf(e.alternate,e,Qt);e.memoizedProps=e.pendingProps,n===null?Bf(e):at=n,Sc.current=null}function Bf(e){var n=e;do{var i=n.alternate;if(e=n.return,(n.flags&32768)===0){if(i=Ry(i,n,Qt),i!==null){at=i;return}}else{if(i=Ay(i,n),i!==null){i.flags&=32767,at=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ft=6,at=null;return}}if(n=n.sibling,n!==null){at=n;return}at=n=e}while(n!==null);ft===0&&(ft=5)}function mo(e,n,i){var l=Ve,d=fn.transition;try{fn.transition=null,Ve=1,By(e,n,i,l)}finally{fn.transition=d,Ve=l}return null}function By(e,n,i,l){do ti();while(zr!==null);if((Oe&6)!==0)throw Error(o(327));i=e.finishedWork;var d=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(On(e,p),e===gt&&(at=gt=null,St=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||hl||(hl=!0,Xf(yr,function(){return ti(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=fn.transition,fn.transition=null;var w=Ve;Ve=1;var T=Oe;Oe|=4,Sc.current=null,Dy(e,i),zf(i,e),cy(Ma),Pe=!!Pa,Ma=Pa=null,e.current=i,$y(i),qr(),Oe=T,Ve=w,fn.transition=p}else e.current=i;if(hl&&(hl=!1,zr=e,pl=d),p=e.pendingLanes,p===0&&(Tr=null),wi(i.stateNode),Ot(e,Ye()),n!==null)for(l=e.onRecoverableError,i=0;i<n.length;i++)d=n[i],l(d.value,{componentStack:d.stack,digest:d.digest});if(fl)throw fl=!1,e=Nc,Nc=null,e;return(pl&1)!==0&&e.tag!==0&&ti(),p=e.pendingLanes,(p&1)!==0?e===Cc?Zi++:(Zi=0,Cc=e):Zi=0,br(),null}function ti(){if(zr!==null){var e=Cs(pl),n=fn.transition,i=Ve;try{if(fn.transition=null,Ve=16>e?16:e,zr===null)var l=!1;else{if(e=zr,zr=null,pl=0,(Oe&6)!==0)throw Error(o(331));var d=Oe;for(Oe|=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 L=0;L<T.length;L++){var Z=T[L];for(ve=Z;ve!==null;){var ce=ve;switch(ce.tag){case 0:case 11:case 15:Ki(8,ce,p)}var ue=ce.child;if(ue!==null)ue.return=ce,ve=ue;else for(;ve!==null;){ce=ve;var le=ce.sibling,ye=ce.return;if(bf(ce),ce===Z){ve=null;break}if(le!==null){le.return=ye,ve=le;break}ve=ye}}}var we=p.alternate;if(we!==null){var Se=we.child;if(Se!==null){we.child=null;do{var it=Se.sibling;Se.sibling=null,Se=it}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:Ki(9,p,p.return)}var Y=p.sibling;if(Y!==null){Y.return=p.return,ve=Y;break e}ve=p.return}}var F=e.current;for(ve=F;ve!==null;){w=ve;var Q=w.child;if((w.subtreeFlags&2064)!==0&&Q!==null)Q.return=w,ve=Q;else e:for(w=F;ve!==null;){if(T=ve,(T.flags&2048)!==0)try{switch(T.tag){case 0:case 11:case 15:cl(9,T)}}catch(ke){ot(T,T.return,ke)}if(T===w){ve=null;break e}var he=T.sibling;if(he!==null){he.return=T.return,ve=he;break e}ve=T.return}}if(Oe=d,br(),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(Be,e)}catch{}l=!0}return l}finally{Ve=i,fn.transition=n}}return!1}function Wf(e,n,i){n=qo(i,n),n=af(e,n,1),e=Mr(e,n,1),n=Mt(),e!==null&&($n(e,1,n),Ot(e,n))}function ot(e,n,i){if(e.tag===3)Wf(e,e,i);else for(;n!==null;){if(n.tag===3){Wf(n,e,i);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Tr===null||!Tr.has(l))){e=qo(i,e),e=cf(n,e,1),n=Mr(n,e,1),e=Mt(),n!==null&&($n(n,1,e),Ot(n,e));break}}n=n.return}}function Wy(e,n,i){var l=e.pingCache;l!==null&&l.delete(n),n=Mt(),e.pingedLanes|=e.suspendedLanes&i,gt===e&&(St&i)===i&&(ft===4||ft===3&&(St&130023424)===St&&500>Ye()-Ec?po(e,0):kc|=i),Ot(e,n)}function Uf(e,n){n===0&&((e.mode&1)===0?n=1:(n=xr,xr<<=1,(xr&130023424)===0&&(xr=4194304)));var i=Mt();e=sr(e,n),e!==null&&($n(e,n,i),Ot(e,i))}function Uy(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),Uf(e,i)}function Yy(e,n){var i=0;switch(e.tag){case 13:var l=e.stateNode,d=e.memoizedState;d!==null&&(i=d.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(o(314))}l!==null&&l.delete(n),Uf(e,i)}var Yf;Yf=function(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps||At.current)Dt=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return Dt=!1,zy(e,n,i);Dt=(e.flags&131072)!==0}else Dt=!1,qe&&(n.flags&1048576)!==0&&Nd(n,Ys,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;ll(e,n),e=n.pendingProps;var d=Bo(n,kt.current);Ko(n,i),d=ec(null,n,l,e,d,i);var p=tc();return n.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Lt(l)?(p=!0,Bs(n)):p=!1,n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Xa(n),d.updater=il,n.stateNode=d,d._reactInternals=n,lc(n,l,e,i),n=dc(null,n,l,!0,p,i)):(n.tag=0,qe&&p&&Da(n),Pt(null,n,d,i),n=n.child),n;case 16:l=n.elementType;e:{switch(ll(e,n),e=n.pendingProps,d=l._init,l=d(l._payload),n.type=l,d=n.tag=Gy(l),e=Nn(l,e),d){case 0:n=uc(null,n,l,e,i);break e;case 1:n=vf(null,n,l,e,i);break e;case 11:n=hf(null,n,l,e,i);break e;case 14:n=pf(null,n,l,Nn(l.type,e),i);break e}throw Error(o(306,l,""))}return n;case 0:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:Nn(l,d),uc(e,n,l,d,i);case 1:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:Nn(l,d),vf(e,n,l,d,i);case 3:e:{if(xf(n),e===null)throw Error(o(387));l=n.pendingProps,p=n.memoizedState,d=p.element,zd(e,n),Zs(n,l,null,i);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){d=qo(Error(o(423)),n),n=wf(e,n,l,i,d);break e}else if(l!==d){d=qo(Error(o(424)),n),n=wf(e,n,l,i,d);break e}else for(Kt=Cr(n.stateNode.containerInfo.firstChild),Gt=n,qe=!0,En=null,i=Id(n,null,l,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Yo(),l===d){n=ar(e,n,i);break e}Pt(e,n,l,i)}n=n.child}return n;case 5:return Ld(n),e===null&&Fa(n),l=n.type,d=n.pendingProps,p=e!==null?e.memoizedProps:null,w=d.children,Ia(l,d)?w=null:p!==null&&Ia(l,p)&&(n.flags|=32),yf(e,n),Pt(e,n,w,i),n.child;case 6:return e===null&&Fa(n),null;case 13:return Sf(e,n,i);case 4:return Ga(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=Xo(n,null,l,i):Pt(e,n,l,i),n.child;case 11:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:Nn(l,d),hf(e,n,l,d,i);case 7:return Pt(e,n,n.pendingProps,i),n.child;case 8:return Pt(e,n,n.pendingProps.children,i),n.child;case 12:return Pt(e,n,n.pendingProps.children,i),n.child;case 10:e:{if(l=n.type._context,d=n.pendingProps,p=n.memoizedProps,w=d.value,Ge(Ks,l._currentValue),l._currentValue=w,p!==null)if(kn(p.value,w)){if(p.children===d.children&&!At.current){n=ar(e,n,i);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 L=T.firstContext;L!==null;){if(L.context===l){if(p.tag===1){L=lr(-1,i&-i),L.tag=2;var Z=p.updateQueue;if(Z!==null){Z=Z.shared;var ce=Z.pending;ce===null?L.next=L:(L.next=ce.next,ce.next=L),Z.pending=L}}p.lanes|=i,L=p.alternate,L!==null&&(L.lanes|=i),Ua(p.return,i,n),T.lanes|=i;break}L=L.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(o(341));w.lanes|=i,T=w.alternate,T!==null&&(T.lanes|=i),Ua(w,i,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}Pt(e,n,d.children,i),n=n.child}return n;case 9:return d=n.type,l=n.pendingProps.children,Ko(n,i),d=un(d),l=l(d),n.flags|=1,Pt(e,n,l,i),n.child;case 14:return l=n.type,d=Nn(l,n.pendingProps),d=Nn(l.type,d),pf(e,n,l,d,i);case 15:return mf(e,n,n.type,n.pendingProps,i);case 17:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:Nn(l,d),ll(e,n),n.tag=1,Lt(l)?(e=!0,Bs(n)):e=!1,Ko(n,i),sf(n,l,d),lc(n,l,d,i),dc(null,n,l,!0,e,i);case 19:return Ef(e,n,i);case 22:return gf(e,n,i)}throw Error(o(156,n.tag))};function Xf(e,n){return Io(e,n)}function Xy(e,n,i,l){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hn(e,n,i,l){return new Xy(e,n,i,l)}function Ic(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gy(e){if(typeof e=="function")return Ic(e)?1:0;if(e!=null){if(e=e.$$typeof,e===X)return 11;if(e===K)return 14}return 2}function Lr(e,n){var i=e.alternate;return i===null?(i=hn(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function vl(e,n,i,l,d,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 H:return go(i.children,d,p,n);case q:w=8,d|=8;break;case J:return e=hn(12,i,n,d|2),e.elementType=J,e.lanes=p,e;case re:return e=hn(13,i,n,d),e.elementType=re,e.lanes=p,e;case b:return e=hn(19,i,n,d),e.elementType=b,e.lanes=p,e;case G:return xl(i,d,p,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ee:w=10;break e;case U:w=9;break e;case X:w=11;break e;case K:w=14;break e;case V:w=16,l=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return n=hn(w,i,n,d),n.elementType=e,n.type=l,n.lanes=p,n}function go(e,n,i,l){return e=hn(7,e,l,n),e.lanes=i,e}function xl(e,n,i,l){return e=hn(22,e,l,n),e.elementType=G,e.lanes=i,e.stateNode={isHidden:!1},e}function Tc(e,n,i){return e=hn(6,e,null,n),e.lanes=i,e}function zc(e,n,i){return n=hn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Ky(e,n,i,l,d){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=Sr(0),this.expirationTimes=Sr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sr(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Rc(e,n,i,l,d,p,w,T,L){return e=new Ky(e,n,i,T,L),n===1?(n=1,p===!0&&(n|=8)):n=0,p=hn(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xa(p),e}function Qy(e,n,i){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:l==null?null:""+l,children:e,containerInfo:n,implementation:i}}function Gf(e){if(!e)return jr;e=e._reactInternals;e:{if(Wt(e)!==e||e.tag!==1)throw Error(o(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Lt(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(o(171))}if(e.tag===1){var i=e.type;if(Lt(i))return Sd(e,i,n)}return n}function Kf(e,n,i,l,d,p,w,T,L){return e=Rc(i,l,!0,e,d,p,w,T,L),e.context=Gf(null),i=e.current,l=Mt(),d=Rr(i),p=lr(l,d),p.callback=n??null,Mr(i,p,d),e.current.lanes=d,$n(e,d,l),Ot(e,l),e}function wl(e,n,i,l){var d=n.current,p=Mt(),w=Rr(d);return i=Gf(i),n.context===null?n.context=i:n.pendingContext=i,n=lr(p,w),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=Mr(d,n,w),e!==null&&(jn(e,d,w,p),qs(e,d,w)),w}function Sl(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 i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function Ac(e,n){Qf(e,n),(e=e.alternate)&&Qf(e,n)}function qy(){return null}var qf=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lc(e){this._internalRoot=e}kl.prototype.render=Lc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(o(409));wl(e,n,null,null)},kl.prototype.unmount=Lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;ho(function(){wl(null,e,null,null)}),n[nr]=null}};function kl(e){this._internalRoot=e}kl.prototype.unstable_scheduleHydration=function(e){if(e){var n=js();e={blockedOn:null,target:e,priority:n};for(var i=0;i<ln.length&&n!==0&&n<ln[i].priority;i++);ln.splice(i,0,e),i===0&&W(e)}};function Dc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function El(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Zf(){}function Zy(e,n,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var Z=Sl(w);p.call(Z)}}var w=Kf(n,l,e,0,null,!1,!1,"",Zf);return e._reactRootContainer=w,e[nr]=w.current,Li(e.nodeType===8?e.parentNode:e),ho(),w}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var T=l;l=function(){var Z=Sl(L);T.call(Z)}}var L=Rc(e,0,!1,null,null,!1,!1,"",Zf);return e._reactRootContainer=L,e[nr]=L.current,Li(e.nodeType===8?e.parentNode:e),ho(function(){wl(n,L,i,l)}),L}function Nl(e,n,i,l,d){var p=i._reactRootContainer;if(p){var w=p;if(typeof d=="function"){var T=d;d=function(){var L=Sl(w);T.call(L)}}wl(n,w,e,d)}else w=Zy(i,n,e,d,l);return Sl(w)}_s=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var i=Rt(n.pendingLanes);i!==0&&(to(n,i|1),Ot(n,Ye()),(Oe&6)===0&&(ei=Ye()+500,br()))}break;case 13:ho(function(){var l=sr(e,1);if(l!==null){var d=Mt();jn(l,e,1,d)}}),Ac(e,1)}},Ni=function(e){if(e.tag===13){var n=sr(e,134217728);if(n!==null){var i=Mt();jn(n,e,134217728,i)}Ac(e,134217728)}},kr=function(e){if(e.tag===13){var n=Rr(e),i=sr(e,n);if(i!==null){var l=Mt();jn(i,e,n,l)}Ac(e,n)}},js=function(){return Ve},bs=function(e,n){var i=Ve;try{return Ve=e,n()}finally{Ve=i}},Xr=function(e,n,i){switch(n){case"input":if(Ue(e,i),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<i.length;n++){var l=i[n];if(l!==e&&l.form===e.form){var d=Hs(l);if(!d)throw Error(o(90));je(l),Ue(l,d)}}}break;case"textarea":xt(e,i);break;case"select":n=i.value,n!=null&&pt(e,!!i.multiple,n,!1)}},Gr=bc,ut=ho;var Jy={usingClientEntryPoint:!1,Events:[Oi,Ho,Hs,jo,jt,bc]},Ji={findFiberByHostInstance:oo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},e0={bundleType:Ji.bundleType,version:Ji.version,rendererPackageName:Ji.rendererPackageName,rendererConfig:Ji.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=Po(e),e===null?null:e.stateNode},findFiberByHostInstance:Ji.findFiberByHostInstance||qy,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 Cl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cl.isDisabled&&Cl.supportsFiber)try{Be=Cl.inject(e0),zt=Cl}catch{}}return Ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jy,Ft.createPortal=function(e,n){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dc(n))throw Error(o(200));return Qy(e,n,null,i)},Ft.createRoot=function(e,n){if(!Dc(e))throw Error(o(299));var i=!1,l="",d=qf;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(d=n.onRecoverableError)),n=Rc(e,1,!1,null,null,i,!1,l,d),e[nr]=n.current,Li(e.nodeType===8?e.parentNode:e),new Lc(n)},Ft.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(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=Po(n),e=e===null?null:e.stateNode,e},Ft.flushSync=function(e){return ho(e)},Ft.hydrate=function(e,n,i){if(!El(n))throw Error(o(200));return Nl(null,e,n,!0,i)},Ft.hydrateRoot=function(e,n,i){if(!Dc(e))throw Error(o(405));var l=i!=null&&i.hydratedSources||null,d=!1,p="",w=qf;if(i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),n=Kf(n,null,e,1,i??null,d,!1,p,w),e[nr]=n.current,Li(e),l)for(e=0;e<l.length;e++)i=l[e],d=i._getVersion,d=d(i._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[i,d]:n.mutableSourceEagerHydrationData.push(i,d);return new kl(n)},Ft.render=function(e,n,i){if(!El(n))throw Error(o(200));return Nl(null,e,n,!1,i)},Ft.unmountComponentAtNode=function(e){if(!El(e))throw Error(o(40));return e._reactRootContainer?(ho(function(){Nl(null,null,e,!1,function(){e._reactRootContainer=null,e[nr]=null})}),!0):!1},Ft.unstable_batchedUpdates=bc,Ft.unstable_renderSubtreeIntoContainer=function(e,n,i,l){if(!El(i))throw Error(o(200));if(e==null||e._reactInternals===void 0)throw Error(o(38));return Nl(e,n,i,!1,l)},Ft.version="18.3.1-next-f1338f8080-20240426",Ft}var sh;function Cp(){if(sh)return Fc.exports;sh=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(),Fc.exports=l0(),Fc.exports}var lh;function a0(){if(lh)return _l;lh=1;var t=Cp();return _l.createRoot=t.createRoot,_l.hydrateRoot=t.hydrateRoot,_l}var c0=a0();const u0=vu(c0);function ct(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let o=0,s;o<t.length;o++)(s=ct(t[o]))!==""&&(r+=(r&&" ")+s);else for(let o in t)t[o]&&(r+=(r&&" ")+o);return r}var d0={value:()=>{}};function ea(){for(var t=0,r=arguments.length,o={},s;t<r;++t){if(!(s=arguments[t]+"")||s in o||/[\s.]/.test(s))throw new Error("illegal type: "+s);o[s]=[]}return new Dl(o)}function Dl(t){this._=t}function f0(t,r){return t.trim().split(/^|\s+/).map(function(o){var s="",a=o.indexOf(".");if(a>=0&&(s=o.slice(a+1),o=o.slice(0,a)),o&&!r.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:s}})}Dl.prototype=ea.prototype={constructor:Dl,on:function(t,r){var o=this._,s=f0(t+"",o),a,c=-1,u=s.length;if(arguments.length<2){for(;++c<u;)if((a=(t=s[c]).type)&&(a=h0(o[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)o[a]=ah(o[a],t.name,r);else if(r==null)for(a in o)o[a]=ah(o[a],t.name,null);return this},copy:function(){var t={},r=this._;for(var o in r)t[o]=r[o].slice();return new Dl(t)},call:function(t,r){if((a=arguments.length-2)>0)for(var o=new Array(a),s=0,a,c;s<a;++s)o[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,o)},apply:function(t,r,o){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,o)}};function h0(t,r){for(var o=0,s=t.length,a;o<s;++o)if((a=t[o]).name===r)return a.value}function ah(t,r,o){for(var s=0,a=t.length;s<a;++s)if(t[s].name===r){t[s]=d0,t=t.slice(0,s).concat(t.slice(s+1));break}return o!=null&&t.push({name:r,value:o}),t}var ru="http://www.w3.org/1999/xhtml";const ch={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 ta(t){var r=t+="",o=r.indexOf(":");return o>=0&&(r=t.slice(0,o))!=="xmlns"&&(t=t.slice(o+1)),ch.hasOwnProperty(r)?{space:ch[r],local:t}:t}function p0(t){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===ru&&r.documentElement.namespaceURI===ru?r.createElement(t):r.createElementNS(o,t)}}function m0(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function _p(t){var r=ta(t);return(r.local?m0:p0)(r)}function g0(){}function xu(t){return t==null?g0:function(){return this.querySelector(t)}}function y0(t){typeof t!="function"&&(t=xu(t));for(var r=this._groups,o=r.length,s=new Array(o),a=0;a<o;++a)for(var c=r[a],u=c.length,h=s[a]=new Array(u),m,g,v=0;v<u;++v)(m=c[v])&&(g=t.call(m,m.__data__,v,c))&&("__data__"in m&&(g.__data__=m.__data__),h[v]=g);return new Jt(s,this._parents)}function v0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function x0(){return[]}function jp(t){return t==null?x0:function(){return this.querySelectorAll(t)}}function w0(t){return function(){return v0(t.apply(this,arguments))}}function S0(t){typeof t=="function"?t=w0(t):t=jp(t);for(var r=this._groups,o=r.length,s=[],a=[],c=0;c<o;++c)for(var u=r[c],h=u.length,m,g=0;g<h;++g)(m=u[g])&&(s.push(t.call(m,m.__data__,g,u)),a.push(m));return new Jt(s,a)}function bp(t){return function(){return this.matches(t)}}function Pp(t){return function(r){return r.matches(t)}}var k0=Array.prototype.find;function E0(t){return function(){return k0.call(this.children,t)}}function N0(){return this.firstElementChild}function C0(t){return this.select(t==null?N0:E0(typeof t=="function"?t:Pp(t)))}var _0=Array.prototype.filter;function j0(){return Array.from(this.children)}function b0(t){return function(){return _0.call(this.children,t)}}function P0(t){return this.selectAll(t==null?j0:b0(typeof t=="function"?t:Pp(t)))}function M0(t){typeof t!="function"&&(t=bp(t));for(var r=this._groups,o=r.length,s=new Array(o),a=0;a<o;++a)for(var c=r[a],u=c.length,h=s[a]=[],m,g=0;g<u;++g)(m=c[g])&&t.call(m,m.__data__,g,c)&&h.push(m);return new Jt(s,this._parents)}function Mp(t){return new Array(t.length)}function I0(){return new Jt(this._enter||this._groups.map(Mp),this._parents)}function Vl(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}Vl.prototype={constructor:Vl,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 T0(t){return function(){return t}}function z0(t,r,o,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):o[u]=new Vl(t,c[u]);for(;u<m;++u)(h=r[u])&&(a[u]=h)}function R0(t,r,o,s,a,c,u){var h,m,g=new Map,v=r.length,y=c.length,x=new Array(v),_;for(h=0;h<v;++h)(m=r[h])&&(x[h]=_=u.call(m,m.__data__,h,r)+"",g.has(_)?a[h]=m:g.set(_,m));for(h=0;h<y;++h)_=u.call(t,c[h],h,c)+"",(m=g.get(_))?(s[h]=m,m.__data__=c[h],g.delete(_)):o[h]=new Vl(t,c[h]);for(h=0;h<v;++h)(m=r[h])&&g.get(x[h])===m&&(a[h]=m)}function A0(t){return t.__data__}function L0(t,r){if(!arguments.length)return Array.from(this,A0);var o=r?R0:z0,s=this._parents,a=this._groups;typeof t!="function"&&(t=T0(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,_=D0(t.call(v,v&&v.__data__,g,s)),E=_.length,N=h[g]=new Array(E),k=u[g]=new Array(E),S=m[g]=new Array(x);o(v,y,N,k,S,_,r);for(var I=0,C=0,j,O;I<E;++I)if(j=N[I]){for(I>=C&&(C=I+1);!(O=k[C])&&++C<E;);j._next=O||null}}return u=new Jt(u,s),u._enter=h,u._exit=m,u}function D0(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function $0(){return new Jt(this._exit||this._groups.map(Mp),this._parents)}function O0(t,r,o){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())),o==null?c.remove():o(c),s&&a?s.merge(a).order():a}function F0(t){for(var r=t.selection?t.selection():t,o=this._groups,s=r._groups,a=o.length,c=s.length,u=Math.min(a,c),h=new Array(a),m=0;m<u;++m)for(var g=o[m],v=s[m],y=g.length,x=h[m]=new Array(y),_,E=0;E<y;++E)(_=g[E]||v[E])&&(x[E]=_);for(;m<a;++m)h[m]=o[m];return new Jt(h,this._parents)}function H0(){for(var t=this._groups,r=-1,o=t.length;++r<o;)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 V0(t){t||(t=B0);function r(y,x){return y&&x?t(y.__data__,x.__data__):!y-!x}for(var o=this._groups,s=o.length,a=new Array(s),c=0;c<s;++c){for(var u=o[c],h=u.length,m=a[c]=new Array(h),g,v=0;v<h;++v)(g=u[v])&&(m[v]=g);m.sort(r)}return new Jt(a,this._parents).order()}function B0(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function W0(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function U0(){return Array.from(this)}function Y0(){for(var t=this._groups,r=0,o=t.length;r<o;++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 X0(){let t=0;for(const r of this)++t;return t}function G0(){return!this.node()}function K0(t){for(var r=this._groups,o=0,s=r.length;o<s;++o)for(var a=r[o],c=0,u=a.length,h;c<u;++c)(h=a[c])&&t.call(h,h.__data__,c,a);return this}function Q0(t){return function(){this.removeAttribute(t)}}function q0(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Z0(t,r){return function(){this.setAttribute(t,r)}}function J0(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function ev(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(t):this.setAttribute(t,o)}}function tv(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,o)}}function nv(t,r){var o=ta(t);if(arguments.length<2){var s=this.node();return o.local?s.getAttributeNS(o.space,o.local):s.getAttribute(o)}return this.each((r==null?o.local?q0:Q0:typeof r=="function"?o.local?tv:ev:o.local?J0:Z0)(o,r))}function Ip(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function rv(t){return function(){this.style.removeProperty(t)}}function ov(t,r,o){return function(){this.style.setProperty(t,r,o)}}function iv(t,r,o){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,o)}}function sv(t,r,o){return arguments.length>1?this.each((r==null?rv:typeof r=="function"?iv:ov)(t,r,o??"")):ui(this.node(),t)}function ui(t,r){return t.style.getPropertyValue(r)||Ip(t).getComputedStyle(t,null).getPropertyValue(r)}function lv(t){return function(){delete this[t]}}function av(t,r){return function(){this[t]=r}}function cv(t,r){return function(){var o=r.apply(this,arguments);o==null?delete this[t]:this[t]=o}}function uv(t,r){return arguments.length>1?this.each((r==null?lv:typeof r=="function"?cv:av)(t,r)):this.node()[t]}function Tp(t){return t.trim().split(/^|\s+/)}function wu(t){return t.classList||new zp(t)}function zp(t){this._node=t,this._names=Tp(t.getAttribute("class")||"")}zp.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 Rp(t,r){for(var o=wu(t),s=-1,a=r.length;++s<a;)o.add(r[s])}function Ap(t,r){for(var o=wu(t),s=-1,a=r.length;++s<a;)o.remove(r[s])}function dv(t){return function(){Rp(this,t)}}function fv(t){return function(){Ap(this,t)}}function hv(t,r){return function(){(r.apply(this,arguments)?Rp:Ap)(this,t)}}function pv(t,r){var o=Tp(t+"");if(arguments.length<2){for(var s=wu(this.node()),a=-1,c=o.length;++a<c;)if(!s.contains(o[a]))return!1;return!0}return this.each((typeof r=="function"?hv:r?dv:fv)(o,r))}function mv(){this.textContent=""}function gv(t){return function(){this.textContent=t}}function yv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function vv(t){return arguments.length?this.each(t==null?mv:(typeof t=="function"?yv:gv)(t)):this.node().textContent}function xv(){this.innerHTML=""}function wv(t){return function(){this.innerHTML=t}}function Sv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function kv(t){return arguments.length?this.each(t==null?xv:(typeof t=="function"?Sv:wv)(t)):this.node().innerHTML}function Ev(){this.nextSibling&&this.parentNode.appendChild(this)}function Nv(){return this.each(Ev)}function Cv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function _v(){return this.each(Cv)}function jv(t){var r=typeof t=="function"?t:_p(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function bv(){return null}function Pv(t,r){var o=typeof t=="function"?t:_p(t),s=r==null?bv:typeof r=="function"?r:xu(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),s.apply(this,arguments)||null)})}function Mv(){var t=this.parentNode;t&&t.removeChild(this)}function Iv(){return this.each(Mv)}function Tv(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function zv(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Rv(t){return this.select(t?zv:Tv)}function Av(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Lv(t){return function(r){t.call(this,r,this.__data__)}}function Dv(t){return t.trim().split(/^|\s+/).map(function(r){var o="",s=r.indexOf(".");return s>=0&&(o=r.slice(s+1),r=r.slice(0,s)),{type:r,name:o}})}function $v(t){return function(){var r=this.__on;if(r){for(var o=0,s=-1,a=r.length,c;o<a;++o)c=r[o],(!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 Ov(t,r,o){return function(){var s=this.__on,a,c=Lv(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=o),a.value=r;return}}this.addEventListener(t.type,c,o),a={type:t.type,name:t.name,value:r,listener:c,options:o},s?s.push(a):this.__on=[a]}}function Fv(t,r,o){var s=Dv(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?Ov:$v,a=0;a<c;++a)this.each(h(s[a],r,o));return this}function Lp(t,r,o){var s=Ip(t),a=s.CustomEvent;typeof a=="function"?a=new a(r,o):(a=s.document.createEvent("Event"),o?(a.initEvent(r,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(r,!1,!1)),t.dispatchEvent(a)}function Hv(t,r){return function(){return Lp(this,t,r)}}function Vv(t,r){return function(){return Lp(this,t,r.apply(this,arguments))}}function Bv(t,r){return this.each((typeof r=="function"?Vv:Hv)(t,r))}function*Wv(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var s=t[r],a=0,c=s.length,u;a<c;++a)(u=s[a])&&(yield u)}var Dp=[null];function Jt(t,r){this._groups=t,this._parents=r}function vs(){return new Jt([[document.documentElement]],Dp)}function Uv(){return this}Jt.prototype=vs.prototype={constructor:Jt,select:y0,selectAll:S0,selectChild:C0,selectChildren:P0,filter:M0,data:L0,enter:I0,exit:$0,join:O0,merge:F0,selection:Uv,order:H0,sort:V0,call:W0,nodes:U0,node:Y0,size:X0,empty:G0,each:K0,attr:nv,style:sv,property:uv,classed:pv,text:vv,html:kv,raise:Nv,lower:_v,append:jv,insert:Pv,remove:Iv,clone:Rv,datum:Av,on:Fv,dispatch:Bv,[Symbol.iterator]:Wv};function Zt(t){return typeof t=="string"?new Jt([[document.querySelector(t)]],[document.documentElement]):new Jt([[t]],Dp)}function Yv(t){let r;for(;r=t.sourceEvent;)t=r;return t}function bn(t,r){if(t=Yv(t),r===void 0&&(r=t.currentTarget),r){var o=r.ownerSVGElement||r;if(o.createSVGPoint){var s=o.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 Xv={passive:!1},ls={capture:!0,passive:!1};function Bc(t){t.stopImmediatePropagation()}function ai(t){t.preventDefault(),t.stopImmediatePropagation()}function $p(t){var r=t.document.documentElement,o=Zt(t).on("dragstart.drag",ai,ls);"onselectstart"in r?o.on("selectstart.drag",ai,ls):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Op(t,r){var o=t.document.documentElement,s=Zt(t).on("dragstart.drag",null);r&&(s.on("click.drag",ai,ls),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in o?s.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const jl=t=>()=>t;function ou(t,{sourceEvent:r,subject:o,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:o,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}})}ou.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Gv(t){return!t.ctrlKey&&!t.button}function Kv(){return this.parentNode}function Qv(t,r){return r??{x:t.x,y:t.y}}function qv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fp(){var t=Gv,r=Kv,o=Qv,s=qv,a={},c=ea("start","drag","end"),u=0,h,m,g,v,y=0;function x(j){j.on("mousedown.drag",_).filter(s).on("touchstart.drag",k).on("touchmove.drag",S,Xv).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(j,O){if(!(v||!t.call(this,j,O))){var A=C(this,r.call(this,j,O),j,O,"mouse");A&&(Zt(j.view).on("mousemove.drag",E,ls).on("mouseup.drag",N,ls),$p(j.view),Bc(j),g=!1,h=j.clientX,m=j.clientY,A("start",j))}}function E(j){if(ai(j),!g){var O=j.clientX-h,A=j.clientY-m;g=O*O+A*A>y}a.mouse("drag",j)}function N(j){Zt(j.view).on("mousemove.drag mouseup.drag",null),Op(j.view,g),ai(j),a.mouse("end",j)}function k(j,O){if(t.call(this,j,O)){var A=j.changedTouches,H=r.call(this,j,O),q=A.length,J,ee;for(J=0;J<q;++J)(ee=C(this,H,j,O,A[J].identifier,A[J]))&&(Bc(j),ee("start",j,A[J]))}}function S(j){var O=j.changedTouches,A=O.length,H,q;for(H=0;H<A;++H)(q=a[O[H].identifier])&&(ai(j),q("drag",j,O[H]))}function I(j){var O=j.changedTouches,A=O.length,H,q;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),H=0;H<A;++H)(q=a[O[H].identifier])&&(Bc(j),q("end",j,O[H]))}function C(j,O,A,H,q,J){var ee=c.copy(),U=bn(J||A,O),X,re,b;if((b=o.call(j,new ou("beforestart",{sourceEvent:A,target:x,identifier:q,active:u,x:U[0],y:U[1],dx:0,dy:0,dispatch:ee}),H))!=null)return X=b.x-U[0]||0,re=b.y-U[1]||0,function K(V,G,z){var R=U,B;switch(V){case"start":a[q]=K,B=u++;break;case"end":delete a[q],--u;case"drag":U=bn(z||G,O),B=u;break}ee.call(V,j,new ou(V,{sourceEvent:G,subject:b,target:x,identifier:q,active:B,x:U[0]+X,y:U[1]+re,dx:U[0]-R[0],dy:U[1]-R[1],dispatch:ee}),H)}}return x.filter=function(j){return arguments.length?(t=typeof j=="function"?j:jl(!!j),x):t},x.container=function(j){return arguments.length?(r=typeof j=="function"?j:jl(j),x):r},x.subject=function(j){return arguments.length?(o=typeof j=="function"?j:jl(j),x):o},x.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:jl(!!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,o){t.prototype=r.prototype=o,o.constructor=t}function Hp(t,r){var o=Object.create(t.prototype);for(var s in r)o[s]=r[s];return o}function xs(){}var as=.7,Bl=1/as,ci="\\s*([+-]?\\d+)\\s*",cs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Zv=/^#([0-9a-f]{3,8})$/,Jv=new RegExp(`^rgb\\(${ci},${ci},${ci}\\)$`),ex=new RegExp(`^rgb\\(${Xn},${Xn},${Xn}\\)$`),tx=new RegExp(`^rgba\\(${ci},${ci},${ci},${cs}\\)$`),nx=new RegExp(`^rgba\\(${Xn},${Xn},${Xn},${cs}\\)$`),rx=new RegExp(`^hsl\\(${cs},${Xn},${Xn}\\)$`),ox=new RegExp(`^hsla\\(${cs},${Xn},${Xn},${cs}\\)$`),uh={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,So,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:dh,formatHex:dh,formatHex8:ix,formatHsl:sx,formatRgb:fh,toString:fh});function dh(){return this.rgb().formatHex()}function ix(){return this.rgb().formatHex8()}function sx(){return Vp(this).formatHsl()}function fh(){return this.rgb().formatRgb()}function So(t){var r,o;return t=(t+"").trim().toLowerCase(),(r=Zv.exec(t))?(o=r[1].length,r=parseInt(r[1],16),o===6?hh(r):o===3?new Ht(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?bl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?bl(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=Jv.exec(t))?new Ht(r[1],r[2],r[3],1):(r=ex.exec(t))?new Ht(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=tx.exec(t))?bl(r[1],r[2],r[3],r[4]):(r=nx.exec(t))?bl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=rx.exec(t))?gh(r[1],r[2]/100,r[3]/100,1):(r=ox.exec(t))?gh(r[1],r[2]/100,r[3]/100,r[4]):uh.hasOwnProperty(t)?hh(uh[t]):t==="transparent"?new Ht(NaN,NaN,NaN,0):null}function hh(t){return new Ht(t>>16&255,t>>8&255,t&255,1)}function bl(t,r,o,s){return s<=0&&(t=r=o=NaN),new Ht(t,r,o,s)}function lx(t){return t instanceof xs||(t=So(t)),t?(t=t.rgb(),new Ht(t.r,t.g,t.b,t.opacity)):new Ht}function iu(t,r,o,s){return arguments.length===1?lx(t):new Ht(t,r,o,s??1)}function Ht(t,r,o,s){this.r=+t,this.g=+r,this.b=+o,this.opacity=+s}Su(Ht,iu,Hp(xs,{brighter(t){return t=t==null?Bl:Math.pow(Bl,t),new Ht(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?as:Math.pow(as,t),new Ht(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ht(xo(this.r),xo(this.g),xo(this.b),Wl(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:ph,formatHex:ph,formatHex8:ax,formatRgb:mh,toString:mh}));function ph(){return`#${vo(this.r)}${vo(this.g)}${vo(this.b)}`}function ax(){return`#${vo(this.r)}${vo(this.g)}${vo(this.b)}${vo((isNaN(this.opacity)?1:this.opacity)*255)}`}function mh(){const t=Wl(this.opacity);return`${t===1?"rgb(":"rgba("}${xo(this.r)}, ${xo(this.g)}, ${xo(this.b)}${t===1?")":`, ${t})`}`}function Wl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function xo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vo(t){return t=xo(t),(t<16?"0":"")+t.toString(16)}function gh(t,r,o,s){return s<=0?t=r=o=NaN:o<=0||o>=1?t=r=NaN:r<=0&&(t=NaN),new Pn(t,r,o,s)}function Vp(t){if(t instanceof Pn)return new Pn(t.h,t.s,t.l,t.opacity);if(t instanceof xs||(t=So(t)),!t)return new Pn;if(t instanceof Pn)return t;t=t.rgb();var r=t.r/255,o=t.g/255,s=t.b/255,a=Math.min(r,o,s),c=Math.max(r,o,s),u=NaN,h=c-a,m=(c+a)/2;return h?(r===c?u=(o-s)/h+(o<s)*6:o===c?u=(s-r)/h+2:u=(r-o)/h+4,h/=m<.5?c+a:2-c-a,u*=60):h=m>0&&m<1?0:u,new Pn(u,h,m,t.opacity)}function cx(t,r,o,s){return arguments.length===1?Vp(t):new Pn(t,r,o,s??1)}function Pn(t,r,o,s){this.h=+t,this.s=+r,this.l=+o,this.opacity=+s}Su(Pn,cx,Hp(xs,{brighter(t){return t=t==null?Bl:Math.pow(Bl,t),new Pn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?as:Math.pow(as,t),new Pn(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,o=this.l,s=o+(o<.5?o:1-o)*r,a=2*o-s;return new Ht(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 Pn(yh(this.h),Pl(this.s),Pl(this.l),Wl(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=Wl(this.opacity);return`${t===1?"hsl(":"hsla("}${yh(this.h)}, ${Pl(this.s)*100}%, ${Pl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function yh(t){return t=(t||0)%360,t<0?t+360:t}function Pl(t){return Math.max(0,Math.min(1,t||0))}function Wc(t,r,o){return(t<60?r+(o-r)*t/60:t<180?o:t<240?r+(o-r)*(240-t)/60:r)*255}const ku=t=>()=>t;function ux(t,r){return function(o){return t+o*r}}function dx(t,r,o){return t=Math.pow(t,o),r=Math.pow(r,o)-t,o=1/o,function(s){return Math.pow(t+s*r,o)}}function fx(t){return(t=+t)==1?Bp:function(r,o){return o-r?dx(r,o,t):ku(isNaN(r)?o:r)}}function Bp(t,r){var o=r-t;return o?ux(t,o):ku(isNaN(t)?r:t)}const Ul=(function t(r){var o=fx(r);function s(a,c){var u=o((a=iu(a)).r,(c=iu(c)).r),h=o(a.g,c.g),m=o(a.b,c.b),g=Bp(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 hx(t,r){r||(r=[]);var o=t?Math.min(r.length,t.length):0,s=r.slice(),a;return function(c){for(a=0;a<o;++a)s[a]=t[a]*(1-c)+r[a]*c;return s}}function px(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function mx(t,r){var o=r?r.length:0,s=t?Math.min(o,t.length):0,a=new Array(s),c=new Array(o),u;for(u=0;u<s;++u)a[u]=is(t[u],r[u]);for(;u<o;++u)c[u]=r[u];return function(h){for(u=0;u<s;++u)c[u]=a[u](h);return c}}function gx(t,r){var o=new Date;return t=+t,r=+r,function(s){return o.setTime(t*(1-s)+r*s),o}}function Yn(t,r){return t=+t,r=+r,function(o){return t*(1-o)+r*o}}function yx(t,r){var o={},s={},a;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(a in r)a in t?o[a]=is(t[a],r[a]):s[a]=r[a];return function(c){for(a in o)s[a]=o[a](c);return s}}var su=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Uc=new RegExp(su.source,"g");function vx(t){return function(){return t}}function xx(t){return function(r){return t(r)+""}}function Wp(t,r){var o=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)>o&&(c=r.slice(o,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:Yn(s,a)})),o=Uc.lastIndex;return o<r.length&&(c=r.slice(o),h[u]?h[u]+=c:h[++u]=c),h.length<2?m[0]?xx(m[0].x):vx(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 is(t,r){var o=typeof r,s;return r==null||o==="boolean"?ku(r):(o==="number"?Yn:o==="string"?(s=So(r))?(r=s,Ul):Wp:r instanceof So?Ul:r instanceof Date?gx:px(r)?hx:Array.isArray(r)?mx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?yx:Yn)(t,r)}var vh=180/Math.PI,lu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Up(t,r,o,s,a,c){var u,h,m;return(u=Math.sqrt(t*t+r*r))&&(t/=u,r/=u),(m=t*o+r*s)&&(o-=t*m,s-=r*m),(h=Math.sqrt(o*o+s*s))&&(o/=h,s/=h,m/=h),t*s<r*o&&(t=-t,r=-r,m=-m,u=-u),{translateX:a,translateY:c,rotate:Math.atan2(r,t)*vh,skewX:Math.atan(m)*vh,scaleX:u,scaleY:h}}var Ml;function wx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?lu:Up(r.a,r.b,r.c,r.d,r.e,r.f)}function Sx(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,Up(t.a,t.b,t.c,t.d,t.e,t.f))}function Yp(t,r,o,s){function a(g){return g.length?g.pop()+" ":""}function c(g,v,y,x,_,E){if(g!==y||v!==x){var N=_.push("translate(",null,r,null,o);E.push({i:N-4,x:Yn(g,y)},{i:N-2,x:Yn(v,x)})}else(y||x)&&_.push("translate("+y+r+x+o)}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:Yn(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:Yn(g,v)}):v&&y.push(a(y)+"skewX("+v+s)}function m(g,v,y,x,_,E){if(g!==y||v!==x){var N=_.push(a(_)+"scale(",null,",",null,")");E.push({i:N-4,x:Yn(g,y)},{i:N-2,x:Yn(v,x)})}else(y!==1||x!==1)&&_.push(a(_)+"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(_){for(var E=-1,N=x.length,k;++E<N;)y[(k=x[E]).i]=k.x(_);return y.join("")}}}var kx=Yp(wx,"px, ","px)","deg)"),Ex=Yp(Sx,", ",")",")"),Nx=1e-12;function xh(t){return((t=Math.exp(t))+1/t)/2}function Cx(t){return((t=Math.exp(t))-1/t)/2}function _x(t){return((t=Math.exp(2*t))-1)/(t+1)}const $l=(function t(r,o,s){function a(c,u){var h=c[0],m=c[1],g=c[2],v=u[0],y=u[1],x=u[2],_=v-h,E=y-m,N=_*_+E*E,k,S;if(N<Nx)S=Math.log(x/g)/r,k=function(H){return[h+H*_,m+H*E,g*Math.exp(r*H*S)]};else{var I=Math.sqrt(N),C=(x*x-g*g+s*N)/(2*g*o*I),j=(x*x-g*g-s*N)/(2*x*o*I),O=Math.log(Math.sqrt(C*C+1)-C),A=Math.log(Math.sqrt(j*j+1)-j);S=(A-O)/r,k=function(H){var q=H*S,J=xh(O),ee=g/(o*I)*(J*_x(r*q+O)-Cx(O));return[h+ee*_,m+ee*E,g*J/xh(r*q+O)]}}return k.duration=S*1e3*r/Math.SQRT2,k}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 di=0,rs=0,ts=0,Xp=1e3,Yl,os,Xl=0,ko=0,na=0,us=typeof performance=="object"&&performance.now?performance:Date,Gp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Eu(){return ko||(Gp(jx),ko=us.now()+na)}function jx(){ko=0}function Gl(){this._call=this._time=this._next=null}Gl.prototype=Kp.prototype={constructor:Gl,restart:function(t,r,o){if(typeof t!="function")throw new TypeError("callback is not a function");o=(o==null?Eu():+o)+(r==null?0:+r),!this._next&&os!==this&&(os?os._next=this:Yl=this,os=this),this._call=t,this._time=o,au()},stop:function(){this._call&&(this._call=null,this._time=1/0,au())}};function Kp(t,r,o){var s=new Gl;return s.restart(t,r,o),s}function bx(){Eu(),++di;for(var t=Yl,r;t;)(r=ko-t._time)>=0&&t._call.call(void 0,r),t=t._next;--di}function wh(){ko=(Xl=us.now())+na,di=rs=0;try{bx()}finally{di=0,Mx(),ko=0}}function Px(){var t=us.now(),r=t-Xl;r>Xp&&(na-=r,Xl=t)}function Mx(){for(var t,r=Yl,o,s=1/0;r;)r._call?(s>r._time&&(s=r._time),t=r,r=r._next):(o=r._next,r._next=null,r=t?t._next=o:Yl=o);os=t,au(s)}function au(t){if(!di){rs&&(rs=clearTimeout(rs));var r=t-ko;r>24?(t<1/0&&(rs=setTimeout(wh,t-us.now()-na)),ts&&(ts=clearInterval(ts))):(ts||(Xl=us.now(),ts=setInterval(Px,Xp)),di=1,Gp(wh))}}function Sh(t,r,o){var s=new Gl;return r=r==null?0:+r,s.restart(a=>{s.stop(),t(a+r)},r,o),s}var Ix=ea("start","end","cancel","interrupt"),Tx=[],Qp=0,kh=1,cu=2,Ol=3,Eh=4,uu=5,Fl=6;function ra(t,r,o,s,a,c){var u=t.__transition;if(!u)t.__transition={};else if(o in u)return;zx(t,o,{name:r,index:s,group:a,on:Ix,tween:Tx,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Qp})}function Nu(t,r){var o=Tn(t,r);if(o.state>Qp)throw new Error("too late; already scheduled");return o}function Qn(t,r){var o=Tn(t,r);if(o.state>Ol)throw new Error("too late; already running");return o}function Tn(t,r){var o=t.__transition;if(!o||!(o=o[r]))throw new Error("transition not found");return o}function zx(t,r,o){var s=t.__transition,a;s[r]=o,o.timer=Kp(c,0,o.time);function c(g){o.state=kh,o.timer.restart(u,o.delay,o.time),o.delay<=g&&u(g-o.delay)}function u(g){var v,y,x,_;if(o.state!==kh)return m();for(v in s)if(_=s[v],_.name===o.name){if(_.state===Ol)return Sh(u);_.state===Eh?(_.state=Fl,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete s[v]):+v<r&&(_.state=Fl,_.timer.stop(),_.on.call("cancel",t,t.__data__,_.index,_.group),delete s[v])}if(Sh(function(){o.state===Ol&&(o.state=Eh,o.timer.restart(h,o.delay,o.time),h(g))}),o.state=cu,o.on.call("start",t,t.__data__,o.index,o.group),o.state===cu){for(o.state=Ol,a=new Array(x=o.tween.length),v=0,y=-1;v<x;++v)(_=o.tween[v].value.call(t,t.__data__,o.index,o.group))&&(a[++y]=_);a.length=y+1}}function h(g){for(var v=g<o.duration?o.ease.call(null,g/o.duration):(o.timer.restart(m),o.state=uu,1),y=-1,x=a.length;++y<x;)a[y].call(t,v);o.state===uu&&(o.on.call("end",t,t.__data__,o.index,o.group),m())}function m(){o.state=Fl,o.timer.stop(),delete s[r];for(var g in s)return;delete t.__transition}}function Hl(t,r){var o=t.__transition,s,a,c=!0,u;if(o){r=r==null?null:r+"";for(u in o){if((s=o[u]).name!==r){c=!1;continue}a=s.state>cu&&s.state<uu,s.state=Fl,s.timer.stop(),s.on.call(a?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete o[u]}c&&delete t.__transition}}function Rx(t){return this.each(function(){Hl(this,t)})}function Ax(t,r){var o,s;return function(){var a=Qn(this,t),c=a.tween;if(c!==o){s=o=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 Lx(t,r,o){var s,a;if(typeof o!="function")throw new Error;return function(){var c=Qn(this,t),u=c.tween;if(u!==s){a=(s=u).slice();for(var h={name:r,value:o},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 Dx(t,r){var o=this._id;if(t+="",arguments.length<2){for(var s=Tn(this.node(),o).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?Ax:Lx)(o,t,r))}function Cu(t,r,o){var s=t._id;return t.each(function(){var a=Qn(this,s);(a.value||(a.value={}))[r]=o.apply(this,arguments)}),function(a){return Tn(a,s).value[r]}}function qp(t,r){var o;return(typeof r=="number"?Yn:r instanceof So?Ul:(o=So(r))?(r=o,Ul):Wp)(t,r)}function $x(t){return function(){this.removeAttribute(t)}}function Ox(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Fx(t,r,o){var s,a=o+"",c;return function(){var u=this.getAttribute(t);return u===a?null:u===s?c:c=r(s=u,o)}}function Hx(t,r,o){var s,a=o+"",c;return function(){var u=this.getAttributeNS(t.space,t.local);return u===a?null:u===s?c:c=r(s=u,o)}}function Vx(t,r,o){var s,a,c;return function(){var u,h=o(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 Bx(t,r,o){var s,a,c;return function(){var u,h=o(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 Wx(t,r){var o=ta(t),s=o==="transform"?Ex:qp;return this.attrTween(t,typeof r=="function"?(o.local?Bx:Vx)(o,s,Cu(this,"attr."+t,r)):r==null?(o.local?Ox:$x)(o):(o.local?Hx:Fx)(o,s,r))}function Ux(t,r){return function(o){this.setAttribute(t,r.call(this,o))}}function Yx(t,r){return function(o){this.setAttributeNS(t.space,t.local,r.call(this,o))}}function Xx(t,r){var o,s;function a(){var c=r.apply(this,arguments);return c!==s&&(o=(s=c)&&Yx(t,c)),o}return a._value=r,a}function Gx(t,r){var o,s;function a(){var c=r.apply(this,arguments);return c!==s&&(o=(s=c)&&Ux(t,c)),o}return a._value=r,a}function Kx(t,r){var o="attr."+t;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;var s=ta(t);return this.tween(o,(s.local?Xx:Gx)(s,r))}function Qx(t,r){return function(){Nu(this,t).delay=+r.apply(this,arguments)}}function qx(t,r){return r=+r,function(){Nu(this,t).delay=r}}function Zx(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Qx:qx)(r,t)):Tn(this.node(),r).delay}function Jx(t,r){return function(){Qn(this,t).duration=+r.apply(this,arguments)}}function ew(t,r){return r=+r,function(){Qn(this,t).duration=r}}function tw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Jx:ew)(r,t)):Tn(this.node(),r).duration}function nw(t,r){if(typeof r!="function")throw new Error;return function(){Qn(this,t).ease=r}}function rw(t){var r=this._id;return arguments.length?this.each(nw(r,t)):Tn(this.node(),r).ease}function ow(t,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;Qn(this,t).ease=o}}function iw(t){if(typeof t!="function")throw new Error;return this.each(ow(this._id,t))}function sw(t){typeof t!="function"&&(t=bp(t));for(var r=this._groups,o=r.length,s=new Array(o),a=0;a<o;++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 fr(s,this._parents,this._name,this._id)}function lw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,o=t._groups,s=r.length,a=o.length,c=Math.min(s,a),u=new Array(s),h=0;h<c;++h)for(var m=r[h],g=o[h],v=m.length,y=u[h]=new Array(v),x,_=0;_<v;++_)(x=m[_]||g[_])&&(y[_]=x);for(;h<s;++h)u[h]=r[h];return new fr(u,this._parents,this._name,this._id)}function aw(t){return(t+"").trim().split(/^|\s+/).every(function(r){var o=r.indexOf(".");return o>=0&&(r=r.slice(0,o)),!r||r==="start"})}function cw(t,r,o){var s,a,c=aw(r)?Nu:Qn;return function(){var u=c(this,t),h=u.on;h!==s&&(a=(s=h).copy()).on(r,o),u.on=a}}function uw(t,r){var o=this._id;return arguments.length<2?Tn(this.node(),o).on.on(t):this.each(cw(o,t,r))}function dw(t){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==t)return;r&&r.removeChild(this)}}function fw(){return this.on("end.remove",dw(this._id))}function hw(t){var r=this._name,o=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,ra(g[x],r,o,x,g,Tn(v,o)));return new fr(c,this._parents,r,o)}function pw(t){var r=this._name,o=this._id;typeof t!="function"&&(t=jp(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),_,E=Tn(v,o),N=0,k=x.length;N<k;++N)(_=x[N])&&ra(_,r,o,N,x,E);c.push(x),u.push(v)}return new fr(c,u,r,o)}var mw=vs.prototype.constructor;function gw(){return new mw(this._groups,this._parents)}function yw(t,r){var o,s,a;return function(){var c=ui(this,t),u=(this.style.removeProperty(t),ui(this,t));return c===u?null:c===o&&u===s?a:a=r(o=c,s=u)}}function Zp(t){return function(){this.style.removeProperty(t)}}function vw(t,r,o){var s,a=o+"",c;return function(){var u=ui(this,t);return u===a?null:u===s?c:c=r(s=u,o)}}function xw(t,r,o){var s,a,c;return function(){var u=ui(this,t),h=o(this),m=h+"";return h==null&&(m=h=(this.style.removeProperty(t),ui(this,t))),u===m?null:u===s&&m===a?c:(a=m,c=r(s=u,h))}}function ww(t,r){var o,s,a,c="style."+r,u="end."+c,h;return function(){var m=Qn(this,t),g=m.on,v=m.value[c]==null?h||(h=Zp(r)):void 0;(g!==o||a!==v)&&(s=(o=g).copy()).on(u,a=v),m.on=s}}function Sw(t,r,o){var s=(t+="")=="transform"?kx:qp;return r==null?this.styleTween(t,yw(t,s)).on("end.style."+t,Zp(t)):typeof r=="function"?this.styleTween(t,xw(t,s,Cu(this,"style."+t,r))).each(ww(this._id,t)):this.styleTween(t,vw(t,s,r),o).on("end.style."+t,null)}function kw(t,r,o){return function(s){this.style.setProperty(t,r.call(this,s),o)}}function Ew(t,r,o){var s,a;function c(){var u=r.apply(this,arguments);return u!==a&&(s=(a=u)&&kw(t,u,o)),s}return c._value=r,c}function Nw(t,r,o){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,Ew(t,r,o??""))}function Cw(t){return function(){this.textContent=t}}function _w(t){return function(){var r=t(this);this.textContent=r??""}}function jw(t){return this.tween("text",typeof t=="function"?_w(Cu(this,"text",t)):Cw(t==null?"":t+""))}function bw(t){return function(r){this.textContent=t.call(this,r)}}function Pw(t){var r,o;function s(){var a=t.apply(this,arguments);return a!==o&&(r=(o=a)&&bw(a)),r}return s._value=t,s}function Mw(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,Pw(t))}function Iw(){for(var t=this._name,r=this._id,o=Jp(),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=Tn(m,r);ra(m,t,o,g,u,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new fr(s,this._parents,t,o)}function Tw(){var t,r,o=this,s=o._id,a=o.size();return new Promise(function(c,u){var h={value:u},m={value:function(){--a===0&&c()}};o.each(function(){var g=Qn(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 zw=0;function fr(t,r,o,s){this._groups=t,this._parents=r,this._name=o,this._id=s}function Jp(){return++zw}var ur=vs.prototype;fr.prototype={constructor:fr,select:hw,selectAll:pw,selectChild:ur.selectChild,selectChildren:ur.selectChildren,filter:sw,merge:lw,selection:gw,transition:Iw,call:ur.call,nodes:ur.nodes,node:ur.node,size:ur.size,empty:ur.empty,each:ur.each,on:uw,attr:Wx,attrTween:Kx,style:Sw,styleTween:Nw,text:jw,textTween:Mw,remove:fw,tween:Dx,delay:Zx,duration:tw,ease:rw,easeVarying:iw,end:Tw,[Symbol.iterator]:ur[Symbol.iterator]};function Rw(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Aw={time:null,delay:0,duration:250,ease:Rw};function Lw(t,r){for(var o;!(o=t.__transition)||!(o=o[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return o}function Dw(t){var r,o;t instanceof fr?(r=t._id,t=t._name):(r=Jp(),(o=Aw).time=Eu(),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])&&ra(m,t,r,g,u,o||Lw(m,r));return new fr(s,this._parents,t,r)}vs.prototype.interrupt=Rx;vs.prototype.transition=Dw;const Il=t=>()=>t;function $w(t,{sourceEvent:r,target:o,transform:s,dispatch:a}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:a}})}function dr(t,r,o){this.k=t,this.x=r,this.y=o}dr.prototype={constructor:dr,scale:function(t){return t===1?this:new dr(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new dr(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 oa=new dr(1,0,0);em.prototype=dr.prototype;function em(t){for(;!t.__zoom;)if(!(t=t.parentNode))return oa;return t.__zoom}function Yc(t){t.stopImmediatePropagation()}function ns(t){t.preventDefault(),t.stopImmediatePropagation()}function Ow(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Fw(){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 Nh(){return this.__zoom||oa}function Hw(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Vw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Bw(t,r,o){var s=t.invertX(r[0][0])-o[0][0],a=t.invertX(r[1][0])-o[1][0],c=t.invertY(r[0][1])-o[0][1],u=t.invertY(r[1][1])-o[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 tm(){var t=Ow,r=Fw,o=Bw,s=Hw,a=Vw,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],h=250,m=$l,g=ea("start","zoom","end"),v,y,x,_=500,E=150,N=0,k=10;function S(b){b.property("__zoom",Nh).on("wheel.zoom",q,{passive:!1}).on("mousedown.zoom",J).on("dblclick.zoom",ee).filter(a).on("touchstart.zoom",U).on("touchmove.zoom",X).on("touchend.zoom touchcancel.zoom",re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(b,K,V,G){var z=b.selection?b.selection():b;z.property("__zoom",Nh),b!==z?O(b,K,V,G):z.interrupt().each(function(){A(this,arguments).event(G).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},S.scaleBy=function(b,K,V,G){S.scaleTo(b,function(){var z=this.__zoom.k,R=typeof K=="function"?K.apply(this,arguments):K;return z*R},V,G)},S.scaleTo=function(b,K,V,G){S.transform(b,function(){var z=r.apply(this,arguments),R=this.__zoom,B=V==null?j(z):typeof V=="function"?V.apply(this,arguments):V,M=R.invert(B),$=typeof K=="function"?K.apply(this,arguments):K;return o(C(I(R,$),B,M),z,u)},V,G)},S.translateBy=function(b,K,V,G){S.transform(b,function(){return o(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof V=="function"?V.apply(this,arguments):V),r.apply(this,arguments),u)},null,G)},S.translateTo=function(b,K,V,G,z){S.transform(b,function(){var R=r.apply(this,arguments),B=this.__zoom,M=G==null?j(R):typeof G=="function"?G.apply(this,arguments):G;return o(oa.translate(M[0],M[1]).scale(B.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof V=="function"?-V.apply(this,arguments):-V),R,u)},G,z)};function I(b,K){return K=Math.max(c[0],Math.min(c[1],K)),K===b.k?b:new dr(K,b.x,b.y)}function C(b,K,V){var G=K[0]-V[0]*b.k,z=K[1]-V[1]*b.k;return G===b.x&&z===b.y?b:new dr(b.k,G,z)}function j(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function O(b,K,V,G){b.on("start.zoom",function(){A(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){A(this,arguments).event(G).end()}).tween("zoom",function(){var z=this,R=arguments,B=A(z,R).event(G),M=r.apply(z,R),$=V==null?j(M):typeof V=="function"?V.apply(z,R):V,se=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),oe=z.__zoom,de=typeof K=="function"?K.apply(z,R):K,fe=m(oe.invert($).concat(se/oe.k),de.invert($).concat(se/de.k));return function(me){if(me===1)me=de;else{var te=fe(me),pe=se/te[2];me=new dr(pe,$[0]-te[0]*pe,$[1]-te[1]*pe)}B.zoom(null,me)}})}function A(b,K,V){return!V&&b.__zooming||new H(b,K)}function H(b,K){this.that=b,this.args=K,this.active=0,this.sourceEvent=null,this.extent=r.apply(b,K),this.taps=0}H.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,K){return this.mouse&&b!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var K=Zt(this.that).datum();g.call(b,this.that,new $w(b,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:g}),K)}};function q(b,...K){if(!t.apply(this,arguments))return;var V=A(this,K).event(b),G=this.__zoom,z=Math.max(c[0],Math.min(c[1],G.k*Math.pow(2,s.apply(this,arguments)))),R=bn(b);if(V.wheel)(V.mouse[0][0]!==R[0]||V.mouse[0][1]!==R[1])&&(V.mouse[1]=G.invert(V.mouse[0]=R)),clearTimeout(V.wheel);else{if(G.k===z)return;V.mouse=[R,G.invert(R)],Hl(this),V.start()}ns(b),V.wheel=setTimeout(B,E),V.zoom("mouse",o(C(I(G,z),V.mouse[0],V.mouse[1]),V.extent,u));function B(){V.wheel=null,V.end()}}function J(b,...K){if(x||!t.apply(this,arguments))return;var V=b.currentTarget,G=A(this,K,!0).event(b),z=Zt(b.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",se,!0),R=bn(b,V),B=b.clientX,M=b.clientY;$p(b.view),Yc(b),G.mouse=[R,this.__zoom.invert(R)],Hl(this),G.start();function $(oe){if(ns(oe),!G.moved){var de=oe.clientX-B,fe=oe.clientY-M;G.moved=de*de+fe*fe>N}G.event(oe).zoom("mouse",o(C(G.that.__zoom,G.mouse[0]=bn(oe,V),G.mouse[1]),G.extent,u))}function se(oe){z.on("mousemove.zoom mouseup.zoom",null),Op(oe.view,G.moved),ns(oe),G.event(oe).end()}}function ee(b,...K){if(t.apply(this,arguments)){var V=this.__zoom,G=bn(b.changedTouches?b.changedTouches[0]:b,this),z=V.invert(G),R=V.k*(b.shiftKey?.5:2),B=o(C(I(V,R),G,z),r.apply(this,K),u);ns(b),h>0?Zt(this).transition().duration(h).call(O,B,G,b):Zt(this).call(S.transform,B,G,b)}}function U(b,...K){if(t.apply(this,arguments)){var V=b.touches,G=V.length,z=A(this,K,b.changedTouches.length===G).event(b),R,B,M,$;for(Yc(b),B=0;B<G;++B)M=V[B],$=bn(M,this),$=[$,this.__zoom.invert($),M.identifier],z.touch0?!z.touch1&&z.touch0[2]!==$[2]&&(z.touch1=$,z.taps=0):(z.touch0=$,R=!0,z.taps=1+!!v);v&&(v=clearTimeout(v)),R&&(z.taps<2&&(y=$[0],v=setTimeout(function(){v=null},_)),Hl(this),z.start())}}function X(b,...K){if(this.__zooming){var V=A(this,K).event(b),G=b.changedTouches,z=G.length,R,B,M,$;for(ns(b),R=0;R<z;++R)B=G[R],M=bn(B,this),V.touch0&&V.touch0[2]===B.identifier?V.touch0[0]=M:V.touch1&&V.touch1[2]===B.identifier&&(V.touch1[0]=M);if(B=V.that.__zoom,V.touch1){var se=V.touch0[0],oe=V.touch0[1],de=V.touch1[0],fe=V.touch1[1],me=(me=de[0]-se[0])*me+(me=de[1]-se[1])*me,te=(te=fe[0]-oe[0])*te+(te=fe[1]-oe[1])*te;B=I(B,Math.sqrt(me/te)),M=[(se[0]+de[0])/2,(se[1]+de[1])/2],$=[(oe[0]+fe[0])/2,(oe[1]+fe[1])/2]}else if(V.touch0)M=V.touch0[0],$=V.touch0[1];else return;V.zoom("touch",o(C(B,M,$),V.extent,u))}}function re(b,...K){if(this.__zooming){var V=A(this,K).event(b),G=b.changedTouches,z=G.length,R,B;for(Yc(b),x&&clearTimeout(x),x=setTimeout(function(){x=null},_),R=0;R<z;++R)B=G[R],V.touch0&&V.touch0[2]===B.identifier?delete V.touch0:V.touch1&&V.touch1[2]===B.identifier&&delete V.touch1;if(V.touch1&&!V.touch0&&(V.touch0=V.touch1,delete V.touch1),V.touch0)V.touch0[1]=this.__zoom.invert(V.touch0[0]);else if(V.end(),V.taps===2&&(B=bn(B,this),Math.hypot(y[0]-B[0],y[1]-B[1])<k)){var M=Zt(this).on("dblclick.zoom");M&&M.apply(this,arguments)}}}return S.wheelDelta=function(b){return arguments.length?(s=typeof b=="function"?b:Il(+b),S):s},S.filter=function(b){return arguments.length?(t=typeof b=="function"?b:Il(!!b),S):t},S.touchable=function(b){return arguments.length?(a=typeof b=="function"?b:Il(!!b),S):a},S.extent=function(b){return arguments.length?(r=typeof b=="function"?b:Il([[+b[0][0],+b[0][1]],[+b[1][0],+b[1][1]]]),S):r},S.scaleExtent=function(b){return arguments.length?(c[0]=+b[0],c[1]=+b[1],S):[c[0],c[1]]},S.translateExtent=function(b){return arguments.length?(u[0][0]=+b[0][0],u[1][0]=+b[1][0],u[0][1]=+b[0][1],u[1][1]=+b[1][1],S):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},S.constrain=function(b){return arguments.length?(o=b,S):o},S.duration=function(b){return arguments.length?(h=+b,S):h},S.interpolate=function(b){return arguments.length?(m=b,S):m},S.on=function(){var b=g.on.apply(g,arguments);return b===g?S:b},S.clickDistance=function(b){return arguments.length?(N=(b=+b)*b,S):Math.sqrt(N)},S.tapDistance=function(b){return arguments.length?(k=+b,S):k},S}const Kn={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:o,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?o: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]],nm=["Enter"," ","Escape"],rm={"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:o})=>`Moved selected node ${t}. New position, x: ${r}, y: ${o}`,"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 Eo;(function(t){t.Strict="strict",t.Loose="loose"})(Eo||(Eo={}));var wo;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(wo||(wo={}));var fs;(function(t){t.Partial="partial",t.Full="full"})(fs||(fs={}));const om={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Fr;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Fr||(Fr={}));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 Ch={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top};function im(t){return t===null?null:t?"valid":"invalid"}const sm=t=>"id"in t&&"source"in t&&"target"in t,Ww=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:o,height:s}=hr(t),a=t.origin??r,c=o*a[0],u=s*a[1];return{x:t.position.x-c,y:t.position.y-u}},Uw=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const o=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?Kl(u,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ia(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return sa(o)},Ss=(t,r={})=>{let o={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))&&(o=ia(o,Kl(a)),s=!0)}),s?sa(o):{x:0,y:0,width:0,height:0}},ju=(t,r,[o,s,a]=[0,0,1],c=!1,u=!1)=>{const h={...Es(r,[o,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 _=v.width??g.width??g.initialWidth??null,E=v.height??g.height??g.initialHeight??null,N=ps(h,hi(g)),k=(_??0)*(E??0),S=c&&N>0;(!g.internals.handleBounds||S||N>=k||g.dragging)&&m.push(g)}return m},Yw=(t,r)=>{const o=new Set;return t.forEach(s=>{o.add(s.id)}),r.filter(s=>o.has(s.source)||o.has(s.target))};function Xw(t,r){const o=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))&&o.set(a.id,a)}),o}async function Gw({nodes:t,width:r,height:o,panZoom:s,minZoom:a,maxZoom:c},u){if(t.size===0)return Promise.resolve(!0);const h=Xw(t,u),m=Ss(h),g=bu(m,r,o,(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 lm({nodeId:t,nextPosition:r,nodeLookup:o,nodeOrigin:s=[0,0],nodeExtent:a,onError:c}){const u=o.get(t),h=u.parentId?o.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",Kn.error005());else{const _=h.measured.width,E=h.measured.height;_&&E&&(y=[[m,g],[m+_,g+E]])}else h&&pi(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=pi(y)?No(r,y,u.measured):r;return(u.measured.width===void 0||u.measured.height===void 0)&&(c==null||c("015",Kn.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 Kw({nodesToRemove:t=[],edgesToRemove:r=[],nodes:o,edges:s,onBeforeDelete:a}){const c=new Set(t.map(x=>x.id)),u=[];for(const x of o){if(x.deletable===!1)continue;const _=c.has(x.id),E=!_&&x.parentId&&u.find(N=>N.id===x.parentId);(_||E)&&u.push(x)}const h=new Set(r.map(x=>x.id)),m=s.filter(x=>x.deletable!==!1),v=Yw(u,m);for(const x of m)h.has(x.id)&&!v.find(E=>E.id===x.id)&&v.push(x);if(!a)return{edges:v,nodes:u};const y=await a({nodes:u,edges:v});return typeof y=="boolean"?y?{edges:v,nodes:u}:{edges:[],nodes:[]}:y}const fi=(t,r=0,o=1)=>Math.min(Math.max(t,r),o),No=(t={x:0,y:0},r,o)=>({x:fi(t.x,r[0][0],r[1][0]-((o==null?void 0:o.width)??0)),y:fi(t.y,r[0][1],r[1][1]-((o==null?void 0:o.height)??0))});function am(t,r,o){const{width:s,height:a}=hr(o),{x:c,y:u}=o.internals.positionAbsolute;return No(t,[[c,u],[c+s,u+a]],r)}const _h=(t,r,o)=>t<r?fi(Math.abs(t-r),1,r)/r:t>o?-fi(Math.abs(t-o),1,r)/r:0,cm=(t,r,o=15,s=40)=>{const a=_h(t.x,s,r.width-s)*o,c=_h(t.y,s,r.height-s)*o;return[a,c]},ia=(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:o,height:s})=>({x:t,y:r,x2:t+o,y2:r+s}),sa=({x:t,y:r,x2:o,y2:s})=>({x:t,y:r,width:o-t,height:s-r}),hi=(t,r=[0,0])=>{var a,c;const{x:o,y:s}=_u(t)?t.internals.positionAbsolute:ws(t,r);return{x:o,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}},Kl=(t,r=[0,0])=>{var a,c;const{x:o,y:s}=_u(t)?t.internals.positionAbsolute:ws(t,r);return{x:o,y:s,x2:o+(((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)}},um=(t,r)=>sa(ia(du(t),du(r))),ps=(t,r)=>{const o=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(o*s)},jh=t=>Mn(t.width)&&Mn(t.height)&&Mn(t.x)&&Mn(t.y),Mn=t=>!isNaN(t)&&isFinite(t),Qw=(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])}),Es=({x:t,y:r},[o,s,a],c=!1,u=[1,1])=>{const h={x:(t-o)/a,y:(r-s)/a};return c?ks(h,u):h},Ql=({x:t,y:r},[o,s,a])=>({x:t*a+o,y:r*a+s});function ni(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const o=parseFloat(t);if(!Number.isNaN(o))return Math.floor(o)}if(typeof t=="string"&&t.endsWith("%")){const o=parseFloat(t);if(!Number.isNaN(o))return Math.floor(r*o*.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 qw(t,r,o){if(typeof t=="string"||typeof t=="number"){const s=ni(t,o),a=ni(t,r);return{top:s,right:a,bottom:s,left:a,x:a*2,y:s*2}}if(typeof t=="object"){const s=ni(t.top??t.y??0,o),a=ni(t.bottom??t.y??0,o),c=ni(t.left??t.x??0,r),u=ni(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 Zw(t,r,o,s,a,c){const{x:u,y:h}=Ql(t,[r,o,s]),{x:m,y:g}=Ql({x:t.x+t.width,y:t.y+t.height},[r,o,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,o,s,a,c)=>{const u=qw(c,r,o),h=(r-u.x)/t.width,m=(o-u.y)/t.height,g=Math.min(h,m),v=fi(g,s,a),y=t.x+t.width/2,x=t.y+t.height/2,_=r/2-y*v,E=o/2-x*v,N=Zw(t,_,E,v,r,o),k={left:Math.min(N.left-u.left,0),top:Math.min(N.top-u.top,0),right:Math.min(N.right-u.right,0),bottom:Math.min(N.bottom-u.bottom,0)};return{x:_-k.left+k.right,y:E-k.top+k.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 pi(t){return t!=null&&t!=="parent"}function hr(t){var r,o;return{width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((o=t.measured)==null?void 0:o.height)??t.height??t.initialHeight??0}}function dm(t){var r,o;return(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth)!==void 0&&(((o=t.measured)==null?void 0:o.height)??t.height??t.initialHeight)!==void 0}function fm(t,r={width:0,height:0},o,s,a){const c={...t},u=s.get(o);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 bh(t,r){if(t.size!==r.size)return!1;for(const o of t)if(!r.has(o))return!1;return!0}function Jw(){let t,r;return{promise:new Promise((s,a)=>{t=s,r=a}),resolve:t,reject:r}}function e1(t){return{...rm,...t||{}}}function ss(t,{snapGrid:r=[0,0],snapToGrid:o=!1,transform:s,containerBounds:a}){const{x:c,y:u}=In(t),h=Es({x:c-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},s),{x:m,y:g}=o?ks(h,r):h;return{xSnapped:m,ySnapped:g,...h}}const Pu=t=>({width:t.offsetWidth,height:t.offsetHeight}),hm=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},t1=["INPUT","SELECT","TEXTAREA"];function pm(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:t1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const mm=t=>"clientX"in t,In=(t,r)=>{var c,u;const o=mm(t),s=o?t.clientX:(c=t.touches)==null?void 0:c[0].clientX,a=o?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,o,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-o.left)/s,y:(h.top-o.top)/s,...Pu(u)}})};function gm({sourceX:t,sourceY:r,targetX:o,targetY:s,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:h}){const m=t*.125+a*.375+u*.375+o*.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 Tl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function Mh({pos:t,x1:r,y1:o,x2:s,y2:a,c}){switch(t){case Ce.Left:return[r-Tl(r-s,c),o];case Ce.Right:return[r+Tl(s-r,c),o];case Ce.Top:return[r,o-Tl(o-a,c)];case Ce.Bottom:return[r,o+Tl(a-o,c)]}}function ym({sourceX:t,sourceY:r,sourcePosition:o=Ce.Bottom,targetX:s,targetY:a,targetPosition:c=Ce.Top,curvature:u=.25}){const[h,m]=Mh({pos:o,x1:t,y1:r,x2:s,y2:a,c:u}),[g,v]=Mh({pos:c,x1:s,y1:a,x2:t,y2:r,c:u}),[y,x,_,E]=gm({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,_,E]}function vm({sourceX:t,sourceY:r,targetX:o,targetY:s}){const a=Math.abs(o-t)/2,c=o<t?o+a:o-a,u=Math.abs(s-r)/2,h=s<r?s+u:s-u;return[c,h,a,u]}function n1({sourceNode:t,targetNode:r,selected:o=!1,zIndex:s=0,elevateOnSelect:a=!1,zIndexMode:c="basic"}){if(c==="manual")return s;const u=a&&o?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 r1({sourceNode:t,targetNode:r,width:o,height:s,transform:a}){const c=ia(Kl(t),Kl(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:o/a[2],height:s/a[2]};return ps(u,sa(c))>0}const xm=({source:t,sourceHandle:r,target:o,targetHandle:s})=>`xy-edge__${t}${r||""}-${o}${s||""}`,o1=(t,r)=>r.some(o=>o.source===t.source&&o.target===t.target&&(o.sourceHandle===t.sourceHandle||!o.sourceHandle&&!t.sourceHandle)&&(o.targetHandle===t.targetHandle||!o.targetHandle&&!t.targetHandle)),wm=(t,r,o={})=>{if(!t.source||!t.target)return r;const s=o.getEdgeId||xm;let a;return sm(t)?a={...t}:a={...t,id:s(t)},o1(a,r)?r:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,r.concat(a))},i1=(t,r,o,s={shouldReplaceId:!0})=>{const{id:a,...c}=t;if(!r.source||!r.target||!o.find(g=>g.id===t.id))return o;const h=s.getEdgeId||xm,m={...c,id:s.shouldReplaceId?h(r):a,source:r.source,target:r.target,sourceHandle:r.sourceHandle,targetHandle:r.targetHandle};return o.filter(g=>g.id!==a).concat(m)};function Sm({sourceX:t,sourceY:r,targetX:o,targetY:s}){const[a,c,u,h]=vm({sourceX:t,sourceY:r,targetX:o,targetY:s});return[`M ${t},${r}L ${o},${s}`,a,c,u,h]}const Ih={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},s1=({source:t,sourcePosition:r=Ce.Bottom,target:o})=>r===Ce.Left||r===Ce.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.y<o.y?{x:0,y:1}:{x:0,y:-1},Th=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function l1({source:t,sourcePosition:r=Ce.Bottom,target:o,targetPosition:s=Ce.Top,center:a,offset:c,stepPosition:u}){const h=Ih[r],m=Ih[s],g={x:t.x+h.x*c,y:t.y+h.y*c},v={x:o.x+m.x*c,y:o.y+m.y*c},y=s1({source:g,sourcePosition:r,target:v}),x=y.x!==0?"x":"y",_=y[x];let E=[],N,k;const S={x:0,y:0},I={x:0,y:0},[,,C,j]=vm({sourceX:t.x,sourceY:t.y,targetX:o.x,targetY:o.y});if(h[x]*m[x]===-1){x==="x"?(N=a.x??g.x+(v.x-g.x)*u,k=a.y??(g.y+v.y)/2):(N=a.x??(g.x+v.x)/2,k=a.y??g.y+(v.y-g.y)*u);const A=[{x:N,y:g.y},{x:N,y:v.y}],H=[{x:g.x,y:k},{x:v.x,y:k}];h[x]===_?E=x==="x"?A:H:E=x==="x"?H:A}else{const A=[{x:g.x,y:v.y}],H=[{x:v.x,y:g.y}];if(x==="x"?E=h.x===_?H:A:E=h.y===_?A:H,r===s){const X=Math.abs(t[x]-o[x]);if(X<=c){const re=Math.min(c-1,c-X);h[x]===_?S[x]=(g[x]>t[x]?-1:1)*re:I[x]=(v[x]>o[x]?-1:1)*re}}if(r!==s){const X=x==="x"?"y":"x",re=h[x]===m[X],b=g[X]>v[X],K=g[X]<v[X];(h[x]===1&&(!re&&b||re&&K)||h[x]!==1&&(!re&&K||re&&b))&&(E=x==="x"?A:H)}const q={x:g.x+S.x,y:g.y+S.y},J={x:v.x+I.x,y:v.y+I.y},ee=Math.max(Math.abs(q.x-E[0].x),Math.abs(J.x-E[0].x)),U=Math.max(Math.abs(q.y-E[0].y),Math.abs(J.y-E[0].y));ee>=U?(N=(q.x+J.x)/2,k=E[0].y):(N=E[0].x,k=(q.y+J.y)/2)}return[[t,{x:g.x+S.x,y:g.y+S.y},...E,{x:v.x+I.x,y:v.y+I.y},o],N,k,C,j]}function a1(t,r,o,s){const a=Math.min(Th(t,r)/2,Th(r,o)/2,s),{x:c,y:u}=r;if(t.x===c&&c===o.x||t.y===u&&u===o.y)return`L${c} ${u}`;if(t.y===u){const g=t.x<o.x?-1:1,v=t.y<o.y?1:-1;return`L ${c+a*g},${u}Q ${c},${u} ${c},${u+a*v}`}const h=t.x<o.x?1:-1,m=t.y<o.y?-1:1;return`L ${c},${u+a*m}Q ${c},${u} ${c+a*h},${u}`}function fu({sourceX:t,sourceY:r,sourcePosition:o=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,_,E,N]=l1({source:{x:t,y:r},sourcePosition:o,target:{x:s,y:a},targetPosition:c,center:{x:h,y:m},offset:g,stepPosition:v});return[y.reduce((S,I,C)=>{let j="";return C>0&&C<y.length-1?j=a1(y[C-1],I,y[C+1],u):j=`${C===0?"M":"L"}${I.x} ${I.y}`,S+=j,S},""),x,_,E,N]}function zh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function c1(t){var y;const{sourceNode:r,targetNode:o}=t;if(!zh(r)||!zh(o))return null;const s=r.internals.handleBounds||Rh(r.handles),a=o.internals.handleBounds||Rh(o.handles),c=Ah((s==null?void 0:s.source)??[],t.sourceHandle),u=Ah(t.connectionMode===Eo.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",Kn.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=Co(r,c,h),v=Co(o,u,m);return{sourceX:g.x,sourceY:g.y,targetX:v.x,targetY:v.y,sourcePosition:h,targetPosition:m}}function Rh(t){if(!t)return null;const r=[],o=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?r.push(s):s.type==="target"&&o.push(s);return{source:r,target:o}}function Co(t,r,o=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??hr(t);if(s)return{x:a+u/2,y:c+h/2};switch((r==null?void 0:r.position)??o){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 Ah(t,r){return t&&(r?t.find(o=>o.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 u1(t,{id:r,defaultColor:o,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||o,...m}),c.add(g))}}),u),[]).sort((u,h)=>u.id.localeCompare(h.id))}const km=1e3,d1=10,Mu={nodeOrigin:[0,0],nodeExtent:ds,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},f1={...Mu,checkEquality:!0};function Iu(t,r){const o={...t};for(const s in r)r[s]!==void 0&&(o[s]=r[s]);return o}function h1(t,r,o){const s=Iu(Mu,o);for(const a of t.values())if(a.parentId)zu(a,t,r,s);else{const c=ws(a,s.nodeOrigin),u=pi(a.extent)?a.extent:s.nodeExtent,h=No(c,u,hr(a));a.internals.positionAbsolute=h}}function p1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const o=[],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"?o.push(c):a.type==="target"&&s.push(c)}return{source:o,target:s}}function Tu(t){return t==="manual"}function pu(t,r,o,s={}){var g,v;const a=Iu(f1,s),c={i:0},u=new Map(r),h=a!=null&&a.elevateNodesOnSelect&&!Tu(a.zIndexMode)?km:0;let m=t.length>0;r.clear(),o.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 _=ws(y,a.nodeOrigin),E=pi(y.extent)?y.extent:a.nodeExtent,N=No(_,E,hr(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:N,handleBounds:p1(y,x),z:Em(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&&zu(x,r,o,s,c)}return m}function m1(t,r){if(!t.parentId)return;const o=r.get(t.parentId);o?o.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function zu(t,r,o,s,a){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:h,zIndexMode:m}=Iu(Mu,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}m1(t,o),a&&!v.parentId&&v.internals.rootParentIndex===void 0&&m==="auto"&&(v.internals.rootParentIndex=++a.i,v.internals.z=v.internals.z+a.i*d1),a&&v.internals.rootParentIndex!==void 0&&(a.i=v.internals.rootParentIndex);const y=c&&!Tu(m)?km:0,{x,y:_,z:E}=g1(t,v,u,h,y,m),{positionAbsolute:N}=t.internals,k=x!==N.x||_!==N.y;(k||E!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:k?{x,y:_}:N,z:E}})}function Em(t,r,o){const s=Mn(t.zIndex)?t.zIndex:0;return Tu(o)?s:s+(t.selected?r:0)}function g1(t,r,o,s,a,c){const{x:u,y:h}=r.internals.positionAbsolute,m=hr(t),g=ws(t,o),v=pi(t.extent)?No(g,t.extent,m):g;let y=No({x:u+v.x,y:h+v.y},s,m);t.extent==="parent"&&(y=am(y,m,r));const x=Em(t,a,c),_=r.internals.z??0;return{x:y.x,y:y.y,z:_>=x?_+1:x}}function Ru(t,r,o,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)??hi(m),v=um(g,h.rect);c.set(h.parentId,{expandedRect:v,parent:m})}return c.size>0&&c.forEach(({expandedRect:h,parent:m},g)=>{var C;const v=m.internals.positionAbsolute,y=hr(m),x=m.origin??s,_=h.x<v.x?Math.round(Math.abs(v.x-h.x)):0,E=h.y<v.y?Math.round(Math.abs(v.y-h.y)):0,N=Math.max(y.width,Math.round(h.width)),k=Math.max(y.height,Math.round(h.height)),S=(N-y.width)*x[0],I=(k-y.height)*x[1];(_>0||E>0||S||I)&&(a.push({id:g,type:"position",position:{x:m.position.x-_+S,y:m.position.y-E+I}}),(C=o.get(g))==null||C.forEach(j=>{t.some(O=>O.id===j.id)||a.push({id:j.id,type:"position",position:{x:j.position.x+_,y:j.position.y+E}})})),(y.width<h.width||y.height<h.height||_||E)&&a.push({id:g,type:"dimensions",setAttributes:!0,dimensions:{width:N+(_?x[0]*_-S:0),height:k+(E?x[1]*E-I:0)}})}),a}function y1(t,r,o,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 _ of t.values()){const E=r.get(_.id);if(!E)continue;if(E.hidden){r.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),m=!0;continue}const N=Pu(_.nodeElement),k=E.measured.width!==N.width||E.measured.height!==N.height;if(!!(N.width&&N.height&&(k||!E.internals.handleBounds||_.force))){const I=_.nodeElement.getBoundingClientRect(),C=pi(E.extent)?E.extent:c;let{positionAbsolute:j}=E.internals;E.parentId&&E.extent==="parent"?j=am(j,N,r.get(E.parentId)):C&&(j=No(j,C,N));const O={...E,measured:N,internals:{...E.internals,positionAbsolute:j,handleBounds:{source:Ph("source",_.nodeElement,I,y,E.id),target:Ph("target",_.nodeElement,I,y,E.id)}}};r.set(E.id,O),E.parentId&&zu(O,r,o,{nodeOrigin:a,zIndexMode:u}),m=!0,k&&(g.push({id:E.id,type:"dimensions",dimensions:N}),E.expandParent&&E.parentId&&x.push({id:E.id,parentId:E.parentId,rect:hi(O,a)}))}}if(x.length>0){const _=Ru(x,r,o,a);g.push(..._)}return{changes:g,updatedInternals:m}}async function v1({delta:t,panZoom:r,transform:o,translateExtent:s,width:a,height:c}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const u=await r.setViewportConstrained({x:o[0]+t.x,y:o[1]+t.y,zoom:o[2]},[[0,0],[a,c]],s),h=!!u&&(u.x!==o[0]||u.y!==o[1]||u.k!==o[2]);return Promise.resolve(h)}function Lh(t,r,o,s,a,c){let u=a;const h=s.get(u)||new Map;s.set(u,h.set(o,r)),u=`${a}-${t}`;const m=s.get(u)||new Map;if(s.set(u,m.set(o,r)),c){u=`${a}-${t}-${c}`;const g=s.get(u)||new Map;s.set(u,g.set(o,r))}}function Nm(t,r,o){t.clear(),r.clear();for(const s of o){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}`;Lh("source",m,v,t,a,u),Lh("target",m,g,t,c,h),r.set(s.id,s)}}function Cm(t,r){if(!t.parentId)return!1;const o=r.get(t.parentId);return o?o.selected?!0:Cm(o,r):!1}function Dh(t,r,o){var a;let s=t;do{if((a=s==null?void 0:s.matches)!=null&&a.call(s,r))return!0;if(s===o)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function x1(t,r,o,s){const a=new Map;for(const[c,u]of t)if((u.selected||u.id===s)&&(!u.parentId||!Cm(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:o.x-h.internals.positionAbsolute.x,y:o.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:o,dragging:s=!0}){var u,h,m;const a=[];for(const[g,v]of r){const y=(u=o.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=o.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 w1({dragItems:t,snapGrid:r,x:o,y:s}){const a=t.values().next().value;if(!a)return null;const c={x:o-a.distance.x,y:s-a.distance.y},u=ks(c,r);return{x:u.x-c.x,y:u.y-c.y}}function S1({onNodeMouseDown:t,getStoreItems:r,onDragStart:o,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,_=!1,E=!1,N=null;function k({noDragClassName:I,handleSelector:C,domNode:j,isSelectable:O,nodeId:A,nodeClickDistance:H=0}){x=Zt(j);function q({x:X,y:re}){const{nodeLookup:b,nodeExtent:K,snapGrid:V,snapToGrid:G,nodeOrigin:z,onNodeDrag:R,onSelectionDrag:B,onError:M,updateNodePositions:$}=r();c={x:X,y:re};let se=!1;const oe=h.size>1,de=oe&&K?du(Ss(h)):null,fe=oe&&G?w1({dragItems:h,snapGrid:V,x:X,y:re}):null;for(const[me,te]of h){if(!b.has(me))continue;let pe={x:X-te.distance.x,y:re-te.distance.y};G&&(pe=fe?{x:Math.round(pe.x+fe.x),y:Math.round(pe.y+fe.y)}:ks(pe,V));let _e=null;if(oe&&K&&!te.extent&&de){const{positionAbsolute:Ee}=te.internals,Ae=Ee.x-de.x+K[0][0],He=Ee.x+te.measured.width-de.x2+K[1][0],Re=Ee.y-de.y+K[0][1],Ue=Ee.y+te.measured.height-de.y2+K[1][1];_e=[[Ae,Re],[He,Ue]]}const{position:be,positionAbsolute:je}=lm({nodeId:me,nextPosition:pe,nodeLookup:b,nodeExtent:_e||K,nodeOrigin:z,onError:M});se=se||te.position.x!==be.x||te.position.y!==be.y,te.position=be,te.internals.positionAbsolute=je}if(E=E||se,!!se&&($(h,!0),N&&(s||R||!A&&B))){const[me,te]=Xc({nodeId:A,dragItems:h,nodeLookup:b});s==null||s(N,h,me,te),R==null||R(N,me,te),A||B==null||B(N,te)}}async function J(){if(!v)return;const{transform:X,panBy:re,autoPanSpeed:b,autoPanOnNodeDrag:K}=r();if(!K){m=!1,cancelAnimationFrame(u);return}const[V,G]=cm(g,v,b);(V!==0||G!==0)&&(c.x=(c.x??0)-V/X[2],c.y=(c.y??0)-G/X[2],await re({x:V,y:G})&&q(c)),u=requestAnimationFrame(J)}function ee(X){var oe;const{nodeLookup:re,multiSelectionActive:b,nodesDraggable:K,transform:V,snapGrid:G,snapToGrid:z,selectNodesOnDrag:R,onNodeDragStart:B,onSelectionDragStart:M,unselectNodesAndEdges:$}=r();y=!0,(!R||!O)&&!b&&A&&((oe=re.get(A))!=null&&oe.selected||$()),O&&R&&A&&(t==null||t(A));const se=ss(X.sourceEvent,{transform:V,snapGrid:G,snapToGrid:z,containerBounds:v});if(c=se,h=x1(re,K,se,A),h.size>0&&(o||B||!A&&M)){const[de,fe]=Xc({nodeId:A,dragItems:h,nodeLookup:re});o==null||o(X.sourceEvent,h,de,fe),B==null||B(X.sourceEvent,de,fe),A||M==null||M(X.sourceEvent,fe)}}const U=Fp().clickDistance(H).on("start",X=>{const{domNode:re,nodeDragThreshold:b,transform:K,snapGrid:V,snapToGrid:G}=r();v=(re==null?void 0:re.getBoundingClientRect())||null,_=!1,E=!1,N=X.sourceEvent,b===0&&ee(X),c=ss(X.sourceEvent,{transform:K,snapGrid:V,snapToGrid:G,containerBounds:v}),g=In(X.sourceEvent,v)}).on("drag",X=>{const{autoPanOnNodeDrag:re,transform:b,snapGrid:K,snapToGrid:V,nodeDragThreshold:G,nodeLookup:z}=r(),R=ss(X.sourceEvent,{transform:b,snapGrid:K,snapToGrid:V,containerBounds:v});if(N=X.sourceEvent,(X.sourceEvent.type==="touchmove"&&X.sourceEvent.touches.length>1||A&&!z.has(A))&&(_=!0),!_){if(!m&&re&&y&&(m=!0,J()),!y){const B=In(X.sourceEvent,v),M=B.x-g.x,$=B.y-g.y;Math.sqrt(M*M+$*$)>G&&ee(X)}(c.x!==R.xSnapped||c.y!==R.ySnapped)&&h&&y&&(g=In(X.sourceEvent,v),q(R))}}).on("end",X=>{if(!(!y||_)&&(m=!1,y=!1,cancelAnimationFrame(u),h.size>0)){const{nodeLookup:re,updateNodePositions:b,onNodeDragStop:K,onSelectionDragStop:V}=r();if(E&&(b(h,!1),E=!1),a||K||!A&&V){const[G,z]=Xc({nodeId:A,dragItems:h,nodeLookup:re,dragging:!1});a==null||a(X.sourceEvent,h,G,z),K==null||K(X.sourceEvent,G,z),A||V==null||V(X.sourceEvent,z)}}}).filter(X=>{const re=X.target;return!X.button&&(!I||!Dh(re,`.${I}`,j))&&(!C||Dh(re,C,j))});x.call(U)}function S(){x==null||x.on(".drag",null)}return{update:k,destroy:S}}function k1(t,r,o){const s=[],a={x:t.x-o,y:t.y-o,width:o*2,height:o*2};for(const c of r.values())ps(a,hi(c))>0&&s.push(c);return s}const E1=250;function N1(t,r,o,s){var h,m;let a=[],c=1/0;const u=k1(t,o,r+E1);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:_}=Co(g,y,y.position,!0),E=Math.sqrt(Math.pow(x-t.x,2)+Math.pow(_-t.y,2));E>r||(E<c?(a=[{...y,x,y:_}],c=E):E===c&&a.push({...y,x,y:_}))}}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 _m(t,r,o,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=(o?h==null?void 0:h.find(x=>x.id===o):h==null?void 0:h[0])??null;return m&&c?{...m,...Co(u,m,m.position,!0)}:m}function jm(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function C1(t,r){let o=null;return r?o=!0:t&&!r&&(o=!1),o}const bm=()=>!0;function _1(t,{connectionMode:r,connectionRadius:o,handleId:s,nodeId:a,edgeUpdaterType:c,isTarget:u,domNode:h,nodeLookup:m,lib:g,autoPanOnConnect:v,flowId:y,panBy:x,cancelConnection:_,onConnectStart:E,onConnect:N,onConnectEnd:k,isValidConnection:S=bm,onReconnectEnd:I,updateConnection:C,getTransform:j,getFromHandle:O,autoPanSpeed:A,dragThreshold:H=1,handleDomNode:q}){const J=hm(t.target);let ee=0,U;const{x:X,y:re}=In(t),b=jm(c,q),K=h==null?void 0:h.getBoundingClientRect();let V=!1;if(!K||!b)return;const G=_m(a,b,s,m,r);if(!G)return;let z=In(t,K),R=!1,B=null,M=!1,$=null;function se(){if(!v||!K)return;const[be,je]=cm(z,K,A);x({x:be,y:je}),ee=requestAnimationFrame(se)}const oe={...G,nodeId:a,type:b,position:G.position},de=m.get(a);let me={inProgress:!0,isValid:null,from:Co(de,oe,Ce.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:de,to:z,toHandle:null,toPosition:Ch[oe.position],toNode:null,pointer:z};function te(){V=!0,C(me),E==null||E(t,{nodeId:a,handleId:s,handleType:b})}H===0&&te();function pe(be){if(!V){const{x:Ue,y:st}=In(be),ht=Ue-X,vt=st-re;if(!(ht*ht+vt*vt>H*H))return;te()}if(!O()||!oe){_e(be);return}const je=j();z=In(be,K),U=N1(Es(z,je,!1,[1,1]),o,m,oe),R||(se(),R=!0);const Ee=Pm(be,{handle:U,connectionMode:r,fromNodeId:a,fromHandleId:s,fromType:u?"target":"source",isValidConnection:S,doc:J,lib:g,flowId:y,nodeLookup:m});$=Ee.handleDomNode,B=Ee.connection,M=C1(!!U,Ee.isValid);const Ae=m.get(a),He=Ae?Co(Ae,oe,Ce.Left,!0):me.from,Re={...me,from:He,isValid:M,to:Ee.toHandle&&M?Ql({x:Ee.toHandle.x,y:Ee.toHandle.y},je):z,toHandle:Ee.toHandle,toPosition:M&&Ee.toHandle?Ee.toHandle.position:Ch[oe.position],toNode:Ee.toHandle?m.get(Ee.toHandle.nodeId):null,pointer:z};C(Re),me=Re}function _e(be){if(!("touches"in be&&be.touches.length>0)){if(V){(U||$)&&B&&M&&(N==null||N(B));const{inProgress:je,...Ee}=me,Ae={...Ee,toPosition:me.toHandle?me.toPosition:null};k==null||k(be,Ae),c&&(I==null||I(be,Ae))}_(),cancelAnimationFrame(ee),R=!1,M=!1,B=null,$=null,J.removeEventListener("mousemove",pe),J.removeEventListener("mouseup",_e),J.removeEventListener("touchmove",pe),J.removeEventListener("touchend",_e)}}J.addEventListener("mousemove",pe),J.addEventListener("mouseup",_e),J.addEventListener("touchmove",pe),J.addEventListener("touchend",_e)}function Pm(t,{handle:r,connectionMode:o,fromNodeId:s,fromHandleId:a,fromType:c,doc:u,lib:h,flowId:m,isValidConnection:g=bm,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:_,y:E}=In(t),N=u.elementFromPoint(_,E),k=N!=null&&N.classList.contains(`${h}-flow__handle`)?N:x,S={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const I=jm(void 0,k),C=k.getAttribute("data-nodeid"),j=k.getAttribute("data-handleid"),O=k.classList.contains("connectable"),A=k.classList.contains("connectableend");if(!C||!I)return S;const H={source:y?C:s,sourceHandle:y?j:a,target:y?s:C,targetHandle:y?a:j};S.connection=H;const J=O&&A&&(o===Eo.Strict?y&&I==="source"||!y&&I==="target":C!==s||j!==a);S.isValid=J&&g(H),S.toHandle=_m(C,I,j,v,o,!0)}return S}const mu={onPointerDown:_1,isValid:Pm};function j1({domNode:t,panZoom:r,getTransform:o,getViewScale:s}){const a=Zt(t);function c({translateExtent:h,width:m,height:g,zoomStep:v=1,pannable:y=!0,zoomable:x=!0,inversePan:_=!1}){const E=C=>{if(C.sourceEvent.type!=="wheel"||!r)return;const j=o(),O=C.sourceEvent.ctrlKey&&ms()?10:1,A=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*v,H=j[2]*Math.pow(2,A*O);r.scaleTo(H)};let N=[0,0];const k=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(N=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},S=C=>{const j=o();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!r)return;const O=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],A=[O[0]-N[0],O[1]-N[1]];N=O;const H=s()*Math.max(j[2],Math.log(j[2]))*(_?-1:1),q={x:j[0]-A[0]*H,y:j[1]-A[1]*H},J=[[0,0],[m,g]];r.setViewportConstrained({x:q.x,y:q.y,zoom:j[2]},J,h)},I=tm().on("start",k).on("zoom",y?S:null).on("zoom.wheel",x?E:null);a.call(I,{})}function u(){a.on("zoom",null)}return{update:c,destroy:u,pointer:bn}}const la=t=>({x:t.x,y:t.y,zoom:t.k}),Gc=({x:t,y:r,zoom:o})=>oa.translate(t,r).scale(o),si=(t,r)=>t.target.closest(`.${r}`),Mm=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),b1=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Kc=(t,r=0,o=b1,s=()=>{})=>{const a=typeof r=="number"&&r>0;return a||s(),a?t.transition().duration(r).ease(o).on("end",s):t},Im=t=>{const r=t.ctrlKey&&ms()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function P1({zoomPanValues:t,noWheelClassName:r,d3Selection:o,d3Zoom:s,panOnScrollMode:a,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:h,onPanZoom:m,onPanZoomEnd:g}){return v=>{if(si(v,r))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const y=o.property("__zoom").k||1;if(v.ctrlKey&&u){const k=bn(v),S=Im(v),I=y*Math.pow(2,S);s.scaleTo(o,I,k,v);return}const x=v.deltaMode===1?20:1;let _=a===wo.Vertical?0:v.deltaX*x,E=a===wo.Horizontal?0:v.deltaY*x;!ms()&&v.shiftKey&&a!==wo.Vertical&&(_=v.deltaY*x,E=0),s.translateBy(o,-(_/y)*c,-(E/y)*c,{internal:!0});const N=la(o.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(m==null||m(v,N),t.panScrollTimeout=setTimeout(()=>{g==null||g(v,N),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(v,N))}}function M1({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:o}){return function(s,a){const c=s.type==="wheel",u=!r&&c&&!s.ctrlKey,h=si(s,t);if(s.ctrlKey&&c&&h&&s.preventDefault(),u||h)return null;s.preventDefault(),o.call(this,s,a)}}function I1({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:o}){return s=>{var c,u,h;if((c=s.sourceEvent)!=null&&c.internal)return;const a=la(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),o&&(o==null||o(s.sourceEvent,a))}}function T1({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:o,onTransformChange:s,onPanZoom:a}){return c=>{var u,h;t.usedRightMouseButton=!!(o&&Mm(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,la(c.transform)))}}function z1({zoomPanValues:t,panOnDrag:r,panOnScroll:o,onDraggingChange:s,onPanZoomEnd:a,onPaneContextMenu:c}){return u=>{var h;if(!((h=u.sourceEvent)!=null&&h.internal)&&(t.isZoomingOrPanning=!1,c&&Mm(r,t.mouseButton??0)&&!t.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),t.usedRightMouseButton=!1,s(!1),a)){const m=la(u.transform);t.prevViewport=m,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,m)},o?150:0)}}}function R1({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:o,panOnDrag:s,panOnScroll:a,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:h,noPanClassName:m,lib:g,connectionInProgress:v}){return y=>{var k;const x=t||r,_=o&&y.ctrlKey,E=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(si(y,`${g}-flow__node`)||si(y,`${g}-flow__edge`)))return!0;if(!s&&!x&&!a&&!c&&!o||u||v&&!E||si(y,h)&&E||si(y,m)&&(!E||a&&E&&!t)||!o&&y.ctrlKey&&E)return!1;if(!o&&y.type==="touchstart"&&((k=y.touches)==null?void 0:k.length)>1)return y.preventDefault(),!1;if(!x&&!a&&!_&&E||!s&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(s)&&!s.includes(y.button)&&y.type==="mousedown")return!1;const N=Array.isArray(s)&&s.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||E)&&N}}function A1({domNode:t,minZoom:r,maxZoom:o,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=tm().scaleExtent([r,o]).translateExtent(s),x=Zt(t).call(y);I({x:a.x,y:a.y,zoom:fi(a.zoom,r,o)},[[0,0],[v.width,v.height]],s);const _=x.on("wheel.zoom"),E=x.on("dblclick.zoom");y.wheelDelta(Im);function N(U,X){return x?new Promise(re=>{y==null||y.interpolate((X==null?void 0:X.interpolate)==="linear"?is:$l).transform(Kc(x,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>re(!0)),U)}):Promise.resolve(!1)}function k({noWheelClassName:U,noPanClassName:X,onPaneContextMenu:re,userSelectionActive:b,panOnScroll:K,panOnDrag:V,panOnScrollMode:G,panOnScrollSpeed:z,preventScrolling:R,zoomOnPinch:B,zoomOnScroll:M,zoomOnDoubleClick:$,zoomActivationKeyPressed:se,lib:oe,onTransformChange:de,connectionInProgress:fe,paneClickDistance:me,selectionOnDrag:te}){b&&!g.isZoomingOrPanning&&S();const pe=K&&!se&&!b;y.clickDistance(te?1/0:!Mn(me)||me<0?0:me);const _e=pe?P1({zoomPanValues:g,noWheelClassName:U,d3Selection:x,d3Zoom:y,panOnScrollMode:G,panOnScrollSpeed:z,zoomOnPinch:B,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:h}):M1({noWheelClassName:U,preventScrolling:R,d3ZoomHandler:_});if(x.on("wheel.zoom",_e,{passive:!1}),!b){const je=I1({zoomPanValues:g,onDraggingChange:m,onPanZoomStart:u});y.on("start",je);const Ee=T1({zoomPanValues:g,panOnDrag:V,onPaneContextMenu:!!re,onPanZoom:c,onTransformChange:de});y.on("zoom",Ee);const Ae=z1({zoomPanValues:g,panOnDrag:V,panOnScroll:K,onPaneContextMenu:re,onPanZoomEnd:h,onDraggingChange:m});y.on("end",Ae)}const be=R1({zoomActivationKeyPressed:se,panOnDrag:V,zoomOnScroll:M,panOnScroll:K,zoomOnDoubleClick:$,zoomOnPinch:B,userSelectionActive:b,noPanClassName:X,noWheelClassName:U,lib:oe,connectionInProgress:fe});y.filter(be),$?x.on("dblclick.zoom",E):x.on("dblclick.zoom",null)}function S(){y.on("zoom",null)}async function I(U,X,re){const b=Gc(U),K=y==null?void 0:y.constrain()(b,X,re);return K&&await N(K),new Promise(V=>V(K))}async function C(U,X){const re=Gc(U);return await N(re,X),new Promise(b=>b(re))}function j(U){if(x){const X=Gc(U),re=x.property("__zoom");(re.k!==U.zoom||re.x!==U.x||re.y!==U.y)&&(y==null||y.transform(x,X,null,{sync:!0}))}}function O(){const U=x?em(x.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function A(U,X){return x?new Promise(re=>{y==null||y.interpolate((X==null?void 0:X.interpolate)==="linear"?is:$l).scaleTo(Kc(x,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>re(!0)),U)}):Promise.resolve(!1)}function H(U,X){return x?new Promise(re=>{y==null||y.interpolate((X==null?void 0:X.interpolate)==="linear"?is:$l).scaleBy(Kc(x,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>re(!0)),U)}):Promise.resolve(!1)}function q(U){y==null||y.scaleExtent(U)}function J(U){y==null||y.translateExtent(U)}function ee(U){const X=!Mn(U)||U<0?0:U;y==null||y.clickDistance(X)}return{update:k,destroy:S,setViewport:C,setViewportConstrained:I,getViewport:O,scaleTo:A,scaleBy:H,setScaleExtent:q,setTranslateExtent:J,syncViewport:j,setClickDistance:ee}}var _o;(function(t){t.Line="line",t.Handle="handle"})(_o||(_o={}));const L1=["top-left","top-right","bottom-left","bottom-right"],D1=["top","right","bottom","left"];function $1({width:t,prevWidth:r,height:o,prevHeight:s,affectsX:a,affectsY:c}){const u=t-r,h=o-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 $h(t){const r=t.includes("right")||t.includes("left"),o=t.includes("bottom")||t.includes("top"),s=t.includes("left"),a=t.includes("top");return{isHorizontal:r,isVertical:o,affectsX:s,affectsY:a}}function $r(t,r){return Math.max(0,r-t)}function Or(t,r){return Math.max(0,t-r)}function zl(t,r,o){return Math.max(0,r-t,t-o)}function Oh(t,r){return t?!r:r}function O1(t,r,o,s,a,c,u,h){let{affectsX:m,affectsY:g}=r;const{isHorizontal:v,isVertical:y}=r,x=v&&y,{xSnapped:_,ySnapped:E}=o,{minWidth:N,maxWidth:k,minHeight:S,maxHeight:I}=s,{x:C,y:j,width:O,height:A,aspectRatio:H}=t;let q=Math.floor(v?_-t.pointerX:0),J=Math.floor(y?E-t.pointerY:0);const ee=O+(m?-q:q),U=A+(g?-J:J),X=-c[0]*O,re=-c[1]*A;let b=zl(ee,N,k),K=zl(U,S,I);if(u){let z=0,R=0;m&&q<0?z=$r(C+q+X,u[0][0]):!m&&q>0&&(z=Or(C+ee+X,u[1][0])),g&&J<0?R=$r(j+J+re,u[0][1]):!g&&J>0&&(R=Or(j+U+re,u[1][1])),b=Math.max(b,z),K=Math.max(K,R)}if(h){let z=0,R=0;m&&q>0?z=Or(C+q,h[0][0]):!m&&q<0&&(z=$r(C+ee,h[1][0])),g&&J>0?R=Or(j+J,h[0][1]):!g&&J<0&&(R=$r(j+U,h[1][1])),b=Math.max(b,z),K=Math.max(K,R)}if(a){if(v){const z=zl(ee/H,S,I)*H;if(b=Math.max(b,z),u){let R=0;!m&&!g||m&&!g&&x?R=Or(j+re+ee/H,u[1][1])*H:R=$r(j+re+(m?q:-q)/H,u[0][1])*H,b=Math.max(b,R)}if(h){let R=0;!m&&!g||m&&!g&&x?R=$r(j+ee/H,h[1][1])*H:R=Or(j+(m?q:-q)/H,h[0][1])*H,b=Math.max(b,R)}}if(y){const z=zl(U*H,N,k)/H;if(K=Math.max(K,z),u){let R=0;!m&&!g||g&&!m&&x?R=Or(C+U*H+X,u[1][0])/H:R=$r(C+(g?J:-J)*H+X,u[0][0])/H,K=Math.max(K,R)}if(h){let R=0;!m&&!g||g&&!m&&x?R=$r(C+U*H,h[1][0])/H:R=Or(C+(g?J:-J)*H,h[0][0])/H,K=Math.max(K,R)}}}J=J+(J<0?K:-K),q=q+(q<0?b:-b),a&&(x?ee>U*H?J=(Oh(m,g)?-q:q)/H:q=(Oh(m,g)?-J:J)*H:v?(J=q/H,g=m):(q=J*H,m=g));const V=m?C+q:C,G=g?j+J:j;return{width:O+(m?-q:q),height:A+(g?-J:J),x:c[0]*q*(m?-1:1)+V,y:c[1]*J*(g?-1:1)+G}}const Tm={width:0,height:0,x:0,y:0},F1={...Tm,pointerX:0,pointerY:0,aspectRatio:1};function H1(t){return[[0,0],[t.measured.width,t.measured.height]]}function V1(t,r,o){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=o[0]*c,m=o[1]*u;return[[s-h,a-m],[s+c-h,a+u-m]]}function B1({domNode:t,nodeId:r,getStoreItems:o,onChange:s,onEnd:a}){const c=Zt(t);let u={controlDirection:$h("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:_,onResize:E,onResizeEnd:N,shouldResize:k}){let S={...Tm},I={...F1};u={boundaries:v,resizeDirection:x,keepAspectRatio:y,controlDirection:$h(g)};let C,j=null,O=[],A,H,q,J=!1;const ee=Fp().on("start",U=>{const{nodeLookup:X,transform:re,snapGrid:b,snapToGrid:K,nodeOrigin:V,paneDomNode:G}=o();if(C=X.get(r),!C)return;j=(G==null?void 0:G.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:R}=ss(U.sourceEvent,{transform:re,snapGrid:b,snapToGrid:K,containerBounds:j});S={width:C.measured.width??0,height:C.measured.height??0,x:C.position.x??0,y:C.position.y??0},I={...S,pointerX:z,pointerY:R,aspectRatio:S.width/S.height},A=void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(A=X.get(C.parentId),H=A&&C.extent==="parent"?H1(A):void 0),O=[],q=void 0;for(const[B,M]of X)if(M.parentId===r&&(O.push({id:B,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const $=V1(M,C,M.origin??V);q?q=[[Math.min($[0][0],q[0][0]),Math.min($[0][1],q[0][1])],[Math.max($[1][0],q[1][0]),Math.max($[1][1],q[1][1])]]:q=$}_==null||_(U,{...S})}).on("drag",U=>{const{transform:X,snapGrid:re,snapToGrid:b,nodeOrigin:K}=o(),V=ss(U.sourceEvent,{transform:X,snapGrid:re,snapToGrid:b,containerBounds:j}),G=[];if(!C)return;const{x:z,y:R,width:B,height:M}=S,$={},se=C.origin??K,{width:oe,height:de,x:fe,y:me}=O1(I,u.controlDirection,V,u.boundaries,u.keepAspectRatio,se,H,q),te=oe!==B,pe=de!==M,_e=fe!==z&&te,be=me!==R&&pe;if(!_e&&!be&&!te&&!pe)return;if((_e||be||se[0]===1||se[1]===1)&&($.x=_e?fe:S.x,$.y=be?me:S.y,S.x=$.x,S.y=$.y,O.length>0)){const He=fe-z,Re=me-R;for(const Ue of O)Ue.position={x:Ue.position.x-He+se[0]*(oe-B),y:Ue.position.y-Re+se[1]*(de-M)},G.push(Ue)}if((te||pe)&&($.width=te&&(!u.resizeDirection||u.resizeDirection==="horizontal")?oe:S.width,$.height=pe&&(!u.resizeDirection||u.resizeDirection==="vertical")?de:S.height,S.width=$.width,S.height=$.height),A&&C.expandParent){const He=se[0]*($.width??0);$.x&&$.x<He&&(S.x=He,I.x=I.x-($.x-He));const Re=se[1]*($.height??0);$.y&&$.y<Re&&(S.y=Re,I.y=I.y-($.y-Re))}const je=$1({width:S.width,prevWidth:B,height:S.height,prevHeight:M,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ee={...S,direction:je};(k==null?void 0:k(U,Ee))!==!1&&(J=!0,E==null||E(U,Ee),s($,G))}).on("end",U=>{J&&(N==null||N(U,{...S}),a==null||a({...S}),J=!1)});c.call(ee)}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 Fh;function W1(){if(Fh)return Jc;Fh=1;var t=ys();function r(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var o=typeof Object.is=="function"?Object.is:r,s=t.useState,a=t.useEffect,c=t.useLayoutEffect,u=t.useDebugValue;function h(y,x){var _=x(),E=s({inst:{value:_,getSnapshot:x}}),N=E[0].inst,k=E[1];return c(function(){N.value=_,N.getSnapshot=x,m(N)&&k({inst:N})},[y,_,x]),a(function(){return m(N)&&k({inst:N}),y(function(){m(N)&&k({inst:N})})},[y]),u(_),_}function m(y){var x=y.getSnapshot;y=y.value;try{var _=x();return!o(y,_)}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 Hh;function U1(){return Hh||(Hh=1,Zc.exports=W1()),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 Y1(){if(Vh)return qc;Vh=1;var t=ys(),r=U1();function o(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var s=typeof Object.is=="function"?Object.is:o,a=r.useSyncExternalStore,c=t.useRef,u=t.useEffect,h=t.useMemo,m=t.useDebugValue;return qc.useSyncExternalStoreWithSelector=function(g,v,y,x,_){var E=c(null);if(E.current===null){var N={hasValue:!1,value:null};E.current=N}else N=E.current;E=h(function(){function S(A){if(!I){if(I=!0,C=A,A=x(A),_!==void 0&&N.hasValue){var H=N.value;if(_(H,A))return j=H}return j=A}if(H=j,s(C,A))return H;var q=x(A);return _!==void 0&&_(H,q)?(C=A,H):(C=A,j=q)}var I=!1,C,j,O=y===void 0?null:y;return[function(){return S(v())},O===null?void 0:function(){return S(O())}]},[v,y,x,_]);var k=a(g,E[0],E[1]);return u(function(){N.hasValue=!0,N.value=k},[k]),m(k),k},qc}var Bh;function X1(){return Bh||(Bh=1,Qc.exports=Y1()),Qc.exports}var G1=X1();const K1=vu(G1),Q1={},Wh=t=>{let r;const o=new Set,s=(v,y)=>{const x=typeof v=="function"?v(r):v;if(!Object.is(x,r)){const _=r;r=y??(typeof x!="object"||x===null)?x:Object.assign({},r,x),o.forEach(E=>E(r,_))}},a=()=>r,m={setState:s,getState:a,getInitialState:()=>g,subscribe:v=>(o.add(v),()=>o.delete(v)),destroy:()=>{(Q1?"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."),o.clear()}},g=r=t(s,a,m);return m},q1=t=>t?Wh(t):Wh,{useDebugValue:Z1}=Np,{useSyncExternalStoreWithSelector:J1}=K1,eS=t=>t;function zm(t,r=eS,o){const s=J1(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,o);return Z1(s),s}const Uh=(t,r)=>{const o=q1(t),s=(a,c=r)=>zm(o,a,c);return Object.assign(s,o),s},tS=(t,r)=>t?Uh(t,r):Uh;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 o=Object.keys(t);if(o.length!==Object.keys(r).length)return!1;for(const s of o)if(!Object.prototype.hasOwnProperty.call(r,s)||!Object.is(t[s],r[s]))return!1;return!0}Cp();const aa=P.createContext(null),nS=aa.Provider,Rm=Kn.error001();function $e(t,r){const o=P.useContext(aa);if(o===null)throw new Error(Rm);return zm(o,t,r)}function Je(){const t=P.useContext(aa);if(t===null)throw new Error(Rm);return P.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Yh={display:"none"},rS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Am="react-flow__node-desc",Lm="react-flow__edge-desc",oS="react-flow__aria-live",iS=t=>t.ariaLiveMessage,sS=t=>t.ariaLabelConfig;function lS({rfId:t}){const r=$e(iS);return f.jsx("div",{id:`${oS}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:rS,children:r})}function aS({rfId:t,disableKeyboardA11y:r}){const o=$e(sS);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${Am}-${t}`,style:Yh,children:r?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${Lm}-${t}`,style:Yh,children:o["edge.a11yDescription.default"]}),!r&&f.jsx(lS,{rfId:t})]})}const ca=P.forwardRef(({position:t="top-left",children:r,className:o,style:s,...a},c)=>{const u=`${t}`.split("-");return f.jsx("div",{className:ct(["react-flow__panel",o,...u]),style:s,ref:c,...a,children:r})});ca.displayName="Panel";function cS({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:f.jsx(ca,{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:f.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const uS=t=>{const r=[],o=[];for(const[,s]of t.nodeLookup)s.selected&&r.push(s.internals.userNode);for(const[,s]of t.edgeLookup)s.selected&&o.push(s);return{selectedNodes:r,selectedEdges:o}},Rl=t=>t.id;function dS(t,r){return Ze(t.selectedNodes.map(Rl),r.selectedNodes.map(Rl))&&Ze(t.selectedEdges.map(Rl),r.selectedEdges.map(Rl))}function fS({onSelectionChange:t}){const r=Je(),{selectedNodes:o,selectedEdges:s}=$e(uS,dS);return P.useEffect(()=>{const a={nodes:o,edges:s};t==null||t(a),r.getState().onSelectionChangeHandlers.forEach(c=>c(a))},[o,s,t]),null}const hS=t=>!!t.onSelectionChangeHandlers;function pS({onSelectionChange:t}){const r=$e(hS);return t||r?f.jsx(fS,{onSelectionChange:t}):null}const Dm=[0,0],mS={x:0,y:0,zoom:1},gS=["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"],Xh=[...gS,"rfId"],yS=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}),Gh={translateExtent:ds,nodeOrigin:Dm,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function vS(t){const{setNodes:r,setEdges:o,setMinZoom:s,setMaxZoom:a,setTranslateExtent:c,setNodeExtent:u,reset:h,setDefaultNodesAndEdges:m}=$e(yS,Ze),g=Je();P.useEffect(()=>(m(t.defaultNodes,t.defaultEdges),()=>{v.current=Gh,h()}),[]);const v=P.useRef(Gh);return P.useEffect(()=>{for(const y of Xh){const x=t[y],_=v.current[y];x!==_&&(typeof t[y]>"u"||(y==="nodes"?r(x):y==="edges"?o(x):y==="minZoom"?s(x):y==="maxZoom"?a(x):y==="translateExtent"?c(x):y==="nodeExtent"?u(x):y==="ariaLabelConfig"?g.setState({ariaLabelConfig:e1(x)}):y==="fitView"?g.setState({fitViewQueued:x}):y==="fitViewOptions"?g.setState({fitViewOptions:x}):g.setState({[y]:x})))}v.current=t},Xh.map(y=>t[y])),null}function Kh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function xS(t){var s;const[r,o]=P.useState(t==="system"?null:t);return P.useEffect(()=>{if(t!=="system"){o(t);return}const a=Kh(),c=()=>o(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=Kh())!=null&&s.matches?"dark":"light"}const Qh=typeof document<"u"?document:null;function gs(t=null,r={target:Qh,actInsideInputWithModifier:!0}){const[o,s]=P.useState(!1),a=P.useRef(!1),c=P.useRef(new Set([])),[u,h]=P.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 P.useEffect(()=>{const m=(r==null?void 0:r.target)??Qh,g=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const v=_=>{var k,S;if(a.current=_.ctrlKey||_.metaKey||_.shiftKey||_.altKey,(!a.current||a.current&&!g)&&pm(_))return!1;const N=Zh(_.code,h);if(c.current.add(_[N]),qh(u,c.current,!1)){const I=((S=(k=_.composedPath)==null?void 0:k.call(_))==null?void 0:S[0])||_.target,C=(I==null?void 0:I.nodeName)==="BUTTON"||(I==null?void 0:I.nodeName)==="A";r.preventDefault!==!1&&(a.current||!C)&&_.preventDefault(),s(!0)}},y=_=>{const E=Zh(_.code,h);qh(u,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(_[E]),_.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]),o}function qh(t,r,o){return t.filter(s=>o||s.length===r.size).some(s=>s.every(a=>r.has(a)))}function Zh(t,r){return r.includes(t)?"code":"key"}const wS=()=>{const t=Je();return P.useMemo(()=>({zoomIn:r=>{const{panZoom:o}=t.getState();return o?o.scaleBy(1.2,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:o}=t.getState();return o?o.scaleBy(1/1.2,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},zoomTo:(r,o)=>{const{panZoom:s}=t.getState();return s?s.scaleTo(r,{duration:o==null?void 0:o.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,o)=>{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},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,o,s]=t.getState().transform;return{x:r,y:o,zoom:s}},setCenter:async(r,o,s)=>t.getState().setCenter(r,o,s),fitBounds:async(r,o)=>{const{width:s,height:a,minZoom:c,maxZoom:u,panZoom:h}=t.getState(),m=bu(r,s,a,c,u,(o==null?void 0:o.padding)??.1);return h?(await h.setViewport(m,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,o={})=>{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=o.snapGrid??a,y=o.snapToGrid??c;return Es(g,s,y,v)},flowToScreenPosition:r=>{const{transform:o,domNode:s}=t.getState();if(!s)return r;const{x:a,y:c}=s.getBoundingClientRect(),u=Ql(r,o);return{x:u.x+a,y:u.y+c}}}),[])};function $m(t,r){const o=[],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){o.push(c);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){o.push({...u[0].item});continue}const h={...c};for(const m of u)SS(m,h);o.push(h)}return a.length&&a.forEach(c=>{c.index!==void 0?o.splice(c.index,0,{...c.item}):o.push({...c.item})}),o}function SS(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 Om(t,r){return $m(t,r)}function Fm(t,r){return $m(t,r)}function yo(t,r){return{id:t,type:"select",selected:r}}function li(t,r=new Set,o=!1){const s=[];for(const[a,c]of t){const u=r.has(a);!(c.selected===void 0&&!u)&&c.selected!==u&&(o&&(c.selected=u),s.push(yo(c.id,u)))}return s}function Jh({items:t=[],lookup:r}){var a;const o=[],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&&o.push({id:u.id,item:u,type:"replace"}),m===void 0&&o.push({item:u,type:"add",index:c})}for(const[c]of r)s.get(c)===void 0&&o.push({id:c,type:"remove"});return o}function ep(t){return{id:t.id,type:"remove"}}const tp=t=>Ww(t),kS=t=>sm(t);function Hm(t){return P.forwardRef(t)}const ES=typeof window<"u"?P.useLayoutEffect:P.useEffect;function np(t){const[r,o]=P.useState(BigInt(0)),[s]=P.useState(()=>NS(()=>o(a=>a+BigInt(1))));return ES(()=>{const a=s.get();a.length&&(t(a),s.reset())},[r]),s}function NS(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:o=>{r.push(o),t()}}}const Vm=P.createContext(null);function CS({children:t}){const r=Je(),o=P.useCallback(h=>{const{nodes:m=[],setNodes:g,hasDefaultNodes:v,onNodesChange:y,nodeLookup:x,fitViewQueued:_,onNodesChangeMiddlewareMap:E}=r.getState();let N=m;for(const S of h)N=typeof S=="function"?S(N):S;let k=Jh({items:N,lookup:x});for(const S of E.values())k=S(k);v&&g(N),k.length>0?y==null||y(k):_&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:I,setNodes:C}=r.getState();S&&C(I)})},[]),s=np(o),a=P.useCallback(h=>{const{edges:m=[],setEdges:g,hasDefaultEdges:v,onEdgesChange:y,edgeLookup:x}=r.getState();let _=m;for(const E of h)_=typeof E=="function"?E(_):E;v?g(_):y&&y(Jh({items:_,lookup:x}))},[]),c=np(a),u=P.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return f.jsx(Vm.Provider,{value:u,children:t})}function _S(){const t=P.useContext(Vm);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const jS=t=>!!t.panZoom;function Au(){const t=wS(),r=Je(),o=_S(),s=$e(jS),a=P.useMemo(()=>{const c=y=>r.getState().nodeLookup.get(y),u=y=>{o.nodeQueue.push(y)},h=y=>{o.edgeQueue.push(y)},m=y=>{var S,I;const{nodeLookup:x,nodeOrigin:_}=r.getState(),E=tp(y)?y:x.get(y.id),N=E.parentId?fm(E.position,E.measured,E.parentId,x,_):E.position,k={...E,position:N,width:((S=E.measured)==null?void 0:S.width)??E.width,height:((I=E.measured)==null?void 0:I.height)??E.height};return hi(k)},g=(y,x,_={replace:!1})=>{u(E=>E.map(N=>{if(N.id===y){const k=typeof x=="function"?x(N):x;return _.replace&&tp(k)?k:{...N,...k}}return N}))},v=(y,x,_={replace:!1})=>{h(E=>E.map(N=>{if(N.id===y){const k=typeof x=="function"?x(N):x;return _.replace&&kS(k)?k:{...N,...k}}return N}))};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];o.nodeQueue.push(_=>[..._,...x])},addEdges:y=>{const x=Array.isArray(y)?y:[y];o.edgeQueue.push(_=>[..._,...x])},toObject:()=>{const{nodes:y=[],edges:x=[],transform:_}=r.getState(),[E,N,k]=_;return{nodes:y.map(S=>({...S})),edges:x.map(S=>({...S})),viewport:{x:E,y:N,zoom:k}}},deleteElements:async({nodes:y=[],edges:x=[]})=>{const{nodes:_,edges:E,onNodesDelete:N,onEdgesDelete:k,triggerNodeChanges:S,triggerEdgeChanges:I,onDelete:C,onBeforeDelete:j}=r.getState(),{nodes:O,edges:A}=await Kw({nodesToRemove:y,edgesToRemove:x,nodes:_,edges:E,onBeforeDelete:j}),H=A.length>0,q=O.length>0;if(H){const J=A.map(ep);k==null||k(A),I(J)}if(q){const J=O.map(ep);N==null||N(O),S(J)}return(q||H)&&(C==null||C({nodes:O,edges:A})),{deletedNodes:O,deletedEdges:A}},getIntersectingNodes:(y,x=!0,_)=>{const E=jh(y),N=E?y:m(y),k=_!==void 0;return N?(_||r.getState().nodes).filter(S=>{const I=r.getState().nodeLookup.get(S.id);if(I&&!E&&(S.id===y.id||!I.internals.positionAbsolute))return!1;const C=hi(k?S:I),j=ps(C,N);return x&&j>0||j>=C.width*C.height||j>=N.width*N.height}):[]},isNodeIntersecting:(y,x,_=!0)=>{const N=jh(y)?y:m(y);if(!N)return!1;const k=ps(N,x);return _&&k>0||k>=x.width*x.height||k>=N.width*N.height},updateNode:g,updateNodeData:(y,x,_={replace:!1})=>{g(y,E=>{const N=typeof x=="function"?x(E):x;return _.replace?{...E,data:N}:{...E,data:{...E.data,...N}}},_)},updateEdge:v,updateEdgeData:(y,x,_={replace:!1})=>{v(y,E=>{const N=typeof x=="function"?x(E):x;return _.replace?{...E,data:N}:{...E,data:{...E.data,...N}}},_)},getNodesBounds:y=>{const{nodeLookup:x,nodeOrigin:_}=r.getState();return Uw(y,{nodeLookup:x,nodeOrigin:_})},getHandleConnections:({type:y,id:x,nodeId:_})=>{var E;return Array.from(((E=r.getState().connectionLookup.get(`${_}-${y}${x?`-${x}`:""}`))==null?void 0:E.values())??[])},getNodeConnections:({type:y,handleId:x,nodeId:_})=>{var E;return Array.from(((E=r.getState().connectionLookup.get(`${_}${y?x?`-${y}-${x}`:`-${y}`:""}`))==null?void 0:E.values())??[])},fitView:async y=>{const x=r.getState().fitViewResolver??Jw();return r.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:x}),o.nodeQueue.push(_=>[..._]),x.promise}}},[]);return P.useMemo(()=>({...a,...t,viewportInitialized:s}),[s])}const rp=t=>t.selected,bS=typeof window<"u"?window:void 0;function PS({deleteKeyCode:t,multiSelectionKeyCode:r}){const o=Je(),{deleteElements:s}=Au(),a=gs(t,{actInsideInputWithModifier:!1}),c=gs(r,{target:bS});P.useEffect(()=>{if(a){const{edges:u,nodes:h}=o.getState();s({nodes:h.filter(rp),edges:u.filter(rp)}),o.setState({nodesSelectionActive:!1})}},[a]),P.useEffect(()=>{o.setState({multiSelectionActive:c})},[c])}function MS(t){const r=Je();P.useEffect(()=>{const o=()=>{var a,c,u,h;if(!t.current||!(((c=(a=t.current).checkVisibility)==null?void 0:c.call(a))??!0))return!1;const s=Pu(t.current);(s.height===0||s.width===0)&&((h=(u=r.getState()).onError)==null||h.call(u,"004",Kn.error004())),r.setState({width:s.width||500,height:s.height||500})};if(t.current){o(),window.addEventListener("resize",o);const s=new ResizeObserver(()=>o());return s.observe(t.current),()=>{window.removeEventListener("resize",o),s&&t.current&&s.unobserve(t.current)}}},[])}const ua={position:"absolute",width:"100%",height:"100%",top:0,left:0},IS=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function TS({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:c=wo.Free,zoomOnDoubleClick:u=!0,panOnDrag:h=!0,defaultViewport:m,translateExtent:g,minZoom:v,maxZoom:y,zoomActivationKeyCode:x,preventScrolling:_=!0,children:E,noWheelClassName:N,noPanClassName:k,onViewportChange:S,isControlledViewport:I,paneClickDistance:C,selectionOnDrag:j}){const O=Je(),A=P.useRef(null),{userSelectionActive:H,lib:q,connectionInProgress:J}=$e(IS,Ze),ee=gs(x),U=P.useRef();MS(A);const X=P.useCallback(re=>{S==null||S({x:re[0],y:re[1],zoom:re[2]}),I||O.setState({transform:re})},[S,I]);return P.useEffect(()=>{if(A.current){U.current=A1({domNode:A.current,minZoom:v,maxZoom:y,translateExtent:g,viewport:m,onDraggingChange:V=>O.setState({paneDragging:V}),onPanZoomStart:(V,G)=>{const{onViewportChangeStart:z,onMoveStart:R}=O.getState();R==null||R(V,G),z==null||z(G)},onPanZoom:(V,G)=>{const{onViewportChange:z,onMove:R}=O.getState();R==null||R(V,G),z==null||z(G)},onPanZoomEnd:(V,G)=>{const{onViewportChangeEnd:z,onMoveEnd:R}=O.getState();R==null||R(V,G),z==null||z(G)}});const{x:re,y:b,zoom:K}=U.current.getViewport();return O.setState({panZoom:U.current,transform:[re,b,K],domNode:A.current.closest(".react-flow")}),()=>{var V;(V=U.current)==null||V.destroy()}}},[]),P.useEffect(()=>{var re;(re=U.current)==null||re.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:o,panOnScroll:s,panOnScrollSpeed:a,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:h,zoomActivationKeyPressed:ee,preventScrolling:_,noPanClassName:k,userSelectionActive:H,noWheelClassName:N,lib:q,onTransformChange:X,connectionInProgress:J,selectionOnDrag:j,paneClickDistance:C})},[t,r,o,s,a,c,u,h,ee,_,k,H,N,q,X,J,j,C]),f.jsx("div",{className:"react-flow__renderer",ref:A,style:ua,children:E})}const zS=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function RS(){const{userSelectionActive:t,userSelectionRect:r}=$e(zS,Ze);return t&&r?f.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)=>o=>{o.target===r.current&&(t==null||t(o))},AS=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function LS({isSelecting:t,selectionKeyPressed:r,selectionMode:o=fs.Full,panOnDrag:s,paneClickDistance:a,selectionOnDrag:c,onSelectionStart:u,onSelectionEnd:h,onPaneClick:m,onPaneContextMenu:g,onPaneScroll:v,onPaneMouseEnter:y,onPaneMouseMove:x,onPaneMouseLeave:_,children:E}){const N=Je(),{userSelectionActive:k,elementsSelectable:S,dragging:I,connectionInProgress:C}=$e(AS,Ze),j=S&&(t||k),O=P.useRef(null),A=P.useRef(),H=P.useRef(new Set),q=P.useRef(new Set),J=P.useRef(!1),ee=z=>{if(J.current||C){J.current=!1;return}m==null||m(z),N.getState().resetSelectedElements(),N.setState({nodesSelectionActive:!1})},U=z=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){z.preventDefault();return}g==null||g(z)},X=v?z=>v(z):void 0,re=z=>{J.current&&(z.stopPropagation(),J.current=!1)},b=z=>{var de,fe;const{domNode:R}=N.getState();if(A.current=R==null?void 0:R.getBoundingClientRect(),!A.current)return;const B=z.target===O.current;if(!B&&!!z.target.closest(".nokey")||!t||!(c&&B||r)||z.button!==0||!z.isPrimary)return;(fe=(de=z.target)==null?void 0:de.setPointerCapture)==null||fe.call(de,z.pointerId),J.current=!1;const{x:se,y:oe}=In(z.nativeEvent,A.current);N.setState({userSelectionRect:{width:0,height:0,startX:se,startY:oe,x:se,y:oe}}),B||(z.stopPropagation(),z.preventDefault())},K=z=>{const{userSelectionRect:R,transform:B,nodeLookup:M,edgeLookup:$,connectionLookup:se,triggerNodeChanges:oe,triggerEdgeChanges:de,defaultEdgeOptions:fe,resetSelectedElements:me}=N.getState();if(!A.current||!R)return;const{x:te,y:pe}=In(z.nativeEvent,A.current),{startX:_e,startY:be}=R;if(!J.current){const Re=r?0:a;if(Math.hypot(te-_e,pe-be)<=Re)return;me(),u==null||u(z)}J.current=!0;const je={startX:_e,startY:be,x:te<_e?te:_e,y:pe<be?pe:be,width:Math.abs(te-_e),height:Math.abs(pe-be)},Ee=H.current,Ae=q.current;H.current=new Set(ju(M,je,B,o===fs.Partial,!0).map(Re=>Re.id)),q.current=new Set;const He=(fe==null?void 0:fe.selectable)??!0;for(const Re of H.current){const Ue=se.get(Re);if(Ue)for(const{edgeId:st}of Ue.values()){const ht=$.get(st);ht&&(ht.selectable??He)&&q.current.add(st)}}if(!bh(Ee,H.current)){const Re=li(M,H.current,!0);oe(Re)}if(!bh(Ae,q.current)){const Re=li($,q.current);de(Re)}N.setState({userSelectionRect:je,userSelectionActive:!0,nodesSelectionActive:!1})},V=z=>{var R,B;z.button===0&&((B=(R=z.target)==null?void 0:R.releasePointerCapture)==null||B.call(R,z.pointerId),!k&&z.target===O.current&&N.getState().userSelectionRect&&(ee==null||ee(z)),N.setState({userSelectionActive:!1,userSelectionRect:null}),J.current&&(h==null||h(z),N.setState({nodesSelectionActive:H.current.size>0})))},G=s===!0||Array.isArray(s)&&s.includes(0);return f.jsxs("div",{className:ct(["react-flow__pane",{draggable:G,dragging:I,selection:t}]),onClick:j?void 0:eu(ee,O),onContextMenu:eu(U,O),onWheel:eu(X,O),onPointerEnter:j?void 0:y,onPointerMove:j?K:x,onPointerUp:j?V:void 0,onPointerDownCapture:j?b:void 0,onClickCapture:j?re:void 0,onPointerLeave:_,ref:O,style:ua,children:[E,f.jsx(RS,{})]})}function gu({id:t,store:r,unselect:o=!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",Kn.error012(t));return}r.setState({nodesSelectionActive:!1}),g.selected?(o||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 Bm({nodeRef:t,disabled:r=!1,noDragClassName:o,handleSelector:s,nodeId:a,isSelectable:c,nodeClickDistance:u}){const h=Je(),[m,g]=P.useState(!1),v=P.useRef();return P.useEffect(()=>{v.current=S1({getStoreItems:()=>h.getState(),onNodeMouseDown:y=>{gu({id:y,store:h,nodeRef:t})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),P.useEffect(()=>{var y,x;if(r)(y=v.current)==null||y.destroy();else if(t.current)return(x=v.current)==null||x.update({noDragClassName:o,handleSelector:s,domNode:t.current,isSelectable:c,nodeId:a,nodeClickDistance:u}),()=>{var _;(_=v.current)==null||_.destroy()}},[o,s,r,c,t,a]),m}const DS=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Wm(){const t=Je();return P.useCallback(o=>{const{nodeExtent:s,snapToGrid:a,snapGrid:c,nodesDraggable:u,onError:h,updateNodePositions:m,nodeLookup:g,nodeOrigin:v}=t.getState(),y=new Map,x=DS(u),_=a?c[0]:5,E=a?c[1]:5,N=o.direction.x*_*o.factor,k=o.direction.y*E*o.factor;for(const[,S]of g){if(!x(S))continue;let I={x:S.internals.positionAbsolute.x+N,y:S.internals.positionAbsolute.y+k};a&&(I=ks(I,c));const{position:C,positionAbsolute:j}=lm({nodeId:S.id,nextPosition:I,nodeLookup:g,nodeExtent:s,nodeOrigin:v,onError:h});S.position=C,S.internals.positionAbsolute=j,y.set(S.id,S)}m(y)},[])}const Lu=P.createContext(null),$S=Lu.Provider;Lu.Consumer;const Um=()=>P.useContext(Lu),OS=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),FS=(t,r,o)=>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)===o;return{connectingFrom:(h==null?void 0:h.nodeId)===t&&(h==null?void 0:h.id)===r&&(h==null?void 0:h.type)===o,connectingTo:v,clickConnecting:(a==null?void 0:a.nodeId)===t&&(a==null?void 0:a.id)===r&&(a==null?void 0:a.type)===o,isPossibleEndHandle:c===Eo.Strict?(h==null?void 0:h.type)!==o:t!==(h==null?void 0:h.nodeId)||r!==(h==null?void 0:h.id),connectionInProcess:!!h,clickConnectionInProcess:!!a,valid:v&&g}};function HS({type:t="source",position:r=Ce.Top,isValidConnection:o,isConnectable:s=!0,isConnectableStart:a=!0,isConnectableEnd:c=!0,id:u,onConnect:h,children:m,className:g,onMouseDown:v,onTouchStart:y,...x},_){var K,V;const E=u||null,N=t==="target",k=Je(),S=Um(),{connectOnClick:I,noPanClassName:C,rfId:j}=$e(OS,Ze),{connectingFrom:O,connectingTo:A,clickConnecting:H,isPossibleEndHandle:q,connectionInProcess:J,clickConnectionInProcess:ee,valid:U}=$e(FS(S,E,t),Ze);S||(V=(K=k.getState()).onError)==null||V.call(K,"010",Kn.error010());const X=G=>{const{defaultEdgeOptions:z,onConnect:R,hasDefaultEdges:B}=k.getState(),M={...z,...G};if(B){const{edges:$,setEdges:se}=k.getState();se(wm(M,$))}R==null||R(M),h==null||h(M)},re=G=>{if(!S)return;const z=mm(G.nativeEvent);if(a&&(z&&G.button===0||!z)){const R=k.getState();mu.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:R.autoPanOnConnect,connectionMode:R.connectionMode,connectionRadius:R.connectionRadius,domNode:R.domNode,nodeLookup:R.nodeLookup,lib:R.lib,isTarget:N,handleId:E,nodeId:S,flowId:R.rfId,panBy:R.panBy,cancelConnection:R.cancelConnection,onConnectStart:R.onConnectStart,onConnectEnd:R.onConnectEnd,updateConnection:R.updateConnection,onConnect:X,isValidConnection:o||R.isValidConnection,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:R.autoPanSpeed,dragThreshold:R.connectionDragThreshold})}z?v==null||v(G):y==null||y(G)},b=G=>{const{onClickConnectStart:z,onClickConnectEnd:R,connectionClickStartHandle:B,connectionMode:M,isValidConnection:$,lib:se,rfId:oe,nodeLookup:de,connection:fe}=k.getState();if(!S||!B&&!a)return;if(!B){z==null||z(G.nativeEvent,{nodeId:S,handleId:E,handleType:t}),k.setState({connectionClickStartHandle:{nodeId:S,type:t,id:E}});return}const me=hm(G.target),te=o||$,{connection:pe,isValid:_e}=mu.isValid(G.nativeEvent,{handle:{nodeId:S,id:E,type:t},connectionMode:M,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:te,flowId:oe,doc:me,lib:se,nodeLookup:de});_e&&pe&&X(pe);const be=structuredClone(fe);delete be.inProgress,be.toPosition=be.toHandle?be.toHandle.position:null,R==null||R(G,be),k.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":E,"data-nodeid":S,"data-handlepos":r,"data-id":`${j}-${S}-${E}-${t}`,className:ct(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",C,g,{source:!N,target:N,connectable:s,connectablestart:a,connectableend:c,clickconnecting:H,connectingfrom:O,connectingto:A,valid:U,connectionindicator:s&&(!J||q)&&(J||ee?c:a)}]),onMouseDown:re,onTouchStart:re,onClick:I?b:void 0,ref:_,...x,children:m})}const Hr=P.memo(Hm(HS));function VS({data:t,isConnectable:r,sourcePosition:o=Ce.Bottom}){return f.jsxs(f.Fragment,{children:[t==null?void 0:t.label,f.jsx(Hr,{type:"source",position:o,isConnectable:r})]})}function BS({data:t,isConnectable:r,targetPosition:o=Ce.Top,sourcePosition:s=Ce.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Hr,{type:"target",position:o,isConnectable:r}),t==null?void 0:t.label,f.jsx(Hr,{type:"source",position:s,isConnectable:r})]})}function WS(){return null}function US({data:t,isConnectable:r,targetPosition:o=Ce.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Hr,{type:"target",position:o,isConnectable:r}),t==null?void 0:t.label]})}const ql={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},op={input:VS,default:BS,output:US,group:WS};function YS(t){var r,o,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??((o=t.style)==null?void 0:o.height)}:{width:t.width??((s=t.style)==null?void 0:s.width),height:t.height??((a=t.style)==null?void 0:a.height)}}const XS=t=>{const{width:r,height:o,x:s,y:a}=Ss(t.nodeLookup,{filter:c=>!!c.selected});return{width:Mn(r)?r:null,height:Mn(o)?o:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${a}px)`}};function GS({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:o}){const s=Je(),{width:a,height:c,transformString:u,userSelectionActive:h}=$e(XS,Ze),m=Wm(),g=P.useRef(null);if(P.useEffect(()=>{var x;o||(x=g.current)==null||x.focus({preventScroll:!0})},[o]),Bm({nodeRef:g}),h||!a||!c)return null;const v=t?x=>{const _=s.getState().nodes.filter(E=>E.selected);t(x,_)}:void 0,y=x=>{Object.prototype.hasOwnProperty.call(ql,x.key)&&(x.preventDefault(),m({direction:ql[x.key],factor:x.shiftKey?4:1}))};return f.jsx("div",{className:ct(["react-flow__nodesselection","react-flow__container",r]),style:{transform:u},children:f.jsx("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:v,tabIndex:o?void 0:-1,onKeyDown:o?void 0:y,style:{width:a,height:c}})})}const ip=typeof window<"u"?window:void 0,KS=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Ym({children:t,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:h,deleteKeyCode:m,selectionKeyCode:g,selectionOnDrag:v,selectionMode:y,onSelectionStart:x,onSelectionEnd:_,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:k,elementsSelectable:S,zoomOnScroll:I,zoomOnPinch:C,panOnScroll:j,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:q,defaultViewport:J,translateExtent:ee,minZoom:U,maxZoom:X,preventScrolling:re,onSelectionContextMenu:b,noWheelClassName:K,noPanClassName:V,disableKeyboardA11y:G,onViewportChange:z,isControlledViewport:R}){const{nodesSelectionActive:B,userSelectionActive:M}=$e(KS,Ze),$=gs(g,{target:ip}),se=gs(N,{target:ip}),oe=se||q,de=se||j,fe=v&&oe!==!0,me=$||M||fe;return PS({deleteKeyCode:m,multiSelectionKeyCode:E}),f.jsx(TS,{onPaneContextMenu:c,elementsSelectable:S,zoomOnScroll:I,zoomOnPinch:C,panOnScroll:de,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:!$&&oe,defaultViewport:J,translateExtent:ee,minZoom:U,maxZoom:X,zoomActivationKeyCode:k,preventScrolling:re,noWheelClassName:K,noPanClassName:V,onViewportChange:z,isControlledViewport:R,paneClickDistance:h,selectionOnDrag:fe,children:f.jsxs(LS,{onSelectionStart:x,onSelectionEnd:_,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:oe,isSelecting:!!me,selectionMode:y,selectionKeyPressed:$,paneClickDistance:h,selectionOnDrag:fe,children:[t,B&&f.jsx(GS,{onSelectionContextMenu:b,noPanClassName:V,disableKeyboardA11y:G})]})})}Ym.displayName="FlowRenderer";const QS=P.memo(Ym),qS=t=>r=>t?ju(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(o=>o.id):Array.from(r.nodeLookup.keys());function ZS(t){return $e(P.useCallback(qS(t),[t]),Ze)}const JS=t=>t.updateNodeInternals;function ek(){const t=$e(JS),[r]=P.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const s=new Map;o.forEach(a=>{const c=a.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:a.target,force:!0})}),t(s)}));return P.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function tk({node:t,nodeType:r,hasDimensions:o,resizeObserver:s}){const a=Je(),c=P.useRef(null),u=P.useRef(null),h=P.useRef(t.sourcePosition),m=P.useRef(t.targetPosition),g=P.useRef(r),v=o&&!!t.internals.handleBounds;return P.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]),P.useEffect(()=>()=>{u.current&&(s==null||s.unobserve(u.current),u.current=null)},[]),P.useEffect(()=>{if(c.current){const y=g.current!==r,x=h.current!==t.sourcePosition,_=m.current!==t.targetPosition;(y||x||_)&&(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 nk({id:t,onClick:r,onMouseEnter:o,onMouseMove:s,onMouseLeave:a,onContextMenu:c,onDoubleClick:u,nodesDraggable:h,elementsSelectable:m,nodesConnectable:g,nodesFocusable:v,resizeObserver:y,noDragClassName:x,noPanClassName:_,disableKeyboardA11y:E,rfId:N,nodeTypes:k,nodeClickDistance:S,onError:I}){const{node:C,internals:j,isParent:O}=$e(te=>{const pe=te.nodeLookup.get(t),_e=te.parentLookup.has(t);return{node:pe,internals:pe.internals,isParent:_e}},Ze);let A=C.type||"default",H=(k==null?void 0:k[A])||op[A];H===void 0&&(I==null||I("003",Kn.error003(A)),A="default",H=(k==null?void 0:k.default)||op.default);const q=!!(C.draggable||h&&typeof C.draggable>"u"),J=!!(C.selectable||m&&typeof C.selectable>"u"),ee=!!(C.connectable||g&&typeof C.connectable>"u"),U=!!(C.focusable||v&&typeof C.focusable>"u"),X=Je(),re=dm(C),b=tk({node:C,nodeType:A,hasDimensions:re,resizeObserver:y}),K=Bm({nodeRef:b,disabled:C.hidden||!q,noDragClassName:x,handleSelector:C.dragHandle,nodeId:t,isSelectable:J,nodeClickDistance:S}),V=Wm();if(C.hidden)return null;const G=hr(C),z=YS(C),R=J||q||r||o||s||a,B=o?te=>o(te,{...j.userNode}):void 0,M=s?te=>s(te,{...j.userNode}):void 0,$=a?te=>a(te,{...j.userNode}):void 0,se=c?te=>c(te,{...j.userNode}):void 0,oe=u?te=>u(te,{...j.userNode}):void 0,de=te=>{const{selectNodesOnDrag:pe,nodeDragThreshold:_e}=X.getState();J&&(!pe||!q||_e>0)&&gu({id:t,store:X,nodeRef:b}),r&&r(te,{...j.userNode})},fe=te=>{if(!(pm(te.nativeEvent)||E)){if(nm.includes(te.key)&&J){const pe=te.key==="Escape";gu({id:t,store:X,unselect:pe,nodeRef:b})}else if(q&&C.selected&&Object.prototype.hasOwnProperty.call(ql,te.key)){te.preventDefault();const{ariaLabelConfig:pe}=X.getState();X.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),V({direction:ql[te.key],factor:te.shiftKey?4:1})}}},me=()=>{var Ae;if(E||!((Ae=b.current)!=null&&Ae.matches(":focus-visible")))return;const{transform:te,width:pe,height:_e,autoPanOnNodeFocus:be,setCenter:je}=X.getState();if(!be)return;ju(new Map([[t,C]]),{x:0,y:0,width:pe,height:_e},te,!0).length>0||je(C.position.x+G.width/2,C.position.y+G.height/2,{zoom:te[2]})};return f.jsx("div",{className:ct(["react-flow__node",`react-flow__node-${A}`,{[_]:q},C.className,{selected:C.selected,selectable:J,parent:O,draggable:q,dragging:K}]),ref:b,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:R?"all":"none",visibility:re?"visible":"hidden",...C.style,...z},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:B,onMouseMove:M,onMouseLeave:$,onContextMenu:se,onClick:de,onDoubleClick:oe,onKeyDown:U?fe:void 0,tabIndex:U?0:void 0,onFocus:U?me:void 0,role:C.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${Am}-${N}`,"aria-label":C.ariaLabel,...C.domAttributes,children:f.jsx($S,{value:t,children:f.jsx(H,{id:t,data:C.data,type:A,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:C.selected??!1,selectable:J,draggable:q,deletable:C.deletable??!0,isConnectable:ee,sourcePosition:C.sourcePosition,targetPosition:C.targetPosition,dragging:K,dragHandle:C.dragHandle,zIndex:j.z,parentId:C.parentId,...G})})})}var rk=P.memo(nk);const ok=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Xm(t){const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:s,elementsSelectable:a,onError:c}=$e(ok,Ze),u=ZS(t.onlyRenderVisibleElements),h=ek();return f.jsx("div",{className:"react-flow__nodes",style:ua,children:u.map(m=>f.jsx(rk,{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:o,nodesFocusable:s,elementsSelectable:a,nodeClickDistance:t.nodeClickDistance,onError:c},m))})}Xm.displayName="NodeRenderer";const ik=P.memo(Xm);function sk(t){return $e(P.useCallback(o=>{if(!t)return o.edges.map(a=>a.id);const s=[];if(o.width&&o.height)for(const a of o.edges){const c=o.nodeLookup.get(a.source),u=o.nodeLookup.get(a.target);c&&u&&r1({sourceNode:c,targetNode:u,width:o.width,height:o.height,transform:o.transform})&&s.push(a.id)}return s},[t]),Ze)}const lk=({color:t="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...t&&{stroke:t}};return f.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},ak=({color:t="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...t&&{stroke:t,fill:t}};return f.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},sp={[hs.Arrow]:lk,[hs.ArrowClosed]:ak};function ck(t){const r=Je();return P.useMemo(()=>{var a,c;return Object.prototype.hasOwnProperty.call(sp,t)?sp[t]:((c=(a=r.getState()).onError)==null||c.call(a,"009",Kn.error009(t)),null)},[t])}const uk=({id:t,type:r,color:o,width:s=12.5,height:a=12.5,markerUnits:c="strokeWidth",strokeWidth:u,orient:h="auto-start-reverse"})=>{const m=ck(r);return m?f.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:f.jsx(m,{color:o,strokeWidth:u})}):null},Gm=({defaultColor:t,rfId:r})=>{const o=$e(c=>c.edges),s=$e(c=>c.defaultEdgeOptions),a=P.useMemo(()=>u1(o,{id:r,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[o,s,r,t]);return a.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:a.map(c=>f.jsx(uk,{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};Gm.displayName="MarkerDefinitions";var dk=P.memo(Gm);function Km({x:t,y:r,label:o,labelStyle:s,labelShowBg:a=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:h=2,children:m,className:g,...v}){const[y,x]=P.useState({x:1,y:0,width:0,height:0}),_=ct(["react-flow__edge-textwrapper",g]),E=P.useRef(null);return P.useEffect(()=>{if(E.current){const N=E.current.getBBox();x({x:N.x,y:N.y,width:N.width,height:N.height})}},[o]),o?f.jsxs("g",{transform:`translate(${t-y.width/2} ${r-y.height/2})`,className:_,visibility:y.width?"visible":"hidden",...v,children:[a&&f.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}),f.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:E,style:s,children:o}),m]}):null}Km.displayName="EdgeText";const fk=P.memo(Km);function da({path:t,labelX:r,labelY:o,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m,interactionWidth:g=20,...v}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...v,d:t,fill:"none",className:ct(["react-flow__edge-path",v.className])}),g?f.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,s&&Mn(r)&&Mn(o)?f.jsx(fk,{x:r,y:o,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:h,labelBgBorderRadius:m}):null]})}function lp({pos:t,x1:r,y1:o,x2:s,y2:a}){return t===Ce.Left||t===Ce.Right?[.5*(r+s),o]:[r,.5*(o+a)]}function Qm({sourceX:t,sourceY:r,sourcePosition:o=Ce.Bottom,targetX:s,targetY:a,targetPosition:c=Ce.Top}){const[u,h]=lp({pos:o,x1:t,y1:r,x2:s,y2:a}),[m,g]=lp({pos:c,x1:s,y1:a,x2:t,y2:r}),[v,y,x,_]=gm({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,_]}function qm(t){return P.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:c,sourcePosition:u,targetPosition:h,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:_,style:E,markerEnd:N,markerStart:k,interactionWidth:S})=>{const[I,C,j]=Qm({sourceX:o,sourceY:s,sourcePosition:u,targetX:a,targetY:c,targetPosition:h}),O=t.isInternal?void 0:r;return f.jsx(da,{id:O,path:I,labelX:C,labelY:j,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:_,style:E,markerEnd:N,markerStart:k,interactionWidth:S})})}const hk=qm({isInternal:!1}),Zm=qm({isInternal:!0});hk.displayName="SimpleBezierEdge";Zm.displayName="SimpleBezierEdgeInternal";function Jm(t){return P.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:c,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,sourcePosition:_=Ce.Bottom,targetPosition:E=Ce.Top,markerEnd:N,markerStart:k,pathOptions:S,interactionWidth:I})=>{const[C,j,O]=fu({sourceX:o,sourceY:s,sourcePosition:_,targetX:a,targetY:c,targetPosition:E,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),A=t.isInternal?void 0:r;return f.jsx(da,{id:A,path:C,labelX:j,labelY:O,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:N,markerStart:k,interactionWidth:I})})}const eg=Jm({isInternal:!1}),tg=Jm({isInternal:!0});eg.displayName="SmoothStepEdge";tg.displayName="SmoothStepEdgeInternal";function ng(t){return P.memo(({id:r,...o})=>{var a;const s=t.isInternal?void 0:r;return f.jsx(eg,{...o,id:s,pathOptions:P.useMemo(()=>{var c;return{borderRadius:0,offset:(c=o.pathOptions)==null?void 0:c.offset}},[(a=o.pathOptions)==null?void 0:a.offset])})})}const pk=ng({isInternal:!1}),rg=ng({isInternal:!0});pk.displayName="StepEdge";rg.displayName="StepEdgeInternal";function og(t){return P.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:c,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:_,markerStart:E,interactionWidth:N})=>{const[k,S,I]=Sm({sourceX:o,sourceY:s,targetX:a,targetY:c}),C=t.isInternal?void 0:r;return f.jsx(da,{id:C,path:k,labelX:S,labelY:I,label:u,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:_,markerStart:E,interactionWidth:N})})}const mk=og({isInternal:!1}),ig=og({isInternal:!0});mk.displayName="StraightEdge";ig.displayName="StraightEdgeInternal";function sg(t){return P.memo(({id:r,sourceX:o,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:_,style:E,markerEnd:N,markerStart:k,pathOptions:S,interactionWidth:I})=>{const[C,j,O]=ym({sourceX:o,sourceY:s,sourcePosition:u,targetX:a,targetY:c,targetPosition:h,curvature:S==null?void 0:S.curvature}),A=t.isInternal?void 0:r;return f.jsx(da,{id:A,path:C,labelX:j,labelY:O,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:_,style:E,markerEnd:N,markerStart:k,interactionWidth:I})})}const gk=sg({isInternal:!1}),lg=sg({isInternal:!0});gk.displayName="BezierEdge";lg.displayName="BezierEdgeInternal";const ap={default:lg,straight:ig,step:rg,smoothstep:tg,simplebezier:Zm},cp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},yk=(t,r,o)=>o===Ce.Left?t-r:o===Ce.Right?t+r:t,vk=(t,r,o)=>o===Ce.Top?t-r:o===Ce.Bottom?t+r:t,up="react-flow__edgeupdater";function dp({position:t,centerX:r,centerY:o,radius:s=10,onMouseDown:a,onMouseEnter:c,onMouseOut:u,type:h}){return f.jsx("circle",{onMouseDown:a,onMouseEnter:c,onMouseOut:u,className:ct([up,`${up}-${h}`]),cx:yk(r,s,t),cy:vk(o,s,t),r:s,stroke:"transparent",fill:"transparent"})}function xk({isReconnectable:t,reconnectRadius:r,edge:o,sourceX:s,sourceY:a,targetX:c,targetY:u,sourcePosition:h,targetPosition:m,onReconnect:g,onReconnectStart:v,onReconnectEnd:y,setReconnecting:x,setUpdateHover:_}){const E=Je(),N=(j,O)=>{if(j.button!==0)return;const{autoPanOnConnect:A,domNode:H,isValidConnection:q,connectionMode:J,connectionRadius:ee,lib:U,onConnectStart:X,onConnectEnd:re,cancelConnection:b,nodeLookup:K,rfId:V,panBy:G,updateConnection:z}=E.getState(),R=O.type==="target",B=(se,oe)=>{x(!1),y==null||y(se,o,O.type,oe)},M=se=>g==null?void 0:g(o,se),$=(se,oe)=>{x(!0),v==null||v(j,o,O.type),X==null||X(se,oe)};mu.onPointerDown(j.nativeEvent,{autoPanOnConnect:A,connectionMode:J,connectionRadius:ee,domNode:H,handleId:O.id,nodeId:O.nodeId,nodeLookup:K,isTarget:R,edgeUpdaterType:O.type,lib:U,flowId:V,cancelConnection:b,panBy:G,isValidConnection:q,onConnect:M,onConnectStart:$,onConnectEnd:re,onReconnectEnd:B,updateConnection:z,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:j.currentTarget})},k=j=>N(j,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),S=j=>N(j,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),I=()=>_(!0),C=()=>_(!1);return f.jsxs(f.Fragment,{children:[(t===!0||t==="source")&&f.jsx(dp,{position:h,centerX:s,centerY:a,radius:r,onMouseDown:k,onMouseEnter:I,onMouseOut:C,type:"source"}),(t===!0||t==="target")&&f.jsx(dp,{position:m,centerX:c,centerY:u,radius:r,onMouseDown:S,onMouseEnter:I,onMouseOut:C,type:"target"})]})}function wk({id:t,edgesFocusable:r,edgesReconnectable:o,elementsSelectable:s,onClick:a,onDoubleClick:c,onContextMenu:u,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:_,rfId:E,edgeTypes:N,noPanClassName:k,onError:S,disableKeyboardA11y:I}){let C=$e(je=>je.edgeLookup.get(t));const j=$e(je=>je.defaultEdgeOptions);C=j?{...j,...C}:C;let O=C.type||"default",A=(N==null?void 0:N[O])||ap[O];A===void 0&&(S==null||S("011",Kn.error011(O)),O="default",A=(N==null?void 0:N.default)||ap.default);const H=!!(C.focusable||r&&typeof C.focusable>"u"),q=typeof y<"u"&&(C.reconnectable||o&&typeof C.reconnectable>"u"),J=!!(C.selectable||s&&typeof C.selectable>"u"),ee=P.useRef(null),[U,X]=P.useState(!1),[re,b]=P.useState(!1),K=Je(),{zIndex:V,sourceX:G,sourceY:z,targetX:R,targetY:B,sourcePosition:M,targetPosition:$}=$e(P.useCallback(je=>{const Ee=je.nodeLookup.get(C.source),Ae=je.nodeLookup.get(C.target);if(!Ee||!Ae)return{zIndex:C.zIndex,...cp};const He=c1({id:t,sourceNode:Ee,targetNode:Ae,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:je.connectionMode,onError:S});return{zIndex:n1({selected:C.selected,zIndex:C.zIndex,sourceNode:Ee,targetNode:Ae,elevateOnSelect:je.elevateEdgesOnSelect,zIndexMode:je.zIndexMode}),...He||cp}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),Ze),se=P.useMemo(()=>C.markerStart?`url('#${hu(C.markerStart,E)}')`:void 0,[C.markerStart,E]),oe=P.useMemo(()=>C.markerEnd?`url('#${hu(C.markerEnd,E)}')`:void 0,[C.markerEnd,E]);if(C.hidden||G===null||z===null||R===null||B===null)return null;const de=je=>{var Re;const{addSelectedEdges:Ee,unselectNodesAndEdges:Ae,multiSelectionActive:He}=K.getState();J&&(K.setState({nodesSelectionActive:!1}),C.selected&&He?(Ae({nodes:[],edges:[C]}),(Re=ee.current)==null||Re.blur()):Ee([t])),a&&a(je,C)},fe=c?je=>{c(je,{...C})}:void 0,me=u?je=>{u(je,{...C})}:void 0,te=h?je=>{h(je,{...C})}:void 0,pe=m?je=>{m(je,{...C})}:void 0,_e=g?je=>{g(je,{...C})}:void 0,be=je=>{var Ee;if(!I&&nm.includes(je.key)&&J){const{unselectNodesAndEdges:Ae,addSelectedEdges:He}=K.getState();je.key==="Escape"?((Ee=ee.current)==null||Ee.blur(),Ae({edges:[C]})):He([t])}};return f.jsx("svg",{style:{zIndex:V},children:f.jsxs("g",{className:ct(["react-flow__edge",`react-flow__edge-${O}`,C.className,k,{selected:C.selected,animated:C.animated,inactive:!J&&!a,updating:U,selectable:J}]),onClick:de,onDoubleClick:fe,onContextMenu:me,onMouseEnter:te,onMouseMove:pe,onMouseLeave:_e,onKeyDown:H?be:void 0,tabIndex:H?0:void 0,role:C.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":H?`${Lm}-${E}`:void 0,ref:ee,...C.domAttributes,children:[!re&&f.jsx(A,{id:t,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:J,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:G,sourceY:z,targetX:R,targetY:B,sourcePosition:M,targetPosition:$,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:se,markerEnd:oe,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),q&&f.jsx(xk,{edge:C,isReconnectable:q,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:_,sourceX:G,sourceY:z,targetX:R,targetY:B,sourcePosition:M,targetPosition:$,setUpdateHover:X,setReconnecting:b})]})})}var Sk=P.memo(wk);const kk=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function ag({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:o,edgeTypes:s,noPanClassName:a,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:h,onEdgeMouseMove:m,onEdgeMouseLeave:g,onEdgeClick:v,reconnectRadius:y,onEdgeDoubleClick:x,onReconnectStart:_,onReconnectEnd:E,disableKeyboardA11y:N}){const{edgesFocusable:k,edgesReconnectable:S,elementsSelectable:I,onError:C}=$e(kk,Ze),j=sk(r);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dk,{defaultColor:t,rfId:o}),j.map(O=>f.jsx(Sk,{id:O,edgesFocusable:k,edgesReconnectable:S,elementsSelectable:I,noPanClassName:a,onReconnect:c,onContextMenu:u,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,onClick:v,reconnectRadius:y,onDoubleClick:x,onReconnectStart:_,onReconnectEnd:E,rfId:o,onError:C,edgeTypes:s,disableKeyboardA11y:N},O))]})}ag.displayName="EdgeRenderer";const Ek=P.memo(ag),Nk=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function Ck({children:t}){const r=$e(Nk);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function _k(t){const r=Au(),o=P.useRef(!1);P.useEffect(()=>{!o.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),o.current=!0)},[t,r.viewportInitialized])}const jk=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function bk(t){const r=$e(jk),o=Je();return P.useEffect(()=>{t&&(r==null||r(t),o.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function Pk(t){return t.connection.inProgress?{...t.connection,to:Es(t.connection.to,t.transform)}:{...t.connection}}function Mk(t){return Pk}function Ik(t){const r=Mk();return $e(r,Ze)}const Tk=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function zk({containerStyle:t,style:r,type:o,component:s}){const{nodesConnectable:a,width:c,height:u,isValid:h,inProgress:m}=$e(Tk,Ze);return!(c&&a&&m)?null:f.jsx("svg",{style:t,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:ct(["react-flow__connection",im(h)]),children:f.jsx(cg,{style:r,type:o,CustomComponent:s,isValid:h})})})}const cg=({style:t,type:r=Fr.Bezier,CustomComponent:o,isValid:s})=>{const{inProgress:a,from:c,fromNode:u,fromHandle:h,fromPosition:m,to:g,toNode:v,toHandle:y,toPosition:x,pointer:_}=Ik();if(!a)return;if(o)return f.jsx(o,{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:im(s),toNode:v,toHandle:y,pointer:_});let E="";const N={sourceX:c.x,sourceY:c.y,sourcePosition:m,targetX:g.x,targetY:g.y,targetPosition:x};switch(r){case Fr.Bezier:[E]=ym(N);break;case Fr.SimpleBezier:[E]=Qm(N);break;case Fr.Step:[E]=fu({...N,borderRadius:0});break;case Fr.SmoothStep:[E]=fu(N);break;default:[E]=Sm(N)}return f.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:t})};cg.displayName="ConnectionLine";const Rk={};function fp(t=Rk){P.useRef(t),Je(),P.useEffect(()=>{},[t])}function Ak(){Je(),P.useRef(!1),P.useEffect(()=>{},[])}function ug({nodeTypes:t,edgeTypes:r,onInit:o,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:v,onSelectionContextMenu:y,onSelectionStart:x,onSelectionEnd:_,connectionLineType:E,connectionLineStyle:N,connectionLineComponent:k,connectionLineContainerStyle:S,selectionKeyCode:I,selectionOnDrag:C,selectionMode:j,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:H,deleteKeyCode:q,onlyRenderVisibleElements:J,elementsSelectable:ee,defaultViewport:U,translateExtent:X,minZoom:re,maxZoom:b,preventScrolling:K,defaultMarkerColor:V,zoomOnScroll:G,zoomOnPinch:z,panOnScroll:R,panOnScrollSpeed:B,panOnScrollMode:M,zoomOnDoubleClick:$,panOnDrag:se,onPaneClick:oe,onPaneMouseEnter:de,onPaneMouseMove:fe,onPaneMouseLeave:me,onPaneScroll:te,onPaneContextMenu:pe,paneClickDistance:_e,nodeClickDistance:be,onEdgeContextMenu:je,onEdgeMouseEnter:Ee,onEdgeMouseMove:Ae,onEdgeMouseLeave:He,reconnectRadius:Re,onReconnect:Ue,onReconnectStart:st,onReconnectEnd:ht,noDragClassName:vt,noWheelClassName:pt,noPanClassName:pn,disableKeyboardA11y:zn,nodeExtent:xt,rfId:Rn,viewport:en,onViewportChange:mn}){return fp(t),fp(r),Ak(),_k(o),bk(en),f.jsx(QS,{onPaneClick:oe,onPaneMouseEnter:de,onPaneMouseMove:fe,onPaneMouseLeave:me,onPaneContextMenu:pe,onPaneScroll:te,paneClickDistance:_e,deleteKeyCode:q,selectionKeyCode:I,selectionOnDrag:C,selectionMode:j,onSelectionStart:x,onSelectionEnd:_,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:H,elementsSelectable:ee,zoomOnScroll:G,zoomOnPinch:z,zoomOnDoubleClick:$,panOnScroll:R,panOnScrollSpeed:B,panOnScrollMode:M,panOnDrag:se,defaultViewport:U,translateExtent:X,minZoom:re,maxZoom:b,onSelectionContextMenu:y,preventScrolling:K,noDragClassName:vt,noWheelClassName:pt,noPanClassName:pn,disableKeyboardA11y:zn,onViewportChange:mn,isControlledViewport:!!en,children:f.jsxs(Ck,{children:[f.jsx(Ek,{edgeTypes:r,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:Ue,onReconnectStart:st,onReconnectEnd:ht,onlyRenderVisibleElements:J,onEdgeContextMenu:je,onEdgeMouseEnter:Ee,onEdgeMouseMove:Ae,onEdgeMouseLeave:He,reconnectRadius:Re,defaultMarkerColor:V,noPanClassName:pn,disableKeyboardA11y:zn,rfId:Rn}),f.jsx(zk,{style:N,type:E,component:k,containerStyle:S}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(ik,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:v,nodeClickDistance:be,onlyRenderVisibleElements:J,noPanClassName:pn,noDragClassName:vt,disableKeyboardA11y:zn,nodeExtent:xt,rfId:Rn}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}ug.displayName="GraphView";const Lk=P.memo(ug),hp=({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,width:a,height:c,fitView:u,fitViewOptions:h,minZoom:m=.5,maxZoom:g=2,nodeOrigin:v,nodeExtent:y,zIndexMode:x="basic"}={})=>{const _=new Map,E=new Map,N=new Map,k=new Map,S=s??r??[],I=o??t??[],C=v??[0,0],j=y??ds;Nm(N,k,S);const O=pu(I,_,E,{nodeOrigin:C,nodeExtent:j,zIndexMode:x});let A=[0,0,1];if(u&&a&&c){const H=Ss(_,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:q,y:J,zoom:ee}=bu(H,a,c,m,g,(h==null?void 0:h.padding)??.1);A=[q,J,ee]}return{rfId:"1",width:a??0,height:c??0,transform:A,nodes:I,nodesInitialized:O,nodeLookup:_,parentLookup:E,edges:S,edgeLookup:k,connectionLookup:N,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:m,maxZoom:g,translateExtent:ds,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Eo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,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:{...om},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Qw,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:rm,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Dk=({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,width:a,height:c,fitView:u,fitViewOptions:h,minZoom:m,maxZoom:g,nodeOrigin:v,nodeExtent:y,zIndexMode:x})=>tS((_,E)=>{async function N(){const{nodeLookup:k,panZoom:S,fitViewOptions:I,fitViewResolver:C,width:j,height:O,minZoom:A,maxZoom:H}=E();S&&(await Gw({nodes:k,width:j,height:O,panZoom:S,minZoom:A,maxZoom:H},I),C==null||C.resolve(!0),_({fitViewResolver:null}))}return{...hp({nodes:t,edges:r,width:a,height:c,fitView:u,fitViewOptions:h,minZoom:m,maxZoom:g,nodeOrigin:v,nodeExtent:y,defaultNodes:o,defaultEdges:s,zIndexMode:x}),setNodes:k=>{const{nodeLookup:S,parentLookup:I,nodeOrigin:C,elevateNodesOnSelect:j,fitViewQueued:O,zIndexMode:A}=E(),H=pu(k,S,I,{nodeOrigin:C,nodeExtent:y,elevateNodesOnSelect:j,checkEquality:!0,zIndexMode:A});O&&H?(N(),_({nodes:k,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0})):_({nodes:k,nodesInitialized:H})},setEdges:k=>{const{connectionLookup:S,edgeLookup:I}=E();Nm(S,I,k),_({edges:k})},setDefaultNodesAndEdges:(k,S)=>{if(k){const{setNodes:I}=E();I(k),_({hasDefaultNodes:!0})}if(S){const{setEdges:I}=E();I(S),_({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:S,nodeLookup:I,parentLookup:C,domNode:j,nodeOrigin:O,nodeExtent:A,debug:H,fitViewQueued:q,zIndexMode:J}=E(),{changes:ee,updatedInternals:U}=y1(k,I,C,j,O,A,J);U&&(h1(I,C,{nodeOrigin:O,nodeExtent:A,zIndexMode:J}),q?(N(),_({fitViewQueued:!1,fitViewOptions:void 0})):_({}),(ee==null?void 0:ee.length)>0&&(H&&console.log("React Flow: trigger node changes",ee),S==null||S(ee)))},updateNodePositions:(k,S=!1)=>{const I=[];let C=[];const{nodeLookup:j,triggerNodeChanges:O,connection:A,updateConnection:H,onNodesChangeMiddlewareMap:q}=E();for(const[J,ee]of k){const U=j.get(J),X=!!(U!=null&&U.expandParent&&(U!=null&&U.parentId)&&(ee!=null&&ee.position)),re={id:J,type:"position",position:X?{x:Math.max(0,ee.position.x),y:Math.max(0,ee.position.y)}:ee.position,dragging:S};if(U&&A.inProgress&&A.fromNode.id===U.id){const b=Co(U,A.fromHandle,Ce.Left,!0);H({...A,from:b})}X&&U.parentId&&I.push({id:J,parentId:U.parentId,rect:{...ee.internals.positionAbsolute,width:ee.measured.width??0,height:ee.measured.height??0}}),C.push(re)}if(I.length>0){const{parentLookup:J,nodeOrigin:ee}=E(),U=Ru(I,j,J,ee);C.push(...U)}for(const J of q.values())C=J(C);O(C)},triggerNodeChanges:k=>{const{onNodesChange:S,setNodes:I,nodes:C,hasDefaultNodes:j,debug:O}=E();if(k!=null&&k.length){if(j){const A=Om(k,C);I(A)}O&&console.log("React Flow: trigger node changes",k),S==null||S(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:S,setEdges:I,edges:C,hasDefaultEdges:j,debug:O}=E();if(k!=null&&k.length){if(j){const A=Fm(k,C);I(A)}O&&console.log("React Flow: trigger edge changes",k),S==null||S(k)}},addSelectedNodes:k=>{const{multiSelectionActive:S,edgeLookup:I,nodeLookup:C,triggerNodeChanges:j,triggerEdgeChanges:O}=E();if(S){const A=k.map(H=>yo(H,!0));j(A);return}j(li(C,new Set([...k]),!0)),O(li(I))},addSelectedEdges:k=>{const{multiSelectionActive:S,edgeLookup:I,nodeLookup:C,triggerNodeChanges:j,triggerEdgeChanges:O}=E();if(S){const A=k.map(H=>yo(H,!0));O(A);return}O(li(I,new Set([...k]))),j(li(C,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:S}={})=>{const{edges:I,nodes:C,nodeLookup:j,triggerNodeChanges:O,triggerEdgeChanges:A}=E(),H=k||C,q=S||I,J=H.map(U=>{const X=j.get(U.id);return X&&(X.selected=!1),yo(U.id,!1)}),ee=q.map(U=>yo(U.id,!1));O(J),A(ee)},setMinZoom:k=>{const{panZoom:S,maxZoom:I}=E();S==null||S.setScaleExtent([k,I]),_({minZoom:k})},setMaxZoom:k=>{const{panZoom:S,minZoom:I}=E();S==null||S.setScaleExtent([I,k]),_({maxZoom:k})},setTranslateExtent:k=>{var S;(S=E().panZoom)==null||S.setTranslateExtent(k),_({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:S,triggerNodeChanges:I,triggerEdgeChanges:C,elementsSelectable:j}=E();if(!j)return;const O=S.reduce((H,q)=>q.selected?[...H,yo(q.id,!1)]:H,[]),A=k.reduce((H,q)=>q.selected?[...H,yo(q.id,!1)]:H,[]);I(O),C(A)},setNodeExtent:k=>{const{nodes:S,nodeLookup:I,parentLookup:C,nodeOrigin:j,elevateNodesOnSelect:O,nodeExtent:A,zIndexMode:H}=E();k[0][0]===A[0][0]&&k[0][1]===A[0][1]&&k[1][0]===A[1][0]&&k[1][1]===A[1][1]||(pu(S,I,C,{nodeOrigin:j,nodeExtent:k,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:H}),_({nodeExtent:k}))},panBy:k=>{const{transform:S,width:I,height:C,panZoom:j,translateExtent:O}=E();return v1({delta:k,panZoom:j,transform:S,translateExtent:O,width:I,height:C})},setCenter:async(k,S,I)=>{const{width:C,height:j,maxZoom:O,panZoom:A}=E();if(!A)return Promise.resolve(!1);const H=typeof(I==null?void 0:I.zoom)<"u"?I.zoom:O;return await A.setViewport({x:C/2-k*H,y:j/2-S*H,zoom:H},{duration:I==null?void 0:I.duration,ease:I==null?void 0:I.ease,interpolate:I==null?void 0:I.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{_({connection:{...om}})},updateConnection:k=>{_({connection:k})},reset:()=>_({...hp()})}},Object.is);function dg({initialNodes:t,initialEdges:r,defaultNodes:o,defaultEdges:s,initialWidth:a,initialHeight:c,initialMinZoom:u,initialMaxZoom:h,initialFitViewOptions:m,fitView:g,nodeOrigin:v,nodeExtent:y,zIndexMode:x,children:_}){const[E]=P.useState(()=>Dk({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,width:a,height:c,fitView:g,minZoom:u,maxZoom:h,fitViewOptions:m,nodeOrigin:v,nodeExtent:y,zIndexMode:x}));return f.jsx(nS,{value:E,children:f.jsx(CS,{children:_})})}function $k({children:t,nodes:r,edges:o,defaultNodes:s,defaultEdges:a,width:c,height:u,fitView:h,fitViewOptions:m,minZoom:g,maxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:_}){return P.useContext(aa)?f.jsx(f.Fragment,{children:t}):f.jsx(dg,{initialNodes:r,initialEdges:o,defaultNodes:s,defaultEdges:a,initialWidth:c,initialHeight:u,fitView:h,initialFitViewOptions:m,initialMinZoom:g,initialMaxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:_,children:t})}const Ok={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Fk({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,className:a,nodeTypes:c,edgeTypes:u,onNodeClick:h,onEdgeClick:m,onInit:g,onMove:v,onMoveStart:y,onMoveEnd:x,onConnect:_,onConnectStart:E,onConnectEnd:N,onClickConnectStart:k,onClickConnectEnd:S,onNodeMouseEnter:I,onNodeMouseMove:C,onNodeMouseLeave:j,onNodeContextMenu:O,onNodeDoubleClick:A,onNodeDragStart:H,onNodeDrag:q,onNodeDragStop:J,onNodesDelete:ee,onEdgesDelete:U,onDelete:X,onSelectionChange:re,onSelectionDragStart:b,onSelectionDrag:K,onSelectionDragStop:V,onSelectionContextMenu:G,onSelectionStart:z,onSelectionEnd:R,onBeforeDelete:B,connectionMode:M,connectionLineType:$=Fr.Bezier,connectionLineStyle:se,connectionLineComponent:oe,connectionLineContainerStyle:de,deleteKeyCode:fe="Backspace",selectionKeyCode:me="Shift",selectionOnDrag:te=!1,selectionMode:pe=fs.Full,panActivationKeyCode:_e="Space",multiSelectionKeyCode:be=ms()?"Meta":"Control",zoomActivationKeyCode:je=ms()?"Meta":"Control",snapToGrid:Ee,snapGrid:Ae,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:Re,nodesDraggable:Ue,autoPanOnNodeFocus:st,nodesConnectable:ht,nodesFocusable:vt,nodeOrigin:pt=Dm,edgesFocusable:pn,edgesReconnectable:zn,elementsSelectable:xt=!0,defaultViewport:Rn=mS,minZoom:en=.5,maxZoom:mn=2,translateExtent:An=ds,preventScrolling:Wr=!0,nodeExtent:tn,defaultMarkerColor:_t="#b1b1b7",zoomOnScroll:mi=!0,zoomOnPinch:gn=!0,panOnScroll:Bt=!1,panOnScrollSpeed:Ur=.5,panOnScrollMode:pr=wo.Free,zoomOnDoubleClick:nn=!0,panOnDrag:qn=!0,onPaneClick:Yr,onPaneMouseEnter:Xr,onPaneMouseMove:rn,onPaneMouseLeave:on,onPaneScroll:sn,onPaneContextMenu:jo,paneClickDistance:jt=1,nodeClickDistance:Gr=0,children:ut,onReconnect:Kr,onReconnectStart:Qr,onReconnectEnd:It,onEdgeContextMenu:yn,onEdgeDoubleClick:Ln,onEdgeMouseEnter:Zn,onEdgeMouseMove:vn,onEdgeMouseLeave:mr,reconnectRadius:xn=10,onNodesChange:et,onEdgesChange:gi,noDragClassName:Jn="nodrag",noWheelClassName:bo="nowheel",noPanClassName:Wt="nopan",fitView:Tt,fitViewOptions:wn,connectOnClick:yi,attributionPosition:Po,proOptions:Mo,defaultEdgeOptions:Io,elevateNodesOnSelect:To=!0,elevateEdgesOnSelect:vi=!1,disableKeyboardA11y:qr=!1,autoPanOnConnect:Ye,autoPanOnNodeDrag:Zr,autoPanSpeed:gr,connectionRadius:Dn,isValidConnection:yr,onError:xi,style:er,id:Be,nodeDragThreshold:zt,connectionDragThreshold:wi,viewport:bt,onViewportChange:Si,width:ki,height:Ei,colorMode:vr="light",debug:xr,onScroll:Rt,ariaLabelConfig:wr,zIndexMode:Jr="basic",...zo},eo){const tr=Be||"1",Sr=xS(vr),$n=P.useCallback(On=>{On.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Rt==null||Rt(On)},[Rt]);return f.jsx("div",{"data-testid":"rf__wrapper",...zo,onScroll:$n,style:{...er,...Ok},ref:eo,className:ct(["react-flow",a,Sr]),id:Be,role:"application",children:f.jsxs($k,{nodes:t,edges:r,width:ki,height:Ei,fitView:Tt,fitViewOptions:wn,minZoom:en,maxZoom:mn,nodeOrigin:pt,nodeExtent:tn,zIndexMode:Jr,children:[f.jsx(Lk,{onInit:g,onNodeClick:h,onEdgeClick:m,onNodeMouseEnter:I,onNodeMouseMove:C,onNodeMouseLeave:j,onNodeContextMenu:O,onNodeDoubleClick:A,nodeTypes:c,edgeTypes:u,connectionLineType:$,connectionLineStyle:se,connectionLineComponent:oe,connectionLineContainerStyle:de,selectionKeyCode:me,selectionOnDrag:te,selectionMode:pe,deleteKeyCode:fe,multiSelectionKeyCode:be,panActivationKeyCode:_e,zoomActivationKeyCode:je,onlyRenderVisibleElements:He,defaultViewport:Rn,translateExtent:An,minZoom:en,maxZoom:mn,preventScrolling:Wr,zoomOnScroll:mi,zoomOnPinch:gn,zoomOnDoubleClick:nn,panOnScroll:Bt,panOnScrollSpeed:Ur,panOnScrollMode:pr,panOnDrag:qn,onPaneClick:Yr,onPaneMouseEnter:Xr,onPaneMouseMove:rn,onPaneMouseLeave:on,onPaneScroll:sn,onPaneContextMenu:jo,paneClickDistance:jt,nodeClickDistance:Gr,onSelectionContextMenu:G,onSelectionStart:z,onSelectionEnd:R,onReconnect:Kr,onReconnectStart:Qr,onReconnectEnd:It,onEdgeContextMenu:yn,onEdgeDoubleClick:Ln,onEdgeMouseEnter:Zn,onEdgeMouseMove:vn,onEdgeMouseLeave:mr,reconnectRadius:xn,defaultMarkerColor:_t,noDragClassName:Jn,noWheelClassName:bo,noPanClassName:Wt,rfId:tr,disableKeyboardA11y:qr,nodeExtent:tn,viewport:bt,onViewportChange:Si}),f.jsx(vS,{nodes:t,edges:r,defaultNodes:o,defaultEdges:s,onConnect:_,onConnectStart:E,onConnectEnd:N,onClickConnectStart:k,onClickConnectEnd:S,nodesDraggable:Ue,autoPanOnNodeFocus:st,nodesConnectable:ht,nodesFocusable:vt,edgesFocusable:pn,edgesReconnectable:zn,elementsSelectable:xt,elevateNodesOnSelect:To,elevateEdgesOnSelect:vi,minZoom:en,maxZoom:mn,nodeExtent:tn,onNodesChange:et,onEdgesChange:gi,snapToGrid:Ee,snapGrid:Ae,connectionMode:M,translateExtent:An,connectOnClick:yi,defaultEdgeOptions:Io,fitView:Tt,fitViewOptions:wn,onNodesDelete:ee,onEdgesDelete:U,onDelete:X,onNodeDragStart:H,onNodeDrag:q,onNodeDragStop:J,onSelectionDrag:K,onSelectionDragStart:b,onSelectionDragStop:V,onMove:v,onMoveStart:y,onMoveEnd:x,noPanClassName:Wt,nodeOrigin:pt,rfId:tr,autoPanOnConnect:Ye,autoPanOnNodeDrag:Zr,autoPanSpeed:gr,onError:xi,connectionRadius:Dn,isValidConnection:yr,selectNodesOnDrag:Re,nodeDragThreshold:zt,connectionDragThreshold:wi,onBeforeDelete:B,debug:xr,ariaLabelConfig:wr,zIndexMode:Jr}),f.jsx(pS,{onSelectionChange:re}),ut,f.jsx(cS,{proOptions:Mo,position:Po}),f.jsx(aS,{rfId:tr,disableKeyboardA11y:qr})]})})}var fg=Hm(Fk);function Hk(t){const[r,o]=P.useState(t),s=P.useCallback(a=>o(c=>Om(a,c)),[]);return[r,o,s]}function Vk(t){const[r,o]=P.useState(t),s=P.useCallback(a=>o(c=>Fm(a,c)),[]);return[r,o,s]}function Bk({dimensions:t,lineWidth:r,variant:o,className:s}){return f.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:ct(["react-flow__background-pattern",o,s])})}function Wk({radius:t,className:r}){return f.jsx("circle",{cx:t,cy:t,r:t,className:ct(["react-flow__background-pattern","dots",r])})}var Gn;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Gn||(Gn={}));const Uk={[Gn.Dots]:1,[Gn.Lines]:1,[Gn.Cross]:6},Yk=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function hg({id:t,variant:r=Gn.Dots,gap:o=20,size:s,lineWidth:a=1,offset:c=0,color:u,bgColor:h,style:m,className:g,patternClassName:v}){const y=P.useRef(null),{transform:x,patternId:_}=$e(Yk,Ze),E=s||Uk[r],N=r===Gn.Dots,k=r===Gn.Cross,S=Array.isArray(o)?o:[o,o],I=[S[0]*x[2]||1,S[1]*x[2]||1],C=E*x[2],j=Array.isArray(c)?c:[c,c],O=k?[C,C]:I,A=[j[0]*x[2]||1+O[0]/2,j[1]*x[2]||1+O[1]/2],H=`${_}${t||""}`;return f.jsxs("svg",{className:ct(["react-flow__background",g]),style:{...m,...ua,"--xy-background-color-props":h,"--xy-background-pattern-color-props":u},ref:y,"data-testid":"rf__background",children:[f.jsx("pattern",{id:H,x:x[0]%I[0],y:x[1]%I[1],width:I[0],height:I[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:N?f.jsx(Wk,{radius:C/2,className:v}):f.jsx(Bk,{dimensions:O,lineWidth:a,variant:r,className:v})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}hg.displayName="Background";const pg=P.memo(hg);function Xk(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Gk(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Kk(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 Qk(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 qk(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 Al({children:t,className:r,...o}){return f.jsx("button",{type:"button",className:ct(["react-flow__controls-button",r]),...o,children:t})}const Zk=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function mg({style:t,showZoom:r=!0,showFitView:o=!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":_}){const E=Je(),{isInteractive:N,minZoomReached:k,maxZoomReached:S,ariaLabelConfig:I}=$e(Zk,Ze),{zoomIn:C,zoomOut:j,fitView:O}=Au(),A=()=>{C(),c==null||c()},H=()=>{j(),u==null||u()},q=()=>{O(a),h==null||h()},J=()=>{E.setState({nodesDraggable:!N,nodesConnectable:!N,elementsSelectable:!N}),m==null||m(!N)},ee=x==="horizontal"?"horizontal":"vertical";return f.jsxs(ca,{className:ct(["react-flow__controls",ee,g]),position:y,style:t,"data-testid":"rf__controls","aria-label":_??I["controls.ariaLabel"],children:[r&&f.jsxs(f.Fragment,{children:[f.jsx(Al,{onClick:A,className:"react-flow__controls-zoomin",title:I["controls.zoomIn.ariaLabel"],"aria-label":I["controls.zoomIn.ariaLabel"],disabled:S,children:f.jsx(Xk,{})}),f.jsx(Al,{onClick:H,className:"react-flow__controls-zoomout",title:I["controls.zoomOut.ariaLabel"],"aria-label":I["controls.zoomOut.ariaLabel"],disabled:k,children:f.jsx(Gk,{})})]}),o&&f.jsx(Al,{className:"react-flow__controls-fitview",onClick:q,title:I["controls.fitView.ariaLabel"],"aria-label":I["controls.fitView.ariaLabel"],children:f.jsx(Kk,{})}),s&&f.jsx(Al,{className:"react-flow__controls-interactive",onClick:J,title:I["controls.interactive.ariaLabel"],"aria-label":I["controls.interactive.ariaLabel"],children:N?f.jsx(qk,{}):f.jsx(Qk,{})}),v]})}mg.displayName="Controls";const gg=P.memo(mg);function Jk({id:t,x:r,y:o,width:s,height:a,style:c,color:u,strokeColor:h,strokeWidth:m,className:g,borderRadius:v,shapeRendering:y,selected:x,onClick:_}){const{background:E,backgroundColor:N}=c||{},k=u||E||N;return f.jsx("rect",{className:ct(["react-flow__minimap-node",{selected:x},g]),x:r,y:o,rx:v,ry:v,width:s,height:a,style:{fill:k,stroke:h,strokeWidth:m},shapeRendering:y,onClick:_?S=>_(S,t):void 0})}const eE=P.memo(Jk),tE=t=>t.nodes.map(r=>r.id),tu=t=>t instanceof Function?t:()=>t;function nE({nodeStrokeColor:t,nodeColor:r,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:c=eE,onClick:u}){const h=$e(tE,Ze),m=tu(r),g=tu(t),v=tu(o),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:h.map(x=>f.jsx(oE,{id:x,nodeColorFunc:m,nodeStrokeColorFunc:g,nodeClassNameFunc:v,nodeBorderRadius:s,nodeStrokeWidth:a,NodeComponent:c,onClick:u,shapeRendering:y},x))})}function rE({id:t,nodeColorFunc:r,nodeStrokeColorFunc:o,nodeClassNameFunc:s,nodeBorderRadius:a,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:h,onClick:m}){const{node:g,x:v,y,width:x,height:_}=$e(E=>{const{internals:N}=E.nodeLookup.get(t),k=N.userNode,{x:S,y:I}=N.positionAbsolute,{width:C,height:j}=hr(k);return{node:k,x:S,y:I,width:C,height:j}},Ze);return!g||g.hidden||!dm(g)?null:f.jsx(h,{x:v,y,width:x,height:_,style:g.style,selected:!!g.selected,className:s(g),color:r(g),borderRadius:a,strokeColor:o(g),strokeWidth:c,shapeRendering:u,onClick:m,id:g.id})}const oE=P.memo(rE);var iE=P.memo(nE);const sE=200,lE=150,aE=t=>!t.hidden,cE=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?um(Ss(t.nodeLookup,{filter:aE}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},uE="react-flow__minimap-desc";function yg({style:t,className:r,nodeStrokeColor:o,nodeColor:s,nodeClassName:a="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:h,bgColor:m,maskColor:g,maskStrokeColor:v,maskStrokeWidth:y,position:x="bottom-right",onClick:_,onNodeClick:E,pannable:N=!1,zoomable:k=!1,ariaLabel:S,inversePan:I,zoomStep:C=1,offsetScale:j=5}){const O=Je(),A=P.useRef(null),{boundingRect:H,viewBB:q,rfId:J,panZoom:ee,translateExtent:U,flowWidth:X,flowHeight:re,ariaLabelConfig:b}=$e(cE,Ze),K=(t==null?void 0:t.width)??sE,V=(t==null?void 0:t.height)??lE,G=H.width/K,z=H.height/V,R=Math.max(G,z),B=R*K,M=R*V,$=j*R,se=H.x-(B-H.width)/2-$,oe=H.y-(M-H.height)/2-$,de=B+$*2,fe=M+$*2,me=`${uE}-${J}`,te=P.useRef(0),pe=P.useRef();te.current=R,P.useEffect(()=>{if(A.current&&ee)return pe.current=j1({domNode:A.current,panZoom:ee,getTransform:()=>O.getState().transform,getViewScale:()=>te.current}),()=>{var Ee;(Ee=pe.current)==null||Ee.destroy()}},[ee]),P.useEffect(()=>{var Ee;(Ee=pe.current)==null||Ee.update({translateExtent:U,width:X,height:re,inversePan:I,pannable:N,zoomStep:C,zoomable:k})},[N,k,I,C,U,X,re]);const _e=_?Ee=>{var Re;const[Ae,He]=((Re=pe.current)==null?void 0:Re.pointer(Ee))||[0,0];_(Ee,{x:Ae,y:He})}:void 0,be=E?P.useCallback((Ee,Ae)=>{const He=O.getState().nodeLookup.get(Ae).internals.userNode;E(Ee,He)},[]):void 0,je=S??b["minimap.ariaLabel"];return f.jsx(ca,{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*R:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:ct(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:K,height:V,viewBox:`${se} ${oe} ${de} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":me,ref:A,onClick:_e,children:[je&&f.jsx("title",{id:me,children:je}),f.jsx(iE,{onClick:be,nodeColor:s,nodeStrokeColor:o,nodeBorderRadius:c,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:h}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${se-$},${oe-$}h${de+$*2}v${fe+$*2}h${-de-$*2}z
|
|
62
|
-
M${q.x},${q.y}h${q.width}v${q.height}h${-q.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}yg.displayName="MiniMap";P.memo(yg);const dE=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,fE={[_o.Line]:"right",[_o.Handle]:"bottom-right"};function hE({nodeId:t,position:r,variant:o=_o.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:_=!0,shouldResize:E,onResizeStart:N,onResize:k,onResizeEnd:S}){const I=Um(),C=typeof t=="string"?t:I,j=Je(),O=P.useRef(null),A=o===_o.Handle,H=$e(P.useCallback(dE(A&&_),[A,_]),Ze),q=P.useRef(null),J=r??fE[o];P.useEffect(()=>{if(!(!O.current||!C))return q.current||(q.current=B1({domNode:O.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:U,transform:X,snapGrid:re,snapToGrid:b,nodeOrigin:K,domNode:V}=j.getState();return{nodeLookup:U,transform:X,snapGrid:re,snapToGrid:b,nodeOrigin:K,paneDomNode:V}},onChange:(U,X)=>{const{triggerNodeChanges:re,nodeLookup:b,parentLookup:K,nodeOrigin:V}=j.getState(),G=[],z={x:U.x,y:U.y},R=b.get(C);if(R&&R.expandParent&&R.parentId){const B=R.origin??V,M=U.width??R.measured.width??0,$=U.height??R.measured.height??0,se={id:R.id,parentId:R.parentId,rect:{width:M,height:$,...fm({x:U.x??R.position.x,y:U.y??R.position.y},{width:M,height:$},R.parentId,b,B)}},oe=Ru([se],b,K,V);G.push(...oe),z.x=U.x?Math.max(B[0]*M,U.x):void 0,z.y=U.y?Math.max(B[1]*$,U.y):void 0}if(z.x!==void 0&&z.y!==void 0){const B={id:C,type:"position",position:{...z}};G.push(B)}if(U.width!==void 0&&U.height!==void 0){const M={id:C,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};G.push(M)}for(const B of X){const M={...B,type:"position"};G.push(M)}re(G)},onEnd:({width:U,height:X})=>{const re={id:C,type:"dimensions",resizing:!1,dimensions:{width:U,height:X}};j.getState().triggerNodeChanges([re])}})),q.current.update({controlPosition:J,boundaries:{minWidth:h,minHeight:m,maxWidth:g,maxHeight:v},keepAspectRatio:y,resizeDirection:x,onResizeStart:N,onResize:k,onResizeEnd:S,shouldResize:E}),()=>{var U;(U=q.current)==null||U.destroy()}},[J,h,m,g,v,y,N,k,S,E]);const ee=J.split("-");return f.jsx("div",{className:ct(["react-flow__resize-control","nodrag",...ee,o,s]),ref:O,style:{...a,scale:H,...u&&{[A?"backgroundColor":"borderColor"]:u}},children:c})}const pp=P.memo(hE);function pE({nodeId:t,isVisible:r=!0,handleClassName:o,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:_,onResizeStart:E,onResize:N,onResizeEnd:k}){return r?f.jsxs(f.Fragment,{children:[D1.map(S=>f.jsx(pp,{className:a,style:c,nodeId:t,position:S,variant:_o.Line,color:u,minWidth:h,minHeight:m,maxWidth:g,maxHeight:v,onResizeStart:E,keepAspectRatio:y,autoScale:x,shouldResize:_,onResize:N,onResizeEnd:k},S)),L1.map(S=>f.jsx(pp,{className:o,style:s,nodeId:t,position:S,color:u,minWidth:h,minHeight:m,maxWidth:g,maxHeight:v,onResizeStart:E,keepAspectRatio:y,autoScale:x,shouldResize:_,onResize:N,onResizeEnd:k},S))]}):null}function mE(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 o=document.implementation.createHTMLDocument(),s=o.createElement("base"),a=o.createElement("a");return o.head.appendChild(s),o.body.appendChild(a),r&&(s.href=r),a.href=t,a.href}const gE=(()=>{let t=0;const r=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${r()}${t}`)})();function Vr(t){const r=[];for(let o=0,s=t.length;o<s;o++)r.push(t[o]);return r}let ri=null;function vg(t={}){return ri||(t.includeStyleProperties?(ri=t.includeStyleProperties,ri):(ri=Vr(window.getComputedStyle(document.documentElement)),ri))}function Zl(t,r){const s=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(r);return s?parseFloat(s.replace("px","")):0}function yE(t){const r=Zl(t,"border-left-width"),o=Zl(t,"border-right-width");return t.clientWidth+r+o}function vE(t){const r=Zl(t,"border-top-width"),o=Zl(t,"border-bottom-width");return t.clientHeight+r+o}function xg(t,r={}){const o=r.width||yE(t),s=r.height||vE(t);return{width:o,height:s}}function xE(){let t,r;try{r=process}catch{}const o=r&&r.env?r.env.devicePixelRatio:null;return o&&(t=parseInt(o,10),Number.isNaN(t)&&(t=1)),t||window.devicePixelRatio||1}const qt=16384;function wE(t){(t.width>qt||t.height>qt)&&(t.width>qt&&t.height>qt?t.width>t.height?(t.height*=qt/t.width,t.width=qt):(t.width*=qt/t.height,t.height=qt):t.width>qt?(t.height*=qt/t.width,t.width=qt):(t.width*=qt/t.height,t.height=qt))}function Jl(t){return new Promise((r,o)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>r(s))})},s.onerror=o,s.crossOrigin="anonymous",s.decoding="async",s.src=t})}async function SE(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(r=>`data:image/svg+xml;charset=utf-8,${r}`)}async function kE(t,r,o){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",`${o}`),a.setAttribute("viewBox",`0 0 ${r} ${o}`),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),SE(a)}const Vt=(t,r)=>{if(t instanceof r)return!0;const o=Object.getPrototypeOf(t);return o===null?!1:o.constructor.name===r.name||Vt(o,r)};function EE(t){const r=t.getPropertyValue("content");return`${t.cssText} content: '${r.replace(/'|"/g,"")}';`}function NE(t,r){return vg(r).map(o=>{const s=t.getPropertyValue(o),a=t.getPropertyPriority(o);return`${o}: ${s}${a?" !important":""};`}).join(" ")}function CE(t,r,o,s){const a=`.${t}:${r}`,c=o.cssText?EE(o):NE(o,s);return document.createTextNode(`${a}{${c}}`)}function mp(t,r,o,s){const a=window.getComputedStyle(t,o),c=a.getPropertyValue("content");if(c===""||c==="none")return;const u=gE();try{r.className=`${r.className} ${u}`}catch{return}const h=document.createElement("style");h.appendChild(CE(u,o,a,s)),r.appendChild(h)}function _E(t,r,o){mp(t,r,":before",o),mp(t,r,":after",o)}const gp="application/font-woff",yp="image/jpeg",jE={woff:gp,woff2:gp,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:yp,jpeg:yp,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function bE(t){const r=/\.([^./]*?)$/g.exec(t);return r?r[1]:""}function Du(t){const r=bE(t).toLowerCase();return jE[r]||""}function PE(t){return t.split(/,/)[1]}function yu(t){return t.search(/^(data:)/)!==-1}function ME(t,r){return`data:${r};base64,${t}`}async function wg(t,r,o){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(o({res:s,result:h.result}))}catch(m){u(m)}},h.readAsDataURL(a)})}const nu={};function IE(t,r,o){let s=t.replace(/\?.*/,"");return o&&(s=t),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),r?`[${r}]${s}`:s}async function $u(t,r,o){const s=IE(t,r,o.includeQueryParams);if(nu[s]!=null)return nu[s];o.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let a;try{const c=await wg(t,o.fetchRequestInit,({res:u,result:h})=>(r||(r=u.headers.get("Content-Type")||""),PE(h)));a=ME(c,r)}catch(c){a=o.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 TE(t){const r=t.toDataURL();return r==="data:,"?t.cloneNode(!1):Jl(r)}async function zE(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 Jl(h)}const o=t.poster,s=Du(o),a=await $u(o,s,r);return Jl(a)}async function RE(t,r){var o;try{if(!((o=t==null?void 0:t.contentDocument)===null||o===void 0)&&o.body)return await fa(t.contentDocument.body,r,!0)}catch{}return t.cloneNode(!1)}async function AE(t,r){return Vt(t,HTMLCanvasElement)?TE(t):Vt(t,HTMLVideoElement)?zE(t,r):Vt(t,HTMLIFrameElement)?RE(t,r):t.cloneNode(Sg(t))}const LE=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",Sg=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function DE(t,r,o){var s,a;if(Sg(r))return r;let c=[];return LE(t)&&t.assignedNodes?c=Vr(t.assignedNodes()):Vt(t,HTMLIFrameElement)&&(!((s=t.contentDocument)===null||s===void 0)&&s.body)?c=Vr(t.contentDocument.body.childNodes):c=Vr(((a=t.shadowRoot)!==null&&a!==void 0?a:t).childNodes),c.length===0||Vt(t,HTMLVideoElement)||await c.reduce((u,h)=>u.then(()=>fa(h,o)).then(m=>{m&&r.appendChild(m)}),Promise.resolve()),r}function $E(t,r,o){const s=r.style;if(!s)return;const a=window.getComputedStyle(t);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):vg(o).forEach(c=>{let u=a.getPropertyValue(c);c==="font-size"&&u.endsWith("px")&&(u=`${Math.floor(parseFloat(u.substring(0,u.length-2)))-.1}px`),Vt(t,HTMLIFrameElement)&&c==="display"&&u==="inline"&&(u="block"),c==="d"&&r.getAttribute("d")&&(u=`path(${r.getAttribute("d")})`),s.setProperty(c,u,a.getPropertyPriority(c))})}function OE(t,r){Vt(t,HTMLTextAreaElement)&&(r.innerHTML=t.value),Vt(t,HTMLInputElement)&&r.setAttribute("value",t.value)}function FE(t,r){if(Vt(t,HTMLSelectElement)){const s=Array.from(r.children).find(a=>t.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function HE(t,r,o){return Vt(r,Element)&&($E(t,r,o),_E(t,r,o),OE(t,r),FE(t,r)),r}async function VE(t,r){const o=t.querySelectorAll?t.querySelectorAll("use"):[];if(o.length===0)return t;const s={};for(let c=0;c<o.length;c++){const h=o[c].getAttribute("xlink:href");if(h){const m=t.querySelector(h),g=document.querySelector(h);!m&&g&&!s[h]&&(s[h]=await fa(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 fa(t,r,o){return!o&&r.filter&&!r.filter(t)?null:Promise.resolve(t).then(s=>AE(s,r)).then(s=>DE(t,s,r)).then(s=>HE(t,s,r)).then(s=>VE(s,r))}const kg=/url\((['"]?)([^'"]+?)\1\)/g,BE=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,WE=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function UE(t){const r=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${r})(['"]?\\))`,"g")}function YE(t){const r=[];return t.replace(kg,(o,s,a)=>(r.push(a),o)),r.filter(o=>!yu(o))}async function XE(t,r,o,s,a){try{const c=o?mE(r,o):r,u=Du(r);let h;return a||(h=await $u(c,u,s)),t.replace(UE(r),`$1${h}$3`)}catch{}return t}function GE(t,{preferredFontFormat:r}){return r?t.replace(WE,o=>{for(;;){const[s,,a]=BE.exec(o)||[];if(!a)return"";if(a===r)return`src: ${s};`}}):t}function Eg(t){return t.search(kg)!==-1}async function Ng(t,r,o){if(!Eg(t))return t;const s=GE(t,o);return YE(s).reduce((c,u)=>c.then(h=>XE(h,u,r,o)),Promise.resolve(s))}async function oi(t,r,o){var s;const a=(s=r.style)===null||s===void 0?void 0:s.getPropertyValue(t);if(a){const c=await Ng(a,null,o);return r.style.setProperty(t,c,r.style.getPropertyPriority(t)),!0}return!1}async function KE(t,r){await oi("background",t,r)||await oi("background-image",t,r),await oi("mask",t,r)||await oi("-webkit-mask",t,r)||await oi("mask-image",t,r)||await oi("-webkit-mask-image",t,r)}async function QE(t,r){const o=Vt(t,HTMLImageElement);if(!(o&&!yu(t.src))&&!(Vt(t,SVGImageElement)&&!yu(t.href.baseVal)))return;const s=o?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"),o?(t.srcset="",t.src=a):t.href.baseVal=a})}async function qE(t,r){const s=Vr(t.childNodes).map(a=>Cg(a,r));await Promise.all(s).then(()=>t)}async function Cg(t,r){Vt(t,Element)&&(await KE(t,r),await QE(t,r),await qE(t,r))}function ZE(t,r){const{style:o}=t;r.backgroundColor&&(o.backgroundColor=r.backgroundColor),r.width&&(o.width=`${r.width}px`),r.height&&(o.height=`${r.height}px`);const s=r.style;return s!=null&&Object.keys(s).forEach(a=>{o[a]=s[a]}),t}const vp={};async function xp(t){let r=vp[t];if(r!=null)return r;const s=await(await fetch(t)).text();return r={url:t,cssText:s},vp[t]=r,r}async function wp(t,r){let o=t.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,c=(o.match(/url\([^)]+\)/g)||[]).map(async u=>{let h=u.replace(s,"$1");return h.startsWith("https://")||(h=new URL(h,t.url).href),wg(h,r.fetchRequestInit,({result:m})=>(o=o.replace(u,`url(${m})`),[u,m]))});return Promise.all(c).then(()=>o)}function Sp(t){if(t==null)return[];const r=[],o=/(\/\*[\s\S]*?\*\/)/gi;let s=t.replace(o,"");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 JE(t,r){const o=[],s=[];return t.forEach(a=>{if("cssRules"in a)try{Vr(a.cssRules||[]).forEach((c,u)=>{if(c.type===CSSRule.IMPORT_RULE){let h=u+1;const m=c.href,g=xp(m).then(v=>wp(v,r)).then(v=>Sp(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(xp(a.href).then(h=>wp(h,r)).then(h=>Sp(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{Vr(a.cssRules||[]).forEach(c=>{o.push(c)})}catch(c){console.error(`Error while reading CSS rules from ${a.href}`,c)}}),o))}function eN(t){return t.filter(r=>r.type===CSSRule.FONT_FACE_RULE).filter(r=>Eg(r.style.getPropertyValue("src")))}async function tN(t,r){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const o=Vr(t.ownerDocument.styleSheets),s=await JE(o,r);return eN(s)}function _g(t){return t.trim().replace(/["']/g,"")}function nN(t){const r=new Set;function o(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(c=>{r.add(_g(c))}),Array.from(s.children).forEach(c=>{c instanceof HTMLElement&&o(c)})}return o(t),r}async function rN(t,r){const o=await tN(t,r),s=nN(t);return(await Promise.all(o.filter(c=>s.has(_g(c.style.fontFamily))).map(c=>{const u=c.parentStyleSheet?c.parentStyleSheet.href:null;return Ng(c.cssText,u,r)}))).join(`
|
|
63
|
-
`)}async function oN(t,r){const o=r.fontEmbedCSS!=null?r.fontEmbedCSS:r.skipFonts?null:await rN(t,r);if(o){const s=document.createElement("style"),a=document.createTextNode(o);s.appendChild(a),t.firstChild?t.insertBefore(s,t.firstChild):t.appendChild(s)}}async function jg(t,r={}){const{width:o,height:s}=xg(t,r),a=await fa(t,r,!0);return await oN(a,r),await Cg(a,r),ZE(a,r),await kE(a,o,s)}async function iN(t,r={}){const{width:o,height:s}=xg(t,r),a=await jg(t,r),c=await Jl(a),u=document.createElement("canvas"),h=u.getContext("2d"),m=r.pixelRatio||xE(),g=r.canvasWidth||o,v=r.canvasHeight||s;return u.width=g*m,u.height=v*m,r.skipAutoScale||wE(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 sN(t,r={}){return(await iN(t,r)).toDataURL()}function lN({feature:t,onClose:r}){return f.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:f.jsxs("div",{style:{background:"#1e1e2e",border:"1px solid #444",borderRadius:12,padding:"32px 40px",maxWidth:420,textAlign:"center"},onClick:o=>o.stopPropagation(),children:[f.jsx("div",{style:{fontSize:32,marginBottom:12},children:"🔒"}),f.jsxs("h2",{style:{color:"#fff",margin:"0 0 8px",fontSize:20},children:[t," is a Pro feature"]}),f.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."]}),f.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"}),f.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 Ll({trigger:t,triggerClassName:r,contentClassName:o,children:s,disabled:a}){const[c,u]=P.useState(!1),h=P.useRef(null);return P.useEffect(()=>{if(!c)return;const m=g=>{h.current&&!h.current.contains(g.target)&&u(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[c]),f.jsxs("div",{ref:h,className:"dropdown-wrapper",children:[f.jsx("button",{className:r,onClick:()=>!a&&u(!c),disabled:a,children:t}),c&&f.jsx("div",{className:`dropdown-menu ${o||""}`,onClick:()=>u(!1),children:s})]})}const aN={presentation:"#1971c2",application:"#e67700",data:"#2f9e44",external:"#9c36b5",deployment:"#c92a2a"},kp={frontend:"■",backend:"⬡",service:"⬡",worker:"⚙",gateway:"⬥",database:"⎕",external:"☁",component:"●",cli:"❯",library:"≡"};function cN({data:t,selected:r}){const o=t,s=o.label.split(`
|
|
64
|
-
`),a=s[0],c=s.slice(1).join(`
|
|
65
|
-
`),u=["arch-node",o.layer,o.active?"active":"",o.highlighted?"highlighted":"",o.locked?"locked":"",o.isConnected===!0?"connected":"",o.isConnected===!1?"dimmed":"",o.isSearchMatch===!0?"search-match":"",o.isSearchMatch===!1?"search-no-match":""].filter(Boolean).join(" "),h=aN[o.layer]||"#868e96",m=kp[o.nodeType]||kp.component;return f.jsxs(f.Fragment,{children:[f.jsx(pE,{color:h,isVisible:r,minWidth:100,minHeight:60}),f.jsxs("div",{className:u,style:{minWidth:o.width||130,width:"100%",height:"100%"},children:[f.jsx(Hr,{type:"target",position:Ce.Top}),f.jsx(Hr,{type:"target",position:Ce.Left}),f.jsx("div",{className:"node-type-icon",children:m}),f.jsxs("div",{className:"node-content",children:[f.jsx("div",{className:"label",children:a}),c&&f.jsx("div",{className:"sublabel",children:c}),o.description&&f.jsx("div",{className:"node-desc",children:o.description})]}),o.techStack&&o.techStack.length>0&&f.jsx("div",{className:"node-tech-row",children:o.techStack.slice(0,3).map((g,v)=>f.jsx("span",{className:"node-tech-pill",children:g},v))}),f.jsx(Hr,{type:"source",position:Ce.Bottom}),f.jsx(Hr,{type:"source",position:Ce.Right})]})]})}const bg=P.memo(cN),uN={develop:"#2f9e44",development:"#2f9e44",dev:"#2f9e44",staging:"#e67700",stage:"#e67700",production:"#c92a2a",prod:"#c92a2a"};function dN({selectedEnvironment:t,environments:r,onSelectEnvironment:o}){if(!r||Object.keys(r).length===0)return null;const s=Object.keys(r);return f.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)||uN[a]||"#6b7280",m=(u==null?void 0:u.label)||a.charAt(0).toUpperCase()+a.slice(1);return f.jsxs("button",{className:`env-tab ${c?"selected":""}`,onClick:()=>o(a),style:{"--env-color":h},children:[f.jsx("span",{className:"env-indicator"}),f.jsx("span",{className:"env-label",children:m}),c&&u&&f.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 fN=P.memo(dN);function hN(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function pN(t){return new Date(t).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function mN({visible:t,onClose:r}){const[o,s]=P.useState(null),a=P.useCallback(async()=>{try{const c=await fetch("http://localhost:3847/api/stats");c.ok&&s(await c.json())}catch{}},[]);return P.useEffect(()=>{t&&a()},[t,a]),!t||!o?null:f.jsxs("div",{className:"stats-overlay",children:[f.jsxs("div",{className:"stats-overlay-header",children:[f.jsx("span",{className:"stats-overlay-title",children:"Architecture Stats"}),f.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]}),(o.durationMs||o.filesScanned||o.analyzedAt)&&f.jsxs("div",{className:"stats-scan-info",children:[o.durationMs!=null&&f.jsx("span",{className:"scan-info-item",children:hN(o.durationMs)}),o.filesScanned!=null&&f.jsxs("span",{className:"scan-info-item",children:[o.filesScanned.toLocaleString()," files"]}),o.tokenUsage&&f.jsxs("span",{className:"scan-info-item",children:[(o.tokenUsage.input+o.tokenUsage.output).toLocaleString()," tokens"]}),o.mode&&f.jsx("span",{className:"scan-info-item",children:o.mode==="pipeline"?"static + model":"static only"}),o.analyzedAt&&f.jsx("span",{className:"scan-info-item",children:pN(o.analyzedAt)})]}),f.jsxs("div",{className:"stats-grid",children:[f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:o.components}),f.jsx("div",{className:"stat-label",children:"Components"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:o.totalConnections}),f.jsx("div",{className:"stat-label",children:"Connections"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:o.databases}),f.jsx("div",{className:"stat-label",children:"Databases"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:o.externalServices}),f.jsx("div",{className:"stat-label",children:"External"})]}),f.jsxs("div",{className:`stat-card ${o.orphans>0?"highlight":""}`,children:[f.jsx("div",{className:"stat-value",children:o.orphans}),f.jsx("div",{className:"stat-label",children:"Orphans"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:o.flows}),f.jsx("div",{className:"stat-label",children:"Flows"})]})]})]})}const gN=P.memo(mN);function yN({visible:t,onClose:r,onHighlightNode:o}){const[s,a]=P.useState(null),[c,u]=P.useState(!1),h=P.useCallback(async()=>{u(!0);try{const m=await fetch("http://localhost:3847/api/validate");m.ok&&a(await m.json())}catch{}u(!1)},[]);return P.useEffect(()=>{t&&h()},[t,h]),!t||!s&&!c?null:f.jsxs("div",{className:"validation-panel",children:[f.jsxs("div",{className:"validation-header",children:[f.jsx("span",{className:"validation-title",children:"Validation"}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("button",{className:"panel-btn cyan small",onClick:h,disabled:c,children:c?"...":"Re-validate"}),s&&f.jsx("span",{className:`validation-badge ${s.passed?"pass":"fail"}`,children:s.passed?"PASS":"FAIL"}),f.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]})]}),c&&!s?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:12},children:"Validating..."}):s&&s.violations.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:12},children:"No violations found"}):s?f.jsx("div",{children:s.violations.map((m,g)=>f.jsxs("div",{className:`violation-item ${m.level}`,onClick:()=>{m.nodeIds&&m.nodeIds.length>0&&o(m.nodeIds[0])},children:[f.jsx("div",{className:"violation-rule",children:m.rule}),f.jsx("div",{className:"violation-message",children:m.message})]},g))}):null,s&&f.jsxs("div",{style:{marginTop:8,fontSize:10,color:"var(--text-muted)",textAlign:"center"},children:[s.errors," error",s.errors!==1?"s":"",", ",s.warnings," warning",s.warnings!==1?"s":""]})]})}const vN=P.memo(yN);function xN({visible:t}){const[r,o]=P.useState(null),[s,a]=P.useState([]),[c,u]=P.useState(!0),[h,m]=P.useState(!1),g=P.useCallback(async()=>{try{const[k,S]=await Promise.all([fetch("http://localhost:3847/api/patrol/latest"),fetch("http://localhost:3847/api/patrol/history")]);k.ok&&o(await k.json()),S.ok&&a(await S.json())}catch{}u(!1)},[]),v=P.useCallback(async()=>{try{const k=await fetch("http://localhost:3847/api/patrol/running");if(k.ok){const S=await k.json();m(S.running)}}catch{}},[]);P.useEffect(()=>{if(t){g(),v();const k=setInterval(g,h?5e3:1e4),S=setInterval(v,5e3);return()=>{clearInterval(k),clearInterval(S)}}},[t,g,v,h]);const y=async()=>{try{(await fetch("http://localhost:3847/api/patrol/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({interval:30})})).ok&&m(!0)}catch{}},x=async()=>{try{(await fetch("http://localhost:3847/api/patrol/stop",{method:"POST"})).ok&&m(!1)}catch{}};if(!t)return null;if(c)return f.jsx("div",{className:"ops-section",children:f.jsx("div",{className:"ops-empty",children:"Loading..."})});if(!r&&s.length===0)return f.jsxs("div",{className:"ops-section",children:[f.jsxs("div",{className:"ops-empty",children:["No patrol data yet.",f.jsx("span",{className:"ops-hint",children:"Start patrol to begin monitoring"})]}),f.jsx("div",{className:"patrol-actions",children:f.jsx("button",{className:"panel-btn green",onClick:y,disabled:h,children:h?"Running...":"Start Patrol"})})]});const _=s.slice(-20),E=_.filter(k=>k.passed).length,N=_.length>0?Math.round(E/_.length*100):0;return f.jsxs("div",{className:"ops-section",children:[f.jsx("div",{className:"patrol-actions",children:h?f.jsx("button",{className:"panel-btn red",onClick:x,children:"Stop Patrol"}):f.jsx("button",{className:"panel-btn green",onClick:y,children:"Start Patrol"})}),_.length>0&&f.jsxs("div",{className:"patrol-sparkline-row",children:[f.jsx("div",{className:"patrol-sparkline",children:_.map((k,S)=>f.jsx("div",{className:`spark-dot ${k.passed?"healthy":"violation"}`,title:`${new Date(k.timestamp).toLocaleTimeString()} — ${k.passed?"Healthy":"Violation"}`},S))}),f.jsxs("span",{className:"patrol-health-pct",children:[N,"%"]})]}),r&&f.jsxs("div",{className:`patrol-status-card ${r.passed?"healthy":"violation"}`,children:[f.jsxs("div",{className:"patrol-status-row",children:[f.jsx("span",{className:`patrol-badge ${r.passed?"healthy":"violation"}`,children:r.passed?"HEALTHY":"VIOLATION"}),f.jsx("span",{className:"patrol-time",children:new Date(r.timestamp).toLocaleTimeString()})]}),f.jsxs("div",{className:"patrol-counts",children:[r.errors>0&&f.jsxs("span",{className:"patrol-count error",children:[r.errors," err"]}),r.warnings>0&&f.jsxs("span",{className:"patrol-count warn",children:[r.warnings," warn"]}),r.errors===0&&r.warnings===0&&f.jsx("span",{className:"patrol-count ok",children:"All clear"})]})]}),r&&r.newViolations.length>0&&f.jsxs("div",{className:"patrol-violations",children:[f.jsx("div",{className:"patrol-violations-label",children:"New violations"}),r.newViolations.slice(0,5).map((k,S)=>f.jsxs("div",{className:`patrol-violation-item ${k.level}`,children:[f.jsx("span",{className:"patrol-v-rule",children:k.rule}),f.jsx("span",{className:"patrol-v-msg",children:k.message})]},S))]}),r&&r.resolvedViolations.length>0&&f.jsxs("div",{className:"patrol-violations resolved",children:[f.jsx("div",{className:"patrol-violations-label",children:"Resolved"}),r.resolvedViolations.slice(0,3).map((k,S)=>f.jsxs("div",{className:"patrol-violation-item resolved",children:[f.jsx("span",{className:"patrol-v-rule",children:k.rule}),f.jsx("span",{className:"patrol-v-msg",children:k.message})]},S))]}),f.jsxs("div",{className:"patrol-summary",children:[s.length," patrols total"]})]})}const wN=P.memo(xN);function SN({visible:t}){const[r,o]=P.useState([]),[s,a]=P.useState(null),[c,u]=P.useState(null),[h,m]=P.useState(!0),[g,v]=P.useState(null),[y,x]=P.useState(null),_=P.useRef(null),E=P.useCallback(async()=>{try{const I=await fetch("http://localhost:3847/api/workflow/list");I.ok&&o(await I.json())}catch{}m(!1)},[]),N=P.useCallback(async I=>{try{const C=await fetch(`http://localhost:3847/api/workflow/status/${I}`);if(C.ok){const j=await C.json();u(j),j&&g===I&&(j.status==="completed"||j.status==="failed")&&(v(null),E())}}catch{}},[g,E]);P.useEffect(()=>{if(t){E();const I=setInterval(E,g?3e3:1e4);return()=>clearInterval(I)}},[t,E,g]),P.useEffect(()=>(_.current&&clearInterval(_.current),s&&(N(s),_.current=setInterval(()=>N(s),g?3e3:1e4)),()=>{_.current&&clearInterval(_.current)}),[s,N,g]);const k=async I=>{x(null);try{const C=await fetch(`http://localhost:3847/api/workflow/run/${I}`,{method:"POST"});if(C.ok)v(I);else{const j=await C.json();x(j.error||"Failed to start workflow")}}catch{x("Failed to connect to server")}},S=async I=>{x(null);try{(await fetch("http://localhost:3847/api/workflow/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:I})})).ok&&(u(null),E())}catch{}};return t?h?f.jsx("div",{className:"ops-section",children:f.jsx("div",{className:"ops-empty",children:"Loading..."})}):r.length===0?f.jsx("div",{className:"ops-section",children:f.jsxs("div",{className:"ops-empty",children:["No workflows available.",f.jsx("span",{className:"ops-hint",children:"Run: archbyte workflow --list"})]})}):f.jsxs("div",{className:"ops-section",children:[y&&f.jsx("div",{className:"wf-error",children:y}),r.map(I=>{const C=s===I.id,j=g===I.id;return f.jsxs("div",{className:"wf-item",children:[f.jsxs("div",{className:"wf-header",onClick:()=>a(C?null:I.id),children:[f.jsxs("div",{className:"wf-header-left",children:[f.jsx("span",{className:"wf-expand",children:C?"−":"+"}),f.jsx("span",{className:"wf-name",children:I.name}),I.builtin&&f.jsx("span",{className:"wf-tag",children:"built-in"})]}),(j||I.status)&&f.jsx("span",{className:`wf-status ${j?"running":I.status}`,children:j?"running":I.status==="completed"?"done":I.status})]}),C&&f.jsxs("div",{className:"wf-detail",children:[f.jsx("div",{className:"wf-desc",children:I.description}),c&&c.workflowId===I.id?f.jsxs("div",{className:"wf-steps",children:[Object.entries(c.steps).map(([O,A])=>f.jsxs("div",{className:`wf-step ${A.status}`,children:[f.jsx("span",{className:"wf-step-icon",children:A.status==="completed"?"✓":A.status==="running"?"▶":A.status==="failed"?"✗":"○"}),f.jsx("span",{className:"wf-step-id",children:O})]},O)),(()=>{const O=Object.keys(c.steps).length,A=Object.values(c.steps).filter(q=>q.status==="completed").length,H=O>0?Math.round(A/O*100):0;return f.jsxs("div",{className:"wf-progress",children:[f.jsx("div",{className:"wf-progress-bar",children:f.jsx("div",{className:"wf-progress-fill",style:{width:`${H}%`}})}),f.jsxs("span",{className:"wf-progress-label",children:[H,"%"]})]})})()]}):f.jsx("div",{className:"wf-steps-preview",children:I.steps.length>0?I.steps.join(" → "):"No state yet"}),f.jsxs("div",{className:"wf-actions",children:[f.jsx("button",{className:"panel-btn cyan",disabled:j,onClick:()=>k(I.id),children:j?"Running...":"Run"}),(I.status==="completed"||I.status==="failed")&&!j&&f.jsx("button",{className:"panel-btn amber",onClick:()=>S(I.id),children:"Reset"})]})]})]},I.id)})]}):null}const kN=P.memo(SN);function EN({projectInfo:t}){const[r,o]=P.useState(!1),s=P.useRef(null);return P.useEffect(()=>{if(!r)return;const a=c=>{s.current&&!s.current.contains(c.target)&&o(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r]),t?f.jsxs("div",{className:"project-info-wrapper",ref:s,children:[f.jsx("button",{className:"project-info-trigger",onClick:()=>o(!r),children:t.name}),r&&f.jsxs("div",{className:"project-info-popup",children:[f.jsxs("div",{className:"project-info-header",children:[f.jsx("span",{className:"project-info-name",children:t.name}),t.primaryLanguage&&f.jsx("span",{className:"project-info-lang",children:t.primaryLanguage})]}),t.description&&f.jsx("p",{className:"project-info-desc",children:t.description}),t.isMonorepo&&f.jsx("div",{className:"project-info-badge",children:"Monorepo"}),t.workspacePath&&f.jsxs("a",{className:"project-info-vscode",href:`vscode://file${t.workspacePath}`,title:"Open folder in VS Code",children:[f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:f.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 NN={architecture:bg},CN=1500;function _N({flow:t,architecture:r,onClose:o}){var _;const[s,a]=P.useState(0),[c,u]=P.useState(new Set([(_=t.steps[0])==null?void 0:_.edge])),[h,m]=P.useState(!0),{flowNodeIds:g,flowEdges:v}=P.useMemo(()=>{const E=new Set(t.steps.map(S=>S.edge)),N=r.edges.filter(S=>E.has(S.id)),k=new Set;return N.forEach(S=>{k.add(S.source),k.add(S.target)}),{flowNodeIds:k,flowEdges:N}},[t,r]),y=P.useMemo(()=>{const E=r.nodes.filter(ee=>g.has(ee.id)),N=320,k=140,S=80,I=80,C=new Map,j=new Map;g.forEach(ee=>{C.set(ee,0),j.set(ee,[])}),v.forEach(ee=>{g.has(ee.source)&&g.has(ee.target)&&(j.get(ee.source).push(ee.target),C.set(ee.target,(C.get(ee.target)||0)+1))});const O=new Map,A=[];for(C.forEach((ee,U)=>{ee===0&&(A.push(U),O.set(U,0))});A.length>0;){const ee=A.shift(),U=O.get(ee);for(const X of j.get(ee)||[]){const re=U+1;(!O.has(X)||O.get(X)<re)&&O.set(X,re),C.set(X,C.get(X)-1),C.get(X)===0&&A.push(X)}}E.forEach(ee=>{O.has(ee.id)||O.set(ee.id,0)});const H=new Map;E.forEach(ee=>{const U=O.get(ee.id);H.has(U)||H.set(U,[]),H.get(U).push(ee)});const q=[...H.keys()].sort((ee,U)=>ee-U),J=new Map;return q.forEach((ee,U)=>{H.get(ee).forEach((re,b)=>{J.set(re.id,{x:S+U*N,y:I+b*k})})}),E.map(ee=>{const U=J.get(ee.id)||{x:S,y:I};return{id:ee.id,type:"architecture",position:U,data:{label:ee.label,layer:ee.layer,nodeType:ee.type,width:ee.width,height:ee.height,path:ee.path,techStack:ee.techStack,description:ee.description},style:{width:ee.width,zIndex:1}}})},[r,g,v]);P.useEffect(()=>{if(!h)return;const E=setInterval(()=>{a(N=>{const k=N+1;if(k>=t.steps.length)return u(new Set([t.steps[0].edge])),0;const S=new Set;for(let I=0;I<=k;I++)S.add(t.steps[I].edge);return u(S),k})},CN);return()=>clearInterval(E)},[h,t]);const x=P.useMemo(()=>{const E=new Map;return t.steps.forEach((N,k)=>{E.has(N.edge)||E.set(N.edge,k+1)}),v.map(N=>{const k=c.has(N.id),S=E.get(N.id);return{id:N.id,source:N.source,target:N.target,label:k&&S?`${S}`:void 0,labelStyle:k&&S?{fill:"#fff",fontWeight:700,fontSize:13,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:k&&S?{fill:t.color,fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:k?t.color:N.color||"var(--border-color)",strokeWidth:k?5:2,opacity:k?1:.3,filter:k?"brightness(0.85) saturate(1.4)":void 0},animated:k,type:"smoothstep"}})},[v,c,t]);return f.jsx("div",{className:"flow-hud-overlay",children:f.jsxs("div",{className:"flow-hud-panel",children:[f.jsxs("div",{className:"flow-hud-header",children:[f.jsxs("div",{className:"flow-hud-title",children:[f.jsx("span",{className:"flow-hud-dot",style:{background:t.color}}),f.jsx("span",{children:t.name})]}),f.jsxs("div",{className:"flow-hud-controls",children:[h?f.jsx("button",{className:"flow-hud-btn",onClick:()=>m(!1),title:"Pause",children:"⏸"}):f.jsx("button",{className:"flow-hud-btn",onClick:()=>m(!0),title:"Play",children:"▶"}),f.jsx("button",{className:"flow-hud-close",onClick:o,title:"Close",children:"✕"})]})]}),f.jsx("div",{className:"flow-hud-description",children:t.description}),f.jsx("div",{className:"flow-hud-canvas",children:f.jsxs(fg,{nodes:y,edges:x,nodeTypes:NN,fitView:!0,fitViewOptions:{padding:.3},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,minZoom:.3,maxZoom:2,proOptions:{hideAttribution:!0},children:[f.jsx(pg,{variant:Gn.Dots,gap:20,size:1,color:"var(--grid-color)"}),f.jsx(gg,{showInteractive:!1})]})}),f.jsx("div",{className:"flow-hud-steps",children:t.steps.map((E,N)=>f.jsxs("div",{className:`flow-hud-step ${N<=s?"active":""} ${N===s?"current":""}`,style:{borderColor:N<=s?t.color:void 0},children:[f.jsx("span",{className:"flow-hud-step-num",style:{background:N<=s?t.color:void 0},children:N+1}),E.label]},N))})]})})}function jN(t){return f.jsx(dg,{children:f.jsx(_N,{...t})})}const bN=P.memo(jN),PN=[{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},{key:"ollama",name:"Ollama",icon:"L",models:"Llama 3, CodeLlama, Mistral",description:"Local models, no API key needed",requiresKey:!1}];function MN({onComplete:t}){const[r,o]=P.useState(1),[s,a]=P.useState(null),[c,u]=P.useState(""),[h,m]=P.useState(!1),[g,v]=P.useState(null),y=N=>{a(N),u(""),v(null),N.requiresKey?o(2):o(3)},x=()=>{if(!c.trim()){v("API key is required");return}v(null),o(3)},_=async()=>{if(s){m(!0),v(null);try{const N={provider:s.key};s.requiresKey&&c.trim()&&(N.apiKey=c.trim());const k=await fetch("http://localhost:3847/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)});if(!k.ok){const S=await k.json();throw new Error(S.error||"Failed to save configuration")}t()}catch(N){v(N instanceof Error?N.message:"Failed to save configuration"),m(!1)}}},E=()=>{v(null),r===3&&(s!=null&&s.requiresKey)?o(2):r===3&&!(s!=null&&s.requiresKey)?o(1):(o(1),a(null),u(""))};return f.jsx("div",{style:Te.overlay,onClick:N=>N.stopPropagation(),children:f.jsxs("div",{style:Te.modal,children:[f.jsxs("div",{style:Te.header,children:[f.jsx("div",{style:Te.headerIcon,children:"⚙"}),f.jsx("h2",{style:Te.title,children:"Set Up Your AI Provider"}),f.jsx("p",{style:Te.subtitle,children:"ArchByte uses AI to analyze your codebase and generate architecture diagrams. Choose a provider to get started."})]}),f.jsx("div",{style:Te.stepIndicator,children:[1,2,3].map(N=>f.jsxs("div",{style:Te.stepRow,children:[f.jsx("div",{style:{...Te.stepDot,background:N<=r?"#7c3aed":"#3a3a4a",color:N<=r?"#fff":"#888"},children:N}),f.jsx("span",{style:{...Te.stepLabel,color:N<=r?"#ccc":"#666"},children:N===1?"Provider":N===2?"API Key":"Confirm"}),N<3&&f.jsx("div",{style:{...Te.stepLine,background:N<r?"#7c3aed":"#3a3a4a"}})]},N))}),r===1&&f.jsx("div",{style:Te.stepContent,children:f.jsx("div",{style:Te.providerGrid,children:PN.map(N=>f.jsxs("button",{style:{...Te.providerCard,borderColor:(s==null?void 0:s.key)===N.key?"#7c3aed":"#5a5a7a"},onClick:()=>y(N),onMouseEnter:k=>{k.currentTarget.style.borderColor="#7c3aed",k.currentTarget.style.background="#2a2a3e"},onMouseLeave:k=>{(s==null?void 0:s.key)!==N.key&&(k.currentTarget.style.borderColor="#5a5a7a"),k.currentTarget.style.background="#252536"},children:[f.jsx("div",{style:Te.providerIcon,children:N.icon}),f.jsx("div",{style:Te.providerName,children:N.name}),f.jsx("div",{style:Te.providerModels,children:N.models}),f.jsx("div",{style:Te.providerDesc,children:N.description}),!N.requiresKey&&f.jsx("div",{style:Te.noKeyBadge,children:"No API key needed"})]},N.key))})}),r===2&&s&&f.jsx("div",{style:Te.stepContent,children:f.jsxs("div",{style:Te.keySection,children:[f.jsxs("div",{style:Te.selectedProviderBadge,children:[f.jsx("span",{style:Te.providerIconSmall,children:s.icon}),f.jsx("span",{children:s.name})]}),f.jsx("label",{style:Te.label,children:"API Key"}),f.jsx("input",{type:"password",value:c,onChange:N=>{u(N.target.value),v(null)},placeholder:`Enter your ${s.name} API key`,style:Te.input,autoFocus:!0,onKeyDown:N=>{N.key==="Enter"&&x()}}),f.jsxs("p",{style:Te.keyHint,children:["Your key is stored locally in ",f.jsx("code",{style:Te.code,children:".archbyte/config.json"})," and never sent to external servers."]}),g&&f.jsx("div",{style:Te.error,children:g}),f.jsxs("div",{style:Te.buttonRow,children:[f.jsx("button",{style:Te.backBtn,onClick:E,children:"Back"}),f.jsx("button",{style:{...Te.primaryBtn,opacity:c.trim()?1:.5,cursor:c.trim()?"pointer":"not-allowed"},onClick:x,disabled:!c.trim(),children:"Continue"})]})]})}),r===3&&s&&f.jsx("div",{style:Te.stepContent,children:f.jsxs("div",{style:Te.confirmSection,children:[f.jsx("div",{style:Te.confirmIcon,children:"✓"}),f.jsx("h3",{style:Te.confirmTitle,children:"Ready to Analyze"}),f.jsxs("div",{style:Te.confirmDetails,children:[f.jsxs("div",{style:Te.confirmRow,children:[f.jsx("span",{style:Te.confirmLabel,children:"Provider"}),f.jsxs("span",{style:Te.confirmValue,children:[f.jsx("span",{style:Te.providerIconSmall,children:s.icon}),s.name]})]}),f.jsxs("div",{style:Te.confirmRow,children:[f.jsx("span",{style:Te.confirmLabel,children:"Models"}),f.jsx("span",{style:Te.confirmValue,children:s.models})]}),s.requiresKey&&f.jsxs("div",{style:Te.confirmRow,children:[f.jsx("span",{style:Te.confirmLabel,children:"API Key"}),f.jsxs("span",{style:Te.confirmValue,children:["*".repeat(Math.min(c.length,8)),"...",c.slice(-4)]})]})]}),g&&f.jsx("div",{style:Te.error,children:g}),f.jsxs("div",{style:Te.buttonRow,children:[f.jsx("button",{style:Te.backBtn,onClick:E,children:"Back"}),f.jsx("button",{style:{...Te.runBtn,opacity:h?.6:1,cursor:h?"wait":"pointer"},onClick:_,disabled:h,children:h?"Saving...":"Run First Analysis"})]})]})})]})})}const Te={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,backdropFilter:"blur(4px)"},modal:{background:"#1e1e2e",border:"1px solid #5a5a7a",borderRadius:16,padding:"36px 40px",maxWidth:600,width:"90vw",maxHeight:"90vh",overflowY:"auto"},header:{textAlign:"center",marginBottom:24},headerIcon:{fontSize:36,marginBottom:8,color:"#7c3aed"},title:{color:"#fff",margin:"0 0 8px",fontSize:22,fontWeight:700},subtitle:{color:"#999",margin:0,fontSize:14,lineHeight:1.5},stepIndicator:{display:"flex",alignItems:"center",justifyContent:"center",gap:0,marginBottom:28},stepRow:{display:"flex",alignItems:"center",gap:6},stepDot:{width:26,height:26,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,flexShrink:0},stepLabel:{fontSize:12,fontWeight:500},stepLine:{width:40,height:2,marginLeft:6,marginRight:6,borderRadius:1},stepContent:{minHeight:200},providerGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:14},providerCard:{background:"#252536",border:"1px solid #5a5a7a",borderRadius:12,padding:"20px 16px",cursor:"pointer",textAlign:"left",transition:"border-color 0.15s, background 0.15s",display:"flex",flexDirection:"column",gap:6},providerIcon:{width:40,height:40,borderRadius:10,background:"#3a3a5a",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:800,color:"#7c3aed",marginBottom:4},providerName:{color:"#fff",fontSize:16,fontWeight:600},providerModels:{color:"#aaa",fontSize:12,lineHeight:1.4},providerDesc:{color:"#777",fontSize:11,lineHeight:1.4},noKeyBadge:{marginTop:4,fontSize:10,color:"#4ade80",fontWeight:600,textTransform:"uppercase",letterSpacing:.5},keySection:{display:"flex",flexDirection:"column",gap:14},selectedProviderBadge:{display:"inline-flex",alignItems:"center",gap:8,background:"#2a2a3e",border:"1px solid #5a5a7a",borderRadius:8,padding:"8px 14px",color:"#ccc",fontSize:14,fontWeight:500,alignSelf:"flex-start"},providerIconSmall:{width:22,height:22,borderRadius:6,background:"#3a3a5a",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:800,color:"#7c3aed"},label:{color:"#ccc",fontSize:13,fontWeight:600},input:{width:"100%",padding:"12px 14px",background:"#161622",border:"1px solid #5a5a7a",borderRadius:8,color:"#fff",fontSize:14,outline:"none",fontFamily:"'JetBrains Mono', monospace",boxSizing:"border-box"},keyHint:{color:"#777",fontSize:12,margin:0,lineHeight:1.4},code:{background:"#2a2a3e",padding:"2px 6px",borderRadius:4,fontSize:11,color:"#aaa"},error:{color:"#f87171",fontSize:13,padding:"8px 12px",background:"rgba(248, 113, 113, 0.1)",border:"1px solid rgba(248, 113, 113, 0.3)",borderRadius:8},buttonRow:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:8},backBtn:{padding:"10px 20px",background:"transparent",border:"1px solid #5a5a7a",borderRadius:8,color:"#aaa",fontSize:14,cursor:"pointer",fontWeight:500},primaryBtn:{padding:"10px 24px",background:"#7c3aed",border:"none",borderRadius:8,color:"#fff",fontSize:14,cursor:"pointer",fontWeight:600},confirmSection:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:12},confirmIcon:{width:52,height:52,borderRadius:"50%",background:"rgba(124, 58, 237, 0.15)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:26,color:"#7c3aed"},confirmTitle:{color:"#fff",fontSize:18,fontWeight:600,margin:0},confirmDetails:{width:"100%",maxWidth:360,background:"#252536",border:"1px solid #5a5a7a",borderRadius:10,padding:"14px 18px",display:"flex",flexDirection:"column",gap:10,textAlign:"left"},confirmRow:{display:"flex",justifyContent:"space-between",alignItems:"center"},confirmLabel:{color:"#888",fontSize:13},confirmValue:{color:"#ddd",fontSize:13,fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},runBtn:{padding:"12px 28px",background:"linear-gradient(135deg, #7c3aed, #6d28d9)",border:"none",borderRadius:8,color:"#fff",fontSize:15,cursor:"pointer",fontWeight:700,letterSpacing:.3}},IN={"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"}},Br={critical:0,high:1,medium:2,low:3};function Ns({severity:t}){const r={critical:"var(--accent-red)",high:"hsl(25 95% 53%)",medium:"var(--accent-amber)",low:"var(--accent-green)"},o={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 f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r[t],background:o[t],border:`1px solid ${s[t]}`,whiteSpace:"nowrap"},children:t})}function TN({value:t}){const r=Math.round(t*100);return f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[f.jsx("div",{style:{flex:1,height:3,borderRadius:2,background:"var(--bg-hover)"},children:f.jsx("div",{style:{width:`${r}%`,height:"100%",borderRadius:2,background:r>=80?"var(--accent-green)":r>=50?"var(--accent-amber)":"var(--accent-red)"}})}),f.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600,minWidth:28},children:[r,"%"]})]})}function zN({status:t}){const o={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 f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:o.color,background:o.bg,border:`1px solid ${o.border}`},children:t})}function RN({status:t}){const o={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 f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:o.color,background:o.bg,border:`1px solid ${o.border}`},children:t})}function AN({driftType:t}){const o={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 f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:o.color,background:o.bg,border:`1px solid ${o.border}`},children:t})}function LN({data:t}){const r=[...t.findings].sort((o,s)=>Br[o.severity]-Br[s.severity]);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No findings"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${o.severity==="critical"?"var(--accent-red)":o.severity==="high"?"hsl(25 95% 53%)":o.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:o.owaspId}),f.jsx(Ns,{severity:o.severity})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:o.title}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:o.description}),o.affectedComponent&&f.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Component: ",o.affectedComponent]})]},s))})}function DN({data:t}){return t.statuses.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No compliance data"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.statuses.map((r,o)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[f.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:r.framework}),f.jsx(zN,{status:r.status})]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[f.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:f.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"}})}),f.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:500,minWidth:40,textAlign:"right"},children:[r.passing,"/",r.controls]})]}),r.findings.length>0&&f.jsx("div",{style:{marginTop:4},children:r.findings.map((s,a)=>f.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"2px 0",lineHeight:1.4},children:["- ",s]},a))})]},o))})}function $N({data:t}){const r=[...t.bottlenecks].sort((o,s)=>Br[o.severity]-Br[s.severity]);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No bottlenecks detected"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${o.severity==="critical"?"var(--accent-red)":o.severity==="high"?"hsl(25 95% 53%)":o.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:o.component}),f.jsx(Ns,{severity:o.severity})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:o.metric}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:o.description}),o.recommendation&&f.jsx("div",{style:{fontSize:10,color:"var(--accent-cyan)",marginTop:4,fontStyle:"italic"},children:o.recommendation})]},s))})}function ON({data:t}){const r=[...t.risks].sort((o,s)=>s.riskScore-o.riskScore);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No risks identified"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsxs("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:[o.package,f.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",marginLeft:4},children:["@",o.version]})]}),f.jsx(Ns,{severity:o.severity})]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[f.jsx("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600},children:"Risk"}),f.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:f.jsx("div",{style:{width:`${o.riskScore}%`,height:"100%",borderRadius:2,background:o.riskScore>=75?"var(--accent-red)":o.riskScore>=50?"var(--accent-amber)":"var(--accent-green)",transition:"width 0.3s"}})}),f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",minWidth:28},children:o.riskScore})]}),o.reasons.length>0&&f.jsx("div",{style:{marginTop:2},children:o.reasons.map((a,c)=>f.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"1px 0",lineHeight:1.4},children:["- ",a]},c))})]},s))})}function FN({data:t}){const r=[...t.steps].sort((o,s)=>o.order-s.order);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No migration plan"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${o.status==="completed"?"var(--accent-green)":o.status==="in-progress"?"var(--accent-amber)":"var(--border-color)"}`,opacity:o.status==="completed"?.7:1},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsxs("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)"},children:["Step ",o.order]}),f.jsx(RN,{status:o.status})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:o.title}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:o.description}),o.estimatedEffort&&f.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Effort: ",o.estimatedEffort]})]},s))})}function HN({data:t}){const r=[...t.mismatches].sort((o,s)=>Br[o.severity]-Br[s.severity]);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No mismatches found"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${o.severity==="critical"?"var(--accent-red)":o.severity==="high"?"hsl(25 95% 53%)":o.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--accent-cyan)",fontFamily:"'JetBrains Mono', monospace"},children:o.endpoint}),f.jsx(Ns,{severity:o.severity})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:4},children:o.field}),f.jsxs("div",{style:{display:"flex",gap:8,fontSize:10},children:[f.jsxs("div",{style:{flex:1},children:[f.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Spec"}),f.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:o.specValue})]}),f.jsxs("div",{style:{flex:1},children:[f.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Impl"}),f.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:o.implValue})]})]})]},s))})}function VN({data:t}){const r=[...t.detections].sort((o,s)=>Br[o.severity]-Br[s.severity]);return r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No drift detected"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:r.map((o,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${o.severity==="critical"?"var(--accent-red)":o.severity==="high"?"hsl(25 95% 53%)":o.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:o.component}),f.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[f.jsx(AN,{driftType:o.driftType}),f.jsx(Ns,{severity:o.severity})]})]}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:o.description}),f.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:new Date(o.detectedAt).toLocaleString()})]},s))})}function BN({visible:t,onClose:r,results:o}){const[s,a]=P.useState(new Set),[c,u]=P.useState(!1),[h,m]=P.useState([]),g=P.useCallback(k=>{a(S=>{const I=new Set(S);return I.has(k)?I.delete(k):I.add(k),I})},[]),v=P.useCallback(async()=>{u(!0);try{const k=await fetch("http://localhost:3847/api/premium-agents/results");if(k.ok){const S=await k.json();Array.isArray(S)&&m(S)}}catch{}u(!1)},[]);P.useEffect(()=>{t&&v()},[t,v]);const y=o.length>0?o:h,x=new Map;y.forEach(k=>{x.set(k.agentId,k)});const _=["security-audit","compliance","performance","dependency-risk","migration","api-contracts","drift-detection"];function E(k){const S=k.data;switch(S.agentId){case"security-audit":return S.findings.length;case"compliance":return S.statuses.length;case"performance":return S.bottlenecks.length;case"dependency-risk":return S.risks.length;case"migration":return S.steps.length;case"api-contracts":return S.mismatches.length;case"drift-detection":return S.detections.length}}function N(k){const S=k.data;switch(S.agentId){case"security-audit":return f.jsx(LN,{data:S});case"compliance":return f.jsx(DN,{data:S});case"performance":return f.jsx($N,{data:S});case"dependency-risk":return f.jsx(ON,{data:S});case"migration":return f.jsx(FN,{data:S});case"api-contracts":return f.jsx(HN,{data:S});case"drift-detection":return f.jsx(VN,{data:S})}}return t?f.jsxs("div",{style:{position:"absolute",top:16,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:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 14px 8px",borderBottom:"1px solid var(--border-color)"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"1px",color:"var(--text-muted)"},children:"Pro Agents"}),f.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:3,background:"#7c3aed",color:"#fff"},children:"PRO"})]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[f.jsx("button",{className:"panel-btn cyan small",onClick:v,disabled:c,children:c?"...":"Refresh"}),f.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]})]}),f.jsx("div",{style:{padding:"8px 10px 12px"},children:c&&y.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:"Loading agent results..."}):y.length===0?f.jsxs("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:["No premium agent results yet.",f.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"})]}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:_.map(k=>{const S=x.get(k);if(!S)return null;const I=IN[k],C=s.has(k),j=E(S);return f.jsxs("div",{style:{borderRadius:8,border:"1px solid var(--border-color)",overflow:"hidden"},children:[f.jsxs("div",{onClick:()=>g(k),style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 10px",background:C?"var(--bg-tertiary)":"transparent",cursor:"pointer",transition:"background 0.15s",userSelect:"none"},onMouseEnter:O=>{C||(O.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:O=>{C||(O.currentTarget.style.background="transparent")},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{style:{fontSize:12},children:I.icon}),f.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)"},children:I.label}),j>0&&f.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"0px 5px",borderRadius:8,background:"var(--bg-hover)",color:"var(--text-secondary)"},children:j})]}),f.jsx("div",{style:{display:"flex",alignItems:"center",gap:6},children:f.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace",transition:"transform 0.2s",transform:C?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"})})]}),C&&f.jsxs("div",{style:{padding:"6px 10px 10px"},children:[f.jsxs("div",{style:{marginBottom:8},children:[f.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginBottom:3,fontWeight:500},children:"Confidence"}),f.jsx(TN,{value:S.confidence})]}),N(S),f.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:8,textAlign:"right",fontFamily:"'JetBrains Mono', monospace"},children:new Date(S.timestamp).toLocaleString()})]})]},k)})})}),y.length>0&&f.jsxs("div",{style:{padding:"8px 14px",borderTop:"1px solid var(--border-color)",fontSize:10,color:"var(--text-muted)",textAlign:"center"},children:[y.length," of ",_.length," agents reporting"]})]}):null}const WN=P.memo(BN);function ii(t,r){return!t||t.length===0?!0:t.includes(r)}const UN=1500,YN={architecture:bg};function XN(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,_)=>{m.set(x.id,{x:100+_*250,y:g})}),y.length>0&&(g+=180)}),Object.entries(h).forEach(([v,y])=>{u.includes(v)||(y.forEach((x,_)=>{m.set(x.id,{x:100+_*250,y:g})}),g+=180)}),t.map(v=>{const 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 Ep(t,r="#64748b"){return t.map(o=>({id:o.id,source:o.source,target:o.target,label:o.label||void 0,labelStyle:o.label?{fill:"var(--text-secondary)",fontSize:10,fontWeight:500,fontFamily:"'JetBrains Mono', monospace"}:void 0,labelBgStyle:o.label?{fill:"var(--bg-secondary)",fillOpacity:.85,rx:4,ry:4}:void 0,labelBgPadding:[4,3],style:{stroke:o.color||r,strokeWidth:2,...o.style==="dashed"&&{strokeDasharray:"8 4"}},animated:o.animated||!1,type:"smoothstep",markerEnd:{type:hs.ArrowClosed,width:16,height:16,color:o.color||r}}))}function GN(){var Ps,_i,Er;const[t,r,o]=Hk([]),[s,a,c]=Vk([]),[u,h]=P.useState(null),[m,g]=P.useState(!1),[v,y]=P.useState(null),[x]=P.useState([]),[_,E]=P.useState(!0),[N,k]=P.useState(null),[S,I]=P.useState({loggedIn:!1,email:null,tier:"free",features:{analyze:!0,validate:!1,patrol:!1,workflows:!1,chat:!1,premiumAgents:!1}}),[C,j]=P.useState(!1),[O,A]=P.useState(null),[H,q]=P.useState(!1),[J,ee]=P.useState(null),[,U]=P.useState(null),[X,re]=P.useState(null),[b,K]=P.useState(null),[V,G]=P.useState(-1),[z,R]=P.useState(!1),[B,M]=P.useState(new Set),[$,se]=P.useState(!1),[oe,de]=P.useState(new Set),[fe,me]=P.useState(new Set),[te,pe]=P.useState(null),[_e,be]=P.useState("layer"),[je,Ee]=P.useState(!1),[Ae,He]=P.useState(!1),[Re,Ue]=P.useState(!1),[st,ht]=P.useState("patrol"),[vt,pt]=P.useState(!1),[pn,zn]=P.useState([]),[xt,Rn]=P.useState("develop"),[,en]=P.useState([]),[mn,An]=P.useState(),[Wr,tn]=P.useState(null),[_t,mi]=P.useState(null),[gn,Bt]=P.useState(new Map),[Ur,pr]=P.useState(!1),nn=P.useRef([]),[qn,Yr]=P.useState([]),Xr=50,[,rn]=P.useState([]),[,on]=P.useState([]),[sn,jo]=P.useState(new Set),[jt,Gr]=P.useState(new Set),[ut,Kr]=P.useState(()=>{const D=localStorage.getItem("archbyte-theme");return D==="dark"||D==="light"?D:"dark"});P.useEffect(()=>{document.documentElement.setAttribute("data-theme",ut),localStorage.setItem("archbyte-theme",ut)},[ut]);const[Qr,It]=P.useState(!1),[yn,Ln]=P.useState(""),[Zn,vn]=P.useState(new Set),[mr,xn]=P.useState(!1),[et,gi]=P.useState(null),Jn=ut==="dark"?"#64748b":"#94a3b8",bo="#fff",Wt=20,Tt=10,wn=P.useCallback(async()=>{try{await vi()}catch(D){console.error("Failed to load architecture:",D),k("Failed to connect to server"),Ye()}finally{E(!1)}},[]),yi=async()=>{try{const D=await fetch("http://localhost:3847/api/tools-git");if(D.ok){const W=await D.json();mi(W)}}catch{}},Po=async()=>{try{const D=await fetch("http://localhost:3847/api/config");if(D.ok){const W=await D.json();if(U(W),W.environments){An(W.environments);const ne=Object.keys(W.environments);ne.length>0&&!ne.includes(xt)&&Rn(ne[0])}}}catch{}},Mo=async()=>{try{const D=await fetch("http://localhost:3847/api/license");if(D.ok){const W=await D.json();I(W),j(!0)}}catch{j(!0)}},Io=async()=>{try{const D=await fetch("http://localhost:3847/api/project");if(D.ok){const W=await D.json();W&&re(W)}}catch{}},To=async()=>{try{const D=await fetch("http://localhost:3847/api/analysis-status");if(D.ok){const W=await D.json();(W==null?void 0:W.status)==="error"&&W.error?ee(W.error):ee(null)}}catch{}},vi=async()=>{const D="http://localhost:3847/events",W="http://localhost:3847/api/architecture";yi(),Po(),Io(),Mo(),To();try{const ne=new EventSource(D);return ne.onopen=()=>{console.log("SSE connected"),g(!0),k(null)},ne.onmessage=ie=>{try{const ae=JSON.parse(ie.data);console.log("SSE message:",ae.type),ae.architecture&&Zr(ae.architecture),ae.type==="git_update"&&ae.gitInfo&&en(ae.gitInfo),ae.type==="premium_agent_result"&&ae.premiumResults&&zn(ae.premiumResults)}catch(ae){console.error("Failed to parse SSE message:",ae)}},ne.onerror=ie=>{console.error("SSE error:",ie),ne.close(),g(!1),qr(W)},()=>ne.close()}catch{qr(W)}},qr=async D=>{try{const W=await fetch(D);if(W.ok){const ne=await W.json();Zr(ne),g(!0)}else Ye()}catch{Ye()}},Ye=()=>{const D={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};Zr(D)},Zr=D=>{h(D),y(D.lastUpdated),D.gitInfo&&en(D.gitInfo),D.environments&&An(D.environments)};P.useEffect(()=>{if(!u)return;const D=u.nodes.filter(ie=>ii(ie.environments,xt)&&!oe.has(ie.id)&&!fe.has(ie.layer)),W=new Set(D.map(ie=>ie.id)),ne=u.edges.filter(ie=>ii(ie.environments,xt)&&W.has(ie.source)&&W.has(ie.target));r(XN(D)),a(Ep(ne,Jn))},[u,xt,oe,fe,Jn]),P.useEffect(()=>{wn()},[wn]),P.useEffect(()=>{if(!z||!b)return;const D=setInterval(()=>{G(W=>{const ne=W+1;if(ne>=b.steps.length)return M(new Set([b.steps[0].edge])),0;const ie=new Set;for(let ae=0;ae<=ne;ae++)ie.add(b.steps[ae].edge);return M(ie),ne})},UN);return()=>clearInterval(D)},[z,b]),P.useEffect(()=>{if(!u)return;const D=u.nodes.filter(ge=>ii(ge.environments,xt)),W=new Set(D.map(ge=>ge.id)),ne=u.edges.filter(ge=>ii(ge.environments,xt)&&W.has(ge.source)&&W.has(ge.target)),ie=new Map;b&&b.steps.forEach((ge,Ne)=>{ie.has(ge.edge)||ie.set(ge.edge,Ne+1)});const ae=ne.map(ge=>{const Ne=B.has(ge.id),xe=b==null?void 0:b.steps.some(We=>We.edge===ge.id),Pe=ie.get(ge.id);return{id:ge.id,source:ge.source,target:ge.target,label:Ne&&Pe?`${Pe}`:void 0,labelStyle:Ne&&Pe?{fill:bo,fontWeight:700,fontSize:12,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:Ne&&Pe?{fill:(b==null?void 0:b.color)||"#3b82f6",fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:Ne?(b==null?void 0:b.color)||ge.color:ge.color||Jn,strokeWidth:Ne?6:3,opacity:b?xe?1:.15:1,filter:Ne?"brightness(0.85) saturate(1.4)":void 0},animated:Ne,type:"smoothstep"}});a(ae)},[B,b,u,xt,Jn,bo]);const gr=D=>{K(D),G(0),M(new Set([D.steps[0].edge])),R(!0),se(!0)},Dn=()=>{if(R(!1),K(null),G(-1),M(new Set),se(!1),u){const D=u.nodes.filter(ie=>ii(ie.environments,xt)),W=new Set(D.map(ie=>ie.id)),ne=u.edges.filter(ie=>ii(ie.environments,xt)&&W.has(ie.source)&&W.has(ie.target));a(Ep(ne,Jn))}},yr=()=>{R(!1)},xi=()=>{b&&R(!0)},er=P.useRef(oe);P.useEffect(()=>{er.current=oe},[oe]);const Be=P.useCallback(()=>{rn(D=>{const W={nodes:[...nn.current],edges:[...s],hiddenNodeIds:new Set(er.current)},ne=[...D,W];return ne.length>Xr&&ne.shift(),ne}),on([])},[s]),zt=P.useCallback(D=>{tn(D),setTimeout(()=>tn(null),3e3)},[]),wi=P.useCallback(D=>{Be(),de(W=>new Set([...W,D])),pe(null)},[Be]),bt=P.useCallback(D=>{de(W=>{const ne=new Set(W);return ne.delete(D),ne})},[]),Si=P.useCallback(()=>{de(new Set)},[]),ki=P.useCallback(D=>{me(W=>{const ne=new Set(W);return ne.has(D)?ne.delete(D):ne.add(D),ne})},[]),Ei=P.useCallback((D,W)=>{pe(W.id)},[]),vr=P.useCallback(()=>{pe(null)},[]);P.useEffect(()=>{nn.current=t},[t]);const xr=P.useCallback(D=>{o(D);const W=D.some(ie=>ie.type==="position"&&ie.dragging===!1&&ie.position),ne=D.some(ie=>ie.type==="dimensions"&&ie.dimensions&&ie.resizing===!1);(W||ne)&&Be(),D.forEach(ie=>{if(ie.type==="position"&&ie.dragging===!1&&ie.position){const ae=nn.current.find(ge=>ge.id===ie.id);ae&&Bt(ge=>{var Pe,We,Xe,lt;const Ne=new Map(ge),xe=Ne.get(ie.id);return Ne.set(ie.id,{id:ie.id,x:ie.position.x,y:ie.position.y,width:(xe==null?void 0:xe.width)??((Pe=ae.style)==null?void 0:Pe.width)??((We=ae.data)==null?void 0:We.width)??100,height:(xe==null?void 0:xe.height)??((Xe=ae.style)==null?void 0:Xe.height)??((lt=ae.data)==null?void 0:lt.height)??60}),Ne})}if(ie.type==="dimensions"&&ie.dimensions&&ie.resizing===!1){const ae=nn.current.find(ge=>ge.id===ie.id);ae&&Bt(ge=>{const Ne=new Map(ge),xe=Ne.get(ie.id);return Ne.set(ie.id,{id:ie.id,x:(xe==null?void 0:xe.x)??ae.position.x,y:(xe==null?void 0:xe.y)??ae.position.y,width:ie.dimensions.width,height:ie.dimensions.height}),Ne})}})},[o,Be]),Rt=P.useCallback(async()=>{if(gn.size!==0){pr(!0);try{const D=Array.from(gn.values()),W=await fetch("http://localhost:3847/api/update-positions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:D})});if(W.ok)Bt(new Map),console.log("Changes saved successfully");else{const ne=await W.json();console.error("Failed to save changes:",ne)}}catch(D){console.error("Error saving changes:",D)}finally{pr(!1)}}},[gn]),wr=P.useCallback(()=>{Bt(new Map),wn()},[wn]),Jr=P.useCallback(()=>{rn(D=>{if(D.length===0)return D;const W=[...D],ne=W.pop();if(on(ie=>[...ie,{nodes:[...nn.current],edges:[...s],hiddenNodeIds:new Set(er.current)}]),r(ne.nodes),a(ne.edges),de(ne.hiddenNodeIds),u){const ie=new Map;ne.nodes.forEach(ae=>{var Ne,xe,Pe,We;const ge=u.nodes.find(Xe=>Xe.id===ae.id);if(ge){const Xe=ae.position.x,lt=ae.position.y,De=((Ne=ae.style)==null?void 0:Ne.width)??((xe=ae.data)==null?void 0:xe.width)??100,rt=((Pe=ae.style)==null?void 0:Pe.height)??((We=ae.data)==null?void 0:We.height)??60;(Xe!==ge.x||lt!==ge.y||De!==ge.width||rt!==ge.height)&&ie.set(ae.id,{id:ae.id,x:Xe,y:lt,width:De,height:rt})}}),Bt(ie)}return W})},[s,r,a,u]),zo=P.useCallback(()=>{on(D=>{if(D.length===0)return D;const W=[...D],ne=W.pop();if(rn(ie=>[...ie,{nodes:[...nn.current],edges:[...s],hiddenNodeIds:new Set(er.current)}]),r(ne.nodes),a(ne.edges),de(ne.hiddenNodeIds),u){const ie=new Map;ne.nodes.forEach(ae=>{var Ne,xe,Pe,We;const ge=u.nodes.find(Xe=>Xe.id===ae.id);if(ge){const Xe=ae.position.x,lt=ae.position.y,De=((Ne=ae.style)==null?void 0:Ne.width)??((xe=ae.data)==null?void 0:xe.width)??100,rt=((Pe=ae.style)==null?void 0:Pe.height)??((We=ae.data)==null?void 0:We.height)??60;(Xe!==ge.x||lt!==ge.y||De!==ge.width||rt!==ge.height)&&ie.set(ae.id,{id:ae.id,x:Xe,y:lt,width:De,height:rt})}}),Bt(ie)}return W})},[s,r,a,u]),eo=P.useCallback(({nodes:D})=>{Gr(new Set(D.map(W=>W.id))),D.length===1?pe(D[0].id):D.length===0&&pe(null)},[]),tr=P.useCallback(()=>{if(jt.size===0&&!te)return;Be();const D=jt.size>0?jt:new Set([te]);de(W=>new Set([...W,...D])),Gr(new Set),pe(null)},[jt,te,Be]),Sr=P.useCallback(()=>{const D=jt.size>0?jt:te?new Set([te]):new Set;if(D.size===0)return;const W=t.filter(ne=>D.has(ne.id));Yr(W)},[t,jt,te]),$n=P.useCallback(()=>{if(qn.length===0)return;Be();const D=50,W=qn.map((ne,ie)=>{var ae;return{...ne,id:`${ne.id}-copy-${Date.now()}-${ie}`,position:{x:ne.position.x+D,y:ne.position.y+D},selected:!0,data:{...ne.data,label:`${((ae=ne.data)==null?void 0:ae.label)||ne.id} (copy)`}}});r(ne=>[...ne.map(ie=>({...ie,selected:!1})),...W]),W.forEach(ne=>{Bt(ie=>{var ge,Ne,xe,Pe;const ae=new Map(ie);return ae.set(ne.id,{id:ne.id,x:ne.position.x,y:ne.position.y,width:((ge=ne.style)==null?void 0:ge.width)||((Ne=ne.data)==null?void 0:Ne.width)||100,height:((xe=ne.style)==null?void 0:xe.height)||((Pe=ne.data)==null?void 0:Pe.height)||60}),ae})})},[qn,r,Be]),On=P.useCallback((D,W)=>{const ne=jt.size>0?jt:te?new Set([te]):new Set;ne.size!==0&&(Be(),r(ie=>ie.map(ae=>{if(ne.has(ae.id)&&!sn.has(ae.id)){const ge={x:ae.position.x+D,y:ae.position.y+W};return Bt(Ne=>{var Pe,We,Xe,lt;const xe=new Map(Ne);return xe.set(ae.id,{id:ae.id,x:ge.x,y:ge.y,width:((Pe=ae.style)==null?void 0:Pe.width)||((We=ae.data)==null?void 0:We.width)||100,height:((Xe=ae.style)==null?void 0:Xe.height)||((lt=ae.data)==null?void 0:lt.height)||60}),xe}),{...ae,position:ge}}return ae})))},[jt,te,sn,r,Be]),to=P.useCallback(D=>{jo(W=>{const ne=new Set(W);return ne.has(D)?ne.delete(D):ne.add(D),ne})},[]),Ve=P.useCallback(D=>{const W={id:`edge-${D.source}-${D.target}-${Date.now()}`,source:D.source,target:D.target,type:"smoothstep",animated:!0,style:{stroke:ut==="dark"?"#868e96":"#6b7280",strokeWidth:2}};a(ne=>wm(W,ne))},[a,ut]),Cs=P.useCallback((D,W)=>{Be(),a(ne=>i1(D,W,ne))},[a,Be]),_s=P.useCallback(async()=>{const D=document.querySelector(".react-flow");if(D){It(!0);try{const W=await sN(D,{backgroundColor:ut==="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=W,ne.click()}catch(W){console.error("Failed to export PNG:",W)}finally{It(!1)}}},[ut]),Ni=P.useCallback(async()=>{const D=document.querySelector(".react-flow");if(D){It(!0);try{const W=await jg(D,{backgroundColor:ut==="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=W,ne.click()}catch(W){console.error("Failed to export SVG:",W)}finally{It(!1)}}},[ut]),kr=P.useCallback(async D=>{It(!0);try{const W=await fetch(`http://localhost:3847/api/export?format=${D}`);if(!W.ok)throw new Error("Export failed");const ne=await W.blob(),ie=D==="mermaid"?"mmd":D==="plantuml"?"puml":D==="markdown"?"md":D,ae=document.createElement("a");ae.download=`architecture.${ie}`,ae.href=URL.createObjectURL(ne),ae.click(),URL.revokeObjectURL(ae.href)}catch(W){console.error(`Failed to export ${D}:`,W)}finally{It(!1)}},[]),js=P.useCallback(()=>{if(!u)return;Be();const D=250,W=100,ne=100,ie=t.map((ae,ge)=>({...ae,position:{x:W+ge*D,y:ne}}));r(ie),be("horizontal")},[u,t,r,Be]),bs=P.useCallback(()=>{if(!u)return;Be();const D=150,W=100,ne=100,ie=t.map((ae,ge)=>({...ae,position:{x:W,y:ne+ge*D}}));r(ie),be("vertical")},[u,t,r,Be]),Ci=P.useCallback(()=>{if(!u)return;Be();const D=280,W=180,ne=100,ie=100,ae=Math.ceil(Math.sqrt(t.length)),ge=t.map((Ne,xe)=>({...Ne,position:{x:ne+xe%ae*D,y:ie+Math.floor(xe/ae)*W}}));r(ge),be("grid")},[u,t,r,Be]),Ro=P.useCallback(()=>{if(!u)return;Be();const D=320,W=160,ne=100,ie=100,ae=new Set(t.map(De=>De.id)),ge=new Map,Ne=new Map;ae.forEach(De=>{ge.set(De,0),Ne.set(De,[])}),s.forEach(De=>{ae.has(De.source)&&ae.has(De.target)&&(Ne.get(De.source).push(De.target),ge.set(De.target,(ge.get(De.target)||0)+1))});const xe=new Map,Pe=[];for(ge.forEach((De,rt)=>{De===0&&(Pe.push(rt),xe.set(rt,0))});Pe.length>0;){const De=Pe.shift(),rt=xe.get(De);for(const Sn of Ne.get(De)||[]){const Yt=rt+1;(!xe.has(Sn)||xe.get(Sn)<Yt)&&xe.set(Sn,Yt),ge.set(Sn,ge.get(Sn)-1),ge.get(Sn)===0&&Pe.push(Sn)}}t.forEach(De=>{xe.has(De.id)||xe.set(De.id,0)});const We=new Map;t.forEach(De=>{const rt=xe.get(De.id);We.has(rt)||We.set(rt,[]),We.get(rt).push(De)});const Xe=[];[...We.keys()].sort((De,rt)=>De-rt).forEach((De,rt)=>{We.get(De).forEach((Yt,ji)=>{Xe.push({...Yt,position:{x:ne+rt*D,y:ie+ji*W}})})}),r(Xe),be("flow")},[u,t,s,r,Be]),Fn=P.useCallback(()=>{if(!u)return;Be();const D=250,W=180,ne=100,ie=100,ae={};t.forEach(Pe=>{var Xe;const We=((Xe=Pe.data)==null?void 0:Xe.layer)||"application";ae[We]||(ae[We]=[]),ae[We].push(Pe)});const ge=["presentation","application","data","external","deployment"];let Ne=ie;const xe=[];ge.forEach(Pe=>{const We=ae[Pe]||[];We.forEach((Xe,lt)=>{xe.push({...Xe,position:{x:ne+lt*D,y:Ne}})}),We.length>0&&(Ne+=W)}),Object.entries(ae).forEach(([Pe,We])=>{ge.includes(Pe)||(We.forEach((Xe,lt)=>{xe.push({...Xe,position:{x:ne+lt*D,y:Ne}})}),Ne+=W)}),r(xe),be("layer")},[u,t,r,Be]),Ut=P.useCallback(D=>{if(!D||!u){vn(new Set);return}const W=new Set;W.add(D),u.edges.forEach(ne=>{ne.source===D&&(W.add(ne.target),W.add(ne.id)),ne.target===D&&(W.add(ne.source),W.add(ne.id))}),vn(W)},[u]),Hn=P.useMemo(()=>{if(!yn.trim())return new Set;const D=yn.toLowerCase(),W=new Set;return t.forEach(ne=>{var ae;(((ae=ne.data)==null?void 0:ae.label)||"").toLowerCase().includes(D)&&W.add(ne.id)}),W},[yn,t]),no=P.useCallback(async D=>{try{await fetch("http://localhost:3847/api/open-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:D})})}catch(W){console.error("Failed to open file:",W)}},[]),ro=P.useCallback((D,W)=>{if(!u)return;const ne=u.nodes.find(ie=>ie.id===W.id);ne&&(gi(ne),xn(!0))},[u]);P.useEffect(()=>{const D=W=>{if(W.target instanceof HTMLInputElement||W.target instanceof HTMLTextAreaElement)return;const ie=navigator.platform.toUpperCase().indexOf("MAC")>=0?W.metaKey:W.ctrlKey;if(W.key==="Backspace"||W.key==="Delete"){W.preventDefault(),tr();return}if(ie&&W.key==="c"){W.preventDefault(),Sr();return}if(ie&&W.key==="v"){W.preventDefault(),$n();return}if(ie&&W.shiftKey&&W.key==="z"){W.preventDefault(),zo();return}if(ie&&W.key==="z"){W.preventDefault(),Jr();return}if(ie&&W.key==="s"){W.preventDefault(),Rt();return}if(W.key==="Escape"){Ln(""),vn(new Set),xn(!1);return}if(W.key==="ArrowUp"){W.preventDefault(),On(0,W.shiftKey?-Tt*5:-Tt);return}if(W.key==="ArrowDown"){W.preventDefault(),On(0,W.shiftKey?Tt*5:Tt);return}if(W.key==="ArrowLeft"){W.preventDefault(),On(W.shiftKey?-Tt*5:-Tt,0);return}if(W.key==="ArrowRight"){W.preventDefault(),On(W.shiftKey?Tt*5:Tt,0);return}if(ie&&W.key==="l"&&te){W.preventDefault(),to(te);return}};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[tr,Sr,$n,Rt,On,to,te,Jr,zo]);const ln=P.useMemo(()=>u?u.nodes.filter(D=>oe.has(D.id)):[],[u,oe]);return P.useEffect(()=>{u&&r(D=>D.map(W=>({...W,data:{...W.data,highlighted:W.id===Wr}})))},[Wr,u]),_?f.jsx("div",{className:"app",children:f.jsxs("div",{className:"loading",children:[f.jsx("div",{className:"loading-spinner"}),"Loading architecture..."]})}):f.jsxs("div",{className:"app",children:[f.jsxs("div",{className:"branding-header",children:[f.jsxs("div",{className:"archbyte-brand",children:[f.jsx("img",{src:"/logo.png",alt:"ArchByte",className:"archbyte-logo-img"}),f.jsx("span",{className:"archbyte-name",children:"ArchByte"}),X?f.jsx(EN,{projectInfo:X}):f.jsx("span",{className:"archbyte-tagline",children:"See what agents build. As they build it."})]}),S.loggedIn&&f.jsx("div",{className:"branding-account",children:S.email&&f.jsxs("span",{className:"account-email",children:[S.email,S.tier==="premium"&&f.jsx("span",{className:"account-pro-tag",children:"PRO"})]})})]}),f.jsxs("div",{className:"toolbar",children:[f.jsxs("div",{className:"toolbar-left",children:[f.jsxs("div",{className:"toolbar-section",children:[f.jsx("span",{className:"toolbar-section-label",children:"View"}),f.jsxs("div",{className:"toolbar-section-items",children:[f.jsx("input",{type:"text",placeholder:"Search nodes...",value:yn,onChange:D=>Ln(D.target.value),className:"toolbar-search"}),f.jsxs(Ll,{trigger:"→ Layout ▾",triggerClassName:"toolbar-btn",children:[f.jsx("button",{className:`dropdown-item ${_e==="flow"?"active":""}`,onClick:Ro,children:"→ Flow"}),f.jsx("button",{className:`dropdown-item ${_e==="grid"?"active":""}`,onClick:Ci,children:"⊡ Grid"}),f.jsx("button",{className:`dropdown-item ${_e==="layer"?"active":""}`,onClick:Fn,children:"⊞ By Layer"}),f.jsx("button",{className:`dropdown-item ${_e==="horizontal"?"active":""}`,onClick:js,children:"↔ Horizontal"}),f.jsx("button",{className:`dropdown-item ${_e==="vertical"?"active":""}`,onClick:bs,children:"↕ Vertical"})]}),f.jsx(Ll,{trigger:fe.size>0?`☰ Layers (${5-fe.size}/5) ▾`:"☰ Layers ▾",triggerClassName:`toolbar-btn ${fe.size>0?"has-hidden":""}`,children:["presentation","application","data","external","deployment"].map(D=>f.jsxs("button",{className:`dropdown-item layer-dropdown-item ${fe.has(D)?"hidden-layer":""}`,onClick:()=>ki(D),children:[f.jsx("div",{className:`legend-color ${D}`}),f.jsx("span",{children:D.charAt(0).toUpperCase()+D.slice(1)}),f.jsx("span",{className:"layer-toggle-indicator",children:fe.has(D)?"○":"●"})]},D))})]})]}),f.jsxs("div",{className:"toolbar-section",children:[f.jsx("span",{className:"toolbar-section-label",children:"Analyze"}),f.jsxs("div",{className:"toolbar-section-items",children:[f.jsx("button",{className:`toolbar-btn premium-btn ${S.features.validate?"":"premium-locked"} ${Ae?"active":""}`,onClick:()=>{if(!S.features.validate){A("Validate");return}He(!Ae)},children:"Validate"}),f.jsxs(Ll,{trigger:b?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"flow-dot-inline",style:{background:b.color}}),b.name]}):"▶ Flows ▾",triggerClassName:`toolbar-btn ${b?"has-active-flow":""}`,children:[b&&f.jsxs(f.Fragment,{children:[f.jsx("button",{className:"dropdown-item flow-clear",onClick:Dn,children:"⏹ Clear active flow"}),f.jsx("div",{className:"dropdown-separator"})]}),u!=null&&u.flows&&u.flows.length>0?(()=>{const D=["user-journey","data-pipeline","system","deployment","error-recovery"],W={"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 Ne of u.flows){const xe=Ne.category||"system";ie[xe]||(ie[xe]=[]),ie[xe].push(Ne)}const ae=[];for(const Ne of D){const xe=ie[Ne];if(xe!=null&&xe.length){ae.push(f.jsxs("div",{className:"flow-category-header",children:[f.jsx("span",{className:"flow-dot-inline",style:{background:ne[Ne]}}),W[Ne]||Ne]},`cat-${Ne}`));for(const Pe of xe)ae.push(f.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(b==null?void 0:b.id)===Pe.id?"active":""}`,onClick:()=>{(b==null?void 0:b.id)===Pe.id?Dn():gr(Pe)},children:[f.jsx("span",{className:"flow-dot-inline",style:{background:Pe.color}}),f.jsx("span",{className:"flow-dropdown-name",children:Pe.name}),(b==null?void 0:b.id)===Pe.id&&f.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Pe.id))}}const ge=new Set(D);for(const[Ne,xe]of Object.entries(ie))if(!ge.has(Ne)&&xe!=null&&xe.length){ae.push(f.jsxs("div",{className:"flow-category-header",children:[f.jsx("span",{className:"flow-dot-inline",style:{background:"#6b7280"}}),Ne]},`cat-${Ne}`));for(const Pe of xe)ae.push(f.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(b==null?void 0:b.id)===Pe.id?"active":""}`,onClick:()=>{(b==null?void 0:b.id)===Pe.id?Dn():gr(Pe)},children:[f.jsx("span",{className:"flow-dot-inline",style:{background:Pe.color}}),f.jsx("span",{className:"flow-dropdown-name",children:Pe.name}),(b==null?void 0:b.id)===Pe.id&&f.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Pe.id))}return ae})():f.jsx("span",{className:"dropdown-item disabled",children:"No flows defined"})]})]})]}),f.jsxs("div",{className:"toolbar-section",children:[f.jsx("span",{className:"toolbar-section-label",children:"Ops"}),f.jsxs("div",{className:"toolbar-section-items",children:[f.jsx("button",{className:`toolbar-btn premium-btn ${S.features.patrol?"":"premium-locked"} ${Re&&st==="patrol"?"active":""}`,title:S.features.patrol?"":"Available in Pro",onClick:()=>{if(!S.features.patrol){A("Patrol");return}Re&&st==="patrol"?Ue(!1):(ht("patrol"),Ue(!0),pt(!1))},children:"Patrol"}),f.jsx("button",{className:`toolbar-btn premium-btn ${S.features.patrol?"":"premium-locked"} ${Re&&st==="workflow"?"active":""}`,title:S.features.patrol?"":"Available in Pro",onClick:()=>{if(!S.features.patrol){A("Workflows");return}Re&&st==="workflow"?Ue(!1):(ht("workflow"),Ue(!0),pt(!1))},children:"Workflows"}),f.jsx("button",{className:`toolbar-btn premium-btn ${S.features.premiumAgents?"":"premium-locked"} ${vt?"active":""}`,title:S.features.premiumAgents?"":"Available in Pro",onClick:()=>{if(!S.features.premiumAgents){A("Pro Agents");return}vt?pt(!1):(pt(!0),Ue(!1))},children:"Agents"})]})]})]}),f.jsxs("div",{className:"toolbar-right",children:[J&&f.jsx("button",{className:"toolbar-btn toolbar-error-btn",onClick:()=>ee(null),title:J,children:"Analysis failed"}),f.jsx("button",{className:`toolbar-btn ${je?"active":""}`,onClick:()=>Ee(!je),children:"Stats"}),f.jsxs(Ll,{trigger:Qr?"Exporting...":"↓ Export ▾",triggerClassName:"toolbar-btn",disabled:Qr,children:[f.jsx("div",{className:"dropdown-label",children:"Image"}),f.jsx("button",{className:"dropdown-item",onClick:_s,children:"PNG — Raster image"}),f.jsx("button",{className:"dropdown-item",onClick:Ni,children:"SVG — Vector image"}),f.jsx("div",{className:"dropdown-separator"}),f.jsx("div",{className:"dropdown-label",children:"Diagram"}),f.jsx("button",{className:"dropdown-item",onClick:()=>kr("mermaid"),children:"Mermaid — .mmd"}),f.jsx("button",{className:"dropdown-item",onClick:()=>kr("plantuml"),children:"PlantUML — .puml"}),f.jsx("button",{className:"dropdown-item",onClick:()=>kr("dot"),children:"Graphviz DOT — .dot"}),f.jsx("div",{className:"dropdown-separator"}),f.jsx("div",{className:"dropdown-label",children:"Document"}),f.jsx("button",{className:"dropdown-item",onClick:()=>kr("markdown"),children:"Markdown — .md"}),f.jsx("button",{className:"dropdown-item",onClick:()=>kr("json"),children:"JSON — .json"})]}),f.jsx("button",{className:"toolbar-btn-icon",onClick:()=>Kr(ut==="dark"?"light":"dark"),title:`Switch to ${ut==="dark"?"light":"dark"} mode`,children:ut==="dark"?"☀":"☽"})]})]}),f.jsx(fN,{selectedEnvironment:xt,environments:mn,onSelectEnvironment:Rn}),f.jsxs("div",{className:"canvas-container",children:[f.jsx("div",{className:"watermark",children:"archbyte"}),f.jsxs(fg,{nodes:t.map(D=>({...D,draggable:!sn.has(D.id),data:{...D.data,locked:sn.has(D.id),isConnected:Zn.size>0?Zn.has(D.id):null,isSearchMatch:yn?Hn.has(D.id):null}})),edges:s.map(D=>{var W;return{...D,style:{...D.style,opacity:Zn.size>0?Zn.has(D.id)?1:.15:1,strokeWidth:Zn.has(D.id)?3:((W=D.style)==null?void 0:W.strokeWidth)||2}}}),onNodesChange:xr,onEdgesChange:c,onNodeClick:(D,W)=>{Ei(D,W),Ut(W.id)},onNodeDoubleClick:ro,onPaneClick:()=>{vr(),Ut(null)},onConnect:Ve,onReconnect:Cs,edgesReconnectable:!0,onSelectionChange:eo,nodeTypes:YN,connectionMode:Eo.Loose,snapToGrid:!0,snapGrid:[Wt,Wt],selectionOnDrag:!0,selectNodesOnDrag:!1,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,attributionPosition:"bottom-left",deleteKeyCode:null,children:[f.jsx(pg,{color:ut==="dark"?"hsl(220 25% 15%)":"hsl(220 15% 82%)",gap:20,variant:Gn.Dots}),f.jsx(gg,{})]}),te&&f.jsxs("div",{className:"node-actions-panel",children:[f.jsxs("div",{className:"node-actions-title",children:[sn.has(te)&&f.jsx("span",{className:"lock-icon",children:"🔒"}),((_i=(Ps=t.find(D=>D.id===te))==null?void 0:Ps.data)==null?void 0:_i.label)||te]}),f.jsxs("div",{className:"node-actions-buttons",children:[f.jsx("button",{className:`panel-btn ${sn.has(te)?"amber":"cyan"}`,onClick:()=>to(te),title:"Lock/Unlock (Cmd+L)",children:sn.has(te)?"🔓 Unlock":"🔒 Lock"}),f.jsx("button",{className:"panel-btn red",onClick:()=>wi(te),title:"Hide (Delete key)",children:"Hide"})]}),f.jsx("div",{className:"node-actions-hint",children:"Arrow keys to move • Shift for faster"})]}),mr&&et&&f.jsxs("div",{className:"node-details-panel",children:[f.jsxs("div",{className:"node-details-header",children:[f.jsxs("div",{children:[f.jsx("div",{className:"node-details-title",children:et.label.split(`
|
|
68
|
-
`)[0]}),f.jsxs("div",{className:"node-details-type",children:[et.layer," • ",et.type]})]}),f.jsx("button",{className:"panel-close-btn",onClick:()=>xn(!1),children:"×"})]}),et.path&&f.jsxs("div",{className:"node-details-section",children:[f.jsx("div",{className:"node-details-section-title",children:"Path"}),f.jsx("div",{className:"node-details-path",children:et.path})]}),et.techStack&&et.techStack.length>0&&f.jsxs("div",{className:"node-details-section",children:[f.jsx("div",{className:"node-details-section-title",children:"Tech Stack"}),f.jsx("div",{className:"node-details-tech-stack",children:et.techStack.map((D,W)=>f.jsx("span",{className:"tech-badge",children:D},W))})]}),f.jsxs("div",{className:"node-details-section",children:[f.jsx("div",{className:"node-details-section-title",children:"Connections"}),f.jsxs("div",{className:"node-details-connections",children:[u==null?void 0:u.edges.filter(D=>D.source===et.id||D.target===et.id).map(D=>{const W=D.source===et.id,ne=W?D.target:D.source,ie=u==null?void 0:u.nodes.find(ae=>ae.id===ne);return f.jsxs("div",{className:"connection-item-detailed",children:[f.jsxs("div",{className:"connection-header",children:[f.jsx("span",{className:"connection-arrow",children:W?"→":"←"}),f.jsx("span",{className:"connection-target",children:(ie==null?void 0:ie.label.split(`
|
|
69
|
-
`)[0])||ne})]}),D.label&&f.jsx("div",{className:"connection-label",children:D.label})]},D.id)}),(u==null?void 0:u.edges.filter(D=>D.source===et.id||D.target===et.id).length)===0&&f.jsx("span",{style:{color:"var(--text-muted)"},children:"No connections"})]})]}),f.jsxs("div",{className:"node-details-actions",children:[et.path&&f.jsx("button",{className:"panel-btn cyan",onClick:()=>no(et.path),children:"Open in VS Code"}),f.jsx("button",{className:"panel-btn",onClick:()=>{Ut(et.id),xn(!1)},children:"Highlight Deps"})]})]}),gn.size>0&&f.jsxs("div",{className:"save-panel",children:[f.jsxs("span",{className:"save-panel-text",children:[gn.size," unsaved change",gn.size!==1?"s":""]}),f.jsx("button",{className:"save-btn",onClick:Rt,disabled:Ur,children:Ur?"Saving...":"Save Changes"}),f.jsx("button",{className:"discard-btn",onClick:wr,disabled:Ur,children:"Discard"})]}),ln.length>0&&f.jsxs("div",{className:"hidden-nodes-panel",children:[f.jsxs("div",{className:"hidden-nodes-title",children:["Hidden (",ln.length,")",f.jsx("button",{className:"panel-btn cyan small",onClick:Si,children:"Show All"})]}),f.jsx("div",{className:"hidden-nodes-list",style:{maxHeight:220,overflowY:"auto"},children:ln.map(D=>f.jsxs("div",{className:"hidden-node-item",children:[f.jsx("span",{className:"hidden-node-name",children:D.label.split(`
|
|
70
|
-
`)[0]}),f.jsx("button",{className:"panel-btn green small",onClick:()=>bt(D.id),children:"Show"})]},D.id))})]}),b&&f.jsxs("div",{className:"flow-progress-bar",children:[f.jsx("span",{className:"flow-progress-dot",style:{background:b.color}}),f.jsx("span",{className:"flow-progress-name",children:b.name}),f.jsx("div",{className:"flow-progress-steps",children:b.steps.map((D,W)=>f.jsx("div",{className:`flow-progress-step ${W<=V?"active":""} ${W===V?"current":""}`,style:{borderColor:W<=V?b.color:void 0},title:D.label,children:D.label},W))}),f.jsxs("div",{className:"flow-progress-controls",children:[z?f.jsx("button",{className:"flow-progress-btn",onClick:yr,title:"Pause",children:"⏸"}):f.jsx("button",{className:"flow-progress-btn",onClick:xi,title:"Resume",children:"▶"}),f.jsx("button",{className:"flow-progress-btn stop",onClick:Dn,title:"Stop",children:"⏹"})]})]}),$&&b&&u&&f.jsx(bN,{flow:b,architecture:u,onClose:Dn}),f.jsx(gN,{visible:je,onClose:()=>Ee(!1)}),f.jsx(vN,{visible:Ae,onClose:()=>He(!1),onHighlightNode:D=>{zt(D),Ut(D)}}),Re&&f.jsxs("div",{className:"ops-panel",children:[f.jsxs("div",{className:"ops-header",children:[f.jsxs("div",{className:"ops-tabs",children:[f.jsx("button",{className:`ops-tab ${st==="patrol"?"active":""}`,onClick:()=>ht("patrol"),children:"Patrol"}),f.jsx("button",{className:`ops-tab ${st==="workflow"?"active":""}`,onClick:()=>ht("workflow"),children:"Workflows"})]}),f.jsx("button",{className:"panel-close-btn",onClick:()=>Ue(!1),children:"x"})]}),f.jsx(wN,{visible:st==="patrol"}),f.jsx(kN,{visible:st==="workflow"})]}),f.jsx(WN,{visible:vt,onClose:()=>pt(!1),results:pn}),x.length>0&&f.jsxs("div",{className:"agent-panel",children:[f.jsx("div",{className:"agent-panel-title",children:"Agent Activity"}),x.map((D,W)=>f.jsxs("div",{className:"agent-item",children:[f.jsx("div",{className:`agent-dot ${W===0?"active":""}`}),f.jsx("span",{className:"agent-name",children:D.agentName}),f.jsx("span",{className:"agent-target",children:D.targetComponent||D.action})]},W))]})]}),f.jsxs("div",{className:"status-bar",children:[f.jsxs("div",{className:"status-left",children:[f.jsxs("div",{className:"status-indicator",children:[f.jsx("div",{className:`status-dot ${m?"":"disconnected"}`}),f.jsx("span",{children:m?"Live":"Offline"})]}),N&&f.jsx("span",{style:{color:"var(--accent-red)"},children:N})]}),f.jsx("div",{className:"status-center"}),f.jsxs("div",{className:"status-right",children:[f.jsx("span",{children:v?`Updated ${new Date(v).toLocaleTimeString()}`:"Waiting..."}),_t?f.jsxs("span",{className:"git-status",children:[_t.repo&&f.jsx("a",{href:((Er=_t.remoteUrl)==null?void 0:Er.replace(/^git@([^:]+):/,"https://$1/").replace(/\.git$/,""))||"#",target:"_blank",rel:"noopener noreferrer",className:"git-repo-badge",title:_t.remoteUrl||"",children:_t.repo}),f.jsx("span",{className:"git-branch",children:_t.branch}),f.jsx("span",{className:"git-hash",children:_t.commit})]}):f.jsxs("span",{children:["v",(u==null?void 0:u.version)||1]})]})]}),H&&f.jsx(MN,{onComplete:()=>{q(!1),wn()}}),O&&f.jsx(lN,{feature:O,onClose:()=>A(null)})]})}u0.createRoot(document.getElementById("root")).render(f.jsx(Np.StrictMode,{children:f.jsx(GN,{})}));
|