@johnz4021/illuminate 0.2.0 → 0.4.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.
@@ -1,71 +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)}})();var AC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ch(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dh={exports:{}},Bs={},fh={exports:{}},oe={};/**
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 Zo=Symbol.for("react.element"),$y=Symbol.for("react.portal"),Py=Symbol.for("react.fragment"),Iy=Symbol.for("react.strict_mode"),Ty=Symbol.for("react.profiler"),zy=Symbol.for("react.provider"),by=Symbol.for("react.context"),Ly=Symbol.for("react.forward_ref"),Ay=Symbol.for("react.suspense"),Ry=Symbol.for("react.memo"),Dy=Symbol.for("react.lazy"),Dc=Symbol.iterator;function Oy(e){return e===null||typeof e!="object"?null:(e=Dc&&e[Dc]||e["@@iterator"],typeof e=="function"?e:null)}var hh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ph=Object.assign,mh={};function Wr(e,t,n){this.props=e,this.context=t,this.refs=mh,this.updater=n||hh}Wr.prototype.isReactComponent={};Wr.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")};Wr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function gh(){}gh.prototype=Wr.prototype;function pu(e,t,n){this.props=e,this.context=t,this.refs=mh,this.updater=n||hh}var mu=pu.prototype=new gh;mu.constructor=pu;ph(mu,Wr.prototype);mu.isPureReactComponent=!0;var Oc=Array.isArray,yh=Object.prototype.hasOwnProperty,gu={current:null},vh={key:!0,ref:!0,__self:!0,__source:!0};function xh(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)yh.call(t,r)&&!vh.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Zo,type:e,key:i,ref:s,props:o,_owner:gu.current}}function Fy(e,t){return{$$typeof:Zo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function yu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Zo}function Hy(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Fc=/\/+/g;function El(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Hy(""+e.key):t.toString(36)}function Fi(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 Zo:case $y:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+El(s,0):r,Oc(o)?(n="",e!=null&&(n=e.replace(Fc,"$&/")+"/"),Fi(o,t,n,"",function(u){return u})):o!=null&&(yu(o)&&(o=Fy(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Fc,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Oc(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+El(i,l);s+=Fi(i,t,n,a,o)}else if(a=Oy(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+El(i,l++),s+=Fi(i,t,n,a,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 hi(e,t,n){if(e==null)return e;var r=[],o=0;return Fi(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Vy(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 Re={current:null},Hi={transition:null},By={ReactCurrentDispatcher:Re,ReactCurrentBatchConfig:Hi,ReactCurrentOwner:gu};function wh(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:hi,forEach:function(e,t,n){hi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return hi(e,function(){t++}),t},toArray:function(e){return hi(e,function(t){return t})||[]},only:function(e){if(!yu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=Wr;oe.Fragment=Py;oe.Profiler=Ty;oe.PureComponent=pu;oe.StrictMode=Iy;oe.Suspense=Ay;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=By;oe.act=wh;oe.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=ph({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=gu.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)yh.call(t,a)&&!vh.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Zo,type:e.type,key:o,ref:i,props:r,_owner:s}};oe.createContext=function(e){return e={$$typeof:by,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:zy,_context:e},e.Consumer=e};oe.createElement=xh;oe.createFactory=function(e){var t=xh.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:Ly,render:e}};oe.isValidElement=yu;oe.lazy=function(e){return{$$typeof:Dy,_payload:{_status:-1,_result:e},_init:Vy}};oe.memo=function(e,t){return{$$typeof:Ry,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Hi.transition;Hi.transition={};try{e()}finally{Hi.transition=t}};oe.unstable_act=wh;oe.useCallback=function(e,t){return Re.current.useCallback(e,t)};oe.useContext=function(e){return Re.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Re.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Re.current.useEffect(e,t)};oe.useId=function(){return Re.current.useId()};oe.useImperativeHandle=function(e,t,n){return Re.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return Re.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Re.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Re.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return Re.current.useReducer(e,t,n)};oe.useRef=function(e){return Re.current.useRef(e)};oe.useState=function(e){return Re.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return Re.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return Re.current.useTransition()};oe.version="18.3.1";fh.exports=oe;var b=fh.exports;const Uy=ch(b);/**
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 Wy=b,Yy=Symbol.for("react.element"),Xy=Symbol.for("react.fragment"),Ky=Object.prototype.hasOwnProperty,Qy=Wy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Gy={key:!0,ref:!0,__self:!0,__source:!0};function kh(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)Ky.call(t,r)&&!Gy.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:Yy,type:e,key:i,ref:s,props:o,_owner:Qy.current}}Bs.Fragment=Xy;Bs.jsx=kh;Bs.jsxs=kh;dh.exports=Bs;var h=dh.exports,Sh={exports:{}},Ze={},Eh={exports:{}},Nh={};/**
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($,M){var L=$.length;$.push(M);e:for(;0<L;){var I=L-1>>>1,D=$[I];if(0<o(D,M))$[I]=M,$[L]=D,L=I;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var M=$[0],L=$.pop();if(L!==M){$[0]=L;e:for(var I=0,D=$.length,U=D>>>1;I<U;){var W=2*(I+1)-1,G=$[W],V=W+1,X=$[V];if(0>o(G,L))V<D&&0>o(X,G)?($[I]=X,$[V]=L,I=V):($[I]=G,$[W]=L,I=W);else if(V<D&&0>o(X,L))$[I]=X,$[V]=L,I=V;else break e}}return M}function o($,M){var L=$.sortIndex-M.sortIndex;return L!==0?L:$.id-M.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 a=[],u=[],c=1,f=null,d=3,p=!1,y=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g($){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=$)r(u),M.sortIndex=M.expirationTime,t(a,M);else break;M=n(u)}}function w($){if(x=!1,g($),!y)if(n(a)!==null)y=!0,_(C);else{var M=n(u);M!==null&&z(w,M.startTime-$)}}function C($,M){y=!1,x&&(x=!1,m(j),j=-1),p=!0;var L=d;try{for(g(M),f=n(a);f!==null&&(!(f.expirationTime>M)||$&&!R());){var I=f.callback;if(typeof I=="function"){f.callback=null,d=f.priorityLevel;var D=I(f.expirationTime<=M);M=e.unstable_now(),typeof D=="function"?f.callback=D:f===n(a)&&r(a),g(M)}else r(a);f=n(a)}if(f!==null)var U=!0;else{var W=n(u);W!==null&&z(w,W.startTime-M),U=!1}return U}finally{f=null,d=L,p=!1}}var E=!1,N=null,j=-1,P=5,A=-1;function R(){return!(e.unstable_now()-A<P)}function H(){if(N!==null){var $=e.unstable_now();A=$;var M=!0;try{M=N(!0,$)}finally{M?F():(E=!1,N=null)}}else E=!1}var F;if(typeof v=="function")F=function(){v(H)};else if(typeof MessageChannel<"u"){var S=new MessageChannel,T=S.port2;S.port1.onmessage=H,F=function(){T.postMessage(null)}}else F=function(){k(H,0)};function _($){N=$,E||(E=!0,F())}function z($,M){j=k(function(){$(e.unstable_now())},M)}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($){$.callback=null},e.unstable_continueExecution=function(){y||p||(y=!0,_(C))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function($){switch(d){case 1:case 2:case 3:var M=3;break;default:M=d}var L=d;d=M;try{return $()}finally{d=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,M){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var L=d;d=$;try{return M()}finally{d=L}},e.unstable_scheduleCallback=function($,M,L){var I=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?I+L:I):L=I,$){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=L+D,$={id:c++,callback:M,priorityLevel:$,startTime:L,expirationTime:D,sortIndex:-1},L>I?($.sortIndex=L,t(u,$),n(a)===null&&$===n(u)&&(x?(m(j),j=-1):x=!0,z(w,L-I))):($.sortIndex=D,t(a,$),y||p||(y=!0,_(C))),$},e.unstable_shouldYield=R,e.unstable_wrapCallback=function($){var M=d;return function(){var L=d;d=M;try{return $.apply(this,arguments)}finally{d=L}}}})(Nh);Eh.exports=Nh;var qy=Eh.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 Zy=b,Ge=qy;function B(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 _h=new Set,No={};function tr(e,t){$r(e,t),$r(e+"Capture",t)}function $r(e,t){for(No[e]=t,e=0;e<t.length;e++)_h.add(t[e])}var Wt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sa=Object.prototype.hasOwnProperty,Jy=/^[: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]*$/,Hc={},Vc={};function ev(e){return sa.call(Vc,e)?!0:sa.call(Hc,e)?!1:Jy.test(e)?Vc[e]=!0:(Hc[e]=!0,!1)}function tv(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 nv(e,t,n,r){if(t===null||typeof t>"u"||tv(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 De(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 $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new De(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new De(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new De(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new De(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$e[e]=new De(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new De(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new De(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new De(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new De(e,5,!1,e.toLowerCase(),null,!1,!1)});var vu=/[\-:]([a-z])/g;function xu(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(vu,xu);$e[t]=new De(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(vu,xu);$e[t]=new De(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(vu,xu);$e[t]=new De(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new De(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new De("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new De(e,1,!1,e.toLowerCase(),null,!0,!0)});function wu(e,t,n,r){var o=$e.hasOwnProperty(t)?$e[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(nv(t,n,o,r)&&(n=null),r||o===null?ev(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 Gt=Zy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,pi=Symbol.for("react.element"),ar=Symbol.for("react.portal"),ur=Symbol.for("react.fragment"),ku=Symbol.for("react.strict_mode"),la=Symbol.for("react.profiler"),Ch=Symbol.for("react.provider"),jh=Symbol.for("react.context"),Su=Symbol.for("react.forward_ref"),aa=Symbol.for("react.suspense"),ua=Symbol.for("react.suspense_list"),Eu=Symbol.for("react.memo"),en=Symbol.for("react.lazy"),Mh=Symbol.for("react.offscreen"),Bc=Symbol.iterator;function Qr(e){return e===null||typeof e!="object"?null:(e=Bc&&e[Bc]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Object.assign,Nl;function io(e){if(Nl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Nl=t&&t[1]||""}return`
34
- `+Nl+e}var _l=!1;function Cl(e,t){if(!e||_l)return"";_l=!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(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.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 a=`
37
- `+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{_l=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?io(e):""}function rv(e){switch(e.tag){case 5:return io(e.type);case 16:return io("Lazy");case 13:return io("Suspense");case 19:return io("SuspenseList");case 0:case 2:case 15:return e=Cl(e.type,!1),e;case 11:return e=Cl(e.type.render,!1),e;case 1:return e=Cl(e.type,!0),e;default:return""}}function ca(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 ur:return"Fragment";case ar:return"Portal";case la:return"Profiler";case ku:return"StrictMode";case aa:return"Suspense";case ua:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case jh:return(e.displayName||"Context")+".Consumer";case Ch:return(e._context.displayName||"Context")+".Provider";case Su:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Eu:return t=e.displayName||null,t!==null?t:ca(e.type)||"Memo";case en:t=e._payload,e=e._init;try{return ca(e(t))}catch{}}return null}function ov(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 ca(t);case 8:return t===ku?"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 wn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $h(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iv(e){var t=$h(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 mi(e){e._valueTracker||(e._valueTracker=iv(e))}function Ph(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$h(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function os(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 da(e,t){var n=t.checked;return ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Uc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=wn(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 Ih(e,t){t=t.checked,t!=null&&wu(e,"checked",t,!1)}function fa(e,t){Ih(e,t);var n=wn(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")?ha(e,t.type,n):t.hasOwnProperty("defaultValue")&&ha(e,t.type,wn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wc(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 ha(e,t,n){(t!=="number"||os(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var so=Array.isArray;function kr(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=""+wn(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 pa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return ge({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Yc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(so(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:wn(n)}}function Th(e,t){var n=wn(t.value),r=wn(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 Xc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function zh(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 ma(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?zh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var gi,bh=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(gi=gi||document.createElement("div"),gi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=gi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _o(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ho={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},sv=["Webkit","ms","Moz","O"];Object.keys(ho).forEach(function(e){sv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ho[t]=ho[e]})});function Lh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ho.hasOwnProperty(e)&&ho[e]?(""+t).trim():t+"px"}function Ah(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Lh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var lv=ge({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 ga(e,t){if(t){if(lv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function ya(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 va=null;function Nu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xa=null,Sr=null,Er=null;function Kc(e){if(e=ti(e)){if(typeof xa!="function")throw Error(B(280));var t=e.stateNode;t&&(t=Ks(t),xa(e.stateNode,e.type,t))}}function Rh(e){Sr?Er?Er.push(e):Er=[e]:Sr=e}function Dh(){if(Sr){var e=Sr,t=Er;if(Er=Sr=null,Kc(e),t)for(e=0;e<t.length;e++)Kc(t[e])}}function Oh(e,t){return e(t)}function Fh(){}var jl=!1;function Hh(e,t,n){if(jl)return e(t,n);jl=!0;try{return Oh(e,t,n)}finally{jl=!1,(Sr!==null||Er!==null)&&(Fh(),Dh())}}function Co(e,t){var n=e.stateNode;if(n===null)return null;var r=Ks(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(B(231,t,typeof n));return n}var wa=!1;if(Wt)try{var Gr={};Object.defineProperty(Gr,"passive",{get:function(){wa=!0}}),window.addEventListener("test",Gr,Gr),window.removeEventListener("test",Gr,Gr)}catch{wa=!1}function av(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var po=!1,is=null,ss=!1,ka=null,uv={onError:function(e){po=!0,is=e}};function cv(e,t,n,r,o,i,s,l,a){po=!1,is=null,av.apply(uv,arguments)}function dv(e,t,n,r,o,i,s,l,a){if(cv.apply(this,arguments),po){if(po){var u=is;po=!1,is=null}else throw Error(B(198));ss||(ss=!0,ka=u)}}function nr(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 Vh(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 Qc(e){if(nr(e)!==e)throw Error(B(188))}function fv(e){var t=e.alternate;if(!t){if(t=nr(e),t===null)throw Error(B(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 Qc(o),e;if(i===r)return Qc(o),t;i=i.sibling}throw Error(B(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(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function Bh(e){return e=fv(e),e!==null?Uh(e):null}function Uh(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Uh(e);if(t!==null)return t;e=e.sibling}return null}var Wh=Ge.unstable_scheduleCallback,Gc=Ge.unstable_cancelCallback,hv=Ge.unstable_shouldYield,pv=Ge.unstable_requestPaint,xe=Ge.unstable_now,mv=Ge.unstable_getCurrentPriorityLevel,_u=Ge.unstable_ImmediatePriority,Yh=Ge.unstable_UserBlockingPriority,ls=Ge.unstable_NormalPriority,gv=Ge.unstable_LowPriority,Xh=Ge.unstable_IdlePriority,Us=null,$t=null;function yv(e){if($t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(Us,e,void 0,(e.current.flags&128)===128)}catch{}}var vt=Math.clz32?Math.clz32:wv,vv=Math.log,xv=Math.LN2;function wv(e){return e>>>=0,e===0?32:31-(vv(e)/xv|0)|0}var yi=64,vi=4194304;function lo(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 as(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=lo(l):(i&=s,i!==0&&(r=lo(i)))}else s=n&~o,s!==0?r=lo(s):i!==0&&(r=lo(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-vt(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 Sv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-vt(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=kv(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function Sa(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Kh(){var e=yi;return yi<<=1,!(yi&4194240)&&(yi=64),e}function Ml(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Jo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vt(t),e[t]=n}function Ev(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-vt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Cu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-vt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ae=0;function Qh(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Gh,ju,qh,Zh,Jh,Ea=!1,xi=[],fn=null,hn=null,pn=null,jo=new Map,Mo=new Map,on=[],Nv="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 qc(e,t){switch(e){case"focusin":case"focusout":fn=null;break;case"dragenter":case"dragleave":hn=null;break;case"mouseover":case"mouseout":pn=null;break;case"pointerover":case"pointerout":jo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Mo.delete(t.pointerId)}}function qr(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=ti(t),t!==null&&ju(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function _v(e,t,n,r,o){switch(t){case"focusin":return fn=qr(fn,e,t,n,r,o),!0;case"dragenter":return hn=qr(hn,e,t,n,r,o),!0;case"mouseover":return pn=qr(pn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return jo.set(i,qr(jo.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Mo.set(i,qr(Mo.get(i)||null,e,t,n,r,o)),!0}return!1}function ep(e){var t=Tn(e.target);if(t!==null){var n=nr(t);if(n!==null){if(t=n.tag,t===13){if(t=Vh(n),t!==null){e.blockedOn=t,Jh(e.priority,function(){qh(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 Vi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Na(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);va=r,n.target.dispatchEvent(r),va=null}else return t=ti(n),t!==null&&ju(t),e.blockedOn=n,!1;t.shift()}return!0}function Zc(e,t,n){Vi(e)&&n.delete(t)}function Cv(){Ea=!1,fn!==null&&Vi(fn)&&(fn=null),hn!==null&&Vi(hn)&&(hn=null),pn!==null&&Vi(pn)&&(pn=null),jo.forEach(Zc),Mo.forEach(Zc)}function Zr(e,t){e.blockedOn===t&&(e.blockedOn=null,Ea||(Ea=!0,Ge.unstable_scheduleCallback(Ge.unstable_NormalPriority,Cv)))}function $o(e){function t(o){return Zr(o,e)}if(0<xi.length){Zr(xi[0],e);for(var n=1;n<xi.length;n++){var r=xi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(fn!==null&&Zr(fn,e),hn!==null&&Zr(hn,e),pn!==null&&Zr(pn,e),jo.forEach(t),Mo.forEach(t),n=0;n<on.length;n++)r=on[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<on.length&&(n=on[0],n.blockedOn===null);)ep(n),n.blockedOn===null&&on.shift()}var Nr=Gt.ReactCurrentBatchConfig,us=!0;function jv(e,t,n,r){var o=ae,i=Nr.transition;Nr.transition=null;try{ae=1,Mu(e,t,n,r)}finally{ae=o,Nr.transition=i}}function Mv(e,t,n,r){var o=ae,i=Nr.transition;Nr.transition=null;try{ae=4,Mu(e,t,n,r)}finally{ae=o,Nr.transition=i}}function Mu(e,t,n,r){if(us){var o=Na(e,t,n,r);if(o===null)Dl(e,t,r,cs,n),qc(e,r);else if(_v(o,e,t,n,r))r.stopPropagation();else if(qc(e,r),t&4&&-1<Nv.indexOf(e)){for(;o!==null;){var i=ti(o);if(i!==null&&Gh(i),i=Na(e,t,n,r),i===null&&Dl(e,t,r,cs,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Dl(e,t,r,null,n)}}var cs=null;function Na(e,t,n,r){if(cs=null,e=Nu(r),e=Tn(e),e!==null)if(t=nr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Vh(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 cs=e,null}function tp(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(mv()){case _u:return 1;case Yh:return 4;case ls:case gv:return 16;case Xh:return 536870912;default:return 16}default:return 16}}var an=null,$u=null,Bi=null;function np(){if(Bi)return Bi;var e,t=$u,n=t.length,r,o="value"in an?an.value:an.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 Bi=o.slice(e,1<r?1-r:void 0)}function Ui(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 wi(){return!0}function Jc(){return!1}function Je(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)?wi:Jc,this.isPropagationStopped=Jc,this}return ge(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=wi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=wi)},persist:function(){},isPersistent:wi}),t}var Yr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pu=Je(Yr),ei=ge({},Yr,{view:0,detail:0}),$v=Je(ei),$l,Pl,Jr,Ws=ge({},ei,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Iu,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!==Jr&&(Jr&&e.type==="mousemove"?($l=e.screenX-Jr.screenX,Pl=e.screenY-Jr.screenY):Pl=$l=0,Jr=e),$l)},movementY:function(e){return"movementY"in e?e.movementY:Pl}}),ed=Je(Ws),Pv=ge({},Ws,{dataTransfer:0}),Iv=Je(Pv),Tv=ge({},ei,{relatedTarget:0}),Il=Je(Tv),zv=ge({},Yr,{animationName:0,elapsedTime:0,pseudoElement:0}),bv=Je(zv),Lv=ge({},Yr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Av=Je(Lv),Rv=ge({},Yr,{data:0}),td=Je(Rv),Dv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ov={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"},Fv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fv[e])?!!t[e]:!1}function Iu(){return Hv}var Vv=ge({},ei,{key:function(e){if(e.key){var t=Dv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ui(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ov[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Iu,charCode:function(e){return e.type==="keypress"?Ui(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ui(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Bv=Je(Vv),Uv=ge({},Ws,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nd=Je(Uv),Wv=ge({},ei,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Iu}),Yv=Je(Wv),Xv=ge({},Yr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kv=Je(Xv),Qv=ge({},Ws,{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}),Gv=Je(Qv),qv=[9,13,27,32],Tu=Wt&&"CompositionEvent"in window,mo=null;Wt&&"documentMode"in document&&(mo=document.documentMode);var Zv=Wt&&"TextEvent"in window&&!mo,rp=Wt&&(!Tu||mo&&8<mo&&11>=mo),rd=" ",od=!1;function op(e,t){switch(e){case"keyup":return qv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ip(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cr=!1;function Jv(e,t){switch(e){case"compositionend":return ip(t);case"keypress":return t.which!==32?null:(od=!0,rd);case"textInput":return e=t.data,e===rd&&od?null:e;default:return null}}function ex(e,t){if(cr)return e==="compositionend"||!Tu&&op(e,t)?(e=np(),Bi=$u=an=null,cr=!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 rp&&t.locale!=="ko"?null:t.data;default:return null}}var tx={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 id(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tx[e.type]:t==="textarea"}function sp(e,t,n,r){Rh(r),t=ds(t,"onChange"),0<t.length&&(n=new Pu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var go=null,Po=null;function nx(e){yp(e,0)}function Ys(e){var t=hr(e);if(Ph(t))return e}function rx(e,t){if(e==="change")return t}var lp=!1;if(Wt){var Tl;if(Wt){var zl="oninput"in document;if(!zl){var sd=document.createElement("div");sd.setAttribute("oninput","return;"),zl=typeof sd.oninput=="function"}Tl=zl}else Tl=!1;lp=Tl&&(!document.documentMode||9<document.documentMode)}function ld(){go&&(go.detachEvent("onpropertychange",ap),Po=go=null)}function ap(e){if(e.propertyName==="value"&&Ys(Po)){var t=[];sp(t,Po,e,Nu(e)),Hh(nx,t)}}function ox(e,t,n){e==="focusin"?(ld(),go=t,Po=n,go.attachEvent("onpropertychange",ap)):e==="focusout"&&ld()}function ix(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ys(Po)}function sx(e,t){if(e==="click")return Ys(t)}function lx(e,t){if(e==="input"||e==="change")return Ys(t)}function ax(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wt=typeof Object.is=="function"?Object.is:ax;function Io(e,t){if(wt(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(!sa.call(t,o)||!wt(e[o],t[o]))return!1}return!0}function ad(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ud(e,t){var n=ad(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=ad(n)}}function up(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?up(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cp(){for(var e=window,t=os();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=os(e.document)}return t}function zu(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 ux(e){var t=cp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&up(n.ownerDocument.documentElement,n)){if(r!==null&&zu(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=ud(n,i);var s=ud(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 cx=Wt&&"documentMode"in document&&11>=document.documentMode,dr=null,_a=null,yo=null,Ca=!1;function cd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ca||dr==null||dr!==os(r)||(r=dr,"selectionStart"in r&&zu(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}),yo&&Io(yo,r)||(yo=r,r=ds(_a,"onSelect"),0<r.length&&(t=new Pu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=dr)))}function ki(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var fr={animationend:ki("Animation","AnimationEnd"),animationiteration:ki("Animation","AnimationIteration"),animationstart:ki("Animation","AnimationStart"),transitionend:ki("Transition","TransitionEnd")},bl={},dp={};Wt&&(dp=document.createElement("div").style,"AnimationEvent"in window||(delete fr.animationend.animation,delete fr.animationiteration.animation,delete fr.animationstart.animation),"TransitionEvent"in window||delete fr.transitionend.transition);function Xs(e){if(bl[e])return bl[e];if(!fr[e])return e;var t=fr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in dp)return bl[e]=t[n];return e}var fp=Xs("animationend"),hp=Xs("animationiteration"),pp=Xs("animationstart"),mp=Xs("transitionend"),gp=new Map,dd="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 En(e,t){gp.set(e,t),tr(t,[e])}for(var Ll=0;Ll<dd.length;Ll++){var Al=dd[Ll],dx=Al.toLowerCase(),fx=Al[0].toUpperCase()+Al.slice(1);En(dx,"on"+fx)}En(fp,"onAnimationEnd");En(hp,"onAnimationIteration");En(pp,"onAnimationStart");En("dblclick","onDoubleClick");En("focusin","onFocus");En("focusout","onBlur");En(mp,"onTransitionEnd");$r("onMouseEnter",["mouseout","mouseover"]);$r("onMouseLeave",["mouseout","mouseover"]);$r("onPointerEnter",["pointerout","pointerover"]);$r("onPointerLeave",["pointerout","pointerover"]);tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));tr("onBeforeInput",["compositionend","keypress","textInput","paste"]);tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ao="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),hx=new Set("cancel close invalid load scroll toggle".split(" ").concat(ao));function fd(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,dv(r,t,void 0,e),e.currentTarget=null}function yp(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],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;fd(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;fd(o,l,u),i=a}}}if(ss)throw e=ka,ss=!1,ka=null,e}function ce(e,t){var n=t[Ia];n===void 0&&(n=t[Ia]=new Set);var r=e+"__bubble";n.has(r)||(vp(t,e,2,!1),n.add(r))}function Rl(e,t,n){var r=0;t&&(r|=4),vp(n,e,r,t)}var Si="_reactListening"+Math.random().toString(36).slice(2);function To(e){if(!e[Si]){e[Si]=!0,_h.forEach(function(n){n!=="selectionchange"&&(hx.has(n)||Rl(n,!1,e),Rl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Si]||(t[Si]=!0,Rl("selectionchange",!1,t))}}function vp(e,t,n,r){switch(tp(t)){case 1:var o=jv;break;case 4:o=Mv;break;default:o=Mu}n=o.bind(null,t,n,e),o=void 0,!wa||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 Dl(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 a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=Tn(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Hh(function(){var u=i,c=Nu(n),f=[];e:{var d=gp.get(e);if(d!==void 0){var p=Pu,y=e;switch(e){case"keypress":if(Ui(n)===0)break e;case"keydown":case"keyup":p=Bv;break;case"focusin":y="focus",p=Il;break;case"focusout":y="blur",p=Il;break;case"beforeblur":case"afterblur":p=Il;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":p=ed;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Iv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=Yv;break;case fp:case hp:case pp:p=bv;break;case mp:p=Kv;break;case"scroll":p=$v;break;case"wheel":p=Gv;break;case"copy":case"cut":case"paste":p=Av;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=nd}var x=(t&4)!==0,k=!x&&e==="scroll",m=x?d!==null?d+"Capture":null:d;x=[];for(var v=u,g;v!==null;){g=v;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,m!==null&&(w=Co(v,m),w!=null&&x.push(zo(v,w,g)))),k)break;v=v.return}0<x.length&&(d=new p(d,y,null,n,c),f.push({event:d,listeners:x}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",d&&n!==va&&(y=n.relatedTarget||n.fromElement)&&(Tn(y)||y[Yt]))break e;if((p||d)&&(d=c.window===c?c:(d=c.ownerDocument)?d.defaultView||d.parentWindow:window,p?(y=n.relatedTarget||n.toElement,p=u,y=y?Tn(y):null,y!==null&&(k=nr(y),y!==k||y.tag!==5&&y.tag!==6)&&(y=null)):(p=null,y=u),p!==y)){if(x=ed,w="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(x=nd,w="onPointerLeave",m="onPointerEnter",v="pointer"),k=p==null?d:hr(p),g=y==null?d:hr(y),d=new x(w,v+"leave",p,n,c),d.target=k,d.relatedTarget=g,w=null,Tn(c)===u&&(x=new x(m,v+"enter",y,n,c),x.target=g,x.relatedTarget=k,w=x),k=w,p&&y)t:{for(x=p,m=y,v=0,g=x;g;g=rr(g))v++;for(g=0,w=m;w;w=rr(w))g++;for(;0<v-g;)x=rr(x),v--;for(;0<g-v;)m=rr(m),g--;for(;v--;){if(x===m||m!==null&&x===m.alternate)break t;x=rr(x),m=rr(m)}x=null}else x=null;p!==null&&hd(f,d,p,x,!1),y!==null&&k!==null&&hd(f,k,y,x,!0)}}e:{if(d=u?hr(u):window,p=d.nodeName&&d.nodeName.toLowerCase(),p==="select"||p==="input"&&d.type==="file")var C=rx;else if(id(d))if(lp)C=lx;else{C=ix;var E=ox}else(p=d.nodeName)&&p.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(C=sx);if(C&&(C=C(e,u))){sp(f,C,n,c);break e}E&&E(e,d,u),e==="focusout"&&(E=d._wrapperState)&&E.controlled&&d.type==="number"&&ha(d,"number",d.value)}switch(E=u?hr(u):window,e){case"focusin":(id(E)||E.contentEditable==="true")&&(dr=E,_a=u,yo=null);break;case"focusout":yo=_a=dr=null;break;case"mousedown":Ca=!0;break;case"contextmenu":case"mouseup":case"dragend":Ca=!1,cd(f,n,c);break;case"selectionchange":if(cx)break;case"keydown":case"keyup":cd(f,n,c)}var N;if(Tu)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else cr?op(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(rp&&n.locale!=="ko"&&(cr||j!=="onCompositionStart"?j==="onCompositionEnd"&&cr&&(N=np()):(an=c,$u="value"in an?an.value:an.textContent,cr=!0)),E=ds(u,j),0<E.length&&(j=new td(j,e,null,n,c),f.push({event:j,listeners:E}),N?j.data=N:(N=ip(n),N!==null&&(j.data=N)))),(N=Zv?Jv(e,n):ex(e,n))&&(u=ds(u,"onBeforeInput"),0<u.length&&(c=new td("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=N))}yp(f,t)})}function zo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ds(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Co(e,n),i!=null&&r.unshift(zo(e,i,o)),i=Co(e,t),i!=null&&r.push(zo(e,i,o))),e=e.return}return r}function rr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hd(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=Co(n,i),a!=null&&s.unshift(zo(n,a,l))):o||(a=Co(n,i),a!=null&&s.push(zo(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var px=/\r\n?/g,mx=/\u0000|\uFFFD/g;function pd(e){return(typeof e=="string"?e:""+e).replace(px,`
38
- `).replace(mx,"")}function Ei(e,t,n){if(t=pd(t),pd(e)!==t&&n)throw Error(B(425))}function fs(){}var ja=null,Ma=null;function $a(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 Pa=typeof setTimeout=="function"?setTimeout:void 0,gx=typeof clearTimeout=="function"?clearTimeout:void 0,md=typeof Promise=="function"?Promise:void 0,yx=typeof queueMicrotask=="function"?queueMicrotask:typeof md<"u"?function(e){return md.resolve(null).then(e).catch(vx)}:Pa;function vx(e){setTimeout(function(){throw e})}function Ol(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),$o(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);$o(t)}function mn(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 gd(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 Xr=Math.random().toString(36).slice(2),jt="__reactFiber$"+Xr,bo="__reactProps$"+Xr,Yt="__reactContainer$"+Xr,Ia="__reactEvents$"+Xr,xx="__reactListeners$"+Xr,wx="__reactHandles$"+Xr;function Tn(e){var t=e[jt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Yt]||n[jt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gd(e);e!==null;){if(n=e[jt])return n;e=gd(e)}return t}e=n,n=e.parentNode}return null}function ti(e){return e=e[jt]||e[Yt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function hr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function Ks(e){return e[bo]||null}var Ta=[],pr=-1;function Nn(e){return{current:e}}function de(e){0>pr||(e.current=Ta[pr],Ta[pr]=null,pr--)}function ue(e,t){pr++,Ta[pr]=e.current,e.current=t}var kn={},ze=Nn(kn),Be=Nn(!1),Wn=kn;function Pr(e,t){var n=e.type.contextTypes;if(!n)return kn;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 Ue(e){return e=e.childContextTypes,e!=null}function hs(){de(Be),de(ze)}function yd(e,t,n){if(ze.current!==kn)throw Error(B(168));ue(ze,t),ue(Be,n)}function xp(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(B(108,ov(e)||"Unknown",o));return ge({},n,r)}function ps(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||kn,Wn=ze.current,ue(ze,e),ue(Be,Be.current),!0}function vd(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=xp(e,t,Wn),r.__reactInternalMemoizedMergedChildContext=e,de(Be),de(ze),ue(ze,e)):de(Be),ue(Be,n)}var Ot=null,Qs=!1,Fl=!1;function wp(e){Ot===null?Ot=[e]:Ot.push(e)}function kx(e){Qs=!0,wp(e)}function _n(){if(!Fl&&Ot!==null){Fl=!0;var e=0,t=ae;try{var n=Ot;for(ae=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ot=null,Qs=!1}catch(o){throw Ot!==null&&(Ot=Ot.slice(e+1)),Wh(_u,_n),o}finally{ae=t,Fl=!1}}return null}var mr=[],gr=0,ms=null,gs=0,tt=[],nt=0,Yn=null,Ft=1,Ht="";function $n(e,t){mr[gr++]=gs,mr[gr++]=ms,ms=e,gs=t}function kp(e,t,n){tt[nt++]=Ft,tt[nt++]=Ht,tt[nt++]=Yn,Yn=e;var r=Ft;e=Ht;var o=32-vt(r)-1;r&=~(1<<o),n+=1;var i=32-vt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Ft=1<<32-vt(t)+o|n<<o|r,Ht=i+e}else Ft=1<<i|n<<o|r,Ht=e}function bu(e){e.return!==null&&($n(e,1),kp(e,1,0))}function Lu(e){for(;e===ms;)ms=mr[--gr],mr[gr]=null,gs=mr[--gr],mr[gr]=null;for(;e===Yn;)Yn=tt[--nt],tt[nt]=null,Ht=tt[--nt],tt[nt]=null,Ft=tt[--nt],tt[nt]=null}var Qe=null,Ke=null,he=!1,pt=null;function Sp(e,t){var n=rt(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 xd(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,Qe=e,Ke=mn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Qe=e,Ke=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Yn!==null?{id:Ft,overflow:Ht}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=rt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Qe=e,Ke=null,!0):!1;default:return!1}}function za(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ba(e){if(he){var t=Ke;if(t){var n=t;if(!xd(e,t)){if(za(e))throw Error(B(418));t=mn(n.nextSibling);var r=Qe;t&&xd(e,t)?Sp(r,n):(e.flags=e.flags&-4097|2,he=!1,Qe=e)}}else{if(za(e))throw Error(B(418));e.flags=e.flags&-4097|2,he=!1,Qe=e}}}function wd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qe=e}function Ni(e){if(e!==Qe)return!1;if(!he)return wd(e),he=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!$a(e.type,e.memoizedProps)),t&&(t=Ke)){if(za(e))throw Ep(),Error(B(418));for(;t;)Sp(e,t),t=mn(t.nextSibling)}if(wd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ke=mn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ke=null}}else Ke=Qe?mn(e.stateNode.nextSibling):null;return!0}function Ep(){for(var e=Ke;e;)e=mn(e.nextSibling)}function Ir(){Ke=Qe=null,he=!1}function Au(e){pt===null?pt=[e]:pt.push(e)}var Sx=Gt.ReactCurrentBatchConfig;function eo(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(B(309));var r=n.stateNode}if(!r)throw Error(B(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(B(284));if(!n._owner)throw Error(B(290,e))}return e}function _i(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function kd(e){var t=e._init;return t(e._payload)}function Np(e){function t(m,v){if(e){var g=m.deletions;g===null?(m.deletions=[v],m.flags|=16):g.push(v)}}function n(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function r(m,v){for(m=new Map;v!==null;)v.key!==null?m.set(v.key,v):m.set(v.index,v),v=v.sibling;return m}function o(m,v){return m=xn(m,v),m.index=0,m.sibling=null,m}function i(m,v,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<v?(m.flags|=2,v):g):(m.flags|=2,v)):(m.flags|=1048576,v)}function s(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,v,g,w){return v===null||v.tag!==6?(v=Xl(g,m.mode,w),v.return=m,v):(v=o(v,g),v.return=m,v)}function a(m,v,g,w){var C=g.type;return C===ur?c(m,v,g.props.children,w,g.key):v!==null&&(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===en&&kd(C)===v.type)?(w=o(v,g.props),w.ref=eo(m,v,g),w.return=m,w):(w=qi(g.type,g.key,g.props,null,m.mode,w),w.ref=eo(m,v,g),w.return=m,w)}function u(m,v,g,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=Kl(g,m.mode,w),v.return=m,v):(v=o(v,g.children||[]),v.return=m,v)}function c(m,v,g,w,C){return v===null||v.tag!==7?(v=On(g,m.mode,w,C),v.return=m,v):(v=o(v,g),v.return=m,v)}function f(m,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Xl(""+v,m.mode,g),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case pi:return g=qi(v.type,v.key,v.props,null,m.mode,g),g.ref=eo(m,null,v),g.return=m,g;case ar:return v=Kl(v,m.mode,g),v.return=m,v;case en:var w=v._init;return f(m,w(v._payload),g)}if(so(v)||Qr(v))return v=On(v,m.mode,g,null),v.return=m,v;_i(m,v)}return null}function d(m,v,g,w){var C=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return C!==null?null:l(m,v,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case pi:return g.key===C?a(m,v,g,w):null;case ar:return g.key===C?u(m,v,g,w):null;case en:return C=g._init,d(m,v,C(g._payload),w)}if(so(g)||Qr(g))return C!==null?null:c(m,v,g,w,null);_i(m,g)}return null}function p(m,v,g,w,C){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(g)||null,l(v,m,""+w,C);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case pi:return m=m.get(w.key===null?g:w.key)||null,a(v,m,w,C);case ar:return m=m.get(w.key===null?g:w.key)||null,u(v,m,w,C);case en:var E=w._init;return p(m,v,g,E(w._payload),C)}if(so(w)||Qr(w))return m=m.get(g)||null,c(v,m,w,C,null);_i(v,w)}return null}function y(m,v,g,w){for(var C=null,E=null,N=v,j=v=0,P=null;N!==null&&j<g.length;j++){N.index>j?(P=N,N=null):P=N.sibling;var A=d(m,N,g[j],w);if(A===null){N===null&&(N=P);break}e&&N&&A.alternate===null&&t(m,N),v=i(A,v,j),E===null?C=A:E.sibling=A,E=A,N=P}if(j===g.length)return n(m,N),he&&$n(m,j),C;if(N===null){for(;j<g.length;j++)N=f(m,g[j],w),N!==null&&(v=i(N,v,j),E===null?C=N:E.sibling=N,E=N);return he&&$n(m,j),C}for(N=r(m,N);j<g.length;j++)P=p(N,m,j,g[j],w),P!==null&&(e&&P.alternate!==null&&N.delete(P.key===null?j:P.key),v=i(P,v,j),E===null?C=P:E.sibling=P,E=P);return e&&N.forEach(function(R){return t(m,R)}),he&&$n(m,j),C}function x(m,v,g,w){var C=Qr(g);if(typeof C!="function")throw Error(B(150));if(g=C.call(g),g==null)throw Error(B(151));for(var E=C=null,N=v,j=v=0,P=null,A=g.next();N!==null&&!A.done;j++,A=g.next()){N.index>j?(P=N,N=null):P=N.sibling;var R=d(m,N,A.value,w);if(R===null){N===null&&(N=P);break}e&&N&&R.alternate===null&&t(m,N),v=i(R,v,j),E===null?C=R:E.sibling=R,E=R,N=P}if(A.done)return n(m,N),he&&$n(m,j),C;if(N===null){for(;!A.done;j++,A=g.next())A=f(m,A.value,w),A!==null&&(v=i(A,v,j),E===null?C=A:E.sibling=A,E=A);return he&&$n(m,j),C}for(N=r(m,N);!A.done;j++,A=g.next())A=p(N,m,j,A.value,w),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?j:A.key),v=i(A,v,j),E===null?C=A:E.sibling=A,E=A);return e&&N.forEach(function(H){return t(m,H)}),he&&$n(m,j),C}function k(m,v,g,w){if(typeof g=="object"&&g!==null&&g.type===ur&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case pi:e:{for(var C=g.key,E=v;E!==null;){if(E.key===C){if(C=g.type,C===ur){if(E.tag===7){n(m,E.sibling),v=o(E,g.props.children),v.return=m,m=v;break e}}else if(E.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===en&&kd(C)===E.type){n(m,E.sibling),v=o(E,g.props),v.ref=eo(m,E,g),v.return=m,m=v;break e}n(m,E);break}else t(m,E);E=E.sibling}g.type===ur?(v=On(g.props.children,m.mode,w,g.key),v.return=m,m=v):(w=qi(g.type,g.key,g.props,null,m.mode,w),w.ref=eo(m,v,g),w.return=m,m=w)}return s(m);case ar:e:{for(E=g.key;v!==null;){if(v.key===E)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(m,v.sibling),v=o(v,g.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=Kl(g,m.mode,w),v.return=m,m=v}return s(m);case en:return E=g._init,k(m,v,E(g._payload),w)}if(so(g))return y(m,v,g,w);if(Qr(g))return x(m,v,g,w);_i(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(m,v.sibling),v=o(v,g),v.return=m,m=v):(n(m,v),v=Xl(g,m.mode,w),v.return=m,m=v),s(m)):n(m,v)}return k}var Tr=Np(!0),_p=Np(!1),ys=Nn(null),vs=null,yr=null,Ru=null;function Du(){Ru=yr=vs=null}function Ou(e){var t=ys.current;de(ys),e._currentValue=t}function La(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 _r(e,t){vs=e,Ru=yr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(He=!0),e.firstContext=null)}function st(e){var t=e._currentValue;if(Ru!==e)if(e={context:e,memoizedValue:t,next:null},yr===null){if(vs===null)throw Error(B(308));yr=e,vs.dependencies={lanes:0,firstContext:e}}else yr=yr.next=e;return t}var zn=null;function Fu(e){zn===null?zn=[e]:zn.push(e)}function Cp(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Fu(t)):(n.next=o.next,o.next=n),t.interleaved=n,Xt(e,r)}function Xt(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 tn=!1;function Hu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jp(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 Bt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function gn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,le&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Xt(e,n)}return o=r.interleaved,o===null?(t.next=t,Fu(r)):(t.next=o.next,o.next=t),r.interleaved=t,Xt(e,n)}function Wi(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,Cu(e,n)}}function Sd(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 xs(e,t,n,r){var o=e.updateQueue;tn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(i!==null){var f=o.baseState;s=0,c=u=a=null,l=i;do{var d=l.lane,p=l.eventTime;if((r&d)===d){c!==null&&(c=c.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,x=l;switch(d=t,p=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){f=y.call(p,f,d);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,d=typeof y=="function"?y.call(p,f,d):y,d==null)break e;f=ge({},f,d);break e;case 2:tn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,d=o.effects,d===null?o.effects=[l]:d.push(l))}else p={eventTime:p,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,a=f):c=c.next=p,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(c===null&&(a=f),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,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);Kn|=s,e.lanes=s,e.memoizedState=f}}function Ed(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(B(191,o));o.call(r)}}}var ni={},Pt=Nn(ni),Lo=Nn(ni),Ao=Nn(ni);function bn(e){if(e===ni)throw Error(B(174));return e}function Vu(e,t){switch(ue(Ao,t),ue(Lo,e),ue(Pt,ni),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ma(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ma(t,e)}de(Pt),ue(Pt,t)}function zr(){de(Pt),de(Lo),de(Ao)}function Mp(e){bn(Ao.current);var t=bn(Pt.current),n=ma(t,e.type);t!==n&&(ue(Lo,e),ue(Pt,n))}function Bu(e){Lo.current===e&&(de(Pt),de(Lo))}var pe=Nn(0);function ws(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 Hl=[];function Uu(){for(var e=0;e<Hl.length;e++)Hl[e]._workInProgressVersionPrimary=null;Hl.length=0}var Yi=Gt.ReactCurrentDispatcher,Vl=Gt.ReactCurrentBatchConfig,Xn=0,me=null,Se=null,_e=null,ks=!1,vo=!1,Ro=0,Ex=0;function Pe(){throw Error(B(321))}function Wu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wt(e[n],t[n]))return!1;return!0}function Yu(e,t,n,r,o,i){if(Xn=i,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yi.current=e===null||e.memoizedState===null?jx:Mx,e=n(r,o),vo){i=0;do{if(vo=!1,Ro=0,25<=i)throw Error(B(301));i+=1,_e=Se=null,t.updateQueue=null,Yi.current=$x,e=n(r,o)}while(vo)}if(Yi.current=Ss,t=Se!==null&&Se.next!==null,Xn=0,_e=Se=me=null,ks=!1,t)throw Error(B(300));return e}function Xu(){var e=Ro!==0;return Ro=0,e}function _t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _e===null?me.memoizedState=_e=e:_e=_e.next=e,_e}function lt(){if(Se===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Se.next;var t=_e===null?me.memoizedState:_e.next;if(t!==null)_e=t,Se=e;else{if(e===null)throw Error(B(310));Se=e,e={memoizedState:Se.memoizedState,baseState:Se.baseState,baseQueue:Se.baseQueue,queue:Se.queue,next:null},_e===null?me.memoizedState=_e=e:_e=_e.next=e}return _e}function Do(e,t){return typeof t=="function"?t(e):t}function Bl(e){var t=lt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=Se,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,a=null,u=i;do{var c=u.lane;if((Xn&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=f,s=r):a=a.next=f,me.lanes|=c,Kn|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,wt(r,t.memoizedState)||(He=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,me.lanes|=i,Kn|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ul(e){var t=lt(),n=t.queue;if(n===null)throw Error(B(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);wt(i,t.memoizedState)||(He=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function $p(){}function Pp(e,t){var n=me,r=lt(),o=t(),i=!wt(r.memoizedState,o);if(i&&(r.memoizedState=o,He=!0),r=r.queue,Ku(zp.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||_e!==null&&_e.memoizedState.tag&1){if(n.flags|=2048,Oo(9,Tp.bind(null,n,r,o,t),void 0,null),Ce===null)throw Error(B(349));Xn&30||Ip(n,t,o)}return o}function Ip(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=me.updateQueue,t===null?(t={lastEffect:null,stores:null},me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Tp(e,t,n,r){t.value=n,t.getSnapshot=r,bp(t)&&Lp(e)}function zp(e,t,n){return n(function(){bp(t)&&Lp(e)})}function bp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wt(e,n)}catch{return!0}}function Lp(e){var t=Xt(e,1);t!==null&&xt(t,e,1,-1)}function Nd(e){var t=_t();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Do,lastRenderedState:e},t.queue=e,e=e.dispatch=Cx.bind(null,me,e),[t.memoizedState,e]}function Oo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=me.updateQueue,t===null?(t={lastEffect:null,stores:null},me.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 Ap(){return lt().memoizedState}function Xi(e,t,n,r){var o=_t();me.flags|=e,o.memoizedState=Oo(1|t,n,void 0,r===void 0?null:r)}function Gs(e,t,n,r){var o=lt();r=r===void 0?null:r;var i=void 0;if(Se!==null){var s=Se.memoizedState;if(i=s.destroy,r!==null&&Wu(r,s.deps)){o.memoizedState=Oo(t,n,i,r);return}}me.flags|=e,o.memoizedState=Oo(1|t,n,i,r)}function _d(e,t){return Xi(8390656,8,e,t)}function Ku(e,t){return Gs(2048,8,e,t)}function Rp(e,t){return Gs(4,2,e,t)}function Dp(e,t){return Gs(4,4,e,t)}function Op(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 Fp(e,t,n){return n=n!=null?n.concat([e]):null,Gs(4,4,Op.bind(null,t,e),n)}function Qu(){}function Hp(e,t){var n=lt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Vp(e,t){var n=lt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Bp(e,t,n){return Xn&21?(wt(n,t)||(n=Kh(),me.lanes|=n,Kn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,He=!0),e.memoizedState=n)}function Nx(e,t){var n=ae;ae=n!==0&&4>n?n:4,e(!0);var r=Vl.transition;Vl.transition={};try{e(!1),t()}finally{ae=n,Vl.transition=r}}function Up(){return lt().memoizedState}function _x(e,t,n){var r=vn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Wp(e))Yp(t,n);else if(n=Cp(e,t,n,r),n!==null){var o=Ae();xt(n,e,r,o),Xp(n,t,r)}}function Cx(e,t,n){var r=vn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Wp(e))Yp(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,wt(l,s)){var a=t.interleaved;a===null?(o.next=o,Fu(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Cp(e,t,o,r),n!==null&&(o=Ae(),xt(n,e,r,o),Xp(n,t,r))}}function Wp(e){var t=e.alternate;return e===me||t!==null&&t===me}function Yp(e,t){vo=ks=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Xp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cu(e,n)}}var Ss={readContext:st,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},jx={readContext:st,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:st,useEffect:_d,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Xi(4194308,4,Op.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xi(4,2,e,t)},useMemo:function(e,t){var n=_t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_t();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=_x.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:Nd,useDebugValue:Qu,useDeferredValue:function(e){return _t().memoizedState=e},useTransition:function(){var e=Nd(!1),t=e[0];return e=Nx.bind(null,e[1]),_t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=me,o=_t();if(he){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Ce===null)throw Error(B(349));Xn&30||Ip(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,_d(zp.bind(null,r,i,e),[e]),r.flags|=2048,Oo(9,Tp.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=_t(),t=Ce.identifierPrefix;if(he){var n=Ht,r=Ft;n=(r&~(1<<32-vt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ro++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Ex++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Mx={readContext:st,useCallback:Hp,useContext:st,useEffect:Ku,useImperativeHandle:Fp,useInsertionEffect:Rp,useLayoutEffect:Dp,useMemo:Vp,useReducer:Bl,useRef:Ap,useState:function(){return Bl(Do)},useDebugValue:Qu,useDeferredValue:function(e){var t=lt();return Bp(t,Se.memoizedState,e)},useTransition:function(){var e=Bl(Do)[0],t=lt().memoizedState;return[e,t]},useMutableSource:$p,useSyncExternalStore:Pp,useId:Up,unstable_isNewReconciler:!1},$x={readContext:st,useCallback:Hp,useContext:st,useEffect:Ku,useImperativeHandle:Fp,useInsertionEffect:Rp,useLayoutEffect:Dp,useMemo:Vp,useReducer:Ul,useRef:Ap,useState:function(){return Ul(Do)},useDebugValue:Qu,useDeferredValue:function(e){var t=lt();return Se===null?t.memoizedState=e:Bp(t,Se.memoizedState,e)},useTransition:function(){var e=Ul(Do)[0],t=lt().memoizedState;return[e,t]},useMutableSource:$p,useSyncExternalStore:Pp,useId:Up,unstable_isNewReconciler:!1};function ct(e,t){if(e&&e.defaultProps){t=ge({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Aa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ge({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var qs={isMounted:function(e){return(e=e._reactInternals)?nr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ae(),o=vn(e),i=Bt(r,o);i.payload=t,n!=null&&(i.callback=n),t=gn(e,i,o),t!==null&&(xt(t,e,o,r),Wi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ae(),o=vn(e),i=Bt(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=gn(e,i,o),t!==null&&(xt(t,e,o,r),Wi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ae(),r=vn(e),o=Bt(n,r);o.tag=2,t!=null&&(o.callback=t),t=gn(e,o,r),t!==null&&(xt(t,e,r,n),Wi(t,e,r))}};function Cd(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?!Io(n,r)||!Io(o,i):!0}function Kp(e,t,n){var r=!1,o=kn,i=t.contextType;return typeof i=="object"&&i!==null?i=st(i):(o=Ue(t)?Wn:ze.current,r=t.contextTypes,i=(r=r!=null)?Pr(e,o):kn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=qs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function jd(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&&qs.enqueueReplaceState(t,t.state,null)}function Ra(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Hu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=st(i):(i=Ue(t)?Wn:ze.current,o.context=Pr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Aa(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&&qs.enqueueReplaceState(o,o.state,null),xs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function br(e,t){try{var n="",r=t;do n+=rv(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 Wl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Da(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Px=typeof WeakMap=="function"?WeakMap:Map;function Qp(e,t,n){n=Bt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ns||(Ns=!0,Ka=r),Da(e,t)},n}function Gp(e,t,n){n=Bt(-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(){Da(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Da(e,t),typeof r!="function"&&(yn===null?yn=new Set([this]):yn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Md(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Px;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=Ux.bind(null,e,t,n),t.then(e,e))}function $d(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 Pd(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=Bt(-1,1),t.tag=2,gn(n,t,1))),n.lanes|=1),e)}var Ix=Gt.ReactCurrentOwner,He=!1;function Le(e,t,n,r){t.child=e===null?_p(t,null,n,r):Tr(t,e.child,n,r)}function Id(e,t,n,r,o){n=n.render;var i=t.ref;return _r(t,o),r=Yu(e,t,n,r,i,o),n=Xu(),e!==null&&!He?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Kt(e,t,o)):(he&&n&&bu(t),t.flags|=1,Le(e,t,r,o),t.child)}function Td(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!rc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,qp(e,t,i,r,o)):(e=qi(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:Io,n(s,r)&&e.ref===t.ref)return Kt(e,t,o)}return t.flags|=1,e=xn(i,r),e.ref=t.ref,e.return=t,t.child=e}function qp(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Io(i,r)&&e.ref===t.ref)if(He=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(He=!0);else return t.lanes=e.lanes,Kt(e,t,o)}return Oa(e,t,n,r,o)}function Zp(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},ue(xr,Ye),Ye|=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,ue(xr,Ye),Ye|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ue(xr,Ye),Ye|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ue(xr,Ye),Ye|=r;return Le(e,t,o,n),t.child}function Jp(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Oa(e,t,n,r,o){var i=Ue(n)?Wn:ze.current;return i=Pr(t,i),_r(t,o),n=Yu(e,t,n,r,i,o),r=Xu(),e!==null&&!He?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Kt(e,t,o)):(he&&r&&bu(t),t.flags|=1,Le(e,t,n,o),t.child)}function zd(e,t,n,r,o){if(Ue(n)){var i=!0;ps(t)}else i=!1;if(_r(t,o),t.stateNode===null)Ki(e,t),Kp(t,n,r),Ra(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=st(u):(u=Ue(n)?Wn:ze.current,u=Pr(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&jd(t,s,r,u),tn=!1;var d=t.memoizedState;s.state=d,xs(t,r,s,o),a=t.memoizedState,l!==r||d!==a||Be.current||tn?(typeof c=="function"&&(Aa(t,n,c,r),a=t.memoizedState),(l=tn||Cd(t,n,l,r,d,a,u))?(f||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=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,jp(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ct(t.type,l),s.props=u,f=t.pendingProps,d=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=st(a):(a=Ue(n)?Wn:ze.current,a=Pr(t,a));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||d!==a)&&jd(t,s,r,a),tn=!1,d=t.memoizedState,s.state=d,xs(t,r,s,o);var y=t.memoizedState;l!==f||d!==y||Be.current||tn?(typeof p=="function"&&(Aa(t,n,p,r),y=t.memoizedState),(u=tn||Cd(t,n,u,r,d,y,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,a)),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=a,r=u):(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 Fa(e,t,n,r,i,o)}function Fa(e,t,n,r,o,i){Jp(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&vd(t,n,!1),Kt(e,t,i);r=t.stateNode,Ix.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Tr(t,e.child,null,i),t.child=Tr(t,null,l,i)):Le(e,t,l,i),t.memoizedState=r.state,o&&vd(t,n,!0),t.child}function em(e){var t=e.stateNode;t.pendingContext?yd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&yd(e,t.context,!1),Vu(e,t.containerInfo)}function bd(e,t,n,r,o){return Ir(),Au(o),t.flags|=256,Le(e,t,n,r),t.child}var Ha={dehydrated:null,treeContext:null,retryLane:0};function Va(e){return{baseLanes:e,cachePool:null,transitions:null}}function tm(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),ue(pe,o&1),e===null)return ba(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=el(s,r,0,null),e=On(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Va(n),t.memoizedState=Ha,e):Gu(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return Tx(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=xn(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=xn(l,i):(i=On(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?Va(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Ha,r}return i=e.child,e=i.sibling,r=xn(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 Gu(e,t){return t=el({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ci(e,t,n,r){return r!==null&&Au(r),Tr(t,e.child,null,n),e=Gu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tx(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Wl(Error(B(422))),Ci(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=el({mode:"visible",children:r.children},o,0,null),i=On(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Tr(t,e.child,null,s),t.child.memoizedState=Va(s),t.memoizedState=Ha,i);if(!(t.mode&1))return Ci(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(B(419)),r=Wl(i,r,void 0),Ci(e,t,s,r)}if(l=(s&e.childLanes)!==0,He||l){if(r=Ce,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,Xt(e,o),xt(r,e,o,-1))}return nc(),r=Wl(Error(B(421))),Ci(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Wx.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ke=mn(o.nextSibling),Qe=t,he=!0,pt=null,e!==null&&(tt[nt++]=Ft,tt[nt++]=Ht,tt[nt++]=Yn,Ft=e.id,Ht=e.overflow,Yn=t),t=Gu(t,r.children),t.flags|=4096,t)}function Ld(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),La(e.return,t,n)}function Yl(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 nm(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Le(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&&Ld(e,n,t);else if(e.tag===19)Ld(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(ue(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&&ws(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Yl(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&&ws(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Yl(t,!0,n,null,i);break;case"together":Yl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ki(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Kt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=xn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function zx(e,t,n){switch(t.tag){case 3:em(t),Ir();break;case 5:Mp(t);break;case 1:Ue(t.type)&&ps(t);break;case 4:Vu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ue(ys,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ue(pe,pe.current&1),t.flags|=128,null):n&t.child.childLanes?tm(e,t,n):(ue(pe,pe.current&1),e=Kt(e,t,n),e!==null?e.sibling:null);ue(pe,pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return nm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ue(pe,pe.current),r)break;return null;case 22:case 23:return t.lanes=0,Zp(e,t,n)}return Kt(e,t,n)}var rm,Ba,om,im;rm=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}};Ba=function(){};om=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,bn(Pt.current);var i=null;switch(n){case"input":o=da(e,o),r=da(e,r),i=[];break;case"select":o=ge({},o,{value:void 0}),r=ge({},r,{value:void 0}),i=[];break;case"textarea":o=pa(e,o),r=pa(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=fs)}ga(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(No.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(No.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&ce("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};im=function(e,t,n,r){n!==r&&(t.flags|=4)};function to(e,t){if(!he)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 Ie(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 bx(e,t,n){var r=t.pendingProps;switch(Lu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(t),null;case 1:return Ue(t.type)&&hs(),Ie(t),null;case 3:return r=t.stateNode,zr(),de(Be),de(ze),Uu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pt!==null&&(qa(pt),pt=null))),Ba(e,t),Ie(t),null;case 5:Bu(t);var o=bn(Ao.current);if(n=t.type,e!==null&&t.stateNode!=null)om(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Ie(t),null}if(e=bn(Pt.current),Ni(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[jt]=t,r[bo]=i,e=(t.mode&1)!==0,n){case"dialog":ce("cancel",r),ce("close",r);break;case"iframe":case"object":case"embed":ce("load",r);break;case"video":case"audio":for(o=0;o<ao.length;o++)ce(ao[o],r);break;case"source":ce("error",r);break;case"img":case"image":case"link":ce("error",r),ce("load",r);break;case"details":ce("toggle",r);break;case"input":Uc(r,i),ce("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ce("invalid",r);break;case"textarea":Yc(r,i),ce("invalid",r)}ga(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&&Ei(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Ei(r.textContent,l,e),o=["children",""+l]):No.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&ce("scroll",r)}switch(n){case"input":mi(r),Wc(r,i,!0);break;case"textarea":mi(r),Xc(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=fs)}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=zh(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[jt]=t,e[bo]=r,rm(e,t,!1,!1),t.stateNode=e;e:{switch(s=ya(n,r),n){case"dialog":ce("cancel",e),ce("close",e),o=r;break;case"iframe":case"object":case"embed":ce("load",e),o=r;break;case"video":case"audio":for(o=0;o<ao.length;o++)ce(ao[o],e);o=r;break;case"source":ce("error",e),o=r;break;case"img":case"image":case"link":ce("error",e),ce("load",e),o=r;break;case"details":ce("toggle",e),o=r;break;case"input":Uc(e,r),o=da(e,r),ce("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ge({},r,{value:void 0}),ce("invalid",e);break;case"textarea":Yc(e,r),o=pa(e,r),ce("invalid",e);break;default:o=r}ga(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?Ah(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&bh(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&_o(e,a):typeof a=="number"&&_o(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(No.hasOwnProperty(i)?a!=null&&i==="onScroll"&&ce("scroll",e):a!=null&&wu(e,i,a,s))}switch(n){case"input":mi(e),Wc(e,r,!1);break;case"textarea":mi(e),Xc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+wn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?kr(e,!!r.multiple,i,!1):r.defaultValue!=null&&kr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=fs)}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 Ie(t),null;case 6:if(e&&t.stateNode!=null)im(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=bn(Ao.current),bn(Pt.current),Ni(t)){if(r=t.stateNode,n=t.memoizedProps,r[jt]=t,(i=r.nodeValue!==n)&&(e=Qe,e!==null))switch(e.tag){case 3:Ei(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ei(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[jt]=t,t.stateNode=r}return Ie(t),null;case 13:if(de(pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(he&&Ke!==null&&t.mode&1&&!(t.flags&128))Ep(),Ir(),t.flags|=98560,i=!1;else if(i=Ni(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(B(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(B(317));i[jt]=t}else Ir(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ie(t),i=!1}else pt!==null&&(qa(pt),pt=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?Ee===0&&(Ee=3):nc())),t.updateQueue!==null&&(t.flags|=4),Ie(t),null);case 4:return zr(),Ba(e,t),e===null&&To(t.stateNode.containerInfo),Ie(t),null;case 10:return Ou(t.type._context),Ie(t),null;case 17:return Ue(t.type)&&hs(),Ie(t),null;case 19:if(de(pe),i=t.memoizedState,i===null)return Ie(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)to(i,!1);else{if(Ee!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=ws(e),s!==null){for(t.flags|=128,to(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 ue(pe,pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&xe()>Lr&&(t.flags|=128,r=!0,to(i,!1),t.lanes=4194304)}else{if(!r)if(e=ws(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),to(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!he)return Ie(t),null}else 2*xe()-i.renderingStartTime>Lr&&n!==1073741824&&(t.flags|=128,r=!0,to(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=xe(),t.sibling=null,n=pe.current,ue(pe,r?n&1|2:n&1),t):(Ie(t),null);case 22:case 23:return tc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ye&1073741824&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function Lx(e,t){switch(Lu(t),t.tag){case 1:return Ue(t.type)&&hs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zr(),de(Be),de(ze),Uu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bu(t),null;case 13:if(de(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Ir()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(pe),null;case 4:return zr(),null;case 10:return Ou(t.type._context),null;case 22:case 23:return tc(),null;case 24:return null;default:return null}}var ji=!1,Te=!1,Ax=typeof WeakSet=="function"?WeakSet:Set,K=null;function vr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ve(e,t,r)}else n.current=null}function Ua(e,t,n){try{n()}catch(r){ve(e,t,r)}}var Ad=!1;function Rx(e,t){if(ja=us,e=cp(),zu(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,a=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var p;f!==n||o!==0&&f.nodeType!==3||(l=s+o),f!==i||r!==0&&f.nodeType!==3||(a=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===e)break t;if(d===n&&++u===o&&(l=s),d===i&&++c===r&&(a=s),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ma={focusedElem:e,selectionRange:n},us=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;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 x=y.memoizedProps,k=y.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?x:ct(t.type,x),k);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(w){ve(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return y=Ad,Ad=!1,y}function xo(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&&Ua(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 Wa(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 sm(e){var t=e.alternate;t!==null&&(e.alternate=null,sm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jt],delete t[bo],delete t[Ia],delete t[xx],delete t[wx])),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 lm(e){return e.tag===5||e.tag===3||e.tag===4}function Rd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||lm(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 Ya(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=fs));else if(r!==4&&(e=e.child,e!==null))for(Ya(e,t,n),e=e.sibling;e!==null;)Ya(e,t,n),e=e.sibling}function Xa(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(Xa(e,t,n),e=e.sibling;e!==null;)Xa(e,t,n),e=e.sibling}var je=null,dt=!1;function qt(e,t,n){for(n=n.child;n!==null;)am(e,t,n),n=n.sibling}function am(e,t,n){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(Us,n)}catch{}switch(n.tag){case 5:Te||vr(n,t);case 6:var r=je,o=dt;je=null,qt(e,t,n),je=r,dt=o,je!==null&&(dt?(e=je,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):je.removeChild(n.stateNode));break;case 18:je!==null&&(dt?(e=je,n=n.stateNode,e.nodeType===8?Ol(e.parentNode,n):e.nodeType===1&&Ol(e,n),$o(e)):Ol(je,n.stateNode));break;case 4:r=je,o=dt,je=n.stateNode.containerInfo,dt=!0,qt(e,t,n),je=r,dt=o;break;case 0:case 11:case 14:case 15:if(!Te&&(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)&&Ua(n,t,s),o=o.next}while(o!==r)}qt(e,t,n);break;case 1:if(!Te&&(vr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){ve(n,t,l)}qt(e,t,n);break;case 21:qt(e,t,n);break;case 22:n.mode&1?(Te=(r=Te)||n.memoizedState!==null,qt(e,t,n),Te=r):qt(e,t,n);break;default:qt(e,t,n)}}function Dd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ax),t.forEach(function(r){var o=Yx.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ut(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:je=l.stateNode,dt=!1;break e;case 3:je=l.stateNode.containerInfo,dt=!0;break e;case 4:je=l.stateNode.containerInfo,dt=!0;break e}l=l.return}if(je===null)throw Error(B(160));am(i,s,o),je=null,dt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){ve(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)um(t,e),t=t.sibling}function um(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ut(t,e),Nt(e),r&4){try{xo(3,e,e.return),Zs(3,e)}catch(x){ve(e,e.return,x)}try{xo(5,e,e.return)}catch(x){ve(e,e.return,x)}}break;case 1:ut(t,e),Nt(e),r&512&&n!==null&&vr(n,n.return);break;case 5:if(ut(t,e),Nt(e),r&512&&n!==null&&vr(n,n.return),e.flags&32){var o=e.stateNode;try{_o(o,"")}catch(x){ve(e,e.return,x)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Ih(o,i),ya(l,s);var u=ya(l,i);for(s=0;s<a.length;s+=2){var c=a[s],f=a[s+1];c==="style"?Ah(o,f):c==="dangerouslySetInnerHTML"?bh(o,f):c==="children"?_o(o,f):wu(o,c,f,u)}switch(l){case"input":fa(o,i);break;case"textarea":Th(o,i);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?kr(o,!!i.multiple,p,!1):d!==!!i.multiple&&(i.defaultValue!=null?kr(o,!!i.multiple,i.defaultValue,!0):kr(o,!!i.multiple,i.multiple?[]:"",!1))}o[bo]=i}catch(x){ve(e,e.return,x)}}break;case 6:if(ut(t,e),Nt(e),r&4){if(e.stateNode===null)throw Error(B(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(x){ve(e,e.return,x)}}break;case 3:if(ut(t,e),Nt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{$o(t.containerInfo)}catch(x){ve(e,e.return,x)}break;case 4:ut(t,e),Nt(e);break;case 13:ut(t,e),Nt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Ju=xe())),r&4&&Dd(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Te=(u=Te)||c,ut(t,e),Te=u):ut(t,e),Nt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(K=e,c=e.child;c!==null;){for(f=K=c;K!==null;){switch(d=K,p=d.child,d.tag){case 0:case 11:case 14:case 15:xo(4,d,d.return);break;case 1:vr(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(x){ve(r,n,x)}}break;case 5:vr(d,d.return);break;case 22:if(d.memoizedState!==null){Fd(f);continue}}p!==null?(p.return=d,K=p):Fd(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{o=f.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,a=f.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Lh("display",s))}catch(x){ve(e,e.return,x)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(x){ve(e,e.return,x)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:ut(t,e),Nt(e),r&4&&Dd(e);break;case 21:break;default:ut(t,e),Nt(e)}}function Nt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(lm(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(_o(o,""),r.flags&=-33);var i=Rd(e);Xa(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Rd(e);Ya(e,l,s);break;default:throw Error(B(161))}}catch(a){ve(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dx(e,t,n){K=e,cm(e)}function cm(e,t,n){for(var r=(e.mode&1)!==0;K!==null;){var o=K,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||ji;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||Te;l=ji;var u=Te;if(ji=s,(Te=a)&&!u)for(K=o;K!==null;)s=K,a=s.child,s.tag===22&&s.memoizedState!==null?Hd(o):a!==null?(a.return=s,K=a):Hd(o);for(;i!==null;)K=i,cm(i),i=i.sibling;K=o,ji=l,Te=u}Od(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,K=i):Od(e)}}function Od(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Te||Zs(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Te)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ct(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ed(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}Ed(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&$o(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}Te||t.flags&512&&Wa(t)}catch(d){ve(t,t.return,d)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function Fd(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Hd(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zs(4,t)}catch(a){ve(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){ve(t,o,a)}}var i=t.return;try{Wa(t)}catch(a){ve(t,i,a)}break;case 5:var s=t.return;try{Wa(t)}catch(a){ve(t,s,a)}}}catch(a){ve(t,t.return,a)}if(t===e){K=null;break}var l=t.sibling;if(l!==null){l.return=t.return,K=l;break}K=t.return}}var Ox=Math.ceil,Es=Gt.ReactCurrentDispatcher,qu=Gt.ReactCurrentOwner,ot=Gt.ReactCurrentBatchConfig,le=0,Ce=null,we=null,Me=0,Ye=0,xr=Nn(0),Ee=0,Fo=null,Kn=0,Js=0,Zu=0,wo=null,Oe=null,Ju=0,Lr=1/0,Dt=null,Ns=!1,Ka=null,yn=null,Mi=!1,un=null,_s=0,ko=0,Qa=null,Qi=-1,Gi=0;function Ae(){return le&6?xe():Qi!==-1?Qi:Qi=xe()}function vn(e){return e.mode&1?le&2&&Me!==0?Me&-Me:Sx.transition!==null?(Gi===0&&(Gi=Kh()),Gi):(e=ae,e!==0||(e=window.event,e=e===void 0?16:tp(e.type)),e):1}function xt(e,t,n,r){if(50<ko)throw ko=0,Qa=null,Error(B(185));Jo(e,n,r),(!(le&2)||e!==Ce)&&(e===Ce&&(!(le&2)&&(Js|=n),Ee===4&&sn(e,Me)),We(e,r),n===1&&le===0&&!(t.mode&1)&&(Lr=xe()+500,Qs&&_n()))}function We(e,t){var n=e.callbackNode;Sv(e,t);var r=as(e,e===Ce?Me:0);if(r===0)n!==null&&Gc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Gc(n),t===1)e.tag===0?kx(Vd.bind(null,e)):wp(Vd.bind(null,e)),yx(function(){!(le&6)&&_n()}),n=null;else{switch(Qh(r)){case 1:n=_u;break;case 4:n=Yh;break;case 16:n=ls;break;case 536870912:n=Xh;break;default:n=ls}n=vm(n,dm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function dm(e,t){if(Qi=-1,Gi=0,le&6)throw Error(B(327));var n=e.callbackNode;if(Cr()&&e.callbackNode!==n)return null;var r=as(e,e===Ce?Me:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Cs(e,r);else{t=r;var o=le;le|=2;var i=hm();(Ce!==e||Me!==t)&&(Dt=null,Lr=xe()+500,Dn(e,t));do try{Vx();break}catch(l){fm(e,l)}while(!0);Du(),Es.current=i,le=o,we!==null?t=0:(Ce=null,Me=0,t=Ee)}if(t!==0){if(t===2&&(o=Sa(e),o!==0&&(r=o,t=Ga(e,o))),t===1)throw n=Fo,Dn(e,0),sn(e,r),We(e,xe()),n;if(t===6)sn(e,r);else{if(o=e.current.alternate,!(r&30)&&!Fx(o)&&(t=Cs(e,r),t===2&&(i=Sa(e),i!==0&&(r=i,t=Ga(e,i))),t===1))throw n=Fo,Dn(e,0),sn(e,r),We(e,xe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:Pn(e,Oe,Dt);break;case 3:if(sn(e,r),(r&130023424)===r&&(t=Ju+500-xe(),10<t)){if(as(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ae(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Pa(Pn.bind(null,e,Oe,Dt),t);break}Pn(e,Oe,Dt);break;case 4:if(sn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-vt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ox(r/1960))-r,10<r){e.timeoutHandle=Pa(Pn.bind(null,e,Oe,Dt),r);break}Pn(e,Oe,Dt);break;case 5:Pn(e,Oe,Dt);break;default:throw Error(B(329))}}}return We(e,xe()),e.callbackNode===n?dm.bind(null,e):null}function Ga(e,t){var n=wo;return e.current.memoizedState.isDehydrated&&(Dn(e,t).flags|=256),e=Cs(e,t),e!==2&&(t=Oe,Oe=n,t!==null&&qa(t)),e}function qa(e){Oe===null?Oe=e:Oe.push.apply(Oe,e)}function Fx(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(!wt(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 sn(e,t){for(t&=~Zu,t&=~Js,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-vt(t),r=1<<n;e[n]=-1,t&=~r}}function Vd(e){if(le&6)throw Error(B(327));Cr();var t=as(e,0);if(!(t&1))return We(e,xe()),null;var n=Cs(e,t);if(e.tag!==0&&n===2){var r=Sa(e);r!==0&&(t=r,n=Ga(e,r))}if(n===1)throw n=Fo,Dn(e,0),sn(e,t),We(e,xe()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Pn(e,Oe,Dt),We(e,xe()),null}function ec(e,t){var n=le;le|=1;try{return e(t)}finally{le=n,le===0&&(Lr=xe()+500,Qs&&_n())}}function Qn(e){un!==null&&un.tag===0&&!(le&6)&&Cr();var t=le;le|=1;var n=ot.transition,r=ae;try{if(ot.transition=null,ae=1,e)return e()}finally{ae=r,ot.transition=n,le=t,!(le&6)&&_n()}}function tc(){Ye=xr.current,de(xr)}function Dn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,gx(n)),we!==null)for(n=we.return;n!==null;){var r=n;switch(Lu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&hs();break;case 3:zr(),de(Be),de(ze),Uu();break;case 5:Bu(r);break;case 4:zr();break;case 13:de(pe);break;case 19:de(pe);break;case 10:Ou(r.type._context);break;case 22:case 23:tc()}n=n.return}if(Ce=e,we=e=xn(e.current,null),Me=Ye=t,Ee=0,Fo=null,Zu=Js=Kn=0,Oe=wo=null,zn!==null){for(t=0;t<zn.length;t++)if(n=zn[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}zn=null}return e}function fm(e,t){do{var n=we;try{if(Du(),Yi.current=Ss,ks){for(var r=me.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ks=!1}if(Xn=0,_e=Se=me=null,vo=!1,Ro=0,qu.current=null,n===null||n.return===null){Ee=1,Fo=t,we=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=Me,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var d=c.alternate;d?(c.updateQueue=d.updateQueue,c.memoizedState=d.memoizedState,c.lanes=d.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=$d(s);if(p!==null){p.flags&=-257,Pd(p,s,l,i,t),p.mode&1&&Md(i,u,t),t=p,a=u;var y=t.updateQueue;if(y===null){var x=new Set;x.add(a),t.updateQueue=x}else y.add(a);break e}else{if(!(t&1)){Md(i,u,t),nc();break e}a=Error(B(426))}}else if(he&&l.mode&1){var k=$d(s);if(k!==null){!(k.flags&65536)&&(k.flags|=256),Pd(k,s,l,i,t),Au(br(a,l));break e}}i=a=br(a,l),Ee!==4&&(Ee=2),wo===null?wo=[i]:wo.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var m=Qp(i,a,t);Sd(i,m);break e;case 1:l=a;var v=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(yn===null||!yn.has(g)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=Gp(i,l,t);Sd(i,w);break e}}i=i.return}while(i!==null)}mm(n)}catch(C){t=C,we===n&&n!==null&&(we=n=n.return);continue}break}while(!0)}function hm(){var e=Es.current;return Es.current=Ss,e===null?Ss:e}function nc(){(Ee===0||Ee===3||Ee===2)&&(Ee=4),Ce===null||!(Kn&268435455)&&!(Js&268435455)||sn(Ce,Me)}function Cs(e,t){var n=le;le|=2;var r=hm();(Ce!==e||Me!==t)&&(Dt=null,Dn(e,t));do try{Hx();break}catch(o){fm(e,o)}while(!0);if(Du(),le=n,Es.current=r,we!==null)throw Error(B(261));return Ce=null,Me=0,Ee}function Hx(){for(;we!==null;)pm(we)}function Vx(){for(;we!==null&&!hv();)pm(we)}function pm(e){var t=ym(e.alternate,e,Ye);e.memoizedProps=e.pendingProps,t===null?mm(e):we=t,qu.current=null}function mm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Lx(n,t),n!==null){n.flags&=32767,we=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ee=6,we=null;return}}else if(n=bx(n,t,Ye),n!==null){we=n;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);Ee===0&&(Ee=5)}function Pn(e,t,n){var r=ae,o=ot.transition;try{ot.transition=null,ae=1,Bx(e,t,n,r)}finally{ot.transition=o,ae=r}return null}function Bx(e,t,n,r){do Cr();while(un!==null);if(le&6)throw Error(B(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(B(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Ev(e,i),e===Ce&&(we=Ce=null,Me=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Mi||(Mi=!0,vm(ls,function(){return Cr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ot.transition,ot.transition=null;var s=ae;ae=1;var l=le;le|=4,qu.current=null,Rx(e,n),um(n,e),ux(Ma),us=!!ja,Ma=ja=null,e.current=n,Dx(n),pv(),le=l,ae=s,ot.transition=i}else e.current=n;if(Mi&&(Mi=!1,un=e,_s=o),i=e.pendingLanes,i===0&&(yn=null),yv(n.stateNode),We(e,xe()),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(Ns)throw Ns=!1,e=Ka,Ka=null,e;return _s&1&&e.tag!==0&&Cr(),i=e.pendingLanes,i&1?e===Qa?ko++:(ko=0,Qa=e):ko=0,_n(),null}function Cr(){if(un!==null){var e=Qh(_s),t=ot.transition,n=ae;try{if(ot.transition=null,ae=16>e?16:e,un===null)var r=!1;else{if(e=un,un=null,_s=0,le&6)throw Error(B(331));var o=le;for(le|=4,K=e.current;K!==null;){var i=K,s=i.child;if(K.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(K=u;K!==null;){var c=K;switch(c.tag){case 0:case 11:case 15:xo(8,c,i)}var f=c.child;if(f!==null)f.return=c,K=f;else for(;K!==null;){c=K;var d=c.sibling,p=c.return;if(sm(c),c===u){K=null;break}if(d!==null){d.return=p,K=d;break}K=p}}}var y=i.alternate;if(y!==null){var x=y.child;if(x!==null){y.child=null;do{var k=x.sibling;x.sibling=null,x=k}while(x!==null)}}K=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,K=s;else e:for(;K!==null;){if(i=K,i.flags&2048)switch(i.tag){case 0:case 11:case 15:xo(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,K=m;break e}K=i.return}}var v=e.current;for(K=v;K!==null;){s=K;var g=s.child;if(s.subtreeFlags&2064&&g!==null)g.return=s,K=g;else e:for(s=v;K!==null;){if(l=K,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Zs(9,l)}}catch(C){ve(l,l.return,C)}if(l===s){K=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,K=w;break e}K=l.return}}if(le=o,_n(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(Us,e)}catch{}r=!0}return r}finally{ae=n,ot.transition=t}}return!1}function Bd(e,t,n){t=br(n,t),t=Qp(e,t,1),e=gn(e,t,1),t=Ae(),e!==null&&(Jo(e,1,t),We(e,t))}function ve(e,t,n){if(e.tag===3)Bd(e,e,n);else for(;t!==null;){if(t.tag===3){Bd(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(yn===null||!yn.has(r))){e=br(n,e),e=Gp(t,e,1),t=gn(t,e,1),e=Ae(),t!==null&&(Jo(t,1,e),We(t,e));break}}t=t.return}}function Ux(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ae(),e.pingedLanes|=e.suspendedLanes&n,Ce===e&&(Me&n)===n&&(Ee===4||Ee===3&&(Me&130023424)===Me&&500>xe()-Ju?Dn(e,0):Zu|=n),We(e,t)}function gm(e,t){t===0&&(e.mode&1?(t=vi,vi<<=1,!(vi&130023424)&&(vi=4194304)):t=1);var n=Ae();e=Xt(e,t),e!==null&&(Jo(e,t,n),We(e,n))}function Wx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),gm(e,n)}function Yx(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(B(314))}r!==null&&r.delete(t),gm(e,n)}var ym;ym=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Be.current)He=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return He=!1,zx(e,t,n);He=!!(e.flags&131072)}else He=!1,he&&t.flags&1048576&&kp(t,gs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ki(e,t),e=t.pendingProps;var o=Pr(t,ze.current);_r(t,n),o=Yu(null,t,r,e,o,n);var i=Xu();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,Ue(r)?(i=!0,ps(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Hu(t),o.updater=qs,t.stateNode=o,o._reactInternals=t,Ra(t,r,e,n),t=Fa(null,t,r,!0,i,n)):(t.tag=0,he&&i&&bu(t),Le(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ki(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Kx(r),e=ct(r,e),o){case 0:t=Oa(null,t,r,e,n);break e;case 1:t=zd(null,t,r,e,n);break e;case 11:t=Id(null,t,r,e,n);break e;case 14:t=Td(null,t,r,ct(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),Oa(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),zd(e,t,r,o,n);case 3:e:{if(em(t),e===null)throw Error(B(387));r=t.pendingProps,i=t.memoizedState,o=i.element,jp(e,t),xs(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=br(Error(B(423)),t),t=bd(e,t,r,n,o);break e}else if(r!==o){o=br(Error(B(424)),t),t=bd(e,t,r,n,o);break e}else for(Ke=mn(t.stateNode.containerInfo.firstChild),Qe=t,he=!0,pt=null,n=_p(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ir(),r===o){t=Kt(e,t,n);break e}Le(e,t,r,n)}t=t.child}return t;case 5:return Mp(t),e===null&&ba(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,$a(r,o)?s=null:i!==null&&$a(r,i)&&(t.flags|=32),Jp(e,t),Le(e,t,s,n),t.child;case 6:return e===null&&ba(t),null;case 13:return tm(e,t,n);case 4:return Vu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Tr(t,null,r,n):Le(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),Id(e,t,r,o,n);case 7:return Le(e,t,t.pendingProps,n),t.child;case 8:return Le(e,t,t.pendingProps.children,n),t.child;case 12:return Le(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,ue(ys,r._currentValue),r._currentValue=s,i!==null)if(wt(i.value,s)){if(i.children===o.children&&!Be.current){t=Kt(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 a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=Bt(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),La(i.return,n,t),l.lanes|=n;break}a=a.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(B(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),La(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}Le(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,_r(t,n),o=st(o),r=r(o),t.flags|=1,Le(e,t,r,n),t.child;case 14:return r=t.type,o=ct(r,t.pendingProps),o=ct(r.type,o),Td(e,t,r,o,n);case 15:return qp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),Ki(e,t),t.tag=1,Ue(r)?(e=!0,ps(t)):e=!1,_r(t,n),Kp(t,r,o),Ra(t,r,o,n),Fa(null,t,r,!0,e,n);case 19:return nm(e,t,n);case 22:return Zp(e,t,n)}throw Error(B(156,t.tag))};function vm(e,t){return Wh(e,t)}function Xx(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 rt(e,t,n,r){return new Xx(e,t,n,r)}function rc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kx(e){if(typeof e=="function")return rc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Su)return 11;if(e===Eu)return 14}return 2}function xn(e,t){var n=e.alternate;return n===null?(n=rt(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 qi(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")rc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ur:return On(n.children,o,i,t);case ku:s=8,o|=8;break;case la:return e=rt(12,n,t,o|2),e.elementType=la,e.lanes=i,e;case aa:return e=rt(13,n,t,o),e.elementType=aa,e.lanes=i,e;case ua:return e=rt(19,n,t,o),e.elementType=ua,e.lanes=i,e;case Mh:return el(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ch:s=10;break e;case jh:s=9;break e;case Su:s=11;break e;case Eu:s=14;break e;case en:s=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=rt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function On(e,t,n,r){return e=rt(7,e,r,t),e.lanes=n,e}function el(e,t,n,r){return e=rt(22,e,r,t),e.elementType=Mh,e.lanes=n,e.stateNode={isHidden:!1},e}function Xl(e,t,n){return e=rt(6,e,null,t),e.lanes=n,e}function Kl(e,t,n){return t=rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qx(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=Ml(0),this.expirationTimes=Ml(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ml(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function oc(e,t,n,r,o,i,s,l,a){return e=new Qx(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=rt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hu(i),e}function Gx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ar,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function xm(e){if(!e)return kn;e=e._reactInternals;e:{if(nr(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ue(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(Ue(n))return xp(e,n,t)}return t}function wm(e,t,n,r,o,i,s,l,a){return e=oc(n,r,!0,e,o,i,s,l,a),e.context=xm(null),n=e.current,r=Ae(),o=vn(n),i=Bt(r,o),i.callback=t??null,gn(n,i,o),e.current.lanes=o,Jo(e,o,r),We(e,r),e}function tl(e,t,n,r){var o=t.current,i=Ae(),s=vn(o);return n=xm(n),t.context===null?t.context=n:t.pendingContext=n,t=Bt(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=gn(o,t,s),e!==null&&(xt(e,o,s,i),Wi(e,o,s)),s}function js(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 Ud(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ic(e,t){Ud(e,t),(e=e.alternate)&&Ud(e,t)}function qx(){return null}var km=typeof reportError=="function"?reportError:function(e){console.error(e)};function sc(e){this._internalRoot=e}nl.prototype.render=sc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));tl(e,t,null,null)};nl.prototype.unmount=sc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qn(function(){tl(null,e,null,null)}),t[Yt]=null}};function nl(e){this._internalRoot=e}nl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Zh();e={blockedOn:null,target:e,priority:t};for(var n=0;n<on.length&&t!==0&&t<on[n].priority;n++);on.splice(n,0,e),n===0&&ep(e)}};function lc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function rl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Wd(){}function Zx(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=js(s);i.call(u)}}var s=wm(t,r,e,0,null,!1,!1,"",Wd);return e._reactRootContainer=s,e[Yt]=s.current,To(e.nodeType===8?e.parentNode:e),Qn(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=js(a);l.call(u)}}var a=oc(e,0,!1,null,null,!1,!1,"",Wd);return e._reactRootContainer=a,e[Yt]=a.current,To(e.nodeType===8?e.parentNode:e),Qn(function(){tl(t,a,n,r)}),a}function ol(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=js(s);l.call(a)}}tl(t,s,e,o)}else s=Zx(n,t,e,o,r);return js(s)}Gh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=lo(t.pendingLanes);n!==0&&(Cu(t,n|1),We(t,xe()),!(le&6)&&(Lr=xe()+500,_n()))}break;case 13:Qn(function(){var r=Xt(e,1);if(r!==null){var o=Ae();xt(r,e,1,o)}}),ic(e,1)}};ju=function(e){if(e.tag===13){var t=Xt(e,134217728);if(t!==null){var n=Ae();xt(t,e,134217728,n)}ic(e,134217728)}};qh=function(e){if(e.tag===13){var t=vn(e),n=Xt(e,t);if(n!==null){var r=Ae();xt(n,e,t,r)}ic(e,t)}};Zh=function(){return ae};Jh=function(e,t){var n=ae;try{return ae=e,t()}finally{ae=n}};xa=function(e,t,n){switch(t){case"input":if(fa(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=Ks(r);if(!o)throw Error(B(90));Ph(r),fa(r,o)}}}break;case"textarea":Th(e,n);break;case"select":t=n.value,t!=null&&kr(e,!!n.multiple,t,!1)}};Oh=ec;Fh=Qn;var Jx={usingClientEntryPoint:!1,Events:[ti,hr,Ks,Rh,Dh,ec]},no={findFiberByHostInstance:Tn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ew={bundleType:no.bundleType,version:no.version,rendererPackageName:no.rendererPackageName,rendererConfig:no.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Gt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Bh(e),e===null?null:e.stateNode},findFiberByHostInstance:no.findFiberByHostInstance||qx,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 $i=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$i.isDisabled&&$i.supportsFiber)try{Us=$i.inject(ew),$t=$i}catch{}}Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jx;Ze.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!lc(t))throw Error(B(200));return Gx(e,t,null,n)};Ze.createRoot=function(e,t){if(!lc(e))throw Error(B(299));var n=!1,r="",o=km;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=oc(e,1,!1,null,null,n,!1,r,o),e[Yt]=t.current,To(e.nodeType===8?e.parentNode:e),new sc(t)};Ze.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(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=Bh(t),e=e===null?null:e.stateNode,e};Ze.flushSync=function(e){return Qn(e)};Ze.hydrate=function(e,t,n){if(!rl(t))throw Error(B(200));return ol(null,e,t,!0,n)};Ze.hydrateRoot=function(e,t,n){if(!lc(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=km;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=wm(t,null,e,1,n??null,o,!1,i,s),e[Yt]=t.current,To(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 nl(t)};Ze.render=function(e,t,n){if(!rl(t))throw Error(B(200));return ol(null,e,t,!1,n)};Ze.unmountComponentAtNode=function(e){if(!rl(e))throw Error(B(40));return e._reactRootContainer?(Qn(function(){ol(null,null,e,!1,function(){e._reactRootContainer=null,e[Yt]=null})}),!0):!1};Ze.unstable_batchedUpdates=ec;Ze.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!rl(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return ol(e,t,n,!1,r)};Ze.version="18.3.1-next-f1338f8080-20240426";function Sm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sm)}catch(e){console.error(e)}}Sm(),Sh.exports=Ze;var Em=Sh.exports,Nm,Yd=Em;Nm=Yd.createRoot,Yd.hydrateRoot;function ke(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=ke(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var tw={value:()=>{}};function il(){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 Zi(n)}function Zi(e){this._=e}function nw(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}})}Zi.prototype=il.prototype={constructor:Zi,on:function(e,t){var n=this._,r=nw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=rw(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]=Xd(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Xd(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 Zi(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 rw(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Xd(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=tw,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Za="http://www.w3.org/1999/xhtml";const Kd={svg:"http://www.w3.org/2000/svg",xhtml:Za,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function sl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Kd.hasOwnProperty(t)?{space:Kd[t],local:e}:e}function ow(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Za&&t.documentElement.namespaceURI===Za?t.createElement(e):t.createElementNS(n,e)}}function iw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function _m(e){var t=sl(e);return(t.local?iw:ow)(t)}function sw(){}function ac(e){return e==null?sw:function(){return this.querySelector(e)}}function lw(e){typeof e!="function"&&(e=ac(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),a,u,c=0;c<s;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new qe(r,this._parents)}function aw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function uw(){return[]}function Cm(e){return e==null?uw:function(){return this.querySelectorAll(e)}}function cw(e){return function(){return aw(e.apply(this,arguments))}}function dw(e){typeof e=="function"?e=cw(e):e=Cm(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new qe(r,o)}function jm(e){return function(){return this.matches(e)}}function Mm(e){return function(t){return t.matches(e)}}var fw=Array.prototype.find;function hw(e){return function(){return fw.call(this.children,e)}}function pw(){return this.firstElementChild}function mw(e){return this.select(e==null?pw:hw(typeof e=="function"?e:Mm(e)))}var gw=Array.prototype.filter;function yw(){return Array.from(this.children)}function vw(e){return function(){return gw.call(this.children,e)}}function xw(e){return this.selectAll(e==null?yw:vw(typeof e=="function"?e:Mm(e)))}function ww(e){typeof e!="function"&&(e=jm(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]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new qe(r,this._parents)}function $m(e){return new Array(e.length)}function kw(){return new qe(this._enter||this._groups.map($m),this._parents)}function Ms(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ms.prototype={constructor:Ms,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 Sw(e){return function(){return e}}function Ew(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new Ms(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function Nw(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,f=i.length,d=new Array(c),p;for(l=0;l<c;++l)(a=t[l])&&(d[l]=p=s.call(a,a.__data__,l,t)+"",u.has(p)?o[l]=a:u.set(p,a));for(l=0;l<f;++l)p=s.call(e,i[l],l,i)+"",(a=u.get(p))?(r[l]=a,a.__data__=i[l],u.delete(p)):n[l]=new Ms(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(d[l])===a&&(o[l]=a)}function _w(e){return e.__data__}function Cw(e,t){if(!arguments.length)return Array.from(this,_w);var n=t?Nw:Ew,r=this._parents,o=this._groups;typeof e!="function"&&(e=Sw(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],f=o[u],d=f.length,p=jw(e.call(c,c&&c.__data__,u,r)),y=p.length,x=l[u]=new Array(y),k=s[u]=new Array(y),m=a[u]=new Array(d);n(c,f,x,k,m,p,t);for(var v=0,g=0,w,C;v<y;++v)if(w=x[v]){for(v>=g&&(g=v+1);!(C=k[g])&&++g<y;);w._next=C||null}}return s=new qe(s,r),s._enter=l,s._exit=a,s}function jw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Mw(){return new qe(this._exit||this._groups.map($m),this._parents)}function $w(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 Pw(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),a=0;a<s;++a)for(var u=n[a],c=r[a],f=u.length,d=l[a]=new Array(f),p,y=0;y<f;++y)(p=u[y]||c[y])&&(d[y]=p);for(;a<o;++a)l[a]=n[a];return new qe(l,this._parents)}function Iw(){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 Tw(e){e||(e=zw);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!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,a=o[i]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new qe(o,this._parents).order()}function zw(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function bw(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Lw(){return Array.from(this)}function Aw(){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 Rw(){let e=0;for(const t of this)++e;return e}function Dw(){return!this.node()}function Ow(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 Fw(e){return function(){this.removeAttribute(e)}}function Hw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vw(e,t){return function(){this.setAttribute(e,t)}}function Bw(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Uw(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Ww(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 Yw(e,t){var n=sl(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?Hw:Fw:typeof t=="function"?n.local?Ww:Uw:n.local?Bw:Vw)(n,t))}function Pm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Xw(e){return function(){this.style.removeProperty(e)}}function Kw(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Qw(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Gw(e,t,n){return arguments.length>1?this.each((t==null?Xw:typeof t=="function"?Qw:Kw)(e,t,n??"")):Ar(this.node(),e)}function Ar(e,t){return e.style.getPropertyValue(t)||Pm(e).getComputedStyle(e,null).getPropertyValue(t)}function qw(e){return function(){delete this[e]}}function Zw(e,t){return function(){this[e]=t}}function Jw(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function e1(e,t){return arguments.length>1?this.each((t==null?qw:typeof t=="function"?Jw:Zw)(e,t)):this.node()[e]}function Im(e){return e.trim().split(/^|\s+/)}function uc(e){return e.classList||new Tm(e)}function Tm(e){this._node=e,this._names=Im(e.getAttribute("class")||"")}Tm.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 zm(e,t){for(var n=uc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function bm(e,t){for(var n=uc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function t1(e){return function(){zm(this,e)}}function n1(e){return function(){bm(this,e)}}function r1(e,t){return function(){(t.apply(this,arguments)?zm:bm)(this,e)}}function o1(e,t){var n=Im(e+"");if(arguments.length<2){for(var r=uc(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?r1:t?t1:n1)(n,t))}function i1(){this.textContent=""}function s1(e){return function(){this.textContent=e}}function l1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function a1(e){return arguments.length?this.each(e==null?i1:(typeof e=="function"?l1:s1)(e)):this.node().textContent}function u1(){this.innerHTML=""}function c1(e){return function(){this.innerHTML=e}}function d1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function f1(e){return arguments.length?this.each(e==null?u1:(typeof e=="function"?d1:c1)(e)):this.node().innerHTML}function h1(){this.nextSibling&&this.parentNode.appendChild(this)}function p1(){return this.each(h1)}function m1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function g1(){return this.each(m1)}function y1(e){var t=typeof e=="function"?e:_m(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function v1(){return null}function x1(e,t){var n=typeof e=="function"?e:_m(e),r=t==null?v1:typeof t=="function"?t:ac(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function w1(){var e=this.parentNode;e&&e.removeChild(this)}function k1(){return this.each(w1)}function S1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function E1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function N1(e){return this.select(e?E1:S1)}function _1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function C1(e){return function(t){e.call(this,t,this.__data__)}}function j1(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 M1(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 $1(e,t,n){return function(){var r=this.__on,o,i=C1(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 P1(e,t,n){var r=j1(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(o=0,c=l[a];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?$1:M1,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function Lm(e,t,n){var r=Pm(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 I1(e,t){return function(){return Lm(this,e,t)}}function T1(e,t){return function(){return Lm(this,e,t.apply(this,arguments))}}function z1(e,t){return this.each((typeof t=="function"?T1:I1)(e,t))}function*b1(){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 Am=[null];function qe(e,t){this._groups=e,this._parents=t}function ri(){return new qe([[document.documentElement]],Am)}function L1(){return this}qe.prototype=ri.prototype={constructor:qe,select:lw,selectAll:dw,selectChild:mw,selectChildren:xw,filter:ww,data:Cw,enter:kw,exit:Mw,join:$w,merge:Pw,selection:L1,order:Iw,sort:Tw,call:bw,nodes:Lw,node:Aw,size:Rw,empty:Dw,each:Ow,attr:Yw,style:Gw,property:e1,classed:o1,text:a1,html:f1,raise:p1,lower:g1,append:y1,insert:x1,remove:k1,clone:N1,datum:_1,on:P1,dispatch:z1,[Symbol.iterator]:b1};function Xe(e){return typeof e=="string"?new qe([[document.querySelector(e)]],[document.documentElement]):new qe([[e]],Am)}function A1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ft(e,t){if(e=A1(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 R1={passive:!1},Ho={capture:!0,passive:!1};function Ql(e){e.stopImmediatePropagation()}function jr(e){e.preventDefault(),e.stopImmediatePropagation()}function Rm(e){var t=e.document.documentElement,n=Xe(e).on("dragstart.drag",jr,Ho);"onselectstart"in t?n.on("selectstart.drag",jr,Ho):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Dm(e,t){var n=e.document.documentElement,r=Xe(e).on("dragstart.drag",null);t&&(r.on("click.drag",jr,Ho),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 Pi=e=>()=>e;function Ja(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:c}){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:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Ja.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function D1(e){return!e.ctrlKey&&!e.button}function O1(){return this.parentNode}function F1(e,t){return t??{x:e.x,y:e.y}}function H1(){return navigator.maxTouchPoints||"ontouchstart"in this}function Om(){var e=D1,t=O1,n=F1,r=H1,o={},i=il("start","drag","end"),s=0,l,a,u,c,f=0;function d(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",k).on("touchmove.drag",m,R1).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,C){if(!(c||!e.call(this,w,C))){var E=g(this,t.call(this,w,C),w,C,"mouse");E&&(Xe(w.view).on("mousemove.drag",y,Ho).on("mouseup.drag",x,Ho),Rm(w.view),Ql(w),u=!1,l=w.clientX,a=w.clientY,E("start",w))}}function y(w){if(jr(w),!u){var C=w.clientX-l,E=w.clientY-a;u=C*C+E*E>f}o.mouse("drag",w)}function x(w){Xe(w.view).on("mousemove.drag mouseup.drag",null),Dm(w.view,u),jr(w),o.mouse("end",w)}function k(w,C){if(e.call(this,w,C)){var E=w.changedTouches,N=t.call(this,w,C),j=E.length,P,A;for(P=0;P<j;++P)(A=g(this,N,w,C,E[P].identifier,E[P]))&&(Ql(w),A("start",w,E[P]))}}function m(w){var C=w.changedTouches,E=C.length,N,j;for(N=0;N<E;++N)(j=o[C[N].identifier])&&(jr(w),j("drag",w,C[N]))}function v(w){var C=w.changedTouches,E=C.length,N,j;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),N=0;N<E;++N)(j=o[C[N].identifier])&&(Ql(w),j("end",w,C[N]))}function g(w,C,E,N,j,P){var A=i.copy(),R=ft(P||E,C),H,F,S;if((S=n.call(w,new Ja("beforestart",{sourceEvent:E,target:d,identifier:j,active:s,x:R[0],y:R[1],dx:0,dy:0,dispatch:A}),N))!=null)return H=S.x-R[0]||0,F=S.y-R[1]||0,function T(_,z,$){var M=R,L;switch(_){case"start":o[j]=T,L=s++;break;case"end":delete o[j],--s;case"drag":R=ft($||z,C),L=s;break}A.call(_,w,new Ja(_,{sourceEvent:z,subject:S,target:d,identifier:j,active:L,x:R[0]+H,y:R[1]+F,dx:R[0]-M[0],dy:R[1]-M[1],dispatch:A}),N)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Pi(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:Pi(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Pi(w),d):n},d.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Pi(!!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?(f=(w=+w)*w,d):Math.sqrt(f)},d}function cc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Fm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function oi(){}var Vo=.7,$s=1/Vo,Mr="\\s*([+-]?\\d+)\\s*",Bo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",It="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",V1=/^#([0-9a-f]{3,8})$/,B1=new RegExp(`^rgb\\(${Mr},${Mr},${Mr}\\)$`),U1=new RegExp(`^rgb\\(${It},${It},${It}\\)$`),W1=new RegExp(`^rgba\\(${Mr},${Mr},${Mr},${Bo}\\)$`),Y1=new RegExp(`^rgba\\(${It},${It},${It},${Bo}\\)$`),X1=new RegExp(`^hsl\\(${Bo},${It},${It}\\)$`),K1=new RegExp(`^hsla\\(${Bo},${It},${It},${Bo}\\)$`),Qd={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};cc(oi,Gn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Gd,formatHex:Gd,formatHex8:Q1,formatHsl:G1,formatRgb:qd,toString:qd});function Gd(){return this.rgb().formatHex()}function Q1(){return this.rgb().formatHex8()}function G1(){return Hm(this).formatHsl()}function qd(){return this.rgb().formatRgb()}function Gn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=V1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Zd(t):n===3?new Ve(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ii(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ii(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=B1.exec(e))?new Ve(t[1],t[2],t[3],1):(t=U1.exec(e))?new Ve(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=W1.exec(e))?Ii(t[1],t[2],t[3],t[4]):(t=Y1.exec(e))?Ii(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=X1.exec(e))?tf(t[1],t[2]/100,t[3]/100,1):(t=K1.exec(e))?tf(t[1],t[2]/100,t[3]/100,t[4]):Qd.hasOwnProperty(e)?Zd(Qd[e]):e==="transparent"?new Ve(NaN,NaN,NaN,0):null}function Zd(e){return new Ve(e>>16&255,e>>8&255,e&255,1)}function Ii(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ve(e,t,n,r)}function q1(e){return e instanceof oi||(e=Gn(e)),e?(e=e.rgb(),new Ve(e.r,e.g,e.b,e.opacity)):new Ve}function eu(e,t,n,r){return arguments.length===1?q1(e):new Ve(e,t,n,r??1)}function Ve(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}cc(Ve,eu,Fm(oi,{brighter(e){return e=e==null?$s:Math.pow($s,e),new Ve(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vo:Math.pow(Vo,e),new Ve(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ve(Fn(this.r),Fn(this.g),Fn(this.b),Ps(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:Jd,formatHex:Jd,formatHex8:Z1,formatRgb:ef,toString:ef}));function Jd(){return`#${Ln(this.r)}${Ln(this.g)}${Ln(this.b)}`}function Z1(){return`#${Ln(this.r)}${Ln(this.g)}${Ln(this.b)}${Ln((isNaN(this.opacity)?1:this.opacity)*255)}`}function ef(){const e=Ps(this.opacity);return`${e===1?"rgb(":"rgba("}${Fn(this.r)}, ${Fn(this.g)}, ${Fn(this.b)}${e===1?")":`, ${e})`}`}function Ps(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ln(e){return e=Fn(e),(e<16?"0":"")+e.toString(16)}function tf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new mt(e,t,n,r)}function Hm(e){if(e instanceof mt)return new mt(e.h,e.s,e.l,e.opacity);if(e instanceof oi||(e=Gn(e)),!e)return new mt;if(e instanceof mt)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,a=(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/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new mt(s,l,a,e.opacity)}function J1(e,t,n,r){return arguments.length===1?Hm(e):new mt(e,t,n,r??1)}function mt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}cc(mt,J1,Fm(oi,{brighter(e){return e=e==null?$s:Math.pow($s,e),new mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vo:Math.pow(Vo,e),new mt(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 Ve(Gl(e>=240?e-240:e+120,o,r),Gl(e,o,r),Gl(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new mt(nf(this.h),Ti(this.s),Ti(this.l),Ps(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=Ps(this.opacity);return`${e===1?"hsl(":"hsla("}${nf(this.h)}, ${Ti(this.s)*100}%, ${Ti(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nf(e){return e=(e||0)%360,e<0?e+360:e}function Ti(e){return Math.max(0,Math.min(1,e||0))}function Gl(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 dc=e=>()=>e;function ek(e,t){return function(n){return e+n*t}}function tk(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 nk(e){return(e=+e)==1?Vm:function(t,n){return n-t?tk(t,n,e):dc(isNaN(t)?n:t)}}function Vm(e,t){var n=t-e;return n?ek(e,n):dc(isNaN(e)?t:e)}const Is=function e(t){var n=nk(t);function r(o,i){var s=n((o=eu(o)).r,(i=eu(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=Vm(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=l(c),o.b=a(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function rk(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 ok(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ik(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]=So(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 sk(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ct(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function lk(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]=So(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var tu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ql=new RegExp(tu.source,"g");function ak(e){return function(){return e}}function uk(e){return function(t){return e(t)+""}}function Bm(e,t){var n=tu.lastIndex=ql.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=tu.exec(e))&&(o=ql.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,a.push({i:s,x:Ct(r,o)})),n=ql.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?uk(a[0].x):ak(t):(t=a.length,function(u){for(var c=0,f;c<t;++c)l[(f=a[c]).i]=f.x(u);return l.join("")})}function So(e,t){var n=typeof t,r;return t==null||n==="boolean"?dc(t):(n==="number"?Ct:n==="string"?(r=Gn(t))?(t=r,Is):Bm:t instanceof Gn?Is:t instanceof Date?sk:ok(t)?rk:Array.isArray(t)?ik:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?lk:Ct)(e,t)}var rf=180/Math.PI,nu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Um(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*rf,skewX:Math.atan(a)*rf,scaleX:s,scaleY:l}}var zi;function ck(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?nu:Um(t.a,t.b,t.c,t.d,t.e,t.f)}function dk(e){return e==null||(zi||(zi=document.createElementNS("http://www.w3.org/2000/svg","g")),zi.setAttribute("transform",e),!(e=zi.transform.baseVal.consolidate()))?nu:(e=e.matrix,Um(e.a,e.b,e.c,e.d,e.e,e.f))}function Wm(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,f,d,p,y){if(u!==f||c!==d){var x=p.push("translate(",null,t,null,n);y.push({i:x-4,x:Ct(u,f)},{i:x-2,x:Ct(c,d)})}else(f||d)&&p.push("translate("+f+t+d+n)}function s(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Ct(u,c)})):c&&f.push(o(f)+"rotate("+c+r)}function l(u,c,f,d){u!==c?d.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Ct(u,c)}):c&&f.push(o(f)+"skewX("+c+r)}function a(u,c,f,d,p,y){if(u!==f||c!==d){var x=p.push(o(p)+"scale(",null,",",null,")");y.push({i:x-4,x:Ct(u,f)},{i:x-2,x:Ct(c,d)})}else(f!==1||d!==1)&&p.push(o(p)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,f,d),s(u.rotate,c.rotate,f,d),l(u.skewX,c.skewX,f,d),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(p){for(var y=-1,x=d.length,k;++y<x;)f[(k=d[y]).i]=k.x(p);return f.join("")}}}var fk=Wm(ck,"px, ","px)","deg)"),hk=Wm(dk,", ",")",")"),pk=1e-12;function of(e){return((e=Math.exp(e))+1/e)/2}function mk(e){return((e=Math.exp(e))-1/e)/2}function gk(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ji=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],f=s[1],d=s[2],p=c-l,y=f-a,x=p*p+y*y,k,m;if(x<pk)m=Math.log(d/u)/t,k=function(N){return[l+N*p,a+N*y,u*Math.exp(t*N*m)]};else{var v=Math.sqrt(x),g=(d*d-u*u+r*x)/(2*u*n*v),w=(d*d-u*u-r*x)/(2*d*n*v),C=Math.log(Math.sqrt(g*g+1)-g),E=Math.log(Math.sqrt(w*w+1)-w);m=(E-C)/t,k=function(N){var j=N*m,P=of(C),A=u/(n*v)*(P*gk(t*j+C)-mk(C));return[l+A*p,a+A*y,u*P/of(t*j+C)]}}return k.duration=m*1e3*t/Math.SQRT2,k}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var Rr=0,uo=0,ro=0,Ym=1e3,Ts,co,zs=0,qn=0,ll=0,Uo=typeof performance=="object"&&performance.now?performance:Date,Xm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function fc(){return qn||(Xm(yk),qn=Uo.now()+ll)}function yk(){qn=0}function bs(){this._call=this._time=this._next=null}bs.prototype=Km.prototype={constructor:bs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?fc():+n)+(t==null?0:+t),!this._next&&co!==this&&(co?co._next=this:Ts=this,co=this),this._call=e,this._time=n,ru()},stop:function(){this._call&&(this._call=null,this._time=1/0,ru())}};function Km(e,t,n){var r=new bs;return r.restart(e,t,n),r}function vk(){fc(),++Rr;for(var e=Ts,t;e;)(t=qn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Rr}function sf(){qn=(zs=Uo.now())+ll,Rr=uo=0;try{vk()}finally{Rr=0,wk(),qn=0}}function xk(){var e=Uo.now(),t=e-zs;t>Ym&&(ll-=t,zs=e)}function wk(){for(var e,t=Ts,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:Ts=n);co=e,ru(r)}function ru(e){if(!Rr){uo&&(uo=clearTimeout(uo));var t=e-qn;t>24?(e<1/0&&(uo=setTimeout(sf,e-Uo.now()-ll)),ro&&(ro=clearInterval(ro))):(ro||(zs=Uo.now(),ro=setInterval(xk,Ym)),Rr=1,Xm(sf))}}function lf(e,t,n){var r=new bs;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var kk=il("start","end","cancel","interrupt"),Sk=[],Qm=0,af=1,ou=2,es=3,uf=4,iu=5,ts=6;function al(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Ek(e,n,{name:t,index:r,group:o,on:kk,tween:Sk,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Qm})}function hc(e,t){var n=St(e,t);if(n.state>Qm)throw new Error("too late; already scheduled");return n}function Tt(e,t){var n=St(e,t);if(n.state>es)throw new Error("too late; already running");return n}function St(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Ek(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Km(i,0,n.time);function i(u){n.state=af,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,f,d,p;if(n.state!==af)return a();for(c in r)if(p=r[c],p.name===n.name){if(p.state===es)return lf(s);p.state===uf?(p.state=ts,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=ts,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(lf(function(){n.state===es&&(n.state=uf,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=ou,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ou){for(n.state=es,o=new Array(d=n.tween.length),c=0,f=-1;c<d;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=p);o.length=f+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=iu,1),f=-1,d=o.length;++f<d;)o[f].call(e,c);n.state===iu&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=ts,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function ns(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>ou&&r.state<iu,r.state=ts,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Nk(e){return this.each(function(){ns(this,e)})}function _k(e,t){var n,r;return function(){var o=Tt(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 Ck(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Tt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function jk(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=St(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?_k:Ck)(n,e,t))}function pc(e,t,n){var r=e._id;return e.each(function(){var o=Tt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return St(o,r).value[t]}}function Gm(e,t){var n;return(typeof t=="number"?Ct:t instanceof Gn?Is:(n=Gn(t))?(t=n,Is):Bm)(e,t)}function Mk(e){return function(){this.removeAttribute(e)}}function $k(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Pk(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 Ik(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 Tk(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function zk(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function bk(e,t){var n=sl(e),r=n==="transform"?hk:Gm;return this.attrTween(e,typeof t=="function"?(n.local?zk:Tk)(n,r,pc(this,"attr."+e,t)):t==null?(n.local?$k:Mk)(n):(n.local?Ik:Pk)(n,r,t))}function Lk(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ak(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Rk(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ak(e,i)),n}return o._value=t,o}function Dk(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Lk(e,i)),n}return o._value=t,o}function Ok(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=sl(e);return this.tween(n,(r.local?Rk:Dk)(r,t))}function Fk(e,t){return function(){hc(this,e).delay=+t.apply(this,arguments)}}function Hk(e,t){return t=+t,function(){hc(this,e).delay=t}}function Vk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Fk:Hk)(t,e)):St(this.node(),t).delay}function Bk(e,t){return function(){Tt(this,e).duration=+t.apply(this,arguments)}}function Uk(e,t){return t=+t,function(){Tt(this,e).duration=t}}function Wk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Bk:Uk)(t,e)):St(this.node(),t).duration}function Yk(e,t){if(typeof t!="function")throw new Error;return function(){Tt(this,e).ease=t}}function Xk(e){var t=this._id;return arguments.length?this.each(Yk(t,e)):St(this.node(),t).ease}function Kk(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Tt(this,e).ease=n}}function Qk(e){if(typeof e!="function")throw new Error;return this.each(Kk(this._id,e))}function Gk(e){typeof e!="function"&&(e=jm(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]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new Qt(r,this._parents,this._name,this._id)}function qk(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 a=t[l],u=n[l],c=a.length,f=s[l]=new Array(c),d,p=0;p<c;++p)(d=a[p]||u[p])&&(f[p]=d);for(;l<r;++l)s[l]=t[l];return new Qt(s,this._parents,this._name,this._id)}function Zk(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 Jk(e,t,n){var r,o,i=Zk(t)?hc:Tt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function eS(e,t){var n=this._id;return arguments.length<2?St(this.node(),n).on.on(e):this.each(Jk(n,e,t))}function tS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function nS(){return this.on("end.remove",tS(this._id))}function rS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ac(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),c,f,d=0;d<a;++d)(c=l[d])&&(f=e.call(c,c.__data__,d,l))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,al(u[d],t,n,d,u,St(c,n)));return new Qt(i,this._parents,t,n)}function oS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Cm(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,c,f=0;f<u;++f)if(c=a[f]){for(var d=e.call(c,c.__data__,f,a),p,y=St(c,n),x=0,k=d.length;x<k;++x)(p=d[x])&&al(p,t,n,x,d,y);i.push(d),s.push(c)}return new Qt(i,s,t,n)}var iS=ri.prototype.constructor;function sS(){return new iS(this._groups,this._parents)}function lS(e,t){var n,r,o;return function(){var i=Ar(this,e),s=(this.style.removeProperty(e),Ar(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function qm(e){return function(){this.style.removeProperty(e)}}function aS(e,t,n){var r,o=n+"",i;return function(){var s=Ar(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function uS(e,t,n){var r,o,i;return function(){var s=Ar(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Ar(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function cS(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=Tt(this,e),u=a.on,c=a.value[i]==null?l||(l=qm(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function dS(e,t,n){var r=(e+="")=="transform"?fk:Gm;return t==null?this.styleTween(e,lS(e,r)).on("end.style."+e,qm(e)):typeof t=="function"?this.styleTween(e,uS(e,r,pc(this,"style."+e,t))).each(cS(this._id,e)):this.styleTween(e,aS(e,r,t),n).on("end.style."+e,null)}function fS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function hS(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&fS(e,s,n)),r}return i._value=t,i}function pS(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,hS(e,t,n??""))}function mS(e){return function(){this.textContent=e}}function gS(e){return function(){var t=e(this);this.textContent=t??""}}function yS(e){return this.tween("text",typeof e=="function"?gS(pc(this,"text",e)):mS(e==null?"":e+""))}function vS(e){return function(t){this.textContent=e.call(this,t)}}function xS(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&vS(o)),t}return r._value=e,r}function wS(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,xS(e))}function kS(){for(var e=this._name,t=this._id,n=Zm(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=St(a,t);al(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Qt(r,this._parents,e,n)}function SS(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=Tt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var ES=0;function Qt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Zm(){return++ES}var At=ri.prototype;Qt.prototype={constructor:Qt,select:rS,selectAll:oS,selectChild:At.selectChild,selectChildren:At.selectChildren,filter:Gk,merge:qk,selection:sS,transition:kS,call:At.call,nodes:At.nodes,node:At.node,size:At.size,empty:At.empty,each:At.each,on:eS,attr:bk,attrTween:Ok,style:dS,styleTween:pS,text:yS,textTween:wS,remove:nS,tween:jk,delay:Vk,duration:Wk,ease:Xk,easeVarying:Qk,end:SS,[Symbol.iterator]:At[Symbol.iterator]};function NS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var _S={time:null,delay:0,duration:250,ease:NS};function CS(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 jS(e){var t,n;e instanceof Qt?(t=e._id,e=e._name):(t=Zm(),(n=_S).time=fc(),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,a,u=0;u<l;++u)(a=s[u])&&al(a,e,t,u,s,n||CS(a,t));return new Qt(r,this._parents,e,t)}ri.prototype.interrupt=Nk;ri.prototype.transition=jS;const bi=e=>()=>e;function MS(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 Vt(e,t,n){this.k=e,this.x=t,this.y=n}Vt.prototype={constructor:Vt,scale:function(e){return e===1?this:new Vt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Vt(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 ul=new Vt(1,0,0);Jm.prototype=Vt.prototype;function Jm(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ul;return e.__zoom}function Zl(e){e.stopImmediatePropagation()}function oo(e){e.preventDefault(),e.stopImmediatePropagation()}function $S(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function PS(){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 cf(){return this.__zoom||ul}function IS(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function TS(){return navigator.maxTouchPoints||"ontouchstart"in this}function zS(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 eg(){var e=$S,t=PS,n=zS,r=IS,o=TS,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=Ji,u=il("start","zoom","end"),c,f,d,p=500,y=150,x=0,k=10;function m(S){S.property("__zoom",cf).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",A).filter(o).on("touchstart.zoom",R).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(S,T,_,z){var $=S.selection?S.selection():S;$.property("__zoom",cf),S!==$?C(S,T,_,z):$.interrupt().each(function(){E(this,arguments).event(z).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},m.scaleBy=function(S,T,_,z){m.scaleTo(S,function(){var $=this.__zoom.k,M=typeof T=="function"?T.apply(this,arguments):T;return $*M},_,z)},m.scaleTo=function(S,T,_,z){m.transform(S,function(){var $=t.apply(this,arguments),M=this.__zoom,L=_==null?w($):typeof _=="function"?_.apply(this,arguments):_,I=M.invert(L),D=typeof T=="function"?T.apply(this,arguments):T;return n(g(v(M,D),L,I),$,s)},_,z)},m.translateBy=function(S,T,_,z){m.transform(S,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof _=="function"?_.apply(this,arguments):_),t.apply(this,arguments),s)},null,z)},m.translateTo=function(S,T,_,z,$){m.transform(S,function(){var M=t.apply(this,arguments),L=this.__zoom,I=z==null?w(M):typeof z=="function"?z.apply(this,arguments):z;return n(ul.translate(I[0],I[1]).scale(L.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof _=="function"?-_.apply(this,arguments):-_),M,s)},z,$)};function v(S,T){return T=Math.max(i[0],Math.min(i[1],T)),T===S.k?S:new Vt(T,S.x,S.y)}function g(S,T,_){var z=T[0]-_[0]*S.k,$=T[1]-_[1]*S.k;return z===S.x&&$===S.y?S:new Vt(S.k,z,$)}function w(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function C(S,T,_,z){S.on("start.zoom",function(){E(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(z).end()}).tween("zoom",function(){var $=this,M=arguments,L=E($,M).event(z),I=t.apply($,M),D=_==null?w(I):typeof _=="function"?_.apply($,M):_,U=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),W=$.__zoom,G=typeof T=="function"?T.apply($,M):T,V=a(W.invert(D).concat(U/W.k),G.invert(D).concat(U/G.k));return function(X){if(X===1)X=G;else{var O=V(X),Y=U/O[2];X=new Vt(Y,D[0]-O[0]*Y,D[1]-O[1]*Y)}L.zoom(null,X)}})}function E(S,T,_){return!_&&S.__zooming||new N(S,T)}function N(S,T){this.that=S,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,T),this.taps=0}N.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,T){return this.mouse&&S!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var T=Xe(this.that).datum();u.call(S,this.that,new MS(S,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),T)}};function j(S,...T){if(!e.apply(this,arguments))return;var _=E(this,T).event(S),z=this.__zoom,$=Math.max(i[0],Math.min(i[1],z.k*Math.pow(2,r.apply(this,arguments)))),M=ft(S);if(_.wheel)(_.mouse[0][0]!==M[0]||_.mouse[0][1]!==M[1])&&(_.mouse[1]=z.invert(_.mouse[0]=M)),clearTimeout(_.wheel);else{if(z.k===$)return;_.mouse=[M,z.invert(M)],ns(this),_.start()}oo(S),_.wheel=setTimeout(L,y),_.zoom("mouse",n(g(v(z,$),_.mouse[0],_.mouse[1]),_.extent,s));function L(){_.wheel=null,_.end()}}function P(S,...T){if(d||!e.apply(this,arguments))return;var _=S.currentTarget,z=E(this,T,!0).event(S),$=Xe(S.view).on("mousemove.zoom",D,!0).on("mouseup.zoom",U,!0),M=ft(S,_),L=S.clientX,I=S.clientY;Rm(S.view),Zl(S),z.mouse=[M,this.__zoom.invert(M)],ns(this),z.start();function D(W){if(oo(W),!z.moved){var G=W.clientX-L,V=W.clientY-I;z.moved=G*G+V*V>x}z.event(W).zoom("mouse",n(g(z.that.__zoom,z.mouse[0]=ft(W,_),z.mouse[1]),z.extent,s))}function U(W){$.on("mousemove.zoom mouseup.zoom",null),Dm(W.view,z.moved),oo(W),z.event(W).end()}}function A(S,...T){if(e.apply(this,arguments)){var _=this.__zoom,z=ft(S.changedTouches?S.changedTouches[0]:S,this),$=_.invert(z),M=_.k*(S.shiftKey?.5:2),L=n(g(v(_,M),z,$),t.apply(this,T),s);oo(S),l>0?Xe(this).transition().duration(l).call(C,L,z,S):Xe(this).call(m.transform,L,z,S)}}function R(S,...T){if(e.apply(this,arguments)){var _=S.touches,z=_.length,$=E(this,T,S.changedTouches.length===z).event(S),M,L,I,D;for(Zl(S),L=0;L<z;++L)I=_[L],D=ft(I,this),D=[D,this.__zoom.invert(D),I.identifier],$.touch0?!$.touch1&&$.touch0[2]!==D[2]&&($.touch1=D,$.taps=0):($.touch0=D,M=!0,$.taps=1+!!c);c&&(c=clearTimeout(c)),M&&($.taps<2&&(f=D[0],c=setTimeout(function(){c=null},p)),ns(this),$.start())}}function H(S,...T){if(this.__zooming){var _=E(this,T).event(S),z=S.changedTouches,$=z.length,M,L,I,D;for(oo(S),M=0;M<$;++M)L=z[M],I=ft(L,this),_.touch0&&_.touch0[2]===L.identifier?_.touch0[0]=I:_.touch1&&_.touch1[2]===L.identifier&&(_.touch1[0]=I);if(L=_.that.__zoom,_.touch1){var U=_.touch0[0],W=_.touch0[1],G=_.touch1[0],V=_.touch1[1],X=(X=G[0]-U[0])*X+(X=G[1]-U[1])*X,O=(O=V[0]-W[0])*O+(O=V[1]-W[1])*O;L=v(L,Math.sqrt(X/O)),I=[(U[0]+G[0])/2,(U[1]+G[1])/2],D=[(W[0]+V[0])/2,(W[1]+V[1])/2]}else if(_.touch0)I=_.touch0[0],D=_.touch0[1];else return;_.zoom("touch",n(g(L,I,D),_.extent,s))}}function F(S,...T){if(this.__zooming){var _=E(this,T).event(S),z=S.changedTouches,$=z.length,M,L;for(Zl(S),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),M=0;M<$;++M)L=z[M],_.touch0&&_.touch0[2]===L.identifier?delete _.touch0:_.touch1&&_.touch1[2]===L.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(L=ft(L,this),Math.hypot(f[0]-L[0],f[1]-L[1])<k)){var I=Xe(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return m.wheelDelta=function(S){return arguments.length?(r=typeof S=="function"?S:bi(+S),m):r},m.filter=function(S){return arguments.length?(e=typeof S=="function"?S:bi(!!S),m):e},m.touchable=function(S){return arguments.length?(o=typeof S=="function"?S:bi(!!S),m):o},m.extent=function(S){return arguments.length?(t=typeof S=="function"?S:bi([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),m):t},m.scaleExtent=function(S){return arguments.length?(i[0]=+S[0],i[1]=+S[1],m):[i[0],i[1]]},m.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],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(S){return arguments.length?(n=S,m):n},m.duration=function(S){return arguments.length?(l=+S,m):l},m.interpolate=function(S){return arguments.length?(a=S,m):a},m.on=function(){var S=u.on.apply(u,arguments);return S===u?m:S},m.clickDistance=function(S){return arguments.length?(x=(S=+S)*S,m):Math.sqrt(x)},m.tapDistance=function(S){return arguments.length?(k=+S,m):k},m}const kt={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.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 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.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Wo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],tg=["Enter"," ","Escape"],ng={"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 Dr;(function(e){e.Strict="strict",e.Loose="loose"})(Dr||(Dr={}));var Hn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Hn||(Hn={}));var Yo;(function(e){e.Partial="partial",e.Full="full"})(Yo||(Yo={}));const rg={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ln;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ln||(ln={}));var Xo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Xo||(Xo={}));var Z;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Z||(Z={}));const df={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top},og=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,bS=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),mc=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ii=(e,t=[0,0])=>{const{width:n,height:r}=Et(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},LS=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const r=e.reduce((o,i)=>{const s=typeof i=="string";let l=!t.nodeLookup&&!s?i:void 0;return t.nodeLookup&&(l=s?t.nodeLookup.get(i):mc(i)?i:t.nodeLookup.get(i.id)),l?(n=!0,cl(o,Ls(l,t.nodeOrigin))):o},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?dl(r):{x:0,y:0,width:0,height:0}},si=(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=cl(n,Ls(o)),r=!0)}),r?dl(n):{x:0,y:0,width:0,height:0}},gc=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l=(t.x-n)/o,a=(t.y-r)/o,u=t.width/o,c=t.height/o,f=[];for(const d of e.values()){const{measured:p,selectable:y=!0,hidden:x=!1}=d;if(s&&!y||x)continue;const k=p.width??d.width??d.initialWidth??0,m=p.height??d.height??d.initialHeight??0,{x:v,y:g}=d.internals.positionAbsolute,w=ag(l,a,u,c,v,g,k,m),C=k*m,E=i&&w>0;(!d.internals.handleBounds||E||w>=C||d.dragging)&&f.push(d)}return f},AS=(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 RS(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{let i;if(t!=null&&t.includeHiddenNodes){const{width:s,height:l}=Et(o);i=s>0&&l>0}else i=!!(o.measured.width&&o.measured.height&&!o.hidden);i&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function DS({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return!0;const l=RS(e,s),a=si(l),u=vc(a,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(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),!0}function ig({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:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=s.origin??r;let f=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",kt.error005());else{const{width:p,height:y}=Et(l);p&&y&&(f=[[a,u],[a+p,u+y]])}else l&&Jn(s.extent)&&(f=[[s.extent[0][0]+a,s.extent[0][1]+u],[s.extent[1][0]+a,s.extent[1][1]+u]]);const d=Jn(f)?Zn(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",kt.error015())),{position:{x:d.x-a+(s.measured.width??0)*c[0],y:d.y-u+(s.measured.height??0)*c[1]},positionAbsolute:d}}async function OS({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 p=i.has(d.id),y=!p&&d.parentId&&s.find(x=>x.id===d.parentId);(p||y)&&s.push(d)}const l=new Set(t.map(d=>d.id)),a=r.filter(d=>d.deletable!==!1),c=AS(s,a);for(const d of a)l.has(d.id)&&!c.find(y=>y.id===d.id)&&c.push(d);if(!o)return{edges:c,nodes:s};const f=await o({nodes:s,edges:c});return typeof f=="boolean"?f?{edges:c,nodes:s}:{edges:[],nodes:[]}:f}const Or=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Zn=(e={x:0,y:0},t,n)=>({x:Or(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Or(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function sg(e,t,n){const{width:r,height:o}=Et(n),{x:i,y:s}=n.internals.positionAbsolute;return Zn(e,[[i,s],[i+r,s+o]],t)}const ff=(e,t,n)=>e<t?Or(Math.abs(e-t),1,t)/t:e>n?-Or(Math.abs(e-n),1,t)/t:0,yc=(e,t,n=15,r=40)=>{const o=ff(e.x,r,t.width-r)*n,i=ff(e.y,r,t.height-r)*n;return[o,i]},cl=(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)}),su=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),dl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Ko=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=mc(e)?e.internals.positionAbsolute:ii(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}},Ls=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=mc(e)?e.internals.positionAbsolute:ii(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)}},lg=(e,t)=>dl(cl(su(e),su(t))),ag=(e,t,n,r,o,i,s,l)=>{const a=Math.max(0,Math.min(e+n,o+s)-Math.max(e,o)),u=Math.max(0,Math.min(t+r,i+l)-Math.max(t,i));return Math.ceil(a*u)},As=(e,t)=>ag(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),hf=e=>gt(e.width)&&gt(e.height)&&gt(e.x)&&gt(e.y),gt=e=>!isNaN(e)&&isFinite(e),ug=(e,t)=>(n,r)=>{},li=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ai=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?li(l,s):l},Fr=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function or(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(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function FS(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=or(e,n),o=or(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=or(e.top??e.y??0,n),o=or(e.bottom??e.y??0,n),i=or(e.left??e.x??0,t),s=or(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 HS(e,t,n,r,o,i){const{x:s,y:l}=Fr(e,[t,n,r]),{x:a,y:u}=Fr({x:e.x+e.width,y:e.y+e.height},[t,n,r]),c=o-a,f=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(f)}}const vc=(e,t,n,r,o,i)=>{const s=FS(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),c=Or(u,r,o),f=e.x+e.width/2,d=e.y+e.height/2,p=t/2-f*c,y=n/2-d*c,x=HS(e,p,y,c,t,n),k={left:Math.min(x.left-s.left,0),top:Math.min(x.top-s.top,0),right:Math.min(x.right-s.right,0),bottom:Math.min(x.bottom-s.bottom,0)};return{x:p-k.left+k.right,y:y-k.top+k.bottom,zoom:c}},Qo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Jn(e){return e!=null&&e!=="parent"}function Et(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 cg(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 dg(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 pf(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function VS(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function BS(e){return{...ng,...e||{}}}function fg(e){return e===null?null:e?"valid":"invalid"}function Eo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=yt(e),l=ai({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:a,y:u}=n?li(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const xc=e=>({width:e.offsetWidth,height:e.offsetHeight}),hg=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},US=["INPUT","SELECT","TEXTAREA"];function pg(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:US.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const mg=e=>"clientX"in e,yt=(e,t)=>{var i,s;const n=mg(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)}},mf=(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,...xc(s)}})};function gg({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,c=Math.abs(a-e),f=Math.abs(u-t);return[a,u,c,f]}function Li(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function gf({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Z.Left:return[t-Li(t-r,i),n];case Z.Right:return[t+Li(r-t,i),n];case Z.Top:return[t,n-Li(n-o,i)];case Z.Bottom:return[t,n+Li(o-n,i)]}}function wc({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:o,targetPosition:i=Z.Top,curvature:s=.25}){const[l,a]=gf({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=gf({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[f,d,p,y]=gg({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${a} ${u},${c} ${r},${o}`,f,d,p,y]}function yg({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 WS({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 YS({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=cl(Ls(e),Ls(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 As(s,dl(i))>0}const XS=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,KS=(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)),QS=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",kt.error006()),t;const r=n.getEdgeId||XS;let o;return og(e)?o={...e}:o={...e,id:r(e)},KS(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function vg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=yg({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const yf={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}},GS=({source:e,sourcePosition:t=Z.Bottom,target:n})=>t===Z.Left||t===Z.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},vf=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function qS({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:r=Z.Top,center:o,offset:i,stepPosition:s}){const l=yf[t],a=yf[r],u={x:e.x+l.x*i,y:e.y+l.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},f=GS({source:u,sourcePosition:t,target:c}),d=f.x!==0?"x":"y",p=f[d];let y=[],x,k;const m={x:0,y:0},v={x:0,y:0},[,,g,w]=yg({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*a[d]===-1){d==="x"?(x=o.x??u.x+(c.x-u.x)*s,k=o.y??(u.y+c.y)/2):(x=o.x??(u.x+c.x)/2,k=o.y??u.y+(c.y-u.y)*s);const j=[{x,y:u.y},{x,y:c.y}],P=[{x:u.x,y:k},{x:c.x,y:k}];l[d]===p?y=d==="x"?j:P:y=d==="x"?P:j}else{const j=[{x:u.x,y:c.y}],P=[{x:c.x,y:u.y}];if(d==="x"?y=l.x===p?P:j:y=l.y===p?j:P,t===r){const S=Math.abs(e[d]-n[d]);if(S<=i){const T=Math.min(i-1,i-S);l[d]===p?m[d]=(u[d]>e[d]?-1:1)*T:v[d]=(c[d]>n[d]?-1:1)*T}}if(t!==r){const S=d==="x"?"y":"x",T=l[d]===a[S],_=u[S]>c[S],z=u[S]<c[S];(l[d]===1&&(!T&&_||T&&z)||l[d]!==1&&(!T&&z||T&&_))&&(y=d==="x"?j:P)}const A={x:u.x+m.x,y:u.y+m.y},R={x:c.x+v.x,y:c.y+v.y},H=Math.max(Math.abs(A.x-y[0].x),Math.abs(R.x-y[0].x)),F=Math.max(Math.abs(A.y-y[0].y),Math.abs(R.y-y[0].y));H>=F?(x=(A.x+R.x)/2,k=y[0].y):(x=y[0].x,k=(A.y+R.y)/2)}const C={x:u.x+m.x,y:u.y+m.y},E={x:c.x+v.x,y:c.y+v.y};return[[e,...C.x!==y[0].x||C.y!==y[0].y?[C]:[],...y,...E.x!==y[y.length-1].x||E.y!==y[y.length-1].y?[E]:[],n],x,k,g,w]}function ZS(e,t,n,r){const o=Math.min(vf(e,t)/2,vf(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 u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function Rs({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:o,targetPosition:i=Z.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20,stepPosition:c=.5}){const[f,d,p,y,x]=qS({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u,stepPosition:c});let k=`M${f[0].x} ${f[0].y}`;for(let m=1;m<f.length-1;m++)k+=ZS(f[m-1],f[m],f[m+1],s);return k+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[k,d,p,y,x]}function xf(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function JS(e){var f;const{sourceNode:t,targetNode:n}=e;if(!xf(t)||!xf(n))return null;const r=t.internals.handleBounds||wf(t.handles),o=n.internals.handleBounds||wf(n.handles),i=kf((r==null?void 0:r.source)??[],e.sourceHandle),s=kf(e.connectionMode===Dr.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(f=e.onError)==null||f.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)||Z.Bottom,a=(s==null?void 0:s.position)||Z.Top,u=er(t,i,l),c=er(n,s,a);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:a}}function wf(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 er(e,t,n=Z.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??Et(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Z.Top:return{x:o+s/2,y:i};case Z.Right:return{x:o+s,y:i+l/2};case Z.Bottom:return{x:o+s/2,y:i+l};case Z.Left:return{x:o,y:i+l/2}}}function kf(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function lu(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function eE(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(a=>{if(a&&typeof a=="object"){const u=lu(a,t);i.has(u)||(s.push({id:u,color:a.color||n,...a}),i.add(u))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const xg=1e3,tE=10,kc={nodeOrigin:[0,0],nodeExtent:Wo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},nE={...kc,checkEquality:!0};function Sc(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function rE(e,t,n){const r=Sc(kc,n);for(const o of e.values())if(o.parentId)Nc(o,e,t,r);else{const i=ii(o,r.nodeOrigin),s=Jn(o.extent)?o.extent:r.nodeExtent,l=Zn(i,s,Et(o));o.internals.positionAbsolute=l}}function oE(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 Ec(e){return e==="manual"}function au(e,t,n,r={}){var c,f;const o=Sc(nE,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!Ec(o.zIndexMode)?xg:0;let a=e.length>0,u=!1;t.clear(),n.clear();for(const d of e){let p=s.get(d.id);if(o.checkEquality&&d===(p==null?void 0:p.internals.userNode))t.set(d.id,p);else{const y=ii(d,o.nodeOrigin),x=Jn(d.extent)?d.extent:o.nodeExtent,k=Zn(y,x,Et(d));p={...o.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(f=d.measured)==null?void 0:f.height},internals:{positionAbsolute:k,handleBounds:oE(d,p),z:wg(d,l,o.zIndexMode),userNode:d}},t.set(d.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(a=!1),d.parentId&&Nc(p,t,n,r,i),u||(u=d.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:u}}function iE(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 Nc(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:a}=Sc(kc,r),u=e.parentId,c=t.get(u);if(!c){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}iE(e,n),o&&!c.parentId&&c.internals.rootParentIndex===void 0&&a==="auto"&&(c.internals.rootParentIndex=++o.i,c.internals.z=c.internals.z+o.i*tE),o&&c.internals.rootParentIndex!==void 0&&(o.i=c.internals.rootParentIndex);const f=i&&!Ec(a)?xg:0,{x:d,y:p,z:y}=sE(e,c,s,l,f,a),{positionAbsolute:x}=e.internals,k=d!==x.x||p!==x.y;(k||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:k?{x:d,y:p}:x,z:y}})}function wg(e,t,n){const r=gt(e.zIndex)?e.zIndex:0;return Ec(n)?r:r+(e.selected?t:0)}function sE(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,a=Et(e),u=ii(e,n),c=Jn(e.extent)?Zn(u,e.extent,a):u;let f=Zn({x:s+c.x,y:l+c.y},r,a);e.extent==="parent"&&(f=sg(f,a,t));const d=wg(e,o,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=d?p+1:d}}function _c(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const u=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??Ko(a),c=lg(u,l.rect);i.set(l.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},u)=>{var g;const c=a.internals.positionAbsolute,f=Et(a),d=a.origin??r,p=l.x<c.x?Math.round(Math.abs(c.x-l.x)):0,y=l.y<c.y?Math.round(Math.abs(c.y-l.y)):0,x=Math.max(f.width,Math.round(l.width)),k=Math.max(f.height,Math.round(l.height)),m=(x-f.width)*d[0],v=(k-f.height)*d[1];(p>0||y>0||m||v)&&(o.push({id:u,type:"position",position:{x:a.position.x-p+m,y:a.position.y-y+v}}),(g=n.get(u))==null||g.forEach(w=>{e.some(C=>C.id===w.id)||o.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+y}})})),(f.width<l.width||f.height<l.height||p||y)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:x+(p?d[0]*p-m:0),height:k+(y?d[1]*y-v:0)}})}),o}function lE(e,t,n,r,o,i,s){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const u=[],c=window.getComputedStyle(l),{m22:f}=new window.DOMMatrixReadOnly(c.transform),d=[];for(const p of e.values()){const y=t.get(p.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),a=!0;continue}const x=xc(p.nodeElement),k=y.measured.width!==x.width||y.measured.height!==x.height;if(!!(x.width&&x.height&&(k||!y.internals.handleBounds||p.force))){const v=p.nodeElement.getBoundingClientRect(),g=Jn(y.extent)?y.extent:i;let{positionAbsolute:w}=y.internals;if(y.parentId&&y.extent==="parent"){const E=t.get(y.parentId);E&&(w=sg(w,x,E))}else g&&(w=Zn(w,g,x));const C={...y,measured:x,internals:{...y.internals,positionAbsolute:w,handleBounds:{source:mf("source",p.nodeElement,v,f,y.id),target:mf("target",p.nodeElement,v,f,y.id)}}};t.set(y.id,C),y.parentId&&Nc(C,t,n,{nodeOrigin:o,zIndexMode:s}),a=!0,k&&(u.push({id:y.id,type:"dimensions",dimensions:x}),y.expandParent&&y.parentId&&d.push({id:y.id,parentId:y.parentId,rect:Ko(C,o)}))}}if(d.length>0){const p=_c(d,t,n,o);u.push(...p)}return{changes:u,updatedInternals:a}}async function aE({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function Sf(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 a=r.get(s)||new Map;if(r.set(s,a.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function kg(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,a={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l},u=`${o}-${s}--${i}-${l}`,c=`${i}-${l}--${o}-${s}`;Sf("source",a,c,e,o,s),Sf("target",a,u,e,i,l),t.set(r.id,r)}}function Sg(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Sg(n,t):!1}function Ef(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 uE(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Sg(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 Jl({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,a;const o=[];for(const[u,c]of t){const f=(s=n.get(u))==null?void 0:s.internals.userNode;f&&o.push({...f,position:c.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:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:r}:o[0],o]}function cE({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=li(i,t);return{x:s.x-i.x,y:s.y-i.y}}function dE({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,a=!1,u={x:0,y:0},c=null,f=!1,d=null,p=!1,y=!1,x=null;function k({noDragClassName:v,handleSelector:g,domNode:w,isSelectable:C,nodeId:E,nodeClickDistance:N=0}){d=Xe(w);function j({x:H,y:F}){const{nodeLookup:S,nodeExtent:T,snapGrid:_,snapToGrid:z,nodeOrigin:$,onNodeDrag:M,onSelectionDrag:L,onError:I,updateNodePositions:D}=t();i={x:H,y:F};let U=!1;const W=l.size>1,G=W&&T?su(si(l)):null,V=W&&z?cE({dragItems:l,snapGrid:_,x:H,y:F}):null;for(const[X,O]of l){if(!S.has(X))continue;let Y={x:H-O.distance.x,y:F-O.distance.y};z&&(Y=V?{x:Math.round(Y.x+V.x),y:Math.round(Y.y+V.y)}:li(Y,_));let q=null;if(W&&T&&!O.extent&&G){const{positionAbsolute:ee}=O.internals,te=ee.x-G.x+T[0][0],ne=ee.x+O.measured.width-G.x2+T[1][0],re=ee.y-G.y+T[0][1],se=ee.y+O.measured.height-G.y2+T[1][1];q=[[te,re],[ne,se]]}const{position:J,positionAbsolute:Q}=ig({nodeId:X,nextPosition:Y,nodeLookup:S,nodeExtent:q||T,nodeOrigin:$,onError:I});U=U||O.position.x!==J.x||O.position.y!==J.y,O.position=J,O.internals.positionAbsolute=Q}if(y=y||U,!!U&&(D(l,!0),x&&(r||M||!E&&L))){const[X,O]=Jl({nodeId:E,dragItems:l,nodeLookup:S});r==null||r(x,l,X,O),M==null||M(x,X,O),E||L==null||L(x,O)}}async function P(){if(!c)return;const{transform:H,panBy:F,autoPanSpeed:S,autoPanOnNodeDrag:T}=t();if(!T){a=!1,cancelAnimationFrame(s);return}const[_,z]=yc(u,c,S);(_!==0||z!==0)&&(i.x=(i.x??0)-_/H[2],i.y=(i.y??0)-z/H[2],await F({x:_,y:z})&&j(i)),s=requestAnimationFrame(P)}function A(H){var W;const{nodeLookup:F,multiSelectionActive:S,nodesDraggable:T,transform:_,snapGrid:z,snapToGrid:$,selectNodesOnDrag:M,onNodeDragStart:L,onSelectionDragStart:I,unselectNodesAndEdges:D}=t();f=!0,(!M||!C)&&!S&&E&&((W=F.get(E))!=null&&W.selected||D()),C&&M&&E&&(e==null||e(E));const U=Eo(H.sourceEvent,{transform:_,snapGrid:z,snapToGrid:$,containerBounds:c});if(i=U,l=uE(F,T,U,E),l.size>0&&(n||L||!E&&I)){const[G,V]=Jl({nodeId:E,dragItems:l,nodeLookup:F});n==null||n(H.sourceEvent,l,G,V),L==null||L(H.sourceEvent,G,V),E||I==null||I(H.sourceEvent,V)}}const R=Om().clickDistance(N).on("start",H=>{const{domNode:F,nodeDragThreshold:S,transform:T,snapGrid:_,snapToGrid:z}=t();c=(F==null?void 0:F.getBoundingClientRect())||null,p=!1,y=!1,x=H.sourceEvent,S===0&&A(H),i=Eo(H.sourceEvent,{transform:T,snapGrid:_,snapToGrid:z,containerBounds:c}),u=yt(H.sourceEvent,c)}).on("drag",H=>{const{autoPanOnNodeDrag:F,transform:S,snapGrid:T,snapToGrid:_,nodeDragThreshold:z,nodeLookup:$}=t(),M=Eo(H.sourceEvent,{transform:S,snapGrid:T,snapToGrid:_,containerBounds:c});if(x=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||E&&!$.has(E))&&(p=!0),!p){if(!a&&F&&f&&(a=!0,P()),!f){const L=yt(H.sourceEvent,c),I=L.x-u.x,D=L.y-u.y;Math.sqrt(I*I+D*D)>z&&A(H)}(i.x!==M.xSnapped||i.y!==M.ySnapped)&&l&&f&&(u=yt(H.sourceEvent,c),j(M))}}).on("end",H=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(a=!1,f=!1,cancelAnimationFrame(s),l.size>0){const{nodeLookup:F,updateNodePositions:S,onNodeDragStop:T,onSelectionDragStop:_}=t();if(y&&(S(l,!1),y=!1),o||T||!E&&_){const[z,$]=Jl({nodeId:E,dragItems:l,nodeLookup:F,dragging:!1});o==null||o(H.sourceEvent,l,z,$),T==null||T(H.sourceEvent,z,$),E||_==null||_(H.sourceEvent,$)}}}).filter(H=>{const F=H.target;return!H.button&&(!v||!Ef(F,`.${v}`,w))&&(!g||Ef(F,g,w))});d.call(R)}function m(){d==null||d.on(".drag",null)}return{update:k,destroy:m}}function fE(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())As(o,Ko(i))>0&&r.push(i);return r}const hE=250;function pE(e,t,n,r){var l,a;let o=[],i=1/0;const s=fE(e,n,t+hE);for(const u of s){const c=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const f of c){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:d,y:p}=er(u,f,f.position,!0),y=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(p-e.y,2));y>t||(y<i?(o=[{...f,x:d,y:p}],i=y):y===i&&o.push({...f,x:d,y:p}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(c=>c.type===u)??o[0]}return o[0]}function Eg(e,t,n,r,o,i=!1){var u,c,f;const s=r.get(e);if(!s)return null;const l=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((c=s.internals.handleBounds)==null?void 0:c.source)??[],...((f=s.internals.handleBounds)==null?void 0:f.target)??[]],a=(n?l==null?void 0:l.find(d=>d.id===n):l==null?void 0:l[0])??null;return a&&i?{...a,...er(s,a,a.position,!0)}:a}function Ng(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function mE(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const _g=()=>!0;function gE(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:c,flowId:f,panBy:d,cancelConnection:p,onConnectStart:y,onConnect:x,onConnectEnd:k,isValidConnection:m=_g,onReconnectEnd:v,updateConnection:g,getTransform:w,getFromHandle:C,autoPanSpeed:E,dragThreshold:N=1,handleDomNode:j}){const P=hg(e.target);let A=0,R;const{x:H,y:F}=yt(e),S=Ng(i,j),T=l==null?void 0:l.getBoundingClientRect();let _=!1;if(!T||!S)return;const z=Eg(o,S,r,a,t);if(!z)return;let $=yt(e,T),M=!1,L=null,I=!1,D=null;function U(){if(!c||!T)return;const[J,Q]=yc($,T,E);d({x:J,y:Q}),A=requestAnimationFrame(U)}const W={...z,nodeId:o,type:S,position:z.position},G=a.get(o);let X={inProgress:!0,isValid:null,from:er(G,W,Z.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:G,to:$,toHandle:null,toPosition:df[W.position],toNode:null,pointer:$};function O(){_=!0,g(X),y==null||y(e,{nodeId:o,handleId:r,handleType:S})}N===0&&O();function Y(J){if(!_){const{x:se,y:Ne}=yt(J),be=se-H,et=Ne-F;if(!(be*be+et*et>N*N))return;O()}if(!C()||!W){q(J);return}const Q=w();$=yt(J,T),R=pE(ai($,Q,!1,[1,1]),n,a,W),M||(U(),M=!0);const ee=Cg(J,{handle:R,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:m,doc:P,lib:u,flowId:f,nodeLookup:a});D=ee.handleDomNode,L=ee.connection,I=mE(!!R,ee.isValid);const te=a.get(o),ne=te?er(te,W,Z.Left,!0):X.from,re={...X,from:ne,isValid:I,to:ee.toHandle&&I?Fr({x:ee.toHandle.x,y:ee.toHandle.y},Q):$,toHandle:ee.toHandle,toPosition:I&&ee.toHandle?ee.toHandle.position:df[W.position],toNode:ee.toHandle?a.get(ee.toHandle.nodeId):null,pointer:$};g(re),X=re}function q(J){if(!("touches"in J&&J.touches.length>0)){if(_){(R||D)&&L&&I&&(x==null||x(L));const{inProgress:Q,...ee}=X,te={...ee,toPosition:X.toHandle?X.toPosition:null};k==null||k(J,te),i&&(v==null||v(J,te))}p(),cancelAnimationFrame(A),M=!1,I=!1,L=null,D=null,P.removeEventListener("mousemove",Y),P.removeEventListener("mouseup",q),P.removeEventListener("touchmove",Y),P.removeEventListener("touchend",q)}}P.addEventListener("mousemove",Y),P.addEventListener("mouseup",q),P.addEventListener("touchmove",Y),P.addEventListener("touchend",q)}function Cg(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=_g,nodeLookup:c}){const f=i==="target",d=t?s.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y}=yt(e),x=s.elementFromPoint(p,y),k=x!=null&&x.classList.contains(`${l}-flow__handle`)?x:d,m={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const v=Ng(void 0,k),g=k.getAttribute("data-nodeid"),w=k.getAttribute("data-handleid"),C=k.classList.contains("connectable"),E=k.classList.contains("connectableend");if(!g||!v)return m;const N={source:f?g:r,sourceHandle:f?w:o,target:f?r:g,targetHandle:f?o:w};m.connection=N;const P=C&&E&&(n===Dr.Strict?f&&v==="source"||!f&&v==="target":g!==r||w!==o);m.isValid=P&&u(N),m.toHandle=Eg(g,v,w,c,n,!0)}return m}const uu={onPointerDown:gE,isValid:Cg};function yE({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=Xe(e);function i({translateExtent:l,width:a,height:u,zoomStep:c=1,pannable:f=!0,zoomable:d=!0,inversePan:p=!1}){const y=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const w=n(),C=g.sourceEvent.ctrlKey&&Qo()?10:1,E=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*c,N=w[2]*Math.pow(2,E*C);t.scaleTo(N)};let x=[0,0];const k=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(x=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const C=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],E=[C[0]-x[0],C[1]-x[1]];x=C;const N=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),j={x:w[0]-E[0]*N,y:w[1]-E[1]*N},P=[[0,0],[a,u]];t.setViewportConstrained({x:j.x,y:j.y,zoom:w[2]},P,l)},v=eg().on("start",k).on("zoom",f?m:null).on("zoom.wheel",d?y:null);o.call(v,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:ft}}const fl=e=>({x:e.x,y:e.y,zoom:e.k}),ea=({x:e,y:t,zoom:n})=>ul.translate(e,t).scale(n),nn=(e,t)=>e.target.closest(`.${t}`),jg=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),vE=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ta=(e,t=0,n=vE,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Mg=e=>{const t=e.ctrlKey&&Qo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function xE({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return c=>{if(nn(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(c.ctrlKey&&s){const k=ft(c),m=Mg(c),v=f*Math.pow(2,m);r.scaleTo(n,v,k,c);return}const d=c.deltaMode===1?20:1;let p=o===Hn.Vertical?0:c.deltaX*d,y=o===Hn.Horizontal?0:c.deltaY*d;!Qo()&&c.shiftKey&&o!==Hn.Vertical&&(p=c.deltaY*d,y=0),r.translateBy(n,-(p/f)*i,-(y/f)*i,{internal:!0});const x=fl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?a==null||a(c,x):(e.isPanScrolling=!0,l==null||l(c,x)),e.panScrollTimeout=setTimeout(()=>{u==null||u(c,x),e.isPanScrolling=!1},150)}}function wE({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=nn(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function kE({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=fl(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 SE({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&jg(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,fl(i.transform)))}}function EE({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&&jg(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=fl(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,a)},n?150:0)}}}function NE({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:o,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:l,noWheelClassName:a,noPanClassName:u,lib:c,connectionInProgress:f}){return d=>{var m;const p=t||n,y=r&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(nn(d,`${c}-flow__node`)||nn(d,`${c}-flow__edge`)||nn(d,`${c}-flow__selection`)||nn(d,`${c}-flow__nodesselection`)))return!0;if(!o&&!p&&!i&&!s&&!r||l||f&&!x||nn(d,a)&&x||nn(d,u)&&(!x||i&&x&&!t)||!r&&d.ctrlKey&&x)return!1;if(!r&&d.type==="touchstart"&&((m=d.touches)==null?void 0:m.length)>1)return d.preventDefault(),!1;if(!p&&!i&&!y&&x||!o&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(o)&&!o.includes(d.button)&&d.type==="mousedown")return!1;const k=Array.isArray(o)&&o.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x||e)&&k}}function _E({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect();let f=[[0,0],[c.width,c.height]];const d=typeof ResizeObserver<"u"?new ResizeObserver(F=>{const S=F[0];S&&(f=[[0,0],[S.contentRect.width,S.contentRect.height]])}):null;d==null||d.observe(e);const p=eg().extent(()=>f).scaleExtent([t,n]).translateExtent(r),y=Xe(e).call(p);w({x:o.x,y:o.y,zoom:Or(o.zoom,t,n)},[[0,0],[c.width,c.height]],r);const x=y.on("wheel.zoom"),k=y.on("dblclick.zoom");p.wheelDelta(Mg);async function m(F,S){return y?new Promise(T=>{p==null||p.interpolate((S==null?void 0:S.interpolate)==="linear"?So:Ji).transform(ta(y,S==null?void 0:S.duration,S==null?void 0:S.ease,()=>T(!0)),F)}):!1}function v({noWheelClassName:F,noPanClassName:S,onPaneContextMenu:T,userSelectionActive:_,panOnScroll:z,panOnDrag:$,panOnScrollMode:M,panOnScrollSpeed:L,preventScrolling:I,zoomOnPinch:D,zoomOnScroll:U,zoomOnDoubleClick:W,panActivationKeyPressed:G=!1,zoomActivationKeyPressed:V,lib:X,onTransformChange:O,connectionInProgress:Y,paneClickDistance:q,selectionOnDrag:J}){_&&!u.isZoomingOrPanning&&g();const Q=z&&!V&&!_;p.clickDistance(J?1/0:!gt(q)||q<0?0:q);const ee=Q?xE({zoomPanValues:u,noWheelClassName:F,d3Selection:y,d3Zoom:p,panOnScrollMode:M,panOnScrollSpeed:L,zoomOnPinch:D,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):wE({noWheelClassName:F,preventScrolling:I,d3ZoomHandler:x});y.on("wheel.zoom",ee,{passive:!1});const te=kE({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:s});p.on("start",te);const ne=SE({zoomPanValues:u,panOnDrag:$,onPaneContextMenu:!!T,onPanZoom:i,onTransformChange:O});p.on("zoom",ne);const re=EE({zoomPanValues:u,panOnDrag:$,panOnScroll:z,onPaneContextMenu:T,onPanZoomEnd:l,onDraggingChange:a});p.on("end",re);const se=NE({panActivationKeyPressed:G,zoomActivationKeyPressed:V,panOnDrag:$,zoomOnScroll:U,panOnScroll:z,zoomOnDoubleClick:W,zoomOnPinch:D,userSelectionActive:_,noPanClassName:S,noWheelClassName:F,lib:X,connectionInProgress:Y});p.filter(se),W?y.on("dblclick.zoom",k):y.on("dblclick.zoom",null)}function g(){p.on("zoom",null)}async function w(F,S,T){const _=ea(F),z=p==null?void 0:p.constrain()(_,S,T);return z&&await m(z),z}async function C(F,S){const T=ea(F);return await m(T,S),T}function E(F){if(y){const S=ea(F),T=y.property("__zoom");(T.k!==F.zoom||T.x!==F.x||T.y!==F.y)&&(p==null||p.transform(y,S,null,{sync:!0}))}}function N(){const F=y?Jm(y.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}async function j(F,S){return y?new Promise(T=>{p==null||p.interpolate((S==null?void 0:S.interpolate)==="linear"?So:Ji).scaleTo(ta(y,S==null?void 0:S.duration,S==null?void 0:S.ease,()=>T(!0)),F)}):!1}async function P(F,S){return y?new Promise(T=>{p==null||p.interpolate((S==null?void 0:S.interpolate)==="linear"?So:Ji).scaleBy(ta(y,S==null?void 0:S.duration,S==null?void 0:S.ease,()=>T(!0)),F)}):!1}function A(F){p==null||p.scaleExtent(F)}function R(F){p==null||p.translateExtent(F)}function H(F){const S=!gt(F)||F<0?0:F;p==null||p.clickDistance(S)}return{update:v,destroy:g,setViewport:C,setViewportConstrained:w,getViewport:N,scaleTo:j,scaleBy:P,setScaleExtent:A,setTranslateExtent:R,syncViewport:E,setClickDistance:H}}var Hr;(function(e){e.Line="line",e.Handle="handle"})(Hr||(Hr={}));function CE({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,l=n-r,a=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&o&&(a[0]=a[0]*-1),l&&i&&(a[1]=a[1]*-1),a}function Nf(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 Zt(e,t){return Math.max(0,t-e)}function Jt(e,t){return Math.max(0,e-t)}function Ai(e,t,n){return Math.max(0,t-e,e-n)}function _f(e,t){return e?!t:t}function jE(e,t,n,r,o,i,s,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:c,isVertical:f}=t,d=c&&f,{xSnapped:p,ySnapped:y}=n,{minWidth:x,maxWidth:k,minHeight:m,maxHeight:v}=r,{x:g,y:w,width:C,height:E,aspectRatio:N}=e;let j=Math.floor(c?p-e.pointerX:0),P=Math.floor(f?y-e.pointerY:0);const A=C+(a?-j:j),R=E+(u?-P:P),H=-i[0]*C,F=-i[1]*E;let S=Ai(A,x,k),T=Ai(R,m,v);if(s){let $=0,M=0;a&&j<0?$=Zt(g+j+H,s[0][0]):!a&&j>0&&($=Jt(g+A+H,s[1][0])),u&&P<0?M=Zt(w+P+F,s[0][1]):!u&&P>0&&(M=Jt(w+R+F,s[1][1])),S=Math.max(S,$),T=Math.max(T,M)}if(l){let $=0,M=0;a&&j>0?$=Jt(g+j,l[0][0]):!a&&j<0&&($=Zt(g+A,l[1][0])),u&&P>0?M=Jt(w+P,l[0][1]):!u&&P<0&&(M=Zt(w+R,l[1][1])),S=Math.max(S,$),T=Math.max(T,M)}if(o){if(c){const $=Ai(A/N,m,v)*N;if(S=Math.max(S,$),s){let M=0;!a&&!u||a&&!u&&d?M=Jt(w+F+A/N,s[1][1])*N:M=Zt(w+F+(a?j:-j)/N,s[0][1])*N,S=Math.max(S,M)}if(l){let M=0;!a&&!u||a&&!u&&d?M=Zt(w+A/N,l[1][1])*N:M=Jt(w+(a?j:-j)/N,l[0][1])*N,S=Math.max(S,M)}}if(f){const $=Ai(R*N,x,k)/N;if(T=Math.max(T,$),s){let M=0;!a&&!u||u&&!a&&d?M=Jt(g+R*N+H,s[1][0])/N:M=Zt(g+(u?P:-P)*N+H,s[0][0])/N,T=Math.max(T,M)}if(l){let M=0;!a&&!u||u&&!a&&d?M=Zt(g+R*N,l[1][0])/N:M=Jt(g+(u?P:-P)*N,l[0][0])/N,T=Math.max(T,M)}}}P=P+(P<0?T:-T),j=j+(j<0?S:-S),o&&(d?A>R*N?P=(_f(a,u)?-j:j)/N:j=(_f(a,u)?-P:P)*N:c?(P=j/N,u=a):(j=P*N,a=u));const _=a?g+j:g,z=u?w+P:w;return{width:C+(a?-j:j),height:E+(u?-P:P),x:i[0]*j*(a?-1:1)+_,y:i[1]*P*(u?-1:1)+z}}const $g={width:0,height:0,x:0,y:0},ME={...$g,pointerX:0,pointerY:0,aspectRatio:1};function $E(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,a=n[1]*s;return[[r-l,o-a],[r+i-l,o+s-a]]}function PE({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=Xe(e);let s={controlDirection:Nf("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:c,keepAspectRatio:f,resizeDirection:d,onResizeStart:p,onResize:y,onResizeEnd:x,shouldResize:k}){let m={...$g},v={...ME};s={boundaries:c,resizeDirection:d,keepAspectRatio:f,controlDirection:Nf(u)};let g,w=null,C=[],E,N,j;const P=Om().on("start",A=>{const{nodeLookup:R,transform:H,snapGrid:F,snapToGrid:S,nodeOrigin:T,paneDomNode:_}=n();if(g=R.get(t),!g)return;w=(_==null?void 0:_.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:$}=Eo(A.sourceEvent,{transform:H,snapGrid:F,snapToGrid:S,containerBounds:w});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...m,pointerX:z,pointerY:$,aspectRatio:m.width/m.height},E=void 0,N=Jn(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(E=R.get(g.parentId)),E&&g.extent==="parent"&&(N=[[0,0],[E.measured.width,E.measured.height]]),C=[],j=void 0;for(const[M,L]of R)if(L.parentId===t&&(C.push({id:M,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const I=$E(L,g,L.origin??T);j?j=[[Math.min(I[0][0],j[0][0]),Math.min(I[0][1],j[0][1])],[Math.max(I[1][0],j[1][0]),Math.max(I[1][1],j[1][1])]]:j=I}p==null||p(A,{...m})}).on("drag",A=>{const{transform:R,snapGrid:H,snapToGrid:F,nodeOrigin:S}=n(),T=Eo(A.sourceEvent,{transform:R,snapGrid:H,snapToGrid:F,containerBounds:w}),_=[];if(!g)return;const{x:z,y:$,width:M,height:L}=m,I={},D=g.origin??S,{width:U,height:W,x:G,y:V}=jE(v,s.controlDirection,T,s.boundaries,s.keepAspectRatio,D,N,j),X=U!==M,O=W!==L,Y=G!==z&&X,q=V!==$&&O;if(!Y&&!q&&!X&&!O)return;const J={prevValues:{...m},startX:v.x,startY:v.y,childNodes:C.map(ne=>({...ne,position:{...ne.position}}))};if((Y||q||D[0]===1||D[1]===1)&&(I.x=Y?G:m.x,I.y=q?V:m.y,m.x=I.x,m.y=I.y,C.length>0)){const ne=G-z,re=V-$;for(const se of C)se.position={x:se.position.x-ne+D[0]*(U-M),y:se.position.y-re+D[1]*(W-L)},_.push(se)}if((X||O)&&(I.width=X&&(!s.resizeDirection||s.resizeDirection==="horizontal")?U:m.width,I.height=O&&(!s.resizeDirection||s.resizeDirection==="vertical")?W:m.height,m.width=I.width,m.height=I.height),E&&g.expandParent){const ne=D[0]*(I.width??0);I.x&&I.x<ne&&(m.x=ne,v.x=v.x-(I.x-ne));const re=D[1]*(I.height??0);I.y&&I.y<re&&(m.y=re,v.y=v.y-(I.y-re))}const Q=CE({width:m.width,prevWidth:M,height:m.height,prevHeight:L,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),ee={...m,direction:Q};if((k==null?void 0:k(A,ee))===!1){m=J.prevValues,v.x=J.startX,v.y=J.startY,C.forEach((ne,re)=>{ne.position=J.childNodes[re].position});return}y==null||y(A,ee),r(I,_)}).on("end",A=>{x==null||x(A,{...m}),o==null||o({...m})});i.call(P)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var Pg={exports:{}},Ig={},Tg={exports:{}},zg={};/**
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 Vr=b;function IE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var TE=typeof Object.is=="function"?Object.is:IE,zE=Vr.useState,bE=Vr.useEffect,LE=Vr.useLayoutEffect,AE=Vr.useDebugValue;function RE(e,t){var n=t(),r=zE({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return LE(function(){o.value=n,o.getSnapshot=t,na(o)&&i({inst:o})},[e,n,t]),bE(function(){return na(o)&&i({inst:o}),e(function(){na(o)&&i({inst:o})})},[e]),AE(n),n}function na(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!TE(e,n)}catch{return!0}}function DE(e,t){return t()}var OE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?DE:RE;zg.useSyncExternalStore=Vr.useSyncExternalStore!==void 0?Vr.useSyncExternalStore:OE;Tg.exports=zg;var FE=Tg.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 hl=b,HE=FE;function VE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var BE=typeof Object.is=="function"?Object.is:VE,UE=HE.useSyncExternalStore,WE=hl.useRef,YE=hl.useEffect,XE=hl.useMemo,KE=hl.useDebugValue;Ig.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=WE(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=XE(function(){function a(p){if(!u){if(u=!0,c=p,p=r(p),o!==void 0&&s.hasValue){var y=s.value;if(o(y,p))return f=y}return f=p}if(y=f,BE(c,p))return y;var x=r(p);return o!==void 0&&o(y,x)?(c=p,y):(c=p,f=x)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,o]);var l=UE(e,i[0],i[1]);return YE(function(){s.hasValue=!0,s.value=l},[l]),KE(l),l};Pg.exports=Ig;var QE=Pg.exports;const GE=ch(QE),qE={},Cf=e=>{let t;const n=new Set,r=(c,f)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(y=>y(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(qE?"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()}},u=t=e(r,o,a);return a},ZE=e=>e?Cf(e):Cf,{useDebugValue:JE}=Uy,{useSyncExternalStoreWithSelector:eN}=GE,tN=e=>e;function bg(e,t=tN,n){const r=eN(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return JE(r),r}const jf=(e,t)=>{const n=ZE(e),r=(o,i=t)=>bg(n,o,i);return Object.assign(r,n),r},nN=(e,t)=>e?jf(e,t):jf;function ye(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 pl=b.createContext(null),rN=pl.Provider,Lg=kt.error001("react");function ie(e,t){const n=b.useContext(pl);if(n===null)throw new Error(Lg);return bg(n,e,t)}function fe(){const e=b.useContext(pl);if(e===null)throw new Error(Lg);return b.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Mf={display:"none"},oN={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Ag="react-flow__node-desc",Rg="react-flow__edge-desc",iN="react-flow__aria-live",sN=e=>e.ariaLiveMessage,lN=e=>e.ariaLabelConfig;function aN({rfId:e}){const t=ie(sN);return h.jsx("div",{id:`${iN}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:oN,children:t})}function uN({rfId:e,disableKeyboardA11y:t}){const n=ie(lN);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${Ag}-${e}`,style:Mf,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${Rg}-${e}`,style:Mf,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(aN,{rfId:e})]})}const ui=b.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return h.jsx("div",{className:ke(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});ui.displayName="Panel";const $f="https://reactflow.dev?utm_source=attribution";function cN({proOptions:e,position:t="bottom-right"}){return b.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:h.jsx(ui,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${$f}`,children:h.jsx("a",{href:$f,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const dN=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}},Ri=e=>e.id;function fN(e,t){return ye(e.selectedNodes.map(Ri),t.selectedNodes.map(Ri))&&ye(e.selectedEdges.map(Ri),t.selectedEdges.map(Ri))}function hN({onSelectionChange:e}){const t=fe(),{selectedNodes:n,selectedEdges:r}=ie(dN,fN);return b.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const pN=e=>!!e.onSelectionChangeHandlers;function mN({onSelectionChange:e}){const t=ie(pN);return e||t?h.jsx(hN,{onSelectionChange:e}):null}const Dg=[0,0],gN={x:0,y:0,zoom:1},yN=["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"],Pf=[...yN,"rfId"],vN=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}),If={translateExtent:Wo,nodeOrigin:Dg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function xN(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:a}=ie(vN,ye),u=fe();b.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{c.current=If,l()}),[]);const c=b.useRef(If);return b.useEffect(()=>{for(const f of Pf){const d=e[f],p=c.current[f];d!==p&&(typeof e[f]>"u"||(f==="nodes"?t(d):f==="edges"?n(d):f==="minZoom"?r(d):f==="maxZoom"?o(d):f==="translateExtent"?i(d):f==="nodeExtent"?s(d):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:BS(d)}):f==="fitView"?u.setState({fitViewQueued:d}):f==="fitViewOptions"?u.setState({fitViewOptions:d}):u.setState({[f]:d})))}c.current=e},Pf.map(f=>e[f])),null}function Tf(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function wN(e){var r;const[t,n]=b.useState(e==="system"?null:e);return b.useEffect(()=>{if(e!=="system"){n(e);return}const o=Tf(),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=Tf())!=null&&r.matches?"dark":"light"}const zf=typeof document<"u"?document:null;function Go(e=null,t={target:zf,actInsideInputWithModifier:!0}){const[n,r]=b.useState(!1),o=b.useRef(!1),i=b.useRef(new Set([])),[s,l]=b.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace(/\+/g,`
57
- `).replace(`
58
-
59
- `,`
60
- +`).split(`
61
- `)),c=u.reduce((f,d)=>f.concat(...d),[]);return[u,c]}return[[],[]]},[e]);return b.useEffect(()=>{const a=(t==null?void 0:t.target)??zf,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const c=p=>{var k,m;if(o.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!o.current||o.current&&!u)&&pg(p))return!1;const x=Lf(p.code,l);if(i.current.add(p[x]),bf(s,i.current,!1)){const v=((m=(k=p.composedPath)==null?void 0:k.call(p))==null?void 0:m[0])||p.target,g=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(o.current||!g)&&p.preventDefault(),r(!0)}},f=p=>{const y=Lf(p.code,l);bf(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[y]),p.key==="Meta"&&i.current.clear(),o.current=!1},d=()=>{i.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function bf(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Lf(e,t){return t.includes(e)?"code":"key"}const kN=()=>{const e=fe();return b.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!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),!0):!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(),a=vc(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:a}=s.getBoundingClientRect(),u={x:t.x-l,y:t.y-a},c=n.snapGrid??o,f=n.snapToGrid??i;return ai(u,r,f,c)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=Fr(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function Og(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 a of s)SN(a,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 SN(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 EN(e,t){return Og(e,t)}function NN(e,t){return Og(e,t)}function In(e,t){return{id:e,type:"select",selected:t}}function wr(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(In(i.id,s)))}return r}function Af({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),a=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;a!==void 0&&a!==s&&n.push({id:s.id,item:s,type:"replace"}),a===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 Rf(e){return{id:e.id,type:"remove"}}const _N=ug();function CN(e,t,n={}){return QS(e,t,{...n,onError:n.onError??_N})}const Df=e=>bS(e),jN=e=>og(e);function Fg(e){return b.forwardRef(e)}const Hg=typeof window<"u"?b.useLayoutEffect:b.useEffect;function Of(e){const[t,n]=b.useState(BigInt(0)),[r]=b.useState(()=>MN(()=>n(o=>o+BigInt(1))));return Hg(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function MN(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Vg=b.createContext(null);function $N({children:e}){const t=fe(),n=b.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:c,onNodesChange:f,nodeLookup:d,fitViewQueued:p,onNodesChangeMiddlewareMap:y}=t.getState();let x=a;for(const m of l)x=typeof m=="function"?m(x):m;let k=Af({items:x,lookup:d});for(const m of y.values())k=m(k);c&&u(x),k.length>0?f==null||f(k):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:v,setNodes:g}=t.getState();m&&g(v)})},[]),r=Of(n),o=b.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:f,edgeLookup:d}=t.getState();let p=a;for(const y of l)p=typeof y=="function"?y(p):y;c?u(p):f&&f(Af({items:p,lookup:d}))},[]),i=Of(o),s=b.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return h.jsx(Vg.Provider,{value:s,children:e})}function PN(){const e=b.useContext(Vg);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const IN=e=>!!e.panZoom;function ml(){const e=kN(),t=fe(),n=PN(),r=ie(IN),o=b.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),s=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},a=f=>{var m,v;const{nodeLookup:d,nodeOrigin:p}=t.getState(),y=Df(f)?f:d.get(f.id),x=y.parentId?dg(y.position,y.measured,y.parentId,d,p):y.position,k={...y,position:x,width:((m=y.measured)==null?void 0:m.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return Ko(k)},u=(f,d,p={replace:!1})=>{s(y=>y.map(x=>{if(x.id===f){const k=typeof d=="function"?d(x):d;return p.replace&&Df(k)?k:{...x,...k}}return x}))},c=(f,d,p={replace:!1})=>{l(y=>y.map(x=>{if(x.id===f){const k=typeof d=="function"?d(x):d;return p.replace&&jN(k)?k:{...x,...k}}return x}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var d;return(d=i(f))==null?void 0:d.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(d=>({...d}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:s,setEdges:l,addNodes:f=>{const d=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...d])},addEdges:f=>{const d=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...d])},toObject:()=>{const{nodes:f=[],edges:d=[],transform:p}=t.getState(),[y,x,k]=p;return{nodes:f.map(m=>({...m})),edges:d.map(m=>({...m})),viewport:{x:y,y:x,zoom:k}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:p,edges:y,onNodesDelete:x,onEdgesDelete:k,triggerNodeChanges:m,triggerEdgeChanges:v,onDelete:g,onBeforeDelete:w}=t.getState(),{nodes:C,edges:E}=await OS({nodesToRemove:f,edgesToRemove:d,nodes:p,edges:y,onBeforeDelete:w}),N=E.length>0,j=C.length>0;if(N){const P=E.map(Rf);k==null||k(E),v(P)}if(j){const P=C.map(Rf);x==null||x(C),m(P)}return(j||N)&&(g==null||g({nodes:C,edges:E})),{deletedNodes:C,deletedEdges:E}},getIntersectingNodes:(f,d=!0,p)=>{const y=hf(f),x=y?f:a(f),k=p!==void 0;return x?(p||t.getState().nodes).filter(m=>{const v=t.getState().nodeLookup.get(m.id);if(v&&!y&&(m.id===f.id||!v.internals.positionAbsolute))return!1;const g=Ko(k?m:v),w=As(g,x);return d&&w>0||w>=g.width*g.height||w>=x.width*x.height}):[]},isNodeIntersecting:(f,d,p=!0)=>{const x=hf(f)?f:a(f);if(!x)return!1;const k=As(x,d);return p&&k>0||k>=d.width*d.height||k>=x.width*x.height},updateNode:u,updateNodeData:(f,d,p={replace:!1})=>{u(f,y=>{const x=typeof d=="function"?d(y):d;return p.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},p)},updateEdge:c,updateEdgeData:(f,d,p={replace:!1})=>{c(f,y=>{const x=typeof d=="function"?d(y):d;return p.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},p)},getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:p}=t.getState();return LS(f,{nodeLookup:d,nodeOrigin:p})},getHandleConnections:({type:f,id:d,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}-${f}${d?`-${d}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:f,handleId:d,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}${f?d?`-${f}-${d}`:`-${f}`:""}`))==null?void 0:y.values())??[])},fitView:async f=>{const d=t.getState().fitViewResolver??VS();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:d}),n.nodeQueue.push(p=>[...p]),d.promise}}},[]);return b.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const Ff=e=>e.selected,TN=typeof window<"u"?window:void 0;function zN({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=fe(),{deleteElements:r}=ml(),o=Go(e,{actInsideInputWithModifier:!1}),i=Go(t,{target:TN});b.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(Ff),edges:s.filter(Ff)}),n.setState({nodesSelectionActive:!1})}},[o]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function bN(e){const t=fe();b.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=xc(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 gl={position:"absolute",width:"100%",height:"100%",top:0,left:0},LN=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function AN({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:o,panOnScrollSpeed:i=.5,panOnScrollMode:s=Hn.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:f,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:y=!0,children:x,noWheelClassName:k,noPanClassName:m,onViewportChange:v,isControlledViewport:g,paneClickDistance:w,selectionOnDrag:C}){const E=fe(),N=b.useRef(null),{userSelectionActive:j,lib:P,connectionInProgress:A}=ie(LN,ye),R=Go(p),H=b.useRef();bN(N);const F=b.useCallback(S=>{v==null||v({x:S[0],y:S[1],zoom:S[2]}),g||E.setState({transform:S})},[v,g]);return b.useEffect(()=>{if(N.current){H.current=_E({domNode:N.current,minZoom:f,maxZoom:d,translateExtent:c,viewport:u,onDraggingChange:z=>E.setState($=>$.paneDragging===z?$:{paneDragging:z}),onPanZoomStart:(z,$)=>{const{onViewportChangeStart:M,onMoveStart:L}=E.getState();L==null||L(z,$),M==null||M($)},onPanZoom:(z,$)=>{const{onViewportChange:M,onMove:L}=E.getState();L==null||L(z,$),M==null||M($)},onPanZoomEnd:(z,$)=>{const{onViewportChangeEnd:M,onMoveEnd:L}=E.getState();L==null||L(z,$),M==null||M($)}});const{x:S,y:T,zoom:_}=H.current.getViewport();return E.setState({panZoom:H.current,transform:[S,T,_],domNode:N.current.closest(".react-flow")}),()=>{var z;(z=H.current)==null||z.destroy()}}},[]),b.useEffect(()=>{var S;(S=H.current)==null||S.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:o,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:R,preventScrolling:y,noPanClassName:m,userSelectionActive:j,noWheelClassName:k,lib:P,onTransformChange:F,connectionInProgress:A,selectionOnDrag:C,paneClickDistance:w})},[e,t,n,r,o,i,s,l,a,R,y,m,j,k,P,F,A,C,w]),h.jsx("div",{className:"react-flow__renderer",ref:N,style:gl,children:x})}const RN=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function DN(){const{userSelectionActive:e,userSelectionRect:t}=ie(RN,ye);return e&&t?h.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 ra=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},ON=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function FN({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Yo.Full,panOnDrag:r,autoPanOnSelection:o,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:p,onPaneMouseLeave:y,children:x}){const k=b.useRef(0),m=fe(),{userSelectionActive:v,elementsSelectable:g,dragging:w,panBy:C,autoPanSpeed:E}=ie(ON,ye),N=g&&(e||v),j=b.useRef(null),P=b.useRef(),A=b.useRef(new Set),R=b.useRef(new Set),H=b.useRef(!1),F=b.useRef(!1),S=b.useRef({x:0,y:0}),T=b.useRef(!1),_=O=>{if(F.current||H.current||m.getState().connection.inProgress){F.current=!1,H.current=!1;return}u==null||u(O),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},z=O=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){O.preventDefault();return}c==null||c(O)},$=f?O=>f(O):void 0,M=O=>{F.current&&(O.stopPropagation(),F.current=!1)},L=O=>{var se,Ne;if(O.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:Y,transform:q}=m.getState();if(P.current=Y==null?void 0:Y.getBoundingClientRect(),!P.current)return;const J=O.target===j.current;if(!J&&!!O.target.closest(".nokey")||!e||!(s&&J||t)||O.button!==0||!O.isPrimary)return;(Ne=(se=O.target)==null?void 0:se.setPointerCapture)==null||Ne.call(se,O.pointerId),F.current=!1;const{x:te,y:ne}=yt(O.nativeEvent,P.current),re=ai({x:te,y:ne},q);m.setState({userSelectionRect:{width:0,height:0,startX:re.x,startY:re.y,x:te,y:ne}}),J||(O.stopPropagation(),O.preventDefault())};function I(O,Y){const{userSelectionRect:q}=m.getState();if(!q)return;const{transform:J,nodeLookup:Q,edgeLookup:ee,connectionLookup:te,triggerNodeChanges:ne,triggerEdgeChanges:re,defaultEdgeOptions:se}=m.getState(),Ne={x:q.startX,y:q.startY},{x:be,y:et}=Fr(Ne,J),zt={startX:Ne.x,startY:Ne.y,x:O<be?O:be,y:Y<et?Y:et,width:Math.abs(O-be),height:Math.abs(Y-et)},Kr=A.current,Cn=R.current;A.current=new Set(gc(Q,zt,J,n===Yo.Partial,!0).map(at=>at.id)),R.current=new Set;const jn=(se==null?void 0:se.selectable)??!0;for(const at of A.current){const bt=te.get(at);if(bt)for(const{edgeId:Lt}of bt.values()){const Mn=ee.get(Lt);Mn&&(Mn.selectable??jn)&&R.current.add(Lt)}}if(!pf(Kr,A.current)){const at=wr(Q,A.current,!0);ne(at)}if(!pf(Cn,R.current)){const at=wr(ee,R.current);re(at)}m.setState({userSelectionRect:zt,userSelectionActive:!0,nodesSelectionActive:!1})}function D(){if(!o||!P.current)return;const[O,Y]=yc(S.current,P.current,E);C({x:O,y:Y}).then(q=>{if(!F.current||!q){k.current=requestAnimationFrame(D);return}const{x:J,y:Q}=S.current;I(J,Q),k.current=requestAnimationFrame(D)})}const U=()=>{cancelAnimationFrame(k.current),k.current=0,T.current=!1};b.useEffect(()=>()=>U(),[]);const W=O=>{const{userSelectionRect:Y,transform:q,resetSelectedElements:J}=m.getState();if(!P.current||!Y)return;const{x:Q,y:ee}=yt(O.nativeEvent,P.current);S.current={x:Q,y:ee};const te=Fr({x:Y.startX,y:Y.startY},q);if(!F.current){const ne=t?0:i;if(Math.hypot(Q-te.x,ee-te.y)<=ne)return;J(),l==null||l(O)}F.current=!0,T.current||(D(),T.current=!0),I(Q,ee)},G=O=>{var Y,q;if(!N){O.target===j.current&&m.getState().connection.inProgress&&(H.current=!0);return}O.button===0&&((q=(Y=O.target)==null?void 0:Y.releasePointerCapture)==null||q.call(Y,O.pointerId),!v&&O.target===j.current&&m.getState().userSelectionRect&&(_==null||_(O)),m.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(a==null||a(O),m.setState({nodesSelectionActive:A.current.size>0})),U())},V=O=>{var Y,q;(q=(Y=O.target)==null?void 0:Y.releasePointerCapture)==null||q.call(Y,O.pointerId),U()},X=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:ke(["react-flow__pane",{draggable:X,dragging:w,selection:e}]),onClick:N?void 0:ra(_,j),onContextMenu:ra(z,j),onWheel:ra($,j),onPointerEnter:N?void 0:d,onPointerMove:N?W:p,onPointerUp:G,onPointerCancel:N?V:void 0,onPointerDownCapture:N?L:void 0,onClickCapture:N?M:void 0,onPointerLeave:y,ref:j,style:gl,children:[x,h.jsx(DN,{})]})}function cu({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:l,onError:a}=t.getState(),u=l.get(e);if(!u){a==null||a("012",kt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):o([e])}function Bg({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=fe(),[a,u]=b.useState(!1),c=b.useRef();return b.useEffect(()=>{if(!t)return c.current=dE({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{cu({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var f;(f=c.current)==null||f.destroy(),c.current=void 0}},[t,l,e]),b.useEffect(()=>{t||!e.current||!c.current||c.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s})},[n,r,t,i,e,o,s]),a}const HN=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Ug(){const e=fe();return b.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:c}=e.getState(),f=new Map,d=HN(s),p=o?i[0]:5,y=o?i[1]:5,x=n.direction.x*p*n.factor,k=n.direction.y*y*n.factor;for(const[,m]of u){if(!d(m))continue;let v={x:m.internals.positionAbsolute.x+x,y:m.internals.positionAbsolute.y+k};o&&(v=li(v,i));const{position:g,positionAbsolute:w}=ig({nodeId:m.id,nextPosition:v,nodeLookup:u,nodeExtent:r,nodeOrigin:c,onError:l});m.position=g,m.internals.positionAbsolute=w,f.set(m.id,m)}a(f)},[])}const Cc=b.createContext(null),VN=Cc.Provider;Cc.Consumer;const Wg=()=>b.useContext(Cc),BN=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Yg=b.createContext(null);function UN({children:e}){const t=ie(BN,ye);return h.jsx(Yg.Provider,{value:t,children:e})}function WN(){const e=b.useContext(Yg);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const YN={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},XN=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:a,isValid:u}=s;if(!l&&!o)return YN;const c=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.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:c,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===Dr.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:c&&u}};function KN({type:e="source",position:t=Z.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:c,onTouchStart:f,...d},p){var T,_;const y=s||null,x=e==="target",k=fe(),m=Wg(),{connectOnClick:v,noPanClassName:g,rfId:w}=WN(),{connectingFrom:C,connectingTo:E,clickConnecting:N,isPossibleEndHandle:j,connectionInProcess:P,clickConnectionInProcess:A,valid:R}=ie(XN(m,y,e),ye);m||(_=(T=k.getState()).onError)==null||_.call(T,"010",kt.error010());const H=z=>{const{defaultEdgeOptions:$,onConnect:M,hasDefaultEdges:L}=k.getState(),I={...$,...z};if(L){const{edges:D,setEdges:U,onError:W}=k.getState();U(CN(I,D,{onError:W}))}M==null||M(I),l==null||l(I)},F=z=>{if(!m)return;const $=mg(z.nativeEvent);if(o&&($&&z.button===0||!$)){const M=k.getState();uu.onPointerDown(z.nativeEvent,{handleDomNode:z.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:x,handleId:y,nodeId:m,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...L)=>{var I,D;return(D=(I=k.getState()).onConnectEnd)==null?void 0:D.call(I,...L)},updateConnection:M.updateConnection,onConnect:H,isValidConnection:n||((...L)=>{var I,D;return((D=(I=k.getState()).isValidConnection)==null?void 0:D.call(I,...L))??!0}),getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}$?c==null||c(z):f==null||f(z)},S=z=>{const{onClickConnectStart:$,onClickConnectEnd:M,connectionClickStartHandle:L,connectionMode:I,isValidConnection:D,lib:U,rfId:W,nodeLookup:G,connection:V}=k.getState();if(!m||!L&&!o)return;if(!L){$==null||$(z.nativeEvent,{nodeId:m,handleId:y,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:m,type:e,id:y}});return}const X=hg(z.target),O=n||D,{connection:Y,isValid:q}=uu.isValid(z.nativeEvent,{handle:{nodeId:m,id:y,type:e},connectionMode:I,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:O,flowId:W,doc:X,lib:U,nodeLookup:G});q&&Y&&H(Y);const J=structuredClone(V);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,M==null||M(z,J),k.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":y,"data-nodeid":m,"data-handlepos":t,"data-id":`${w}-${m}-${y}-${e}`,className:ke(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!x,target:x,connectable:r,connectablestart:o,connectableend:i,clickconnecting:N,connectingfrom:C,connectingto:E,valid:R,connectionindicator:r&&(!P||j)&&(P||A?i:o)}]),onMouseDown:F,onTouchStart:F,onClick:v?S:void 0,ref:p,...d,children:a})}const Br=b.memo(Fg(KN));function QN({data:e,isConnectable:t,sourcePosition:n=Z.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Br,{type:"source",position:n,isConnectable:t})]})}function GN({data:e,isConnectable:t,targetPosition:n=Z.Top,sourcePosition:r=Z.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Br,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Br,{type:"source",position:r,isConnectable:t})]})}function qN(){return null}function ZN({data:e,isConnectable:t,targetPosition:n=Z.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Br,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ds={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Hf={input:QN,default:GN,output:ZN,group:qN};function JN(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 e_=e=>{const{width:t,height:n,x:r,y:o}=si(e.nodeLookup,{filter:i=>!!i.selected});return{width:gt(t)?t:null,height:gt(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 t_({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=fe(),{width:o,height:i,transformString:s,userSelectionActive:l}=ie(e_,ye),a=Ug(),u=b.useRef(null);b.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const c=!l&&o!==null&&i!==null;if(Bg({nodeRef:u,disabled:!c}),!c)return null;const f=e?p=>{const y=r.getState().nodes.filter(x=>x.selected);e(p,y)}:void 0,d=p=>{Object.prototype.hasOwnProperty.call(Ds,p.key)&&(p.preventDefault(),a({direction:Ds[p.key],factor:p.shiftKey?4:1}))};return h.jsx("div",{className:ke(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:h.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:o,height:i}})})}const Vf=typeof window<"u"?window:void 0,n_=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Xg({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:c,selectionMode:f,onSelectionStart:d,onSelectionEnd:p,multiSelectionKeyCode:y,panActivationKeyCode:x,zoomActivationKeyCode:k,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:w,panOnScrollSpeed:C,panOnScrollMode:E,zoomOnDoubleClick:N,panOnDrag:j,autoPanOnSelection:P,defaultViewport:A,translateExtent:R,minZoom:H,maxZoom:F,preventScrolling:S,onSelectionContextMenu:T,noWheelClassName:_,noPanClassName:z,disableKeyboardA11y:$,onViewportChange:M,isControlledViewport:L}){const{nodesSelectionActive:I,userSelectionActive:D}=ie(n_,ye),U=Go(u,{target:Vf}),W=Go(x,{target:Vf}),G=W||j,V=W||w,X=c&&G!==!0,O=U||D||X;return zN({deleteKeyCode:a,multiSelectionKeyCode:y}),h.jsx(AN,{onPaneContextMenu:i,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:V,panActivationKeyPressed:W,panOnScrollSpeed:C,panOnScrollMode:E,zoomOnDoubleClick:N,panOnDrag:!U&&G,defaultViewport:A,translateExtent:R,minZoom:H,maxZoom:F,zoomActivationKeyCode:k,preventScrolling:S,noWheelClassName:_,noPanClassName:z,onViewportChange:M,isControlledViewport:L,paneClickDistance:l,selectionOnDrag:X,children:h.jsxs(FN,{onSelectionStart:d,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:G,autoPanOnSelection:P,isSelecting:!!O,selectionMode:f,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:X,children:[e,I&&h.jsx(t_,{onSelectionContextMenu:T,noPanClassName:z,disableKeyboardA11y:$})]})})}Xg.displayName="FlowRenderer";const r_=b.memo(Xg),o_=e=>t=>e?gc(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 i_(e){return ie(b.useCallback(o_(e),[e]),ye)}const s_=e=>e.updateNodeInternals;function l_(){const e=ie(s_),[t]=b.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 b.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function a_({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=fe(),i=b.useRef(null),s=b.useRef(null),l=b.useRef(e.sourcePosition),a=b.useRef(e.targetPosition),u=b.useRef(t),c=n&&!!e.internals.handleBounds;return b.useEffect(()=>{i.current&&!e.hidden&&(!c||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[c,e.hidden]),b.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),b.useEffect(()=>{if(i.current){const f=u.current!==t,d=l.current!==e.sourcePosition,p=a.current!==e.targetPosition;(f||d||p)&&(u.current=t,l.current=e.sourcePosition,a.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 u_({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:c,resizeObserver:f,noDragClassName:d,noPanClassName:p,disableKeyboardA11y:y,rfId:x,nodeTypes:k,nodeClickDistance:m,onError:v}){const{node:g,internals:w,isParent:C}=ie(O=>{const Y=O.nodeLookup.get(e),q=O.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:q}},ye);let E=g.type||"default",N=(k==null?void 0:k[E])||Hf[E];N===void 0&&(v==null||v("003",kt.error003(E)),E="default",N=(k==null?void 0:k.default)||Hf.default);const j=!!(g.draggable||l&&typeof g.draggable>"u"),P=!!(g.selectable||a&&typeof g.selectable>"u"),A=!!(g.connectable||u&&typeof g.connectable>"u"),R=!!(g.focusable||c&&typeof g.focusable>"u"),H=fe(),F=cg(g),S=a_({node:g,nodeType:E,hasDimensions:F,resizeObserver:f}),T=Bg({nodeRef:S,disabled:g.hidden||!j,noDragClassName:d,handleSelector:g.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:m}),_=Ug();if(g.hidden)return null;const z=Et(g),$=JN(g),M=P||j||t||n||r||o,L=n?O=>n(O,{...w.userNode}):void 0,I=r?O=>r(O,{...w.userNode}):void 0,D=o?O=>o(O,{...w.userNode}):void 0,U=i?O=>i(O,{...w.userNode}):void 0,W=s?O=>s(O,{...w.userNode}):void 0,G=O=>{const{selectNodesOnDrag:Y,nodeDragThreshold:q}=H.getState();P&&(!Y||!j||q>0)&&cu({id:e,store:H,nodeRef:S}),t&&t(O,{...w.userNode})},V=O=>{if(!(pg(O.nativeEvent)||y)){if(tg.includes(O.key)&&P){const Y=O.key==="Escape";cu({id:e,store:H,unselect:Y,nodeRef:S})}else if(j&&g.selected&&Object.prototype.hasOwnProperty.call(Ds,O.key)){O.preventDefault();const{ariaLabelConfig:Y}=H.getState();H.setState({ariaLiveMessage:Y["node.a11yDescription.ariaLiveMessage"]({direction:O.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),_({direction:Ds[O.key],factor:O.shiftKey?4:1})}}},X=()=>{var te;if(y||!((te=S.current)!=null&&te.matches(":focus-visible")))return;const{transform:O,width:Y,height:q,autoPanOnNodeFocus:J,setCenter:Q}=H.getState();if(!J)return;gc(new Map([[e,g]]),{x:0,y:0,width:Y,height:q},O,!0).length>0||Q(g.position.x+z.width/2,g.position.y+z.height/2,{zoom:O[2]})};return h.jsx("div",{className:ke(["react-flow__node",`react-flow__node-${E}`,{[p]:j},g.className,{selected:g.selected,selectable:P,parent:C,draggable:j,dragging:T}]),ref:S,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:F?"visible":"hidden",...g.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:I,onMouseLeave:D,onContextMenu:U,onClick:G,onDoubleClick:W,onKeyDown:R?V:void 0,tabIndex:R?0:void 0,onFocus:R?X:void 0,role:g.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${Ag}-${x}`,"aria-label":g.ariaLabel,...g.domAttributes,children:h.jsx(VN,{value:e,children:h.jsx(N,{id:e,data:g.data,type:E,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:g.selected??!1,selectable:P,draggable:j,deletable:g.deletable??!0,isConnectable:A,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:T,dragHandle:g.dragHandle,zIndex:w.z,parentId:g.parentId,...z})})})}var c_=b.memo(u_);const d_=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Kg(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:o}=ie(d_,ye),i=i_(e.onlyRenderVisibleElements),s=l_();return h.jsx("div",{className:"react-flow__nodes",style:gl,children:i.map(l=>h.jsx(c_,{id:l,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:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:o},l))})}Kg.displayName="NodeRenderer";const f_=b.memo(Kg);function h_(e){return ie(b.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&&YS({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),ye)}const p_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},m_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Bf={[Xo.Arrow]:p_,[Xo.ArrowClosed]:m_};function g_(e){const t=fe();return b.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Bf,e)?Bf[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",kt.error009(e)),null)},[e])}const y_=({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 a=g_(t);return a?h.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:h.jsx(a,{color:n,strokeWidth:s})}):null},Qg=({defaultColor:e,rfId:t})=>{const n=ie(i=>i.edges),r=ie(i=>i.defaultEdgeOptions),o=b.useMemo(()=>eE(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?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:o.map(i=>h.jsx(y_,{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};Qg.displayName="MarkerDefinitions";var v_=b.memo(Qg);function Gg({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...c}){const[f,d]=b.useState({x:1,y:0,width:0,height:0}),p=ke(["react-flow__edge-textwrapper",u]),y=b.useRef(null);return b.useEffect(()=>{if(y.current){const x=y.current.getBBox();d({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...c,children:[o&&h.jsx("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]}):null}Gg.displayName="EdgeText";const x_=b.memo(Gg);function ci({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...c}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...c,d:e,fill:"none",className:ke(["react-flow__edge-path",c.className])}),u?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&gt(t)&&gt(n)?h.jsx(x_,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Uf({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===Z.Left||e===Z.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function qg({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:o,targetPosition:i=Z.Top}){const[s,l]=Uf({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=Uf({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,f,d,p]=gg({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,c,f,d,p]}function Zg(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:m})=>{const[v,g,w]=qg({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),C=e.isInternal?void 0:t;return h.jsx(ci,{id:C,path:v,labelX:g,labelY:w,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:m})})}const w_=Zg({isInternal:!1}),Jg=Zg({isInternal:!0});w_.displayName="SimpleBezierEdge";Jg.displayName="SimpleBezierEdgeInternal";function e0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,sourcePosition:p=Z.Bottom,targetPosition:y=Z.Top,markerEnd:x,markerStart:k,pathOptions:m,interactionWidth:v})=>{const[g,w,C]=Rs({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:i,targetPosition:y,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),E=e.isInternal?void 0:t;return h.jsx(ci,{id:E,path:g,labelX:w,labelY:C,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:x,markerStart:k,interactionWidth:v})})}const t0=e0({isInternal:!1}),n0=e0({isInternal:!0});t0.displayName="SmoothStepEdge";n0.displayName="SmoothStepEdgeInternal";function r0(e){return b.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return h.jsx(t0,{...n,id:r,pathOptions:b.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const k_=r0({isInternal:!1}),o0=r0({isInternal:!0});k_.displayName="StepEdge";o0.displayName="StepEdgeInternal";function i0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:p,markerStart:y,interactionWidth:x})=>{const[k,m,v]=vg({sourceX:n,sourceY:r,targetX:o,targetY:i}),g=e.isInternal?void 0:t;return h.jsx(ci,{id:g,path:k,labelX:m,labelY:v,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:p,markerStart:y,interactionWidth:x})})}const S_=i0({isInternal:!1}),s0=i0({isInternal:!0});S_.displayName="StraightEdge";s0.displayName="StraightEdgeInternal";function l0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=Z.Bottom,targetPosition:l=Z.Top,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,pathOptions:m,interactionWidth:v})=>{const[g,w,C]=wc({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:m==null?void 0:m.curvature}),E=e.isInternal?void 0:t;return h.jsx(ci,{id:E,path:g,labelX:w,labelY:C,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:v})})}const E_=l0({isInternal:!1}),a0=l0({isInternal:!0});E_.displayName="BezierEdge";a0.displayName="BezierEdgeInternal";const Wf={default:a0,straight:s0,step:o0,smoothstep:n0,simplebezier:Jg},Yf={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},N_=(e,t,n)=>n===Z.Left?e-t:n===Z.Right?e+t:e,__=(e,t,n)=>n===Z.Top?e-t:n===Z.Bottom?e+t:e,Xf="react-flow__edgeupdater";function Kf({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return h.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:ke([Xf,`${Xf}-${l}`]),cx:N_(t,r,e),cy:__(n,r,e),r,stroke:"transparent",fill:"transparent"})}function C_({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:c,onReconnectEnd:f,setReconnecting:d,setUpdateHover:p}){const y=fe(),x=(w,C)=>{if(w.button!==0)return;const{autoPanOnConnect:E,domNode:N,connectionMode:j,connectionRadius:P,lib:A,onConnectStart:R,cancelConnection:H,nodeLookup:F,rfId:S,panBy:T,updateConnection:_}=y.getState(),z=C.type==="target",$=(I,D)=>{d(!1),f==null||f(I,n,C.type,D)},M=I=>u==null?void 0:u(n,I),L=(I,D)=>{d(!0),c==null||c(w,n,C.type),R==null||R(I,D)};uu.onPointerDown(w.nativeEvent,{autoPanOnConnect:E,connectionMode:j,connectionRadius:P,domNode:N,handleId:C.id,nodeId:C.nodeId,nodeLookup:F,isTarget:z,edgeUpdaterType:C.type,lib:A,flowId:S,cancelConnection:H,panBy:T,isValidConnection:(...I)=>{var D,U;return((U=(D=y.getState()).isValidConnection)==null?void 0:U.call(D,...I))??!0},onConnect:M,onConnectStart:L,onConnectEnd:(...I)=>{var D,U;return(U=(D=y.getState()).onConnectEnd)==null?void 0:U.call(D,...I)},onReconnectEnd:$,updateConnection:_,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},k=w=>x(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=w=>x(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>p(!0),g=()=>p(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(Kf,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:k,onMouseEnter:v,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&h.jsx(Kf,{position:a,centerX:i,centerY:s,radius:t,onMouseDown:m,onMouseEnter:v,onMouseOut:g,type:"target"})]})}function j_({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:c,onReconnect:f,onReconnectStart:d,onReconnectEnd:p,rfId:y,edgeTypes:x,noPanClassName:k,onError:m,disableKeyboardA11y:v}){let g=ie(Q=>Q.edgeLookup.get(e));const w=ie(Q=>Q.defaultEdgeOptions);g=w?{...w,...g}:g;let C=g.type||"default",E=(x==null?void 0:x[C])||Wf[C];E===void 0&&(m==null||m("011",kt.error011(C)),C="default",E=(x==null?void 0:x.default)||Wf.default);const N=!!(g.focusable||t&&typeof g.focusable>"u"),j=typeof f<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),P=!!(g.selectable||r&&typeof g.selectable>"u"),A=b.useRef(null),[R,H]=b.useState(!1),[F,S]=b.useState(!1),T=fe(),{zIndex:_=g.zIndex,sourceX:z,sourceY:$,targetX:M,targetY:L,sourcePosition:I,targetPosition:D}=ie(b.useCallback(Q=>{const ee=Q.nodeLookup.get(g.source),te=Q.nodeLookup.get(g.target);if(!ee||!te)return Yf;const ne=JS({id:e,sourceNode:ee,targetNode:te,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:Q.connectionMode,onError:m}),re=WS({selected:g.selected,zIndex:g.zIndex,sourceNode:ee,targetNode:te,elevateOnSelect:Q.elevateEdgesOnSelect,zIndexMode:Q.zIndexMode});return{...ne||Yf,zIndex:re}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex,m]),ye),U=b.useMemo(()=>g.markerStart?`url('#${lu(g.markerStart,y)}')`:void 0,[g.markerStart,y]),W=b.useMemo(()=>g.markerEnd?`url('#${lu(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||z===null||$===null||M===null||L===null)return null;const G=Q=>{var re;const{addSelectedEdges:ee,unselectNodesAndEdges:te,multiSelectionActive:ne}=T.getState();P&&(T.setState({nodesSelectionActive:!1}),g.selected&&ne?(te({nodes:[],edges:[g]}),(re=A.current)==null||re.blur()):ee([e])),o&&o(Q,g)},V=i?Q=>{i(Q,{...g})}:void 0,X=s?Q=>{s(Q,{...g})}:void 0,O=l?Q=>{l(Q,{...g})}:void 0,Y=a?Q=>{a(Q,{...g})}:void 0,q=u?Q=>{u(Q,{...g})}:void 0,J=Q=>{var ee;if(!v&&tg.includes(Q.key)&&P){const{unselectNodesAndEdges:te,addSelectedEdges:ne}=T.getState();Q.key==="Escape"?((ee=A.current)==null||ee.blur(),te({edges:[g]})):ne([e])}};return h.jsx("svg",{style:{zIndex:_},children:h.jsxs("g",{className:ke(["react-flow__edge",`react-flow__edge-${C}`,g.className,k,{selected:g.selected,animated:g.animated,inactive:!P&&!o,updating:R,selectable:P}]),onClick:G,onDoubleClick:V,onContextMenu:X,onMouseEnter:O,onMouseMove:Y,onMouseLeave:q,onKeyDown:N?J:void 0,tabIndex:N?0:void 0,role:g.ariaRole??(N?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":N?`${Rg}-${y}`:void 0,ref:A,...g.domAttributes,children:[!F&&h.jsx(E,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:P,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:z,sourceY:$,targetX:M,targetY:L,sourcePosition:I,targetPosition:D,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:U,markerEnd:W,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),j&&h.jsx(C_,{edge:g,isReconnectable:j,reconnectRadius:c,onReconnect:f,onReconnectStart:d,onReconnectEnd:p,sourceX:z,sourceY:$,targetX:M,targetY:L,sourcePosition:I,targetPosition:D,setUpdateHover:H,setReconnecting:S})]})})}var M_=b.memo(j_);const $_=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function u0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:p,onReconnectEnd:y,disableKeyboardA11y:x}){const{edgesFocusable:k,edgesReconnectable:m,elementsSelectable:v,onError:g}=ie($_,ye),w=h_(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(v_,{defaultColor:e,rfId:n}),w.map(C=>h.jsx(M_,{id:C,edgesFocusable:k,edgesReconnectable:m,elementsSelectable:v,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:c,reconnectRadius:f,onDoubleClick:d,onReconnectStart:p,onReconnectEnd:y,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:x},C))]})}u0.displayName="EdgeRenderer";const P_=b.memo(u0),Qf=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function I_({children:e}){const t=fe(),n=b.useRef(null),[r]=b.useState(()=>t.getState().transform);return Hg(()=>{let o=null;const i=()=>{const s=t.getState().transform;o&&s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]||(o=s,n.current&&(n.current.style.transform=Qf(s)))};return i(),t.subscribe(i)},[t]),h.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Qf(r)},children:e})}function T_(e){const t=ml(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const z_=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function b_(e){const t=ie(z_),n=fe();return b.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function L_(e){return e.connection.inProgress?{...e.connection,to:ai(e.connection.to,e.transform)}:{...e.connection}}function A_(e){return L_}function R_(e){const t=A_();return ie(t,ye)}const D_=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function O_({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:a}=ie(D_,ye);return!(i&&o&&a)?null:h.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:ke(["react-flow__connection",fg(l)]),children:h.jsx(c0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const c0=({style:e,type:t=ln.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:a,to:u,toNode:c,toHandle:f,toPosition:d,pointer:p}=R_();if(!o)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:d,connectionStatus:fg(r),toNode:c,toHandle:f,pointer:p});let y="";const x={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:d};switch(t){case ln.Bezier:[y]=wc(x);break;case ln.SimpleBezier:[y]=qg(x);break;case ln.Step:[y]=Rs({...x,borderRadius:0});break;case ln.SmoothStep:[y]=Rs(x);break;default:[y]=vg(x)}return h.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};c0.displayName="ConnectionLine";const F_={};function Gf(e=F_){b.useRef(e),fe(),b.useEffect(()=>{},[e])}function H_(){fe(),b.useRef(!1),b.useEffect(()=>{},[])}function d0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:p,connectionLineType:y,connectionLineStyle:x,connectionLineComponent:k,connectionLineContainerStyle:m,selectionKeyCode:v,selectionOnDrag:g,selectionMode:w,multiSelectionKeyCode:C,panActivationKeyCode:E,zoomActivationKeyCode:N,deleteKeyCode:j,onlyRenderVisibleElements:P,elementsSelectable:A,defaultViewport:R,translateExtent:H,minZoom:F,maxZoom:S,preventScrolling:T,defaultMarkerColor:_,zoomOnScroll:z,zoomOnPinch:$,panOnScroll:M,panOnScrollSpeed:L,panOnScrollMode:I,zoomOnDoubleClick:D,panOnDrag:U,autoPanOnSelection:W,onPaneClick:G,onPaneMouseEnter:V,onPaneMouseMove:X,onPaneMouseLeave:O,onPaneScroll:Y,onPaneContextMenu:q,paneClickDistance:J,nodeClickDistance:Q,onEdgeContextMenu:ee,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:se,onReconnect:Ne,onReconnectStart:be,onReconnectEnd:et,noDragClassName:zt,noWheelClassName:Kr,noPanClassName:Cn,disableKeyboardA11y:jn,nodeExtent:at,rfId:bt,viewport:Lt,onViewportChange:Mn,nodesDraggable:wl}){return Gf(e),Gf(t),H_(),T_(n),b_(Lt),h.jsx(r_,{onPaneClick:G,onPaneMouseEnter:V,onPaneMouseMove:X,onPaneMouseLeave:O,onPaneContextMenu:q,onPaneScroll:Y,paneClickDistance:J,deleteKeyCode:j,selectionKeyCode:v,selectionOnDrag:g,selectionMode:w,onSelectionStart:d,onSelectionEnd:p,multiSelectionKeyCode:C,panActivationKeyCode:E,zoomActivationKeyCode:N,elementsSelectable:A,zoomOnScroll:z,zoomOnPinch:$,zoomOnDoubleClick:D,panOnScroll:M,panOnScrollSpeed:L,panOnScrollMode:I,panOnDrag:U,autoPanOnSelection:W,defaultViewport:R,translateExtent:H,minZoom:F,maxZoom:S,onSelectionContextMenu:f,preventScrolling:T,noDragClassName:zt,noWheelClassName:Kr,noPanClassName:Cn,disableKeyboardA11y:jn,onViewportChange:Mn,isControlledViewport:!!Lt,children:h.jsxs(I_,{children:[h.jsx(P_,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:Ne,onReconnectStart:be,onReconnectEnd:et,onlyRenderVisibleElements:P,onEdgeContextMenu:ee,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:se,defaultMarkerColor:_,noPanClassName:Cn,disableKeyboardA11y:jn,rfId:bt}),h.jsx(O_,{style:x,type:y,component:k,containerStyle:m}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(f_,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:Q,onlyRenderVisibleElements:P,noPanClassName:Cn,noDragClassName:zt,disableKeyboardA11y:jn,nodeExtent:at,rfId:bt,nodesDraggable:wl}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}d0.displayName="GraphView";const V_=b.memo(d0),B_=ug(),qf=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a=.5,maxZoom:u=2,nodeOrigin:c,nodeExtent:f,zIndexMode:d="basic"}={})=>{const p=new Map,y=new Map,x=new Map,k=new Map,m=r??t??[],v=n??e??[],g=c??[0,0],w=f??Wo;kg(x,k,m);const{nodesInitialized:C}=au(v,p,y,{nodeOrigin:g,nodeExtent:w,zIndexMode:d});let E=[0,0,1];if(s&&o&&i){const N=si(p,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:j,y:P,zoom:A}=vc(N,o,i,a,u,(l==null?void 0:l.padding)??.1);E=[j,P,A]}return{rfId:"1",width:o??0,height:i??0,transform:E,nodes:v,nodesInitialized:C,nodeLookup:p,parentLookup:y,edges:m,edgeLookup:k,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:Wo,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Dr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,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:{...rg},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:B_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:ng,zIndexMode:d,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},U_=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:f,zIndexMode:d})=>nN((p,y)=>{async function x(){const{nodeLookup:k,panZoom:m,fitViewOptions:v,fitViewResolver:g,width:w,height:C,minZoom:E,maxZoom:N}=y();m&&(await DS({nodes:k,width:w,height:C,panZoom:m,minZoom:E,maxZoom:N},v),g==null||g.resolve(!0),p({fitViewResolver:null}))}return{...qf({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:d}),setNodes:k=>{const{nodeLookup:m,parentLookup:v,nodeOrigin:g,nodeExtent:w,elevateNodesOnSelect:C,fitViewQueued:E,zIndexMode:N,nodesSelectionActive:j}=y(),{nodesInitialized:P,hasSelectedNodes:A}=au(k,m,v,{nodeOrigin:g,nodeExtent:w,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),R=j&&A;E&&P?(x(),p({nodes:k,nodesInitialized:P,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:R})):p({nodes:k,nodesInitialized:P,nodesSelectionActive:R})},setEdges:k=>{const{connectionLookup:m,edgeLookup:v}=y();kg(m,v,k),p({edges:k})},setDefaultNodesAndEdges:(k,m)=>{if(k){const{setNodes:v}=y();v(k),p({hasDefaultNodes:!0})}if(m){const{setEdges:v}=y();v(m),p({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:m,nodeLookup:v,parentLookup:g,domNode:w,nodeOrigin:C,nodeExtent:E,debug:N,fitViewQueued:j,zIndexMode:P}=y(),{changes:A,updatedInternals:R}=lE(k,v,g,w,C,E,P);R&&(rE(v,g,{nodeOrigin:C,nodeExtent:E,zIndexMode:P}),j?(x(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(A==null?void 0:A.length)>0&&(N&&console.log("React Flow: trigger node changes",A),m==null||m(A)))},updateNodePositions:(k,m=!1)=>{const v=[];let g=[];const{nodeLookup:w,triggerNodeChanges:C,connection:E,updateConnection:N,onNodesChangeMiddlewareMap:j}=y();for(const[P,A]of k){const R=w.get(P),H=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(A!=null&&A.position)),F={id:P,type:"position",position:H?{x:Math.max(0,A.position.x),y:Math.max(0,A.position.y)}:A.position,dragging:m};if(R&&E.inProgress&&E.fromNode.id===R.id){const S=er(R,E.fromHandle,Z.Left,!0);N({...E,from:S})}H&&R.parentId&&v.push({id:P,parentId:R.parentId,rect:{...A.internals.positionAbsolute,width:A.measured.width??0,height:A.measured.height??0}}),g.push(F)}if(v.length>0){const{parentLookup:P,nodeOrigin:A}=y(),R=_c(v,w,P,A);g.push(...R)}for(const P of j.values())g=P(g);C(g)},triggerNodeChanges:k=>{const{onNodesChange:m,setNodes:v,nodes:g,hasDefaultNodes:w,debug:C}=y();if(k!=null&&k.length){if(w){const E=EN(k,g);v(E)}C&&console.log("React Flow: trigger node changes",k),m==null||m(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:m,setEdges:v,edges:g,hasDefaultEdges:w,debug:C}=y();if(k!=null&&k.length){if(w){const E=NN(k,g);v(E)}C&&console.log("React Flow: trigger edge changes",k),m==null||m(k)}},addSelectedNodes:k=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:w,triggerEdgeChanges:C}=y();if(m){const E=k.map(N=>In(N,!0));w(E);return}w(wr(g,new Set([...k]),!0)),C(wr(v))},addSelectedEdges:k=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:w,triggerEdgeChanges:C}=y();if(m){const E=k.map(N=>In(N,!0));C(E);return}C(wr(v,new Set([...k]))),w(wr(g,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:m}={})=>{const{edges:v,nodes:g,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:E}=y(),N=k||g,j=m||v,P=[];for(const R of N){if(!R.selected)continue;const H=w.get(R.id);H&&(H.selected=!1),P.push(In(R.id,!1))}const A=[];for(const R of j)R.selected&&A.push(In(R.id,!1));C(P),E(A)},setMinZoom:k=>{const{panZoom:m,maxZoom:v}=y();m==null||m.setScaleExtent([k,v]),p({minZoom:k})},setMaxZoom:k=>{const{panZoom:m,minZoom:v}=y();m==null||m.setScaleExtent([v,k]),p({maxZoom:k})},setTranslateExtent:k=>{var m;(m=y().panZoom)==null||m.setTranslateExtent(k),p({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:m,triggerNodeChanges:v,triggerEdgeChanges:g,elementsSelectable:w}=y();if(!w)return;const C=m.reduce((N,j)=>j.selected?[...N,In(j.id,!1)]:N,[]),E=k.reduce((N,j)=>j.selected?[...N,In(j.id,!1)]:N,[]);v(C),g(E)},setNodeExtent:k=>{const{nodes:m,nodeLookup:v,parentLookup:g,nodeOrigin:w,elevateNodesOnSelect:C,nodeExtent:E,zIndexMode:N}=y();k[0][0]===E[0][0]&&k[0][1]===E[0][1]&&k[1][0]===E[1][0]&&k[1][1]===E[1][1]||(au(m,v,g,{nodeOrigin:w,nodeExtent:k,elevateNodesOnSelect:C,checkEquality:!1,zIndexMode:N}),p({nodeExtent:k}))},panBy:k=>{const{transform:m,width:v,height:g,panZoom:w,translateExtent:C}=y();return aE({delta:k,panZoom:w,transform:m,translateExtent:C,width:v,height:g})},setCenter:async(k,m,v)=>{const{width:g,height:w,maxZoom:C,panZoom:E}=y();if(!E)return!1;const N=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:C;return await E.setViewport({x:g/2-k*N,y:w/2-m*N,zoom:N},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),!0},cancelConnection:()=>{p({connection:{...rg}})},updateConnection:k=>{p({connection:k})},reset:()=>p({...qf()})}},Object.is);function f0({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:a,fitView:u,nodeOrigin:c,nodeExtent:f,zIndexMode:d,children:p}){const[y]=b.useState(()=>U_({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:a,nodeOrigin:c,nodeExtent:f,zIndexMode:d}));return h.jsx(rN,{value:y,children:h.jsx($N,{children:h.jsx(UN,{children:p})})})}function W_({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:f,nodeExtent:d,zIndexMode:p}){return b.useContext(pl)?h.jsx(h.Fragment,{children:e}):h.jsx(f0,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:f,nodeExtent:d,zIndexMode:p,children:e})}const Y_={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function X_({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:f,onMoveEnd:d,onConnect:p,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:m,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:C,onNodeDoubleClick:E,onNodeDragStart:N,onNodeDrag:j,onNodeDragStop:P,onNodesDelete:A,onEdgesDelete:R,onDelete:H,onSelectionChange:F,onSelectionDragStart:S,onSelectionDrag:T,onSelectionDragStop:_,onSelectionContextMenu:z,onSelectionStart:$,onSelectionEnd:M,onBeforeDelete:L,connectionMode:I,connectionLineType:D=ln.Bezier,connectionLineStyle:U,connectionLineComponent:W,connectionLineContainerStyle:G,deleteKeyCode:V="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:O=!1,selectionMode:Y=Yo.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:J=Qo()?"Meta":"Control",zoomActivationKeyCode:Q=Qo()?"Meta":"Control",snapToGrid:ee,snapGrid:te,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:re,nodesDraggable:se,autoPanOnNodeFocus:Ne,nodesConnectable:be,nodesFocusable:et,nodeOrigin:zt=Dg,edgesFocusable:Kr,edgesReconnectable:Cn,elementsSelectable:jn=!0,defaultViewport:at=gN,minZoom:bt=.5,maxZoom:Lt=2,translateExtent:Mn=Wo,preventScrolling:wl=!0,nodeExtent:kl,defaultMarkerColor:C0="#b1b1b7",zoomOnScroll:j0=!0,zoomOnPinch:M0=!0,panOnScroll:$0=!1,panOnScrollSpeed:P0=.5,panOnScrollMode:I0=Hn.Free,zoomOnDoubleClick:T0=!0,panOnDrag:z0=!0,onPaneClick:b0,onPaneMouseEnter:L0,onPaneMouseMove:A0,onPaneMouseLeave:R0,onPaneScroll:D0,onPaneContextMenu:O0,paneClickDistance:F0=1,nodeClickDistance:H0=0,children:V0,onReconnect:B0,onReconnectStart:U0,onReconnectEnd:W0,onEdgeContextMenu:Y0,onEdgeDoubleClick:X0,onEdgeMouseEnter:K0,onEdgeMouseMove:Q0,onEdgeMouseLeave:G0,reconnectRadius:q0=10,onNodesChange:Z0,onEdgesChange:J0,noDragClassName:ey="nodrag",noWheelClassName:ty="nowheel",noPanClassName:Ic="nopan",fitView:Tc,fitViewOptions:zc,connectOnClick:ny,attributionPosition:ry,proOptions:oy,defaultEdgeOptions:iy,elevateNodesOnSelect:sy=!0,elevateEdgesOnSelect:ly=!1,disableKeyboardA11y:bc=!1,autoPanOnConnect:ay,autoPanOnNodeDrag:uy,autoPanOnSelection:cy=!0,autoPanSpeed:dy,connectionRadius:fy,isValidConnection:hy,onError:py,style:my,id:Lc,nodeDragThreshold:gy,connectionDragThreshold:yy,viewport:vy,onViewportChange:xy,width:wy,height:ky,colorMode:Sy="light",debug:Ey,onScroll:fi,ariaLabelConfig:Ny,zIndexMode:Ac="basic",..._y},Cy){const Sl=Lc||"1",jy=wN(Sy),My=b.useCallback(Rc=>{Rc.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),fi==null||fi(Rc)},[fi]);return h.jsx("div",{"data-testid":"rf__wrapper",..._y,onScroll:My,style:{...my,...Y_},ref:Cy,className:ke(["react-flow",o,jy]),id:Lc,role:"application",children:h.jsxs(W_,{nodes:e,edges:t,width:wy,height:ky,fitView:Tc,fitViewOptions:zc,minZoom:bt,maxZoom:Lt,nodeOrigin:zt,nodeExtent:kl,zIndexMode:Ac,children:[h.jsx(xN,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:m,nodesDraggable:se,autoPanOnNodeFocus:Ne,nodesConnectable:be,nodesFocusable:et,edgesFocusable:Kr,edgesReconnectable:Cn,elementsSelectable:jn,elevateNodesOnSelect:sy,elevateEdgesOnSelect:ly,minZoom:bt,maxZoom:Lt,nodeExtent:kl,onNodesChange:Z0,onEdgesChange:J0,snapToGrid:ee,snapGrid:te,connectionMode:I,translateExtent:Mn,connectOnClick:ny,defaultEdgeOptions:iy,fitView:Tc,fitViewOptions:zc,onNodesDelete:A,onEdgesDelete:R,onDelete:H,onNodeDragStart:N,onNodeDrag:j,onNodeDragStop:P,onSelectionDrag:T,onSelectionDragStart:S,onSelectionDragStop:_,onMove:c,onMoveStart:f,onMoveEnd:d,noPanClassName:Ic,nodeOrigin:zt,rfId:Sl,autoPanOnConnect:ay,autoPanOnNodeDrag:uy,autoPanSpeed:dy,onError:py,connectionRadius:fy,isValidConnection:hy,selectNodesOnDrag:re,nodeDragThreshold:gy,connectionDragThreshold:yy,onBeforeDelete:L,debug:Ey,ariaLabelConfig:Ny,zIndexMode:Ac}),h.jsx(V_,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:C,onNodeDoubleClick:E,nodeTypes:i,edgeTypes:s,connectionLineType:D,connectionLineStyle:U,connectionLineComponent:W,connectionLineContainerStyle:G,selectionKeyCode:X,selectionOnDrag:O,selectionMode:Y,deleteKeyCode:V,multiSelectionKeyCode:J,panActivationKeyCode:q,zoomActivationKeyCode:Q,onlyRenderVisibleElements:ne,defaultViewport:at,translateExtent:Mn,minZoom:bt,maxZoom:Lt,preventScrolling:wl,zoomOnScroll:j0,zoomOnPinch:M0,zoomOnDoubleClick:T0,panOnScroll:$0,panOnScrollSpeed:P0,panOnScrollMode:I0,panOnDrag:z0,autoPanOnSelection:cy,onPaneClick:b0,onPaneMouseEnter:L0,onPaneMouseMove:A0,onPaneMouseLeave:R0,onPaneScroll:D0,onPaneContextMenu:O0,paneClickDistance:F0,nodeClickDistance:H0,onSelectionContextMenu:z,onSelectionStart:$,onSelectionEnd:M,onReconnect:B0,onReconnectStart:U0,onReconnectEnd:W0,onEdgeContextMenu:Y0,onEdgeDoubleClick:X0,onEdgeMouseEnter:K0,onEdgeMouseMove:Q0,onEdgeMouseLeave:G0,reconnectRadius:q0,defaultMarkerColor:C0,noDragClassName:ey,noWheelClassName:ty,noPanClassName:Ic,rfId:Sl,disableKeyboardA11y:bc,nodeExtent:kl,viewport:vy,onViewportChange:xy,nodesDraggable:se}),h.jsx(mN,{onSelectionChange:F}),V0,h.jsx(cN,{proOptions:oy,position:ry}),h.jsx(uN,{rfId:Sl,disableKeyboardA11y:bc})]})})}var K_=Fg(X_);const Q_=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function G_({children:e}){const t=ie(Q_);return t?Em.createPortal(e,t):null}function q_({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ke(["react-flow__background-pattern",n,r])})}function Z_({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:ke(["react-flow__background-pattern","dots",t])})}var Ut;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ut||(Ut={}));const J_={[Ut.Dots]:1,[Ut.Lines]:1,[Ut.Cross]:6},e2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function h0({id:e,variant:t=Ut.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:a,className:u,patternClassName:c}){const f=b.useRef(null),{transform:d,patternId:p}=ie(e2,ye),y=r||J_[t],x=t===Ut.Dots,k=t===Ut.Cross,m=Array.isArray(n)?n:[n,n],v=[m[0]*d[2]||1,m[1]*d[2]||1],g=y*d[2],w=Array.isArray(i)?i:[i,i],C=k?[g,g]:v,E=[w[0]*d[2]+C[0]/2,w[1]*d[2]+C[1]/2],N=`${p}${e||""}`;return h.jsxs("svg",{className:ke(["react-flow__background",u]),style:{...a,...gl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:f,"data-testid":"rf__background",children:[h.jsx("pattern",{id:N,x:d[0]%v[0],y:d[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:x?h.jsx(Z_,{radius:g/2,className:c}):h.jsx(q_,{dimensions:C,lineWidth:o,variant:t,className:c})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}h0.displayName="Background";const t2=b.memo(h0);function n2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function r2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function o2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 i2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 s2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 Di({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:ke(["react-flow__controls-button",t]),...n,children:e})}const l2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function p0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:c,position:f="bottom-left",orientation:d="vertical","aria-label":p}){const y=fe(),{isInteractive:x,minZoomReached:k,maxZoomReached:m,ariaLabelConfig:v}=ie(l2,ye),{zoomIn:g,zoomOut:w,fitView:C}=ml(),E=()=>{g(),i==null||i()},N=()=>{w(),s==null||s()},j=()=>{C(o),l==null||l()},P=()=>{y.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),a==null||a(!x)},A=d==="horizontal"?"horizontal":"vertical";return h.jsxs(ui,{className:ke(["react-flow__controls",A,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??v["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Di,{onClick:E,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:m,children:h.jsx(n2,{})}),h.jsx(Di,{onClick:N,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:k,children:h.jsx(r2,{})})]}),n&&h.jsx(Di,{className:"react-flow__controls-fitview",onClick:j,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:h.jsx(o2,{})}),r&&h.jsx(Di,{className:"react-flow__controls-interactive",onClick:P,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:x?h.jsx(s2,{}):h.jsx(i2,{})}),c]})}p0.displayName="Controls";b.memo(p0);function a2({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:a,className:u,borderRadius:c,shapeRendering:f,selected:d,onClick:p}){const{background:y,backgroundColor:x}=i||{},k=s||y||x;return h.jsx("rect",{className:ke(["react-flow__minimap-node",{selected:d},u]),x:t,y:n,rx:c,ry:c,width:r,height:o,style:{fill:k,stroke:l,strokeWidth:a},shapeRendering:f,onClick:p?m=>p(m,e):void 0})}const u2=b.memo(a2),c2=e=>e.nodes.map(t=>t.id),oa=e=>e instanceof Function?e:()=>e;function d2({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=u2,onClick:s}){const l=ie(c2,ye),a=oa(t),u=oa(e),c=oa(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(d=>h.jsx(h2,{id:d,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:f},d))})}function f2({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:a}){const{node:u,x:c,y:f,width:d,height:p}=ie(y=>{const x=y.nodeLookup.get(e);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const k=x.internals.userNode,{x:m,y:v}=x.internals.positionAbsolute,{width:g,height:w}=Et(k);return{node:k,x:m,y:v,width:g,height:w}},ye);return!u||u.hidden||!cg(u)?null:h.jsx(l,{x:c,y:f,width:d,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:a,id:u.id})}const h2=b.memo(f2);var p2=b.memo(d2);const m2=200,g2=150,y2=e=>!e.hidden,v2=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]};let n=!1;for(const r of e.nodeLookup.values())if(!r.hidden){n=!0;break}return{viewBB:t,boundingRect:n?lg(si(e.nodeLookup,{filter:y2}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Zf=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,x2=(e,t)=>Zf(e.viewBB,t.viewBB)&&Zf(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,w2="react-flow__minimap-desc";function m0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:c,maskStrokeWidth:f,position:d="bottom-right",onClick:p,onNodeClick:y,pannable:x=!1,zoomable:k=!1,ariaLabel:m,inversePan:v,zoomStep:g=1,offsetScale:w=5}){const C=fe(),E=b.useRef(null),{boundingRect:N,panZoom:j,viewBB:P,rfId:A,translateExtent:R,flowWidth:H,flowHeight:F,ariaLabelConfig:S}=ie(v2,x2),T=(e==null?void 0:e.width)??m2,_=(e==null?void 0:e.height)??g2,z=N.width/T,$=N.height/_,M=Math.max(z,$),L=M*T,I=M*_,D=w*M,U=N.x-(L-N.width)/2-D,W=N.y-(I-N.height)/2-D,G=L+D*2,V=I+D*2,X=`${w2}-${A}`,O=b.useRef(0),Y=b.useRef();O.current=M,b.useEffect(()=>{const te=C.getState().panZoom;if(E.current&&te)return Y.current=yE({domNode:E.current,panZoom:te,getTransform:()=>C.getState().transform,getViewScale:()=>O.current}),()=>{var ne;(ne=Y.current)==null||ne.destroy()}},[j]),b.useEffect(()=>{var te;(te=Y.current)==null||te.update({translateExtent:R,width:H,height:F,inversePan:v,pannable:x,zoomStep:g,zoomable:k})},[x,k,v,g,R,H,F]);const q=p?te=>{var se;const[ne,re]=((se=Y.current)==null?void 0:se.pointer(te))||[0,0];p(te,{x:ne,y:re})}:void 0,J=b.useCallback((te,ne)=>{const re=C.getState().nodeLookup.get(ne).internals.userNode;y==null||y(te,re)},[y]),Q=y?J:void 0,ee=m??S["minimap.ariaLabel"];return h.jsx(ui,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*M: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:ke(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:T,height:_,viewBox:`${U} ${W} ${G} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:E,onClick:q,children:[ee&&h.jsx("title",{id:X,children:ee}),h.jsx(p2,{onClick:Q,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-D},${W-D}h${G+D*2}v${V+D*2}h${-G-D*2}z
62
- M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}m0.displayName="MiniMap";b.memo(m0);const k2=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,S2={[Hr.Line]:"right",[Hr.Handle]:"bottom-right"};function E2({nodeId:e,position:t,variant:n=Hr.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:d,autoScale:p=!0,shouldResize:y,onResizeStart:x,onResize:k,onResizeEnd:m}){const v=Wg(),g=typeof e=="string"?e:v,w=fe(),C=b.useRef(null),E=n===Hr.Handle,N=ie(b.useCallback(k2(E&&p),[E,p]),ye),j=b.useRef(null),P=t??S2[n];b.useEffect(()=>{if(!(!C.current||!g))return j.current||(j.current=PE({domNode:C.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:R,transform:H,snapGrid:F,snapToGrid:S,nodeOrigin:T,domNode:_}=w.getState();return{nodeLookup:R,transform:H,snapGrid:F,snapToGrid:S,nodeOrigin:T,paneDomNode:_}},onChange:(R,H)=>{const{triggerNodeChanges:F,nodeLookup:S,parentLookup:T,nodeOrigin:_}=w.getState(),z=[],$={x:R.x,y:R.y},M=S.get(g);if(M&&M.expandParent&&M.parentId){const L=M.origin??_,I=R.width??M.measured.width??0,D=R.height??M.measured.height??0,U={id:M.id,parentId:M.parentId,rect:{width:I,height:D,...dg({x:R.x??M.position.x,y:R.y??M.position.y},{width:I,height:D},M.parentId,S,L)}},W=_c([U],S,T,_);z.push(...W),$.x=R.x?Math.max(L[0]*I,R.x):void 0,$.y=R.y?Math.max(L[1]*D,R.y):void 0}if($.x!==void 0&&$.y!==void 0){const L={id:g,type:"position",position:{...$}};z.push(L)}if(R.width!==void 0&&R.height!==void 0){const I={id:g,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};z.push(I)}for(const L of H){const I={...L,type:"position"};z.push(I)}F(z)},onEnd:({width:R,height:H})=>{const F={id:g,type:"dimensions",resizing:!1,dimensions:{width:R,height:H}};w.getState().triggerNodeChanges([F])}})),j.current.update({controlPosition:P,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:c},keepAspectRatio:f,resizeDirection:d,onResizeStart:x,onResize:k,onResizeEnd:m,shouldResize:y}),()=>{var R;(R=j.current)==null||R.destroy()}},[P,l,a,u,c,f,x,k,m,y]);const A=P.split("-");return h.jsx("div",{className:ke(["react-flow__resize-control","nodrag",...A,n,r]),ref:C,style:{...o,scale:N,...s&&{[E?"backgroundColor":"borderColor"]:s}},children:i})}b.memo(E2);function N2(){const e=new URLSearchParams(location.search).get("t");try{return e&&sessionStorage.setItem("illuminate-token",e),e??sessionStorage.getItem("illuminate-token")??""}catch{return e??""}}const Ur=N2(),Mt=e=>`/${e?`m/${encodeURIComponent(e)}`:""}?t=${encodeURIComponent(Ur)}`,Os=e=>e.kind==="capture"?`/api/screens/${encodeURIComponent(e.capture)}.png?t=${encodeURIComponent(Ur)}`:`/api/repo-image?file=${encodeURIComponent(e.file)}&t=${encodeURIComponent(Ur)}`;class g0 extends Error{constructor(t,n=[]){super(t),this.problems=n}}async function Rt(e,t,n){const r=await fetch(t,{method:e,headers:{"x-illuminate-token":Ur,"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),o=await r.json().catch(()=>({}));if(!r.ok)throw new g0(o.error??`Request failed (${r.status})`,o.problems??[]);return o}const cn={list:()=>Rt("GET","/api/maps"),get:e=>Rt("GET",`/api/maps/${encodeURIComponent(e)}`),make:(e,t)=>Rt("POST","/api/maps",{question:e,parent:t}),offer:(e,t,n)=>Rt("POST",`/api/maps/${encodeURIComponent(e)}/answers/${encodeURIComponent(t)}/offer`,{choice:n}),ask:(e,t,n)=>Rt("POST",`/api/maps/${encodeURIComponent(e)}/ask`,{question:t,selection:n}),approve:(e,t)=>Rt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/approve`),reject:(e,t)=>Rt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/reject`),undo:(e,t)=>Rt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/undo`),stop:()=>Rt("POST","/api/stop")},_2=4e3;function y0(e,t,n){let r=null,o=!1,i=null;const s=()=>{r=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws?t=${encodeURIComponent(Ur)}`),r.onopen=()=>t(!0),r.onmessage=l=>{try{e(JSON.parse(String(l.data)))}catch{}},r.onclose=l=>{t(!1),l.code===_2?(o=!0,n()):o||(i=setTimeout(s,1e3))}};return s(),()=>{o=!0,i&&clearTimeout(i),r==null||r.close()}}const v0=(...e)=>e.filter(Boolean).join(" "),rn=e=>`${Math.max(0,Math.min(1,e))*100}%`;function Fs(e,t){var r;const n=(r=e==null?void 0:e.screens)==null?void 0:r[t];return(n==null?void 0:n.status)==="confirmed"?n.show:null}function C2(e,t,n){for(const r of n){const o=Fs(t,r),i=e.nodes.find(s=>s.id===r);if(o&&i)return{name:i.name,show:o}}return null}function jc({show:e,name:t}){var i;const[n,r]=b.useState(!1);if(e.kind==="capture"){const s=e.box,l=!!s&&!n,a=s?`${rn(s.x+s.w/2)} ${rn(s.y+s.h/2)}`:void 0;return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-shot",style:{aspectRatio:`${e.width} / ${e.height}`},children:h.jsxs("div",{className:"screen-zoom",style:l?{transform:"scale(2.2)",transformOrigin:a}:void 0,children:[h.jsx("img",{src:Os(e),alt:`The screen at “${t}”${e.title?`: ${e.title}`:""}`,loading:"lazy"}),s&&h.jsx("i",{className:"screen-mark","aria-hidden":"true",style:{left:rn(s.x),top:rn(s.y),width:rn(s.w),height:rn(s.h)}})]})}),h.jsxs("figcaption",{className:"muted small",children:["Screenshot of ",e.from,s&&h.jsxs(h.Fragment,{children:[" · ",h.jsx("button",{className:"linklike",onClick:()=>r(!n),children:n?"Zoom in":"Show the whole screen"})]})]})]})}if(e.kind==="image")return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-image",children:h.jsx("img",{src:Os(e),alt:`Image used at “${t}”`,loading:"lazy"})}),h.jsx("figcaption",{className:"muted small",children:e.file})]});const o=(i=e.highlight)==null?void 0:i.trim().toLowerCase();return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:e.elements.map((s,l)=>h.jsxs("span",{className:v0("sk",`sk-${s.kind}`,s.proposed&&"sk-proposed",o===s.text.trim().toLowerCase()&&"sk-mark"),title:s.proposed?"Proposed: not on the screen yet":void 0,children:[s.kind==="image"?`▧ ${s.text}`:s.text,s.proposed&&h.jsx("i",{className:"sk-new",children:"proposed"})]},l))}),h.jsxs("figcaption",{className:"muted small",children:[e.elements.every(s=>s.proposed)?`Rough sketch of a proposed screen (${e.file})`:`Rough sketch from ${e.file}, not a screenshot`,e.elements.some(s=>s.proposed)&&!e.elements.every(s=>s.proposed)&&" · violet parts are proposed"]})]})}function j2({show:e,name:t}){var r;if(e.kind==="sketch"){const o=(r=e.highlight)==null?void 0:r.trim().toLowerCase(),i=e.elements.slice(0,4);return h.jsxs("div",{className:"thumb thumb-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:[i.map((s,l)=>h.jsx("span",{className:v0("sk",`sk-${s.kind}`,s.proposed&&"sk-proposed",o===s.text.trim().toLowerCase()&&"sk-mark"),children:s.kind==="image"?`▧ ${s.text}`:s.text},l)),e.elements.length>i.length&&h.jsxs("span",{className:"thumb-more",children:["+",e.elements.length-i.length," more"]})]})}if(e.kind==="image")return h.jsx("div",{className:"thumb thumb-image",children:h.jsx("img",{src:Os(e),alt:`Image used at “${t}”`,loading:"lazy"})});const n=e.box;return h.jsx("div",{className:"thumb thumb-shot",children:h.jsx("img",{src:Os(e),alt:`The screen at “${t}”`,loading:"lazy",style:n?{transform:"scale(1.8)",transformOrigin:`${rn(n.x+n.w/2)} ${rn(n.y+n.h/2)}`}:void 0})})}const Jf=/^\s*(```|~~~)/,M2=/^\s{0,3}#{1,6}\s+(.*?)\s*#*\s*$/,$2=/^\s*[-*+•]\s+(.*)$/,P2=/^\s*(\d{1,4})[.)]\s+(.*)$/;function I2(e){const t=e.replace(/\r\n?/g,`
63
- `).split(`
64
- `),n=[];let r=[];const o=()=>{r.length&&n.push({kind:"p",text:r.join(`
65
- `)}),r=[]};for(let i=0;i<t.length;i++){const s=t[i];if(Jf.test(s)){o();const f=[];for(i++;i<t.length&&!Jf.test(t[i]);i++)f.push(t[i]);n.push({kind:"code",text:f.join(`
66
- `)});continue}if(!s.trim()){o();continue}const l=M2.exec(s);if(l){o(),n.push({kind:"h",text:l[1]});continue}const a=$2.exec(s),u=a?null:P2.exec(s);if(a||u){o();const f=a?"ul":"ol",d=n[n.length-1],p=a?a[1]:u[2];d&&d.kind===f?d.items.push(p):n.push(f==="ul"?{kind:f,items:[p]}:{kind:f,items:[p],start:Number(u[1])});continue}const c=n[n.length-1];if(!r.length&&c&&(c.kind==="ul"||c.kind==="ol")&&/^\s+\S/.test(s)){c.items[c.items.length-1]+=` ${s.trim()}`;continue}r.push(s)}return o(),n}const T2=new RegExp("(`+)([^`]+?)\\1|\\*\\*(.+?)\\*\\*|__(.+?)__|\\*(?!\\s)(.+?)\\*|(?<![\\w])_(?!\\s)(.+?)_(?![\\w])|\\[([^\\]]+)\\]\\(([^)\\s]+)\\)","g");function An(e,t="i"){const n=[];let r=0,o=0;const i=s=>{s.split(`
67
- `).forEach((l,a)=>{a>0&&n.push(h.jsx("br",{},`${t}-br${o++}`)),l&&n.push(l)})};for(const s of e.matchAll(T2)){i(e.slice(r,s.index));const l=`${t}-${o++}`;if(s[2]!==void 0)n.push(h.jsx("code",{children:s[2]},l));else if(s[3]!==void 0||s[4]!==void 0)n.push(h.jsx("strong",{children:An(s[3]??s[4],l)},l));else if(s[5]!==void 0||s[6]!==void 0)n.push(h.jsx("em",{children:An(s[5]??s[6],l)},l));else if(s[7]!==void 0){const a=s[8];n.push(/^https?:\/\//i.test(a)?h.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:An(s[7],l)},l):h.jsx("span",{children:An(s[7],l)},l))}r=s.index+s[0].length}return i(e.slice(r)),n}function qo({text:e,className:t}){const n=I2(e);return n.length?h.jsx("div",{className:t?`md ${t}`:"md",children:n.map((r,o)=>{const i=`b${o}`;if(r.kind==="p")return h.jsx("p",{children:An(r.text,i)},i);if(r.kind==="h")return h.jsx("p",{className:"md-h",children:An(r.text,i)},i);if(r.kind==="code")return h.jsx("pre",{children:h.jsx("code",{children:r.text})},i);const s=r.items.map((l,a)=>h.jsx("li",{children:An(l,`${i}-${a}`)},`${i}-${a}`));return r.kind==="ul"?h.jsx("ul",{children:s},i):h.jsx("ol",{start:r.start,children:s},i)})}):null}const sr=()=>({nodes:[],edges:[],absences:[]}),fo=e=>e.nodes.length+e.edges.length+e.absences.length,z2=e=>({mapId:e,phase:"loading",meta:null,map:null,report:null,job:null,error:null,answers:[],shown:null,selection:sr(),tour:null,views:[],viewIndex:-1,fixes:{},fresh:[],hidden:[],connected:!1}),b2=e=>e.views[e.viewIndex]??null;function di(e){if(!e.map)return[];const t=new Set([...e.map.areas,...e.map.nodes,...e.map.edges,...e.map.absences].map(n=>n.id));return e.answers.flatMap(n=>{const r=n.added.filter(o=>t.has(o));return r.length?[{answerId:n.id,question:n.question,ids:r,visible:!e.hidden.includes(n.id)}]:[]})}const L2=e=>di(e).flatMap(t=>t.ids);function x0(e){if(!e.map)return null;const t=new Set(di(e).filter(o=>!o.visible).flatMap(o=>o.ids));if(!t.size)return e.map;const n=e.map.nodes.filter(o=>!t.has(o.id)),r=new Set(n.map(o=>o.id));return{...e.map,areas:e.map.areas.filter(o=>!t.has(o.id)),nodes:n,edges:e.map.edges.filter(o=>!t.has(o.id)&&r.has(o.from)&&r.has(o.to)),absences:e.map.absences.filter(o=>!t.has(o.id)&&(!o.between||r.has(o.between.from)&&r.has(o.between.to)))}}function A2(e,t){if(!t)return e;const n=(r,o)=>r.filter(i=>o.some(s=>s.id===i));return{nodes:n(e.nodes,t.nodes),edges:n(e.edges,t.edges),absences:n(e.absences,t.absences)}}function R2(e,t){var s,l,a;const n=e.tour[t];if(!n)return null;const r=e.nodes.filter(u=>{var c;return(c=n.focus.areas)==null?void 0:c.includes(u.area)}).map(u=>u.id),o=[...n.focus.nodes??[],...n.focus.edges??[],...n.focus.absences??[],...r],i=(n.focus.edges??[]).length||(n.focus.absences??[]).length?[]:w0(e,new Set(o));return{focus:((s=n.focus.nodes)==null?void 0:s[0])??((l=n.focus.edges)==null?void 0:l[0])??((a=n.focus.absences)==null?void 0:a[0])??null,highlight:[...new Set([...o,...i])]}}function w0(e,t){return e.edges.filter(n=>t.has(n.from)&&t.has(n.to)).map(n=>n.id)}function eh(e,t){const n=[...t.moves.highlight,...t.added],r=e?[...new Set([...n,...w0(e,new Set(n))])]:n;return r.length||t.moves.focus?{focus:t.moves.focus??r[0]??null,highlight:r}:null}function ir(e,t){if(!t)return e;const n=[...e.views.slice(0,e.viewIndex+1),t].slice(-50);return{...e,views:n,viewIndex:n.length-1}}function th(e,t,n){const r={...t};for(const o of e){if(!o.fix||r[o.fix.id]&&!n)continue;const i=n?n[o.fix.id]:{status:"proposed"};r[o.fix.id]={proposal:o.fix,answerId:o.id,status:(i==null?void 0:i.status)??"rejected",problems:[],edgeId:(i==null?void 0:i.edgeId)??null,closed:(i==null?void 0:i.closed)??[],undoable:(i==null?void 0:i.undoable)??!0}}return r}function D2(e,t){var n;switch(t.type){case"loaded":{const r=t.payload,o=r.map?"ready":r.job?"making":r.failure?"failed":"missing";return{...e,phase:o,meta:r.meta,map:r.map,report:r.report,job:r.job,error:((n=r.failure)==null?void 0:n.error)??null,answers:r.answers,shown:null,fixes:th(r.answers,e.fixes,r.fixes??{})}}case"missing":return{...e,phase:"missing"};case"connected":return{...e,connected:t.value};case"event":{const r=t.event;if(r.mapId!==e.mapId)return e;if(r.type==="job")return r.status==="started"?{...e,job:{kind:r.job,question:r.question,progress:[]},error:null,phase:r.job==="make"?"making":e.phase}:r.status==="failed"?{...e,job:null,error:r.error??"Something went wrong.",phase:r.job==="make"&&!e.map?"failed":e.phase}:{...e,job:null};if(r.type==="progress")return e.job?{...e,job:{...e.job,progress:[...e.job.progress,r.text].slice(-200)}}:e;if(r.type==="map"){const o=s=>s.filter(l=>r.map.nodes.some(a=>a.id===l)||r.map.edges.some(a=>a.id===l)||r.map.absences.some(a=>a.id===l)),i={nodes:o(e.selection.nodes),edges:o(e.selection.edges),absences:o(e.selection.absences)};return{...e,phase:"ready",meta:r.meta,map:r.map,report:r.report,selection:i}}if(r.type==="answer"){const o=[...e.answers,r.answer],i={...e,answers:o,shown:r.answer.id,tour:null,fresh:r.answer.added,fixes:th([r.answer],e.fixes,void 0)};return ir(i,eh(e.map,r.answer))}if(r.type==="answerUpdate")return{...e,answers:e.answers.map(o=>o.id===r.answer.id?r.answer:o)};if(r.type==="fix"){const o=e.fixes[r.fixId];if(!o)return e;const i=r.status,s={...e.fixes,[r.fixId]:{...o,status:i,problems:r.problems??[],edgeId:r.edgeId??o.edgeId,closed:r.closed??o.closed,undoable:r.status==="applied"?!0:o.undoable}},l={...e,fixes:s};if(r.status==="applied"&&r.edgeId){const a=o.proposal.connects;return ir(l,{focus:r.edgeId,highlight:[r.edgeId,...a?[a.from,a.to]:[]]})}return l}return e}case"select":{const r=e.selection[t.kind],o=r.includes(t.id),i=t.additive?{...e.selection,[t.kind]:o?r.filter(s=>s!==t.id):[...r,t.id]}:{...sr(),[t.kind]:o&&fo(e.selection)===1?[]:[t.id]};return{...e,selection:i}}case"selectMany":return{...e,selection:t.selection};case"clearSelection":return{...e,selection:sr()};case"tour":{if(t.stop===null||!e.map)return{...e,tour:null};const r=Math.max(0,Math.min(t.stop,e.map.tour.length-1));return ir({...e,tour:r,selection:sr()},R2(e.map,r))}case"focus":{if(!e.map)return e;const r=e.map.nodes.some(o=>o.id===t.id)?"nodes":e.map.edges.some(o=>o.id===t.id)?"edges":e.map.absences.some(o=>o.id===t.id)?"absences":null;return r?ir({...e,tour:null,selection:{...sr(),[r]:[t.id]}},{focus:t.id,highlight:[t.id]}):e}case"back":return e.viewIndex>0?{...e,viewIndex:e.viewIndex-1}:e.viewIndex===0?{...e,viewIndex:-1}:e;case"forward":return e.viewIndex<e.views.length-1?{...e,viewIndex:e.viewIndex+1}:e;case"show":{const r=e.answers.find(o=>o.id===t.answerId);return ir({...e,shown:t.answerId,tour:null},r?eh(e.map,r):null)}case"overview":return ir({...e,shown:null,tour:null,selection:sr(),fresh:[]},{focus:null,highlight:[]});case"layer":case"allLayers":{const r=t.type==="layer"?[t.answerId]:di(e).map(s=>s.answerId),o=t.visible?e.hidden.filter(s=>!r.includes(s)):[...new Set([...e.hidden,...r])],i={...e,hidden:o};return{...i,selection:A2(e.selection,x0(i))}}case"fixStatus":{const r=e.fixes[t.fixId];return r?{...e,fixes:{...e.fixes,[t.fixId]:{...r,status:t.status,problems:t.problems??r.problems}}}:e}case"error":return{...e,error:t.message}}}const dn=(...e)=>e.filter(Boolean).join(" ");function it(e,t){const n=e.nodes.find(s=>s.id===t);if(n)return n.name;const r=e.edges.find(s=>s.id===t);if(r)return`${it(e,r.from)} → ${it(e,r.to)}`;const o=e.absences.find(s=>s.id===t);if(o)return o.claim;const i=e.areas.find(s=>s.id===t);return(i==null?void 0:i.label)??t}const O2={add:{pending:"Proposed: this isn’t in the code yet.",done:"This was proposed, and the code now has it."},change:{pending:"Proposed: this code would change.",done:"This was proposed to change, and the code here has changed since."},remove:{pending:"Proposed: this code would be removed.",done:"This was proposed for removal, and it’s no longer in the code."}},F2={added:"New since",changed:"Changed since",removed:"Removed since"};function du(e,t){return e?e.nodes[t]??e.edges[t]??(e.absences[t]?{status:e.absences[t].status,reasons:e.absences[t].reasons}:null):null}function Fe({eyebrow:e,title:t,children:n,tone:r,className:o}){return h.jsxs("section",{className:dn("card",r&&`card-${r}`,o),children:[e&&h.jsx("div",{className:"eyebrow",children:e}),t&&h.jsx("h2",{className:"card-title",children:t}),n]})}function H2({map:e,ids:t,onPick:n}){return t.length?h.jsx("div",{className:"chips",children:t.map(({id:r,status:o})=>h.jsxs("button",{className:dn("chip",o==="proposed"?"chip-proposed":o!=="confirmed"&&"chip-unconfirmed"),onClick:()=>n(r),title:o==="confirmed"?"Confirmed against the code":o==="proposed"?"Part of a proposal, not in the code":"Couldn't confirm against the code",children:[h.jsx("span",{className:o==="confirmed"?"tick":o==="proposed"?"pmark":"qmark",children:o==="confirmed"?"✓":o==="proposed"?"+":"?"}),it(e,r)]},r))}):null}function nh({lines:e,working:t}){const n=e.slice(-8);return h.jsxs("ul",{className:"progress",children:[n.map((r,o)=>h.jsxs("li",{className:dn(t&&o===n.length-1&&"running"),children:[h.jsx("span",{className:"ic",children:t&&o===n.length-1?"…":"✓"}),r]},`${o}-${r}`)),!n.length&&t&&h.jsxs("li",{className:"running",children:[h.jsx("span",{className:"ic",children:"…"}),"Starting"]})]})}function V2({fix:e,onApprove:t,onReject:n,onUndo:r,map:o}){const i=e.proposal,s=i.files.filter(l=>l.uncommitted);return e.status==="applied"?h.jsxs(Fe,{eyebrow:"Fix applied · re-checked",tone:"ok",children:[h.jsxs("ul",{className:"progress",children:[h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"Changed ",i.files.length," ",i.files.length===1?"file":"files",": ",i.files.map(l=>l.file).join(", ")]}),e.edgeId&&h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"New confirmed connection: ",it(o,e.edgeId)]}),e.closed.length>0&&h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"Closed: ",e.closed.length===1?"the missing connection":`${e.closed.length} missing connections`]})]}),e.undoable?h.jsx("div",{className:"btns",children:h.jsx("button",{className:"btn",onClick:r,children:"Undo this fix"})}):h.jsx("p",{className:"muted small",children:"Undo ended when illuminate stopped. Use git to reverse it."})]}):e.status==="rejected"||e.status==="undone"?h.jsxs(Fe,{eyebrow:e.status==="undone"?"Fix undone":"Fix rejected",children:[h.jsx(qo,{text:i.summary,className:"muted"}),e.status==="undone"&&h.jsx("div",{className:"btns",children:h.jsx("button",{className:"btn",onClick:t,children:"Apply it again"})})]}):h.jsxs(Fe,{eyebrow:`Proposed fix · ${i.files.length} ${i.files.length===1?"file":"files"} · nothing changed yet`,tone:"ai",children:[h.jsx(qo,{text:i.summary}),i.connects&&h.jsx("p",{className:"muted small",children:"The green dashed arrow is the connection it adds."}),h.jsx("pre",{className:"diff",children:i.diff.split(`
68
- `).map((l,a)=>h.jsxs("span",{className:l.startsWith("+ ")?"add":l.startsWith("- ")?"del":l.includes(" · ")?"file":"",children:[l,`
69
- `]},a))}),s.length>0?h.jsxs("p",{className:"warn small",children:["⚠ ",s.map(l=>l.file).join(", ")," ",s.length===1?"has":"have"," uncommitted changes. They'll be kept; the fix applies on top."]}):null,e.problems.length>0&&h.jsx("ul",{className:"problems",children:e.problems.map(l=>h.jsx("li",{children:l},l))}),h.jsxs("div",{className:"btns",children:[h.jsx("button",{className:"btn primary",disabled:e.status==="applying",onClick:t,children:e.status==="applying"?"Applying…":"Approve"}),h.jsx("button",{className:"btn",onClick:n,children:"Reject"})]}),h.jsx("p",{className:"muted small",children:"Won't apply if these files change first."})]})}function B2({state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o,composer:i}){const s=e.map,l=e.job,a=b.useRef(null);if(b.useEffect(()=>{const d=a.current;d&&(d.scrollTop=d.scrollHeight)},[e.answers.length,l==null?void 0:l.progress.length,!!l]),e.phase==="loading")return h.jsx("aside",{className:"panel",children:h.jsx("div",{className:"panel-scroll",children:h.jsx(Fe,{children:h.jsx("p",{className:"muted",children:"Loading…"})})})});if(e.phase==="missing")return h.jsx("aside",{className:"panel",children:h.jsx("div",{className:"panel-scroll",children:h.jsx(Fe,{title:"No map here",children:h.jsx("p",{className:"muted",children:"This map isn't in this repo."})})})});if(!s)return h.jsx("aside",{className:"panel",children:h.jsxs("div",{className:"panel-scroll",children:[l&&h.jsx(Fe,{eyebrow:"Making your map",title:l.question,tone:"ai",children:h.jsx(nh,{lines:l.progress,working:!0})}),e.phase==="failed"&&h.jsx(Fe,{title:"The map couldn't be made",tone:"dead",children:h.jsx("p",{children:e.error})})]})});const u=[...e.selection.nodes,...e.selection.edges,...e.selection.absences],c=di(e),f=c.length>0&&c.every(d=>!d.visible);return h.jsxs("aside",{className:"panel","aria-label":"Conversation about this map",children:[h.jsxs("header",{className:"panel-head",children:[h.jsx("h2",{className:"panel-title",children:"Conversation"}),c.length>0&&h.jsx("button",{className:"link-btn small",onClick:()=>t({type:"allLayers",visible:f}),children:f?"Show everything":"Show the original map"}),h.jsx("button",{className:"card-close","aria-label":"Close the conversation",title:"Close (Esc). It stays here to reopen.",onClick:()=>t({type:"overview"}),children:"×"})]}),h.jsxs("div",{className:"panel-scroll",ref:a,children:[e.error&&h.jsxs("div",{className:"banner banner-dead",role:"alert",children:[e.error,h.jsx("button",{className:"link-btn",onClick:()=>t({type:"error",message:null}),children:"Dismiss"})]}),e.answers.map(d=>h.jsx(U2,{answer:d,state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o},d.id)),(l==null?void 0:l.kind)==="ask"&&h.jsxs("article",{className:"turn",children:[h.jsx(k0,{question:l.question}),h.jsx(Fe,{eyebrow:"Claude is working",tone:"ai",children:h.jsx(nh,{lines:l.progress,working:!0})})]}),!e.answers.length&&!l&&!u.length&&h.jsx("p",{className:"muted small thread-empty",children:"Ask anything about this map. Click a box or arrow first to ask about it."})]}),h.jsxs("footer",{className:"panel-foot",children:[u.length>0&&h.jsx(Y2,{map:s,report:e.report,ids:u,compact:e.answers.length>0||(l==null?void 0:l.kind)==="ask"},u.join(" ")),i]})]})}function k0({question:e,about:t}){return h.jsxs("div",{className:"you",children:[h.jsx("p",{className:"you-q",children:e}),t&&h.jsxs("span",{className:"you-about",children:["About ",t]})]})}function U2({answer:e,state:t,dispatch:n,onFix:r,onFocus:o,onOffer:i}){const s=t.map,l=e.fix?t.fixes[e.fix.id]??null:null,a=e.id===t.shown,u=[...e.selection.nodes??[],...e.selection.edges??[],...e.selection.absences??[]].map(x=>it(s,x)).join(", "),c=di(t).find(x=>x.answerId===e.id),f=e.problems.filter(x=>x.startsWith("The proposed fix")),d=e.problems.filter(x=>!x.startsWith("The proposed fix")),p=e.refs.filter(x=>{var k;return x.status!=="unknown"&&((k=du(t.report,x.id))==null?void 0:k.status)==="unconfirmed"}).map(x=>x.id),y=e.moves.highlight.length>0||!!e.moves.focus||e.added.length>0||(e.screens??[]).length>0;return h.jsxs("article",{className:"turn",children:[h.jsx(k0,{question:e.question,about:u||void 0}),e.offer?h.jsx(W2,{answer:e,busy:!!t.job,onOffer:i}):h.jsxs("section",{className:dn("card","reply",a&&"card-focus"),children:[h.jsxs("div",{className:"reply-meta",children:[h.jsx("span",{children:e.source==="map"?"From the map":"Looked in the code"}),y&&(a?h.jsx("span",{className:"reply-lit",children:"Lit on the map"}):h.jsx("button",{className:"link-btn small",onClick:()=>n({type:"show",answerId:e.id}),children:"Show on the map"}))]}),h.jsx(qo,{text:e.concept,className:"depth-text"}),(e.screens??[]).map(x=>{const k=Fs(t.report,x);return k?h.jsx(jc,{show:k,name:it(s,x)},x):null}),p.length>0&&h.jsxs("p",{className:"warn small reply-warn",children:["Relies on ",p.length===1?"1 thing":`${p.length} things`," the checker couldn't confirm:"," ",p.map((x,k)=>h.jsxs("span",{children:[k>0&&", ",h.jsx("button",{className:"link-btn small",title:"Show it on the map",onClick:()=>o(x),children:it(s,x)})]},x))]}),c&&h.jsxs("div",{className:"reply-added",children:[h.jsxs("span",{children:["Added ",c.ids.length," to the map"]}),h.jsx("button",{className:"link-btn small",onClick:()=>n({type:"layer",answerId:e.id,visible:!c.visible}),children:c.visible?"Hide":"Show"})]}),d.length>0&&h.jsxs("details",{className:"problems-box",children:[h.jsxs("summary",{children:[d.length," thing",d.length===1?"":"s"," Claude found but couldn't confirm or show"]}),h.jsx("ul",{className:"problems",children:d.map(x=>h.jsx("li",{children:x},x))})]})]}),l&&h.jsx(V2,{fix:l,map:s,onApprove:()=>r(l.proposal.id,"approve"),onReject:()=>r(l.proposal.id,"reject"),onUndo:()=>r(l.proposal.id,"undo")}),f.length>0&&h.jsxs(Fe,{eyebrow:"The proposed fix can't be applied",tone:"dead",children:[h.jsx("ul",{className:"problems",children:f.map(x=>h.jsx("li",{children:x.replace("The proposed fix can't be applied: ","")},x))}),h.jsx("p",{className:"muted small",children:"Ask again, or ask for a smaller change."})]})]})}function W2({answer:e,busy:t,onOffer:n}){const r=e.offer;return r.status==="mapped"?h.jsxs(Fe,{eyebrow:"A different part of the app",children:[h.jsx("p",{className:"muted",children:"You made a new map for this."}),r.mapId&&h.jsx("div",{className:"btns",children:h.jsx("a",{className:"btn primary",href:Mt(r.mapId),children:"Open it"})})]}):r.status==="answered"?h.jsx(Fe,{eyebrow:"A different part of the app",children:h.jsx("p",{className:"muted",children:"Answered in words, below."})}):h.jsxs(Fe,{eyebrow:"A different part of the app",tone:"ai",children:[h.jsx("p",{children:"This is about a different part of the app than this map shows."}),r.existing&&h.jsxs("p",{children:["There's already a map for it: “",r.existing.question,"”."]}),h.jsxs("div",{className:"btns",children:[r.existing&&h.jsx("a",{className:"btn primary",href:Mt(r.existing.id),children:"Open that map"}),h.jsx("button",{className:r.existing?"btn":"btn primary",onClick:()=>n(e.id,"map"),children:"Make a new map for this"}),h.jsx("button",{className:"btn",disabled:t,onClick:()=>n(e.id,"words"),title:t?"Claude is still working on this map":void 0,children:"Just answer in words"})]})]})}function Y2({map:e,report:t,ids:n,compact:r}){var g,w,C,E,N;const[o,i]=b.useState(!r);if(n.length>1)return h.jsx(Fe,{eyebrow:`Asking about ${n.length} things`,className:"card-selected",children:h.jsx(H2,{map:e,ids:n.map(j=>{var P;return{id:j,status:((P=du(t,j))==null?void 0:P.status)??"unknown"}}),onPick:()=>{}})});const s=n[0],l=e.nodes.find(j=>j.id===s),a=e.edges.find(j=>j.id===s),u=e.absences.find(j=>j.id===s),c=du(t,s),f=(l==null?void 0:l.evidence)??(a==null?void 0:a.evidence)??[],d=c&&"evidence"in c&&c.evidence?c.evidence:[],p=l?"Step":a?"Connection":"Missing connection",y=(c==null?void 0:c.proposal)??null,x=(w=(g=l??a)==null?void 0:g.proposed)==null?void 0:w.note,k=c&&"change"in c?c.change??null:null,m=((E=(C=t==null?void 0:t.since)==null?void 0:C.commit)==null?void 0:E.slice(0,7))??"the commit this map is compared with",v=u?(t==null?void 0:t.absences[u.id])??null:null;return o?h.jsxs(Fe,{eyebrow:p,title:it(e,s),tone:u?"dead":void 0,className:"card-selected",children:[r&&h.jsx("button",{className:"link-btn small selected-hide",onClick:()=>i(!1),children:"Hide details"}),((N=l==null?void 0:l.explain)==null?void 0:N.concept)&&h.jsx(qo,{text:l.explain.concept,className:"depth-text"}),l&&Fs(t,l.id)&&h.jsx(jc,{show:Fs(t,l.id),name:l.name}),y&&h.jsxs("div",{className:dn("proposal-note",`proposal-note-${y.state}`),children:[h.jsx("strong",{children:O2[y.kind][y.state]}),x&&h.jsxs(h.Fragment,{children:[" ",x]})]}),k&&h.jsxs("div",{className:dn("change-note",`change-note-${k.kind}`),children:[h.jsxs("strong",{children:[F2[k.kind]," ",m,"."]}),k.kind==="changed"&&!k.diff&&" A line it cites wasn’t there then.",k.kind==="removed"&&" It was in the code then and is gone now.",k.diff&&h.jsx("pre",{className:"diff",children:k.diff.map((j,P)=>h.jsxs("span",{className:j.startsWith("+ ")?"add":j.startsWith("- ")?"del":"",children:[j,`
70
- `]},P))})]}),u&&v&&h.jsxs("p",{children:[v.found>u.matches?"This may no longer be missing: the search below now finds something.":"Nothing in the code connects these, going by this search."," ","Searched ",v.searched??"?"," ",v.searched===1?"file":"files",u.search.paths?h.jsxs(h.Fragment,{children:[" in ",h.jsx("code",{children:u.search.paths.join(", ")})]}):" (the whole repo)"," for ",h.jsx("code",{children:u.search.pattern}),": ",v.found," ",v.found===1?"match":"matches","."]}),c&&c.status==="unconfirmed"&&h.jsxs("div",{className:"warn small",children:["Couldn't confirm against the code: ",c.reasons.join("; ")]}),f.length>0&&h.jsxs("div",{className:"basis",children:[h.jsx("div",{className:"eyebrow",children:(k==null?void 0:k.kind)==="removed"?`In the code as it was at ${m}`:"In the code"}),h.jsx("div",{className:"chips",children:f.map((j,P)=>{var R,H;const A=((R=d[P])==null?void 0:R.ok)??!1;return h.jsxs("span",{className:dn("chip static",!A&&"chip-unconfirmed"),children:[h.jsx("span",{className:A?"tick":"qmark",children:A?"✓":"?"}),j.file,":",((H=d[P])==null?void 0:H.foundAt)??j.line]},P)})})]})]}):h.jsxs("div",{className:dn("selected-line",u&&"selected-line-dead"),children:[h.jsx("span",{className:"eyebrow",children:p}),h.jsx("span",{className:"selected-name",children:it(e,s)}),h.jsx("button",{className:"link-btn small",onClick:()=>i(!0),children:"Details"})]})}function X2({map:e,selection:t,draft:n,busy:r,autoFocus:o,onDraft:i,onRemove:s,onSend:l}){const a=b.useRef(null),u=["nodes","edges","absences"].flatMap(c=>t[c].map(f=>({kind:c,id:f})));return b.useEffect(()=>{const c=a.current;c&&(c.style.height="auto",c.style.height=`${Math.min(c.scrollHeight,140)}px`)},[n]),b.useEffect(()=>{var c;n&&((c=a.current)==null||c.focus())},[n===""]),b.useEffect(()=>{var c;o&&((c=a.current)==null||c.focus({preventScroll:!0}))},[]),h.jsxs("form",{className:"composer",onSubmit:c=>{c.preventDefault(),!r&&n.trim()&&l()},children:[u.map(c=>h.jsxs("span",{className:`sel-chip sel-${c.kind}`,children:[h.jsxs("span",{className:"sel-text",title:it(e,c.id),children:[c.kind==="absences"?"✕ ":"◉ ",it(e,c.id)]}),h.jsx("button",{type:"button","aria-label":`Remove ${it(e,c.id)}`,onClick:()=>s(c.kind,c.id),children:"×"})]},`${c.kind}:${c.id}`)),h.jsx("textarea",{ref:a,id:"ask",rows:1,value:n,placeholder:r?"Claude is working…":u.length?"Ask about what you selected…":"Ask about this map…",onChange:c=>i(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),!r&&n.trim()&&l())},"aria-label":"Ask a question about the map"}),h.jsx("button",{type:"submit",className:"send",disabled:r||!n.trim(),"aria-label":"Send",children:"↑"})]})}function K2({map:e,tour:t,onTour:n,selected:r,children:o}){const i=e.tour.length,s=i>0&&t===null;return!s&&!o?null:h.jsxs("div",{className:"dock",children:[s&&h.jsxs("section",{className:"dock-part dock-walk","aria-label":"Walkthrough",children:[h.jsx("h2",{className:"dock-title",children:"Walkthrough"}),h.jsxs("button",{className:"dock-start",onClick:()=>n(0),children:["Take the walkthrough ",h.jsxs("span",{className:"muted",children:[i," ",i===1?"stop":"stops"]})]})]}),o&&h.jsxs("section",{className:"dock-part dock-ask","aria-label":"Ask about the map",children:[h.jsxs("div",{className:"dock-head",children:[h.jsx("h2",{className:"dock-title",children:"Ask about the map"}),h.jsx("span",{className:"dock-hint",children:r?"Shift-click to add more":"Click a box or arrow to ask about it"})]}),o]})]})}function Q2({state:e,dispatch:t}){const n=e.answers[e.answers.length-1];return n?h.jsx("div",{className:"history-corner",children:h.jsxs("button",{className:"pill-btn history-btn",onClick:()=>t({type:"show",answerId:n.id}),title:"Open the conversation about this map",children:["Conversation ",h.jsx("span",{className:"muted",children:e.answers.length})]})}):null}const G2="modulepreload",q2=function(e){return"/"+e},rh={},Z2=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(a=>{if(a=q2(a),a in rh)return;rh[a]=!0;const u=a.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":G2,u||(f.as="script"),f.crossOrigin="",f.href=a,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((d,p)=>{f.addEventListener("load",d),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})}))}function i(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return o.then(s=>{for(const l of s||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Vn=232,Rn=96;function Hs(e,t){var i;const n=((i=e.nodes[t])==null?void 0:i.y)??0,r=e.rowTops??[];let o=0;for(const[s,l]of r.entries())n>=l-1&&(o=s);return o}const J2=132;function oh(e,t=!1){return e==="choice"?{w:196,h:132}:e==="action"?{w:196,h:60}:t?{w:232,h:64+J2}:{w:196,h:72}}let eC=null;const Mc=()=>eC??(eC=Z2(()=>import("./elk.bundled-B6ubuFvT.js").then(e=>e.e),[]).then(e=>new e.default)),$c={"elk.algorithm":"layered","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"};function Pc(e,t){const n=new Set(e.nodes.map(r=>r.id));return[...e.edges.map(r=>({id:`e:${r.id}`,from:r.from,to:r.to})),...e.absences.flatMap(r=>r.between?[{id:`a:${r.id}`,from:r.between.from,to:r.between.to}]:[]),...t.map(r=>({id:`x:${r.id}`,from:r.from,to:r.to}))].filter(r=>n.has(r.from)&&n.has(r.to)&&r.from!==r.to)}const ht={top:52,side:26,bottom:26},lr=64,rs=44,tC=56,nC=140;async function S0(e,t,n,r){const o=await e.layout({id:t,layoutOptions:{...$c,"elk.direction":"DOWN","elk.padding":`[top=${ht.top},left=${ht.side},bottom=${ht.bottom},right=${ht.side}]`,"elk.layered.spacing.nodeNodeBetweenLayers":String(lr),"elk.spacing.nodeNode":String(rs)},children:n.map(s=>({id:s.id,width:Vn,height:Rn})),edges:r.map(s=>({id:s.id,sources:[s.from],targets:[s.to]}))}),i={};for(const s of o.children??[])i[s.id]={x:s.x??0,y:s.y??0,w:Vn,h:Rn};return{nodes:i,size:{w:o.width??Vn+2*ht.side,h:o.height??Rn+ht.top+ht.bottom}}}function rC(e,t){const n=e.nodes.filter(o=>!t.has(o.id)),r=new Set(n.map(o=>o.id));return{...e,areas:e.areas.filter(o=>!t.has(o.id)),nodes:n,edges:e.edges.filter(o=>!t.has(o.id)&&r.has(o.from)&&r.has(o.to)),absences:e.absences.filter(o=>!t.has(o.id)&&(!o.between||r.has(o.between.from)&&r.has(o.between.to)))}}async function oC(e,t=[],n=new Set,r=new Set){var C;if(e.view==="journey")return iC(e,t,r);const o=e.nodes.filter(E=>n.has(E.id));if(!o.length)return sh(e,t);const i=rC(e,n),s=new Set(i.nodes.map(E=>E.id)),l=await sh(i,t.filter(E=>s.has(E.from)&&s.has(E.to))),a=await Mc(),u=Object.fromEntries(Object.entries(l.areas).map(([E,N])=>[E,{...N}])),c={...l.nodes},f={},d={};for(const E of o)(d[C=E.area]??(d[C]=[])).push(E);for(const[E,N]of Object.entries(d)){const j=u[E];if(!j)continue;const P=Math.max(1,Math.floor((j.w-2*ht.side+rs)/(Vn+rs))),A=Math.max(ht.top-lr,...i.nodes.filter(H=>H.area===E).map(H=>{var F;return(((F=c[H.id])==null?void 0:F.y)??0)+Rn}))+lr;N.forEach((H,F)=>{c[H.id]={x:ht.side+F%P*(Vn+rs),y:A+Math.floor(F/P)*(Rn+lr),w:Vn,h:Rn}});const R=Math.max(j.h,A+Math.ceil(N.length/P)*(Rn+lr)-lr+ht.bottom);f[E]=R-j.h,j.h=R}const p=Object.fromEntries(Object.entries(l.areas).map(([E,N])=>[E,N])),y=Object.keys(p).sort((E,N)=>p[E].y-p[N].y),x={};for(const E of y){const N=p[E];x[E]=Math.max(0,...y.filter(j=>j!==E&&x[j]!==void 0).filter(j=>{const P=p[j];return P.y+P.h<=N.y+1&&P.x<N.x+N.w&&N.x<P.x+P.w}).map(j=>x[j]+(f[j]??0))),u[E].y+=x[E]}const k=Pc(e,t),m=new Map(e.nodes.map(E=>[E.id,E.area])),v=Math.max(0,...Object.values(u).map(E=>E.x+E.w))+nC;let g=0;for(const E of e.areas){if(u[E.id])continue;const N=e.nodes.filter(A=>A.area===E.id);if(!N.length)continue;const j=k.filter(A=>m.get(A.from)===E.id&&m.get(A.to)===E.id),P=await S0(a,E.id,N,j);Object.assign(c,P.nodes),u[E.id]={x:v,y:g,w:P.size.w,h:P.size.h},g+=P.size.h+tC}const w=Object.values(u);return{areas:u,nodes:c,width:Math.max(0,...w.map(E=>E.x+E.w)),height:Math.max(0,...w.map(E=>E.y+E.h))}}const ih=1900,fu=130;async function iC(e,t,n){const o=await(await Mc()).layout({id:"root",layoutOptions:{...$c,"elk.direction":"RIGHT","elk.layered.cycleBreaking.strategy":"MODEL_ORDER","elk.layered.spacing.nodeNodeBetweenLayers":"176","elk.spacing.nodeNode":"56","elk.spacing.componentComponent":"72"},children:e.nodes.map(p=>({id:p.id,width:oh(p.kind,n.has(p.id)).w,height:oh(p.kind,n.has(p.id)).h})),edges:Pc(e,t).map(p=>({id:p.id,sources:[p.from],targets:[p.to]}))}),i={};for(const p of o.children??[])i[p.id]={x:p.x??0,y:p.y??0,w:p.width??0,h:p.height??0};const s=o.width??0;if(s<=ih)return{areas:{},nodes:i,width:s,height:o.height??0,flat:!0};const l=[];for(const[p,y]of Object.entries(i).sort((x,k)=>x[1].x+x[1].w/2-(k[1].x+k[1].w/2))){const x=l[l.length-1];x&&y.x+y.w/2<x.right?(x.ids.push(p),x.left=Math.min(x.left,y.x),x.right=Math.max(x.right,y.x+y.w)):l.push({left:y.x,right:y.x+y.w,ids:[p]})}const a=Math.ceil(s/ih),u=Math.ceil(l.length/a);let c=0,f=0;const d=[];for(let p=0;p*u<l.length;p++){const y=l.slice(p*u,(p+1)*u),x=y.flatMap(v=>v.ids),k=y[0].left,m=Math.min(...x.map(v=>i[v].y));d.push(c);for(const v of x)i[v]={...i[v],x:i[v].x-k,y:i[v].y-m+c};c=Math.max(...x.map(v=>i[v].y+i[v].h))+fu,f=Math.max(f,y[y.length-1].right-k)}return{areas:{},nodes:i,width:f,height:c-fu,flat:!0,rowTops:d}}async function sh(e,t){const n=await Mc(),r=new Map(e.nodes.map(c=>[c.id,c.area])),o=Pc(e,t),i={},s={};for(const c of e.areas){const f=e.nodes.filter(y=>y.area===c.id);if(!f.length)continue;const d=o.filter(y=>r.get(y.from)===c.id&&r.get(y.to)===c.id),p=await S0(n,c.id,f,d);Object.assign(i,p.nodes),s[c.id]=p.size}const l=new Map;for(const c of o){const f=r.get(c.from),d=r.get(c.to);f!==d&&s[f]&&s[d]&&l.set(`${f}>${d}`,{from:f,to:d})}const a=await n.layout({id:"root",layoutOptions:{...$c,"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"120","elk.spacing.nodeNode":"48","elk.spacing.componentComponent":"64"},children:e.areas.filter(c=>s[c.id]).map(c=>({id:c.id,width:s[c.id].w,height:s[c.id].h})),edges:[...l.values()].map((c,f)=>({id:`p${f}`,sources:[c.from],targets:[c.to]}))}),u={};for(const c of a.children??[])u[c.id]={x:c.x??0,y:c.y??0,w:c.width??0,h:c.height??0};return{areas:u,nodes:i,width:a.width??0,height:a.height??0}}function sC(e,t,n,r){if(t.flat){const c=y=>{const x=t.nodes[y];return x?{x:x.x+x.w/2,y:x.y+x.h/2}:{x:0,y:0}},f=c(r).x-c(n).x,d=c(r).y-c(n).y;if(Math.abs(f)<40)return d>=0?["b","t"]:["t","b"];const p=Hs(t,r)-Hs(t,n);return p?p>0?["b","t"]:["r","b"]:f>=0?["r","l"]:["l","r"]}const o=c=>{var f;return((f=e.nodes.find(d=>d.id===c))==null?void 0:f.area)??""},i=c=>{const f=t.areas[o(c)],d=t.nodes[c];return f&&d?{x:f.x+d.x+d.w/2,y:f.y+d.y+d.h/2}:{x:0,y:0}},s=i(n),l=i(r),a=l.x-s.x,u=l.y-s.y;return o(n)===o(r)||Math.abs(a)<Vn*.75?u>=0?["b","t"]:["t","b"]:a>=0?["r","l"]:["l","r"]}function lC(e,t=[],n=[],r=[]){return JSON.stringify([e.view==="journey"?[e.nodes.map(o=>o.kind),[...r].sort()]:null,[...n].sort(),e.areas.map(o=>o.id),e.nodes.map(o=>`${o.id}@${o.area}`),e.edges.map(o=>`${o.from}>${o.to}`),e.absences.map(o=>o.between?`${o.between.from}~${o.between.to}`:""),t.map(o=>`${o.from}+${o.to}`)])}const Sn=(...e)=>e.filter(Boolean).join(" "),Bn={add:{pending:"Proposed",done:"Now in the code",mark:"+",title:"Proposed: not in the code yet"},change:{pending:"Would change",done:"Changed",mark:"~",title:"Proposed: this code would change"},remove:{pending:"Would be removed",done:"Removed",mark:"−",title:"Proposed: this code would be removed"}},yl=e=>e&&`proposal proposal-${e.kind} proposal-${e.state}`,Un={added:{label:"Added",mark:"+",title:"New since the commit this map is compared with"},changed:{label:"Changed",mark:"~",title:"Different from the commit this map is compared with"},removed:{label:"Removed",mark:"−",title:"Was in the code at the commit this map is compared with, and is gone now"}},vl=e=>e&&`change change-${e}`,Vs={later:{label:"Not there yet",title:"Added after this version of the code"},gone:{label:"Gone",title:"Removed: it was in the code before, and isn’t now"}};function aC(e){if(!(e!=null&&e.length))return null;const t=e.filter(r=>r.startsWith("+ ")).length,n=e.filter(r=>r.startsWith("- ")).length;return[t&&`+${t}`,n&&`−${n}`].filter(Boolean).join(" ")||null}const uC=[["before","Before","The code as it was at that commit; what was added since is a shadow"],["after","After","The code as it is now; what was removed is a shadow"],["both","Both","The code as it is now, with what was removed drawn in too"]];function cC({commit:e,when:t,onWhen:n}){return h.jsxs("div",{className:"change-key",children:[h.jsx("div",{className:"seg",role:"group","aria-label":"Which version of the code to show",children:uC.map(([r,o,i])=>h.jsx("button",{className:Sn("seg-btn",t===r&&"on"),title:i,"aria-pressed":t===r,onClick:()=>n(r),children:o},r))}),h.jsx("span",{className:"change-key-title",children:t==="before"?`The code at ${e}`:t==="after"?"The code now":`Now, compared with ${e}`}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch"}),"Same as before"]}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-added"}),"Added"]}),h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:Sn("key-swatch key-changed",t!=="both"&&"key-quiet")}),t==="before"?"Changes later":"Changed"]}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-removed"}),"Removed (only in the before)"]}),t!=="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-ghost"}),t==="before"?"Not there yet":"Gone"]})]})}const Oi={entry:["Where it starts","▸"],store:["Saved data","▤"],external:["Outside the app","↗"],job:["Background job","◷"]},lh=[["t",Z.Top],["r",Z.Right],["b",Z.Bottom],["l",Z.Left]];function E0(){return h.jsxs(h.Fragment,{children:[lh.map(([e,t])=>h.jsx(Br,{id:`s${e}`,type:"source",position:t,className:"handle",isConnectable:!1},`s${e}`)),lh.map(([e,t])=>h.jsx(Br,{id:`t${e}`,type:"target",position:t,className:"handle",isConnectable:!1},`t${e}`))]})}function dC({data:e}){var t,n,r;return e.journey?h.jsx(fC,{data:e}):h.jsxs("div",{className:Sn("step","nopan",`kind-${e.kind}`,!e.confirmed&&"unconfirmed",yl(e.proposal),vl(e.change),e.quiet&&"quiet",e.ghost&&"ghost",e.selected&&"selected",e.hl&&"hl",e.dim&&"dim"),onClick:o=>{o.stopPropagation(),e.onClick(o.shiftKey||o.metaKey)},children:[h.jsx(E0,{}),(Oi[e.kind]||e.fresh||e.screen||e.proposal||e.change||e.ghost)&&h.jsxs("div",{className:"step-head",children:[e.ghost&&h.jsx("span",{className:"badge-ghost",title:Vs[e.ghost].title,children:Vs[e.ghost].label}),e.proposal&&h.jsx("span",{className:"badge-proposal",children:Bn[e.proposal.kind][e.proposal.state]}),e.change&&h.jsxs("span",{className:"badge-change",title:Un[e.change].title,children:[e.quiet==="before"?"Changes later":Un[e.change].label,e.changeSize&&!e.quiet&&h.jsxs("span",{className:"change-size",children:[" ",e.changeSize]})]}),Oi[e.kind]&&!e.proposal&&!e.change&&!e.ghost&&h.jsxs(h.Fragment,{children:[h.jsx("i",{className:"step-mark","aria-hidden":"true",children:Oi[e.kind][1]}),Oi[e.kind][0]]}),e.screen&&h.jsx("span",{className:"badge-screen",title:"Select this step to see the screen",children:"▣ Screen"}),e.fresh&&h.jsx("span",{className:"badge-new",children:"New"})]}),h.jsx("div",{className:"step-name",title:e.name,children:e.name}),h.jsxs("div",{className:"step-code",title:((t=e.proposal)==null?void 0:t.state)==="pending"?Bn[e.proposal.kind].title:e.confirmed?"Confirmed against the code":"The checker couldn't confirm this against the code",children:[((n=e.proposal)==null?void 0:n.state)==="pending"&&e.proposal.kind==="add"?h.jsx("span",{className:"pmark",children:"+"}):((r=e.proposal)==null?void 0:r.state)==="done"&&e.proposal.kind!=="add"?h.jsx("span",{className:"pmark",children:Bn[e.proposal.kind].mark}):e.change&&e.confirmed?h.jsx("span",{className:"cmark",children:Un[e.change].mark}):h.jsx("span",{className:e.confirmed?"tick":"qmark",children:e.confirmed?"✓":"?"}),h.jsx("span",{className:"step-sub",children:e.sub})]})]})}function fC({data:e}){const t=e.journey,n=e.proposal;return h.jsxs("div",{className:Sn("step","jstep","nopan",`j-${t.shape}`,t.show&&"j-pictured",t.outside&&"j-outside",!e.confirmed&&"unconfirmed",yl(n),vl(e.change),e.quiet&&"quiet",e.ghost&&"ghost",e.selected&&"selected",e.hl&&"hl",e.dim&&"dim"),style:{width:t.w,height:t.h},onClick:r=>{r.stopPropagation(),e.onClick(r.shiftKey||r.metaKey)},children:[h.jsx(E0,{}),t.stage&&h.jsx("div",{className:"j-stage",children:t.stage}),t.shape==="choice"&&h.jsx("svg",{className:"j-diamond",viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",children:h.jsx("polygon",{points:"50,1 99,50 50,99 1,50",vectorEffect:"non-scaling-stroke"})}),h.jsxs("div",{className:"j-tags",children:[n&&h.jsx("span",{className:"badge-proposal",children:Bn[n.kind][n.state]}),e.ghost&&h.jsx("span",{className:"badge-ghost",title:Vs[e.ghost].title,children:Vs[e.ghost].label}),e.change&&h.jsx("span",{className:"badge-change",title:Un[e.change].title,children:e.quiet==="before"?"Changes later":Un[e.change].label}),!e.confirmed&&h.jsx("span",{className:"j-q",title:"The checker couldn't confirm this against the code",children:"?"}),e.fresh&&h.jsx("span",{className:"badge-new",children:"New"})]}),t.show&&h.jsx(j2,{show:t.show,name:e.name}),h.jsx("div",{className:"j-name",title:e.name,children:e.name}),t.outside&&t.shape!=="choice"&&h.jsx("div",{className:"j-note",children:"Outside the app"})]})}function hC({data:e}){return h.jsx("div",{className:Sn("area",e.dim&&"dim"),children:h.jsxs("div",{className:"area-label",children:[e.label,e.note&&h.jsxs("span",{className:"area-note",children:[" ",e.note]})]})})}function pC(e,t,n,r,o){const i=Math.hypot(n-e,r-t)||1,s=-(r-t)/i,l=(n-e)/i,a=(e+n)/2+s*o*2,u=(t+r)/2+l*o*2;return[`M ${e} ${t} Q ${a} ${u} ${n} ${r}`,(e+n)/2+s*o,(t+r)/2+l*o]}function mC(e,t=18){let n=`M ${e[0][0]} ${e[0][1]}`;for(let i=1;i<e.length-1;i++){const[s,l]=e[i-1],[a,u]=e[i],[c,f]=e[i+1],d=Math.min(t,Math.hypot(a-s,u-l)/2),p=Math.min(t,Math.hypot(c-a,f-u)/2),y=Math.sign(a-s),x=Math.sign(u-l),k=Math.sign(c-a),m=Math.sign(f-u);n+=` L ${a-y*d} ${u-x*d} Q ${a} ${u} ${a+k*p} ${u+m*p}`}const r=e[e.length-1];n+=` L ${r[0]} ${r[1]}`;let o=[0,e[0][0],e[0][1]];for(let i=1;i<e.length;i++){const[s,l]=e[i-1],[a,u]=e[i];l===u&&Math.abs(a-s)>o[0]&&(o=[Math.abs(a-s),(s+a)/2,u])}return[n,o[1],o[2]]}function gC({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:s,markerEnd:l,data:a}){const[u,c,f]=(a==null?void 0:a.wrapY)!==void 0&&i===Z.Right?mC([[t,n],[t+30,n],[t+30,a.wrapY],[r,a.wrapY],[r,o]]):(a==null?void 0:a.wrapY)!==void 0?Rs({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s,borderRadius:18,centerY:a.wrapY}):a!=null&&a.offset?pC(t,n,r,o,a.offset):wc({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s});return a?h.jsxs(h.Fragment,{children:[a.selected&&h.jsx("path",{d:u,className:"edge-halo"}),h.jsx(ci,{id:e,path:u,markerEnd:l,interactionWidth:18}),h.jsx(G_,{children:h.jsxs("div",{className:Sn("link-label",`link-${a.variant}`,!a.confirmed&&"unconfirmed",yl(a.proposal),vl(a.change),a.ghost&&"ghost",a.hl&&"hl",a.dim&&"dim",a.selected&&"selected","nodrag nopan"),style:{transform:`translate(-50%, -50%) translate(${c}px, ${f}px)`},onClick:d=>{var p;d.stopPropagation(),(p=a.onClick)==null||p.call(a,d.shiftKey||d.metaKey)},children:[a.variant==="absence"&&h.jsx("span",{className:"gap-q","aria-hidden":"true",children:"?"}),a.proposal&&h.jsx("span",{className:"pmark",title:a.proposal.state==="done"?Bn[a.proposal.kind].done:Bn[a.proposal.kind].title,children:a.proposal.state==="done"&&a.proposal.kind==="add"?"✓":Bn[a.proposal.kind].mark}),a.change&&h.jsx("span",{className:"cmark",title:Un[a.change].title,children:Un[a.change].mark}),h.jsx("span",{className:"link-text",children:a.label}),!a.confirmed&&a.variant==="edge"&&h.jsx("span",{className:"q",children:" ?"})]})})]}):null}const yC={step:dC,area:hC},vC={link:gC};function ah(e,t){const n=new Set;for(const r of t){e.nodes.some(s=>s.id===r)&&n.add(r);const o=e.edges.find(s=>s.id===r);o&&n.add(o.from).add(o.to);const i=e.absences.find(s=>s.id===r);i!=null&&i.between&&n.add(i.between.from).add(i.between.to)}return[...n]}const xC="440px",wC=e=>e.length>28?`${e.slice(0,26)}…`:e;function kC(e){var j,P,A,R,H,F,S,T;const t=(j=e.ghost)!=null&&j.connects&&e.map.nodes.some(_=>_.id===e.ghost.connects.from)&&e.map.nodes.some(_=>_.id===e.ghost.connects.to)?e.ghost:null,n=b.useMemo(()=>t!=null&&t.connects?[{id:t.id,from:t.connects.from,to:t.connects.to}]:[],[t]),r=b.useMemo(()=>e.map.view==="journey"?e.map.nodes.filter(_=>{var z,$,M;return _.kind!=="action"&&_.kind!=="choice"&&((M=($=(z=e.report)==null?void 0:z.screens)==null?void 0:$[_.id])==null?void 0:M.status)==="confirmed"}).map(_=>_.id):[],[e.map,e.report]),o=lC(e.map,n,e.added,r),[i,s]=b.useState(null),l=ml(),[a,u]=b.useState("both"),f=!!((A=(P=e.report)==null?void 0:P.since)!=null&&A.commit)?a:"both",d=_=>{var z,$,M,L,I,D;return((M=($=(z=e.report)==null?void 0:z.nodes[_])==null?void 0:$.change)==null?void 0:M.kind)??((D=(I=(L=e.report)==null?void 0:L.edges[_])==null?void 0:I.change)==null?void 0:D.kind)??null},p=_=>f==="before"&&d(_)==="added"?"later":f==="after"&&d(_)==="removed"?"gone":null,y=_=>f==="both"||_==="changed"?_:null;b.useEffect(()=>{let _=!0;return oC(e.map,n,new Set(e.added),new Set(r)).then(z=>_&&s({key:o,layout:z})),()=>{_=!1}},[o]);const x=(R=e.view)!=null&&R.highlight.length?new Set(e.view.highlight):null,k=b.useMemo(()=>x?new Set(ah(e.map,[...x])):null,[x,e.map]),m=e.selection,v=b.useMemo(()=>{if(!i)return[];const _=i.layout,z=I=>!k||e.map.nodes.some(D=>D.area===I&&k.has(D.id)),$=e.map.areas.flatMap(I=>{const D=_.areas[I.id];return D?[{id:`area:${I.id}`,type:"area",position:{x:D.x,y:D.y},style:{width:D.w,height:D.h},data:{label:I.label,note:null,dim:!z(I.id)},selectable:!1,draggable:!1,zIndex:0}]:[]}),M=new Map;if(_.flat)for(const I of e.map.areas){const D=e.map.nodes.filter(U=>U.area===I.id&&_.nodes[U.id]).sort((U,W)=>_.nodes[U.id].x-_.nodes[W.id].x||_.nodes[U.id].y-_.nodes[W.id].y)[0];D&&M.set(D.id,I.label)}const L=e.map.nodes.flatMap(I=>{var G,V,X,O,Y,q,J,Q,ee,te,ne,re,se,Ne,be;const D=_.nodes[I.id];if(!D)return[];const U=I.evidence[0],W=I.symbol?I.symbol.slice(I.symbol.indexOf("#")+1):U?`${U.file.split("/").pop()}:${U.line}`:"not in the code yet";return[{id:I.id,type:"step",..._.flat?{}:{parentId:`area:${I.area}`,extent:"parent"},position:{x:D.x,y:D.y},data:{name:I.name,sub:W,kind:I.kind,confirmed:!!e.report&&((G=e.report.nodes[I.id])==null?void 0:G.status)!=="unconfirmed",proposal:((X=(V=e.report)==null?void 0:V.nodes[I.id])==null?void 0:X.proposal)??null,screen:((q=(Y=(O=e.report)==null?void 0:O.screens)==null?void 0:Y[I.id])==null?void 0:q.status)==="confirmed",selected:m.nodes.includes(I.id),hl:!!(k!=null&&k.has(I.id)),dim:!!k&&!k.has(I.id),fresh:e.fresh.includes(I.id),change:y(((ee=(Q=(J=e.report)==null?void 0:J.nodes[I.id])==null?void 0:Q.change)==null?void 0:ee.kind)??null),changeSize:aC((re=(ne=(te=e.report)==null?void 0:te.nodes[I.id])==null?void 0:ne.change)==null?void 0:re.diff),ghost:p(I.id),quiet:f==="both"?null:f,..._.flat&&{journey:{w:D.w,h:D.h,shape:I.kind==="choice"?"choice":I.kind==="action"?"action":"screen",outside:I.kind==="external",stage:M.get(I.id)??null,show:r.includes(I.id)?((be=(Ne=(se=e.report)==null?void 0:se.screens)==null?void 0:Ne[I.id])==null?void 0:be.show)??null:null}},onClick:et=>e.onSelect("nodes",I.id,et)},draggable:!1,zIndex:1}]});return[...$,...L]},[i,e.map,e.report,m,k,e.fresh,e.onSelect,r,f]),g=b.useMemo(()=>{var W,G;if(!i)return[];const _=V=>({type:Xo.ArrowClosed,width:16,height:16,color:V}),z=V=>!!(x!=null&&x.has(V)),$=(V,X)=>{const[O,Y]=sC(e.map,i.layout,V,X);return{sourceHandle:`s${O}`,targetHandle:`t${Y}`}},M=new Map,L=(V,X)=>{const O=i.layout.rowTops,Y=Hs(i.layout,V),q=Hs(i.layout,X);if(!O||Y===q)return;const J=Math.max(Y,q),Q=M.get(J)??0;return M.set(J,Q+1),O[J]-fu/2+(Q%2?1:-1)*Math.ceil(Q/2)*18},I=e.map.edges.map(V=>{var ee,te,ne,re,se,Ne;const X=!!e.report&&((ee=e.report.edges[V.id])==null?void 0:ee.status)!=="unconfirmed",O=((ne=(te=e.report)==null?void 0:te.edges[V.id])==null?void 0:ne.proposal)??null,Y=y(((Ne=(se=(re=e.report)==null?void 0:re.edges[V.id])==null?void 0:se.change)==null?void 0:Ne.kind)??null),q=p(V.id)??p(V.from)??p(V.to),J=z(V.id)||!!k&&k.has(V.from)&&k.has(V.to)&&!x,Q="edge";return{id:`e:${V.id}`,source:V.from,target:V.to,...$(V.from,V.to),type:"link",className:Sn("link",`link-${Q}`,!X&&"unconfirmed",yl(O),vl(Y),q&&"ghost",z(V.id)&&"hl",!!x&&!z(V.id)&&"dim",m.edges.includes(V.id)&&"selected"),markerEnd:_(q?"var(--line)":(O==null?void 0:O.state)==="pending"&&O.kind!=="remove"?"var(--ai)":Y==="added"?"var(--ok)":Y==="removed"?"var(--dead)":z(V.id)?"var(--path)":"var(--line-strong)"),zIndex:2,data:{label:V.label,wrapY:L(V.from,V.to),variant:Q,proposal:O,change:Y,ghost:q,confirmed:X,hl:J,dim:!!x&&!z(V.id),selected:m.edges.includes(V.id),onClick:be=>e.onSelect("edges",V.id,be)}}}),D=V=>{var X;return((X=t==null?void 0:t.connects)==null?void 0:X.from)===V.from&&t.connects.to===V.to};for(const V of e.map.absences){if(!V.between||D(V.between))continue;const X=((G=(W=e.report)==null?void 0:W.absences[V.id])==null?void 0:G.status)==="confirmed";I.push({id:`a:${V.id}`,hidden:f==="before",source:V.between.from,target:V.between.to,...$(V.between.from,V.between.to),type:"link",className:Sn("link","link-absence",!X&&"unconfirmed",z(V.id)&&"hl",!!x&&!z(V.id)&&"dim",m.absences.includes(V.id)&&"selected"),markerEnd:_("var(--dead)"),zIndex:2,data:{label:wC(V.claim),variant:"absence",confirmed:X,hl:z(V.id),dim:!!x&&!z(V.id),selected:m.absences.includes(V.id),onClick:O=>e.onSelect("absences",V.id,O)}})}t!=null&&t.connects&&I.push({id:`g:${t.id}`,source:t.connects.from,target:t.connects.to,...$(t.connects.from,t.connects.to),type:"link",className:"link link-ghost",markerEnd:_("var(--ok)"),zIndex:3,data:{label:`+ ${t.connects.label}`,variant:"ghost",confirmed:!0,hl:!0,dim:!1,selected:!1}});const U=new Map;for(const V of I){const X=[V.source,V.target].sort().join("|");U.set(X,[...U.get(X)??[],V])}for(const V of U.values())V.length<2||V.forEach((X,O)=>{X.data&&(X.data.offset=(O-(V.length-1)/2)*44)});return I},[i,e.map,e.report,m,x,k,t,e.onSelect,f]),w=ie(_=>_.width),C=b.useRef(0);b.useEffect(()=>{const _=C.current;if(C.current=w,!_||!w||_===w)return;const z=l.getViewport();l.setViewport({...z,x:z.x+(w-_)/2})},[w]);const E=JSON.stringify([i==null?void 0:i.key,(H=e.view)==null?void 0:H.focus,(F=e.view)==null?void 0:F.highlight,e.touring]),N=b.useRef(!0);return b.useEffect(()=>{if(!i)return;const _=e.view?ah(e.map,e.view.highlight.length?e.view.highlight:e.view.focus?[e.view.focus]:[]):[];let z=0,$=0;const M=()=>{const L=l.getNodes();if(z<2||!L.length||!L.every(U=>{var W,G;return(G=(W=l.getInternalNode(U.id))==null?void 0:W.measured)==null?void 0:G.width})){z++<60&&($=requestAnimationFrame(M));return}const I=N.current?0:650;N.current=!1;const D=_.length?{top:"60px",left:e.touring?xC:"60px",right:"60px",bottom:"150px"}:{top:"64px",left:"32px",right:"32px",bottom:"130px"};l.fitView(_.length?{nodes:_.map(U=>({id:U})),duration:I,padding:D,maxZoom:1.15}:{duration:I,padding:D,maxZoom:1.1})};return $=requestAnimationFrame(M),()=>cancelAnimationFrame($)},[E]),h.jsxs(K_,{className:i!=null&&i.layout.flat?"journey":void 0,nodes:v,edges:g,nodeTypes:yC,edgeTypes:vC,onNodeClick:()=>{},onEdgeClick:(_,z)=>{z.id.startsWith("e:")&&e.onSelect("edges",z.id.slice(2),_.shiftKey||_.metaKey),z.id.startsWith("a:")&&e.onSelect("absences",z.id.slice(2),_.shiftKey||_.metaKey)},onPaneClick:e.onClear,panOnDrag:!0,elementsSelectable:!1,nodesDraggable:!1,nodesConnectable:!1,minZoom:.15,maxZoom:2,children:[h.jsx(t2,{variant:Ut.Dots,gap:22,size:1.3}),((T=(S=e.report)==null?void 0:S.since)==null?void 0:T.commit)&&h.jsx(ui,{position:"top-left",children:h.jsx(cC,{commit:e.report.since.commit.slice(0,7),when:f,onWhen:u})})]})}function xl(e){e!==`${location.pathname}${location.search}`&&(history.pushState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate")))}function SC(){const[e,t]=b.useState(location.pathname);return b.useEffect(()=>{const n=()=>t(location.pathname),r=o=>{var s,l;if(o.defaultPrevented||o.button!==0||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey)return;const i=(l=(s=o.target)==null?void 0:s.closest)==null?void 0:l.call(s,"a[href]");!(i instanceof HTMLAnchorElement)||i.target||i.origin!==location.origin||(o.preventDefault(),xl(`${i.pathname}${i.search}`))};return window.addEventListener("popstate",n),document.addEventListener("click",r),()=>{window.removeEventListener("popstate",n),document.removeEventListener("click",r)}},[]),e}function N0({busy:e,onStopped:t,onError:n}){return h.jsx("button",{className:"pill-btn",disabled:e,title:e?"Claude is still working":"Maps stay saved. Undo for applied fixes ends.",onClick:()=>cn.stop().then(t,r=>n(r.message)),children:"Stop illuminate"})}function EC(){return h.jsxs("main",{className:"home",children:[h.jsx("h1",{children:"illuminate has stopped"}),h.jsx("p",{className:"muted lede",children:"You can close this tab."}),h.jsxs("p",{className:"muted lede",children:["Maps are saved in ",h.jsx("code",{children:".illuminate/maps"}),". Run ",h.jsx("code",{children:"illume open"})," in the repo to see them again."]})]})}function NC({onStopped:e}){const[t,n]=b.useState(""),[r,o]=b.useState(null),[i,s]=b.useState([]),[l,a]=b.useState(""),[u,c]=b.useState(null),[f,d]=b.useState(!1);b.useEffect(()=>y0(()=>{},()=>{},e),[e]),b.useEffect(()=>{cn.list().then(y=>{n(y.repo),o(y.maps),s(y.making)},y=>c(y.message))},[]);const p=async()=>{if(l.trim()){d(!0);try{const{id:y}=await cn.make(l.trim());xl(Mt(y))}catch(y){c(y.message),d(!1)}}};return h.jsxs("main",{className:"home",children:[h.jsxs("div",{className:"home-brand",children:[h.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate",t&&h.jsx("span",{className:"muted",children:t})]}),h.jsx("h1",{children:"Ask how your code works"}),h.jsx("p",{className:"muted lede",children:"Every box and arrow is checked against the code."}),h.jsxs("form",{className:"home-ask",onSubmit:y=>{y.preventDefault(),p()},children:[h.jsx("input",{id:"question",value:l,onChange:y=>a(y.target.value),placeholder:"What happens when a user signs up?","aria-label":"Your question",autoFocus:!0}),h.jsx("button",{className:"btn primary",disabled:f||!l.trim(),children:f?"Starting…":"Map it"})]}),u&&h.jsx("div",{className:"banner banner-dead",role:"alert",children:u}),i.length>0&&h.jsxs("section",{children:[h.jsx("h2",{className:"section-title",children:"Being made now"}),h.jsx("ul",{className:"maplist",children:i.map(y=>h.jsxs("li",{children:[h.jsx("a",{href:Mt(y.id),children:y.question}),h.jsx("span",{className:"muted small",children:"Claude is exploring…"})]},y.id))})]}),h.jsxs("section",{children:[h.jsx("h2",{className:"section-title",children:"Maps in this repo"}),r===null?h.jsx("p",{className:"muted",children:"Loading…"}):r.length===0?h.jsx("p",{className:"muted",children:"None yet."}):h.jsx("ul",{className:"maplist",children:r.map(y=>h.jsxs("li",{children:[h.jsx("a",{href:Mt(y.id),children:y.question}),h.jsxs("span",{className:"muted small",children:[new Date(y.updatedAt).toLocaleString(),y.commit?` · ${y.commit.slice(0,7)}`:""]})]},y.id))})]}),h.jsx("footer",{className:"home-foot",children:h.jsx(N0,{busy:i.length>0,onStopped:e,onError:c})})]})}const uh="illuminate-panel-width",hu=300,_0=400,_C=360,ia=e=>Math.round(Math.max(hu,Math.min(e,Math.max(hu,window.innerWidth-_C))));function CC(){const[e,t]=b.useState(()=>{const r=Number(localStorage.getItem(uh));return ia(r>0?r:_0)}),n=b.useCallback(r=>{const o=ia(r);t(o),localStorage.setItem(uh,String(o))},[]);return b.useEffect(()=>{const r=()=>t(o=>ia(o));return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),[e,n]}function jC({width:e,onWidth:t}){return h.jsx("div",{className:"panel-handle",role:"separator","aria-orientation":"vertical","aria-label":"Panel width","aria-valuenow":e,"aria-valuemin":hu,tabIndex:0,title:"Drag to resize the panel",onPointerDown:n=>{n.preventDefault();const r=n.currentTarget;r.setPointerCapture(n.pointerId),document.body.classList.add("resizing");const o=s=>t(window.innerWidth-s.clientX),i=()=>{r.removeEventListener("pointermove",o),r.removeEventListener("pointerup",i),r.removeEventListener("pointercancel",i),document.body.classList.remove("resizing")};r.addEventListener("pointermove",o),r.addEventListener("pointerup",i),r.addEventListener("pointercancel",i)},onDoubleClick:()=>t(_0),onKeyDown:n=>{n.key==="ArrowLeft"&&(n.preventDefault(),t(e+24)),n.key==="ArrowRight"&&(n.preventDefault(),t(e-24))}})}const MC=(...e)=>e.filter(Boolean).join(" ");function $C({map:e,report:t,stop:n,onTour:r,onAsk:o}){var a;const i=e.tour[n];if(!i)return null;const s=n===e.tour.length-1,l=C2(e,t,i.focus.nodes??[]);return h.jsxs("section",{className:"card card-focus tour-bubble","aria-label":"Walkthrough","aria-live":"polite",children:[h.jsx("button",{className:"card-close","aria-label":"Leave the walkthrough",title:"Leave the walkthrough (Esc)",onClick:()=>r(null),children:"×"}),h.jsxs("div",{className:"tour-head",children:[h.jsxs("span",{className:"eyebrow",children:["Walkthrough, stop ",n+1," of ",e.tour.length]}),h.jsx("span",{className:"dots","aria-hidden":"true",children:e.tour.map((u,c)=>h.jsx("i",{className:MC(c===n&&"on",c<n&&"done")},u.id))})]}),h.jsx("h2",{className:"card-title",children:i.title}),h.jsx(qo,{text:i.text,className:"depth-text"}),l&&h.jsx(jc,{show:l.show,name:l.name}),(a=i.terms)!=null&&a.length?h.jsxs("p",{className:"muted small",children:["Terms: ",i.terms.join(", ")]}):null,h.jsxs("div",{className:"tour-nav",children:[h.jsx("button",{className:"btn",disabled:n===0,onClick:()=>r(n-1),children:"‹ Back"}),h.jsx("button",{className:"btn",onClick:()=>o(`About “${i.title}”: `),children:"Ask about this step"}),h.jsx("span",{className:"grow"}),s?h.jsx("button",{className:"btn primary",onClick:()=>r(null),children:"Done"}):h.jsx("button",{className:"btn primary",onClick:()=>r(n+1),children:"Next ›"})]}),h.jsx("div",{className:"kbd",children:"← → to step, Esc to leave"})]})}function PC(){return Ur?h.jsx(IC,{}):h.jsxs("main",{className:"home",children:[h.jsx("h1",{children:"Open illuminate from its link"}),h.jsxs("p",{className:"muted lede",children:["Use the link illuminate printed in your terminal (it ends in ",h.jsx("code",{children:"?t=…"}),")."]})]})}function IC(){const[e,t]=b.useState(!1),n=b.useCallback(()=>{window.close(),t(!0)},[]),r=SC();if(e)return h.jsx(EC,{});const o=/^\/m\/([a-z0-9-]{1,80})\/?$/.exec(r);return o?h.jsx(LC,{mapId:o[1],onStopped:n},o[1]):h.jsx(NC,{onStopped:n})}function TC({mapId:e,question:t}){const[n,r]=b.useState([]);b.useEffect(()=>{cn.list().then(i=>r([...i.making.map(s=>({...s,making:!0})),...i.maps.map(s=>({id:s.id,question:s.question}))]),()=>{})},[e]);const o=n.some(i=>i.id===e)?n:[{id:e,question:t},...n];return h.jsx("select",{className:"switcher",value:e,onChange:i=>xl(Mt(i.target.value)),"aria-label":"Switch to another map",title:"Switch to another map in this repo",children:o.map(i=>h.jsxs("option",{value:i.id,children:[i.question||i.id,i.making?" (being made)":""]},i.id))})}function zC({report:e}){if(!e)return null;const t=e.summary.unconfirmed,{pending:n,done:r}=e.summary.proposals??{pending:0,done:0},o=n+r,i=o?h.jsx("span",{className:"map-status proposals",title:"Parts of this map are a proposal, drawn in violet: they aren't in the code yet, or would change or go. illuminate checks the code to see which have been done.",children:r===0?`${o} proposed ${o===1?"change":"changes"}`:`${r} of ${o} proposed changes done`}):null,s=h.jsxs(h.Fragment,{children:[i,h.jsx(bC,{report:e})]});return t?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"map-status off",title:"Every time the map is shown, illuminate re-checks it against the code. These parts no longer hold, usually because the code changed after the map was made. They're dashed and marked ? on the map; click one to see why.",children:t===1?"1 part of this map doesn’t match the code":`${t} parts of this map don’t match the code`}),s]}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"map-status ok",title:"Every box and arrow on this map was just re-checked and is really in the code, and every gap's search still finds nothing. That shows each part is real; it doesn't show the map covers everything.",children:"✓ Every part is in the code"}),s]})}function bC({report:e}){const t=e.since;if(!t)return null;if(!t.commit)return h.jsx("span",{className:"map-status off",title:`This map compares the code with "${t.ref}", but that isn't a commit in this repo, so nothing could be compared.`,children:"Can’t find the commit this map compares with"});const{added:n,changed:r,removed:o}=e.summary.changes??{added:0,changed:0,removed:0},i=t.date?new Date(t.date).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):null,s=[n&&`${n} added`,r&&`${r} changed`,o&&`${o} removed`].filter(Boolean).join(" · ");return h.jsxs("span",{className:"map-status changes",title:`This map shows the code as it is now, compared with commit ${t.commit.slice(0,7)}${t.subject?` ("${t.subject}")`:""}. illuminate works out from the two versions which boxes and arrows are new, different or gone. It can't tell who made a change.`,children:["Changes since ",t.commit.slice(0,7),i?` (${i})`:"",s?`: ${s}`:": nothing on this map differs"]})}function LC({mapId:e,onStopped:t}){var P,A,R,H,F;const[n,r]=b.useReducer(D2,e,z2),[o,i]=b.useState(""),[s,l]=CC(),a=b.useRef(!1),u=b.useCallback(()=>{cn.get(e).then(S=>r({type:"loaded",payload:S}),S=>r(S instanceof g0&&/No such map/.test(S.message)?{type:"missing"}:{type:"error",message:S.message}))},[e]);b.useEffect(u,[u]),b.useEffect(()=>y0(S=>r({type:"event",event:S}),S=>{r({type:"connected",value:S}),S&&a.current===!1&&n.phase!=="loading"&&u(),a.current=S},t),[]);const c=b.useCallback(S=>{const T=S.trim();!T||n.job||cn.ask(e,T,n.selection).then(()=>i(""),_=>r({type:"error",message:_.message}))},[e,n.job,n.selection]),f=(S,T)=>{T==="approve"&&r({type:"fixStatus",fixId:S,status:"applying",problems:[]}),cn[T](e,S).catch(_=>{r(T==="approve"?{type:"fixStatus",fixId:S,status:"failed",problems:_.problems.length?_.problems:[_.message]}:{type:"error",message:[_.message,..._.problems].join(" ")})})},d=(S,T)=>{cn.offer(e,S,T).then(_=>{_.id&&xl(Mt(_.id))},_=>r({type:"error",message:_.message}))};b.useEffect(()=>{const S=T=>{const _=T.target instanceof HTMLTextAreaElement||T.target instanceof HTMLInputElement;if(T.key==="Escape"){n.tour!==null?r({type:"tour",stop:null}):fo(n.selection)?r({type:"clearSelection"}):r({type:"overview"});return}_||n.tour===null||(T.key==="ArrowRight"&&r({type:"tour",stop:n.tour+1}),T.key==="ArrowLeft"&&r({type:"tour",stop:n.tour-1}))};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[n.tour,n.selection]);const p=n.answers.find(S=>S.id===n.shown),y=p!=null&&p.fix&&["proposed","applying","failed"].includes(((P=n.fixes[p.fix.id])==null?void 0:P.status)??"")?p.fix:null,x=b.useCallback((S,T,_)=>r({type:"select",kind:S,id:T,additive:_}),[]),k=b.useCallback(()=>r({type:"clearSelection"}),[]),m=x0(n),v=L2(n),g=b2(n),w=!!n.map&&n.tour!==null,E=(!n.map||!!n.error||!!n.job||n.shown!==null||fo(n.selection)>0)&&(!w||!!n.error||((A=n.job)==null?void 0:A.kind)==="ask"||fo(n.selection)>0),N=E&&!!n.map,j=n.map?h.jsx(X2,{map:n.map,selection:n.selection,draft:o,busy:!!n.job,autoFocus:N,onDraft:i,onRemove:(S,T)=>r({type:"select",kind:S,id:T,additive:!0}),onSend:()=>c(o)}):null;return h.jsx(f0,{children:h.jsxs("div",{className:"app",children:[h.jsxs("header",{className:"topbar",children:[h.jsxs("a",{className:"brand",href:Mt(),title:"All maps in this repo",children:[h.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate"]}),h.jsxs("div",{className:"topbar-map",children:[((R=n.meta)==null?void 0:R.parent)&&h.jsxs("a",{className:"crumb",href:Mt(n.meta.parent.mapId),title:`Back to the map this one came from: ${n.meta.parent.question}`,children:["← ",n.meta.parent.question]}),h.jsx(TC,{mapId:e,question:((H=n.map)==null?void 0:H.question)??((F=n.job)==null?void 0:F.question)??""})]}),h.jsx(zC,{report:n.report}),h.jsx("a",{className:"pill-btn",href:Mt(),title:"Ask a new question and make a map for it",children:"New map"}),h.jsx(N0,{busy:!!n.job,onStopped:t,onError:S=>r({type:"error",message:S})}),h.jsx("span",{className:n.connected?"live on":"live",title:n.connected?"Connected to illuminate":"Reconnecting to illuminate…"})]}),h.jsxs("div",{className:E?"body":"body full",style:{"--panel-w":`${s}px`},children:[h.jsx("div",{className:"canvas",children:n.map&&m?h.jsxs(h.Fragment,{children:[h.jsx(kC,{map:m,report:n.report,selection:n.selection,view:g,fresh:n.fresh,added:v,ghost:y??null,touring:w,onSelect:x,onClear:k}),!w&&!E&&h.jsx(Q2,{state:n,dispatch:r}),w&&h.jsx($C,{map:n.map,report:n.report,stop:n.tour,onTour:S=>r({type:"tour",stop:S}),onAsk:i}),h.jsx(K2,{map:n.map,tour:n.tour,onTour:S=>r({type:"tour",stop:S}),selected:fo(n.selection),children:N?null:j})]}):h.jsx("div",{className:"empty",children:n.phase==="making"?h.jsx("div",{className:"pulse",children:"Claude is exploring the code…"}):null})}),E&&h.jsx(jC,{width:s,onWidth:l}),E&&h.jsx(B2,{state:n,dispatch:r,onFix:f,onFocus:S=>r({type:"focus",id:S}),onOffer:d,composer:N?j:null})]})]})})}Nm(document.getElementById("root")).render(h.jsx(b.StrictMode,{children:h.jsx(PC,{})}));export{AC as c,ch as g};
71
- //# sourceMappingURL=index-BK-v1h46.js.map