agent-dag 1.31.0 → 1.32.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,66 +0,0 @@
1
- (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const l of u.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function i(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=i(o);fetch(o.href,u)}})();var nu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oc={exports:{}},ko={},qc={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 B0;function UR(){if(B0)return Oe;B0=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function y(A){return A===null||typeof A!="object"?null:(A=m&&A[m]||A["@@iterator"],typeof A=="function"?A:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,_={};function S(A,B,ue){this.props=A,this.context=B,this.refs=_,this.updater=ue||x}S.prototype.isReactComponent={},S.prototype.setState=function(A,B){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,B,"setState")},S.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function b(){}b.prototype=S.prototype;function k(A,B,ue){this.props=A,this.context=B,this.refs=_,this.updater=ue||x}var E=k.prototype=new b;E.constructor=k,N(E,S.prototype),E.isPureReactComponent=!0;var C=Array.isArray,I=Object.prototype.hasOwnProperty,O={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function P(A,B,ue){var z,X={},ee=null,se=null;if(B!=null)for(z in B.ref!==void 0&&(se=B.ref),B.key!==void 0&&(ee=""+B.key),B)I.call(B,z)&&!M.hasOwnProperty(z)&&(X[z]=B[z]);var oe=arguments.length-2;if(oe===1)X.children=ue;else if(1<oe){for(var pe=Array(oe),ge=0;ge<oe;ge++)pe[ge]=arguments[ge+2];X.children=pe}if(A&&A.defaultProps)for(z in oe=A.defaultProps,oe)X[z]===void 0&&(X[z]=oe[z]);return{$$typeof:e,type:A,key:ee,ref:se,props:X,_owner:O.current}}function T(A,B){return{$$typeof:e,type:A.type,key:B,ref:A.ref,props:A.props,_owner:A._owner}}function L(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function F(A){var B={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(ue){return B[ue]})}var J=/\/+/g;function Q(A,B){return typeof A=="object"&&A!==null&&A.key!=null?F(""+A.key):B.toString(36)}function j(A,B,ue,z,X){var ee=typeof A;(ee==="undefined"||ee==="boolean")&&(A=null);var se=!1;if(A===null)se=!0;else switch(ee){case"string":case"number":se=!0;break;case"object":switch(A.$$typeof){case e:case n:se=!0}}if(se)return se=A,X=X(se),A=z===""?"."+Q(se,0):z,C(X)?(ue="",A!=null&&(ue=A.replace(J,"$&/")+"/"),j(X,B,ue,"",function(ge){return ge})):X!=null&&(L(X)&&(X=T(X,ue+(!X.key||se&&se.key===X.key?"":(""+X.key).replace(J,"$&/")+"/")+A)),B.push(X)),1;if(se=0,z=z===""?".":z+":",C(A))for(var oe=0;oe<A.length;oe++){ee=A[oe];var pe=z+Q(ee,oe);se+=j(ee,B,ue,pe,X)}else if(pe=y(A),typeof pe=="function")for(A=pe.call(A),oe=0;!(ee=A.next()).done;)ee=ee.value,pe=z+Q(ee,oe++),se+=j(ee,B,ue,pe,X);else if(ee==="object")throw B=String(A),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.");return se}function G(A,B,ue){if(A==null)return A;var z=[],X=0;return j(A,z,"","",function(ee){return B.call(ue,ee,X++)}),z}function U(A){if(A._status===-1){var B=A._result;B=B(),B.then(function(ue){(A._status===0||A._status===-1)&&(A._status=1,A._result=ue)},function(ue){(A._status===0||A._status===-1)&&(A._status=2,A._result=ue)}),A._status===-1&&(A._status=0,A._result=B)}if(A._status===1)return A._result.default;throw A._result}var ne={current:null},K={transition:null},$={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:K,ReactCurrentOwner:O};function W(){throw Error("act(...) is not supported in production builds of React.")}return Oe.Children={map:G,forEach:function(A,B,ue){G(A,function(){B.apply(this,arguments)},ue)},count:function(A){var B=0;return G(A,function(){B++}),B},toArray:function(A){return G(A,function(B){return B})||[]},only:function(A){if(!L(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},Oe.Component=S,Oe.Fragment=i,Oe.Profiler=o,Oe.PureComponent=k,Oe.StrictMode=s,Oe.Suspense=d,Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$,Oe.act=W,Oe.cloneElement=function(A,B,ue){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var z=N({},A.props),X=A.key,ee=A.ref,se=A._owner;if(B!=null){if(B.ref!==void 0&&(ee=B.ref,se=O.current),B.key!==void 0&&(X=""+B.key),A.type&&A.type.defaultProps)var oe=A.type.defaultProps;for(pe in B)I.call(B,pe)&&!M.hasOwnProperty(pe)&&(z[pe]=B[pe]===void 0&&oe!==void 0?oe[pe]:B[pe])}var pe=arguments.length-2;if(pe===1)z.children=ue;else if(1<pe){oe=Array(pe);for(var ge=0;ge<pe;ge++)oe[ge]=arguments[ge+2];z.children=oe}return{$$typeof:e,type:A.type,key:X,ref:ee,props:z,_owner:se}},Oe.createContext=function(A){return A={$$typeof:l,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:u,_context:A},A.Consumer=A},Oe.createElement=P,Oe.createFactory=function(A){var B=P.bind(null,A);return B.type=A,B},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(A){return{$$typeof:c,render:A}},Oe.isValidElement=L,Oe.lazy=function(A){return{$$typeof:p,_payload:{_status:-1,_result:A},_init:U}},Oe.memo=function(A,B){return{$$typeof:h,type:A,compare:B===void 0?null:B}},Oe.startTransition=function(A){var B=K.transition;K.transition={};try{A()}finally{K.transition=B}},Oe.unstable_act=W,Oe.useCallback=function(A,B){return ne.current.useCallback(A,B)},Oe.useContext=function(A){return ne.current.useContext(A)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(A){return ne.current.useDeferredValue(A)},Oe.useEffect=function(A,B){return ne.current.useEffect(A,B)},Oe.useId=function(){return ne.current.useId()},Oe.useImperativeHandle=function(A,B,ue){return ne.current.useImperativeHandle(A,B,ue)},Oe.useInsertionEffect=function(A,B){return ne.current.useInsertionEffect(A,B)},Oe.useLayoutEffect=function(A,B){return ne.current.useLayoutEffect(A,B)},Oe.useMemo=function(A,B){return ne.current.useMemo(A,B)},Oe.useReducer=function(A,B,ue){return ne.current.useReducer(A,B,ue)},Oe.useRef=function(A){return ne.current.useRef(A)},Oe.useState=function(A){return ne.current.useState(A)},Oe.useSyncExternalStore=function(A,B,ue){return ne.current.useSyncExternalStore(A,B,ue)},Oe.useTransition=function(){return ne.current.useTransition()},Oe.version="18.3.1",Oe}var U0;function Vo(){return U0||(U0=1,qc.exports=UR()),qc.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var H0;function HR(){if(H0)return ko;H0=1;var e=Vo(),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function l(c,d,h){var p,m={},y=null,x=null;h!==void 0&&(y=""+h),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(x=d.ref);for(p in d)s.call(d,p)&&!u.hasOwnProperty(p)&&(m[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)m[p]===void 0&&(m[p]=d[p]);return{$$typeof:n,type:c,key:y,ref:x,props:m,_owner:o.current}}return ko.Fragment=i,ko.jsx=l,ko.jsxs=l,ko}var V0;function VR(){return V0||(V0=1,Oc.exports=HR()),Oc.exports}var v=VR(),ru={},Lc={exports:{}},un={},$c={exports:{}},Dc={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var W0;function WR(){return W0||(W0=1,(function(e){function n(K,$){var W=K.length;K.push($);e:for(;0<W;){var A=W-1>>>1,B=K[A];if(0<o(B,$))K[A]=$,K[W]=B,W=A;else break e}}function i(K){return K.length===0?null:K[0]}function s(K){if(K.length===0)return null;var $=K[0],W=K.pop();if(W!==$){K[0]=W;e:for(var A=0,B=K.length,ue=B>>>1;A<ue;){var z=2*(A+1)-1,X=K[z],ee=z+1,se=K[ee];if(0>o(X,W))ee<B&&0>o(se,X)?(K[A]=se,K[ee]=W,A=ee):(K[A]=X,K[z]=W,A=z);else if(ee<B&&0>o(se,W))K[A]=se,K[ee]=W,A=ee;else break e}}return $}function o(K,$){var W=K.sortIndex-$.sortIndex;return W!==0?W:K.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],h=[],p=1,m=null,y=3,x=!1,N=!1,_=!1,S=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(K){for(var $=i(h);$!==null;){if($.callback===null)s(h);else if($.startTime<=K)s(h),$.sortIndex=$.expirationTime,n(d,$);else break;$=i(h)}}function C(K){if(_=!1,E(K),!N)if(i(d)!==null)N=!0,U(I);else{var $=i(h);$!==null&&ne(C,$.startTime-K)}}function I(K,$){N=!1,_&&(_=!1,b(P),P=-1),x=!0;var W=y;try{for(E($),m=i(d);m!==null&&(!(m.expirationTime>$)||K&&!F());){var A=m.callback;if(typeof A=="function"){m.callback=null,y=m.priorityLevel;var B=A(m.expirationTime<=$);$=e.unstable_now(),typeof B=="function"?m.callback=B:m===i(d)&&s(d),E($)}else s(d);m=i(d)}if(m!==null)var ue=!0;else{var z=i(h);z!==null&&ne(C,z.startTime-$),ue=!1}return ue}finally{m=null,y=W,x=!1}}var O=!1,M=null,P=-1,T=5,L=-1;function F(){return!(e.unstable_now()-L<T)}function J(){if(M!==null){var K=e.unstable_now();L=K;var $=!0;try{$=M(!0,K)}finally{$?Q():(O=!1,M=null)}}else O=!1}var Q;if(typeof k=="function")Q=function(){k(J)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,G=j.port2;j.port1.onmessage=J,Q=function(){G.postMessage(null)}}else Q=function(){S(J,0)};function U(K){M=K,O||(O=!0,Q())}function ne(K,$){P=S(function(){K(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_continueExecution=function(){N||x||(N=!0,U(I))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return i(d)},e.unstable_next=function(K){switch(y){case 1:case 2:case 3:var $=3;break;default:$=y}var W=y;y=$;try{return K()}finally{y=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,$){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var W=y;y=K;try{return $()}finally{y=W}},e.unstable_scheduleCallback=function(K,$,W){var A=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?A+W:A):W=A,K){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=W+B,K={id:p++,callback:$,priorityLevel:K,startTime:W,expirationTime:B,sortIndex:-1},W>A?(K.sortIndex=W,n(h,K),i(d)===null&&K===i(h)&&(_?(b(P),P=-1):_=!0,ne(C,W-A))):(K.sortIndex=B,n(d,K),N||x||(N=!0,U(I))),K},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(K){var $=y;return function(){var W=y;y=$;try{return K.apply(this,arguments)}finally{y=W}}}})(Dc)),Dc}var G0;function GR(){return G0||(G0=1,$c.exports=WR()),$c.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 Y0;function YR(){if(Y0)return un;Y0=1;var e=Vo(),n=GR();function i(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,a=1;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function u(t,r){l(t,r),l(t+"Capture",r)}function l(t,r){for(o[t]=r,t=0;t<r.length;t++)s.add(r[t])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[: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]*$/,p={},m={};function y(t){return d.call(m,t)?!0:d.call(p,t)?!1:h.test(t)?m[t]=!0:(p[t]=!0,!1)}function x(t,r,a,f){if(a!==null&&a.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return f?!1:a!==null?!a.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function N(t,r,a,f){if(r===null||typeof r>"u"||x(t,r,a,f))return!0;if(f)return!1;if(a!==null)switch(a.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function _(t,r,a,f,g,w,R){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=f,this.attributeNamespace=g,this.mustUseProperty=a,this.propertyName=t,this.type=r,this.sanitizeURL=w,this.removeEmptyString=R}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){S[t]=new _(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];S[r]=new _(r,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){S[t]=new _(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){S[t]=new _(t,2,!1,t,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(t){S[t]=new _(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){S[t]=new _(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){S[t]=new _(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){S[t]=new _(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){S[t]=new _(t,5,!1,t.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function k(t){return t[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(t){var r=t.replace(b,k);S[r]=new _(r,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(b,k);S[r]=new _(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(b,k);S[r]=new _(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){S[t]=new _(t,1,!1,t.toLowerCase(),null,!1,!1)}),S.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){S[t]=new _(t,1,!1,t.toLowerCase(),null,!0,!0)});function E(t,r,a,f){var g=S.hasOwnProperty(r)?S[r]:null;(g!==null?g.type!==0:f||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(N(r,a,g,f)&&(a=null),f||g===null?y(r)&&(a===null?t.removeAttribute(r):t.setAttribute(r,""+a)):g.mustUseProperty?t[g.propertyName]=a===null?g.type===3?!1:"":a:(r=g.attributeName,f=g.attributeNamespace,a===null?t.removeAttribute(r):(g=g.type,a=g===3||g===4&&a===!0?"":""+a,f?t.setAttributeNS(f,r,a):t.setAttribute(r,a))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),O=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),F=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),K=Symbol.iterator;function $(t){return t===null||typeof t!="object"?null:(t=K&&t[K]||t["@@iterator"],typeof t=="function"?t:null)}var W=Object.assign,A;function B(t){if(A===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);A=r&&r[1]||""}return`
34
- `+A+t}var ue=!1;function z(t,r){if(!t||ue)return"";ue=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(ie){var f=ie}Reflect.construct(t,[],r)}else{try{r.call()}catch(ie){f=ie}t.call(r.prototype)}else{try{throw Error()}catch(ie){f=ie}t()}}catch(ie){if(ie&&f&&typeof ie.stack=="string"){for(var g=ie.stack.split(`
35
- `),w=f.stack.split(`
36
- `),R=g.length-1,D=w.length-1;1<=R&&0<=D&&g[R]!==w[D];)D--;for(;1<=R&&0<=D;R--,D--)if(g[R]!==w[D]){if(R!==1||D!==1)do if(R--,D--,0>D||g[R]!==w[D]){var H=`
37
- `+g[R].replace(" at new "," at ");return t.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",t.displayName)),H}while(1<=R&&0<=D);break}}}finally{ue=!1,Error.prepareStackTrace=a}return(t=t?t.displayName||t.name:"")?B(t):""}function X(t){switch(t.tag){case 5:return B(t.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return t=z(t.type,!1),t;case 11:return t=z(t.type.render,!1),t;case 1:return t=z(t.type,!0),t;default:return""}}function ee(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case O:return"Portal";case T:return"Profiler";case P:return"StrictMode";case Q:return"Suspense";case j:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case F:return(t.displayName||"Context")+".Consumer";case L:return(t._context.displayName||"Context")+".Provider";case J:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case G:return r=t.displayName||null,r!==null?r:ee(t.type)||"Memo";case U:r=t._payload,t=t._init;try{return ee(t(r))}catch{}}return null}function se(t){var r=t.type;switch(t.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ee(r);case 8:return r===P?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function oe(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function pe(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function ge(t){var r=pe(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),f=""+t[r];if(!t.hasOwnProperty(r)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var g=a.get,w=a.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return g.call(this)},set:function(R){f=""+R,w.call(this,R)}}),Object.defineProperty(t,r,{enumerable:a.enumerable}),{getValue:function(){return f},setValue:function(R){f=""+R},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Ae(t){t._valueTracker||(t._valueTracker=ge(t))}function ze(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),f="";return t&&(f=pe(t)?t.checked?"true":"false":t.value),t=f,t!==a?(r.setValue(t),!0):!1}function Me(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Ie(t,r){var a=r.checked;return W({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??t._wrapperState.initialChecked})}function be(t,r){var a=r.defaultValue==null?"":r.defaultValue,f=r.checked!=null?r.checked:r.defaultChecked;a=oe(r.value!=null?r.value:a),t._wrapperState={initialChecked:f,initialValue:a,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Be(t,r){r=r.checked,r!=null&&E(t,"checked",r,!1)}function ye(t,r){Be(t,r);var a=oe(r.value),f=r.type;if(a!=null)f==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+a):t.value!==""+a&&(t.value=""+a);else if(f==="submit"||f==="reset"){t.removeAttribute("value");return}r.hasOwnProperty("value")?Le(t,r.type,a):r.hasOwnProperty("defaultValue")&&Le(t,r.type,oe(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function we(t,r,a){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var f=r.type;if(!(f!=="submit"&&f!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+t._wrapperState.initialValue,a||r===t.value||(t.value=r),t.defaultValue=r}a=t.name,a!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,a!==""&&(t.name=a)}function Le(t,r,a){(r!=="number"||Me(t.ownerDocument)!==t)&&(a==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+a&&(t.defaultValue=""+a))}var Qe=Array.isArray;function et(t,r,a,f){if(t=t.options,r){r={};for(var g=0;g<a.length;g++)r["$"+a[g]]=!0;for(a=0;a<t.length;a++)g=r.hasOwnProperty("$"+t[a].value),t[a].selected!==g&&(t[a].selected=g),g&&f&&(t[a].defaultSelected=!0)}else{for(a=""+oe(a),r=null,g=0;g<t.length;g++){if(t[g].value===a){t[g].selected=!0,f&&(t[g].defaultSelected=!0);return}r!==null||t[g].disabled||(r=t[g])}r!==null&&(r.selected=!0)}}function Ve(t,r){if(r.dangerouslySetInnerHTML!=null)throw Error(i(91));return W({},r,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Ye(t,r){var a=r.value;if(a==null){if(a=r.children,r=r.defaultValue,a!=null){if(r!=null)throw Error(i(92));if(Qe(a)){if(1<a.length)throw Error(i(93));a=a[0]}r=a}r==null&&(r=""),a=r}t._wrapperState={initialValue:oe(a)}}function We(t,r){var a=oe(r.value),f=oe(r.defaultValue);a!=null&&(a=""+a,a!==t.value&&(t.value=a),r.defaultValue==null&&t.defaultValue!==a&&(t.defaultValue=a)),f!=null&&(t.defaultValue=""+f)}function Ke(t){var r=t.textContent;r===t._wrapperState.initialValue&&r!==""&&r!==null&&(t.value=r)}function Qt(t){switch(t){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 vt(t,r){return t==null||t==="http://www.w3.org/1999/xhtml"?Qt(r):t==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var yt,Zt=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,a,f,g){MSApp.execUnsafeLocalFunction(function(){return t(r,a,f,g)})}:t})(function(t,r){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=r;else{for(yt=yt||document.createElement("div"),yt.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=yt.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function Ct(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var Ze={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},_t=["Webkit","ms","Moz","O"];Object.keys(Ze).forEach(function(t){_t.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),Ze[r]=Ze[t]})});function ht(t,r,a){return r==null||typeof r=="boolean"||r===""?"":a||typeof r!="number"||r===0||Ze.hasOwnProperty(t)&&Ze[t]?(""+r).trim():r+"px"}function at(t,r){t=t.style;for(var a in r)if(r.hasOwnProperty(a)){var f=a.indexOf("--")===0,g=ht(a,r[a],f);a==="float"&&(a="cssFloat"),f?t.setProperty(a,g):t[a]=g}}var dn=W({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 Bt(t,r){if(r){if(dn[t]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(i(137,t));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(i(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(i(61))}if(r.style!=null&&typeof r.style!="object")throw Error(i(62))}}function Rt(t,r){if(t.indexOf("-")===-1)return typeof r.is=="string";switch(t){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 ct=null;function xn(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Jt=null,Tt=null,_n=null;function hn(t){if(t=uo(t)){if(typeof Jt!="function")throw Error(i(280));var r=t.stateNode;r&&(r=va(r),Jt(t.stateNode,t.type,r))}}function Gi(t){Tt?_n?_n.push(t):_n=[t]:Tt=t}function Zn(){if(Tt){var t=Tt,r=_n;if(_n=Tt=null,hn(t),r)for(t=0;t<r.length;t++)hn(r[t])}}function ui(t,r){return t(r)}function li(){}var ci=!1;function fi(t,r,a){if(ci)return t(r,a);ci=!0;try{return ui(t,r,a)}finally{ci=!1,(Tt!==null||_n!==null)&&(li(),Zn())}}function Jn(t,r){var a=t.stateNode;if(a===null)return null;var f=va(a);if(f===null)return null;a=f[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(t=t.type,f=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!f;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(i(231,r,typeof a));return a}var St=!1;if(c)try{var qn={};Object.defineProperty(qn,"passive",{get:function(){St=!0}}),window.addEventListener("test",qn,qn),window.removeEventListener("test",qn,qn)}catch{St=!1}function er(t,r,a,f,g,w,R,D,H){var ie=Array.prototype.slice.call(arguments,3);try{r.apply(a,ie)}catch(fe){this.onError(fe)}}var hr=!1,Ot=null,tr=!1,pr=null,Yi={onError:function(t){hr=!0,Ot=t}};function Ir(t,r,a,f,g,w,R,D,H){hr=!1,Ot=null,er.apply(Yi,arguments)}function Mr(t,r,a,f,g,w,R,D,H){if(Ir.apply(this,arguments),hr){if(hr){var ie=Ot;hr=!1,Ot=null}else throw Error(i(198));tr||(tr=!0,pr=ie)}}function qt(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function di(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function hi(t){if(qt(t)!==t)throw Error(i(188))}function Ki(t){var r=t.alternate;if(!r){if(r=qt(t),r===null)throw Error(i(188));return r!==t?null:t}for(var a=t,f=r;;){var g=a.return;if(g===null)break;var w=g.alternate;if(w===null){if(f=g.return,f!==null){a=f;continue}break}if(g.child===w.child){for(w=g.child;w;){if(w===a)return hi(g),t;if(w===f)return hi(g),r;w=w.sibling}throw Error(i(188))}if(a.return!==f.return)a=g,f=w;else{for(var R=!1,D=g.child;D;){if(D===a){R=!0,a=g,f=w;break}if(D===f){R=!0,f=g,a=w;break}D=D.sibling}if(!R){for(D=w.child;D;){if(D===a){R=!0,a=w,f=g;break}if(D===f){R=!0,f=w,a=g;break}D=D.sibling}if(!R)throw Error(i(189))}}if(a.alternate!==f)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?t:r}function Xi(t){return t=Ki(t),t!==null?Pr(t):null}function Pr(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var r=Pr(t);if(r!==null)return r;t=t.sibling}return null}var Ln=n.unstable_scheduleCallback,pi=n.unstable_cancelCallback,Qi=n.unstable_shouldYield,Zi=n.unstable_requestPaint,rt=n.unstable_now,Vs=n.unstable_getCurrentPriorityLevel,jt=n.unstable_ImmediatePriority,Or=n.unstable_UserBlockingPriority,pn=n.unstable_NormalPriority,nr=n.unstable_LowPriority,qr=n.unstable_IdlePriority,rr=null,Yt=null;function ir(t){if(Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(rr,t,void 0,(t.current.flags&128)===128)}catch{}}var en=Math.clz32?Math.clz32:al,ol=Math.log,na=Math.LN2;function al(t){return t>>>=0,t===0?32:31-(ol(t)/na|0)|0}var Ji=64,Lr=4194304;function tn(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function $r(t,r){var a=t.pendingLanes;if(a===0)return 0;var f=0,g=t.suspendedLanes,w=t.pingedLanes,R=a&268435455;if(R!==0){var D=R&~g;D!==0?f=tn(D):(w&=R,w!==0&&(f=tn(w)))}else R=a&~g,R!==0?f=tn(R):w!==0&&(f=tn(w));if(f===0)return 0;if(r!==0&&r!==f&&(r&g)===0&&(g=f&-f,w=r&-r,g>=w||g===16&&(w&4194240)!==0))return r;if((f&4)!==0&&(f|=a&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=f;0<r;)a=31-en(r),g=1<<a,f|=t[a],r&=~g;return f}function ra(t,r){switch(t){case 1:case 2:case 4:return r+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 r+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 ul(t,r){for(var a=t.suspendedLanes,f=t.pingedLanes,g=t.expirationTimes,w=t.pendingLanes;0<w;){var R=31-en(w),D=1<<R,H=g[R];H===-1?((D&a)===0||(D&f)!==0)&&(g[R]=ra(D,r)):H<=r&&(t.expiredLanes|=D),w&=~D}}function Ws(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Gs(){var t=Ji;return Ji<<=1,(Ji&4194240)===0&&(Ji=64),t}function es(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function Ut(t,r,a){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-en(r),t[r]=a}function ll(t,r){var a=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var f=t.eventTimes;for(t=t.expirationTimes;0<a;){var g=31-en(a),w=1<<g;r[g]=0,f[g]=-1,t[g]=-1,a&=~w}}function ts(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var f=31-en(a),g=1<<f;g&r|t[f]&r&&(t[f]|=r),a&=~g}}var Ge=0;function ia(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var Ys,mr,sa,Lt,Ks,mi=!1,Dr=[],$n=null,Sn=null,bn=null,gi=new Map,At=new Map,V=[],Z="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 le(t,r){switch(t){case"focusin":case"focusout":$n=null;break;case"dragenter":case"dragleave":Sn=null;break;case"mouseover":case"mouseout":bn=null;break;case"pointerover":case"pointerout":gi.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":At.delete(r.pointerId)}}function de(t,r,a,f,g,w){return t===null||t.nativeEvent!==w?(t={blockedOn:r,domEventName:a,eventSystemFlags:f,nativeEvent:w,targetContainers:[g]},r!==null&&(r=uo(r),r!==null&&mr(r)),t):(t.eventSystemFlags|=f,r=t.targetContainers,g!==null&&r.indexOf(g)===-1&&r.push(g),t)}function xe(t,r,a,f,g){switch(r){case"focusin":return $n=de($n,t,r,a,f,g),!0;case"dragenter":return Sn=de(Sn,t,r,a,f,g),!0;case"mouseover":return bn=de(bn,t,r,a,f,g),!0;case"pointerover":var w=g.pointerId;return gi.set(w,de(gi.get(w)||null,t,r,a,f,g)),!0;case"gotpointercapture":return w=g.pointerId,At.set(w,de(At.get(w)||null,t,r,a,f,g)),!0}return!1}function _e(t){var r=xi(t.target);if(r!==null){var a=qt(r);if(a!==null){if(r=a.tag,r===13){if(r=di(a),r!==null){t.blockedOn=r,Ks(t.priority,function(){sa(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Pe(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=Fr(t.domEventName,t.eventSystemFlags,r[0],t.nativeEvent);if(a===null){a=t.nativeEvent;var f=new a.constructor(a.type,a);ct=f,a.target.dispatchEvent(f),ct=null}else return r=uo(a),r!==null&&mr(r),t.blockedOn=a,!1;r.shift()}return!0}function $e(t,r,a){Pe(t)&&a.delete(r)}function tt(){mi=!1,$n!==null&&Pe($n)&&($n=null),Sn!==null&&Pe(Sn)&&(Sn=null),bn!==null&&Pe(bn)&&(bn=null),gi.forEach($e),At.forEach($e)}function Ue(t,r){t.blockedOn===r&&(t.blockedOn=null,mi||(mi=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,tt)))}function Je(t){function r(g){return Ue(g,t)}if(0<Dr.length){Ue(Dr[0],t);for(var a=1;a<Dr.length;a++){var f=Dr[a];f.blockedOn===t&&(f.blockedOn=null)}}for($n!==null&&Ue($n,t),Sn!==null&&Ue(Sn,t),bn!==null&&Ue(bn,t),gi.forEach(r),At.forEach(r),a=0;a<V.length;a++)f=V[a],f.blockedOn===t&&(f.blockedOn=null);for(;0<V.length&&(a=V[0],a.blockedOn===null);)_e(a),a.blockedOn===null&&V.shift()}var $t=C.ReactCurrentBatchConfig,sr=!0;function Xs(t,r,a,f){var g=Ge,w=$t.transition;$t.transition=null;try{Ge=1,yi(t,r,a,f)}finally{Ge=g,$t.transition=w}}function vi(t,r,a,f){var g=Ge,w=$t.transition;$t.transition=null;try{Ge=4,yi(t,r,a,f)}finally{Ge=g,$t.transition=w}}function yi(t,r,a,f){if(sr){var g=Fr(t,r,a,f);if(g===null)El(t,r,f,wi,a),le(t,f);else if(xe(g,t,r,a,f))f.stopPropagation();else if(le(t,f),r&4&&-1<Z.indexOf(t)){for(;g!==null;){var w=uo(g);if(w!==null&&Ys(w),w=Fr(t,r,a,f),w===null&&El(t,r,f,wi,a),w===g)break;g=w}g!==null&&f.stopPropagation()}else El(t,r,f,null,a)}}var wi=null;function Fr(t,r,a,f){if(wi=null,t=xn(f),t=xi(t),t!==null)if(r=qt(t),r===null)t=null;else if(a=r.tag,a===13){if(t=di(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null);return wi=t,null}function kn(t){switch(t){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(Vs()){case jt:return 1;case Or:return 4;case pn:case nr:return 16;case qr:return 536870912;default:return 16}default:return 16}}var nt=null,ns=null,oa=null;function Tv(){if(oa)return oa;var t,r=ns,a=r.length,f,g="value"in nt?nt.value:nt.textContent,w=g.length;for(t=0;t<a&&r[t]===g[t];t++);var R=a-t;for(f=1;f<=R&&r[a-f]===g[w-f];f++);return oa=g.slice(t,1<f?1-f:void 0)}function aa(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function ua(){return!0}function jv(){return!1}function mn(t){function r(a,f,g,w,R){this._reactName=a,this._targetInst=g,this.type=f,this.nativeEvent=w,this.target=R,this.currentTarget=null;for(var D in t)t.hasOwnProperty(D)&&(a=t[D],this[D]=a?a(w):w[D]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?ua:jv,this.isPropagationStopped=jv,this}return W(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ua)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ua)},persist:function(){},isPersistent:ua}),r}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cl=mn(rs),Qs=W({},rs,{view:0,detail:0}),gC=mn(Qs),fl,dl,Zs,la=W({},Qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pl,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Zs&&(Zs&&t.type==="mousemove"?(fl=t.screenX-Zs.screenX,dl=t.screenY-Zs.screenY):dl=fl=0,Zs=t),fl)},movementY:function(t){return"movementY"in t?t.movementY:dl}}),Av=mn(la),vC=W({},la,{dataTransfer:0}),yC=mn(vC),wC=W({},Qs,{relatedTarget:0}),hl=mn(wC),xC=W({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),_C=mn(xC),SC=W({},rs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),bC=mn(SC),kC=W({},rs,{data:0}),Iv=mn(kC),EC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},NC={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"},CC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function RC(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=CC[t])?!!r[t]:!1}function pl(){return RC}var TC=W({},Qs,{key:function(t){if(t.key){var r=EC[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=aa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?NC[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pl,charCode:function(t){return t.type==="keypress"?aa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?aa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),jC=mn(TC),AC=W({},la,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mv=mn(AC),IC=W({},Qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pl}),MC=mn(IC),PC=W({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),OC=mn(PC),qC=W({},la,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),LC=mn(qC),$C=[9,13,27,32],ml=c&&"CompositionEvent"in window,Js=null;c&&"documentMode"in document&&(Js=document.documentMode);var DC=c&&"TextEvent"in window&&!Js,Pv=c&&(!ml||Js&&8<Js&&11>=Js),Ov=" ",qv=!1;function Lv(t,r){switch(t){case"keyup":return $C.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $v(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var is=!1;function FC(t,r){switch(t){case"compositionend":return $v(r);case"keypress":return r.which!==32?null:(qv=!0,Ov);case"textInput":return t=r.data,t===Ov&&qv?null:t;default:return null}}function zC(t,r){if(is)return t==="compositionend"||!ml&&Lv(t,r)?(t=Tv(),oa=ns=nt=null,is=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Pv&&r.locale!=="ko"?null:r.data;default:return null}}var BC={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 Dv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!BC[t.type]:r==="textarea"}function Fv(t,r,a,f){Gi(f),r=pa(r,"onChange"),0<r.length&&(a=new cl("onChange","change",null,a,f),t.push({event:a,listeners:r}))}var eo=null,to=null;function UC(t){iy(t,0)}function ca(t){var r=ls(t);if(ze(r))return t}function HC(t,r){if(t==="change")return r}var zv=!1;if(c){var gl;if(c){var vl="oninput"in document;if(!vl){var Bv=document.createElement("div");Bv.setAttribute("oninput","return;"),vl=typeof Bv.oninput=="function"}gl=vl}else gl=!1;zv=gl&&(!document.documentMode||9<document.documentMode)}function Uv(){eo&&(eo.detachEvent("onpropertychange",Hv),to=eo=null)}function Hv(t){if(t.propertyName==="value"&&ca(to)){var r=[];Fv(r,to,t,xn(t)),fi(UC,r)}}function VC(t,r,a){t==="focusin"?(Uv(),eo=r,to=a,eo.attachEvent("onpropertychange",Hv)):t==="focusout"&&Uv()}function WC(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ca(to)}function GC(t,r){if(t==="click")return ca(r)}function YC(t,r){if(t==="input"||t==="change")return ca(r)}function KC(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Dn=typeof Object.is=="function"?Object.is:KC;function no(t,r){if(Dn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var a=Object.keys(t),f=Object.keys(r);if(a.length!==f.length)return!1;for(f=0;f<a.length;f++){var g=a[f];if(!d.call(r,g)||!Dn(t[g],r[g]))return!1}return!0}function Vv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Wv(t,r){var a=Vv(t);t=0;for(var f;a;){if(a.nodeType===3){if(f=t+a.textContent.length,t<=r&&f>=r)return{node:a,offset:r-t};t=f}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Vv(a)}}function Gv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Gv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Yv(){for(var t=window,r=Me();r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Me(t.document)}return r}function yl(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}function XC(t){var r=Yv(),a=t.focusedElem,f=t.selectionRange;if(r!==a&&a&&a.ownerDocument&&Gv(a.ownerDocument.documentElement,a)){if(f!==null&&yl(a)){if(r=f.start,t=f.end,t===void 0&&(t=r),"selectionStart"in a)a.selectionStart=r,a.selectionEnd=Math.min(t,a.value.length);else if(t=(r=a.ownerDocument||document)&&r.defaultView||window,t.getSelection){t=t.getSelection();var g=a.textContent.length,w=Math.min(f.start,g);f=f.end===void 0?w:Math.min(f.end,g),!t.extend&&w>f&&(g=f,f=w,w=g),g=Wv(a,w);var R=Wv(a,f);g&&R&&(t.rangeCount!==1||t.anchorNode!==g.node||t.anchorOffset!==g.offset||t.focusNode!==R.node||t.focusOffset!==R.offset)&&(r=r.createRange(),r.setStart(g.node,g.offset),t.removeAllRanges(),w>f?(t.addRange(r),t.extend(R.node,R.offset)):(r.setEnd(R.node,R.offset),t.addRange(r)))}}for(r=[],t=a;t=t.parentNode;)t.nodeType===1&&r.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<r.length;a++)t=r[a],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var QC=c&&"documentMode"in document&&11>=document.documentMode,ss=null,wl=null,ro=null,xl=!1;function Kv(t,r,a){var f=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;xl||ss==null||ss!==Me(f)||(f=ss,"selectionStart"in f&&yl(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),ro&&no(ro,f)||(ro=f,f=pa(wl,"onSelect"),0<f.length&&(r=new cl("onSelect","select",null,r,a),t.push({event:r,listeners:f}),r.target=ss)))}function fa(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var os={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionend:fa("Transition","TransitionEnd")},_l={},Xv={};c&&(Xv=document.createElement("div").style,"AnimationEvent"in window||(delete os.animationend.animation,delete os.animationiteration.animation,delete os.animationstart.animation),"TransitionEvent"in window||delete os.transitionend.transition);function da(t){if(_l[t])return _l[t];if(!os[t])return t;var r=os[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Xv)return _l[t]=r[a];return t}var Qv=da("animationend"),Zv=da("animationiteration"),Jv=da("animationstart"),ey=da("transitionend"),ty=new Map,ny="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 zr(t,r){ty.set(t,r),u(r,[t])}for(var Sl=0;Sl<ny.length;Sl++){var bl=ny[Sl],ZC=bl.toLowerCase(),JC=bl[0].toUpperCase()+bl.slice(1);zr(ZC,"on"+JC)}zr(Qv,"onAnimationEnd"),zr(Zv,"onAnimationIteration"),zr(Jv,"onAnimationStart"),zr("dblclick","onDoubleClick"),zr("focusin","onFocus"),zr("focusout","onBlur"),zr(ey,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var io="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(" "),eR=new Set("cancel close invalid load scroll toggle".split(" ").concat(io));function ry(t,r,a){var f=t.type||"unknown-event";t.currentTarget=a,Mr(f,r,void 0,t),t.currentTarget=null}function iy(t,r){r=(r&4)!==0;for(var a=0;a<t.length;a++){var f=t[a],g=f.event;f=f.listeners;e:{var w=void 0;if(r)for(var R=f.length-1;0<=R;R--){var D=f[R],H=D.instance,ie=D.currentTarget;if(D=D.listener,H!==w&&g.isPropagationStopped())break e;ry(g,D,ie),w=H}else for(R=0;R<f.length;R++){if(D=f[R],H=D.instance,ie=D.currentTarget,D=D.listener,H!==w&&g.isPropagationStopped())break e;ry(g,D,ie),w=H}}}if(tr)throw t=pr,tr=!1,pr=null,t}function st(t,r){var a=r[Al];a===void 0&&(a=r[Al]=new Set);var f=t+"__bubble";a.has(f)||(sy(r,t,2,!1),a.add(f))}function kl(t,r,a){var f=0;r&&(f|=4),sy(a,t,f,r)}var ha="_reactListening"+Math.random().toString(36).slice(2);function so(t){if(!t[ha]){t[ha]=!0,s.forEach(function(a){a!=="selectionchange"&&(eR.has(a)||kl(a,!1,t),kl(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[ha]||(r[ha]=!0,kl("selectionchange",!1,r))}}function sy(t,r,a,f){switch(kn(r)){case 1:var g=Xs;break;case 4:g=vi;break;default:g=yi}a=g.bind(null,r,a,t),g=void 0,!St||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(g=!0),f?g!==void 0?t.addEventListener(r,a,{capture:!0,passive:g}):t.addEventListener(r,a,!0):g!==void 0?t.addEventListener(r,a,{passive:g}):t.addEventListener(r,a,!1)}function El(t,r,a,f,g){var w=f;if((r&1)===0&&(r&2)===0&&f!==null)e:for(;;){if(f===null)return;var R=f.tag;if(R===3||R===4){var D=f.stateNode.containerInfo;if(D===g||D.nodeType===8&&D.parentNode===g)break;if(R===4)for(R=f.return;R!==null;){var H=R.tag;if((H===3||H===4)&&(H=R.stateNode.containerInfo,H===g||H.nodeType===8&&H.parentNode===g))return;R=R.return}for(;D!==null;){if(R=xi(D),R===null)return;if(H=R.tag,H===5||H===6){f=w=R;continue e}D=D.parentNode}}f=f.return}fi(function(){var ie=w,fe=xn(a),he=[];e:{var ce=ty.get(t);if(ce!==void 0){var ve=cl,ke=t;switch(t){case"keypress":if(aa(a)===0)break e;case"keydown":case"keyup":ve=jC;break;case"focusin":ke="focus",ve=hl;break;case"focusout":ke="blur",ve=hl;break;case"beforeblur":case"afterblur":ve=hl;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ve=Av;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=yC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=MC;break;case Qv:case Zv:case Jv:ve=_C;break;case ey:ve=OC;break;case"scroll":ve=gC;break;case"wheel":ve=LC;break;case"copy":case"cut":case"paste":ve=bC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=Mv}var Ee=(r&4)!==0,gt=!Ee&&t==="scroll",te=Ee?ce!==null?ce+"Capture":null:ce;Ee=[];for(var Y=ie,re;Y!==null;){re=Y;var me=re.stateNode;if(re.tag===5&&me!==null&&(re=me,te!==null&&(me=Jn(Y,te),me!=null&&Ee.push(oo(Y,me,re)))),gt)break;Y=Y.return}0<Ee.length&&(ce=new ve(ce,ke,null,a,fe),he.push({event:ce,listeners:Ee}))}}if((r&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",ve=t==="mouseout"||t==="pointerout",ce&&a!==ct&&(ke=a.relatedTarget||a.fromElement)&&(xi(ke)||ke[gr]))break e;if((ve||ce)&&(ce=fe.window===fe?fe:(ce=fe.ownerDocument)?ce.defaultView||ce.parentWindow:window,ve?(ke=a.relatedTarget||a.toElement,ve=ie,ke=ke?xi(ke):null,ke!==null&&(gt=qt(ke),ke!==gt||ke.tag!==5&&ke.tag!==6)&&(ke=null)):(ve=null,ke=ie),ve!==ke)){if(Ee=Av,me="onMouseLeave",te="onMouseEnter",Y="mouse",(t==="pointerout"||t==="pointerover")&&(Ee=Mv,me="onPointerLeave",te="onPointerEnter",Y="pointer"),gt=ve==null?ce:ls(ve),re=ke==null?ce:ls(ke),ce=new Ee(me,Y+"leave",ve,a,fe),ce.target=gt,ce.relatedTarget=re,me=null,xi(fe)===ie&&(Ee=new Ee(te,Y+"enter",ke,a,fe),Ee.target=re,Ee.relatedTarget=gt,me=Ee),gt=me,ve&&ke)t:{for(Ee=ve,te=ke,Y=0,re=Ee;re;re=as(re))Y++;for(re=0,me=te;me;me=as(me))re++;for(;0<Y-re;)Ee=as(Ee),Y--;for(;0<re-Y;)te=as(te),re--;for(;Y--;){if(Ee===te||te!==null&&Ee===te.alternate)break t;Ee=as(Ee),te=as(te)}Ee=null}else Ee=null;ve!==null&&oy(he,ce,ve,Ee,!1),ke!==null&&gt!==null&&oy(he,gt,ke,Ee,!0)}}e:{if(ce=ie?ls(ie):window,ve=ce.nodeName&&ce.nodeName.toLowerCase(),ve==="select"||ve==="input"&&ce.type==="file")var Ne=HC;else if(Dv(ce))if(zv)Ne=YC;else{Ne=WC;var Re=VC}else(ve=ce.nodeName)&&ve.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&(Ne=GC);if(Ne&&(Ne=Ne(t,ie))){Fv(he,Ne,a,fe);break e}Re&&Re(t,ce,ie),t==="focusout"&&(Re=ce._wrapperState)&&Re.controlled&&ce.type==="number"&&Le(ce,"number",ce.value)}switch(Re=ie?ls(ie):window,t){case"focusin":(Dv(Re)||Re.contentEditable==="true")&&(ss=Re,wl=ie,ro=null);break;case"focusout":ro=wl=ss=null;break;case"mousedown":xl=!0;break;case"contextmenu":case"mouseup":case"dragend":xl=!1,Kv(he,a,fe);break;case"selectionchange":if(QC)break;case"keydown":case"keyup":Kv(he,a,fe)}var Te;if(ml)e:{switch(t){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else is?Lv(t,a)&&(je="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(je="onCompositionStart");je&&(Pv&&a.locale!=="ko"&&(is||je!=="onCompositionStart"?je==="onCompositionEnd"&&is&&(Te=Tv()):(nt=fe,ns="value"in nt?nt.value:nt.textContent,is=!0)),Re=pa(ie,je),0<Re.length&&(je=new Iv(je,t,null,a,fe),he.push({event:je,listeners:Re}),Te?je.data=Te:(Te=$v(a),Te!==null&&(je.data=Te)))),(Te=DC?FC(t,a):zC(t,a))&&(ie=pa(ie,"onBeforeInput"),0<ie.length&&(fe=new Iv("onBeforeInput","beforeinput",null,a,fe),he.push({event:fe,listeners:ie}),fe.data=Te))}iy(he,r)})}function oo(t,r,a){return{instance:t,listener:r,currentTarget:a}}function pa(t,r){for(var a=r+"Capture",f=[];t!==null;){var g=t,w=g.stateNode;g.tag===5&&w!==null&&(g=w,w=Jn(t,a),w!=null&&f.unshift(oo(t,w,g)),w=Jn(t,r),w!=null&&f.push(oo(t,w,g))),t=t.return}return f}function as(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function oy(t,r,a,f,g){for(var w=r._reactName,R=[];a!==null&&a!==f;){var D=a,H=D.alternate,ie=D.stateNode;if(H!==null&&H===f)break;D.tag===5&&ie!==null&&(D=ie,g?(H=Jn(a,w),H!=null&&R.unshift(oo(a,H,D))):g||(H=Jn(a,w),H!=null&&R.push(oo(a,H,D)))),a=a.return}R.length!==0&&t.push({event:r,listeners:R})}var tR=/\r\n?/g,nR=/\u0000|\uFFFD/g;function ay(t){return(typeof t=="string"?t:""+t).replace(tR,`
38
- `).replace(nR,"")}function ma(t,r,a){if(r=ay(r),ay(t)!==r&&a)throw Error(i(425))}function ga(){}var Nl=null,Cl=null;function Rl(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Tl=typeof setTimeout=="function"?setTimeout:void 0,rR=typeof clearTimeout=="function"?clearTimeout:void 0,uy=typeof Promise=="function"?Promise:void 0,iR=typeof queueMicrotask=="function"?queueMicrotask:typeof uy<"u"?function(t){return uy.resolve(null).then(t).catch(sR)}:Tl;function sR(t){setTimeout(function(){throw t})}function jl(t,r){var a=r,f=0;do{var g=a.nextSibling;if(t.removeChild(a),g&&g.nodeType===8)if(a=g.data,a==="/$"){if(f===0){t.removeChild(g),Je(r);return}f--}else a!=="$"&&a!=="$?"&&a!=="$!"||f++;a=g}while(a);Je(r)}function Br(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return t}function ly(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"){if(r===0)return t;r--}else a==="/$"&&r++}t=t.previousSibling}return null}var us=Math.random().toString(36).slice(2),or="__reactFiber$"+us,ao="__reactProps$"+us,gr="__reactContainer$"+us,Al="__reactEvents$"+us,oR="__reactListeners$"+us,aR="__reactHandles$"+us;function xi(t){var r=t[or];if(r)return r;for(var a=t.parentNode;a;){if(r=a[gr]||a[or]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=ly(t);t!==null;){if(a=t[or])return a;t=ly(t)}return r}t=a,a=t.parentNode}return null}function uo(t){return t=t[or]||t[gr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ls(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(i(33))}function va(t){return t[ao]||null}var Il=[],cs=-1;function Ur(t){return{current:t}}function ot(t){0>cs||(t.current=Il[cs],Il[cs]=null,cs--)}function it(t,r){cs++,Il[cs]=t.current,t.current=r}var Hr={},Ht=Ur(Hr),nn=Ur(!1),_i=Hr;function fs(t,r){var a=t.type.contextTypes;if(!a)return Hr;var f=t.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===r)return f.__reactInternalMemoizedMaskedChildContext;var g={},w;for(w in a)g[w]=r[w];return f&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=g),g}function rn(t){return t=t.childContextTypes,t!=null}function ya(){ot(nn),ot(Ht)}function cy(t,r,a){if(Ht.current!==Hr)throw Error(i(168));it(Ht,r),it(nn,a)}function fy(t,r,a){var f=t.stateNode;if(r=r.childContextTypes,typeof f.getChildContext!="function")return a;f=f.getChildContext();for(var g in f)if(!(g in r))throw Error(i(108,se(t)||"Unknown",g));return W({},a,f)}function wa(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Hr,_i=Ht.current,it(Ht,t),it(nn,nn.current),!0}function dy(t,r,a){var f=t.stateNode;if(!f)throw Error(i(169));a?(t=fy(t,r,_i),f.__reactInternalMemoizedMergedChildContext=t,ot(nn),ot(Ht),it(Ht,t)):ot(nn),it(nn,a)}var vr=null,xa=!1,Ml=!1;function hy(t){vr===null?vr=[t]:vr.push(t)}function uR(t){xa=!0,hy(t)}function Vr(){if(!Ml&&vr!==null){Ml=!0;var t=0,r=Ge;try{var a=vr;for(Ge=1;t<a.length;t++){var f=a[t];do f=f(!0);while(f!==null)}vr=null,xa=!1}catch(g){throw vr!==null&&(vr=vr.slice(t+1)),Ln(jt,Vr),g}finally{Ge=r,Ml=!1}}return null}var ds=[],hs=0,_a=null,Sa=0,En=[],Nn=0,Si=null,yr=1,wr="";function bi(t,r){ds[hs++]=Sa,ds[hs++]=_a,_a=t,Sa=r}function py(t,r,a){En[Nn++]=yr,En[Nn++]=wr,En[Nn++]=Si,Si=t;var f=yr;t=wr;var g=32-en(f)-1;f&=~(1<<g),a+=1;var w=32-en(r)+g;if(30<w){var R=g-g%5;w=(f&(1<<R)-1).toString(32),f>>=R,g-=R,yr=1<<32-en(r)+g|a<<g|f,wr=w+t}else yr=1<<w|a<<g|f,wr=t}function Pl(t){t.return!==null&&(bi(t,1),py(t,1,0))}function Ol(t){for(;t===_a;)_a=ds[--hs],ds[hs]=null,Sa=ds[--hs],ds[hs]=null;for(;t===Si;)Si=En[--Nn],En[Nn]=null,wr=En[--Nn],En[Nn]=null,yr=En[--Nn],En[Nn]=null}var gn=null,vn=null,ut=!1,Fn=null;function my(t,r){var a=jn(5,null,null,0);a.elementType="DELETED",a.stateNode=r,a.return=t,r=t.deletions,r===null?(t.deletions=[a],t.flags|=16):r.push(a)}function gy(t,r){switch(t.tag){case 5:var a=t.type;return r=r.nodeType!==1||a.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(t.stateNode=r,gn=t,vn=Br(r.firstChild),!0):!1;case 6:return r=t.pendingProps===""||r.nodeType!==3?null:r,r!==null?(t.stateNode=r,gn=t,vn=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(a=Si!==null?{id:yr,overflow:wr}:null,t.memoizedState={dehydrated:r,treeContext:a,retryLane:1073741824},a=jn(18,null,null,0),a.stateNode=r,a.return=t,t.child=a,gn=t,vn=null,!0):!1;default:return!1}}function ql(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Ll(t){if(ut){var r=vn;if(r){var a=r;if(!gy(t,r)){if(ql(t))throw Error(i(418));r=Br(a.nextSibling);var f=gn;r&&gy(t,r)?my(f,a):(t.flags=t.flags&-4097|2,ut=!1,gn=t)}}else{if(ql(t))throw Error(i(418));t.flags=t.flags&-4097|2,ut=!1,gn=t}}}function vy(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;gn=t}function ba(t){if(t!==gn)return!1;if(!ut)return vy(t),ut=!0,!1;var r;if((r=t.tag!==3)&&!(r=t.tag!==5)&&(r=t.type,r=r!=="head"&&r!=="body"&&!Rl(t.type,t.memoizedProps)),r&&(r=vn)){if(ql(t))throw yy(),Error(i(418));for(;r;)my(t,r),r=Br(r.nextSibling)}if(vy(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"){if(r===0){vn=Br(t.nextSibling);break e}r--}else a!=="$"&&a!=="$!"&&a!=="$?"||r++}t=t.nextSibling}vn=null}}else vn=gn?Br(t.stateNode.nextSibling):null;return!0}function yy(){for(var t=vn;t;)t=Br(t.nextSibling)}function ps(){vn=gn=null,ut=!1}function $l(t){Fn===null?Fn=[t]:Fn.push(t)}var lR=C.ReactCurrentBatchConfig;function lo(t,r,a){if(t=a.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(i(309));var f=a.stateNode}if(!f)throw Error(i(147,t));var g=f,w=""+t;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===w?r.ref:(r=function(R){var D=g.refs;R===null?delete D[w]:D[w]=R},r._stringRef=w,r)}if(typeof t!="string")throw Error(i(284));if(!a._owner)throw Error(i(290,t))}return t}function ka(t,r){throw t=Object.prototype.toString.call(r),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t))}function wy(t){var r=t._init;return r(t._payload)}function xy(t){function r(te,Y){if(t){var re=te.deletions;re===null?(te.deletions=[Y],te.flags|=16):re.push(Y)}}function a(te,Y){if(!t)return null;for(;Y!==null;)r(te,Y),Y=Y.sibling;return null}function f(te,Y){for(te=new Map;Y!==null;)Y.key!==null?te.set(Y.key,Y):te.set(Y.index,Y),Y=Y.sibling;return te}function g(te,Y){return te=Jr(te,Y),te.index=0,te.sibling=null,te}function w(te,Y,re){return te.index=re,t?(re=te.alternate,re!==null?(re=re.index,re<Y?(te.flags|=2,Y):re):(te.flags|=2,Y)):(te.flags|=1048576,Y)}function R(te){return t&&te.alternate===null&&(te.flags|=2),te}function D(te,Y,re,me){return Y===null||Y.tag!==6?(Y=Tc(re,te.mode,me),Y.return=te,Y):(Y=g(Y,re),Y.return=te,Y)}function H(te,Y,re,me){var Ne=re.type;return Ne===M?fe(te,Y,re.props.children,me,re.key):Y!==null&&(Y.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===U&&wy(Ne)===Y.type)?(me=g(Y,re.props),me.ref=lo(te,Y,re),me.return=te,me):(me=Ya(re.type,re.key,re.props,null,te.mode,me),me.ref=lo(te,Y,re),me.return=te,me)}function ie(te,Y,re,me){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==re.containerInfo||Y.stateNode.implementation!==re.implementation?(Y=jc(re,te.mode,me),Y.return=te,Y):(Y=g(Y,re.children||[]),Y.return=te,Y)}function fe(te,Y,re,me,Ne){return Y===null||Y.tag!==7?(Y=Ai(re,te.mode,me,Ne),Y.return=te,Y):(Y=g(Y,re),Y.return=te,Y)}function he(te,Y,re){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return Y=Tc(""+Y,te.mode,re),Y.return=te,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case I:return re=Ya(Y.type,Y.key,Y.props,null,te.mode,re),re.ref=lo(te,null,Y),re.return=te,re;case O:return Y=jc(Y,te.mode,re),Y.return=te,Y;case U:var me=Y._init;return he(te,me(Y._payload),re)}if(Qe(Y)||$(Y))return Y=Ai(Y,te.mode,re,null),Y.return=te,Y;ka(te,Y)}return null}function ce(te,Y,re,me){var Ne=Y!==null?Y.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Ne!==null?null:D(te,Y,""+re,me);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case I:return re.key===Ne?H(te,Y,re,me):null;case O:return re.key===Ne?ie(te,Y,re,me):null;case U:return Ne=re._init,ce(te,Y,Ne(re._payload),me)}if(Qe(re)||$(re))return Ne!==null?null:fe(te,Y,re,me,null);ka(te,re)}return null}function ve(te,Y,re,me,Ne){if(typeof me=="string"&&me!==""||typeof me=="number")return te=te.get(re)||null,D(Y,te,""+me,Ne);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case I:return te=te.get(me.key===null?re:me.key)||null,H(Y,te,me,Ne);case O:return te=te.get(me.key===null?re:me.key)||null,ie(Y,te,me,Ne);case U:var Re=me._init;return ve(te,Y,re,Re(me._payload),Ne)}if(Qe(me)||$(me))return te=te.get(re)||null,fe(Y,te,me,Ne,null);ka(Y,me)}return null}function ke(te,Y,re,me){for(var Ne=null,Re=null,Te=Y,je=Y=0,Pt=null;Te!==null&&je<re.length;je++){Te.index>je?(Pt=Te,Te=null):Pt=Te.sibling;var He=ce(te,Te,re[je],me);if(He===null){Te===null&&(Te=Pt);break}t&&Te&&He.alternate===null&&r(te,Te),Y=w(He,Y,je),Re===null?Ne=He:Re.sibling=He,Re=He,Te=Pt}if(je===re.length)return a(te,Te),ut&&bi(te,je),Ne;if(Te===null){for(;je<re.length;je++)Te=he(te,re[je],me),Te!==null&&(Y=w(Te,Y,je),Re===null?Ne=Te:Re.sibling=Te,Re=Te);return ut&&bi(te,je),Ne}for(Te=f(te,Te);je<re.length;je++)Pt=ve(Te,te,je,re[je],me),Pt!==null&&(t&&Pt.alternate!==null&&Te.delete(Pt.key===null?je:Pt.key),Y=w(Pt,Y,je),Re===null?Ne=Pt:Re.sibling=Pt,Re=Pt);return t&&Te.forEach(function(ei){return r(te,ei)}),ut&&bi(te,je),Ne}function Ee(te,Y,re,me){var Ne=$(re);if(typeof Ne!="function")throw Error(i(150));if(re=Ne.call(re),re==null)throw Error(i(151));for(var Re=Ne=null,Te=Y,je=Y=0,Pt=null,He=re.next();Te!==null&&!He.done;je++,He=re.next()){Te.index>je?(Pt=Te,Te=null):Pt=Te.sibling;var ei=ce(te,Te,He.value,me);if(ei===null){Te===null&&(Te=Pt);break}t&&Te&&ei.alternate===null&&r(te,Te),Y=w(ei,Y,je),Re===null?Ne=ei:Re.sibling=ei,Re=ei,Te=Pt}if(He.done)return a(te,Te),ut&&bi(te,je),Ne;if(Te===null){for(;!He.done;je++,He=re.next())He=he(te,He.value,me),He!==null&&(Y=w(He,Y,je),Re===null?Ne=He:Re.sibling=He,Re=He);return ut&&bi(te,je),Ne}for(Te=f(te,Te);!He.done;je++,He=re.next())He=ve(Te,te,je,He.value,me),He!==null&&(t&&He.alternate!==null&&Te.delete(He.key===null?je:He.key),Y=w(He,Y,je),Re===null?Ne=He:Re.sibling=He,Re=He);return t&&Te.forEach(function(BR){return r(te,BR)}),ut&&bi(te,je),Ne}function gt(te,Y,re,me){if(typeof re=="object"&&re!==null&&re.type===M&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case I:e:{for(var Ne=re.key,Re=Y;Re!==null;){if(Re.key===Ne){if(Ne=re.type,Ne===M){if(Re.tag===7){a(te,Re.sibling),Y=g(Re,re.props.children),Y.return=te,te=Y;break e}}else if(Re.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===U&&wy(Ne)===Re.type){a(te,Re.sibling),Y=g(Re,re.props),Y.ref=lo(te,Re,re),Y.return=te,te=Y;break e}a(te,Re);break}else r(te,Re);Re=Re.sibling}re.type===M?(Y=Ai(re.props.children,te.mode,me,re.key),Y.return=te,te=Y):(me=Ya(re.type,re.key,re.props,null,te.mode,me),me.ref=lo(te,Y,re),me.return=te,te=me)}return R(te);case O:e:{for(Re=re.key;Y!==null;){if(Y.key===Re)if(Y.tag===4&&Y.stateNode.containerInfo===re.containerInfo&&Y.stateNode.implementation===re.implementation){a(te,Y.sibling),Y=g(Y,re.children||[]),Y.return=te,te=Y;break e}else{a(te,Y);break}else r(te,Y);Y=Y.sibling}Y=jc(re,te.mode,me),Y.return=te,te=Y}return R(te);case U:return Re=re._init,gt(te,Y,Re(re._payload),me)}if(Qe(re))return ke(te,Y,re,me);if($(re))return Ee(te,Y,re,me);ka(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,Y!==null&&Y.tag===6?(a(te,Y.sibling),Y=g(Y,re),Y.return=te,te=Y):(a(te,Y),Y=Tc(re,te.mode,me),Y.return=te,te=Y),R(te)):a(te,Y)}return gt}var ms=xy(!0),_y=xy(!1),Ea=Ur(null),Na=null,gs=null,Dl=null;function Fl(){Dl=gs=Na=null}function zl(t){var r=Ea.current;ot(Ea),t._currentValue=r}function Bl(t,r,a){for(;t!==null;){var f=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,f!==null&&(f.childLanes|=r)):f!==null&&(f.childLanes&r)!==r&&(f.childLanes|=r),t===a)break;t=t.return}}function vs(t,r){Na=t,Dl=gs=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(sn=!0),t.firstContext=null)}function Cn(t){var r=t._currentValue;if(Dl!==t)if(t={context:t,memoizedValue:r,next:null},gs===null){if(Na===null)throw Error(i(308));gs=t,Na.dependencies={lanes:0,firstContext:t}}else gs=gs.next=t;return r}var ki=null;function Ul(t){ki===null?ki=[t]:ki.push(t)}function Sy(t,r,a,f){var g=r.interleaved;return g===null?(a.next=a,Ul(r)):(a.next=g.next,g.next=a),r.interleaved=a,xr(t,f)}function xr(t,r){t.lanes|=r;var a=t.alternate;for(a!==null&&(a.lanes|=r),a=t,t=t.return;t!==null;)t.childLanes|=r,a=t.alternate,a!==null&&(a.childLanes|=r),a=t,t=t.return;return a.tag===3?a.stateNode:null}var Wr=!1;function Hl(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function by(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function _r(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function Gr(t,r,a){var f=t.updateQueue;if(f===null)return null;if(f=f.shared,(De&2)!==0){var g=f.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),f.pending=r,xr(t,a)}return g=f.interleaved,g===null?(r.next=r,Ul(f)):(r.next=g.next,g.next=r),f.interleaved=r,xr(t,a)}function Ca(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194240)!==0)){var f=r.lanes;f&=t.pendingLanes,a|=f,r.lanes=a,ts(t,a)}}function ky(t,r){var a=t.updateQueue,f=t.alternate;if(f!==null&&(f=f.updateQueue,a===f)){var g=null,w=null;if(a=a.firstBaseUpdate,a!==null){do{var R={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};w===null?g=w=R:w=w.next=R,a=a.next}while(a!==null);w===null?g=w=r:w=w.next=r}else g=w=r;a={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:w,shared:f.shared,effects:f.effects},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}function Ra(t,r,a,f){var g=t.updateQueue;Wr=!1;var w=g.firstBaseUpdate,R=g.lastBaseUpdate,D=g.shared.pending;if(D!==null){g.shared.pending=null;var H=D,ie=H.next;H.next=null,R===null?w=ie:R.next=ie,R=H;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,D=fe.lastBaseUpdate,D!==R&&(D===null?fe.firstBaseUpdate=ie:D.next=ie,fe.lastBaseUpdate=H))}if(w!==null){var he=g.baseState;R=0,fe=ie=H=null,D=w;do{var ce=D.lane,ve=D.eventTime;if((f&ce)===ce){fe!==null&&(fe=fe.next={eventTime:ve,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var ke=t,Ee=D;switch(ce=r,ve=a,Ee.tag){case 1:if(ke=Ee.payload,typeof ke=="function"){he=ke.call(ve,he,ce);break e}he=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ee.payload,ce=typeof ke=="function"?ke.call(ve,he,ce):ke,ce==null)break e;he=W({},he,ce);break e;case 2:Wr=!0}}D.callback!==null&&D.lane!==0&&(t.flags|=64,ce=g.effects,ce===null?g.effects=[D]:ce.push(D))}else ve={eventTime:ve,lane:ce,tag:D.tag,payload:D.payload,callback:D.callback,next:null},fe===null?(ie=fe=ve,H=he):fe=fe.next=ve,R|=ce;if(D=D.next,D===null){if(D=g.shared.pending,D===null)break;ce=D,D=ce.next,ce.next=null,g.lastBaseUpdate=ce,g.shared.pending=null}}while(!0);if(fe===null&&(H=he),g.baseState=H,g.firstBaseUpdate=ie,g.lastBaseUpdate=fe,r=g.shared.interleaved,r!==null){g=r;do R|=g.lane,g=g.next;while(g!==r)}else w===null&&(g.shared.lanes=0);Ci|=R,t.lanes=R,t.memoizedState=he}}function Ey(t,r,a){if(t=r.effects,r.effects=null,t!==null)for(r=0;r<t.length;r++){var f=t[r],g=f.callback;if(g!==null){if(f.callback=null,f=a,typeof g!="function")throw Error(i(191,g));g.call(f)}}}var co={},ar=Ur(co),fo=Ur(co),ho=Ur(co);function Ei(t){if(t===co)throw Error(i(174));return t}function Vl(t,r){switch(it(ho,r),it(fo,t),it(ar,co),t=r.nodeType,t){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:vt(null,"");break;default:t=t===8?r.parentNode:r,r=t.namespaceURI||null,t=t.tagName,r=vt(r,t)}ot(ar),it(ar,r)}function ys(){ot(ar),ot(fo),ot(ho)}function Ny(t){Ei(ho.current);var r=Ei(ar.current),a=vt(r,t.type);r!==a&&(it(fo,t),it(ar,a))}function Wl(t){fo.current===t&&(ot(ar),ot(fo))}var ft=Ur(0);function Ta(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Gl=[];function Yl(){for(var t=0;t<Gl.length;t++)Gl[t]._workInProgressVersionPrimary=null;Gl.length=0}var ja=C.ReactCurrentDispatcher,Kl=C.ReactCurrentBatchConfig,Ni=0,dt=null,bt=null,It=null,Aa=!1,po=!1,mo=0,cR=0;function Vt(){throw Error(i(321))}function Xl(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!Dn(t[a],r[a]))return!1;return!0}function Ql(t,r,a,f,g,w){if(Ni=w,dt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,ja.current=t===null||t.memoizedState===null?pR:mR,t=a(f,g),po){w=0;do{if(po=!1,mo=0,25<=w)throw Error(i(301));w+=1,It=bt=null,r.updateQueue=null,ja.current=gR,t=a(f,g)}while(po)}if(ja.current=Pa,r=bt!==null&&bt.next!==null,Ni=0,It=bt=dt=null,Aa=!1,r)throw Error(i(300));return t}function Zl(){var t=mo!==0;return mo=0,t}function ur(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?dt.memoizedState=It=t:It=It.next=t,It}function Rn(){if(bt===null){var t=dt.alternate;t=t!==null?t.memoizedState:null}else t=bt.next;var r=It===null?dt.memoizedState:It.next;if(r!==null)It=r,bt=t;else{if(t===null)throw Error(i(310));bt=t,t={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},It===null?dt.memoizedState=It=t:It=It.next=t}return It}function go(t,r){return typeof r=="function"?r(t):r}function Jl(t){var r=Rn(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=t;var f=bt,g=f.baseQueue,w=a.pending;if(w!==null){if(g!==null){var R=g.next;g.next=w.next,w.next=R}f.baseQueue=g=w,a.pending=null}if(g!==null){w=g.next,f=f.baseState;var D=R=null,H=null,ie=w;do{var fe=ie.lane;if((Ni&fe)===fe)H!==null&&(H=H.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),f=ie.hasEagerState?ie.eagerState:t(f,ie.action);else{var he={lane:fe,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};H===null?(D=H=he,R=f):H=H.next=he,dt.lanes|=fe,Ci|=fe}ie=ie.next}while(ie!==null&&ie!==w);H===null?R=f:H.next=D,Dn(f,r.memoizedState)||(sn=!0),r.memoizedState=f,r.baseState=R,r.baseQueue=H,a.lastRenderedState=f}if(t=a.interleaved,t!==null){g=t;do w=g.lane,dt.lanes|=w,Ci|=w,g=g.next;while(g!==t)}else g===null&&(a.lanes=0);return[r.memoizedState,a.dispatch]}function ec(t){var r=Rn(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=t;var f=a.dispatch,g=a.pending,w=r.memoizedState;if(g!==null){a.pending=null;var R=g=g.next;do w=t(w,R.action),R=R.next;while(R!==g);Dn(w,r.memoizedState)||(sn=!0),r.memoizedState=w,r.baseQueue===null&&(r.baseState=w),a.lastRenderedState=w}return[w,f]}function Cy(){}function Ry(t,r){var a=dt,f=Rn(),g=r(),w=!Dn(f.memoizedState,g);if(w&&(f.memoizedState=g,sn=!0),f=f.queue,tc(Ay.bind(null,a,f,t),[t]),f.getSnapshot!==r||w||It!==null&&It.memoizedState.tag&1){if(a.flags|=2048,vo(9,jy.bind(null,a,f,g,r),void 0,null),Mt===null)throw Error(i(349));(Ni&30)!==0||Ty(a,r,g)}return g}function Ty(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=dt.updateQueue,r===null?(r={lastEffect:null,stores:null},dt.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function jy(t,r,a,f){r.value=a,r.getSnapshot=f,Iy(r)&&My(t)}function Ay(t,r,a){return a(function(){Iy(r)&&My(t)})}function Iy(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!Dn(t,a)}catch{return!0}}function My(t){var r=xr(t,1);r!==null&&Hn(r,t,1,-1)}function Py(t){var r=ur();return typeof t=="function"&&(t=t()),r.memoizedState=r.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:t},r.queue=t,t=t.dispatch=hR.bind(null,dt,t),[r.memoizedState,t]}function vo(t,r,a,f){return t={tag:t,create:r,destroy:a,deps:f,next:null},r=dt.updateQueue,r===null?(r={lastEffect:null,stores:null},dt.updateQueue=r,r.lastEffect=t.next=t):(a=r.lastEffect,a===null?r.lastEffect=t.next=t:(f=a.next,a.next=t,t.next=f,r.lastEffect=t)),t}function Oy(){return Rn().memoizedState}function Ia(t,r,a,f){var g=ur();dt.flags|=t,g.memoizedState=vo(1|r,a,void 0,f===void 0?null:f)}function Ma(t,r,a,f){var g=Rn();f=f===void 0?null:f;var w=void 0;if(bt!==null){var R=bt.memoizedState;if(w=R.destroy,f!==null&&Xl(f,R.deps)){g.memoizedState=vo(r,a,w,f);return}}dt.flags|=t,g.memoizedState=vo(1|r,a,w,f)}function qy(t,r){return Ia(8390656,8,t,r)}function tc(t,r){return Ma(2048,8,t,r)}function Ly(t,r){return Ma(4,2,t,r)}function $y(t,r){return Ma(4,4,t,r)}function Dy(t,r){if(typeof r=="function")return t=t(),r(t),function(){r(null)};if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Fy(t,r,a){return a=a!=null?a.concat([t]):null,Ma(4,4,Dy.bind(null,r,t),a)}function nc(){}function zy(t,r){var a=Rn();r=r===void 0?null:r;var f=a.memoizedState;return f!==null&&r!==null&&Xl(r,f[1])?f[0]:(a.memoizedState=[t,r],t)}function By(t,r){var a=Rn();r=r===void 0?null:r;var f=a.memoizedState;return f!==null&&r!==null&&Xl(r,f[1])?f[0]:(t=t(),a.memoizedState=[t,r],t)}function Uy(t,r,a){return(Ni&21)===0?(t.baseState&&(t.baseState=!1,sn=!0),t.memoizedState=a):(Dn(a,r)||(a=Gs(),dt.lanes|=a,Ci|=a,t.baseState=!0),r)}function fR(t,r){var a=Ge;Ge=a!==0&&4>a?a:4,t(!0);var f=Kl.transition;Kl.transition={};try{t(!1),r()}finally{Ge=a,Kl.transition=f}}function Hy(){return Rn().memoizedState}function dR(t,r,a){var f=Qr(t);if(a={lane:f,action:a,hasEagerState:!1,eagerState:null,next:null},Vy(t))Wy(r,a);else if(a=Sy(t,r,a,f),a!==null){var g=Xt();Hn(a,t,f,g),Gy(a,r,f)}}function hR(t,r,a){var f=Qr(t),g={lane:f,action:a,hasEagerState:!1,eagerState:null,next:null};if(Vy(t))Wy(r,g);else{var w=t.alternate;if(t.lanes===0&&(w===null||w.lanes===0)&&(w=r.lastRenderedReducer,w!==null))try{var R=r.lastRenderedState,D=w(R,a);if(g.hasEagerState=!0,g.eagerState=D,Dn(D,R)){var H=r.interleaved;H===null?(g.next=g,Ul(r)):(g.next=H.next,H.next=g),r.interleaved=g;return}}catch{}finally{}a=Sy(t,r,g,f),a!==null&&(g=Xt(),Hn(a,t,f,g),Gy(a,r,f))}}function Vy(t){var r=t.alternate;return t===dt||r!==null&&r===dt}function Wy(t,r){po=Aa=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Gy(t,r,a){if((a&4194240)!==0){var f=r.lanes;f&=t.pendingLanes,a|=f,r.lanes=a,ts(t,a)}}var Pa={readContext:Cn,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useInsertionEffect:Vt,useLayoutEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useMutableSource:Vt,useSyncExternalStore:Vt,useId:Vt,unstable_isNewReconciler:!1},pR={readContext:Cn,useCallback:function(t,r){return ur().memoizedState=[t,r===void 0?null:r],t},useContext:Cn,useEffect:qy,useImperativeHandle:function(t,r,a){return a=a!=null?a.concat([t]):null,Ia(4194308,4,Dy.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Ia(4194308,4,t,r)},useInsertionEffect:function(t,r){return Ia(4,2,t,r)},useMemo:function(t,r){var a=ur();return r=r===void 0?null:r,t=t(),a.memoizedState=[t,r],t},useReducer:function(t,r,a){var f=ur();return r=a!==void 0?a(r):r,f.memoizedState=f.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},f.queue=t,t=t.dispatch=dR.bind(null,dt,t),[f.memoizedState,t]},useRef:function(t){var r=ur();return t={current:t},r.memoizedState=t},useState:Py,useDebugValue:nc,useDeferredValue:function(t){return ur().memoizedState=t},useTransition:function(){var t=Py(!1),r=t[0];return t=fR.bind(null,t[1]),ur().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,a){var f=dt,g=ur();if(ut){if(a===void 0)throw Error(i(407));a=a()}else{if(a=r(),Mt===null)throw Error(i(349));(Ni&30)!==0||Ty(f,r,a)}g.memoizedState=a;var w={value:a,getSnapshot:r};return g.queue=w,qy(Ay.bind(null,f,w,t),[t]),f.flags|=2048,vo(9,jy.bind(null,f,w,a,r),void 0,null),a},useId:function(){var t=ur(),r=Mt.identifierPrefix;if(ut){var a=wr,f=yr;a=(f&~(1<<32-en(f)-1)).toString(32)+a,r=":"+r+"R"+a,a=mo++,0<a&&(r+="H"+a.toString(32)),r+=":"}else a=cR++,r=":"+r+"r"+a.toString(32)+":";return t.memoizedState=r},unstable_isNewReconciler:!1},mR={readContext:Cn,useCallback:zy,useContext:Cn,useEffect:tc,useImperativeHandle:Fy,useInsertionEffect:Ly,useLayoutEffect:$y,useMemo:By,useReducer:Jl,useRef:Oy,useState:function(){return Jl(go)},useDebugValue:nc,useDeferredValue:function(t){var r=Rn();return Uy(r,bt.memoizedState,t)},useTransition:function(){var t=Jl(go)[0],r=Rn().memoizedState;return[t,r]},useMutableSource:Cy,useSyncExternalStore:Ry,useId:Hy,unstable_isNewReconciler:!1},gR={readContext:Cn,useCallback:zy,useContext:Cn,useEffect:tc,useImperativeHandle:Fy,useInsertionEffect:Ly,useLayoutEffect:$y,useMemo:By,useReducer:ec,useRef:Oy,useState:function(){return ec(go)},useDebugValue:nc,useDeferredValue:function(t){var r=Rn();return bt===null?r.memoizedState=t:Uy(r,bt.memoizedState,t)},useTransition:function(){var t=ec(go)[0],r=Rn().memoizedState;return[t,r]},useMutableSource:Cy,useSyncExternalStore:Ry,useId:Hy,unstable_isNewReconciler:!1};function zn(t,r){if(t&&t.defaultProps){r=W({},r),t=t.defaultProps;for(var a in t)r[a]===void 0&&(r[a]=t[a]);return r}return r}function rc(t,r,a,f){r=t.memoizedState,a=a(f,r),a=a==null?r:W({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Oa={isMounted:function(t){return(t=t._reactInternals)?qt(t)===t:!1},enqueueSetState:function(t,r,a){t=t._reactInternals;var f=Xt(),g=Qr(t),w=_r(f,g);w.payload=r,a!=null&&(w.callback=a),r=Gr(t,w,g),r!==null&&(Hn(r,t,g,f),Ca(r,t,g))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var f=Xt(),g=Qr(t),w=_r(f,g);w.tag=1,w.payload=r,a!=null&&(w.callback=a),r=Gr(t,w,g),r!==null&&(Hn(r,t,g,f),Ca(r,t,g))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Xt(),f=Qr(t),g=_r(a,f);g.tag=2,r!=null&&(g.callback=r),r=Gr(t,g,f),r!==null&&(Hn(r,t,f,a),Ca(r,t,f))}};function Yy(t,r,a,f,g,w,R){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(f,w,R):r.prototype&&r.prototype.isPureReactComponent?!no(a,f)||!no(g,w):!0}function Ky(t,r,a){var f=!1,g=Hr,w=r.contextType;return typeof w=="object"&&w!==null?w=Cn(w):(g=rn(r)?_i:Ht.current,f=r.contextTypes,w=(f=f!=null)?fs(t,g):Hr),r=new r(a,w),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Oa,t.stateNode=r,r._reactInternals=t,f&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=g,t.__reactInternalMemoizedMaskedChildContext=w),r}function Xy(t,r,a,f){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,f),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,f),r.state!==t&&Oa.enqueueReplaceState(r,r.state,null)}function ic(t,r,a,f){var g=t.stateNode;g.props=a,g.state=t.memoizedState,g.refs={},Hl(t);var w=r.contextType;typeof w=="object"&&w!==null?g.context=Cn(w):(w=rn(r)?_i:Ht.current,g.context=fs(t,w)),g.state=t.memoizedState,w=r.getDerivedStateFromProps,typeof w=="function"&&(rc(t,r,w,a),g.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(r=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),r!==g.state&&Oa.enqueueReplaceState(g,g.state,null),Ra(t,a,g,f),g.state=t.memoizedState),typeof g.componentDidMount=="function"&&(t.flags|=4194308)}function ws(t,r){try{var a="",f=r;do a+=X(f),f=f.return;while(f);var g=a}catch(w){g=`
39
- Error generating stack: `+w.message+`
40
- `+w.stack}return{value:t,source:r,stack:g,digest:null}}function sc(t,r,a){return{value:t,source:null,stack:a??null,digest:r??null}}function oc(t,r){try{console.error(r.value)}catch(a){setTimeout(function(){throw a})}}var vR=typeof WeakMap=="function"?WeakMap:Map;function Qy(t,r,a){a=_r(-1,a),a.tag=3,a.payload={element:null};var f=r.value;return a.callback=function(){Ba||(Ba=!0,_c=f),oc(t,r)},a}function Zy(t,r,a){a=_r(-1,a),a.tag=3;var f=t.type.getDerivedStateFromError;if(typeof f=="function"){var g=r.value;a.payload=function(){return f(g)},a.callback=function(){oc(t,r)}}var w=t.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(a.callback=function(){oc(t,r),typeof f!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var R=r.stack;this.componentDidCatch(r.value,{componentStack:R!==null?R:""})}),a}function Jy(t,r,a){var f=t.pingCache;if(f===null){f=t.pingCache=new vR;var g=new Set;f.set(r,g)}else g=f.get(r),g===void 0&&(g=new Set,f.set(r,g));g.has(a)||(g.add(a),t=AR.bind(null,t,r,a),r.then(t,t))}function e0(t){do{var r;if((r=t.tag===13)&&(r=t.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return t;t=t.return}while(t!==null);return null}function t0(t,r,a,f,g){return(t.mode&1)===0?(t===r?t.flags|=65536:(t.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(r=_r(-1,1),r.tag=2,Gr(a,r,1))),a.lanes|=1),t):(t.flags|=65536,t.lanes=g,t)}var yR=C.ReactCurrentOwner,sn=!1;function Kt(t,r,a,f){r.child=t===null?_y(r,null,a,f):ms(r,t.child,a,f)}function n0(t,r,a,f,g){a=a.render;var w=r.ref;return vs(r,g),f=Ql(t,r,a,f,w,g),a=Zl(),t!==null&&!sn?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~g,Sr(t,r,g)):(ut&&a&&Pl(r),r.flags|=1,Kt(t,r,f,g),r.child)}function r0(t,r,a,f,g){if(t===null){var w=a.type;return typeof w=="function"&&!Rc(w)&&w.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(r.tag=15,r.type=w,i0(t,r,w,f,g)):(t=Ya(a.type,null,f,r,r.mode,g),t.ref=r.ref,t.return=r,r.child=t)}if(w=t.child,(t.lanes&g)===0){var R=w.memoizedProps;if(a=a.compare,a=a!==null?a:no,a(R,f)&&t.ref===r.ref)return Sr(t,r,g)}return r.flags|=1,t=Jr(w,f),t.ref=r.ref,t.return=r,r.child=t}function i0(t,r,a,f,g){if(t!==null){var w=t.memoizedProps;if(no(w,f)&&t.ref===r.ref)if(sn=!1,r.pendingProps=f=w,(t.lanes&g)!==0)(t.flags&131072)!==0&&(sn=!0);else return r.lanes=t.lanes,Sr(t,r,g)}return ac(t,r,a,f,g)}function s0(t,r,a){var f=r.pendingProps,g=f.children,w=t!==null?t.memoizedState:null;if(f.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},it(_s,yn),yn|=a;else{if((a&1073741824)===0)return t=w!==null?w.baseLanes|a:a,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:t,cachePool:null,transitions:null},r.updateQueue=null,it(_s,yn),yn|=t,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=w!==null?w.baseLanes:a,it(_s,yn),yn|=f}else w!==null?(f=w.baseLanes|a,r.memoizedState=null):f=a,it(_s,yn),yn|=f;return Kt(t,r,g,a),r.child}function o0(t,r){var a=r.ref;(t===null&&a!==null||t!==null&&t.ref!==a)&&(r.flags|=512,r.flags|=2097152)}function ac(t,r,a,f,g){var w=rn(a)?_i:Ht.current;return w=fs(r,w),vs(r,g),a=Ql(t,r,a,f,w,g),f=Zl(),t!==null&&!sn?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~g,Sr(t,r,g)):(ut&&f&&Pl(r),r.flags|=1,Kt(t,r,a,g),r.child)}function a0(t,r,a,f,g){if(rn(a)){var w=!0;wa(r)}else w=!1;if(vs(r,g),r.stateNode===null)La(t,r),Ky(r,a,f),ic(r,a,f,g),f=!0;else if(t===null){var R=r.stateNode,D=r.memoizedProps;R.props=D;var H=R.context,ie=a.contextType;typeof ie=="object"&&ie!==null?ie=Cn(ie):(ie=rn(a)?_i:Ht.current,ie=fs(r,ie));var fe=a.getDerivedStateFromProps,he=typeof fe=="function"||typeof R.getSnapshotBeforeUpdate=="function";he||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(D!==f||H!==ie)&&Xy(r,R,f,ie),Wr=!1;var ce=r.memoizedState;R.state=ce,Ra(r,f,R,g),H=r.memoizedState,D!==f||ce!==H||nn.current||Wr?(typeof fe=="function"&&(rc(r,a,fe,f),H=r.memoizedState),(D=Wr||Yy(r,a,D,f,ce,H,ie))?(he||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(r.flags|=4194308)):(typeof R.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=f,r.memoizedState=H),R.props=f,R.state=H,R.context=ie,f=D):(typeof R.componentDidMount=="function"&&(r.flags|=4194308),f=!1)}else{R=r.stateNode,by(t,r),D=r.memoizedProps,ie=r.type===r.elementType?D:zn(r.type,D),R.props=ie,he=r.pendingProps,ce=R.context,H=a.contextType,typeof H=="object"&&H!==null?H=Cn(H):(H=rn(a)?_i:Ht.current,H=fs(r,H));var ve=a.getDerivedStateFromProps;(fe=typeof ve=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(D!==he||ce!==H)&&Xy(r,R,f,H),Wr=!1,ce=r.memoizedState,R.state=ce,Ra(r,f,R,g);var ke=r.memoizedState;D!==he||ce!==ke||nn.current||Wr?(typeof ve=="function"&&(rc(r,a,ve,f),ke=r.memoizedState),(ie=Wr||Yy(r,a,ie,f,ce,ke,H)||!1)?(fe||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(f,ke,H),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(f,ke,H)),typeof R.componentDidUpdate=="function"&&(r.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof R.componentDidUpdate!="function"||D===t.memoizedProps&&ce===t.memoizedState||(r.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&ce===t.memoizedState||(r.flags|=1024),r.memoizedProps=f,r.memoizedState=ke),R.props=f,R.state=ke,R.context=H,f=ie):(typeof R.componentDidUpdate!="function"||D===t.memoizedProps&&ce===t.memoizedState||(r.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&ce===t.memoizedState||(r.flags|=1024),f=!1)}return uc(t,r,a,f,w,g)}function uc(t,r,a,f,g,w){o0(t,r);var R=(r.flags&128)!==0;if(!f&&!R)return g&&dy(r,a,!1),Sr(t,r,w);f=r.stateNode,yR.current=r;var D=R&&typeof a.getDerivedStateFromError!="function"?null:f.render();return r.flags|=1,t!==null&&R?(r.child=ms(r,t.child,null,w),r.child=ms(r,null,D,w)):Kt(t,r,D,w),r.memoizedState=f.state,g&&dy(r,a,!0),r.child}function u0(t){var r=t.stateNode;r.pendingContext?cy(t,r.pendingContext,r.pendingContext!==r.context):r.context&&cy(t,r.context,!1),Vl(t,r.containerInfo)}function l0(t,r,a,f,g){return ps(),$l(g),r.flags|=256,Kt(t,r,a,f),r.child}var lc={dehydrated:null,treeContext:null,retryLane:0};function cc(t){return{baseLanes:t,cachePool:null,transitions:null}}function c0(t,r,a){var f=r.pendingProps,g=ft.current,w=!1,R=(r.flags&128)!==0,D;if((D=R)||(D=t!==null&&t.memoizedState===null?!1:(g&2)!==0),D?(w=!0,r.flags&=-129):(t===null||t.memoizedState!==null)&&(g|=1),it(ft,g&1),t===null)return Ll(r),t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((r.mode&1)===0?r.lanes=1:t.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(R=f.children,t=f.fallback,w?(f=r.mode,w=r.child,R={mode:"hidden",children:R},(f&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=R):w=Ka(R,f,0,null),t=Ai(t,f,a,null),w.return=r,t.return=r,w.sibling=t,r.child=w,r.child.memoizedState=cc(a),r.memoizedState=lc,t):fc(r,R));if(g=t.memoizedState,g!==null&&(D=g.dehydrated,D!==null))return wR(t,r,R,f,D,g,a);if(w){w=f.fallback,R=r.mode,g=t.child,D=g.sibling;var H={mode:"hidden",children:f.children};return(R&1)===0&&r.child!==g?(f=r.child,f.childLanes=0,f.pendingProps=H,r.deletions=null):(f=Jr(g,H),f.subtreeFlags=g.subtreeFlags&14680064),D!==null?w=Jr(D,w):(w=Ai(w,R,a,null),w.flags|=2),w.return=r,f.return=r,f.sibling=w,r.child=f,f=w,w=r.child,R=t.child.memoizedState,R=R===null?cc(a):{baseLanes:R.baseLanes|a,cachePool:null,transitions:R.transitions},w.memoizedState=R,w.childLanes=t.childLanes&~a,r.memoizedState=lc,f}return w=t.child,t=w.sibling,f=Jr(w,{mode:"visible",children:f.children}),(r.mode&1)===0&&(f.lanes=a),f.return=r,f.sibling=null,t!==null&&(a=r.deletions,a===null?(r.deletions=[t],r.flags|=16):a.push(t)),r.child=f,r.memoizedState=null,f}function fc(t,r){return r=Ka({mode:"visible",children:r},t.mode,0,null),r.return=t,t.child=r}function qa(t,r,a,f){return f!==null&&$l(f),ms(r,t.child,null,a),t=fc(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function wR(t,r,a,f,g,w,R){if(a)return r.flags&256?(r.flags&=-257,f=sc(Error(i(422))),qa(t,r,R,f)):r.memoizedState!==null?(r.child=t.child,r.flags|=128,null):(w=f.fallback,g=r.mode,f=Ka({mode:"visible",children:f.children},g,0,null),w=Ai(w,g,R,null),w.flags|=2,f.return=r,w.return=r,f.sibling=w,r.child=f,(r.mode&1)!==0&&ms(r,t.child,null,R),r.child.memoizedState=cc(R),r.memoizedState=lc,w);if((r.mode&1)===0)return qa(t,r,R,null);if(g.data==="$!"){if(f=g.nextSibling&&g.nextSibling.dataset,f)var D=f.dgst;return f=D,w=Error(i(419)),f=sc(w,f,void 0),qa(t,r,R,f)}if(D=(R&t.childLanes)!==0,sn||D){if(f=Mt,f!==null){switch(R&-R){case 4:g=2;break;case 16:g=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:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(f.suspendedLanes|R))!==0?0:g,g!==0&&g!==w.retryLane&&(w.retryLane=g,xr(t,g),Hn(f,t,g,-1))}return Cc(),f=sc(Error(i(421))),qa(t,r,R,f)}return g.data==="$?"?(r.flags|=128,r.child=t.child,r=IR.bind(null,t),g._reactRetry=r,null):(t=w.treeContext,vn=Br(g.nextSibling),gn=r,ut=!0,Fn=null,t!==null&&(En[Nn++]=yr,En[Nn++]=wr,En[Nn++]=Si,yr=t.id,wr=t.overflow,Si=r),r=fc(r,f.children),r.flags|=4096,r)}function f0(t,r,a){t.lanes|=r;var f=t.alternate;f!==null&&(f.lanes|=r),Bl(t.return,r,a)}function dc(t,r,a,f,g){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:f,tail:a,tailMode:g}:(w.isBackwards=r,w.rendering=null,w.renderingStartTime=0,w.last=f,w.tail=a,w.tailMode=g)}function d0(t,r,a){var f=r.pendingProps,g=f.revealOrder,w=f.tail;if(Kt(t,r,f.children,a),f=ft.current,(f&2)!==0)f=f&1|2,r.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&f0(t,a,r);else if(t.tag===19)f0(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}f&=1}if(it(ft,f),(r.mode&1)===0)r.memoizedState=null;else switch(g){case"forwards":for(a=r.child,g=null;a!==null;)t=a.alternate,t!==null&&Ta(t)===null&&(g=a),a=a.sibling;a=g,a===null?(g=r.child,r.child=null):(g=a.sibling,a.sibling=null),dc(r,!1,g,a,w);break;case"backwards":for(a=null,g=r.child,r.child=null;g!==null;){if(t=g.alternate,t!==null&&Ta(t)===null){r.child=g;break}t=g.sibling,g.sibling=a,a=g,g=t}dc(r,!0,a,null,w);break;case"together":dc(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function La(t,r){(r.mode&1)===0&&t!==null&&(t.alternate=null,r.alternate=null,r.flags|=2)}function Sr(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),Ci|=r.lanes,(a&r.childLanes)===0)return null;if(t!==null&&r.child!==t.child)throw Error(i(153));if(r.child!==null){for(t=r.child,a=Jr(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Jr(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function xR(t,r,a){switch(r.tag){case 3:u0(r),ps();break;case 5:Ny(r);break;case 1:rn(r.type)&&wa(r);break;case 4:Vl(r,r.stateNode.containerInfo);break;case 10:var f=r.type._context,g=r.memoizedProps.value;it(Ea,f._currentValue),f._currentValue=g;break;case 13:if(f=r.memoizedState,f!==null)return f.dehydrated!==null?(it(ft,ft.current&1),r.flags|=128,null):(a&r.child.childLanes)!==0?c0(t,r,a):(it(ft,ft.current&1),t=Sr(t,r,a),t!==null?t.sibling:null);it(ft,ft.current&1);break;case 19:if(f=(a&r.childLanes)!==0,(t.flags&128)!==0){if(f)return d0(t,r,a);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),it(ft,ft.current),f)break;return null;case 22:case 23:return r.lanes=0,s0(t,r,a)}return Sr(t,r,a)}var h0,hc,p0,m0;h0=function(t,r){for(var a=r.child;a!==null;){if(a.tag===5||a.tag===6)t.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},hc=function(){},p0=function(t,r,a,f){var g=t.memoizedProps;if(g!==f){t=r.stateNode,Ei(ar.current);var w=null;switch(a){case"input":g=Ie(t,g),f=Ie(t,f),w=[];break;case"select":g=W({},g,{value:void 0}),f=W({},f,{value:void 0}),w=[];break;case"textarea":g=Ve(t,g),f=Ve(t,f),w=[];break;default:typeof g.onClick!="function"&&typeof f.onClick=="function"&&(t.onclick=ga)}Bt(a,f);var R;a=null;for(ie in g)if(!f.hasOwnProperty(ie)&&g.hasOwnProperty(ie)&&g[ie]!=null)if(ie==="style"){var D=g[ie];for(R in D)D.hasOwnProperty(R)&&(a||(a={}),a[R]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(o.hasOwnProperty(ie)?w||(w=[]):(w=w||[]).push(ie,null));for(ie in f){var H=f[ie];if(D=g!=null?g[ie]:void 0,f.hasOwnProperty(ie)&&H!==D&&(H!=null||D!=null))if(ie==="style")if(D){for(R in D)!D.hasOwnProperty(R)||H&&H.hasOwnProperty(R)||(a||(a={}),a[R]="");for(R in H)H.hasOwnProperty(R)&&D[R]!==H[R]&&(a||(a={}),a[R]=H[R])}else a||(w||(w=[]),w.push(ie,a)),a=H;else ie==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,D=D?D.__html:void 0,H!=null&&D!==H&&(w=w||[]).push(ie,H)):ie==="children"?typeof H!="string"&&typeof H!="number"||(w=w||[]).push(ie,""+H):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(o.hasOwnProperty(ie)?(H!=null&&ie==="onScroll"&&st("scroll",t),w||D===H||(w=[])):(w=w||[]).push(ie,H))}a&&(w=w||[]).push("style",a);var ie=w;(r.updateQueue=ie)&&(r.flags|=4)}},m0=function(t,r,a,f){a!==f&&(r.flags|=4)};function yo(t,r){if(!ut)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var f=null;a!==null;)a.alternate!==null&&(f=a),a=a.sibling;f===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:f.sibling=null}}function Wt(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,f=0;if(r)for(var g=t.child;g!==null;)a|=g.lanes|g.childLanes,f|=g.subtreeFlags&14680064,f|=g.flags&14680064,g.return=t,g=g.sibling;else for(g=t.child;g!==null;)a|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=t,g=g.sibling;return t.subtreeFlags|=f,t.childLanes=a,r}function _R(t,r,a){var f=r.pendingProps;switch(Ol(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(r),null;case 1:return rn(r.type)&&ya(),Wt(r),null;case 3:return f=r.stateNode,ys(),ot(nn),ot(Ht),Yl(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(t===null||t.child===null)&&(ba(r)?r.flags|=4:t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Fn!==null&&(kc(Fn),Fn=null))),hc(t,r),Wt(r),null;case 5:Wl(r);var g=Ei(ho.current);if(a=r.type,t!==null&&r.stateNode!=null)p0(t,r,a,f,g),t.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!f){if(r.stateNode===null)throw Error(i(166));return Wt(r),null}if(t=Ei(ar.current),ba(r)){f=r.stateNode,a=r.type;var w=r.memoizedProps;switch(f[or]=r,f[ao]=w,t=(r.mode&1)!==0,a){case"dialog":st("cancel",f),st("close",f);break;case"iframe":case"object":case"embed":st("load",f);break;case"video":case"audio":for(g=0;g<io.length;g++)st(io[g],f);break;case"source":st("error",f);break;case"img":case"image":case"link":st("error",f),st("load",f);break;case"details":st("toggle",f);break;case"input":be(f,w),st("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!w.multiple},st("invalid",f);break;case"textarea":Ye(f,w),st("invalid",f)}Bt(a,w),g=null;for(var R in w)if(w.hasOwnProperty(R)){var D=w[R];R==="children"?typeof D=="string"?f.textContent!==D&&(w.suppressHydrationWarning!==!0&&ma(f.textContent,D,t),g=["children",D]):typeof D=="number"&&f.textContent!==""+D&&(w.suppressHydrationWarning!==!0&&ma(f.textContent,D,t),g=["children",""+D]):o.hasOwnProperty(R)&&D!=null&&R==="onScroll"&&st("scroll",f)}switch(a){case"input":Ae(f),we(f,w,!0);break;case"textarea":Ae(f),Ke(f);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(f.onclick=ga)}f=g,r.updateQueue=f,f!==null&&(r.flags|=4)}else{R=g.nodeType===9?g:g.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Qt(a)),t==="http://www.w3.org/1999/xhtml"?a==="script"?(t=R.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof f.is=="string"?t=R.createElement(a,{is:f.is}):(t=R.createElement(a),a==="select"&&(R=t,f.multiple?R.multiple=!0:f.size&&(R.size=f.size))):t=R.createElementNS(t,a),t[or]=r,t[ao]=f,h0(t,r,!1,!1),r.stateNode=t;e:{switch(R=Rt(a,f),a){case"dialog":st("cancel",t),st("close",t),g=f;break;case"iframe":case"object":case"embed":st("load",t),g=f;break;case"video":case"audio":for(g=0;g<io.length;g++)st(io[g],t);g=f;break;case"source":st("error",t),g=f;break;case"img":case"image":case"link":st("error",t),st("load",t),g=f;break;case"details":st("toggle",t),g=f;break;case"input":be(t,f),g=Ie(t,f),st("invalid",t);break;case"option":g=f;break;case"select":t._wrapperState={wasMultiple:!!f.multiple},g=W({},f,{value:void 0}),st("invalid",t);break;case"textarea":Ye(t,f),g=Ve(t,f),st("invalid",t);break;default:g=f}Bt(a,g),D=g;for(w in D)if(D.hasOwnProperty(w)){var H=D[w];w==="style"?at(t,H):w==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&Zt(t,H)):w==="children"?typeof H=="string"?(a!=="textarea"||H!=="")&&Ct(t,H):typeof H=="number"&&Ct(t,""+H):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(o.hasOwnProperty(w)?H!=null&&w==="onScroll"&&st("scroll",t):H!=null&&E(t,w,H,R))}switch(a){case"input":Ae(t),we(t,f,!1);break;case"textarea":Ae(t),Ke(t);break;case"option":f.value!=null&&t.setAttribute("value",""+oe(f.value));break;case"select":t.multiple=!!f.multiple,w=f.value,w!=null?et(t,!!f.multiple,w,!1):f.defaultValue!=null&&et(t,!!f.multiple,f.defaultValue,!0);break;default:typeof g.onClick=="function"&&(t.onclick=ga)}switch(a){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return Wt(r),null;case 6:if(t&&r.stateNode!=null)m0(t,r,t.memoizedProps,f);else{if(typeof f!="string"&&r.stateNode===null)throw Error(i(166));if(a=Ei(ho.current),Ei(ar.current),ba(r)){if(f=r.stateNode,a=r.memoizedProps,f[or]=r,(w=f.nodeValue!==a)&&(t=gn,t!==null))switch(t.tag){case 3:ma(f.nodeValue,a,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&ma(f.nodeValue,a,(t.mode&1)!==0)}w&&(r.flags|=4)}else f=(a.nodeType===9?a:a.ownerDocument).createTextNode(f),f[or]=r,r.stateNode=f}return Wt(r),null;case 13:if(ot(ft),f=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ut&&vn!==null&&(r.mode&1)!==0&&(r.flags&128)===0)yy(),ps(),r.flags|=98560,w=!1;else if(w=ba(r),f!==null&&f.dehydrated!==null){if(t===null){if(!w)throw Error(i(318));if(w=r.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(i(317));w[or]=r}else ps(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Wt(r),w=!1}else Fn!==null&&(kc(Fn),Fn=null),w=!0;if(!w)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=a,r):(f=f!==null,f!==(t!==null&&t.memoizedState!==null)&&f&&(r.child.flags|=8192,(r.mode&1)!==0&&(t===null||(ft.current&1)!==0?kt===0&&(kt=3):Cc())),r.updateQueue!==null&&(r.flags|=4),Wt(r),null);case 4:return ys(),hc(t,r),t===null&&so(r.stateNode.containerInfo),Wt(r),null;case 10:return zl(r.type._context),Wt(r),null;case 17:return rn(r.type)&&ya(),Wt(r),null;case 19:if(ot(ft),w=r.memoizedState,w===null)return Wt(r),null;if(f=(r.flags&128)!==0,R=w.rendering,R===null)if(f)yo(w,!1);else{if(kt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(R=Ta(t),R!==null){for(r.flags|=128,yo(w,!1),f=R.updateQueue,f!==null&&(r.updateQueue=f,r.flags|=4),r.subtreeFlags=0,f=a,a=r.child;a!==null;)w=a,t=f,w.flags&=14680066,R=w.alternate,R===null?(w.childLanes=0,w.lanes=t,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=R.childLanes,w.lanes=R.lanes,w.child=R.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=R.memoizedProps,w.memoizedState=R.memoizedState,w.updateQueue=R.updateQueue,w.type=R.type,t=R.dependencies,w.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),a=a.sibling;return it(ft,ft.current&1|2),r.child}t=t.sibling}w.tail!==null&&rt()>Ss&&(r.flags|=128,f=!0,yo(w,!1),r.lanes=4194304)}else{if(!f)if(t=Ta(R),t!==null){if(r.flags|=128,f=!0,a=t.updateQueue,a!==null&&(r.updateQueue=a,r.flags|=4),yo(w,!0),w.tail===null&&w.tailMode==="hidden"&&!R.alternate&&!ut)return Wt(r),null}else 2*rt()-w.renderingStartTime>Ss&&a!==1073741824&&(r.flags|=128,f=!0,yo(w,!1),r.lanes=4194304);w.isBackwards?(R.sibling=r.child,r.child=R):(a=w.last,a!==null?a.sibling=R:r.child=R,w.last=R)}return w.tail!==null?(r=w.tail,w.rendering=r,w.tail=r.sibling,w.renderingStartTime=rt(),r.sibling=null,a=ft.current,it(ft,f?a&1|2:a&1),r):(Wt(r),null);case 22:case 23:return Nc(),f=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==f&&(r.flags|=8192),f&&(r.mode&1)!==0?(yn&1073741824)!==0&&(Wt(r),r.subtreeFlags&6&&(r.flags|=8192)):Wt(r),null;case 24:return null;case 25:return null}throw Error(i(156,r.tag))}function SR(t,r){switch(Ol(r),r.tag){case 1:return rn(r.type)&&ya(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return ys(),ot(nn),ot(Ht),Yl(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return Wl(r),null;case 13:if(ot(ft),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(i(340));ps()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return ot(ft),null;case 4:return ys(),null;case 10:return zl(r.type._context),null;case 22:case 23:return Nc(),null;case 24:return null;default:return null}}var $a=!1,Gt=!1,bR=typeof WeakSet=="function"?WeakSet:Set,Se=null;function xs(t,r){var a=t.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(f){pt(t,r,f)}else a.current=null}function pc(t,r,a){try{a()}catch(f){pt(t,r,f)}}var g0=!1;function kR(t,r){if(Nl=sr,t=Yv(),yl(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var f=a.getSelection&&a.getSelection();if(f&&f.rangeCount!==0){a=f.anchorNode;var g=f.anchorOffset,w=f.focusNode;f=f.focusOffset;try{a.nodeType,w.nodeType}catch{a=null;break e}var R=0,D=-1,H=-1,ie=0,fe=0,he=t,ce=null;t:for(;;){for(var ve;he!==a||g!==0&&he.nodeType!==3||(D=R+g),he!==w||f!==0&&he.nodeType!==3||(H=R+f),he.nodeType===3&&(R+=he.nodeValue.length),(ve=he.firstChild)!==null;)ce=he,he=ve;for(;;){if(he===t)break t;if(ce===a&&++ie===g&&(D=R),ce===w&&++fe===f&&(H=R),(ve=he.nextSibling)!==null)break;he=ce,ce=he.parentNode}he=ve}a=D===-1||H===-1?null:{start:D,end:H}}else a=null}a=a||{start:0,end:0}}else a=null;for(Cl={focusedElem:t,selectionRange:a},sr=!1,Se=r;Se!==null;)if(r=Se,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Se=t;else for(;Se!==null;){r=Se;try{var ke=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(ke!==null){var Ee=ke.memoizedProps,gt=ke.memoizedState,te=r.stateNode,Y=te.getSnapshotBeforeUpdate(r.elementType===r.type?Ee:zn(r.type,Ee),gt);te.__reactInternalSnapshotBeforeUpdate=Y}break;case 3:var re=r.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(me){pt(r,r.return,me)}if(t=r.sibling,t!==null){t.return=r.return,Se=t;break}Se=r.return}return ke=g0,g0=!1,ke}function wo(t,r,a){var f=r.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&t)===t){var w=g.destroy;g.destroy=void 0,w!==void 0&&pc(r,a,w)}g=g.next}while(g!==f)}}function Da(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&t)===t){var f=a.create;a.destroy=f()}a=a.next}while(a!==r)}}function mc(t){var r=t.ref;if(r!==null){var a=t.stateNode;switch(t.tag){case 5:t=a;break;default:t=a}typeof r=="function"?r(t):r.current=t}}function v0(t){var r=t.alternate;r!==null&&(t.alternate=null,v0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[or],delete r[ao],delete r[Al],delete r[oR],delete r[aR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function y0(t){return t.tag===5||t.tag===3||t.tag===4}function w0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||y0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function gc(t,r,a){var f=t.tag;if(f===5||f===6)t=t.stateNode,r?a.nodeType===8?a.parentNode.insertBefore(t,r):a.insertBefore(t,r):(a.nodeType===8?(r=a.parentNode,r.insertBefore(t,a)):(r=a,r.appendChild(t)),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=ga));else if(f!==4&&(t=t.child,t!==null))for(gc(t,r,a),t=t.sibling;t!==null;)gc(t,r,a),t=t.sibling}function vc(t,r,a){var f=t.tag;if(f===5||f===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(f!==4&&(t=t.child,t!==null))for(vc(t,r,a),t=t.sibling;t!==null;)vc(t,r,a),t=t.sibling}var Dt=null,Bn=!1;function Yr(t,r,a){for(a=a.child;a!==null;)x0(t,r,a),a=a.sibling}function x0(t,r,a){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(rr,a)}catch{}switch(a.tag){case 5:Gt||xs(a,r);case 6:var f=Dt,g=Bn;Dt=null,Yr(t,r,a),Dt=f,Bn=g,Dt!==null&&(Bn?(t=Dt,a=a.stateNode,t.nodeType===8?t.parentNode.removeChild(a):t.removeChild(a)):Dt.removeChild(a.stateNode));break;case 18:Dt!==null&&(Bn?(t=Dt,a=a.stateNode,t.nodeType===8?jl(t.parentNode,a):t.nodeType===1&&jl(t,a),Je(t)):jl(Dt,a.stateNode));break;case 4:f=Dt,g=Bn,Dt=a.stateNode.containerInfo,Bn=!0,Yr(t,r,a),Dt=f,Bn=g;break;case 0:case 11:case 14:case 15:if(!Gt&&(f=a.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){g=f=f.next;do{var w=g,R=w.destroy;w=w.tag,R!==void 0&&((w&2)!==0||(w&4)!==0)&&pc(a,r,R),g=g.next}while(g!==f)}Yr(t,r,a);break;case 1:if(!Gt&&(xs(a,r),f=a.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=a.memoizedProps,f.state=a.memoizedState,f.componentWillUnmount()}catch(D){pt(a,r,D)}Yr(t,r,a);break;case 21:Yr(t,r,a);break;case 22:a.mode&1?(Gt=(f=Gt)||a.memoizedState!==null,Yr(t,r,a),Gt=f):Yr(t,r,a);break;default:Yr(t,r,a)}}function _0(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var a=t.stateNode;a===null&&(a=t.stateNode=new bR),r.forEach(function(f){var g=MR.bind(null,t,f);a.has(f)||(a.add(f),f.then(g,g))})}}function Un(t,r){var a=r.deletions;if(a!==null)for(var f=0;f<a.length;f++){var g=a[f];try{var w=t,R=r,D=R;e:for(;D!==null;){switch(D.tag){case 5:Dt=D.stateNode,Bn=!1;break e;case 3:Dt=D.stateNode.containerInfo,Bn=!0;break e;case 4:Dt=D.stateNode.containerInfo,Bn=!0;break e}D=D.return}if(Dt===null)throw Error(i(160));x0(w,R,g),Dt=null,Bn=!1;var H=g.alternate;H!==null&&(H.return=null),g.return=null}catch(ie){pt(g,r,ie)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)S0(r,t),r=r.sibling}function S0(t,r){var a=t.alternate,f=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Un(r,t),lr(t),f&4){try{wo(3,t,t.return),Da(3,t)}catch(Ee){pt(t,t.return,Ee)}try{wo(5,t,t.return)}catch(Ee){pt(t,t.return,Ee)}}break;case 1:Un(r,t),lr(t),f&512&&a!==null&&xs(a,a.return);break;case 5:if(Un(r,t),lr(t),f&512&&a!==null&&xs(a,a.return),t.flags&32){var g=t.stateNode;try{Ct(g,"")}catch(Ee){pt(t,t.return,Ee)}}if(f&4&&(g=t.stateNode,g!=null)){var w=t.memoizedProps,R=a!==null?a.memoizedProps:w,D=t.type,H=t.updateQueue;if(t.updateQueue=null,H!==null)try{D==="input"&&w.type==="radio"&&w.name!=null&&Be(g,w),Rt(D,R);var ie=Rt(D,w);for(R=0;R<H.length;R+=2){var fe=H[R],he=H[R+1];fe==="style"?at(g,he):fe==="dangerouslySetInnerHTML"?Zt(g,he):fe==="children"?Ct(g,he):E(g,fe,he,ie)}switch(D){case"input":ye(g,w);break;case"textarea":We(g,w);break;case"select":var ce=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!w.multiple;var ve=w.value;ve!=null?et(g,!!w.multiple,ve,!1):ce!==!!w.multiple&&(w.defaultValue!=null?et(g,!!w.multiple,w.defaultValue,!0):et(g,!!w.multiple,w.multiple?[]:"",!1))}g[ao]=w}catch(Ee){pt(t,t.return,Ee)}}break;case 6:if(Un(r,t),lr(t),f&4){if(t.stateNode===null)throw Error(i(162));g=t.stateNode,w=t.memoizedProps;try{g.nodeValue=w}catch(Ee){pt(t,t.return,Ee)}}break;case 3:if(Un(r,t),lr(t),f&4&&a!==null&&a.memoizedState.isDehydrated)try{Je(r.containerInfo)}catch(Ee){pt(t,t.return,Ee)}break;case 4:Un(r,t),lr(t);break;case 13:Un(r,t),lr(t),g=t.child,g.flags&8192&&(w=g.memoizedState!==null,g.stateNode.isHidden=w,!w||g.alternate!==null&&g.alternate.memoizedState!==null||(xc=rt())),f&4&&_0(t);break;case 22:if(fe=a!==null&&a.memoizedState!==null,t.mode&1?(Gt=(ie=Gt)||fe,Un(r,t),Gt=ie):Un(r,t),lr(t),f&8192){if(ie=t.memoizedState!==null,(t.stateNode.isHidden=ie)&&!fe&&(t.mode&1)!==0)for(Se=t,fe=t.child;fe!==null;){for(he=Se=fe;Se!==null;){switch(ce=Se,ve=ce.child,ce.tag){case 0:case 11:case 14:case 15:wo(4,ce,ce.return);break;case 1:xs(ce,ce.return);var ke=ce.stateNode;if(typeof ke.componentWillUnmount=="function"){f=ce,a=ce.return;try{r=f,ke.props=r.memoizedProps,ke.state=r.memoizedState,ke.componentWillUnmount()}catch(Ee){pt(f,a,Ee)}}break;case 5:xs(ce,ce.return);break;case 22:if(ce.memoizedState!==null){E0(he);continue}}ve!==null?(ve.return=ce,Se=ve):E0(he)}fe=fe.sibling}e:for(fe=null,he=t;;){if(he.tag===5){if(fe===null){fe=he;try{g=he.stateNode,ie?(w=g.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):(D=he.stateNode,H=he.memoizedProps.style,R=H!=null&&H.hasOwnProperty("display")?H.display:null,D.style.display=ht("display",R))}catch(Ee){pt(t,t.return,Ee)}}}else if(he.tag===6){if(fe===null)try{he.stateNode.nodeValue=ie?"":he.memoizedProps}catch(Ee){pt(t,t.return,Ee)}}else if((he.tag!==22&&he.tag!==23||he.memoizedState===null||he===t)&&he.child!==null){he.child.return=he,he=he.child;continue}if(he===t)break e;for(;he.sibling===null;){if(he.return===null||he.return===t)break e;fe===he&&(fe=null),he=he.return}fe===he&&(fe=null),he.sibling.return=he.return,he=he.sibling}}break;case 19:Un(r,t),lr(t),f&4&&_0(t);break;case 21:break;default:Un(r,t),lr(t)}}function lr(t){var r=t.flags;if(r&2){try{e:{for(var a=t.return;a!==null;){if(y0(a)){var f=a;break e}a=a.return}throw Error(i(160))}switch(f.tag){case 5:var g=f.stateNode;f.flags&32&&(Ct(g,""),f.flags&=-33);var w=w0(t);vc(t,w,g);break;case 3:case 4:var R=f.stateNode.containerInfo,D=w0(t);gc(t,D,R);break;default:throw Error(i(161))}}catch(H){pt(t,t.return,H)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function ER(t,r,a){Se=t,b0(t)}function b0(t,r,a){for(var f=(t.mode&1)!==0;Se!==null;){var g=Se,w=g.child;if(g.tag===22&&f){var R=g.memoizedState!==null||$a;if(!R){var D=g.alternate,H=D!==null&&D.memoizedState!==null||Gt;D=$a;var ie=Gt;if($a=R,(Gt=H)&&!ie)for(Se=g;Se!==null;)R=Se,H=R.child,R.tag===22&&R.memoizedState!==null?N0(g):H!==null?(H.return=R,Se=H):N0(g);for(;w!==null;)Se=w,b0(w),w=w.sibling;Se=g,$a=D,Gt=ie}k0(t)}else(g.subtreeFlags&8772)!==0&&w!==null?(w.return=g,Se=w):k0(t)}}function k0(t){for(;Se!==null;){var r=Se;if((r.flags&8772)!==0){var a=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:Gt||Da(5,r);break;case 1:var f=r.stateNode;if(r.flags&4&&!Gt)if(a===null)f.componentDidMount();else{var g=r.elementType===r.type?a.memoizedProps:zn(r.type,a.memoizedProps);f.componentDidUpdate(g,a.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var w=r.updateQueue;w!==null&&Ey(r,w,f);break;case 3:var R=r.updateQueue;if(R!==null){if(a=null,r.child!==null)switch(r.child.tag){case 5:a=r.child.stateNode;break;case 1:a=r.child.stateNode}Ey(r,R,a)}break;case 5:var D=r.stateNode;if(a===null&&r.flags&4){a=D;var H=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&a.focus();break;case"img":H.src&&(a.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var ie=r.alternate;if(ie!==null){var fe=ie.memoizedState;if(fe!==null){var he=fe.dehydrated;he!==null&&Je(he)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}Gt||r.flags&512&&mc(r)}catch(ce){pt(r,r.return,ce)}}if(r===t){Se=null;break}if(a=r.sibling,a!==null){a.return=r.return,Se=a;break}Se=r.return}}function E0(t){for(;Se!==null;){var r=Se;if(r===t){Se=null;break}var a=r.sibling;if(a!==null){a.return=r.return,Se=a;break}Se=r.return}}function N0(t){for(;Se!==null;){var r=Se;try{switch(r.tag){case 0:case 11:case 15:var a=r.return;try{Da(4,r)}catch(H){pt(r,a,H)}break;case 1:var f=r.stateNode;if(typeof f.componentDidMount=="function"){var g=r.return;try{f.componentDidMount()}catch(H){pt(r,g,H)}}var w=r.return;try{mc(r)}catch(H){pt(r,w,H)}break;case 5:var R=r.return;try{mc(r)}catch(H){pt(r,R,H)}}}catch(H){pt(r,r.return,H)}if(r===t){Se=null;break}var D=r.sibling;if(D!==null){D.return=r.return,Se=D;break}Se=r.return}}var NR=Math.ceil,Fa=C.ReactCurrentDispatcher,yc=C.ReactCurrentOwner,Tn=C.ReactCurrentBatchConfig,De=0,Mt=null,wt=null,Ft=0,yn=0,_s=Ur(0),kt=0,xo=null,Ci=0,za=0,wc=0,_o=null,on=null,xc=0,Ss=1/0,br=null,Ba=!1,_c=null,Kr=null,Ua=!1,Xr=null,Ha=0,So=0,Sc=null,Va=-1,Wa=0;function Xt(){return(De&6)!==0?rt():Va!==-1?Va:Va=rt()}function Qr(t){return(t.mode&1)===0?1:(De&2)!==0&&Ft!==0?Ft&-Ft:lR.transition!==null?(Wa===0&&(Wa=Gs()),Wa):(t=Ge,t!==0||(t=window.event,t=t===void 0?16:kn(t.type)),t)}function Hn(t,r,a,f){if(50<So)throw So=0,Sc=null,Error(i(185));Ut(t,a,f),((De&2)===0||t!==Mt)&&(t===Mt&&((De&2)===0&&(za|=a),kt===4&&Zr(t,Ft)),an(t,f),a===1&&De===0&&(r.mode&1)===0&&(Ss=rt()+500,xa&&Vr()))}function an(t,r){var a=t.callbackNode;ul(t,r);var f=$r(t,t===Mt?Ft:0);if(f===0)a!==null&&pi(a),t.callbackNode=null,t.callbackPriority=0;else if(r=f&-f,t.callbackPriority!==r){if(a!=null&&pi(a),r===1)t.tag===0?uR(R0.bind(null,t)):hy(R0.bind(null,t)),iR(function(){(De&6)===0&&Vr()}),a=null;else{switch(ia(f)){case 1:a=jt;break;case 4:a=Or;break;case 16:a=pn;break;case 536870912:a=qr;break;default:a=pn}a=q0(a,C0.bind(null,t))}t.callbackPriority=r,t.callbackNode=a}}function C0(t,r){if(Va=-1,Wa=0,(De&6)!==0)throw Error(i(327));var a=t.callbackNode;if(bs()&&t.callbackNode!==a)return null;var f=$r(t,t===Mt?Ft:0);if(f===0)return null;if((f&30)!==0||(f&t.expiredLanes)!==0||r)r=Ga(t,f);else{r=f;var g=De;De|=2;var w=j0();(Mt!==t||Ft!==r)&&(br=null,Ss=rt()+500,Ti(t,r));do try{TR();break}catch(D){T0(t,D)}while(!0);Fl(),Fa.current=w,De=g,wt!==null?r=0:(Mt=null,Ft=0,r=kt)}if(r!==0){if(r===2&&(g=Ws(t),g!==0&&(f=g,r=bc(t,g))),r===1)throw a=xo,Ti(t,0),Zr(t,f),an(t,rt()),a;if(r===6)Zr(t,f);else{if(g=t.current.alternate,(f&30)===0&&!CR(g)&&(r=Ga(t,f),r===2&&(w=Ws(t),w!==0&&(f=w,r=bc(t,w))),r===1))throw a=xo,Ti(t,0),Zr(t,f),an(t,rt()),a;switch(t.finishedWork=g,t.finishedLanes=f,r){case 0:case 1:throw Error(i(345));case 2:ji(t,on,br);break;case 3:if(Zr(t,f),(f&130023424)===f&&(r=xc+500-rt(),10<r)){if($r(t,0)!==0)break;if(g=t.suspendedLanes,(g&f)!==f){Xt(),t.pingedLanes|=t.suspendedLanes&g;break}t.timeoutHandle=Tl(ji.bind(null,t,on,br),r);break}ji(t,on,br);break;case 4:if(Zr(t,f),(f&4194240)===f)break;for(r=t.eventTimes,g=-1;0<f;){var R=31-en(f);w=1<<R,R=r[R],R>g&&(g=R),f&=~w}if(f=g,f=rt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*NR(f/1960))-f,10<f){t.timeoutHandle=Tl(ji.bind(null,t,on,br),f);break}ji(t,on,br);break;case 5:ji(t,on,br);break;default:throw Error(i(329))}}}return an(t,rt()),t.callbackNode===a?C0.bind(null,t):null}function bc(t,r){var a=_o;return t.current.memoizedState.isDehydrated&&(Ti(t,r).flags|=256),t=Ga(t,r),t!==2&&(r=on,on=a,r!==null&&kc(r)),t}function kc(t){on===null?on=t:on.push.apply(on,t)}function CR(t){for(var r=t;;){if(r.flags&16384){var a=r.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var f=0;f<a.length;f++){var g=a[f],w=g.getSnapshot;g=g.value;try{if(!Dn(w(),g))return!1}catch{return!1}}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Zr(t,r){for(r&=~wc,r&=~za,t.suspendedLanes|=r,t.pingedLanes&=~r,t=t.expirationTimes;0<r;){var a=31-en(r),f=1<<a;t[a]=-1,r&=~f}}function R0(t){if((De&6)!==0)throw Error(i(327));bs();var r=$r(t,0);if((r&1)===0)return an(t,rt()),null;var a=Ga(t,r);if(t.tag!==0&&a===2){var f=Ws(t);f!==0&&(r=f,a=bc(t,f))}if(a===1)throw a=xo,Ti(t,0),Zr(t,r),an(t,rt()),a;if(a===6)throw Error(i(345));return t.finishedWork=t.current.alternate,t.finishedLanes=r,ji(t,on,br),an(t,rt()),null}function Ec(t,r){var a=De;De|=1;try{return t(r)}finally{De=a,De===0&&(Ss=rt()+500,xa&&Vr())}}function Ri(t){Xr!==null&&Xr.tag===0&&(De&6)===0&&bs();var r=De;De|=1;var a=Tn.transition,f=Ge;try{if(Tn.transition=null,Ge=1,t)return t()}finally{Ge=f,Tn.transition=a,De=r,(De&6)===0&&Vr()}}function Nc(){yn=_s.current,ot(_s)}function Ti(t,r){t.finishedWork=null,t.finishedLanes=0;var a=t.timeoutHandle;if(a!==-1&&(t.timeoutHandle=-1,rR(a)),wt!==null)for(a=wt.return;a!==null;){var f=a;switch(Ol(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&ya();break;case 3:ys(),ot(nn),ot(Ht),Yl();break;case 5:Wl(f);break;case 4:ys();break;case 13:ot(ft);break;case 19:ot(ft);break;case 10:zl(f.type._context);break;case 22:case 23:Nc()}a=a.return}if(Mt=t,wt=t=Jr(t.current,null),Ft=yn=r,kt=0,xo=null,wc=za=Ci=0,on=_o=null,ki!==null){for(r=0;r<ki.length;r++)if(a=ki[r],f=a.interleaved,f!==null){a.interleaved=null;var g=f.next,w=a.pending;if(w!==null){var R=w.next;w.next=g,f.next=R}a.pending=f}ki=null}return t}function T0(t,r){do{var a=wt;try{if(Fl(),ja.current=Pa,Aa){for(var f=dt.memoizedState;f!==null;){var g=f.queue;g!==null&&(g.pending=null),f=f.next}Aa=!1}if(Ni=0,It=bt=dt=null,po=!1,mo=0,yc.current=null,a===null||a.return===null){kt=1,xo=r,wt=null;break}e:{var w=t,R=a.return,D=a,H=r;if(r=Ft,D.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var ie=H,fe=D,he=fe.tag;if((fe.mode&1)===0&&(he===0||he===11||he===15)){var ce=fe.alternate;ce?(fe.updateQueue=ce.updateQueue,fe.memoizedState=ce.memoizedState,fe.lanes=ce.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var ve=e0(R);if(ve!==null){ve.flags&=-257,t0(ve,R,D,w,r),ve.mode&1&&Jy(w,ie,r),r=ve,H=ie;var ke=r.updateQueue;if(ke===null){var Ee=new Set;Ee.add(H),r.updateQueue=Ee}else ke.add(H);break e}else{if((r&1)===0){Jy(w,ie,r),Cc();break e}H=Error(i(426))}}else if(ut&&D.mode&1){var gt=e0(R);if(gt!==null){(gt.flags&65536)===0&&(gt.flags|=256),t0(gt,R,D,w,r),$l(ws(H,D));break e}}w=H=ws(H,D),kt!==4&&(kt=2),_o===null?_o=[w]:_o.push(w),w=R;do{switch(w.tag){case 3:w.flags|=65536,r&=-r,w.lanes|=r;var te=Qy(w,H,r);ky(w,te);break e;case 1:D=H;var Y=w.type,re=w.stateNode;if((w.flags&128)===0&&(typeof Y.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(Kr===null||!Kr.has(re)))){w.flags|=65536,r&=-r,w.lanes|=r;var me=Zy(w,D,r);ky(w,me);break e}}w=w.return}while(w!==null)}I0(a)}catch(Ne){r=Ne,wt===a&&a!==null&&(wt=a=a.return);continue}break}while(!0)}function j0(){var t=Fa.current;return Fa.current=Pa,t===null?Pa:t}function Cc(){(kt===0||kt===3||kt===2)&&(kt=4),Mt===null||(Ci&268435455)===0&&(za&268435455)===0||Zr(Mt,Ft)}function Ga(t,r){var a=De;De|=2;var f=j0();(Mt!==t||Ft!==r)&&(br=null,Ti(t,r));do try{RR();break}catch(g){T0(t,g)}while(!0);if(Fl(),De=a,Fa.current=f,wt!==null)throw Error(i(261));return Mt=null,Ft=0,kt}function RR(){for(;wt!==null;)A0(wt)}function TR(){for(;wt!==null&&!Qi();)A0(wt)}function A0(t){var r=O0(t.alternate,t,yn);t.memoizedProps=t.pendingProps,r===null?I0(t):wt=r,yc.current=null}function I0(t){var r=t;do{var a=r.alternate;if(t=r.return,(r.flags&32768)===0){if(a=_R(a,r,yn),a!==null){wt=a;return}}else{if(a=SR(a,r),a!==null){a.flags&=32767,wt=a;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{kt=6,wt=null;return}}if(r=r.sibling,r!==null){wt=r;return}wt=r=t}while(r!==null);kt===0&&(kt=5)}function ji(t,r,a){var f=Ge,g=Tn.transition;try{Tn.transition=null,Ge=1,jR(t,r,a,f)}finally{Tn.transition=g,Ge=f}return null}function jR(t,r,a,f){do bs();while(Xr!==null);if((De&6)!==0)throw Error(i(327));a=t.finishedWork;var g=t.finishedLanes;if(a===null)return null;if(t.finishedWork=null,t.finishedLanes=0,a===t.current)throw Error(i(177));t.callbackNode=null,t.callbackPriority=0;var w=a.lanes|a.childLanes;if(ll(t,w),t===Mt&&(wt=Mt=null,Ft=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||Ua||(Ua=!0,q0(pn,function(){return bs(),null})),w=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||w){w=Tn.transition,Tn.transition=null;var R=Ge;Ge=1;var D=De;De|=4,yc.current=null,kR(t,a),S0(a,t),XC(Cl),sr=!!Nl,Cl=Nl=null,t.current=a,ER(a),Zi(),De=D,Ge=R,Tn.transition=w}else t.current=a;if(Ua&&(Ua=!1,Xr=t,Ha=g),w=t.pendingLanes,w===0&&(Kr=null),ir(a.stateNode),an(t,rt()),r!==null)for(f=t.onRecoverableError,a=0;a<r.length;a++)g=r[a],f(g.value,{componentStack:g.stack,digest:g.digest});if(Ba)throw Ba=!1,t=_c,_c=null,t;return(Ha&1)!==0&&t.tag!==0&&bs(),w=t.pendingLanes,(w&1)!==0?t===Sc?So++:(So=0,Sc=t):So=0,Vr(),null}function bs(){if(Xr!==null){var t=ia(Ha),r=Tn.transition,a=Ge;try{if(Tn.transition=null,Ge=16>t?16:t,Xr===null)var f=!1;else{if(t=Xr,Xr=null,Ha=0,(De&6)!==0)throw Error(i(331));var g=De;for(De|=4,Se=t.current;Se!==null;){var w=Se,R=w.child;if((Se.flags&16)!==0){var D=w.deletions;if(D!==null){for(var H=0;H<D.length;H++){var ie=D[H];for(Se=ie;Se!==null;){var fe=Se;switch(fe.tag){case 0:case 11:case 15:wo(8,fe,w)}var he=fe.child;if(he!==null)he.return=fe,Se=he;else for(;Se!==null;){fe=Se;var ce=fe.sibling,ve=fe.return;if(v0(fe),fe===ie){Se=null;break}if(ce!==null){ce.return=ve,Se=ce;break}Se=ve}}}var ke=w.alternate;if(ke!==null){var Ee=ke.child;if(Ee!==null){ke.child=null;do{var gt=Ee.sibling;Ee.sibling=null,Ee=gt}while(Ee!==null)}}Se=w}}if((w.subtreeFlags&2064)!==0&&R!==null)R.return=w,Se=R;else e:for(;Se!==null;){if(w=Se,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:wo(9,w,w.return)}var te=w.sibling;if(te!==null){te.return=w.return,Se=te;break e}Se=w.return}}var Y=t.current;for(Se=Y;Se!==null;){R=Se;var re=R.child;if((R.subtreeFlags&2064)!==0&&re!==null)re.return=R,Se=re;else e:for(R=Y;Se!==null;){if(D=Se,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Da(9,D)}}catch(Ne){pt(D,D.return,Ne)}if(D===R){Se=null;break e}var me=D.sibling;if(me!==null){me.return=D.return,Se=me;break e}Se=D.return}}if(De=g,Vr(),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(rr,t)}catch{}f=!0}return f}finally{Ge=a,Tn.transition=r}}return!1}function M0(t,r,a){r=ws(a,r),r=Qy(t,r,1),t=Gr(t,r,1),r=Xt(),t!==null&&(Ut(t,1,r),an(t,r))}function pt(t,r,a){if(t.tag===3)M0(t,t,a);else for(;r!==null;){if(r.tag===3){M0(r,t,a);break}else if(r.tag===1){var f=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Kr===null||!Kr.has(f))){t=ws(a,t),t=Zy(r,t,1),r=Gr(r,t,1),t=Xt(),r!==null&&(Ut(r,1,t),an(r,t));break}}r=r.return}}function AR(t,r,a){var f=t.pingCache;f!==null&&f.delete(r),r=Xt(),t.pingedLanes|=t.suspendedLanes&a,Mt===t&&(Ft&a)===a&&(kt===4||kt===3&&(Ft&130023424)===Ft&&500>rt()-xc?Ti(t,0):wc|=a),an(t,r)}function P0(t,r){r===0&&((t.mode&1)===0?r=1:(r=Lr,Lr<<=1,(Lr&130023424)===0&&(Lr=4194304)));var a=Xt();t=xr(t,r),t!==null&&(Ut(t,r,a),an(t,a))}function IR(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),P0(t,a)}function MR(t,r){var a=0;switch(t.tag){case 13:var f=t.stateNode,g=t.memoizedState;g!==null&&(a=g.retryLane);break;case 19:f=t.stateNode;break;default:throw Error(i(314))}f!==null&&f.delete(r),P0(t,a)}var O0;O0=function(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps||nn.current)sn=!0;else{if((t.lanes&a)===0&&(r.flags&128)===0)return sn=!1,xR(t,r,a);sn=(t.flags&131072)!==0}else sn=!1,ut&&(r.flags&1048576)!==0&&py(r,Sa,r.index);switch(r.lanes=0,r.tag){case 2:var f=r.type;La(t,r),t=r.pendingProps;var g=fs(r,Ht.current);vs(r,a),g=Ql(null,r,f,t,g,a);var w=Zl();return r.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,rn(f)?(w=!0,wa(r)):w=!1,r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Hl(r),g.updater=Oa,r.stateNode=g,g._reactInternals=r,ic(r,f,t,a),r=uc(null,r,f,!0,w,a)):(r.tag=0,ut&&w&&Pl(r),Kt(null,r,g,a),r=r.child),r;case 16:f=r.elementType;e:{switch(La(t,r),t=r.pendingProps,g=f._init,f=g(f._payload),r.type=f,g=r.tag=OR(f),t=zn(f,t),g){case 0:r=ac(null,r,f,t,a);break e;case 1:r=a0(null,r,f,t,a);break e;case 11:r=n0(null,r,f,t,a);break e;case 14:r=r0(null,r,f,zn(f.type,t),a);break e}throw Error(i(306,f,""))}return r;case 0:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:zn(f,g),ac(t,r,f,g,a);case 1:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:zn(f,g),a0(t,r,f,g,a);case 3:e:{if(u0(r),t===null)throw Error(i(387));f=r.pendingProps,w=r.memoizedState,g=w.element,by(t,r),Ra(r,f,null,a);var R=r.memoizedState;if(f=R.element,w.isDehydrated)if(w={element:f,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},r.updateQueue.baseState=w,r.memoizedState=w,r.flags&256){g=ws(Error(i(423)),r),r=l0(t,r,f,a,g);break e}else if(f!==g){g=ws(Error(i(424)),r),r=l0(t,r,f,a,g);break e}else for(vn=Br(r.stateNode.containerInfo.firstChild),gn=r,ut=!0,Fn=null,a=_y(r,null,f,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ps(),f===g){r=Sr(t,r,a);break e}Kt(t,r,f,a)}r=r.child}return r;case 5:return Ny(r),t===null&&Ll(r),f=r.type,g=r.pendingProps,w=t!==null?t.memoizedProps:null,R=g.children,Rl(f,g)?R=null:w!==null&&Rl(f,w)&&(r.flags|=32),o0(t,r),Kt(t,r,R,a),r.child;case 6:return t===null&&Ll(r),null;case 13:return c0(t,r,a);case 4:return Vl(r,r.stateNode.containerInfo),f=r.pendingProps,t===null?r.child=ms(r,null,f,a):Kt(t,r,f,a),r.child;case 11:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:zn(f,g),n0(t,r,f,g,a);case 7:return Kt(t,r,r.pendingProps,a),r.child;case 8:return Kt(t,r,r.pendingProps.children,a),r.child;case 12:return Kt(t,r,r.pendingProps.children,a),r.child;case 10:e:{if(f=r.type._context,g=r.pendingProps,w=r.memoizedProps,R=g.value,it(Ea,f._currentValue),f._currentValue=R,w!==null)if(Dn(w.value,R)){if(w.children===g.children&&!nn.current){r=Sr(t,r,a);break e}}else for(w=r.child,w!==null&&(w.return=r);w!==null;){var D=w.dependencies;if(D!==null){R=w.child;for(var H=D.firstContext;H!==null;){if(H.context===f){if(w.tag===1){H=_r(-1,a&-a),H.tag=2;var ie=w.updateQueue;if(ie!==null){ie=ie.shared;var fe=ie.pending;fe===null?H.next=H:(H.next=fe.next,fe.next=H),ie.pending=H}}w.lanes|=a,H=w.alternate,H!==null&&(H.lanes|=a),Bl(w.return,a,r),D.lanes|=a;break}H=H.next}}else if(w.tag===10)R=w.type===r.type?null:w.child;else if(w.tag===18){if(R=w.return,R===null)throw Error(i(341));R.lanes|=a,D=R.alternate,D!==null&&(D.lanes|=a),Bl(R,a,r),R=w.sibling}else R=w.child;if(R!==null)R.return=w;else for(R=w;R!==null;){if(R===r){R=null;break}if(w=R.sibling,w!==null){w.return=R.return,R=w;break}R=R.return}w=R}Kt(t,r,g.children,a),r=r.child}return r;case 9:return g=r.type,f=r.pendingProps.children,vs(r,a),g=Cn(g),f=f(g),r.flags|=1,Kt(t,r,f,a),r.child;case 14:return f=r.type,g=zn(f,r.pendingProps),g=zn(f.type,g),r0(t,r,f,g,a);case 15:return i0(t,r,r.type,r.pendingProps,a);case 17:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:zn(f,g),La(t,r),r.tag=1,rn(f)?(t=!0,wa(r)):t=!1,vs(r,a),Ky(r,f,g),ic(r,f,g,a),uc(null,r,f,!0,t,a);case 19:return d0(t,r,a);case 22:return s0(t,r,a)}throw Error(i(156,r.tag))};function q0(t,r){return Ln(t,r)}function PR(t,r,a,f){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(t,r,a,f){return new PR(t,r,a,f)}function Rc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function OR(t){if(typeof t=="function")return Rc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===J)return 11;if(t===G)return 14}return 2}function Jr(t,r){var a=t.alternate;return a===null?(a=jn(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&14680064,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a}function Ya(t,r,a,f,g,w){var R=2;if(f=t,typeof t=="function")Rc(t)&&(R=1);else if(typeof t=="string")R=5;else e:switch(t){case M:return Ai(a.children,g,w,r);case P:R=8,g|=8;break;case T:return t=jn(12,a,r,g|2),t.elementType=T,t.lanes=w,t;case Q:return t=jn(13,a,r,g),t.elementType=Q,t.lanes=w,t;case j:return t=jn(19,a,r,g),t.elementType=j,t.lanes=w,t;case ne:return Ka(a,g,w,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case L:R=10;break e;case F:R=9;break e;case J:R=11;break e;case G:R=14;break e;case U:R=16,f=null;break e}throw Error(i(130,t==null?t:typeof t,""))}return r=jn(R,a,r,g),r.elementType=t,r.type=f,r.lanes=w,r}function Ai(t,r,a,f){return t=jn(7,t,f,r),t.lanes=a,t}function Ka(t,r,a,f){return t=jn(22,t,f,r),t.elementType=ne,t.lanes=a,t.stateNode={isHidden:!1},t}function Tc(t,r,a){return t=jn(6,t,null,r),t.lanes=a,t}function jc(t,r,a){return r=jn(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function qR(t,r,a,f,g){this.tag=r,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=es(0),this.expirationTimes=es(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=es(0),this.identifierPrefix=f,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Ac(t,r,a,f,g,w,R,D,H){return t=new qR(t,r,a,D,H),r===1?(r=1,w===!0&&(r|=8)):r=0,w=jn(3,null,null,r),t.current=w,w.stateNode=t,w.memoizedState={element:f,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hl(w),t}function LR(t,r,a){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:f==null?null:""+f,children:t,containerInfo:r,implementation:a}}function L0(t){if(!t)return Hr;t=t._reactInternals;e:{if(qt(t)!==t||t.tag!==1)throw Error(i(170));var r=t;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(rn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(i(171))}if(t.tag===1){var a=t.type;if(rn(a))return fy(t,a,r)}return r}function $0(t,r,a,f,g,w,R,D,H){return t=Ac(a,f,!0,t,g,w,R,D,H),t.context=L0(null),a=t.current,f=Xt(),g=Qr(a),w=_r(f,g),w.callback=r??null,Gr(a,w,g),t.current.lanes=g,Ut(t,g,f),an(t,f),t}function Xa(t,r,a,f){var g=r.current,w=Xt(),R=Qr(g);return a=L0(a),r.context===null?r.context=a:r.pendingContext=a,r=_r(w,R),r.payload={element:t},f=f===void 0?null:f,f!==null&&(r.callback=f),t=Gr(g,r,R),t!==null&&(Hn(t,g,R,w),Ca(t,g,R)),R}function Qa(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function D0(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function Ic(t,r){D0(t,r),(t=t.alternate)&&D0(t,r)}function $R(){return null}var F0=typeof reportError=="function"?reportError:function(t){console.error(t)};function Mc(t){this._internalRoot=t}Za.prototype.render=Mc.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(i(409));Xa(t,r,null,null)},Za.prototype.unmount=Mc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Ri(function(){Xa(null,t,null,null)}),r[gr]=null}};function Za(t){this._internalRoot=t}Za.prototype.unstable_scheduleHydration=function(t){if(t){var r=Lt();t={blockedOn:null,target:t,priority:r};for(var a=0;a<V.length&&r!==0&&r<V[a].priority;a++);V.splice(a,0,t),a===0&&_e(t)}};function Pc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ja(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function z0(){}function DR(t,r,a,f,g){if(g){if(typeof f=="function"){var w=f;f=function(){var ie=Qa(R);w.call(ie)}}var R=$0(r,f,t,0,null,!1,!1,"",z0);return t._reactRootContainer=R,t[gr]=R.current,so(t.nodeType===8?t.parentNode:t),Ri(),R}for(;g=t.lastChild;)t.removeChild(g);if(typeof f=="function"){var D=f;f=function(){var ie=Qa(H);D.call(ie)}}var H=Ac(t,0,!1,null,null,!1,!1,"",z0);return t._reactRootContainer=H,t[gr]=H.current,so(t.nodeType===8?t.parentNode:t),Ri(function(){Xa(r,H,a,f)}),H}function eu(t,r,a,f,g){var w=a._reactRootContainer;if(w){var R=w;if(typeof g=="function"){var D=g;g=function(){var H=Qa(R);D.call(H)}}Xa(r,R,t,g)}else R=DR(a,r,t,g,f);return Qa(R)}Ys=function(t){switch(t.tag){case 3:var r=t.stateNode;if(r.current.memoizedState.isDehydrated){var a=tn(r.pendingLanes);a!==0&&(ts(r,a|1),an(r,rt()),(De&6)===0&&(Ss=rt()+500,Vr()))}break;case 13:Ri(function(){var f=xr(t,1);if(f!==null){var g=Xt();Hn(f,t,1,g)}}),Ic(t,1)}},mr=function(t){if(t.tag===13){var r=xr(t,134217728);if(r!==null){var a=Xt();Hn(r,t,134217728,a)}Ic(t,134217728)}},sa=function(t){if(t.tag===13){var r=Qr(t),a=xr(t,r);if(a!==null){var f=Xt();Hn(a,t,r,f)}Ic(t,r)}},Lt=function(){return Ge},Ks=function(t,r){var a=Ge;try{return Ge=t,r()}finally{Ge=a}},Jt=function(t,r,a){switch(r){case"input":if(ye(t,a),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<a.length;r++){var f=a[r];if(f!==t&&f.form===t.form){var g=va(f);if(!g)throw Error(i(90));ze(f),ye(f,g)}}}break;case"textarea":We(t,a);break;case"select":r=a.value,r!=null&&et(t,!!a.multiple,r,!1)}},ui=Ec,li=Ri;var FR={usingClientEntryPoint:!1,Events:[uo,ls,va,Gi,Zn,Ec]},bo={findFiberByHostInstance:xi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},zR={bundleType:bo.bundleType,version:bo.version,rendererPackageName:bo.rendererPackageName,rendererConfig:bo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Xi(t),t===null?null:t.stateNode},findFiberByHostInstance:bo.findFiberByHostInstance||$R,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 tu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tu.isDisabled&&tu.supportsFiber)try{rr=tu.inject(zR),Yt=tu}catch{}}return un.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FR,un.createPortal=function(t,r){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Pc(r))throw Error(i(200));return LR(t,r,null,a)},un.createRoot=function(t,r){if(!Pc(t))throw Error(i(299));var a=!1,f="",g=F0;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),r=Ac(t,1,!1,null,null,a,!1,f,g),t[gr]=r.current,so(t.nodeType===8?t.parentNode:t),new Mc(r)},un.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=Xi(r),t=t===null?null:t.stateNode,t},un.flushSync=function(t){return Ri(t)},un.hydrate=function(t,r,a){if(!Ja(r))throw Error(i(200));return eu(null,t,r,!0,a)},un.hydrateRoot=function(t,r,a){if(!Pc(t))throw Error(i(405));var f=a!=null&&a.hydratedSources||null,g=!1,w="",R=F0;if(a!=null&&(a.unstable_strictMode===!0&&(g=!0),a.identifierPrefix!==void 0&&(w=a.identifierPrefix),a.onRecoverableError!==void 0&&(R=a.onRecoverableError)),r=$0(r,null,t,1,a??null,g,!1,w,R),t[gr]=r.current,so(t),f)for(t=0;t<f.length;t++)a=f[t],g=a._getVersion,g=g(a._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[a,g]:r.mutableSourceEagerHydrationData.push(a,g);return new Za(r)},un.render=function(t,r,a){if(!Ja(r))throw Error(i(200));return eu(null,t,r,!1,a)},un.unmountComponentAtNode=function(t){if(!Ja(t))throw Error(i(40));return t._reactRootContainer?(Ri(function(){eu(null,null,t,!1,function(){t._reactRootContainer=null,t[gr]=null})}),!0):!1},un.unstable_batchedUpdates=Ec,un.unstable_renderSubtreeIntoContainer=function(t,r,a,f){if(!Ja(a))throw Error(i(200));if(t==null||t._reactInternals===void 0)throw Error(i(38));return eu(t,r,a,!1,f)},un.version="18.3.1-next-f1338f8080-20240426",un}var K0;function Ak(){if(K0)return Lc.exports;K0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Lc.exports=YR(),Lc.exports}var X0;function KR(){if(X0)return ru;X0=1;var e=Ak();return ru.createRoot=e.createRoot,ru.hydrateRoot=e.hydrateRoot,ru}var XR=KR(),q=Vo();const ae=Bg(q);function zt(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let i=0,s;i<e.length;i++)(s=zt(e[i]))!==""&&(n+=(n&&" ")+s);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var Fc={exports:{}},zc={},Bc={exports:{}},Uc={};/**
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 Q0;function QR(){if(Q0)return Uc;Q0=1;var e=Vo();function n(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var i=typeof Object.is=="function"?Object.is:n,s=e.useState,o=e.useEffect,u=e.useLayoutEffect,l=e.useDebugValue;function c(m,y){var x=y(),N=s({inst:{value:x,getSnapshot:y}}),_=N[0].inst,S=N[1];return u(function(){_.value=x,_.getSnapshot=y,d(_)&&S({inst:_})},[m,x,y]),o(function(){return d(_)&&S({inst:_}),m(function(){d(_)&&S({inst:_})})},[m]),l(x),x}function d(m){var y=m.getSnapshot;m=m.value;try{var x=y();return!i(m,x)}catch{return!0}}function h(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Uc.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Uc}var Z0;function ZR(){return Z0||(Z0=1,Bc.exports=QR()),Bc.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 J0;function JR(){if(J0)return zc;J0=1;var e=Vo(),n=ZR();function i(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var s=typeof Object.is=="function"?Object.is:i,o=n.useSyncExternalStore,u=e.useRef,l=e.useEffect,c=e.useMemo,d=e.useDebugValue;return zc.useSyncExternalStoreWithSelector=function(h,p,m,y,x){var N=u(null);if(N.current===null){var _={hasValue:!1,value:null};N.current=_}else _=N.current;N=c(function(){function b(O){if(!k){if(k=!0,E=O,O=y(O),x!==void 0&&_.hasValue){var M=_.value;if(x(M,O))return C=M}return C=O}if(M=C,s(E,O))return M;var P=y(O);return x!==void 0&&x(M,P)?(E=O,M):(E=O,C=P)}var k=!1,E,C,I=m===void 0?null:m;return[function(){return b(p())},I===null?void 0:function(){return b(I())}]},[p,m,y,x]);var S=o(h,N[0],N[1]);return l(function(){_.hasValue=!0,_.value=S},[S]),d(S),S},zc}var ew;function eT(){return ew||(ew=1,Fc.exports=JR()),Fc.exports}var tT=eT();const nT=Bg(tT),rT={},tw=e=>{let n;const i=new Set,s=(p,m)=>{const y=typeof p=="function"?p(n):p;if(!Object.is(y,n)){const x=n;n=m??(typeof y!="object"||y===null)?y:Object.assign({},n,y),i.forEach(N=>N(n,x))}},o=()=>n,d={setState:s,getState:o,getInitialState:()=>h,subscribe:p=>(i.add(p),()=>i.delete(p)),destroy:()=>{(rT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},h=n=e(s,o,d);return d},iT=e=>e?tw(e):tw,{useDebugValue:sT}=ae,{useSyncExternalStoreWithSelector:oT}=nT,aT=e=>e;function Ik(e,n=aT,i){const s=oT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return sT(s),s}const nw=(e,n)=>{const i=iT(e),s=(o,u=n)=>Ik(i,o,u);return Object.assign(s,i),s},uT=(e,n)=>e?nw(e,n):nw;function Et(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[s,o]of e)if(!Object.is(o,n.get(s)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(n,s)||!Object.is(e[s],n[s]))return!1;return!0}var lT={value:()=>{}};function Pu(){for(var e=0,n=arguments.length,i={},s;e<n;++e){if(!(s=arguments[e]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new yu(i)}function yu(e){this._=e}function cT(e,n){return e.trim().split(/^|\s+/).map(function(i){var s="",o=i.indexOf(".");if(o>=0&&(s=i.slice(o+1),i=i.slice(0,o)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}yu.prototype=Pu.prototype={constructor:yu,on:function(e,n){var i=this._,s=cT(e+"",i),o,u=-1,l=s.length;if(arguments.length<2){for(;++u<l;)if((o=(e=s[u]).type)&&(o=fT(i[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++u<l;)if(o=(e=s[u]).type)i[o]=rw(i[o],e.name,n);else if(n==null)for(o in i)i[o]=rw(i[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var i in n)e[i]=n[i].slice();return new yu(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var i=new Array(o),s=0,o,u;s<o;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(u=this._[e],s=0,o=u.length;s<o;++s)u[s].value.apply(n,i)},apply:function(e,n,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,u=s.length;o<u;++o)s[o].value.apply(n,i)}};function fT(e,n){for(var i=0,s=e.length,o;i<s;++i)if((o=e[i]).name===n)return o.value}function rw(e,n,i){for(var s=0,o=e.length;s<o;++s)if(e[s].name===n){e[s]=lT,e=e.slice(0,s).concat(e.slice(s+1));break}return i!=null&&e.push({name:n,value:i}),e}var xg="http://www.w3.org/1999/xhtml";const iw={svg:"http://www.w3.org/2000/svg",xhtml:xg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ou(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),iw.hasOwnProperty(n)?{space:iw[n],local:e}:e}function dT(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===xg&&n.documentElement.namespaceURI===xg?n.createElement(e):n.createElementNS(i,e)}}function hT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Mk(e){var n=Ou(e);return(n.local?hT:dT)(n)}function pT(){}function Ug(e){return e==null?pT:function(){return this.querySelector(e)}}function mT(e){typeof e!="function"&&(e=Ug(e));for(var n=this._groups,i=n.length,s=new Array(i),o=0;o<i;++o)for(var u=n[o],l=u.length,c=s[o]=new Array(l),d,h,p=0;p<l;++p)(d=u[p])&&(h=e.call(d,d.__data__,p,u))&&("__data__"in d&&(h.__data__=d.__data__),c[p]=h);return new wn(s,this._parents)}function gT(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function vT(){return[]}function Pk(e){return e==null?vT:function(){return this.querySelectorAll(e)}}function yT(e){return function(){return gT(e.apply(this,arguments))}}function wT(e){typeof e=="function"?e=yT(e):e=Pk(e);for(var n=this._groups,i=n.length,s=[],o=[],u=0;u<i;++u)for(var l=n[u],c=l.length,d,h=0;h<c;++h)(d=l[h])&&(s.push(e.call(d,d.__data__,h,l)),o.push(d));return new wn(s,o)}function Ok(e){return function(){return this.matches(e)}}function qk(e){return function(n){return n.matches(e)}}var xT=Array.prototype.find;function _T(e){return function(){return xT.call(this.children,e)}}function ST(){return this.firstElementChild}function bT(e){return this.select(e==null?ST:_T(typeof e=="function"?e:qk(e)))}var kT=Array.prototype.filter;function ET(){return Array.from(this.children)}function NT(e){return function(){return kT.call(this.children,e)}}function CT(e){return this.selectAll(e==null?ET:NT(typeof e=="function"?e:qk(e)))}function RT(e){typeof e!="function"&&(e=Ok(e));for(var n=this._groups,i=n.length,s=new Array(i),o=0;o<i;++o)for(var u=n[o],l=u.length,c=s[o]=[],d,h=0;h<l;++h)(d=u[h])&&e.call(d,d.__data__,h,u)&&c.push(d);return new wn(s,this._parents)}function Lk(e){return new Array(e.length)}function TT(){return new wn(this._enter||this._groups.map(Lk),this._parents)}function Su(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Su.prototype={constructor:Su,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function jT(e){return function(){return e}}function AT(e,n,i,s,o,u){for(var l=0,c,d=n.length,h=u.length;l<h;++l)(c=n[l])?(c.__data__=u[l],s[l]=c):i[l]=new Su(e,u[l]);for(;l<d;++l)(c=n[l])&&(o[l]=c)}function IT(e,n,i,s,o,u,l){var c,d,h=new Map,p=n.length,m=u.length,y=new Array(p),x;for(c=0;c<p;++c)(d=n[c])&&(y[c]=x=l.call(d,d.__data__,c,n)+"",h.has(x)?o[c]=d:h.set(x,d));for(c=0;c<m;++c)x=l.call(e,u[c],c,u)+"",(d=h.get(x))?(s[c]=d,d.__data__=u[c],h.delete(x)):i[c]=new Su(e,u[c]);for(c=0;c<p;++c)(d=n[c])&&h.get(y[c])===d&&(o[c]=d)}function MT(e){return e.__data__}function PT(e,n){if(!arguments.length)return Array.from(this,MT);var i=n?IT:AT,s=this._parents,o=this._groups;typeof e!="function"&&(e=jT(e));for(var u=o.length,l=new Array(u),c=new Array(u),d=new Array(u),h=0;h<u;++h){var p=s[h],m=o[h],y=m.length,x=OT(e.call(p,p&&p.__data__,h,s)),N=x.length,_=c[h]=new Array(N),S=l[h]=new Array(N),b=d[h]=new Array(y);i(p,m,_,S,b,x,n);for(var k=0,E=0,C,I;k<N;++k)if(C=_[k]){for(k>=E&&(E=k+1);!(I=S[E])&&++E<N;);C._next=I||null}}return l=new wn(l,s),l._enter=c,l._exit=d,l}function OT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qT(){return new wn(this._exit||this._groups.map(Lk),this._parents)}function LT(e,n,i){var s=this.enter(),o=this,u=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),i==null?u.remove():i(u),s&&o?s.merge(o).order():o}function $T(e){for(var n=e.selection?e.selection():e,i=this._groups,s=n._groups,o=i.length,u=s.length,l=Math.min(o,u),c=new Array(o),d=0;d<l;++d)for(var h=i[d],p=s[d],m=h.length,y=c[d]=new Array(m),x,N=0;N<m;++N)(x=h[N]||p[N])&&(y[N]=x);for(;d<o;++d)c[d]=i[d];return new wn(c,this._parents)}function DT(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var s=e[n],o=s.length-1,u=s[o],l;--o>=0;)(l=s[o])&&(u&&l.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(l,u),u=l);return this}function FT(e){e||(e=zT);function n(m,y){return m&&y?e(m.__data__,y.__data__):!m-!y}for(var i=this._groups,s=i.length,o=new Array(s),u=0;u<s;++u){for(var l=i[u],c=l.length,d=o[u]=new Array(c),h,p=0;p<c;++p)(h=l[p])&&(d[p]=h);d.sort(n)}return new wn(o,this._parents).order()}function zT(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function BT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function UT(){return Array.from(this)}function HT(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var s=e[n],o=0,u=s.length;o<u;++o){var l=s[o];if(l)return l}return null}function VT(){let e=0;for(const n of this)++e;return e}function WT(){return!this.node()}function GT(e){for(var n=this._groups,i=0,s=n.length;i<s;++i)for(var o=n[i],u=0,l=o.length,c;u<l;++u)(c=o[u])&&e.call(c,c.__data__,u,o);return this}function YT(e){return function(){this.removeAttribute(e)}}function KT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function XT(e,n){return function(){this.setAttribute(e,n)}}function QT(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function ZT(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function JT(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function e2(e,n){var i=Ou(e);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((n==null?i.local?KT:YT:typeof n=="function"?i.local?JT:ZT:i.local?QT:XT)(i,n))}function $k(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function t2(e){return function(){this.style.removeProperty(e)}}function n2(e,n,i){return function(){this.style.setProperty(e,n,i)}}function r2(e,n,i){return function(){var s=n.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,i)}}function i2(e,n,i){return arguments.length>1?this.each((n==null?t2:typeof n=="function"?r2:n2)(e,n,i??"")):qs(this.node(),e)}function qs(e,n){return e.style.getPropertyValue(n)||$k(e).getComputedStyle(e,null).getPropertyValue(n)}function s2(e){return function(){delete this[e]}}function o2(e,n){return function(){this[e]=n}}function a2(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function u2(e,n){return arguments.length>1?this.each((n==null?s2:typeof n=="function"?a2:o2)(e,n)):this.node()[e]}function Dk(e){return e.trim().split(/^|\s+/)}function Hg(e){return e.classList||new Fk(e)}function Fk(e){this._node=e,this._names=Dk(e.getAttribute("class")||"")}Fk.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function zk(e,n){for(var i=Hg(e),s=-1,o=n.length;++s<o;)i.add(n[s])}function Bk(e,n){for(var i=Hg(e),s=-1,o=n.length;++s<o;)i.remove(n[s])}function l2(e){return function(){zk(this,e)}}function c2(e){return function(){Bk(this,e)}}function f2(e,n){return function(){(n.apply(this,arguments)?zk:Bk)(this,e)}}function d2(e,n){var i=Dk(e+"");if(arguments.length<2){for(var s=Hg(this.node()),o=-1,u=i.length;++o<u;)if(!s.contains(i[o]))return!1;return!0}return this.each((typeof n=="function"?f2:n?l2:c2)(i,n))}function h2(){this.textContent=""}function p2(e){return function(){this.textContent=e}}function m2(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function g2(e){return arguments.length?this.each(e==null?h2:(typeof e=="function"?m2:p2)(e)):this.node().textContent}function v2(){this.innerHTML=""}function y2(e){return function(){this.innerHTML=e}}function w2(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function x2(e){return arguments.length?this.each(e==null?v2:(typeof e=="function"?w2:y2)(e)):this.node().innerHTML}function _2(){this.nextSibling&&this.parentNode.appendChild(this)}function S2(){return this.each(_2)}function b2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function k2(){return this.each(b2)}function E2(e){var n=typeof e=="function"?e:Mk(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function N2(){return null}function C2(e,n){var i=typeof e=="function"?e:Mk(e),s=n==null?N2:typeof n=="function"?n:Ug(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function R2(){var e=this.parentNode;e&&e.removeChild(this)}function T2(){return this.each(R2)}function j2(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function A2(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function I2(e){return this.select(e?A2:j2)}function M2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function P2(e){return function(n){e.call(this,n,this.__data__)}}function O2(e){return e.trim().split(/^|\s+/).map(function(n){var i="",s=n.indexOf(".");return s>=0&&(i=n.slice(s+1),n=n.slice(0,s)),{type:n,name:i}})}function q2(e){return function(){var n=this.__on;if(n){for(var i=0,s=-1,o=n.length,u;i<o;++i)u=n[i],(!e.type||u.type===e.type)&&u.name===e.name?this.removeEventListener(u.type,u.listener,u.options):n[++s]=u;++s?n.length=s:delete this.__on}}}function L2(e,n,i){return function(){var s=this.__on,o,u=P2(n);if(s){for(var l=0,c=s.length;l<c;++l)if((o=s[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=u,o.options=i),o.value=n;return}}this.addEventListener(e.type,u,i),o={type:e.type,name:e.name,value:n,listener:u,options:i},s?s.push(o):this.__on=[o]}}function $2(e,n,i){var s=O2(e+""),o,u=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var d=0,h=c.length,p;d<h;++d)for(o=0,p=c[d];o<u;++o)if((l=s[o]).type===p.type&&l.name===p.name)return p.value}return}for(c=n?L2:q2,o=0;o<u;++o)this.each(c(s[o],n,i));return this}function Uk(e,n,i){var s=$k(e),o=s.CustomEvent;typeof o=="function"?o=new o(n,i):(o=s.document.createEvent("Event"),i?(o.initEvent(n,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function D2(e,n){return function(){return Uk(this,e,n)}}function F2(e,n){return function(){return Uk(this,e,n.apply(this,arguments))}}function z2(e,n){return this.each((typeof n=="function"?F2:D2)(e,n))}function*B2(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var s=e[n],o=0,u=s.length,l;o<u;++o)(l=s[o])&&(yield l)}var Hk=[null];function wn(e,n){this._groups=e,this._parents=n}function Wo(){return new wn([[document.documentElement]],Hk)}function U2(){return this}wn.prototype=Wo.prototype={constructor:wn,select:mT,selectAll:wT,selectChild:bT,selectChildren:CT,filter:RT,data:PT,enter:TT,exit:qT,join:LT,merge:$T,selection:U2,order:DT,sort:FT,call:BT,nodes:UT,node:HT,size:VT,empty:WT,each:GT,attr:e2,style:i2,property:u2,classed:d2,text:g2,html:x2,raise:S2,lower:k2,append:E2,insert:C2,remove:T2,clone:I2,datum:M2,on:$2,dispatch:z2,[Symbol.iterator]:B2};function In(e){return typeof e=="string"?new wn([[document.querySelector(e)]],[document.documentElement]):new wn([[e]],Hk)}function H2(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Wn(e,n){if(e=H2(e),n===void 0&&(n=e.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(n.getScreenCTM().inverse()),[s.x,s.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const V2={passive:!1},Lo={capture:!0,passive:!1};function Hc(e){e.stopImmediatePropagation()}function As(e){e.preventDefault(),e.stopImmediatePropagation()}function Vk(e){var n=e.document.documentElement,i=In(e).on("dragstart.drag",As,Lo);"onselectstart"in n?i.on("selectstart.drag",As,Lo):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Wk(e,n){var i=e.document.documentElement,s=In(e).on("dragstart.drag",null);n&&(s.on("click.drag",As,Lo),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const iu=e=>()=>e;function _g(e,{sourceEvent:n,subject:i,target:s,identifier:o,active:u,x:l,y:c,dx:d,dy:h,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:u,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:p}})}_g.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function W2(e){return!e.ctrlKey&&!e.button}function G2(){return this.parentNode}function Y2(e,n){return n??{x:e.x,y:e.y}}function K2(){return navigator.maxTouchPoints||"ontouchstart"in this}function X2(){var e=W2,n=G2,i=Y2,s=K2,o={},u=Pu("start","drag","end"),l=0,c,d,h,p,m=0;function y(C){C.on("mousedown.drag",x).filter(s).on("touchstart.drag",S).on("touchmove.drag",b,V2).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(C,I){if(!(p||!e.call(this,C,I))){var O=E(this,n.call(this,C,I),C,I,"mouse");O&&(In(C.view).on("mousemove.drag",N,Lo).on("mouseup.drag",_,Lo),Vk(C.view),Hc(C),h=!1,c=C.clientX,d=C.clientY,O("start",C))}}function N(C){if(As(C),!h){var I=C.clientX-c,O=C.clientY-d;h=I*I+O*O>m}o.mouse("drag",C)}function _(C){In(C.view).on("mousemove.drag mouseup.drag",null),Wk(C.view,h),As(C),o.mouse("end",C)}function S(C,I){if(e.call(this,C,I)){var O=C.changedTouches,M=n.call(this,C,I),P=O.length,T,L;for(T=0;T<P;++T)(L=E(this,M,C,I,O[T].identifier,O[T]))&&(Hc(C),L("start",C,O[T]))}}function b(C){var I=C.changedTouches,O=I.length,M,P;for(M=0;M<O;++M)(P=o[I[M].identifier])&&(As(C),P("drag",C,I[M]))}function k(C){var I=C.changedTouches,O=I.length,M,P;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),M=0;M<O;++M)(P=o[I[M].identifier])&&(Hc(C),P("end",C,I[M]))}function E(C,I,O,M,P,T){var L=u.copy(),F=Wn(T||O,I),J,Q,j;if((j=i.call(C,new _g("beforestart",{sourceEvent:O,target:y,identifier:P,active:l,x:F[0],y:F[1],dx:0,dy:0,dispatch:L}),M))!=null)return J=j.x-F[0]||0,Q=j.y-F[1]||0,function G(U,ne,K){var $=F,W;switch(U){case"start":o[P]=G,W=l++;break;case"end":delete o[P],--l;case"drag":F=Wn(K||ne,I),W=l;break}L.call(U,C,new _g(U,{sourceEvent:ne,subject:j,target:y,identifier:P,active:W,x:F[0]+J,y:F[1]+Q,dx:F[0]-$[0],dy:F[1]-$[1],dispatch:L}),M)}}return y.filter=function(C){return arguments.length?(e=typeof C=="function"?C:iu(!!C),y):e},y.container=function(C){return arguments.length?(n=typeof C=="function"?C:iu(C),y):n},y.subject=function(C){return arguments.length?(i=typeof C=="function"?C:iu(C),y):i},y.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:iu(!!C),y):s},y.on=function(){var C=u.on.apply(u,arguments);return C===u?y:C},y.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,y):Math.sqrt(m)},y}function Vg(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function Gk(e,n){var i=Object.create(e.prototype);for(var s in n)i[s]=n[s];return i}function Go(){}var $o=.7,bu=1/$o,Is="\\s*([+-]?\\d+)\\s*",Do="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q2=/^#([0-9a-f]{3,8})$/,Z2=new RegExp(`^rgb\\(${Is},${Is},${Is}\\)$`),J2=new RegExp(`^rgb\\(${cr},${cr},${cr}\\)$`),ej=new RegExp(`^rgba\\(${Is},${Is},${Is},${Do}\\)$`),tj=new RegExp(`^rgba\\(${cr},${cr},${cr},${Do}\\)$`),nj=new RegExp(`^hsl\\(${Do},${cr},${cr}\\)$`),rj=new RegExp(`^hsla\\(${Do},${cr},${cr},${Do}\\)$`),sw={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};Vg(Go,Fo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ow,formatHex:ow,formatHex8:ij,formatHsl:sj,formatRgb:aw,toString:aw});function ow(){return this.rgb().formatHex()}function ij(){return this.rgb().formatHex8()}function sj(){return Yk(this).formatHsl()}function aw(){return this.rgb().formatRgb()}function Fo(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=Q2.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?uw(n):i===3?new ln(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?su(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?su(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Z2.exec(e))?new ln(n[1],n[2],n[3],1):(n=J2.exec(e))?new ln(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=ej.exec(e))?su(n[1],n[2],n[3],n[4]):(n=tj.exec(e))?su(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=nj.exec(e))?fw(n[1],n[2]/100,n[3]/100,1):(n=rj.exec(e))?fw(n[1],n[2]/100,n[3]/100,n[4]):sw.hasOwnProperty(e)?uw(sw[e]):e==="transparent"?new ln(NaN,NaN,NaN,0):null}function uw(e){return new ln(e>>16&255,e>>8&255,e&255,1)}function su(e,n,i,s){return s<=0&&(e=n=i=NaN),new ln(e,n,i,s)}function oj(e){return e instanceof Go||(e=Fo(e)),e?(e=e.rgb(),new ln(e.r,e.g,e.b,e.opacity)):new ln}function Sg(e,n,i,s){return arguments.length===1?oj(e):new ln(e,n,i,s??1)}function ln(e,n,i,s){this.r=+e,this.g=+n,this.b=+i,this.opacity=+s}Vg(ln,Sg,Gk(Go,{brighter(e){return e=e==null?bu:Math.pow(bu,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$o:Math.pow($o,e),new ln(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ln($i(this.r),$i(this.g),$i(this.b),ku(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:lw,formatHex:lw,formatHex8:aj,formatRgb:cw,toString:cw}));function lw(){return`#${qi(this.r)}${qi(this.g)}${qi(this.b)}`}function aj(){return`#${qi(this.r)}${qi(this.g)}${qi(this.b)}${qi((isNaN(this.opacity)?1:this.opacity)*255)}`}function cw(){const e=ku(this.opacity);return`${e===1?"rgb(":"rgba("}${$i(this.r)}, ${$i(this.g)}, ${$i(this.b)}${e===1?")":`, ${e})`}`}function ku(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function $i(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function qi(e){return e=$i(e),(e<16?"0":"")+e.toString(16)}function fw(e,n,i,s){return s<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new Gn(e,n,i,s)}function Yk(e){if(e instanceof Gn)return new Gn(e.h,e.s,e.l,e.opacity);if(e instanceof Go||(e=Fo(e)),!e)return new Gn;if(e instanceof Gn)return e;e=e.rgb();var n=e.r/255,i=e.g/255,s=e.b/255,o=Math.min(n,i,s),u=Math.max(n,i,s),l=NaN,c=u-o,d=(u+o)/2;return c?(n===u?l=(i-s)/c+(i<s)*6:i===u?l=(s-n)/c+2:l=(n-i)/c+4,c/=d<.5?u+o:2-u-o,l*=60):c=d>0&&d<1?0:l,new Gn(l,c,d,e.opacity)}function uj(e,n,i,s){return arguments.length===1?Yk(e):new Gn(e,n,i,s??1)}function Gn(e,n,i,s){this.h=+e,this.s=+n,this.l=+i,this.opacity=+s}Vg(Gn,uj,Gk(Go,{brighter(e){return e=e==null?bu:Math.pow(bu,e),new Gn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$o:Math.pow($o,e),new Gn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*n,o=2*i-s;return new ln(Vc(e>=240?e-240:e+120,o,s),Vc(e,o,s),Vc(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new Gn(dw(this.h),ou(this.s),ou(this.l),ku(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=ku(this.opacity);return`${e===1?"hsl(":"hsla("}${dw(this.h)}, ${ou(this.s)*100}%, ${ou(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dw(e){return e=(e||0)%360,e<0?e+360:e}function ou(e){return Math.max(0,Math.min(1,e||0))}function Vc(e,n,i){return(e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n)*255}const Kk=e=>()=>e;function lj(e,n){return function(i){return e+i*n}}function cj(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(s){return Math.pow(e+s*n,i)}}function fj(e){return(e=+e)==1?Xk:function(n,i){return i-n?cj(n,i,e):Kk(isNaN(n)?i:n)}}function Xk(e,n){var i=n-e;return i?lj(e,i):Kk(isNaN(e)?n:e)}const hw=(function e(n){var i=fj(n);function s(o,u){var l=i((o=Sg(o)).r,(u=Sg(u)).r),c=i(o.g,u.g),d=i(o.b,u.b),h=Xk(o.opacity,u.opacity);return function(p){return o.r=l(p),o.g=c(p),o.b=d(p),o.opacity=h(p),o+""}}return s.gamma=e,s})(1);function ni(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}var bg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wc=new RegExp(bg.source,"g");function dj(e){return function(){return e}}function hj(e){return function(n){return e(n)+""}}function pj(e,n){var i=bg.lastIndex=Wc.lastIndex=0,s,o,u,l=-1,c=[],d=[];for(e=e+"",n=n+"";(s=bg.exec(e))&&(o=Wc.exec(n));)(u=o.index)>i&&(u=n.slice(i,u),c[l]?c[l]+=u:c[++l]=u),(s=s[0])===(o=o[0])?c[l]?c[l]+=o:c[++l]=o:(c[++l]=null,d.push({i:l,x:ni(s,o)})),i=Wc.lastIndex;return i<n.length&&(u=n.slice(i),c[l]?c[l]+=u:c[++l]=u),c.length<2?d[0]?hj(d[0].x):dj(n):(n=d.length,function(h){for(var p=0,m;p<n;++p)c[(m=d[p]).i]=m.x(h);return c.join("")})}var pw=180/Math.PI,kg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Qk(e,n,i,s,o,u){var l,c,d;return(l=Math.sqrt(e*e+n*n))&&(e/=l,n/=l),(d=e*i+n*s)&&(i-=e*d,s-=n*d),(c=Math.sqrt(i*i+s*s))&&(i/=c,s/=c,d/=c),e*s<n*i&&(e=-e,n=-n,d=-d,l=-l),{translateX:o,translateY:u,rotate:Math.atan2(n,e)*pw,skewX:Math.atan(d)*pw,scaleX:l,scaleY:c}}var au;function mj(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?kg:Qk(n.a,n.b,n.c,n.d,n.e,n.f)}function gj(e){return e==null||(au||(au=document.createElementNS("http://www.w3.org/2000/svg","g")),au.setAttribute("transform",e),!(e=au.transform.baseVal.consolidate()))?kg:(e=e.matrix,Qk(e.a,e.b,e.c,e.d,e.e,e.f))}function Zk(e,n,i,s){function o(h){return h.length?h.pop()+" ":""}function u(h,p,m,y,x,N){if(h!==m||p!==y){var _=x.push("translate(",null,n,null,i);N.push({i:_-4,x:ni(h,m)},{i:_-2,x:ni(p,y)})}else(m||y)&&x.push("translate("+m+n+y+i)}function l(h,p,m,y){h!==p?(h-p>180?p+=360:p-h>180&&(h+=360),y.push({i:m.push(o(m)+"rotate(",null,s)-2,x:ni(h,p)})):p&&m.push(o(m)+"rotate("+p+s)}function c(h,p,m,y){h!==p?y.push({i:m.push(o(m)+"skewX(",null,s)-2,x:ni(h,p)}):p&&m.push(o(m)+"skewX("+p+s)}function d(h,p,m,y,x,N){if(h!==m||p!==y){var _=x.push(o(x)+"scale(",null,",",null,")");N.push({i:_-4,x:ni(h,m)},{i:_-2,x:ni(p,y)})}else(m!==1||y!==1)&&x.push(o(x)+"scale("+m+","+y+")")}return function(h,p){var m=[],y=[];return h=e(h),p=e(p),u(h.translateX,h.translateY,p.translateX,p.translateY,m,y),l(h.rotate,p.rotate,m,y),c(h.skewX,p.skewX,m,y),d(h.scaleX,h.scaleY,p.scaleX,p.scaleY,m,y),h=p=null,function(x){for(var N=-1,_=y.length,S;++N<_;)m[(S=y[N]).i]=S.x(x);return m.join("")}}}var vj=Zk(mj,"px, ","px)","deg)"),yj=Zk(gj,", ",")",")"),wj=1e-12;function mw(e){return((e=Math.exp(e))+1/e)/2}function xj(e){return((e=Math.exp(e))-1/e)/2}function _j(e){return((e=Math.exp(2*e))-1)/(e+1)}const Sj=(function e(n,i,s){function o(u,l){var c=u[0],d=u[1],h=u[2],p=l[0],m=l[1],y=l[2],x=p-c,N=m-d,_=x*x+N*N,S,b;if(_<wj)b=Math.log(y/h)/n,S=function(M){return[c+M*x,d+M*N,h*Math.exp(n*M*b)]};else{var k=Math.sqrt(_),E=(y*y-h*h+s*_)/(2*h*i*k),C=(y*y-h*h-s*_)/(2*y*i*k),I=Math.log(Math.sqrt(E*E+1)-E),O=Math.log(Math.sqrt(C*C+1)-C);b=(O-I)/n,S=function(M){var P=M*b,T=mw(I),L=h/(i*k)*(T*_j(n*P+I)-xj(I));return[c+L*x,d+L*N,h*T/mw(n*P+I)]}}return S.duration=b*1e3*n/Math.SQRT2,S}return o.rho=function(u){var l=Math.max(.001,+u),c=l*l,d=c*c;return e(l,c,d)},o})(Math.SQRT2,2,4);var Ls=0,jo=0,Eo=0,Jk=1e3,Eu,Ao,Nu=0,zi=0,qu=0,zo=typeof performance=="object"&&performance.now?performance:Date,eE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Wg(){return zi||(eE(bj),zi=zo.now()+qu)}function bj(){zi=0}function Cu(){this._call=this._time=this._next=null}Cu.prototype=tE.prototype={constructor:Cu,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Wg():+i)+(n==null?0:+n),!this._next&&Ao!==this&&(Ao?Ao._next=this:Eu=this,Ao=this),this._call=e,this._time=i,Eg()},stop:function(){this._call&&(this._call=null,this._time=1/0,Eg())}};function tE(e,n,i){var s=new Cu;return s.restart(e,n,i),s}function kj(){Wg(),++Ls;for(var e=Eu,n;e;)(n=zi-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Ls}function gw(){zi=(Nu=zo.now())+qu,Ls=jo=0;try{kj()}finally{Ls=0,Nj(),zi=0}}function Ej(){var e=zo.now(),n=e-Nu;n>Jk&&(qu-=n,Nu=e)}function Nj(){for(var e,n=Eu,i,s=1/0;n;)n._call?(s>n._time&&(s=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:Eu=i);Ao=e,Eg(s)}function Eg(e){if(!Ls){jo&&(jo=clearTimeout(jo));var n=e-zi;n>24?(e<1/0&&(jo=setTimeout(gw,e-zo.now()-qu)),Eo&&(Eo=clearInterval(Eo))):(Eo||(Nu=zo.now(),Eo=setInterval(Ej,Jk)),Ls=1,eE(gw))}}function vw(e,n,i){var s=new Cu;return n=n==null?0:+n,s.restart(o=>{s.stop(),e(o+n)},n,i),s}var Cj=Pu("start","end","cancel","interrupt"),Rj=[],nE=0,yw=1,Ng=2,wu=3,ww=4,Cg=5,xu=6;function Lu(e,n,i,s,o,u){var l=e.__transition;if(!l)e.__transition={};else if(i in l)return;Tj(e,i,{name:n,index:s,group:o,on:Cj,tween:Rj,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:nE})}function Gg(e,n){var i=Xn(e,n);if(i.state>nE)throw new Error("too late; already scheduled");return i}function fr(e,n){var i=Xn(e,n);if(i.state>wu)throw new Error("too late; already running");return i}function Xn(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function Tj(e,n,i){var s=e.__transition,o;s[n]=i,i.timer=tE(u,0,i.time);function u(h){i.state=yw,i.timer.restart(l,i.delay,i.time),i.delay<=h&&l(h-i.delay)}function l(h){var p,m,y,x;if(i.state!==yw)return d();for(p in s)if(x=s[p],x.name===i.name){if(x.state===wu)return vw(l);x.state===ww?(x.state=xu,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete s[p]):+p<n&&(x.state=xu,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete s[p])}if(vw(function(){i.state===wu&&(i.state=ww,i.timer.restart(c,i.delay,i.time),c(h))}),i.state=Ng,i.on.call("start",e,e.__data__,i.index,i.group),i.state===Ng){for(i.state=wu,o=new Array(y=i.tween.length),p=0,m=-1;p<y;++p)(x=i.tween[p].value.call(e,e.__data__,i.index,i.group))&&(o[++m]=x);o.length=m+1}}function c(h){for(var p=h<i.duration?i.ease.call(null,h/i.duration):(i.timer.restart(d),i.state=Cg,1),m=-1,y=o.length;++m<y;)o[m].call(e,p);i.state===Cg&&(i.on.call("end",e,e.__data__,i.index,i.group),d())}function d(){i.state=xu,i.timer.stop(),delete s[n];for(var h in s)return;delete e.__transition}}function _u(e,n){var i=e.__transition,s,o,u=!0,l;if(i){n=n==null?null:n+"";for(l in i){if((s=i[l]).name!==n){u=!1;continue}o=s.state>Ng&&s.state<Cg,s.state=xu,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete i[l]}u&&delete e.__transition}}function jj(e){return this.each(function(){_u(this,e)})}function Aj(e,n){var i,s;return function(){var o=fr(this,e),u=o.tween;if(u!==i){s=i=u;for(var l=0,c=s.length;l<c;++l)if(s[l].name===n){s=s.slice(),s.splice(l,1);break}}o.tween=s}}function Ij(e,n,i){var s,o;if(typeof i!="function")throw new Error;return function(){var u=fr(this,e),l=u.tween;if(l!==s){o=(s=l).slice();for(var c={name:n,value:i},d=0,h=o.length;d<h;++d)if(o[d].name===n){o[d]=c;break}d===h&&o.push(c)}u.tween=o}}function Mj(e,n){var i=this._id;if(e+="",arguments.length<2){for(var s=Xn(this.node(),i).tween,o=0,u=s.length,l;o<u;++o)if((l=s[o]).name===e)return l.value;return null}return this.each((n==null?Aj:Ij)(i,e,n))}function Yg(e,n,i){var s=e._id;return e.each(function(){var o=fr(this,s);(o.value||(o.value={}))[n]=i.apply(this,arguments)}),function(o){return Xn(o,s).value[n]}}function rE(e,n){var i;return(typeof n=="number"?ni:n instanceof Fo?hw:(i=Fo(n))?(n=i,hw):pj)(e,n)}function Pj(e){return function(){this.removeAttribute(e)}}function Oj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function qj(e,n,i){var s,o=i+"",u;return function(){var l=this.getAttribute(e);return l===o?null:l===s?u:u=n(s=l,i)}}function Lj(e,n,i){var s,o=i+"",u;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===s?u:u=n(s=l,i)}}function $j(e,n,i){var s,o,u;return function(){var l,c=i(this),d;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),d=c+"",l===d?null:l===s&&d===o?u:(o=d,u=n(s=l,c)))}}function Dj(e,n,i){var s,o,u;return function(){var l,c=i(this),d;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),d=c+"",l===d?null:l===s&&d===o?u:(o=d,u=n(s=l,c)))}}function Fj(e,n){var i=Ou(e),s=i==="transform"?yj:rE;return this.attrTween(e,typeof n=="function"?(i.local?Dj:$j)(i,s,Yg(this,"attr."+e,n)):n==null?(i.local?Oj:Pj)(i):(i.local?Lj:qj)(i,s,n))}function zj(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function Bj(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function Uj(e,n){var i,s;function o(){var u=n.apply(this,arguments);return u!==s&&(i=(s=u)&&Bj(e,u)),i}return o._value=n,o}function Hj(e,n){var i,s;function o(){var u=n.apply(this,arguments);return u!==s&&(i=(s=u)&&zj(e,u)),i}return o._value=n,o}function Vj(e,n){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var s=Ou(e);return this.tween(i,(s.local?Uj:Hj)(s,n))}function Wj(e,n){return function(){Gg(this,e).delay=+n.apply(this,arguments)}}function Gj(e,n){return n=+n,function(){Gg(this,e).delay=n}}function Yj(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Wj:Gj)(n,e)):Xn(this.node(),n).delay}function Kj(e,n){return function(){fr(this,e).duration=+n.apply(this,arguments)}}function Xj(e,n){return n=+n,function(){fr(this,e).duration=n}}function Qj(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Kj:Xj)(n,e)):Xn(this.node(),n).duration}function Zj(e,n){if(typeof n!="function")throw new Error;return function(){fr(this,e).ease=n}}function Jj(e){var n=this._id;return arguments.length?this.each(Zj(n,e)):Xn(this.node(),n).ease}function eA(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;fr(this,e).ease=i}}function tA(e){if(typeof e!="function")throw new Error;return this.each(eA(this._id,e))}function nA(e){typeof e!="function"&&(e=Ok(e));for(var n=this._groups,i=n.length,s=new Array(i),o=0;o<i;++o)for(var u=n[o],l=u.length,c=s[o]=[],d,h=0;h<l;++h)(d=u[h])&&e.call(d,d.__data__,h,u)&&c.push(d);return new Rr(s,this._parents,this._name,this._id)}function rA(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,s=n.length,o=i.length,u=Math.min(s,o),l=new Array(s),c=0;c<u;++c)for(var d=n[c],h=i[c],p=d.length,m=l[c]=new Array(p),y,x=0;x<p;++x)(y=d[x]||h[x])&&(m[x]=y);for(;c<s;++c)l[c]=n[c];return new Rr(l,this._parents,this._name,this._id)}function iA(e){return(e+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function sA(e,n,i){var s,o,u=iA(n)?Gg:fr;return function(){var l=u(this,e),c=l.on;c!==s&&(o=(s=c).copy()).on(n,i),l.on=o}}function oA(e,n){var i=this._id;return arguments.length<2?Xn(this.node(),i).on.on(e):this.each(sA(i,e,n))}function aA(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function uA(){return this.on("end.remove",aA(this._id))}function lA(e){var n=this._name,i=this._id;typeof e!="function"&&(e=Ug(e));for(var s=this._groups,o=s.length,u=new Array(o),l=0;l<o;++l)for(var c=s[l],d=c.length,h=u[l]=new Array(d),p,m,y=0;y<d;++y)(p=c[y])&&(m=e.call(p,p.__data__,y,c))&&("__data__"in p&&(m.__data__=p.__data__),h[y]=m,Lu(h[y],n,i,y,h,Xn(p,i)));return new Rr(u,this._parents,n,i)}function cA(e){var n=this._name,i=this._id;typeof e!="function"&&(e=Pk(e));for(var s=this._groups,o=s.length,u=[],l=[],c=0;c<o;++c)for(var d=s[c],h=d.length,p,m=0;m<h;++m)if(p=d[m]){for(var y=e.call(p,p.__data__,m,d),x,N=Xn(p,i),_=0,S=y.length;_<S;++_)(x=y[_])&&Lu(x,n,i,_,y,N);u.push(y),l.push(p)}return new Rr(u,l,n,i)}var fA=Wo.prototype.constructor;function dA(){return new fA(this._groups,this._parents)}function hA(e,n){var i,s,o;return function(){var u=qs(this,e),l=(this.style.removeProperty(e),qs(this,e));return u===l?null:u===i&&l===s?o:o=n(i=u,s=l)}}function iE(e){return function(){this.style.removeProperty(e)}}function pA(e,n,i){var s,o=i+"",u;return function(){var l=qs(this,e);return l===o?null:l===s?u:u=n(s=l,i)}}function mA(e,n,i){var s,o,u;return function(){var l=qs(this,e),c=i(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(e),qs(this,e))),l===d?null:l===s&&d===o?u:(o=d,u=n(s=l,c))}}function gA(e,n){var i,s,o,u="style."+n,l="end."+u,c;return function(){var d=fr(this,e),h=d.on,p=d.value[u]==null?c||(c=iE(n)):void 0;(h!==i||o!==p)&&(s=(i=h).copy()).on(l,o=p),d.on=s}}function vA(e,n,i){var s=(e+="")=="transform"?vj:rE;return n==null?this.styleTween(e,hA(e,s)).on("end.style."+e,iE(e)):typeof n=="function"?this.styleTween(e,mA(e,s,Yg(this,"style."+e,n))).each(gA(this._id,e)):this.styleTween(e,pA(e,s,n),i).on("end.style."+e,null)}function yA(e,n,i){return function(s){this.style.setProperty(e,n.call(this,s),i)}}function wA(e,n,i){var s,o;function u(){var l=n.apply(this,arguments);return l!==o&&(s=(o=l)&&yA(e,l,i)),s}return u._value=n,u}function xA(e,n,i){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;return this.tween(s,wA(e,n,i??""))}function _A(e){return function(){this.textContent=e}}function SA(e){return function(){var n=e(this);this.textContent=n??""}}function bA(e){return this.tween("text",typeof e=="function"?SA(Yg(this,"text",e)):_A(e==null?"":e+""))}function kA(e){return function(n){this.textContent=e.call(this,n)}}function EA(e){var n,i;function s(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&kA(o)),n}return s._value=e,s}function NA(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,EA(e))}function CA(){for(var e=this._name,n=this._id,i=sE(),s=this._groups,o=s.length,u=0;u<o;++u)for(var l=s[u],c=l.length,d,h=0;h<c;++h)if(d=l[h]){var p=Xn(d,n);Lu(d,e,i,h,l,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Rr(s,this._parents,e,i)}function RA(){var e,n,i=this,s=i._id,o=i.size();return new Promise(function(u,l){var c={value:l},d={value:function(){--o===0&&u()}};i.each(function(){var h=fr(this,s),p=h.on;p!==e&&(n=(e=p).copy(),n._.cancel.push(c),n._.interrupt.push(c),n._.end.push(d)),h.on=n}),o===0&&u()})}var TA=0;function Rr(e,n,i,s){this._groups=e,this._parents=n,this._name=i,this._id=s}function sE(){return++TA}var kr=Wo.prototype;Rr.prototype={constructor:Rr,select:lA,selectAll:cA,selectChild:kr.selectChild,selectChildren:kr.selectChildren,filter:nA,merge:rA,selection:dA,transition:CA,call:kr.call,nodes:kr.nodes,node:kr.node,size:kr.size,empty:kr.empty,each:kr.each,on:oA,attr:Fj,attrTween:Vj,style:vA,styleTween:xA,text:bA,textTween:NA,remove:uA,tween:Mj,delay:Yj,duration:Qj,ease:Jj,easeVarying:tA,end:RA,[Symbol.iterator]:kr[Symbol.iterator]};function jA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var AA={time:null,delay:0,duration:250,ease:jA};function IA(e,n){for(var i;!(i=e.__transition)||!(i=i[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return i}function MA(e){var n,i;e instanceof Rr?(n=e._id,e=e._name):(n=sE(),(i=AA).time=Wg(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,u=0;u<o;++u)for(var l=s[u],c=l.length,d,h=0;h<c;++h)(d=l[h])&&Lu(d,e,n,h,l,i||IA(d,n));return new Rr(s,this._parents,e,n)}Wo.prototype.interrupt=jj;Wo.prototype.transition=MA;const uu=e=>()=>e;function PA(e,{sourceEvent:n,target:i,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Nr(e,n,i){this.k=e,this.x=n,this.y=i}Nr.prototype={constructor:Nr,scale:function(e){return e===1?this:new Nr(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Nr(this.k,this.x+this.k*e,this.y+this.k*n)},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 Cr=new Nr(1,0,0);Nr.prototype;function Gc(e){e.stopImmediatePropagation()}function No(e){e.preventDefault(),e.stopImmediatePropagation()}function OA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function qA(){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 xw(){return this.__zoom||Cr}function LA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function $A(){return navigator.maxTouchPoints||"ontouchstart"in this}function DA(e,n,i){var s=e.invertX(n[0][0])-i[0][0],o=e.invertX(n[1][0])-i[1][0],u=e.invertY(n[0][1])-i[0][1],l=e.invertY(n[1][1])-i[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),l>u?(u+l)/2:Math.min(0,u)||Math.max(0,l))}function oE(){var e=OA,n=qA,i=DA,s=LA,o=$A,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,d=Sj,h=Pu("start","zoom","end"),p,m,y,x=500,N=150,_=0,S=10;function b(j){j.property("__zoom",xw).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",L).filter(o).on("touchstart.zoom",F).on("touchmove.zoom",J).on("touchend.zoom touchcancel.zoom",Q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(j,G,U,ne){var K=j.selection?j.selection():j;K.property("__zoom",xw),j!==K?I(j,G,U,ne):K.interrupt().each(function(){O(this,arguments).event(ne).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},b.scaleBy=function(j,G,U,ne){b.scaleTo(j,function(){var K=this.__zoom.k,$=typeof G=="function"?G.apply(this,arguments):G;return K*$},U,ne)},b.scaleTo=function(j,G,U,ne){b.transform(j,function(){var K=n.apply(this,arguments),$=this.__zoom,W=U==null?C(K):typeof U=="function"?U.apply(this,arguments):U,A=$.invert(W),B=typeof G=="function"?G.apply(this,arguments):G;return i(E(k($,B),W,A),K,l)},U,ne)},b.translateBy=function(j,G,U,ne){b.transform(j,function(){return i(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof U=="function"?U.apply(this,arguments):U),n.apply(this,arguments),l)},null,ne)},b.translateTo=function(j,G,U,ne,K){b.transform(j,function(){var $=n.apply(this,arguments),W=this.__zoom,A=ne==null?C($):typeof ne=="function"?ne.apply(this,arguments):ne;return i(Cr.translate(A[0],A[1]).scale(W.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof U=="function"?-U.apply(this,arguments):-U),$,l)},ne,K)};function k(j,G){return G=Math.max(u[0],Math.min(u[1],G)),G===j.k?j:new Nr(G,j.x,j.y)}function E(j,G,U){var ne=G[0]-U[0]*j.k,K=G[1]-U[1]*j.k;return ne===j.x&&K===j.y?j:new Nr(j.k,ne,K)}function C(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function I(j,G,U,ne){j.on("start.zoom",function(){O(this,arguments).event(ne).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(ne).end()}).tween("zoom",function(){var K=this,$=arguments,W=O(K,$).event(ne),A=n.apply(K,$),B=U==null?C(A):typeof U=="function"?U.apply(K,$):U,ue=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),z=K.__zoom,X=typeof G=="function"?G.apply(K,$):G,ee=d(z.invert(B).concat(ue/z.k),X.invert(B).concat(ue/X.k));return function(se){if(se===1)se=X;else{var oe=ee(se),pe=ue/oe[2];se=new Nr(pe,B[0]-oe[0]*pe,B[1]-oe[1]*pe)}W.zoom(null,se)}})}function O(j,G,U){return!U&&j.__zooming||new M(j,G)}function M(j,G){this.that=j,this.args=G,this.active=0,this.sourceEvent=null,this.extent=n.apply(j,G),this.taps=0}M.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,G){return this.mouse&&j!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var G=In(this.that).datum();h.call(j,this.that,new PA(j,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:h}),G)}};function P(j,...G){if(!e.apply(this,arguments))return;var U=O(this,G).event(j),ne=this.__zoom,K=Math.max(u[0],Math.min(u[1],ne.k*Math.pow(2,s.apply(this,arguments)))),$=Wn(j);if(U.wheel)(U.mouse[0][0]!==$[0]||U.mouse[0][1]!==$[1])&&(U.mouse[1]=ne.invert(U.mouse[0]=$)),clearTimeout(U.wheel);else{if(ne.k===K)return;U.mouse=[$,ne.invert($)],_u(this),U.start()}No(j),U.wheel=setTimeout(W,N),U.zoom("mouse",i(E(k(ne,K),U.mouse[0],U.mouse[1]),U.extent,l));function W(){U.wheel=null,U.end()}}function T(j,...G){if(y||!e.apply(this,arguments))return;var U=j.currentTarget,ne=O(this,G,!0).event(j),K=In(j.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",ue,!0),$=Wn(j,U),W=j.clientX,A=j.clientY;Vk(j.view),Gc(j),ne.mouse=[$,this.__zoom.invert($)],_u(this),ne.start();function B(z){if(No(z),!ne.moved){var X=z.clientX-W,ee=z.clientY-A;ne.moved=X*X+ee*ee>_}ne.event(z).zoom("mouse",i(E(ne.that.__zoom,ne.mouse[0]=Wn(z,U),ne.mouse[1]),ne.extent,l))}function ue(z){K.on("mousemove.zoom mouseup.zoom",null),Wk(z.view,ne.moved),No(z),ne.event(z).end()}}function L(j,...G){if(e.apply(this,arguments)){var U=this.__zoom,ne=Wn(j.changedTouches?j.changedTouches[0]:j,this),K=U.invert(ne),$=U.k*(j.shiftKey?.5:2),W=i(E(k(U,$),ne,K),n.apply(this,G),l);No(j),c>0?In(this).transition().duration(c).call(I,W,ne,j):In(this).call(b.transform,W,ne,j)}}function F(j,...G){if(e.apply(this,arguments)){var U=j.touches,ne=U.length,K=O(this,G,j.changedTouches.length===ne).event(j),$,W,A,B;for(Gc(j),W=0;W<ne;++W)A=U[W],B=Wn(A,this),B=[B,this.__zoom.invert(B),A.identifier],K.touch0?!K.touch1&&K.touch0[2]!==B[2]&&(K.touch1=B,K.taps=0):(K.touch0=B,$=!0,K.taps=1+!!p);p&&(p=clearTimeout(p)),$&&(K.taps<2&&(m=B[0],p=setTimeout(function(){p=null},x)),_u(this),K.start())}}function J(j,...G){if(this.__zooming){var U=O(this,G).event(j),ne=j.changedTouches,K=ne.length,$,W,A,B;for(No(j),$=0;$<K;++$)W=ne[$],A=Wn(W,this),U.touch0&&U.touch0[2]===W.identifier?U.touch0[0]=A:U.touch1&&U.touch1[2]===W.identifier&&(U.touch1[0]=A);if(W=U.that.__zoom,U.touch1){var ue=U.touch0[0],z=U.touch0[1],X=U.touch1[0],ee=U.touch1[1],se=(se=X[0]-ue[0])*se+(se=X[1]-ue[1])*se,oe=(oe=ee[0]-z[0])*oe+(oe=ee[1]-z[1])*oe;W=k(W,Math.sqrt(se/oe)),A=[(ue[0]+X[0])/2,(ue[1]+X[1])/2],B=[(z[0]+ee[0])/2,(z[1]+ee[1])/2]}else if(U.touch0)A=U.touch0[0],B=U.touch0[1];else return;U.zoom("touch",i(E(W,A,B),U.extent,l))}}function Q(j,...G){if(this.__zooming){var U=O(this,G).event(j),ne=j.changedTouches,K=ne.length,$,W;for(Gc(j),y&&clearTimeout(y),y=setTimeout(function(){y=null},x),$=0;$<K;++$)W=ne[$],U.touch0&&U.touch0[2]===W.identifier?delete U.touch0:U.touch1&&U.touch1[2]===W.identifier&&delete U.touch1;if(U.touch1&&!U.touch0&&(U.touch0=U.touch1,delete U.touch1),U.touch0)U.touch0[1]=this.__zoom.invert(U.touch0[0]);else if(U.end(),U.taps===2&&(W=Wn(W,this),Math.hypot(m[0]-W[0],m[1]-W[1])<S)){var A=In(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return b.wheelDelta=function(j){return arguments.length?(s=typeof j=="function"?j:uu(+j),b):s},b.filter=function(j){return arguments.length?(e=typeof j=="function"?j:uu(!!j),b):e},b.touchable=function(j){return arguments.length?(o=typeof j=="function"?j:uu(!!j),b):o},b.extent=function(j){return arguments.length?(n=typeof j=="function"?j:uu([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),b):n},b.scaleExtent=function(j){return arguments.length?(u[0]=+j[0],u[1]=+j[1],b):[u[0],u[1]]},b.translateExtent=function(j){return arguments.length?(l[0][0]=+j[0][0],l[1][0]=+j[1][0],l[0][1]=+j[0][1],l[1][1]=+j[1][1],b):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},b.constrain=function(j){return arguments.length?(i=j,b):i},b.duration=function(j){return arguments.length?(c=+j,b):c},b.interpolate=function(j){return arguments.length?(d=j,b):d},b.on=function(){var j=h.on.apply(h,arguments);return j===h?b:j},b.clickDistance=function(j){return arguments.length?(_=(j=+j)*j,b):Math.sqrt(_)},b.tapDistance=function(j){return arguments.length?(S=+j,b):S},b}Ak();const $u=q.createContext(null),FA=$u.Provider,Tr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,n)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?n.targetHandle:n.sourceHandle}", edge id: ${n.id}.`,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.`},aE=Tr.error001();function Xe(e,n){const i=q.useContext($u);if(i===null)throw new Error(aE);return Ik(i,e,n)}const Nt=()=>{const e=q.useContext($u);if(e===null)throw new Error(aE);return q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},zA=e=>e.userSelectionActive?"none":"all";function Kg({position:e,children:n,className:i,style:s,...o}){const u=Xe(zA),l=`${e}`.split("-");return ae.createElement("div",{className:zt(["react-flow__panel",i,...l]),style:{...s,pointerEvents:u},...o},n)}function BA({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:ae.createElement(Kg,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ae.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const UA=({x:e,y:n,label:i,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:u={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:d,className:h,...p})=>{const m=q.useRef(null),[y,x]=q.useState({x:0,y:0,width:0,height:0}),N=zt(["react-flow__edge-textwrapper",h]);return q.useEffect(()=>{if(m.current){const _=m.current.getBBox();x({x:_.x,y:_.y,width:_.width,height:_.height})}},[i]),typeof i>"u"||!i?null:ae.createElement("g",{transform:`translate(${e-y.width/2} ${n-y.height/2})`,className:N,visibility:y.width?"visible":"hidden",...p},o&&ae.createElement("rect",{width:y.width+2*l[0],x:-l[0],y:-l[1],height:y.height+2*l[1],className:"react-flow__edge-textbg",style:u,rx:c,ry:c}),ae.createElement("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:m,style:s},i),d)};var HA=q.memo(UA);const Xg=e=>({width:e.offsetWidth,height:e.offsetHeight}),$s=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),Qg=(e={x:0,y:0},n)=>({x:$s(e.x,n[0][0],n[1][0]),y:$s(e.y,n[0][1],n[1][1])}),_w=(e,n,i)=>e<n?$s(Math.abs(e-n),1,50)/50:e>i?-$s(Math.abs(e-i),1,50)/50:0,uE=(e,n)=>{const i=_w(e.x,35,n.width-35)*20,s=_w(e.y,35,n.height-35)*20;return[i,s]},lE=e=>{var n;return((n=e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},cE=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Bo=({x:e,y:n,width:i,height:s})=>({x:e,y:n,x2:e+i,y2:n+s}),fE=({x:e,y:n,x2:i,y2:s})=>({x:e,y:n,width:i-e,height:s-n}),Sw=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),VA=(e,n)=>fE(cE(Bo(e),Bo(n))),Rg=(e,n)=>{const i=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),s=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(i*s)},WA=e=>Mn(e.width)&&Mn(e.height)&&Mn(e.x)&&Mn(e.y),Mn=e=>!isNaN(e)&&isFinite(e),mt=Symbol.for("internals"),dE=["Enter"," ","Escape"],GA=(e,n)=>{},YA=e=>"nativeEvent"in e;function Tg(e){var o,u;const n=YA(e)?e.nativeEvent:e,i=((u=(o=n.composedPath)==null?void 0:o.call(n))==null?void 0:u[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(i==null?void 0:i.nodeName)||(i==null?void 0:i.hasAttribute("contenteditable"))||!!(i!=null&&i.closest(".nokey"))}const hE=e=>"clientX"in e,si=(e,n)=>{var u,l;const i=hE(e),s=i?e.clientX:(u=e.touches)==null?void 0:u[0].clientX,o=i?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((n==null?void 0:n.left)??0),y:o-((n==null?void 0:n.top)??0)}},Ru=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Yo=({id:e,path:n,labelX:i,labelY:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x=20})=>ae.createElement(ae.Fragment,null,ae.createElement("path",{id:e,style:p,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:m,markerStart:y}),x&&ae.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),o&&Mn(i)&&Mn(s)?ae.createElement(HA,{x:i,y:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h}):null);Yo.displayName="BaseEdge";function Co(e,n,i){return i===void 0?i:s=>{const o=n().edges.find(u=>u.id===e);o&&i(s,{...o})}}function pE({sourceX:e,sourceY:n,targetX:i,targetY:s}){const o=Math.abs(i-e)/2,u=i<e?i+o:i-o,l=Math.abs(s-n)/2,c=s<n?s+l:s-l;return[u,c,o,l]}function mE({sourceX:e,sourceY:n,targetX:i,targetY:s,sourceControlX:o,sourceControlY:u,targetControlX:l,targetControlY:c}){const d=e*.125+o*.375+l*.375+i*.125,h=n*.125+u*.375+c*.375+s*.125,p=Math.abs(d-e),m=Math.abs(h-n);return[d,h,p,m]}var Bi;(function(e){e.Strict="strict",e.Loose="loose"})(Bi||(Bi={}));var Li;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Li||(Li={}));var Uo;(function(e){e.Partial="partial",e.Full="full"})(Uo||(Uo={}));var ii;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ii||(ii={}));var Tu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Tu||(Tu={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));function bw({pos:e,x1:n,y1:i,x2:s,y2:o}){return e===Ce.Left||e===Ce.Right?[.5*(n+s),i]:[n,.5*(i+o)]}function gE({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:u=Ce.Top}){const[l,c]=bw({pos:i,x1:e,y1:n,x2:s,y2:o}),[d,h]=bw({pos:u,x1:s,y1:o,x2:e,y2:n}),[p,m,y,x]=mE({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${e},${n} C${l},${c} ${d},${h} ${s},${o}`,p,m,y,x]}const Zg=q.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,sourcePosition:o=Ce.Bottom,targetPosition:u=Ce.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,interactionWidth:_})=>{const[S,b,k]=gE({sourceX:e,sourceY:n,sourcePosition:o,targetX:i,targetY:s,targetPosition:u});return ae.createElement(Yo,{path:S,labelX:b,labelY:k,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,interactionWidth:_})});Zg.displayName="SimpleBezierEdge";const kw={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},KA=({source:e,sourcePosition:n=Ce.Bottom,target:i})=>n===Ce.Left||n===Ce.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},Ew=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function XA({source:e,sourcePosition:n=Ce.Bottom,target:i,targetPosition:s=Ce.Top,center:o,offset:u}){const l=kw[n],c=kw[s],d={x:e.x+l.x*u,y:e.y+l.y*u},h={x:i.x+c.x*u,y:i.y+c.y*u},p=KA({source:d,sourcePosition:n,target:h}),m=p.x!==0?"x":"y",y=p[m];let x=[],N,_;const S={x:0,y:0},b={x:0,y:0},[k,E,C,I]=pE({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(l[m]*c[m]===-1){N=o.x??k,_=o.y??E;const M=[{x:N,y:d.y},{x:N,y:h.y}],P=[{x:d.x,y:_},{x:h.x,y:_}];l[m]===y?x=m==="x"?M:P:x=m==="x"?P:M}else{const M=[{x:d.x,y:h.y}],P=[{x:h.x,y:d.y}];if(m==="x"?x=l.x===y?P:M:x=l.y===y?M:P,n===s){const Q=Math.abs(e[m]-i[m]);if(Q<=u){const j=Math.min(u-1,u-Q);l[m]===y?S[m]=(d[m]>e[m]?-1:1)*j:b[m]=(h[m]>i[m]?-1:1)*j}}if(n!==s){const Q=m==="x"?"y":"x",j=l[m]===c[Q],G=d[Q]>h[Q],U=d[Q]<h[Q];(l[m]===1&&(!j&&G||j&&U)||l[m]!==1&&(!j&&U||j&&G))&&(x=m==="x"?M:P)}const T={x:d.x+S.x,y:d.y+S.y},L={x:h.x+b.x,y:h.y+b.y},F=Math.max(Math.abs(T.x-x[0].x),Math.abs(L.x-x[0].x)),J=Math.max(Math.abs(T.y-x[0].y),Math.abs(L.y-x[0].y));F>=J?(N=(T.x+L.x)/2,_=x[0].y):(N=x[0].x,_=(T.y+L.y)/2)}return[[e,{x:d.x+S.x,y:d.y+S.y},...x,{x:h.x+b.x,y:h.y+b.y},i],N,_,C,I]}function QA(e,n,i,s){const o=Math.min(Ew(e,n)/2,Ew(n,i)/2,s),{x:u,y:l}=n;if(e.x===u&&u===i.x||e.y===l&&l===i.y)return`L${u} ${l}`;if(e.y===l){const h=e.x<i.x?-1:1,p=e.y<i.y?1:-1;return`L ${u+o*h},${l}Q ${u},${l} ${u},${l+o*p}`}const c=e.x<i.x?1:-1,d=e.y<i.y?-1:1;return`L ${u},${l+o*d}Q ${u},${l} ${u+o*c},${l}`}function jg({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:u=Ce.Top,borderRadius:l=5,centerX:c,centerY:d,offset:h=20}){const[p,m,y,x,N]=XA({source:{x:e,y:n},sourcePosition:i,target:{x:s,y:o},targetPosition:u,center:{x:c,y:d},offset:h});return[p.reduce((S,b,k)=>{let E="";return k>0&&k<p.length-1?E=QA(p[k-1],b,p[k+1],l):E=`${k===0?"M":"L"}${b.x} ${b.y}`,S+=E,S},""),m,y,x,N]}const Du=q.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,sourcePosition:m=Ce.Bottom,targetPosition:y=Ce.Top,markerEnd:x,markerStart:N,pathOptions:_,interactionWidth:S})=>{const[b,k,E]=jg({sourceX:e,sourceY:n,sourcePosition:m,targetX:i,targetY:s,targetPosition:y,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset});return ae.createElement(Yo,{path:b,labelX:k,labelY:E,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:x,markerStart:N,interactionWidth:S})});Du.displayName="SmoothStepEdge";const Jg=q.memo(e=>{var n;return ae.createElement(Du,{...e,pathOptions:q.useMemo(()=>{var i;return{borderRadius:0,offset:(i=e.pathOptions)==null?void 0:i.offset}},[(n=e.pathOptions)==null?void 0:n.offset])})});Jg.displayName="StepEdge";function ZA({sourceX:e,sourceY:n,targetX:i,targetY:s}){const[o,u,l,c]=pE({sourceX:e,sourceY:n,targetX:i,targetY:s});return[`M ${e},${n}L ${i},${s}`,o,u,l,c]}const ev=q.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x})=>{const[N,_,S]=ZA({sourceX:e,sourceY:n,targetX:i,targetY:s});return ae.createElement(Yo,{path:N,labelX:_,labelY:S,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x})});ev.displayName="StraightEdge";function lu(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function Nw({pos:e,x1:n,y1:i,x2:s,y2:o,c:u}){switch(e){case Ce.Left:return[n-lu(n-s,u),i];case Ce.Right:return[n+lu(s-n,u),i];case Ce.Top:return[n,i-lu(i-o,u)];case Ce.Bottom:return[n,i+lu(o-i,u)]}}function vE({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:u=Ce.Top,curvature:l=.25}){const[c,d]=Nw({pos:i,x1:e,y1:n,x2:s,y2:o,c:l}),[h,p]=Nw({pos:u,x1:s,y1:o,x2:e,y2:n,c:l}),[m,y,x,N]=mE({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:c,sourceControlY:d,targetControlX:h,targetControlY:p});return[`M${e},${n} C${c},${d} ${h},${p} ${s},${o}`,m,y,x,N]}const ju=q.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,sourcePosition:o=Ce.Bottom,targetPosition:u=Ce.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,pathOptions:_,interactionWidth:S})=>{const[b,k,E]=vE({sourceX:e,sourceY:n,sourcePosition:o,targetX:i,targetY:s,targetPosition:u,curvature:_==null?void 0:_.curvature});return ae.createElement(Yo,{path:b,labelX:k,labelY:E,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,interactionWidth:S})});ju.displayName="BezierEdge";const tv=q.createContext(null),JA=tv.Provider;tv.Consumer;const eI=()=>q.useContext(tv),tI=e=>"id"in e&&"source"in e&&"target"in e,nI=({source:e,sourceHandle:n,target:i,targetHandle:s})=>`reactflow__edge-${e}${n||""}-${i}${s||""}`,Ag=(e,n)=>typeof e>"u"?"":typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`,rI=(e,n)=>n.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),iI=(e,n)=>{if(!e.source||!e.target)return n;let i;return tI(e)?i={...e}:i={...e,id:nI(e)},rI(i,n)?n:n.concat(i)},Ig=({x:e,y:n},[i,s,o],u,[l,c])=>{const d={x:(e-i)/o,y:(n-s)/o};return u?{x:l*Math.round(d.x/l),y:c*Math.round(d.y/c)}:d},yE=({x:e,y:n},[i,s,o])=>({x:e*o+i,y:n*o+s}),Di=(e,n=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const i=(e.width??0)*n[0],s=(e.height??0)*n[1],o={x:e.position.x-i,y:e.position.y-s};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-i,y:e.positionAbsolute.y-s}:o}},Fu=(e,n=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((s,o)=>{const{x:u,y:l}=Di(o,n).positionAbsolute;return cE(s,Bo({x:u,y:l,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return fE(i)},wE=(e,n,[i,s,o]=[0,0,1],u=!1,l=!1,c=[0,0])=>{const d={x:(n.x-i)/o,y:(n.y-s)/o,width:n.width/o,height:n.height/o},h=[];return e.forEach(p=>{const{width:m,height:y,selectable:x=!0,hidden:N=!1}=p;if(l&&!x||N)return!1;const{positionAbsolute:_}=Di(p,c),S={x:_.x,y:_.y,width:m||0,height:y||0},b=Rg(d,S),k=typeof m>"u"||typeof y>"u"||m===null||y===null,E=u&&b>0,C=(m||0)*(y||0);(k||E||b>=C||p.dragging)&&h.push(p)}),h},xE=(e,n)=>{const i=e.map(s=>s.id);return n.filter(s=>i.includes(s.source)||i.includes(s.target))},_E=(e,n,i,s,o,u=.1)=>{const l=n/(e.width*(1+u)),c=i/(e.height*(1+u)),d=Math.min(l,c),h=$s(d,s,o),p=e.x+e.width/2,m=e.y+e.height/2,y=n/2-p*h,x=i/2-m*h;return{x:y,y:x,zoom:h}},Oi=(e,n=0)=>e.transition().duration(n);function Cw(e,n,i,s){return(n[i]||[]).reduce((o,u)=>{var l,c;return`${e.id}-${u.id}-${i}`!==s&&o.push({id:u.id||null,type:i,nodeId:e.id,x:(((l=e.positionAbsolute)==null?void 0:l.x)??0)+u.x+u.width/2,y:(((c=e.positionAbsolute)==null?void 0:c.y)??0)+u.y+u.height/2}),o},[])}function sI(e,n,i,s,o,u){const{x:l,y:c}=si(e),h=n.elementsFromPoint(l,c).find(N=>N.classList.contains("react-flow__handle"));if(h){const N=h.getAttribute("data-nodeid");if(N){const _=nv(void 0,h),S=h.getAttribute("data-handleid"),b=u({nodeId:N,id:S,type:_});if(b){const k=o.find(E=>E.nodeId===N&&E.type===_&&E.id===S);return{handle:{id:S,type:_,nodeId:N,x:(k==null?void 0:k.x)||i.x,y:(k==null?void 0:k.y)||i.y},validHandleResult:b}}}}let p=[],m=1/0;if(o.forEach(N=>{const _=Math.sqrt((N.x-i.x)**2+(N.y-i.y)**2);if(_<=s){const S=u(N);_<=m&&(_<m?p=[{handle:N,validHandleResult:S}]:_===m&&p.push({handle:N,validHandleResult:S}),m=_)}}),!p.length)return{handle:null,validHandleResult:SE()};if(p.length===1)return p[0];const y=p.some(({validHandleResult:N})=>N.isValid),x=p.some(({handle:N})=>N.type==="target");return p.find(({handle:N,validHandleResult:_})=>x?N.type==="target":y?_.isValid:!0)||p[0]}const oI={source:null,target:null,sourceHandle:null,targetHandle:null},SE=()=>({handleDomNode:null,isValid:!1,connection:oI,endHandle:null});function bE(e,n,i,s,o,u,l){const c=o==="target",d=l.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),h={...SE(),handleDomNode:d};if(d){const p=nv(void 0,d),m=d.getAttribute("data-nodeid"),y=d.getAttribute("data-handleid"),x=d.classList.contains("connectable"),N=d.classList.contains("connectableend"),_={source:c?m:i,sourceHandle:c?y:s,target:c?i:m,targetHandle:c?s:y};h.connection=_,x&&N&&(n===Bi.Strict?c&&p==="source"||!c&&p==="target":m!==i||y!==s)&&(h.endHandle={nodeId:m,handleId:y,type:p},h.isValid=u(_))}return h}function aI({nodes:e,nodeId:n,handleId:i,handleType:s}){return e.reduce((o,u)=>{if(u[mt]){const{handleBounds:l}=u[mt];let c=[],d=[];l&&(c=Cw(u,l,"source",`${n}-${i}-${s}`),d=Cw(u,l,"target",`${n}-${i}-${s}`)),o.push(...c,...d)}return o},[])}function nv(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function Yc(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function uI(e,n){let i=null;return n?i="valid":e&&!n&&(i="invalid"),i}function kE({event:e,handleId:n,nodeId:i,onConnect:s,isTarget:o,getState:u,setState:l,isValidConnection:c,edgeUpdaterType:d,onReconnectEnd:h}){const p=lE(e.target),{connectionMode:m,domNode:y,autoPanOnConnect:x,connectionRadius:N,onConnectStart:_,panBy:S,getNodes:b,cancelConnection:k}=u();let E=0,C;const{x:I,y:O}=si(e),M=p==null?void 0:p.elementFromPoint(I,O),P=nv(d,M),T=y==null?void 0:y.getBoundingClientRect();if(!T||!P)return;let L,F=si(e,T),J=!1,Q=null,j=!1,G=null;const U=aI({nodes:b(),nodeId:i,handleId:n,handleType:P}),ne=()=>{if(!x)return;const[W,A]=uE(F,T);S({x:W,y:A}),E=requestAnimationFrame(ne)};l({connectionPosition:F,connectionStatus:null,connectionNodeId:i,connectionHandleId:n,connectionHandleType:P,connectionStartHandle:{nodeId:i,handleId:n,type:P},connectionEndHandle:null}),_==null||_(e,{nodeId:i,handleId:n,handleType:P});function K(W){const{transform:A}=u();F=si(W,T);const{handle:B,validHandleResult:ue}=sI(W,p,Ig(F,A,!1,[1,1]),N,U,z=>bE(z,m,i,n,o?"target":"source",c,p));if(C=B,J||(ne(),J=!0),G=ue.handleDomNode,Q=ue.connection,j=ue.isValid,l({connectionPosition:C&&j?yE({x:C.x,y:C.y},A):F,connectionStatus:uI(!!C,j),connectionEndHandle:ue.endHandle}),!C&&!j&&!G)return Yc(L);Q.source!==Q.target&&G&&(Yc(L),L=G,G.classList.add("connecting","react-flow__handle-connecting"),G.classList.toggle("valid",j),G.classList.toggle("react-flow__handle-valid",j))}function $(W){var A,B;(C||G)&&Q&&j&&(s==null||s(Q)),(B=(A=u()).onConnectEnd)==null||B.call(A,W),d&&(h==null||h(W)),Yc(L),k(),cancelAnimationFrame(E),J=!1,j=!1,Q=null,G=null,p.removeEventListener("mousemove",K),p.removeEventListener("mouseup",$),p.removeEventListener("touchmove",K),p.removeEventListener("touchend",$)}p.addEventListener("mousemove",K),p.addEventListener("mouseup",$),p.addEventListener("touchmove",K),p.addEventListener("touchend",$)}const Rw=()=>!0,lI=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),cI=(e,n,i)=>s=>{const{connectionStartHandle:o,connectionEndHandle:u,connectionClickStartHandle:l}=s;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===n&&(o==null?void 0:o.type)===i||(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.handleId)===n&&(u==null?void 0:u.type)===i,clickConnecting:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.handleId)===n&&(l==null?void 0:l.type)===i}},EE=q.forwardRef(({type:e="source",position:n=Ce.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:u=!0,id:l,onConnect:c,children:d,className:h,onMouseDown:p,onTouchStart:m,...y},x)=>{var T,L;const N=l||null,_=e==="target",S=Nt(),b=eI(),{connectOnClick:k,noPanClassName:E}=Xe(lI,Et),{connecting:C,clickConnecting:I}=Xe(cI(b,N,e),Et);b||(L=(T=S.getState()).onError)==null||L.call(T,"010",Tr.error010());const O=F=>{const{defaultEdgeOptions:J,onConnect:Q,hasDefaultEdges:j}=S.getState(),G={...J,...F};if(j){const{edges:U,setEdges:ne}=S.getState();ne(iI(G,U))}Q==null||Q(G),c==null||c(G)},M=F=>{if(!b)return;const J=hE(F);o&&(J&&F.button===0||!J)&&kE({event:F,handleId:N,nodeId:b,onConnect:O,isTarget:_,getState:S.getState,setState:S.setState,isValidConnection:i||S.getState().isValidConnection||Rw}),J?p==null||p(F):m==null||m(F)},P=F=>{const{onClickConnectStart:J,onClickConnectEnd:Q,connectionClickStartHandle:j,connectionMode:G,isValidConnection:U}=S.getState();if(!b||!j&&!o)return;if(!j){J==null||J(F,{nodeId:b,handleId:N,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:N}});return}const ne=lE(F.target),K=i||U||Rw,{connection:$,isValid:W}=bE({nodeId:b,id:N,type:e},G,j.nodeId,j.handleId||null,j.type,K,ne);W&&O($),Q==null||Q(F),S.setState({connectionClickStartHandle:null})};return ae.createElement("div",{"data-handleid":N,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${N}-${e}`,className:zt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,h,{source:!_,target:_,connectable:s,connectablestart:o,connectableend:u,connecting:I,connectionindicator:s&&(o&&!C||u&&C)}]),onMouseDown:M,onTouchStart:M,onClick:k?P:void 0,ref:x,...y},d)});EE.displayName="Handle";var Ds=q.memo(EE);const NE=({data:e,isConnectable:n,targetPosition:i=Ce.Top,sourcePosition:s=Ce.Bottom})=>ae.createElement(ae.Fragment,null,ae.createElement(Ds,{type:"target",position:i,isConnectable:n}),e==null?void 0:e.label,ae.createElement(Ds,{type:"source",position:s,isConnectable:n}));NE.displayName="DefaultNode";var Mg=q.memo(NE);const CE=({data:e,isConnectable:n,sourcePosition:i=Ce.Bottom})=>ae.createElement(ae.Fragment,null,e==null?void 0:e.label,ae.createElement(Ds,{type:"source",position:i,isConnectable:n}));CE.displayName="InputNode";var RE=q.memo(CE);const TE=({data:e,isConnectable:n,targetPosition:i=Ce.Top})=>ae.createElement(ae.Fragment,null,ae.createElement(Ds,{type:"target",position:i,isConnectable:n}),e==null?void 0:e.label);TE.displayName="OutputNode";var jE=q.memo(TE);const rv=()=>null;rv.displayName="GroupNode";const fI=e=>({selectedNodes:e.getNodes().filter(n=>n.selected),selectedEdges:e.edges.filter(n=>n.selected).map(n=>({...n}))}),cu=e=>e.id;function dI(e,n){return Et(e.selectedNodes.map(cu),n.selectedNodes.map(cu))&&Et(e.selectedEdges.map(cu),n.selectedEdges.map(cu))}const AE=q.memo(({onSelectionChange:e})=>{const n=Nt(),{selectedNodes:i,selectedEdges:s}=Xe(fI,dI);return q.useEffect(()=>{const o={nodes:i,edges:s};e==null||e(o),n.getState().onSelectionChange.forEach(u=>u(o))},[i,s,e]),null});AE.displayName="SelectionListener";const hI=e=>!!e.onSelectionChange;function pI({onSelectionChange:e}){const n=Xe(hI);return e||n?ae.createElement(AE,{onSelectionChange:e}):null}const mI=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function ks(e,n){q.useEffect(()=>{typeof e<"u"&&n(e)},[e])}function qe(e,n,i){q.useEffect(()=>{typeof n<"u"&&i({[e]:n})},[n])}const gI=({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,onConnect:o,onConnectStart:u,onConnectEnd:l,onClickConnectStart:c,onClickConnectEnd:d,nodesDraggable:h,nodesConnectable:p,nodesFocusable:m,edgesFocusable:y,edgesUpdatable:x,elevateNodesOnSelect:N,minZoom:_,maxZoom:S,nodeExtent:b,onNodesChange:k,onEdgesChange:E,elementsSelectable:C,connectionMode:I,snapGrid:O,snapToGrid:M,translateExtent:P,connectOnClick:T,defaultEdgeOptions:L,fitView:F,fitViewOptions:J,onNodesDelete:Q,onEdgesDelete:j,onNodeDrag:G,onNodeDragStart:U,onNodeDragStop:ne,onSelectionDrag:K,onSelectionDragStart:$,onSelectionDragStop:W,noPanClassName:A,nodeOrigin:B,rfId:ue,autoPanOnConnect:z,autoPanOnNodeDrag:X,onError:ee,connectionRadius:se,isValidConnection:oe,nodeDragThreshold:pe})=>{const{setNodes:ge,setEdges:Ae,setDefaultNodesAndEdges:ze,setMinZoom:Me,setMaxZoom:Ie,setTranslateExtent:be,setNodeExtent:Be,reset:ye}=Xe(mI,Et),we=Nt();return q.useEffect(()=>{const Le=s==null?void 0:s.map(Qe=>({...Qe,...L}));return ze(i,Le),()=>{ye()}},[]),qe("defaultEdgeOptions",L,we.setState),qe("connectionMode",I,we.setState),qe("onConnect",o,we.setState),qe("onConnectStart",u,we.setState),qe("onConnectEnd",l,we.setState),qe("onClickConnectStart",c,we.setState),qe("onClickConnectEnd",d,we.setState),qe("nodesDraggable",h,we.setState),qe("nodesConnectable",p,we.setState),qe("nodesFocusable",m,we.setState),qe("edgesFocusable",y,we.setState),qe("edgesUpdatable",x,we.setState),qe("elementsSelectable",C,we.setState),qe("elevateNodesOnSelect",N,we.setState),qe("snapToGrid",M,we.setState),qe("snapGrid",O,we.setState),qe("onNodesChange",k,we.setState),qe("onEdgesChange",E,we.setState),qe("connectOnClick",T,we.setState),qe("fitViewOnInit",F,we.setState),qe("fitViewOnInitOptions",J,we.setState),qe("onNodesDelete",Q,we.setState),qe("onEdgesDelete",j,we.setState),qe("onNodeDrag",G,we.setState),qe("onNodeDragStart",U,we.setState),qe("onNodeDragStop",ne,we.setState),qe("onSelectionDrag",K,we.setState),qe("onSelectionDragStart",$,we.setState),qe("onSelectionDragStop",W,we.setState),qe("noPanClassName",A,we.setState),qe("nodeOrigin",B,we.setState),qe("rfId",ue,we.setState),qe("autoPanOnConnect",z,we.setState),qe("autoPanOnNodeDrag",X,we.setState),qe("onError",ee,we.setState),qe("connectionRadius",se,we.setState),qe("isValidConnection",oe,we.setState),qe("nodeDragThreshold",pe,we.setState),ks(e,ge),ks(n,Ae),ks(_,Me),ks(S,Ie),ks(P,be),ks(b,Be),null},Tw={display:"none"},vI={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},IE="react-flow__node-desc",ME="react-flow__edge-desc",yI="react-flow__aria-live",wI=e=>e.ariaLiveMessage;function xI({rfId:e}){const n=Xe(wI);return ae.createElement("div",{id:`${yI}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vI},n)}function _I({rfId:e,disableKeyboardA11y:n}){return ae.createElement(ae.Fragment,null,ae.createElement("div",{id:`${IE}-${e}`,style:Tw},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ae.createElement("div",{id:`${ME}-${e}`,style:Tw},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&ae.createElement(xI,{rfId:e}))}var Ho=(e=null,n={actInsideInputWithModifier:!0})=>{const[i,s]=q.useState(!1),o=q.useRef(!1),u=q.useRef(new Set([])),[l,c]=q.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.split("+")),p=h.reduce((m,y)=>m.concat(...y),[]);return[h,p]}return[[],[]]},[e]);return q.useEffect(()=>{const d=typeof document<"u"?document:null,h=(n==null?void 0:n.target)||d;if(e!==null){const p=x=>{if(o.current=x.ctrlKey||x.metaKey||x.shiftKey,(!o.current||o.current&&!n.actInsideInputWithModifier)&&Tg(x))return!1;const _=Aw(x.code,c);u.current.add(x[_]),jw(l,u.current,!1)&&(x.preventDefault(),s(!0))},m=x=>{if((!o.current||o.current&&!n.actInsideInputWithModifier)&&Tg(x))return!1;const _=Aw(x.code,c);jw(l,u.current,!0)?(s(!1),u.current.clear()):u.current.delete(x[_]),x.key==="Meta"&&u.current.clear(),o.current=!1},y=()=>{u.current.clear(),s(!1)};return h==null||h.addEventListener("keydown",p),h==null||h.addEventListener("keyup",m),window.addEventListener("blur",y),()=>{h==null||h.removeEventListener("keydown",p),h==null||h.removeEventListener("keyup",m),window.removeEventListener("blur",y)}}},[e,s]),i};function jw(e,n,i){return e.filter(s=>i||s.length===n.size).some(s=>s.every(o=>n.has(o)))}function Aw(e,n){return n.includes(e)?"code":"key"}function PE(e,n,i,s){var c,d;const o=e.parentNode||e.parentId;if(!o)return i;const u=n.get(o),l=Di(u,s);return PE(u,n,{x:(i.x??0)+l.x,y:(i.y??0)+l.y,z:(((c=u[mt])==null?void 0:c.z)??0)>(i.z??0)?((d=u[mt])==null?void 0:d.z)??0:i.z??0},s)}function OE(e,n,i){e.forEach(s=>{var u;const o=s.parentNode||s.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||i!=null&&i[s.id]){const{x:l,y:c,z:d}=PE(s,e,{...s.position,z:((u=s[mt])==null?void 0:u.z)??0},n);s.positionAbsolute={x:l,y:c},s[mt].z=d,i!=null&&i[s.id]&&(s[mt].isParent=!0)}})}function Kc(e,n,i,s){const o=new Map,u={},l=s?1e3:0;return e.forEach(c=>{var x;const d=(Mn(c.zIndex)?c.zIndex:0)+(c.selected?l:0),h=n.get(c.id),p={...c,positionAbsolute:{x:c.position.x,y:c.position.y}},m=c.parentNode||c.parentId;m&&(u[m]=!0);const y=(h==null?void 0:h.type)&&(h==null?void 0:h.type)!==c.type;Object.defineProperty(p,mt,{enumerable:!1,value:{handleBounds:y||(x=h==null?void 0:h[mt])==null?void 0:x.handleBounds,z:d}}),o.set(c.id,p)}),OE(o,i,u),o}function qE(e,n={}){const{getNodes:i,width:s,height:o,minZoom:u,maxZoom:l,d3Zoom:c,d3Selection:d,fitViewOnInitDone:h,fitViewOnInit:p,nodeOrigin:m}=e(),y=n.initial&&!h&&p;if(c&&d&&(y||!n.initial)){const N=i().filter(S=>{var k;const b=n.includeHiddenNodes?S.width&&S.height:!S.hidden;return(k=n.nodes)!=null&&k.length?b&&n.nodes.some(E=>E.id===S.id):b}),_=N.every(S=>S.width&&S.height);if(N.length>0&&_){const S=Fu(N,m),{x:b,y:k,zoom:E}=_E(S,s,o,n.minZoom??u,n.maxZoom??l,n.padding??.1),C=Cr.translate(b,k).scale(E);return typeof n.duration=="number"&&n.duration>0?c.transform(Oi(d,n.duration),C):c.transform(d,C),!0}}return!1}function SI(e,n){return e.forEach(i=>{const s=n.get(i.id);s&&n.set(s.id,{...s,[mt]:s[mt],selected:i.selected})}),new Map(n)}function bI(e,n){return n.map(i=>{const s=e.find(o=>o.id===i.id);return s&&(i.selected=s.selected),i})}function fu({changedNodes:e,changedEdges:n,get:i,set:s}){const{nodeInternals:o,edges:u,onNodesChange:l,onEdgesChange:c,hasDefaultNodes:d,hasDefaultEdges:h}=i();e!=null&&e.length&&(d&&s({nodeInternals:SI(e,o)}),l==null||l(e)),n!=null&&n.length&&(h&&s({edges:bI(n,u)}),c==null||c(n))}const Es=()=>{},kI={zoomIn:Es,zoomOut:Es,zoomTo:Es,getZoom:()=>1,setViewport:Es,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Es,fitBounds:Es,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},EI=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),NI=()=>{const e=Nt(),{d3Zoom:n,d3Selection:i}=Xe(EI,Et);return q.useMemo(()=>i&&n?{zoomIn:o=>n.scaleBy(Oi(i,o==null?void 0:o.duration),1.2),zoomOut:o=>n.scaleBy(Oi(i,o==null?void 0:o.duration),1/1.2),zoomTo:(o,u)=>n.scaleTo(Oi(i,u==null?void 0:u.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,u)=>{const[l,c,d]=e.getState().transform,h=Cr.translate(o.x??l,o.y??c).scale(o.zoom??d);n.transform(Oi(i,u==null?void 0:u.duration),h)},getViewport:()=>{const[o,u,l]=e.getState().transform;return{x:o,y:u,zoom:l}},fitView:o=>qE(e.getState,o),setCenter:(o,u,l)=>{const{width:c,height:d,maxZoom:h}=e.getState(),p=typeof(l==null?void 0:l.zoom)<"u"?l.zoom:h,m=c/2-o*p,y=d/2-u*p,x=Cr.translate(m,y).scale(p);n.transform(Oi(i,l==null?void 0:l.duration),x)},fitBounds:(o,u)=>{const{width:l,height:c,minZoom:d,maxZoom:h}=e.getState(),{x:p,y:m,zoom:y}=_E(o,l,c,d,h,(u==null?void 0:u.padding)??.1),x=Cr.translate(p,m).scale(y);n.transform(Oi(i,u==null?void 0:u.duration),x)},project:o=>{const{transform:u,snapToGrid:l,snapGrid:c}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Ig(o,u,l,c)},screenToFlowPosition:o=>{const{transform:u,snapToGrid:l,snapGrid:c,domNode:d}=e.getState();if(!d)return o;const{x:h,y:p}=d.getBoundingClientRect(),m={x:o.x-h,y:o.y-p};return Ig(m,u,l,c)},flowToScreenPosition:o=>{const{transform:u,domNode:l}=e.getState();if(!l)return o;const{x:c,y:d}=l.getBoundingClientRect(),h=yE(o,u);return{x:h.x+c,y:h.y+d}},viewportInitialized:!0}:kI,[n,i])};function Ko(){const e=NI(),n=Nt(),i=q.useCallback(()=>n.getState().getNodes().map(_=>({..._})),[]),s=q.useCallback(_=>n.getState().nodeInternals.get(_),[]),o=q.useCallback(()=>{const{edges:_=[]}=n.getState();return _.map(S=>({...S}))},[]),u=q.useCallback(_=>{const{edges:S=[]}=n.getState();return S.find(b=>b.id===_)},[]),l=q.useCallback(_=>{const{getNodes:S,setNodes:b,hasDefaultNodes:k,onNodesChange:E}=n.getState(),C=S(),I=typeof _=="function"?_(C):_;if(k)b(I);else if(E){const O=I.length===0?C.map(M=>({type:"remove",id:M.id})):I.map(M=>({item:M,type:"reset"}));E(O)}},[]),c=q.useCallback(_=>{const{edges:S=[],setEdges:b,hasDefaultEdges:k,onEdgesChange:E}=n.getState(),C=typeof _=="function"?_(S):_;if(k)b(C);else if(E){const I=C.length===0?S.map(O=>({type:"remove",id:O.id})):C.map(O=>({item:O,type:"reset"}));E(I)}},[]),d=q.useCallback(_=>{const S=Array.isArray(_)?_:[_],{getNodes:b,setNodes:k,hasDefaultNodes:E,onNodesChange:C}=n.getState();if(E){const O=[...b(),...S];k(O)}else if(C){const I=S.map(O=>({item:O,type:"add"}));C(I)}},[]),h=q.useCallback(_=>{const S=Array.isArray(_)?_:[_],{edges:b=[],setEdges:k,hasDefaultEdges:E,onEdgesChange:C}=n.getState();if(E)k([...b,...S]);else if(C){const I=S.map(O=>({item:O,type:"add"}));C(I)}},[]),p=q.useCallback(()=>{const{getNodes:_,edges:S=[],transform:b}=n.getState(),[k,E,C]=b;return{nodes:_().map(I=>({...I})),edges:S.map(I=>({...I})),viewport:{x:k,y:E,zoom:C}}},[]),m=q.useCallback(({nodes:_,edges:S})=>{const{nodeInternals:b,getNodes:k,edges:E,hasDefaultNodes:C,hasDefaultEdges:I,onNodesDelete:O,onEdgesDelete:M,onNodesChange:P,onEdgesChange:T}=n.getState(),L=(_||[]).map(G=>G.id),F=(S||[]).map(G=>G.id),J=k().reduce((G,U)=>{const ne=U.parentNode||U.parentId,K=!L.includes(U.id)&&ne&&G.find(W=>W.id===ne);return(typeof U.deletable=="boolean"?U.deletable:!0)&&(L.includes(U.id)||K)&&G.push(U),G},[]),Q=E.filter(G=>typeof G.deletable=="boolean"?G.deletable:!0),j=Q.filter(G=>F.includes(G.id));if(J||j){const G=xE(J,Q),U=[...j,...G],ne=U.reduce((K,$)=>(K.includes($.id)||K.push($.id),K),[]);if((I||C)&&(I&&n.setState({edges:E.filter(K=>!ne.includes(K.id))}),C&&(J.forEach(K=>{b.delete(K.id)}),n.setState({nodeInternals:new Map(b)}))),ne.length>0&&(M==null||M(U),T&&T(ne.map(K=>({id:K,type:"remove"})))),J.length>0&&(O==null||O(J),P)){const K=J.map($=>({id:$.id,type:"remove"}));P(K)}}},[]),y=q.useCallback(_=>{const S=WA(_),b=S?null:n.getState().nodeInternals.get(_.id);return!S&&!b?[null,null,S]:[S?_:Sw(b),b,S]},[]),x=q.useCallback((_,S=!0,b)=>{const[k,E,C]=y(_);return k?(b||n.getState().getNodes()).filter(I=>{if(!C&&(I.id===E.id||!I.positionAbsolute))return!1;const O=Sw(I),M=Rg(O,k);return S&&M>0||M>=k.width*k.height}):[]},[]),N=q.useCallback((_,S,b=!0)=>{const[k]=y(_);if(!k)return!1;const E=Rg(k,S);return b&&E>0||E>=k.width*k.height},[]);return q.useMemo(()=>({...e,getNodes:i,getNode:s,getEdges:o,getEdge:u,setNodes:l,setEdges:c,addNodes:d,addEdges:h,toObject:p,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:N}),[e,i,s,o,u,l,c,d,h,p,m,x,N])}const CI={actInsideInputWithModifier:!1};var RI=({deleteKeyCode:e,multiSelectionKeyCode:n})=>{const i=Nt(),{deleteElements:s}=Ko(),o=Ho(e,CI),u=Ho(n);q.useEffect(()=>{if(o){const{edges:l,getNodes:c}=i.getState(),d=c().filter(p=>p.selected),h=l.filter(p=>p.selected);s({nodes:d,edges:h}),i.setState({nodesSelectionActive:!1})}},[o]),q.useEffect(()=>{i.setState({multiSelectionActive:u})},[u])};function TI(e){const n=Nt();q.useEffect(()=>{let i;const s=()=>{var u,l;if(!e.current)return;const o=Xg(e.current);(o.height===0||o.width===0)&&((l=(u=n.getState()).onError)==null||l.call(u,"004",Tr.error004())),n.setState({width:o.width||500,height:o.height||500})};return s(),window.addEventListener("resize",s),e.current&&(i=new ResizeObserver(()=>s()),i.observe(e.current)),()=>{window.removeEventListener("resize",s),i&&e.current&&i.unobserve(e.current)}},[])}const iv={position:"absolute",width:"100%",height:"100%",top:0,left:0},jI=(e,n)=>e.x!==n.x||e.y!==n.y||e.zoom!==n.k,du=e=>({x:e.x,y:e.y,zoom:e.k}),Ns=(e,n)=>e.target.closest(`.${n}`),Iw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),Mw=e=>{const n=e.ctrlKey&&Ru()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n},AI=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),II=({onMove:e,onMoveStart:n,onMoveEnd:i,onPaneContextMenu:s,zoomOnScroll:o=!0,zoomOnPinch:u=!0,panOnScroll:l=!1,panOnScrollSpeed:c=.5,panOnScrollMode:d=Li.Free,zoomOnDoubleClick:h=!0,elementsSelectable:p,panOnDrag:m=!0,defaultViewport:y,translateExtent:x,minZoom:N,maxZoom:_,zoomActivationKeyCode:S,preventScrolling:b=!0,children:k,noWheelClassName:E,noPanClassName:C})=>{const I=q.useRef(),O=Nt(),M=q.useRef(!1),P=q.useRef(!1),T=q.useRef(null),L=q.useRef({x:0,y:0,zoom:0}),{d3Zoom:F,d3Selection:J,d3ZoomHandler:Q,userSelectionActive:j}=Xe(AI,Et),G=Ho(S),U=q.useRef(0),ne=q.useRef(!1),K=q.useRef();return TI(T),q.useEffect(()=>{if(T.current){const $=T.current.getBoundingClientRect(),W=oE().scaleExtent([N,_]).translateExtent(x),A=In(T.current).call(W),B=Cr.translate(y.x,y.y).scale($s(y.zoom,N,_)),ue=[[0,0],[$.width,$.height]],z=W.constrain()(B,ue,x);W.transform(A,z),W.wheelDelta(Mw),O.setState({d3Zoom:W,d3Selection:A,d3ZoomHandler:A.on("wheel.zoom"),transform:[z.x,z.y,z.k],domNode:T.current.closest(".react-flow")})}},[]),q.useEffect(()=>{J&&F&&(l&&!G&&!j?J.on("wheel.zoom",$=>{if(Ns($,E))return!1;$.preventDefault(),$.stopImmediatePropagation();const W=J.property("__zoom").k||1;if($.ctrlKey&&u){const oe=Wn($),pe=Mw($),ge=W*Math.pow(2,pe);F.scaleTo(J,ge,oe,$);return}const A=$.deltaMode===1?20:1;let B=d===Li.Vertical?0:$.deltaX*A,ue=d===Li.Horizontal?0:$.deltaY*A;!Ru()&&$.shiftKey&&d!==Li.Vertical&&(B=$.deltaY*A,ue=0),F.translateBy(J,-(B/W)*c,-(ue/W)*c,{internal:!0});const z=du(J.property("__zoom")),{onViewportChangeStart:X,onViewportChange:ee,onViewportChangeEnd:se}=O.getState();clearTimeout(K.current),ne.current||(ne.current=!0,n==null||n($,z),X==null||X(z)),ne.current&&(e==null||e($,z),ee==null||ee(z),K.current=setTimeout(()=>{i==null||i($,z),se==null||se(z),ne.current=!1},150))},{passive:!1}):typeof Q<"u"&&J.on("wheel.zoom",function($,W){if(!b&&$.type==="wheel"&&!$.ctrlKey||Ns($,E))return null;$.preventDefault(),Q.call(this,$,W)},{passive:!1}))},[j,l,d,J,F,Q,G,u,b,E,n,e,i]),q.useEffect(()=>{F&&F.on("start",$=>{var B,ue;if(!$.sourceEvent||$.sourceEvent.internal)return null;U.current=(B=$.sourceEvent)==null?void 0:B.button;const{onViewportChangeStart:W}=O.getState(),A=du($.transform);M.current=!0,L.current=A,((ue=$.sourceEvent)==null?void 0:ue.type)==="mousedown"&&O.setState({paneDragging:!0}),W==null||W(A),n==null||n($.sourceEvent,A)})},[F,n]),q.useEffect(()=>{F&&(j&&!M.current?F.on("zoom",null):j||F.on("zoom",$=>{var A;const{onViewportChange:W}=O.getState();if(O.setState({transform:[$.transform.x,$.transform.y,$.transform.k]}),P.current=!!(s&&Iw(m,U.current??0)),(e||W)&&!((A=$.sourceEvent)!=null&&A.internal)){const B=du($.transform);W==null||W(B),e==null||e($.sourceEvent,B)}}))},[j,F,e,m,s]),q.useEffect(()=>{F&&F.on("end",$=>{if(!$.sourceEvent||$.sourceEvent.internal)return null;const{onViewportChangeEnd:W}=O.getState();if(M.current=!1,O.setState({paneDragging:!1}),s&&Iw(m,U.current??0)&&!P.current&&s($.sourceEvent),P.current=!1,(i||W)&&jI(L.current,$.transform)){const A=du($.transform);L.current=A,clearTimeout(I.current),I.current=setTimeout(()=>{W==null||W(A),i==null||i($.sourceEvent,A)},l?150:0)}})},[F,l,m,i,s]),q.useEffect(()=>{F&&F.filter($=>{const W=G||o,A=u&&$.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&$.button===1&&$.type==="mousedown"&&(Ns($,"react-flow__node")||Ns($,"react-flow__edge")))return!0;if(!m&&!W&&!l&&!h&&!u||j||!h&&$.type==="dblclick"||Ns($,E)&&$.type==="wheel"||Ns($,C)&&($.type!=="wheel"||l&&$.type==="wheel"&&!G)||!u&&$.ctrlKey&&$.type==="wheel"||!W&&!l&&!A&&$.type==="wheel"||!m&&($.type==="mousedown"||$.type==="touchstart")||Array.isArray(m)&&!m.includes($.button)&&$.type==="mousedown")return!1;const B=Array.isArray(m)&&m.includes($.button)||!$.button||$.button<=1;return(!$.ctrlKey||$.type==="wheel")&&B})},[j,F,o,u,l,h,m,p,G]),ae.createElement("div",{className:"react-flow__renderer",ref:T,style:iv},k)},MI=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function PI(){const{userSelectionActive:e,userSelectionRect:n}=Xe(MI,Et);return e&&n?ae.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function Pw(e,n){const i=n.parentNode||n.parentId,s=e.find(o=>o.id===i);if(s){const o=n.position.x+n.width-s.width,u=n.position.y+n.height-s.height;if(o>0||u>0||n.position.x<0||n.position.y<0){if(s.style={...s.style},s.style.width=s.style.width??s.width,s.style.height=s.style.height??s.height,o>0&&(s.style.width+=o),u>0&&(s.style.height+=u),n.position.x<0){const l=Math.abs(n.position.x);s.position.x=s.position.x-l,s.style.width+=l,n.position.x=0}if(n.position.y<0){const l=Math.abs(n.position.y);s.position.y=s.position.y-l,s.style.height+=l,n.position.y=0}s.width=s.style.width,s.height=s.style.height}}}function OI(e,n){if(e.some(s=>s.type==="reset"))return e.filter(s=>s.type==="reset").map(s=>s.item);const i=e.filter(s=>s.type==="add").map(s=>s.item);return n.reduce((s,o)=>{const u=e.filter(c=>c.id===o.id);if(u.length===0)return s.push(o),s;const l={...o};for(const c of u)if(c)switch(c.type){case"select":{l.selected=c.selected;break}case"position":{typeof c.position<"u"&&(l.position=c.position),typeof c.positionAbsolute<"u"&&(l.positionAbsolute=c.positionAbsolute),typeof c.dragging<"u"&&(l.dragging=c.dragging),l.expandParent&&Pw(s,l);break}case"dimensions":{typeof c.dimensions<"u"&&(l.width=c.dimensions.width,l.height=c.dimensions.height),typeof c.updateStyle<"u"&&(l.style={...l.style||{},...c.dimensions}),typeof c.resizing=="boolean"&&(l.resizing=c.resizing),l.expandParent&&Pw(s,l);break}case"remove":return s}return s.push(l),s},i)}function qI(e,n){return OI(e,n)}const ri=(e,n)=>({id:e,type:"select",selected:n});function Ts(e,n){return e.reduce((i,s)=>{const o=n.includes(s.id);return!s.selected&&o?(s.selected=!0,i.push(ri(s.id,!0))):s.selected&&!o&&(s.selected=!1,i.push(ri(s.id,!1))),i},[])}const Xc=(e,n)=>i=>{i.target===n.current&&(e==null||e(i))},LI=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),LE=q.memo(({isSelecting:e,selectionMode:n=Uo.Full,panOnDrag:i,onSelectionStart:s,onSelectionEnd:o,onPaneClick:u,onPaneContextMenu:l,onPaneScroll:c,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:p,children:m})=>{const y=q.useRef(null),x=Nt(),N=q.useRef(0),_=q.useRef(0),S=q.useRef(),{userSelectionActive:b,elementsSelectable:k,dragging:E}=Xe(LI,Et),C=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),N.current=0,_.current=0},I=Q=>{u==null||u(Q),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},O=Q=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){Q.preventDefault();return}l==null||l(Q)},M=c?Q=>c(Q):void 0,P=Q=>{const{resetSelectedElements:j,domNode:G}=x.getState();if(S.current=G==null?void 0:G.getBoundingClientRect(),!k||!e||Q.button!==0||Q.target!==y.current||!S.current)return;const{x:U,y:ne}=si(Q,S.current);j(),x.setState({userSelectionRect:{width:0,height:0,startX:U,startY:ne,x:U,y:ne}}),s==null||s(Q)},T=Q=>{const{userSelectionRect:j,nodeInternals:G,edges:U,transform:ne,onNodesChange:K,onEdgesChange:$,nodeOrigin:W,getNodes:A}=x.getState();if(!e||!S.current||!j)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const B=si(Q,S.current),ue=j.startX??0,z=j.startY??0,X={...j,x:B.x<ue?B.x:ue,y:B.y<z?B.y:z,width:Math.abs(B.x-ue),height:Math.abs(B.y-z)},ee=A(),se=wE(G,X,ne,n===Uo.Partial,!0,W),oe=xE(se,U).map(ge=>ge.id),pe=se.map(ge=>ge.id);if(N.current!==pe.length){N.current=pe.length;const ge=Ts(ee,pe);ge.length&&(K==null||K(ge))}if(_.current!==oe.length){_.current=oe.length;const ge=Ts(U,oe);ge.length&&($==null||$(ge))}x.setState({userSelectionRect:X})},L=Q=>{if(Q.button!==0)return;const{userSelectionRect:j}=x.getState();!b&&j&&Q.target===y.current&&(I==null||I(Q)),x.setState({nodesSelectionActive:N.current>0}),C(),o==null||o(Q)},F=Q=>{b&&(x.setState({nodesSelectionActive:N.current>0}),o==null||o(Q)),C()},J=k&&(e||b);return ae.createElement("div",{className:zt(["react-flow__pane",{dragging:E,selection:e}]),onClick:J?void 0:Xc(I,y),onContextMenu:Xc(O,y),onWheel:Xc(M,y),onMouseEnter:J?void 0:d,onMouseDown:J?P:void 0,onMouseMove:J?T:h,onMouseUp:J?L:void 0,onMouseLeave:J?F:p,ref:y,style:iv},m,ae.createElement(PI,null))});LE.displayName="Pane";function $E(e,n){const i=e.parentNode||e.parentId;if(!i)return!1;const s=n.get(i);return s?s.selected?!0:$E(s,n):!1}function Ow(e,n,i){let s=e;do{if(s!=null&&s.matches(n))return!0;if(s===i.current)return!1;s=s.parentElement}while(s);return!1}function $I(e,n,i,s){return Array.from(e.values()).filter(o=>(o.selected||o.id===s)&&(!o.parentNode||o.parentId||!$E(o,e))&&(o.draggable||n&&typeof o.draggable>"u")).map(o=>{var u,l;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:i.x-(((u=o.positionAbsolute)==null?void 0:u.x)??0),y:i.y-(((l=o.positionAbsolute)==null?void 0:l.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode||o.parentId,parentId:o.parentNode||o.parentId,width:o.width,height:o.height,expandParent:o.expandParent}})}function DI(e,n){return!n||n==="parent"?n:[n[0],[n[1][0]-(e.width||0),n[1][1]-(e.height||0)]]}function DE(e,n,i,s,o=[0,0],u){const l=DI(e,e.extent||s);let c=l;const d=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(d&&e.width&&e.height){const m=i.get(d),{x:y,y:x}=Di(m,o).positionAbsolute;c=m&&Mn(y)&&Mn(x)&&Mn(m.width)&&Mn(m.height)?[[y+e.width*o[0],x+e.height*o[1]],[y+m.width-e.width+e.width*o[0],x+m.height-e.height+e.height*o[1]]]:c}else u==null||u("005",Tr.error005()),c=l;else if(e.extent&&d&&e.extent!=="parent"){const m=i.get(d),{x:y,y:x}=Di(m,o).positionAbsolute;c=[[e.extent[0][0]+y,e.extent[0][1]+x],[e.extent[1][0]+y,e.extent[1][1]+x]]}let h={x:0,y:0};if(d){const m=i.get(d);h=Di(m,o).positionAbsolute}const p=c&&c!=="parent"?Qg(n,c):n;return{position:{x:p.x-h.x,y:p.y-h.y},positionAbsolute:p}}function Qc({nodeId:e,dragItems:n,nodeInternals:i}){const s=n.map(o=>({...i.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?s.find(o=>o.id===e):s[0],s]}const qw=(e,n,i,s)=>{const o=n.querySelectorAll(e);if(!o||!o.length)return null;const u=Array.from(o),l=n.getBoundingClientRect(),c={x:l.width*s[0],y:l.height*s[1]};return u.map(d=>{const h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),position:d.getAttribute("data-handlepos"),x:(h.left-l.left-c.x)/i,y:(h.top-l.top-c.y)/i,...Xg(d)}})};function Ro(e,n,i){return i===void 0?i:s=>{const o=n().nodeInternals.get(e);o&&i(s,{...o})}}function Pg({id:e,store:n,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:u,multiSelectionActive:l,nodeInternals:c,onError:d}=n.getState(),h=c.get(e);if(!h){d==null||d("012",Tr.error012(e));return}n.setState({nodesSelectionActive:!1}),h.selected?(i||h.selected&&l)&&(u({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var p;return(p=s==null?void 0:s.current)==null?void 0:p.blur()})):o([e])}function FI(){const e=Nt();return q.useCallback(({sourceEvent:i})=>{const{transform:s,snapGrid:o,snapToGrid:u}=e.getState(),l=i.touches?i.touches[0].clientX:i.clientX,c=i.touches?i.touches[0].clientY:i.clientY,d={x:(l-s[0])/s[2],y:(c-s[1])/s[2]};return{xSnapped:u?o[0]*Math.round(d.x/o[0]):d.x,ySnapped:u?o[1]*Math.round(d.y/o[1]):d.y,...d}},[])}function Zc(e){return(n,i,s)=>e==null?void 0:e(n,s)}function FE({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:s,nodeId:o,isSelectable:u,selectNodesOnDrag:l}){const c=Nt(),[d,h]=q.useState(!1),p=q.useRef([]),m=q.useRef({x:null,y:null}),y=q.useRef(0),x=q.useRef(null),N=q.useRef({x:0,y:0}),_=q.useRef(null),S=q.useRef(!1),b=q.useRef(!1),k=q.useRef(!1),E=FI();return q.useEffect(()=>{if(e!=null&&e.current){const C=In(e.current),I=({x:P,y:T})=>{const{nodeInternals:L,onNodeDrag:F,onSelectionDrag:J,updateNodePositions:Q,nodeExtent:j,snapGrid:G,snapToGrid:U,nodeOrigin:ne,onError:K}=c.getState();m.current={x:P,y:T};let $=!1,W={x:0,y:0,x2:0,y2:0};if(p.current.length>1&&j){const B=Fu(p.current,ne);W=Bo(B)}if(p.current=p.current.map(B=>{const ue={x:P-B.distance.x,y:T-B.distance.y};U&&(ue.x=G[0]*Math.round(ue.x/G[0]),ue.y=G[1]*Math.round(ue.y/G[1]));const z=[[j[0][0],j[0][1]],[j[1][0],j[1][1]]];p.current.length>1&&j&&!B.extent&&(z[0][0]=B.positionAbsolute.x-W.x+j[0][0],z[1][0]=B.positionAbsolute.x+(B.width??0)-W.x2+j[1][0],z[0][1]=B.positionAbsolute.y-W.y+j[0][1],z[1][1]=B.positionAbsolute.y+(B.height??0)-W.y2+j[1][1]);const X=DE(B,ue,L,z,ne,K);return $=$||B.position.x!==X.position.x||B.position.y!==X.position.y,B.position=X.position,B.positionAbsolute=X.positionAbsolute,B}),!$)return;Q(p.current,!0,!0),h(!0);const A=o?F:Zc(J);if(A&&_.current){const[B,ue]=Qc({nodeId:o,dragItems:p.current,nodeInternals:L});A(_.current,B,ue)}},O=()=>{if(!x.current)return;const[P,T]=uE(N.current,x.current);if(P!==0||T!==0){const{transform:L,panBy:F}=c.getState();m.current.x=(m.current.x??0)-P/L[2],m.current.y=(m.current.y??0)-T/L[2],F({x:P,y:T})&&I(m.current)}y.current=requestAnimationFrame(O)},M=P=>{var ne;const{nodeInternals:T,multiSelectionActive:L,nodesDraggable:F,unselectNodesAndEdges:J,onNodeDragStart:Q,onSelectionDragStart:j}=c.getState();b.current=!0;const G=o?Q:Zc(j);(!l||!u)&&!L&&o&&((ne=T.get(o))!=null&&ne.selected||J()),o&&u&&l&&Pg({id:o,store:c,nodeRef:e});const U=E(P);if(m.current=U,p.current=$I(T,F,U,o),G&&p.current){const[K,$]=Qc({nodeId:o,dragItems:p.current,nodeInternals:T});G(P.sourceEvent,K,$)}};if(n)C.on(".drag",null);else{const P=X2().on("start",T=>{const{domNode:L,nodeDragThreshold:F}=c.getState();F===0&&M(T),k.current=!1;const J=E(T);m.current=J,x.current=(L==null?void 0:L.getBoundingClientRect())||null,N.current=si(T.sourceEvent,x.current)}).on("drag",T=>{var Q,j;const L=E(T),{autoPanOnNodeDrag:F,nodeDragThreshold:J}=c.getState();if(T.sourceEvent.type==="touchmove"&&T.sourceEvent.touches.length>1&&(k.current=!0),!k.current){if(!S.current&&b.current&&F&&(S.current=!0,O()),!b.current){const G=L.xSnapped-(((Q=m==null?void 0:m.current)==null?void 0:Q.x)??0),U=L.ySnapped-(((j=m==null?void 0:m.current)==null?void 0:j.y)??0);Math.sqrt(G*G+U*U)>J&&M(T)}(m.current.x!==L.xSnapped||m.current.y!==L.ySnapped)&&p.current&&b.current&&(_.current=T.sourceEvent,N.current=si(T.sourceEvent,x.current),I(L))}}).on("end",T=>{if(!(!b.current||k.current)&&(h(!1),S.current=!1,b.current=!1,cancelAnimationFrame(y.current),p.current)){const{updateNodePositions:L,nodeInternals:F,onNodeDragStop:J,onSelectionDragStop:Q}=c.getState(),j=o?J:Zc(Q);if(L(p.current,!1,!1),j){const[G,U]=Qc({nodeId:o,dragItems:p.current,nodeInternals:F});j(T.sourceEvent,G,U)}}}).filter(T=>{const L=T.target;return!T.button&&(!i||!Ow(L,`.${i}`,e))&&(!s||Ow(L,s,e))});return C.call(P),()=>{C.on(".drag",null)}}}},[e,n,i,s,u,c,o,l,E]),d}function zE(){const e=Nt();return q.useCallback(i=>{const{nodeInternals:s,nodeExtent:o,updateNodePositions:u,getNodes:l,snapToGrid:c,snapGrid:d,onError:h,nodesDraggable:p}=e.getState(),m=l().filter(k=>k.selected&&(k.draggable||p&&typeof k.draggable>"u")),y=c?d[0]:5,x=c?d[1]:5,N=i.isShiftPressed?4:1,_=i.x*y*N,S=i.y*x*N,b=m.map(k=>{if(k.positionAbsolute){const E={x:k.positionAbsolute.x+_,y:k.positionAbsolute.y+S};c&&(E.x=d[0]*Math.round(E.x/d[0]),E.y=d[1]*Math.round(E.y/d[1]));const{positionAbsolute:C,position:I}=DE(k,E,s,o,void 0,h);k.position=I,k.positionAbsolute=C}return k});u(b,!0,!1)},[])}const Ms={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var To=e=>{const n=({id:i,type:s,data:o,xPos:u,yPos:l,xPosOrigin:c,yPosOrigin:d,selected:h,onClick:p,onMouseEnter:m,onMouseMove:y,onMouseLeave:x,onContextMenu:N,onDoubleClick:_,style:S,className:b,isDraggable:k,isSelectable:E,isConnectable:C,isFocusable:I,selectNodesOnDrag:O,sourcePosition:M,targetPosition:P,hidden:T,resizeObserver:L,dragHandle:F,zIndex:J,isParent:Q,noDragClassName:j,noPanClassName:G,initialized:U,disableKeyboardA11y:ne,ariaLabel:K,rfId:$,hasHandleBounds:W})=>{const A=Nt(),B=q.useRef(null),ue=q.useRef(null),z=q.useRef(M),X=q.useRef(P),ee=q.useRef(s),se=E||k||p||m||y||x,oe=zE(),pe=Ro(i,A.getState,m),ge=Ro(i,A.getState,y),Ae=Ro(i,A.getState,x),ze=Ro(i,A.getState,N),Me=Ro(i,A.getState,_),Ie=ye=>{const{nodeDragThreshold:we}=A.getState();if(E&&(!O||!k||we>0)&&Pg({id:i,store:A,nodeRef:B}),p){const Le=A.getState().nodeInternals.get(i);Le&&p(ye,{...Le})}},be=ye=>{if(!Tg(ye)&&!ne)if(dE.includes(ye.key)&&E){const we=ye.key==="Escape";Pg({id:i,store:A,unselect:we,nodeRef:B})}else k&&h&&Object.prototype.hasOwnProperty.call(Ms,ye.key)&&(A.setState({ariaLiveMessage:`Moved selected node ${ye.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~u}, y: ${~~l}`}),oe({x:Ms[ye.key].x,y:Ms[ye.key].y,isShiftPressed:ye.shiftKey}))};q.useEffect(()=>()=>{ue.current&&(L==null||L.unobserve(ue.current),ue.current=null)},[]),q.useEffect(()=>{if(B.current&&!T){const ye=B.current;(!U||!W||ue.current!==ye)&&(ue.current&&(L==null||L.unobserve(ue.current)),L==null||L.observe(ye),ue.current=ye)}},[T,U,W]),q.useEffect(()=>{const ye=ee.current!==s,we=z.current!==M,Le=X.current!==P;B.current&&(ye||we||Le)&&(ye&&(ee.current=s),we&&(z.current=M),Le&&(X.current=P),A.getState().updateNodeDimensions([{id:i,nodeElement:B.current,forceUpdate:!0}]))},[i,s,M,P]);const Be=FE({nodeRef:B,disabled:T||!k,noDragClassName:j,handleSelector:F,nodeId:i,isSelectable:E,selectNodesOnDrag:O});return T?null:ae.createElement("div",{className:zt(["react-flow__node",`react-flow__node-${s}`,{[G]:k},b,{selected:h,selectable:E,parent:Q,dragging:Be}]),ref:B,style:{zIndex:J,transform:`translate(${c}px,${d}px)`,pointerEvents:se?"all":"none",visibility:U?"visible":"hidden",...S},"data-id":i,"data-testid":`rf__node-${i}`,onMouseEnter:pe,onMouseMove:ge,onMouseLeave:Ae,onContextMenu:ze,onClick:Ie,onDoubleClick:Me,onKeyDown:I?be:void 0,tabIndex:I?0:void 0,role:I?"button":void 0,"aria-describedby":ne?void 0:`${IE}-${$}`,"aria-label":K},ae.createElement(JA,{value:i},ae.createElement(e,{id:i,data:o,type:s,xPos:u,yPos:l,selected:h,isConnectable:C,sourcePosition:M,targetPosition:P,dragging:Be,dragHandle:F,zIndex:J})))};return n.displayName="NodeWrapper",q.memo(n)};const zI=e=>{const n=e.getNodes().filter(i=>i.selected);return{...Fu(n,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function BI({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const s=Nt(),{width:o,height:u,x:l,y:c,transformString:d,userSelectionActive:h}=Xe(zI,Et),p=zE(),m=q.useRef(null);if(q.useEffect(()=>{var N;i||(N=m.current)==null||N.focus({preventScroll:!0})},[i]),FE({nodeRef:m}),h||!o||!u)return null;const y=e?N=>{const _=s.getState().getNodes().filter(S=>S.selected);e(N,_)}:void 0,x=N=>{Object.prototype.hasOwnProperty.call(Ms,N.key)&&p({x:Ms[N.key].x,y:Ms[N.key].y,isShiftPressed:N.shiftKey})};return ae.createElement("div",{className:zt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d}},ae.createElement("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:i?void 0:-1,onKeyDown:i?void 0:x,style:{width:o,height:u,top:c,left:l}}))}var UI=q.memo(BI);const HI=e=>e.nodesSelectionActive,BE=({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:u,onPaneScroll:l,deleteKeyCode:c,onMove:d,onMoveStart:h,onMoveEnd:p,selectionKeyCode:m,selectionOnDrag:y,selectionMode:x,onSelectionStart:N,onSelectionEnd:_,multiSelectionKeyCode:S,panActivationKeyCode:b,zoomActivationKeyCode:k,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:I,panOnScroll:O,panOnScrollSpeed:M,panOnScrollMode:P,zoomOnDoubleClick:T,panOnDrag:L,defaultViewport:F,translateExtent:J,minZoom:Q,maxZoom:j,preventScrolling:G,onSelectionContextMenu:U,noWheelClassName:ne,noPanClassName:K,disableKeyboardA11y:$})=>{const W=Xe(HI),A=Ho(m),B=Ho(b),ue=B||L,z=B||O,X=A||y&&ue!==!0;return RI({deleteKeyCode:c,multiSelectionKeyCode:S}),ae.createElement(II,{onMove:d,onMoveStart:h,onMoveEnd:p,onPaneContextMenu:u,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:I,panOnScroll:z,panOnScrollSpeed:M,panOnScrollMode:P,zoomOnDoubleClick:T,panOnDrag:!A&&ue,defaultViewport:F,translateExtent:J,minZoom:Q,maxZoom:j,zoomActivationKeyCode:k,preventScrolling:G,noWheelClassName:ne,noPanClassName:K},ae.createElement(LE,{onSelectionStart:N,onSelectionEnd:_,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:u,onPaneScroll:l,panOnDrag:ue,isSelecting:!!X,selectionMode:x},e,W&&ae.createElement(UI,{onSelectionContextMenu:U,noPanClassName:K,disableKeyboardA11y:$})))};BE.displayName="FlowRenderer";var VI=q.memo(BE);function WI(e){return Xe(q.useCallback(i=>e?wE(i.nodeInternals,{x:0,y:0,width:i.width,height:i.height},i.transform,!0):i.getNodes(),[e]))}function GI(e){const n={input:To(e.input||RE),default:To(e.default||Mg),output:To(e.output||jE),group:To(e.group||rv)},i={},s=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,u)=>(o[u]=To(e[u]||Mg),o),i);return{...n,...s}}const YI=({x:e,y:n,width:i,height:s,origin:o})=>!i||!s?{x:e,y:n}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:n}:{x:e-i*o[0],y:n-s*o[1]},KI=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),UE=e=>{const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:s,elementsSelectable:o,updateNodeDimensions:u,onError:l}=Xe(KI,Et),c=WI(e.onlyRenderVisibleElements),d=q.useRef(),h=q.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const p=new ResizeObserver(m=>{const y=m.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));u(y)});return d.current=p,p},[]);return q.useEffect(()=>()=>{var p;(p=d==null?void 0:d.current)==null||p.disconnect()},[]),ae.createElement("div",{className:"react-flow__nodes",style:iv},c.map(p=>{var I,O,M;let m=p.type||"default";e.nodeTypes[m]||(l==null||l("003",Tr.error003(m)),m="default");const y=e.nodeTypes[m]||e.nodeTypes.default,x=!!(p.draggable||n&&typeof p.draggable>"u"),N=!!(p.selectable||o&&typeof p.selectable>"u"),_=!!(p.connectable||i&&typeof p.connectable>"u"),S=!!(p.focusable||s&&typeof p.focusable>"u"),b=e.nodeExtent?Qg(p.positionAbsolute,e.nodeExtent):p.positionAbsolute,k=(b==null?void 0:b.x)??0,E=(b==null?void 0:b.y)??0,C=YI({x:k,y:E,width:p.width??0,height:p.height??0,origin:e.nodeOrigin});return ae.createElement(y,{key:p.id,id:p.id,className:p.className,style:p.style,type:m,data:p.data,sourcePosition:p.sourcePosition||Ce.Bottom,targetPosition:p.targetPosition||Ce.Top,hidden:p.hidden,xPos:k,yPos:E,xPosOrigin:C.x,yPosOrigin:C.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!p.selected,isDraggable:x,isSelectable:N,isConnectable:_,isFocusable:S,resizeObserver:h,dragHandle:p.dragHandle,zIndex:((I=p[mt])==null?void 0:I.z)??0,isParent:!!((O=p[mt])!=null&&O.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!p.width&&!!p.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:p.ariaLabel,hasHandleBounds:!!((M=p[mt])!=null&&M.handleBounds)})}))};UE.displayName="NodeRenderer";var XI=q.memo(UE);const QI=(e,n,i)=>i===Ce.Left?e-n:i===Ce.Right?e+n:e,ZI=(e,n,i)=>i===Ce.Top?e-n:i===Ce.Bottom?e+n:e,Lw="react-flow__edgeupdater",$w=({position:e,centerX:n,centerY:i,radius:s=10,onMouseDown:o,onMouseEnter:u,onMouseOut:l,type:c})=>ae.createElement("circle",{onMouseDown:o,onMouseEnter:u,onMouseOut:l,className:zt([Lw,`${Lw}-${c}`]),cx:QI(n,s,e),cy:ZI(i,s,e),r:s,stroke:"transparent",fill:"transparent"}),JI=()=>!0;var Cs=e=>{const n=({id:i,className:s,type:o,data:u,onClick:l,onEdgeDoubleClick:c,selected:d,animated:h,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:x,labelBgPadding:N,labelBgBorderRadius:_,style:S,source:b,target:k,sourceX:E,sourceY:C,targetX:I,targetY:O,sourcePosition:M,targetPosition:P,elementsSelectable:T,hidden:L,sourceHandleId:F,targetHandleId:J,onContextMenu:Q,onMouseEnter:j,onMouseMove:G,onMouseLeave:U,reconnectRadius:ne,onReconnect:K,onReconnectStart:$,onReconnectEnd:W,markerEnd:A,markerStart:B,rfId:ue,ariaLabel:z,isFocusable:X,isReconnectable:ee,pathOptions:se,interactionWidth:oe,disableKeyboardA11y:pe})=>{const ge=q.useRef(null),[Ae,ze]=q.useState(!1),[Me,Ie]=q.useState(!1),be=Nt(),Be=q.useMemo(()=>`url('#${Ag(B,ue)}')`,[B,ue]),ye=q.useMemo(()=>`url('#${Ag(A,ue)}')`,[A,ue]);if(L)return null;const we=Ze=>{var Rt;const{edges:_t,addSelectedEdges:ht,unselectNodesAndEdges:at,multiSelectionActive:dn}=be.getState(),Bt=_t.find(ct=>ct.id===i);Bt&&(T&&(be.setState({nodesSelectionActive:!1}),Bt.selected&&dn?(at({nodes:[],edges:[Bt]}),(Rt=ge.current)==null||Rt.blur()):ht([i])),l&&l(Ze,Bt))},Le=Co(i,be.getState,c),Qe=Co(i,be.getState,Q),et=Co(i,be.getState,j),Ve=Co(i,be.getState,G),Ye=Co(i,be.getState,U),We=(Ze,_t)=>{if(Ze.button!==0)return;const{edges:ht,isValidConnection:at}=be.getState(),dn=_t?k:b,Bt=(_t?J:F)||null,Rt=_t?"target":"source",ct=at||JI,xn=_t,Jt=ht.find(hn=>hn.id===i);Ie(!0),$==null||$(Ze,Jt,Rt);const Tt=hn=>{Ie(!1),W==null||W(hn,Jt,Rt)};kE({event:Ze,handleId:Bt,nodeId:dn,onConnect:hn=>K==null?void 0:K(Jt,hn),isTarget:xn,getState:be.getState,setState:be.setState,isValidConnection:ct,edgeUpdaterType:Rt,onReconnectEnd:Tt})},Ke=Ze=>We(Ze,!0),Qt=Ze=>We(Ze,!1),vt=()=>ze(!0),yt=()=>ze(!1),Zt=!T&&!l,Ct=Ze=>{var _t;if(!pe&&dE.includes(Ze.key)&&T){const{unselectNodesAndEdges:ht,addSelectedEdges:at,edges:dn}=be.getState();Ze.key==="Escape"?((_t=ge.current)==null||_t.blur(),ht({edges:[dn.find(Rt=>Rt.id===i)]})):at([i])}};return ae.createElement("g",{className:zt(["react-flow__edge",`react-flow__edge-${o}`,s,{selected:d,animated:h,inactive:Zt,updating:Ae}]),onClick:we,onDoubleClick:Le,onContextMenu:Qe,onMouseEnter:et,onMouseMove:Ve,onMouseLeave:Ye,onKeyDown:X?Ct:void 0,tabIndex:X?0:void 0,role:X?"button":"img","data-testid":`rf__edge-${i}`,"aria-label":z===null?void 0:z||`Edge from ${b} to ${k}`,"aria-describedby":X?`${ME}-${ue}`:void 0,ref:ge},!Me&&ae.createElement(e,{id:i,source:b,target:k,selected:d,animated:h,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:x,labelBgPadding:N,labelBgBorderRadius:_,data:u,style:S,sourceX:E,sourceY:C,targetX:I,targetY:O,sourcePosition:M,targetPosition:P,sourceHandleId:F,targetHandleId:J,markerStart:Be,markerEnd:ye,pathOptions:se,interactionWidth:oe}),ee&&ae.createElement(ae.Fragment,null,(ee==="source"||ee===!0)&&ae.createElement($w,{position:M,centerX:E,centerY:C,radius:ne,onMouseDown:Ke,onMouseEnter:vt,onMouseOut:yt,type:"source"}),(ee==="target"||ee===!0)&&ae.createElement($w,{position:P,centerX:I,centerY:O,radius:ne,onMouseDown:Qt,onMouseEnter:vt,onMouseOut:yt,type:"target"})))};return n.displayName="EdgeWrapper",q.memo(n)};function eM(e){const n={default:Cs(e.default||ju),straight:Cs(e.bezier||ev),step:Cs(e.step||Jg),smoothstep:Cs(e.step||Du),simplebezier:Cs(e.simplebezier||Zg)},i={},s=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,u)=>(o[u]=Cs(e[u]||ju),o),i);return{...n,...s}}function Dw(e,n,i=null){const s=((i==null?void 0:i.x)||0)+n.x,o=((i==null?void 0:i.y)||0)+n.y,u=(i==null?void 0:i.width)||n.width,l=(i==null?void 0:i.height)||n.height;switch(e){case Ce.Top:return{x:s+u/2,y:o};case Ce.Right:return{x:s+u,y:o+l/2};case Ce.Bottom:return{x:s+u/2,y:o+l};case Ce.Left:return{x:s,y:o+l/2}}}function Fw(e,n){return e?e.length===1||!n?e[0]:n&&e.find(i=>i.id===n)||null:null}const tM=(e,n,i,s,o,u)=>{const l=Dw(i,e,n),c=Dw(u,s,o);return{sourceX:l.x,sourceY:l.y,targetX:c.x,targetY:c.y}};function nM({sourcePos:e,targetPos:n,sourceWidth:i,sourceHeight:s,targetWidth:o,targetHeight:u,width:l,height:c,transform:d}){const h={x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x+i,n.x+o),y2:Math.max(e.y+s,n.y+u)};h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const p=Bo({x:(0-d[0])/d[2],y:(0-d[1])/d[2],width:l/d[2],height:c/d[2]}),m=Math.max(0,Math.min(p.x2,h.x2)-Math.max(p.x,h.x)),y=Math.max(0,Math.min(p.y2,h.y2)-Math.max(p.y,h.y));return Math.ceil(m*y)>0}function zw(e){var s,o,u,l,c;const n=((s=e==null?void 0:e[mt])==null?void 0:s.handleBounds)||null,i=n&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((u=e==null?void 0:e.positionAbsolute)==null?void 0:u.y)<"u";return[{x:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.x)||0,y:((c=e==null?void 0:e.positionAbsolute)==null?void 0:c.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},n,!!i]}const rM=[{level:0,isMaxLevel:!0,edges:[]}];function iM(e,n,i=!1){let s=-1;const o=e.reduce((l,c)=>{var p,m;const d=Mn(c.zIndex);let h=d?c.zIndex:0;if(i){const y=n.get(c.target),x=n.get(c.source),N=c.selected||(y==null?void 0:y.selected)||(x==null?void 0:x.selected),_=Math.max(((p=x==null?void 0:x[mt])==null?void 0:p.z)||0,((m=y==null?void 0:y[mt])==null?void 0:m.z)||0,1e3);h=(d?c.zIndex:0)+(N?_:0)}return l[h]?l[h].push(c):l[h]=[c],s=h>s?h:s,l},{}),u=Object.entries(o).map(([l,c])=>{const d=+l;return{edges:c,level:d,isMaxLevel:d===s}});return u.length===0?rM:u}function sM(e,n,i){const s=Xe(q.useCallback(o=>e?o.edges.filter(u=>{const l=n.get(u.source),c=n.get(u.target);return(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&(c==null?void 0:c.width)&&(c==null?void 0:c.height)&&nM({sourcePos:l.positionAbsolute||{x:0,y:0},targetPos:c.positionAbsolute||{x:0,y:0},sourceWidth:l.width,sourceHeight:l.height,targetWidth:c.width,targetHeight:c.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,n]));return iM(s,n,i)}const oM=({color:e="none",strokeWidth:n=1})=>ae.createElement("polyline",{style:{stroke:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),aM=({color:e="none",strokeWidth:n=1})=>ae.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Bw={[Tu.Arrow]:oM,[Tu.ArrowClosed]:aM};function uM(e){const n=Nt();return q.useMemo(()=>{var o,u;return Object.prototype.hasOwnProperty.call(Bw,e)?Bw[e]:((u=(o=n.getState()).onError)==null||u.call(o,"009",Tr.error009(e)),null)},[e])}const lM=({id:e,type:n,color:i,width:s=12.5,height:o=12.5,markerUnits:u="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const d=uM(n);return d?ae.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:u,orient:c,refX:"0",refY:"0"},ae.createElement(d,{color:i,strokeWidth:l})):null},cM=({defaultColor:e,rfId:n})=>i=>{const s=[];return i.edges.reduce((o,u)=>([u.markerStart,u.markerEnd].forEach(l=>{if(l&&typeof l=="object"){const c=Ag(l,n);s.includes(c)||(o.push({id:c,color:l.color||e,...l}),s.push(c))}}),o),[]).sort((o,u)=>o.id.localeCompare(u.id))},HE=({defaultColor:e,rfId:n})=>{const i=Xe(q.useCallback(cM({defaultColor:e,rfId:n}),[e,n]),(s,o)=>!(s.length!==o.length||s.some((u,l)=>u.id!==o[l].id)));return ae.createElement("defs",null,i.map(s=>ae.createElement(lM,{id:s.id,key:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient})))};HE.displayName="MarkerDefinitions";var fM=q.memo(HE);const dM=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),VE=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:i,rfId:s,edgeTypes:o,noPanClassName:u,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:d,onEdgeMouseLeave:h,onEdgeClick:p,onEdgeDoubleClick:m,onReconnect:y,onReconnectStart:x,onReconnectEnd:N,reconnectRadius:_,children:S,disableKeyboardA11y:b})=>{const{edgesFocusable:k,edgesUpdatable:E,elementsSelectable:C,width:I,height:O,connectionMode:M,nodeInternals:P,onError:T}=Xe(dM,Et),L=sM(n,P,i);return I?ae.createElement(ae.Fragment,null,L.map(({level:F,edges:J,isMaxLevel:Q})=>ae.createElement("svg",{key:F,style:{zIndex:F},width:I,height:O,className:"react-flow__edges react-flow__container"},Q&&ae.createElement(fM,{defaultColor:e,rfId:s}),ae.createElement("g",null,J.map(j=>{const[G,U,ne]=zw(P.get(j.source)),[K,$,W]=zw(P.get(j.target));if(!ne||!W)return null;let A=j.type||"default";o[A]||(T==null||T("011",Tr.error011(A)),A="default");const B=o[A]||o.default,ue=M===Bi.Strict?$.target:($.target??[]).concat($.source??[]),z=Fw(U.source,j.sourceHandle),X=Fw(ue,j.targetHandle),ee=(z==null?void 0:z.position)||Ce.Bottom,se=(X==null?void 0:X.position)||Ce.Top,oe=!!(j.focusable||k&&typeof j.focusable>"u"),pe=j.reconnectable||j.updatable,ge=typeof y<"u"&&(pe||E&&typeof pe>"u");if(!z||!X)return T==null||T("008",Tr.error008(z,j)),null;const{sourceX:Ae,sourceY:ze,targetX:Me,targetY:Ie}=tM(G,z,ee,K,X,se);return ae.createElement(B,{key:j.id,id:j.id,className:zt([j.className,u]),type:A,data:j.data,selected:!!j.selected,animated:!!j.animated,hidden:!!j.hidden,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,style:j.style,source:j.source,target:j.target,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerEnd:j.markerEnd,markerStart:j.markerStart,sourceX:Ae,sourceY:ze,targetX:Me,targetY:Ie,sourcePosition:ee,targetPosition:se,elementsSelectable:C,onContextMenu:l,onMouseEnter:c,onMouseMove:d,onMouseLeave:h,onClick:p,onEdgeDoubleClick:m,onReconnect:y,onReconnectStart:x,onReconnectEnd:N,reconnectRadius:_,rfId:s,ariaLabel:j.ariaLabel,isFocusable:oe,isReconnectable:ge,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth,disableKeyboardA11y:b})})))),S):null};VE.displayName="EdgeRenderer";var hM=q.memo(VE);const pM=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function mM({children:e}){const n=Xe(pM);return ae.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}function gM(e){const n=Ko(),i=q.useRef(!1);q.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const vM={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top},WE=({nodeId:e,handleType:n,style:i,type:s=ii.Bezier,CustomComponent:o,connectionStatus:u})=>{var O,M,P;const{fromNode:l,handleId:c,toX:d,toY:h,connectionMode:p}=Xe(q.useCallback(T=>({fromNode:T.nodeInternals.get(e),handleId:T.connectionHandleId,toX:(T.connectionPosition.x-T.transform[0])/T.transform[2],toY:(T.connectionPosition.y-T.transform[1])/T.transform[2],connectionMode:T.connectionMode}),[e]),Et),m=(O=l==null?void 0:l[mt])==null?void 0:O.handleBounds;let y=m==null?void 0:m[n];if(p===Bi.Loose&&(y=y||(m==null?void 0:m[n==="source"?"target":"source"])),!l||!y)return null;const x=c?y.find(T=>T.id===c):y[0],N=x?x.x+x.width/2:(l.width??0)/2,_=x?x.y+x.height/2:l.height??0,S=(((M=l.positionAbsolute)==null?void 0:M.x)??0)+N,b=(((P=l.positionAbsolute)==null?void 0:P.y)??0)+_,k=x==null?void 0:x.position,E=k?vM[k]:null;if(!k||!E)return null;if(o)return ae.createElement(o,{connectionLineType:s,connectionLineStyle:i,fromNode:l,fromHandle:x,fromX:S,fromY:b,toX:d,toY:h,fromPosition:k,toPosition:E,connectionStatus:u});let C="";const I={sourceX:S,sourceY:b,sourcePosition:k,targetX:d,targetY:h,targetPosition:E};return s===ii.Bezier?[C]=vE(I):s===ii.Step?[C]=jg({...I,borderRadius:0}):s===ii.SmoothStep?[C]=jg(I):s===ii.SimpleBezier?[C]=gE(I):C=`M${S},${b} ${d},${h}`,ae.createElement("path",{d:C,fill:"none",className:"react-flow__connection-path",style:i})};WE.displayName="ConnectionLine";const yM=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function wM({containerStyle:e,style:n,type:i,component:s}){const{nodeId:o,handleType:u,nodesConnectable:l,width:c,height:d,connectionStatus:h}=Xe(yM,Et);return!(o&&u&&c&&l)?null:ae.createElement("svg",{style:e,width:c,height:d,className:"react-flow__edges react-flow__connectionline react-flow__container"},ae.createElement("g",{className:zt(["react-flow__connection",h])},ae.createElement(WE,{nodeId:o,handleType:u,style:n,type:i,CustomComponent:s,connectionStatus:h})))}function Uw(e,n){return q.useRef(null),Nt(),q.useMemo(()=>n(e),[e])}const GE=({nodeTypes:e,edgeTypes:n,onMove:i,onMoveStart:s,onMoveEnd:o,onInit:u,onNodeClick:l,onEdgeClick:c,onNodeDoubleClick:d,onEdgeDoubleClick:h,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:x,onSelectionContextMenu:N,onSelectionStart:_,onSelectionEnd:S,connectionLineType:b,connectionLineStyle:k,connectionLineComponent:E,connectionLineContainerStyle:C,selectionKeyCode:I,selectionOnDrag:O,selectionMode:M,multiSelectionKeyCode:P,panActivationKeyCode:T,zoomActivationKeyCode:L,deleteKeyCode:F,onlyRenderVisibleElements:J,elementsSelectable:Q,selectNodesOnDrag:j,defaultViewport:G,translateExtent:U,minZoom:ne,maxZoom:K,preventScrolling:$,defaultMarkerColor:W,zoomOnScroll:A,zoomOnPinch:B,panOnScroll:ue,panOnScrollSpeed:z,panOnScrollMode:X,zoomOnDoubleClick:ee,panOnDrag:se,onPaneClick:oe,onPaneMouseEnter:pe,onPaneMouseMove:ge,onPaneMouseLeave:Ae,onPaneScroll:ze,onPaneContextMenu:Me,onEdgeContextMenu:Ie,onEdgeMouseEnter:be,onEdgeMouseMove:Be,onEdgeMouseLeave:ye,onReconnect:we,onReconnectStart:Le,onReconnectEnd:Qe,reconnectRadius:et,noDragClassName:Ve,noWheelClassName:Ye,noPanClassName:We,elevateEdgesOnSelect:Ke,disableKeyboardA11y:Qt,nodeOrigin:vt,nodeExtent:yt,rfId:Zt})=>{const Ct=Uw(e,GI),Ze=Uw(n,eM);return gM(u),ae.createElement(VI,{onPaneClick:oe,onPaneMouseEnter:pe,onPaneMouseMove:ge,onPaneMouseLeave:Ae,onPaneContextMenu:Me,onPaneScroll:ze,deleteKeyCode:F,selectionKeyCode:I,selectionOnDrag:O,selectionMode:M,onSelectionStart:_,onSelectionEnd:S,multiSelectionKeyCode:P,panActivationKeyCode:T,zoomActivationKeyCode:L,elementsSelectable:Q,onMove:i,onMoveStart:s,onMoveEnd:o,zoomOnScroll:A,zoomOnPinch:B,zoomOnDoubleClick:ee,panOnScroll:ue,panOnScrollSpeed:z,panOnScrollMode:X,panOnDrag:se,defaultViewport:G,translateExtent:U,minZoom:ne,maxZoom:K,onSelectionContextMenu:N,preventScrolling:$,noDragClassName:Ve,noWheelClassName:Ye,noPanClassName:We,disableKeyboardA11y:Qt},ae.createElement(mM,null,ae.createElement(hM,{edgeTypes:Ze,onEdgeClick:c,onEdgeDoubleClick:h,onlyRenderVisibleElements:J,onEdgeContextMenu:Ie,onEdgeMouseEnter:be,onEdgeMouseMove:Be,onEdgeMouseLeave:ye,onReconnect:we,onReconnectStart:Le,onReconnectEnd:Qe,reconnectRadius:et,defaultMarkerColor:W,noPanClassName:We,elevateEdgesOnSelect:!!Ke,disableKeyboardA11y:Qt,rfId:Zt},ae.createElement(wM,{style:k,type:b,component:E,containerStyle:C})),ae.createElement("div",{className:"react-flow__edgelabel-renderer"}),ae.createElement(XI,{nodeTypes:Ct,onNodeClick:l,onNodeDoubleClick:d,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:x,selectNodesOnDrag:j,onlyRenderVisibleElements:J,noPanClassName:We,noDragClassName:Ve,disableKeyboardA11y:Qt,nodeOrigin:vt,nodeExtent:yt,rfId:Zt})))};GE.displayName="GraphView";var xM=q.memo(GE);const Og=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ti={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Og,nodeExtent:Og,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Bi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:GA,isValidConnection:void 0},_M=()=>uT((e,n)=>({...ti,setNodes:i=>{const{nodeInternals:s,nodeOrigin:o,elevateNodesOnSelect:u}=n();e({nodeInternals:Kc(i,s,o,u)})},getNodes:()=>Array.from(n().nodeInternals.values()),setEdges:i=>{const{defaultEdgeOptions:s={}}=n();e({edges:i.map(o=>({...s,...o}))})},setDefaultNodesAndEdges:(i,s)=>{const o=typeof i<"u",u=typeof s<"u",l=o?Kc(i,new Map,n().nodeOrigin,n().elevateNodesOnSelect):new Map;e({nodeInternals:l,edges:u?s:[],hasDefaultNodes:o,hasDefaultEdges:u})},updateNodeDimensions:i=>{const{onNodesChange:s,nodeInternals:o,fitViewOnInit:u,fitViewOnInitDone:l,fitViewOnInitOptions:c,domNode:d,nodeOrigin:h}=n(),p=d==null?void 0:d.querySelector(".react-flow__viewport");if(!p)return;const m=window.getComputedStyle(p),{m22:y}=new window.DOMMatrixReadOnly(m.transform),x=i.reduce((_,S)=>{const b=o.get(S.id);if(b!=null&&b.hidden)o.set(b.id,{...b,[mt]:{...b[mt],handleBounds:void 0}});else if(b){const k=Xg(S.nodeElement);!!(k.width&&k.height&&(b.width!==k.width||b.height!==k.height||S.forceUpdate))&&(o.set(b.id,{...b,[mt]:{...b[mt],handleBounds:{source:qw(".source",S.nodeElement,y,h),target:qw(".target",S.nodeElement,y,h)}},...k}),_.push({id:b.id,type:"dimensions",dimensions:k}))}return _},[]);OE(o,h);const N=l||u&&!l&&qE(n,{initial:!0,...c});e({nodeInternals:new Map(o),fitViewOnInitDone:N}),(x==null?void 0:x.length)>0&&(s==null||s(x))},updateNodePositions:(i,s=!0,o=!1)=>{const{triggerNodeChanges:u}=n(),l=i.map(c=>{const d={id:c.id,type:"position",dragging:o};return s&&(d.positionAbsolute=c.positionAbsolute,d.position=c.position),d});u(l)},triggerNodeChanges:i=>{const{onNodesChange:s,nodeInternals:o,hasDefaultNodes:u,nodeOrigin:l,getNodes:c,elevateNodesOnSelect:d}=n();if(i!=null&&i.length){if(u){const h=qI(i,c()),p=Kc(h,o,l,d);e({nodeInternals:p})}s==null||s(i)}},addSelectedNodes:i=>{const{multiSelectionActive:s,edges:o,getNodes:u}=n();let l,c=null;s?l=i.map(d=>ri(d,!0)):(l=Ts(u(),i),c=Ts(o,[])),fu({changedNodes:l,changedEdges:c,get:n,set:e})},addSelectedEdges:i=>{const{multiSelectionActive:s,edges:o,getNodes:u}=n();let l,c=null;s?l=i.map(d=>ri(d,!0)):(l=Ts(o,i),c=Ts(u(),[])),fu({changedNodes:c,changedEdges:l,get:n,set:e})},unselectNodesAndEdges:({nodes:i,edges:s}={})=>{const{edges:o,getNodes:u}=n(),l=i||u(),c=s||o,d=l.map(p=>(p.selected=!1,ri(p.id,!1))),h=c.map(p=>ri(p.id,!1));fu({changedNodes:d,changedEdges:h,get:n,set:e})},setMinZoom:i=>{const{d3Zoom:s,maxZoom:o}=n();s==null||s.scaleExtent([i,o]),e({minZoom:i})},setMaxZoom:i=>{const{d3Zoom:s,minZoom:o}=n();s==null||s.scaleExtent([o,i]),e({maxZoom:i})},setTranslateExtent:i=>{var s;(s=n().d3Zoom)==null||s.translateExtent(i),e({translateExtent:i})},resetSelectedElements:()=>{const{edges:i,getNodes:s}=n(),u=s().filter(c=>c.selected).map(c=>ri(c.id,!1)),l=i.filter(c=>c.selected).map(c=>ri(c.id,!1));fu({changedNodes:u,changedEdges:l,get:n,set:e})},setNodeExtent:i=>{const{nodeInternals:s}=n();s.forEach(o=>{o.positionAbsolute=Qg(o.position,i)}),e({nodeExtent:i,nodeInternals:new Map(s)})},panBy:i=>{const{transform:s,width:o,height:u,d3Zoom:l,d3Selection:c,translateExtent:d}=n();if(!l||!c||!i.x&&!i.y)return!1;const h=Cr.translate(s[0]+i.x,s[1]+i.y).scale(s[2]),p=[[0,0],[o,u]],m=l==null?void 0:l.constrain()(h,p,d);return l.transform(c,m),s[0]!==m.x||s[1]!==m.y||s[2]!==m.k},cancelConnection:()=>e({connectionNodeId:ti.connectionNodeId,connectionHandleId:ti.connectionHandleId,connectionHandleType:ti.connectionHandleType,connectionStatus:ti.connectionStatus,connectionStartHandle:ti.connectionStartHandle,connectionEndHandle:ti.connectionEndHandle}),reset:()=>e({...ti})}),Object.is),sv=({children:e})=>{const n=q.useRef(null);return n.current||(n.current=_M()),ae.createElement(FA,{value:n.current},e)};sv.displayName="ReactFlowProvider";const YE=({children:e})=>q.useContext($u)?ae.createElement(ae.Fragment,null,e):ae.createElement(sv,null,e);YE.displayName="ReactFlowWrapper";const SM={input:RE,default:Mg,output:jE,group:rv},bM={default:ju,straight:ev,step:Jg,smoothstep:Du,simplebezier:Zg},kM=[0,0],EM=[15,15],NM={x:0,y:0,zoom:1},CM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},KE=q.forwardRef(({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,className:o,nodeTypes:u=SM,edgeTypes:l=bM,onNodeClick:c,onEdgeClick:d,onInit:h,onMove:p,onMoveStart:m,onMoveEnd:y,onConnect:x,onConnectStart:N,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:b,onNodeMouseEnter:k,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:I,onNodeDoubleClick:O,onNodeDragStart:M,onNodeDrag:P,onNodeDragStop:T,onNodesDelete:L,onEdgesDelete:F,onSelectionChange:J,onSelectionDragStart:Q,onSelectionDrag:j,onSelectionDragStop:G,onSelectionContextMenu:U,onSelectionStart:ne,onSelectionEnd:K,connectionMode:$=Bi.Strict,connectionLineType:W=ii.Bezier,connectionLineStyle:A,connectionLineComponent:B,connectionLineContainerStyle:ue,deleteKeyCode:z="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:ee=!1,selectionMode:se=Uo.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:pe=Ru()?"Meta":"Control",zoomActivationKeyCode:ge=Ru()?"Meta":"Control",snapToGrid:Ae=!1,snapGrid:ze=EM,onlyRenderVisibleElements:Me=!1,selectNodesOnDrag:Ie=!0,nodesDraggable:be,nodesConnectable:Be,nodesFocusable:ye,nodeOrigin:we=kM,edgesFocusable:Le,edgesUpdatable:Qe,elementsSelectable:et,defaultViewport:Ve=NM,minZoom:Ye=.5,maxZoom:We=2,translateExtent:Ke=Og,preventScrolling:Qt=!0,nodeExtent:vt,defaultMarkerColor:yt="#b1b1b7",zoomOnScroll:Zt=!0,zoomOnPinch:Ct=!0,panOnScroll:Ze=!1,panOnScrollSpeed:_t=.5,panOnScrollMode:ht=Li.Free,zoomOnDoubleClick:at=!0,panOnDrag:dn=!0,onPaneClick:Bt,onPaneMouseEnter:Rt,onPaneMouseMove:ct,onPaneMouseLeave:xn,onPaneScroll:Jt,onPaneContextMenu:Tt,children:_n,onEdgeContextMenu:hn,onEdgeDoubleClick:Gi,onEdgeMouseEnter:Zn,onEdgeMouseMove:ui,onEdgeMouseLeave:li,onEdgeUpdate:ci,onEdgeUpdateStart:fi,onEdgeUpdateEnd:Jn,onReconnect:St,onReconnectStart:qn,onReconnectEnd:er,reconnectRadius:hr=10,edgeUpdaterRadius:Ot=10,onNodesChange:tr,onEdgesChange:pr,noDragClassName:Yi="nodrag",noWheelClassName:Ir="nowheel",noPanClassName:Mr="nopan",fitView:qt=!1,fitViewOptions:di,connectOnClick:hi=!0,attributionPosition:Ki,proOptions:Xi,defaultEdgeOptions:Pr,elevateNodesOnSelect:Ln=!0,elevateEdgesOnSelect:pi=!1,disableKeyboardA11y:Qi=!1,autoPanOnConnect:Zi=!0,autoPanOnNodeDrag:rt=!0,connectionRadius:Vs=20,isValidConnection:jt,onError:Or,style:pn,id:nr,nodeDragThreshold:qr,...rr},Yt)=>{const ir=nr||"1";return ae.createElement("div",{...rr,style:{...pn,...CM},ref:Yt,className:zt(["react-flow",o]),"data-testid":"rf__wrapper",id:nr},ae.createElement(YE,null,ae.createElement(xM,{onInit:h,onMove:p,onMoveStart:m,onMoveEnd:y,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:k,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:I,onNodeDoubleClick:O,nodeTypes:u,edgeTypes:l,connectionLineType:W,connectionLineStyle:A,connectionLineComponent:B,connectionLineContainerStyle:ue,selectionKeyCode:X,selectionOnDrag:ee,selectionMode:se,deleteKeyCode:z,multiSelectionKeyCode:pe,panActivationKeyCode:oe,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Me,selectNodesOnDrag:Ie,defaultViewport:Ve,translateExtent:Ke,minZoom:Ye,maxZoom:We,preventScrolling:Qt,zoomOnScroll:Zt,zoomOnPinch:Ct,zoomOnDoubleClick:at,panOnScroll:Ze,panOnScrollSpeed:_t,panOnScrollMode:ht,panOnDrag:dn,onPaneClick:Bt,onPaneMouseEnter:Rt,onPaneMouseMove:ct,onPaneMouseLeave:xn,onPaneScroll:Jt,onPaneContextMenu:Tt,onSelectionContextMenu:U,onSelectionStart:ne,onSelectionEnd:K,onEdgeContextMenu:hn,onEdgeDoubleClick:Gi,onEdgeMouseEnter:Zn,onEdgeMouseMove:ui,onEdgeMouseLeave:li,onReconnect:St??ci,onReconnectStart:qn??fi,onReconnectEnd:er??Jn,reconnectRadius:hr??Ot,defaultMarkerColor:yt,noDragClassName:Yi,noWheelClassName:Ir,noPanClassName:Mr,elevateEdgesOnSelect:pi,rfId:ir,disableKeyboardA11y:Qi,nodeOrigin:we,nodeExtent:vt}),ae.createElement(gI,{nodes:e,edges:n,defaultNodes:i,defaultEdges:s,onConnect:x,onConnectStart:N,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:b,nodesDraggable:be,nodesConnectable:Be,nodesFocusable:ye,edgesFocusable:Le,edgesUpdatable:Qe,elementsSelectable:et,elevateNodesOnSelect:Ln,minZoom:Ye,maxZoom:We,nodeExtent:vt,onNodesChange:tr,onEdgesChange:pr,snapToGrid:Ae,snapGrid:ze,connectionMode:$,translateExtent:Ke,connectOnClick:hi,defaultEdgeOptions:Pr,fitView:qt,fitViewOptions:di,onNodesDelete:L,onEdgesDelete:F,onNodeDragStart:M,onNodeDrag:P,onNodeDragStop:T,onSelectionDrag:j,onSelectionDragStart:Q,onSelectionDragStop:G,noPanClassName:Mr,nodeOrigin:we,rfId:ir,autoPanOnConnect:Zi,autoPanOnNodeDrag:rt,onError:Or,connectionRadius:Vs,isValidConnection:jt,nodeDragThreshold:qr}),ae.createElement(pI,{onSelectionChange:J}),_n,ae.createElement(BA,{proOptions:Xi,position:Ki}),ae.createElement(_I,{rfId:ir,disableKeyboardA11y:Qi})))});KE.displayName="ReactFlow";const RM=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function XE(){return Xe(RM,Et)}const QE=({id:e,x:n,y:i,width:s,height:o,style:u,color:l,strokeColor:c,strokeWidth:d,className:h,borderRadius:p,shapeRendering:m,onClick:y,selected:x})=>{const{background:N,backgroundColor:_}=u||{},S=l||N||_;return ae.createElement("rect",{className:zt(["react-flow__minimap-node",{selected:x},h]),x:n,y:i,rx:p,ry:p,width:s,height:o,fill:S,stroke:c,strokeWidth:d,shapeRendering:m,onClick:y?b=>y(b,e):void 0})};QE.displayName="MiniMapNode";var TM=q.memo(QE);const jM=e=>e.nodeOrigin,AM=e=>e.getNodes().filter(n=>!n.hidden&&n.width&&n.height),Jc=e=>e instanceof Function?e:()=>e;function IM({nodeStrokeColor:e="transparent",nodeColor:n="#e2e2e2",nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:o=2,nodeComponent:u=TM,onClick:l}){const c=Xe(AM,Et),d=Xe(jM),h=Jc(n),p=Jc(e),m=Jc(i),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ae.createElement(ae.Fragment,null,c.map(x=>{const{x:N,y:_}=Di(x,d).positionAbsolute;return ae.createElement(u,{key:x.id,x:N,y:_,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:h(x),borderRadius:s,strokeColor:p(x),strokeWidth:o,shapeRendering:y,onClick:l,id:x.id})}))}var MM=q.memo(IM);const PM=200,OM=150,qM=e=>{const n=e.getNodes(),i={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:i,boundingRect:n.length>0?VA(Fu(n,e.nodeOrigin),i):i,rfId:e.rfId}},LM="react-flow__minimap-desc";function ZE({style:e,className:n,nodeStrokeColor:i="transparent",nodeColor:s="#e2e2e2",nodeClassName:o="",nodeBorderRadius:u=5,nodeStrokeWidth:l=2,nodeComponent:c,maskColor:d="rgb(240, 240, 240, 0.6)",maskStrokeColor:h="none",maskStrokeWidth:p=1,position:m="bottom-right",onClick:y,onNodeClick:x,pannable:N=!1,zoomable:_=!1,ariaLabel:S="React Flow mini map",inversePan:b=!1,zoomStep:k=10,offsetScale:E=5}){const C=Nt(),I=q.useRef(null),{boundingRect:O,viewBB:M,rfId:P}=Xe(qM,Et),T=(e==null?void 0:e.width)??PM,L=(e==null?void 0:e.height)??OM,F=O.width/T,J=O.height/L,Q=Math.max(F,J),j=Q*T,G=Q*L,U=E*Q,ne=O.x-(j-O.width)/2-U,K=O.y-(G-O.height)/2-U,$=j+U*2,W=G+U*2,A=`${LM}-${P}`,B=q.useRef(0);B.current=Q,q.useEffect(()=>{if(I.current){const X=In(I.current),ee=pe=>{const{transform:ge,d3Selection:Ae,d3Zoom:ze}=C.getState();if(pe.sourceEvent.type!=="wheel"||!Ae||!ze)return;const Me=-pe.sourceEvent.deltaY*(pe.sourceEvent.deltaMode===1?.05:pe.sourceEvent.deltaMode?1:.002)*k,Ie=ge[2]*Math.pow(2,Me);ze.scaleTo(Ae,Ie)},se=pe=>{const{transform:ge,d3Selection:Ae,d3Zoom:ze,translateExtent:Me,width:Ie,height:be}=C.getState();if(pe.sourceEvent.type!=="mousemove"||!Ae||!ze)return;const Be=B.current*Math.max(1,ge[2])*(b?-1:1),ye={x:ge[0]-pe.sourceEvent.movementX*Be,y:ge[1]-pe.sourceEvent.movementY*Be},we=[[0,0],[Ie,be]],Le=Cr.translate(ye.x,ye.y).scale(ge[2]),Qe=ze.constrain()(Le,we,Me);ze.transform(Ae,Qe)},oe=oE().on("zoom",N?se:null).on("zoom.wheel",_?ee:null);return X.call(oe),()=>{X.on("zoom",null)}}},[N,_,b,k]);const ue=y?X=>{const ee=Wn(X);y(X,{x:ee[0],y:ee[1]})}:void 0,z=x?(X,ee)=>{const se=C.getState().nodeInternals.get(ee);x(X,se)}:void 0;return ae.createElement(Kg,{position:m,style:e,className:zt(["react-flow__minimap",n]),"data-testid":"rf__minimap"},ae.createElement("svg",{width:T,height:L,viewBox:`${ne} ${K} ${$} ${W}`,role:"img","aria-labelledby":A,ref:I,onClick:ue},S&&ae.createElement("title",{id:A},S),ae.createElement(MM,{onClick:z,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:u,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),ae.createElement("path",{className:"react-flow__minimap-mask",d:`M${ne-U},${K-U}h${$+U*2}v${W+U*2}h${-$-U*2}z
57
- M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fill:d,fillRule:"evenodd",stroke:h,strokeWidth:p,pointerEvents:"none"})))}ZE.displayName="MiniMap";var $M=q.memo(ZE);function DM(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ae.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function FM(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ae.createElement("path",{d:"M0 0h32v4.2H0z"}))}function zM(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ae.createElement("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 BM(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("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 UM(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("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"}))}const js=({children:e,className:n,...i})=>ae.createElement("button",{type:"button",className:zt(["react-flow__controls-button",n]),...i},e);js.displayName="ControlButton";const HM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),JE=({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:u,onZoomOut:l,onFitView:c,onInteractiveChange:d,className:h,children:p,position:m="bottom-left"})=>{const y=Nt(),[x,N]=q.useState(!1),{isInteractive:_,minZoomReached:S,maxZoomReached:b}=Xe(HM,Et),{zoomIn:k,zoomOut:E,fitView:C}=Ko();if(q.useEffect(()=>{N(!0)},[]),!x)return null;const I=()=>{k(),u==null||u()},O=()=>{E(),l==null||l()},M=()=>{C(o),c==null||c()},P=()=>{y.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),d==null||d(!_)};return ae.createElement(Kg,{className:zt(["react-flow__controls",h]),position:m,style:e,"data-testid":"rf__controls"},n&&ae.createElement(ae.Fragment,null,ae.createElement(js,{onClick:I,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},ae.createElement(DM,null)),ae.createElement(js,{onClick:O,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},ae.createElement(FM,null))),i&&ae.createElement(js,{className:"react-flow__controls-fitview",onClick:M,title:"fit view","aria-label":"fit view"},ae.createElement(zM,null)),s&&ae.createElement(js,{className:"react-flow__controls-interactive",onClick:P,title:"toggle interactivity","aria-label":"toggle interactivity"},_?ae.createElement(UM,null):ae.createElement(BM,null)),p)};JE.displayName="Controls";var VM=q.memo(JE),Yn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Yn||(Yn={}));function WM({color:e,dimensions:n,lineWidth:i}){return ae.createElement("path",{stroke:e,strokeWidth:i,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function GM({color:e,radius:n}){return ae.createElement("circle",{cx:n,cy:n,r:n,fill:e})}const YM={[Yn.Dots]:"#91919a",[Yn.Lines]:"#eee",[Yn.Cross]:"#e2e2e2"},KM={[Yn.Dots]:1,[Yn.Lines]:1,[Yn.Cross]:6},XM=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function eN({id:e,variant:n=Yn.Dots,gap:i=20,size:s,lineWidth:o=1,offset:u=2,color:l,style:c,className:d}){const h=q.useRef(null),{transform:p,patternId:m}=Xe(XM,Et),y=l||YM[n],x=s||KM[n],N=n===Yn.Dots,_=n===Yn.Cross,S=Array.isArray(i)?i:[i,i],b=[S[0]*p[2]||1,S[1]*p[2]||1],k=x*p[2],E=_?[k,k]:b,C=N?[k/u,k/u]:[E[0]/u,E[1]/u];return ae.createElement("svg",{className:zt(["react-flow__background",d]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:h,"data-testid":"rf__background"},ae.createElement("pattern",{id:m+e,x:p[0]%b[0],y:p[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`},N?ae.createElement(GM,{color:y,radius:k/u}):ae.createElement(WM,{dimensions:E,color:y,lineWidth:o})),ae.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`}))}eN.displayName="Background";var QM=q.memo(eN);function tN(){return{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreateTokens:0}}function nN(e,n=0){if(!e||typeof e!="object"||n>6)return null;const i=e;if(typeof i.input_tokens=="number"||typeof i.output_tokens=="number"||typeof i.cache_read_input_tokens=="number"||typeof i.cache_creation_input_tokens=="number")return{inputTokens:Number(i.input_tokens??0),outputTokens:Number(i.output_tokens??0),cacheReadTokens:Number(i.cache_read_input_tokens??0),cacheCreateTokens:Number(i.cache_creation_input_tokens??0)};for(const s of Object.values(i)){const o=nN(s,n+1);if(o)return o}return null}function ZM(e,n){e.inputTokens+=n.inputTokens,e.outputTokens+=n.outputTokens,e.cacheReadTokens+=n.cacheReadTokens,e.cacheCreateTokens+=n.cacheCreateTokens}const JM=/^(?:claude[-_]|gpt[-_]|o\d|codex[-_])/i;function rN(e,n=0){if(!e||typeof e!="object"||n>6)return null;const i=e;if(typeof i.model=="string"&&JM.test(i.model))return i.model;for(const s of Object.values(i)){const o=rN(s,n+1);if(o)return o}return null}function qg(){return{agents:new Map,toolIndex:new Map,toolOwner:new Map,activeSubagentStack:new Map,lastSeq:0,totalEvents:0}}function oi(e){if(!e)return;const n=e.replace(/\\/g,"/").split("/").filter(Boolean);return n[n.length-1]}function ov(e,n){return`${e}::${n}`}function Au(e){return e.agent_type??e.subagent_type??"subagent"}function Lg(e){return e.agent_id?e.agent_id:e.parent_tool_use_id?e.parent_tool_use_id:null}function qo(e,n,i,s){const o=n;let u=e.agents.get(o);return u||(u={id:o,sessionId:n,label:"session",kind:"root",state:"active",startedAt:i,tools:[],prompts:[],toolCount:0,childCount:0,synthetic:s,inFlightTool:null,usage:tN()},e.agents.set(o,u),u)}function iN(e,n,i,s){const o=ov(n,i),u=e.agents.get(o);if(!u)return null;!u.cwd&&s.cwd&&(u.cwd=s.cwd,u.cwdBasename=oi(s.cwd));const l=Au(s);return l&&(u.label==="subagent"||!u.label)&&(u.label=l),u}function Hw(e,n,i){const s=n.session_id??"unknown",o=Lg(n);if(o){const d=iN(e,s,o,n);if(d)return d}const u=e.activeSubagentStack.get(s),l=u&&u.length>0?u[u.length-1]:null;if(l){const d=e.agents.get(ov(s,l));if(d)return!d.cwd&&n.cwd&&(d.cwd=n.cwd,d.cwdBasename=oi(n.cwd)),d}const c=qo(e,s,i,!1);return c.synthetic&&(c.synthetic=!1,c.startedAt=i),!c.cwd&&n.cwd&&(c.cwd=n.cwd,c.cwdBasename=oi(n.cwd)),c.label==="session"&&n.cwd&&(c.label=oi(n.cwd)??"session"),c}function eP(e,n,i,s,o){const u=ov(n,i),l=qo(e,n,o,!0);let c=e.agents.get(u);if(c){!c.cwd&&s.cwd&&(c.cwd=s.cwd,c.cwdBasename=oi(s.cwd));const d=Au(s);return d&&(c.label==="subagent"||!c.label)&&(c.label=d),c}return c={id:u,sessionId:n,label:Au(s),kind:"subagent",parentId:l.id,state:"active",startedAt:o,tools:[],prompts:[],cwd:s.cwd,cwdBasename:oi(s.cwd),toolCount:0,childCount:0,inFlightTool:null,usage:tN()},e.agents.set(u,c),l.childCount+=1,c}function tP(e,n,i){const s=e.activeSubagentStack.get(n)??[];s.push(i),e.activeSubagentStack.set(n,s)}function nP(e,n,i){const s=e.activeSubagentStack.get(n);if(s){for(let o=s.length-1;o>=0;o--)if(s[o]===i){s.splice(o,1);break}s.length===0&&e.activeSubagentStack.delete(n)}}function ef(e,n=80){if(e==null)return"";if(typeof e=="string")return e.length>n?e.slice(0,n-1)+"…":e;try{const i=JSON.stringify(e);return i.length>n?i.slice(0,n-1)+"…":i}catch{return String(e)}}function Io(e){let n=null;for(let i=e.tools.length-1;i>=0;i--){const s=e.tools[i];if(s.endedAt==null){n=s;break}}e.inFlightTool=n}function rP(e,n,i,s){if(e.agents.size<=i)return!1;const o=[];for(const[l,c]of e.agents)c.state==="done"&&c.endedAt!=null&&n-c.endedAt>s&&o.push({id:l,endedAt:c.endedAt});if(o.length===0)return!1;o.sort((l,c)=>l.endedAt-c.endedAt);let u=0;for(const l of o){if(e.agents.size<=i)break;e.agents.delete(l.id),u++}return u>0}function iP(e,n,i,s){const o=new Map;for(const[h,p]of e.agents){let m=o.get(p.sessionId);m||(m={ids:[],endedAt:0,live:!1},o.set(p.sessionId,m)),m.ids.push(h),p.state==="done"&&p.endedAt!=null?m.endedAt=Math.max(m.endedAt,p.endedAt):m.live=!0}const u=[...o.values()].filter(h=>!h.live&&h.endedAt>0&&n-h.endedAt>s).sort((h,p)=>h.endedAt-p.endedAt);let c=[...o.values()].filter(h=>!h.live).length-i;if(c<=0)return!1;let d=!1;for(const h of u){if(c<=0)break;for(const p of h.ids)e.agents.delete(p);c--,d=!0}return d}function sP(e,n,i){let s=!1;for(const o of e.agents.values()){let u=!1;for(const l of o.tools)l.endedAt==null&&n-l.startedAt>i&&(l.endedAt=l.startedAt+i,l.ok=!1,l.errorPreview="stale (no PostToolUse received)",e.toolIndex.delete(l.id),e.toolOwner.delete(l.id),u=!0,s=!0);u&&Io(o)}return s}function Vw(e,n){if(n.seq<=e.lastSeq)return e;const i=n.payload??{},s=n.receivedAt,o=i.hook_event_name??"Unknown";if(o==="__clear")return{...qg(),lastSeq:n.seq};e.totalEvents+=1,e.lastSeq=n.seq;const u=i.session_id??"unknown";if(o==="ModelObserved"){const d=typeof i.model=="string"?i.model:null;if(d){const p=e.agents.get(u);p&&(p.model=d)}const h=i.subagentModels;if(h&&typeof h=="object")for(const[p,m]of Object.entries(h)){if(typeof m!="string")continue;const y=`${u}::${p}`,x=e.agents.get(y);x&&(x.model=m)}return e}if(o==="ContextObserved"){const d=i.context??null;if(d){const h=e.agents.get(u);h&&(h.context={msgsUser:Number(d.msgsUser??0),msgsAssistant:Number(d.msgsAssistant??0),toolUses:Number(d.toolUses??0),toolResults:Number(d.toolResults??0),systemReminders:Number(d.systemReminders??0),currentContextTokens:Number(d.currentContextTokens??0),claudeMdFiles:Array.isArray(d.claudeMdFiles)?d.claudeMdFiles:[]})}return e}if(o==="UsageObserved"){const d=i.usage??null;if(d){const h=e.agents.get(u);h&&(h.usage.inputTokens=Number(d.input_tokens??0),h.usage.outputTokens=Number(d.output_tokens??0),h.usage.cacheReadTokens=Number(d.cache_read_input_tokens??d.cached_input_tokens??0),h.usage.cacheCreateTokens=Number(d.cache_creation_input_tokens??0),typeof d.reasoning_output_tokens=="number"&&(h.usage.reasoningOutputTokens=Number(d.reasoning_output_tokens)))}return e}const l=Hw(e,i,s);l.provider||(l.provider=i.provider==="codex"?"codex":"claude"),typeof i.model_context_window=="number"&&i.model_context_window>0&&(l.contextWindow=i.model_context_window);const c=rN(i);switch(c&&(l.model=c),o){case"SessionStart":{const d=qo(e,u,s,!1);d.synthetic=!1,d.state="active",d.startedAt=d.startedAt||s,!d.cwd&&i.cwd&&(d.cwd=i.cwd,d.cwdBasename=oi(i.cwd)),d.label==="session"&&i.cwd&&(d.label=oi(i.cwd)??"session");break}case"UserPromptSubmit":{for(const m of e.agents.values())m.sessionId===u&&m.kind==="subagent"&&m.state==="done"&&m.exitAt==null&&m.endedAt!=null&&m.endedAt<s&&(m.exitAt=s);const d=qo(e,u,s,!1);d.state="active",d.endedAt=void 0,d.exitAt=void 0;const h=Hw(e,i,s);h.state="active",h.exitAt=void 0,h.endedAt=void 0;const p=(typeof i.prompt=="string"?i.prompt:typeof i.message=="string"?i.message:"")??"";p&&(h.prompts.push({at:s,text:p}),h.firstPrompt||(h.firstPrompt=ef(p,120)));break}case"PreToolUse":{const d=i.tool_use_id??`${l.id}:${l.toolCount}`,h={id:d,name:i.tool_name??"?",input:i.tool_input,inputPreview:ef(i.tool_input),agentId:l.id,startedAt:s};l.tools.push(h),l.toolCount+=1,l.state="active",e.toolIndex.set(d,h),e.toolOwner.set(d,l.id),Io(l);break}case"PostToolUse":case"PostToolUseFailure":{const d=i.tool_use_id;if(!d)break;let h=e.toolIndex.get(d),p=!1;if(!h)for(const x of e.agents.values()){const N=x.tools.find(_=>_.id===d);if(N){h=N,p=!0;break}}if(!h)break;h.endedAt=s,h.ok=o==="PostToolUse",h.response=i.tool_response,o==="PostToolUseFailure"?h.errorPreview=ef(i.tool_response):p&&(h.errorPreview=void 0);const m=nN(i.tool_response);m&&(h.usage=m),e.toolIndex.delete(d);const y=e.toolOwner.get(d)??h.agentId;if(e.toolOwner.delete(d),y){const x=e.agents.get(y);x&&(m&&ZM(x.usage,m),Io(x))}break}case"SubagentStart":{const d=Lg(i);if(!d)break;const h=eP(e,u,d,i,s);h.state="active",h.startedAt=h.startedAt||s,h.exitAt=void 0,h.endedAt=void 0;const p=Au(i);p&&(h.label=p),tP(e,u,d);break}case"SubagentStop":{const d=Lg(i);if(!d)break;const h=iN(e,u,d,i);if(!h)break;h.state="done",h.endedAt=s,Io(h),nP(e,u,d);break}case"Stop":case"SessionEnd":{const d=qo(e,u,s,!1);d.state="done",d.endedAt=s,Io(d);break}}return e}function av(e){let n=5381;for(let i=0;i<e.length;i++)n=(n<<5)+n^e.charCodeAt(i);return Math.abs(n)%360}const oP=Date.UTC(2026,8,1);function aP(){return Date.now()<oP?{input:2,output:10,cacheRead:.2,cacheWrite:2.5}:{input:3,output:15,cacheRead:.3,cacheWrite:3.75}}const uP=[{match:/^claude[-_](fable|mythos)[-_]5\b/i,rates:{input:10,output:50,cacheRead:1,cacheWrite:12.5}},{match:/^claude[-_]opus[-_]5\b/i,rates:{input:5,output:25,cacheRead:.5,cacheWrite:6.25}},{match:/^claude[-_]sonnet[-_]5\b/i,rates:aP()},{match:/^claude[-_]opus[-_]4[-_.](?:5|6|7|8)\b/i,rates:{input:5,output:25,cacheRead:.5,cacheWrite:6.25}},{match:/^claude[-_]opus[-_]4(?:[-_.]1)?\b/i,rates:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}},{match:/^claude[-_]sonnet[-_]4[-_.](?:5|6)\b/i,rates:{input:3,output:15,cacheRead:.3,cacheWrite:3.75}},{match:/^claude[-_]sonnet[-_]4\b/i,rates:{input:3,output:15,cacheRead:.3,cacheWrite:3.75}},{match:/^claude[-_]haiku[-_]4[-_.]5\b/i,rates:{input:1,output:5,cacheRead:.1,cacheWrite:1.25}},{match:/^claude[-_]haiku[-_]3[-_.]5\b/i,rates:{input:.8,output:4,cacheRead:.08,cacheWrite:1}},{match:/^gpt[-_]5[-_.]6[-_]cyber/i,rates:{input:12.5,output:75,cacheRead:1.25,cacheWrite:0}},{match:/^gpt[-_]5[-_.]6[-_]luna/i,rates:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25}},{match:/^gpt[-_]5[-_.]6[-_]terra/i,rates:{input:2,output:12,cacheRead:.2,cacheWrite:2.5}},{match:/^gpt[-_]5[-_.]6(?:[-_]sol)?\b/i,rates:{input:5,output:30,cacheRead:.5,cacheWrite:6.25}},{match:/^gpt[-_]5[-_.]5[-_]pro/i,rates:{input:30,output:180,cacheRead:30,cacheWrite:0}},{match:/^gpt[-_]5[-_.]5\b/i,rates:{input:5,output:30,cacheRead:.5,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4[-_]pro/i,rates:{input:30,output:180,cacheRead:3,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4[-_]mini/i,rates:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4[-_]nano/i,rates:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4\b/i,rates:{input:2.5,output:15,cacheRead:.25,cacheWrite:0}},{match:/^gpt[-_]5[-_.]3[-_]codex/i,rates:{input:1.75,output:14,cacheRead:.175,cacheWrite:0}},{match:/^gpt[-_]5[-_.]2[-_]pro/i,rates:{input:21,output:168,cacheRead:21,cacheWrite:0}},{match:/^gpt[-_]5[-_.]2\b/i,rates:{input:1.75,output:14,cacheRead:.175,cacheWrite:0}},{match:/^codex[-_]mini/i,rates:{input:1.5,output:6,cacheRead:.375,cacheWrite:0}},{match:/^o1[-_]pro/i,rates:{input:150,output:600,cacheRead:150,cacheWrite:0}},{match:/^o1\b/i,rates:{input:15,output:60,cacheRead:7.5,cacheWrite:0}},{match:/^o3[-_]mini/i,rates:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0}},{match:/^o3[-_]pro/i,rates:{input:20,output:80,cacheRead:20,cacheWrite:0}},{match:/^o4[-_]mini/i,rates:{input:1.1,output:4.4,cacheRead:.275,cacheWrite:0}},{match:/^o3\b/i,rates:{input:2,output:8,cacheRead:.5,cacheWrite:0}}];function lP(e){return e?/^(?:gpt[-_]|codex[-_]|o\d)/i.test(e):!1}function uv(e){if(!e)return null;for(const n of uP)if(n.match.test(e))return n.rates;return null}const cP=272e3,fP=/^gpt[-_]5[-_.](?:6(?![-_]cyber)|5|4)/i;function dP(e,n){return!e||n<=cP?{input:1,output:1}:fP.test(e)?{input:2,output:1.5}:{input:1,output:1}}function cn(e,n){const i=uv(n);if(!i)return{input:0,output:0,cacheRead:0,cacheWrite:0,total:0};const s=lP(n),o=s?Math.max(0,e.inputTokens-e.cacheReadTokens):e.inputTokens,u=s?dP(n,e.inputTokens):{input:1,output:1},l=o*i.input*u.input/1e6,c=e.outputTokens*i.output*u.output/1e6,d=e.cacheReadTokens*i.cacheRead*u.input/1e6,h=e.cacheCreateTokens*i.cacheWrite*u.input/1e6;return{input:l,output:c,cacheRead:d,cacheWrite:h,total:l+c+d+h}}const Ww=2e5,hP=1e6,pP=[/\[1m\]/i,/^claude[-_]opus[-_]5\b/i,/^claude[-_]sonnet[-_]5\b/i,/^claude[-_]opus[-_]4[-_.](?:5|6|7|8)\b/i,/^claude[-_]sonnet[-_]4[-_.]6\b/i,/^claude[-_](fable|mythos)[-_]5\b/i],mP=[{match:/^gpt[-_]5[-_.]6[-_]cyber/i,window:4e5},{match:/^gpt[-_]5[-_.]6/i,window:105e4},{match:/^gpt[-_]5[-_.]5/i,window:105e4},{match:/^gpt[-_]5[-_.]4[-_](?:mini|nano)/i,window:4e5},{match:/^gpt[-_]5[-_.]4/i,window:105e4},{match:/^gpt[-_]5[-_.]3[-_]codex[-_]spark/i,window:128e3},{match:/^gpt[-_]5[-_.]3[-_]codex/i,window:4e5},{match:/^gpt[-_]5[-_.]2/i,window:4e5},{match:/^gpt[-_]5/i,window:4e5},{match:/^codex[-_]mini/i,window:2e5},{match:/^o\d/i,window:2e5}];function sN(e){if(!e)return Ww;for(const n of pP)if(n.test(e))return hP;for(const n of mP)if(n.match.test(e))return n.window;return Ww}function Fe(e){return e<=0?"—":e<.005?"<1¢":e<1?`${(e*100).toFixed(e<.1?1:0)}¢`:e<100?`$${e.toFixed(2)}`:e<1e4?`$${e.toFixed(0)}`:`$${(e/1e3).toFixed(1)}k`}function Iu(e,n){if(e<=0||n<10)return null;const i=e/n,s=i*60;return s>=.01?`${Fe(s)}/min`:`${Fe(i*3600)}/hr`}function An(e){return e.toLocaleString()}function gP(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function vP({agent:e,onClose:n}){var h;const i=e.context,s=e.usage,o=(i==null?void 0:i.currentContextTokens)??0,u=sN(e.model),l=Math.min(100,o/u*100),c=cn(s,e.model),d=s.inputTokens+s.cacheReadTokens+s.cacheCreateTokens;return v.jsx("div",{className:"ctx-modal-backdrop",onClick:n,role:"presentation",children:v.jsxs("div",{className:"ctx-modal",onClick:p=>p.stopPropagation(),role:"dialog","aria-label":"Context breakdown",children:[v.jsxs("header",{className:"ctx-modal-head",children:[v.jsxs("div",{children:[v.jsxs("div",{className:"ctx-modal-title",children:["Context · ",e.label]}),v.jsx("div",{className:"ctx-modal-sub",children:"approximation — CC's /context isn't hook-exposed"})]}),v.jsx("button",{className:"ctx-modal-close",onClick:n,"aria-label":"Close",children:"×"})]}),v.jsxs("section",{className:"ctx-window-row",children:[v.jsx("div",{className:"ctx-window-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(l),children:v.jsx("div",{className:"ctx-window-fill",style:{width:`${l}%`}})}),v.jsxs("div",{className:"ctx-window-meta",children:[v.jsxs("span",{className:"ctx-window-pct",children:[l.toFixed(1),"%"]}),v.jsxs("span",{className:"ctx-window-num",children:[An(o)," / ",An(u)," tok (current turn)"]})]})]}),v.jsx("h3",{className:"ctx-section-title",children:"Cumulative usage · whole session"}),v.jsxs("div",{className:"ctx-grid",children:[v.jsx(Vn,{label:"input tokens",val:An(s.inputTokens)}),v.jsx(Vn,{label:"output tokens",val:An(s.outputTokens)}),v.jsx(Vn,{label:"cache reads",val:An(s.cacheReadTokens)}),v.jsx(Vn,{label:"cache writes",val:An(s.cacheCreateTokens)}),v.jsx(Vn,{label:"cumulative total",val:An(d)}),v.jsx(Vn,{label:"estimated cost",val:Fe(c.total),accent:!0})]}),v.jsx("h3",{className:"ctx-section-title",children:"Transcript composition"}),v.jsxs("div",{className:"ctx-grid",children:[v.jsx(Vn,{label:"user messages",val:An((i==null?void 0:i.msgsUser)??0)}),v.jsx(Vn,{label:"assistant messages",val:An((i==null?void 0:i.msgsAssistant)??0)}),v.jsx(Vn,{label:"tool uses",val:An((i==null?void 0:i.toolUses)??0)}),v.jsx(Vn,{label:"tool results",val:An((i==null?void 0:i.toolResults)??0)}),v.jsx(Vn,{label:"system-reminders",val:An((i==null?void 0:i.systemReminders)??0)})]}),v.jsx("h3",{className:"ctx-section-title",children:"CLAUDE.md files in scope"}),(((h=i==null?void 0:i.claudeMdFiles)==null?void 0:h.length)??0)===0?v.jsx("div",{className:"ctx-empty",children:"No CLAUDE.md files found on the path from cwd to ~/.claude."}):v.jsx("ul",{className:"ctx-md-list",children:i.claudeMdFiles.map(p=>v.jsxs("li",{children:[v.jsx("span",{className:"ctx-md-path",title:p.path,children:p.path}),v.jsx("span",{className:"ctx-md-size",children:gP(p.bytes)})]},p.path))})]})})}function Vn({label:e,val:n,accent:i}){return v.jsxs("div",{className:`ctx-row${i?" accent":""}`,children:[v.jsx("span",{className:"ctx-row-label",children:e}),v.jsx("span",{className:"ctx-row-val",children:n})]})}function yP({currentContextTokens:e,modelId:n,size:i=26,onClick:s,title:o}){const u=sN(n),l=Math.min(1,e/u),c=i/2-3,d=i/2,h=2*Math.PI*c,p=h*l,m=l>.9?"var(--err)":l>.7?"var(--inflight)":"var(--accent)";return v.jsx("button",{type:"button",className:"ctx-donut",onClick:s,title:o??`context: ${e.toLocaleString()} / ${u.toLocaleString()} (${(l*100).toFixed(1)}%)`,"aria-label":"Show context breakdown",children:v.jsxs("svg",{width:i,height:i,viewBox:`0 0 ${i} ${i}`,children:[v.jsx("circle",{cx:d,cy:d,r:c,stroke:"var(--line)",strokeWidth:"2.5",fill:"none"}),v.jsx("circle",{cx:d,cy:d,r:c,stroke:m,strokeWidth:"2.5",fill:"none",strokeDasharray:`${p} ${h-p}`,strokeDashoffset:h/4,strokeLinecap:"round",style:{transition:"stroke-dasharray 400ms ease"}}),v.jsx("text",{x:d,y:d+3,textAnchor:"middle",fontSize:"8",fill:"var(--text)",fontWeight:"600",children:Math.round(l*100)})]})})}function wP(e,n){const i=uv(n);if(!i)return"no rates for this model";const s=l=>l.toLocaleString(),o=l=>`$${l}/MTok`,u=cn(e,n);return[`model: ${n}`,`input ${s(e.inputTokens).padStart(14)} × ${o(i.input).padEnd(11)} = ${Fe(u.input)}`,`output ${s(e.outputTokens).padStart(14)} × ${o(i.output).padEnd(11)} = ${Fe(u.output)}`,`cache r ${s(e.cacheReadTokens).padStart(14)} × ${o(i.cacheRead).padEnd(11)} = ${Fe(u.cacheRead)}`,`cache w ${s(e.cacheCreateTokens).padStart(14)} × ${o(i.cacheWrite).padEnd(11)} = ${Fe(u.cacheWrite)}`,"─────────────────────────────────────────",`total = ${Fe(u.total)}`].join(`
58
- `)}function xP(e,n,i){const s=(n??i)-e;if(s<1e3)return`${Math.max(0,s)}ms`;const o=Math.floor(s/1e3);if(o<60)return`${o}s`;const u=Math.floor(o/60),l=o%60;return`${u}m ${String(l).padStart(2,"0")}s`}function _P({data:e,selected:n}){var h;const i=e.now??Date.now(),s=["agent-node",`state-${e.state}`,e.synthetic?"synthetic":"",n?"selected":""].filter(Boolean).join(" "),o=e.tools.filter(p=>!p.endedAt).length,l=`hsl(${av(e.sessionId)} 70% 60%)`,c=((h=e.context)==null?void 0:h.currentContextTokens)??0,d=e.kind==="root"&&c>0;return v.jsxs("div",{className:s,style:{"--accent":l},children:[v.jsx("span",{className:"accent-stripe"}),v.jsx(Ds,{type:"target",position:Ce.Left,style:{background:"transparent",border:"none"}}),v.jsxs("div",{className:"head",children:[v.jsxs("div",{className:"title",children:[v.jsx(SP,{state:e.state}),v.jsx("span",{className:"label",title:e.cwd,children:e.label}),e.synthetic&&v.jsx("span",{className:"synth-tag",title:"No SessionStart captured — synthesised",children:"?"})]}),v.jsxs("div",{className:"head-right",children:[d&&e.onOpenContext&&v.jsx(yP,{currentContextTokens:c,modelId:e.model,onClick:()=>e.onOpenContext(e.sessionId)}),v.jsx("div",{className:"time",title:`Started ${new Date(e.startedAt).toLocaleTimeString()}`,children:xP(e.startedAt,e.endedAt,i)})]})]}),v.jsxs("div",{className:"sub",children:[e.kind==="root"?"session":"subagent",e.childCount>0&&v.jsxs("span",{className:"spawn-badge",title:`${e.childCount} subagents spawned`,children:["→ ",e.childCount]}),e.cwdBasename&&e.kind==="subagent"?` · ${e.cwdBasename}`:"",e.model&&v.jsx("span",{className:"model-chip",title:e.model,children:Xo(e.model)})]}),e.tools.length>0&&v.jsx(kP,{tools:e.tools,now:i}),v.jsxs("div",{className:"meta",children:[v.jsxs("span",{children:[v.jsx("b",{children:e.toolCount})," tools"]}),o>0&&v.jsxs("span",{className:"inflight-meta",children:[v.jsx("b",{children:o})," in-flight"]}),e.usage.inputTokens+e.usage.outputTokens>0&&v.jsxs("span",{className:"tokens-meta",title:`in:${e.usage.inputTokens} out:${e.usage.outputTokens} cache-r:${e.usage.cacheReadTokens} cache-c:${e.usage.cacheCreateTokens}${(e.usage.reasoningOutputTokens??0)>0?` reasoning:${e.usage.reasoningOutputTokens}`:""}`,children:[v.jsx("b",{children:bP(e.usage.inputTokens+e.usage.outputTokens)})," tok"]}),e.model&&uv(e.model)&&(()=>{const p=cn(e.usage,e.model);if(p.total<=0)return null;const m=Math.max(0,((e.endedAt??i)-e.startedAt)/1e3),y=e.state==="active"?Iu(p.total,m):null,x=wP(e.usage,e.model)+(y?`
59
- burn: ${y}`:"");return v.jsxs("span",{className:"cost-meta",title:x,children:[v.jsx("b",{children:Fe(p.total)}),y&&v.jsx("span",{className:"cost-rate",children:y})]})})()]}),v.jsx(Ds,{type:"source",position:Ce.Right,style:{background:"transparent",border:"none"}})]})}function SP({state:e}){const n=e==="active"?"live":e==="done"?"done":"err";return v.jsx("span",{className:`state-pill state-${e}`,children:n})}function bP(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function kP({tools:e,now:n}){const u=new Array(24).fill(0);let l=0;for(const y of e){const x=n-y.startedAt;if(x<0||x>=6e4)continue;const N=23-Math.floor(x/2500);N>=0&&N<24&&(u[N]+=1,l+=1)}const c=Math.max(1,...u),d=132,h=14,p=d/24,m=c/(2500/1e3);return v.jsxs("div",{className:"tool-spark-row",title:`${l} tool calls in last 60s · peak ${m.toFixed(1)}/s`,children:[v.jsx("svg",{className:"tool-spark",width:d,height:h,viewBox:`0 0 ${d} ${h}`,"aria-hidden":!0,children:u.map((y,x)=>{const N=y===0?1.5:Math.max(1.5,y/c*h),_=x===23&&y>0,b=`tool-spark-bar${y>0?" active":""}${_?" latest":""}`;return v.jsx("rect",{x:x*p+.4,y:h-N,width:Math.max(.5,p-1),height:N,rx:.8,className:b},x)})}),v.jsx("span",{className:"tool-spark-label",children:"60s"})]})}function Xo(e){const n=e.match(/^claude[-_](opus|sonnet|haiku|fable|mythos)[-_](\d+(?:[-_.]\d+)*)/i);if(n){const o=n[1][0].toUpperCase()+n[1].slice(1).toLowerCase(),u=n[2].replace(/[-_]/g,".");return`${o} ${u}`}const i=e.match(/^gpt[-_](\d+(?:[-_.]\d+)*)[-_]codex\b/i);if(i)return`GPT-${i[1].replace(/[-_]/g,".")} Codex`;const s=e.match(/^gpt[-_](\d+(?:[-_.]\d+)*)/i);return s?`GPT-${s[1].replace(/[-_]/g,".")}`:e}function Gw(e){if(e==null)return"(none)";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function EP(e){if(e.endedAt==null)return"in-flight…";const n=e.endedAt-e.startedAt;return n<1e3?`${n}ms`:`${(n/1e3).toFixed(2)}s`}function NP({tool:e,onClose:n}){q.useEffect(()=>{const s=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[n]);const i=e.endedAt==null?"inflight":e.ok===!1?"err":"done";return v.jsx("div",{className:"modal-backdrop",onClick:n,role:"dialog","aria-modal":"true",children:v.jsxs("div",{className:"modal",onClick:s=>s.stopPropagation(),children:[v.jsxs("header",{className:"modal-head",children:[v.jsxs("div",{className:"modal-title",children:[v.jsx("span",{className:`status-dot ${i}`}),v.jsx("span",{className:"modal-tool-name",children:e.name}),v.jsxs("span",{className:"modal-tool-id",title:e.id,children:[e.id.slice(0,12),"…"]})]}),v.jsxs("div",{className:"modal-actions",children:[v.jsx("span",{className:"modal-dur",children:EP(e)}),v.jsx("button",{className:"btn icon-btn",onClick:n,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]})]}),v.jsxs("section",{className:"modal-body",children:[v.jsxs("div",{className:"modal-section",children:[v.jsx("h4",{children:"Input"}),v.jsx("pre",{children:Gw(e.input??e.inputPreview)})]}),v.jsxs("div",{className:"modal-section",children:[v.jsxs("h4",{children:["Response ",i==="err"&&v.jsx("span",{className:"err-tag",children:"error"})]}),v.jsx("pre",{children:e.endedAt==null?"(waiting…)":Gw(e.response??e.errorPreview)})]})]})]})})}const hu=18,Yw=26,CP=12;function RP(e){const n=new Map;for(const o of e.nodeInternals.values()){const u=o.data;if(!(u!=null&&u.sessionId)||u.exitAt!=null||o.width==null||o.height==null)continue;const l=o.position.x,c=o.position.y,d=l+o.width,h=c+o.height,p=n.get(u.sessionId);p?(p.minX=Math.min(p.minX,l),p.minY=Math.min(p.minY,c),p.maxX=Math.max(p.maxX,d),p.maxY=Math.max(p.maxY,h),u.kind==="root"&&(p.label=Kw(u)??p.label)):n.set(u.sessionId,{minX:l,minY:c,maxX:d,maxY:h,label:Kw(u)??u.sessionId})}const i=new Map;for(const o of n.values())i.set(o.label,(i.get(o.label)??0)+1);const s=[];for(const[o,u]of n){const c=(i.get(u.label)??0)>1?`${u.label} · ${TP(o)}`:u.label;s.push({sessionId:o,label:c,x:u.minX-hu,y:u.minY-hu-Yw,w:u.maxX-u.minX+hu*2,h:u.maxY-u.minY+hu*2+Yw})}return s}function TP(e){const n=e.match(/[a-zA-Z0-9]{4}/);return n?n[0]:e.slice(0,4)}function Kw(e){if(e.kind==="root")return e.label}function jP(){const{x:e,y:n,zoom:i}=XE(),s=Ko(),o=Xe(RP,AP);if(o.length<=1)return null;const u=l=>{try{const c=s.getNodes().filter(d=>{const h=d.data;return(h==null?void 0:h.sessionId)===l});if(c.length===0)return;s.fitView({padding:.3,duration:500,nodes:c})}catch{}};return v.jsx("div",{className:"session-clusters",children:o.map(l=>{const c=av(l.sessionId),d={position:"absolute",left:l.x*i+e,top:l.y*i+n,width:l.w*i,height:l.h*i,borderColor:`hsl(${c} 65% 55% / 0.32)`,background:`hsl(${c} 70% 50% / 0.04)`},h={position:"absolute",left:l.x*i+e+16*i,top:(l.y-CP)*i+n,color:`hsl(${c} 70% 78%)`,borderColor:`hsl(${c} 65% 55% / 0.5)`,transform:`scale(${Math.min(1,i)})`,transformOrigin:"left top"};return v.jsxs(ae.Fragment,{children:[v.jsx("div",{className:"cluster-card",style:d,"aria-hidden":!0}),v.jsx("button",{type:"button",className:"cluster-label",style:h,title:`Fit view to ${l.label} · drag the wrapper to move the whole session`,onClick:()=>u(l.sessionId),children:l.label})]},l.sessionId)})})}function AP(e,n){if(e.length!==n.length)return!1;for(let i=0;i<e.length;i++){const s=e[i],o=n[i];if(s.sessionId!==o.sessionId||s.label!==o.label||s.x!==o.x||s.y!==o.y||s.w!==o.w||s.h!==o.h)return!1}return!0}function IP({data:e}){return v.jsx("div",{className:"session-group-handle",style:{width:(e==null?void 0:e.w)??0,height:(e==null?void 0:e.h)??0}})}const oN=600,MP=36,$g=16,PP=60,OP=6,Xw=220,Qw=96,qP=28,LP={Read:"file",Write:"file",Edit:"file",MultiEdit:"file",Glob:"file",Grep:"file",LS:"file",NotebookEdit:"file",Bash:"shell",PowerShell:"shell",shell:"shell",exec_command:"shell",shell_command:"shell",write_stdin:"shell",wait:"shell",apply_patch:"file",update_plan:"task",WebFetch:"web",WebSearch:"web",Task:"agent",Agent:"agent",TodoWrite:"task",TaskCreate:"task",TaskUpdate:"task",TaskList:"task",TaskGet:"task",TaskOutput:"task",TaskStop:"task",EnterPlanMode:"plan",ExitPlanMode:"plan",AskUserQuestion:"plan",Skill:"plan",Workflow:"plan",ScheduleWakeup:"other",CronCreate:"other",CronList:"other",CronDelete:"other",Monitor:"other",PushNotification:"other",RemoteTrigger:"other",ToolSearch:"other"};function $P(e){return e.startsWith("mcp__")?"mcp":LP[e]??"other"}const DP={Read:"📖",Write:"💾",Edit:"✏️",MultiEdit:"🔧",Glob:"🗺️",Grep:"🔎",Bash:"⚡",PowerShell:"💻",shell:"⚡",exec_command:"⚡",shell_command:"⚡",write_stdin:"💻",wait:"⏳",apply_patch:"🩹",update_plan:"📋",LS:"📂",Task:"🤖",Agent:"🤖",TodoWrite:"📋",TaskCreate:"📋",TaskUpdate:"📝",TaskList:"🗂️",TaskGet:"🗂️",TaskOutput:"📤",TaskStop:"🛑",WebFetch:"🌐",WebSearch:"🔭",ToolSearch:"🧰",NotebookEdit:"📓",EnterPlanMode:"🧭",ExitPlanMode:"🏁",AskUserQuestion:"❓",ScheduleWakeup:"⏰",CronCreate:"⏰",CronList:"📅",CronDelete:"🗑️",Skill:"🎯",Workflow:"🎬",Monitor:"📡",PushNotification:"🔔",RemoteTrigger:"📡"};function Zw(e){return e.startsWith("mcp__")?"🔌":DP[e]??"✨"}const FP={git:"🐙",gh:"🐙",glab:"🐙",npm:"📦",pnpm:"📦",yarn:"📦",bun:"📦",brew:"🍺",node:"🟢",deno:"🟢",python:"🐍",python3:"🐍",py:"🐍",pip:"🐍",pip3:"🐍",uv:"🐍",ruby:"💎",bundle:"💎",gem:"💎",cargo:"🦀",rustc:"🦀",rustup:"🦀",go:"🐹",docker:"🐳","docker-compose":"🐳",podman:"🐳",kubectl:"☸️",helm:"☸️",k9s:"☸️",grep:"🔎",rg:"🔎",ag:"🔎",ack:"🔎",find:"🔍",fd:"🔍",locate:"🔍",which:"🔍",ls:"📂",dir:"📂",tree:"📂",cat:"📄",head:"📄",tail:"📄",less:"📄",more:"📄",bat:"📄",cp:"📋",mv:"✂️",rm:"🗑️",rmdir:"🗑️",mkdir:"📁",touch:"📁",sed:"✏️",awk:"✏️",tr:"✏️",curl:"🌐",wget:"🌐",http:"🌐",httpie:"🌐",ssh:"🔐",scp:"🔐",rsync:"🔐",ping:"📡",make:"🔨",cmake:"🔨",ninja:"🔨",bazel:"🔨",just:"🔨",terraform:"🏗️",ansible:"📕",pulumi:"🏗️",ps:"📊",top:"📊",htop:"📊",btm:"📊",kill:"💀",pkill:"💀",systemctl:"⚙️",service:"⚙️",tar:"🗜️",zip:"🗜️",unzip:"🗜️",gzip:"🗜️","7z":"🗜️",vim:"📝",nvim:"📝",nano:"📝",emacs:"📝",code:"📝",jq:"🪺",yq:"🪺",echo:"💬",printf:"💬",ffmpeg:"🎞️",ffprobe:"🎞️",imagemagick:"🖼️",convert:"🖼️","Get-ChildItem":"📂","Get-Content":"📄","Set-Content":"💾","Out-File":"💾","Add-Content":"💾","Set-Location":"📍","Get-Location":"📍","Get-Process":"📊","Start-Process":"▶️","Stop-Process":"💀","Invoke-WebRequest":"🌐","Invoke-RestMethod":"🌐","New-Item":"📁","Remove-Item":"🗑️","Copy-Item":"📋","Move-Item":"✂️","Test-Path":"🔍","Where-Object":"🔎","ForEach-Object":"🔁","Select-Object":"🎯","Measure-Object":"📊","Get-Service":"⚙️","Restart-Service":"⚙️","ConvertTo-Json":"🪺","ConvertFrom-Json":"🪺"};function aN(e){if(!e)return null;let n=e.trim();if(!n)return null;const i=n.match(/^(?:bash|sh|zsh|fish|powershell|pwsh)(?:\.exe)?\s+(?:-c|-Command|-NoProfile|-NonInteractive|\s)+["']([^"']+)["']/i);if(i)return aN(i[1]);for(;;){const u=n.match(/^([A-Z_][A-Z0-9_]*=\S*)\s+/);if(!u)break;n=n.slice(u[0].length)}n=n.replace(/^sudo(?:\s+-\S+)*\s+/,""),n=n.replace(/^(?:time|nohup|xargs)\s+/,"");const s=n.match(/^([^\s|;&<>(]+)/);if(!s)return null;let o=s[1];return o=o.replace(/^.*[/\\]/,""),o=o.replace(/\.(exe|cmd|bat|ps1)$/i,""),o||null}function zP(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;const n=e;if(typeof n.cmd=="string")return n.cmd;if(typeof n.command=="string")return n.command;if(Array.isArray(n.command)&&n.command.every(i=>typeof i=="string")){const i=n.command;if(/powershell|cmd|bash|sh(\.exe)?$/i.test(i[0]??"")){const s=i.findIndex(o=>/^(-Command|-c)$/i.test(o));if(s>=0&&s+1<i.length)return i[s+1]}return i.join(" ")}return typeof n.script=="string"?n.script:null}const BP=new Set(["Bash","PowerShell","shell","exec_command","shell_command","write_stdin","wait"]),UP=new Set(["shell","exec_command","shell_command","write_stdin","wait","apply_patch","update_plan"]);function HP(e,n){return UP.has(e)?Math.max(Qw,34+n.length*7.5):Qw}function VP(e,n){if(!BP.has(e))return null;const i=zP(n);if(!i)return null;const s=aN(i);return s?{emoji:FP[s]??"⚙️",label:s,category:"shell",detail:i}:null}const WP=new Set(["Read","Write","Edit","MultiEdit","NotebookEdit","LS","Glob","apply_patch"]),Jw={ts:"🟦",tsx:"🟦",d:"🟦",js:"🟨",jsx:"🟨",mjs:"🟨",cjs:"🟨",py:"🐍",pyi:"🐍",ipynb:"📓",rs:"🦀",go:"🐹",rb:"💎",erb:"💎",java:"☕",kt:"☕",scala:"☕",gradle:"☕",cs:"🔷",fs:"🔷",php:"🐘",swift:"🦅",c:"🇨",cpp:"🇨",cc:"🇨",h:"🇨",hpp:"🇨",md:"📝",mdx:"📝",rst:"📝",json:"🪺",json5:"🪺",jsonl:"🪺",yaml:"⚙️",yml:"⚙️",toml:"⚙️",ini:"⚙️",conf:"⚙️",cfg:"⚙️",xml:"📰",html:"🌐",htm:"🌐",vue:"🌐",svelte:"🌐",css:"🎨",scss:"🎨",sass:"🎨",less:"🎨",sh:"⚡",bash:"⚡",zsh:"⚡",fish:"⚡",ps1:"⚡",txt:"📄",log:"📄",out:"📄",csv:"📊",tsv:"📊",xlsx:"📊",xls:"📊",pdf:"📕",png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",webp:"🖼️",svg:"🖼️",ico:"🖼️",mp4:"🎬",mov:"🎬",avi:"🎬",mkv:"🎬",webm:"🎬",mp3:"🎵",wav:"🎵",ogg:"🎵",flac:"🎵",zip:"🗜️",tar:"🗜️",gz:"🗜️",bz2:"🗜️","7z":"🗜️",xz:"🗜️",rar:"🗜️",env:"🔐",lock:"🔐",pem:"🔐",key:"🔐",crt:"🔐",sql:"🗄️",db:"🗄️",sqlite:"🗄️",parquet:"🗄️"},ex={dockerfile:"🐳",makefile:"🔨",rakefile:"💎","package.json":"📦","pnpm-lock.yaml":"📦","yarn.lock":"📦","cargo.toml":"🦀","cargo.lock":"🦀","go.mod":"🐹","go.sum":"🐹","pyproject.toml":"🐍","requirements.txt":"🐍","readme.md":"📖",readme:"📖",license:"📜",".gitignore":"🐙",".gitattributes":"🐙",".env":"🔐",".dockerignore":"🐳"};function GP(e){const i=e.replace(/\\/g,"/").replace(/\/+$/,""),s=i.lastIndexOf("/");return s>=0?i.slice(s+1):i}function YP(e){const n=e.toLowerCase();if(ex[n])return ex[n];if(n.startsWith("dockerfile."))return"🐳";if(/\.(test|spec)\.[a-z]+$/.test(n))return"🧪";const i=n.lastIndexOf(".");if(i>0&&i<n.length-1){const s=n.slice(i+1);if(Jw[s])return Jw[s]}return"📄"}function KP(e,n){if(!n||typeof n!="object")return null;const i=n;if(e==="apply_patch"&&typeof i.patch=="string"){const s=i.patch.match(/^\*\*\* (?:Update|Add|Delete) File: (.+)$/m);return s?s[1].trim():null}return typeof i.file_path=="string"?i.file_path:typeof i.notebook_path=="string"?i.notebook_path:typeof i.path=="string"?i.path:e==="Glob"&&typeof i.pattern=="string"?i.pattern:null}function XP(e,n){if(!WP.has(e))return null;const i=KP(e,n);if(!i)return null;const s=GP(i);return s?{emoji:e==="LS"?"📂":YP(s),label:s,category:"file",detail:i}:null}const uN={github:{emoji:"🐙",name:"GitHub"},git:{emoji:"🐙",name:"Git"},gitlab:{emoji:"🦊",name:"GitLab"},slack:{emoji:"💬",name:"Slack"},discord:{emoji:"💬",name:"Discord"},linear:{emoji:"📐",name:"Linear"},jira:{emoji:"🅹",name:"Jira"},atlassian:{emoji:"🅰️",name:"Atlassian"},notion:{emoji:"📓",name:"Notion"},asana:{emoji:"📋",name:"Asana"},intercom:{emoji:"💬",name:"Intercom"},figma:{emoji:"🎨",name:"Figma"},gmail:{emoji:"📧",name:"Gmail"},calendar:{emoji:"📅",name:"Calendar"},drive:{emoji:"☁️",name:"Drive"},zoom:{emoji:"📹",name:"Zoom"},spotify:{emoji:"🎵",name:"Spotify"},youtube:{emoji:"📺",name:"YouTube"},ccd_session:{emoji:"📡",name:"Session"},ccd_directory:{emoji:"📂",name:"Directory"},ccd_session_mgmt:{emoji:"📡",name:"Sessions"},mcp_registry:{emoji:"🧰",name:"Registry"},"computer-use":{emoji:"🖱️",name:"Computer"},"claude-in-chrome":{emoji:"🌐",name:"Chrome"},"claude-preview":{emoji:"👀",name:"Preview"},"scheduled-tasks":{emoji:"⏰",name:"Scheduler"},visualize:{emoji:"🎨",name:"Visualize"},"plugin-design-asana":{emoji:"📋",name:"Asana"},"plugin-design-atlassian":{emoji:"🅰️",name:"Atlassian"},"plugin-design-figma":{emoji:"🎨",name:"Figma"},"plugin-design-intercom":{emoji:"💬",name:"Intercom"},"plugin-design-linear":{emoji:"📐",name:"Linear"},"plugin-design-notion":{emoji:"📓",name:"Notion"},"plugin-design-slack":{emoji:"💬",name:"Slack"}};function lN(e){if(!e.startsWith("mcp__"))return null;const n=e.slice(5),i=n.indexOf("__");return i<=0?{server:n,method:""}:{server:n.slice(0,i),method:n.slice(i+2)}}function QP(e){let n=5381;for(let i=0;i<e.length;i++)n=(n<<5)+n^e.charCodeAt(i);return Math.abs(n)%360}function ZP(e,n){const i=lN(e);if(!i)return null;const{server:s,method:o}=i;if(!o)return null;const u=uN[s.toLowerCase()];return{emoji:(u==null?void 0:u.emoji)??"🔌",label:o,category:"mcp",detail:u?`${u.name} · ${o}`:`${s} · ${o}`}}function JP(e,n){return VP(e,n)??XP(e,n)??ZP(e)}const e3={shell:"Shell",exec_command:"Shell",shell_command:"Shell",write_stdin:"stdin",wait:"wait",apply_patch:"Edit",update_plan:"Plan"};function t3(e){const n=lN(e);if(n){const s=uN[n.server.toLowerCase()];return s?{emoji:s.emoji,label:s.name}:{emoji:"🔌",label:n.server,hue:QP(n.server)}}const i=e3[e];return i?{emoji:Zw(e),label:i}:{emoji:Zw(e),label:e}}function n3(e){return e.endedAt==null?"inflight":e.ok===!1?"err":"done"}function r3(e,n,i){if(i==null)return 1;const s=n-i;return s<0?1:Math.max(0,1-s/oN)}function i3(e,n,i,s,o,u){const l=[];for(const c of e.values()){if(!n.has(c.id)||c.exitAt!=null&&u-c.exitAt>oN)continue;const d=s.get(c.id)??i.get(c.id);if(!d)continue;const h=c.tools.slice(-4);if(h.length===0)continue;const p=c.exitAt??null,m=o.get(c.id),y=Math.max((m==null?void 0:m.width)??Xw,Xw),x=(m==null?void 0:m.height)??130,N=d.x,_=d.y,S=N+y,b=_+x/2;h.forEach((k,E)=>{const C=E*MP,I=N+y+PP,O=_+OP+C,M=r3(k,u,p),P=k.inputPreview??"",T=n3(k),L=M<.999,F=t3(k.name);l.push({id:k.id,toolId:k.id,agentId:c.id,toolName:k.name,name:F.label,emoji:F.emoji,status:T,category:$P(k.name),mcpHue:F.hue,inputPreview:P,fade:M,fading:L,worldX:I,worldY:O,anchorX:S,anchorY:b,spawnDx:S-I,spawnDy:b-(O+$g)});const J=JP(k.name,k.input);if(J){const Q=HP(k.name,F.label),j=I+Q+qP,G=O,U=I+Q,ne=O+$g;l.push({id:`sub:${k.id}`,toolId:k.id,agentId:c.id,toolName:k.name,name:J.label,emoji:J.emoji,isSub:!0,status:T,category:J.category,inputPreview:J.detail??P,fade:M,fading:L,worldX:j,worldY:G,anchorX:U,anchorY:ne,spawnDx:U-j,spawnDy:0})}})}return l}function s3({agents:e,visibleAgentIds:n,positions:i,pinned:s,measured:o,dimUnmatched:u,spotlight:l,hiddenCategories:c,now:d,onOpenTool:h}){const{x:p,y:m,zoom:y}=XE(),x=i3(e,n,i,s,o,d),N=c&&c.size>0?x.filter(_=>!c.has(_.category)):x;return v.jsxs("div",{className:"tool-bursts-layer","aria-hidden":!0,children:[v.jsx("svg",{className:"tool-bursts-svg",children:N.map(_=>{const S=_.anchorX*y+p,b=_.anchorY*y+m,k=(_.worldX+6)*y+p,E=(_.worldY+$g)*y+m,C=S+(k-S)*.55,I=u!=null&&!u.has(_.agentId),O=l!=null&&!l.has(_.agentId),M=_.fade*(I||O?.14:1);return v.jsx("path",{d:`M ${S} ${b} Q ${C} ${b}, ${k} ${E}`,className:`tool-conn status-${_.status}${_.fading?" fading":""}`,opacity:M},`l:${_.id}`)})}),N.map(_=>{const S=_.worldX*y+p,b=_.worldY*y+m,k={left:`${S}px`,top:`${b}px`,transform:`scale(${y})`,transformOrigin:"left top","--spawn-dx":`${_.spawnDx}px`,"--spawn-dy":`${_.spawnDy}px`},E=_.isSub?`${_.toolName} · ${_.name}`:_.toolName,C=_.inputPreview?`${E} · ${_.inputPreview}`:E,I=h!=null,O=_.mcpHue!=null?{"--cat-accent":`hsl(${_.mcpHue} 65% 65%)`}:{},M=u!=null&&!u.has(_.agentId),P=l!=null&&!l.has(_.agentId),T=M||P?" dim":"";return v.jsx("div",{className:"tool-burst-wrap",style:k,children:v.jsxs("div",{className:`tool-burst cat-${_.category} status-${_.status}${_.fading?" fading":""}${I?" clickable":""}${_.isSub?" sub":""}${T}`,style:O,title:C,role:I?"button":void 0,tabIndex:I?0:void 0,"aria-label":I?`Open ${_.toolName} ${_.status==="inflight"?"in flight":_.status} — click for details`:void 0,onClick:I?()=>h(_.toolId):void 0,onKeyDown:I?L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),h(_.toolId))}:void 0,children:[v.jsx("span",{className:"tb-emoji",children:_.emoji}),v.jsx("span",{className:"tb-name",children:_.name}),_.status==="inflight"&&v.jsx("span",{className:"tb-spin"}),_.status==="done"&&v.jsx("span",{className:"tb-mark done",children:"✓"}),_.status==="err"&&v.jsx("span",{className:"tb-mark err",children:"×"})]})},_.id)})]})}function o3({state:e,sessionId:n,onClose:i}){const s=q.useMemo(()=>u3(e,n),[e,n]);return s?v.jsx("div",{className:"modal-backdrop",onClick:i,role:"presentation",children:v.jsxs("div",{className:"modal session-summary",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"ss-title",children:[v.jsxs("div",{className:"modal-head",children:[v.jsxs("div",{className:"modal-title",children:[v.jsx("span",{className:"state-pill state-done","aria-hidden":!0,children:"done"}),v.jsx("span",{id:"ss-title",className:"modal-tool-name",title:s.cwd??s.sessionId,children:s.label}),v.jsxs("span",{className:"modal-tool-id",children:["· ",s.sessionId.slice(0,8)]})]}),v.jsxs("div",{className:"modal-actions",children:[v.jsx("span",{className:"modal-dur",title:"Total wall time",children:s.durationLabel}),v.jsx("button",{className:"btn",onClick:i,"aria-label":"Close",children:"×"})]})]}),v.jsxs("div",{className:"modal-body",children:[v.jsxs("section",{className:"ss-hero",children:[v.jsxs("div",{className:"ss-hero-left",children:[v.jsx("div",{className:"ss-cost-label",children:"total spend"}),v.jsx("div",{className:"ss-cost",children:Fe(s.cost.total)}),s.modelChips.length>0&&v.jsx("div",{className:"ss-models",children:s.modelChips.map(o=>v.jsx("span",{className:"model-chip",title:o,children:Xo(o)},o))})]}),v.jsx("div",{className:"ss-hero-right",children:s.cost.total>0&&v.jsxs(v.Fragment,{children:[v.jsx(a3,{cost:s.cost}),v.jsxs("div",{className:"ss-cost-legend",children:[v.jsxs("span",{className:"ssl ssl-in",children:["input ",v.jsx("b",{children:Fe(s.cost.input)})]}),v.jsxs("span",{className:"ssl ssl-out",children:["output ",v.jsx("b",{children:Fe(s.cost.output)})]}),v.jsxs("span",{className:"ssl ssl-cr",children:["cache r ",v.jsx("b",{children:Fe(s.cost.cacheRead)})]}),v.jsxs("span",{className:"ssl ssl-cw",children:["cache w ",v.jsx("b",{children:Fe(s.cost.cacheWrite)})]})]})]})})]}),v.jsxs("section",{className:"ss-stats",children:[v.jsx(Rs,{label:"agents",value:s.agentCount}),v.jsx(Rs,{label:"subagents",value:s.subagentCount}),v.jsx(Rs,{label:"tool calls",value:s.toolCount}),v.jsx(Rs,{label:"prompts",value:s.promptCount}),v.jsx(Rs,{label:"tokens",value:s.tokensSum.toLocaleString()}),s.errCount>0&&v.jsx(Rs,{label:"errors",value:s.errCount,tone:"err"})]}),s.topTools.length>0&&v.jsxs("section",{className:"modal-section",children:[v.jsx("h4",{children:"Most-used tools"}),v.jsx("div",{className:"ss-top-tools",children:s.topTools.map(([o,u])=>v.jsxs("div",{className:"ss-tt",children:[v.jsx("span",{className:"ss-tt-name",children:o}),v.jsx("span",{className:"ss-tt-bar",children:v.jsx("span",{className:"ss-tt-bar-fill",style:{width:`${u/s.topTools[0][1]*100}%`}})}),v.jsx("span",{className:"ss-tt-count",children:u})]},o))})]}),s.firstPrompt&&v.jsxs("section",{className:"modal-section",children:[v.jsx("h4",{children:"Opening prompt"}),v.jsx("div",{className:"ss-prompt",children:s.firstPrompt})]})]})]})}):null}function Rs({label:e,value:n,tone:i}){return v.jsxs("div",{className:`ss-stat${i?` tone-${i}`:""}`,children:[v.jsx("div",{className:"ss-stat-value",children:n}),v.jsx("div",{className:"ss-stat-label",children:e})]})}function a3({cost:e}){const n=e.total;if(n<=0)return null;const i=(s,o,u)=>{if(s<=0)return null;const l=s/n*100;return v.jsx("span",{className:`cb-seg ${o}`,style:{width:`${l}%`},title:`${u}: ${Fe(s)} (${l.toFixed(0)}%)`},o)};return v.jsxs("div",{className:"cost-bar cost-bar-lg","aria-label":"Cost breakdown",children:[i(e.input,"cb-input","input"),i(e.output,"cb-output","output"),i(e.cacheRead,"cb-cache-r","cache read"),i(e.cacheWrite,"cb-cache-w","cache write")]})}function u3(e,n){const i=e.agents.get(n);if(!i)return null;const s=[];for(const E of e.agents.values())E.sessionId===n&&s.push(E);if(s.length===0)return null;const o={input:0,output:0,cacheRead:0,cacheWrite:0,total:0},u=new Set,l=new Map;let c=0,d=0,h=0,p=0,m=0,y,x=1/0,N=0;for(const E of s){const C=cn(E.usage,E.model);o.input+=C.input,o.output+=C.output,o.cacheRead+=C.cacheRead,o.cacheWrite+=C.cacheWrite,o.total+=C.total,E.model&&u.add(E.model),E.kind==="subagent"&&m++,d+=E.prompts.length,!y&&E.prompts.length>0&&(y=E.prompts[0].text),h+=E.usage.inputTokens+E.usage.outputTokens,c+=E.tools.length,x=Math.min(x,E.startedAt),N=Math.max(N,E.endedAt??Date.now());for(const I of E.tools)l.set(I.name,(l.get(I.name)??0)+1),I.ok===!1&&p++}const _=Math.max(0,N-x),S=Math.floor(_/1e3),b=S<60?`${S}s`:S<3600?`${Math.floor(S/60)}m ${String(S%60).padStart(2,"0")}s`:`${Math.floor(S/3600)}h ${Math.floor(S%3600/60)}m`,k=Array.from(l.entries()).sort((E,C)=>C[1]-E[1]).slice(0,5);return{sessionId:n,label:i.label||i.cwdBasename||"session",cwd:i.cwd,durationLabel:b,cost:o,modelChips:Array.from(u),agentCount:s.length,subagentCount:m,toolCount:c,promptCount:d,tokensSum:h,errCount:p,topTools:k,firstPrompt:y}}function l3(e,n){const i=[];for(const s of e.agents.values()){if(s.kind!=="root")continue;let o=s.tools.length,u=cn(s.usage,s.model).total,l=s.endedAt??s.startedAt;for(const c of e.agents.values()){if(c.sessionId!==s.sessionId||c.kind==="root")continue;o+=c.tools.length,u+=cn(c.usage,c.model).total;const d=c.endedAt??c.startedAt;d>l&&(l=d)}i.push({sessionId:s.sessionId,label:s.label||s.cwdBasename||"session",cwdBasename:s.cwdBasename,state:s.state,modelId:s.model,toolCount:o,cost:u,startedAt:s.startedAt,lastActivity:l})}return i.sort((s,o)=>{if(s.state!==o.state){if(s.state==="active")return-1;if(o.state==="active")return 1}return o.lastActivity-s.lastActivity}),i}function c3(e,n,i){const s=(n??i)-e;if(s<1e3)return"<1s";const o=Math.floor(s/1e3);if(o<60)return`${o}s`;const u=Math.floor(o/60);return u<60?`${u}m`:`${Math.floor(u/60)}h ${u%60}m`}function f3({state:e,now:n,selectedIds:i,onSelect:s,onClose:o}){const u=q.useMemo(()=>l3(e),[e,e.lastSeq,n]),l=u.filter(c=>c.state==="active").length;return v.jsxs("aside",{className:"session-list","aria-label":"Sessions",children:[v.jsxs("div",{className:"sl-header",children:[v.jsxs("h3",{children:["Sessions ",v.jsx("span",{className:"sl-count",children:u.length})]}),l>0&&v.jsxs("span",{className:"sl-live-count",children:[l," live"]}),v.jsx("button",{className:"btn icon-btn sl-close",onClick:o,title:"Hide sidebar (L)","aria-label":"Hide session list",children:"‹"})]}),v.jsxs("div",{className:"sl-rows",children:[u.length===0&&v.jsx("div",{className:"sl-empty",children:"No sessions yet."}),u.map(c=>{const d=i.has(c.sessionId);return v.jsxs("button",{type:"button",className:`sl-row state-${c.state}${d?" selected":""}`,onClick:()=>s(c.sessionId),title:`Focus ${c.label}`,children:[v.jsx("span",{className:`sl-dot state-${c.state}`,"aria-hidden":!0}),v.jsxs("div",{className:"sl-row-body",children:[v.jsxs("div",{className:"sl-row-head",children:[v.jsx("span",{className:"sl-label",children:c.label}),c.modelId&&v.jsx("span",{className:"model-chip",title:c.modelId,children:Xo(c.modelId)})]}),v.jsxs("div",{className:"sl-row-meta",children:[v.jsxs("span",{title:"tool calls",children:[v.jsx("b",{children:c.toolCount})," tools"]}),c.cost>0&&v.jsx("span",{className:"sl-cost",title:"total spend",children:v.jsx("b",{children:Fe(c.cost)})}),v.jsx("span",{className:"sl-elapsed",title:`Started ${new Date(c.startedAt).toLocaleString()}`,children:c3(c.startedAt,c.state==="active"?void 0:c.lastActivity,n)})]})]})]},c.sessionId)})]})]})}function tx(e,n){if(!e)return null;const i=n-Math.floor(e/1e3);return i<10?"just now":i<60?`${i}s ago`:i<3600?`${Math.floor(i/60)}m ago`:`${Math.floor(i/3600)}h ago`}function d3(e){return e==="claude-swap"?"Read from claude-swap's last collection — costs no request against your usage-endpoint budget":e==="api"?"Fetched from Anthropic's usage endpoint, at most once every 5 minutes":e==="cli"?"Parsed from `claude /usage`, at most once every 5 minutes":"Last update"}function Er(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function h3({cost:e}){const n=e.total;if(n<=0)return null;const i=(s,o,u)=>{if(s<=0)return null;const l=s/n*100;return v.jsx("span",{className:`cb-seg ${o}`,style:{width:`${l}%`},title:`${u}: ${Fe(s)} (${l.toFixed(0)}%)`},o)};return v.jsxs("div",{className:"cost-bar","aria-label":"Cost breakdown",children:[i(e.input,"cb-input","input"),i(e.output,"cb-output","output"),i(e.cacheRead,"cb-cache-r","cache read"),i(e.cacheWrite,"cb-cache-w","cache write")]})}function p3(e,n){const i=e-n;if(i<=0)return null;const s=Math.floor(i/3600),o=Math.floor(i%3600/60);if(s>23){const u=Math.floor(i/86400),l=Math.floor(i%86400/3600);return`${u}d ${l}h`}return s>0?`${s}h ${o}m`:`${o}m`}function m3(e,n,i,s){const o=Math.max(0,n-s),u=Math.max(0,i-o);if(u<120)return null;const l=Math.min(100,u/i*100),c=e-l;if(Math.abs(c)<3)return{label:"on pace",color:"var(--ok)",expectedPct:l,isDeficit:!1};if(c>0){const d=100-e,h=u>0?e/u:0,p=h>0?d/h:1/0,m={label:`${Math.round(c)}% ahead`,color:"var(--warn)",expectedPct:l,isDeficit:!0};if(p<o&&p<86400){const y=Math.floor(p/3600),x=Math.floor(p%3600/60);m.runsOutIn=y>0?`${y}h ${x}m`:`${x}m`}return m}return{label:`${Math.round(-c)}% reserve`,color:"var(--ok)",expectedPct:l,isDeficit:!1}}function Ii({pct:e,label:n,reset:i,resetAt:s,windowSec:o,limitReached:u,nowSec:l}){const c=Math.min(100,Math.max(0,e)),h=u||c>=90?"var(--err)":c>=70?"var(--warn)":"var(--accent)",p=c===0?"< 1%":`${c}%`,m=c===0?2:c,y=s?p3(s,l):null,x=s&&o?m3(c,s,o,l):null;return v.jsxs("div",{className:"qb-row",children:[v.jsxs("div",{className:"qb-meta",children:[v.jsxs("span",{className:"qb-label",children:[n,u&&v.jsx("span",{className:"qb-limit-badge",title:"Rate limit reached",children:"⛔"})]}),v.jsx("span",{className:"qb-pct",style:{color:h},children:p})]}),v.jsxs("div",{className:"qb-track",children:[v.jsx("div",{className:"qb-fill",style:{width:`${m}%`,background:h,opacity:c===0?.4:1}}),x&&v.jsx("div",{className:"qb-pace-marker",style:{left:`${x.expectedPct}%`,background:x.isDeficit?"var(--err)":"var(--ok)"},title:`To last until reset, stay near ${Math.round(x.expectedPct)}% by now`})]}),v.jsxs("div",{className:"qb-reset-row",children:[y?v.jsxs("span",{className:"qb-reset",children:["resets in ",y]}):i?v.jsxs("span",{className:"qb-reset",children:["resets ",i]}):null,x&&v.jsx("span",{className:"qb-pace",style:{color:x.color},children:x.runsOutIn?`runs out in ${x.runsOutIn}`:x.label})]})]})}const g3=6e4;function v3(){const[e,n]=q.useState(null),[i,s]=q.useState(!1),o=q.useRef(null),u=async(c=!1)=>{c&&s(!0);try{const h=await fetch(c?"/api/quota?refresh=1":"/api/quota");h.ok&&n(await h.json())}catch{}finally{c&&s(!1)}};return q.useEffect(()=>(u(!0),o.current=window.setInterval(()=>u(!1),g3),()=>{o.current!=null&&window.clearInterval(o.current)}),[]),{quota:e,loading:i,refresh:()=>u(!0)}}function y3(e){switch(e){case"no_token":return"Run codex login to authenticate.";case"api_key_mode":return"API-key login — ChatGPT quota is only available for codex login.";case"refresh_rejected":return"Codex session expired — run codex login.";case"refresh_failed":return"Couldn't refresh the Codex token — click ↻ to retry.";default:return"ChatGPT API unreachable — click ↻ to retry."}}const cN=6e4;function w3(){const[e,n]=q.useState(null),[i,s]=q.useState(!1),o=q.useRef(null),u=async(c=!1)=>{c&&s(!0);try{const h=await fetch(c?"/api/codex-quota?refresh=1":"/api/codex-quota");h.ok&&n(await h.json())}catch{}finally{c&&s(!1)}};return q.useEffect(()=>(u(!0),o.current=window.setInterval(()=>u(!1),cN),()=>{o.current!=null&&window.clearInterval(o.current)}),[]),{data:e,loading:i,refresh:()=>u(!0)}}function x3(){const[e,n]=q.useState(null),i=q.useRef(null),s=async()=>{try{const o=await fetch("/api/codex-usage");o.ok&&n(await o.json())}catch{}};return q.useEffect(()=>(s(),i.current=window.setInterval(s,cN),()=>{i.current!=null&&window.clearInterval(i.current)}),[]),{data:e}}function _3({state:e,now:n,onClose:i}){var M,P;const{quota:s,loading:o,refresh:u}=v3(),{data:l,loading:c,refresh:d}=w3(),{data:h}=x3(),[p,m]=q.useState(()=>Math.floor(Date.now()/1e3));q.useEffect(()=>{const T=window.setInterval(()=>m(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(T)},[]);const{byModel:y,totalCost:x,totalTokens:N,burnRate:_}=q.useMemo(()=>{const T=new Map,L={total:0,input:0,output:0,cacheRead:0,cacheWrite:0};let F=0,J=0,Q=0,j=0;for(const $ of e.agents.values()){const W=$.model??"__unknown__",A=cn($.usage,$.model),B=T.get(W);B?(B.inputTokens+=$.usage.inputTokens,B.outputTokens+=$.usage.outputTokens,B.cacheReadTokens+=$.usage.cacheReadTokens,B.cacheCreateTokens+=$.usage.cacheCreateTokens,B.cost.total+=A.total,B.cost.input+=A.input,B.cost.output+=A.output,B.cost.cacheRead+=A.cacheRead,B.cost.cacheWrite+=A.cacheWrite,B.agentCount++):T.set(W,{model:W,inputTokens:$.usage.inputTokens,outputTokens:$.usage.outputTokens,cacheReadTokens:$.usage.cacheReadTokens,cacheCreateTokens:$.usage.cacheCreateTokens,cost:{...A},agentCount:1}),L.total+=A.total,L.input+=A.input,L.output+=A.output,L.cacheRead+=A.cacheRead,L.cacheWrite+=A.cacheWrite,F+=$.usage.inputTokens,J+=$.usage.outputTokens,Q+=$.usage.cacheReadTokens,j+=$.usage.cacheCreateTokens}const G=Array.from(T.values()).sort(($,W)=>W.cost.total-$.cost.total);let U=0,ne=0;for(const $ of e.agents.values()){if($.state!=="active")continue;const W=cn($.usage,$.model);U+=W.total,ne=Math.max(ne,(($.endedAt??n)-$.startedAt)/1e3)}const K=ne>0?Iu(U,ne):null;return{byModel:G,totalCost:L,totalTokens:{in:F,out:J,cacheR:Q,cacheC:j},burnRate:K}},[e,e.lastSeq,n]),S=q.useMemo(()=>{const T=[];for(const L of e.agents.values()){if(L.kind!=="root")continue;let F=cn(L.usage,L.model).total,J=L.usage.inputTokens,Q=L.usage.outputTokens;for(const j of e.agents.values())j.sessionId!==L.sessionId||j.kind==="root"||(F+=cn(j.usage,j.model).total,J+=j.usage.inputTokens,Q+=j.usage.outputTokens);T.push({sessionId:L.sessionId,label:L.label||L.cwdBasename||"session",state:L.state,cost:F,inputTokens:J,outputTokens:Q})}return T.sort((L,F)=>F.cost-L.cost).slice(0,12)},[e,e.lastSeq]),b=x.total>0,k=N.in+N.out,E=o||c,C=tx(s==null?void 0:s.fetchedAt,p),I=tx(l==null?void 0:l.fetchedAt,p),O=()=>{u(),d()};return v.jsxs("div",{className:"usage-panel","aria-label":"Usage",children:[v.jsxs("div",{className:"up-header",children:[v.jsx("h3",{children:"Usage"}),_&&v.jsx("span",{className:"up-rate",children:_}),v.jsxs("div",{className:"up-header-right",children:[v.jsx("button",{type:"button",className:"btn up-refresh-btn",onClick:O,disabled:E,title:"Refresh Claude + Codex quota",children:E?"…":"↻"}),v.jsx("button",{type:"button",className:"btn icon-btn up-close",onClick:i,"aria-label":"Close usage panel",title:"Close (U)",children:"×"})]})]}),v.jsxs("section",{className:"up-section up-quota-section",children:[v.jsxs("h4",{className:"up-section-title",children:["Claude quota",C&&!o&&v.jsx("span",{className:"up-section-age",title:d3(s==null?void 0:s.source),children:C})]}),s!=null&&s.ok?v.jsxs("div",{className:"up-quota-bars",children:[s.session5hPct!=null&&v.jsx(Ii,{label:"5-hour window",pct:s.session5hPct,reset:s.session5hReset,resetAt:s.session5hResetAt,windowSec:s.session5hWindowSec,nowSec:p}),s.week7dPct!=null&&v.jsx(Ii,{label:"7-day window",pct:s.week7dPct,reset:s.week7dReset,resetAt:s.week7dResetAt,windowSec:s.week7dWindowSec,nowSec:p}),s.weekSonnetPct!=null&&v.jsx(Ii,{label:"Sonnet (7d)",pct:s.weekSonnetPct,nowSec:p}),s.weekOpusPct!=null&&v.jsx(Ii,{label:"Opus (7d)",pct:s.weekOpusPct,nowSec:p})]}):(s==null?void 0:s.ok)===!1?v.jsxs("div",{className:"up-quota-na",children:[v.jsx("span",{children:"Quota unavailable."}),v.jsxs("span",{className:"up-quota-hint",children:["Run ",v.jsx("code",{children:"/usage"})," in a claude session, then click ↻"]})]}):v.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),v.jsxs("section",{className:"up-section up-quota-section",children:[v.jsxs("h4",{className:"up-section-title",children:["Codex quota",(l==null?void 0:l.ok)&&l.planLabel&&v.jsx("span",{className:"up-plan-badge",children:l.planLabel}),I&&!c&&v.jsx("span",{className:"up-section-age",title:"Fetched from the Codex usage endpoint",children:I})]}),l!=null&&l.ok?v.jsxs("div",{className:"up-quota-bars",children:[(M=l.windows)==null?void 0:M.map(T=>v.jsx(Ii,{label:T.label,pct:T.pct,reset:T.reset??void 0,resetAt:T.resetAt??void 0,windowSec:T.windowSec??void 0,limitReached:l.limitReached&&T.pct>=100,nowSec:p},T.id)),(P=l.extraWindows)==null?void 0:P.map(T=>v.jsx(Ii,{label:T.label,pct:T.pct,reset:T.reset??void 0,resetAt:T.resetAt??void 0,windowSec:T.windowSec??void 0,nowSec:p},T.id)),l.creditLimit&&v.jsx(Ii,{label:`spend cap · $${Math.round(l.creditLimit.used)} of $${Math.round(l.creditLimit.limit)}`,pct:l.creditLimit.usedPct,reset:l.creditLimit.reset??void 0,resetAt:l.creditLimit.resetAt??void 0,limitReached:l.spendControlReached,nowSec:p}),(h==null?void 0:h.ok)&&h.window7d&&h.window7d.sessionCount>0&&v.jsxs("div",{className:"up-quota-sub",children:[Er(h.window7d.totalTokens)," tokens · ",h.window7d.sessionCount," session",h.window7d.sessionCount!==1?"s":""," (7d)"]}),l.creditsBalance&&!l.creditsUnlimited&&v.jsxs("div",{className:"up-quota-sub up-credits",children:["credits: $",l.creditsBalance,l.overageReached&&" · overage limit reached"]}),l.creditsUnlimited&&v.jsx("div",{className:"up-quota-sub up-credits",children:"credits: unlimited"}),l.resetCredits&&l.resetCredits.availableCount>0&&v.jsxs("div",{className:"up-quota-sub up-reset-credits",title:"Redeem in the Codex CLI or ChatGPT — agents-deck only reports them",children:[l.resetCredits.availableCount," rate-limit reset",l.resetCredits.availableCount!==1?"s":""," available",l.resetCredits.nextExpiryAt&&` · expires ${new Date(l.resetCredits.nextExpiryAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}`]}),l.promo&&v.jsx("div",{className:"up-quota-sub",children:l.promo}),l.partial&&v.jsx("div",{className:"up-quota-sub up-quota-hint",children:"Partial data — OpenAI returned limits this build doesn't recognise."})]}):(l==null?void 0:l.ok)===!1?v.jsxs("div",{className:"up-quota-na",children:[v.jsx("span",{children:"Quota unavailable."}),v.jsx("span",{className:"up-quota-hint",children:y3(l.reason)})]}):v.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),b?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"up-total",children:[v.jsx("span",{className:"up-total-value",children:Fe(x.total)}),v.jsx("span",{className:"up-total-label",children:"total spend"})]}),v.jsx(h3,{cost:x}),k>0&&v.jsxs("div",{className:"up-tokens-row",children:[v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"in"}),Er(N.in)]}),v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"out"}),Er(N.out)]}),N.cacheR>0&&v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"cache r"}),Er(N.cacheR)]}),N.cacheC>0&&v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"cache c"}),Er(N.cacheC)]})]}),y.filter(T=>T.cost.total>0).length>0&&v.jsxs("section",{className:"up-section",children:[v.jsx("h4",{className:"up-section-title",children:"By model"}),v.jsxs("table",{className:"up-table",children:[v.jsx("thead",{children:v.jsxs("tr",{children:[v.jsx("th",{children:"Model"}),v.jsx("th",{children:"Tokens"}),v.jsx("th",{children:"Cost"})]})}),v.jsx("tbody",{children:y.filter(T=>T.cost.total>0).map(T=>v.jsxs("tr",{children:[v.jsx("td",{className:"up-model-name",title:T.model,children:Xo(T.model)}),v.jsx("td",{className:"up-num",children:Er(T.inputTokens+T.outputTokens)}),v.jsx("td",{className:"up-num up-cost-val",children:Fe(T.cost.total)})]},T.model))})]})]}),S.filter(T=>T.cost>0).length>0&&v.jsxs("section",{className:"up-section",children:[v.jsx("h4",{className:"up-section-title",children:"By session"}),v.jsx("div",{className:"up-sessions",children:S.filter(T=>T.cost>0).map(T=>v.jsxs("div",{className:"up-session-row",children:[v.jsx("span",{className:`sl-dot state-${T.state}`,"aria-hidden":!0}),v.jsx("span",{className:"up-session-label",children:T.label}),v.jsx("span",{className:"up-session-tokens",children:Er(T.inputTokens+T.outputTokens)}),v.jsx("span",{className:"up-session-cost",children:Fe(T.cost)})]},T.sessionId))})]})]}):k>0?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"up-tokens-row",children:[v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"in"}),Er(N.in)]}),v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"out"}),Er(N.out)]})]}),v.jsx("div",{className:"up-hint",children:"Cost appears once a known model is detected."})]}):v.jsxs("div",{className:"up-empty",children:["No usage data yet.",v.jsx("br",{}),"Start a Claude Code or Codex session."]})]})}const S3=15e3,b3=[70,80,85,90,95];function k3(e,n){const i=e-n;if(i<=0)return null;const s=Math.floor(i/86400),o=Math.floor(i%86400/3600),u=Math.floor(i%3600/60);return s>0?`${s}d ${o}h`:o>0?`${o}h ${u}m`:`${u}m`}function nx(e,n){const i=n-Math.floor(e/1e3);return i<60?"just now":i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:`${Math.floor(i/86400)}d ago`}function E3(e,n){if(!e)return"";const i=Math.floor(e/1e3)-n;return i<=0?" · due":i<60?` · next in ${i}s`:` · next in ${Math.round(i/60)}m`}function N3(e){return e==="http-429"?"rate limited":e==="http-401"?"re-login needed":e==="timeout"?"timed out":e==="network"?"unreachable":e}function C3({lane:e,nowSec:n}){const i=Math.min(100,Math.max(0,e.pct)),s=i>=90?"var(--err)":i>=70?"var(--warn)":"var(--accent)",o=e.resetAt?k3(e.resetAt,n):null;return v.jsxs("div",{className:"ap-lane",children:[v.jsx("span",{className:"ap-lane-label",children:e.label}),v.jsx("div",{className:"ap-lane-track",children:v.jsx("div",{className:"ap-lane-fill",style:{width:`${i===0?1.5:i}%`,background:s,opacity:i===0?.4:1}})}),v.jsxs("span",{className:"ap-lane-pct",style:{color:s},children:[i,"%"]}),v.jsx("span",{className:"ap-lane-reset",children:o?`resets ${o}`:""})]})}function R3({onClose:e}){var I,O,M;const[n,i]=q.useState(null),[s,o]=q.useState(null),[u,l]=q.useState(null),[c,d]=q.useState(null),[h,p]=q.useState(null),[m,y]=q.useState(()=>Math.floor(Date.now()/1e3)),x=q.useRef(null),N=q.useCallback(async(P=!1)=>{try{const[T,L]=await Promise.all([fetch(`/api/claude-accounts${P?"?refresh=1":""}`),fetch("/api/cswap-auto")]);T.ok&&i(await T.json()),L.ok&&o(await L.json())}catch{}},[]),_=q.useCallback(async(P,T)=>{l(T),p(null);try{const F=await(await fetch("/api/cswap-auto",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)})).json().catch(()=>null);return F!=null&&F.ok||p((F==null?void 0:F.detail)||(F==null?void 0:F.reason)||"command failed"),F}catch{return p("server unreachable"),null}finally{l(null)}},[]);q.useEffect(()=>(N(!0),x.current=window.setInterval(()=>N(!1),S3),()=>{x.current!=null&&window.clearInterval(x.current)}),[N]),q.useEffect(()=>{const P=window.setInterval(()=>y(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(P)},[]);const S=((I=s==null?void 0:s.settings["autoswitch.threshold"])==null?void 0:I.value)??"90",b=(O=n==null?void 0:n.accounts)==null?void 0:O.find(P=>P.active),k=b!=null&&b.lanes.length?Math.max(...b.lanes.map(P=>P.pct)):null,E=k!=null&&k>=Number(S)-15,C=async P=>{d(P),p(null);try{const L=await(await fetch("/api/claude-accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:P})})).json().catch(()=>null);L!=null&&L.ok||p((L==null?void 0:L.output)||(L==null?void 0:L.reason)||"switch failed"),await N(!0)}catch{p("server unreachable")}finally{d(null)}};return v.jsxs("div",{className:"accounts-panel","aria-label":"Claude accounts",children:[v.jsxs("div",{className:"ap-header",children:[v.jsx("h3",{children:"Accounts"}),v.jsxs("div",{className:"ap-header-right",children:[v.jsx("button",{type:"button",className:"btn ap-refresh",onClick:()=>N(!0),title:"Reload from claude-swap",children:"↻"}),v.jsx("button",{type:"button",className:"btn icon-btn",onClick:e,"aria-label":"Close accounts panel",title:"Close (A)",children:"×"})]})]}),n==null?v.jsx("div",{className:"ap-empty",children:"Checking…"}):n.ok?v.jsxs(v.Fragment,{children:[(M=n.accounts)==null?void 0:M.map(P=>v.jsxs("div",{className:`ap-account${P.active?" active":""}${P.disabled?" disabled":""}`,children:[v.jsxs("div",{className:"ap-account-head",children:[v.jsx("span",{className:"ap-num",children:P.num}),P.alias&&v.jsx("span",{className:"ap-alias",children:P.alias}),v.jsx("span",{className:"ap-email",title:P.org??void 0,children:P.email}),P.active?v.jsx("span",{className:"ap-badge-active",children:"● active"}):v.jsx("button",{type:"button",className:"btn ap-switch",disabled:c!=null||P.disabled,onClick:()=>C(P.num),title:P.disabled?"Held out of rotation":`Switch to ${P.alias??P.email}`,children:c===P.num?"…":"switch"})]}),P.lanes.length>0?P.lanes.map(T=>v.jsx(C3,{lane:T,nowSec:m},T.id)):v.jsx("div",{className:"ap-hint",children:"No usage recorded yet."}),v.jsxs("div",{className:"ap-meta",children:[P.error&&v.jsx("span",{className:"ap-err",children:N3(P.error)}),((s==null?void 0:s.enabled)||(s==null?void 0:s.external))&&!P.active&&v.jsx("button",{type:"button",className:"ap-rotate",disabled:u!=null,onClick:()=>_({action:"account",account:P.num,enabled:P.disabled},`rot-${P.num}`).then(()=>N(!0)),title:P.disabled?"Return this account to auto-rotation":"Hold this account out of auto-rotation",children:P.disabled?"held out":"in rotation"}),P.fetchedAt?v.jsxs("span",{className:`ap-age${P.stale?" ap-stale":""}`,title:"When claude-swap last read this account's usage, and when it plans to read it again. It sets that interval itself — 3 minutes at the fastest, wider while an account is recovering from a rate limit — and every surface, including `cswap watch`, follows the same plan.",children:["collected ",nx(P.fetchedAt,m),E3(P.nextAt,m)]}):v.jsx("span",{className:"ap-age ap-stale",title:"claude-swap has not read this account yet",children:"never collected"})]})]},P.num)),(s==null?void 0:s.ok)&&v.jsxs("div",{className:"ap-auto",children:[v.jsxs("div",{className:"ap-auto-head",children:[v.jsx("span",{className:"ap-auto-title",children:"Auto-switch"}),v.jsxs("span",{className:"ap-auto-ctl",children:[k!=null&&v.jsxs("span",{className:`ap-auto-now${E?" near":""}`,children:[Math.round(k),"%"]}),v.jsx("span",{className:"ap-field",title:"Switch once the active account passes this much of its limit",children:v.jsx("select",{"aria-label":"Switch threshold",value:S,disabled:u!=null,onChange:P=>_({action:"setting",key:"autoswitch.threshold",value:P.target.value},"threshold").then(()=>N(!0)),children:b3.map(P=>v.jsxs("option",{value:P,children:[P,"%"]},P))})}),v.jsxs("button",{type:"button",className:`ap-auto-state toggle${s.enabled?" live":""}`,role:"switch","aria-checked":s.enabled,disabled:u!=null,onClick:()=>_({action:"enable",enabled:!s.enabled},"enable").then(()=>N(!0)),title:s.enabled?"Stop switching accounts automatically":"Switch accounts automatically when the active one nears its limit",children:[v.jsx("i",{className:s.enabled?"ap-pulse":"ap-dot","aria-hidden":!0}),s.enabled?"on":"off"]})]})]}),s.external&&v.jsxs("p",{className:"ap-auto-note",children:[v.jsx("i",{className:"ap-pulse","aria-hidden":!0})," A ",v.jsx("code",{children:"cswap auto"})," loop in your terminal is doing the switching. The deck stands down while it runs",s.enabled?" — this toggle takes over when you stop it.":"."]}),s.lastTick&&v.jsx("div",{className:"ap-auto-foot",children:v.jsxs("span",{className:"ap-auto-result",children:["checked ",nx(s.lastTick.at,m)]})})]}),h&&v.jsx("div",{className:"ap-failure",children:h}),v.jsx("p",{className:"ap-footnote",title:"Anthropic's usage endpoint allows roughly 28–30 requests per hour per account, shared by every tool on this machine — polling it from here would rate-limit your account. So the deck never fetches: it asks claude-swap to collect while this panel is open, at most once every three minutes, and claude-swap decides whether that touches the network at all.",children:"Collected by claude-swap while this panel is open."})]}):v.jsx("div",{className:"ap-empty",children:n.reason==="no_cswap"?v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"claude-swap isn't installed."}),v.jsx("span",{className:"ap-hint",children:"This panel reads the account store claude-swap keeps — without it there is nothing to show. It is a separate tool, published on PyPI, so it does not come with this package."}),n.hint&&v.jsx("code",{className:"ap-cmd",children:n.hint}),v.jsxs("span",{className:"ap-hint",children:["Then add your accounts with ",v.jsx("code",{children:"cswap add"})," and reload."]})]}):n.reason==="no_accounts"?v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"No accounts added yet."}),v.jsx("span",{className:"ap-hint",children:"claude-swap is installed but has nothing in its store."}),v.jsx("code",{className:"ap-cmd",children:"cswap add"})]}):v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"Couldn't read the account store."}),v.jsxs("span",{className:"ap-hint",children:["claude-swap is installed, but its store could not be read",n.reason?` (${n.reason})`:"","."]})]})})]})}const T3=3e4;function j3(e){const n=e.thresholdMs??T3;return!e.enabled||e.kind!=="restart"||!e.canRestart?{idleSince:null,restart:!1}:e.busy?{idleSince:null,restart:!1}:e.idleSince==null?{idleSince:e.now,restart:!1}:e.now<e.idleSince?{idleSince:e.now,restart:!1}:{idleSince:e.idleSince,restart:e.now-e.idleSince>=n}}function Mi(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(2)}M`:`${(e/1e9).toFixed(2)}B`}function rx(e){return e.replace(/^anthropic\./,"").replace(/^claude-/,"").replace(/-\d{8}$/,"")}function pu(e){const n=e.toLowerCase();return n.includes("opus")?"#c4b5fd":n.includes("sonnet")?"#7dd3fc":n.includes("haiku")?"#86efac":n.includes("gpt-5")||n.includes("gpt5")?"#fcd34d":n.includes("gpt")?"#fca5a5":n.includes("gemini")?"#a5b4fc":n.includes("codex")?"#fdba74":"#94a3b8"}function A3(e){return new Date(Date.now()-(e-1)*864e5).toISOString().slice(0,10).replace(/-/g,"")}const I3=[7,14,30,90];function M3(e){const[n,i]=q.useState(null),[s,o]=q.useState(!1),u=(l=!1)=>{o(!0);const d=`/api/ccusage?since=${A3(e)}${l?"&refresh=1":""}`;fetch(d).then(h=>h.json()).then(i).catch(()=>i({ok:!1,error:"request failed"})).finally(()=>o(!1))};return q.useEffect(()=>{u(!1)},[e]),{data:n,loading:s,reload:()=>u(!0)}}function P3({onClose:e}){var b,k;const[n,i]=q.useState(30),[s,o]=q.useState(null),{data:u,loading:l,reload:c}=M3(n);q.useEffect(()=>{const E=C=>{C.key==="Escape"&&e()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[e]);const d=u!=null&&u.ok?u.days??[]:[],h=q.useMemo(()=>d.reduce((E,C)=>Math.max(E,C.totalCost),0),[d]),{totalCost:p,totalTok:m,inOut:y,cacheRead:x,modelCosts:N}=q.useMemo(()=>{let E=0,C=0,I=0,O=0;const M=new Map;for(const P of d){E+=P.totalCost,C+=P.totalTokens,I+=P.inputTokens+P.outputTokens,O+=P.cacheReadTokens;for(const T of P.modelBreakdowns)M.set(T.modelName,(M.get(T.modelName)??0)+T.cost)}return{totalCost:E,totalTok:C,inOut:I,cacheRead:O,modelCosts:M}},[d]),_=q.useMemo(()=>Array.from(N.entries()).sort((E,C)=>C[1]-E[1]),[N]),S=s?d.find(E=>E.period===s)??null:null;return v.jsx("div",{className:"uh-backdrop",onClick:e,role:"presentation",children:v.jsxs("div",{className:"uh-modal",onClick:E=>E.stopPropagation(),role:"dialog","aria-label":"Usage history",children:[v.jsxs("header",{className:"uh-head",children:[v.jsxs("div",{className:"uh-titlewrap",children:[v.jsx("div",{className:"uh-title",children:"Usage history"}),v.jsx("div",{className:"uh-sub",children:"via ccusage · local Claude / Codex logs"})]}),v.jsx("div",{className:"uh-range",role:"tablist","aria-label":"Range",children:I3.map(E=>v.jsxs("button",{role:"tab","aria-selected":n===E,className:`uh-range-btn${n===E?" on":""}`,onClick:()=>{i(E),o(null)},children:[E,"d"]},E))}),v.jsx("button",{className:"btn icon-btn uh-reload",onClick:c,title:"Re-run ccusage","aria-label":"Reload",children:"↻"}),v.jsx("button",{className:"uh-close",onClick:e,"aria-label":"Close",children:"×"})]}),l&&d.length===0?v.jsx("div",{className:"uh-status",children:"running ccusage… (first run downloads the package)"}):u&&!u.ok?v.jsxs("div",{className:"uh-status uh-err",children:["ccusage failed: ",u.error]}):d.length===0?v.jsx("div",{className:"uh-status",children:"no usage in this range"}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"uh-totals",children:[v.jsx(mu,{label:"total cost",val:Fe(p),accent:!0}),v.jsx(mu,{label:"tokens",val:Mi(m)}),v.jsx(mu,{label:"input+output",val:Mi(y)}),v.jsx(mu,{label:"cache reads",val:Mi(x)})]}),v.jsx("div",{className:"uh-chart",role:"img","aria-label":"Daily cost by model",children:d.map(E=>{const C=h>0?E.totalCost/h*100:0,I=E.period===s;return v.jsxs("button",{className:`uh-bar-col${I?" sel":""}`,onClick:()=>o(I?null:E.period),title:`${E.period} · ${Fe(E.totalCost)}`,style:{flexBasis:`${100/d.length}%`},children:[v.jsx("div",{className:"uh-bar",style:{height:`${Math.max(C,E.totalCost>0?2:0)}%`},children:E.modelBreakdowns.slice().sort((O,M)=>M.cost-O.cost).map(O=>{const M=E.totalCost>0?O.cost/E.totalCost*100:0;return v.jsx("div",{className:"uh-bar-seg",style:{height:`${M}%`,background:pu(O.modelName)}},O.modelName)})}),v.jsx("span",{className:"uh-bar-label",children:E.period.slice(5)})]},E.period)})}),v.jsx("div",{className:"uh-legend",children:_.map(([E,C])=>v.jsxs("span",{className:"uh-legend-item",children:[v.jsx("span",{className:"uh-legend-dot",style:{background:pu(E)}}),rx(E)," ",v.jsx("span",{className:"uh-legend-cost",children:Fe(C)})]},E))}),S&&v.jsxs("div",{className:"uh-detail",children:[v.jsxs("div",{className:"uh-detail-head",children:[v.jsx("span",{className:"uh-detail-date",children:S.period}),v.jsx("span",{className:"uh-detail-cost",children:Fe(S.totalCost)}),(k=(b=S.metadata)==null?void 0:b.agents)!=null&&k.length?v.jsx("span",{className:"uh-detail-agents",children:S.metadata.agents.join(" · ")}):null]}),v.jsxs("div",{className:"uh-detail-mini",children:[v.jsx(gu,{label:"input",val:Mi(S.inputTokens)}),v.jsx(gu,{label:"output",val:Mi(S.outputTokens)}),v.jsx(gu,{label:"cache write",val:Mi(S.cacheCreationTokens)}),v.jsx(gu,{label:"cache read",val:Mi(S.cacheReadTokens)})]}),v.jsx("div",{className:"uh-detail-models",children:S.modelBreakdowns.slice().sort((E,C)=>C.cost-E.cost).map(E=>{const C=S.totalCost>0?E.cost/S.totalCost*100:0;return v.jsxs("div",{className:"uh-model-row",children:[v.jsxs("span",{className:"uh-model-name",children:[v.jsx("span",{className:"uh-legend-dot",style:{background:pu(E.modelName)}}),rx(E.modelName)]}),v.jsx("span",{className:"uh-model-bar",children:v.jsx("span",{className:"uh-model-bar-fill",style:{width:`${C}%`,background:pu(E.modelName)}})}),v.jsx("span",{className:"uh-model-cost",children:Fe(E.cost)})]},E.modelName)})})]})]})]})})}function mu({label:e,val:n,accent:i}){return v.jsxs("div",{className:"uh-stat",children:[v.jsx("span",{className:`uh-stat-val${i?" accent":""}`,children:n}),v.jsx("span",{className:"uh-stat-label",children:e})]})}function gu({label:e,val:n}){return v.jsxs("div",{className:"uh-ministat",children:[v.jsx("span",{className:"uh-ministat-val",children:n}),v.jsx("span",{className:"uh-ministat-label",children:e})]})}function lv(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var tf,ix;function O3(){if(ix)return tf;ix=1;function e(){this.__data__=[],this.size=0}return tf=e,tf}var nf,sx;function Fs(){if(sx)return nf;sx=1;function e(n,i){return n===i||n!==n&&i!==i}return nf=e,nf}var rf,ox;function zu(){if(ox)return rf;ox=1;var e=Fs();function n(i,s){for(var o=i.length;o--;)if(e(i[o][0],s))return o;return-1}return rf=n,rf}var sf,ax;function q3(){if(ax)return sf;ax=1;var e=zu(),n=Array.prototype,i=n.splice;function s(o){var u=this.__data__,l=e(u,o);if(l<0)return!1;var c=u.length-1;return l==c?u.pop():i.call(u,l,1),--this.size,!0}return sf=s,sf}var of,ux;function L3(){if(ux)return of;ux=1;var e=zu();function n(i){var s=this.__data__,o=e(s,i);return o<0?void 0:s[o][1]}return of=n,of}var af,lx;function $3(){if(lx)return af;lx=1;var e=zu();function n(i){return e(this.__data__,i)>-1}return af=n,af}var uf,cx;function D3(){if(cx)return uf;cx=1;var e=zu();function n(i,s){var o=this.__data__,u=e(o,i);return u<0?(++this.size,o.push([i,s])):o[u][1]=s,this}return uf=n,uf}var lf,fx;function Bu(){if(fx)return lf;fx=1;var e=O3(),n=q3(),i=L3(),s=$3(),o=D3();function u(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var h=l[c];this.set(h[0],h[1])}}return u.prototype.clear=e,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,lf=u,lf}var cf,dx;function F3(){if(dx)return cf;dx=1;var e=Bu();function n(){this.__data__=new e,this.size=0}return cf=n,cf}var ff,hx;function z3(){if(hx)return ff;hx=1;function e(n){var i=this.__data__,s=i.delete(n);return this.size=i.size,s}return ff=e,ff}var df,px;function B3(){if(px)return df;px=1;function e(n){return this.__data__.get(n)}return df=e,df}var hf,mx;function U3(){if(mx)return hf;mx=1;function e(n){return this.__data__.has(n)}return hf=e,hf}var pf,gx;function fN(){if(gx)return pf;gx=1;var e=typeof nu=="object"&&nu&&nu.Object===Object&&nu;return pf=e,pf}var mf,vx;function Qn(){if(vx)return mf;vx=1;var e=fN(),n=typeof self=="object"&&self&&self.Object===Object&&self,i=e||n||Function("return this")();return mf=i,mf}var gf,yx;function zs(){if(yx)return gf;yx=1;var e=Qn(),n=e.Symbol;return gf=n,gf}var vf,wx;function H3(){if(wx)return vf;wx=1;var e=zs(),n=Object.prototype,i=n.hasOwnProperty,s=n.toString,o=e?e.toStringTag:void 0;function u(l){var c=i.call(l,o),d=l[o];try{l[o]=void 0;var h=!0}catch{}var p=s.call(l);return h&&(c?l[o]=d:delete l[o]),p}return vf=u,vf}var yf,xx;function V3(){if(xx)return yf;xx=1;var e=Object.prototype,n=e.toString;function i(s){return n.call(s)}return yf=i,yf}var wf,_x;function Ui(){if(_x)return wf;_x=1;var e=zs(),n=H3(),i=V3(),s="[object Null]",o="[object Undefined]",u=e?e.toStringTag:void 0;function l(c){return c==null?c===void 0?o:s:u&&u in Object(c)?n(c):i(c)}return wf=l,wf}var xf,Sx;function Pn(){if(Sx)return xf;Sx=1;function e(n){var i=typeof n;return n!=null&&(i=="object"||i=="function")}return xf=e,xf}var _f,bx;function Qo(){if(bx)return _f;bx=1;var e=Ui(),n=Pn(),i="[object AsyncFunction]",s="[object Function]",o="[object GeneratorFunction]",u="[object Proxy]";function l(c){if(!n(c))return!1;var d=e(c);return d==s||d==o||d==i||d==u}return _f=l,_f}var Sf,kx;function W3(){if(kx)return Sf;kx=1;var e=Qn(),n=e["__core-js_shared__"];return Sf=n,Sf}var bf,Ex;function G3(){if(Ex)return bf;Ex=1;var e=W3(),n=(function(){var s=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""})();function i(s){return!!n&&n in s}return bf=i,bf}var kf,Nx;function dN(){if(Nx)return kf;Nx=1;var e=Function.prototype,n=e.toString;function i(s){if(s!=null){try{return n.call(s)}catch{}try{return s+""}catch{}}return""}return kf=i,kf}var Ef,Cx;function Y3(){if(Cx)return Ef;Cx=1;var e=Qo(),n=G3(),i=Pn(),s=dN(),o=/[\\^$.*+?()[\]{}|]/g,u=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,d=l.toString,h=c.hasOwnProperty,p=RegExp("^"+d.call(h).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(y){if(!i(y)||n(y))return!1;var x=e(y)?p:u;return x.test(s(y))}return Ef=m,Ef}var Nf,Rx;function K3(){if(Rx)return Nf;Rx=1;function e(n,i){return n==null?void 0:n[i]}return Nf=e,Nf}var Cf,Tx;function Hi(){if(Tx)return Cf;Tx=1;var e=Y3(),n=K3();function i(s,o){var u=n(s,o);return e(u)?u:void 0}return Cf=i,Cf}var Rf,jx;function cv(){if(jx)return Rf;jx=1;var e=Hi(),n=Qn(),i=e(n,"Map");return Rf=i,Rf}var Tf,Ax;function Uu(){if(Ax)return Tf;Ax=1;var e=Hi(),n=e(Object,"create");return Tf=n,Tf}var jf,Ix;function X3(){if(Ix)return jf;Ix=1;var e=Uu();function n(){this.__data__=e?e(null):{},this.size=0}return jf=n,jf}var Af,Mx;function Q3(){if(Mx)return Af;Mx=1;function e(n){var i=this.has(n)&&delete this.__data__[n];return this.size-=i?1:0,i}return Af=e,Af}var If,Px;function Z3(){if(Px)return If;Px=1;var e=Uu(),n="__lodash_hash_undefined__",i=Object.prototype,s=i.hasOwnProperty;function o(u){var l=this.__data__;if(e){var c=l[u];return c===n?void 0:c}return s.call(l,u)?l[u]:void 0}return If=o,If}var Mf,Ox;function J3(){if(Ox)return Mf;Ox=1;var e=Uu(),n=Object.prototype,i=n.hasOwnProperty;function s(o){var u=this.__data__;return e?u[o]!==void 0:i.call(u,o)}return Mf=s,Mf}var Pf,qx;function eO(){if(qx)return Pf;qx=1;var e=Uu(),n="__lodash_hash_undefined__";function i(s,o){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=e&&o===void 0?n:o,this}return Pf=i,Pf}var Of,Lx;function tO(){if(Lx)return Of;Lx=1;var e=X3(),n=Q3(),i=Z3(),s=J3(),o=eO();function u(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var h=l[c];this.set(h[0],h[1])}}return u.prototype.clear=e,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,Of=u,Of}var qf,$x;function nO(){if($x)return qf;$x=1;var e=tO(),n=Bu(),i=cv();function s(){this.size=0,this.__data__={hash:new e,map:new(i||n),string:new e}}return qf=s,qf}var Lf,Dx;function rO(){if(Dx)return Lf;Dx=1;function e(n){var i=typeof n;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?n!=="__proto__":n===null}return Lf=e,Lf}var $f,Fx;function Hu(){if(Fx)return $f;Fx=1;var e=rO();function n(i,s){var o=i.__data__;return e(s)?o[typeof s=="string"?"string":"hash"]:o.map}return $f=n,$f}var Df,zx;function iO(){if(zx)return Df;zx=1;var e=Hu();function n(i){var s=e(this,i).delete(i);return this.size-=s?1:0,s}return Df=n,Df}var Ff,Bx;function sO(){if(Bx)return Ff;Bx=1;var e=Hu();function n(i){return e(this,i).get(i)}return Ff=n,Ff}var zf,Ux;function oO(){if(Ux)return zf;Ux=1;var e=Hu();function n(i){return e(this,i).has(i)}return zf=n,zf}var Bf,Hx;function aO(){if(Hx)return Bf;Hx=1;var e=Hu();function n(i,s){var o=e(this,i),u=o.size;return o.set(i,s),this.size+=o.size==u?0:1,this}return Bf=n,Bf}var Uf,Vx;function fv(){if(Vx)return Uf;Vx=1;var e=nO(),n=iO(),i=sO(),s=oO(),o=aO();function u(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var h=l[c];this.set(h[0],h[1])}}return u.prototype.clear=e,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,Uf=u,Uf}var Hf,Wx;function uO(){if(Wx)return Hf;Wx=1;var e=Bu(),n=cv(),i=fv(),s=200;function o(u,l){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!n||d.length<s-1)return d.push([u,l]),this.size=++c.size,this;c=this.__data__=new i(d)}return c.set(u,l),this.size=c.size,this}return Hf=o,Hf}var Vf,Gx;function Vu(){if(Gx)return Vf;Gx=1;var e=Bu(),n=F3(),i=z3(),s=B3(),o=U3(),u=uO();function l(c){var d=this.__data__=new e(c);this.size=d.size}return l.prototype.clear=n,l.prototype.delete=i,l.prototype.get=s,l.prototype.has=o,l.prototype.set=u,Vf=l,Vf}var Wf,Yx;function dv(){if(Yx)return Wf;Yx=1;function e(n,i){for(var s=-1,o=n==null?0:n.length;++s<o&&i(n[s],s,n)!==!1;);return n}return Wf=e,Wf}var Gf,Kx;function hN(){if(Kx)return Gf;Kx=1;var e=Hi(),n=(function(){try{var i=e(Object,"defineProperty");return i({},"",{}),i}catch{}})();return Gf=n,Gf}var Yf,Xx;function Wu(){if(Xx)return Yf;Xx=1;var e=hN();function n(i,s,o){s=="__proto__"&&e?e(i,s,{configurable:!0,enumerable:!0,value:o,writable:!0}):i[s]=o}return Yf=n,Yf}var Kf,Qx;function Gu(){if(Qx)return Kf;Qx=1;var e=Wu(),n=Fs(),i=Object.prototype,s=i.hasOwnProperty;function o(u,l,c){var d=u[l];(!(s.call(u,l)&&n(d,c))||c===void 0&&!(l in u))&&e(u,l,c)}return Kf=o,Kf}var Xf,Zx;function Zo(){if(Zx)return Xf;Zx=1;var e=Gu(),n=Wu();function i(s,o,u,l){var c=!u;u||(u={});for(var d=-1,h=o.length;++d<h;){var p=o[d],m=l?l(u[p],s[p],p,u,s):void 0;m===void 0&&(m=s[p]),c?n(u,p,m):e(u,p,m)}return u}return Xf=i,Xf}var Qf,Jx;function lO(){if(Jx)return Qf;Jx=1;function e(n,i){for(var s=-1,o=Array(n);++s<n;)o[s]=i(s);return o}return Qf=e,Qf}var Zf,e1;function dr(){if(e1)return Zf;e1=1;function e(n){return n!=null&&typeof n=="object"}return Zf=e,Zf}var Jf,t1;function cO(){if(t1)return Jf;t1=1;var e=Ui(),n=dr(),i="[object Arguments]";function s(o){return n(o)&&e(o)==i}return Jf=s,Jf}var ed,n1;function Jo(){if(n1)return ed;n1=1;var e=cO(),n=dr(),i=Object.prototype,s=i.hasOwnProperty,o=i.propertyIsEnumerable,u=e((function(){return arguments})())?e:function(l){return n(l)&&s.call(l,"callee")&&!o.call(l,"callee")};return ed=u,ed}var td,r1;function xt(){if(r1)return td;r1=1;var e=Array.isArray;return td=e,td}var Mo={exports:{}},nd,i1;function fO(){if(i1)return nd;i1=1;function e(){return!1}return nd=e,nd}Mo.exports;var s1;function Bs(){return s1||(s1=1,(function(e,n){var i=Qn(),s=fO(),o=n&&!n.nodeType&&n,u=o&&!0&&e&&!e.nodeType&&e,l=u&&u.exports===o,c=l?i.Buffer:void 0,d=c?c.isBuffer:void 0,h=d||s;e.exports=h})(Mo,Mo.exports)),Mo.exports}var rd,o1;function Yu(){if(o1)return rd;o1=1;var e=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function i(s,o){var u=typeof s;return o=o??e,!!o&&(u=="number"||u!="symbol"&&n.test(s))&&s>-1&&s%1==0&&s<o}return rd=i,rd}var id,a1;function hv(){if(a1)return id;a1=1;var e=9007199254740991;function n(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=e}return id=n,id}var sd,u1;function dO(){if(u1)return sd;u1=1;var e=Ui(),n=hv(),i=dr(),s="[object Arguments]",o="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",h="[object Map]",p="[object Number]",m="[object Object]",y="[object RegExp]",x="[object Set]",N="[object String]",_="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",k="[object Float32Array]",E="[object Float64Array]",C="[object Int8Array]",I="[object Int16Array]",O="[object Int32Array]",M="[object Uint8Array]",P="[object Uint8ClampedArray]",T="[object Uint16Array]",L="[object Uint32Array]",F={};F[k]=F[E]=F[C]=F[I]=F[O]=F[M]=F[P]=F[T]=F[L]=!0,F[s]=F[o]=F[S]=F[u]=F[b]=F[l]=F[c]=F[d]=F[h]=F[p]=F[m]=F[y]=F[x]=F[N]=F[_]=!1;function J(Q){return i(Q)&&n(Q.length)&&!!F[e(Q)]}return sd=J,sd}var od,l1;function Ku(){if(l1)return od;l1=1;function e(n){return function(i){return n(i)}}return od=e,od}var Po={exports:{}};Po.exports;var c1;function pv(){return c1||(c1=1,(function(e,n){var i=fN(),s=n&&!n.nodeType&&n,o=s&&!0&&e&&!e.nodeType&&e,u=o&&o.exports===s,l=u&&i.process,c=(function(){try{var d=o&&o.require&&o.require("util").types;return d||l&&l.binding&&l.binding("util")}catch{}})();e.exports=c})(Po,Po.exports)),Po.exports}var ad,f1;function ea(){if(f1)return ad;f1=1;var e=dO(),n=Ku(),i=pv(),s=i&&i.isTypedArray,o=s?n(s):e;return ad=o,ad}var ud,d1;function pN(){if(d1)return ud;d1=1;var e=lO(),n=Jo(),i=xt(),s=Bs(),o=Yu(),u=ea(),l=Object.prototype,c=l.hasOwnProperty;function d(h,p){var m=i(h),y=!m&&n(h),x=!m&&!y&&s(h),N=!m&&!y&&!x&&u(h),_=m||y||x||N,S=_?e(h.length,String):[],b=S.length;for(var k in h)(p||c.call(h,k))&&!(_&&(k=="length"||x&&(k=="offset"||k=="parent")||N&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||o(k,b)))&&S.push(k);return S}return ud=d,ud}var ld,h1;function Xu(){if(h1)return ld;h1=1;var e=Object.prototype;function n(i){var s=i&&i.constructor,o=typeof s=="function"&&s.prototype||e;return i===o}return ld=n,ld}var cd,p1;function mN(){if(p1)return cd;p1=1;function e(n,i){return function(s){return n(i(s))}}return cd=e,cd}var fd,m1;function hO(){if(m1)return fd;m1=1;var e=mN(),n=e(Object.keys,Object);return fd=n,fd}var dd,g1;function mv(){if(g1)return dd;g1=1;var e=Xu(),n=hO(),i=Object.prototype,s=i.hasOwnProperty;function o(u){if(!e(u))return n(u);var l=[];for(var c in Object(u))s.call(u,c)&&c!="constructor"&&l.push(c);return l}return dd=o,dd}var hd,v1;function jr(){if(v1)return hd;v1=1;var e=Qo(),n=hv();function i(s){return s!=null&&n(s.length)&&!e(s)}return hd=i,hd}var pd,y1;function ai(){if(y1)return pd;y1=1;var e=pN(),n=mv(),i=jr();function s(o){return i(o)?e(o):n(o)}return pd=s,pd}var md,w1;function pO(){if(w1)return md;w1=1;var e=Zo(),n=ai();function i(s,o){return s&&e(o,n(o),s)}return md=i,md}var gd,x1;function mO(){if(x1)return gd;x1=1;function e(n){var i=[];if(n!=null)for(var s in Object(n))i.push(s);return i}return gd=e,gd}var vd,_1;function gO(){if(_1)return vd;_1=1;var e=Pn(),n=Xu(),i=mO(),s=Object.prototype,o=s.hasOwnProperty;function u(l){if(!e(l))return i(l);var c=n(l),d=[];for(var h in l)h=="constructor"&&(c||!o.call(l,h))||d.push(h);return d}return vd=u,vd}var yd,S1;function Vi(){if(S1)return yd;S1=1;var e=pN(),n=gO(),i=jr();function s(o){return i(o)?e(o,!0):n(o)}return yd=s,yd}var wd,b1;function vO(){if(b1)return wd;b1=1;var e=Zo(),n=Vi();function i(s,o){return s&&e(o,n(o),s)}return wd=i,wd}var Oo={exports:{}};Oo.exports;var k1;function gN(){return k1||(k1=1,(function(e,n){var i=Qn(),s=n&&!n.nodeType&&n,o=s&&!0&&e&&!e.nodeType&&e,u=o&&o.exports===s,l=u?i.Buffer:void 0,c=l?l.allocUnsafe:void 0;function d(h,p){if(p)return h.slice();var m=h.length,y=c?c(m):new h.constructor(m);return h.copy(y),y}e.exports=d})(Oo,Oo.exports)),Oo.exports}var xd,E1;function vN(){if(E1)return xd;E1=1;function e(n,i){var s=-1,o=n.length;for(i||(i=Array(o));++s<o;)i[s]=n[s];return i}return xd=e,xd}var _d,N1;function yN(){if(N1)return _d;N1=1;function e(n,i){for(var s=-1,o=n==null?0:n.length,u=0,l=[];++s<o;){var c=n[s];i(c,s,n)&&(l[u++]=c)}return l}return _d=e,_d}var Sd,C1;function wN(){if(C1)return Sd;C1=1;function e(){return[]}return Sd=e,Sd}var bd,R1;function gv(){if(R1)return bd;R1=1;var e=yN(),n=wN(),i=Object.prototype,s=i.propertyIsEnumerable,o=Object.getOwnPropertySymbols,u=o?function(l){return l==null?[]:(l=Object(l),e(o(l),function(c){return s.call(l,c)}))}:n;return bd=u,bd}var kd,T1;function yO(){if(T1)return kd;T1=1;var e=Zo(),n=gv();function i(s,o){return e(s,n(s),o)}return kd=i,kd}var Ed,j1;function vv(){if(j1)return Ed;j1=1;function e(n,i){for(var s=-1,o=i.length,u=n.length;++s<o;)n[u+s]=i[s];return n}return Ed=e,Ed}var Nd,A1;function Qu(){if(A1)return Nd;A1=1;var e=mN(),n=e(Object.getPrototypeOf,Object);return Nd=n,Nd}var Cd,I1;function xN(){if(I1)return Cd;I1=1;var e=vv(),n=Qu(),i=gv(),s=wN(),o=Object.getOwnPropertySymbols,u=o?function(l){for(var c=[];l;)e(c,i(l)),l=n(l);return c}:s;return Cd=u,Cd}var Rd,M1;function wO(){if(M1)return Rd;M1=1;var e=Zo(),n=xN();function i(s,o){return e(s,n(s),o)}return Rd=i,Rd}var Td,P1;function _N(){if(P1)return Td;P1=1;var e=vv(),n=xt();function i(s,o,u){var l=o(s);return n(s)?l:e(l,u(s))}return Td=i,Td}var jd,O1;function SN(){if(O1)return jd;O1=1;var e=_N(),n=gv(),i=ai();function s(o){return e(o,i,n)}return jd=s,jd}var Ad,q1;function xO(){if(q1)return Ad;q1=1;var e=_N(),n=xN(),i=Vi();function s(o){return e(o,i,n)}return Ad=s,Ad}var Id,L1;function _O(){if(L1)return Id;L1=1;var e=Hi(),n=Qn(),i=e(n,"DataView");return Id=i,Id}var Md,$1;function SO(){if($1)return Md;$1=1;var e=Hi(),n=Qn(),i=e(n,"Promise");return Md=i,Md}var Pd,D1;function bN(){if(D1)return Pd;D1=1;var e=Hi(),n=Qn(),i=e(n,"Set");return Pd=i,Pd}var Od,F1;function bO(){if(F1)return Od;F1=1;var e=Hi(),n=Qn(),i=e(n,"WeakMap");return Od=i,Od}var qd,z1;function Us(){if(z1)return qd;z1=1;var e=_O(),n=cv(),i=SO(),s=bN(),o=bO(),u=Ui(),l=dN(),c="[object Map]",d="[object Object]",h="[object Promise]",p="[object Set]",m="[object WeakMap]",y="[object DataView]",x=l(e),N=l(n),_=l(i),S=l(s),b=l(o),k=u;return(e&&k(new e(new ArrayBuffer(1)))!=y||n&&k(new n)!=c||i&&k(i.resolve())!=h||s&&k(new s)!=p||o&&k(new o)!=m)&&(k=function(E){var C=u(E),I=C==d?E.constructor:void 0,O=I?l(I):"";if(O)switch(O){case x:return y;case N:return c;case _:return h;case S:return p;case b:return m}return C}),qd=k,qd}var Ld,B1;function kO(){if(B1)return Ld;B1=1;var e=Object.prototype,n=e.hasOwnProperty;function i(s){var o=s.length,u=new s.constructor(o);return o&&typeof s[0]=="string"&&n.call(s,"index")&&(u.index=s.index,u.input=s.input),u}return Ld=i,Ld}var $d,U1;function kN(){if(U1)return $d;U1=1;var e=Qn(),n=e.Uint8Array;return $d=n,$d}var Dd,H1;function yv(){if(H1)return Dd;H1=1;var e=kN();function n(i){var s=new i.constructor(i.byteLength);return new e(s).set(new e(i)),s}return Dd=n,Dd}var Fd,V1;function EO(){if(V1)return Fd;V1=1;var e=yv();function n(i,s){var o=s?e(i.buffer):i.buffer;return new i.constructor(o,i.byteOffset,i.byteLength)}return Fd=n,Fd}var zd,W1;function NO(){if(W1)return zd;W1=1;var e=/\w*$/;function n(i){var s=new i.constructor(i.source,e.exec(i));return s.lastIndex=i.lastIndex,s}return zd=n,zd}var Bd,G1;function CO(){if(G1)return Bd;G1=1;var e=zs(),n=e?e.prototype:void 0,i=n?n.valueOf:void 0;function s(o){return i?Object(i.call(o)):{}}return Bd=s,Bd}var Ud,Y1;function EN(){if(Y1)return Ud;Y1=1;var e=yv();function n(i,s){var o=s?e(i.buffer):i.buffer;return new i.constructor(o,i.byteOffset,i.length)}return Ud=n,Ud}var Hd,K1;function RO(){if(K1)return Hd;K1=1;var e=yv(),n=EO(),i=NO(),s=CO(),o=EN(),u="[object Boolean]",l="[object Date]",c="[object Map]",d="[object Number]",h="[object RegExp]",p="[object Set]",m="[object String]",y="[object Symbol]",x="[object ArrayBuffer]",N="[object DataView]",_="[object Float32Array]",S="[object Float64Array]",b="[object Int8Array]",k="[object Int16Array]",E="[object Int32Array]",C="[object Uint8Array]",I="[object Uint8ClampedArray]",O="[object Uint16Array]",M="[object Uint32Array]";function P(T,L,F){var J=T.constructor;switch(L){case x:return e(T);case u:case l:return new J(+T);case N:return n(T,F);case _:case S:case b:case k:case E:case C:case I:case O:case M:return o(T,F);case c:return new J;case d:case m:return new J(T);case h:return i(T);case p:return new J;case y:return s(T)}}return Hd=P,Hd}var Vd,X1;function NN(){if(X1)return Vd;X1=1;var e=Pn(),n=Object.create,i=(function(){function s(){}return function(o){if(!e(o))return{};if(n)return n(o);s.prototype=o;var u=new s;return s.prototype=void 0,u}})();return Vd=i,Vd}var Wd,Q1;function CN(){if(Q1)return Wd;Q1=1;var e=NN(),n=Qu(),i=Xu();function s(o){return typeof o.constructor=="function"&&!i(o)?e(n(o)):{}}return Wd=s,Wd}var Gd,Z1;function TO(){if(Z1)return Gd;Z1=1;var e=Us(),n=dr(),i="[object Map]";function s(o){return n(o)&&e(o)==i}return Gd=s,Gd}var Yd,J1;function jO(){if(J1)return Yd;J1=1;var e=TO(),n=Ku(),i=pv(),s=i&&i.isMap,o=s?n(s):e;return Yd=o,Yd}var Kd,e_;function AO(){if(e_)return Kd;e_=1;var e=Us(),n=dr(),i="[object Set]";function s(o){return n(o)&&e(o)==i}return Kd=s,Kd}var Xd,t_;function IO(){if(t_)return Xd;t_=1;var e=AO(),n=Ku(),i=pv(),s=i&&i.isSet,o=s?n(s):e;return Xd=o,Xd}var Qd,n_;function RN(){if(n_)return Qd;n_=1;var e=Vu(),n=dv(),i=Gu(),s=pO(),o=vO(),u=gN(),l=vN(),c=yO(),d=wO(),h=SN(),p=xO(),m=Us(),y=kO(),x=RO(),N=CN(),_=xt(),S=Bs(),b=jO(),k=Pn(),E=IO(),C=ai(),I=Vi(),O=1,M=2,P=4,T="[object Arguments]",L="[object Array]",F="[object Boolean]",J="[object Date]",Q="[object Error]",j="[object Function]",G="[object GeneratorFunction]",U="[object Map]",ne="[object Number]",K="[object Object]",$="[object RegExp]",W="[object Set]",A="[object String]",B="[object Symbol]",ue="[object WeakMap]",z="[object ArrayBuffer]",X="[object DataView]",ee="[object Float32Array]",se="[object Float64Array]",oe="[object Int8Array]",pe="[object Int16Array]",ge="[object Int32Array]",Ae="[object Uint8Array]",ze="[object Uint8ClampedArray]",Me="[object Uint16Array]",Ie="[object Uint32Array]",be={};be[T]=be[L]=be[z]=be[X]=be[F]=be[J]=be[ee]=be[se]=be[oe]=be[pe]=be[ge]=be[U]=be[ne]=be[K]=be[$]=be[W]=be[A]=be[B]=be[Ae]=be[ze]=be[Me]=be[Ie]=!0,be[Q]=be[j]=be[ue]=!1;function Be(ye,we,Le,Qe,et,Ve){var Ye,We=we&O,Ke=we&M,Qt=we&P;if(Le&&(Ye=et?Le(ye,Qe,et,Ve):Le(ye)),Ye!==void 0)return Ye;if(!k(ye))return ye;var vt=_(ye);if(vt){if(Ye=y(ye),!We)return l(ye,Ye)}else{var yt=m(ye),Zt=yt==j||yt==G;if(S(ye))return u(ye,We);if(yt==K||yt==T||Zt&&!et){if(Ye=Ke||Zt?{}:N(ye),!We)return Ke?d(ye,o(Ye,ye)):c(ye,s(Ye,ye))}else{if(!be[yt])return et?ye:{};Ye=x(ye,yt,We)}}Ve||(Ve=new e);var Ct=Ve.get(ye);if(Ct)return Ct;Ve.set(ye,Ye),E(ye)?ye.forEach(function(ht){Ye.add(Be(ht,we,Le,ht,ye,Ve))}):b(ye)&&ye.forEach(function(ht,at){Ye.set(at,Be(ht,we,Le,at,ye,Ve))});var Ze=Qt?Ke?p:h:Ke?I:C,_t=vt?void 0:Ze(ye);return n(_t||ye,function(ht,at){_t&&(at=ht,ht=ye[at]),i(Ye,at,Be(ht,we,Le,at,ye,Ve))}),Ye}return Qd=Be,Qd}var Zd,r_;function MO(){if(r_)return Zd;r_=1;var e=RN(),n=4;function i(s){return e(s,n)}return Zd=i,Zd}var Jd,i_;function wv(){if(i_)return Jd;i_=1;function e(n){return function(){return n}}return Jd=e,Jd}var eh,s_;function PO(){if(s_)return eh;s_=1;function e(n){return function(i,s,o){for(var u=-1,l=Object(i),c=o(i),d=c.length;d--;){var h=c[n?d:++u];if(s(l[h],h,l)===!1)break}return i}}return eh=e,eh}var th,o_;function xv(){if(o_)return th;o_=1;var e=PO(),n=e();return th=n,th}var nh,a_;function _v(){if(a_)return nh;a_=1;var e=xv(),n=ai();function i(s,o){return s&&e(s,o,n)}return nh=i,nh}var rh,u_;function OO(){if(u_)return rh;u_=1;var e=jr();function n(i,s){return function(o,u){if(o==null)return o;if(!e(o))return i(o,u);for(var l=o.length,c=s?l:-1,d=Object(o);(s?c--:++c<l)&&u(d[c],c,d)!==!1;);return o}}return rh=n,rh}var ih,l_;function Zu(){if(l_)return ih;l_=1;var e=_v(),n=OO(),i=n(e);return ih=i,ih}var sh,c_;function Wi(){if(c_)return sh;c_=1;function e(n){return n}return sh=e,sh}var oh,f_;function TN(){if(f_)return oh;f_=1;var e=Wi();function n(i){return typeof i=="function"?i:e}return oh=n,oh}var ah,d_;function jN(){if(d_)return ah;d_=1;var e=dv(),n=Zu(),i=TN(),s=xt();function o(u,l){var c=s(u)?e:n;return c(u,i(l))}return ah=o,ah}var uh,h_;function AN(){return h_||(h_=1,uh=jN()),uh}var lh,p_;function qO(){if(p_)return lh;p_=1;var e=Zu();function n(i,s){var o=[];return e(i,function(u,l,c){s(u,l,c)&&o.push(u)}),o}return lh=n,lh}var ch,m_;function LO(){if(m_)return ch;m_=1;var e="__lodash_hash_undefined__";function n(i){return this.__data__.set(i,e),this}return ch=n,ch}var fh,g_;function $O(){if(g_)return fh;g_=1;function e(n){return this.__data__.has(n)}return fh=e,fh}var dh,v_;function IN(){if(v_)return dh;v_=1;var e=fv(),n=LO(),i=$O();function s(o){var u=-1,l=o==null?0:o.length;for(this.__data__=new e;++u<l;)this.add(o[u])}return s.prototype.add=s.prototype.push=n,s.prototype.has=i,dh=s,dh}var hh,y_;function DO(){if(y_)return hh;y_=1;function e(n,i){for(var s=-1,o=n==null?0:n.length;++s<o;)if(i(n[s],s,n))return!0;return!1}return hh=e,hh}var ph,w_;function MN(){if(w_)return ph;w_=1;function e(n,i){return n.has(i)}return ph=e,ph}var mh,x_;function PN(){if(x_)return mh;x_=1;var e=IN(),n=DO(),i=MN(),s=1,o=2;function u(l,c,d,h,p,m){var y=d&s,x=l.length,N=c.length;if(x!=N&&!(y&&N>x))return!1;var _=m.get(l),S=m.get(c);if(_&&S)return _==c&&S==l;var b=-1,k=!0,E=d&o?new e:void 0;for(m.set(l,c),m.set(c,l);++b<x;){var C=l[b],I=c[b];if(h)var O=y?h(I,C,b,c,l,m):h(C,I,b,l,c,m);if(O!==void 0){if(O)continue;k=!1;break}if(E){if(!n(c,function(M,P){if(!i(E,P)&&(C===M||p(C,M,d,h,m)))return E.push(P)})){k=!1;break}}else if(!(C===I||p(C,I,d,h,m))){k=!1;break}}return m.delete(l),m.delete(c),k}return mh=u,mh}var gh,__;function FO(){if(__)return gh;__=1;function e(n){var i=-1,s=Array(n.size);return n.forEach(function(o,u){s[++i]=[u,o]}),s}return gh=e,gh}var vh,S_;function Sv(){if(S_)return vh;S_=1;function e(n){var i=-1,s=Array(n.size);return n.forEach(function(o){s[++i]=o}),s}return vh=e,vh}var yh,b_;function zO(){if(b_)return yh;b_=1;var e=zs(),n=kN(),i=Fs(),s=PN(),o=FO(),u=Sv(),l=1,c=2,d="[object Boolean]",h="[object Date]",p="[object Error]",m="[object Map]",y="[object Number]",x="[object RegExp]",N="[object Set]",_="[object String]",S="[object Symbol]",b="[object ArrayBuffer]",k="[object DataView]",E=e?e.prototype:void 0,C=E?E.valueOf:void 0;function I(O,M,P,T,L,F,J){switch(P){case k:if(O.byteLength!=M.byteLength||O.byteOffset!=M.byteOffset)return!1;O=O.buffer,M=M.buffer;case b:return!(O.byteLength!=M.byteLength||!F(new n(O),new n(M)));case d:case h:case y:return i(+O,+M);case p:return O.name==M.name&&O.message==M.message;case x:case _:return O==M+"";case m:var Q=o;case N:var j=T&l;if(Q||(Q=u),O.size!=M.size&&!j)return!1;var G=J.get(O);if(G)return G==M;T|=c,J.set(O,M);var U=s(Q(O),Q(M),T,L,F,J);return J.delete(O),U;case S:if(C)return C.call(O)==C.call(M)}return!1}return yh=I,yh}var wh,k_;function BO(){if(k_)return wh;k_=1;var e=SN(),n=1,i=Object.prototype,s=i.hasOwnProperty;function o(u,l,c,d,h,p){var m=c&n,y=e(u),x=y.length,N=e(l),_=N.length;if(x!=_&&!m)return!1;for(var S=x;S--;){var b=y[S];if(!(m?b in l:s.call(l,b)))return!1}var k=p.get(u),E=p.get(l);if(k&&E)return k==l&&E==u;var C=!0;p.set(u,l),p.set(l,u);for(var I=m;++S<x;){b=y[S];var O=u[b],M=l[b];if(d)var P=m?d(M,O,b,l,u,p):d(O,M,b,u,l,p);if(!(P===void 0?O===M||h(O,M,c,d,p):P)){C=!1;break}I||(I=b=="constructor")}if(C&&!I){var T=u.constructor,L=l.constructor;T!=L&&"constructor"in u&&"constructor"in l&&!(typeof T=="function"&&T instanceof T&&typeof L=="function"&&L instanceof L)&&(C=!1)}return p.delete(u),p.delete(l),C}return wh=o,wh}var xh,E_;function UO(){if(E_)return xh;E_=1;var e=Vu(),n=PN(),i=zO(),s=BO(),o=Us(),u=xt(),l=Bs(),c=ea(),d=1,h="[object Arguments]",p="[object Array]",m="[object Object]",y=Object.prototype,x=y.hasOwnProperty;function N(_,S,b,k,E,C){var I=u(_),O=u(S),M=I?p:o(_),P=O?p:o(S);M=M==h?m:M,P=P==h?m:P;var T=M==m,L=P==m,F=M==P;if(F&&l(_)){if(!l(S))return!1;I=!0,T=!1}if(F&&!T)return C||(C=new e),I||c(_)?n(_,S,b,k,E,C):i(_,S,M,b,k,E,C);if(!(b&d)){var J=T&&x.call(_,"__wrapped__"),Q=L&&x.call(S,"__wrapped__");if(J||Q){var j=J?_.value():_,G=Q?S.value():S;return C||(C=new e),E(j,G,b,k,C)}}return F?(C||(C=new e),s(_,S,b,k,E,C)):!1}return xh=N,xh}var _h,N_;function ON(){if(N_)return _h;N_=1;var e=UO(),n=dr();function i(s,o,u,l,c){return s===o?!0:s==null||o==null||!n(s)&&!n(o)?s!==s&&o!==o:e(s,o,u,l,i,c)}return _h=i,_h}var Sh,C_;function HO(){if(C_)return Sh;C_=1;var e=Vu(),n=ON(),i=1,s=2;function o(u,l,c,d){var h=c.length,p=h,m=!d;if(u==null)return!p;for(u=Object(u);h--;){var y=c[h];if(m&&y[2]?y[1]!==u[y[0]]:!(y[0]in u))return!1}for(;++h<p;){y=c[h];var x=y[0],N=u[x],_=y[1];if(m&&y[2]){if(N===void 0&&!(x in u))return!1}else{var S=new e;if(d)var b=d(N,_,x,u,l,S);if(!(b===void 0?n(_,N,i|s,d,S):b))return!1}}return!0}return Sh=o,Sh}var bh,R_;function qN(){if(R_)return bh;R_=1;var e=Pn();function n(i){return i===i&&!e(i)}return bh=n,bh}var kh,T_;function VO(){if(T_)return kh;T_=1;var e=qN(),n=ai();function i(s){for(var o=n(s),u=o.length;u--;){var l=o[u],c=s[l];o[u]=[l,c,e(c)]}return o}return kh=i,kh}var Eh,j_;function LN(){if(j_)return Eh;j_=1;function e(n,i){return function(s){return s==null?!1:s[n]===i&&(i!==void 0||n in Object(s))}}return Eh=e,Eh}var Nh,A_;function WO(){if(A_)return Nh;A_=1;var e=HO(),n=VO(),i=LN();function s(o){var u=n(o);return u.length==1&&u[0][2]?i(u[0][0],u[0][1]):function(l){return l===o||e(l,o,u)}}return Nh=s,Nh}var Ch,I_;function Hs(){if(I_)return Ch;I_=1;var e=Ui(),n=dr(),i="[object Symbol]";function s(o){return typeof o=="symbol"||n(o)&&e(o)==i}return Ch=s,Ch}var Rh,M_;function bv(){if(M_)return Rh;M_=1;var e=xt(),n=Hs(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;function o(u,l){if(e(u))return!1;var c=typeof u;return c=="number"||c=="symbol"||c=="boolean"||u==null||n(u)?!0:s.test(u)||!i.test(u)||l!=null&&u in Object(l)}return Rh=o,Rh}var Th,P_;function GO(){if(P_)return Th;P_=1;var e=fv(),n="Expected a function";function i(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new TypeError(n);var u=function(){var l=arguments,c=o?o.apply(this,l):l[0],d=u.cache;if(d.has(c))return d.get(c);var h=s.apply(this,l);return u.cache=d.set(c,h)||d,h};return u.cache=new(i.Cache||e),u}return i.Cache=e,Th=i,Th}var jh,O_;function YO(){if(O_)return jh;O_=1;var e=GO(),n=500;function i(s){var o=e(s,function(l){return u.size===n&&u.clear(),l}),u=o.cache;return o}return jh=i,jh}var Ah,q_;function KO(){if(q_)return Ah;q_=1;var e=YO(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,s=e(function(o){var u=[];return o.charCodeAt(0)===46&&u.push(""),o.replace(n,function(l,c,d,h){u.push(d?h.replace(i,"$1"):c||l)}),u});return Ah=s,Ah}var Ih,L_;function Ju(){if(L_)return Ih;L_=1;function e(n,i){for(var s=-1,o=n==null?0:n.length,u=Array(o);++s<o;)u[s]=i(n[s],s,n);return u}return Ih=e,Ih}var Mh,$_;function XO(){if($_)return Mh;$_=1;var e=zs(),n=Ju(),i=xt(),s=Hs(),o=e?e.prototype:void 0,u=o?o.toString:void 0;function l(c){if(typeof c=="string")return c;if(i(c))return n(c,l)+"";if(s(c))return u?u.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return Mh=l,Mh}var Ph,D_;function $N(){if(D_)return Ph;D_=1;var e=XO();function n(i){return i==null?"":e(i)}return Ph=n,Ph}var Oh,F_;function el(){if(F_)return Oh;F_=1;var e=xt(),n=bv(),i=KO(),s=$N();function o(u,l){return e(u)?u:n(u,l)?[u]:i(s(u))}return Oh=o,Oh}var qh,z_;function ta(){if(z_)return qh;z_=1;var e=Hs();function n(i){if(typeof i=="string"||e(i))return i;var s=i+"";return s=="0"&&1/i==-1/0?"-0":s}return qh=n,qh}var Lh,B_;function tl(){if(B_)return Lh;B_=1;var e=el(),n=ta();function i(s,o){o=e(o,s);for(var u=0,l=o.length;s!=null&&u<l;)s=s[n(o[u++])];return u&&u==l?s:void 0}return Lh=i,Lh}var $h,U_;function QO(){if(U_)return $h;U_=1;var e=tl();function n(i,s,o){var u=i==null?void 0:e(i,s);return u===void 0?o:u}return $h=n,$h}var Dh,H_;function ZO(){if(H_)return Dh;H_=1;function e(n,i){return n!=null&&i in Object(n)}return Dh=e,Dh}var Fh,V_;function DN(){if(V_)return Fh;V_=1;var e=el(),n=Jo(),i=xt(),s=Yu(),o=hv(),u=ta();function l(c,d,h){d=e(d,c);for(var p=-1,m=d.length,y=!1;++p<m;){var x=u(d[p]);if(!(y=c!=null&&h(c,x)))break;c=c[x]}return y||++p!=m?y:(m=c==null?0:c.length,!!m&&o(m)&&s(x,m)&&(i(c)||n(c)))}return Fh=l,Fh}var zh,W_;function FN(){if(W_)return zh;W_=1;var e=ZO(),n=DN();function i(s,o){return s!=null&&n(s,o,e)}return zh=i,zh}var Bh,G_;function JO(){if(G_)return Bh;G_=1;var e=ON(),n=QO(),i=FN(),s=bv(),o=qN(),u=LN(),l=ta(),c=1,d=2;function h(p,m){return s(p)&&o(m)?u(l(p),m):function(y){var x=n(y,p);return x===void 0&&x===m?i(y,p):e(m,x,c|d)}}return Bh=h,Bh}var Uh,Y_;function zN(){if(Y_)return Uh;Y_=1;function e(n){return function(i){return i==null?void 0:i[n]}}return Uh=e,Uh}var Hh,K_;function eq(){if(K_)return Hh;K_=1;var e=tl();function n(i){return function(s){return e(s,i)}}return Hh=n,Hh}var Vh,X_;function tq(){if(X_)return Vh;X_=1;var e=zN(),n=eq(),i=bv(),s=ta();function o(u){return i(u)?e(s(u)):n(u)}return Vh=o,Vh}var Wh,Q_;function Ar(){if(Q_)return Wh;Q_=1;var e=WO(),n=JO(),i=Wi(),s=xt(),o=tq();function u(l){return typeof l=="function"?l:l==null?i:typeof l=="object"?s(l)?n(l[0],l[1]):e(l):o(l)}return Wh=u,Wh}var Gh,Z_;function BN(){if(Z_)return Gh;Z_=1;var e=yN(),n=qO(),i=Ar(),s=xt();function o(u,l){var c=s(u)?e:n;return c(u,i(l,3))}return Gh=o,Gh}var Yh,J_;function nq(){if(J_)return Yh;J_=1;var e=Object.prototype,n=e.hasOwnProperty;function i(s,o){return s!=null&&n.call(s,o)}return Yh=i,Yh}var Kh,eS;function UN(){if(eS)return Kh;eS=1;var e=nq(),n=DN();function i(s,o){return s!=null&&n(s,o,e)}return Kh=i,Kh}var Xh,tS;function rq(){if(tS)return Xh;tS=1;var e=mv(),n=Us(),i=Jo(),s=xt(),o=jr(),u=Bs(),l=Xu(),c=ea(),d="[object Map]",h="[object Set]",p=Object.prototype,m=p.hasOwnProperty;function y(x){if(x==null)return!0;if(o(x)&&(s(x)||typeof x=="string"||typeof x.splice=="function"||u(x)||c(x)||i(x)))return!x.length;var N=n(x);if(N==d||N==h)return!x.size;if(l(x))return!e(x).length;for(var _ in x)if(m.call(x,_))return!1;return!0}return Xh=y,Xh}var Qh,nS;function HN(){if(nS)return Qh;nS=1;function e(n){return n===void 0}return Qh=e,Qh}var Zh,rS;function VN(){if(rS)return Zh;rS=1;var e=Zu(),n=jr();function i(s,o){var u=-1,l=n(s)?Array(s.length):[];return e(s,function(c,d,h){l[++u]=o(c,d,h)}),l}return Zh=i,Zh}var Jh,iS;function WN(){if(iS)return Jh;iS=1;var e=Ju(),n=Ar(),i=VN(),s=xt();function o(u,l){var c=s(u)?e:i;return c(u,n(l,3))}return Jh=o,Jh}var ep,sS;function iq(){if(sS)return ep;sS=1;function e(n,i,s,o){var u=-1,l=n==null?0:n.length;for(o&&l&&(s=n[++u]);++u<l;)s=i(s,n[u],u,n);return s}return ep=e,ep}var tp,oS;function sq(){if(oS)return tp;oS=1;function e(n,i,s,o,u){return u(n,function(l,c,d){s=o?(o=!1,l):i(s,l,c,d)}),s}return tp=e,tp}var np,aS;function GN(){if(aS)return np;aS=1;var e=iq(),n=Zu(),i=Ar(),s=sq(),o=xt();function u(l,c,d){var h=o(l)?e:s,p=arguments.length<3;return h(l,i(c,4),d,p,n)}return np=u,np}var rp,uS;function oq(){if(uS)return rp;uS=1;var e=Ui(),n=xt(),i=dr(),s="[object String]";function o(u){return typeof u=="string"||!n(u)&&i(u)&&e(u)==s}return rp=o,rp}var ip,lS;function aq(){if(lS)return ip;lS=1;var e=zN(),n=e("length");return ip=n,ip}var sp,cS;function uq(){if(cS)return sp;cS=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=n+i+s,u="\\ufe0e\\ufe0f",l="\\u200d",c=RegExp("["+l+e+o+u+"]");function d(h){return c.test(h)}return sp=d,sp}var op,fS;function lq(){if(fS)return op;fS=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=n+i+s,u="\\ufe0e\\ufe0f",l="["+e+"]",c="["+o+"]",d="\\ud83c[\\udffb-\\udfff]",h="(?:"+c+"|"+d+")",p="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",N=h+"?",_="["+u+"]?",S="(?:"+x+"(?:"+[p,m,y].join("|")+")"+_+N+")*",b=_+N+S,k="(?:"+[p+c+"?",c,m,y,l].join("|")+")",E=RegExp(d+"(?="+d+")|"+k+b,"g");function C(I){for(var O=E.lastIndex=0;E.test(I);)++O;return O}return op=C,op}var ap,dS;function cq(){if(dS)return ap;dS=1;var e=aq(),n=uq(),i=lq();function s(o){return n(o)?i(o):e(o)}return ap=s,ap}var up,hS;function fq(){if(hS)return up;hS=1;var e=mv(),n=Us(),i=jr(),s=oq(),o=cq(),u="[object Map]",l="[object Set]";function c(d){if(d==null)return 0;if(i(d))return s(d)?o(d):d.length;var h=n(d);return h==u||h==l?d.size:e(d).length}return up=c,up}var lp,pS;function dq(){if(pS)return lp;pS=1;var e=dv(),n=NN(),i=_v(),s=Ar(),o=Qu(),u=xt(),l=Bs(),c=Qo(),d=Pn(),h=ea();function p(m,y,x){var N=u(m),_=N||l(m)||h(m);if(y=s(y,4),x==null){var S=m&&m.constructor;_?x=N?new S:[]:d(m)?x=c(S)?n(o(m)):{}:x={}}return(_?e:i)(m,function(b,k,E){return y(x,b,k,E)}),x}return lp=p,lp}var cp,mS;function hq(){if(mS)return cp;mS=1;var e=zs(),n=Jo(),i=xt(),s=e?e.isConcatSpreadable:void 0;function o(u){return i(u)||n(u)||!!(s&&u&&u[s])}return cp=o,cp}var fp,gS;function kv(){if(gS)return fp;gS=1;var e=vv(),n=hq();function i(s,o,u,l,c){var d=-1,h=s.length;for(u||(u=n),c||(c=[]);++d<h;){var p=s[d];o>0&&u(p)?o>1?i(p,o-1,u,l,c):e(c,p):l||(c[c.length]=p)}return c}return fp=i,fp}var dp,vS;function pq(){if(vS)return dp;vS=1;function e(n,i,s){switch(s.length){case 0:return n.call(i);case 1:return n.call(i,s[0]);case 2:return n.call(i,s[0],s[1]);case 3:return n.call(i,s[0],s[1],s[2])}return n.apply(i,s)}return dp=e,dp}var hp,yS;function YN(){if(yS)return hp;yS=1;var e=pq(),n=Math.max;function i(s,o,u){return o=n(o===void 0?s.length-1:o,0),function(){for(var l=arguments,c=-1,d=n(l.length-o,0),h=Array(d);++c<d;)h[c]=l[o+c];c=-1;for(var p=Array(o+1);++c<o;)p[c]=l[c];return p[o]=u(h),e(s,this,p)}}return hp=i,hp}var pp,wS;function mq(){if(wS)return pp;wS=1;var e=wv(),n=hN(),i=Wi(),s=n?function(o,u){return n(o,"toString",{configurable:!0,enumerable:!1,value:e(u),writable:!0})}:i;return pp=s,pp}var mp,xS;function gq(){if(xS)return mp;xS=1;var e=800,n=16,i=Date.now;function s(o){var u=0,l=0;return function(){var c=i(),d=n-(c-l);if(l=c,d>0){if(++u>=e)return arguments[0]}else u=0;return o.apply(void 0,arguments)}}return mp=s,mp}var gp,_S;function KN(){if(_S)return gp;_S=1;var e=mq(),n=gq(),i=n(e);return gp=i,gp}var vp,SS;function nl(){if(SS)return vp;SS=1;var e=Wi(),n=YN(),i=KN();function s(o,u){return i(n(o,u,e),o+"")}return vp=s,vp}var yp,bS;function XN(){if(bS)return yp;bS=1;function e(n,i,s,o){for(var u=n.length,l=s+(o?1:-1);o?l--:++l<u;)if(i(n[l],l,n))return l;return-1}return yp=e,yp}var wp,kS;function vq(){if(kS)return wp;kS=1;function e(n){return n!==n}return wp=e,wp}var xp,ES;function yq(){if(ES)return xp;ES=1;function e(n,i,s){for(var o=s-1,u=n.length;++o<u;)if(n[o]===i)return o;return-1}return xp=e,xp}var _p,NS;function wq(){if(NS)return _p;NS=1;var e=XN(),n=vq(),i=yq();function s(o,u,l){return u===u?i(o,u,l):e(o,n,l)}return _p=s,_p}var Sp,CS;function xq(){if(CS)return Sp;CS=1;var e=wq();function n(i,s){var o=i==null?0:i.length;return!!o&&e(i,s,0)>-1}return Sp=n,Sp}var bp,RS;function _q(){if(RS)return bp;RS=1;function e(n,i,s){for(var o=-1,u=n==null?0:n.length;++o<u;)if(s(i,n[o]))return!0;return!1}return bp=e,bp}var kp,TS;function Sq(){if(TS)return kp;TS=1;function e(){}return kp=e,kp}var Ep,jS;function bq(){if(jS)return Ep;jS=1;var e=bN(),n=Sq(),i=Sv(),s=1/0,o=e&&1/i(new e([,-0]))[1]==s?function(u){return new e(u)}:n;return Ep=o,Ep}var Np,AS;function kq(){if(AS)return Np;AS=1;var e=IN(),n=xq(),i=_q(),s=MN(),o=bq(),u=Sv(),l=200;function c(d,h,p){var m=-1,y=n,x=d.length,N=!0,_=[],S=_;if(p)N=!1,y=i;else if(x>=l){var b=h?null:o(d);if(b)return u(b);N=!1,y=s,S=new e}else S=h?[]:_;e:for(;++m<x;){var k=d[m],E=h?h(k):k;if(k=p||k!==0?k:0,N&&E===E){for(var C=S.length;C--;)if(S[C]===E)continue e;h&&S.push(E),_.push(k)}else y(S,E,p)||(S!==_&&S.push(E),_.push(k))}return _}return Np=c,Np}var Cp,IS;function QN(){if(IS)return Cp;IS=1;var e=jr(),n=dr();function i(s){return n(s)&&e(s)}return Cp=i,Cp}var Rp,MS;function Eq(){if(MS)return Rp;MS=1;var e=kv(),n=nl(),i=kq(),s=QN(),o=n(function(u){return i(e(u,1,s,!0))});return Rp=o,Rp}var Tp,PS;function Nq(){if(PS)return Tp;PS=1;var e=Ju();function n(i,s){return e(s,function(o){return i[o]})}return Tp=n,Tp}var jp,OS;function ZN(){if(OS)return jp;OS=1;var e=Nq(),n=ai();function i(s){return s==null?[]:e(s,n(s))}return jp=i,jp}var Ap,qS;function On(){if(qS)return Ap;qS=1;var e;if(typeof lv=="function")try{e={clone:MO(),constant:wv(),each:AN(),filter:BN(),has:UN(),isArray:xt(),isEmpty:rq(),isFunction:Qo(),isUndefined:HN(),keys:ai(),map:WN(),reduce:GN(),size:fq(),transform:dq(),union:Eq(),values:ZN()}}catch{}return e||(e=window._),Ap=e,Ap}var Ip,LS;function Ev(){if(LS)return Ip;LS=1;var e=On();Ip=o;var n="\0",i="\0",s="";function o(p){this._isDirected=e.has(p,"directed")?p.directed:!0,this._isMultigraph=e.has(p,"multigraph")?p.multigraph:!1,this._isCompound=e.has(p,"compound")?p.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[i]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(p){return this._label=p,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultNodeLabelFn=p,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return e.keys(this._nodes)},o.prototype.sources=function(){var p=this;return e.filter(this.nodes(),function(m){return e.isEmpty(p._in[m])})},o.prototype.sinks=function(){var p=this;return e.filter(this.nodes(),function(m){return e.isEmpty(p._out[m])})},o.prototype.setNodes=function(p,m){var y=arguments,x=this;return e.each(p,function(N){y.length>1?x.setNode(N,m):x.setNode(N)}),this},o.prototype.setNode=function(p,m){return e.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=m),this):(this._nodes[p]=arguments.length>1?m:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=i,this._children[p]={},this._children[i][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},o.prototype.node=function(p){return this._nodes[p]},o.prototype.hasNode=function(p){return e.has(this._nodes,p)},o.prototype.removeNode=function(p){var m=this;if(e.has(this._nodes,p)){var y=function(x){m.removeEdge(m._edgeObjs[x])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],e.each(this.children(p),function(x){m.setParent(x)}),delete this._children[p]),e.each(e.keys(this._in[p]),y),delete this._in[p],delete this._preds[p],e.each(e.keys(this._out[p]),y),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},o.prototype.setParent=function(p,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(m))m=i;else{m+="";for(var y=m;!e.isUndefined(y);y=this.parent(y))if(y===p)throw new Error("Setting "+m+" as parent of "+p+" would create a cycle");this.setNode(m)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=m,this._children[m][p]=!0,this},o.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},o.prototype.parent=function(p){if(this._isCompound){var m=this._parent[p];if(m!==i)return m}},o.prototype.children=function(p){if(e.isUndefined(p)&&(p=i),this._isCompound){var m=this._children[p];if(m)return e.keys(m)}else{if(p===i)return this.nodes();if(this.hasNode(p))return[]}},o.prototype.predecessors=function(p){var m=this._preds[p];if(m)return e.keys(m)},o.prototype.successors=function(p){var m=this._sucs[p];if(m)return e.keys(m)},o.prototype.neighbors=function(p){var m=this.predecessors(p);if(m)return e.union(m,this.successors(p))},o.prototype.isLeaf=function(p){var m;return this.isDirected()?m=this.successors(p):m=this.neighbors(p),m.length===0},o.prototype.filterNodes=function(p){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var y=this;e.each(this._nodes,function(_,S){p(S)&&m.setNode(S,_)}),e.each(this._edgeObjs,function(_){m.hasNode(_.v)&&m.hasNode(_.w)&&m.setEdge(_,y.edge(_))});var x={};function N(_){var S=y.parent(_);return S===void 0||m.hasNode(S)?(x[_]=S,S):S in x?x[S]:N(S)}return this._isCompound&&e.each(m.nodes(),function(_){m.setParent(_,N(_))}),m},o.prototype.setDefaultEdgeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultEdgeLabelFn=p,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return e.values(this._edgeObjs)},o.prototype.setPath=function(p,m){var y=this,x=arguments;return e.reduce(p,function(N,_){return x.length>1?y.setEdge(N,_,m):y.setEdge(N,_),_}),this},o.prototype.setEdge=function(){var p,m,y,x,N=!1,_=arguments[0];typeof _=="object"&&_!==null&&"v"in _?(p=_.v,m=_.w,y=_.name,arguments.length===2&&(x=arguments[1],N=!0)):(p=_,m=arguments[1],y=arguments[3],arguments.length>2&&(x=arguments[2],N=!0)),p=""+p,m=""+m,e.isUndefined(y)||(y=""+y);var S=c(this._isDirected,p,m,y);if(e.has(this._edgeLabels,S))return N&&(this._edgeLabels[S]=x),this;if(!e.isUndefined(y)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(m),this._edgeLabels[S]=N?x:this._defaultEdgeLabelFn(p,m,y);var b=d(this._isDirected,p,m,y);return p=b.v,m=b.w,Object.freeze(b),this._edgeObjs[S]=b,u(this._preds[m],p),u(this._sucs[p],m),this._in[m][S]=b,this._out[p][S]=b,this._edgeCount++,this},o.prototype.edge=function(p,m,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,m,y);return this._edgeLabels[x]},o.prototype.hasEdge=function(p,m,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,m,y);return e.has(this._edgeLabels,x)},o.prototype.removeEdge=function(p,m,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,m,y),N=this._edgeObjs[x];return N&&(p=N.v,m=N.w,delete this._edgeLabels[x],delete this._edgeObjs[x],l(this._preds[m],p),l(this._sucs[p],m),delete this._in[m][x],delete this._out[p][x],this._edgeCount--),this},o.prototype.inEdges=function(p,m){var y=this._in[p];if(y){var x=e.values(y);return m?e.filter(x,function(N){return N.v===m}):x}},o.prototype.outEdges=function(p,m){var y=this._out[p];if(y){var x=e.values(y);return m?e.filter(x,function(N){return N.w===m}):x}},o.prototype.nodeEdges=function(p,m){var y=this.inEdges(p,m);if(y)return y.concat(this.outEdges(p,m))};function u(p,m){p[m]?p[m]++:p[m]=1}function l(p,m){--p[m]||delete p[m]}function c(p,m,y,x){var N=""+m,_=""+y;if(!p&&N>_){var S=N;N=_,_=S}return N+s+_+s+(e.isUndefined(x)?n:x)}function d(p,m,y,x){var N=""+m,_=""+y;if(!p&&N>_){var S=N;N=_,_=S}var b={v:N,w:_};return x&&(b.name=x),b}function h(p,m){return c(p,m.v,m.w,m.name)}return Ip}var Mp,$S;function Cq(){return $S||($S=1,Mp="2.1.8"),Mp}var Pp,DS;function Rq(){return DS||(DS=1,Pp={Graph:Ev(),version:Cq()}),Pp}var Op,FS;function Tq(){if(FS)return Op;FS=1;var e=On(),n=Ev();Op={write:i,read:u};function i(l){var c={options:{directed:l.isDirected(),multigraph:l.isMultigraph(),compound:l.isCompound()},nodes:s(l),edges:o(l)};return e.isUndefined(l.graph())||(c.value=e.clone(l.graph())),c}function s(l){return e.map(l.nodes(),function(c){var d=l.node(c),h=l.parent(c),p={v:c};return e.isUndefined(d)||(p.value=d),e.isUndefined(h)||(p.parent=h),p})}function o(l){return e.map(l.edges(),function(c){var d=l.edge(c),h={v:c.v,w:c.w};return e.isUndefined(c.name)||(h.name=c.name),e.isUndefined(d)||(h.value=d),h})}function u(l){var c=new n(l.options).setGraph(l.value);return e.each(l.nodes,function(d){c.setNode(d.v,d.value),d.parent&&c.setParent(d.v,d.parent)}),e.each(l.edges,function(d){c.setEdge({v:d.v,w:d.w,name:d.name},d.value)}),c}return Op}var qp,zS;function jq(){if(zS)return qp;zS=1;var e=On();qp=n;function n(i){var s={},o=[],u;function l(c){e.has(s,c)||(s[c]=!0,u.push(c),e.each(i.successors(c),l),e.each(i.predecessors(c),l))}return e.each(i.nodes(),function(c){u=[],l(c),u.length&&o.push(u)}),o}return qp}var Lp,BS;function JN(){if(BS)return Lp;BS=1;var e=On();Lp=n;function n(){this._arr=[],this._keyIndices={}}return n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(i){return i.key})},n.prototype.has=function(i){return e.has(this._keyIndices,i)},n.prototype.priority=function(i){var s=this._keyIndices[i];if(s!==void 0)return this._arr[s].priority},n.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(i,s){var o=this._keyIndices;if(i=String(i),!e.has(o,i)){var u=this._arr,l=u.length;return o[i]=l,u.push({key:i,priority:s}),this._decrease(l),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var i=this._arr.pop();return delete this._keyIndices[i.key],this._heapify(0),i.key},n.prototype.decrease=function(i,s){var o=this._keyIndices[i];if(s>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+i+" Old: "+this._arr[o].priority+" New: "+s);this._arr[o].priority=s,this._decrease(o)},n.prototype._heapify=function(i){var s=this._arr,o=2*i,u=o+1,l=i;o<s.length&&(l=s[o].priority<s[l].priority?o:l,u<s.length&&(l=s[u].priority<s[l].priority?u:l),l!==i&&(this._swap(i,l),this._heapify(l)))},n.prototype._decrease=function(i){for(var s=this._arr,o=s[i].priority,u;i!==0&&(u=i>>1,!(s[u].priority<o));)this._swap(i,u),i=u},n.prototype._swap=function(i,s){var o=this._arr,u=this._keyIndices,l=o[i],c=o[s];o[i]=c,o[s]=l,u[c.key]=i,u[l.key]=s},Lp}var $p,US;function eC(){if(US)return $p;US=1;var e=On(),n=JN();$p=s;var i=e.constant(1);function s(u,l,c,d){return o(u,String(l),c||i,d||function(h){return u.outEdges(h)})}function o(u,l,c,d){var h={},p=new n,m,y,x=function(N){var _=N.v!==m?N.v:N.w,S=h[_],b=c(N),k=y.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+N+" Weight: "+b);k<S.distance&&(S.distance=k,S.predecessor=m,p.decrease(_,k))};for(u.nodes().forEach(function(N){var _=N===l?0:Number.POSITIVE_INFINITY;h[N]={distance:_},p.add(N,_)});p.size()>0&&(m=p.removeMin(),y=h[m],y.distance!==Number.POSITIVE_INFINITY);)d(m).forEach(x);return h}return $p}var Dp,HS;function Aq(){if(HS)return Dp;HS=1;var e=eC(),n=On();Dp=i;function i(s,o,u){return n.transform(s.nodes(),function(l,c){l[c]=e(s,c,o,u)},{})}return Dp}var Fp,VS;function tC(){if(VS)return Fp;VS=1;var e=On();Fp=n;function n(i){var s=0,o=[],u={},l=[];function c(d){var h=u[d]={onStack:!0,lowlink:s,index:s++};if(o.push(d),i.successors(d).forEach(function(y){e.has(u,y)?u[y].onStack&&(h.lowlink=Math.min(h.lowlink,u[y].index)):(c(y),h.lowlink=Math.min(h.lowlink,u[y].lowlink))}),h.lowlink===h.index){var p=[],m;do m=o.pop(),u[m].onStack=!1,p.push(m);while(d!==m);l.push(p)}}return i.nodes().forEach(function(d){e.has(u,d)||c(d)}),l}return Fp}var zp,WS;function Iq(){if(WS)return zp;WS=1;var e=On(),n=tC();zp=i;function i(s){return e.filter(n(s),function(o){return o.length>1||o.length===1&&s.hasEdge(o[0],o[0])})}return zp}var Bp,GS;function Mq(){if(GS)return Bp;GS=1;var e=On();Bp=i;var n=e.constant(1);function i(o,u,l){return s(o,u||n,l||function(c){return o.outEdges(c)})}function s(o,u,l){var c={},d=o.nodes();return d.forEach(function(h){c[h]={},c[h][h]={distance:0},d.forEach(function(p){h!==p&&(c[h][p]={distance:Number.POSITIVE_INFINITY})}),l(h).forEach(function(p){var m=p.v===h?p.w:p.v,y=u(p);c[h][m]={distance:y,predecessor:h}})}),d.forEach(function(h){var p=c[h];d.forEach(function(m){var y=c[m];d.forEach(function(x){var N=y[h],_=p[x],S=y[x],b=N.distance+_.distance;b<S.distance&&(S.distance=b,S.predecessor=_.predecessor)})})}),c}return Bp}var Up,YS;function nC(){if(YS)return Up;YS=1;var e=On();Up=n,n.CycleException=i;function n(s){var o={},u={},l=[];function c(d){if(e.has(u,d))throw new i;e.has(o,d)||(u[d]=!0,o[d]=!0,e.each(s.predecessors(d),c),delete u[d],l.push(d))}if(e.each(s.sinks(),c),e.size(o)!==s.nodeCount())throw new i;return l}function i(){}return i.prototype=new Error,Up}var Hp,KS;function Pq(){if(KS)return Hp;KS=1;var e=nC();Hp=n;function n(i){try{e(i)}catch(s){if(s instanceof e.CycleException)return!1;throw s}return!0}return Hp}var Vp,XS;function rC(){if(XS)return Vp;XS=1;var e=On();Vp=n;function n(s,o,u){e.isArray(o)||(o=[o]);var l=(s.isDirected()?s.successors:s.neighbors).bind(s),c=[],d={};return e.each(o,function(h){if(!s.hasNode(h))throw new Error("Graph does not have node: "+h);i(s,h,u==="post",d,l,c)}),c}function i(s,o,u,l,c,d){e.has(l,o)||(l[o]=!0,u||d.push(o),e.each(c(o),function(h){i(s,h,u,l,c,d)}),u&&d.push(o))}return Vp}var Wp,QS;function Oq(){if(QS)return Wp;QS=1;var e=rC();Wp=n;function n(i,s){return e(i,s,"post")}return Wp}var Gp,ZS;function qq(){if(ZS)return Gp;ZS=1;var e=rC();Gp=n;function n(i,s){return e(i,s,"pre")}return Gp}var Yp,JS;function Lq(){if(JS)return Yp;JS=1;var e=On(),n=Ev(),i=JN();Yp=s;function s(o,u){var l=new n,c={},d=new i,h;function p(y){var x=y.v===h?y.w:y.v,N=d.priority(x);if(N!==void 0){var _=u(y);_<N&&(c[x]=h,d.decrease(x,_))}}if(o.nodeCount()===0)return l;e.each(o.nodes(),function(y){d.add(y,Number.POSITIVE_INFINITY),l.setNode(y)}),d.decrease(o.nodes()[0],0);for(var m=!1;d.size()>0;){if(h=d.removeMin(),e.has(c,h))l.setEdge(h,c[h]);else{if(m)throw new Error("Input graph is not connected: "+o);m=!0}o.nodeEdges(h).forEach(p)}return l}return Yp}var Kp,eb;function $q(){return eb||(eb=1,Kp={components:jq(),dijkstra:eC(),dijkstraAll:Aq(),findCycles:Iq(),floydWarshall:Mq(),isAcyclic:Pq(),postorder:Oq(),preorder:qq(),prim:Lq(),tarjan:tC(),topsort:nC()}),Kp}var Xp,tb;function Dq(){if(tb)return Xp;tb=1;var e=Rq();return Xp={Graph:e.Graph,json:Tq(),alg:$q(),version:e.version},Xp}var Qp,nb;function Kn(){if(nb)return Qp;nb=1;var e;if(typeof lv=="function")try{e=Dq()}catch{}return e||(e=window.graphlib),Qp=e,Qp}var Zp,rb;function Fq(){if(rb)return Zp;rb=1;var e=RN(),n=1,i=4;function s(o){return e(o,n|i)}return Zp=s,Zp}var Jp,ib;function rl(){if(ib)return Jp;ib=1;var e=Fs(),n=jr(),i=Yu(),s=Pn();function o(u,l,c){if(!s(c))return!1;var d=typeof l;return(d=="number"?n(c)&&i(l,c.length):d=="string"&&l in c)?e(c[l],u):!1}return Jp=o,Jp}var em,sb;function zq(){if(sb)return em;sb=1;var e=nl(),n=Fs(),i=rl(),s=Vi(),o=Object.prototype,u=o.hasOwnProperty,l=e(function(c,d){c=Object(c);var h=-1,p=d.length,m=p>2?d[2]:void 0;for(m&&i(d[0],d[1],m)&&(p=1);++h<p;)for(var y=d[h],x=s(y),N=-1,_=x.length;++N<_;){var S=x[N],b=c[S];(b===void 0||n(b,o[S])&&!u.call(c,S))&&(c[S]=y[S])}return c});return em=l,em}var tm,ob;function Bq(){if(ob)return tm;ob=1;var e=Ar(),n=jr(),i=ai();function s(o){return function(u,l,c){var d=Object(u);if(!n(u)){var h=e(l,3);u=i(u),l=function(m){return h(d[m],m,d)}}var p=o(u,l,c);return p>-1?d[h?u[p]:p]:void 0}}return tm=s,tm}var nm,ab;function Uq(){if(ab)return nm;ab=1;var e=/\s/;function n(i){for(var s=i.length;s--&&e.test(i.charAt(s)););return s}return nm=n,nm}var rm,ub;function Hq(){if(ub)return rm;ub=1;var e=Uq(),n=/^\s+/;function i(s){return s&&s.slice(0,e(s)+1).replace(n,"")}return rm=i,rm}var im,lb;function Vq(){if(lb)return im;lb=1;var e=Hq(),n=Pn(),i=Hs(),s=NaN,o=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;function d(h){if(typeof h=="number")return h;if(i(h))return s;if(n(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=n(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=e(h);var m=u.test(h);return m||l.test(h)?c(h.slice(2),m?2:8):o.test(h)?s:+h}return im=d,im}var sm,cb;function iC(){if(cb)return sm;cb=1;var e=Vq(),n=1/0,i=17976931348623157e292;function s(o){if(!o)return o===0?o:0;if(o=e(o),o===n||o===-n){var u=o<0?-1:1;return u*i}return o===o?o:0}return sm=s,sm}var om,fb;function Wq(){if(fb)return om;fb=1;var e=iC();function n(i){var s=e(i),o=s%1;return s===s?o?s-o:s:0}return om=n,om}var am,db;function Gq(){if(db)return am;db=1;var e=XN(),n=Ar(),i=Wq(),s=Math.max;function o(u,l,c){var d=u==null?0:u.length;if(!d)return-1;var h=c==null?0:i(c);return h<0&&(h=s(d+h,0)),e(u,n(l,3),h)}return am=o,am}var um,hb;function Yq(){if(hb)return um;hb=1;var e=Bq(),n=Gq(),i=e(n);return um=i,um}var lm,pb;function sC(){if(pb)return lm;pb=1;var e=kv();function n(i){var s=i==null?0:i.length;return s?e(i,1):[]}return lm=n,lm}var cm,mb;function Kq(){if(mb)return cm;mb=1;var e=xv(),n=TN(),i=Vi();function s(o,u){return o==null?o:e(o,n(u),i)}return cm=s,cm}var fm,gb;function Xq(){if(gb)return fm;gb=1;function e(n){var i=n==null?0:n.length;return i?n[i-1]:void 0}return fm=e,fm}var dm,vb;function Qq(){if(vb)return dm;vb=1;var e=Wu(),n=_v(),i=Ar();function s(o,u){var l={};return u=i(u,3),n(o,function(c,d,h){e(l,d,u(c,d,h))}),l}return dm=s,dm}var hm,yb;function Nv(){if(yb)return hm;yb=1;var e=Hs();function n(i,s,o){for(var u=-1,l=i.length;++u<l;){var c=i[u],d=s(c);if(d!=null&&(h===void 0?d===d&&!e(d):o(d,h)))var h=d,p=c}return p}return hm=n,hm}var pm,wb;function Zq(){if(wb)return pm;wb=1;function e(n,i){return n>i}return pm=e,pm}var mm,xb;function Jq(){if(xb)return mm;xb=1;var e=Nv(),n=Zq(),i=Wi();function s(o){return o&&o.length?e(o,i,n):void 0}return mm=s,mm}var gm,_b;function oC(){if(_b)return gm;_b=1;var e=Wu(),n=Fs();function i(s,o,u){(u!==void 0&&!n(s[o],u)||u===void 0&&!(o in s))&&e(s,o,u)}return gm=i,gm}var vm,Sb;function eL(){if(Sb)return vm;Sb=1;var e=Ui(),n=Qu(),i=dr(),s="[object Object]",o=Function.prototype,u=Object.prototype,l=o.toString,c=u.hasOwnProperty,d=l.call(Object);function h(p){if(!i(p)||e(p)!=s)return!1;var m=n(p);if(m===null)return!0;var y=c.call(m,"constructor")&&m.constructor;return typeof y=="function"&&y instanceof y&&l.call(y)==d}return vm=h,vm}var ym,bb;function aC(){if(bb)return ym;bb=1;function e(n,i){if(!(i==="constructor"&&typeof n[i]=="function")&&i!="__proto__")return n[i]}return ym=e,ym}var wm,kb;function tL(){if(kb)return wm;kb=1;var e=Zo(),n=Vi();function i(s){return e(s,n(s))}return wm=i,wm}var xm,Eb;function nL(){if(Eb)return xm;Eb=1;var e=oC(),n=gN(),i=EN(),s=vN(),o=CN(),u=Jo(),l=xt(),c=QN(),d=Bs(),h=Qo(),p=Pn(),m=eL(),y=ea(),x=aC(),N=tL();function _(S,b,k,E,C,I,O){var M=x(S,k),P=x(b,k),T=O.get(P);if(T){e(S,k,T);return}var L=I?I(M,P,k+"",S,b,O):void 0,F=L===void 0;if(F){var J=l(P),Q=!J&&d(P),j=!J&&!Q&&y(P);L=P,J||Q||j?l(M)?L=M:c(M)?L=s(M):Q?(F=!1,L=n(P,!0)):j?(F=!1,L=i(P,!0)):L=[]:m(P)||u(P)?(L=M,u(M)?L=N(M):(!p(M)||h(M))&&(L=o(P))):F=!1}F&&(O.set(P,L),C(L,P,E,I,O),O.delete(P)),e(S,k,L)}return xm=_,xm}var _m,Nb;function rL(){if(Nb)return _m;Nb=1;var e=Vu(),n=oC(),i=xv(),s=nL(),o=Pn(),u=Vi(),l=aC();function c(d,h,p,m,y){d!==h&&i(h,function(x,N){if(y||(y=new e),o(x))s(d,h,N,p,c,m,y);else{var _=m?m(l(d,N),x,N+"",d,h,y):void 0;_===void 0&&(_=x),n(d,N,_)}},u)}return _m=c,_m}var Sm,Cb;function iL(){if(Cb)return Sm;Cb=1;var e=nl(),n=rl();function i(s){return e(function(o,u){var l=-1,c=u.length,d=c>1?u[c-1]:void 0,h=c>2?u[2]:void 0;for(d=s.length>3&&typeof d=="function"?(c--,d):void 0,h&&n(u[0],u[1],h)&&(d=c<3?void 0:d,c=1),o=Object(o);++l<c;){var p=u[l];p&&s(o,p,l,d)}return o})}return Sm=i,Sm}var bm,Rb;function sL(){if(Rb)return bm;Rb=1;var e=rL(),n=iL(),i=n(function(s,o,u){e(s,o,u)});return bm=i,bm}var km,Tb;function uC(){if(Tb)return km;Tb=1;function e(n,i){return n<i}return km=e,km}var Em,jb;function oL(){if(jb)return Em;jb=1;var e=Nv(),n=uC(),i=Wi();function s(o){return o&&o.length?e(o,i,n):void 0}return Em=s,Em}var Nm,Ab;function aL(){if(Ab)return Nm;Ab=1;var e=Nv(),n=Ar(),i=uC();function s(o,u){return o&&o.length?e(o,n(u,2),i):void 0}return Nm=s,Nm}var Cm,Ib;function uL(){if(Ib)return Cm;Ib=1;var e=Qn(),n=function(){return e.Date.now()};return Cm=n,Cm}var Rm,Mb;function lL(){if(Mb)return Rm;Mb=1;var e=Gu(),n=el(),i=Yu(),s=Pn(),o=ta();function u(l,c,d,h){if(!s(l))return l;c=n(c,l);for(var p=-1,m=c.length,y=m-1,x=l;x!=null&&++p<m;){var N=o(c[p]),_=d;if(N==="__proto__"||N==="constructor"||N==="prototype")return l;if(p!=y){var S=x[N];_=h?h(S,N,x):void 0,_===void 0&&(_=s(S)?S:i(c[p+1])?[]:{})}e(x,N,_),x=x[N]}return l}return Rm=u,Rm}var Tm,Pb;function cL(){if(Pb)return Tm;Pb=1;var e=tl(),n=lL(),i=el();function s(o,u,l){for(var c=-1,d=u.length,h={};++c<d;){var p=u[c],m=e(o,p);l(m,p)&&n(h,i(p,o),m)}return h}return Tm=s,Tm}var jm,Ob;function fL(){if(Ob)return jm;Ob=1;var e=cL(),n=FN();function i(s,o){return e(s,o,function(u,l){return n(s,l)})}return jm=i,jm}var Am,qb;function dL(){if(qb)return Am;qb=1;var e=sC(),n=YN(),i=KN();function s(o){return i(n(o,void 0,e),o+"")}return Am=s,Am}var Im,Lb;function hL(){if(Lb)return Im;Lb=1;var e=fL(),n=dL(),i=n(function(s,o){return s==null?{}:e(s,o)});return Im=i,Im}var Mm,$b;function pL(){if($b)return Mm;$b=1;var e=Math.ceil,n=Math.max;function i(s,o,u,l){for(var c=-1,d=n(e((o-s)/(u||1)),0),h=Array(d);d--;)h[l?d:++c]=s,s+=u;return h}return Mm=i,Mm}var Pm,Db;function mL(){if(Db)return Pm;Db=1;var e=pL(),n=rl(),i=iC();function s(o){return function(u,l,c){return c&&typeof c!="number"&&n(u,l,c)&&(l=c=void 0),u=i(u),l===void 0?(l=u,u=0):l=i(l),c=c===void 0?u<l?1:-1:i(c),e(u,l,c,o)}}return Pm=s,Pm}var Om,Fb;function gL(){if(Fb)return Om;Fb=1;var e=mL(),n=e();return Om=n,Om}var qm,zb;function vL(){if(zb)return qm;zb=1;function e(n,i){var s=n.length;for(n.sort(i);s--;)n[s]=n[s].value;return n}return qm=e,qm}var Lm,Bb;function yL(){if(Bb)return Lm;Bb=1;var e=Hs();function n(i,s){if(i!==s){var o=i!==void 0,u=i===null,l=i===i,c=e(i),d=s!==void 0,h=s===null,p=s===s,m=e(s);if(!h&&!m&&!c&&i>s||c&&d&&p&&!h&&!m||u&&d&&p||!o&&p||!l)return 1;if(!u&&!c&&!m&&i<s||m&&o&&l&&!u&&!c||h&&o&&l||!d&&l||!p)return-1}return 0}return Lm=n,Lm}var $m,Ub;function wL(){if(Ub)return $m;Ub=1;var e=yL();function n(i,s,o){for(var u=-1,l=i.criteria,c=s.criteria,d=l.length,h=o.length;++u<d;){var p=e(l[u],c[u]);if(p){if(u>=h)return p;var m=o[u];return p*(m=="desc"?-1:1)}}return i.index-s.index}return $m=n,$m}var Dm,Hb;function xL(){if(Hb)return Dm;Hb=1;var e=Ju(),n=tl(),i=Ar(),s=VN(),o=vL(),u=Ku(),l=wL(),c=Wi(),d=xt();function h(p,m,y){m.length?m=e(m,function(_){return d(_)?function(S){return n(S,_.length===1?_[0]:_)}:_}):m=[c];var x=-1;m=e(m,u(i));var N=s(p,function(_,S,b){var k=e(m,function(E){return E(_)});return{criteria:k,index:++x,value:_}});return o(N,function(_,S){return l(_,S,y)})}return Dm=h,Dm}var Fm,Vb;function _L(){if(Vb)return Fm;Vb=1;var e=kv(),n=xL(),i=nl(),s=rl(),o=i(function(u,l){if(u==null)return[];var c=l.length;return c>1&&s(u,l[0],l[1])?l=[]:c>2&&s(l[0],l[1],l[2])&&(l=[l[0]]),n(u,e(l,1),[])});return Fm=o,Fm}var zm,Wb;function SL(){if(Wb)return zm;Wb=1;var e=$N(),n=0;function i(s){var o=++n;return e(s)+o}return zm=i,zm}var Bm,Gb;function bL(){if(Gb)return Bm;Gb=1;function e(n,i,s){for(var o=-1,u=n.length,l=i.length,c={};++o<u;){var d=o<l?i[o]:void 0;s(c,n[o],d)}return c}return Bm=e,Bm}var Um,Yb;function kL(){if(Yb)return Um;Yb=1;var e=Gu(),n=bL();function i(s,o){return n(s||[],o||[],e)}return Um=i,Um}var Hm,Kb;function lt(){if(Kb)return Hm;Kb=1;var e;if(typeof lv=="function")try{e={cloneDeep:Fq(),constant:wv(),defaults:zq(),each:AN(),filter:BN(),find:Yq(),flatten:sC(),forEach:jN(),forIn:Kq(),has:UN(),isUndefined:HN(),last:Xq(),map:WN(),mapValues:Qq(),max:Jq(),merge:sL(),min:oL(),minBy:aL(),now:uL(),pick:hL(),range:gL(),reduce:GN(),sortBy:_L(),uniqueId:SL(),values:ZN(),zipObject:kL()}}catch{}return e||(e=window._),Hm=e,Hm}var Vm,Xb;function EL(){if(Xb)return Vm;Xb=1,Vm=e;function e(){var s={};s._next=s._prev=s,this._sentinel=s}e.prototype.dequeue=function(){var s=this._sentinel,o=s._prev;if(o!==s)return n(o),o},e.prototype.enqueue=function(s){var o=this._sentinel;s._prev&&s._next&&n(s),s._next=o._next,o._next._prev=s,o._next=s,s._prev=o},e.prototype.toString=function(){for(var s=[],o=this._sentinel,u=o._prev;u!==o;)s.push(JSON.stringify(u,i)),u=u._prev;return"["+s.join(", ")+"]"};function n(s){s._prev._next=s._next,s._next._prev=s._prev,delete s._next,delete s._prev}function i(s,o){if(s!=="_next"&&s!=="_prev")return o}return Vm}var Wm,Qb;function NL(){if(Qb)return Wm;Qb=1;var e=lt(),n=Kn().Graph,i=EL();Wm=o;var s=e.constant(1);function o(h,p){if(h.nodeCount()<=1)return[];var m=c(h,p||s),y=u(m.graph,m.buckets,m.zeroIdx);return e.flatten(e.map(y,function(x){return h.outEdges(x.v,x.w)}),!0)}function u(h,p,m){for(var y=[],x=p[p.length-1],N=p[0],_;h.nodeCount();){for(;_=N.dequeue();)l(h,p,m,_);for(;_=x.dequeue();)l(h,p,m,_);if(h.nodeCount()){for(var S=p.length-2;S>0;--S)if(_=p[S].dequeue(),_){y=y.concat(l(h,p,m,_,!0));break}}}return y}function l(h,p,m,y,x){var N=x?[]:void 0;return e.forEach(h.inEdges(y.v),function(_){var S=h.edge(_),b=h.node(_.v);x&&N.push({v:_.v,w:_.w}),b.out-=S,d(p,m,b)}),e.forEach(h.outEdges(y.v),function(_){var S=h.edge(_),b=_.w,k=h.node(b);k.in-=S,d(p,m,k)}),h.removeNode(y.v),N}function c(h,p){var m=new n,y=0,x=0;e.forEach(h.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),e.forEach(h.edges(),function(S){var b=m.edge(S.v,S.w)||0,k=p(S),E=b+k;m.setEdge(S.v,S.w,E),x=Math.max(x,m.node(S.v).out+=k),y=Math.max(y,m.node(S.w).in+=k)});var N=e.range(x+y+3).map(function(){return new i}),_=y+1;return e.forEach(m.nodes(),function(S){d(N,_,m.node(S))}),{graph:m,buckets:N,zeroIdx:_}}function d(h,p,m){m.out?m.in?h[m.out-m.in+p].enqueue(m):h[h.length-1].enqueue(m):h[0].enqueue(m)}return Wm}var Gm,Zb;function CL(){if(Zb)return Gm;Zb=1;var e=lt(),n=NL();Gm={run:i,undo:o};function i(u){var l=u.graph().acyclicer==="greedy"?n(u,c(u)):s(u);e.forEach(l,function(d){var h=u.edge(d);u.removeEdge(d),h.forwardName=d.name,h.reversed=!0,u.setEdge(d.w,d.v,h,e.uniqueId("rev"))});function c(d){return function(h){return d.edge(h).weight}}}function s(u){var l=[],c={},d={};function h(p){e.has(d,p)||(d[p]=!0,c[p]=!0,e.forEach(u.outEdges(p),function(m){e.has(c,m.w)?l.push(m):h(m.w)}),delete c[p])}return e.forEach(u.nodes(),h),l}function o(u){e.forEach(u.edges(),function(l){var c=u.edge(l);if(c.reversed){u.removeEdge(l);var d=c.forwardName;delete c.reversed,delete c.forwardName,u.setEdge(l.w,l.v,c,d)}})}return Gm}var Ym,Jb;function fn(){if(Jb)return Ym;Jb=1;var e=lt(),n=Kn().Graph;Ym={addDummyNode:i,simplify:s,asNonCompoundGraph:o,successorWeights:u,predecessorWeights:l,intersectRect:c,buildLayerMatrix:d,normalizeRanks:h,removeEmptyRanks:p,addBorderNode:m,maxRank:y,partition:x,time:N,notime:_};function i(S,b,k,E){var C;do C=e.uniqueId(E);while(S.hasNode(C));return k.dummy=b,S.setNode(C,k),C}function s(S){var b=new n().setGraph(S.graph());return e.forEach(S.nodes(),function(k){b.setNode(k,S.node(k))}),e.forEach(S.edges(),function(k){var E=b.edge(k.v,k.w)||{weight:0,minlen:1},C=S.edge(k);b.setEdge(k.v,k.w,{weight:E.weight+C.weight,minlen:Math.max(E.minlen,C.minlen)})}),b}function o(S){var b=new n({multigraph:S.isMultigraph()}).setGraph(S.graph());return e.forEach(S.nodes(),function(k){S.children(k).length||b.setNode(k,S.node(k))}),e.forEach(S.edges(),function(k){b.setEdge(k,S.edge(k))}),b}function u(S){var b=e.map(S.nodes(),function(k){var E={};return e.forEach(S.outEdges(k),function(C){E[C.w]=(E[C.w]||0)+S.edge(C).weight}),E});return e.zipObject(S.nodes(),b)}function l(S){var b=e.map(S.nodes(),function(k){var E={};return e.forEach(S.inEdges(k),function(C){E[C.v]=(E[C.v]||0)+S.edge(C).weight}),E});return e.zipObject(S.nodes(),b)}function c(S,b){var k=S.x,E=S.y,C=b.x-k,I=b.y-E,O=S.width/2,M=S.height/2;if(!C&&!I)throw new Error("Not possible to find intersection inside of the rectangle");var P,T;return Math.abs(I)*O>Math.abs(C)*M?(I<0&&(M=-M),P=M*C/I,T=M):(C<0&&(O=-O),P=O,T=O*I/C),{x:k+P,y:E+T}}function d(S){var b=e.map(e.range(y(S)+1),function(){return[]});return e.forEach(S.nodes(),function(k){var E=S.node(k),C=E.rank;e.isUndefined(C)||(b[C][E.order]=k)}),b}function h(S){var b=e.min(e.map(S.nodes(),function(k){return S.node(k).rank}));e.forEach(S.nodes(),function(k){var E=S.node(k);e.has(E,"rank")&&(E.rank-=b)})}function p(S){var b=e.min(e.map(S.nodes(),function(I){return S.node(I).rank})),k=[];e.forEach(S.nodes(),function(I){var O=S.node(I).rank-b;k[O]||(k[O]=[]),k[O].push(I)});var E=0,C=S.graph().nodeRankFactor;e.forEach(k,function(I,O){e.isUndefined(I)&&O%C!==0?--E:E&&e.forEach(I,function(M){S.node(M).rank+=E})})}function m(S,b,k,E){var C={width:0,height:0};return arguments.length>=4&&(C.rank=k,C.order=E),i(S,"border",C,b)}function y(S){return e.max(e.map(S.nodes(),function(b){var k=S.node(b).rank;if(!e.isUndefined(k))return k}))}function x(S,b){var k={lhs:[],rhs:[]};return e.forEach(S,function(E){b(E)?k.lhs.push(E):k.rhs.push(E)}),k}function N(S,b){var k=e.now();try{return b()}finally{console.log(S+" time: "+(e.now()-k)+"ms")}}function _(S,b){return b()}return Ym}var Km,ek;function RL(){if(ek)return Km;ek=1;var e=lt(),n=fn();Km={run:i,undo:o};function i(u){u.graph().dummyChains=[],e.forEach(u.edges(),function(l){s(u,l)})}function s(u,l){var c=l.v,d=u.node(c).rank,h=l.w,p=u.node(h).rank,m=l.name,y=u.edge(l),x=y.labelRank;if(p!==d+1){u.removeEdge(l);var N,_,S;for(S=0,++d;d<p;++S,++d)y.points=[],_={width:0,height:0,edgeLabel:y,edgeObj:l,rank:d},N=n.addDummyNode(u,"edge",_,"_d"),d===x&&(_.width=y.width,_.height=y.height,_.dummy="edge-label",_.labelpos=y.labelpos),u.setEdge(c,N,{weight:y.weight},m),S===0&&u.graph().dummyChains.push(N),c=N;u.setEdge(c,h,{weight:y.weight},m)}}function o(u){e.forEach(u.graph().dummyChains,function(l){var c=u.node(l),d=c.edgeLabel,h;for(u.setEdge(c.edgeObj,d);c.dummy;)h=u.successors(l)[0],u.removeNode(l),d.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(d.x=c.x,d.y=c.y,d.width=c.width,d.height=c.height),l=h,c=u.node(l)})}return Km}var Xm,tk;function Mu(){if(tk)return Xm;tk=1;var e=lt();Xm={longestPath:n,slack:i};function n(s){var o={};function u(l){var c=s.node(l);if(e.has(o,l))return c.rank;o[l]=!0;var d=e.min(e.map(s.outEdges(l),function(h){return u(h.w)-s.edge(h).minlen}));return(d===Number.POSITIVE_INFINITY||d===void 0||d===null)&&(d=0),c.rank=d}e.forEach(s.sources(),u)}function i(s,o){return s.node(o.w).rank-s.node(o.v).rank-s.edge(o).minlen}return Xm}var Qm,nk;function lC(){if(nk)return Qm;nk=1;var e=lt(),n=Kn().Graph,i=Mu().slack;Qm=s;function s(c){var d=new n({directed:!1}),h=c.nodes()[0],p=c.nodeCount();d.setNode(h,{});for(var m,y;o(d,c)<p;)m=u(d,c),y=d.hasNode(m.v)?i(c,m):-i(c,m),l(d,c,y);return d}function o(c,d){function h(p){e.forEach(d.nodeEdges(p),function(m){var y=m.v,x=p===y?m.w:y;!c.hasNode(x)&&!i(d,m)&&(c.setNode(x,{}),c.setEdge(p,x,{}),h(x))})}return e.forEach(c.nodes(),h),c.nodeCount()}function u(c,d){return e.minBy(d.edges(),function(h){if(c.hasNode(h.v)!==c.hasNode(h.w))return i(d,h)})}function l(c,d,h){e.forEach(c.nodes(),function(p){d.node(p).rank+=h})}return Qm}var Zm,rk;function TL(){if(rk)return Zm;rk=1;var e=lt(),n=lC(),i=Mu().slack,s=Mu().longestPath,o=Kn().alg.preorder,u=Kn().alg.postorder,l=fn().simplify;Zm=c,c.initLowLimValues=m,c.initCutValues=d,c.calcCutValue=p,c.leaveEdge=x,c.enterEdge=N,c.exchangeEdges=_;function c(E){E=l(E),s(E);var C=n(E);m(C),d(C,E);for(var I,O;I=x(C);)O=N(C,E,I),_(C,E,I,O)}function d(E,C){var I=u(E,E.nodes());I=I.slice(0,I.length-1),e.forEach(I,function(O){h(E,C,O)})}function h(E,C,I){var O=E.node(I),M=O.parent;E.edge(I,M).cutvalue=p(E,C,I)}function p(E,C,I){var O=E.node(I),M=O.parent,P=!0,T=C.edge(I,M),L=0;return T||(P=!1,T=C.edge(M,I)),L=T.weight,e.forEach(C.nodeEdges(I),function(F){var J=F.v===I,Q=J?F.w:F.v;if(Q!==M){var j=J===P,G=C.edge(F).weight;if(L+=j?G:-G,b(E,I,Q)){var U=E.edge(I,Q).cutvalue;L+=j?-U:U}}}),L}function m(E,C){arguments.length<2&&(C=E.nodes()[0]),y(E,{},1,C)}function y(E,C,I,O,M){var P=I,T=E.node(O);return C[O]=!0,e.forEach(E.neighbors(O),function(L){e.has(C,L)||(I=y(E,C,I,L,O))}),T.low=P,T.lim=I++,M?T.parent=M:delete T.parent,I}function x(E){return e.find(E.edges(),function(C){return E.edge(C).cutvalue<0})}function N(E,C,I){var O=I.v,M=I.w;C.hasEdge(O,M)||(O=I.w,M=I.v);var P=E.node(O),T=E.node(M),L=P,F=!1;P.lim>T.lim&&(L=T,F=!0);var J=e.filter(C.edges(),function(Q){return F===k(E,E.node(Q.v),L)&&F!==k(E,E.node(Q.w),L)});return e.minBy(J,function(Q){return i(C,Q)})}function _(E,C,I,O){var M=I.v,P=I.w;E.removeEdge(M,P),E.setEdge(O.v,O.w,{}),m(E),d(E,C),S(E,C)}function S(E,C){var I=e.find(E.nodes(),function(M){return!C.node(M).parent}),O=o(E,I);O=O.slice(1),e.forEach(O,function(M){var P=E.node(M).parent,T=C.edge(M,P),L=!1;T||(T=C.edge(P,M),L=!0),C.node(M).rank=C.node(P).rank+(L?T.minlen:-T.minlen)})}function b(E,C,I){return E.hasEdge(C,I)}function k(E,C,I){return I.low<=C.lim&&C.lim<=I.lim}return Zm}var Jm,ik;function jL(){if(ik)return Jm;ik=1;var e=Mu(),n=e.longestPath,i=lC(),s=TL();Jm=o;function o(d){switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":l(d);break;case"longest-path":u(d);break;default:c(d)}}var u=n;function l(d){n(d),i(d)}function c(d){s(d)}return Jm}var eg,sk;function AL(){if(sk)return eg;sk=1;var e=lt();eg=n;function n(o){var u=s(o);e.forEach(o.graph().dummyChains,function(l){for(var c=o.node(l),d=c.edgeObj,h=i(o,u,d.v,d.w),p=h.path,m=h.lca,y=0,x=p[y],N=!0;l!==d.w;){if(c=o.node(l),N){for(;(x=p[y])!==m&&o.node(x).maxRank<c.rank;)y++;x===m&&(N=!1)}if(!N){for(;y<p.length-1&&o.node(x=p[y+1]).minRank<=c.rank;)y++;x=p[y]}o.setParent(l,x),l=o.successors(l)[0]}})}function i(o,u,l,c){var d=[],h=[],p=Math.min(u[l].low,u[c].low),m=Math.max(u[l].lim,u[c].lim),y,x;y=l;do y=o.parent(y),d.push(y);while(y&&(u[y].low>p||m>u[y].lim));for(x=y,y=c;(y=o.parent(y))!==x;)h.push(y);return{path:d.concat(h.reverse()),lca:x}}function s(o){var u={},l=0;function c(d){var h=l;e.forEach(o.children(d),c),u[d]={low:h,lim:l++}}return e.forEach(o.children(),c),u}return eg}var tg,ok;function IL(){if(ok)return tg;ok=1;var e=lt(),n=fn();tg={run:i,cleanup:l};function i(c){var d=n.addDummyNode(c,"root",{},"_root"),h=o(c),p=e.max(e.values(h))-1,m=2*p+1;c.graph().nestingRoot=d,e.forEach(c.edges(),function(x){c.edge(x).minlen*=m});var y=u(c)+1;e.forEach(c.children(),function(x){s(c,d,m,y,p,h,x)}),c.graph().nodeRankFactor=m}function s(c,d,h,p,m,y,x){var N=c.children(x);if(!N.length){x!==d&&c.setEdge(d,x,{weight:0,minlen:h});return}var _=n.addBorderNode(c,"_bt"),S=n.addBorderNode(c,"_bb"),b=c.node(x);c.setParent(_,x),b.borderTop=_,c.setParent(S,x),b.borderBottom=S,e.forEach(N,function(k){s(c,d,h,p,m,y,k);var E=c.node(k),C=E.borderTop?E.borderTop:k,I=E.borderBottom?E.borderBottom:k,O=E.borderTop?p:2*p,M=C!==I?1:m-y[x]+1;c.setEdge(_,C,{weight:O,minlen:M,nestingEdge:!0}),c.setEdge(I,S,{weight:O,minlen:M,nestingEdge:!0})}),c.parent(x)||c.setEdge(d,_,{weight:0,minlen:m+y[x]})}function o(c){var d={};function h(p,m){var y=c.children(p);y&&y.length&&e.forEach(y,function(x){h(x,m+1)}),d[p]=m}return e.forEach(c.children(),function(p){h(p,1)}),d}function u(c){return e.reduce(c.edges(),function(d,h){return d+c.edge(h).weight},0)}function l(c){var d=c.graph();c.removeNode(d.nestingRoot),delete d.nestingRoot,e.forEach(c.edges(),function(h){var p=c.edge(h);p.nestingEdge&&c.removeEdge(h)})}return tg}var ng,ak;function ML(){if(ak)return ng;ak=1;var e=lt(),n=fn();ng=i;function i(o){function u(l){var c=o.children(l),d=o.node(l);if(c.length&&e.forEach(c,u),e.has(d,"minRank")){d.borderLeft=[],d.borderRight=[];for(var h=d.minRank,p=d.maxRank+1;h<p;++h)s(o,"borderLeft","_bl",l,d,h),s(o,"borderRight","_br",l,d,h)}}e.forEach(o.children(),u)}function s(o,u,l,c,d,h){var p={width:0,height:0,rank:h,borderType:u},m=d[u][h-1],y=n.addDummyNode(o,"border",p,l);d[u][h]=y,o.setParent(y,c),m&&o.setEdge(m,y,{weight:1})}return ng}var rg,uk;function PL(){if(uk)return rg;uk=1;var e=lt();rg={adjust:n,undo:i};function n(h){var p=h.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&s(h)}function i(h){var p=h.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&u(h),(p==="lr"||p==="rl")&&(c(h),s(h))}function s(h){e.forEach(h.nodes(),function(p){o(h.node(p))}),e.forEach(h.edges(),function(p){o(h.edge(p))})}function o(h){var p=h.width;h.width=h.height,h.height=p}function u(h){e.forEach(h.nodes(),function(p){l(h.node(p))}),e.forEach(h.edges(),function(p){var m=h.edge(p);e.forEach(m.points,l),e.has(m,"y")&&l(m)})}function l(h){h.y=-h.y}function c(h){e.forEach(h.nodes(),function(p){d(h.node(p))}),e.forEach(h.edges(),function(p){var m=h.edge(p);e.forEach(m.points,d),e.has(m,"x")&&d(m)})}function d(h){var p=h.x;h.x=h.y,h.y=p}return rg}var ig,lk;function OL(){if(lk)return ig;lk=1;var e=lt();ig=n;function n(i){var s={},o=e.filter(i.nodes(),function(h){return!i.children(h).length}),u=e.max(e.map(o,function(h){return i.node(h).rank})),l=e.map(e.range(u+1),function(){return[]});function c(h){if(!e.has(s,h)){s[h]=!0;var p=i.node(h);l[p.rank].push(h),e.forEach(i.successors(h),c)}}var d=e.sortBy(o,function(h){return i.node(h).rank});return e.forEach(d,c),l}return ig}var sg,ck;function qL(){if(ck)return sg;ck=1;var e=lt();sg=n;function n(s,o){for(var u=0,l=1;l<o.length;++l)u+=i(s,o[l-1],o[l]);return u}function i(s,o,u){for(var l=e.zipObject(u,e.map(u,function(y,x){return x})),c=e.flatten(e.map(o,function(y){return e.sortBy(e.map(s.outEdges(y),function(x){return{pos:l[x.w],weight:s.edge(x).weight}}),"pos")}),!0),d=1;d<u.length;)d<<=1;var h=2*d-1;d-=1;var p=e.map(new Array(h),function(){return 0}),m=0;return e.forEach(c.forEach(function(y){var x=y.pos+d;p[x]+=y.weight;for(var N=0;x>0;)x%2&&(N+=p[x+1]),x=x-1>>1,p[x]+=y.weight;m+=y.weight*N})),m}return sg}var og,fk;function LL(){if(fk)return og;fk=1;var e=lt();og=n;function n(i,s){return e.map(s,function(o){var u=i.inEdges(o);if(u.length){var l=e.reduce(u,function(c,d){var h=i.edge(d),p=i.node(d.v);return{sum:c.sum+h.weight*p.order,weight:c.weight+h.weight}},{sum:0,weight:0});return{v:o,barycenter:l.sum/l.weight,weight:l.weight}}else return{v:o}})}return og}var ag,dk;function $L(){if(dk)return ag;dk=1;var e=lt();ag=n;function n(o,u){var l={};e.forEach(o,function(d,h){var p=l[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:h};e.isUndefined(d.barycenter)||(p.barycenter=d.barycenter,p.weight=d.weight)}),e.forEach(u.edges(),function(d){var h=l[d.v],p=l[d.w];!e.isUndefined(h)&&!e.isUndefined(p)&&(p.indegree++,h.out.push(l[d.w]))});var c=e.filter(l,function(d){return!d.indegree});return i(c)}function i(o){var u=[];function l(h){return function(p){p.merged||(e.isUndefined(p.barycenter)||e.isUndefined(h.barycenter)||p.barycenter>=h.barycenter)&&s(h,p)}}function c(h){return function(p){p.in.push(h),--p.indegree===0&&o.push(p)}}for(;o.length;){var d=o.pop();u.push(d),e.forEach(d.in.reverse(),l(d)),e.forEach(d.out,c(d))}return e.map(e.filter(u,function(h){return!h.merged}),function(h){return e.pick(h,["vs","i","barycenter","weight"])})}function s(o,u){var l=0,c=0;o.weight&&(l+=o.barycenter*o.weight,c+=o.weight),u.weight&&(l+=u.barycenter*u.weight,c+=u.weight),o.vs=u.vs.concat(o.vs),o.barycenter=l/c,o.weight=c,o.i=Math.min(u.i,o.i),u.merged=!0}return ag}var ug,hk;function DL(){if(hk)return ug;hk=1;var e=lt(),n=fn();ug=i;function i(u,l){var c=n.partition(u,function(_){return e.has(_,"barycenter")}),d=c.lhs,h=e.sortBy(c.rhs,function(_){return-_.i}),p=[],m=0,y=0,x=0;d.sort(o(!!l)),x=s(p,h,x),e.forEach(d,function(_){x+=_.vs.length,p.push(_.vs),m+=_.barycenter*_.weight,y+=_.weight,x=s(p,h,x)});var N={vs:e.flatten(p,!0)};return y&&(N.barycenter=m/y,N.weight=y),N}function s(u,l,c){for(var d;l.length&&(d=e.last(l)).i<=c;)l.pop(),u.push(d.vs),c++;return c}function o(u){return function(l,c){return l.barycenter<c.barycenter?-1:l.barycenter>c.barycenter?1:u?c.i-l.i:l.i-c.i}}return ug}var lg,pk;function FL(){if(pk)return lg;pk=1;var e=lt(),n=LL(),i=$L(),s=DL();lg=o;function o(c,d,h,p){var m=c.children(d),y=c.node(d),x=y?y.borderLeft:void 0,N=y?y.borderRight:void 0,_={};x&&(m=e.filter(m,function(I){return I!==x&&I!==N}));var S=n(c,m);e.forEach(S,function(I){if(c.children(I.v).length){var O=o(c,I.v,h,p);_[I.v]=O,e.has(O,"barycenter")&&l(I,O)}});var b=i(S,h);u(b,_);var k=s(b,p);if(x&&(k.vs=e.flatten([x,k.vs,N],!0),c.predecessors(x).length)){var E=c.node(c.predecessors(x)[0]),C=c.node(c.predecessors(N)[0]);e.has(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+E.order+C.order)/(k.weight+2),k.weight+=2}return k}function u(c,d){e.forEach(c,function(h){h.vs=e.flatten(h.vs.map(function(p){return d[p]?d[p].vs:p}),!0)})}function l(c,d){e.isUndefined(c.barycenter)?(c.barycenter=d.barycenter,c.weight=d.weight):(c.barycenter=(c.barycenter*c.weight+d.barycenter*d.weight)/(c.weight+d.weight),c.weight+=d.weight)}return lg}var cg,mk;function zL(){if(mk)return cg;mk=1;var e=lt(),n=Kn().Graph;cg=i;function i(o,u,l){var c=s(o),d=new n({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(h){return o.node(h)});return e.forEach(o.nodes(),function(h){var p=o.node(h),m=o.parent(h);(p.rank===u||p.minRank<=u&&u<=p.maxRank)&&(d.setNode(h),d.setParent(h,m||c),e.forEach(o[l](h),function(y){var x=y.v===h?y.w:y.v,N=d.edge(x,h),_=e.isUndefined(N)?0:N.weight;d.setEdge(x,h,{weight:o.edge(y).weight+_})}),e.has(p,"minRank")&&d.setNode(h,{borderLeft:p.borderLeft[u],borderRight:p.borderRight[u]}))}),d}function s(o){for(var u;o.hasNode(u=e.uniqueId("_root")););return u}return cg}var fg,gk;function BL(){if(gk)return fg;gk=1;var e=lt();fg=n;function n(i,s,o){var u={},l;e.forEach(o,function(c){for(var d=i.parent(c),h,p;d;){if(h=i.parent(d),h?(p=u[h],u[h]=d):(p=l,l=d),p&&p!==d){s.setEdge(p,d);return}d=h}})}return fg}var dg,vk;function UL(){if(vk)return dg;vk=1;var e=lt(),n=OL(),i=qL(),s=FL(),o=zL(),u=BL(),l=Kn().Graph,c=fn();dg=d;function d(y){var x=c.maxRank(y),N=h(y,e.range(1,x+1),"inEdges"),_=h(y,e.range(x-1,-1,-1),"outEdges"),S=n(y);m(y,S);for(var b=Number.POSITIVE_INFINITY,k,E=0,C=0;C<4;++E,++C){p(E%2?N:_,E%4>=2),S=c.buildLayerMatrix(y);var I=i(y,S);I<b&&(C=0,k=e.cloneDeep(S),b=I)}m(y,k)}function h(y,x,N){return e.map(x,function(_){return o(y,_,N)})}function p(y,x){var N=new l;e.forEach(y,function(_){var S=_.graph().root,b=s(_,S,N,x);e.forEach(b.vs,function(k,E){_.node(k).order=E}),u(_,N,b.vs)})}function m(y,x){e.forEach(x,function(N){e.forEach(N,function(_,S){y.node(_).order=S})})}return dg}var hg,yk;function HL(){if(yk)return hg;yk=1;var e=lt(),n=Kn().Graph,i=fn();hg={positionX:N,findType1Conflicts:s,findType2Conflicts:o,addConflict:l,hasConflict:c,verticalAlignment:d,horizontalCompaction:h,alignCoordinates:y,findSmallestWidthAlignment:m,balance:x};function s(b,k){var E={};function C(I,O){var M=0,P=0,T=I.length,L=e.last(O);return e.forEach(O,function(F,J){var Q=u(b,F),j=Q?b.node(Q).order:T;(Q||F===L)&&(e.forEach(O.slice(P,J+1),function(G){e.forEach(b.predecessors(G),function(U){var ne=b.node(U),K=ne.order;(K<M||j<K)&&!(ne.dummy&&b.node(G).dummy)&&l(E,U,G)})}),P=J+1,M=j)}),O}return e.reduce(k,C),E}function o(b,k){var E={};function C(O,M,P,T,L){var F;e.forEach(e.range(M,P),function(J){F=O[J],b.node(F).dummy&&e.forEach(b.predecessors(F),function(Q){var j=b.node(Q);j.dummy&&(j.order<T||j.order>L)&&l(E,Q,F)})})}function I(O,M){var P=-1,T,L=0;return e.forEach(M,function(F,J){if(b.node(F).dummy==="border"){var Q=b.predecessors(F);Q.length&&(T=b.node(Q[0]).order,C(M,L,J,P,T),L=J,P=T)}C(M,L,M.length,T,O.length)}),M}return e.reduce(k,I),E}function u(b,k){if(b.node(k).dummy)return e.find(b.predecessors(k),function(E){return b.node(E).dummy})}function l(b,k,E){if(k>E){var C=k;k=E,E=C}var I=b[k];I||(b[k]=I={}),I[E]=!0}function c(b,k,E){if(k>E){var C=k;k=E,E=C}return e.has(b[k],E)}function d(b,k,E,C){var I={},O={},M={};return e.forEach(k,function(P){e.forEach(P,function(T,L){I[T]=T,O[T]=T,M[T]=L})}),e.forEach(k,function(P){var T=-1;e.forEach(P,function(L){var F=C(L);if(F.length){F=e.sortBy(F,function(U){return M[U]});for(var J=(F.length-1)/2,Q=Math.floor(J),j=Math.ceil(J);Q<=j;++Q){var G=F[Q];O[L]===L&&T<M[G]&&!c(E,L,G)&&(O[G]=L,O[L]=I[L]=I[G],T=M[G])}}})}),{root:I,align:O}}function h(b,k,E,C,I){var O={},M=p(b,k,E,I),P=I?"borderLeft":"borderRight";function T(J,Q){for(var j=M.nodes(),G=j.pop(),U={};G;)U[G]?J(G):(U[G]=!0,j.push(G),j=j.concat(Q(G))),G=j.pop()}function L(J){O[J]=M.inEdges(J).reduce(function(Q,j){return Math.max(Q,O[j.v]+M.edge(j))},0)}function F(J){var Q=M.outEdges(J).reduce(function(G,U){return Math.min(G,O[U.w]-M.edge(U))},Number.POSITIVE_INFINITY),j=b.node(J);Q!==Number.POSITIVE_INFINITY&&j.borderType!==P&&(O[J]=Math.max(O[J],Q))}return T(L,M.predecessors.bind(M)),T(F,M.successors.bind(M)),e.forEach(C,function(J){O[J]=O[E[J]]}),O}function p(b,k,E,C){var I=new n,O=b.graph(),M=_(O.nodesep,O.edgesep,C);return e.forEach(k,function(P){var T;e.forEach(P,function(L){var F=E[L];if(I.setNode(F),T){var J=E[T],Q=I.edge(J,F);I.setEdge(J,F,Math.max(M(b,L,T),Q||0))}T=L})}),I}function m(b,k){return e.minBy(e.values(k),function(E){var C=Number.NEGATIVE_INFINITY,I=Number.POSITIVE_INFINITY;return e.forIn(E,function(O,M){var P=S(b,M)/2;C=Math.max(O+P,C),I=Math.min(O-P,I)}),C-I})}function y(b,k){var E=e.values(k),C=e.min(E),I=e.max(E);e.forEach(["u","d"],function(O){e.forEach(["l","r"],function(M){var P=O+M,T=b[P],L;if(T!==k){var F=e.values(T);L=M==="l"?C-e.min(F):I-e.max(F),L&&(b[P]=e.mapValues(T,function(J){return J+L}))}})})}function x(b,k){return e.mapValues(b.ul,function(E,C){if(k)return b[k.toLowerCase()][C];var I=e.sortBy(e.map(b,C));return(I[1]+I[2])/2})}function N(b){var k=i.buildLayerMatrix(b),E=e.merge(s(b,k),o(b,k)),C={},I;e.forEach(["u","d"],function(M){I=M==="u"?k:e.values(k).reverse(),e.forEach(["l","r"],function(P){P==="r"&&(I=e.map(I,function(J){return e.values(J).reverse()}));var T=(M==="u"?b.predecessors:b.successors).bind(b),L=d(b,I,E,T),F=h(b,I,L.root,L.align,P==="r");P==="r"&&(F=e.mapValues(F,function(J){return-J})),C[M+P]=F})});var O=m(b,C);return y(C,O),x(C,b.graph().align)}function _(b,k,E){return function(C,I,O){var M=C.node(I),P=C.node(O),T=0,L;if(T+=M.width/2,e.has(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":L=-M.width/2;break;case"r":L=M.width/2;break}if(L&&(T+=E?L:-L),L=0,T+=(M.dummy?k:b)/2,T+=(P.dummy?k:b)/2,T+=P.width/2,e.has(P,"labelpos"))switch(P.labelpos.toLowerCase()){case"l":L=P.width/2;break;case"r":L=-P.width/2;break}return L&&(T+=E?L:-L),L=0,T}}function S(b,k){return b.node(k).width}return hg}var pg,wk;function VL(){if(wk)return pg;wk=1;var e=lt(),n=fn(),i=HL().positionX;pg=s;function s(u){u=n.asNonCompoundGraph(u),o(u),e.forEach(i(u),function(l,c){u.node(c).x=l})}function o(u){var l=n.buildLayerMatrix(u),c=u.graph().ranksep,d=0;e.forEach(l,function(h){var p=e.max(e.map(h,function(m){return u.node(m).height}));e.forEach(h,function(m){u.node(m).y=d+p/2}),d+=p+c})}return pg}var mg,xk;function WL(){if(xk)return mg;xk=1;var e=lt(),n=CL(),i=RL(),s=jL(),o=fn().normalizeRanks,u=AL(),l=fn().removeEmptyRanks,c=IL(),d=ML(),h=PL(),p=UL(),m=VL(),y=fn(),x=Kn().Graph;mg=N;function N(z,X){var ee=X&&X.debugTiming?y.time:y.notime;ee("layout",function(){var se=ee(" buildLayoutGraph",function(){return T(z)});ee(" runLayout",function(){_(se,ee)}),ee(" updateInputGraph",function(){S(z,se)})})}function _(z,X){X(" makeSpaceForEdgeLabels",function(){L(z)}),X(" removeSelfEdges",function(){$(z)}),X(" acyclic",function(){n.run(z)}),X(" nestingGraph.run",function(){c.run(z)}),X(" rank",function(){s(y.asNonCompoundGraph(z))}),X(" injectEdgeLabelProxies",function(){F(z)}),X(" removeEmptyRanks",function(){l(z)}),X(" nestingGraph.cleanup",function(){c.cleanup(z)}),X(" normalizeRanks",function(){o(z)}),X(" assignRankMinMax",function(){J(z)}),X(" removeEdgeLabelProxies",function(){Q(z)}),X(" normalize.run",function(){i.run(z)}),X(" parentDummyChains",function(){u(z)}),X(" addBorderSegments",function(){d(z)}),X(" order",function(){p(z)}),X(" insertSelfEdges",function(){W(z)}),X(" adjustCoordinateSystem",function(){h.adjust(z)}),X(" position",function(){m(z)}),X(" positionSelfEdges",function(){A(z)}),X(" removeBorderNodes",function(){K(z)}),X(" normalize.undo",function(){i.undo(z)}),X(" fixupEdgeLabelCoords",function(){U(z)}),X(" undoCoordinateSystem",function(){h.undo(z)}),X(" translateGraph",function(){j(z)}),X(" assignNodeIntersects",function(){G(z)}),X(" reversePoints",function(){ne(z)}),X(" acyclic.undo",function(){n.undo(z)})}function S(z,X){e.forEach(z.nodes(),function(ee){var se=z.node(ee),oe=X.node(ee);se&&(se.x=oe.x,se.y=oe.y,X.children(ee).length&&(se.width=oe.width,se.height=oe.height))}),e.forEach(z.edges(),function(ee){var se=z.edge(ee),oe=X.edge(ee);se.points=oe.points,e.has(oe,"x")&&(se.x=oe.x,se.y=oe.y)}),z.graph().width=X.graph().width,z.graph().height=X.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],C=["width","height"],I={width:0,height:0},O=["minlen","weight","width","height","labeloffset"],M={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},P=["labelpos"];function T(z){var X=new x({multigraph:!0,compound:!0}),ee=ue(z.graph());return X.setGraph(e.merge({},k,B(ee,b),e.pick(ee,E))),e.forEach(z.nodes(),function(se){var oe=ue(z.node(se));X.setNode(se,e.defaults(B(oe,C),I)),X.setParent(se,z.parent(se))}),e.forEach(z.edges(),function(se){var oe=ue(z.edge(se));X.setEdge(se,e.merge({},M,B(oe,O),e.pick(oe,P)))}),X}function L(z){var X=z.graph();X.ranksep/=2,e.forEach(z.edges(),function(ee){var se=z.edge(ee);se.minlen*=2,se.labelpos.toLowerCase()!=="c"&&(X.rankdir==="TB"||X.rankdir==="BT"?se.width+=se.labeloffset:se.height+=se.labeloffset)})}function F(z){e.forEach(z.edges(),function(X){var ee=z.edge(X);if(ee.width&&ee.height){var se=z.node(X.v),oe=z.node(X.w),pe={rank:(oe.rank-se.rank)/2+se.rank,e:X};y.addDummyNode(z,"edge-proxy",pe,"_ep")}})}function J(z){var X=0;e.forEach(z.nodes(),function(ee){var se=z.node(ee);se.borderTop&&(se.minRank=z.node(se.borderTop).rank,se.maxRank=z.node(se.borderBottom).rank,X=e.max(X,se.maxRank))}),z.graph().maxRank=X}function Q(z){e.forEach(z.nodes(),function(X){var ee=z.node(X);ee.dummy==="edge-proxy"&&(z.edge(ee.e).labelRank=ee.rank,z.removeNode(X))})}function j(z){var X=Number.POSITIVE_INFINITY,ee=0,se=Number.POSITIVE_INFINITY,oe=0,pe=z.graph(),ge=pe.marginx||0,Ae=pe.marginy||0;function ze(Me){var Ie=Me.x,be=Me.y,Be=Me.width,ye=Me.height;X=Math.min(X,Ie-Be/2),ee=Math.max(ee,Ie+Be/2),se=Math.min(se,be-ye/2),oe=Math.max(oe,be+ye/2)}e.forEach(z.nodes(),function(Me){ze(z.node(Me))}),e.forEach(z.edges(),function(Me){var Ie=z.edge(Me);e.has(Ie,"x")&&ze(Ie)}),X-=ge,se-=Ae,e.forEach(z.nodes(),function(Me){var Ie=z.node(Me);Ie.x-=X,Ie.y-=se}),e.forEach(z.edges(),function(Me){var Ie=z.edge(Me);e.forEach(Ie.points,function(be){be.x-=X,be.y-=se}),e.has(Ie,"x")&&(Ie.x-=X),e.has(Ie,"y")&&(Ie.y-=se)}),pe.width=ee-X+ge,pe.height=oe-se+Ae}function G(z){e.forEach(z.edges(),function(X){var ee=z.edge(X),se=z.node(X.v),oe=z.node(X.w),pe,ge;ee.points?(pe=ee.points[0],ge=ee.points[ee.points.length-1]):(ee.points=[],pe=oe,ge=se),ee.points.unshift(y.intersectRect(se,pe)),ee.points.push(y.intersectRect(oe,ge))})}function U(z){e.forEach(z.edges(),function(X){var ee=z.edge(X);if(e.has(ee,"x"))switch((ee.labelpos==="l"||ee.labelpos==="r")&&(ee.width-=ee.labeloffset),ee.labelpos){case"l":ee.x-=ee.width/2+ee.labeloffset;break;case"r":ee.x+=ee.width/2+ee.labeloffset;break}})}function ne(z){e.forEach(z.edges(),function(X){var ee=z.edge(X);ee.reversed&&ee.points.reverse()})}function K(z){e.forEach(z.nodes(),function(X){if(z.children(X).length){var ee=z.node(X),se=z.node(ee.borderTop),oe=z.node(ee.borderBottom),pe=z.node(e.last(ee.borderLeft)),ge=z.node(e.last(ee.borderRight));ee.width=Math.abs(ge.x-pe.x),ee.height=Math.abs(oe.y-se.y),ee.x=pe.x+ee.width/2,ee.y=se.y+ee.height/2}}),e.forEach(z.nodes(),function(X){z.node(X).dummy==="border"&&z.removeNode(X)})}function $(z){e.forEach(z.edges(),function(X){if(X.v===X.w){var ee=z.node(X.v);ee.selfEdges||(ee.selfEdges=[]),ee.selfEdges.push({e:X,label:z.edge(X)}),z.removeEdge(X)}})}function W(z){var X=y.buildLayerMatrix(z);e.forEach(X,function(ee){var se=0;e.forEach(ee,function(oe,pe){var ge=z.node(oe);ge.order=pe+se,e.forEach(ge.selfEdges,function(Ae){y.addDummyNode(z,"selfedge",{width:Ae.label.width,height:Ae.label.height,rank:ge.rank,order:pe+ ++se,e:Ae.e,label:Ae.label},"_se")}),delete ge.selfEdges})})}function A(z){e.forEach(z.nodes(),function(X){var ee=z.node(X);if(ee.dummy==="selfedge"){var se=z.node(ee.e.v),oe=se.x+se.width/2,pe=se.y,ge=ee.x-oe,Ae=se.height/2;z.setEdge(ee.e,ee.label),z.removeNode(X),ee.label.points=[{x:oe+2*ge/3,y:pe-Ae},{x:oe+5*ge/6,y:pe-Ae},{x:oe+ge,y:pe},{x:oe+5*ge/6,y:pe+Ae},{x:oe+2*ge/3,y:pe+Ae}],ee.label.x=ee.x,ee.label.y=ee.y}})}function B(z,X){return e.mapValues(e.pick(z,X),Number)}function ue(z){var X={};return e.forEach(z,function(ee,se){X[se.toLowerCase()]=ee}),X}return mg}var gg,_k;function GL(){if(_k)return gg;_k=1;var e=lt(),n=fn(),i=Kn().Graph;gg={debugOrdering:s};function s(o){var u=n.buildLayerMatrix(o),l=new i({compound:!0,multigraph:!0}).setGraph({});return e.forEach(o.nodes(),function(c){l.setNode(c,{label:c}),l.setParent(c,"layer"+o.node(c).rank)}),e.forEach(o.edges(),function(c){l.setEdge(c.v,c.w,{},c.name)}),e.forEach(u,function(c,d){var h="layer"+d;l.setNode(h,{rank:"same"}),e.reduce(c,function(p,m){return l.setEdge(p,m,{style:"invis"}),m})}),l}return gg}var vg,Sk;function YL(){return Sk||(Sk=1,vg="0.8.5"),vg}var yg,bk;function KL(){return bk||(bk=1,yg={graphlib:Kn(),layout:WL(),debug:GL(),util:{time:fn().time,notime:fn().notime},version:YL()}),yg}var XL=KL();const kk=Bg(XL),Fi=240,Ps=130,Os=74,il=72,Ek=Os+il;function QL(e){let n=Fi;for(const i of e.values())n=Math.max(n,i.width);return n}const ZL=420,JL=2;function sl(e){var i;return((i=e.data)==null?void 0:i.sessionId)??"_default"}function e$(e,n,i,s,o){const u=new kk.graphlib.Graph;u.setDefaultEdgeLabel(()=>({})),u.setGraph({rankdir:i,marginx:0,marginy:0,nodesep:70,ranksep:160,edgesep:30});const l=e.filter(_=>!o.has(_)),c=new Set(l);for(const _ of l){const S=s.get(_);u.setNode(_,{width:(S==null?void 0:S.width)??Fi,height:(S==null?void 0:S.height)??Ps})}for(const _ of n)c.has(_.source)&&c.has(_.target)&&u.setEdge(_.source,_.target);kk.layout(u);const d=new Map;let h=1/0,p=1/0,m=-1/0,y=-1/0;for(const _ of l){const S=u.node(_);if(!S)continue;const b=s.get(_),k=(b==null?void 0:b.width)??Fi,E=(b==null?void 0:b.height)??Ps,C=S.x-k/2,I=S.y-E/2;d.set(_,{x:C,y:I}),C<h&&(h=C),I<p&&(p=I),C+k>m&&(m=C+k),I+E>y&&(y=I+E)}if(Number.isFinite(h)&&Number.isFinite(p))for(const[_,S]of d)d.set(_,{x:S.x-h,y:S.y-p});let x=Number.isFinite(m)?m-h:0,N=Number.isFinite(y)?y-p:0;for(const _ of e){const S=o.get(_);if(!S)continue;const b=s.get(_);x=Math.max(x,S.x+((b==null?void 0:b.width)??Fi)),N=Math.max(N,S.y+((b==null?void 0:b.height)??Ps))}return{positions:d,width:x,height:N}}function t$(e,n,i={}){const s=i.direction??"LR",o=i.pinned??new Map,u=i.measured??new Map,l=new Map;for(const S of e){const b=sl(S),k=l.get(b);k?k.push(S.id):l.set(b,[S.id])}const d=Array.from(l.keys()).sort().map(S=>({sid:S,...e$(l.get(S),n,s,u,o)})),h=QL(u),p=i.availableHeight&&i.availableHeight>0?i.availableHeight:Number.POSITIVE_INFINITY,m=S=>{const b=[[]];let k=0;for(const E of d)b.length<S&&k>0&&k+E.height>p&&(b.push([]),k=0),b[b.length-1].push(E),k+=E.height+Ek;return b},y=S=>S.reduce((b,k)=>Math.max(b,k.width),0)+ZL;let x=m(i.availableWidth?JL:1);x.length>1&&x.reduce((b,k)=>b+y(k),0)+h*(x.length-1)>(i.availableWidth??0)&&(x=m(1));const N=new Map;let _=0;for(const S of x){let b=0;for(const{positions:k,height:E}of S){for(const[C,I]of k)N.set(C,{x:I.x+_,y:I.y+b});b+=E+Ek}_+=y(S)+h}return e.map(S=>{const b=o.get(S.id);if(b)return{...S,position:b};const k=N.get(S.id);return k?{...S,position:k}:S})}function n$(e,n,i,s){const u=Os+il,l=60,c=y=>{const x=s.get(y);return{w:(x==null?void 0:x.width)??Fi,h:(x==null?void 0:x.height)??Ps}},d=new Map(e.map(y=>[y.id,sl(y)])),h=[],p=e.map(y=>({id:y.id,pos:i.get(y.id)??n.get(y.id)})).filter(y=>y.pos!=null).sort((y,x)=>y.pos.y-x.pos.y||y.pos.x-x.pos.x||y.id.localeCompare(x.id)),m=[];for(const{id:y,pos:x}of p){const{w:N,h:_}=c(y),S=d.get(y)??"_default";if(i.has(y)){h.push({x:x.x,y:x.y,w:N,h:_,sid:S});continue}let b=x.y;for(let k=0;k<h.length+1;k++){const E=h.find(C=>{const I=C.sid===S?24:l,O=C.sid===S?24:u;return x.x<C.x+C.w+I&&C.x<x.x+N+I&&b<C.y+C.h+O&&C.y<b+_+O});if(!E)break;b=E.y+E.h+(E.sid===S?24:u)}b!==x.y&&(n.set(y,{x:x.x,y:b}),m.push(y)),h.push({x:x.x,y:b,w:N,h:_,sid:S})}return m}function r$(e,n,i,s,o){const u=y=>{const x=s.get(y);return{w:(x==null?void 0:x.width)??Fi,h:(x==null?void 0:x.height)??Ps}},l=y=>i.get(y)??n.get(y),c=new Map,d=[];for(const y of e){const x=l(y.id);if(!x)continue;const{w:N,h:_}=u(y.id);if(o.has(y.id)&&!i.has(y.id)){const S=sl(y);(c.get(S)??c.set(S,[]).get(S)).push(y)}else d.push({x:x.x,y:x.y,w:N,h:_})}if(c.size===0)return[];const h=Os+il,p=(y,x,N,_)=>d.some(S=>y<S.x+S.w+Os&&S.x<y+N+Os&&x<S.y+S.h+h&&S.y<x+_+h),m=[];for(const y of[...c.keys()].sort()){const x=c.get(y);let N=1/0,_=1/0,S=-1/0,b=-1/0;for(const P of x){const T=l(P.id),{w:L,h:F}=u(P.id);N=Math.min(N,T.x),_=Math.min(_,T.y),S=Math.max(S,T.x+L),b=Math.max(b,T.y+F)}const k=S-N,E=b-_,C=[...new Set(d.map(P=>Math.round(P.x)))].sort((P,T)=>P-T),I=C.length?C:[N],O=[0,...d.map(P=>P.y+P.h+h)].sort((P,T)=>P-T);let M=null;e:for(const P of I)for(const T of O){if(T>=_)break;if(!p(P,T,k,E)){M={x:P,y:T};break e}}if(M){const P=M.x-N,T=M.y-_;for(const L of x){const F=l(L.id);n.set(L.id,{x:F.x+P,y:F.y+T})}m.push(y)}for(const P of x){const T=l(P.id),{w:L,h:F}=u(P.id);d.push({x:T.x,y:T.y,w:L,h:F})}}return m}function i$(e,n,i,s,o,u=!1){const d=Os+il+1,h=8,p=1.75,m=200,y=.7,x=.01,N=M=>{const P=s.get(M);return{w:(P==null?void 0:P.width)??Fi,h:(P==null?void 0:P.height)??Ps}},_=M=>i.get(M)??n.get(M),S=new Map;for(const M of e){if(!_(M.id))continue;const P=sl(M),T=S.get(P);T?T.push(M):S.set(P,[M])}const b=[],k=new Set,E=new Set;for(const M of[...S.keys()].sort()){const P=S.get(M);let T=1/0,L=1/0,F=-1/0,J=-1/0,Q=!1;for(const ne of P){const K=_(ne.id),{w:$,h:W}=N(ne.id);T=Math.min(T,K.x),L=Math.min(L,K.y),F=Math.max(F,K.x+$),J=Math.max(J,K.y+W),i.has(ne.id)&&(Q=!0)}const j=F-T,G=J-L;E.add(M);const U=o.get(M);U&&(j>U.w+h||G>U.h+h)&&k.add(M),o.set(M,{w:j,h:G}),b.push({sid:M,members:P.map(ne=>ne.id),x:T,y:L,w:j,h:G,anchored:Q,mass:1})}for(const M of[...o.keys()])E.has(M)||o.delete(M);if(u||k.size===0)return[];for(const M of b)k.has(M.sid)&&(M.mass=8);const C=new Map(b.map(M=>[M.sid,M.x])),I=new Map(b.map(M=>[M.sid,M.y]));for(let M=0;M<m;M++){const P=new Map,T=new Map;let L=0;for(let F=0;F<b.length;F++)for(let J=F+1;J<b.length;J++){const Q=b[F],j=b[J];if(Q.anchored&&j.anchored)continue;const G=Q.x+Q.w/2,U=Q.y+Q.h/2,ne=j.x+j.w/2,K=j.y+j.h/2,$=(Q.w+j.w)/2+61-Math.abs(G-ne),W=(Q.h+j.h)/2+d-Math.abs(U-K);if($<=0||W<=0)continue;const A=(Qe,et)=>!Qe.anchored&&!(et<0&&Qe.x<=0),B=(Qe,et)=>!Qe.anchored&&!(et<0&&Qe.y<=0),ue=(Qe,et,Ve)=>{const Ye=Qe===et,We=Ye?Q.sid<j.sid?-1:1:Math.sign(Qe-et);return Ve(Q,We)||Ve(j,-We)?We:Ye&&(Ve(Q,-We)||Ve(j,We))?-We:0},z=ue(G,ne,A),X=ue(U,K,B),ee=z!==0,se=X!==0;if(!ee&&!se)continue;const oe=ee&&(!se||$*p<W),[pe,ge,Ae,ze]=oe?[z,$,P,A]:[X,W,T,B],Me=ze(Q,pe),Ie=ze(j,-pe),be=Q.mass,Be=j.mass,ye=Me?Ie?Be/(be+Be):1:0,we=Ie?Me?be/(be+Be):1:0,Le=ge*y;Ae.set(Q.sid,(Ae.get(Q.sid)??0)+pe*Le*ye),Ae.set(j.sid,(Ae.get(j.sid)??0)-pe*Le*we),L+=Le}for(const F of b)F.anchored||(F.x=Math.max(0,F.x+(P.get(F.sid)??0)),F.y=Math.max(0,F.y+(T.get(F.sid)??0)));if(L<x)break}const O=[];for(const M of b){const P=M.x-C.get(M.sid),T=M.y-I.get(M.sid);if(!(Math.abs(P)<1&&Math.abs(T)<1)){for(const L of M.members){if(i.has(L))continue;const F=n.get(L);F&&n.set(L,{x:F.x+P,y:F.y+T})}O.push(M.sid)}}return O}const s$=600;function Dg(e,n){return!(e.exitAt!=null&&n-e.exitAt>s$||e.kind==="root"&&e.state==="done"&&e.tools.length===0&&e.endedAt!=null&&e.endedAt-e.startedAt<3e3)}function o$(e,n){const i=new Set;for(const s of e.agents.values())Dg(s,n)&&i.add(s.id);return i}function Pi(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}function a$(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}const u$={agent:_P,sessionGroup:IP},l$=420,vu=18,c$=9e4,f$=200,d$=5*6e4,h$=6,p$=2*6e4,Cv="agent-dag.layout",Rv="agent-dag.viewport",cC="agent-dag.summariesDismissed",fC="agent-dag.sessionListOpen",dC="agent-dag.detailOpen",hC="agent-dag.usagePanelOpen",Nk="agent-dag.accountsPanelOpen",Ck="agent-dag.versionNoticeDismissed",Rk="agent-dag.autoRestart";function m$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(fC)==="1"}catch{return!1}}function g$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(fC,e?"1":"0")}catch{}}function v$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(dC)==="1"}catch{return!1}}function y$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(dC,e?"1":"0")}catch{}}function w$(){if(typeof window>"u")return!0;const e=window.localStorage.getItem(hC);try{return e===null?!0:e==="1"}catch{return!0}}function x$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(hC,e?"1":"0")}catch{}}function _$(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(cC);if(!e)return new Set;const n=JSON.parse(e);return new Set(Array.isArray(n)?n.filter(i=>typeof i=="string"):[])}catch{return new Set}}function Tk(e){if(!(typeof window>"u"))try{const n=Array.from(e),i=n.length>200?n.slice(-200):n;window.localStorage.setItem(cC,JSON.stringify(i))}catch{}}function S$(){const e={positions:[],pins:[]};if(typeof window>"u")return e;try{const n=window.localStorage.getItem(Cv);if(!n)return e;const i=JSON.parse(n);if(!("v"in i)){const o=Object.entries(i).filter(([,u])=>u&&typeof u.x=="number"&&typeof u.y=="number");return{positions:o,pins:o.map(([u])=>u)}}return{positions:Object.entries(i.positions??{}).filter(([,o])=>o&&typeof o.x=="number"&&typeof o.y=="number"),pins:Array.isArray(i.pins)?i.pins:[]}}catch{return e}}function wg(e,n){if(!(typeof window>"u"))try{const i={};for(const[s,o]of e)i[s]=o;for(const[s,o]of n)i[s]=o;window.localStorage.setItem(Cv,JSON.stringify({v:2,positions:i,pins:Array.from(n.keys())}))}catch{}}function b$(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(Rv);if(!e)return null;const n=JSON.parse(e);return typeof(n==null?void 0:n.x)!="number"||typeof(n==null?void 0:n.y)!="number"||typeof(n==null?void 0:n.zoom)!="number"?null:n}catch{return null}}function k$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Rv,JSON.stringify(e))}catch{}}function jk(){if(!(typeof window>"u")){try{window.localStorage.removeItem(Cv)}catch{}try{window.localStorage.removeItem(Rv)}catch{}}}function E$(e,n){const i=e.agents.get(n);if(!i)return;const s=[];for(const p of e.agents.values())p.sessionId===n&&s.push(p);const o={schemaVersion:1,exportedAt:new Date().toISOString(),sessionId:n,label:i.label,cwd:i.cwd,startedAt:i.startedAt,endedAt:i.endedAt,model:i.model,agents:s.map(p=>({id:p.id,kind:p.kind,label:p.label,parentId:p.parentId,state:p.state,startedAt:p.startedAt,endedAt:p.endedAt,model:p.model,cwd:p.cwd,usage:p.usage,prompts:p.prompts,tools:p.tools.map(m=>({id:m.id,name:m.name,inputPreview:m.inputPreview,startedAt:m.startedAt,endedAt:m.endedAt,ok:m.ok,errorPreview:m.errorPreview,usage:m.usage}))}))},u=JSON.stringify(o,null,2),l=new Blob([u],{type:"application/json"}),c=URL.createObjectURL(l),d=document.createElement("a"),h=(i.label||"session").replace(/[^a-z0-9._-]/gi,"_");d.href=c,d.download=`agents-deck-${h}-${n.slice(0,8)}.json`,document.body.appendChild(d),d.click(),document.body.removeChild(d),setTimeout(()=>URL.revokeObjectURL(c),1e3)}const Fg={file:"📁",shell:"⚡",web:"🌐",agent:"🤖",task:"📋",plan:"🧭",mcp:"🔌",other:"✨"},zg={file:"file",shell:"shell",web:"web",agent:"agent",task:"task",plan:"plan",mcp:"mcp",other:"other"},N$={Read:"file",Write:"file",Edit:"file",MultiEdit:"file",Glob:"file",Grep:"file",LS:"file",NotebookEdit:"file",Bash:"shell",PowerShell:"shell",shell:"shell",exec_command:"shell",shell_command:"shell",write_stdin:"shell",wait:"shell",apply_patch:"file",update_plan:"task",WebFetch:"web",WebSearch:"web",Task:"agent",Agent:"agent",TodoWrite:"task",TaskCreate:"task",TaskUpdate:"task",TaskList:"task",TaskGet:"task",TaskOutput:"task",TaskStop:"task",EnterPlanMode:"plan",ExitPlanMode:"plan",AskUserQuestion:"plan",Skill:"plan",Workflow:"plan"};function pC(e){return e.startsWith("mcp__")?"mcp":N$[e]??"other"}function mC(e,n){var s,o,u;if(!n)return!0;const i=n.toLowerCase();if(e.label.toLowerCase().includes(i)||(s=e.cwd)!=null&&s.toLowerCase().includes(i)||(o=e.cwdBasename)!=null&&o.toLowerCase().includes(i)||e.sessionId.toLowerCase().includes(i)||(u=e.firstPrompt)!=null&&u.toLowerCase().includes(i))return!0;for(const l of e.tools)if(l.name.toLowerCase().includes(i))return!0;return!1}function C$(e,n){if(!n)return null;const i=new Set([n]);let s=n;for(;s;){const u=e.agents.get(s);if(!(u!=null&&u.parentId)||i.has(u.parentId))break;i.add(u.parentId),s=u.parentId}let o=!0;for(;o;){o=!1;for(const u of e.agents.values())u.parentId&&i.has(u.parentId)&&!i.has(u.id)&&(i.add(u.id),o=!0)}return i}function R$(e,n,i,s,o,u,l,c,d,h,p,m,y,x,N,_,S,b){const k=[],E=[],C=new Set;if(u)for(const T of e.agents.values())mC(T,u)&&C.add(T.id);for(const T of e.agents.values()){if(!S.has(T.id))continue;const L=u?!C.has(T.id):!1,F=T.exitAt!=null,J=_!=null&&!_.has(T.id),Q=[L?"rf-dim":"",F?"rf-exiting":"",J?"rf-spotlit-out":""].filter(Boolean).join(" ")||void 0,j=l.get(T.id);if(k.push({id:T.id,type:"agent",position:{x:0,y:0},data:{...T,now:n,dim:L,onOpenContext:b},className:Q,...j?{width:j.width,height:j.height}:null}),T.parentId&&S.has(T.parentId)){const G=av(T.sessionId),U=T.state==="active"?`hsl(${G} 80% 72%)`:`hsl(${G} 50% 55%)`,ne=u&&!C.has(T.id)&&!C.has(T.parentId),K=F,$=N.size>0&&(N.has(T.id)||N.has(T.parentId)),W=_!=null&&!_.has(T.id)&&!_.has(T.parentId),A=T.state==="active"?2:1.5,B=$?A+1.5:A,ue=ne||K?.2:W?.12:1,z=[K?"rf-edge-exiting":"",$?"rf-edge-selected":""].filter(Boolean).join(" ")||void 0;E.push({id:`e:${T.parentId}->${T.id}`,source:T.parentId,target:T.id,animated:(T.state==="active"||$)&&!ne&&!K,type:"smoothstep",style:{stroke:U,strokeWidth:B,opacity:ue,transition:"opacity 500ms ease, stroke-width 200ms ease"},className:z})}}const I=k.filter(T=>!o.has(T.id)&&!m.has(T.id));if(I.length>0||y!==x.current){if(I.length>0){const T=t$(k,E,{direction:"LR",pinned:o,measured:l,availableWidth:i,availableHeight:s});for(const L of T)m.has(L.id)||m.set(L.id,L.position);r$(k,m,o,l,new Set(I.map(L=>L.id)))}n$(k,m,o,l),x.current=y}const O=i$(k,m,o,l,c,!h||p);O.length>0&&d(O);for(const T of Array.from(m.keys()))e.agents.has(T)||m.delete(T);if(e.agents.size>0)for(const T of Array.from(o.keys()))e.agents.has(T)||o.delete(T);const M=[];let P=!1;for(const T of k){let L=o.get(T.id)??m.get(T.id);L||(L={x:0,y:0},m.set(T.id,L),P=!0),M.push({...T,position:L})}return P&&(x.current=""),{nodes:M,edges:E}}function T$(){return v.jsx(sv,{children:v.jsx(j$,{})})}function j$(){const e=Ko(),n=q.useRef(qg()),[,i]=q.useState(0),s=q.useCallback(()=>i(V=>V+1),[]),[o,u]=q.useState(()=>new Set),[l,c]=q.useState(null),[d,h]=q.useState(null),p=q.useCallback((V,Z)=>{u(le=>{if(!Z)return new Set([V]);const de=new Set(le);return de.has(V)?de.delete(V):de.add(V),de}),c(le=>Z&&le===V?le:V)},[]),m=q.useCallback(()=>{u(new Set),c(null)},[]),[y,x]=q.useState(null),[N,_]=q.useState(null),S=q.useCallback(V=>_(V),[]),b=q.useRef(_$()),[k,E]=q.useState(m$);q.useEffect(()=>{g$(k)},[k]);const[C,I]=q.useState(v$);q.useEffect(()=>{y$(C)},[C]);const[O,M]=q.useState(w$);q.useEffect(()=>{x$(O)},[O]);const[P,T]=q.useState(()=>{try{const V=window.localStorage.getItem(Nk);return V===null?!0:V==="1"}catch{return!0}});q.useEffect(()=>{try{window.localStorage.setItem(Nk,P?"1":"0")}catch{}},[P]);const[L,F]=q.useState(null),[J,Q]=q.useState(!1),[j,G]=q.useState(0),[U,ne]=q.useState(0);q.useEffect(()=>{fetch("/api/sound-hook").then(V=>V.ok?V.json():null).then(V=>{V!=null&&V.ok&&(F(V.enabled===!0),G((V.foreign??[]).filter(Z=>Z.worksHere).length),ne(typeof V.parked=="number"?V.parked:0))}).catch(()=>{})},[]);const K=q.useCallback(async()=>{Q(!0);try{const Z=await(await fetch("/api/sound-hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!L})})).json().catch(()=>null);Z!=null&&Z.ok&&F(Z.enabled===!0),fetch("/api/sound-hook").then(le=>le.ok?le.json():null).then(le=>{le!=null&&le.ok&&(G((le.foreign??[]).filter(de=>de.worksHere).length),ne(typeof le.parked=="number"?le.parked:0))}).catch(()=>{})}catch{}finally{Q(!1)}},[L]),[$,W]=q.useState(!1),[A,B]=q.useState(null),[ue,z]=q.useState(()=>{if(typeof window>"u")return"";try{return window.localStorage.getItem(Ck)??""}catch{return""}}),[X,ee]=q.useState(!1),se=q.useCallback(()=>{fetch("/api/version").then(V=>V.ok?V.json():null).then(V=>{V&&B(V)}).catch(()=>{})},[]);q.useEffect(()=>{se();const V=window.setInterval(se,5*6e4),Z=()=>{document.visibilityState==="visible"&&se()};return document.addEventListener("visibilitychange",Z),()=>{window.clearInterval(V),document.removeEventListener("visibilitychange",Z)}},[se]),q.useEffect(()=>{$&&se()},[$,se]);const oe=(A==null?void 0:A.notice)??null,pe=oe?`${oe.kind}:${oe.to}`:"",ge=oe!=null&&ue!==pe,Ae=q.useCallback(()=>{if(!oe)return;const V=ue===pe?"":pe;z(V);try{window.localStorage.setItem(Ck,V)}catch{}},[oe,pe,ue]),ze=q.useCallback(async()=>{var le;const V=A==null?void 0:A.command;if(!V)return;let Z=!1;try{Z=await Promise.race([((le=navigator.clipboard)==null?void 0:le.writeText(V).then(()=>!0))??Promise.resolve(!1),new Promise(de=>window.setTimeout(()=>de(!1),500))])}catch{Z=!1}if(!Z)try{const de=document.createElement("textarea");de.value=V,de.setAttribute("readonly",""),de.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(de),de.select(),Z=document.execCommand("copy"),de.remove()}catch{Z=!1}Z&&(ee(!0),window.setTimeout(()=>ee(!1),1600))},[A==null?void 0:A.command]),Me=q.useCallback(()=>{E(V=>(V||T(!1),!V))},[]),Ie=q.useCallback(()=>{T(V=>(V||E(!1),!V))},[]),[be,Be]=q.useState(!1),[ye,we]=q.useState(0),Le=q.useRef(null),[Qe,et]=q.useState(0),[Ve,Ye]=q.useState(!1),We=q.useRef([]),[Ke,Qt]=q.useState(Date.now()),[vt,yt]=q.useState(()=>{if(typeof window>"u")return!0;try{return window.localStorage.getItem(Rk)!=="0"}catch{return!0}}),Zt=q.useCallback(()=>{yt(V=>{const Z=!V;try{window.localStorage.setItem(Rk,Z?"1":"0")}catch{}return Z})},[]),[Ct,Ze]=q.useState(!1),[_t,ht]=q.useState(null),at=q.useRef(!1),dn=q.useCallback(async()=>{if(!at.current){at.current=!0,Ze(!0);try{window.sessionStorage.setItem("agent-dag.restartPending",(oe==null?void 0:oe.to)??"")}catch{}try{await fetch("/api/restart",{method:"POST"})}catch{}window.setTimeout(()=>{if(at.current){at.current=!1,Ze(!1);try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}}},3e4)}},[oe==null?void 0:oe.to]),Bt=q.useRef(null);q.useEffect(()=>{let V=!1;for(const le of n.current.agents.values())if(le.state==="active"){V=!0;break}const Z=j3({enabled:vt,kind:oe==null?void 0:oe.kind,canRestart:(A==null?void 0:A.canRestart)===!0,busy:V,idleSince:Bt.current,now:Ke});Bt.current=Z.idleSince,Z.restart&&dn()},[vt,oe==null?void 0:oe.kind,A==null?void 0:A.canRestart,Ke,dn]),q.useEffect(()=>{const V=A==null?void 0:A.running;if(!V)return;let Z=null;try{Z=window.sessionStorage.getItem("agent-dag.restartPending")}catch{return}if(Z==null||Z&&Z!==V)return;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}at.current=!1,Ze(!1),ht(V);const le=window.setTimeout(()=>ht(null),6e3);return()=>window.clearTimeout(le)},[A==null?void 0:A.running]);const Rt=q.useRef(S$()).current;q.useRef(!1);const ct=q.useRef(new Map(Rt.positions.filter(([V])=>Rt.pins.includes(V)))),xn=q.useRef(null),Jt=q.useState(()=>b$())[0],[Tt,_n]=q.useState(""),[hn,Gi]=q.useState(()=>new Set),[Zn,ui]=q.useState(()=>typeof window>"u"?"dark":window.localStorage.getItem("agent-dag.theme")??"dark"),[li,ci]=q.useState(!1),fi=q.useRef(null);q.useEffect(()=>{document.documentElement.dataset.theme=Zn;try{window.localStorage.setItem("agent-dag.theme",Zn)}catch{}},[Zn]),q.useEffect(()=>{if(!Jt)return;const V=window.setTimeout(()=>{try{e.setViewport(Jt,{duration:0})}catch{}},60);return()=>window.clearTimeout(V)},[e,Jt]);const Jn=q.useRef(!0),St=q.useRef(null);q.useEffect(()=>{const V=new EventSource("/events");return V.addEventListener("open",()=>{W(!0),ci(!0)}),V.addEventListener("error",()=>W(!1)),V.addEventListener("replay-end",()=>{Jn.current=!1,St.current!=null&&(window.clearTimeout(St.current),St.current=null),s()}),V.addEventListener("hook",Z=>{try{const le=JSON.parse(Z.data);if(Ve){We.current.push(le);return}n.current=Vw(n.current,le),le.replay===!0||Jn.current||Date.now()-le.receivedAt>3e4?(St.current!=null&&window.clearTimeout(St.current),St.current=window.setTimeout(()=>{St.current=null,s()},120)):(St.current!=null&&(window.clearTimeout(St.current),St.current=null),s())}catch{}}),()=>{V.close(),St.current!=null&&(window.clearTimeout(St.current),St.current=null)}},[Ve,s]),q.useEffect(()=>{if(!Ve&&We.current.length!==0){for(const V of We.current)n.current=Vw(n.current,V);We.current.length=0,s()}},[Ve,s]),q.useEffect(()=>{const V=setInterval(()=>{const Z=Date.now();Qt(Z);let le=sP(n.current,Z,c$);rP(n.current,Z,f$,d$)&&(le=!0),iP(n.current,Z,h$,p$)&&(le=!0),le&&s()},250);return()=>clearInterval(V)},[s]);const qn=q.useRef(null),er=q.useRef(0),hr=420,Ot=q.useCallback((V=500)=>{try{const _e=document.querySelector(".canvas-wrap"),Pe=Array.from(document.querySelectorAll(".react-flow__node")).filter(nt=>nt.offsetWidth>0);if(!_e||Pe.length===0)return;const $e=_e.getBoundingClientRect(),tt=e.getViewport();if(!Number.isFinite(tt.zoom)||tt.zoom<=0)return;const Ue=nt=>(nt-$e.left-tt.x)/tt.zoom,Je=nt=>(nt-$e.top-tt.y)/tt.zoom,$t=Pe.map(nt=>nt.getBoundingClientRect()),sr=Math.min(...$t.map(nt=>Ue(nt.left))),Xs=Math.max(...$t.map(nt=>Ue(nt.right))),vi=Math.min(...$t.map(nt=>Je(nt.top))),yi=Math.max(...$t.map(nt=>Je(nt.bottom))),wi=Xs-sr,Fr=yi-vi;if(!(wi>0&&Fr>0))return;const kn=Math.max(.2,Math.min(1,($e.width-160)/(wi+hr)*.86,($e.height-160)/Fr*.86));e.setViewport({x:80-sr*kn,y:Math.max(80,($e.height-Fr*kn)/2)-vi*kn,zoom:kn},{duration:V}),er.current=Date.now(),window.setTimeout(()=>{try{const nt={x:80-sr*kn,y:Math.max(80,($e.height-Fr*kn)/2)-vi*kn,zoom:kn},ns=e.getViewport();(Math.abs(ns.zoom-kn)>.01||Math.abs(ns.x-nt.x)>2)&&e.setViewport(nt,{duration:0})}catch{}},V+60)}catch{}},[e]),tr=q.useRef(""),pr=q.useRef(null),Yi=q.useRef(0),Ir=q.useCallback(()=>{Yi.current=Date.now()},[]),Mr="agent-dag.autoFitDisabled",qt=q.useRef((()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(Mr)==="1"}catch{return!1}})()),[di,hi]=q.useState(qt.current),Ki=q.useCallback(()=>{if(!qt.current){qt.current=!0,hi(!0);try{window.localStorage.setItem(Mr,"1")}catch{}}},[]),Xi=q.useCallback(()=>{qt.current=!1,hi(!1);try{window.localStorage.removeItem(Mr)}catch{}Ot(400)},[e,Ot]);q.useEffect(()=>{const V=setInterval(()=>{if(qt.current||Date.now()-Yi.current<800)return;const Z=n.current,le=Date.now(),de=[];for(const Ue of Z.agents.values())Dg(Ue,le)&&de.push({id:Ue.id});if(de.length===0)return;const xe=e.getViewport(),_e=window.innerWidth-360,Pe=window.innerHeight-52;let $e=!1,tt=!1;for(const{id:Ue}of de){const Je=Ln.current.get(Ue),$t=ct.current.get(Ue)??jt.current.get(Ue);if(!Je||!$t)continue;tt=!0;const sr=$t.x*xe.zoom+xe.x,Xs=$t.y*xe.zoom+xe.y,vi=($t.x+Je.width)*xe.zoom+xe.x,yi=($t.y+Je.height)*xe.zoom+xe.y;if(vi>0&&sr<_e&&yi>0&&Xs<Pe){$e=!0;break}}tt&&!$e&&Ot(600)},1500);return()=>clearInterval(V)},[e]);const Pr=q.useRef(!1),Ln=q.useRef(new Map),pi=q.useRef(0),Qi=q.useCallback(V=>{const Z=Ln.current;let le=!1;for(const de of V.nodeInternals.values()){const xe=de.width,_e=de.height;if(xe==null||_e==null)continue;const Pe=Z.get(de.id);Pe?(Math.abs(Pe.height-_e)>4||Math.abs(Pe.width-xe)>4)&&(Z.set(de.id,{width:xe,height:_e}),le=!0):(Z.set(de.id,{width:xe,height:_e}),le=!0)}return le&&(pi.current+=1),pi.current},[]),Zi=Xe(Qi),[rt,Vs]=q.useState(0);q.useEffect(()=>{let V=0;const Z=()=>{const de=Ln.current;let xe=!1;for(const _e of document.querySelectorAll(".react-flow__node[data-id]")){const Pe=_e.getAttribute("data-id");if(!Pe)continue;const $e=_e.offsetWidth,tt=_e.offsetHeight;if(!$e||!tt)continue;const Ue=de.get(Pe);(!Ue||Math.abs(Ue.width-$e)>4||Math.abs(Ue.height-tt)>4)&&(de.set(Pe,{width:$e,height:tt}),xe=!0)}xe&&Vs(_e=>_e+1)};if(Pr.current)return;let le=0;return document.visibilityState==="hidden"?le=window.setTimeout(Z,32):V=requestAnimationFrame(Z),()=>{cancelAnimationFrame(V),window.clearTimeout(le)}});const jt=q.useRef(new Map(Rt.positions)),Or=q.useRef(""),pn=q.useMemo(()=>{const V=[];for(const Z of n.current.agents.values())Dg(Z,Ke)&&V.push(Z.id+(Z.parentId?`>${Z.parentId}`:""));return V.sort(),`${V.join("|")}#sv${Zi}.${rt}`},[n.current,n.current.lastSeq,Ke,Zi,rt]),nr=q.useRef(null);q.useEffect(()=>(nr.current!=null&&window.clearTimeout(nr.current),nr.current=window.setTimeout(()=>{wg(jt.current,ct.current)},1500),()=>{nr.current!=null&&window.clearTimeout(nr.current)}),[pn]),q.useEffect(()=>{if(tr.current===pn)return;const V=tr.current;if(tr.current=pn,!V||qt.current)return;Date.now()-er.current>1200&&Ot(400),qn.current&&window.clearTimeout(qn.current),qn.current=window.setTimeout(()=>{qt.current||Ot(500)},280)},[pn,e,Ot]);const qr=q.useMemo(()=>{if(o.size===0)return null;const V=new Set;for(const Z of o){const le=C$(n.current,Z);if(le)for(const de of le)V.add(de)}return V.size>0?V:null},[n.current,n.current.lastSeq,o]),rr=q.useMemo(()=>o$(n.current,Ke),[n.current,n.current.lastSeq,Ke]),Yt=q.useRef(null),[ir,en]=q.useState({w:0,h:0});q.useEffect(()=>{const V=Yt.current;if(!V||typeof ResizeObserver>"u")return;const Z=new ResizeObserver(le=>{var xe;const de=(xe=le[0])==null?void 0:xe.contentRect;de&&en(_e=>Math.abs(_e.w-de.width)>40||Math.abs(_e.h-de.height)>40?{w:de.width,h:de.height}:_e)});return Z.observe(V),en({w:V.clientWidth,h:V.clientHeight}),()=>Z.disconnect()},[]);const ol=q.useRef(new Map),[na,al]=q.useState(!1);q.useEffect(()=>{const V=window.setTimeout(()=>al(!0),2500);return()=>window.clearTimeout(V)},[]);const[Ji,Lr]=q.useState(!1),tn=q.useRef(null),[$r,ra]=q.useState(!1),ul=q.useCallback(()=>{tn.current&&(window.clearTimeout(tn.current),tn.current=null),Lr(!1)},[]),Ws=q.useCallback(V=>{V.length!==0&&queueMicrotask(()=>{Lr(!0),tn.current&&window.clearTimeout(tn.current),tn.current=window.setTimeout(()=>Lr(!1),l$+80)})},[]);q.useEffect(()=>()=>{tn.current&&window.clearTimeout(tn.current)},[]);const Gs=ir.w>0?ir.w*.92:0,es=ir.h>0?ir.h:0,{nodes:Ut,edges:ll}=q.useMemo(()=>R$(n.current,Ke,Gs,es,ct.current,Tt,Ln.current,ol.current,Ws,na,$r,jt.current,pn,Or,o,qr,rr,S),[n.current,n.current.lastSeq,Ke,Gs,es,na,$r,Tt,pn,o,qr,rr,S,ye]),ts=q.useMemo(()=>{const V=new Map;for(const le of Ut){const de=le.data;if(!(de!=null&&de.sessionId)||de.exitAt!=null)continue;const xe=le.width,_e=le.height;if(xe==null||_e==null)continue;const Pe=le.position.x,$e=le.position.y,tt=Pe+xe,Ue=$e+_e,Je=V.get(de.sessionId);Je?(Je.minX=Math.min(Je.minX,Pe),Je.minY=Math.min(Je.minY,$e),Je.maxX=Math.max(Je.maxX,tt),Je.maxY=Math.max(Je.maxY,Ue)):V.set(de.sessionId,{minX:Pe,minY:$e,maxX:tt,maxY:Ue})}const Z=[];for(const[le,de]of V){const xe=de.maxX-de.minX+vu*2,_e=de.maxY-de.minY+vu*2;Z.push({id:`group:${le}`,type:"sessionGroup",position:{x:de.minX-vu,y:de.minY-vu},data:{sessionId:le,w:xe,h:_e},width:xe,height:_e,style:{width:xe,height:_e},zIndex:-1,draggable:!0,selectable:!1,focusable:!1,deletable:!1,connectable:!1})}return Z},[Ut,Ke]),Ge=q.useMemo(()=>{const V=[...ts,...Ut],Z=Le.current;return!Z||Z.size===0?V:V.map(le=>{const de=Z.get(le.id);return de?{...le,position:de}:le})},[ts,Ut,Qe]),ia=q.useMemo(()=>{if(!Tt)return null;const V=new Set;for(const Z of n.current.agents.values())mC(Z,Tt)&&V.add(Z.id);return V},[n.current,n.current.lastSeq,Tt]),Ys=q.useMemo(()=>{const V=new Set;for(const Z of n.current.agents.values())for(const le of Z.tools)V.add(pC(le.name));return Object.keys(Fg).filter(Z=>V.has(Z))},[n.current,n.current.lastSeq]),mr=q.useMemo(()=>{const V=new Map;for(const le of n.current.agents.values())for(const de of le.tools){if(!de.name.startsWith("mcp__"))continue;const xe=de.name.slice(5),_e=xe.indexOf("__"),Pe=_e>0?xe.slice(0,_e):xe;V.set(Pe,(V.get(Pe)??0)+1)}const Z=[];for(const[le,de]of V){let xe=5381;for(let _e=0;_e<le.length;_e++)xe=(xe<<5)+xe^le.charCodeAt(_e);Z.push({server:le,count:de,hue:Math.abs(xe)%360})}return Z.sort((le,de)=>de.count-le.count),Z},[n.current,n.current.lastSeq]),sa=q.useCallback(V=>{Gi(Z=>{const le=new Set(Z);return le.has(V)?le.delete(V):le.add(V),le})},[]),Lt=l?n.current.agents.get(l):null,Ks=d?Array.from(n.current.agents.values()).flatMap(V=>V.tools).find(V=>V.id===d)??null:null,mi=q.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}n.current=qg(),ct.current.clear(),Ln.current.clear(),jt.current.clear(),Or.current="",jk(),m(),s()},[s,m]),Dr=q.useCallback(()=>{ct.current.clear(),jt.current.clear(),Or.current="",jk(),s(),window.setTimeout(()=>Ot(500),80)},[s,e,Ot]),$n=q.useCallback(()=>Ot(500),[Ot]),Sn=q.useCallback(V=>{if(Ut.length===0)return;const Z=Ut.slice().sort((_e,Pe)=>_e.position.y-Pe.position.y||_e.position.x-Pe.position.x),le=l?Z.findIndex(_e=>_e.id===l):-1;let de;le===-1?de=V===1?0:Z.length-1:de=(le+V+Z.length)%Z.length;const xe=Z[de];xe&&(p(xe.id,!1),window.setTimeout(()=>{try{e.fitView({padding:.35,duration:350,nodes:[xe]})}catch{}er.current=Date.now()},30))},[Ut,l,p,e]);q.useEffect(()=>{const V=Z=>{var de,xe;const le=((de=Z.target)==null?void 0:de.tagName)==="INPUT";if(Z.key==="Escape"){le?Z.target.blur():m();return}if(!le){if(Z.key==="/"){Z.preventDefault(),(xe=fi.current)==null||xe.focus();return}Z.key===" "&&(Z.preventDefault(),Ye(_e=>!_e)),(Z.key==="c"||Z.key==="C")&&mi(),(Z.key==="r"||Z.key==="R")&&Dr(),(Z.key==="f"||Z.key==="F")&&$n(),(Z.key==="l"||Z.key==="L")&&Me(),(Z.key==="h"||Z.key==="H")&&Be(_e=>!_e),(Z.key==="u"||Z.key==="U")&&M(_e=>!_e),(Z.key==="a"||Z.key==="A")&&Ie(),(Z.key==="j"||Z.key==="J")&&Sn(1),(Z.key==="k"||Z.key==="K")&&Sn(-1),(Z.key==="t"||Z.key==="T")&&ui(_e=>_e==="dark"?"light":"dark")}};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[mi,Dr,$n,m,Sn]);const bn=n.current.agents.size,gi=new Set(Array.from(n.current.agents.values()).map(V=>V.sessionId)).size,At=q.useMemo(()=>{let V=0,Z=0,le=0,de=0,xe=0,_e=0,Pe=0,$e=0,tt=0;for(const Ue of n.current.agents.values()){V+=Ue.usage.inputTokens,Z+=Ue.usage.outputTokens,le+=Ue.usage.cacheReadTokens,de+=Ue.usage.cacheCreateTokens;const Je=cn(Ue.usage,Ue.model);xe+=Je.total,_e+=Je.input,Pe+=Je.output,$e+=Je.cacheRead,tt+=Je.cacheWrite}return{inT:V,outT:Z,cacheR:le,cacheC:de,sum:V+Z,cost:{total:xe,input:_e,output:Pe,cacheRead:$e,cacheWrite:tt}}},[n.current,n.current.lastSeq]);return v.jsxs("div",{className:"app",children:[v.jsxs("header",{className:"topbar",children:[v.jsxs("div",{className:"brand",children:[v.jsx("span",{className:"logo"}),"agents-deck",oe?v.jsxs("button",{type:"button",className:"v stale",onClick:Ae,title:oe.kind==="restart"?`Running v${oe.from}; v${oe.to} is installed on disk. Restart to pick it up.`:`Running v${oe.from}; v${oe.to} is on npm.`,children:["v",oe.from,v.jsx("span",{className:"v-dot","aria-hidden":!0})]}):v.jsxs("span",{className:"v",children:["v",(A==null?void 0:A.running)??"1.31.0"]})]}),Lt&&(()=>{const V=cn(Lt.usage,Lt.model),Z=Math.max(0,((Lt.endedAt??Ke)-Lt.startedAt)/1e3),le=Lt.state==="active"?Iu(V.total,Z):null,de=o.size-1;return v.jsxs("button",{type:"button",className:"selected-ribbon",title:`Fit view to ${Lt.label}`,onClick:()=>{try{const xe=Ut.find(_e=>_e.id===Lt.id);xe&&e.fitView({padding:.35,duration:500,nodes:[xe]}),er.current=Date.now()}catch{}},children:[v.jsx("span",{className:`state-pill state-${Lt.state}`,children:Lt.state==="active"?"live":Lt.state}),v.jsx("span",{className:"selected-label",children:Lt.label}),V.total>0&&v.jsxs("span",{className:"selected-cost",children:[Fe(V.total),le?v.jsxs("span",{className:"selected-rate",children:[" · ",le]}):null]}),de>0&&v.jsxs("span",{className:"selected-extra",children:["+",de]}),v.jsx("span",{role:"button","aria-label":"Deselect",className:"selected-close",onClick:xe=>{xe.stopPropagation(),m()},children:"×"})]})})(),v.jsxs("div",{className:"actions",children:[v.jsxs("div",{className:"search",children:[v.jsx("span",{className:"search-icon","aria-hidden":!0,children:"⌕"}),v.jsx("input",{ref:fi,type:"text",placeholder:"Search agents, cwd, tools…",value:Tt,onChange:V=>_n(V.target.value),spellCheck:!1,"aria-label":"Filter the graph"}),Tt?v.jsx("button",{className:"search-clear","aria-label":"Clear search",onClick:()=>_n(""),children:"×"}):v.jsx("kbd",{className:"search-kbd","aria-hidden":!0,children:"/"})]}),v.jsxs("span",{className:"status",role:"status",children:[v.jsx("span",{className:`pill ${$?"live":"dead"}`,title:$?"Receiving events":"SSE disconnected",children:$?"live":"offline"}),v.jsxs("span",{className:"stat",title:"Distinct CC sessions",children:[v.jsx("span",{className:"count",children:gi}),v.jsx("span",{className:"lbl",children:"sessions"})]}),v.jsxs("span",{className:"stat",title:"Total agents (root + subagents)",children:[v.jsx("span",{className:"count",children:bn}),v.jsx("span",{className:"lbl",children:"agents"})]}),v.jsxs("span",{className:"stat",title:"Total hook events received",children:[v.jsx("span",{className:"count",children:n.current.totalEvents}),v.jsx("span",{className:"lbl",children:"events"})]}),At.sum>0&&v.jsxs("span",{className:"stat",title:`in:${At.inT.toLocaleString()} out:${At.outT.toLocaleString()} cache-r:${At.cacheR.toLocaleString()} cache-c:${At.cacheC.toLocaleString()}`,children:[v.jsx("span",{className:"count",children:a$(At.sum)}),v.jsx("span",{className:"lbl",children:"tokens"})]}),mr.length>0&&v.jsxs("span",{className:"stat mcp-legend",title:`MCP servers seen this session:
60
- ${mr.map(V=>` ${V.server}: ${V.count} call${V.count===1?"":"s"}`).join(`
61
- `)}`,children:[mr.slice(0,6).map(V=>v.jsx("span",{className:"mcp-dot",style:{background:`hsl(${V.hue} 65% 65%)`}},V.server)),mr.length>6&&v.jsxs("span",{className:"mcp-more",children:["+",mr.length-6]}),v.jsx("span",{className:"lbl",children:"mcp"})]}),At.cost.total>0&&(()=>{let V=0,Z=0;for(const xe of n.current.agents.values()){if(xe.state!=="active")continue;const _e=cn(xe.usage,xe.model);V+=_e.total,Z=Math.max(Z,((xe.endedAt??Ke)-xe.startedAt)/1e3)}const le=Z>0?Iu(V,Z):null,de=`input ${Fe(At.cost.input)} + output ${Fe(At.cost.output)} + cache r ${Fe(At.cost.cacheRead)} + cache w ${Fe(At.cost.cacheWrite)}${le?`
62
- active burn: ${le}`:""}`;return v.jsxs("span",{className:"stat",title:de,children:[v.jsx("span",{className:"count",children:Fe(At.cost.total)}),v.jsxs("span",{className:"lbl",children:["cost",le?` · ${le}`:""]})]})})()]}),v.jsx("button",{className:`btn ${Ve?"warn":""}`,onClick:()=>Ye(V=>!V),title:"Pause/resume live updates (Space)",children:Ve?`Resume${We.current.length?` · ${We.current.length}`:""}`:"Pause"}),v.jsx("button",{className:`btn icon-btn ${O?"primary":""}`,onClick:()=>M(V=>!V),title:`${O?"Hide":"Show"} usage panel (U)`,"aria-label":"Toggle usage panel",children:"$"}),L!==null&&v.jsx("button",{className:`btn icon-btn ${L?"primary":""}`,onClick:V=>{if(V.shiftKey&&U>0){Q(!0),fetch("/api/sound-hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"restore"})}).then(()=>fetch("/api/sound-hook")).then(Z=>Z.ok?Z.json():null).then(Z=>{Z!=null&&Z.ok&&(F(Z.enabled===!0),ne(Z.parked??0))}).catch(()=>{}).finally(()=>Q(!1));return}K()},disabled:J,title:(L?"Sound on turn finish: on — click to remove the hook":"Sound on turn finish: off — click to add a Stop hook")+(j>0?`
63
-
64
- ${j} sound hook${j>1?"s":""} of your own in settings.json also run${j>1?"":"s"} here.`:"")+(U>0?`
65
-
66
- ${U} of your own sound hook${U>1?"s were":" was"} set aside so this switch actually controls the sound. Nothing was deleted — shift-click to put ${U>1?"them":"it"} back.`:""),"aria-label":"Toggle finish sound","aria-pressed":L,children:v.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[v.jsx("path",{d:"M3.2 5.2h2L7.8 3v8L5.2 8.8h-2z"}),L?v.jsxs(v.Fragment,{children:[v.jsx("path",{d:"M9.8 5.4a2.4 2.4 0 0 1 0 3.2"}),v.jsx("path",{d:"M11.3 3.9a4.6 4.6 0 0 1 0 6.2"})]}):v.jsxs(v.Fragment,{children:[v.jsx("path",{d:"M10 5.6l2.6 2.8"}),v.jsx("path",{d:"M12.6 5.6L10 8.4"})]})]})}),v.jsx("button",{className:`btn icon-btn ${P?"primary":""}`,onClick:Ie,title:`${P?"Hide":"Show"} accounts (A)`,"aria-label":"Toggle accounts panel",children:v.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[v.jsx("circle",{cx:"7",cy:"4.6",r:"2.4"}),v.jsx("path",{d:"M2.4 12c0-2.3 2.1-3.7 4.6-3.7s4.6 1.4 4.6 3.7"})]})}),v.jsx("button",{className:`btn icon-btn ${k?"primary":""}`,onClick:Me,title:`${k?"Hide":"Show"} session list (L)`,"aria-label":"Toggle session list",children:"☰"}),v.jsx("button",{className:`btn icon-btn ${be?"primary":""}`,onClick:()=>Be(V=>!V),title:"Usage history — ccusage (H)","aria-label":"Open usage history",children:v.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":!0,children:[v.jsx("line",{x1:"3",y1:"11.5",x2:"3",y2:"7"}),v.jsx("line",{x1:"7",y1:"11.5",x2:"7",y2:"3"}),v.jsx("line",{x1:"11",y1:"11.5",x2:"11",y2:"8.5"})]})}),v.jsx("button",{className:"btn",onClick:Dr,title:"Auto-arrange — clear pins (R)",children:"Re-layout"}),v.jsx("button",{className:"btn",onClick:mi,title:"Clear canvas (C)",children:"Clear"}),v.jsx("button",{className:"btn icon-btn",onClick:()=>ui(V=>V==="dark"?"light":"dark"),title:`Switch to ${Zn==="dark"?"light":"dark"} mode (T)`,"aria-label":"Toggle theme",children:Zn==="dark"?"☀":"☾"})]})]}),_t?v.jsxs("div",{className:"ver-banner done",role:"status",children:[v.jsx("span",{className:"ver-dot"}),v.jsxs("strong",{children:["Restarted — now running v",_t,"."]}),v.jsx("span",{className:"ver-sub",children:"The canvas replayed from the event log."})]}):li&&!$?v.jsxs("div",{className:"conn-banner",role:"alert",children:[v.jsx("span",{className:"conn-dot"}),Ct?"Restarting agents-deck…":"Lost connection to agents-deck server. Reconnecting…"]}):ge&&oe&&v.jsxs("div",{className:`ver-banner ${oe.kind}`,role:"status",children:[v.jsx("span",{className:"ver-dot"}),oe.kind==="restart"?v.jsxs(v.Fragment,{children:[v.jsxs("strong",{children:["v",oe.to," is installed — this deck still runs v",oe.from,"."]}),A!=null&&A.canRestart?v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",className:"ver-act",onClick:dn,disabled:Ct,title:"Stop this process and bring it back on the same port. The canvas replays from the event log.",children:Ct?"restarting…":"Restart now"}),v.jsxs("button",{type:"button",className:`ver-auto${vt?" on":""}`,role:"switch","aria-checked":vt,onClick:Zt,title:vt?"Restarts on its own once nothing has been running for 30 seconds. Click to require a click instead.":"Only restarts when you click. Click to let it restart itself while idle.",children:[v.jsx("i",{"aria-hidden":!0}),"auto when idle"]})]}):v.jsx("span",{className:"ver-sub",title:"Node loads every module once, at startup. An upgrade replaces the files on disk but not the code already in memory, so this process keeps running the old version until it is restarted.",children:"Restart it to pick up the new code."})]}):v.jsxs(v.Fragment,{children:[v.jsxs("strong",{children:["agents-deck v",oe.to," is out — you are on v",oe.from,"."]}),v.jsxs("button",{type:"button",className:"ver-cmd",onClick:ze,title:"Copy to clipboard",children:[v.jsx("code",{children:A==null?void 0:A.command}),v.jsx("span",{className:"ver-cmd-hint",children:X?"copied":"copy"})]})]}),v.jsx("span",{role:"button",tabIndex:0,"aria-label":"Dismiss",className:"ver-close",onClick:Ae,onKeyDown:V=>{(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),Ae())},children:"×"})]}),O&&v.jsx(_3,{state:n.current,now:Ke,onClose:()=>M(!1)}),P&&v.jsx(R3,{onClose:()=>T(!1)}),k&&v.jsx(f3,{state:n.current,now:Ke,selectedIds:o,onSelect:V=>{p(V,!1),window.setTimeout(()=>{try{const Z=Ut.find(le=>le.id===V);Z&&e.fitView({padding:.3,duration:500,nodes:[Z]}),er.current=Date.now()}catch{}},60)},onClose:()=>E(!1)}),v.jsxs("div",{className:`canvas-wrap${Ji?" bubbling":""}${$r?" dragging-any":""}`,ref:Yt,children:[bn===0&&v.jsx(A$,{live:$,everConnected:li}),Ys.length>1&&v.jsx("div",{className:"cat-filter-bar",role:"toolbar","aria-label":"Filter tools by category",children:Ys.map(V=>{const Z=hn.has(V);return v.jsxs("button",{type:"button",className:`cat-filter${Z?" off":""}`,onClick:()=>sa(V),title:`${Z?"Show":"Hide"} ${zg[V]} tools`,children:[v.jsx("span",{className:"cat-emoji",children:Fg[V]}),v.jsx("span",{className:"cat-name",children:zg[V]})]},V)})}),v.jsxs(KE,{nodes:Ge,edges:ll,nodeTypes:u$,fitView:!Jt,fitViewOptions:{padding:.25,duration:400},minZoom:.2,maxZoom:1.6,panOnScroll:!0,nodesDraggable:!0,nodesConnectable:!1,selectionOnDrag:!1,onNodeClick:(V,Z)=>{if(Z.type==="sessionGroup"){m();return}p(Z.id,V.shiftKey)},onPaneClick:()=>m(),onMoveStart:()=>{Date.now()-er.current<1200||Ki()},onMove:(V,Z)=>{Ir(),pr.current&&window.clearTimeout(pr.current),pr.current=window.setTimeout(()=>k$(Z),250)},onNodeDragStart:(V,Z)=>{var le;if(ul(),Pr.current=!0,Le.current=new Map,ra(!0),Ir(),Ki(),Z.type==="sessionGroup"){const de=(le=Z.data)==null?void 0:le.sessionId,xe=new Map;if(de)for(const _e of Ut){const Pe=_e.data;(Pe==null?void 0:Pe.sessionId)===de&&xe.set(_e.id,{x:_e.position.x,y:_e.position.y})}xn.current={start:{x:Z.position.x,y:Z.position.y},members:xe};return}ct.current.set(Z.id,{x:Z.position.x,y:Z.position.y})},onNodeDrag:(V,Z)=>{var le;if(Ir(),Z.type==="sessionGroup"){const de=xn.current;if(!de)return;const xe=Z.position.x-de.start.x,_e=Z.position.y-de.start.y;for(const[$e,tt]of de.members){const Ue={x:tt.x+xe,y:tt.y+_e};ct.current.set($e,Ue),jt.current.set($e,Ue)}const Pe=Le.current;if(Pe){for(const[$e,tt]of de.members)Pe.set($e,{x:tt.x+xe,y:tt.y+_e});Pe.set(Z.id,{x:Z.position.x,y:Z.position.y})}et($e=>$e+1);return}ct.current.set(Z.id,{x:Z.position.x,y:Z.position.y}),jt.current.set(Z.id,{x:Z.position.x,y:Z.position.y}),(le=Le.current)==null||le.set(Z.id,{x:Z.position.x,y:Z.position.y}),et(de=>de+1)},onNodeDragStop:(V,Z)=>{if(Ir(),Pr.current=!1,Le.current=null,ra(!1),we(le=>le+1),Z.type==="sessionGroup"){const le=xn.current;if(le){const de=Z.position.x-le.start.x,xe=Z.position.y-le.start.y;for(const[_e,Pe]of le.members){const $e={x:Pe.x+de,y:Pe.y+xe};ct.current.set(_e,$e),jt.current.set(_e,$e)}}xn.current=null,wg(jt.current,ct.current),we(de=>de+1);return}ct.current.set(Z.id,{x:Z.position.x,y:Z.position.y}),jt.current.set(Z.id,{x:Z.position.x,y:Z.position.y}),wg(jt.current,ct.current)},children:[v.jsx(QM,{gap:28,size:1,color:Pi("--grid-line")}),v.jsx(jP,{}),v.jsx(s3,{agents:n.current.agents,visibleAgentIds:rr,positions:jt.current,pinned:ct.current,measured:Ln.current,dimUnmatched:ia,spotlight:qr,hiddenCategories:hn,now:Ke,onOpenTool:h}),v.jsx(VM,{showInteractive:!1,children:v.jsx(js,{onClick:Xi,title:di?"Recenter view + re-enable autofit":"Recenter view (autofit already on)","aria-label":"Recenter view",style:di?{color:"var(--accent)"}:void 0,children:v.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[v.jsx("circle",{cx:"12",cy:"12",r:"3.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),v.jsx("path",{d:"M12 2v4M12 18v4M2 12h4M18 12h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})})}),v.jsx($M,{zoomable:!0,pannable:!0,nodeColor:V=>{const Z=V.data;return Z.state==="err"?Pi("--err"):Z.state==="active"?Pi("--inflight"):Pi("--ok")},nodeStrokeWidth:2,maskColor:Pi("--minimap-mask"),style:{background:Pi("--panel"),border:`1px solid ${Pi("--line")}`,borderRadius:8}})]})]}),C?v.jsxs("aside",{className:"detail",children:[v.jsx("button",{type:"button",className:"detail-close",title:"Close panel","aria-label":"Close detail panel",onClick:()=>I(!1),children:"×"}),Lt?v.jsx(P$,{agent:Lt,now:Ke,onOpenTool:h,onShowSummary:V=>{b.current.has(V)&&(b.current.delete(V),Tk(b.current)),x(V)},onExportSession:V=>E$(n.current,V)}):v.jsx(M$,{count:bn})]}):v.jsx("button",{type:"button",className:"detail-reopen",title:"Show detail panel","aria-label":"Show detail panel",onClick:()=>I(!0),children:"‹"}),Ks&&v.jsx(NP,{tool:Ks,onClose:()=>h(null)}),be&&v.jsx(P3,{onClose:()=>Be(!1)}),N&&(()=>{const V=n.current.agents.get(N);return V?v.jsx(vP,{agent:V,onClose:()=>_(null)}):null})(),y&&v.jsx(o3,{state:n.current,sessionId:y,onClose:()=>{b.current.add(y),Tk(b.current),x(null)}})]})}function A$({live:e,everConnected:n}){const i=!e;return v.jsxs("div",{className:"empty-hero",children:[v.jsxs("div",{className:"orbit-stack","aria-hidden":!0,children:[v.jsx("div",{className:"core"}),v.jsxs("div",{className:"orbit r1",children:[v.jsx("span",{className:"dot"}),v.jsx("span",{className:"dot b"})]}),v.jsxs("div",{className:"orbit r2",children:[v.jsx("span",{className:"dot"}),v.jsx("span",{className:"dot b"})]}),v.jsxs("div",{className:"orbit r3",children:[v.jsx("span",{className:"dot"}),v.jsx("span",{className:"dot b"})]})]}),i?v.jsxs(v.Fragment,{children:[v.jsx("h2",{children:n?"Disconnected from server":"Server unreachable"}),v.jsxs("p",{children:["The browser cannot reach ",v.jsx("code",{children:"/events"}),". Check that",v.jsx("code",{children:"agents-deck"})," is still running in your terminal, then this page will resume automatically."]})]}):I$()]})}function I$(){return v.jsxs(v.Fragment,{children:[v.jsx("h2",{children:"Waiting for Claude Code or Codex"}),v.jsxs("p",{children:["Run ",v.jsx("code",{children:"claude"})," or ",v.jsx("code",{children:"codex"})," in any folder. As soon as a session sends an event, a node appears here and grows as subagents fork and tools are called."]}),v.jsxs("p",{className:"hint-row",children:["Not seeing anything? Make sure ",v.jsx("code",{children:"agents-deck"})," is running and that hooks are installed in ",v.jsx("code",{children:"~/.claude/settings.json"})," and"," ",v.jsx("code",{children:"~/.codex/hooks.json"}),". (Codex requires"," ",v.jsx("code",{children:"/hooks"})," trust on first run.)"]})]})}function M$({count:e}){return v.jsxs(v.Fragment,{children:[v.jsx("h3",{children:"Detail"}),e===0?v.jsxs("div",{className:"hint",children:["No data yet. Start a Claude Code or Codex session anywhere on this machine — agents-deck is in ",v.jsx("code",{children:"--all"})," mode and listens to every workspace."]}):v.jsx("div",{className:"empty",children:"Click an agent to see its tools."}),v.jsx("h3",{style:{marginTop:4},children:"Shortcuts"}),v.jsxs("div",{className:"shortcuts",children:[v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"drag"}),v.jsx("span",{children:"move a node"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"/"}),v.jsx("span",{children:"focus search"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"space"}),v.jsx("span",{children:"pause / resume"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"J"}),v.jsx("span",{children:"next agent"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"K"}),v.jsx("span",{children:"previous agent"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"R"}),v.jsx("span",{children:"re-arrange"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"F"}),v.jsx("span",{children:"fit view"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"L"}),v.jsx("span",{children:"session list"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"H"}),v.jsx("span",{children:"usage history"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"U"}),v.jsx("span",{children:"usage panel"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"C"}),v.jsx("span",{children:"clear canvas"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"T"}),v.jsx("span",{children:"toggle theme"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"Esc"}),v.jsx("span",{children:"deselect"})]})]})]})}function P$({agent:e,now:n,onOpenTool:i,onShowSummary:s,onExportSession:o}){const u=(e.endedAt??n)-e.startedAt,l=Math.max(0,Math.floor(u/1e3)),c=l<60?`${l}s`:`${Math.floor(l/60)}m ${String(l%60).padStart(2,"0")}s`,d=cn(e.usage,e.model),h=d.total>0,p=e.usage.inputTokens+e.usage.outputTokens,m=new Map;for(const _ of e.tools){const S=pC(_.name);m.set(S,(m.get(S)??0)+1)}const y=e.tools.filter(_=>_.ok===!1).length,x=e.tools.filter(_=>!_.endedAt).length,N=Array.from(m.entries()).sort((_,S)=>S[1]-_[1]);return v.jsxs(v.Fragment,{children:[v.jsxs("header",{className:"detail-hero",children:[v.jsxs("div",{className:"hero-line",children:[v.jsx("span",{className:`state-pill state-${e.state}`,children:e.state==="active"?"live":e.state}),v.jsx("h2",{className:"hero-title",title:e.cwd??e.label,children:e.label})]}),v.jsxs("div",{className:"hero-meta",children:[v.jsx("span",{className:"hero-meta-item",children:e.kind}),v.jsx("span",{className:"hero-sep",children:"·"}),v.jsx("span",{className:"hero-meta-item",title:`started ${new Date(e.startedAt).toLocaleString()}`,children:c}),e.model&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"hero-sep",children:"·"}),v.jsx("span",{className:"model-chip",title:e.model,children:Xo(e.model)})]})]}),h&&v.jsxs("div",{className:"hero-cost",children:[v.jsxs("div",{className:"hero-cost-headline",children:[v.jsx("span",{className:"hero-cost-value",children:Fe(d.total)}),v.jsx("span",{className:"hero-cost-label",children:"spend"})]}),v.jsx(O$,{cost:d})]}),v.jsxs("div",{className:"hero-actions",children:[e.kind==="root"&&e.state==="done"&&s&&v.jsx("button",{type:"button",className:"btn hero-action-btn",onClick:()=>s(e.sessionId),title:"Reopen the end-of-session recap modal",children:"Show recap"}),o&&v.jsx("button",{type:"button",className:"btn hero-action-btn",onClick:()=>o(e.sessionId),title:"Download this session as JSON",children:"Export JSON"})]})]}),e.tools.length>0&&v.jsxs("section",{className:"detail-section",children:[v.jsx("h3",{children:"Activity"}),v.jsxs("div",{className:"activity-row",children:[v.jsxs("div",{className:"activity-counters",children:[v.jsxs("span",{className:"ac-item",children:[v.jsx("b",{children:e.toolCount})," calls"]}),x>0&&v.jsxs("span",{className:"ac-item ac-live",children:[v.jsx("b",{children:x})," live"]}),y>0&&v.jsxs("span",{className:"ac-item ac-err",children:[v.jsx("b",{children:y})," err"]})]}),v.jsx("div",{className:"cat-strip",children:N.map(([_,S])=>v.jsxs("span",{className:`cat-chip cat-${_}`,title:`${S} ${zg[_]} call${S===1?"":"s"}`,children:[v.jsx("span",{className:"cat-emoji",children:Fg[_]}),v.jsx("span",{className:"cat-count",children:S})]},_))})]})]}),p>0&&v.jsxs("section",{className:"detail-section",children:[v.jsx("h3",{children:"Tokens"}),v.jsxs("div",{className:"tokens-grid",children:[v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"in"}),v.jsx("b",{children:e.usage.inputTokens.toLocaleString()})]}),v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"out"}),v.jsx("b",{children:e.usage.outputTokens.toLocaleString()})]}),v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"cache r"}),v.jsx("b",{children:e.usage.cacheReadTokens.toLocaleString()})]}),v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"cache c"}),v.jsx("b",{children:e.usage.cacheCreateTokens.toLocaleString()})]})]})]}),v.jsxs("section",{className:"detail-section",children:[v.jsx("h3",{children:"Identity"}),v.jsxs("div",{children:[e.cwd&&v.jsxs("div",{className:"row",children:[v.jsx("span",{className:"k",children:"cwd"}),v.jsx("span",{className:"v",title:e.cwd,children:e.cwd})]}),v.jsxs("div",{className:"row",children:[v.jsx("span",{className:"k",children:"session"}),v.jsxs("span",{className:"v",children:[e.sessionId.slice(0,12),"…"]})]}),e.parentId&&v.jsxs("div",{className:"row",children:[v.jsx("span",{className:"k",children:"parent"}),v.jsxs("span",{className:"v",children:[e.parentId.slice(0,12),"…"]})]})]})]}),e.prompts.length>0&&v.jsxs("section",{className:"detail-section",children:[v.jsxs("h3",{children:["Prompts ",v.jsx("span",{className:"section-count",children:e.prompts.length})]}),v.jsx("div",{className:"prompts",children:e.prompts.slice().reverse().map((_,S)=>v.jsxs("div",{className:"prompt-entry",children:[v.jsx("div",{className:"prompt-time",children:new Date(_.at).toLocaleTimeString()}),v.jsx("div",{className:"prompt-text",children:_.text})]},S))})]}),v.jsxs("section",{className:"detail-section",children:[v.jsxs("h3",{children:["Tool calls ",v.jsx("span",{className:"section-count",children:e.tools.length})]}),e.tools.length===0&&v.jsx("div",{className:"empty",children:"No tool calls yet."}),v.jsx("div",{children:e.tools.slice().reverse().map(_=>v.jsx(q$,{t:_,now:n,onClick:()=>i(_.id)},_.id))})]})]})}function O$({cost:e}){const n=e.total;if(n<=0)return null;const i=(s,o,u)=>{if(s<=0)return null;const l=s/n*100;return v.jsx("span",{className:`cb-seg ${o}`,style:{width:`${l}%`},title:`${u}: ${Fe(s)} (${l.toFixed(0)}%)`},o)};return v.jsxs("div",{className:"cost-bar","aria-label":"Cost breakdown",children:[i(e.input,"cb-input","input"),i(e.output,"cb-output","output"),i(e.cacheRead,"cb-cache-r","cache read"),i(e.cacheWrite,"cb-cache-w","cache write")]})}function q$({t:e,now:n,onClick:i}){const s=e.endedAt==null?"inflight":e.ok===!1?"err":"done",o=(e.endedAt??n)-e.startedAt,u=e.endedAt==null?"…":o<1e3?`${o}ms`:`${(o/1e3).toFixed(1)}s`;return v.jsxs("button",{className:"tool clickable",title:e.inputPreview||e.name,onClick:i,children:[v.jsxs("span",{className:"name",children:[v.jsx("span",{className:`status-dot ${s}`}),e.name]}),v.jsx("span",{style:{color:"var(--muted)"},children:u})]})}const L$=XR.createRoot(document.getElementById("root"));L$.render(v.jsx(T$,{}));