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
|
@@ -0,0 +1,70 @@
|
|
|
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 u of a)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function o(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(a){if(a.ep)return;a.ep=!0;const u=o(a);fetch(a.href,u)}})();function yc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Du={exports:{}},Qi={},$u={exports:{}},De={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Jf;function r0(){if(Jf)return De;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"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),g=Symbol.iterator;function v(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,N={};function k(M,D,ie){this.props=M,this.context=D,this.refs=N,this.updater=ie||C}k.prototype.isReactComponent={},k.prototype.setState=function(M,D){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,D,"setState")},k.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function S(){}S.prototype=k.prototype;function I(M,D,ie){this.props=M,this.context=D,this.refs=N,this.updater=ie||C}var _=I.prototype=new S;_.constructor=I,E(_,k.prototype),_.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,D,ie){var oe,de={},he=null,me=null;if(D!=null)for(oe in D.ref!==void 0&&(me=D.ref),D.key!==void 0&&(he=""+D.key),D)O.call(D,oe)&&!H.hasOwnProperty(oe)&&(de[oe]=D[oe]);var ne=arguments.length-2;if(ne===1)de.children=ie;else if(1<ne){for(var pe=Array(ne),be=0;be<ne;be++)pe[be]=arguments[be+2];de.children=pe}if(M&&M.defaultProps)for(oe in ne=M.defaultProps,ne)de[oe]===void 0&&(de[oe]=ne[oe]);return{$$typeof:t,type:M,key:he,ref:me,props:de,_owner:A.current}}function J(M,D){return{$$typeof:t,type:M.type,key:D,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 D={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(ie){return D[ie]})}var X=/\/+/g;function re(M,D){return typeof M=="object"&&M!==null&&M.key!=null?U(""+M.key):D.toString(36)}function P(M,D,ie,oe,de){var he=typeof M;(he==="undefined"||he==="boolean")&&(M=null);var me=!1;if(M===null)me=!0;else switch(he){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)?(ie="",M!=null&&(ie=M.replace(X,"$&/")+"/"),P(de,D,ie,"",function(be){return be})):de!=null&&(ee(de)&&(de=J(de,ie+(!de.key||me&&me.key===de.key?"":(""+de.key).replace(X,"$&/")+"/")+M)),D.push(de)),1;if(me=0,oe=oe===""?".":oe+":",j(M))for(var ne=0;ne<M.length;ne++){he=M[ne];var pe=oe+re(he,ne);me+=P(he,D,ie,pe,de)}else if(pe=v(M),typeof pe=="function")for(M=pe.call(M),ne=0;!(he=M.next()).done;)he=he.value,pe=oe+re(he,ne++),me+=P(he,D,ie,pe,de);else if(he==="object")throw D=String(M),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.");return me}function K(M,D,ie){if(M==null)return M;var oe=[],de=0;return P(M,oe,"","",function(he){return D.call(ie,he,de++)}),oe}function V(M){if(M._status===-1){var D=M._result;D=D(),D.then(function(ie){(M._status===0||M._status===-1)&&(M._status=1,M._result=ie)},function(ie){(M._status===0||M._status===-1)&&(M._status=2,M._result=ie)}),M._status===-1&&(M._status=0,M._result=D)}if(M._status===1)return M._result.default;throw M._result}var G={current:null},R={transition:null},z={ReactCurrentDispatcher:G,ReactCurrentBatchConfig:R,ReactCurrentOwner:A};function B(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:K,forEach:function(M,D,ie){K(M,function(){D.apply(this,arguments)},ie)},count:function(M){var D=0;return K(M,function(){D++}),D},toArray:function(M){return K(M,function(D){return D})||[]},only:function(M){if(!ee(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},De.Component=k,De.Fragment=o,De.Profiler=a,De.PureComponent=I,De.StrictMode=s,De.Suspense=m,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z,De.act=B,De.cloneElement=function(M,D,ie){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,he=M.ref,me=M._owner;if(D!=null){if(D.ref!==void 0&&(he=D.ref,me=A.current),D.key!==void 0&&(de=""+D.key),M.type&&M.type.defaultProps)var ne=M.type.defaultProps;for(pe in D)O.call(D,pe)&&!H.hasOwnProperty(pe)&&(oe[pe]=D[pe]===void 0&&ne!==void 0?ne[pe]:D[pe])}var pe=arguments.length-2;if(pe===1)oe.children=ie;else if(1<pe){ne=Array(pe);for(var be=0;be<pe;be++)ne[be]=arguments[be+2];oe.children=ne}return{$$typeof:t,type:M.type,key:de,ref:he,props:oe,_owner:me}},De.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:u,_context:M},M.Consumer=M},De.createElement=q,De.createFactory=function(M){var D=q.bind(null,M);return D.type=M,D},De.createRef=function(){return{current:null}},De.forwardRef=function(M){return{$$typeof:h,render:M}},De.isValidElement=ee,De.lazy=function(M){return{$$typeof:x,_payload:{_status:-1,_result:M},_init:V}},De.memo=function(M,D){return{$$typeof:y,type:M,compare:D===void 0?null:D}},De.startTransition=function(M){var D=R.transition;R.transition={};try{M()}finally{R.transition=D}},De.unstable_act=B,De.useCallback=function(M,D){return G.current.useCallback(M,D)},De.useContext=function(M){return G.current.useContext(M)},De.useDebugValue=function(){},De.useDeferredValue=function(M){return G.current.useDeferredValue(M)},De.useEffect=function(M,D){return G.current.useEffect(M,D)},De.useId=function(){return G.current.useId()},De.useImperativeHandle=function(M,D,ie){return G.current.useImperativeHandle(M,D,ie)},De.useInsertionEffect=function(M,D){return G.current.useInsertionEffect(M,D)},De.useLayoutEffect=function(M,D){return G.current.useLayoutEffect(M,D)},De.useMemo=function(M,D){return G.current.useMemo(M,D)},De.useReducer=function(M,D,ie){return G.current.useReducer(M,D,ie)},De.useRef=function(M){return G.current.useRef(M)},De.useState=function(M){return G.current.useState(M)},De.useSyncExternalStore=function(M,D,ie){return G.current.useSyncExternalStore(M,D,ie)},De.useTransition=function(){return G.current.useTransition()},De.version="18.3.1",De}var eh;function hs(){return eh||(eh=1,$u.exports=r0()),$u.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 o0(){if(th)return Qi;th=1;var t=hs(),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,u={key:!0,ref:!0,__self:!0,__source:!0};function c(h,m,y){var x,g={},v=null,C=null;y!==void 0&&(v=""+y),m.key!==void 0&&(v=""+m.key),m.ref!==void 0&&(C=m.ref);for(x in m)s.call(m,x)&&!u.hasOwnProperty(x)&&(g[x]=m[x]);if(h&&h.defaultProps)for(x in m=h.defaultProps,m)g[x]===void 0&&(g[x]=m[x]);return{$$typeof:r,type:h,key:v,ref:C,props:g,_owner:a.current}}return Qi.Fragment=o,Qi.jsx=c,Qi.jsxs=c,Qi}var nh;function i0(){return nh||(nh=1,Du.exports=o0()),Du.exports}var f=i0(),b=hs();const Cp=yc(b);var kl={},Ou={exports:{}},Ot={},Fu={exports:{}},Hu={};/**
|
|
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 s0(){return rh||(rh=1,(function(t){function r(R,z){var B=R.length;R.push(z);e:for(;0<B;){var M=B-1>>>1,D=R[M];if(0<a(D,z))R[M]=z,R[B]=D,B=M;else break e}}function o(R){return R.length===0?null:R[0]}function s(R){if(R.length===0)return null;var z=R[0],B=R.pop();if(B!==z){R[0]=B;e:for(var M=0,D=R.length,ie=D>>>1;M<ie;){var oe=2*(M+1)-1,de=R[oe],he=oe+1,me=R[he];if(0>a(de,B))he<D&&0>a(me,de)?(R[M]=me,R[he]=B,M=he):(R[M]=de,R[oe]=B,M=oe);else if(he<D&&0>a(me,B))R[M]=me,R[he]=B,M=he;else break e}}return z}function a(R,z){var B=R.sortIndex-z.sortIndex;return B!==0?B:R.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,h=c.now();t.unstable_now=function(){return c.now()-h}}var m=[],y=[],x=1,g=null,v=3,C=!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 _(R){for(var z=o(y);z!==null;){if(z.callback===null)s(y);else if(z.startTime<=R)s(y),z.sortIndex=z.expirationTime,r(m,z);else break;z=o(y)}}function j(R){if(N=!1,_(R),!E)if(o(m)!==null)E=!0,V(O);else{var z=o(y);z!==null&&G(j,z.startTime-R)}}function O(R,z){E=!1,N&&(N=!1,S(q),q=-1),C=!0;var B=v;try{for(_(z),g=o(m);g!==null&&(!(g.expirationTime>z)||R&&!U());){var M=g.callback;if(typeof M=="function"){g.callback=null,v=g.priorityLevel;var D=M(g.expirationTime<=z);z=t.unstable_now(),typeof D=="function"?g.callback=D:g===o(m)&&s(m),_(z)}else s(m);g=o(m)}if(g!==null)var ie=!0;else{var oe=o(y);oe!==null&&G(j,oe.startTime-z),ie=!1}return ie}finally{g=null,v=B,C=!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 R=t.unstable_now();ee=R;var z=!0;try{z=H(!0,R)}finally{z?re():(A=!1,H=null)}}else A=!1}var re;if(typeof I=="function")re=function(){I(X)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,K=P.port2;P.port1.onmessage=X,re=function(){K.postMessage(null)}}else re=function(){k(X,0)};function V(R){H=R,A||(A=!0,re())}function G(R,z){q=k(function(){R(t.unstable_now())},z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(R){R.callback=null},t.unstable_continueExecution=function(){E||C||(E=!0,V(O))},t.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<R?Math.floor(1e3/R):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_getFirstCallbackNode=function(){return o(m)},t.unstable_next=function(R){switch(v){case 1:case 2:case 3:var z=3;break;default:z=v}var B=v;v=z;try{return R()}finally{v=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(R,z){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var B=v;v=R;try{return z()}finally{v=B}},t.unstable_scheduleCallback=function(R,z,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,R){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=B+D,R={id:x++,callback:z,priorityLevel:R,startTime:B,expirationTime:D,sortIndex:-1},B>M?(R.sortIndex=B,r(y,R),o(m)===null&&R===o(y)&&(N?(S(q),q=-1):N=!0,G(j,B-M))):(R.sortIndex=D,r(m,R),E||C||(E=!0,V(O))),R},t.unstable_shouldYield=U,t.unstable_wrapCallback=function(R){var z=v;return function(){var B=v;v=z;try{return R.apply(this,arguments)}finally{v=B}}}})(Hu)),Hu}var oh;function l0(){return oh||(oh=1,Fu.exports=s0()),Fu.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 a0(){if(ih)return Ot;ih=1;var t=hs(),r=l0();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 u(e,n){c(e,n),c(e+"Capture",n)}function c(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,y=/^[: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]*$/,x={},g={};function v(e){return m.call(g,e)?!0:m.call(x,e)?!1:y.test(e)?g[e]=!0:(x[e]=!0,!1)}function C(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"||C(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 _(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?v(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"),P=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),R=Symbol.iterator;function z(e){return e===null||typeof e!="object"?null:(e=R&&e[R]||e["@@iterator"],typeof e=="function"?e:null)}var B=Object.assign,M;function D(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 ie=!1;function oe(e,n){if(!e||ie)return"";ie=!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{ie=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?D(e):""}function de(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("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 he(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case H:return"Fragment";case A:return"Portal";case J:return"Profiler";case q:return"StrictMode";case re:return"Suspense";case P: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:he(e.type)||"Memo";case V:n=e._payload,e=e._init;try{return he(e(n))}catch{}}return null}function me(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(n);case 8:return n===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 ne(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 be(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 _e(e){e._valueTracker||(e._valueTracker=be(e))}function Ce(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 ze(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=ne(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 Ae(e,n){n=n.checked,n!=null&&_(e,"checked",n,!1)}function Ge(e,n){Ae(e,n);var i=ne(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")?ft(e,n.type,i):n.hasOwnProperty("defaultValue")&&ft(e,n.type,ne(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Ct(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 ft(e,n,i){(n!=="number"||Ee(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var yt=Array.isArray;function ht(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=""+ne(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 hn(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(yt(i)){if(1<i.length)throw Error(o(93));i=i[0]}n=i}n==null&&(n=""),i=n}e._wrapperState={initialValue:ne(i)}}function vt(e,n){var i=ne(n.value),l=ne(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 An(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Jt(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 pn(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Jt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ln,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(Ln=Ln||document.createElement("div"),Ln.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Ln.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function en(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},fi=["Webkit","ms","Moz","O"];Object.keys(_t).forEach(function(e){fi.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),_t[n]=_t[e]})});function mn(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 Vt(e,n){e=e.style;for(var i in n)if(n.hasOwnProperty(i)){var l=i.indexOf("--")===0,d=mn(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 tn(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 Kn=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,nn=null,rn=null;function on(e){if(e=Ai(e)){if(typeof Xr!="function")throw Error(o(280));var n=e.stateNode;n&&(n=Ds(n),Xr(e.stateNode,e.type,n))}}function No(e){nn?rn?rn.push(e):rn=[e]:nn=e}function jt(){if(nn){var e=nn,n=rn;if(rn=nn=null,on(e),n)for(e=0;e<n.length;e++)on(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,(nn!==null||rn!==null)&&(ut(),jt())}}function It(e,n){var i=e.stateNode;if(i===null)return null;var l=Ds(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 gn=!1;if(h)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){gn=!0}}),window.addEventListener("test",Dn,Dn),window.removeEventListener("test",Dn,Dn)}catch{gn=!1}function Qn(e,n,i,l,d,p,w,T,L){var Z=Array.prototype.slice.call(arguments,3);try{n.apply(i,Z)}catch(ue){this.onError(ue)}}var yn=!1,mr=null,vn=!1,tt=null,hi={onError:function(e){yn=!0,mr=e}};function qn(e,n,i,l,d,p,w,T,L){yn=!1,mr=null,Qn.apply(hi,arguments)}function Co(e,n,i,l,d,p,w,T,L){if(qn.apply(this,arguments),yn){if(yn){var Z=mr;yn=!1,mr=null}else throw Error(o(198));vn||(vn=!0,tt=Z)}}function Bt(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 xn(e){if(Bt(e)!==e)throw Error(o(188))}function pi(e){var n=e.alternate;if(!n){if(n=Bt(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 xn(d),e;if(p===l)return xn(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 _o(e){return e=pi(e),e!==null?jo(e):null}function jo(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=jo(e);if(n!==null)return n;e=e.sibling}return null}var bo=r.unstable_scheduleCallback,Po=r.unstable_cancelCallback,mi=r.unstable_shouldYield,qr=r.unstable_requestPaint,Ue=r.unstable_now,Zr=r.unstable_getCurrentPriorityLevel,gr=r.unstable_ImmediatePriority,$n=r.unstable_UserBlockingPriority,yr=r.unstable_NormalPriority,gi=r.unstable_LowPriority,Zn=r.unstable_IdlePriority,We=null,Rt=null;function yi(e){if(Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(We,e,void 0,(e.current.flags&128)===128)}catch{}}var bt=Math.clz32?Math.clz32:wi,vi=Math.log,xi=Math.LN2;function wi(e){return e>>>=0,e===0?32:31-(vi(e)/xi|0)|0}var vr=64,On=4194304;function sn(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 Jn(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=sn(T):(p&=w,p!==0&&(l=sn(p)))}else w=i&~d,w!==0?l=sn(w):p!==0&&(l=sn(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 Si(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 xr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function er(){var e=vr;return vr<<=1,(vr&4194240)===0&&(vr=64),e}function wr(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function Wt(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 Sr(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 ki(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 Ss(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var ks,tr,eo,Es,Ns,Ei=!1,kr=[],wn=null,Sn=null,kn=null,$=new Map,W=new Map,te=[],se="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 ae(e,n){switch(e){case"focusin":case"focusout":wn=null;break;case"dragenter":case"dragleave":Sn=null;break;case"mouseover":case"mouseout":kn=null;break;case"pointerover":case"pointerout":$.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":W.delete(n.pointerId)}}function ge(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=Ai(n),n!==null&&tr(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function je(e,n,i,l,d){switch(n){case"focusin":return wn=ge(wn,e,n,i,l,d),!0;case"dragenter":return Sn=ge(Sn,e,n,i,l,d),!0;case"mouseover":return kn=ge(kn,e,n,i,l,d),!0;case"pointerover":var p=d.pointerId;return $.set(p,ge($.get(p)||null,e,n,i,l,d)),!0;case"gotpointercapture":return p=d.pointerId,W.set(p,ge(W.get(p)||null,e,n,i,l,d)),!0}return!1}function Se(e){var n=to(e.target);if(n!==null){var i=Bt(n);if(i!==null){if(n=i.tag,n===13){if(n=Tt(i),n!==null){e.blockedOn=n,Ns(e.priority,function(){eo(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 Pe(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=ca(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);Kn=l,i.target.dispatchEvent(l),Kn=null}else return n=Ai(i),n!==null&&tr(n),e.blockedOn=i,!1;n.shift()}return!0}function Be(e,n,i){Pe(e)&&i.delete(n)}function Ye(){Ei=!1,wn!==null&&Pe(wn)&&(wn=null),Sn!==null&&Pe(Sn)&&(Sn=null),kn!==null&&Pe(kn)&&(kn=null),$.forEach(Be),W.forEach(Be)}function ot(e,n){e.blockedOn===n&&(e.blockedOn=null,Ei||(Ei=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Ye)))}function Le(e){function n(d){return ot(d,e)}if(0<kr.length){ot(kr[0],e);for(var i=1;i<kr.length;i++){var l=kr[i];l.blockedOn===e&&(l.blockedOn=null)}}for(wn!==null&&ot(wn,e),Sn!==null&&ot(Sn,e),kn!==null&&ot(kn,e),$.forEach(n),W.forEach(n),i=0;i<te.length;i++)l=te[i],l.blockedOn===e&&(l.blockedOn=null);for(;0<te.length&&(i=te[0],i.blockedOn===null);)Se(i),i.blockedOn===null&&te.shift()}var Ke=j.ReactCurrentBatchConfig,Ut=!0;function Mo(e,n,i,l){var d=Ve,p=Ke.transition;Ke.transition=null;try{Ve=1,ua(e,n,i,l)}finally{Ve=d,Ke.transition=p}}function aa(e,n,i,l){var d=Ve,p=Ke.transition;Ke.transition=null;try{Ve=4,ua(e,n,i,l)}finally{Ve=d,Ke.transition=p}}function ua(e,n,i,l){if(Ut){var d=ca(e,n,i,l);if(d===null)ja(e,n,l,Cs,i),ae(e,l);else if(je(d,e,n,i,l))l.stopPropagation();else if(ae(e,l),n&4&&-1<se.indexOf(e)){for(;d!==null;){var p=Ai(d);if(p!==null&&ks(p),p=ca(e,n,i,l),p===null&&ja(e,n,l,Cs,i),p===d)break;d=p}d!==null&&l.stopPropagation()}else ja(e,n,l,null,i)}}var Cs=null;function ca(e,n,i,l){if(Cs=null,e=Yr(l),e=to(e),e!==null)if(n=Bt(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 Cs=e,null}function $c(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 $n:return 4;case yr:case gi:return 16;case Zn:return 536870912;default:return 16}default:return 16}}var Er=null,da=null,_s=null;function Oc(){if(_s)return _s;var e,n=da,i=n.length,l,d="value"in Er?Er.value:Er.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 _s=d.slice(e,1<l?1-l:void 0)}function js(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 bs(){return!0}function Fc(){return!1}function Yt(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)?bs:Fc,this.isPropagationStopped=Fc,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=bs)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=bs)},persist:function(){},isPersistent:bs}),n}var Io={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fa=Yt(Io),Ni=B({},Io,{view:0,detail:0}),Mg=Yt(Ni),ha,pa,Ci,Ps=B({},Ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ga,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ci&&(Ci&&e.type==="mousemove"?(ha=e.screenX-Ci.screenX,pa=e.screenY-Ci.screenY):pa=ha=0,Ci=e),ha)},movementY:function(e){return"movementY"in e?e.movementY:pa}}),Hc=Yt(Ps),Ig=B({},Ps,{dataTransfer:0}),Tg=Yt(Ig),Rg=B({},Ni,{relatedTarget:0}),ma=Yt(Rg),zg=B({},Io,{animationName:0,elapsedTime:0,pseudoElement:0}),Ag=Yt(zg),Lg=B({},Io,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Dg=Yt(Lg),$g=B({},Io,{data:0}),Vc=Yt($g),Og={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fg={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"},Hg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Vg(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Hg[e])?!!n[e]:!1}function ga(){return Vg}var Bg=B({},Ni,{key:function(e){if(e.key){var n=Og[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=js(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Fg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ga,charCode:function(e){return e.type==="keypress"?js(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?js(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Wg=Yt(Bg),Ug=B({},Ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bc=Yt(Ug),Yg=B({},Ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ga}),Xg=Yt(Yg),Gg=B({},Io,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kg=Yt(Gg),Qg=B({},Ps,{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=Yt(Qg),Zg=[9,13,27,32],ya=h&&"CompositionEvent"in window,_i=null;h&&"documentMode"in document&&(_i=document.documentMode);var Jg=h&&"TextEvent"in window&&!_i,Wc=h&&(!ya||_i&&8<_i&&11>=_i),Uc=" ",Yc=!1;function Xc(e,n){switch(e){case"keyup":return Zg.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var To=!1;function ey(e,n){switch(e){case"compositionend":return Gc(n);case"keypress":return n.which!==32?null:(Yc=!0,Uc);case"textInput":return e=n.data,e===Uc&&Yc?null:e;default:return null}}function ty(e,n){if(To)return e==="compositionend"||!ya&&Xc(e,n)?(e=Oc(),_s=da=Er=null,To=!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 Wc&&n.locale!=="ko"?null:n.data;default:return null}}var ny={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 Kc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!ny[e.type]:n==="textarea"}function Qc(e,n,i,l){No(l),n=zs(n,"onChange"),0<n.length&&(i=new fa("onChange","change",null,i,l),e.push({event:i,listeners:n}))}var ji=null,bi=null;function ry(e){pd(e,0)}function Ms(e){var n=Do(e);if(Ce(n))return e}function oy(e,n){if(e==="change")return n}var qc=!1;if(h){var va;if(h){var xa="oninput"in document;if(!xa){var Zc=document.createElement("div");Zc.setAttribute("oninput","return;"),xa=typeof Zc.oninput=="function"}va=xa}else va=!1;qc=va&&(!document.documentMode||9<document.documentMode)}function Jc(){ji&&(ji.detachEvent("onpropertychange",ed),bi=ji=null)}function ed(e){if(e.propertyName==="value"&&Ms(bi)){var n=[];Qc(n,bi,e,Yr(e)),Qr(ry,n)}}function iy(e,n,i){e==="focusin"?(Jc(),ji=n,bi=i,ji.attachEvent("onpropertychange",ed)):e==="focusout"&&Jc()}function sy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ms(bi)}function ly(e,n){if(e==="click")return Ms(n)}function ay(e,n){if(e==="input"||e==="change")return Ms(n)}function uy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var En=typeof Object.is=="function"?Object.is:uy;function Pi(e,n){if(En(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)||!En(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 wa(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function 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&&wa(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 dy=h&&"documentMode"in document&&11>=document.documentMode,Ro=null,Sa=null,Mi=null,ka=!1;function id(e,n,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ka||Ro==null||Ro!==Ee(l)||(l=Ro,"selectionStart"in l&&wa(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Mi&&Pi(Mi,l)||(Mi=l,l=zs(Sa,"onSelect"),0<l.length&&(n=new fa("onSelect","select",null,n,i),e.push({event:n,listeners:l}),n.target=Ro)))}function Is(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var zo={animationend:Is("Animation","AnimationEnd"),animationiteration:Is("Animation","AnimationIteration"),animationstart:Is("Animation","AnimationStart"),transitionend:Is("Transition","TransitionEnd")},Ea={},sd={};h&&(sd=document.createElement("div").style,"AnimationEvent"in window||(delete zo.animationend.animation,delete zo.animationiteration.animation,delete zo.animationstart.animation),"TransitionEvent"in window||delete zo.transitionend.transition);function Ts(e){if(Ea[e])return Ea[e];if(!zo[e])return e;var n=zo[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in sd)return Ea[e]=n[i];return e}var ld=Ts("animationend"),ad=Ts("animationiteration"),ud=Ts("animationstart"),cd=Ts("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),u(n,[e])}for(var Na=0;Na<fd.length;Na++){var Ca=fd[Na],fy=Ca.toLowerCase(),hy=Ca[0].toUpperCase()+Ca.slice(1);Nr(fy,"on"+hy)}Nr(ld,"onAnimationEnd"),Nr(ad,"onAnimationIteration"),Nr(ud,"onAnimationStart"),Nr("dblclick","onDoubleClick"),Nr("focusin","onFocus"),Nr("focusout","onBlur"),Nr(cd,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="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(" "),py=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ii));function hd(e,n,i){var l=e.type||"unknown-event";e.currentTarget=i,Co(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(vn)throw e=tt,vn=!1,tt=null,e}function Qe(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 _a(e,n,i){var l=0;n&&(l|=4),md(i,e,l,n)}var Rs="_reactListening"+Math.random().toString(36).slice(2);function Ti(e){if(!e[Rs]){e[Rs]=!0,s.forEach(function(i){i!=="selectionchange"&&(py.has(i)||_a(i,!1,e),_a(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Rs]||(n[Rs]=!0,_a("selectionchange",!1,n))}}function md(e,n,i,l){switch($c(n)){case 1:var d=Mo;break;case 4:d=aa;break;default:d=ua}i=d.bind(null,n,i,e),d=void 0,!gn||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 ja(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=to(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,ue=Yr(i),ce=[];e:{var le=dd.get(e);if(le!==void 0){var ye=fa,xe=e;switch(e){case"keypress":if(js(i)===0)break e;case"keydown":case"keyup":ye=Wg;break;case"focusin":xe="focus",ye=ma;break;case"focusout":xe="blur",ye=ma;break;case"beforeblur":case"afterblur":ye=ma;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=Hc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=Tg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=Xg;break;case ld:case ad:case ud:ye=Ag;break;case cd:ye=Kg;break;case"scroll":ye=Mg;break;case"wheel":ye=qg;break;case"copy":case"cut":case"paste":ye=Dg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=Bc}var we=(n&4)!==0,st=!we&&e==="scroll",Y=we?le!==null?le+"Capture":null:le;we=[];for(var F=Z,Q;F!==null;){Q=F;var fe=Q.stateNode;if(Q.tag===5&&fe!==null&&(Q=fe,Y!==null&&(fe=It(F,Y),fe!=null&&we.push(Ri(F,fe,Q)))),st)break;F=F.return}0<we.length&&(le=new ye(le,xe,null,i,ue),ce.push({event:le,listeners:we}))}}if((n&7)===0){e:{if(le=e==="mouseover"||e==="pointerover",ye=e==="mouseout"||e==="pointerout",le&&i!==Kn&&(xe=i.relatedTarget||i.fromElement)&&(to(xe)||xe[nr]))break e;if((ye||le)&&(le=ue.window===ue?ue:(le=ue.ownerDocument)?le.defaultView||le.parentWindow:window,ye?(xe=i.relatedTarget||i.toElement,ye=Z,xe=xe?to(xe):null,xe!==null&&(st=Bt(xe),xe!==st||xe.tag!==5&&xe.tag!==6)&&(xe=null)):(ye=null,xe=Z),ye!==xe)){if(we=Hc,fe="onMouseLeave",Y="onMouseEnter",F="mouse",(e==="pointerout"||e==="pointerover")&&(we=Bc,fe="onPointerLeave",Y="onPointerEnter",F="pointer"),st=ye==null?le:Do(ye),Q=xe==null?le:Do(xe),le=new we(fe,F+"leave",ye,i,ue),le.target=st,le.relatedTarget=Q,fe=null,to(ue)===Z&&(we=new we(Y,F+"enter",xe,i,ue),we.target=Q,we.relatedTarget=st,fe=we),st=fe,ye&&xe)t:{for(we=ye,Y=xe,F=0,Q=we;Q;Q=Ao(Q))F++;for(Q=0,fe=Y;fe;fe=Ao(fe))Q++;for(;0<F-Q;)we=Ao(we),F--;for(;0<Q-F;)Y=Ao(Y),Q--;for(;F--;){if(we===Y||Y!==null&&we===Y.alternate)break t;we=Ao(we),Y=Ao(Y)}we=null}else we=null;ye!==null&&gd(ce,le,ye,we,!1),xe!==null&&st!==null&&gd(ce,st,xe,we,!0)}}e:{if(le=Z?Do(Z):window,ye=le.nodeName&&le.nodeName.toLowerCase(),ye==="select"||ye==="input"&&le.type==="file")var ke=oy;else if(Kc(le))if(qc)ke=ay;else{ke=sy;var Me=iy}else(ye=le.nodeName)&&ye.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(ke=ly);if(ke&&(ke=ke(e,Z))){Qc(ce,ke,i,ue);break e}Me&&Me(e,le,Z),e==="focusout"&&(Me=le._wrapperState)&&Me.controlled&&le.type==="number"&&ft(le,"number",le.value)}switch(Me=Z?Do(Z):window,e){case"focusin":(Kc(Me)||Me.contentEditable==="true")&&(Ro=Me,Sa=Z,Mi=null);break;case"focusout":Mi=Sa=Ro=null;break;case"mousedown":ka=!0;break;case"contextmenu":case"mouseup":case"dragend":ka=!1,id(ce,i,ue);break;case"selectionchange":if(dy)break;case"keydown":case"keyup":id(ce,i,ue)}var Ie;if(ya)e:{switch(e){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else To?Xc(e,i)&&(Re="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Re="onCompositionStart");Re&&(Wc&&i.locale!=="ko"&&(To||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&To&&(Ie=Oc()):(Er=ue,da="value"in Er?Er.value:Er.textContent,To=!0)),Me=zs(Z,Re),0<Me.length&&(Re=new Vc(Re,e,null,i,ue),ce.push({event:Re,listeners:Me}),Ie?Re.data=Ie:(Ie=Gc(i),Ie!==null&&(Re.data=Ie)))),(Ie=Jg?ey(e,i):ty(e,i))&&(Z=zs(Z,"onBeforeInput"),0<Z.length&&(ue=new Vc("onBeforeInput","beforeinput",null,i,ue),ce.push({event:ue,listeners:Z}),ue.data=Ie))}pd(ce,n)})}function Ri(e,n,i){return{instance:e,listener:n,currentTarget:i}}function zs(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(Ri(e,p,d)),p=It(e,n),p!=null&&l.push(Ri(e,p,d))),e=e.return}return l}function Ao(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(Ri(i,L,T))):d||(L=It(i,p),L!=null&&w.push(Ri(i,L,T)))),i=i.return}w.length!==0&&e.push({event:n,listeners:w})}var my=/\r\n?/g,gy=/\u0000|\uFFFD/g;function yd(e){return(typeof e=="string"?e:""+e).replace(my,`
|
|
38
|
+
`).replace(gy,"")}function As(e,n,i){if(n=yd(n),yd(e)!==n&&i)throw Error(o(425))}function Ls(){}var ba=null,Pa=null;function Ma(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ia=typeof setTimeout=="function"?setTimeout:void 0,yy=typeof clearTimeout=="function"?clearTimeout:void 0,vd=typeof Promise=="function"?Promise:void 0,vy=typeof queueMicrotask=="function"?queueMicrotask:typeof vd<"u"?function(e){return vd.resolve(null).then(e).catch(xy)}:Ia;function xy(e){setTimeout(function(){throw e})}function Ta(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),Le(n);return}l--}else i!=="$"&&i!=="$?"&&i!=="$!"||l++;i=d}while(i);Le(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 Lo=Math.random().toString(36).slice(2),Fn="__reactFiber$"+Lo,zi="__reactProps$"+Lo,nr="__reactContainer$"+Lo,Ra="__reactEvents$"+Lo,wy="__reactListeners$"+Lo,Sy="__reactHandles$"+Lo;function to(e){var n=e[Fn];if(n)return n;for(var i=e.parentNode;i;){if(n=i[nr]||i[Fn]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=xd(e);e!==null;){if(i=e[Fn])return i;e=xd(e)}return n}e=i,i=e.parentNode}return null}function Ai(e){return e=e[Fn]||e[nr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Do(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function Ds(e){return e[zi]||null}var za=[],$o=-1;function _r(e){return{current:e}}function qe(e){0>$o||(e.current=za[$o],za[$o]=null,$o--)}function Xe(e,n){$o++,za[$o]=e.current,e.current=n}var jr={},St=_r(jr),zt=_r(!1),no=jr;function Oo(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 At(e){return e=e.childContextTypes,e!=null}function $s(){qe(zt),qe(St)}function wd(e,n,i){if(St.current!==jr)throw Error(o(168));Xe(St,n),Xe(zt,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 Os(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||jr,no=St.current,Xe(St,e),Xe(zt,zt.current),!0}function kd(e,n,i){var l=e.stateNode;if(!l)throw Error(o(169));i?(e=Sd(e,n,no),l.__reactInternalMemoizedMergedChildContext=e,qe(zt),qe(St),Xe(St,e)):qe(zt),Xe(zt,i)}var rr=null,Fs=!1,Aa=!1;function Ed(e){rr===null?rr=[e]:rr.push(e)}function ky(e){Fs=!0,Ed(e)}function br(){if(!Aa&&rr!==null){Aa=!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,Fs=!1}catch(d){throw rr!==null&&(rr=rr.slice(e+1)),bo(gr,br),d}finally{Ve=n,Aa=!1}}return null}var Fo=[],Ho=0,Hs=null,Vs=0,ln=[],an=0,ro=null,or=1,ir="";function oo(e,n){Fo[Ho++]=Vs,Fo[Ho++]=Hs,Hs=e,Vs=n}function Nd(e,n,i){ln[an++]=or,ln[an++]=ir,ln[an++]=ro,ro=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 La(e){e.return!==null&&(oo(e,1),Nd(e,1,0))}function Da(e){for(;e===Hs;)Hs=Fo[--Ho],Fo[Ho]=null,Vs=Fo[--Ho],Fo[Ho]=null;for(;e===ro;)ro=ln[--an],ln[an]=null,ir=ln[--an],ln[an]=null,or=ln[--an],ln[an]=null}var Xt=null,Gt=null,Ze=!1,Nn=null;function Cd(e,n){var i=fn(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,Xt=e,Gt=Cr(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Xt=e,Gt=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(i=ro!==null?{id:or,overflow:ir}:null,e.memoizedState={dehydrated:n,treeContext:i,retryLane:1073741824},i=fn(18,null,null,0),i.stateNode=n,i.return=e,e.child=i,Xt=e,Gt=null,!0):!1;default:return!1}}function $a(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Oa(e){if(Ze){var n=Gt;if(n){var i=n;if(!_d(e,n)){if($a(e))throw Error(o(418));n=Cr(i.nextSibling);var l=Xt;n&&_d(e,n)?Cd(l,i):(e.flags=e.flags&-4097|2,Ze=!1,Xt=e)}}else{if($a(e))throw Error(o(418));e.flags=e.flags&-4097|2,Ze=!1,Xt=e}}}function jd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Xt=e}function Bs(e){if(e!==Xt)return!1;if(!Ze)return jd(e),Ze=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Ma(e.type,e.memoizedProps)),n&&(n=Gt)){if($a(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){Gt=Cr(e.nextSibling);break e}n--}else i!=="$"&&i!=="$!"&&i!=="$?"||n++}e=e.nextSibling}Gt=null}}else Gt=Xt?Cr(e.stateNode.nextSibling):null;return!0}function bd(){for(var e=Gt;e;)e=Cr(e.nextSibling)}function Vo(){Gt=Xt=null,Ze=!1}function Fa(e){Nn===null?Nn=[e]:Nn.push(e)}var Ey=j.ReactCurrentBatchConfig;function Li(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 Ws(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,fe){return F===null||F.tag!==6?(F=Iu(Q,Y.mode,fe),F.return=Y,F):(F=d(F,Q),F.return=Y,F)}function L(Y,F,Q,fe){var ke=Q.type;return ke===H?ue(Y,F,Q.props.children,fe,Q.key):F!==null&&(F.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===V&&Pd(ke)===F.type)?(fe=d(F,Q.props),fe.ref=Li(Y,F,Q),fe.return=Y,fe):(fe=pl(Q.type,Q.key,Q.props,null,Y.mode,fe),fe.ref=Li(Y,F,Q),fe.return=Y,fe)}function Z(Y,F,Q,fe){return F===null||F.tag!==4||F.stateNode.containerInfo!==Q.containerInfo||F.stateNode.implementation!==Q.implementation?(F=Tu(Q,Y.mode,fe),F.return=Y,F):(F=d(F,Q.children||[]),F.return=Y,F)}function ue(Y,F,Q,fe,ke){return F===null||F.tag!==7?(F=ho(Q,Y.mode,fe,ke),F.return=Y,F):(F=d(F,Q),F.return=Y,F)}function ce(Y,F,Q){if(typeof F=="string"&&F!==""||typeof F=="number")return F=Iu(""+F,Y.mode,Q),F.return=Y,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case O:return Q=pl(F.type,F.key,F.props,null,Y.mode,Q),Q.ref=Li(Y,null,F),Q.return=Y,Q;case A:return F=Tu(F,Y.mode,Q),F.return=Y,F;case V:var fe=F._init;return ce(Y,fe(F._payload),Q)}if(yt(F)||z(F))return F=ho(F,Y.mode,Q,null),F.return=Y,F;Ws(Y,F)}return null}function le(Y,F,Q,fe){var ke=F!==null?F.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number")return ke!==null?null:T(Y,F,""+Q,fe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case O:return Q.key===ke?L(Y,F,Q,fe):null;case A:return Q.key===ke?Z(Y,F,Q,fe):null;case V:return ke=Q._init,le(Y,F,ke(Q._payload),fe)}if(yt(Q)||z(Q))return ke!==null?null:ue(Y,F,Q,fe,null);Ws(Y,Q)}return null}function ye(Y,F,Q,fe,ke){if(typeof fe=="string"&&fe!==""||typeof fe=="number")return Y=Y.get(Q)||null,T(F,Y,""+fe,ke);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case O:return Y=Y.get(fe.key===null?Q:fe.key)||null,L(F,Y,fe,ke);case A:return Y=Y.get(fe.key===null?Q:fe.key)||null,Z(F,Y,fe,ke);case V:var Me=fe._init;return ye(Y,F,Q,Me(fe._payload),ke)}if(yt(fe)||z(fe))return Y=Y.get(Q)||null,ue(F,Y,fe,ke,null);Ws(F,fe)}return null}function xe(Y,F,Q,fe){for(var ke=null,Me=null,Ie=F,Re=F=0,gt=null;Ie!==null&&Re<Q.length;Re++){Ie.index>Re?(gt=Ie,Ie=null):gt=Ie.sibling;var Fe=le(Y,Ie,Q[Re],fe);if(Fe===null){Ie===null&&(Ie=gt);break}e&&Ie&&Fe.alternate===null&&n(Y,Ie),F=p(Fe,F,Re),Me===null?ke=Fe:Me.sibling=Fe,Me=Fe,Ie=gt}if(Re===Q.length)return i(Y,Ie),Ze&&oo(Y,Re),ke;if(Ie===null){for(;Re<Q.length;Re++)Ie=ce(Y,Q[Re],fe),Ie!==null&&(F=p(Ie,F,Re),Me===null?ke=Ie:Me.sibling=Ie,Me=Ie);return Ze&&oo(Y,Re),ke}for(Ie=l(Y,Ie);Re<Q.length;Re++)gt=ye(Ie,Y,Re,Q[Re],fe),gt!==null&&(e&>.alternate!==null&&Ie.delete(gt.key===null?Re:gt.key),F=p(gt,F,Re),Me===null?ke=gt:Me.sibling=gt,Me=gt);return e&&Ie.forEach(function(Dr){return n(Y,Dr)}),Ze&&oo(Y,Re),ke}function we(Y,F,Q,fe){var ke=z(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,Re=F=0,gt=null,Fe=Q.next();Ie!==null&&!Fe.done;Re++,Fe=Q.next()){Ie.index>Re?(gt=Ie,Ie=null):gt=Ie.sibling;var Dr=le(Y,Ie,Fe.value,fe);if(Dr===null){Ie===null&&(Ie=gt);break}e&&Ie&&Dr.alternate===null&&n(Y,Ie),F=p(Dr,F,Re),Me===null?ke=Dr:Me.sibling=Dr,Me=Dr,Ie=gt}if(Fe.done)return i(Y,Ie),Ze&&oo(Y,Re),ke;if(Ie===null){for(;!Fe.done;Re++,Fe=Q.next())Fe=ce(Y,Fe.value,fe),Fe!==null&&(F=p(Fe,F,Re),Me===null?ke=Fe:Me.sibling=Fe,Me=Fe);return Ze&&oo(Y,Re),ke}for(Ie=l(Y,Ie);!Fe.done;Re++,Fe=Q.next())Fe=ye(Ie,Y,Re,Fe.value,fe),Fe!==null&&(e&&Fe.alternate!==null&&Ie.delete(Fe.key===null?Re:Fe.key),F=p(Fe,F,Re),Me===null?ke=Fe:Me.sibling=Fe,Me=Fe);return e&&Ie.forEach(function(n0){return n(Y,n0)}),Ze&&oo(Y,Re),ke}function st(Y,F,Q,fe){if(typeof Q=="object"&&Q!==null&&Q.type===H&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case 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=Li(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=ho(Q.props.children,Y.mode,fe,Q.key),F.return=Y,Y=F):(fe=pl(Q.type,Q.key,Q.props,null,Y.mode,fe),fe.ref=Li(Y,F,Q),fe.return=Y,Y=fe)}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=Tu(Q,Y.mode,fe),F.return=Y,Y=F}return w(Y);case V:return Me=Q._init,st(Y,F,Me(Q._payload),fe)}if(yt(Q))return xe(Y,F,Q,fe);if(z(Q))return we(Y,F,Q,fe);Ws(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=Iu(Q,Y.mode,fe),F.return=Y,Y=F),w(Y)):i(Y,F)}return st}var Bo=Md(!0),Id=Md(!1),Us=_r(null),Ys=null,Wo=null,Ha=null;function Va(){Ha=Wo=Ys=null}function Ba(e){var n=Us.current;qe(Us),e._currentValue=n}function Wa(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 Uo(e,n){Ys=e,Ha=Wo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Lt=!0),e.firstContext=null)}function un(e){var n=e._currentValue;if(Ha!==e)if(e={context:e,memoizedValue:n,next:null},Wo===null){if(Ys===null)throw Error(o(308));Wo=e,Ys.dependencies={lanes:0,firstContext:e}}else Wo=Wo.next=e;return n}var io=null;function Ua(e){io===null?io=[e]:io.push(e)}function Td(e,n,i,l){var d=n.interleaved;return d===null?(i.next=i,Ua(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 Ya(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Rd(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,Ua(l)):(n.next=d.next,d.next=n),l.interleaved=n,sr(e,i)}function Xs(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,ki(e,i)}}function zd(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 Gs(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 ue=e.alternate;ue!==null&&(ue=ue.updateQueue,T=ue.lastBaseUpdate,T!==w&&(T===null?ue.firstBaseUpdate=Z:T.next=Z,ue.lastBaseUpdate=L))}if(p!==null){var ce=d.baseState;w=0,ue=Z=L=null,T=p;do{var le=T.lane,ye=T.eventTime;if((l&le)===le){ue!==null&&(ue=ue.next={eventTime:ye,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var xe=e,we=T;switch(le=n,ye=i,we.tag){case 1:if(xe=we.payload,typeof xe=="function"){ce=xe.call(ye,ce,le);break e}ce=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=we.payload,le=typeof xe=="function"?xe.call(ye,ce,le):xe,le==null)break e;ce=B({},ce,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},ue===null?(Z=ue=ye,L=ce):ue=ue.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(ue===null&&(L=ce),d.baseState=L,d.firstBaseUpdate=Z,d.lastBaseUpdate=ue,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);ao|=w,e.lanes=w,e.memoizedState=ce}}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 Di={},Hn=_r(Di),$i=_r(Di),Oi=_r(Di);function so(e){if(e===Di)throw Error(o(174));return e}function Xa(e,n){switch(Xe(Oi,n),Xe($i,e),Xe(Hn,Di),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:pn(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=pn(n,e)}qe(Hn),Xe(Hn,n)}function Yo(){qe(Hn),qe($i),qe(Oi)}function Ld(e){so(Oi.current);var n=so(Hn.current),i=pn(n,e.type);n!==i&&(Xe($i,e),Xe(Hn,i))}function Ga(e){$i.current===e&&(qe(Hn),qe($i))}var nt=_r(0);function Ks(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 Ka=[];function Qa(){for(var e=0;e<Ka.length;e++)Ka[e]._workInProgressVersionPrimary=null;Ka.length=0}var Qs=j.ReactCurrentDispatcher,qa=j.ReactCurrentBatchConfig,lo=0,rt=null,ct=null,pt=null,qs=!1,Fi=!1,Hi=0,Ny=0;function kt(){throw Error(o(321))}function Za(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!En(e[i],n[i]))return!1;return!0}function Ja(e,n,i,l,d,p){if(lo=p,rt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Qs.current=e===null||e.memoizedState===null?by:Py,e=i(l,d),Fi){p=0;do{if(Fi=!1,Hi=0,25<=p)throw Error(o(301));p+=1,pt=ct=null,n.updateQueue=null,Qs.current=My,e=i(l,d)}while(Fi)}if(Qs.current=el,n=ct!==null&&ct.next!==null,lo=0,pt=ct=rt=null,qs=!1,n)throw Error(o(300));return e}function eu(){var e=Hi!==0;return Hi=0,e}function Vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?rt.memoizedState=pt=e:pt=pt.next=e,pt}function cn(){if(ct===null){var e=rt.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var n=pt===null?rt.memoizedState:pt.next;if(n!==null)pt=n,ct=e;else{if(e===null)throw Error(o(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},pt===null?rt.memoizedState=pt=e:pt=pt.next=e}return pt}function Vi(e,n){return typeof n=="function"?n(e):n}function tu(e){var n=cn(),i=n.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var l=ct,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 ue=Z.lane;if((lo&ue)===ue)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 ce={lane:ue,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null};L===null?(T=L=ce,w=l):L=L.next=ce,rt.lanes|=ue,ao|=ue}Z=Z.next}while(Z!==null&&Z!==p);L===null?w=l:L.next=T,En(l,n.memoizedState)||(Lt=!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,rt.lanes|=p,ao|=p,d=d.next;while(d!==e)}else d===null&&(i.lanes=0);return[n.memoizedState,i.dispatch]}function nu(e){var n=cn(),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);En(p,n.memoizedState)||(Lt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),i.lastRenderedState=p}return[p,l]}function Dd(){}function $d(e,n){var i=rt,l=cn(),d=n(),p=!En(l.memoizedState,d);if(p&&(l.memoizedState=d,Lt=!0),l=l.queue,ru(Hd.bind(null,i,l,e),[e]),l.getSnapshot!==n||p||pt!==null&&pt.memoizedState.tag&1){if(i.flags|=2048,Bi(9,Fd.bind(null,i,l,d,n),void 0,null),mt===null)throw Error(o(349));(lo&30)!==0||Od(i,n,d)}return d}function Od(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=rt.updateQueue,n===null?(n={lastEffect:null,stores:null},rt.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!En(e,i)}catch{return!0}}function Bd(e){var n=sr(e,1);n!==null&&bn(n,e,1,-1)}function Wd(e){var n=Vn();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:e},n.queue=e,e=e.dispatch=jy.bind(null,rt,e),[n.memoizedState,e]}function Bi(e,n,i,l){return e={tag:e,create:n,destroy:i,deps:l,next:null},n=rt.updateQueue,n===null?(n={lastEffect:null,stores:null},rt.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 cn().memoizedState}function Zs(e,n,i,l){var d=Vn();rt.flags|=e,d.memoizedState=Bi(1|n,i,void 0,l===void 0?null:l)}function Js(e,n,i,l){var d=cn();l=l===void 0?null:l;var p=void 0;if(ct!==null){var w=ct.memoizedState;if(p=w.destroy,l!==null&&Za(l,w.deps)){d.memoizedState=Bi(n,i,p,l);return}}rt.flags|=e,d.memoizedState=Bi(1|n,i,p,l)}function Yd(e,n){return Zs(8390656,8,e,n)}function ru(e,n){return Js(2048,8,e,n)}function Xd(e,n){return Js(4,2,e,n)}function Gd(e,n){return Js(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,Js(4,4,Kd.bind(null,n,e),i)}function ou(){}function qd(e,n){var i=cn();n=n===void 0?null:n;var l=i.memoizedState;return l!==null&&n!==null&&Za(n,l[1])?l[0]:(i.memoizedState=[e,n],e)}function Zd(e,n){var i=cn();n=n===void 0?null:n;var l=i.memoizedState;return l!==null&&n!==null&&Za(n,l[1])?l[0]:(e=e(),i.memoizedState=[e,n],e)}function Jd(e,n,i){return(lo&21)===0?(e.baseState&&(e.baseState=!1,Lt=!0),e.memoizedState=i):(En(i,n)||(i=er(),rt.lanes|=i,ao|=i,e.baseState=!0),n)}function Cy(e,n){var i=Ve;Ve=i!==0&&4>i?i:4,e(!0);var l=qa.transition;qa.transition={};try{e(!1),n()}finally{Ve=i,qa.transition=l}}function ef(){return cn().memoizedState}function _y(e,n,i){var l=zr(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();bn(i,e,l,d),rf(i,n,l)}}function jy(e,n,i){var l=zr(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,En(T,w)){var L=n.interleaved;L===null?(d.next=d,Ua(n)):(d.next=L.next,L.next=d),n.interleaved=d;return}}catch{}finally{}i=Td(e,n,d,l),i!==null&&(d=Mt(),bn(i,e,l,d),rf(i,n,l))}}function tf(e){var n=e.alternate;return e===rt||n!==null&&n===rt}function nf(e,n){Fi=qs=!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,ki(e,i)}}var el={readContext:un,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useInsertionEffect:kt,useLayoutEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useMutableSource:kt,useSyncExternalStore:kt,useId:kt,unstable_isNewReconciler:!1},by={readContext:un,useCallback:function(e,n){return Vn().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,Zs(4194308,4,Kd.bind(null,n,e),i)},useLayoutEffect:function(e,n){return Zs(4194308,4,e,n)},useInsertionEffect:function(e,n){return Zs(4,2,e,n)},useMemo:function(e,n){var i=Vn();return n=n===void 0?null:n,e=e(),i.memoizedState=[e,n],e},useReducer:function(e,n,i){var l=Vn();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=_y.bind(null,rt,e),[l.memoizedState,e]},useRef:function(e){var n=Vn();return e={current:e},n.memoizedState=e},useState:Wd,useDebugValue:ou,useDeferredValue:function(e){return Vn().memoizedState=e},useTransition:function(){var e=Wd(!1),n=e[0];return e=Cy.bind(null,e[1]),Vn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,i){var l=rt,d=Vn();if(Ze){if(i===void 0)throw Error(o(407));i=i()}else{if(i=n(),mt===null)throw Error(o(349));(lo&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,Bi(9,Fd.bind(null,l,p,i,n),void 0,null),i},useId:function(){var e=Vn(),n=mt.identifierPrefix;if(Ze){var i=ir,l=or;i=(l&~(1<<32-bt(l)-1)).toString(32)+i,n=":"+n+"R"+i,i=Hi++,0<i&&(n+="H"+i.toString(32)),n+=":"}else i=Ny++,n=":"+n+"r"+i.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Py={readContext:un,useCallback:qd,useContext:un,useEffect:ru,useImperativeHandle:Qd,useInsertionEffect:Xd,useLayoutEffect:Gd,useMemo:Zd,useReducer:tu,useRef:Ud,useState:function(){return tu(Vi)},useDebugValue:ou,useDeferredValue:function(e){var n=cn();return Jd(n,ct.memoizedState,e)},useTransition:function(){var e=tu(Vi)[0],n=cn().memoizedState;return[e,n]},useMutableSource:Dd,useSyncExternalStore:$d,useId:ef,unstable_isNewReconciler:!1},My={readContext:un,useCallback:qd,useContext:un,useEffect:ru,useImperativeHandle:Qd,useInsertionEffect:Xd,useLayoutEffect:Gd,useMemo:Zd,useReducer:nu,useRef:Ud,useState:function(){return nu(Vi)},useDebugValue:ou,useDeferredValue:function(e){var n=cn();return ct===null?n.memoizedState=e:Jd(n,ct.memoizedState,e)},useTransition:function(){var e=nu(Vi)[0],n=cn().memoizedState;return[e,n]},useMutableSource:Dd,useSyncExternalStore:$d,useId:ef,unstable_isNewReconciler:!1};function Cn(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 iu(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 tl={isMounted:function(e){return(e=e._reactInternals)?Bt(e)===e:!1},enqueueSetState:function(e,n,i){e=e._reactInternals;var l=Mt(),d=zr(e),p=lr(l,d);p.payload=n,i!=null&&(p.callback=i),n=Mr(e,p,d),n!==null&&(bn(n,e,d,l),Xs(n,e,d))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var l=Mt(),d=zr(e),p=lr(l,d);p.tag=1,p.payload=n,i!=null&&(p.callback=i),n=Mr(e,p,d),n!==null&&(bn(n,e,d,l),Xs(n,e,d))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=Mt(),l=zr(e),d=lr(i,l);d.tag=2,n!=null&&(d.callback=n),n=Mr(e,d,l),n!==null&&(bn(n,e,l,i),Xs(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?!Pi(i,l)||!Pi(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=At(n)?no:St.current,l=n.contextTypes,p=(l=l!=null)?Oo(e,d):jr),n=new n(i,p),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=tl,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&&tl.enqueueReplaceState(n,n.state,null)}function su(e,n,i,l){var d=e.stateNode;d.props=i,d.state=e.memoizedState,d.refs={},Ya(e);var p=n.contextType;typeof p=="object"&&p!==null?d.context=un(p):(p=At(n)?no:St.current,d.context=Oo(e,p)),d.state=e.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(iu(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&&tl.enqueueReplaceState(d,d.state,null),Gs(e,i,d,l),d.state=e.memoizedState),typeof d.componentDidMount=="function"&&(e.flags|=4194308)}function Xo(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 lu(e,n,i){return{value:e,source:null,stack:i??null,digest:n??null}}function au(e,n){try{console.error(n.value)}catch(i){setTimeout(function(){throw i})}}var Iy=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(){al||(al=!0,Eu=l),au(e,n)},i}function uf(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(){au(e,n)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){au(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 cf(e,n,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Iy;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=Uy.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 Ty=j.ReactCurrentOwner,Lt=!1;function Pt(e,n,i,l){n.child=e===null?Id(n,null,i,l):Bo(n,e.child,i,l)}function hf(e,n,i,l,d){i=i.render;var p=n.ref;return Uo(n,d),l=Ja(e,n,i,l,p,d),i=eu(),e!==null&&!Lt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~d,ar(e,n,d)):(Ze&&i&&La(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"&&!Mu(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=pl(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:Pi,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(Pi(p,l)&&e.ref===n.ref)if(Lt=!1,n.pendingProps=l=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Lt=!0);else return n.lanes=e.lanes,ar(e,n,d)}return uu(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},Xe(Ko,Kt),Kt|=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,Xe(Ko,Kt),Kt|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=p!==null?p.baseLanes:i,Xe(Ko,Kt),Kt|=l}else p!==null?(l=p.baseLanes|i,n.memoizedState=null):l=i,Xe(Ko,Kt),Kt|=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 uu(e,n,i,l,d){var p=At(i)?no:St.current;return p=Oo(n,p),Uo(n,d),i=Ja(e,n,i,l,p,d),l=eu(),e!==null&&!Lt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~d,ar(e,n,d)):(Ze&&l&&La(n),n.flags|=1,Pt(e,n,i,d),n.child)}function vf(e,n,i,l,d){if(At(i)){var p=!0;Os(n)}else p=!1;if(Uo(n,d),n.stateNode===null)rl(e,n),sf(n,i,l),su(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=At(i)?no:St.current,Z=Oo(n,Z));var ue=i.getDerivedStateFromProps,ce=typeof ue=="function"||typeof w.getSnapshotBeforeUpdate=="function";ce||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,Gs(n,l,w,d),L=n.memoizedState,T!==l||le!==L||zt.current||Pr?(typeof ue=="function"&&(iu(n,i,ue,l),L=n.memoizedState),(T=Pr||of(n,i,T,l,le,L,Z))?(ce||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,Rd(e,n),T=n.memoizedProps,Z=n.type===n.elementType?T:Cn(n.type,T),w.props=Z,ce=n.pendingProps,le=w.context,L=i.contextType,typeof L=="object"&&L!==null?L=un(L):(L=At(i)?no:St.current,L=Oo(n,L));var ye=i.getDerivedStateFromProps;(ue=typeof ye=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(T!==ce||le!==L)&&lf(n,w,l,L),Pr=!1,le=n.memoizedState,w.state=le,Gs(n,l,w,d);var xe=n.memoizedState;T!==ce||le!==xe||zt.current||Pr?(typeof ye=="function"&&(iu(n,i,ye,l),xe=n.memoizedState),(Z=Pr||of(n,i,Z,l,le,xe,L)||!1)?(ue||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,xe,L),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,xe,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=xe),w.props=l,w.state=xe,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 cu(e,n,i,l,p,d)}function cu(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,Ty.current=n;var T=w&&typeof i.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&w?(n.child=Bo(n,e.child,null,p),n.child=Bo(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),Xa(e,n.containerInfo)}function wf(e,n,i,l,d){return Vo(),Fa(d),n.flags|=256,Pt(e,n,i,l),n.child}var du={dehydrated:null,treeContext:null,retryLane:0};function fu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Sf(e,n,i){var l=n.pendingProps,d=nt.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),Xe(nt,d&1),e===null)return Oa(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(w=l.children,e=l.fallback,p?(l=n.mode,p=n.child,w={mode:"hidden",children:w},(l&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=w):p=ml(w,l,0,null),e=ho(e,l,i,null),p.return=n,e.return=n,p.sibling=e,n.child=p,n.child.memoizedState=fu(i),n.memoizedState=du,e):hu(n,w));if(d=e.memoizedState,d!==null&&(T=d.dehydrated,T!==null))return Ry(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=ho(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?fu(i):{baseLanes:w.baseLanes|i,cachePool:null,transitions:w.transitions},p.memoizedState=w,p.childLanes=e.childLanes&~i,n.memoizedState=du,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 hu(e,n){return n=ml({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function nl(e,n,i,l){return l!==null&&Fa(l),Bo(n,e.child,null,i),e=hu(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Ry(e,n,i,l,d,p,w){if(i)return n.flags&256?(n.flags&=-257,l=lu(Error(o(422))),nl(e,n,w,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(p=l.fallback,d=n.mode,l=ml({mode:"visible",children:l.children},d,0,null),p=ho(p,d,w,null),p.flags|=2,l.return=n,p.return=n,l.sibling=p,n.child=l,(n.mode&1)!==0&&Bo(n,e.child,null,w),n.child.memoizedState=fu(w),n.memoizedState=du,p);if((n.mode&1)===0)return nl(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=lu(p,l,void 0),nl(e,n,w,l)}if(T=(w&e.childLanes)!==0,Lt||T){if(l=mt,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),bn(l,e,d,-1))}return Pu(),l=lu(Error(o(421))),nl(e,n,w,l)}return d.data==="$?"?(n.flags|=128,n.child=e.child,n=Yy.bind(null,e),d._reactRetry=n,null):(e=p.treeContext,Gt=Cr(d.nextSibling),Xt=n,Ze=!0,Nn=null,e!==null&&(ln[an++]=or,ln[an++]=ir,ln[an++]=ro,or=e.id,ir=e.overflow,ro=n),n=hu(n,l.children),n.flags|=4096,n)}function kf(e,n,i){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),Wa(e.return,n,i)}function pu(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=nt.current,(l&2)!==0)l=l&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&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(Xe(nt,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&&Ks(e)===null&&(d=i),i=i.sibling;i=d,i===null?(d=n.child,n.child=null):(d=i.sibling,i.sibling=null),pu(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&&Ks(e)===null){n.child=d;break}e=d.sibling,d.sibling=i,i=d,d=e}pu(n,!0,i,null,p);break;case"together":pu(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function rl(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),ao|=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),Vo();break;case 5:Ld(n);break;case 1:At(n.type)&&Os(n);break;case 4:Xa(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,d=n.memoizedProps.value;Xe(Us,l._currentValue),l._currentValue=d;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(Xe(nt,nt.current&1),n.flags|=128,null):(i&n.child.childLanes)!==0?Sf(e,n,i):(Xe(nt,nt.current&1),e=ar(e,n,i),e!==null?e.sibling:null);Xe(nt,nt.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),Xe(nt,nt.current),l)break;return null;case 22:case 23:return n.lanes=0,gf(e,n,i)}return ar(e,n,i)}var Nf,mu,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}},mu=function(){},Cf=function(e,n,i,l){var d=e.memoizedProps;if(d!==l){e=n.stateNode,so(Hn.current);var p=null;switch(i){case"input":d=ze(e,d),l=ze(e,l),p=[];break;case"select":d=B({},d,{value:void 0}),l=B({},l,{value:void 0}),p=[];break;case"textarea":d=hn(e,d),l=hn(e,l),p=[];break;default:typeof d.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=Ls)}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"&&Qe("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 Wi(e,n){if(!Ze)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 Et(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 Ay(e,n,i){var l=n.pendingProps;switch(Da(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(n),null;case 1:return At(n.type)&&$s(),Et(n),null;case 3:return l=n.stateNode,Yo(),qe(zt),qe(St),Qa(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Bs(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Nn!==null&&(_u(Nn),Nn=null))),mu(e,n),Et(n),null;case 5:Ga(n);var d=so(Oi.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 Et(n),null}if(e=so(Hn.current),Bs(n)){l=n.stateNode,i=n.type;var p=n.memoizedProps;switch(l[Fn]=n,l[zi]=p,e=(n.mode&1)!==0,i){case"dialog":Qe("cancel",l),Qe("close",l);break;case"iframe":case"object":case"embed":Qe("load",l);break;case"video":case"audio":for(d=0;d<Ii.length;d++)Qe(Ii[d],l);break;case"source":Qe("error",l);break;case"img":case"image":case"link":Qe("error",l),Qe("load",l);break;case"details":Qe("toggle",l);break;case"input":He(l,p),Qe("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!p.multiple},Qe("invalid",l);break;case"textarea":zn(l,p),Qe("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&&As(l.textContent,T,e),d=["children",T]):typeof T=="number"&&l.textContent!==""+T&&(p.suppressHydrationWarning!==!0&&As(l.textContent,T,e),d=["children",""+T]):a.hasOwnProperty(w)&&T!=null&&w==="onScroll"&&Qe("scroll",l)}switch(i){case"input":_e(l),Ct(l,p,!0);break;case"textarea":_e(l),An(l);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(l.onclick=Ls)}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=Jt(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[Fn]=n,e[zi]=l,Nf(e,n,!1,!1),n.stateNode=e;e:{switch(w=tn(i,l),i){case"dialog":Qe("cancel",e),Qe("close",e),d=l;break;case"iframe":case"object":case"embed":Qe("load",e),d=l;break;case"video":case"audio":for(d=0;d<Ii.length;d++)Qe(Ii[d],e);d=l;break;case"source":Qe("error",e),d=l;break;case"img":case"image":case"link":Qe("error",e),Qe("load",e),d=l;break;case"details":Qe("toggle",e),d=l;break;case"input":He(e,l),d=ze(e,l),Qe("invalid",e);break;case"option":d=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},d=B({},l,{value:void 0}),Qe("invalid",e);break;case"textarea":zn(e,l),d=hn(e,l),Qe("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"?Vt(e,L):p==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,L!=null&&Wr(e,L)):p==="children"?typeof L=="string"?(i!=="textarea"||L!=="")&&en(e,L):typeof L=="number"&&en(e,""+L):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(a.hasOwnProperty(p)?L!=null&&p==="onScroll"&&Qe("scroll",e):L!=null&&_(e,p,L,w))}switch(i){case"input":_e(e),Ct(e,l,!1);break;case"textarea":_e(e),An(e);break;case"option":l.value!=null&&e.setAttribute("value",""+ne(l.value));break;case"select":e.multiple=!!l.multiple,p=l.value,p!=null?ht(e,!!l.multiple,p,!1):l.defaultValue!=null&&ht(e,!!l.multiple,l.defaultValue,!0);break;default:typeof d.onClick=="function"&&(e.onclick=Ls)}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 Et(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=so(Oi.current),so(Hn.current),Bs(n)){if(l=n.stateNode,i=n.memoizedProps,l[Fn]=n,(p=l.nodeValue!==i)&&(e=Xt,e!==null))switch(e.tag){case 3:As(l.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&As(l.nodeValue,i,(e.mode&1)!==0)}p&&(n.flags|=4)}else l=(i.nodeType===9?i:i.ownerDocument).createTextNode(l),l[Fn]=n,n.stateNode=l}return Et(n),null;case 13:if(qe(nt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ze&&Gt!==null&&(n.mode&1)!==0&&(n.flags&128)===0)bd(),Vo(),n.flags|=98560,p=!1;else if(p=Bs(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[Fn]=n}else Vo(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Et(n),p=!1}else Nn!==null&&(_u(Nn),Nn=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||(nt.current&1)!==0?dt===0&&(dt=3):Pu())),n.updateQueue!==null&&(n.flags|=4),Et(n),null);case 4:return Yo(),mu(e,n),e===null&&Ti(n.stateNode.containerInfo),Et(n),null;case 10:return Ba(n.type._context),Et(n),null;case 17:return At(n.type)&&$s(),Et(n),null;case 19:if(qe(nt),p=n.memoizedState,p===null)return Et(n),null;if(l=(n.flags&128)!==0,w=p.rendering,w===null)if(l)Wi(p,!1);else{if(dt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(w=Ks(e),w!==null){for(n.flags|=128,Wi(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 Xe(nt,nt.current&1|2),n.child}e=e.sibling}p.tail!==null&&Ue()>Qo&&(n.flags|=128,l=!0,Wi(p,!1),n.lanes=4194304)}else{if(!l)if(e=Ks(w),e!==null){if(n.flags|=128,l=!0,i=e.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),Wi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!Ze)return Et(n),null}else 2*Ue()-p.renderingStartTime>Qo&&i!==1073741824&&(n.flags|=128,l=!0,Wi(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=Ue(),n.sibling=null,i=nt.current,Xe(nt,l?i&1|2:i&1),n):(Et(n),null);case 22:case 23:return bu(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Kt&1073741824)!==0&&(Et(n),n.subtreeFlags&6&&(n.flags|=8192)):Et(n),null;case 24:return null;case 25:return null}throw Error(o(156,n.tag))}function Ly(e,n){switch(Da(n),n.tag){case 1:return At(n.type)&&$s(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Yo(),qe(zt),qe(St),Qa(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Ga(n),null;case 13:if(qe(nt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));Vo()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return qe(nt),null;case 4:return Yo(),null;case 10:return Ba(n.type._context),null;case 22:case 23:return bu(),null;case 24:return null;default:return null}}var ol=!1,Nt=!1,Dy=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Go(e,n){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(l){it(e,n,l)}else i.current=null}function gu(e,n,i){try{i()}catch(l){it(e,n,l)}}var jf=!1;function $y(e,n){if(ba=Ut,e=od(),wa(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,ue=0,ce=e,le=null;t:for(;;){for(var ye;ce!==i||d!==0&&ce.nodeType!==3||(T=w+d),ce!==p||l!==0&&ce.nodeType!==3||(L=w+l),ce.nodeType===3&&(w+=ce.nodeValue.length),(ye=ce.firstChild)!==null;)le=ce,ce=ye;for(;;){if(ce===e)break t;if(le===i&&++Z===d&&(T=w),le===p&&++ue===l&&(L=w),(ye=ce.nextSibling)!==null)break;ce=le,le=ce.parentNode}ce=ye}i=T===-1||L===-1?null:{start:T,end:L}}else i=null}i=i||{start:0,end:0}}else i=null;for(Pa={focusedElem:e,selectionRange:i},Ut=!1,ve=n;ve!==null;)if(n=ve,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ve=e;else for(;ve!==null;){n=ve;try{var xe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(xe!==null){var we=xe.memoizedProps,st=xe.memoizedState,Y=n.stateNode,F=Y.getSnapshotBeforeUpdate(n.elementType===n.type?we:Cn(n.type,we),st);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(fe){it(n,n.return,fe)}if(e=n.sibling,e!==null){e.return=n.return,ve=e;break}ve=n.return}return xe=jf,jf=!1,xe}function Ui(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&&gu(n,i,p)}d=d.next}while(d!==l)}}function il(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 yu(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[Fn],delete n[zi],delete n[Ra],delete n[wy],delete n[Sy])),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 vu(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=Ls));else if(l!==4&&(e=e.child,e!==null))for(vu(e,n,i),e=e.sibling;e!==null;)vu(e,n,i),e=e.sibling}function xu(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(xu(e,n,i),e=e.sibling;e!==null;)xu(e,n,i),e=e.sibling}var xt=null,_n=!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(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(We,i)}catch{}switch(i.tag){case 5:Nt||Go(i,n);case 6:var l=xt,d=_n;xt=null,Ir(e,n,i),xt=l,_n=d,xt!==null&&(_n?(e=xt,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):xt.removeChild(i.stateNode));break;case 18:xt!==null&&(_n?(e=xt,i=i.stateNode,e.nodeType===8?Ta(e.parentNode,i):e.nodeType===1&&Ta(e,i),Le(e)):Ta(xt,i.stateNode));break;case 4:l=xt,d=_n,xt=i.stateNode.containerInfo,_n=!0,Ir(e,n,i),xt=l,_n=d;break;case 0:case 11:case 14:case 15:if(!Nt&&(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)&&gu(i,n,w),d=d.next}while(d!==l)}Ir(e,n,i);break;case 1:if(!Nt&&(Go(i,n),l=i.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=i.memoizedProps,l.state=i.memoizedState,l.componentWillUnmount()}catch(T){it(i,n,T)}Ir(e,n,i);break;case 21:Ir(e,n,i);break;case 22:i.mode&1?(Nt=(l=Nt)||i.memoizedState!==null,Ir(e,n,i),Nt=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 Dy),n.forEach(function(l){var d=Xy.bind(null,e,l);i.has(l)||(i.add(l),l.then(d,d))})}}function jn(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:xt=T.stateNode,_n=!1;break e;case 3:xt=T.stateNode.containerInfo,_n=!0;break e;case 4:xt=T.stateNode.containerInfo,_n=!0;break e}T=T.return}if(xt===null)throw Error(o(160));If(p,w,d),xt=null,_n=!1;var L=d.alternate;L!==null&&(L.return=null),d.return=null}catch(Z){it(d,n,Z)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Rf(n,e),n=n.sibling}function Rf(e,n){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jn(n,e),Bn(e),l&4){try{Ui(3,e,e.return),il(3,e)}catch(we){it(e,e.return,we)}try{Ui(5,e,e.return)}catch(we){it(e,e.return,we)}}break;case 1:jn(n,e),Bn(e),l&512&&i!==null&&Go(i,i.return);break;case 5:if(jn(n,e),Bn(e),l&512&&i!==null&&Go(i,i.return),e.flags&32){var d=e.stateNode;try{en(d,"")}catch(we){it(e,e.return,we)}}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&&Ae(d,p),tn(T,w);var Z=tn(T,p);for(w=0;w<L.length;w+=2){var ue=L[w],ce=L[w+1];ue==="style"?Vt(d,ce):ue==="dangerouslySetInnerHTML"?Wr(d,ce):ue==="children"?en(d,ce):_(d,ue,ce,Z)}switch(T){case"input":Ge(d,p);break;case"textarea":vt(d,p);break;case"select":var le=d._wrapperState.wasMultiple;d._wrapperState.wasMultiple=!!p.multiple;var ye=p.value;ye!=null?ht(d,!!p.multiple,ye,!1):le!==!!p.multiple&&(p.defaultValue!=null?ht(d,!!p.multiple,p.defaultValue,!0):ht(d,!!p.multiple,p.multiple?[]:"",!1))}d[zi]=p}catch(we){it(e,e.return,we)}}break;case 6:if(jn(n,e),Bn(e),l&4){if(e.stateNode===null)throw Error(o(162));d=e.stateNode,p=e.memoizedProps;try{d.nodeValue=p}catch(we){it(e,e.return,we)}}break;case 3:if(jn(n,e),Bn(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{Le(n.containerInfo)}catch(we){it(e,e.return,we)}break;case 4:jn(n,e),Bn(e);break;case 13:jn(n,e),Bn(e),d=e.child,d.flags&8192&&(p=d.memoizedState!==null,d.stateNode.isHidden=p,!p||d.alternate!==null&&d.alternate.memoizedState!==null||(ku=Ue())),l&4&&Tf(e);break;case 22:if(ue=i!==null&&i.memoizedState!==null,e.mode&1?(Nt=(Z=Nt)||ue,jn(n,e),Nt=Z):jn(n,e),Bn(e),l&8192){if(Z=e.memoizedState!==null,(e.stateNode.isHidden=Z)&&!ue&&(e.mode&1)!==0)for(ve=e,ue=e.child;ue!==null;){for(ce=ve=ue;ve!==null;){switch(le=ve,ye=le.child,le.tag){case 0:case 11:case 14:case 15:Ui(4,le,le.return);break;case 1:Go(le,le.return);var xe=le.stateNode;if(typeof xe.componentWillUnmount=="function"){l=le,i=le.return;try{n=l,xe.props=n.memoizedProps,xe.state=n.memoizedState,xe.componentWillUnmount()}catch(we){it(l,i,we)}}break;case 5:Go(le,le.return);break;case 22:if(le.memoizedState!==null){Lf(ce);continue}}ye!==null?(ye.return=le,ve=ye):Lf(ce)}ue=ue.sibling}e:for(ue=null,ce=e;;){if(ce.tag===5){if(ue===null){ue=ce;try{d=ce.stateNode,Z?(p=d.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(T=ce.stateNode,L=ce.memoizedProps.style,w=L!=null&&L.hasOwnProperty("display")?L.display:null,T.style.display=mn("display",w))}catch(we){it(e,e.return,we)}}}else if(ce.tag===6){if(ue===null)try{ce.stateNode.nodeValue=Z?"":ce.memoizedProps}catch(we){it(e,e.return,we)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===e)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===e)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===e)break e;ue===ce&&(ue=null),ce=ce.return}ue===ce&&(ue=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:jn(n,e),Bn(e),l&4&&Tf(e);break;case 21:break;default:jn(n,e),Bn(e)}}function Bn(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&&(en(d,""),l.flags&=-33);var p=Mf(e);xu(e,p,d);break;case 3:case 4:var w=l.stateNode.containerInfo,T=Mf(e);vu(e,T,w);break;default:throw Error(o(161))}}catch(L){it(e,e.return,L)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Oy(e,n,i){ve=e,zf(e)}function zf(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||ol;if(!w){var T=d.alternate,L=T!==null&&T.memoizedState!==null||Nt;T=ol;var Z=Nt;if(ol=w,(Nt=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,zf(p),p=p.sibling;ve=d,ol=T,Nt=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:Nt||il(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!Nt)if(i===null)l.componentDidMount();else{var d=n.elementType===n.type?i.memoizedProps:Cn(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 ue=Z.memoizedState;if(ue!==null){var ce=ue.dehydrated;ce!==null&&Le(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Nt||n.flags&512&&yu(n)}catch(le){it(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{il(4,n)}catch(L){it(n,i,L)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var d=n.return;try{l.componentDidMount()}catch(L){it(n,d,L)}}var p=n.return;try{yu(n)}catch(L){it(n,p,L)}break;case 5:var w=n.return;try{yu(n)}catch(L){it(n,w,L)}}}catch(L){it(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 Fy=Math.ceil,sl=j.ReactCurrentDispatcher,wu=j.ReactCurrentOwner,dn=j.ReactCurrentBatchConfig,Oe=0,mt=null,lt=null,wt=0,Kt=0,Ko=_r(0),dt=0,Yi=null,ao=0,ll=0,Su=0,Xi=null,Dt=null,ku=0,Qo=1/0,ur=null,al=!1,Eu=null,Tr=null,ul=!1,Rr=null,cl=0,Gi=0,Nu=null,dl=-1,fl=0;function Mt(){return(Oe&6)!==0?Ue():dl!==-1?dl:dl=Ue()}function zr(e){return(e.mode&1)===0?1:(Oe&2)!==0&&wt!==0?wt&-wt:Ey.transition!==null?(fl===0&&(fl=er()),fl):(e=Ve,e!==0||(e=window.event,e=e===void 0?16:$c(e.type)),e)}function bn(e,n,i,l){if(50<Gi)throw Gi=0,Nu=null,Error(o(185));Wt(e,i,l),((Oe&2)===0||e!==mt)&&(e===mt&&((Oe&2)===0&&(ll|=i),dt===4&&Ar(e,wt)),$t(e,l),i===1&&Oe===0&&(n.mode&1)===0&&(Qo=Ue()+500,Fs&&br()))}function $t(e,n){var i=e.callbackNode;Si(e,n);var l=Jn(e,e===mt?wt:0);if(l===0)i!==null&&Po(i),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(i!=null&&Po(i),n===1)e.tag===0?ky(Of.bind(null,e)):Ed(Of.bind(null,e)),vy(function(){(Oe&6)===0&&br()}),i=null;else{switch(Ss(l)){case 1:i=gr;break;case 4:i=$n;break;case 16:i=yr;break;case 536870912:i=Zn;break;default:i=yr}i=Xf(i,$f.bind(null,e))}e.callbackPriority=n,e.callbackNode=i}}function $f(e,n){if(dl=-1,fl=0,(Oe&6)!==0)throw Error(o(327));var i=e.callbackNode;if(qo()&&e.callbackNode!==i)return null;var l=Jn(e,e===mt?wt:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=hl(e,l);else{n=l;var d=Oe;Oe|=2;var p=Hf();(mt!==e||wt!==n)&&(ur=null,Qo=Ue()+500,co(e,n));do try{By();break}catch(T){Ff(e,T)}while(!0);Va(),sl.current=p,Oe=d,lt!==null?n=0:(mt=null,wt=0,n=dt)}if(n!==0){if(n===2&&(d=xr(e),d!==0&&(l=d,n=Cu(e,d))),n===1)throw i=Yi,co(e,0),Ar(e,l),$t(e,Ue()),i;if(n===6)Ar(e,l);else{if(d=e.current.alternate,(l&30)===0&&!Hy(d)&&(n=hl(e,l),n===2&&(p=xr(e),p!==0&&(l=p,n=Cu(e,p))),n===1))throw i=Yi,co(e,0),Ar(e,l),$t(e,Ue()),i;switch(e.finishedWork=d,e.finishedLanes=l,n){case 0:case 1:throw Error(o(345));case 2:fo(e,Dt,ur);break;case 3:if(Ar(e,l),(l&130023424)===l&&(n=ku+500-Ue(),10<n)){if(Jn(e,0)!==0)break;if(d=e.suspendedLanes,(d&l)!==l){Mt(),e.pingedLanes|=e.suspendedLanes&d;break}e.timeoutHandle=Ia(fo.bind(null,e,Dt,ur),n);break}fo(e,Dt,ur);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=Ue()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Fy(l/1960))-l,10<l){e.timeoutHandle=Ia(fo.bind(null,e,Dt,ur),l);break}fo(e,Dt,ur);break;case 5:fo(e,Dt,ur);break;default:throw Error(o(329))}}}return $t(e,Ue()),e.callbackNode===i?$f.bind(null,e):null}function Cu(e,n){var i=Xi;return e.current.memoizedState.isDehydrated&&(co(e,n).flags|=256),e=hl(e,n),e!==2&&(n=Dt,Dt=i,n!==null&&_u(n)),e}function _u(e){Dt===null?Dt=e:Dt.push.apply(Dt,e)}function Hy(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(!En(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&=~Su,n&=~ll,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));qo();var n=Jn(e,0);if((n&1)===0)return $t(e,Ue()),null;var i=hl(e,n);if(e.tag!==0&&i===2){var l=xr(e);l!==0&&(n=l,i=Cu(e,l))}if(i===1)throw i=Yi,co(e,0),Ar(e,n),$t(e,Ue()),i;if(i===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,fo(e,Dt,ur),$t(e,Ue()),null}function ju(e,n){var i=Oe;Oe|=1;try{return e(n)}finally{Oe=i,Oe===0&&(Qo=Ue()+500,Fs&&br())}}function uo(e){Rr!==null&&Rr.tag===0&&(Oe&6)===0&&qo();var n=Oe;Oe|=1;var i=dn.transition,l=Ve;try{if(dn.transition=null,Ve=1,e)return e()}finally{Ve=l,dn.transition=i,Oe=n,(Oe&6)===0&&br()}}function bu(){Kt=Ko.current,qe(Ko)}function co(e,n){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,yy(i)),lt!==null)for(i=lt.return;i!==null;){var l=i;switch(Da(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&$s();break;case 3:Yo(),qe(zt),qe(St),Qa();break;case 5:Ga(l);break;case 4:Yo();break;case 13:qe(nt);break;case 19:qe(nt);break;case 10:Ba(l.type._context);break;case 22:case 23:bu()}i=i.return}if(mt=e,lt=e=Lr(e.current,null),wt=Kt=n,dt=0,Yi=null,Su=ll=ao=0,Dt=Xi=null,io!==null){for(n=0;n<io.length;n++)if(i=io[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}io=null}return e}function Ff(e,n){do{var i=lt;try{if(Va(),Qs.current=el,qs){for(var l=rt.memoizedState;l!==null;){var d=l.queue;d!==null&&(d.pending=null),l=l.next}qs=!1}if(lo=0,pt=ct=rt=null,Fi=!1,Hi=0,wu.current=null,i===null||i.return===null){dt=1,Yi=n,lt=null;break}e:{var p=e,w=i.return,T=i,L=n;if(n=wt,T.flags|=32768,L!==null&&typeof L=="object"&&typeof L.then=="function"){var Z=L,ue=T,ce=ue.tag;if((ue.mode&1)===0&&(ce===0||ce===11||ce===15)){var le=ue.alternate;le?(ue.updateQueue=le.updateQueue,ue.memoizedState=le.memoizedState,ue.lanes=le.lanes):(ue.updateQueue=null,ue.memoizedState=null)}var ye=df(w);if(ye!==null){ye.flags&=-257,ff(ye,w,T,p,n),ye.mode&1&&cf(p,Z,n),n=ye,L=Z;var xe=n.updateQueue;if(xe===null){var we=new Set;we.add(L),n.updateQueue=we}else xe.add(L);break e}else{if((n&1)===0){cf(p,Z,n),Pu();break e}L=Error(o(426))}}else if(Ze&&T.mode&1){var st=df(w);if(st!==null){(st.flags&65536)===0&&(st.flags|=256),ff(st,w,T,p,n),Fa(Xo(L,T));break e}}p=L=Xo(L,T),dt!==4&&(dt=2),Xi===null?Xi=[p]:Xi.push(p),p=w;do{switch(p.tag){case 3:p.flags|=65536,n&=-n,p.lanes|=n;var Y=af(p,L,n);zd(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 fe=uf(p,T,n);zd(p,fe);break e}}p=p.return}while(p!==null)}Bf(i)}catch(ke){n=ke,lt===i&&i!==null&&(lt=i=i.return);continue}break}while(!0)}function Hf(){var e=sl.current;return sl.current=el,e===null?el:e}function Pu(){(dt===0||dt===3||dt===2)&&(dt=4),mt===null||(ao&268435455)===0&&(ll&268435455)===0||Ar(mt,wt)}function hl(e,n){var i=Oe;Oe|=2;var l=Hf();(mt!==e||wt!==n)&&(ur=null,co(e,n));do try{Vy();break}catch(d){Ff(e,d)}while(!0);if(Va(),Oe=i,sl.current=l,lt!==null)throw Error(o(261));return mt=null,wt=0,dt}function Vy(){for(;lt!==null;)Vf(lt)}function By(){for(;lt!==null&&!mi();)Vf(lt)}function Vf(e){var n=Yf(e.alternate,e,Kt);e.memoizedProps=e.pendingProps,n===null?Bf(e):lt=n,wu.current=null}function Bf(e){var n=e;do{var i=n.alternate;if(e=n.return,(n.flags&32768)===0){if(i=Ay(i,n,Kt),i!==null){lt=i;return}}else{if(i=Ly(i,n),i!==null){i.flags&=32767,lt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{dt=6,lt=null;return}}if(n=n.sibling,n!==null){lt=n;return}lt=n=e}while(n!==null);dt===0&&(dt=5)}function fo(e,n,i){var l=Ve,d=dn.transition;try{dn.transition=null,Ve=1,Wy(e,n,i,l)}finally{dn.transition=d,Ve=l}return null}function Wy(e,n,i,l){do qo();while(Rr!==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(Sr(e,p),e===mt&&(lt=mt=null,wt=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||ul||(ul=!0,Xf(yr,function(){return qo(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=dn.transition,dn.transition=null;var w=Ve;Ve=1;var T=Oe;Oe|=4,wu.current=null,$y(e,i),Rf(i,e),cy(Pa),Ut=!!ba,Pa=ba=null,e.current=i,Oy(i),qr(),Oe=T,Ve=w,dn.transition=p}else e.current=i;if(ul&&(ul=!1,Rr=e,cl=d),p=e.pendingLanes,p===0&&(Tr=null),yi(i.stateNode),$t(e,Ue()),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(al)throw al=!1,e=Eu,Eu=null,e;return(cl&1)!==0&&e.tag!==0&&qo(),p=e.pendingLanes,(p&1)!==0?e===Nu?Gi++:(Gi=0,Nu=e):Gi=0,br(),null}function qo(){if(Rr!==null){var e=Ss(cl),n=dn.transition,i=Ve;try{if(dn.transition=null,Ve=16>e?16:e,Rr===null)var l=!1;else{if(e=Rr,Rr=null,cl=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 ue=ve;switch(ue.tag){case 0:case 11:case 15:Ui(8,ue,p)}var ce=ue.child;if(ce!==null)ce.return=ue,ve=ce;else for(;ve!==null;){ue=ve;var le=ue.sibling,ye=ue.return;if(bf(ue),ue===Z){ve=null;break}if(le!==null){le.return=ye,ve=le;break}ve=ye}}}var xe=p.alternate;if(xe!==null){var we=xe.child;if(we!==null){xe.child=null;do{var st=we.sibling;we.sibling=null,we=st}while(we!==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:Ui(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:il(9,T)}}catch(ke){it(T,T.return,ke)}if(T===w){ve=null;break e}var fe=T.sibling;if(fe!==null){fe.return=T.return,ve=fe;break e}ve=T.return}}if(Oe=d,br(),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(We,e)}catch{}l=!0}return l}finally{Ve=i,dn.transition=n}}return!1}function Wf(e,n,i){n=Xo(i,n),n=af(e,n,1),e=Mr(e,n,1),n=Mt(),e!==null&&(Wt(e,1,n),$t(e,n))}function it(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=Xo(i,e),e=uf(n,e,1),n=Mr(n,e,1),e=Mt(),n!==null&&(Wt(n,1,e),$t(n,e));break}}n=n.return}}function Uy(e,n,i){var l=e.pingCache;l!==null&&l.delete(n),n=Mt(),e.pingedLanes|=e.suspendedLanes&i,mt===e&&(wt&i)===i&&(dt===4||dt===3&&(wt&130023424)===wt&&500>Ue()-ku?co(e,0):Su|=i),$t(e,n)}function Uf(e,n){n===0&&((e.mode&1)===0?n=1:(n=On,On<<=1,(On&130023424)===0&&(On=4194304)));var i=Mt();e=sr(e,n),e!==null&&(Wt(e,n,i),$t(e,i))}function Yy(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),Uf(e,i)}function Xy(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||zt.current)Lt=!0;else{if((e.lanes&i)===0&&(n.flags&128)===0)return Lt=!1,zy(e,n,i);Lt=(e.flags&131072)!==0}else Lt=!1,Ze&&(n.flags&1048576)!==0&&Nd(n,Vs,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;rl(e,n),e=n.pendingProps;var d=Oo(n,St.current);Uo(n,i),d=Ja(null,n,l,e,d,i);var p=eu();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,At(l)?(p=!0,Os(n)):p=!1,n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Ya(n),d.updater=tl,n.stateNode=d,d._reactInternals=n,su(n,l,e,i),n=cu(null,n,l,!0,p,i)):(n.tag=0,Ze&&p&&La(n),Pt(null,n,d,i),n=n.child),n;case 16:l=n.elementType;e:{switch(rl(e,n),e=n.pendingProps,d=l._init,l=d(l._payload),n.type=l,d=n.tag=Ky(l),e=Cn(l,e),d){case 0:n=uu(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,Cn(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:Cn(l,d),uu(e,n,l,d,i);case 1:return l=n.type,d=n.pendingProps,d=n.elementType===l?d:Cn(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,Rd(e,n),Gs(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=Xo(Error(o(423)),n),n=wf(e,n,l,i,d);break e}else if(l!==d){d=Xo(Error(o(424)),n),n=wf(e,n,l,i,d);break e}else for(Gt=Cr(n.stateNode.containerInfo.firstChild),Xt=n,Ze=!0,Nn=null,i=Id(n,null,l,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Vo(),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&&Oa(n),l=n.type,d=n.pendingProps,p=e!==null?e.memoizedProps:null,w=d.children,Ma(l,d)?w=null:p!==null&&Ma(l,p)&&(n.flags|=32),yf(e,n),Pt(e,n,w,i),n.child;case 6:return e===null&&Oa(n),null;case 13:return Sf(e,n,i);case 4:return Xa(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=Bo(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:Cn(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,Xe(Us,l._currentValue),l._currentValue=w,p!==null)if(En(p.value,w)){if(p.children===d.children&&!zt.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 ue=Z.pending;ue===null?L.next=L:(L.next=ue.next,ue.next=L),Z.pending=L}}p.lanes|=i,L=p.alternate,L!==null&&(L.lanes|=i),Wa(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),Wa(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,Uo(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=Cn(l,n.pendingProps),d=Cn(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:Cn(l,d),rl(e,n),n.tag=1,At(l)?(e=!0,Os(n)):e=!1,Uo(n,i),sf(n,l,d),su(n,l,d,i),cu(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 bo(e,n)}function Gy(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 fn(e,n,i,l){return new Gy(e,n,i,l)}function Mu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ky(e){if(typeof e=="function")return Mu(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=fn(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 pl(e,n,i,l,d,p){var w=2;if(l=e,typeof e=="function")Mu(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case H:return ho(i.children,d,p,n);case q:w=8,d|=8;break;case J:return e=fn(12,i,n,d|2),e.elementType=J,e.lanes=p,e;case re:return e=fn(13,i,n,d),e.elementType=re,e.lanes=p,e;case P:return e=fn(19,i,n,d),e.elementType=P,e.lanes=p,e;case G:return ml(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=fn(w,i,n,d),n.elementType=e,n.type=l,n.lanes=p,n}function ho(e,n,i,l){return e=fn(7,e,l,n),e.lanes=i,e}function ml(e,n,i,l){return e=fn(22,e,l,n),e.elementType=G,e.lanes=i,e.stateNode={isHidden:!1},e}function Iu(e,n,i){return e=fn(6,e,null,n),e.lanes=i,e}function Tu(e,n,i){return n=fn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Qy(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=wr(0),this.expirationTimes=wr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wr(0),this.identifierPrefix=l,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Ru(e,n,i,l,d,p,w,T,L){return e=new Qy(e,n,i,T,L),n===1?(n=1,p===!0&&(n|=8)):n=0,p=fn(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:l,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ya(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(Bt(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(At(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(At(i))return Sd(e,i,n)}return n}function Kf(e,n,i,l,d,p,w,T,L){return e=Ru(i,l,!0,e,d,p,w,T,L),e.context=Gf(null),i=e.current,l=Mt(),d=zr(i),p=lr(l,d),p.callback=n??null,Mr(i,p,d),e.current.lanes=d,Wt(e,d,l),$t(e,l),e}function gl(e,n,i,l){var d=n.current,p=Mt(),w=zr(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&&(bn(e,d,w,p),Xs(e,d,w)),w}function yl(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 zu(e,n){Qf(e,n),(e=e.alternate)&&Qf(e,n)}function Zy(){return null}var qf=typeof reportError=="function"?reportError:function(e){console.error(e)};function Au(e){this._internalRoot=e}vl.prototype.render=Au.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(o(409));gl(e,n,null,null)},vl.prototype.unmount=Au.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;uo(function(){gl(null,e,null,null)}),n[nr]=null}};function vl(e){this._internalRoot=e}vl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Es();e={blockedOn:null,target:e,priority:n};for(var i=0;i<te.length&&n!==0&&n<te[i].priority;i++);te.splice(i,0,e),i===0&&Se(e)}};function Lu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Zf(){}function Jy(e,n,i,l,d){if(d){if(typeof l=="function"){var p=l;l=function(){var Z=yl(w);p.call(Z)}}var w=Kf(n,l,e,0,null,!1,!1,"",Zf);return e._reactRootContainer=w,e[nr]=w.current,Ti(e.nodeType===8?e.parentNode:e),uo(),w}for(;d=e.lastChild;)e.removeChild(d);if(typeof l=="function"){var T=l;l=function(){var Z=yl(L);T.call(Z)}}var L=Ru(e,0,!1,null,null,!1,!1,"",Zf);return e._reactRootContainer=L,e[nr]=L.current,Ti(e.nodeType===8?e.parentNode:e),uo(function(){gl(n,L,i,l)}),L}function wl(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=yl(w);T.call(L)}}gl(n,w,e,d)}else w=Jy(i,n,e,d,l);return yl(w)}ks=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var i=sn(n.pendingLanes);i!==0&&(ki(n,i|1),$t(n,Ue()),(Oe&6)===0&&(Qo=Ue()+500,br()))}break;case 13:uo(function(){var l=sr(e,1);if(l!==null){var d=Mt();bn(l,e,1,d)}}),zu(e,1)}},tr=function(e){if(e.tag===13){var n=sr(e,134217728);if(n!==null){var i=Mt();bn(n,e,134217728,i)}zu(e,134217728)}},eo=function(e){if(e.tag===13){var n=zr(e),i=sr(e,n);if(i!==null){var l=Mt();bn(i,e,n,l)}zu(e,n)}},Es=function(){return Ve},Ns=function(e,n){var i=Ve;try{return Ve=e,n()}finally{Ve=i}},Xr=function(e,n,i){switch(n){case"input":if(Ge(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=Ds(l);if(!d)throw Error(o(90));Ce(l),Ge(l,d)}}}break;case"textarea":vt(e,i);break;case"select":n=i.value,n!=null&&ht(e,!!i.multiple,n,!1)}},Gr=ju,ut=uo;var e0={usingClientEntryPoint:!1,Events:[Ai,Do,Ds,No,jt,ju]},Ki={findFiberByHostInstance:to,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},t0={bundleType:Ki.bundleType,version:Ki.version,rendererPackageName:Ki.rendererPackageName,rendererConfig:Ki.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=_o(e),e===null?null:e.stateNode},findFiberByHostInstance:Ki.findFiberByHostInstance||Zy,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 Sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sl.isDisabled&&Sl.supportsFiber)try{We=Sl.inject(t0),Rt=Sl}catch{}}return Ot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e0,Ot.createPortal=function(e,n){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lu(n))throw Error(o(200));return qy(e,n,null,i)},Ot.createRoot=function(e,n){if(!Lu(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=Ru(e,1,!1,null,null,i,!1,l,d),e[nr]=n.current,Ti(e.nodeType===8?e.parentNode:e),new Au(n)},Ot.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=_o(n),e=e===null?null:e.stateNode,e},Ot.flushSync=function(e){return uo(e)},Ot.hydrate=function(e,n,i){if(!xl(n))throw Error(o(200));return wl(null,e,n,!0,i)},Ot.hydrateRoot=function(e,n,i){if(!Lu(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,Ti(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 vl(n)},Ot.render=function(e,n,i){if(!xl(n))throw Error(o(200));return wl(null,e,n,!1,i)},Ot.unmountComponentAtNode=function(e){if(!xl(e))throw Error(o(40));return e._reactRootContainer?(uo(function(){wl(null,null,e,!1,function(){e._reactRootContainer=null,e[nr]=null})}),!0):!1},Ot.unstable_batchedUpdates=ju,Ot.unstable_renderSubtreeIntoContainer=function(e,n,i,l){if(!xl(i))throw Error(o(200));if(e==null||e._reactInternals===void 0)throw Error(o(38));return wl(e,n,i,!1,l)},Ot.version="18.3.1-next-f1338f8080-20240426",Ot}var sh;function _p(){if(sh)return Ou.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(),Ou.exports=a0(),Ou.exports}var lh;function u0(){if(lh)return kl;lh=1;var t=_p();return kl.createRoot=t.createRoot,kl.hydrateRoot=t.hydrateRoot,kl}var c0=u0();const d0=yc(c0);function at(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=at(t[o]))!==""&&(r+=(r&&" ")+s);else for(let o in t)t[o]&&(r+=(r&&" ")+o);return r}var f0={value:()=>{}};function Kl(){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 Tl(o)}function Tl(t){this._=t}function h0(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}})}Tl.prototype=Kl.prototype={constructor:Tl,on:function(t,r){var o=this._,s=h0(t+"",o),a,u=-1,c=s.length;if(arguments.length<2){for(;++u<c;)if((a=(t=s[u]).type)&&(a=p0(o[a],t.name)))return a;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++u<c;)if(a=(t=s[u]).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 Tl(t)},call:function(t,r){if((a=arguments.length-2)>0)for(var o=new Array(a),s=0,a,u;s<a;++s)o[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(u=this._[t],s=0,a=u.length;s<a;++s)u[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,u=s.length;a<u;++a)s[a].value.apply(r,o)}};function p0(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]=f0,t=t.slice(0,s).concat(t.slice(s+1));break}return o!=null&&t.push({name:r,value:o}),t}var nc="http://www.w3.org/1999/xhtml";const uh={svg:"http://www.w3.org/2000/svg",xhtml:nc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ql(t){var r=t+="",o=r.indexOf(":");return o>=0&&(r=t.slice(0,o))!=="xmlns"&&(t=t.slice(o+1)),uh.hasOwnProperty(r)?{space:uh[r],local:t}:t}function m0(t){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===nc&&r.documentElement.namespaceURI===nc?r.createElement(t):r.createElementNS(o,t)}}function g0(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function jp(t){var r=Ql(t);return(r.local?g0:m0)(r)}function y0(){}function vc(t){return t==null?y0:function(){return this.querySelector(t)}}function v0(t){typeof t!="function"&&(t=vc(t));for(var r=this._groups,o=r.length,s=new Array(o),a=0;a<o;++a)for(var u=r[a],c=u.length,h=s[a]=new Array(c),m,y,x=0;x<c;++x)(m=u[x])&&(y=t.call(m,m.__data__,x,u))&&("__data__"in m&&(y.__data__=m.__data__),h[x]=y);return new Zt(s,this._parents)}function x0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function w0(){return[]}function bp(t){return t==null?w0:function(){return this.querySelectorAll(t)}}function S0(t){return function(){return x0(t.apply(this,arguments))}}function k0(t){typeof t=="function"?t=S0(t):t=bp(t);for(var r=this._groups,o=r.length,s=[],a=[],u=0;u<o;++u)for(var c=r[u],h=c.length,m,y=0;y<h;++y)(m=c[y])&&(s.push(t.call(m,m.__data__,y,c)),a.push(m));return new Zt(s,a)}function Pp(t){return function(){return this.matches(t)}}function Mp(t){return function(r){return r.matches(t)}}var E0=Array.prototype.find;function N0(t){return function(){return E0.call(this.children,t)}}function C0(){return this.firstElementChild}function _0(t){return this.select(t==null?C0:N0(typeof t=="function"?t:Mp(t)))}var j0=Array.prototype.filter;function b0(){return Array.from(this.children)}function P0(t){return function(){return j0.call(this.children,t)}}function M0(t){return this.selectAll(t==null?b0:P0(typeof t=="function"?t:Mp(t)))}function I0(t){typeof t!="function"&&(t=Pp(t));for(var r=this._groups,o=r.length,s=new Array(o),a=0;a<o;++a)for(var u=r[a],c=u.length,h=s[a]=[],m,y=0;y<c;++y)(m=u[y])&&t.call(m,m.__data__,y,u)&&h.push(m);return new Zt(s,this._parents)}function Ip(t){return new Array(t.length)}function T0(){return new Zt(this._enter||this._groups.map(Ip),this._parents)}function Dl(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}Dl.prototype={constructor:Dl,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 R0(t){return function(){return t}}function z0(t,r,o,s,a,u){for(var c=0,h,m=r.length,y=u.length;c<y;++c)(h=r[c])?(h.__data__=u[c],s[c]=h):o[c]=new Dl(t,u[c]);for(;c<m;++c)(h=r[c])&&(a[c]=h)}function A0(t,r,o,s,a,u,c){var h,m,y=new Map,x=r.length,g=u.length,v=new Array(x),C;for(h=0;h<x;++h)(m=r[h])&&(v[h]=C=c.call(m,m.__data__,h,r)+"",y.has(C)?a[h]=m:y.set(C,m));for(h=0;h<g;++h)C=c.call(t,u[h],h,u)+"",(m=y.get(C))?(s[h]=m,m.__data__=u[h],y.delete(C)):o[h]=new Dl(t,u[h]);for(h=0;h<x;++h)(m=r[h])&&y.get(v[h])===m&&(a[h]=m)}function L0(t){return t.__data__}function D0(t,r){if(!arguments.length)return Array.from(this,L0);var o=r?A0:z0,s=this._parents,a=this._groups;typeof t!="function"&&(t=R0(t));for(var u=a.length,c=new Array(u),h=new Array(u),m=new Array(u),y=0;y<u;++y){var x=s[y],g=a[y],v=g.length,C=$0(t.call(x,x&&x.__data__,y,s)),E=C.length,N=h[y]=new Array(E),k=c[y]=new Array(E),S=m[y]=new Array(v);o(x,g,N,k,S,C,r);for(var I=0,_=0,j,O;I<E;++I)if(j=N[I]){for(I>=_&&(_=I+1);!(O=k[_])&&++_<E;);j._next=O||null}}return c=new Zt(c,s),c._enter=h,c._exit=m,c}function $0(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function O0(){return new Zt(this._exit||this._groups.map(Ip),this._parents)}function F0(t,r,o){var s=this.enter(),a=this,u=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?u.remove():o(u),s&&a?s.merge(a).order():a}function H0(t){for(var r=t.selection?t.selection():t,o=this._groups,s=r._groups,a=o.length,u=s.length,c=Math.min(a,u),h=new Array(a),m=0;m<c;++m)for(var y=o[m],x=s[m],g=y.length,v=h[m]=new Array(g),C,E=0;E<g;++E)(C=y[E]||x[E])&&(v[E]=C);for(;m<a;++m)h[m]=o[m];return new Zt(h,this._parents)}function V0(){for(var t=this._groups,r=-1,o=t.length;++r<o;)for(var s=t[r],a=s.length-1,u=s[a],c;--a>=0;)(c=s[a])&&(u&&c.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(c,u),u=c);return this}function B0(t){t||(t=W0);function r(g,v){return g&&v?t(g.__data__,v.__data__):!g-!v}for(var o=this._groups,s=o.length,a=new Array(s),u=0;u<s;++u){for(var c=o[u],h=c.length,m=a[u]=new Array(h),y,x=0;x<h;++x)(y=c[x])&&(m[x]=y);m.sort(r)}return new Zt(a,this._parents).order()}function W0(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function U0(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Y0(){return Array.from(this)}function X0(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var s=t[r],a=0,u=s.length;a<u;++a){var c=s[a];if(c)return c}return null}function G0(){let t=0;for(const r of this)++t;return t}function K0(){return!this.node()}function Q0(t){for(var r=this._groups,o=0,s=r.length;o<s;++o)for(var a=r[o],u=0,c=a.length,h;u<c;++u)(h=a[u])&&t.call(h,h.__data__,u,a);return this}function q0(t){return function(){this.removeAttribute(t)}}function Z0(t){return function(){this.removeAttributeNS(t.space,t.local)}}function J0(t,r){return function(){this.setAttribute(t,r)}}function ev(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function tv(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(t):this.setAttribute(t,o)}}function nv(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 rv(t,r){var o=Ql(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?Z0:q0:typeof r=="function"?o.local?nv:tv:o.local?ev:J0)(o,r))}function Tp(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ov(t){return function(){this.style.removeProperty(t)}}function iv(t,r,o){return function(){this.style.setProperty(t,r,o)}}function sv(t,r,o){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,o)}}function lv(t,r,o){return arguments.length>1?this.each((r==null?ov:typeof r=="function"?sv:iv)(t,r,o??"")):si(this.node(),t)}function si(t,r){return t.style.getPropertyValue(r)||Tp(t).getComputedStyle(t,null).getPropertyValue(r)}function av(t){return function(){delete this[t]}}function uv(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 dv(t,r){return arguments.length>1?this.each((r==null?av:typeof r=="function"?cv:uv)(t,r)):this.node()[t]}function Rp(t){return t.trim().split(/^|\s+/)}function xc(t){return t.classList||new zp(t)}function zp(t){this._node=t,this._names=Rp(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 Ap(t,r){for(var o=xc(t),s=-1,a=r.length;++s<a;)o.add(r[s])}function Lp(t,r){for(var o=xc(t),s=-1,a=r.length;++s<a;)o.remove(r[s])}function fv(t){return function(){Ap(this,t)}}function hv(t){return function(){Lp(this,t)}}function pv(t,r){return function(){(r.apply(this,arguments)?Ap:Lp)(this,t)}}function mv(t,r){var o=Rp(t+"");if(arguments.length<2){for(var s=xc(this.node()),a=-1,u=o.length;++a<u;)if(!s.contains(o[a]))return!1;return!0}return this.each((typeof r=="function"?pv:r?fv:hv)(o,r))}function gv(){this.textContent=""}function yv(t){return function(){this.textContent=t}}function vv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function xv(t){return arguments.length?this.each(t==null?gv:(typeof t=="function"?vv:yv)(t)):this.node().textContent}function wv(){this.innerHTML=""}function Sv(t){return function(){this.innerHTML=t}}function kv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function Ev(t){return arguments.length?this.each(t==null?wv:(typeof t=="function"?kv:Sv)(t)):this.node().innerHTML}function Nv(){this.nextSibling&&this.parentNode.appendChild(this)}function Cv(){return this.each(Nv)}function _v(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jv(){return this.each(_v)}function bv(t){var r=typeof t=="function"?t:jp(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Pv(){return null}function Mv(t,r){var o=typeof t=="function"?t:jp(t),s=r==null?Pv:typeof r=="function"?r:vc(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),s.apply(this,arguments)||null)})}function Iv(){var t=this.parentNode;t&&t.removeChild(this)}function Tv(){return this.each(Iv)}function Rv(){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 Av(t){return this.select(t?zv:Rv)}function Lv(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Dv(t){return function(r){t.call(this,r,this.__data__)}}function $v(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 Ov(t){return function(){var r=this.__on;if(r){for(var o=0,s=-1,a=r.length,u;o<a;++o)u=r[o],(!t.type||u.type===t.type)&&u.name===t.name?this.removeEventListener(u.type,u.listener,u.options):r[++s]=u;++s?r.length=s:delete this.__on}}}function Fv(t,r,o){return function(){var s=this.__on,a,u=Dv(r);if(s){for(var c=0,h=s.length;c<h;++c)if((a=s[c]).type===t.type&&a.name===t.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=u,a.options=o),a.value=r;return}}this.addEventListener(t.type,u,o),a={type:t.type,name:t.name,value:r,listener:u,options:o},s?s.push(a):this.__on=[a]}}function Hv(t,r,o){var s=$v(t+""),a,u=s.length,c;if(arguments.length<2){var h=this.node().__on;if(h){for(var m=0,y=h.length,x;m<y;++m)for(a=0,x=h[m];a<u;++a)if((c=s[a]).type===x.type&&c.name===x.name)return x.value}return}for(h=r?Fv:Ov,a=0;a<u;++a)this.each(h(s[a],r,o));return this}function Dp(t,r,o){var s=Tp(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 Vv(t,r){return function(){return Dp(this,t,r)}}function Bv(t,r){return function(){return Dp(this,t,r.apply(this,arguments))}}function Wv(t,r){return this.each((typeof r=="function"?Bv:Vv)(t,r))}function*Uv(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var s=t[r],a=0,u=s.length,c;a<u;++a)(c=s[a])&&(yield c)}var $p=[null];function Zt(t,r){this._groups=t,this._parents=r}function ps(){return new Zt([[document.documentElement]],$p)}function Yv(){return this}Zt.prototype=ps.prototype={constructor:Zt,select:v0,selectAll:k0,selectChild:_0,selectChildren:M0,filter:I0,data:D0,enter:T0,exit:O0,join:F0,merge:H0,selection:Yv,order:V0,sort:B0,call:U0,nodes:Y0,node:X0,size:G0,empty:K0,each:Q0,attr:rv,style:lv,property:dv,classed:mv,text:xv,html:Ev,raise:Cv,lower:jv,append:bv,insert:Mv,remove:Tv,clone:Av,datum:Lv,on:Hv,dispatch:Wv,[Symbol.iterator]:Uv};function qt(t){return typeof t=="string"?new Zt([[document.querySelector(t)]],[document.documentElement]):new Zt([[t]],$p)}function Xv(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Pn(t,r){if(t=Xv(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 Gv={passive:!1},rs={capture:!0,passive:!1};function Vu(t){t.stopImmediatePropagation()}function oi(t){t.preventDefault(),t.stopImmediatePropagation()}function Op(t){var r=t.document.documentElement,o=qt(t).on("dragstart.drag",oi,rs);"onselectstart"in r?o.on("selectstart.drag",oi,rs):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Fp(t,r){var o=t.document.documentElement,s=qt(t).on("dragstart.drag",null);r&&(s.on("click.drag",oi,rs),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 El=t=>()=>t;function rc(t,{sourceEvent:r,subject:o,target:s,identifier:a,active:u,x:c,y:h,dx:m,dy:y,dispatch:x}){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:u,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:y,enumerable:!0,configurable:!0},_:{value:x}})}rc.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Kv(t){return!t.ctrlKey&&!t.button}function Qv(){return this.parentNode}function qv(t,r){return r??{x:t.x,y:t.y}}function Zv(){return navigator.maxTouchPoints||"ontouchstart"in this}function Hp(){var t=Kv,r=Qv,o=qv,s=Zv,a={},u=Kl("start","drag","end"),c=0,h,m,y,x,g=0;function v(j){j.on("mousedown.drag",C).filter(s).on("touchstart.drag",k).on("touchmove.drag",S,Gv).on("touchend.drag touchcancel.drag",I).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(j,O){if(!(x||!t.call(this,j,O))){var A=_(this,r.call(this,j,O),j,O,"mouse");A&&(qt(j.view).on("mousemove.drag",E,rs).on("mouseup.drag",N,rs),Op(j.view),Vu(j),y=!1,h=j.clientX,m=j.clientY,A("start",j))}}function E(j){if(oi(j),!y){var O=j.clientX-h,A=j.clientY-m;y=O*O+A*A>g}a.mouse("drag",j)}function N(j){qt(j.view).on("mousemove.drag mouseup.drag",null),Fp(j.view,y),oi(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=_(this,H,j,O,A[J].identifier,A[J]))&&(Vu(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])&&(oi(j),q("drag",j,O[H]))}function I(j){var O=j.changedTouches,A=O.length,H,q;for(x&&clearTimeout(x),x=setTimeout(function(){x=null},500),H=0;H<A;++H)(q=a[O[H].identifier])&&(Vu(j),q("end",j,O[H]))}function _(j,O,A,H,q,J){var ee=u.copy(),U=Pn(J||A,O),X,re,P;if((P=o.call(j,new rc("beforestart",{sourceEvent:A,target:v,identifier:q,active:c,x:U[0],y:U[1],dx:0,dy:0,dispatch:ee}),H))!=null)return X=P.x-U[0]||0,re=P.y-U[1]||0,function K(V,G,R){var z=U,B;switch(V){case"start":a[q]=K,B=c++;break;case"end":delete a[q],--c;case"drag":U=Pn(R||G,O),B=c;break}ee.call(V,j,new rc(V,{sourceEvent:G,subject:P,target:v,identifier:q,active:B,x:U[0]+X,y:U[1]+re,dx:U[0]-z[0],dy:U[1]-z[1],dispatch:ee}),H)}}return v.filter=function(j){return arguments.length?(t=typeof j=="function"?j:El(!!j),v):t},v.container=function(j){return arguments.length?(r=typeof j=="function"?j:El(j),v):r},v.subject=function(j){return arguments.length?(o=typeof j=="function"?j:El(j),v):o},v.touchable=function(j){return arguments.length?(s=typeof j=="function"?j:El(!!j),v):s},v.on=function(){var j=u.on.apply(u,arguments);return j===u?v:j},v.clickDistance=function(j){return arguments.length?(g=(j=+j)*j,v):Math.sqrt(g)},v}function wc(t,r,o){t.prototype=r.prototype=o,o.constructor=t}function Vp(t,r){var o=Object.create(t.prototype);for(var s in r)o[s]=r[s];return o}function ms(){}var os=.7,$l=1/os,ii="\\s*([+-]?\\d+)\\s*",is="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Jv=/^#([0-9a-f]{3,8})$/,ex=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),tx=new RegExp(`^rgb\\(${Un},${Un},${Un}\\)$`),nx=new RegExp(`^rgba\\(${ii},${ii},${ii},${is}\\)$`),rx=new RegExp(`^rgba\\(${Un},${Un},${Un},${is}\\)$`),ox=new RegExp(`^hsl\\(${is},${Un},${Un}\\)$`),ix=new RegExp(`^hsla\\(${is},${Un},${Un},${is}\\)$`),ch={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};wc(ms,vo,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:dh,formatHex:dh,formatHex8:sx,formatHsl:lx,formatRgb:fh,toString:fh});function dh(){return this.rgb().formatHex()}function sx(){return this.rgb().formatHex8()}function lx(){return Bp(this).formatHsl()}function fh(){return this.rgb().formatRgb()}function vo(t){var r,o;return t=(t+"").trim().toLowerCase(),(r=Jv.exec(t))?(o=r[1].length,r=parseInt(r[1],16),o===6?hh(r):o===3?new Ft(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?Nl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?Nl(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=ex.exec(t))?new Ft(r[1],r[2],r[3],1):(r=tx.exec(t))?new Ft(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=nx.exec(t))?Nl(r[1],r[2],r[3],r[4]):(r=rx.exec(t))?Nl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=ox.exec(t))?gh(r[1],r[2]/100,r[3]/100,1):(r=ix.exec(t))?gh(r[1],r[2]/100,r[3]/100,r[4]):ch.hasOwnProperty(t)?hh(ch[t]):t==="transparent"?new Ft(NaN,NaN,NaN,0):null}function hh(t){return new Ft(t>>16&255,t>>8&255,t&255,1)}function Nl(t,r,o,s){return s<=0&&(t=r=o=NaN),new Ft(t,r,o,s)}function ax(t){return t instanceof ms||(t=vo(t)),t?(t=t.rgb(),new Ft(t.r,t.g,t.b,t.opacity)):new Ft}function oc(t,r,o,s){return arguments.length===1?ax(t):new Ft(t,r,o,s??1)}function Ft(t,r,o,s){this.r=+t,this.g=+r,this.b=+o,this.opacity=+s}wc(Ft,oc,Vp(ms,{brighter(t){return t=t==null?$l:Math.pow($l,t),new Ft(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?os:Math.pow(os,t),new Ft(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ft(go(this.r),go(this.g),go(this.b),Ol(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:ux,formatRgb:mh,toString:mh}));function ph(){return`#${mo(this.r)}${mo(this.g)}${mo(this.b)}`}function ux(){return`#${mo(this.r)}${mo(this.g)}${mo(this.b)}${mo((isNaN(this.opacity)?1:this.opacity)*255)}`}function mh(){const t=Ol(this.opacity);return`${t===1?"rgb(":"rgba("}${go(this.r)}, ${go(this.g)}, ${go(this.b)}${t===1?")":`, ${t})`}`}function Ol(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function go(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mo(t){return t=go(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 Mn(t,r,o,s)}function Bp(t){if(t instanceof Mn)return new Mn(t.h,t.s,t.l,t.opacity);if(t instanceof ms||(t=vo(t)),!t)return new Mn;if(t instanceof Mn)return t;t=t.rgb();var r=t.r/255,o=t.g/255,s=t.b/255,a=Math.min(r,o,s),u=Math.max(r,o,s),c=NaN,h=u-a,m=(u+a)/2;return h?(r===u?c=(o-s)/h+(o<s)*6:o===u?c=(s-r)/h+2:c=(r-o)/h+4,h/=m<.5?u+a:2-u-a,c*=60):h=m>0&&m<1?0:c,new Mn(c,h,m,t.opacity)}function cx(t,r,o,s){return arguments.length===1?Bp(t):new Mn(t,r,o,s??1)}function Mn(t,r,o,s){this.h=+t,this.s=+r,this.l=+o,this.opacity=+s}wc(Mn,cx,Vp(ms,{brighter(t){return t=t==null?$l:Math.pow($l,t),new Mn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?os:Math.pow(os,t),new Mn(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 Ft(Bu(t>=240?t-240:t+120,a,s),Bu(t,a,s),Bu(t<120?t+240:t-120,a,s),this.opacity)},clamp(){return new Mn(yh(this.h),Cl(this.s),Cl(this.l),Ol(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=Ol(this.opacity);return`${t===1?"hsl(":"hsla("}${yh(this.h)}, ${Cl(this.s)*100}%, ${Cl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function yh(t){return t=(t||0)%360,t<0?t+360:t}function Cl(t){return Math.max(0,Math.min(1,t||0))}function Bu(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 Sc=t=>()=>t;function dx(t,r){return function(o){return t+o*r}}function fx(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 hx(t){return(t=+t)==1?Wp:function(r,o){return o-r?fx(r,o,t):Sc(isNaN(r)?o:r)}}function Wp(t,r){var o=r-t;return o?dx(t,o):Sc(isNaN(t)?r:t)}const Fl=(function t(r){var o=hx(r);function s(a,u){var c=o((a=oc(a)).r,(u=oc(u)).r),h=o(a.g,u.g),m=o(a.b,u.b),y=Wp(a.opacity,u.opacity);return function(x){return a.r=c(x),a.g=h(x),a.b=m(x),a.opacity=y(x),a+""}}return s.gamma=t,s})(1);function px(t,r){r||(r=[]);var o=t?Math.min(r.length,t.length):0,s=r.slice(),a;return function(u){for(a=0;a<o;++a)s[a]=t[a]*(1-u)+r[a]*u;return s}}function mx(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function gx(t,r){var o=r?r.length:0,s=t?Math.min(o,t.length):0,a=new Array(s),u=new Array(o),c;for(c=0;c<s;++c)a[c]=ts(t[c],r[c]);for(;c<o;++c)u[c]=r[c];return function(h){for(c=0;c<s;++c)u[c]=a[c](h);return u}}function yx(t,r){var o=new Date;return t=+t,r=+r,function(s){return o.setTime(t*(1-s)+r*s),o}}function Wn(t,r){return t=+t,r=+r,function(o){return t*(1-o)+r*o}}function vx(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]=ts(t[a],r[a]):s[a]=r[a];return function(u){for(a in o)s[a]=o[a](u);return s}}var ic=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wu=new RegExp(ic.source,"g");function xx(t){return function(){return t}}function wx(t){return function(r){return t(r)+""}}function Up(t,r){var o=ic.lastIndex=Wu.lastIndex=0,s,a,u,c=-1,h=[],m=[];for(t=t+"",r=r+"";(s=ic.exec(t))&&(a=Wu.exec(r));)(u=a.index)>o&&(u=r.slice(o,u),h[c]?h[c]+=u:h[++c]=u),(s=s[0])===(a=a[0])?h[c]?h[c]+=a:h[++c]=a:(h[++c]=null,m.push({i:c,x:Wn(s,a)})),o=Wu.lastIndex;return o<r.length&&(u=r.slice(o),h[c]?h[c]+=u:h[++c]=u),h.length<2?m[0]?wx(m[0].x):xx(r):(r=m.length,function(y){for(var x=0,g;x<r;++x)h[(g=m[x]).i]=g.x(y);return h.join("")})}function ts(t,r){var o=typeof r,s;return r==null||o==="boolean"?Sc(r):(o==="number"?Wn:o==="string"?(s=vo(r))?(r=s,Fl):Up:r instanceof vo?Fl:r instanceof Date?yx:mx(r)?px:Array.isArray(r)?gx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?vx:Wn)(t,r)}var vh=180/Math.PI,sc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yp(t,r,o,s,a,u){var c,h,m;return(c=Math.sqrt(t*t+r*r))&&(t/=c,r/=c),(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,c=-c),{translateX:a,translateY:u,rotate:Math.atan2(r,t)*vh,skewX:Math.atan(m)*vh,scaleX:c,scaleY:h}}var _l;function Sx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?sc:Yp(r.a,r.b,r.c,r.d,r.e,r.f)}function kx(t){return t==null||(_l||(_l=document.createElementNS("http://www.w3.org/2000/svg","g")),_l.setAttribute("transform",t),!(t=_l.transform.baseVal.consolidate()))?sc:(t=t.matrix,Yp(t.a,t.b,t.c,t.d,t.e,t.f))}function Xp(t,r,o,s){function a(y){return y.length?y.pop()+" ":""}function u(y,x,g,v,C,E){if(y!==g||x!==v){var N=C.push("translate(",null,r,null,o);E.push({i:N-4,x:Wn(y,g)},{i:N-2,x:Wn(x,v)})}else(g||v)&&C.push("translate("+g+r+v+o)}function c(y,x,g,v){y!==x?(y-x>180?x+=360:x-y>180&&(y+=360),v.push({i:g.push(a(g)+"rotate(",null,s)-2,x:Wn(y,x)})):x&&g.push(a(g)+"rotate("+x+s)}function h(y,x,g,v){y!==x?v.push({i:g.push(a(g)+"skewX(",null,s)-2,x:Wn(y,x)}):x&&g.push(a(g)+"skewX("+x+s)}function m(y,x,g,v,C,E){if(y!==g||x!==v){var N=C.push(a(C)+"scale(",null,",",null,")");E.push({i:N-4,x:Wn(y,g)},{i:N-2,x:Wn(x,v)})}else(g!==1||v!==1)&&C.push(a(C)+"scale("+g+","+v+")")}return function(y,x){var g=[],v=[];return y=t(y),x=t(x),u(y.translateX,y.translateY,x.translateX,x.translateY,g,v),c(y.rotate,x.rotate,g,v),h(y.skewX,x.skewX,g,v),m(y.scaleX,y.scaleY,x.scaleX,x.scaleY,g,v),y=x=null,function(C){for(var E=-1,N=v.length,k;++E<N;)g[(k=v[E]).i]=k.x(C);return g.join("")}}}var Ex=Xp(Sx,"px, ","px)","deg)"),Nx=Xp(kx,", ",")",")"),Cx=1e-12;function xh(t){return((t=Math.exp(t))+1/t)/2}function _x(t){return((t=Math.exp(t))-1/t)/2}function jx(t){return((t=Math.exp(2*t))-1)/(t+1)}const Rl=(function t(r,o,s){function a(u,c){var h=u[0],m=u[1],y=u[2],x=c[0],g=c[1],v=c[2],C=x-h,E=g-m,N=C*C+E*E,k,S;if(N<Cx)S=Math.log(v/y)/r,k=function(H){return[h+H*C,m+H*E,y*Math.exp(r*H*S)]};else{var I=Math.sqrt(N),_=(v*v-y*y+s*N)/(2*y*o*I),j=(v*v-y*y-s*N)/(2*v*o*I),O=Math.log(Math.sqrt(_*_+1)-_),A=Math.log(Math.sqrt(j*j+1)-j);S=(A-O)/r,k=function(H){var q=H*S,J=xh(O),ee=y/(o*I)*(J*jx(r*q+O)-_x(O));return[h+ee*C,m+ee*E,y*J/xh(r*q+O)]}}return k.duration=S*1e3*r/Math.SQRT2,k}return a.rho=function(u){var c=Math.max(.001,+u),h=c*c,m=h*h;return t(c,h,m)},a})(Math.SQRT2,2,4);var li=0,Ji=0,qi=0,Gp=1e3,Hl,es,Vl=0,xo=0,ql=0,ss=typeof performance=="object"&&performance.now?performance:Date,Kp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function kc(){return xo||(Kp(bx),xo=ss.now()+ql)}function bx(){xo=0}function Bl(){this._call=this._time=this._next=null}Bl.prototype=Qp.prototype={constructor:Bl,restart:function(t,r,o){if(typeof t!="function")throw new TypeError("callback is not a function");o=(o==null?kc():+o)+(r==null?0:+r),!this._next&&es!==this&&(es?es._next=this:Hl=this,es=this),this._call=t,this._time=o,lc()},stop:function(){this._call&&(this._call=null,this._time=1/0,lc())}};function Qp(t,r,o){var s=new Bl;return s.restart(t,r,o),s}function Px(){kc(),++li;for(var t=Hl,r;t;)(r=xo-t._time)>=0&&t._call.call(void 0,r),t=t._next;--li}function wh(){xo=(Vl=ss.now())+ql,li=Ji=0;try{Px()}finally{li=0,Ix(),xo=0}}function Mx(){var t=ss.now(),r=t-Vl;r>Gp&&(ql-=r,Vl=t)}function Ix(){for(var t,r=Hl,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:Hl=o);es=t,lc(s)}function lc(t){if(!li){Ji&&(Ji=clearTimeout(Ji));var r=t-xo;r>24?(t<1/0&&(Ji=setTimeout(wh,t-ss.now()-ql)),qi&&(qi=clearInterval(qi))):(qi||(Vl=ss.now(),qi=setInterval(Mx,Gp)),li=1,Kp(wh))}}function Sh(t,r,o){var s=new Bl;return r=r==null?0:+r,s.restart(a=>{s.stop(),t(a+r)},r,o),s}var Tx=Kl("start","end","cancel","interrupt"),Rx=[],qp=0,kh=1,ac=2,zl=3,Eh=4,uc=5,Al=6;function Zl(t,r,o,s,a,u){var c=t.__transition;if(!c)t.__transition={};else if(o in c)return;zx(t,o,{name:r,index:s,group:a,on:Tx,tween:Rx,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:qp})}function Ec(t,r){var o=Rn(t,r);if(o.state>qp)throw new Error("too late; already scheduled");return o}function Gn(t,r){var o=Rn(t,r);if(o.state>zl)throw new Error("too late; already running");return o}function Rn(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=Qp(u,0,o.time);function u(y){o.state=kh,o.timer.restart(c,o.delay,o.time),o.delay<=y&&c(y-o.delay)}function c(y){var x,g,v,C;if(o.state!==kh)return m();for(x in s)if(C=s[x],C.name===o.name){if(C.state===zl)return Sh(c);C.state===Eh?(C.state=Al,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[x]):+x<r&&(C.state=Al,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[x])}if(Sh(function(){o.state===zl&&(o.state=Eh,o.timer.restart(h,o.delay,o.time),h(y))}),o.state=ac,o.on.call("start",t,t.__data__,o.index,o.group),o.state===ac){for(o.state=zl,a=new Array(v=o.tween.length),x=0,g=-1;x<v;++x)(C=o.tween[x].value.call(t,t.__data__,o.index,o.group))&&(a[++g]=C);a.length=g+1}}function h(y){for(var x=y<o.duration?o.ease.call(null,y/o.duration):(o.timer.restart(m),o.state=uc,1),g=-1,v=a.length;++g<v;)a[g].call(t,x);o.state===uc&&(o.on.call("end",t,t.__data__,o.index,o.group),m())}function m(){o.state=Al,o.timer.stop(),delete s[r];for(var y in s)return;delete t.__transition}}function Ll(t,r){var o=t.__transition,s,a,u=!0,c;if(o){r=r==null?null:r+"";for(c in o){if((s=o[c]).name!==r){u=!1;continue}a=s.state>ac&&s.state<uc,s.state=Al,s.timer.stop(),s.on.call(a?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete o[c]}u&&delete t.__transition}}function Ax(t){return this.each(function(){Ll(this,t)})}function Lx(t,r){var o,s;return function(){var a=Gn(this,t),u=a.tween;if(u!==o){s=o=u;for(var c=0,h=s.length;c<h;++c)if(s[c].name===r){s=s.slice(),s.splice(c,1);break}}a.tween=s}}function Dx(t,r,o){var s,a;if(typeof o!="function")throw new Error;return function(){var u=Gn(this,t),c=u.tween;if(c!==s){a=(s=c).slice();for(var h={name:r,value:o},m=0,y=a.length;m<y;++m)if(a[m].name===r){a[m]=h;break}m===y&&a.push(h)}u.tween=a}}function $x(t,r){var o=this._id;if(t+="",arguments.length<2){for(var s=Rn(this.node(),o).tween,a=0,u=s.length,c;a<u;++a)if((c=s[a]).name===t)return c.value;return null}return this.each((r==null?Lx:Dx)(o,t,r))}function Nc(t,r,o){var s=t._id;return t.each(function(){var a=Gn(this,s);(a.value||(a.value={}))[r]=o.apply(this,arguments)}),function(a){return Rn(a,s).value[r]}}function Zp(t,r){var o;return(typeof r=="number"?Wn:r instanceof vo?Fl:(o=vo(r))?(r=o,Fl):Up)(t,r)}function Ox(t){return function(){this.removeAttribute(t)}}function Fx(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Hx(t,r,o){var s,a=o+"",u;return function(){var c=this.getAttribute(t);return c===a?null:c===s?u:u=r(s=c,o)}}function Vx(t,r,o){var s,a=o+"",u;return function(){var c=this.getAttributeNS(t.space,t.local);return c===a?null:c===s?u:u=r(s=c,o)}}function Bx(t,r,o){var s,a,u;return function(){var c,h=o(this),m;return h==null?void this.removeAttribute(t):(c=this.getAttribute(t),m=h+"",c===m?null:c===s&&m===a?u:(a=m,u=r(s=c,h)))}}function Wx(t,r,o){var s,a,u;return function(){var c,h=o(this),m;return h==null?void this.removeAttributeNS(t.space,t.local):(c=this.getAttributeNS(t.space,t.local),m=h+"",c===m?null:c===s&&m===a?u:(a=m,u=r(s=c,h)))}}function Ux(t,r){var o=Ql(t),s=o==="transform"?Nx:Zp;return this.attrTween(t,typeof r=="function"?(o.local?Wx:Bx)(o,s,Nc(this,"attr."+t,r)):r==null?(o.local?Fx:Ox)(o):(o.local?Vx:Hx)(o,s,r))}function Yx(t,r){return function(o){this.setAttribute(t,r.call(this,o))}}function Xx(t,r){return function(o){this.setAttributeNS(t.space,t.local,r.call(this,o))}}function Gx(t,r){var o,s;function a(){var u=r.apply(this,arguments);return u!==s&&(o=(s=u)&&Xx(t,u)),o}return a._value=r,a}function Kx(t,r){var o,s;function a(){var u=r.apply(this,arguments);return u!==s&&(o=(s=u)&&Yx(t,u)),o}return a._value=r,a}function Qx(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=Ql(t);return this.tween(o,(s.local?Gx:Kx)(s,r))}function qx(t,r){return function(){Ec(this,t).delay=+r.apply(this,arguments)}}function Zx(t,r){return r=+r,function(){Ec(this,t).delay=r}}function Jx(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?qx:Zx)(r,t)):Rn(this.node(),r).delay}function ew(t,r){return function(){Gn(this,t).duration=+r.apply(this,arguments)}}function tw(t,r){return r=+r,function(){Gn(this,t).duration=r}}function nw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?ew:tw)(r,t)):Rn(this.node(),r).duration}function rw(t,r){if(typeof r!="function")throw new Error;return function(){Gn(this,t).ease=r}}function ow(t){var r=this._id;return arguments.length?this.each(rw(r,t)):Rn(this.node(),r).ease}function iw(t,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;Gn(this,t).ease=o}}function sw(t){if(typeof t!="function")throw new Error;return this.each(iw(this._id,t))}function lw(t){typeof t!="function"&&(t=Pp(t));for(var r=this._groups,o=r.length,s=new Array(o),a=0;a<o;++a)for(var u=r[a],c=u.length,h=s[a]=[],m,y=0;y<c;++y)(m=u[y])&&t.call(m,m.__data__,y,u)&&h.push(m);return new fr(s,this._parents,this._name,this._id)}function aw(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,o=t._groups,s=r.length,a=o.length,u=Math.min(s,a),c=new Array(s),h=0;h<u;++h)for(var m=r[h],y=o[h],x=m.length,g=c[h]=new Array(x),v,C=0;C<x;++C)(v=m[C]||y[C])&&(g[C]=v);for(;h<s;++h)c[h]=r[h];return new fr(c,this._parents,this._name,this._id)}function uw(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,u=uw(r)?Ec:Gn;return function(){var c=u(this,t),h=c.on;h!==s&&(a=(s=h).copy()).on(r,o),c.on=a}}function dw(t,r){var o=this._id;return arguments.length<2?Rn(this.node(),o).on.on(t):this.each(cw(o,t,r))}function fw(t){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==t)return;r&&r.removeChild(this)}}function hw(){return this.on("end.remove",fw(this._id))}function pw(t){var r=this._name,o=this._id;typeof t!="function"&&(t=vc(t));for(var s=this._groups,a=s.length,u=new Array(a),c=0;c<a;++c)for(var h=s[c],m=h.length,y=u[c]=new Array(m),x,g,v=0;v<m;++v)(x=h[v])&&(g=t.call(x,x.__data__,v,h))&&("__data__"in x&&(g.__data__=x.__data__),y[v]=g,Zl(y[v],r,o,v,y,Rn(x,o)));return new fr(u,this._parents,r,o)}function mw(t){var r=this._name,o=this._id;typeof t!="function"&&(t=bp(t));for(var s=this._groups,a=s.length,u=[],c=[],h=0;h<a;++h)for(var m=s[h],y=m.length,x,g=0;g<y;++g)if(x=m[g]){for(var v=t.call(x,x.__data__,g,m),C,E=Rn(x,o),N=0,k=v.length;N<k;++N)(C=v[N])&&Zl(C,r,o,N,v,E);u.push(v),c.push(x)}return new fr(u,c,r,o)}var gw=ps.prototype.constructor;function yw(){return new gw(this._groups,this._parents)}function vw(t,r){var o,s,a;return function(){var u=si(this,t),c=(this.style.removeProperty(t),si(this,t));return u===c?null:u===o&&c===s?a:a=r(o=u,s=c)}}function Jp(t){return function(){this.style.removeProperty(t)}}function xw(t,r,o){var s,a=o+"",u;return function(){var c=si(this,t);return c===a?null:c===s?u:u=r(s=c,o)}}function ww(t,r,o){var s,a,u;return function(){var c=si(this,t),h=o(this),m=h+"";return h==null&&(m=h=(this.style.removeProperty(t),si(this,t))),c===m?null:c===s&&m===a?u:(a=m,u=r(s=c,h))}}function Sw(t,r){var o,s,a,u="style."+r,c="end."+u,h;return function(){var m=Gn(this,t),y=m.on,x=m.value[u]==null?h||(h=Jp(r)):void 0;(y!==o||a!==x)&&(s=(o=y).copy()).on(c,a=x),m.on=s}}function kw(t,r,o){var s=(t+="")=="transform"?Ex:Zp;return r==null?this.styleTween(t,vw(t,s)).on("end.style."+t,Jp(t)):typeof r=="function"?this.styleTween(t,ww(t,s,Nc(this,"style."+t,r))).each(Sw(this._id,t)):this.styleTween(t,xw(t,s,r),o).on("end.style."+t,null)}function Ew(t,r,o){return function(s){this.style.setProperty(t,r.call(this,s),o)}}function Nw(t,r,o){var s,a;function u(){var c=r.apply(this,arguments);return c!==a&&(s=(a=c)&&Ew(t,c,o)),s}return u._value=r,u}function Cw(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,Nw(t,r,o??""))}function _w(t){return function(){this.textContent=t}}function jw(t){return function(){var r=t(this);this.textContent=r??""}}function bw(t){return this.tween("text",typeof t=="function"?jw(Nc(this,"text",t)):_w(t==null?"":t+""))}function Pw(t){return function(r){this.textContent=t.call(this,r)}}function Mw(t){var r,o;function s(){var a=t.apply(this,arguments);return a!==o&&(r=(o=a)&&Pw(a)),r}return s._value=t,s}function Iw(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,Mw(t))}function Tw(){for(var t=this._name,r=this._id,o=em(),s=this._groups,a=s.length,u=0;u<a;++u)for(var c=s[u],h=c.length,m,y=0;y<h;++y)if(m=c[y]){var x=Rn(m,r);Zl(m,t,o,y,c,{time:x.time+x.delay+x.duration,delay:0,duration:x.duration,ease:x.ease})}return new fr(s,this._parents,t,o)}function Rw(){var t,r,o=this,s=o._id,a=o.size();return new Promise(function(u,c){var h={value:c},m={value:function(){--a===0&&u()}};o.each(function(){var y=Gn(this,s),x=y.on;x!==t&&(r=(t=x).copy(),r._.cancel.push(h),r._.interrupt.push(h),r._.end.push(m)),y.on=r}),a===0&&u()})}var zw=0;function fr(t,r,o,s){this._groups=t,this._parents=r,this._name=o,this._id=s}function em(){return++zw}var cr=ps.prototype;fr.prototype={constructor:fr,select:pw,selectAll:mw,selectChild:cr.selectChild,selectChildren:cr.selectChildren,filter:lw,merge:aw,selection:yw,transition:Tw,call:cr.call,nodes:cr.nodes,node:cr.node,size:cr.size,empty:cr.empty,each:cr.each,on:dw,attr:Ux,attrTween:Qx,style:kw,styleTween:Cw,text:bw,textTween:Iw,remove:hw,tween:$x,delay:Jx,duration:nw,ease:ow,easeVarying:sw,end:Rw,[Symbol.iterator]:cr[Symbol.iterator]};function Aw(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Lw={time:null,delay:0,duration:250,ease:Aw};function Dw(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 $w(t){var r,o;t instanceof fr?(r=t._id,t=t._name):(r=em(),(o=Lw).time=kc(),t=t==null?null:t+"");for(var s=this._groups,a=s.length,u=0;u<a;++u)for(var c=s[u],h=c.length,m,y=0;y<h;++y)(m=c[y])&&Zl(m,t,r,y,c,o||Dw(m,r));return new fr(s,this._parents,t,r)}ps.prototype.interrupt=Ax;ps.prototype.transition=$w;const jl=t=>()=>t;function Ow(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 Jl=new dr(1,0,0);tm.prototype=dr.prototype;function tm(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Jl;return t.__zoom}function Uu(t){t.stopImmediatePropagation()}function Zi(t){t.preventDefault(),t.stopImmediatePropagation()}function Fw(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Hw(){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||Jl}function Vw(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Bw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ww(t,r,o){var s=t.invertX(r[0][0])-o[0][0],a=t.invertX(r[1][0])-o[1][0],u=t.invertY(r[0][1])-o[0][1],c=t.invertY(r[1][1])-o[1][1];return t.translate(a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a),c>u?(u+c)/2:Math.min(0,u)||Math.max(0,c))}function nm(){var t=Fw,r=Hw,o=Ww,s=Vw,a=Bw,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],h=250,m=Rl,y=Kl("start","zoom","end"),x,g,v,C=500,E=150,N=0,k=10;function S(P){P.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(P,K,V,G){var R=P.selection?P.selection():P;R.property("__zoom",Nh),P!==R?O(P,K,V,G):R.interrupt().each(function(){A(this,arguments).event(G).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},S.scaleBy=function(P,K,V,G){S.scaleTo(P,function(){var R=this.__zoom.k,z=typeof K=="function"?K.apply(this,arguments):K;return R*z},V,G)},S.scaleTo=function(P,K,V,G){S.transform(P,function(){var R=r.apply(this,arguments),z=this.__zoom,B=V==null?j(R):typeof V=="function"?V.apply(this,arguments):V,M=z.invert(B),D=typeof K=="function"?K.apply(this,arguments):K;return o(_(I(z,D),B,M),R,c)},V,G)},S.translateBy=function(P,K,V,G){S.transform(P,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),c)},null,G)},S.translateTo=function(P,K,V,G,R){S.transform(P,function(){var z=r.apply(this,arguments),B=this.__zoom,M=G==null?j(z):typeof G=="function"?G.apply(this,arguments):G;return o(Jl.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),z,c)},G,R)};function I(P,K){return K=Math.max(u[0],Math.min(u[1],K)),K===P.k?P:new dr(K,P.x,P.y)}function _(P,K,V){var G=K[0]-V[0]*P.k,R=K[1]-V[1]*P.k;return G===P.x&&R===P.y?P:new dr(P.k,G,R)}function j(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function O(P,K,V,G){P.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 R=this,z=arguments,B=A(R,z).event(G),M=r.apply(R,z),D=V==null?j(M):typeof V=="function"?V.apply(R,z):V,ie=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),oe=R.__zoom,de=typeof K=="function"?K.apply(R,z):K,he=m(oe.invert(D).concat(ie/oe.k),de.invert(D).concat(ie/de.k));return function(me){if(me===1)me=de;else{var ne=he(me),pe=ie/ne[2];me=new dr(pe,D[0]-ne[0]*pe,D[1]-ne[1]*pe)}B.zoom(null,me)}})}function A(P,K,V){return!V&&P.__zooming||new H(P,K)}function H(P,K){this.that=P,this.args=K,this.active=0,this.sourceEvent=null,this.extent=r.apply(P,K),this.taps=0}H.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,K){return this.mouse&&P!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&P!=="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(P){var K=qt(this.that).datum();y.call(P,this.that,new Ow(P,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:y}),K)}};function q(P,...K){if(!t.apply(this,arguments))return;var V=A(this,K).event(P),G=this.__zoom,R=Math.max(u[0],Math.min(u[1],G.k*Math.pow(2,s.apply(this,arguments)))),z=Pn(P);if(V.wheel)(V.mouse[0][0]!==z[0]||V.mouse[0][1]!==z[1])&&(V.mouse[1]=G.invert(V.mouse[0]=z)),clearTimeout(V.wheel);else{if(G.k===R)return;V.mouse=[z,G.invert(z)],Ll(this),V.start()}Zi(P),V.wheel=setTimeout(B,E),V.zoom("mouse",o(_(I(G,R),V.mouse[0],V.mouse[1]),V.extent,c));function B(){V.wheel=null,V.end()}}function J(P,...K){if(v||!t.apply(this,arguments))return;var V=P.currentTarget,G=A(this,K,!0).event(P),R=qt(P.view).on("mousemove.zoom",D,!0).on("mouseup.zoom",ie,!0),z=Pn(P,V),B=P.clientX,M=P.clientY;Op(P.view),Uu(P),G.mouse=[z,this.__zoom.invert(z)],Ll(this),G.start();function D(oe){if(Zi(oe),!G.moved){var de=oe.clientX-B,he=oe.clientY-M;G.moved=de*de+he*he>N}G.event(oe).zoom("mouse",o(_(G.that.__zoom,G.mouse[0]=Pn(oe,V),G.mouse[1]),G.extent,c))}function ie(oe){R.on("mousemove.zoom mouseup.zoom",null),Fp(oe.view,G.moved),Zi(oe),G.event(oe).end()}}function ee(P,...K){if(t.apply(this,arguments)){var V=this.__zoom,G=Pn(P.changedTouches?P.changedTouches[0]:P,this),R=V.invert(G),z=V.k*(P.shiftKey?.5:2),B=o(_(I(V,z),G,R),r.apply(this,K),c);Zi(P),h>0?qt(this).transition().duration(h).call(O,B,G,P):qt(this).call(S.transform,B,G,P)}}function U(P,...K){if(t.apply(this,arguments)){var V=P.touches,G=V.length,R=A(this,K,P.changedTouches.length===G).event(P),z,B,M,D;for(Uu(P),B=0;B<G;++B)M=V[B],D=Pn(M,this),D=[D,this.__zoom.invert(D),M.identifier],R.touch0?!R.touch1&&R.touch0[2]!==D[2]&&(R.touch1=D,R.taps=0):(R.touch0=D,z=!0,R.taps=1+!!x);x&&(x=clearTimeout(x)),z&&(R.taps<2&&(g=D[0],x=setTimeout(function(){x=null},C)),Ll(this),R.start())}}function X(P,...K){if(this.__zooming){var V=A(this,K).event(P),G=P.changedTouches,R=G.length,z,B,M,D;for(Zi(P),z=0;z<R;++z)B=G[z],M=Pn(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 ie=V.touch0[0],oe=V.touch0[1],de=V.touch1[0],he=V.touch1[1],me=(me=de[0]-ie[0])*me+(me=de[1]-ie[1])*me,ne=(ne=he[0]-oe[0])*ne+(ne=he[1]-oe[1])*ne;B=I(B,Math.sqrt(me/ne)),M=[(ie[0]+de[0])/2,(ie[1]+de[1])/2],D=[(oe[0]+he[0])/2,(oe[1]+he[1])/2]}else if(V.touch0)M=V.touch0[0],D=V.touch0[1];else return;V.zoom("touch",o(_(B,M,D),V.extent,c))}}function re(P,...K){if(this.__zooming){var V=A(this,K).event(P),G=P.changedTouches,R=G.length,z,B;for(Uu(P),v&&clearTimeout(v),v=setTimeout(function(){v=null},C),z=0;z<R;++z)B=G[z],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=Pn(B,this),Math.hypot(g[0]-B[0],g[1]-B[1])<k)){var M=qt(this).on("dblclick.zoom");M&&M.apply(this,arguments)}}}return S.wheelDelta=function(P){return arguments.length?(s=typeof P=="function"?P:jl(+P),S):s},S.filter=function(P){return arguments.length?(t=typeof P=="function"?P:jl(!!P),S):t},S.touchable=function(P){return arguments.length?(a=typeof P=="function"?P:jl(!!P),S):a},S.extent=function(P){return arguments.length?(r=typeof P=="function"?P:jl([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),S):r},S.scaleExtent=function(P){return arguments.length?(u[0]=+P[0],u[1]=+P[1],S):[u[0],u[1]]},S.translateExtent=function(P){return arguments.length?(c[0][0]=+P[0][0],c[1][0]=+P[1][0],c[0][1]=+P[0][1],c[1][1]=+P[1][1],S):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},S.constrain=function(P){return arguments.length?(o=P,S):o},S.duration=function(P){return arguments.length?(h=+P,S):h},S.interpolate=function(P){return arguments.length?(m=P,S):m},S.on=function(){var P=y.on.apply(y,arguments);return P===y?S:P},S.clickDistance=function(P){return arguments.length?(N=(P=+P)*P,S):Math.sqrt(N)},S.tapDistance=function(P){return arguments.length?(k=+P,S):k},S}const Xn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle: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."},ls=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],rm=["Enter"," ","Escape"],om={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:r,y: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 wo;(function(t){t.Strict="strict",t.Loose="loose"})(wo||(wo={}));var yo;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(yo||(yo={}));var as;(function(t){t.Partial="partial",t.Full="full"})(as||(as={}));const im={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 us;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(us||(us={}));var Ne;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ne||(Ne={}));const Ch={[Ne.Left]:Ne.Right,[Ne.Right]:Ne.Left,[Ne.Top]:Ne.Bottom,[Ne.Bottom]:Ne.Top};function sm(t){return t===null?null:t?"valid":"invalid"}const lm=t=>"id"in t&&"source"in t&&"target"in t,Uw=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Cc=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),gs=(t,r=[0,0])=>{const{width:o,height:s}=hr(t),a=t.origin??r,u=o*a[0],c=s*a[1];return{x:t.position.x-u,y:t.position.y-c}},Yw=(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 u=typeof a=="string";let c=!r.nodeLookup&&!u?a:void 0;r.nodeLookup&&(c=u?r.nodeLookup.get(a):Cc(a)?a:r.nodeLookup.get(a.id));const h=c?Wl(c,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ea(s,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ta(o)},ys=(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=ea(o,Wl(a)),s=!0)}),s?ta(o):{x:0,y:0,width:0,height:0}},_c=(t,r,[o,s,a]=[0,0,1],u=!1,c=!1)=>{const h={...xs(r,[o,s,a]),width:r.width/a,height:r.height/a},m=[];for(const y of t.values()){const{measured:x,selectable:g=!0,hidden:v=!1}=y;if(c&&!g||v)continue;const C=x.width??y.width??y.initialWidth??null,E=x.height??y.height??y.initialHeight??null,N=cs(h,ui(y)),k=(C??0)*(E??0),S=u&&N>0;(!y.internals.handleBounds||S||N>=k||y.dragging)&&m.push(y)}return m},Xw=(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 Gw(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 Kw({nodes:t,width:r,height:o,panZoom:s,minZoom:a,maxZoom:u},c){if(t.size===0)return Promise.resolve(!0);const h=Gw(t,c),m=ys(h),y=jc(m,r,o,(c==null?void 0:c.minZoom)??a,(c==null?void 0:c.maxZoom)??u,(c==null?void 0:c.padding)??.1);return await s.setViewport(y,{duration:c==null?void 0:c.duration,ease:c==null?void 0:c.ease,interpolate:c==null?void 0:c.interpolate}),Promise.resolve(!0)}function am({nodeId:t,nextPosition:r,nodeLookup:o,nodeOrigin:s=[0,0],nodeExtent:a,onError:u}){const c=o.get(t),h=c.parentId?o.get(c.parentId):void 0,{x:m,y}=h?h.internals.positionAbsolute:{x:0,y:0},x=c.origin??s;let g=c.extent||a;if(c.extent==="parent"&&!c.expandParent)if(!h)u==null||u("005",Xn.error005());else{const C=h.measured.width,E=h.measured.height;C&&E&&(g=[[m,y],[m+C,y+E]])}else h&&ci(c.extent)&&(g=[[c.extent[0][0]+m,c.extent[0][1]+y],[c.extent[1][0]+m,c.extent[1][1]+y]]);const v=ci(g)?So(r,g,c.measured):r;return(c.measured.width===void 0||c.measured.height===void 0)&&(u==null||u("015",Xn.error015())),{position:{x:v.x-m+(c.measured.width??0)*x[0],y:v.y-y+(c.measured.height??0)*x[1]},positionAbsolute:v}}async function Qw({nodesToRemove:t=[],edgesToRemove:r=[],nodes:o,edges:s,onBeforeDelete:a}){const u=new Set(t.map(v=>v.id)),c=[];for(const v of o){if(v.deletable===!1)continue;const C=u.has(v.id),E=!C&&v.parentId&&c.find(N=>N.id===v.parentId);(C||E)&&c.push(v)}const h=new Set(r.map(v=>v.id)),m=s.filter(v=>v.deletable!==!1),x=Xw(c,m);for(const v of m)h.has(v.id)&&!x.find(E=>E.id===v.id)&&x.push(v);if(!a)return{edges:x,nodes:c};const g=await a({nodes:c,edges:x});return typeof g=="boolean"?g?{edges:x,nodes:c}:{edges:[],nodes:[]}:g}const ai=(t,r=0,o=1)=>Math.min(Math.max(t,r),o),So=(t={x:0,y:0},r,o)=>({x:ai(t.x,r[0][0],r[1][0]-((o==null?void 0:o.width)??0)),y:ai(t.y,r[0][1],r[1][1]-((o==null?void 0:o.height)??0))});function um(t,r,o){const{width:s,height:a}=hr(o),{x:u,y:c}=o.internals.positionAbsolute;return So(t,[[u,c],[u+s,c+a]],r)}const _h=(t,r,o)=>t<r?ai(Math.abs(t-r),1,r)/r:t>o?-ai(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,u=_h(t.y,s,r.height-s)*o;return[a,u]},ea=(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)}),cc=({x:t,y:r,width:o,height:s})=>({x:t,y:r,x2:t+o,y2:r+s}),ta=({x:t,y:r,x2:o,y2:s})=>({x:t,y:r,width:o-t,height:s-r}),ui=(t,r=[0,0])=>{var a,u;const{x:o,y:s}=Cc(t)?t.internals.positionAbsolute:gs(t,r);return{x:o,y:s,width:((a=t.measured)==null?void 0:a.width)??t.width??t.initialWidth??0,height:((u=t.measured)==null?void 0:u.height)??t.height??t.initialHeight??0}},Wl=(t,r=[0,0])=>{var a,u;const{x:o,y:s}=Cc(t)?t.internals.positionAbsolute:gs(t,r);return{x:o,y:s,x2:o+(((a=t.measured)==null?void 0:a.width)??t.width??t.initialWidth??0),y2:s+(((u=t.measured)==null?void 0:u.height)??t.height??t.initialHeight??0)}},dm=(t,r)=>ta(ea(cc(t),cc(r))),cs=(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=>In(t.width)&&In(t.height)&&In(t.x)&&In(t.y),In=t=>!isNaN(t)&&isFinite(t),qw=(t,r)=>{},vs=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),xs=({x:t,y:r},[o,s,a],u=!1,c=[1,1])=>{const h={x:(t-o)/a,y:(r-s)/a};return u?vs(h,c):h},Ul=({x:t,y:r},[o,s,a])=>({x:t*a+o,y:r*a+s});function Zo(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 Zw(t,r,o){if(typeof t=="string"||typeof t=="number"){const s=Zo(t,o),a=Zo(t,r);return{top:s,right:a,bottom:s,left:a,x:a*2,y:s*2}}if(typeof t=="object"){const s=Zo(t.top??t.y??0,o),a=Zo(t.bottom??t.y??0,o),u=Zo(t.left??t.x??0,r),c=Zo(t.right??t.x??0,r);return{top:s,right:c,bottom:a,left:u,x:u+c,y:s+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Jw(t,r,o,s,a,u){const{x:c,y:h}=Ul(t,[r,o,s]),{x:m,y}=Ul({x:t.x+t.width,y:t.y+t.height},[r,o,s]),x=a-m,g=u-y;return{left:Math.floor(c),top:Math.floor(h),right:Math.floor(x),bottom:Math.floor(g)}}const jc=(t,r,o,s,a,u)=>{const c=Zw(u,r,o),h=(r-c.x)/t.width,m=(o-c.y)/t.height,y=Math.min(h,m),x=ai(y,s,a),g=t.x+t.width/2,v=t.y+t.height/2,C=r/2-g*x,E=o/2-v*x,N=Jw(t,C,E,x,r,o),k={left:Math.min(N.left-c.left,0),top:Math.min(N.top-c.top,0),right:Math.min(N.right-c.right,0),bottom:Math.min(N.bottom-c.bottom,0)};return{x:C-k.left+k.right,y:E-k.top+k.bottom,zoom:x}},ds=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function ci(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 fm(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 hm(t,r={width:0,height:0},o,s,a){const u={...t},c=s.get(o);if(c){const h=c.origin||a;u.x+=c.internals.positionAbsolute.x-(r.width??0)*h[0],u.y+=c.internals.positionAbsolute.y-(r.height??0)*h[1]}return u}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 e1(){let t,r;return{promise:new Promise((s,a)=>{t=s,r=a}),resolve:t,reject:r}}function t1(t){return{...om,...t||{}}}function ns(t,{snapGrid:r=[0,0],snapToGrid:o=!1,transform:s,containerBounds:a}){const{x:u,y:c}=Tn(t),h=xs({x:u-((a==null?void 0:a.left)??0),y:c-((a==null?void 0:a.top)??0)},s),{x:m,y}=o?vs(h,r):h;return{xSnapped:m,ySnapped:y,...h}}const bc=t=>({width:t.offsetWidth,height:t.offsetHeight}),pm=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},n1=["INPUT","SELECT","TEXTAREA"];function mm(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:n1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const gm=t=>"clientX"in t,Tn=(t,r)=>{var u,c;const o=gm(t),s=o?t.clientX:(u=t.touches)==null?void 0:u[0].clientX,a=o?t.clientY:(c=t.touches)==null?void 0:c[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 u=r.querySelectorAll(`.${t}`);return!u||!u.length?null:Array.from(u).map(c=>{const h=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:t,nodeId:a,position:c.getAttribute("data-handlepos"),x:(h.left-o.left)/s,y:(h.top-o.top)/s,...bc(c)}})};function ym({sourceX:t,sourceY:r,targetX:o,targetY:s,sourceControlX:a,sourceControlY:u,targetControlX:c,targetControlY:h}){const m=t*.125+a*.375+c*.375+o*.125,y=r*.125+u*.375+h*.375+s*.125,x=Math.abs(m-t),g=Math.abs(y-r);return[m,y,x,g]}function bl(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:u}){switch(t){case Ne.Left:return[r-bl(r-s,u),o];case Ne.Right:return[r+bl(s-r,u),o];case Ne.Top:return[r,o-bl(o-a,u)];case Ne.Bottom:return[r,o+bl(a-o,u)]}}function vm({sourceX:t,sourceY:r,sourcePosition:o=Ne.Bottom,targetX:s,targetY:a,targetPosition:u=Ne.Top,curvature:c=.25}){const[h,m]=Mh({pos:o,x1:t,y1:r,x2:s,y2:a,c}),[y,x]=Mh({pos:u,x1:s,y1:a,x2:t,y2:r,c}),[g,v,C,E]=ym({sourceX:t,sourceY:r,targetX:s,targetY:a,sourceControlX:h,sourceControlY:m,targetControlX:y,targetControlY:x});return[`M${t},${r} C${h},${m} ${y},${x} ${s},${a}`,g,v,C,E]}function xm({sourceX:t,sourceY:r,targetX:o,targetY:s}){const a=Math.abs(o-t)/2,u=o<t?o+a:o-a,c=Math.abs(s-r)/2,h=s<r?s+c:s-c;return[u,h,a,c]}function r1({sourceNode:t,targetNode:r,selected:o=!1,zIndex:s=0,elevateOnSelect:a=!1,zIndexMode:u="basic"}){if(u==="manual")return s;const c=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 c+h}function o1({sourceNode:t,targetNode:r,width:o,height:s,transform:a}){const u=ea(Wl(t),Wl(r));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c={x:-a[0]/a[2],y:-a[1]/a[2],width:o/a[2],height:s/a[2]};return cs(c,ta(u))>0}const wm=({source:t,sourceHandle:r,target:o,targetHandle:s})=>`xy-edge__${t}${r||""}-${o}${s||""}`,i1=(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)),Sm=(t,r,o={})=>{if(!t.source||!t.target)return r;const s=o.getEdgeId||wm;let a;return lm(t)?a={...t}:a={...t,id:s(t)},i1(a,r)?r:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,r.concat(a))},s1=(t,r,o,s={shouldReplaceId:!0})=>{const{id:a,...u}=t;if(!r.source||!r.target||!o.find(y=>y.id===t.id))return o;const h=s.getEdgeId||wm,m={...u,id:s.shouldReplaceId?h(r):a,source:r.source,target:r.target,sourceHandle:r.sourceHandle,targetHandle:r.targetHandle};return o.filter(y=>y.id!==a).concat(m)};function km({sourceX:t,sourceY:r,targetX:o,targetY:s}){const[a,u,c,h]=xm({sourceX:t,sourceY:r,targetX:o,targetY:s});return[`M ${t},${r}L ${o},${s}`,a,u,c,h]}const Ih={[Ne.Left]:{x:-1,y:0},[Ne.Right]:{x:1,y:0},[Ne.Top]:{x:0,y:-1},[Ne.Bottom]:{x:0,y:1}},l1=({source:t,sourcePosition:r=Ne.Bottom,target:o})=>r===Ne.Left||r===Ne.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 a1({source:t,sourcePosition:r=Ne.Bottom,target:o,targetPosition:s=Ne.Top,center:a,offset:u,stepPosition:c}){const h=Ih[r],m=Ih[s],y={x:t.x+h.x*u,y:t.y+h.y*u},x={x:o.x+m.x*u,y:o.y+m.y*u},g=l1({source:y,sourcePosition:r,target:x}),v=g.x!==0?"x":"y",C=g[v];let E=[],N,k;const S={x:0,y:0},I={x:0,y:0},[,,_,j]=xm({sourceX:t.x,sourceY:t.y,targetX:o.x,targetY:o.y});if(h[v]*m[v]===-1){v==="x"?(N=a.x??y.x+(x.x-y.x)*c,k=a.y??(y.y+x.y)/2):(N=a.x??(y.x+x.x)/2,k=a.y??y.y+(x.y-y.y)*c);const A=[{x:N,y:y.y},{x:N,y:x.y}],H=[{x:y.x,y:k},{x:x.x,y:k}];h[v]===C?E=v==="x"?A:H:E=v==="x"?H:A}else{const A=[{x:y.x,y:x.y}],H=[{x:x.x,y:y.y}];if(v==="x"?E=h.x===C?H:A:E=h.y===C?A:H,r===s){const X=Math.abs(t[v]-o[v]);if(X<=u){const re=Math.min(u-1,u-X);h[v]===C?S[v]=(y[v]>t[v]?-1:1)*re:I[v]=(x[v]>o[v]?-1:1)*re}}if(r!==s){const X=v==="x"?"y":"x",re=h[v]===m[X],P=y[X]>x[X],K=y[X]<x[X];(h[v]===1&&(!re&&P||re&&K)||h[v]!==1&&(!re&&K||re&&P))&&(E=v==="x"?A:H)}const q={x:y.x+S.x,y:y.y+S.y},J={x:x.x+I.x,y:x.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:y.x+S.x,y:y.y+S.y},...E,{x:x.x+I.x,y:x.y+I.y},o],N,k,_,j]}function u1(t,r,o,s){const a=Math.min(Th(t,r)/2,Th(r,o)/2,s),{x:u,y:c}=r;if(t.x===u&&u===o.x||t.y===c&&c===o.y)return`L${u} ${c}`;if(t.y===c){const y=t.x<o.x?-1:1,x=t.y<o.y?1:-1;return`L ${u+a*y},${c}Q ${u},${c} ${u},${c+a*x}`}const h=t.x<o.x?1:-1,m=t.y<o.y?-1:1;return`L ${u},${c+a*m}Q ${u},${c} ${u+a*h},${c}`}function dc({sourceX:t,sourceY:r,sourcePosition:o=Ne.Bottom,targetX:s,targetY:a,targetPosition:u=Ne.Top,borderRadius:c=5,centerX:h,centerY:m,offset:y=20,stepPosition:x=.5}){const[g,v,C,E,N]=a1({source:{x:t,y:r},sourcePosition:o,target:{x:s,y:a},targetPosition:u,center:{x:h,y:m},offset:y,stepPosition:x});return[g.reduce((S,I,_)=>{let j="";return _>0&&_<g.length-1?j=u1(g[_-1],I,g[_+1],c):j=`${_===0?"M":"L"}${I.x} ${I.y}`,S+=j,S},""),v,C,E,N]}function Rh(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 g;const{sourceNode:r,targetNode:o}=t;if(!Rh(r)||!Rh(o))return null;const s=r.internals.handleBounds||zh(r.handles),a=o.internals.handleBounds||zh(o.handles),u=Ah((s==null?void 0:s.source)??[],t.sourceHandle),c=Ah(t.connectionMode===wo.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),t.targetHandle);if(!u||!c)return(g=t.onError)==null||g.call(t,"008",Xn.error008(u?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const h=(u==null?void 0:u.position)||Ne.Bottom,m=(c==null?void 0:c.position)||Ne.Top,y=ko(r,u,h),x=ko(o,c,m);return{sourceX:y.x,sourceY:y.y,targetX:x.x,targetY:x.y,sourcePosition:h,targetPosition:m}}function zh(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 ko(t,r,o=Ne.Left,s=!1){const a=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,u=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:c,height:h}=r??hr(t);if(s)return{x:a+c/2,y:u+h/2};switch((r==null?void 0:r.position)??o){case Ne.Top:return{x:a+c/2,y:u};case Ne.Right:return{x:a+c,y:u+h/2};case Ne.Bottom:return{x:a+c/2,y:u+h};case Ne.Left:return{x:a,y:u+h/2}}}function Ah(t,r){return t&&(r?t.find(o=>o.id===r):t[0])||null}function fc(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function d1(t,{id:r,defaultColor:o,defaultMarkerStart:s,defaultMarkerEnd:a}){const u=new Set;return t.reduce((c,h)=>([h.markerStart||s,h.markerEnd||a].forEach(m=>{if(m&&typeof m=="object"){const y=fc(m,r);u.has(y)||(c.push({id:y,color:m.color||o,...m}),u.add(y))}}),c),[]).sort((c,h)=>c.id.localeCompare(h.id))}const Em=1e3,f1=10,Pc={nodeOrigin:[0,0],nodeExtent:ls,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},h1={...Pc,checkEquality:!0};function Mc(t,r){const o={...t};for(const s in r)r[s]!==void 0&&(o[s]=r[s]);return o}function p1(t,r,o){const s=Mc(Pc,o);for(const a of t.values())if(a.parentId)Tc(a,t,r,s);else{const u=gs(a,s.nodeOrigin),c=ci(a.extent)?a.extent:s.nodeExtent,h=So(u,c,hr(a));a.internals.positionAbsolute=h}}function m1(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 u={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(u):a.type==="target"&&s.push(u)}return{source:o,target:s}}function Ic(t){return t==="manual"}function hc(t,r,o,s={}){var y,x;const a=Mc(h1,s),u={i:0},c=new Map(r),h=a!=null&&a.elevateNodesOnSelect&&!Ic(a.zIndexMode)?Em:0;let m=t.length>0;r.clear(),o.clear();for(const g of t){let v=c.get(g.id);if(a.checkEquality&&g===(v==null?void 0:v.internals.userNode))r.set(g.id,v);else{const C=gs(g,a.nodeOrigin),E=ci(g.extent)?g.extent:a.nodeExtent,N=So(C,E,hr(g));v={...a.defaults,...g,measured:{width:(y=g.measured)==null?void 0:y.width,height:(x=g.measured)==null?void 0:x.height},internals:{positionAbsolute:N,handleBounds:m1(g,v),z:Nm(g,h,a.zIndexMode),userNode:g}},r.set(g.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(m=!1),g.parentId&&Tc(v,r,o,s,u)}return m}function g1(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 Tc(t,r,o,s,a){const{elevateNodesOnSelect:u,nodeOrigin:c,nodeExtent:h,zIndexMode:m}=Mc(Pc,s),y=t.parentId,x=r.get(y);if(!x){console.warn(`Parent node ${y} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}g1(t,o),a&&!x.parentId&&x.internals.rootParentIndex===void 0&&m==="auto"&&(x.internals.rootParentIndex=++a.i,x.internals.z=x.internals.z+a.i*f1),a&&x.internals.rootParentIndex!==void 0&&(a.i=x.internals.rootParentIndex);const g=u&&!Ic(m)?Em:0,{x:v,y:C,z:E}=y1(t,x,c,h,g,m),{positionAbsolute:N}=t.internals,k=v!==N.x||C!==N.y;(k||E!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:k?{x:v,y:C}:N,z:E}})}function Nm(t,r,o){const s=In(t.zIndex)?t.zIndex:0;return Ic(o)?s:s+(t.selected?r:0)}function y1(t,r,o,s,a,u){const{x:c,y:h}=r.internals.positionAbsolute,m=hr(t),y=gs(t,o),x=ci(t.extent)?So(y,t.extent,m):y;let g=So({x:c+x.x,y:h+x.y},s,m);t.extent==="parent"&&(g=um(g,m,r));const v=Nm(t,a,u),C=r.internals.z??0;return{x:g.x,y:g.y,z:C>=v?C+1:v}}function Rc(t,r,o,s=[0,0]){var c;const a=[],u=new Map;for(const h of t){const m=r.get(h.parentId);if(!m)continue;const y=((c=u.get(h.parentId))==null?void 0:c.expandedRect)??ui(m),x=dm(y,h.rect);u.set(h.parentId,{expandedRect:x,parent:m})}return u.size>0&&u.forEach(({expandedRect:h,parent:m},y)=>{var _;const x=m.internals.positionAbsolute,g=hr(m),v=m.origin??s,C=h.x<x.x?Math.round(Math.abs(x.x-h.x)):0,E=h.y<x.y?Math.round(Math.abs(x.y-h.y)):0,N=Math.max(g.width,Math.round(h.width)),k=Math.max(g.height,Math.round(h.height)),S=(N-g.width)*v[0],I=(k-g.height)*v[1];(C>0||E>0||S||I)&&(a.push({id:y,type:"position",position:{x:m.position.x-C+S,y:m.position.y-E+I}}),(_=o.get(y))==null||_.forEach(j=>{t.some(O=>O.id===j.id)||a.push({id:j.id,type:"position",position:{x:j.position.x+C,y:j.position.y+E}})})),(g.width<h.width||g.height<h.height||C||E)&&a.push({id:y,type:"dimensions",setAttributes:!0,dimensions:{width:N+(C?v[0]*C-S:0),height:k+(E?v[1]*E-I:0)}})}),a}function v1(t,r,o,s,a,u,c){const h=s==null?void 0:s.querySelector(".xyflow__viewport");let m=!1;if(!h)return{changes:[],updatedInternals:m};const y=[],x=window.getComputedStyle(h),{m22:g}=new window.DOMMatrixReadOnly(x.transform),v=[];for(const C of t.values()){const E=r.get(C.id);if(!E)continue;if(E.hidden){r.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),m=!0;continue}const N=bc(C.nodeElement),k=E.measured.width!==N.width||E.measured.height!==N.height;if(!!(N.width&&N.height&&(k||!E.internals.handleBounds||C.force))){const I=C.nodeElement.getBoundingClientRect(),_=ci(E.extent)?E.extent:u;let{positionAbsolute:j}=E.internals;E.parentId&&E.extent==="parent"?j=um(j,N,r.get(E.parentId)):_&&(j=So(j,_,N));const O={...E,measured:N,internals:{...E.internals,positionAbsolute:j,handleBounds:{source:Ph("source",C.nodeElement,I,g,E.id),target:Ph("target",C.nodeElement,I,g,E.id)}}};r.set(E.id,O),E.parentId&&Tc(O,r,o,{nodeOrigin:a,zIndexMode:c}),m=!0,k&&(y.push({id:E.id,type:"dimensions",dimensions:N}),E.expandParent&&E.parentId&&v.push({id:E.id,parentId:E.parentId,rect:ui(O,a)}))}}if(v.length>0){const C=Rc(v,r,o,a);y.push(...C)}return{changes:y,updatedInternals:m}}async function x1({delta:t,panZoom:r,transform:o,translateExtent:s,width:a,height:u}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const c=await r.setViewportConstrained({x:o[0]+t.x,y:o[1]+t.y,zoom:o[2]},[[0,0],[a,u]],s),h=!!c&&(c.x!==o[0]||c.y!==o[1]||c.k!==o[2]);return Promise.resolve(h)}function Lh(t,r,o,s,a,u){let c=a;const h=s.get(c)||new Map;s.set(c,h.set(o,r)),c=`${a}-${t}`;const m=s.get(c)||new Map;if(s.set(c,m.set(o,r)),u){c=`${a}-${t}-${u}`;const y=s.get(c)||new Map;s.set(c,y.set(o,r))}}function Cm(t,r,o){t.clear(),r.clear();for(const s of o){const{source:a,target:u,sourceHandle:c=null,targetHandle:h=null}=s,m={edgeId:s.id,source:a,target:u,sourceHandle:c,targetHandle:h},y=`${a}-${c}--${u}-${h}`,x=`${u}-${h}--${a}-${c}`;Lh("source",m,x,t,a,c),Lh("target",m,y,t,u,h),r.set(s.id,s)}}function _m(t,r){if(!t.parentId)return!1;const o=r.get(t.parentId);return o?o.selected?!0:_m(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 w1(t,r,o,s){const a=new Map;for(const[u,c]of t)if((c.selected||c.id===s)&&(!c.parentId||!_m(c,t))&&(c.draggable||r&&typeof c.draggable>"u")){const h=t.get(u);h&&a.set(u,{id:u,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 Yu({nodeId:t,dragItems:r,nodeLookup:o,dragging:s=!0}){var c,h,m;const a=[];for(const[y,x]of r){const g=(c=o.get(y))==null?void 0:c.internals.userNode;g&&a.push({...g,position:x.position,dragging:s})}if(!t)return[a[0],a];const u=(h=o.get(t))==null?void 0:h.internals.userNode;return[u?{...u,position:((m=r.get(t))==null?void 0:m.position)||u.position,dragging:s}:a[0],a]}function S1({dragItems:t,snapGrid:r,x:o,y:s}){const a=t.values().next().value;if(!a)return null;const u={x:o-a.distance.x,y:s-a.distance.y},c=vs(u,r);return{x:c.x-u.x,y:c.y-u.y}}function k1({onNodeMouseDown:t,getStoreItems:r,onDragStart:o,onDrag:s,onDragStop:a}){let u={x:null,y:null},c=0,h=new Map,m=!1,y={x:0,y:0},x=null,g=!1,v=null,C=!1,E=!1,N=null;function k({noDragClassName:I,handleSelector:_,domNode:j,isSelectable:O,nodeId:A,nodeClickDistance:H=0}){v=qt(j);function q({x:X,y:re}){const{nodeLookup:P,nodeExtent:K,snapGrid:V,snapToGrid:G,nodeOrigin:R,onNodeDrag:z,onSelectionDrag:B,onError:M,updateNodePositions:D}=r();u={x:X,y:re};let ie=!1;const oe=h.size>1,de=oe&&K?cc(ys(h)):null,he=oe&&G?S1({dragItems:h,snapGrid:V,x:X,y:re}):null;for(const[me,ne]of h){if(!P.has(me))continue;let pe={x:X-ne.distance.x,y:re-ne.distance.y};G&&(pe=he?{x:Math.round(pe.x+he.x),y:Math.round(pe.y+he.y)}:vs(pe,V));let be=null;if(oe&&K&&!ne.extent&&de){const{positionAbsolute:Ee}=ne.internals,ze=Ee.x-de.x+K[0][0],He=Ee.x+ne.measured.width-de.x2+K[1][0],Ae=Ee.y-de.y+K[0][1],Ge=Ee.y+ne.measured.height-de.y2+K[1][1];be=[[ze,Ae],[He,Ge]]}const{position:_e,positionAbsolute:Ce}=am({nodeId:me,nextPosition:pe,nodeLookup:P,nodeExtent:be||K,nodeOrigin:R,onError:M});ie=ie||ne.position.x!==_e.x||ne.position.y!==_e.y,ne.position=_e,ne.internals.positionAbsolute=Ce}if(E=E||ie,!!ie&&(D(h,!0),N&&(s||z||!A&&B))){const[me,ne]=Yu({nodeId:A,dragItems:h,nodeLookup:P});s==null||s(N,h,me,ne),z==null||z(N,me,ne),A||B==null||B(N,ne)}}async function J(){if(!x)return;const{transform:X,panBy:re,autoPanSpeed:P,autoPanOnNodeDrag:K}=r();if(!K){m=!1,cancelAnimationFrame(c);return}const[V,G]=cm(y,x,P);(V!==0||G!==0)&&(u.x=(u.x??0)-V/X[2],u.y=(u.y??0)-G/X[2],await re({x:V,y:G})&&q(u)),c=requestAnimationFrame(J)}function ee(X){var oe;const{nodeLookup:re,multiSelectionActive:P,nodesDraggable:K,transform:V,snapGrid:G,snapToGrid:R,selectNodesOnDrag:z,onNodeDragStart:B,onSelectionDragStart:M,unselectNodesAndEdges:D}=r();g=!0,(!z||!O)&&!P&&A&&((oe=re.get(A))!=null&&oe.selected||D()),O&&z&&A&&(t==null||t(A));const ie=ns(X.sourceEvent,{transform:V,snapGrid:G,snapToGrid:R,containerBounds:x});if(u=ie,h=w1(re,K,ie,A),h.size>0&&(o||B||!A&&M)){const[de,he]=Yu({nodeId:A,dragItems:h,nodeLookup:re});o==null||o(X.sourceEvent,h,de,he),B==null||B(X.sourceEvent,de,he),A||M==null||M(X.sourceEvent,he)}}const U=Hp().clickDistance(H).on("start",X=>{const{domNode:re,nodeDragThreshold:P,transform:K,snapGrid:V,snapToGrid:G}=r();x=(re==null?void 0:re.getBoundingClientRect())||null,C=!1,E=!1,N=X.sourceEvent,P===0&&ee(X),u=ns(X.sourceEvent,{transform:K,snapGrid:V,snapToGrid:G,containerBounds:x}),y=Tn(X.sourceEvent,x)}).on("drag",X=>{const{autoPanOnNodeDrag:re,transform:P,snapGrid:K,snapToGrid:V,nodeDragThreshold:G,nodeLookup:R}=r(),z=ns(X.sourceEvent,{transform:P,snapGrid:K,snapToGrid:V,containerBounds:x});if(N=X.sourceEvent,(X.sourceEvent.type==="touchmove"&&X.sourceEvent.touches.length>1||A&&!R.has(A))&&(C=!0),!C){if(!m&&re&&g&&(m=!0,J()),!g){const B=Tn(X.sourceEvent,x),M=B.x-y.x,D=B.y-y.y;Math.sqrt(M*M+D*D)>G&&ee(X)}(u.x!==z.xSnapped||u.y!==z.ySnapped)&&h&&g&&(y=Tn(X.sourceEvent,x),q(z))}}).on("end",X=>{if(!(!g||C)&&(m=!1,g=!1,cancelAnimationFrame(c),h.size>0)){const{nodeLookup:re,updateNodePositions:P,onNodeDragStop:K,onSelectionDragStop:V}=r();if(E&&(P(h,!1),E=!1),a||K||!A&&V){const[G,R]=Yu({nodeId:A,dragItems:h,nodeLookup:re,dragging:!1});a==null||a(X.sourceEvent,h,G,R),K==null||K(X.sourceEvent,G,R),A||V==null||V(X.sourceEvent,R)}}}).filter(X=>{const re=X.target;return!X.button&&(!I||!Dh(re,`.${I}`,j))&&(!_||Dh(re,_,j))});v.call(U)}function S(){v==null||v.on(".drag",null)}return{update:k,destroy:S}}function E1(t,r,o){const s=[],a={x:t.x-o,y:t.y-o,width:o*2,height:o*2};for(const u of r.values())cs(a,ui(u))>0&&s.push(u);return s}const N1=250;function C1(t,r,o,s){var h,m;let a=[],u=1/0;const c=E1(t,o,r+N1);for(const y of c){const x=[...((h=y.internals.handleBounds)==null?void 0:h.source)??[],...((m=y.internals.handleBounds)==null?void 0:m.target)??[]];for(const g of x){if(s.nodeId===g.nodeId&&s.type===g.type&&s.id===g.id)continue;const{x:v,y:C}=ko(y,g,g.position,!0),E=Math.sqrt(Math.pow(v-t.x,2)+Math.pow(C-t.y,2));E>r||(E<u?(a=[{...g,x:v,y:C}],u=E):E===u&&a.push({...g,x:v,y:C}))}}if(!a.length)return null;if(a.length>1){const y=s.type==="source"?"target":"source";return a.find(x=>x.type===y)??a[0]}return a[0]}function jm(t,r,o,s,a,u=!1){var y,x,g;const c=s.get(t);if(!c)return null;const h=a==="strict"?(y=c.internals.handleBounds)==null?void 0:y[r]:[...((x=c.internals.handleBounds)==null?void 0:x.source)??[],...((g=c.internals.handleBounds)==null?void 0:g.target)??[]],m=(o?h==null?void 0:h.find(v=>v.id===o):h==null?void 0:h[0])??null;return m&&u?{...m,...ko(c,m,m.position,!0)}:m}function bm(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function _1(t,r){let o=null;return r?o=!0:t&&!r&&(o=!1),o}const Pm=()=>!0;function j1(t,{connectionMode:r,connectionRadius:o,handleId:s,nodeId:a,edgeUpdaterType:u,isTarget:c,domNode:h,nodeLookup:m,lib:y,autoPanOnConnect:x,flowId:g,panBy:v,cancelConnection:C,onConnectStart:E,onConnect:N,onConnectEnd:k,isValidConnection:S=Pm,onReconnectEnd:I,updateConnection:_,getTransform:j,getFromHandle:O,autoPanSpeed:A,dragThreshold:H=1,handleDomNode:q}){const J=pm(t.target);let ee=0,U;const{x:X,y:re}=Tn(t),P=bm(u,q),K=h==null?void 0:h.getBoundingClientRect();let V=!1;if(!K||!P)return;const G=jm(a,P,s,m,r);if(!G)return;let R=Tn(t,K),z=!1,B=null,M=!1,D=null;function ie(){if(!x||!K)return;const[_e,Ce]=cm(R,K,A);v({x:_e,y:Ce}),ee=requestAnimationFrame(ie)}const oe={...G,nodeId:a,type:P,position:G.position},de=m.get(a);let me={inProgress:!0,isValid:null,from:ko(de,oe,Ne.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:de,to:R,toHandle:null,toPosition:Ch[oe.position],toNode:null,pointer:R};function ne(){V=!0,_(me),E==null||E(t,{nodeId:a,handleId:s,handleType:P})}H===0&&ne();function pe(_e){if(!V){const{x:Ge,y:Ct}=Tn(_e),ft=Ge-X,yt=Ct-re;if(!(ft*ft+yt*yt>H*H))return;ne()}if(!O()||!oe){be(_e);return}const Ce=j();R=Tn(_e,K),U=C1(xs(R,Ce,!1,[1,1]),o,m,oe),z||(ie(),z=!0);const Ee=Mm(_e,{handle:U,connectionMode:r,fromNodeId:a,fromHandleId:s,fromType:c?"target":"source",isValidConnection:S,doc:J,lib:y,flowId:g,nodeLookup:m});D=Ee.handleDomNode,B=Ee.connection,M=_1(!!U,Ee.isValid);const ze=m.get(a),He=ze?ko(ze,oe,Ne.Left,!0):me.from,Ae={...me,from:He,isValid:M,to:Ee.toHandle&&M?Ul({x:Ee.toHandle.x,y:Ee.toHandle.y},Ce):R,toHandle:Ee.toHandle,toPosition:M&&Ee.toHandle?Ee.toHandle.position:Ch[oe.position],toNode:Ee.toHandle?m.get(Ee.toHandle.nodeId):null,pointer:R};_(Ae),me=Ae}function be(_e){if(!("touches"in _e&&_e.touches.length>0)){if(V){(U||D)&&B&&M&&(N==null||N(B));const{inProgress:Ce,...Ee}=me,ze={...Ee,toPosition:me.toHandle?me.toPosition:null};k==null||k(_e,ze),u&&(I==null||I(_e,ze))}C(),cancelAnimationFrame(ee),z=!1,M=!1,B=null,D=null,J.removeEventListener("mousemove",pe),J.removeEventListener("mouseup",be),J.removeEventListener("touchmove",pe),J.removeEventListener("touchend",be)}}J.addEventListener("mousemove",pe),J.addEventListener("mouseup",be),J.addEventListener("touchmove",pe),J.addEventListener("touchend",be)}function Mm(t,{handle:r,connectionMode:o,fromNodeId:s,fromHandleId:a,fromType:u,doc:c,lib:h,flowId:m,isValidConnection:y=Pm,nodeLookup:x}){const g=u==="target",v=r?c.querySelector(`.${h}-flow__handle[data-id="${m}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:E}=Tn(t),N=c.elementFromPoint(C,E),k=N!=null&&N.classList.contains(`${h}-flow__handle`)?N:v,S={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const I=bm(void 0,k),_=k.getAttribute("data-nodeid"),j=k.getAttribute("data-handleid"),O=k.classList.contains("connectable"),A=k.classList.contains("connectableend");if(!_||!I)return S;const H={source:g?_:s,sourceHandle:g?j:a,target:g?s:_,targetHandle:g?a:j};S.connection=H;const J=O&&A&&(o===wo.Strict?g&&I==="source"||!g&&I==="target":_!==s||j!==a);S.isValid=J&&y(H),S.toHandle=jm(_,I,j,x,o,!0)}return S}const pc={onPointerDown:j1,isValid:Mm};function b1({domNode:t,panZoom:r,getTransform:o,getViewScale:s}){const a=qt(t);function u({translateExtent:h,width:m,height:y,zoomStep:x=1,pannable:g=!0,zoomable:v=!0,inversePan:C=!1}){const E=_=>{if(_.sourceEvent.type!=="wheel"||!r)return;const j=o(),O=_.sourceEvent.ctrlKey&&ds()?10:1,A=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*x,H=j[2]*Math.pow(2,A*O);r.scaleTo(H)};let N=[0,0];const k=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(N=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},S=_=>{const j=o();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!r)return;const O=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.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]))*(C?-1:1),q={x:j[0]-A[0]*H,y:j[1]-A[1]*H},J=[[0,0],[m,y]];r.setViewportConstrained({x:q.x,y:q.y,zoom:j[2]},J,h)},I=nm().on("start",k).on("zoom",g?S:null).on("zoom.wheel",v?E:null);a.call(I,{})}function c(){a.on("zoom",null)}return{update:u,destroy:c,pointer:Pn}}const na=t=>({x:t.x,y:t.y,zoom:t.k}),Xu=({x:t,y:r,zoom:o})=>Jl.translate(t,r).scale(o),ni=(t,r)=>t.target.closest(`.${r}`),Im=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),P1=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Gu=(t,r=0,o=P1,s=()=>{})=>{const a=typeof r=="number"&&r>0;return a||s(),a?t.transition().duration(r).ease(o).on("end",s):t},Tm=t=>{const r=t.ctrlKey&&ds()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function M1({zoomPanValues:t,noWheelClassName:r,d3Selection:o,d3Zoom:s,panOnScrollMode:a,panOnScrollSpeed:u,zoomOnPinch:c,onPanZoomStart:h,onPanZoom:m,onPanZoomEnd:y}){return x=>{if(ni(x,r))return x.ctrlKey&&x.preventDefault(),!1;x.preventDefault(),x.stopImmediatePropagation();const g=o.property("__zoom").k||1;if(x.ctrlKey&&c){const k=Pn(x),S=Tm(x),I=g*Math.pow(2,S);s.scaleTo(o,I,k,x);return}const v=x.deltaMode===1?20:1;let C=a===yo.Vertical?0:x.deltaX*v,E=a===yo.Horizontal?0:x.deltaY*v;!ds()&&x.shiftKey&&a!==yo.Vertical&&(C=x.deltaY*v,E=0),s.translateBy(o,-(C/g)*u,-(E/g)*u,{internal:!0});const N=na(o.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(m==null||m(x,N),t.panScrollTimeout=setTimeout(()=>{y==null||y(x,N),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,h==null||h(x,N))}}function I1({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:o}){return function(s,a){const u=s.type==="wheel",c=!r&&u&&!s.ctrlKey,h=ni(s,t);if(s.ctrlKey&&u&&h&&s.preventDefault(),c||h)return null;s.preventDefault(),o.call(this,s,a)}}function T1({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:o}){return s=>{var u,c,h;if((u=s.sourceEvent)!=null&&u.internal)return;const a=na(s.transform);t.mouseButton=((c=s.sourceEvent)==null?void 0:c.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 R1({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:o,onTransformChange:s,onPanZoom:a}){return u=>{var c,h;t.usedRightMouseButton=!!(o&&Im(r,t.mouseButton??0)),(c=u.sourceEvent)!=null&&c.sync||s([u.transform.x,u.transform.y,u.transform.k]),a&&!((h=u.sourceEvent)!=null&&h.internal)&&(a==null||a(u.sourceEvent,na(u.transform)))}}function z1({zoomPanValues:t,panOnDrag:r,panOnScroll:o,onDraggingChange:s,onPanZoomEnd:a,onPaneContextMenu:u}){return c=>{var h;if(!((h=c.sourceEvent)!=null&&h.internal)&&(t.isZoomingOrPanning=!1,u&&Im(r,t.mouseButton??0)&&!t.usedRightMouseButton&&c.sourceEvent&&u(c.sourceEvent),t.usedRightMouseButton=!1,s(!1),a)){const m=na(c.transform);t.prevViewport=m,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{a==null||a(c.sourceEvent,m)},o?150:0)}}}function A1({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:o,panOnDrag:s,panOnScroll:a,zoomOnDoubleClick:u,userSelectionActive:c,noWheelClassName:h,noPanClassName:m,lib:y,connectionInProgress:x}){return g=>{var k;const v=t||r,C=o&&g.ctrlKey,E=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(ni(g,`${y}-flow__node`)||ni(g,`${y}-flow__edge`)))return!0;if(!s&&!v&&!a&&!u&&!o||c||x&&!E||ni(g,h)&&E||ni(g,m)&&(!E||a&&E&&!t)||!o&&g.ctrlKey&&E)return!1;if(!o&&g.type==="touchstart"&&((k=g.touches)==null?void 0:k.length)>1)return g.preventDefault(),!1;if(!v&&!a&&!C&&E||!s&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(s)&&!s.includes(g.button)&&g.type==="mousedown")return!1;const N=Array.isArray(s)&&s.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||E)&&N}}function L1({domNode:t,minZoom:r,maxZoom:o,translateExtent:s,viewport:a,onPanZoom:u,onPanZoomStart:c,onPanZoomEnd:h,onDraggingChange:m}){const y={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},x=t.getBoundingClientRect(),g=nm().scaleExtent([r,o]).translateExtent(s),v=qt(t).call(g);I({x:a.x,y:a.y,zoom:ai(a.zoom,r,o)},[[0,0],[x.width,x.height]],s);const C=v.on("wheel.zoom"),E=v.on("dblclick.zoom");g.wheelDelta(Tm);function N(U,X){return v?new Promise(re=>{g==null||g.interpolate((X==null?void 0:X.interpolate)==="linear"?ts:Rl).transform(Gu(v,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:P,panOnScroll:K,panOnDrag:V,panOnScrollMode:G,panOnScrollSpeed:R,preventScrolling:z,zoomOnPinch:B,zoomOnScroll:M,zoomOnDoubleClick:D,zoomActivationKeyPressed:ie,lib:oe,onTransformChange:de,connectionInProgress:he,paneClickDistance:me,selectionOnDrag:ne}){P&&!y.isZoomingOrPanning&&S();const pe=K&&!ie&&!P;g.clickDistance(ne?1/0:!In(me)||me<0?0:me);const be=pe?M1({zoomPanValues:y,noWheelClassName:U,d3Selection:v,d3Zoom:g,panOnScrollMode:G,panOnScrollSpeed:R,zoomOnPinch:B,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:h}):I1({noWheelClassName:U,preventScrolling:z,d3ZoomHandler:C});if(v.on("wheel.zoom",be,{passive:!1}),!P){const Ce=T1({zoomPanValues:y,onDraggingChange:m,onPanZoomStart:c});g.on("start",Ce);const Ee=R1({zoomPanValues:y,panOnDrag:V,onPaneContextMenu:!!re,onPanZoom:u,onTransformChange:de});g.on("zoom",Ee);const ze=z1({zoomPanValues:y,panOnDrag:V,panOnScroll:K,onPaneContextMenu:re,onPanZoomEnd:h,onDraggingChange:m});g.on("end",ze)}const _e=A1({zoomActivationKeyPressed:ie,panOnDrag:V,zoomOnScroll:M,panOnScroll:K,zoomOnDoubleClick:D,zoomOnPinch:B,userSelectionActive:P,noPanClassName:X,noWheelClassName:U,lib:oe,connectionInProgress:he});g.filter(_e),D?v.on("dblclick.zoom",E):v.on("dblclick.zoom",null)}function S(){g.on("zoom",null)}async function I(U,X,re){const P=Xu(U),K=g==null?void 0:g.constrain()(P,X,re);return K&&await N(K),new Promise(V=>V(K))}async function _(U,X){const re=Xu(U);return await N(re,X),new Promise(P=>P(re))}function j(U){if(v){const X=Xu(U),re=v.property("__zoom");(re.k!==U.zoom||re.x!==U.x||re.y!==U.y)&&(g==null||g.transform(v,X,null,{sync:!0}))}}function O(){const U=v?tm(v.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function A(U,X){return v?new Promise(re=>{g==null||g.interpolate((X==null?void 0:X.interpolate)==="linear"?ts:Rl).scaleTo(Gu(v,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>re(!0)),U)}):Promise.resolve(!1)}function H(U,X){return v?new Promise(re=>{g==null||g.interpolate((X==null?void 0:X.interpolate)==="linear"?ts:Rl).scaleBy(Gu(v,X==null?void 0:X.duration,X==null?void 0:X.ease,()=>re(!0)),U)}):Promise.resolve(!1)}function q(U){g==null||g.scaleExtent(U)}function J(U){g==null||g.translateExtent(U)}function ee(U){const X=!In(U)||U<0?0:U;g==null||g.clickDistance(X)}return{update:k,destroy:S,setViewport:_,setViewportConstrained:I,getViewport:O,scaleTo:A,scaleBy:H,setScaleExtent:q,setTranslateExtent:J,syncViewport:j,setClickDistance:ee}}var Eo;(function(t){t.Line="line",t.Handle="handle"})(Eo||(Eo={}));const D1=["top-left","top-right","bottom-left","bottom-right"],$1=["top","right","bottom","left"];function O1({width:t,prevWidth:r,height:o,prevHeight:s,affectsX:a,affectsY:u}){const c=t-r,h=o-s,m=[c>0?1:c<0?-1:0,h>0?1:h<0?-1:0];return c&&a&&(m[0]=m[0]*-1),h&&u&&(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 Pl(t,r,o){return Math.max(0,r-t,t-o)}function Oh(t,r){return t?!r:r}function F1(t,r,o,s,a,u,c,h){let{affectsX:m,affectsY:y}=r;const{isHorizontal:x,isVertical:g}=r,v=x&&g,{xSnapped:C,ySnapped:E}=o,{minWidth:N,maxWidth:k,minHeight:S,maxHeight:I}=s,{x:_,y:j,width:O,height:A,aspectRatio:H}=t;let q=Math.floor(x?C-t.pointerX:0),J=Math.floor(g?E-t.pointerY:0);const ee=O+(m?-q:q),U=A+(y?-J:J),X=-u[0]*O,re=-u[1]*A;let P=Pl(ee,N,k),K=Pl(U,S,I);if(c){let R=0,z=0;m&&q<0?R=$r(_+q+X,c[0][0]):!m&&q>0&&(R=Or(_+ee+X,c[1][0])),y&&J<0?z=$r(j+J+re,c[0][1]):!y&&J>0&&(z=Or(j+U+re,c[1][1])),P=Math.max(P,R),K=Math.max(K,z)}if(h){let R=0,z=0;m&&q>0?R=Or(_+q,h[0][0]):!m&&q<0&&(R=$r(_+ee,h[1][0])),y&&J>0?z=Or(j+J,h[0][1]):!y&&J<0&&(z=$r(j+U,h[1][1])),P=Math.max(P,R),K=Math.max(K,z)}if(a){if(x){const R=Pl(ee/H,S,I)*H;if(P=Math.max(P,R),c){let z=0;!m&&!y||m&&!y&&v?z=Or(j+re+ee/H,c[1][1])*H:z=$r(j+re+(m?q:-q)/H,c[0][1])*H,P=Math.max(P,z)}if(h){let z=0;!m&&!y||m&&!y&&v?z=$r(j+ee/H,h[1][1])*H:z=Or(j+(m?q:-q)/H,h[0][1])*H,P=Math.max(P,z)}}if(g){const R=Pl(U*H,N,k)/H;if(K=Math.max(K,R),c){let z=0;!m&&!y||y&&!m&&v?z=Or(_+U*H+X,c[1][0])/H:z=$r(_+(y?J:-J)*H+X,c[0][0])/H,K=Math.max(K,z)}if(h){let z=0;!m&&!y||y&&!m&&v?z=$r(_+U*H,h[1][0])/H:z=Or(_+(y?J:-J)*H,h[0][0])/H,K=Math.max(K,z)}}}J=J+(J<0?K:-K),q=q+(q<0?P:-P),a&&(v?ee>U*H?J=(Oh(m,y)?-q:q)/H:q=(Oh(m,y)?-J:J)*H:x?(J=q/H,y=m):(q=J*H,m=y));const V=m?_+q:_,G=y?j+J:j;return{width:O+(m?-q:q),height:A+(y?-J:J),x:u[0]*q*(m?-1:1)+V,y:u[1]*J*(y?-1:1)+G}}const Rm={width:0,height:0,x:0,y:0},H1={...Rm,pointerX:0,pointerY:0,aspectRatio:1};function V1(t){return[[0,0],[t.measured.width,t.measured.height]]}function B1(t,r,o){const s=r.position.x+t.position.x,a=r.position.y+t.position.y,u=t.measured.width??0,c=t.measured.height??0,h=o[0]*u,m=o[1]*c;return[[s-h,a-m],[s+u-h,a+c-m]]}function W1({domNode:t,nodeId:r,getStoreItems:o,onChange:s,onEnd:a}){const u=qt(t);let c={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:y,boundaries:x,keepAspectRatio:g,resizeDirection:v,onResizeStart:C,onResize:E,onResizeEnd:N,shouldResize:k}){let S={...Rm},I={...H1};c={boundaries:x,resizeDirection:v,keepAspectRatio:g,controlDirection:$h(y)};let _,j=null,O=[],A,H,q,J=!1;const ee=Hp().on("start",U=>{const{nodeLookup:X,transform:re,snapGrid:P,snapToGrid:K,nodeOrigin:V,paneDomNode:G}=o();if(_=X.get(r),!_)return;j=(G==null?void 0:G.getBoundingClientRect())??null;const{xSnapped:R,ySnapped:z}=ns(U.sourceEvent,{transform:re,snapGrid:P,snapToGrid:K,containerBounds:j});S={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},I={...S,pointerX:R,pointerY:z,aspectRatio:S.width/S.height},A=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(A=X.get(_.parentId),H=A&&_.extent==="parent"?V1(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 D=B1(M,_,M.origin??V);q?q=[[Math.min(D[0][0],q[0][0]),Math.min(D[0][1],q[0][1])],[Math.max(D[1][0],q[1][0]),Math.max(D[1][1],q[1][1])]]:q=D}C==null||C(U,{...S})}).on("drag",U=>{const{transform:X,snapGrid:re,snapToGrid:P,nodeOrigin:K}=o(),V=ns(U.sourceEvent,{transform:X,snapGrid:re,snapToGrid:P,containerBounds:j}),G=[];if(!_)return;const{x:R,y:z,width:B,height:M}=S,D={},ie=_.origin??K,{width:oe,height:de,x:he,y:me}=F1(I,c.controlDirection,V,c.boundaries,c.keepAspectRatio,ie,H,q),ne=oe!==B,pe=de!==M,be=he!==R&&ne,_e=me!==z&&pe;if(!be&&!_e&&!ne&&!pe)return;if((be||_e||ie[0]===1||ie[1]===1)&&(D.x=be?he:S.x,D.y=_e?me:S.y,S.x=D.x,S.y=D.y,O.length>0)){const He=he-R,Ae=me-z;for(const Ge of O)Ge.position={x:Ge.position.x-He+ie[0]*(oe-B),y:Ge.position.y-Ae+ie[1]*(de-M)},G.push(Ge)}if((ne||pe)&&(D.width=ne&&(!c.resizeDirection||c.resizeDirection==="horizontal")?oe:S.width,D.height=pe&&(!c.resizeDirection||c.resizeDirection==="vertical")?de:S.height,S.width=D.width,S.height=D.height),A&&_.expandParent){const He=ie[0]*(D.width??0);D.x&&D.x<He&&(S.x=He,I.x=I.x-(D.x-He));const Ae=ie[1]*(D.height??0);D.y&&D.y<Ae&&(S.y=Ae,I.y=I.y-(D.y-Ae))}const Ce=O1({width:S.width,prevWidth:B,height:S.height,prevHeight:M,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),Ee={...S,direction:Ce};(k==null?void 0:k(U,Ee))!==!1&&(J=!0,E==null||E(U,Ee),s(D,G))}).on("end",U=>{J&&(N==null||N(U,{...S}),a==null||a({...S}),J=!1)});u.call(ee)}function m(){u.on(".drag",null)}return{update:h,destroy:m}}var Ku={exports:{}},Qu={},qu={exports:{}},Zu={};/**
|
|
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 U1(){if(Fh)return Zu;Fh=1;var t=hs();function r(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var o=typeof Object.is=="function"?Object.is:r,s=t.useState,a=t.useEffect,u=t.useLayoutEffect,c=t.useDebugValue;function h(g,v){var C=v(),E=s({inst:{value:C,getSnapshot:v}}),N=E[0].inst,k=E[1];return u(function(){N.value=C,N.getSnapshot=v,m(N)&&k({inst:N})},[g,C,v]),a(function(){return m(N)&&k({inst:N}),g(function(){m(N)&&k({inst:N})})},[g]),c(C),C}function m(g){var v=g.getSnapshot;g=g.value;try{var C=v();return!o(g,C)}catch{return!0}}function y(g,v){return v()}var x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:h;return Zu.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:x,Zu}var Hh;function Y1(){return Hh||(Hh=1,qu.exports=U1()),qu.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 X1(){if(Vh)return Qu;Vh=1;var t=hs(),r=Y1();function o(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var s=typeof Object.is=="function"?Object.is:o,a=r.useSyncExternalStore,u=t.useRef,c=t.useEffect,h=t.useMemo,m=t.useDebugValue;return Qu.useSyncExternalStoreWithSelector=function(y,x,g,v,C){var E=u(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,_=A,A=v(A),C!==void 0&&N.hasValue){var H=N.value;if(C(H,A))return j=H}return j=A}if(H=j,s(_,A))return H;var q=v(A);return C!==void 0&&C(H,q)?(_=A,H):(_=A,j=q)}var I=!1,_,j,O=g===void 0?null:g;return[function(){return S(x())},O===null?void 0:function(){return S(O())}]},[x,g,v,C]);var k=a(y,E[0],E[1]);return c(function(){N.hasValue=!0,N.value=k},[k]),m(k),k},Qu}var Bh;function G1(){return Bh||(Bh=1,Ku.exports=X1()),Ku.exports}var K1=G1();const Q1=yc(K1),q1={},Wh=t=>{let r;const o=new Set,s=(x,g)=>{const v=typeof x=="function"?x(r):x;if(!Object.is(v,r)){const C=r;r=g??(typeof v!="object"||v===null)?v:Object.assign({},r,v),o.forEach(E=>E(r,C))}},a=()=>r,m={setState:s,getState:a,getInitialState:()=>y,subscribe:x=>(o.add(x),()=>o.delete(x)),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()}},y=r=t(s,a,m);return m},Z1=t=>t?Wh(t):Wh,{useDebugValue:J1}=Cp,{useSyncExternalStoreWithSelector:eS}=Q1,tS=t=>t;function zm(t,r=tS,o){const s=eS(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,o);return J1(s),s}const Uh=(t,r)=>{const o=Z1(t),s=(a,u=r)=>zm(o,a,u);return Object.assign(s,o),s},nS=(t,r)=>t?Uh(t,r):Uh;function Je(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}_p();const ra=b.createContext(null),rS=ra.Provider,Am=Xn.error001();function $e(t,r){const o=b.useContext(ra);if(o===null)throw new Error(Am);return zm(o,t,r)}function et(){const t=b.useContext(ra);if(t===null)throw new Error(Am);return b.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Yh={display:"none"},oS={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Lm="react-flow__node-desc",Dm="react-flow__edge-desc",iS="react-flow__aria-live",sS=t=>t.ariaLiveMessage,lS=t=>t.ariaLabelConfig;function aS({rfId:t}){const r=$e(sS);return f.jsx("div",{id:`${iS}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:oS,children:r})}function uS({rfId:t,disableKeyboardA11y:r}){const o=$e(lS);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${Lm}-${t}`,style:Yh,children:r?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${Dm}-${t}`,style:Yh,children:o["edge.a11yDescription.default"]}),!r&&f.jsx(aS,{rfId:t})]})}const oa=b.forwardRef(({position:t="top-left",children:r,className:o,style:s,...a},u)=>{const c=`${t}`.split("-");return f.jsx("div",{className:at(["react-flow__panel",o,...c]),style:s,ref:u,...a,children:r})});oa.displayName="Panel";function cS({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:f.jsx(oa,{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 dS=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}},Ml=t=>t.id;function fS(t,r){return Je(t.selectedNodes.map(Ml),r.selectedNodes.map(Ml))&&Je(t.selectedEdges.map(Ml),r.selectedEdges.map(Ml))}function hS({onSelectionChange:t}){const r=et(),{selectedNodes:o,selectedEdges:s}=$e(dS,fS);return b.useEffect(()=>{const a={nodes:o,edges:s};t==null||t(a),r.getState().onSelectionChangeHandlers.forEach(u=>u(a))},[o,s,t]),null}const pS=t=>!!t.onSelectionChangeHandlers;function mS({onSelectionChange:t}){const r=$e(pS);return t||r?f.jsx(hS,{onSelectionChange:t}):null}const $m=[0,0],gS={x:0,y:0,zoom:1},yS=["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=[...yS,"rfId"],vS=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:ls,nodeOrigin:$m,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function xS(t){const{setNodes:r,setEdges:o,setMinZoom:s,setMaxZoom:a,setTranslateExtent:u,setNodeExtent:c,reset:h,setDefaultNodesAndEdges:m}=$e(vS,Je),y=et();b.useEffect(()=>(m(t.defaultNodes,t.defaultEdges),()=>{x.current=Gh,h()}),[]);const x=b.useRef(Gh);return b.useEffect(()=>{for(const g of Xh){const v=t[g],C=x.current[g];v!==C&&(typeof t[g]>"u"||(g==="nodes"?r(v):g==="edges"?o(v):g==="minZoom"?s(v):g==="maxZoom"?a(v):g==="translateExtent"?u(v):g==="nodeExtent"?c(v):g==="ariaLabelConfig"?y.setState({ariaLabelConfig:t1(v)}):g==="fitView"?y.setState({fitViewQueued:v}):g==="fitViewOptions"?y.setState({fitViewOptions:v}):y.setState({[g]:v})))}x.current=t},Xh.map(g=>t[g])),null}function Kh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function wS(t){var s;const[r,o]=b.useState(t==="system"?null:t);return b.useEffect(()=>{if(t!=="system"){o(t);return}const a=Kh(),u=()=>o(a!=null&&a.matches?"dark":"light");return u(),a==null||a.addEventListener("change",u),()=>{a==null||a.removeEventListener("change",u)}},[t]),r!==null?r:(s=Kh())!=null&&s.matches?"dark":"light"}const Qh=typeof document<"u"?document:null;function fs(t=null,r={target:Qh,actInsideInputWithModifier:!0}){const[o,s]=b.useState(!1),a=b.useRef(!1),u=b.useRef(new Set([])),[c,h]=b.useMemo(()=>{if(t!==null){const y=(Array.isArray(t)?t:[t]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),x=y.reduce((g,v)=>g.concat(...v),[]);return[y,x]}return[[],[]]},[t]);return b.useEffect(()=>{const m=(r==null?void 0:r.target)??Qh,y=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const x=C=>{var k,S;if(a.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!a.current||a.current&&!y)&&mm(C))return!1;const N=Zh(C.code,h);if(u.current.add(C[N]),qh(c,u.current,!1)){const I=((S=(k=C.composedPath)==null?void 0:k.call(C))==null?void 0:S[0])||C.target,_=(I==null?void 0:I.nodeName)==="BUTTON"||(I==null?void 0:I.nodeName)==="A";r.preventDefault!==!1&&(a.current||!_)&&C.preventDefault(),s(!0)}},g=C=>{const E=Zh(C.code,h);qh(c,u.current,!0)?(s(!1),u.current.clear()):u.current.delete(C[E]),C.key==="Meta"&&u.current.clear(),a.current=!1},v=()=>{u.current.clear(),s(!1)};return m==null||m.addEventListener("keydown",x),m==null||m.addEventListener("keyup",g),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{m==null||m.removeEventListener("keydown",x),m==null||m.removeEventListener("keyup",g),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[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 SS=()=>{const t=et();return b.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,u],panZoom:c}=t.getState();return c?(await c.setViewport({x:r.x??s,y:r.y??a,zoom:r.zoom??u},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:u,maxZoom:c,panZoom:h}=t.getState(),m=jc(r,s,a,u,c,(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:u,domNode:c}=t.getState();if(!c)return r;const{x:h,y:m}=c.getBoundingClientRect(),y={x:r.x-h,y:r.y-m},x=o.snapGrid??a,g=o.snapToGrid??u;return xs(y,s,g,x)},flowToScreenPosition:r=>{const{transform:o,domNode:s}=t.getState();if(!s)return r;const{x:a,y:u}=s.getBoundingClientRect(),c=Ul(r,o);return{x:c.x+a,y:c.y+u}}}),[])};function Om(t,r){const o=[],s=new Map,a=[];for(const u of t)if(u.type==="add"){a.push(u);continue}else if(u.type==="remove"||u.type==="replace")s.set(u.id,[u]);else{const c=s.get(u.id);c?c.push(u):s.set(u.id,[u])}for(const u of r){const c=s.get(u.id);if(!c){o.push(u);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){o.push({...c[0].item});continue}const h={...u};for(const m of c)kS(m,h);o.push(h)}return a.length&&a.forEach(u=>{u.index!==void 0?o.splice(u.index,0,{...u.item}):o.push({...u.item})}),o}function kS(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 Fm(t,r){return Om(t,r)}function Hm(t,r){return Om(t,r)}function po(t,r){return{id:t,type:"select",selected:r}}function ri(t,r=new Set,o=!1){const s=[];for(const[a,u]of t){const c=r.has(a);!(u.selected===void 0&&!c)&&u.selected!==c&&(o&&(u.selected=c),s.push(po(u.id,c)))}return s}function Jh({items:t=[],lookup:r}){var a;const o=[],s=new Map(t.map(u=>[u.id,u]));for(const[u,c]of t.entries()){const h=r.get(c.id),m=((a=h==null?void 0:h.internals)==null?void 0:a.userNode)??h;m!==void 0&&m!==c&&o.push({id:c.id,item:c,type:"replace"}),m===void 0&&o.push({item:c,type:"add",index:u})}for(const[u]of r)s.get(u)===void 0&&o.push({id:u,type:"remove"});return o}function ep(t){return{id:t.id,type:"remove"}}const tp=t=>Uw(t),ES=t=>lm(t);function Vm(t){return b.forwardRef(t)}const NS=typeof window<"u"?b.useLayoutEffect:b.useEffect;function np(t){const[r,o]=b.useState(BigInt(0)),[s]=b.useState(()=>CS(()=>o(a=>a+BigInt(1))));return NS(()=>{const a=s.get();a.length&&(t(a),s.reset())},[r]),s}function CS(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:o=>{r.push(o),t()}}}const Bm=b.createContext(null);function _S({children:t}){const r=et(),o=b.useCallback(h=>{const{nodes:m=[],setNodes:y,hasDefaultNodes:x,onNodesChange:g,nodeLookup:v,fitViewQueued:C,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:v});for(const S of E.values())k=S(k);x&&y(N),k.length>0?g==null||g(k):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:I,setNodes:_}=r.getState();S&&_(I)})},[]),s=np(o),a=b.useCallback(h=>{const{edges:m=[],setEdges:y,hasDefaultEdges:x,onEdgesChange:g,edgeLookup:v}=r.getState();let C=m;for(const E of h)C=typeof E=="function"?E(C):E;x?y(C):g&&g(Jh({items:C,lookup:v}))},[]),u=np(a),c=b.useMemo(()=>({nodeQueue:s,edgeQueue:u}),[]);return f.jsx(Bm.Provider,{value:c,children:t})}function jS(){const t=b.useContext(Bm);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const bS=t=>!!t.panZoom;function zc(){const t=SS(),r=et(),o=jS(),s=$e(bS),a=b.useMemo(()=>{const u=g=>r.getState().nodeLookup.get(g),c=g=>{o.nodeQueue.push(g)},h=g=>{o.edgeQueue.push(g)},m=g=>{var S,I;const{nodeLookup:v,nodeOrigin:C}=r.getState(),E=tp(g)?g:v.get(g.id),N=E.parentId?hm(E.position,E.measured,E.parentId,v,C):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 ui(k)},y=(g,v,C={replace:!1})=>{c(E=>E.map(N=>{if(N.id===g){const k=typeof v=="function"?v(N):v;return C.replace&&tp(k)?k:{...N,...k}}return N}))},x=(g,v,C={replace:!1})=>{h(E=>E.map(N=>{if(N.id===g){const k=typeof v=="function"?v(N):v;return C.replace&&ES(k)?k:{...N,...k}}return N}))};return{getNodes:()=>r.getState().nodes.map(g=>({...g})),getNode:g=>{var v;return(v=u(g))==null?void 0:v.internals.userNode},getInternalNode:u,getEdges:()=>{const{edges:g=[]}=r.getState();return g.map(v=>({...v}))},getEdge:g=>r.getState().edgeLookup.get(g),setNodes:c,setEdges:h,addNodes:g=>{const v=Array.isArray(g)?g:[g];o.nodeQueue.push(C=>[...C,...v])},addEdges:g=>{const v=Array.isArray(g)?g:[g];o.edgeQueue.push(C=>[...C,...v])},toObject:()=>{const{nodes:g=[],edges:v=[],transform:C}=r.getState(),[E,N,k]=C;return{nodes:g.map(S=>({...S})),edges:v.map(S=>({...S})),viewport:{x:E,y:N,zoom:k}}},deleteElements:async({nodes:g=[],edges:v=[]})=>{const{nodes:C,edges:E,onNodesDelete:N,onEdgesDelete:k,triggerNodeChanges:S,triggerEdgeChanges:I,onDelete:_,onBeforeDelete:j}=r.getState(),{nodes:O,edges:A}=await Qw({nodesToRemove:g,edgesToRemove:v,nodes:C,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)&&(_==null||_({nodes:O,edges:A})),{deletedNodes:O,deletedEdges:A}},getIntersectingNodes:(g,v=!0,C)=>{const E=jh(g),N=E?g:m(g),k=C!==void 0;return N?(C||r.getState().nodes).filter(S=>{const I=r.getState().nodeLookup.get(S.id);if(I&&!E&&(S.id===g.id||!I.internals.positionAbsolute))return!1;const _=ui(k?S:I),j=cs(_,N);return v&&j>0||j>=_.width*_.height||j>=N.width*N.height}):[]},isNodeIntersecting:(g,v,C=!0)=>{const N=jh(g)?g:m(g);if(!N)return!1;const k=cs(N,v);return C&&k>0||k>=v.width*v.height||k>=N.width*N.height},updateNode:y,updateNodeData:(g,v,C={replace:!1})=>{y(g,E=>{const N=typeof v=="function"?v(E):v;return C.replace?{...E,data:N}:{...E,data:{...E.data,...N}}},C)},updateEdge:x,updateEdgeData:(g,v,C={replace:!1})=>{x(g,E=>{const N=typeof v=="function"?v(E):v;return C.replace?{...E,data:N}:{...E,data:{...E.data,...N}}},C)},getNodesBounds:g=>{const{nodeLookup:v,nodeOrigin:C}=r.getState();return Yw(g,{nodeLookup:v,nodeOrigin:C})},getHandleConnections:({type:g,id:v,nodeId:C})=>{var E;return Array.from(((E=r.getState().connectionLookup.get(`${C}-${g}${v?`-${v}`:""}`))==null?void 0:E.values())??[])},getNodeConnections:({type:g,handleId:v,nodeId:C})=>{var E;return Array.from(((E=r.getState().connectionLookup.get(`${C}${g?v?`-${g}-${v}`:`-${g}`:""}`))==null?void 0:E.values())??[])},fitView:async g=>{const v=r.getState().fitViewResolver??e1();return r.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:v}),o.nodeQueue.push(C=>[...C]),v.promise}}},[]);return b.useMemo(()=>({...a,...t,viewportInitialized:s}),[s])}const rp=t=>t.selected,PS=typeof window<"u"?window:void 0;function MS({deleteKeyCode:t,multiSelectionKeyCode:r}){const o=et(),{deleteElements:s}=zc(),a=fs(t,{actInsideInputWithModifier:!1}),u=fs(r,{target:PS});b.useEffect(()=>{if(a){const{edges:c,nodes:h}=o.getState();s({nodes:h.filter(rp),edges:c.filter(rp)}),o.setState({nodesSelectionActive:!1})}},[a]),b.useEffect(()=>{o.setState({multiSelectionActive:u})},[u])}function IS(t){const r=et();b.useEffect(()=>{const o=()=>{var a,u,c,h;if(!t.current||!(((u=(a=t.current).checkVisibility)==null?void 0:u.call(a))??!0))return!1;const s=bc(t.current);(s.height===0||s.width===0)&&((h=(c=r.getState()).onError)==null||h.call(c,"004",Xn.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 ia={position:"absolute",width:"100%",height:"100%",top:0,left:0},TS=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function RS({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:u=yo.Free,zoomOnDoubleClick:c=!0,panOnDrag:h=!0,defaultViewport:m,translateExtent:y,minZoom:x,maxZoom:g,zoomActivationKeyCode:v,preventScrolling:C=!0,children:E,noWheelClassName:N,noPanClassName:k,onViewportChange:S,isControlledViewport:I,paneClickDistance:_,selectionOnDrag:j}){const O=et(),A=b.useRef(null),{userSelectionActive:H,lib:q,connectionInProgress:J}=$e(TS,Je),ee=fs(v),U=b.useRef();IS(A);const X=b.useCallback(re=>{S==null||S({x:re[0],y:re[1],zoom:re[2]}),I||O.setState({transform:re})},[S,I]);return b.useEffect(()=>{if(A.current){U.current=L1({domNode:A.current,minZoom:x,maxZoom:g,translateExtent:y,viewport:m,onDraggingChange:V=>O.setState({paneDragging:V}),onPanZoomStart:(V,G)=>{const{onViewportChangeStart:R,onMoveStart:z}=O.getState();z==null||z(V,G),R==null||R(G)},onPanZoom:(V,G)=>{const{onViewportChange:R,onMove:z}=O.getState();z==null||z(V,G),R==null||R(G)},onPanZoomEnd:(V,G)=>{const{onViewportChangeEnd:R,onMoveEnd:z}=O.getState();z==null||z(V,G),R==null||R(G)}});const{x:re,y:P,zoom:K}=U.current.getViewport();return O.setState({panZoom:U.current,transform:[re,P,K],domNode:A.current.closest(".react-flow")}),()=>{var V;(V=U.current)==null||V.destroy()}}},[]),b.useEffect(()=>{var re;(re=U.current)==null||re.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:o,panOnScroll:s,panOnScrollSpeed:a,panOnScrollMode:u,zoomOnDoubleClick:c,panOnDrag:h,zoomActivationKeyPressed:ee,preventScrolling:C,noPanClassName:k,userSelectionActive:H,noWheelClassName:N,lib:q,onTransformChange:X,connectionInProgress:J,selectionOnDrag:j,paneClickDistance:_})},[t,r,o,s,a,u,c,h,ee,C,k,H,N,q,X,J,j,_]),f.jsx("div",{className:"react-flow__renderer",ref:A,style:ia,children:E})}const zS=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function AS(){const{userSelectionActive:t,userSelectionRect:r}=$e(zS,Je);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 Ju=(t,r)=>o=>{o.target===r.current&&(t==null||t(o))},LS=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function DS({isSelecting:t,selectionKeyPressed:r,selectionMode:o=as.Full,panOnDrag:s,paneClickDistance:a,selectionOnDrag:u,onSelectionStart:c,onSelectionEnd:h,onPaneClick:m,onPaneContextMenu:y,onPaneScroll:x,onPaneMouseEnter:g,onPaneMouseMove:v,onPaneMouseLeave:C,children:E}){const N=et(),{userSelectionActive:k,elementsSelectable:S,dragging:I,connectionInProgress:_}=$e(LS,Je),j=S&&(t||k),O=b.useRef(null),A=b.useRef(),H=b.useRef(new Set),q=b.useRef(new Set),J=b.useRef(!1),ee=R=>{if(J.current||_){J.current=!1;return}m==null||m(R),N.getState().resetSelectedElements(),N.setState({nodesSelectionActive:!1})},U=R=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){R.preventDefault();return}y==null||y(R)},X=x?R=>x(R):void 0,re=R=>{J.current&&(R.stopPropagation(),J.current=!1)},P=R=>{var de,he;const{domNode:z}=N.getState();if(A.current=z==null?void 0:z.getBoundingClientRect(),!A.current)return;const B=R.target===O.current;if(!B&&!!R.target.closest(".nokey")||!t||!(u&&B||r)||R.button!==0||!R.isPrimary)return;(he=(de=R.target)==null?void 0:de.setPointerCapture)==null||he.call(de,R.pointerId),J.current=!1;const{x:ie,y:oe}=Tn(R.nativeEvent,A.current);N.setState({userSelectionRect:{width:0,height:0,startX:ie,startY:oe,x:ie,y:oe}}),B||(R.stopPropagation(),R.preventDefault())},K=R=>{const{userSelectionRect:z,transform:B,nodeLookup:M,edgeLookup:D,connectionLookup:ie,triggerNodeChanges:oe,triggerEdgeChanges:de,defaultEdgeOptions:he,resetSelectedElements:me}=N.getState();if(!A.current||!z)return;const{x:ne,y:pe}=Tn(R.nativeEvent,A.current),{startX:be,startY:_e}=z;if(!J.current){const Ae=r?0:a;if(Math.hypot(ne-be,pe-_e)<=Ae)return;me(),c==null||c(R)}J.current=!0;const Ce={startX:be,startY:_e,x:ne<be?ne:be,y:pe<_e?pe:_e,width:Math.abs(ne-be),height:Math.abs(pe-_e)},Ee=H.current,ze=q.current;H.current=new Set(_c(M,Ce,B,o===as.Partial,!0).map(Ae=>Ae.id)),q.current=new Set;const He=(he==null?void 0:he.selectable)??!0;for(const Ae of H.current){const Ge=ie.get(Ae);if(Ge)for(const{edgeId:Ct}of Ge.values()){const ft=D.get(Ct);ft&&(ft.selectable??He)&&q.current.add(Ct)}}if(!bh(Ee,H.current)){const Ae=ri(M,H.current,!0);oe(Ae)}if(!bh(ze,q.current)){const Ae=ri(D,q.current);de(Ae)}N.setState({userSelectionRect:Ce,userSelectionActive:!0,nodesSelectionActive:!1})},V=R=>{var z,B;R.button===0&&((B=(z=R.target)==null?void 0:z.releasePointerCapture)==null||B.call(z,R.pointerId),!k&&R.target===O.current&&N.getState().userSelectionRect&&(ee==null||ee(R)),N.setState({userSelectionActive:!1,userSelectionRect:null}),J.current&&(h==null||h(R),N.setState({nodesSelectionActive:H.current.size>0})))},G=s===!0||Array.isArray(s)&&s.includes(0);return f.jsxs("div",{className:at(["react-flow__pane",{draggable:G,dragging:I,selection:t}]),onClick:j?void 0:Ju(ee,O),onContextMenu:Ju(U,O),onWheel:Ju(X,O),onPointerEnter:j?void 0:g,onPointerMove:j?K:v,onPointerUp:j?V:void 0,onPointerDownCapture:j?P:void 0,onClickCapture:j?re:void 0,onPointerLeave:C,ref:O,style:ia,children:[E,f.jsx(AS,{})]})}function mc({id:t,store:r,unselect:o=!1,nodeRef:s}){const{addSelectedNodes:a,unselectNodesAndEdges:u,multiSelectionActive:c,nodeLookup:h,onError:m}=r.getState(),y=h.get(t);if(!y){m==null||m("012",Xn.error012(t));return}r.setState({nodesSelectionActive:!1}),y.selected?(o||y.selected&&c)&&(u({nodes:[y],edges:[]}),requestAnimationFrame(()=>{var x;return(x=s==null?void 0:s.current)==null?void 0:x.blur()})):a([t])}function Wm({nodeRef:t,disabled:r=!1,noDragClassName:o,handleSelector:s,nodeId:a,isSelectable:u,nodeClickDistance:c}){const h=et(),[m,y]=b.useState(!1),x=b.useRef();return b.useEffect(()=>{x.current=k1({getStoreItems:()=>h.getState(),onNodeMouseDown:g=>{mc({id:g,store:h,nodeRef:t})},onDragStart:()=>{y(!0)},onDragStop:()=>{y(!1)}})},[]),b.useEffect(()=>{var g,v;if(r)(g=x.current)==null||g.destroy();else if(t.current)return(v=x.current)==null||v.update({noDragClassName:o,handleSelector:s,domNode:t.current,isSelectable:u,nodeId:a,nodeClickDistance:c}),()=>{var C;(C=x.current)==null||C.destroy()}},[o,s,r,u,t,a]),m}const $S=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Um(){const t=et();return b.useCallback(o=>{const{nodeExtent:s,snapToGrid:a,snapGrid:u,nodesDraggable:c,onError:h,updateNodePositions:m,nodeLookup:y,nodeOrigin:x}=t.getState(),g=new Map,v=$S(c),C=a?u[0]:5,E=a?u[1]:5,N=o.direction.x*C*o.factor,k=o.direction.y*E*o.factor;for(const[,S]of y){if(!v(S))continue;let I={x:S.internals.positionAbsolute.x+N,y:S.internals.positionAbsolute.y+k};a&&(I=vs(I,u));const{position:_,positionAbsolute:j}=am({nodeId:S.id,nextPosition:I,nodeLookup:y,nodeExtent:s,nodeOrigin:x,onError:h});S.position=_,S.internals.positionAbsolute=j,g.set(S.id,S)}m(g)},[])}const Ac=b.createContext(null),OS=Ac.Provider;Ac.Consumer;const Ym=()=>b.useContext(Ac),FS=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),HS=(t,r,o)=>s=>{const{connectionClickStartHandle:a,connectionMode:u,connection:c}=s,{fromHandle:h,toHandle:m,isValid:y}=c,x=(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:x,clickConnecting:(a==null?void 0:a.nodeId)===t&&(a==null?void 0:a.id)===r&&(a==null?void 0:a.type)===o,isPossibleEndHandle:u===wo.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:x&&y}};function VS({type:t="source",position:r=Ne.Top,isValidConnection:o,isConnectable:s=!0,isConnectableStart:a=!0,isConnectableEnd:u=!0,id:c,onConnect:h,children:m,className:y,onMouseDown:x,onTouchStart:g,...v},C){var K,V;const E=c||null,N=t==="target",k=et(),S=Ym(),{connectOnClick:I,noPanClassName:_,rfId:j}=$e(FS,Je),{connectingFrom:O,connectingTo:A,clickConnecting:H,isPossibleEndHandle:q,connectionInProcess:J,clickConnectionInProcess:ee,valid:U}=$e(HS(S,E,t),Je);S||(V=(K=k.getState()).onError)==null||V.call(K,"010",Xn.error010());const X=G=>{const{defaultEdgeOptions:R,onConnect:z,hasDefaultEdges:B}=k.getState(),M={...R,...G};if(B){const{edges:D,setEdges:ie}=k.getState();ie(Sm(M,D))}z==null||z(M),h==null||h(M)},re=G=>{if(!S)return;const R=gm(G.nativeEvent);if(a&&(R&&G.button===0||!R)){const z=k.getState();pc.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:z.autoPanOnConnect,connectionMode:z.connectionMode,connectionRadius:z.connectionRadius,domNode:z.domNode,nodeLookup:z.nodeLookup,lib:z.lib,isTarget:N,handleId:E,nodeId:S,flowId:z.rfId,panBy:z.panBy,cancelConnection:z.cancelConnection,onConnectStart:z.onConnectStart,onConnectEnd:z.onConnectEnd,updateConnection:z.updateConnection,onConnect:X,isValidConnection:o||z.isValidConnection,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:z.autoPanSpeed,dragThreshold:z.connectionDragThreshold})}R?x==null||x(G):g==null||g(G)},P=G=>{const{onClickConnectStart:R,onClickConnectEnd:z,connectionClickStartHandle:B,connectionMode:M,isValidConnection:D,lib:ie,rfId:oe,nodeLookup:de,connection:he}=k.getState();if(!S||!B&&!a)return;if(!B){R==null||R(G.nativeEvent,{nodeId:S,handleId:E,handleType:t}),k.setState({connectionClickStartHandle:{nodeId:S,type:t,id:E}});return}const me=pm(G.target),ne=o||D,{connection:pe,isValid:be}=pc.isValid(G.nativeEvent,{handle:{nodeId:S,id:E,type:t},connectionMode:M,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:ne,flowId:oe,doc:me,lib:ie,nodeLookup:de});be&&pe&&X(pe);const _e=structuredClone(he);delete _e.inProgress,_e.toPosition=_e.toHandle?_e.toHandle.position:null,z==null||z(G,_e),k.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":E,"data-nodeid":S,"data-handlepos":r,"data-id":`${j}-${S}-${E}-${t}`,className:at(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",_,y,{source:!N,target:N,connectable:s,connectablestart:a,connectableend:u,clickconnecting:H,connectingfrom:O,connectingto:A,valid:U,connectionindicator:s&&(!J||q)&&(J||ee?u:a)}]),onMouseDown:re,onTouchStart:re,onClick:I?P:void 0,ref:C,...v,children:m})}const Hr=b.memo(Vm(VS));function BS({data:t,isConnectable:r,sourcePosition:o=Ne.Bottom}){return f.jsxs(f.Fragment,{children:[t==null?void 0:t.label,f.jsx(Hr,{type:"source",position:o,isConnectable:r})]})}function WS({data:t,isConnectable:r,targetPosition:o=Ne.Top,sourcePosition:s=Ne.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 US(){return null}function YS({data:t,isConnectable:r,targetPosition:o=Ne.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Hr,{type:"target",position:o,isConnectable:r}),t==null?void 0:t.label]})}const Yl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},op={input:BS,default:WS,output:YS,group:US};function XS(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 GS=t=>{const{width:r,height:o,x:s,y:a}=ys(t.nodeLookup,{filter:u=>!!u.selected});return{width:In(r)?r:null,height:In(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 KS({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:o}){const s=et(),{width:a,height:u,transformString:c,userSelectionActive:h}=$e(GS,Je),m=Um(),y=b.useRef(null);if(b.useEffect(()=>{var v;o||(v=y.current)==null||v.focus({preventScroll:!0})},[o]),Wm({nodeRef:y}),h||!a||!u)return null;const x=t?v=>{const C=s.getState().nodes.filter(E=>E.selected);t(v,C)}:void 0,g=v=>{Object.prototype.hasOwnProperty.call(Yl,v.key)&&(v.preventDefault(),m({direction:Yl[v.key],factor:v.shiftKey?4:1}))};return f.jsx("div",{className:at(["react-flow__nodesselection","react-flow__container",r]),style:{transform:c},children:f.jsx("div",{ref:y,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:o?void 0:-1,onKeyDown:o?void 0:g,style:{width:a,height:u}})})}const ip=typeof window<"u"?window:void 0,QS=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Xm({children:t,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:u,onPaneScroll:c,paneClickDistance:h,deleteKeyCode:m,selectionKeyCode:y,selectionOnDrag:x,selectionMode:g,onSelectionStart:v,onSelectionEnd:C,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:k,elementsSelectable:S,zoomOnScroll:I,zoomOnPinch:_,panOnScroll:j,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:q,defaultViewport:J,translateExtent:ee,minZoom:U,maxZoom:X,preventScrolling:re,onSelectionContextMenu:P,noWheelClassName:K,noPanClassName:V,disableKeyboardA11y:G,onViewportChange:R,isControlledViewport:z}){const{nodesSelectionActive:B,userSelectionActive:M}=$e(QS,Je),D=fs(y,{target:ip}),ie=fs(N,{target:ip}),oe=ie||q,de=ie||j,he=x&&oe!==!0,me=D||M||he;return MS({deleteKeyCode:m,multiSelectionKeyCode:E}),f.jsx(RS,{onPaneContextMenu:u,elementsSelectable:S,zoomOnScroll:I,zoomOnPinch:_,panOnScroll:de,panOnScrollSpeed:O,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:!D&&oe,defaultViewport:J,translateExtent:ee,minZoom:U,maxZoom:X,zoomActivationKeyCode:k,preventScrolling:re,noWheelClassName:K,noPanClassName:V,onViewportChange:R,isControlledViewport:z,paneClickDistance:h,selectionOnDrag:he,children:f.jsxs(DS,{onSelectionStart:v,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:oe,isSelecting:!!me,selectionMode:g,selectionKeyPressed:D,paneClickDistance:h,selectionOnDrag:he,children:[t,B&&f.jsx(KS,{onSelectionContextMenu:P,noPanClassName:V,disableKeyboardA11y:G})]})})}Xm.displayName="FlowRenderer";const qS=b.memo(Xm),ZS=t=>r=>t?_c(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 JS(t){return $e(b.useCallback(ZS(t),[t]),Je)}const ek=t=>t.updateNodeInternals;function tk(){const t=$e(ek),[r]=b.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const s=new Map;o.forEach(a=>{const u=a.target.getAttribute("data-id");s.set(u,{id:u,nodeElement:a.target,force:!0})}),t(s)}));return b.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function nk({node:t,nodeType:r,hasDimensions:o,resizeObserver:s}){const a=et(),u=b.useRef(null),c=b.useRef(null),h=b.useRef(t.sourcePosition),m=b.useRef(t.targetPosition),y=b.useRef(r),x=o&&!!t.internals.handleBounds;return b.useEffect(()=>{u.current&&!t.hidden&&(!x||c.current!==u.current)&&(c.current&&(s==null||s.unobserve(c.current)),s==null||s.observe(u.current),c.current=u.current)},[x,t.hidden]),b.useEffect(()=>()=>{c.current&&(s==null||s.unobserve(c.current),c.current=null)},[]),b.useEffect(()=>{if(u.current){const g=y.current!==r,v=h.current!==t.sourcePosition,C=m.current!==t.targetPosition;(g||v||C)&&(y.current=r,h.current=t.sourcePosition,m.current=t.targetPosition,a.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:u.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),u}function rk({id:t,onClick:r,onMouseEnter:o,onMouseMove:s,onMouseLeave:a,onContextMenu:u,onDoubleClick:c,nodesDraggable:h,elementsSelectable:m,nodesConnectable:y,nodesFocusable:x,resizeObserver:g,noDragClassName:v,noPanClassName:C,disableKeyboardA11y:E,rfId:N,nodeTypes:k,nodeClickDistance:S,onError:I}){const{node:_,internals:j,isParent:O}=$e(ne=>{const pe=ne.nodeLookup.get(t),be=ne.parentLookup.has(t);return{node:pe,internals:pe.internals,isParent:be}},Je);let A=_.type||"default",H=(k==null?void 0:k[A])||op[A];H===void 0&&(I==null||I("003",Xn.error003(A)),A="default",H=(k==null?void 0:k.default)||op.default);const q=!!(_.draggable||h&&typeof _.draggable>"u"),J=!!(_.selectable||m&&typeof _.selectable>"u"),ee=!!(_.connectable||y&&typeof _.connectable>"u"),U=!!(_.focusable||x&&typeof _.focusable>"u"),X=et(),re=fm(_),P=nk({node:_,nodeType:A,hasDimensions:re,resizeObserver:g}),K=Wm({nodeRef:P,disabled:_.hidden||!q,noDragClassName:v,handleSelector:_.dragHandle,nodeId:t,isSelectable:J,nodeClickDistance:S}),V=Um();if(_.hidden)return null;const G=hr(_),R=XS(_),z=J||q||r||o||s||a,B=o?ne=>o(ne,{...j.userNode}):void 0,M=s?ne=>s(ne,{...j.userNode}):void 0,D=a?ne=>a(ne,{...j.userNode}):void 0,ie=u?ne=>u(ne,{...j.userNode}):void 0,oe=c?ne=>c(ne,{...j.userNode}):void 0,de=ne=>{const{selectNodesOnDrag:pe,nodeDragThreshold:be}=X.getState();J&&(!pe||!q||be>0)&&mc({id:t,store:X,nodeRef:P}),r&&r(ne,{...j.userNode})},he=ne=>{if(!(mm(ne.nativeEvent)||E)){if(rm.includes(ne.key)&&J){const pe=ne.key==="Escape";mc({id:t,store:X,unselect:pe,nodeRef:P})}else if(q&&_.selected&&Object.prototype.hasOwnProperty.call(Yl,ne.key)){ne.preventDefault();const{ariaLabelConfig:pe}=X.getState();X.setState({ariaLiveMessage:pe["node.a11yDescription.ariaLiveMessage"]({direction:ne.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),V({direction:Yl[ne.key],factor:ne.shiftKey?4:1})}}},me=()=>{var ze;if(E||!((ze=P.current)!=null&&ze.matches(":focus-visible")))return;const{transform:ne,width:pe,height:be,autoPanOnNodeFocus:_e,setCenter:Ce}=X.getState();if(!_e)return;_c(new Map([[t,_]]),{x:0,y:0,width:pe,height:be},ne,!0).length>0||Ce(_.position.x+G.width/2,_.position.y+G.height/2,{zoom:ne[2]})};return f.jsx("div",{className:at(["react-flow__node",`react-flow__node-${A}`,{[C]:q},_.className,{selected:_.selected,selectable:J,parent:O,draggable:q,dragging:K}]),ref:P,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:z?"all":"none",visibility:re?"visible":"hidden",..._.style,...R},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:B,onMouseMove:M,onMouseLeave:D,onContextMenu:ie,onClick:de,onDoubleClick:oe,onKeyDown:U?he:void 0,tabIndex:U?0:void 0,onFocus:U?me:void 0,role:_.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${Lm}-${N}`,"aria-label":_.ariaLabel,..._.domAttributes,children:f.jsx(OS,{value:t,children:f.jsx(H,{id:t,data:_.data,type:A,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:_.selected??!1,selectable:J,draggable:q,deletable:_.deletable??!0,isConnectable:ee,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:K,dragHandle:_.dragHandle,zIndex:j.z,parentId:_.parentId,...G})})})}var ok=b.memo(rk);const ik=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Gm(t){const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:s,elementsSelectable:a,onError:u}=$e(ik,Je),c=JS(t.onlyRenderVisibleElements),h=tk();return f.jsx("div",{className:"react-flow__nodes",style:ia,children:c.map(m=>f.jsx(ok,{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:u},m))})}Gm.displayName="NodeRenderer";const sk=b.memo(Gm);function lk(t){return $e(b.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 u=o.nodeLookup.get(a.source),c=o.nodeLookup.get(a.target);u&&c&&o1({sourceNode:u,targetNode:c,width:o.width,height:o.height,transform:o.transform})&&s.push(a.id)}return s},[t]),Je)}const ak=({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"})},uk=({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={[us.Arrow]:ak,[us.ArrowClosed]:uk};function ck(t){const r=et();return b.useMemo(()=>{var a,u;return Object.prototype.hasOwnProperty.call(sp,t)?sp[t]:((u=(a=r.getState()).onError)==null||u.call(a,"009",Xn.error009(t)),null)},[t])}const dk=({id:t,type:r,color:o,width:s=12.5,height:a=12.5,markerUnits:u="strokeWidth",strokeWidth:c,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:u,orient:h,refX:"0",refY:"0",children:f.jsx(m,{color:o,strokeWidth:c})}):null},Km=({defaultColor:t,rfId:r})=>{const o=$e(u=>u.edges),s=$e(u=>u.defaultEdgeOptions),a=b.useMemo(()=>d1(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(u=>f.jsx(dk,{id:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,strokeWidth:u.strokeWidth,orient:u.orient},u.id))})}):null};Km.displayName="MarkerDefinitions";var fk=b.memo(Km);function Qm({x:t,y:r,label:o,labelStyle:s,labelShowBg:a=!0,labelBgStyle:u,labelBgPadding:c=[2,4],labelBgBorderRadius:h=2,children:m,className:y,...x}){const[g,v]=b.useState({x:1,y:0,width:0,height:0}),C=at(["react-flow__edge-textwrapper",y]),E=b.useRef(null);return b.useEffect(()=>{if(E.current){const N=E.current.getBBox();v({x:N.x,y:N.y,width:N.width,height:N.height})}},[o]),o?f.jsxs("g",{transform:`translate(${t-g.width/2} ${r-g.height/2})`,className:C,visibility:g.width?"visible":"hidden",...x,children:[a&&f.jsx("rect",{width:g.width+2*c[0],x:-c[0],y:-c[1],height:g.height+2*c[1],className:"react-flow__edge-textbg",style:u,rx:h,ry:h}),f.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:E,style:s,children:o}),m]}):null}Qm.displayName="EdgeText";const hk=b.memo(Qm);function sa({path:t,labelX:r,labelY:o,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:m,interactionWidth:y=20,...x}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...x,d:t,fill:"none",className:at(["react-flow__edge-path",x.className])}),y?f.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:y,className:"react-flow__edge-interaction"}):null,s&&In(r)&&In(o)?f.jsx(hk,{x:r,y:o,label:s,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:h,labelBgBorderRadius:m}):null]})}function lp({pos:t,x1:r,y1:o,x2:s,y2:a}){return t===Ne.Left||t===Ne.Right?[.5*(r+s),o]:[r,.5*(o+a)]}function qm({sourceX:t,sourceY:r,sourcePosition:o=Ne.Bottom,targetX:s,targetY:a,targetPosition:u=Ne.Top}){const[c,h]=lp({pos:o,x1:t,y1:r,x2:s,y2:a}),[m,y]=lp({pos:u,x1:s,y1:a,x2:t,y2:r}),[x,g,v,C]=ym({sourceX:t,sourceY:r,targetX:s,targetY:a,sourceControlX:c,sourceControlY:h,targetControlX:m,targetControlY:y});return[`M${t},${r} C${c},${h} ${m},${y} ${s},${a}`,x,g,v,C]}function Zm(t){return b.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:u,sourcePosition:c,targetPosition:h,label:m,labelStyle:y,labelShowBg:x,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:C,style:E,markerEnd:N,markerStart:k,interactionWidth:S})=>{const[I,_,j]=qm({sourceX:o,sourceY:s,sourcePosition:c,targetX:a,targetY:u,targetPosition:h}),O=t.isInternal?void 0:r;return f.jsx(sa,{id:O,path:I,labelX:_,labelY:j,label:m,labelStyle:y,labelShowBg:x,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:C,style:E,markerEnd:N,markerStart:k,interactionWidth:S})})}const pk=Zm({isInternal:!1}),Jm=Zm({isInternal:!0});pk.displayName="SimpleBezierEdge";Jm.displayName="SimpleBezierEdgeInternal";function eg(t){return b.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:u,label:c,labelStyle:h,labelShowBg:m,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:g,style:v,sourcePosition:C=Ne.Bottom,targetPosition:E=Ne.Top,markerEnd:N,markerStart:k,pathOptions:S,interactionWidth:I})=>{const[_,j,O]=dc({sourceX:o,sourceY:s,sourcePosition:C,targetX:a,targetY:u,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(sa,{id:A,path:_,labelX:j,labelY:O,label:c,labelStyle:h,labelShowBg:m,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:g,style:v,markerEnd:N,markerStart:k,interactionWidth:I})})}const tg=eg({isInternal:!1}),ng=eg({isInternal:!0});tg.displayName="SmoothStepEdge";ng.displayName="SmoothStepEdgeInternal";function rg(t){return b.memo(({id:r,...o})=>{var a;const s=t.isInternal?void 0:r;return f.jsx(tg,{...o,id:s,pathOptions:b.useMemo(()=>{var u;return{borderRadius:0,offset:(u=o.pathOptions)==null?void 0:u.offset}},[(a=o.pathOptions)==null?void 0:a.offset])})})}const mk=rg({isInternal:!1}),og=rg({isInternal:!0});mk.displayName="StepEdge";og.displayName="StepEdgeInternal";function ig(t){return b.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:u,label:c,labelStyle:h,labelShowBg:m,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:g,style:v,markerEnd:C,markerStart:E,interactionWidth:N})=>{const[k,S,I]=km({sourceX:o,sourceY:s,targetX:a,targetY:u}),_=t.isInternal?void 0:r;return f.jsx(sa,{id:_,path:k,labelX:S,labelY:I,label:c,labelStyle:h,labelShowBg:m,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:g,style:v,markerEnd:C,markerStart:E,interactionWidth:N})})}const gk=ig({isInternal:!1}),sg=ig({isInternal:!0});gk.displayName="StraightEdge";sg.displayName="StraightEdgeInternal";function lg(t){return b.memo(({id:r,sourceX:o,sourceY:s,targetX:a,targetY:u,sourcePosition:c=Ne.Bottom,targetPosition:h=Ne.Top,label:m,labelStyle:y,labelShowBg:x,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:C,style:E,markerEnd:N,markerStart:k,pathOptions:S,interactionWidth:I})=>{const[_,j,O]=vm({sourceX:o,sourceY:s,sourcePosition:c,targetX:a,targetY:u,targetPosition:h,curvature:S==null?void 0:S.curvature}),A=t.isInternal?void 0:r;return f.jsx(sa,{id:A,path:_,labelX:j,labelY:O,label:m,labelStyle:y,labelShowBg:x,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:C,style:E,markerEnd:N,markerStart:k,interactionWidth:I})})}const yk=lg({isInternal:!1}),ag=lg({isInternal:!0});yk.displayName="BezierEdge";ag.displayName="BezierEdgeInternal";const ap={default:ag,straight:sg,step:og,smoothstep:ng,simplebezier:Jm},up={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},vk=(t,r,o)=>o===Ne.Left?t-r:o===Ne.Right?t+r:t,xk=(t,r,o)=>o===Ne.Top?t-r:o===Ne.Bottom?t+r:t,cp="react-flow__edgeupdater";function dp({position:t,centerX:r,centerY:o,radius:s=10,onMouseDown:a,onMouseEnter:u,onMouseOut:c,type:h}){return f.jsx("circle",{onMouseDown:a,onMouseEnter:u,onMouseOut:c,className:at([cp,`${cp}-${h}`]),cx:vk(r,s,t),cy:xk(o,s,t),r:s,stroke:"transparent",fill:"transparent"})}function wk({isReconnectable:t,reconnectRadius:r,edge:o,sourceX:s,sourceY:a,targetX:u,targetY:c,sourcePosition:h,targetPosition:m,onReconnect:y,onReconnectStart:x,onReconnectEnd:g,setReconnecting:v,setUpdateHover:C}){const E=et(),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:P,nodeLookup:K,rfId:V,panBy:G,updateConnection:R}=E.getState(),z=O.type==="target",B=(ie,oe)=>{v(!1),g==null||g(ie,o,O.type,oe)},M=ie=>y==null?void 0:y(o,ie),D=(ie,oe)=>{v(!0),x==null||x(j,o,O.type),X==null||X(ie,oe)};pc.onPointerDown(j.nativeEvent,{autoPanOnConnect:A,connectionMode:J,connectionRadius:ee,domNode:H,handleId:O.id,nodeId:O.nodeId,nodeLookup:K,isTarget:z,edgeUpdaterType:O.type,lib:U,flowId:V,cancelConnection:P,panBy:G,isValidConnection:q,onConnect:M,onConnectStart:D,onConnectEnd:re,onReconnectEnd:B,updateConnection:R,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=()=>C(!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:_,type:"source"}),(t===!0||t==="target")&&f.jsx(dp,{position:m,centerX:u,centerY:c,radius:r,onMouseDown:S,onMouseEnter:I,onMouseOut:_,type:"target"})]})}function Sk({id:t,edgesFocusable:r,edgesReconnectable:o,elementsSelectable:s,onClick:a,onDoubleClick:u,onContextMenu:c,onMouseEnter:h,onMouseMove:m,onMouseLeave:y,reconnectRadius:x,onReconnect:g,onReconnectStart:v,onReconnectEnd:C,rfId:E,edgeTypes:N,noPanClassName:k,onError:S,disableKeyboardA11y:I}){let _=$e(Ce=>Ce.edgeLookup.get(t));const j=$e(Ce=>Ce.defaultEdgeOptions);_=j?{...j,..._}:_;let O=_.type||"default",A=(N==null?void 0:N[O])||ap[O];A===void 0&&(S==null||S("011",Xn.error011(O)),O="default",A=(N==null?void 0:N.default)||ap.default);const H=!!(_.focusable||r&&typeof _.focusable>"u"),q=typeof g<"u"&&(_.reconnectable||o&&typeof _.reconnectable>"u"),J=!!(_.selectable||s&&typeof _.selectable>"u"),ee=b.useRef(null),[U,X]=b.useState(!1),[re,P]=b.useState(!1),K=et(),{zIndex:V,sourceX:G,sourceY:R,targetX:z,targetY:B,sourcePosition:M,targetPosition:D}=$e(b.useCallback(Ce=>{const Ee=Ce.nodeLookup.get(_.source),ze=Ce.nodeLookup.get(_.target);if(!Ee||!ze)return{zIndex:_.zIndex,...up};const He=c1({id:t,sourceNode:Ee,targetNode:ze,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:Ce.connectionMode,onError:S});return{zIndex:r1({selected:_.selected,zIndex:_.zIndex,sourceNode:Ee,targetNode:ze,elevateOnSelect:Ce.elevateEdgesOnSelect,zIndexMode:Ce.zIndexMode}),...He||up}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),Je),ie=b.useMemo(()=>_.markerStart?`url('#${fc(_.markerStart,E)}')`:void 0,[_.markerStart,E]),oe=b.useMemo(()=>_.markerEnd?`url('#${fc(_.markerEnd,E)}')`:void 0,[_.markerEnd,E]);if(_.hidden||G===null||R===null||z===null||B===null)return null;const de=Ce=>{var Ae;const{addSelectedEdges:Ee,unselectNodesAndEdges:ze,multiSelectionActive:He}=K.getState();J&&(K.setState({nodesSelectionActive:!1}),_.selected&&He?(ze({nodes:[],edges:[_]}),(Ae=ee.current)==null||Ae.blur()):Ee([t])),a&&a(Ce,_)},he=u?Ce=>{u(Ce,{..._})}:void 0,me=c?Ce=>{c(Ce,{..._})}:void 0,ne=h?Ce=>{h(Ce,{..._})}:void 0,pe=m?Ce=>{m(Ce,{..._})}:void 0,be=y?Ce=>{y(Ce,{..._})}:void 0,_e=Ce=>{var Ee;if(!I&&rm.includes(Ce.key)&&J){const{unselectNodesAndEdges:ze,addSelectedEdges:He}=K.getState();Ce.key==="Escape"?((Ee=ee.current)==null||Ee.blur(),ze({edges:[_]})):He([t])}};return f.jsx("svg",{style:{zIndex:V},children:f.jsxs("g",{className:at(["react-flow__edge",`react-flow__edge-${O}`,_.className,k,{selected:_.selected,animated:_.animated,inactive:!J&&!a,updating:U,selectable:J}]),onClick:de,onDoubleClick:he,onContextMenu:me,onMouseEnter:ne,onMouseMove:pe,onMouseLeave:be,onKeyDown:H?_e:void 0,tabIndex:H?0:void 0,role:_.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":H?`${Dm}-${E}`:void 0,ref:ee,..._.domAttributes,children:[!re&&f.jsx(A,{id:t,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:J,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:G,sourceY:R,targetX:z,targetY:B,sourcePosition:M,targetPosition:D,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:ie,markerEnd:oe,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),q&&f.jsx(wk,{edge:_,isReconnectable:q,reconnectRadius:x,onReconnect:g,onReconnectStart:v,onReconnectEnd:C,sourceX:G,sourceY:R,targetX:z,targetY:B,sourcePosition:M,targetPosition:D,setUpdateHover:X,setReconnecting:P})]})})}var kk=b.memo(Sk);const Ek=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function ug({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:o,edgeTypes:s,noPanClassName:a,onReconnect:u,onEdgeContextMenu:c,onEdgeMouseEnter:h,onEdgeMouseMove:m,onEdgeMouseLeave:y,onEdgeClick:x,reconnectRadius:g,onEdgeDoubleClick:v,onReconnectStart:C,onReconnectEnd:E,disableKeyboardA11y:N}){const{edgesFocusable:k,edgesReconnectable:S,elementsSelectable:I,onError:_}=$e(Ek,Je),j=lk(r);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(fk,{defaultColor:t,rfId:o}),j.map(O=>f.jsx(kk,{id:O,edgesFocusable:k,edgesReconnectable:S,elementsSelectable:I,noPanClassName:a,onReconnect:u,onContextMenu:c,onMouseEnter:h,onMouseMove:m,onMouseLeave:y,onClick:x,reconnectRadius:g,onDoubleClick:v,onReconnectStart:C,onReconnectEnd:E,rfId:o,onError:_,edgeTypes:s,disableKeyboardA11y:N},O))]})}ug.displayName="EdgeRenderer";const Nk=b.memo(ug),Ck=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function _k({children:t}){const r=$e(Ck);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function jk(t){const r=zc(),o=b.useRef(!1);b.useEffect(()=>{!o.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),o.current=!0)},[t,r.viewportInitialized])}const bk=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function Pk(t){const r=$e(bk),o=et();return b.useEffect(()=>{t&&(r==null||r(t),o.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function Mk(t){return t.connection.inProgress?{...t.connection,to:xs(t.connection.to,t.transform)}:{...t.connection}}function Ik(t){return Mk}function Tk(t){const r=Ik();return $e(r,Je)}const Rk=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:u,height:c,isValid:h,inProgress:m}=$e(Rk,Je);return!(u&&a&&m)?null:f.jsx("svg",{style:t,width:u,height:c,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:at(["react-flow__connection",sm(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:u,fromNode:c,fromHandle:h,fromPosition:m,to:y,toNode:x,toHandle:g,toPosition:v,pointer:C}=Tk();if(!a)return;if(o)return f.jsx(o,{connectionLineType:r,connectionLineStyle:t,fromNode:c,fromHandle:h,fromX:u.x,fromY:u.y,toX:y.x,toY:y.y,fromPosition:m,toPosition:v,connectionStatus:sm(s),toNode:x,toHandle:g,pointer:C});let E="";const N={sourceX:u.x,sourceY:u.y,sourcePosition:m,targetX:y.x,targetY:y.y,targetPosition:v};switch(r){case Fr.Bezier:[E]=vm(N);break;case Fr.SimpleBezier:[E]=qm(N);break;case Fr.Step:[E]=dc({...N,borderRadius:0});break;case Fr.SmoothStep:[E]=dc(N);break;default:[E]=km(N)}return f.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:t})};cg.displayName="ConnectionLine";const Ak={};function fp(t=Ak){b.useRef(t),et(),b.useEffect(()=>{},[t])}function Lk(){et(),b.useRef(!1),b.useEffect(()=>{},[])}function dg({nodeTypes:t,edgeTypes:r,onInit:o,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:u,onEdgeDoubleClick:c,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:x,onSelectionContextMenu:g,onSelectionStart:v,onSelectionEnd:C,connectionLineType:E,connectionLineStyle:N,connectionLineComponent:k,connectionLineContainerStyle:S,selectionKeyCode:I,selectionOnDrag:_,selectionMode:j,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:H,deleteKeyCode:q,onlyRenderVisibleElements:J,elementsSelectable:ee,defaultViewport:U,translateExtent:X,minZoom:re,maxZoom:P,preventScrolling:K,defaultMarkerColor:V,zoomOnScroll:G,zoomOnPinch:R,panOnScroll:z,panOnScrollSpeed:B,panOnScrollMode:M,zoomOnDoubleClick:D,panOnDrag:ie,onPaneClick:oe,onPaneMouseEnter:de,onPaneMouseMove:he,onPaneMouseLeave:me,onPaneScroll:ne,onPaneContextMenu:pe,paneClickDistance:be,nodeClickDistance:_e,onEdgeContextMenu:Ce,onEdgeMouseEnter:Ee,onEdgeMouseMove:ze,onEdgeMouseLeave:He,reconnectRadius:Ae,onReconnect:Ge,onReconnectStart:Ct,onReconnectEnd:ft,noDragClassName:yt,noWheelClassName:ht,noPanClassName:hn,disableKeyboardA11y:zn,nodeExtent:vt,rfId:An,viewport:Jt,onViewportChange:pn}){return fp(t),fp(r),Lk(),jk(o),Pk(Jt),f.jsx(qS,{onPaneClick:oe,onPaneMouseEnter:de,onPaneMouseMove:he,onPaneMouseLeave:me,onPaneContextMenu:pe,onPaneScroll:ne,paneClickDistance:be,deleteKeyCode:q,selectionKeyCode:I,selectionOnDrag:_,selectionMode:j,onSelectionStart:v,onSelectionEnd:C,multiSelectionKeyCode:O,panActivationKeyCode:A,zoomActivationKeyCode:H,elementsSelectable:ee,zoomOnScroll:G,zoomOnPinch:R,zoomOnDoubleClick:D,panOnScroll:z,panOnScrollSpeed:B,panOnScrollMode:M,panOnDrag:ie,defaultViewport:U,translateExtent:X,minZoom:re,maxZoom:P,onSelectionContextMenu:g,preventScrolling:K,noDragClassName:yt,noWheelClassName:ht,noPanClassName:hn,disableKeyboardA11y:zn,onViewportChange:pn,isControlledViewport:!!Jt,children:f.jsxs(_k,{children:[f.jsx(Nk,{edgeTypes:r,onEdgeClick:a,onEdgeDoubleClick:c,onReconnect:Ge,onReconnectStart:Ct,onReconnectEnd:ft,onlyRenderVisibleElements:J,onEdgeContextMenu:Ce,onEdgeMouseEnter:Ee,onEdgeMouseMove:ze,onEdgeMouseLeave:He,reconnectRadius:Ae,defaultMarkerColor:V,noPanClassName:hn,disableKeyboardA11y:zn,rfId:An}),f.jsx(zk,{style:N,type:E,component:k,containerStyle:S}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(sk,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:u,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:x,nodeClickDistance:_e,onlyRenderVisibleElements:J,noPanClassName:hn,noDragClassName:yt,disableKeyboardA11y:zn,nodeExtent:vt,rfId:An}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}dg.displayName="GraphView";const Dk=b.memo(dg),hp=({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,width:a,height:u,fitView:c,fitViewOptions:h,minZoom:m=.5,maxZoom:y=2,nodeOrigin:x,nodeExtent:g,zIndexMode:v="basic"}={})=>{const C=new Map,E=new Map,N=new Map,k=new Map,S=s??r??[],I=o??t??[],_=x??[0,0],j=g??ls;Cm(N,k,S);const O=hc(I,C,E,{nodeOrigin:_,nodeExtent:j,zIndexMode:v});let A=[0,0,1];if(c&&a&&u){const H=ys(C,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:q,y:J,zoom:ee}=jc(H,a,u,m,y,(h==null?void 0:h.padding)??.1);A=[q,J,ee]}return{rfId:"1",width:a??0,height:u??0,transform:A,nodes:I,nodesInitialized:O,nodeLookup:C,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:y,translateExtent:ls,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:wo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,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:c??!1,fitViewOptions:h,fitViewResolver:null,connection:{...im},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:om,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},$k=({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,width:a,height:u,fitView:c,fitViewOptions:h,minZoom:m,maxZoom:y,nodeOrigin:x,nodeExtent:g,zIndexMode:v})=>nS((C,E)=>{async function N(){const{nodeLookup:k,panZoom:S,fitViewOptions:I,fitViewResolver:_,width:j,height:O,minZoom:A,maxZoom:H}=E();S&&(await Kw({nodes:k,width:j,height:O,panZoom:S,minZoom:A,maxZoom:H},I),_==null||_.resolve(!0),C({fitViewResolver:null}))}return{...hp({nodes:t,edges:r,width:a,height:u,fitView:c,fitViewOptions:h,minZoom:m,maxZoom:y,nodeOrigin:x,nodeExtent:g,defaultNodes:o,defaultEdges:s,zIndexMode:v}),setNodes:k=>{const{nodeLookup:S,parentLookup:I,nodeOrigin:_,elevateNodesOnSelect:j,fitViewQueued:O,zIndexMode:A}=E(),H=hc(k,S,I,{nodeOrigin:_,nodeExtent:g,elevateNodesOnSelect:j,checkEquality:!0,zIndexMode:A});O&&H?(N(),C({nodes:k,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0})):C({nodes:k,nodesInitialized:H})},setEdges:k=>{const{connectionLookup:S,edgeLookup:I}=E();Cm(S,I,k),C({edges:k})},setDefaultNodesAndEdges:(k,S)=>{if(k){const{setNodes:I}=E();I(k),C({hasDefaultNodes:!0})}if(S){const{setEdges:I}=E();I(S),C({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:S,nodeLookup:I,parentLookup:_,domNode:j,nodeOrigin:O,nodeExtent:A,debug:H,fitViewQueued:q,zIndexMode:J}=E(),{changes:ee,updatedInternals:U}=v1(k,I,_,j,O,A,J);U&&(p1(I,_,{nodeOrigin:O,nodeExtent:A,zIndexMode:J}),q?(N(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(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 _=[];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 P=ko(U,A.fromHandle,Ne.Left,!0);H({...A,from:P})}X&&U.parentId&&I.push({id:J,parentId:U.parentId,rect:{...ee.internals.positionAbsolute,width:ee.measured.width??0,height:ee.measured.height??0}}),_.push(re)}if(I.length>0){const{parentLookup:J,nodeOrigin:ee}=E(),U=Rc(I,j,J,ee);_.push(...U)}for(const J of q.values())_=J(_);O(_)},triggerNodeChanges:k=>{const{onNodesChange:S,setNodes:I,nodes:_,hasDefaultNodes:j,debug:O}=E();if(k!=null&&k.length){if(j){const A=Fm(k,_);I(A)}O&&console.log("React Flow: trigger node changes",k),S==null||S(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:S,setEdges:I,edges:_,hasDefaultEdges:j,debug:O}=E();if(k!=null&&k.length){if(j){const A=Hm(k,_);I(A)}O&&console.log("React Flow: trigger edge changes",k),S==null||S(k)}},addSelectedNodes:k=>{const{multiSelectionActive:S,edgeLookup:I,nodeLookup:_,triggerNodeChanges:j,triggerEdgeChanges:O}=E();if(S){const A=k.map(H=>po(H,!0));j(A);return}j(ri(_,new Set([...k]),!0)),O(ri(I))},addSelectedEdges:k=>{const{multiSelectionActive:S,edgeLookup:I,nodeLookup:_,triggerNodeChanges:j,triggerEdgeChanges:O}=E();if(S){const A=k.map(H=>po(H,!0));O(A);return}O(ri(I,new Set([...k]))),j(ri(_,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:S}={})=>{const{edges:I,nodes:_,nodeLookup:j,triggerNodeChanges:O,triggerEdgeChanges:A}=E(),H=k||_,q=S||I,J=H.map(U=>{const X=j.get(U.id);return X&&(X.selected=!1),po(U.id,!1)}),ee=q.map(U=>po(U.id,!1));O(J),A(ee)},setMinZoom:k=>{const{panZoom:S,maxZoom:I}=E();S==null||S.setScaleExtent([k,I]),C({minZoom:k})},setMaxZoom:k=>{const{panZoom:S,minZoom:I}=E();S==null||S.setScaleExtent([I,k]),C({maxZoom:k})},setTranslateExtent:k=>{var S;(S=E().panZoom)==null||S.setTranslateExtent(k),C({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:S,triggerNodeChanges:I,triggerEdgeChanges:_,elementsSelectable:j}=E();if(!j)return;const O=S.reduce((H,q)=>q.selected?[...H,po(q.id,!1)]:H,[]),A=k.reduce((H,q)=>q.selected?[...H,po(q.id,!1)]:H,[]);I(O),_(A)},setNodeExtent:k=>{const{nodes:S,nodeLookup:I,parentLookup:_,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]||(hc(S,I,_,{nodeOrigin:j,nodeExtent:k,elevateNodesOnSelect:O,checkEquality:!1,zIndexMode:H}),C({nodeExtent:k}))},panBy:k=>{const{transform:S,width:I,height:_,panZoom:j,translateExtent:O}=E();return x1({delta:k,panZoom:j,transform:S,translateExtent:O,width:I,height:_})},setCenter:async(k,S,I)=>{const{width:_,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:_/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:()=>{C({connection:{...im}})},updateConnection:k=>{C({connection:k})},reset:()=>C({...hp()})}},Object.is);function fg({initialNodes:t,initialEdges:r,defaultNodes:o,defaultEdges:s,initialWidth:a,initialHeight:u,initialMinZoom:c,initialMaxZoom:h,initialFitViewOptions:m,fitView:y,nodeOrigin:x,nodeExtent:g,zIndexMode:v,children:C}){const[E]=b.useState(()=>$k({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,width:a,height:u,fitView:y,minZoom:c,maxZoom:h,fitViewOptions:m,nodeOrigin:x,nodeExtent:g,zIndexMode:v}));return f.jsx(rS,{value:E,children:f.jsx(_S,{children:C})})}function Ok({children:t,nodes:r,edges:o,defaultNodes:s,defaultEdges:a,width:u,height:c,fitView:h,fitViewOptions:m,minZoom:y,maxZoom:x,nodeOrigin:g,nodeExtent:v,zIndexMode:C}){return b.useContext(ra)?f.jsx(f.Fragment,{children:t}):f.jsx(fg,{initialNodes:r,initialEdges:o,defaultNodes:s,defaultEdges:a,initialWidth:u,initialHeight:c,fitView:h,initialFitViewOptions:m,initialMinZoom:y,initialMaxZoom:x,nodeOrigin:g,nodeExtent:v,zIndexMode:C,children:t})}const Fk={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Hk({nodes:t,edges:r,defaultNodes:o,defaultEdges:s,className:a,nodeTypes:u,edgeTypes:c,onNodeClick:h,onEdgeClick:m,onInit:y,onMove:x,onMoveStart:g,onMoveEnd:v,onConnect:C,onConnectStart:E,onConnectEnd:N,onClickConnectStart:k,onClickConnectEnd:S,onNodeMouseEnter:I,onNodeMouseMove:_,onNodeMouseLeave:j,onNodeContextMenu:O,onNodeDoubleClick:A,onNodeDragStart:H,onNodeDrag:q,onNodeDragStop:J,onNodesDelete:ee,onEdgesDelete:U,onDelete:X,onSelectionChange:re,onSelectionDragStart:P,onSelectionDrag:K,onSelectionDragStop:V,onSelectionContextMenu:G,onSelectionStart:R,onSelectionEnd:z,onBeforeDelete:B,connectionMode:M,connectionLineType:D=Fr.Bezier,connectionLineStyle:ie,connectionLineComponent:oe,connectionLineContainerStyle:de,deleteKeyCode:he="Backspace",selectionKeyCode:me="Shift",selectionOnDrag:ne=!1,selectionMode:pe=as.Full,panActivationKeyCode:be="Space",multiSelectionKeyCode:_e=ds()?"Meta":"Control",zoomActivationKeyCode:Ce=ds()?"Meta":"Control",snapToGrid:Ee,snapGrid:ze,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:Ae,nodesDraggable:Ge,autoPanOnNodeFocus:Ct,nodesConnectable:ft,nodesFocusable:yt,nodeOrigin:ht=$m,edgesFocusable:hn,edgesReconnectable:zn,elementsSelectable:vt=!0,defaultViewport:An=gS,minZoom:Jt=.5,maxZoom:pn=2,translateExtent:Ln=ls,preventScrolling:Wr=!0,nodeExtent:en,defaultMarkerColor:_t="#b1b1b7",zoomOnScroll:fi=!0,zoomOnPinch:mn=!0,panOnScroll:Vt=!1,panOnScrollSpeed:Ur=.5,panOnScrollMode:pr=yo.Free,zoomOnDoubleClick:tn=!0,panOnDrag:Kn=!0,onPaneClick:Yr,onPaneMouseEnter:Xr,onPaneMouseMove:nn,onPaneMouseLeave:rn,onPaneScroll:on,onPaneContextMenu:No,paneClickDistance:jt=1,nodeClickDistance:Gr=0,children:ut,onReconnect:Kr,onReconnectStart:Qr,onReconnectEnd:It,onEdgeContextMenu:gn,onEdgeDoubleClick:Dn,onEdgeMouseEnter:Qn,onEdgeMouseMove:yn,onEdgeMouseLeave:mr,reconnectRadius:vn=10,onNodesChange:tt,onEdgesChange:hi,noDragClassName:qn="nodrag",noWheelClassName:Co="nowheel",noPanClassName:Bt="nopan",fitView:Tt,fitViewOptions:xn,connectOnClick:pi,attributionPosition:_o,proOptions:jo,defaultEdgeOptions:bo,elevateNodesOnSelect:Po=!0,elevateEdgesOnSelect:mi=!1,disableKeyboardA11y:qr=!1,autoPanOnConnect:Ue,autoPanOnNodeDrag:Zr,autoPanSpeed:gr,connectionRadius:$n,isValidConnection:yr,onError:gi,style:Zn,id:We,nodeDragThreshold:Rt,connectionDragThreshold:yi,viewport:bt,onViewportChange:vi,width:xi,height:wi,colorMode:vr="light",debug:On,onScroll:sn,ariaLabelConfig:Jn,zIndexMode:Jr="basic",...Si},xr){const er=We||"1",wr=wS(vr),Wt=b.useCallback(Sr=>{Sr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),sn==null||sn(Sr)},[sn]);return f.jsx("div",{"data-testid":"rf__wrapper",...Si,onScroll:Wt,style:{...Zn,...Fk},ref:xr,className:at(["react-flow",a,wr]),id:We,role:"application",children:f.jsxs(Ok,{nodes:t,edges:r,width:xi,height:wi,fitView:Tt,fitViewOptions:xn,minZoom:Jt,maxZoom:pn,nodeOrigin:ht,nodeExtent:en,zIndexMode:Jr,children:[f.jsx(Dk,{onInit:y,onNodeClick:h,onEdgeClick:m,onNodeMouseEnter:I,onNodeMouseMove:_,onNodeMouseLeave:j,onNodeContextMenu:O,onNodeDoubleClick:A,nodeTypes:u,edgeTypes:c,connectionLineType:D,connectionLineStyle:ie,connectionLineComponent:oe,connectionLineContainerStyle:de,selectionKeyCode:me,selectionOnDrag:ne,selectionMode:pe,deleteKeyCode:he,multiSelectionKeyCode:_e,panActivationKeyCode:be,zoomActivationKeyCode:Ce,onlyRenderVisibleElements:He,defaultViewport:An,translateExtent:Ln,minZoom:Jt,maxZoom:pn,preventScrolling:Wr,zoomOnScroll:fi,zoomOnPinch:mn,zoomOnDoubleClick:tn,panOnScroll:Vt,panOnScrollSpeed:Ur,panOnScrollMode:pr,panOnDrag:Kn,onPaneClick:Yr,onPaneMouseEnter:Xr,onPaneMouseMove:nn,onPaneMouseLeave:rn,onPaneScroll:on,onPaneContextMenu:No,paneClickDistance:jt,nodeClickDistance:Gr,onSelectionContextMenu:G,onSelectionStart:R,onSelectionEnd:z,onReconnect:Kr,onReconnectStart:Qr,onReconnectEnd:It,onEdgeContextMenu:gn,onEdgeDoubleClick:Dn,onEdgeMouseEnter:Qn,onEdgeMouseMove:yn,onEdgeMouseLeave:mr,reconnectRadius:vn,defaultMarkerColor:_t,noDragClassName:qn,noWheelClassName:Co,noPanClassName:Bt,rfId:er,disableKeyboardA11y:qr,nodeExtent:en,viewport:bt,onViewportChange:vi}),f.jsx(xS,{nodes:t,edges:r,defaultNodes:o,defaultEdges:s,onConnect:C,onConnectStart:E,onConnectEnd:N,onClickConnectStart:k,onClickConnectEnd:S,nodesDraggable:Ge,autoPanOnNodeFocus:Ct,nodesConnectable:ft,nodesFocusable:yt,edgesFocusable:hn,edgesReconnectable:zn,elementsSelectable:vt,elevateNodesOnSelect:Po,elevateEdgesOnSelect:mi,minZoom:Jt,maxZoom:pn,nodeExtent:en,onNodesChange:tt,onEdgesChange:hi,snapToGrid:Ee,snapGrid:ze,connectionMode:M,translateExtent:Ln,connectOnClick:pi,defaultEdgeOptions:bo,fitView:Tt,fitViewOptions:xn,onNodesDelete:ee,onEdgesDelete:U,onDelete:X,onNodeDragStart:H,onNodeDrag:q,onNodeDragStop:J,onSelectionDrag:K,onSelectionDragStart:P,onSelectionDragStop:V,onMove:x,onMoveStart:g,onMoveEnd:v,noPanClassName:Bt,nodeOrigin:ht,rfId:er,autoPanOnConnect:Ue,autoPanOnNodeDrag:Zr,autoPanSpeed:gr,onError:gi,connectionRadius:$n,isValidConnection:yr,selectNodesOnDrag:Ae,nodeDragThreshold:Rt,connectionDragThreshold:yi,onBeforeDelete:B,debug:On,ariaLabelConfig:Jn,zIndexMode:Jr}),f.jsx(mS,{onSelectionChange:re}),ut,f.jsx(cS,{proOptions:jo,position:_o}),f.jsx(uS,{rfId:er,disableKeyboardA11y:qr})]})})}var hg=Vm(Hk);function Vk(t){const[r,o]=b.useState(t),s=b.useCallback(a=>o(u=>Fm(a,u)),[]);return[r,o,s]}function Bk(t){const[r,o]=b.useState(t),s=b.useCallback(a=>o(u=>Hm(a,u)),[]);return[r,o,s]}function Wk({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:at(["react-flow__background-pattern",o,s])})}function Uk({radius:t,className:r}){return f.jsx("circle",{cx:t,cy:t,r:t,className:at(["react-flow__background-pattern","dots",r])})}var Yn;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Yn||(Yn={}));const Yk={[Yn.Dots]:1,[Yn.Lines]:1,[Yn.Cross]:6},Xk=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function pg({id:t,variant:r=Yn.Dots,gap:o=20,size:s,lineWidth:a=1,offset:u=0,color:c,bgColor:h,style:m,className:y,patternClassName:x}){const g=b.useRef(null),{transform:v,patternId:C}=$e(Xk,Je),E=s||Yk[r],N=r===Yn.Dots,k=r===Yn.Cross,S=Array.isArray(o)?o:[o,o],I=[S[0]*v[2]||1,S[1]*v[2]||1],_=E*v[2],j=Array.isArray(u)?u:[u,u],O=k?[_,_]:I,A=[j[0]*v[2]||1+O[0]/2,j[1]*v[2]||1+O[1]/2],H=`${C}${t||""}`;return f.jsxs("svg",{className:at(["react-flow__background",y]),style:{...m,...ia,"--xy-background-color-props":h,"--xy-background-pattern-color-props":c},ref:g,"data-testid":"rf__background",children:[f.jsx("pattern",{id:H,x:v[0]%I[0],y:v[1]%I[1],width:I[0],height:I[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${A[0]},-${A[1]})`,children:N?f.jsx(Uk,{radius:_/2,className:x}):f.jsx(Wk,{dimensions:O,lineWidth:a,variant:r,className:x})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}pg.displayName="Background";const mg=b.memo(pg);function Gk(){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 Kk(){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 Qk(){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 Zk(){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 Il({children:t,className:r,...o}){return f.jsx("button",{type:"button",className:at(["react-flow__controls-button",r]),...o,children:t})}const Jk=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function gg({style:t,showZoom:r=!0,showFitView:o=!0,showInteractive:s=!0,fitViewOptions:a,onZoomIn:u,onZoomOut:c,onFitView:h,onInteractiveChange:m,className:y,children:x,position:g="bottom-left",orientation:v="vertical","aria-label":C}){const E=et(),{isInteractive:N,minZoomReached:k,maxZoomReached:S,ariaLabelConfig:I}=$e(Jk,Je),{zoomIn:_,zoomOut:j,fitView:O}=zc(),A=()=>{_(),u==null||u()},H=()=>{j(),c==null||c()},q=()=>{O(a),h==null||h()},J=()=>{E.setState({nodesDraggable:!N,nodesConnectable:!N,elementsSelectable:!N}),m==null||m(!N)},ee=v==="horizontal"?"horizontal":"vertical";return f.jsxs(oa,{className:at(["react-flow__controls",ee,y]),position:g,style:t,"data-testid":"rf__controls","aria-label":C??I["controls.ariaLabel"],children:[r&&f.jsxs(f.Fragment,{children:[f.jsx(Il,{onClick:A,className:"react-flow__controls-zoomin",title:I["controls.zoomIn.ariaLabel"],"aria-label":I["controls.zoomIn.ariaLabel"],disabled:S,children:f.jsx(Gk,{})}),f.jsx(Il,{onClick:H,className:"react-flow__controls-zoomout",title:I["controls.zoomOut.ariaLabel"],"aria-label":I["controls.zoomOut.ariaLabel"],disabled:k,children:f.jsx(Kk,{})})]}),o&&f.jsx(Il,{className:"react-flow__controls-fitview",onClick:q,title:I["controls.fitView.ariaLabel"],"aria-label":I["controls.fitView.ariaLabel"],children:f.jsx(Qk,{})}),s&&f.jsx(Il,{className:"react-flow__controls-interactive",onClick:J,title:I["controls.interactive.ariaLabel"],"aria-label":I["controls.interactive.ariaLabel"],children:N?f.jsx(Zk,{}):f.jsx(qk,{})}),x]})}gg.displayName="Controls";const yg=b.memo(gg);function eE({id:t,x:r,y:o,width:s,height:a,style:u,color:c,strokeColor:h,strokeWidth:m,className:y,borderRadius:x,shapeRendering:g,selected:v,onClick:C}){const{background:E,backgroundColor:N}=u||{},k=c||E||N;return f.jsx("rect",{className:at(["react-flow__minimap-node",{selected:v},y]),x:r,y:o,rx:x,ry:x,width:s,height:a,style:{fill:k,stroke:h,strokeWidth:m},shapeRendering:g,onClick:C?S=>C(S,t):void 0})}const tE=b.memo(eE),nE=t=>t.nodes.map(r=>r.id),ec=t=>t instanceof Function?t:()=>t;function rE({nodeStrokeColor:t,nodeColor:r,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:u=tE,onClick:c}){const h=$e(nE,Je),m=ec(r),y=ec(t),x=ec(o),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:h.map(v=>f.jsx(iE,{id:v,nodeColorFunc:m,nodeStrokeColorFunc:y,nodeClassNameFunc:x,nodeBorderRadius:s,nodeStrokeWidth:a,NodeComponent:u,onClick:c,shapeRendering:g},v))})}function oE({id:t,nodeColorFunc:r,nodeStrokeColorFunc:o,nodeClassNameFunc:s,nodeBorderRadius:a,nodeStrokeWidth:u,shapeRendering:c,NodeComponent:h,onClick:m}){const{node:y,x,y:g,width:v,height:C}=$e(E=>{const{internals:N}=E.nodeLookup.get(t),k=N.userNode,{x:S,y:I}=N.positionAbsolute,{width:_,height:j}=hr(k);return{node:k,x:S,y:I,width:_,height:j}},Je);return!y||y.hidden||!fm(y)?null:f.jsx(h,{x,y:g,width:v,height:C,style:y.style,selected:!!y.selected,className:s(y),color:r(y),borderRadius:a,strokeColor:o(y),strokeWidth:u,shapeRendering:c,onClick:m,id:y.id})}const iE=b.memo(oE);var sE=b.memo(rE);const lE=200,aE=150,uE=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?dm(ys(t.nodeLookup,{filter:uE}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},dE="react-flow__minimap-desc";function vg({style:t,className:r,nodeStrokeColor:o,nodeColor:s,nodeClassName:a="",nodeBorderRadius:u=5,nodeStrokeWidth:c,nodeComponent:h,bgColor:m,maskColor:y,maskStrokeColor:x,maskStrokeWidth:g,position:v="bottom-right",onClick:C,onNodeClick:E,pannable:N=!1,zoomable:k=!1,ariaLabel:S,inversePan:I,zoomStep:_=1,offsetScale:j=5}){const O=et(),A=b.useRef(null),{boundingRect:H,viewBB:q,rfId:J,panZoom:ee,translateExtent:U,flowWidth:X,flowHeight:re,ariaLabelConfig:P}=$e(cE,Je),K=(t==null?void 0:t.width)??lE,V=(t==null?void 0:t.height)??aE,G=H.width/K,R=H.height/V,z=Math.max(G,R),B=z*K,M=z*V,D=j*z,ie=H.x-(B-H.width)/2-D,oe=H.y-(M-H.height)/2-D,de=B+D*2,he=M+D*2,me=`${dE}-${J}`,ne=b.useRef(0),pe=b.useRef();ne.current=z,b.useEffect(()=>{if(A.current&&ee)return pe.current=b1({domNode:A.current,panZoom:ee,getTransform:()=>O.getState().transform,getViewScale:()=>ne.current}),()=>{var Ee;(Ee=pe.current)==null||Ee.destroy()}},[ee]),b.useEffect(()=>{var Ee;(Ee=pe.current)==null||Ee.update({translateExtent:U,width:X,height:re,inversePan:I,pannable:N,zoomStep:_,zoomable:k})},[N,k,I,_,U,X,re]);const be=C?Ee=>{var Ae;const[ze,He]=((Ae=pe.current)==null?void 0:Ae.pointer(Ee))||[0,0];C(Ee,{x:ze,y:He})}:void 0,_e=E?b.useCallback((Ee,ze)=>{const He=O.getState().nodeLookup.get(ze).internals.userNode;E(Ee,He)},[]):void 0,Ce=S??P["minimap.ariaLabel"];return f.jsx(oa,{position:v,style:{...t,"--xy-minimap-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-background-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-stroke-color-props":typeof x=="string"?x:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*z: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 c=="number"?c:void 0},className:at(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:K,height:V,viewBox:`${ie} ${oe} ${de} ${he}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":me,ref:A,onClick:be,children:[Ce&&f.jsx("title",{id:me,children:Ce}),f.jsx(sE,{onClick:_e,nodeColor:s,nodeStrokeColor:o,nodeBorderRadius:u,nodeClassName:a,nodeStrokeWidth:c,nodeComponent:h}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${ie-D},${oe-D}h${de+D*2}v${he+D*2}h${-de-D*2}z
|
|
62
|
+
M${q.x},${q.y}h${q.width}v${q.height}h${-q.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}vg.displayName="MiniMap";b.memo(vg);const fE=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,hE={[Eo.Line]:"right",[Eo.Handle]:"bottom-right"};function pE({nodeId:t,position:r,variant:o=Eo.Handle,className:s,style:a=void 0,children:u,color:c,minWidth:h=10,minHeight:m=10,maxWidth:y=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:v,autoScale:C=!0,shouldResize:E,onResizeStart:N,onResize:k,onResizeEnd:S}){const I=Ym(),_=typeof t=="string"?t:I,j=et(),O=b.useRef(null),A=o===Eo.Handle,H=$e(b.useCallback(fE(A&&C),[A,C]),Je),q=b.useRef(null),J=r??hE[o];b.useEffect(()=>{if(!(!O.current||!_))return q.current||(q.current=W1({domNode:O.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:U,transform:X,snapGrid:re,snapToGrid:P,nodeOrigin:K,domNode:V}=j.getState();return{nodeLookup:U,transform:X,snapGrid:re,snapToGrid:P,nodeOrigin:K,paneDomNode:V}},onChange:(U,X)=>{const{triggerNodeChanges:re,nodeLookup:P,parentLookup:K,nodeOrigin:V}=j.getState(),G=[],R={x:U.x,y:U.y},z=P.get(_);if(z&&z.expandParent&&z.parentId){const B=z.origin??V,M=U.width??z.measured.width??0,D=U.height??z.measured.height??0,ie={id:z.id,parentId:z.parentId,rect:{width:M,height:D,...hm({x:U.x??z.position.x,y:U.y??z.position.y},{width:M,height:D},z.parentId,P,B)}},oe=Rc([ie],P,K,V);G.push(...oe),R.x=U.x?Math.max(B[0]*M,U.x):void 0,R.y=U.y?Math.max(B[1]*D,U.y):void 0}if(R.x!==void 0&&R.y!==void 0){const B={id:_,type:"position",position:{...R}};G.push(B)}if(U.width!==void 0&&U.height!==void 0){const M={id:_,type:"dimensions",resizing:!0,setAttributes:v?v==="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:_,type:"dimensions",resizing:!1,dimensions:{width:U,height:X}};j.getState().triggerNodeChanges([re])}})),q.current.update({controlPosition:J,boundaries:{minWidth:h,minHeight:m,maxWidth:y,maxHeight:x},keepAspectRatio:g,resizeDirection:v,onResizeStart:N,onResize:k,onResizeEnd:S,shouldResize:E}),()=>{var U;(U=q.current)==null||U.destroy()}},[J,h,m,y,x,g,N,k,S,E]);const ee=J.split("-");return f.jsx("div",{className:at(["react-flow__resize-control","nodrag",...ee,o,s]),ref:O,style:{...a,scale:H,...c&&{[A?"backgroundColor":"borderColor"]:c}},children:u})}const pp=b.memo(pE);function mE({nodeId:t,isVisible:r=!0,handleClassName:o,handleStyle:s,lineClassName:a,lineStyle:u,color:c,minWidth:h=10,minHeight:m=10,maxWidth:y=Number.MAX_VALUE,maxHeight:x=Number.MAX_VALUE,keepAspectRatio:g=!1,autoScale:v=!0,shouldResize:C,onResizeStart:E,onResize:N,onResizeEnd:k}){return r?f.jsxs(f.Fragment,{children:[$1.map(S=>f.jsx(pp,{className:a,style:u,nodeId:t,position:S,variant:Eo.Line,color:c,minWidth:h,minHeight:m,maxWidth:y,maxHeight:x,onResizeStart:E,keepAspectRatio:g,autoScale:v,shouldResize:C,onResize:N,onResizeEnd:k},S)),D1.map(S=>f.jsx(pp,{className:o,style:s,nodeId:t,position:S,color:c,minWidth:h,minHeight:m,maxWidth:y,maxHeight:x,onResizeStart:E,keepAspectRatio:g,autoScale:v,shouldResize:C,onResize:N,onResizeEnd:k},S))]}):null}function gE(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 yE=(()=>{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 Jo=null;function xg(t={}){return Jo||(t.includeStyleProperties?(Jo=t.includeStyleProperties,Jo):(Jo=Vr(window.getComputedStyle(document.documentElement)),Jo))}function Xl(t,r){const s=(t.ownerDocument.defaultView||window).getComputedStyle(t).getPropertyValue(r);return s?parseFloat(s.replace("px","")):0}function vE(t){const r=Xl(t,"border-left-width"),o=Xl(t,"border-right-width");return t.clientWidth+r+o}function xE(t){const r=Xl(t,"border-top-width"),o=Xl(t,"border-bottom-width");return t.clientHeight+r+o}function wg(t,r={}){const o=r.width||vE(t),s=r.height||xE(t);return{width:o,height:s}}function wE(){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 SE(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 Gl(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 kE(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(r=>`data:image/svg+xml;charset=utf-8,${r}`)}async function EE(t,r,o){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),u=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${r}`),a.setAttribute("height",`${o}`),a.setAttribute("viewBox",`0 0 ${r} ${o}`),u.setAttribute("width","100%"),u.setAttribute("height","100%"),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("externalResourcesRequired","true"),a.appendChild(u),u.appendChild(t),kE(a)}const Ht=(t,r)=>{if(t instanceof r)return!0;const o=Object.getPrototypeOf(t);return o===null?!1:o.constructor.name===r.name||Ht(o,r)};function NE(t){const r=t.getPropertyValue("content");return`${t.cssText} content: '${r.replace(/'|"/g,"")}';`}function CE(t,r){return xg(r).map(o=>{const s=t.getPropertyValue(o),a=t.getPropertyPriority(o);return`${o}: ${s}${a?" !important":""};`}).join(" ")}function _E(t,r,o,s){const a=`.${t}:${r}`,u=o.cssText?NE(o):CE(o,s);return document.createTextNode(`${a}{${u}}`)}function mp(t,r,o,s){const a=window.getComputedStyle(t,o),u=a.getPropertyValue("content");if(u===""||u==="none")return;const c=yE();try{r.className=`${r.className} ${c}`}catch{return}const h=document.createElement("style");h.appendChild(_E(c,o,a,s)),r.appendChild(h)}function jE(t,r,o){mp(t,r,":before",o),mp(t,r,":after",o)}const gp="application/font-woff",yp="image/jpeg",bE={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 PE(t){const r=/\.([^./]*?)$/g.exec(t);return r?r[1]:""}function Lc(t){const r=PE(t).toLowerCase();return bE[r]||""}function ME(t){return t.split(/,/)[1]}function gc(t){return t.search(/^(data:)/)!==-1}function IE(t,r){return`data:${r};base64,${t}`}async function Sg(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((u,c)=>{const h=new FileReader;h.onerror=c,h.onloadend=()=>{try{u(o({res:s,result:h.result}))}catch(m){c(m)}},h.readAsDataURL(a)})}const tc={};function TE(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 Dc(t,r,o){const s=TE(t,r,o.includeQueryParams);if(tc[s]!=null)return tc[s];o.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let a;try{const u=await Sg(t,o.fetchRequestInit,({res:c,result:h})=>(r||(r=c.headers.get("Content-Type")||""),ME(h)));a=IE(u,r)}catch(u){a=o.imagePlaceholder||"";let c=`Failed to fetch resource: ${t}`;u&&(c=typeof u=="string"?u:u.message),c&&console.warn(c)}return tc[s]=a,a}async function RE(t){const r=t.toDataURL();return r==="data:,"?t.cloneNode(!1):Gl(r)}async function zE(t,r){if(t.currentSrc){const u=document.createElement("canvas"),c=u.getContext("2d");u.width=t.clientWidth,u.height=t.clientHeight,c==null||c.drawImage(t,0,0,u.width,u.height);const h=u.toDataURL();return Gl(h)}const o=t.poster,s=Lc(o),a=await Dc(o,s,r);return Gl(a)}async function AE(t,r){var o;try{if(!((o=t==null?void 0:t.contentDocument)===null||o===void 0)&&o.body)return await la(t.contentDocument.body,r,!0)}catch{}return t.cloneNode(!1)}async function LE(t,r){return Ht(t,HTMLCanvasElement)?RE(t):Ht(t,HTMLVideoElement)?zE(t,r):Ht(t,HTMLIFrameElement)?AE(t,r):t.cloneNode(kg(t))}const DE=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT",kg=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SVG";async function $E(t,r,o){var s,a;if(kg(r))return r;let u=[];return DE(t)&&t.assignedNodes?u=Vr(t.assignedNodes()):Ht(t,HTMLIFrameElement)&&(!((s=t.contentDocument)===null||s===void 0)&&s.body)?u=Vr(t.contentDocument.body.childNodes):u=Vr(((a=t.shadowRoot)!==null&&a!==void 0?a:t).childNodes),u.length===0||Ht(t,HTMLVideoElement)||await u.reduce((c,h)=>c.then(()=>la(h,o)).then(m=>{m&&r.appendChild(m)}),Promise.resolve()),r}function OE(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):xg(o).forEach(u=>{let c=a.getPropertyValue(u);u==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),Ht(t,HTMLIFrameElement)&&u==="display"&&c==="inline"&&(c="block"),u==="d"&&r.getAttribute("d")&&(c=`path(${r.getAttribute("d")})`),s.setProperty(u,c,a.getPropertyPriority(u))})}function FE(t,r){Ht(t,HTMLTextAreaElement)&&(r.innerHTML=t.value),Ht(t,HTMLInputElement)&&r.setAttribute("value",t.value)}function HE(t,r){if(Ht(t,HTMLSelectElement)){const s=Array.from(r.children).find(a=>t.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function VE(t,r,o){return Ht(r,Element)&&(OE(t,r,o),jE(t,r,o),FE(t,r),HE(t,r)),r}async function BE(t,r){const o=t.querySelectorAll?t.querySelectorAll("use"):[];if(o.length===0)return t;const s={};for(let u=0;u<o.length;u++){const h=o[u].getAttribute("xlink:href");if(h){const m=t.querySelector(h),y=document.querySelector(h);!m&&y&&!s[h]&&(s[h]=await la(y,r,!0))}}const a=Object.values(s);if(a.length){const u="http://www.w3.org/1999/xhtml",c=document.createElementNS(u,"svg");c.setAttribute("xmlns",u),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";const h=document.createElementNS(u,"defs");c.appendChild(h);for(let m=0;m<a.length;m++)h.appendChild(a[m]);t.appendChild(c)}return t}async function la(t,r,o){return!o&&r.filter&&!r.filter(t)?null:Promise.resolve(t).then(s=>LE(s,r)).then(s=>$E(t,s,r)).then(s=>VE(t,s,r)).then(s=>BE(s,r))}const Eg=/url\((['"]?)([^'"]+?)\1\)/g,WE=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,UE=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function YE(t){const r=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${r})(['"]?\\))`,"g")}function XE(t){const r=[];return t.replace(Eg,(o,s,a)=>(r.push(a),o)),r.filter(o=>!gc(o))}async function GE(t,r,o,s,a){try{const u=o?gE(r,o):r,c=Lc(r);let h;return a||(h=await Dc(u,c,s)),t.replace(YE(r),`$1${h}$3`)}catch{}return t}function KE(t,{preferredFontFormat:r}){return r?t.replace(UE,o=>{for(;;){const[s,,a]=WE.exec(o)||[];if(!a)return"";if(a===r)return`src: ${s};`}}):t}function Ng(t){return t.search(Eg)!==-1}async function Cg(t,r,o){if(!Ng(t))return t;const s=KE(t,o);return XE(s).reduce((u,c)=>u.then(h=>GE(h,c,r,o)),Promise.resolve(s))}async function ei(t,r,o){var s;const a=(s=r.style)===null||s===void 0?void 0:s.getPropertyValue(t);if(a){const u=await Cg(a,null,o);return r.style.setProperty(t,u,r.style.getPropertyPriority(t)),!0}return!1}async function QE(t,r){await ei("background",t,r)||await ei("background-image",t,r),await ei("mask",t,r)||await ei("-webkit-mask",t,r)||await ei("mask-image",t,r)||await ei("-webkit-mask-image",t,r)}async function qE(t,r){const o=Ht(t,HTMLImageElement);if(!(o&&!gc(t.src))&&!(Ht(t,SVGImageElement)&&!gc(t.href.baseVal)))return;const s=o?t.src:t.href.baseVal,a=await Dc(s,Lc(s),r);await new Promise((u,c)=>{t.onload=u,t.onerror=r.onImageErrorHandler?(...m)=>{try{u(r.onImageErrorHandler(...m))}catch(y){c(y)}}:c;const h=t;h.decode&&(h.decode=u),h.loading==="lazy"&&(h.loading="eager"),o?(t.srcset="",t.src=a):t.href.baseVal=a})}async function ZE(t,r){const s=Vr(t.childNodes).map(a=>_g(a,r));await Promise.all(s).then(()=>t)}async function _g(t,r){Ht(t,Element)&&(await QE(t,r),await qE(t,r),await ZE(t,r))}function JE(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,u=(o.match(/url\([^)]+\)/g)||[]).map(async c=>{let h=c.replace(s,"$1");return h.startsWith("https://")||(h=new URL(h,t.url).href),Sg(h,r.fetchRequestInit,({result:m})=>(o=o.replace(c,`url(${m})`),[c,m]))});return Promise.all(u).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 u=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",h=new RegExp(c,"gi");for(;;){let m=u.exec(s);if(m===null){if(m=h.exec(s),m===null)break;u.lastIndex=h.lastIndex}else h.lastIndex=u.lastIndex;r.push(m[0])}return r}async function eN(t,r){const o=[],s=[];return t.forEach(a=>{if("cssRules"in a)try{Vr(a.cssRules||[]).forEach((u,c)=>{if(u.type===CSSRule.IMPORT_RULE){let h=c+1;const m=u.href,y=xp(m).then(x=>wp(x,r)).then(x=>Sp(x).forEach(g=>{try{a.insertRule(g,g.startsWith("@import")?h+=1:a.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:g,error:v})}})).catch(x=>{console.error("Error loading remote css",x.toString())});s.push(y)}})}catch(u){const c=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=>{c.insertRule(m,c.cssRules.length)})).catch(h=>{console.error("Error loading remote stylesheet",h)})),console.error("Error inlining remote css file",u)}}),Promise.all(s).then(()=>(t.forEach(a=>{if("cssRules"in a)try{Vr(a.cssRules||[]).forEach(u=>{o.push(u)})}catch(u){console.error(`Error while reading CSS rules from ${a.href}`,u)}}),o))}function tN(t){return t.filter(r=>r.type===CSSRule.FONT_FACE_RULE).filter(r=>Ng(r.style.getPropertyValue("src")))}async function nN(t,r){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const o=Vr(t.ownerDocument.styleSheets),s=await eN(o,r);return tN(s)}function jg(t){return t.trim().replace(/["']/g,"")}function rN(t){const r=new Set;function o(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(u=>{r.add(jg(u))}),Array.from(s.children).forEach(u=>{u instanceof HTMLElement&&o(u)})}return o(t),r}async function oN(t,r){const o=await nN(t,r),s=rN(t);return(await Promise.all(o.filter(u=>s.has(jg(u.style.fontFamily))).map(u=>{const c=u.parentStyleSheet?u.parentStyleSheet.href:null;return Cg(u.cssText,c,r)}))).join(`
|
|
63
|
+
`)}async function iN(t,r){const o=r.fontEmbedCSS!=null?r.fontEmbedCSS:r.skipFonts?null:await oN(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 bg(t,r={}){const{width:o,height:s}=wg(t,r),a=await la(t,r,!0);return await iN(a,r),await _g(a,r),JE(a,r),await EE(a,o,s)}async function sN(t,r={}){const{width:o,height:s}=wg(t,r),a=await bg(t,r),u=await Gl(a),c=document.createElement("canvas"),h=c.getContext("2d"),m=r.pixelRatio||wE(),y=r.canvasWidth||o,x=r.canvasHeight||s;return c.width=y*m,c.height=x*m,r.skipAutoScale||SE(c),c.style.width=`${y}`,c.style.height=`${x}`,r.backgroundColor&&(h.fillStyle=r.backgroundColor,h.fillRect(0,0,c.width,c.height)),h.drawImage(u,0,0,c.width,c.height),c}async function lN(t,r={}){return(await sN(t,r)).toDataURL()}function aN({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 kp({trigger:t,triggerClassName:r,contentClassName:o,children:s,disabled:a}){const[u,c]=b.useState(!1),h=b.useRef(null);return b.useEffect(()=>{if(!u)return;const m=x=>{h.current&&!h.current.contains(x.target)&&c(!1)},y=()=>c(!1);return document.addEventListener("mousedown",m),document.addEventListener("dropdown:closeall",y),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("dropdown:closeall",y)}},[u]),f.jsxs("div",{ref:h,className:"dropdown-wrapper",children:[f.jsx("button",{className:r,onClick:()=>!a&&c(!u),disabled:a,children:t}),u&&f.jsx("div",{className:`dropdown-menu ${o||""}`,onClick:()=>c(!1),children:s})]})}const uN={presentation:"#1971c2",application:"#e67700",data:"#2f9e44",external:"#9c36b5",deployment:"#c92a2a"},Ep={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],u=s.slice(1).join(`
|
|
65
|
+
`),c=["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=uN[o.layer]||"#868e96",m=Ep[o.nodeType]||Ep.component;return f.jsxs(f.Fragment,{children:[f.jsx(mE,{color:h,isVisible:r,minWidth:100,minHeight:60}),f.jsxs("div",{className:c,style:{minWidth:o.width||130,width:"100%",height:"100%"},children:[f.jsx(Hr,{type:"target",position:Ne.Top}),f.jsx(Hr,{type:"target",position:Ne.Left}),f.jsx("div",{className:"node-type-icon",children:m}),f.jsxs("div",{className:"node-content",children:[f.jsx("div",{className:"label",children:a}),u&&f.jsx("div",{className:"sublabel",children:u}),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((y,x)=>f.jsx("span",{className:"node-tech-pill",children:y},x))}),f.jsx(Hr,{type:"source",position:Ne.Bottom}),f.jsx(Hr,{type:"source",position:Ne.Right})]})]})}const Pg=b.memo(cN),dN={develop:"#2f9e44",development:"#2f9e44",dev:"#2f9e44",staging:"#e67700",stage:"#e67700",production:"#c92a2a",prod:"#c92a2a"};function fN({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 y;const u=t===a,c=r==null?void 0:r[a],h=(c==null?void 0:c.color)||dN[a]||"#6b7280",m=(c==null?void 0:c.label)||a.charAt(0).toUpperCase()+a.slice(1);return f.jsxs("button",{className:`env-tab ${u?"selected":""}`,onClick:()=>o(a),style:{"--env-color":h},children:[f.jsx("span",{className:"env-indicator"}),f.jsx("span",{className:"env-label",children:m}),u&&c&&f.jsx("span",{className:"env-meta",children:[c.deployment,c.scaling,(y=c.urlPatterns||c.urls)==null?void 0:y[0]].filter(Boolean).join(" | ")})]},a)})})}const hN=b.memo(fN);function di({children:t,className:r,style:o}){const s=b.useRef(null),[a,u]=b.useState({x:0,y:0}),c=b.useRef(!1),h=b.useRef({x:0,y:0}),m=b.useRef({x:0,y:0}),y=b.useCallback(x=>{const g=x.target;if(!g.closest("[data-drag-handle]")||g.closest("button"))return;c.current=!0,h.current={x:x.clientX,y:x.clientY},m.current={...a},x.preventDefault();const C=N=>{c.current&&u({x:m.current.x+(N.clientX-h.current.x),y:m.current.y+(N.clientY-h.current.y)})},E=()=>{c.current=!1,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",E)};document.addEventListener("mousemove",C),document.addEventListener("mouseup",E)},[a]);return f.jsx("div",{ref:s,className:r,style:{...o,transform:`translate(${a.x}px, ${a.y}px)`},onMouseDown:y,children:t})}function pN(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function mN(t){return new Date(t).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function gN({visible:t,onClose:r}){const[o,s]=b.useState(null),a=b.useCallback(async()=>{try{const u=await fetch("/api/stats");u.ok&&s(await u.json())}catch{}},[]);return b.useEffect(()=>{t&&a()},[t,a]),!t||!o?null:f.jsxs(di,{className:"stats-overlay",children:[f.jsxs("div",{className:"stats-overlay-header","data-drag-handle":!0,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:pN(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.analyzedAt&&f.jsx("span",{className:"scan-info-item",children:mN(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 yN=b.memo(gN);function vN({visible:t,onClose:r,onHighlightNode:o}){const[s,a]=b.useState(null),[u,c]=b.useState(!1),h=b.useCallback(async()=>{c(!0);try{const m=await fetch("/api/validate");m.ok&&a(await m.json())}catch{}c(!1)},[]);return b.useEffect(()=>{t&&h()},[t,h]),!t||!s&&!u?null:f.jsxs(di,{className:"validation-panel",children:[f.jsxs("div",{className:"validation-header","data-drag-handle":!0,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:u,children:u?"...":"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"})]})]}),u&&!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,y)=>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})]},y))}):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 xN=b.memo(vN);function wN({visible:t}){const[r,o]=b.useState(null),[s,a]=b.useState([]),[u,c]=b.useState(!0),[h,m]=b.useState(!1),y=b.useCallback(async()=>{try{const[k,S]=await Promise.all([fetch("/api/patrol/latest"),fetch("/api/patrol/history")]);k.ok&&o(await k.json()),S.ok&&a(await S.json())}catch{}c(!1)},[]),x=b.useCallback(async()=>{try{const k=await fetch("/api/patrol/running");if(k.ok){const S=await k.json();m(S.running)}}catch{}},[]);b.useEffect(()=>{if(t){y(),x();const k=setInterval(y,h?5e3:1e4),S=setInterval(x,5e3);return()=>{clearInterval(k),clearInterval(S)}}},[t,y,x,h]);const g=async()=>{try{(await fetch("/api/patrol/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({interval:30})})).ok&&m(!0)}catch{}},v=async()=>{try{(await fetch("/api/patrol/stop",{method:"POST"})).ok&&m(!1)}catch{}};if(!t)return null;if(u)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:g,disabled:h,children:h?"Running...":"Start Patrol"})})]});const C=s.slice(-20),E=C.filter(k=>k.passed).length,N=C.length>0?Math.round(E/C.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:v,children:"Stop Patrol"}):f.jsx("button",{className:"panel-btn green",onClick:g,children:"Start Patrol"})}),C.length>0&&f.jsxs("div",{className:"patrol-sparkline-row",children:[f.jsx("div",{className:"patrol-sparkline",children:C.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 SN=b.memo(wN);function kN({visible:t}){const[r,o]=b.useState([]),[s,a]=b.useState(null),[u,c]=b.useState(null),[h,m]=b.useState(!0),[y,x]=b.useState(null),[g,v]=b.useState(null),C=b.useRef(null),E=b.useCallback(async()=>{try{const I=await fetch("/api/workflow/list");I.ok&&o(await I.json())}catch{}m(!1)},[]),N=b.useCallback(async I=>{try{const _=await fetch(`/api/workflow/status/${I}`);if(_.ok){const j=await _.json();c(j),j&&y===I&&(j.status==="completed"||j.status==="failed")&&(x(null),E())}}catch{}},[y,E]);b.useEffect(()=>{if(t){E();const I=setInterval(E,y?3e3:1e4);return()=>clearInterval(I)}},[t,E,y]),b.useEffect(()=>(C.current&&clearInterval(C.current),s&&(N(s),C.current=setInterval(()=>N(s),y?3e3:1e4)),()=>{C.current&&clearInterval(C.current)}),[s,N,y]);const k=async I=>{v(null);try{const _=await fetch(`/api/workflow/run/${I}`,{method:"POST"});if(_.ok)x(I);else{const j=await _.json();v(j.error||"Failed to start workflow")}}catch{v("Failed to connect to server")}},S=async I=>{v(null);try{(await fetch("/api/workflow/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:I})})).ok&&(c(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:[g&&f.jsx("div",{className:"wf-error",children:g}),r.map(I=>{const _=s===I.id,j=y===I.id;return f.jsxs("div",{className:"wf-item",children:[f.jsxs("div",{className:"wf-header",onClick:()=>a(_?null:I.id),children:[f.jsxs("div",{className:"wf-header-left",children:[f.jsx("span",{className:"wf-expand",children:_?"−":"+"}),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})]}),_&&f.jsxs("div",{className:"wf-detail",children:[f.jsx("div",{className:"wf-desc",children:I.description}),u&&u.workflowId===I.id?f.jsxs("div",{className:"wf-steps",children:[Object.entries(u.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(u.steps).length,A=Object.values(u.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 EN=b.memo(kN);function NN({projectInfo:t}){const[r,o]=b.useState(!1),s=b.useRef(null);return b.useEffect(()=>{if(!r)return;const a=u=>{s.current&&!s.current.contains(u.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 CN={architecture:Pg},_N=1500;function jN({flow:t,architecture:r,onClose:o}){var C;const[s,a]=b.useState(0),[u,c]=b.useState(new Set([(C=t.steps[0])==null?void 0:C.edge])),[h,m]=b.useState(!0),{flowNodeIds:y,flowEdges:x}=b.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]),g=b.useMemo(()=>{const E=r.nodes.filter(ee=>y.has(ee.id)),N=320,k=140,S=80,I=80,_=new Map,j=new Map;y.forEach(ee=>{_.set(ee,0),j.set(ee,[])}),x.forEach(ee=>{y.has(ee.source)&&y.has(ee.target)&&(j.get(ee.source).push(ee.target),_.set(ee.target,(_.get(ee.target)||0)+1))});const O=new Map,A=[];for(_.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),_.set(X,_.get(X)-1),_.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,P)=>{J.set(re.id,{x:S+U*N,y:I+P*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,y,x]);b.useEffect(()=>{if(!h)return;const E=setInterval(()=>{a(N=>{const k=N+1;if(k>=t.steps.length)return c(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 c(S),k})},_N);return()=>clearInterval(E)},[h,t]);const v=b.useMemo(()=>{const E=new Map;return t.steps.forEach((N,k)=>{E.has(N.edge)||E.set(N.edge,k+1)}),x.map(N=>{const k=u.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"}})},[x,u,t]);return f.jsx("div",{className:"flow-hud-overlay",children:f.jsxs(di,{className:"flow-hud-panel",children:[f.jsxs("div",{className:"flow-hud-header","data-drag-handle":!0,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(hg,{nodes:g,edges:v,nodeTypes:CN,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(mg,{variant:Yn.Dots,gap:20,size:1,color:"var(--grid-color)"}),f.jsx(yg,{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 bN(t){return f.jsx(fg,{children:f.jsx(jN,{...t})})}const PN=b.memo(bN),MN=[{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 IN({onComplete:t}){const[r,o]=b.useState(1),[s,a]=b.useState(null),[u,c]=b.useState(""),[h,m]=b.useState(!1),[y,x]=b.useState(null),g=N=>{a(N),c(""),x(null),N.requiresKey?o(2):o(3)},v=()=>{if(!u.trim()){x("API key is required");return}x(null),o(3)},C=async()=>{if(s){m(!0),x(null);try{const N={provider:s.key};s.requiresKey&&u.trim()&&(N.apiKey=u.trim());const k=await fetch("/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){x(N instanceof Error?N.message:"Failed to save configuration"),m(!1)}}},E=()=>{x(null),r===3&&(s!=null&&s.requiresKey)?o(2):r===3&&!(s!=null&&s.requiresKey)?o(1):(o(1),a(null),c(""))};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:MN.map(N=>f.jsxs("button",{style:{...Te.providerCard,borderColor:(s==null?void 0:s.key)===N.key?"#7c3aed":"#5a5a7a"},onClick:()=>g(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:u,onChange:N=>{c(N.target.value),x(null)},placeholder:`Enter your ${s.name} API key`,style:Te.input,autoFocus:!0,onKeyDown:N=>{N.key==="Enter"&&v()}}),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."]}),y&&f.jsx("div",{style:Te.error,children:y}),f.jsxs("div",{style:Te.buttonRow,children:[f.jsx("button",{style:Te.backBtn,onClick:E,children:"Back"}),f.jsx("button",{style:{...Te.primaryBtn,opacity:u.trim()?1:.5,cursor:u.trim()?"pointer":"not-allowed"},onClick:v,disabled:!u.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(u.length,8)),"...",u.slice(-4)]})]})]}),y&&f.jsx("div",{style:Te.error,children:y}),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:C,disabled:h,children:h?"Saving...":"Run First Analysis"})]})]})})]})})}const Te={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,backdropFilter:"blur(4px)"},modal:{background:"#1e1e2e",border:"1px solid #5a5a7a",borderRadius:16,padding:"36px 40px",maxWidth:600,width:"90vw",maxHeight:"90vh",overflowY:"auto"},header:{textAlign:"center",marginBottom:24},headerIcon:{fontSize:36,marginBottom:8,color:"#7c3aed"},title:{color:"#fff",margin:"0 0 8px",fontSize:22,fontWeight:700},subtitle:{color:"#999",margin:0,fontSize:14,lineHeight:1.5},stepIndicator:{display:"flex",alignItems:"center",justifyContent:"center",gap:0,marginBottom:28},stepRow:{display:"flex",alignItems:"center",gap:6},stepDot:{width:26,height:26,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,flexShrink:0},stepLabel:{fontSize:12,fontWeight:500},stepLine:{width:40,height:2,marginLeft:6,marginRight:6,borderRadius:1},stepContent:{minHeight:200},providerGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:14},providerCard:{background:"#252536",border:"1px solid #5a5a7a",borderRadius:12,padding:"20px 16px",cursor:"pointer",textAlign:"left",transition:"border-color 0.15s, background 0.15s",display:"flex",flexDirection:"column",gap:6},providerIcon:{width:40,height:40,borderRadius:10,background:"#3a3a5a",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:800,color:"#7c3aed",marginBottom:4},providerName:{color:"#fff",fontSize:16,fontWeight:600},providerModels:{color:"#aaa",fontSize:12,lineHeight:1.4},providerDesc:{color:"#777",fontSize:11,lineHeight:1.4},noKeyBadge:{marginTop:4,fontSize:10,color:"#4ade80",fontWeight:600,textTransform:"uppercase",letterSpacing:.5},keySection:{display:"flex",flexDirection:"column",gap:14},selectedProviderBadge:{display:"inline-flex",alignItems:"center",gap:8,background:"#2a2a3e",border:"1px solid #5a5a7a",borderRadius:8,padding:"8px 14px",color:"#ccc",fontSize:14,fontWeight:500,alignSelf:"flex-start"},providerIconSmall:{width:22,height:22,borderRadius:6,background:"#3a3a5a",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:800,color:"#7c3aed"},label:{color:"#ccc",fontSize:13,fontWeight:600},input:{width:"100%",padding:"12px 14px",background:"#161622",border:"1px solid #5a5a7a",borderRadius:8,color:"#fff",fontSize:14,outline:"none",fontFamily:"'JetBrains Mono', monospace",boxSizing:"border-box"},keyHint:{color:"#777",fontSize:12,margin:0,lineHeight:1.4},code:{background:"#2a2a3e",padding:"2px 6px",borderRadius:4,fontSize:11,color:"#aaa"},error:{color:"#f87171",fontSize:13,padding:"8px 12px",background:"rgba(248, 113, 113, 0.1)",border:"1px solid rgba(248, 113, 113, 0.3)",borderRadius:8},buttonRow:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:8},backBtn:{padding:"10px 20px",background:"transparent",border:"1px solid #5a5a7a",borderRadius:8,color:"#aaa",fontSize:14,cursor:"pointer",fontWeight:500},primaryBtn:{padding:"10px 24px",background:"#7c3aed",border:"none",borderRadius:8,color:"#fff",fontSize:14,cursor:"pointer",fontWeight:600},confirmSection:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:12},confirmIcon:{width:52,height:52,borderRadius:"50%",background:"rgba(124, 58, 237, 0.15)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:26,color:"#7c3aed"},confirmTitle:{color:"#fff",fontSize:18,fontWeight:600,margin:0},confirmDetails:{width:"100%",maxWidth:360,background:"#252536",border:"1px solid #5a5a7a",borderRadius:10,padding:"14px 18px",display:"flex",flexDirection:"column",gap:10,textAlign:"left"},confirmRow:{display:"flex",justifyContent:"space-between",alignItems:"center"},confirmLabel:{color:"#888",fontSize:13},confirmValue:{color:"#ddd",fontSize:13,fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},runBtn:{padding:"12px 28px",background:"linear-gradient(135deg, #7c3aed, #6d28d9)",border:"none",borderRadius:8,color:"#fff",fontSize:15,cursor:"pointer",fontWeight:700,letterSpacing:.3}},TN={"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 ws({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 RN({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 AN({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 LN({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 DN({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(ws,{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 $N({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 ON({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(ws,{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 FN({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(ws,{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,u)=>f.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"1px 0",lineHeight:1.4},children:["- ",a]},u))})]},s))})}function HN({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(AN,{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 VN({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(ws,{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 BN({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(LN,{driftType:o.driftType}),f.jsx(ws,{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 WN({visible:t,onClose:r,results:o}){const[s,a]=b.useState(new Set),[u,c]=b.useState(!1),[h,m]=b.useState([]),y=b.useCallback(k=>{a(S=>{const I=new Set(S);return I.has(k)?I.delete(k):I.add(k),I})},[]),x=b.useCallback(async()=>{c(!0);try{const k=await fetch("/api/premium-agents/results");if(k.ok){const S=await k.json();Array.isArray(S)&&m(S)}}catch{}c(!1)},[]);b.useEffect(()=>{t&&x()},[t,x]);const g=o.length>0?o:h,v=new Map;g.forEach(k=>{v.set(k.agentId,k)});const C=["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(DN,{data:S});case"compliance":return f.jsx($N,{data:S});case"performance":return f.jsx(ON,{data:S});case"dependency-risk":return f.jsx(FN,{data:S});case"migration":return f.jsx(HN,{data:S});case"api-contracts":return f.jsx(VN,{data:S});case"drift-detection":return f.jsx(BN,{data:S})}}return t?f.jsxs(di,{style:{position:"absolute",top:60,right:16,background:"var(--bg-secondary)",backdropFilter:"blur(12px)",borderRadius:12,border:"1px solid var(--border-color)",zIndex:10,width:320,maxHeight:"calc(100vh - 200px)",overflowY:"auto",boxShadow:"0 2px 12px var(--shadow-color)"},children:[f.jsxs("div",{"data-drag-handle":!0,style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 14px 8px",borderBottom:"1px solid var(--border-color)",cursor:"grab"},children:[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:x,disabled:u,children:u?"...":"Refresh"}),f.jsx("button",{className:"panel-close-btn",onClick:r,children:"x"})]})]}),f.jsx("div",{style:{padding:"8px 10px 12px"},children:u&&g.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:"Loading agent results..."}):g.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:C.map(k=>{const S=v.get(k);if(!S)return null;const I=TN[k],_=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:()=>y(k),style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 10px",background:_?"var(--bg-tertiary)":"transparent",cursor:"pointer",transition:"background 0.15s",userSelect:"none"},onMouseEnter:O=>{_||(O.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:O=>{_||(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:_?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"})})]}),_&&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(RN,{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)})})}),g.length>0&&f.jsxs("div",{style:{padding:"8px 14px",borderTop:"1px solid var(--border-color)",fontSize:10,color:"var(--text-muted)",textAlign:"center"},children:[g.length," of ",C.length," agents reporting"]})]}):null}const UN=b.memo(WN);function ti(t,r){return!t||t.length===0?!0:t.includes(r)}const YN=1500,XN={architecture:Pg};function GN(t,r,o){if(o)return t.map(g=>({id:g.id,type:"architecture",position:{x:g.x,y:g.y},data:{label:g.label,layer:g.layer,nodeType:g.type,width:g.width,height:g.height,path:g.path,techStack:g.techStack,description:g.description},style:{width:g.width,zIndex:1}}));const h=["presentation","application","data","external","deployment"],m={};t.forEach(g=>{const v=g.layer||"application";m[v]||(m[v]=[]),m[v].push(g)});const y=new Map;let x=100;return h.forEach(g=>{const v=m[g]||[];v.forEach((C,E)=>{y.set(C.id,{x:100+E*250,y:x})}),v.length>0&&(x+=180)}),Object.entries(m).forEach(([g,v])=>{h.includes(g)||(v.forEach((C,E)=>{y.set(C.id,{x:100+E*250,y:x})}),x+=180)}),t.map(g=>{const v=y.get(g.id)||{x:100,y:100};return{id:g.id,type:"architecture",position:v,data:{label:g.label,layer:g.layer,nodeType:g.type,width:g.width,height:g.height,path:g.path,techStack:g.techStack,description:g.description},style:{width:g.width,zIndex:1}}})}function Np(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:us.ArrowClosed,width:16,height:16,color:o.color||r}}))}function KN(){var wn,Sn,kn;const[t,r,o]=Vk([]),[s,a,u]=Bk([]),[c,h]=b.useState(null),[m,y]=b.useState(!1),[x,g]=b.useState(null),[v]=b.useState([]),[C,E]=b.useState(!0),[N,k]=b.useState(null),[S,I]=b.useState({loggedIn:!1,email:null,tier:"free",features:{analyze:!0,validate:!1,patrol:!1,workflows:!1,chat:!1,premiumAgents:!1}}),[_,j]=b.useState(!1),[O,A]=b.useState(null),[H,q]=b.useState(!1),[J,ee]=b.useState(null),[,U]=b.useState(null),[X,re]=b.useState(null),[P,K]=b.useState(null),[V,G]=b.useState(-1),[R,z]=b.useState(!1),[B,M]=b.useState(new Set),[D,ie]=b.useState(!1),[oe,de]=b.useState(new Set),[he,me]=b.useState(new Set),[ne,pe]=b.useState(null),[be,_e]=b.useState("layer"),[Ce,Ee]=b.useState(!1),[ze,He]=b.useState(!1),[Ae,Ge]=b.useState(!1),[Ct,ft]=b.useState(!1),[yt,ht]=b.useState(!1),[hn,zn]=b.useState([]),[vt,An]=b.useState("develop"),[,Jt]=b.useState([]),[pn,Ln]=b.useState(),[Wr,en]=b.useState(null),[_t,fi]=b.useState(null),[mn,Vt]=b.useState(new Map),[Ur,pr]=b.useState(!1),tn=b.useRef([]),[Kn,Yr]=b.useState([]),Xr=50,[,nn]=b.useState([]),[,rn]=b.useState([]),[on,No]=b.useState(new Set),[jt,Gr]=b.useState(new Set),[ut,Kr]=b.useState(()=>{const $=localStorage.getItem("archbyte-theme");return $==="dark"||$==="light"?$:"light"});b.useEffect(()=>{document.documentElement.setAttribute("data-theme",ut),localStorage.setItem("archbyte-theme",ut)},[ut]);const[Qr,It]=b.useState(!1),[gn,Dn]=b.useState(""),[Qn,yn]=b.useState(new Set),[mr,vn]=b.useState(!1),[tt,hi]=b.useState(null),qn=ut==="dark"?"#64748b":"#94a3b8",Co="#fff",Bt=20,Tt=10,xn=b.useCallback(async()=>{try{await mi()}catch($){console.error("Failed to load architecture:",$),k("Failed to connect to server"),Ue()}finally{E(!1)}},[]),pi=async()=>{try{const $=await fetch("/api/tools-git");if($.ok){const W=await $.json();fi(W)}}catch{}},_o=async()=>{try{const $=await fetch("/api/config");if($.ok){const W=await $.json();if(U(W),W.environments){Ln(W.environments);const te=Object.keys(W.environments);te.length>0&&!te.includes(vt)&&An(te[0])}}}catch{}},jo=async()=>{try{const $=await fetch("/api/license");if($.ok){const W=await $.json();I(W),j(!0)}}catch{j(!0)}},bo=async()=>{try{const $=await fetch("/api/project");if($.ok){const W=await $.json();W&&re(W)}}catch{}},Po=async()=>{try{const $=await fetch("/api/analysis-status");if($.ok){const W=await $.json();(W==null?void 0:W.status)==="error"&&W.error?ee(W.error):ee(null)}}catch{}},mi=async()=>{const $="/events",W="/api/architecture";pi(),_o(),bo(),jo(),Po();try{const te=new EventSource($);return te.onopen=()=>{console.log("SSE connected"),y(!0),k(null)},te.onmessage=se=>{try{const ae=JSON.parse(se.data);console.log("SSE message:",ae.type),ae.architecture&&Zr(ae.architecture),ae.type==="git_update"&&ae.gitInfo&&Jt(ae.gitInfo),ae.type==="premium_agent_result"&&ae.premiumResults&&zn(ae.premiumResults)}catch(ae){console.error("Failed to parse SSE message:",ae)}},te.onerror=se=>{console.error("SSE error:",se),te.close(),y(!1),qr(W)},()=>te.close()}catch{qr(W)}},qr=async $=>{try{const W=await fetch($);if(W.ok){const te=await W.json();Zr(te),y(!0)}else Ue()}catch{Ue()}},Ue=()=>{const $={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($)},Zr=$=>{h($),g($.lastUpdated),$.gitInfo&&Jt($.gitInfo),$.environments&&Ln($.environments)};b.useEffect(()=>{if(!c)return;const $=c.nodes.filter(se=>ti(se.environments,vt)&&!oe.has(se.id)&&!he.has(se.layer)),W=new Set($.map(se=>se.id)),te=c.edges.filter(se=>ti(se.environments,vt)&&W.has(se.source)&&W.has(se.target));r(GN($,te,c.layoutSaved)),a(Np(te,qn))},[c,vt,oe,he,qn]),b.useEffect(()=>{xn()},[xn]),b.useEffect(()=>{if(!R||!P)return;const $=setInterval(()=>{G(W=>{const te=W+1;if(te>=P.steps.length)return M(new Set([P.steps[0].edge])),0;const se=new Set;for(let ae=0;ae<=te;ae++)se.add(P.steps[ae].edge);return M(se),te})},YN);return()=>clearInterval($)},[R,P]),b.useEffect(()=>{if(!c)return;const $=c.nodes.filter(ge=>ti(ge.environments,vt)),W=new Set($.map(ge=>ge.id)),te=c.edges.filter(ge=>ti(ge.environments,vt)&&W.has(ge.source)&&W.has(ge.target)),se=new Map;P&&P.steps.forEach((ge,je)=>{se.has(ge.edge)||se.set(ge.edge,je+1)});const ae=te.map(ge=>{const je=B.has(ge.id),Se=P==null?void 0:P.steps.some(Be=>Be.edge===ge.id),Pe=se.get(ge.id);return{id:ge.id,source:ge.source,target:ge.target,label:je&&Pe?`${Pe}`:void 0,labelStyle:je&&Pe?{fill:Co,fontWeight:700,fontSize:12,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:je&&Pe?{fill:(P==null?void 0:P.color)||"#3b82f6",fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:je?(P==null?void 0:P.color)||ge.color:ge.color||qn,strokeWidth:je?6:3,opacity:P?Se?1:.15:1,filter:je?"brightness(0.85) saturate(1.4)":void 0},animated:je,type:"smoothstep"}});a(ae)},[B,P,c,vt,qn,Co]);const gr=$=>{K($),G(0),M(new Set([$.steps[0].edge])),z(!0),ie(!0)},$n=()=>{if(z(!1),K(null),G(-1),M(new Set),ie(!1),c){const $=c.nodes.filter(se=>ti(se.environments,vt)),W=new Set($.map(se=>se.id)),te=c.edges.filter(se=>ti(se.environments,vt)&&W.has(se.source)&&W.has(se.target));a(Np(te,qn))}},yr=()=>{z(!1)},gi=()=>{P&&z(!0)},Zn=b.useRef(oe);b.useEffect(()=>{Zn.current=oe},[oe]);const We=b.useCallback(()=>{nn($=>{const W={nodes:[...tn.current],edges:[...s],hiddenNodeIds:new Set(Zn.current)},te=[...$,W];return te.length>Xr&&te.shift(),te}),rn([])},[s]),Rt=b.useCallback($=>{en($),setTimeout(()=>en(null),3e3)},[]),yi=b.useCallback($=>{We(),de(W=>new Set([...W,$])),pe(null)},[We]),bt=b.useCallback($=>{de(W=>{const te=new Set(W);return te.delete($),te})},[]),vi=b.useCallback(()=>{de(new Set)},[]);b.useCallback($=>{me(W=>{const te=new Set(W);return te.has($)?te.delete($):te.add($),te})},[]);const xi=b.useCallback(($,W)=>{pe(W.id)},[]),wi=b.useCallback(()=>{pe(null)},[]);b.useEffect(()=>{tn.current=t},[t]);const vr=b.useCallback($=>{o($);const W=$.some(se=>se.type==="position"&&se.dragging===!1&&se.position),te=$.some(se=>se.type==="dimensions"&&se.dimensions&&se.resizing===!1);(W||te)&&We(),$.forEach(se=>{if(se.type==="position"&&se.dragging===!1&&se.position){const ae=tn.current.find(ge=>ge.id===se.id);ae&&Vt(ge=>{var Pe,Be,Ye,ot;const je=new Map(ge),Se=je.get(se.id);return je.set(se.id,{id:se.id,x:se.position.x,y:se.position.y,width:(Se==null?void 0:Se.width)??((Pe=ae.style)==null?void 0:Pe.width)??((Be=ae.data)==null?void 0:Be.width)??100,height:(Se==null?void 0:Se.height)??((Ye=ae.style)==null?void 0:Ye.height)??((ot=ae.data)==null?void 0:ot.height)??60}),je})}if(se.type==="dimensions"&&se.dimensions&&se.resizing===!1){const ae=tn.current.find(ge=>ge.id===se.id);ae&&Vt(ge=>{const je=new Map(ge),Se=je.get(se.id);return je.set(se.id,{id:se.id,x:(Se==null?void 0:Se.x)??ae.position.x,y:(Se==null?void 0:Se.y)??ae.position.y,width:se.dimensions.width,height:se.dimensions.height}),je})}})},[o,We]),On=b.useCallback(async()=>{if(mn.size!==0){pr(!0);try{const $=Array.from(mn.values()),W=await fetch("/api/update-positions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:$})});if(W.ok)Vt(new Map),console.log("Changes saved successfully");else{const te=await W.json();console.error("Failed to save changes:",te)}}catch($){console.error("Error saving changes:",$)}finally{pr(!1)}}},[mn]),sn=b.useCallback(()=>{Vt(new Map),xn()},[xn]),Jn=b.useCallback(()=>{nn($=>{if($.length===0)return $;const W=[...$],te=W.pop();if(rn(se=>[...se,{nodes:[...tn.current],edges:[...s],hiddenNodeIds:new Set(Zn.current)}]),r(te.nodes),a(te.edges),de(te.hiddenNodeIds),c){const se=new Map;te.nodes.forEach(ae=>{var je,Se,Pe,Be;const ge=c.nodes.find(Ye=>Ye.id===ae.id);if(ge){const Ye=ae.position.x,ot=ae.position.y,Le=((je=ae.style)==null?void 0:je.width)??((Se=ae.data)==null?void 0:Se.width)??100,Ke=((Pe=ae.style)==null?void 0:Pe.height)??((Be=ae.data)==null?void 0:Be.height)??60;(Ye!==ge.x||ot!==ge.y||Le!==ge.width||Ke!==ge.height)&&se.set(ae.id,{id:ae.id,x:Ye,y:ot,width:Le,height:Ke})}}),Vt(se)}return W})},[s,r,a,c]),Jr=b.useCallback(()=>{rn($=>{if($.length===0)return $;const W=[...$],te=W.pop();if(nn(se=>[...se,{nodes:[...tn.current],edges:[...s],hiddenNodeIds:new Set(Zn.current)}]),r(te.nodes),a(te.edges),de(te.hiddenNodeIds),c){const se=new Map;te.nodes.forEach(ae=>{var je,Se,Pe,Be;const ge=c.nodes.find(Ye=>Ye.id===ae.id);if(ge){const Ye=ae.position.x,ot=ae.position.y,Le=((je=ae.style)==null?void 0:je.width)??((Se=ae.data)==null?void 0:Se.width)??100,Ke=((Pe=ae.style)==null?void 0:Pe.height)??((Be=ae.data)==null?void 0:Be.height)??60;(Ye!==ge.x||ot!==ge.y||Le!==ge.width||Ke!==ge.height)&&se.set(ae.id,{id:ae.id,x:Ye,y:ot,width:Le,height:Ke})}}),Vt(se)}return W})},[s,r,a,c]),Si=b.useCallback(({nodes:$})=>{Gr(new Set($.map(W=>W.id))),$.length===1?pe($[0].id):$.length===0&&pe(null)},[]),xr=b.useCallback(()=>{if(jt.size===0&&!ne)return;We();const $=jt.size>0?jt:new Set([ne]);de(W=>new Set([...W,...$])),Gr(new Set),pe(null)},[jt,ne,We]),er=b.useCallback(()=>{const $=jt.size>0?jt:ne?new Set([ne]):new Set;if($.size===0)return;const W=t.filter(te=>$.has(te.id));Yr(W)},[t,jt,ne]),wr=b.useCallback(()=>{if(Kn.length===0)return;We();const $=50,W=Kn.map((te,se)=>{var ae;return{...te,id:`${te.id}-copy-${Date.now()}-${se}`,position:{x:te.position.x+$,y:te.position.y+$},selected:!0,data:{...te.data,label:`${((ae=te.data)==null?void 0:ae.label)||te.id} (copy)`}}});r(te=>[...te.map(se=>({...se,selected:!1})),...W]),W.forEach(te=>{Vt(se=>{var ge,je,Se,Pe;const ae=new Map(se);return ae.set(te.id,{id:te.id,x:te.position.x,y:te.position.y,width:((ge=te.style)==null?void 0:ge.width)||((je=te.data)==null?void 0:je.width)||100,height:((Se=te.style)==null?void 0:Se.height)||((Pe=te.data)==null?void 0:Pe.height)||60}),ae})})},[Kn,r,We]),Wt=b.useCallback(($,W)=>{const te=jt.size>0?jt:ne?new Set([ne]):new Set;te.size!==0&&(We(),r(se=>se.map(ae=>{if(te.has(ae.id)&&!on.has(ae.id)){const ge={x:ae.position.x+$,y:ae.position.y+W};return Vt(je=>{var Pe,Be,Ye,ot;const Se=new Map(je);return Se.set(ae.id,{id:ae.id,x:ge.x,y:ge.y,width:((Pe=ae.style)==null?void 0:Pe.width)||((Be=ae.data)==null?void 0:Be.width)||100,height:((Ye=ae.style)==null?void 0:Ye.height)||((ot=ae.data)==null?void 0:ot.height)||60}),Se}),{...ae,position:ge}}return ae})))},[jt,ne,on,r,We]),Sr=b.useCallback($=>{No(W=>{const te=new Set(W);return te.has($)?te.delete($):te.add($),te})},[]),ki=b.useCallback($=>{const W={id:`edge-${$.source}-${$.target}-${Date.now()}`,source:$.source,target:$.target,type:"smoothstep",animated:!0,style:{stroke:ut==="dark"?"#868e96":"#6b7280",strokeWidth:2}};a(te=>Sm(W,te))},[a,ut]),Ve=b.useCallback(($,W)=>{We(),a(te=>s1($,W,te))},[a,We]),Ss=b.useCallback(async()=>{const $=document.querySelector(".react-flow");if($){It(!0);try{const W=await lN($,{backgroundColor:ut==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)",quality:1,pixelRatio:2}),te=document.createElement("a");te.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.png`,te.href=W,te.click()}catch(W){console.error("Failed to export PNG:",W)}finally{It(!1)}}},[ut]),ks=b.useCallback(async()=>{const $=document.querySelector(".react-flow");if($){It(!0);try{const W=await bg($,{backgroundColor:ut==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)"}),te=document.createElement("a");te.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.svg`,te.href=W,te.click()}catch(W){console.error("Failed to export SVG:",W)}finally{It(!1)}}},[ut]),tr=b.useCallback(async $=>{It(!0);try{const W=await fetch(`/api/export?format=${$}`);if(!W.ok)throw new Error("Export failed");const te=await W.blob(),se=$==="mermaid"?"mmd":$==="plantuml"?"puml":$==="markdown"?"md":$,ae=document.createElement("a");ae.download=`architecture.${se}`,ae.href=URL.createObjectURL(te),ae.click(),URL.revokeObjectURL(ae.href)}catch(W){console.error(`Failed to export ${$}:`,W)}finally{It(!1)}},[]);b.useCallback(()=>{if(!c)return;We();const $=250,W=100,te=100,se=t.map((ae,ge)=>({...ae,position:{x:W+ge*$,y:te}}));r(se),_e("horizontal")},[c,t,r,We]),b.useCallback(()=>{if(!c)return;We();const $=150,W=100,te=100,se=t.map((ae,ge)=>({...ae,position:{x:W,y:te+ge*$}}));r(se),_e("vertical")},[c,t,r,We]),b.useCallback(()=>{if(!c)return;We();const $=280,W=180,te=100,se=100,ae=Math.ceil(Math.sqrt(t.length)),ge=t.map((je,Se)=>({...je,position:{x:te+Se%ae*$,y:se+Math.floor(Se/ae)*W}}));r(ge),_e("grid")},[c,t,r,We]),b.useCallback(()=>{if(!c)return;We();const $=320,W=160,te=100,se=100,ae=new Set(t.map(Le=>Le.id)),ge=new Map,je=new Map;ae.forEach(Le=>{ge.set(Le,0),je.set(Le,[])}),s.forEach(Le=>{ae.has(Le.source)&&ae.has(Le.target)&&(je.get(Le.source).push(Le.target),ge.set(Le.target,(ge.get(Le.target)||0)+1))});const Se=new Map,Pe=[];for(ge.forEach((Le,Ke)=>{Le===0&&(Pe.push(Ke),Se.set(Ke,0))});Pe.length>0;){const Le=Pe.shift(),Ke=Se.get(Le);for(const Ut of je.get(Le)||[]){const Mo=Ke+1;(!Se.has(Ut)||Se.get(Ut)<Mo)&&Se.set(Ut,Mo),ge.set(Ut,ge.get(Ut)-1),ge.get(Ut)===0&&Pe.push(Ut)}}t.forEach(Le=>{Se.has(Le.id)||Se.set(Le.id,0)});const Be=new Map;t.forEach(Le=>{const Ke=Se.get(Le.id);Be.has(Ke)||Be.set(Ke,[]),Be.get(Ke).push(Le)});const Ye=[];[...Be.keys()].sort((Le,Ke)=>Le-Ke).forEach((Le,Ke)=>{Be.get(Le).forEach((Mo,aa)=>{Ye.push({...Mo,position:{x:te+Ke*$,y:se+aa*W}})})}),r(Ye),_e("flow")},[c,t,s,r,We]),b.useCallback(()=>{if(!c)return;We();const $=250,W=180,te=100,se=100,ae={};t.forEach(Pe=>{var Ye;const Be=((Ye=Pe.data)==null?void 0:Ye.layer)||"application";ae[Be]||(ae[Be]=[]),ae[Be].push(Pe)});const ge=["presentation","application","data","external","deployment"];let je=se;const Se=[];ge.forEach(Pe=>{const Be=ae[Pe]||[];Be.forEach((Ye,ot)=>{Se.push({...Ye,position:{x:te+ot*$,y:je}})}),Be.length>0&&(je+=W)}),Object.entries(ae).forEach(([Pe,Be])=>{ge.includes(Pe)||(Be.forEach((Ye,ot)=>{Se.push({...Ye,position:{x:te+ot*$,y:je}})}),je+=W)}),r(Se),_e("layer")},[c,t,r,We]);const eo=b.useCallback($=>{if(!$||!c){yn(new Set);return}const W=new Set;W.add($),c.edges.forEach(te=>{te.source===$&&(W.add(te.target),W.add(te.id)),te.target===$&&(W.add(te.source),W.add(te.id))}),yn(W)},[c]),Es=b.useMemo(()=>{if(!gn.trim())return new Set;const $=gn.toLowerCase(),W=new Set;return t.forEach(te=>{var ae;(((ae=te.data)==null?void 0:ae.label)||"").toLowerCase().includes($)&&W.add(te.id)}),W},[gn,t]),Ns=b.useCallback(async $=>{try{await fetch("/api/open-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:$})})}catch(W){console.error("Failed to open file:",W)}},[]),Ei=b.useCallback(($,W)=>{if(!c)return;const te=c.nodes.find(se=>se.id===W.id);te&&(hi(te),vn(!0))},[c]);b.useEffect(()=>{const $=W=>{if(W.target instanceof HTMLInputElement||W.target instanceof HTMLTextAreaElement)return;const se=navigator.platform.toUpperCase().indexOf("MAC")>=0?W.metaKey:W.ctrlKey;if(W.key==="Backspace"||W.key==="Delete"){W.preventDefault(),xr();return}if(se&&W.key==="c"){W.preventDefault(),er();return}if(se&&W.key==="v"){W.preventDefault(),wr();return}if(se&&W.shiftKey&&W.key==="z"){W.preventDefault(),Jr();return}if(se&&W.key==="z"){W.preventDefault(),Jn();return}if(se&&W.key==="s"){W.preventDefault(),On();return}if(W.key==="Escape"){Dn(""),yn(new Set),vn(!1);return}if(W.key==="ArrowUp"){W.preventDefault(),Wt(0,W.shiftKey?-Tt*5:-Tt);return}if(W.key==="ArrowDown"){W.preventDefault(),Wt(0,W.shiftKey?Tt*5:Tt);return}if(W.key==="ArrowLeft"){W.preventDefault(),Wt(W.shiftKey?-Tt*5:-Tt,0);return}if(W.key==="ArrowRight"){W.preventDefault(),Wt(W.shiftKey?Tt*5:Tt,0);return}if(se&&W.key==="l"&&ne){W.preventDefault(),Sr(ne);return}};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[xr,er,wr,On,Wt,Sr,ne,Jn,Jr]);const kr=b.useMemo(()=>c?c.nodes.filter($=>oe.has($.id)):[],[c,oe]);return b.useEffect(()=>{c&&r($=>$.map(W=>({...W,data:{...W.data,highlighted:W.id===Wr}})))},[Wr,c]),C?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("span",{className:"archbyte-name",children:"ArchByte"}),X?f.jsx(NN,{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.jsx("div",{className:"toolbar-section-items",children:f.jsx("input",{type:"text",placeholder:"Filter nodes...",value:gn,onChange:$=>Dn($.target.value),className:"toolbar-search"})})]}),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.jsxs(kp,{trigger:P?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"flow-dot-inline",style:{background:P.color}}),P.name]}):"▶ Flows ▾",triggerClassName:`toolbar-btn ${P?"has-active-flow":""}`,children:[P&&f.jsxs(f.Fragment,{children:[f.jsx("button",{className:"dropdown-item flow-clear",onClick:$n,children:"⏹ Clear active flow"}),f.jsx("div",{className:"dropdown-separator"})]}),c!=null&&c.flows&&c.flows.length>0?(()=>{const $=["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"},te={"user-journey":"#3b82f6","data-pipeline":"#22c55e",system:"#f59e0b",deployment:"#a855f7","error-recovery":"#ef4444"},se={};for(const je of c.flows){const Se=je.category||"system";se[Se]||(se[Se]=[]),se[Se].push(je)}const ae=[];for(const je of $){const Se=se[je];if(Se!=null&&Se.length){ae.push(f.jsxs("div",{className:"flow-category-header",children:[f.jsx("span",{className:"flow-dot-inline",style:{background:te[je]}}),W[je]||je]},`cat-${je}`));for(const Pe of Se)ae.push(f.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(P==null?void 0:P.id)===Pe.id?"active":""}`,onClick:()=>{(P==null?void 0:P.id)===Pe.id?$n():gr(Pe)},children:[f.jsx("span",{className:"flow-dot-inline",style:{background:Pe.color}}),f.jsx("span",{className:"flow-dropdown-name",children:Pe.name}),(P==null?void 0:P.id)===Pe.id&&f.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Pe.id))}}const ge=new Set($);for(const[je,Se]of Object.entries(se))if(!ge.has(je)&&Se!=null&&Se.length){ae.push(f.jsxs("div",{className:"flow-category-header",children:[f.jsx("span",{className:"flow-dot-inline",style:{background:"#6b7280"}}),je]},`cat-${je}`));for(const Pe of Se)ae.push(f.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(P==null?void 0:P.id)===Pe.id?"active":""}`,onClick:()=>{(P==null?void 0:P.id)===Pe.id?$n():gr(Pe)},children:[f.jsx("span",{className:"flow-dot-inline",style:{background:Pe.color}}),f.jsx("span",{className:"flow-dropdown-name",children:Pe.name}),(P==null?void 0:P.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.jsx("button",{className:`toolbar-btn premium-btn ${S.features.validate?"":"premium-locked"} ${ze?"active":""}`,onClick:()=>{if(!S.features.validate){A("Validate");return}He(!ze)},children:"Validate"})]})]}),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"} ${Ae?"active":""}`,title:S.features.patrol?"":"Available in Pro",onClick:()=>{if(!S.features.patrol){A("Patrol");return}Ge(!Ae),ft(!1),ht(!1)},children:"Patrol"}),f.jsx("button",{className:`toolbar-btn premium-btn ${S.features.patrol?"":"premium-locked"} ${Ct?"active":""}`,title:S.features.patrol?"":"Available in Pro",onClick:()=>{if(!S.features.patrol){A("Workflows");return}ft(!Ct),Ge(!1),ht(!1)},children:"Workflows"}),f.jsx("button",{className:`toolbar-btn premium-btn ${S.features.premiumAgents?"":"premium-locked"} ${yt?"active":""}`,title:S.features.premiumAgents?"":"Available in Pro",onClick:()=>{if(!S.features.premiumAgents){A("Pro Agents");return}yt?ht(!1):(ht(!0),Ge(!1),ft(!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 ${Ce?"active":""}`,onClick:()=>Ee(!Ce),children:"Stats"}),f.jsxs(kp,{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:Ss,children:"PNG — Raster image"}),f.jsx("button",{className:"dropdown-item",onClick:ks,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:()=>tr("mermaid"),children:"Mermaid — .mmd"}),f.jsx("button",{className:"dropdown-item",onClick:()=>tr("plantuml"),children:"PlantUML — .puml"}),f.jsx("button",{className:"dropdown-item",onClick:()=>tr("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:()=>tr("markdown"),children:"Markdown — .md"}),f.jsx("button",{className:"dropdown-item",onClick:()=>tr("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(hN,{selectedEnvironment:vt,environments:pn,onSelectEnvironment:An}),f.jsxs("div",{className:"canvas-container",children:[f.jsx("div",{className:"watermark",children:"archbyte"}),f.jsxs(hg,{nodes:t.map($=>({...$,draggable:!on.has($.id),data:{...$.data,locked:on.has($.id),isConnected:Qn.size>0?Qn.has($.id):null,isSearchMatch:gn?Es.has($.id):null}})),edges:s.map($=>{var W;return{...$,style:{...$.style,opacity:Qn.size>0?Qn.has($.id)?1:.15:1,strokeWidth:Qn.has($.id)?3:((W=$.style)==null?void 0:W.strokeWidth)||2}}}),onNodesChange:vr,onEdgesChange:u,onNodeClick:($,W)=>{xi($,W),eo(W.id)},onNodeDoubleClick:Ei,onPaneClick:()=>{wi(),eo(null),document.dispatchEvent(new Event("dropdown:closeall"))},onConnect:ki,onReconnect:Ve,edgesReconnectable:!0,onSelectionChange:Si,nodeTypes:XN,connectionMode:wo.Loose,snapToGrid:!0,snapGrid:[Bt,Bt],selectionOnDrag:!0,selectNodesOnDrag:!1,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,attributionPosition:"bottom-left",deleteKeyCode:null,children:[f.jsx(mg,{color:ut==="dark"?"hsl(220 25% 15%)":"hsl(220 15% 82%)",gap:20,variant:Yn.Dots}),f.jsx(yg,{})]}),ne&&f.jsxs("div",{className:"node-actions-panel",children:[f.jsxs("div",{className:"node-actions-title",children:[on.has(ne)&&f.jsx("span",{className:"lock-icon",children:"🔒"}),((Sn=(wn=t.find($=>$.id===ne))==null?void 0:wn.data)==null?void 0:Sn.label)||ne]}),f.jsxs("div",{className:"node-actions-buttons",children:[f.jsx("button",{className:`panel-btn ${on.has(ne)?"amber":"cyan"}`,onClick:()=>Sr(ne),title:"Lock/Unlock (Cmd+L)",children:on.has(ne)?"🔓 Unlock":"🔒 Lock"}),f.jsx("button",{className:"panel-btn red",onClick:()=>yi(ne),title:"Hide (Delete key)",children:"Hide"})]}),f.jsx("div",{className:"node-actions-hint",children:"Arrow keys to move • Shift for faster"})]}),mr&&tt&&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:tt.label.split(`
|
|
68
|
+
`)[0]}),f.jsxs("div",{className:"node-details-type",children:[tt.layer," • ",tt.type]})]}),f.jsx("button",{className:"panel-close-btn",onClick:()=>vn(!1),children:"×"})]}),tt.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:tt.path})]}),tt.techStack&&tt.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:tt.techStack.map(($,W)=>f.jsx("span",{className:"tech-badge",children:$},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:[c==null?void 0:c.edges.filter($=>$.source===tt.id||$.target===tt.id).map($=>{const W=$.source===tt.id,te=W?$.target:$.source,se=c==null?void 0:c.nodes.find(ae=>ae.id===te);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:(se==null?void 0:se.label.split(`
|
|
69
|
+
`)[0])||te})]}),$.label&&f.jsx("div",{className:"connection-label",children:$.label})]},$.id)}),(c==null?void 0:c.edges.filter($=>$.source===tt.id||$.target===tt.id).length)===0&&f.jsx("span",{style:{color:"var(--text-muted)"},children:"No connections"})]})]}),f.jsxs("div",{className:"node-details-actions",children:[tt.path&&f.jsx("button",{className:"panel-btn cyan",onClick:()=>Ns(tt.path),children:"Open in VS Code"}),f.jsx("button",{className:"panel-btn",onClick:()=>{eo(tt.id),vn(!1)},children:"Highlight Deps"})]})]}),mn.size>0&&f.jsxs("div",{className:"save-panel",children:[f.jsxs("span",{className:"save-panel-text",children:[mn.size," unsaved change",mn.size!==1?"s":""]}),f.jsx("button",{className:"save-btn",onClick:On,disabled:Ur,children:Ur?"Saving...":"Save Changes"}),f.jsx("button",{className:"discard-btn",onClick:sn,disabled:Ur,children:"Discard"})]}),kr.length>0&&f.jsxs("div",{className:"hidden-nodes-panel",children:[f.jsxs("div",{className:"hidden-nodes-title",children:["Hidden (",kr.length,")",f.jsx("button",{className:"panel-btn cyan small",onClick:vi,children:"Show All"})]}),f.jsx("div",{className:"hidden-nodes-list",style:{maxHeight:220,overflowY:"auto"},children:kr.map($=>f.jsxs("div",{className:"hidden-node-item",children:[f.jsx("span",{className:"hidden-node-name",children:$.label.split(`
|
|
70
|
+
`)[0]}),f.jsx("button",{className:"panel-btn green small",onClick:()=>bt($.id),children:"Show"})]},$.id))})]}),P&&f.jsxs("div",{className:"flow-progress-bar",children:[f.jsx("span",{className:"flow-progress-dot",style:{background:P.color}}),f.jsx("span",{className:"flow-progress-name",children:P.name}),f.jsx("div",{className:"flow-progress-steps",children:P.steps.map(($,W)=>f.jsx("div",{className:`flow-progress-step ${W<=V?"active":""} ${W===V?"current":""}`,style:{borderColor:W<=V?P.color:void 0},title:$.label,children:$.label},W))}),f.jsxs("div",{className:"flow-progress-controls",children:[R?f.jsx("button",{className:"flow-progress-btn",onClick:yr,title:"Pause",children:"⏸"}):f.jsx("button",{className:"flow-progress-btn",onClick:gi,title:"Resume",children:"▶"}),f.jsx("button",{className:"flow-progress-btn stop",onClick:$n,title:"Stop",children:"⏹"})]})]}),D&&P&&c&&f.jsx(PN,{flow:P,architecture:c,onClose:$n}),f.jsx(yN,{visible:Ce,onClose:()=>Ee(!1)}),f.jsx(xN,{visible:ze,onClose:()=>He(!1),onHighlightNode:$=>{Rt($),eo($)}}),Ae&&f.jsxs(di,{className:"ops-panel",children:[f.jsxs("div",{className:"ops-header","data-drag-handle":!0,children:[f.jsx("span",{className:"ops-panel-title",children:"Patrol"}),f.jsx("button",{className:"panel-close-btn",onClick:()=>Ge(!1),children:"x"})]}),f.jsx(SN,{visible:!0})]}),Ct&&f.jsxs(di,{className:"ops-panel",children:[f.jsxs("div",{className:"ops-header","data-drag-handle":!0,children:[f.jsx("span",{className:"ops-panel-title",children:"Workflows"}),f.jsx("button",{className:"panel-close-btn",onClick:()=>ft(!1),children:"x"})]}),f.jsx(EN,{visible:!0})]}),f.jsx(UN,{visible:yt,onClose:()=>ht(!1),results:hn}),v.length>0&&f.jsxs("div",{className:"agent-panel",children:[f.jsx("div",{className:"agent-panel-title",children:"Agent Activity"}),v.map(($,W)=>f.jsxs("div",{className:"agent-item",children:[f.jsx("div",{className:`agent-dot ${W===0?"active":""}`}),f.jsx("span",{className:"agent-name",children:$.agentName}),f.jsx("span",{className:"agent-target",children:$.targetComponent||$.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:x?`Updated ${new Date(x).toLocaleTimeString()}`:"Waiting..."}),_t?f.jsxs("span",{className:"git-status",children:[_t.repo&&f.jsx("a",{href:((kn=_t.remoteUrl)==null?void 0:kn.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",(c==null?void 0:c.version)||1]})]})]}),H&&f.jsx(IN,{onComplete:()=>{q(!1),xn()}}),O&&f.jsx(aN,{feature:O,onClose:()=>A(null)})]})}d0.createRoot(document.getElementById("root")).render(f.jsx(Cp.StrictMode,{children:f.jsx(KN,{})}));
|