react-state-flow 0.0.3 → 0.1.0
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/LICENSE +21 -0
- package/README.md +56 -18
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +139 -75978
- package/dist/runtime/index.d.ts +22 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +109 -0
- package/package.json +35 -9
- package/dist/ui/assets/index-BZV40eAE.css +0 -1
- package/dist/ui/assets/index-CMEcbN2L.js +0 -62
- package/dist/ui/index.html +0 -17
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Zd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qd={exports:{}},_s={},Jd={exports:{}},te={};/**
|
|
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 bo=Symbol.for("react.element"),Ly=Symbol.for("react.portal"),$y=Symbol.for("react.fragment"),Ry=Symbol.for("react.strict_mode"),Oy=Symbol.for("react.profiler"),by=Symbol.for("react.provider"),Ay=Symbol.for("react.context"),Dy=Symbol.for("react.forward_ref"),jy=Symbol.for("react.suspense"),Fy=Symbol.for("react.memo"),Hy=Symbol.for("react.lazy"),Sc=Symbol.iterator;function Vy(e){return e===null||typeof e!="object"?null:(e=Sc&&e[Sc]||e["@@iterator"],typeof e=="function"?e:null)}var eh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},th=Object.assign,nh={};function Nr(e,t,n){this.props=e,this.context=t,this.refs=nh,this.updater=n||eh}Nr.prototype.isReactComponent={};Nr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Nr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function rh(){}rh.prototype=Nr.prototype;function qu(e,t,n){this.props=e,this.context=t,this.refs=nh,this.updater=n||eh}var Ju=qu.prototype=new rh;Ju.constructor=qu;th(Ju,Nr.prototype);Ju.isPureReactComponent=!0;var kc=Array.isArray,oh=Object.prototype.hasOwnProperty,ea={current:null},ih={key:!0,ref:!0,__self:!0,__source:!0};function sh(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)oh.call(t,r)&&!ih.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var u=Array(l),a=0;a<l;a++)u[a]=arguments[a+2];o.children=u}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:bo,type:e,key:i,ref:s,props:o,_owner:ea.current}}function By(e,t){return{$$typeof:bo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ta(e){return typeof e=="object"&&e!==null&&e.$$typeof===bo}function Wy(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Nc=/\/+/g;function nl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wy(""+e.key):t.toString(36)}function _i(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case bo:case Ly:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+nl(s,0):r,kc(o)?(n="",e!=null&&(n=e.replace(Nc,"$&/")+"/"),_i(o,t,n,"",function(a){return a})):o!=null&&(ta(o)&&(o=By(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Nc,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",kc(e))for(var l=0;l<e.length;l++){i=e[l];var u=r+nl(i,l);s+=_i(i,t,n,u,o)}else if(u=Vy(e),typeof u=="function")for(e=u.call(e),l=0;!(i=e.next()).done;)i=i.value,u=r+nl(i,l++),s+=_i(i,t,n,u,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Ko(e,t,n){if(e==null)return e;var r=[],o=0;return _i(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Uy(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Oe={current:null},Si={transition:null},Yy={ReactCurrentDispatcher:Oe,ReactCurrentBatchConfig:Si,ReactCurrentOwner:ea};function lh(){throw Error("act(...) is not supported in production builds of React.")}te.Children={map:Ko,forEach:function(e,t,n){Ko(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ko(e,function(){t++}),t},toArray:function(e){return Ko(e,function(t){return t})||[]},only:function(e){if(!ta(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};te.Component=Nr;te.Fragment=$y;te.Profiler=Oy;te.PureComponent=qu;te.StrictMode=Ry;te.Suspense=jy;te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yy;te.act=lh;te.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=th({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=ea.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)oh.call(t,u)&&!ih.hasOwnProperty(u)&&(r[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var a=0;a<u;a++)l[a]=arguments[a+2];r.children=l}return{$$typeof:bo,type:e.type,key:o,ref:i,props:r,_owner:s}};te.createContext=function(e){return e={$$typeof:Ay,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:by,_context:e},e.Consumer=e};te.createElement=sh;te.createFactory=function(e){var t=sh.bind(null,e);return t.type=e,t};te.createRef=function(){return{current:null}};te.forwardRef=function(e){return{$$typeof:Dy,render:e}};te.isValidElement=ta;te.lazy=function(e){return{$$typeof:Hy,_payload:{_status:-1,_result:e},_init:Uy}};te.memo=function(e,t){return{$$typeof:Fy,type:e,compare:t===void 0?null:t}};te.startTransition=function(e){var t=Si.transition;Si.transition={};try{e()}finally{Si.transition=t}};te.unstable_act=lh;te.useCallback=function(e,t){return Oe.current.useCallback(e,t)};te.useContext=function(e){return Oe.current.useContext(e)};te.useDebugValue=function(){};te.useDeferredValue=function(e){return Oe.current.useDeferredValue(e)};te.useEffect=function(e,t){return Oe.current.useEffect(e,t)};te.useId=function(){return Oe.current.useId()};te.useImperativeHandle=function(e,t,n){return Oe.current.useImperativeHandle(e,t,n)};te.useInsertionEffect=function(e,t){return Oe.current.useInsertionEffect(e,t)};te.useLayoutEffect=function(e,t){return Oe.current.useLayoutEffect(e,t)};te.useMemo=function(e,t){return Oe.current.useMemo(e,t)};te.useReducer=function(e,t,n){return Oe.current.useReducer(e,t,n)};te.useRef=function(e){return Oe.current.useRef(e)};te.useState=function(e){return Oe.current.useState(e)};te.useSyncExternalStore=function(e,t,n){return Oe.current.useSyncExternalStore(e,t,n)};te.useTransition=function(){return Oe.current.useTransition()};te.version="18.3.1";Jd.exports=te;var O=Jd.exports;const Xy=Zd(O);/**
|
|
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 Qy=O,Gy=Symbol.for("react.element"),Ky=Symbol.for("react.fragment"),Zy=Object.prototype.hasOwnProperty,qy=Qy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Jy={key:!0,ref:!0,__self:!0,__source:!0};function uh(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Zy.call(t,r)&&!Jy.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Gy,type:e,key:i,ref:s,props:o,_owner:qy.current}}_s.Fragment=Ky;_s.jsx=uh;_s.jsxs=uh;qd.exports=_s;var I=qd.exports,ah={exports:{}},Ge={},ch={exports:{}},fh={};/**
|
|
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
|
-
*/(function(e){function t(k,N){var L=k.length;k.push(N);e:for(;0<L;){var j=L-1>>>1,A=k[j];if(0<o(A,N))k[j]=N,k[L]=A,L=j;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var N=k[0],L=k.pop();if(L!==N){k[0]=L;e:for(var j=0,A=k.length,W=A>>>1;j<W;){var B=2*(j+1)-1,X=k[B],Q=B+1,G=k[Q];if(0>o(X,L))Q<A&&0>o(G,X)?(k[j]=G,k[Q]=L,j=Q):(k[j]=X,k[B]=L,j=B);else if(Q<A&&0>o(G,L))k[j]=G,k[Q]=L,j=Q;else break e}}return N}function o(k,N){var L=k.sortIndex-N.sortIndex;return L!==0?L:k.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var u=[],a=[],f=1,c=null,d=3,g=!1,y=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(k){for(var N=n(a);N!==null;){if(N.callback===null)r(a);else if(N.startTime<=k)r(a),N.sortIndex=N.expirationTime,t(u,N);else break;N=n(a)}}function w(k){if(v=!1,p(k),!y)if(n(u)!==null)y=!0,P(E);else{var N=n(a);N!==null&&R(w,N.startTime-k)}}function E(k,N){y=!1,v&&(v=!1,h(M),M=-1),g=!0;var L=d;try{for(p(N),c=n(u);c!==null&&(!(c.expirationTime>N)||k&&!T());){var j=c.callback;if(typeof j=="function"){c.callback=null,d=c.priorityLevel;var A=j(c.expirationTime<=N);N=e.unstable_now(),typeof A=="function"?c.callback=A:c===n(u)&&r(u),p(N)}else r(u);c=n(u)}if(c!==null)var W=!0;else{var B=n(a);B!==null&&R(w,B.startTime-N),W=!1}return W}finally{c=null,d=L,g=!1}}var _=!1,C=null,M=-1,z=5,D=-1;function T(){return!(e.unstable_now()-D<z)}function b(){if(C!==null){var k=e.unstable_now();D=k;var N=!0;try{N=C(!0,k)}finally{N?F():(_=!1,C=null)}}else _=!1}var F;if(typeof m=="function")F=function(){m(b)};else if(typeof MessageChannel<"u"){var S=new MessageChannel,$=S.port2;S.port1.onmessage=b,F=function(){$.postMessage(null)}}else F=function(){x(b,0)};function P(k){C=k,_||(_=!0,F())}function R(k,N){M=x(function(){k(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_continueExecution=function(){y||g||(y=!0,P(E))},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(k){switch(d){case 1:case 2:case 3:var N=3;break;default:N=d}var L=d;d=N;try{return k()}finally{d=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,N){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var L=d;d=k;try{return N()}finally{d=L}},e.unstable_scheduleCallback=function(k,N,L){var j=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?j+L:j):L=j,k){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=L+A,k={id:f++,callback:N,priorityLevel:k,startTime:L,expirationTime:A,sortIndex:-1},L>j?(k.sortIndex=L,t(a,k),n(u)===null&&k===n(a)&&(v?(h(M),M=-1):v=!0,R(w,L-j))):(k.sortIndex=A,t(u,k),y||g||(y=!0,P(E))),k},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(k){var N=d;return function(){var L=d;d=N;try{return k.apply(this,arguments)}finally{d=L}}}})(fh);ch.exports=fh;var ev=ch.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 tv=O,Xe=ev;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var dh=new Set,lo={};function On(e,t){ar(e,t),ar(e+"Capture",t)}function ar(e,t){for(lo[e]=t,e=0;e<t.length;e++)dh.add(t[e])}var Rt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wl=Object.prototype.hasOwnProperty,nv=/^[: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]*$/,Cc={},Mc={};function rv(e){return Wl.call(Mc,e)?!0:Wl.call(Cc,e)?!1:nv.test(e)?Mc[e]=!0:(Cc[e]=!0,!1)}function ov(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function iv(e,t,n,r){if(t===null||typeof t>"u"||ov(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function be(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Me={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Me[e]=new be(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Me[t]=new be(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Me[e]=new be(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Me[e]=new be(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){Me[e]=new be(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Me[e]=new be(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Me[e]=new be(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Me[e]=new be(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Me[e]=new be(e,5,!1,e.toLowerCase(),null,!1,!1)});var na=/[\-:]([a-z])/g;function ra(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 t=e.replace(na,ra);Me[t]=new be(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(na,ra);Me[t]=new be(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(na,ra);Me[t]=new be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Me[e]=new be(e,1,!1,e.toLowerCase(),null,!1,!1)});Me.xlinkHref=new be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Me[e]=new be(e,1,!1,e.toLowerCase(),null,!0,!0)});function oa(e,t,n,r){var o=Me.hasOwnProperty(t)?Me[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(iv(t,n,o,r)&&(n=null),r||o===null?rv(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var jt=tv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Zo=Symbol.for("react.element"),Hn=Symbol.for("react.portal"),Vn=Symbol.for("react.fragment"),ia=Symbol.for("react.strict_mode"),Ul=Symbol.for("react.profiler"),hh=Symbol.for("react.provider"),ph=Symbol.for("react.context"),sa=Symbol.for("react.forward_ref"),Yl=Symbol.for("react.suspense"),Xl=Symbol.for("react.suspense_list"),la=Symbol.for("react.memo"),Ut=Symbol.for("react.lazy"),gh=Symbol.for("react.offscreen"),Ic=Symbol.iterator;function $r(e){return e===null||typeof e!="object"?null:(e=Ic&&e[Ic]||e["@@iterator"],typeof e=="function"?e:null)}var me=Object.assign,rl;function Br(e){if(rl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);rl=t&&t[1]||""}return`
|
|
34
|
-
`+rl+e}var ol=!1;function il(e,t){if(!e||ol)return"";ol=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(a){var r=a}Reflect.construct(e,[],t)}else{try{t.call()}catch(a){r=a}e.call(t.prototype)}else{try{throw Error()}catch(a){r=a}e()}}catch(a){if(a&&r&&typeof a.stack=="string"){for(var o=a.stack.split(`
|
|
35
|
-
`),i=r.stack.split(`
|
|
36
|
-
`),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var u=`
|
|
37
|
-
`+o[s].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=s&&0<=l);break}}}finally{ol=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Br(e):""}function sv(e){switch(e.tag){case 5:return Br(e.type);case 16:return Br("Lazy");case 13:return Br("Suspense");case 19:return Br("SuspenseList");case 0:case 2:case 15:return e=il(e.type,!1),e;case 11:return e=il(e.type.render,!1),e;case 1:return e=il(e.type,!0),e;default:return""}}function Ql(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 Vn:return"Fragment";case Hn:return"Portal";case Ul:return"Profiler";case ia:return"StrictMode";case Yl:return"Suspense";case Xl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ph:return(e.displayName||"Context")+".Consumer";case hh:return(e._context.displayName||"Context")+".Provider";case sa:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case la:return t=e.displayName||null,t!==null?t:Ql(e.type)||"Memo";case Ut:t=e._payload,e=e._init;try{return Ql(e(t))}catch{}}return null}function lv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ql(t);case 8:return t===ia?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function un(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function mh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uv(e){var t=mh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qo(e){e._valueTracker||(e._valueTracker=uv(e))}function yh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=mh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ji(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 Gl(e,t){var n=t.checked;return me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=un(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function vh(e,t){t=t.checked,t!=null&&oa(e,"checked",t,!1)}function Kl(e,t){vh(e,t);var n=un(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Zl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Zl(e,t.type,un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Tc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Zl(e,t,n){(t!=="number"||ji(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wr=Array.isArray;function tr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+un(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function ql(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return me({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function zc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(Wr(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:un(n)}}function wh(e,t){var n=un(t.value),r=un(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Lc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function xh(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 Jl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?xh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Jo,Eh=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Jo=Jo||document.createElement("div"),Jo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Jo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function uo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kr={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},av=["Webkit","ms","Moz","O"];Object.keys(Kr).forEach(function(e){av.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kr[t]=Kr[e]})});function _h(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Kr.hasOwnProperty(e)&&Kr[e]?(""+t).trim():t+"px"}function Sh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=_h(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var cv=me({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 eu(e,t){if(t){if(cv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function tu(e,t){if(e.indexOf("-")===-1)return typeof t.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 nu=null;function ua(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ru=null,nr=null,rr=null;function $c(e){if(e=jo(e)){if(typeof ru!="function")throw Error(H(280));var t=e.stateNode;t&&(t=Ms(t),ru(e.stateNode,e.type,t))}}function kh(e){nr?rr?rr.push(e):rr=[e]:nr=e}function Nh(){if(nr){var e=nr,t=rr;if(rr=nr=null,$c(e),t)for(e=0;e<t.length;e++)$c(t[e])}}function Ch(e,t){return e(t)}function Mh(){}var sl=!1;function Ih(e,t,n){if(sl)return e(t,n);sl=!0;try{return Ch(e,t,n)}finally{sl=!1,(nr!==null||rr!==null)&&(Mh(),Nh())}}function ao(e,t){var n=e.stateNode;if(n===null)return null;var r=Ms(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var ou=!1;if(Rt)try{var Rr={};Object.defineProperty(Rr,"passive",{get:function(){ou=!0}}),window.addEventListener("test",Rr,Rr),window.removeEventListener("test",Rr,Rr)}catch{ou=!1}function fv(e,t,n,r,o,i,s,l,u){var a=Array.prototype.slice.call(arguments,3);try{t.apply(n,a)}catch(f){this.onError(f)}}var Zr=!1,Fi=null,Hi=!1,iu=null,dv={onError:function(e){Zr=!0,Fi=e}};function hv(e,t,n,r,o,i,s,l,u){Zr=!1,Fi=null,fv.apply(dv,arguments)}function pv(e,t,n,r,o,i,s,l,u){if(hv.apply(this,arguments),Zr){if(Zr){var a=Fi;Zr=!1,Fi=null}else throw Error(H(198));Hi||(Hi=!0,iu=a)}}function bn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Ph(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Rc(e){if(bn(e)!==e)throw Error(H(188))}function gv(e){var t=e.alternate;if(!t){if(t=bn(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Rc(o),e;if(i===r)return Rc(o),t;i=i.sibling}throw Error(H(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function Th(e){return e=gv(e),e!==null?zh(e):null}function zh(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=zh(e);if(t!==null)return t;e=e.sibling}return null}var Lh=Xe.unstable_scheduleCallback,Oc=Xe.unstable_cancelCallback,mv=Xe.unstable_shouldYield,yv=Xe.unstable_requestPaint,ve=Xe.unstable_now,vv=Xe.unstable_getCurrentPriorityLevel,aa=Xe.unstable_ImmediatePriority,$h=Xe.unstable_UserBlockingPriority,Vi=Xe.unstable_NormalPriority,wv=Xe.unstable_LowPriority,Rh=Xe.unstable_IdlePriority,Ss=null,Et=null;function xv(e){if(Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(Ss,e,void 0,(e.current.flags&128)===128)}catch{}}var dt=Math.clz32?Math.clz32:Sv,Ev=Math.log,_v=Math.LN2;function Sv(e){return e>>>=0,e===0?32:31-(Ev(e)/_v|0)|0}var ei=64,ti=4194304;function Ur(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 Bi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=Ur(l):(i&=s,i!==0&&(r=Ur(i)))}else s=n&~o,s!==0?r=Ur(s):i!==0&&(r=Ur(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-dt(t),o=1<<n,r|=e[n],t&=~o;return r}function kv(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 Nv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-dt(i),l=1<<s,u=o[s];u===-1?(!(l&n)||l&r)&&(o[s]=kv(l,t)):u<=t&&(e.expiredLanes|=l),i&=~l}}function su(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Oh(){var e=ei;return ei<<=1,!(ei&4194240)&&(ei=64),e}function ll(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ao(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dt(t),e[t]=n}function Cv(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-dt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function ca(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-dt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var se=0;function bh(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ah,fa,Dh,jh,Fh,lu=!1,ni=[],qt=null,Jt=null,en=null,co=new Map,fo=new Map,Xt=[],Mv="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 bc(e,t){switch(e){case"focusin":case"focusout":qt=null;break;case"dragenter":case"dragleave":Jt=null;break;case"mouseover":case"mouseout":en=null;break;case"pointerover":case"pointerout":co.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fo.delete(t.pointerId)}}function Or(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=jo(t),t!==null&&fa(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Iv(e,t,n,r,o){switch(t){case"focusin":return qt=Or(qt,e,t,n,r,o),!0;case"dragenter":return Jt=Or(Jt,e,t,n,r,o),!0;case"mouseover":return en=Or(en,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return co.set(i,Or(co.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,fo.set(i,Or(fo.get(i)||null,e,t,n,r,o)),!0}return!1}function Hh(e){var t=vn(e.target);if(t!==null){var n=bn(t);if(n!==null){if(t=n.tag,t===13){if(t=Ph(n),t!==null){e.blockedOn=t,Fh(e.priority,function(){Dh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ki(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=uu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);nu=r,n.target.dispatchEvent(r),nu=null}else return t=jo(n),t!==null&&fa(t),e.blockedOn=n,!1;t.shift()}return!0}function Ac(e,t,n){ki(e)&&n.delete(t)}function Pv(){lu=!1,qt!==null&&ki(qt)&&(qt=null),Jt!==null&&ki(Jt)&&(Jt=null),en!==null&&ki(en)&&(en=null),co.forEach(Ac),fo.forEach(Ac)}function br(e,t){e.blockedOn===t&&(e.blockedOn=null,lu||(lu=!0,Xe.unstable_scheduleCallback(Xe.unstable_NormalPriority,Pv)))}function ho(e){function t(o){return br(o,e)}if(0<ni.length){br(ni[0],e);for(var n=1;n<ni.length;n++){var r=ni[n];r.blockedOn===e&&(r.blockedOn=null)}}for(qt!==null&&br(qt,e),Jt!==null&&br(Jt,e),en!==null&&br(en,e),co.forEach(t),fo.forEach(t),n=0;n<Xt.length;n++)r=Xt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Xt.length&&(n=Xt[0],n.blockedOn===null);)Hh(n),n.blockedOn===null&&Xt.shift()}var or=jt.ReactCurrentBatchConfig,Wi=!0;function Tv(e,t,n,r){var o=se,i=or.transition;or.transition=null;try{se=1,da(e,t,n,r)}finally{se=o,or.transition=i}}function zv(e,t,n,r){var o=se,i=or.transition;or.transition=null;try{se=4,da(e,t,n,r)}finally{se=o,or.transition=i}}function da(e,t,n,r){if(Wi){var o=uu(e,t,n,r);if(o===null)yl(e,t,r,Ui,n),bc(e,r);else if(Iv(o,e,t,n,r))r.stopPropagation();else if(bc(e,r),t&4&&-1<Mv.indexOf(e)){for(;o!==null;){var i=jo(o);if(i!==null&&Ah(i),i=uu(e,t,n,r),i===null&&yl(e,t,r,Ui,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else yl(e,t,r,null,n)}}var Ui=null;function uu(e,t,n,r){if(Ui=null,e=ua(r),e=vn(e),e!==null)if(t=bn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ph(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ui=e,null}function Vh(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(vv()){case aa:return 1;case $h:return 4;case Vi:case wv:return 16;case Rh:return 536870912;default:return 16}default:return 16}}var Kt=null,ha=null,Ni=null;function Bh(){if(Ni)return Ni;var e,t=ha,n=t.length,r,o="value"in Kt?Kt.value:Kt.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Ni=o.slice(e,1<r?1-r:void 0)}function Ci(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ri(){return!0}function Dc(){return!1}function Ke(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ri:Dc,this.isPropagationStopped=Dc,this}return me(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ri)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ri)},persist:function(){},isPersistent:ri}),t}var Cr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pa=Ke(Cr),Do=me({},Cr,{view:0,detail:0}),Lv=Ke(Do),ul,al,Ar,ks=me({},Do,{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!==Ar&&(Ar&&e.type==="mousemove"?(ul=e.screenX-Ar.screenX,al=e.screenY-Ar.screenY):al=ul=0,Ar=e),ul)},movementY:function(e){return"movementY"in e?e.movementY:al}}),jc=Ke(ks),$v=me({},ks,{dataTransfer:0}),Rv=Ke($v),Ov=me({},Do,{relatedTarget:0}),cl=Ke(Ov),bv=me({},Cr,{animationName:0,elapsedTime:0,pseudoElement:0}),Av=Ke(bv),Dv=me({},Cr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jv=Ke(Dv),Fv=me({},Cr,{data:0}),Fc=Ke(Fv),Hv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vv={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"},Bv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bv[e])?!!t[e]:!1}function ga(){return Wv}var Uv=me({},Do,{key:function(e){if(e.key){var t=Hv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ci(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vv[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"?Ci(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ci(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Yv=Ke(Uv),Xv=me({},ks,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hc=Ke(Xv),Qv=me({},Do,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ga}),Gv=Ke(Qv),Kv=me({},Cr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zv=Ke(Kv),qv=me({},ks,{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}),Jv=Ke(qv),ew=[9,13,27,32],ma=Rt&&"CompositionEvent"in window,qr=null;Rt&&"documentMode"in document&&(qr=document.documentMode);var tw=Rt&&"TextEvent"in window&&!qr,Wh=Rt&&(!ma||qr&&8<qr&&11>=qr),Vc=" ",Bc=!1;function Uh(e,t){switch(e){case"keyup":return ew.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bn=!1;function nw(e,t){switch(e){case"compositionend":return Yh(t);case"keypress":return t.which!==32?null:(Bc=!0,Vc);case"textInput":return e=t.data,e===Vc&&Bc?null:e;default:return null}}function rw(e,t){if(Bn)return e==="compositionend"||!ma&&Uh(e,t)?(e=Bh(),Ni=ha=Kt=null,Bn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Wh&&t.locale!=="ko"?null:t.data;default:return null}}var ow={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 Wc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ow[e.type]:t==="textarea"}function Xh(e,t,n,r){kh(r),t=Yi(t,"onChange"),0<t.length&&(n=new pa("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Jr=null,po=null;function iw(e){op(e,0)}function Ns(e){var t=Yn(e);if(yh(t))return e}function sw(e,t){if(e==="change")return t}var Qh=!1;if(Rt){var fl;if(Rt){var dl="oninput"in document;if(!dl){var Uc=document.createElement("div");Uc.setAttribute("oninput","return;"),dl=typeof Uc.oninput=="function"}fl=dl}else fl=!1;Qh=fl&&(!document.documentMode||9<document.documentMode)}function Yc(){Jr&&(Jr.detachEvent("onpropertychange",Gh),po=Jr=null)}function Gh(e){if(e.propertyName==="value"&&Ns(po)){var t=[];Xh(t,po,e,ua(e)),Ih(iw,t)}}function lw(e,t,n){e==="focusin"?(Yc(),Jr=t,po=n,Jr.attachEvent("onpropertychange",Gh)):e==="focusout"&&Yc()}function uw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ns(po)}function aw(e,t){if(e==="click")return Ns(t)}function cw(e,t){if(e==="input"||e==="change")return Ns(t)}function fw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pt=typeof Object.is=="function"?Object.is:fw;function go(e,t){if(pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Wl.call(t,o)||!pt(e[o],t[o]))return!1}return!0}function Xc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qc(e,t){var n=Xc(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xc(n)}}function Kh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zh(){for(var e=window,t=ji();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ji(e.document)}return t}function ya(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function dw(e){var t=Zh(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Kh(n.ownerDocument.documentElement,n)){if(r!==null&&ya(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Qc(n,i);var s=Qc(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var hw=Rt&&"documentMode"in document&&11>=document.documentMode,Wn=null,au=null,eo=null,cu=!1;function Gc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cu||Wn==null||Wn!==ji(r)||(r=Wn,"selectionStart"in r&&ya(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),eo&&go(eo,r)||(eo=r,r=Yi(au,"onSelect"),0<r.length&&(t=new pa("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Wn)))}function oi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Un={animationend:oi("Animation","AnimationEnd"),animationiteration:oi("Animation","AnimationIteration"),animationstart:oi("Animation","AnimationStart"),transitionend:oi("Transition","TransitionEnd")},hl={},qh={};Rt&&(qh=document.createElement("div").style,"AnimationEvent"in window||(delete Un.animationend.animation,delete Un.animationiteration.animation,delete Un.animationstart.animation),"TransitionEvent"in window||delete Un.transitionend.transition);function Cs(e){if(hl[e])return hl[e];if(!Un[e])return e;var t=Un[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qh)return hl[e]=t[n];return e}var Jh=Cs("animationend"),ep=Cs("animationiteration"),tp=Cs("animationstart"),np=Cs("transitionend"),rp=new Map,Kc="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 fn(e,t){rp.set(e,t),On(t,[e])}for(var pl=0;pl<Kc.length;pl++){var gl=Kc[pl],pw=gl.toLowerCase(),gw=gl[0].toUpperCase()+gl.slice(1);fn(pw,"on"+gw)}fn(Jh,"onAnimationEnd");fn(ep,"onAnimationIteration");fn(tp,"onAnimationStart");fn("dblclick","onDoubleClick");fn("focusin","onFocus");fn("focusout","onBlur");fn(np,"onTransitionEnd");ar("onMouseEnter",["mouseout","mouseover"]);ar("onMouseLeave",["mouseout","mouseover"]);ar("onPointerEnter",["pointerout","pointerover"]);ar("onPointerLeave",["pointerout","pointerover"]);On("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));On("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));On("onBeforeInput",["compositionend","keypress","textInput","paste"]);On("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));On("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));On("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yr="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(" "),mw=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yr));function Zc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,pv(r,t,void 0,e),e.currentTarget=null}function op(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],u=l.instance,a=l.currentTarget;if(l=l.listener,u!==i&&o.isPropagationStopped())break e;Zc(o,l,a),i=u}else for(s=0;s<r.length;s++){if(l=r[s],u=l.instance,a=l.currentTarget,l=l.listener,u!==i&&o.isPropagationStopped())break e;Zc(o,l,a),i=u}}}if(Hi)throw e=iu,Hi=!1,iu=null,e}function ae(e,t){var n=t[gu];n===void 0&&(n=t[gu]=new Set);var r=e+"__bubble";n.has(r)||(ip(t,e,2,!1),n.add(r))}function ml(e,t,n){var r=0;t&&(r|=4),ip(n,e,r,t)}var ii="_reactListening"+Math.random().toString(36).slice(2);function mo(e){if(!e[ii]){e[ii]=!0,dh.forEach(function(n){n!=="selectionchange"&&(mw.has(n)||ml(n,!1,e),ml(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ii]||(t[ii]=!0,ml("selectionchange",!1,t))}}function ip(e,t,n,r){switch(Vh(t)){case 1:var o=Tv;break;case 4:o=zv;break;default:o=da}n=o.bind(null,t,n,e),o=void 0,!ou||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function yl(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var u=s.tag;if((u===3||u===4)&&(u=s.stateNode.containerInfo,u===o||u.nodeType===8&&u.parentNode===o))return;s=s.return}for(;l!==null;){if(s=vn(l),s===null)return;if(u=s.tag,u===5||u===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Ih(function(){var a=i,f=ua(n),c=[];e:{var d=rp.get(e);if(d!==void 0){var g=pa,y=e;switch(e){case"keypress":if(Ci(n)===0)break e;case"keydown":case"keyup":g=Yv;break;case"focusin":y="focus",g=cl;break;case"focusout":y="blur",g=cl;break;case"beforeblur":case"afterblur":g=cl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=jc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Rv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=Gv;break;case Jh:case ep:case tp:g=Av;break;case np:g=Zv;break;case"scroll":g=Lv;break;case"wheel":g=Jv;break;case"copy":case"cut":case"paste":g=jv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Hc}var v=(t&4)!==0,x=!v&&e==="scroll",h=v?d!==null?d+"Capture":null:d;v=[];for(var m=a,p;m!==null;){p=m;var w=p.stateNode;if(p.tag===5&&w!==null&&(p=w,h!==null&&(w=ao(m,h),w!=null&&v.push(yo(m,w,p)))),x)break;m=m.return}0<v.length&&(d=new g(d,y,null,n,f),c.push({event:d,listeners:v}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",d&&n!==nu&&(y=n.relatedTarget||n.fromElement)&&(vn(y)||y[Ot]))break e;if((g||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,g?(y=n.relatedTarget||n.toElement,g=a,y=y?vn(y):null,y!==null&&(x=bn(y),y!==x||y.tag!==5&&y.tag!==6)&&(y=null)):(g=null,y=a),g!==y)){if(v=jc,w="onMouseLeave",h="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=Hc,w="onPointerLeave",h="onPointerEnter",m="pointer"),x=g==null?d:Yn(g),p=y==null?d:Yn(y),d=new v(w,m+"leave",g,n,f),d.target=x,d.relatedTarget=p,w=null,vn(f)===a&&(v=new v(h,m+"enter",y,n,f),v.target=p,v.relatedTarget=x,w=v),x=w,g&&y)t:{for(v=g,h=y,m=0,p=v;p;p=jn(p))m++;for(p=0,w=h;w;w=jn(w))p++;for(;0<m-p;)v=jn(v),m--;for(;0<p-m;)h=jn(h),p--;for(;m--;){if(v===h||h!==null&&v===h.alternate)break t;v=jn(v),h=jn(h)}v=null}else v=null;g!==null&&qc(c,d,g,v,!1),y!==null&&x!==null&&qc(c,x,y,v,!0)}}e:{if(d=a?Yn(a):window,g=d.nodeName&&d.nodeName.toLowerCase(),g==="select"||g==="input"&&d.type==="file")var E=sw;else if(Wc(d))if(Qh)E=cw;else{E=uw;var _=lw}else(g=d.nodeName)&&g.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(E=aw);if(E&&(E=E(e,a))){Xh(c,E,n,f);break e}_&&_(e,d,a),e==="focusout"&&(_=d._wrapperState)&&_.controlled&&d.type==="number"&&Zl(d,"number",d.value)}switch(_=a?Yn(a):window,e){case"focusin":(Wc(_)||_.contentEditable==="true")&&(Wn=_,au=a,eo=null);break;case"focusout":eo=au=Wn=null;break;case"mousedown":cu=!0;break;case"contextmenu":case"mouseup":case"dragend":cu=!1,Gc(c,n,f);break;case"selectionchange":if(hw)break;case"keydown":case"keyup":Gc(c,n,f)}var C;if(ma)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else Bn?Uh(e,n)&&(M="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(M="onCompositionStart");M&&(Wh&&n.locale!=="ko"&&(Bn||M!=="onCompositionStart"?M==="onCompositionEnd"&&Bn&&(C=Bh()):(Kt=f,ha="value"in Kt?Kt.value:Kt.textContent,Bn=!0)),_=Yi(a,M),0<_.length&&(M=new Fc(M,e,null,n,f),c.push({event:M,listeners:_}),C?M.data=C:(C=Yh(n),C!==null&&(M.data=C)))),(C=tw?nw(e,n):rw(e,n))&&(a=Yi(a,"onBeforeInput"),0<a.length&&(f=new Fc("onBeforeInput","beforeinput",null,n,f),c.push({event:f,listeners:a}),f.data=C))}op(c,t)})}function yo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Yi(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=ao(e,n),i!=null&&r.unshift(yo(e,i,o)),i=ao(e,t),i!=null&&r.push(yo(e,i,o))),e=e.return}return r}function jn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function qc(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,u=l.alternate,a=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&a!==null&&(l=a,o?(u=ao(n,i),u!=null&&s.unshift(yo(n,u,l))):o||(u=ao(n,i),u!=null&&s.push(yo(n,u,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var yw=/\r\n?/g,vw=/\u0000|\uFFFD/g;function Jc(e){return(typeof e=="string"?e:""+e).replace(yw,`
|
|
38
|
-
`).replace(vw,"")}function si(e,t,n){if(t=Jc(t),Jc(e)!==t&&n)throw Error(H(425))}function Xi(){}var fu=null,du=null;function hu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var pu=typeof setTimeout=="function"?setTimeout:void 0,ww=typeof clearTimeout=="function"?clearTimeout:void 0,ef=typeof Promise=="function"?Promise:void 0,xw=typeof queueMicrotask=="function"?queueMicrotask:typeof ef<"u"?function(e){return ef.resolve(null).then(e).catch(Ew)}:pu;function Ew(e){setTimeout(function(){throw e})}function vl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),ho(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ho(t)}function tn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function tf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Mr=Math.random().toString(36).slice(2),wt="__reactFiber$"+Mr,vo="__reactProps$"+Mr,Ot="__reactContainer$"+Mr,gu="__reactEvents$"+Mr,_w="__reactListeners$"+Mr,Sw="__reactHandles$"+Mr;function vn(e){var t=e[wt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ot]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=tf(e);e!==null;){if(n=e[wt])return n;e=tf(e)}return t}e=n,n=e.parentNode}return null}function jo(e){return e=e[wt]||e[Ot],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Yn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function Ms(e){return e[vo]||null}var mu=[],Xn=-1;function dn(e){return{current:e}}function ce(e){0>Xn||(e.current=mu[Xn],mu[Xn]=null,Xn--)}function le(e,t){Xn++,mu[Xn]=e.current,e.current=t}var an={},Le=dn(an),Fe=dn(!1),Cn=an;function cr(e,t){var n=e.type.contextTypes;if(!n)return an;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function He(e){return e=e.childContextTypes,e!=null}function Qi(){ce(Fe),ce(Le)}function nf(e,t,n){if(Le.current!==an)throw Error(H(168));le(Le,t),le(Fe,n)}function sp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(H(108,lv(e)||"Unknown",o));return me({},n,r)}function Gi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||an,Cn=Le.current,le(Le,e),le(Fe,Fe.current),!0}function rf(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=sp(e,t,Cn),r.__reactInternalMemoizedMergedChildContext=e,ce(Fe),ce(Le),le(Le,e)):ce(Fe),le(Fe,n)}var Pt=null,Is=!1,wl=!1;function lp(e){Pt===null?Pt=[e]:Pt.push(e)}function kw(e){Is=!0,lp(e)}function hn(){if(!wl&&Pt!==null){wl=!0;var e=0,t=se;try{var n=Pt;for(se=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Pt=null,Is=!1}catch(o){throw Pt!==null&&(Pt=Pt.slice(e+1)),Lh(aa,hn),o}finally{se=t,wl=!1}}return null}var Qn=[],Gn=0,Ki=null,Zi=0,Ze=[],qe=0,Mn=null,Tt=1,zt="";function gn(e,t){Qn[Gn++]=Zi,Qn[Gn++]=Ki,Ki=e,Zi=t}function up(e,t,n){Ze[qe++]=Tt,Ze[qe++]=zt,Ze[qe++]=Mn,Mn=e;var r=Tt;e=zt;var o=32-dt(r)-1;r&=~(1<<o),n+=1;var i=32-dt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Tt=1<<32-dt(t)+o|n<<o|r,zt=i+e}else Tt=1<<i|n<<o|r,zt=e}function va(e){e.return!==null&&(gn(e,1),up(e,1,0))}function wa(e){for(;e===Ki;)Ki=Qn[--Gn],Qn[Gn]=null,Zi=Qn[--Gn],Qn[Gn]=null;for(;e===Mn;)Mn=Ze[--qe],Ze[qe]=null,zt=Ze[--qe],Ze[qe]=null,Tt=Ze[--qe],Ze[qe]=null}var Ye=null,Ue=null,fe=!1,ut=null;function ap(e,t){var n=Je(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function of(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ye=e,Ue=tn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ye=e,Ue=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Mn!==null?{id:Tt,overflow:zt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Je(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ye=e,Ue=null,!0):!1;default:return!1}}function yu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function vu(e){if(fe){var t=Ue;if(t){var n=t;if(!of(e,t)){if(yu(e))throw Error(H(418));t=tn(n.nextSibling);var r=Ye;t&&of(e,t)?ap(r,n):(e.flags=e.flags&-4097|2,fe=!1,Ye=e)}}else{if(yu(e))throw Error(H(418));e.flags=e.flags&-4097|2,fe=!1,Ye=e}}}function sf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ye=e}function li(e){if(e!==Ye)return!1;if(!fe)return sf(e),fe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!hu(e.type,e.memoizedProps)),t&&(t=Ue)){if(yu(e))throw cp(),Error(H(418));for(;t;)ap(e,t),t=tn(t.nextSibling)}if(sf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ue=tn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ue=null}}else Ue=Ye?tn(e.stateNode.nextSibling):null;return!0}function cp(){for(var e=Ue;e;)e=tn(e.nextSibling)}function fr(){Ue=Ye=null,fe=!1}function xa(e){ut===null?ut=[e]:ut.push(e)}var Nw=jt.ReactCurrentBatchConfig;function Dr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function ui(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function lf(e){var t=e._init;return t(e._payload)}function fp(e){function t(h,m){if(e){var p=h.deletions;p===null?(h.deletions=[m],h.flags|=16):p.push(m)}}function n(h,m){if(!e)return null;for(;m!==null;)t(h,m),m=m.sibling;return null}function r(h,m){for(h=new Map;m!==null;)m.key!==null?h.set(m.key,m):h.set(m.index,m),m=m.sibling;return h}function o(h,m){return h=sn(h,m),h.index=0,h.sibling=null,h}function i(h,m,p){return h.index=p,e?(p=h.alternate,p!==null?(p=p.index,p<m?(h.flags|=2,m):p):(h.flags|=2,m)):(h.flags|=1048576,m)}function s(h){return e&&h.alternate===null&&(h.flags|=2),h}function l(h,m,p,w){return m===null||m.tag!==6?(m=Cl(p,h.mode,w),m.return=h,m):(m=o(m,p),m.return=h,m)}function u(h,m,p,w){var E=p.type;return E===Vn?f(h,m,p.props.children,w,p.key):m!==null&&(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ut&&lf(E)===m.type)?(w=o(m,p.props),w.ref=Dr(h,m,p),w.return=h,w):(w=$i(p.type,p.key,p.props,null,h.mode,w),w.ref=Dr(h,m,p),w.return=h,w)}function a(h,m,p,w){return m===null||m.tag!==4||m.stateNode.containerInfo!==p.containerInfo||m.stateNode.implementation!==p.implementation?(m=Ml(p,h.mode,w),m.return=h,m):(m=o(m,p.children||[]),m.return=h,m)}function f(h,m,p,w,E){return m===null||m.tag!==7?(m=Sn(p,h.mode,w,E),m.return=h,m):(m=o(m,p),m.return=h,m)}function c(h,m,p){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Cl(""+m,h.mode,p),m.return=h,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Zo:return p=$i(m.type,m.key,m.props,null,h.mode,p),p.ref=Dr(h,null,m),p.return=h,p;case Hn:return m=Ml(m,h.mode,p),m.return=h,m;case Ut:var w=m._init;return c(h,w(m._payload),p)}if(Wr(m)||$r(m))return m=Sn(m,h.mode,p,null),m.return=h,m;ui(h,m)}return null}function d(h,m,p,w){var E=m!==null?m.key:null;if(typeof p=="string"&&p!==""||typeof p=="number")return E!==null?null:l(h,m,""+p,w);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Zo:return p.key===E?u(h,m,p,w):null;case Hn:return p.key===E?a(h,m,p,w):null;case Ut:return E=p._init,d(h,m,E(p._payload),w)}if(Wr(p)||$r(p))return E!==null?null:f(h,m,p,w,null);ui(h,p)}return null}function g(h,m,p,w,E){if(typeof w=="string"&&w!==""||typeof w=="number")return h=h.get(p)||null,l(m,h,""+w,E);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Zo:return h=h.get(w.key===null?p:w.key)||null,u(m,h,w,E);case Hn:return h=h.get(w.key===null?p:w.key)||null,a(m,h,w,E);case Ut:var _=w._init;return g(h,m,p,_(w._payload),E)}if(Wr(w)||$r(w))return h=h.get(p)||null,f(m,h,w,E,null);ui(m,w)}return null}function y(h,m,p,w){for(var E=null,_=null,C=m,M=m=0,z=null;C!==null&&M<p.length;M++){C.index>M?(z=C,C=null):z=C.sibling;var D=d(h,C,p[M],w);if(D===null){C===null&&(C=z);break}e&&C&&D.alternate===null&&t(h,C),m=i(D,m,M),_===null?E=D:_.sibling=D,_=D,C=z}if(M===p.length)return n(h,C),fe&&gn(h,M),E;if(C===null){for(;M<p.length;M++)C=c(h,p[M],w),C!==null&&(m=i(C,m,M),_===null?E=C:_.sibling=C,_=C);return fe&&gn(h,M),E}for(C=r(h,C);M<p.length;M++)z=g(C,h,M,p[M],w),z!==null&&(e&&z.alternate!==null&&C.delete(z.key===null?M:z.key),m=i(z,m,M),_===null?E=z:_.sibling=z,_=z);return e&&C.forEach(function(T){return t(h,T)}),fe&&gn(h,M),E}function v(h,m,p,w){var E=$r(p);if(typeof E!="function")throw Error(H(150));if(p=E.call(p),p==null)throw Error(H(151));for(var _=E=null,C=m,M=m=0,z=null,D=p.next();C!==null&&!D.done;M++,D=p.next()){C.index>M?(z=C,C=null):z=C.sibling;var T=d(h,C,D.value,w);if(T===null){C===null&&(C=z);break}e&&C&&T.alternate===null&&t(h,C),m=i(T,m,M),_===null?E=T:_.sibling=T,_=T,C=z}if(D.done)return n(h,C),fe&&gn(h,M),E;if(C===null){for(;!D.done;M++,D=p.next())D=c(h,D.value,w),D!==null&&(m=i(D,m,M),_===null?E=D:_.sibling=D,_=D);return fe&&gn(h,M),E}for(C=r(h,C);!D.done;M++,D=p.next())D=g(C,h,M,D.value,w),D!==null&&(e&&D.alternate!==null&&C.delete(D.key===null?M:D.key),m=i(D,m,M),_===null?E=D:_.sibling=D,_=D);return e&&C.forEach(function(b){return t(h,b)}),fe&&gn(h,M),E}function x(h,m,p,w){if(typeof p=="object"&&p!==null&&p.type===Vn&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Zo:e:{for(var E=p.key,_=m;_!==null;){if(_.key===E){if(E=p.type,E===Vn){if(_.tag===7){n(h,_.sibling),m=o(_,p.props.children),m.return=h,h=m;break e}}else if(_.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ut&&lf(E)===_.type){n(h,_.sibling),m=o(_,p.props),m.ref=Dr(h,_,p),m.return=h,h=m;break e}n(h,_);break}else t(h,_);_=_.sibling}p.type===Vn?(m=Sn(p.props.children,h.mode,w,p.key),m.return=h,h=m):(w=$i(p.type,p.key,p.props,null,h.mode,w),w.ref=Dr(h,m,p),w.return=h,h=w)}return s(h);case Hn:e:{for(_=p.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===p.containerInfo&&m.stateNode.implementation===p.implementation){n(h,m.sibling),m=o(m,p.children||[]),m.return=h,h=m;break e}else{n(h,m);break}else t(h,m);m=m.sibling}m=Ml(p,h.mode,w),m.return=h,h=m}return s(h);case Ut:return _=p._init,x(h,m,_(p._payload),w)}if(Wr(p))return y(h,m,p,w);if($r(p))return v(h,m,p,w);ui(h,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,m!==null&&m.tag===6?(n(h,m.sibling),m=o(m,p),m.return=h,h=m):(n(h,m),m=Cl(p,h.mode,w),m.return=h,h=m),s(h)):n(h,m)}return x}var dr=fp(!0),dp=fp(!1),qi=dn(null),Ji=null,Kn=null,Ea=null;function _a(){Ea=Kn=Ji=null}function Sa(e){var t=qi.current;ce(qi),e._currentValue=t}function wu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ir(e,t){Ji=e,Ea=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(De=!0),e.firstContext=null)}function tt(e){var t=e._currentValue;if(Ea!==e)if(e={context:e,memoizedValue:t,next:null},Kn===null){if(Ji===null)throw Error(H(308));Kn=e,Ji.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return t}var wn=null;function ka(e){wn===null?wn=[e]:wn.push(e)}function hp(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,ka(t)):(n.next=o.next,o.next=n),t.interleaved=n,bt(e,r)}function bt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Yt=!1;function Na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function pp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function $t(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function nn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,re&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,bt(e,n)}return o=r.interleaved,o===null?(t.next=t,ka(r)):(t.next=o.next,o.next=t),r.interleaved=t,bt(e,n)}function Mi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ca(e,n)}}function uf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function es(e,t,n,r){var o=e.updateQueue;Yt=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var u=l,a=u.next;u.next=null,s===null?i=a:s.next=a,s=u;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==s&&(l===null?f.firstBaseUpdate=a:l.next=a,f.lastBaseUpdate=u))}if(i!==null){var c=o.baseState;s=0,f=a=u=null,l=i;do{var d=l.lane,g=l.eventTime;if((r&d)===d){f!==null&&(f=f.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,v=l;switch(d=t,g=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){c=y.call(g,c,d);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,d=typeof y=="function"?y.call(g,c,d):y,d==null)break e;c=me({},c,d);break e;case 2:Yt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,d=o.effects,d===null?o.effects=[l]:d.push(l))}else g={eventTime:g,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(a=f=g,u=c):f=f.next=g,s|=d;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;d=l,l=d.next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}while(!0);if(f===null&&(u=c),o.baseState=u,o.firstBaseUpdate=a,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Pn|=s,e.lanes=s,e.memoizedState=c}}function af(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(H(191,o));o.call(r)}}}var Fo={},_t=dn(Fo),wo=dn(Fo),xo=dn(Fo);function xn(e){if(e===Fo)throw Error(H(174));return e}function Ca(e,t){switch(le(xo,t),le(wo,e),le(_t,Fo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Jl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Jl(t,e)}ce(_t),le(_t,t)}function hr(){ce(_t),ce(wo),ce(xo)}function gp(e){xn(xo.current);var t=xn(_t.current),n=Jl(t,e.type);t!==n&&(le(wo,e),le(_t,n))}function Ma(e){wo.current===e&&(ce(_t),ce(wo))}var pe=dn(0);function ts(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var xl=[];function Ia(){for(var e=0;e<xl.length;e++)xl[e]._workInProgressVersionPrimary=null;xl.length=0}var Ii=jt.ReactCurrentDispatcher,El=jt.ReactCurrentBatchConfig,In=0,ge=null,Ee=null,Se=null,ns=!1,to=!1,Eo=0,Cw=0;function Pe(){throw Error(H(321))}function Pa(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!pt(e[n],t[n]))return!1;return!0}function Ta(e,t,n,r,o,i){if(In=i,ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ii.current=e===null||e.memoizedState===null?Tw:zw,e=n(r,o),to){i=0;do{if(to=!1,Eo=0,25<=i)throw Error(H(301));i+=1,Se=Ee=null,t.updateQueue=null,Ii.current=Lw,e=n(r,o)}while(to)}if(Ii.current=rs,t=Ee!==null&&Ee.next!==null,In=0,Se=Ee=ge=null,ns=!1,t)throw Error(H(300));return e}function za(){var e=Eo!==0;return Eo=0,e}function yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Se===null?ge.memoizedState=Se=e:Se=Se.next=e,Se}function nt(){if(Ee===null){var e=ge.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=Se===null?ge.memoizedState:Se.next;if(t!==null)Se=t,Ee=e;else{if(e===null)throw Error(H(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Se===null?ge.memoizedState=Se=e:Se=Se.next=e}return Se}function _o(e,t){return typeof t=="function"?t(e):t}function _l(e){var t=nt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=Ee,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,u=null,a=i;do{var f=a.lane;if((In&f)===f)u!==null&&(u=u.next={lane:0,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null}),r=a.hasEagerState?a.eagerState:e(r,a.action);else{var c={lane:f,action:a.action,hasEagerState:a.hasEagerState,eagerState:a.eagerState,next:null};u===null?(l=u=c,s=r):u=u.next=c,ge.lanes|=f,Pn|=f}a=a.next}while(a!==null&&a!==i);u===null?s=r:u.next=l,pt(r,t.memoizedState)||(De=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=u,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,ge.lanes|=i,Pn|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Sl(e){var t=nt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);pt(i,t.memoizedState)||(De=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function mp(){}function yp(e,t){var n=ge,r=nt(),o=t(),i=!pt(r.memoizedState,o);if(i&&(r.memoizedState=o,De=!0),r=r.queue,La(xp.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Se!==null&&Se.memoizedState.tag&1){if(n.flags|=2048,So(9,wp.bind(null,n,r,o,t),void 0,null),ke===null)throw Error(H(349));In&30||vp(n,t,o)}return o}function vp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ge.updateQueue,t===null?(t={lastEffect:null,stores:null},ge.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function wp(e,t,n,r){t.value=n,t.getSnapshot=r,Ep(t)&&_p(e)}function xp(e,t,n){return n(function(){Ep(t)&&_p(e)})}function Ep(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pt(e,n)}catch{return!0}}function _p(e){var t=bt(e,1);t!==null&&ht(t,e,1,-1)}function cf(e){var t=yt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_o,lastRenderedState:e},t.queue=e,e=e.dispatch=Pw.bind(null,ge,e),[t.memoizedState,e]}function So(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ge.updateQueue,t===null?(t={lastEffect:null,stores:null},ge.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Sp(){return nt().memoizedState}function Pi(e,t,n,r){var o=yt();ge.flags|=e,o.memoizedState=So(1|t,n,void 0,r===void 0?null:r)}function Ps(e,t,n,r){var o=nt();r=r===void 0?null:r;var i=void 0;if(Ee!==null){var s=Ee.memoizedState;if(i=s.destroy,r!==null&&Pa(r,s.deps)){o.memoizedState=So(t,n,i,r);return}}ge.flags|=e,o.memoizedState=So(1|t,n,i,r)}function ff(e,t){return Pi(8390656,8,e,t)}function La(e,t){return Ps(2048,8,e,t)}function kp(e,t){return Ps(4,2,e,t)}function Np(e,t){return Ps(4,4,e,t)}function Cp(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Mp(e,t,n){return n=n!=null?n.concat([e]):null,Ps(4,4,Cp.bind(null,t,e),n)}function $a(){}function Ip(e,t){var n=nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Pa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Pp(e,t){var n=nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Pa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Tp(e,t,n){return In&21?(pt(n,t)||(n=Oh(),ge.lanes|=n,Pn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,De=!0),e.memoizedState=n)}function Mw(e,t){var n=se;se=n!==0&&4>n?n:4,e(!0);var r=El.transition;El.transition={};try{e(!1),t()}finally{se=n,El.transition=r}}function zp(){return nt().memoizedState}function Iw(e,t,n){var r=on(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Lp(e))$p(t,n);else if(n=hp(e,t,n,r),n!==null){var o=Re();ht(n,e,r,o),Rp(n,t,r)}}function Pw(e,t,n){var r=on(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Lp(e))$p(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,pt(l,s)){var u=t.interleaved;u===null?(o.next=o,ka(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=hp(e,t,o,r),n!==null&&(o=Re(),ht(n,e,r,o),Rp(n,t,r))}}function Lp(e){var t=e.alternate;return e===ge||t!==null&&t===ge}function $p(e,t){to=ns=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ca(e,n)}}var rs={readContext:tt,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useInsertionEffect:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useMutableSource:Pe,useSyncExternalStore:Pe,useId:Pe,unstable_isNewReconciler:!1},Tw={readContext:tt,useCallback:function(e,t){return yt().memoizedState=[e,t===void 0?null:t],e},useContext:tt,useEffect:ff,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Pi(4194308,4,Cp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Pi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pi(4,2,e,t)},useMemo:function(e,t){var n=yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=yt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Iw.bind(null,ge,e),[r.memoizedState,e]},useRef:function(e){var t=yt();return e={current:e},t.memoizedState=e},useState:cf,useDebugValue:$a,useDeferredValue:function(e){return yt().memoizedState=e},useTransition:function(){var e=cf(!1),t=e[0];return e=Mw.bind(null,e[1]),yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ge,o=yt();if(fe){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),ke===null)throw Error(H(349));In&30||vp(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,ff(xp.bind(null,r,i,e),[e]),r.flags|=2048,So(9,wp.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=yt(),t=ke.identifierPrefix;if(fe){var n=zt,r=Tt;n=(r&~(1<<32-dt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Eo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Cw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},zw={readContext:tt,useCallback:Ip,useContext:tt,useEffect:La,useImperativeHandle:Mp,useInsertionEffect:kp,useLayoutEffect:Np,useMemo:Pp,useReducer:_l,useRef:Sp,useState:function(){return _l(_o)},useDebugValue:$a,useDeferredValue:function(e){var t=nt();return Tp(t,Ee.memoizedState,e)},useTransition:function(){var e=_l(_o)[0],t=nt().memoizedState;return[e,t]},useMutableSource:mp,useSyncExternalStore:yp,useId:zp,unstable_isNewReconciler:!1},Lw={readContext:tt,useCallback:Ip,useContext:tt,useEffect:La,useImperativeHandle:Mp,useInsertionEffect:kp,useLayoutEffect:Np,useMemo:Pp,useReducer:Sl,useRef:Sp,useState:function(){return Sl(_o)},useDebugValue:$a,useDeferredValue:function(e){var t=nt();return Ee===null?t.memoizedState=e:Tp(t,Ee.memoizedState,e)},useTransition:function(){var e=Sl(_o)[0],t=nt().memoizedState;return[e,t]},useMutableSource:mp,useSyncExternalStore:yp,useId:zp,unstable_isNewReconciler:!1};function it(e,t){if(e&&e.defaultProps){t=me({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function xu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:me({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ts={isMounted:function(e){return(e=e._reactInternals)?bn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Re(),o=on(e),i=$t(r,o);i.payload=t,n!=null&&(i.callback=n),t=nn(e,i,o),t!==null&&(ht(t,e,o,r),Mi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Re(),o=on(e),i=$t(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=nn(e,i,o),t!==null&&(ht(t,e,o,r),Mi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Re(),r=on(e),o=$t(n,r);o.tag=2,t!=null&&(o.callback=t),t=nn(e,o,r),t!==null&&(ht(t,e,r,n),Mi(t,e,r))}};function df(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!go(n,r)||!go(o,i):!0}function Op(e,t,n){var r=!1,o=an,i=t.contextType;return typeof i=="object"&&i!==null?i=tt(i):(o=He(t)?Cn:Le.current,r=t.contextTypes,i=(r=r!=null)?cr(e,o):an),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ts,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function hf(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ts.enqueueReplaceState(t,t.state,null)}function Eu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Na(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=tt(i):(i=He(t)?Cn:Le.current,o.context=cr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(xu(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Ts.enqueueReplaceState(o,o.state,null),es(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function pr(e,t){try{var n="",r=t;do n+=sv(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
39
|
-
Error generating stack: `+i.message+`
|
|
40
|
-
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function kl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function _u(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $w=typeof WeakMap=="function"?WeakMap:Map;function bp(e,t,n){n=$t(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){is||(is=!0,Lu=r),_u(e,t)},n}function Ap(e,t,n){n=$t(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){_u(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){_u(e,t),typeof r!="function"&&(rn===null?rn=new Set([this]):rn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $w;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Xw.bind(null,e,t,n),t.then(e,e))}function gf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function mf(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=$t(-1,1),t.tag=2,nn(n,t,1))),n.lanes|=1),e)}var Rw=jt.ReactCurrentOwner,De=!1;function $e(e,t,n,r){t.child=e===null?dp(t,null,n,r):dr(t,e.child,n,r)}function yf(e,t,n,r,o){n=n.render;var i=t.ref;return ir(t,o),r=Ta(e,t,n,r,i,o),n=za(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,At(e,t,o)):(fe&&n&&va(t),t.flags|=1,$e(e,t,r,o),t.child)}function vf(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Ha(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Dp(e,t,i,r,o)):(e=$i(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:go,n(s,r)&&e.ref===t.ref)return At(e,t,o)}return t.flags|=1,e=sn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Dp(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(go(i,r)&&e.ref===t.ref)if(De=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(De=!0);else return t.lanes=e.lanes,At(e,t,o)}return Su(e,t,n,r,o)}function jp(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},le(qn,Be),Be|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,le(qn,Be),Be|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,le(qn,Be),Be|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,le(qn,Be),Be|=r;return $e(e,t,o,n),t.child}function Fp(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Su(e,t,n,r,o){var i=He(n)?Cn:Le.current;return i=cr(t,i),ir(t,o),n=Ta(e,t,n,r,i,o),r=za(),e!==null&&!De?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,At(e,t,o)):(fe&&r&&va(t),t.flags|=1,$e(e,t,n,o),t.child)}function wf(e,t,n,r,o){if(He(n)){var i=!0;Gi(t)}else i=!1;if(ir(t,o),t.stateNode===null)Ti(e,t),Op(t,n,r),Eu(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var u=s.context,a=n.contextType;typeof a=="object"&&a!==null?a=tt(a):(a=He(n)?Cn:Le.current,a=cr(t,a));var f=n.getDerivedStateFromProps,c=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";c||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||u!==a)&&hf(t,s,r,a),Yt=!1;var d=t.memoizedState;s.state=d,es(t,r,s,o),u=t.memoizedState,l!==r||d!==u||Fe.current||Yt?(typeof f=="function"&&(xu(t,n,f,r),u=t.memoizedState),(l=Yt||df(t,n,l,r,d,u,a))?(c||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),s.props=r,s.state=u,s.context=a,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,pp(e,t),l=t.memoizedProps,a=t.type===t.elementType?l:it(t.type,l),s.props=a,c=t.pendingProps,d=s.context,u=n.contextType,typeof u=="object"&&u!==null?u=tt(u):(u=He(n)?Cn:Le.current,u=cr(t,u));var g=n.getDerivedStateFromProps;(f=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==c||d!==u)&&hf(t,s,r,u),Yt=!1,d=t.memoizedState,s.state=d,es(t,r,s,o);var y=t.memoizedState;l!==c||d!==y||Fe.current||Yt?(typeof g=="function"&&(xu(t,n,g,r),y=t.memoizedState),(a=Yt||df(t,n,a,r,d,y,u)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,u),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,u)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=u,r=a):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return ku(e,t,n,r,i,o)}function ku(e,t,n,r,o,i){Fp(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&rf(t,n,!1),At(e,t,i);r=t.stateNode,Rw.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=dr(t,e.child,null,i),t.child=dr(t,null,l,i)):$e(e,t,l,i),t.memoizedState=r.state,o&&rf(t,n,!0),t.child}function Hp(e){var t=e.stateNode;t.pendingContext?nf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nf(e,t.context,!1),Ca(e,t.containerInfo)}function xf(e,t,n,r,o){return fr(),xa(o),t.flags|=256,$e(e,t,n,r),t.child}var Nu={dehydrated:null,treeContext:null,retryLane:0};function Cu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Vp(e,t,n){var r=t.pendingProps,o=pe.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),le(pe,o&1),e===null)return vu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=$s(s,r,0,null),e=Sn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Cu(n),t.memoizedState=Nu,e):Ra(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return Ow(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var u={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=sn(o,u),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=sn(l,i):(i=Sn(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Cu(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Nu,r}return i=e.child,e=i.sibling,r=sn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ra(e,t){return t=$s({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ai(e,t,n,r){return r!==null&&xa(r),dr(t,e.child,null,n),e=Ra(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ow(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=kl(Error(H(422))),ai(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=$s({mode:"visible",children:r.children},o,0,null),i=Sn(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&dr(t,e.child,null,s),t.child.memoizedState=Cu(s),t.memoizedState=Nu,i);if(!(t.mode&1))return ai(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(H(419)),r=kl(i,r,void 0),ai(e,t,s,r)}if(l=(s&e.childLanes)!==0,De||l){if(r=ke,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,bt(e,o),ht(r,e,o,-1))}return Fa(),r=kl(Error(H(421))),ai(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Qw.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ue=tn(o.nextSibling),Ye=t,fe=!0,ut=null,e!==null&&(Ze[qe++]=Tt,Ze[qe++]=zt,Ze[qe++]=Mn,Tt=e.id,zt=e.overflow,Mn=t),t=Ra(t,r.children),t.flags|=4096,t)}function Ef(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),wu(e.return,t,n)}function Nl(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Bp(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if($e(e,t,r.children,n),r=pe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ef(e,n,t);else if(e.tag===19)Ef(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(le(pe,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&ts(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Nl(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&ts(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Nl(t,!0,n,null,i);break;case"together":Nl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ti(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function At(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Pn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=sn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=sn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function bw(e,t,n){switch(t.tag){case 3:Hp(t),fr();break;case 5:gp(t);break;case 1:He(t.type)&&Gi(t);break;case 4:Ca(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;le(qi,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(le(pe,pe.current&1),t.flags|=128,null):n&t.child.childLanes?Vp(e,t,n):(le(pe,pe.current&1),e=At(e,t,n),e!==null?e.sibling:null);le(pe,pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Bp(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),le(pe,pe.current),r)break;return null;case 22:case 23:return t.lanes=0,jp(e,t,n)}return At(e,t,n)}var Wp,Mu,Up,Yp;Wp=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Mu=function(){};Up=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,xn(_t.current);var i=null;switch(n){case"input":o=Gl(e,o),r=Gl(e,r),i=[];break;case"select":o=me({},o,{value:void 0}),r=me({},r,{value:void 0}),i=[];break;case"textarea":o=ql(e,o),r=ql(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Xi)}eu(n,r);var s;n=null;for(a in o)if(!r.hasOwnProperty(a)&&o.hasOwnProperty(a)&&o[a]!=null)if(a==="style"){var l=o[a];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(lo.hasOwnProperty(a)?i||(i=[]):(i=i||[]).push(a,null));for(a in r){var u=r[a];if(l=o!=null?o[a]:void 0,r.hasOwnProperty(a)&&u!==l&&(u!=null||l!=null))if(a==="style")if(l){for(s in l)!l.hasOwnProperty(s)||u&&u.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in u)u.hasOwnProperty(s)&&l[s]!==u[s]&&(n||(n={}),n[s]=u[s])}else n||(i||(i=[]),i.push(a,n)),n=u;else a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(i=i||[]).push(a,u)):a==="children"?typeof u!="string"&&typeof u!="number"||(i=i||[]).push(a,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(lo.hasOwnProperty(a)?(u!=null&&a==="onScroll"&&ae("scroll",e),i||l===u||(i=[])):(i=i||[]).push(a,u))}n&&(i=i||[]).push("style",n);var a=i;(t.updateQueue=a)&&(t.flags|=4)}};Yp=function(e,t,n,r){n!==r&&(t.flags|=4)};function jr(e,t){if(!fe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Te(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Aw(e,t,n){var r=t.pendingProps;switch(wa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Te(t),null;case 1:return He(t.type)&&Qi(),Te(t),null;case 3:return r=t.stateNode,hr(),ce(Fe),ce(Le),Ia(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(li(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ut!==null&&(Ou(ut),ut=null))),Mu(e,t),Te(t),null;case 5:Ma(t);var o=xn(xo.current);if(n=t.type,e!==null&&t.stateNode!=null)Up(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Te(t),null}if(e=xn(_t.current),li(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[wt]=t,r[vo]=i,e=(t.mode&1)!==0,n){case"dialog":ae("cancel",r),ae("close",r);break;case"iframe":case"object":case"embed":ae("load",r);break;case"video":case"audio":for(o=0;o<Yr.length;o++)ae(Yr[o],r);break;case"source":ae("error",r);break;case"img":case"image":case"link":ae("error",r),ae("load",r);break;case"details":ae("toggle",r);break;case"input":Pc(r,i),ae("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ae("invalid",r);break;case"textarea":zc(r,i),ae("invalid",r)}eu(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&si(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&si(r.textContent,l,e),o=["children",""+l]):lo.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&ae("scroll",r)}switch(n){case"input":qo(r),Tc(r,i,!0);break;case"textarea":qo(r),Lc(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Xi)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=xh(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[wt]=t,e[vo]=r,Wp(e,t,!1,!1),t.stateNode=e;e:{switch(s=tu(n,r),n){case"dialog":ae("cancel",e),ae("close",e),o=r;break;case"iframe":case"object":case"embed":ae("load",e),o=r;break;case"video":case"audio":for(o=0;o<Yr.length;o++)ae(Yr[o],e);o=r;break;case"source":ae("error",e),o=r;break;case"img":case"image":case"link":ae("error",e),ae("load",e),o=r;break;case"details":ae("toggle",e),o=r;break;case"input":Pc(e,r),o=Gl(e,r),ae("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=me({},r,{value:void 0}),ae("invalid",e);break;case"textarea":zc(e,r),o=ql(e,r),ae("invalid",e);break;default:o=r}eu(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var u=l[i];i==="style"?Sh(e,u):i==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&Eh(e,u)):i==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&uo(e,u):typeof u=="number"&&uo(e,""+u):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(lo.hasOwnProperty(i)?u!=null&&i==="onScroll"&&ae("scroll",e):u!=null&&oa(e,i,u,s))}switch(n){case"input":qo(e),Tc(e,r,!1);break;case"textarea":qo(e),Lc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+un(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?tr(e,!!r.multiple,i,!1):r.defaultValue!=null&&tr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Xi)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Te(t),null;case 6:if(e&&t.stateNode!=null)Yp(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=xn(xo.current),xn(_t.current),li(t)){if(r=t.stateNode,n=t.memoizedProps,r[wt]=t,(i=r.nodeValue!==n)&&(e=Ye,e!==null))switch(e.tag){case 3:si(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&si(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[wt]=t,t.stateNode=r}return Te(t),null;case 13:if(ce(pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(fe&&Ue!==null&&t.mode&1&&!(t.flags&128))cp(),fr(),t.flags|=98560,i=!1;else if(i=li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[wt]=t}else fr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Te(t),i=!1}else ut!==null&&(Ou(ut),ut=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||pe.current&1?_e===0&&(_e=3):Fa())),t.updateQueue!==null&&(t.flags|=4),Te(t),null);case 4:return hr(),Mu(e,t),e===null&&mo(t.stateNode.containerInfo),Te(t),null;case 10:return Sa(t.type._context),Te(t),null;case 17:return He(t.type)&&Qi(),Te(t),null;case 19:if(ce(pe),i=t.memoizedState,i===null)return Te(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)jr(i,!1);else{if(_e!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ts(e),s!==null){for(t.flags|=128,jr(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return le(pe,pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&ve()>gr&&(t.flags|=128,r=!0,jr(i,!1),t.lanes=4194304)}else{if(!r)if(e=ts(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),jr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!fe)return Te(t),null}else 2*ve()-i.renderingStartTime>gr&&n!==1073741824&&(t.flags|=128,r=!0,jr(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ve(),t.sibling=null,n=pe.current,le(pe,r?n&1|2:n&1),t):(Te(t),null);case 22:case 23:return ja(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Be&1073741824&&(Te(t),t.subtreeFlags&6&&(t.flags|=8192)):Te(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function Dw(e,t){switch(wa(t),t.tag){case 1:return He(t.type)&&Qi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return hr(),ce(Fe),ce(Le),Ia(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ma(t),null;case 13:if(ce(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));fr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(pe),null;case 4:return hr(),null;case 10:return Sa(t.type._context),null;case 22:case 23:return ja(),null;case 24:return null;default:return null}}var ci=!1,ze=!1,jw=typeof WeakSet=="function"?WeakSet:Set,U=null;function Zn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ye(e,t,r)}else n.current=null}function Iu(e,t,n){try{n()}catch(r){ye(e,t,r)}}var _f=!1;function Fw(e,t){if(fu=Wi,e=Zh(),ya(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,u=-1,a=0,f=0,c=e,d=null;t:for(;;){for(var g;c!==n||o!==0&&c.nodeType!==3||(l=s+o),c!==i||r!==0&&c.nodeType!==3||(u=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(g=c.firstChild)!==null;)d=c,c=g;for(;;){if(c===e)break t;if(d===n&&++a===o&&(l=s),d===i&&++f===r&&(u=s),(g=c.nextSibling)!==null)break;c=d,d=c.parentNode}c=g}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(du={focusedElem:e,selectionRange:n},Wi=!1,U=t;U!==null;)if(t=U,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,x=y.memoizedState,h=t.stateNode,m=h.getSnapshotBeforeUpdate(t.elementType===t.type?v:it(t.type,v),x);h.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(w){ye(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return y=_f,_f=!1,y}function no(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Iu(t,n,i)}o=o.next}while(o!==r)}}function zs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Pu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Xp(e){var t=e.alternate;t!==null&&(e.alternate=null,Xp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[wt],delete t[vo],delete t[gu],delete t[_w],delete t[Sw])),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 Qp(e){return e.tag===5||e.tag===3||e.tag===4}function Sf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Qp(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 Tu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xi));else if(r!==4&&(e=e.child,e!==null))for(Tu(e,t,n),e=e.sibling;e!==null;)Tu(e,t,n),e=e.sibling}function zu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(zu(e,t,n),e=e.sibling;e!==null;)zu(e,t,n),e=e.sibling}var Ne=null,st=!1;function Vt(e,t,n){for(n=n.child;n!==null;)Gp(e,t,n),n=n.sibling}function Gp(e,t,n){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(Ss,n)}catch{}switch(n.tag){case 5:ze||Zn(n,t);case 6:var r=Ne,o=st;Ne=null,Vt(e,t,n),Ne=r,st=o,Ne!==null&&(st?(e=Ne,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ne.removeChild(n.stateNode));break;case 18:Ne!==null&&(st?(e=Ne,n=n.stateNode,e.nodeType===8?vl(e.parentNode,n):e.nodeType===1&&vl(e,n),ho(e)):vl(Ne,n.stateNode));break;case 4:r=Ne,o=st,Ne=n.stateNode.containerInfo,st=!0,Vt(e,t,n),Ne=r,st=o;break;case 0:case 11:case 14:case 15:if(!ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Iu(n,t,s),o=o.next}while(o!==r)}Vt(e,t,n);break;case 1:if(!ze&&(Zn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){ye(n,t,l)}Vt(e,t,n);break;case 21:Vt(e,t,n);break;case 22:n.mode&1?(ze=(r=ze)||n.memoizedState!==null,Vt(e,t,n),ze=r):Vt(e,t,n);break;default:Vt(e,t,n)}}function kf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new jw),t.forEach(function(r){var o=Gw.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ot(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Ne=l.stateNode,st=!1;break e;case 3:Ne=l.stateNode.containerInfo,st=!0;break e;case 4:Ne=l.stateNode.containerInfo,st=!0;break e}l=l.return}if(Ne===null)throw Error(H(160));Gp(i,s,o),Ne=null,st=!1;var u=o.alternate;u!==null&&(u.return=null),o.return=null}catch(a){ye(o,t,a)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Kp(t,e),t=t.sibling}function Kp(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ot(t,e),mt(e),r&4){try{no(3,e,e.return),zs(3,e)}catch(v){ye(e,e.return,v)}try{no(5,e,e.return)}catch(v){ye(e,e.return,v)}}break;case 1:ot(t,e),mt(e),r&512&&n!==null&&Zn(n,n.return);break;case 5:if(ot(t,e),mt(e),r&512&&n!==null&&Zn(n,n.return),e.flags&32){var o=e.stateNode;try{uo(o,"")}catch(v){ye(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&vh(o,i),tu(l,s);var a=tu(l,i);for(s=0;s<u.length;s+=2){var f=u[s],c=u[s+1];f==="style"?Sh(o,c):f==="dangerouslySetInnerHTML"?Eh(o,c):f==="children"?uo(o,c):oa(o,f,c,a)}switch(l){case"input":Kl(o,i);break;case"textarea":wh(o,i);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?tr(o,!!i.multiple,g,!1):d!==!!i.multiple&&(i.defaultValue!=null?tr(o,!!i.multiple,i.defaultValue,!0):tr(o,!!i.multiple,i.multiple?[]:"",!1))}o[vo]=i}catch(v){ye(e,e.return,v)}}break;case 6:if(ot(t,e),mt(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){ye(e,e.return,v)}}break;case 3:if(ot(t,e),mt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ho(t.containerInfo)}catch(v){ye(e,e.return,v)}break;case 4:ot(t,e),mt(e);break;case 13:ot(t,e),mt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Aa=ve())),r&4&&kf(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(ze=(a=ze)||f,ot(t,e),ze=a):ot(t,e),mt(e),r&8192){if(a=e.memoizedState!==null,(e.stateNode.isHidden=a)&&!f&&e.mode&1)for(U=e,f=e.child;f!==null;){for(c=U=f;U!==null;){switch(d=U,g=d.child,d.tag){case 0:case 11:case 14:case 15:no(4,d,d.return);break;case 1:Zn(d,d.return);var y=d.stateNode;if(typeof y.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){ye(r,n,v)}}break;case 5:Zn(d,d.return);break;case 22:if(d.memoizedState!==null){Cf(c);continue}}g!==null?(g.return=d,U=g):Cf(c)}f=f.sibling}e:for(f=null,c=e;;){if(c.tag===5){if(f===null){f=c;try{o=c.stateNode,a?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=c.stateNode,u=c.memoizedProps.style,s=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=_h("display",s))}catch(v){ye(e,e.return,v)}}}else if(c.tag===6){if(f===null)try{c.stateNode.nodeValue=a?"":c.memoizedProps}catch(v){ye(e,e.return,v)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;f===c&&(f=null),c=c.return}f===c&&(f=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:ot(t,e),mt(e),r&4&&kf(e);break;case 21:break;default:ot(t,e),mt(e)}}function mt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Qp(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(uo(o,""),r.flags&=-33);var i=Sf(e);zu(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Sf(e);Tu(e,l,s);break;default:throw Error(H(161))}}catch(u){ye(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hw(e,t,n){U=e,Zp(e)}function Zp(e,t,n){for(var r=(e.mode&1)!==0;U!==null;){var o=U,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||ci;if(!s){var l=o.alternate,u=l!==null&&l.memoizedState!==null||ze;l=ci;var a=ze;if(ci=s,(ze=u)&&!a)for(U=o;U!==null;)s=U,u=s.child,s.tag===22&&s.memoizedState!==null?Mf(o):u!==null?(u.return=s,U=u):Mf(o);for(;i!==null;)U=i,Zp(i),i=i.sibling;U=o,ci=l,ze=a}Nf(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,U=i):Nf(e)}}function Nf(e){for(;U!==null;){var t=U;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ze||zs(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ze)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:it(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&af(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}af(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var a=t.alternate;if(a!==null){var f=a.memoizedState;if(f!==null){var c=f.dehydrated;c!==null&&ho(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}ze||t.flags&512&&Pu(t)}catch(d){ye(t,t.return,d)}}if(t===e){U=null;break}if(n=t.sibling,n!==null){n.return=t.return,U=n;break}U=t.return}}function Cf(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var n=t.sibling;if(n!==null){n.return=t.return,U=n;break}U=t.return}}function Mf(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{zs(4,t)}catch(u){ye(t,n,u)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(u){ye(t,o,u)}}var i=t.return;try{Pu(t)}catch(u){ye(t,i,u)}break;case 5:var s=t.return;try{Pu(t)}catch(u){ye(t,s,u)}}}catch(u){ye(t,t.return,u)}if(t===e){U=null;break}var l=t.sibling;if(l!==null){l.return=t.return,U=l;break}U=t.return}}var Vw=Math.ceil,os=jt.ReactCurrentDispatcher,Oa=jt.ReactCurrentOwner,et=jt.ReactCurrentBatchConfig,re=0,ke=null,we=null,Ce=0,Be=0,qn=dn(0),_e=0,ko=null,Pn=0,Ls=0,ba=0,ro=null,Ae=null,Aa=0,gr=1/0,It=null,is=!1,Lu=null,rn=null,fi=!1,Zt=null,ss=0,oo=0,$u=null,zi=-1,Li=0;function Re(){return re&6?ve():zi!==-1?zi:zi=ve()}function on(e){return e.mode&1?re&2&&Ce!==0?Ce&-Ce:Nw.transition!==null?(Li===0&&(Li=Oh()),Li):(e=se,e!==0||(e=window.event,e=e===void 0?16:Vh(e.type)),e):1}function ht(e,t,n,r){if(50<oo)throw oo=0,$u=null,Error(H(185));Ao(e,n,r),(!(re&2)||e!==ke)&&(e===ke&&(!(re&2)&&(Ls|=n),_e===4&&Qt(e,Ce)),Ve(e,r),n===1&&re===0&&!(t.mode&1)&&(gr=ve()+500,Is&&hn()))}function Ve(e,t){var n=e.callbackNode;Nv(e,t);var r=Bi(e,e===ke?Ce:0);if(r===0)n!==null&&Oc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Oc(n),t===1)e.tag===0?kw(If.bind(null,e)):lp(If.bind(null,e)),xw(function(){!(re&6)&&hn()}),n=null;else{switch(bh(r)){case 1:n=aa;break;case 4:n=$h;break;case 16:n=Vi;break;case 536870912:n=Rh;break;default:n=Vi}n=ig(n,qp.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function qp(e,t){if(zi=-1,Li=0,re&6)throw Error(H(327));var n=e.callbackNode;if(sr()&&e.callbackNode!==n)return null;var r=Bi(e,e===ke?Ce:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ls(e,r);else{t=r;var o=re;re|=2;var i=eg();(ke!==e||Ce!==t)&&(It=null,gr=ve()+500,_n(e,t));do try{Uw();break}catch(l){Jp(e,l)}while(!0);_a(),os.current=i,re=o,we!==null?t=0:(ke=null,Ce=0,t=_e)}if(t!==0){if(t===2&&(o=su(e),o!==0&&(r=o,t=Ru(e,o))),t===1)throw n=ko,_n(e,0),Qt(e,r),Ve(e,ve()),n;if(t===6)Qt(e,r);else{if(o=e.current.alternate,!(r&30)&&!Bw(o)&&(t=ls(e,r),t===2&&(i=su(e),i!==0&&(r=i,t=Ru(e,i))),t===1))throw n=ko,_n(e,0),Qt(e,r),Ve(e,ve()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:mn(e,Ae,It);break;case 3:if(Qt(e,r),(r&130023424)===r&&(t=Aa+500-ve(),10<t)){if(Bi(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Re(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=pu(mn.bind(null,e,Ae,It),t);break}mn(e,Ae,It);break;case 4:if(Qt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-dt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=ve()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Vw(r/1960))-r,10<r){e.timeoutHandle=pu(mn.bind(null,e,Ae,It),r);break}mn(e,Ae,It);break;case 5:mn(e,Ae,It);break;default:throw Error(H(329))}}}return Ve(e,ve()),e.callbackNode===n?qp.bind(null,e):null}function Ru(e,t){var n=ro;return e.current.memoizedState.isDehydrated&&(_n(e,t).flags|=256),e=ls(e,t),e!==2&&(t=Ae,Ae=n,t!==null&&Ou(t)),e}function Ou(e){Ae===null?Ae=e:Ae.push.apply(Ae,e)}function Bw(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!pt(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Qt(e,t){for(t&=~ba,t&=~Ls,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-dt(t),r=1<<n;e[n]=-1,t&=~r}}function If(e){if(re&6)throw Error(H(327));sr();var t=Bi(e,0);if(!(t&1))return Ve(e,ve()),null;var n=ls(e,t);if(e.tag!==0&&n===2){var r=su(e);r!==0&&(t=r,n=Ru(e,r))}if(n===1)throw n=ko,_n(e,0),Qt(e,t),Ve(e,ve()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,mn(e,Ae,It),Ve(e,ve()),null}function Da(e,t){var n=re;re|=1;try{return e(t)}finally{re=n,re===0&&(gr=ve()+500,Is&&hn())}}function Tn(e){Zt!==null&&Zt.tag===0&&!(re&6)&&sr();var t=re;re|=1;var n=et.transition,r=se;try{if(et.transition=null,se=1,e)return e()}finally{se=r,et.transition=n,re=t,!(re&6)&&hn()}}function ja(){Be=qn.current,ce(qn)}function _n(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ww(n)),we!==null)for(n=we.return;n!==null;){var r=n;switch(wa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Qi();break;case 3:hr(),ce(Fe),ce(Le),Ia();break;case 5:Ma(r);break;case 4:hr();break;case 13:ce(pe);break;case 19:ce(pe);break;case 10:Sa(r.type._context);break;case 22:case 23:ja()}n=n.return}if(ke=e,we=e=sn(e.current,null),Ce=Be=t,_e=0,ko=null,ba=Ls=Pn=0,Ae=ro=null,wn!==null){for(t=0;t<wn.length;t++)if(n=wn[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}wn=null}return e}function Jp(e,t){do{var n=we;try{if(_a(),Ii.current=rs,ns){for(var r=ge.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ns=!1}if(In=0,Se=Ee=ge=null,to=!1,Eo=0,Oa.current=null,n===null||n.return===null){_e=1,ko=t,we=null;break}e:{var i=e,s=n.return,l=n,u=t;if(t=Ce,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var a=u,f=l,c=f.tag;if(!(f.mode&1)&&(c===0||c===11||c===15)){var d=f.alternate;d?(f.updateQueue=d.updateQueue,f.memoizedState=d.memoizedState,f.lanes=d.lanes):(f.updateQueue=null,f.memoizedState=null)}var g=gf(s);if(g!==null){g.flags&=-257,mf(g,s,l,i,t),g.mode&1&&pf(i,a,t),t=g,u=a;var y=t.updateQueue;if(y===null){var v=new Set;v.add(u),t.updateQueue=v}else y.add(u);break e}else{if(!(t&1)){pf(i,a,t),Fa();break e}u=Error(H(426))}}else if(fe&&l.mode&1){var x=gf(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),mf(x,s,l,i,t),xa(pr(u,l));break e}}i=u=pr(u,l),_e!==4&&(_e=2),ro===null?ro=[i]:ro.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var h=bp(i,u,t);uf(i,h);break e;case 1:l=u;var m=i.type,p=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(rn===null||!rn.has(p)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=Ap(i,l,t);uf(i,w);break e}}i=i.return}while(i!==null)}ng(n)}catch(E){t=E,we===n&&n!==null&&(we=n=n.return);continue}break}while(!0)}function eg(){var e=os.current;return os.current=rs,e===null?rs:e}function Fa(){(_e===0||_e===3||_e===2)&&(_e=4),ke===null||!(Pn&268435455)&&!(Ls&268435455)||Qt(ke,Ce)}function ls(e,t){var n=re;re|=2;var r=eg();(ke!==e||Ce!==t)&&(It=null,_n(e,t));do try{Ww();break}catch(o){Jp(e,o)}while(!0);if(_a(),re=n,os.current=r,we!==null)throw Error(H(261));return ke=null,Ce=0,_e}function Ww(){for(;we!==null;)tg(we)}function Uw(){for(;we!==null&&!mv();)tg(we)}function tg(e){var t=og(e.alternate,e,Be);e.memoizedProps=e.pendingProps,t===null?ng(e):we=t,Oa.current=null}function ng(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Dw(n,t),n!==null){n.flags&=32767,we=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{_e=6,we=null;return}}else if(n=Aw(n,t,Be),n!==null){we=n;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);_e===0&&(_e=5)}function mn(e,t,n){var r=se,o=et.transition;try{et.transition=null,se=1,Yw(e,t,n,r)}finally{et.transition=o,se=r}return null}function Yw(e,t,n,r){do sr();while(Zt!==null);if(re&6)throw Error(H(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Cv(e,i),e===ke&&(we=ke=null,Ce=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||fi||(fi=!0,ig(Vi,function(){return sr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=et.transition,et.transition=null;var s=se;se=1;var l=re;re|=4,Oa.current=null,Fw(e,n),Kp(n,e),dw(du),Wi=!!fu,du=fu=null,e.current=n,Hw(n),yv(),re=l,se=s,et.transition=i}else e.current=n;if(fi&&(fi=!1,Zt=e,ss=o),i=e.pendingLanes,i===0&&(rn=null),xv(n.stateNode),Ve(e,ve()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(is)throw is=!1,e=Lu,Lu=null,e;return ss&1&&e.tag!==0&&sr(),i=e.pendingLanes,i&1?e===$u?oo++:(oo=0,$u=e):oo=0,hn(),null}function sr(){if(Zt!==null){var e=bh(ss),t=et.transition,n=se;try{if(et.transition=null,se=16>e?16:e,Zt===null)var r=!1;else{if(e=Zt,Zt=null,ss=0,re&6)throw Error(H(331));var o=re;for(re|=4,U=e.current;U!==null;){var i=U,s=i.child;if(U.flags&16){var l=i.deletions;if(l!==null){for(var u=0;u<l.length;u++){var a=l[u];for(U=a;U!==null;){var f=U;switch(f.tag){case 0:case 11:case 15:no(8,f,i)}var c=f.child;if(c!==null)c.return=f,U=c;else for(;U!==null;){f=U;var d=f.sibling,g=f.return;if(Xp(f),f===a){U=null;break}if(d!==null){d.return=g,U=d;break}U=g}}}var y=i.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var x=v.sibling;v.sibling=null,v=x}while(v!==null)}}U=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,U=s;else e:for(;U!==null;){if(i=U,i.flags&2048)switch(i.tag){case 0:case 11:case 15:no(9,i,i.return)}var h=i.sibling;if(h!==null){h.return=i.return,U=h;break e}U=i.return}}var m=e.current;for(U=m;U!==null;){s=U;var p=s.child;if(s.subtreeFlags&2064&&p!==null)p.return=s,U=p;else e:for(s=m;U!==null;){if(l=U,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:zs(9,l)}}catch(E){ye(l,l.return,E)}if(l===s){U=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,U=w;break e}U=l.return}}if(re=o,hn(),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(Ss,e)}catch{}r=!0}return r}finally{se=n,et.transition=t}}return!1}function Pf(e,t,n){t=pr(n,t),t=bp(e,t,1),e=nn(e,t,1),t=Re(),e!==null&&(Ao(e,1,t),Ve(e,t))}function ye(e,t,n){if(e.tag===3)Pf(e,e,n);else for(;t!==null;){if(t.tag===3){Pf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(rn===null||!rn.has(r))){e=pr(n,e),e=Ap(t,e,1),t=nn(t,e,1),e=Re(),t!==null&&(Ao(t,1,e),Ve(t,e));break}}t=t.return}}function Xw(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Re(),e.pingedLanes|=e.suspendedLanes&n,ke===e&&(Ce&n)===n&&(_e===4||_e===3&&(Ce&130023424)===Ce&&500>ve()-Aa?_n(e,0):ba|=n),Ve(e,t)}function rg(e,t){t===0&&(e.mode&1?(t=ti,ti<<=1,!(ti&130023424)&&(ti=4194304)):t=1);var n=Re();e=bt(e,t),e!==null&&(Ao(e,t,n),Ve(e,n))}function Qw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rg(e,n)}function Gw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),rg(e,n)}var og;og=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fe.current)De=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return De=!1,bw(e,t,n);De=!!(e.flags&131072)}else De=!1,fe&&t.flags&1048576&&up(t,Zi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ti(e,t),e=t.pendingProps;var o=cr(t,Le.current);ir(t,n),o=Ta(null,t,r,e,o,n);var i=za();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,He(r)?(i=!0,Gi(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Na(t),o.updater=Ts,t.stateNode=o,o._reactInternals=t,Eu(t,r,e,n),t=ku(null,t,r,!0,i,n)):(t.tag=0,fe&&i&&va(t),$e(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ti(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Zw(r),e=it(r,e),o){case 0:t=Su(null,t,r,e,n);break e;case 1:t=wf(null,t,r,e,n);break e;case 11:t=yf(null,t,r,e,n);break e;case 14:t=vf(null,t,r,it(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:it(r,o),Su(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:it(r,o),wf(e,t,r,o,n);case 3:e:{if(Hp(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,o=i.element,pp(e,t),es(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=pr(Error(H(423)),t),t=xf(e,t,r,n,o);break e}else if(r!==o){o=pr(Error(H(424)),t),t=xf(e,t,r,n,o);break e}else for(Ue=tn(t.stateNode.containerInfo.firstChild),Ye=t,fe=!0,ut=null,n=dp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fr(),r===o){t=At(e,t,n);break e}$e(e,t,r,n)}t=t.child}return t;case 5:return gp(t),e===null&&vu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,hu(r,o)?s=null:i!==null&&hu(r,i)&&(t.flags|=32),Fp(e,t),$e(e,t,s,n),t.child;case 6:return e===null&&vu(t),null;case 13:return Vp(e,t,n);case 4:return Ca(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=dr(t,null,r,n):$e(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:it(r,o),yf(e,t,r,o,n);case 7:return $e(e,t,t.pendingProps,n),t.child;case 8:return $e(e,t,t.pendingProps.children,n),t.child;case 12:return $e(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,le(qi,r._currentValue),r._currentValue=s,i!==null)if(pt(i.value,s)){if(i.children===o.children&&!Fe.current){t=At(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=$t(-1,n&-n),u.tag=2;var a=i.updateQueue;if(a!==null){a=a.shared;var f=a.pending;f===null?u.next=u:(u.next=f.next,f.next=u),a.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),wu(i.return,n,t),l.lanes|=n;break}u=u.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),wu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}$e(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ir(t,n),o=tt(o),r=r(o),t.flags|=1,$e(e,t,r,n),t.child;case 14:return r=t.type,o=it(r,t.pendingProps),o=it(r.type,o),vf(e,t,r,o,n);case 15:return Dp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:it(r,o),Ti(e,t),t.tag=1,He(r)?(e=!0,Gi(t)):e=!1,ir(t,n),Op(t,r,o),Eu(t,r,o,n),ku(null,t,r,!0,e,n);case 19:return Bp(e,t,n);case 22:return jp(e,t,n)}throw Error(H(156,t.tag))};function ig(e,t){return Lh(e,t)}function Kw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Je(e,t,n,r){return new Kw(e,t,n,r)}function Ha(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zw(e){if(typeof e=="function")return Ha(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sa)return 11;if(e===la)return 14}return 2}function sn(e,t){var n=e.alternate;return n===null?(n=Je(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function $i(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Ha(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Vn:return Sn(n.children,o,i,t);case ia:s=8,o|=8;break;case Ul:return e=Je(12,n,t,o|2),e.elementType=Ul,e.lanes=i,e;case Yl:return e=Je(13,n,t,o),e.elementType=Yl,e.lanes=i,e;case Xl:return e=Je(19,n,t,o),e.elementType=Xl,e.lanes=i,e;case gh:return $s(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case hh:s=10;break e;case ph:s=9;break e;case sa:s=11;break e;case la:s=14;break e;case Ut:s=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Je(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Sn(e,t,n,r){return e=Je(7,e,r,t),e.lanes=n,e}function $s(e,t,n,r){return e=Je(22,e,r,t),e.elementType=gh,e.lanes=n,e.stateNode={isHidden:!1},e}function Cl(e,t,n){return e=Je(6,e,null,t),e.lanes=n,e}function Ml(e,t,n){return t=Je(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function qw(e,t,n,r,o){this.tag=t,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=ll(0),this.expirationTimes=ll(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ll(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Va(e,t,n,r,o,i,s,l,u){return e=new qw(e,t,n,l,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Je(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Na(i),e}function Jw(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Hn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function sg(e){if(!e)return an;e=e._reactInternals;e:{if(bn(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(He(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(He(n))return sp(e,n,t)}return t}function lg(e,t,n,r,o,i,s,l,u){return e=Va(n,r,!0,e,o,i,s,l,u),e.context=sg(null),n=e.current,r=Re(),o=on(n),i=$t(r,o),i.callback=t??null,nn(n,i,o),e.current.lanes=o,Ao(e,o,r),Ve(e,r),e}function Rs(e,t,n,r){var o=t.current,i=Re(),s=on(o);return n=sg(n),t.context===null?t.context=n:t.pendingContext=n,t=$t(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=nn(o,t,s),e!==null&&(ht(e,o,s,i),Mi(e,o,s)),s}function us(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 Tf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ba(e,t){Tf(e,t),(e=e.alternate)&&Tf(e,t)}function e1(){return null}var ug=typeof reportError=="function"?reportError:function(e){console.error(e)};function Wa(e){this._internalRoot=e}Os.prototype.render=Wa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Rs(e,t,null,null)};Os.prototype.unmount=Wa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Tn(function(){Rs(null,e,null,null)}),t[Ot]=null}};function Os(e){this._internalRoot=e}Os.prototype.unstable_scheduleHydration=function(e){if(e){var t=jh();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Xt.length&&t!==0&&t<Xt[n].priority;n++);Xt.splice(n,0,e),n===0&&Hh(e)}};function Ua(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function zf(){}function t1(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var a=us(s);i.call(a)}}var s=lg(t,r,e,0,null,!1,!1,"",zf);return e._reactRootContainer=s,e[Ot]=s.current,mo(e.nodeType===8?e.parentNode:e),Tn(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var a=us(u);l.call(a)}}var u=Va(e,0,!1,null,null,!1,!1,"",zf);return e._reactRootContainer=u,e[Ot]=u.current,mo(e.nodeType===8?e.parentNode:e),Tn(function(){Rs(t,u,n,r)}),u}function As(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var u=us(s);l.call(u)}}Rs(t,s,e,o)}else s=t1(n,t,e,o,r);return us(s)}Ah=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ur(t.pendingLanes);n!==0&&(ca(t,n|1),Ve(t,ve()),!(re&6)&&(gr=ve()+500,hn()))}break;case 13:Tn(function(){var r=bt(e,1);if(r!==null){var o=Re();ht(r,e,1,o)}}),Ba(e,1)}};fa=function(e){if(e.tag===13){var t=bt(e,134217728);if(t!==null){var n=Re();ht(t,e,134217728,n)}Ba(e,134217728)}};Dh=function(e){if(e.tag===13){var t=on(e),n=bt(e,t);if(n!==null){var r=Re();ht(n,e,t,r)}Ba(e,t)}};jh=function(){return se};Fh=function(e,t){var n=se;try{return se=e,t()}finally{se=n}};ru=function(e,t,n){switch(t){case"input":if(Kl(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Ms(r);if(!o)throw Error(H(90));yh(r),Kl(r,o)}}}break;case"textarea":wh(e,n);break;case"select":t=n.value,t!=null&&tr(e,!!n.multiple,t,!1)}};Ch=Da;Mh=Tn;var n1={usingClientEntryPoint:!1,Events:[jo,Yn,Ms,kh,Nh,Da]},Fr={findFiberByHostInstance:vn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},r1={bundleType:Fr.bundleType,version:Fr.version,rendererPackageName:Fr.rendererPackageName,rendererConfig:Fr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Th(e),e===null?null:e.stateNode},findFiberByHostInstance:Fr.findFiberByHostInstance||e1,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 di=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!di.isDisabled&&di.supportsFiber)try{Ss=di.inject(r1),Et=di}catch{}}Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=n1;Ge.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ua(t))throw Error(H(200));return Jw(e,t,null,n)};Ge.createRoot=function(e,t){if(!Ua(e))throw Error(H(299));var n=!1,r="",o=ug;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Va(e,1,!1,null,null,n,!1,r,o),e[Ot]=t.current,mo(e.nodeType===8?e.parentNode:e),new Wa(t)};Ge.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=Th(t),e=e===null?null:e.stateNode,e};Ge.flushSync=function(e){return Tn(e)};Ge.hydrate=function(e,t,n){if(!bs(t))throw Error(H(200));return As(null,e,t,!0,n)};Ge.hydrateRoot=function(e,t,n){if(!Ua(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=ug;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=lg(t,null,e,1,n??null,o,!1,i,s),e[Ot]=t.current,mo(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Os(t)};Ge.render=function(e,t,n){if(!bs(t))throw Error(H(200));return As(null,e,t,!1,n)};Ge.unmountComponentAtNode=function(e){if(!bs(e))throw Error(H(40));return e._reactRootContainer?(Tn(function(){As(null,null,e,!1,function(){e._reactRootContainer=null,e[Ot]=null})}),!0):!1};Ge.unstable_batchedUpdates=Da;Ge.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!bs(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return As(e,t,n,!1,r)};Ge.version="18.3.1-next-f1338f8080-20240426";function ag(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ag)}catch(e){console.error(e)}}ag(),ah.exports=Ge;var o1=ah.exports,cg,Lf=o1;cg=Lf.createRoot,Lf.hydrateRoot;function xe(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=xe(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var i1={value:()=>{}};function Ds(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ri(n)}function Ri(e){this._=e}function s1(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ri.prototype=Ds.prototype={constructor:Ri,on:function(e,t){var n=this._,r=s1(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=l1(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=$f(n[o],e.name,t);else if(t==null)for(o in n)n[o]=$f(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ri(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function l1(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function $f(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=i1,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var bu="http://www.w3.org/1999/xhtml";const Rf={svg:"http://www.w3.org/2000/svg",xhtml:bu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function js(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Rf.hasOwnProperty(t)?{space:Rf[t],local:e}:e}function u1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===bu&&t.documentElement.namespaceURI===bu?t.createElement(e):t.createElementNS(n,e)}}function a1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function fg(e){var t=js(e);return(t.local?a1:u1)(t)}function c1(){}function Ya(e){return e==null?c1:function(){return this.querySelector(e)}}function f1(e){typeof e!="function"&&(e=Ya(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),u,a,f=0;f<s;++f)(u=i[f])&&(a=e.call(u,u.__data__,f,i))&&("__data__"in u&&(a.__data__=u.__data__),l[f]=a);return new Qe(r,this._parents)}function d1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function h1(){return[]}function dg(e){return e==null?h1:function(){return this.querySelectorAll(e)}}function p1(e){return function(){return d1(e.apply(this,arguments))}}function g1(e){typeof e=="function"?e=p1(e):e=dg(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,u,a=0;a<l;++a)(u=s[a])&&(r.push(e.call(u,u.__data__,a,s)),o.push(u));return new Qe(r,o)}function hg(e){return function(){return this.matches(e)}}function pg(e){return function(t){return t.matches(e)}}var m1=Array.prototype.find;function y1(e){return function(){return m1.call(this.children,e)}}function v1(){return this.firstElementChild}function w1(e){return this.select(e==null?v1:y1(typeof e=="function"?e:pg(e)))}var x1=Array.prototype.filter;function E1(){return Array.from(this.children)}function _1(e){return function(){return x1.call(this.children,e)}}function S1(e){return this.selectAll(e==null?E1:_1(typeof e=="function"?e:pg(e)))}function k1(e){typeof e!="function"&&(e=hg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],u,a=0;a<s;++a)(u=i[a])&&e.call(u,u.__data__,a,i)&&l.push(u);return new Qe(r,this._parents)}function gg(e){return new Array(e.length)}function N1(){return new Qe(this._enter||this._groups.map(gg),this._parents)}function as(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}as.prototype={constructor:as,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function C1(e){return function(){return e}}function M1(e,t,n,r,o,i){for(var s=0,l,u=t.length,a=i.length;s<a;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new as(e,i[s]);for(;s<u;++s)(l=t[s])&&(o[s]=l)}function I1(e,t,n,r,o,i,s){var l,u,a=new Map,f=t.length,c=i.length,d=new Array(f),g;for(l=0;l<f;++l)(u=t[l])&&(d[l]=g=s.call(u,u.__data__,l,t)+"",a.has(g)?o[l]=u:a.set(g,u));for(l=0;l<c;++l)g=s.call(e,i[l],l,i)+"",(u=a.get(g))?(r[l]=u,u.__data__=i[l],a.delete(g)):n[l]=new as(e,i[l]);for(l=0;l<f;++l)(u=t[l])&&a.get(d[l])===u&&(o[l]=u)}function P1(e){return e.__data__}function T1(e,t){if(!arguments.length)return Array.from(this,P1);var n=t?I1:M1,r=this._parents,o=this._groups;typeof e!="function"&&(e=C1(e));for(var i=o.length,s=new Array(i),l=new Array(i),u=new Array(i),a=0;a<i;++a){var f=r[a],c=o[a],d=c.length,g=z1(e.call(f,f&&f.__data__,a,r)),y=g.length,v=l[a]=new Array(y),x=s[a]=new Array(y),h=u[a]=new Array(d);n(f,c,v,x,h,g,t);for(var m=0,p=0,w,E;m<y;++m)if(w=v[m]){for(m>=p&&(p=m+1);!(E=x[p])&&++p<y;);w._next=E||null}}return s=new Qe(s,r),s._enter=l,s._exit=u,s}function z1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function L1(){return new Qe(this._exit||this._groups.map(gg),this._parents)}function $1(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function R1(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),u=0;u<s;++u)for(var a=n[u],f=r[u],c=a.length,d=l[u]=new Array(c),g,y=0;y<c;++y)(g=a[y]||f[y])&&(d[y]=g);for(;u<o;++u)l[u]=n[u];return new Qe(l,this._parents)}function O1(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function b1(e){e||(e=A1);function t(c,d){return c&&d?e(c.__data__,d.__data__):!c-!d}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,u=o[i]=new Array(l),a,f=0;f<l;++f)(a=s[f])&&(u[f]=a);u.sort(t)}return new Qe(o,this._parents).order()}function A1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function D1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function j1(){return Array.from(this)}function F1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function H1(){let e=0;for(const t of this)++e;return e}function V1(){return!this.node()}function B1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function W1(e){return function(){this.removeAttribute(e)}}function U1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Y1(e,t){return function(){this.setAttribute(e,t)}}function X1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Q1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function G1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function K1(e,t){var n=js(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?U1:W1:typeof t=="function"?n.local?G1:Q1:n.local?X1:Y1)(n,t))}function mg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Z1(e){return function(){this.style.removeProperty(e)}}function q1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function J1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function ex(e,t,n){return arguments.length>1?this.each((t==null?Z1:typeof t=="function"?J1:q1)(e,t,n??"")):mr(this.node(),e)}function mr(e,t){return e.style.getPropertyValue(t)||mg(e).getComputedStyle(e,null).getPropertyValue(t)}function tx(e){return function(){delete this[e]}}function nx(e,t){return function(){this[e]=t}}function rx(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function ox(e,t){return arguments.length>1?this.each((t==null?tx:typeof t=="function"?rx:nx)(e,t)):this.node()[e]}function yg(e){return e.trim().split(/^|\s+/)}function Xa(e){return e.classList||new vg(e)}function vg(e){this._node=e,this._names=yg(e.getAttribute("class")||"")}vg.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function wg(e,t){for(var n=Xa(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function xg(e,t){for(var n=Xa(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function ix(e){return function(){wg(this,e)}}function sx(e){return function(){xg(this,e)}}function lx(e,t){return function(){(t.apply(this,arguments)?wg:xg)(this,e)}}function ux(e,t){var n=yg(e+"");if(arguments.length<2){for(var r=Xa(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?lx:t?ix:sx)(n,t))}function ax(){this.textContent=""}function cx(e){return function(){this.textContent=e}}function fx(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function dx(e){return arguments.length?this.each(e==null?ax:(typeof e=="function"?fx:cx)(e)):this.node().textContent}function hx(){this.innerHTML=""}function px(e){return function(){this.innerHTML=e}}function gx(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function mx(e){return arguments.length?this.each(e==null?hx:(typeof e=="function"?gx:px)(e)):this.node().innerHTML}function yx(){this.nextSibling&&this.parentNode.appendChild(this)}function vx(){return this.each(yx)}function wx(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xx(){return this.each(wx)}function Ex(e){var t=typeof e=="function"?e:fg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _x(){return null}function Sx(e,t){var n=typeof e=="function"?e:fg(e),r=t==null?_x:typeof t=="function"?t:Ya(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function kx(){var e=this.parentNode;e&&e.removeChild(this)}function Nx(){return this.each(kx)}function Cx(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Mx(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ix(e){return this.select(e?Mx:Cx)}function Px(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Tx(e){return function(t){e.call(this,t,this.__data__)}}function zx(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Lx(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function $x(e,t,n){return function(){var r=this.__on,o,i=Tx(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function Rx(e,t,n){var r=zx(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,a=l.length,f;u<a;++u)for(o=0,f=l[u];o<i;++o)if((s=r[o]).type===f.type&&s.name===f.name)return f.value}return}for(l=t?$x:Lx,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function Eg(e,t,n){var r=mg(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Ox(e,t){return function(){return Eg(this,e,t)}}function bx(e,t){return function(){return Eg(this,e,t.apply(this,arguments))}}function Ax(e,t){return this.each((typeof t=="function"?bx:Ox)(e,t))}function*Dx(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var _g=[null];function Qe(e,t){this._groups=e,this._parents=t}function Ho(){return new Qe([[document.documentElement]],_g)}function jx(){return this}Qe.prototype=Ho.prototype={constructor:Qe,select:f1,selectAll:g1,selectChild:w1,selectChildren:S1,filter:k1,data:T1,enter:N1,exit:L1,join:$1,merge:R1,selection:jx,order:O1,sort:b1,call:D1,nodes:j1,node:F1,size:H1,empty:V1,each:B1,attr:K1,style:ex,property:ox,classed:ux,text:dx,html:mx,raise:vx,lower:xx,append:Ex,insert:Sx,remove:Nx,clone:Ix,datum:Px,on:Rx,dispatch:Ax,[Symbol.iterator]:Dx};function We(e){return typeof e=="string"?new Qe([[document.querySelector(e)]],[document.documentElement]):new Qe([[e]],_g)}function Fx(e){let t;for(;t=e.sourceEvent;)e=t;return e}function lt(e,t){if(e=Fx(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const Hx={passive:!1},No={capture:!0,passive:!1};function Il(e){e.stopImmediatePropagation()}function lr(e){e.preventDefault(),e.stopImmediatePropagation()}function Sg(e){var t=e.document.documentElement,n=We(e).on("dragstart.drag",lr,No);"onselectstart"in t?n.on("selectstart.drag",lr,No):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function kg(e,t){var n=e.document.documentElement,r=We(e).on("dragstart.drag",null);t&&(r.on("click.drag",lr,No),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const hi=e=>()=>e;function Au(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:u,dy:a,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:a,enumerable:!0,configurable:!0},_:{value:f}})}Au.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Vx(e){return!e.ctrlKey&&!e.button}function Bx(){return this.parentNode}function Wx(e,t){return t??{x:e.x,y:e.y}}function Ux(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ng(){var e=Vx,t=Bx,n=Wx,r=Ux,o={},i=Ds("start","drag","end"),s=0,l,u,a,f,c=0;function d(w){w.on("mousedown.drag",g).filter(r).on("touchstart.drag",x).on("touchmove.drag",h,Hx).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(w,E){if(!(f||!e.call(this,w,E))){var _=p(this,t.call(this,w,E),w,E,"mouse");_&&(We(w.view).on("mousemove.drag",y,No).on("mouseup.drag",v,No),Sg(w.view),Il(w),a=!1,l=w.clientX,u=w.clientY,_("start",w))}}function y(w){if(lr(w),!a){var E=w.clientX-l,_=w.clientY-u;a=E*E+_*_>c}o.mouse("drag",w)}function v(w){We(w.view).on("mousemove.drag mouseup.drag",null),kg(w.view,a),lr(w),o.mouse("end",w)}function x(w,E){if(e.call(this,w,E)){var _=w.changedTouches,C=t.call(this,w,E),M=_.length,z,D;for(z=0;z<M;++z)(D=p(this,C,w,E,_[z].identifier,_[z]))&&(Il(w),D("start",w,_[z]))}}function h(w){var E=w.changedTouches,_=E.length,C,M;for(C=0;C<_;++C)(M=o[E[C].identifier])&&(lr(w),M("drag",w,E[C]))}function m(w){var E=w.changedTouches,_=E.length,C,M;for(f&&clearTimeout(f),f=setTimeout(function(){f=null},500),C=0;C<_;++C)(M=o[E[C].identifier])&&(Il(w),M("end",w,E[C]))}function p(w,E,_,C,M,z){var D=i.copy(),T=lt(z||_,E),b,F,S;if((S=n.call(w,new Au("beforestart",{sourceEvent:_,target:d,identifier:M,active:s,x:T[0],y:T[1],dx:0,dy:0,dispatch:D}),C))!=null)return b=S.x-T[0]||0,F=S.y-T[1]||0,function $(P,R,k){var N=T,L;switch(P){case"start":o[M]=$,L=s++;break;case"end":delete o[M],--s;case"drag":T=lt(k||R,E),L=s;break}D.call(P,w,new Au(P,{sourceEvent:R,subject:S,target:d,identifier:M,active:L,x:T[0]+b,y:T[1]+F,dx:T[0]-N[0],dy:T[1]-N[1],dispatch:D}),C)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:hi(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:hi(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:hi(w),d):n},d.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:hi(!!w),d):r},d.on=function(){var w=i.on.apply(i,arguments);return w===i?d:w},d.clickDistance=function(w){return arguments.length?(c=(w=+w)*w,d):Math.sqrt(c)},d}function Qa(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Cg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Vo(){}var Co=.7,cs=1/Co,ur="\\s*([+-]?\\d+)\\s*",Mo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",St="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yx=/^#([0-9a-f]{3,8})$/,Xx=new RegExp(`^rgb\\(${ur},${ur},${ur}\\)$`),Qx=new RegExp(`^rgb\\(${St},${St},${St}\\)$`),Gx=new RegExp(`^rgba\\(${ur},${ur},${ur},${Mo}\\)$`),Kx=new RegExp(`^rgba\\(${St},${St},${St},${Mo}\\)$`),Zx=new RegExp(`^hsl\\(${Mo},${St},${St}\\)$`),qx=new RegExp(`^hsla\\(${Mo},${St},${St},${Mo}\\)$`),Of={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};Qa(Vo,zn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:bf,formatHex:bf,formatHex8:Jx,formatHsl:eE,formatRgb:Af,toString:Af});function bf(){return this.rgb().formatHex()}function Jx(){return this.rgb().formatHex8()}function eE(){return Mg(this).formatHsl()}function Af(){return this.rgb().formatRgb()}function zn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Yx.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Df(t):n===3?new je(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?pi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?pi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Xx.exec(e))?new je(t[1],t[2],t[3],1):(t=Qx.exec(e))?new je(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Gx.exec(e))?pi(t[1],t[2],t[3],t[4]):(t=Kx.exec(e))?pi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Zx.exec(e))?Hf(t[1],t[2]/100,t[3]/100,1):(t=qx.exec(e))?Hf(t[1],t[2]/100,t[3]/100,t[4]):Of.hasOwnProperty(e)?Df(Of[e]):e==="transparent"?new je(NaN,NaN,NaN,0):null}function Df(e){return new je(e>>16&255,e>>8&255,e&255,1)}function pi(e,t,n,r){return r<=0&&(e=t=n=NaN),new je(e,t,n,r)}function tE(e){return e instanceof Vo||(e=zn(e)),e?(e=e.rgb(),new je(e.r,e.g,e.b,e.opacity)):new je}function Du(e,t,n,r){return arguments.length===1?tE(e):new je(e,t,n,r??1)}function je(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Qa(je,Du,Cg(Vo,{brighter(e){return e=e==null?cs:Math.pow(cs,e),new je(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Co:Math.pow(Co,e),new je(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new je(kn(this.r),kn(this.g),kn(this.b),fs(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:jf,formatHex:jf,formatHex8:nE,formatRgb:Ff,toString:Ff}));function jf(){return`#${En(this.r)}${En(this.g)}${En(this.b)}`}function nE(){return`#${En(this.r)}${En(this.g)}${En(this.b)}${En((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ff(){const e=fs(this.opacity);return`${e===1?"rgb(":"rgba("}${kn(this.r)}, ${kn(this.g)}, ${kn(this.b)}${e===1?")":`, ${e})`}`}function fs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function kn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function En(e){return e=kn(e),(e<16?"0":"")+e.toString(16)}function Hf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new at(e,t,n,r)}function Mg(e){if(e instanceof at)return new at(e.h,e.s,e.l,e.opacity);if(e instanceof Vo||(e=zn(e)),!e)return new at;if(e instanceof at)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,u=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=u<.5?i+o:2-i-o,s*=60):l=u>0&&u<1?0:s,new at(s,l,u,e.opacity)}function rE(e,t,n,r){return arguments.length===1?Mg(e):new at(e,t,n,r??1)}function at(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Qa(at,rE,Cg(Vo,{brighter(e){return e=e==null?cs:Math.pow(cs,e),new at(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Co:Math.pow(Co,e),new at(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new je(Pl(e>=240?e-240:e+120,o,r),Pl(e,o,r),Pl(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new at(Vf(this.h),gi(this.s),gi(this.l),fs(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=fs(this.opacity);return`${e===1?"hsl(":"hsla("}${Vf(this.h)}, ${gi(this.s)*100}%, ${gi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Vf(e){return e=(e||0)%360,e<0?e+360:e}function gi(e){return Math.max(0,Math.min(1,e||0))}function Pl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ga=e=>()=>e;function oE(e,t){return function(n){return e+n*t}}function iE(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function sE(e){return(e=+e)==1?Ig:function(t,n){return n-t?iE(t,n,e):Ga(isNaN(t)?n:t)}}function Ig(e,t){var n=t-e;return n?oE(e,n):Ga(isNaN(e)?t:e)}const ds=function e(t){var n=sE(t);function r(o,i){var s=n((o=Du(o)).r,(i=Du(i)).r),l=n(o.g,i.g),u=n(o.b,i.b),a=Ig(o.opacity,i.opacity);return function(f){return o.r=s(f),o.g=l(f),o.b=u(f),o.opacity=a(f),o+""}}return r.gamma=e,r}(1);function lE(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function uE(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function aE(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=io(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(l){for(s=0;s<r;++s)i[s]=o[s](l);return i}}function cE(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function vt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function fE(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=io(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var ju=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Tl=new RegExp(ju.source,"g");function dE(e){return function(){return e}}function hE(e){return function(t){return e(t)+""}}function Pg(e,t){var n=ju.lastIndex=Tl.lastIndex=0,r,o,i,s=-1,l=[],u=[];for(e=e+"",t=t+"";(r=ju.exec(e))&&(o=Tl.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,u.push({i:s,x:vt(r,o)})),n=Tl.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?u[0]?hE(u[0].x):dE(t):(t=u.length,function(a){for(var f=0,c;f<t;++f)l[(c=u[f]).i]=c.x(a);return l.join("")})}function io(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ga(t):(n==="number"?vt:n==="string"?(r=zn(t))?(t=r,ds):Pg:t instanceof zn?ds:t instanceof Date?cE:uE(t)?lE:Array.isArray(t)?aE:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?fE:vt)(e,t)}var Bf=180/Math.PI,Fu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tg(e,t,n,r,o,i){var s,l,u;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,u/=l),e*r<t*n&&(e=-e,t=-t,u=-u,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Bf,skewX:Math.atan(u)*Bf,scaleX:s,scaleY:l}}var mi;function pE(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Fu:Tg(t.a,t.b,t.c,t.d,t.e,t.f)}function gE(e){return e==null||(mi||(mi=document.createElementNS("http://www.w3.org/2000/svg","g")),mi.setAttribute("transform",e),!(e=mi.transform.baseVal.consolidate()))?Fu:(e=e.matrix,Tg(e.a,e.b,e.c,e.d,e.e,e.f))}function zg(e,t,n,r){function o(a){return a.length?a.pop()+" ":""}function i(a,f,c,d,g,y){if(a!==c||f!==d){var v=g.push("translate(",null,t,null,n);y.push({i:v-4,x:vt(a,c)},{i:v-2,x:vt(f,d)})}else(c||d)&&g.push("translate("+c+t+d+n)}function s(a,f,c,d){a!==f?(a-f>180?f+=360:f-a>180&&(a+=360),d.push({i:c.push(o(c)+"rotate(",null,r)-2,x:vt(a,f)})):f&&c.push(o(c)+"rotate("+f+r)}function l(a,f,c,d){a!==f?d.push({i:c.push(o(c)+"skewX(",null,r)-2,x:vt(a,f)}):f&&c.push(o(c)+"skewX("+f+r)}function u(a,f,c,d,g,y){if(a!==c||f!==d){var v=g.push(o(g)+"scale(",null,",",null,")");y.push({i:v-4,x:vt(a,c)},{i:v-2,x:vt(f,d)})}else(c!==1||d!==1)&&g.push(o(g)+"scale("+c+","+d+")")}return function(a,f){var c=[],d=[];return a=e(a),f=e(f),i(a.translateX,a.translateY,f.translateX,f.translateY,c,d),s(a.rotate,f.rotate,c,d),l(a.skewX,f.skewX,c,d),u(a.scaleX,a.scaleY,f.scaleX,f.scaleY,c,d),a=f=null,function(g){for(var y=-1,v=d.length,x;++y<v;)c[(x=d[y]).i]=x.x(g);return c.join("")}}}var mE=zg(pE,"px, ","px)","deg)"),yE=zg(gE,", ",")",")"),vE=1e-12;function Wf(e){return((e=Math.exp(e))+1/e)/2}function wE(e){return((e=Math.exp(e))-1/e)/2}function xE(e){return((e=Math.exp(2*e))-1)/(e+1)}const Oi=function e(t,n,r){function o(i,s){var l=i[0],u=i[1],a=i[2],f=s[0],c=s[1],d=s[2],g=f-l,y=c-u,v=g*g+y*y,x,h;if(v<vE)h=Math.log(d/a)/t,x=function(C){return[l+C*g,u+C*y,a*Math.exp(t*C*h)]};else{var m=Math.sqrt(v),p=(d*d-a*a+r*v)/(2*a*n*m),w=(d*d-a*a-r*v)/(2*d*n*m),E=Math.log(Math.sqrt(p*p+1)-p),_=Math.log(Math.sqrt(w*w+1)-w);h=(_-E)/t,x=function(C){var M=C*h,z=Wf(E),D=a/(n*m)*(z*xE(t*M+E)-wE(E));return[l+D*g,u+D*y,a*z/Wf(t*M+E)]}}return x.duration=h*1e3*t/Math.SQRT2,x}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,u=l*l;return e(s,l,u)},o}(Math.SQRT2,2,4);var yr=0,Xr=0,Hr=0,Lg=1e3,hs,Qr,ps=0,Ln=0,Fs=0,Io=typeof performance=="object"&&performance.now?performance:Date,$g=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ka(){return Ln||($g(EE),Ln=Io.now()+Fs)}function EE(){Ln=0}function gs(){this._call=this._time=this._next=null}gs.prototype=Rg.prototype={constructor:gs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ka():+n)+(t==null?0:+t),!this._next&&Qr!==this&&(Qr?Qr._next=this:hs=this,Qr=this),this._call=e,this._time=n,Hu()},stop:function(){this._call&&(this._call=null,this._time=1/0,Hu())}};function Rg(e,t,n){var r=new gs;return r.restart(e,t,n),r}function _E(){Ka(),++yr;for(var e=hs,t;e;)(t=Ln-e._time)>=0&&e._call.call(void 0,t),e=e._next;--yr}function Uf(){Ln=(ps=Io.now())+Fs,yr=Xr=0;try{_E()}finally{yr=0,kE(),Ln=0}}function SE(){var e=Io.now(),t=e-ps;t>Lg&&(Fs-=t,ps=e)}function kE(){for(var e,t=hs,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:hs=n);Qr=e,Hu(r)}function Hu(e){if(!yr){Xr&&(Xr=clearTimeout(Xr));var t=e-Ln;t>24?(e<1/0&&(Xr=setTimeout(Uf,e-Io.now()-Fs)),Hr&&(Hr=clearInterval(Hr))):(Hr||(ps=Io.now(),Hr=setInterval(SE,Lg)),yr=1,$g(Uf))}}function Yf(e,t,n){var r=new gs;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var NE=Ds("start","end","cancel","interrupt"),CE=[],Og=0,Xf=1,Vu=2,bi=3,Qf=4,Bu=5,Ai=6;function Hs(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;ME(e,n,{name:t,index:r,group:o,on:NE,tween:CE,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Og})}function Za(e,t){var n=gt(e,t);if(n.state>Og)throw new Error("too late; already scheduled");return n}function Nt(e,t){var n=gt(e,t);if(n.state>bi)throw new Error("too late; already running");return n}function gt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ME(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Rg(i,0,n.time);function i(a){n.state=Xf,n.timer.restart(s,n.delay,n.time),n.delay<=a&&s(a-n.delay)}function s(a){var f,c,d,g;if(n.state!==Xf)return u();for(f in r)if(g=r[f],g.name===n.name){if(g.state===bi)return Yf(s);g.state===Qf?(g.state=Ai,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[f]):+f<t&&(g.state=Ai,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[f])}if(Yf(function(){n.state===bi&&(n.state=Qf,n.timer.restart(l,n.delay,n.time),l(a))}),n.state=Vu,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Vu){for(n.state=bi,o=new Array(d=n.tween.length),f=0,c=-1;f<d;++f)(g=n.tween[f].value.call(e,e.__data__,n.index,n.group))&&(o[++c]=g);o.length=c+1}}function l(a){for(var f=a<n.duration?n.ease.call(null,a/n.duration):(n.timer.restart(u),n.state=Bu,1),c=-1,d=o.length;++c<d;)o[c].call(e,f);n.state===Bu&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Ai,n.timer.stop(),delete r[t];for(var a in r)return;delete e.__transition}}function Di(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>Vu&&r.state<Bu,r.state=Ai,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function IE(e){return this.each(function(){Di(this,e)})}function PE(e,t){var n,r;return function(){var o=Nt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function TE(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Nt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},u=0,a=o.length;u<a;++u)if(o[u].name===t){o[u]=l;break}u===a&&o.push(l)}i.tween=o}}function zE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=gt(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?PE:TE)(n,e,t))}function qa(e,t,n){var r=e._id;return e.each(function(){var o=Nt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return gt(o,r).value[t]}}function bg(e,t){var n;return(typeof t=="number"?vt:t instanceof zn?ds:(n=zn(t))?(t=n,ds):Pg)(e,t)}function LE(e){return function(){this.removeAttribute(e)}}function $E(e){return function(){this.removeAttributeNS(e.space,e.local)}}function RE(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function OE(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function bE(e,t,n){var r,o,i;return function(){var s,l=n(this),u;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),u=l+"",s===u?null:s===r&&u===o?i:(o=u,i=t(r=s,l)))}}function AE(e,t,n){var r,o,i;return function(){var s,l=n(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),u=l+"",s===u?null:s===r&&u===o?i:(o=u,i=t(r=s,l)))}}function DE(e,t){var n=js(e),r=n==="transform"?yE:bg;return this.attrTween(e,typeof t=="function"?(n.local?AE:bE)(n,r,qa(this,"attr."+e,t)):t==null?(n.local?$E:LE)(n):(n.local?OE:RE)(n,r,t))}function jE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function FE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function HE(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&FE(e,i)),n}return o._value=t,o}function VE(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&jE(e,i)),n}return o._value=t,o}function BE(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=js(e);return this.tween(n,(r.local?HE:VE)(r,t))}function WE(e,t){return function(){Za(this,e).delay=+t.apply(this,arguments)}}function UE(e,t){return t=+t,function(){Za(this,e).delay=t}}function YE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?WE:UE)(t,e)):gt(this.node(),t).delay}function XE(e,t){return function(){Nt(this,e).duration=+t.apply(this,arguments)}}function QE(e,t){return t=+t,function(){Nt(this,e).duration=t}}function GE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?XE:QE)(t,e)):gt(this.node(),t).duration}function KE(e,t){if(typeof t!="function")throw new Error;return function(){Nt(this,e).ease=t}}function ZE(e){var t=this._id;return arguments.length?this.each(KE(t,e)):gt(this.node(),t).ease}function qE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Nt(this,e).ease=n}}function JE(e){if(typeof e!="function")throw new Error;return this.each(qE(this._id,e))}function e_(e){typeof e!="function"&&(e=hg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],u,a=0;a<s;++a)(u=i[a])&&e.call(u,u.__data__,a,i)&&l.push(u);return new Dt(r,this._parents,this._name,this._id)}function t_(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),l=0;l<i;++l)for(var u=t[l],a=n[l],f=u.length,c=s[l]=new Array(f),d,g=0;g<f;++g)(d=u[g]||a[g])&&(c[g]=d);for(;l<r;++l)s[l]=t[l];return new Dt(s,this._parents,this._name,this._id)}function n_(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function r_(e,t,n){var r,o,i=n_(t)?Za:Nt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function o_(e,t){var n=this._id;return arguments.length<2?gt(this.node(),n).on.on(e):this.each(r_(n,e,t))}function i_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function s_(){return this.on("end.remove",i_(this._id))}function l_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ya(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],u=l.length,a=i[s]=new Array(u),f,c,d=0;d<u;++d)(f=l[d])&&(c=e.call(f,f.__data__,d,l))&&("__data__"in f&&(c.__data__=f.__data__),a[d]=c,Hs(a[d],t,n,d,a,gt(f,n)));return new Dt(i,this._parents,t,n)}function u_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=dg(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var u=r[l],a=u.length,f,c=0;c<a;++c)if(f=u[c]){for(var d=e.call(f,f.__data__,c,u),g,y=gt(f,n),v=0,x=d.length;v<x;++v)(g=d[v])&&Hs(g,t,n,v,d,y);i.push(d),s.push(f)}return new Dt(i,s,t,n)}var a_=Ho.prototype.constructor;function c_(){return new a_(this._groups,this._parents)}function f_(e,t){var n,r,o;return function(){var i=mr(this,e),s=(this.style.removeProperty(e),mr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Ag(e){return function(){this.style.removeProperty(e)}}function d_(e,t,n){var r,o=n+"",i;return function(){var s=mr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function h_(e,t,n){var r,o,i;return function(){var s=mr(this,e),l=n(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),mr(this,e))),s===u?null:s===r&&u===o?i:(o=u,i=t(r=s,l))}}function p_(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var u=Nt(this,e),a=u.on,f=u.value[i]==null?l||(l=Ag(t)):void 0;(a!==n||o!==f)&&(r=(n=a).copy()).on(s,o=f),u.on=r}}function g_(e,t,n){var r=(e+="")=="transform"?mE:bg;return t==null?this.styleTween(e,f_(e,r)).on("end.style."+e,Ag(e)):typeof t=="function"?this.styleTween(e,h_(e,r,qa(this,"style."+e,t))).each(p_(this._id,e)):this.styleTween(e,d_(e,r,t),n).on("end.style."+e,null)}function m_(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function y_(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&m_(e,s,n)),r}return i._value=t,i}function v_(e,t,n){var r="style."+(e+="");if(arguments.length<2)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,y_(e,t,n??""))}function w_(e){return function(){this.textContent=e}}function x_(e){return function(){var t=e(this);this.textContent=t??""}}function E_(e){return this.tween("text",typeof e=="function"?x_(qa(this,"text",e)):w_(e==null?"":e+""))}function __(e){return function(t){this.textContent=e.call(this,t)}}function S_(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&__(o)),t}return r._value=e,r}function k_(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,S_(e))}function N_(){for(var e=this._name,t=this._id,n=Dg(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,u,a=0;a<l;++a)if(u=s[a]){var f=gt(u,t);Hs(u,e,n,a,s,{time:f.time+f.delay+f.duration,delay:0,duration:f.duration,ease:f.ease})}return new Dt(r,this._parents,e,n)}function C_(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},u={value:function(){--o===0&&i()}};n.each(function(){var a=Nt(this,r),f=a.on;f!==e&&(t=(e=f).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(u)),a.on=t}),o===0&&i()})}var M_=0;function Dt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Dg(){return++M_}var Mt=Ho.prototype;Dt.prototype={constructor:Dt,select:l_,selectAll:u_,selectChild:Mt.selectChild,selectChildren:Mt.selectChildren,filter:e_,merge:t_,selection:c_,transition:N_,call:Mt.call,nodes:Mt.nodes,node:Mt.node,size:Mt.size,empty:Mt.empty,each:Mt.each,on:o_,attr:DE,attrTween:BE,style:g_,styleTween:v_,text:E_,textTween:k_,remove:s_,tween:zE,delay:YE,duration:GE,ease:ZE,easeVarying:JE,end:C_,[Symbol.iterator]:Mt[Symbol.iterator]};function I_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var P_={time:null,delay:0,duration:250,ease:I_};function T_(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function z_(e){var t,n;e instanceof Dt?(t=e._id,e=e._name):(t=Dg(),(n=P_).time=Ka(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,u,a=0;a<l;++a)(u=s[a])&&Hs(u,e,t,a,s,n||T_(u,t));return new Dt(r,this._parents,e,t)}Ho.prototype.interrupt=IE;Ho.prototype.transition=z_;const yi=e=>()=>e;function L_(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Lt(e,t,n){this.k=e,this.x=t,this.y=n}Lt.prototype={constructor:Lt,scale:function(e){return e===1?this:new Lt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Lt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Vs=new Lt(1,0,0);jg.prototype=Lt.prototype;function jg(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Vs;return e.__zoom}function zl(e){e.stopImmediatePropagation()}function Vr(e){e.preventDefault(),e.stopImmediatePropagation()}function $_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function R_(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Gf(){return this.__zoom||Vs}function O_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function b_(){return navigator.maxTouchPoints||"ontouchstart"in this}function A_(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Fg(){var e=$_,t=R_,n=A_,r=O_,o=b_,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,u=Oi,a=Ds("start","zoom","end"),f,c,d,g=500,y=150,v=0,x=10;function h(S){S.property("__zoom",Gf).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",D).filter(o).on("touchstart.zoom",T).on("touchmove.zoom",b).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}h.transform=function(S,$,P,R){var k=S.selection?S.selection():S;k.property("__zoom",Gf),S!==k?E(S,$,P,R):k.interrupt().each(function(){_(this,arguments).event(R).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},h.scaleBy=function(S,$,P,R){h.scaleTo(S,function(){var k=this.__zoom.k,N=typeof $=="function"?$.apply(this,arguments):$;return k*N},P,R)},h.scaleTo=function(S,$,P,R){h.transform(S,function(){var k=t.apply(this,arguments),N=this.__zoom,L=P==null?w(k):typeof P=="function"?P.apply(this,arguments):P,j=N.invert(L),A=typeof $=="function"?$.apply(this,arguments):$;return n(p(m(N,A),L,j),k,s)},P,R)},h.translateBy=function(S,$,P,R){h.transform(S,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),s)},null,R)},h.translateTo=function(S,$,P,R,k){h.transform(S,function(){var N=t.apply(this,arguments),L=this.__zoom,j=R==null?w(N):typeof R=="function"?R.apply(this,arguments):R;return n(Vs.translate(j[0],j[1]).scale(L.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof P=="function"?-P.apply(this,arguments):-P),N,s)},R,k)};function m(S,$){return $=Math.max(i[0],Math.min(i[1],$)),$===S.k?S:new Lt($,S.x,S.y)}function p(S,$,P){var R=$[0]-P[0]*S.k,k=$[1]-P[1]*S.k;return R===S.x&&k===S.y?S:new Lt(S.k,R,k)}function w(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function E(S,$,P,R){S.on("start.zoom",function(){_(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(R).end()}).tween("zoom",function(){var k=this,N=arguments,L=_(k,N).event(R),j=t.apply(k,N),A=P==null?w(j):typeof P=="function"?P.apply(k,N):P,W=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),B=k.__zoom,X=typeof $=="function"?$.apply(k,N):$,Q=u(B.invert(A).concat(W/B.k),X.invert(A).concat(W/X.k));return function(G){if(G===1)G=X;else{var V=Q(G),K=W/V[2];G=new Lt(K,A[0]-V[0]*K,A[1]-V[1]*K)}L.zoom(null,G)}})}function _(S,$,P){return!P&&S.__zooming||new C(S,$)}function C(S,$){this.that=S,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,$),this.taps=0}C.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,$){return this.mouse&&S!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var $=We(this.that).datum();a.call(S,this.that,new L_(S,{sourceEvent:this.sourceEvent,target:h,transform:this.that.__zoom,dispatch:a}),$)}};function M(S,...$){if(!e.apply(this,arguments))return;var P=_(this,$).event(S),R=this.__zoom,k=Math.max(i[0],Math.min(i[1],R.k*Math.pow(2,r.apply(this,arguments)))),N=lt(S);if(P.wheel)(P.mouse[0][0]!==N[0]||P.mouse[0][1]!==N[1])&&(P.mouse[1]=R.invert(P.mouse[0]=N)),clearTimeout(P.wheel);else{if(R.k===k)return;P.mouse=[N,R.invert(N)],Di(this),P.start()}Vr(S),P.wheel=setTimeout(L,y),P.zoom("mouse",n(p(m(R,k),P.mouse[0],P.mouse[1]),P.extent,s));function L(){P.wheel=null,P.end()}}function z(S,...$){if(d||!e.apply(this,arguments))return;var P=S.currentTarget,R=_(this,$,!0).event(S),k=We(S.view).on("mousemove.zoom",A,!0).on("mouseup.zoom",W,!0),N=lt(S,P),L=S.clientX,j=S.clientY;Sg(S.view),zl(S),R.mouse=[N,this.__zoom.invert(N)],Di(this),R.start();function A(B){if(Vr(B),!R.moved){var X=B.clientX-L,Q=B.clientY-j;R.moved=X*X+Q*Q>v}R.event(B).zoom("mouse",n(p(R.that.__zoom,R.mouse[0]=lt(B,P),R.mouse[1]),R.extent,s))}function W(B){k.on("mousemove.zoom mouseup.zoom",null),kg(B.view,R.moved),Vr(B),R.event(B).end()}}function D(S,...$){if(e.apply(this,arguments)){var P=this.__zoom,R=lt(S.changedTouches?S.changedTouches[0]:S,this),k=P.invert(R),N=P.k*(S.shiftKey?.5:2),L=n(p(m(P,N),R,k),t.apply(this,$),s);Vr(S),l>0?We(this).transition().duration(l).call(E,L,R,S):We(this).call(h.transform,L,R,S)}}function T(S,...$){if(e.apply(this,arguments)){var P=S.touches,R=P.length,k=_(this,$,S.changedTouches.length===R).event(S),N,L,j,A;for(zl(S),L=0;L<R;++L)j=P[L],A=lt(j,this),A=[A,this.__zoom.invert(A),j.identifier],k.touch0?!k.touch1&&k.touch0[2]!==A[2]&&(k.touch1=A,k.taps=0):(k.touch0=A,N=!0,k.taps=1+!!f);f&&(f=clearTimeout(f)),N&&(k.taps<2&&(c=A[0],f=setTimeout(function(){f=null},g)),Di(this),k.start())}}function b(S,...$){if(this.__zooming){var P=_(this,$).event(S),R=S.changedTouches,k=R.length,N,L,j,A;for(Vr(S),N=0;N<k;++N)L=R[N],j=lt(L,this),P.touch0&&P.touch0[2]===L.identifier?P.touch0[0]=j:P.touch1&&P.touch1[2]===L.identifier&&(P.touch1[0]=j);if(L=P.that.__zoom,P.touch1){var W=P.touch0[0],B=P.touch0[1],X=P.touch1[0],Q=P.touch1[1],G=(G=X[0]-W[0])*G+(G=X[1]-W[1])*G,V=(V=Q[0]-B[0])*V+(V=Q[1]-B[1])*V;L=m(L,Math.sqrt(G/V)),j=[(W[0]+X[0])/2,(W[1]+X[1])/2],A=[(B[0]+Q[0])/2,(B[1]+Q[1])/2]}else if(P.touch0)j=P.touch0[0],A=P.touch0[1];else return;P.zoom("touch",n(p(L,j,A),P.extent,s))}}function F(S,...$){if(this.__zooming){var P=_(this,$).event(S),R=S.changedTouches,k=R.length,N,L;for(zl(S),d&&clearTimeout(d),d=setTimeout(function(){d=null},g),N=0;N<k;++N)L=R[N],P.touch0&&P.touch0[2]===L.identifier?delete P.touch0:P.touch1&&P.touch1[2]===L.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(L=lt(L,this),Math.hypot(c[0]-L[0],c[1]-L[1])<x)){var j=We(this).on("dblclick.zoom");j&&j.apply(this,arguments)}}}return h.wheelDelta=function(S){return arguments.length?(r=typeof S=="function"?S:yi(+S),h):r},h.filter=function(S){return arguments.length?(e=typeof S=="function"?S:yi(!!S),h):e},h.touchable=function(S){return arguments.length?(o=typeof S=="function"?S:yi(!!S),h):o},h.extent=function(S){return arguments.length?(t=typeof S=="function"?S:yi([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),h):t},h.scaleExtent=function(S){return arguments.length?(i[0]=+S[0],i[1]=+S[1],h):[i[0],i[1]]},h.translateExtent=function(S){return arguments.length?(s[0][0]=+S[0][0],s[1][0]=+S[1][0],s[0][1]=+S[0][1],s[1][1]=+S[1][1],h):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},h.constrain=function(S){return arguments.length?(n=S,h):n},h.duration=function(S){return arguments.length?(l=+S,h):l},h.interpolate=function(S){return arguments.length?(u=S,h):u},h.on=function(){var S=a.on.apply(a,arguments);return S===a?h:S},h.clickDistance=function(S){return arguments.length?(v=(S=+S)*S,h):Math.sqrt(v)},h.tapDistance=function(S){return arguments.length?(x=+S,h):x},h}const kt={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Po=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Hg=["Enter"," ","Escape"],Vg={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"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 vr;(function(e){e.Strict="strict",e.Loose="loose"})(vr||(vr={}));var Nn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Nn||(Nn={}));var To;(function(e){e.Partial="partial",e.Full="full"})(To||(To={}));const Bg={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Gt;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Gt||(Gt={}));var zo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(zo||(zo={}));var Y;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Y||(Y={}));const Kf={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top};function Wg(e){return e===null?null:e?"valid":"invalid"}const Ug=e=>"id"in e&&"source"in e&&"target"in e,D_=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Ja=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Bo=(e,t=[0,0])=>{const{width:n,height:r}=Ft(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},j_=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):Ja(o)?o:t.nodeLookup.get(o.id));const l=s?ms(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Bs(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ws(n)},Wo=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=Bs(n,ms(o)),r=!0)}),r?Ws(n):{x:0,y:0,width:0,height:0}},ec=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l={...Yo(t,[n,r,o]),width:t.width/o,height:t.height/o},u=[];for(const a of e.values()){const{measured:f,selectable:c=!0,hidden:d=!1}=a;if(s&&!c||d)continue;const g=f.width??a.width??a.initialWidth??null,y=f.height??a.height??a.initialHeight??null,v=Lo(l,xr(a)),x=(g??0)*(y??0),h=i&&v>0;(!a.internals.handleBounds||h||v>=x||a.dragging)&&u.push(a)}return u},F_=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function H_(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function V_({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const l=H_(e,s),u=Wo(l),a=tc(u,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(a,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),Promise.resolve(!0)}function Yg({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:u,y:a}=l?l.internals.positionAbsolute:{x:0,y:0},f=s.origin??r;let c=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",kt.error005());else{const g=l.measured.width,y=l.measured.height;g&&y&&(c=[[u,a],[u+g,a+y]])}else l&&Er(s.extent)&&(c=[[s.extent[0][0]+u,s.extent[0][1]+a],[s.extent[1][0]+u,s.extent[1][1]+a]]);const d=Er(c)?$n(t,c,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",kt.error015())),{position:{x:d.x-u+(s.measured.width??0)*f[0],y:d.y-a+(s.measured.height??0)*f[1]},positionAbsolute:d}}async function B_({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const g=i.has(d.id),y=!g&&d.parentId&&s.find(v=>v.id===d.parentId);(g||y)&&s.push(d)}const l=new Set(t.map(d=>d.id)),u=r.filter(d=>d.deletable!==!1),f=F_(s,u);for(const d of u)l.has(d.id)&&!f.find(y=>y.id===d.id)&&f.push(d);if(!o)return{edges:f,nodes:s};const c=await o({nodes:s,edges:f});return typeof c=="boolean"?c?{edges:f,nodes:s}:{edges:[],nodes:[]}:c}const wr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),$n=(e={x:0,y:0},t,n)=>({x:wr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:wr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Xg(e,t,n){const{width:r,height:o}=Ft(n),{x:i,y:s}=n.internals.positionAbsolute;return $n(e,[[i,s],[i+r,s+o]],t)}const Zf=(e,t,n)=>e<t?wr(Math.abs(e-t),1,t)/t:e>n?-wr(Math.abs(e-n),1,t)/t:0,Qg=(e,t,n=15,r=40)=>{const o=Zf(e.x,r,t.width-r)*n,i=Zf(e.y,r,t.height-r)*n;return[o,i]},Bs=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Wu=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ws=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),xr=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Ja(e)?e.internals.positionAbsolute:Bo(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},ms=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Ja(e)?e.internals.positionAbsolute:Bo(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},Gg=(e,t)=>Ws(Bs(Wu(e),Wu(t))),Lo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},qf=e=>ct(e.width)&&ct(e.height)&&ct(e.x)&&ct(e.y),ct=e=>!isNaN(e)&&isFinite(e),W_=(e,t)=>{},Uo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Yo=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?Uo(l,s):l},ys=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function Fn(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function U_(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Fn(e,n),o=Fn(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=Fn(e.top??e.y??0,n),o=Fn(e.bottom??e.y??0,n),i=Fn(e.left??e.x??0,t),s=Fn(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Y_(e,t,n,r,o,i){const{x:s,y:l}=ys(e,[t,n,r]),{x:u,y:a}=ys({x:e.x+e.width,y:e.y+e.height},[t,n,r]),f=o-u,c=i-a;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(f),bottom:Math.floor(c)}}const tc=(e,t,n,r,o,i)=>{const s=U_(i,t,n),l=(t-s.x)/e.width,u=(n-s.y)/e.height,a=Math.min(l,u),f=wr(a,r,o),c=e.x+e.width/2,d=e.y+e.height/2,g=t/2-c*f,y=n/2-d*f,v=Y_(e,g,y,f,t,n),x={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:g-x.left+x.right,y:y-x.top+x.bottom,zoom:f}},$o=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Er(e){return e!=null&&e!=="parent"}function Ft(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Kg(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Zg(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const l=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function Jf(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function X_(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function Q_(e){return{...Vg,...e||{}}}function so(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=ft(e),l=Yo({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:u,y:a}=n?Uo(l,t):l;return{xSnapped:u,ySnapped:a,...l}}const nc=e=>({width:e.offsetWidth,height:e.offsetHeight}),qg=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},G_=["INPUT","SELECT","TEXTAREA"];function Jg(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:G_.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const em=e=>"clientX"in e,ft=(e,t)=>{var i,s;const n=em(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},ed=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...nc(s)}})};function tm({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const u=e*.125+o*.375+s*.375+n*.125,a=t*.125+i*.375+l*.375+r*.125,f=Math.abs(u-e),c=Math.abs(a-t);return[u,a,f,c]}function vi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function td({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Y.Left:return[t-vi(t-r,i),n];case Y.Right:return[t+vi(r-t,i),n];case Y.Top:return[t,n-vi(n-o,i)];case Y.Bottom:return[t,n+vi(o-n,i)]}}function nm({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top,curvature:s=.25}){const[l,u]=td({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[a,f]=td({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[c,d,g,y]=tm({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:u,targetControlX:a,targetControlY:f});return[`M${e},${t} C${l},${u} ${a},${f} ${r},${o}`,c,d,g,y]}function rm({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function K_({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,l=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+l}function Z_({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=Bs(ms(e),ms(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Lo(s,Ws(i))>0}const q_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,J_=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),om=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||q_;let o;return Ug(e)?o={...e}:o={...e,id:r(e)},J_(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function im({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=rm({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const nd={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},eS=({source:e,sourcePosition:t=Y.Bottom,target:n})=>t===Y.Left||t===Y.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},rd=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function tS({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:r=Y.Top,center:o,offset:i,stepPosition:s}){const l=nd[t],u=nd[r],a={x:e.x+l.x*i,y:e.y+l.y*i},f={x:n.x+u.x*i,y:n.y+u.y*i},c=eS({source:a,sourcePosition:t,target:f}),d=c.x!==0?"x":"y",g=c[d];let y=[],v,x;const h={x:0,y:0},m={x:0,y:0},[,,p,w]=rm({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*u[d]===-1){d==="x"?(v=o.x??a.x+(f.x-a.x)*s,x=o.y??(a.y+f.y)/2):(v=o.x??(a.x+f.x)/2,x=o.y??a.y+(f.y-a.y)*s);const M=[{x:v,y:a.y},{x:v,y:f.y}],z=[{x:a.x,y:x},{x:f.x,y:x}];l[d]===g?y=d==="x"?M:z:y=d==="x"?z:M}else{const M=[{x:a.x,y:f.y}],z=[{x:f.x,y:a.y}];if(d==="x"?y=l.x===g?z:M:y=l.y===g?M:z,t===r){const S=Math.abs(e[d]-n[d]);if(S<=i){const $=Math.min(i-1,i-S);l[d]===g?h[d]=(a[d]>e[d]?-1:1)*$:m[d]=(f[d]>n[d]?-1:1)*$}}if(t!==r){const S=d==="x"?"y":"x",$=l[d]===u[S],P=a[S]>f[S],R=a[S]<f[S];(l[d]===1&&(!$&&P||$&&R)||l[d]!==1&&(!$&&R||$&&P))&&(y=d==="x"?M:z)}const D={x:a.x+h.x,y:a.y+h.y},T={x:f.x+m.x,y:f.y+m.y},b=Math.max(Math.abs(D.x-y[0].x),Math.abs(T.x-y[0].x)),F=Math.max(Math.abs(D.y-y[0].y),Math.abs(T.y-y[0].y));b>=F?(v=(D.x+T.x)/2,x=y[0].y):(v=y[0].x,x=(D.y+T.y)/2)}const E={x:a.x+h.x,y:a.y+h.y},_={x:f.x+m.x,y:f.y+m.y};return[[e,...E.x!==y[0].x||E.y!==y[0].y?[E]:[],...y,..._.x!==y[y.length-1].x||_.y!==y[y.length-1].y?[_]:[],n],v,x,p,w]}function nS(e,t,n,r){const o=Math.min(rd(e,t)/2,rd(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const a=e.x<n.x?-1:1,f=e.y<n.y?1:-1;return`L ${i+o*a},${s}Q ${i},${s} ${i},${s+o*f}`}const l=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${i},${s+o*u}Q ${i},${s} ${i+o*l},${s}`}function Uu({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top,borderRadius:s=5,centerX:l,centerY:u,offset:a=20,stepPosition:f=.5}){const[c,d,g,y,v]=tS({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:u},offset:a,stepPosition:f});let x=`M${c[0].x} ${c[0].y}`;for(let h=1;h<c.length-1;h++)x+=nS(c[h-1],c[h],c[h+1],s);return x+=`L${c[c.length-1].x} ${c[c.length-1].y}`,[x,d,g,y,v]}function od(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function rS(e){var c;const{sourceNode:t,targetNode:n}=e;if(!od(t)||!od(n))return null;const r=t.internals.handleBounds||id(t.handles),o=n.internals.handleBounds||id(n.handles),i=sd((r==null?void 0:r.source)??[],e.sourceHandle),s=sd(e.connectionMode===vr.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(c=e.onError)==null||c.call(e,"008",kt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||Y.Bottom,u=(s==null?void 0:s.position)||Y.Top,a=Rn(t,i,l),f=Rn(n,s,u);return{sourceX:a.x,sourceY:a.y,targetX:f.x,targetY:f.y,sourcePosition:l,targetPosition:u}}function id(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Rn(e,t,n=Y.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??Ft(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Y.Top:return{x:o+s/2,y:i};case Y.Right:return{x:o+s,y:i+l/2};case Y.Bottom:return{x:o+s/2,y:i+l};case Y.Left:return{x:o,y:i+l/2}}}function sd(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Yu(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function oS(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||o].forEach(u=>{if(u&&typeof u=="object"){const a=Yu(u,t);i.has(a)||(s.push({id:a,color:u.color||n,...u}),i.add(a))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const sm=1e3,iS=10,rc={nodeOrigin:[0,0],nodeExtent:Po,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},sS={...rc,checkEquality:!0};function oc(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function lS(e,t,n){const r=oc(rc,n);for(const o of e.values())if(o.parentId)sc(o,e,t,r);else{const i=Bo(o,r.nodeOrigin),s=Er(o.extent)?o.extent:r.nodeExtent,l=$n(i,s,Ft(o));o.internals.positionAbsolute=l}}function uS(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function ic(e){return e==="manual"}function Xu(e,t,n,r={}){var f,c;const o=oc(sS,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!ic(o.zIndexMode)?sm:0;let u=e.length>0,a=!1;t.clear(),n.clear();for(const d of e){let g=s.get(d.id);if(o.checkEquality&&d===(g==null?void 0:g.internals.userNode))t.set(d.id,g);else{const y=Bo(d,o.nodeOrigin),v=Er(d.extent)?d.extent:o.nodeExtent,x=$n(y,v,Ft(d));g={...o.defaults,...d,measured:{width:(f=d.measured)==null?void 0:f.width,height:(c=d.measured)==null?void 0:c.height},internals:{positionAbsolute:x,handleBounds:uS(d,g),z:lm(d,l,o.zIndexMode),userNode:d}},t.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(u=!1),d.parentId&&sc(g,t,n,r,i),a||(a=d.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:a}}function aS(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function sc(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:u}=oc(rc,r),a=e.parentId,f=t.get(a);if(!f){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}aS(e,n),o&&!f.parentId&&f.internals.rootParentIndex===void 0&&u==="auto"&&(f.internals.rootParentIndex=++o.i,f.internals.z=f.internals.z+o.i*iS),o&&f.internals.rootParentIndex!==void 0&&(o.i=f.internals.rootParentIndex);const c=i&&!ic(u)?sm:0,{x:d,y:g,z:y}=cS(e,f,s,l,c,u),{positionAbsolute:v}=e.internals,x=d!==v.x||g!==v.y;(x||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:d,y:g}:v,z:y}})}function lm(e,t,n){const r=ct(e.zIndex)?e.zIndex:0;return ic(n)?r:r+(e.selected?t:0)}function cS(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,u=Ft(e),a=Bo(e,n),f=Er(e.extent)?$n(a,e.extent,u):a;let c=$n({x:s+f.x,y:l+f.y},r,u);e.extent==="parent"&&(c=Xg(c,u,t));const d=lm(e,o,i),g=t.internals.z??0;return{x:c.x,y:c.y,z:g>=d?g+1:d}}function lc(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const u=t.get(l.parentId);if(!u)continue;const a=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??xr(u),f=Gg(a,l.rect);i.set(l.parentId,{expandedRect:f,parent:u})}return i.size>0&&i.forEach(({expandedRect:l,parent:u},a)=>{var p;const f=u.internals.positionAbsolute,c=Ft(u),d=u.origin??r,g=l.x<f.x?Math.round(Math.abs(f.x-l.x)):0,y=l.y<f.y?Math.round(Math.abs(f.y-l.y)):0,v=Math.max(c.width,Math.round(l.width)),x=Math.max(c.height,Math.round(l.height)),h=(v-c.width)*d[0],m=(x-c.height)*d[1];(g>0||y>0||h||m)&&(o.push({id:a,type:"position",position:{x:u.position.x-g+h,y:u.position.y-y+m}}),(p=n.get(a))==null||p.forEach(w=>{e.some(E=>E.id===w.id)||o.push({id:w.id,type:"position",position:{x:w.position.x+g,y:w.position.y+y}})})),(c.width<l.width||c.height<l.height||g||y)&&o.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:v+(g?d[0]*g-h:0),height:x+(y?d[1]*y-m:0)}})}),o}function fS(e,t,n,r,o,i,s){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!l)return{changes:[],updatedInternals:u};const a=[],f=window.getComputedStyle(l),{m22:c}=new window.DOMMatrixReadOnly(f.transform),d=[];for(const g of e.values()){const y=t.get(g.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),u=!0;continue}const v=nc(g.nodeElement),x=y.measured.width!==v.width||y.measured.height!==v.height;if(!!(v.width&&v.height&&(x||!y.internals.handleBounds||g.force))){const m=g.nodeElement.getBoundingClientRect(),p=Er(y.extent)?y.extent:i;let{positionAbsolute:w}=y.internals;y.parentId&&y.extent==="parent"?w=Xg(w,v,t.get(y.parentId)):p&&(w=$n(w,p,v));const E={...y,measured:v,internals:{...y.internals,positionAbsolute:w,handleBounds:{source:ed("source",g.nodeElement,m,c,y.id),target:ed("target",g.nodeElement,m,c,y.id)}}};t.set(y.id,E),y.parentId&&sc(E,t,n,{nodeOrigin:o,zIndexMode:s}),u=!0,x&&(a.push({id:y.id,type:"dimensions",dimensions:v}),y.expandParent&&y.parentId&&d.push({id:y.id,parentId:y.parentId,rect:xr(E,o)}))}}if(d.length>0){const g=lc(d,t,n,o);a.push(...g)}return{changes:a,updatedInternals:u}}async function dS({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r),l=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(l)}function ld(e,t,n,r,o,i){let s=o;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${o}-${e}`;const u=r.get(s)||new Map;if(r.set(s,u.set(n,t)),i){s=`${o}-${e}-${i}`;const a=r.get(s)||new Map;r.set(s,a.set(n,t))}}function um(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,u={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l},a=`${o}-${s}--${i}-${l}`,f=`${i}-${l}--${o}-${s}`;ld("source",u,f,e,o,s),ld("target",u,a,e,i,l),t.set(r.id,r)}}function am(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:am(n,t):!1}function ud(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function hS(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!am(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(i);l&&o.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return o}function Ll({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,u;const o=[];for(const[a,f]of t){const c=(s=n.get(a))==null?void 0:s.internals.userNode;c&&o.push({...c,position:f.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((u=t.get(e))==null?void 0:u.position)||i.position,dragging:r}:o[0],o]}function pS({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=Uo(i,t);return{x:s.x-i.x,y:s.y-i.y}}function gS({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,u=!1,a={x:0,y:0},f=null,c=!1,d=null,g=!1,y=!1,v=null;function x({noDragClassName:m,handleSelector:p,domNode:w,isSelectable:E,nodeId:_,nodeClickDistance:C=0}){d=We(w);function M({x:b,y:F}){const{nodeLookup:S,nodeExtent:$,snapGrid:P,snapToGrid:R,nodeOrigin:k,onNodeDrag:N,onSelectionDrag:L,onError:j,updateNodePositions:A}=t();i={x:b,y:F};let W=!1;const B=l.size>1,X=B&&$?Wu(Wo(l)):null,Q=B&&R?pS({dragItems:l,snapGrid:P,x:b,y:F}):null;for(const[G,V]of l){if(!S.has(G))continue;let K={x:b-V.distance.x,y:F-V.distance.y};R&&(K=Q?{x:Math.round(K.x+Q.x),y:Math.round(K.y+Q.y)}:Uo(K,P));let ee=null;if(B&&$&&!V.extent&&X){const{positionAbsolute:Z}=V.internals,ie=Z.x-X.x+$[0][0],ue=Z.x+V.measured.width-X.x2+$[1][0],oe=Z.y-X.y+$[0][1],Ie=Z.y+V.measured.height-X.y2+$[1][1];ee=[[ie,oe],[ue,Ie]]}const{position:J,positionAbsolute:q}=Yg({nodeId:G,nextPosition:K,nodeLookup:S,nodeExtent:ee||$,nodeOrigin:k,onError:j});W=W||V.position.x!==J.x||V.position.y!==J.y,V.position=J,V.internals.positionAbsolute=q}if(y=y||W,!!W&&(A(l,!0),v&&(r||N||!_&&L))){const[G,V]=Ll({nodeId:_,dragItems:l,nodeLookup:S});r==null||r(v,l,G,V),N==null||N(v,G,V),_||L==null||L(v,V)}}async function z(){if(!f)return;const{transform:b,panBy:F,autoPanSpeed:S,autoPanOnNodeDrag:$}=t();if(!$){u=!1,cancelAnimationFrame(s);return}const[P,R]=Qg(a,f,S);(P!==0||R!==0)&&(i.x=(i.x??0)-P/b[2],i.y=(i.y??0)-R/b[2],await F({x:P,y:R})&&M(i)),s=requestAnimationFrame(z)}function D(b){var B;const{nodeLookup:F,multiSelectionActive:S,nodesDraggable:$,transform:P,snapGrid:R,snapToGrid:k,selectNodesOnDrag:N,onNodeDragStart:L,onSelectionDragStart:j,unselectNodesAndEdges:A}=t();c=!0,(!N||!E)&&!S&&_&&((B=F.get(_))!=null&&B.selected||A()),E&&N&&_&&(e==null||e(_));const W=so(b.sourceEvent,{transform:P,snapGrid:R,snapToGrid:k,containerBounds:f});if(i=W,l=hS(F,$,W,_),l.size>0&&(n||L||!_&&j)){const[X,Q]=Ll({nodeId:_,dragItems:l,nodeLookup:F});n==null||n(b.sourceEvent,l,X,Q),L==null||L(b.sourceEvent,X,Q),_||j==null||j(b.sourceEvent,Q)}}const T=Ng().clickDistance(C).on("start",b=>{const{domNode:F,nodeDragThreshold:S,transform:$,snapGrid:P,snapToGrid:R}=t();f=(F==null?void 0:F.getBoundingClientRect())||null,g=!1,y=!1,v=b.sourceEvent,S===0&&D(b),i=so(b.sourceEvent,{transform:$,snapGrid:P,snapToGrid:R,containerBounds:f}),a=ft(b.sourceEvent,f)}).on("drag",b=>{const{autoPanOnNodeDrag:F,transform:S,snapGrid:$,snapToGrid:P,nodeDragThreshold:R,nodeLookup:k}=t(),N=so(b.sourceEvent,{transform:S,snapGrid:$,snapToGrid:P,containerBounds:f});if(v=b.sourceEvent,(b.sourceEvent.type==="touchmove"&&b.sourceEvent.touches.length>1||_&&!k.has(_))&&(g=!0),!g){if(!u&&F&&c&&(u=!0,z()),!c){const L=ft(b.sourceEvent,f),j=L.x-a.x,A=L.y-a.y;Math.sqrt(j*j+A*A)>R&&D(b)}(i.x!==N.xSnapped||i.y!==N.ySnapped)&&l&&c&&(a=ft(b.sourceEvent,f),M(N))}}).on("end",b=>{if(!(!c||g)&&(u=!1,c=!1,cancelAnimationFrame(s),l.size>0)){const{nodeLookup:F,updateNodePositions:S,onNodeDragStop:$,onSelectionDragStop:P}=t();if(y&&(S(l,!1),y=!1),o||$||!_&&P){const[R,k]=Ll({nodeId:_,dragItems:l,nodeLookup:F,dragging:!1});o==null||o(b.sourceEvent,l,R,k),$==null||$(b.sourceEvent,R,k),_||P==null||P(b.sourceEvent,k)}}}).filter(b=>{const F=b.target;return!b.button&&(!m||!ud(F,`.${m}`,w))&&(!p||ud(F,p,w))});d.call(T)}function h(){d==null||d.on(".drag",null)}return{update:x,destroy:h}}function mS(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Lo(o,xr(i))>0&&r.push(i);return r}const yS=250;function vS(e,t,n,r){var l,u;let o=[],i=1/0;const s=mS(e,n,t+yS);for(const a of s){const f=[...((l=a.internals.handleBounds)==null?void 0:l.source)??[],...((u=a.internals.handleBounds)==null?void 0:u.target)??[]];for(const c of f){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:d,y:g}=Rn(a,c,c.position,!0),y=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(g-e.y,2));y>t||(y<i?(o=[{...c,x:d,y:g}],i=y):y===i&&o.push({...c,x:d,y:g}))}}if(!o.length)return null;if(o.length>1){const a=r.type==="source"?"target":"source";return o.find(f=>f.type===a)??o[0]}return o[0]}function cm(e,t,n,r,o,i=!1){var a,f,c;const s=r.get(e);if(!s)return null;const l=o==="strict"?(a=s.internals.handleBounds)==null?void 0:a[t]:[...((f=s.internals.handleBounds)==null?void 0:f.source)??[],...((c=s.internals.handleBounds)==null?void 0:c.target)??[]],u=(n?l==null?void 0:l.find(d=>d.id===n):l==null?void 0:l[0])??null;return u&&i?{...u,...Rn(s,u,u.position,!0)}:u}function fm(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function wS(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const dm=()=>!0;function xS(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:u,lib:a,autoPanOnConnect:f,flowId:c,panBy:d,cancelConnection:g,onConnectStart:y,onConnect:v,onConnectEnd:x,isValidConnection:h=dm,onReconnectEnd:m,updateConnection:p,getTransform:w,getFromHandle:E,autoPanSpeed:_,dragThreshold:C=1,handleDomNode:M}){const z=qg(e.target);let D=0,T;const{x:b,y:F}=ft(e),S=fm(i,M),$=l==null?void 0:l.getBoundingClientRect();let P=!1;if(!$||!S)return;const R=cm(o,S,r,u,t);if(!R)return;let k=ft(e,$),N=!1,L=null,j=!1,A=null;function W(){if(!f||!$)return;const[J,q]=Qg(k,$,_);d({x:J,y:q}),D=requestAnimationFrame(W)}const B={...R,nodeId:o,type:S,position:R.position},X=u.get(o);let G={inProgress:!0,isValid:null,from:Rn(X,B,Y.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:X,to:k,toHandle:null,toPosition:Kf[B.position],toNode:null,pointer:k};function V(){P=!0,p(G),y==null||y(e,{nodeId:o,handleId:r,handleType:S})}C===0&&V();function K(J){if(!P){const{x:Ie,y:Ht}=ft(J),Ct=Ie-b,pn=Ht-F;if(!(Ct*Ct+pn*pn>C*C))return;V()}if(!E()||!B){ee(J);return}const q=w();k=ft(J,$),T=vS(Yo(k,q,!1,[1,1]),n,u,B),N||(W(),N=!0);const Z=hm(J,{handle:T,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:h,doc:z,lib:a,flowId:c,nodeLookup:u});A=Z.handleDomNode,L=Z.connection,j=wS(!!T,Z.isValid);const ie=u.get(o),ue=ie?Rn(ie,B,Y.Left,!0):G.from,oe={...G,from:ue,isValid:j,to:Z.toHandle&&j?ys({x:Z.toHandle.x,y:Z.toHandle.y},q):k,toHandle:Z.toHandle,toPosition:j&&Z.toHandle?Z.toHandle.position:Kf[B.position],toNode:Z.toHandle?u.get(Z.toHandle.nodeId):null,pointer:k};p(oe),G=oe}function ee(J){if(!("touches"in J&&J.touches.length>0)){if(P){(T||A)&&L&&j&&(v==null||v(L));const{inProgress:q,...Z}=G,ie={...Z,toPosition:G.toHandle?G.toPosition:null};x==null||x(J,ie),i&&(m==null||m(J,ie))}g(),cancelAnimationFrame(D),N=!1,j=!1,L=null,A=null,z.removeEventListener("mousemove",K),z.removeEventListener("mouseup",ee),z.removeEventListener("touchmove",K),z.removeEventListener("touchend",ee)}}z.addEventListener("mousemove",K),z.addEventListener("mouseup",ee),z.addEventListener("touchmove",K),z.addEventListener("touchend",ee)}function hm(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:u,isValidConnection:a=dm,nodeLookup:f}){const c=i==="target",d=t?s.querySelector(`.${l}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y}=ft(e),v=s.elementFromPoint(g,y),x=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:d,h={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const m=fm(void 0,x),p=x.getAttribute("data-nodeid"),w=x.getAttribute("data-handleid"),E=x.classList.contains("connectable"),_=x.classList.contains("connectableend");if(!p||!m)return h;const C={source:c?p:r,sourceHandle:c?w:o,target:c?r:p,targetHandle:c?o:w};h.connection=C;const z=E&&_&&(n===vr.Strict?c&&m==="source"||!c&&m==="target":p!==r||w!==o);h.isValid=z&&a(C),h.toHandle=cm(p,m,w,f,n,!0)}return h}const Qu={onPointerDown:xS,isValid:hm};function ES({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=We(e);function i({translateExtent:l,width:u,height:a,zoomStep:f=1,pannable:c=!0,zoomable:d=!0,inversePan:g=!1}){const y=p=>{if(p.sourceEvent.type!=="wheel"||!t)return;const w=n(),E=p.sourceEvent.ctrlKey&&$o()?10:1,_=-p.sourceEvent.deltaY*(p.sourceEvent.deltaMode===1?.05:p.sourceEvent.deltaMode?1:.002)*f,C=w[2]*Math.pow(2,_*E);t.scaleTo(C)};let v=[0,0];const x=p=>{(p.sourceEvent.type==="mousedown"||p.sourceEvent.type==="touchstart")&&(v=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY])},h=p=>{const w=n();if(p.sourceEvent.type!=="mousemove"&&p.sourceEvent.type!=="touchmove"||!t)return;const E=[p.sourceEvent.clientX??p.sourceEvent.touches[0].clientX,p.sourceEvent.clientY??p.sourceEvent.touches[0].clientY],_=[E[0]-v[0],E[1]-v[1]];v=E;const C=r()*Math.max(w[2],Math.log(w[2]))*(g?-1:1),M={x:w[0]-_[0]*C,y:w[1]-_[1]*C},z=[[0,0],[u,a]];t.setViewportConstrained({x:M.x,y:M.y,zoom:w[2]},z,l)},m=Fg().on("start",x).on("zoom",c?h:null).on("zoom.wheel",d?y:null);o.call(m,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:lt}}const Us=e=>({x:e.x,y:e.y,zoom:e.k}),$l=({x:e,y:t,zoom:n})=>Vs.translate(e,t).scale(n),Jn=(e,t)=>e.target.closest(`.${t}`),pm=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),_S=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Rl=(e,t=0,n=_S,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},gm=e=>{const t=e.ctrlKey&&$o()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function SS({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:a}){return f=>{if(Jn(f,t))return f.ctrlKey&&f.preventDefault(),!1;f.preventDefault(),f.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(f.ctrlKey&&s){const x=lt(f),h=gm(f),m=c*Math.pow(2,h);r.scaleTo(n,m,x,f);return}const d=f.deltaMode===1?20:1;let g=o===Nn.Vertical?0:f.deltaX*d,y=o===Nn.Horizontal?0:f.deltaY*d;!$o()&&f.shiftKey&&o!==Nn.Vertical&&(g=f.deltaY*d,y=0),r.translateBy(n,-(g/c)*i,-(y/c)*i,{internal:!0});const v=Us(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u==null||u(f,v),e.panScrollTimeout=setTimeout(()=>{a==null||a(f,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(f,v))}}function kS({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=Jn(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function NS({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=Us(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function CS({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&pm(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((l=i.sourceEvent)!=null&&l.internal)&&(o==null||o(i.sourceEvent,Us(i.transform)))}}function MS({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&pm(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const u=Us(s.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,u)},n?150:0)}}}function IS({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:l,noPanClassName:u,lib:a,connectionInProgress:f}){return c=>{var x;const d=e||t,g=n&&c.ctrlKey,y=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(Jn(c,`${a}-flow__node`)||Jn(c,`${a}-flow__edge`)))return!0;if(!r&&!d&&!o&&!i&&!n||s||f&&!y||Jn(c,l)&&y||Jn(c,u)&&(!y||o&&y&&!e)||!n&&c.ctrlKey&&y)return!1;if(!n&&c.type==="touchstart"&&((x=c.touches)==null?void 0:x.length)>1)return c.preventDefault(),!1;if(!d&&!o&&!g&&y||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||y)&&v}}function PS({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:u}){const a={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},f=e.getBoundingClientRect(),c=Fg().scaleExtent([t,n]).translateExtent(r),d=We(e).call(c);m({x:o.x,y:o.y,zoom:wr(o.zoom,t,n)},[[0,0],[f.width,f.height]],r);const g=d.on("wheel.zoom"),y=d.on("dblclick.zoom");c.wheelDelta(gm);function v(T,b){return d?new Promise(F=>{c==null||c.interpolate((b==null?void 0:b.interpolate)==="linear"?io:Oi).transform(Rl(d,b==null?void 0:b.duration,b==null?void 0:b.ease,()=>F(!0)),T)}):Promise.resolve(!1)}function x({noWheelClassName:T,noPanClassName:b,onPaneContextMenu:F,userSelectionActive:S,panOnScroll:$,panOnDrag:P,panOnScrollMode:R,panOnScrollSpeed:k,preventScrolling:N,zoomOnPinch:L,zoomOnScroll:j,zoomOnDoubleClick:A,zoomActivationKeyPressed:W,lib:B,onTransformChange:X,connectionInProgress:Q,paneClickDistance:G,selectionOnDrag:V}){S&&!a.isZoomingOrPanning&&h();const K=$&&!W&&!S;c.clickDistance(V?1/0:!ct(G)||G<0?0:G);const ee=K?SS({zoomPanValues:a,noWheelClassName:T,d3Selection:d,d3Zoom:c,panOnScrollMode:R,panOnScrollSpeed:k,zoomOnPinch:L,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):kS({noWheelClassName:T,preventScrolling:N,d3ZoomHandler:g});if(d.on("wheel.zoom",ee,{passive:!1}),!S){const q=NS({zoomPanValues:a,onDraggingChange:u,onPanZoomStart:s});c.on("start",q);const Z=CS({zoomPanValues:a,panOnDrag:P,onPaneContextMenu:!!F,onPanZoom:i,onTransformChange:X});c.on("zoom",Z);const ie=MS({zoomPanValues:a,panOnDrag:P,panOnScroll:$,onPaneContextMenu:F,onPanZoomEnd:l,onDraggingChange:u});c.on("end",ie)}const J=IS({zoomActivationKeyPressed:W,panOnDrag:P,zoomOnScroll:j,panOnScroll:$,zoomOnDoubleClick:A,zoomOnPinch:L,userSelectionActive:S,noPanClassName:b,noWheelClassName:T,lib:B,connectionInProgress:Q});c.filter(J),A?d.on("dblclick.zoom",y):d.on("dblclick.zoom",null)}function h(){c.on("zoom",null)}async function m(T,b,F){const S=$l(T),$=c==null?void 0:c.constrain()(S,b,F);return $&&await v($),new Promise(P=>P($))}async function p(T,b){const F=$l(T);return await v(F,b),new Promise(S=>S(F))}function w(T){if(d){const b=$l(T),F=d.property("__zoom");(F.k!==T.zoom||F.x!==T.x||F.y!==T.y)&&(c==null||c.transform(d,b,null,{sync:!0}))}}function E(){const T=d?jg(d.node()):{x:0,y:0,k:1};return{x:T.x,y:T.y,zoom:T.k}}function _(T,b){return d?new Promise(F=>{c==null||c.interpolate((b==null?void 0:b.interpolate)==="linear"?io:Oi).scaleTo(Rl(d,b==null?void 0:b.duration,b==null?void 0:b.ease,()=>F(!0)),T)}):Promise.resolve(!1)}function C(T,b){return d?new Promise(F=>{c==null||c.interpolate((b==null?void 0:b.interpolate)==="linear"?io:Oi).scaleBy(Rl(d,b==null?void 0:b.duration,b==null?void 0:b.ease,()=>F(!0)),T)}):Promise.resolve(!1)}function M(T){c==null||c.scaleExtent(T)}function z(T){c==null||c.translateExtent(T)}function D(T){const b=!ct(T)||T<0?0:T;c==null||c.clickDistance(b)}return{update:x,destroy:h,setViewport:p,setViewportConstrained:m,getViewport:E,scaleTo:_,scaleBy:C,setScaleExtent:M,setTranslateExtent:z,syncViewport:w,setClickDistance:D}}var _r;(function(e){e.Line="line",e.Handle="handle"})(_r||(_r={}));function TS({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,l=n-r,u=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&o&&(u[0]=u[0]*-1),l&&i&&(u[1]=u[1]*-1),u}function ad(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Bt(e,t){return Math.max(0,t-e)}function Wt(e,t){return Math.max(0,e-t)}function wi(e,t,n){return Math.max(0,t-e,e-n)}function cd(e,t){return e?!t:t}function zS(e,t,n,r,o,i,s,l){let{affectsX:u,affectsY:a}=t;const{isHorizontal:f,isVertical:c}=t,d=f&&c,{xSnapped:g,ySnapped:y}=n,{minWidth:v,maxWidth:x,minHeight:h,maxHeight:m}=r,{x:p,y:w,width:E,height:_,aspectRatio:C}=e;let M=Math.floor(f?g-e.pointerX:0),z=Math.floor(c?y-e.pointerY:0);const D=E+(u?-M:M),T=_+(a?-z:z),b=-i[0]*E,F=-i[1]*_;let S=wi(D,v,x),$=wi(T,h,m);if(s){let k=0,N=0;u&&M<0?k=Bt(p+M+b,s[0][0]):!u&&M>0&&(k=Wt(p+D+b,s[1][0])),a&&z<0?N=Bt(w+z+F,s[0][1]):!a&&z>0&&(N=Wt(w+T+F,s[1][1])),S=Math.max(S,k),$=Math.max($,N)}if(l){let k=0,N=0;u&&M>0?k=Wt(p+M,l[0][0]):!u&&M<0&&(k=Bt(p+D,l[1][0])),a&&z>0?N=Wt(w+z,l[0][1]):!a&&z<0&&(N=Bt(w+T,l[1][1])),S=Math.max(S,k),$=Math.max($,N)}if(o){if(f){const k=wi(D/C,h,m)*C;if(S=Math.max(S,k),s){let N=0;!u&&!a||u&&!a&&d?N=Wt(w+F+D/C,s[1][1])*C:N=Bt(w+F+(u?M:-M)/C,s[0][1])*C,S=Math.max(S,N)}if(l){let N=0;!u&&!a||u&&!a&&d?N=Bt(w+D/C,l[1][1])*C:N=Wt(w+(u?M:-M)/C,l[0][1])*C,S=Math.max(S,N)}}if(c){const k=wi(T*C,v,x)/C;if($=Math.max($,k),s){let N=0;!u&&!a||a&&!u&&d?N=Wt(p+T*C+b,s[1][0])/C:N=Bt(p+(a?z:-z)*C+b,s[0][0])/C,$=Math.max($,N)}if(l){let N=0;!u&&!a||a&&!u&&d?N=Bt(p+T*C,l[1][0])/C:N=Wt(p+(a?z:-z)*C,l[0][0])/C,$=Math.max($,N)}}}z=z+(z<0?$:-$),M=M+(M<0?S:-S),o&&(d?D>T*C?z=(cd(u,a)?-M:M)/C:M=(cd(u,a)?-z:z)*C:f?(z=M/C,a=u):(M=z*C,u=a));const P=u?p+M:p,R=a?w+z:w;return{width:E+(u?-M:M),height:_+(a?-z:z),x:i[0]*M*(u?-1:1)+P,y:i[1]*z*(a?-1:1)+R}}const mm={width:0,height:0,x:0,y:0},LS={...mm,pointerX:0,pointerY:0,aspectRatio:1};function $S(e){return[[0,0],[e.measured.width,e.measured.height]]}function RS(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,l=n[0]*i,u=n[1]*s;return[[r-l,o-u],[r+i-l,o+s-u]]}function OS({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=We(e);let s={controlDirection:ad("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:a,boundaries:f,keepAspectRatio:c,resizeDirection:d,onResizeStart:g,onResize:y,onResizeEnd:v,shouldResize:x}){let h={...mm},m={...LS};s={boundaries:f,resizeDirection:d,keepAspectRatio:c,controlDirection:ad(a)};let p,w=null,E=[],_,C,M,z=!1;const D=Ng().on("start",T=>{const{nodeLookup:b,transform:F,snapGrid:S,snapToGrid:$,nodeOrigin:P,paneDomNode:R}=n();if(p=b.get(t),!p)return;w=(R==null?void 0:R.getBoundingClientRect())??null;const{xSnapped:k,ySnapped:N}=so(T.sourceEvent,{transform:F,snapGrid:S,snapToGrid:$,containerBounds:w});h={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},m={...h,pointerX:k,pointerY:N,aspectRatio:h.width/h.height},_=void 0,p.parentId&&(p.extent==="parent"||p.expandParent)&&(_=b.get(p.parentId),C=_&&p.extent==="parent"?$S(_):void 0),E=[],M=void 0;for(const[L,j]of b)if(j.parentId===t&&(E.push({id:L,position:{...j.position},extent:j.extent}),j.extent==="parent"||j.expandParent)){const A=RS(j,p,j.origin??P);M?M=[[Math.min(A[0][0],M[0][0]),Math.min(A[0][1],M[0][1])],[Math.max(A[1][0],M[1][0]),Math.max(A[1][1],M[1][1])]]:M=A}g==null||g(T,{...h})}).on("drag",T=>{const{transform:b,snapGrid:F,snapToGrid:S,nodeOrigin:$}=n(),P=so(T.sourceEvent,{transform:b,snapGrid:F,snapToGrid:S,containerBounds:w}),R=[];if(!p)return;const{x:k,y:N,width:L,height:j}=h,A={},W=p.origin??$,{width:B,height:X,x:Q,y:G}=zS(m,s.controlDirection,P,s.boundaries,s.keepAspectRatio,W,C,M),V=B!==L,K=X!==j,ee=Q!==k&&V,J=G!==N&&K;if(!ee&&!J&&!V&&!K)return;if((ee||J||W[0]===1||W[1]===1)&&(A.x=ee?Q:h.x,A.y=J?G:h.y,h.x=A.x,h.y=A.y,E.length>0)){const ue=Q-k,oe=G-N;for(const Ie of E)Ie.position={x:Ie.position.x-ue+W[0]*(B-L),y:Ie.position.y-oe+W[1]*(X-j)},R.push(Ie)}if((V||K)&&(A.width=V&&(!s.resizeDirection||s.resizeDirection==="horizontal")?B:h.width,A.height=K&&(!s.resizeDirection||s.resizeDirection==="vertical")?X:h.height,h.width=A.width,h.height=A.height),_&&p.expandParent){const ue=W[0]*(A.width??0);A.x&&A.x<ue&&(h.x=ue,m.x=m.x-(A.x-ue));const oe=W[1]*(A.height??0);A.y&&A.y<oe&&(h.y=oe,m.y=m.y-(A.y-oe))}const q=TS({width:h.width,prevWidth:L,height:h.height,prevHeight:j,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),Z={...h,direction:q};(x==null?void 0:x(T,Z))!==!1&&(z=!0,y==null||y(T,Z),r(A,R))}).on("end",T=>{z&&(v==null||v(T,{...h}),o==null||o({...h}),z=!1)});i.call(D)}function u(){i.on(".drag",null)}return{update:l,destroy:u}}var ym={exports:{}},vm={},wm={exports:{}},xm={};/**
|
|
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 Sr=O;function bS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var AS=typeof Object.is=="function"?Object.is:bS,DS=Sr.useState,jS=Sr.useEffect,FS=Sr.useLayoutEffect,HS=Sr.useDebugValue;function VS(e,t){var n=t(),r=DS({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return FS(function(){o.value=n,o.getSnapshot=t,Ol(o)&&i({inst:o})},[e,n,t]),jS(function(){return Ol(o)&&i({inst:o}),e(function(){Ol(o)&&i({inst:o})})},[e]),HS(n),n}function Ol(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!AS(e,n)}catch{return!0}}function BS(e,t){return t()}var WS=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?BS:VS;xm.useSyncExternalStore=Sr.useSyncExternalStore!==void 0?Sr.useSyncExternalStore:WS;wm.exports=xm;var US=wm.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 Ys=O,YS=US;function XS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var QS=typeof Object.is=="function"?Object.is:XS,GS=YS.useSyncExternalStore,KS=Ys.useRef,ZS=Ys.useEffect,qS=Ys.useMemo,JS=Ys.useDebugValue;vm.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=KS(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=qS(function(){function u(g){if(!a){if(a=!0,f=g,g=r(g),o!==void 0&&s.hasValue){var y=s.value;if(o(y,g))return c=y}return c=g}if(y=c,QS(f,g))return y;var v=r(g);return o!==void 0&&o(y,v)?(f=g,y):(f=g,c=v)}var a=!1,f,c,d=n===void 0?null:n;return[function(){return u(t())},d===null?void 0:function(){return u(d())}]},[t,n,r,o]);var l=GS(e,i[0],i[1]);return ZS(function(){s.hasValue=!0,s.value=l},[l]),JS(l),l};ym.exports=vm;var ek=ym.exports;const tk=Zd(ek),nk={},fd=e=>{let t;const n=new Set,r=(f,c)=>{const d=typeof f=="function"?f(t):f;if(!Object.is(d,t)){const g=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(y=>y(t,g))}},o=()=>t,u={setState:r,getState:o,getInitialState:()=>a,subscribe:f=>(n.add(f),()=>n.delete(f)),destroy:()=>{(nk?"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."),n.clear()}},a=t=e(r,o,u);return u},rk=e=>e?fd(e):fd,{useDebugValue:ok}=Xy,{useSyncExternalStoreWithSelector:ik}=tk,sk=e=>e;function Em(e,t=sk,n){const r=ik(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ok(r),r}const dd=(e,t)=>{const n=rk(e),r=(o,i=t)=>Em(n,o,i);return Object.assign(r,n),r},lk=(e,t)=>e?dd(e,t):dd;function de(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Xs=O.createContext(null),uk=Xs.Provider,_m=kt.error001();function ne(e,t){const n=O.useContext(Xs);if(n===null)throw new Error(_m);return Em(n,e,t)}function he(){const e=O.useContext(Xs);if(e===null)throw new Error(_m);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const hd={display:"none"},ak={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Sm="react-flow__node-desc",km="react-flow__edge-desc",ck="react-flow__aria-live",fk=e=>e.ariaLiveMessage,dk=e=>e.ariaLabelConfig;function hk({rfId:e}){const t=ne(fk);return I.jsx("div",{id:`${ck}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ak,children:t})}function pk({rfId:e,disableKeyboardA11y:t}){const n=ne(dk);return I.jsxs(I.Fragment,{children:[I.jsx("div",{id:`${Sm}-${e}`,style:hd,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),I.jsx("div",{id:`${km}-${e}`,style:hd,children:n["edge.a11yDescription.default"]}),!t&&I.jsx(hk,{rfId:e})]})}const Qs=O.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return I.jsx("div",{className:xe(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});Qs.displayName="Panel";function gk({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:I.jsx(Qs,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:I.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const mk=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},xi=e=>e.id;function yk(e,t){return de(e.selectedNodes.map(xi),t.selectedNodes.map(xi))&&de(e.selectedEdges.map(xi),t.selectedEdges.map(xi))}function vk({onSelectionChange:e}){const t=he(),{selectedNodes:n,selectedEdges:r}=ne(mk,yk);return O.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const wk=e=>!!e.onSelectionChangeHandlers;function xk({onSelectionChange:e}){const t=ne(wk);return e||t?I.jsx(vk,{onSelectionChange:e}):null}const Gu=typeof window<"u"?O.useLayoutEffect:O.useEffect,Nm=[0,0],Ek={x:0,y:0,zoom:1},_k=["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"],pd=[..._k,"rfId"],Sk=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),gd={translateExtent:Po,nodeOrigin:Nm,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function kk(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:u}=ne(Sk,de),a=he();Gu(()=>(u(e.defaultNodes,e.defaultEdges),()=>{f.current=gd,l()}),[]);const f=O.useRef(gd);return Gu(()=>{for(const c of pd){const d=e[c],g=f.current[c];d!==g&&(typeof e[c]>"u"||(c==="nodes"?t(d):c==="edges"?n(d):c==="minZoom"?r(d):c==="maxZoom"?o(d):c==="translateExtent"?i(d):c==="nodeExtent"?s(d):c==="ariaLabelConfig"?a.setState({ariaLabelConfig:Q_(d)}):c==="fitView"?a.setState({fitViewQueued:d}):c==="fitViewOptions"?a.setState({fitViewOptions:d}):a.setState({[c]:d})))}f.current=e},pd.map(c=>e[c])),null}function md(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Nk(e){var r;const[t,n]=O.useState(e==="system"?null:e);return O.useEffect(()=>{if(e!=="system"){n(e);return}const o=md(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=md())!=null&&r.matches?"dark":"light"}const yd=typeof document<"u"?document:null;function Ro(e=null,t={target:yd,actInsideInputWithModifier:!0}){const[n,r]=O.useState(!1),o=O.useRef(!1),i=O.useRef(new Set([])),[s,l]=O.useMemo(()=>{if(e!==null){const a=(Array.isArray(e)?e:[e]).filter(c=>typeof c=="string").map(c=>c.replace("+",`
|
|
57
|
-
`).replace(`
|
|
58
|
-
|
|
59
|
-
`,`
|
|
60
|
-
+`).split(`
|
|
61
|
-
`)),f=a.reduce((c,d)=>c.concat(...d),[]);return[a,f]}return[[],[]]},[e]);return O.useEffect(()=>{const u=(t==null?void 0:t.target)??yd,a=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const f=g=>{var x,h;if(o.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!o.current||o.current&&!a)&&Jg(g))return!1;const v=wd(g.code,l);if(i.current.add(g[v]),vd(s,i.current,!1)){const m=((h=(x=g.composedPath)==null?void 0:x.call(g))==null?void 0:h[0])||g.target,p=(m==null?void 0:m.nodeName)==="BUTTON"||(m==null?void 0:m.nodeName)==="A";t.preventDefault!==!1&&(o.current||!p)&&g.preventDefault(),r(!0)}},c=g=>{const y=wd(g.code,l);vd(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(g[y]),g.key==="Meta"&&i.current.clear(),o.current=!1},d=()=>{i.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",f),u==null||u.addEventListener("keyup",c),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{u==null||u.removeEventListener("keydown",f),u==null||u.removeEventListener("keyup",c),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function vd(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function wd(e,t){return t.includes(e)?"code":"key"}const Ck=()=>{const e=he();return O.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:l}=e.getState(),u=tc(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:u}=s.getBoundingClientRect(),a={x:t.x-l,y:t.y-u},f=n.snapGrid??o,c=n.snapToGrid??i;return Yo(a,r,c,f)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=ys(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function Cm(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...i};for(const u of s)Mk(u,l);n.push(l)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Mk(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Mm(e,t){return Cm(e,t)}function Im(e,t){return Cm(e,t)}function yn(e,t){return{id:e,type:"select",selected:t}}function er(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(yn(i.id,s)))}return r}function xd({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const l=t.get(s.id),u=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;u!==void 0&&u!==s&&n.push({id:s.id,item:s,type:"replace"}),u===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function Ed(e){return{id:e.id,type:"remove"}}const _d=e=>D_(e),Ik=e=>Ug(e);function Pm(e){return O.forwardRef(e)}function Sd(e){const[t,n]=O.useState(BigInt(0)),[r]=O.useState(()=>Pk(()=>n(o=>o+BigInt(1))));return Gu(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function Pk(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Tm=O.createContext(null);function Tk({children:e}){const t=he(),n=O.useCallback(l=>{const{nodes:u=[],setNodes:a,hasDefaultNodes:f,onNodesChange:c,nodeLookup:d,fitViewQueued:g,onNodesChangeMiddlewareMap:y}=t.getState();let v=u;for(const h of l)v=typeof h=="function"?h(v):h;let x=xd({items:v,lookup:d});for(const h of y.values())x=h(x);f&&a(v),x.length>0?c==null||c(x):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:h,nodes:m,setNodes:p}=t.getState();h&&p(m)})},[]),r=Sd(n),o=O.useCallback(l=>{const{edges:u=[],setEdges:a,hasDefaultEdges:f,onEdgesChange:c,edgeLookup:d}=t.getState();let g=u;for(const y of l)g=typeof y=="function"?y(g):y;f?a(g):c&&c(xd({items:g,lookup:d}))},[]),i=Sd(o),s=O.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return I.jsx(Tm.Provider,{value:s,children:e})}function zk(){const e=O.useContext(Tm);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Lk=e=>!!e.panZoom;function uc(){const e=Ck(),t=he(),n=zk(),r=ne(Lk),o=O.useMemo(()=>{const i=c=>t.getState().nodeLookup.get(c),s=c=>{n.nodeQueue.push(c)},l=c=>{n.edgeQueue.push(c)},u=c=>{var h,m;const{nodeLookup:d,nodeOrigin:g}=t.getState(),y=_d(c)?c:d.get(c.id),v=y.parentId?Zg(y.position,y.measured,y.parentId,d,g):y.position,x={...y,position:v,width:((h=y.measured)==null?void 0:h.width)??y.width,height:((m=y.measured)==null?void 0:m.height)??y.height};return xr(x)},a=(c,d,g={replace:!1})=>{s(y=>y.map(v=>{if(v.id===c){const x=typeof d=="function"?d(v):d;return g.replace&&_d(x)?x:{...v,...x}}return v}))},f=(c,d,g={replace:!1})=>{l(y=>y.map(v=>{if(v.id===c){const x=typeof d=="function"?d(v):d;return g.replace&&Ik(x)?x:{...v,...x}}return v}))};return{getNodes:()=>t.getState().nodes.map(c=>({...c})),getNode:c=>{var d;return(d=i(c))==null?void 0:d.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:c=[]}=t.getState();return c.map(d=>({...d}))},getEdge:c=>t.getState().edgeLookup.get(c),setNodes:s,setEdges:l,addNodes:c=>{const d=Array.isArray(c)?c:[c];n.nodeQueue.push(g=>[...g,...d])},addEdges:c=>{const d=Array.isArray(c)?c:[c];n.edgeQueue.push(g=>[...g,...d])},toObject:()=>{const{nodes:c=[],edges:d=[],transform:g}=t.getState(),[y,v,x]=g;return{nodes:c.map(h=>({...h})),edges:d.map(h=>({...h})),viewport:{x:y,y:v,zoom:x}}},deleteElements:async({nodes:c=[],edges:d=[]})=>{const{nodes:g,edges:y,onNodesDelete:v,onEdgesDelete:x,triggerNodeChanges:h,triggerEdgeChanges:m,onDelete:p,onBeforeDelete:w}=t.getState(),{nodes:E,edges:_}=await B_({nodesToRemove:c,edgesToRemove:d,nodes:g,edges:y,onBeforeDelete:w}),C=_.length>0,M=E.length>0;if(C){const z=_.map(Ed);x==null||x(_),m(z)}if(M){const z=E.map(Ed);v==null||v(E),h(z)}return(M||C)&&(p==null||p({nodes:E,edges:_})),{deletedNodes:E,deletedEdges:_}},getIntersectingNodes:(c,d=!0,g)=>{const y=qf(c),v=y?c:u(c),x=g!==void 0;return v?(g||t.getState().nodes).filter(h=>{const m=t.getState().nodeLookup.get(h.id);if(m&&!y&&(h.id===c.id||!m.internals.positionAbsolute))return!1;const p=xr(x?h:m),w=Lo(p,v);return d&&w>0||w>=p.width*p.height||w>=v.width*v.height}):[]},isNodeIntersecting:(c,d,g=!0)=>{const v=qf(c)?c:u(c);if(!v)return!1;const x=Lo(v,d);return g&&x>0||x>=d.width*d.height||x>=v.width*v.height},updateNode:a,updateNodeData:(c,d,g={replace:!1})=>{a(c,y=>{const v=typeof d=="function"?d(y):d;return g.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},g)},updateEdge:f,updateEdgeData:(c,d,g={replace:!1})=>{f(c,y=>{const v=typeof d=="function"?d(y):d;return g.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},g)},getNodesBounds:c=>{const{nodeLookup:d,nodeOrigin:g}=t.getState();return j_(c,{nodeLookup:d,nodeOrigin:g})},getHandleConnections:({type:c,id:d,nodeId:g})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${g}-${c}${d?`-${d}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:c,handleId:d,nodeId:g})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${g}${c?d?`-${c}-${d}`:`-${c}`:""}`))==null?void 0:y.values())??[])},fitView:async c=>{const d=t.getState().fitViewResolver??X_();return t.setState({fitViewQueued:!0,fitViewOptions:c,fitViewResolver:d}),n.nodeQueue.push(g=>[...g]),d.promise}}},[]);return O.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const kd=e=>e.selected,$k=typeof window<"u"?window:void 0;function Rk({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=he(),{deleteElements:r}=uc(),o=Ro(e,{actInsideInputWithModifier:!1}),i=Ro(t,{target:$k});O.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(kd),edges:s.filter(kd)}),n.setState({nodesSelectionActive:!1})}},[o]),O.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function Ok(e){const t=he();O.useEffect(()=>{const n=()=>{var o,i,s,l;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=nc(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",kt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Gs={position:"absolute",width:"100%",height:"100%",top:0,left:0},bk=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Ak({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=Nn.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:a,minZoom:f,maxZoom:c,zoomActivationKeyCode:d,preventScrolling:g=!0,children:y,noWheelClassName:v,noPanClassName:x,onViewportChange:h,isControlledViewport:m,paneClickDistance:p,selectionOnDrag:w}){const E=he(),_=O.useRef(null),{userSelectionActive:C,lib:M,connectionInProgress:z}=ne(bk,de),D=Ro(d),T=O.useRef();Ok(_);const b=O.useCallback(F=>{h==null||h({x:F[0],y:F[1],zoom:F[2]}),m||E.setState({transform:F})},[h,m]);return O.useEffect(()=>{if(_.current){T.current=PS({domNode:_.current,minZoom:f,maxZoom:c,translateExtent:a,viewport:u,onDraggingChange:P=>E.setState(R=>R.paneDragging===P?R:{paneDragging:P}),onPanZoomStart:(P,R)=>{const{onViewportChangeStart:k,onMoveStart:N}=E.getState();N==null||N(P,R),k==null||k(R)},onPanZoom:(P,R)=>{const{onViewportChange:k,onMove:N}=E.getState();N==null||N(P,R),k==null||k(R)},onPanZoomEnd:(P,R)=>{const{onViewportChangeEnd:k,onMoveEnd:N}=E.getState();N==null||N(P,R),k==null||k(R)}});const{x:F,y:S,zoom:$}=T.current.getViewport();return E.setState({panZoom:T.current,transform:[F,S,$],domNode:_.current.closest(".react-flow")}),()=>{var P;(P=T.current)==null||P.destroy()}}},[]),O.useEffect(()=>{var F;(F=T.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:D,preventScrolling:g,noPanClassName:x,userSelectionActive:C,noWheelClassName:v,lib:M,onTransformChange:b,connectionInProgress:z,selectionOnDrag:w,paneClickDistance:p})},[e,t,n,r,o,i,s,l,D,g,x,C,v,M,b,z,w,p]),I.jsx("div",{className:"react-flow__renderer",ref:_,style:Gs,children:y})}const Dk=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function jk(){const{userSelectionActive:e,userSelectionRect:t}=ne(Dk,de);return e&&t?I.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const bl=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Fk=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Hk({isSelecting:e,selectionKeyPressed:t,selectionMode:n=To.Full,panOnDrag:r,paneClickDistance:o,selectionOnDrag:i,onSelectionStart:s,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:a,onPaneScroll:f,onPaneMouseEnter:c,onPaneMouseMove:d,onPaneMouseLeave:g,children:y}){const v=he(),{userSelectionActive:x,elementsSelectable:h,dragging:m,connectionInProgress:p}=ne(Fk,de),w=h&&(e||x),E=O.useRef(null),_=O.useRef(),C=O.useRef(new Set),M=O.useRef(new Set),z=O.useRef(!1),D=k=>{if(z.current||p){z.current=!1;return}u==null||u(k),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},T=k=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){k.preventDefault();return}a==null||a(k)},b=f?k=>f(k):void 0,F=k=>{z.current&&(k.stopPropagation(),z.current=!1)},S=k=>{var X,Q;const{domNode:N}=v.getState();if(_.current=N==null?void 0:N.getBoundingClientRect(),!_.current)return;const L=k.target===E.current;if(!L&&!!k.target.closest(".nokey")||!e||!(i&&L||t)||k.button!==0||!k.isPrimary)return;(Q=(X=k.target)==null?void 0:X.setPointerCapture)==null||Q.call(X,k.pointerId),z.current=!1;const{x:W,y:B}=ft(k.nativeEvent,_.current);v.setState({userSelectionRect:{width:0,height:0,startX:W,startY:B,x:W,y:B}}),L||(k.stopPropagation(),k.preventDefault())},$=k=>{const{userSelectionRect:N,transform:L,nodeLookup:j,edgeLookup:A,connectionLookup:W,triggerNodeChanges:B,triggerEdgeChanges:X,defaultEdgeOptions:Q,resetSelectedElements:G}=v.getState();if(!_.current||!N)return;const{x:V,y:K}=ft(k.nativeEvent,_.current),{startX:ee,startY:J}=N;if(!z.current){const oe=t?0:o;if(Math.hypot(V-ee,K-J)<=oe)return;G(),s==null||s(k)}z.current=!0;const q={startX:ee,startY:J,x:V<ee?V:ee,y:K<J?K:J,width:Math.abs(V-ee),height:Math.abs(K-J)},Z=C.current,ie=M.current;C.current=new Set(ec(j,q,L,n===To.Partial,!0).map(oe=>oe.id)),M.current=new Set;const ue=(Q==null?void 0:Q.selectable)??!0;for(const oe of C.current){const Ie=W.get(oe);if(Ie)for(const{edgeId:Ht}of Ie.values()){const Ct=A.get(Ht);Ct&&(Ct.selectable??ue)&&M.current.add(Ht)}}if(!Jf(Z,C.current)){const oe=er(j,C.current,!0);B(oe)}if(!Jf(ie,M.current)){const oe=er(A,M.current);X(oe)}v.setState({userSelectionRect:q,userSelectionActive:!0,nodesSelectionActive:!1})},P=k=>{var N,L;k.button===0&&((L=(N=k.target)==null?void 0:N.releasePointerCapture)==null||L.call(N,k.pointerId),!x&&k.target===E.current&&v.getState().userSelectionRect&&(D==null||D(k)),v.setState({userSelectionActive:!1,userSelectionRect:null}),z.current&&(l==null||l(k),v.setState({nodesSelectionActive:C.current.size>0})))},R=r===!0||Array.isArray(r)&&r.includes(0);return I.jsxs("div",{className:xe(["react-flow__pane",{draggable:R,dragging:m,selection:e}]),onClick:w?void 0:bl(D,E),onContextMenu:bl(T,E),onWheel:bl(b,E),onPointerEnter:w?void 0:c,onPointerMove:w?$:d,onPointerUp:w?P:void 0,onPointerDownCapture:w?S:void 0,onClickCapture:w?F:void 0,onPointerLeave:g,ref:E,style:Gs,children:[y,I.jsx(jk,{})]})}function Ku({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:l,onError:u}=t.getState(),a=l.get(e);if(!a){u==null||u("012",kt.error012(e));return}t.setState({nodesSelectionActive:!1}),a.selected?(n||a.selected&&s)&&(i({nodes:[a],edges:[]}),requestAnimationFrame(()=>{var f;return(f=r==null?void 0:r.current)==null?void 0:f.blur()})):o([e])}function zm({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=he(),[u,a]=O.useState(!1),f=O.useRef();return O.useEffect(()=>{f.current=gS({getStoreItems:()=>l.getState(),onNodeMouseDown:c=>{Ku({id:c,store:l,nodeRef:e})},onDragStart:()=>{a(!0)},onDragStop:()=>{a(!1)}})},[]),O.useEffect(()=>{if(!(t||!e.current||!f.current))return f.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s}),()=>{var c;(c=f.current)==null||c.destroy()}},[n,r,t,i,e,o,s]),u}const Vk=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Lm(){const e=he();return O.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:u,nodeLookup:a,nodeOrigin:f}=e.getState(),c=new Map,d=Vk(s),g=o?i[0]:5,y=o?i[1]:5,v=n.direction.x*g*n.factor,x=n.direction.y*y*n.factor;for(const[,h]of a){if(!d(h))continue;let m={x:h.internals.positionAbsolute.x+v,y:h.internals.positionAbsolute.y+x};o&&(m=Uo(m,i));const{position:p,positionAbsolute:w}=Yg({nodeId:h.id,nextPosition:m,nodeLookup:a,nodeExtent:r,nodeOrigin:f,onError:l});h.position=p,h.internals.positionAbsolute=w,c.set(h.id,h)}u(c)},[])}const ac=O.createContext(null),Bk=ac.Provider;ac.Consumer;const $m=()=>O.useContext(ac),Wk=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Uk=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:u,isValid:a}=s,f=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:f,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===vr.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!o,valid:f&&a}};function Yk({type:e="source",position:t=Y.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:u,className:a,onMouseDown:f,onTouchStart:c,...d},g){var $,P;const y=s||null,v=e==="target",x=he(),h=$m(),{connectOnClick:m,noPanClassName:p,rfId:w}=ne(Wk,de),{connectingFrom:E,connectingTo:_,clickConnecting:C,isPossibleEndHandle:M,connectionInProcess:z,clickConnectionInProcess:D,valid:T}=ne(Uk(h,y,e),de);h||(P=($=x.getState()).onError)==null||P.call($,"010",kt.error010());const b=R=>{const{defaultEdgeOptions:k,onConnect:N,hasDefaultEdges:L}=x.getState(),j={...k,...R};if(L){const{edges:A,setEdges:W}=x.getState();W(om(j,A))}N==null||N(j),l==null||l(j)},F=R=>{if(!h)return;const k=em(R.nativeEvent);if(o&&(k&&R.button===0||!k)){const N=x.getState();Qu.onPointerDown(R.nativeEvent,{handleDomNode:R.currentTarget,autoPanOnConnect:N.autoPanOnConnect,connectionMode:N.connectionMode,connectionRadius:N.connectionRadius,domNode:N.domNode,nodeLookup:N.nodeLookup,lib:N.lib,isTarget:v,handleId:y,nodeId:h,flowId:N.rfId,panBy:N.panBy,cancelConnection:N.cancelConnection,onConnectStart:N.onConnectStart,onConnectEnd:(...L)=>{var j,A;return(A=(j=x.getState()).onConnectEnd)==null?void 0:A.call(j,...L)},updateConnection:N.updateConnection,onConnect:b,isValidConnection:n||((...L)=>{var j,A;return((A=(j=x.getState()).isValidConnection)==null?void 0:A.call(j,...L))??!0}),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:N.autoPanSpeed,dragThreshold:N.connectionDragThreshold})}k?f==null||f(R):c==null||c(R)},S=R=>{const{onClickConnectStart:k,onClickConnectEnd:N,connectionClickStartHandle:L,connectionMode:j,isValidConnection:A,lib:W,rfId:B,nodeLookup:X,connection:Q}=x.getState();if(!h||!L&&!o)return;if(!L){k==null||k(R.nativeEvent,{nodeId:h,handleId:y,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:h,type:e,id:y}});return}const G=qg(R.target),V=n||A,{connection:K,isValid:ee}=Qu.isValid(R.nativeEvent,{handle:{nodeId:h,id:y,type:e},connectionMode:j,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:V,flowId:B,doc:G,lib:W,nodeLookup:X});ee&&K&&b(K);const J=structuredClone(Q);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,N==null||N(R,J),x.setState({connectionClickStartHandle:null})};return I.jsx("div",{"data-handleid":y,"data-nodeid":h,"data-handlepos":t,"data-id":`${w}-${h}-${y}-${e}`,className:xe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",p,a,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,clickconnecting:C,connectingfrom:E,connectingto:_,valid:T,connectionindicator:r&&(!z||M)&&(z||D?i:o)}]),onMouseDown:F,onTouchStart:F,onClick:m?S:void 0,ref:g,...d,children:u})}const cn=O.memo(Pm(Yk));function Xk({data:e,isConnectable:t,sourcePosition:n=Y.Bottom}){return I.jsxs(I.Fragment,{children:[e==null?void 0:e.label,I.jsx(cn,{type:"source",position:n,isConnectable:t})]})}function Qk({data:e,isConnectable:t,targetPosition:n=Y.Top,sourcePosition:r=Y.Bottom}){return I.jsxs(I.Fragment,{children:[I.jsx(cn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,I.jsx(cn,{type:"source",position:r,isConnectable:t})]})}function Gk(){return null}function Kk({data:e,isConnectable:t,targetPosition:n=Y.Top}){return I.jsxs(I.Fragment,{children:[I.jsx(cn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const vs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Nd={input:Xk,default:Qk,output:Kk,group:Gk};function Zk(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const qk=e=>{const{width:t,height:n,x:r,y:o}=Wo(e.nodeLookup,{filter:i=>!!i.selected});return{width:ct(t)?t:null,height:ct(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function Jk({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=he(),{width:o,height:i,transformString:s,userSelectionActive:l}=ne(qk,de),u=Lm(),a=O.useRef(null);O.useEffect(()=>{var g;n||(g=a.current)==null||g.focus({preventScroll:!0})},[n]);const f=!l&&o!==null&&i!==null;if(zm({nodeRef:a,disabled:!f}),!f)return null;const c=e?g=>{const y=r.getState().nodes.filter(v=>v.selected);e(g,y)}:void 0,d=g=>{Object.prototype.hasOwnProperty.call(vs,g.key)&&(g.preventDefault(),u({direction:vs[g.key],factor:g.shiftKey?4:1}))};return I.jsx("div",{className:xe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:I.jsx("div",{ref:a,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:o,height:i}})})}const Cd=typeof window<"u"?window:void 0,e2=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Rm({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:a,selectionOnDrag:f,selectionMode:c,onSelectionStart:d,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:x,elementsSelectable:h,zoomOnScroll:m,zoomOnPinch:p,panOnScroll:w,panOnScrollSpeed:E,panOnScrollMode:_,zoomOnDoubleClick:C,panOnDrag:M,defaultViewport:z,translateExtent:D,minZoom:T,maxZoom:b,preventScrolling:F,onSelectionContextMenu:S,noWheelClassName:$,noPanClassName:P,disableKeyboardA11y:R,onViewportChange:k,isControlledViewport:N}){const{nodesSelectionActive:L,userSelectionActive:j}=ne(e2,de),A=Ro(a,{target:Cd}),W=Ro(v,{target:Cd}),B=W||M,X=W||w,Q=f&&B!==!0,G=A||j||Q;return Rk({deleteKeyCode:u,multiSelectionKeyCode:y}),I.jsx(Ak,{onPaneContextMenu:i,elementsSelectable:h,zoomOnScroll:m,zoomOnPinch:p,panOnScroll:X,panOnScrollSpeed:E,panOnScrollMode:_,zoomOnDoubleClick:C,panOnDrag:!A&&B,defaultViewport:z,translateExtent:D,minZoom:T,maxZoom:b,zoomActivationKeyCode:x,preventScrolling:F,noWheelClassName:$,noPanClassName:P,onViewportChange:k,isControlledViewport:N,paneClickDistance:l,selectionOnDrag:Q,children:I.jsxs(Hk,{onSelectionStart:d,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:B,isSelecting:!!G,selectionMode:c,selectionKeyPressed:A,paneClickDistance:l,selectionOnDrag:Q,children:[e,L&&I.jsx(Jk,{onSelectionContextMenu:S,noPanClassName:P,disableKeyboardA11y:R})]})})}Rm.displayName="FlowRenderer";const t2=O.memo(Rm),n2=e=>t=>e?ec(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function r2(e){return ne(O.useCallback(n2(e),[e]),de)}const o2=e=>e.updateNodeInternals;function i2(){const e=ne(o2),[t]=O.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return O.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function s2({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=he(),i=O.useRef(null),s=O.useRef(null),l=O.useRef(e.sourcePosition),u=O.useRef(e.targetPosition),a=O.useRef(t),f=n&&!!e.internals.handleBounds;return O.useEffect(()=>{i.current&&!e.hidden&&(!f||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[f,e.hidden]),O.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),O.useEffect(()=>{if(i.current){const c=a.current!==t,d=l.current!==e.sourcePosition,g=u.current!==e.targetPosition;(c||d||g)&&(a.current=t,l.current=e.sourcePosition,u.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function l2({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:u,nodesConnectable:a,nodesFocusable:f,resizeObserver:c,noDragClassName:d,noPanClassName:g,disableKeyboardA11y:y,rfId:v,nodeTypes:x,nodeClickDistance:h,onError:m}){const{node:p,internals:w,isParent:E}=ne(V=>{const K=V.nodeLookup.get(e),ee=V.parentLookup.has(e);return{node:K,internals:K.internals,isParent:ee}},de);let _=p.type||"default",C=(x==null?void 0:x[_])||Nd[_];C===void 0&&(m==null||m("003",kt.error003(_)),_="default",C=(x==null?void 0:x.default)||Nd.default);const M=!!(p.draggable||l&&typeof p.draggable>"u"),z=!!(p.selectable||u&&typeof p.selectable>"u"),D=!!(p.connectable||a&&typeof p.connectable>"u"),T=!!(p.focusable||f&&typeof p.focusable>"u"),b=he(),F=Kg(p),S=s2({node:p,nodeType:_,hasDimensions:F,resizeObserver:c}),$=zm({nodeRef:S,disabled:p.hidden||!M,noDragClassName:d,handleSelector:p.dragHandle,nodeId:e,isSelectable:z,nodeClickDistance:h}),P=Lm();if(p.hidden)return null;const R=Ft(p),k=Zk(p),N=z||M||t||n||r||o,L=n?V=>n(V,{...w.userNode}):void 0,j=r?V=>r(V,{...w.userNode}):void 0,A=o?V=>o(V,{...w.userNode}):void 0,W=i?V=>i(V,{...w.userNode}):void 0,B=s?V=>s(V,{...w.userNode}):void 0,X=V=>{const{selectNodesOnDrag:K,nodeDragThreshold:ee}=b.getState();z&&(!K||!M||ee>0)&&Ku({id:e,store:b,nodeRef:S}),t&&t(V,{...w.userNode})},Q=V=>{if(!(Jg(V.nativeEvent)||y)){if(Hg.includes(V.key)&&z){const K=V.key==="Escape";Ku({id:e,store:b,unselect:K,nodeRef:S})}else if(M&&p.selected&&Object.prototype.hasOwnProperty.call(vs,V.key)){V.preventDefault();const{ariaLabelConfig:K}=b.getState();b.setState({ariaLiveMessage:K["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),P({direction:vs[V.key],factor:V.shiftKey?4:1})}}},G=()=>{var ie;if(y||!((ie=S.current)!=null&&ie.matches(":focus-visible")))return;const{transform:V,width:K,height:ee,autoPanOnNodeFocus:J,setCenter:q}=b.getState();if(!J)return;ec(new Map([[e,p]]),{x:0,y:0,width:K,height:ee},V,!0).length>0||q(p.position.x+R.width/2,p.position.y+R.height/2,{zoom:V[2]})};return I.jsx("div",{className:xe(["react-flow__node",`react-flow__node-${_}`,{[g]:M},p.className,{selected:p.selected,selectable:z,parent:E,draggable:M,dragging:$}]),ref:S,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:N?"all":"none",visibility:F?"visible":"hidden",...p.style,...k},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:j,onMouseLeave:A,onContextMenu:W,onClick:X,onDoubleClick:B,onKeyDown:T?Q:void 0,tabIndex:T?0:void 0,onFocus:T?G:void 0,role:p.ariaRole??(T?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${Sm}-${v}`,"aria-label":p.ariaLabel,...p.domAttributes,children:I.jsx(Bk,{value:e,children:I.jsx(C,{id:e,data:p.data,type:_,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:p.selected??!1,selectable:z,draggable:M,deletable:p.deletable??!0,isConnectable:D,sourcePosition:p.sourcePosition,targetPosition:p.targetPosition,dragging:$,dragHandle:p.dragHandle,zIndex:w.z,parentId:p.parentId,...R})})})}var u2=O.memo(l2);const a2=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Om(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,onError:i}=ne(a2,de),s=r2(e.onlyRenderVisibleElements),l=i2();return I.jsx("div",{className:"react-flow__nodes",style:Gs,children:s.map(u=>I.jsx(u2,{id:u,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:i},u))})}Om.displayName="NodeRenderer";const c2=O.memo(Om);function f2(e){return ne(O.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&Z_({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),de)}const d2=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return I.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},h2=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return I.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Md={[zo.Arrow]:d2,[zo.ArrowClosed]:h2};function p2(e){const t=he();return O.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Md,e)?Md[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",kt.error009(e)),null)},[e])}const g2=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const u=p2(t);return u?I.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:I.jsx(u,{color:n,strokeWidth:s})}):null},bm=({defaultColor:e,rfId:t})=>{const n=ne(i=>i.edges),r=ne(i=>i.defaultEdgeOptions),o=O.useMemo(()=>oS(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?I.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:I.jsx("defs",{children:o.map(i=>I.jsx(g2,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};bm.displayName="MarkerDefinitions";var m2=O.memo(bm);function Am({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:u,className:a,...f}){const[c,d]=O.useState({x:1,y:0,width:0,height:0}),g=xe(["react-flow__edge-textwrapper",a]),y=O.useRef(null);return O.useEffect(()=>{if(y.current){const v=y.current.getBBox();d({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?I.jsxs("g",{transform:`translate(${e-c.width/2} ${t-c.height/2})`,className:g,visibility:c.width?"visible":"hidden",...f,children:[o&&I.jsx("rect",{width:c.width+2*s[0],x:-s[0],y:-s[1],height:c.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),I.jsx("text",{className:"react-flow__edge-text",y:c.height/2,dy:"0.3em",ref:y,style:r,children:n}),u]}):null}Am.displayName="EdgeText";const y2=O.memo(Am);function Ks({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:a=20,...f}){return I.jsxs(I.Fragment,{children:[I.jsx("path",{...f,d:e,fill:"none",className:xe(["react-flow__edge-path",f.className])}),a?I.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:a,className:"react-flow__edge-interaction"}):null,r&&ct(t)&&ct(n)?I.jsx(y2,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function Id({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===Y.Left||e===Y.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Dm({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:o,targetPosition:i=Y.Top}){const[s,l]=Id({pos:n,x1:e,y1:t,x2:r,y2:o}),[u,a]=Id({pos:i,x1:r,y1:o,x2:e,y2:t}),[f,c,d,g]=tm({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:a});return[`M${e},${t} C${s},${l} ${u},${a} ${r},${o}`,f,c,d,g]}function jm(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:u,labelStyle:a,labelShowBg:f,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,interactionWidth:h})=>{const[m,p,w]=Dm({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),E=e.isInternal?void 0:t;return I.jsx(Ks,{id:E,path:m,labelX:p,labelY:w,label:u,labelStyle:a,labelShowBg:f,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,interactionWidth:h})})}const v2=jm({isInternal:!1}),Fm=jm({isInternal:!0});v2.displayName="SimpleBezierEdge";Fm.displayName="SimpleBezierEdgeInternal";function Hm(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:f,labelBgBorderRadius:c,style:d,sourcePosition:g=Y.Bottom,targetPosition:y=Y.Top,markerEnd:v,markerStart:x,pathOptions:h,interactionWidth:m})=>{const[p,w,E]=Uu({sourceX:n,sourceY:r,sourcePosition:g,targetX:o,targetY:i,targetPosition:y,borderRadius:h==null?void 0:h.borderRadius,offset:h==null?void 0:h.offset,stepPosition:h==null?void 0:h.stepPosition}),_=e.isInternal?void 0:t;return I.jsx(Ks,{id:_,path:p,labelX:w,labelY:E,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:f,labelBgBorderRadius:c,style:d,markerEnd:v,markerStart:x,interactionWidth:m})})}const Vm=Hm({isInternal:!1}),Bm=Hm({isInternal:!0});Vm.displayName="SmoothStepEdge";Bm.displayName="SmoothStepEdgeInternal";function Wm(e){return O.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return I.jsx(Vm,{...n,id:r,pathOptions:O.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const w2=Wm({isInternal:!1}),Um=Wm({isInternal:!0});w2.displayName="StepEdge";Um.displayName="StepEdgeInternal";function Ym(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:f,labelBgBorderRadius:c,style:d,markerEnd:g,markerStart:y,interactionWidth:v})=>{const[x,h,m]=im({sourceX:n,sourceY:r,targetX:o,targetY:i}),p=e.isInternal?void 0:t;return I.jsx(Ks,{id:p,path:x,labelX:h,labelY:m,label:s,labelStyle:l,labelShowBg:u,labelBgStyle:a,labelBgPadding:f,labelBgBorderRadius:c,style:d,markerEnd:g,markerStart:y,interactionWidth:v})})}const x2=Ym({isInternal:!1}),Xm=Ym({isInternal:!0});x2.displayName="StraightEdge";Xm.displayName="StraightEdgeInternal";function Qm(e){return O.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=Y.Bottom,targetPosition:l=Y.Top,label:u,labelStyle:a,labelShowBg:f,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,pathOptions:h,interactionWidth:m})=>{const[p,w,E]=nm({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:h==null?void 0:h.curvature}),_=e.isInternal?void 0:t;return I.jsx(Ks,{id:_,path:p,labelX:w,labelY:E,label:u,labelStyle:a,labelShowBg:f,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,interactionWidth:m})})}const E2=Qm({isInternal:!1}),Gm=Qm({isInternal:!0});E2.displayName="BezierEdge";Gm.displayName="BezierEdgeInternal";const Pd={default:Gm,straight:Xm,step:Um,smoothstep:Bm,simplebezier:Fm},Td={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},_2=(e,t,n)=>n===Y.Left?e-t:n===Y.Right?e+t:e,S2=(e,t,n)=>n===Y.Top?e-t:n===Y.Bottom?e+t:e,zd="react-flow__edgeupdater";function Ld({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return I.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:xe([zd,`${zd}-${l}`]),cx:_2(t,r,e),cy:S2(n,r,e),r,stroke:"transparent",fill:"transparent"})}function k2({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:u,onReconnect:a,onReconnectStart:f,onReconnectEnd:c,setReconnecting:d,setUpdateHover:g}){const y=he(),v=(w,E)=>{if(w.button!==0)return;const{autoPanOnConnect:_,domNode:C,connectionMode:M,connectionRadius:z,lib:D,onConnectStart:T,cancelConnection:b,nodeLookup:F,rfId:S,panBy:$,updateConnection:P}=y.getState(),R=E.type==="target",k=(j,A)=>{d(!1),c==null||c(j,n,E.type,A)},N=j=>a==null?void 0:a(n,j),L=(j,A)=>{d(!0),f==null||f(w,n,E.type),T==null||T(j,A)};Qu.onPointerDown(w.nativeEvent,{autoPanOnConnect:_,connectionMode:M,connectionRadius:z,domNode:C,handleId:E.id,nodeId:E.nodeId,nodeLookup:F,isTarget:R,edgeUpdaterType:E.type,lib:D,flowId:S,cancelConnection:b,panBy:$,isValidConnection:(...j)=>{var A,W;return((W=(A=y.getState()).isValidConnection)==null?void 0:W.call(A,...j))??!0},onConnect:N,onConnectStart:L,onConnectEnd:(...j)=>{var A,W;return(W=(A=y.getState()).onConnectEnd)==null?void 0:W.call(A,...j)},onReconnectEnd:k,updateConnection:P,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},x=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),h=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),m=()=>g(!0),p=()=>g(!1);return I.jsxs(I.Fragment,{children:[(e===!0||e==="source")&&I.jsx(Ld,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:x,onMouseEnter:m,onMouseOut:p,type:"source"}),(e===!0||e==="target")&&I.jsx(Ld,{position:u,centerX:i,centerY:s,radius:t,onMouseDown:h,onMouseEnter:m,onMouseOut:p,type:"target"})]})}function N2({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,reconnectRadius:f,onReconnect:c,onReconnectStart:d,onReconnectEnd:g,rfId:y,edgeTypes:v,noPanClassName:x,onError:h,disableKeyboardA11y:m}){let p=ne(q=>q.edgeLookup.get(e));const w=ne(q=>q.defaultEdgeOptions);p=w?{...w,...p}:p;let E=p.type||"default",_=(v==null?void 0:v[E])||Pd[E];_===void 0&&(h==null||h("011",kt.error011(E)),E="default",_=(v==null?void 0:v.default)||Pd.default);const C=!!(p.focusable||t&&typeof p.focusable>"u"),M=typeof c<"u"&&(p.reconnectable||n&&typeof p.reconnectable>"u"),z=!!(p.selectable||r&&typeof p.selectable>"u"),D=O.useRef(null),[T,b]=O.useState(!1),[F,S]=O.useState(!1),$=he(),{zIndex:P,sourceX:R,sourceY:k,targetX:N,targetY:L,sourcePosition:j,targetPosition:A}=ne(O.useCallback(q=>{const Z=q.nodeLookup.get(p.source),ie=q.nodeLookup.get(p.target);if(!Z||!ie)return{zIndex:p.zIndex,...Td};const ue=rS({id:e,sourceNode:Z,targetNode:ie,sourceHandle:p.sourceHandle||null,targetHandle:p.targetHandle||null,connectionMode:q.connectionMode,onError:h});return{zIndex:K_({selected:p.selected,zIndex:p.zIndex,sourceNode:Z,targetNode:ie,elevateOnSelect:q.elevateEdgesOnSelect,zIndexMode:q.zIndexMode}),...ue||Td}},[p.source,p.target,p.sourceHandle,p.targetHandle,p.selected,p.zIndex]),de),W=O.useMemo(()=>p.markerStart?`url('#${Yu(p.markerStart,y)}')`:void 0,[p.markerStart,y]),B=O.useMemo(()=>p.markerEnd?`url('#${Yu(p.markerEnd,y)}')`:void 0,[p.markerEnd,y]);if(p.hidden||R===null||k===null||N===null||L===null)return null;const X=q=>{var oe;const{addSelectedEdges:Z,unselectNodesAndEdges:ie,multiSelectionActive:ue}=$.getState();z&&($.setState({nodesSelectionActive:!1}),p.selected&&ue?(ie({nodes:[],edges:[p]}),(oe=D.current)==null||oe.blur()):Z([e])),o&&o(q,p)},Q=i?q=>{i(q,{...p})}:void 0,G=s?q=>{s(q,{...p})}:void 0,V=l?q=>{l(q,{...p})}:void 0,K=u?q=>{u(q,{...p})}:void 0,ee=a?q=>{a(q,{...p})}:void 0,J=q=>{var Z;if(!m&&Hg.includes(q.key)&&z){const{unselectNodesAndEdges:ie,addSelectedEdges:ue}=$.getState();q.key==="Escape"?((Z=D.current)==null||Z.blur(),ie({edges:[p]})):ue([e])}};return I.jsx("svg",{style:{zIndex:P},children:I.jsxs("g",{className:xe(["react-flow__edge",`react-flow__edge-${E}`,p.className,x,{selected:p.selected,animated:p.animated,inactive:!z&&!o,updating:T,selectable:z}]),onClick:X,onDoubleClick:Q,onContextMenu:G,onMouseEnter:V,onMouseMove:K,onMouseLeave:ee,onKeyDown:C?J:void 0,tabIndex:C?0:void 0,role:p.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":p.ariaLabel===null?void 0:p.ariaLabel||`Edge from ${p.source} to ${p.target}`,"aria-describedby":C?`${km}-${y}`:void 0,ref:D,...p.domAttributes,children:[!F&&I.jsx(_,{id:e,source:p.source,target:p.target,type:p.type,selected:p.selected,animated:p.animated,selectable:z,deletable:p.deletable??!0,label:p.label,labelStyle:p.labelStyle,labelShowBg:p.labelShowBg,labelBgStyle:p.labelBgStyle,labelBgPadding:p.labelBgPadding,labelBgBorderRadius:p.labelBgBorderRadius,sourceX:R,sourceY:k,targetX:N,targetY:L,sourcePosition:j,targetPosition:A,data:p.data,style:p.style,sourceHandleId:p.sourceHandle,targetHandleId:p.targetHandle,markerStart:W,markerEnd:B,pathOptions:"pathOptions"in p?p.pathOptions:void 0,interactionWidth:p.interactionWidth}),M&&I.jsx(k2,{edge:p,isReconnectable:M,reconnectRadius:f,onReconnect:c,onReconnectStart:d,onReconnectEnd:g,sourceX:R,sourceY:k,targetX:N,targetY:L,sourcePosition:j,targetPosition:A,setUpdateHover:b,setReconnecting:S})]})})}var C2=O.memo(N2);const M2=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Km({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:a,onEdgeClick:f,reconnectRadius:c,onEdgeDoubleClick:d,onReconnectStart:g,onReconnectEnd:y,disableKeyboardA11y:v}){const{edgesFocusable:x,edgesReconnectable:h,elementsSelectable:m,onError:p}=ne(M2,de),w=f2(t);return I.jsxs("div",{className:"react-flow__edges",children:[I.jsx(m2,{defaultColor:e,rfId:n}),w.map(E=>I.jsx(C2,{id:E,edgesFocusable:x,edgesReconnectable:h,elementsSelectable:m,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:a,onClick:f,reconnectRadius:c,onDoubleClick:d,onReconnectStart:g,onReconnectEnd:y,rfId:n,onError:p,edgeTypes:r,disableKeyboardA11y:v},E))]})}Km.displayName="EdgeRenderer";const I2=O.memo(Km),P2=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function T2({children:e}){const t=ne(P2);return I.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function z2(e){const t=uc(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const L2=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function $2(e){const t=ne(L2),n=he();return O.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function R2(e){return e.connection.inProgress?{...e.connection,to:Yo(e.connection.to,e.transform)}:{...e.connection}}function O2(e){return R2}function b2(e){const t=O2();return ne(t,de)}const A2=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function D2({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:u}=ne(A2,de);return!(i&&o&&u)?null:I.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:I.jsx("g",{className:xe(["react-flow__connection",Wg(l)]),children:I.jsx(Zm,{style:t,type:n,CustomComponent:r,isValid:l})})})}const Zm=({style:e,type:t=Gt.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:u,to:a,toNode:f,toHandle:c,toPosition:d,pointer:g}=b2();if(!o)return;if(n)return I.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:i.x,fromY:i.y,toX:a.x,toY:a.y,fromPosition:u,toPosition:d,connectionStatus:Wg(r),toNode:f,toHandle:c,pointer:g});let y="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:u,targetX:a.x,targetY:a.y,targetPosition:d};switch(t){case Gt.Bezier:[y]=nm(v);break;case Gt.SimpleBezier:[y]=Dm(v);break;case Gt.Step:[y]=Uu({...v,borderRadius:0});break;case Gt.SmoothStep:[y]=Uu(v);break;default:[y]=im(v)}return I.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};Zm.displayName="ConnectionLine";const j2={};function $d(e=j2){O.useRef(e),he(),O.useEffect(()=>{},[e])}function F2(){he(),O.useRef(!1),O.useEffect(()=>{},[])}function qm({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:f,onSelectionContextMenu:c,onSelectionStart:d,onSelectionEnd:g,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:x,connectionLineContainerStyle:h,selectionKeyCode:m,selectionOnDrag:p,selectionMode:w,multiSelectionKeyCode:E,panActivationKeyCode:_,zoomActivationKeyCode:C,deleteKeyCode:M,onlyRenderVisibleElements:z,elementsSelectable:D,defaultViewport:T,translateExtent:b,minZoom:F,maxZoom:S,preventScrolling:$,defaultMarkerColor:P,zoomOnScroll:R,zoomOnPinch:k,panOnScroll:N,panOnScrollSpeed:L,panOnScrollMode:j,zoomOnDoubleClick:A,panOnDrag:W,onPaneClick:B,onPaneMouseEnter:X,onPaneMouseMove:Q,onPaneMouseLeave:G,onPaneScroll:V,onPaneContextMenu:K,paneClickDistance:ee,nodeClickDistance:J,onEdgeContextMenu:q,onEdgeMouseEnter:Z,onEdgeMouseMove:ie,onEdgeMouseLeave:ue,reconnectRadius:oe,onReconnect:Ie,onReconnectStart:Ht,onReconnectEnd:Ct,noDragClassName:pn,noWheelClassName:Pr,noPanClassName:Tr,disableKeyboardA11y:zr,nodeExtent:Js,rfId:Qo,viewport:Dn,onViewportChange:Lr}){return $d(e),$d(t),F2(),z2(n),$2(Dn),I.jsx(t2,{onPaneClick:B,onPaneMouseEnter:X,onPaneMouseMove:Q,onPaneMouseLeave:G,onPaneContextMenu:K,onPaneScroll:V,paneClickDistance:ee,deleteKeyCode:M,selectionKeyCode:m,selectionOnDrag:p,selectionMode:w,onSelectionStart:d,onSelectionEnd:g,multiSelectionKeyCode:E,panActivationKeyCode:_,zoomActivationKeyCode:C,elementsSelectable:D,zoomOnScroll:R,zoomOnPinch:k,zoomOnDoubleClick:A,panOnScroll:N,panOnScrollSpeed:L,panOnScrollMode:j,panOnDrag:W,defaultViewport:T,translateExtent:b,minZoom:F,maxZoom:S,onSelectionContextMenu:c,preventScrolling:$,noDragClassName:pn,noWheelClassName:Pr,noPanClassName:Tr,disableKeyboardA11y:zr,onViewportChange:Lr,isControlledViewport:!!Dn,children:I.jsxs(T2,{children:[I.jsx(I2,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:Ie,onReconnectStart:Ht,onReconnectEnd:Ct,onlyRenderVisibleElements:z,onEdgeContextMenu:q,onEdgeMouseEnter:Z,onEdgeMouseMove:ie,onEdgeMouseLeave:ue,reconnectRadius:oe,defaultMarkerColor:P,noPanClassName:Tr,disableKeyboardA11y:zr,rfId:Qo}),I.jsx(D2,{style:v,type:y,component:x,containerStyle:h}),I.jsx("div",{className:"react-flow__edgelabel-renderer"}),I.jsx(c2,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:a,onNodeContextMenu:f,nodeClickDistance:J,onlyRenderVisibleElements:z,noPanClassName:Tr,noDragClassName:pn,disableKeyboardA11y:zr,nodeExtent:Js,rfId:Qo}),I.jsx("div",{className:"react-flow__viewport-portal"})]})})}qm.displayName="GraphView";const H2=O.memo(qm),Rd=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:u=.5,maxZoom:a=2,nodeOrigin:f,nodeExtent:c,zIndexMode:d="basic"}={})=>{const g=new Map,y=new Map,v=new Map,x=new Map,h=r??t??[],m=n??e??[],p=f??[0,0],w=c??Po;um(v,x,h);const{nodesInitialized:E}=Xu(m,g,y,{nodeOrigin:p,nodeExtent:w,zIndexMode:d});let _=[0,0,1];if(s&&o&&i){const C=Wo(g,{filter:T=>!!((T.width||T.initialWidth)&&(T.height||T.initialHeight))}),{x:M,y:z,zoom:D}=tc(C,o,i,u,a,(l==null?void 0:l.padding)??.1);_=[M,z,D]}return{rfId:"1",width:o??0,height:i??0,transform:_,nodes:m,nodesInitialized:E,nodeLookup:g,parentLookup:y,edges:h,edgeLookup:x,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:a,translateExtent:Po,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:vr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:p,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:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...Bg},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:W_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Vg,zIndexMode:d,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},V2=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:u,maxZoom:a,nodeOrigin:f,nodeExtent:c,zIndexMode:d})=>lk((g,y)=>{async function v(){const{nodeLookup:x,panZoom:h,fitViewOptions:m,fitViewResolver:p,width:w,height:E,minZoom:_,maxZoom:C}=y();h&&(await V_({nodes:x,width:w,height:E,panZoom:h,minZoom:_,maxZoom:C},m),p==null||p.resolve(!0),g({fitViewResolver:null}))}return{...Rd({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:u,maxZoom:a,nodeOrigin:f,nodeExtent:c,defaultNodes:n,defaultEdges:r,zIndexMode:d}),setNodes:x=>{const{nodeLookup:h,parentLookup:m,nodeOrigin:p,elevateNodesOnSelect:w,fitViewQueued:E,zIndexMode:_,nodesSelectionActive:C}=y(),{nodesInitialized:M,hasSelectedNodes:z}=Xu(x,h,m,{nodeOrigin:p,nodeExtent:c,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:_}),D=C&&z;E&&M?(v(),g({nodes:x,nodesInitialized:M,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):g({nodes:x,nodesInitialized:M,nodesSelectionActive:D})},setEdges:x=>{const{connectionLookup:h,edgeLookup:m}=y();um(h,m,x),g({edges:x})},setDefaultNodesAndEdges:(x,h)=>{if(x){const{setNodes:m}=y();m(x),g({hasDefaultNodes:!0})}if(h){const{setEdges:m}=y();m(h),g({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:h,nodeLookup:m,parentLookup:p,domNode:w,nodeOrigin:E,nodeExtent:_,debug:C,fitViewQueued:M,zIndexMode:z}=y(),{changes:D,updatedInternals:T}=fS(x,m,p,w,E,_,z);T&&(lS(m,p,{nodeOrigin:E,nodeExtent:_,zIndexMode:z}),M?(v(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(D==null?void 0:D.length)>0&&(C&&console.log("React Flow: trigger node changes",D),h==null||h(D)))},updateNodePositions:(x,h=!1)=>{const m=[];let p=[];const{nodeLookup:w,triggerNodeChanges:E,connection:_,updateConnection:C,onNodesChangeMiddlewareMap:M}=y();for(const[z,D]of x){const T=w.get(z),b=!!(T!=null&&T.expandParent&&(T!=null&&T.parentId)&&(D!=null&&D.position)),F={id:z,type:"position",position:b?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:h};if(T&&_.inProgress&&_.fromNode.id===T.id){const S=Rn(T,_.fromHandle,Y.Left,!0);C({..._,from:S})}b&&T.parentId&&m.push({id:z,parentId:T.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),p.push(F)}if(m.length>0){const{parentLookup:z,nodeOrigin:D}=y(),T=lc(m,w,z,D);p.push(...T)}for(const z of M.values())p=z(p);E(p)},triggerNodeChanges:x=>{const{onNodesChange:h,setNodes:m,nodes:p,hasDefaultNodes:w,debug:E}=y();if(x!=null&&x.length){if(w){const _=Mm(x,p);m(_)}E&&console.log("React Flow: trigger node changes",x),h==null||h(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:h,setEdges:m,edges:p,hasDefaultEdges:w,debug:E}=y();if(x!=null&&x.length){if(w){const _=Im(x,p);m(_)}E&&console.log("React Flow: trigger edge changes",x),h==null||h(x)}},addSelectedNodes:x=>{const{multiSelectionActive:h,edgeLookup:m,nodeLookup:p,triggerNodeChanges:w,triggerEdgeChanges:E}=y();if(h){const _=x.map(C=>yn(C,!0));w(_);return}w(er(p,new Set([...x]),!0)),E(er(m))},addSelectedEdges:x=>{const{multiSelectionActive:h,edgeLookup:m,nodeLookup:p,triggerNodeChanges:w,triggerEdgeChanges:E}=y();if(h){const _=x.map(C=>yn(C,!0));E(_);return}E(er(m,new Set([...x]))),w(er(p,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:h}={})=>{const{edges:m,nodes:p,nodeLookup:w,triggerNodeChanges:E,triggerEdgeChanges:_}=y(),C=x||p,M=h||m,z=[];for(const T of C){if(!T.selected)continue;const b=w.get(T.id);b&&(b.selected=!1),z.push(yn(T.id,!1))}const D=[];for(const T of M)T.selected&&D.push(yn(T.id,!1));E(z),_(D)},setMinZoom:x=>{const{panZoom:h,maxZoom:m}=y();h==null||h.setScaleExtent([x,m]),g({minZoom:x})},setMaxZoom:x=>{const{panZoom:h,minZoom:m}=y();h==null||h.setScaleExtent([m,x]),g({maxZoom:x})},setTranslateExtent:x=>{var h;(h=y().panZoom)==null||h.setTranslateExtent(x),g({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:h,triggerNodeChanges:m,triggerEdgeChanges:p,elementsSelectable:w}=y();if(!w)return;const E=h.reduce((C,M)=>M.selected?[...C,yn(M.id,!1)]:C,[]),_=x.reduce((C,M)=>M.selected?[...C,yn(M.id,!1)]:C,[]);m(E),p(_)},setNodeExtent:x=>{const{nodes:h,nodeLookup:m,parentLookup:p,nodeOrigin:w,elevateNodesOnSelect:E,nodeExtent:_,zIndexMode:C}=y();x[0][0]===_[0][0]&&x[0][1]===_[0][1]&&x[1][0]===_[1][0]&&x[1][1]===_[1][1]||(Xu(h,m,p,{nodeOrigin:w,nodeExtent:x,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:C}),g({nodeExtent:x}))},panBy:x=>{const{transform:h,width:m,height:p,panZoom:w,translateExtent:E}=y();return dS({delta:x,panZoom:w,transform:h,translateExtent:E,width:m,height:p})},setCenter:async(x,h,m)=>{const{width:p,height:w,maxZoom:E,panZoom:_}=y();if(!_)return Promise.resolve(!1);const C=typeof(m==null?void 0:m.zoom)<"u"?m.zoom:E;return await _.setViewport({x:p/2-x*C,y:w/2-h*C,zoom:C},{duration:m==null?void 0:m.duration,ease:m==null?void 0:m.ease,interpolate:m==null?void 0:m.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{g({connection:{...Bg}})},updateConnection:x=>{g({connection:x})},reset:()=>g({...Rd()})}},Object.is);function Jm({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:u,fitView:a,nodeOrigin:f,nodeExtent:c,zIndexMode:d,children:g}){const[y]=O.useState(()=>V2({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:a,minZoom:s,maxZoom:l,fitViewOptions:u,nodeOrigin:f,nodeExtent:c,zIndexMode:d}));return I.jsx(uk,{value:y,children:I.jsx(Tk,{children:g})})}function B2({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:u,minZoom:a,maxZoom:f,nodeOrigin:c,nodeExtent:d,zIndexMode:g}){return O.useContext(Xs)?I.jsx(I.Fragment,{children:e}):I.jsx(Jm,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:u,initialMinZoom:a,initialMaxZoom:f,nodeOrigin:c,nodeExtent:d,zIndexMode:g,children:e})}const W2={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function U2({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:u,onInit:a,onMove:f,onMoveStart:c,onMoveEnd:d,onConnect:g,onConnectStart:y,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:h,onNodeMouseEnter:m,onNodeMouseMove:p,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:_,onNodeDragStart:C,onNodeDrag:M,onNodeDragStop:z,onNodesDelete:D,onEdgesDelete:T,onDelete:b,onSelectionChange:F,onSelectionDragStart:S,onSelectionDrag:$,onSelectionDragStop:P,onSelectionContextMenu:R,onSelectionStart:k,onSelectionEnd:N,onBeforeDelete:L,connectionMode:j,connectionLineType:A=Gt.Bezier,connectionLineStyle:W,connectionLineComponent:B,connectionLineContainerStyle:X,deleteKeyCode:Q="Backspace",selectionKeyCode:G="Shift",selectionOnDrag:V=!1,selectionMode:K=To.Full,panActivationKeyCode:ee="Space",multiSelectionKeyCode:J=$o()?"Meta":"Control",zoomActivationKeyCode:q=$o()?"Meta":"Control",snapToGrid:Z,snapGrid:ie,onlyRenderVisibleElements:ue=!1,selectNodesOnDrag:oe,nodesDraggable:Ie,autoPanOnNodeFocus:Ht,nodesConnectable:Ct,nodesFocusable:pn,nodeOrigin:Pr=Nm,edgesFocusable:Tr,edgesReconnectable:zr,elementsSelectable:Js=!0,defaultViewport:Qo=Ek,minZoom:Dn=.5,maxZoom:Lr=2,translateExtent:gc=Po,preventScrolling:P0=!0,nodeExtent:el,defaultMarkerColor:T0="#b1b1b7",zoomOnScroll:z0=!0,zoomOnPinch:L0=!0,panOnScroll:$0=!1,panOnScrollSpeed:R0=.5,panOnScrollMode:O0=Nn.Free,zoomOnDoubleClick:b0=!0,panOnDrag:A0=!0,onPaneClick:D0,onPaneMouseEnter:j0,onPaneMouseMove:F0,onPaneMouseLeave:H0,onPaneScroll:V0,onPaneContextMenu:B0,paneClickDistance:W0=1,nodeClickDistance:U0=0,children:Y0,onReconnect:X0,onReconnectStart:Q0,onReconnectEnd:G0,onEdgeContextMenu:K0,onEdgeDoubleClick:Z0,onEdgeMouseEnter:q0,onEdgeMouseMove:J0,onEdgeMouseLeave:ey,reconnectRadius:ty=10,onNodesChange:ny,onEdgesChange:ry,noDragClassName:oy="nodrag",noWheelClassName:iy="nowheel",noPanClassName:mc="nopan",fitView:yc,fitViewOptions:vc,connectOnClick:sy,attributionPosition:ly,proOptions:uy,defaultEdgeOptions:ay,elevateNodesOnSelect:cy=!0,elevateEdgesOnSelect:fy=!1,disableKeyboardA11y:wc=!1,autoPanOnConnect:dy,autoPanOnNodeDrag:hy,autoPanSpeed:py,connectionRadius:gy,isValidConnection:my,onError:yy,style:vy,id:xc,nodeDragThreshold:wy,connectionDragThreshold:xy,viewport:Ey,onViewportChange:_y,width:Sy,height:ky,colorMode:Ny="light",debug:Cy,onScroll:Go,ariaLabelConfig:My,zIndexMode:Ec="basic",...Iy},Py){const tl=xc||"1",Ty=Nk(Ny),zy=O.useCallback(_c=>{_c.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Go==null||Go(_c)},[Go]);return I.jsx("div",{"data-testid":"rf__wrapper",...Iy,onScroll:zy,style:{...vy,...W2},ref:Py,className:xe(["react-flow",o,Ty]),id:xc,role:"application",children:I.jsxs(B2,{nodes:e,edges:t,width:Sy,height:ky,fitView:yc,fitViewOptions:vc,minZoom:Dn,maxZoom:Lr,nodeOrigin:Pr,nodeExtent:el,zIndexMode:Ec,children:[I.jsx(kk,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:y,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:h,nodesDraggable:Ie,autoPanOnNodeFocus:Ht,nodesConnectable:Ct,nodesFocusable:pn,edgesFocusable:Tr,edgesReconnectable:zr,elementsSelectable:Js,elevateNodesOnSelect:cy,elevateEdgesOnSelect:fy,minZoom:Dn,maxZoom:Lr,nodeExtent:el,onNodesChange:ny,onEdgesChange:ry,snapToGrid:Z,snapGrid:ie,connectionMode:j,translateExtent:gc,connectOnClick:sy,defaultEdgeOptions:ay,fitView:yc,fitViewOptions:vc,onNodesDelete:D,onEdgesDelete:T,onDelete:b,onNodeDragStart:C,onNodeDrag:M,onNodeDragStop:z,onSelectionDrag:$,onSelectionDragStart:S,onSelectionDragStop:P,onMove:f,onMoveStart:c,onMoveEnd:d,noPanClassName:mc,nodeOrigin:Pr,rfId:tl,autoPanOnConnect:dy,autoPanOnNodeDrag:hy,autoPanSpeed:py,onError:yy,connectionRadius:gy,isValidConnection:my,selectNodesOnDrag:oe,nodeDragThreshold:wy,connectionDragThreshold:xy,onBeforeDelete:L,debug:Cy,ariaLabelConfig:My,zIndexMode:Ec}),I.jsx(H2,{onInit:a,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:m,onNodeMouseMove:p,onNodeMouseLeave:w,onNodeContextMenu:E,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:A,connectionLineStyle:W,connectionLineComponent:B,connectionLineContainerStyle:X,selectionKeyCode:G,selectionOnDrag:V,selectionMode:K,deleteKeyCode:Q,multiSelectionKeyCode:J,panActivationKeyCode:ee,zoomActivationKeyCode:q,onlyRenderVisibleElements:ue,defaultViewport:Qo,translateExtent:gc,minZoom:Dn,maxZoom:Lr,preventScrolling:P0,zoomOnScroll:z0,zoomOnPinch:L0,zoomOnDoubleClick:b0,panOnScroll:$0,panOnScrollSpeed:R0,panOnScrollMode:O0,panOnDrag:A0,onPaneClick:D0,onPaneMouseEnter:j0,onPaneMouseMove:F0,onPaneMouseLeave:H0,onPaneScroll:V0,onPaneContextMenu:B0,paneClickDistance:W0,nodeClickDistance:U0,onSelectionContextMenu:R,onSelectionStart:k,onSelectionEnd:N,onReconnect:X0,onReconnectStart:Q0,onReconnectEnd:G0,onEdgeContextMenu:K0,onEdgeDoubleClick:Z0,onEdgeMouseEnter:q0,onEdgeMouseMove:J0,onEdgeMouseLeave:ey,reconnectRadius:ty,defaultMarkerColor:T0,noDragClassName:oy,noWheelClassName:iy,noPanClassName:mc,rfId:tl,disableKeyboardA11y:wc,nodeExtent:el,viewport:Ey,onViewportChange:_y}),I.jsx(xk,{onSelectionChange:F}),Y0,I.jsx(gk,{proOptions:uy,position:ly}),I.jsx(pk,{rfId:tl,disableKeyboardA11y:wc})]})})}var Y2=Pm(U2);function X2(e){const[t,n]=O.useState(e),r=O.useCallback(o=>n(i=>Mm(o,i)),[]);return[t,n,r]}function Q2(e){const[t,n]=O.useState(e),r=O.useCallback(o=>n(i=>Im(o,i)),[]);return[t,n,r]}function G2({dimensions:e,lineWidth:t,variant:n,className:r}){return I.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xe(["react-flow__background-pattern",n,r])})}function K2({radius:e,className:t}){return I.jsx("circle",{cx:e,cy:e,r:e,className:xe(["react-flow__background-pattern","dots",t])})}var ln;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(ln||(ln={}));const Z2={[ln.Dots]:1,[ln.Lines]:1,[ln.Cross]:6},q2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function e0({id:e,variant:t=ln.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:u,className:a,patternClassName:f}){const c=O.useRef(null),{transform:d,patternId:g}=ne(q2,de),y=r||Z2[t],v=t===ln.Dots,x=t===ln.Cross,h=Array.isArray(n)?n:[n,n],m=[h[0]*d[2]||1,h[1]*d[2]||1],p=y*d[2],w=Array.isArray(i)?i:[i,i],E=x?[p,p]:m,_=[w[0]*d[2]||1+E[0]/2,w[1]*d[2]||1+E[1]/2],C=`${g}${e||""}`;return I.jsxs("svg",{className:xe(["react-flow__background",a]),style:{...u,...Gs,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:c,"data-testid":"rf__background",children:[I.jsx("pattern",{id:C,x:d[0]%m[0],y:d[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:v?I.jsx(K2,{radius:p/2,className:f}):I.jsx(G2,{dimensions:E,lineWidth:o,variant:t,className:f})}),I.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}e0.displayName="Background";const J2=O.memo(e0);function eN(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:I.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function tN(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:I.jsx("path",{d:"M0 0h32v4.2H0z"})})}function nN(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:I.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 rN(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:I.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 oN(){return I.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:I.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 Ei({children:e,className:t,...n}){return I.jsx("button",{type:"button",className:xe(["react-flow__controls-button",t]),...n,children:e})}const iN=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function t0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:u,className:a,children:f,position:c="bottom-left",orientation:d="vertical","aria-label":g}){const y=he(),{isInteractive:v,minZoomReached:x,maxZoomReached:h,ariaLabelConfig:m}=ne(iN,de),{zoomIn:p,zoomOut:w,fitView:E}=uc(),_=()=>{p(),i==null||i()},C=()=>{w(),s==null||s()},M=()=>{E(o),l==null||l()},z=()=>{y.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),u==null||u(!v)},D=d==="horizontal"?"horizontal":"vertical";return I.jsxs(Qs,{className:xe(["react-flow__controls",D,a]),position:c,style:e,"data-testid":"rf__controls","aria-label":g??m["controls.ariaLabel"],children:[t&&I.jsxs(I.Fragment,{children:[I.jsx(Ei,{onClick:_,className:"react-flow__controls-zoomin",title:m["controls.zoomIn.ariaLabel"],"aria-label":m["controls.zoomIn.ariaLabel"],disabled:h,children:I.jsx(eN,{})}),I.jsx(Ei,{onClick:C,className:"react-flow__controls-zoomout",title:m["controls.zoomOut.ariaLabel"],"aria-label":m["controls.zoomOut.ariaLabel"],disabled:x,children:I.jsx(tN,{})})]}),n&&I.jsx(Ei,{className:"react-flow__controls-fitview",onClick:M,title:m["controls.fitView.ariaLabel"],"aria-label":m["controls.fitView.ariaLabel"],children:I.jsx(nN,{})}),r&&I.jsx(Ei,{className:"react-flow__controls-interactive",onClick:z,title:m["controls.interactive.ariaLabel"],"aria-label":m["controls.interactive.ariaLabel"],children:v?I.jsx(oN,{}):I.jsx(rN,{})}),f]})}t0.displayName="Controls";const sN=O.memo(t0);function lN({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:u,className:a,borderRadius:f,shapeRendering:c,selected:d,onClick:g}){const{background:y,backgroundColor:v}=i||{},x=s||y||v;return I.jsx("rect",{className:xe(["react-flow__minimap-node",{selected:d},a]),x:t,y:n,rx:f,ry:f,width:r,height:o,style:{fill:x,stroke:l,strokeWidth:u},shapeRendering:c,onClick:g?h=>g(h,e):void 0})}const uN=O.memo(lN),aN=e=>e.nodes.map(t=>t.id),Al=e=>e instanceof Function?e:()=>e;function cN({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=uN,onClick:s}){const l=ne(aN,de),u=Al(t),a=Al(e),f=Al(n),c=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return I.jsx(I.Fragment,{children:l.map(d=>I.jsx(dN,{id:d,nodeColorFunc:u,nodeStrokeColorFunc:a,nodeClassNameFunc:f,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:c},d))})}function fN({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:u}){const{node:a,x:f,y:c,width:d,height:g}=ne(y=>{const v=y.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const x=v.internals.userNode,{x:h,y:m}=v.internals.positionAbsolute,{width:p,height:w}=Ft(x);return{node:x,x:h,y:m,width:p,height:w}},de);return!a||a.hidden||!Kg(a)?null:I.jsx(l,{x:f,y:c,width:d,height:g,style:a.style,selected:!!a.selected,className:r(a),color:t(a),borderRadius:o,strokeColor:n(a),strokeWidth:i,shapeRendering:s,onClick:u,id:a.id})}const dN=O.memo(fN);var hN=O.memo(cN);const pN=200,gN=150,mN=e=>!e.hidden,yN=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Gg(Wo(e.nodeLookup,{filter:mN}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},vN="react-flow__minimap-desc";function n0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:u,maskColor:a,maskStrokeColor:f,maskStrokeWidth:c,position:d="bottom-right",onClick:g,onNodeClick:y,pannable:v=!1,zoomable:x=!1,ariaLabel:h,inversePan:m,zoomStep:p=1,offsetScale:w=5}){const E=he(),_=O.useRef(null),{boundingRect:C,viewBB:M,rfId:z,panZoom:D,translateExtent:T,flowWidth:b,flowHeight:F,ariaLabelConfig:S}=ne(yN,de),$=(e==null?void 0:e.width)??pN,P=(e==null?void 0:e.height)??gN,R=C.width/$,k=C.height/P,N=Math.max(R,k),L=N*$,j=N*P,A=w*N,W=C.x-(L-C.width)/2-A,B=C.y-(j-C.height)/2-A,X=L+A*2,Q=j+A*2,G=`${vN}-${z}`,V=O.useRef(0),K=O.useRef();V.current=N,O.useEffect(()=>{if(_.current&&D)return K.current=ES({domNode:_.current,panZoom:D,getTransform:()=>E.getState().transform,getViewScale:()=>V.current}),()=>{var Z;(Z=K.current)==null||Z.destroy()}},[D]),O.useEffect(()=>{var Z;(Z=K.current)==null||Z.update({translateExtent:T,width:b,height:F,inversePan:m,pannable:v,zoomStep:p,zoomable:x})},[v,x,m,p,T,b,F]);const ee=g?Z=>{var oe;const[ie,ue]=((oe=K.current)==null?void 0:oe.pointer(Z))||[0,0];g(Z,{x:ie,y:ue})}:void 0,J=y?O.useCallback((Z,ie)=>{const ue=E.getState().nodeLookup.get(ie).internals.userNode;y(Z,ue)},[]):void 0,q=h??S["minimap.ariaLabel"];return I.jsx(Qs,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-stroke-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-width-props":typeof c=="number"?c*N:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:xe(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:I.jsxs("svg",{width:$,height:P,viewBox:`${W} ${B} ${X} ${Q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":G,ref:_,onClick:ee,children:[q&&I.jsx("title",{id:G,children:q}),I.jsx(hN,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),I.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-A},${B-A}h${X+A*2}v${Q+A*2}h${-X-A*2}z
|
|
62
|
-
M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}n0.displayName="MiniMap";const wN=O.memo(n0),xN=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,EN={[_r.Line]:"right",[_r.Handle]:"bottom-right"};function _N({nodeId:e,position:t,variant:n=_r.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:u=10,maxWidth:a=Number.MAX_VALUE,maxHeight:f=Number.MAX_VALUE,keepAspectRatio:c=!1,resizeDirection:d,autoScale:g=!0,shouldResize:y,onResizeStart:v,onResize:x,onResizeEnd:h}){const m=$m(),p=typeof e=="string"?e:m,w=he(),E=O.useRef(null),_=n===_r.Handle,C=ne(O.useCallback(xN(_&&g),[_,g]),de),M=O.useRef(null),z=t??EN[n];O.useEffect(()=>{if(!(!E.current||!p))return M.current||(M.current=OS({domNode:E.current,nodeId:p,getStoreItems:()=>{const{nodeLookup:T,transform:b,snapGrid:F,snapToGrid:S,nodeOrigin:$,domNode:P}=w.getState();return{nodeLookup:T,transform:b,snapGrid:F,snapToGrid:S,nodeOrigin:$,paneDomNode:P}},onChange:(T,b)=>{const{triggerNodeChanges:F,nodeLookup:S,parentLookup:$,nodeOrigin:P}=w.getState(),R=[],k={x:T.x,y:T.y},N=S.get(p);if(N&&N.expandParent&&N.parentId){const L=N.origin??P,j=T.width??N.measured.width??0,A=T.height??N.measured.height??0,W={id:N.id,parentId:N.parentId,rect:{width:j,height:A,...Zg({x:T.x??N.position.x,y:T.y??N.position.y},{width:j,height:A},N.parentId,S,L)}},B=lc([W],S,$,P);R.push(...B),k.x=T.x?Math.max(L[0]*j,T.x):void 0,k.y=T.y?Math.max(L[1]*A,T.y):void 0}if(k.x!==void 0&&k.y!==void 0){const L={id:p,type:"position",position:{...k}};R.push(L)}if(T.width!==void 0&&T.height!==void 0){const j={id:p,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:T.width,height:T.height}};R.push(j)}for(const L of b){const j={...L,type:"position"};R.push(j)}F(R)},onEnd:({width:T,height:b})=>{const F={id:p,type:"dimensions",resizing:!1,dimensions:{width:T,height:b}};w.getState().triggerNodeChanges([F])}})),M.current.update({controlPosition:z,boundaries:{minWidth:l,minHeight:u,maxWidth:a,maxHeight:f},keepAspectRatio:c,resizeDirection:d,onResizeStart:v,onResize:x,onResizeEnd:h,shouldResize:y}),()=>{var T;(T=M.current)==null||T.destroy()}},[z,l,u,a,f,c,v,x,h,y]);const D=z.split("-");return I.jsx("div",{className:xe(["react-flow__resize-control","nodrag",...D,n,r]),ref:E,style:{...o,scale:C,...s&&{[_?"backgroundColor":"borderColor"]:s}},children:i})}O.memo(_N);function SN({data:e}){const{label:t,file:n,stateSlots:r,isContextProvider:o,renderCount:i,isRecentlyRendered:s}=e;return I.jsxs("div",{style:{background:s?"#1e3a2f":"#1a1d27",border:`1.5px solid ${s?"#22c55e":o?"#818cf8":"#2e3348"}`,borderRadius:10,padding:"10px 14px",minWidth:160,fontFamily:"monospace",transition:"border-color 0.2s, background 0.2s",boxShadow:s?"0 0 12px #22c55e44":"0 2px 8px #00000044"},children:[I.jsx(cn,{type:"target",position:Y.Top,style:{background:"#4b5563"}}),I.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[o&&I.jsx("span",{style:{fontSize:9,background:"#4338ca",color:"#c7d2fe",padding:"1px 5px",borderRadius:4},children:"CTX"}),I.jsx("span",{style:{color:"#e2e8f0",fontWeight:700,fontSize:13},children:t})]}),I.jsx("div",{style:{color:"#64748b",fontSize:10,marginBottom:r.length>0?6:0},children:n}),r.length>0&&I.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:4},children:r.map(l=>I.jsx("span",{style:{fontSize:10,background:"#172554",color:"#93c5fd",padding:"1px 6px",borderRadius:4,border:"1px solid #1e3a8a"},children:l},l))}),i>0&&I.jsx("div",{style:{position:"absolute",top:-8,right:-8,background:s?"#22c55e":"#334155",color:s?"#fff":"#94a3b8",fontSize:10,fontWeight:700,borderRadius:999,padding:"1px 6px",minWidth:20,textAlign:"center",transition:"background 0.2s"},children:i}),I.jsx(cn,{type:"source",position:Y.Bottom,style:{background:"#4b5563"}})]})}function kN({data:e}){const{label:t,file:n,renderCount:r,isRecentlyRendered:o}=e;return I.jsxs("div",{style:{background:o?"#1e1b40":"#13111f",border:`1.5px solid ${o?"#818cf8":"#3730a3"}`,borderRadius:10,padding:"10px 14px",minWidth:150,fontFamily:"monospace",transition:"border-color 0.2s, background 0.2s",boxShadow:o?"0 0 12px #818cf844":"0 2px 8px #00000044"},children:[I.jsx(cn,{type:"target",position:Y.Top,style:{background:"#4b5563"}}),I.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[I.jsx("span",{style:{fontSize:9,background:"#4338ca",color:"#c7d2fe",padding:"1px 5px",borderRadius:4},children:"CONTEXT"}),I.jsx("span",{style:{color:"#c7d2fe",fontWeight:700,fontSize:13},children:t})]}),I.jsx("div",{style:{color:"#64748b",fontSize:10},children:n}),r>0&&I.jsx("div",{style:{position:"absolute",top:-8,right:-8,background:o?"#818cf8":"#334155",color:"#fff",fontSize:10,fontWeight:700,borderRadius:999,padding:"1px 6px",minWidth:20,textAlign:"center"},children:r}),I.jsx(cn,{type:"source",position:Y.Bottom,style:{background:"#4b5563"}})]})}const NN=800,CN=window.__RSF_PORT__??7272;function MN(e,t){const n=O.useRef({renderCounts:{},recentlyRendered:new Set}),r=O.useRef(new Map),o=O.useCallback(s=>{const l=n.current;l.renderCounts[s.componentName]=s.renderCount,l.recentlyRendered.add(s.componentName);const u=r.current.get(s.componentName);u&&clearTimeout(u);const a=setTimeout(()=>{n.current.recentlyRendered.delete(s.componentName),e({...n.current,recentlyRendered:new Set(n.current.recentlyRendered)})},NN);r.current.set(s.componentName,a),e({...l,recentlyRendered:new Set(l.recentlyRendered)})},[e]),i=O.useCallback(s=>{n.current.renderCounts[s.componentName]=s.renderCount},[]);O.useEffect(()=>{let s=null,l=!1,u=2e3;function a(){l||(s=new WebSocket(`ws://${window.location.hostname}:${CN}/runtime-ui`),s.addEventListener("message",f=>{try{const c=JSON.parse(f.data);if(c.type==="render")o(c);else if(c.type==="graph-update"&&t)t(c.graph);else if(c.type==="history"&&Array.isArray(c.events)){for(const d of c.events)d.type==="render"&&i(d);e({...n.current,recentlyRendered:new Set})}}catch{}}),s.addEventListener("open",()=>{u=2e3}),s.addEventListener("close",()=>{l||(setTimeout(a,u),u=Math.min(u*2,3e4))}))}return a(),()=>{l=!0,s==null||s.close(),r.current.forEach(clearTimeout)}},[o,i,e,t])}var r0=Object.defineProperty,IN=(e,t,n)=>t in e?r0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PN=(e,t)=>{for(var n in t)r0(e,n,{get:t[n],enumerable:!0})},TN=(e,t,n)=>IN(e,t+"",n),o0={};PN(o0,{Graph:()=>rt,alg:()=>cc,json:()=>s0,version:()=>$N});var zN=Object.defineProperty,i0=(e,t)=>{for(var n in t)zN(e,n,{get:t[n],enumerable:!0})},rt=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected="directed"in e?e.directed:!0,this._isMultigraph="multigraph"in e?e.multigraph:!1,this._isCompound="compound"in e?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e!="function"?this._defaultNodeLabelFn=()=>e:this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(n=>{t!==void 0?this.setNode(n,t):this.setNode(n)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(n=>{this.setParent(n)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(t===void 0)t="\0";else{t+="";for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!=="\0")return t}}children(e="\0"){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e==="\0")return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){let t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([o,i])=>{e(o)&&t.setNode(o,i)}),Object.values(this._edgeObjs).forEach(o=>{t.hasNode(o.v)&&t.hasNode(o.w)&&t.setEdge(o,this.edge(o))});let n={},r=o=>{let i=this.parent(o);return!i||t.hasNode(i)?(n[o]=i??void 0,i??void 0):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(o=>t.setParent(o,r(o))),t}setDefaultEdgeLabel(e){return typeof e!="function"?this._defaultEdgeLabelFn=()=>e:this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((n,r)=>(t!==void 0?this.setEdge(n,r,t):this.setEdge(n,r),r)),this}setEdge(e,t,n,r){let o,i,s,l,u=!1;typeof e=="object"&&e!==null&&"v"in e?(o=e.v,i=e.w,s=e.name,arguments.length===2&&(l=t,u=!0)):(o=e,i=t,s=r,arguments.length>2&&(l=n,u=!0)),o=""+o,i=""+i,s!==void 0&&(s=""+s);let a=Gr(this._isDirected,o,i,s);if(a in this._edgeLabels)return u&&(this._edgeLabels[a]=l),this;if(s!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(o),this.setNode(i),this._edgeLabels[a]=u?l:this._defaultEdgeLabelFn(o,i,s);let f=LN(this._isDirected,o,i,s);return o=f.v,i=f.w,Object.freeze(f),this._edgeObjs[a]=f,Od(this._preds[i],o),Od(this._sucs[o],i),this._in[i][a]=f,this._out[o][a]=f,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?Dl(this._isDirected,e):Gr(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!="object"?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?Dl(this._isDirected,e):Gr(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Dl(this._isDirected,e):Gr(this._isDirected,e,t,n),o=this._edgeObjs[r];if(o){let i=o.v,s=o.w;delete this._edgeLabels[r],delete this._edgeObjs[r],bd(this._preds[s],i),bd(this._sucs[i],s),delete this._in[s][r],delete this._out[i][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(o=>o.v===t&&o.w===n||o.v===n&&o.w===t):r}};function Od(e,t){e[t]?e[t]++:e[t]=1}function bd(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Gr(e,t,n,r){let o=""+t,i=""+n;if(!e&&o>i){let s=o;o=i,i=s}return o+""+i+""+(r===void 0?"\0":r)}function LN(e,t,n,r){let o=""+t,i=""+n;if(!e&&o>i){let l=o;o=i,i=l}let s={v:o,w:i};return r&&(s.name=r),s}function Dl(e,t){return Gr(e,t.v,t.w,t.name)}var $N="4.0.1",s0={};i0(s0,{read:()=>AN,write:()=>RN});function RN(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ON(e),edges:bN(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function ON(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),o={v:t};return n!==void 0&&(o.value=n),r!==void 0&&(o.parent=r),o})}function bN(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function AN(e){let t=new rt(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var cc={};i0(cc,{CycleException:()=>xs,bellmanFord:()=>l0,components:()=>FN,dijkstra:()=>ws,dijkstraAll:()=>BN,findCycles:()=>WN,floydWarshall:()=>YN,isAcyclic:()=>QN,postorder:()=>KN,preorder:()=>ZN,prim:()=>qN,shortestPaths:()=>JN,tarjan:()=>a0,topsort:()=>c0});var DN=()=>1;function l0(e,t,n,r){return jN(e,String(t),n||DN,r||function(o){return e.outEdges(o)})}function jN(e,t,n,r){let o={},i,s=0,l=e.nodes(),u=function(c){let d=n(c);o[c.v].distance+d<o[c.w].distance&&(o[c.w]={distance:o[c.v].distance+d,predecessor:c.v},i=!0)},a=function(){l.forEach(function(c){r(c).forEach(function(d){let g=d.v===c?d.v:d.w,y=g===d.v?d.w:d.v;u({v:g,w:y})})})};l.forEach(function(c){let d=c===t?0:Number.POSITIVE_INFINITY;o[c]={distance:d,predecessor:""}});let f=l.length;for(let c=1;c<f&&(i=!1,s++,a(),!!i);c++);if(s===f-1&&(i=!1,a(),i))throw new Error("The graph contains a negative weight cycle");return o}function FN(e){let t={},n=[],r;function o(i){i in t||(t[i]=!0,r.push(i),e.successors(i).forEach(o),e.predecessors(i).forEach(o))}return e.nodes().forEach(function(i){r=[],o(i),r.length&&n.push(r)}),n}var u0=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let o=this._arr,i=o.length;return n[r]=i,o.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,r<t.length&&(o=t[r].priority<t[o].priority?r:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,o=n[e],i=n[t];n[e]=i,n[t]=o,r[i.key]=e,r[o.key]=t}},HN=()=>1;function ws(e,t,n,r){let o=function(i){return e.outEdges(i)};return VN(e,String(t),n||HN,r||o)}function VN(e,t,n,r){let o={},i=new u0,s,l,u=function(a){let f=a.v!==s?a.v:a.w,c=o[f],d=n(a),g=l.distance+d;if(d<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+a+" Weight: "+d);g<c.distance&&(c.distance=g,c.predecessor=s,i.decrease(f,g))};for(e.nodes().forEach(function(a){let f=a===t?0:Number.POSITIVE_INFINITY;o[a]={distance:f,predecessor:""},i.add(a,f)});i.size()>0&&(s=i.removeMin(),l=o[s],l.distance!==Number.POSITIVE_INFINITY);)r(s).forEach(u);return o}function BN(e,t,n){return e.nodes().reduce(function(r,o){return r[o]=ws(e,o,t,n),r},{})}function a0(e){let t=0,n=[],r={},o=[];function i(s){let l=r[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach(function(u){u in r?r[u].onStack&&(l.lowlink=Math.min(l.lowlink,r[u].index)):(i(u),l.lowlink=Math.min(l.lowlink,r[u].lowlink))}),l.lowlink===l.index){let u=[],a;do a=n.pop(),r[a].onStack=!1,u.push(a);while(s!==a);o.push(u)}}return e.nodes().forEach(function(s){s in r||i(s)}),o}function WN(e){return a0(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var UN=()=>1;function YN(e,t,n){return XN(e,t||UN,n||function(r){return e.outEdges(r)})}function XN(e,t,n){let r={},o=e.nodes();return o.forEach(function(i){r[i]={},r[i][i]={distance:0,predecessor:""},o.forEach(function(s){i!==s&&(r[i][s]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(i).forEach(function(s){let l=s.v===i?s.w:s.v,u=t(s);r[i][l]={distance:u,predecessor:i}})}),o.forEach(function(i){let s=r[i];o.forEach(function(l){let u=r[l];o.forEach(function(a){let f=u[i],c=s[a],d=u[a],g=f.distance+c.distance;g<d.distance&&(d.distance=g,d.predecessor=c.predecessor)})})}),r}var xs=class extends Error{constructor(...e){super(...e)}};function c0(e){let t={},n={},r=[];function o(i){if(i in n)throw new xs;i in t||(n[i]=!0,t[i]=!0,e.predecessors(i).forEach(o),delete n[i],r.push(i))}if(e.sinks().forEach(o),Object.keys(t).length!==e.nodeCount())throw new xs;return r}function QN(e){try{c0(e)}catch(t){if(t instanceof xs)return!1;throw t}return!0}function GN(e,t,n,r,o){Array.isArray(t)||(t=[t]);let i=l=>{var u;return(u=e.isDirected()?e.successors(l):e.neighbors(l))!=null?u:[]},s={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);o=f0(e,l,n==="post",s,i,r,o)}),o}function f0(e,t,n,r,o,i,s){return t in r||(r[t]=!0,n||(s=i(s,t)),o(t).forEach(function(l){s=f0(e,l,n,r,o,i,s)}),n&&(s=i(s,t))),s}function d0(e,t,n){return GN(e,t,n,function(r,o){return r.push(o),r},[])}function KN(e,t){return d0(e,t,"post")}function ZN(e,t){return d0(e,t,"pre")}function qN(e,t){let n=new rt,r={},o=new u0,i;function s(u){let a=u.v===i?u.w:u.v,f=o.priority(a);if(f!==void 0){let c=t(u);c<f&&(r[a]=i,o.decrease(a,c))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(u){o.add(u,Number.POSITIVE_INFINITY),n.setNode(u)}),o.decrease(e.nodes()[0],0);let l=!1;for(;o.size()>0;){if(i=o.removeMin(),i in r)n.setEdge(i,r[i]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(i).forEach(s)}return n}function JN(e,t,n,r){return eC(e,t,n,r??(o=>{let i=e.outEdges(o);return i??[]}))}function eC(e,t,n,r){if(n===void 0)return ws(e,t,n,r);let o=!1,i=e.nodes();for(let s=0;s<i.length;s++){let l=r(i[s]);for(let u=0;u<l.length;u++){let a=l[u],f=a.v===i[s]?a.v:a.w,c=f===a.v?a.w:a.v;n({v:f,w:c})<0&&(o=!0)}if(o)return l0(e,t,n,r)}return ws(e,t,n,r)}function Ir(e,t,n,r){let o=r;for(;e.hasNode(o);)o=fc(r);return n.dummy=t,e.setNode(o,n),o}function tC(e){let t=new rt().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),t}function h0(e){let t=new rt({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function Ad(e,t){let n=e.x,r=e.y,o=t.x-n,i=t.y-r,s=e.width/2,l=e.height/2;if(!o&&!i)throw new Error("Not possible to find intersection inside of the rectangle");let u,a;return Math.abs(i)*s>Math.abs(o)*l?(i<0&&(l=-l),u=l*o/i,a=l):(o<0&&(s=-s),u=s,a=s*i/o),{x:n+u,y:r+a}}function Xo(e){let t=Oo(g0(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),o=r.rank;o!==void 0&&(t[o]||(t[o]=[]),t[o][r.order]=n)}),t}function nC(e){let t=e.nodes().map(r=>{let o=e.node(r).rank;return o===void 0?Number.MAX_VALUE:o}),n=xt(Math.min,t);e.nodes().forEach(r=>{let o=e.node(r);Object.hasOwn(o,"rank")&&(o.rank-=n)})}function rC(e){let t=e.nodes().map(s=>e.node(s).rank).filter(s=>s!==void 0),n=xt(Math.min,t),r=[];e.nodes().forEach(s=>{let l=e.node(s).rank-n;r[l]||(r[l]=[]),r[l].push(s)});let o=0,i=e.graph().nodeRankFactor;Array.from(r).forEach((s,l)=>{s===void 0&&l%i!==0?--o:s!==void 0&&o&&s.forEach(u=>e.node(u).rank+=o)})}function Dd(e,t,n,r){let o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=r),Ir(e,"border",o,t)}function oC(e,t=p0){let n=[];for(let r=0;r<e.length;r+=t){let o=e.slice(r,r+t);n.push(o)}return n}var p0=65535;function xt(e,t){if(t.length>p0){let n=oC(t);return e(...n.map(r=>e(...r)))}else return e(...t)}function g0(e){let t=e.nodes().map(n=>{let r=e.node(n).rank;return r===void 0?Number.MIN_VALUE:r});return xt(Math.max,t)}function iC(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function m0(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function y0(e,t){return t()}var sC=0;function fc(e){let t=++sC;return e+(""+t)}function Oo(e,t,n=1){t==null&&(t=e,e=0);let r=i=>i<t;n<0&&(r=i=>t<i);let o=[];for(let i=e;r(i);i+=n)o.push(i);return o}function Es(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function Zs(e,t){let n;return typeof t=="string"?n=r=>r[t]:n=t,Object.entries(e).reduce((r,[o,i])=>(r[o]=n(i,o),r),{})}function lC(e,t){return e.reduce((n,r,o)=>(n[r]=t[o],n),{})}var qs="\0",uC="3.0.0",aC=class{constructor(){TN(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return jd(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&jd(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,cC)),n=n._prev;return"["+e.join(", ")+"]"}};function jd(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function cC(e,t){if(e!=="_next"&&e!=="_prev")return t}var fC=aC,dC=()=>1;function hC(e,t){if(e.nodeCount()<=1)return[];let n=gC(e,t||dC);return pC(n.graph,n.buckets,n.zeroIdx).flatMap(r=>e.outEdges(r.v,r.w)||[])}function pC(e,t,n){var r;let o=[],i=t[t.length-1],s=t[0],l;for(;e.nodeCount();){for(;l=s.dequeue();)jl(e,t,n,l);for(;l=i.dequeue();)jl(e,t,n,l);if(e.nodeCount()){for(let u=t.length-2;u>0;--u)if(l=(r=t[u])==null?void 0:r.dequeue(),l){o=o.concat(jl(e,t,n,l,!0)||[]);break}}}return o}function jl(e,t,n,r,o){let i=[],s=o?i:void 0;return(e.inEdges(r.v)||[]).forEach(l=>{let u=e.edge(l),a=e.node(l.v);o&&i.push({v:l.v,w:l.w}),a.out-=u,Zu(t,n,a)}),(e.outEdges(r.v)||[]).forEach(l=>{let u=e.edge(l),a=l.w,f=e.node(a);f.in-=u,Zu(t,n,f)}),e.removeNode(r.v),s}function gC(e,t){let n=new rt,r=0,o=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let u=n.edge(l.v,l.w)||0,a=t(l),f=u+a;n.setEdge(l.v,l.w,f);let c=n.node(l.v),d=n.node(l.w);o=Math.max(o,c.out+=a),r=Math.max(r,d.in+=a)});let i=mC(o+r+3).map(()=>new fC),s=r+1;return n.nodes().forEach(l=>{Zu(i,s,n.node(l))}),{graph:n,buckets:i,zeroIdx:s}}function Zu(e,t,n){var r,o,i;n.out?n.in?(i=e[n.out-n.in+t])==null||i.enqueue(n):(o=e[e.length-1])==null||o.enqueue(n):(r=e[0])==null||r.enqueue(n)}function mC(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function yC(e){(e.graph().acyclicer==="greedy"?hC(e,t(e)):vC(e)).forEach(n=>{let r=e.edge(n);e.removeEdge(n),r.forwardName=n.name,r.reversed=!0,e.setEdge(n.w,n.v,r,fc("rev"))});function t(n){return r=>n.edge(r).weight}}function vC(e){let t=[],n={},r={};function o(i){Object.hasOwn(r,i)||(r[i]=!0,n[i]=!0,e.outEdges(i).forEach(s=>{Object.hasOwn(n,s.w)?t.push(s):o(s.w)}),delete n[i])}return e.nodes().forEach(o),t}function wC(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function xC(e){e.graph().dummyChains=[],e.edges().forEach(t=>EC(e,t))}function EC(e,t){let n=t.v,r=e.node(n).rank,o=t.w,i=e.node(o).rank,s=t.name,l=e.edge(t),u=l.labelRank;if(i===r+1)return;e.removeEdge(t);let a,f,c;for(c=0,++r;r<i;++c,++r)l.points=[],f={width:0,height:0,edgeLabel:l,edgeObj:t,rank:r},a=Ir(e,"edge",f,"_d"),r===u&&(f.width=l.width,f.height=l.height,f.dummy="edge-label",f.labelpos=l.labelpos),e.setEdge(n,a,{weight:l.weight},s),c===0&&e.graph().dummyChains.push(a),n=a;e.setEdge(n,o,{weight:l.weight},s)}function _C(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,o;for(e.setEdge(n.edgeObj,r);n.dummy;)o=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=o,n=e.node(t)})}function dc(e){let t={};function n(r){let o=e.node(r);if(Object.hasOwn(t,r))return o.rank;t[r]=!0;let i=e.outEdges(r),s=i?i.map(u=>u==null?Number.POSITIVE_INFINITY:n(u.w)-e.edge(u).minlen):[],l=xt(Math.min,s);return l===Number.POSITIVE_INFINITY&&(l=0),o.rank=l}e.sources().forEach(n)}function kr(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var v0=SC;function SC(e){let t=new rt({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let r=n[0],o=e.nodeCount();t.setNode(r,{});let i,s;for(;kC(t,e)<o&&(i=NC(t,e),!!i);)s=t.hasNode(i.v)?kr(e,i):-kr(e,i),CC(t,e,s);return t}function kC(e,t){function n(r){let o=t.nodeEdges(r);o&&o.forEach(i=>{let s=i.v,l=r===s?i.w:s;!e.hasNode(l)&&!kr(t,i)&&(e.setNode(l,{}),e.setEdge(r,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function NC(e,t){return t.edges().reduce((n,r)=>{let o=Number.POSITIVE_INFINITY;return e.hasNode(r.v)!==e.hasNode(r.w)&&(o=kr(t,r)),o<n[0]?[o,r]:n},[Number.POSITIVE_INFINITY,null])[1]}function CC(e,t,n){e.nodes().forEach(r=>t.node(r).rank+=n)}var{preorder:MC,postorder:IC}=cc,PC=An;An.initLowLimValues=pc;An.initCutValues=hc;An.calcCutValue=w0;An.leaveEdge=E0;An.enterEdge=_0;An.exchangeEdges=S0;function An(e){e=tC(e),dc(e);let t=v0(e);pc(t),hc(t,e);let n,r;for(;n=E0(t);)r=_0(t,e,n),S0(t,e,n,r)}function hc(e,t){let n=IC(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>TC(e,t,r))}function TC(e,t,n){let r=e.node(n).parent,o=e.edge(n,r);o.cutvalue=w0(e,t,n)}function w0(e,t,n){let r=e.node(n).parent,o=!0,i=t.edge(n,r),s=0;i||(o=!1,i=t.edge(r,n)),s=i.weight;let l=t.nodeEdges(n);return l&&l.forEach(u=>{let a=u.v===n,f=a?u.w:u.v;if(f!==r){let c=a===o,d=t.edge(u).weight;if(s+=c?d:-d,LC(e,n,f)){let g=e.edge(n,f).cutvalue;s+=c?-g:g}}}),s}function pc(e,t){arguments.length<2&&(t=e.nodes()[0]),x0(e,{},1,t)}function x0(e,t,n,r,o){let i=n,s=e.node(r);t[r]=!0;let l=e.neighbors(r);return l&&l.forEach(u=>{Object.hasOwn(t,u)||(n=x0(e,t,n,u,r))}),s.low=i,s.lim=n++,o?s.parent=o:delete s.parent,n}function E0(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function _0(e,t,n){let r=n.v,o=n.w;t.hasEdge(r,o)||(r=n.w,o=n.v);let i=e.node(r),s=e.node(o),l=i,u=!1;return i.lim>s.lim&&(l=s,u=!0),t.edges().filter(a=>u===Fd(e,e.node(a.v),l)&&u!==Fd(e,e.node(a.w),l)).reduce((a,f)=>kr(t,f)<kr(t,a)?f:a)}function S0(e,t,n,r){let o=n.v,i=n.w;e.removeEdge(o,i),e.setEdge(r.v,r.w,{}),pc(e),hc(e,t),zC(e,t)}function zC(e,t){let n=e.nodes().find(o=>!e.node(o).parent);if(!n)return;let r=MC(e,[n]);r=r.slice(1),r.forEach(o=>{let i=e.node(o).parent,s=t.edge(o,i),l=!1;s||(s=t.edge(i,o),l=!0),t.node(o).rank=t.node(i).rank+(l?s.minlen:-s.minlen)})}function LC(e,t,n){return e.hasEdge(t,n)}function Fd(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var $C=RC;function RC(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":Hd(e);break;case"tight-tree":bC(e);break;case"longest-path":OC(e);break;case"none":break;default:Hd(e)}}var OC=dc;function bC(e){dc(e),v0(e)}function Hd(e){PC(e)}var AC=DC;function DC(e){let t=FC(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),o=r.edgeObj,i=jC(e,t,o.v,o.w),s=i.path,l=i.lca,u=0,a=s[u],f=!0;for(;n!==o.w;){if(r=e.node(n),f){for(;(a=s[u])!==l&&e.node(a).maxRank<r.rank;)u++;a===l&&(f=!1)}if(!f){for(;u<s.length-1&&e.node(s[u+1]).minRank<=r.rank;)u++;a=s[u]}a!==void 0&&e.setParent(n,a),n=e.successors(n)[0]}})}function jC(e,t,n,r){let o=[],i=[],s=Math.min(t[n].low,t[r].low),l=Math.max(t[n].lim,t[r].lim),u;u=n;do u=e.parent(u),o.push(u);while(u&&(t[u].low>s||l>t[u].lim));let a=u,f=r;for(;(f=e.parent(f))!==a;)i.push(f);return{path:o.concat(i.reverse()),lca:a}}function FC(e){let t={},n=0;function r(o){let i=n;e.children(o).forEach(r),t[o]={low:i,lim:n++}}return e.children(qs).forEach(r),t}function HC(e){let t=Ir(e,"root",{},"_root"),n=VC(e),r=Object.values(n),o=xt(Math.max,r)-1,i=2*o+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=i);let s=BC(e)+1;e.children(qs).forEach(l=>k0(e,t,i,s,o,n,l)),e.graph().nodeRankFactor=i}function k0(e,t,n,r,o,i,s){var l;let u=e.children(s);if(!u.length){s!==t&&e.setEdge(t,s,{weight:0,minlen:n});return}let a=Dd(e,"_bt"),f=Dd(e,"_bb"),c=e.node(s);e.setParent(a,s),c.borderTop=a,e.setParent(f,s),c.borderBottom=f,u.forEach(d=>{var g;k0(e,t,n,r,o,i,d);let y=e.node(d),v=y.borderTop?y.borderTop:d,x=y.borderBottom?y.borderBottom:d,h=y.borderTop?r:2*r,m=v!==x?1:o-((g=i[s])!=null?g:0)+1;e.setEdge(a,v,{weight:h,minlen:m,nestingEdge:!0}),e.setEdge(x,f,{weight:h,minlen:m,nestingEdge:!0})}),e.parent(s)||e.setEdge(t,a,{weight:0,minlen:o+((l=i[s])!=null?l:0)})}function VC(e){let t={};function n(r,o){let i=e.children(r);i&&i.length&&i.forEach(s=>n(s,o+1)),t[r]=o}return e.children(qs).forEach(r=>n(r,1)),t}function BC(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function WC(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var UC=YC;function YC(e){function t(n){let r=e.children(n),o=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(let i=o.minRank,s=o.maxRank+1;i<s;++i)Vd(e,"borderLeft","_bl",n,o,i),Vd(e,"borderRight","_br",n,o,i)}}e.children(qs).forEach(t)}function Vd(e,t,n,r,o,i){let s={width:0,height:0,rank:i,borderType:t},l=o[t][i-1],u=Ir(e,"border",s,n);o[t][i]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}function XC(e){var t;let n=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(n==="lr"||n==="rl")&&N0(e)}function QC(e){var t;let n=(t=e.graph().rankdir)==null?void 0:t.toLowerCase();(n==="bt"||n==="rl")&&GC(e),(n==="lr"||n==="rl")&&(KC(e),N0(e))}function N0(e){e.nodes().forEach(t=>Bd(e.node(t))),e.edges().forEach(t=>Bd(e.edge(t)))}function Bd(e){let t=e.width;e.width=e.height,e.height=t}function GC(e){e.nodes().forEach(t=>Fl(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Fl),Object.hasOwn(r,"y")&&Fl(r)})}function Fl(e){e.y=-e.y}function KC(e){e.nodes().forEach(t=>Hl(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Hl),Object.hasOwn(r,"x")&&Hl(r)})}function Hl(e){let t=e.x;e.x=e.y,e.y=t}function ZC(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),r=n.map(l=>e.node(l).rank),o=xt(Math.max,r),i=Oo(o+1).map(()=>[]);function s(l){if(t[l])return;t[l]=!0;let u=e.node(l);i[u.rank].push(l);let a=e.successors(l);a&&a.forEach(s)}return n.sort((l,u)=>e.node(l).rank-e.node(u).rank).forEach(s),i}function qC(e,t){let n=0;for(let r=1;r<t.length;++r)n+=JC(e,t[r-1],t[r]);return n}function JC(e,t,n){let r=lC(n,n.map((a,f)=>f)),o=t.flatMap(a=>{let f=e.outEdges(a);return f?f.map(c=>({pos:r[c.w],weight:e.edge(c).weight})).sort((c,d)=>c.pos-d.pos):[]}),i=1;for(;i<n.length;)i<<=1;let s=2*i-1;i-=1;let l=new Array(s).fill(0),u=0;return o.forEach(a=>{let f=a.pos+i;l[f]+=a.weight;let c=0;for(;f>0;)f%2&&(c+=l[f+1]),f=f-1>>1,l[f]+=a.weight;u+=a.weight*c}),u}function e3(e,t=[]){return t.map(n=>{let r=e.inEdges(n);if(!r||!r.length)return{v:n};{let o=r.reduce((i,s)=>{let l=e.edge(s),u=e.node(s.v);return{sum:i.sum+l.weight*u.order,weight:i.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}})}function t3(e,t){let n={};e.forEach((o,i)=>{let s={indegree:0,in:[],out:[],vs:[o.v],i};o.barycenter!==void 0&&(s.barycenter=o.barycenter,s.weight=o.weight),n[o.v]=s}),t.edges().forEach(o=>{let i=n[o.v],s=n[o.w];i!==void 0&&s!==void 0&&(s.indegree++,i.out.push(s))});let r=Object.values(n).filter(o=>!o.indegree);return n3(r)}function n3(e){let t=[];function n(o){return i=>{i.merged||(i.barycenter===void 0||o.barycenter===void 0||i.barycenter>=o.barycenter)&&r3(o,i)}}function r(o){return i=>{i.in.push(o),--i.indegree===0&&e.push(i)}}for(;e.length;){let o=e.pop();t.push(o),o.in.reverse().forEach(n(o)),o.out.forEach(r(o))}return t.filter(o=>!o.merged).map(o=>Es(o,["vs","i","barycenter","weight"]))}function r3(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function o3(e,t){let n=iC(e,f=>Object.hasOwn(f,"barycenter")),r=n.lhs,o=n.rhs.sort((f,c)=>c.i-f.i),i=[],s=0,l=0,u=0;r.sort(i3(!!t)),u=Wd(i,o,u),r.forEach(f=>{u+=f.vs.length,i.push(f.vs),s+=f.barycenter*f.weight,l+=f.weight,u=Wd(i,o,u)});let a={vs:i.flat(1)};return l&&(a.barycenter=s/l,a.weight=l),a}function Wd(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function i3(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function C0(e,t,n,r){let o=e.children(t),i=e.node(t),s=i?i.borderLeft:void 0,l=i?i.borderRight:void 0,u={};s&&(o=o.filter(d=>d!==s&&d!==l));let a=e3(e,o);a.forEach(d=>{if(e.children(d.v).length){let g=C0(e,d.v,n,r);u[d.v]=g,Object.hasOwn(g,"barycenter")&&l3(d,g)}});let f=t3(a,n);s3(f,u);let c=o3(f,r);if(s&&l){c.vs=[s,c.vs,l].flat(1);let d=e.predecessors(s);if(d&&d.length){let g=e.node(d[0]),y=e.predecessors(l),v=e.node(y[0]);Object.hasOwn(c,"barycenter")||(c.barycenter=0,c.weight=0),c.barycenter=(c.barycenter*c.weight+g.order+v.order)/(c.weight+2),c.weight+=2}}return c}function s3(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function l3(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function u3(e,t,n,r){r||(r=e.nodes());let o=a3(e),i=new rt({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(s=>e.node(s));return r.forEach(s=>{let l=e.node(s),u=e.parent(s);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){i.setNode(s),i.setParent(s,u||o);let a=e[n](s);a&&a.forEach(f=>{let c=f.v===s?f.w:f.v,d=i.edge(c,s),g=d!==void 0?d.weight:0;i.setEdge(c,s,{weight:e.edge(f).weight+g})}),Object.hasOwn(l,"minRank")&&i.setNode(s,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),i}function a3(e){let t;for(;e.hasNode(t=fc("_root")););return t}function c3(e,t,n){let r={},o;n.forEach(i=>{let s=e.parent(i),l,u;for(;s;){if(l=e.parent(s),l?(u=r[l],r[l]=s):(u=o,o=s),u&&u!==s){t.setEdge(u,s);return}s=l}})}function M0(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,M0);return}let n=g0(e),r=Ud(e,Oo(1,n+1),"inEdges"),o=Ud(e,Oo(n-1,-1,-1),"outEdges"),i=ZC(e);if(Yd(e,i),t.disableOptimalOrderHeuristic)return;let s=Number.POSITIVE_INFINITY,l,u=t.constraints||[];for(let a=0,f=0;f<4;++a,++f){f3(a%2?r:o,a%4>=2,u),i=Xo(e);let c=qC(e,i);c<s?(f=0,l=Object.assign({},i),s=c):c===s&&(l=structuredClone(i))}Yd(e,l)}function Ud(e,t,n){let r=new Map,o=(i,s)=>{r.has(i)||r.set(i,[]),r.get(i).push(s)};for(let i of e.nodes()){let s=e.node(i);if(typeof s.rank=="number"&&o(s.rank,i),typeof s.minRank=="number"&&typeof s.maxRank=="number")for(let l=s.minRank;l<=s.maxRank;l++)l!==s.rank&&o(l,i)}return t.map(function(i){return u3(e,i,n,r.get(i)||[])})}function f3(e,t,n){let r=new rt;e.forEach(function(o){n.forEach(l=>r.setEdge(l.left,l.right));let i=o.graph().root,s=C0(o,i,r,t);s.vs.forEach((l,u)=>o.node(l).order=u),c3(o,r,s.vs)})}function Yd(e,t){Object.values(t).forEach(n=>n.forEach((r,o)=>e.node(r).order=o))}function d3(e,t){let n={};function r(o,i){let s=0,l=0,u=o.length,a=i[i.length-1];return i.forEach((f,c)=>{let d=p3(e,f),g=d?e.node(d).order:u;(d||f===a)&&(i.slice(l,c+1).forEach(y=>{let v=e.predecessors(y);v&&v.forEach(x=>{let h=e.node(x),m=h.order;(m<s||g<m)&&!(h.dummy&&e.node(y).dummy)&&I0(n,x,y)})}),l=c+1,s=g)}),i}return t.length&&t.reduce(r),n}function h3(e,t){let n={};function r(i,s,l,u,a){Oo(s,l).forEach(f=>{let c=i[f];if(c!==void 0&&e.node(c).dummy){let d=e.predecessors(c);d&&d.forEach(g=>{if(g===void 0)return;let y=e.node(g);y.dummy&&(y.order<u||y.order>a)&&I0(n,g,c)})}})}function o(i,s){let l=-1,u=-1,a=0;return s.forEach((f,c)=>{if(e.node(f).dummy==="border"){let d=e.predecessors(f);if(d&&d.length){let g=d[0];if(g===void 0)return;u=e.node(g).order,r(s,a,c,l,u),a=c,l=u}}r(s,a,s.length,u,i.length)}),s}return t.length&&t.reduce(o),n}function p3(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(r=>e.node(r).dummy)}}function I0(e,t,n){if(t>n){let o=t;t=n,n=o}let r=e[t];r||(e[t]=r={}),r[n]=!0}function g3(e,t,n){if(t>n){let o=t;t=n,n=o}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function m3(e,t,n,r){let o={},i={},s={};return t.forEach(l=>{l.forEach((u,a)=>{o[u]=u,i[u]=u,s[u]=a})}),t.forEach(l=>{let u=-1;l.forEach(a=>{let f=r(a);if(f&&f.length){let c=f.sort((g,y)=>{let v=s[g],x=s[y];return(v!==void 0?v:0)-(x!==void 0?x:0)}),d=(c.length-1)/2;for(let g=Math.floor(d),y=Math.ceil(d);g<=y;++g){let v=c[g];if(v===void 0)continue;let x=s[v];if(x!==void 0&&i[a]===a&&u<x&&!g3(n,a,v)){let h=o[v];h!==void 0&&(i[v]=a,i[a]=o[a]=h,u=x)}}}})}),{root:o,align:i}}function y3(e,t,n,r,o=!1){let i={},s=v3(e,t,n,o),l=o?"borderLeft":"borderRight";function u(g,y){let v=s.nodes().slice(),x={},h=v.pop();for(;h;){if(x[h])g(h);else{x[h]=!0,v.push(h);for(let m of y(h))v.push(m)}h=v.pop()}}function a(g){let y=s.inEdges(g);y?i[g]=y.reduce((v,x)=>{var h;let m=(h=i[x.v])!=null?h:0,p=s.edge(x);return Math.max(v,m+(p!==void 0?p:0))},0):i[g]=0}function f(g){let y=s.outEdges(g),v=Number.POSITIVE_INFINITY;y&&(v=y.reduce((h,m)=>{let p=i[m.w],w=s.edge(m);return Math.min(h,(p!==void 0?p:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let x=e.node(g);v!==Number.POSITIVE_INFINITY&&x.borderType!==l&&(i[g]=Math.max(i[g]!==void 0?i[g]:0,v))}function c(g){return s.predecessors(g)||[]}function d(g){return s.successors(g)||[]}return u(a,c),u(f,d),Object.keys(r).forEach(g=>{var y;let v=n[g];v!==void 0&&(i[g]=(y=i[v])!=null?y:0)}),i}function v3(e,t,n,r){let o=new rt,i=e.graph(),s=S3(i.nodesep,i.edgesep,r);return t.forEach(l=>{let u;l.forEach(a=>{let f=n[a];if(f!==void 0){if(o.setNode(f),u!==void 0){let c=n[u];if(c!==void 0){let d=o.edge(c,f);o.setEdge(c,f,Math.max(s(e,a,u),d||0))}}u=a}})}),o}function w3(e,t){return Object.values(t).reduce((n,r)=>{let o=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([l,u])=>{let a=k3(e,l)/2;o=Math.max(u+a,o),i=Math.min(u-a,i)});let s=o-i;return s<n[0]&&(n=[s,r]),n},[Number.POSITIVE_INFINITY,null])[1]}function x3(e,t){let n=Object.values(t),r=xt(Math.min,n),o=xt(Math.max,n);["u","d"].forEach(i=>{["l","r"].forEach(s=>{let l=i+s,u=e[l];if(!u||u===t)return;let a=Object.values(u),f=r-xt(Math.min,a);s!=="l"&&(f=o-xt(Math.max,a)),f&&(e[l]=Zs(u,c=>c+f))})})}function E3(e,t=void 0){let n=e.ul;return n?Zs(n,(r,o)=>{var i,s;if(t){let u=t.toLowerCase(),a=e[u];if(a&&a[o]!==void 0)return a[o]}let l=Object.values(e).map(u=>{let a=u[o];return a!==void 0?a:0}).sort((u,a)=>u-a);return(((i=l[1])!=null?i:0)+((s=l[2])!=null?s:0))/2}):{}}function _3(e){let t=Xo(e),n=Object.assign(d3(e,t),h3(e,t)),r={},o;["u","d"].forEach(s=>{o=s==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(o=o.map(f=>Object.values(f).reverse()));let u=m3(e,o,n,f=>(s==="u"?e.predecessors(f):e.successors(f))||[]),a=y3(e,o,u.root,u.align,l==="r");l==="r"&&(a=Zs(a,f=>-f)),r[s+l]=a})});let i=w3(e,r);return x3(r,i),E3(r,e.graph().align)}function S3(e,t,n){return(r,o,i)=>{let s=r.node(o),l=r.node(i),u=0,a;if(u+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":a=-s.width/2;break;case"r":a=s.width/2;break}if(a&&(u+=n?a:-a),a=void 0,u+=(s.dummy?t:e)/2,u+=(l.dummy?t:e)/2,u+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":a=l.width/2;break;case"r":a=-l.width/2;break}return a&&(u+=n?a:-a),u}}function k3(e,t){return e.node(t).width}function N3(e){e=h0(e),C3(e),Object.entries(_3(e)).forEach(([t,n])=>e.node(t).x=n)}function C3(e){let t=Xo(e),n=e.graph(),r=n.ranksep,o=n.rankalign,i=0;t.forEach(s=>{let l=s.reduce((u,a)=>{var f;let c=(f=e.node(a).height)!=null?f:0;return u>c?u:c},0);s.forEach(u=>{let a=e.node(u);o==="top"?a.y=i+a.height/2:o==="bottom"?a.y=i+l-a.height/2:a.y=i+l/2}),i+=l+r})}function M3(e,t={}){let n=t.debugTiming?m0:y0;return n("layout",()=>{let r=n(" buildLayoutGraph",()=>A3(e));return n(" runLayout",()=>I3(r,n,t)),n(" updateInputGraph",()=>P3(e,r)),r})}function I3(e,t,n){t(" makeSpaceForEdgeLabels",()=>D3(e)),t(" removeSelfEdges",()=>X3(e)),t(" acyclic",()=>yC(e)),t(" nestingGraph.run",()=>HC(e)),t(" rank",()=>$C(h0(e))),t(" injectEdgeLabelProxies",()=>j3(e)),t(" removeEmptyRanks",()=>rC(e)),t(" nestingGraph.cleanup",()=>WC(e)),t(" normalizeRanks",()=>nC(e)),t(" assignRankMinMax",()=>F3(e)),t(" removeEdgeLabelProxies",()=>H3(e)),t(" normalize.run",()=>xC(e)),t(" parentDummyChains",()=>AC(e)),t(" addBorderSegments",()=>UC(e)),t(" order",()=>M0(e,n)),t(" insertSelfEdges",()=>Q3(e)),t(" adjustCoordinateSystem",()=>XC(e)),t(" position",()=>N3(e)),t(" positionSelfEdges",()=>G3(e)),t(" removeBorderNodes",()=>Y3(e)),t(" normalize.undo",()=>_C(e)),t(" fixupEdgeLabelCoords",()=>W3(e)),t(" undoCoordinateSystem",()=>QC(e)),t(" translateGraph",()=>V3(e)),t(" assignNodeIntersects",()=>B3(e)),t(" reversePoints",()=>U3(e)),t(" acyclic.undo",()=>wC(e))}function P3(e,t){e.nodes().forEach(n=>{let r=e.node(n),o=t.node(n);r&&(r.x=o.x,r.y=o.y,r.order=o.order,r.rank=o.rank,t.children(n).length&&(r.width=o.width,r.height=o.height))}),e.edges().forEach(n=>{let r=e.edge(n),o=t.edge(n);r.points=o.points,Object.hasOwn(o,"x")&&(r.x=o.x,r.y=o.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var T3=["nodesep","edgesep","ranksep","marginx","marginy"],z3={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},L3=["acyclicer","ranker","rankdir","align","rankalign"],$3=["width","height","rank"],Xd={width:0,height:0},R3=["minlen","weight","width","height","labeloffset"],O3={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},b3=["labelpos"];function A3(e){let t=new rt({multigraph:!0,compound:!0}),n=Bl(e.graph());return t.setGraph(Object.assign({},z3,Vl(n,T3),Es(n,L3))),e.nodes().forEach(r=>{let o=Bl(e.node(r)),i=Vl(o,$3);Object.keys(Xd).forEach(l=>{i[l]===void 0&&(i[l]=Xd[l])}),t.setNode(r,i);let s=e.parent(r);s!==void 0&&t.setParent(r,s)}),e.edges().forEach(r=>{let o=Bl(e.edge(r));t.setEdge(r,Object.assign({},O3,Vl(o,R3),Es(o,b3)))}),t}function D3(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function j3(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let r=e.node(t.v),o={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};Ir(e,"edge-proxy",o,"_ep")}})}function F3(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function H3(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function V3(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,o=0,i=e.graph(),s=i.marginx||0,l=i.marginy||0;function u(a){let f=a.x,c=a.y,d=a.width,g=a.height;t=Math.min(t,f-d/2),n=Math.max(n,f+d/2),r=Math.min(r,c-g/2),o=Math.max(o,c+g/2)}e.nodes().forEach(a=>u(e.node(a))),e.edges().forEach(a=>{let f=e.edge(a);Object.hasOwn(f,"x")&&u(f)}),t-=s,r-=l,e.nodes().forEach(a=>{let f=e.node(a);f.x-=t,f.y-=r}),e.edges().forEach(a=>{let f=e.edge(a);f.points.forEach(c=>{c.x-=t,c.y-=r}),Object.hasOwn(f,"x")&&(f.x-=t),Object.hasOwn(f,"y")&&(f.y-=r)}),i.width=n-t+s,i.height=o-r+l}function B3(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),o=e.node(t.w),i,s;n.points?(i=n.points[0],s=n.points[n.points.length-1]):(n.points=[],i=o,s=r),n.points.unshift(Ad(r,i)),n.points.push(Ad(o,s))})}function W3(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function U3(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function Y3(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),o=e.node(n.borderBottom),i=e.node(n.borderLeft[n.borderLeft.length-1]),s=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(s.x-i.x),n.height=Math.abs(o.y-r.y),n.x=i.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function X3(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Q3(e){Xo(e).forEach(t=>{let n=0;t.forEach((r,o)=>{let i=e.node(r);i.order=o+n,(i.selfEdges||[]).forEach(s=>{Ir(e,"selfedge",{width:s.label.width,height:s.label.height,rank:i.rank,order:o+ ++n,e:s.e,label:s.label},"_se")}),delete i.selfEdges})})}function G3(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let r=n,o=e.node(r.e.v),i=o.x+o.width/2,s=o.y,l=n.x-i,u=o.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*l/3,y:s-u},{x:i+5*l/6,y:s-u},{x:i+l,y:s},{x:i+5*l/6,y:s+u},{x:i+2*l/3,y:s+u}],r.label.x=n.x,r.label.y=n.y}})}function Vl(e,t){return Zs(Es(e,t),Number)}function Bl(e){let t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}function K3(e){let t=Xo(e),n=new rt({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(r=>{n.setNode(r,{label:r}),n.setParent(r,"layer"+e.node(r).rank)}),e.edges().forEach(r=>n.setEdge(r.v,r.w,{},r.name)),t.forEach((r,o)=>{let i="layer"+o;n.setNode(i,{rank:"same"}),r.reduce((s,l)=>(n.setEdge(s,l,{style:"invis"}),l))}),n}var Z3={graphlib:o0,version:uC,layout:M3,debug:K3,util:{time:m0,notime:y0}},Qd=Z3;/*! For license information please see dagre.esm.js.LEGAL.txt */const Gd=180,Kd=90;function q3(e,t){const n=new Qd.graphlib.Graph;n.setDefaultEdgeLabel(()=>({})),n.setGraph({rankdir:"TB",ranksep:80,nodesep:60});for(const r of e)n.setNode(r.id,{width:Gd,height:Kd});for(const r of t)n.setEdge(r.source,r.target);return Qd.layout(n),e.map(r=>{const o=n.node(r.id);return{...r,position:{x:o.x-Gd/2,y:o.y-Kd/2}}})}const J3={component:SN,context:kN};function eM(e,t){return e.nodes.map((n,r)=>({id:n.id,type:n.type,position:{x:r%5*220,y:Math.floor(r/5)*160},data:{label:n.label,file:n.file,stateSlots:n.stateSlots,isContextProvider:n.isContextProvider,renderCount:t.renderCounts[n.id]??0,isRecentlyRendered:t.recentlyRendered.has(n.id)}}))}function tM(e){return e.edges.map(t=>{const n=t.type==="context-subscription",r=t.type==="context-provision",o=n?"#818cf8":r?"#a78bfa":"#334155";return{id:t.id,source:t.source,target:t.target,type:"smoothstep",animated:n||r,style:{stroke:o,strokeWidth:n||r?2:1.5},markerEnd:{type:zo.ArrowClosed,color:o}}})}function nM(){const[e,t]=O.useState(null),[n,r]=O.useState(null),[o,i]=O.useState({renderCounts:{},recentlyRendered:new Set}),[s,l,u]=X2([]),[a,f,c]=Q2([]),d=O.useRef(null),g=O.useCallback(x=>f(h=>om(x,h)),[f]);O.useEffect(()=>{let x=!1,h=500;function m(p){fetch("/api/graph").then(w=>{if(!w.ok)throw new Error(`HTTP ${w.status}`);return w.json()}).then(w=>{x||t(w)}).catch(()=>{if(!x){if(p>=6){r("Could not reach CLI server after multiple retries");return}setTimeout(()=>m(p+1),h),h=Math.min(h*2,8e3)}})}return m(0),()=>{x=!0}},[]),O.useEffect(()=>{if(!e)return;const h=eM(e,{renderCounts:{},recentlyRendered:new Set}),m=tM(e),p=q3(h,m);l(p),f(m),requestAnimationFrame(()=>{var w;(w=d.current)==null||w.fitView({padding:.15,duration:400})})},[e,l,f]),O.useEffect(()=>{e&&l(x=>x.map(h=>({...h,data:{...h.data,renderCount:o.renderCounts[h.id]??0,isRecentlyRendered:o.recentlyRendered.has(h.id)}})))},[o,e,l]);const y=O.useCallback(x=>{i(x)},[]),v=O.useCallback(x=>{t(x)},[]);return MN(y,v),n?I.jsxs("div",{style:{color:"#f87171",fontFamily:"monospace",padding:32,background:"#0f1117",height:"100%"},children:[I.jsx("div",{style:{fontSize:16,marginBottom:8},children:"Failed to load graph"}),I.jsx("div",{style:{color:"#64748b",fontSize:13},children:n}),I.jsxs("div",{style:{color:"#64748b",fontSize:12,marginTop:16},children:["Make sure the CLI server is running: ",I.jsx("code",{children:"npx react-state-flow ./src"})]})]}):e?I.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[I.jsxs("div",{style:{flexShrink:0,zIndex:10,background:"#0f1117",borderBottom:"1px solid #1e2235",padding:"10px 16px",display:"flex",alignItems:"center",gap:12,fontFamily:"monospace"},children:[I.jsx("span",{style:{color:"#e2e8f0",fontWeight:700,fontSize:14},children:"React State Flow"}),I.jsx("span",{style:{color:"#334155",fontSize:12},children:"|"}),I.jsxs("span",{style:{color:"#64748b",fontSize:12},children:[e.nodes.length," nodes · ",e.edges.length," edges"]}),I.jsxs("div",{style:{marginLeft:"auto",display:"flex",gap:12,alignItems:"center",fontSize:11,color:"#64748b"},children:[I.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[I.jsx("span",{style:{width:8,height:8,borderRadius:999,background:"#334155",display:"inline-block"}}),"parent-child"]}),I.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[I.jsx("span",{style:{width:8,height:8,borderRadius:999,background:"#818cf8",display:"inline-block"}}),"context sub"]}),I.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[I.jsx("span",{style:{width:8,height:8,borderRadius:999,background:"#a78bfa",display:"inline-block"}}),"context provides"]}),I.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:[I.jsx("span",{style:{width:8,height:8,borderRadius:999,background:"#22c55e",display:"inline-block"}}),"re-render"]})]})]}),I.jsx("div",{style:{flex:1,minHeight:0},children:I.jsxs(Y2,{nodes:s,edges:a,onNodesChange:u,onEdgesChange:c,onConnect:g,nodeTypes:J3,onInit:x=>{d.current=x},fitView:!0,fitViewOptions:{padding:.15,minZoom:.2},style:{background:"#0f1117",width:"100%",height:"100%"},children:[I.jsx(J2,{color:"#1e2235",gap:24}),I.jsx(sN,{style:{background:"#1a1d27",border:"1px solid #2e3348"}}),I.jsx(wN,{style:{background:"#1a1d27",border:"1px solid #2e3348"},nodeColor:x=>x.type==="context"?"#4338ca":"#334155"})]})})]}):I.jsx("div",{style:{color:"#64748b",fontFamily:"monospace",padding:32,background:"#0f1117",height:"100%"},children:"Loading graph..."})}function rM(){return I.jsx(Jm,{children:I.jsx(nM,{})})}cg(document.getElementById("root")).render(I.jsx(O.StrictMode,{children:I.jsx(rM,{})}));
|