agent-dag 1.46.1 → 1.46.2
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,4 +1,4 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();var _u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function My(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cf={exports:{}},
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();var _u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function My(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cf={exports:{}},ba={},df={exports:{}},He={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Tx;function mA(){if(Tx)return He;Tx=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),g=Symbol.iterator;function y(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,_={};function b(I,Y,ce){this.props=I,this.context=Y,this.refs=_,this.updater=ce||w}b.prototype.isReactComponent={},b.prototype.setState=function(I,Y){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,Y,"setState")},b.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function k(){}k.prototype=b.prototype;function E(I,Y,ce){this.props=I,this.context=Y,this.refs=_,this.updater=ce||w}var C=E.prototype=new k;C.constructor=E,S(C,b.prototype),C.isPureReactComponent=!0;var T=Array.isArray,A=Object.prototype.hasOwnProperty,L={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function U(I,Y,ce){var z,Q={},ne=null,ae=null;if(Y!=null)for(z in Y.ref!==void 0&&(ae=Y.ref),Y.key!==void 0&&(ne=""+Y.key),Y)A.call(Y,z)&&!P.hasOwnProperty(z)&&(Q[z]=Y[z]);var fe=arguments.length-2;if(fe===1)Q.children=ce;else if(1<fe){for(var pe=Array(fe),ye=0;ye<fe;ye++)pe[ye]=arguments[ye+2];Q.children=pe}if(I&&I.defaultProps)for(z in fe=I.defaultProps,fe)Q[z]===void 0&&(Q[z]=fe[z]);return{$$typeof:e,type:I,key:ne,ref:ae,props:Q,_owner:L.current}}function O(I,Y){return{$$typeof:e,type:I.type,key:Y,ref:I.ref,props:I.props,_owner:I._owner}}function M(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function q(I){var Y={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(ce){return Y[ce]})}var V=/\/+/g;function X(I,Y){return typeof I=="object"&&I!==null&&I.key!=null?q(""+I.key):Y.toString(36)}function j(I,Y,ce,z,Q){var ne=typeof I;(ne==="undefined"||ne==="boolean")&&(I=null);var ae=!1;if(I===null)ae=!0;else switch(ne){case"string":case"number":ae=!0;break;case"object":switch(I.$$typeof){case e:case t:ae=!0}}if(ae)return ae=I,Q=Q(ae),I=z===""?"."+X(ae,0):z,T(Q)?(ce="",I!=null&&(ce=I.replace(V,"$&/")+"/"),j(Q,Y,ce,"",function(ye){return ye})):Q!=null&&(M(Q)&&(Q=O(Q,ce+(!Q.key||ae&&ae.key===Q.key?"":(""+Q.key).replace(V,"$&/")+"/")+I)),Y.push(Q)),1;if(ae=0,z=z===""?".":z+":",T(I))for(var fe=0;fe<I.length;fe++){ne=I[fe];var pe=z+X(ne,fe);ae+=j(ne,Y,ce,pe,Q)}else if(pe=y(I),typeof pe=="function")for(I=pe.call(I),fe=0;!(ne=I.next()).done;)ne=ne.value,pe=z+X(ne,fe++),ae+=j(ne,Y,ce,pe,Q);else if(ne==="object")throw Y=String(I),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return ae}function G(I,Y,ce){if(I==null)return I;var z=[],Q=0;return j(I,z,"","",function(ne){return Y.call(ce,ne,Q++)}),z}function B(I){if(I._status===-1){var Y=I._result;Y=Y(),Y.then(function(ce){(I._status===0||I._status===-1)&&(I._status=1,I._result=ce)},function(ce){(I._status===0||I._status===-1)&&(I._status=2,I._result=ce)}),I._status===-1&&(I._status=0,I._result=Y)}if(I._status===1)return I._result.default;throw I._result}var te={current:null},Z={transition:null},$={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:Z,ReactCurrentOwner:L};function H(){throw Error("act(...) is not supported in production builds of React.")}return He.Children={map:G,forEach:function(I,Y,ce){G(I,function(){Y.apply(this,arguments)},ce)},count:function(I){var Y=0;return G(I,function(){Y++}),Y},toArray:function(I){return G(I,function(Y){return Y})||[]},only:function(I){if(!M(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},He.Component=b,He.Fragment=r,He.Profiler=o,He.PureComponent=E,He.StrictMode=s,He.Suspense=f,He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$,He.act=H,He.cloneElement=function(I,Y,ce){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var z=S({},I.props),Q=I.key,ne=I.ref,ae=I._owner;if(Y!=null){if(Y.ref!==void 0&&(ne=Y.ref,ae=L.current),Y.key!==void 0&&(Q=""+Y.key),I.type&&I.type.defaultProps)var fe=I.type.defaultProps;for(pe in Y)A.call(Y,pe)&&!P.hasOwnProperty(pe)&&(z[pe]=Y[pe]===void 0&&fe!==void 0?fe[pe]:Y[pe])}var pe=arguments.length-2;if(pe===1)z.children=ce;else if(1<pe){fe=Array(pe);for(var ye=0;ye<pe;ye++)fe[ye]=arguments[ye+2];z.children=fe}return{$$typeof:e,type:I.type,key:Q,ref:ne,props:z,_owner:ae}},He.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:a,_context:I},I.Consumer=I},He.createElement=U,He.createFactory=function(I){var Y=U.bind(null,I);return Y.type=I,Y},He.createRef=function(){return{current:null}},He.forwardRef=function(I){return{$$typeof:c,render:I}},He.isValidElement=M,He.lazy=function(I){return{$$typeof:d,_payload:{_status:-1,_result:I},_init:B}},He.memo=function(I,Y){return{$$typeof:p,type:I,compare:Y===void 0?null:Y}},He.startTransition=function(I){var Y=Z.transition;Z.transition={};try{I()}finally{Z.transition=Y}},He.unstable_act=H,He.useCallback=function(I,Y){return te.current.useCallback(I,Y)},He.useContext=function(I){return te.current.useContext(I)},He.useDebugValue=function(){},He.useDeferredValue=function(I){return te.current.useDeferredValue(I)},He.useEffect=function(I,Y){return te.current.useEffect(I,Y)},He.useId=function(){return te.current.useId()},He.useImperativeHandle=function(I,Y,ce){return te.current.useImperativeHandle(I,Y,ce)},He.useInsertionEffect=function(I,Y){return te.current.useInsertionEffect(I,Y)},He.useLayoutEffect=function(I,Y){return te.current.useLayoutEffect(I,Y)},He.useMemo=function(I,Y){return te.current.useMemo(I,Y)},He.useReducer=function(I,Y,ce){return te.current.useReducer(I,Y,ce)},He.useRef=function(I){return te.current.useRef(I)},He.useState=function(I){return te.current.useState(I)},He.useSyncExternalStore=function(I,Y,ce){return te.current.useSyncExternalStore(I,Y,ce)},He.useTransition=function(){return te.current.useTransition()},He.version="18.3.1",He}var Rx;function Ka(){return Rx||(Rx=1,df.exports=mA()),df.exports}/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var Ax;function gA(){if(Ax)return ba;Ax=1;var e=Ka(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(c,f,p){var d,g={},y=null,w=null;p!==void 0&&(y=""+p),f.key!==void 0&&(y=""+f.key),f.ref!==void 0&&(w=f.ref);for(d in f)s.call(f,d)&&!a.hasOwnProperty(d)&&(g[d]=f[d]);if(c&&c.defaultProps)for(d in f=c.defaultProps,f)g[d]===void 0&&(g[d]=f[d]);return{$$typeof:t,type:c,key:y,ref:w,props:g,_owner:o.current}}return ba.Fragment=r,ba.jsx=u,ba.jsxs=u,ba}var Ix;function vA(){return Ix||(Ix=1,cf.exports=gA()),cf.exports}var m=vA(),bu={},ff={exports:{}},ln={},hf={exports:{}},pf={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var
|
|
25
|
+
*/var Mx;function yA(){return Mx||(Mx=1,(function(e){function t(Z,$){var H=Z.length;Z.push($);e:for(;0<H;){var I=H-1>>>1,Y=Z[I];if(0<o(Y,$))Z[I]=$,Z[H]=Y,H=I;else break e}}function r(Z){return Z.length===0?null:Z[0]}function s(Z){if(Z.length===0)return null;var $=Z[0],H=Z.pop();if(H!==$){Z[0]=H;e:for(var I=0,Y=Z.length,ce=Y>>>1;I<ce;){var z=2*(I+1)-1,Q=Z[z],ne=z+1,ae=Z[ne];if(0>o(Q,H))ne<Y&&0>o(ae,Q)?(Z[I]=ae,Z[ne]=H,I=ne):(Z[I]=Q,Z[z]=H,I=z);else if(ne<Y&&0>o(ae,H))Z[I]=ae,Z[ne]=H,I=ne;else break e}}return $}function o(Z,$){var H=Z.sortIndex-$.sortIndex;return H!==0?H:Z.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}var f=[],p=[],d=1,g=null,y=3,w=!1,S=!1,_=!1,b=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(Z){for(var $=r(p);$!==null;){if($.callback===null)s(p);else if($.startTime<=Z)s(p),$.sortIndex=$.expirationTime,t(f,$);else break;$=r(p)}}function T(Z){if(_=!1,C(Z),!S)if(r(f)!==null)S=!0,B(A);else{var $=r(p);$!==null&&te(T,$.startTime-Z)}}function A(Z,$){S=!1,_&&(_=!1,k(U),U=-1),w=!0;var H=y;try{for(C($),g=r(f);g!==null&&(!(g.expirationTime>$)||Z&&!q());){var I=g.callback;if(typeof I=="function"){g.callback=null,y=g.priorityLevel;var Y=I(g.expirationTime<=$);$=e.unstable_now(),typeof Y=="function"?g.callback=Y:g===r(f)&&s(f),C($)}else s(f);g=r(f)}if(g!==null)var ce=!0;else{var z=r(p);z!==null&&te(T,z.startTime-$),ce=!1}return ce}finally{g=null,y=H,w=!1}}var L=!1,P=null,U=-1,O=5,M=-1;function q(){return!(e.unstable_now()-M<O)}function V(){if(P!==null){var Z=e.unstable_now();M=Z;var $=!0;try{$=P(!0,Z)}finally{$?X():(L=!1,P=null)}}else L=!1}var X;if(typeof E=="function")X=function(){E(V)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,G=j.port2;j.port1.onmessage=V,X=function(){G.postMessage(null)}}else X=function(){b(V,0)};function B(Z){P=Z,L||(L=!0,X())}function te(Z,$){U=b(function(){Z(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(Z){Z.callback=null},e.unstable_continueExecution=function(){S||w||(S=!0,B(A))},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return r(f)},e.unstable_next=function(Z){switch(y){case 1:case 2:case 3:var $=3;break;default:$=y}var H=y;y=$;try{return Z()}finally{y=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Z,$){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var H=y;y=Z;try{return $()}finally{y=H}},e.unstable_scheduleCallback=function(Z,$,H){var I=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?I+H:I):H=I,Z){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=H+Y,Z={id:d++,callback:$,priorityLevel:Z,startTime:H,expirationTime:Y,sortIndex:-1},H>I?(Z.sortIndex=H,t(p,Z),r(f)===null&&Z===r(p)&&(_?(k(U),U=-1):_=!0,te(T,H-I))):(Z.sortIndex=Y,t(f,Z),S||w||(S=!0,B(A))),Z},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(Z){var $=y;return function(){var H=y;y=$;try{return Z.apply(this,arguments)}finally{y=H}}}})(pf)),pf}var Ox;function wA(){return Ox||(Ox=1,hf.exports=yA()),hf.exports}/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
34
|
-
`+I+n}var ce=!1;function z(n,i){if(!n||ce)return"";ce=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(
|
|
33
|
+
*/var Px;function xA(){if(Px)return ln;Px=1;var e=Ka(),t=wA();function r(n){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+n,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function a(n,i){u(n,i),u(n+"Capture",i)}function u(n,i){for(o[n]=i,n=0;n<i.length;n++)s.add(i[n])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,p=/^[: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]*$/,d={},g={};function y(n){return f.call(g,n)?!0:f.call(d,n)?!1:p.test(n)?g[n]=!0:(d[n]=!0,!1)}function w(n,i,l,h){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return h?!1:l!==null?!l.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function S(n,i,l,h){if(i===null||typeof i>"u"||w(n,i,l,h))return!0;if(h)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function _(n,i,l,h,v,x,R){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=h,this.attributeNamespace=v,this.mustUseProperty=l,this.propertyName=n,this.type=i,this.sanitizeURL=x,this.removeEmptyString=R}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){b[n]=new _(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var i=n[0];b[i]=new _(i,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){b[n]=new _(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){b[n]=new _(n,2,!1,n,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(n){b[n]=new _(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){b[n]=new _(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){b[n]=new _(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){b[n]=new _(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){b[n]=new _(n,5,!1,n.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function E(n){return n[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(n){var i=n.replace(k,E);b[i]=new _(i,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var i=n.replace(k,E);b[i]=new _(i,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var i=n.replace(k,E);b[i]=new _(i,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){b[n]=new _(n,1,!1,n.toLowerCase(),null,!1,!1)}),b.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){b[n]=new _(n,1,!1,n.toLowerCase(),null,!0,!0)});function C(n,i,l,h){var v=b.hasOwnProperty(i)?b[i]:null;(v!==null?v.type!==0:h||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(S(i,l,v,h)&&(l=null),h||v===null?y(i)&&(l===null?n.removeAttribute(i):n.setAttribute(i,""+l)):v.mustUseProperty?n[v.propertyName]=l===null?v.type===3?!1:"":l:(i=v.attributeName,h=v.attributeNamespace,l===null?n.removeAttribute(i):(v=v.type,l=v===3||v===4&&l===!0?"":""+l,h?n.setAttributeNS(h,i,l):n.setAttribute(i,l))))}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),L=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),q=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),Z=Symbol.iterator;function $(n){return n===null||typeof n!="object"?null:(n=Z&&n[Z]||n["@@iterator"],typeof n=="function"?n:null)}var H=Object.assign,I;function Y(n){if(I===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);I=i&&i[1]||""}return`
|
|
34
|
+
`+I+n}var ce=!1;function z(n,i){if(!n||ce)return"";ce=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(oe){var h=oe}Reflect.construct(n,[],i)}else{try{i.call()}catch(oe){h=oe}n.call(i.prototype)}else{try{throw Error()}catch(oe){h=oe}n()}}catch(oe){if(oe&&h&&typeof oe.stack=="string"){for(var v=oe.stack.split(`
|
|
35
35
|
`),x=h.stack.split(`
|
|
36
36
|
`),R=v.length-1,D=x.length-1;1<=R&&0<=D&&v[R]!==x[D];)D--;for(;1<=R&&0<=D;R--,D--)if(v[R]!==x[D]){if(R!==1||D!==1)do if(R--,D--,0>D||v[R]!==x[D]){var K=`
|
|
37
|
-
`+v[R].replace(" at new "," at ");return n.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",n.displayName)),K}while(1<=R&&0<=D);break}}}finally{ce=!1,Error.prepareStackTrace=l}return(n=n?n.displayName||n.name:"")?Y(n):""}function Q(n){switch(n.tag){case 5:return Y(n.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return n=z(n.type,!1),n;case 11:return n=z(n.type.render,!1),n;case 1:return n=z(n.type,!0),n;default:return""}}function ne(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case P:return"Fragment";case L:return"Portal";case O:return"Profiler";case U:return"StrictMode";case X:return"Suspense";case j:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case q:return(n.displayName||"Context")+".Consumer";case M:return(n._context.displayName||"Context")+".Provider";case V:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case G:return i=n.displayName||null,i!==null?i:ne(n.type)||"Memo";case B:i=n._payload,n=n._init;try{return ne(n(i))}catch{}}return null}function oe(n){var i=n.type;switch(n.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=i.render,n=n.displayName||n.name||"",i.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ne(i);case 8:return i===U?"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 i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function fe(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function pe(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ye(n){var i=pe(n)?"checked":"value",l=Object.getOwnPropertyDescriptor(n.constructor.prototype,i),h=""+n[i];if(!n.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var v=l.get,x=l.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return v.call(this)},set:function(R){h=""+R,x.call(this,R)}}),Object.defineProperty(n,i,{enumerable:l.enumerable}),{getValue:function(){return h},setValue:function(R){h=""+R},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function Me(n){n._valueTracker||(n._valueTracker=ye(n))}function Ue(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),h="";return n&&(h=pe(n)?n.checked?"true":"false":n.value),n=h,n!==l?(i.setValue(n),!0):!1}function ze(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Ie(n,i){var l=i.checked;return H({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??n._wrapperState.initialChecked})}function ke(n,i){var l=i.defaultValue==null?"":i.defaultValue,h=i.checked!=null?i.checked:i.defaultChecked;l=fe(i.value!=null?i.value:l),n._wrapperState={initialChecked:h,initialValue:l,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function le(n,i){i=i.checked,i!=null&&C(n,"checked",i,!1)}function we(n,i){le(n,i);var l=fe(i.value),h=i.type;if(l!=null)h==="number"?(l===0&&n.value===""||n.value!=l)&&(n.value=""+l):n.value!==""+l&&(n.value=""+l);else if(h==="submit"||h==="reset"){n.removeAttribute("value");return}i.hasOwnProperty("value")?Ye(n,i.type,l):i.hasOwnProperty("defaultValue")&&Ye(n,i.type,fe(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(n.defaultChecked=!!i.defaultChecked)}function xe(n,i,l){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var h=i.type;if(!(h!=="submit"&&h!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+n._wrapperState.initialValue,l||i===n.value||(n.value=i),n.defaultValue=i}l=n.name,l!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,l!==""&&(n.name=l)}function Ye(n,i,l){(i!=="number"||ze(n.ownerDocument)!==n)&&(l==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+l&&(n.defaultValue=""+l))}var gt=Array.isArray;function ft(n,i,l,h){if(n=n.options,i){i={};for(var v=0;v<l.length;v++)i["$"+l[v]]=!0;for(l=0;l<n.length;l++)v=i.hasOwnProperty("$"+n[l].value),n[l].selected!==v&&(n[l].selected=v),v&&h&&(n[l].defaultSelected=!0)}else{for(l=""+fe(l),i=null,v=0;v<n.length;v++){if(n[v].value===l){n[v].selected=!0,h&&(n[v].defaultSelected=!0);return}i!==null||n[v].disabled||(i=n[v])}i!==null&&(i.selected=!0)}}function ot(n,i){if(i.dangerouslySetInnerHTML!=null)throw Error(r(91));return H({},i,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function Be(n,i){var l=i.value;if(l==null){if(l=i.children,i=i.defaultValue,l!=null){if(i!=null)throw Error(r(92));if(gt(l)){if(1<l.length)throw Error(r(93));l=l[0]}i=l}i==null&&(i=""),l=i}n._wrapperState={initialValue:fe(l)}}function et(n,i){var l=fe(i.value),h=fe(i.defaultValue);l!=null&&(l=""+l,l!==n.value&&(n.value=l),i.defaultValue==null&&n.defaultValue!==l&&(n.defaultValue=l)),h!=null&&(n.defaultValue=""+h)}function Xe(n){var i=n.textContent;i===n._wrapperState.initialValue&&i!==""&&i!==null&&(n.value=i)}function wt(n){switch(n){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 ee(n,i){return n==null||n==="http://www.w3.org/1999/xhtml"?wt(i):n==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var Le,De=(function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,l,h,v){MSApp.execUnsafeLocalFunction(function(){return n(i,l,h,v)})}:n})(function(n,i){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=i;else{for(Le=Le||document.createElement("div"),Le.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=Le.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;i.firstChild;)n.appendChild(i.firstChild)}});function Re(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var $e={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},rt=["Webkit","ms","Moz","O"];Object.keys($e).forEach(function(n){rt.forEach(function(i){i=i+n.charAt(0).toUpperCase()+n.substring(1),$e[i]=$e[n]})});function tt(n,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||$e.hasOwnProperty(n)&&$e[n]?(""+i).trim():i+"px"}function Ce(n,i){n=n.style;for(var l in i)if(i.hasOwnProperty(l)){var h=l.indexOf("--")===0,v=tt(l,i[l],h);l==="float"&&(l="cssFloat"),h?n.setProperty(l,v):n[l]=v}}var kt=H({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 Ve(n,i){if(i){if(kt[n]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(r(137,n));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(r(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(r(61))}if(i.style!=null&&typeof i.style!="object")throw Error(r(62))}}function lt(n,i){if(n.indexOf("-")===-1)return typeof i.is=="string";switch(n){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 dn=null;function wn(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var xn=null,_n=null,zn=null;function bn(n){if(n=ia(n)){if(typeof xn!="function")throw Error(r(280));var i=n.stateNode;i&&(i=Ll(i),xn(n.stateNode,n.type,i))}}function hi(n){_n?zn?zn.push(n):zn=[n]:_n=n}function fn(){if(_n){var n=_n,i=zn;if(zn=_n=null,bn(n),i)for(n=0;n<i.length;n++)bn(i[n])}}function pi(n,i){return n(i)}function mi(){}var qt=!1;function Sr(n,i,l){if(qt)return n(i,l);qt=!0;try{return pi(n,i,l)}finally{qt=!1,(_n!==null||zn!==null)&&(mi(),fn())}}function Bn(n,i){var l=n.stateNode;if(l===null)return null;var h=Ll(l);if(h===null)return null;l=h[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(n=n.type,h=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!h;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var Rs=!1;if(c)try{var Er={};Object.defineProperty(Er,"passive",{get:function(){Rs=!0}}),window.addEventListener("test",Er,Er),window.removeEventListener("test",Er,Er)}catch{Rs=!1}function To(n,i,l,h,v,x,R,D,K){var ie=Array.prototype.slice.call(arguments,3);try{i.apply(l,ie)}catch(me){this.onError(me)}}var lr=!1,Nr=null,ur=!1,As=null,gi={onError:function(n){lr=!0,Nr=n}};function vi(n,i,l,h,v,x,R,D,K){lr=!1,Nr=null,To.apply(gi,arguments)}function yi(n,i,l,h,v,x,R,D,K){if(vi.apply(this,arguments),lr){if(lr){var ie=Nr;lr=!1,Nr=null}else throw Error(r(198));ur||(ur=!0,As=ie)}}function kn(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function cr(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function wi(n){if(kn(n)!==n)throw Error(r(188))}function xi(n){var i=n.alternate;if(!i){if(i=kn(n),i===null)throw Error(r(188));return i!==n?null:n}for(var l=n,h=i;;){var v=l.return;if(v===null)break;var x=v.alternate;if(x===null){if(h=v.return,h!==null){l=h;continue}break}if(v.child===x.child){for(x=v.child;x;){if(x===l)return wi(v),n;if(x===h)return wi(v),i;x=x.sibling}throw Error(r(188))}if(l.return!==h.return)l=v,h=x;else{for(var R=!1,D=v.child;D;){if(D===l){R=!0,l=v,h=x;break}if(D===h){R=!0,h=v,l=x;break}D=D.sibling}if(!R){for(D=x.child;D;){if(D===l){R=!0,l=x,h=v;break}if(D===h){R=!0,h=x,l=v;break}D=D.sibling}if(!R)throw Error(r(189))}}if(l.alternate!==h)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?n:i}function Bt(n){return n=xi(n),n!==null?Cr(n):null}function Cr(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var i=Cr(n);if(i!==null)return i;n=n.sibling}return null}var _i=t.unstable_scheduleCallback,Zr=t.unstable_cancelCallback,xt=t.unstable_shouldYield,Ro=t.unstable_requestPaint,st=t.unstable_now,Ao=t.unstable_getCurrentPriorityLevel,Is=t.unstable_ImmediatePriority,Sn=t.unstable_UserBlockingPriority,Un=t.unstable_NormalPriority,bi=t.unstable_LowPriority,ki=t.unstable_IdlePriority,jr=null,Kt=null;function En(n){if(Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(jr,n,void 0,(n.current.flags&128)===128)}catch{}}var tn=Math.clz32?Math.clz32:cl,ul=Math.log,Si=Math.LN2;function cl(n){return n>>>=0,n===0?32:31-(ul(n)/Si|0)|0}var Ms=64,Mt=4194304;function dr(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function Tr(n,i){var l=n.pendingLanes;if(l===0)return 0;var h=0,v=n.suspendedLanes,x=n.pingedLanes,R=l&268435455;if(R!==0){var D=R&~v;D!==0?h=dr(D):(x&=R,x!==0&&(h=dr(x)))}else R=l&~v,R!==0?h=dr(R):x!==0&&(h=dr(x));if(h===0)return 0;if(i!==0&&i!==h&&(i&v)===0&&(v=h&-h,x=i&-i,v>=x||v===16&&(x&4194240)!==0))return i;if((h&4)!==0&&(h|=l&16),i=n.entangledLanes,i!==0)for(n=n.entanglements,i&=h;0<i;)l=31-tn(i),v=1<<l,h|=n[l],i&=~v;return h}function dl(n,i){switch(n){case 1:case 2:case 4:return i+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 i+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 $c(n,i){for(var l=n.suspendedLanes,h=n.pingedLanes,v=n.expirationTimes,x=n.pendingLanes;0<x;){var R=31-tn(x),D=1<<R,K=v[R];K===-1?((D&l)===0||(D&h)!==0)&&(v[R]=dl(D,i)):K<=i&&(n.expiredLanes|=D),x&=~D}}function Rr(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function Io(){var n=Ms;return Ms<<=1,(Ms&4194240)===0&&(Ms=64),n}function Hn(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Os(n,i,l){n.pendingLanes|=i,i!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,i=31-tn(i),n[i]=l}function fl(n,i){var l=n.pendingLanes&~i;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=i,n.mutableReadLanes&=i,n.entangledLanes&=i,i=n.entanglements;var h=n.eventTimes;for(n=n.expirationTimes;0<l;){var v=31-tn(l),x=1<<v;i[v]=0,h[v]=-1,n[v]=-1,l&=~x}}function Mo(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var h=31-tn(l),v=1<<h;v&i|n[h]&i&&(n[h]|=i),l&=~v}}var Je=0;function Oo(n){return n&=-n,1<n?4<n?(n&268435455)!==0?16:536870912:4:1}var hl,Wn,Jr,Po,Ei,Nn=!1,Ni=[],jt=null,Cn=null,jn=null,es=new Map,fr=new Map,Tn=[],pl="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 Ci(n,i){switch(n){case"focusin":case"focusout":jt=null;break;case"dragenter":case"dragleave":Cn=null;break;case"mouseover":case"mouseout":jn=null;break;case"pointerover":case"pointerout":es.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":fr.delete(i.pointerId)}}function ts(n,i,l,h,v,x){return n===null||n.nativeEvent!==x?(n={blockedOn:i,domEventName:l,eventSystemFlags:h,nativeEvent:x,targetContainers:[v]},i!==null&&(i=ia(i),i!==null&&Wn(i)),n):(n.eventSystemFlags|=h,i=n.targetContainers,v!==null&&i.indexOf(v)===-1&&i.push(v),n)}function Lo(n,i,l,h,v){switch(i){case"focusin":return jt=ts(jt,n,i,l,h,v),!0;case"dragenter":return Cn=ts(Cn,n,i,l,h,v),!0;case"mouseover":return jn=ts(jn,n,i,l,h,v),!0;case"pointerover":var x=v.pointerId;return es.set(x,ts(es.get(x)||null,n,i,l,h,v)),!0;case"gotpointercapture":return x=v.pointerId,fr.set(x,ts(fr.get(x)||null,n,i,l,h,v)),!0}return!1}function $o(n){var i=Bs(n.target);if(i!==null){var l=kn(i);if(l!==null){if(i=l.tag,i===13){if(i=cr(l),i!==null){n.blockedOn=i,Ei(n.priority,function(){Jr(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Vn(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=Do(n.domEventName,n.eventSystemFlags,i[0],n.nativeEvent);if(l===null){l=n.nativeEvent;var h=new l.constructor(l.type,l);dn=h,l.target.dispatchEvent(h),dn=null}else return i=ia(l),i!==null&&Wn(i),n.blockedOn=l,!1;i.shift()}return!0}function qo(n,i,l){Vn(n)&&l.delete(i)}function ml(){Nn=!1,jt!==null&&Vn(jt)&&(jt=null),Cn!==null&&Vn(Cn)&&(Cn=null),jn!==null&&Vn(jn)&&(jn=null),es.forEach(qo),fr.forEach(qo)}function Ar(n,i){n.blockedOn===i&&(n.blockedOn=null,Nn||(Nn=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,ml)))}function Ps(n){function i(v){return Ar(v,n)}if(0<Ni.length){Ar(Ni[0],n);for(var l=1;l<Ni.length;l++){var h=Ni[l];h.blockedOn===n&&(h.blockedOn=null)}}for(jt!==null&&Ar(jt,n),Cn!==null&&Ar(Cn,n),jn!==null&&Ar(jn,n),es.forEach(i),fr.forEach(i),l=0;l<Tn.length;l++)h=Tn[l],h.blockedOn===n&&(h.blockedOn=null);for(;0<Tn.length&&(l=Tn[0],l.blockedOn===null);)$o(l),l.blockedOn===null&&Tn.shift()}var hr=T.ReactCurrentBatchConfig,Gn=!0;function gl(n,i,l,h){var v=Je,x=hr.transition;hr.transition=null;try{Je=1,ji(n,i,l,h)}finally{Je=v,hr.transition=x}}function qc(n,i,l,h){var v=Je,x=hr.transition;hr.transition=null;try{Je=4,ji(n,i,l,h)}finally{Je=v,hr.transition=x}}function ji(n,i,l,h){if(Gn){var v=Do(n,i,l,h);if(v===null)Jc(n,i,h,Ls,l),Ci(n,h);else if(Lo(v,n,i,l,h))h.stopPropagation();else if(Ci(n,h),i&4&&-1<pl.indexOf(n)){for(;v!==null;){var x=ia(v);if(x!==null&&hl(x),x=Do(n,i,l,h),x===null&&Jc(n,i,h,Ls,l),x===v)break;v=x}v!==null&&h.stopPropagation()}else Jc(n,i,h,null,l)}}var Ls=null;function Do(n,i,l,h){if(Ls=null,n=wn(h),n=Bs(n),n!==null)if(i=kn(n),i===null)n=null;else if(l=i.tag,l===13){if(n=cr(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null);return Ls=n,null}function Xt(n){switch(n){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(Ao()){case Is:return 1;case Sn:return 4;case Un:case bi:return 16;case ki:return 536870912;default:return 16}default:return 16}}var pr=null,$s=null,Yn=null;function ns(){if(Yn)return Yn;var n,i=$s,l=i.length,h,v="value"in pr?pr.value:pr.textContent,x=v.length;for(n=0;n<l&&i[n]===v[n];n++);var R=l-n;for(h=1;h<=R&&i[l-h]===v[x-h];h++);return Yn=v.slice(n,1<h?1-h:void 0)}function rs(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function ss(){return!0}function Fo(){return!1}function Ot(n){function i(l,h,v,x,R){this._reactName=l,this._targetInst=v,this.type=h,this.nativeEvent=x,this.target=R,this.currentTarget=null;for(var D in n)n.hasOwnProperty(D)&&(l=n[D],this[D]=l?l(x):x[D]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?ss:Fo,this.isPropagationStopped=Fo,this}return H(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ss)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ss)},persist:function(){},isPersistent:ss}),i}var Ir={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zo=Ot(Ir),qs=H({},Ir,{view:0,detail:0}),vl=Ot(qs),Bo,Uo,Mr,hn=H({},qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ai,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Mr&&(Mr&&n.type==="mousemove"?(Bo=n.screenX-Mr.screenX,Uo=n.screenY-Mr.screenY):Uo=Bo=0,Mr=n),Bo)},movementY:function(n){return"movementY"in n?n.movementY:Uo}}),Ti=Ot(hn),yl=H({},hn,{dataTransfer:0}),Dc=Ot(yl),Fc=H({},qs,{relatedTarget:0}),Ri=Ot(Fc),wl=H({},Ir,{animationName:0,elapsedTime:0,pseudoElement:0}),mr=Ot(wl),zc=H({},Ir,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),xl=Ot(zc),Bc=H({},Ir,{data:0}),Ds=Ot(Bc),Uc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qt={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"},Ho={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _l(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=Ho[n])?!!i[n]:!1}function Ai(){return _l}var bl=H({},qs,{key:function(n){if(n.key){var i=Uc[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=rs(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Qt[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ai,charCode:function(n){return n.type==="keypress"?rs(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?rs(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Wo=Ot(bl),Ii=H({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mi=Ot(Ii),kl=H({},qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ai}),Oi=Ot(kl),Sl=H({},Ir,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vo=Ot(Sl),El=H({},hn,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),Go=Ot(El),Kn=[9,13,27,32],Pi=c&&"CompositionEvent"in window,is=null;c&&"documentMode"in document&&(is=document.documentMode);var Hc=c&&"TextEvent"in window&&!is,Nl=c&&(!Pi||is&&8<is&&11>=is),Yo=" ",Zt=!1;function Ko(n,i){switch(n){case"keyup":return Kn.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xo(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Or=!1;function Cl(n,i){switch(n){case"compositionend":return Xo(i);case"keypress":return i.which!==32?null:(Zt=!0,Yo);case"textInput":return n=i.data,n===Yo&&Zt?null:n;default:return null}}function F(n,i){if(Or)return n==="compositionend"||!Pi&&Ko(n,i)?(n=ns(),Yn=$s=pr=null,Or=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Nl&&i.locale!=="ko"?null:i.data;default:return null}}var W={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 ae(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!W[n.type]:i==="textarea"}function de(n,i,l,h){hi(h),i=Ml(i,"onChange"),0<i.length&&(l=new zo("onChange","change",null,l,h),n.push({event:l,listeners:i}))}var _e=null,Se=null;function Fe(n){H0(n,0)}function Ke(n){var i=Fi(n);if(Ue(i))return n}function ht(n,i){if(n==="change")return i}var at=!1;if(c){var Ut;if(c){var os="oninput"in document;if(!os){var Qo=document.createElement("div");Qo.setAttribute("oninput","return;"),os=typeof Qo.oninput=="function"}Ut=os}else Ut=!1;at=Ut&&(!document.documentMode||9<document.documentMode)}function jl(){_e&&(_e.detachEvent("onpropertychange",Zo),Se=_e=null)}function Zo(n){if(n.propertyName==="value"&&Ke(Se)){var i=[];de(i,Se,n,wn(n)),Sr(Fe,i)}}function Wc(n,i,l){n==="focusin"?(jl(),_e=i,Se=l,_e.attachEvent("onpropertychange",Zo)):n==="focusout"&&jl()}function Tl(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Ke(Se)}function Jo(n,i){if(n==="click")return Ke(i)}function Fs(n,i){if(n==="input"||n==="change")return Ke(i)}function zs(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var nt=typeof Object.is=="function"?Object.is:zs;function as(n,i){if(nt(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),h=Object.keys(i);if(l.length!==h.length)return!1;for(h=0;h<l.length;h++){var v=l[h];if(!f.call(i,v)||!nt(n[v],i[v]))return!1}return!0}function A0(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function I0(n,i){var l=A0(n);n=0;for(var h;l;){if(l.nodeType===3){if(h=n+l.textContent.length,n<=i&&h>=i)return{node:l,offset:i-n};n=h}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=A0(l)}}function M0(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?M0(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function O0(){for(var n=window,i=ze();i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=ze(n.document)}return i}function Vc(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}function bR(n){var i=O0(),l=n.focusedElem,h=n.selectionRange;if(i!==l&&l&&l.ownerDocument&&M0(l.ownerDocument.documentElement,l)){if(h!==null&&Vc(l)){if(i=h.start,n=h.end,n===void 0&&(n=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(n,l.value.length);else if(n=(i=l.ownerDocument||document)&&i.defaultView||window,n.getSelection){n=n.getSelection();var v=l.textContent.length,x=Math.min(h.start,v);h=h.end===void 0?x:Math.min(h.end,v),!n.extend&&x>h&&(v=h,h=x,x=v),v=I0(l,x);var R=I0(l,h);v&&R&&(n.rangeCount!==1||n.anchorNode!==v.node||n.anchorOffset!==v.offset||n.focusNode!==R.node||n.focusOffset!==R.offset)&&(i=i.createRange(),i.setStart(v.node,v.offset),n.removeAllRanges(),x>h?(n.addRange(i),n.extend(R.node,R.offset)):(i.setEnd(R.node,R.offset),n.addRange(i)))}}for(i=[],n=l;n=n.parentNode;)n.nodeType===1&&i.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<i.length;l++)n=i[l],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var kR=c&&"documentMode"in document&&11>=document.documentMode,Li=null,Gc=null,ea=null,Yc=!1;function P0(n,i,l){var h=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Yc||Li==null||Li!==ze(h)||(h=Li,"selectionStart"in h&&Vc(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),ea&&as(ea,h)||(ea=h,h=Ml(Gc,"onSelect"),0<h.length&&(i=new zo("onSelect","select",null,i,l),n.push({event:i,listeners:h}),i.target=Li)))}function Rl(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var $i={animationend:Rl("Animation","AnimationEnd"),animationiteration:Rl("Animation","AnimationIteration"),animationstart:Rl("Animation","AnimationStart"),transitionend:Rl("Transition","TransitionEnd")},Kc={},L0={};c&&(L0=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function Al(n){if(Kc[n])return Kc[n];if(!$i[n])return n;var i=$i[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in L0)return Kc[n]=i[l];return n}var $0=Al("animationend"),q0=Al("animationiteration"),D0=Al("animationstart"),F0=Al("transitionend"),z0=new Map,B0="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 ls(n,i){z0.set(n,i),a(i,[n])}for(var Xc=0;Xc<B0.length;Xc++){var Qc=B0[Xc],SR=Qc.toLowerCase(),ER=Qc[0].toUpperCase()+Qc.slice(1);ls(SR,"on"+ER)}ls($0,"onAnimationEnd"),ls(q0,"onAnimationIteration"),ls(D0,"onAnimationStart"),ls("dblclick","onDoubleClick"),ls("focusin","onFocus"),ls("focusout","onBlur"),ls(F0,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ta="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(" "),NR=new Set("cancel close invalid load scroll toggle".split(" ").concat(ta));function U0(n,i,l){var h=n.type||"unknown-event";n.currentTarget=l,yi(h,i,void 0,n),n.currentTarget=null}function H0(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var h=n[l],v=h.event;h=h.listeners;e:{var x=void 0;if(i)for(var R=h.length-1;0<=R;R--){var D=h[R],K=D.instance,ie=D.currentTarget;if(D=D.listener,K!==x&&v.isPropagationStopped())break e;U0(v,D,ie),x=K}else for(R=0;R<h.length;R++){if(D=h[R],K=D.instance,ie=D.currentTarget,D=D.listener,K!==x&&v.isPropagationStopped())break e;U0(v,D,ie),x=K}}}if(ur)throw n=As,ur=!1,As=null,n}function ct(n,i){var l=i[id];l===void 0&&(l=i[id]=new Set);var h=n+"__bubble";l.has(h)||(W0(i,n,2,!1),l.add(h))}function Zc(n,i,l){var h=0;i&&(h|=4),W0(l,n,h,i)}var Il="_reactListening"+Math.random().toString(36).slice(2);function na(n){if(!n[Il]){n[Il]=!0,s.forEach(function(l){l!=="selectionchange"&&(NR.has(l)||Zc(l,!1,n),Zc(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[Il]||(i[Il]=!0,Zc("selectionchange",!1,i))}}function W0(n,i,l,h){switch(Xt(i)){case 1:var v=gl;break;case 4:v=qc;break;default:v=ji}l=v.bind(null,i,l,n),v=void 0,!Rs||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(v=!0),h?v!==void 0?n.addEventListener(i,l,{capture:!0,passive:v}):n.addEventListener(i,l,!0):v!==void 0?n.addEventListener(i,l,{passive:v}):n.addEventListener(i,l,!1)}function Jc(n,i,l,h,v){var x=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var R=h.tag;if(R===3||R===4){var D=h.stateNode.containerInfo;if(D===v||D.nodeType===8&&D.parentNode===v)break;if(R===4)for(R=h.return;R!==null;){var K=R.tag;if((K===3||K===4)&&(K=R.stateNode.containerInfo,K===v||K.nodeType===8&&K.parentNode===v))return;R=R.return}for(;D!==null;){if(R=Bs(D),R===null)return;if(K=R.tag,K===5||K===6){h=x=R;continue e}D=D.parentNode}}h=h.return}Sr(function(){var ie=x,me=wn(l),ge=[];e:{var he=z0.get(n);if(he!==void 0){var be=zo,Ne=n;switch(n){case"keypress":if(rs(l)===0)break e;case"keydown":case"keyup":be=Wo;break;case"focusin":Ne="focus",be=Ri;break;case"focusout":Ne="blur",be=Ri;break;case"beforeblur":case"afterblur":be=Ri;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":be=Ti;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":be=Dc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":be=Oi;break;case $0:case q0:case D0:be=mr;break;case F0:be=Vo;break;case"scroll":be=vl;break;case"wheel":be=Go;break;case"copy":case"cut":case"paste":be=xl;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":be=Mi}var je=(i&4)!==0,St=!je&&n==="scroll",re=je?he!==null?he+"Capture":null:he;je=[];for(var J=ie,se;J!==null;){se=J;var ve=se.stateNode;if(se.tag===5&&ve!==null&&(se=ve,re!==null&&(ve=Bn(J,re),ve!=null&&je.push(ra(J,ve,se)))),St)break;J=J.return}0<je.length&&(he=new be(he,Ne,null,l,me),ge.push({event:he,listeners:je}))}}if((i&7)===0){e:{if(he=n==="mouseover"||n==="pointerover",be=n==="mouseout"||n==="pointerout",he&&l!==dn&&(Ne=l.relatedTarget||l.fromElement)&&(Bs(Ne)||Ne[Pr]))break e;if((be||he)&&(he=me.window===me?me:(he=me.ownerDocument)?he.defaultView||he.parentWindow:window,be?(Ne=l.relatedTarget||l.toElement,be=ie,Ne=Ne?Bs(Ne):null,Ne!==null&&(St=kn(Ne),Ne!==St||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(be=null,Ne=ie),be!==Ne)){if(je=Ti,ve="onMouseLeave",re="onMouseEnter",J="mouse",(n==="pointerout"||n==="pointerover")&&(je=Mi,ve="onPointerLeave",re="onPointerEnter",J="pointer"),St=be==null?he:Fi(be),se=Ne==null?he:Fi(Ne),he=new je(ve,J+"leave",be,l,me),he.target=St,he.relatedTarget=se,ve=null,Bs(me)===ie&&(je=new je(re,J+"enter",Ne,l,me),je.target=se,je.relatedTarget=St,ve=je),St=ve,be&&Ne)t:{for(je=be,re=Ne,J=0,se=je;se;se=qi(se))J++;for(se=0,ve=re;ve;ve=qi(ve))se++;for(;0<J-se;)je=qi(je),J--;for(;0<se-J;)re=qi(re),se--;for(;J--;){if(je===re||re!==null&&je===re.alternate)break t;je=qi(je),re=qi(re)}je=null}else je=null;be!==null&&V0(ge,he,be,je,!1),Ne!==null&&St!==null&&V0(ge,St,Ne,je,!0)}}e:{if(he=ie?Fi(ie):window,be=he.nodeName&&he.nodeName.toLowerCase(),be==="select"||be==="input"&&he.type==="file")var Te=ht;else if(ae(he))if(at)Te=Fs;else{Te=Tl;var Oe=Wc}else(be=he.nodeName)&&be.toLowerCase()==="input"&&(he.type==="checkbox"||he.type==="radio")&&(Te=Jo);if(Te&&(Te=Te(n,ie))){de(ge,Te,l,me);break e}Oe&&Oe(n,he,ie),n==="focusout"&&(Oe=he._wrapperState)&&Oe.controlled&&he.type==="number"&&Ye(he,"number",he.value)}switch(Oe=ie?Fi(ie):window,n){case"focusin":(ae(Oe)||Oe.contentEditable==="true")&&(Li=Oe,Gc=ie,ea=null);break;case"focusout":ea=Gc=Li=null;break;case"mousedown":Yc=!0;break;case"contextmenu":case"mouseup":case"dragend":Yc=!1,P0(ge,l,me);break;case"selectionchange":if(kR)break;case"keydown":case"keyup":P0(ge,l,me)}var Pe;if(Pi)e:{switch(n){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Or?Ko(n,l)&&(qe="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(qe="onCompositionStart");qe&&(Nl&&l.locale!=="ko"&&(Or||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Or&&(Pe=ns()):(pr=me,$s="value"in pr?pr.value:pr.textContent,Or=!0)),Oe=Ml(ie,qe),0<Oe.length&&(qe=new Ds(qe,n,null,l,me),ge.push({event:qe,listeners:Oe}),Pe?qe.data=Pe:(Pe=Xo(l),Pe!==null&&(qe.data=Pe)))),(Pe=Hc?Cl(n,l):F(n,l))&&(ie=Ml(ie,"onBeforeInput"),0<ie.length&&(me=new Ds("onBeforeInput","beforeinput",null,l,me),ge.push({event:me,listeners:ie}),me.data=Pe))}H0(ge,i)})}function ra(n,i,l){return{instance:n,listener:i,currentTarget:l}}function Ml(n,i){for(var l=i+"Capture",h=[];n!==null;){var v=n,x=v.stateNode;v.tag===5&&x!==null&&(v=x,x=Bn(n,l),x!=null&&h.unshift(ra(n,x,v)),x=Bn(n,i),x!=null&&h.push(ra(n,x,v))),n=n.return}return h}function qi(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function V0(n,i,l,h,v){for(var x=i._reactName,R=[];l!==null&&l!==h;){var D=l,K=D.alternate,ie=D.stateNode;if(K!==null&&K===h)break;D.tag===5&&ie!==null&&(D=ie,v?(K=Bn(l,x),K!=null&&R.unshift(ra(l,K,D))):v||(K=Bn(l,x),K!=null&&R.push(ra(l,K,D)))),l=l.return}R.length!==0&&n.push({event:i,listeners:R})}var CR=/\r\n?/g,jR=/\u0000|\uFFFD/g;function G0(n){return(typeof n=="string"?n:""+n).replace(CR,`
|
|
38
|
-
`).replace(jR,"")}function Ol(n,i,l){if(i=G0(i),G0(n)!==i&&l)throw Error(r(425))}function Pl(){}var ed=null,td=null;function nd(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var rd=typeof setTimeout=="function"?setTimeout:void 0,TR=typeof clearTimeout=="function"?clearTimeout:void 0,Y0=typeof Promise=="function"?Promise:void 0,RR=typeof queueMicrotask=="function"?queueMicrotask:typeof Y0<"u"?function(n){return Y0.resolve(null).then(n).catch(AR)}:rd;function AR(n){setTimeout(function(){throw n})}function sd(n,i){var l=i,h=0;do{var v=l.nextSibling;if(n.removeChild(l),v&&v.nodeType===8)if(l=v.data,l==="/$"){if(h===0){n.removeChild(v),Ps(i);return}h--}else l!=="$"&&l!=="$?"&&l!=="$!"||h++;l=v}while(l);Ps(i)}function us(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return n}function K0(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return n;i--}else l==="/$"&&i++}n=n.previousSibling}return null}var Di=Math.random().toString(36).slice(2),gr="__reactFiber$"+Di,sa="__reactProps$"+Di,Pr="__reactContainer$"+Di,id="__reactEvents$"+Di,IR="__reactListeners$"+Di,MR="__reactHandles$"+Di;function Bs(n){var i=n[gr];if(i)return i;for(var l=n.parentNode;l;){if(i=l[Pr]||l[gr]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=K0(n);n!==null;){if(l=n[gr])return l;n=K0(n)}return i}n=l,l=n.parentNode}return null}function ia(n){return n=n[gr]||n[Pr],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function Fi(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(r(33))}function Ll(n){return n[sa]||null}var od=[],zi=-1;function cs(n){return{current:n}}function dt(n){0>zi||(n.current=od[zi],od[zi]=null,zi--)}function ut(n,i){zi++,od[zi]=n.current,n.current=i}var ds={},Ht=cs(ds),nn=cs(!1),Us=ds;function Bi(n,i){var l=n.type.contextTypes;if(!l)return ds;var h=n.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===i)return h.__reactInternalMemoizedMaskedChildContext;var v={},x;for(x in l)v[x]=i[x];return h&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=v),v}function rn(n){return n=n.childContextTypes,n!=null}function $l(){dt(nn),dt(Ht)}function X0(n,i,l){if(Ht.current!==ds)throw Error(r(168));ut(Ht,i),ut(nn,l)}function Q0(n,i,l){var h=n.stateNode;if(i=i.childContextTypes,typeof h.getChildContext!="function")return l;h=h.getChildContext();for(var v in h)if(!(v in i))throw Error(r(108,oe(n)||"Unknown",v));return H({},l,h)}function ql(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||ds,Us=Ht.current,ut(Ht,n),ut(nn,nn.current),!0}function Z0(n,i,l){var h=n.stateNode;if(!h)throw Error(r(169));l?(n=Q0(n,i,Us),h.__reactInternalMemoizedMergedChildContext=n,dt(nn),dt(Ht),ut(Ht,n)):dt(nn),ut(nn,l)}var Lr=null,Dl=!1,ad=!1;function J0(n){Lr===null?Lr=[n]:Lr.push(n)}function OR(n){Dl=!0,J0(n)}function fs(){if(!ad&&Lr!==null){ad=!0;var n=0,i=Je;try{var l=Lr;for(Je=1;n<l.length;n++){var h=l[n];do h=h(!0);while(h!==null)}Lr=null,Dl=!1}catch(v){throw Lr!==null&&(Lr=Lr.slice(n+1)),_i(Is,fs),v}finally{Je=i,ad=!1}}return null}var Ui=[],Hi=0,Fl=null,zl=0,Rn=[],An=0,Hs=null,$r=1,qr="";function Ws(n,i){Ui[Hi++]=zl,Ui[Hi++]=Fl,Fl=n,zl=i}function ew(n,i,l){Rn[An++]=$r,Rn[An++]=qr,Rn[An++]=Hs,Hs=n;var h=$r;n=qr;var v=32-tn(h)-1;h&=~(1<<v),l+=1;var x=32-tn(i)+v;if(30<x){var R=v-v%5;x=(h&(1<<R)-1).toString(32),h>>=R,v-=R,$r=1<<32-tn(i)+v|l<<v|h,qr=x+n}else $r=1<<x|l<<v|h,qr=n}function ld(n){n.return!==null&&(Ws(n,1),ew(n,1,0))}function ud(n){for(;n===Fl;)Fl=Ui[--Hi],Ui[Hi]=null,zl=Ui[--Hi],Ui[Hi]=null;for(;n===Hs;)Hs=Rn[--An],Rn[An]=null,qr=Rn[--An],Rn[An]=null,$r=Rn[--An],Rn[An]=null}var pn=null,mn=null,pt=!1,Xn=null;function tw(n,i){var l=Pn(5,null,null,0);l.elementType="DELETED",l.stateNode=i,l.return=n,i=n.deletions,i===null?(n.deletions=[l],n.flags|=16):i.push(l)}function nw(n,i){switch(n.tag){case 5:var l=n.type;return i=i.nodeType!==1||l.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(n.stateNode=i,pn=n,mn=us(i.firstChild),!0):!1;case 6:return i=n.pendingProps===""||i.nodeType!==3?null:i,i!==null?(n.stateNode=i,pn=n,mn=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=Hs!==null?{id:$r,overflow:qr}:null,n.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=Pn(18,null,null,0),l.stateNode=i,l.return=n,n.child=l,pn=n,mn=null,!0):!1;default:return!1}}function cd(n){return(n.mode&1)!==0&&(n.flags&128)===0}function dd(n){if(pt){var i=mn;if(i){var l=i;if(!nw(n,i)){if(cd(n))throw Error(r(418));i=us(l.nextSibling);var h=pn;i&&nw(n,i)?tw(h,l):(n.flags=n.flags&-4097|2,pt=!1,pn=n)}}else{if(cd(n))throw Error(r(418));n.flags=n.flags&-4097|2,pt=!1,pn=n}}}function rw(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;pn=n}function Bl(n){if(n!==pn)return!1;if(!pt)return rw(n),pt=!0,!1;var i;if((i=n.tag!==3)&&!(i=n.tag!==5)&&(i=n.type,i=i!=="head"&&i!=="body"&&!nd(n.type,n.memoizedProps)),i&&(i=mn)){if(cd(n))throw sw(),Error(r(418));for(;i;)tw(n,i),i=us(i.nextSibling)}if(rw(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));e:{for(n=n.nextSibling,i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"){if(i===0){mn=us(n.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}n=n.nextSibling}mn=null}}else mn=pn?us(n.stateNode.nextSibling):null;return!0}function sw(){for(var n=mn;n;)n=us(n.nextSibling)}function Wi(){mn=pn=null,pt=!1}function fd(n){Xn===null?Xn=[n]:Xn.push(n)}var PR=T.ReactCurrentBatchConfig;function oa(n,i,l){if(n=l.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(r(309));var h=l.stateNode}if(!h)throw Error(r(147,n));var v=h,x=""+n;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===x?i.ref:(i=function(R){var D=v.refs;R===null?delete D[x]:D[x]=R},i._stringRef=x,i)}if(typeof n!="string")throw Error(r(284));if(!l._owner)throw Error(r(290,n))}return n}function Ul(n,i){throw n=Object.prototype.toString.call(i),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n))}function iw(n){var i=n._init;return i(n._payload)}function ow(n){function i(re,J){if(n){var se=re.deletions;se===null?(re.deletions=[J],re.flags|=16):se.push(J)}}function l(re,J){if(!n)return null;for(;J!==null;)i(re,J),J=J.sibling;return null}function h(re,J){for(re=new Map;J!==null;)J.key!==null?re.set(J.key,J):re.set(J.index,J),J=J.sibling;return re}function v(re,J){return re=xs(re,J),re.index=0,re.sibling=null,re}function x(re,J,se){return re.index=se,n?(se=re.alternate,se!==null?(se=se.index,se<J?(re.flags|=2,J):se):(re.flags|=2,J)):(re.flags|=1048576,J)}function R(re){return n&&re.alternate===null&&(re.flags|=2),re}function D(re,J,se,ve){return J===null||J.tag!==6?(J=rf(se,re.mode,ve),J.return=re,J):(J=v(J,se),J.return=re,J)}function K(re,J,se,ve){var Te=se.type;return Te===P?me(re,J,se.props.children,ve,se.key):J!==null&&(J.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===B&&iw(Te)===J.type)?(ve=v(J,se.props),ve.ref=oa(re,J,se),ve.return=re,ve):(ve=hu(se.type,se.key,se.props,null,re.mode,ve),ve.ref=oa(re,J,se),ve.return=re,ve)}function ie(re,J,se,ve){return J===null||J.tag!==4||J.stateNode.containerInfo!==se.containerInfo||J.stateNode.implementation!==se.implementation?(J=sf(se,re.mode,ve),J.return=re,J):(J=v(J,se.children||[]),J.return=re,J)}function me(re,J,se,ve,Te){return J===null||J.tag!==7?(J=Js(se,re.mode,ve,Te),J.return=re,J):(J=v(J,se),J.return=re,J)}function ge(re,J,se){if(typeof J=="string"&&J!==""||typeof J=="number")return J=rf(""+J,re.mode,se),J.return=re,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case A:return se=hu(J.type,J.key,J.props,null,re.mode,se),se.ref=oa(re,null,J),se.return=re,se;case L:return J=sf(J,re.mode,se),J.return=re,J;case B:var ve=J._init;return ge(re,ve(J._payload),se)}if(gt(J)||$(J))return J=Js(J,re.mode,se,null),J.return=re,J;Ul(re,J)}return null}function he(re,J,se,ve){var Te=J!==null?J.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return Te!==null?null:D(re,J,""+se,ve);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case A:return se.key===Te?K(re,J,se,ve):null;case L:return se.key===Te?ie(re,J,se,ve):null;case B:return Te=se._init,he(re,J,Te(se._payload),ve)}if(gt(se)||$(se))return Te!==null?null:me(re,J,se,ve,null);Ul(re,se)}return null}function be(re,J,se,ve,Te){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return re=re.get(se)||null,D(J,re,""+ve,Te);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case A:return re=re.get(ve.key===null?se:ve.key)||null,K(J,re,ve,Te);case L:return re=re.get(ve.key===null?se:ve.key)||null,ie(J,re,ve,Te);case B:var Oe=ve._init;return be(re,J,se,Oe(ve._payload),Te)}if(gt(ve)||$(ve))return re=re.get(se)||null,me(J,re,ve,Te,null);Ul(J,ve)}return null}function Ne(re,J,se,ve){for(var Te=null,Oe=null,Pe=J,qe=J=0,$t=null;Pe!==null&&qe<se.length;qe++){Pe.index>qe?($t=Pe,Pe=null):$t=Pe.sibling;var Ze=he(re,Pe,se[qe],ve);if(Ze===null){Pe===null&&(Pe=$t);break}n&&Pe&&Ze.alternate===null&&i(re,Pe),J=x(Ze,J,qe),Oe===null?Te=Ze:Oe.sibling=Ze,Oe=Ze,Pe=$t}if(qe===se.length)return l(re,Pe),pt&&Ws(re,qe),Te;if(Pe===null){for(;qe<se.length;qe++)Pe=ge(re,se[qe],ve),Pe!==null&&(J=x(Pe,J,qe),Oe===null?Te=Pe:Oe.sibling=Pe,Oe=Pe);return pt&&Ws(re,qe),Te}for(Pe=h(re,Pe);qe<se.length;qe++)$t=be(Pe,re,qe,se[qe],ve),$t!==null&&(n&&$t.alternate!==null&&Pe.delete($t.key===null?qe:$t.key),J=x($t,J,qe),Oe===null?Te=$t:Oe.sibling=$t,Oe=$t);return n&&Pe.forEach(function(_s){return i(re,_s)}),pt&&Ws(re,qe),Te}function je(re,J,se,ve){var Te=$(se);if(typeof Te!="function")throw Error(r(150));if(se=Te.call(se),se==null)throw Error(r(151));for(var Oe=Te=null,Pe=J,qe=J=0,$t=null,Ze=se.next();Pe!==null&&!Ze.done;qe++,Ze=se.next()){Pe.index>qe?($t=Pe,Pe=null):$t=Pe.sibling;var _s=he(re,Pe,Ze.value,ve);if(_s===null){Pe===null&&(Pe=$t);break}n&&Pe&&_s.alternate===null&&i(re,Pe),J=x(_s,J,qe),Oe===null?Te=_s:Oe.sibling=_s,Oe=_s,Pe=$t}if(Ze.done)return l(re,Pe),pt&&Ws(re,qe),Te;if(Pe===null){for(;!Ze.done;qe++,Ze=se.next())Ze=ge(re,Ze.value,ve),Ze!==null&&(J=x(Ze,J,qe),Oe===null?Te=Ze:Oe.sibling=Ze,Oe=Ze);return pt&&Ws(re,qe),Te}for(Pe=h(re,Pe);!Ze.done;qe++,Ze=se.next())Ze=be(Pe,re,qe,Ze.value,ve),Ze!==null&&(n&&Ze.alternate!==null&&Pe.delete(Ze.key===null?qe:Ze.key),J=x(Ze,J,qe),Oe===null?Te=Ze:Oe.sibling=Ze,Oe=Ze);return n&&Pe.forEach(function(pA){return i(re,pA)}),pt&&Ws(re,qe),Te}function St(re,J,se,ve){if(typeof se=="object"&&se!==null&&se.type===P&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case A:e:{for(var Te=se.key,Oe=J;Oe!==null;){if(Oe.key===Te){if(Te=se.type,Te===P){if(Oe.tag===7){l(re,Oe.sibling),J=v(Oe,se.props.children),J.return=re,re=J;break e}}else if(Oe.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===B&&iw(Te)===Oe.type){l(re,Oe.sibling),J=v(Oe,se.props),J.ref=oa(re,Oe,se),J.return=re,re=J;break e}l(re,Oe);break}else i(re,Oe);Oe=Oe.sibling}se.type===P?(J=Js(se.props.children,re.mode,ve,se.key),J.return=re,re=J):(ve=hu(se.type,se.key,se.props,null,re.mode,ve),ve.ref=oa(re,J,se),ve.return=re,re=ve)}return R(re);case L:e:{for(Oe=se.key;J!==null;){if(J.key===Oe)if(J.tag===4&&J.stateNode.containerInfo===se.containerInfo&&J.stateNode.implementation===se.implementation){l(re,J.sibling),J=v(J,se.children||[]),J.return=re,re=J;break e}else{l(re,J);break}else i(re,J);J=J.sibling}J=sf(se,re.mode,ve),J.return=re,re=J}return R(re);case B:return Oe=se._init,St(re,J,Oe(se._payload),ve)}if(gt(se))return Ne(re,J,se,ve);if($(se))return je(re,J,se,ve);Ul(re,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,J!==null&&J.tag===6?(l(re,J.sibling),J=v(J,se),J.return=re,re=J):(l(re,J),J=rf(se,re.mode,ve),J.return=re,re=J),R(re)):l(re,J)}return St}var Vi=ow(!0),aw=ow(!1),Hl=cs(null),Wl=null,Gi=null,hd=null;function pd(){hd=Gi=Wl=null}function md(n){var i=Hl.current;dt(Hl),n._currentValue=i}function gd(n,i,l){for(;n!==null;){var h=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),n===l)break;n=n.return}}function Yi(n,i){Wl=n,hd=Gi=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&i)!==0&&(sn=!0),n.firstContext=null)}function In(n){var i=n._currentValue;if(hd!==n)if(n={context:n,memoizedValue:i,next:null},Gi===null){if(Wl===null)throw Error(r(308));Gi=n,Wl.dependencies={lanes:0,firstContext:n}}else Gi=Gi.next=n;return i}var Vs=null;function vd(n){Vs===null?Vs=[n]:Vs.push(n)}function lw(n,i,l,h){var v=i.interleaved;return v===null?(l.next=l,vd(i)):(l.next=v.next,v.next=l),i.interleaved=l,Dr(n,h)}function Dr(n,i){n.lanes|=i;var l=n.alternate;for(l!==null&&(l.lanes|=i),l=n,n=n.return;n!==null;)n.childLanes|=i,l=n.alternate,l!==null&&(l.childLanes|=i),l=n,n=n.return;return l.tag===3?l.stateNode:null}var hs=!1;function yd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uw(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Fr(n,i){return{eventTime:n,lane:i,tag:0,payload:null,callback:null,next:null}}function ps(n,i,l){var h=n.updateQueue;if(h===null)return null;if(h=h.shared,(Qe&2)!==0){var v=h.pending;return v===null?i.next=i:(i.next=v.next,v.next=i),h.pending=i,Dr(n,l)}return v=h.interleaved,v===null?(i.next=i,vd(h)):(i.next=v.next,v.next=i),h.interleaved=i,Dr(n,l)}function Vl(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var h=i.lanes;h&=n.pendingLanes,l|=h,i.lanes=l,Mo(n,l)}}function cw(n,i){var l=n.updateQueue,h=n.alternate;if(h!==null&&(h=h.updateQueue,l===h)){var v=null,x=null;if(l=l.firstBaseUpdate,l!==null){do{var R={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};x===null?v=x=R:x=x.next=R,l=l.next}while(l!==null);x===null?v=x=i:x=x.next=i}else v=x=i;l={baseState:h.baseState,firstBaseUpdate:v,lastBaseUpdate:x,shared:h.shared,effects:h.effects},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}function Gl(n,i,l,h){var v=n.updateQueue;hs=!1;var x=v.firstBaseUpdate,R=v.lastBaseUpdate,D=v.shared.pending;if(D!==null){v.shared.pending=null;var K=D,ie=K.next;K.next=null,R===null?x=ie:R.next=ie,R=K;var me=n.alternate;me!==null&&(me=me.updateQueue,D=me.lastBaseUpdate,D!==R&&(D===null?me.firstBaseUpdate=ie:D.next=ie,me.lastBaseUpdate=K))}if(x!==null){var ge=v.baseState;R=0,me=ie=K=null,D=x;do{var he=D.lane,be=D.eventTime;if((h&he)===he){me!==null&&(me=me.next={eventTime:be,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Ne=n,je=D;switch(he=i,be=l,je.tag){case 1:if(Ne=je.payload,typeof Ne=="function"){ge=Ne.call(be,ge,he);break e}ge=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=je.payload,he=typeof Ne=="function"?Ne.call(be,ge,he):Ne,he==null)break e;ge=H({},ge,he);break e;case 2:hs=!0}}D.callback!==null&&D.lane!==0&&(n.flags|=64,he=v.effects,he===null?v.effects=[D]:he.push(D))}else be={eventTime:be,lane:he,tag:D.tag,payload:D.payload,callback:D.callback,next:null},me===null?(ie=me=be,K=ge):me=me.next=be,R|=he;if(D=D.next,D===null){if(D=v.shared.pending,D===null)break;he=D,D=he.next,he.next=null,v.lastBaseUpdate=he,v.shared.pending=null}}while(!0);if(me===null&&(K=ge),v.baseState=K,v.firstBaseUpdate=ie,v.lastBaseUpdate=me,i=v.shared.interleaved,i!==null){v=i;do R|=v.lane,v=v.next;while(v!==i)}else x===null&&(v.shared.lanes=0);Ks|=R,n.lanes=R,n.memoizedState=ge}}function dw(n,i,l){if(n=i.effects,i.effects=null,n!==null)for(i=0;i<n.length;i++){var h=n[i],v=h.callback;if(v!==null){if(h.callback=null,h=l,typeof v!="function")throw Error(r(191,v));v.call(h)}}}var aa={},vr=cs(aa),la=cs(aa),ua=cs(aa);function Gs(n){if(n===aa)throw Error(r(174));return n}function wd(n,i){switch(ut(ua,i),ut(la,n),ut(vr,aa),n=i.nodeType,n){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:ee(null,"");break;default:n=n===8?i.parentNode:i,i=n.namespaceURI||null,n=n.tagName,i=ee(i,n)}dt(vr),ut(vr,i)}function Ki(){dt(vr),dt(la),dt(ua)}function fw(n){Gs(ua.current);var i=Gs(vr.current),l=ee(i,n.type);i!==l&&(ut(la,n),ut(vr,l))}function xd(n){la.current===n&&(dt(vr),dt(la))}var vt=cs(0);function Yl(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var _d=[];function bd(){for(var n=0;n<_d.length;n++)_d[n]._workInProgressVersionPrimary=null;_d.length=0}var Kl=T.ReactCurrentDispatcher,kd=T.ReactCurrentBatchConfig,Ys=0,yt=null,Tt=null,Pt=null,Xl=!1,ca=!1,da=0,LR=0;function Wt(){throw Error(r(321))}function Sd(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!nt(n[l],i[l]))return!1;return!0}function Ed(n,i,l,h,v,x){if(Ys=x,yt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Kl.current=n===null||n.memoizedState===null?FR:zR,n=l(h,v),ca){x=0;do{if(ca=!1,da=0,25<=x)throw Error(r(301));x+=1,Pt=Tt=null,i.updateQueue=null,Kl.current=BR,n=l(h,v)}while(ca)}if(Kl.current=Jl,i=Tt!==null&&Tt.next!==null,Ys=0,Pt=Tt=yt=null,Xl=!1,i)throw Error(r(300));return n}function Nd(){var n=da!==0;return da=0,n}function yr(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?yt.memoizedState=Pt=n:Pt=Pt.next=n,Pt}function Mn(){if(Tt===null){var n=yt.alternate;n=n!==null?n.memoizedState:null}else n=Tt.next;var i=Pt===null?yt.memoizedState:Pt.next;if(i!==null)Pt=i,Tt=n;else{if(n===null)throw Error(r(310));Tt=n,n={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Pt===null?yt.memoizedState=Pt=n:Pt=Pt.next=n}return Pt}function fa(n,i){return typeof i=="function"?i(n):i}function Cd(n){var i=Mn(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var h=Tt,v=h.baseQueue,x=l.pending;if(x!==null){if(v!==null){var R=v.next;v.next=x.next,x.next=R}h.baseQueue=v=x,l.pending=null}if(v!==null){x=v.next,h=h.baseState;var D=R=null,K=null,ie=x;do{var me=ie.lane;if((Ys&me)===me)K!==null&&(K=K.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),h=ie.hasEagerState?ie.eagerState:n(h,ie.action);else{var ge={lane:me,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};K===null?(D=K=ge,R=h):K=K.next=ge,yt.lanes|=me,Ks|=me}ie=ie.next}while(ie!==null&&ie!==x);K===null?R=h:K.next=D,nt(h,i.memoizedState)||(sn=!0),i.memoizedState=h,i.baseState=R,i.baseQueue=K,l.lastRenderedState=h}if(n=l.interleaved,n!==null){v=n;do x=v.lane,yt.lanes|=x,Ks|=x,v=v.next;while(v!==n)}else v===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function jd(n){var i=Mn(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var h=l.dispatch,v=l.pending,x=i.memoizedState;if(v!==null){l.pending=null;var R=v=v.next;do x=n(x,R.action),R=R.next;while(R!==v);nt(x,i.memoizedState)||(sn=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),l.lastRenderedState=x}return[x,h]}function hw(){}function pw(n,i){var l=yt,h=Mn(),v=i(),x=!nt(h.memoizedState,v);if(x&&(h.memoizedState=v,sn=!0),h=h.queue,Td(vw.bind(null,l,h,n),[n]),h.getSnapshot!==i||x||Pt!==null&&Pt.memoizedState.tag&1){if(l.flags|=2048,ha(9,gw.bind(null,l,h,v,i),void 0,null),Lt===null)throw Error(r(349));(Ys&30)!==0||mw(l,i,v)}return v}function mw(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=yt.updateQueue,i===null?(i={lastEffect:null,stores:null},yt.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function gw(n,i,l,h){i.value=l,i.getSnapshot=h,yw(i)&&ww(n)}function vw(n,i,l){return l(function(){yw(i)&&ww(n)})}function yw(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!nt(n,l)}catch{return!0}}function ww(n){var i=Dr(n,1);i!==null&&er(i,n,1,-1)}function xw(n){var i=yr();return typeof n=="function"&&(n=n()),i.memoizedState=i.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fa,lastRenderedState:n},i.queue=n,n=n.dispatch=DR.bind(null,yt,n),[i.memoizedState,n]}function ha(n,i,l,h){return n={tag:n,create:i,destroy:l,deps:h,next:null},i=yt.updateQueue,i===null?(i={lastEffect:null,stores:null},yt.updateQueue=i,i.lastEffect=n.next=n):(l=i.lastEffect,l===null?i.lastEffect=n.next=n:(h=l.next,l.next=n,n.next=h,i.lastEffect=n)),n}function _w(){return Mn().memoizedState}function Ql(n,i,l,h){var v=yr();yt.flags|=n,v.memoizedState=ha(1|i,l,void 0,h===void 0?null:h)}function Zl(n,i,l,h){var v=Mn();h=h===void 0?null:h;var x=void 0;if(Tt!==null){var R=Tt.memoizedState;if(x=R.destroy,h!==null&&Sd(h,R.deps)){v.memoizedState=ha(i,l,x,h);return}}yt.flags|=n,v.memoizedState=ha(1|i,l,x,h)}function bw(n,i){return Ql(8390656,8,n,i)}function Td(n,i){return Zl(2048,8,n,i)}function kw(n,i){return Zl(4,2,n,i)}function Sw(n,i){return Zl(4,4,n,i)}function Ew(n,i){if(typeof i=="function")return n=n(),i(n),function(){i(null)};if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Nw(n,i,l){return l=l!=null?l.concat([n]):null,Zl(4,4,Ew.bind(null,i,n),l)}function Rd(){}function Cw(n,i){var l=Mn();i=i===void 0?null:i;var h=l.memoizedState;return h!==null&&i!==null&&Sd(i,h[1])?h[0]:(l.memoizedState=[n,i],n)}function jw(n,i){var l=Mn();i=i===void 0?null:i;var h=l.memoizedState;return h!==null&&i!==null&&Sd(i,h[1])?h[0]:(n=n(),l.memoizedState=[n,i],n)}function Tw(n,i,l){return(Ys&21)===0?(n.baseState&&(n.baseState=!1,sn=!0),n.memoizedState=l):(nt(l,i)||(l=Io(),yt.lanes|=l,Ks|=l,n.baseState=!0),i)}function $R(n,i){var l=Je;Je=l!==0&&4>l?l:4,n(!0);var h=kd.transition;kd.transition={};try{n(!1),i()}finally{Je=l,kd.transition=h}}function Rw(){return Mn().memoizedState}function qR(n,i,l){var h=ys(n);if(l={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null},Aw(n))Iw(i,l);else if(l=lw(n,i,l,h),l!==null){var v=en();er(l,n,h,v),Mw(l,i,h)}}function DR(n,i,l){var h=ys(n),v={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null};if(Aw(n))Iw(i,v);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var R=i.lastRenderedState,D=x(R,l);if(v.hasEagerState=!0,v.eagerState=D,nt(D,R)){var K=i.interleaved;K===null?(v.next=v,vd(i)):(v.next=K.next,K.next=v),i.interleaved=v;return}}catch{}finally{}l=lw(n,i,v,h),l!==null&&(v=en(),er(l,n,h,v),Mw(l,i,h))}}function Aw(n){var i=n.alternate;return n===yt||i!==null&&i===yt}function Iw(n,i){ca=Xl=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function Mw(n,i,l){if((l&4194240)!==0){var h=i.lanes;h&=n.pendingLanes,l|=h,i.lanes=l,Mo(n,l)}}var Jl={readContext:In,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},FR={readContext:In,useCallback:function(n,i){return yr().memoizedState=[n,i===void 0?null:i],n},useContext:In,useEffect:bw,useImperativeHandle:function(n,i,l){return l=l!=null?l.concat([n]):null,Ql(4194308,4,Ew.bind(null,i,n),l)},useLayoutEffect:function(n,i){return Ql(4194308,4,n,i)},useInsertionEffect:function(n,i){return Ql(4,2,n,i)},useMemo:function(n,i){var l=yr();return i=i===void 0?null:i,n=n(),l.memoizedState=[n,i],n},useReducer:function(n,i,l){var h=yr();return i=l!==void 0?l(i):i,h.memoizedState=h.baseState=i,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:i},h.queue=n,n=n.dispatch=qR.bind(null,yt,n),[h.memoizedState,n]},useRef:function(n){var i=yr();return n={current:n},i.memoizedState=n},useState:xw,useDebugValue:Rd,useDeferredValue:function(n){return yr().memoizedState=n},useTransition:function(){var n=xw(!1),i=n[0];return n=$R.bind(null,n[1]),yr().memoizedState=n,[i,n]},useMutableSource:function(){},useSyncExternalStore:function(n,i,l){var h=yt,v=yr();if(pt){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),Lt===null)throw Error(r(349));(Ys&30)!==0||mw(h,i,l)}v.memoizedState=l;var x={value:l,getSnapshot:i};return v.queue=x,bw(vw.bind(null,h,x,n),[n]),h.flags|=2048,ha(9,gw.bind(null,h,x,l,i),void 0,null),l},useId:function(){var n=yr(),i=Lt.identifierPrefix;if(pt){var l=qr,h=$r;l=(h&~(1<<32-tn(h)-1)).toString(32)+l,i=":"+i+"R"+l,l=da++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=LR++,i=":"+i+"r"+l.toString(32)+":";return n.memoizedState=i},unstable_isNewReconciler:!1},zR={readContext:In,useCallback:Cw,useContext:In,useEffect:Td,useImperativeHandle:Nw,useInsertionEffect:kw,useLayoutEffect:Sw,useMemo:jw,useReducer:Cd,useRef:_w,useState:function(){return Cd(fa)},useDebugValue:Rd,useDeferredValue:function(n){var i=Mn();return Tw(i,Tt.memoizedState,n)},useTransition:function(){var n=Cd(fa)[0],i=Mn().memoizedState;return[n,i]},useMutableSource:hw,useSyncExternalStore:pw,useId:Rw,unstable_isNewReconciler:!1},BR={readContext:In,useCallback:Cw,useContext:In,useEffect:Td,useImperativeHandle:Nw,useInsertionEffect:kw,useLayoutEffect:Sw,useMemo:jw,useReducer:jd,useRef:_w,useState:function(){return jd(fa)},useDebugValue:Rd,useDeferredValue:function(n){var i=Mn();return Tt===null?i.memoizedState=n:Tw(i,Tt.memoizedState,n)},useTransition:function(){var n=jd(fa)[0],i=Mn().memoizedState;return[n,i]},useMutableSource:hw,useSyncExternalStore:pw,useId:Rw,unstable_isNewReconciler:!1};function Qn(n,i){if(n&&n.defaultProps){i=H({},i),n=n.defaultProps;for(var l in n)i[l]===void 0&&(i[l]=n[l]);return i}return i}function Ad(n,i,l,h){i=n.memoizedState,l=l(h,i),l=l==null?i:H({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var eu={isMounted:function(n){return(n=n._reactInternals)?kn(n)===n:!1},enqueueSetState:function(n,i,l){n=n._reactInternals;var h=en(),v=ys(n),x=Fr(h,v);x.payload=i,l!=null&&(x.callback=l),i=ps(n,x,v),i!==null&&(er(i,n,v,h),Vl(i,n,v))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var h=en(),v=ys(n),x=Fr(h,v);x.tag=1,x.payload=i,l!=null&&(x.callback=l),i=ps(n,x,v),i!==null&&(er(i,n,v,h),Vl(i,n,v))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=en(),h=ys(n),v=Fr(l,h);v.tag=2,i!=null&&(v.callback=i),i=ps(n,v,h),i!==null&&(er(i,n,h,l),Vl(i,n,h))}};function Ow(n,i,l,h,v,x,R){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(h,x,R):i.prototype&&i.prototype.isPureReactComponent?!as(l,h)||!as(v,x):!0}function Pw(n,i,l){var h=!1,v=ds,x=i.contextType;return typeof x=="object"&&x!==null?x=In(x):(v=rn(i)?Us:Ht.current,h=i.contextTypes,x=(h=h!=null)?Bi(n,v):ds),i=new i(l,x),n.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=eu,n.stateNode=i,i._reactInternals=n,h&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=v,n.__reactInternalMemoizedMaskedChildContext=x),i}function Lw(n,i,l,h){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,h),i.state!==n&&eu.enqueueReplaceState(i,i.state,null)}function Id(n,i,l,h){var v=n.stateNode;v.props=l,v.state=n.memoizedState,v.refs={},yd(n);var x=i.contextType;typeof x=="object"&&x!==null?v.context=In(x):(x=rn(i)?Us:Ht.current,v.context=Bi(n,x)),v.state=n.memoizedState,x=i.getDerivedStateFromProps,typeof x=="function"&&(Ad(n,i,x,l),v.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(i=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),i!==v.state&&eu.enqueueReplaceState(v,v.state,null),Gl(n,l,v,h),v.state=n.memoizedState),typeof v.componentDidMount=="function"&&(n.flags|=4194308)}function Xi(n,i){try{var l="",h=i;do l+=Q(h),h=h.return;while(h);var v=l}catch(x){v=`
|
|
37
|
+
`+v[R].replace(" at new "," at ");return n.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",n.displayName)),K}while(1<=R&&0<=D);break}}}finally{ce=!1,Error.prepareStackTrace=l}return(n=n?n.displayName||n.name:"")?Y(n):""}function Q(n){switch(n.tag){case 5:return Y(n.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return n=z(n.type,!1),n;case 11:return n=z(n.type.render,!1),n;case 1:return n=z(n.type,!0),n;default:return""}}function ne(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case P:return"Fragment";case L:return"Portal";case O:return"Profiler";case U:return"StrictMode";case X:return"Suspense";case j:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case q:return(n.displayName||"Context")+".Consumer";case M:return(n._context.displayName||"Context")+".Provider";case V:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case G:return i=n.displayName||null,i!==null?i:ne(n.type)||"Memo";case B:i=n._payload,n=n._init;try{return ne(n(i))}catch{}}return null}function ae(n){var i=n.type;switch(n.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=i.render,n=n.displayName||n.name||"",i.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ne(i);case 8:return i===U?"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 i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function fe(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function pe(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ye(n){var i=pe(n)?"checked":"value",l=Object.getOwnPropertyDescriptor(n.constructor.prototype,i),h=""+n[i];if(!n.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var v=l.get,x=l.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return v.call(this)},set:function(R){h=""+R,x.call(this,R)}}),Object.defineProperty(n,i,{enumerable:l.enumerable}),{getValue:function(){return h},setValue:function(R){h=""+R},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function Me(n){n._valueTracker||(n._valueTracker=ye(n))}function Ue(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),h="";return n&&(h=pe(n)?n.checked?"true":"false":n.value),n=h,n!==l?(i.setValue(n),!0):!1}function ze(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Ie(n,i){var l=i.checked;return H({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??n._wrapperState.initialChecked})}function ke(n,i){var l=i.defaultValue==null?"":i.defaultValue,h=i.checked!=null?i.checked:i.defaultChecked;l=fe(i.value!=null?i.value:l),n._wrapperState={initialChecked:h,initialValue:l,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function le(n,i){i=i.checked,i!=null&&C(n,"checked",i,!1)}function we(n,i){le(n,i);var l=fe(i.value),h=i.type;if(l!=null)h==="number"?(l===0&&n.value===""||n.value!=l)&&(n.value=""+l):n.value!==""+l&&(n.value=""+l);else if(h==="submit"||h==="reset"){n.removeAttribute("value");return}i.hasOwnProperty("value")?Ye(n,i.type,l):i.hasOwnProperty("defaultValue")&&Ye(n,i.type,fe(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(n.defaultChecked=!!i.defaultChecked)}function xe(n,i,l){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var h=i.type;if(!(h!=="submit"&&h!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+n._wrapperState.initialValue,l||i===n.value||(n.value=i),n.defaultValue=i}l=n.name,l!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,l!==""&&(n.name=l)}function Ye(n,i,l){(i!=="number"||ze(n.ownerDocument)!==n)&&(l==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+l&&(n.defaultValue=""+l))}var gt=Array.isArray;function ft(n,i,l,h){if(n=n.options,i){i={};for(var v=0;v<l.length;v++)i["$"+l[v]]=!0;for(l=0;l<n.length;l++)v=i.hasOwnProperty("$"+n[l].value),n[l].selected!==v&&(n[l].selected=v),v&&h&&(n[l].defaultSelected=!0)}else{for(l=""+fe(l),i=null,v=0;v<n.length;v++){if(n[v].value===l){n[v].selected=!0,h&&(n[v].defaultSelected=!0);return}i!==null||n[v].disabled||(i=n[v])}i!==null&&(i.selected=!0)}}function ot(n,i){if(i.dangerouslySetInnerHTML!=null)throw Error(r(91));return H({},i,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function Be(n,i){var l=i.value;if(l==null){if(l=i.children,i=i.defaultValue,l!=null){if(i!=null)throw Error(r(92));if(gt(l)){if(1<l.length)throw Error(r(93));l=l[0]}i=l}i==null&&(i=""),l=i}n._wrapperState={initialValue:fe(l)}}function et(n,i){var l=fe(i.value),h=fe(i.defaultValue);l!=null&&(l=""+l,l!==n.value&&(n.value=l),i.defaultValue==null&&n.defaultValue!==l&&(n.defaultValue=l)),h!=null&&(n.defaultValue=""+h)}function Xe(n){var i=n.textContent;i===n._wrapperState.initialValue&&i!==""&&i!==null&&(n.value=i)}function wt(n){switch(n){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 ee(n,i){return n==null||n==="http://www.w3.org/1999/xhtml"?wt(i):n==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var Le,De=(function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,l,h,v){MSApp.execUnsafeLocalFunction(function(){return n(i,l,h,v)})}:n})(function(n,i){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=i;else{for(Le=Le||document.createElement("div"),Le.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=Le.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;i.firstChild;)n.appendChild(i.firstChild)}});function Re(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var $e={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},rt=["Webkit","ms","Moz","O"];Object.keys($e).forEach(function(n){rt.forEach(function(i){i=i+n.charAt(0).toUpperCase()+n.substring(1),$e[i]=$e[n]})});function tt(n,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||$e.hasOwnProperty(n)&&$e[n]?(""+i).trim():i+"px"}function Ce(n,i){n=n.style;for(var l in i)if(i.hasOwnProperty(l)){var h=l.indexOf("--")===0,v=tt(l,i[l],h);l==="float"&&(l="cssFloat"),h?n.setProperty(l,v):n[l]=v}}var kt=H({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 Ve(n,i){if(i){if(kt[n]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(r(137,n));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(r(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(r(61))}if(i.style!=null&&typeof i.style!="object")throw Error(r(62))}}function lt(n,i){if(n.indexOf("-")===-1)return typeof i.is=="string";switch(n){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 dn=null;function wn(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var xn=null,_n=null,zn=null;function bn(n){if(n=aa(n)){if(typeof xn!="function")throw Error(r(280));var i=n.stateNode;i&&(i=Ll(i),xn(n.stateNode,n.type,i))}}function hi(n){_n?zn?zn.push(n):zn=[n]:_n=n}function fn(){if(_n){var n=_n,i=zn;if(zn=_n=null,bn(n),i)for(n=0;n<i.length;n++)bn(i[n])}}function pi(n,i){return n(i)}function mi(){}var qt=!1;function Sr(n,i,l){if(qt)return n(i,l);qt=!0;try{return pi(n,i,l)}finally{qt=!1,(_n!==null||zn!==null)&&(mi(),fn())}}function Bn(n,i){var l=n.stateNode;if(l===null)return null;var h=Ll(l);if(h===null)return null;l=h[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(n=n.type,h=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!h;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var Rs=!1;if(c)try{var Er={};Object.defineProperty(Er,"passive",{get:function(){Rs=!0}}),window.addEventListener("test",Er,Er),window.removeEventListener("test",Er,Er)}catch{Rs=!1}function Ao(n,i,l,h,v,x,R,D,K){var oe=Array.prototype.slice.call(arguments,3);try{i.apply(l,oe)}catch(me){this.onError(me)}}var lr=!1,Nr=null,ur=!1,As=null,gi={onError:function(n){lr=!0,Nr=n}};function vi(n,i,l,h,v,x,R,D,K){lr=!1,Nr=null,Ao.apply(gi,arguments)}function yi(n,i,l,h,v,x,R,D,K){if(vi.apply(this,arguments),lr){if(lr){var oe=Nr;lr=!1,Nr=null}else throw Error(r(198));ur||(ur=!0,As=oe)}}function kn(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function cr(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function wi(n){if(kn(n)!==n)throw Error(r(188))}function xi(n){var i=n.alternate;if(!i){if(i=kn(n),i===null)throw Error(r(188));return i!==n?null:n}for(var l=n,h=i;;){var v=l.return;if(v===null)break;var x=v.alternate;if(x===null){if(h=v.return,h!==null){l=h;continue}break}if(v.child===x.child){for(x=v.child;x;){if(x===l)return wi(v),n;if(x===h)return wi(v),i;x=x.sibling}throw Error(r(188))}if(l.return!==h.return)l=v,h=x;else{for(var R=!1,D=v.child;D;){if(D===l){R=!0,l=v,h=x;break}if(D===h){R=!0,h=v,l=x;break}D=D.sibling}if(!R){for(D=x.child;D;){if(D===l){R=!0,l=x,h=v;break}if(D===h){R=!0,h=x,l=v;break}D=D.sibling}if(!R)throw Error(r(189))}}if(l.alternate!==h)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?n:i}function Bt(n){return n=xi(n),n!==null?Cr(n):null}function Cr(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var i=Cr(n);if(i!==null)return i;n=n.sibling}return null}var _i=t.unstable_scheduleCallback,Zr=t.unstable_cancelCallback,xt=t.unstable_shouldYield,Io=t.unstable_requestPaint,st=t.unstable_now,Mo=t.unstable_getCurrentPriorityLevel,Is=t.unstable_ImmediatePriority,Sn=t.unstable_UserBlockingPriority,Un=t.unstable_NormalPriority,bi=t.unstable_LowPriority,ki=t.unstable_IdlePriority,jr=null,Kt=null;function En(n){if(Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(jr,n,void 0,(n.current.flags&128)===128)}catch{}}var tn=Math.clz32?Math.clz32:cl,ul=Math.log,Si=Math.LN2;function cl(n){return n>>>=0,n===0?32:31-(ul(n)/Si|0)|0}var Ms=64,Mt=4194304;function dr(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function Tr(n,i){var l=n.pendingLanes;if(l===0)return 0;var h=0,v=n.suspendedLanes,x=n.pingedLanes,R=l&268435455;if(R!==0){var D=R&~v;D!==0?h=dr(D):(x&=R,x!==0&&(h=dr(x)))}else R=l&~v,R!==0?h=dr(R):x!==0&&(h=dr(x));if(h===0)return 0;if(i!==0&&i!==h&&(i&v)===0&&(v=h&-h,x=i&-i,v>=x||v===16&&(x&4194240)!==0))return i;if((h&4)!==0&&(h|=l&16),i=n.entangledLanes,i!==0)for(n=n.entanglements,i&=h;0<i;)l=31-tn(i),v=1<<l,h|=n[l],i&=~v;return h}function dl(n,i){switch(n){case 1:case 2:case 4:return i+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 i+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 $c(n,i){for(var l=n.suspendedLanes,h=n.pingedLanes,v=n.expirationTimes,x=n.pendingLanes;0<x;){var R=31-tn(x),D=1<<R,K=v[R];K===-1?((D&l)===0||(D&h)!==0)&&(v[R]=dl(D,i)):K<=i&&(n.expiredLanes|=D),x&=~D}}function Rr(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function Oo(){var n=Ms;return Ms<<=1,(Ms&4194240)===0&&(Ms=64),n}function Hn(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Os(n,i,l){n.pendingLanes|=i,i!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,i=31-tn(i),n[i]=l}function fl(n,i){var l=n.pendingLanes&~i;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=i,n.mutableReadLanes&=i,n.entangledLanes&=i,i=n.entanglements;var h=n.eventTimes;for(n=n.expirationTimes;0<l;){var v=31-tn(l),x=1<<v;i[v]=0,h[v]=-1,n[v]=-1,l&=~x}}function Po(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var h=31-tn(l),v=1<<h;v&i|n[h]&i&&(n[h]|=i),l&=~v}}var Je=0;function Lo(n){return n&=-n,1<n?4<n?(n&268435455)!==0?16:536870912:4:1}var hl,Wn,Jr,$o,Ei,Nn=!1,Ni=[],jt=null,Cn=null,jn=null,es=new Map,fr=new Map,Tn=[],pl="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 Ci(n,i){switch(n){case"focusin":case"focusout":jt=null;break;case"dragenter":case"dragleave":Cn=null;break;case"mouseover":case"mouseout":jn=null;break;case"pointerover":case"pointerout":es.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":fr.delete(i.pointerId)}}function ts(n,i,l,h,v,x){return n===null||n.nativeEvent!==x?(n={blockedOn:i,domEventName:l,eventSystemFlags:h,nativeEvent:x,targetContainers:[v]},i!==null&&(i=aa(i),i!==null&&Wn(i)),n):(n.eventSystemFlags|=h,i=n.targetContainers,v!==null&&i.indexOf(v)===-1&&i.push(v),n)}function qo(n,i,l,h,v){switch(i){case"focusin":return jt=ts(jt,n,i,l,h,v),!0;case"dragenter":return Cn=ts(Cn,n,i,l,h,v),!0;case"mouseover":return jn=ts(jn,n,i,l,h,v),!0;case"pointerover":var x=v.pointerId;return es.set(x,ts(es.get(x)||null,n,i,l,h,v)),!0;case"gotpointercapture":return x=v.pointerId,fr.set(x,ts(fr.get(x)||null,n,i,l,h,v)),!0}return!1}function Do(n){var i=Bs(n.target);if(i!==null){var l=kn(i);if(l!==null){if(i=l.tag,i===13){if(i=cr(l),i!==null){n.blockedOn=i,Ei(n.priority,function(){Jr(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Vn(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=zo(n.domEventName,n.eventSystemFlags,i[0],n.nativeEvent);if(l===null){l=n.nativeEvent;var h=new l.constructor(l.type,l);dn=h,l.target.dispatchEvent(h),dn=null}else return i=aa(l),i!==null&&Wn(i),n.blockedOn=l,!1;i.shift()}return!0}function Fo(n,i,l){Vn(n)&&l.delete(i)}function ml(){Nn=!1,jt!==null&&Vn(jt)&&(jt=null),Cn!==null&&Vn(Cn)&&(Cn=null),jn!==null&&Vn(jn)&&(jn=null),es.forEach(Fo),fr.forEach(Fo)}function Ar(n,i){n.blockedOn===i&&(n.blockedOn=null,Nn||(Nn=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,ml)))}function Ps(n){function i(v){return Ar(v,n)}if(0<Ni.length){Ar(Ni[0],n);for(var l=1;l<Ni.length;l++){var h=Ni[l];h.blockedOn===n&&(h.blockedOn=null)}}for(jt!==null&&Ar(jt,n),Cn!==null&&Ar(Cn,n),jn!==null&&Ar(jn,n),es.forEach(i),fr.forEach(i),l=0;l<Tn.length;l++)h=Tn[l],h.blockedOn===n&&(h.blockedOn=null);for(;0<Tn.length&&(l=Tn[0],l.blockedOn===null);)Do(l),l.blockedOn===null&&Tn.shift()}var hr=T.ReactCurrentBatchConfig,Gn=!0;function gl(n,i,l,h){var v=Je,x=hr.transition;hr.transition=null;try{Je=1,ji(n,i,l,h)}finally{Je=v,hr.transition=x}}function qc(n,i,l,h){var v=Je,x=hr.transition;hr.transition=null;try{Je=4,ji(n,i,l,h)}finally{Je=v,hr.transition=x}}function ji(n,i,l,h){if(Gn){var v=zo(n,i,l,h);if(v===null)Jc(n,i,h,Ls,l),Ci(n,h);else if(qo(v,n,i,l,h))h.stopPropagation();else if(Ci(n,h),i&4&&-1<pl.indexOf(n)){for(;v!==null;){var x=aa(v);if(x!==null&&hl(x),x=zo(n,i,l,h),x===null&&Jc(n,i,h,Ls,l),x===v)break;v=x}v!==null&&h.stopPropagation()}else Jc(n,i,h,null,l)}}var Ls=null;function zo(n,i,l,h){if(Ls=null,n=wn(h),n=Bs(n),n!==null)if(i=kn(n),i===null)n=null;else if(l=i.tag,l===13){if(n=cr(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null);return Ls=n,null}function Xt(n){switch(n){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(Mo()){case Is:return 1;case Sn:return 4;case Un:case bi:return 16;case ki:return 536870912;default:return 16}default:return 16}}var pr=null,$s=null,Yn=null;function ns(){if(Yn)return Yn;var n,i=$s,l=i.length,h,v="value"in pr?pr.value:pr.textContent,x=v.length;for(n=0;n<l&&i[n]===v[n];n++);var R=l-n;for(h=1;h<=R&&i[l-h]===v[x-h];h++);return Yn=v.slice(n,1<h?1-h:void 0)}function rs(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function ss(){return!0}function Bo(){return!1}function Ot(n){function i(l,h,v,x,R){this._reactName=l,this._targetInst=v,this.type=h,this.nativeEvent=x,this.target=R,this.currentTarget=null;for(var D in n)n.hasOwnProperty(D)&&(l=n[D],this[D]=l?l(x):x[D]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?ss:Bo,this.isPropagationStopped=Bo,this}return H(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ss)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ss)},persist:function(){},isPersistent:ss}),i}var Ir={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Uo=Ot(Ir),qs=H({},Ir,{view:0,detail:0}),vl=Ot(qs),Ho,Wo,Mr,hn=H({},qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ai,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Mr&&(Mr&&n.type==="mousemove"?(Ho=n.screenX-Mr.screenX,Wo=n.screenY-Mr.screenY):Wo=Ho=0,Mr=n),Ho)},movementY:function(n){return"movementY"in n?n.movementY:Wo}}),Ti=Ot(hn),yl=H({},hn,{dataTransfer:0}),Dc=Ot(yl),Fc=H({},qs,{relatedTarget:0}),Ri=Ot(Fc),wl=H({},Ir,{animationName:0,elapsedTime:0,pseudoElement:0}),mr=Ot(wl),zc=H({},Ir,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),xl=Ot(zc),Bc=H({},Ir,{data:0}),Ds=Ot(Bc),Uc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qt={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"},Vo={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _l(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=Vo[n])?!!i[n]:!1}function Ai(){return _l}var bl=H({},qs,{key:function(n){if(n.key){var i=Uc[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=rs(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?Qt[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ai,charCode:function(n){return n.type==="keypress"?rs(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?rs(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Go=Ot(bl),Ii=H({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mi=Ot(Ii),kl=H({},qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ai}),Oi=Ot(kl),Sl=H({},Ir,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yo=Ot(Sl),El=H({},hn,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),Ko=Ot(El),Kn=[9,13,27,32],Pi=c&&"CompositionEvent"in window,is=null;c&&"documentMode"in document&&(is=document.documentMode);var Hc=c&&"TextEvent"in window&&!is,Nl=c&&(!Pi||is&&8<is&&11>=is),Xo=" ",Zt=!1;function Qo(n,i){switch(n){case"keyup":return Kn.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zo(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Or=!1;function Cl(n,i){switch(n){case"compositionend":return Zo(i);case"keypress":return i.which!==32?null:(Zt=!0,Xo);case"textInput":return n=i.data,n===Xo&&Zt?null:n;default:return null}}function F(n,i){if(Or)return n==="compositionend"||!Pi&&Qo(n,i)?(n=ns(),Yn=$s=pr=null,Or=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Nl&&i.locale!=="ko"?null:i.data;default:return null}}var W={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 ie(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!W[n.type]:i==="textarea"}function de(n,i,l,h){hi(h),i=Ml(i,"onChange"),0<i.length&&(l=new Uo("onChange","change",null,l,h),n.push({event:l,listeners:i}))}var _e=null,Se=null;function Fe(n){W0(n,0)}function Ke(n){var i=Fi(n);if(Ue(i))return n}function ht(n,i){if(n==="change")return i}var at=!1;if(c){var Ut;if(c){var os="oninput"in document;if(!os){var Jo=document.createElement("div");Jo.setAttribute("oninput","return;"),os=typeof Jo.oninput=="function"}Ut=os}else Ut=!1;at=Ut&&(!document.documentMode||9<document.documentMode)}function jl(){_e&&(_e.detachEvent("onpropertychange",ea),Se=_e=null)}function ea(n){if(n.propertyName==="value"&&Ke(Se)){var i=[];de(i,Se,n,wn(n)),Sr(Fe,i)}}function Wc(n,i,l){n==="focusin"?(jl(),_e=i,Se=l,_e.attachEvent("onpropertychange",ea)):n==="focusout"&&jl()}function Tl(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Ke(Se)}function ta(n,i){if(n==="click")return Ke(i)}function Fs(n,i){if(n==="input"||n==="change")return Ke(i)}function zs(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var nt=typeof Object.is=="function"?Object.is:zs;function as(n,i){if(nt(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),h=Object.keys(i);if(l.length!==h.length)return!1;for(h=0;h<l.length;h++){var v=l[h];if(!f.call(i,v)||!nt(n[v],i[v]))return!1}return!0}function I0(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function M0(n,i){var l=I0(n);n=0;for(var h;l;){if(l.nodeType===3){if(h=n+l.textContent.length,n<=i&&h>=i)return{node:l,offset:i-n};n=h}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=I0(l)}}function O0(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?O0(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function P0(){for(var n=window,i=ze();i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=ze(n.document)}return i}function Vc(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}function bR(n){var i=P0(),l=n.focusedElem,h=n.selectionRange;if(i!==l&&l&&l.ownerDocument&&O0(l.ownerDocument.documentElement,l)){if(h!==null&&Vc(l)){if(i=h.start,n=h.end,n===void 0&&(n=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(n,l.value.length);else if(n=(i=l.ownerDocument||document)&&i.defaultView||window,n.getSelection){n=n.getSelection();var v=l.textContent.length,x=Math.min(h.start,v);h=h.end===void 0?x:Math.min(h.end,v),!n.extend&&x>h&&(v=h,h=x,x=v),v=M0(l,x);var R=M0(l,h);v&&R&&(n.rangeCount!==1||n.anchorNode!==v.node||n.anchorOffset!==v.offset||n.focusNode!==R.node||n.focusOffset!==R.offset)&&(i=i.createRange(),i.setStart(v.node,v.offset),n.removeAllRanges(),x>h?(n.addRange(i),n.extend(R.node,R.offset)):(i.setEnd(R.node,R.offset),n.addRange(i)))}}for(i=[],n=l;n=n.parentNode;)n.nodeType===1&&i.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<i.length;l++)n=i[l],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var kR=c&&"documentMode"in document&&11>=document.documentMode,Li=null,Gc=null,na=null,Yc=!1;function L0(n,i,l){var h=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Yc||Li==null||Li!==ze(h)||(h=Li,"selectionStart"in h&&Vc(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),na&&as(na,h)||(na=h,h=Ml(Gc,"onSelect"),0<h.length&&(i=new Uo("onSelect","select",null,i,l),n.push({event:i,listeners:h}),i.target=Li)))}function Rl(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var $i={animationend:Rl("Animation","AnimationEnd"),animationiteration:Rl("Animation","AnimationIteration"),animationstart:Rl("Animation","AnimationStart"),transitionend:Rl("Transition","TransitionEnd")},Kc={},$0={};c&&($0=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function Al(n){if(Kc[n])return Kc[n];if(!$i[n])return n;var i=$i[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in $0)return Kc[n]=i[l];return n}var q0=Al("animationend"),D0=Al("animationiteration"),F0=Al("animationstart"),z0=Al("transitionend"),B0=new Map,U0="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 ls(n,i){B0.set(n,i),a(i,[n])}for(var Xc=0;Xc<U0.length;Xc++){var Qc=U0[Xc],SR=Qc.toLowerCase(),ER=Qc[0].toUpperCase()+Qc.slice(1);ls(SR,"on"+ER)}ls(q0,"onAnimationEnd"),ls(D0,"onAnimationIteration"),ls(F0,"onAnimationStart"),ls("dblclick","onDoubleClick"),ls("focusin","onFocus"),ls("focusout","onBlur"),ls(z0,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ra="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(" "),NR=new Set("cancel close invalid load scroll toggle".split(" ").concat(ra));function H0(n,i,l){var h=n.type||"unknown-event";n.currentTarget=l,yi(h,i,void 0,n),n.currentTarget=null}function W0(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var h=n[l],v=h.event;h=h.listeners;e:{var x=void 0;if(i)for(var R=h.length-1;0<=R;R--){var D=h[R],K=D.instance,oe=D.currentTarget;if(D=D.listener,K!==x&&v.isPropagationStopped())break e;H0(v,D,oe),x=K}else for(R=0;R<h.length;R++){if(D=h[R],K=D.instance,oe=D.currentTarget,D=D.listener,K!==x&&v.isPropagationStopped())break e;H0(v,D,oe),x=K}}}if(ur)throw n=As,ur=!1,As=null,n}function ct(n,i){var l=i[id];l===void 0&&(l=i[id]=new Set);var h=n+"__bubble";l.has(h)||(V0(i,n,2,!1),l.add(h))}function Zc(n,i,l){var h=0;i&&(h|=4),V0(l,n,h,i)}var Il="_reactListening"+Math.random().toString(36).slice(2);function sa(n){if(!n[Il]){n[Il]=!0,s.forEach(function(l){l!=="selectionchange"&&(NR.has(l)||Zc(l,!1,n),Zc(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[Il]||(i[Il]=!0,Zc("selectionchange",!1,i))}}function V0(n,i,l,h){switch(Xt(i)){case 1:var v=gl;break;case 4:v=qc;break;default:v=ji}l=v.bind(null,i,l,n),v=void 0,!Rs||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(v=!0),h?v!==void 0?n.addEventListener(i,l,{capture:!0,passive:v}):n.addEventListener(i,l,!0):v!==void 0?n.addEventListener(i,l,{passive:v}):n.addEventListener(i,l,!1)}function Jc(n,i,l,h,v){var x=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var R=h.tag;if(R===3||R===4){var D=h.stateNode.containerInfo;if(D===v||D.nodeType===8&&D.parentNode===v)break;if(R===4)for(R=h.return;R!==null;){var K=R.tag;if((K===3||K===4)&&(K=R.stateNode.containerInfo,K===v||K.nodeType===8&&K.parentNode===v))return;R=R.return}for(;D!==null;){if(R=Bs(D),R===null)return;if(K=R.tag,K===5||K===6){h=x=R;continue e}D=D.parentNode}}h=h.return}Sr(function(){var oe=x,me=wn(l),ge=[];e:{var he=B0.get(n);if(he!==void 0){var be=Uo,Ne=n;switch(n){case"keypress":if(rs(l)===0)break e;case"keydown":case"keyup":be=Go;break;case"focusin":Ne="focus",be=Ri;break;case"focusout":Ne="blur",be=Ri;break;case"beforeblur":case"afterblur":be=Ri;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":be=Ti;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":be=Dc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":be=Oi;break;case q0:case D0:case F0:be=mr;break;case z0:be=Yo;break;case"scroll":be=vl;break;case"wheel":be=Ko;break;case"copy":case"cut":case"paste":be=xl;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":be=Mi}var je=(i&4)!==0,St=!je&&n==="scroll",re=je?he!==null?he+"Capture":null:he;je=[];for(var J=oe,se;J!==null;){se=J;var ve=se.stateNode;if(se.tag===5&&ve!==null&&(se=ve,re!==null&&(ve=Bn(J,re),ve!=null&&je.push(ia(J,ve,se)))),St)break;J=J.return}0<je.length&&(he=new be(he,Ne,null,l,me),ge.push({event:he,listeners:je}))}}if((i&7)===0){e:{if(he=n==="mouseover"||n==="pointerover",be=n==="mouseout"||n==="pointerout",he&&l!==dn&&(Ne=l.relatedTarget||l.fromElement)&&(Bs(Ne)||Ne[Pr]))break e;if((be||he)&&(he=me.window===me?me:(he=me.ownerDocument)?he.defaultView||he.parentWindow:window,be?(Ne=l.relatedTarget||l.toElement,be=oe,Ne=Ne?Bs(Ne):null,Ne!==null&&(St=kn(Ne),Ne!==St||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(be=null,Ne=oe),be!==Ne)){if(je=Ti,ve="onMouseLeave",re="onMouseEnter",J="mouse",(n==="pointerout"||n==="pointerover")&&(je=Mi,ve="onPointerLeave",re="onPointerEnter",J="pointer"),St=be==null?he:Fi(be),se=Ne==null?he:Fi(Ne),he=new je(ve,J+"leave",be,l,me),he.target=St,he.relatedTarget=se,ve=null,Bs(me)===oe&&(je=new je(re,J+"enter",Ne,l,me),je.target=se,je.relatedTarget=St,ve=je),St=ve,be&&Ne)t:{for(je=be,re=Ne,J=0,se=je;se;se=qi(se))J++;for(se=0,ve=re;ve;ve=qi(ve))se++;for(;0<J-se;)je=qi(je),J--;for(;0<se-J;)re=qi(re),se--;for(;J--;){if(je===re||re!==null&&je===re.alternate)break t;je=qi(je),re=qi(re)}je=null}else je=null;be!==null&&G0(ge,he,be,je,!1),Ne!==null&&St!==null&&G0(ge,St,Ne,je,!0)}}e:{if(he=oe?Fi(oe):window,be=he.nodeName&&he.nodeName.toLowerCase(),be==="select"||be==="input"&&he.type==="file")var Te=ht;else if(ie(he))if(at)Te=Fs;else{Te=Tl;var Oe=Wc}else(be=he.nodeName)&&be.toLowerCase()==="input"&&(he.type==="checkbox"||he.type==="radio")&&(Te=ta);if(Te&&(Te=Te(n,oe))){de(ge,Te,l,me);break e}Oe&&Oe(n,he,oe),n==="focusout"&&(Oe=he._wrapperState)&&Oe.controlled&&he.type==="number"&&Ye(he,"number",he.value)}switch(Oe=oe?Fi(oe):window,n){case"focusin":(ie(Oe)||Oe.contentEditable==="true")&&(Li=Oe,Gc=oe,na=null);break;case"focusout":na=Gc=Li=null;break;case"mousedown":Yc=!0;break;case"contextmenu":case"mouseup":case"dragend":Yc=!1,L0(ge,l,me);break;case"selectionchange":if(kR)break;case"keydown":case"keyup":L0(ge,l,me)}var Pe;if(Pi)e:{switch(n){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else Or?Qo(n,l)&&(qe="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(qe="onCompositionStart");qe&&(Nl&&l.locale!=="ko"&&(Or||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&Or&&(Pe=ns()):(pr=me,$s="value"in pr?pr.value:pr.textContent,Or=!0)),Oe=Ml(oe,qe),0<Oe.length&&(qe=new Ds(qe,n,null,l,me),ge.push({event:qe,listeners:Oe}),Pe?qe.data=Pe:(Pe=Zo(l),Pe!==null&&(qe.data=Pe)))),(Pe=Hc?Cl(n,l):F(n,l))&&(oe=Ml(oe,"onBeforeInput"),0<oe.length&&(me=new Ds("onBeforeInput","beforeinput",null,l,me),ge.push({event:me,listeners:oe}),me.data=Pe))}W0(ge,i)})}function ia(n,i,l){return{instance:n,listener:i,currentTarget:l}}function Ml(n,i){for(var l=i+"Capture",h=[];n!==null;){var v=n,x=v.stateNode;v.tag===5&&x!==null&&(v=x,x=Bn(n,l),x!=null&&h.unshift(ia(n,x,v)),x=Bn(n,i),x!=null&&h.push(ia(n,x,v))),n=n.return}return h}function qi(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function G0(n,i,l,h,v){for(var x=i._reactName,R=[];l!==null&&l!==h;){var D=l,K=D.alternate,oe=D.stateNode;if(K!==null&&K===h)break;D.tag===5&&oe!==null&&(D=oe,v?(K=Bn(l,x),K!=null&&R.unshift(ia(l,K,D))):v||(K=Bn(l,x),K!=null&&R.push(ia(l,K,D)))),l=l.return}R.length!==0&&n.push({event:i,listeners:R})}var CR=/\r\n?/g,jR=/\u0000|\uFFFD/g;function Y0(n){return(typeof n=="string"?n:""+n).replace(CR,`
|
|
38
|
+
`).replace(jR,"")}function Ol(n,i,l){if(i=Y0(i),Y0(n)!==i&&l)throw Error(r(425))}function Pl(){}var ed=null,td=null;function nd(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var rd=typeof setTimeout=="function"?setTimeout:void 0,TR=typeof clearTimeout=="function"?clearTimeout:void 0,K0=typeof Promise=="function"?Promise:void 0,RR=typeof queueMicrotask=="function"?queueMicrotask:typeof K0<"u"?function(n){return K0.resolve(null).then(n).catch(AR)}:rd;function AR(n){setTimeout(function(){throw n})}function sd(n,i){var l=i,h=0;do{var v=l.nextSibling;if(n.removeChild(l),v&&v.nodeType===8)if(l=v.data,l==="/$"){if(h===0){n.removeChild(v),Ps(i);return}h--}else l!=="$"&&l!=="$?"&&l!=="$!"||h++;l=v}while(l);Ps(i)}function us(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return n}function X0(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return n;i--}else l==="/$"&&i++}n=n.previousSibling}return null}var Di=Math.random().toString(36).slice(2),gr="__reactFiber$"+Di,oa="__reactProps$"+Di,Pr="__reactContainer$"+Di,id="__reactEvents$"+Di,IR="__reactListeners$"+Di,MR="__reactHandles$"+Di;function Bs(n){var i=n[gr];if(i)return i;for(var l=n.parentNode;l;){if(i=l[Pr]||l[gr]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=X0(n);n!==null;){if(l=n[gr])return l;n=X0(n)}return i}n=l,l=n.parentNode}return null}function aa(n){return n=n[gr]||n[Pr],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function Fi(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(r(33))}function Ll(n){return n[oa]||null}var od=[],zi=-1;function cs(n){return{current:n}}function dt(n){0>zi||(n.current=od[zi],od[zi]=null,zi--)}function ut(n,i){zi++,od[zi]=n.current,n.current=i}var ds={},Ht=cs(ds),nn=cs(!1),Us=ds;function Bi(n,i){var l=n.type.contextTypes;if(!l)return ds;var h=n.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===i)return h.__reactInternalMemoizedMaskedChildContext;var v={},x;for(x in l)v[x]=i[x];return h&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=v),v}function rn(n){return n=n.childContextTypes,n!=null}function $l(){dt(nn),dt(Ht)}function Q0(n,i,l){if(Ht.current!==ds)throw Error(r(168));ut(Ht,i),ut(nn,l)}function Z0(n,i,l){var h=n.stateNode;if(i=i.childContextTypes,typeof h.getChildContext!="function")return l;h=h.getChildContext();for(var v in h)if(!(v in i))throw Error(r(108,ae(n)||"Unknown",v));return H({},l,h)}function ql(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||ds,Us=Ht.current,ut(Ht,n),ut(nn,nn.current),!0}function J0(n,i,l){var h=n.stateNode;if(!h)throw Error(r(169));l?(n=Z0(n,i,Us),h.__reactInternalMemoizedMergedChildContext=n,dt(nn),dt(Ht),ut(Ht,n)):dt(nn),ut(nn,l)}var Lr=null,Dl=!1,ad=!1;function ew(n){Lr===null?Lr=[n]:Lr.push(n)}function OR(n){Dl=!0,ew(n)}function fs(){if(!ad&&Lr!==null){ad=!0;var n=0,i=Je;try{var l=Lr;for(Je=1;n<l.length;n++){var h=l[n];do h=h(!0);while(h!==null)}Lr=null,Dl=!1}catch(v){throw Lr!==null&&(Lr=Lr.slice(n+1)),_i(Is,fs),v}finally{Je=i,ad=!1}}return null}var Ui=[],Hi=0,Fl=null,zl=0,Rn=[],An=0,Hs=null,$r=1,qr="";function Ws(n,i){Ui[Hi++]=zl,Ui[Hi++]=Fl,Fl=n,zl=i}function tw(n,i,l){Rn[An++]=$r,Rn[An++]=qr,Rn[An++]=Hs,Hs=n;var h=$r;n=qr;var v=32-tn(h)-1;h&=~(1<<v),l+=1;var x=32-tn(i)+v;if(30<x){var R=v-v%5;x=(h&(1<<R)-1).toString(32),h>>=R,v-=R,$r=1<<32-tn(i)+v|l<<v|h,qr=x+n}else $r=1<<x|l<<v|h,qr=n}function ld(n){n.return!==null&&(Ws(n,1),tw(n,1,0))}function ud(n){for(;n===Fl;)Fl=Ui[--Hi],Ui[Hi]=null,zl=Ui[--Hi],Ui[Hi]=null;for(;n===Hs;)Hs=Rn[--An],Rn[An]=null,qr=Rn[--An],Rn[An]=null,$r=Rn[--An],Rn[An]=null}var pn=null,mn=null,pt=!1,Xn=null;function nw(n,i){var l=Pn(5,null,null,0);l.elementType="DELETED",l.stateNode=i,l.return=n,i=n.deletions,i===null?(n.deletions=[l],n.flags|=16):i.push(l)}function rw(n,i){switch(n.tag){case 5:var l=n.type;return i=i.nodeType!==1||l.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(n.stateNode=i,pn=n,mn=us(i.firstChild),!0):!1;case 6:return i=n.pendingProps===""||i.nodeType!==3?null:i,i!==null?(n.stateNode=i,pn=n,mn=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=Hs!==null?{id:$r,overflow:qr}:null,n.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=Pn(18,null,null,0),l.stateNode=i,l.return=n,n.child=l,pn=n,mn=null,!0):!1;default:return!1}}function cd(n){return(n.mode&1)!==0&&(n.flags&128)===0}function dd(n){if(pt){var i=mn;if(i){var l=i;if(!rw(n,i)){if(cd(n))throw Error(r(418));i=us(l.nextSibling);var h=pn;i&&rw(n,i)?nw(h,l):(n.flags=n.flags&-4097|2,pt=!1,pn=n)}}else{if(cd(n))throw Error(r(418));n.flags=n.flags&-4097|2,pt=!1,pn=n}}}function sw(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;pn=n}function Bl(n){if(n!==pn)return!1;if(!pt)return sw(n),pt=!0,!1;var i;if((i=n.tag!==3)&&!(i=n.tag!==5)&&(i=n.type,i=i!=="head"&&i!=="body"&&!nd(n.type,n.memoizedProps)),i&&(i=mn)){if(cd(n))throw iw(),Error(r(418));for(;i;)nw(n,i),i=us(i.nextSibling)}if(sw(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));e:{for(n=n.nextSibling,i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"){if(i===0){mn=us(n.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}n=n.nextSibling}mn=null}}else mn=pn?us(n.stateNode.nextSibling):null;return!0}function iw(){for(var n=mn;n;)n=us(n.nextSibling)}function Wi(){mn=pn=null,pt=!1}function fd(n){Xn===null?Xn=[n]:Xn.push(n)}var PR=T.ReactCurrentBatchConfig;function la(n,i,l){if(n=l.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(r(309));var h=l.stateNode}if(!h)throw Error(r(147,n));var v=h,x=""+n;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===x?i.ref:(i=function(R){var D=v.refs;R===null?delete D[x]:D[x]=R},i._stringRef=x,i)}if(typeof n!="string")throw Error(r(284));if(!l._owner)throw Error(r(290,n))}return n}function Ul(n,i){throw n=Object.prototype.toString.call(i),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n))}function ow(n){var i=n._init;return i(n._payload)}function aw(n){function i(re,J){if(n){var se=re.deletions;se===null?(re.deletions=[J],re.flags|=16):se.push(J)}}function l(re,J){if(!n)return null;for(;J!==null;)i(re,J),J=J.sibling;return null}function h(re,J){for(re=new Map;J!==null;)J.key!==null?re.set(J.key,J):re.set(J.index,J),J=J.sibling;return re}function v(re,J){return re=xs(re,J),re.index=0,re.sibling=null,re}function x(re,J,se){return re.index=se,n?(se=re.alternate,se!==null?(se=se.index,se<J?(re.flags|=2,J):se):(re.flags|=2,J)):(re.flags|=1048576,J)}function R(re){return n&&re.alternate===null&&(re.flags|=2),re}function D(re,J,se,ve){return J===null||J.tag!==6?(J=rf(se,re.mode,ve),J.return=re,J):(J=v(J,se),J.return=re,J)}function K(re,J,se,ve){var Te=se.type;return Te===P?me(re,J,se.props.children,ve,se.key):J!==null&&(J.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===B&&ow(Te)===J.type)?(ve=v(J,se.props),ve.ref=la(re,J,se),ve.return=re,ve):(ve=hu(se.type,se.key,se.props,null,re.mode,ve),ve.ref=la(re,J,se),ve.return=re,ve)}function oe(re,J,se,ve){return J===null||J.tag!==4||J.stateNode.containerInfo!==se.containerInfo||J.stateNode.implementation!==se.implementation?(J=sf(se,re.mode,ve),J.return=re,J):(J=v(J,se.children||[]),J.return=re,J)}function me(re,J,se,ve,Te){return J===null||J.tag!==7?(J=Js(se,re.mode,ve,Te),J.return=re,J):(J=v(J,se),J.return=re,J)}function ge(re,J,se){if(typeof J=="string"&&J!==""||typeof J=="number")return J=rf(""+J,re.mode,se),J.return=re,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case A:return se=hu(J.type,J.key,J.props,null,re.mode,se),se.ref=la(re,null,J),se.return=re,se;case L:return J=sf(J,re.mode,se),J.return=re,J;case B:var ve=J._init;return ge(re,ve(J._payload),se)}if(gt(J)||$(J))return J=Js(J,re.mode,se,null),J.return=re,J;Ul(re,J)}return null}function he(re,J,se,ve){var Te=J!==null?J.key:null;if(typeof se=="string"&&se!==""||typeof se=="number")return Te!==null?null:D(re,J,""+se,ve);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case A:return se.key===Te?K(re,J,se,ve):null;case L:return se.key===Te?oe(re,J,se,ve):null;case B:return Te=se._init,he(re,J,Te(se._payload),ve)}if(gt(se)||$(se))return Te!==null?null:me(re,J,se,ve,null);Ul(re,se)}return null}function be(re,J,se,ve,Te){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return re=re.get(se)||null,D(J,re,""+ve,Te);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case A:return re=re.get(ve.key===null?se:ve.key)||null,K(J,re,ve,Te);case L:return re=re.get(ve.key===null?se:ve.key)||null,oe(J,re,ve,Te);case B:var Oe=ve._init;return be(re,J,se,Oe(ve._payload),Te)}if(gt(ve)||$(ve))return re=re.get(se)||null,me(J,re,ve,Te,null);Ul(J,ve)}return null}function Ne(re,J,se,ve){for(var Te=null,Oe=null,Pe=J,qe=J=0,$t=null;Pe!==null&&qe<se.length;qe++){Pe.index>qe?($t=Pe,Pe=null):$t=Pe.sibling;var Ze=he(re,Pe,se[qe],ve);if(Ze===null){Pe===null&&(Pe=$t);break}n&&Pe&&Ze.alternate===null&&i(re,Pe),J=x(Ze,J,qe),Oe===null?Te=Ze:Oe.sibling=Ze,Oe=Ze,Pe=$t}if(qe===se.length)return l(re,Pe),pt&&Ws(re,qe),Te;if(Pe===null){for(;qe<se.length;qe++)Pe=ge(re,se[qe],ve),Pe!==null&&(J=x(Pe,J,qe),Oe===null?Te=Pe:Oe.sibling=Pe,Oe=Pe);return pt&&Ws(re,qe),Te}for(Pe=h(re,Pe);qe<se.length;qe++)$t=be(Pe,re,qe,se[qe],ve),$t!==null&&(n&&$t.alternate!==null&&Pe.delete($t.key===null?qe:$t.key),J=x($t,J,qe),Oe===null?Te=$t:Oe.sibling=$t,Oe=$t);return n&&Pe.forEach(function(_s){return i(re,_s)}),pt&&Ws(re,qe),Te}function je(re,J,se,ve){var Te=$(se);if(typeof Te!="function")throw Error(r(150));if(se=Te.call(se),se==null)throw Error(r(151));for(var Oe=Te=null,Pe=J,qe=J=0,$t=null,Ze=se.next();Pe!==null&&!Ze.done;qe++,Ze=se.next()){Pe.index>qe?($t=Pe,Pe=null):$t=Pe.sibling;var _s=he(re,Pe,Ze.value,ve);if(_s===null){Pe===null&&(Pe=$t);break}n&&Pe&&_s.alternate===null&&i(re,Pe),J=x(_s,J,qe),Oe===null?Te=_s:Oe.sibling=_s,Oe=_s,Pe=$t}if(Ze.done)return l(re,Pe),pt&&Ws(re,qe),Te;if(Pe===null){for(;!Ze.done;qe++,Ze=se.next())Ze=ge(re,Ze.value,ve),Ze!==null&&(J=x(Ze,J,qe),Oe===null?Te=Ze:Oe.sibling=Ze,Oe=Ze);return pt&&Ws(re,qe),Te}for(Pe=h(re,Pe);!Ze.done;qe++,Ze=se.next())Ze=be(Pe,re,qe,Ze.value,ve),Ze!==null&&(n&&Ze.alternate!==null&&Pe.delete(Ze.key===null?qe:Ze.key),J=x(Ze,J,qe),Oe===null?Te=Ze:Oe.sibling=Ze,Oe=Ze);return n&&Pe.forEach(function(pA){return i(re,pA)}),pt&&Ws(re,qe),Te}function St(re,J,se,ve){if(typeof se=="object"&&se!==null&&se.type===P&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case A:e:{for(var Te=se.key,Oe=J;Oe!==null;){if(Oe.key===Te){if(Te=se.type,Te===P){if(Oe.tag===7){l(re,Oe.sibling),J=v(Oe,se.props.children),J.return=re,re=J;break e}}else if(Oe.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===B&&ow(Te)===Oe.type){l(re,Oe.sibling),J=v(Oe,se.props),J.ref=la(re,Oe,se),J.return=re,re=J;break e}l(re,Oe);break}else i(re,Oe);Oe=Oe.sibling}se.type===P?(J=Js(se.props.children,re.mode,ve,se.key),J.return=re,re=J):(ve=hu(se.type,se.key,se.props,null,re.mode,ve),ve.ref=la(re,J,se),ve.return=re,re=ve)}return R(re);case L:e:{for(Oe=se.key;J!==null;){if(J.key===Oe)if(J.tag===4&&J.stateNode.containerInfo===se.containerInfo&&J.stateNode.implementation===se.implementation){l(re,J.sibling),J=v(J,se.children||[]),J.return=re,re=J;break e}else{l(re,J);break}else i(re,J);J=J.sibling}J=sf(se,re.mode,ve),J.return=re,re=J}return R(re);case B:return Oe=se._init,St(re,J,Oe(se._payload),ve)}if(gt(se))return Ne(re,J,se,ve);if($(se))return je(re,J,se,ve);Ul(re,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,J!==null&&J.tag===6?(l(re,J.sibling),J=v(J,se),J.return=re,re=J):(l(re,J),J=rf(se,re.mode,ve),J.return=re,re=J),R(re)):l(re,J)}return St}var Vi=aw(!0),lw=aw(!1),Hl=cs(null),Wl=null,Gi=null,hd=null;function pd(){hd=Gi=Wl=null}function md(n){var i=Hl.current;dt(Hl),n._currentValue=i}function gd(n,i,l){for(;n!==null;){var h=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),n===l)break;n=n.return}}function Yi(n,i){Wl=n,hd=Gi=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&i)!==0&&(sn=!0),n.firstContext=null)}function In(n){var i=n._currentValue;if(hd!==n)if(n={context:n,memoizedValue:i,next:null},Gi===null){if(Wl===null)throw Error(r(308));Gi=n,Wl.dependencies={lanes:0,firstContext:n}}else Gi=Gi.next=n;return i}var Vs=null;function vd(n){Vs===null?Vs=[n]:Vs.push(n)}function uw(n,i,l,h){var v=i.interleaved;return v===null?(l.next=l,vd(i)):(l.next=v.next,v.next=l),i.interleaved=l,Dr(n,h)}function Dr(n,i){n.lanes|=i;var l=n.alternate;for(l!==null&&(l.lanes|=i),l=n,n=n.return;n!==null;)n.childLanes|=i,l=n.alternate,l!==null&&(l.childLanes|=i),l=n,n=n.return;return l.tag===3?l.stateNode:null}var hs=!1;function yd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function cw(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Fr(n,i){return{eventTime:n,lane:i,tag:0,payload:null,callback:null,next:null}}function ps(n,i,l){var h=n.updateQueue;if(h===null)return null;if(h=h.shared,(Qe&2)!==0){var v=h.pending;return v===null?i.next=i:(i.next=v.next,v.next=i),h.pending=i,Dr(n,l)}return v=h.interleaved,v===null?(i.next=i,vd(h)):(i.next=v.next,v.next=i),h.interleaved=i,Dr(n,l)}function Vl(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var h=i.lanes;h&=n.pendingLanes,l|=h,i.lanes=l,Po(n,l)}}function dw(n,i){var l=n.updateQueue,h=n.alternate;if(h!==null&&(h=h.updateQueue,l===h)){var v=null,x=null;if(l=l.firstBaseUpdate,l!==null){do{var R={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};x===null?v=x=R:x=x.next=R,l=l.next}while(l!==null);x===null?v=x=i:x=x.next=i}else v=x=i;l={baseState:h.baseState,firstBaseUpdate:v,lastBaseUpdate:x,shared:h.shared,effects:h.effects},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}function Gl(n,i,l,h){var v=n.updateQueue;hs=!1;var x=v.firstBaseUpdate,R=v.lastBaseUpdate,D=v.shared.pending;if(D!==null){v.shared.pending=null;var K=D,oe=K.next;K.next=null,R===null?x=oe:R.next=oe,R=K;var me=n.alternate;me!==null&&(me=me.updateQueue,D=me.lastBaseUpdate,D!==R&&(D===null?me.firstBaseUpdate=oe:D.next=oe,me.lastBaseUpdate=K))}if(x!==null){var ge=v.baseState;R=0,me=oe=K=null,D=x;do{var he=D.lane,be=D.eventTime;if((h&he)===he){me!==null&&(me=me.next={eventTime:be,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Ne=n,je=D;switch(he=i,be=l,je.tag){case 1:if(Ne=je.payload,typeof Ne=="function"){ge=Ne.call(be,ge,he);break e}ge=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=je.payload,he=typeof Ne=="function"?Ne.call(be,ge,he):Ne,he==null)break e;ge=H({},ge,he);break e;case 2:hs=!0}}D.callback!==null&&D.lane!==0&&(n.flags|=64,he=v.effects,he===null?v.effects=[D]:he.push(D))}else be={eventTime:be,lane:he,tag:D.tag,payload:D.payload,callback:D.callback,next:null},me===null?(oe=me=be,K=ge):me=me.next=be,R|=he;if(D=D.next,D===null){if(D=v.shared.pending,D===null)break;he=D,D=he.next,he.next=null,v.lastBaseUpdate=he,v.shared.pending=null}}while(!0);if(me===null&&(K=ge),v.baseState=K,v.firstBaseUpdate=oe,v.lastBaseUpdate=me,i=v.shared.interleaved,i!==null){v=i;do R|=v.lane,v=v.next;while(v!==i)}else x===null&&(v.shared.lanes=0);Ks|=R,n.lanes=R,n.memoizedState=ge}}function fw(n,i,l){if(n=i.effects,i.effects=null,n!==null)for(i=0;i<n.length;i++){var h=n[i],v=h.callback;if(v!==null){if(h.callback=null,h=l,typeof v!="function")throw Error(r(191,v));v.call(h)}}}var ua={},vr=cs(ua),ca=cs(ua),da=cs(ua);function Gs(n){if(n===ua)throw Error(r(174));return n}function wd(n,i){switch(ut(da,i),ut(ca,n),ut(vr,ua),n=i.nodeType,n){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:ee(null,"");break;default:n=n===8?i.parentNode:i,i=n.namespaceURI||null,n=n.tagName,i=ee(i,n)}dt(vr),ut(vr,i)}function Ki(){dt(vr),dt(ca),dt(da)}function hw(n){Gs(da.current);var i=Gs(vr.current),l=ee(i,n.type);i!==l&&(ut(ca,n),ut(vr,l))}function xd(n){ca.current===n&&(dt(vr),dt(ca))}var vt=cs(0);function Yl(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var _d=[];function bd(){for(var n=0;n<_d.length;n++)_d[n]._workInProgressVersionPrimary=null;_d.length=0}var Kl=T.ReactCurrentDispatcher,kd=T.ReactCurrentBatchConfig,Ys=0,yt=null,Tt=null,Pt=null,Xl=!1,fa=!1,ha=0,LR=0;function Wt(){throw Error(r(321))}function Sd(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!nt(n[l],i[l]))return!1;return!0}function Ed(n,i,l,h,v,x){if(Ys=x,yt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Kl.current=n===null||n.memoizedState===null?FR:zR,n=l(h,v),fa){x=0;do{if(fa=!1,ha=0,25<=x)throw Error(r(301));x+=1,Pt=Tt=null,i.updateQueue=null,Kl.current=BR,n=l(h,v)}while(fa)}if(Kl.current=Jl,i=Tt!==null&&Tt.next!==null,Ys=0,Pt=Tt=yt=null,Xl=!1,i)throw Error(r(300));return n}function Nd(){var n=ha!==0;return ha=0,n}function yr(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?yt.memoizedState=Pt=n:Pt=Pt.next=n,Pt}function Mn(){if(Tt===null){var n=yt.alternate;n=n!==null?n.memoizedState:null}else n=Tt.next;var i=Pt===null?yt.memoizedState:Pt.next;if(i!==null)Pt=i,Tt=n;else{if(n===null)throw Error(r(310));Tt=n,n={memoizedState:Tt.memoizedState,baseState:Tt.baseState,baseQueue:Tt.baseQueue,queue:Tt.queue,next:null},Pt===null?yt.memoizedState=Pt=n:Pt=Pt.next=n}return Pt}function pa(n,i){return typeof i=="function"?i(n):i}function Cd(n){var i=Mn(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var h=Tt,v=h.baseQueue,x=l.pending;if(x!==null){if(v!==null){var R=v.next;v.next=x.next,x.next=R}h.baseQueue=v=x,l.pending=null}if(v!==null){x=v.next,h=h.baseState;var D=R=null,K=null,oe=x;do{var me=oe.lane;if((Ys&me)===me)K!==null&&(K=K.next={lane:0,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),h=oe.hasEagerState?oe.eagerState:n(h,oe.action);else{var ge={lane:me,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null};K===null?(D=K=ge,R=h):K=K.next=ge,yt.lanes|=me,Ks|=me}oe=oe.next}while(oe!==null&&oe!==x);K===null?R=h:K.next=D,nt(h,i.memoizedState)||(sn=!0),i.memoizedState=h,i.baseState=R,i.baseQueue=K,l.lastRenderedState=h}if(n=l.interleaved,n!==null){v=n;do x=v.lane,yt.lanes|=x,Ks|=x,v=v.next;while(v!==n)}else v===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function jd(n){var i=Mn(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var h=l.dispatch,v=l.pending,x=i.memoizedState;if(v!==null){l.pending=null;var R=v=v.next;do x=n(x,R.action),R=R.next;while(R!==v);nt(x,i.memoizedState)||(sn=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),l.lastRenderedState=x}return[x,h]}function pw(){}function mw(n,i){var l=yt,h=Mn(),v=i(),x=!nt(h.memoizedState,v);if(x&&(h.memoizedState=v,sn=!0),h=h.queue,Td(yw.bind(null,l,h,n),[n]),h.getSnapshot!==i||x||Pt!==null&&Pt.memoizedState.tag&1){if(l.flags|=2048,ma(9,vw.bind(null,l,h,v,i),void 0,null),Lt===null)throw Error(r(349));(Ys&30)!==0||gw(l,i,v)}return v}function gw(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=yt.updateQueue,i===null?(i={lastEffect:null,stores:null},yt.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function vw(n,i,l,h){i.value=l,i.getSnapshot=h,ww(i)&&xw(n)}function yw(n,i,l){return l(function(){ww(i)&&xw(n)})}function ww(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!nt(n,l)}catch{return!0}}function xw(n){var i=Dr(n,1);i!==null&&er(i,n,1,-1)}function _w(n){var i=yr();return typeof n=="function"&&(n=n()),i.memoizedState=i.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:n},i.queue=n,n=n.dispatch=DR.bind(null,yt,n),[i.memoizedState,n]}function ma(n,i,l,h){return n={tag:n,create:i,destroy:l,deps:h,next:null},i=yt.updateQueue,i===null?(i={lastEffect:null,stores:null},yt.updateQueue=i,i.lastEffect=n.next=n):(l=i.lastEffect,l===null?i.lastEffect=n.next=n:(h=l.next,l.next=n,n.next=h,i.lastEffect=n)),n}function bw(){return Mn().memoizedState}function Ql(n,i,l,h){var v=yr();yt.flags|=n,v.memoizedState=ma(1|i,l,void 0,h===void 0?null:h)}function Zl(n,i,l,h){var v=Mn();h=h===void 0?null:h;var x=void 0;if(Tt!==null){var R=Tt.memoizedState;if(x=R.destroy,h!==null&&Sd(h,R.deps)){v.memoizedState=ma(i,l,x,h);return}}yt.flags|=n,v.memoizedState=ma(1|i,l,x,h)}function kw(n,i){return Ql(8390656,8,n,i)}function Td(n,i){return Zl(2048,8,n,i)}function Sw(n,i){return Zl(4,2,n,i)}function Ew(n,i){return Zl(4,4,n,i)}function Nw(n,i){if(typeof i=="function")return n=n(),i(n),function(){i(null)};if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Cw(n,i,l){return l=l!=null?l.concat([n]):null,Zl(4,4,Nw.bind(null,i,n),l)}function Rd(){}function jw(n,i){var l=Mn();i=i===void 0?null:i;var h=l.memoizedState;return h!==null&&i!==null&&Sd(i,h[1])?h[0]:(l.memoizedState=[n,i],n)}function Tw(n,i){var l=Mn();i=i===void 0?null:i;var h=l.memoizedState;return h!==null&&i!==null&&Sd(i,h[1])?h[0]:(n=n(),l.memoizedState=[n,i],n)}function Rw(n,i,l){return(Ys&21)===0?(n.baseState&&(n.baseState=!1,sn=!0),n.memoizedState=l):(nt(l,i)||(l=Oo(),yt.lanes|=l,Ks|=l,n.baseState=!0),i)}function $R(n,i){var l=Je;Je=l!==0&&4>l?l:4,n(!0);var h=kd.transition;kd.transition={};try{n(!1),i()}finally{Je=l,kd.transition=h}}function Aw(){return Mn().memoizedState}function qR(n,i,l){var h=ys(n);if(l={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null},Iw(n))Mw(i,l);else if(l=uw(n,i,l,h),l!==null){var v=en();er(l,n,h,v),Ow(l,i,h)}}function DR(n,i,l){var h=ys(n),v={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null};if(Iw(n))Mw(i,v);else{var x=n.alternate;if(n.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var R=i.lastRenderedState,D=x(R,l);if(v.hasEagerState=!0,v.eagerState=D,nt(D,R)){var K=i.interleaved;K===null?(v.next=v,vd(i)):(v.next=K.next,K.next=v),i.interleaved=v;return}}catch{}finally{}l=uw(n,i,v,h),l!==null&&(v=en(),er(l,n,h,v),Ow(l,i,h))}}function Iw(n){var i=n.alternate;return n===yt||i!==null&&i===yt}function Mw(n,i){fa=Xl=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function Ow(n,i,l){if((l&4194240)!==0){var h=i.lanes;h&=n.pendingLanes,l|=h,i.lanes=l,Po(n,l)}}var Jl={readContext:In,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},FR={readContext:In,useCallback:function(n,i){return yr().memoizedState=[n,i===void 0?null:i],n},useContext:In,useEffect:kw,useImperativeHandle:function(n,i,l){return l=l!=null?l.concat([n]):null,Ql(4194308,4,Nw.bind(null,i,n),l)},useLayoutEffect:function(n,i){return Ql(4194308,4,n,i)},useInsertionEffect:function(n,i){return Ql(4,2,n,i)},useMemo:function(n,i){var l=yr();return i=i===void 0?null:i,n=n(),l.memoizedState=[n,i],n},useReducer:function(n,i,l){var h=yr();return i=l!==void 0?l(i):i,h.memoizedState=h.baseState=i,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:i},h.queue=n,n=n.dispatch=qR.bind(null,yt,n),[h.memoizedState,n]},useRef:function(n){var i=yr();return n={current:n},i.memoizedState=n},useState:_w,useDebugValue:Rd,useDeferredValue:function(n){return yr().memoizedState=n},useTransition:function(){var n=_w(!1),i=n[0];return n=$R.bind(null,n[1]),yr().memoizedState=n,[i,n]},useMutableSource:function(){},useSyncExternalStore:function(n,i,l){var h=yt,v=yr();if(pt){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),Lt===null)throw Error(r(349));(Ys&30)!==0||gw(h,i,l)}v.memoizedState=l;var x={value:l,getSnapshot:i};return v.queue=x,kw(yw.bind(null,h,x,n),[n]),h.flags|=2048,ma(9,vw.bind(null,h,x,l,i),void 0,null),l},useId:function(){var n=yr(),i=Lt.identifierPrefix;if(pt){var l=qr,h=$r;l=(h&~(1<<32-tn(h)-1)).toString(32)+l,i=":"+i+"R"+l,l=ha++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=LR++,i=":"+i+"r"+l.toString(32)+":";return n.memoizedState=i},unstable_isNewReconciler:!1},zR={readContext:In,useCallback:jw,useContext:In,useEffect:Td,useImperativeHandle:Cw,useInsertionEffect:Sw,useLayoutEffect:Ew,useMemo:Tw,useReducer:Cd,useRef:bw,useState:function(){return Cd(pa)},useDebugValue:Rd,useDeferredValue:function(n){var i=Mn();return Rw(i,Tt.memoizedState,n)},useTransition:function(){var n=Cd(pa)[0],i=Mn().memoizedState;return[n,i]},useMutableSource:pw,useSyncExternalStore:mw,useId:Aw,unstable_isNewReconciler:!1},BR={readContext:In,useCallback:jw,useContext:In,useEffect:Td,useImperativeHandle:Cw,useInsertionEffect:Sw,useLayoutEffect:Ew,useMemo:Tw,useReducer:jd,useRef:bw,useState:function(){return jd(pa)},useDebugValue:Rd,useDeferredValue:function(n){var i=Mn();return Tt===null?i.memoizedState=n:Rw(i,Tt.memoizedState,n)},useTransition:function(){var n=jd(pa)[0],i=Mn().memoizedState;return[n,i]},useMutableSource:pw,useSyncExternalStore:mw,useId:Aw,unstable_isNewReconciler:!1};function Qn(n,i){if(n&&n.defaultProps){i=H({},i),n=n.defaultProps;for(var l in n)i[l]===void 0&&(i[l]=n[l]);return i}return i}function Ad(n,i,l,h){i=n.memoizedState,l=l(h,i),l=l==null?i:H({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var eu={isMounted:function(n){return(n=n._reactInternals)?kn(n)===n:!1},enqueueSetState:function(n,i,l){n=n._reactInternals;var h=en(),v=ys(n),x=Fr(h,v);x.payload=i,l!=null&&(x.callback=l),i=ps(n,x,v),i!==null&&(er(i,n,v,h),Vl(i,n,v))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var h=en(),v=ys(n),x=Fr(h,v);x.tag=1,x.payload=i,l!=null&&(x.callback=l),i=ps(n,x,v),i!==null&&(er(i,n,v,h),Vl(i,n,v))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=en(),h=ys(n),v=Fr(l,h);v.tag=2,i!=null&&(v.callback=i),i=ps(n,v,h),i!==null&&(er(i,n,h,l),Vl(i,n,h))}};function Pw(n,i,l,h,v,x,R){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(h,x,R):i.prototype&&i.prototype.isPureReactComponent?!as(l,h)||!as(v,x):!0}function Lw(n,i,l){var h=!1,v=ds,x=i.contextType;return typeof x=="object"&&x!==null?x=In(x):(v=rn(i)?Us:Ht.current,h=i.contextTypes,x=(h=h!=null)?Bi(n,v):ds),i=new i(l,x),n.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=eu,n.stateNode=i,i._reactInternals=n,h&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=v,n.__reactInternalMemoizedMaskedChildContext=x),i}function $w(n,i,l,h){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,h),i.state!==n&&eu.enqueueReplaceState(i,i.state,null)}function Id(n,i,l,h){var v=n.stateNode;v.props=l,v.state=n.memoizedState,v.refs={},yd(n);var x=i.contextType;typeof x=="object"&&x!==null?v.context=In(x):(x=rn(i)?Us:Ht.current,v.context=Bi(n,x)),v.state=n.memoizedState,x=i.getDerivedStateFromProps,typeof x=="function"&&(Ad(n,i,x,l),v.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(i=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),i!==v.state&&eu.enqueueReplaceState(v,v.state,null),Gl(n,l,v,h),v.state=n.memoizedState),typeof v.componentDidMount=="function"&&(n.flags|=4194308)}function Xi(n,i){try{var l="",h=i;do l+=Q(h),h=h.return;while(h);var v=l}catch(x){v=`
|
|
39
39
|
Error generating stack: `+x.message+`
|
|
40
|
-
`+x.stack}return{value:n,source:i,stack:v,digest:null}}function Md(n,i,l){return{value:n,source:null,stack:l??null,digest:i??null}}function Od(n,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var UR=typeof WeakMap=="function"?WeakMap:Map;function $w(n,i,l){l=Fr(-1,l),l.tag=3,l.payload={element:null};var h=i.value;return l.callback=function(){au||(au=!0,Kd=h),Od(n,i)},l}function qw(n,i,l){l=Fr(-1,l),l.tag=3;var h=n.type.getDerivedStateFromError;if(typeof h=="function"){var v=i.value;l.payload=function(){return h(v)},l.callback=function(){Od(n,i)}}var x=n.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(l.callback=function(){Od(n,i),typeof h!="function"&&(gs===null?gs=new Set([this]):gs.add(this));var R=i.stack;this.componentDidCatch(i.value,{componentStack:R!==null?R:""})}),l}function Dw(n,i,l){var h=n.pingCache;if(h===null){h=n.pingCache=new UR;var v=new Set;h.set(i,v)}else v=h.get(i),v===void 0&&(v=new Set,h.set(i,v));v.has(l)||(v.add(l),n=rA.bind(null,n,i,l),i.then(n,n))}function Fw(n){do{var i;if((i=n.tag===13)&&(i=n.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return n;n=n.return}while(n!==null);return null}function zw(n,i,l,h,v){return(n.mode&1)===0?(n===i?n.flags|=65536:(n.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(i=Fr(-1,1),i.tag=2,ps(l,i,1))),l.lanes|=1),n):(n.flags|=65536,n.lanes=v,n)}var HR=T.ReactCurrentOwner,sn=!1;function Jt(n,i,l,h){i.child=n===null?aw(i,null,l,h):Vi(i,n.child,l,h)}function Bw(n,i,l,h,v){l=l.render;var x=i.ref;return Yi(i,v),h=Ed(n,i,l,h,x,v),l=Nd(),n!==null&&!sn?(i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~v,zr(n,i,v)):(pt&&l&&ld(i),i.flags|=1,Jt(n,i,h,v),i.child)}function Uw(n,i,l,h,v){if(n===null){var x=l.type;return typeof x=="function"&&!nf(x)&&x.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=x,Hw(n,i,x,h,v)):(n=hu(l.type,null,h,i,i.mode,v),n.ref=i.ref,n.return=i,i.child=n)}if(x=n.child,(n.lanes&v)===0){var R=x.memoizedProps;if(l=l.compare,l=l!==null?l:as,l(R,h)&&n.ref===i.ref)return zr(n,i,v)}return i.flags|=1,n=xs(x,h),n.ref=i.ref,n.return=i,i.child=n}function Hw(n,i,l,h,v){if(n!==null){var x=n.memoizedProps;if(as(x,h)&&n.ref===i.ref)if(sn=!1,i.pendingProps=h=x,(n.lanes&v)!==0)(n.flags&131072)!==0&&(sn=!0);else return i.lanes=n.lanes,zr(n,i,v)}return Pd(n,i,l,h,v)}function Ww(n,i,l){var h=i.pendingProps,v=h.children,x=n!==null?n.memoizedState:null;if(h.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(Zi,gn),gn|=l;else{if((l&1073741824)===0)return n=x!==null?x.baseLanes|l:l,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:n,cachePool:null,transitions:null},i.updateQueue=null,ut(Zi,gn),gn|=n,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=x!==null?x.baseLanes:l,ut(Zi,gn),gn|=h}else x!==null?(h=x.baseLanes|l,i.memoizedState=null):h=l,ut(Zi,gn),gn|=h;return Jt(n,i,v,l),i.child}function Vw(n,i){var l=i.ref;(n===null&&l!==null||n!==null&&n.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function Pd(n,i,l,h,v){var x=rn(l)?Us:Ht.current;return x=Bi(i,x),Yi(i,v),l=Ed(n,i,l,h,x,v),h=Nd(),n!==null&&!sn?(i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~v,zr(n,i,v)):(pt&&h&&ld(i),i.flags|=1,Jt(n,i,l,v),i.child)}function Gw(n,i,l,h,v){if(rn(l)){var x=!0;ql(i)}else x=!1;if(Yi(i,v),i.stateNode===null)nu(n,i),Pw(i,l,h),Id(i,l,h,v),h=!0;else if(n===null){var R=i.stateNode,D=i.memoizedProps;R.props=D;var K=R.context,ie=l.contextType;typeof ie=="object"&&ie!==null?ie=In(ie):(ie=rn(l)?Us:Ht.current,ie=Bi(i,ie));var me=l.getDerivedStateFromProps,ge=typeof me=="function"||typeof R.getSnapshotBeforeUpdate=="function";ge||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(D!==h||K!==ie)&&Lw(i,R,h,ie),hs=!1;var he=i.memoizedState;R.state=he,Gl(i,h,R,v),K=i.memoizedState,D!==h||he!==K||nn.current||hs?(typeof me=="function"&&(Ad(i,l,me,h),K=i.memoizedState),(D=hs||Ow(i,l,D,h,he,K,ie))?(ge||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"&&(i.flags|=4194308)):(typeof R.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=K),R.props=h,R.state=K,R.context=ie,h=D):(typeof R.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{R=i.stateNode,uw(n,i),D=i.memoizedProps,ie=i.type===i.elementType?D:Qn(i.type,D),R.props=ie,ge=i.pendingProps,he=R.context,K=l.contextType,typeof K=="object"&&K!==null?K=In(K):(K=rn(l)?Us:Ht.current,K=Bi(i,K));var be=l.getDerivedStateFromProps;(me=typeof be=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(D!==ge||he!==K)&&Lw(i,R,h,K),hs=!1,he=i.memoizedState,R.state=he,Gl(i,h,R,v);var Ne=i.memoizedState;D!==ge||he!==Ne||nn.current||hs?(typeof be=="function"&&(Ad(i,l,be,h),Ne=i.memoizedState),(ie=hs||Ow(i,l,ie,h,he,Ne,K)||!1)?(me||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(h,Ne,K),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(h,Ne,K)),typeof R.componentDidUpdate=="function"&&(i.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof R.componentDidUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(i.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=Ne),R.props=h,R.state=Ne,R.context=K,h=ie):(typeof R.componentDidUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(i.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(i.flags|=1024),h=!1)}return Ld(n,i,l,h,x,v)}function Ld(n,i,l,h,v,x){Vw(n,i);var R=(i.flags&128)!==0;if(!h&&!R)return v&&Z0(i,l,!1),zr(n,i,x);h=i.stateNode,HR.current=i;var D=R&&typeof l.getDerivedStateFromError!="function"?null:h.render();return i.flags|=1,n!==null&&R?(i.child=Vi(i,n.child,null,x),i.child=Vi(i,null,D,x)):Jt(n,i,D,x),i.memoizedState=h.state,v&&Z0(i,l,!0),i.child}function Yw(n){var i=n.stateNode;i.pendingContext?X0(n,i.pendingContext,i.pendingContext!==i.context):i.context&&X0(n,i.context,!1),wd(n,i.containerInfo)}function Kw(n,i,l,h,v){return Wi(),fd(v),i.flags|=256,Jt(n,i,l,h),i.child}var $d={dehydrated:null,treeContext:null,retryLane:0};function qd(n){return{baseLanes:n,cachePool:null,transitions:null}}function Xw(n,i,l){var h=i.pendingProps,v=vt.current,x=!1,R=(i.flags&128)!==0,D;if((D=R)||(D=n!==null&&n.memoizedState===null?!1:(v&2)!==0),D?(x=!0,i.flags&=-129):(n===null||n.memoizedState!==null)&&(v|=1),ut(vt,v&1),n===null)return dd(i),n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?((i.mode&1)===0?i.lanes=1:n.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(R=h.children,n=h.fallback,x?(h=i.mode,x=i.child,R={mode:"hidden",children:R},(h&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=R):x=pu(R,h,0,null),n=Js(n,h,l,null),x.return=i,n.return=i,x.sibling=n,i.child=x,i.child.memoizedState=qd(l),i.memoizedState=$d,n):Dd(i,R));if(v=n.memoizedState,v!==null&&(D=v.dehydrated,D!==null))return WR(n,i,R,h,D,v,l);if(x){x=h.fallback,R=i.mode,v=n.child,D=v.sibling;var K={mode:"hidden",children:h.children};return(R&1)===0&&i.child!==v?(h=i.child,h.childLanes=0,h.pendingProps=K,i.deletions=null):(h=xs(v,K),h.subtreeFlags=v.subtreeFlags&14680064),D!==null?x=xs(D,x):(x=Js(x,R,l,null),x.flags|=2),x.return=i,h.return=i,h.sibling=x,i.child=h,h=x,x=i.child,R=n.child.memoizedState,R=R===null?qd(l):{baseLanes:R.baseLanes|l,cachePool:null,transitions:R.transitions},x.memoizedState=R,x.childLanes=n.childLanes&~l,i.memoizedState=$d,h}return x=n.child,n=x.sibling,h=xs(x,{mode:"visible",children:h.children}),(i.mode&1)===0&&(h.lanes=l),h.return=i,h.sibling=null,n!==null&&(l=i.deletions,l===null?(i.deletions=[n],i.flags|=16):l.push(n)),i.child=h,i.memoizedState=null,h}function Dd(n,i){return i=pu({mode:"visible",children:i},n.mode,0,null),i.return=n,n.child=i}function tu(n,i,l,h){return h!==null&&fd(h),Vi(i,n.child,null,l),n=Dd(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function WR(n,i,l,h,v,x,R){if(l)return i.flags&256?(i.flags&=-257,h=Md(Error(r(422))),tu(n,i,R,h)):i.memoizedState!==null?(i.child=n.child,i.flags|=128,null):(x=h.fallback,v=i.mode,h=pu({mode:"visible",children:h.children},v,0,null),x=Js(x,v,R,null),x.flags|=2,h.return=i,x.return=i,h.sibling=x,i.child=h,(i.mode&1)!==0&&Vi(i,n.child,null,R),i.child.memoizedState=qd(R),i.memoizedState=$d,x);if((i.mode&1)===0)return tu(n,i,R,null);if(v.data==="$!"){if(h=v.nextSibling&&v.nextSibling.dataset,h)var D=h.dgst;return h=D,x=Error(r(419)),h=Md(x,h,void 0),tu(n,i,R,h)}if(D=(R&n.childLanes)!==0,sn||D){if(h=Lt,h!==null){switch(R&-R){case 4:v=2;break;case 16:v=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:v=32;break;case 536870912:v=268435456;break;default:v=0}v=(v&(h.suspendedLanes|R))!==0?0:v,v!==0&&v!==x.retryLane&&(x.retryLane=v,Dr(n,v),er(h,n,v,-1))}return tf(),h=Md(Error(r(421))),tu(n,i,R,h)}return v.data==="$?"?(i.flags|=128,i.child=n.child,i=sA.bind(null,n),v._reactRetry=i,null):(n=x.treeContext,mn=us(v.nextSibling),pn=i,pt=!0,Xn=null,n!==null&&(Rn[An++]=$r,Rn[An++]=qr,Rn[An++]=Hs,$r=n.id,qr=n.overflow,Hs=i),i=Dd(i,h.children),i.flags|=4096,i)}function Qw(n,i,l){n.lanes|=i;var h=n.alternate;h!==null&&(h.lanes|=i),gd(n.return,i,l)}function Fd(n,i,l,h,v){var x=n.memoizedState;x===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:l,tailMode:v}:(x.isBackwards=i,x.rendering=null,x.renderingStartTime=0,x.last=h,x.tail=l,x.tailMode=v)}function Zw(n,i,l){var h=i.pendingProps,v=h.revealOrder,x=h.tail;if(Jt(n,i,h.children,l),h=vt.current,(h&2)!==0)h=h&1|2,i.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Qw(n,l,i);else if(n.tag===19)Qw(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}h&=1}if(ut(vt,h),(i.mode&1)===0)i.memoizedState=null;else switch(v){case"forwards":for(l=i.child,v=null;l!==null;)n=l.alternate,n!==null&&Yl(n)===null&&(v=l),l=l.sibling;l=v,l===null?(v=i.child,i.child=null):(v=l.sibling,l.sibling=null),Fd(i,!1,v,l,x);break;case"backwards":for(l=null,v=i.child,i.child=null;v!==null;){if(n=v.alternate,n!==null&&Yl(n)===null){i.child=v;break}n=v.sibling,v.sibling=l,l=v,v=n}Fd(i,!0,l,null,x);break;case"together":Fd(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function nu(n,i){(i.mode&1)===0&&n!==null&&(n.alternate=null,i.alternate=null,i.flags|=2)}function zr(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),Ks|=i.lanes,(l&i.childLanes)===0)return null;if(n!==null&&i.child!==n.child)throw Error(r(153));if(i.child!==null){for(n=i.child,l=xs(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=xs(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function VR(n,i,l){switch(i.tag){case 3:Yw(i),Wi();break;case 5:fw(i);break;case 1:rn(i.type)&&ql(i);break;case 4:wd(i,i.stateNode.containerInfo);break;case 10:var h=i.type._context,v=i.memoizedProps.value;ut(Hl,h._currentValue),h._currentValue=v;break;case 13:if(h=i.memoizedState,h!==null)return h.dehydrated!==null?(ut(vt,vt.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?Xw(n,i,l):(ut(vt,vt.current&1),n=zr(n,i,l),n!==null?n.sibling:null);ut(vt,vt.current&1);break;case 19:if(h=(l&i.childLanes)!==0,(n.flags&128)!==0){if(h)return Zw(n,i,l);i.flags|=128}if(v=i.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),ut(vt,vt.current),h)break;return null;case 22:case 23:return i.lanes=0,Ww(n,i,l)}return zr(n,i,l)}var Jw,zd,ex,tx;Jw=function(n,i){for(var l=i.child;l!==null;){if(l.tag===5||l.tag===6)n.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},zd=function(){},ex=function(n,i,l,h){var v=n.memoizedProps;if(v!==h){n=i.stateNode,Gs(vr.current);var x=null;switch(l){case"input":v=Ie(n,v),h=Ie(n,h),x=[];break;case"select":v=H({},v,{value:void 0}),h=H({},h,{value:void 0}),x=[];break;case"textarea":v=ot(n,v),h=ot(n,h),x=[];break;default:typeof v.onClick!="function"&&typeof h.onClick=="function"&&(n.onclick=Pl)}Ve(l,h);var R;l=null;for(ie in v)if(!h.hasOwnProperty(ie)&&v.hasOwnProperty(ie)&&v[ie]!=null)if(ie==="style"){var D=v[ie];for(R in D)D.hasOwnProperty(R)&&(l||(l={}),l[R]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(o.hasOwnProperty(ie)?x||(x=[]):(x=x||[]).push(ie,null));for(ie in h){var K=h[ie];if(D=v!=null?v[ie]:void 0,h.hasOwnProperty(ie)&&K!==D&&(K!=null||D!=null))if(ie==="style")if(D){for(R in D)!D.hasOwnProperty(R)||K&&K.hasOwnProperty(R)||(l||(l={}),l[R]="");for(R in K)K.hasOwnProperty(R)&&D[R]!==K[R]&&(l||(l={}),l[R]=K[R])}else l||(x||(x=[]),x.push(ie,l)),l=K;else ie==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,D=D?D.__html:void 0,K!=null&&D!==K&&(x=x||[]).push(ie,K)):ie==="children"?typeof K!="string"&&typeof K!="number"||(x=x||[]).push(ie,""+K):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(o.hasOwnProperty(ie)?(K!=null&&ie==="onScroll"&&ct("scroll",n),x||D===K||(x=[])):(x=x||[]).push(ie,K))}l&&(x=x||[]).push("style",l);var ie=x;(i.updateQueue=ie)&&(i.flags|=4)}},tx=function(n,i,l,h){l!==h&&(i.flags|=4)};function pa(n,i){if(!pt)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:h.sibling=null}}function Vt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,h=0;if(i)for(var v=n.child;v!==null;)l|=v.lanes|v.childLanes,h|=v.subtreeFlags&14680064,h|=v.flags&14680064,v.return=n,v=v.sibling;else for(v=n.child;v!==null;)l|=v.lanes|v.childLanes,h|=v.subtreeFlags,h|=v.flags,v.return=n,v=v.sibling;return n.subtreeFlags|=h,n.childLanes=l,i}function GR(n,i,l){var h=i.pendingProps;switch(ud(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(i),null;case 1:return rn(i.type)&&$l(),Vt(i),null;case 3:return h=i.stateNode,Ki(),dt(nn),dt(Ht),bd(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(n===null||n.child===null)&&(Bl(i)?i.flags|=4:n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Xn!==null&&(Zd(Xn),Xn=null))),zd(n,i),Vt(i),null;case 5:xd(i);var v=Gs(ua.current);if(l=i.type,n!==null&&i.stateNode!=null)ex(n,i,l,h,v),n.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!h){if(i.stateNode===null)throw Error(r(166));return Vt(i),null}if(n=Gs(vr.current),Bl(i)){h=i.stateNode,l=i.type;var x=i.memoizedProps;switch(h[gr]=i,h[sa]=x,n=(i.mode&1)!==0,l){case"dialog":ct("cancel",h),ct("close",h);break;case"iframe":case"object":case"embed":ct("load",h);break;case"video":case"audio":for(v=0;v<ta.length;v++)ct(ta[v],h);break;case"source":ct("error",h);break;case"img":case"image":case"link":ct("error",h),ct("load",h);break;case"details":ct("toggle",h);break;case"input":ke(h,x),ct("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!x.multiple},ct("invalid",h);break;case"textarea":Be(h,x),ct("invalid",h)}Ve(l,x),v=null;for(var R in x)if(x.hasOwnProperty(R)){var D=x[R];R==="children"?typeof D=="string"?h.textContent!==D&&(x.suppressHydrationWarning!==!0&&Ol(h.textContent,D,n),v=["children",D]):typeof D=="number"&&h.textContent!==""+D&&(x.suppressHydrationWarning!==!0&&Ol(h.textContent,D,n),v=["children",""+D]):o.hasOwnProperty(R)&&D!=null&&R==="onScroll"&&ct("scroll",h)}switch(l){case"input":Me(h),xe(h,x,!0);break;case"textarea":Me(h),Xe(h);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(h.onclick=Pl)}h=v,i.updateQueue=h,h!==null&&(i.flags|=4)}else{R=v.nodeType===9?v:v.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=wt(l)),n==="http://www.w3.org/1999/xhtml"?l==="script"?(n=R.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof h.is=="string"?n=R.createElement(l,{is:h.is}):(n=R.createElement(l),l==="select"&&(R=n,h.multiple?R.multiple=!0:h.size&&(R.size=h.size))):n=R.createElementNS(n,l),n[gr]=i,n[sa]=h,Jw(n,i,!1,!1),i.stateNode=n;e:{switch(R=lt(l,h),l){case"dialog":ct("cancel",n),ct("close",n),v=h;break;case"iframe":case"object":case"embed":ct("load",n),v=h;break;case"video":case"audio":for(v=0;v<ta.length;v++)ct(ta[v],n);v=h;break;case"source":ct("error",n),v=h;break;case"img":case"image":case"link":ct("error",n),ct("load",n),v=h;break;case"details":ct("toggle",n),v=h;break;case"input":ke(n,h),v=Ie(n,h),ct("invalid",n);break;case"option":v=h;break;case"select":n._wrapperState={wasMultiple:!!h.multiple},v=H({},h,{value:void 0}),ct("invalid",n);break;case"textarea":Be(n,h),v=ot(n,h),ct("invalid",n);break;default:v=h}Ve(l,v),D=v;for(x in D)if(D.hasOwnProperty(x)){var K=D[x];x==="style"?Ce(n,K):x==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&De(n,K)):x==="children"?typeof K=="string"?(l!=="textarea"||K!=="")&&Re(n,K):typeof K=="number"&&Re(n,""+K):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(o.hasOwnProperty(x)?K!=null&&x==="onScroll"&&ct("scroll",n):K!=null&&C(n,x,K,R))}switch(l){case"input":Me(n),xe(n,h,!1);break;case"textarea":Me(n),Xe(n);break;case"option":h.value!=null&&n.setAttribute("value",""+fe(h.value));break;case"select":n.multiple=!!h.multiple,x=h.value,x!=null?ft(n,!!h.multiple,x,!1):h.defaultValue!=null&&ft(n,!!h.multiple,h.defaultValue,!0);break;default:typeof v.onClick=="function"&&(n.onclick=Pl)}switch(l){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return Vt(i),null;case 6:if(n&&i.stateNode!=null)tx(n,i,n.memoizedProps,h);else{if(typeof h!="string"&&i.stateNode===null)throw Error(r(166));if(l=Gs(ua.current),Gs(vr.current),Bl(i)){if(h=i.stateNode,l=i.memoizedProps,h[gr]=i,(x=h.nodeValue!==l)&&(n=pn,n!==null))switch(n.tag){case 3:Ol(h.nodeValue,l,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Ol(h.nodeValue,l,(n.mode&1)!==0)}x&&(i.flags|=4)}else h=(l.nodeType===9?l:l.ownerDocument).createTextNode(h),h[gr]=i,i.stateNode=h}return Vt(i),null;case 13:if(dt(vt),h=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(pt&&mn!==null&&(i.mode&1)!==0&&(i.flags&128)===0)sw(),Wi(),i.flags|=98560,x=!1;else if(x=Bl(i),h!==null&&h.dehydrated!==null){if(n===null){if(!x)throw Error(r(318));if(x=i.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[gr]=i}else Wi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Vt(i),x=!1}else Xn!==null&&(Zd(Xn),Xn=null),x=!0;if(!x)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=l,i):(h=h!==null,h!==(n!==null&&n.memoizedState!==null)&&h&&(i.child.flags|=8192,(i.mode&1)!==0&&(n===null||(vt.current&1)!==0?Rt===0&&(Rt=3):tf())),i.updateQueue!==null&&(i.flags|=4),Vt(i),null);case 4:return Ki(),zd(n,i),n===null&&na(i.stateNode.containerInfo),Vt(i),null;case 10:return md(i.type._context),Vt(i),null;case 17:return rn(i.type)&&$l(),Vt(i),null;case 19:if(dt(vt),x=i.memoizedState,x===null)return Vt(i),null;if(h=(i.flags&128)!==0,R=x.rendering,R===null)if(h)pa(x,!1);else{if(Rt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(R=Yl(n),R!==null){for(i.flags|=128,pa(x,!1),h=R.updateQueue,h!==null&&(i.updateQueue=h,i.flags|=4),i.subtreeFlags=0,h=l,l=i.child;l!==null;)x=l,n=h,x.flags&=14680066,R=x.alternate,R===null?(x.childLanes=0,x.lanes=n,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=R.childLanes,x.lanes=R.lanes,x.child=R.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=R.memoizedProps,x.memoizedState=R.memoizedState,x.updateQueue=R.updateQueue,x.type=R.type,n=R.dependencies,x.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),l=l.sibling;return ut(vt,vt.current&1|2),i.child}n=n.sibling}x.tail!==null&&st()>Ji&&(i.flags|=128,h=!0,pa(x,!1),i.lanes=4194304)}else{if(!h)if(n=Yl(R),n!==null){if(i.flags|=128,h=!0,l=n.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),pa(x,!0),x.tail===null&&x.tailMode==="hidden"&&!R.alternate&&!pt)return Vt(i),null}else 2*st()-x.renderingStartTime>Ji&&l!==1073741824&&(i.flags|=128,h=!0,pa(x,!1),i.lanes=4194304);x.isBackwards?(R.sibling=i.child,i.child=R):(l=x.last,l!==null?l.sibling=R:i.child=R,x.last=R)}return x.tail!==null?(i=x.tail,x.rendering=i,x.tail=i.sibling,x.renderingStartTime=st(),i.sibling=null,l=vt.current,ut(vt,h?l&1|2:l&1),i):(Vt(i),null);case 22:case 23:return ef(),h=i.memoizedState!==null,n!==null&&n.memoizedState!==null!==h&&(i.flags|=8192),h&&(i.mode&1)!==0?(gn&1073741824)!==0&&(Vt(i),i.subtreeFlags&6&&(i.flags|=8192)):Vt(i),null;case 24:return null;case 25:return null}throw Error(r(156,i.tag))}function YR(n,i){switch(ud(i),i.tag){case 1:return rn(i.type)&&$l(),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Ki(),dt(nn),dt(Ht),bd(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 5:return xd(i),null;case 13:if(dt(vt),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Wi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return dt(vt),null;case 4:return Ki(),null;case 10:return md(i.type._context),null;case 22:case 23:return ef(),null;case 24:return null;default:return null}}var ru=!1,Gt=!1,KR=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function Qi(n,i){var l=n.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(h){_t(n,i,h)}else l.current=null}function Bd(n,i,l){try{l()}catch(h){_t(n,i,h)}}var nx=!1;function XR(n,i){if(ed=Gn,n=O0(),Vc(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var h=l.getSelection&&l.getSelection();if(h&&h.rangeCount!==0){l=h.anchorNode;var v=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{l.nodeType,x.nodeType}catch{l=null;break e}var R=0,D=-1,K=-1,ie=0,me=0,ge=n,he=null;t:for(;;){for(var be;ge!==l||v!==0&&ge.nodeType!==3||(D=R+v),ge!==x||h!==0&&ge.nodeType!==3||(K=R+h),ge.nodeType===3&&(R+=ge.nodeValue.length),(be=ge.firstChild)!==null;)he=ge,ge=be;for(;;){if(ge===n)break t;if(he===l&&++ie===v&&(D=R),he===x&&++me===h&&(K=R),(be=ge.nextSibling)!==null)break;ge=he,he=ge.parentNode}ge=be}l=D===-1||K===-1?null:{start:D,end:K}}else l=null}l=l||{start:0,end:0}}else l=null;for(td={focusedElem:n,selectionRange:l},Gn=!1,Ee=i;Ee!==null;)if(i=Ee,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Ee=n;else for(;Ee!==null;){i=Ee;try{var Ne=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var je=Ne.memoizedProps,St=Ne.memoizedState,re=i.stateNode,J=re.getSnapshotBeforeUpdate(i.elementType===i.type?je:Qn(i.type,je),St);re.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var se=i.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ve){_t(i,i.return,ve)}if(n=i.sibling,n!==null){n.return=i.return,Ee=n;break}Ee=i.return}return Ne=nx,nx=!1,Ne}function ma(n,i,l){var h=i.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var v=h=h.next;do{if((v.tag&n)===n){var x=v.destroy;v.destroy=void 0,x!==void 0&&Bd(i,l,x)}v=v.next}while(v!==h)}}function su(n,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&n)===n){var h=l.create;l.destroy=h()}l=l.next}while(l!==i)}}function Ud(n){var i=n.ref;if(i!==null){var l=n.stateNode;switch(n.tag){case 5:n=l;break;default:n=l}typeof i=="function"?i(n):i.current=n}}function rx(n){var i=n.alternate;i!==null&&(n.alternate=null,rx(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&(delete i[gr],delete i[sa],delete i[id],delete i[IR],delete i[MR])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function sx(n){return n.tag===5||n.tag===3||n.tag===4}function ix(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||sx(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Hd(n,i,l){var h=n.tag;if(h===5||h===6)n=n.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(n,i):l.insertBefore(n,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(n,l)):(i=l,i.appendChild(n)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Pl));else if(h!==4&&(n=n.child,n!==null))for(Hd(n,i,l),n=n.sibling;n!==null;)Hd(n,i,l),n=n.sibling}function Wd(n,i,l){var h=n.tag;if(h===5||h===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(h!==4&&(n=n.child,n!==null))for(Wd(n,i,l),n=n.sibling;n!==null;)Wd(n,i,l),n=n.sibling}var Dt=null,Zn=!1;function ms(n,i,l){for(l=l.child;l!==null;)ox(n,i,l),l=l.sibling}function ox(n,i,l){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(jr,l)}catch{}switch(l.tag){case 5:Gt||Qi(l,i);case 6:var h=Dt,v=Zn;Dt=null,ms(n,i,l),Dt=h,Zn=v,Dt!==null&&(Zn?(n=Dt,l=l.stateNode,n.nodeType===8?n.parentNode.removeChild(l):n.removeChild(l)):Dt.removeChild(l.stateNode));break;case 18:Dt!==null&&(Zn?(n=Dt,l=l.stateNode,n.nodeType===8?sd(n.parentNode,l):n.nodeType===1&&sd(n,l),Ps(n)):sd(Dt,l.stateNode));break;case 4:h=Dt,v=Zn,Dt=l.stateNode.containerInfo,Zn=!0,ms(n,i,l),Dt=h,Zn=v;break;case 0:case 11:case 14:case 15:if(!Gt&&(h=l.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){v=h=h.next;do{var x=v,R=x.destroy;x=x.tag,R!==void 0&&((x&2)!==0||(x&4)!==0)&&Bd(l,i,R),v=v.next}while(v!==h)}ms(n,i,l);break;case 1:if(!Gt&&(Qi(l,i),h=l.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=l.memoizedProps,h.state=l.memoizedState,h.componentWillUnmount()}catch(D){_t(l,i,D)}ms(n,i,l);break;case 21:ms(n,i,l);break;case 22:l.mode&1?(Gt=(h=Gt)||l.memoizedState!==null,ms(n,i,l),Gt=h):ms(n,i,l);break;default:ms(n,i,l)}}function ax(n){var i=n.updateQueue;if(i!==null){n.updateQueue=null;var l=n.stateNode;l===null&&(l=n.stateNode=new KR),i.forEach(function(h){var v=iA.bind(null,n,h);l.has(h)||(l.add(h),h.then(v,v))})}}function Jn(n,i){var l=i.deletions;if(l!==null)for(var h=0;h<l.length;h++){var v=l[h];try{var x=n,R=i,D=R;e:for(;D!==null;){switch(D.tag){case 5:Dt=D.stateNode,Zn=!1;break e;case 3:Dt=D.stateNode.containerInfo,Zn=!0;break e;case 4:Dt=D.stateNode.containerInfo,Zn=!0;break e}D=D.return}if(Dt===null)throw Error(r(160));ox(x,R,v),Dt=null,Zn=!1;var K=v.alternate;K!==null&&(K.return=null),v.return=null}catch(ie){_t(v,i,ie)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)lx(i,n),i=i.sibling}function lx(n,i){var l=n.alternate,h=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Jn(i,n),wr(n),h&4){try{ma(3,n,n.return),su(3,n)}catch(je){_t(n,n.return,je)}try{ma(5,n,n.return)}catch(je){_t(n,n.return,je)}}break;case 1:Jn(i,n),wr(n),h&512&&l!==null&&Qi(l,l.return);break;case 5:if(Jn(i,n),wr(n),h&512&&l!==null&&Qi(l,l.return),n.flags&32){var v=n.stateNode;try{Re(v,"")}catch(je){_t(n,n.return,je)}}if(h&4&&(v=n.stateNode,v!=null)){var x=n.memoizedProps,R=l!==null?l.memoizedProps:x,D=n.type,K=n.updateQueue;if(n.updateQueue=null,K!==null)try{D==="input"&&x.type==="radio"&&x.name!=null&&le(v,x),lt(D,R);var ie=lt(D,x);for(R=0;R<K.length;R+=2){var me=K[R],ge=K[R+1];me==="style"?Ce(v,ge):me==="dangerouslySetInnerHTML"?De(v,ge):me==="children"?Re(v,ge):C(v,me,ge,ie)}switch(D){case"input":we(v,x);break;case"textarea":et(v,x);break;case"select":var he=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!x.multiple;var be=x.value;be!=null?ft(v,!!x.multiple,be,!1):he!==!!x.multiple&&(x.defaultValue!=null?ft(v,!!x.multiple,x.defaultValue,!0):ft(v,!!x.multiple,x.multiple?[]:"",!1))}v[sa]=x}catch(je){_t(n,n.return,je)}}break;case 6:if(Jn(i,n),wr(n),h&4){if(n.stateNode===null)throw Error(r(162));v=n.stateNode,x=n.memoizedProps;try{v.nodeValue=x}catch(je){_t(n,n.return,je)}}break;case 3:if(Jn(i,n),wr(n),h&4&&l!==null&&l.memoizedState.isDehydrated)try{Ps(i.containerInfo)}catch(je){_t(n,n.return,je)}break;case 4:Jn(i,n),wr(n);break;case 13:Jn(i,n),wr(n),v=n.child,v.flags&8192&&(x=v.memoizedState!==null,v.stateNode.isHidden=x,!x||v.alternate!==null&&v.alternate.memoizedState!==null||(Yd=st())),h&4&&ax(n);break;case 22:if(me=l!==null&&l.memoizedState!==null,n.mode&1?(Gt=(ie=Gt)||me,Jn(i,n),Gt=ie):Jn(i,n),wr(n),h&8192){if(ie=n.memoizedState!==null,(n.stateNode.isHidden=ie)&&!me&&(n.mode&1)!==0)for(Ee=n,me=n.child;me!==null;){for(ge=Ee=me;Ee!==null;){switch(he=Ee,be=he.child,he.tag){case 0:case 11:case 14:case 15:ma(4,he,he.return);break;case 1:Qi(he,he.return);var Ne=he.stateNode;if(typeof Ne.componentWillUnmount=="function"){h=he,l=he.return;try{i=h,Ne.props=i.memoizedProps,Ne.state=i.memoizedState,Ne.componentWillUnmount()}catch(je){_t(h,l,je)}}break;case 5:Qi(he,he.return);break;case 22:if(he.memoizedState!==null){dx(ge);continue}}be!==null?(be.return=he,Ee=be):dx(ge)}me=me.sibling}e:for(me=null,ge=n;;){if(ge.tag===5){if(me===null){me=ge;try{v=ge.stateNode,ie?(x=v.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(D=ge.stateNode,K=ge.memoizedProps.style,R=K!=null&&K.hasOwnProperty("display")?K.display:null,D.style.display=tt("display",R))}catch(je){_t(n,n.return,je)}}}else if(ge.tag===6){if(me===null)try{ge.stateNode.nodeValue=ie?"":ge.memoizedProps}catch(je){_t(n,n.return,je)}}else if((ge.tag!==22&&ge.tag!==23||ge.memoizedState===null||ge===n)&&ge.child!==null){ge.child.return=ge,ge=ge.child;continue}if(ge===n)break e;for(;ge.sibling===null;){if(ge.return===null||ge.return===n)break e;me===ge&&(me=null),ge=ge.return}me===ge&&(me=null),ge.sibling.return=ge.return,ge=ge.sibling}}break;case 19:Jn(i,n),wr(n),h&4&&ax(n);break;case 21:break;default:Jn(i,n),wr(n)}}function wr(n){var i=n.flags;if(i&2){try{e:{for(var l=n.return;l!==null;){if(sx(l)){var h=l;break e}l=l.return}throw Error(r(160))}switch(h.tag){case 5:var v=h.stateNode;h.flags&32&&(Re(v,""),h.flags&=-33);var x=ix(n);Wd(n,x,v);break;case 3:case 4:var R=h.stateNode.containerInfo,D=ix(n);Hd(n,D,R);break;default:throw Error(r(161))}}catch(K){_t(n,n.return,K)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function QR(n,i,l){Ee=n,ux(n)}function ux(n,i,l){for(var h=(n.mode&1)!==0;Ee!==null;){var v=Ee,x=v.child;if(v.tag===22&&h){var R=v.memoizedState!==null||ru;if(!R){var D=v.alternate,K=D!==null&&D.memoizedState!==null||Gt;D=ru;var ie=Gt;if(ru=R,(Gt=K)&&!ie)for(Ee=v;Ee!==null;)R=Ee,K=R.child,R.tag===22&&R.memoizedState!==null?fx(v):K!==null?(K.return=R,Ee=K):fx(v);for(;x!==null;)Ee=x,ux(x),x=x.sibling;Ee=v,ru=D,Gt=ie}cx(n)}else(v.subtreeFlags&8772)!==0&&x!==null?(x.return=v,Ee=x):cx(n)}}function cx(n){for(;Ee!==null;){var i=Ee;if((i.flags&8772)!==0){var l=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:Gt||su(5,i);break;case 1:var h=i.stateNode;if(i.flags&4&&!Gt)if(l===null)h.componentDidMount();else{var v=i.elementType===i.type?l.memoizedProps:Qn(i.type,l.memoizedProps);h.componentDidUpdate(v,l.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var x=i.updateQueue;x!==null&&dw(i,x,h);break;case 3:var R=i.updateQueue;if(R!==null){if(l=null,i.child!==null)switch(i.child.tag){case 5:l=i.child.stateNode;break;case 1:l=i.child.stateNode}dw(i,R,l)}break;case 5:var D=i.stateNode;if(l===null&&i.flags&4){l=D;var K=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&l.focus();break;case"img":K.src&&(l.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var ie=i.alternate;if(ie!==null){var me=ie.memoizedState;if(me!==null){var ge=me.dehydrated;ge!==null&&Ps(ge)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Gt||i.flags&512&&Ud(i)}catch(he){_t(i,i.return,he)}}if(i===n){Ee=null;break}if(l=i.sibling,l!==null){l.return=i.return,Ee=l;break}Ee=i.return}}function dx(n){for(;Ee!==null;){var i=Ee;if(i===n){Ee=null;break}var l=i.sibling;if(l!==null){l.return=i.return,Ee=l;break}Ee=i.return}}function fx(n){for(;Ee!==null;){var i=Ee;try{switch(i.tag){case 0:case 11:case 15:var l=i.return;try{su(4,i)}catch(K){_t(i,l,K)}break;case 1:var h=i.stateNode;if(typeof h.componentDidMount=="function"){var v=i.return;try{h.componentDidMount()}catch(K){_t(i,v,K)}}var x=i.return;try{Ud(i)}catch(K){_t(i,x,K)}break;case 5:var R=i.return;try{Ud(i)}catch(K){_t(i,R,K)}}}catch(K){_t(i,i.return,K)}if(i===n){Ee=null;break}var D=i.sibling;if(D!==null){D.return=i.return,Ee=D;break}Ee=i.return}}var ZR=Math.ceil,iu=T.ReactCurrentDispatcher,Vd=T.ReactCurrentOwner,On=T.ReactCurrentBatchConfig,Qe=0,Lt=null,Et=null,Ft=0,gn=0,Zi=cs(0),Rt=0,ga=null,Ks=0,ou=0,Gd=0,va=null,on=null,Yd=0,Ji=1/0,Br=null,au=!1,Kd=null,gs=null,lu=!1,vs=null,uu=0,ya=0,Xd=null,cu=-1,du=0;function en(){return(Qe&6)!==0?st():cu!==-1?cu:cu=st()}function ys(n){return(n.mode&1)===0?1:(Qe&2)!==0&&Ft!==0?Ft&-Ft:PR.transition!==null?(du===0&&(du=Io()),du):(n=Je,n!==0||(n=window.event,n=n===void 0?16:Xt(n.type)),n)}function er(n,i,l,h){if(50<ya)throw ya=0,Xd=null,Error(r(185));Os(n,l,h),((Qe&2)===0||n!==Lt)&&(n===Lt&&((Qe&2)===0&&(ou|=l),Rt===4&&ws(n,Ft)),an(n,h),l===1&&Qe===0&&(i.mode&1)===0&&(Ji=st()+500,Dl&&fs()))}function an(n,i){var l=n.callbackNode;$c(n,i);var h=Tr(n,n===Lt?Ft:0);if(h===0)l!==null&&Zr(l),n.callbackNode=null,n.callbackPriority=0;else if(i=h&-h,n.callbackPriority!==i){if(l!=null&&Zr(l),i===1)n.tag===0?OR(px.bind(null,n)):J0(px.bind(null,n)),RR(function(){(Qe&6)===0&&fs()}),l=null;else{switch(Oo(h)){case 1:l=Is;break;case 4:l=Sn;break;case 16:l=Un;break;case 536870912:l=ki;break;default:l=Un}l=bx(l,hx.bind(null,n))}n.callbackPriority=i,n.callbackNode=l}}function hx(n,i){if(cu=-1,du=0,(Qe&6)!==0)throw Error(r(327));var l=n.callbackNode;if(eo()&&n.callbackNode!==l)return null;var h=Tr(n,n===Lt?Ft:0);if(h===0)return null;if((h&30)!==0||(h&n.expiredLanes)!==0||i)i=fu(n,h);else{i=h;var v=Qe;Qe|=2;var x=gx();(Lt!==n||Ft!==i)&&(Br=null,Ji=st()+500,Qs(n,i));do try{tA();break}catch(D){mx(n,D)}while(!0);pd(),iu.current=x,Qe=v,Et!==null?i=0:(Lt=null,Ft=0,i=Rt)}if(i!==0){if(i===2&&(v=Rr(n),v!==0&&(h=v,i=Qd(n,v))),i===1)throw l=ga,Qs(n,0),ws(n,h),an(n,st()),l;if(i===6)ws(n,h);else{if(v=n.current.alternate,(h&30)===0&&!JR(v)&&(i=fu(n,h),i===2&&(x=Rr(n),x!==0&&(h=x,i=Qd(n,x))),i===1))throw l=ga,Qs(n,0),ws(n,h),an(n,st()),l;switch(n.finishedWork=v,n.finishedLanes=h,i){case 0:case 1:throw Error(r(345));case 2:Zs(n,on,Br);break;case 3:if(ws(n,h),(h&130023424)===h&&(i=Yd+500-st(),10<i)){if(Tr(n,0)!==0)break;if(v=n.suspendedLanes,(v&h)!==h){en(),n.pingedLanes|=n.suspendedLanes&v;break}n.timeoutHandle=rd(Zs.bind(null,n,on,Br),i);break}Zs(n,on,Br);break;case 4:if(ws(n,h),(h&4194240)===h)break;for(i=n.eventTimes,v=-1;0<h;){var R=31-tn(h);x=1<<R,R=i[R],R>v&&(v=R),h&=~x}if(h=v,h=st()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*ZR(h/1960))-h,10<h){n.timeoutHandle=rd(Zs.bind(null,n,on,Br),h);break}Zs(n,on,Br);break;case 5:Zs(n,on,Br);break;default:throw Error(r(329))}}}return an(n,st()),n.callbackNode===l?hx.bind(null,n):null}function Qd(n,i){var l=va;return n.current.memoizedState.isDehydrated&&(Qs(n,i).flags|=256),n=fu(n,i),n!==2&&(i=on,on=l,i!==null&&Zd(i)),n}function Zd(n){on===null?on=n:on.push.apply(on,n)}function JR(n){for(var i=n;;){if(i.flags&16384){var l=i.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var h=0;h<l.length;h++){var v=l[h],x=v.getSnapshot;v=v.value;try{if(!nt(x(),v))return!1}catch{return!1}}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ws(n,i){for(i&=~Gd,i&=~ou,n.suspendedLanes|=i,n.pingedLanes&=~i,n=n.expirationTimes;0<i;){var l=31-tn(i),h=1<<l;n[l]=-1,i&=~h}}function px(n){if((Qe&6)!==0)throw Error(r(327));eo();var i=Tr(n,0);if((i&1)===0)return an(n,st()),null;var l=fu(n,i);if(n.tag!==0&&l===2){var h=Rr(n);h!==0&&(i=h,l=Qd(n,h))}if(l===1)throw l=ga,Qs(n,0),ws(n,i),an(n,st()),l;if(l===6)throw Error(r(345));return n.finishedWork=n.current.alternate,n.finishedLanes=i,Zs(n,on,Br),an(n,st()),null}function Jd(n,i){var l=Qe;Qe|=1;try{return n(i)}finally{Qe=l,Qe===0&&(Ji=st()+500,Dl&&fs())}}function Xs(n){vs!==null&&vs.tag===0&&(Qe&6)===0&&eo();var i=Qe;Qe|=1;var l=On.transition,h=Je;try{if(On.transition=null,Je=1,n)return n()}finally{Je=h,On.transition=l,Qe=i,(Qe&6)===0&&fs()}}function ef(){gn=Zi.current,dt(Zi)}function Qs(n,i){n.finishedWork=null,n.finishedLanes=0;var l=n.timeoutHandle;if(l!==-1&&(n.timeoutHandle=-1,TR(l)),Et!==null)for(l=Et.return;l!==null;){var h=l;switch(ud(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&$l();break;case 3:Ki(),dt(nn),dt(Ht),bd();break;case 5:xd(h);break;case 4:Ki();break;case 13:dt(vt);break;case 19:dt(vt);break;case 10:md(h.type._context);break;case 22:case 23:ef()}l=l.return}if(Lt=n,Et=n=xs(n.current,null),Ft=gn=i,Rt=0,ga=null,Gd=ou=Ks=0,on=va=null,Vs!==null){for(i=0;i<Vs.length;i++)if(l=Vs[i],h=l.interleaved,h!==null){l.interleaved=null;var v=h.next,x=l.pending;if(x!==null){var R=x.next;x.next=v,h.next=R}l.pending=h}Vs=null}return n}function mx(n,i){do{var l=Et;try{if(pd(),Kl.current=Jl,Xl){for(var h=yt.memoizedState;h!==null;){var v=h.queue;v!==null&&(v.pending=null),h=h.next}Xl=!1}if(Ys=0,Pt=Tt=yt=null,ca=!1,da=0,Vd.current=null,l===null||l.return===null){Rt=1,ga=i,Et=null;break}e:{var x=n,R=l.return,D=l,K=i;if(i=Ft,D.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var ie=K,me=D,ge=me.tag;if((me.mode&1)===0&&(ge===0||ge===11||ge===15)){var he=me.alternate;he?(me.updateQueue=he.updateQueue,me.memoizedState=he.memoizedState,me.lanes=he.lanes):(me.updateQueue=null,me.memoizedState=null)}var be=Fw(R);if(be!==null){be.flags&=-257,zw(be,R,D,x,i),be.mode&1&&Dw(x,ie,i),i=be,K=ie;var Ne=i.updateQueue;if(Ne===null){var je=new Set;je.add(K),i.updateQueue=je}else Ne.add(K);break e}else{if((i&1)===0){Dw(x,ie,i),tf();break e}K=Error(r(426))}}else if(pt&&D.mode&1){var St=Fw(R);if(St!==null){(St.flags&65536)===0&&(St.flags|=256),zw(St,R,D,x,i),fd(Xi(K,D));break e}}x=K=Xi(K,D),Rt!==4&&(Rt=2),va===null?va=[x]:va.push(x),x=R;do{switch(x.tag){case 3:x.flags|=65536,i&=-i,x.lanes|=i;var re=$w(x,K,i);cw(x,re);break e;case 1:D=K;var J=x.type,se=x.stateNode;if((x.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(gs===null||!gs.has(se)))){x.flags|=65536,i&=-i,x.lanes|=i;var ve=qw(x,D,i);cw(x,ve);break e}}x=x.return}while(x!==null)}yx(l)}catch(Te){i=Te,Et===l&&l!==null&&(Et=l=l.return);continue}break}while(!0)}function gx(){var n=iu.current;return iu.current=Jl,n===null?Jl:n}function tf(){(Rt===0||Rt===3||Rt===2)&&(Rt=4),Lt===null||(Ks&268435455)===0&&(ou&268435455)===0||ws(Lt,Ft)}function fu(n,i){var l=Qe;Qe|=2;var h=gx();(Lt!==n||Ft!==i)&&(Br=null,Qs(n,i));do try{eA();break}catch(v){mx(n,v)}while(!0);if(pd(),Qe=l,iu.current=h,Et!==null)throw Error(r(261));return Lt=null,Ft=0,Rt}function eA(){for(;Et!==null;)vx(Et)}function tA(){for(;Et!==null&&!xt();)vx(Et)}function vx(n){var i=_x(n.alternate,n,gn);n.memoizedProps=n.pendingProps,i===null?yx(n):Et=i,Vd.current=null}function yx(n){var i=n;do{var l=i.alternate;if(n=i.return,(i.flags&32768)===0){if(l=GR(l,i,gn),l!==null){Et=l;return}}else{if(l=YR(l,i),l!==null){l.flags&=32767,Et=l;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{Rt=6,Et=null;return}}if(i=i.sibling,i!==null){Et=i;return}Et=i=n}while(i!==null);Rt===0&&(Rt=5)}function Zs(n,i,l){var h=Je,v=On.transition;try{On.transition=null,Je=1,nA(n,i,l,h)}finally{On.transition=v,Je=h}return null}function nA(n,i,l,h){do eo();while(vs!==null);if((Qe&6)!==0)throw Error(r(327));l=n.finishedWork;var v=n.finishedLanes;if(l===null)return null;if(n.finishedWork=null,n.finishedLanes=0,l===n.current)throw Error(r(177));n.callbackNode=null,n.callbackPriority=0;var x=l.lanes|l.childLanes;if(fl(n,x),n===Lt&&(Et=Lt=null,Ft=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||lu||(lu=!0,bx(Un,function(){return eo(),null})),x=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||x){x=On.transition,On.transition=null;var R=Je;Je=1;var D=Qe;Qe|=4,Vd.current=null,XR(n,l),lx(l,n),bR(td),Gn=!!ed,td=ed=null,n.current=l,QR(l),Ro(),Qe=D,Je=R,On.transition=x}else n.current=l;if(lu&&(lu=!1,vs=n,uu=v),x=n.pendingLanes,x===0&&(gs=null),En(l.stateNode),an(n,st()),i!==null)for(h=n.onRecoverableError,l=0;l<i.length;l++)v=i[l],h(v.value,{componentStack:v.stack,digest:v.digest});if(au)throw au=!1,n=Kd,Kd=null,n;return(uu&1)!==0&&n.tag!==0&&eo(),x=n.pendingLanes,(x&1)!==0?n===Xd?ya++:(ya=0,Xd=n):ya=0,fs(),null}function eo(){if(vs!==null){var n=Oo(uu),i=On.transition,l=Je;try{if(On.transition=null,Je=16>n?16:n,vs===null)var h=!1;else{if(n=vs,vs=null,uu=0,(Qe&6)!==0)throw Error(r(331));var v=Qe;for(Qe|=4,Ee=n.current;Ee!==null;){var x=Ee,R=x.child;if((Ee.flags&16)!==0){var D=x.deletions;if(D!==null){for(var K=0;K<D.length;K++){var ie=D[K];for(Ee=ie;Ee!==null;){var me=Ee;switch(me.tag){case 0:case 11:case 15:ma(8,me,x)}var ge=me.child;if(ge!==null)ge.return=me,Ee=ge;else for(;Ee!==null;){me=Ee;var he=me.sibling,be=me.return;if(rx(me),me===ie){Ee=null;break}if(he!==null){he.return=be,Ee=he;break}Ee=be}}}var Ne=x.alternate;if(Ne!==null){var je=Ne.child;if(je!==null){Ne.child=null;do{var St=je.sibling;je.sibling=null,je=St}while(je!==null)}}Ee=x}}if((x.subtreeFlags&2064)!==0&&R!==null)R.return=x,Ee=R;else e:for(;Ee!==null;){if(x=Ee,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:ma(9,x,x.return)}var re=x.sibling;if(re!==null){re.return=x.return,Ee=re;break e}Ee=x.return}}var J=n.current;for(Ee=J;Ee!==null;){R=Ee;var se=R.child;if((R.subtreeFlags&2064)!==0&&se!==null)se.return=R,Ee=se;else e:for(R=J;Ee!==null;){if(D=Ee,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:su(9,D)}}catch(Te){_t(D,D.return,Te)}if(D===R){Ee=null;break e}var ve=D.sibling;if(ve!==null){ve.return=D.return,Ee=ve;break e}Ee=D.return}}if(Qe=v,fs(),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(jr,n)}catch{}h=!0}return h}finally{Je=l,On.transition=i}}return!1}function wx(n,i,l){i=Xi(l,i),i=$w(n,i,1),n=ps(n,i,1),i=en(),n!==null&&(Os(n,1,i),an(n,i))}function _t(n,i,l){if(n.tag===3)wx(n,n,l);else for(;i!==null;){if(i.tag===3){wx(i,n,l);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(gs===null||!gs.has(h))){n=Xi(l,n),n=qw(i,n,1),i=ps(i,n,1),n=en(),i!==null&&(Os(i,1,n),an(i,n));break}}i=i.return}}function rA(n,i,l){var h=n.pingCache;h!==null&&h.delete(i),i=en(),n.pingedLanes|=n.suspendedLanes&l,Lt===n&&(Ft&l)===l&&(Rt===4||Rt===3&&(Ft&130023424)===Ft&&500>st()-Yd?Qs(n,0):Gd|=l),an(n,i)}function xx(n,i){i===0&&((n.mode&1)===0?i=1:(i=Mt,Mt<<=1,(Mt&130023424)===0&&(Mt=4194304)));var l=en();n=Dr(n,i),n!==null&&(Os(n,i,l),an(n,l))}function sA(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),xx(n,l)}function iA(n,i){var l=0;switch(n.tag){case 13:var h=n.stateNode,v=n.memoizedState;v!==null&&(l=v.retryLane);break;case 19:h=n.stateNode;break;default:throw Error(r(314))}h!==null&&h.delete(i),xx(n,l)}var _x;_x=function(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps||nn.current)sn=!0;else{if((n.lanes&l)===0&&(i.flags&128)===0)return sn=!1,VR(n,i,l);sn=(n.flags&131072)!==0}else sn=!1,pt&&(i.flags&1048576)!==0&&ew(i,zl,i.index);switch(i.lanes=0,i.tag){case 2:var h=i.type;nu(n,i),n=i.pendingProps;var v=Bi(i,Ht.current);Yi(i,l),v=Ed(null,i,h,n,v,l);var x=Nd();return i.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,rn(h)?(x=!0,ql(i)):x=!1,i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,yd(i),v.updater=eu,i.stateNode=v,v._reactInternals=i,Id(i,h,n,l),i=Ld(null,i,h,!0,x,l)):(i.tag=0,pt&&x&&ld(i),Jt(null,i,v,l),i=i.child),i;case 16:h=i.elementType;e:{switch(nu(n,i),n=i.pendingProps,v=h._init,h=v(h._payload),i.type=h,v=i.tag=aA(h),n=Qn(h,n),v){case 0:i=Pd(null,i,h,n,l);break e;case 1:i=Gw(null,i,h,n,l);break e;case 11:i=Bw(null,i,h,n,l);break e;case 14:i=Uw(null,i,h,Qn(h.type,n),l);break e}throw Error(r(306,h,""))}return i;case 0:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:Qn(h,v),Pd(n,i,h,v,l);case 1:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:Qn(h,v),Gw(n,i,h,v,l);case 3:e:{if(Yw(i),n===null)throw Error(r(387));h=i.pendingProps,x=i.memoizedState,v=x.element,uw(n,i),Gl(i,h,null,l);var R=i.memoizedState;if(h=R.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){v=Xi(Error(r(423)),i),i=Kw(n,i,h,l,v);break e}else if(h!==v){v=Xi(Error(r(424)),i),i=Kw(n,i,h,l,v);break e}else for(mn=us(i.stateNode.containerInfo.firstChild),pn=i,pt=!0,Xn=null,l=aw(i,null,h,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Wi(),h===v){i=zr(n,i,l);break e}Jt(n,i,h,l)}i=i.child}return i;case 5:return fw(i),n===null&&dd(i),h=i.type,v=i.pendingProps,x=n!==null?n.memoizedProps:null,R=v.children,nd(h,v)?R=null:x!==null&&nd(h,x)&&(i.flags|=32),Vw(n,i),Jt(n,i,R,l),i.child;case 6:return n===null&&dd(i),null;case 13:return Xw(n,i,l);case 4:return wd(i,i.stateNode.containerInfo),h=i.pendingProps,n===null?i.child=Vi(i,null,h,l):Jt(n,i,h,l),i.child;case 11:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:Qn(h,v),Bw(n,i,h,v,l);case 7:return Jt(n,i,i.pendingProps,l),i.child;case 8:return Jt(n,i,i.pendingProps.children,l),i.child;case 12:return Jt(n,i,i.pendingProps.children,l),i.child;case 10:e:{if(h=i.type._context,v=i.pendingProps,x=i.memoizedProps,R=v.value,ut(Hl,h._currentValue),h._currentValue=R,x!==null)if(nt(x.value,R)){if(x.children===v.children&&!nn.current){i=zr(n,i,l);break e}}else for(x=i.child,x!==null&&(x.return=i);x!==null;){var D=x.dependencies;if(D!==null){R=x.child;for(var K=D.firstContext;K!==null;){if(K.context===h){if(x.tag===1){K=Fr(-1,l&-l),K.tag=2;var ie=x.updateQueue;if(ie!==null){ie=ie.shared;var me=ie.pending;me===null?K.next=K:(K.next=me.next,me.next=K),ie.pending=K}}x.lanes|=l,K=x.alternate,K!==null&&(K.lanes|=l),gd(x.return,l,i),D.lanes|=l;break}K=K.next}}else if(x.tag===10)R=x.type===i.type?null:x.child;else if(x.tag===18){if(R=x.return,R===null)throw Error(r(341));R.lanes|=l,D=R.alternate,D!==null&&(D.lanes|=l),gd(R,l,i),R=x.sibling}else R=x.child;if(R!==null)R.return=x;else for(R=x;R!==null;){if(R===i){R=null;break}if(x=R.sibling,x!==null){x.return=R.return,R=x;break}R=R.return}x=R}Jt(n,i,v.children,l),i=i.child}return i;case 9:return v=i.type,h=i.pendingProps.children,Yi(i,l),v=In(v),h=h(v),i.flags|=1,Jt(n,i,h,l),i.child;case 14:return h=i.type,v=Qn(h,i.pendingProps),v=Qn(h.type,v),Uw(n,i,h,v,l);case 15:return Hw(n,i,i.type,i.pendingProps,l);case 17:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:Qn(h,v),nu(n,i),i.tag=1,rn(h)?(n=!0,ql(i)):n=!1,Yi(i,l),Pw(i,h,v),Id(i,h,v,l),Ld(null,i,h,!0,n,l);case 19:return Zw(n,i,l);case 22:return Ww(n,i,l)}throw Error(r(156,i.tag))};function bx(n,i){return _i(n,i)}function oA(n,i,l,h){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pn(n,i,l,h){return new oA(n,i,l,h)}function nf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function aA(n){if(typeof n=="function")return nf(n)?1:0;if(n!=null){if(n=n.$$typeof,n===V)return 11;if(n===G)return 14}return 2}function xs(n,i){var l=n.alternate;return l===null?(l=Pn(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&14680064,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l}function hu(n,i,l,h,v,x){var R=2;if(h=n,typeof n=="function")nf(n)&&(R=1);else if(typeof n=="string")R=5;else e:switch(n){case P:return Js(l.children,v,x,i);case U:R=8,v|=8;break;case O:return n=Pn(12,l,i,v|2),n.elementType=O,n.lanes=x,n;case X:return n=Pn(13,l,i,v),n.elementType=X,n.lanes=x,n;case j:return n=Pn(19,l,i,v),n.elementType=j,n.lanes=x,n;case te:return pu(l,v,x,i);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case M:R=10;break e;case q:R=9;break e;case V:R=11;break e;case G:R=14;break e;case B:R=16,h=null;break e}throw Error(r(130,n==null?n:typeof n,""))}return i=Pn(R,l,i,v),i.elementType=n,i.type=h,i.lanes=x,i}function Js(n,i,l,h){return n=Pn(7,n,h,i),n.lanes=l,n}function pu(n,i,l,h){return n=Pn(22,n,h,i),n.elementType=te,n.lanes=l,n.stateNode={isHidden:!1},n}function rf(n,i,l){return n=Pn(6,n,null,i),n.lanes=l,n}function sf(n,i,l){return i=Pn(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}function lA(n,i,l,h,v){this.tag=i,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hn(0),this.expirationTimes=Hn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hn(0),this.identifierPrefix=h,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function of(n,i,l,h,v,x,R,D,K){return n=new lA(n,i,l,D,K),i===1?(i=1,x===!0&&(i|=8)):i=0,x=Pn(3,null,null,i),n.current=x,x.stateNode=n,x.memoizedState={element:h,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},yd(x),n}function uA(n,i,l){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:h==null?null:""+h,children:n,containerInfo:i,implementation:l}}function kx(n){if(!n)return ds;n=n._reactInternals;e:{if(kn(n)!==n||n.tag!==1)throw Error(r(170));var i=n;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(rn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(r(171))}if(n.tag===1){var l=n.type;if(rn(l))return Q0(n,l,i)}return i}function Sx(n,i,l,h,v,x,R,D,K){return n=of(l,h,!0,n,v,x,R,D,K),n.context=kx(null),l=n.current,h=en(),v=ys(l),x=Fr(h,v),x.callback=i??null,ps(l,x,v),n.current.lanes=v,Os(n,v,h),an(n,h),n}function mu(n,i,l,h){var v=i.current,x=en(),R=ys(v);return l=kx(l),i.context===null?i.context=l:i.pendingContext=l,i=Fr(x,R),i.payload={element:n},h=h===void 0?null:h,h!==null&&(i.callback=h),n=ps(v,i,R),n!==null&&(er(n,v,R,x),Vl(n,v,R)),R}function gu(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function Ex(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function af(n,i){Ex(n,i),(n=n.alternate)&&Ex(n,i)}function cA(){return null}var Nx=typeof reportError=="function"?reportError:function(n){console.error(n)};function lf(n){this._internalRoot=n}vu.prototype.render=lf.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(r(409));mu(n,i,null,null)},vu.prototype.unmount=lf.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Xs(function(){mu(null,n,null,null)}),i[Pr]=null}};function vu(n){this._internalRoot=n}vu.prototype.unstable_scheduleHydration=function(n){if(n){var i=Po();n={blockedOn:null,target:n,priority:i};for(var l=0;l<Tn.length&&i!==0&&i<Tn[l].priority;l++);Tn.splice(l,0,n),l===0&&$o(n)}};function uf(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function yu(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function Cx(){}function dA(n,i,l,h,v){if(v){if(typeof h=="function"){var x=h;h=function(){var ie=gu(R);x.call(ie)}}var R=Sx(i,h,n,0,null,!1,!1,"",Cx);return n._reactRootContainer=R,n[Pr]=R.current,na(n.nodeType===8?n.parentNode:n),Xs(),R}for(;v=n.lastChild;)n.removeChild(v);if(typeof h=="function"){var D=h;h=function(){var ie=gu(K);D.call(ie)}}var K=of(n,0,!1,null,null,!1,!1,"",Cx);return n._reactRootContainer=K,n[Pr]=K.current,na(n.nodeType===8?n.parentNode:n),Xs(function(){mu(i,K,l,h)}),K}function wu(n,i,l,h,v){var x=l._reactRootContainer;if(x){var R=x;if(typeof v=="function"){var D=v;v=function(){var K=gu(R);D.call(K)}}mu(i,R,n,v)}else R=dA(l,i,n,v,h);return gu(R)}hl=function(n){switch(n.tag){case 3:var i=n.stateNode;if(i.current.memoizedState.isDehydrated){var l=dr(i.pendingLanes);l!==0&&(Mo(i,l|1),an(i,st()),(Qe&6)===0&&(Ji=st()+500,fs()))}break;case 13:Xs(function(){var h=Dr(n,1);if(h!==null){var v=en();er(h,n,1,v)}}),af(n,1)}},Wn=function(n){if(n.tag===13){var i=Dr(n,134217728);if(i!==null){var l=en();er(i,n,134217728,l)}af(n,134217728)}},Jr=function(n){if(n.tag===13){var i=ys(n),l=Dr(n,i);if(l!==null){var h=en();er(l,n,i,h)}af(n,i)}},Po=function(){return Je},Ei=function(n,i){var l=Je;try{return Je=n,i()}finally{Je=l}},xn=function(n,i,l){switch(i){case"input":if(we(n,l),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<l.length;i++){var h=l[i];if(h!==n&&h.form===n.form){var v=Ll(h);if(!v)throw Error(r(90));Ue(h),we(h,v)}}}break;case"textarea":et(n,l);break;case"select":i=l.value,i!=null&&ft(n,!!l.multiple,i,!1)}},pi=Jd,mi=Xs;var fA={usingClientEntryPoint:!1,Events:[ia,Fi,Ll,hi,fn,Jd]},wa={findFiberByHostInstance:Bs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hA={bundleType:wa.bundleType,version:wa.version,rendererPackageName:wa.rendererPackageName,rendererConfig:wa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=Bt(n),n===null?null:n.stateNode},findFiberByHostInstance:wa.findFiberByHostInstance||cA,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 xu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xu.isDisabled&&xu.supportsFiber)try{jr=xu.inject(hA),Kt=xu}catch{}}return ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fA,ln.createPortal=function(n,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uf(i))throw Error(r(200));return uA(n,i,null,l)},ln.createRoot=function(n,i){if(!uf(n))throw Error(r(299));var l=!1,h="",v=Nx;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),i=of(n,1,!1,null,null,l,!1,h,v),n[Pr]=i.current,na(n.nodeType===8?n.parentNode:n),new lf(i)},ln.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=Bt(i),n=n===null?null:n.stateNode,n},ln.flushSync=function(n){return Xs(n)},ln.hydrate=function(n,i,l){if(!yu(i))throw Error(r(200));return wu(null,n,i,!0,l)},ln.hydrateRoot=function(n,i,l){if(!uf(n))throw Error(r(405));var h=l!=null&&l.hydratedSources||null,v=!1,x="",R=Nx;if(l!=null&&(l.unstable_strictMode===!0&&(v=!0),l.identifierPrefix!==void 0&&(x=l.identifierPrefix),l.onRecoverableError!==void 0&&(R=l.onRecoverableError)),i=Sx(i,null,n,1,l??null,v,!1,x,R),n[Pr]=i.current,na(n),h)for(n=0;n<h.length;n++)l=h[n],v=l._getVersion,v=v(l._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[l,v]:i.mutableSourceEagerHydrationData.push(l,v);return new vu(i)},ln.render=function(n,i,l){if(!yu(i))throw Error(r(200));return wu(null,n,i,!1,l)},ln.unmountComponentAtNode=function(n){if(!yu(n))throw Error(r(40));return n._reactRootContainer?(Xs(function(){wu(null,null,n,!1,function(){n._reactRootContainer=null,n[Pr]=null})}),!0):!1},ln.unstable_batchedUpdates=Jd,ln.unstable_renderSubtreeIntoContainer=function(n,i,l,h){if(!yu(l))throw Error(r(200));if(n==null||n._reactInternals===void 0)throw Error(r(38));return wu(n,i,l,!1,h)},ln.version="18.3.1-next-f1338f8080-20240426",ln}var Px;function sC(){if(Px)return ff.exports;Px=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(t){console.error(t)}}return e(),ff.exports=xA(),ff.exports}var Lx;function _A(){if(Lx)return bu;Lx=1;var e=sC();return bu.createRoot=e.createRoot,bu.hydrateRoot=e.hydrateRoot,bu}var bA=_A(),N=Ka();const ue=My(N);function zt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,s;r<e.length;r++)(s=zt(e[r]))!==""&&(t+=(t&&" ")+s);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var mf={exports:{}},gf={},vf={exports:{}},yf={};/**
|
|
40
|
+
`+x.stack}return{value:n,source:i,stack:v,digest:null}}function Md(n,i,l){return{value:n,source:null,stack:l??null,digest:i??null}}function Od(n,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var UR=typeof WeakMap=="function"?WeakMap:Map;function qw(n,i,l){l=Fr(-1,l),l.tag=3,l.payload={element:null};var h=i.value;return l.callback=function(){au||(au=!0,Kd=h),Od(n,i)},l}function Dw(n,i,l){l=Fr(-1,l),l.tag=3;var h=n.type.getDerivedStateFromError;if(typeof h=="function"){var v=i.value;l.payload=function(){return h(v)},l.callback=function(){Od(n,i)}}var x=n.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(l.callback=function(){Od(n,i),typeof h!="function"&&(gs===null?gs=new Set([this]):gs.add(this));var R=i.stack;this.componentDidCatch(i.value,{componentStack:R!==null?R:""})}),l}function Fw(n,i,l){var h=n.pingCache;if(h===null){h=n.pingCache=new UR;var v=new Set;h.set(i,v)}else v=h.get(i),v===void 0&&(v=new Set,h.set(i,v));v.has(l)||(v.add(l),n=rA.bind(null,n,i,l),i.then(n,n))}function zw(n){do{var i;if((i=n.tag===13)&&(i=n.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return n;n=n.return}while(n!==null);return null}function Bw(n,i,l,h,v){return(n.mode&1)===0?(n===i?n.flags|=65536:(n.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(i=Fr(-1,1),i.tag=2,ps(l,i,1))),l.lanes|=1),n):(n.flags|=65536,n.lanes=v,n)}var HR=T.ReactCurrentOwner,sn=!1;function Jt(n,i,l,h){i.child=n===null?lw(i,null,l,h):Vi(i,n.child,l,h)}function Uw(n,i,l,h,v){l=l.render;var x=i.ref;return Yi(i,v),h=Ed(n,i,l,h,x,v),l=Nd(),n!==null&&!sn?(i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~v,zr(n,i,v)):(pt&&l&&ld(i),i.flags|=1,Jt(n,i,h,v),i.child)}function Hw(n,i,l,h,v){if(n===null){var x=l.type;return typeof x=="function"&&!nf(x)&&x.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=x,Ww(n,i,x,h,v)):(n=hu(l.type,null,h,i,i.mode,v),n.ref=i.ref,n.return=i,i.child=n)}if(x=n.child,(n.lanes&v)===0){var R=x.memoizedProps;if(l=l.compare,l=l!==null?l:as,l(R,h)&&n.ref===i.ref)return zr(n,i,v)}return i.flags|=1,n=xs(x,h),n.ref=i.ref,n.return=i,i.child=n}function Ww(n,i,l,h,v){if(n!==null){var x=n.memoizedProps;if(as(x,h)&&n.ref===i.ref)if(sn=!1,i.pendingProps=h=x,(n.lanes&v)!==0)(n.flags&131072)!==0&&(sn=!0);else return i.lanes=n.lanes,zr(n,i,v)}return Pd(n,i,l,h,v)}function Vw(n,i,l){var h=i.pendingProps,v=h.children,x=n!==null?n.memoizedState:null;if(h.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(Zi,gn),gn|=l;else{if((l&1073741824)===0)return n=x!==null?x.baseLanes|l:l,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:n,cachePool:null,transitions:null},i.updateQueue=null,ut(Zi,gn),gn|=n,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=x!==null?x.baseLanes:l,ut(Zi,gn),gn|=h}else x!==null?(h=x.baseLanes|l,i.memoizedState=null):h=l,ut(Zi,gn),gn|=h;return Jt(n,i,v,l),i.child}function Gw(n,i){var l=i.ref;(n===null&&l!==null||n!==null&&n.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function Pd(n,i,l,h,v){var x=rn(l)?Us:Ht.current;return x=Bi(i,x),Yi(i,v),l=Ed(n,i,l,h,x,v),h=Nd(),n!==null&&!sn?(i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~v,zr(n,i,v)):(pt&&h&&ld(i),i.flags|=1,Jt(n,i,l,v),i.child)}function Yw(n,i,l,h,v){if(rn(l)){var x=!0;ql(i)}else x=!1;if(Yi(i,v),i.stateNode===null)nu(n,i),Lw(i,l,h),Id(i,l,h,v),h=!0;else if(n===null){var R=i.stateNode,D=i.memoizedProps;R.props=D;var K=R.context,oe=l.contextType;typeof oe=="object"&&oe!==null?oe=In(oe):(oe=rn(l)?Us:Ht.current,oe=Bi(i,oe));var me=l.getDerivedStateFromProps,ge=typeof me=="function"||typeof R.getSnapshotBeforeUpdate=="function";ge||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(D!==h||K!==oe)&&$w(i,R,h,oe),hs=!1;var he=i.memoizedState;R.state=he,Gl(i,h,R,v),K=i.memoizedState,D!==h||he!==K||nn.current||hs?(typeof me=="function"&&(Ad(i,l,me,h),K=i.memoizedState),(D=hs||Pw(i,l,D,h,he,K,oe))?(ge||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"&&(i.flags|=4194308)):(typeof R.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=K),R.props=h,R.state=K,R.context=oe,h=D):(typeof R.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{R=i.stateNode,cw(n,i),D=i.memoizedProps,oe=i.type===i.elementType?D:Qn(i.type,D),R.props=oe,ge=i.pendingProps,he=R.context,K=l.contextType,typeof K=="object"&&K!==null?K=In(K):(K=rn(l)?Us:Ht.current,K=Bi(i,K));var be=l.getDerivedStateFromProps;(me=typeof be=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(D!==ge||he!==K)&&$w(i,R,h,K),hs=!1,he=i.memoizedState,R.state=he,Gl(i,h,R,v);var Ne=i.memoizedState;D!==ge||he!==Ne||nn.current||hs?(typeof be=="function"&&(Ad(i,l,be,h),Ne=i.memoizedState),(oe=hs||Pw(i,l,oe,h,he,Ne,K)||!1)?(me||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(h,Ne,K),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(h,Ne,K)),typeof R.componentDidUpdate=="function"&&(i.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof R.componentDidUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(i.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=Ne),R.props=h,R.state=Ne,R.context=K,h=oe):(typeof R.componentDidUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(i.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||D===n.memoizedProps&&he===n.memoizedState||(i.flags|=1024),h=!1)}return Ld(n,i,l,h,x,v)}function Ld(n,i,l,h,v,x){Gw(n,i);var R=(i.flags&128)!==0;if(!h&&!R)return v&&J0(i,l,!1),zr(n,i,x);h=i.stateNode,HR.current=i;var D=R&&typeof l.getDerivedStateFromError!="function"?null:h.render();return i.flags|=1,n!==null&&R?(i.child=Vi(i,n.child,null,x),i.child=Vi(i,null,D,x)):Jt(n,i,D,x),i.memoizedState=h.state,v&&J0(i,l,!0),i.child}function Kw(n){var i=n.stateNode;i.pendingContext?Q0(n,i.pendingContext,i.pendingContext!==i.context):i.context&&Q0(n,i.context,!1),wd(n,i.containerInfo)}function Xw(n,i,l,h,v){return Wi(),fd(v),i.flags|=256,Jt(n,i,l,h),i.child}var $d={dehydrated:null,treeContext:null,retryLane:0};function qd(n){return{baseLanes:n,cachePool:null,transitions:null}}function Qw(n,i,l){var h=i.pendingProps,v=vt.current,x=!1,R=(i.flags&128)!==0,D;if((D=R)||(D=n!==null&&n.memoizedState===null?!1:(v&2)!==0),D?(x=!0,i.flags&=-129):(n===null||n.memoizedState!==null)&&(v|=1),ut(vt,v&1),n===null)return dd(i),n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?((i.mode&1)===0?i.lanes=1:n.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(R=h.children,n=h.fallback,x?(h=i.mode,x=i.child,R={mode:"hidden",children:R},(h&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=R):x=pu(R,h,0,null),n=Js(n,h,l,null),x.return=i,n.return=i,x.sibling=n,i.child=x,i.child.memoizedState=qd(l),i.memoizedState=$d,n):Dd(i,R));if(v=n.memoizedState,v!==null&&(D=v.dehydrated,D!==null))return WR(n,i,R,h,D,v,l);if(x){x=h.fallback,R=i.mode,v=n.child,D=v.sibling;var K={mode:"hidden",children:h.children};return(R&1)===0&&i.child!==v?(h=i.child,h.childLanes=0,h.pendingProps=K,i.deletions=null):(h=xs(v,K),h.subtreeFlags=v.subtreeFlags&14680064),D!==null?x=xs(D,x):(x=Js(x,R,l,null),x.flags|=2),x.return=i,h.return=i,h.sibling=x,i.child=h,h=x,x=i.child,R=n.child.memoizedState,R=R===null?qd(l):{baseLanes:R.baseLanes|l,cachePool:null,transitions:R.transitions},x.memoizedState=R,x.childLanes=n.childLanes&~l,i.memoizedState=$d,h}return x=n.child,n=x.sibling,h=xs(x,{mode:"visible",children:h.children}),(i.mode&1)===0&&(h.lanes=l),h.return=i,h.sibling=null,n!==null&&(l=i.deletions,l===null?(i.deletions=[n],i.flags|=16):l.push(n)),i.child=h,i.memoizedState=null,h}function Dd(n,i){return i=pu({mode:"visible",children:i},n.mode,0,null),i.return=n,n.child=i}function tu(n,i,l,h){return h!==null&&fd(h),Vi(i,n.child,null,l),n=Dd(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function WR(n,i,l,h,v,x,R){if(l)return i.flags&256?(i.flags&=-257,h=Md(Error(r(422))),tu(n,i,R,h)):i.memoizedState!==null?(i.child=n.child,i.flags|=128,null):(x=h.fallback,v=i.mode,h=pu({mode:"visible",children:h.children},v,0,null),x=Js(x,v,R,null),x.flags|=2,h.return=i,x.return=i,h.sibling=x,i.child=h,(i.mode&1)!==0&&Vi(i,n.child,null,R),i.child.memoizedState=qd(R),i.memoizedState=$d,x);if((i.mode&1)===0)return tu(n,i,R,null);if(v.data==="$!"){if(h=v.nextSibling&&v.nextSibling.dataset,h)var D=h.dgst;return h=D,x=Error(r(419)),h=Md(x,h,void 0),tu(n,i,R,h)}if(D=(R&n.childLanes)!==0,sn||D){if(h=Lt,h!==null){switch(R&-R){case 4:v=2;break;case 16:v=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:v=32;break;case 536870912:v=268435456;break;default:v=0}v=(v&(h.suspendedLanes|R))!==0?0:v,v!==0&&v!==x.retryLane&&(x.retryLane=v,Dr(n,v),er(h,n,v,-1))}return tf(),h=Md(Error(r(421))),tu(n,i,R,h)}return v.data==="$?"?(i.flags|=128,i.child=n.child,i=sA.bind(null,n),v._reactRetry=i,null):(n=x.treeContext,mn=us(v.nextSibling),pn=i,pt=!0,Xn=null,n!==null&&(Rn[An++]=$r,Rn[An++]=qr,Rn[An++]=Hs,$r=n.id,qr=n.overflow,Hs=i),i=Dd(i,h.children),i.flags|=4096,i)}function Zw(n,i,l){n.lanes|=i;var h=n.alternate;h!==null&&(h.lanes|=i),gd(n.return,i,l)}function Fd(n,i,l,h,v){var x=n.memoizedState;x===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:l,tailMode:v}:(x.isBackwards=i,x.rendering=null,x.renderingStartTime=0,x.last=h,x.tail=l,x.tailMode=v)}function Jw(n,i,l){var h=i.pendingProps,v=h.revealOrder,x=h.tail;if(Jt(n,i,h.children,l),h=vt.current,(h&2)!==0)h=h&1|2,i.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Zw(n,l,i);else if(n.tag===19)Zw(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}h&=1}if(ut(vt,h),(i.mode&1)===0)i.memoizedState=null;else switch(v){case"forwards":for(l=i.child,v=null;l!==null;)n=l.alternate,n!==null&&Yl(n)===null&&(v=l),l=l.sibling;l=v,l===null?(v=i.child,i.child=null):(v=l.sibling,l.sibling=null),Fd(i,!1,v,l,x);break;case"backwards":for(l=null,v=i.child,i.child=null;v!==null;){if(n=v.alternate,n!==null&&Yl(n)===null){i.child=v;break}n=v.sibling,v.sibling=l,l=v,v=n}Fd(i,!0,l,null,x);break;case"together":Fd(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function nu(n,i){(i.mode&1)===0&&n!==null&&(n.alternate=null,i.alternate=null,i.flags|=2)}function zr(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),Ks|=i.lanes,(l&i.childLanes)===0)return null;if(n!==null&&i.child!==n.child)throw Error(r(153));if(i.child!==null){for(n=i.child,l=xs(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=xs(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function VR(n,i,l){switch(i.tag){case 3:Kw(i),Wi();break;case 5:hw(i);break;case 1:rn(i.type)&&ql(i);break;case 4:wd(i,i.stateNode.containerInfo);break;case 10:var h=i.type._context,v=i.memoizedProps.value;ut(Hl,h._currentValue),h._currentValue=v;break;case 13:if(h=i.memoizedState,h!==null)return h.dehydrated!==null?(ut(vt,vt.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?Qw(n,i,l):(ut(vt,vt.current&1),n=zr(n,i,l),n!==null?n.sibling:null);ut(vt,vt.current&1);break;case 19:if(h=(l&i.childLanes)!==0,(n.flags&128)!==0){if(h)return Jw(n,i,l);i.flags|=128}if(v=i.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),ut(vt,vt.current),h)break;return null;case 22:case 23:return i.lanes=0,Vw(n,i,l)}return zr(n,i,l)}var ex,zd,tx,nx;ex=function(n,i){for(var l=i.child;l!==null;){if(l.tag===5||l.tag===6)n.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},zd=function(){},tx=function(n,i,l,h){var v=n.memoizedProps;if(v!==h){n=i.stateNode,Gs(vr.current);var x=null;switch(l){case"input":v=Ie(n,v),h=Ie(n,h),x=[];break;case"select":v=H({},v,{value:void 0}),h=H({},h,{value:void 0}),x=[];break;case"textarea":v=ot(n,v),h=ot(n,h),x=[];break;default:typeof v.onClick!="function"&&typeof h.onClick=="function"&&(n.onclick=Pl)}Ve(l,h);var R;l=null;for(oe in v)if(!h.hasOwnProperty(oe)&&v.hasOwnProperty(oe)&&v[oe]!=null)if(oe==="style"){var D=v[oe];for(R in D)D.hasOwnProperty(R)&&(l||(l={}),l[R]="")}else oe!=="dangerouslySetInnerHTML"&&oe!=="children"&&oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&oe!=="autoFocus"&&(o.hasOwnProperty(oe)?x||(x=[]):(x=x||[]).push(oe,null));for(oe in h){var K=h[oe];if(D=v!=null?v[oe]:void 0,h.hasOwnProperty(oe)&&K!==D&&(K!=null||D!=null))if(oe==="style")if(D){for(R in D)!D.hasOwnProperty(R)||K&&K.hasOwnProperty(R)||(l||(l={}),l[R]="");for(R in K)K.hasOwnProperty(R)&&D[R]!==K[R]&&(l||(l={}),l[R]=K[R])}else l||(x||(x=[]),x.push(oe,l)),l=K;else oe==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,D=D?D.__html:void 0,K!=null&&D!==K&&(x=x||[]).push(oe,K)):oe==="children"?typeof K!="string"&&typeof K!="number"||(x=x||[]).push(oe,""+K):oe!=="suppressContentEditableWarning"&&oe!=="suppressHydrationWarning"&&(o.hasOwnProperty(oe)?(K!=null&&oe==="onScroll"&&ct("scroll",n),x||D===K||(x=[])):(x=x||[]).push(oe,K))}l&&(x=x||[]).push("style",l);var oe=x;(i.updateQueue=oe)&&(i.flags|=4)}},nx=function(n,i,l,h){l!==h&&(i.flags|=4)};function ga(n,i){if(!pt)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:h.sibling=null}}function Vt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,h=0;if(i)for(var v=n.child;v!==null;)l|=v.lanes|v.childLanes,h|=v.subtreeFlags&14680064,h|=v.flags&14680064,v.return=n,v=v.sibling;else for(v=n.child;v!==null;)l|=v.lanes|v.childLanes,h|=v.subtreeFlags,h|=v.flags,v.return=n,v=v.sibling;return n.subtreeFlags|=h,n.childLanes=l,i}function GR(n,i,l){var h=i.pendingProps;switch(ud(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(i),null;case 1:return rn(i.type)&&$l(),Vt(i),null;case 3:return h=i.stateNode,Ki(),dt(nn),dt(Ht),bd(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(n===null||n.child===null)&&(Bl(i)?i.flags|=4:n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Xn!==null&&(Zd(Xn),Xn=null))),zd(n,i),Vt(i),null;case 5:xd(i);var v=Gs(da.current);if(l=i.type,n!==null&&i.stateNode!=null)tx(n,i,l,h,v),n.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!h){if(i.stateNode===null)throw Error(r(166));return Vt(i),null}if(n=Gs(vr.current),Bl(i)){h=i.stateNode,l=i.type;var x=i.memoizedProps;switch(h[gr]=i,h[oa]=x,n=(i.mode&1)!==0,l){case"dialog":ct("cancel",h),ct("close",h);break;case"iframe":case"object":case"embed":ct("load",h);break;case"video":case"audio":for(v=0;v<ra.length;v++)ct(ra[v],h);break;case"source":ct("error",h);break;case"img":case"image":case"link":ct("error",h),ct("load",h);break;case"details":ct("toggle",h);break;case"input":ke(h,x),ct("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!x.multiple},ct("invalid",h);break;case"textarea":Be(h,x),ct("invalid",h)}Ve(l,x),v=null;for(var R in x)if(x.hasOwnProperty(R)){var D=x[R];R==="children"?typeof D=="string"?h.textContent!==D&&(x.suppressHydrationWarning!==!0&&Ol(h.textContent,D,n),v=["children",D]):typeof D=="number"&&h.textContent!==""+D&&(x.suppressHydrationWarning!==!0&&Ol(h.textContent,D,n),v=["children",""+D]):o.hasOwnProperty(R)&&D!=null&&R==="onScroll"&&ct("scroll",h)}switch(l){case"input":Me(h),xe(h,x,!0);break;case"textarea":Me(h),Xe(h);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(h.onclick=Pl)}h=v,i.updateQueue=h,h!==null&&(i.flags|=4)}else{R=v.nodeType===9?v:v.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=wt(l)),n==="http://www.w3.org/1999/xhtml"?l==="script"?(n=R.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof h.is=="string"?n=R.createElement(l,{is:h.is}):(n=R.createElement(l),l==="select"&&(R=n,h.multiple?R.multiple=!0:h.size&&(R.size=h.size))):n=R.createElementNS(n,l),n[gr]=i,n[oa]=h,ex(n,i,!1,!1),i.stateNode=n;e:{switch(R=lt(l,h),l){case"dialog":ct("cancel",n),ct("close",n),v=h;break;case"iframe":case"object":case"embed":ct("load",n),v=h;break;case"video":case"audio":for(v=0;v<ra.length;v++)ct(ra[v],n);v=h;break;case"source":ct("error",n),v=h;break;case"img":case"image":case"link":ct("error",n),ct("load",n),v=h;break;case"details":ct("toggle",n),v=h;break;case"input":ke(n,h),v=Ie(n,h),ct("invalid",n);break;case"option":v=h;break;case"select":n._wrapperState={wasMultiple:!!h.multiple},v=H({},h,{value:void 0}),ct("invalid",n);break;case"textarea":Be(n,h),v=ot(n,h),ct("invalid",n);break;default:v=h}Ve(l,v),D=v;for(x in D)if(D.hasOwnProperty(x)){var K=D[x];x==="style"?Ce(n,K):x==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&De(n,K)):x==="children"?typeof K=="string"?(l!=="textarea"||K!=="")&&Re(n,K):typeof K=="number"&&Re(n,""+K):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(o.hasOwnProperty(x)?K!=null&&x==="onScroll"&&ct("scroll",n):K!=null&&C(n,x,K,R))}switch(l){case"input":Me(n),xe(n,h,!1);break;case"textarea":Me(n),Xe(n);break;case"option":h.value!=null&&n.setAttribute("value",""+fe(h.value));break;case"select":n.multiple=!!h.multiple,x=h.value,x!=null?ft(n,!!h.multiple,x,!1):h.defaultValue!=null&&ft(n,!!h.multiple,h.defaultValue,!0);break;default:typeof v.onClick=="function"&&(n.onclick=Pl)}switch(l){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return Vt(i),null;case 6:if(n&&i.stateNode!=null)nx(n,i,n.memoizedProps,h);else{if(typeof h!="string"&&i.stateNode===null)throw Error(r(166));if(l=Gs(da.current),Gs(vr.current),Bl(i)){if(h=i.stateNode,l=i.memoizedProps,h[gr]=i,(x=h.nodeValue!==l)&&(n=pn,n!==null))switch(n.tag){case 3:Ol(h.nodeValue,l,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Ol(h.nodeValue,l,(n.mode&1)!==0)}x&&(i.flags|=4)}else h=(l.nodeType===9?l:l.ownerDocument).createTextNode(h),h[gr]=i,i.stateNode=h}return Vt(i),null;case 13:if(dt(vt),h=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(pt&&mn!==null&&(i.mode&1)!==0&&(i.flags&128)===0)iw(),Wi(),i.flags|=98560,x=!1;else if(x=Bl(i),h!==null&&h.dehydrated!==null){if(n===null){if(!x)throw Error(r(318));if(x=i.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[gr]=i}else Wi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Vt(i),x=!1}else Xn!==null&&(Zd(Xn),Xn=null),x=!0;if(!x)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=l,i):(h=h!==null,h!==(n!==null&&n.memoizedState!==null)&&h&&(i.child.flags|=8192,(i.mode&1)!==0&&(n===null||(vt.current&1)!==0?Rt===0&&(Rt=3):tf())),i.updateQueue!==null&&(i.flags|=4),Vt(i),null);case 4:return Ki(),zd(n,i),n===null&&sa(i.stateNode.containerInfo),Vt(i),null;case 10:return md(i.type._context),Vt(i),null;case 17:return rn(i.type)&&$l(),Vt(i),null;case 19:if(dt(vt),x=i.memoizedState,x===null)return Vt(i),null;if(h=(i.flags&128)!==0,R=x.rendering,R===null)if(h)ga(x,!1);else{if(Rt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(R=Yl(n),R!==null){for(i.flags|=128,ga(x,!1),h=R.updateQueue,h!==null&&(i.updateQueue=h,i.flags|=4),i.subtreeFlags=0,h=l,l=i.child;l!==null;)x=l,n=h,x.flags&=14680066,R=x.alternate,R===null?(x.childLanes=0,x.lanes=n,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=R.childLanes,x.lanes=R.lanes,x.child=R.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=R.memoizedProps,x.memoizedState=R.memoizedState,x.updateQueue=R.updateQueue,x.type=R.type,n=R.dependencies,x.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),l=l.sibling;return ut(vt,vt.current&1|2),i.child}n=n.sibling}x.tail!==null&&st()>Ji&&(i.flags|=128,h=!0,ga(x,!1),i.lanes=4194304)}else{if(!h)if(n=Yl(R),n!==null){if(i.flags|=128,h=!0,l=n.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),ga(x,!0),x.tail===null&&x.tailMode==="hidden"&&!R.alternate&&!pt)return Vt(i),null}else 2*st()-x.renderingStartTime>Ji&&l!==1073741824&&(i.flags|=128,h=!0,ga(x,!1),i.lanes=4194304);x.isBackwards?(R.sibling=i.child,i.child=R):(l=x.last,l!==null?l.sibling=R:i.child=R,x.last=R)}return x.tail!==null?(i=x.tail,x.rendering=i,x.tail=i.sibling,x.renderingStartTime=st(),i.sibling=null,l=vt.current,ut(vt,h?l&1|2:l&1),i):(Vt(i),null);case 22:case 23:return ef(),h=i.memoizedState!==null,n!==null&&n.memoizedState!==null!==h&&(i.flags|=8192),h&&(i.mode&1)!==0?(gn&1073741824)!==0&&(Vt(i),i.subtreeFlags&6&&(i.flags|=8192)):Vt(i),null;case 24:return null;case 25:return null}throw Error(r(156,i.tag))}function YR(n,i){switch(ud(i),i.tag){case 1:return rn(i.type)&&$l(),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Ki(),dt(nn),dt(Ht),bd(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 5:return xd(i),null;case 13:if(dt(vt),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Wi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return dt(vt),null;case 4:return Ki(),null;case 10:return md(i.type._context),null;case 22:case 23:return ef(),null;case 24:return null;default:return null}}var ru=!1,Gt=!1,KR=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function Qi(n,i){var l=n.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(h){_t(n,i,h)}else l.current=null}function Bd(n,i,l){try{l()}catch(h){_t(n,i,h)}}var rx=!1;function XR(n,i){if(ed=Gn,n=P0(),Vc(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var h=l.getSelection&&l.getSelection();if(h&&h.rangeCount!==0){l=h.anchorNode;var v=h.anchorOffset,x=h.focusNode;h=h.focusOffset;try{l.nodeType,x.nodeType}catch{l=null;break e}var R=0,D=-1,K=-1,oe=0,me=0,ge=n,he=null;t:for(;;){for(var be;ge!==l||v!==0&&ge.nodeType!==3||(D=R+v),ge!==x||h!==0&&ge.nodeType!==3||(K=R+h),ge.nodeType===3&&(R+=ge.nodeValue.length),(be=ge.firstChild)!==null;)he=ge,ge=be;for(;;){if(ge===n)break t;if(he===l&&++oe===v&&(D=R),he===x&&++me===h&&(K=R),(be=ge.nextSibling)!==null)break;ge=he,he=ge.parentNode}ge=be}l=D===-1||K===-1?null:{start:D,end:K}}else l=null}l=l||{start:0,end:0}}else l=null;for(td={focusedElem:n,selectionRange:l},Gn=!1,Ee=i;Ee!==null;)if(i=Ee,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Ee=n;else for(;Ee!==null;){i=Ee;try{var Ne=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var je=Ne.memoizedProps,St=Ne.memoizedState,re=i.stateNode,J=re.getSnapshotBeforeUpdate(i.elementType===i.type?je:Qn(i.type,je),St);re.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var se=i.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ve){_t(i,i.return,ve)}if(n=i.sibling,n!==null){n.return=i.return,Ee=n;break}Ee=i.return}return Ne=rx,rx=!1,Ne}function va(n,i,l){var h=i.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var v=h=h.next;do{if((v.tag&n)===n){var x=v.destroy;v.destroy=void 0,x!==void 0&&Bd(i,l,x)}v=v.next}while(v!==h)}}function su(n,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&n)===n){var h=l.create;l.destroy=h()}l=l.next}while(l!==i)}}function Ud(n){var i=n.ref;if(i!==null){var l=n.stateNode;switch(n.tag){case 5:n=l;break;default:n=l}typeof i=="function"?i(n):i.current=n}}function sx(n){var i=n.alternate;i!==null&&(n.alternate=null,sx(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&(delete i[gr],delete i[oa],delete i[id],delete i[IR],delete i[MR])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function ix(n){return n.tag===5||n.tag===3||n.tag===4}function ox(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||ix(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Hd(n,i,l){var h=n.tag;if(h===5||h===6)n=n.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(n,i):l.insertBefore(n,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(n,l)):(i=l,i.appendChild(n)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Pl));else if(h!==4&&(n=n.child,n!==null))for(Hd(n,i,l),n=n.sibling;n!==null;)Hd(n,i,l),n=n.sibling}function Wd(n,i,l){var h=n.tag;if(h===5||h===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(h!==4&&(n=n.child,n!==null))for(Wd(n,i,l),n=n.sibling;n!==null;)Wd(n,i,l),n=n.sibling}var Dt=null,Zn=!1;function ms(n,i,l){for(l=l.child;l!==null;)ax(n,i,l),l=l.sibling}function ax(n,i,l){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(jr,l)}catch{}switch(l.tag){case 5:Gt||Qi(l,i);case 6:var h=Dt,v=Zn;Dt=null,ms(n,i,l),Dt=h,Zn=v,Dt!==null&&(Zn?(n=Dt,l=l.stateNode,n.nodeType===8?n.parentNode.removeChild(l):n.removeChild(l)):Dt.removeChild(l.stateNode));break;case 18:Dt!==null&&(Zn?(n=Dt,l=l.stateNode,n.nodeType===8?sd(n.parentNode,l):n.nodeType===1&&sd(n,l),Ps(n)):sd(Dt,l.stateNode));break;case 4:h=Dt,v=Zn,Dt=l.stateNode.containerInfo,Zn=!0,ms(n,i,l),Dt=h,Zn=v;break;case 0:case 11:case 14:case 15:if(!Gt&&(h=l.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){v=h=h.next;do{var x=v,R=x.destroy;x=x.tag,R!==void 0&&((x&2)!==0||(x&4)!==0)&&Bd(l,i,R),v=v.next}while(v!==h)}ms(n,i,l);break;case 1:if(!Gt&&(Qi(l,i),h=l.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=l.memoizedProps,h.state=l.memoizedState,h.componentWillUnmount()}catch(D){_t(l,i,D)}ms(n,i,l);break;case 21:ms(n,i,l);break;case 22:l.mode&1?(Gt=(h=Gt)||l.memoizedState!==null,ms(n,i,l),Gt=h):ms(n,i,l);break;default:ms(n,i,l)}}function lx(n){var i=n.updateQueue;if(i!==null){n.updateQueue=null;var l=n.stateNode;l===null&&(l=n.stateNode=new KR),i.forEach(function(h){var v=iA.bind(null,n,h);l.has(h)||(l.add(h),h.then(v,v))})}}function Jn(n,i){var l=i.deletions;if(l!==null)for(var h=0;h<l.length;h++){var v=l[h];try{var x=n,R=i,D=R;e:for(;D!==null;){switch(D.tag){case 5:Dt=D.stateNode,Zn=!1;break e;case 3:Dt=D.stateNode.containerInfo,Zn=!0;break e;case 4:Dt=D.stateNode.containerInfo,Zn=!0;break e}D=D.return}if(Dt===null)throw Error(r(160));ax(x,R,v),Dt=null,Zn=!1;var K=v.alternate;K!==null&&(K.return=null),v.return=null}catch(oe){_t(v,i,oe)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)ux(i,n),i=i.sibling}function ux(n,i){var l=n.alternate,h=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(Jn(i,n),wr(n),h&4){try{va(3,n,n.return),su(3,n)}catch(je){_t(n,n.return,je)}try{va(5,n,n.return)}catch(je){_t(n,n.return,je)}}break;case 1:Jn(i,n),wr(n),h&512&&l!==null&&Qi(l,l.return);break;case 5:if(Jn(i,n),wr(n),h&512&&l!==null&&Qi(l,l.return),n.flags&32){var v=n.stateNode;try{Re(v,"")}catch(je){_t(n,n.return,je)}}if(h&4&&(v=n.stateNode,v!=null)){var x=n.memoizedProps,R=l!==null?l.memoizedProps:x,D=n.type,K=n.updateQueue;if(n.updateQueue=null,K!==null)try{D==="input"&&x.type==="radio"&&x.name!=null&&le(v,x),lt(D,R);var oe=lt(D,x);for(R=0;R<K.length;R+=2){var me=K[R],ge=K[R+1];me==="style"?Ce(v,ge):me==="dangerouslySetInnerHTML"?De(v,ge):me==="children"?Re(v,ge):C(v,me,ge,oe)}switch(D){case"input":we(v,x);break;case"textarea":et(v,x);break;case"select":var he=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!x.multiple;var be=x.value;be!=null?ft(v,!!x.multiple,be,!1):he!==!!x.multiple&&(x.defaultValue!=null?ft(v,!!x.multiple,x.defaultValue,!0):ft(v,!!x.multiple,x.multiple?[]:"",!1))}v[oa]=x}catch(je){_t(n,n.return,je)}}break;case 6:if(Jn(i,n),wr(n),h&4){if(n.stateNode===null)throw Error(r(162));v=n.stateNode,x=n.memoizedProps;try{v.nodeValue=x}catch(je){_t(n,n.return,je)}}break;case 3:if(Jn(i,n),wr(n),h&4&&l!==null&&l.memoizedState.isDehydrated)try{Ps(i.containerInfo)}catch(je){_t(n,n.return,je)}break;case 4:Jn(i,n),wr(n);break;case 13:Jn(i,n),wr(n),v=n.child,v.flags&8192&&(x=v.memoizedState!==null,v.stateNode.isHidden=x,!x||v.alternate!==null&&v.alternate.memoizedState!==null||(Yd=st())),h&4&&lx(n);break;case 22:if(me=l!==null&&l.memoizedState!==null,n.mode&1?(Gt=(oe=Gt)||me,Jn(i,n),Gt=oe):Jn(i,n),wr(n),h&8192){if(oe=n.memoizedState!==null,(n.stateNode.isHidden=oe)&&!me&&(n.mode&1)!==0)for(Ee=n,me=n.child;me!==null;){for(ge=Ee=me;Ee!==null;){switch(he=Ee,be=he.child,he.tag){case 0:case 11:case 14:case 15:va(4,he,he.return);break;case 1:Qi(he,he.return);var Ne=he.stateNode;if(typeof Ne.componentWillUnmount=="function"){h=he,l=he.return;try{i=h,Ne.props=i.memoizedProps,Ne.state=i.memoizedState,Ne.componentWillUnmount()}catch(je){_t(h,l,je)}}break;case 5:Qi(he,he.return);break;case 22:if(he.memoizedState!==null){fx(ge);continue}}be!==null?(be.return=he,Ee=be):fx(ge)}me=me.sibling}e:for(me=null,ge=n;;){if(ge.tag===5){if(me===null){me=ge;try{v=ge.stateNode,oe?(x=v.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(D=ge.stateNode,K=ge.memoizedProps.style,R=K!=null&&K.hasOwnProperty("display")?K.display:null,D.style.display=tt("display",R))}catch(je){_t(n,n.return,je)}}}else if(ge.tag===6){if(me===null)try{ge.stateNode.nodeValue=oe?"":ge.memoizedProps}catch(je){_t(n,n.return,je)}}else if((ge.tag!==22&&ge.tag!==23||ge.memoizedState===null||ge===n)&&ge.child!==null){ge.child.return=ge,ge=ge.child;continue}if(ge===n)break e;for(;ge.sibling===null;){if(ge.return===null||ge.return===n)break e;me===ge&&(me=null),ge=ge.return}me===ge&&(me=null),ge.sibling.return=ge.return,ge=ge.sibling}}break;case 19:Jn(i,n),wr(n),h&4&&lx(n);break;case 21:break;default:Jn(i,n),wr(n)}}function wr(n){var i=n.flags;if(i&2){try{e:{for(var l=n.return;l!==null;){if(ix(l)){var h=l;break e}l=l.return}throw Error(r(160))}switch(h.tag){case 5:var v=h.stateNode;h.flags&32&&(Re(v,""),h.flags&=-33);var x=ox(n);Wd(n,x,v);break;case 3:case 4:var R=h.stateNode.containerInfo,D=ox(n);Hd(n,D,R);break;default:throw Error(r(161))}}catch(K){_t(n,n.return,K)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function QR(n,i,l){Ee=n,cx(n)}function cx(n,i,l){for(var h=(n.mode&1)!==0;Ee!==null;){var v=Ee,x=v.child;if(v.tag===22&&h){var R=v.memoizedState!==null||ru;if(!R){var D=v.alternate,K=D!==null&&D.memoizedState!==null||Gt;D=ru;var oe=Gt;if(ru=R,(Gt=K)&&!oe)for(Ee=v;Ee!==null;)R=Ee,K=R.child,R.tag===22&&R.memoizedState!==null?hx(v):K!==null?(K.return=R,Ee=K):hx(v);for(;x!==null;)Ee=x,cx(x),x=x.sibling;Ee=v,ru=D,Gt=oe}dx(n)}else(v.subtreeFlags&8772)!==0&&x!==null?(x.return=v,Ee=x):dx(n)}}function dx(n){for(;Ee!==null;){var i=Ee;if((i.flags&8772)!==0){var l=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:Gt||su(5,i);break;case 1:var h=i.stateNode;if(i.flags&4&&!Gt)if(l===null)h.componentDidMount();else{var v=i.elementType===i.type?l.memoizedProps:Qn(i.type,l.memoizedProps);h.componentDidUpdate(v,l.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var x=i.updateQueue;x!==null&&fw(i,x,h);break;case 3:var R=i.updateQueue;if(R!==null){if(l=null,i.child!==null)switch(i.child.tag){case 5:l=i.child.stateNode;break;case 1:l=i.child.stateNode}fw(i,R,l)}break;case 5:var D=i.stateNode;if(l===null&&i.flags&4){l=D;var K=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&l.focus();break;case"img":K.src&&(l.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var oe=i.alternate;if(oe!==null){var me=oe.memoizedState;if(me!==null){var ge=me.dehydrated;ge!==null&&Ps(ge)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Gt||i.flags&512&&Ud(i)}catch(he){_t(i,i.return,he)}}if(i===n){Ee=null;break}if(l=i.sibling,l!==null){l.return=i.return,Ee=l;break}Ee=i.return}}function fx(n){for(;Ee!==null;){var i=Ee;if(i===n){Ee=null;break}var l=i.sibling;if(l!==null){l.return=i.return,Ee=l;break}Ee=i.return}}function hx(n){for(;Ee!==null;){var i=Ee;try{switch(i.tag){case 0:case 11:case 15:var l=i.return;try{su(4,i)}catch(K){_t(i,l,K)}break;case 1:var h=i.stateNode;if(typeof h.componentDidMount=="function"){var v=i.return;try{h.componentDidMount()}catch(K){_t(i,v,K)}}var x=i.return;try{Ud(i)}catch(K){_t(i,x,K)}break;case 5:var R=i.return;try{Ud(i)}catch(K){_t(i,R,K)}}}catch(K){_t(i,i.return,K)}if(i===n){Ee=null;break}var D=i.sibling;if(D!==null){D.return=i.return,Ee=D;break}Ee=i.return}}var ZR=Math.ceil,iu=T.ReactCurrentDispatcher,Vd=T.ReactCurrentOwner,On=T.ReactCurrentBatchConfig,Qe=0,Lt=null,Et=null,Ft=0,gn=0,Zi=cs(0),Rt=0,ya=null,Ks=0,ou=0,Gd=0,wa=null,on=null,Yd=0,Ji=1/0,Br=null,au=!1,Kd=null,gs=null,lu=!1,vs=null,uu=0,xa=0,Xd=null,cu=-1,du=0;function en(){return(Qe&6)!==0?st():cu!==-1?cu:cu=st()}function ys(n){return(n.mode&1)===0?1:(Qe&2)!==0&&Ft!==0?Ft&-Ft:PR.transition!==null?(du===0&&(du=Oo()),du):(n=Je,n!==0||(n=window.event,n=n===void 0?16:Xt(n.type)),n)}function er(n,i,l,h){if(50<xa)throw xa=0,Xd=null,Error(r(185));Os(n,l,h),((Qe&2)===0||n!==Lt)&&(n===Lt&&((Qe&2)===0&&(ou|=l),Rt===4&&ws(n,Ft)),an(n,h),l===1&&Qe===0&&(i.mode&1)===0&&(Ji=st()+500,Dl&&fs()))}function an(n,i){var l=n.callbackNode;$c(n,i);var h=Tr(n,n===Lt?Ft:0);if(h===0)l!==null&&Zr(l),n.callbackNode=null,n.callbackPriority=0;else if(i=h&-h,n.callbackPriority!==i){if(l!=null&&Zr(l),i===1)n.tag===0?OR(mx.bind(null,n)):ew(mx.bind(null,n)),RR(function(){(Qe&6)===0&&fs()}),l=null;else{switch(Lo(h)){case 1:l=Is;break;case 4:l=Sn;break;case 16:l=Un;break;case 536870912:l=ki;break;default:l=Un}l=kx(l,px.bind(null,n))}n.callbackPriority=i,n.callbackNode=l}}function px(n,i){if(cu=-1,du=0,(Qe&6)!==0)throw Error(r(327));var l=n.callbackNode;if(eo()&&n.callbackNode!==l)return null;var h=Tr(n,n===Lt?Ft:0);if(h===0)return null;if((h&30)!==0||(h&n.expiredLanes)!==0||i)i=fu(n,h);else{i=h;var v=Qe;Qe|=2;var x=vx();(Lt!==n||Ft!==i)&&(Br=null,Ji=st()+500,Qs(n,i));do try{tA();break}catch(D){gx(n,D)}while(!0);pd(),iu.current=x,Qe=v,Et!==null?i=0:(Lt=null,Ft=0,i=Rt)}if(i!==0){if(i===2&&(v=Rr(n),v!==0&&(h=v,i=Qd(n,v))),i===1)throw l=ya,Qs(n,0),ws(n,h),an(n,st()),l;if(i===6)ws(n,h);else{if(v=n.current.alternate,(h&30)===0&&!JR(v)&&(i=fu(n,h),i===2&&(x=Rr(n),x!==0&&(h=x,i=Qd(n,x))),i===1))throw l=ya,Qs(n,0),ws(n,h),an(n,st()),l;switch(n.finishedWork=v,n.finishedLanes=h,i){case 0:case 1:throw Error(r(345));case 2:Zs(n,on,Br);break;case 3:if(ws(n,h),(h&130023424)===h&&(i=Yd+500-st(),10<i)){if(Tr(n,0)!==0)break;if(v=n.suspendedLanes,(v&h)!==h){en(),n.pingedLanes|=n.suspendedLanes&v;break}n.timeoutHandle=rd(Zs.bind(null,n,on,Br),i);break}Zs(n,on,Br);break;case 4:if(ws(n,h),(h&4194240)===h)break;for(i=n.eventTimes,v=-1;0<h;){var R=31-tn(h);x=1<<R,R=i[R],R>v&&(v=R),h&=~x}if(h=v,h=st()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*ZR(h/1960))-h,10<h){n.timeoutHandle=rd(Zs.bind(null,n,on,Br),h);break}Zs(n,on,Br);break;case 5:Zs(n,on,Br);break;default:throw Error(r(329))}}}return an(n,st()),n.callbackNode===l?px.bind(null,n):null}function Qd(n,i){var l=wa;return n.current.memoizedState.isDehydrated&&(Qs(n,i).flags|=256),n=fu(n,i),n!==2&&(i=on,on=l,i!==null&&Zd(i)),n}function Zd(n){on===null?on=n:on.push.apply(on,n)}function JR(n){for(var i=n;;){if(i.flags&16384){var l=i.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var h=0;h<l.length;h++){var v=l[h],x=v.getSnapshot;v=v.value;try{if(!nt(x(),v))return!1}catch{return!1}}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ws(n,i){for(i&=~Gd,i&=~ou,n.suspendedLanes|=i,n.pingedLanes&=~i,n=n.expirationTimes;0<i;){var l=31-tn(i),h=1<<l;n[l]=-1,i&=~h}}function mx(n){if((Qe&6)!==0)throw Error(r(327));eo();var i=Tr(n,0);if((i&1)===0)return an(n,st()),null;var l=fu(n,i);if(n.tag!==0&&l===2){var h=Rr(n);h!==0&&(i=h,l=Qd(n,h))}if(l===1)throw l=ya,Qs(n,0),ws(n,i),an(n,st()),l;if(l===6)throw Error(r(345));return n.finishedWork=n.current.alternate,n.finishedLanes=i,Zs(n,on,Br),an(n,st()),null}function Jd(n,i){var l=Qe;Qe|=1;try{return n(i)}finally{Qe=l,Qe===0&&(Ji=st()+500,Dl&&fs())}}function Xs(n){vs!==null&&vs.tag===0&&(Qe&6)===0&&eo();var i=Qe;Qe|=1;var l=On.transition,h=Je;try{if(On.transition=null,Je=1,n)return n()}finally{Je=h,On.transition=l,Qe=i,(Qe&6)===0&&fs()}}function ef(){gn=Zi.current,dt(Zi)}function Qs(n,i){n.finishedWork=null,n.finishedLanes=0;var l=n.timeoutHandle;if(l!==-1&&(n.timeoutHandle=-1,TR(l)),Et!==null)for(l=Et.return;l!==null;){var h=l;switch(ud(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&$l();break;case 3:Ki(),dt(nn),dt(Ht),bd();break;case 5:xd(h);break;case 4:Ki();break;case 13:dt(vt);break;case 19:dt(vt);break;case 10:md(h.type._context);break;case 22:case 23:ef()}l=l.return}if(Lt=n,Et=n=xs(n.current,null),Ft=gn=i,Rt=0,ya=null,Gd=ou=Ks=0,on=wa=null,Vs!==null){for(i=0;i<Vs.length;i++)if(l=Vs[i],h=l.interleaved,h!==null){l.interleaved=null;var v=h.next,x=l.pending;if(x!==null){var R=x.next;x.next=v,h.next=R}l.pending=h}Vs=null}return n}function gx(n,i){do{var l=Et;try{if(pd(),Kl.current=Jl,Xl){for(var h=yt.memoizedState;h!==null;){var v=h.queue;v!==null&&(v.pending=null),h=h.next}Xl=!1}if(Ys=0,Pt=Tt=yt=null,fa=!1,ha=0,Vd.current=null,l===null||l.return===null){Rt=1,ya=i,Et=null;break}e:{var x=n,R=l.return,D=l,K=i;if(i=Ft,D.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var oe=K,me=D,ge=me.tag;if((me.mode&1)===0&&(ge===0||ge===11||ge===15)){var he=me.alternate;he?(me.updateQueue=he.updateQueue,me.memoizedState=he.memoizedState,me.lanes=he.lanes):(me.updateQueue=null,me.memoizedState=null)}var be=zw(R);if(be!==null){be.flags&=-257,Bw(be,R,D,x,i),be.mode&1&&Fw(x,oe,i),i=be,K=oe;var Ne=i.updateQueue;if(Ne===null){var je=new Set;je.add(K),i.updateQueue=je}else Ne.add(K);break e}else{if((i&1)===0){Fw(x,oe,i),tf();break e}K=Error(r(426))}}else if(pt&&D.mode&1){var St=zw(R);if(St!==null){(St.flags&65536)===0&&(St.flags|=256),Bw(St,R,D,x,i),fd(Xi(K,D));break e}}x=K=Xi(K,D),Rt!==4&&(Rt=2),wa===null?wa=[x]:wa.push(x),x=R;do{switch(x.tag){case 3:x.flags|=65536,i&=-i,x.lanes|=i;var re=qw(x,K,i);dw(x,re);break e;case 1:D=K;var J=x.type,se=x.stateNode;if((x.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||se!==null&&typeof se.componentDidCatch=="function"&&(gs===null||!gs.has(se)))){x.flags|=65536,i&=-i,x.lanes|=i;var ve=Dw(x,D,i);dw(x,ve);break e}}x=x.return}while(x!==null)}wx(l)}catch(Te){i=Te,Et===l&&l!==null&&(Et=l=l.return);continue}break}while(!0)}function vx(){var n=iu.current;return iu.current=Jl,n===null?Jl:n}function tf(){(Rt===0||Rt===3||Rt===2)&&(Rt=4),Lt===null||(Ks&268435455)===0&&(ou&268435455)===0||ws(Lt,Ft)}function fu(n,i){var l=Qe;Qe|=2;var h=vx();(Lt!==n||Ft!==i)&&(Br=null,Qs(n,i));do try{eA();break}catch(v){gx(n,v)}while(!0);if(pd(),Qe=l,iu.current=h,Et!==null)throw Error(r(261));return Lt=null,Ft=0,Rt}function eA(){for(;Et!==null;)yx(Et)}function tA(){for(;Et!==null&&!xt();)yx(Et)}function yx(n){var i=bx(n.alternate,n,gn);n.memoizedProps=n.pendingProps,i===null?wx(n):Et=i,Vd.current=null}function wx(n){var i=n;do{var l=i.alternate;if(n=i.return,(i.flags&32768)===0){if(l=GR(l,i,gn),l!==null){Et=l;return}}else{if(l=YR(l,i),l!==null){l.flags&=32767,Et=l;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{Rt=6,Et=null;return}}if(i=i.sibling,i!==null){Et=i;return}Et=i=n}while(i!==null);Rt===0&&(Rt=5)}function Zs(n,i,l){var h=Je,v=On.transition;try{On.transition=null,Je=1,nA(n,i,l,h)}finally{On.transition=v,Je=h}return null}function nA(n,i,l,h){do eo();while(vs!==null);if((Qe&6)!==0)throw Error(r(327));l=n.finishedWork;var v=n.finishedLanes;if(l===null)return null;if(n.finishedWork=null,n.finishedLanes=0,l===n.current)throw Error(r(177));n.callbackNode=null,n.callbackPriority=0;var x=l.lanes|l.childLanes;if(fl(n,x),n===Lt&&(Et=Lt=null,Ft=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||lu||(lu=!0,kx(Un,function(){return eo(),null})),x=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||x){x=On.transition,On.transition=null;var R=Je;Je=1;var D=Qe;Qe|=4,Vd.current=null,XR(n,l),ux(l,n),bR(td),Gn=!!ed,td=ed=null,n.current=l,QR(l),Io(),Qe=D,Je=R,On.transition=x}else n.current=l;if(lu&&(lu=!1,vs=n,uu=v),x=n.pendingLanes,x===0&&(gs=null),En(l.stateNode),an(n,st()),i!==null)for(h=n.onRecoverableError,l=0;l<i.length;l++)v=i[l],h(v.value,{componentStack:v.stack,digest:v.digest});if(au)throw au=!1,n=Kd,Kd=null,n;return(uu&1)!==0&&n.tag!==0&&eo(),x=n.pendingLanes,(x&1)!==0?n===Xd?xa++:(xa=0,Xd=n):xa=0,fs(),null}function eo(){if(vs!==null){var n=Lo(uu),i=On.transition,l=Je;try{if(On.transition=null,Je=16>n?16:n,vs===null)var h=!1;else{if(n=vs,vs=null,uu=0,(Qe&6)!==0)throw Error(r(331));var v=Qe;for(Qe|=4,Ee=n.current;Ee!==null;){var x=Ee,R=x.child;if((Ee.flags&16)!==0){var D=x.deletions;if(D!==null){for(var K=0;K<D.length;K++){var oe=D[K];for(Ee=oe;Ee!==null;){var me=Ee;switch(me.tag){case 0:case 11:case 15:va(8,me,x)}var ge=me.child;if(ge!==null)ge.return=me,Ee=ge;else for(;Ee!==null;){me=Ee;var he=me.sibling,be=me.return;if(sx(me),me===oe){Ee=null;break}if(he!==null){he.return=be,Ee=he;break}Ee=be}}}var Ne=x.alternate;if(Ne!==null){var je=Ne.child;if(je!==null){Ne.child=null;do{var St=je.sibling;je.sibling=null,je=St}while(je!==null)}}Ee=x}}if((x.subtreeFlags&2064)!==0&&R!==null)R.return=x,Ee=R;else e:for(;Ee!==null;){if(x=Ee,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:va(9,x,x.return)}var re=x.sibling;if(re!==null){re.return=x.return,Ee=re;break e}Ee=x.return}}var J=n.current;for(Ee=J;Ee!==null;){R=Ee;var se=R.child;if((R.subtreeFlags&2064)!==0&&se!==null)se.return=R,Ee=se;else e:for(R=J;Ee!==null;){if(D=Ee,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:su(9,D)}}catch(Te){_t(D,D.return,Te)}if(D===R){Ee=null;break e}var ve=D.sibling;if(ve!==null){ve.return=D.return,Ee=ve;break e}Ee=D.return}}if(Qe=v,fs(),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(jr,n)}catch{}h=!0}return h}finally{Je=l,On.transition=i}}return!1}function xx(n,i,l){i=Xi(l,i),i=qw(n,i,1),n=ps(n,i,1),i=en(),n!==null&&(Os(n,1,i),an(n,i))}function _t(n,i,l){if(n.tag===3)xx(n,n,l);else for(;i!==null;){if(i.tag===3){xx(i,n,l);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(gs===null||!gs.has(h))){n=Xi(l,n),n=Dw(i,n,1),i=ps(i,n,1),n=en(),i!==null&&(Os(i,1,n),an(i,n));break}}i=i.return}}function rA(n,i,l){var h=n.pingCache;h!==null&&h.delete(i),i=en(),n.pingedLanes|=n.suspendedLanes&l,Lt===n&&(Ft&l)===l&&(Rt===4||Rt===3&&(Ft&130023424)===Ft&&500>st()-Yd?Qs(n,0):Gd|=l),an(n,i)}function _x(n,i){i===0&&((n.mode&1)===0?i=1:(i=Mt,Mt<<=1,(Mt&130023424)===0&&(Mt=4194304)));var l=en();n=Dr(n,i),n!==null&&(Os(n,i,l),an(n,l))}function sA(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),_x(n,l)}function iA(n,i){var l=0;switch(n.tag){case 13:var h=n.stateNode,v=n.memoizedState;v!==null&&(l=v.retryLane);break;case 19:h=n.stateNode;break;default:throw Error(r(314))}h!==null&&h.delete(i),_x(n,l)}var bx;bx=function(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps||nn.current)sn=!0;else{if((n.lanes&l)===0&&(i.flags&128)===0)return sn=!1,VR(n,i,l);sn=(n.flags&131072)!==0}else sn=!1,pt&&(i.flags&1048576)!==0&&tw(i,zl,i.index);switch(i.lanes=0,i.tag){case 2:var h=i.type;nu(n,i),n=i.pendingProps;var v=Bi(i,Ht.current);Yi(i,l),v=Ed(null,i,h,n,v,l);var x=Nd();return i.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,rn(h)?(x=!0,ql(i)):x=!1,i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,yd(i),v.updater=eu,i.stateNode=v,v._reactInternals=i,Id(i,h,n,l),i=Ld(null,i,h,!0,x,l)):(i.tag=0,pt&&x&&ld(i),Jt(null,i,v,l),i=i.child),i;case 16:h=i.elementType;e:{switch(nu(n,i),n=i.pendingProps,v=h._init,h=v(h._payload),i.type=h,v=i.tag=aA(h),n=Qn(h,n),v){case 0:i=Pd(null,i,h,n,l);break e;case 1:i=Yw(null,i,h,n,l);break e;case 11:i=Uw(null,i,h,n,l);break e;case 14:i=Hw(null,i,h,Qn(h.type,n),l);break e}throw Error(r(306,h,""))}return i;case 0:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:Qn(h,v),Pd(n,i,h,v,l);case 1:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:Qn(h,v),Yw(n,i,h,v,l);case 3:e:{if(Kw(i),n===null)throw Error(r(387));h=i.pendingProps,x=i.memoizedState,v=x.element,cw(n,i),Gl(i,h,null,l);var R=i.memoizedState;if(h=R.element,x.isDehydrated)if(x={element:h,isDehydrated:!1,cache:R.cache,pendingSuspenseBoundaries:R.pendingSuspenseBoundaries,transitions:R.transitions},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){v=Xi(Error(r(423)),i),i=Xw(n,i,h,l,v);break e}else if(h!==v){v=Xi(Error(r(424)),i),i=Xw(n,i,h,l,v);break e}else for(mn=us(i.stateNode.containerInfo.firstChild),pn=i,pt=!0,Xn=null,l=lw(i,null,h,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Wi(),h===v){i=zr(n,i,l);break e}Jt(n,i,h,l)}i=i.child}return i;case 5:return hw(i),n===null&&dd(i),h=i.type,v=i.pendingProps,x=n!==null?n.memoizedProps:null,R=v.children,nd(h,v)?R=null:x!==null&&nd(h,x)&&(i.flags|=32),Gw(n,i),Jt(n,i,R,l),i.child;case 6:return n===null&&dd(i),null;case 13:return Qw(n,i,l);case 4:return wd(i,i.stateNode.containerInfo),h=i.pendingProps,n===null?i.child=Vi(i,null,h,l):Jt(n,i,h,l),i.child;case 11:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:Qn(h,v),Uw(n,i,h,v,l);case 7:return Jt(n,i,i.pendingProps,l),i.child;case 8:return Jt(n,i,i.pendingProps.children,l),i.child;case 12:return Jt(n,i,i.pendingProps.children,l),i.child;case 10:e:{if(h=i.type._context,v=i.pendingProps,x=i.memoizedProps,R=v.value,ut(Hl,h._currentValue),h._currentValue=R,x!==null)if(nt(x.value,R)){if(x.children===v.children&&!nn.current){i=zr(n,i,l);break e}}else for(x=i.child,x!==null&&(x.return=i);x!==null;){var D=x.dependencies;if(D!==null){R=x.child;for(var K=D.firstContext;K!==null;){if(K.context===h){if(x.tag===1){K=Fr(-1,l&-l),K.tag=2;var oe=x.updateQueue;if(oe!==null){oe=oe.shared;var me=oe.pending;me===null?K.next=K:(K.next=me.next,me.next=K),oe.pending=K}}x.lanes|=l,K=x.alternate,K!==null&&(K.lanes|=l),gd(x.return,l,i),D.lanes|=l;break}K=K.next}}else if(x.tag===10)R=x.type===i.type?null:x.child;else if(x.tag===18){if(R=x.return,R===null)throw Error(r(341));R.lanes|=l,D=R.alternate,D!==null&&(D.lanes|=l),gd(R,l,i),R=x.sibling}else R=x.child;if(R!==null)R.return=x;else for(R=x;R!==null;){if(R===i){R=null;break}if(x=R.sibling,x!==null){x.return=R.return,R=x;break}R=R.return}x=R}Jt(n,i,v.children,l),i=i.child}return i;case 9:return v=i.type,h=i.pendingProps.children,Yi(i,l),v=In(v),h=h(v),i.flags|=1,Jt(n,i,h,l),i.child;case 14:return h=i.type,v=Qn(h,i.pendingProps),v=Qn(h.type,v),Hw(n,i,h,v,l);case 15:return Ww(n,i,i.type,i.pendingProps,l);case 17:return h=i.type,v=i.pendingProps,v=i.elementType===h?v:Qn(h,v),nu(n,i),i.tag=1,rn(h)?(n=!0,ql(i)):n=!1,Yi(i,l),Lw(i,h,v),Id(i,h,v,l),Ld(null,i,h,!0,n,l);case 19:return Jw(n,i,l);case 22:return Vw(n,i,l)}throw Error(r(156,i.tag))};function kx(n,i){return _i(n,i)}function oA(n,i,l,h){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pn(n,i,l,h){return new oA(n,i,l,h)}function nf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function aA(n){if(typeof n=="function")return nf(n)?1:0;if(n!=null){if(n=n.$$typeof,n===V)return 11;if(n===G)return 14}return 2}function xs(n,i){var l=n.alternate;return l===null?(l=Pn(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&14680064,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l}function hu(n,i,l,h,v,x){var R=2;if(h=n,typeof n=="function")nf(n)&&(R=1);else if(typeof n=="string")R=5;else e:switch(n){case P:return Js(l.children,v,x,i);case U:R=8,v|=8;break;case O:return n=Pn(12,l,i,v|2),n.elementType=O,n.lanes=x,n;case X:return n=Pn(13,l,i,v),n.elementType=X,n.lanes=x,n;case j:return n=Pn(19,l,i,v),n.elementType=j,n.lanes=x,n;case te:return pu(l,v,x,i);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case M:R=10;break e;case q:R=9;break e;case V:R=11;break e;case G:R=14;break e;case B:R=16,h=null;break e}throw Error(r(130,n==null?n:typeof n,""))}return i=Pn(R,l,i,v),i.elementType=n,i.type=h,i.lanes=x,i}function Js(n,i,l,h){return n=Pn(7,n,h,i),n.lanes=l,n}function pu(n,i,l,h){return n=Pn(22,n,h,i),n.elementType=te,n.lanes=l,n.stateNode={isHidden:!1},n}function rf(n,i,l){return n=Pn(6,n,null,i),n.lanes=l,n}function sf(n,i,l){return i=Pn(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}function lA(n,i,l,h,v){this.tag=i,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hn(0),this.expirationTimes=Hn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hn(0),this.identifierPrefix=h,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function of(n,i,l,h,v,x,R,D,K){return n=new lA(n,i,l,D,K),i===1?(i=1,x===!0&&(i|=8)):i=0,x=Pn(3,null,null,i),n.current=x,x.stateNode=n,x.memoizedState={element:h,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},yd(x),n}function uA(n,i,l){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:h==null?null:""+h,children:n,containerInfo:i,implementation:l}}function Sx(n){if(!n)return ds;n=n._reactInternals;e:{if(kn(n)!==n||n.tag!==1)throw Error(r(170));var i=n;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(rn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(r(171))}if(n.tag===1){var l=n.type;if(rn(l))return Z0(n,l,i)}return i}function Ex(n,i,l,h,v,x,R,D,K){return n=of(l,h,!0,n,v,x,R,D,K),n.context=Sx(null),l=n.current,h=en(),v=ys(l),x=Fr(h,v),x.callback=i??null,ps(l,x,v),n.current.lanes=v,Os(n,v,h),an(n,h),n}function mu(n,i,l,h){var v=i.current,x=en(),R=ys(v);return l=Sx(l),i.context===null?i.context=l:i.pendingContext=l,i=Fr(x,R),i.payload={element:n},h=h===void 0?null:h,h!==null&&(i.callback=h),n=ps(v,i,R),n!==null&&(er(n,v,R,x),Vl(n,v,R)),R}function gu(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function Nx(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function af(n,i){Nx(n,i),(n=n.alternate)&&Nx(n,i)}function cA(){return null}var Cx=typeof reportError=="function"?reportError:function(n){console.error(n)};function lf(n){this._internalRoot=n}vu.prototype.render=lf.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(r(409));mu(n,i,null,null)},vu.prototype.unmount=lf.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Xs(function(){mu(null,n,null,null)}),i[Pr]=null}};function vu(n){this._internalRoot=n}vu.prototype.unstable_scheduleHydration=function(n){if(n){var i=$o();n={blockedOn:null,target:n,priority:i};for(var l=0;l<Tn.length&&i!==0&&i<Tn[l].priority;l++);Tn.splice(l,0,n),l===0&&Do(n)}};function uf(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function yu(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function jx(){}function dA(n,i,l,h,v){if(v){if(typeof h=="function"){var x=h;h=function(){var oe=gu(R);x.call(oe)}}var R=Ex(i,h,n,0,null,!1,!1,"",jx);return n._reactRootContainer=R,n[Pr]=R.current,sa(n.nodeType===8?n.parentNode:n),Xs(),R}for(;v=n.lastChild;)n.removeChild(v);if(typeof h=="function"){var D=h;h=function(){var oe=gu(K);D.call(oe)}}var K=of(n,0,!1,null,null,!1,!1,"",jx);return n._reactRootContainer=K,n[Pr]=K.current,sa(n.nodeType===8?n.parentNode:n),Xs(function(){mu(i,K,l,h)}),K}function wu(n,i,l,h,v){var x=l._reactRootContainer;if(x){var R=x;if(typeof v=="function"){var D=v;v=function(){var K=gu(R);D.call(K)}}mu(i,R,n,v)}else R=dA(l,i,n,v,h);return gu(R)}hl=function(n){switch(n.tag){case 3:var i=n.stateNode;if(i.current.memoizedState.isDehydrated){var l=dr(i.pendingLanes);l!==0&&(Po(i,l|1),an(i,st()),(Qe&6)===0&&(Ji=st()+500,fs()))}break;case 13:Xs(function(){var h=Dr(n,1);if(h!==null){var v=en();er(h,n,1,v)}}),af(n,1)}},Wn=function(n){if(n.tag===13){var i=Dr(n,134217728);if(i!==null){var l=en();er(i,n,134217728,l)}af(n,134217728)}},Jr=function(n){if(n.tag===13){var i=ys(n),l=Dr(n,i);if(l!==null){var h=en();er(l,n,i,h)}af(n,i)}},$o=function(){return Je},Ei=function(n,i){var l=Je;try{return Je=n,i()}finally{Je=l}},xn=function(n,i,l){switch(i){case"input":if(we(n,l),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<l.length;i++){var h=l[i];if(h!==n&&h.form===n.form){var v=Ll(h);if(!v)throw Error(r(90));Ue(h),we(h,v)}}}break;case"textarea":et(n,l);break;case"select":i=l.value,i!=null&&ft(n,!!l.multiple,i,!1)}},pi=Jd,mi=Xs;var fA={usingClientEntryPoint:!1,Events:[aa,Fi,Ll,hi,fn,Jd]},_a={findFiberByHostInstance:Bs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hA={bundleType:_a.bundleType,version:_a.version,rendererPackageName:_a.rendererPackageName,rendererConfig:_a.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=Bt(n),n===null?null:n.stateNode},findFiberByHostInstance:_a.findFiberByHostInstance||cA,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 xu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xu.isDisabled&&xu.supportsFiber)try{jr=xu.inject(hA),Kt=xu}catch{}}return ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fA,ln.createPortal=function(n,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!uf(i))throw Error(r(200));return uA(n,i,null,l)},ln.createRoot=function(n,i){if(!uf(n))throw Error(r(299));var l=!1,h="",v=Cx;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(v=i.onRecoverableError)),i=of(n,1,!1,null,null,l,!1,h,v),n[Pr]=i.current,sa(n.nodeType===8?n.parentNode:n),new lf(i)},ln.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=Bt(i),n=n===null?null:n.stateNode,n},ln.flushSync=function(n){return Xs(n)},ln.hydrate=function(n,i,l){if(!yu(i))throw Error(r(200));return wu(null,n,i,!0,l)},ln.hydrateRoot=function(n,i,l){if(!uf(n))throw Error(r(405));var h=l!=null&&l.hydratedSources||null,v=!1,x="",R=Cx;if(l!=null&&(l.unstable_strictMode===!0&&(v=!0),l.identifierPrefix!==void 0&&(x=l.identifierPrefix),l.onRecoverableError!==void 0&&(R=l.onRecoverableError)),i=Ex(i,null,n,1,l??null,v,!1,x,R),n[Pr]=i.current,sa(n),h)for(n=0;n<h.length;n++)l=h[n],v=l._getVersion,v=v(l._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[l,v]:i.mutableSourceEagerHydrationData.push(l,v);return new vu(i)},ln.render=function(n,i,l){if(!yu(i))throw Error(r(200));return wu(null,n,i,!1,l)},ln.unmountComponentAtNode=function(n){if(!yu(n))throw Error(r(40));return n._reactRootContainer?(Xs(function(){wu(null,null,n,!1,function(){n._reactRootContainer=null,n[Pr]=null})}),!0):!1},ln.unstable_batchedUpdates=Jd,ln.unstable_renderSubtreeIntoContainer=function(n,i,l,h){if(!yu(l))throw Error(r(200));if(n==null||n._reactInternals===void 0)throw Error(r(38));return wu(n,i,l,!1,h)},ln.version="18.3.1-next-f1338f8080-20240426",ln}var Lx;function iC(){if(Lx)return ff.exports;Lx=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(t){console.error(t)}}return e(),ff.exports=xA(),ff.exports}var $x;function _A(){if($x)return bu;$x=1;var e=iC();return bu.createRoot=e.createRoot,bu.hydrateRoot=e.hydrateRoot,bu}var bA=_A(),N=Ka();const ue=My(N);function zt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,s;r<e.length;r++)(s=zt(e[r]))!==""&&(t+=(t&&" ")+s);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var mf={exports:{}},gf={},vf={exports:{}},yf={};/**
|
|
41
41
|
* @license React
|
|
42
42
|
* use-sync-external-store-shim.production.js
|
|
43
43
|
*
|
|
@@ -45,7 +45,7 @@ Error generating stack: `+x.message+`
|
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var
|
|
48
|
+
*/var qx;function kA(){if(qx)return yf;qx=1;var e=Ka();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,a=e.useLayoutEffect,u=e.useDebugValue;function c(g,y){var w=y(),S=s({inst:{value:w,getSnapshot:y}}),_=S[0].inst,b=S[1];return a(function(){_.value=w,_.getSnapshot=y,f(_)&&b({inst:_})},[g,w,y]),o(function(){return f(_)&&b({inst:_}),g(function(){f(_)&&b({inst:_})})},[g]),u(w),w}function f(g){var y=g.getSnapshot;g=g.value;try{var w=y();return!r(g,w)}catch{return!0}}function p(g,y){return y()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:c;return yf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,yf}var Dx;function SA(){return Dx||(Dx=1,vf.exports=kA()),vf.exports}/**
|
|
49
49
|
* @license React
|
|
50
50
|
* use-sync-external-store-shim/with-selector.production.js
|
|
51
51
|
*
|
|
@@ -53,45 +53,45 @@ Error generating stack: `+x.message+`
|
|
|
53
53
|
*
|
|
54
54
|
* This source code is licensed under the MIT license found in the
|
|
55
55
|
* LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/var Dx;function EA(){if(Dx)return gf;Dx=1;var e=Ka(),t=SA();function r(p,d){return p===d&&(p!==0||1/p===1/d)||p!==p&&d!==d}var s=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,a=e.useRef,u=e.useEffect,c=e.useMemo,f=e.useDebugValue;return gf.useSyncExternalStoreWithSelector=function(p,d,g,y,w){var S=a(null);if(S.current===null){var _={hasValue:!1,value:null};S.current=_}else _=S.current;S=c(function(){function k(L){if(!E){if(E=!0,C=L,L=y(L),w!==void 0&&_.hasValue){var P=_.value;if(w(P,L))return T=P}return T=L}if(P=T,s(C,L))return P;var U=y(L);return w!==void 0&&w(P,U)?(C=L,P):(C=L,T=U)}var E=!1,C,T,A=g===void 0?null:g;return[function(){return k(d())},A===null?void 0:function(){return k(A())}]},[d,g,y,w]);var b=o(p,S[0],S[1]);return u(function(){_.hasValue=!0,_.value=b},[b]),f(b),b},gf}var Fx;function NA(){return Fx||(Fx=1,mf.exports=EA()),mf.exports}var CA=NA();const jA=My(CA),TA={},zx=e=>{let t;const r=new Set,s=(d,g)=>{const y=typeof d=="function"?d(t):d;if(!Object.is(y,t)){const w=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),r.forEach(S=>S(t,w))}},o=()=>t,f={setState:s,getState:o,getInitialState:()=>p,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(TA?"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."),r.clear()}},p=t=e(s,o,f);return f},RA=e=>e?zx(e):zx,{useDebugValue:AA}=ue,{useSyncExternalStoreWithSelector:IA}=jA,MA=e=>e;function iC(e,t=MA,r){const s=IA(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return AA(s),s}const Bx=(e,t)=>{const r=RA(e),s=(o,a=t)=>iC(r,o,a);return Object.assign(s,r),s},OA=(e,t)=>e?Bx(e,t):Bx;function It(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e)if(!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const s of r)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}var PA={value:()=>{}};function uc(){for(var e=0,t=arguments.length,r={},s;e<t;++e){if(!(s=arguments[e]+"")||s in r||/[\s.]/.test(s))throw new Error("illegal type: "+s);r[s]=[]}return new zu(r)}function zu(e){this._=e}function LA(e,t){return e.trim().split(/^|\s+/).map(function(r){var s="",o=r.indexOf(".");if(o>=0&&(s=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:s}})}zu.prototype=uc.prototype={constructor:zu,on:function(e,t){var r=this._,s=LA(e+"",r),o,a=-1,u=s.length;if(arguments.length<2){for(;++a<u;)if((o=(e=s[a]).type)&&(o=$A(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<u;)if(o=(e=s[a]).type)r[o]=Ux(r[o],e.name,t);else if(t==null)for(o in r)r[o]=Ux(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new zu(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),s=0,o,a;s<o;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],s=0,o=a.length;s<o;++s)a[s].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,a=s.length;o<a;++o)s[o].value.apply(t,r)}};function $A(e,t){for(var r=0,s=e.length,o;r<s;++r)if((o=e[r]).name===t)return o.value}function Ux(e,t,r){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=PA,e=e.slice(0,s).concat(e.slice(s+1));break}return r!=null&&e.push({name:t,value:r}),e}var ny="http://www.w3.org/1999/xhtml";const Hx={svg:"http://www.w3.org/2000/svg",xhtml:ny,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function cc(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Hx.hasOwnProperty(t)?{space:Hx[t],local:e}:e}function qA(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===ny&&t.documentElement.namespaceURI===ny?t.createElement(e):t.createElementNS(r,e)}}function DA(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function oC(e){var t=cc(e);return(t.local?DA:qA)(t)}function FA(){}function Oy(e){return e==null?FA:function(){return this.querySelector(e)}}function zA(e){typeof e!="function"&&(e=Oy(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,c=s[o]=new Array(u),f,p,d=0;d<u;++d)(f=a[d])&&(p=e.call(f,f.__data__,d,a))&&("__data__"in f&&(p.__data__=f.__data__),c[d]=p);return new yn(s,this._parents)}function BA(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function UA(){return[]}function aC(e){return e==null?UA:function(){return this.querySelectorAll(e)}}function HA(e){return function(){return BA(e.apply(this,arguments))}}function WA(e){typeof e=="function"?e=HA(e):e=aC(e);for(var t=this._groups,r=t.length,s=[],o=[],a=0;a<r;++a)for(var u=t[a],c=u.length,f,p=0;p<c;++p)(f=u[p])&&(s.push(e.call(f,f.__data__,p,u)),o.push(f));return new yn(s,o)}function lC(e){return function(){return this.matches(e)}}function uC(e){return function(t){return t.matches(e)}}var VA=Array.prototype.find;function GA(e){return function(){return VA.call(this.children,e)}}function YA(){return this.firstElementChild}function KA(e){return this.select(e==null?YA:GA(typeof e=="function"?e:uC(e)))}var XA=Array.prototype.filter;function QA(){return Array.from(this.children)}function ZA(e){return function(){return XA.call(this.children,e)}}function JA(e){return this.selectAll(e==null?QA:ZA(typeof e=="function"?e:uC(e)))}function e2(e){typeof e!="function"&&(e=lC(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,c=s[o]=[],f,p=0;p<u;++p)(f=a[p])&&e.call(f,f.__data__,p,a)&&c.push(f);return new yn(s,this._parents)}function cC(e){return new Array(e.length)}function t2(){return new yn(this._enter||this._groups.map(cC),this._parents)}function Gu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Gu.prototype={constructor:Gu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function n2(e){return function(){return e}}function r2(e,t,r,s,o,a){for(var u=0,c,f=t.length,p=a.length;u<p;++u)(c=t[u])?(c.__data__=a[u],s[u]=c):r[u]=new Gu(e,a[u]);for(;u<f;++u)(c=t[u])&&(o[u]=c)}function s2(e,t,r,s,o,a,u){var c,f,p=new Map,d=t.length,g=a.length,y=new Array(d),w;for(c=0;c<d;++c)(f=t[c])&&(y[c]=w=u.call(f,f.__data__,c,t)+"",p.has(w)?o[c]=f:p.set(w,f));for(c=0;c<g;++c)w=u.call(e,a[c],c,a)+"",(f=p.get(w))?(s[c]=f,f.__data__=a[c],p.delete(w)):r[c]=new Gu(e,a[c]);for(c=0;c<d;++c)(f=t[c])&&p.get(y[c])===f&&(o[c]=f)}function i2(e){return e.__data__}function o2(e,t){if(!arguments.length)return Array.from(this,i2);var r=t?s2:r2,s=this._parents,o=this._groups;typeof e!="function"&&(e=n2(e));for(var a=o.length,u=new Array(a),c=new Array(a),f=new Array(a),p=0;p<a;++p){var d=s[p],g=o[p],y=g.length,w=a2(e.call(d,d&&d.__data__,p,s)),S=w.length,_=c[p]=new Array(S),b=u[p]=new Array(S),k=f[p]=new Array(y);r(d,g,_,b,k,w,t);for(var E=0,C=0,T,A;E<S;++E)if(T=_[E]){for(E>=C&&(C=E+1);!(A=b[C])&&++C<S;);T._next=A||null}}return u=new yn(u,s),u._enter=c,u._exit=f,u}function a2(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function l2(){return new yn(this._exit||this._groups.map(cC),this._parents)}function u2(e,t,r){var s=this.enter(),o=this,a=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?a.remove():r(a),s&&o?s.merge(o).order():o}function c2(e){for(var t=e.selection?e.selection():e,r=this._groups,s=t._groups,o=r.length,a=s.length,u=Math.min(o,a),c=new Array(o),f=0;f<u;++f)for(var p=r[f],d=s[f],g=p.length,y=c[f]=new Array(g),w,S=0;S<g;++S)(w=p[S]||d[S])&&(y[S]=w);for(;f<o;++f)c[f]=r[f];return new yn(c,this._parents)}function d2(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var s=e[t],o=s.length-1,a=s[o],u;--o>=0;)(u=s[o])&&(a&&u.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(u,a),a=u);return this}function f2(e){e||(e=h2);function t(g,y){return g&&y?e(g.__data__,y.__data__):!g-!y}for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a){for(var u=r[a],c=u.length,f=o[a]=new Array(c),p,d=0;d<c;++d)(p=u[d])&&(f[d]=p);f.sort(t)}return new yn(o,this._parents).order()}function h2(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function p2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function m2(){return Array.from(this)}function g2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],o=0,a=s.length;o<a;++o){var u=s[o];if(u)return u}return null}function v2(){let e=0;for(const t of this)++e;return e}function y2(){return!this.node()}function w2(e){for(var t=this._groups,r=0,s=t.length;r<s;++r)for(var o=t[r],a=0,u=o.length,c;a<u;++a)(c=o[a])&&e.call(c,c.__data__,a,o);return this}function x2(e){return function(){this.removeAttribute(e)}}function _2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function b2(e,t){return function(){this.setAttribute(e,t)}}function k2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function S2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function E2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function N2(e,t){var r=cc(e);if(arguments.length<2){var s=this.node();return r.local?s.getAttributeNS(r.space,r.local):s.getAttribute(r)}return this.each((t==null?r.local?_2:x2:typeof t=="function"?r.local?E2:S2:r.local?k2:b2)(r,t))}function dC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function C2(e){return function(){this.style.removeProperty(e)}}function j2(e,t,r){return function(){this.style.setProperty(e,t,r)}}function T2(e,t,r){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,r)}}function R2(e,t,r){return arguments.length>1?this.each((t==null?C2:typeof t=="function"?T2:j2)(e,t,r??"")):go(this.node(),e)}function go(e,t){return e.style.getPropertyValue(t)||dC(e).getComputedStyle(e,null).getPropertyValue(t)}function A2(e){return function(){delete this[e]}}function I2(e,t){return function(){this[e]=t}}function M2(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function O2(e,t){return arguments.length>1?this.each((t==null?A2:typeof t=="function"?M2:I2)(e,t)):this.node()[e]}function fC(e){return e.trim().split(/^|\s+/)}function Py(e){return e.classList||new hC(e)}function hC(e){this._node=e,this._names=fC(e.getAttribute("class")||"")}hC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function pC(e,t){for(var r=Py(e),s=-1,o=t.length;++s<o;)r.add(t[s])}function mC(e,t){for(var r=Py(e),s=-1,o=t.length;++s<o;)r.remove(t[s])}function P2(e){return function(){pC(this,e)}}function L2(e){return function(){mC(this,e)}}function $2(e,t){return function(){(t.apply(this,arguments)?pC:mC)(this,e)}}function q2(e,t){var r=fC(e+"");if(arguments.length<2){for(var s=Py(this.node()),o=-1,a=r.length;++o<a;)if(!s.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?$2:t?P2:L2)(r,t))}function D2(){this.textContent=""}function F2(e){return function(){this.textContent=e}}function z2(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function B2(e){return arguments.length?this.each(e==null?D2:(typeof e=="function"?z2:F2)(e)):this.node().textContent}function U2(){this.innerHTML=""}function H2(e){return function(){this.innerHTML=e}}function W2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function V2(e){return arguments.length?this.each(e==null?U2:(typeof e=="function"?W2:H2)(e)):this.node().innerHTML}function G2(){this.nextSibling&&this.parentNode.appendChild(this)}function Y2(){return this.each(G2)}function K2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function X2(){return this.each(K2)}function Q2(e){var t=typeof e=="function"?e:oC(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Z2(){return null}function J2(e,t){var r=typeof e=="function"?e:oC(e),s=t==null?Z2:typeof t=="function"?t:Oy(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),s.apply(this,arguments)||null)})}function eI(){var e=this.parentNode;e&&e.removeChild(this)}function tI(){return this.each(eI)}function nI(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rI(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function sI(e){return this.select(e?rI:nI)}function iI(e){return arguments.length?this.property("__data__",e):this.node().__data__}function oI(e){return function(t){e.call(this,t,this.__data__)}}function aI(e){return e.trim().split(/^|\s+/).map(function(t){var r="",s=t.indexOf(".");return s>=0&&(r=t.slice(s+1),t=t.slice(0,s)),{type:t,name:r}})}function lI(e){return function(){var t=this.__on;if(t){for(var r=0,s=-1,o=t.length,a;r<o;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++s]=a;++s?t.length=s:delete this.__on}}}function uI(e,t,r){return function(){var s=this.__on,o,a=oI(t);if(s){for(var u=0,c=s.length;u<c;++u)if((o=s[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=t;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:t,listener:a,options:r},s?s.push(o):this.__on=[o]}}function cI(e,t,r){var s=aI(e+""),o,a=s.length,u;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,p=c.length,d;f<p;++f)for(o=0,d=c[f];o<a;++o)if((u=s[o]).type===d.type&&u.name===d.name)return d.value}return}for(c=t?uI:lI,o=0;o<a;++o)this.each(c(s[o],t,r));return this}function gC(e,t,r){var s=dC(e),o=s.CustomEvent;typeof o=="function"?o=new o(t,r):(o=s.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function dI(e,t){return function(){return gC(this,e,t)}}function fI(e,t){return function(){return gC(this,e,t.apply(this,arguments))}}function hI(e,t){return this.each((typeof t=="function"?fI:dI)(e,t))}function*pI(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],o=0,a=s.length,u;o<a;++o)(u=s[o])&&(yield u)}var vC=[null];function yn(e,t){this._groups=e,this._parents=t}function Xa(){return new yn([[document.documentElement]],vC)}function mI(){return this}yn.prototype=Xa.prototype={constructor:yn,select:zA,selectAll:WA,selectChild:KA,selectChildren:JA,filter:e2,data:o2,enter:t2,exit:l2,join:u2,merge:c2,selection:mI,order:d2,sort:f2,call:p2,nodes:m2,node:g2,size:v2,empty:y2,each:w2,attr:N2,style:R2,property:O2,classed:q2,text:B2,html:V2,raise:Y2,lower:X2,append:Q2,insert:J2,remove:tI,clone:sI,datum:iI,on:cI,dispatch:hI,[Symbol.iterator]:pI};function $n(e){return typeof e=="string"?new yn([[document.querySelector(e)]],[document.documentElement]):new yn([[e]],vC)}function gI(e){let t;for(;t=e.sourceEvent;)e=t;return e}function nr(e,t){if(e=gI(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var s=r.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const vI={passive:!1},Oa={capture:!0,passive:!1};function wf(e){e.stopImmediatePropagation()}function co(e){e.preventDefault(),e.stopImmediatePropagation()}function yC(e){var t=e.document.documentElement,r=$n(e).on("dragstart.drag",co,Oa);"onselectstart"in t?r.on("selectstart.drag",co,Oa):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function wC(e,t){var r=e.document.documentElement,s=$n(e).on("dragstart.drag",null);t&&(s.on("click.drag",co,Oa),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in r?s.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const ku=e=>()=>e;function ry(e,{sourceEvent:t,subject:r,target:s,identifier:o,active:a,x:u,y:c,dx:f,dy:p,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:d}})}ry.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yI(e){return!e.ctrlKey&&!e.button}function wI(){return this.parentNode}function xI(e,t){return t??{x:e.x,y:e.y}}function _I(){return navigator.maxTouchPoints||"ontouchstart"in this}function bI(){var e=yI,t=wI,r=xI,s=_I,o={},a=uc("start","drag","end"),u=0,c,f,p,d,g=0;function y(T){T.on("mousedown.drag",w).filter(s).on("touchstart.drag",b).on("touchmove.drag",k,vI).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(T,A){if(!(d||!e.call(this,T,A))){var L=C(this,t.call(this,T,A),T,A,"mouse");L&&($n(T.view).on("mousemove.drag",S,Oa).on("mouseup.drag",_,Oa),yC(T.view),wf(T),p=!1,c=T.clientX,f=T.clientY,L("start",T))}}function S(T){if(co(T),!p){var A=T.clientX-c,L=T.clientY-f;p=A*A+L*L>g}o.mouse("drag",T)}function _(T){$n(T.view).on("mousemove.drag mouseup.drag",null),wC(T.view,p),co(T),o.mouse("end",T)}function b(T,A){if(e.call(this,T,A)){var L=T.changedTouches,P=t.call(this,T,A),U=L.length,O,M;for(O=0;O<U;++O)(M=C(this,P,T,A,L[O].identifier,L[O]))&&(wf(T),M("start",T,L[O]))}}function k(T){var A=T.changedTouches,L=A.length,P,U;for(P=0;P<L;++P)(U=o[A[P].identifier])&&(co(T),U("drag",T,A[P]))}function E(T){var A=T.changedTouches,L=A.length,P,U;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),P=0;P<L;++P)(U=o[A[P].identifier])&&(wf(T),U("end",T,A[P]))}function C(T,A,L,P,U,O){var M=a.copy(),q=nr(O||L,A),V,X,j;if((j=r.call(T,new ry("beforestart",{sourceEvent:L,target:y,identifier:U,active:u,x:q[0],y:q[1],dx:0,dy:0,dispatch:M}),P))!=null)return V=j.x-q[0]||0,X=j.y-q[1]||0,function G(B,te,Z){var $=q,H;switch(B){case"start":o[U]=G,H=u++;break;case"end":delete o[U],--u;case"drag":q=nr(Z||te,A),H=u;break}M.call(B,T,new ry(B,{sourceEvent:te,subject:j,target:y,identifier:U,active:H,x:q[0]+V,y:q[1]+X,dx:q[0]-$[0],dy:q[1]-$[1],dispatch:M}),P)}}return y.filter=function(T){return arguments.length?(e=typeof T=="function"?T:ku(!!T),y):e},y.container=function(T){return arguments.length?(t=typeof T=="function"?T:ku(T),y):t},y.subject=function(T){return arguments.length?(r=typeof T=="function"?T:ku(T),y):r},y.touchable=function(T){return arguments.length?(s=typeof T=="function"?T:ku(!!T),y):s},y.on=function(){var T=a.on.apply(a,arguments);return T===a?y:T},y.clickDistance=function(T){return arguments.length?(g=(T=+T)*T,y):Math.sqrt(g)},y}function Ly(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function xC(e,t){var r=Object.create(e.prototype);for(var s in t)r[s]=t[s];return r}function Qa(){}var Pa=.7,Yu=1/Pa,fo="\\s*([+-]?\\d+)\\s*",La="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_r="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kI=/^#([0-9a-f]{3,8})$/,SI=new RegExp(`^rgb\\(${fo},${fo},${fo}\\)$`),EI=new RegExp(`^rgb\\(${_r},${_r},${_r}\\)$`),NI=new RegExp(`^rgba\\(${fo},${fo},${fo},${La}\\)$`),CI=new RegExp(`^rgba\\(${_r},${_r},${_r},${La}\\)$`),jI=new RegExp(`^hsl\\(${La},${_r},${_r}\\)$`),TI=new RegExp(`^hsla\\(${La},${_r},${_r},${La}\\)$`),Wx={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};Ly(Qa,$a,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Vx,formatHex:Vx,formatHex8:RI,formatHsl:AI,formatRgb:Gx,toString:Gx});function Vx(){return this.rgb().formatHex()}function RI(){return this.rgb().formatHex8()}function AI(){return _C(this).formatHsl()}function Gx(){return this.rgb().formatRgb()}function $a(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=kI.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Yx(t):r===3?new un(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Su(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Su(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=SI.exec(e))?new un(t[1],t[2],t[3],1):(t=EI.exec(e))?new un(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=NI.exec(e))?Su(t[1],t[2],t[3],t[4]):(t=CI.exec(e))?Su(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=jI.exec(e))?Qx(t[1],t[2]/100,t[3]/100,1):(t=TI.exec(e))?Qx(t[1],t[2]/100,t[3]/100,t[4]):Wx.hasOwnProperty(e)?Yx(Wx[e]):e==="transparent"?new un(NaN,NaN,NaN,0):null}function Yx(e){return new un(e>>16&255,e>>8&255,e&255,1)}function Su(e,t,r,s){return s<=0&&(e=t=r=NaN),new un(e,t,r,s)}function II(e){return e instanceof Qa||(e=$a(e)),e?(e=e.rgb(),new un(e.r,e.g,e.b,e.opacity)):new un}function sy(e,t,r,s){return arguments.length===1?II(e):new un(e,t,r,s??1)}function un(e,t,r,s){this.r=+e,this.g=+t,this.b=+r,this.opacity=+s}Ly(un,sy,xC(Qa,{brighter(e){return e=e==null?Yu:Math.pow(Yu,e),new un(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Pa:Math.pow(Pa,e),new un(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new un(si(this.r),si(this.g),si(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:Kx,formatHex:Kx,formatHex8:MI,formatRgb:Xx,toString:Xx}));function Kx(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}`}function MI(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}${ni((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xx(){const e=Ku(this.opacity);return`${e===1?"rgb(":"rgba("}${si(this.r)}, ${si(this.g)}, ${si(this.b)}${e===1?")":`, ${e})`}`}function Ku(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function si(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ni(e){return e=si(e),(e<16?"0":"")+e.toString(16)}function Qx(e,t,r,s){return s<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new rr(e,t,r,s)}function _C(e){if(e instanceof rr)return new rr(e.h,e.s,e.l,e.opacity);if(e instanceof Qa||(e=$a(e)),!e)return new rr;if(e instanceof rr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,s=e.b/255,o=Math.min(t,r,s),a=Math.max(t,r,s),u=NaN,c=a-o,f=(a+o)/2;return c?(t===a?u=(r-s)/c+(r<s)*6:r===a?u=(s-t)/c+2:u=(t-r)/c+4,c/=f<.5?a+o:2-a-o,u*=60):c=f>0&&f<1?0:u,new rr(u,c,f,e.opacity)}function OI(e,t,r,s){return arguments.length===1?_C(e):new rr(e,t,r,s??1)}function rr(e,t,r,s){this.h=+e,this.s=+t,this.l=+r,this.opacity=+s}Ly(rr,OI,xC(Qa,{brighter(e){return e=e==null?Yu:Math.pow(Yu,e),new rr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pa:Math.pow(Pa,e),new rr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,s=r+(r<.5?r:1-r)*t,o=2*r-s;return new un(xf(e>=240?e-240:e+120,o,s),xf(e,o,s),xf(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new rr(Zx(this.h),Eu(this.s),Eu(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("}${Zx(this.h)}, ${Eu(this.s)*100}%, ${Eu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Zx(e){return e=(e||0)%360,e<0?e+360:e}function Eu(e){return Math.max(0,Math.min(1,e||0))}function xf(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const bC=e=>()=>e;function PI(e,t){return function(r){return e+r*t}}function LI(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(s){return Math.pow(e+s*t,r)}}function $I(e){return(e=+e)==1?kC:function(t,r){return r-t?LI(t,r,e):bC(isNaN(t)?r:t)}}function kC(e,t){var r=t-e;return r?PI(e,r):bC(isNaN(e)?t:e)}const Jx=(function e(t){var r=$I(t);function s(o,a){var u=r((o=sy(o)).r,(a=sy(a)).r),c=r(o.g,a.g),f=r(o.b,a.b),p=kC(o.opacity,a.opacity);return function(d){return o.r=u(d),o.g=c(d),o.b=f(d),o.opacity=p(d),o+""}}return s.gamma=e,s})(1);function ks(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var iy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_f=new RegExp(iy.source,"g");function qI(e){return function(){return e}}function DI(e){return function(t){return e(t)+""}}function FI(e,t){var r=iy.lastIndex=_f.lastIndex=0,s,o,a,u=-1,c=[],f=[];for(e=e+"",t=t+"";(s=iy.exec(e))&&(o=_f.exec(t));)(a=o.index)>r&&(a=t.slice(r,a),c[u]?c[u]+=a:c[++u]=a),(s=s[0])===(o=o[0])?c[u]?c[u]+=o:c[++u]=o:(c[++u]=null,f.push({i:u,x:ks(s,o)})),r=_f.lastIndex;return r<t.length&&(a=t.slice(r),c[u]?c[u]+=a:c[++u]=a),c.length<2?f[0]?DI(f[0].x):qI(t):(t=f.length,function(p){for(var d=0,g;d<t;++d)c[(g=f[d]).i]=g.x(p);return c.join("")})}var e_=180/Math.PI,oy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function SC(e,t,r,s,o,a){var u,c,f;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(f=e*r+t*s)&&(r-=e*f,s-=t*f),(c=Math.sqrt(r*r+s*s))&&(r/=c,s/=c,f/=c),e*s<t*r&&(e=-e,t=-t,f=-f,u=-u),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*e_,skewX:Math.atan(f)*e_,scaleX:u,scaleY:c}}var Nu;function zI(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?oy:SC(t.a,t.b,t.c,t.d,t.e,t.f)}function BI(e){return e==null||(Nu||(Nu=document.createElementNS("http://www.w3.org/2000/svg","g")),Nu.setAttribute("transform",e),!(e=Nu.transform.baseVal.consolidate()))?oy:(e=e.matrix,SC(e.a,e.b,e.c,e.d,e.e,e.f))}function EC(e,t,r,s){function o(p){return p.length?p.pop()+" ":""}function a(p,d,g,y,w,S){if(p!==g||d!==y){var _=w.push("translate(",null,t,null,r);S.push({i:_-4,x:ks(p,g)},{i:_-2,x:ks(d,y)})}else(g||y)&&w.push("translate("+g+t+y+r)}function u(p,d,g,y){p!==d?(p-d>180?d+=360:d-p>180&&(p+=360),y.push({i:g.push(o(g)+"rotate(",null,s)-2,x:ks(p,d)})):d&&g.push(o(g)+"rotate("+d+s)}function c(p,d,g,y){p!==d?y.push({i:g.push(o(g)+"skewX(",null,s)-2,x:ks(p,d)}):d&&g.push(o(g)+"skewX("+d+s)}function f(p,d,g,y,w,S){if(p!==g||d!==y){var _=w.push(o(w)+"scale(",null,",",null,")");S.push({i:_-4,x:ks(p,g)},{i:_-2,x:ks(d,y)})}else(g!==1||y!==1)&&w.push(o(w)+"scale("+g+","+y+")")}return function(p,d){var g=[],y=[];return p=e(p),d=e(d),a(p.translateX,p.translateY,d.translateX,d.translateY,g,y),u(p.rotate,d.rotate,g,y),c(p.skewX,d.skewX,g,y),f(p.scaleX,p.scaleY,d.scaleX,d.scaleY,g,y),p=d=null,function(w){for(var S=-1,_=y.length,b;++S<_;)g[(b=y[S]).i]=b.x(w);return g.join("")}}}var UI=EC(zI,"px, ","px)","deg)"),HI=EC(BI,", ",")",")"),WI=1e-12;function t_(e){return((e=Math.exp(e))+1/e)/2}function VI(e){return((e=Math.exp(e))-1/e)/2}function GI(e){return((e=Math.exp(2*e))-1)/(e+1)}const YI=(function e(t,r,s){function o(a,u){var c=a[0],f=a[1],p=a[2],d=u[0],g=u[1],y=u[2],w=d-c,S=g-f,_=w*w+S*S,b,k;if(_<WI)k=Math.log(y/p)/t,b=function(P){return[c+P*w,f+P*S,p*Math.exp(t*P*k)]};else{var E=Math.sqrt(_),C=(y*y-p*p+s*_)/(2*p*r*E),T=(y*y-p*p-s*_)/(2*y*r*E),A=Math.log(Math.sqrt(C*C+1)-C),L=Math.log(Math.sqrt(T*T+1)-T);k=(L-A)/t,b=function(P){var U=P*k,O=t_(A),M=p/(r*E)*(O*GI(t*U+A)-VI(A));return[c+M*w,f+M*S,p*O/t_(t*U+A)]}}return b.duration=k*1e3*t/Math.SQRT2,b}return o.rho=function(a){var u=Math.max(.001,+a),c=u*u,f=c*c;return e(u,c,f)},o})(Math.SQRT2,2,4);var vo=0,ja=0,_a=0,NC=1e3,Xu,Ta,Qu=0,oi=0,dc=0,qa=typeof performance=="object"&&performance.now?performance:Date,CC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $y(){return oi||(CC(KI),oi=qa.now()+dc)}function KI(){oi=0}function Zu(){this._call=this._time=this._next=null}Zu.prototype=jC.prototype={constructor:Zu,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?$y():+r)+(t==null?0:+t),!this._next&&Ta!==this&&(Ta?Ta._next=this:Xu=this,Ta=this),this._call=e,this._time=r,ay()},stop:function(){this._call&&(this._call=null,this._time=1/0,ay())}};function jC(e,t,r){var s=new Zu;return s.restart(e,t,r),s}function XI(){$y(),++vo;for(var e=Xu,t;e;)(t=oi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vo}function n_(){oi=(Qu=qa.now())+dc,vo=ja=0;try{XI()}finally{vo=0,ZI(),oi=0}}function QI(){var e=qa.now(),t=e-Qu;t>NC&&(dc-=t,Qu=e)}function ZI(){for(var e,t=Xu,r,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Xu=r);Ta=e,ay(s)}function ay(e){if(!vo){ja&&(ja=clearTimeout(ja));var t=e-oi;t>24?(e<1/0&&(ja=setTimeout(n_,e-qa.now()-dc)),_a&&(_a=clearInterval(_a))):(_a||(Qu=qa.now(),_a=setInterval(QI,NC)),vo=1,CC(n_))}}function r_(e,t,r){var s=new Zu;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,r),s}var JI=uc("start","end","cancel","interrupt"),eM=[],TC=0,s_=1,ly=2,Bu=3,i_=4,uy=5,Uu=6;function fc(e,t,r,s,o,a){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;tM(e,r,{name:t,index:s,group:o,on:JI,tween:eM,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:TC})}function qy(e,t){var r=or(e,t);if(r.state>TC)throw new Error("too late; already scheduled");return r}function br(e,t){var r=or(e,t);if(r.state>Bu)throw new Error("too late; already running");return r}function or(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function tM(e,t,r){var s=e.__transition,o;s[t]=r,r.timer=jC(a,0,r.time);function a(p){r.state=s_,r.timer.restart(u,r.delay,r.time),r.delay<=p&&u(p-r.delay)}function u(p){var d,g,y,w;if(r.state!==s_)return f();for(d in s)if(w=s[d],w.name===r.name){if(w.state===Bu)return r_(u);w.state===i_?(w.state=Uu,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete s[d]):+d<t&&(w.state=Uu,w.timer.stop(),w.on.call("cancel",e,e.__data__,w.index,w.group),delete s[d])}if(r_(function(){r.state===Bu&&(r.state=i_,r.timer.restart(c,r.delay,r.time),c(p))}),r.state=ly,r.on.call("start",e,e.__data__,r.index,r.group),r.state===ly){for(r.state=Bu,o=new Array(y=r.tween.length),d=0,g=-1;d<y;++d)(w=r.tween[d].value.call(e,e.__data__,r.index,r.group))&&(o[++g]=w);o.length=g+1}}function c(p){for(var d=p<r.duration?r.ease.call(null,p/r.duration):(r.timer.restart(f),r.state=uy,1),g=-1,y=o.length;++g<y;)o[g].call(e,d);r.state===uy&&(r.on.call("end",e,e.__data__,r.index,r.group),f())}function f(){r.state=Uu,r.timer.stop(),delete s[t];for(var p in s)return;delete e.__transition}}function Hu(e,t){var r=e.__transition,s,o,a=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((s=r[u]).name!==t){a=!1;continue}o=s.state>ly&&s.state<uy,s.state=Uu,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete r[u]}a&&delete e.__transition}}function nM(e){return this.each(function(){Hu(this,e)})}function rM(e,t){var r,s;return function(){var o=br(this,e),a=o.tween;if(a!==r){s=r=a;for(var u=0,c=s.length;u<c;++u)if(s[u].name===t){s=s.slice(),s.splice(u,1);break}}o.tween=s}}function sM(e,t,r){var s,o;if(typeof r!="function")throw new Error;return function(){var a=br(this,e),u=a.tween;if(u!==s){o=(s=u).slice();for(var c={name:t,value:r},f=0,p=o.length;f<p;++f)if(o[f].name===t){o[f]=c;break}f===p&&o.push(c)}a.tween=o}}function iM(e,t){var r=this._id;if(e+="",arguments.length<2){for(var s=or(this.node(),r).tween,o=0,a=s.length,u;o<a;++o)if((u=s[o]).name===e)return u.value;return null}return this.each((t==null?rM:sM)(r,e,t))}function Dy(e,t,r){var s=e._id;return e.each(function(){var o=br(this,s);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return or(o,s).value[t]}}function RC(e,t){var r;return(typeof t=="number"?ks:t instanceof $a?Jx:(r=$a(t))?(t=r,Jx):FI)(e,t)}function oM(e){return function(){this.removeAttribute(e)}}function aM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lM(e,t,r){var s,o=r+"",a;return function(){var u=this.getAttribute(e);return u===o?null:u===s?a:a=t(s=u,r)}}function uM(e,t,r){var s,o=r+"",a;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===s?a:a=t(s=u,r)}}function cM(e,t,r){var s,o,a;return function(){var u,c=r(this),f;return c==null?void this.removeAttribute(e):(u=this.getAttribute(e),f=c+"",u===f?null:u===s&&f===o?a:(o=f,a=t(s=u,c)))}}function dM(e,t,r){var s,o,a;return function(){var u,c=r(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),f=c+"",u===f?null:u===s&&f===o?a:(o=f,a=t(s=u,c)))}}function fM(e,t){var r=cc(e),s=r==="transform"?HI:RC;return this.attrTween(e,typeof t=="function"?(r.local?dM:cM)(r,s,Dy(this,"attr."+e,t)):t==null?(r.local?aM:oM)(r):(r.local?uM:lM)(r,s,t))}function hM(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function pM(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function mM(e,t){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&pM(e,a)),r}return o._value=t,o}function gM(e,t){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&hM(e,a)),r}return o._value=t,o}function vM(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var s=cc(e);return this.tween(r,(s.local?mM:gM)(s,t))}function yM(e,t){return function(){qy(this,e).delay=+t.apply(this,arguments)}}function wM(e,t){return t=+t,function(){qy(this,e).delay=t}}function xM(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yM:wM)(t,e)):or(this.node(),t).delay}function _M(e,t){return function(){br(this,e).duration=+t.apply(this,arguments)}}function bM(e,t){return t=+t,function(){br(this,e).duration=t}}function kM(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_M:bM)(t,e)):or(this.node(),t).duration}function SM(e,t){if(typeof t!="function")throw new Error;return function(){br(this,e).ease=t}}function EM(e){var t=this._id;return arguments.length?this.each(SM(t,e)):or(this.node(),t).ease}function NM(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;br(this,e).ease=r}}function CM(e){if(typeof e!="function")throw new Error;return this.each(NM(this._id,e))}function jM(e){typeof e!="function"&&(e=lC(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,c=s[o]=[],f,p=0;p<u;++p)(f=a[p])&&e.call(f,f.__data__,p,a)&&c.push(f);return new Gr(s,this._parents,this._name,this._id)}function TM(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,s=t.length,o=r.length,a=Math.min(s,o),u=new Array(s),c=0;c<a;++c)for(var f=t[c],p=r[c],d=f.length,g=u[c]=new Array(d),y,w=0;w<d;++w)(y=f[w]||p[w])&&(g[w]=y);for(;c<s;++c)u[c]=t[c];return new Gr(u,this._parents,this._name,this._id)}function RM(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function AM(e,t,r){var s,o,a=RM(t)?qy:br;return function(){var u=a(this,e),c=u.on;c!==s&&(o=(s=c).copy()).on(t,r),u.on=o}}function IM(e,t){var r=this._id;return arguments.length<2?or(this.node(),r).on.on(e):this.each(AM(r,e,t))}function MM(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function OM(){return this.on("end.remove",MM(this._id))}function PM(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Oy(e));for(var s=this._groups,o=s.length,a=new Array(o),u=0;u<o;++u)for(var c=s[u],f=c.length,p=a[u]=new Array(f),d,g,y=0;y<f;++y)(d=c[y])&&(g=e.call(d,d.__data__,y,c))&&("__data__"in d&&(g.__data__=d.__data__),p[y]=g,fc(p[y],t,r,y,p,or(d,r)));return new Gr(a,this._parents,t,r)}function LM(e){var t=this._name,r=this._id;typeof e!="function"&&(e=aC(e));for(var s=this._groups,o=s.length,a=[],u=[],c=0;c<o;++c)for(var f=s[c],p=f.length,d,g=0;g<p;++g)if(d=f[g]){for(var y=e.call(d,d.__data__,g,f),w,S=or(d,r),_=0,b=y.length;_<b;++_)(w=y[_])&&fc(w,t,r,_,y,S);a.push(y),u.push(d)}return new Gr(a,u,t,r)}var $M=Xa.prototype.constructor;function qM(){return new $M(this._groups,this._parents)}function DM(e,t){var r,s,o;return function(){var a=go(this,e),u=(this.style.removeProperty(e),go(this,e));return a===u?null:a===r&&u===s?o:o=t(r=a,s=u)}}function AC(e){return function(){this.style.removeProperty(e)}}function FM(e,t,r){var s,o=r+"",a;return function(){var u=go(this,e);return u===o?null:u===s?a:a=t(s=u,r)}}function zM(e,t,r){var s,o,a;return function(){var u=go(this,e),c=r(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),go(this,e))),u===f?null:u===s&&f===o?a:(o=f,a=t(s=u,c))}}function BM(e,t){var r,s,o,a="style."+t,u="end."+a,c;return function(){var f=br(this,e),p=f.on,d=f.value[a]==null?c||(c=AC(t)):void 0;(p!==r||o!==d)&&(s=(r=p).copy()).on(u,o=d),f.on=s}}function UM(e,t,r){var s=(e+="")=="transform"?UI:RC;return t==null?this.styleTween(e,DM(e,s)).on("end.style."+e,AC(e)):typeof t=="function"?this.styleTween(e,zM(e,s,Dy(this,"style."+e,t))).each(BM(this._id,e)):this.styleTween(e,FM(e,s,t),r).on("end.style."+e,null)}function HM(e,t,r){return function(s){this.style.setProperty(e,t.call(this,s),r)}}function WM(e,t,r){var s,o;function a(){var u=t.apply(this,arguments);return u!==o&&(s=(o=u)&&HM(e,u,r)),s}return a._value=t,a}function VM(e,t,r){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,WM(e,t,r??""))}function GM(e){return function(){this.textContent=e}}function YM(e){return function(){var t=e(this);this.textContent=t??""}}function KM(e){return this.tween("text",typeof e=="function"?YM(Dy(this,"text",e)):GM(e==null?"":e+""))}function XM(e){return function(t){this.textContent=e.call(this,t)}}function QM(e){var t,r;function s(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&XM(o)),t}return s._value=e,s}function ZM(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,QM(e))}function JM(){for(var e=this._name,t=this._id,r=IC(),s=this._groups,o=s.length,a=0;a<o;++a)for(var u=s[a],c=u.length,f,p=0;p<c;++p)if(f=u[p]){var d=or(f,t);fc(f,e,r,p,u,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Gr(s,this._parents,e,r)}function eO(){var e,t,r=this,s=r._id,o=r.size();return new Promise(function(a,u){var c={value:u},f={value:function(){--o===0&&a()}};r.each(function(){var p=br(this,s),d=p.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),p.on=t}),o===0&&a()})}var tO=0;function Gr(e,t,r,s){this._groups=e,this._parents=t,this._name=r,this._id=s}function IC(){return++tO}var Ur=Xa.prototype;Gr.prototype={constructor:Gr,select:PM,selectAll:LM,selectChild:Ur.selectChild,selectChildren:Ur.selectChildren,filter:jM,merge:TM,selection:qM,transition:JM,call:Ur.call,nodes:Ur.nodes,node:Ur.node,size:Ur.size,empty:Ur.empty,each:Ur.each,on:IM,attr:fM,attrTween:vM,style:UM,styleTween:VM,text:KM,textTween:ZM,remove:OM,tween:iM,delay:xM,duration:kM,ease:EM,easeVarying:CM,end:eO,[Symbol.iterator]:Ur[Symbol.iterator]};function nO(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var rO={time:null,delay:0,duration:250,ease:nO};function sO(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function iO(e){var t,r;e instanceof Gr?(t=e._id,e=e._name):(t=IC(),(r=rO).time=$y(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,a=0;a<o;++a)for(var u=s[a],c=u.length,f,p=0;p<c;++p)(f=u[p])&&fc(f,e,t,p,u,r||sO(f,t));return new Gr(s,this._parents,e,t)}Xa.prototype.interrupt=nM;Xa.prototype.transition=iO;const Cu=e=>()=>e;function oO(e,{sourceEvent:t,target:r,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Hr(e,t,r){this.k=e,this.x=t,this.y=r}Hr.prototype={constructor:Hr,scale:function(e){return e===1?this:new Hr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Hr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Vr=new Hr(1,0,0);Hr.prototype;function bf(e){e.stopImmediatePropagation()}function ba(e){e.preventDefault(),e.stopImmediatePropagation()}function aO(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function lO(){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 o_(){return this.__zoom||Vr}function uO(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function cO(){return navigator.maxTouchPoints||"ontouchstart"in this}function dO(e,t,r){var s=e.invertX(t[0][0])-r[0][0],o=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),u>a?(a+u)/2:Math.min(0,a)||Math.max(0,u))}function MC(){var e=aO,t=lO,r=dO,s=uO,o=cO,a=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,f=YI,p=uc("start","zoom","end"),d,g,y,w=500,S=150,_=0,b=10;function k(j){j.property("__zoom",o_).on("wheel.zoom",U,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",M).filter(o).on("touchstart.zoom",q).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",X).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(j,G,B,te){var Z=j.selection?j.selection():j;Z.property("__zoom",o_),j!==Z?A(j,G,B,te):Z.interrupt().each(function(){L(this,arguments).event(te).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},k.scaleBy=function(j,G,B,te){k.scaleTo(j,function(){var Z=this.__zoom.k,$=typeof G=="function"?G.apply(this,arguments):G;return Z*$},B,te)},k.scaleTo=function(j,G,B,te){k.transform(j,function(){var Z=t.apply(this,arguments),$=this.__zoom,H=B==null?T(Z):typeof B=="function"?B.apply(this,arguments):B,I=$.invert(H),Y=typeof G=="function"?G.apply(this,arguments):G;return r(C(E($,Y),H,I),Z,u)},B,te)},k.translateBy=function(j,G,B,te){k.transform(j,function(){return r(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof B=="function"?B.apply(this,arguments):B),t.apply(this,arguments),u)},null,te)},k.translateTo=function(j,G,B,te,Z){k.transform(j,function(){var $=t.apply(this,arguments),H=this.__zoom,I=te==null?T($):typeof te=="function"?te.apply(this,arguments):te;return r(Vr.translate(I[0],I[1]).scale(H.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof B=="function"?-B.apply(this,arguments):-B),$,u)},te,Z)};function E(j,G){return G=Math.max(a[0],Math.min(a[1],G)),G===j.k?j:new Hr(G,j.x,j.y)}function C(j,G,B){var te=G[0]-B[0]*j.k,Z=G[1]-B[1]*j.k;return te===j.x&&Z===j.y?j:new Hr(j.k,te,Z)}function T(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function A(j,G,B,te){j.on("start.zoom",function(){L(this,arguments).event(te).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(te).end()}).tween("zoom",function(){var Z=this,$=arguments,H=L(Z,$).event(te),I=t.apply(Z,$),Y=B==null?T(I):typeof B=="function"?B.apply(Z,$):B,ce=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),z=Z.__zoom,Q=typeof G=="function"?G.apply(Z,$):G,ne=f(z.invert(Y).concat(ce/z.k),Q.invert(Y).concat(ce/Q.k));return function(oe){if(oe===1)oe=Q;else{var fe=ne(oe),pe=ce/fe[2];oe=new Hr(pe,Y[0]-fe[0]*pe,Y[1]-fe[1]*pe)}H.zoom(null,oe)}})}function L(j,G,B){return!B&&j.__zooming||new P(j,G)}function P(j,G){this.that=j,this.args=G,this.active=0,this.sourceEvent=null,this.extent=t.apply(j,G),this.taps=0}P.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=$n(this.that).datum();p.call(j,this.that,new oO(j,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:p}),G)}};function U(j,...G){if(!e.apply(this,arguments))return;var B=L(this,G).event(j),te=this.__zoom,Z=Math.max(a[0],Math.min(a[1],te.k*Math.pow(2,s.apply(this,arguments)))),$=nr(j);if(B.wheel)(B.mouse[0][0]!==$[0]||B.mouse[0][1]!==$[1])&&(B.mouse[1]=te.invert(B.mouse[0]=$)),clearTimeout(B.wheel);else{if(te.k===Z)return;B.mouse=[$,te.invert($)],Hu(this),B.start()}ba(j),B.wheel=setTimeout(H,S),B.zoom("mouse",r(C(E(te,Z),B.mouse[0],B.mouse[1]),B.extent,u));function H(){B.wheel=null,B.end()}}function O(j,...G){if(y||!e.apply(this,arguments))return;var B=j.currentTarget,te=L(this,G,!0).event(j),Z=$n(j.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",ce,!0),$=nr(j,B),H=j.clientX,I=j.clientY;yC(j.view),bf(j),te.mouse=[$,this.__zoom.invert($)],Hu(this),te.start();function Y(z){if(ba(z),!te.moved){var Q=z.clientX-H,ne=z.clientY-I;te.moved=Q*Q+ne*ne>_}te.event(z).zoom("mouse",r(C(te.that.__zoom,te.mouse[0]=nr(z,B),te.mouse[1]),te.extent,u))}function ce(z){Z.on("mousemove.zoom mouseup.zoom",null),wC(z.view,te.moved),ba(z),te.event(z).end()}}function M(j,...G){if(e.apply(this,arguments)){var B=this.__zoom,te=nr(j.changedTouches?j.changedTouches[0]:j,this),Z=B.invert(te),$=B.k*(j.shiftKey?.5:2),H=r(C(E(B,$),te,Z),t.apply(this,G),u);ba(j),c>0?$n(this).transition().duration(c).call(A,H,te,j):$n(this).call(k.transform,H,te,j)}}function q(j,...G){if(e.apply(this,arguments)){var B=j.touches,te=B.length,Z=L(this,G,j.changedTouches.length===te).event(j),$,H,I,Y;for(bf(j),H=0;H<te;++H)I=B[H],Y=nr(I,this),Y=[Y,this.__zoom.invert(Y),I.identifier],Z.touch0?!Z.touch1&&Z.touch0[2]!==Y[2]&&(Z.touch1=Y,Z.taps=0):(Z.touch0=Y,$=!0,Z.taps=1+!!d);d&&(d=clearTimeout(d)),$&&(Z.taps<2&&(g=Y[0],d=setTimeout(function(){d=null},w)),Hu(this),Z.start())}}function V(j,...G){if(this.__zooming){var B=L(this,G).event(j),te=j.changedTouches,Z=te.length,$,H,I,Y;for(ba(j),$=0;$<Z;++$)H=te[$],I=nr(H,this),B.touch0&&B.touch0[2]===H.identifier?B.touch0[0]=I:B.touch1&&B.touch1[2]===H.identifier&&(B.touch1[0]=I);if(H=B.that.__zoom,B.touch1){var ce=B.touch0[0],z=B.touch0[1],Q=B.touch1[0],ne=B.touch1[1],oe=(oe=Q[0]-ce[0])*oe+(oe=Q[1]-ce[1])*oe,fe=(fe=ne[0]-z[0])*fe+(fe=ne[1]-z[1])*fe;H=E(H,Math.sqrt(oe/fe)),I=[(ce[0]+Q[0])/2,(ce[1]+Q[1])/2],Y=[(z[0]+ne[0])/2,(z[1]+ne[1])/2]}else if(B.touch0)I=B.touch0[0],Y=B.touch0[1];else return;B.zoom("touch",r(C(H,I,Y),B.extent,u))}}function X(j,...G){if(this.__zooming){var B=L(this,G).event(j),te=j.changedTouches,Z=te.length,$,H;for(bf(j),y&&clearTimeout(y),y=setTimeout(function(){y=null},w),$=0;$<Z;++$)H=te[$],B.touch0&&B.touch0[2]===H.identifier?delete B.touch0:B.touch1&&B.touch1[2]===H.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&(H=nr(H,this),Math.hypot(g[0]-H[0],g[1]-H[1])<b)){var I=$n(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return k.wheelDelta=function(j){return arguments.length?(s=typeof j=="function"?j:Cu(+j),k):s},k.filter=function(j){return arguments.length?(e=typeof j=="function"?j:Cu(!!j),k):e},k.touchable=function(j){return arguments.length?(o=typeof j=="function"?j:Cu(!!j),k):o},k.extent=function(j){return arguments.length?(t=typeof j=="function"?j:Cu([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),k):t},k.scaleExtent=function(j){return arguments.length?(a[0]=+j[0],a[1]=+j[1],k):[a[0],a[1]]},k.translateExtent=function(j){return arguments.length?(u[0][0]=+j[0][0],u[1][0]=+j[1][0],u[0][1]=+j[0][1],u[1][1]=+j[1][1],k):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},k.constrain=function(j){return arguments.length?(r=j,k):r},k.duration=function(j){return arguments.length?(c=+j,k):c},k.interpolate=function(j){return arguments.length?(f=j,k):f},k.on=function(){var j=p.on.apply(p,arguments);return j===p?k:j},k.clickDistance=function(j){return arguments.length?(_=(j=+j)*j,k):Math.sqrt(_)},k.tapDistance=function(j){return arguments.length?(b=+j,k):b},k}var fO=sC();const hc=N.createContext(null),hO=hc.Provider,Yr={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,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.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.`},OC=Yr.error001();function it(e,t){const r=N.useContext(hc);if(r===null)throw new Error(OC);return iC(r,e,t)}const Nt=()=>{const e=N.useContext(hc);if(e===null)throw new Error(OC);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},pO=e=>e.userSelectionActive?"none":"all";function Fy({position:e,children:t,className:r,style:s,...o}){const a=it(pO),u=`${e}`.split("-");return ue.createElement("div",{className:zt(["react-flow__panel",r,...u]),style:{...s,pointerEvents:a},...o},t)}function mO({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:ue.createElement(Fy,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ue.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const gO=({x:e,y:t,label:r,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:a={},labelBgPadding:u=[2,4],labelBgBorderRadius:c=2,children:f,className:p,...d})=>{const g=N.useRef(null),[y,w]=N.useState({x:0,y:0,width:0,height:0}),S=zt(["react-flow__edge-textwrapper",p]);return N.useEffect(()=>{if(g.current){const _=g.current.getBBox();w({x:_.x,y:_.y,width:_.width,height:_.height})}},[r]),typeof r>"u"||!r?null:ue.createElement("g",{transform:`translate(${e-y.width/2} ${t-y.height/2})`,className:S,visibility:y.width?"visible":"hidden",...d},o&&ue.createElement("rect",{width:y.width+2*u[0],x:-u[0],y:-u[1],height:y.height+2*u[1],className:"react-flow__edge-textbg",style:a,rx:c,ry:c}),ue.createElement("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:g,style:s},r),f)};var vO=N.memo(gO);const zy=e=>({width:e.offsetWidth,height:e.offsetHeight}),yo=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),By=(e={x:0,y:0},t)=>({x:yo(e.x,t[0][0],t[1][0]),y:yo(e.y,t[0][1],t[1][1])}),a_=(e,t,r)=>e<t?yo(Math.abs(e-t),1,50)/50:e>r?-yo(Math.abs(e-r),1,50)/50:0,PC=(e,t)=>{const r=a_(e.x,35,t.width-35)*20,s=a_(e.y,35,t.height-35)*20;return[r,s]},LC=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},$C=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Da=({x:e,y:t,width:r,height:s})=>({x:e,y:t,x2:e+r,y2:t+s}),qC=({x:e,y:t,x2:r,y2:s})=>({x:e,y:t,width:r-e,height:s-t}),l_=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),yO=(e,t)=>qC($C(Da(e),Da(t))),cy=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*s)},wO=e=>qn(e.width)&&qn(e.height)&&qn(e.x)&&qn(e.y),qn=e=>!isNaN(e)&&isFinite(e),bt=Symbol.for("internals"),DC=["Enter"," ","Escape"],xO=(e,t)=>{},_O=e=>"nativeEvent"in e;function dy(e){var o,a;const t=_O(e)?e.nativeEvent:e,r=((a=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:a[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(r==null?void 0:r.nodeName)||(r==null?void 0:r.hasAttribute("contenteditable"))||!!(r!=null&&r.closest(".nokey"))}const FC=e=>"clientX"in e,Ns=(e,t)=>{var a,u;const r=FC(e),s=r?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,o=r?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Ju=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Za=({id:e,path:t,labelX:r,labelY:s,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:d,markerEnd:g,markerStart:y,interactionWidth:w=20})=>ue.createElement(ue.Fragment,null,ue.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:g,markerStart:y}),w&&ue.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}),o&&qn(r)&&qn(s)?ue.createElement(vO,{x:r,y:s,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p}):null);Za.displayName="BaseEdge";function ka(e,t,r){return r===void 0?r:s=>{const o=t().edges.find(a=>a.id===e);o&&r(s,{...o})}}function zC({sourceX:e,sourceY:t,targetX:r,targetY:s}){const o=Math.abs(r-e)/2,a=r<e?r+o:r-o,u=Math.abs(s-t)/2,c=s<t?s+u:s-u;return[a,c,o,u]}function BC({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:a,targetControlX:u,targetControlY:c}){const f=e*.125+o*.375+u*.375+r*.125,p=t*.125+a*.375+c*.375+s*.125,d=Math.abs(f-e),g=Math.abs(p-t);return[f,p,d,g]}var ai;(function(e){e.Strict="strict",e.Loose="loose"})(ai||(ai={}));var ri;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ri||(ri={}));var Fa;(function(e){e.Partial="partial",e.Full="full"})(Fa||(Fa={}));var Es;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Es||(Es={}));var ec;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ec||(ec={}));var Ae;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ae||(Ae={}));function u_({pos:e,x1:t,y1:r,x2:s,y2:o}){return e===Ae.Left||e===Ae.Right?[.5*(t+s),r]:[t,.5*(r+o)]}function UC({sourceX:e,sourceY:t,sourcePosition:r=Ae.Bottom,targetX:s,targetY:o,targetPosition:a=Ae.Top}){const[u,c]=u_({pos:r,x1:e,y1:t,x2:s,y2:o}),[f,p]=u_({pos:a,x1:s,y1:o,x2:e,y2:t}),[d,g,y,w]=BC({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:u,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${u},${c} ${f},${p} ${s},${o}`,d,g,y,w]}const Uy=N.memo(({sourceX:e,sourceY:t,targetX:r,targetY:s,sourcePosition:o=Ae.Bottom,targetPosition:a=Ae.Top,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:S,interactionWidth:_})=>{const[b,k,E]=UC({sourceX:e,sourceY:t,sourcePosition:o,targetX:r,targetY:s,targetPosition:a});return ue.createElement(Za,{path:b,labelX:k,labelY:E,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:S,interactionWidth:_})});Uy.displayName="SimpleBezierEdge";const c_={[Ae.Left]:{x:-1,y:0},[Ae.Right]:{x:1,y:0},[Ae.Top]:{x:0,y:-1},[Ae.Bottom]:{x:0,y:1}},bO=({source:e,sourcePosition:t=Ae.Bottom,target:r})=>t===Ae.Left||t===Ae.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},d_=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function kO({source:e,sourcePosition:t=Ae.Bottom,target:r,targetPosition:s=Ae.Top,center:o,offset:a}){const u=c_[t],c=c_[s],f={x:e.x+u.x*a,y:e.y+u.y*a},p={x:r.x+c.x*a,y:r.y+c.y*a},d=bO({source:f,sourcePosition:t,target:p}),g=d.x!==0?"x":"y",y=d[g];let w=[],S,_;const b={x:0,y:0},k={x:0,y:0},[E,C,T,A]=zC({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(u[g]*c[g]===-1){S=o.x??E,_=o.y??C;const P=[{x:S,y:f.y},{x:S,y:p.y}],U=[{x:f.x,y:_},{x:p.x,y:_}];u[g]===y?w=g==="x"?P:U:w=g==="x"?U:P}else{const P=[{x:f.x,y:p.y}],U=[{x:p.x,y:f.y}];if(g==="x"?w=u.x===y?U:P:w=u.y===y?P:U,t===s){const X=Math.abs(e[g]-r[g]);if(X<=a){const j=Math.min(a-1,a-X);u[g]===y?b[g]=(f[g]>e[g]?-1:1)*j:k[g]=(p[g]>r[g]?-1:1)*j}}if(t!==s){const X=g==="x"?"y":"x",j=u[g]===c[X],G=f[X]>p[X],B=f[X]<p[X];(u[g]===1&&(!j&&G||j&&B)||u[g]!==1&&(!j&&B||j&&G))&&(w=g==="x"?P:U)}const O={x:f.x+b.x,y:f.y+b.y},M={x:p.x+k.x,y:p.y+k.y},q=Math.max(Math.abs(O.x-w[0].x),Math.abs(M.x-w[0].x)),V=Math.max(Math.abs(O.y-w[0].y),Math.abs(M.y-w[0].y));q>=V?(S=(O.x+M.x)/2,_=w[0].y):(S=w[0].x,_=(O.y+M.y)/2)}return[[e,{x:f.x+b.x,y:f.y+b.y},...w,{x:p.x+k.x,y:p.y+k.y},r],S,_,T,A]}function SO(e,t,r,s){const o=Math.min(d_(e,t)/2,d_(t,r)/2,s),{x:a,y:u}=t;if(e.x===a&&a===r.x||e.y===u&&u===r.y)return`L${a} ${u}`;if(e.y===u){const p=e.x<r.x?-1:1,d=e.y<r.y?1:-1;return`L ${a+o*p},${u}Q ${a},${u} ${a},${u+o*d}`}const c=e.x<r.x?1:-1,f=e.y<r.y?-1:1;return`L ${a},${u+o*f}Q ${a},${u} ${a+o*c},${u}`}function fy({sourceX:e,sourceY:t,sourcePosition:r=Ae.Bottom,targetX:s,targetY:o,targetPosition:a=Ae.Top,borderRadius:u=5,centerX:c,centerY:f,offset:p=20}){const[d,g,y,w,S]=kO({source:{x:e,y:t},sourcePosition:r,target:{x:s,y:o},targetPosition:a,center:{x:c,y:f},offset:p});return[d.reduce((b,k,E)=>{let C="";return E>0&&E<d.length-1?C=SO(d[E-1],k,d[E+1],u):C=`${E===0?"M":"L"}${k.x} ${k.y}`,b+=C,b},""),g,y,w,S]}const pc=N.memo(({sourceX:e,sourceY:t,targetX:r,targetY:s,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:d,sourcePosition:g=Ae.Bottom,targetPosition:y=Ae.Top,markerEnd:w,markerStart:S,pathOptions:_,interactionWidth:b})=>{const[k,E,C]=fy({sourceX:e,sourceY:t,sourcePosition:g,targetX:r,targetY:s,targetPosition:y,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset});return ue.createElement(Za,{path:k,labelX:E,labelY:C,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:d,markerEnd:w,markerStart:S,interactionWidth:b})});pc.displayName="SmoothStepEdge";const Hy=N.memo(e=>{var t;return ue.createElement(pc,{...e,pathOptions:N.useMemo(()=>{var r;return{borderRadius:0,offset:(r=e.pathOptions)==null?void 0:r.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});Hy.displayName="StepEdge";function EO({sourceX:e,sourceY:t,targetX:r,targetY:s}){const[o,a,u,c]=zC({sourceX:e,sourceY:t,targetX:r,targetY:s});return[`M ${e},${t}L ${r},${s}`,o,a,u,c]}const Wy=N.memo(({sourceX:e,sourceY:t,targetX:r,targetY:s,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:d,markerEnd:g,markerStart:y,interactionWidth:w})=>{const[S,_,b]=EO({sourceX:e,sourceY:t,targetX:r,targetY:s});return ue.createElement(Za,{path:S,labelX:_,labelY:b,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:d,markerEnd:g,markerStart:y,interactionWidth:w})});Wy.displayName="StraightEdge";function ju(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function f_({pos:e,x1:t,y1:r,x2:s,y2:o,c:a}){switch(e){case Ae.Left:return[t-ju(t-s,a),r];case Ae.Right:return[t+ju(s-t,a),r];case Ae.Top:return[t,r-ju(r-o,a)];case Ae.Bottom:return[t,r+ju(o-r,a)]}}function HC({sourceX:e,sourceY:t,sourcePosition:r=Ae.Bottom,targetX:s,targetY:o,targetPosition:a=Ae.Top,curvature:u=.25}){const[c,f]=f_({pos:r,x1:e,y1:t,x2:s,y2:o,c:u}),[p,d]=f_({pos:a,x1:s,y1:o,x2:e,y2:t,c:u}),[g,y,w,S]=BC({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:c,sourceControlY:f,targetControlX:p,targetControlY:d});return[`M${e},${t} C${c},${f} ${p},${d} ${s},${o}`,g,y,w,S]}const tc=N.memo(({sourceX:e,sourceY:t,targetX:r,targetY:s,sourcePosition:o=Ae.Bottom,targetPosition:a=Ae.Top,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:S,pathOptions:_,interactionWidth:b})=>{const[k,E,C]=HC({sourceX:e,sourceY:t,sourcePosition:o,targetX:r,targetY:s,targetPosition:a,curvature:_==null?void 0:_.curvature});return ue.createElement(Za,{path:k,labelX:E,labelY:C,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:S,interactionWidth:b})});tc.displayName="BezierEdge";const Vy=N.createContext(null),NO=Vy.Provider;Vy.Consumer;const CO=()=>N.useContext(Vy),jO=e=>"id"in e&&"source"in e&&"target"in e,TO=({source:e,sourceHandle:t,target:r,targetHandle:s})=>`reactflow__edge-${e}${t||""}-${r}${s||""}`,hy=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`,RO=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),AO=(e,t)=>{if(!e.source||!e.target)return t;let r;return jO(e)?r={...e}:r={...e,id:TO(e)},RO(r,t)?t:t.concat(r)},py=({x:e,y:t},[r,s,o],a,[u,c])=>{const f={x:(e-r)/o,y:(t-s)/o};return a?{x:u*Math.round(f.x/u),y:c*Math.round(f.y/c)}:f},WC=({x:e,y:t},[r,s,o])=>({x:e*o+r,y:t*o+s}),ii=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const r=(e.width??0)*t[0],s=(e.height??0)*t[1],o={x:e.position.x-r,y:e.position.y-s};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-r,y:e.positionAbsolute.y-s}:o}},mc=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((s,o)=>{const{x:a,y:u}=ii(o,t).positionAbsolute;return $C(s,Da({x:a,y:u,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return qC(r)},VC=(e,t,[r,s,o]=[0,0,1],a=!1,u=!1,c=[0,0])=>{const f={x:(t.x-r)/o,y:(t.y-s)/o,width:t.width/o,height:t.height/o},p=[];return e.forEach(d=>{const{width:g,height:y,selectable:w=!0,hidden:S=!1}=d;if(u&&!w||S)return!1;const{positionAbsolute:_}=ii(d,c),b={x:_.x,y:_.y,width:g||0,height:y||0},k=cy(f,b),E=typeof g>"u"||typeof y>"u"||g===null||y===null,C=a&&k>0,T=(g||0)*(y||0);(E||C||k>=T||d.dragging)&&p.push(d)}),p},GC=(e,t)=>{const r=e.map(s=>s.id);return t.filter(s=>r.includes(s.source)||r.includes(s.target))},YC=(e,t,r,s,o,a=.1)=>{const u=t/(e.width*(1+a)),c=r/(e.height*(1+a)),f=Math.min(u,c),p=yo(f,s,o),d=e.x+e.width/2,g=e.y+e.height/2,y=t/2-d*p,w=r/2-g*p;return{x:y,y:w,zoom:p}},ti=(e,t=0)=>e.transition().duration(t);function h_(e,t,r,s){return(t[r]||[]).reduce((o,a)=>{var u,c;return`${e.id}-${a.id}-${r}`!==s&&o.push({id:a.id||null,type:r,nodeId:e.id,x:(((u=e.positionAbsolute)==null?void 0:u.x)??0)+a.x+a.width/2,y:(((c=e.positionAbsolute)==null?void 0:c.y)??0)+a.y+a.height/2}),o},[])}function IO(e,t,r,s,o,a){const{x:u,y:c}=Ns(e),p=t.elementsFromPoint(u,c).find(S=>S.classList.contains("react-flow__handle"));if(p){const S=p.getAttribute("data-nodeid");if(S){const _=Gy(void 0,p),b=p.getAttribute("data-handleid"),k=a({nodeId:S,id:b,type:_});if(k){const E=o.find(C=>C.nodeId===S&&C.type===_&&C.id===b);return{handle:{id:b,type:_,nodeId:S,x:(E==null?void 0:E.x)||r.x,y:(E==null?void 0:E.y)||r.y},validHandleResult:k}}}}let d=[],g=1/0;if(o.forEach(S=>{const _=Math.sqrt((S.x-r.x)**2+(S.y-r.y)**2);if(_<=s){const b=a(S);_<=g&&(_<g?d=[{handle:S,validHandleResult:b}]:_===g&&d.push({handle:S,validHandleResult:b}),g=_)}}),!d.length)return{handle:null,validHandleResult:KC()};if(d.length===1)return d[0];const y=d.some(({validHandleResult:S})=>S.isValid),w=d.some(({handle:S})=>S.type==="target");return d.find(({handle:S,validHandleResult:_})=>w?S.type==="target":y?_.isValid:!0)||d[0]}const MO={source:null,target:null,sourceHandle:null,targetHandle:null},KC=()=>({handleDomNode:null,isValid:!1,connection:MO,endHandle:null});function XC(e,t,r,s,o,a,u){const c=o==="target",f=u.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),p={...KC(),handleDomNode:f};if(f){const d=Gy(void 0,f),g=f.getAttribute("data-nodeid"),y=f.getAttribute("data-handleid"),w=f.classList.contains("connectable"),S=f.classList.contains("connectableend"),_={source:c?g:r,sourceHandle:c?y:s,target:c?r:g,targetHandle:c?s:y};p.connection=_,w&&S&&(t===ai.Strict?c&&d==="source"||!c&&d==="target":g!==r||y!==s)&&(p.endHandle={nodeId:g,handleId:y,type:d},p.isValid=a(_))}return p}function OO({nodes:e,nodeId:t,handleId:r,handleType:s}){return e.reduce((o,a)=>{if(a[bt]){const{handleBounds:u}=a[bt];let c=[],f=[];u&&(c=h_(a,u,"source",`${t}-${r}-${s}`),f=h_(a,u,"target",`${t}-${r}-${s}`)),o.push(...c,...f)}return o},[])}function Gy(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function kf(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function PO(e,t){let r=null;return t?r="valid":e&&!t&&(r="invalid"),r}function QC({event:e,handleId:t,nodeId:r,onConnect:s,isTarget:o,getState:a,setState:u,isValidConnection:c,edgeUpdaterType:f,onReconnectEnd:p}){const d=LC(e.target),{connectionMode:g,domNode:y,autoPanOnConnect:w,connectionRadius:S,onConnectStart:_,panBy:b,getNodes:k,cancelConnection:E}=a();let C=0,T;const{x:A,y:L}=Ns(e),P=d==null?void 0:d.elementFromPoint(A,L),U=Gy(f,P),O=y==null?void 0:y.getBoundingClientRect();if(!O||!U)return;let M,q=Ns(e,O),V=!1,X=null,j=!1,G=null;const B=OO({nodes:k(),nodeId:r,handleId:t,handleType:U}),te=()=>{if(!w)return;const[H,I]=PC(q,O);b({x:H,y:I}),C=requestAnimationFrame(te)};u({connectionPosition:q,connectionStatus:null,connectionNodeId:r,connectionHandleId:t,connectionHandleType:U,connectionStartHandle:{nodeId:r,handleId:t,type:U},connectionEndHandle:null}),_==null||_(e,{nodeId:r,handleId:t,handleType:U});function Z(H){const{transform:I}=a();q=Ns(H,O);const{handle:Y,validHandleResult:ce}=IO(H,d,py(q,I,!1,[1,1]),S,B,z=>XC(z,g,r,t,o?"target":"source",c,d));if(T=Y,V||(te(),V=!0),G=ce.handleDomNode,X=ce.connection,j=ce.isValid,u({connectionPosition:T&&j?WC({x:T.x,y:T.y},I):q,connectionStatus:PO(!!T,j),connectionEndHandle:ce.endHandle}),!T&&!j&&!G)return kf(M);X.source!==X.target&&G&&(kf(M),M=G,G.classList.add("connecting","react-flow__handle-connecting"),G.classList.toggle("valid",j),G.classList.toggle("react-flow__handle-valid",j))}function $(H){var I,Y;(T||G)&&X&&j&&(s==null||s(X)),(Y=(I=a()).onConnectEnd)==null||Y.call(I,H),f&&(p==null||p(H)),kf(M),E(),cancelAnimationFrame(C),V=!1,j=!1,X=null,G=null,d.removeEventListener("mousemove",Z),d.removeEventListener("mouseup",$),d.removeEventListener("touchmove",Z),d.removeEventListener("touchend",$)}d.addEventListener("mousemove",Z),d.addEventListener("mouseup",$),d.addEventListener("touchmove",Z),d.addEventListener("touchend",$)}const p_=()=>!0,LO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),$O=(e,t,r)=>s=>{const{connectionStartHandle:o,connectionEndHandle:a,connectionClickStartHandle:u}=s;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===r||(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===r,clickConnecting:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.handleId)===t&&(u==null?void 0:u.type)===r}},ZC=N.forwardRef(({type:e="source",position:t=Ae.Top,isValidConnection:r,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:u,onConnect:c,children:f,className:p,onMouseDown:d,onTouchStart:g,...y},w)=>{var O,M;const S=u||null,_=e==="target",b=Nt(),k=CO(),{connectOnClick:E,noPanClassName:C}=it(LO,It),{connecting:T,clickConnecting:A}=it($O(k,S,e),It);k||(M=(O=b.getState()).onError)==null||M.call(O,"010",Yr.error010());const L=q=>{const{defaultEdgeOptions:V,onConnect:X,hasDefaultEdges:j}=b.getState(),G={...V,...q};if(j){const{edges:B,setEdges:te}=b.getState();te(AO(G,B))}X==null||X(G),c==null||c(G)},P=q=>{if(!k)return;const V=FC(q);o&&(V&&q.button===0||!V)&&QC({event:q,handleId:S,nodeId:k,onConnect:L,isTarget:_,getState:b.getState,setState:b.setState,isValidConnection:r||b.getState().isValidConnection||p_}),V?d==null||d(q):g==null||g(q)},U=q=>{const{onClickConnectStart:V,onClickConnectEnd:X,connectionClickStartHandle:j,connectionMode:G,isValidConnection:B}=b.getState();if(!k||!j&&!o)return;if(!j){V==null||V(q,{nodeId:k,handleId:S,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:k,type:e,handleId:S}});return}const te=LC(q.target),Z=r||B||p_,{connection:$,isValid:H}=XC({nodeId:k,id:S,type:e},G,j.nodeId,j.handleId||null,j.type,Z,te);H&&L($),X==null||X(q),b.setState({connectionClickStartHandle:null})};return ue.createElement("div",{"data-handleid":S,"data-nodeid":k,"data-handlepos":t,"data-id":`${k}-${S}-${e}`,className:zt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",C,p,{source:!_,target:_,connectable:s,connectablestart:o,connectableend:a,connecting:A,connectionindicator:s&&(o&&!T||a&&T)}]),onMouseDown:P,onTouchStart:P,onClick:E?U:void 0,ref:w,...y},f)});ZC.displayName="Handle";var wo=N.memo(ZC);const JC=({data:e,isConnectable:t,targetPosition:r=Ae.Top,sourcePosition:s=Ae.Bottom})=>ue.createElement(ue.Fragment,null,ue.createElement(wo,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,ue.createElement(wo,{type:"source",position:s,isConnectable:t}));JC.displayName="DefaultNode";var my=N.memo(JC);const ej=({data:e,isConnectable:t,sourcePosition:r=Ae.Bottom})=>ue.createElement(ue.Fragment,null,e==null?void 0:e.label,ue.createElement(wo,{type:"source",position:r,isConnectable:t}));ej.displayName="InputNode";var tj=N.memo(ej);const nj=({data:e,isConnectable:t,targetPosition:r=Ae.Top})=>ue.createElement(ue.Fragment,null,ue.createElement(wo,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label);nj.displayName="OutputNode";var rj=N.memo(nj);const Yy=()=>null;Yy.displayName="GroupNode";const qO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Tu=e=>e.id;function DO(e,t){return It(e.selectedNodes.map(Tu),t.selectedNodes.map(Tu))&&It(e.selectedEdges.map(Tu),t.selectedEdges.map(Tu))}const sj=N.memo(({onSelectionChange:e})=>{const t=Nt(),{selectedNodes:r,selectedEdges:s}=it(qO,DO);return N.useEffect(()=>{const o={nodes:r,edges:s};e==null||e(o),t.getState().onSelectionChange.forEach(a=>a(o))},[r,s,e]),null});sj.displayName="SelectionListener";const FO=e=>!!e.onSelectionChange;function zO({onSelectionChange:e}){const t=it(FO);return e||t?ue.createElement(sj,{onSelectionChange:e}):null}const BO=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 to(e,t){N.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function We(e,t,r){N.useEffect(()=>{typeof t<"u"&&r({[e]:t})},[t])}const UO=({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,onConnect:o,onConnectStart:a,onConnectEnd:u,onClickConnectStart:c,onClickConnectEnd:f,nodesDraggable:p,nodesConnectable:d,nodesFocusable:g,edgesFocusable:y,edgesUpdatable:w,elevateNodesOnSelect:S,minZoom:_,maxZoom:b,nodeExtent:k,onNodesChange:E,onEdgesChange:C,elementsSelectable:T,connectionMode:A,snapGrid:L,snapToGrid:P,translateExtent:U,connectOnClick:O,defaultEdgeOptions:M,fitView:q,fitViewOptions:V,onNodesDelete:X,onEdgesDelete:j,onNodeDrag:G,onNodeDragStart:B,onNodeDragStop:te,onSelectionDrag:Z,onSelectionDragStart:$,onSelectionDragStop:H,noPanClassName:I,nodeOrigin:Y,rfId:ce,autoPanOnConnect:z,autoPanOnNodeDrag:Q,onError:ne,connectionRadius:oe,isValidConnection:fe,nodeDragThreshold:pe})=>{const{setNodes:ye,setEdges:Me,setDefaultNodesAndEdges:Ue,setMinZoom:ze,setMaxZoom:Ie,setTranslateExtent:ke,setNodeExtent:le,reset:we}=it(BO,It),xe=Nt();return N.useEffect(()=>{const Ye=s==null?void 0:s.map(gt=>({...gt,...M}));return Ue(r,Ye),()=>{we()}},[]),We("defaultEdgeOptions",M,xe.setState),We("connectionMode",A,xe.setState),We("onConnect",o,xe.setState),We("onConnectStart",a,xe.setState),We("onConnectEnd",u,xe.setState),We("onClickConnectStart",c,xe.setState),We("onClickConnectEnd",f,xe.setState),We("nodesDraggable",p,xe.setState),We("nodesConnectable",d,xe.setState),We("nodesFocusable",g,xe.setState),We("edgesFocusable",y,xe.setState),We("edgesUpdatable",w,xe.setState),We("elementsSelectable",T,xe.setState),We("elevateNodesOnSelect",S,xe.setState),We("snapToGrid",P,xe.setState),We("snapGrid",L,xe.setState),We("onNodesChange",E,xe.setState),We("onEdgesChange",C,xe.setState),We("connectOnClick",O,xe.setState),We("fitViewOnInit",q,xe.setState),We("fitViewOnInitOptions",V,xe.setState),We("onNodesDelete",X,xe.setState),We("onEdgesDelete",j,xe.setState),We("onNodeDrag",G,xe.setState),We("onNodeDragStart",B,xe.setState),We("onNodeDragStop",te,xe.setState),We("onSelectionDrag",Z,xe.setState),We("onSelectionDragStart",$,xe.setState),We("onSelectionDragStop",H,xe.setState),We("noPanClassName",I,xe.setState),We("nodeOrigin",Y,xe.setState),We("rfId",ce,xe.setState),We("autoPanOnConnect",z,xe.setState),We("autoPanOnNodeDrag",Q,xe.setState),We("onError",ne,xe.setState),We("connectionRadius",oe,xe.setState),We("isValidConnection",fe,xe.setState),We("nodeDragThreshold",pe,xe.setState),to(e,ye),to(t,Me),to(_,ze),to(b,Ie),to(U,ke),to(k,le),null},m_={display:"none"},HO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ij="react-flow__node-desc",oj="react-flow__edge-desc",WO="react-flow__aria-live",VO=e=>e.ariaLiveMessage;function GO({rfId:e}){const t=it(VO);return ue.createElement("div",{id:`${WO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:HO},t)}function YO({rfId:e,disableKeyboardA11y:t}){return ue.createElement(ue.Fragment,null,ue.createElement("div",{id:`${ij}-${e}`,style:m_},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ue.createElement("div",{id:`${oj}-${e}`,style:m_},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&ue.createElement(GO,{rfId:e}))}var za=(e=null,t={actInsideInputWithModifier:!0})=>{const[r,s]=N.useState(!1),o=N.useRef(!1),a=N.useRef(new Set([])),[u,c]=N.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.split("+")),d=p.reduce((g,y)=>g.concat(...y),[]);return[p,d]}return[[],[]]},[e]);return N.useEffect(()=>{const f=typeof document<"u"?document:null,p=(t==null?void 0:t.target)||f;if(e!==null){const d=w=>{if(o.current=w.ctrlKey||w.metaKey||w.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&dy(w))return!1;const _=v_(w.code,c);a.current.add(w[_]),g_(u,a.current,!1)&&(w.preventDefault(),s(!0))},g=w=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&dy(w))return!1;const _=v_(w.code,c);g_(u,a.current,!0)?(s(!1),a.current.clear()):a.current.delete(w[_]),w.key==="Meta"&&a.current.clear(),o.current=!1},y=()=>{a.current.clear(),s(!1)};return p==null||p.addEventListener("keydown",d),p==null||p.addEventListener("keyup",g),window.addEventListener("blur",y),()=>{p==null||p.removeEventListener("keydown",d),p==null||p.removeEventListener("keyup",g),window.removeEventListener("blur",y)}}},[e,s]),r};function g_(e,t,r){return e.filter(s=>r||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function v_(e,t){return t.includes(e)?"code":"key"}function aj(e,t,r,s){var c,f;const o=e.parentNode||e.parentId;if(!o)return r;const a=t.get(o),u=ii(a,s);return aj(a,t,{x:(r.x??0)+u.x,y:(r.y??0)+u.y,z:(((c=a[bt])==null?void 0:c.z)??0)>(r.z??0)?((f=a[bt])==null?void 0:f.z)??0:r.z??0},s)}function lj(e,t,r){e.forEach(s=>{var a;const o=s.parentNode||s.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||r!=null&&r[s.id]){const{x:u,y:c,z:f}=aj(s,e,{...s.position,z:((a=s[bt])==null?void 0:a.z)??0},t);s.positionAbsolute={x:u,y:c},s[bt].z=f,r!=null&&r[s.id]&&(s[bt].isParent=!0)}})}function Sf(e,t,r,s){const o=new Map,a={},u=s?1e3:0;return e.forEach(c=>{var w;const f=(qn(c.zIndex)?c.zIndex:0)+(c.selected?u:0),p=t.get(c.id),d={...c,positionAbsolute:{x:c.position.x,y:c.position.y}},g=c.parentNode||c.parentId;g&&(a[g]=!0);const y=(p==null?void 0:p.type)&&(p==null?void 0:p.type)!==c.type;Object.defineProperty(d,bt,{enumerable:!1,value:{handleBounds:y||(w=p==null?void 0:p[bt])==null?void 0:w.handleBounds,z:f}}),o.set(c.id,d)}),lj(o,r,a),o}function uj(e,t={}){const{getNodes:r,width:s,height:o,minZoom:a,maxZoom:u,d3Zoom:c,d3Selection:f,fitViewOnInitDone:p,fitViewOnInit:d,nodeOrigin:g}=e(),y=t.initial&&!p&&d;if(c&&f&&(y||!t.initial)){const S=r().filter(b=>{var E;const k=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return(E=t.nodes)!=null&&E.length?k&&t.nodes.some(C=>C.id===b.id):k}),_=S.every(b=>b.width&&b.height);if(S.length>0&&_){const b=mc(S,g),{x:k,y:E,zoom:C}=YC(b,s,o,t.minZoom??a,t.maxZoom??u,t.padding??.1),T=Vr.translate(k,E).scale(C);return typeof t.duration=="number"&&t.duration>0?c.transform(ti(f,t.duration),T):c.transform(f,T),!0}}return!1}function KO(e,t){return e.forEach(r=>{const s=t.get(r.id);s&&t.set(s.id,{...s,[bt]:s[bt],selected:r.selected})}),new Map(t)}function XO(e,t){return t.map(r=>{const s=e.find(o=>o.id===r.id);return s&&(r.selected=s.selected),r})}function Ru({changedNodes:e,changedEdges:t,get:r,set:s}){const{nodeInternals:o,edges:a,onNodesChange:u,onEdgesChange:c,hasDefaultNodes:f,hasDefaultEdges:p}=r();e!=null&&e.length&&(f&&s({nodeInternals:KO(e,o)}),u==null||u(e)),t!=null&&t.length&&(p&&s({edges:XO(t,a)}),c==null||c(t))}const no=()=>{},QO={zoomIn:no,zoomOut:no,zoomTo:no,getZoom:()=>1,setViewport:no,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:no,fitBounds:no,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},ZO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),JO=()=>{const e=Nt(),{d3Zoom:t,d3Selection:r}=it(ZO,It);return N.useMemo(()=>r&&t?{zoomIn:o=>t.scaleBy(ti(r,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(ti(r,o==null?void 0:o.duration),1/1.2),zoomTo:(o,a)=>t.scaleTo(ti(r,a==null?void 0:a.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,a)=>{const[u,c,f]=e.getState().transform,p=Vr.translate(o.x??u,o.y??c).scale(o.zoom??f);t.transform(ti(r,a==null?void 0:a.duration),p)},getViewport:()=>{const[o,a,u]=e.getState().transform;return{x:o,y:a,zoom:u}},fitView:o=>uj(e.getState,o),setCenter:(o,a,u)=>{const{width:c,height:f,maxZoom:p}=e.getState(),d=typeof(u==null?void 0:u.zoom)<"u"?u.zoom:p,g=c/2-o*d,y=f/2-a*d,w=Vr.translate(g,y).scale(d);t.transform(ti(r,u==null?void 0:u.duration),w)},fitBounds:(o,a)=>{const{width:u,height:c,minZoom:f,maxZoom:p}=e.getState(),{x:d,y:g,zoom:y}=YC(o,u,c,f,p,(a==null?void 0:a.padding)??.1),w=Vr.translate(d,g).scale(y);t.transform(ti(r,a==null?void 0:a.duration),w)},project:o=>{const{transform:a,snapToGrid:u,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"),py(o,a,u,c)},screenToFlowPosition:o=>{const{transform:a,snapToGrid:u,snapGrid:c,domNode:f}=e.getState();if(!f)return o;const{x:p,y:d}=f.getBoundingClientRect(),g={x:o.x-p,y:o.y-d};return py(g,a,u,c)},flowToScreenPosition:o=>{const{transform:a,domNode:u}=e.getState();if(!u)return o;const{x:c,y:f}=u.getBoundingClientRect(),p=WC(o,a);return{x:p.x+c,y:p.y+f}},viewportInitialized:!0}:QO,[t,r])};function Ja(){const e=JO(),t=Nt(),r=N.useCallback(()=>t.getState().getNodes().map(_=>({..._})),[]),s=N.useCallback(_=>t.getState().nodeInternals.get(_),[]),o=N.useCallback(()=>{const{edges:_=[]}=t.getState();return _.map(b=>({...b}))},[]),a=N.useCallback(_=>{const{edges:b=[]}=t.getState();return b.find(k=>k.id===_)},[]),u=N.useCallback(_=>{const{getNodes:b,setNodes:k,hasDefaultNodes:E,onNodesChange:C}=t.getState(),T=b(),A=typeof _=="function"?_(T):_;if(E)k(A);else if(C){const L=A.length===0?T.map(P=>({type:"remove",id:P.id})):A.map(P=>({item:P,type:"reset"}));C(L)}},[]),c=N.useCallback(_=>{const{edges:b=[],setEdges:k,hasDefaultEdges:E,onEdgesChange:C}=t.getState(),T=typeof _=="function"?_(b):_;if(E)k(T);else if(C){const A=T.length===0?b.map(L=>({type:"remove",id:L.id})):T.map(L=>({item:L,type:"reset"}));C(A)}},[]),f=N.useCallback(_=>{const b=Array.isArray(_)?_:[_],{getNodes:k,setNodes:E,hasDefaultNodes:C,onNodesChange:T}=t.getState();if(C){const L=[...k(),...b];E(L)}else if(T){const A=b.map(L=>({item:L,type:"add"}));T(A)}},[]),p=N.useCallback(_=>{const b=Array.isArray(_)?_:[_],{edges:k=[],setEdges:E,hasDefaultEdges:C,onEdgesChange:T}=t.getState();if(C)E([...k,...b]);else if(T){const A=b.map(L=>({item:L,type:"add"}));T(A)}},[]),d=N.useCallback(()=>{const{getNodes:_,edges:b=[],transform:k}=t.getState(),[E,C,T]=k;return{nodes:_().map(A=>({...A})),edges:b.map(A=>({...A})),viewport:{x:E,y:C,zoom:T}}},[]),g=N.useCallback(({nodes:_,edges:b})=>{const{nodeInternals:k,getNodes:E,edges:C,hasDefaultNodes:T,hasDefaultEdges:A,onNodesDelete:L,onEdgesDelete:P,onNodesChange:U,onEdgesChange:O}=t.getState(),M=(_||[]).map(G=>G.id),q=(b||[]).map(G=>G.id),V=E().reduce((G,B)=>{const te=B.parentNode||B.parentId,Z=!M.includes(B.id)&&te&&G.find(H=>H.id===te);return(typeof B.deletable=="boolean"?B.deletable:!0)&&(M.includes(B.id)||Z)&&G.push(B),G},[]),X=C.filter(G=>typeof G.deletable=="boolean"?G.deletable:!0),j=X.filter(G=>q.includes(G.id));if(V||j){const G=GC(V,X),B=[...j,...G],te=B.reduce((Z,$)=>(Z.includes($.id)||Z.push($.id),Z),[]);if((A||T)&&(A&&t.setState({edges:C.filter(Z=>!te.includes(Z.id))}),T&&(V.forEach(Z=>{k.delete(Z.id)}),t.setState({nodeInternals:new Map(k)}))),te.length>0&&(P==null||P(B),O&&O(te.map(Z=>({id:Z,type:"remove"})))),V.length>0&&(L==null||L(V),U)){const Z=V.map($=>({id:$.id,type:"remove"}));U(Z)}}},[]),y=N.useCallback(_=>{const b=wO(_),k=b?null:t.getState().nodeInternals.get(_.id);return!b&&!k?[null,null,b]:[b?_:l_(k),k,b]},[]),w=N.useCallback((_,b=!0,k)=>{const[E,C,T]=y(_);return E?(k||t.getState().getNodes()).filter(A=>{if(!T&&(A.id===C.id||!A.positionAbsolute))return!1;const L=l_(A),P=cy(L,E);return b&&P>0||P>=E.width*E.height}):[]},[]),S=N.useCallback((_,b,k=!0)=>{const[E]=y(_);if(!E)return!1;const C=cy(E,b);return k&&C>0||C>=E.width*E.height},[]);return N.useMemo(()=>({...e,getNodes:r,getNode:s,getEdges:o,getEdge:a,setNodes:u,setEdges:c,addNodes:f,addEdges:p,toObject:d,deleteElements:g,getIntersectingNodes:w,isNodeIntersecting:S}),[e,r,s,o,a,u,c,f,p,d,g,w,S])}const eP={actInsideInputWithModifier:!1};var tP=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const r=Nt(),{deleteElements:s}=Ja(),o=za(e,eP),a=za(t);N.useEffect(()=>{if(o){const{edges:u,getNodes:c}=r.getState(),f=c().filter(d=>d.selected),p=u.filter(d=>d.selected);s({nodes:f,edges:p}),r.setState({nodesSelectionActive:!1})}},[o]),N.useEffect(()=>{r.setState({multiSelectionActive:a})},[a])};function nP(e){const t=Nt();N.useEffect(()=>{let r;const s=()=>{var a,u;if(!e.current)return;const o=zy(e.current);(o.height===0||o.width===0)&&((u=(a=t.getState()).onError)==null||u.call(a,"004",Yr.error004())),t.setState({width:o.width||500,height:o.height||500})};return s(),window.addEventListener("resize",s),e.current&&(r=new ResizeObserver(()=>s()),r.observe(e.current)),()=>{window.removeEventListener("resize",s),r&&e.current&&r.unobserve(e.current)}},[])}const Ky={position:"absolute",width:"100%",height:"100%",top:0,left:0},rP=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Au=e=>({x:e.x,y:e.y,zoom:e.k}),ro=(e,t)=>e.target.closest(`.${t}`),y_=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),w_=e=>{const t=e.ctrlKey&&Ju()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},sP=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),iP=({onMove:e,onMoveStart:t,onMoveEnd:r,onPaneContextMenu:s,zoomOnScroll:o=!0,zoomOnPinch:a=!0,panOnScroll:u=!1,panOnScrollSpeed:c=.5,panOnScrollMode:f=ri.Free,zoomOnDoubleClick:p=!0,elementsSelectable:d,panOnDrag:g=!0,defaultViewport:y,translateExtent:w,minZoom:S,maxZoom:_,zoomActivationKeyCode:b,preventScrolling:k=!0,children:E,noWheelClassName:C,noPanClassName:T})=>{const A=N.useRef(),L=Nt(),P=N.useRef(!1),U=N.useRef(!1),O=N.useRef(null),M=N.useRef({x:0,y:0,zoom:0}),{d3Zoom:q,d3Selection:V,d3ZoomHandler:X,userSelectionActive:j}=it(sP,It),G=za(b),B=N.useRef(0),te=N.useRef(!1),Z=N.useRef();return nP(O),N.useEffect(()=>{if(O.current){const $=O.current.getBoundingClientRect(),H=MC().scaleExtent([S,_]).translateExtent(w),I=$n(O.current).call(H),Y=Vr.translate(y.x,y.y).scale(yo(y.zoom,S,_)),ce=[[0,0],[$.width,$.height]],z=H.constrain()(Y,ce,w);H.transform(I,z),H.wheelDelta(w_),L.setState({d3Zoom:H,d3Selection:I,d3ZoomHandler:I.on("wheel.zoom"),transform:[z.x,z.y,z.k],domNode:O.current.closest(".react-flow")})}},[]),N.useEffect(()=>{V&&q&&(u&&!G&&!j?V.on("wheel.zoom",$=>{if(ro($,C))return!1;$.preventDefault(),$.stopImmediatePropagation();const H=V.property("__zoom").k||1;if($.ctrlKey&&a){const fe=nr($),pe=w_($),ye=H*Math.pow(2,pe);q.scaleTo(V,ye,fe,$);return}const I=$.deltaMode===1?20:1;let Y=f===ri.Vertical?0:$.deltaX*I,ce=f===ri.Horizontal?0:$.deltaY*I;!Ju()&&$.shiftKey&&f!==ri.Vertical&&(Y=$.deltaY*I,ce=0),q.translateBy(V,-(Y/H)*c,-(ce/H)*c,{internal:!0});const z=Au(V.property("__zoom")),{onViewportChangeStart:Q,onViewportChange:ne,onViewportChangeEnd:oe}=L.getState();clearTimeout(Z.current),te.current||(te.current=!0,t==null||t($,z),Q==null||Q(z)),te.current&&(e==null||e($,z),ne==null||ne(z),Z.current=setTimeout(()=>{r==null||r($,z),oe==null||oe(z),te.current=!1},150))},{passive:!1}):typeof X<"u"&&V.on("wheel.zoom",function($,H){if(!k&&$.type==="wheel"&&!$.ctrlKey||ro($,C))return null;$.preventDefault(),X.call(this,$,H)},{passive:!1}))},[j,u,f,V,q,X,G,a,k,C,t,e,r]),N.useEffect(()=>{q&&q.on("start",$=>{var Y,ce;if(!$.sourceEvent||$.sourceEvent.internal)return null;B.current=(Y=$.sourceEvent)==null?void 0:Y.button;const{onViewportChangeStart:H}=L.getState(),I=Au($.transform);P.current=!0,M.current=I,((ce=$.sourceEvent)==null?void 0:ce.type)==="mousedown"&&L.setState({paneDragging:!0}),H==null||H(I),t==null||t($.sourceEvent,I)})},[q,t]),N.useEffect(()=>{q&&(j&&!P.current?q.on("zoom",null):j||q.on("zoom",$=>{var I;const{onViewportChange:H}=L.getState();if(L.setState({transform:[$.transform.x,$.transform.y,$.transform.k]}),U.current=!!(s&&y_(g,B.current??0)),(e||H)&&!((I=$.sourceEvent)!=null&&I.internal)){const Y=Au($.transform);H==null||H(Y),e==null||e($.sourceEvent,Y)}}))},[j,q,e,g,s]),N.useEffect(()=>{q&&q.on("end",$=>{if(!$.sourceEvent||$.sourceEvent.internal)return null;const{onViewportChangeEnd:H}=L.getState();if(P.current=!1,L.setState({paneDragging:!1}),s&&y_(g,B.current??0)&&!U.current&&s($.sourceEvent),U.current=!1,(r||H)&&rP(M.current,$.transform)){const I=Au($.transform);M.current=I,clearTimeout(A.current),A.current=setTimeout(()=>{H==null||H(I),r==null||r($.sourceEvent,I)},u?150:0)}})},[q,u,g,r,s]),N.useEffect(()=>{q&&q.filter($=>{const H=G||o,I=a&&$.ctrlKey;if((g===!0||Array.isArray(g)&&g.includes(1))&&$.button===1&&$.type==="mousedown"&&(ro($,"react-flow__node")||ro($,"react-flow__edge")))return!0;if(!g&&!H&&!u&&!p&&!a||j||!p&&$.type==="dblclick"||ro($,C)&&$.type==="wheel"||ro($,T)&&($.type!=="wheel"||u&&$.type==="wheel"&&!G)||!a&&$.ctrlKey&&$.type==="wheel"||!H&&!u&&!I&&$.type==="wheel"||!g&&($.type==="mousedown"||$.type==="touchstart")||Array.isArray(g)&&!g.includes($.button)&&$.type==="mousedown")return!1;const Y=Array.isArray(g)&&g.includes($.button)||!$.button||$.button<=1;return(!$.ctrlKey||$.type==="wheel")&&Y})},[j,q,o,a,u,p,g,d,G]),ue.createElement("div",{className:"react-flow__renderer",ref:O,style:Ky},E)},oP=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function aP(){const{userSelectionActive:e,userSelectionRect:t}=it(oP,It);return e&&t?ue.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function x_(e,t){const r=t.parentNode||t.parentId,s=e.find(o=>o.id===r);if(s){const o=t.position.x+t.width-s.width,a=t.position.y+t.height-s.height;if(o>0||a>0||t.position.x<0||t.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),a>0&&(s.style.height+=a),t.position.x<0){const u=Math.abs(t.position.x);s.position.x=s.position.x-u,s.style.width+=u,t.position.x=0}if(t.position.y<0){const u=Math.abs(t.position.y);s.position.y=s.position.y-u,s.style.height+=u,t.position.y=0}s.width=s.style.width,s.height=s.style.height}}}function lP(e,t){if(e.some(s=>s.type==="reset"))return e.filter(s=>s.type==="reset").map(s=>s.item);const r=e.filter(s=>s.type==="add").map(s=>s.item);return t.reduce((s,o)=>{const a=e.filter(c=>c.id===o.id);if(a.length===0)return s.push(o),s;const u={...o};for(const c of a)if(c)switch(c.type){case"select":{u.selected=c.selected;break}case"position":{typeof c.position<"u"&&(u.position=c.position),typeof c.positionAbsolute<"u"&&(u.positionAbsolute=c.positionAbsolute),typeof c.dragging<"u"&&(u.dragging=c.dragging),u.expandParent&&x_(s,u);break}case"dimensions":{typeof c.dimensions<"u"&&(u.width=c.dimensions.width,u.height=c.dimensions.height),typeof c.updateStyle<"u"&&(u.style={...u.style||{},...c.dimensions}),typeof c.resizing=="boolean"&&(u.resizing=c.resizing),u.expandParent&&x_(s,u);break}case"remove":return s}return s.push(u),s},r)}function uP(e,t){return lP(e,t)}const Ss=(e,t)=>({id:e,type:"select",selected:t});function lo(e,t){return e.reduce((r,s)=>{const o=t.includes(s.id);return!s.selected&&o?(s.selected=!0,r.push(Ss(s.id,!0))):s.selected&&!o&&(s.selected=!1,r.push(Ss(s.id,!1))),r},[])}const Ef=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},cP=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),cj=N.memo(({isSelecting:e,selectionMode:t=Fa.Full,panOnDrag:r,onSelectionStart:s,onSelectionEnd:o,onPaneClick:a,onPaneContextMenu:u,onPaneScroll:c,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:d,children:g})=>{const y=N.useRef(null),w=Nt(),S=N.useRef(0),_=N.useRef(0),b=N.useRef(),{userSelectionActive:k,elementsSelectable:E,dragging:C}=it(cP,It),T=()=>{w.setState({userSelectionActive:!1,userSelectionRect:null}),S.current=0,_.current=0},A=X=>{a==null||a(X),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},L=X=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){X.preventDefault();return}u==null||u(X)},P=c?X=>c(X):void 0,U=X=>{const{resetSelectedElements:j,domNode:G}=w.getState();if(b.current=G==null?void 0:G.getBoundingClientRect(),!E||!e||X.button!==0||X.target!==y.current||!b.current)return;const{x:B,y:te}=Ns(X,b.current);j(),w.setState({userSelectionRect:{width:0,height:0,startX:B,startY:te,x:B,y:te}}),s==null||s(X)},O=X=>{const{userSelectionRect:j,nodeInternals:G,edges:B,transform:te,onNodesChange:Z,onEdgesChange:$,nodeOrigin:H,getNodes:I}=w.getState();if(!e||!b.current||!j)return;w.setState({userSelectionActive:!0,nodesSelectionActive:!1});const Y=Ns(X,b.current),ce=j.startX??0,z=j.startY??0,Q={...j,x:Y.x<ce?Y.x:ce,y:Y.y<z?Y.y:z,width:Math.abs(Y.x-ce),height:Math.abs(Y.y-z)},ne=I(),oe=VC(G,Q,te,t===Fa.Partial,!0,H),fe=GC(oe,B).map(ye=>ye.id),pe=oe.map(ye=>ye.id);if(S.current!==pe.length){S.current=pe.length;const ye=lo(ne,pe);ye.length&&(Z==null||Z(ye))}if(_.current!==fe.length){_.current=fe.length;const ye=lo(B,fe);ye.length&&($==null||$(ye))}w.setState({userSelectionRect:Q})},M=X=>{if(X.button!==0)return;const{userSelectionRect:j}=w.getState();!k&&j&&X.target===y.current&&(A==null||A(X)),w.setState({nodesSelectionActive:S.current>0}),T(),o==null||o(X)},q=X=>{k&&(w.setState({nodesSelectionActive:S.current>0}),o==null||o(X)),T()},V=E&&(e||k);return ue.createElement("div",{className:zt(["react-flow__pane",{dragging:C,selection:e}]),onClick:V?void 0:Ef(A,y),onContextMenu:Ef(L,y),onWheel:Ef(P,y),onMouseEnter:V?void 0:f,onMouseDown:V?U:void 0,onMouseMove:V?O:p,onMouseUp:V?M:void 0,onMouseLeave:V?q:d,ref:y,style:Ky},g,ue.createElement(aP,null))});cj.displayName="Pane";function dj(e,t){const r=e.parentNode||e.parentId;if(!r)return!1;const s=t.get(r);return s?s.selected?!0:dj(s,t):!1}function __(e,t,r){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===r.current)return!1;s=s.parentElement}while(s);return!1}function dP(e,t,r,s){return Array.from(e.values()).filter(o=>(o.selected||o.id===s)&&(!o.parentNode||o.parentId||!dj(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var a,u;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:r.x-(((a=o.positionAbsolute)==null?void 0:a.x)??0),y:r.y-(((u=o.positionAbsolute)==null?void 0:u.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 fP(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function fj(e,t,r,s,o=[0,0],a){const u=fP(e,e.extent||s);let c=u;const f=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(f&&e.width&&e.height){const g=r.get(f),{x:y,y:w}=ii(g,o).positionAbsolute;c=g&&qn(y)&&qn(w)&&qn(g.width)&&qn(g.height)?[[y+e.width*o[0],w+e.height*o[1]],[y+g.width-e.width+e.width*o[0],w+g.height-e.height+e.height*o[1]]]:c}else a==null||a("005",Yr.error005()),c=u;else if(e.extent&&f&&e.extent!=="parent"){const g=r.get(f),{x:y,y:w}=ii(g,o).positionAbsolute;c=[[e.extent[0][0]+y,e.extent[0][1]+w],[e.extent[1][0]+y,e.extent[1][1]+w]]}let p={x:0,y:0};if(f){const g=r.get(f);p=ii(g,o).positionAbsolute}const d=c&&c!=="parent"?By(t,c):t;return{position:{x:d.x-p.x,y:d.y-p.y},positionAbsolute:d}}function Nf({nodeId:e,dragItems:t,nodeInternals:r}){const s=t.map(o=>({...r.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?s.find(o=>o.id===e):s[0],s]}const b_=(e,t,r,s)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const a=Array.from(o),u=t.getBoundingClientRect(),c={x:u.width*s[0],y:u.height*s[1]};return a.map(f=>{const p=f.getBoundingClientRect();return{id:f.getAttribute("data-handleid"),position:f.getAttribute("data-handlepos"),x:(p.left-u.left-c.x)/r,y:(p.top-u.top-c.y)/r,...zy(f)}})};function Sa(e,t,r){return r===void 0?r:s=>{const o=t().nodeInternals.get(e);o&&r(s,{...o})}}function gy({id:e,store:t,unselect:r=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:u,nodeInternals:c,onError:f}=t.getState(),p=c.get(e);if(!p){f==null||f("012",Yr.error012(e));return}t.setState({nodesSelectionActive:!1}),p.selected?(r||p.selected&&u)&&(a({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var d;return(d=s==null?void 0:s.current)==null?void 0:d.blur()})):o([e])}function hP(){const e=Nt();return N.useCallback(({sourceEvent:r})=>{const{transform:s,snapGrid:o,snapToGrid:a}=e.getState(),u=r.touches?r.touches[0].clientX:r.clientX,c=r.touches?r.touches[0].clientY:r.clientY,f={x:(u-s[0])/s[2],y:(c-s[1])/s[2]};return{xSnapped:a?o[0]*Math.round(f.x/o[0]):f.x,ySnapped:a?o[1]*Math.round(f.y/o[1]):f.y,...f}},[])}function Cf(e){return(t,r,s)=>e==null?void 0:e(t,s)}function hj({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:s,nodeId:o,isSelectable:a,selectNodesOnDrag:u}){const c=Nt(),[f,p]=N.useState(!1),d=N.useRef([]),g=N.useRef({x:null,y:null}),y=N.useRef(0),w=N.useRef(null),S=N.useRef({x:0,y:0}),_=N.useRef(null),b=N.useRef(!1),k=N.useRef(!1),E=N.useRef(!1),C=hP();return N.useEffect(()=>{if(e!=null&&e.current){const T=$n(e.current),A=({x:U,y:O})=>{const{nodeInternals:M,onNodeDrag:q,onSelectionDrag:V,updateNodePositions:X,nodeExtent:j,snapGrid:G,snapToGrid:B,nodeOrigin:te,onError:Z}=c.getState();g.current={x:U,y:O};let $=!1,H={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&j){const Y=mc(d.current,te);H=Da(Y)}if(d.current=d.current.map(Y=>{const ce={x:U-Y.distance.x,y:O-Y.distance.y};B&&(ce.x=G[0]*Math.round(ce.x/G[0]),ce.y=G[1]*Math.round(ce.y/G[1]));const z=[[j[0][0],j[0][1]],[j[1][0],j[1][1]]];d.current.length>1&&j&&!Y.extent&&(z[0][0]=Y.positionAbsolute.x-H.x+j[0][0],z[1][0]=Y.positionAbsolute.x+(Y.width??0)-H.x2+j[1][0],z[0][1]=Y.positionAbsolute.y-H.y+j[0][1],z[1][1]=Y.positionAbsolute.y+(Y.height??0)-H.y2+j[1][1]);const Q=fj(Y,ce,M,z,te,Z);return $=$||Y.position.x!==Q.position.x||Y.position.y!==Q.position.y,Y.position=Q.position,Y.positionAbsolute=Q.positionAbsolute,Y}),!$)return;X(d.current,!0,!0),p(!0);const I=o?q:Cf(V);if(I&&_.current){const[Y,ce]=Nf({nodeId:o,dragItems:d.current,nodeInternals:M});I(_.current,Y,ce)}},L=()=>{if(!w.current)return;const[U,O]=PC(S.current,w.current);if(U!==0||O!==0){const{transform:M,panBy:q}=c.getState();g.current.x=(g.current.x??0)-U/M[2],g.current.y=(g.current.y??0)-O/M[2],q({x:U,y:O})&&A(g.current)}y.current=requestAnimationFrame(L)},P=U=>{var te;const{nodeInternals:O,multiSelectionActive:M,nodesDraggable:q,unselectNodesAndEdges:V,onNodeDragStart:X,onSelectionDragStart:j}=c.getState();k.current=!0;const G=o?X:Cf(j);(!u||!a)&&!M&&o&&((te=O.get(o))!=null&&te.selected||V()),o&&a&&u&&gy({id:o,store:c,nodeRef:e});const B=C(U);if(g.current=B,d.current=dP(O,q,B,o),G&&d.current){const[Z,$]=Nf({nodeId:o,dragItems:d.current,nodeInternals:O});G(U.sourceEvent,Z,$)}};if(t)T.on(".drag",null);else{const U=bI().on("start",O=>{const{domNode:M,nodeDragThreshold:q}=c.getState();q===0&&P(O),E.current=!1;const V=C(O);g.current=V,w.current=(M==null?void 0:M.getBoundingClientRect())||null,S.current=Ns(O.sourceEvent,w.current)}).on("drag",O=>{var X,j;const M=C(O),{autoPanOnNodeDrag:q,nodeDragThreshold:V}=c.getState();if(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1&&(E.current=!0),!E.current){if(!b.current&&k.current&&q&&(b.current=!0,L()),!k.current){const G=M.xSnapped-(((X=g==null?void 0:g.current)==null?void 0:X.x)??0),B=M.ySnapped-(((j=g==null?void 0:g.current)==null?void 0:j.y)??0);Math.sqrt(G*G+B*B)>V&&P(O)}(g.current.x!==M.xSnapped||g.current.y!==M.ySnapped)&&d.current&&k.current&&(_.current=O.sourceEvent,S.current=Ns(O.sourceEvent,w.current),A(M))}}).on("end",O=>{if(!(!k.current||E.current)&&(p(!1),b.current=!1,k.current=!1,cancelAnimationFrame(y.current),d.current)){const{updateNodePositions:M,nodeInternals:q,onNodeDragStop:V,onSelectionDragStop:X}=c.getState(),j=o?V:Cf(X);if(M(d.current,!1,!1),j){const[G,B]=Nf({nodeId:o,dragItems:d.current,nodeInternals:q});j(O.sourceEvent,G,B)}}}).filter(O=>{const M=O.target;return!O.button&&(!r||!__(M,`.${r}`,e))&&(!s||__(M,s,e))});return T.call(U),()=>{T.on(".drag",null)}}}},[e,t,r,s,a,c,o,u,C]),f}function pj(){const e=Nt();return N.useCallback(r=>{const{nodeInternals:s,nodeExtent:o,updateNodePositions:a,getNodes:u,snapToGrid:c,snapGrid:f,onError:p,nodesDraggable:d}=e.getState(),g=u().filter(E=>E.selected&&(E.draggable||d&&typeof E.draggable>"u")),y=c?f[0]:5,w=c?f[1]:5,S=r.isShiftPressed?4:1,_=r.x*y*S,b=r.y*w*S,k=g.map(E=>{if(E.positionAbsolute){const C={x:E.positionAbsolute.x+_,y:E.positionAbsolute.y+b};c&&(C.x=f[0]*Math.round(C.x/f[0]),C.y=f[1]*Math.round(C.y/f[1]));const{positionAbsolute:T,position:A}=fj(E,C,s,o,void 0,p);E.position=A,E.positionAbsolute=T}return E});a(k,!0,!1)},[])}const ho={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Ea=e=>{const t=({id:r,type:s,data:o,xPos:a,yPos:u,xPosOrigin:c,yPosOrigin:f,selected:p,onClick:d,onMouseEnter:g,onMouseMove:y,onMouseLeave:w,onContextMenu:S,onDoubleClick:_,style:b,className:k,isDraggable:E,isSelectable:C,isConnectable:T,isFocusable:A,selectNodesOnDrag:L,sourcePosition:P,targetPosition:U,hidden:O,resizeObserver:M,dragHandle:q,zIndex:V,isParent:X,noDragClassName:j,noPanClassName:G,initialized:B,disableKeyboardA11y:te,ariaLabel:Z,rfId:$,hasHandleBounds:H})=>{const I=Nt(),Y=N.useRef(null),ce=N.useRef(null),z=N.useRef(P),Q=N.useRef(U),ne=N.useRef(s),oe=C||E||d||g||y||w,fe=pj(),pe=Sa(r,I.getState,g),ye=Sa(r,I.getState,y),Me=Sa(r,I.getState,w),Ue=Sa(r,I.getState,S),ze=Sa(r,I.getState,_),Ie=we=>{const{nodeDragThreshold:xe}=I.getState();if(C&&(!L||!E||xe>0)&&gy({id:r,store:I,nodeRef:Y}),d){const Ye=I.getState().nodeInternals.get(r);Ye&&d(we,{...Ye})}},ke=we=>{if(!dy(we)&&!te)if(DC.includes(we.key)&&C){const xe=we.key==="Escape";gy({id:r,store:I,unselect:xe,nodeRef:Y})}else E&&p&&Object.prototype.hasOwnProperty.call(ho,we.key)&&(I.setState({ariaLiveMessage:`Moved selected node ${we.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~u}`}),fe({x:ho[we.key].x,y:ho[we.key].y,isShiftPressed:we.shiftKey}))};N.useEffect(()=>()=>{ce.current&&(M==null||M.unobserve(ce.current),ce.current=null)},[]),N.useEffect(()=>{if(Y.current&&!O){const we=Y.current;(!B||!H||ce.current!==we)&&(ce.current&&(M==null||M.unobserve(ce.current)),M==null||M.observe(we),ce.current=we)}},[O,B,H]),N.useEffect(()=>{const we=ne.current!==s,xe=z.current!==P,Ye=Q.current!==U;Y.current&&(we||xe||Ye)&&(we&&(ne.current=s),xe&&(z.current=P),Ye&&(Q.current=U),I.getState().updateNodeDimensions([{id:r,nodeElement:Y.current,forceUpdate:!0}]))},[r,s,P,U]);const le=hj({nodeRef:Y,disabled:O||!E,noDragClassName:j,handleSelector:q,nodeId:r,isSelectable:C,selectNodesOnDrag:L});return O?null:ue.createElement("div",{className:zt(["react-flow__node",`react-flow__node-${s}`,{[G]:E},k,{selected:p,selectable:C,parent:X,dragging:le}]),ref:Y,style:{zIndex:V,transform:`translate(${c}px,${f}px)`,pointerEvents:oe?"all":"none",visibility:B?"visible":"hidden",...b},"data-id":r,"data-testid":`rf__node-${r}`,onMouseEnter:pe,onMouseMove:ye,onMouseLeave:Me,onContextMenu:Ue,onClick:Ie,onDoubleClick:ze,onKeyDown:A?ke:void 0,tabIndex:A?0:void 0,role:A?"button":void 0,"aria-describedby":te?void 0:`${ij}-${$}`,"aria-label":Z},ue.createElement(NO,{value:r},ue.createElement(e,{id:r,data:o,type:s,xPos:a,yPos:u,selected:p,isConnectable:T,sourcePosition:P,targetPosition:U,dragging:le,dragHandle:q,zIndex:V})))};return t.displayName="NodeWrapper",N.memo(t)};const pP=e=>{const t=e.getNodes().filter(r=>r.selected);return{...mc(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function mP({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const s=Nt(),{width:o,height:a,x:u,y:c,transformString:f,userSelectionActive:p}=it(pP,It),d=pj(),g=N.useRef(null);if(N.useEffect(()=>{var S;r||(S=g.current)==null||S.focus({preventScroll:!0})},[r]),hj({nodeRef:g}),p||!o||!a)return null;const y=e?S=>{const _=s.getState().getNodes().filter(b=>b.selected);e(S,_)}:void 0,w=S=>{Object.prototype.hasOwnProperty.call(ho,S.key)&&d({x:ho[S.key].x,y:ho[S.key].y,isShiftPressed:S.shiftKey})};return ue.createElement("div",{className:zt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:f}},ue.createElement("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:r?void 0:-1,onKeyDown:r?void 0:w,style:{width:o,height:a,top:c,left:u}}))}var gP=N.memo(mP);const vP=e=>e.nodesSelectionActive,mj=({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:u,deleteKeyCode:c,onMove:f,onMoveStart:p,onMoveEnd:d,selectionKeyCode:g,selectionOnDrag:y,selectionMode:w,onSelectionStart:S,onSelectionEnd:_,multiSelectionKeyCode:b,panActivationKeyCode:k,zoomActivationKeyCode:E,elementsSelectable:C,zoomOnScroll:T,zoomOnPinch:A,panOnScroll:L,panOnScrollSpeed:P,panOnScrollMode:U,zoomOnDoubleClick:O,panOnDrag:M,defaultViewport:q,translateExtent:V,minZoom:X,maxZoom:j,preventScrolling:G,onSelectionContextMenu:B,noWheelClassName:te,noPanClassName:Z,disableKeyboardA11y:$})=>{const H=it(vP),I=za(g),Y=za(k),ce=Y||M,z=Y||L,Q=I||y&&ce!==!0;return tP({deleteKeyCode:c,multiSelectionKeyCode:b}),ue.createElement(iP,{onMove:f,onMoveStart:p,onMoveEnd:d,onPaneContextMenu:a,elementsSelectable:C,zoomOnScroll:T,zoomOnPinch:A,panOnScroll:z,panOnScrollSpeed:P,panOnScrollMode:U,zoomOnDoubleClick:O,panOnDrag:!I&&ce,defaultViewport:q,translateExtent:V,minZoom:X,maxZoom:j,zoomActivationKeyCode:E,preventScrolling:G,noWheelClassName:te,noPanClassName:Z},ue.createElement(cj,{onSelectionStart:S,onSelectionEnd:_,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:u,panOnDrag:ce,isSelecting:!!Q,selectionMode:w},e,H&&ue.createElement(gP,{onSelectionContextMenu:B,noPanClassName:Z,disableKeyboardA11y:$})))};mj.displayName="FlowRenderer";var yP=N.memo(mj);function wP(e){return it(N.useCallback(r=>e?VC(r.nodeInternals,{x:0,y:0,width:r.width,height:r.height},r.transform,!0):r.getNodes(),[e]))}function xP(e){const t={input:Ea(e.input||tj),default:Ea(e.default||my),output:Ea(e.output||rj),group:Ea(e.group||Yy)},r={},s=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,a)=>(o[a]=Ea(e[a]||my),o),r);return{...t,...s}}const _P=({x:e,y:t,width:r,height:s,origin:o})=>!r||!s?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-r*o[0],y:t-s*o[1]},bP=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),gj=e=>{const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:s,elementsSelectable:o,updateNodeDimensions:a,onError:u}=it(bP,It),c=wP(e.onlyRenderVisibleElements),f=N.useRef(),p=N.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(g=>{const y=g.map(w=>({id:w.target.getAttribute("data-id"),nodeElement:w.target,forceUpdate:!0}));a(y)});return f.current=d,d},[]);return N.useEffect(()=>()=>{var d;(d=f==null?void 0:f.current)==null||d.disconnect()},[]),ue.createElement("div",{className:"react-flow__nodes",style:Ky},c.map(d=>{var A,L,P;let g=d.type||"default";e.nodeTypes[g]||(u==null||u("003",Yr.error003(g)),g="default");const y=e.nodeTypes[g]||e.nodeTypes.default,w=!!(d.draggable||t&&typeof d.draggable>"u"),S=!!(d.selectable||o&&typeof d.selectable>"u"),_=!!(d.connectable||r&&typeof d.connectable>"u"),b=!!(d.focusable||s&&typeof d.focusable>"u"),k=e.nodeExtent?By(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,E=(k==null?void 0:k.x)??0,C=(k==null?void 0:k.y)??0,T=_P({x:E,y:C,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return ue.createElement(y,{key:d.id,id:d.id,className:d.className,style:d.style,type:g,data:d.data,sourcePosition:d.sourcePosition||Ae.Bottom,targetPosition:d.targetPosition||Ae.Top,hidden:d.hidden,xPos:E,yPos:C,xPosOrigin:T.x,yPosOrigin:T.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:w,isSelectable:S,isConnectable:_,isFocusable:b,resizeObserver:p,dragHandle:d.dragHandle,zIndex:((A=d[bt])==null?void 0:A.z)??0,isParent:!!((L=d[bt])!=null&&L.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel,hasHandleBounds:!!((P=d[bt])!=null&&P.handleBounds)})}))};gj.displayName="NodeRenderer";var kP=N.memo(gj);const SP=(e,t,r)=>r===Ae.Left?e-t:r===Ae.Right?e+t:e,EP=(e,t,r)=>r===Ae.Top?e-t:r===Ae.Bottom?e+t:e,k_="react-flow__edgeupdater",S_=({position:e,centerX:t,centerY:r,radius:s=10,onMouseDown:o,onMouseEnter:a,onMouseOut:u,type:c})=>ue.createElement("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:u,className:zt([k_,`${k_}-${c}`]),cx:SP(t,s,e),cy:EP(r,s,e),r:s,stroke:"transparent",fill:"transparent"}),NP=()=>!0;var so=e=>{const t=({id:r,className:s,type:o,data:a,onClick:u,onEdgeDoubleClick:c,selected:f,animated:p,label:d,labelStyle:g,labelShowBg:y,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:_,style:b,source:k,target:E,sourceX:C,sourceY:T,targetX:A,targetY:L,sourcePosition:P,targetPosition:U,elementsSelectable:O,hidden:M,sourceHandleId:q,targetHandleId:V,onContextMenu:X,onMouseEnter:j,onMouseMove:G,onMouseLeave:B,reconnectRadius:te,onReconnect:Z,onReconnectStart:$,onReconnectEnd:H,markerEnd:I,markerStart:Y,rfId:ce,ariaLabel:z,isFocusable:Q,isReconnectable:ne,pathOptions:oe,interactionWidth:fe,disableKeyboardA11y:pe})=>{const ye=N.useRef(null),[Me,Ue]=N.useState(!1),[ze,Ie]=N.useState(!1),ke=Nt(),le=N.useMemo(()=>`url('#${hy(Y,ce)}')`,[Y,ce]),we=N.useMemo(()=>`url('#${hy(I,ce)}')`,[I,ce]);if(M)return null;const xe=$e=>{var lt;const{edges:rt,addSelectedEdges:tt,unselectNodesAndEdges:Ce,multiSelectionActive:kt}=ke.getState(),Ve=rt.find(dn=>dn.id===r);Ve&&(O&&(ke.setState({nodesSelectionActive:!1}),Ve.selected&&kt?(Ce({nodes:[],edges:[Ve]}),(lt=ye.current)==null||lt.blur()):tt([r])),u&&u($e,Ve))},Ye=ka(r,ke.getState,c),gt=ka(r,ke.getState,X),ft=ka(r,ke.getState,j),ot=ka(r,ke.getState,G),Be=ka(r,ke.getState,B),et=($e,rt)=>{if($e.button!==0)return;const{edges:tt,isValidConnection:Ce}=ke.getState(),kt=rt?E:k,Ve=(rt?V:q)||null,lt=rt?"target":"source",dn=Ce||NP,wn=rt,xn=tt.find(bn=>bn.id===r);Ie(!0),$==null||$($e,xn,lt);const _n=bn=>{Ie(!1),H==null||H(bn,xn,lt)};QC({event:$e,handleId:Ve,nodeId:kt,onConnect:bn=>Z==null?void 0:Z(xn,bn),isTarget:wn,getState:ke.getState,setState:ke.setState,isValidConnection:dn,edgeUpdaterType:lt,onReconnectEnd:_n})},Xe=$e=>et($e,!0),wt=$e=>et($e,!1),ee=()=>Ue(!0),Le=()=>Ue(!1),De=!O&&!u,Re=$e=>{var rt;if(!pe&&DC.includes($e.key)&&O){const{unselectNodesAndEdges:tt,addSelectedEdges:Ce,edges:kt}=ke.getState();$e.key==="Escape"?((rt=ye.current)==null||rt.blur(),tt({edges:[kt.find(lt=>lt.id===r)]})):Ce([r])}};return ue.createElement("g",{className:zt(["react-flow__edge",`react-flow__edge-${o}`,s,{selected:f,animated:p,inactive:De,updating:Me}]),onClick:xe,onDoubleClick:Ye,onContextMenu:gt,onMouseEnter:ft,onMouseMove:ot,onMouseLeave:Be,onKeyDown:Q?Re:void 0,tabIndex:Q?0:void 0,role:Q?"button":"img","data-testid":`rf__edge-${r}`,"aria-label":z===null?void 0:z||`Edge from ${k} to ${E}`,"aria-describedby":Q?`${oj}-${ce}`:void 0,ref:ye},!ze&&ue.createElement(e,{id:r,source:k,target:E,selected:f,animated:p,label:d,labelStyle:g,labelShowBg:y,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:_,data:a,style:b,sourceX:C,sourceY:T,targetX:A,targetY:L,sourcePosition:P,targetPosition:U,sourceHandleId:q,targetHandleId:V,markerStart:le,markerEnd:we,pathOptions:oe,interactionWidth:fe}),ne&&ue.createElement(ue.Fragment,null,(ne==="source"||ne===!0)&&ue.createElement(S_,{position:P,centerX:C,centerY:T,radius:te,onMouseDown:Xe,onMouseEnter:ee,onMouseOut:Le,type:"source"}),(ne==="target"||ne===!0)&&ue.createElement(S_,{position:U,centerX:A,centerY:L,radius:te,onMouseDown:wt,onMouseEnter:ee,onMouseOut:Le,type:"target"})))};return t.displayName="EdgeWrapper",N.memo(t)};function CP(e){const t={default:so(e.default||tc),straight:so(e.bezier||Wy),step:so(e.step||Hy),smoothstep:so(e.step||pc),simplebezier:so(e.simplebezier||Uy)},r={},s=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,a)=>(o[a]=so(e[a]||tc),o),r);return{...t,...s}}function E_(e,t,r=null){const s=((r==null?void 0:r.x)||0)+t.x,o=((r==null?void 0:r.y)||0)+t.y,a=(r==null?void 0:r.width)||t.width,u=(r==null?void 0:r.height)||t.height;switch(e){case Ae.Top:return{x:s+a/2,y:o};case Ae.Right:return{x:s+a,y:o+u/2};case Ae.Bottom:return{x:s+a/2,y:o+u};case Ae.Left:return{x:s,y:o+u/2}}}function N_(e,t){return e?e.length===1||!t?e[0]:t&&e.find(r=>r.id===t)||null:null}const jP=(e,t,r,s,o,a)=>{const u=E_(r,e,t),c=E_(a,s,o);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y}};function TP({sourcePos:e,targetPos:t,sourceWidth:r,sourceHeight:s,targetWidth:o,targetHeight:a,width:u,height:c,transform:f}){const p={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+r,t.x+o),y2:Math.max(e.y+s,t.y+a)};p.x===p.x2&&(p.x2+=1),p.y===p.y2&&(p.y2+=1);const d=Da({x:(0-f[0])/f[2],y:(0-f[1])/f[2],width:u/f[2],height:c/f[2]}),g=Math.max(0,Math.min(d.x2,p.x2)-Math.max(d.x,p.x)),y=Math.max(0,Math.min(d.y2,p.y2)-Math.max(d.y,p.y));return Math.ceil(g*y)>0}function C_(e){var s,o,a,u,c;const t=((s=e==null?void 0:e[bt])==null?void 0:s.handleBounds)||null,r=t&&(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((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)<"u";return[{x:((u=e==null?void 0:e.positionAbsolute)==null?void 0:u.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},t,!!r]}const RP=[{level:0,isMaxLevel:!0,edges:[]}];function AP(e,t,r=!1){let s=-1;const o=e.reduce((u,c)=>{var d,g;const f=qn(c.zIndex);let p=f?c.zIndex:0;if(r){const y=t.get(c.target),w=t.get(c.source),S=c.selected||(y==null?void 0:y.selected)||(w==null?void 0:w.selected),_=Math.max(((d=w==null?void 0:w[bt])==null?void 0:d.z)||0,((g=y==null?void 0:y[bt])==null?void 0:g.z)||0,1e3);p=(f?c.zIndex:0)+(S?_:0)}return u[p]?u[p].push(c):u[p]=[c],s=p>s?p:s,u},{}),a=Object.entries(o).map(([u,c])=>{const f=+u;return{edges:c,level:f,isMaxLevel:f===s}});return a.length===0?RP:a}function IP(e,t,r){const s=it(N.useCallback(o=>e?o.edges.filter(a=>{const u=t.get(a.source),c=t.get(a.target);return(u==null?void 0:u.width)&&(u==null?void 0:u.height)&&(c==null?void 0:c.width)&&(c==null?void 0:c.height)&&TP({sourcePos:u.positionAbsolute||{x:0,y:0},targetPos:c.positionAbsolute||{x:0,y:0},sourceWidth:u.width,sourceHeight:u.height,targetWidth:c.width,targetHeight:c.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return AP(s,t,r)}const MP=({color:e="none",strokeWidth:t=1})=>ue.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),OP=({color:e="none",strokeWidth:t=1})=>ue.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),j_={[ec.Arrow]:MP,[ec.ArrowClosed]:OP};function PP(e){const t=Nt();return N.useMemo(()=>{var o,a;return Object.prototype.hasOwnProperty.call(j_,e)?j_[e]:((a=(o=t.getState()).onError)==null||a.call(o,"009",Yr.error009(e)),null)},[e])}const LP=({id:e,type:t,color:r,width:s=12.5,height:o=12.5,markerUnits:a="strokeWidth",strokeWidth:u,orient:c="auto-start-reverse"})=>{const f=PP(t);return f?ue.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:c,refX:"0",refY:"0"},ue.createElement(f,{color:r,strokeWidth:u})):null},$P=({defaultColor:e,rfId:t})=>r=>{const s=[];return r.edges.reduce((o,a)=>([a.markerStart,a.markerEnd].forEach(u=>{if(u&&typeof u=="object"){const c=hy(u,t);s.includes(c)||(o.push({id:c,color:u.color||e,...u}),s.push(c))}}),o),[]).sort((o,a)=>o.id.localeCompare(a.id))},vj=({defaultColor:e,rfId:t})=>{const r=it(N.useCallback($P({defaultColor:e,rfId:t}),[e,t]),(s,o)=>!(s.length!==o.length||s.some((a,u)=>a.id!==o[u].id)));return ue.createElement("defs",null,r.map(s=>ue.createElement(LP,{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})))};vj.displayName="MarkerDefinitions";var qP=N.memo(vj);const DP=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}),yj=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:r,rfId:s,edgeTypes:o,noPanClassName:a,onEdgeContextMenu:u,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:p,onEdgeClick:d,onEdgeDoubleClick:g,onReconnect:y,onReconnectStart:w,onReconnectEnd:S,reconnectRadius:_,children:b,disableKeyboardA11y:k})=>{const{edgesFocusable:E,edgesUpdatable:C,elementsSelectable:T,width:A,height:L,connectionMode:P,nodeInternals:U,onError:O}=it(DP,It),M=IP(t,U,r);return A?ue.createElement(ue.Fragment,null,M.map(({level:q,edges:V,isMaxLevel:X})=>ue.createElement("svg",{key:q,style:{zIndex:q},width:A,height:L,className:"react-flow__edges react-flow__container"},X&&ue.createElement(qP,{defaultColor:e,rfId:s}),ue.createElement("g",null,V.map(j=>{const[G,B,te]=C_(U.get(j.source)),[Z,$,H]=C_(U.get(j.target));if(!te||!H)return null;let I=j.type||"default";o[I]||(O==null||O("011",Yr.error011(I)),I="default");const Y=o[I]||o.default,ce=P===ai.Strict?$.target:($.target??[]).concat($.source??[]),z=N_(B.source,j.sourceHandle),Q=N_(ce,j.targetHandle),ne=(z==null?void 0:z.position)||Ae.Bottom,oe=(Q==null?void 0:Q.position)||Ae.Top,fe=!!(j.focusable||E&&typeof j.focusable>"u"),pe=j.reconnectable||j.updatable,ye=typeof y<"u"&&(pe||C&&typeof pe>"u");if(!z||!Q)return O==null||O("008",Yr.error008(z,j)),null;const{sourceX:Me,sourceY:Ue,targetX:ze,targetY:Ie}=jP(G,z,ne,Z,Q,oe);return ue.createElement(Y,{key:j.id,id:j.id,className:zt([j.className,a]),type:I,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:Me,sourceY:Ue,targetX:ze,targetY:Ie,sourcePosition:ne,targetPosition:oe,elementsSelectable:T,onContextMenu:u,onMouseEnter:c,onMouseMove:f,onMouseLeave:p,onClick:d,onEdgeDoubleClick:g,onReconnect:y,onReconnectStart:w,onReconnectEnd:S,reconnectRadius:_,rfId:s,ariaLabel:j.ariaLabel,isFocusable:fe,isReconnectable:ye,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth,disableKeyboardA11y:k})})))),b):null};yj.displayName="EdgeRenderer";var FP=N.memo(yj);const zP=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function BP({children:e}){const t=it(zP);return ue.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function UP(e){const t=Ja(),r=N.useRef(!1);N.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const HP={[Ae.Left]:Ae.Right,[Ae.Right]:Ae.Left,[Ae.Top]:Ae.Bottom,[Ae.Bottom]:Ae.Top},wj=({nodeId:e,handleType:t,style:r,type:s=Es.Bezier,CustomComponent:o,connectionStatus:a})=>{var L,P,U;const{fromNode:u,handleId:c,toX:f,toY:p,connectionMode:d}=it(N.useCallback(O=>({fromNode:O.nodeInternals.get(e),handleId:O.connectionHandleId,toX:(O.connectionPosition.x-O.transform[0])/O.transform[2],toY:(O.connectionPosition.y-O.transform[1])/O.transform[2],connectionMode:O.connectionMode}),[e]),It),g=(L=u==null?void 0:u[bt])==null?void 0:L.handleBounds;let y=g==null?void 0:g[t];if(d===ai.Loose&&(y=y||(g==null?void 0:g[t==="source"?"target":"source"])),!u||!y)return null;const w=c?y.find(O=>O.id===c):y[0],S=w?w.x+w.width/2:(u.width??0)/2,_=w?w.y+w.height/2:u.height??0,b=(((P=u.positionAbsolute)==null?void 0:P.x)??0)+S,k=(((U=u.positionAbsolute)==null?void 0:U.y)??0)+_,E=w==null?void 0:w.position,C=E?HP[E]:null;if(!E||!C)return null;if(o)return ue.createElement(o,{connectionLineType:s,connectionLineStyle:r,fromNode:u,fromHandle:w,fromX:b,fromY:k,toX:f,toY:p,fromPosition:E,toPosition:C,connectionStatus:a});let T="";const A={sourceX:b,sourceY:k,sourcePosition:E,targetX:f,targetY:p,targetPosition:C};return s===Es.Bezier?[T]=HC(A):s===Es.Step?[T]=fy({...A,borderRadius:0}):s===Es.SmoothStep?[T]=fy(A):s===Es.SimpleBezier?[T]=UC(A):T=`M${b},${k} ${f},${p}`,ue.createElement("path",{d:T,fill:"none",className:"react-flow__connection-path",style:r})};wj.displayName="ConnectionLine";const WP=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function VP({containerStyle:e,style:t,type:r,component:s}){const{nodeId:o,handleType:a,nodesConnectable:u,width:c,height:f,connectionStatus:p}=it(WP,It);return!(o&&a&&c&&u)?null:ue.createElement("svg",{style:e,width:c,height:f,className:"react-flow__edges react-flow__connectionline react-flow__container"},ue.createElement("g",{className:zt(["react-flow__connection",p])},ue.createElement(wj,{nodeId:o,handleType:a,style:t,type:r,CustomComponent:s,connectionStatus:p})))}function T_(e,t){return N.useRef(null),Nt(),N.useMemo(()=>t(e),[e])}const xj=({nodeTypes:e,edgeTypes:t,onMove:r,onMoveStart:s,onMoveEnd:o,onInit:a,onNodeClick:u,onEdgeClick:c,onNodeDoubleClick:f,onEdgeDoubleClick:p,onNodeMouseEnter:d,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:w,onSelectionContextMenu:S,onSelectionStart:_,onSelectionEnd:b,connectionLineType:k,connectionLineStyle:E,connectionLineComponent:C,connectionLineContainerStyle:T,selectionKeyCode:A,selectionOnDrag:L,selectionMode:P,multiSelectionKeyCode:U,panActivationKeyCode:O,zoomActivationKeyCode:M,deleteKeyCode:q,onlyRenderVisibleElements:V,elementsSelectable:X,selectNodesOnDrag:j,defaultViewport:G,translateExtent:B,minZoom:te,maxZoom:Z,preventScrolling:$,defaultMarkerColor:H,zoomOnScroll:I,zoomOnPinch:Y,panOnScroll:ce,panOnScrollSpeed:z,panOnScrollMode:Q,zoomOnDoubleClick:ne,panOnDrag:oe,onPaneClick:fe,onPaneMouseEnter:pe,onPaneMouseMove:ye,onPaneMouseLeave:Me,onPaneScroll:Ue,onPaneContextMenu:ze,onEdgeContextMenu:Ie,onEdgeMouseEnter:ke,onEdgeMouseMove:le,onEdgeMouseLeave:we,onReconnect:xe,onReconnectStart:Ye,onReconnectEnd:gt,reconnectRadius:ft,noDragClassName:ot,noWheelClassName:Be,noPanClassName:et,elevateEdgesOnSelect:Xe,disableKeyboardA11y:wt,nodeOrigin:ee,nodeExtent:Le,rfId:De})=>{const Re=T_(e,xP),$e=T_(t,CP);return UP(a),ue.createElement(yP,{onPaneClick:fe,onPaneMouseEnter:pe,onPaneMouseMove:ye,onPaneMouseLeave:Me,onPaneContextMenu:ze,onPaneScroll:Ue,deleteKeyCode:q,selectionKeyCode:A,selectionOnDrag:L,selectionMode:P,onSelectionStart:_,onSelectionEnd:b,multiSelectionKeyCode:U,panActivationKeyCode:O,zoomActivationKeyCode:M,elementsSelectable:X,onMove:r,onMoveStart:s,onMoveEnd:o,zoomOnScroll:I,zoomOnPinch:Y,zoomOnDoubleClick:ne,panOnScroll:ce,panOnScrollSpeed:z,panOnScrollMode:Q,panOnDrag:oe,defaultViewport:G,translateExtent:B,minZoom:te,maxZoom:Z,onSelectionContextMenu:S,preventScrolling:$,noDragClassName:ot,noWheelClassName:Be,noPanClassName:et,disableKeyboardA11y:wt},ue.createElement(BP,null,ue.createElement(FP,{edgeTypes:$e,onEdgeClick:c,onEdgeDoubleClick:p,onlyRenderVisibleElements:V,onEdgeContextMenu:Ie,onEdgeMouseEnter:ke,onEdgeMouseMove:le,onEdgeMouseLeave:we,onReconnect:xe,onReconnectStart:Ye,onReconnectEnd:gt,reconnectRadius:ft,defaultMarkerColor:H,noPanClassName:et,elevateEdgesOnSelect:!!Xe,disableKeyboardA11y:wt,rfId:De},ue.createElement(VP,{style:E,type:k,component:C,containerStyle:T})),ue.createElement("div",{className:"react-flow__edgelabel-renderer"}),ue.createElement(kP,{nodeTypes:Re,onNodeClick:u,onNodeDoubleClick:f,onNodeMouseEnter:d,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:w,selectNodesOnDrag:j,onlyRenderVisibleElements:V,noPanClassName:et,noDragClassName:ot,disableKeyboardA11y:wt,nodeOrigin:ee,nodeExtent:Le,rfId:De})))};xj.displayName="GraphView";var GP=N.memo(xj);const vy=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],bs={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:vy,nodeExtent:vy,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ai.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:xO,isValidConnection:void 0},YP=()=>OA((e,t)=>({...bs,setNodes:r=>{const{nodeInternals:s,nodeOrigin:o,elevateNodesOnSelect:a}=t();e({nodeInternals:Sf(r,s,o,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:r=>{const{defaultEdgeOptions:s={}}=t();e({edges:r.map(o=>({...s,...o}))})},setDefaultNodesAndEdges:(r,s)=>{const o=typeof r<"u",a=typeof s<"u",u=o?Sf(r,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:u,edges:a?s:[],hasDefaultNodes:o,hasDefaultEdges:a})},updateNodeDimensions:r=>{const{onNodesChange:s,nodeInternals:o,fitViewOnInit:a,fitViewOnInitDone:u,fitViewOnInitOptions:c,domNode:f,nodeOrigin:p}=t(),d=f==null?void 0:f.querySelector(".react-flow__viewport");if(!d)return;const g=window.getComputedStyle(d),{m22:y}=new window.DOMMatrixReadOnly(g.transform),w=r.reduce((_,b)=>{const k=o.get(b.id);if(k!=null&&k.hidden)o.set(k.id,{...k,[bt]:{...k[bt],handleBounds:void 0}});else if(k){const E=zy(b.nodeElement);!!(E.width&&E.height&&(k.width!==E.width||k.height!==E.height||b.forceUpdate))&&(o.set(k.id,{...k,[bt]:{...k[bt],handleBounds:{source:b_(".source",b.nodeElement,y,p),target:b_(".target",b.nodeElement,y,p)}},...E}),_.push({id:k.id,type:"dimensions",dimensions:E}))}return _},[]);lj(o,p);const S=u||a&&!u&&uj(t,{initial:!0,...c});e({nodeInternals:new Map(o),fitViewOnInitDone:S}),(w==null?void 0:w.length)>0&&(s==null||s(w))},updateNodePositions:(r,s=!0,o=!1)=>{const{triggerNodeChanges:a}=t(),u=r.map(c=>{const f={id:c.id,type:"position",dragging:o};return s&&(f.positionAbsolute=c.positionAbsolute,f.position=c.position),f});a(u)},triggerNodeChanges:r=>{const{onNodesChange:s,nodeInternals:o,hasDefaultNodes:a,nodeOrigin:u,getNodes:c,elevateNodesOnSelect:f}=t();if(r!=null&&r.length){if(a){const p=uP(r,c()),d=Sf(p,o,u,f);e({nodeInternals:d})}s==null||s(r)}},addSelectedNodes:r=>{const{multiSelectionActive:s,edges:o,getNodes:a}=t();let u,c=null;s?u=r.map(f=>Ss(f,!0)):(u=lo(a(),r),c=lo(o,[])),Ru({changedNodes:u,changedEdges:c,get:t,set:e})},addSelectedEdges:r=>{const{multiSelectionActive:s,edges:o,getNodes:a}=t();let u,c=null;s?u=r.map(f=>Ss(f,!0)):(u=lo(o,r),c=lo(a(),[])),Ru({changedNodes:c,changedEdges:u,get:t,set:e})},unselectNodesAndEdges:({nodes:r,edges:s}={})=>{const{edges:o,getNodes:a}=t(),u=r||a(),c=s||o,f=u.map(d=>(d.selected=!1,Ss(d.id,!1))),p=c.map(d=>Ss(d.id,!1));Ru({changedNodes:f,changedEdges:p,get:t,set:e})},setMinZoom:r=>{const{d3Zoom:s,maxZoom:o}=t();s==null||s.scaleExtent([r,o]),e({minZoom:r})},setMaxZoom:r=>{const{d3Zoom:s,minZoom:o}=t();s==null||s.scaleExtent([o,r]),e({maxZoom:r})},setTranslateExtent:r=>{var s;(s=t().d3Zoom)==null||s.translateExtent(r),e({translateExtent:r})},resetSelectedElements:()=>{const{edges:r,getNodes:s}=t(),a=s().filter(c=>c.selected).map(c=>Ss(c.id,!1)),u=r.filter(c=>c.selected).map(c=>Ss(c.id,!1));Ru({changedNodes:a,changedEdges:u,get:t,set:e})},setNodeExtent:r=>{const{nodeInternals:s}=t();s.forEach(o=>{o.positionAbsolute=By(o.position,r)}),e({nodeExtent:r,nodeInternals:new Map(s)})},panBy:r=>{const{transform:s,width:o,height:a,d3Zoom:u,d3Selection:c,translateExtent:f}=t();if(!u||!c||!r.x&&!r.y)return!1;const p=Vr.translate(s[0]+r.x,s[1]+r.y).scale(s[2]),d=[[0,0],[o,a]],g=u==null?void 0:u.constrain()(p,d,f);return u.transform(c,g),s[0]!==g.x||s[1]!==g.y||s[2]!==g.k},cancelConnection:()=>e({connectionNodeId:bs.connectionNodeId,connectionHandleId:bs.connectionHandleId,connectionHandleType:bs.connectionHandleType,connectionStatus:bs.connectionStatus,connectionStartHandle:bs.connectionStartHandle,connectionEndHandle:bs.connectionEndHandle}),reset:()=>e({...bs})}),Object.is),Xy=({children:e})=>{const t=N.useRef(null);return t.current||(t.current=YP()),ue.createElement(hO,{value:t.current},e)};Xy.displayName="ReactFlowProvider";const _j=({children:e})=>N.useContext(hc)?ue.createElement(ue.Fragment,null,e):ue.createElement(Xy,null,e);_j.displayName="ReactFlowWrapper";const KP={input:tj,default:my,output:rj,group:Yy},XP={default:tc,straight:Wy,step:Hy,smoothstep:pc,simplebezier:Uy},QP=[0,0],ZP=[15,15],JP={x:0,y:0,zoom:1},eL={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},bj=N.forwardRef(({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,className:o,nodeTypes:a=KP,edgeTypes:u=XP,onNodeClick:c,onEdgeClick:f,onInit:p,onMove:d,onMoveStart:g,onMoveEnd:y,onConnect:w,onConnectStart:S,onConnectEnd:_,onClickConnectStart:b,onClickConnectEnd:k,onNodeMouseEnter:E,onNodeMouseMove:C,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:L,onNodeDragStart:P,onNodeDrag:U,onNodeDragStop:O,onNodesDelete:M,onEdgesDelete:q,onSelectionChange:V,onSelectionDragStart:X,onSelectionDrag:j,onSelectionDragStop:G,onSelectionContextMenu:B,onSelectionStart:te,onSelectionEnd:Z,connectionMode:$=ai.Strict,connectionLineType:H=Es.Bezier,connectionLineStyle:I,connectionLineComponent:Y,connectionLineContainerStyle:ce,deleteKeyCode:z="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:ne=!1,selectionMode:oe=Fa.Full,panActivationKeyCode:fe="Space",multiSelectionKeyCode:pe=Ju()?"Meta":"Control",zoomActivationKeyCode:ye=Ju()?"Meta":"Control",snapToGrid:Me=!1,snapGrid:Ue=ZP,onlyRenderVisibleElements:ze=!1,selectNodesOnDrag:Ie=!0,nodesDraggable:ke,nodesConnectable:le,nodesFocusable:we,nodeOrigin:xe=QP,edgesFocusable:Ye,edgesUpdatable:gt,elementsSelectable:ft,defaultViewport:ot=JP,minZoom:Be=.5,maxZoom:et=2,translateExtent:Xe=vy,preventScrolling:wt=!0,nodeExtent:ee,defaultMarkerColor:Le="#b1b1b7",zoomOnScroll:De=!0,zoomOnPinch:Re=!0,panOnScroll:$e=!1,panOnScrollSpeed:rt=.5,panOnScrollMode:tt=ri.Free,zoomOnDoubleClick:Ce=!0,panOnDrag:kt=!0,onPaneClick:Ve,onPaneMouseEnter:lt,onPaneMouseMove:dn,onPaneMouseLeave:wn,onPaneScroll:xn,onPaneContextMenu:_n,children:zn,onEdgeContextMenu:bn,onEdgeDoubleClick:hi,onEdgeMouseEnter:fn,onEdgeMouseMove:pi,onEdgeMouseLeave:mi,onEdgeUpdate:qt,onEdgeUpdateStart:Sr,onEdgeUpdateEnd:Bn,onReconnect:Rs,onReconnectStart:Er,onReconnectEnd:To,reconnectRadius:lr=10,edgeUpdaterRadius:Nr=10,onNodesChange:ur,onEdgesChange:As,noDragClassName:gi="nodrag",noWheelClassName:vi="nowheel",noPanClassName:yi="nopan",fitView:kn=!1,fitViewOptions:cr,connectOnClick:wi=!0,attributionPosition:xi,proOptions:Bt,defaultEdgeOptions:Cr,elevateNodesOnSelect:_i=!0,elevateEdgesOnSelect:Zr=!1,disableKeyboardA11y:xt=!1,autoPanOnConnect:Ro=!0,autoPanOnNodeDrag:st=!0,connectionRadius:Ao=20,isValidConnection:Is,onError:Sn,style:Un,id:bi,nodeDragThreshold:ki,...jr},Kt)=>{const En=bi||"1";return ue.createElement("div",{...jr,style:{...Un,...eL},ref:Kt,className:zt(["react-flow",o]),"data-testid":"rf__wrapper",id:bi},ue.createElement(_j,null,ue.createElement(GP,{onInit:p,onMove:d,onMoveStart:g,onMoveEnd:y,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:E,onNodeMouseMove:C,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:L,nodeTypes:a,edgeTypes:u,connectionLineType:H,connectionLineStyle:I,connectionLineComponent:Y,connectionLineContainerStyle:ce,selectionKeyCode:Q,selectionOnDrag:ne,selectionMode:oe,deleteKeyCode:z,multiSelectionKeyCode:pe,panActivationKeyCode:fe,zoomActivationKeyCode:ye,onlyRenderVisibleElements:ze,selectNodesOnDrag:Ie,defaultViewport:ot,translateExtent:Xe,minZoom:Be,maxZoom:et,preventScrolling:wt,zoomOnScroll:De,zoomOnPinch:Re,zoomOnDoubleClick:Ce,panOnScroll:$e,panOnScrollSpeed:rt,panOnScrollMode:tt,panOnDrag:kt,onPaneClick:Ve,onPaneMouseEnter:lt,onPaneMouseMove:dn,onPaneMouseLeave:wn,onPaneScroll:xn,onPaneContextMenu:_n,onSelectionContextMenu:B,onSelectionStart:te,onSelectionEnd:Z,onEdgeContextMenu:bn,onEdgeDoubleClick:hi,onEdgeMouseEnter:fn,onEdgeMouseMove:pi,onEdgeMouseLeave:mi,onReconnect:Rs??qt,onReconnectStart:Er??Sr,onReconnectEnd:To??Bn,reconnectRadius:lr??Nr,defaultMarkerColor:Le,noDragClassName:gi,noWheelClassName:vi,noPanClassName:yi,elevateEdgesOnSelect:Zr,rfId:En,disableKeyboardA11y:xt,nodeOrigin:xe,nodeExtent:ee}),ue.createElement(UO,{nodes:e,edges:t,defaultNodes:r,defaultEdges:s,onConnect:w,onConnectStart:S,onConnectEnd:_,onClickConnectStart:b,onClickConnectEnd:k,nodesDraggable:ke,nodesConnectable:le,nodesFocusable:we,edgesFocusable:Ye,edgesUpdatable:gt,elementsSelectable:ft,elevateNodesOnSelect:_i,minZoom:Be,maxZoom:et,nodeExtent:ee,onNodesChange:ur,onEdgesChange:As,snapToGrid:Me,snapGrid:Ue,connectionMode:$,translateExtent:Xe,connectOnClick:wi,defaultEdgeOptions:Cr,fitView:kn,fitViewOptions:cr,onNodesDelete:M,onEdgesDelete:q,onNodeDragStart:P,onNodeDrag:U,onNodeDragStop:O,onSelectionDrag:j,onSelectionDragStart:X,onSelectionDragStop:G,noPanClassName:yi,nodeOrigin:xe,rfId:En,autoPanOnConnect:Ro,autoPanOnNodeDrag:st,onError:Sn,connectionRadius:Ao,isValidConnection:Is,nodeDragThreshold:ki}),ue.createElement(zO,{onSelectionChange:V}),zn,ue.createElement(mO,{proOptions:Bt,position:xi}),ue.createElement(YO,{rfId:En,disableKeyboardA11y:xt})))});bj.displayName="ReactFlow";const tL=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function kj(){return it(tL,It)}const Sj=({id:e,x:t,y:r,width:s,height:o,style:a,color:u,strokeColor:c,strokeWidth:f,className:p,borderRadius:d,shapeRendering:g,onClick:y,selected:w})=>{const{background:S,backgroundColor:_}=a||{},b=u||S||_;return ue.createElement("rect",{className:zt(["react-flow__minimap-node",{selected:w},p]),x:t,y:r,rx:d,ry:d,width:s,height:o,fill:b,stroke:c,strokeWidth:f,shapeRendering:g,onClick:y?k=>y(k,e):void 0})};Sj.displayName="MiniMapNode";var nL=N.memo(Sj);const rL=e=>e.nodeOrigin,sL=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),jf=e=>e instanceof Function?e:()=>e;function iL({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o=2,nodeComponent:a=nL,onClick:u}){const c=it(sL,It),f=it(rL),p=jf(t),d=jf(e),g=jf(r),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ue.createElement(ue.Fragment,null,c.map(w=>{const{x:S,y:_}=ii(w,f).positionAbsolute;return ue.createElement(a,{key:w.id,x:S,y:_,width:w.width,height:w.height,style:w.style,selected:w.selected,className:g(w),color:p(w),borderRadius:s,strokeColor:d(w),strokeWidth:o,shapeRendering:y,onClick:u,id:w.id})}))}var oL=N.memo(iL);const aL=200,lL=150,uL=e=>{const t=e.getNodes(),r={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:r,boundingRect:t.length>0?yO(mc(t,e.nodeOrigin),r):r,rfId:e.rfId}},cL="react-flow__minimap-desc";function Ej({style:e,className:t,nodeStrokeColor:r="transparent",nodeColor:s="#e2e2e2",nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:u=2,nodeComponent:c,maskColor:f="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:d=1,position:g="bottom-right",onClick:y,onNodeClick:w,pannable:S=!1,zoomable:_=!1,ariaLabel:b="React Flow mini map",inversePan:k=!1,zoomStep:E=10,offsetScale:C=5}){const T=Nt(),A=N.useRef(null),{boundingRect:L,viewBB:P,rfId:U}=it(uL,It),O=(e==null?void 0:e.width)??aL,M=(e==null?void 0:e.height)??lL,q=L.width/O,V=L.height/M,X=Math.max(q,V),j=X*O,G=X*M,B=C*X,te=L.x-(j-L.width)/2-B,Z=L.y-(G-L.height)/2-B,$=j+B*2,H=G+B*2,I=`${cL}-${U}`,Y=N.useRef(0);Y.current=X,N.useEffect(()=>{if(A.current){const Q=$n(A.current),ne=pe=>{const{transform:ye,d3Selection:Me,d3Zoom:Ue}=T.getState();if(pe.sourceEvent.type!=="wheel"||!Me||!Ue)return;const ze=-pe.sourceEvent.deltaY*(pe.sourceEvent.deltaMode===1?.05:pe.sourceEvent.deltaMode?1:.002)*E,Ie=ye[2]*Math.pow(2,ze);Ue.scaleTo(Me,Ie)},oe=pe=>{const{transform:ye,d3Selection:Me,d3Zoom:Ue,translateExtent:ze,width:Ie,height:ke}=T.getState();if(pe.sourceEvent.type!=="mousemove"||!Me||!Ue)return;const le=Y.current*Math.max(1,ye[2])*(k?-1:1),we={x:ye[0]-pe.sourceEvent.movementX*le,y:ye[1]-pe.sourceEvent.movementY*le},xe=[[0,0],[Ie,ke]],Ye=Vr.translate(we.x,we.y).scale(ye[2]),gt=Ue.constrain()(Ye,xe,ze);Ue.transform(Me,gt)},fe=MC().on("zoom",S?oe:null).on("zoom.wheel",_?ne:null);return Q.call(fe),()=>{Q.on("zoom",null)}}},[S,_,k,E]);const ce=y?Q=>{const ne=nr(Q);y(Q,{x:ne[0],y:ne[1]})}:void 0,z=w?(Q,ne)=>{const oe=T.getState().nodeInternals.get(ne);w(Q,oe)}:void 0;return ue.createElement(Fy,{position:g,style:e,className:zt(["react-flow__minimap",t]),"data-testid":"rf__minimap"},ue.createElement("svg",{width:O,height:M,viewBox:`${te} ${Z} ${$} ${H}`,role:"img","aria-labelledby":I,ref:A,onClick:ce},b&&ue.createElement("title",{id:I},b),ue.createElement(oL,{onClick:z,nodeColor:s,nodeStrokeColor:r,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:c}),ue.createElement("path",{className:"react-flow__minimap-mask",d:`M${te-B},${Z-B}h${$+B*2}v${H+B*2}h${-$-B*2}z
|
|
57
|
-
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fill:f,fillRule:"evenodd",stroke:p,strokeWidth:d,pointerEvents:"none"})))}Ej.displayName="MiniMap";var dL=N.memo(Ej);function fL(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ue.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function hL(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ue.createElement("path",{d:"M0 0h32v4.2H0z"}))}function pL(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ue.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 mL(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ue.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 gL(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ue.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 xr=({children:e,className:t,...r})=>ue.createElement("button",{type:"button",className:zt(["react-flow__controls-button",t]),...r},e);xr.displayName="ControlButton";const vL=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),Nj=({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:u,onFitView:c,onInteractiveChange:f,className:p,children:d,position:g="bottom-left"})=>{const y=Nt(),[w,S]=N.useState(!1),{isInteractive:_,minZoomReached:b,maxZoomReached:k}=it(vL,It),{zoomIn:E,zoomOut:C,fitView:T}=Ja();if(N.useEffect(()=>{S(!0)},[]),!w)return null;const A=()=>{E(),a==null||a()},L=()=>{C(),u==null||u()},P=()=>{T(o),c==null||c()},U=()=>{y.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),f==null||f(!_)};return ue.createElement(Fy,{className:zt(["react-flow__controls",p]),position:g,style:e,"data-testid":"rf__controls"},t&&ue.createElement(ue.Fragment,null,ue.createElement(xr,{onClick:A,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k},ue.createElement(fL,null)),ue.createElement(xr,{onClick:L,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b},ue.createElement(hL,null))),r&&ue.createElement(xr,{className:"react-flow__controls-fitview",onClick:P,title:"fit view","aria-label":"fit view"},ue.createElement(pL,null)),s&&ue.createElement(xr,{className:"react-flow__controls-interactive",onClick:U,title:"toggle interactivity","aria-label":"toggle interactivity"},_?ue.createElement(gL,null):ue.createElement(mL,null)),d)};Nj.displayName="Controls";var yL=N.memo(Nj),sr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(sr||(sr={}));function wL({color:e,dimensions:t,lineWidth:r}){return ue.createElement("path",{stroke:e,strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function xL({color:e,radius:t}){return ue.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const _L={[sr.Dots]:"#91919a",[sr.Lines]:"#eee",[sr.Cross]:"#e2e2e2"},bL={[sr.Dots]:1,[sr.Lines]:1,[sr.Cross]:6},kL=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Cj({id:e,variant:t=sr.Dots,gap:r=20,size:s,lineWidth:o=1,offset:a=2,color:u,style:c,className:f}){const p=N.useRef(null),{transform:d,patternId:g}=it(kL,It),y=u||_L[t],w=s||bL[t],S=t===sr.Dots,_=t===sr.Cross,b=Array.isArray(r)?r:[r,r],k=[b[0]*d[2]||1,b[1]*d[2]||1],E=w*d[2],C=_?[E,E]:k,T=S?[E/a,E/a]:[C[0]/a,C[1]/a];return ue.createElement("svg",{className:zt(["react-flow__background",f]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background"},ue.createElement("pattern",{id:g+e,x:d[0]%k[0],y:d[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`},S?ue.createElement(xL,{color:y,radius:E/a}):ue.createElement(wL,{dimensions:C,color:y,lineWidth:o})),ue.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${g+e})`}))}Cj.displayName="Background";var SL=N.memo(Cj);const EL=["us-gov","global","apac","us","eu","jp","au"],NL=new RegExp(`^(?:(?:${EL.join("|")})\\.)?anthropic\\.`,"i");function gc(e){return e.replace(NL,"")}function jj(){return{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreateTokens:0}}function Qy(e){const t=e.cache_creation,r=t&&typeof t=="object"?t:e,s=r.ephemeral_1h_input_tokens,o=r.ephemeral_5m_input_tokens;return typeof s!="number"&&typeof o!="number"?{}:{cacheCreate1hTokens:Number(s??0),cacheCreate5mTokens:Number(o??0)}}function CL(e){const t=Qy(e),r={inputTokens:Number(e.input_tokens??0),outputTokens:Number(e.output_tokens??0),cacheReadTokens:Number(e.cache_read_input_tokens??e.cached_input_tokens??0),cacheCreateTokens:Number(e.cache_creation_input_tokens??e.cache_write_input_tokens??0),cacheCreate1hTokens:t.cacheCreate1hTokens,cacheCreate5mTokens:t.cacheCreate5mTokens};return typeof e.reasoning_output_tokens=="number"&&(r.reasoningOutputTokens=Number(e.reasoning_output_tokens)),r}function jL(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t={};for(const[r,s]of Object.entries(e))!r||!s||typeof s!="object"||(t[r]=CL(s));return Object.keys(t).length?t:void 0}function Tj(e,t=0){if(!e||typeof e!="object"||t>6)return null;const r=e;if(typeof r.input_tokens=="number"||typeof r.output_tokens=="number"||typeof r.cache_read_input_tokens=="number"||typeof r.cache_creation_input_tokens=="number")return{inputTokens:Number(r.input_tokens??0),outputTokens:Number(r.output_tokens??0),cacheReadTokens:Number(r.cache_read_input_tokens??0),cacheCreateTokens:Number(r.cache_creation_input_tokens??0),...Qy(r)};for(const s of Object.values(r)){const o=Tj(s,t+1);if(o)return o}return null}const TL=/^(?:claude[-_]|gpt[-_]|o\d|codex[-_])/i;function Rj(e,t=0){if(!e||typeof e!="object"||t>6)return null;const r=e;if(typeof r.model=="string"&&TL.test(gc(r.model)))return r.model;for(const s of Object.values(r)){const o=Rj(s,t+1);if(o)return o}return null}function yy(){return{agents:new Map,toolIndex:new Map,toolOwner:new Map,activeSubagentStack:new Map,lastSeq:0,seqEpoch:null,totalEvents:0,revision:0}}function Cs(e){if(!e)return;const t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t[t.length-1]}function R_(){return{msgsUser:0,msgsAssistant:0,toolUses:0,toolResults:0,systemReminders:0,currentContextTokens:0,memoryFiles:[]}}function el(e,t){return`${e}::${t}`}function nc(e){return e.agent_type??e.subagent_type??"subagent"}function Ma(e){return e.agent_id?e.agent_id:e.parent_tool_use_id?e.parent_tool_use_id:null}function uo(e,t,r,s){const o=t;let a=e.agents.get(o);return a||(a={id:o,sessionId:t,label:"session",kind:"root",state:"active",startedAt:r,lastEventAt:r,tools:[],prompts:[],toolCount:0,childCount:0,synthetic:s,usage:jj()},e.agents.set(o,a),a)}function Aj(e,t,r,s){const o=el(t,r),a=e.agents.get(o);if(!a)return null;!a.cwd&&s.cwd&&(a.cwd=s.cwd,a.cwdBasename=Cs(s.cwd));const u=nc(s);return u&&(a.label==="subagent"||!a.label)&&(a.label=u),a}function RL(e,t,r){const s=t.session_id??"unknown",o=Ma(t);if(o){const f=Aj(e,s,o,t);if(f)return f}const a=e.activeSubagentStack.get(s),u=a&&a.length>0?a[a.length-1]:null;if(u){const f=e.agents.get(el(s,u));if(f)return!f.cwd&&t.cwd&&(f.cwd=t.cwd,f.cwdBasename=Cs(t.cwd)),f}const c=uo(e,s,r,t.hook_event_name!=="SessionStart");return!c.cwd&&t.cwd&&(c.cwd=t.cwd,c.cwdBasename=Cs(t.cwd)),c.label==="session"&&t.cwd&&(c.label=Cs(t.cwd)??"session"),c}function AL(e,t,r,s,o){const a=el(t,r),u=uo(e,t,o,!0);let c=e.agents.get(a);if(c){!c.cwd&&s.cwd&&(c.cwd=s.cwd,c.cwdBasename=Cs(s.cwd));const f=nc(s);return f&&(c.label==="subagent"||!c.label)&&(c.label=f),c}return c={id:a,sessionId:t,label:nc(s),kind:"subagent",parentId:u.id,state:"active",startedAt:o,tools:[],prompts:[],cwd:s.cwd,cwdBasename:Cs(s.cwd),toolCount:0,childCount:0,usage:jj()},e.agents.set(a,c),u.childCount+=1,c}function IL(e,t,r){const s=e.activeSubagentStack.get(t)??[];s.includes(r)||(s.push(r),e.activeSubagentStack.set(t,s))}function ML(e,t,r){const s=e.activeSubagentStack.get(t);if(s){for(let o=s.length-1;o>=0;o--)if(s[o]===r){s.splice(o,1);break}s.length===0&&e.activeSubagentStack.delete(t)}}function Iu(e,t=80){if(e==null)return"";if(typeof e=="string")return e.length>t?e.slice(0,t-1)+"…":e;try{const r=JSON.stringify(e);return r.length>t?r.slice(0,t-1)+"…":r}catch{return String(e)}}const A_=200,OL=25;function PL(e,t){const r=t.tools;if(r.length>A_){const s=r.splice(0,r.length-A_);for(const o of s)e.toolIndex.get(o.id)===o&&(e.toolIndex.delete(o.id),e.toolOwner.delete(o.id))}for(let s=r.length-OL-1;s>=0;s--){const o=r[s];if(o.trimmed)break;o.input=void 0,o.response=void 0,o.trimmed=!0}}function LL(e,t,r){const s=e.toolIndex.get(r);if(s)return s;for(let o=t.tools.length-1;o>=0;o--)if(t.tools[o].id===r)return t.tools[o];return null}const I_=2e3;function $L(e,t,r){for(let s=e.prompts.length-1;s>=0;s--){const o=e.prompts[s];if(o.at<t-I_)return!1;if(o.text===r&&o.at<=t+I_)return!0}return!1}function Ij(e,t){for(const r of t.tools)e.toolIndex.get(r.id)===r&&e.toolIndex.delete(r.id),e.toolOwner.get(r.id)===t.id&&e.toolOwner.delete(r.id)}function tl(e,t){return t&&(e.revision+=1),t}function qL(e,t,r,s){if(e.agents.size<=r)return!1;const o=p=>p.state==="done"&&p.endedAt!=null&&t-p.endedAt>s,a=[],u=new Map;for(const[p,d]of e.agents){if(d.parentId!=null){const g=u.get(d.parentId);g?g.push(p):u.set(d.parentId,[p])}o(d)&&a.push({id:p,endedAt:d.endedAt})}if(a.length===0)return!1;a.sort((p,d)=>p.endedAt-d.endedAt);let c=0;const f=p=>{const d=e.agents.get(p);d&&(Ij(e,d),e.agents.delete(p),c++)};for(const p of a){if(e.agents.size<=r)break;if(!e.agents.has(p.id))continue;const d=(u.get(p.id)??[]).map(g=>e.agents.get(g)).filter(g=>g!=null);if(!d.some(g=>!o(g))){for(const g of d)f(g.id);f(p.id)}}return tl(e,c>0)}function DL(e,t,r,s){const o=new Map;for(const[p,d]of e.agents){let g=o.get(d.sessionId);g||(g={ids:[],endedAt:0,live:!1,closed:!1},o.set(d.sessionId,g)),g.ids.push(p),d.kind==="root"&&d.closedAt!=null&&(g.closed=!0),d.state==="done"&&d.endedAt!=null?g.endedAt=Math.max(g.endedAt,d.endedAt):g.live=!0}const a=[...o.values()].filter(p=>!p.live&&p.endedAt>0&&t-p.endedAt>s).sort((p,d)=>p.closed===d.closed?p.endedAt-d.endedAt:p.closed?-1:1);let c=[...o.values()].filter(p=>!p.live).length-r;if(c<=0)return!1;let f=!1;for(const p of a){if(c<=0)break;for(const d of p.ids){const g=e.agents.get(d);g&&Ij(e,g),e.agents.delete(d)}c--,f=!0}return tl(e,f)}function FL(e,t){const r=t==null?void 0:t.payload,s=r==null?void 0:r.hook_event_name;if(s!=="PostToolUse"&&s!=="PostToolUseFailure")return!1;const o=r==null?void 0:r.tool_use_id;return typeof o=="string"&&o.length>0&&e.toolIndex.has(o)}function zL(e){let t=!1;for(const r of e.agents.values())for(const s of r.tools)s.endedAt!=null||s.outcomeGap||(s.outcomeGap=!0,t=!0);return tl(e,t)}function BL(e,t,r){let s=!1;for(const o of e.agents.values()){if(o.provider==="codex")continue;const a=e.agents.get(o.sessionId),u=(a==null?void 0:a.lastEventAt)??(a==null?void 0:a.startedAt);for(const c of o.tools){const f=Math.max(c.startedAt,u??c.startedAt);c.endedAt==null&&t-f>r&&(c.endedAt=f,c.ok=!1,c.errorPreview=c.outcomeGap?"no result reached the deck — events were dropped while the deck was paused":"session ended before this call returned",e.toolIndex.delete(c.id),e.toolOwner.delete(c.id),s=!0)}}return tl(e,s)}const M_=90*6e4;function UL(e,t,r){let s=!1;for(const o of e.agents.values()){if(o.kind!=="root")continue;const a=o.lastEventAt??o.startedAt;if(!(t-a<=r)){o.waiting&&(o.waiting=null,s=!0),o.closedAt==null&&(o.closedAt=a),o.state==="active"&&(o.state="done",o.endedAt=a,o.reaped=!0,s=!0);for(const u of e.agents.values())u.sessionId!==o.sessionId||u.kind==="root"||u.state!=="active"||(u.state="done",u.endedAt=a,s=!0);e.activeSubagentStack.delete(o.sessionId)}}return tl(e,s)}function HL(e){return e==="permission_prompt"?"permission":e==="idle_prompt"?"idle":null}const WL=new Set(["Notification","ModelObserved","ContextObserved","UsageObserved","SessionNamed"]);function VL(e,t){let r=null;for(const s of e.toolIndex.values()){const o=s.agentId?e.agents.get(s.agentId):void 0;!o||o.sessionId!==t||(!r||s.startedAt>r.startedAt)&&(r=s)}return r==null?void 0:r.explicitSubagentId}function GL(e,t,r,s,o){const a=r==="permission"?VL(e,t):void 0;return a?{kind:r,message:s,since:o,subagentId:a}:{kind:r,message:s,since:o}}function YL(e,t,r){if(e.kind!=="permission")return!0;const s=Ma(t);return s==null?!0:e.subagentId!=null&&el(r,s)===e.subagentId}function O_(e,t){const r=t.epoch??null;if(r!==null&&r!==e.seqEpoch)e.seqEpoch=r,e.lastSeq=0;else if(t.seq<=e.lastSeq)return e;const s=t.payload??{},o=t.receivedAt,a=s.hook_event_name??"Unknown";if(a==="__clear")return{...yy(),lastSeq:t.seq,seqEpoch:e.seqEpoch,revision:e.revision+1};e.totalEvents+=1,e.lastSeq=t.seq,e.revision+=1;const u=s.session_id??"unknown";if(!WL.has(a)){const d=e.agents.get(u);d!=null&&d.waiting&&YL(d.waiting,s,u)&&(d.waiting=null)}const c=e.agents.get(u);if(c&&o>(c.lastEventAt??0)&&(c.lastEventAt=o,c.reaped&&(c.reaped=!1,c.state="active",c.endedAt=void 0,c.closedAt=void 0)),typeof s.model_context_window=="number"&&s.model_context_window>0){const d=e.agents.get(u);d&&(d.contextWindow=s.model_context_window)}if(typeof s.approval_policy=="string"&&s.approval_policy){const d=e.agents.get(u);d&&(d.approvalPolicy=s.approval_policy)}if(typeof s.context_tokens=="number"&&s.context_tokens>=0){const d=e.agents.get(u);d&&(d.context={...d.context??R_(),currentContextTokens:s.context_tokens})}if(a==="ModelObserved"){const d=typeof s.model=="string"?s.model:null;if(d){const y=e.agents.get(u);y&&(y.model=d)}const g=s.subagentModels;if(g&&typeof g=="object")for(const[y,w]of Object.entries(g)){if(typeof w!="string")continue;const S=`${u}::${y}`,_=e.agents.get(S);_&&(_.model=w)}return e}if(a==="ContextObserved"){const d=s.context??null;if(d){const g=e.agents.get(u);if(g){const y=g.context??R_(),w=(_,b)=>typeof d[_]=="number"?d[_]:b,S=Array.isArray(d.memoryFiles)?d.memoryFiles:Array.isArray(d.claudeMdFiles)?d.claudeMdFiles:null;g.context={msgsUser:w("msgsUser",y.msgsUser),msgsAssistant:w("msgsAssistant",y.msgsAssistant),toolUses:w("toolUses",y.toolUses),toolResults:w("toolResults",y.toolResults),systemReminders:w("systemReminders",y.systemReminders),currentContextTokens:w("currentContextTokens",y.currentContextTokens),memoryFiles:S??y.memoryFiles}}}return e}if(a==="SessionNamed"){const d=e.agents.get(u);if(d){const g=typeof s.sessionName=="string"?s.sessionName.trim():"",y=typeof s.sessionTitle=="string"?s.sessionTitle.trim():"";g&&(d.sessionName=g),y&&(d.sessionTitle=y);const w=d.sessionName??"";d.sessionTitle&&w&&d.sessionTitle.toLowerCase()===w.toLowerCase()&&(d.sessionTitle=void 0)}return e}if(a==="UsageObserved"){const d=s.usage??null;if(d){const g=e.agents.get(u);if(g){g.usage.inputTokens=Number(d.input_tokens??0),g.usage.outputTokens=Number(d.output_tokens??0),g.usage.cacheReadTokens=Number(d.cache_read_input_tokens??d.cached_input_tokens??0),g.usage.cacheCreateTokens=Number(d.cache_creation_input_tokens??d.cache_write_input_tokens??0);const y=Qy(d);g.usage.cacheCreate1hTokens=y.cacheCreate1hTokens,g.usage.cacheCreate5mTokens=y.cacheCreate5mTokens,typeof d.reasoning_output_tokens=="number"&&(g.usage.reasoningOutputTokens=Number(d.reasoning_output_tokens)),g.usageByModel=jL(s.usageByModel)}}return e}const f=RL(e,s,o);f.provider||(f.provider=s.provider==="codex"?"codex":"claude");const p=Rj(s);switch(p&&(f.model=p),a){case"SessionStart":{const d=uo(e,u,o,!1);d.synthetic=!1,d.state="active",d.closedAt=void 0,d.startedAt=d.startedAt||o,!d.cwd&&s.cwd&&(d.cwd=s.cwd,d.cwdBasename=Cs(s.cwd)),d.label==="session"&&s.cwd&&(d.label=Cs(s.cwd)??"session");break}case"UserPromptSubmit":{for(const y of e.agents.values())y.sessionId===u&&y.kind==="subagent"&&y.state==="done"&&y.exitAt==null&&y.endedAt!=null&&y.endedAt<o&&(y.exitAt=o);const d=uo(e,u,o,!1);d.state="active",d.endedAt=void 0,d.closedAt=void 0,d.exitAt=void 0;const g=(typeof s.prompt=="string"?s.prompt:typeof s.message=="string"?s.message:"")??"";g&&!$L(d,o,g)&&(d.prompts.push({at:o,text:g}),d.firstPrompt||(d.firstPrompt=Iu(g,120)));break}case"PreToolUse":{const d=s.tool_use_id?LL(e,f,s.tool_use_id):null;if(d){s.tool_name&&d.name==="?"&&(d.name=s.tool_name),d.endedAt==null&&!d.trimmed&&s.tool_input!==void 0&&(d.input=s.tool_input,d.inputPreview=Iu(s.tool_input));break}const g=s.tool_use_id??`${f.id}:${f.toolCount}`,y=Ma(s),w={id:g,name:s.tool_name??"?",input:s.tool_input,inputPreview:Iu(s.tool_input),agentId:f.id,explicitSubagentId:y?el(u,y):void 0,startedAt:o};f.tools.push(w),f.toolCount+=1,f.state="active",e.toolIndex.set(g,w),e.toolOwner.set(g,f.id),PL(e,f);break}case"PostToolUse":case"PostToolUseFailure":{const d=s.tool_use_id;if(!d)break;let g=e.toolIndex.get(d),y=!1;if(!g)for(const S of e.agents.values()){const _=S.tools.find(b=>b.id===d);if(_){g=_,y=!0;break}}if(!g||g.outcomeApplied)break;g.outcomeApplied=!0,g.outcomeGap=void 0,g.endedAt=o,g.ok=a==="PostToolUse",g.trimmed||(g.response=s.tool_response),a==="PostToolUseFailure"?g.errorPreview=Iu(s.tool_response):y&&(g.errorPreview=void 0);const w=Tj(s.tool_response);w&&(g.usage=w),e.toolIndex.delete(d),e.toolOwner.delete(d);break}case"SubagentStart":{const d=Ma(s);if(!d)break;const g=AL(e,u,d,s,o);g.state="active",g.startedAt=g.startedAt||o,g.exitAt=void 0,g.endedAt=void 0;const y=nc(s);y&&(g.label=y),IL(e,u,d);break}case"SubagentStop":{const d=Ma(s);if(!d)break;const g=Aj(e,u,d,s);if(!g)break;g.state="done",g.endedAt=o,ML(e,u,d);break}case"Stop":case"SessionEnd":{const d=uo(e,u,o,!1);d.state="done",d.endedAt=o,a==="SessionEnd"&&(d.closedAt=o),e.activeSubagentStack.delete(u);break}case"Notification":{const d=HL(s.notification_type);if(!d)break;const g=uo(e,u,o,!1),y=typeof s.message=="string"?s.message:"",w=g.waiting;g.waiting=w&&w.kind===d&&w.message===y?{...w,since:Math.min(w.since,o)}:GL(e,u,d,y,o);break}}return e}function Zy(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t^e.charCodeAt(r);return Math.abs(t)%360}const KL=Date.UTC(2026,8,1);function XL(e){return e<KL?{input:2,output:10,cacheRead:.2,cacheWrite:2.5,cacheWrite1h:4}:{input:3,output:15,cacheRead:.3,cacheWrite:3.75,cacheWrite1h:6}}const QL=[{match:/^claude[-_](fable|mythos)[-_]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:10,output:50,cacheRead:1,cacheWrite:12.5,cacheWrite1h:20}},{match:/^claude[-_]opus[-_]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:5,output:25,cacheRead:.5,cacheWrite:6.25,cacheWrite1h:10}},{match:/^claude[-_]sonnet[-_]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:XL},{match:/^claude[-_]opus[-_]4[-_.](?:5|6|7|8)\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:5,output:25,cacheRead:.5,cacheWrite:6.25,cacheWrite1h:10}},{match:/^claude[-_]opus[-_]4(?:[-_.]1)?\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75,cacheWrite1h:30}},{match:/^claude[-_]sonnet[-_]4[-_.](?:5|6)\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:3,output:15,cacheRead:.3,cacheWrite:3.75,cacheWrite1h:6}},{match:/^claude[-_]sonnet[-_]4\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:3,output:15,cacheRead:.3,cacheWrite:3.75,cacheWrite1h:6}},{match:/^claude[-_]haiku[-_]4[-_.]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:1,output:5,cacheRead:.1,cacheWrite:1.25,cacheWrite1h:2}},{match:/^claude[-_]haiku[-_]3[-_.]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:.8,output:4,cacheRead:.08,cacheWrite:1,cacheWrite1h:1.6}},{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:/^gpt[-_]5[-_.]1[-_]codex[-_]mini/i,rates:{input:.25,output:2,cacheRead:.025,cacheWrite:0}},{match:/^gpt[-_]5[-_.]1(?!\d)/i,rates:{input:1.25,output:10,cacheRead:.125,cacheWrite:0}},{match:/^gpt[-_]5[-_]pro\b/i,rates:{input:15,output:120,cacheRead:15,cacheWrite:0}},{match:/^gpt[-_]5[-_]mini/i,rates:{input:.25,output:2,cacheRead:.025,cacheWrite:0}},{match:/^gpt[-_]5[-_]nano/i,rates:{input:.05,output:.4,cacheRead:.005,cacheWrite:0}},{match:/^gpt[-_]5(?![-_.]\d)/i,rates:{input:1.25,output:10,cacheRead:.125,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[-_]mini/i,rates:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0}},{match:/^o1\b/i,rates:{input:15,output:60,cacheRead:7.5,cacheWrite:0}},{match:/^o3[-_]deep[-_]research/i,rates:{input:10,output:40,cacheRead:2.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[-_]deep[-_]research/i,rates:{input:2,output:8,cacheRead:.5,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 ZL(e){return e?/^(?:gpt[-_]|codex[-_]|o\d)/i.test(e):!1}function ko(e,t=Date.now()){if(!e)return null;const r=gc(e);for(const s of QL)if(s.match.test(r))return typeof s.rates=="function"?s.rates(t):s.rates;return null}function Mj(e,t){const r=Math.max(0,e.cacheCreate1hTokens??0),s=Math.max(0,e.cacheCreate5mTokens??0),o=Math.max(0,e.cacheCreateTokens-r-s),a=s+o,u=t.cacheWrite1h??t.cacheWrite;return{tokens5m:a,tokens1h:r,usd5m:a*t.cacheWrite/1e6,usd1h:r*u/1e6}}function Oj(e,t,r=Date.now()){if(!ZL(t))return e.inputTokens;const s=ko(t,r),o=((s==null?void 0:s.cacheWrite)??0)>0?Math.max(0,e.cacheCreateTokens):0;return Math.max(0,e.inputTokens-e.cacheReadTokens-o)}function Jy(e,t,r=Date.now()){const s=ko(t,r);if(!s)return{input:0,output:0,cacheRead:0,cacheWrite:0,total:0};const o=Oj(e,t,r)*s.input/1e6,a=e.outputTokens*s.output/1e6,u=e.cacheReadTokens*s.cacheRead/1e6,c=Mj(e,s),f=c.usd5m+c.usd1h;return{input:o,output:a,cacheRead:u,cacheWrite:f,total:o+a+u+f}}const P_=2e5,JL=1e6,e$=[/\[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],t$=[{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 n$(e){if(!e)return P_;const t=gc(e);for(const r of e$)if(r.test(t))return JL;for(const r of t$)if(r.match.test(t))return r.window;return P_}function Pj(e,t){return typeof e=="number"&&e>0?e:n$(t)}const Wu="not priced";function Ge(e){if(e<=0)return"—";if(e<.005)return"<1¢";if(e<1){const t=(e*100).toFixed(e<.1?1:0);if(Number(t)<100)return`${t}¢`}return e<100?`$${e.toFixed(2)}`:e<1e4?`$${e.toFixed(0)}`:`$${(e/1e3).toFixed(1)}k`}function rc(e,t){if(e<=0||t<10)return null;const r=e/t,s=r*60;return s>=.01?`${Ge(s)}/min`:`${Ge(r*3600)}/hr`}function r$(e,t){const r={inputTokens:e.inputTokens+t.inputTokens,outputTokens:e.outputTokens+t.outputTokens,cacheReadTokens:e.cacheReadTokens+t.cacheReadTokens,cacheCreateTokens:e.cacheCreateTokens+t.cacheCreateTokens};return(e.cacheCreate1hTokens!==void 0||e.cacheCreate5mTokens!==void 0||t.cacheCreate1hTokens!==void 0||t.cacheCreate5mTokens!==void 0)&&(r.cacheCreate1hTokens=(e.cacheCreate1hTokens??0)+(t.cacheCreate1hTokens??0),r.cacheCreate5mTokens=(e.cacheCreate5mTokens??0)+(t.cacheCreate5mTokens??0)),(e.reasoningOutputTokens!==void 0||t.reasoningOutputTokens!==void 0)&&(r.reasoningOutputTokens=(e.reasoningOutputTokens??0)+(t.reasoningOutputTokens??0)),r}function s$(e,t){let r=0,s=0,o=0,a=0,u=0,c=0;for(const g of t)r+=g.inputTokens,s+=g.outputTokens,o+=g.cacheReadTokens,a+=g.cacheCreateTokens,u+=g.cacheCreate1hTokens??0,c+=g.cacheCreate5mTokens??0;const f=(g,y)=>Math.max(0,g-y),p={inputTokens:f(e.inputTokens,r),outputTokens:f(e.outputTokens,s),cacheReadTokens:f(e.cacheReadTokens,o),cacheCreateTokens:f(e.cacheCreateTokens,a)};return(e.cacheCreate1hTokens!==void 0||e.cacheCreate5mTokens!==void 0)&&(p.cacheCreate1hTokens=f(e.cacheCreate1hTokens??0,u),p.cacheCreate5mTokens=f(e.cacheCreate5mTokens??0,c)),p.inputTokens+p.outputTokens+p.cacheReadTokens+p.cacheCreateTokens>0?p:null}function nl(e){const t=e.usageByModel,r=t?Object.keys(t):[];if(!t||r.length===0)return[{model:e.model,usage:e.usage}];const s=r.map(a=>({model:a,usage:t[a]})),o=s$(e.usage,s.map(a=>a.usage));if(o){const a=s.findIndex(u=>u.model===e.model);a>=0?s[a]={model:s[a].model,usage:r$(s[a].usage,o)}:s.push({model:e.model,usage:o})}return s}function vn(e,t=Date.now()){const r={input:0,output:0,cacheRead:0,cacheWrite:0,total:0};for(const s of nl(e)){const o=Jy(s.usage,s.model,t);r.input+=o.input,r.output+=o.output,r.cacheRead+=o.cacheRead,r.cacheWrite+=o.cacheWrite,r.total+=o.total}return r}function wy(e,t=Date.now()){let r=0;for(const s of nl(e))ko(s.model,t)==null&&(r+=s.usage.inputTokens+s.usage.outputTokens);return r}function Lj(e){const t=[];for(const r of nl(e)){if(!r.model||t.includes(r.model))continue;const s=r.usage;s.inputTokens+s.outputTokens+s.cacheReadTokens+s.cacheCreateTokens<=0||t.push(r.model)}return t}function $j(e){return Lj(e).filter(t=>t!==e.model)}const i$=new Set(["untrusted","on-request","on-failure"]);function o$(e){return typeof e!="string"||!e?null:i$.has(e)?!0:e==="never"?!1:null}function a$(e){if(e.provider!=="codex"||e.kind!=="root"||e.waiting||e.state!=="active")return null;const t=o$(e.approvalPolicy);return t===!1?null:{label:"approvals not visible",detail:`${t===!0?`This session's approval policy is "${e.approvalPolicy}", so Codex can stop and ask you to approve a command.`:"This session's approval policy has not been read yet, so it may be able to stop and ask you to approve a command."}
|
|
56
|
+
*/var Fx;function EA(){if(Fx)return gf;Fx=1;var e=Ka(),t=SA();function r(p,d){return p===d&&(p!==0||1/p===1/d)||p!==p&&d!==d}var s=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,a=e.useRef,u=e.useEffect,c=e.useMemo,f=e.useDebugValue;return gf.useSyncExternalStoreWithSelector=function(p,d,g,y,w){var S=a(null);if(S.current===null){var _={hasValue:!1,value:null};S.current=_}else _=S.current;S=c(function(){function k(L){if(!E){if(E=!0,C=L,L=y(L),w!==void 0&&_.hasValue){var P=_.value;if(w(P,L))return T=P}return T=L}if(P=T,s(C,L))return P;var U=y(L);return w!==void 0&&w(P,U)?(C=L,P):(C=L,T=U)}var E=!1,C,T,A=g===void 0?null:g;return[function(){return k(d())},A===null?void 0:function(){return k(A())}]},[d,g,y,w]);var b=o(p,S[0],S[1]);return u(function(){_.hasValue=!0,_.value=b},[b]),f(b),b},gf}var zx;function NA(){return zx||(zx=1,mf.exports=EA()),mf.exports}var CA=NA();const jA=My(CA),TA={},Bx=e=>{let t;const r=new Set,s=(d,g)=>{const y=typeof d=="function"?d(t):d;if(!Object.is(y,t)){const w=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),r.forEach(S=>S(t,w))}},o=()=>t,f={setState:s,getState:o,getInitialState:()=>p,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(TA?"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."),r.clear()}},p=t=e(s,o,f);return f},RA=e=>e?Bx(e):Bx,{useDebugValue:AA}=ue,{useSyncExternalStoreWithSelector:IA}=jA,MA=e=>e;function oC(e,t=MA,r){const s=IA(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return AA(s),s}const Ux=(e,t)=>{const r=RA(e),s=(o,a=t)=>oC(r,o,a);return Object.assign(s,r),s},OA=(e,t)=>e?Ux(e,t):Ux;function It(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e)if(!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const s of r)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}var PA={value:()=>{}};function uc(){for(var e=0,t=arguments.length,r={},s;e<t;++e){if(!(s=arguments[e]+"")||s in r||/[\s.]/.test(s))throw new Error("illegal type: "+s);r[s]=[]}return new zu(r)}function zu(e){this._=e}function LA(e,t){return e.trim().split(/^|\s+/).map(function(r){var s="",o=r.indexOf(".");if(o>=0&&(s=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:s}})}zu.prototype=uc.prototype={constructor:zu,on:function(e,t){var r=this._,s=LA(e+"",r),o,a=-1,u=s.length;if(arguments.length<2){for(;++a<u;)if((o=(e=s[a]).type)&&(o=$A(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<u;)if(o=(e=s[a]).type)r[o]=Hx(r[o],e.name,t);else if(t==null)for(o in r)r[o]=Hx(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new zu(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),s=0,o,a;s<o;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],s=0,o=a.length;s<o;++s)a[s].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,a=s.length;o<a;++o)s[o].value.apply(t,r)}};function $A(e,t){for(var r=0,s=e.length,o;r<s;++r)if((o=e[r]).name===t)return o.value}function Hx(e,t,r){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=PA,e=e.slice(0,s).concat(e.slice(s+1));break}return r!=null&&e.push({name:t,value:r}),e}var ny="http://www.w3.org/1999/xhtml";const Wx={svg:"http://www.w3.org/2000/svg",xhtml:ny,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function cc(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Wx.hasOwnProperty(t)?{space:Wx[t],local:e}:e}function qA(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===ny&&t.documentElement.namespaceURI===ny?t.createElement(e):t.createElementNS(r,e)}}function DA(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function aC(e){var t=cc(e);return(t.local?DA:qA)(t)}function FA(){}function Oy(e){return e==null?FA:function(){return this.querySelector(e)}}function zA(e){typeof e!="function"&&(e=Oy(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,c=s[o]=new Array(u),f,p,d=0;d<u;++d)(f=a[d])&&(p=e.call(f,f.__data__,d,a))&&("__data__"in f&&(p.__data__=f.__data__),c[d]=p);return new yn(s,this._parents)}function BA(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function UA(){return[]}function lC(e){return e==null?UA:function(){return this.querySelectorAll(e)}}function HA(e){return function(){return BA(e.apply(this,arguments))}}function WA(e){typeof e=="function"?e=HA(e):e=lC(e);for(var t=this._groups,r=t.length,s=[],o=[],a=0;a<r;++a)for(var u=t[a],c=u.length,f,p=0;p<c;++p)(f=u[p])&&(s.push(e.call(f,f.__data__,p,u)),o.push(f));return new yn(s,o)}function uC(e){return function(){return this.matches(e)}}function cC(e){return function(t){return t.matches(e)}}var VA=Array.prototype.find;function GA(e){return function(){return VA.call(this.children,e)}}function YA(){return this.firstElementChild}function KA(e){return this.select(e==null?YA:GA(typeof e=="function"?e:cC(e)))}var XA=Array.prototype.filter;function QA(){return Array.from(this.children)}function ZA(e){return function(){return XA.call(this.children,e)}}function JA(e){return this.selectAll(e==null?QA:ZA(typeof e=="function"?e:cC(e)))}function e2(e){typeof e!="function"&&(e=uC(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,c=s[o]=[],f,p=0;p<u;++p)(f=a[p])&&e.call(f,f.__data__,p,a)&&c.push(f);return new yn(s,this._parents)}function dC(e){return new Array(e.length)}function t2(){return new yn(this._enter||this._groups.map(dC),this._parents)}function Gu(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Gu.prototype={constructor:Gu,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function n2(e){return function(){return e}}function r2(e,t,r,s,o,a){for(var u=0,c,f=t.length,p=a.length;u<p;++u)(c=t[u])?(c.__data__=a[u],s[u]=c):r[u]=new Gu(e,a[u]);for(;u<f;++u)(c=t[u])&&(o[u]=c)}function s2(e,t,r,s,o,a,u){var c,f,p=new Map,d=t.length,g=a.length,y=new Array(d),w;for(c=0;c<d;++c)(f=t[c])&&(y[c]=w=u.call(f,f.__data__,c,t)+"",p.has(w)?o[c]=f:p.set(w,f));for(c=0;c<g;++c)w=u.call(e,a[c],c,a)+"",(f=p.get(w))?(s[c]=f,f.__data__=a[c],p.delete(w)):r[c]=new Gu(e,a[c]);for(c=0;c<d;++c)(f=t[c])&&p.get(y[c])===f&&(o[c]=f)}function i2(e){return e.__data__}function o2(e,t){if(!arguments.length)return Array.from(this,i2);var r=t?s2:r2,s=this._parents,o=this._groups;typeof e!="function"&&(e=n2(e));for(var a=o.length,u=new Array(a),c=new Array(a),f=new Array(a),p=0;p<a;++p){var d=s[p],g=o[p],y=g.length,w=a2(e.call(d,d&&d.__data__,p,s)),S=w.length,_=c[p]=new Array(S),b=u[p]=new Array(S),k=f[p]=new Array(y);r(d,g,_,b,k,w,t);for(var E=0,C=0,T,A;E<S;++E)if(T=_[E]){for(E>=C&&(C=E+1);!(A=b[C])&&++C<S;);T._next=A||null}}return u=new yn(u,s),u._enter=c,u._exit=f,u}function a2(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function l2(){return new yn(this._exit||this._groups.map(dC),this._parents)}function u2(e,t,r){var s=this.enter(),o=this,a=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?a.remove():r(a),s&&o?s.merge(o).order():o}function c2(e){for(var t=e.selection?e.selection():e,r=this._groups,s=t._groups,o=r.length,a=s.length,u=Math.min(o,a),c=new Array(o),f=0;f<u;++f)for(var p=r[f],d=s[f],g=p.length,y=c[f]=new Array(g),w,S=0;S<g;++S)(w=p[S]||d[S])&&(y[S]=w);for(;f<o;++f)c[f]=r[f];return new yn(c,this._parents)}function d2(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var s=e[t],o=s.length-1,a=s[o],u;--o>=0;)(u=s[o])&&(a&&u.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(u,a),a=u);return this}function f2(e){e||(e=h2);function t(g,y){return g&&y?e(g.__data__,y.__data__):!g-!y}for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a){for(var u=r[a],c=u.length,f=o[a]=new Array(c),p,d=0;d<c;++d)(p=u[d])&&(f[d]=p);f.sort(t)}return new yn(o,this._parents).order()}function h2(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function p2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function m2(){return Array.from(this)}function g2(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],o=0,a=s.length;o<a;++o){var u=s[o];if(u)return u}return null}function v2(){let e=0;for(const t of this)++e;return e}function y2(){return!this.node()}function w2(e){for(var t=this._groups,r=0,s=t.length;r<s;++r)for(var o=t[r],a=0,u=o.length,c;a<u;++a)(c=o[a])&&e.call(c,c.__data__,a,o);return this}function x2(e){return function(){this.removeAttribute(e)}}function _2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function b2(e,t){return function(){this.setAttribute(e,t)}}function k2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function S2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function E2(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function N2(e,t){var r=cc(e);if(arguments.length<2){var s=this.node();return r.local?s.getAttributeNS(r.space,r.local):s.getAttribute(r)}return this.each((t==null?r.local?_2:x2:typeof t=="function"?r.local?E2:S2:r.local?k2:b2)(r,t))}function fC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function C2(e){return function(){this.style.removeProperty(e)}}function j2(e,t,r){return function(){this.style.setProperty(e,t,r)}}function T2(e,t,r){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,r)}}function R2(e,t,r){return arguments.length>1?this.each((t==null?C2:typeof t=="function"?T2:j2)(e,t,r??"")):go(this.node(),e)}function go(e,t){return e.style.getPropertyValue(t)||fC(e).getComputedStyle(e,null).getPropertyValue(t)}function A2(e){return function(){delete this[e]}}function I2(e,t){return function(){this[e]=t}}function M2(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function O2(e,t){return arguments.length>1?this.each((t==null?A2:typeof t=="function"?M2:I2)(e,t)):this.node()[e]}function hC(e){return e.trim().split(/^|\s+/)}function Py(e){return e.classList||new pC(e)}function pC(e){this._node=e,this._names=hC(e.getAttribute("class")||"")}pC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function mC(e,t){for(var r=Py(e),s=-1,o=t.length;++s<o;)r.add(t[s])}function gC(e,t){for(var r=Py(e),s=-1,o=t.length;++s<o;)r.remove(t[s])}function P2(e){return function(){mC(this,e)}}function L2(e){return function(){gC(this,e)}}function $2(e,t){return function(){(t.apply(this,arguments)?mC:gC)(this,e)}}function q2(e,t){var r=hC(e+"");if(arguments.length<2){for(var s=Py(this.node()),o=-1,a=r.length;++o<a;)if(!s.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?$2:t?P2:L2)(r,t))}function D2(){this.textContent=""}function F2(e){return function(){this.textContent=e}}function z2(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function B2(e){return arguments.length?this.each(e==null?D2:(typeof e=="function"?z2:F2)(e)):this.node().textContent}function U2(){this.innerHTML=""}function H2(e){return function(){this.innerHTML=e}}function W2(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function V2(e){return arguments.length?this.each(e==null?U2:(typeof e=="function"?W2:H2)(e)):this.node().innerHTML}function G2(){this.nextSibling&&this.parentNode.appendChild(this)}function Y2(){return this.each(G2)}function K2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function X2(){return this.each(K2)}function Q2(e){var t=typeof e=="function"?e:aC(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Z2(){return null}function J2(e,t){var r=typeof e=="function"?e:aC(e),s=t==null?Z2:typeof t=="function"?t:Oy(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),s.apply(this,arguments)||null)})}function eI(){var e=this.parentNode;e&&e.removeChild(this)}function tI(){return this.each(eI)}function nI(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function rI(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function sI(e){return this.select(e?rI:nI)}function iI(e){return arguments.length?this.property("__data__",e):this.node().__data__}function oI(e){return function(t){e.call(this,t,this.__data__)}}function aI(e){return e.trim().split(/^|\s+/).map(function(t){var r="",s=t.indexOf(".");return s>=0&&(r=t.slice(s+1),t=t.slice(0,s)),{type:t,name:r}})}function lI(e){return function(){var t=this.__on;if(t){for(var r=0,s=-1,o=t.length,a;r<o;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++s]=a;++s?t.length=s:delete this.__on}}}function uI(e,t,r){return function(){var s=this.__on,o,a=oI(t);if(s){for(var u=0,c=s.length;u<c;++u)if((o=s[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=t;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:t,listener:a,options:r},s?s.push(o):this.__on=[o]}}function cI(e,t,r){var s=aI(e+""),o,a=s.length,u;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,p=c.length,d;f<p;++f)for(o=0,d=c[f];o<a;++o)if((u=s[o]).type===d.type&&u.name===d.name)return d.value}return}for(c=t?uI:lI,o=0;o<a;++o)this.each(c(s[o],t,r));return this}function vC(e,t,r){var s=fC(e),o=s.CustomEvent;typeof o=="function"?o=new o(t,r):(o=s.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function dI(e,t){return function(){return vC(this,e,t)}}function fI(e,t){return function(){return vC(this,e,t.apply(this,arguments))}}function hI(e,t){return this.each((typeof t=="function"?fI:dI)(e,t))}function*pI(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],o=0,a=s.length,u;o<a;++o)(u=s[o])&&(yield u)}var yC=[null];function yn(e,t){this._groups=e,this._parents=t}function Xa(){return new yn([[document.documentElement]],yC)}function mI(){return this}yn.prototype=Xa.prototype={constructor:yn,select:zA,selectAll:WA,selectChild:KA,selectChildren:JA,filter:e2,data:o2,enter:t2,exit:l2,join:u2,merge:c2,selection:mI,order:d2,sort:f2,call:p2,nodes:m2,node:g2,size:v2,empty:y2,each:w2,attr:N2,style:R2,property:O2,classed:q2,text:B2,html:V2,raise:Y2,lower:X2,append:Q2,insert:J2,remove:tI,clone:sI,datum:iI,on:cI,dispatch:hI,[Symbol.iterator]:pI};function $n(e){return typeof e=="string"?new yn([[document.querySelector(e)]],[document.documentElement]):new yn([[e]],yC)}function gI(e){let t;for(;t=e.sourceEvent;)e=t;return e}function nr(e,t){if(e=gI(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var s=r.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const vI={passive:!1},La={capture:!0,passive:!1};function wf(e){e.stopImmediatePropagation()}function co(e){e.preventDefault(),e.stopImmediatePropagation()}function wC(e){var t=e.document.documentElement,r=$n(e).on("dragstart.drag",co,La);"onselectstart"in t?r.on("selectstart.drag",co,La):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function xC(e,t){var r=e.document.documentElement,s=$n(e).on("dragstart.drag",null);t&&(s.on("click.drag",co,La),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in r?s.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const ku=e=>()=>e;function ry(e,{sourceEvent:t,subject:r,target:s,identifier:o,active:a,x:u,y:c,dx:f,dy:p,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:d}})}ry.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yI(e){return!e.ctrlKey&&!e.button}function wI(){return this.parentNode}function xI(e,t){return t??{x:e.x,y:e.y}}function _I(){return navigator.maxTouchPoints||"ontouchstart"in this}function bI(){var e=yI,t=wI,r=xI,s=_I,o={},a=uc("start","drag","end"),u=0,c,f,p,d,g=0;function y(T){T.on("mousedown.drag",w).filter(s).on("touchstart.drag",b).on("touchmove.drag",k,vI).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(T,A){if(!(d||!e.call(this,T,A))){var L=C(this,t.call(this,T,A),T,A,"mouse");L&&($n(T.view).on("mousemove.drag",S,La).on("mouseup.drag",_,La),wC(T.view),wf(T),p=!1,c=T.clientX,f=T.clientY,L("start",T))}}function S(T){if(co(T),!p){var A=T.clientX-c,L=T.clientY-f;p=A*A+L*L>g}o.mouse("drag",T)}function _(T){$n(T.view).on("mousemove.drag mouseup.drag",null),xC(T.view,p),co(T),o.mouse("end",T)}function b(T,A){if(e.call(this,T,A)){var L=T.changedTouches,P=t.call(this,T,A),U=L.length,O,M;for(O=0;O<U;++O)(M=C(this,P,T,A,L[O].identifier,L[O]))&&(wf(T),M("start",T,L[O]))}}function k(T){var A=T.changedTouches,L=A.length,P,U;for(P=0;P<L;++P)(U=o[A[P].identifier])&&(co(T),U("drag",T,A[P]))}function E(T){var A=T.changedTouches,L=A.length,P,U;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),P=0;P<L;++P)(U=o[A[P].identifier])&&(wf(T),U("end",T,A[P]))}function C(T,A,L,P,U,O){var M=a.copy(),q=nr(O||L,A),V,X,j;if((j=r.call(T,new ry("beforestart",{sourceEvent:L,target:y,identifier:U,active:u,x:q[0],y:q[1],dx:0,dy:0,dispatch:M}),P))!=null)return V=j.x-q[0]||0,X=j.y-q[1]||0,function G(B,te,Z){var $=q,H;switch(B){case"start":o[U]=G,H=u++;break;case"end":delete o[U],--u;case"drag":q=nr(Z||te,A),H=u;break}M.call(B,T,new ry(B,{sourceEvent:te,subject:j,target:y,identifier:U,active:H,x:q[0]+V,y:q[1]+X,dx:q[0]-$[0],dy:q[1]-$[1],dispatch:M}),P)}}return y.filter=function(T){return arguments.length?(e=typeof T=="function"?T:ku(!!T),y):e},y.container=function(T){return arguments.length?(t=typeof T=="function"?T:ku(T),y):t},y.subject=function(T){return arguments.length?(r=typeof T=="function"?T:ku(T),y):r},y.touchable=function(T){return arguments.length?(s=typeof T=="function"?T:ku(!!T),y):s},y.on=function(){var T=a.on.apply(a,arguments);return T===a?y:T},y.clickDistance=function(T){return arguments.length?(g=(T=+T)*T,y):Math.sqrt(g)},y}function Ly(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function _C(e,t){var r=Object.create(e.prototype);for(var s in t)r[s]=t[s];return r}function Qa(){}var $a=.7,Yu=1/$a,fo="\\s*([+-]?\\d+)\\s*",qa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_r="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",kI=/^#([0-9a-f]{3,8})$/,SI=new RegExp(`^rgb\\(${fo},${fo},${fo}\\)$`),EI=new RegExp(`^rgb\\(${_r},${_r},${_r}\\)$`),NI=new RegExp(`^rgba\\(${fo},${fo},${fo},${qa}\\)$`),CI=new RegExp(`^rgba\\(${_r},${_r},${_r},${qa}\\)$`),jI=new RegExp(`^hsl\\(${qa},${_r},${_r}\\)$`),TI=new RegExp(`^hsla\\(${qa},${_r},${_r},${qa}\\)$`),Vx={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};Ly(Qa,Da,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Gx,formatHex:Gx,formatHex8:RI,formatHsl:AI,formatRgb:Yx,toString:Yx});function Gx(){return this.rgb().formatHex()}function RI(){return this.rgb().formatHex8()}function AI(){return bC(this).formatHsl()}function Yx(){return this.rgb().formatRgb()}function Da(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=kI.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Kx(t):r===3?new un(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Su(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Su(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=SI.exec(e))?new un(t[1],t[2],t[3],1):(t=EI.exec(e))?new un(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=NI.exec(e))?Su(t[1],t[2],t[3],t[4]):(t=CI.exec(e))?Su(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=jI.exec(e))?Zx(t[1],t[2]/100,t[3]/100,1):(t=TI.exec(e))?Zx(t[1],t[2]/100,t[3]/100,t[4]):Vx.hasOwnProperty(e)?Kx(Vx[e]):e==="transparent"?new un(NaN,NaN,NaN,0):null}function Kx(e){return new un(e>>16&255,e>>8&255,e&255,1)}function Su(e,t,r,s){return s<=0&&(e=t=r=NaN),new un(e,t,r,s)}function II(e){return e instanceof Qa||(e=Da(e)),e?(e=e.rgb(),new un(e.r,e.g,e.b,e.opacity)):new un}function sy(e,t,r,s){return arguments.length===1?II(e):new un(e,t,r,s??1)}function un(e,t,r,s){this.r=+e,this.g=+t,this.b=+r,this.opacity=+s}Ly(un,sy,_C(Qa,{brighter(e){return e=e==null?Yu:Math.pow(Yu,e),new un(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$a:Math.pow($a,e),new un(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new un(si(this.r),si(this.g),si(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:Xx,formatHex:Xx,formatHex8:MI,formatRgb:Qx,toString:Qx}));function Xx(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}`}function MI(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}${ni((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qx(){const e=Ku(this.opacity);return`${e===1?"rgb(":"rgba("}${si(this.r)}, ${si(this.g)}, ${si(this.b)}${e===1?")":`, ${e})`}`}function Ku(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function si(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ni(e){return e=si(e),(e<16?"0":"")+e.toString(16)}function Zx(e,t,r,s){return s<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new rr(e,t,r,s)}function bC(e){if(e instanceof rr)return new rr(e.h,e.s,e.l,e.opacity);if(e instanceof Qa||(e=Da(e)),!e)return new rr;if(e instanceof rr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,s=e.b/255,o=Math.min(t,r,s),a=Math.max(t,r,s),u=NaN,c=a-o,f=(a+o)/2;return c?(t===a?u=(r-s)/c+(r<s)*6:r===a?u=(s-t)/c+2:u=(t-r)/c+4,c/=f<.5?a+o:2-a-o,u*=60):c=f>0&&f<1?0:u,new rr(u,c,f,e.opacity)}function OI(e,t,r,s){return arguments.length===1?bC(e):new rr(e,t,r,s??1)}function rr(e,t,r,s){this.h=+e,this.s=+t,this.l=+r,this.opacity=+s}Ly(rr,OI,_C(Qa,{brighter(e){return e=e==null?Yu:Math.pow(Yu,e),new rr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$a:Math.pow($a,e),new rr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,s=r+(r<.5?r:1-r)*t,o=2*r-s;return new un(xf(e>=240?e-240:e+120,o,s),xf(e,o,s),xf(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new rr(Jx(this.h),Eu(this.s),Eu(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("}${Jx(this.h)}, ${Eu(this.s)*100}%, ${Eu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Jx(e){return e=(e||0)%360,e<0?e+360:e}function Eu(e){return Math.max(0,Math.min(1,e||0))}function xf(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const kC=e=>()=>e;function PI(e,t){return function(r){return e+r*t}}function LI(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(s){return Math.pow(e+s*t,r)}}function $I(e){return(e=+e)==1?SC:function(t,r){return r-t?LI(t,r,e):kC(isNaN(t)?r:t)}}function SC(e,t){var r=t-e;return r?PI(e,r):kC(isNaN(e)?t:e)}const e_=(function e(t){var r=$I(t);function s(o,a){var u=r((o=sy(o)).r,(a=sy(a)).r),c=r(o.g,a.g),f=r(o.b,a.b),p=SC(o.opacity,a.opacity);return function(d){return o.r=u(d),o.g=c(d),o.b=f(d),o.opacity=p(d),o+""}}return s.gamma=e,s})(1);function ks(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var iy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_f=new RegExp(iy.source,"g");function qI(e){return function(){return e}}function DI(e){return function(t){return e(t)+""}}function FI(e,t){var r=iy.lastIndex=_f.lastIndex=0,s,o,a,u=-1,c=[],f=[];for(e=e+"",t=t+"";(s=iy.exec(e))&&(o=_f.exec(t));)(a=o.index)>r&&(a=t.slice(r,a),c[u]?c[u]+=a:c[++u]=a),(s=s[0])===(o=o[0])?c[u]?c[u]+=o:c[++u]=o:(c[++u]=null,f.push({i:u,x:ks(s,o)})),r=_f.lastIndex;return r<t.length&&(a=t.slice(r),c[u]?c[u]+=a:c[++u]=a),c.length<2?f[0]?DI(f[0].x):qI(t):(t=f.length,function(p){for(var d=0,g;d<t;++d)c[(g=f[d]).i]=g.x(p);return c.join("")})}var t_=180/Math.PI,oy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function EC(e,t,r,s,o,a){var u,c,f;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(f=e*r+t*s)&&(r-=e*f,s-=t*f),(c=Math.sqrt(r*r+s*s))&&(r/=c,s/=c,f/=c),e*s<t*r&&(e=-e,t=-t,f=-f,u=-u),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*t_,skewX:Math.atan(f)*t_,scaleX:u,scaleY:c}}var Nu;function zI(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?oy:EC(t.a,t.b,t.c,t.d,t.e,t.f)}function BI(e){return e==null||(Nu||(Nu=document.createElementNS("http://www.w3.org/2000/svg","g")),Nu.setAttribute("transform",e),!(e=Nu.transform.baseVal.consolidate()))?oy:(e=e.matrix,EC(e.a,e.b,e.c,e.d,e.e,e.f))}function NC(e,t,r,s){function o(p){return p.length?p.pop()+" ":""}function a(p,d,g,y,w,S){if(p!==g||d!==y){var _=w.push("translate(",null,t,null,r);S.push({i:_-4,x:ks(p,g)},{i:_-2,x:ks(d,y)})}else(g||y)&&w.push("translate("+g+t+y+r)}function u(p,d,g,y){p!==d?(p-d>180?d+=360:d-p>180&&(p+=360),y.push({i:g.push(o(g)+"rotate(",null,s)-2,x:ks(p,d)})):d&&g.push(o(g)+"rotate("+d+s)}function c(p,d,g,y){p!==d?y.push({i:g.push(o(g)+"skewX(",null,s)-2,x:ks(p,d)}):d&&g.push(o(g)+"skewX("+d+s)}function f(p,d,g,y,w,S){if(p!==g||d!==y){var _=w.push(o(w)+"scale(",null,",",null,")");S.push({i:_-4,x:ks(p,g)},{i:_-2,x:ks(d,y)})}else(g!==1||y!==1)&&w.push(o(w)+"scale("+g+","+y+")")}return function(p,d){var g=[],y=[];return p=e(p),d=e(d),a(p.translateX,p.translateY,d.translateX,d.translateY,g,y),u(p.rotate,d.rotate,g,y),c(p.skewX,d.skewX,g,y),f(p.scaleX,p.scaleY,d.scaleX,d.scaleY,g,y),p=d=null,function(w){for(var S=-1,_=y.length,b;++S<_;)g[(b=y[S]).i]=b.x(w);return g.join("")}}}var UI=NC(zI,"px, ","px)","deg)"),HI=NC(BI,", ",")",")"),WI=1e-12;function n_(e){return((e=Math.exp(e))+1/e)/2}function VI(e){return((e=Math.exp(e))-1/e)/2}function GI(e){return((e=Math.exp(2*e))-1)/(e+1)}const YI=(function e(t,r,s){function o(a,u){var c=a[0],f=a[1],p=a[2],d=u[0],g=u[1],y=u[2],w=d-c,S=g-f,_=w*w+S*S,b,k;if(_<WI)k=Math.log(y/p)/t,b=function(P){return[c+P*w,f+P*S,p*Math.exp(t*P*k)]};else{var E=Math.sqrt(_),C=(y*y-p*p+s*_)/(2*p*r*E),T=(y*y-p*p-s*_)/(2*y*r*E),A=Math.log(Math.sqrt(C*C+1)-C),L=Math.log(Math.sqrt(T*T+1)-T);k=(L-A)/t,b=function(P){var U=P*k,O=n_(A),M=p/(r*E)*(O*GI(t*U+A)-VI(A));return[c+M*w,f+M*S,p*O/n_(t*U+A)]}}return b.duration=k*1e3*t/Math.SQRT2,b}return o.rho=function(a){var u=Math.max(.001,+a),c=u*u,f=c*c;return e(u,c,f)},o})(Math.SQRT2,2,4);var vo=0,Ra=0,ka=0,CC=1e3,Xu,Aa,Qu=0,oi=0,dc=0,Fa=typeof performance=="object"&&performance.now?performance:Date,jC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function $y(){return oi||(jC(KI),oi=Fa.now()+dc)}function KI(){oi=0}function Zu(){this._call=this._time=this._next=null}Zu.prototype=TC.prototype={constructor:Zu,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?$y():+r)+(t==null?0:+t),!this._next&&Aa!==this&&(Aa?Aa._next=this:Xu=this,Aa=this),this._call=e,this._time=r,ay()},stop:function(){this._call&&(this._call=null,this._time=1/0,ay())}};function TC(e,t,r){var s=new Zu;return s.restart(e,t,r),s}function XI(){$y(),++vo;for(var e=Xu,t;e;)(t=oi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--vo}function r_(){oi=(Qu=Fa.now())+dc,vo=Ra=0;try{XI()}finally{vo=0,ZI(),oi=0}}function QI(){var e=Fa.now(),t=e-Qu;t>CC&&(dc-=t,Qu=e)}function ZI(){for(var e,t=Xu,r,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Xu=r);Aa=e,ay(s)}function ay(e){if(!vo){Ra&&(Ra=clearTimeout(Ra));var t=e-oi;t>24?(e<1/0&&(Ra=setTimeout(r_,e-Fa.now()-dc)),ka&&(ka=clearInterval(ka))):(ka||(Qu=Fa.now(),ka=setInterval(QI,CC)),vo=1,jC(r_))}}function s_(e,t,r){var s=new Zu;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,r),s}var JI=uc("start","end","cancel","interrupt"),eM=[],RC=0,i_=1,ly=2,Bu=3,o_=4,uy=5,Uu=6;function fc(e,t,r,s,o,a){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;tM(e,r,{name:t,index:s,group:o,on:JI,tween:eM,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:RC})}function qy(e,t){var r=or(e,t);if(r.state>RC)throw new Error("too late; already scheduled");return r}function br(e,t){var r=or(e,t);if(r.state>Bu)throw new Error("too late; already running");return r}function or(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function tM(e,t,r){var s=e.__transition,o;s[t]=r,r.timer=TC(a,0,r.time);function a(p){r.state=i_,r.timer.restart(u,r.delay,r.time),r.delay<=p&&u(p-r.delay)}function u(p){var d,g,y,w;if(r.state!==i_)return f();for(d in s)if(w=s[d],w.name===r.name){if(w.state===Bu)return s_(u);w.state===o_?(w.state=Uu,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete s[d]):+d<t&&(w.state=Uu,w.timer.stop(),w.on.call("cancel",e,e.__data__,w.index,w.group),delete s[d])}if(s_(function(){r.state===Bu&&(r.state=o_,r.timer.restart(c,r.delay,r.time),c(p))}),r.state=ly,r.on.call("start",e,e.__data__,r.index,r.group),r.state===ly){for(r.state=Bu,o=new Array(y=r.tween.length),d=0,g=-1;d<y;++d)(w=r.tween[d].value.call(e,e.__data__,r.index,r.group))&&(o[++g]=w);o.length=g+1}}function c(p){for(var d=p<r.duration?r.ease.call(null,p/r.duration):(r.timer.restart(f),r.state=uy,1),g=-1,y=o.length;++g<y;)o[g].call(e,d);r.state===uy&&(r.on.call("end",e,e.__data__,r.index,r.group),f())}function f(){r.state=Uu,r.timer.stop(),delete s[t];for(var p in s)return;delete e.__transition}}function Hu(e,t){var r=e.__transition,s,o,a=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((s=r[u]).name!==t){a=!1;continue}o=s.state>ly&&s.state<uy,s.state=Uu,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete r[u]}a&&delete e.__transition}}function nM(e){return this.each(function(){Hu(this,e)})}function rM(e,t){var r,s;return function(){var o=br(this,e),a=o.tween;if(a!==r){s=r=a;for(var u=0,c=s.length;u<c;++u)if(s[u].name===t){s=s.slice(),s.splice(u,1);break}}o.tween=s}}function sM(e,t,r){var s,o;if(typeof r!="function")throw new Error;return function(){var a=br(this,e),u=a.tween;if(u!==s){o=(s=u).slice();for(var c={name:t,value:r},f=0,p=o.length;f<p;++f)if(o[f].name===t){o[f]=c;break}f===p&&o.push(c)}a.tween=o}}function iM(e,t){var r=this._id;if(e+="",arguments.length<2){for(var s=or(this.node(),r).tween,o=0,a=s.length,u;o<a;++o)if((u=s[o]).name===e)return u.value;return null}return this.each((t==null?rM:sM)(r,e,t))}function Dy(e,t,r){var s=e._id;return e.each(function(){var o=br(this,s);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return or(o,s).value[t]}}function AC(e,t){var r;return(typeof t=="number"?ks:t instanceof Da?e_:(r=Da(t))?(t=r,e_):FI)(e,t)}function oM(e){return function(){this.removeAttribute(e)}}function aM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lM(e,t,r){var s,o=r+"",a;return function(){var u=this.getAttribute(e);return u===o?null:u===s?a:a=t(s=u,r)}}function uM(e,t,r){var s,o=r+"",a;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===s?a:a=t(s=u,r)}}function cM(e,t,r){var s,o,a;return function(){var u,c=r(this),f;return c==null?void this.removeAttribute(e):(u=this.getAttribute(e),f=c+"",u===f?null:u===s&&f===o?a:(o=f,a=t(s=u,c)))}}function dM(e,t,r){var s,o,a;return function(){var u,c=r(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),f=c+"",u===f?null:u===s&&f===o?a:(o=f,a=t(s=u,c)))}}function fM(e,t){var r=cc(e),s=r==="transform"?HI:AC;return this.attrTween(e,typeof t=="function"?(r.local?dM:cM)(r,s,Dy(this,"attr."+e,t)):t==null?(r.local?aM:oM)(r):(r.local?uM:lM)(r,s,t))}function hM(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function pM(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function mM(e,t){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&pM(e,a)),r}return o._value=t,o}function gM(e,t){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&hM(e,a)),r}return o._value=t,o}function vM(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var s=cc(e);return this.tween(r,(s.local?mM:gM)(s,t))}function yM(e,t){return function(){qy(this,e).delay=+t.apply(this,arguments)}}function wM(e,t){return t=+t,function(){qy(this,e).delay=t}}function xM(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?yM:wM)(t,e)):or(this.node(),t).delay}function _M(e,t){return function(){br(this,e).duration=+t.apply(this,arguments)}}function bM(e,t){return t=+t,function(){br(this,e).duration=t}}function kM(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?_M:bM)(t,e)):or(this.node(),t).duration}function SM(e,t){if(typeof t!="function")throw new Error;return function(){br(this,e).ease=t}}function EM(e){var t=this._id;return arguments.length?this.each(SM(t,e)):or(this.node(),t).ease}function NM(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;br(this,e).ease=r}}function CM(e){if(typeof e!="function")throw new Error;return this.each(NM(this._id,e))}function jM(e){typeof e!="function"&&(e=uC(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,c=s[o]=[],f,p=0;p<u;++p)(f=a[p])&&e.call(f,f.__data__,p,a)&&c.push(f);return new Gr(s,this._parents,this._name,this._id)}function TM(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,s=t.length,o=r.length,a=Math.min(s,o),u=new Array(s),c=0;c<a;++c)for(var f=t[c],p=r[c],d=f.length,g=u[c]=new Array(d),y,w=0;w<d;++w)(y=f[w]||p[w])&&(g[w]=y);for(;c<s;++c)u[c]=t[c];return new Gr(u,this._parents,this._name,this._id)}function RM(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function AM(e,t,r){var s,o,a=RM(t)?qy:br;return function(){var u=a(this,e),c=u.on;c!==s&&(o=(s=c).copy()).on(t,r),u.on=o}}function IM(e,t){var r=this._id;return arguments.length<2?or(this.node(),r).on.on(e):this.each(AM(r,e,t))}function MM(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function OM(){return this.on("end.remove",MM(this._id))}function PM(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Oy(e));for(var s=this._groups,o=s.length,a=new Array(o),u=0;u<o;++u)for(var c=s[u],f=c.length,p=a[u]=new Array(f),d,g,y=0;y<f;++y)(d=c[y])&&(g=e.call(d,d.__data__,y,c))&&("__data__"in d&&(g.__data__=d.__data__),p[y]=g,fc(p[y],t,r,y,p,or(d,r)));return new Gr(a,this._parents,t,r)}function LM(e){var t=this._name,r=this._id;typeof e!="function"&&(e=lC(e));for(var s=this._groups,o=s.length,a=[],u=[],c=0;c<o;++c)for(var f=s[c],p=f.length,d,g=0;g<p;++g)if(d=f[g]){for(var y=e.call(d,d.__data__,g,f),w,S=or(d,r),_=0,b=y.length;_<b;++_)(w=y[_])&&fc(w,t,r,_,y,S);a.push(y),u.push(d)}return new Gr(a,u,t,r)}var $M=Xa.prototype.constructor;function qM(){return new $M(this._groups,this._parents)}function DM(e,t){var r,s,o;return function(){var a=go(this,e),u=(this.style.removeProperty(e),go(this,e));return a===u?null:a===r&&u===s?o:o=t(r=a,s=u)}}function IC(e){return function(){this.style.removeProperty(e)}}function FM(e,t,r){var s,o=r+"",a;return function(){var u=go(this,e);return u===o?null:u===s?a:a=t(s=u,r)}}function zM(e,t,r){var s,o,a;return function(){var u=go(this,e),c=r(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),go(this,e))),u===f?null:u===s&&f===o?a:(o=f,a=t(s=u,c))}}function BM(e,t){var r,s,o,a="style."+t,u="end."+a,c;return function(){var f=br(this,e),p=f.on,d=f.value[a]==null?c||(c=IC(t)):void 0;(p!==r||o!==d)&&(s=(r=p).copy()).on(u,o=d),f.on=s}}function UM(e,t,r){var s=(e+="")=="transform"?UI:AC;return t==null?this.styleTween(e,DM(e,s)).on("end.style."+e,IC(e)):typeof t=="function"?this.styleTween(e,zM(e,s,Dy(this,"style."+e,t))).each(BM(this._id,e)):this.styleTween(e,FM(e,s,t),r).on("end.style."+e,null)}function HM(e,t,r){return function(s){this.style.setProperty(e,t.call(this,s),r)}}function WM(e,t,r){var s,o;function a(){var u=t.apply(this,arguments);return u!==o&&(s=(o=u)&&HM(e,u,r)),s}return a._value=t,a}function VM(e,t,r){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,WM(e,t,r??""))}function GM(e){return function(){this.textContent=e}}function YM(e){return function(){var t=e(this);this.textContent=t??""}}function KM(e){return this.tween("text",typeof e=="function"?YM(Dy(this,"text",e)):GM(e==null?"":e+""))}function XM(e){return function(t){this.textContent=e.call(this,t)}}function QM(e){var t,r;function s(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&XM(o)),t}return s._value=e,s}function ZM(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,QM(e))}function JM(){for(var e=this._name,t=this._id,r=MC(),s=this._groups,o=s.length,a=0;a<o;++a)for(var u=s[a],c=u.length,f,p=0;p<c;++p)if(f=u[p]){var d=or(f,t);fc(f,e,r,p,u,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Gr(s,this._parents,e,r)}function eO(){var e,t,r=this,s=r._id,o=r.size();return new Promise(function(a,u){var c={value:u},f={value:function(){--o===0&&a()}};r.each(function(){var p=br(this,s),d=p.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),p.on=t}),o===0&&a()})}var tO=0;function Gr(e,t,r,s){this._groups=e,this._parents=t,this._name=r,this._id=s}function MC(){return++tO}var Ur=Xa.prototype;Gr.prototype={constructor:Gr,select:PM,selectAll:LM,selectChild:Ur.selectChild,selectChildren:Ur.selectChildren,filter:jM,merge:TM,selection:qM,transition:JM,call:Ur.call,nodes:Ur.nodes,node:Ur.node,size:Ur.size,empty:Ur.empty,each:Ur.each,on:IM,attr:fM,attrTween:vM,style:UM,styleTween:VM,text:KM,textTween:ZM,remove:OM,tween:iM,delay:xM,duration:kM,ease:EM,easeVarying:CM,end:eO,[Symbol.iterator]:Ur[Symbol.iterator]};function nO(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var rO={time:null,delay:0,duration:250,ease:nO};function sO(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function iO(e){var t,r;e instanceof Gr?(t=e._id,e=e._name):(t=MC(),(r=rO).time=$y(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,a=0;a<o;++a)for(var u=s[a],c=u.length,f,p=0;p<c;++p)(f=u[p])&&fc(f,e,t,p,u,r||sO(f,t));return new Gr(s,this._parents,e,t)}Xa.prototype.interrupt=nM;Xa.prototype.transition=iO;const Cu=e=>()=>e;function oO(e,{sourceEvent:t,target:r,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Hr(e,t,r){this.k=e,this.x=t,this.y=r}Hr.prototype={constructor:Hr,scale:function(e){return e===1?this:new Hr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Hr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Vr=new Hr(1,0,0);Hr.prototype;function bf(e){e.stopImmediatePropagation()}function Sa(e){e.preventDefault(),e.stopImmediatePropagation()}function aO(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function lO(){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 a_(){return this.__zoom||Vr}function uO(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function cO(){return navigator.maxTouchPoints||"ontouchstart"in this}function dO(e,t,r){var s=e.invertX(t[0][0])-r[0][0],o=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),u>a?(a+u)/2:Math.min(0,a)||Math.max(0,u))}function OC(){var e=aO,t=lO,r=dO,s=uO,o=cO,a=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,f=YI,p=uc("start","zoom","end"),d,g,y,w=500,S=150,_=0,b=10;function k(j){j.property("__zoom",a_).on("wheel.zoom",U,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",M).filter(o).on("touchstart.zoom",q).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",X).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(j,G,B,te){var Z=j.selection?j.selection():j;Z.property("__zoom",a_),j!==Z?A(j,G,B,te):Z.interrupt().each(function(){L(this,arguments).event(te).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},k.scaleBy=function(j,G,B,te){k.scaleTo(j,function(){var Z=this.__zoom.k,$=typeof G=="function"?G.apply(this,arguments):G;return Z*$},B,te)},k.scaleTo=function(j,G,B,te){k.transform(j,function(){var Z=t.apply(this,arguments),$=this.__zoom,H=B==null?T(Z):typeof B=="function"?B.apply(this,arguments):B,I=$.invert(H),Y=typeof G=="function"?G.apply(this,arguments):G;return r(C(E($,Y),H,I),Z,u)},B,te)},k.translateBy=function(j,G,B,te){k.transform(j,function(){return r(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof B=="function"?B.apply(this,arguments):B),t.apply(this,arguments),u)},null,te)},k.translateTo=function(j,G,B,te,Z){k.transform(j,function(){var $=t.apply(this,arguments),H=this.__zoom,I=te==null?T($):typeof te=="function"?te.apply(this,arguments):te;return r(Vr.translate(I[0],I[1]).scale(H.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof B=="function"?-B.apply(this,arguments):-B),$,u)},te,Z)};function E(j,G){return G=Math.max(a[0],Math.min(a[1],G)),G===j.k?j:new Hr(G,j.x,j.y)}function C(j,G,B){var te=G[0]-B[0]*j.k,Z=G[1]-B[1]*j.k;return te===j.x&&Z===j.y?j:new Hr(j.k,te,Z)}function T(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function A(j,G,B,te){j.on("start.zoom",function(){L(this,arguments).event(te).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(te).end()}).tween("zoom",function(){var Z=this,$=arguments,H=L(Z,$).event(te),I=t.apply(Z,$),Y=B==null?T(I):typeof B=="function"?B.apply(Z,$):B,ce=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),z=Z.__zoom,Q=typeof G=="function"?G.apply(Z,$):G,ne=f(z.invert(Y).concat(ce/z.k),Q.invert(Y).concat(ce/Q.k));return function(ae){if(ae===1)ae=Q;else{var fe=ne(ae),pe=ce/fe[2];ae=new Hr(pe,Y[0]-fe[0]*pe,Y[1]-fe[1]*pe)}H.zoom(null,ae)}})}function L(j,G,B){return!B&&j.__zooming||new P(j,G)}function P(j,G){this.that=j,this.args=G,this.active=0,this.sourceEvent=null,this.extent=t.apply(j,G),this.taps=0}P.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=$n(this.that).datum();p.call(j,this.that,new oO(j,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:p}),G)}};function U(j,...G){if(!e.apply(this,arguments))return;var B=L(this,G).event(j),te=this.__zoom,Z=Math.max(a[0],Math.min(a[1],te.k*Math.pow(2,s.apply(this,arguments)))),$=nr(j);if(B.wheel)(B.mouse[0][0]!==$[0]||B.mouse[0][1]!==$[1])&&(B.mouse[1]=te.invert(B.mouse[0]=$)),clearTimeout(B.wheel);else{if(te.k===Z)return;B.mouse=[$,te.invert($)],Hu(this),B.start()}Sa(j),B.wheel=setTimeout(H,S),B.zoom("mouse",r(C(E(te,Z),B.mouse[0],B.mouse[1]),B.extent,u));function H(){B.wheel=null,B.end()}}function O(j,...G){if(y||!e.apply(this,arguments))return;var B=j.currentTarget,te=L(this,G,!0).event(j),Z=$n(j.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",ce,!0),$=nr(j,B),H=j.clientX,I=j.clientY;wC(j.view),bf(j),te.mouse=[$,this.__zoom.invert($)],Hu(this),te.start();function Y(z){if(Sa(z),!te.moved){var Q=z.clientX-H,ne=z.clientY-I;te.moved=Q*Q+ne*ne>_}te.event(z).zoom("mouse",r(C(te.that.__zoom,te.mouse[0]=nr(z,B),te.mouse[1]),te.extent,u))}function ce(z){Z.on("mousemove.zoom mouseup.zoom",null),xC(z.view,te.moved),Sa(z),te.event(z).end()}}function M(j,...G){if(e.apply(this,arguments)){var B=this.__zoom,te=nr(j.changedTouches?j.changedTouches[0]:j,this),Z=B.invert(te),$=B.k*(j.shiftKey?.5:2),H=r(C(E(B,$),te,Z),t.apply(this,G),u);Sa(j),c>0?$n(this).transition().duration(c).call(A,H,te,j):$n(this).call(k.transform,H,te,j)}}function q(j,...G){if(e.apply(this,arguments)){var B=j.touches,te=B.length,Z=L(this,G,j.changedTouches.length===te).event(j),$,H,I,Y;for(bf(j),H=0;H<te;++H)I=B[H],Y=nr(I,this),Y=[Y,this.__zoom.invert(Y),I.identifier],Z.touch0?!Z.touch1&&Z.touch0[2]!==Y[2]&&(Z.touch1=Y,Z.taps=0):(Z.touch0=Y,$=!0,Z.taps=1+!!d);d&&(d=clearTimeout(d)),$&&(Z.taps<2&&(g=Y[0],d=setTimeout(function(){d=null},w)),Hu(this),Z.start())}}function V(j,...G){if(this.__zooming){var B=L(this,G).event(j),te=j.changedTouches,Z=te.length,$,H,I,Y;for(Sa(j),$=0;$<Z;++$)H=te[$],I=nr(H,this),B.touch0&&B.touch0[2]===H.identifier?B.touch0[0]=I:B.touch1&&B.touch1[2]===H.identifier&&(B.touch1[0]=I);if(H=B.that.__zoom,B.touch1){var ce=B.touch0[0],z=B.touch0[1],Q=B.touch1[0],ne=B.touch1[1],ae=(ae=Q[0]-ce[0])*ae+(ae=Q[1]-ce[1])*ae,fe=(fe=ne[0]-z[0])*fe+(fe=ne[1]-z[1])*fe;H=E(H,Math.sqrt(ae/fe)),I=[(ce[0]+Q[0])/2,(ce[1]+Q[1])/2],Y=[(z[0]+ne[0])/2,(z[1]+ne[1])/2]}else if(B.touch0)I=B.touch0[0],Y=B.touch0[1];else return;B.zoom("touch",r(C(H,I,Y),B.extent,u))}}function X(j,...G){if(this.__zooming){var B=L(this,G).event(j),te=j.changedTouches,Z=te.length,$,H;for(bf(j),y&&clearTimeout(y),y=setTimeout(function(){y=null},w),$=0;$<Z;++$)H=te[$],B.touch0&&B.touch0[2]===H.identifier?delete B.touch0:B.touch1&&B.touch1[2]===H.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&(H=nr(H,this),Math.hypot(g[0]-H[0],g[1]-H[1])<b)){var I=$n(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return k.wheelDelta=function(j){return arguments.length?(s=typeof j=="function"?j:Cu(+j),k):s},k.filter=function(j){return arguments.length?(e=typeof j=="function"?j:Cu(!!j),k):e},k.touchable=function(j){return arguments.length?(o=typeof j=="function"?j:Cu(!!j),k):o},k.extent=function(j){return arguments.length?(t=typeof j=="function"?j:Cu([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),k):t},k.scaleExtent=function(j){return arguments.length?(a[0]=+j[0],a[1]=+j[1],k):[a[0],a[1]]},k.translateExtent=function(j){return arguments.length?(u[0][0]=+j[0][0],u[1][0]=+j[1][0],u[0][1]=+j[0][1],u[1][1]=+j[1][1],k):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},k.constrain=function(j){return arguments.length?(r=j,k):r},k.duration=function(j){return arguments.length?(c=+j,k):c},k.interpolate=function(j){return arguments.length?(f=j,k):f},k.on=function(){var j=p.on.apply(p,arguments);return j===p?k:j},k.clickDistance=function(j){return arguments.length?(_=(j=+j)*j,k):Math.sqrt(_)},k.tapDistance=function(j){return arguments.length?(b=+j,k):b},k}var fO=iC();const hc=N.createContext(null),hO=hc.Provider,Yr={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,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.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.`},PC=Yr.error001();function it(e,t){const r=N.useContext(hc);if(r===null)throw new Error(PC);return oC(r,e,t)}const Nt=()=>{const e=N.useContext(hc);if(e===null)throw new Error(PC);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},pO=e=>e.userSelectionActive?"none":"all";function Fy({position:e,children:t,className:r,style:s,...o}){const a=it(pO),u=`${e}`.split("-");return ue.createElement("div",{className:zt(["react-flow__panel",r,...u]),style:{...s,pointerEvents:a},...o},t)}function mO({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:ue.createElement(Fy,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ue.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const gO=({x:e,y:t,label:r,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:a={},labelBgPadding:u=[2,4],labelBgBorderRadius:c=2,children:f,className:p,...d})=>{const g=N.useRef(null),[y,w]=N.useState({x:0,y:0,width:0,height:0}),S=zt(["react-flow__edge-textwrapper",p]);return N.useEffect(()=>{if(g.current){const _=g.current.getBBox();w({x:_.x,y:_.y,width:_.width,height:_.height})}},[r]),typeof r>"u"||!r?null:ue.createElement("g",{transform:`translate(${e-y.width/2} ${t-y.height/2})`,className:S,visibility:y.width?"visible":"hidden",...d},o&&ue.createElement("rect",{width:y.width+2*u[0],x:-u[0],y:-u[1],height:y.height+2*u[1],className:"react-flow__edge-textbg",style:a,rx:c,ry:c}),ue.createElement("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:g,style:s},r),f)};var vO=N.memo(gO);const zy=e=>({width:e.offsetWidth,height:e.offsetHeight}),yo=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),By=(e={x:0,y:0},t)=>({x:yo(e.x,t[0][0],t[1][0]),y:yo(e.y,t[0][1],t[1][1])}),l_=(e,t,r)=>e<t?yo(Math.abs(e-t),1,50)/50:e>r?-yo(Math.abs(e-r),1,50)/50:0,LC=(e,t)=>{const r=l_(e.x,35,t.width-35)*20,s=l_(e.y,35,t.height-35)*20;return[r,s]},$C=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},qC=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),za=({x:e,y:t,width:r,height:s})=>({x:e,y:t,x2:e+r,y2:t+s}),DC=({x:e,y:t,x2:r,y2:s})=>({x:e,y:t,width:r-e,height:s-t}),u_=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),yO=(e,t)=>DC(qC(za(e),za(t))),cy=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*s)},wO=e=>qn(e.width)&&qn(e.height)&&qn(e.x)&&qn(e.y),qn=e=>!isNaN(e)&&isFinite(e),bt=Symbol.for("internals"),FC=["Enter"," ","Escape"],xO=(e,t)=>{},_O=e=>"nativeEvent"in e;function dy(e){var o,a;const t=_O(e)?e.nativeEvent:e,r=((a=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:a[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(r==null?void 0:r.nodeName)||(r==null?void 0:r.hasAttribute("contenteditable"))||!!(r!=null&&r.closest(".nokey"))}const zC=e=>"clientX"in e,Ns=(e,t)=>{var a,u;const r=zC(e),s=r?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,o=r?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},Ju=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Za=({id:e,path:t,labelX:r,labelY:s,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:d,markerEnd:g,markerStart:y,interactionWidth:w=20})=>ue.createElement(ue.Fragment,null,ue.createElement("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:g,markerStart:y}),w&&ue.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}),o&&qn(r)&&qn(s)?ue.createElement(vO,{x:r,y:s,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p}):null);Za.displayName="BaseEdge";function Ea(e,t,r){return r===void 0?r:s=>{const o=t().edges.find(a=>a.id===e);o&&r(s,{...o})}}function BC({sourceX:e,sourceY:t,targetX:r,targetY:s}){const o=Math.abs(r-e)/2,a=r<e?r+o:r-o,u=Math.abs(s-t)/2,c=s<t?s+u:s-u;return[a,c,o,u]}function UC({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:a,targetControlX:u,targetControlY:c}){const f=e*.125+o*.375+u*.375+r*.125,p=t*.125+a*.375+c*.375+s*.125,d=Math.abs(f-e),g=Math.abs(p-t);return[f,p,d,g]}var ai;(function(e){e.Strict="strict",e.Loose="loose"})(ai||(ai={}));var ri;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ri||(ri={}));var Ba;(function(e){e.Partial="partial",e.Full="full"})(Ba||(Ba={}));var Es;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Es||(Es={}));var ec;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ec||(ec={}));var Ae;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ae||(Ae={}));function c_({pos:e,x1:t,y1:r,x2:s,y2:o}){return e===Ae.Left||e===Ae.Right?[.5*(t+s),r]:[t,.5*(r+o)]}function HC({sourceX:e,sourceY:t,sourcePosition:r=Ae.Bottom,targetX:s,targetY:o,targetPosition:a=Ae.Top}){const[u,c]=c_({pos:r,x1:e,y1:t,x2:s,y2:o}),[f,p]=c_({pos:a,x1:s,y1:o,x2:e,y2:t}),[d,g,y,w]=UC({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:u,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${u},${c} ${f},${p} ${s},${o}`,d,g,y,w]}const Uy=N.memo(({sourceX:e,sourceY:t,targetX:r,targetY:s,sourcePosition:o=Ae.Bottom,targetPosition:a=Ae.Top,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:S,interactionWidth:_})=>{const[b,k,E]=HC({sourceX:e,sourceY:t,sourcePosition:o,targetX:r,targetY:s,targetPosition:a});return ue.createElement(Za,{path:b,labelX:k,labelY:E,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:S,interactionWidth:_})});Uy.displayName="SimpleBezierEdge";const d_={[Ae.Left]:{x:-1,y:0},[Ae.Right]:{x:1,y:0},[Ae.Top]:{x:0,y:-1},[Ae.Bottom]:{x:0,y:1}},bO=({source:e,sourcePosition:t=Ae.Bottom,target:r})=>t===Ae.Left||t===Ae.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},f_=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function kO({source:e,sourcePosition:t=Ae.Bottom,target:r,targetPosition:s=Ae.Top,center:o,offset:a}){const u=d_[t],c=d_[s],f={x:e.x+u.x*a,y:e.y+u.y*a},p={x:r.x+c.x*a,y:r.y+c.y*a},d=bO({source:f,sourcePosition:t,target:p}),g=d.x!==0?"x":"y",y=d[g];let w=[],S,_;const b={x:0,y:0},k={x:0,y:0},[E,C,T,A]=BC({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(u[g]*c[g]===-1){S=o.x??E,_=o.y??C;const P=[{x:S,y:f.y},{x:S,y:p.y}],U=[{x:f.x,y:_},{x:p.x,y:_}];u[g]===y?w=g==="x"?P:U:w=g==="x"?U:P}else{const P=[{x:f.x,y:p.y}],U=[{x:p.x,y:f.y}];if(g==="x"?w=u.x===y?U:P:w=u.y===y?P:U,t===s){const X=Math.abs(e[g]-r[g]);if(X<=a){const j=Math.min(a-1,a-X);u[g]===y?b[g]=(f[g]>e[g]?-1:1)*j:k[g]=(p[g]>r[g]?-1:1)*j}}if(t!==s){const X=g==="x"?"y":"x",j=u[g]===c[X],G=f[X]>p[X],B=f[X]<p[X];(u[g]===1&&(!j&&G||j&&B)||u[g]!==1&&(!j&&B||j&&G))&&(w=g==="x"?P:U)}const O={x:f.x+b.x,y:f.y+b.y},M={x:p.x+k.x,y:p.y+k.y},q=Math.max(Math.abs(O.x-w[0].x),Math.abs(M.x-w[0].x)),V=Math.max(Math.abs(O.y-w[0].y),Math.abs(M.y-w[0].y));q>=V?(S=(O.x+M.x)/2,_=w[0].y):(S=w[0].x,_=(O.y+M.y)/2)}return[[e,{x:f.x+b.x,y:f.y+b.y},...w,{x:p.x+k.x,y:p.y+k.y},r],S,_,T,A]}function SO(e,t,r,s){const o=Math.min(f_(e,t)/2,f_(t,r)/2,s),{x:a,y:u}=t;if(e.x===a&&a===r.x||e.y===u&&u===r.y)return`L${a} ${u}`;if(e.y===u){const p=e.x<r.x?-1:1,d=e.y<r.y?1:-1;return`L ${a+o*p},${u}Q ${a},${u} ${a},${u+o*d}`}const c=e.x<r.x?1:-1,f=e.y<r.y?-1:1;return`L ${a},${u+o*f}Q ${a},${u} ${a+o*c},${u}`}function fy({sourceX:e,sourceY:t,sourcePosition:r=Ae.Bottom,targetX:s,targetY:o,targetPosition:a=Ae.Top,borderRadius:u=5,centerX:c,centerY:f,offset:p=20}){const[d,g,y,w,S]=kO({source:{x:e,y:t},sourcePosition:r,target:{x:s,y:o},targetPosition:a,center:{x:c,y:f},offset:p});return[d.reduce((b,k,E)=>{let C="";return E>0&&E<d.length-1?C=SO(d[E-1],k,d[E+1],u):C=`${E===0?"M":"L"}${k.x} ${k.y}`,b+=C,b},""),g,y,w,S]}const pc=N.memo(({sourceX:e,sourceY:t,targetX:r,targetY:s,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:d,sourcePosition:g=Ae.Bottom,targetPosition:y=Ae.Top,markerEnd:w,markerStart:S,pathOptions:_,interactionWidth:b})=>{const[k,E,C]=fy({sourceX:e,sourceY:t,sourcePosition:g,targetX:r,targetY:s,targetPosition:y,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset});return ue.createElement(Za,{path:k,labelX:E,labelY:C,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:d,markerEnd:w,markerStart:S,interactionWidth:b})});pc.displayName="SmoothStepEdge";const Hy=N.memo(e=>{var t;return ue.createElement(pc,{...e,pathOptions:N.useMemo(()=>{var r;return{borderRadius:0,offset:(r=e.pathOptions)==null?void 0:r.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});Hy.displayName="StepEdge";function EO({sourceX:e,sourceY:t,targetX:r,targetY:s}){const[o,a,u,c]=BC({sourceX:e,sourceY:t,targetX:r,targetY:s});return[`M ${e},${t}L ${r},${s}`,o,a,u,c]}const Wy=N.memo(({sourceX:e,sourceY:t,targetX:r,targetY:s,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:d,markerEnd:g,markerStart:y,interactionWidth:w})=>{const[S,_,b]=EO({sourceX:e,sourceY:t,targetX:r,targetY:s});return ue.createElement(Za,{path:S,labelX:_,labelY:b,label:o,labelStyle:a,labelShowBg:u,labelBgStyle:c,labelBgPadding:f,labelBgBorderRadius:p,style:d,markerEnd:g,markerStart:y,interactionWidth:w})});Wy.displayName="StraightEdge";function ju(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function h_({pos:e,x1:t,y1:r,x2:s,y2:o,c:a}){switch(e){case Ae.Left:return[t-ju(t-s,a),r];case Ae.Right:return[t+ju(s-t,a),r];case Ae.Top:return[t,r-ju(r-o,a)];case Ae.Bottom:return[t,r+ju(o-r,a)]}}function WC({sourceX:e,sourceY:t,sourcePosition:r=Ae.Bottom,targetX:s,targetY:o,targetPosition:a=Ae.Top,curvature:u=.25}){const[c,f]=h_({pos:r,x1:e,y1:t,x2:s,y2:o,c:u}),[p,d]=h_({pos:a,x1:s,y1:o,x2:e,y2:t,c:u}),[g,y,w,S]=UC({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:c,sourceControlY:f,targetControlX:p,targetControlY:d});return[`M${e},${t} C${c},${f} ${p},${d} ${s},${o}`,g,y,w,S]}const tc=N.memo(({sourceX:e,sourceY:t,targetX:r,targetY:s,sourcePosition:o=Ae.Bottom,targetPosition:a=Ae.Top,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:S,pathOptions:_,interactionWidth:b})=>{const[k,E,C]=WC({sourceX:e,sourceY:t,sourcePosition:o,targetX:r,targetY:s,targetPosition:a,curvature:_==null?void 0:_.curvature});return ue.createElement(Za,{path:k,labelX:E,labelY:C,label:u,labelStyle:c,labelShowBg:f,labelBgStyle:p,labelBgPadding:d,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:S,interactionWidth:b})});tc.displayName="BezierEdge";const Vy=N.createContext(null),NO=Vy.Provider;Vy.Consumer;const CO=()=>N.useContext(Vy),jO=e=>"id"in e&&"source"in e&&"target"in e,TO=({source:e,sourceHandle:t,target:r,targetHandle:s})=>`reactflow__edge-${e}${t||""}-${r}${s||""}`,hy=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`,RO=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),AO=(e,t)=>{if(!e.source||!e.target)return t;let r;return jO(e)?r={...e}:r={...e,id:TO(e)},RO(r,t)?t:t.concat(r)},py=({x:e,y:t},[r,s,o],a,[u,c])=>{const f={x:(e-r)/o,y:(t-s)/o};return a?{x:u*Math.round(f.x/u),y:c*Math.round(f.y/c)}:f},VC=({x:e,y:t},[r,s,o])=>({x:e*o+r,y:t*o+s}),ii=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const r=(e.width??0)*t[0],s=(e.height??0)*t[1],o={x:e.position.x-r,y:e.position.y-s};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-r,y:e.positionAbsolute.y-s}:o}},mc=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((s,o)=>{const{x:a,y:u}=ii(o,t).positionAbsolute;return qC(s,za({x:a,y:u,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return DC(r)},GC=(e,t,[r,s,o]=[0,0,1],a=!1,u=!1,c=[0,0])=>{const f={x:(t.x-r)/o,y:(t.y-s)/o,width:t.width/o,height:t.height/o},p=[];return e.forEach(d=>{const{width:g,height:y,selectable:w=!0,hidden:S=!1}=d;if(u&&!w||S)return!1;const{positionAbsolute:_}=ii(d,c),b={x:_.x,y:_.y,width:g||0,height:y||0},k=cy(f,b),E=typeof g>"u"||typeof y>"u"||g===null||y===null,C=a&&k>0,T=(g||0)*(y||0);(E||C||k>=T||d.dragging)&&p.push(d)}),p},YC=(e,t)=>{const r=e.map(s=>s.id);return t.filter(s=>r.includes(s.source)||r.includes(s.target))},KC=(e,t,r,s,o,a=.1)=>{const u=t/(e.width*(1+a)),c=r/(e.height*(1+a)),f=Math.min(u,c),p=yo(f,s,o),d=e.x+e.width/2,g=e.y+e.height/2,y=t/2-d*p,w=r/2-g*p;return{x:y,y:w,zoom:p}},ti=(e,t=0)=>e.transition().duration(t);function p_(e,t,r,s){return(t[r]||[]).reduce((o,a)=>{var u,c;return`${e.id}-${a.id}-${r}`!==s&&o.push({id:a.id||null,type:r,nodeId:e.id,x:(((u=e.positionAbsolute)==null?void 0:u.x)??0)+a.x+a.width/2,y:(((c=e.positionAbsolute)==null?void 0:c.y)??0)+a.y+a.height/2}),o},[])}function IO(e,t,r,s,o,a){const{x:u,y:c}=Ns(e),p=t.elementsFromPoint(u,c).find(S=>S.classList.contains("react-flow__handle"));if(p){const S=p.getAttribute("data-nodeid");if(S){const _=Gy(void 0,p),b=p.getAttribute("data-handleid"),k=a({nodeId:S,id:b,type:_});if(k){const E=o.find(C=>C.nodeId===S&&C.type===_&&C.id===b);return{handle:{id:b,type:_,nodeId:S,x:(E==null?void 0:E.x)||r.x,y:(E==null?void 0:E.y)||r.y},validHandleResult:k}}}}let d=[],g=1/0;if(o.forEach(S=>{const _=Math.sqrt((S.x-r.x)**2+(S.y-r.y)**2);if(_<=s){const b=a(S);_<=g&&(_<g?d=[{handle:S,validHandleResult:b}]:_===g&&d.push({handle:S,validHandleResult:b}),g=_)}}),!d.length)return{handle:null,validHandleResult:XC()};if(d.length===1)return d[0];const y=d.some(({validHandleResult:S})=>S.isValid),w=d.some(({handle:S})=>S.type==="target");return d.find(({handle:S,validHandleResult:_})=>w?S.type==="target":y?_.isValid:!0)||d[0]}const MO={source:null,target:null,sourceHandle:null,targetHandle:null},XC=()=>({handleDomNode:null,isValid:!1,connection:MO,endHandle:null});function QC(e,t,r,s,o,a,u){const c=o==="target",f=u.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),p={...XC(),handleDomNode:f};if(f){const d=Gy(void 0,f),g=f.getAttribute("data-nodeid"),y=f.getAttribute("data-handleid"),w=f.classList.contains("connectable"),S=f.classList.contains("connectableend"),_={source:c?g:r,sourceHandle:c?y:s,target:c?r:g,targetHandle:c?s:y};p.connection=_,w&&S&&(t===ai.Strict?c&&d==="source"||!c&&d==="target":g!==r||y!==s)&&(p.endHandle={nodeId:g,handleId:y,type:d},p.isValid=a(_))}return p}function OO({nodes:e,nodeId:t,handleId:r,handleType:s}){return e.reduce((o,a)=>{if(a[bt]){const{handleBounds:u}=a[bt];let c=[],f=[];u&&(c=p_(a,u,"source",`${t}-${r}-${s}`),f=p_(a,u,"target",`${t}-${r}-${s}`)),o.push(...c,...f)}return o},[])}function Gy(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function kf(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function PO(e,t){let r=null;return t?r="valid":e&&!t&&(r="invalid"),r}function ZC({event:e,handleId:t,nodeId:r,onConnect:s,isTarget:o,getState:a,setState:u,isValidConnection:c,edgeUpdaterType:f,onReconnectEnd:p}){const d=$C(e.target),{connectionMode:g,domNode:y,autoPanOnConnect:w,connectionRadius:S,onConnectStart:_,panBy:b,getNodes:k,cancelConnection:E}=a();let C=0,T;const{x:A,y:L}=Ns(e),P=d==null?void 0:d.elementFromPoint(A,L),U=Gy(f,P),O=y==null?void 0:y.getBoundingClientRect();if(!O||!U)return;let M,q=Ns(e,O),V=!1,X=null,j=!1,G=null;const B=OO({nodes:k(),nodeId:r,handleId:t,handleType:U}),te=()=>{if(!w)return;const[H,I]=LC(q,O);b({x:H,y:I}),C=requestAnimationFrame(te)};u({connectionPosition:q,connectionStatus:null,connectionNodeId:r,connectionHandleId:t,connectionHandleType:U,connectionStartHandle:{nodeId:r,handleId:t,type:U},connectionEndHandle:null}),_==null||_(e,{nodeId:r,handleId:t,handleType:U});function Z(H){const{transform:I}=a();q=Ns(H,O);const{handle:Y,validHandleResult:ce}=IO(H,d,py(q,I,!1,[1,1]),S,B,z=>QC(z,g,r,t,o?"target":"source",c,d));if(T=Y,V||(te(),V=!0),G=ce.handleDomNode,X=ce.connection,j=ce.isValid,u({connectionPosition:T&&j?VC({x:T.x,y:T.y},I):q,connectionStatus:PO(!!T,j),connectionEndHandle:ce.endHandle}),!T&&!j&&!G)return kf(M);X.source!==X.target&&G&&(kf(M),M=G,G.classList.add("connecting","react-flow__handle-connecting"),G.classList.toggle("valid",j),G.classList.toggle("react-flow__handle-valid",j))}function $(H){var I,Y;(T||G)&&X&&j&&(s==null||s(X)),(Y=(I=a()).onConnectEnd)==null||Y.call(I,H),f&&(p==null||p(H)),kf(M),E(),cancelAnimationFrame(C),V=!1,j=!1,X=null,G=null,d.removeEventListener("mousemove",Z),d.removeEventListener("mouseup",$),d.removeEventListener("touchmove",Z),d.removeEventListener("touchend",$)}d.addEventListener("mousemove",Z),d.addEventListener("mouseup",$),d.addEventListener("touchmove",Z),d.addEventListener("touchend",$)}const m_=()=>!0,LO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),$O=(e,t,r)=>s=>{const{connectionStartHandle:o,connectionEndHandle:a,connectionClickStartHandle:u}=s;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===r||(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===r,clickConnecting:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.handleId)===t&&(u==null?void 0:u.type)===r}},JC=N.forwardRef(({type:e="source",position:t=Ae.Top,isValidConnection:r,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:u,onConnect:c,children:f,className:p,onMouseDown:d,onTouchStart:g,...y},w)=>{var O,M;const S=u||null,_=e==="target",b=Nt(),k=CO(),{connectOnClick:E,noPanClassName:C}=it(LO,It),{connecting:T,clickConnecting:A}=it($O(k,S,e),It);k||(M=(O=b.getState()).onError)==null||M.call(O,"010",Yr.error010());const L=q=>{const{defaultEdgeOptions:V,onConnect:X,hasDefaultEdges:j}=b.getState(),G={...V,...q};if(j){const{edges:B,setEdges:te}=b.getState();te(AO(G,B))}X==null||X(G),c==null||c(G)},P=q=>{if(!k)return;const V=zC(q);o&&(V&&q.button===0||!V)&&ZC({event:q,handleId:S,nodeId:k,onConnect:L,isTarget:_,getState:b.getState,setState:b.setState,isValidConnection:r||b.getState().isValidConnection||m_}),V?d==null||d(q):g==null||g(q)},U=q=>{const{onClickConnectStart:V,onClickConnectEnd:X,connectionClickStartHandle:j,connectionMode:G,isValidConnection:B}=b.getState();if(!k||!j&&!o)return;if(!j){V==null||V(q,{nodeId:k,handleId:S,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:k,type:e,handleId:S}});return}const te=$C(q.target),Z=r||B||m_,{connection:$,isValid:H}=QC({nodeId:k,id:S,type:e},G,j.nodeId,j.handleId||null,j.type,Z,te);H&&L($),X==null||X(q),b.setState({connectionClickStartHandle:null})};return ue.createElement("div",{"data-handleid":S,"data-nodeid":k,"data-handlepos":t,"data-id":`${k}-${S}-${e}`,className:zt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",C,p,{source:!_,target:_,connectable:s,connectablestart:o,connectableend:a,connecting:A,connectionindicator:s&&(o&&!T||a&&T)}]),onMouseDown:P,onTouchStart:P,onClick:E?U:void 0,ref:w,...y},f)});JC.displayName="Handle";var wo=N.memo(JC);const ej=({data:e,isConnectable:t,targetPosition:r=Ae.Top,sourcePosition:s=Ae.Bottom})=>ue.createElement(ue.Fragment,null,ue.createElement(wo,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,ue.createElement(wo,{type:"source",position:s,isConnectable:t}));ej.displayName="DefaultNode";var my=N.memo(ej);const tj=({data:e,isConnectable:t,sourcePosition:r=Ae.Bottom})=>ue.createElement(ue.Fragment,null,e==null?void 0:e.label,ue.createElement(wo,{type:"source",position:r,isConnectable:t}));tj.displayName="InputNode";var nj=N.memo(tj);const rj=({data:e,isConnectable:t,targetPosition:r=Ae.Top})=>ue.createElement(ue.Fragment,null,ue.createElement(wo,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label);rj.displayName="OutputNode";var sj=N.memo(rj);const Yy=()=>null;Yy.displayName="GroupNode";const qO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected).map(t=>({...t}))}),Tu=e=>e.id;function DO(e,t){return It(e.selectedNodes.map(Tu),t.selectedNodes.map(Tu))&&It(e.selectedEdges.map(Tu),t.selectedEdges.map(Tu))}const ij=N.memo(({onSelectionChange:e})=>{const t=Nt(),{selectedNodes:r,selectedEdges:s}=it(qO,DO);return N.useEffect(()=>{const o={nodes:r,edges:s};e==null||e(o),t.getState().onSelectionChange.forEach(a=>a(o))},[r,s,e]),null});ij.displayName="SelectionListener";const FO=e=>!!e.onSelectionChange;function zO({onSelectionChange:e}){const t=it(FO);return e||t?ue.createElement(ij,{onSelectionChange:e}):null}const BO=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 to(e,t){N.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function We(e,t,r){N.useEffect(()=>{typeof t<"u"&&r({[e]:t})},[t])}const UO=({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,onConnect:o,onConnectStart:a,onConnectEnd:u,onClickConnectStart:c,onClickConnectEnd:f,nodesDraggable:p,nodesConnectable:d,nodesFocusable:g,edgesFocusable:y,edgesUpdatable:w,elevateNodesOnSelect:S,minZoom:_,maxZoom:b,nodeExtent:k,onNodesChange:E,onEdgesChange:C,elementsSelectable:T,connectionMode:A,snapGrid:L,snapToGrid:P,translateExtent:U,connectOnClick:O,defaultEdgeOptions:M,fitView:q,fitViewOptions:V,onNodesDelete:X,onEdgesDelete:j,onNodeDrag:G,onNodeDragStart:B,onNodeDragStop:te,onSelectionDrag:Z,onSelectionDragStart:$,onSelectionDragStop:H,noPanClassName:I,nodeOrigin:Y,rfId:ce,autoPanOnConnect:z,autoPanOnNodeDrag:Q,onError:ne,connectionRadius:ae,isValidConnection:fe,nodeDragThreshold:pe})=>{const{setNodes:ye,setEdges:Me,setDefaultNodesAndEdges:Ue,setMinZoom:ze,setMaxZoom:Ie,setTranslateExtent:ke,setNodeExtent:le,reset:we}=it(BO,It),xe=Nt();return N.useEffect(()=>{const Ye=s==null?void 0:s.map(gt=>({...gt,...M}));return Ue(r,Ye),()=>{we()}},[]),We("defaultEdgeOptions",M,xe.setState),We("connectionMode",A,xe.setState),We("onConnect",o,xe.setState),We("onConnectStart",a,xe.setState),We("onConnectEnd",u,xe.setState),We("onClickConnectStart",c,xe.setState),We("onClickConnectEnd",f,xe.setState),We("nodesDraggable",p,xe.setState),We("nodesConnectable",d,xe.setState),We("nodesFocusable",g,xe.setState),We("edgesFocusable",y,xe.setState),We("edgesUpdatable",w,xe.setState),We("elementsSelectable",T,xe.setState),We("elevateNodesOnSelect",S,xe.setState),We("snapToGrid",P,xe.setState),We("snapGrid",L,xe.setState),We("onNodesChange",E,xe.setState),We("onEdgesChange",C,xe.setState),We("connectOnClick",O,xe.setState),We("fitViewOnInit",q,xe.setState),We("fitViewOnInitOptions",V,xe.setState),We("onNodesDelete",X,xe.setState),We("onEdgesDelete",j,xe.setState),We("onNodeDrag",G,xe.setState),We("onNodeDragStart",B,xe.setState),We("onNodeDragStop",te,xe.setState),We("onSelectionDrag",Z,xe.setState),We("onSelectionDragStart",$,xe.setState),We("onSelectionDragStop",H,xe.setState),We("noPanClassName",I,xe.setState),We("nodeOrigin",Y,xe.setState),We("rfId",ce,xe.setState),We("autoPanOnConnect",z,xe.setState),We("autoPanOnNodeDrag",Q,xe.setState),We("onError",ne,xe.setState),We("connectionRadius",ae,xe.setState),We("isValidConnection",fe,xe.setState),We("nodeDragThreshold",pe,xe.setState),to(e,ye),to(t,Me),to(_,ze),to(b,Ie),to(U,ke),to(k,le),null},g_={display:"none"},HO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},oj="react-flow__node-desc",aj="react-flow__edge-desc",WO="react-flow__aria-live",VO=e=>e.ariaLiveMessage;function GO({rfId:e}){const t=it(VO);return ue.createElement("div",{id:`${WO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:HO},t)}function YO({rfId:e,disableKeyboardA11y:t}){return ue.createElement(ue.Fragment,null,ue.createElement("div",{id:`${oj}-${e}`,style:g_},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ue.createElement("div",{id:`${aj}-${e}`,style:g_},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&ue.createElement(GO,{rfId:e}))}var Ua=(e=null,t={actInsideInputWithModifier:!0})=>{const[r,s]=N.useState(!1),o=N.useRef(!1),a=N.useRef(new Set([])),[u,c]=N.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.split("+")),d=p.reduce((g,y)=>g.concat(...y),[]);return[p,d]}return[[],[]]},[e]);return N.useEffect(()=>{const f=typeof document<"u"?document:null,p=(t==null?void 0:t.target)||f;if(e!==null){const d=w=>{if(o.current=w.ctrlKey||w.metaKey||w.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&dy(w))return!1;const _=y_(w.code,c);a.current.add(w[_]),v_(u,a.current,!1)&&(w.preventDefault(),s(!0))},g=w=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&dy(w))return!1;const _=y_(w.code,c);v_(u,a.current,!0)?(s(!1),a.current.clear()):a.current.delete(w[_]),w.key==="Meta"&&a.current.clear(),o.current=!1},y=()=>{a.current.clear(),s(!1)};return p==null||p.addEventListener("keydown",d),p==null||p.addEventListener("keyup",g),window.addEventListener("blur",y),()=>{p==null||p.removeEventListener("keydown",d),p==null||p.removeEventListener("keyup",g),window.removeEventListener("blur",y)}}},[e,s]),r};function v_(e,t,r){return e.filter(s=>r||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function y_(e,t){return t.includes(e)?"code":"key"}function lj(e,t,r,s){var c,f;const o=e.parentNode||e.parentId;if(!o)return r;const a=t.get(o),u=ii(a,s);return lj(a,t,{x:(r.x??0)+u.x,y:(r.y??0)+u.y,z:(((c=a[bt])==null?void 0:c.z)??0)>(r.z??0)?((f=a[bt])==null?void 0:f.z)??0:r.z??0},s)}function uj(e,t,r){e.forEach(s=>{var a;const o=s.parentNode||s.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||r!=null&&r[s.id]){const{x:u,y:c,z:f}=lj(s,e,{...s.position,z:((a=s[bt])==null?void 0:a.z)??0},t);s.positionAbsolute={x:u,y:c},s[bt].z=f,r!=null&&r[s.id]&&(s[bt].isParent=!0)}})}function Sf(e,t,r,s){const o=new Map,a={},u=s?1e3:0;return e.forEach(c=>{var w;const f=(qn(c.zIndex)?c.zIndex:0)+(c.selected?u:0),p=t.get(c.id),d={...c,positionAbsolute:{x:c.position.x,y:c.position.y}},g=c.parentNode||c.parentId;g&&(a[g]=!0);const y=(p==null?void 0:p.type)&&(p==null?void 0:p.type)!==c.type;Object.defineProperty(d,bt,{enumerable:!1,value:{handleBounds:y||(w=p==null?void 0:p[bt])==null?void 0:w.handleBounds,z:f}}),o.set(c.id,d)}),uj(o,r,a),o}function cj(e,t={}){const{getNodes:r,width:s,height:o,minZoom:a,maxZoom:u,d3Zoom:c,d3Selection:f,fitViewOnInitDone:p,fitViewOnInit:d,nodeOrigin:g}=e(),y=t.initial&&!p&&d;if(c&&f&&(y||!t.initial)){const S=r().filter(b=>{var E;const k=t.includeHiddenNodes?b.width&&b.height:!b.hidden;return(E=t.nodes)!=null&&E.length?k&&t.nodes.some(C=>C.id===b.id):k}),_=S.every(b=>b.width&&b.height);if(S.length>0&&_){const b=mc(S,g),{x:k,y:E,zoom:C}=KC(b,s,o,t.minZoom??a,t.maxZoom??u,t.padding??.1),T=Vr.translate(k,E).scale(C);return typeof t.duration=="number"&&t.duration>0?c.transform(ti(f,t.duration),T):c.transform(f,T),!0}}return!1}function KO(e,t){return e.forEach(r=>{const s=t.get(r.id);s&&t.set(s.id,{...s,[bt]:s[bt],selected:r.selected})}),new Map(t)}function XO(e,t){return t.map(r=>{const s=e.find(o=>o.id===r.id);return s&&(r.selected=s.selected),r})}function Ru({changedNodes:e,changedEdges:t,get:r,set:s}){const{nodeInternals:o,edges:a,onNodesChange:u,onEdgesChange:c,hasDefaultNodes:f,hasDefaultEdges:p}=r();e!=null&&e.length&&(f&&s({nodeInternals:KO(e,o)}),u==null||u(e)),t!=null&&t.length&&(p&&s({edges:XO(t,a)}),c==null||c(t))}const no=()=>{},QO={zoomIn:no,zoomOut:no,zoomTo:no,getZoom:()=>1,setViewport:no,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:no,fitBounds:no,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},ZO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),JO=()=>{const e=Nt(),{d3Zoom:t,d3Selection:r}=it(ZO,It);return N.useMemo(()=>r&&t?{zoomIn:o=>t.scaleBy(ti(r,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(ti(r,o==null?void 0:o.duration),1/1.2),zoomTo:(o,a)=>t.scaleTo(ti(r,a==null?void 0:a.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,a)=>{const[u,c,f]=e.getState().transform,p=Vr.translate(o.x??u,o.y??c).scale(o.zoom??f);t.transform(ti(r,a==null?void 0:a.duration),p)},getViewport:()=>{const[o,a,u]=e.getState().transform;return{x:o,y:a,zoom:u}},fitView:o=>cj(e.getState,o),setCenter:(o,a,u)=>{const{width:c,height:f,maxZoom:p}=e.getState(),d=typeof(u==null?void 0:u.zoom)<"u"?u.zoom:p,g=c/2-o*d,y=f/2-a*d,w=Vr.translate(g,y).scale(d);t.transform(ti(r,u==null?void 0:u.duration),w)},fitBounds:(o,a)=>{const{width:u,height:c,minZoom:f,maxZoom:p}=e.getState(),{x:d,y:g,zoom:y}=KC(o,u,c,f,p,(a==null?void 0:a.padding)??.1),w=Vr.translate(d,g).scale(y);t.transform(ti(r,a==null?void 0:a.duration),w)},project:o=>{const{transform:a,snapToGrid:u,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"),py(o,a,u,c)},screenToFlowPosition:o=>{const{transform:a,snapToGrid:u,snapGrid:c,domNode:f}=e.getState();if(!f)return o;const{x:p,y:d}=f.getBoundingClientRect(),g={x:o.x-p,y:o.y-d};return py(g,a,u,c)},flowToScreenPosition:o=>{const{transform:a,domNode:u}=e.getState();if(!u)return o;const{x:c,y:f}=u.getBoundingClientRect(),p=VC(o,a);return{x:p.x+c,y:p.y+f}},viewportInitialized:!0}:QO,[t,r])};function Ja(){const e=JO(),t=Nt(),r=N.useCallback(()=>t.getState().getNodes().map(_=>({..._})),[]),s=N.useCallback(_=>t.getState().nodeInternals.get(_),[]),o=N.useCallback(()=>{const{edges:_=[]}=t.getState();return _.map(b=>({...b}))},[]),a=N.useCallback(_=>{const{edges:b=[]}=t.getState();return b.find(k=>k.id===_)},[]),u=N.useCallback(_=>{const{getNodes:b,setNodes:k,hasDefaultNodes:E,onNodesChange:C}=t.getState(),T=b(),A=typeof _=="function"?_(T):_;if(E)k(A);else if(C){const L=A.length===0?T.map(P=>({type:"remove",id:P.id})):A.map(P=>({item:P,type:"reset"}));C(L)}},[]),c=N.useCallback(_=>{const{edges:b=[],setEdges:k,hasDefaultEdges:E,onEdgesChange:C}=t.getState(),T=typeof _=="function"?_(b):_;if(E)k(T);else if(C){const A=T.length===0?b.map(L=>({type:"remove",id:L.id})):T.map(L=>({item:L,type:"reset"}));C(A)}},[]),f=N.useCallback(_=>{const b=Array.isArray(_)?_:[_],{getNodes:k,setNodes:E,hasDefaultNodes:C,onNodesChange:T}=t.getState();if(C){const L=[...k(),...b];E(L)}else if(T){const A=b.map(L=>({item:L,type:"add"}));T(A)}},[]),p=N.useCallback(_=>{const b=Array.isArray(_)?_:[_],{edges:k=[],setEdges:E,hasDefaultEdges:C,onEdgesChange:T}=t.getState();if(C)E([...k,...b]);else if(T){const A=b.map(L=>({item:L,type:"add"}));T(A)}},[]),d=N.useCallback(()=>{const{getNodes:_,edges:b=[],transform:k}=t.getState(),[E,C,T]=k;return{nodes:_().map(A=>({...A})),edges:b.map(A=>({...A})),viewport:{x:E,y:C,zoom:T}}},[]),g=N.useCallback(({nodes:_,edges:b})=>{const{nodeInternals:k,getNodes:E,edges:C,hasDefaultNodes:T,hasDefaultEdges:A,onNodesDelete:L,onEdgesDelete:P,onNodesChange:U,onEdgesChange:O}=t.getState(),M=(_||[]).map(G=>G.id),q=(b||[]).map(G=>G.id),V=E().reduce((G,B)=>{const te=B.parentNode||B.parentId,Z=!M.includes(B.id)&&te&&G.find(H=>H.id===te);return(typeof B.deletable=="boolean"?B.deletable:!0)&&(M.includes(B.id)||Z)&&G.push(B),G},[]),X=C.filter(G=>typeof G.deletable=="boolean"?G.deletable:!0),j=X.filter(G=>q.includes(G.id));if(V||j){const G=YC(V,X),B=[...j,...G],te=B.reduce((Z,$)=>(Z.includes($.id)||Z.push($.id),Z),[]);if((A||T)&&(A&&t.setState({edges:C.filter(Z=>!te.includes(Z.id))}),T&&(V.forEach(Z=>{k.delete(Z.id)}),t.setState({nodeInternals:new Map(k)}))),te.length>0&&(P==null||P(B),O&&O(te.map(Z=>({id:Z,type:"remove"})))),V.length>0&&(L==null||L(V),U)){const Z=V.map($=>({id:$.id,type:"remove"}));U(Z)}}},[]),y=N.useCallback(_=>{const b=wO(_),k=b?null:t.getState().nodeInternals.get(_.id);return!b&&!k?[null,null,b]:[b?_:u_(k),k,b]},[]),w=N.useCallback((_,b=!0,k)=>{const[E,C,T]=y(_);return E?(k||t.getState().getNodes()).filter(A=>{if(!T&&(A.id===C.id||!A.positionAbsolute))return!1;const L=u_(A),P=cy(L,E);return b&&P>0||P>=E.width*E.height}):[]},[]),S=N.useCallback((_,b,k=!0)=>{const[E]=y(_);if(!E)return!1;const C=cy(E,b);return k&&C>0||C>=E.width*E.height},[]);return N.useMemo(()=>({...e,getNodes:r,getNode:s,getEdges:o,getEdge:a,setNodes:u,setEdges:c,addNodes:f,addEdges:p,toObject:d,deleteElements:g,getIntersectingNodes:w,isNodeIntersecting:S}),[e,r,s,o,a,u,c,f,p,d,g,w,S])}const eP={actInsideInputWithModifier:!1};var tP=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const r=Nt(),{deleteElements:s}=Ja(),o=Ua(e,eP),a=Ua(t);N.useEffect(()=>{if(o){const{edges:u,getNodes:c}=r.getState(),f=c().filter(d=>d.selected),p=u.filter(d=>d.selected);s({nodes:f,edges:p}),r.setState({nodesSelectionActive:!1})}},[o]),N.useEffect(()=>{r.setState({multiSelectionActive:a})},[a])};function nP(e){const t=Nt();N.useEffect(()=>{let r;const s=()=>{var a,u;if(!e.current)return;const o=zy(e.current);(o.height===0||o.width===0)&&((u=(a=t.getState()).onError)==null||u.call(a,"004",Yr.error004())),t.setState({width:o.width||500,height:o.height||500})};return s(),window.addEventListener("resize",s),e.current&&(r=new ResizeObserver(()=>s()),r.observe(e.current)),()=>{window.removeEventListener("resize",s),r&&e.current&&r.unobserve(e.current)}},[])}const Ky={position:"absolute",width:"100%",height:"100%",top:0,left:0},rP=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Au=e=>({x:e.x,y:e.y,zoom:e.k}),ro=(e,t)=>e.target.closest(`.${t}`),w_=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),x_=e=>{const t=e.ctrlKey&&Ju()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},sP=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),iP=({onMove:e,onMoveStart:t,onMoveEnd:r,onPaneContextMenu:s,zoomOnScroll:o=!0,zoomOnPinch:a=!0,panOnScroll:u=!1,panOnScrollSpeed:c=.5,panOnScrollMode:f=ri.Free,zoomOnDoubleClick:p=!0,elementsSelectable:d,panOnDrag:g=!0,defaultViewport:y,translateExtent:w,minZoom:S,maxZoom:_,zoomActivationKeyCode:b,preventScrolling:k=!0,children:E,noWheelClassName:C,noPanClassName:T})=>{const A=N.useRef(),L=Nt(),P=N.useRef(!1),U=N.useRef(!1),O=N.useRef(null),M=N.useRef({x:0,y:0,zoom:0}),{d3Zoom:q,d3Selection:V,d3ZoomHandler:X,userSelectionActive:j}=it(sP,It),G=Ua(b),B=N.useRef(0),te=N.useRef(!1),Z=N.useRef();return nP(O),N.useEffect(()=>{if(O.current){const $=O.current.getBoundingClientRect(),H=OC().scaleExtent([S,_]).translateExtent(w),I=$n(O.current).call(H),Y=Vr.translate(y.x,y.y).scale(yo(y.zoom,S,_)),ce=[[0,0],[$.width,$.height]],z=H.constrain()(Y,ce,w);H.transform(I,z),H.wheelDelta(x_),L.setState({d3Zoom:H,d3Selection:I,d3ZoomHandler:I.on("wheel.zoom"),transform:[z.x,z.y,z.k],domNode:O.current.closest(".react-flow")})}},[]),N.useEffect(()=>{V&&q&&(u&&!G&&!j?V.on("wheel.zoom",$=>{if(ro($,C))return!1;$.preventDefault(),$.stopImmediatePropagation();const H=V.property("__zoom").k||1;if($.ctrlKey&&a){const fe=nr($),pe=x_($),ye=H*Math.pow(2,pe);q.scaleTo(V,ye,fe,$);return}const I=$.deltaMode===1?20:1;let Y=f===ri.Vertical?0:$.deltaX*I,ce=f===ri.Horizontal?0:$.deltaY*I;!Ju()&&$.shiftKey&&f!==ri.Vertical&&(Y=$.deltaY*I,ce=0),q.translateBy(V,-(Y/H)*c,-(ce/H)*c,{internal:!0});const z=Au(V.property("__zoom")),{onViewportChangeStart:Q,onViewportChange:ne,onViewportChangeEnd:ae}=L.getState();clearTimeout(Z.current),te.current||(te.current=!0,t==null||t($,z),Q==null||Q(z)),te.current&&(e==null||e($,z),ne==null||ne(z),Z.current=setTimeout(()=>{r==null||r($,z),ae==null||ae(z),te.current=!1},150))},{passive:!1}):typeof X<"u"&&V.on("wheel.zoom",function($,H){if(!k&&$.type==="wheel"&&!$.ctrlKey||ro($,C))return null;$.preventDefault(),X.call(this,$,H)},{passive:!1}))},[j,u,f,V,q,X,G,a,k,C,t,e,r]),N.useEffect(()=>{q&&q.on("start",$=>{var Y,ce;if(!$.sourceEvent||$.sourceEvent.internal)return null;B.current=(Y=$.sourceEvent)==null?void 0:Y.button;const{onViewportChangeStart:H}=L.getState(),I=Au($.transform);P.current=!0,M.current=I,((ce=$.sourceEvent)==null?void 0:ce.type)==="mousedown"&&L.setState({paneDragging:!0}),H==null||H(I),t==null||t($.sourceEvent,I)})},[q,t]),N.useEffect(()=>{q&&(j&&!P.current?q.on("zoom",null):j||q.on("zoom",$=>{var I;const{onViewportChange:H}=L.getState();if(L.setState({transform:[$.transform.x,$.transform.y,$.transform.k]}),U.current=!!(s&&w_(g,B.current??0)),(e||H)&&!((I=$.sourceEvent)!=null&&I.internal)){const Y=Au($.transform);H==null||H(Y),e==null||e($.sourceEvent,Y)}}))},[j,q,e,g,s]),N.useEffect(()=>{q&&q.on("end",$=>{if(!$.sourceEvent||$.sourceEvent.internal)return null;const{onViewportChangeEnd:H}=L.getState();if(P.current=!1,L.setState({paneDragging:!1}),s&&w_(g,B.current??0)&&!U.current&&s($.sourceEvent),U.current=!1,(r||H)&&rP(M.current,$.transform)){const I=Au($.transform);M.current=I,clearTimeout(A.current),A.current=setTimeout(()=>{H==null||H(I),r==null||r($.sourceEvent,I)},u?150:0)}})},[q,u,g,r,s]),N.useEffect(()=>{q&&q.filter($=>{const H=G||o,I=a&&$.ctrlKey;if((g===!0||Array.isArray(g)&&g.includes(1))&&$.button===1&&$.type==="mousedown"&&(ro($,"react-flow__node")||ro($,"react-flow__edge")))return!0;if(!g&&!H&&!u&&!p&&!a||j||!p&&$.type==="dblclick"||ro($,C)&&$.type==="wheel"||ro($,T)&&($.type!=="wheel"||u&&$.type==="wheel"&&!G)||!a&&$.ctrlKey&&$.type==="wheel"||!H&&!u&&!I&&$.type==="wheel"||!g&&($.type==="mousedown"||$.type==="touchstart")||Array.isArray(g)&&!g.includes($.button)&&$.type==="mousedown")return!1;const Y=Array.isArray(g)&&g.includes($.button)||!$.button||$.button<=1;return(!$.ctrlKey||$.type==="wheel")&&Y})},[j,q,o,a,u,p,g,d,G]),ue.createElement("div",{className:"react-flow__renderer",ref:O,style:Ky},E)},oP=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function aP(){const{userSelectionActive:e,userSelectionRect:t}=it(oP,It);return e&&t?ue.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function __(e,t){const r=t.parentNode||t.parentId,s=e.find(o=>o.id===r);if(s){const o=t.position.x+t.width-s.width,a=t.position.y+t.height-s.height;if(o>0||a>0||t.position.x<0||t.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),a>0&&(s.style.height+=a),t.position.x<0){const u=Math.abs(t.position.x);s.position.x=s.position.x-u,s.style.width+=u,t.position.x=0}if(t.position.y<0){const u=Math.abs(t.position.y);s.position.y=s.position.y-u,s.style.height+=u,t.position.y=0}s.width=s.style.width,s.height=s.style.height}}}function lP(e,t){if(e.some(s=>s.type==="reset"))return e.filter(s=>s.type==="reset").map(s=>s.item);const r=e.filter(s=>s.type==="add").map(s=>s.item);return t.reduce((s,o)=>{const a=e.filter(c=>c.id===o.id);if(a.length===0)return s.push(o),s;const u={...o};for(const c of a)if(c)switch(c.type){case"select":{u.selected=c.selected;break}case"position":{typeof c.position<"u"&&(u.position=c.position),typeof c.positionAbsolute<"u"&&(u.positionAbsolute=c.positionAbsolute),typeof c.dragging<"u"&&(u.dragging=c.dragging),u.expandParent&&__(s,u);break}case"dimensions":{typeof c.dimensions<"u"&&(u.width=c.dimensions.width,u.height=c.dimensions.height),typeof c.updateStyle<"u"&&(u.style={...u.style||{},...c.dimensions}),typeof c.resizing=="boolean"&&(u.resizing=c.resizing),u.expandParent&&__(s,u);break}case"remove":return s}return s.push(u),s},r)}function uP(e,t){return lP(e,t)}const Ss=(e,t)=>({id:e,type:"select",selected:t});function lo(e,t){return e.reduce((r,s)=>{const o=t.includes(s.id);return!s.selected&&o?(s.selected=!0,r.push(Ss(s.id,!0))):s.selected&&!o&&(s.selected=!1,r.push(Ss(s.id,!1))),r},[])}const Ef=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},cP=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),dj=N.memo(({isSelecting:e,selectionMode:t=Ba.Full,panOnDrag:r,onSelectionStart:s,onSelectionEnd:o,onPaneClick:a,onPaneContextMenu:u,onPaneScroll:c,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:d,children:g})=>{const y=N.useRef(null),w=Nt(),S=N.useRef(0),_=N.useRef(0),b=N.useRef(),{userSelectionActive:k,elementsSelectable:E,dragging:C}=it(cP,It),T=()=>{w.setState({userSelectionActive:!1,userSelectionRect:null}),S.current=0,_.current=0},A=X=>{a==null||a(X),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},L=X=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){X.preventDefault();return}u==null||u(X)},P=c?X=>c(X):void 0,U=X=>{const{resetSelectedElements:j,domNode:G}=w.getState();if(b.current=G==null?void 0:G.getBoundingClientRect(),!E||!e||X.button!==0||X.target!==y.current||!b.current)return;const{x:B,y:te}=Ns(X,b.current);j(),w.setState({userSelectionRect:{width:0,height:0,startX:B,startY:te,x:B,y:te}}),s==null||s(X)},O=X=>{const{userSelectionRect:j,nodeInternals:G,edges:B,transform:te,onNodesChange:Z,onEdgesChange:$,nodeOrigin:H,getNodes:I}=w.getState();if(!e||!b.current||!j)return;w.setState({userSelectionActive:!0,nodesSelectionActive:!1});const Y=Ns(X,b.current),ce=j.startX??0,z=j.startY??0,Q={...j,x:Y.x<ce?Y.x:ce,y:Y.y<z?Y.y:z,width:Math.abs(Y.x-ce),height:Math.abs(Y.y-z)},ne=I(),ae=GC(G,Q,te,t===Ba.Partial,!0,H),fe=YC(ae,B).map(ye=>ye.id),pe=ae.map(ye=>ye.id);if(S.current!==pe.length){S.current=pe.length;const ye=lo(ne,pe);ye.length&&(Z==null||Z(ye))}if(_.current!==fe.length){_.current=fe.length;const ye=lo(B,fe);ye.length&&($==null||$(ye))}w.setState({userSelectionRect:Q})},M=X=>{if(X.button!==0)return;const{userSelectionRect:j}=w.getState();!k&&j&&X.target===y.current&&(A==null||A(X)),w.setState({nodesSelectionActive:S.current>0}),T(),o==null||o(X)},q=X=>{k&&(w.setState({nodesSelectionActive:S.current>0}),o==null||o(X)),T()},V=E&&(e||k);return ue.createElement("div",{className:zt(["react-flow__pane",{dragging:C,selection:e}]),onClick:V?void 0:Ef(A,y),onContextMenu:Ef(L,y),onWheel:Ef(P,y),onMouseEnter:V?void 0:f,onMouseDown:V?U:void 0,onMouseMove:V?O:p,onMouseUp:V?M:void 0,onMouseLeave:V?q:d,ref:y,style:Ky},g,ue.createElement(aP,null))});dj.displayName="Pane";function fj(e,t){const r=e.parentNode||e.parentId;if(!r)return!1;const s=t.get(r);return s?s.selected?!0:fj(s,t):!1}function b_(e,t,r){let s=e;do{if(s!=null&&s.matches(t))return!0;if(s===r.current)return!1;s=s.parentElement}while(s);return!1}function dP(e,t,r,s){return Array.from(e.values()).filter(o=>(o.selected||o.id===s)&&(!o.parentNode||o.parentId||!fj(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var a,u;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:r.x-(((a=o.positionAbsolute)==null?void 0:a.x)??0),y:r.y-(((u=o.positionAbsolute)==null?void 0:u.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 fP(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function hj(e,t,r,s,o=[0,0],a){const u=fP(e,e.extent||s);let c=u;const f=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(f&&e.width&&e.height){const g=r.get(f),{x:y,y:w}=ii(g,o).positionAbsolute;c=g&&qn(y)&&qn(w)&&qn(g.width)&&qn(g.height)?[[y+e.width*o[0],w+e.height*o[1]],[y+g.width-e.width+e.width*o[0],w+g.height-e.height+e.height*o[1]]]:c}else a==null||a("005",Yr.error005()),c=u;else if(e.extent&&f&&e.extent!=="parent"){const g=r.get(f),{x:y,y:w}=ii(g,o).positionAbsolute;c=[[e.extent[0][0]+y,e.extent[0][1]+w],[e.extent[1][0]+y,e.extent[1][1]+w]]}let p={x:0,y:0};if(f){const g=r.get(f);p=ii(g,o).positionAbsolute}const d=c&&c!=="parent"?By(t,c):t;return{position:{x:d.x-p.x,y:d.y-p.y},positionAbsolute:d}}function Nf({nodeId:e,dragItems:t,nodeInternals:r}){const s=t.map(o=>({...r.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?s.find(o=>o.id===e):s[0],s]}const k_=(e,t,r,s)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const a=Array.from(o),u=t.getBoundingClientRect(),c={x:u.width*s[0],y:u.height*s[1]};return a.map(f=>{const p=f.getBoundingClientRect();return{id:f.getAttribute("data-handleid"),position:f.getAttribute("data-handlepos"),x:(p.left-u.left-c.x)/r,y:(p.top-u.top-c.y)/r,...zy(f)}})};function Na(e,t,r){return r===void 0?r:s=>{const o=t().nodeInternals.get(e);o&&r(s,{...o})}}function gy({id:e,store:t,unselect:r=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:u,nodeInternals:c,onError:f}=t.getState(),p=c.get(e);if(!p){f==null||f("012",Yr.error012(e));return}t.setState({nodesSelectionActive:!1}),p.selected?(r||p.selected&&u)&&(a({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var d;return(d=s==null?void 0:s.current)==null?void 0:d.blur()})):o([e])}function hP(){const e=Nt();return N.useCallback(({sourceEvent:r})=>{const{transform:s,snapGrid:o,snapToGrid:a}=e.getState(),u=r.touches?r.touches[0].clientX:r.clientX,c=r.touches?r.touches[0].clientY:r.clientY,f={x:(u-s[0])/s[2],y:(c-s[1])/s[2]};return{xSnapped:a?o[0]*Math.round(f.x/o[0]):f.x,ySnapped:a?o[1]*Math.round(f.y/o[1]):f.y,...f}},[])}function Cf(e){return(t,r,s)=>e==null?void 0:e(t,s)}function pj({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:s,nodeId:o,isSelectable:a,selectNodesOnDrag:u}){const c=Nt(),[f,p]=N.useState(!1),d=N.useRef([]),g=N.useRef({x:null,y:null}),y=N.useRef(0),w=N.useRef(null),S=N.useRef({x:0,y:0}),_=N.useRef(null),b=N.useRef(!1),k=N.useRef(!1),E=N.useRef(!1),C=hP();return N.useEffect(()=>{if(e!=null&&e.current){const T=$n(e.current),A=({x:U,y:O})=>{const{nodeInternals:M,onNodeDrag:q,onSelectionDrag:V,updateNodePositions:X,nodeExtent:j,snapGrid:G,snapToGrid:B,nodeOrigin:te,onError:Z}=c.getState();g.current={x:U,y:O};let $=!1,H={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&j){const Y=mc(d.current,te);H=za(Y)}if(d.current=d.current.map(Y=>{const ce={x:U-Y.distance.x,y:O-Y.distance.y};B&&(ce.x=G[0]*Math.round(ce.x/G[0]),ce.y=G[1]*Math.round(ce.y/G[1]));const z=[[j[0][0],j[0][1]],[j[1][0],j[1][1]]];d.current.length>1&&j&&!Y.extent&&(z[0][0]=Y.positionAbsolute.x-H.x+j[0][0],z[1][0]=Y.positionAbsolute.x+(Y.width??0)-H.x2+j[1][0],z[0][1]=Y.positionAbsolute.y-H.y+j[0][1],z[1][1]=Y.positionAbsolute.y+(Y.height??0)-H.y2+j[1][1]);const Q=hj(Y,ce,M,z,te,Z);return $=$||Y.position.x!==Q.position.x||Y.position.y!==Q.position.y,Y.position=Q.position,Y.positionAbsolute=Q.positionAbsolute,Y}),!$)return;X(d.current,!0,!0),p(!0);const I=o?q:Cf(V);if(I&&_.current){const[Y,ce]=Nf({nodeId:o,dragItems:d.current,nodeInternals:M});I(_.current,Y,ce)}},L=()=>{if(!w.current)return;const[U,O]=LC(S.current,w.current);if(U!==0||O!==0){const{transform:M,panBy:q}=c.getState();g.current.x=(g.current.x??0)-U/M[2],g.current.y=(g.current.y??0)-O/M[2],q({x:U,y:O})&&A(g.current)}y.current=requestAnimationFrame(L)},P=U=>{var te;const{nodeInternals:O,multiSelectionActive:M,nodesDraggable:q,unselectNodesAndEdges:V,onNodeDragStart:X,onSelectionDragStart:j}=c.getState();k.current=!0;const G=o?X:Cf(j);(!u||!a)&&!M&&o&&((te=O.get(o))!=null&&te.selected||V()),o&&a&&u&&gy({id:o,store:c,nodeRef:e});const B=C(U);if(g.current=B,d.current=dP(O,q,B,o),G&&d.current){const[Z,$]=Nf({nodeId:o,dragItems:d.current,nodeInternals:O});G(U.sourceEvent,Z,$)}};if(t)T.on(".drag",null);else{const U=bI().on("start",O=>{const{domNode:M,nodeDragThreshold:q}=c.getState();q===0&&P(O),E.current=!1;const V=C(O);g.current=V,w.current=(M==null?void 0:M.getBoundingClientRect())||null,S.current=Ns(O.sourceEvent,w.current)}).on("drag",O=>{var X,j;const M=C(O),{autoPanOnNodeDrag:q,nodeDragThreshold:V}=c.getState();if(O.sourceEvent.type==="touchmove"&&O.sourceEvent.touches.length>1&&(E.current=!0),!E.current){if(!b.current&&k.current&&q&&(b.current=!0,L()),!k.current){const G=M.xSnapped-(((X=g==null?void 0:g.current)==null?void 0:X.x)??0),B=M.ySnapped-(((j=g==null?void 0:g.current)==null?void 0:j.y)??0);Math.sqrt(G*G+B*B)>V&&P(O)}(g.current.x!==M.xSnapped||g.current.y!==M.ySnapped)&&d.current&&k.current&&(_.current=O.sourceEvent,S.current=Ns(O.sourceEvent,w.current),A(M))}}).on("end",O=>{if(!(!k.current||E.current)&&(p(!1),b.current=!1,k.current=!1,cancelAnimationFrame(y.current),d.current)){const{updateNodePositions:M,nodeInternals:q,onNodeDragStop:V,onSelectionDragStop:X}=c.getState(),j=o?V:Cf(X);if(M(d.current,!1,!1),j){const[G,B]=Nf({nodeId:o,dragItems:d.current,nodeInternals:q});j(O.sourceEvent,G,B)}}}).filter(O=>{const M=O.target;return!O.button&&(!r||!b_(M,`.${r}`,e))&&(!s||b_(M,s,e))});return T.call(U),()=>{T.on(".drag",null)}}}},[e,t,r,s,a,c,o,u,C]),f}function mj(){const e=Nt();return N.useCallback(r=>{const{nodeInternals:s,nodeExtent:o,updateNodePositions:a,getNodes:u,snapToGrid:c,snapGrid:f,onError:p,nodesDraggable:d}=e.getState(),g=u().filter(E=>E.selected&&(E.draggable||d&&typeof E.draggable>"u")),y=c?f[0]:5,w=c?f[1]:5,S=r.isShiftPressed?4:1,_=r.x*y*S,b=r.y*w*S,k=g.map(E=>{if(E.positionAbsolute){const C={x:E.positionAbsolute.x+_,y:E.positionAbsolute.y+b};c&&(C.x=f[0]*Math.round(C.x/f[0]),C.y=f[1]*Math.round(C.y/f[1]));const{positionAbsolute:T,position:A}=hj(E,C,s,o,void 0,p);E.position=A,E.positionAbsolute=T}return E});a(k,!0,!1)},[])}const ho={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Ca=e=>{const t=({id:r,type:s,data:o,xPos:a,yPos:u,xPosOrigin:c,yPosOrigin:f,selected:p,onClick:d,onMouseEnter:g,onMouseMove:y,onMouseLeave:w,onContextMenu:S,onDoubleClick:_,style:b,className:k,isDraggable:E,isSelectable:C,isConnectable:T,isFocusable:A,selectNodesOnDrag:L,sourcePosition:P,targetPosition:U,hidden:O,resizeObserver:M,dragHandle:q,zIndex:V,isParent:X,noDragClassName:j,noPanClassName:G,initialized:B,disableKeyboardA11y:te,ariaLabel:Z,rfId:$,hasHandleBounds:H})=>{const I=Nt(),Y=N.useRef(null),ce=N.useRef(null),z=N.useRef(P),Q=N.useRef(U),ne=N.useRef(s),ae=C||E||d||g||y||w,fe=mj(),pe=Na(r,I.getState,g),ye=Na(r,I.getState,y),Me=Na(r,I.getState,w),Ue=Na(r,I.getState,S),ze=Na(r,I.getState,_),Ie=we=>{const{nodeDragThreshold:xe}=I.getState();if(C&&(!L||!E||xe>0)&&gy({id:r,store:I,nodeRef:Y}),d){const Ye=I.getState().nodeInternals.get(r);Ye&&d(we,{...Ye})}},ke=we=>{if(!dy(we)&&!te)if(FC.includes(we.key)&&C){const xe=we.key==="Escape";gy({id:r,store:I,unselect:xe,nodeRef:Y})}else E&&p&&Object.prototype.hasOwnProperty.call(ho,we.key)&&(I.setState({ariaLiveMessage:`Moved selected node ${we.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~u}`}),fe({x:ho[we.key].x,y:ho[we.key].y,isShiftPressed:we.shiftKey}))};N.useEffect(()=>()=>{ce.current&&(M==null||M.unobserve(ce.current),ce.current=null)},[]),N.useEffect(()=>{if(Y.current&&!O){const we=Y.current;(!B||!H||ce.current!==we)&&(ce.current&&(M==null||M.unobserve(ce.current)),M==null||M.observe(we),ce.current=we)}},[O,B,H]),N.useEffect(()=>{const we=ne.current!==s,xe=z.current!==P,Ye=Q.current!==U;Y.current&&(we||xe||Ye)&&(we&&(ne.current=s),xe&&(z.current=P),Ye&&(Q.current=U),I.getState().updateNodeDimensions([{id:r,nodeElement:Y.current,forceUpdate:!0}]))},[r,s,P,U]);const le=pj({nodeRef:Y,disabled:O||!E,noDragClassName:j,handleSelector:q,nodeId:r,isSelectable:C,selectNodesOnDrag:L});return O?null:ue.createElement("div",{className:zt(["react-flow__node",`react-flow__node-${s}`,{[G]:E},k,{selected:p,selectable:C,parent:X,dragging:le}]),ref:Y,style:{zIndex:V,transform:`translate(${c}px,${f}px)`,pointerEvents:ae?"all":"none",visibility:B?"visible":"hidden",...b},"data-id":r,"data-testid":`rf__node-${r}`,onMouseEnter:pe,onMouseMove:ye,onMouseLeave:Me,onContextMenu:Ue,onClick:Ie,onDoubleClick:ze,onKeyDown:A?ke:void 0,tabIndex:A?0:void 0,role:A?"button":void 0,"aria-describedby":te?void 0:`${oj}-${$}`,"aria-label":Z},ue.createElement(NO,{value:r},ue.createElement(e,{id:r,data:o,type:s,xPos:a,yPos:u,selected:p,isConnectable:T,sourcePosition:P,targetPosition:U,dragging:le,dragHandle:q,zIndex:V})))};return t.displayName="NodeWrapper",N.memo(t)};const pP=e=>{const t=e.getNodes().filter(r=>r.selected);return{...mc(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function mP({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const s=Nt(),{width:o,height:a,x:u,y:c,transformString:f,userSelectionActive:p}=it(pP,It),d=mj(),g=N.useRef(null);if(N.useEffect(()=>{var S;r||(S=g.current)==null||S.focus({preventScroll:!0})},[r]),pj({nodeRef:g}),p||!o||!a)return null;const y=e?S=>{const _=s.getState().getNodes().filter(b=>b.selected);e(S,_)}:void 0,w=S=>{Object.prototype.hasOwnProperty.call(ho,S.key)&&d({x:ho[S.key].x,y:ho[S.key].y,isShiftPressed:S.shiftKey})};return ue.createElement("div",{className:zt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:f}},ue.createElement("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:r?void 0:-1,onKeyDown:r?void 0:w,style:{width:o,height:a,top:c,left:u}}))}var gP=N.memo(mP);const vP=e=>e.nodesSelectionActive,gj=({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:u,deleteKeyCode:c,onMove:f,onMoveStart:p,onMoveEnd:d,selectionKeyCode:g,selectionOnDrag:y,selectionMode:w,onSelectionStart:S,onSelectionEnd:_,multiSelectionKeyCode:b,panActivationKeyCode:k,zoomActivationKeyCode:E,elementsSelectable:C,zoomOnScroll:T,zoomOnPinch:A,panOnScroll:L,panOnScrollSpeed:P,panOnScrollMode:U,zoomOnDoubleClick:O,panOnDrag:M,defaultViewport:q,translateExtent:V,minZoom:X,maxZoom:j,preventScrolling:G,onSelectionContextMenu:B,noWheelClassName:te,noPanClassName:Z,disableKeyboardA11y:$})=>{const H=it(vP),I=Ua(g),Y=Ua(k),ce=Y||M,z=Y||L,Q=I||y&&ce!==!0;return tP({deleteKeyCode:c,multiSelectionKeyCode:b}),ue.createElement(iP,{onMove:f,onMoveStart:p,onMoveEnd:d,onPaneContextMenu:a,elementsSelectable:C,zoomOnScroll:T,zoomOnPinch:A,panOnScroll:z,panOnScrollSpeed:P,panOnScrollMode:U,zoomOnDoubleClick:O,panOnDrag:!I&&ce,defaultViewport:q,translateExtent:V,minZoom:X,maxZoom:j,zoomActivationKeyCode:E,preventScrolling:G,noWheelClassName:te,noPanClassName:Z},ue.createElement(dj,{onSelectionStart:S,onSelectionEnd:_,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:u,panOnDrag:ce,isSelecting:!!Q,selectionMode:w},e,H&&ue.createElement(gP,{onSelectionContextMenu:B,noPanClassName:Z,disableKeyboardA11y:$})))};gj.displayName="FlowRenderer";var yP=N.memo(gj);function wP(e){return it(N.useCallback(r=>e?GC(r.nodeInternals,{x:0,y:0,width:r.width,height:r.height},r.transform,!0):r.getNodes(),[e]))}function xP(e){const t={input:Ca(e.input||nj),default:Ca(e.default||my),output:Ca(e.output||sj),group:Ca(e.group||Yy)},r={},s=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,a)=>(o[a]=Ca(e[a]||my),o),r);return{...t,...s}}const _P=({x:e,y:t,width:r,height:s,origin:o})=>!r||!s?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-r*o[0],y:t-s*o[1]},bP=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),vj=e=>{const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:s,elementsSelectable:o,updateNodeDimensions:a,onError:u}=it(bP,It),c=wP(e.onlyRenderVisibleElements),f=N.useRef(),p=N.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(g=>{const y=g.map(w=>({id:w.target.getAttribute("data-id"),nodeElement:w.target,forceUpdate:!0}));a(y)});return f.current=d,d},[]);return N.useEffect(()=>()=>{var d;(d=f==null?void 0:f.current)==null||d.disconnect()},[]),ue.createElement("div",{className:"react-flow__nodes",style:Ky},c.map(d=>{var A,L,P;let g=d.type||"default";e.nodeTypes[g]||(u==null||u("003",Yr.error003(g)),g="default");const y=e.nodeTypes[g]||e.nodeTypes.default,w=!!(d.draggable||t&&typeof d.draggable>"u"),S=!!(d.selectable||o&&typeof d.selectable>"u"),_=!!(d.connectable||r&&typeof d.connectable>"u"),b=!!(d.focusable||s&&typeof d.focusable>"u"),k=e.nodeExtent?By(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,E=(k==null?void 0:k.x)??0,C=(k==null?void 0:k.y)??0,T=_P({x:E,y:C,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return ue.createElement(y,{key:d.id,id:d.id,className:d.className,style:d.style,type:g,data:d.data,sourcePosition:d.sourcePosition||Ae.Bottom,targetPosition:d.targetPosition||Ae.Top,hidden:d.hidden,xPos:E,yPos:C,xPosOrigin:T.x,yPosOrigin:T.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!d.selected,isDraggable:w,isSelectable:S,isConnectable:_,isFocusable:b,resizeObserver:p,dragHandle:d.dragHandle,zIndex:((A=d[bt])==null?void 0:A.z)??0,isParent:!!((L=d[bt])!=null&&L.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel,hasHandleBounds:!!((P=d[bt])!=null&&P.handleBounds)})}))};vj.displayName="NodeRenderer";var kP=N.memo(vj);const SP=(e,t,r)=>r===Ae.Left?e-t:r===Ae.Right?e+t:e,EP=(e,t,r)=>r===Ae.Top?e-t:r===Ae.Bottom?e+t:e,S_="react-flow__edgeupdater",E_=({position:e,centerX:t,centerY:r,radius:s=10,onMouseDown:o,onMouseEnter:a,onMouseOut:u,type:c})=>ue.createElement("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:u,className:zt([S_,`${S_}-${c}`]),cx:SP(t,s,e),cy:EP(r,s,e),r:s,stroke:"transparent",fill:"transparent"}),NP=()=>!0;var so=e=>{const t=({id:r,className:s,type:o,data:a,onClick:u,onEdgeDoubleClick:c,selected:f,animated:p,label:d,labelStyle:g,labelShowBg:y,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:_,style:b,source:k,target:E,sourceX:C,sourceY:T,targetX:A,targetY:L,sourcePosition:P,targetPosition:U,elementsSelectable:O,hidden:M,sourceHandleId:q,targetHandleId:V,onContextMenu:X,onMouseEnter:j,onMouseMove:G,onMouseLeave:B,reconnectRadius:te,onReconnect:Z,onReconnectStart:$,onReconnectEnd:H,markerEnd:I,markerStart:Y,rfId:ce,ariaLabel:z,isFocusable:Q,isReconnectable:ne,pathOptions:ae,interactionWidth:fe,disableKeyboardA11y:pe})=>{const ye=N.useRef(null),[Me,Ue]=N.useState(!1),[ze,Ie]=N.useState(!1),ke=Nt(),le=N.useMemo(()=>`url('#${hy(Y,ce)}')`,[Y,ce]),we=N.useMemo(()=>`url('#${hy(I,ce)}')`,[I,ce]);if(M)return null;const xe=$e=>{var lt;const{edges:rt,addSelectedEdges:tt,unselectNodesAndEdges:Ce,multiSelectionActive:kt}=ke.getState(),Ve=rt.find(dn=>dn.id===r);Ve&&(O&&(ke.setState({nodesSelectionActive:!1}),Ve.selected&&kt?(Ce({nodes:[],edges:[Ve]}),(lt=ye.current)==null||lt.blur()):tt([r])),u&&u($e,Ve))},Ye=Ea(r,ke.getState,c),gt=Ea(r,ke.getState,X),ft=Ea(r,ke.getState,j),ot=Ea(r,ke.getState,G),Be=Ea(r,ke.getState,B),et=($e,rt)=>{if($e.button!==0)return;const{edges:tt,isValidConnection:Ce}=ke.getState(),kt=rt?E:k,Ve=(rt?V:q)||null,lt=rt?"target":"source",dn=Ce||NP,wn=rt,xn=tt.find(bn=>bn.id===r);Ie(!0),$==null||$($e,xn,lt);const _n=bn=>{Ie(!1),H==null||H(bn,xn,lt)};ZC({event:$e,handleId:Ve,nodeId:kt,onConnect:bn=>Z==null?void 0:Z(xn,bn),isTarget:wn,getState:ke.getState,setState:ke.setState,isValidConnection:dn,edgeUpdaterType:lt,onReconnectEnd:_n})},Xe=$e=>et($e,!0),wt=$e=>et($e,!1),ee=()=>Ue(!0),Le=()=>Ue(!1),De=!O&&!u,Re=$e=>{var rt;if(!pe&&FC.includes($e.key)&&O){const{unselectNodesAndEdges:tt,addSelectedEdges:Ce,edges:kt}=ke.getState();$e.key==="Escape"?((rt=ye.current)==null||rt.blur(),tt({edges:[kt.find(lt=>lt.id===r)]})):Ce([r])}};return ue.createElement("g",{className:zt(["react-flow__edge",`react-flow__edge-${o}`,s,{selected:f,animated:p,inactive:De,updating:Me}]),onClick:xe,onDoubleClick:Ye,onContextMenu:gt,onMouseEnter:ft,onMouseMove:ot,onMouseLeave:Be,onKeyDown:Q?Re:void 0,tabIndex:Q?0:void 0,role:Q?"button":"img","data-testid":`rf__edge-${r}`,"aria-label":z===null?void 0:z||`Edge from ${k} to ${E}`,"aria-describedby":Q?`${aj}-${ce}`:void 0,ref:ye},!ze&&ue.createElement(e,{id:r,source:k,target:E,selected:f,animated:p,label:d,labelStyle:g,labelShowBg:y,labelBgStyle:w,labelBgPadding:S,labelBgBorderRadius:_,data:a,style:b,sourceX:C,sourceY:T,targetX:A,targetY:L,sourcePosition:P,targetPosition:U,sourceHandleId:q,targetHandleId:V,markerStart:le,markerEnd:we,pathOptions:ae,interactionWidth:fe}),ne&&ue.createElement(ue.Fragment,null,(ne==="source"||ne===!0)&&ue.createElement(E_,{position:P,centerX:C,centerY:T,radius:te,onMouseDown:Xe,onMouseEnter:ee,onMouseOut:Le,type:"source"}),(ne==="target"||ne===!0)&&ue.createElement(E_,{position:U,centerX:A,centerY:L,radius:te,onMouseDown:wt,onMouseEnter:ee,onMouseOut:Le,type:"target"})))};return t.displayName="EdgeWrapper",N.memo(t)};function CP(e){const t={default:so(e.default||tc),straight:so(e.bezier||Wy),step:so(e.step||Hy),smoothstep:so(e.step||pc),simplebezier:so(e.simplebezier||Uy)},r={},s=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,a)=>(o[a]=so(e[a]||tc),o),r);return{...t,...s}}function N_(e,t,r=null){const s=((r==null?void 0:r.x)||0)+t.x,o=((r==null?void 0:r.y)||0)+t.y,a=(r==null?void 0:r.width)||t.width,u=(r==null?void 0:r.height)||t.height;switch(e){case Ae.Top:return{x:s+a/2,y:o};case Ae.Right:return{x:s+a,y:o+u/2};case Ae.Bottom:return{x:s+a/2,y:o+u};case Ae.Left:return{x:s,y:o+u/2}}}function C_(e,t){return e?e.length===1||!t?e[0]:t&&e.find(r=>r.id===t)||null:null}const jP=(e,t,r,s,o,a)=>{const u=N_(r,e,t),c=N_(a,s,o);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y}};function TP({sourcePos:e,targetPos:t,sourceWidth:r,sourceHeight:s,targetWidth:o,targetHeight:a,width:u,height:c,transform:f}){const p={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+r,t.x+o),y2:Math.max(e.y+s,t.y+a)};p.x===p.x2&&(p.x2+=1),p.y===p.y2&&(p.y2+=1);const d=za({x:(0-f[0])/f[2],y:(0-f[1])/f[2],width:u/f[2],height:c/f[2]}),g=Math.max(0,Math.min(d.x2,p.x2)-Math.max(d.x,p.x)),y=Math.max(0,Math.min(d.y2,p.y2)-Math.max(d.y,p.y));return Math.ceil(g*y)>0}function j_(e){var s,o,a,u,c;const t=((s=e==null?void 0:e[bt])==null?void 0:s.handleBounds)||null,r=t&&(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((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)<"u";return[{x:((u=e==null?void 0:e.positionAbsolute)==null?void 0:u.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},t,!!r]}const RP=[{level:0,isMaxLevel:!0,edges:[]}];function AP(e,t,r=!1){let s=-1;const o=e.reduce((u,c)=>{var d,g;const f=qn(c.zIndex);let p=f?c.zIndex:0;if(r){const y=t.get(c.target),w=t.get(c.source),S=c.selected||(y==null?void 0:y.selected)||(w==null?void 0:w.selected),_=Math.max(((d=w==null?void 0:w[bt])==null?void 0:d.z)||0,((g=y==null?void 0:y[bt])==null?void 0:g.z)||0,1e3);p=(f?c.zIndex:0)+(S?_:0)}return u[p]?u[p].push(c):u[p]=[c],s=p>s?p:s,u},{}),a=Object.entries(o).map(([u,c])=>{const f=+u;return{edges:c,level:f,isMaxLevel:f===s}});return a.length===0?RP:a}function IP(e,t,r){const s=it(N.useCallback(o=>e?o.edges.filter(a=>{const u=t.get(a.source),c=t.get(a.target);return(u==null?void 0:u.width)&&(u==null?void 0:u.height)&&(c==null?void 0:c.width)&&(c==null?void 0:c.height)&&TP({sourcePos:u.positionAbsolute||{x:0,y:0},targetPos:c.positionAbsolute||{x:0,y:0},sourceWidth:u.width,sourceHeight:u.height,targetWidth:c.width,targetHeight:c.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return AP(s,t,r)}const MP=({color:e="none",strokeWidth:t=1})=>ue.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),OP=({color:e="none",strokeWidth:t=1})=>ue.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),T_={[ec.Arrow]:MP,[ec.ArrowClosed]:OP};function PP(e){const t=Nt();return N.useMemo(()=>{var o,a;return Object.prototype.hasOwnProperty.call(T_,e)?T_[e]:((a=(o=t.getState()).onError)==null||a.call(o,"009",Yr.error009(e)),null)},[e])}const LP=({id:e,type:t,color:r,width:s=12.5,height:o=12.5,markerUnits:a="strokeWidth",strokeWidth:u,orient:c="auto-start-reverse"})=>{const f=PP(t);return f?ue.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:c,refX:"0",refY:"0"},ue.createElement(f,{color:r,strokeWidth:u})):null},$P=({defaultColor:e,rfId:t})=>r=>{const s=[];return r.edges.reduce((o,a)=>([a.markerStart,a.markerEnd].forEach(u=>{if(u&&typeof u=="object"){const c=hy(u,t);s.includes(c)||(o.push({id:c,color:u.color||e,...u}),s.push(c))}}),o),[]).sort((o,a)=>o.id.localeCompare(a.id))},yj=({defaultColor:e,rfId:t})=>{const r=it(N.useCallback($P({defaultColor:e,rfId:t}),[e,t]),(s,o)=>!(s.length!==o.length||s.some((a,u)=>a.id!==o[u].id)));return ue.createElement("defs",null,r.map(s=>ue.createElement(LP,{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})))};yj.displayName="MarkerDefinitions";var qP=N.memo(yj);const DP=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}),wj=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:r,rfId:s,edgeTypes:o,noPanClassName:a,onEdgeContextMenu:u,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:p,onEdgeClick:d,onEdgeDoubleClick:g,onReconnect:y,onReconnectStart:w,onReconnectEnd:S,reconnectRadius:_,children:b,disableKeyboardA11y:k})=>{const{edgesFocusable:E,edgesUpdatable:C,elementsSelectable:T,width:A,height:L,connectionMode:P,nodeInternals:U,onError:O}=it(DP,It),M=IP(t,U,r);return A?ue.createElement(ue.Fragment,null,M.map(({level:q,edges:V,isMaxLevel:X})=>ue.createElement("svg",{key:q,style:{zIndex:q},width:A,height:L,className:"react-flow__edges react-flow__container"},X&&ue.createElement(qP,{defaultColor:e,rfId:s}),ue.createElement("g",null,V.map(j=>{const[G,B,te]=j_(U.get(j.source)),[Z,$,H]=j_(U.get(j.target));if(!te||!H)return null;let I=j.type||"default";o[I]||(O==null||O("011",Yr.error011(I)),I="default");const Y=o[I]||o.default,ce=P===ai.Strict?$.target:($.target??[]).concat($.source??[]),z=C_(B.source,j.sourceHandle),Q=C_(ce,j.targetHandle),ne=(z==null?void 0:z.position)||Ae.Bottom,ae=(Q==null?void 0:Q.position)||Ae.Top,fe=!!(j.focusable||E&&typeof j.focusable>"u"),pe=j.reconnectable||j.updatable,ye=typeof y<"u"&&(pe||C&&typeof pe>"u");if(!z||!Q)return O==null||O("008",Yr.error008(z,j)),null;const{sourceX:Me,sourceY:Ue,targetX:ze,targetY:Ie}=jP(G,z,ne,Z,Q,ae);return ue.createElement(Y,{key:j.id,id:j.id,className:zt([j.className,a]),type:I,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:Me,sourceY:Ue,targetX:ze,targetY:Ie,sourcePosition:ne,targetPosition:ae,elementsSelectable:T,onContextMenu:u,onMouseEnter:c,onMouseMove:f,onMouseLeave:p,onClick:d,onEdgeDoubleClick:g,onReconnect:y,onReconnectStart:w,onReconnectEnd:S,reconnectRadius:_,rfId:s,ariaLabel:j.ariaLabel,isFocusable:fe,isReconnectable:ye,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth,disableKeyboardA11y:k})})))),b):null};wj.displayName="EdgeRenderer";var FP=N.memo(wj);const zP=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function BP({children:e}){const t=it(zP);return ue.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function UP(e){const t=Ja(),r=N.useRef(!1);N.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const HP={[Ae.Left]:Ae.Right,[Ae.Right]:Ae.Left,[Ae.Top]:Ae.Bottom,[Ae.Bottom]:Ae.Top},xj=({nodeId:e,handleType:t,style:r,type:s=Es.Bezier,CustomComponent:o,connectionStatus:a})=>{var L,P,U;const{fromNode:u,handleId:c,toX:f,toY:p,connectionMode:d}=it(N.useCallback(O=>({fromNode:O.nodeInternals.get(e),handleId:O.connectionHandleId,toX:(O.connectionPosition.x-O.transform[0])/O.transform[2],toY:(O.connectionPosition.y-O.transform[1])/O.transform[2],connectionMode:O.connectionMode}),[e]),It),g=(L=u==null?void 0:u[bt])==null?void 0:L.handleBounds;let y=g==null?void 0:g[t];if(d===ai.Loose&&(y=y||(g==null?void 0:g[t==="source"?"target":"source"])),!u||!y)return null;const w=c?y.find(O=>O.id===c):y[0],S=w?w.x+w.width/2:(u.width??0)/2,_=w?w.y+w.height/2:u.height??0,b=(((P=u.positionAbsolute)==null?void 0:P.x)??0)+S,k=(((U=u.positionAbsolute)==null?void 0:U.y)??0)+_,E=w==null?void 0:w.position,C=E?HP[E]:null;if(!E||!C)return null;if(o)return ue.createElement(o,{connectionLineType:s,connectionLineStyle:r,fromNode:u,fromHandle:w,fromX:b,fromY:k,toX:f,toY:p,fromPosition:E,toPosition:C,connectionStatus:a});let T="";const A={sourceX:b,sourceY:k,sourcePosition:E,targetX:f,targetY:p,targetPosition:C};return s===Es.Bezier?[T]=WC(A):s===Es.Step?[T]=fy({...A,borderRadius:0}):s===Es.SmoothStep?[T]=fy(A):s===Es.SimpleBezier?[T]=HC(A):T=`M${b},${k} ${f},${p}`,ue.createElement("path",{d:T,fill:"none",className:"react-flow__connection-path",style:r})};xj.displayName="ConnectionLine";const WP=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function VP({containerStyle:e,style:t,type:r,component:s}){const{nodeId:o,handleType:a,nodesConnectable:u,width:c,height:f,connectionStatus:p}=it(WP,It);return!(o&&a&&c&&u)?null:ue.createElement("svg",{style:e,width:c,height:f,className:"react-flow__edges react-flow__connectionline react-flow__container"},ue.createElement("g",{className:zt(["react-flow__connection",p])},ue.createElement(xj,{nodeId:o,handleType:a,style:t,type:r,CustomComponent:s,connectionStatus:p})))}function R_(e,t){return N.useRef(null),Nt(),N.useMemo(()=>t(e),[e])}const _j=({nodeTypes:e,edgeTypes:t,onMove:r,onMoveStart:s,onMoveEnd:o,onInit:a,onNodeClick:u,onEdgeClick:c,onNodeDoubleClick:f,onEdgeDoubleClick:p,onNodeMouseEnter:d,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:w,onSelectionContextMenu:S,onSelectionStart:_,onSelectionEnd:b,connectionLineType:k,connectionLineStyle:E,connectionLineComponent:C,connectionLineContainerStyle:T,selectionKeyCode:A,selectionOnDrag:L,selectionMode:P,multiSelectionKeyCode:U,panActivationKeyCode:O,zoomActivationKeyCode:M,deleteKeyCode:q,onlyRenderVisibleElements:V,elementsSelectable:X,selectNodesOnDrag:j,defaultViewport:G,translateExtent:B,minZoom:te,maxZoom:Z,preventScrolling:$,defaultMarkerColor:H,zoomOnScroll:I,zoomOnPinch:Y,panOnScroll:ce,panOnScrollSpeed:z,panOnScrollMode:Q,zoomOnDoubleClick:ne,panOnDrag:ae,onPaneClick:fe,onPaneMouseEnter:pe,onPaneMouseMove:ye,onPaneMouseLeave:Me,onPaneScroll:Ue,onPaneContextMenu:ze,onEdgeContextMenu:Ie,onEdgeMouseEnter:ke,onEdgeMouseMove:le,onEdgeMouseLeave:we,onReconnect:xe,onReconnectStart:Ye,onReconnectEnd:gt,reconnectRadius:ft,noDragClassName:ot,noWheelClassName:Be,noPanClassName:et,elevateEdgesOnSelect:Xe,disableKeyboardA11y:wt,nodeOrigin:ee,nodeExtent:Le,rfId:De})=>{const Re=R_(e,xP),$e=R_(t,CP);return UP(a),ue.createElement(yP,{onPaneClick:fe,onPaneMouseEnter:pe,onPaneMouseMove:ye,onPaneMouseLeave:Me,onPaneContextMenu:ze,onPaneScroll:Ue,deleteKeyCode:q,selectionKeyCode:A,selectionOnDrag:L,selectionMode:P,onSelectionStart:_,onSelectionEnd:b,multiSelectionKeyCode:U,panActivationKeyCode:O,zoomActivationKeyCode:M,elementsSelectable:X,onMove:r,onMoveStart:s,onMoveEnd:o,zoomOnScroll:I,zoomOnPinch:Y,zoomOnDoubleClick:ne,panOnScroll:ce,panOnScrollSpeed:z,panOnScrollMode:Q,panOnDrag:ae,defaultViewport:G,translateExtent:B,minZoom:te,maxZoom:Z,onSelectionContextMenu:S,preventScrolling:$,noDragClassName:ot,noWheelClassName:Be,noPanClassName:et,disableKeyboardA11y:wt},ue.createElement(BP,null,ue.createElement(FP,{edgeTypes:$e,onEdgeClick:c,onEdgeDoubleClick:p,onlyRenderVisibleElements:V,onEdgeContextMenu:Ie,onEdgeMouseEnter:ke,onEdgeMouseMove:le,onEdgeMouseLeave:we,onReconnect:xe,onReconnectStart:Ye,onReconnectEnd:gt,reconnectRadius:ft,defaultMarkerColor:H,noPanClassName:et,elevateEdgesOnSelect:!!Xe,disableKeyboardA11y:wt,rfId:De},ue.createElement(VP,{style:E,type:k,component:C,containerStyle:T})),ue.createElement("div",{className:"react-flow__edgelabel-renderer"}),ue.createElement(kP,{nodeTypes:Re,onNodeClick:u,onNodeDoubleClick:f,onNodeMouseEnter:d,onNodeMouseMove:g,onNodeMouseLeave:y,onNodeContextMenu:w,selectNodesOnDrag:j,onlyRenderVisibleElements:V,noPanClassName:et,noDragClassName:ot,disableKeyboardA11y:wt,nodeOrigin:ee,nodeExtent:Le,rfId:De})))};_j.displayName="GraphView";var GP=N.memo(_j);const vy=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],bs={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:vy,nodeExtent:vy,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:ai.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:xO,isValidConnection:void 0},YP=()=>OA((e,t)=>({...bs,setNodes:r=>{const{nodeInternals:s,nodeOrigin:o,elevateNodesOnSelect:a}=t();e({nodeInternals:Sf(r,s,o,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:r=>{const{defaultEdgeOptions:s={}}=t();e({edges:r.map(o=>({...s,...o}))})},setDefaultNodesAndEdges:(r,s)=>{const o=typeof r<"u",a=typeof s<"u",u=o?Sf(r,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:u,edges:a?s:[],hasDefaultNodes:o,hasDefaultEdges:a})},updateNodeDimensions:r=>{const{onNodesChange:s,nodeInternals:o,fitViewOnInit:a,fitViewOnInitDone:u,fitViewOnInitOptions:c,domNode:f,nodeOrigin:p}=t(),d=f==null?void 0:f.querySelector(".react-flow__viewport");if(!d)return;const g=window.getComputedStyle(d),{m22:y}=new window.DOMMatrixReadOnly(g.transform),w=r.reduce((_,b)=>{const k=o.get(b.id);if(k!=null&&k.hidden)o.set(k.id,{...k,[bt]:{...k[bt],handleBounds:void 0}});else if(k){const E=zy(b.nodeElement);!!(E.width&&E.height&&(k.width!==E.width||k.height!==E.height||b.forceUpdate))&&(o.set(k.id,{...k,[bt]:{...k[bt],handleBounds:{source:k_(".source",b.nodeElement,y,p),target:k_(".target",b.nodeElement,y,p)}},...E}),_.push({id:k.id,type:"dimensions",dimensions:E}))}return _},[]);uj(o,p);const S=u||a&&!u&&cj(t,{initial:!0,...c});e({nodeInternals:new Map(o),fitViewOnInitDone:S}),(w==null?void 0:w.length)>0&&(s==null||s(w))},updateNodePositions:(r,s=!0,o=!1)=>{const{triggerNodeChanges:a}=t(),u=r.map(c=>{const f={id:c.id,type:"position",dragging:o};return s&&(f.positionAbsolute=c.positionAbsolute,f.position=c.position),f});a(u)},triggerNodeChanges:r=>{const{onNodesChange:s,nodeInternals:o,hasDefaultNodes:a,nodeOrigin:u,getNodes:c,elevateNodesOnSelect:f}=t();if(r!=null&&r.length){if(a){const p=uP(r,c()),d=Sf(p,o,u,f);e({nodeInternals:d})}s==null||s(r)}},addSelectedNodes:r=>{const{multiSelectionActive:s,edges:o,getNodes:a}=t();let u,c=null;s?u=r.map(f=>Ss(f,!0)):(u=lo(a(),r),c=lo(o,[])),Ru({changedNodes:u,changedEdges:c,get:t,set:e})},addSelectedEdges:r=>{const{multiSelectionActive:s,edges:o,getNodes:a}=t();let u,c=null;s?u=r.map(f=>Ss(f,!0)):(u=lo(o,r),c=lo(a(),[])),Ru({changedNodes:c,changedEdges:u,get:t,set:e})},unselectNodesAndEdges:({nodes:r,edges:s}={})=>{const{edges:o,getNodes:a}=t(),u=r||a(),c=s||o,f=u.map(d=>(d.selected=!1,Ss(d.id,!1))),p=c.map(d=>Ss(d.id,!1));Ru({changedNodes:f,changedEdges:p,get:t,set:e})},setMinZoom:r=>{const{d3Zoom:s,maxZoom:o}=t();s==null||s.scaleExtent([r,o]),e({minZoom:r})},setMaxZoom:r=>{const{d3Zoom:s,minZoom:o}=t();s==null||s.scaleExtent([o,r]),e({maxZoom:r})},setTranslateExtent:r=>{var s;(s=t().d3Zoom)==null||s.translateExtent(r),e({translateExtent:r})},resetSelectedElements:()=>{const{edges:r,getNodes:s}=t(),a=s().filter(c=>c.selected).map(c=>Ss(c.id,!1)),u=r.filter(c=>c.selected).map(c=>Ss(c.id,!1));Ru({changedNodes:a,changedEdges:u,get:t,set:e})},setNodeExtent:r=>{const{nodeInternals:s}=t();s.forEach(o=>{o.positionAbsolute=By(o.position,r)}),e({nodeExtent:r,nodeInternals:new Map(s)})},panBy:r=>{const{transform:s,width:o,height:a,d3Zoom:u,d3Selection:c,translateExtent:f}=t();if(!u||!c||!r.x&&!r.y)return!1;const p=Vr.translate(s[0]+r.x,s[1]+r.y).scale(s[2]),d=[[0,0],[o,a]],g=u==null?void 0:u.constrain()(p,d,f);return u.transform(c,g),s[0]!==g.x||s[1]!==g.y||s[2]!==g.k},cancelConnection:()=>e({connectionNodeId:bs.connectionNodeId,connectionHandleId:bs.connectionHandleId,connectionHandleType:bs.connectionHandleType,connectionStatus:bs.connectionStatus,connectionStartHandle:bs.connectionStartHandle,connectionEndHandle:bs.connectionEndHandle}),reset:()=>e({...bs})}),Object.is),Xy=({children:e})=>{const t=N.useRef(null);return t.current||(t.current=YP()),ue.createElement(hO,{value:t.current},e)};Xy.displayName="ReactFlowProvider";const bj=({children:e})=>N.useContext(hc)?ue.createElement(ue.Fragment,null,e):ue.createElement(Xy,null,e);bj.displayName="ReactFlowWrapper";const KP={input:nj,default:my,output:sj,group:Yy},XP={default:tc,straight:Wy,step:Hy,smoothstep:pc,simplebezier:Uy},QP=[0,0],ZP=[15,15],JP={x:0,y:0,zoom:1},eL={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},kj=N.forwardRef(({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,className:o,nodeTypes:a=KP,edgeTypes:u=XP,onNodeClick:c,onEdgeClick:f,onInit:p,onMove:d,onMoveStart:g,onMoveEnd:y,onConnect:w,onConnectStart:S,onConnectEnd:_,onClickConnectStart:b,onClickConnectEnd:k,onNodeMouseEnter:E,onNodeMouseMove:C,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:L,onNodeDragStart:P,onNodeDrag:U,onNodeDragStop:O,onNodesDelete:M,onEdgesDelete:q,onSelectionChange:V,onSelectionDragStart:X,onSelectionDrag:j,onSelectionDragStop:G,onSelectionContextMenu:B,onSelectionStart:te,onSelectionEnd:Z,connectionMode:$=ai.Strict,connectionLineType:H=Es.Bezier,connectionLineStyle:I,connectionLineComponent:Y,connectionLineContainerStyle:ce,deleteKeyCode:z="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:ne=!1,selectionMode:ae=Ba.Full,panActivationKeyCode:fe="Space",multiSelectionKeyCode:pe=Ju()?"Meta":"Control",zoomActivationKeyCode:ye=Ju()?"Meta":"Control",snapToGrid:Me=!1,snapGrid:Ue=ZP,onlyRenderVisibleElements:ze=!1,selectNodesOnDrag:Ie=!0,nodesDraggable:ke,nodesConnectable:le,nodesFocusable:we,nodeOrigin:xe=QP,edgesFocusable:Ye,edgesUpdatable:gt,elementsSelectable:ft,defaultViewport:ot=JP,minZoom:Be=.5,maxZoom:et=2,translateExtent:Xe=vy,preventScrolling:wt=!0,nodeExtent:ee,defaultMarkerColor:Le="#b1b1b7",zoomOnScroll:De=!0,zoomOnPinch:Re=!0,panOnScroll:$e=!1,panOnScrollSpeed:rt=.5,panOnScrollMode:tt=ri.Free,zoomOnDoubleClick:Ce=!0,panOnDrag:kt=!0,onPaneClick:Ve,onPaneMouseEnter:lt,onPaneMouseMove:dn,onPaneMouseLeave:wn,onPaneScroll:xn,onPaneContextMenu:_n,children:zn,onEdgeContextMenu:bn,onEdgeDoubleClick:hi,onEdgeMouseEnter:fn,onEdgeMouseMove:pi,onEdgeMouseLeave:mi,onEdgeUpdate:qt,onEdgeUpdateStart:Sr,onEdgeUpdateEnd:Bn,onReconnect:Rs,onReconnectStart:Er,onReconnectEnd:Ao,reconnectRadius:lr=10,edgeUpdaterRadius:Nr=10,onNodesChange:ur,onEdgesChange:As,noDragClassName:gi="nodrag",noWheelClassName:vi="nowheel",noPanClassName:yi="nopan",fitView:kn=!1,fitViewOptions:cr,connectOnClick:wi=!0,attributionPosition:xi,proOptions:Bt,defaultEdgeOptions:Cr,elevateNodesOnSelect:_i=!0,elevateEdgesOnSelect:Zr=!1,disableKeyboardA11y:xt=!1,autoPanOnConnect:Io=!0,autoPanOnNodeDrag:st=!0,connectionRadius:Mo=20,isValidConnection:Is,onError:Sn,style:Un,id:bi,nodeDragThreshold:ki,...jr},Kt)=>{const En=bi||"1";return ue.createElement("div",{...jr,style:{...Un,...eL},ref:Kt,className:zt(["react-flow",o]),"data-testid":"rf__wrapper",id:bi},ue.createElement(bj,null,ue.createElement(GP,{onInit:p,onMove:d,onMoveStart:g,onMoveEnd:y,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:E,onNodeMouseMove:C,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:L,nodeTypes:a,edgeTypes:u,connectionLineType:H,connectionLineStyle:I,connectionLineComponent:Y,connectionLineContainerStyle:ce,selectionKeyCode:Q,selectionOnDrag:ne,selectionMode:ae,deleteKeyCode:z,multiSelectionKeyCode:pe,panActivationKeyCode:fe,zoomActivationKeyCode:ye,onlyRenderVisibleElements:ze,selectNodesOnDrag:Ie,defaultViewport:ot,translateExtent:Xe,minZoom:Be,maxZoom:et,preventScrolling:wt,zoomOnScroll:De,zoomOnPinch:Re,zoomOnDoubleClick:Ce,panOnScroll:$e,panOnScrollSpeed:rt,panOnScrollMode:tt,panOnDrag:kt,onPaneClick:Ve,onPaneMouseEnter:lt,onPaneMouseMove:dn,onPaneMouseLeave:wn,onPaneScroll:xn,onPaneContextMenu:_n,onSelectionContextMenu:B,onSelectionStart:te,onSelectionEnd:Z,onEdgeContextMenu:bn,onEdgeDoubleClick:hi,onEdgeMouseEnter:fn,onEdgeMouseMove:pi,onEdgeMouseLeave:mi,onReconnect:Rs??qt,onReconnectStart:Er??Sr,onReconnectEnd:Ao??Bn,reconnectRadius:lr??Nr,defaultMarkerColor:Le,noDragClassName:gi,noWheelClassName:vi,noPanClassName:yi,elevateEdgesOnSelect:Zr,rfId:En,disableKeyboardA11y:xt,nodeOrigin:xe,nodeExtent:ee}),ue.createElement(UO,{nodes:e,edges:t,defaultNodes:r,defaultEdges:s,onConnect:w,onConnectStart:S,onConnectEnd:_,onClickConnectStart:b,onClickConnectEnd:k,nodesDraggable:ke,nodesConnectable:le,nodesFocusable:we,edgesFocusable:Ye,edgesUpdatable:gt,elementsSelectable:ft,elevateNodesOnSelect:_i,minZoom:Be,maxZoom:et,nodeExtent:ee,onNodesChange:ur,onEdgesChange:As,snapToGrid:Me,snapGrid:Ue,connectionMode:$,translateExtent:Xe,connectOnClick:wi,defaultEdgeOptions:Cr,fitView:kn,fitViewOptions:cr,onNodesDelete:M,onEdgesDelete:q,onNodeDragStart:P,onNodeDrag:U,onNodeDragStop:O,onSelectionDrag:j,onSelectionDragStart:X,onSelectionDragStop:G,noPanClassName:yi,nodeOrigin:xe,rfId:En,autoPanOnConnect:Io,autoPanOnNodeDrag:st,onError:Sn,connectionRadius:Mo,isValidConnection:Is,nodeDragThreshold:ki}),ue.createElement(zO,{onSelectionChange:V}),zn,ue.createElement(mO,{proOptions:Bt,position:xi}),ue.createElement(YO,{rfId:En,disableKeyboardA11y:xt})))});kj.displayName="ReactFlow";const tL=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function Sj(){return it(tL,It)}const Ej=({id:e,x:t,y:r,width:s,height:o,style:a,color:u,strokeColor:c,strokeWidth:f,className:p,borderRadius:d,shapeRendering:g,onClick:y,selected:w})=>{const{background:S,backgroundColor:_}=a||{},b=u||S||_;return ue.createElement("rect",{className:zt(["react-flow__minimap-node",{selected:w},p]),x:t,y:r,rx:d,ry:d,width:s,height:o,fill:b,stroke:c,strokeWidth:f,shapeRendering:g,onClick:y?k=>y(k,e):void 0})};Ej.displayName="MiniMapNode";var nL=N.memo(Ej);const rL=e=>e.nodeOrigin,sL=e=>e.getNodes().filter(t=>!t.hidden&&t.width&&t.height),jf=e=>e instanceof Function?e:()=>e;function iL({nodeStrokeColor:e="transparent",nodeColor:t="#e2e2e2",nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o=2,nodeComponent:a=nL,onClick:u}){const c=it(sL,It),f=it(rL),p=jf(t),d=jf(e),g=jf(r),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ue.createElement(ue.Fragment,null,c.map(w=>{const{x:S,y:_}=ii(w,f).positionAbsolute;return ue.createElement(a,{key:w.id,x:S,y:_,width:w.width,height:w.height,style:w.style,selected:w.selected,className:g(w),color:p(w),borderRadius:s,strokeColor:d(w),strokeWidth:o,shapeRendering:y,onClick:u,id:w.id})}))}var oL=N.memo(iL);const aL=200,lL=150,uL=e=>{const t=e.getNodes(),r={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:r,boundingRect:t.length>0?yO(mc(t,e.nodeOrigin),r):r,rfId:e.rfId}},cL="react-flow__minimap-desc";function Nj({style:e,className:t,nodeStrokeColor:r="transparent",nodeColor:s="#e2e2e2",nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:u=2,nodeComponent:c,maskColor:f="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:d=1,position:g="bottom-right",onClick:y,onNodeClick:w,pannable:S=!1,zoomable:_=!1,ariaLabel:b="React Flow mini map",inversePan:k=!1,zoomStep:E=10,offsetScale:C=5}){const T=Nt(),A=N.useRef(null),{boundingRect:L,viewBB:P,rfId:U}=it(uL,It),O=(e==null?void 0:e.width)??aL,M=(e==null?void 0:e.height)??lL,q=L.width/O,V=L.height/M,X=Math.max(q,V),j=X*O,G=X*M,B=C*X,te=L.x-(j-L.width)/2-B,Z=L.y-(G-L.height)/2-B,$=j+B*2,H=G+B*2,I=`${cL}-${U}`,Y=N.useRef(0);Y.current=X,N.useEffect(()=>{if(A.current){const Q=$n(A.current),ne=pe=>{const{transform:ye,d3Selection:Me,d3Zoom:Ue}=T.getState();if(pe.sourceEvent.type!=="wheel"||!Me||!Ue)return;const ze=-pe.sourceEvent.deltaY*(pe.sourceEvent.deltaMode===1?.05:pe.sourceEvent.deltaMode?1:.002)*E,Ie=ye[2]*Math.pow(2,ze);Ue.scaleTo(Me,Ie)},ae=pe=>{const{transform:ye,d3Selection:Me,d3Zoom:Ue,translateExtent:ze,width:Ie,height:ke}=T.getState();if(pe.sourceEvent.type!=="mousemove"||!Me||!Ue)return;const le=Y.current*Math.max(1,ye[2])*(k?-1:1),we={x:ye[0]-pe.sourceEvent.movementX*le,y:ye[1]-pe.sourceEvent.movementY*le},xe=[[0,0],[Ie,ke]],Ye=Vr.translate(we.x,we.y).scale(ye[2]),gt=Ue.constrain()(Ye,xe,ze);Ue.transform(Me,gt)},fe=OC().on("zoom",S?ae:null).on("zoom.wheel",_?ne:null);return Q.call(fe),()=>{Q.on("zoom",null)}}},[S,_,k,E]);const ce=y?Q=>{const ne=nr(Q);y(Q,{x:ne[0],y:ne[1]})}:void 0,z=w?(Q,ne)=>{const ae=T.getState().nodeInternals.get(ne);w(Q,ae)}:void 0;return ue.createElement(Fy,{position:g,style:e,className:zt(["react-flow__minimap",t]),"data-testid":"rf__minimap"},ue.createElement("svg",{width:O,height:M,viewBox:`${te} ${Z} ${$} ${H}`,role:"img","aria-labelledby":I,ref:A,onClick:ce},b&&ue.createElement("title",{id:I},b),ue.createElement(oL,{onClick:z,nodeColor:s,nodeStrokeColor:r,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:c}),ue.createElement("path",{className:"react-flow__minimap-mask",d:`M${te-B},${Z-B}h${$+B*2}v${H+B*2}h${-$-B*2}z
|
|
57
|
+
M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fill:f,fillRule:"evenodd",stroke:p,strokeWidth:d,pointerEvents:"none"})))}Nj.displayName="MiniMap";var dL=N.memo(Nj);function fL(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ue.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function hL(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ue.createElement("path",{d:"M0 0h32v4.2H0z"}))}function pL(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ue.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 mL(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ue.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 gL(){return ue.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ue.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 xr=({children:e,className:t,...r})=>ue.createElement("button",{type:"button",className:zt(["react-flow__controls-button",t]),...r},e);xr.displayName="ControlButton";const vL=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),Cj=({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:u,onFitView:c,onInteractiveChange:f,className:p,children:d,position:g="bottom-left"})=>{const y=Nt(),[w,S]=N.useState(!1),{isInteractive:_,minZoomReached:b,maxZoomReached:k}=it(vL,It),{zoomIn:E,zoomOut:C,fitView:T}=Ja();if(N.useEffect(()=>{S(!0)},[]),!w)return null;const A=()=>{E(),a==null||a()},L=()=>{C(),u==null||u()},P=()=>{T(o),c==null||c()},U=()=>{y.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),f==null||f(!_)};return ue.createElement(Fy,{className:zt(["react-flow__controls",p]),position:g,style:e,"data-testid":"rf__controls"},t&&ue.createElement(ue.Fragment,null,ue.createElement(xr,{onClick:A,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k},ue.createElement(fL,null)),ue.createElement(xr,{onClick:L,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:b},ue.createElement(hL,null))),r&&ue.createElement(xr,{className:"react-flow__controls-fitview",onClick:P,title:"fit view","aria-label":"fit view"},ue.createElement(pL,null)),s&&ue.createElement(xr,{className:"react-flow__controls-interactive",onClick:U,title:"toggle interactivity","aria-label":"toggle interactivity"},_?ue.createElement(gL,null):ue.createElement(mL,null)),d)};Cj.displayName="Controls";var yL=N.memo(Cj),sr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(sr||(sr={}));function wL({color:e,dimensions:t,lineWidth:r}){return ue.createElement("path",{stroke:e,strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function xL({color:e,radius:t}){return ue.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const _L={[sr.Dots]:"#91919a",[sr.Lines]:"#eee",[sr.Cross]:"#e2e2e2"},bL={[sr.Dots]:1,[sr.Lines]:1,[sr.Cross]:6},kL=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function jj({id:e,variant:t=sr.Dots,gap:r=20,size:s,lineWidth:o=1,offset:a=2,color:u,style:c,className:f}){const p=N.useRef(null),{transform:d,patternId:g}=it(kL,It),y=u||_L[t],w=s||bL[t],S=t===sr.Dots,_=t===sr.Cross,b=Array.isArray(r)?r:[r,r],k=[b[0]*d[2]||1,b[1]*d[2]||1],E=w*d[2],C=_?[E,E]:k,T=S?[E/a,E/a]:[C[0]/a,C[1]/a];return ue.createElement("svg",{className:zt(["react-flow__background",f]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background"},ue.createElement("pattern",{id:g+e,x:d[0]%k[0],y:d[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`},S?ue.createElement(xL,{color:y,radius:E/a}):ue.createElement(wL,{dimensions:C,color:y,lineWidth:o})),ue.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${g+e})`}))}jj.displayName="Background";var SL=N.memo(jj);const EL=["us-gov","global","apac","us","eu","jp","au"],NL=new RegExp(`^(?:(?:${EL.join("|")})\\.)?anthropic\\.`,"i");function gc(e){return e.replace(NL,"")}function Tj(){return{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreateTokens:0}}function Qy(e){const t=e.cache_creation,r=t&&typeof t=="object"?t:e,s=r.ephemeral_1h_input_tokens,o=r.ephemeral_5m_input_tokens;return typeof s!="number"&&typeof o!="number"?{}:{cacheCreate1hTokens:Number(s??0),cacheCreate5mTokens:Number(o??0)}}function CL(e){const t=Qy(e),r={inputTokens:Number(e.input_tokens??0),outputTokens:Number(e.output_tokens??0),cacheReadTokens:Number(e.cache_read_input_tokens??e.cached_input_tokens??0),cacheCreateTokens:Number(e.cache_creation_input_tokens??e.cache_write_input_tokens??0),cacheCreate1hTokens:t.cacheCreate1hTokens,cacheCreate5mTokens:t.cacheCreate5mTokens};return typeof e.reasoning_output_tokens=="number"&&(r.reasoningOutputTokens=Number(e.reasoning_output_tokens)),r}function jL(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t={};for(const[r,s]of Object.entries(e))!r||!s||typeof s!="object"||(t[r]=CL(s));return Object.keys(t).length?t:void 0}function Rj(e,t=0){if(!e||typeof e!="object"||t>6)return null;const r=e;if(typeof r.input_tokens=="number"||typeof r.output_tokens=="number"||typeof r.cache_read_input_tokens=="number"||typeof r.cache_creation_input_tokens=="number")return{inputTokens:Number(r.input_tokens??0),outputTokens:Number(r.output_tokens??0),cacheReadTokens:Number(r.cache_read_input_tokens??0),cacheCreateTokens:Number(r.cache_creation_input_tokens??0),...Qy(r)};for(const s of Object.values(r)){const o=Rj(s,t+1);if(o)return o}return null}const TL=/^(?:claude[-_]|gpt[-_]|o\d|codex[-_])/i;function Aj(e,t=0){if(!e||typeof e!="object"||t>6)return null;const r=e;if(typeof r.model=="string"&&TL.test(gc(r.model)))return r.model;for(const s of Object.values(r)){const o=Aj(s,t+1);if(o)return o}return null}function yy(){return{agents:new Map,toolIndex:new Map,toolOwner:new Map,activeSubagentStack:new Map,lastSeq:0,seqEpoch:null,totalEvents:0,revision:0}}function Cs(e){if(!e)return;const t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t[t.length-1]}function A_(){return{msgsUser:0,msgsAssistant:0,toolUses:0,toolResults:0,systemReminders:0,currentContextTokens:0,memoryFiles:[]}}function el(e,t){return`${e}::${t}`}function nc(e){return e.agent_type??e.subagent_type??"subagent"}function Pa(e){return e.agent_id?e.agent_id:e.parent_tool_use_id?e.parent_tool_use_id:null}function uo(e,t,r,s){const o=t;let a=e.agents.get(o);return a||(a={id:o,sessionId:t,label:"session",kind:"root",state:"active",startedAt:r,lastEventAt:r,tools:[],prompts:[],toolCount:0,childCount:0,synthetic:s,usage:Tj()},e.agents.set(o,a),a)}function Ij(e,t,r,s){const o=el(t,r),a=e.agents.get(o);if(!a)return null;!a.cwd&&s.cwd&&(a.cwd=s.cwd,a.cwdBasename=Cs(s.cwd));const u=nc(s);return u&&(a.label==="subagent"||!a.label)&&(a.label=u),a}function RL(e,t,r){const s=t.session_id??"unknown",o=Pa(t);if(o){const f=Ij(e,s,o,t);if(f)return f}const a=e.activeSubagentStack.get(s),u=a&&a.length>0?a[a.length-1]:null;if(u){const f=e.agents.get(el(s,u));if(f)return!f.cwd&&t.cwd&&(f.cwd=t.cwd,f.cwdBasename=Cs(t.cwd)),f}const c=uo(e,s,r,t.hook_event_name!=="SessionStart");return!c.cwd&&t.cwd&&(c.cwd=t.cwd,c.cwdBasename=Cs(t.cwd)),c.label==="session"&&t.cwd&&(c.label=Cs(t.cwd)??"session"),c}function AL(e,t,r,s,o){const a=el(t,r),u=uo(e,t,o,!0);let c=e.agents.get(a);if(c){!c.cwd&&s.cwd&&(c.cwd=s.cwd,c.cwdBasename=Cs(s.cwd));const f=nc(s);return f&&(c.label==="subagent"||!c.label)&&(c.label=f),c}return c={id:a,sessionId:t,label:nc(s),kind:"subagent",parentId:u.id,state:"active",startedAt:o,tools:[],prompts:[],cwd:s.cwd,cwdBasename:Cs(s.cwd),toolCount:0,childCount:0,usage:Tj()},e.agents.set(a,c),u.childCount+=1,c}function IL(e,t,r){const s=e.activeSubagentStack.get(t)??[];s.includes(r)||(s.push(r),e.activeSubagentStack.set(t,s))}function ML(e,t,r){const s=e.activeSubagentStack.get(t);if(s){for(let o=s.length-1;o>=0;o--)if(s[o]===r){s.splice(o,1);break}s.length===0&&e.activeSubagentStack.delete(t)}}function Iu(e,t=80){if(e==null)return"";if(typeof e=="string")return e.length>t?e.slice(0,t-1)+"…":e;try{const r=JSON.stringify(e);return r.length>t?r.slice(0,t-1)+"…":r}catch{return String(e)}}const I_=200,OL=25;function PL(e,t){const r=t.tools;if(r.length>I_){const s=r.splice(0,r.length-I_);for(const o of s)e.toolIndex.get(o.id)===o&&(e.toolIndex.delete(o.id),e.toolOwner.delete(o.id))}for(let s=r.length-OL-1;s>=0;s--){const o=r[s];if(o.trimmed)break;o.input=void 0,o.response=void 0,o.trimmed=!0}}function LL(e,t,r){const s=e.toolIndex.get(r);if(s)return s;for(let o=t.tools.length-1;o>=0;o--)if(t.tools[o].id===r)return t.tools[o];return null}const M_=2e3;function $L(e,t,r){for(let s=e.prompts.length-1;s>=0;s--){const o=e.prompts[s];if(o.at<t-M_)return!1;if(o.text===r&&o.at<=t+M_)return!0}return!1}function Mj(e,t){for(const r of t.tools)e.toolIndex.get(r.id)===r&&e.toolIndex.delete(r.id),e.toolOwner.get(r.id)===t.id&&e.toolOwner.delete(r.id)}function tl(e,t){return t&&(e.revision+=1),t}function qL(e,t,r,s){if(e.agents.size<=r)return!1;const o=p=>p.state==="done"&&p.endedAt!=null&&t-p.endedAt>s,a=[],u=new Map;for(const[p,d]of e.agents){if(d.parentId!=null){const g=u.get(d.parentId);g?g.push(p):u.set(d.parentId,[p])}o(d)&&a.push({id:p,endedAt:d.endedAt})}if(a.length===0)return!1;a.sort((p,d)=>p.endedAt-d.endedAt);let c=0;const f=p=>{const d=e.agents.get(p);d&&(Mj(e,d),e.agents.delete(p),c++)};for(const p of a){if(e.agents.size<=r)break;if(!e.agents.has(p.id))continue;const d=(u.get(p.id)??[]).map(g=>e.agents.get(g)).filter(g=>g!=null);if(!d.some(g=>!o(g))){for(const g of d)f(g.id);f(p.id)}}return tl(e,c>0)}function DL(e,t,r,s){const o=new Map;for(const[p,d]of e.agents){let g=o.get(d.sessionId);g||(g={ids:[],endedAt:0,live:!1,closed:!1},o.set(d.sessionId,g)),g.ids.push(p),d.kind==="root"&&d.closedAt!=null&&(g.closed=!0),d.state==="done"&&d.endedAt!=null?g.endedAt=Math.max(g.endedAt,d.endedAt):g.live=!0}const a=[...o.values()].filter(p=>!p.live&&p.endedAt>0&&t-p.endedAt>s).sort((p,d)=>p.closed===d.closed?p.endedAt-d.endedAt:p.closed?-1:1);let c=[...o.values()].filter(p=>!p.live).length-r;if(c<=0)return!1;let f=!1;for(const p of a){if(c<=0)break;for(const d of p.ids){const g=e.agents.get(d);g&&Mj(e,g),e.agents.delete(d)}c--,f=!0}return tl(e,f)}function FL(e,t){const r=t==null?void 0:t.payload,s=r==null?void 0:r.hook_event_name;if(s!=="PostToolUse"&&s!=="PostToolUseFailure")return!1;const o=r==null?void 0:r.tool_use_id;return typeof o=="string"&&o.length>0&&e.toolIndex.has(o)}function zL(e){let t=!1;for(const r of e.agents.values())for(const s of r.tools)s.endedAt!=null||s.outcomeGap||(s.outcomeGap=!0,t=!0);return tl(e,t)}function BL(e,t,r){let s=!1;for(const o of e.agents.values()){if(o.provider==="codex")continue;const a=e.agents.get(o.sessionId),u=(a==null?void 0:a.lastEventAt)??(a==null?void 0:a.startedAt);for(const c of o.tools){const f=Math.max(c.startedAt,u??c.startedAt);c.endedAt==null&&t-f>r&&(c.endedAt=f,c.ok=!1,c.errorPreview=c.outcomeGap?"no result reached the deck — events were dropped while the deck was paused":"session ended before this call returned",e.toolIndex.delete(c.id),e.toolOwner.delete(c.id),s=!0)}}return tl(e,s)}const O_=90*6e4;function UL(e,t,r){let s=!1;for(const o of e.agents.values()){if(o.kind!=="root")continue;const a=o.lastEventAt??o.startedAt;if(!(t-a<=r)){o.waiting&&(o.waiting=null,s=!0),o.closedAt==null&&(o.closedAt=a),o.state==="active"&&(o.state="done",o.endedAt=a,o.reaped=!0,s=!0);for(const u of e.agents.values())u.sessionId!==o.sessionId||u.kind==="root"||u.state!=="active"||(u.state="done",u.endedAt=a,s=!0);e.activeSubagentStack.delete(o.sessionId)}}return tl(e,s)}function HL(e){return e==="permission_prompt"?"permission":e==="idle_prompt"?"idle":null}const WL=new Set(["Notification","ModelObserved","ContextObserved","UsageObserved","SessionNamed"]);function VL(e,t){let r=null;for(const s of e.toolIndex.values()){const o=s.agentId?e.agents.get(s.agentId):void 0;!o||o.sessionId!==t||(!r||s.startedAt>r.startedAt)&&(r=s)}return r==null?void 0:r.explicitSubagentId}function GL(e,t,r,s,o){const a=r==="permission"?VL(e,t):void 0;return a?{kind:r,message:s,since:o,subagentId:a}:{kind:r,message:s,since:o}}function YL(e,t,r){if(e.kind!=="permission")return!0;const s=Pa(t);return s==null?!0:e.subagentId!=null&&el(r,s)===e.subagentId}function P_(e,t){const r=t.epoch??null;if(r!==null&&r!==e.seqEpoch)e.seqEpoch=r,e.lastSeq=0;else if(t.seq<=e.lastSeq)return e;const s=t.payload??{},o=t.receivedAt,a=s.hook_event_name??"Unknown";if(a==="__clear")return{...yy(),lastSeq:t.seq,seqEpoch:e.seqEpoch,revision:e.revision+1};e.totalEvents+=1,e.lastSeq=t.seq,e.revision+=1;const u=s.session_id??"unknown";if(!WL.has(a)){const d=e.agents.get(u);d!=null&&d.waiting&&YL(d.waiting,s,u)&&(d.waiting=null)}const c=e.agents.get(u);if(c&&o>(c.lastEventAt??0)&&(c.lastEventAt=o,c.reaped&&(c.reaped=!1,c.state="active",c.endedAt=void 0,c.closedAt=void 0)),typeof s.model_context_window=="number"&&s.model_context_window>0){const d=e.agents.get(u);d&&(d.contextWindow=s.model_context_window)}if(typeof s.approval_policy=="string"&&s.approval_policy){const d=e.agents.get(u);d&&(d.approvalPolicy=s.approval_policy)}if(typeof s.context_tokens=="number"&&s.context_tokens>=0){const d=e.agents.get(u);d&&(d.context={...d.context??A_(),currentContextTokens:s.context_tokens})}if(a==="ModelObserved"){const d=typeof s.model=="string"?s.model:null;if(d){const y=e.agents.get(u);y&&(y.model=d)}const g=s.subagentModels;if(g&&typeof g=="object")for(const[y,w]of Object.entries(g)){if(typeof w!="string")continue;const S=`${u}::${y}`,_=e.agents.get(S);_&&(_.model=w)}return e}if(a==="ContextObserved"){const d=s.context??null;if(d){const g=e.agents.get(u);if(g){const y=g.context??A_(),w=(_,b)=>typeof d[_]=="number"?d[_]:b,S=Array.isArray(d.memoryFiles)?d.memoryFiles:Array.isArray(d.claudeMdFiles)?d.claudeMdFiles:null;g.context={msgsUser:w("msgsUser",y.msgsUser),msgsAssistant:w("msgsAssistant",y.msgsAssistant),toolUses:w("toolUses",y.toolUses),toolResults:w("toolResults",y.toolResults),systemReminders:w("systemReminders",y.systemReminders),currentContextTokens:w("currentContextTokens",y.currentContextTokens),memoryFiles:S??y.memoryFiles}}}return e}if(a==="SessionNamed"){const d=e.agents.get(u);if(d){const g=typeof s.sessionName=="string"?s.sessionName.trim():"",y=typeof s.sessionTitle=="string"?s.sessionTitle.trim():"";g&&(d.sessionName=g),y&&(d.sessionTitle=y);const w=d.sessionName??"";d.sessionTitle&&w&&d.sessionTitle.toLowerCase()===w.toLowerCase()&&(d.sessionTitle=void 0)}return e}if(a==="UsageObserved"){const d=s.usage??null;if(d){const g=e.agents.get(u);if(g){g.usage.inputTokens=Number(d.input_tokens??0),g.usage.outputTokens=Number(d.output_tokens??0),g.usage.cacheReadTokens=Number(d.cache_read_input_tokens??d.cached_input_tokens??0),g.usage.cacheCreateTokens=Number(d.cache_creation_input_tokens??d.cache_write_input_tokens??0);const y=Qy(d);g.usage.cacheCreate1hTokens=y.cacheCreate1hTokens,g.usage.cacheCreate5mTokens=y.cacheCreate5mTokens,typeof d.reasoning_output_tokens=="number"&&(g.usage.reasoningOutputTokens=Number(d.reasoning_output_tokens)),g.usageByModel=jL(s.usageByModel)}}return e}const f=RL(e,s,o);f.provider||(f.provider=s.provider==="codex"?"codex":"claude");const p=Aj(s);switch(p&&(f.model=p),a){case"SessionStart":{const d=uo(e,u,o,!1);d.synthetic=!1,d.state="active",d.closedAt=void 0,d.startedAt=d.startedAt||o,!d.cwd&&s.cwd&&(d.cwd=s.cwd,d.cwdBasename=Cs(s.cwd)),d.label==="session"&&s.cwd&&(d.label=Cs(s.cwd)??"session");break}case"UserPromptSubmit":{for(const y of e.agents.values())y.sessionId===u&&y.kind==="subagent"&&y.state==="done"&&y.exitAt==null&&y.endedAt!=null&&y.endedAt<o&&(y.exitAt=o);const d=uo(e,u,o,!1);d.state="active",d.endedAt=void 0,d.closedAt=void 0,d.exitAt=void 0;const g=(typeof s.prompt=="string"?s.prompt:typeof s.message=="string"?s.message:"")??"";g&&!$L(d,o,g)&&(d.prompts.push({at:o,text:g}),d.firstPrompt||(d.firstPrompt=Iu(g,120)));break}case"PreToolUse":{const d=s.tool_use_id?LL(e,f,s.tool_use_id):null;if(d){s.tool_name&&d.name==="?"&&(d.name=s.tool_name),d.endedAt==null&&!d.trimmed&&s.tool_input!==void 0&&(d.input=s.tool_input,d.inputPreview=Iu(s.tool_input));break}const g=s.tool_use_id??`${f.id}:${f.toolCount}`,y=Pa(s),w={id:g,name:s.tool_name??"?",input:s.tool_input,inputPreview:Iu(s.tool_input),agentId:f.id,explicitSubagentId:y?el(u,y):void 0,startedAt:o};f.tools.push(w),f.toolCount+=1,f.state="active",e.toolIndex.set(g,w),e.toolOwner.set(g,f.id),PL(e,f);break}case"PostToolUse":case"PostToolUseFailure":{const d=s.tool_use_id;if(!d)break;let g=e.toolIndex.get(d),y=!1;if(!g)for(const S of e.agents.values()){const _=S.tools.find(b=>b.id===d);if(_){g=_,y=!0;break}}if(!g||g.outcomeApplied)break;g.outcomeApplied=!0,g.outcomeGap=void 0,g.endedAt=o,g.ok=a==="PostToolUse",g.trimmed||(g.response=s.tool_response),a==="PostToolUseFailure"?g.errorPreview=Iu(s.tool_response):y&&(g.errorPreview=void 0);const w=Rj(s.tool_response);w&&(g.usage=w),e.toolIndex.delete(d),e.toolOwner.delete(d);break}case"SubagentStart":{const d=Pa(s);if(!d)break;const g=AL(e,u,d,s,o);g.state="active",g.startedAt=g.startedAt||o,g.exitAt=void 0,g.endedAt=void 0;const y=nc(s);y&&(g.label=y),IL(e,u,d);break}case"SubagentStop":{const d=Pa(s);if(!d)break;const g=Ij(e,u,d,s);if(!g)break;g.state="done",g.endedAt=o,ML(e,u,d);break}case"Stop":case"SessionEnd":{const d=uo(e,u,o,!1);d.state="done",d.endedAt=o,a==="SessionEnd"&&(d.closedAt=o),e.activeSubagentStack.delete(u);break}case"Notification":{const d=HL(s.notification_type);if(!d)break;const g=uo(e,u,o,!1),y=typeof s.message=="string"?s.message:"",w=g.waiting;g.waiting=w&&w.kind===d&&w.message===y?{...w,since:Math.min(w.since,o)}:GL(e,u,d,y,o);break}}return e}function Zy(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t^e.charCodeAt(r);return Math.abs(t)%360}const KL=Date.UTC(2026,8,1);function XL(e){return e<KL?{input:2,output:10,cacheRead:.2,cacheWrite:2.5,cacheWrite1h:4}:{input:3,output:15,cacheRead:.3,cacheWrite:3.75,cacheWrite1h:6}}const QL=[{match:/^claude[-_](fable|mythos)[-_]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:10,output:50,cacheRead:1,cacheWrite:12.5,cacheWrite1h:20}},{match:/^claude[-_]opus[-_]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:5,output:25,cacheRead:.5,cacheWrite:6.25,cacheWrite1h:10}},{match:/^claude[-_]sonnet[-_]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:XL},{match:/^claude[-_]opus[-_]4[-_.](?:5|6|7|8)\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:5,output:25,cacheRead:.5,cacheWrite:6.25,cacheWrite1h:10}},{match:/^claude[-_]opus[-_]4(?:[-_.]1)?\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75,cacheWrite1h:30}},{match:/^claude[-_]sonnet[-_]4[-_.](?:5|6)\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:3,output:15,cacheRead:.3,cacheWrite:3.75,cacheWrite1h:6}},{match:/^claude[-_]sonnet[-_]4\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:3,output:15,cacheRead:.3,cacheWrite:3.75,cacheWrite1h:6}},{match:/^claude[-_]haiku[-_]4[-_.]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:1,output:5,cacheRead:.1,cacheWrite:1.25,cacheWrite1h:2}},{match:/^claude[-_]haiku[-_]3[-_.]5\b(?![-_.]\d{1,7}(?!\d))/i,rates:{input:.8,output:4,cacheRead:.08,cacheWrite:1,cacheWrite1h:1.6}},{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:/^gpt[-_]5[-_.]1[-_]codex[-_]mini/i,rates:{input:.25,output:2,cacheRead:.025,cacheWrite:0}},{match:/^gpt[-_]5[-_.]1(?!\d)/i,rates:{input:1.25,output:10,cacheRead:.125,cacheWrite:0}},{match:/^gpt[-_]5[-_]pro\b/i,rates:{input:15,output:120,cacheRead:15,cacheWrite:0}},{match:/^gpt[-_]5[-_]mini/i,rates:{input:.25,output:2,cacheRead:.025,cacheWrite:0}},{match:/^gpt[-_]5[-_]nano/i,rates:{input:.05,output:.4,cacheRead:.005,cacheWrite:0}},{match:/^gpt[-_]5(?![-_.]\d)/i,rates:{input:1.25,output:10,cacheRead:.125,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[-_]mini/i,rates:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0}},{match:/^o1\b/i,rates:{input:15,output:60,cacheRead:7.5,cacheWrite:0}},{match:/^o3[-_]deep[-_]research/i,rates:{input:10,output:40,cacheRead:2.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[-_]deep[-_]research/i,rates:{input:2,output:8,cacheRead:.5,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 ZL(e){return e?/^(?:gpt[-_]|codex[-_]|o\d)/i.test(e):!1}function Eo(e,t=Date.now()){if(!e)return null;const r=gc(e);for(const s of QL)if(s.match.test(r))return typeof s.rates=="function"?s.rates(t):s.rates;return null}function Oj(e,t){const r=Math.max(0,e.cacheCreate1hTokens??0),s=Math.max(0,e.cacheCreate5mTokens??0),o=Math.max(0,e.cacheCreateTokens-r-s),a=s+o,u=t.cacheWrite1h??t.cacheWrite;return{tokens5m:a,tokens1h:r,usd5m:a*t.cacheWrite/1e6,usd1h:r*u/1e6}}function Pj(e,t,r=Date.now()){if(!ZL(t))return e.inputTokens;const s=Eo(t,r),o=((s==null?void 0:s.cacheWrite)??0)>0?Math.max(0,e.cacheCreateTokens):0;return Math.max(0,e.inputTokens-e.cacheReadTokens-o)}function Jy(e,t,r=Date.now()){const s=Eo(t,r);if(!s)return{input:0,output:0,cacheRead:0,cacheWrite:0,total:0};const o=Pj(e,t,r)*s.input/1e6,a=e.outputTokens*s.output/1e6,u=e.cacheReadTokens*s.cacheRead/1e6,c=Oj(e,s),f=c.usd5m+c.usd1h;return{input:o,output:a,cacheRead:u,cacheWrite:f,total:o+a+u+f}}const L_=2e5,JL=1e6,e$=[/\[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],t$=[{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 n$(e){if(!e)return L_;const t=gc(e);for(const r of e$)if(r.test(t))return JL;for(const r of t$)if(r.match.test(t))return r.window;return L_}function Lj(e,t){return typeof e=="number"&&e>0?e:n$(t)}const Wu="not priced";function Ge(e){if(e<=0)return"—";if(e<.005)return"<1¢";if(e<1){const t=(e*100).toFixed(e<.1?1:0);if(Number(t)<100)return`${t}¢`}return e<100?`$${e.toFixed(2)}`:e<1e4?`$${e.toFixed(0)}`:`$${(e/1e3).toFixed(1)}k`}function rc(e,t){if(e<=0||t<10)return null;const r=e/t,s=r*60;return s>=.01?`${Ge(s)}/min`:`${Ge(r*3600)}/hr`}function r$(e,t){const r={inputTokens:e.inputTokens+t.inputTokens,outputTokens:e.outputTokens+t.outputTokens,cacheReadTokens:e.cacheReadTokens+t.cacheReadTokens,cacheCreateTokens:e.cacheCreateTokens+t.cacheCreateTokens};return(e.cacheCreate1hTokens!==void 0||e.cacheCreate5mTokens!==void 0||t.cacheCreate1hTokens!==void 0||t.cacheCreate5mTokens!==void 0)&&(r.cacheCreate1hTokens=(e.cacheCreate1hTokens??0)+(t.cacheCreate1hTokens??0),r.cacheCreate5mTokens=(e.cacheCreate5mTokens??0)+(t.cacheCreate5mTokens??0)),(e.reasoningOutputTokens!==void 0||t.reasoningOutputTokens!==void 0)&&(r.reasoningOutputTokens=(e.reasoningOutputTokens??0)+(t.reasoningOutputTokens??0)),r}function s$(e,t){let r=0,s=0,o=0,a=0,u=0,c=0;for(const g of t)r+=g.inputTokens,s+=g.outputTokens,o+=g.cacheReadTokens,a+=g.cacheCreateTokens,u+=g.cacheCreate1hTokens??0,c+=g.cacheCreate5mTokens??0;const f=(g,y)=>Math.max(0,g-y),p={inputTokens:f(e.inputTokens,r),outputTokens:f(e.outputTokens,s),cacheReadTokens:f(e.cacheReadTokens,o),cacheCreateTokens:f(e.cacheCreateTokens,a)};return(e.cacheCreate1hTokens!==void 0||e.cacheCreate5mTokens!==void 0)&&(p.cacheCreate1hTokens=f(e.cacheCreate1hTokens??0,u),p.cacheCreate5mTokens=f(e.cacheCreate5mTokens??0,c)),p.inputTokens+p.outputTokens+p.cacheReadTokens+p.cacheCreateTokens>0?p:null}function nl(e){const t=e.usageByModel,r=t?Object.keys(t):[];if(!t||r.length===0)return[{model:e.model,usage:e.usage}];const s=r.map(a=>({model:a,usage:t[a]})),o=s$(e.usage,s.map(a=>a.usage));if(o){const a=s.findIndex(u=>u.model===e.model);a>=0?s[a]={model:s[a].model,usage:r$(s[a].usage,o)}:s.push({model:e.model,usage:o})}return s}function vn(e,t=Date.now()){const r={input:0,output:0,cacheRead:0,cacheWrite:0,total:0};for(const s of nl(e)){const o=Jy(s.usage,s.model,t);r.input+=o.input,r.output+=o.output,r.cacheRead+=o.cacheRead,r.cacheWrite+=o.cacheWrite,r.total+=o.total}return r}function wy(e,t=Date.now()){let r=0;for(const s of nl(e))Eo(s.model,t)==null&&(r+=s.usage.inputTokens+s.usage.outputTokens);return r}function $j(e){const t=[];for(const r of nl(e)){if(!r.model||t.includes(r.model))continue;const s=r.usage;s.inputTokens+s.outputTokens+s.cacheReadTokens+s.cacheCreateTokens<=0||t.push(r.model)}return t}function qj(e){return $j(e).filter(t=>t!==e.model)}const i$=new Set(["untrusted","on-request","on-failure"]);function o$(e){return typeof e!="string"||!e?null:i$.has(e)?!0:e==="never"?!1:null}function a$(e){if(e.provider!=="codex"||e.kind!=="root"||e.waiting||e.state!=="active")return null;const t=o$(e.approvalPolicy);return t===!1?null:{label:"approvals not visible",detail:`${t===!0?`This session's approval policy is "${e.approvalPolicy}", so Codex can stop and ask you to approve a command.`:"This session's approval policy has not been read yet, so it may be able to stop and ask you to approve a command."}
|
|
58
58
|
|
|
59
|
-
Codex writes no approval request to its rollout files, which are the only thing this deck can read — so when it does ask, this card, the sidebar, the topbar count, the tab title and the favicon will all stay silent. Check the terminal.`}}function
|
|
60
|
-
no published rate in this build — the tokens are counted, the dollars are not`;const s=d=>d.toLocaleString(),o=d=>`$${d}/MTok`,a=Jy(e,t),u=
|
|
61
|
-
`)}function
|
|
59
|
+
Codex writes no approval request to its rollout files, which are the only thing this deck can read — so when it does ask, this card, the sidebar, the topbar count, the tab title and the favicon will all stay silent. Check the terminal.`}}function $_(e){return e[0].toUpperCase()+e.slice(1).toLowerCase()}function li(e){const t=gc(e).replace(/[-_]\d{8}(?!\d)/,""),r=t.match(/^claude[-_](opus|sonnet|haiku|fable|mythos)[-_](\d+(?:[-_.]\d+)*)/i);if(r){const o=$_(r[1]),a=r[2].replace(/[-_]/g,".");return`${o} ${a}`}const s=t.match(/^gpt[-_](\d+(?:[-_.]\d+)*)((?:[-_][A-Za-z0-9.]+)*)$/i);if(s){const o=s[1].replace(/[-_]/g,"."),a=s[2].split(/[-_]/).filter(Boolean).map($_);return[`GPT-${o}`,...a].join(" ")}return e}function At(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 sc(e,t,r){const s=(t??r)-e;if(s<1e3)return`${Math.max(0,s)}ms`;const o=Math.floor(s/1e3);if(o<60)return`${o}s`;const a=Math.floor(o/60),u=o%60;return`${a}m ${String(u).padStart(2,"0")}s`}function Dj(e,t){if(e.endedAt==null)return t;const r=e.endedAt-e.startedAt;return r<1e3?`${r}ms`:`${(r/1e3).toFixed(2)}s`}function Fj(e,t){const r=typeof e=="string"?e.trim():"",s=typeof t=="string"?t.trim():"";return{face:r||s||void 0,tooltip:s||r||void 0}}const l$=1,zj=-1;function u$(){const e=[];let t=0;function r(){let s;for(const o of e)(!s||o.layer>s.layer||o.layer===s.layer&&o.seq>s.seq)&&(s=o);return s}return{push(s,o=0){const a={dismiss:s,layer:o,seq:t++};return e.push(a),()=>{const u=e.indexOf(a);u!==-1&&e.splice(u,1)}},dismissTop(){const s=r();return s?(s.dismiss(),!0):!1},isTop(s){const o=r();return o!=null&&o.dismiss===s},depth(){return e.length},topIsPanel(){const s=r();return s!=null&&s.layer===zj}}}const po=u$();function c$(e){return e.overlayOpen&&!e.panelOnTop?"dismiss":e.typing?"blur":e.overlayOpen?"dismiss":"clear-selection"}function q_(e){return String(e.tagName??"").toUpperCase()==="BODY"}function d$(e,t){return!e||!e.isConnected||q_(e)?!1:t==null||q_(t)}const D_="a[href], button, input, select, textarea, [tabindex]";function f$(e){return!e||e.disabled||e.rendered===!1?!1:(e.tabIndex??0)>=0}function h$(e){if(!e||!e.overflowing||e.hasFocusable)return!1;const t=String(e.overflow??"").toLowerCase();return t==="auto"||t==="scroll"}function p$({count:e,index:t,shiftKey:r}){return e<=0?{kind:"hold"}:t<0||t>=e?{kind:"focus",index:r?e-1:0}:!r&&t===e-1?{kind:"focus",index:0}:r&&t===0?{kind:"focus",index:e-1}:{kind:"allow"}}function e0(e){return e.ctrlKey||e.metaKey||e.altKey}const m$=new Set(["button","checkbox","color","file","image","radio","range","reset","submit"]),g$=new Set(["INPUT","TEXTAREA","SELECT","OPTION","BUTTON","SUMMARY","A"]),v$=new Set(["button","checkbox","combobox","link","listbox","menu","menubar","menuitem","menuitemcheckbox","menuitemradio","option","radio","searchbox","slider","spinbutton","switch","tab","textbox","treeitem"]);function Bj(e){return typeof e.tagName=="string"?e.tagName.toUpperCase():""}function t0(e){if(!e)return!1;if(e.isContentEditable)return!0;const t=Bj(e);return t==="TEXTAREA"?!0:t!=="INPUT"?!1:!m$.has(String(e.type??"text").toLowerCase())}function y$(e){if(!e)return!1;if(t0(e)||g$.has(Bj(e)))return!0;const t=typeof e.role=="string"?e.role.trim().toLowerCase():"";return t!==""&&t.split(/\s+/).some(r=>v$.has(r))}function w$({key:e,modalOpen:t,sheetOpen:r}){return t?!(e==="?"&&r):!1}function Uj(e){return e?Array.from(e.querySelectorAll("*")).filter(t=>{if(t.matches(D_))return f$({disabled:t.disabled,tabIndex:t.tabIndex,rendered:t.getClientRects().length>0});const r=t.scrollHeight>t.clientHeight;return r&&h$({overflowing:r,overflow:getComputedStyle(t).overflowY,hasFocusable:t.querySelector(D_)!=null})}):[]}function x$(e,t){const r=Uj(e);if(!t||!e.contains(t)||r.includes(t))return r;const s=r.findIndex(o=>(t.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return s===-1?[...r,t]:[...r.slice(0,s),t,...r.slice(s)]}function Kr(e,t={}){const{focusRef:r,layer:s}=t,o=N.useRef(null),a=N.useRef(e);a.current=e;const u=N.useRef(null);u.current===null&&(u.current=()=>a.current());const c=u.current;return N.useEffect(()=>po.push(c,s),[c,s]),N.useEffect(()=>{var p;const f=document.activeElement;return(p=(r==null?void 0:r.current)??Uj(o.current)[0])==null||p.focus(),()=>{d$(f,document.activeElement)&&f.focus()}},[]),N.useEffect(()=>{const f=p=>{var _;if(p.key!=="Tab"||e0(p))return;const d=o.current;if(!d)return;const g=document.activeElement;if(!(g!=null&&d.contains(g))&&!po.isTop(c))return;const w=x$(d,g),S=p$({count:w.length,index:g?w.indexOf(g):-1,shiftKey:p.shiftKey});S.kind!=="allow"&&(p.preventDefault(),S.kind==="focus"&&((_=w[S.index])==null||_.focus()))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[c]),o}function _$(e){return e==="codex"?{subtitle:"reported by the Codex CLI — as of its most recent request",windowScope:"last request",compositionCounted:!1,compositionUncounted:"Not counted for Codex — the deck reconstructs the session from its rollout file and skips whatever was written before it attached, so a message and tool-call breakdown here would be short by an unknown amount. The window figure above is the CLI's own and is unaffected.",memoryHeading:"AGENTS.md files in scope",memoryEmpty:"No AGENTS.md files found on the path from cwd to the filesystem root, or in $CODEX_HOME."}:{subtitle:"approximation — CC's /context isn't hook-exposed",windowScope:"current turn",compositionCounted:!0,compositionUncounted:"",memoryHeading:"CLAUDE.md files in scope",memoryEmpty:"No CLAUDE.md files found on the path from cwd to ~/.claude."}}function Ln(e){return e.toLocaleString()}function b$(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}const k$=60;function S$(e,t=k$){if(e.length<=t)return e;const r=e.slice(e.length-(t-1)),s=r.search(/[/\\]/);return"…"+(s===-1?r:r.slice(s))}function E$({agent:e,onClose:t}){var y;const r=N.useRef(null),s=Kr(t,{focusRef:r}),o=e.context,a=e.usage,u=(o==null?void 0:o.currentContextTokens)??0,c=Lj(e.contextWindow,e.model),f=Math.min(100,u/c*100),p=vn(e),d=a.inputTokens+a.cacheReadTokens+a.cacheCreateTokens,g=_$(e.provider);return m.jsx("div",{className:"ctx-modal-backdrop",onClick:t,role:"presentation",children:m.jsxs("div",{ref:s,className:"ctx-modal",onClick:w=>w.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Context breakdown",children:[m.jsxs("header",{className:"ctx-modal-head",children:[m.jsxs("div",{children:[m.jsxs("div",{className:"ctx-modal-title",children:["Context · ",e.label]}),m.jsx("div",{className:"ctx-modal-sub",children:g.subtitle})]}),m.jsx("button",{type:"button",ref:r,className:"glyph-btn ctx-modal-close",onClick:t,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]}),m.jsxs("section",{className:"ctx-window-row",children:[m.jsx("div",{className:"ctx-window-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(f),children:m.jsx("div",{className:"ctx-window-fill",style:{width:`${f}%`}})}),m.jsxs("div",{className:"ctx-window-meta",children:[m.jsxs("span",{className:"ctx-window-pct",children:[f.toFixed(1),"%"]}),m.jsxs("span",{children:[Ln(u)," / ",Ln(c)," tok (",g.windowScope,")"]})]})]}),m.jsx("h3",{className:"ctx-section-title",children:"Cumulative usage · whole session"}),m.jsxs("div",{className:"ctx-grid",children:[m.jsx(tr,{label:"input tokens",val:Ln(a.inputTokens)}),m.jsx(tr,{label:"output tokens",val:Ln(a.outputTokens)}),m.jsx(tr,{label:"cache reads",val:Ln(a.cacheReadTokens)}),m.jsx(tr,{label:"cache writes",val:Ln(a.cacheCreateTokens)}),m.jsx(tr,{label:"cumulative total",val:Ln(d)}),m.jsx(tr,{label:"estimated cost",val:Ge(p.total),accent:!0})]}),m.jsx("h3",{className:"ctx-section-title",children:"Transcript composition"}),g.compositionCounted?m.jsxs("div",{className:"ctx-grid",children:[m.jsx(tr,{label:"user messages",val:Ln((o==null?void 0:o.msgsUser)??0)}),m.jsx(tr,{label:"assistant messages",val:Ln((o==null?void 0:o.msgsAssistant)??0)}),m.jsx(tr,{label:"tool uses",val:Ln((o==null?void 0:o.toolUses)??0)}),m.jsx(tr,{label:"tool results",val:Ln((o==null?void 0:o.toolResults)??0)}),m.jsx(tr,{label:"system-reminders",val:Ln((o==null?void 0:o.systemReminders)??0)})]}):m.jsx("div",{className:"ctx-empty",children:g.compositionUncounted}),m.jsx("h3",{className:"ctx-section-title",children:g.memoryHeading}),(((y=o==null?void 0:o.memoryFiles)==null?void 0:y.length)??0)===0?m.jsx("div",{className:"ctx-empty",children:g.memoryEmpty}):m.jsx("ul",{className:"ctx-md-list",children:o.memoryFiles.map(w=>m.jsxs("li",{children:[m.jsx("span",{className:"ctx-md-path",title:w.path,children:S$(w.path)}),m.jsx("span",{className:"ctx-md-size",children:b$(w.bytes)})]},w.path))})]})})}function tr({label:e,val:t,accent:r}){return m.jsxs("div",{className:`ctx-row${r?" accent":""}`,children:[m.jsx("span",{className:"ctx-row-label",children:e}),m.jsx("span",{className:"ctx-row-val",children:t})]})}function N$({currentContextTokens:e,modelId:t,contextWindow:r,size:s=26,onClick:o,title:a}){const u=Lj(r,t),c=Math.min(1,e/u),f=s/2-3,p=s/2,d=2*Math.PI*f,g=d*c,y=c>.9?"var(--err)":c>.7?"var(--inflight)":"var(--accent)";return m.jsx("button",{type:"button",className:"ctx-donut",onClick:o,title:a??`context: ${e.toLocaleString()} / ${u.toLocaleString()} (${(c*100).toFixed(1)}%)`,"aria-label":"Show context breakdown",children:m.jsxs("svg",{width:s,height:s,viewBox:`0 0 ${s} ${s}`,children:[m.jsx("circle",{cx:p,cy:p,r:f,stroke:"var(--line)",strokeWidth:"2.5",fill:"none"}),m.jsx("circle",{cx:p,cy:p,r:f,stroke:y,strokeWidth:"2.5",fill:"none",strokeDasharray:`${g} ${d-g}`,strokeDashoffset:d/4,strokeLinecap:"round",style:{transition:"var(--ctx-arc-transition)"}}),m.jsx("text",{x:p,y:p+3,textAnchor:"middle",fontSize:"8",fill:"var(--text)",fontWeight:"600",children:Math.round(c*100)})]})})}function F_(e,t){const r=Eo(t);if(!r)return`model: ${t}
|
|
60
|
+
no published rate in this build — the tokens are counted, the dollars are not`;const s=d=>d.toLocaleString(),o=d=>`$${d}/MTok`,a=Jy(e,t),u=Oj(e,r),c=u.tokens1h>0?[`cache w5m${s(u.tokens5m).padStart(14)} × ${o(r.cacheWrite).padEnd(11)} = ${Ge(u.usd5m)}`,`cache w1h${s(u.tokens1h).padStart(14)} × ${o(r.cacheWrite1h??r.cacheWrite).padEnd(11)} = ${Ge(u.usd1h)}`]:[`cache w ${s(u.tokens5m).padStart(14)} × ${o(r.cacheWrite).padEnd(11)} = ${Ge(u.usd5m)}`],f=Pj(e,t),p=f===e.inputTokens?"input":"uncached";return[`model: ${t}`,`${p.padEnd(9)}${s(f).padStart(14)} × ${o(r.input).padEnd(11)} = ${Ge(a.input)}`,`output ${s(e.outputTokens).padStart(14)} × ${o(r.output).padEnd(11)} = ${Ge(a.output)}`,`cache r ${s(e.cacheReadTokens).padStart(14)} × ${o(r.cacheRead).padEnd(11)} = ${Ge(a.cacheRead)}`,...c,"─────────────────────────────────────────",`total = ${Ge(a.total)}`].join(`
|
|
61
|
+
`)}function z_(e){const t=nl(e);return t.length<=1?F_(e.usage,e.model):[...t.map(r=>F_(r.usage,r.model)),"═════════════════════════════════════════",`all models = ${Ge(vn(e).total)}`].join(`
|
|
62
62
|
`)}function C$({data:e,selected:t}){var y;const r=e.now??Date.now(),s=["agent-node",`state-${e.state}`,e.synthetic?"synthetic":"",t?"selected":""].filter(Boolean).join(" "),o=e.tools.filter(w=>!w.endedAt).length,a=Zy(e.sessionId),u=((y=e.context)==null?void 0:y.currentContextTokens)??0,c=e.kind==="root"&&u>0,f=e.sessionTitle?e.cwd?`${e.cwd}
|
|
63
|
-
${e.sessionTitle}`:e.sessionTitle:e.cwd,p
|
|
63
|
+
${e.sessionTitle}`:e.sessionTitle:e.cwd,p=qj(e),d=p.length>0?`${e.model}
|
|
64
64
|
spend on this card also covers:
|
|
65
65
|
${p.join(`
|
|
66
|
-
`)}`:e.model,g=
|
|
66
|
+
`)}`:e.model,g=Fj(e.sessionName,e.sessionTitle);return m.jsxs("div",{className:s,style:{"--session-hue":a},children:[m.jsx("span",{className:"accent-stripe"}),m.jsx(wo,{type:"target",position:Ae.Left,style:{background:"transparent",border:"none"}}),m.jsxs("div",{className:"head",children:[m.jsxs("div",{className:"title",children:[m.jsx(j$,{state:e.state}),m.jsx("span",{className:"label",title:f,children:e.label}),e.synthetic&&m.jsx("span",{className:"synth-tag",title:"No SessionStart captured — synthesised",children:"?"})]}),m.jsxs("div",{className:"head-right",children:[c&&e.onOpenContext&&m.jsx(N$,{currentContextTokens:u,modelId:e.model,contextWindow:e.contextWindow,onClick:()=>e.onOpenContext(e.sessionId)}),m.jsx("div",{className:"time",title:`Started ${new Date(e.startedAt).toLocaleTimeString()}`,children:sc(e.startedAt,e.endedAt,r)})]})]}),m.jsxs("div",{className:"sub",children:[e.kind==="root"?"session":"subagent",e.childCount>0&&m.jsxs("span",{className:"spawn-badge",title:`${e.childCount} subagents spawned`,children:["→ ",e.childCount]}),e.cwdBasename&&e.kind==="subagent"?` · ${e.cwdBasename}`:"",e.model?m.jsxs("span",{className:"model-chip",title:d,children:[li(e.model),p.length>0?` +${p.length}`:""]}):e.provider==="codex"?m.jsx("span",{className:"model-chip",title:"OpenAI Codex — no model reported yet",children:"Codex"}):null]}),e.kind==="root"&&g.face&&m.jsx("div",{className:"session-name",title:g.tooltip,children:g.face}),e.waiting&&m.jsx(R$,{waiting:e.waiting,now:r}),(()=>{const w=a$(e);return w?m.jsxs("div",{className:"approval-blind-row",title:w.detail,children:[m.jsx("span",{className:"approval-blind-dot","aria-hidden":!0}),m.jsx("span",{className:"approval-blind-said",children:w.label})]}):null})(),e.tools.length>0&&m.jsx(A$,{tools:e.tools,now:r}),m.jsxs("div",{className:"meta",children:[m.jsxs("span",{children:[m.jsx("b",{children:e.toolCount})," tools"]}),o>0&&m.jsxs("span",{className:"inflight-meta",children:[m.jsx("b",{children:o})," in-flight"]}),e.usage.inputTokens+e.usage.outputTokens>0&&m.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:[m.jsx("b",{children:At(e.usage.inputTokens+e.usage.outputTokens)})," tok"]}),e.model&&(()=>{const w=Eo(e.model),S=vn(e),_=wy(e);if(!w&&S.total<=0)return e.usage.inputTokens+e.usage.outputTokens<=0?null:m.jsx("span",{className:"cost-unpriced",title:z_(e),children:Wu});if(S.total<=0)return null;const b=Math.max(0,((e.endedAt??r)-e.startedAt)/1e3),k=e.state==="active"?rc(S.total,b):null,E=z_(e)+(k?`
|
|
67
67
|
burn: ${k}`:"");return m.jsxs("span",{className:"cost-meta",title:E,children:[m.jsxs("b",{children:[Ge(S.total),_>0?"+":""]}),k&&m.jsx("span",{className:"cost-rate",children:k})]})})()]}),m.jsx(wo,{type:"source",position:Ae.Right,style:{background:"transparent",border:"none"}})]})}function n0(e){return e==="active"?"live":e==="done"?"done":"err"}function j$({state:e}){return m.jsx("span",{className:`state-pill state-${e}`,children:n0(e)})}function vc(e){return e.message?e.message:e.kind==="permission"?"Needs your permission":"Waiting for your input"}function T$(e){return e.kind==="permission"?vc(e):"Your turn"}function R$({waiting:e,now:t}){const r=e.kind==="permission",s=vc(e);return m.jsxs("div",{className:r?"waiting-row permission":"waiting-row idle",title:`${s}
|
|
68
|
-
Blocked for ${sc(e.since,void 0,t)} — the answer goes in the terminal, not here.`,children:[r?m.jsx("span",{className:"ap-pulse","aria-hidden":!0}):m.jsx("span",{className:"waiting-dot","aria-hidden":!0}),m.jsx("span",{className:"waiting-said",children:T$(e)}),m.jsx("b",{children:sc(e.since,void 0,t)})]})}function A$({tools:e,now:t}){const a=new Array(24).fill(0);let u=0;for(const y of e){const w=t-y.startedAt;if(w<0||w>=6e4)continue;const S=23-Math.floor(w/2500);S>=0&&S<24&&(a[S]+=1,u+=1)}const c=Math.max(1,...a),f=132,p=14,d=f/24,g=c/(2500/1e3);return m.jsxs("div",{className:"tool-spark-row",title:`${u} tool calls in last 60s · peak ${g.toFixed(1)}/s`,children:[m.jsx("svg",{className:"tool-spark",width:f,height:p,viewBox:`0 0 ${f} ${p}`,"aria-hidden":!0,children:a.map((y,w)=>{const S=y===0?1.5:Math.max(1.5,y/c*p),_=w===23&&y>0,k=`tool-spark-bar${y>0?" active":""}${_?" latest":""}`;return m.jsx("rect",{x:w*d+.4,y:p-S,width:Math.max(.5,d-1),height:S,rx:.8,className:k},w)})}),m.jsx("span",{className:"tool-spark-label",children:"60s"})]})}function
|
|
69
|
-
drag the wrapper to move the whole session`,onClick:()=>a(c.sessionId),children:[c.label,c.name?m.jsxs(m.Fragment,{children:[xy,m.jsx("span",{className:"cluster-label-name",children:c.name})]}):null,c.shortId?xy+c.shortId:null]})]},c.sessionId)})})}function B$(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const s=e[r],o=t[r];if(s.sessionId!==o.sessionId||s.label!==o.label||s.name!==o.name||s.shortId!==o.shortId||s.fullLabel!==o.fullLabel||s.x!==o.x||s.y!==o.y||s.w!==o.w||s.h!==o.h)return!1}return!0}function U$({data:e}){return m.jsx("div",{className:"session-group-handle",style:{width:(e==null?void 0:e.w)??0,height:(e==null?void 0:e.h)??0}})}const rl={exec:{category:"shell",emoji:"⚡",label:"Shell",shell:!0},shell:{category:"shell",emoji:"⚡",label:"Shell",shell:!0},exec_command:{category:"shell",emoji:"⚡",label:"Shell",shell:!0},shell_command:{category:"shell",emoji:"⚡",label:"Shell",shell:!0},write_stdin:{category:"shell",emoji:"💻",label:"stdin",shell:!0},wait:{category:"shell",emoji:"⏳",label:"wait",shell:!0},apply_patch:{category:"file",emoji:"🩹",label:"Edit"},update_plan:{category:"task",emoji:"📋",label:"Plan"},run:{category:"web",emoji:"🌐",label:"Web"}},H$=Object.fromEntries(Object.entries(rl).map(([e,t])=>[e,t.category])),W$=Object.fromEntries(Object.entries(rl).map(([e,t])=>[e,t.emoji])),V$=Object.fromEntries(Object.entries(rl).map(([e,t])=>[e,t.label])),G$=new Set(Object.keys(rl)),Y$=new Set(Object.entries(rl).filter(([,e])=>e.shell).map(([e])=>e)),
|
|
70
|
-
`:r==="r"?"\r":r==="t"?" ":r)}const Hj=600,J$=4,e3=36,_y=16,t3=60,n3=6,G_=220,Y_=96,r3=28,K_={Read:"📖",Write:"💾",Edit:"✏️",MultiEdit:"🔧",Glob:"🗺️",Grep:"🔎",Bash:"⚡",PowerShell:"💻",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:"📡",...W$};function X_(e){return e.startsWith("mcp__")?"🔌":Object.hasOwn(K_,e)?K_[e]:"✨"}const Q_={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 Wj(e){if(!e)return null;let t=e.trim();if(!t)return null;const r=t.match(/^(?:bash|sh|zsh|fish|powershell|pwsh)(?:\.exe)?\s+(?:-c|-Command|-NoProfile|-NonInteractive|\s)+["']([^"']+)["']/i);if(r)return Wj(r[1]);for(;;){const a=t.match(/^([A-Z_][A-Z0-9_]*=\S*)\s+/);if(!a)break;t=t.slice(a[0].length)}t=t.replace(/^sudo(?:\s+-\S+)*\s+/,""),t=t.replace(/^(?:time|nohup|xargs)\s+/,"");const s=t.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 s3(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;const t=e;if(typeof t.script=="string"){const r=Q$(t.script);if(r)return r}if(typeof t.cmd=="string")return t.cmd;if(typeof t.command=="string")return t.command;if(Array.isArray(t.command)&&t.command.every(r=>typeof r=="string")){const r=t.command;if(/powershell|cmd|bash|sh(\.exe)?$/i.test(r[0]??"")){const s=r.findIndex(o=>/^(-Command|-c)$/i.test(o));if(s>=0&&s+1<r.length)return r[s+1]}return r.join(" ")}return typeof t.script=="string"?t.script:null}const i3=new Set(["Bash","PowerShell",...Y$]),o3=G$;function a3(e,t){return o3.has(e)||e.startsWith("mcp__")?Math.max(Y_,34+t.length*7.5):Y_}function l3(e,t){if(!i3.has(e))return null;const r=s3(t);if(!r)return null;const s=Wj(r);return s?{emoji:Object.hasOwn(Q_,s)?Q_[s]:"⚙️",label:s,category:"shell",detail:r}:null}const u3=new Set(["Read","Write","Edit","MultiEdit","NotebookEdit","LS","Glob","apply_patch"]),Z_={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:"🗄️"},J_={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 c3(e){const r=e.replace(/\\/g,"/").replace(/\/+$/,""),s=r.lastIndexOf("/");return s>=0?r.slice(s+1):r}function d3(e){const t=e.toLowerCase();if(Object.hasOwn(J_,t))return J_[t];if(t.startsWith("dockerfile."))return"🐳";if(/\.(test|spec)\.[a-z]+$/.test(t))return"🧪";const r=t.lastIndexOf(".");if(r>0&&r<t.length-1){const s=t.slice(r+1);if(Object.hasOwn(Z_,s))return Z_[s]}return"📄"}function f3(e,t){if(!t||typeof t!="object")return null;const r=t;if(e==="apply_patch"&&typeof r.patch=="string"){const s=r.patch.match(/^\*\*\* (?:Update|Add|Delete) File: (.+)$/m);return s?s[1].trim():null}return typeof r.file_path=="string"?r.file_path:typeof r.notebook_path=="string"?r.notebook_path:typeof r.path=="string"?r.path:e==="Glob"&&typeof r.pattern=="string"?r.pattern:null}function h3(e,t){if(!u3.has(e))return null;const r=f3(e,t);if(!r)return null;const s=c3(r);return s?{emoji:e==="LS"?"📂":d3(s),label:s,category:"file",detail:r}:null}const e1={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 r0(e){if(!e.startsWith("mcp__"))return null;const t=e.slice(5),r=t.indexOf("__");return r<=0?{server:t,method:""}:{server:t.slice(0,r),method:t.slice(r+2)}}function p3(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t^e.charCodeAt(r);return Math.abs(t)%360}function Vj(e){const t=e.toLowerCase();return Object.hasOwn(e1,t)?e1[t]:void 0}function m3(e,t){const r=r0(e);if(!r)return null;const{server:s,method:o}=r;if(!o)return null;const a=Vj(s);return{emoji:(a==null?void 0:a.emoji)??"🔌",label:o,category:"mcp",detail:a?`${a.name} · ${o}`:`${s} · ${o}`}}function g3(e,t){return l3(e,t)??h3(e,t)??m3(e)}const t1=V$;function Gj(e){const t=r0(e);if(t){const s=Vj(t.server);return s?{emoji:s.emoji,label:s.name}:{emoji:"🔌",label:t.server,hue:p3(t.server)}}const r=Object.hasOwn(t1,e)?t1[e]:"";return r?{emoji:X_(e),label:r}:{emoji:X_(e),label:e}}function v3(e){let t=null,r="";for(const s of e){const o=r0(s);if(o){if(!o.server)return null;if(t===null)t=o.server,r=s;else if(o.server!==t)return null}}return t===null?null:Gj(r)}function y3(e){return e.endedAt==null?"inflight":e.ok===!1?"err":"done"}function w3(e,t,r){if(r==null)return 1;const s=t-r;return s<0?1:Math.max(0,1-s/Hj)}function x3(e,t){const r=[],s=new Set;for(let o=e.length-1;o>=0&&r.length<t;o--){const a=e[o];s.has(a.id)||(s.add(a.id),r.push(a))}return r.reverse()}function _3(e,t,r,s,o,a){const u=[];for(const c of e.values()){if(!t.has(c.id)||c.exitAt!=null&&a-c.exitAt>Hj)continue;const f=s.get(c.id)??r.get(c.id);if(!f)continue;const p=x3(c.tools,J$);if(p.length===0)continue;const d=c.exitAt??null,g=o.get(c.id),y=Math.max((g==null?void 0:g.width)??G_,G_),w=(g==null?void 0:g.height)??130,S=f.x,_=f.y,b=S+y,k=_+w/2;p.forEach((E,C)=>{const T=C*e3,A=S+y+t3,L=_+n3+T,P=w3(E,a,d),U=E.inputPreview??"",O=y3(E),M=P<.999,q=Gj(E.name);u.push({id:`${c.id}::${E.id}`,toolId:E.id,agentId:c.id,toolName:E.name,name:q.label,emoji:q.emoji,status:O,category:Uj(E.name),mcpHue:q.hue,inputPreview:U,fade:P,fading:M,worldX:A,worldY:L,anchorX:b,anchorY:k,spawnDx:b-A,spawnDy:k-(L+_y)});const V=g3(E.name,E.input);if(V){const X=a3(E.name,q.label),j=A+X+r3,G=L,B=A+X,te=L+_y;u.push({id:`sub:${c.id}::${E.id}`,toolId:E.id,agentId:c.id,toolName:E.name,name:V.label,emoji:V.emoji,isSub:!0,status:O,category:V.category,inputPreview:V.detail??U,fade:P,fading:M,worldX:j,worldY:G,anchorX:B,anchorY:te,spawnDx:B-j,spawnDy:0})}})}return u}function b3({agents:e,visibleAgentIds:t,positions:r,pinned:s,measured:o,spotlight:a,hiddenCategories:u,now:c,onOpenTool:f}){const p=_3(e,t,r,s,o,c),d=u&&u.size>0?p.filter(g=>!u.has(g.category)):p;return m.jsx(k3,{bursts:d,spotlight:a,onOpenTool:f})}function k3({bursts:e,spotlight:t,onOpenTool:r}){const{x:s,y:o,zoom:a}=kj();return m.jsxs("div",{className:"tool-bursts-layer","aria-hidden":!0,children:[m.jsx("svg",{className:"tool-bursts-svg",children:e.map(u=>{const c=u.anchorX*a+s,f=u.anchorY*a+o,p=(u.worldX+6)*a+s,d=(u.worldY+_y)*a+o,g=c+(p-c)*.55,y=t!=null&&!t.has(u.agentId),w=u.fade*(y?.14:1);return m.jsx("path",{d:`M ${c} ${f} Q ${g} ${f}, ${p} ${d}`,className:`tool-conn status-${u.status}${u.fading?" fading":""}`,opacity:w},`l:${u.id}`)})}),e.map(u=>{const c=u.worldX*a+s,f=u.worldY*a+o,p={left:`${c}px`,top:`${f}px`,transform:`scale(${a})`,transformOrigin:"left top","--spawn-dx":`${u.spawnDx}px`,"--spawn-dy":`${u.spawnDy}px`},d=u.isSub?`${u.toolName} · ${u.name}`:u.toolName,g=u.inputPreview?`${d} · ${u.inputPreview}`:d,y=r!=null,w=u.mcpHue!=null?{"--mcp-hue":u.mcpHue}:{},_=t!=null&&!t.has(u.agentId)?" dim":"";return m.jsx("div",{className:"tool-burst-wrap",style:p,children:m.jsxs("div",{className:`tool-burst cat-${u.category}${u.mcpHue!=null?" mcp-hue":""} status-${u.status}${u.fading?" fading":""}${y?" clickable":""}${u.isSub?" sub":""}${_}`,style:w,title:g,onClick:y?()=>r(u.toolId):void 0,children:[m.jsx("span",{className:"tb-emoji",children:u.emoji}),m.jsx("span",{className:"tb-name",children:u.name}),u.status==="inflight"&&m.jsx("span",{className:"tb-spin"}),u.status==="done"&&m.jsx("span",{className:"tb-mark done",children:"✓"}),u.status==="err"&&m.jsx("span",{className:"tb-mark err",children:"×"})]})},u.id)})]})}function Yj(e){const t={input:0,output:0,cacheRead:0,cacheWrite:0,total:0};let r=0,s=0,o=0,a=0;for(const u of e){const c=vn(u);t.input+=c.input,t.output+=c.output,t.cacheRead+=c.cacheRead,t.cacheWrite+=c.cacheWrite,t.total+=c.total,r+=u.usage.inputTokens,s+=u.usage.outputTokens,o+=u.usage.cacheReadTokens,a+=u.usage.cacheCreateTokens}return{cost:t,inputTokens:r,outputTokens:s,cacheReadTokens:o,cacheCreateTokens:a,sum:r+s}}const S3="spend on this board",E3="on this board",N3="board tokens",C3="board cost",ic=`Everything on the board right now, and only that.
|
|
68
|
+
Blocked for ${sc(e.since,void 0,t)} — the answer goes in the terminal, not here.`,children:[r?m.jsx("span",{className:"ap-pulse","aria-hidden":!0}):m.jsx("span",{className:"waiting-dot","aria-hidden":!0}),m.jsx("span",{className:"waiting-said",children:T$(e)}),m.jsx("b",{children:sc(e.since,void 0,t)})]})}function A$({tools:e,now:t}){const a=new Array(24).fill(0);let u=0;for(const y of e){const w=t-y.startedAt;if(w<0||w>=6e4)continue;const S=23-Math.floor(w/2500);S>=0&&S<24&&(a[S]+=1,u+=1)}const c=Math.max(1,...a),f=132,p=14,d=f/24,g=c/(2500/1e3);return m.jsxs("div",{className:"tool-spark-row",title:`${u} tool calls in last 60s · peak ${g.toFixed(1)}/s`,children:[m.jsx("svg",{className:"tool-spark",width:f,height:p,viewBox:`0 0 ${f} ${p}`,"aria-hidden":!0,children:a.map((y,w)=>{const S=y===0?1.5:Math.max(1.5,y/c*p),_=w===23&&y>0,k=`tool-spark-bar${y>0?" active":""}${_?" latest":""}`;return m.jsx("rect",{x:w*d+.4,y:p-S,width:Math.max(.5,d-1),height:S,rx:.8,className:k},w)})}),m.jsx("span",{className:"tool-spark-label",children:"60s"})]})}function B_(e){if(e==null)return"(none)";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function I$({tool:e,onClose:t}){const r=Kr(t),s=e.endedAt==null?"inflight":e.ok===!1?"err":"done";return m.jsx("div",{className:"modal-backdrop",onClick:t,role:"presentation",children:m.jsxs("div",{ref:r,className:"modal",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"tool-modal-title",children:[m.jsxs("header",{className:"modal-head",children:[m.jsxs("div",{className:"modal-title",children:[m.jsx("span",{className:`status-dot ${s}`,"aria-hidden":!0}),m.jsx("span",{id:"tool-modal-title",className:"modal-tool-name",children:e.name}),m.jsxs("span",{className:"modal-tool-id",title:e.id,children:[e.id.slice(0,12),"…"]})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("span",{className:"modal-dur",children:Dj(e,"in-flight…")}),m.jsx("button",{className:"glyph-btn",onClick:t,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]})]}),m.jsxs("section",{className:"modal-body",children:[e.trimmed&&m.jsx("div",{className:"modal-section",children:m.jsx("p",{className:"modal-note",children:"Full payloads for this call were released to keep memory bounded — only the previews below are still held."})}),m.jsxs("div",{className:"modal-section",children:[m.jsx("h4",{children:"Input"}),m.jsx("pre",{children:B_(e.input??e.inputPreview)})]}),m.jsxs("div",{className:"modal-section",children:[m.jsxs("h4",{children:["Response ",s==="err"&&m.jsx("span",{className:"err-tag",children:"error"})]}),m.jsx("pre",{children:e.endedAt==null?"(waiting…)":B_(e.response??e.errorPreview)})]})]})]})})}const Mu=18,U_=26,M$=12;function O$(e){return P$(e.nodeInternals.values())}function P$(e){const t=new Map;for(const o of e){if(o.type!=="agent")continue;const a=o.data;if(!(a!=null&&a.sessionId)||a.exitAt!=null||o.width==null||o.height==null)continue;const u=o.position.x,c=o.position.y,f=u+o.width,p=c+o.height,d=t.get(a.sessionId);d?(d.minX=Math.min(d.minX,u),d.minY=Math.min(d.minY,c),d.maxX=Math.max(d.maxX,f),d.maxY=Math.max(d.maxY,p),a.kind==="root"&&(d.label=W_(a)??d.label),a.kind==="root"&&(d.name=V_(a))):t.set(a.sessionId,{minX:u,minY:c,maxX:f,maxY:p,label:W_(a)??a.sessionId,name:V_(a)})}const r=new Map;for(const o of t.values())r.set(o.label,(r.get(o.label)??0)+1);const s=[];for(const[o,a]of t){const u=(r.get(a.label)??0)>1;s.push({sessionId:o,...D$(a.label,a.name,o,u),x:a.minX-Mu,y:a.minY-Mu-U_,w:a.maxX-a.minX+Mu*2,h:a.maxY-a.minY+Mu*2+U_})}return s}const xy=" · ",L$=32,$$=/[\u1100-\u115F\u2E80-\u303E\u3041-\u33FF\u3400-\u4DBF\u4E00-\u9FFF\uA000-\uA4CF\uAC00-\uD7A3\uF900-\uFAFF\uFE30-\uFE6F\uFF00-\uFF60\uFFE0-\uFFE6]/;function H_(e){return $$.test(e)?2:1}function q$(e,t=L$){const r=[...e];let s=0;for(const u of r)s+=H_(u);if(s<=t)return e;const o=[];let a=0;for(const u of r){const c=H_(u);if(a+c>t-1)break;o.push(u),a+=c}for(;o.length&&/[\s\-_.:/]/.test(o[o.length-1]);)o.pop();return`${o.join("")}…`}function D$(e,t,r,s){const o=(t==null?void 0:t.trim())??"",a=s?F$(r):void 0,u=[e,o||void 0,a].filter(Boolean);return{label:e,name:o?q$(o):void 0,shortId:a,fullLabel:u.join(xy)}}function F$(e){const t=e.match(/[a-zA-Z0-9]{4}/);return t?t[0]:e.slice(0,4)}function W_(e){if(e.kind==="root")return e.label}function V_(e){if(e.kind==="root")return Fj(e.sessionName,e.sessionTitle).face}function z$(){const{x:e,y:t,zoom:r}=Sj(),s=Ja(),o=it(O$,B$);if(o.length<=1)return null;const a=c=>{try{const f=s.getNodes().filter(p=>{const d=p.data;return(d==null?void 0:d.sessionId)===c});if(f.length===0)return;s.fitView({padding:.3,duration:500,nodes:f})}catch{}},u={transform:`translate(${e}px, ${t}px) scale(${r})`};return m.jsx("div",{className:"session-clusters",style:u,children:o.map(c=>{const f=Zy(c.sessionId),p={position:"absolute",left:c.x,top:c.y,width:c.w,height:c.h,"--session-hue":f},d={position:"absolute",left:c.x+16,top:c.y-M$,transform:`scale(${Math.min(1,r)/(r||1)})`,transformOrigin:"left top","--session-hue":f};return m.jsxs(ue.Fragment,{children:[m.jsx("div",{className:"cluster-card",style:p,"aria-hidden":!0}),m.jsxs("button",{type:"button",className:"cluster-label",style:d,title:`Fit view to ${c.fullLabel}
|
|
69
|
+
drag the wrapper to move the whole session`,onClick:()=>a(c.sessionId),children:[c.label,c.name?m.jsxs(m.Fragment,{children:[xy,m.jsx("span",{className:"cluster-label-name",children:c.name})]}):null,c.shortId?xy+c.shortId:null]})]},c.sessionId)})})}function B$(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const s=e[r],o=t[r];if(s.sessionId!==o.sessionId||s.label!==o.label||s.name!==o.name||s.shortId!==o.shortId||s.fullLabel!==o.fullLabel||s.x!==o.x||s.y!==o.y||s.w!==o.w||s.h!==o.h)return!1}return!0}function U$({data:e}){return m.jsx("div",{className:"session-group-handle",style:{width:(e==null?void 0:e.w)??0,height:(e==null?void 0:e.h)??0}})}const rl={exec:{category:"shell",emoji:"⚡",label:"Shell",shell:!0},shell:{category:"shell",emoji:"⚡",label:"Shell",shell:!0},exec_command:{category:"shell",emoji:"⚡",label:"Shell",shell:!0},shell_command:{category:"shell",emoji:"⚡",label:"Shell",shell:!0},write_stdin:{category:"shell",emoji:"💻",label:"stdin",shell:!0},wait:{category:"shell",emoji:"⏳",label:"wait",shell:!0},apply_patch:{category:"file",emoji:"🩹",label:"Edit"},update_plan:{category:"task",emoji:"📋",label:"Plan"},run:{category:"web",emoji:"🌐",label:"Web"}},H$=Object.fromEntries(Object.entries(rl).map(([e,t])=>[e,t.category])),W$=Object.fromEntries(Object.entries(rl).map(([e,t])=>[e,t.emoji])),V$=Object.fromEntries(Object.entries(rl).map(([e,t])=>[e,t.label])),G$=new Set(Object.keys(rl)),Y$=new Set(Object.entries(rl).filter(([,e])=>e.shell).map(([e])=>e)),G_={Read:"file",Write:"file",Edit:"file",MultiEdit:"file",Glob:"file",Grep:"file",LS:"file",NotebookEdit:"file",Bash:"shell",PowerShell:"shell",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",...H$};function Hj(e){return e.startsWith("mcp__")?"mcp":Object.hasOwn(G_,e)?G_[e]:"other"}const K$=/\btools\.exec_command\s*\(\s*\{[^{}]*?\bcmd\s*:\s*(["'`])((?:\\.|(?!\1)[^\\])*)\1/,X$=/\btools\.([A-Za-z_$][\w$]*)\s*\(/;function Q$(e){if(typeof e!="string"||!e)return null;const t=K$.exec(e);if(t){const s=Z$(t[2]);if(s.trim())return s}const r=X$.exec(e);return r?r[1]:null}function Z$(e){return e.replace(/\\(["'`\\nrt])/g,(t,r)=>r==="n"?`
|
|
70
|
+
`:r==="r"?"\r":r==="t"?" ":r)}const Wj=600,J$=4,e3=36,_y=16,t3=60,n3=6,Y_=220,K_=96,r3=28,X_={Read:"📖",Write:"💾",Edit:"✏️",MultiEdit:"🔧",Glob:"🗺️",Grep:"🔎",Bash:"⚡",PowerShell:"💻",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:"📡",...W$};function Q_(e){return e.startsWith("mcp__")?"🔌":Object.hasOwn(X_,e)?X_[e]:"✨"}const Z_={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 Vj(e){if(!e)return null;let t=e.trim();if(!t)return null;const r=t.match(/^(?:bash|sh|zsh|fish|powershell|pwsh)(?:\.exe)?\s+(?:-c|-Command|-NoProfile|-NonInteractive|\s)+["']([^"']+)["']/i);if(r)return Vj(r[1]);for(;;){const a=t.match(/^([A-Z_][A-Z0-9_]*=\S*)\s+/);if(!a)break;t=t.slice(a[0].length)}t=t.replace(/^sudo(?:\s+-\S+)*\s+/,""),t=t.replace(/^(?:time|nohup|xargs)\s+/,"");const s=t.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 s3(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;const t=e;if(typeof t.script=="string"){const r=Q$(t.script);if(r)return r}if(typeof t.cmd=="string")return t.cmd;if(typeof t.command=="string")return t.command;if(Array.isArray(t.command)&&t.command.every(r=>typeof r=="string")){const r=t.command;if(/powershell|cmd|bash|sh(\.exe)?$/i.test(r[0]??"")){const s=r.findIndex(o=>/^(-Command|-c)$/i.test(o));if(s>=0&&s+1<r.length)return r[s+1]}return r.join(" ")}return typeof t.script=="string"?t.script:null}const i3=new Set(["Bash","PowerShell",...Y$]),o3=G$;function a3(e,t){return o3.has(e)||e.startsWith("mcp__")?Math.max(K_,34+t.length*7.5):K_}function l3(e,t){if(!i3.has(e))return null;const r=s3(t);if(!r)return null;const s=Vj(r);return s?{emoji:Object.hasOwn(Z_,s)?Z_[s]:"⚙️",label:s,category:"shell",detail:r}:null}const u3=new Set(["Read","Write","Edit","MultiEdit","NotebookEdit","LS","Glob","apply_patch"]),J_={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:"🗄️"},e1={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 c3(e){const r=e.replace(/\\/g,"/").replace(/\/+$/,""),s=r.lastIndexOf("/");return s>=0?r.slice(s+1):r}function d3(e){const t=e.toLowerCase();if(Object.hasOwn(e1,t))return e1[t];if(t.startsWith("dockerfile."))return"🐳";if(/\.(test|spec)\.[a-z]+$/.test(t))return"🧪";const r=t.lastIndexOf(".");if(r>0&&r<t.length-1){const s=t.slice(r+1);if(Object.hasOwn(J_,s))return J_[s]}return"📄"}function f3(e,t){if(!t||typeof t!="object")return null;const r=t;if(e==="apply_patch"&&typeof r.patch=="string"){const s=r.patch.match(/^\*\*\* (?:Update|Add|Delete) File: (.+)$/m);return s?s[1].trim():null}return typeof r.file_path=="string"?r.file_path:typeof r.notebook_path=="string"?r.notebook_path:typeof r.path=="string"?r.path:e==="Glob"&&typeof r.pattern=="string"?r.pattern:null}function h3(e,t){if(!u3.has(e))return null;const r=f3(e,t);if(!r)return null;const s=c3(r);return s?{emoji:e==="LS"?"📂":d3(s),label:s,category:"file",detail:r}:null}const t1={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 r0(e){if(!e.startsWith("mcp__"))return null;const t=e.slice(5),r=t.indexOf("__");return r<=0?{server:t,method:""}:{server:t.slice(0,r),method:t.slice(r+2)}}function p3(e){let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t^e.charCodeAt(r);return Math.abs(t)%360}function Gj(e){const t=e.toLowerCase();return Object.hasOwn(t1,t)?t1[t]:void 0}function m3(e,t){const r=r0(e);if(!r)return null;const{server:s,method:o}=r;if(!o)return null;const a=Gj(s);return{emoji:(a==null?void 0:a.emoji)??"🔌",label:o,category:"mcp",detail:a?`${a.name} · ${o}`:`${s} · ${o}`}}function g3(e,t){return l3(e,t)??h3(e,t)??m3(e)}const n1=V$;function Yj(e){const t=r0(e);if(t){const s=Gj(t.server);return s?{emoji:s.emoji,label:s.name}:{emoji:"🔌",label:t.server,hue:p3(t.server)}}const r=Object.hasOwn(n1,e)?n1[e]:"";return r?{emoji:Q_(e),label:r}:{emoji:Q_(e),label:e}}function v3(e){let t=null,r="";for(const s of e){const o=r0(s);if(o){if(!o.server)return null;if(t===null)t=o.server,r=s;else if(o.server!==t)return null}}return t===null?null:Yj(r)}function y3(e){return e.endedAt==null?"inflight":e.ok===!1?"err":"done"}function w3(e,t,r){if(r==null)return 1;const s=t-r;return s<0?1:Math.max(0,1-s/Wj)}function x3(e,t){const r=[],s=new Set;for(let o=e.length-1;o>=0&&r.length<t;o--){const a=e[o];s.has(a.id)||(s.add(a.id),r.push(a))}return r.reverse()}function _3(e,t,r,s,o,a){const u=[];for(const c of e.values()){if(!t.has(c.id)||c.exitAt!=null&&a-c.exitAt>Wj)continue;const f=s.get(c.id)??r.get(c.id);if(!f)continue;const p=x3(c.tools,J$);if(p.length===0)continue;const d=c.exitAt??null,g=o.get(c.id),y=Math.max((g==null?void 0:g.width)??Y_,Y_),w=(g==null?void 0:g.height)??130,S=f.x,_=f.y,b=S+y,k=_+w/2;p.forEach((E,C)=>{const T=C*e3,A=S+y+t3,L=_+n3+T,P=w3(E,a,d),U=E.inputPreview??"",O=y3(E),M=P<.999,q=Yj(E.name);u.push({id:`${c.id}::${E.id}`,toolId:E.id,agentId:c.id,toolName:E.name,name:q.label,emoji:q.emoji,status:O,category:Hj(E.name),mcpHue:q.hue,inputPreview:U,fade:P,fading:M,worldX:A,worldY:L,anchorX:b,anchorY:k,spawnDx:b-A,spawnDy:k-(L+_y)});const V=g3(E.name,E.input);if(V){const X=a3(E.name,q.label),j=A+X+r3,G=L,B=A+X,te=L+_y;u.push({id:`sub:${c.id}::${E.id}`,toolId:E.id,agentId:c.id,toolName:E.name,name:V.label,emoji:V.emoji,isSub:!0,status:O,category:V.category,inputPreview:V.detail??U,fade:P,fading:M,worldX:j,worldY:G,anchorX:B,anchorY:te,spawnDx:B-j,spawnDy:0})}})}return u}function b3({agents:e,visibleAgentIds:t,positions:r,pinned:s,measured:o,spotlight:a,hiddenCategories:u,now:c,onOpenTool:f}){const p=_3(e,t,r,s,o,c),d=u&&u.size>0?p.filter(g=>!u.has(g.category)):p;return m.jsx(k3,{bursts:d,spotlight:a,onOpenTool:f})}function k3({bursts:e,spotlight:t,onOpenTool:r}){const{x:s,y:o,zoom:a}=Sj();return m.jsxs("div",{className:"tool-bursts-layer","aria-hidden":!0,children:[m.jsx("svg",{className:"tool-bursts-svg",children:e.map(u=>{const c=u.anchorX*a+s,f=u.anchorY*a+o,p=(u.worldX+6)*a+s,d=(u.worldY+_y)*a+o,g=c+(p-c)*.55,y=t!=null&&!t.has(u.agentId),w=u.fade*(y?.14:1);return m.jsx("path",{d:`M ${c} ${f} Q ${g} ${f}, ${p} ${d}`,className:`tool-conn status-${u.status}${u.fading?" fading":""}`,opacity:w},`l:${u.id}`)})}),e.map(u=>{const c=u.worldX*a+s,f=u.worldY*a+o,p={left:`${c}px`,top:`${f}px`,transform:`scale(${a})`,transformOrigin:"left top","--spawn-dx":`${u.spawnDx}px`,"--spawn-dy":`${u.spawnDy}px`},d=u.isSub?`${u.toolName} · ${u.name}`:u.toolName,g=u.inputPreview?`${d} · ${u.inputPreview}`:d,y=r!=null,w=u.mcpHue!=null?{"--mcp-hue":u.mcpHue}:{},_=t!=null&&!t.has(u.agentId)?" dim":"";return m.jsx("div",{className:"tool-burst-wrap",style:p,children:m.jsxs("div",{className:`tool-burst cat-${u.category}${u.mcpHue!=null?" mcp-hue":""} status-${u.status}${u.fading?" fading":""}${y?" clickable":""}${u.isSub?" sub":""}${_}`,style:w,title:g,onClick:y?()=>r(u.toolId):void 0,children:[m.jsx("span",{className:"tb-emoji",children:u.emoji}),m.jsx("span",{className:"tb-name",children:u.name}),u.status==="inflight"&&m.jsx("span",{className:"tb-spin"}),u.status==="done"&&m.jsx("span",{className:"tb-mark done",children:"✓"}),u.status==="err"&&m.jsx("span",{className:"tb-mark err",children:"×"})]})},u.id)})]})}function Kj(e){const t={input:0,output:0,cacheRead:0,cacheWrite:0,total:0};let r=0,s=0,o=0,a=0;for(const u of e){const c=vn(u);t.input+=c.input,t.output+=c.output,t.cacheRead+=c.cacheRead,t.cacheWrite+=c.cacheWrite,t.total+=c.total,r+=u.usage.inputTokens,s+=u.usage.outputTokens,o+=u.usage.cacheReadTokens,a+=u.usage.cacheCreateTokens}return{cost:t,inputTokens:r,outputTokens:s,cacheReadTokens:o,cacheCreateTokens:a,sum:r+s}}const S3="spend on this board",E3="on this board",N3="board tokens",C3="board cost",ic=`Everything on the board right now, and only that.
|
|
71
71
|
Finished sessions are evicted from the canvas a couple of minutes after they end, and their tokens and dollars leave with them — so this figure falls on its own.
|
|
72
|
-
Press H for the totals ccusage reads off the logs on disk, which do not forget.`,
|
|
73
|
-
Blocked since ${new Date(f.waiting.since).toLocaleTimeString()} · started ${new Date(f.startedAt).toLocaleString()}`,children:["waiting ",r1(f.waiting.since,void 0,t)]}):m.jsx("span",{className:"sl-elapsed",title:`Started ${new Date(f.startedAt).toLocaleString()}`,children:r1(f.startedAt,f.state==="active"?void 0:f.lastActivity,t)})]})]})]},f.sessionId)})]})]})}const Yt="ccdeck";function Xj(e){const t=Math.max(0,e);return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function by(e){return Xj(Math.floor(e/1e3))}function Qj(e,t){const r=e-t;if(r<=0)return null;const s=Math.floor(r/86400),o=Math.floor(r%86400/3600),a=Math.floor(r%3600/60);return s>0?`${s}d ${o}h`:o>0?`${o}h ${a}m`:`${a}m`}function O3(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function P3(e,t,r){const s=new Date(e),o=by(t-e);return{label:O3(s,new Date(t))?o:`${o} · ${s.toLocaleDateString(r,{month:"short",day:"numeric"})}`,title:s.toLocaleString(r,{dateStyle:"medium",timeStyle:"medium"})}}function Zj(e,t){return{disabled:e!=null&&e!==t,busy:e===t}}function Jj(e){return e==null}const ky="self";function Wr(e,t=!1){const r=Zj(e?ky:null,ky);return{disabled:t||r.disabled,"aria-busy":r.busy}}function js(e){return Jj(e?ky:null)}function L3(e){return[...e==null?[]:[`#ap-more-${e}`],".accounts-panel .ap-refresh"]}function $3(e){return e==null||e==="BODY"||e==="HTML"}function s1(e,t){if(!e)return null;const r=t-Math.floor(e/1e3);return r<10?"just now":r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:`${Math.floor(r/3600)}h ago`}function q3(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"}const Tf="__unknown__";function D3(e,t,r,s){const o=Math.max(0,t-s),a=Math.max(0,r-o);if(a<120)return null;const u=Math.min(100,a/r*100),c=e-u;if(Math.abs(c)<3)return{label:"on pace",color:"var(--ok)",expectedPct:u,isDeficit:!1};if(c>0){const f=100-e,p=a>0?e/a:0,d=p>0?f/p:1/0,g={label:`${Math.round(c)}% ahead`,color:"var(--warn)",expectedPct:u,isDeficit:!0};if(d<o&&d<86400){const y=Math.floor(d/3600),w=Math.floor(d%3600/60);g.runsOutIn=y>0?`${y}h ${w}m`:`${w}m`}return g}return{label:`${Math.round(-c)}% reserve`,color:"var(--ok)",expectedPct:u,isDeficit:!1}}function ei({pct:e,label:t,reset:r,resetAt:s,windowSec:o,limitReached:a,nowSec:u}){const c=Math.min(100,Math.max(0,e)),p=a||c>=90?"var(--err)":c>=70?"var(--warn)":"var(--accent)",d=c===0?"< 1%":`${c}%`,g=c===0?2:c,y=s?Qj(s,u):null,w=s&&o?D3(c,s,o,u):null;return m.jsxs("div",{className:"qb-row",children:[m.jsxs("div",{className:"qb-meta",children:[m.jsxs("span",{className:"qb-label",children:[t,a&&m.jsx("span",{className:"qb-limit-badge",title:"Rate limit reached",children:"⛔"})]}),m.jsx("span",{className:"qb-pct",style:{color:p},children:d})]}),m.jsxs("div",{className:"qb-track",children:[m.jsx("div",{className:"qb-fill",style:{width:`${g}%`,background:p,opacity:c===0?.4:1}}),w&&m.jsx("div",{className:"qb-pace-marker",style:{left:`${w.expectedPct}%`,background:w.isDeficit?"var(--err)":"var(--ok)"},title:`To last until reset, stay near ${Math.round(w.expectedPct)}% by now`})]}),m.jsxs("div",{className:"qb-reset-row",children:[y?m.jsxs("span",{className:"qb-reset",children:["resets in ",y]}):r?m.jsxs("span",{className:"qb-reset",children:["resets ",r]}):null,w&&m.jsx("span",{className:"qb-pace",style:{color:w.color},children:w.runsOutIn?`runs out in ${w.runsOutIn}`:w.label})]})]})}const F3=6e4;function z3(e){const[t,r]=N.useState(null),[s,o]=N.useState(!1),a=N.useRef(null),u=N.useRef(!1),c=async(p=!1)=>{if(!(p&&!js(u.current))){p&&(u.current=!0,o(!0));try{const g=await fetch(p?"/api/quota?refresh=1":"/api/quota");g.ok&&r(await g.json())}catch{}finally{p&&(u.current=!1,o(!1))}}};return N.useEffect(()=>{if(e)return c(!0),a.current=window.setInterval(()=>c(!1),F3),()=>{a.current!=null&&window.clearInterval(a.current)}},[e]),{quota:t,loading:s,refresh:()=>{e&&c(!0)}}}function B3(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.";case"untrusted_base_url":return"chatgpt_base_url in ~/.codex/config.toml is not an https OpenAI host, so the token was not sent.";default:return"ChatGPT API unreachable — click ↻ to retry."}}const eT=6e4;function U3(e){const[t,r]=N.useState(null),[s,o]=N.useState(!1),a=N.useRef(null),u=N.useRef(!1),c=async(p=!1)=>{if(!(p&&!js(u.current))){p&&(u.current=!0,o(!0));try{const g=await fetch(p?"/api/codex-quota?refresh=1":"/api/codex-quota");g.ok&&r(await g.json())}catch{}finally{p&&(u.current=!1,o(!1))}}};return N.useEffect(()=>{if(e)return c(!0),a.current=window.setInterval(()=>c(!1),eT),()=>{a.current!=null&&window.clearInterval(a.current)}},[e]),{data:t,loading:s,refresh:()=>{e&&c(!0)}}}function H3(e){const[t,r]=N.useState(null),s=N.useRef(null),o=async()=>{try{const a=await fetch("/api/codex-usage");a.ok&&r(await a.json())}catch{}};return N.useEffect(()=>{if(e)return o(),s.current=window.setInterval(o,eT),()=>{s.current!=null&&window.clearInterval(s.current)}},[e]),{data:t}}function W3({state:e,now:t,providers:r,onClose:s}){var V,X;const{quota:o,loading:a,refresh:u}=z3(r.claude),{data:c,loading:f,refresh:p}=U3(r.codex),{data:d}=H3(r.codex),[g,y]=N.useState(()=>Math.floor(Date.now()/1e3));N.useEffect(()=>{const j=window.setInterval(()=>y(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(j)},[]);const{byModel:w,totalCost:S,totalTokens:_,burnRate:b}=N.useMemo(()=>{const j=new Map;for(const H of e.agents.values())for(const I of nl(H)){const Y=I.model??Tf,ce=Jy(I.usage,I.model),z=j.get(Y);z?(z.inputTokens+=I.usage.inputTokens,z.outputTokens+=I.usage.outputTokens,z.cacheReadTokens+=I.usage.cacheReadTokens,z.cacheCreateTokens+=I.usage.cacheCreateTokens,z.cost.total+=ce.total,z.cost.input+=ce.input,z.cost.output+=ce.output,z.cost.cacheRead+=ce.cacheRead,z.cost.cacheWrite+=ce.cacheWrite,z.agentCount++):j.set(Y,{model:Y,inputTokens:I.usage.inputTokens,outputTokens:I.usage.outputTokens,cacheReadTokens:I.usage.cacheReadTokens,cacheCreateTokens:I.usage.cacheCreateTokens,cost:{...ce},agentCount:1,priced:ko(I.model)!=null})}const G=Array.from(j.values()).sort((H,I)=>I.cost.total-H.cost.total||I.inputTokens+I.outputTokens-(H.inputTokens+H.outputTokens));let B=0,te=0;for(const H of e.agents.values()){if(H.state!=="active")continue;const I=vn(H);B+=I.total,te=Math.max(te,((H.endedAt??t)-H.startedAt)/1e3)}const Z=te>0?rc(B,te):null,$=Yj(e.agents.values());return{byModel:G,totalCost:$.cost,totalTokens:$,burnRate:Z}},[e,e.revision,t]),k=N.useMemo(()=>{const j=[];for(const G of e.agents.values()){if(G.kind!=="root")continue;let B=vn(G).total,te=G.usage.inputTokens,Z=G.usage.outputTokens,$=wy(G);for(const H of e.agents.values())H.sessionId!==G.sessionId||H.kind==="root"||(B+=vn(H).total,te+=H.usage.inputTokens,Z+=H.usage.outputTokens,$+=wy(H));j.push({sessionId:G.sessionId,label:G.label||G.cwdBasename||"session",state:G.state,cost:B,inputTokens:te,outputTokens:Z,unpricedTokens:$})}return j.sort((G,B)=>B.cost-G.cost||B.inputTokens+B.outputTokens-(G.inputTokens+G.outputTokens)).slice(0,12)},[e,e.revision]),E=S.total>0,C=_.sum,T=w.filter(j=>j.cost.total>0||j.inputTokens+j.outputTokens>0),A=k.filter(j=>j.cost>0||j.inputTokens+j.outputTokens>0),L=T.some(j=>!j.priced),P=a||f,U=s1(o==null?void 0:o.fetchedAt,g),O=s1(c==null?void 0:c.fetchedAt,g),M=()=>{u(),p()},q=r.claude&&r.codex?"Refresh Claude + Codex quota":r.codex?"Refresh Codex quota":"Refresh Claude quota";return m.jsxs("aside",{className:"usage-panel",id:"usage-panel","aria-label":"Usage",children:[m.jsxs("div",{className:"up-header",children:[m.jsx("h2",{children:"Usage"}),b&&m.jsx("span",{className:"up-rate",children:b}),m.jsxs("div",{className:"up-header-right",children:[(r.claude||r.codex)&&m.jsx("button",{type:"button",className:"glyph-btn up-refresh-btn",onClick:M,...Wr(P),"aria-label":q,title:q,children:P?"…":"↻"}),m.jsx("button",{type:"button",className:"glyph-btn up-close",onClick:s,"aria-label":"Close usage panel",title:"Close (U)",children:"×"})]})]}),r.claude&&m.jsxs("section",{className:"up-section up-quota-section",children:[m.jsxs("h3",{className:"up-section-title",children:["Claude quota",U&&!a&&m.jsx("span",{className:"up-section-age",title:q3(o==null?void 0:o.source),children:U})]}),o!=null&&o.ok?m.jsxs("div",{className:"up-quota-bars",children:[o.session5hPct!=null&&m.jsx(ei,{label:"5-hour window",pct:o.session5hPct,reset:o.session5hReset,resetAt:o.session5hResetAt,windowSec:o.session5hWindowSec,nowSec:g}),o.week7dPct!=null&&m.jsx(ei,{label:"7-day window",pct:o.week7dPct,reset:o.week7dReset,resetAt:o.week7dResetAt,windowSec:o.week7dWindowSec,nowSec:g}),o.weekSonnetPct!=null&&m.jsx(ei,{label:"Sonnet (7d)",pct:o.weekSonnetPct,nowSec:g}),o.weekOpusPct!=null&&m.jsx(ei,{label:"Opus (7d)",pct:o.weekOpusPct,nowSec:g})]}):(o==null?void 0:o.ok)===!1?m.jsxs("div",{className:"up-quota-na",children:[m.jsx("span",{children:"Quota unavailable."}),m.jsxs("span",{className:"up-quota-hint",children:["Run ",m.jsx("code",{children:"/usage"})," in a claude session, then click ↻"]})]}):m.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),r.codex&&m.jsxs("section",{className:"up-section up-quota-section",children:[m.jsxs("h3",{className:"up-section-title",children:["Codex quota",(c==null?void 0:c.ok)&&c.planLabel&&m.jsx("span",{className:"up-plan-badge",children:c.planLabel}),O&&!f&&m.jsx("span",{className:"up-section-age",title:"Fetched from the Codex usage endpoint",children:O})]}),c!=null&&c.ok?m.jsxs("div",{className:"up-quota-bars",children:[(V=c.windows)==null?void 0:V.map(j=>m.jsx(ei,{label:j.label,pct:j.pct,reset:j.reset??void 0,resetAt:j.resetAt??void 0,windowSec:j.windowSec??void 0,limitReached:c.limitReached&&j.pct>=100,nowSec:g},j.id)),(X=c.extraWindows)==null?void 0:X.map(j=>m.jsx(ei,{label:j.label,pct:j.pct,reset:j.reset??void 0,resetAt:j.resetAt??void 0,windowSec:j.windowSec??void 0,nowSec:g},j.id)),c.creditLimit&&m.jsx(ei,{label:`spend cap · $${Math.round(c.creditLimit.used)} of $${Math.round(c.creditLimit.limit)}`,pct:c.creditLimit.usedPct,reset:c.creditLimit.reset??void 0,resetAt:c.creditLimit.resetAt??void 0,limitReached:c.spendControlReached,nowSec:g}),c.creditsBalance&&!c.creditsUnlimited&&m.jsxs("div",{className:"up-quota-sub up-credits",children:["credits: $",c.creditsBalance,c.overageReached&&" · overage limit reached"]}),c.creditsUnlimited&&m.jsx("div",{className:"up-quota-sub up-credits",children:"credits: unlimited"}),c.resetCredits&&c.resetCredits.availableCount>0&&m.jsxs("div",{className:"up-quota-sub up-reset-credits",title:`Redeem in the Codex CLI or ChatGPT — ${Yt} only reports them`,children:[c.resetCredits.availableCount," rate-limit reset",c.resetCredits.availableCount!==1?"s":""," available",c.resetCredits.nextExpiryAt&&` · expires ${new Date(c.resetCredits.nextExpiryAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}`]}),c.promo&&m.jsx("div",{className:"up-quota-sub",children:c.promo}),c.partial&&m.jsx("div",{className:"up-quota-sub up-quota-hint",children:"Partial data — OpenAI returned limits this build doesn't recognise."})]}):(c==null?void 0:c.ok)===!1?m.jsxs("div",{className:"up-quota-na",children:[m.jsx("span",{children:"Quota unavailable."}),m.jsx("span",{className:"up-quota-hint",children:B3(c.reason)})]}):m.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"}),(d==null?void 0:d.ok)&&d.window7d&&d.window7d.sessionCount>0&&m.jsxs("div",{className:"up-quota-sub",title:`Counted from the rollout files under CODEX_HOME — no network, no account${d.window5h?`
|
|
74
|
-
last 5h: ${At(d.window5h.totalTokens)} tokens · ${d.window5h.sessionCount} session${d.window5h.sessionCount!==1?"s":""}`:""}`,children:[At(d.window7d.totalTokens)," tokens · ",d.window7d.sessionCount," session",d.window7d.sessionCount!==1?"s":""," (7d)"]})]}),C>0?m.jsxs(m.Fragment,{children:[E&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"up-total",title:ic,children:[m.jsx("span",{className:"up-total-value",children:Ge(S.total)}),m.jsx("span",{className:"up-total-label",children:S3})]}),m.jsx(s0,{cost:S})]}),m.jsxs("div",{className:"up-tokens-row",title:ic,children:[m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"in"}),At(_.inputTokens)]}),m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"out"}),At(_.outputTokens)]}),_.cacheReadTokens>0&&m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"cache r"}),At(_.cacheReadTokens)]}),_.cacheCreateTokens>0&&m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"cache c"}),At(_.cacheCreateTokens)]}),!E&&m.jsx("span",{className:"up-tok up-scope",children:E3})]}),T.length>0&&m.jsxs("section",{className:"up-section",children:[m.jsx("h3",{className:"up-section-title",children:"By model"}),m.jsxs("table",{className:"up-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Model"}),m.jsx("th",{children:"Tokens"}),m.jsx("th",{children:"Cost"})]})}),m.jsx("tbody",{children:T.map(j=>m.jsxs("tr",{children:[m.jsx("td",{className:"up-model-name",title:j.model===Tf?"no model reported yet":j.model,children:j.model===Tf?"unknown":li(j.model)}),m.jsx("td",{className:"up-num",children:At(j.inputTokens+j.outputTokens)}),j.priced?m.jsx("td",{className:"up-num up-cost-val",children:Ge(j.cost.total)}):m.jsx("td",{className:"up-num up-unpriced",children:Wu})]},j.model))})]})]}),A.length>0&&m.jsxs("section",{className:"up-section",children:[m.jsx("h3",{className:"up-section-title",children:"By session"}),m.jsx("div",{className:"up-sessions",children:A.map(j=>m.jsxs("div",{className:"up-session-row",children:[m.jsx("span",{className:`sl-dot state-${j.state}`,"aria-hidden":!0}),m.jsx("span",{className:"vis-hidden",children:n0(j.state)}),m.jsx("span",{className:"up-session-label",children:j.label}),m.jsx("span",{className:"up-session-tokens",children:At(j.inputTokens+j.outputTokens)}),j.cost>0?m.jsxs("span",{className:"up-session-cost",title:j.unpricedTokens>0?`${At(j.unpricedTokens)} tokens in this session are on an unpriced model, so this is a floor`:void 0,children:[Ge(j.cost),j.unpricedTokens>0?"+":""]}):m.jsx("span",{className:"up-session-cost up-unpriced",children:Wu})]},j.sessionId))})]}),L&&m.jsxs("div",{className:"up-hint",children:["“",Wu,"” means this build holds no published rate for that model — those tokens are counted above and their dollars are not."]})]}):m.jsxs("div",{className:"up-empty",children:["No usage data yet.",m.jsx("br",{}),"Start a Claude Code or Codex session."]})]})}const V3="1",
|
|
75
|
-
`);return m.jsxs("span",{className:"sysmeter-wrap",children:[m.jsxs("button",{type:"button",ref:o,className:"sysmeter",title:_,"aria-label":"Toggle machine detail","aria-expanded":r,"aria-controls":r?"system-panel":void 0,onClick:()=>s(b=>!b),children:[m.jsxs("span",{className:"sm-box","aria-hidden":!0,children:[m.jsxs("span",{className:"sm-graphic",children:[m.jsx("svg",{className:"sm-spark",width:Na,height:oo,viewBox:`0 0 ${Na} ${oo}`,children:y.map((b,k)=>{const E=w+k,C=Math.max(1,b/100*oo),T=.32+.68*((k+1)/y.length);return m.jsx("rect",{x:E*S,y:oo-C,width:Math.max(.8,S-.7),height:C,rx:.5,fill:"var(--accent)",opacity:T},E)})}),m.jsx("span",{className:"sm-ram",children:m.jsx("span",{className:`sm-ram-fill${g?" warn":""}`,style:{transform:`scaleX(${Math.max(2,p.usedPct)/100})`}})})]}),m.jsxs("span",{className:"sm-read",children:[m.jsx("b",{children:u.toFixed(0)}),m.jsx("i",{children:"·"}),m.jsx("b",{children:p.usedPct.toFixed(0)})]})]}),m.jsxs("span",{className:"sm-sr",children:["CPU ",u.toFixed(0)," percent, memory ",p.usedPct.toFixed(0)," percent used"]})]}),r&&m.jsx(rq,{sys:t,usageOpen:e,panelRef:a,onClose:()=>{var b;s(!1),(b=o.current)==null||b.focus()}})]})}function rq({sys:e,usageOpen:t,panelRef:r,onClose:s}){const o=tq(!0),{memory:a,swap:u,perCore:c,loadavg:f,cores:p,uptimeSec:d,platform:g}=e,y=a?a.total-a.available:0,w=g==="win32"?"Commit":"Swap",S=u&&u.total>0?u.used/u.total*100:0;return m.jsxs("aside",{ref:r,className:`sysdetail${t?" shifted":""}`,id:"system-panel","aria-label":"Machine detail",children:[m.jsxs("div",{className:"sd-head",children:[m.jsx("span",{className:"sd-title",children:"This machine"}),m.jsxs("span",{className:"sd-sub",children:["up ",J3(d)," · ",p," cores"]}),m.jsx("button",{type:"button",className:"glyph-btn sd-close",onClick:s,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]}),c&&c.length>0&&m.jsxs("div",{className:"sd-section",role:"group","aria-label":"Cores",children:[m.jsx("div",{className:"sd-h","aria-hidden":!0,children:"Cores"}),m.jsx("div",{className:"sd-cores",style:{"--n":c.length},children:c.map((_,b)=>m.jsx("span",{className:"sd-core",title:`core ${b+1}: ${_}%`,children:m.jsx("span",{className:"sd-core-fill",style:{transform:`scaleY(${Math.max(2,_)/100})`}})},b))})]}),m.jsxs("div",{className:"sd-section",role:"group","aria-label":"Memory",children:[m.jsx("div",{className:"sd-h","aria-hidden":!0,children:"Memory"}),a&&m.jsx(o1,{label:"Physical",used:y,total:a.total,pct:a.usedPct,note:`${Ba(a.available)} available`}),u&&u.total>0&&m.jsx(o1,{label:w,used:u.used,total:u.total,pct:S,note:S>=50?"paging to disk":void 0})]}),f&&m.jsxs("div",{className:"sd-section",role:"group","aria-label":"Load average",children:[m.jsx("div",{className:"sd-h","aria-hidden":!0,children:"Load average"}),m.jsx("div",{className:"sd-load",children:f.map((_,b)=>m.jsxs("span",{className:`sd-load-item${_>p?" over":""}`,children:[m.jsx("b",{children:_.toFixed(2)}),m.jsx("span",{children:["1m","5m","15m"][b]})]},b))}),m.jsx("div",{className:"sd-note",children:f[0]>p?`${(f[0]/p).toFixed(1)}× more work queued than cores to run it`:`within ${p} cores`})]}),m.jsxs("div",{className:"sd-section",role:"group","aria-label":"Busiest processes",children:[m.jsx("div",{className:"sd-h","aria-hidden":!0,children:"Busiest processes"}),o==null?m.jsx("div",{className:"sd-note",children:"reading…"}):o.length===0?m.jsx("div",{className:"sd-note",children:"Could not read the process list on this platform."}):m.jsxs("table",{className:"sd-procs",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"cpu"}),m.jsx("th",{children:"mem"}),m.jsx("th",{children:"process"})]})}),m.jsx("tbody",{children:o.map(_=>m.jsxs("tr",{children:[m.jsx("td",{className:"sd-num",children:_.cpu==null?"—":_.cpu.toFixed(0)}),m.jsx("td",{className:"sd-num sd-dim",children:_.mem.toFixed(1)}),m.jsx("td",{className:"sd-proc-name",title:`pid ${_.pid}`,children:_.name})]},_.pid))})]})]})]})}function o1({label:e,used:t,total:r,pct:s,note:o}){const a=s>=90;return m.jsxs("div",{className:"sd-row",children:[m.jsxs("div",{className:"sd-row-head",children:[m.jsx("span",{className:"sd-row-label",children:e}),m.jsxs("span",{className:"sd-row-val",children:[m.jsx("b",{children:Ba(t)})," of ",Ba(r)]})]}),m.jsx("span",{className:"sd-track",children:m.jsx("span",{className:`sd-fill${a?" warn":""}`,style:{transform:`scaleX(${Math.max(1,Math.min(100,s))/100})`}})}),o&&m.jsx("div",{className:"sd-note",children:o})]})}const a1=18,sq=1100,ao=(e,t)=>{const r=Math.sin(e*12.9898+t*78.233)*43758.5453;return r-Math.floor(r)},iq=Array.from({length:a1},(e,t)=>{const r=-72+144*t/(a1-1)+(ao(t,1)-.5)*9,s=(r-90)*(Math.PI/180),o=(54+32*Math.cos(r*Math.PI/180))*(.74+ao(t,2)*.52);return{dx:Math.cos(s)*o,dy:Math.sin(s)*o,rot:(t%2?1:-1)*(100+ao(t,3)*260),delay:Math.round(ao(t,4)*90),dur:760+Math.round(ao(t,5)*260),scale:.8+ao(t,6)*.45,hue:t%4,round:t%3===0}});function l1({anchor:e,lifetimeMs:t=sq}){var a;const[r,s]=N.useState(null),o=typeof window<"u"&&((a=window.matchMedia)==null?void 0:a.call(window,"(prefers-reduced-motion: reduce)").matches);return N.useEffect(()=>{if(o)return;const u=e.current;if(!u)return;const c=u.getBoundingClientRect();s({x:c.left+c.width/2,y:c.top+c.height/2});const f=window.setTimeout(()=>s(null),t);return()=>window.clearTimeout(f)},[e,t,o]),o||!r?null:fO.createPortal(m.jsx("div",{className:"confetti",style:{left:`${r.x}px`,top:`${r.y}px`},"aria-hidden":!0,children:iq.map((u,c)=>m.jsx("span",{className:`confetti-bit${u.round?" round":""}`,"data-hue":u.hue,style:{"--dx":`${u.dx.toFixed(1)}px`,"--dy":`${u.dy.toFixed(1)}px`,"--rot":`${u.rot}deg`,"--s":u.scale.toFixed(2),animationDelay:`${u.delay}ms`,animationDuration:`${u.dur}ms, ${u.dur}ms`}},c))}),document.body)}const nT=new Set(["awaiting_url","awaiting_code","registering"]);function oq(e){return e!=null&&nT.has(e)}function rT(e){return e!=null&&e!=="done"&&!nT.has(e)}const aq="the sign-in ended before it finished — the deck restarted, or it was cancelled in another tab",lq="the sign-in did not complete";function uq({state:e,serverError:t,localError:r}){const s=e==="idle";return{title:s?"Sign-in ended":"Sign-in failed",message:r||t||(s?aq:lq)}}const cq="done";function dq(){let e=!1;return{shouldAnnounce(t){return t!==cq?(e=!1,!1):e?!1:(e=!0,!0)}}}function o0(e,t){return t&&Object.hasOwn(e,t)?e[t]:void 0}const fq={already_running:"a sign-in is already in progress",no_url:"the claude CLI did not offer a sign-in link — is it installed?",not_waiting:"that sign-in is no longer waiting for a code",not_prompted:"the CLI has not asked for a code yet",code_rejected:"that code was not accepted — copy it again from the browser",no_verdict:"the claude CLI has not answered — try the code again",empty_code:"paste the code from the browser first",login_failed:"the code was not accepted",no_identity:"signed in, but the CLI still reports nobody logged in",add_failed:"signed in, but claude-swap could not record the account",not_a_share:"that does not look like a shared account — it should start with ccdeck1:",corrupt:"that share is incomplete — copy the whole thing",wrong_version:`that share was made by a newer ${Yt}`,expired:"that share has expired — make a new one",import_failed:"claude-swap refused the import",bad_value:"an alias can only use letters, numbers, spaces, dots, dashes and underscores, up to 64 characters, and cannot start with a dash",bad_email:"that does not look like an email address — it cannot contain spaces or start with a dash"},hq={no_cswap:"claude-swap could not be run — it is not on this deck's PATH. Set AGENTS_DECK_CSWAP to its full path",timeout:"claude-swap took too long and was stopped — try again",switch_failed:"claude-swap refused the switch",bad_account:"that is not an account claude-swap has",unknown_setting:"claude-swap has no such setting",out_of_range:"that value is outside what the setting allows",bad_value:"claude-swap does not accept that value",set_failed:"claude-swap refused the change",command_failed:"claude-swap refused the command"},pq=`claude-swap could not read the login keychain — start ${Yt} from a Terminal window rather than a background service`;function Sy(e,t){if((e==null?void 0:e.reason)!=="no_cswap"&&/keychain/i.test(xo(e)))return pq;const r=o0(hq,e==null?void 0:e.reason);return r||(e==null?void 0:e.reason)||t}function xo(e){return((e==null?void 0:e.output)||(e==null?void 0:e.detail)||(e==null?void 0:e.error)||"").trim()}const mq={no_install:"ccusage is not installed, and AGENTS_DECK_NO_INSTALL=1 forbids fetching it — unset that variable and restart the deck, or install ccusage yourself so it is on this deck's PATH",bad_override:"AGENTS_DECK_CCUSAGE names a file that is not there — correct it to the full path of your ccusage, or unset it to let the deck find its own",timeout:"ccusage took more than 90 seconds and was stopped — a narrower range usually finishes",bad_output:"ccusage ran but printed no usage data — try again, and run ccusage daily --json in a terminal if it keeps happening",run_failed:"ccusage could not report usage — try again",bad_range:"that date range is not a YYYYMMDD date — reopen the modal and pick one of the presets",unreachable:"the deck did not answer — check it is still running, then try again"},gq="ccusage could not be started — npx is not on this deck's PATH. Install Node's npm/npx, or put ccusage on PATH yourself";function vq(e){return/\bnpx\b/i.test(e)&&/(command not found|not found|not recognized|ENOENT)/i.test(e)}const yq="ccusage could not be started — the deck launched npx and Node could not load the npm script it points at. An older deck asked cmd.exe for a bare npx.cmd, which made the shim look for that script under the deck's working directory instead of beside itself; update the deck and reopen this modal",wq="ccusage could not be started — the copy npx fetched will not load: Node could not resolve a file inside it. That copy is in npx's own cache, which the deck never rewrites, so clear it with `npm cache clean --force` and reopen this modal",xq=e=>/\b(?:ERR_)?MODULE_NOT_FOUND\b|cannot find (?:module|package)/i.test(e),_q=/node_modules[\\/]npm[\\/]bin[\\/]|\bnpm-prefix\.js\b|\bnp[mx][-.][\w.-]*cli\.js\b/i,bq=/[\\/]_npx[\\/]/i,kq=`the copy of ccusage ${Yt} installed for itself`;function Sq(e){const t=String((e==null?void 0:e.install)??"").replace(/\s+/g," ").trim();return t.length>240?`${t.slice(0,239)}…`:t}function Eq(e,t){const r=Nq(e,t),s=Sq(e);switch(e==null?void 0:e.stage){case"npx":return s?`ccusage failed on both of its paths. The managed install failed first — ${s} — and the deck then fell back to npx, where ${Ca(r)}`:`there is no managed copy of ccusage on this machine, and the npx fallback failed: ${Ca(r)}`;case"managed":return`${kq} failed to run: ${Ca(r)}`;case"path":return e.bin?`the ccusage this deck found at ${e.bin} failed to run: ${Ca(r)}`:`the ccusage this deck found on your PATH failed to run: ${Ca(r)}`;default:return r}}const Ca=e=>/^[A-Z][a-z]/.test(e)?e[0].toLowerCase()+e.slice(1):e;function Nq(e,t){const r=xo(e);if(xq(r)){if(bq.test(r))return wq;if(_q.test(r))return yq}if(vq(r))return gq;const s=o0(mq,e==null?void 0:e.reason);return s||(e==null?void 0:e.reason)||t}function Vu(e,t){if(e!=null&&e.detail)return e.detail;if(e!=null&&e.error&&rT(e.state))return e.error;const r=o0(fq,e==null?void 0:e.reason);return r||(e!=null&&e.error?e.error:(e==null?void 0:e.reason)||t)}function Cq(e,t,r){if(r<=0||e0(e))return{kind:"pass"};const s=t>=0&&t<r?t:-1;switch(e.key){case"ArrowRight":return{kind:"select",index:s===-1?0:(s+1)%r};case"ArrowLeft":return{kind:"select",index:s===-1?r-1:(s-1+r)%r};case"Home":return{kind:"select",index:0};case"End":return{kind:"select",index:r-1};default:return{kind:"pass"}}}const jq=1500,Ou=[{id:"login",label:"Sign in"},{id:"paste",label:"Paste a share"}],u1="aa-panel",c1=e=>`aa-tab-${e}`;async function Pu(e){return(await fetch("/api/claude-accounts/admin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json().catch(()=>null)}const Ey=ue.forwardRef((e,t)=>m.jsxs("svg",{className:"aa-mark",viewBox:"0 0 44 44","aria-hidden":!0,ref:t,children:[m.jsx("circle",{className:"aa-mark-ring",cx:"22",cy:"22",r:"20"}),m.jsx("path",{className:"aa-mark-tick",d:"M13.5 22.5 L19.5 28.5 L31 17"})]}));Ey.displayName="SuccessMark";function Tq({onClose:e,onChanged:t}){const[r,s]=N.useState("login"),[o,a]=N.useState(null),[u,c]=N.useState(""),[f,p]=N.useState(""),[d,g]=N.useState(!1),[y,w]=N.useState(null),[S,_]=N.useState(null),b=N.useRef(!1),k=N.useRef(!1),E=N.useRef(null),C=N.useRef(null),T=N.useRef(null),A=N.useRef(null),L=N.useRef([]),P=N.useRef(!1),U=N.useCallback(()=>{b.current&&Pu({action:"login-cancel"}).catch(()=>{}),e()},[e]),O=Kr(U,{focusRef:T}),M=N.useCallback(async()=>{if(!js(k.current))return;k.current=!0,g(!0),w(null),b.current=!0;const $=await Pu({action:"login"}).catch(()=>null);if(k.current=!1,g(!1),!($!=null&&$.ok)){w(Vu($,"could not start the sign-in"));return}a($)},[]);N.useEffect(()=>{if(!oq(o==null?void 0:o.state))return;const $=window.setInterval(async()=>{try{const H=await fetch("/api/claude-accounts/login");H.ok&&a(await H.json())}catch{}},jq);return()=>window.clearInterval($)},[o]);const q=N.useRef(t);q.current=t;const V=N.useState(dq)[0];N.useEffect(()=>{var $;(o==null?void 0:o.state)==="awaiting_code"&&(($=E.current)==null||$.focus()),V.shouldAnnounce(o==null?void 0:o.state)&&q.current()},[o==null?void 0:o.state,V]),N.useEffect(()=>{var $;r==="paste"&&!P.current&&(($=C.current)==null||$.focus()),P.current=!1},[r]);const X=N.useCallback($=>{var I;const H=Cq($,Ou.findIndex(Y=>Y.id===r),Ou.length);H.kind!=="pass"&&($.preventDefault(),P.current=!0,s(Ou[H.index].id),(I=L.current[H.index])==null||I.focus())},[r]),j=N.useCallback(async()=>{var H;if(!js(k.current))return;k.current=!0,g(!0),w(null);const $=await Pu({action:"login-code",code:u}).catch(()=>null);if(k.current=!1,g(!1),!($!=null&&$.ok)){w(Vu($,"the code was not accepted")),$!=null&&$.state&&a($),(H=E.current)==null||H.select();return}c(""),a($)},[u,o]),G=N.useCallback(async()=>{if(!js(k.current))return;k.current=!0,g(!0),w(null);const $=await Pu({action:"import",blob:f}).catch(()=>null);if(k.current=!1,g(!1),!($!=null&&$.ok)){w(Vu($,"the import failed"));return}p(""),_({added:$.added===!0,num:$.num??null,email:$.email??null}),t()},[f,t]),B=(o==null?void 0:o.state)==="done"?o.account:null,te=rT(o==null?void 0:o.state)||!!(y&&b.current&&!d),Z=uq({state:o==null?void 0:o.state,serverError:o==null?void 0:o.error,localError:y});return m.jsx("div",{className:"modal-backdrop",onClick:U,role:"presentation",children:m.jsxs("div",{ref:O,className:"modal aa-modal",onClick:$=>$.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Add a Claude account",children:[m.jsxs("header",{className:"modal-head",children:[m.jsx("div",{className:"modal-title",children:m.jsx("span",{className:"aa-tabs",role:"tablist","aria-label":"How to add the account",onKeyDown:X,children:Ou.map(($,H)=>m.jsx("button",{type:"button",role:"tab",id:c1($.id),ref:I=>{L.current[H]=I},"aria-selected":r===$.id,"aria-controls":u1,tabIndex:r===$.id?0:-1,className:`aa-tab${r===$.id?" on":""}`,onClick:()=>{P.current=!1,s($.id)},children:$.label},$.id))})}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"glyph-btn",onClick:U,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),m.jsx("section",{className:"modal-body aa-body",id:u1,role:"tabpanel","aria-labelledby":c1(r),children:r==="login"?B?m.jsxs("div",{className:"aa-done",children:[m.jsx(Ey,{ref:A}),m.jsx(l1,{anchor:A}),m.jsx("h4",{children:B.added?`Account ${B.num} added`:"Credentials refreshed"}),m.jsxs("p",{className:"aa-note",children:[m.jsx("strong",{children:B.email}),B.added?" is in the rotation. The account you were using is still active.":" was already managed, so its stored credentials were replaced."]}),m.jsx("button",{type:"button",className:"btn primary",onClick:e,children:"Done"})]}):(o==null?void 0:o.state)==="awaiting_code"||(o==null?void 0:o.state)==="registering"?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:"1 · Approve in the browser"}),m.jsx("p",{className:"aa-note",children:"A tab should have opened. If not, use this link:"}),m.jsx("a",{className:"aa-link",href:o.url??"#",target:"_blank",rel:"noreferrer noopener",children:o.url})]}),m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:"2 · Paste a code, if the page shows one"}),m.jsx("p",{className:"aa-note",children:"It usually finishes on its own — if the page says you are all set, there is nothing to do here."}),m.jsxs("div",{className:"aa-field",children:[m.jsx("input",{ref:E,type:"text",value:u,onChange:$=>c($.target.value),onKeyDown:$=>{$.key==="Enter"&&u.trim()&&!d&&j()},placeholder:"paste the code here",spellCheck:!1,autoComplete:"off","aria-label":"Sign-in code",disabled:o.state==="registering"}),m.jsx("button",{type:"button",className:"btn primary",...Wr(d,!u.trim()||o.state==="registering"),onClick:j,children:o.state==="registering"?"registering…":"Continue"})]}),(y||o.error)&&m.jsx("p",{className:"aa-err",children:y??o.error}),m.jsx("p",{className:"aa-note",children:"The code goes straight to the claude CLI on this machine. It is never stored or sent anywhere else."})]})]}):te?m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:Z.title}),m.jsx("p",{className:"aa-err",children:Z.message}),m.jsx("button",{type:"button",className:"btn",onClick:()=>{b.current=!1,a(null),w(null),M()},children:"Try again"})]}):d||b.current?m.jsx("div",{className:"aa-step",children:m.jsx("p",{className:"aa-note",children:"Asking the claude CLI for a sign-in link…"})}):m.jsxs("div",{className:"aa-step aa-primer",children:[m.jsx("h4",{children:"Sign in to Anthropic"}),m.jsx("p",{className:"aa-note",children:"Opens a browser tab where you approve the sign-in. It normally completes by itself; only if the page hands you a code does it need pasting back here. claude-swap records the account when it completes, and the account you are using now stays active."}),m.jsx("div",{className:"aa-actions",children:m.jsx("button",{type:"button",ref:T,className:"btn primary",onClick:M,children:"Open the sign-in page"})})]}):S?m.jsxs("div",{className:"aa-done",children:[m.jsx(Ey,{ref:A}),S.added&&m.jsx(l1,{anchor:A}),m.jsx("h4",{children:S.added?`Account ${S.num} imported`:"Already here"}),m.jsx("p",{className:"aa-note",children:S.added?m.jsxs(m.Fragment,{children:[S.email?m.jsx("strong",{children:S.email}):"That account"," is in the rotation now. Nothing changed on the deck you copied it from."]}):"This deck already holds that account, so nothing changed."}),m.jsxs("div",{className:"aa-actions",children:[m.jsx("button",{type:"button",className:"btn primary",onClick:e,children:"Done"}),m.jsx("button",{type:"button",className:"btn",onClick:()=>_(null),children:"Import another"})]})]}):m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:"Paste an account shared from another deck"}),m.jsxs("div",{className:"aa-field",children:[m.jsx("input",{ref:C,type:"text",value:f,onChange:$=>p($.target.value),onKeyDown:$=>{$.key==="Enter"&&f.trim()&&!d&&G()},placeholder:"ccdeck1:…",spellCheck:!1,autoComplete:"off","aria-label":"Shared account"}),m.jsx("button",{type:"button",className:"btn primary",...Wr(d,!f.trim()),onClick:G,children:d?"importing…":"Import"})]}),y&&m.jsx("p",{className:"aa-err",children:y}),m.jsxs("p",{className:"aa-note",children:["Use ",m.jsx("strong",{children:"share"})," on an account in the other deck. A share carries a live login and expires ten minutes after it is made."]})]})})]})})}function Rq(e,t){const r=new Set(e),s=e.length?Math.max(...e):0;return[...new Set([...e,s+1])].sort((o,a)=>o-a).map(o=>{const a=o===t?"here":r.has(o)?"swap":"free";return{slot:o,kind:a,label:a==="here"?`slot ${o}`:`slot ${o} · ${a}`}})}function Aq(e,t,r){if(!(r!=null&&r.ok))return null;const s=Number.isInteger(r.to)?r.to:null;if(s==null)return{menuFor:null,confirmRemove:null,shareFor:null,swapNote:null};const o=r.swapped===!0&&s!==t;return{menuFor:e.menuFor===t?s:o&&e.menuFor===s?t:e.menuFor,confirmRemove:null,shareFor:null,swapNote:o?{at:s,displaced:t}:null}}function Iq(e,t,r){return t!=null&&e.some(s=>s.slot===t)?t:r}function Mq(e,t,r){var o;const s=((o=e.find(a=>a.slot===t))==null?void 0:o.kind)??"here";return s==="swap"?{label:"swap",done:"swapped",sends:!0,swaps:!0,title:`Send this account to slot ${t}. That slot is taken, so the two accounts trade places and the one standing there moves to slot ${r}.`}:s==="free"?{label:"move",done:"moved",sends:!0,swaps:!1,title:`Send this account to slot ${t}. That slot is empty, so no other account moves.`}:{label:"move",done:"here",sends:!1,swaps:!1,title:`This account already holds slot ${r}.`}}function Oq(e,t){return{label:"save",done:"saved",sends:e!==t,swaps:!1,title:`Switch the active account out once it passes ${e}% of its limit.`}}function d1(e){return typeof e.id=="string"&&e.id.startsWith("scoped-")}function f1(e){const t=e.filter(c=>!d1(c)),r=e.filter(c=>d1(c)),s=t.length?t:r,o=t.length?r:[],a=s.reduce((c,f)=>c&&c.pct>=f.pct?c:f,null);let u=null;for(const c of o)a&&c.pct<=a.pct||(!u||c.pct>u.pct)&&(u=c);return{shown:s,rest:o,fuller:u,peak:u??a}}function Pq(e,t,r){return e<1?null:t?"fewer":r?`${r.label} ${Math.round(r.pct)}%`:`${e} more`}function Lq(e,t,r,s){const o=e==null?"No usage has been collected for this account yet.":`${Math.round(e)}% left on ${t??"the window that runs out first"}, which is the one that runs out first.`,a=r===1?"the other window":`the other ${r} windows`;return`${o} ${s?"Hide":"Show"} ${a}.`}const $q="\0";function a0(e){const t=typeof e.email=="string"?e.email.trim():"";if(!t)return`slot:${e.num}`;const r=typeof e.org=="string"?e.org.trim():"";return`acct:${t}${$q}${r}`}function qq(e,t){const r=a0(t);return e.includes(r)?e.filter(s=>s!==r):[...e,r]}function Dq(e,t){if(!Array.isArray(t))return e;const r=new Set(t.map(a0)),s=e.filter(o=>r.has(o));return s.length===e.length?e:s}const Fq=64;function zq(e,t){const r=e.trim();return{alias:r,commit:r!==(t??"").trim()}}const Bq=Object.freeze({text:"couldn't reach the deck server",reload:!0});async function h1(e){return e.ok?{ok:!0,status:e.status,body:null}:{ok:!1,status:e.status,body:await e.json().catch(()=>null)}}function Uq(e){const t=e.find(s=>!s.ok);if(!t)return null;const r=xo(t.body);return{text:Sy(t.body,`the deck server answered ${t.status}`),...r?{raw:r}:{},reload:!0}}function p1(e,t){return t?e!=null&&e.reload&&e.text===t.text&&e.raw===t.raw?e:t:e!=null&&e.reload?null:e}const m1=15e3,Hq=8e3,Af=1800,Wq=3e4,Vq=[70,80,85,90,95];function g1(e,t){return Xj(t-Math.floor(e/1e3))}function Gq(e,t){if(!e)return"";const r=Math.floor(e/1e3)-t;return r<=0?" · due":r<60?` · next in ${r}s`:` · next in ${Math.round(r/60)}m`}function Yq(e){switch(e){case"invalid_grant":case"no_refresh_token":return{text:"login expired",hint:"claude-swap's stored login for this account was rejected and cannot be refreshed. Signing in again replaces it — the account keeps its slot, its alias and its history.",fixable:!0};case"http-401":return{text:"re-login needed",hint:"Anthropic refused this account's token.",fixable:!0};case"http-429":return{text:"rate limited",hint:"Anthropic is throttling requests for this account. It clears on its own.",fixable:!1};case"transient":return{text:"temporary error",hint:"A network or server hiccup while reading usage. The next collection retries.",fixable:!1};case"timeout":return{text:"timed out",hint:"Reading this account's usage took too long. The next collection retries.",fixable:!1};case"network":return{text:"unreachable",hint:"Could not reach Anthropic to read this account's usage.",fixable:!1};default:return{text:e,hint:`claude-swap reported "${e}" for this account.`,fixable:!1}}}function v1({lane:e,nowSec:t}){const r=Math.min(100,Math.max(0,e.pct)),s=r>=90?"var(--err)":r>=70?"var(--warn)":"var(--accent)",o=e.resetAt?Qj(e.resetAt,t):null;return m.jsxs("div",{className:"ap-lane",children:[m.jsx("span",{className:"ap-lane-label",children:e.label}),m.jsx("div",{className:"ap-lane-track",children:m.jsx("div",{className:"ap-lane-fill",style:{width:`${r===0?1.5:r}%`,background:s,opacity:r===0?.4:1}})}),m.jsxs("span",{className:"ap-lane-pct",style:{color:s},children:[r,"%"]}),m.jsx("span",{className:"ap-lane-reset",children:o?`resets ${o}`:""})]})}async function Kq(e){var r;let t=!1;try{t=await Promise.race([((r=navigator.clipboard)==null?void 0:r.writeText(e).then(()=>!0))??Promise.resolve(!1),new Promise(s=>window.setTimeout(()=>s(!1),500))])}catch{t=!1}if(t)return!0;try{const s=document.createElement("textarea");s.value=e,s.setAttribute("readonly",""),s.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(s),s.select(),t=document.execCommand("copy"),s.remove()}catch{t=!1}return t}function Xq(e,t){const r=Math.round(e/1e3)-t;return r<=0?{text:"expired",tone:"gone"}:r<60?{text:`expires in ${r}s`,tone:"soon"}:{text:`expires in ${Math.round(r/60)}m`,tone:"ok"}}function Qq({onClose:e}){var Be,et,Xe,wt;const[t,r]=N.useState(null),[s,o]=N.useState(null),[a,u]=N.useState(null),[c,f]=N.useState(!1),[p,d]=N.useState(null),[g,y]=N.useState(()=>Math.floor(Date.now()/1e3)),w=N.useRef(null),[S,_]=N.useState(null),[b,k]=N.useState(!1),[E,C]=N.useState(""),[T,A]=N.useState(null),[L,P]=N.useState(null),[U,O]=N.useState(null),[M,q]=N.useState(!1),[V,X]=N.useState(null),[j,G]=N.useState(null),[B,te]=N.useState(null),[Z,$]=N.useState(null),[H,I]=N.useState(!1),[Y,ce]=N.useState([]),z=N.useRef(null),Q=N.useCallback(ee=>Jj(z.current)?(z.current=ee,u(ee),!0):!1,[]),ne=N.useCallback(()=>{z.current=null,u(null)},[]),oe=(ee,Le=!1)=>{const De=Zj(a,ee);return{disabled:De.disabled,"aria-busy":De.busy||Le}},fe=N.useCallback(ee=>{window.requestAnimationFrame(()=>{var Le;if($3(((Le=document.activeElement)==null?void 0:Le.tagName)??null))for(const De of L3(ee)){const Re=document.querySelector(De);if(Re){Re.focus();return}}})},[]),pe=N.useCallback(async(ee=!1)=>{ee&&f(!0);const Le=new AbortController,De=window.setTimeout(()=>Le.abort(),Wq);try{const[Re,$e]=await Promise.all([fetch(`/api/claude-accounts${ee?"?refresh=1":""}`,{signal:Le.signal}),fetch("/api/cswap-auto",{signal:Le.signal})]);if(Re.ok){const tt=await Re.json();r(tt),ce(Ce=>Dq(Ce,tt.accounts))}$e.ok&&o(await $e.json());const rt=Uq([await h1(Re),await h1($e)]);d(tt=>p1(tt,rt))}catch{d(Re=>p1(Re,Bq))}finally{window.clearTimeout(De),ee&&f(!1)}},[]),ye=N.useCallback(async(ee,Le)=>{if(!Q(Le))return null;d(null);try{const Re=await(await fetch("/api/cswap-auto",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})).json().catch(()=>null);return Re!=null&&Re.ok||d({text:Sy(Re,"command failed"),raw:xo(Re)}),Re}catch{return d({text:"server unreachable"}),null}finally{ne()}},[Q,ne]),Me=N.useCallback(async(ee,Le)=>{if(!Q(Le))return null;d(null);try{const Re=await(await fetch("/api/claude-accounts/admin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})).json().catch(()=>null);return Re!=null&&Re.ok||d({text:Vu(Re,"command failed")}),Re}catch{return d({text:"server unreachable"}),null}finally{ne()}},[Q,ne]);N.useEffect(()=>(pe(!0),w.current=window.setInterval(()=>pe(!1),m1),()=>{w.current!=null&&window.clearInterval(w.current)}),[pe]),N.useEffect(()=>{const ee=window.setInterval(()=>y(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(ee)},[]);const Ue=((Be=s==null?void 0:s.settings["autoswitch.threshold"])==null?void 0:Be.value)??"90",ze=Z??Ue,Ie=Oq(ze,Ue),ke=(et=t==null?void 0:t.accounts)==null?void 0:et.find(ee=>ee.active),le=((Xe=f1((ke==null?void 0:ke.lanes)??[]).peak)==null?void 0:Xe.pct)??null,we=le!=null&&le>=Number(Ue)-15,xe=async ee=>{if(Q(`switch-${ee}`)){d(null);try{const De=await(await fetch("/api/claude-accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:ee})})).json().catch(()=>null);De!=null&&De.ok||d({text:Sy(De,"the switch failed"),raw:xo(De)}),await pe(!0)}catch{d({text:"server unreachable"})}finally{ne(),fe(ee)}}},Ye=async(ee,Le)=>{const{commit:De,alias:Re}=zq(E,Le);if(De){const $e=await Me({action:"alias",account:ee,alias:Re},`alias-${ee}`);if(await pe(!0),!($e!=null&&$e.ok))return;C(Re)}A(ee),window.setTimeout(()=>A($e=>$e===ee?null:$e),Af)},gt=async(ee,Le)=>{const De=await Me({action:"move",account:ee,slot:Le},`move-${ee}`),Re=Aq({menuFor:S,shareFor:(U==null?void 0:U.num)??null},ee,De);if(await pe(!0),Re){_(Re.menuFor),P(Re.confirmRemove),Re.shareFor==null&&(O(null),q(!1)),X(Re.swapNote);const $e=Re.swapNote;$e&&window.setTimeout(()=>X(rt=>rt===$e?null:rt),Hq),G(null),fe(Re.menuFor)}return De},ft=async(ee,Le,De)=>{if(De.sends){const Re=await gt(ee,Le);if(!(Re!=null&&Re.ok))return}te(ee),window.setTimeout(()=>te(Re=>Re===ee?null:Re),Af)},ot=async(ee,Le)=>{if(Le.sends){const De=await ye({action:"setting",key:"autoswitch.threshold",value:ee},"threshold");if(await pe(!0),!(De!=null&&De.ok))return;$(null)}I(!0),window.setTimeout(()=>I(!1),Af)};return m.jsxs("aside",{className:"accounts-panel",id:"accounts-panel","aria-label":"Claude accounts",children:[m.jsxs("div",{className:"ap-header",children:[m.jsx("h2",{children:"Accounts"}),m.jsxs("div",{className:"ap-header-right",children:[m.jsx("button",{type:"button",className:"glyph-btn ap-add",onClick:()=>k(!0),"aria-label":"Add an account",title:"Sign in to another Claude account, or paste one shared from another deck",children:"+"}),m.jsx("button",{type:"button",className:"glyph-btn ap-refresh",onClick:()=>pe(!0),...oe("reload",c),"aria-label":"Reload accounts",title:"Reload from claude-swap",children:c?"…":"↻"}),m.jsx("button",{type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close accounts panel",title:"Close (A)",children:"×"})]})]}),t==null?p?m.jsxs("div",{className:"ap-empty",role:"alert",children:[m.jsx("span",{title:p.raw||void 0,children:p.text}),m.jsxs("span",{className:"ap-hint",children:["No accounts have arrived, so there is nothing to show yet. The panel keeps trying every ",m1/1e3," seconds."]}),m.jsx("button",{type:"button",className:"ap-fix",disabled:c,onClick:()=>pe(!0),children:c?"trying…":"try again"})]}):m.jsx("div",{className:"ap-empty",children:"Checking…"}):t.ok?m.jsxs(m.Fragment,{children:[(wt=t.accounts)==null?void 0:wt.map(ee=>{const{shown:Le,rest:De,fuller:Re,peak:$e}=f1(ee.lanes),rt=Y.includes(a0(ee)),tt=Pq(De.length,rt,Re);return m.jsxs("div",{className:`ap-account${ee.active?" active":""}`,children:[m.jsxs("div",{className:"ap-account-head",children:[m.jsx("span",{className:"ap-num",children:ee.num}),ee.alias&&m.jsx("span",{className:"ap-alias",title:ee.alias,children:ee.alias}),m.jsx("span",{className:"ap-email",title:ee.email??void 0,children:ee.email}),m.jsx("button",{type:"button",id:`ap-more-${ee.num}`,className:`ap-more${S===ee.num?" on":""}`,"aria-label":`Manage account ${ee.num}`,"aria-expanded":S===ee.num,"aria-controls":S===ee.num?`ap-manage-${ee.num}`:void 0,title:"Share, rename, move, remove",onClick:()=>{_(S===ee.num?null:ee.num),C(ee.alias??""),P(null),O(null),q(!1),X(null),A(null),G(null),te(null)},children:"⋯"}),ee.active&&m.jsx("span",{className:"ap-badge-active",children:"active"}),ee.disabled&&m.jsx("span",{className:"ap-badge-held",children:"held out"}),!ee.active&&!ee.disabled&&m.jsx("button",{type:"button",className:"ap-manage-btn ap-switch",...oe(`switch-${ee.num}`),onClick:()=>xe(ee.num),title:`Switch to ${ee.alias??ee.email}`,children:a===`switch-${ee.num}`?"…":"switch"})]}),m.jsx("div",{className:"ap-lanes",id:`ap-lanes-${ee.num}`,children:Le.length?m.jsxs(m.Fragment,{children:[Le.map(Ce=>m.jsx(v1,{lane:Ce,nowSec:g},Ce.id)),rt&&De.map(Ce=>m.jsx(v1,{lane:Ce,nowSec:g},Ce.id))]}):m.jsx("div",{className:"ap-hint",children:"No usage recorded yet."})}),m.jsxs("div",{className:"ap-meta",children:[ee.error&&(()=>{const Ce=Yq(ee.error);return m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"ap-err",title:Ce.hint,children:Ce.text}),Ce.fixable&&m.jsx("button",{type:"button",className:"ap-fix",onClick:()=>k(!0),title:"Open the sign-in dialog. Signing in as this account replaces its stored login in place.",children:"sign in again"})]})})(),tt&&m.jsx("button",{type:"button",className:"ap-lanes-more","aria-expanded":rt,"aria-controls":`ap-lanes-${ee.num}`,title:Lq(ee.headroom,($e==null?void 0:$e.label)??null,De.length,rt),onClick:()=>ce(Ce=>qq(Ce,ee)),children:tt}),(((s==null?void 0:s.enabled)||(s==null?void 0:s.external))&&!ee.active||ee.disabled)&&m.jsx("button",{type:"button",className:"ap-rotate",...oe(`rot-${ee.num}`),onClick:()=>ye({action:"account",account:ee.num,enabled:ee.disabled},`rot-${ee.num}`).then(()=>pe(!0)),title:ee.disabled?"Return this account to auto-rotation":"Hold this account out of auto-rotation",children:ee.disabled?"put back":"hold out"}),ee.fetchedAt?m.jsxs("span",{className:`ap-age${ee.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 ",g1(ee.fetchedAt,g),Gq(ee.nextAt,g)]}):m.jsx("span",{className:"ap-age ap-stale",title:"claude-swap has not read this account yet",children:"never collected"})]}),S===ee.num&&m.jsxs("div",{className:"ap-manage",id:`ap-manage-${ee.num}`,role:"group","aria-label":`Manage account ${ee.num}`,children:[m.jsxs("div",{className:"ap-manage-name",children:[m.jsx("label",{className:"vis-hidden",htmlFor:`ap-alias-${ee.num}`,children:"Alias"}),m.jsx("input",{id:`ap-alias-${ee.num}`,className:"ap-manage-input",type:"text",value:E,onChange:Ce=>C(Ce.target.value),onKeyDown:Ce=>{Ce.key==="Enter"&&Ye(ee.num,ee.alias)},maxLength:Fq,placeholder:"e.g. work",spellCheck:!1,autoFocus:!0}),m.jsx("button",{type:"button",className:"ap-manage-btn",...oe(`alias-${ee.num}`),onClick:()=>Ye(ee.num,ee.alias),title:"A short name to show instead of the email",children:T===ee.num?"saved":"save"})]}),(()=>{const Ce=Rq((t.accounts??[]).map(lt=>lt.num),ee.num),kt=Iq(Ce,j,ee.num),Ve=Mq(Ce,kt,ee.num);return m.jsxs("div",{className:"ap-manage-slot",children:[m.jsx("label",{className:"vis-hidden",htmlFor:`ap-slot-${ee.num}`,children:"Slot"}),m.jsx("span",{className:"ap-field",children:m.jsx("select",{id:`ap-slot-${ee.num}`,value:String(kt),...oe(`move-${ee.num}`),onChange:lt=>G(Number(lt.target.value)),children:Ce.map(lt=>m.jsx("option",{value:lt.slot,children:lt.label},lt.slot))})}),m.jsx("button",{type:"button",className:"ap-manage-btn",...oe(`move-${ee.num}`),title:Ve.title,onClick:()=>ft(ee.num,kt,Ve),children:B===ee.num?Ve.done:Ve.label})]})})(),m.jsxs("div",{className:"ap-manage-acts",children:[m.jsx("button",{type:"button",className:"ap-manage-btn",...oe(`share-${ee.num}`),title:`Copy this account to another ${Yt}. Anyone who has the text can use the account — treat it as the password. The other deck stops accepting it after 10 minutes; that does not make an escaped copy safe.`,onClick:async()=>{q(!1);const Ce=await Me({action:"share",account:ee.num},`share-${ee.num}`);Ce!=null&&Ce.ok&&O({num:ee.num,blob:Ce.blob,expiresAt:Ce.expiresAt})},children:"share"}),m.jsx("button",{type:"button",className:`ap-manage-btn danger${L===ee.num?" armed":""}`,...oe(`rm-${ee.num}`),title:L===ee.num?"This deletes the stored credentials for this account":"Remove this account from claude-swap",onClick:()=>{if(L!==ee.num){P(ee.num),window.setTimeout(()=>P(Ce=>Ce===ee.num?null:Ce),4e3);return}P(null),Me({action:"remove",account:ee.num},`rm-${ee.num}`).then(()=>{_(null),pe(!0),fe(null)})},children:L===ee.num?"confirm":"remove"})]}),(V==null?void 0:V.at)===ee.num&&(()=>{var Ve;const Ce=(Ve=t.accounts)==null?void 0:Ve.find(lt=>lt.num===V.displaced),kt=(Ce==null?void 0:Ce.alias)??(Ce==null?void 0:Ce.email)??"the account that was there";return m.jsxs("span",{className:"ap-manage-hint ap-manage-swap",title:`Slot ${V.at} was taken, so the two accounts traded places: ${kt} now holds slot ${V.displaced}.`,children:["swapped with slot ",V.displaced]})})(),(U==null?void 0:U.num)===ee.num&&(()=>{const Ce=Xq(U.expiresAt,g),kt=Ce.tone==="gone";return m.jsxs("div",{className:`ap-share${kt?" expired":""}`,children:[m.jsx("code",{className:"ap-share-blob",children:U.blob}),m.jsxs("div",{className:"ap-share-foot",children:[m.jsx("button",{type:"button",className:"ap-manage-btn",...oe(`share-${ee.num}`),onClick:async()=>{if(kt){q(!1);const Ve=await Me({action:"share",account:ee.num},`share-${ee.num}`);Ve!=null&&Ve.ok&&O({num:ee.num,blob:Ve.blob,expiresAt:Ve.expiresAt});return}await Kq(U.blob)&&(q(!0),window.setTimeout(()=>q(!1),1800))},children:kt?"make a new share":M?"copied":"copy"}),m.jsxs("span",{className:"ap-manage-hint",title:"This text is the account's password. It is base64 of plain JSON — the expiry inside it is not signed, so anyone holding a copy can change it, and the login itself is in there in the clear either way. The countdown only says how long another deck's import dialog will still accept it. If a copy escapes, sign the account out and back in.",children:[m.jsx("span",{className:"ap-share-warn",children:"this is the password"})," · ",m.jsx("span",{className:`ap-share-expiry ${Ce.tone}`,children:Ce.text})]})]})]})})()]})]},ee.num)}),(s==null?void 0:s.ok)&&m.jsxs("div",{className:"ap-auto",children:[m.jsxs("div",{className:"ap-auto-head",children:[m.jsx("h3",{className:"ap-auto-title",children:"Auto-switch"}),m.jsxs("span",{className:"ap-auto-ctl",children:[le!=null&&m.jsxs("span",{className:`ap-auto-now${we?" near":""}`,children:[Math.round(le),"%"]}),m.jsx("span",{className:"ap-field",title:"Switch once the active account passes this much of its limit",children:m.jsx("select",{"aria-label":"Switch threshold",value:ze,...oe("threshold"),onChange:ee=>$(ee.target.value),children:Vq.map(ee=>m.jsxs("option",{value:ee,children:[ee,"%"]},ee))})}),m.jsx("button",{type:"button",className:"ap-manage-btn",...oe("threshold"),title:Ie.title,onClick:()=>ot(ze,Ie),children:H?Ie.done:Ie.label}),m.jsxs("button",{type:"button",className:`ap-auto-state${s.enabled?" live":""}`,role:"switch","aria-checked":s.enabled,"aria-label":"Auto-switch",...oe("enable"),onClick:()=>ye({action:"enable",enabled:!s.enabled},"enable").then(()=>pe(!0)),title:s.enabled?"Stop switching accounts automatically":"Switch accounts automatically when the active one nears its limit",children:[m.jsx("i",{className:s.enabled?"ap-pulse":"ap-dot","aria-hidden":!0}),s.enabled?"on":"off"]})]})]}),s.external&&m.jsxs("p",{className:"ap-auto-note",children:[m.jsx("i",{className:"ap-pulse","aria-hidden":!0})," A ",m.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&&m.jsx("div",{className:"ap-auto-foot",children:m.jsxs("span",{className:"ap-auto-result",children:["checked ",g1(s.lastTick.at,g)]})})]}),p&&m.jsxs("div",{className:"ap-failure",role:"alert",children:[m.jsx("span",{className:"ap-failure-text",title:p.raw||void 0,children:p.text}),m.jsx("button",{type:"button",className:"ap-failure-x",onClick:()=>d(null),"aria-label":"Dismiss this message",title:"Dismiss",children:"×"})]}),m.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:"These numbers only update while this panel is open."})]}):m.jsx("div",{className:"ap-empty",children:t.reason==="no_cswap"?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"claude-swap isn't installed."}),m.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."}),t.hint&&m.jsx("code",{className:"ap-cmd",children:t.hint}),m.jsxs("span",{className:"ap-hint",children:["Then add an account with the ",m.jsx("strong",{children:"+"})," button above."]})]}):t.reason==="no_accounts"?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"No accounts added yet."}),m.jsxs("span",{className:"ap-hint",children:["claude-swap is installed but has nothing in its store. Use the ",m.jsx("strong",{children:"+"})," above to sign one in, or to paste one shared from another deck."]})]}):m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"Couldn't read the account store."}),m.jsxs("span",{className:"ap-hint",children:["claude-swap is installed, but its store could not be read",t.reason?` (${t.reason})`:"","."]})]})}),b&&m.jsx(Tq,{onClose:()=>k(!1),onChanged:()=>pe(!0)})]})}const Zq=3e4;function Jq({bundle:e,running:t,lastTried:r}){return!t||e===t?!1:r!==t}function e4({bundle:e,running:t,pending:r,lastTried:s}){return t?Jq({bundle:e,running:t,lastTried:s})?"reload":r==null||r&&r!==t?"wait":"confirm":"wait"}function t4(e){return!e||e.state!=="failed"?null:`${typeof e.at=="number"?e.at:0}:${e.error??""}`}function n4({asked:e,reported:t}){return t?t!==e:!1}function r4(e){const t=e.thresholdMs??Zq;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>=t}}function s4(e,t){return e==="confirmation"?t.confirmOpen?"clear":"ignore":t.modalOpen||t.confirmOpen?"ignore":"confirm"}function i4(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.decks!="number"||typeof t.mine!="boolean")return null;const r=t.owner&&typeof t.owner=="object"?t.owner.port:null;return{path:typeof t.path=="string"&&t.path!==""?t.path:null,decks:t.decks,mine:t.mine,ownerPort:typeof r=="number"?r:null}}function o4(e){return e<=0?null:e===1?"the one agent":`all ${e} agents`}function a4(e,t){const r=o4(e),s=r?`removes ${r} on the canvas`:null,o=c=>`This ${s?`${s} and ${c}`:c}`;if(!t)return{note:`${o("deletes the event log on disk")} — the file a restarted deck replays to rebuild what you see, and the file every deck on this machine shares unless one was told otherwise. Layout, pins and selection go with it. This cannot be undone.`,confirm:"Clear everything"};if(!t.path)return{note:`${o("leaves nothing on disk — this deck keeps no event log")}. Layout, pins and selection go with it. This cannot be undone.`,confirm:"Clear everything"};if(!t.mine){const c=t.ownerPort===null?"another running deck owns that file":`the deck on port ${t.ownerPort} owns that file`,f=t.decks>2?`, one of ${t.decks} decks sharing it`:"";return{note:`${o(`leaves the event log alone: ${c}${f}`)}. Clearing here empties this canvas only — restart this deck and the log replays back onto it. Layout, pins and selection go with it.`,confirm:"Clear this canvas"}}if(t.decks<=1)return{note:`${o("deletes this deck's event log")} — the file a restarted deck replays to rebuild what you see. Layout, pins and selection go with it. This cannot be undone.`,confirm:"Clear everything"};const a=t.decks-1,u=a===1?"That deck keeps what is on its canvas until it restarts, and then it is gone there too.":"Those decks keep what is on their canvases until they restart, and then it is gone there too.";return{note:`${o(`deletes the event log ${a===1?"1 other running deck shares":`${a} other running decks share`} with this one`)} — every session recorded in it, not just the ones drawn here. ${u} This cannot be undone.`,confirm:"Clear everything"}}function l4({agentCount:e,onConfirm:t,onCancel:r}){const s=N.useRef(null),o=Kr(r,{focusRef:s,layer:l$}),[a,u]=N.useState(null);N.useEffect(()=>{let p=!1;return fetch("/api/clear").then(d=>d.ok?d.json():null).then(d=>{p||u(i4(d))}).catch(()=>{}),()=>{p=!0}},[]);const{note:c,confirm:f}=a4(e,a);return m.jsx("div",{className:"modal-backdrop",onClick:r,role:"presentation",children:m.jsxs("div",{ref:o,className:"modal clear-confirm",onClick:p=>p.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"clear-confirm-title",children:[m.jsxs("header",{className:"modal-head",children:[m.jsxs("div",{className:"modal-title",children:[m.jsx("span",{className:"status-dot err","aria-hidden":!0}),m.jsx("span",{id:"clear-confirm-title",className:"modal-tool-name",children:"Clear the deck?"})]}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"glyph-btn",onClick:r,"aria-label":"Cancel (Esc)",title:"Cancel (Esc)",children:"×"})})]}),m.jsxs("section",{className:"modal-body",children:[m.jsx("p",{className:"modal-note",children:c}),m.jsxs("div",{className:"cc-actions",children:[m.jsx("button",{type:"button",ref:s,className:"btn",onClick:r,children:"Cancel"}),m.jsx("button",{type:"button",className:"btn danger",onClick:t,children:f})]})]})]})})}const u4="One-key shortcuts run when nothing on the page has focus. A focused control keeps its own keys — this sheet included, which takes the keyboard while it is open — so Esc is the way back to the canvas.",c4=[{title:"Canvas",rows:[{cap:"Space",action:"pause or resume the stream",binds:[" "]},{cap:"J",action:"next agent",binds:["j","J"]},{cap:"K",action:"previous agent",binds:["k","K"]},{cap:"F",action:"fit every agent on screen",binds:["f","F"]},{cap:"R",action:"re-arrange the canvas and drop the pins",binds:["r","R"]},{cap:"C",action:"clear the canvas and the event log — asks first",binds:["c","C"]}]},{title:"Panels and dialogs",rows:[{cap:"U",action:"usage panel",binds:["u","U"]},{cap:"L",action:"session list",binds:["l","L"]},{cap:"H",action:"usage history",binds:["h","H"]},{cap:"A",action:"Claude accounts, where Claude Code is installed",binds:["a","A"]},{cap:"?",action:"this sheet",binds:["?"]}]},{title:"Settings",rows:[{cap:"M",action:"sound on or off",binds:["m","M"]},{cap:"T",action:"light or dark theme",binds:["t","T"]}]},{title:"Focus and selection",rows:[{cap:"Tab",action:"reach the agent cards",binds:[]},{cap:"Enter",action:"select the focused card",binds:["Enter"]},{cap:"Shift + Enter",action:"add the focused card to the selection",binds:["Enter"]},{cap:"Esc",action:"close what is open, deselect, release focus",binds:["Escape"]}]},{title:"Mouse",rows:[{cap:"drag",action:"move a node, and pin it where you dropped it",binds:[]},{cap:"shift-click",action:"add an agent to the selection",binds:[]},{cap:"click",action:"the topbar speaker opens volume and sound settings",binds:[]}]}];function d4({onClose:e}){const t=Kr(e);return m.jsx("div",{className:"modal-backdrop",onClick:e,role:"presentation",children:m.jsxs("div",{ref:t,className:"modal key-help",onClick:r=>r.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"key-help-title",children:[m.jsxs("header",{className:"modal-head",children:[m.jsx("div",{className:"modal-title",children:m.jsx("span",{id:"key-help-title",className:"modal-tool-name",children:"Keyboard shortcuts"})}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),m.jsxs("section",{className:"modal-body",children:[m.jsx("p",{className:"modal-note",children:u4}),m.jsx("div",{className:"shortcuts",children:c4.map(r=>m.jsxs(N.Fragment,{children:[m.jsx("h3",{className:"kh-group",children:r.title}),r.rows.map(s=>m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:s.cap}),m.jsx("span",{children:s.action})]},`${r.title}:${s.cap}:${s.action}`))]},r.title))})]})]})})}const f4=["done","needs-input"],h4=[{id:"two",label:"Two notes",notes:[{at:0,hz:740,ms:90},{at:.085,hz:440,ms:150}]},{id:"arc",label:"Descent",notes:[{at:0,hz:988,ms:80},{at:.07,hz:659,ms:80},{at:.14,hz:440,ms:160}]},{id:"tap",label:"Double tap",notes:[{at:0,hz:740,ms:55},{at:.055,hz:740,ms:55},{at:.165,hz:440,ms:150}]},{id:"chord",label:"Chord",trim:.7,notes:[{at:0,hz:988,ms:110},{at:0,hz:740,ms:110},{at:.1,hz:440,ms:170}]},{id:"bell",label:"Bell",type:"triangle",notes:[{at:0,hz:740,ms:120},{at:.11,hz:440,ms:260}]},{id:"blip",label:"Blip",type:"square",trim:.7,notes:[{at:0,hz:740,ms:55},{at:.06,hz:440,ms:90}]}],p4=[{id:"two",label:"Two notes",notes:[{at:0,hz:440,ms:90},{at:.085,hz:740,ms:150}]},{id:"arc",label:"Ascent",notes:[{at:0,hz:440,ms:80},{at:.07,hz:659,ms:80},{at:.14,hz:988,ms:160}]},{id:"tap",label:"Double tap",notes:[{at:0,hz:440,ms:55},{at:.055,hz:440,ms:55},{at:.165,hz:740,ms:150}]},{id:"chord",label:"Chord",trim:.7,notes:[{at:0,hz:440,ms:110},{at:.1,hz:740,ms:170},{at:.1,hz:988,ms:170}]},{id:"bell",label:"Bell",type:"triangle",notes:[{at:0,hz:440,ms:120},{at:.11,hz:740,ms:260}]},{id:"blip",label:"Blip",type:"square",trim:.7,notes:[{at:0,hz:440,ms:55},{at:.06,hz:740,ms:90}]}],l0={done:h4,"needs-input":p4},_o="two";function Ny(e,t){const r=l0[e];return r.find(s=>s.id===t)??r.find(s=>s.id===_o)??r[0]}function sT(e,t){return l0[e].some(s=>s.id===t)?t:_o}Ny("done",_o).notes,Ny("needs-input",_o).notes;const y1=.04,m4=.24,iT=0,u0=100,Cy=5,Ua=50;function Ha(e){if(!Number.isFinite(e))return Ua;const t=Math.round(e/Cy)*Cy;return Math.min(u0,Math.max(iT,t))}function g4(e){if(e==null)return Ua;const t=e.trim();return/^-?\d+(\.\d+)?$/.test(t)?Ha(Number(t)):Ua}function v4(e){const t=Ha(e),r=y1+(m4-y1)*(t/u0);return Math.round(r*1e4)/1e4}function y4(e,t){const r=t.trim,s=typeof r=="number"&&Number.isFinite(r)&&r>0&&r<=1?r:1;return Math.round(v4(e)*s*1e4)/1e4}const w4=160,x4="agent-dag.soundLevel.done",_4="agent-dag.soundLevel.needs-input",b4="agent-dag.soundFigure.done",k4="agent-dag.soundFigure.needs-input",oT={done:x4,"needs-input":_4},aT={done:b4,"needs-input":k4},jy={done:{level:Ua,figure:_o},"needs-input":{level:Ua,figure:_o}};function S4(e){const t=r=>({level:g4(e(oT[r])),figure:sT(r,e(aT[r]))});return{done:t("done"),"needs-input":t("needs-input")}}const E4={Stop:"done",Notification:"needs-input"};function N4(e,t){var s;if(t)return null;const r=(s=e==null?void 0:e.payload)==null?void 0:s.hook_event_name;return typeof r!="string"?null:E4[r]??null}function C4(e={enabled:()=>!0}){const t=e.ctor??(typeof window<"u"?window.AudioContext??window.webkitAudioContext??null:null);let r=null,s=!1;const o=()=>e.enabled()?s&&(r==null?void 0:r.state)==="running"?"ready":"locked":"off",a=()=>{var f;return(f=e.onState)==null?void 0:f.call(e,o())};function u(){var f;if(!(!t||s))try{r=r??new t,(f=r.resume)==null||f.call(r).then(a,()=>{}),s=!0,a()}catch{}}function c(f,p=!1){var S;if(!p&&!e.enabled()||!r||r.state!=="running")return!1;const d=(((S=e.prefs)==null?void 0:S.call(e))??jy)[f]??jy[f],g=Ny(f,d.figure),y=y4(d.level,g),w=r.currentTime;for(const _ of g.notes){const b=r.createOscillator(),k=r.createGain();b.type=g.type??"sine",b.frequency.value=_.hz;const E=w+_.at,C=E+_.ms/1e3;k.gain.setValueAtTime(1e-4,E),k.gain.exponentialRampToValueAtTime(y,E+.012),k.gain.exponentialRampToValueAtTime(1e-4,C),b.connect(k).connect(r.destination),b.start(E),b.stop(C+.02)}return!0}return{unlock:u,play:c,state:o,get context(){return r}}}const w1={done:"Turn finished","needs-input":"Claude is asking"},j4={done:"Every finished turn, on both CLIs.","needs-input":"Claude Code only — Codex has no such event."};function T4({onClose:e,soundOn:t,onToggleSound:r,prefs:s,onLevel:o,onFigure:a,onPreview:u,openerRef:c}){const f=Kr(e),p=N.useRef(e);return p.current=e,N.useEffect(()=>{const d=g=>{var w,S;const y=g.target;y&&((w=f.current)!=null&&w.contains(y)||(S=c.current)!=null&&S.contains(y)||p.current())};return window.addEventListener("pointerdown",d,!0),()=>window.removeEventListener("pointerdown",d,!0)},[f,c]),m.jsxs("div",{ref:f,id:"sound-menu",className:"sound-menu",role:"dialog","aria-label":"Sound settings",children:[m.jsxs("button",{type:"button",className:"btn sm-switch",onClick:r,"aria-pressed":t,children:[m.jsx("span",{className:"sm-switch-label",children:"Sound"}),m.jsx("span",{className:"sm-switch-state",children:t?"on":"off"})]}),f4.map(d=>{const g=s[d],y=`sm-level-${d}`,w=`sm-figure-${d}`;return m.jsxs("section",{className:"sm-tone","aria-labelledby":`sm-name-${d}`,children:[m.jsxs("div",{className:"sm-tone-head",children:[m.jsx("h3",{className:"sm-tone-name",id:`sm-name-${d}`,children:w1[d]}),m.jsxs("button",{type:"button",className:"btn sm-hear",onClick:()=>u(d),"aria-label":`Hear the ${w1[d].toLowerCase()} tone`,children:[m.jsx("svg",{width:"11",height:"11",viewBox:"0 0 12 12",fill:"currentColor","aria-hidden":!0,children:m.jsx("path",{d:"M3 1.6v8.8l7-4.4z"})}),"Hear it"]})]}),m.jsxs("div",{className:"sm-row",children:[m.jsx("label",{htmlFor:y,children:"Volume"}),m.jsx("input",{id:y,type:"range",min:iT,max:u0,step:Cy,value:g.level,onChange:S=>o(d,Number(S.target.value))}),m.jsxs("span",{className:"sm-read",children:[g.level,"%"]})]}),m.jsxs("div",{className:"sm-row",children:[m.jsx("label",{htmlFor:w,children:"Sound"}),m.jsx("select",{id:w,className:"sm-select",value:g.figure,onChange:S=>a(d,S.target.value),children:l0[d].map(S=>m.jsx("option",{value:S.id,children:S.label},S.id))})]}),m.jsx("p",{className:"sm-note",children:j4[d]})]},d)}),m.jsx("p",{className:"sm-foot",children:"M turns the sound on and off from anywhere."})]})}const R4={"//":["What a user would NOTICE. One key per version that has something to say,","and no key at all for a version that has nothing — which is most of them.","","The rule this file exists to serve: before every release, ask 'what would a","user notice?' and write the answer here. 'Nothing user-visible' is a valid","and expected answer, and it is spelled by adding no key. A release with no","key shows no modal, and that silence is what keeps the modal worth reading","on the day it is not silent.","","What belongs here: something that changed on the user's machine or under","their hands — a hook written to or removed from settings.json, a default","that flipped, a control that moved or went away, a stored preference that","changed meaning. What does not: bounds, races, assertions that could not","fire, anything that is invisible when it is correct.","","Write it for the person running the deck, not for the person reading the","diff. `title` is the sentence they scan; `body` is what they need in order","to act on it, or to stop worrying about it.","","Keys are versions exactly as package.json spells them. A key that is not a","version, or an entry missing either field, fails the suite rather than","being quietly dropped — see src/web/__tests__/release-notes-file.test.ts.","Ordering here is for humans; the deck sorts by version itself.","","A title may open with an emoji, and if it does, put exactly ONE space after","it. Not two: the dialog gives a leading emoji its own optical gap, because","a colour glyph is drawn edge to edge inside its advance and one word space","after one reads as none. A second space here would be a lie in the data","about a defect in the type, and the suite refuses both it and no space at","all."],"1.46.0":[{title:"🔊 Pick a volume and a sound for each of the two tones",body:`Click the speaker in the top bar and a small menu opens. There are two tones — one when a turn finishes, one when Claude is waiting for you — and each has its own volume and its own sound, six to choose from. Press "Hear it" to try one straight away, without waiting for a real turn.
|
|
72
|
+
Press H for the totals ccusage reads off the logs on disk, which do not forget.`,Xj="session spend";function s0({cost:e,size:t="md"}){const r=e.total;if(r<=0)return null;const s=(a,u,c)=>{if(a<=0)return null;const f=a/r*100;return m.jsx("span",{className:`cb-seg ${u}`,style:{width:`${f}%`},title:`${c}: ${Ge(a)} (${f.toFixed(0)}%)`},u)},o=t==="lg";return m.jsxs("div",{className:o?"cost-bar cost-bar-lg":"cost-bar",role:"img","aria-label":"Cost breakdown",children:[s(e.input,"cb-input","input"),s(e.output,"cb-output","output"),s(e.cacheRead,"cb-cache-r","cache read"),s(e.cacheWrite,"cb-cache-w","cache write")]})}function j3({state:e,sessionId:t,onClose:r}){const s=N.useMemo(()=>T3(e,t),[e,t]),o=N.useRef(null),a=Kr(r,{focusRef:o});return s?m.jsx("div",{className:"modal-backdrop",onClick:r,role:"presentation",children:m.jsxs("div",{ref:a,className:"modal session-summary",onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"ss-title",children:[m.jsxs("div",{className:"modal-head",children:[m.jsxs("div",{className:"modal-title",children:[m.jsx("span",{className:"state-pill state-done","aria-hidden":!0,children:"done"}),m.jsx("span",{id:"ss-title",className:"modal-tool-name",title:s.cwd??s.sessionId,children:s.label}),m.jsxs("span",{className:"modal-tool-id",children:["· ",s.sessionId.slice(0,8)]})]}),m.jsxs("div",{className:"modal-actions",children:[m.jsx("span",{className:"modal-dur",title:"Total wall time",children:s.durationLabel}),m.jsx("button",{type:"button",ref:o,className:"glyph-btn",onClick:r,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]})]}),m.jsxs("div",{className:"modal-body",children:[m.jsxs("section",{className:"ss-hero",children:[m.jsxs("div",{className:"ss-hero-left",children:[m.jsx("div",{className:"ss-cost-label",children:Xj}),m.jsx("div",{className:"ss-cost",children:Ge(s.cost.total)}),s.modelChips.length>0&&m.jsx("div",{className:"ss-models",children:s.modelChips.map(u=>m.jsx("span",{className:"model-chip",title:u,children:li(u)},u))})]}),m.jsx("div",{className:"ss-hero-right",children:s.cost.total>0&&m.jsxs(m.Fragment,{children:[m.jsx(s0,{cost:s.cost,size:"lg"}),m.jsxs("div",{className:"ss-cost-legend",children:[m.jsxs("span",{className:"ssl ssl-in",children:["input ",m.jsx("b",{children:Ge(s.cost.input)})]}),m.jsxs("span",{className:"ssl ssl-out",children:["output ",m.jsx("b",{children:Ge(s.cost.output)})]}),m.jsxs("span",{className:"ssl ssl-cr",children:["cache r ",m.jsx("b",{children:Ge(s.cost.cacheRead)})]}),m.jsxs("span",{className:"ssl ssl-cw",children:["cache w ",m.jsx("b",{children:Ge(s.cost.cacheWrite)})]})]})]})})]}),m.jsxs("section",{className:"ss-stats",children:[m.jsx(io,{label:"agents",value:s.agentCount}),m.jsx(io,{label:"subagents",value:s.subagentCount}),m.jsx(io,{label:"tool calls",value:s.toolCount}),m.jsx(io,{label:"prompts",value:s.promptCount}),m.jsx(io,{label:"tokens",value:s.tokensSum.toLocaleString()}),s.errCount>0&&m.jsx(io,{label:"errors",value:s.errCount,tone:"err"})]}),s.topTools.length>0&&m.jsxs("section",{className:"modal-section",children:[m.jsx("h4",{children:"Most-used tools"}),m.jsx("div",{className:"ss-top-tools",children:s.topTools.map(([u,c])=>m.jsxs("div",{className:"ss-tt",children:[m.jsx("span",{className:"ss-tt-name",children:u}),m.jsx("span",{className:"ss-tt-bar",children:m.jsx("span",{className:"ss-tt-bar-fill",style:{width:`${c/s.topTools[0][1]*100}%`}})}),m.jsx("span",{className:"ss-tt-count",children:c})]},u))})]}),s.firstPrompt&&m.jsxs("section",{className:"modal-section",children:[m.jsx("h4",{children:"Opening prompt"}),m.jsx("div",{className:"ss-prompt",children:s.firstPrompt})]})]})]})}):null}function io({label:e,value:t,tone:r}){return m.jsxs("div",{className:`ss-stat${r?` tone-${r}`:""}`,children:[m.jsx("div",{className:"ss-stat-value",children:t}),m.jsx("div",{className:"ss-stat-label",children:e})]})}function T3(e,t){const r=e.agents.get(t);if(!r)return null;const s=[];for(const C of e.agents.values())C.sessionId===t&&s.push(C);if(s.length===0)return null;const o={input:0,output:0,cacheRead:0,cacheWrite:0,total:0},a=new Set,u=new Map;let c=0,f=0,p=0,d=0,g=0,y,w=1/0,S=0;for(const C of s){const T=vn(C);o.input+=T.input,o.output+=T.output,o.cacheRead+=T.cacheRead,o.cacheWrite+=T.cacheWrite,o.total+=T.total;for(const A of $j(C))a.add(A);C.model&&a.add(C.model),C.kind==="subagent"&&g++,f+=C.prompts.length,!y&&C.prompts.length>0&&(y=C.prompts[0].text),p+=C.usage.inputTokens+C.usage.outputTokens,c+=C.toolCount,w=Math.min(w,C.startedAt),S=Math.max(S,C.endedAt??Date.now());for(const A of C.tools)u.set(A.name,(u.get(A.name)??0)+1),A.ok===!1&&d++}const _=Math.max(0,S-w),b=Math.floor(_/1e3),k=b<60?`${b}s`:b<3600?`${Math.floor(b/60)}m ${String(b%60).padStart(2,"0")}s`:`${Math.floor(b/3600)}h ${Math.floor(b%3600/60)}m`,E=Array.from(u.entries()).sort((C,T)=>T[1]-C[1]).slice(0,5);return{sessionId:t,label:r.label||r.cwdBasename||"session",cwd:r.cwd,durationLabel:k,cost:o,modelChips:Array.from(a),agentCount:s.length,subagentCount:g,toolCount:c,promptCount:f,tokensSum:p,errCount:d,topTools:E,firstPrompt:y}}function i0(e){return(e==null?void 0:e.kind)==="permission"}function R3(e){const t=[];for(const r of e)r.kind==="root"&&i0(r.waiting)&&t.push({id:r.id,label:r.label,waiting:r.waiting});return t.sort((r,s)=>r.waiting.since-s.waiting.since)}function A3(e){const t=new Set;for(const r of e)r.state==="active"&&t.add(r.sessionId);return t.size}function r1(e){return e.waiting?i0(e.waiting)?0:1:e.state==="active"?2:3}function I3(e,t){const r=[];for(const s of e.agents.values()){if(s.kind!=="root")continue;let o=s.toolCount,a=vn(s).total,u=s.endedAt??s.startedAt;for(const c of e.agents.values()){if(c.sessionId!==s.sessionId||c.kind==="root")continue;o+=c.toolCount,a+=vn(c).total;const f=c.endedAt??c.startedAt;f>u&&(u=f)}r.push({sessionId:s.sessionId,label:s.label||s.cwdBasename||"session",cwdBasename:s.cwdBasename,state:s.state,waiting:s.waiting,modelId:s.model,toolCount:o,cost:a,startedAt:s.startedAt,lastActivity:u})}return r.sort((s,o)=>{const a=r1(s),u=r1(o);return a!==u?a-u:s.waiting&&o.waiting?s.waiting.since-o.waiting.since:o.lastActivity-s.lastActivity}),r}function s1(e,t,r){const s=(t??r)-e;if(s<1e3)return"<1s";const o=Math.floor(s/1e3);if(o<60)return`${o}s`;const a=Math.floor(o/60);return a<60?`${a}m`:`${Math.floor(a/60)}h ${a%60}m`}function M3({state:e,now:t,selectedIds:r,onSelect:s,onClose:o}){const a=N.useMemo(()=>I3(e),[e,e.revision,t]),u=a.filter(f=>f.state==="active").length,c=a.filter(f=>i0(f.waiting)).length;return m.jsxs("aside",{className:"session-list",id:"session-list","aria-label":"Sessions",children:[m.jsxs("div",{className:"sl-header",children:[m.jsxs("h2",{children:["Sessions ",m.jsx("span",{className:"sl-count",children:a.length})]}),c>0&&m.jsxs("span",{className:"sl-waiting-count",children:[c," waiting"]}),u>0&&m.jsxs("span",{className:"sl-live-count",children:[u," live"]}),m.jsx("button",{className:"glyph-btn sl-close",onClick:o,title:"Hide sidebar (L)","aria-label":"Hide session list",children:"‹"})]}),m.jsxs("div",{className:"sl-rows",children:[a.length===0&&m.jsx("div",{className:"sl-empty",children:"No sessions yet."}),a.map(f=>{const p=r.has(f.sessionId);return m.jsxs("button",{type:"button",className:`sl-row state-${f.state}${p?" selected":""}`,onClick:()=>s(f.sessionId),title:`Focus ${f.label}`,children:[m.jsx("span",{className:`sl-dot state-${f.state}`,"aria-hidden":!0}),m.jsx("span",{className:"vis-hidden",children:n0(f.state)}),m.jsxs("div",{className:"sl-row-body",children:[m.jsxs("div",{className:"sl-row-head",children:[m.jsx("span",{className:"sl-label",children:f.label}),f.modelId&&m.jsx("span",{className:"model-chip",title:f.modelId,children:li(f.modelId)})]}),m.jsxs("div",{className:"sl-row-meta",children:[m.jsxs("span",{title:"tool calls",children:[m.jsx("b",{children:f.toolCount})," tools"]}),f.cost>0&&m.jsx("span",{className:"sl-cost",title:Xj,children:m.jsx("b",{children:Ge(f.cost)})}),f.waiting?m.jsxs("span",{className:"sl-waiting",title:`${vc(f.waiting)}
|
|
73
|
+
Blocked since ${new Date(f.waiting.since).toLocaleTimeString()} · started ${new Date(f.startedAt).toLocaleString()}`,children:["waiting ",s1(f.waiting.since,void 0,t)]}):m.jsx("span",{className:"sl-elapsed",title:`Started ${new Date(f.startedAt).toLocaleString()}`,children:s1(f.startedAt,f.state==="active"?void 0:f.lastActivity,t)})]})]})]},f.sessionId)})]})]})}const Yt="ccdeck";function Qj(e){const t=Math.max(0,e);return t<60?"just now":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`}function by(e){return Qj(Math.floor(e/1e3))}function Zj(e,t){const r=e-t;if(r<=0)return null;const s=Math.floor(r/86400),o=Math.floor(r%86400/3600),a=Math.floor(r%3600/60);return s>0?`${s}d ${o}h`:o>0?`${o}h ${a}m`:`${a}m`}function O3(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function P3(e,t,r){const s=new Date(e),o=by(t-e);return{label:O3(s,new Date(t))?o:`${o} · ${s.toLocaleDateString(r,{month:"short",day:"numeric"})}`,title:s.toLocaleString(r,{dateStyle:"medium",timeStyle:"medium"})}}function Jj(e,t){return{disabled:e!=null&&e!==t,busy:e===t}}function eT(e){return e==null}const ky="self";function Wr(e,t=!1){const r=Jj(e?ky:null,ky);return{disabled:t||r.disabled,"aria-busy":r.busy}}function js(e){return eT(e?ky:null)}function L3(e){return[...e==null?[]:[`#ap-more-${e}`],".accounts-panel .ap-refresh"]}function $3(e){return e==null||e==="BODY"||e==="HTML"}function i1(e,t){if(!e)return null;const r=t-Math.floor(e/1e3);return r<10?"just now":r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:`${Math.floor(r/3600)}h ago`}function q3(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"}const Tf="__unknown__";function D3(e,t,r,s){const o=Math.max(0,t-s),a=Math.max(0,r-o);if(a<120)return null;const u=Math.min(100,a/r*100),c=e-u;if(Math.abs(c)<3)return{label:"on pace",color:"var(--ok)",expectedPct:u,isDeficit:!1};if(c>0){const f=100-e,p=a>0?e/a:0,d=p>0?f/p:1/0,g={label:`${Math.round(c)}% ahead`,color:"var(--warn)",expectedPct:u,isDeficit:!0};if(d<o&&d<86400){const y=Math.floor(d/3600),w=Math.floor(d%3600/60);g.runsOutIn=y>0?`${y}h ${w}m`:`${w}m`}return g}return{label:`${Math.round(-c)}% reserve`,color:"var(--ok)",expectedPct:u,isDeficit:!1}}function ei({pct:e,label:t,reset:r,resetAt:s,windowSec:o,limitReached:a,nowSec:u}){const c=Math.min(100,Math.max(0,e)),p=a||c>=90?"var(--err)":c>=70?"var(--warn)":"var(--accent)",d=c===0?"< 1%":`${c}%`,g=c===0?2:c,y=s?Zj(s,u):null,w=s&&o?D3(c,s,o,u):null;return m.jsxs("div",{className:"qb-row",children:[m.jsxs("div",{className:"qb-meta",children:[m.jsxs("span",{className:"qb-label",children:[t,a&&m.jsx("span",{className:"qb-limit-badge",title:"Rate limit reached",children:"⛔"})]}),m.jsx("span",{className:"qb-pct",style:{color:p},children:d})]}),m.jsxs("div",{className:"qb-track",children:[m.jsx("div",{className:"qb-fill",style:{width:`${g}%`,background:p,opacity:c===0?.4:1}}),w&&m.jsx("div",{className:"qb-pace-marker",style:{left:`${w.expectedPct}%`,background:w.isDeficit?"var(--err)":"var(--ok)"},title:`To last until reset, stay near ${Math.round(w.expectedPct)}% by now`})]}),m.jsxs("div",{className:"qb-reset-row",children:[y?m.jsxs("span",{className:"qb-reset",children:["resets in ",y]}):r?m.jsxs("span",{className:"qb-reset",children:["resets ",r]}):null,w&&m.jsx("span",{className:"qb-pace",style:{color:w.color},children:w.runsOutIn?`runs out in ${w.runsOutIn}`:w.label})]})]})}const F3=6e4;function z3(e){const[t,r]=N.useState(null),[s,o]=N.useState(!1),a=N.useRef(null),u=N.useRef(!1),c=async(p=!1)=>{if(!(p&&!js(u.current))){p&&(u.current=!0,o(!0));try{const g=await fetch(p?"/api/quota?refresh=1":"/api/quota");g.ok&&r(await g.json())}catch{}finally{p&&(u.current=!1,o(!1))}}};return N.useEffect(()=>{if(e)return c(!0),a.current=window.setInterval(()=>c(!1),F3),()=>{a.current!=null&&window.clearInterval(a.current)}},[e]),{quota:t,loading:s,refresh:()=>{e&&c(!0)}}}function B3(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.";case"untrusted_base_url":return"chatgpt_base_url in ~/.codex/config.toml is not an https OpenAI host, so the token was not sent.";default:return"ChatGPT API unreachable — click ↻ to retry."}}const tT=6e4;function U3(e){const[t,r]=N.useState(null),[s,o]=N.useState(!1),a=N.useRef(null),u=N.useRef(!1),c=async(p=!1)=>{if(!(p&&!js(u.current))){p&&(u.current=!0,o(!0));try{const g=await fetch(p?"/api/codex-quota?refresh=1":"/api/codex-quota");g.ok&&r(await g.json())}catch{}finally{p&&(u.current=!1,o(!1))}}};return N.useEffect(()=>{if(e)return c(!0),a.current=window.setInterval(()=>c(!1),tT),()=>{a.current!=null&&window.clearInterval(a.current)}},[e]),{data:t,loading:s,refresh:()=>{e&&c(!0)}}}function H3(e){const[t,r]=N.useState(null),s=N.useRef(null),o=async()=>{try{const a=await fetch("/api/codex-usage");a.ok&&r(await a.json())}catch{}};return N.useEffect(()=>{if(e)return o(),s.current=window.setInterval(o,tT),()=>{s.current!=null&&window.clearInterval(s.current)}},[e]),{data:t}}function W3({state:e,now:t,providers:r,onClose:s}){var V,X;const{quota:o,loading:a,refresh:u}=z3(r.claude),{data:c,loading:f,refresh:p}=U3(r.codex),{data:d}=H3(r.codex),[g,y]=N.useState(()=>Math.floor(Date.now()/1e3));N.useEffect(()=>{const j=window.setInterval(()=>y(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(j)},[]);const{byModel:w,totalCost:S,totalTokens:_,burnRate:b}=N.useMemo(()=>{const j=new Map;for(const H of e.agents.values())for(const I of nl(H)){const Y=I.model??Tf,ce=Jy(I.usage,I.model),z=j.get(Y);z?(z.inputTokens+=I.usage.inputTokens,z.outputTokens+=I.usage.outputTokens,z.cacheReadTokens+=I.usage.cacheReadTokens,z.cacheCreateTokens+=I.usage.cacheCreateTokens,z.cost.total+=ce.total,z.cost.input+=ce.input,z.cost.output+=ce.output,z.cost.cacheRead+=ce.cacheRead,z.cost.cacheWrite+=ce.cacheWrite,z.agentCount++):j.set(Y,{model:Y,inputTokens:I.usage.inputTokens,outputTokens:I.usage.outputTokens,cacheReadTokens:I.usage.cacheReadTokens,cacheCreateTokens:I.usage.cacheCreateTokens,cost:{...ce},agentCount:1,priced:Eo(I.model)!=null})}const G=Array.from(j.values()).sort((H,I)=>I.cost.total-H.cost.total||I.inputTokens+I.outputTokens-(H.inputTokens+H.outputTokens));let B=0,te=0;for(const H of e.agents.values()){if(H.state!=="active")continue;const I=vn(H);B+=I.total,te=Math.max(te,((H.endedAt??t)-H.startedAt)/1e3)}const Z=te>0?rc(B,te):null,$=Kj(e.agents.values());return{byModel:G,totalCost:$.cost,totalTokens:$,burnRate:Z}},[e,e.revision,t]),k=N.useMemo(()=>{const j=[];for(const G of e.agents.values()){if(G.kind!=="root")continue;let B=vn(G).total,te=G.usage.inputTokens,Z=G.usage.outputTokens,$=wy(G);for(const H of e.agents.values())H.sessionId!==G.sessionId||H.kind==="root"||(B+=vn(H).total,te+=H.usage.inputTokens,Z+=H.usage.outputTokens,$+=wy(H));j.push({sessionId:G.sessionId,label:G.label||G.cwdBasename||"session",state:G.state,cost:B,inputTokens:te,outputTokens:Z,unpricedTokens:$})}return j.sort((G,B)=>B.cost-G.cost||B.inputTokens+B.outputTokens-(G.inputTokens+G.outputTokens)).slice(0,12)},[e,e.revision]),E=S.total>0,C=_.sum,T=w.filter(j=>j.cost.total>0||j.inputTokens+j.outputTokens>0),A=k.filter(j=>j.cost>0||j.inputTokens+j.outputTokens>0),L=T.some(j=>!j.priced),P=a||f,U=i1(o==null?void 0:o.fetchedAt,g),O=i1(c==null?void 0:c.fetchedAt,g),M=()=>{u(),p()},q=r.claude&&r.codex?"Refresh Claude + Codex quota":r.codex?"Refresh Codex quota":"Refresh Claude quota";return m.jsxs("aside",{className:"usage-panel",id:"usage-panel","aria-label":"Usage",children:[m.jsxs("div",{className:"up-header",children:[m.jsx("h2",{children:"Usage"}),b&&m.jsx("span",{className:"up-rate",children:b}),m.jsxs("div",{className:"up-header-right",children:[(r.claude||r.codex)&&m.jsx("button",{type:"button",className:"glyph-btn up-refresh-btn",onClick:M,...Wr(P),"aria-label":q,title:q,children:P?"…":"↻"}),m.jsx("button",{type:"button",className:"glyph-btn up-close",onClick:s,"aria-label":"Close usage panel",title:"Close (U)",children:"×"})]})]}),r.claude&&m.jsxs("section",{className:"up-section up-quota-section",children:[m.jsxs("h3",{className:"up-section-title",children:["Claude quota",U&&!a&&m.jsx("span",{className:"up-section-age",title:q3(o==null?void 0:o.source),children:U})]}),o!=null&&o.ok?m.jsxs("div",{className:"up-quota-bars",children:[o.session5hPct!=null&&m.jsx(ei,{label:"5-hour window",pct:o.session5hPct,reset:o.session5hReset,resetAt:o.session5hResetAt,windowSec:o.session5hWindowSec,nowSec:g}),o.week7dPct!=null&&m.jsx(ei,{label:"7-day window",pct:o.week7dPct,reset:o.week7dReset,resetAt:o.week7dResetAt,windowSec:o.week7dWindowSec,nowSec:g}),o.weekSonnetPct!=null&&m.jsx(ei,{label:"Sonnet (7d)",pct:o.weekSonnetPct,nowSec:g}),o.weekOpusPct!=null&&m.jsx(ei,{label:"Opus (7d)",pct:o.weekOpusPct,nowSec:g})]}):(o==null?void 0:o.ok)===!1?m.jsxs("div",{className:"up-quota-na",children:[m.jsx("span",{children:"Quota unavailable."}),m.jsxs("span",{className:"up-quota-hint",children:["Run ",m.jsx("code",{children:"/usage"})," in a claude session, then click ↻"]})]}):m.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),r.codex&&m.jsxs("section",{className:"up-section up-quota-section",children:[m.jsxs("h3",{className:"up-section-title",children:["Codex quota",(c==null?void 0:c.ok)&&c.planLabel&&m.jsx("span",{className:"up-plan-badge",children:c.planLabel}),O&&!f&&m.jsx("span",{className:"up-section-age",title:"Fetched from the Codex usage endpoint",children:O})]}),c!=null&&c.ok?m.jsxs("div",{className:"up-quota-bars",children:[(V=c.windows)==null?void 0:V.map(j=>m.jsx(ei,{label:j.label,pct:j.pct,reset:j.reset??void 0,resetAt:j.resetAt??void 0,windowSec:j.windowSec??void 0,limitReached:c.limitReached&&j.pct>=100,nowSec:g},j.id)),(X=c.extraWindows)==null?void 0:X.map(j=>m.jsx(ei,{label:j.label,pct:j.pct,reset:j.reset??void 0,resetAt:j.resetAt??void 0,windowSec:j.windowSec??void 0,nowSec:g},j.id)),c.creditLimit&&m.jsx(ei,{label:`spend cap · $${Math.round(c.creditLimit.used)} of $${Math.round(c.creditLimit.limit)}`,pct:c.creditLimit.usedPct,reset:c.creditLimit.reset??void 0,resetAt:c.creditLimit.resetAt??void 0,limitReached:c.spendControlReached,nowSec:g}),c.creditsBalance&&!c.creditsUnlimited&&m.jsxs("div",{className:"up-quota-sub up-credits",children:["credits: $",c.creditsBalance,c.overageReached&&" · overage limit reached"]}),c.creditsUnlimited&&m.jsx("div",{className:"up-quota-sub up-credits",children:"credits: unlimited"}),c.resetCredits&&c.resetCredits.availableCount>0&&m.jsxs("div",{className:"up-quota-sub up-reset-credits",title:`Redeem in the Codex CLI or ChatGPT — ${Yt} only reports them`,children:[c.resetCredits.availableCount," rate-limit reset",c.resetCredits.availableCount!==1?"s":""," available",c.resetCredits.nextExpiryAt&&` · expires ${new Date(c.resetCredits.nextExpiryAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}`]}),c.promo&&m.jsx("div",{className:"up-quota-sub",children:c.promo}),c.partial&&m.jsx("div",{className:"up-quota-sub up-quota-hint",children:"Partial data — OpenAI returned limits this build doesn't recognise."})]}):(c==null?void 0:c.ok)===!1?m.jsxs("div",{className:"up-quota-na",children:[m.jsx("span",{children:"Quota unavailable."}),m.jsx("span",{className:"up-quota-hint",children:B3(c.reason)})]}):m.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"}),(d==null?void 0:d.ok)&&d.window7d&&d.window7d.sessionCount>0&&m.jsxs("div",{className:"up-quota-sub",title:`Counted from the rollout files under CODEX_HOME — no network, no account${d.window5h?`
|
|
74
|
+
last 5h: ${At(d.window5h.totalTokens)} tokens · ${d.window5h.sessionCount} session${d.window5h.sessionCount!==1?"s":""}`:""}`,children:[At(d.window7d.totalTokens)," tokens · ",d.window7d.sessionCount," session",d.window7d.sessionCount!==1?"s":""," (7d)"]})]}),C>0?m.jsxs(m.Fragment,{children:[E&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"up-total",title:ic,children:[m.jsx("span",{className:"up-total-value",children:Ge(S.total)}),m.jsx("span",{className:"up-total-label",children:S3})]}),m.jsx(s0,{cost:S})]}),m.jsxs("div",{className:"up-tokens-row",title:ic,children:[m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"in"}),At(_.inputTokens)]}),m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"out"}),At(_.outputTokens)]}),_.cacheReadTokens>0&&m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"cache r"}),At(_.cacheReadTokens)]}),_.cacheCreateTokens>0&&m.jsxs("span",{className:"up-tok",children:[m.jsx("span",{className:"up-k",children:"cache c"}),At(_.cacheCreateTokens)]}),!E&&m.jsx("span",{className:"up-tok up-scope",children:E3})]}),T.length>0&&m.jsxs("section",{className:"up-section",children:[m.jsx("h3",{className:"up-section-title",children:"By model"}),m.jsxs("table",{className:"up-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Model"}),m.jsx("th",{children:"Tokens"}),m.jsx("th",{children:"Cost"})]})}),m.jsx("tbody",{children:T.map(j=>m.jsxs("tr",{children:[m.jsx("td",{className:"up-model-name",title:j.model===Tf?"no model reported yet":j.model,children:j.model===Tf?"unknown":li(j.model)}),m.jsx("td",{className:"up-num",children:At(j.inputTokens+j.outputTokens)}),j.priced?m.jsx("td",{className:"up-num up-cost-val",children:Ge(j.cost.total)}):m.jsx("td",{className:"up-num up-unpriced",children:Wu})]},j.model))})]})]}),A.length>0&&m.jsxs("section",{className:"up-section",children:[m.jsx("h3",{className:"up-section-title",children:"By session"}),m.jsx("div",{className:"up-sessions",children:A.map(j=>m.jsxs("div",{className:"up-session-row",children:[m.jsx("span",{className:`sl-dot state-${j.state}`,"aria-hidden":!0}),m.jsx("span",{className:"vis-hidden",children:n0(j.state)}),m.jsx("span",{className:"up-session-label",children:j.label}),m.jsx("span",{className:"up-session-tokens",children:At(j.inputTokens+j.outputTokens)}),j.cost>0?m.jsxs("span",{className:"up-session-cost",title:j.unpricedTokens>0?`${At(j.unpricedTokens)} tokens in this session are on an unpriced model, so this is a floor`:void 0,children:[Ge(j.cost),j.unpricedTokens>0?"+":""]}):m.jsx("span",{className:"up-session-cost up-unpriced",children:Wu})]},j.sessionId))})]}),L&&m.jsxs("div",{className:"up-hint",children:["“",Wu,"” means this build holds no published rate for that model — those tokens are counted above and their dollars are not."]})]}):m.jsxs("div",{className:"up-empty",children:["No usage data yet.",m.jsx("br",{}),"Start a Claude Code or Codex session."]})]})}const V3="1",o1="agent-dag.schema",G3=["agent-dag.layout","agent-dag.viewport"];function yc(e){if(typeof window>"u")return null;try{return window.localStorage.getItem(e)}catch{return null}}function Y3(e,t=V3){let r=null;try{r=e.getItem(o1)}catch{return[]}if(r===t)return[];const s=[];if(r!==null)for(const o of G3)try{e.getItem(o)!==null&&(e.removeItem(o),s.push(o))}catch{}try{e.setItem(o1,t)}catch{}return s}const K3=3e3,X3=4e3,Rf=20,ja=36,oo=8,nT="agent-dag.systemPanelOpen";function Q3(){return yc(nT)==="1"}function Z3(e){if(!(typeof window>"u"))try{window.localStorage.setItem(nT,e?"1":"0")}catch{}}function Ha(e){return e>=1024**3?`${(e/1024**3).toFixed(1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} KB`}function J3(e){const t=Math.floor(e/86400),r=Math.floor(e%86400/3600),s=Math.floor(e%3600/60);return t>0?`${t}d ${r}h`:r>0?`${r}h ${s}m`:`${s}m`}function eq(){const[e,t]=N.useState(null),r=N.useRef(null);return N.useEffect(()=>{let s=!0;const o=async()=>{if(document.visibilityState!=="hidden")try{const f=await fetch("/api/system");if(!f.ok)return;const p=await f.json();s&&(p!=null&&p.ok)&&t(p)}catch{}},a=()=>{r.current==null&&(o(),r.current=window.setInterval(o,K3))},u=()=>{r.current!=null&&(window.clearInterval(r.current),r.current=null)},c=()=>{if(document.visibilityState==="hidden"){u();return}a(),o()};return a(),document.addEventListener("visibilitychange",c),()=>{s=!1,u(),document.removeEventListener("visibilitychange",c)}},[]),e}function tq(e){const[t,r]=N.useState(null);return N.useEffect(()=>{let s=!0;const o=async()=>{if(document.visibilityState!=="hidden")try{const u=await fetch("/api/system/processes");if(!u.ok)return;const c=await u.json();s&&(c!=null&&c.ok)&&r(c.procs??[])}catch{}};o();const a=window.setInterval(o,X3);return()=>{s=!1,window.clearInterval(a)}},[e]),t}function nq({usageOpen:e=!1}){const t=eq(),[r,s]=N.useState(Q3);N.useEffect(()=>{Z3(r)},[r]);const o=N.useRef(null),a=N.useRef(null);if(N.useEffect(()=>{if(r)return po.push(()=>{var k,E;const b=((k=a.current)==null?void 0:k.contains(document.activeElement))??!1;s(!1),b&&((E=o.current)==null||E.focus())},zj)},[r]),!t||t.cpu==null||!t.memory)return m.jsx("span",{className:"sysmeter idle",title:"Sampling this machine…",children:m.jsx("span",{className:"sm-box","aria-hidden":!0,children:m.jsxs("span",{className:"sm-graphic",children:[m.jsx("svg",{className:"sm-spark",width:ja,height:oo,viewBox:`0 0 ${ja} ${oo}`}),m.jsx("span",{className:"sm-ram"})]})})});const{cpu:u,cpuHistory:c,cores:f,memory:p,loadavg:d}=t,g=p.usedPct>=90,y=c.slice(-Rf),w=Rf-y.length,S=ja/Rf,_=[`CPU ${u.toFixed(0)}% of ${f} cores`,d?`load ${d[0]} · ${d[1]} · ${d[2]} (1m · 5m · 15m)`:null,`Memory ${Ha(p.total-p.available)} of ${Ha(p.total)} used`,"","Click for detail. This machine, not this session."].filter(b=>b!==null).join(`
|
|
75
|
+
`);return m.jsxs("span",{className:"sysmeter-wrap",children:[m.jsxs("button",{type:"button",ref:o,className:"sysmeter",title:_,"aria-label":"Toggle machine detail","aria-expanded":r,"aria-controls":r?"system-panel":void 0,onClick:()=>s(b=>!b),children:[m.jsxs("span",{className:"sm-box","aria-hidden":!0,children:[m.jsxs("span",{className:"sm-graphic",children:[m.jsx("svg",{className:"sm-spark",width:ja,height:oo,viewBox:`0 0 ${ja} ${oo}`,children:y.map((b,k)=>{const E=w+k,C=Math.max(1,b/100*oo),T=.32+.68*((k+1)/y.length);return m.jsx("rect",{x:E*S,y:oo-C,width:Math.max(.8,S-.7),height:C,rx:.5,fill:"var(--accent)",opacity:T},E)})}),m.jsx("span",{className:"sm-ram",children:m.jsx("span",{className:`sm-ram-fill${g?" warn":""}`,style:{transform:`scaleX(${Math.max(2,p.usedPct)/100})`}})})]}),m.jsxs("span",{className:"sm-read",children:[m.jsx("b",{children:u.toFixed(0)}),m.jsx("i",{children:"·"}),m.jsx("b",{children:p.usedPct.toFixed(0)})]})]}),m.jsxs("span",{className:"sm-sr",children:["CPU ",u.toFixed(0)," percent, memory ",p.usedPct.toFixed(0)," percent used"]})]}),r&&m.jsx(rq,{sys:t,usageOpen:e,panelRef:a,onClose:()=>{var b;s(!1),(b=o.current)==null||b.focus()}})]})}function rq({sys:e,usageOpen:t,panelRef:r,onClose:s}){const o=tq(!0),{memory:a,swap:u,perCore:c,loadavg:f,cores:p,uptimeSec:d,platform:g}=e,y=a?a.total-a.available:0,w=g==="win32"?"Commit":"Swap",S=u&&u.total>0?u.used/u.total*100:0;return m.jsxs("aside",{ref:r,className:`sysdetail${t?" shifted":""}`,id:"system-panel","aria-label":"Machine detail",children:[m.jsxs("div",{className:"sd-head",children:[m.jsx("span",{className:"sd-title",children:"This machine"}),m.jsxs("span",{className:"sd-sub",children:["up ",J3(d)," · ",p," cores"]}),m.jsx("button",{type:"button",className:"glyph-btn sd-close",onClick:s,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]}),c&&c.length>0&&m.jsxs("div",{className:"sd-section",role:"group","aria-label":"Cores",children:[m.jsx("div",{className:"sd-h","aria-hidden":!0,children:"Cores"}),m.jsx("div",{className:"sd-cores",style:{"--n":c.length},children:c.map((_,b)=>m.jsx("span",{className:"sd-core",title:`core ${b+1}: ${_}%`,children:m.jsx("span",{className:"sd-core-fill",style:{transform:`scaleY(${Math.max(2,_)/100})`}})},b))})]}),m.jsxs("div",{className:"sd-section",role:"group","aria-label":"Memory",children:[m.jsx("div",{className:"sd-h","aria-hidden":!0,children:"Memory"}),a&&m.jsx(a1,{label:"Physical",used:y,total:a.total,pct:a.usedPct,note:`${Ha(a.available)} available`}),u&&u.total>0&&m.jsx(a1,{label:w,used:u.used,total:u.total,pct:S,note:S>=50?"paging to disk":void 0})]}),f&&m.jsxs("div",{className:"sd-section",role:"group","aria-label":"Load average",children:[m.jsx("div",{className:"sd-h","aria-hidden":!0,children:"Load average"}),m.jsx("div",{className:"sd-load",children:f.map((_,b)=>m.jsxs("span",{className:`sd-load-item${_>p?" over":""}`,children:[m.jsx("b",{children:_.toFixed(2)}),m.jsx("span",{children:["1m","5m","15m"][b]})]},b))}),m.jsx("div",{className:"sd-note",children:f[0]>p?`${(f[0]/p).toFixed(1)}× more work queued than cores to run it`:`within ${p} cores`})]}),m.jsxs("div",{className:"sd-section",role:"group","aria-label":"Busiest processes",children:[m.jsx("div",{className:"sd-h","aria-hidden":!0,children:"Busiest processes"}),o==null?m.jsx("div",{className:"sd-note",children:"reading…"}):o.length===0?m.jsx("div",{className:"sd-note",children:"Could not read the process list on this platform."}):m.jsxs("table",{className:"sd-procs",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"cpu"}),m.jsx("th",{children:"mem"}),m.jsx("th",{children:"process"})]})}),m.jsx("tbody",{children:o.map(_=>m.jsxs("tr",{children:[m.jsx("td",{className:"sd-num",children:_.cpu==null?"—":_.cpu.toFixed(0)}),m.jsx("td",{className:"sd-num sd-dim",children:_.mem.toFixed(1)}),m.jsx("td",{className:"sd-proc-name",title:`pid ${_.pid}`,children:_.name})]},_.pid))})]})]})]})}function a1({label:e,used:t,total:r,pct:s,note:o}){const a=s>=90;return m.jsxs("div",{className:"sd-row",children:[m.jsxs("div",{className:"sd-row-head",children:[m.jsx("span",{className:"sd-row-label",children:e}),m.jsxs("span",{className:"sd-row-val",children:[m.jsx("b",{children:Ha(t)})," of ",Ha(r)]})]}),m.jsx("span",{className:"sd-track",children:m.jsx("span",{className:`sd-fill${a?" warn":""}`,style:{transform:`scaleX(${Math.max(1,Math.min(100,s))/100})`}})}),o&&m.jsx("div",{className:"sd-note",children:o})]})}const l1=18,sq=1100,ao=(e,t)=>{const r=Math.sin(e*12.9898+t*78.233)*43758.5453;return r-Math.floor(r)},iq=Array.from({length:l1},(e,t)=>{const r=-72+144*t/(l1-1)+(ao(t,1)-.5)*9,s=(r-90)*(Math.PI/180),o=(54+32*Math.cos(r*Math.PI/180))*(.74+ao(t,2)*.52);return{dx:Math.cos(s)*o,dy:Math.sin(s)*o,rot:(t%2?1:-1)*(100+ao(t,3)*260),delay:Math.round(ao(t,4)*90),dur:760+Math.round(ao(t,5)*260),scale:.8+ao(t,6)*.45,hue:t%4,round:t%3===0}});function u1({anchor:e,lifetimeMs:t=sq}){var a;const[r,s]=N.useState(null),o=typeof window<"u"&&((a=window.matchMedia)==null?void 0:a.call(window,"(prefers-reduced-motion: reduce)").matches);return N.useEffect(()=>{if(o)return;const u=e.current;if(!u)return;const c=u.getBoundingClientRect();s({x:c.left+c.width/2,y:c.top+c.height/2});const f=window.setTimeout(()=>s(null),t);return()=>window.clearTimeout(f)},[e,t,o]),o||!r?null:fO.createPortal(m.jsx("div",{className:"confetti",style:{left:`${r.x}px`,top:`${r.y}px`},"aria-hidden":!0,children:iq.map((u,c)=>m.jsx("span",{className:`confetti-bit${u.round?" round":""}`,"data-hue":u.hue,style:{"--dx":`${u.dx.toFixed(1)}px`,"--dy":`${u.dy.toFixed(1)}px`,"--rot":`${u.rot}deg`,"--s":u.scale.toFixed(2),animationDelay:`${u.delay}ms`,animationDuration:`${u.dur}ms, ${u.dur}ms`}},c))}),document.body)}const rT=new Set(["awaiting_url","awaiting_code","registering"]);function oq(e){return e!=null&&rT.has(e)}function sT(e){return e!=null&&e!=="done"&&!rT.has(e)}const aq="the sign-in ended before it finished — the deck restarted, or it was cancelled in another tab",lq="the sign-in did not complete";function uq({state:e,serverError:t,localError:r}){const s=e==="idle";return{title:s?"Sign-in ended":"Sign-in failed",message:r||t||(s?aq:lq)}}const cq="done";function dq(){let e=!1;return{shouldAnnounce(t){return t!==cq?(e=!1,!1):e?!1:(e=!0,!0)}}}function o0(e,t){return t&&Object.hasOwn(e,t)?e[t]:void 0}const fq={already_running:"a sign-in is already in progress",no_url:"the claude CLI did not offer a sign-in link — is it installed?",not_waiting:"that sign-in is no longer waiting for a code",not_prompted:"the CLI has not asked for a code yet",code_rejected:"that code was not accepted — copy it again from the browser",no_verdict:"the claude CLI has not answered — try the code again",empty_code:"paste the code from the browser first",login_failed:"the code was not accepted",no_identity:"signed in, but the CLI still reports nobody logged in",add_failed:"signed in, but claude-swap could not record the account",not_a_share:"that does not look like a shared account — it should start with ccdeck1:",corrupt:"that share is incomplete — copy the whole thing",wrong_version:`that share was made by a newer ${Yt}`,expired:"that share has expired — make a new one",import_failed:"claude-swap refused the import",bad_value:"an alias can only use letters, numbers, spaces, dots, dashes and underscores, up to 64 characters, and cannot start with a dash",bad_email:"that does not look like an email address — it cannot contain spaces or start with a dash"},hq={no_cswap:"claude-swap could not be run — it is not on this deck's PATH. Set AGENTS_DECK_CSWAP to its full path",timeout:"claude-swap took too long and was stopped — try again",switch_failed:"claude-swap refused the switch",bad_account:"that is not an account claude-swap has",unknown_setting:"claude-swap has no such setting",out_of_range:"that value is outside what the setting allows",bad_value:"claude-swap does not accept that value",set_failed:"claude-swap refused the change",command_failed:"claude-swap refused the command"},pq=`claude-swap could not read the login keychain — start ${Yt} from a Terminal window rather than a background service`;function Sy(e,t){if((e==null?void 0:e.reason)!=="no_cswap"&&/keychain/i.test(xo(e)))return pq;const r=o0(hq,e==null?void 0:e.reason);return r||(e==null?void 0:e.reason)||t}function xo(e){return((e==null?void 0:e.output)||(e==null?void 0:e.detail)||(e==null?void 0:e.error)||"").trim()}const mq={no_install:"ccusage is not installed, and AGENTS_DECK_NO_INSTALL=1 forbids fetching it — unset that variable and restart the deck, or install ccusage yourself so it is on this deck's PATH",bad_override:"AGENTS_DECK_CCUSAGE names a file that is not there — correct it to the full path of your ccusage, or unset it to let the deck find its own",timeout:"ccusage took more than 90 seconds and was stopped — a narrower range usually finishes",bad_output:"ccusage ran but printed no usage data — try again, and run ccusage daily --json in a terminal if it keeps happening",run_failed:"ccusage could not report usage — try again",bad_range:"that date range is not a YYYYMMDD date — reopen the modal and pick one of the presets",unreachable:"the deck did not answer — check it is still running, then try again"},gq="ccusage could not be started — npx is not on this deck's PATH. Install Node's npm/npx, or put ccusage on PATH yourself";function vq(e){return/\bnpx\b/i.test(e)&&/(command not found|not found|not recognized|ENOENT)/i.test(e)}const yq="ccusage could not be started — the deck launched npx and Node could not load the npm script it points at. An older deck asked cmd.exe for a bare npx.cmd, which made the shim look for that script under the deck's working directory instead of beside itself; update the deck and reopen this modal",wq="ccusage could not be started — the copy npx fetched will not load: Node could not resolve a file inside it. That copy is in npx's own cache, which the deck never rewrites, so clear it with `npm cache clean --force` and reopen this modal",xq=e=>/\b(?:ERR_)?MODULE_NOT_FOUND\b|cannot find (?:module|package)/i.test(e),_q=/node_modules[\\/]npm[\\/]bin[\\/]|\bnpm-prefix\.js\b|\bnp[mx][-.][\w.-]*cli\.js\b/i,bq=/[\\/]_npx[\\/]/i,kq=`the copy of ccusage ${Yt} installed for itself`;function Sq(e){const t=String((e==null?void 0:e.install)??"").replace(/\s+/g," ").trim();return t.length>240?`${t.slice(0,239)}…`:t}function Eq(e,t){const r=Nq(e,t),s=Sq(e);switch(e==null?void 0:e.stage){case"npx":return s?`ccusage failed on both of its paths. The managed install failed first — ${s} — and the deck then fell back to npx, where ${Ta(r)}`:`there is no managed copy of ccusage on this machine, and the npx fallback failed: ${Ta(r)}`;case"managed":return`${kq} failed to run: ${Ta(r)}`;case"path":return e.bin?`the ccusage this deck found at ${e.bin} failed to run: ${Ta(r)}`:`the ccusage this deck found on your PATH failed to run: ${Ta(r)}`;default:return r}}const Ta=e=>/^[A-Z][a-z]/.test(e)?e[0].toLowerCase()+e.slice(1):e;function Nq(e,t){const r=xo(e);if(xq(r)){if(bq.test(r))return wq;if(_q.test(r))return yq}if(vq(r))return gq;const s=o0(mq,e==null?void 0:e.reason);return s||(e==null?void 0:e.reason)||t}function Vu(e,t){if(e!=null&&e.detail)return e.detail;if(e!=null&&e.error&&sT(e.state))return e.error;const r=o0(fq,e==null?void 0:e.reason);return r||(e!=null&&e.error?e.error:(e==null?void 0:e.reason)||t)}function Cq(e,t,r){if(r<=0||e0(e))return{kind:"pass"};const s=t>=0&&t<r?t:-1;switch(e.key){case"ArrowRight":return{kind:"select",index:s===-1?0:(s+1)%r};case"ArrowLeft":return{kind:"select",index:s===-1?r-1:(s-1+r)%r};case"Home":return{kind:"select",index:0};case"End":return{kind:"select",index:r-1};default:return{kind:"pass"}}}const jq=1500,Ou=[{id:"login",label:"Sign in"},{id:"paste",label:"Paste a share"}],c1="aa-panel",d1=e=>`aa-tab-${e}`;async function Pu(e){return(await fetch("/api/claude-accounts/admin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json().catch(()=>null)}const Ey=ue.forwardRef((e,t)=>m.jsxs("svg",{className:"aa-mark",viewBox:"0 0 44 44","aria-hidden":!0,ref:t,children:[m.jsx("circle",{className:"aa-mark-ring",cx:"22",cy:"22",r:"20"}),m.jsx("path",{className:"aa-mark-tick",d:"M13.5 22.5 L19.5 28.5 L31 17"})]}));Ey.displayName="SuccessMark";function Tq({onClose:e,onChanged:t}){const[r,s]=N.useState("login"),[o,a]=N.useState(null),[u,c]=N.useState(""),[f,p]=N.useState(""),[d,g]=N.useState(!1),[y,w]=N.useState(null),[S,_]=N.useState(null),b=N.useRef(!1),k=N.useRef(!1),E=N.useRef(null),C=N.useRef(null),T=N.useRef(null),A=N.useRef(null),L=N.useRef([]),P=N.useRef(!1),U=N.useCallback(()=>{b.current&&Pu({action:"login-cancel"}).catch(()=>{}),e()},[e]),O=Kr(U,{focusRef:T}),M=N.useCallback(async()=>{if(!js(k.current))return;k.current=!0,g(!0),w(null),b.current=!0;const $=await Pu({action:"login"}).catch(()=>null);if(k.current=!1,g(!1),!($!=null&&$.ok)){w(Vu($,"could not start the sign-in"));return}a($)},[]);N.useEffect(()=>{if(!oq(o==null?void 0:o.state))return;const $=window.setInterval(async()=>{try{const H=await fetch("/api/claude-accounts/login");H.ok&&a(await H.json())}catch{}},jq);return()=>window.clearInterval($)},[o]);const q=N.useRef(t);q.current=t;const V=N.useState(dq)[0];N.useEffect(()=>{var $;(o==null?void 0:o.state)==="awaiting_code"&&(($=E.current)==null||$.focus()),V.shouldAnnounce(o==null?void 0:o.state)&&q.current()},[o==null?void 0:o.state,V]),N.useEffect(()=>{var $;r==="paste"&&!P.current&&(($=C.current)==null||$.focus()),P.current=!1},[r]);const X=N.useCallback($=>{var I;const H=Cq($,Ou.findIndex(Y=>Y.id===r),Ou.length);H.kind!=="pass"&&($.preventDefault(),P.current=!0,s(Ou[H.index].id),(I=L.current[H.index])==null||I.focus())},[r]),j=N.useCallback(async()=>{var H;if(!js(k.current))return;k.current=!0,g(!0),w(null);const $=await Pu({action:"login-code",code:u}).catch(()=>null);if(k.current=!1,g(!1),!($!=null&&$.ok)){w(Vu($,"the code was not accepted")),$!=null&&$.state&&a($),(H=E.current)==null||H.select();return}c(""),a($)},[u,o]),G=N.useCallback(async()=>{if(!js(k.current))return;k.current=!0,g(!0),w(null);const $=await Pu({action:"import",blob:f}).catch(()=>null);if(k.current=!1,g(!1),!($!=null&&$.ok)){w(Vu($,"the import failed"));return}p(""),_({added:$.added===!0,num:$.num??null,email:$.email??null}),t()},[f,t]),B=(o==null?void 0:o.state)==="done"?o.account:null,te=sT(o==null?void 0:o.state)||!!(y&&b.current&&!d),Z=uq({state:o==null?void 0:o.state,serverError:o==null?void 0:o.error,localError:y});return m.jsx("div",{className:"modal-backdrop",onClick:U,role:"presentation",children:m.jsxs("div",{ref:O,className:"modal aa-modal",onClick:$=>$.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Add a Claude account",children:[m.jsxs("header",{className:"modal-head",children:[m.jsx("div",{className:"modal-title",children:m.jsx("span",{className:"aa-tabs",role:"tablist","aria-label":"How to add the account",onKeyDown:X,children:Ou.map(($,H)=>m.jsx("button",{type:"button",role:"tab",id:d1($.id),ref:I=>{L.current[H]=I},"aria-selected":r===$.id,"aria-controls":c1,tabIndex:r===$.id?0:-1,className:`aa-tab${r===$.id?" on":""}`,onClick:()=>{P.current=!1,s($.id)},children:$.label},$.id))})}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"glyph-btn",onClick:U,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),m.jsx("section",{className:"modal-body aa-body",id:c1,role:"tabpanel","aria-labelledby":d1(r),children:r==="login"?B?m.jsxs("div",{className:"aa-done",children:[m.jsx(Ey,{ref:A}),m.jsx(u1,{anchor:A}),m.jsx("h4",{children:B.added?`Account ${B.num} added`:"Credentials refreshed"}),m.jsxs("p",{className:"aa-note",children:[m.jsx("strong",{children:B.email}),B.added?" is in the rotation. The account you were using is still active.":" was already managed, so its stored credentials were replaced."]}),m.jsx("button",{type:"button",className:"btn primary",onClick:e,children:"Done"})]}):(o==null?void 0:o.state)==="awaiting_code"||(o==null?void 0:o.state)==="registering"?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:"1 · Approve in the browser"}),m.jsx("p",{className:"aa-note",children:"A tab should have opened. If not, use this link:"}),m.jsx("a",{className:"aa-link",href:o.url??"#",target:"_blank",rel:"noreferrer noopener",children:o.url})]}),m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:"2 · Paste a code, if the page shows one"}),m.jsx("p",{className:"aa-note",children:"It usually finishes on its own — if the page says you are all set, there is nothing to do here."}),m.jsxs("div",{className:"aa-field",children:[m.jsx("input",{ref:E,type:"text",value:u,onChange:$=>c($.target.value),onKeyDown:$=>{$.key==="Enter"&&u.trim()&&!d&&j()},placeholder:"paste the code here",spellCheck:!1,autoComplete:"off","aria-label":"Sign-in code",disabled:o.state==="registering"}),m.jsx("button",{type:"button",className:"btn primary",...Wr(d,!u.trim()||o.state==="registering"),onClick:j,children:o.state==="registering"?"registering…":"Continue"})]}),(y||o.error)&&m.jsx("p",{className:"aa-err",children:y??o.error}),m.jsx("p",{className:"aa-note",children:"The code goes straight to the claude CLI on this machine. It is never stored or sent anywhere else."})]})]}):te?m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:Z.title}),m.jsx("p",{className:"aa-err",children:Z.message}),m.jsx("button",{type:"button",className:"btn",onClick:()=>{b.current=!1,a(null),w(null),M()},children:"Try again"})]}):d||b.current?m.jsx("div",{className:"aa-step",children:m.jsx("p",{className:"aa-note",children:"Asking the claude CLI for a sign-in link…"})}):m.jsxs("div",{className:"aa-step aa-primer",children:[m.jsx("h4",{children:"Sign in to Anthropic"}),m.jsx("p",{className:"aa-note",children:"Opens a browser tab where you approve the sign-in. It normally completes by itself; only if the page hands you a code does it need pasting back here. claude-swap records the account when it completes, and the account you are using now stays active."}),m.jsx("div",{className:"aa-actions",children:m.jsx("button",{type:"button",ref:T,className:"btn primary",onClick:M,children:"Open the sign-in page"})})]}):S?m.jsxs("div",{className:"aa-done",children:[m.jsx(Ey,{ref:A}),S.added&&m.jsx(u1,{anchor:A}),m.jsx("h4",{children:S.added?`Account ${S.num} imported`:"Already here"}),m.jsx("p",{className:"aa-note",children:S.added?m.jsxs(m.Fragment,{children:[S.email?m.jsx("strong",{children:S.email}):"That account"," is in the rotation now. Nothing changed on the deck you copied it from."]}):"This deck already holds that account, so nothing changed."}),m.jsxs("div",{className:"aa-actions",children:[m.jsx("button",{type:"button",className:"btn primary",onClick:e,children:"Done"}),m.jsx("button",{type:"button",className:"btn",onClick:()=>_(null),children:"Import another"})]})]}):m.jsxs("div",{className:"aa-step",children:[m.jsx("h4",{children:"Paste an account shared from another deck"}),m.jsxs("div",{className:"aa-field",children:[m.jsx("input",{ref:C,type:"text",value:f,onChange:$=>p($.target.value),onKeyDown:$=>{$.key==="Enter"&&f.trim()&&!d&&G()},placeholder:"ccdeck1:…",spellCheck:!1,autoComplete:"off","aria-label":"Shared account"}),m.jsx("button",{type:"button",className:"btn primary",...Wr(d,!f.trim()),onClick:G,children:d?"importing…":"Import"})]}),y&&m.jsx("p",{className:"aa-err",children:y}),m.jsxs("p",{className:"aa-note",children:["Use ",m.jsx("strong",{children:"share"})," on an account in the other deck. A share carries a live login and expires ten minutes after it is made."]})]})})]})})}function Rq(e,t){const r=new Set(e),s=e.length?Math.max(...e):0;return[...new Set([...e,s+1])].sort((o,a)=>o-a).map(o=>{const a=o===t?"here":r.has(o)?"swap":"free";return{slot:o,kind:a,label:a==="here"?`slot ${o}`:`slot ${o} · ${a}`}})}function Aq(e,t,r){if(!(r!=null&&r.ok))return null;const s=Number.isInteger(r.to)?r.to:null;if(s==null)return{menuFor:null,confirmRemove:null,shareFor:null,swapNote:null};const o=r.swapped===!0&&s!==t;return{menuFor:e.menuFor===t?s:o&&e.menuFor===s?t:e.menuFor,confirmRemove:null,shareFor:null,swapNote:o?{at:s,displaced:t}:null}}function Iq(e,t,r){return t!=null&&e.some(s=>s.slot===t)?t:r}function Mq(e,t,r){var o;const s=((o=e.find(a=>a.slot===t))==null?void 0:o.kind)??"here";return s==="swap"?{label:"swap",done:"swapped",sends:!0,swaps:!0,title:`Send this account to slot ${t}. That slot is taken, so the two accounts trade places and the one standing there moves to slot ${r}.`}:s==="free"?{label:"move",done:"moved",sends:!0,swaps:!1,title:`Send this account to slot ${t}. That slot is empty, so no other account moves.`}:{label:"move",done:"here",sends:!1,swaps:!1,title:`This account already holds slot ${r}.`}}function Oq(e,t){return{label:"save",done:"saved",sends:e!==t,swaps:!1,title:`Switch the active account out once it passes ${e}% of its limit.`}}function f1(e){return typeof e.id=="string"&&e.id.startsWith("scoped-")}function h1(e){const t=e.filter(c=>!f1(c)),r=e.filter(c=>f1(c)),s=t.length?t:r,o=t.length?r:[],a=s.reduce((c,f)=>c&&c.pct>=f.pct?c:f,null);let u=null;for(const c of o)a&&c.pct<=a.pct||(!u||c.pct>u.pct)&&(u=c);return{shown:s,rest:o,fuller:u,peak:u??a}}function Pq(e,t,r){return e<1?null:t?"fewer":r?`${r.label} ${Math.round(r.pct)}%`:`${e} more`}function Lq(e,t,r,s){const o=e==null?"No usage has been collected for this account yet.":`${Math.round(e)}% left on ${t??"the window that runs out first"}, which is the one that runs out first.`,a=r===1?"the other window":`the other ${r} windows`;return`${o} ${s?"Hide":"Show"} ${a}.`}const $q="\0";function a0(e){const t=typeof e.email=="string"?e.email.trim():"";if(!t)return`slot:${e.num}`;const r=typeof e.org=="string"?e.org.trim():"";return`acct:${t}${$q}${r}`}function qq(e,t){const r=a0(t);return e.includes(r)?e.filter(s=>s!==r):[...e,r]}function Dq(e,t){if(!Array.isArray(t))return e;const r=new Set(t.map(a0)),s=e.filter(o=>r.has(o));return s.length===e.length?e:s}const Fq=64;function zq(e,t){const r=e.trim();return{alias:r,commit:r!==(t??"").trim()}}const Bq=Object.freeze({text:"couldn't reach the deck server",reload:!0});async function p1(e){return e.ok?{ok:!0,status:e.status,body:null}:{ok:!1,status:e.status,body:await e.json().catch(()=>null)}}function Uq(e){const t=e.find(s=>!s.ok);if(!t)return null;const r=xo(t.body);return{text:Sy(t.body,`the deck server answered ${t.status}`),...r?{raw:r}:{},reload:!0}}function m1(e,t){return t?e!=null&&e.reload&&e.text===t.text&&e.raw===t.raw?e:t:e!=null&&e.reload?null:e}const g1=15e3,Hq=8e3,Af=1800,Wq=3e4,Vq=[70,80,85,90,95];function v1(e,t){return Qj(t-Math.floor(e/1e3))}function Gq(e,t){if(!e)return"";const r=Math.floor(e/1e3)-t;return r<=0?" · due":r<60?` · next in ${r}s`:` · next in ${Math.round(r/60)}m`}function Yq(e){switch(e){case"invalid_grant":case"no_refresh_token":return{text:"login expired",hint:"claude-swap's stored login for this account was rejected and cannot be refreshed. Signing in again replaces it — the account keeps its slot, its alias and its history.",fixable:!0};case"http-401":return{text:"re-login needed",hint:"Anthropic refused this account's token.",fixable:!0};case"http-429":return{text:"rate limited",hint:"Anthropic is throttling requests for this account. It clears on its own.",fixable:!1};case"transient":return{text:"temporary error",hint:"A network or server hiccup while reading usage. The next collection retries.",fixable:!1};case"timeout":return{text:"timed out",hint:"Reading this account's usage took too long. The next collection retries.",fixable:!1};case"network":return{text:"unreachable",hint:"Could not reach Anthropic to read this account's usage.",fixable:!1};default:return{text:e,hint:`claude-swap reported "${e}" for this account.`,fixable:!1}}}function y1({lane:e,nowSec:t}){const r=Math.min(100,Math.max(0,e.pct)),s=r>=90?"var(--err)":r>=70?"var(--warn)":"var(--accent)",o=e.resetAt?Zj(e.resetAt,t):null;return m.jsxs("div",{className:"ap-lane",children:[m.jsx("span",{className:"ap-lane-label",children:e.label}),m.jsx("div",{className:"ap-lane-track",children:m.jsx("div",{className:"ap-lane-fill",style:{width:`${r===0?1.5:r}%`,background:s,opacity:r===0?.4:1}})}),m.jsxs("span",{className:"ap-lane-pct",style:{color:s},children:[r,"%"]}),m.jsx("span",{className:"ap-lane-reset",children:o?`resets ${o}`:""})]})}async function Kq(e){var r;let t=!1;try{t=await Promise.race([((r=navigator.clipboard)==null?void 0:r.writeText(e).then(()=>!0))??Promise.resolve(!1),new Promise(s=>window.setTimeout(()=>s(!1),500))])}catch{t=!1}if(t)return!0;try{const s=document.createElement("textarea");s.value=e,s.setAttribute("readonly",""),s.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(s),s.select(),t=document.execCommand("copy"),s.remove()}catch{t=!1}return t}function Xq(e,t){const r=Math.round(e/1e3)-t;return r<=0?{text:"expired",tone:"gone"}:r<60?{text:`expires in ${r}s`,tone:"soon"}:{text:`expires in ${Math.round(r/60)}m`,tone:"ok"}}function Qq({onClose:e}){var Be,et,Xe,wt;const[t,r]=N.useState(null),[s,o]=N.useState(null),[a,u]=N.useState(null),[c,f]=N.useState(!1),[p,d]=N.useState(null),[g,y]=N.useState(()=>Math.floor(Date.now()/1e3)),w=N.useRef(null),[S,_]=N.useState(null),[b,k]=N.useState(!1),[E,C]=N.useState(""),[T,A]=N.useState(null),[L,P]=N.useState(null),[U,O]=N.useState(null),[M,q]=N.useState(!1),[V,X]=N.useState(null),[j,G]=N.useState(null),[B,te]=N.useState(null),[Z,$]=N.useState(null),[H,I]=N.useState(!1),[Y,ce]=N.useState([]),z=N.useRef(null),Q=N.useCallback(ee=>eT(z.current)?(z.current=ee,u(ee),!0):!1,[]),ne=N.useCallback(()=>{z.current=null,u(null)},[]),ae=(ee,Le=!1)=>{const De=Jj(a,ee);return{disabled:De.disabled,"aria-busy":De.busy||Le}},fe=N.useCallback(ee=>{window.requestAnimationFrame(()=>{var Le;if($3(((Le=document.activeElement)==null?void 0:Le.tagName)??null))for(const De of L3(ee)){const Re=document.querySelector(De);if(Re){Re.focus();return}}})},[]),pe=N.useCallback(async(ee=!1)=>{ee&&f(!0);const Le=new AbortController,De=window.setTimeout(()=>Le.abort(),Wq);try{const[Re,$e]=await Promise.all([fetch(`/api/claude-accounts${ee?"?refresh=1":""}`,{signal:Le.signal}),fetch("/api/cswap-auto",{signal:Le.signal})]);if(Re.ok){const tt=await Re.json();r(tt),ce(Ce=>Dq(Ce,tt.accounts))}$e.ok&&o(await $e.json());const rt=Uq([await p1(Re),await p1($e)]);d(tt=>m1(tt,rt))}catch{d(Re=>m1(Re,Bq))}finally{window.clearTimeout(De),ee&&f(!1)}},[]),ye=N.useCallback(async(ee,Le)=>{if(!Q(Le))return null;d(null);try{const Re=await(await fetch("/api/cswap-auto",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})).json().catch(()=>null);return Re!=null&&Re.ok||d({text:Sy(Re,"command failed"),raw:xo(Re)}),Re}catch{return d({text:"server unreachable"}),null}finally{ne()}},[Q,ne]),Me=N.useCallback(async(ee,Le)=>{if(!Q(Le))return null;d(null);try{const Re=await(await fetch("/api/claude-accounts/admin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})).json().catch(()=>null);return Re!=null&&Re.ok||d({text:Vu(Re,"command failed")}),Re}catch{return d({text:"server unreachable"}),null}finally{ne()}},[Q,ne]);N.useEffect(()=>(pe(!0),w.current=window.setInterval(()=>pe(!1),g1),()=>{w.current!=null&&window.clearInterval(w.current)}),[pe]),N.useEffect(()=>{const ee=window.setInterval(()=>y(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(ee)},[]);const Ue=((Be=s==null?void 0:s.settings["autoswitch.threshold"])==null?void 0:Be.value)??"90",ze=Z??Ue,Ie=Oq(ze,Ue),ke=(et=t==null?void 0:t.accounts)==null?void 0:et.find(ee=>ee.active),le=((Xe=h1((ke==null?void 0:ke.lanes)??[]).peak)==null?void 0:Xe.pct)??null,we=le!=null&&le>=Number(Ue)-15,xe=async ee=>{if(Q(`switch-${ee}`)){d(null);try{const De=await(await fetch("/api/claude-accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:ee})})).json().catch(()=>null);De!=null&&De.ok||d({text:Sy(De,"the switch failed"),raw:xo(De)}),await pe(!0)}catch{d({text:"server unreachable"})}finally{ne(),fe(ee)}}},Ye=async(ee,Le)=>{const{commit:De,alias:Re}=zq(E,Le);if(De){const $e=await Me({action:"alias",account:ee,alias:Re},`alias-${ee}`);if(await pe(!0),!($e!=null&&$e.ok))return;C(Re)}A(ee),window.setTimeout(()=>A($e=>$e===ee?null:$e),Af)},gt=async(ee,Le)=>{const De=await Me({action:"move",account:ee,slot:Le},`move-${ee}`),Re=Aq({menuFor:S,shareFor:(U==null?void 0:U.num)??null},ee,De);if(await pe(!0),Re){_(Re.menuFor),P(Re.confirmRemove),Re.shareFor==null&&(O(null),q(!1)),X(Re.swapNote);const $e=Re.swapNote;$e&&window.setTimeout(()=>X(rt=>rt===$e?null:rt),Hq),G(null),fe(Re.menuFor)}return De},ft=async(ee,Le,De)=>{if(De.sends){const Re=await gt(ee,Le);if(!(Re!=null&&Re.ok))return}te(ee),window.setTimeout(()=>te(Re=>Re===ee?null:Re),Af)},ot=async(ee,Le)=>{if(Le.sends){const De=await ye({action:"setting",key:"autoswitch.threshold",value:ee},"threshold");if(await pe(!0),!(De!=null&&De.ok))return;$(null)}I(!0),window.setTimeout(()=>I(!1),Af)};return m.jsxs("aside",{className:"accounts-panel",id:"accounts-panel","aria-label":"Claude accounts",children:[m.jsxs("div",{className:"ap-header",children:[m.jsx("h2",{children:"Accounts"}),m.jsxs("div",{className:"ap-header-right",children:[m.jsx("button",{type:"button",className:"glyph-btn ap-add",onClick:()=>k(!0),"aria-label":"Add an account",title:"Sign in to another Claude account, or paste one shared from another deck",children:"+"}),m.jsx("button",{type:"button",className:"glyph-btn ap-refresh",onClick:()=>pe(!0),...ae("reload",c),"aria-label":"Reload accounts",title:"Reload from claude-swap",children:c?"…":"↻"}),m.jsx("button",{type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close accounts panel",title:"Close (A)",children:"×"})]})]}),t==null?p?m.jsxs("div",{className:"ap-empty",role:"alert",children:[m.jsx("span",{title:p.raw||void 0,children:p.text}),m.jsxs("span",{className:"ap-hint",children:["No accounts have arrived, so there is nothing to show yet. The panel keeps trying every ",g1/1e3," seconds."]}),m.jsx("button",{type:"button",className:"ap-fix",disabled:c,onClick:()=>pe(!0),children:c?"trying…":"try again"})]}):m.jsx("div",{className:"ap-empty",children:"Checking…"}):t.ok?m.jsxs(m.Fragment,{children:[(wt=t.accounts)==null?void 0:wt.map(ee=>{const{shown:Le,rest:De,fuller:Re,peak:$e}=h1(ee.lanes),rt=Y.includes(a0(ee)),tt=Pq(De.length,rt,Re);return m.jsxs("div",{className:`ap-account${ee.active?" active":""}`,children:[m.jsxs("div",{className:"ap-account-head",children:[m.jsx("span",{className:"ap-num",children:ee.num}),ee.alias&&m.jsx("span",{className:"ap-alias",title:ee.alias,children:ee.alias}),m.jsx("span",{className:"ap-email",title:ee.email??void 0,children:ee.email}),m.jsx("button",{type:"button",id:`ap-more-${ee.num}`,className:`ap-more${S===ee.num?" on":""}`,"aria-label":`Manage account ${ee.num}`,"aria-expanded":S===ee.num,"aria-controls":S===ee.num?`ap-manage-${ee.num}`:void 0,title:"Share, rename, move, remove",onClick:()=>{_(S===ee.num?null:ee.num),C(ee.alias??""),P(null),O(null),q(!1),X(null),A(null),G(null),te(null)},children:"⋯"}),ee.active&&m.jsx("span",{className:"ap-badge-active",children:"active"}),ee.disabled&&m.jsx("span",{className:"ap-badge-held",children:"held out"}),!ee.active&&!ee.disabled&&m.jsx("button",{type:"button",className:"ap-manage-btn ap-switch",...ae(`switch-${ee.num}`),onClick:()=>xe(ee.num),title:`Switch to ${ee.alias??ee.email}`,children:a===`switch-${ee.num}`?"…":"switch"})]}),m.jsx("div",{className:"ap-lanes",id:`ap-lanes-${ee.num}`,children:Le.length?m.jsxs(m.Fragment,{children:[Le.map(Ce=>m.jsx(y1,{lane:Ce,nowSec:g},Ce.id)),rt&&De.map(Ce=>m.jsx(y1,{lane:Ce,nowSec:g},Ce.id))]}):m.jsx("div",{className:"ap-hint",children:"No usage recorded yet."})}),m.jsxs("div",{className:"ap-meta",children:[ee.error&&(()=>{const Ce=Yq(ee.error);return m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"ap-err",title:Ce.hint,children:Ce.text}),Ce.fixable&&m.jsx("button",{type:"button",className:"ap-fix",onClick:()=>k(!0),title:"Open the sign-in dialog. Signing in as this account replaces its stored login in place.",children:"sign in again"})]})})(),tt&&m.jsx("button",{type:"button",className:"ap-lanes-more","aria-expanded":rt,"aria-controls":`ap-lanes-${ee.num}`,title:Lq(ee.headroom,($e==null?void 0:$e.label)??null,De.length,rt),onClick:()=>ce(Ce=>qq(Ce,ee)),children:tt}),(((s==null?void 0:s.enabled)||(s==null?void 0:s.external))&&!ee.active||ee.disabled)&&m.jsx("button",{type:"button",className:"ap-rotate",...ae(`rot-${ee.num}`),onClick:()=>ye({action:"account",account:ee.num,enabled:ee.disabled},`rot-${ee.num}`).then(()=>pe(!0)),title:ee.disabled?"Return this account to auto-rotation":"Hold this account out of auto-rotation",children:ee.disabled?"put back":"hold out"}),ee.fetchedAt?m.jsxs("span",{className:`ap-age${ee.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 ",v1(ee.fetchedAt,g),Gq(ee.nextAt,g)]}):m.jsx("span",{className:"ap-age ap-stale",title:"claude-swap has not read this account yet",children:"never collected"})]}),S===ee.num&&m.jsxs("div",{className:"ap-manage",id:`ap-manage-${ee.num}`,role:"group","aria-label":`Manage account ${ee.num}`,children:[m.jsxs("div",{className:"ap-manage-name",children:[m.jsx("label",{className:"vis-hidden",htmlFor:`ap-alias-${ee.num}`,children:"Alias"}),m.jsx("input",{id:`ap-alias-${ee.num}`,className:"ap-manage-input",type:"text",value:E,onChange:Ce=>C(Ce.target.value),onKeyDown:Ce=>{Ce.key==="Enter"&&Ye(ee.num,ee.alias)},maxLength:Fq,placeholder:"e.g. work",spellCheck:!1,autoFocus:!0}),m.jsx("button",{type:"button",className:"ap-manage-btn",...ae(`alias-${ee.num}`),onClick:()=>Ye(ee.num,ee.alias),title:"A short name to show instead of the email",children:T===ee.num?"saved":"save"})]}),(()=>{const Ce=Rq((t.accounts??[]).map(lt=>lt.num),ee.num),kt=Iq(Ce,j,ee.num),Ve=Mq(Ce,kt,ee.num);return m.jsxs("div",{className:"ap-manage-slot",children:[m.jsx("label",{className:"vis-hidden",htmlFor:`ap-slot-${ee.num}`,children:"Slot"}),m.jsx("span",{className:"ap-field",children:m.jsx("select",{id:`ap-slot-${ee.num}`,value:String(kt),...ae(`move-${ee.num}`),onChange:lt=>G(Number(lt.target.value)),children:Ce.map(lt=>m.jsx("option",{value:lt.slot,children:lt.label},lt.slot))})}),m.jsx("button",{type:"button",className:"ap-manage-btn",...ae(`move-${ee.num}`),title:Ve.title,onClick:()=>ft(ee.num,kt,Ve),children:B===ee.num?Ve.done:Ve.label})]})})(),m.jsxs("div",{className:"ap-manage-acts",children:[m.jsx("button",{type:"button",className:"ap-manage-btn",...ae(`share-${ee.num}`),title:`Copy this account to another ${Yt}. Anyone who has the text can use the account — treat it as the password. The other deck stops accepting it after 10 minutes; that does not make an escaped copy safe.`,onClick:async()=>{q(!1);const Ce=await Me({action:"share",account:ee.num},`share-${ee.num}`);Ce!=null&&Ce.ok&&O({num:ee.num,blob:Ce.blob,expiresAt:Ce.expiresAt})},children:"share"}),m.jsx("button",{type:"button",className:`ap-manage-btn danger${L===ee.num?" armed":""}`,...ae(`rm-${ee.num}`),title:L===ee.num?"This deletes the stored credentials for this account":"Remove this account from claude-swap",onClick:()=>{if(L!==ee.num){P(ee.num),window.setTimeout(()=>P(Ce=>Ce===ee.num?null:Ce),4e3);return}P(null),Me({action:"remove",account:ee.num},`rm-${ee.num}`).then(()=>{_(null),pe(!0),fe(null)})},children:L===ee.num?"confirm":"remove"})]}),(V==null?void 0:V.at)===ee.num&&(()=>{var Ve;const Ce=(Ve=t.accounts)==null?void 0:Ve.find(lt=>lt.num===V.displaced),kt=(Ce==null?void 0:Ce.alias)??(Ce==null?void 0:Ce.email)??"the account that was there";return m.jsxs("span",{className:"ap-manage-hint ap-manage-swap",title:`Slot ${V.at} was taken, so the two accounts traded places: ${kt} now holds slot ${V.displaced}.`,children:["swapped with slot ",V.displaced]})})(),(U==null?void 0:U.num)===ee.num&&(()=>{const Ce=Xq(U.expiresAt,g),kt=Ce.tone==="gone";return m.jsxs("div",{className:`ap-share${kt?" expired":""}`,children:[m.jsx("code",{className:"ap-share-blob",children:U.blob}),m.jsxs("div",{className:"ap-share-foot",children:[m.jsx("button",{type:"button",className:"ap-manage-btn",...ae(`share-${ee.num}`),onClick:async()=>{if(kt){q(!1);const Ve=await Me({action:"share",account:ee.num},`share-${ee.num}`);Ve!=null&&Ve.ok&&O({num:ee.num,blob:Ve.blob,expiresAt:Ve.expiresAt});return}await Kq(U.blob)&&(q(!0),window.setTimeout(()=>q(!1),1800))},children:kt?"make a new share":M?"copied":"copy"}),m.jsxs("span",{className:"ap-manage-hint",title:"This text is the account's password. It is base64 of plain JSON — the expiry inside it is not signed, so anyone holding a copy can change it, and the login itself is in there in the clear either way. The countdown only says how long another deck's import dialog will still accept it. If a copy escapes, sign the account out and back in.",children:[m.jsx("span",{className:"ap-share-warn",children:"this is the password"})," · ",m.jsx("span",{className:`ap-share-expiry ${Ce.tone}`,children:Ce.text})]})]})]})})()]})]},ee.num)}),(s==null?void 0:s.ok)&&m.jsxs("div",{className:"ap-auto",children:[m.jsxs("div",{className:"ap-auto-head",children:[m.jsx("h3",{className:"ap-auto-title",children:"Auto-switch"}),m.jsxs("span",{className:"ap-auto-ctl",children:[le!=null&&m.jsxs("span",{className:`ap-auto-now${we?" near":""}`,children:[Math.round(le),"%"]}),m.jsx("span",{className:"ap-field",title:"Switch once the active account passes this much of its limit",children:m.jsx("select",{"aria-label":"Switch threshold",value:ze,...ae("threshold"),onChange:ee=>$(ee.target.value),children:Vq.map(ee=>m.jsxs("option",{value:ee,children:[ee,"%"]},ee))})}),m.jsx("button",{type:"button",className:"ap-manage-btn",...ae("threshold"),title:Ie.title,onClick:()=>ot(ze,Ie),children:H?Ie.done:Ie.label}),m.jsxs("button",{type:"button",className:`ap-auto-state${s.enabled?" live":""}`,role:"switch","aria-checked":s.enabled,"aria-label":"Auto-switch",...ae("enable"),onClick:()=>ye({action:"enable",enabled:!s.enabled},"enable").then(()=>pe(!0)),title:s.enabled?"Stop switching accounts automatically":"Switch accounts automatically when the active one nears its limit",children:[m.jsx("i",{className:s.enabled?"ap-pulse":"ap-dot","aria-hidden":!0}),s.enabled?"on":"off"]})]})]}),s.external&&m.jsxs("p",{className:"ap-auto-note",children:[m.jsx("i",{className:"ap-pulse","aria-hidden":!0})," A ",m.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&&m.jsx("div",{className:"ap-auto-foot",children:m.jsxs("span",{className:"ap-auto-result",children:["checked ",v1(s.lastTick.at,g)]})})]}),p&&m.jsxs("div",{className:"ap-failure",role:"alert",children:[m.jsx("span",{className:"ap-failure-text",title:p.raw||void 0,children:p.text}),m.jsx("button",{type:"button",className:"ap-failure-x",onClick:()=>d(null),"aria-label":"Dismiss this message",title:"Dismiss",children:"×"})]}),m.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:"These numbers only update while this panel is open."})]}):m.jsx("div",{className:"ap-empty",children:t.reason==="no_cswap"?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"claude-swap isn't installed."}),m.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."}),t.hint&&m.jsx("code",{className:"ap-cmd",children:t.hint}),m.jsxs("span",{className:"ap-hint",children:["Then add an account with the ",m.jsx("strong",{children:"+"})," button above."]})]}):t.reason==="no_accounts"?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"No accounts added yet."}),m.jsxs("span",{className:"ap-hint",children:["claude-swap is installed but has nothing in its store. Use the ",m.jsx("strong",{children:"+"})," above to sign one in, or to paste one shared from another deck."]})]}):m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"Couldn't read the account store."}),m.jsxs("span",{className:"ap-hint",children:["claude-swap is installed, but its store could not be read",t.reason?` (${t.reason})`:"","."]})]})}),b&&m.jsx(Tq,{onClose:()=>k(!1),onChanged:()=>pe(!0)})]})}const Zq=3e4;function Jq({bundle:e,running:t,lastTried:r}){return!t||e===t?!1:r!==t}function e4({bundle:e,running:t,pending:r,lastTried:s}){return t?Jq({bundle:e,running:t,lastTried:s})?"reload":r==null||r&&r!==t?"wait":"confirm":"wait"}function t4(e){return!e||e.state!=="failed"?null:`${typeof e.at=="number"?e.at:0}:${e.error??""}`}function n4({asked:e,reported:t}){return t?t!==e:!1}function r4(e){const t=e.thresholdMs??Zq;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>=t}}function s4(e,t){return e==="confirmation"?t.confirmOpen?"clear":"ignore":t.modalOpen||t.confirmOpen?"ignore":"confirm"}function i4(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.decks!="number"||typeof t.mine!="boolean")return null;const r=t.owner&&typeof t.owner=="object"?t.owner.port:null;return{path:typeof t.path=="string"&&t.path!==""?t.path:null,decks:t.decks,mine:t.mine,ownerPort:typeof r=="number"?r:null}}function o4(e){return e<=0?null:e===1?"the one agent":`all ${e} agents`}function a4(e,t){const r=o4(e),s=r?`removes ${r} on the canvas`:null,o=c=>`This ${s?`${s} and ${c}`:c}`;if(!t)return{note:`${o("deletes the event log on disk")} — the file a restarted deck replays to rebuild what you see, and the file every deck on this machine shares unless one was told otherwise. Layout, pins and selection go with it. This cannot be undone.`,confirm:"Clear everything"};if(!t.path)return{note:`${o("leaves nothing on disk — this deck keeps no event log")}. Layout, pins and selection go with it. This cannot be undone.`,confirm:"Clear everything"};if(!t.mine){const c=t.ownerPort===null?"another running deck owns that file":`the deck on port ${t.ownerPort} owns that file`,f=t.decks>2?`, one of ${t.decks} decks sharing it`:"";return{note:`${o(`leaves the event log alone: ${c}${f}`)}. Clearing here empties this canvas only — restart this deck and the log replays back onto it. Layout, pins and selection go with it.`,confirm:"Clear this canvas"}}if(t.decks<=1)return{note:`${o("deletes this deck's event log")} — the file a restarted deck replays to rebuild what you see. Layout, pins and selection go with it. This cannot be undone.`,confirm:"Clear everything"};const a=t.decks-1,u=a===1?"That deck keeps what is on its canvas until it restarts, and then it is gone there too.":"Those decks keep what is on their canvases until they restart, and then it is gone there too.";return{note:`${o(`deletes the event log ${a===1?"1 other running deck shares":`${a} other running decks share`} with this one`)} — every session recorded in it, not just the ones drawn here. ${u} This cannot be undone.`,confirm:"Clear everything"}}function l4({agentCount:e,onConfirm:t,onCancel:r}){const s=N.useRef(null),o=Kr(r,{focusRef:s,layer:l$}),[a,u]=N.useState(null);N.useEffect(()=>{let p=!1;return fetch("/api/clear").then(d=>d.ok?d.json():null).then(d=>{p||u(i4(d))}).catch(()=>{}),()=>{p=!0}},[]);const{note:c,confirm:f}=a4(e,a);return m.jsx("div",{className:"modal-backdrop",onClick:r,role:"presentation",children:m.jsxs("div",{ref:o,className:"modal clear-confirm",onClick:p=>p.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"clear-confirm-title",children:[m.jsxs("header",{className:"modal-head",children:[m.jsxs("div",{className:"modal-title",children:[m.jsx("span",{className:"status-dot err","aria-hidden":!0}),m.jsx("span",{id:"clear-confirm-title",className:"modal-tool-name",children:"Clear the deck?"})]}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"glyph-btn",onClick:r,"aria-label":"Cancel (Esc)",title:"Cancel (Esc)",children:"×"})})]}),m.jsxs("section",{className:"modal-body",children:[m.jsx("p",{className:"modal-note",children:c}),m.jsxs("div",{className:"cc-actions",children:[m.jsx("button",{type:"button",ref:s,className:"btn",onClick:r,children:"Cancel"}),m.jsx("button",{type:"button",className:"btn danger",onClick:t,children:f})]})]})]})})}const u4="One-key shortcuts run when nothing on the page has focus. A focused control keeps its own keys — this sheet included, which takes the keyboard while it is open — so Esc is the way back to the canvas.",c4=[{title:"Canvas",rows:[{cap:"Space",action:"pause or resume the stream",binds:[" "]},{cap:"J",action:"next agent",binds:["j","J"]},{cap:"K",action:"previous agent",binds:["k","K"]},{cap:"F",action:"fit every agent on screen",binds:["f","F"]},{cap:"R",action:"re-arrange the canvas and drop the pins",binds:["r","R"]},{cap:"C",action:"clear the canvas and the event log — asks first",binds:["c","C"]}]},{title:"Panels and dialogs",rows:[{cap:"U",action:"usage panel",binds:["u","U"]},{cap:"L",action:"session list",binds:["l","L"]},{cap:"H",action:"usage history",binds:["h","H"]},{cap:"A",action:"Claude accounts, where Claude Code is installed",binds:["a","A"]},{cap:"?",action:"this sheet",binds:["?"]}]},{title:"Settings",rows:[{cap:"M",action:"sound on or off",binds:["m","M"]},{cap:"T",action:"light or dark theme",binds:["t","T"]}]},{title:"Focus and selection",rows:[{cap:"Tab",action:"reach the agent cards",binds:[]},{cap:"Enter",action:"select the focused card",binds:["Enter"]},{cap:"Shift + Enter",action:"add the focused card to the selection",binds:["Enter"]},{cap:"Esc",action:"close what is open, deselect, release focus",binds:["Escape"]}]},{title:"Mouse",rows:[{cap:"drag",action:"move a node, and pin it where you dropped it",binds:[]},{cap:"shift-click",action:"add an agent to the selection",binds:[]},{cap:"click",action:"the topbar speaker opens volume and sound settings",binds:[]}]}];function d4({onClose:e}){const t=Kr(e);return m.jsx("div",{className:"modal-backdrop",onClick:e,role:"presentation",children:m.jsxs("div",{ref:t,className:"modal key-help",onClick:r=>r.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"key-help-title",children:[m.jsxs("header",{className:"modal-head",children:[m.jsx("div",{className:"modal-title",children:m.jsx("span",{id:"key-help-title",className:"modal-tool-name",children:"Keyboard shortcuts"})}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"glyph-btn",onClick:e,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),m.jsxs("section",{className:"modal-body",children:[m.jsx("p",{className:"modal-note",children:u4}),m.jsx("div",{className:"shortcuts",children:c4.map(r=>m.jsxs(N.Fragment,{children:[m.jsx("h3",{className:"kh-group",children:r.title}),r.rows.map(s=>m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:s.cap}),m.jsx("span",{children:s.action})]},`${r.title}:${s.cap}:${s.action}`))]},r.title))})]})]})})}const f4=["done","needs-input"],h4=[{id:"two",label:"Two notes",notes:[{at:0,hz:740,ms:90},{at:.085,hz:440,ms:150}]},{id:"arc",label:"Descent",notes:[{at:0,hz:988,ms:80},{at:.07,hz:659,ms:80},{at:.14,hz:440,ms:160}]},{id:"tap",label:"Double tap",notes:[{at:0,hz:740,ms:55},{at:.055,hz:740,ms:55},{at:.165,hz:440,ms:150}]},{id:"chord",label:"Chord",trim:.7,notes:[{at:0,hz:988,ms:110},{at:0,hz:740,ms:110},{at:.1,hz:440,ms:170}]},{id:"bell",label:"Bell",type:"triangle",notes:[{at:0,hz:740,ms:120},{at:.11,hz:440,ms:260}]},{id:"blip",label:"Blip",type:"square",trim:.7,notes:[{at:0,hz:740,ms:55},{at:.06,hz:440,ms:90}]}],p4=[{id:"two",label:"Two notes",notes:[{at:0,hz:440,ms:90},{at:.085,hz:740,ms:150}]},{id:"arc",label:"Ascent",notes:[{at:0,hz:440,ms:80},{at:.07,hz:659,ms:80},{at:.14,hz:988,ms:160}]},{id:"tap",label:"Double tap",notes:[{at:0,hz:440,ms:55},{at:.055,hz:440,ms:55},{at:.165,hz:740,ms:150}]},{id:"chord",label:"Chord",trim:.7,notes:[{at:0,hz:440,ms:110},{at:.1,hz:740,ms:170},{at:.1,hz:988,ms:170}]},{id:"bell",label:"Bell",type:"triangle",notes:[{at:0,hz:440,ms:120},{at:.11,hz:740,ms:260}]},{id:"blip",label:"Blip",type:"square",trim:.7,notes:[{at:0,hz:440,ms:55},{at:.06,hz:740,ms:90}]}],l0={done:h4,"needs-input":p4},_o="two";function Ny(e,t){const r=l0[e];return r.find(s=>s.id===t)??r.find(s=>s.id===_o)??r[0]}function iT(e,t){return l0[e].some(s=>s.id===t)?t:_o}Ny("done",_o).notes,Ny("needs-input",_o).notes;const w1=.04,m4=.24,oT=0,u0=100,Cy=5,Wa=50;function Va(e){if(!Number.isFinite(e))return Wa;const t=Math.round(e/Cy)*Cy;return Math.min(u0,Math.max(oT,t))}function g4(e){if(e==null)return Wa;const t=e.trim();return/^-?\d+(\.\d+)?$/.test(t)?Va(Number(t)):Wa}function v4(e){const t=Va(e),r=w1+(m4-w1)*(t/u0);return Math.round(r*1e4)/1e4}function y4(e,t){const r=t.trim,s=typeof r=="number"&&Number.isFinite(r)&&r>0&&r<=1?r:1;return Math.round(v4(e)*s*1e4)/1e4}const w4=160,x4="agent-dag.soundLevel.done",_4="agent-dag.soundLevel.needs-input",b4="agent-dag.soundFigure.done",k4="agent-dag.soundFigure.needs-input",aT={done:x4,"needs-input":_4},lT={done:b4,"needs-input":k4},jy={done:{level:Wa,figure:_o},"needs-input":{level:Wa,figure:_o}};function S4(e){const t=r=>({level:g4(e(aT[r])),figure:iT(r,e(lT[r]))});return{done:t("done"),"needs-input":t("needs-input")}}const E4={Stop:"done",Notification:"needs-input"};function N4(e,t){var s;if(t)return null;const r=(s=e==null?void 0:e.payload)==null?void 0:s.hook_event_name;return typeof r!="string"?null:E4[r]??null}function C4(e={enabled:()=>!0}){const t=e.ctor??(typeof window<"u"?window.AudioContext??window.webkitAudioContext??null:null);let r=null,s=!1;const o=()=>e.enabled()?s&&(r==null?void 0:r.state)==="running"?"ready":"locked":"off",a=()=>{var f;return(f=e.onState)==null?void 0:f.call(e,o())};function u(){var f;if(!(!t||s))try{r=r??new t,(f=r.resume)==null||f.call(r).then(a,()=>{}),s=!0,a()}catch{}}function c(f,p=!1){var S;if(!p&&!e.enabled()||!r||r.state!=="running")return!1;const d=(((S=e.prefs)==null?void 0:S.call(e))??jy)[f]??jy[f],g=Ny(f,d.figure),y=y4(d.level,g),w=r.currentTime;for(const _ of g.notes){const b=r.createOscillator(),k=r.createGain();b.type=g.type??"sine",b.frequency.value=_.hz;const E=w+_.at,C=E+_.ms/1e3;k.gain.setValueAtTime(1e-4,E),k.gain.exponentialRampToValueAtTime(y,E+.012),k.gain.exponentialRampToValueAtTime(1e-4,C),b.connect(k).connect(r.destination),b.start(E),b.stop(C+.02)}return!0}return{unlock:u,play:c,state:o,get context(){return r}}}const x1={done:"Turn finished","needs-input":"Claude is asking"},j4={done:"Every finished turn, on both CLIs.","needs-input":"Claude Code only — Codex has no such event."};function T4({onClose:e,soundOn:t,onToggleSound:r,prefs:s,onLevel:o,onFigure:a,onPreview:u,openerRef:c}){const f=Kr(e),p=N.useRef(e);return p.current=e,N.useEffect(()=>{const d=g=>{var w,S;const y=g.target;y&&((w=f.current)!=null&&w.contains(y)||(S=c.current)!=null&&S.contains(y)||p.current())};return window.addEventListener("pointerdown",d,!0),()=>window.removeEventListener("pointerdown",d,!0)},[f,c]),m.jsxs("div",{ref:f,id:"sound-menu",className:"sound-menu",role:"dialog","aria-label":"Sound settings",children:[m.jsxs("button",{type:"button",className:"btn sm-switch",onClick:r,"aria-pressed":t,children:[m.jsx("span",{className:"sm-switch-label",children:"Sound"}),m.jsx("span",{className:"sm-switch-state",children:t?"on":"off"})]}),f4.map(d=>{const g=s[d],y=`sm-level-${d}`,w=`sm-figure-${d}`;return m.jsxs("section",{className:"sm-tone","aria-labelledby":`sm-name-${d}`,children:[m.jsxs("div",{className:"sm-tone-head",children:[m.jsx("h3",{className:"sm-tone-name",id:`sm-name-${d}`,children:x1[d]}),m.jsxs("button",{type:"button",className:"btn sm-hear",onClick:()=>u(d),"aria-label":`Hear the ${x1[d].toLowerCase()} tone`,children:[m.jsx("svg",{width:"11",height:"11",viewBox:"0 0 12 12",fill:"currentColor","aria-hidden":!0,children:m.jsx("path",{d:"M3 1.6v8.8l7-4.4z"})}),"Hear it"]})]}),m.jsxs("div",{className:"sm-row",children:[m.jsx("label",{htmlFor:y,children:"Volume"}),m.jsx("input",{id:y,type:"range",min:oT,max:u0,step:Cy,value:g.level,onChange:S=>o(d,Number(S.target.value))}),m.jsxs("span",{className:"sm-read",children:[g.level,"%"]})]}),m.jsxs("div",{className:"sm-row",children:[m.jsx("label",{htmlFor:w,children:"Sound"}),m.jsx("select",{id:w,className:"sm-select",value:g.figure,onChange:S=>a(d,S.target.value),children:l0[d].map(S=>m.jsx("option",{value:S.id,children:S.label},S.id))})]}),m.jsx("p",{className:"sm-note",children:j4[d]})]},d)}),m.jsx("p",{className:"sm-foot",children:"M turns the sound on and off from anywhere."})]})}const R4={"//":["What a user would NOTICE. One key per version that has something to say,","and no key at all for a version that has nothing — which is most of them.","","The rule this file exists to serve: before every release, ask 'what would a","user notice?' and write the answer here. 'Nothing user-visible' is a valid","and expected answer, and it is spelled by adding no key. A release with no","key shows no modal, and that silence is what keeps the modal worth reading","on the day it is not silent.","","What belongs here: something that changed on the user's machine or under","their hands — a hook written to or removed from settings.json, a default","that flipped, a control that moved or went away, a stored preference that","changed meaning. What does not: bounds, races, assertions that could not","fire, anything that is invisible when it is correct.","","Write it for the person running the deck, not for the person reading the","diff. `title` is the sentence they scan; `body` is what they need in order","to act on it, or to stop worrying about it.","","Keys are versions exactly as package.json spells them. A key that is not a","version, or an entry missing either field, fails the suite rather than","being quietly dropped — see src/web/__tests__/release-notes-file.test.ts.","Ordering here is for humans; the deck sorts by version itself.","","A title may open with an emoji, and if it does, put exactly ONE space after","it. Not two: the dialog gives a leading emoji its own optical gap, because","a colour glyph is drawn edge to edge inside its advance and one word space","after one reads as none. A second space here would be a lie in the data","about a defect in the type, and the suite refuses both it and no space at","all."],"1.46.0":[{title:"🔊 Pick a volume and a sound for each of the two tones",body:`Click the speaker in the top bar and a small menu opens. There are two tones — one when a turn finishes, one when Claude is waiting for you — and each has its own volume and its own sound, six to choose from. Press "Hear it" to try one straight away, without waiting for a real turn.
|
|
76
76
|
|
|
77
77
|
The two lists are separate on purpose, so you can never end up with both tones sounding the same. A finish tone always falls; an asking tone always rises. That is how you tell them apart without looking at the screen.
|
|
78
78
|
|
|
79
79
|
M still turns the sound on and off from anywhere.`},{title:"✨ This box is new",body:`After an update, the deck tells you what changed — once, and only when there is something worth telling. Most updates have nothing to say and you will see nothing at all.
|
|
80
80
|
|
|
81
|
-
Click the version at the top of the deck to read it again whenever you like.`}],"1.45.0":[{title:"🔕 The deck no longer puts anything in your settings.json",body:"It used to add a hook there so Claude Code would play a sound when a turn ended. That entry is removed the first time you start this version, and any sound hook you wrote yourself is put back exactly where you had it. Nothing else in that file is touched. The deck makes the sound itself now — which is also why you finally hear one when a Codex turn ends, not just a Claude one."}]},lT="agent-dag.releaseNotesSeen";function x1(e){return e.split(/[.\-+]/).map(t=>parseInt(t,10)).map(t=>Number.isNaN(t)?0:t)}function Wa(e,t){const r=x1(e),s=x1(t);for(let o=0;o<Math.max(r.length,s.length);o++){const a=(r[o]??0)-(s[o]??0);if(a!==0)return a<0?-1:1}return 0}function Va(e){return typeof e=="string"&&/^\d+\.\d+\.\d+/.test(e)}function A4(e){if(!e||typeof e!="object")return!1;const{title:t,body:r}=e;return typeof t=="string"&&t.trim()!==""&&typeof r=="string"&&r.trim()!==""}function I4(e){if(!e||typeof e!="object")return[];const t=[];for(const[r,s]of Object.entries(e)){if(!Va(r)||!Array.isArray(s))continue;const o=s.filter(A4);o.length&&t.push({version:r,notes:o})}return t.sort((r,s)=>Wa(s.version,r.version))}const _1=I4(R4);function uT(e,t,r){return e.filter(s=>Wa(s.version,r)<=0&&(t===null||Wa(s.version,t)>0))}function M4(e){if(!e.length)return"";const t=e[0].version,r=e[e.length-1].version;return t===r?`v${t}`:`v${r} – v${t}`}function O4({since:e,running:t,entries:r}){if(!r.length)return"Nothing in this build has anything to report yet. Most releases do not, which is the point.";if(e!==null){const a=r.length===1?"one release":`${r.length} releases`;return`You were last caught up at v${e}. Since then ${a} changed something you would notice. Clicking the version in the topbar brings this back.`}const s=r[0].version;if(!Va(t))return"Everything this build has to say, newest first. Most releases have nothing here, which is why the deck stays quiet about them.";const o=Wa(s,t);return o<0?`v${t} — the release you are running — changed nothing you would notice, which most releases do not. Below is the last release that did, and everything before it, newest first.`:o>0?"Everything this build has to say, newest first. Most releases have nothing here, which is why the deck stays quiet about them.":`You are running v${t}, and this is what it changed — and everything before it, newest first. Most releases have nothing here, which is why the deck stays quiet about them.`}const P4=new RegExp("^(?:\\p{Extended_Pictographic}|\\p{Emoji_Modifier}|\\p{Regional_Indicator}|[\\u200D\\uFE0F])+(?= \\S)","u");function L4(e){const t=P4.exec(e);return t?{icon:t[0],rest:e.slice(t[0].length)}:{icon:null,rest:e}}function $4(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function q4(e){if(!e)return null;let t=null;try{t=e.getItem(lT)}catch{return null}return Va(t)?t:null}function D4(e,t){if(!e)return!1;try{return e.setItem(lT,t),!0}catch{return!1}}function F4({stored:e,running:t,notes:r}){if(!Va(t))return{show:[],record:null,reason:"no-version"};if(!Va(e))return{show:[],record:t,reason:"first-run"};const s=Wa(e,t);if(s===0)return{show:[],record:null,reason:"seen"};if(s>0)return{show:[],record:null,reason:"ahead"};const o=uT(r,e,t);return o.length?{show:o,record:t,reason:"new-notes"}:{show:[],record:t,reason:"nothing-new"}}function z4({entries:e,since:t,running:r,onClose:s}){const o=Kr(s),a=M4(e);return m.jsx("div",{className:"modal-backdrop",onClick:s,role:"presentation",children:m.jsxs("div",{ref:o,className:"modal release-notes",onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"release-notes-title",children:[m.jsxs("header",{className:"modal-head",children:[m.jsxs("div",{className:"modal-title",children:[m.jsx("span",{id:"release-notes-title",className:"modal-tool-name",children:"What's new"}),a&&m.jsx("span",{className:"modal-tool-id",children:a})]}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"glyph-btn",onClick:s,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),m.jsxs("section",{className:"modal-body",children:[m.jsx("p",{className:"modal-note",children:O4({since:t,running:r,entries:e})}),e.map(u=>m.jsxs("section",{className:"modal-section",children:[m.jsxs("h3",{className:"rn-version",children:["v",u.version]}),m.jsx("ul",{className:"rn-notes",children:u.notes.map((c,f)=>{const{icon:p,rest:d}=L4(c.title);return m.jsxs("li",{className:"rn-note",children:[m.jsxs("p",{className:"rn-note-title",children:[p&&m.jsx("span",{className:"rn-note-icon",children:p}),d]}),m.jsx("p",{className:"rn-note-body",children:c.body})]},f)})})]},u.version))]})]})})}function B4(e){return e.slice().sort((t,r)=>t.y-r.y||t.x-r.x)}function U4(e,t,r){var u;if(e.length===0)return null;const s=B4(e),o=t?s.findIndex(c=>c.id===t):-1,a=o===-1?r===1?0:s.length-1:(o+r+s.length)%s.length;return((u=s[a])==null?void 0:u.id)??null}const H4=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Escape","Delete","Backspace"]);function W4(e,t){return t==null?{kind:"deck",nodeId:null}:e.key==="Enter"||e.key===" "?{kind:"activate",nodeId:t,additive:e.shiftKey}:H4.has(e.key)?{kind:"node",nodeId:t}:{kind:"deck",nodeId:t}}const V4=new Set(["","BODY","HTML","#DOCUMENT"]);function G4(e){return!e||t0(e)?!1:!V4.has(String(e.tagName??"").toUpperCase())}function Lu(e,t){if(t.size!==0)for(const r of Array.from(e.keys()))t.has(r)||e.delete(r)}function Y4(e,t){let r=!1;for(const o of e)if(!t.has(o)){r=!0;break}if(!r)return e;const s=new Set;for(const o of e)t.has(o)&&s.add(o);return s}function K4(e){const t=new Set;for(const r of e)t.add(r.id),t.add(`group:${r.sessionId}`);return t}function X4(e,t){if(!t||!e.agents.get(t))return null;const s=new Set([t]);let o=t;for(;o;){const u=e.agents.get(o);if(!(u!=null&&u.parentId)||s.has(u.parentId))break;s.add(u.parentId),o=u.parentId}let a=!0;for(;a;){a=!1;for(const u of e.agents.values())u.parentId&&s.has(u.parentId)&&!s.has(u.id)&&(s.add(u.id),a=!0)}return s}function Q4(e,t){const r=new Set;for(const s of t){const o=X4(e,s);if(o)for(const a of o)r.add(a)}return r.size>0?r:null}function cT(e,t,r){return!t.has(e)||r.has(e)}function Z4(e,t,r,s){return!t.has(e)&&cT(e,r,s)}function J4(e,t,r){const s={x:0,y:0};return t.set(e,s),r.add(e),s}function eD(e,t,r,s){r.set(e,t),s.delete(e)}const tD=40,nD=120;function rD(e,t){let r=null,s=0,o=Number.NEGATIVE_INFINITY;const a=()=>{r=null,o=t.now(),e()},u=()=>{r!=null&&(t.clearTimeout(r),r=null)},c=(f,p,d)=>{if(r!=null){if(s<=f)return;u()}const g=Math.min(d,Math.max(0,f-p));s=f,r=t.setTimeout(a,g)};return{live(f=tD){const p=t.now(),d=Math.max(o+f,p);if(d<=p){u(),a();return}c(d,p,f)},replay(f=nD){u(),s=t.now()+f,r=t.setTimeout(a,f)},flush(){u(),a()},cancel(){u()}}}const sD=1e3;function iD(e={}){const t=Math.max(1,Math.floor(e.limit??sD)),r=e.protect;let s=!1,o=[],a=new Set,u=0,c=0,f=null;return{get paused(){return s},get size(){return o.length},get dropped(){return u},get overflowed(){return u>0},get through(){return c},accept(p){const d=typeof(p==null?void 0:p.seq)=="number"?p.seq:null,g=(p==null?void 0:p.epoch)??null,y=g!==null&&g!==f;y&&(f=g,c=0);const w=d!==null&&!y&&d<=c;if(d!==null&&d>c&&(c=d),!s)return!0;if(w)return!1;if(o.push(p),r!=null&&r(p)&&a.add(p),o.length>t){let S=0;if(a.size<o.length)for(;a.has(o[S]);)S++;const[_]=o.splice(S,1);a.delete(_),u++}return!1},setPaused(p){if(s=p,p)return[];const d=o;return o=[],a=new Set,u=0,d}}}const dT="agent-dag.theme";function oD(e){return e==="light"?"light":"dark"}function aD(){return oD(yc(dT))}function lD({waiting:e,running:t}){return{title:e>0?`(${e}) ${Yt}`:Yt,icon:e>0?"waiting":t>0?"running":"idle"}}const If={waiting:"#c97d12",running:"#2a90d4",idle:"#7e828c"};function Mf(e,t){return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">${t==="waiting"?`<circle cx="16" cy="16" r="14.5" fill="${e}"/>`:`<circle cx="16" cy="16" r="12" fill="none" stroke="${e}" stroke-width="5"/>`+(t==="running"?`<circle cx="16" cy="16" r="5" fill="${e}"/>`:"")}</svg>`}const uD=Object.freeze({waiting:`data:image/svg+xml,${encodeURIComponent(Mf(If.waiting,"waiting"))}`,running:`data:image/svg+xml,${encodeURIComponent(Mf(If.running,"running"))}`,idle:`data:image/svg+xml,${encodeURIComponent(Mf(If.idle,"idle"))}`}),cD="No sessions are waiting for you.";function dD(e){if(e.length===0)return"";const[t,...r]=e;if(r.length===0)return`${t.label} is waiting for your permission.`;const s=`${r.length} more session${r.length===1?"":"s"}`;return`${t.label} and ${s} are waiting for your permission.`}function fD(e,t){return t!==""?t:e===""?"":cD}function hD(){let e=0;return{begin(){const t=++e;return()=>t===e},cancel(){e++}}}function pD(e,t=new Date){return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()-(e-1))).toISOString().slice(0,10).replace(/-/g,"")}function mD(e){return!e.answer||e.answer.range!==e.want?{phase:"busy",stale:!1}:e.answer.ok?{phase:e.answer.days>0?"chart":"empty",stale:e.loading}:{phase:"error",stale:e.loading}}function gD(e){return e.claude&&e.codex?"Claude Code and Codex":e.claude?"Claude Code":e.codex?"Codex":null}const b1={claude:"Claude Code",codex:"Codex",opencode:"OpenCode",openclaw:"OpenClaw",copilot:"GitHub Copilot",pi:"pi-agent"};function c0(e){const t=e.toLowerCase();return Object.hasOwn(b1,t)?b1[t]:t?t[0].toUpperCase()+t.slice(1):""}function vD(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function yD(e,t=[]){const r=t.length?vD(t.map(c0)):gD(e);return r?`via ccusage · local ${r} logs`:"via ccusage · local agent logs"}function wD(e){const t=e.claude?{provider:"claude",watching:!0,spans:[{text:"Claude Code sends its events through a hook in "},{text:"~/.claude/settings.json",code:!0},{text:" — or in "},{text:"$CLAUDE_CONFIG_DIR/settings.json",code:!0},{text:" when you have that set — which the deck installs on first run."}]}:{provider:"claude",watching:!1,spans:[{text:"Claude Code capture is off: no Claude Code was found on this machine, or the deck was started with "},{text:"--no-claude",code:!0},{text:"."}]},r=e.codex?{provider:"codex",watching:!0,spans:[{text:"Codex installs nothing and needs no trust prompt — the deck reads "},{text:"~/.codex/sessions/",code:!0},{text:" itself, so an empty canvas means no rollout has been written there yet, or that "},{text:"$CODEX_HOME",code:!0},{text:" points at a different tree."}]}:{provider:"codex",watching:!1,spans:[{text:"Codex capture is off: no "},{text:"~/.codex/",code:!0},{text:" was found — set "},{text:"$CODEX_HOME",code:!0},{text:" if yours lives elsewhere — or the deck was started with "},{text:"--no-codex",code:!0},{text:"."}]};return[t,r]}function xD(e,t){const r=t.prefs??jy,s=Ha(r.done.level),o=Ha(r["needs-input"].level),a=s===o?`${s}%`:`${s}% and ${o}%`,u=t.on?`Sound: on at ${a} — a tone when a turn finishes, another when Claude asks for you (M)`:"Sound: off — press M, or use the switch in here, for a tone when a turn finishes (M)",c=e.codex?`
|
|
81
|
+
Click the version at the top of the deck to read it again whenever you like.`}],"1.45.0":[{title:"🔕 The deck no longer puts anything in your settings.json",body:"It used to add a hook there so Claude Code would play a sound when a turn ended. That entry is removed the first time you start this version, and any sound hook you wrote yourself is put back exactly where you had it. Nothing else in that file is touched. The deck makes the sound itself now — which is also why you finally hear one when a Codex turn ends, not just a Claude one."}]},c0="agent-dag.releaseNotesSeen";function _1(e){return e.split(/[.\-+]/).map(t=>parseInt(t,10)).map(t=>Number.isNaN(t)?0:t)}function bo(e,t){const r=_1(e),s=_1(t);for(let o=0;o<Math.max(r.length,s.length);o++){const a=(r[o]??0)-(s[o]??0);if(a!==0)return a<0?-1:1}return 0}function ko(e){return typeof e=="string"&&/^\d+\.\d+\.\d+/.test(e)}function A4(e){if(!e||typeof e!="object")return!1;const{title:t,body:r}=e;return typeof t=="string"&&t.trim()!==""&&typeof r=="string"&&r.trim()!==""}function I4(e){if(!e||typeof e!="object")return[];const t=[];for(const[r,s]of Object.entries(e)){if(!ko(r)||!Array.isArray(s))continue;const o=s.filter(A4);o.length&&t.push({version:r,notes:o})}return t.sort((r,s)=>bo(s.version,r.version))}const b1=I4(R4);function uT(e,t,r){return e.filter(s=>bo(s.version,r)<=0&&(t===null||bo(s.version,t)>0))}function M4(e,t){return e.filter(r=>bo(r.version,t)===0)}function O4(e){if(!e.length)return"";const t=e[0].version,r=e[e.length-1].version;return t===r?`v${t}`:`v${r} – v${t}`}function P4({since:e,running:t,entries:r,firstRun:s}){if(!r.length)return"Nothing in this build has anything to report yet. Most releases do not, which is the point.";if(e!==null){const u=r.length===1?"one release":`${r.length} releases`;return`You were last caught up at v${e}. Since then ${u} changed something you would notice. Clicking the version in the topbar brings this back.`}if(s&&ko(t))return`The deck has not run in this browser before, so this is what v${t} — the release you have — changed. Earlier releases are not repeated here; clicking the version in the topbar brings all of them back.`;const o=r[0].version;if(!ko(t))return"Everything this build has to say, newest first. Most releases have nothing here, which is why the deck stays quiet about them.";const a=bo(o,t);return a<0?`v${t} — the release you are running — changed nothing you would notice, which most releases do not. Below is the last release that did, and everything before it, newest first.`:a>0?"Everything this build has to say, newest first. Most releases have nothing here, which is why the deck stays quiet about them.":`You are running v${t}, and this is what it changed — and everything before it, newest first. Most releases have nothing here, which is why the deck stays quiet about them.`}const L4=new RegExp("^(?:\\p{Extended_Pictographic}|\\p{Emoji_Modifier}|\\p{Regional_Indicator}|[\\u200D\\uFE0F])+(?= \\S)","u");function $4(e){const t=L4.exec(e);return t?{icon:t[0],rest:e.slice(t[0].length)}:{icon:null,rest:e}}function q4(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function D4(e){if(!e)return null;let t=null;try{t=e.getItem(c0)}catch{return null}return ko(t)?t:null}function F4(e){if(!e)return!1;try{return e.getItem(c0),!0}catch{return!1}}function z4(e,t){if(!e)return!1;try{return e.setItem(c0,t),!0}catch{return!1}}function B4({stored:e,running:t,notes:r,remembers:s=!0}){if(!ko(t))return{show:[],record:null,reason:"no-version"};if(!ko(e)){if(!s)return{show:[],record:t,reason:"cannot-remember"};const u=M4(r,t);return u.length?{show:u,record:t,reason:"welcome"}:{show:[],record:t,reason:"first-run"}}const o=bo(e,t);if(o===0)return{show:[],record:null,reason:"seen"};if(o>0)return{show:[],record:null,reason:"ahead"};const a=uT(r,e,t);return a.length?{show:a,record:t,reason:"new-notes"}:{show:[],record:t,reason:"nothing-new"}}function U4({entries:e,since:t,running:r,firstRun:s,onClose:o}){const a=Kr(o),u=O4(e);return m.jsx("div",{className:"modal-backdrop",onClick:o,role:"presentation",children:m.jsxs("div",{ref:a,className:"modal release-notes",onClick:c=>c.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"release-notes-title",children:[m.jsxs("header",{className:"modal-head",children:[m.jsxs("div",{className:"modal-title",children:[m.jsx("span",{id:"release-notes-title",className:"modal-tool-name",children:"What's new"}),u&&m.jsx("span",{className:"modal-tool-id",children:u})]}),m.jsx("div",{className:"modal-actions",children:m.jsx("button",{type:"button",className:"glyph-btn",onClick:o,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})})]}),m.jsxs("section",{className:"modal-body",children:[m.jsx("p",{className:"modal-note",children:P4({since:t,running:r,firstRun:s,entries:e})}),e.map(c=>m.jsxs("section",{className:"modal-section",children:[m.jsxs("h3",{className:"rn-version",children:["v",c.version]}),m.jsx("ul",{className:"rn-notes",children:c.notes.map((f,p)=>{const{icon:d,rest:g}=$4(f.title);return m.jsxs("li",{className:"rn-note",children:[m.jsxs("p",{className:"rn-note-title",children:[d&&m.jsx("span",{className:"rn-note-icon",children:d}),g]}),m.jsx("p",{className:"rn-note-body",children:f.body})]},p)})})]},c.version))]})]})})}function H4(e){return e.slice().sort((t,r)=>t.y-r.y||t.x-r.x)}function W4(e,t,r){var u;if(e.length===0)return null;const s=H4(e),o=t?s.findIndex(c=>c.id===t):-1,a=o===-1?r===1?0:s.length-1:(o+r+s.length)%s.length;return((u=s[a])==null?void 0:u.id)??null}const V4=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Escape","Delete","Backspace"]);function G4(e,t){return t==null?{kind:"deck",nodeId:null}:e.key==="Enter"||e.key===" "?{kind:"activate",nodeId:t,additive:e.shiftKey}:V4.has(e.key)?{kind:"node",nodeId:t}:{kind:"deck",nodeId:t}}const Y4=new Set(["","BODY","HTML","#DOCUMENT"]);function K4(e){return!e||t0(e)?!1:!Y4.has(String(e.tagName??"").toUpperCase())}function Lu(e,t){if(t.size!==0)for(const r of Array.from(e.keys()))t.has(r)||e.delete(r)}function X4(e,t){let r=!1;for(const o of e)if(!t.has(o)){r=!0;break}if(!r)return e;const s=new Set;for(const o of e)t.has(o)&&s.add(o);return s}function Q4(e){const t=new Set;for(const r of e)t.add(r.id),t.add(`group:${r.sessionId}`);return t}function Z4(e,t){if(!t||!e.agents.get(t))return null;const s=new Set([t]);let o=t;for(;o;){const u=e.agents.get(o);if(!(u!=null&&u.parentId)||s.has(u.parentId))break;s.add(u.parentId),o=u.parentId}let a=!0;for(;a;){a=!1;for(const u of e.agents.values())u.parentId&&s.has(u.parentId)&&!s.has(u.id)&&(s.add(u.id),a=!0)}return s}function J4(e,t){const r=new Set;for(const s of t){const o=Z4(e,s);if(o)for(const a of o)r.add(a)}return r.size>0?r:null}function cT(e,t,r){return!t.has(e)||r.has(e)}function eD(e,t,r,s){return!t.has(e)&&cT(e,r,s)}function tD(e,t,r){const s={x:0,y:0};return t.set(e,s),r.add(e),s}function nD(e,t,r,s){r.set(e,t),s.delete(e)}const rD=40,sD=120;function iD(e,t){let r=null,s=0,o=Number.NEGATIVE_INFINITY;const a=()=>{r=null,o=t.now(),e()},u=()=>{r!=null&&(t.clearTimeout(r),r=null)},c=(f,p,d)=>{if(r!=null){if(s<=f)return;u()}const g=Math.min(d,Math.max(0,f-p));s=f,r=t.setTimeout(a,g)};return{live(f=rD){const p=t.now(),d=Math.max(o+f,p);if(d<=p){u(),a();return}c(d,p,f)},replay(f=sD){u(),s=t.now()+f,r=t.setTimeout(a,f)},flush(){u(),a()},cancel(){u()}}}const oD=1e3;function aD(e={}){const t=Math.max(1,Math.floor(e.limit??oD)),r=e.protect;let s=!1,o=[],a=new Set,u=0,c=0,f=null;return{get paused(){return s},get size(){return o.length},get dropped(){return u},get overflowed(){return u>0},get through(){return c},accept(p){const d=typeof(p==null?void 0:p.seq)=="number"?p.seq:null,g=(p==null?void 0:p.epoch)??null,y=g!==null&&g!==f;y&&(f=g,c=0);const w=d!==null&&!y&&d<=c;if(d!==null&&d>c&&(c=d),!s)return!0;if(w)return!1;if(o.push(p),r!=null&&r(p)&&a.add(p),o.length>t){let S=0;if(a.size<o.length)for(;a.has(o[S]);)S++;const[_]=o.splice(S,1);a.delete(_),u++}return!1},setPaused(p){if(s=p,p)return[];const d=o;return o=[],a=new Set,u=0,d}}}const dT="agent-dag.theme";function lD(e){return e==="light"?"light":"dark"}function uD(){return lD(yc(dT))}function cD({waiting:e,running:t}){return{title:e>0?`(${e}) ${Yt}`:Yt,icon:e>0?"waiting":t>0?"running":"idle"}}const If={waiting:"#c97d12",running:"#2a90d4",idle:"#7e828c"};function Mf(e,t){return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">${t==="waiting"?`<circle cx="16" cy="16" r="14.5" fill="${e}"/>`:`<circle cx="16" cy="16" r="12" fill="none" stroke="${e}" stroke-width="5"/>`+(t==="running"?`<circle cx="16" cy="16" r="5" fill="${e}"/>`:"")}</svg>`}const dD=Object.freeze({waiting:`data:image/svg+xml,${encodeURIComponent(Mf(If.waiting,"waiting"))}`,running:`data:image/svg+xml,${encodeURIComponent(Mf(If.running,"running"))}`,idle:`data:image/svg+xml,${encodeURIComponent(Mf(If.idle,"idle"))}`}),fD="No sessions are waiting for you.";function hD(e){if(e.length===0)return"";const[t,...r]=e;if(r.length===0)return`${t.label} is waiting for your permission.`;const s=`${r.length} more session${r.length===1?"":"s"}`;return`${t.label} and ${s} are waiting for your permission.`}function pD(e,t){return t!==""?t:e===""?"":fD}function mD(){let e=0;return{begin(){const t=++e;return()=>t===e},cancel(){e++}}}function gD(e,t=new Date){return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()-(e-1))).toISOString().slice(0,10).replace(/-/g,"")}function vD(e){return!e.answer||e.answer.range!==e.want?{phase:"busy",stale:!1}:e.answer.ok?{phase:e.answer.days>0?"chart":"empty",stale:e.loading}:{phase:"error",stale:e.loading}}function yD(e){return e.claude&&e.codex?"Claude Code and Codex":e.claude?"Claude Code":e.codex?"Codex":null}const k1={claude:"Claude Code",codex:"Codex",opencode:"OpenCode",openclaw:"OpenClaw",copilot:"GitHub Copilot",pi:"pi-agent"};function d0(e){const t=e.toLowerCase();return Object.hasOwn(k1,t)?k1[t]:t?t[0].toUpperCase()+t.slice(1):""}function wD(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function xD(e,t=[]){const r=t.length?wD(t.map(d0)):yD(e);return r?`via ccusage · local ${r} logs`:"via ccusage · local agent logs"}function _D(e){const t=e.claude?{provider:"claude",watching:!0,spans:[{text:"Claude Code sends its events through a hook in "},{text:"~/.claude/settings.json",code:!0},{text:" — or in "},{text:"$CLAUDE_CONFIG_DIR/settings.json",code:!0},{text:" when you have that set — which the deck installs on first run."}]}:{provider:"claude",watching:!1,spans:[{text:"Claude Code capture is off: no Claude Code was found on this machine, or the deck was started with "},{text:"--no-claude",code:!0},{text:"."}]},r=e.codex?{provider:"codex",watching:!0,spans:[{text:"Codex installs nothing and needs no trust prompt — the deck reads "},{text:"~/.codex/sessions/",code:!0},{text:" itself, so an empty canvas means no rollout has been written there yet, or that "},{text:"$CODEX_HOME",code:!0},{text:" points at a different tree."}]}:{provider:"codex",watching:!1,spans:[{text:"Codex capture is off: no "},{text:"~/.codex/",code:!0},{text:" was found — set "},{text:"$CODEX_HOME",code:!0},{text:" if yours lives elsewhere — or the deck was started with "},{text:"--no-codex",code:!0},{text:"."}]};return[t,r]}function bD(e,t){const r=t.prefs??jy,s=Va(r.done.level),o=Va(r["needs-input"].level),a=s===o?`${s}%`:`${s}% and ${o}%`,u=t.on?`Sound: on at ${a} — a tone when a turn finishes, another when Claude asks for you (M)`:"Sound: off — press M, or use the switch in here, for a tone when a turn finishes (M)",c=e.codex?`
|
|
82
82
|
|
|
83
83
|
Both CLIs get the finish tone. The second tone — Claude is waiting for you — has no Codex equivalent to fire on, so it only ever plays for Claude Code.`:"",f=t.on&&t.locked?`
|
|
84
84
|
|
|
85
85
|
Waiting for a click: this browser plays no sound until the page has been used at least once. Anything you press unlocks it.`:"";return u+c+f+`
|
|
86
86
|
|
|
87
|
-
Click to set the volume and the sound of each tone, and to hear either one.`}function fT(e){const t=new Map;for(const r of e)for(const s of r.agents??[]){if(!s||typeof s.agent!="string"||s.agent==="")continue;const o=t.get(s.agent)??{id:s.agent,cost:0,tokens:0};o.cost+=Number.isFinite(s.totalCost)?s.totalCost:0,o.tokens+=Number.isFinite(s.totalTokens)?s.totalTokens:0,t.set(s.agent,o)}return[...t.values()].sort((r,s)=>s.cost-r.cost||r.id.localeCompare(s.id))}function _D(e){const t=fT([{agents:e}]);return t.length<2?null:t.map(r=>`${c0(r.id)} ${Ge(r.cost)}`).join(" · ")}function k1(e){switch(e.toLowerCase()){case"claude":return"var(--usage-purple)";case"codex":return"var(--usage-orange)";case"gemini":return"var(--usage-indigo)";case"copilot":return"var(--usage-green)";default:return"var(--usage-zinc)"}}function bD(e,t){if(!(t>0)||!(e>0))return"0%";const r=e/t*100;return r<.1?"<0.1%":`${r.toFixed(1)}%`}function $u(e){const t=e.toLowerCase();return t.includes("opus")?"var(--usage-purple)":t.includes("sonnet")?"var(--usage-blue)":t.includes("haiku")?"var(--usage-green)":t.includes("gpt-5")||t.includes("gpt5")?"var(--usage-amber)":t.includes("gpt")?"var(--usage-red)":t.includes("gemini")?"var(--usage-indigo)":t.includes("codex")?"var(--usage-orange)":"var(--usage-zinc)"}const kD=[7,14,30,90];function SD(e){const[t,r]=N.useState(null),[s,o]=N.useState(!1),a=N.useState(hD)[0],u=N.useRef(!1),c=(f=!1)=>{if(f&&!js(u.current))return;const p=a.begin();u.current=f;const d=e;o(!0);const y=`/api/ccusage?since=${pD(d)}${f?"&refresh=1":""}`;fetch(y).then(w=>w.json()).then(w=>{p()&&r({range:d,resp:w})}).catch(()=>{p()&&r({range:d,resp:{ok:!1,reason:"unreachable"}})}).finally(()=>{p()&&(u.current=!1,o(!1))})};return N.useEffect(()=>(c(!1),()=>a.cancel()),[e]),{landed:t,loading:s,reload:()=>c(!0)}}function ED({onClose:e,providers:t}){var U;const[r,s]=N.useState(30),[o,a]=N.useState(null),{landed:u,loading:c,reload:f}=SD(r),p=N.useRef(null),d=Kr(e,{focusRef:p}),g=mD({loading:c,want:r,answer:u&&{range:u.range,ok:u.resp.ok===!0,days:((U=u.resp.days)==null?void 0:U.length)??0}}),y=g.phase==="chart"?u.resp.days??[]:[],w=N.useMemo(()=>y.reduce((O,M)=>Math.max(O,M.totalCost),0),[y]),S=N.useRef(null);N.useLayoutEffect(()=>{const O=S.current;O&&(O.scrollLeft=O.scrollWidth)},[y]);const{totalCost:_,totalTok:b,inOut:k,cacheRead:E,modelCosts:C}=N.useMemo(()=>{let O=0,M=0,q=0,V=0;const X=new Map;for(const j of y){O+=j.totalCost,M+=j.totalTokens,q+=j.inputTokens+j.outputTokens,V+=j.cacheReadTokens;for(const G of j.modelBreakdowns)X.set(G.modelName,(X.get(G.modelName)??0)+G.cost)}return{totalCost:O,totalTok:M,inOut:q,cacheRead:V,modelCosts:X}},[y]),T=N.useMemo(()=>Array.from(C.entries()).sort((O,M)=>M[1]-O[1]),[C]),A=N.useMemo(()=>fT(y),[y]),L=A.length>1,P=o?y.find(O=>O.period===o)??null:null;return m.jsx("div",{className:"uh-backdrop",onClick:e,role:"presentation",children:m.jsxs("div",{ref:d,className:"uh-modal",onClick:O=>O.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Usage history",children:[m.jsxs("header",{className:"uh-head",children:[m.jsxs("div",{className:"uh-titlewrap",children:[m.jsx("div",{className:"uh-title",children:"Usage history"}),m.jsx("div",{className:"uh-sub",children:yD(t,A.map(O=>O.id))})]}),m.jsx("div",{className:"uh-range",role:"group","aria-label":"Range",children:kD.map(O=>m.jsxs("button",{type:"button","aria-pressed":r===O,className:"uh-range-btn",onClick:()=>{s(O),a(null)},children:[O,"d"]},O))}),m.jsx("button",{className:"glyph-btn uh-reload",onClick:f,...Wr(c),title:"Re-run ccusage","aria-label":"Reload",children:c?"…":"↻"}),m.jsx("button",{ref:p,className:"glyph-btn uh-close",onClick:e,"aria-label":"Close",children:"×"})]}),g.phase==="busy"?m.jsx("div",{className:"uh-status","aria-busy":"true",children:u?"running ccusage…":"running ccusage… (first run downloads the package)"}):g.phase==="error"?m.jsxs("div",{className:"uh-status uh-err",title:xo(u.resp)||void 0,children:[Eq(u.resp,"ccusage did not report usage"),m.jsx("div",{children:m.jsx("button",{className:"btn uh-retry",onClick:f,...Wr(c),children:c?"trying…":"Try again"})})]}):g.phase==="empty"?m.jsx("div",{className:`uh-status${g.stale?" uh-stale":""}`,"aria-busy":g.stale||void 0,children:"no usage in this range"}):m.jsxs("div",{className:g.stale?"uh-stale":void 0,"aria-busy":g.stale||void 0,children:[m.jsxs("div",{className:"uh-totals",children:[m.jsx(qu,{label:"total cost",val:Ge(_),accent:!0}),m.jsx(qu,{label:"tokens",val:At(b)}),m.jsx(qu,{label:"input+output",val:At(k)}),m.jsx(qu,{label:"cache reads",val:At(E)})]}),L&&m.jsxs("div",{className:"uh-agents",role:"group","aria-label":"Cost by CLI",children:[m.jsx("div",{className:"uh-agent-bar","aria-hidden":"true",children:A.map(O=>m.jsx("span",{className:"uh-agent-seg",style:{width:`${_>0?O.cost/_*100:0}%`,background:k1(O.id)}},O.id))}),m.jsx("div",{className:"uh-agent-keys",children:A.map(O=>m.jsxs("span",{className:"uh-agent-key",title:`${O.id} · ${At(O.tokens)} tokens`,children:[m.jsx("span",{className:"uh-legend-dot",style:{background:k1(O.id)}}),c0(O.id),m.jsx("span",{className:"uh-agent-cost",children:Ge(O.cost)}),m.jsx("span",{className:"uh-agent-share",children:bD(O.cost,_)})]},O.id))})]}),m.jsx("div",{ref:S,className:"uh-chart",role:"group","aria-label":"Daily cost by model",children:y.map(O=>{const M=w>0?O.totalCost/w*100:0,q=O.period===o,V=`${O.period}, ${Ge(O.totalCost)}`;return m.jsxs("button",{className:`uh-bar-col${q?" sel":""}`,onClick:()=>a(q?null:O.period),"aria-pressed":q,"aria-label":V,title:`${O.period} · ${Ge(O.totalCost)}`,style:{flexBasis:`${100/y.length}%`},children:[m.jsx("div",{className:"uh-bar",style:{height:`${Math.max(M,O.totalCost>0?2:0)}%`},children:O.modelBreakdowns.slice().sort((X,j)=>j.cost-X.cost).map(X=>{const j=O.totalCost>0?X.cost/O.totalCost*100:0;return m.jsx("div",{className:"uh-bar-seg",style:{height:`${j}%`,background:$u(X.modelName)}},X.modelName)})}),m.jsx("span",{className:"uh-bar-label",children:O.period.slice(5)})]},O.period)})}),m.jsx("div",{className:"uh-legend",children:T.map(([O,M])=>m.jsxs("span",{className:"uh-legend-item",title:O,children:[m.jsx("span",{className:"uh-legend-dot",style:{background:$u(O)}}),li(O)," ",m.jsx("span",{className:"uh-legend-cost",children:Ge(M)})]},O))}),P&&m.jsxs("div",{className:"uh-detail",children:[m.jsxs("div",{className:"uh-detail-head",children:[m.jsx("span",{className:"uh-detail-date",children:P.period}),m.jsx("span",{className:"uh-detail-cost",children:Ge(P.totalCost)}),(()=>{var q,V;const M=_D(P.agents)??((V=(q=P.metadata)==null?void 0:q.agents)!=null&&V.length?P.metadata.agents.join(" · "):null);return M?m.jsx("span",{className:"uh-detail-agents",title:M,children:M}):null})()]}),m.jsxs("div",{className:"uh-detail-mini",children:[m.jsx(Du,{label:"input",val:At(P.inputTokens)}),m.jsx(Du,{label:"output",val:At(P.outputTokens)}),m.jsx(Du,{label:"cache write",val:At(P.cacheCreationTokens)}),m.jsx(Du,{label:"cache read",val:At(P.cacheReadTokens)})]}),m.jsx("div",{className:"uh-detail-models",children:P.modelBreakdowns.slice().sort((O,M)=>M.cost-O.cost).map(O=>{const M=P.totalCost>0?O.cost/P.totalCost*100:0;return m.jsxs("div",{className:"uh-model-row",title:O.modelName,children:[m.jsxs("span",{className:"uh-model-name",children:[m.jsx("span",{className:"uh-legend-dot",style:{background:$u(O.modelName)}}),m.jsx("span",{className:"uh-model-label",children:li(O.modelName)})]}),m.jsx("span",{className:"uh-model-bar",children:m.jsx("span",{className:"uh-model-bar-fill",style:{width:`${M}%`,background:$u(O.modelName)}})}),m.jsx("span",{className:"uh-model-cost",children:Ge(O.cost)})]},O.modelName)})})]})]})]})})}function qu({label:e,val:t,accent:r}){return m.jsxs("div",{className:"uh-stat",children:[m.jsx("span",{className:`uh-stat-val${r?" accent":""}`,children:t}),m.jsx("span",{className:"uh-stat-label",children:e})]})}function Du({label:e,val:t}){return m.jsxs("div",{className:"uh-ministat",children:[m.jsx("span",{className:"uh-ministat-val",children:t}),m.jsx("span",{className:"uh-ministat-label",children:e})]})}function d0(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 Of,S1;function ND(){if(S1)return Of;S1=1;function e(){this.__data__=[],this.size=0}return Of=e,Of}var Pf,E1;function So(){if(E1)return Pf;E1=1;function e(t,r){return t===r||t!==t&&r!==r}return Pf=e,Pf}var Lf,N1;function wc(){if(N1)return Lf;N1=1;var e=So();function t(r,s){for(var o=r.length;o--;)if(e(r[o][0],s))return o;return-1}return Lf=t,Lf}var $f,C1;function CD(){if(C1)return $f;C1=1;var e=wc(),t=Array.prototype,r=t.splice;function s(o){var a=this.__data__,u=e(a,o);if(u<0)return!1;var c=a.length-1;return u==c?a.pop():r.call(a,u,1),--this.size,!0}return $f=s,$f}var qf,j1;function jD(){if(j1)return qf;j1=1;var e=wc();function t(r){var s=this.__data__,o=e(s,r);return o<0?void 0:s[o][1]}return qf=t,qf}var Df,T1;function TD(){if(T1)return Df;T1=1;var e=wc();function t(r){return e(this.__data__,r)>-1}return Df=t,Df}var Ff,R1;function RD(){if(R1)return Ff;R1=1;var e=wc();function t(r,s){var o=this.__data__,a=e(o,r);return a<0?(++this.size,o.push([r,s])):o[a][1]=s,this}return Ff=t,Ff}var zf,A1;function xc(){if(A1)return zf;A1=1;var e=ND(),t=CD(),r=jD(),s=TD(),o=RD();function a(u){var c=-1,f=u==null?0:u.length;for(this.clear();++c<f;){var p=u[c];this.set(p[0],p[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,zf=a,zf}var Bf,I1;function AD(){if(I1)return Bf;I1=1;var e=xc();function t(){this.__data__=new e,this.size=0}return Bf=t,Bf}var Uf,M1;function ID(){if(M1)return Uf;M1=1;function e(t){var r=this.__data__,s=r.delete(t);return this.size=r.size,s}return Uf=e,Uf}var Hf,O1;function MD(){if(O1)return Hf;O1=1;function e(t){return this.__data__.get(t)}return Hf=e,Hf}var Wf,P1;function OD(){if(P1)return Wf;P1=1;function e(t){return this.__data__.has(t)}return Wf=e,Wf}var Vf,L1;function hT(){if(L1)return Vf;L1=1;var e=typeof _u=="object"&&_u&&_u.Object===Object&&_u;return Vf=e,Vf}var Gf,$1;function ar(){if($1)return Gf;$1=1;var e=hT(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Gf=r,Gf}var Yf,q1;function Eo(){if(q1)return Yf;q1=1;var e=ar(),t=e.Symbol;return Yf=t,Yf}var Kf,D1;function PD(){if(D1)return Kf;D1=1;var e=Eo(),t=Object.prototype,r=t.hasOwnProperty,s=t.toString,o=e?e.toStringTag:void 0;function a(u){var c=r.call(u,o),f=u[o];try{u[o]=void 0;var p=!0}catch{}var d=s.call(u);return p&&(c?u[o]=f:delete u[o]),d}return Kf=a,Kf}var Xf,F1;function LD(){if(F1)return Xf;F1=1;var e=Object.prototype,t=e.toString;function r(s){return t.call(s)}return Xf=r,Xf}var Qf,z1;function ui(){if(z1)return Qf;z1=1;var e=Eo(),t=PD(),r=LD(),s="[object Null]",o="[object Undefined]",a=e?e.toStringTag:void 0;function u(c){return c==null?c===void 0?o:s:a&&a in Object(c)?t(c):r(c)}return Qf=u,Qf}var Zf,B1;function Dn(){if(B1)return Zf;B1=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Zf=e,Zf}var Jf,U1;function sl(){if(U1)return Jf;U1=1;var e=ui(),t=Dn(),r="[object AsyncFunction]",s="[object Function]",o="[object GeneratorFunction]",a="[object Proxy]";function u(c){if(!t(c))return!1;var f=e(c);return f==s||f==o||f==r||f==a}return Jf=u,Jf}var eh,H1;function $D(){if(H1)return eh;H1=1;var e=ar(),t=e["__core-js_shared__"];return eh=t,eh}var th,W1;function qD(){if(W1)return th;W1=1;var e=$D(),t=(function(){var s=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""})();function r(s){return!!t&&t in s}return th=r,th}var nh,V1;function pT(){if(V1)return nh;V1=1;var e=Function.prototype,t=e.toString;function r(s){if(s!=null){try{return t.call(s)}catch{}try{return s+""}catch{}}return""}return nh=r,nh}var rh,G1;function DD(){if(G1)return rh;G1=1;var e=sl(),t=qD(),r=Dn(),s=pT(),o=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,f=u.toString,p=c.hasOwnProperty,d=RegExp("^"+f.call(p).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g(y){if(!r(y)||t(y))return!1;var w=e(y)?d:a;return w.test(s(y))}return rh=g,rh}var sh,Y1;function FD(){if(Y1)return sh;Y1=1;function e(t,r){return t==null?void 0:t[r]}return sh=e,sh}var ih,K1;function ci(){if(K1)return ih;K1=1;var e=DD(),t=FD();function r(s,o){var a=t(s,o);return e(a)?a:void 0}return ih=r,ih}var oh,X1;function f0(){if(X1)return oh;X1=1;var e=ci(),t=ar(),r=e(t,"Map");return oh=r,oh}var ah,Q1;function _c(){if(Q1)return ah;Q1=1;var e=ci(),t=e(Object,"create");return ah=t,ah}var lh,Z1;function zD(){if(Z1)return lh;Z1=1;var e=_c();function t(){this.__data__=e?e(null):{},this.size=0}return lh=t,lh}var uh,J1;function BD(){if(J1)return uh;J1=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return uh=e,uh}var ch,eb;function UD(){if(eb)return ch;eb=1;var e=_c(),t="__lodash_hash_undefined__",r=Object.prototype,s=r.hasOwnProperty;function o(a){var u=this.__data__;if(e){var c=u[a];return c===t?void 0:c}return s.call(u,a)?u[a]:void 0}return ch=o,ch}var dh,tb;function HD(){if(tb)return dh;tb=1;var e=_c(),t=Object.prototype,r=t.hasOwnProperty;function s(o){var a=this.__data__;return e?a[o]!==void 0:r.call(a,o)}return dh=s,dh}var fh,nb;function WD(){if(nb)return fh;nb=1;var e=_c(),t="__lodash_hash_undefined__";function r(s,o){var a=this.__data__;return this.size+=this.has(s)?0:1,a[s]=e&&o===void 0?t:o,this}return fh=r,fh}var hh,rb;function VD(){if(rb)return hh;rb=1;var e=zD(),t=BD(),r=UD(),s=HD(),o=WD();function a(u){var c=-1,f=u==null?0:u.length;for(this.clear();++c<f;){var p=u[c];this.set(p[0],p[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,hh=a,hh}var ph,sb;function GD(){if(sb)return ph;sb=1;var e=VD(),t=xc(),r=f0();function s(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return ph=s,ph}var mh,ib;function YD(){if(ib)return mh;ib=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return mh=e,mh}var gh,ob;function bc(){if(ob)return gh;ob=1;var e=YD();function t(r,s){var o=r.__data__;return e(s)?o[typeof s=="string"?"string":"hash"]:o.map}return gh=t,gh}var vh,ab;function KD(){if(ab)return vh;ab=1;var e=bc();function t(r){var s=e(this,r).delete(r);return this.size-=s?1:0,s}return vh=t,vh}var yh,lb;function XD(){if(lb)return yh;lb=1;var e=bc();function t(r){return e(this,r).get(r)}return yh=t,yh}var wh,ub;function QD(){if(ub)return wh;ub=1;var e=bc();function t(r){return e(this,r).has(r)}return wh=t,wh}var xh,cb;function ZD(){if(cb)return xh;cb=1;var e=bc();function t(r,s){var o=e(this,r),a=o.size;return o.set(r,s),this.size+=o.size==a?0:1,this}return xh=t,xh}var _h,db;function h0(){if(db)return _h;db=1;var e=GD(),t=KD(),r=XD(),s=QD(),o=ZD();function a(u){var c=-1,f=u==null?0:u.length;for(this.clear();++c<f;){var p=u[c];this.set(p[0],p[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,_h=a,_h}var bh,fb;function JD(){if(fb)return bh;fb=1;var e=xc(),t=f0(),r=h0(),s=200;function o(a,u){var c=this.__data__;if(c instanceof e){var f=c.__data__;if(!t||f.length<s-1)return f.push([a,u]),this.size=++c.size,this;c=this.__data__=new r(f)}return c.set(a,u),this.size=c.size,this}return bh=o,bh}var kh,hb;function kc(){if(hb)return kh;hb=1;var e=xc(),t=AD(),r=ID(),s=MD(),o=OD(),a=JD();function u(c){var f=this.__data__=new e(c);this.size=f.size}return u.prototype.clear=t,u.prototype.delete=r,u.prototype.get=s,u.prototype.has=o,u.prototype.set=a,kh=u,kh}var Sh,pb;function p0(){if(pb)return Sh;pb=1;function e(t,r){for(var s=-1,o=t==null?0:t.length;++s<o&&r(t[s],s,t)!==!1;);return t}return Sh=e,Sh}var Eh,mb;function mT(){if(mb)return Eh;mb=1;var e=ci(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Eh=t,Eh}var Nh,gb;function Sc(){if(gb)return Nh;gb=1;var e=mT();function t(r,s,o){s=="__proto__"&&e?e(r,s,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[s]=o}return Nh=t,Nh}var Ch,vb;function Ec(){if(vb)return Ch;vb=1;var e=Sc(),t=So(),r=Object.prototype,s=r.hasOwnProperty;function o(a,u,c){var f=a[u];(!(s.call(a,u)&&t(f,c))||c===void 0&&!(u in a))&&e(a,u,c)}return Ch=o,Ch}var jh,yb;function il(){if(yb)return jh;yb=1;var e=Ec(),t=Sc();function r(s,o,a,u){var c=!a;a||(a={});for(var f=-1,p=o.length;++f<p;){var d=o[f],g=u?u(a[d],s[d],d,a,s):void 0;g===void 0&&(g=s[d]),c?t(a,d,g):e(a,d,g)}return a}return jh=r,jh}var Th,wb;function e5(){if(wb)return Th;wb=1;function e(t,r){for(var s=-1,o=Array(t);++s<t;)o[s]=r(s);return o}return Th=e,Th}var Rh,xb;function kr(){if(xb)return Rh;xb=1;function e(t){return t!=null&&typeof t=="object"}return Rh=e,Rh}var Ah,_b;function t5(){if(_b)return Ah;_b=1;var e=ui(),t=kr(),r="[object Arguments]";function s(o){return t(o)&&e(o)==r}return Ah=s,Ah}var Ih,bb;function ol(){if(bb)return Ih;bb=1;var e=t5(),t=kr(),r=Object.prototype,s=r.hasOwnProperty,o=r.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(u){return t(u)&&s.call(u,"callee")&&!o.call(u,"callee")};return Ih=a,Ih}var Mh,kb;function Ct(){if(kb)return Mh;kb=1;var e=Array.isArray;return Mh=e,Mh}var Ra={exports:{}},Oh,Sb;function n5(){if(Sb)return Oh;Sb=1;function e(){return!1}return Oh=e,Oh}Ra.exports;var Eb;function No(){return Eb||(Eb=1,(function(e,t){var r=ar(),s=n5(),o=t&&!t.nodeType&&t,a=o&&!0&&e&&!e.nodeType&&e,u=a&&a.exports===o,c=u?r.Buffer:void 0,f=c?c.isBuffer:void 0,p=f||s;e.exports=p})(Ra,Ra.exports)),Ra.exports}var Ph,Nb;function Nc(){if(Nb)return Ph;Nb=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(s,o){var a=typeof s;return o=o??e,!!o&&(a=="number"||a!="symbol"&&t.test(s))&&s>-1&&s%1==0&&s<o}return Ph=r,Ph}var Lh,Cb;function m0(){if(Cb)return Lh;Cb=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Lh=t,Lh}var $h,jb;function r5(){if(jb)return $h;jb=1;var e=ui(),t=m0(),r=kr(),s="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Function]",p="[object Map]",d="[object Number]",g="[object Object]",y="[object RegExp]",w="[object Set]",S="[object String]",_="[object WeakMap]",b="[object ArrayBuffer]",k="[object DataView]",E="[object Float32Array]",C="[object Float64Array]",T="[object Int8Array]",A="[object Int16Array]",L="[object Int32Array]",P="[object Uint8Array]",U="[object Uint8ClampedArray]",O="[object Uint16Array]",M="[object Uint32Array]",q={};q[E]=q[C]=q[T]=q[A]=q[L]=q[P]=q[U]=q[O]=q[M]=!0,q[s]=q[o]=q[b]=q[a]=q[k]=q[u]=q[c]=q[f]=q[p]=q[d]=q[g]=q[y]=q[w]=q[S]=q[_]=!1;function V(X){return r(X)&&t(X.length)&&!!q[e(X)]}return $h=V,$h}var qh,Tb;function Cc(){if(Tb)return qh;Tb=1;function e(t){return function(r){return t(r)}}return qh=e,qh}var Aa={exports:{}};Aa.exports;var Rb;function g0(){return Rb||(Rb=1,(function(e,t){var r=hT(),s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,u=a&&r.process,c=(function(){try{var f=o&&o.require&&o.require("util").types;return f||u&&u.binding&&u.binding("util")}catch{}})();e.exports=c})(Aa,Aa.exports)),Aa.exports}var Dh,Ab;function al(){if(Ab)return Dh;Ab=1;var e=r5(),t=Cc(),r=g0(),s=r&&r.isTypedArray,o=s?t(s):e;return Dh=o,Dh}var Fh,Ib;function gT(){if(Ib)return Fh;Ib=1;var e=e5(),t=ol(),r=Ct(),s=No(),o=Nc(),a=al(),u=Object.prototype,c=u.hasOwnProperty;function f(p,d){var g=r(p),y=!g&&t(p),w=!g&&!y&&s(p),S=!g&&!y&&!w&&a(p),_=g||y||w||S,b=_?e(p.length,String):[],k=b.length;for(var E in p)(d||c.call(p,E))&&!(_&&(E=="length"||w&&(E=="offset"||E=="parent")||S&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||o(E,k)))&&b.push(E);return b}return Fh=f,Fh}var zh,Mb;function jc(){if(Mb)return zh;Mb=1;var e=Object.prototype;function t(r){var s=r&&r.constructor,o=typeof s=="function"&&s.prototype||e;return r===o}return zh=t,zh}var Bh,Ob;function vT(){if(Ob)return Bh;Ob=1;function e(t,r){return function(s){return t(r(s))}}return Bh=e,Bh}var Uh,Pb;function s5(){if(Pb)return Uh;Pb=1;var e=vT(),t=e(Object.keys,Object);return Uh=t,Uh}var Hh,Lb;function v0(){if(Lb)return Hh;Lb=1;var e=jc(),t=s5(),r=Object.prototype,s=r.hasOwnProperty;function o(a){if(!e(a))return t(a);var u=[];for(var c in Object(a))s.call(a,c)&&c!="constructor"&&u.push(c);return u}return Hh=o,Hh}var Wh,$b;function Xr(){if($b)return Wh;$b=1;var e=sl(),t=m0();function r(s){return s!=null&&t(s.length)&&!e(s)}return Wh=r,Wh}var Vh,qb;function Ts(){if(qb)return Vh;qb=1;var e=gT(),t=v0(),r=Xr();function s(o){return r(o)?e(o):t(o)}return Vh=s,Vh}var Gh,Db;function i5(){if(Db)return Gh;Db=1;var e=il(),t=Ts();function r(s,o){return s&&e(o,t(o),s)}return Gh=r,Gh}var Yh,Fb;function o5(){if(Fb)return Yh;Fb=1;function e(t){var r=[];if(t!=null)for(var s in Object(t))r.push(s);return r}return Yh=e,Yh}var Kh,zb;function a5(){if(zb)return Kh;zb=1;var e=Dn(),t=jc(),r=o5(),s=Object.prototype,o=s.hasOwnProperty;function a(u){if(!e(u))return r(u);var c=t(u),f=[];for(var p in u)p=="constructor"&&(c||!o.call(u,p))||f.push(p);return f}return Kh=a,Kh}var Xh,Bb;function di(){if(Bb)return Xh;Bb=1;var e=gT(),t=a5(),r=Xr();function s(o){return r(o)?e(o,!0):t(o)}return Xh=s,Xh}var Qh,Ub;function l5(){if(Ub)return Qh;Ub=1;var e=il(),t=di();function r(s,o){return s&&e(o,t(o),s)}return Qh=r,Qh}var Ia={exports:{}};Ia.exports;var Hb;function yT(){return Hb||(Hb=1,(function(e,t){var r=ar(),s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,u=a?r.Buffer:void 0,c=u?u.allocUnsafe:void 0;function f(p,d){if(d)return p.slice();var g=p.length,y=c?c(g):new p.constructor(g);return p.copy(y),y}e.exports=f})(Ia,Ia.exports)),Ia.exports}var Zh,Wb;function wT(){if(Wb)return Zh;Wb=1;function e(t,r){var s=-1,o=t.length;for(r||(r=Array(o));++s<o;)r[s]=t[s];return r}return Zh=e,Zh}var Jh,Vb;function xT(){if(Vb)return Jh;Vb=1;function e(t,r){for(var s=-1,o=t==null?0:t.length,a=0,u=[];++s<o;){var c=t[s];r(c,s,t)&&(u[a++]=c)}return u}return Jh=e,Jh}var ep,Gb;function _T(){if(Gb)return ep;Gb=1;function e(){return[]}return ep=e,ep}var tp,Yb;function y0(){if(Yb)return tp;Yb=1;var e=xT(),t=_T(),r=Object.prototype,s=r.propertyIsEnumerable,o=Object.getOwnPropertySymbols,a=o?function(u){return u==null?[]:(u=Object(u),e(o(u),function(c){return s.call(u,c)}))}:t;return tp=a,tp}var np,Kb;function u5(){if(Kb)return np;Kb=1;var e=il(),t=y0();function r(s,o){return e(s,t(s),o)}return np=r,np}var rp,Xb;function w0(){if(Xb)return rp;Xb=1;function e(t,r){for(var s=-1,o=r.length,a=t.length;++s<o;)t[a+s]=r[s];return t}return rp=e,rp}var sp,Qb;function Tc(){if(Qb)return sp;Qb=1;var e=vT(),t=e(Object.getPrototypeOf,Object);return sp=t,sp}var ip,Zb;function bT(){if(Zb)return ip;Zb=1;var e=w0(),t=Tc(),r=y0(),s=_T(),o=Object.getOwnPropertySymbols,a=o?function(u){for(var c=[];u;)e(c,r(u)),u=t(u);return c}:s;return ip=a,ip}var op,Jb;function c5(){if(Jb)return op;Jb=1;var e=il(),t=bT();function r(s,o){return e(s,t(s),o)}return op=r,op}var ap,ek;function kT(){if(ek)return ap;ek=1;var e=w0(),t=Ct();function r(s,o,a){var u=o(s);return t(s)?u:e(u,a(s))}return ap=r,ap}var lp,tk;function ST(){if(tk)return lp;tk=1;var e=kT(),t=y0(),r=Ts();function s(o){return e(o,r,t)}return lp=s,lp}var up,nk;function d5(){if(nk)return up;nk=1;var e=kT(),t=bT(),r=di();function s(o){return e(o,r,t)}return up=s,up}var cp,rk;function f5(){if(rk)return cp;rk=1;var e=ci(),t=ar(),r=e(t,"DataView");return cp=r,cp}var dp,sk;function h5(){if(sk)return dp;sk=1;var e=ci(),t=ar(),r=e(t,"Promise");return dp=r,dp}var fp,ik;function ET(){if(ik)return fp;ik=1;var e=ci(),t=ar(),r=e(t,"Set");return fp=r,fp}var hp,ok;function p5(){if(ok)return hp;ok=1;var e=ci(),t=ar(),r=e(t,"WeakMap");return hp=r,hp}var pp,ak;function Co(){if(ak)return pp;ak=1;var e=f5(),t=f0(),r=h5(),s=ET(),o=p5(),a=ui(),u=pT(),c="[object Map]",f="[object Object]",p="[object Promise]",d="[object Set]",g="[object WeakMap]",y="[object DataView]",w=u(e),S=u(t),_=u(r),b=u(s),k=u(o),E=a;return(e&&E(new e(new ArrayBuffer(1)))!=y||t&&E(new t)!=c||r&&E(r.resolve())!=p||s&&E(new s)!=d||o&&E(new o)!=g)&&(E=function(C){var T=a(C),A=T==f?C.constructor:void 0,L=A?u(A):"";if(L)switch(L){case w:return y;case S:return c;case _:return p;case b:return d;case k:return g}return T}),pp=E,pp}var mp,lk;function m5(){if(lk)return mp;lk=1;var e=Object.prototype,t=e.hasOwnProperty;function r(s){var o=s.length,a=new s.constructor(o);return o&&typeof s[0]=="string"&&t.call(s,"index")&&(a.index=s.index,a.input=s.input),a}return mp=r,mp}var gp,uk;function NT(){if(uk)return gp;uk=1;var e=ar(),t=e.Uint8Array;return gp=t,gp}var vp,ck;function x0(){if(ck)return vp;ck=1;var e=NT();function t(r){var s=new r.constructor(r.byteLength);return new e(s).set(new e(r)),s}return vp=t,vp}var yp,dk;function g5(){if(dk)return yp;dk=1;var e=x0();function t(r,s){var o=s?e(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}return yp=t,yp}var wp,fk;function v5(){if(fk)return wp;fk=1;var e=/\w*$/;function t(r){var s=new r.constructor(r.source,e.exec(r));return s.lastIndex=r.lastIndex,s}return wp=t,wp}var xp,hk;function y5(){if(hk)return xp;hk=1;var e=Eo(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function s(o){return r?Object(r.call(o)):{}}return xp=s,xp}var _p,pk;function CT(){if(pk)return _p;pk=1;var e=x0();function t(r,s){var o=s?e(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}return _p=t,_p}var bp,mk;function w5(){if(mk)return bp;mk=1;var e=x0(),t=g5(),r=v5(),s=y5(),o=CT(),a="[object Boolean]",u="[object Date]",c="[object Map]",f="[object Number]",p="[object RegExp]",d="[object Set]",g="[object String]",y="[object Symbol]",w="[object ArrayBuffer]",S="[object DataView]",_="[object Float32Array]",b="[object Float64Array]",k="[object Int8Array]",E="[object Int16Array]",C="[object Int32Array]",T="[object Uint8Array]",A="[object Uint8ClampedArray]",L="[object Uint16Array]",P="[object Uint32Array]";function U(O,M,q){var V=O.constructor;switch(M){case w:return e(O);case a:case u:return new V(+O);case S:return t(O,q);case _:case b:case k:case E:case C:case T:case A:case L:case P:return o(O,q);case c:return new V;case f:case g:return new V(O);case p:return r(O);case d:return new V;case y:return s(O)}}return bp=U,bp}var kp,gk;function jT(){if(gk)return kp;gk=1;var e=Dn(),t=Object.create,r=(function(){function s(){}return function(o){if(!e(o))return{};if(t)return t(o);s.prototype=o;var a=new s;return s.prototype=void 0,a}})();return kp=r,kp}var Sp,vk;function TT(){if(vk)return Sp;vk=1;var e=jT(),t=Tc(),r=jc();function s(o){return typeof o.constructor=="function"&&!r(o)?e(t(o)):{}}return Sp=s,Sp}var Ep,yk;function x5(){if(yk)return Ep;yk=1;var e=Co(),t=kr(),r="[object Map]";function s(o){return t(o)&&e(o)==r}return Ep=s,Ep}var Np,wk;function _5(){if(wk)return Np;wk=1;var e=x5(),t=Cc(),r=g0(),s=r&&r.isMap,o=s?t(s):e;return Np=o,Np}var Cp,xk;function b5(){if(xk)return Cp;xk=1;var e=Co(),t=kr(),r="[object Set]";function s(o){return t(o)&&e(o)==r}return Cp=s,Cp}var jp,_k;function k5(){if(_k)return jp;_k=1;var e=b5(),t=Cc(),r=g0(),s=r&&r.isSet,o=s?t(s):e;return jp=o,jp}var Tp,bk;function RT(){if(bk)return Tp;bk=1;var e=kc(),t=p0(),r=Ec(),s=i5(),o=l5(),a=yT(),u=wT(),c=u5(),f=c5(),p=ST(),d=d5(),g=Co(),y=m5(),w=w5(),S=TT(),_=Ct(),b=No(),k=_5(),E=Dn(),C=k5(),T=Ts(),A=di(),L=1,P=2,U=4,O="[object Arguments]",M="[object Array]",q="[object Boolean]",V="[object Date]",X="[object Error]",j="[object Function]",G="[object GeneratorFunction]",B="[object Map]",te="[object Number]",Z="[object Object]",$="[object RegExp]",H="[object Set]",I="[object String]",Y="[object Symbol]",ce="[object WeakMap]",z="[object ArrayBuffer]",Q="[object DataView]",ne="[object Float32Array]",oe="[object Float64Array]",fe="[object Int8Array]",pe="[object Int16Array]",ye="[object Int32Array]",Me="[object Uint8Array]",Ue="[object Uint8ClampedArray]",ze="[object Uint16Array]",Ie="[object Uint32Array]",ke={};ke[O]=ke[M]=ke[z]=ke[Q]=ke[q]=ke[V]=ke[ne]=ke[oe]=ke[fe]=ke[pe]=ke[ye]=ke[B]=ke[te]=ke[Z]=ke[$]=ke[H]=ke[I]=ke[Y]=ke[Me]=ke[Ue]=ke[ze]=ke[Ie]=!0,ke[X]=ke[j]=ke[ce]=!1;function le(we,xe,Ye,gt,ft,ot){var Be,et=xe&L,Xe=xe&P,wt=xe&U;if(Ye&&(Be=ft?Ye(we,gt,ft,ot):Ye(we)),Be!==void 0)return Be;if(!E(we))return we;var ee=_(we);if(ee){if(Be=y(we),!et)return u(we,Be)}else{var Le=g(we),De=Le==j||Le==G;if(b(we))return a(we,et);if(Le==Z||Le==O||De&&!ft){if(Be=Xe||De?{}:S(we),!et)return Xe?f(we,o(Be,we)):c(we,s(Be,we))}else{if(!ke[Le])return ft?we:{};Be=w(we,Le,et)}}ot||(ot=new e);var Re=ot.get(we);if(Re)return Re;ot.set(we,Be),C(we)?we.forEach(function(tt){Be.add(le(tt,xe,Ye,tt,we,ot))}):k(we)&&we.forEach(function(tt,Ce){Be.set(Ce,le(tt,xe,Ye,Ce,we,ot))});var $e=wt?Xe?d:p:Xe?A:T,rt=ee?void 0:$e(we);return t(rt||we,function(tt,Ce){rt&&(Ce=tt,tt=we[Ce]),r(Be,Ce,le(tt,xe,Ye,Ce,we,ot))}),Be}return Tp=le,Tp}var Rp,kk;function S5(){if(kk)return Rp;kk=1;var e=RT(),t=4;function r(s){return e(s,t)}return Rp=r,Rp}var Ap,Sk;function _0(){if(Sk)return Ap;Sk=1;function e(t){return function(){return t}}return Ap=e,Ap}var Ip,Ek;function E5(){if(Ek)return Ip;Ek=1;function e(t){return function(r,s,o){for(var a=-1,u=Object(r),c=o(r),f=c.length;f--;){var p=c[t?f:++a];if(s(u[p],p,u)===!1)break}return r}}return Ip=e,Ip}var Mp,Nk;function b0(){if(Nk)return Mp;Nk=1;var e=E5(),t=e();return Mp=t,Mp}var Op,Ck;function k0(){if(Ck)return Op;Ck=1;var e=b0(),t=Ts();function r(s,o){return s&&e(s,o,t)}return Op=r,Op}var Pp,jk;function N5(){if(jk)return Pp;jk=1;var e=Xr();function t(r,s){return function(o,a){if(o==null)return o;if(!e(o))return r(o,a);for(var u=o.length,c=s?u:-1,f=Object(o);(s?c--:++c<u)&&a(f[c],c,f)!==!1;);return o}}return Pp=t,Pp}var Lp,Tk;function Rc(){if(Tk)return Lp;Tk=1;var e=k0(),t=N5(),r=t(e);return Lp=r,Lp}var $p,Rk;function fi(){if(Rk)return $p;Rk=1;function e(t){return t}return $p=e,$p}var qp,Ak;function AT(){if(Ak)return qp;Ak=1;var e=fi();function t(r){return typeof r=="function"?r:e}return qp=t,qp}var Dp,Ik;function IT(){if(Ik)return Dp;Ik=1;var e=p0(),t=Rc(),r=AT(),s=Ct();function o(a,u){var c=s(a)?e:t;return c(a,r(u))}return Dp=o,Dp}var Fp,Mk;function MT(){return Mk||(Mk=1,Fp=IT()),Fp}var zp,Ok;function C5(){if(Ok)return zp;Ok=1;var e=Rc();function t(r,s){var o=[];return e(r,function(a,u,c){s(a,u,c)&&o.push(a)}),o}return zp=t,zp}var Bp,Pk;function j5(){if(Pk)return Bp;Pk=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return Bp=t,Bp}var Up,Lk;function T5(){if(Lk)return Up;Lk=1;function e(t){return this.__data__.has(t)}return Up=e,Up}var Hp,$k;function OT(){if($k)return Hp;$k=1;var e=h0(),t=j5(),r=T5();function s(o){var a=-1,u=o==null?0:o.length;for(this.__data__=new e;++a<u;)this.add(o[a])}return s.prototype.add=s.prototype.push=t,s.prototype.has=r,Hp=s,Hp}var Wp,qk;function R5(){if(qk)return Wp;qk=1;function e(t,r){for(var s=-1,o=t==null?0:t.length;++s<o;)if(r(t[s],s,t))return!0;return!1}return Wp=e,Wp}var Vp,Dk;function PT(){if(Dk)return Vp;Dk=1;function e(t,r){return t.has(r)}return Vp=e,Vp}var Gp,Fk;function LT(){if(Fk)return Gp;Fk=1;var e=OT(),t=R5(),r=PT(),s=1,o=2;function a(u,c,f,p,d,g){var y=f&s,w=u.length,S=c.length;if(w!=S&&!(y&&S>w))return!1;var _=g.get(u),b=g.get(c);if(_&&b)return _==c&&b==u;var k=-1,E=!0,C=f&o?new e:void 0;for(g.set(u,c),g.set(c,u);++k<w;){var T=u[k],A=c[k];if(p)var L=y?p(A,T,k,c,u,g):p(T,A,k,u,c,g);if(L!==void 0){if(L)continue;E=!1;break}if(C){if(!t(c,function(P,U){if(!r(C,U)&&(T===P||d(T,P,f,p,g)))return C.push(U)})){E=!1;break}}else if(!(T===A||d(T,A,f,p,g))){E=!1;break}}return g.delete(u),g.delete(c),E}return Gp=a,Gp}var Yp,zk;function A5(){if(zk)return Yp;zk=1;function e(t){var r=-1,s=Array(t.size);return t.forEach(function(o,a){s[++r]=[a,o]}),s}return Yp=e,Yp}var Kp,Bk;function S0(){if(Bk)return Kp;Bk=1;function e(t){var r=-1,s=Array(t.size);return t.forEach(function(o){s[++r]=o}),s}return Kp=e,Kp}var Xp,Uk;function I5(){if(Uk)return Xp;Uk=1;var e=Eo(),t=NT(),r=So(),s=LT(),o=A5(),a=S0(),u=1,c=2,f="[object Boolean]",p="[object Date]",d="[object Error]",g="[object Map]",y="[object Number]",w="[object RegExp]",S="[object Set]",_="[object String]",b="[object Symbol]",k="[object ArrayBuffer]",E="[object DataView]",C=e?e.prototype:void 0,T=C?C.valueOf:void 0;function A(L,P,U,O,M,q,V){switch(U){case E:if(L.byteLength!=P.byteLength||L.byteOffset!=P.byteOffset)return!1;L=L.buffer,P=P.buffer;case k:return!(L.byteLength!=P.byteLength||!q(new t(L),new t(P)));case f:case p:case y:return r(+L,+P);case d:return L.name==P.name&&L.message==P.message;case w:case _:return L==P+"";case g:var X=o;case S:var j=O&u;if(X||(X=a),L.size!=P.size&&!j)return!1;var G=V.get(L);if(G)return G==P;O|=c,V.set(L,P);var B=s(X(L),X(P),O,M,q,V);return V.delete(L),B;case b:if(T)return T.call(L)==T.call(P)}return!1}return Xp=A,Xp}var Qp,Hk;function M5(){if(Hk)return Qp;Hk=1;var e=ST(),t=1,r=Object.prototype,s=r.hasOwnProperty;function o(a,u,c,f,p,d){var g=c&t,y=e(a),w=y.length,S=e(u),_=S.length;if(w!=_&&!g)return!1;for(var b=w;b--;){var k=y[b];if(!(g?k in u:s.call(u,k)))return!1}var E=d.get(a),C=d.get(u);if(E&&C)return E==u&&C==a;var T=!0;d.set(a,u),d.set(u,a);for(var A=g;++b<w;){k=y[b];var L=a[k],P=u[k];if(f)var U=g?f(P,L,k,u,a,d):f(L,P,k,a,u,d);if(!(U===void 0?L===P||p(L,P,c,f,d):U)){T=!1;break}A||(A=k=="constructor")}if(T&&!A){var O=a.constructor,M=u.constructor;O!=M&&"constructor"in a&&"constructor"in u&&!(typeof O=="function"&&O instanceof O&&typeof M=="function"&&M instanceof M)&&(T=!1)}return d.delete(a),d.delete(u),T}return Qp=o,Qp}var Zp,Wk;function O5(){if(Wk)return Zp;Wk=1;var e=kc(),t=LT(),r=I5(),s=M5(),o=Co(),a=Ct(),u=No(),c=al(),f=1,p="[object Arguments]",d="[object Array]",g="[object Object]",y=Object.prototype,w=y.hasOwnProperty;function S(_,b,k,E,C,T){var A=a(_),L=a(b),P=A?d:o(_),U=L?d:o(b);P=P==p?g:P,U=U==p?g:U;var O=P==g,M=U==g,q=P==U;if(q&&u(_)){if(!u(b))return!1;A=!0,O=!1}if(q&&!O)return T||(T=new e),A||c(_)?t(_,b,k,E,C,T):r(_,b,P,k,E,C,T);if(!(k&f)){var V=O&&w.call(_,"__wrapped__"),X=M&&w.call(b,"__wrapped__");if(V||X){var j=V?_.value():_,G=X?b.value():b;return T||(T=new e),C(j,G,k,E,T)}}return q?(T||(T=new e),s(_,b,k,E,C,T)):!1}return Zp=S,Zp}var Jp,Vk;function $T(){if(Vk)return Jp;Vk=1;var e=O5(),t=kr();function r(s,o,a,u,c){return s===o?!0:s==null||o==null||!t(s)&&!t(o)?s!==s&&o!==o:e(s,o,a,u,r,c)}return Jp=r,Jp}var em,Gk;function P5(){if(Gk)return em;Gk=1;var e=kc(),t=$T(),r=1,s=2;function o(a,u,c,f){var p=c.length,d=p,g=!f;if(a==null)return!d;for(a=Object(a);p--;){var y=c[p];if(g&&y[2]?y[1]!==a[y[0]]:!(y[0]in a))return!1}for(;++p<d;){y=c[p];var w=y[0],S=a[w],_=y[1];if(g&&y[2]){if(S===void 0&&!(w in a))return!1}else{var b=new e;if(f)var k=f(S,_,w,a,u,b);if(!(k===void 0?t(_,S,r|s,f,b):k))return!1}}return!0}return em=o,em}var tm,Yk;function qT(){if(Yk)return tm;Yk=1;var e=Dn();function t(r){return r===r&&!e(r)}return tm=t,tm}var nm,Kk;function L5(){if(Kk)return nm;Kk=1;var e=qT(),t=Ts();function r(s){for(var o=t(s),a=o.length;a--;){var u=o[a],c=s[u];o[a]=[u,c,e(c)]}return o}return nm=r,nm}var rm,Xk;function DT(){if(Xk)return rm;Xk=1;function e(t,r){return function(s){return s==null?!1:s[t]===r&&(r!==void 0||t in Object(s))}}return rm=e,rm}var sm,Qk;function $5(){if(Qk)return sm;Qk=1;var e=P5(),t=L5(),r=DT();function s(o){var a=t(o);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(u){return u===o||e(u,o,a)}}return sm=s,sm}var im,Zk;function jo(){if(Zk)return im;Zk=1;var e=ui(),t=kr(),r="[object Symbol]";function s(o){return typeof o=="symbol"||t(o)&&e(o)==r}return im=s,im}var om,Jk;function E0(){if(Jk)return om;Jk=1;var e=Ct(),t=jo(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;function o(a,u){if(e(a))return!1;var c=typeof a;return c=="number"||c=="symbol"||c=="boolean"||a==null||t(a)?!0:s.test(a)||!r.test(a)||u!=null&&a in Object(u)}return om=o,om}var am,eS;function q5(){if(eS)return am;eS=1;var e=h0(),t="Expected a function";function r(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new TypeError(t);var a=function(){var u=arguments,c=o?o.apply(this,u):u[0],f=a.cache;if(f.has(c))return f.get(c);var p=s.apply(this,u);return a.cache=f.set(c,p)||f,p};return a.cache=new(r.Cache||e),a}return r.Cache=e,am=r,am}var lm,tS;function D5(){if(tS)return lm;tS=1;var e=q5(),t=500;function r(s){var o=e(s,function(u){return a.size===t&&a.clear(),u}),a=o.cache;return o}return lm=r,lm}var um,nS;function F5(){if(nS)return um;nS=1;var e=D5(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,s=e(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(t,function(u,c,f,p){a.push(f?p.replace(r,"$1"):c||u)}),a});return um=s,um}var cm,rS;function Ac(){if(rS)return cm;rS=1;function e(t,r){for(var s=-1,o=t==null?0:t.length,a=Array(o);++s<o;)a[s]=r(t[s],s,t);return a}return cm=e,cm}var dm,sS;function z5(){if(sS)return dm;sS=1;var e=Eo(),t=Ac(),r=Ct(),s=jo(),o=e?e.prototype:void 0,a=o?o.toString:void 0;function u(c){if(typeof c=="string")return c;if(r(c))return t(c,u)+"";if(s(c))return a?a.call(c):"";var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}return dm=u,dm}var fm,iS;function FT(){if(iS)return fm;iS=1;var e=z5();function t(r){return r==null?"":e(r)}return fm=t,fm}var hm,oS;function Ic(){if(oS)return hm;oS=1;var e=Ct(),t=E0(),r=F5(),s=FT();function o(a,u){return e(a)?a:t(a,u)?[a]:r(s(a))}return hm=o,hm}var pm,aS;function ll(){if(aS)return pm;aS=1;var e=jo();function t(r){if(typeof r=="string"||e(r))return r;var s=r+"";return s=="0"&&1/r==-1/0?"-0":s}return pm=t,pm}var mm,lS;function Mc(){if(lS)return mm;lS=1;var e=Ic(),t=ll();function r(s,o){o=e(o,s);for(var a=0,u=o.length;s!=null&&a<u;)s=s[t(o[a++])];return a&&a==u?s:void 0}return mm=r,mm}var gm,uS;function B5(){if(uS)return gm;uS=1;var e=Mc();function t(r,s,o){var a=r==null?void 0:e(r,s);return a===void 0?o:a}return gm=t,gm}var vm,cS;function U5(){if(cS)return vm;cS=1;function e(t,r){return t!=null&&r in Object(t)}return vm=e,vm}var ym,dS;function zT(){if(dS)return ym;dS=1;var e=Ic(),t=ol(),r=Ct(),s=Nc(),o=m0(),a=ll();function u(c,f,p){f=e(f,c);for(var d=-1,g=f.length,y=!1;++d<g;){var w=a(f[d]);if(!(y=c!=null&&p(c,w)))break;c=c[w]}return y||++d!=g?y:(g=c==null?0:c.length,!!g&&o(g)&&s(w,g)&&(r(c)||t(c)))}return ym=u,ym}var wm,fS;function BT(){if(fS)return wm;fS=1;var e=U5(),t=zT();function r(s,o){return s!=null&&t(s,o,e)}return wm=r,wm}var xm,hS;function H5(){if(hS)return xm;hS=1;var e=$T(),t=B5(),r=BT(),s=E0(),o=qT(),a=DT(),u=ll(),c=1,f=2;function p(d,g){return s(d)&&o(g)?a(u(d),g):function(y){var w=t(y,d);return w===void 0&&w===g?r(y,d):e(g,w,c|f)}}return xm=p,xm}var _m,pS;function UT(){if(pS)return _m;pS=1;function e(t){return function(r){return r==null?void 0:r[t]}}return _m=e,_m}var bm,mS;function W5(){if(mS)return bm;mS=1;var e=Mc();function t(r){return function(s){return e(s,r)}}return bm=t,bm}var km,gS;function V5(){if(gS)return km;gS=1;var e=UT(),t=W5(),r=E0(),s=ll();function o(a){return r(a)?e(s(a)):t(a)}return km=o,km}var Sm,vS;function Qr(){if(vS)return Sm;vS=1;var e=$5(),t=H5(),r=fi(),s=Ct(),o=V5();function a(u){return typeof u=="function"?u:u==null?r:typeof u=="object"?s(u)?t(u[0],u[1]):e(u):o(u)}return Sm=a,Sm}var Em,yS;function HT(){if(yS)return Em;yS=1;var e=xT(),t=C5(),r=Qr(),s=Ct();function o(a,u){var c=s(a)?e:t;return c(a,r(u,3))}return Em=o,Em}var Nm,wS;function G5(){if(wS)return Nm;wS=1;var e=Object.prototype,t=e.hasOwnProperty;function r(s,o){return s!=null&&t.call(s,o)}return Nm=r,Nm}var Cm,xS;function WT(){if(xS)return Cm;xS=1;var e=G5(),t=zT();function r(s,o){return s!=null&&t(s,o,e)}return Cm=r,Cm}var jm,_S;function Y5(){if(_S)return jm;_S=1;var e=v0(),t=Co(),r=ol(),s=Ct(),o=Xr(),a=No(),u=jc(),c=al(),f="[object Map]",p="[object Set]",d=Object.prototype,g=d.hasOwnProperty;function y(w){if(w==null)return!0;if(o(w)&&(s(w)||typeof w=="string"||typeof w.splice=="function"||a(w)||c(w)||r(w)))return!w.length;var S=t(w);if(S==f||S==p)return!w.size;if(u(w))return!e(w).length;for(var _ in w)if(g.call(w,_))return!1;return!0}return jm=y,jm}var Tm,bS;function VT(){if(bS)return Tm;bS=1;function e(t){return t===void 0}return Tm=e,Tm}var Rm,kS;function GT(){if(kS)return Rm;kS=1;var e=Rc(),t=Xr();function r(s,o){var a=-1,u=t(s)?Array(s.length):[];return e(s,function(c,f,p){u[++a]=o(c,f,p)}),u}return Rm=r,Rm}var Am,SS;function YT(){if(SS)return Am;SS=1;var e=Ac(),t=Qr(),r=GT(),s=Ct();function o(a,u){var c=s(a)?e:r;return c(a,t(u,3))}return Am=o,Am}var Im,ES;function K5(){if(ES)return Im;ES=1;function e(t,r,s,o){var a=-1,u=t==null?0:t.length;for(o&&u&&(s=t[++a]);++a<u;)s=r(s,t[a],a,t);return s}return Im=e,Im}var Mm,NS;function X5(){if(NS)return Mm;NS=1;function e(t,r,s,o,a){return a(t,function(u,c,f){s=o?(o=!1,u):r(s,u,c,f)}),s}return Mm=e,Mm}var Om,CS;function KT(){if(CS)return Om;CS=1;var e=K5(),t=Rc(),r=Qr(),s=X5(),o=Ct();function a(u,c,f){var p=o(u)?e:s,d=arguments.length<3;return p(u,r(c,4),f,d,t)}return Om=a,Om}var Pm,jS;function Q5(){if(jS)return Pm;jS=1;var e=ui(),t=Ct(),r=kr(),s="[object String]";function o(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==s}return Pm=o,Pm}var Lm,TS;function Z5(){if(TS)return Lm;TS=1;var e=UT(),t=e("length");return Lm=t,Lm}var $m,RS;function J5(){if(RS)return $m;RS=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=t+r+s,a="\\ufe0e\\ufe0f",u="\\u200d",c=RegExp("["+u+e+o+a+"]");function f(p){return c.test(p)}return $m=f,$m}var qm,AS;function eF(){if(AS)return qm;AS=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=t+r+s,a="\\ufe0e\\ufe0f",u="["+e+"]",c="["+o+"]",f="\\ud83c[\\udffb-\\udfff]",p="(?:"+c+"|"+f+")",d="[^"+e+"]",g="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",w="\\u200d",S=p+"?",_="["+a+"]?",b="(?:"+w+"(?:"+[d,g,y].join("|")+")"+_+S+")*",k=_+S+b,E="(?:"+[d+c+"?",c,g,y,u].join("|")+")",C=RegExp(f+"(?="+f+")|"+E+k,"g");function T(A){for(var L=C.lastIndex=0;C.test(A);)++L;return L}return qm=T,qm}var Dm,IS;function tF(){if(IS)return Dm;IS=1;var e=Z5(),t=J5(),r=eF();function s(o){return t(o)?r(o):e(o)}return Dm=s,Dm}var Fm,MS;function nF(){if(MS)return Fm;MS=1;var e=v0(),t=Co(),r=Xr(),s=Q5(),o=tF(),a="[object Map]",u="[object Set]";function c(f){if(f==null)return 0;if(r(f))return s(f)?o(f):f.length;var p=t(f);return p==a||p==u?f.size:e(f).length}return Fm=c,Fm}var zm,OS;function rF(){if(OS)return zm;OS=1;var e=p0(),t=jT(),r=k0(),s=Qr(),o=Tc(),a=Ct(),u=No(),c=sl(),f=Dn(),p=al();function d(g,y,w){var S=a(g),_=S||u(g)||p(g);if(y=s(y,4),w==null){var b=g&&g.constructor;_?w=S?new b:[]:f(g)?w=c(b)?t(o(g)):{}:w={}}return(_?e:r)(g,function(k,E,C){return y(w,k,E,C)}),w}return zm=d,zm}var Bm,PS;function sF(){if(PS)return Bm;PS=1;var e=Eo(),t=ol(),r=Ct(),s=e?e.isConcatSpreadable:void 0;function o(a){return r(a)||t(a)||!!(s&&a&&a[s])}return Bm=o,Bm}var Um,LS;function N0(){if(LS)return Um;LS=1;var e=w0(),t=sF();function r(s,o,a,u,c){var f=-1,p=s.length;for(a||(a=t),c||(c=[]);++f<p;){var d=s[f];o>0&&a(d)?o>1?r(d,o-1,a,u,c):e(c,d):u||(c[c.length]=d)}return c}return Um=r,Um}var Hm,$S;function iF(){if($S)return Hm;$S=1;function e(t,r,s){switch(s.length){case 0:return t.call(r);case 1:return t.call(r,s[0]);case 2:return t.call(r,s[0],s[1]);case 3:return t.call(r,s[0],s[1],s[2])}return t.apply(r,s)}return Hm=e,Hm}var Wm,qS;function XT(){if(qS)return Wm;qS=1;var e=iF(),t=Math.max;function r(s,o,a){return o=t(o===void 0?s.length-1:o,0),function(){for(var u=arguments,c=-1,f=t(u.length-o,0),p=Array(f);++c<f;)p[c]=u[o+c];c=-1;for(var d=Array(o+1);++c<o;)d[c]=u[c];return d[o]=a(p),e(s,this,d)}}return Wm=r,Wm}var Vm,DS;function oF(){if(DS)return Vm;DS=1;var e=_0(),t=mT(),r=fi(),s=t?function(o,a){return t(o,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:r;return Vm=s,Vm}var Gm,FS;function aF(){if(FS)return Gm;FS=1;var e=800,t=16,r=Date.now;function s(o){var a=0,u=0;return function(){var c=r(),f=t-(c-u);if(u=c,f>0){if(++a>=e)return arguments[0]}else a=0;return o.apply(void 0,arguments)}}return Gm=s,Gm}var Ym,zS;function QT(){if(zS)return Ym;zS=1;var e=oF(),t=aF(),r=t(e);return Ym=r,Ym}var Km,BS;function Oc(){if(BS)return Km;BS=1;var e=fi(),t=XT(),r=QT();function s(o,a){return r(t(o,a,e),o+"")}return Km=s,Km}var Xm,US;function ZT(){if(US)return Xm;US=1;function e(t,r,s,o){for(var a=t.length,u=s+(o?1:-1);o?u--:++u<a;)if(r(t[u],u,t))return u;return-1}return Xm=e,Xm}var Qm,HS;function lF(){if(HS)return Qm;HS=1;function e(t){return t!==t}return Qm=e,Qm}var Zm,WS;function uF(){if(WS)return Zm;WS=1;function e(t,r,s){for(var o=s-1,a=t.length;++o<a;)if(t[o]===r)return o;return-1}return Zm=e,Zm}var Jm,VS;function cF(){if(VS)return Jm;VS=1;var e=ZT(),t=lF(),r=uF();function s(o,a,u){return a===a?r(o,a,u):e(o,t,u)}return Jm=s,Jm}var eg,GS;function dF(){if(GS)return eg;GS=1;var e=cF();function t(r,s){var o=r==null?0:r.length;return!!o&&e(r,s,0)>-1}return eg=t,eg}var tg,YS;function fF(){if(YS)return tg;YS=1;function e(t,r,s){for(var o=-1,a=t==null?0:t.length;++o<a;)if(s(r,t[o]))return!0;return!1}return tg=e,tg}var ng,KS;function hF(){if(KS)return ng;KS=1;function e(){}return ng=e,ng}var rg,XS;function pF(){if(XS)return rg;XS=1;var e=ET(),t=hF(),r=S0(),s=1/0,o=e&&1/r(new e([,-0]))[1]==s?function(a){return new e(a)}:t;return rg=o,rg}var sg,QS;function mF(){if(QS)return sg;QS=1;var e=OT(),t=dF(),r=fF(),s=PT(),o=pF(),a=S0(),u=200;function c(f,p,d){var g=-1,y=t,w=f.length,S=!0,_=[],b=_;if(d)S=!1,y=r;else if(w>=u){var k=p?null:o(f);if(k)return a(k);S=!1,y=s,b=new e}else b=p?[]:_;e:for(;++g<w;){var E=f[g],C=p?p(E):E;if(E=d||E!==0?E:0,S&&C===C){for(var T=b.length;T--;)if(b[T]===C)continue e;p&&b.push(C),_.push(E)}else y(b,C,d)||(b!==_&&b.push(C),_.push(E))}return _}return sg=c,sg}var ig,ZS;function JT(){if(ZS)return ig;ZS=1;var e=Xr(),t=kr();function r(s){return t(s)&&e(s)}return ig=r,ig}var og,JS;function gF(){if(JS)return og;JS=1;var e=N0(),t=Oc(),r=mF(),s=JT(),o=t(function(a){return r(e(a,1,s,!0))});return og=o,og}var ag,eE;function vF(){if(eE)return ag;eE=1;var e=Ac();function t(r,s){return e(s,function(o){return r[o]})}return ag=t,ag}var lg,tE;function eR(){if(tE)return lg;tE=1;var e=vF(),t=Ts();function r(s){return s==null?[]:e(s,t(s))}return lg=r,lg}var ug,nE;function Fn(){if(nE)return ug;nE=1;var e;if(typeof d0=="function")try{e={clone:S5(),constant:_0(),each:MT(),filter:HT(),has:WT(),isArray:Ct(),isEmpty:Y5(),isFunction:sl(),isUndefined:VT(),keys:Ts(),map:YT(),reduce:KT(),size:nF(),transform:rF(),union:gF(),values:eR()}}catch{}return e||(e=window._),ug=e,ug}var cg,rE;function C0(){if(rE)return cg;rE=1;var e=Fn();cg=o;var t="\0",r="\0",s="";function o(d){this._isDirected=e.has(d,"directed")?d.directed:!0,this._isMultigraph=e.has(d,"multigraph")?d.multigraph:!1,this._isCompound=e.has(d,"compound")?d.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[r]={}),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(d){return this._label=d,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(d){return e.isFunction(d)||(d=e.constant(d)),this._defaultNodeLabelFn=d,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return e.keys(this._nodes)},o.prototype.sources=function(){var d=this;return e.filter(this.nodes(),function(g){return e.isEmpty(d._in[g])})},o.prototype.sinks=function(){var d=this;return e.filter(this.nodes(),function(g){return e.isEmpty(d._out[g])})},o.prototype.setNodes=function(d,g){var y=arguments,w=this;return e.each(d,function(S){y.length>1?w.setNode(S,g):w.setNode(S)}),this},o.prototype.setNode=function(d,g){return e.has(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=g),this):(this._nodes[d]=arguments.length>1?g:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=r,this._children[d]={},this._children[r][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)},o.prototype.node=function(d){return this._nodes[d]},o.prototype.hasNode=function(d){return e.has(this._nodes,d)},o.prototype.removeNode=function(d){var g=this;if(e.has(this._nodes,d)){var y=function(w){g.removeEdge(g._edgeObjs[w])};delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],e.each(this.children(d),function(w){g.setParent(w)}),delete this._children[d]),e.each(e.keys(this._in[d]),y),delete this._in[d],delete this._preds[d],e.each(e.keys(this._out[d]),y),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this},o.prototype.setParent=function(d,g){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(g))g=r;else{g+="";for(var y=g;!e.isUndefined(y);y=this.parent(y))if(y===d)throw new Error("Setting "+g+" as parent of "+d+" would create a cycle");this.setNode(g)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=g,this._children[g][d]=!0,this},o.prototype._removeFromParentsChildList=function(d){delete this._children[this._parent[d]][d]},o.prototype.parent=function(d){if(this._isCompound){var g=this._parent[d];if(g!==r)return g}},o.prototype.children=function(d){if(e.isUndefined(d)&&(d=r),this._isCompound){var g=this._children[d];if(g)return e.keys(g)}else{if(d===r)return this.nodes();if(this.hasNode(d))return[]}},o.prototype.predecessors=function(d){var g=this._preds[d];if(g)return e.keys(g)},o.prototype.successors=function(d){var g=this._sucs[d];if(g)return e.keys(g)},o.prototype.neighbors=function(d){var g=this.predecessors(d);if(g)return e.union(g,this.successors(d))},o.prototype.isLeaf=function(d){var g;return this.isDirected()?g=this.successors(d):g=this.neighbors(d),g.length===0},o.prototype.filterNodes=function(d){var g=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});g.setGraph(this.graph());var y=this;e.each(this._nodes,function(_,b){d(b)&&g.setNode(b,_)}),e.each(this._edgeObjs,function(_){g.hasNode(_.v)&&g.hasNode(_.w)&&g.setEdge(_,y.edge(_))});var w={};function S(_){var b=y.parent(_);return b===void 0||g.hasNode(b)?(w[_]=b,b):b in w?w[b]:S(b)}return this._isCompound&&e.each(g.nodes(),function(_){g.setParent(_,S(_))}),g},o.prototype.setDefaultEdgeLabel=function(d){return e.isFunction(d)||(d=e.constant(d)),this._defaultEdgeLabelFn=d,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return e.values(this._edgeObjs)},o.prototype.setPath=function(d,g){var y=this,w=arguments;return e.reduce(d,function(S,_){return w.length>1?y.setEdge(S,_,g):y.setEdge(S,_),_}),this},o.prototype.setEdge=function(){var d,g,y,w,S=!1,_=arguments[0];typeof _=="object"&&_!==null&&"v"in _?(d=_.v,g=_.w,y=_.name,arguments.length===2&&(w=arguments[1],S=!0)):(d=_,g=arguments[1],y=arguments[3],arguments.length>2&&(w=arguments[2],S=!0)),d=""+d,g=""+g,e.isUndefined(y)||(y=""+y);var b=c(this._isDirected,d,g,y);if(e.has(this._edgeLabels,b))return S&&(this._edgeLabels[b]=w),this;if(!e.isUndefined(y)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(g),this._edgeLabels[b]=S?w:this._defaultEdgeLabelFn(d,g,y);var k=f(this._isDirected,d,g,y);return d=k.v,g=k.w,Object.freeze(k),this._edgeObjs[b]=k,a(this._preds[g],d),a(this._sucs[d],g),this._in[g][b]=k,this._out[d][b]=k,this._edgeCount++,this},o.prototype.edge=function(d,g,y){var w=arguments.length===1?p(this._isDirected,arguments[0]):c(this._isDirected,d,g,y);return this._edgeLabels[w]},o.prototype.hasEdge=function(d,g,y){var w=arguments.length===1?p(this._isDirected,arguments[0]):c(this._isDirected,d,g,y);return e.has(this._edgeLabels,w)},o.prototype.removeEdge=function(d,g,y){var w=arguments.length===1?p(this._isDirected,arguments[0]):c(this._isDirected,d,g,y),S=this._edgeObjs[w];return S&&(d=S.v,g=S.w,delete this._edgeLabels[w],delete this._edgeObjs[w],u(this._preds[g],d),u(this._sucs[d],g),delete this._in[g][w],delete this._out[d][w],this._edgeCount--),this},o.prototype.inEdges=function(d,g){var y=this._in[d];if(y){var w=e.values(y);return g?e.filter(w,function(S){return S.v===g}):w}},o.prototype.outEdges=function(d,g){var y=this._out[d];if(y){var w=e.values(y);return g?e.filter(w,function(S){return S.w===g}):w}},o.prototype.nodeEdges=function(d,g){var y=this.inEdges(d,g);if(y)return y.concat(this.outEdges(d,g))};function a(d,g){d[g]?d[g]++:d[g]=1}function u(d,g){--d[g]||delete d[g]}function c(d,g,y,w){var S=""+g,_=""+y;if(!d&&S>_){var b=S;S=_,_=b}return S+s+_+s+(e.isUndefined(w)?t:w)}function f(d,g,y,w){var S=""+g,_=""+y;if(!d&&S>_){var b=S;S=_,_=b}var k={v:S,w:_};return w&&(k.name=w),k}function p(d,g){return c(d,g.v,g.w,g.name)}return cg}var dg,sE;function yF(){return sE||(sE=1,dg="2.1.8"),dg}var fg,iE;function wF(){return iE||(iE=1,fg={Graph:C0(),version:yF()}),fg}var hg,oE;function xF(){if(oE)return hg;oE=1;var e=Fn(),t=C0();hg={write:r,read:a};function r(u){var c={options:{directed:u.isDirected(),multigraph:u.isMultigraph(),compound:u.isCompound()},nodes:s(u),edges:o(u)};return e.isUndefined(u.graph())||(c.value=e.clone(u.graph())),c}function s(u){return e.map(u.nodes(),function(c){var f=u.node(c),p=u.parent(c),d={v:c};return e.isUndefined(f)||(d.value=f),e.isUndefined(p)||(d.parent=p),d})}function o(u){return e.map(u.edges(),function(c){var f=u.edge(c),p={v:c.v,w:c.w};return e.isUndefined(c.name)||(p.name=c.name),e.isUndefined(f)||(p.value=f),p})}function a(u){var c=new t(u.options).setGraph(u.value);return e.each(u.nodes,function(f){c.setNode(f.v,f.value),f.parent&&c.setParent(f.v,f.parent)}),e.each(u.edges,function(f){c.setEdge({v:f.v,w:f.w,name:f.name},f.value)}),c}return hg}var pg,aE;function _F(){if(aE)return pg;aE=1;var e=Fn();pg=t;function t(r){var s={},o=[],a;function u(c){e.has(s,c)||(s[c]=!0,a.push(c),e.each(r.successors(c),u),e.each(r.predecessors(c),u))}return e.each(r.nodes(),function(c){a=[],u(c),a.length&&o.push(a)}),o}return pg}var mg,lE;function tR(){if(lE)return mg;lE=1;var e=Fn();mg=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(r){return r.key})},t.prototype.has=function(r){return e.has(this._keyIndices,r)},t.prototype.priority=function(r){var s=this._keyIndices[r];if(s!==void 0)return this._arr[s].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(r,s){var o=this._keyIndices;if(r=String(r),!e.has(o,r)){var a=this._arr,u=a.length;return o[r]=u,a.push({key:r,priority:s}),this._decrease(u),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},t.prototype.decrease=function(r,s){var o=this._keyIndices[r];if(s>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[o].priority+" New: "+s);this._arr[o].priority=s,this._decrease(o)},t.prototype._heapify=function(r){var s=this._arr,o=2*r,a=o+1,u=r;o<s.length&&(u=s[o].priority<s[u].priority?o:u,a<s.length&&(u=s[a].priority<s[u].priority?a:u),u!==r&&(this._swap(r,u),this._heapify(u)))},t.prototype._decrease=function(r){for(var s=this._arr,o=s[r].priority,a;r!==0&&(a=r>>1,!(s[a].priority<o));)this._swap(r,a),r=a},t.prototype._swap=function(r,s){var o=this._arr,a=this._keyIndices,u=o[r],c=o[s];o[r]=c,o[s]=u,a[c.key]=r,a[u.key]=s},mg}var gg,uE;function nR(){if(uE)return gg;uE=1;var e=Fn(),t=tR();gg=s;var r=e.constant(1);function s(a,u,c,f){return o(a,String(u),c||r,f||function(p){return a.outEdges(p)})}function o(a,u,c,f){var p={},d=new t,g,y,w=function(S){var _=S.v!==g?S.v:S.w,b=p[_],k=c(S),E=y.distance+k;if(k<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+S+" Weight: "+k);E<b.distance&&(b.distance=E,b.predecessor=g,d.decrease(_,E))};for(a.nodes().forEach(function(S){var _=S===u?0:Number.POSITIVE_INFINITY;p[S]={distance:_},d.add(S,_)});d.size()>0&&(g=d.removeMin(),y=p[g],y.distance!==Number.POSITIVE_INFINITY);)f(g).forEach(w);return p}return gg}var vg,cE;function bF(){if(cE)return vg;cE=1;var e=nR(),t=Fn();vg=r;function r(s,o,a){return t.transform(s.nodes(),function(u,c){u[c]=e(s,c,o,a)},{})}return vg}var yg,dE;function rR(){if(dE)return yg;dE=1;var e=Fn();yg=t;function t(r){var s=0,o=[],a={},u=[];function c(f){var p=a[f]={onStack:!0,lowlink:s,index:s++};if(o.push(f),r.successors(f).forEach(function(y){e.has(a,y)?a[y].onStack&&(p.lowlink=Math.min(p.lowlink,a[y].index)):(c(y),p.lowlink=Math.min(p.lowlink,a[y].lowlink))}),p.lowlink===p.index){var d=[],g;do g=o.pop(),a[g].onStack=!1,d.push(g);while(f!==g);u.push(d)}}return r.nodes().forEach(function(f){e.has(a,f)||c(f)}),u}return yg}var wg,fE;function kF(){if(fE)return wg;fE=1;var e=Fn(),t=rR();wg=r;function r(s){return e.filter(t(s),function(o){return o.length>1||o.length===1&&s.hasEdge(o[0],o[0])})}return wg}var xg,hE;function SF(){if(hE)return xg;hE=1;var e=Fn();xg=r;var t=e.constant(1);function r(o,a,u){return s(o,a||t,u||function(c){return o.outEdges(c)})}function s(o,a,u){var c={},f=o.nodes();return f.forEach(function(p){c[p]={},c[p][p]={distance:0},f.forEach(function(d){p!==d&&(c[p][d]={distance:Number.POSITIVE_INFINITY})}),u(p).forEach(function(d){var g=d.v===p?d.w:d.v,y=a(d);c[p][g]={distance:y,predecessor:p}})}),f.forEach(function(p){var d=c[p];f.forEach(function(g){var y=c[g];f.forEach(function(w){var S=y[p],_=d[w],b=y[w],k=S.distance+_.distance;k<b.distance&&(b.distance=k,b.predecessor=_.predecessor)})})}),c}return xg}var _g,pE;function sR(){if(pE)return _g;pE=1;var e=Fn();_g=t,t.CycleException=r;function t(s){var o={},a={},u=[];function c(f){if(e.has(a,f))throw new r;e.has(o,f)||(a[f]=!0,o[f]=!0,e.each(s.predecessors(f),c),delete a[f],u.push(f))}if(e.each(s.sinks(),c),e.size(o)!==s.nodeCount())throw new r;return u}function r(){}return r.prototype=new Error,_g}var bg,mE;function EF(){if(mE)return bg;mE=1;var e=sR();bg=t;function t(r){try{e(r)}catch(s){if(s instanceof e.CycleException)return!1;throw s}return!0}return bg}var kg,gE;function iR(){if(gE)return kg;gE=1;var e=Fn();kg=t;function t(s,o,a){e.isArray(o)||(o=[o]);var u=(s.isDirected()?s.successors:s.neighbors).bind(s),c=[],f={};return e.each(o,function(p){if(!s.hasNode(p))throw new Error("Graph does not have node: "+p);r(s,p,a==="post",f,u,c)}),c}function r(s,o,a,u,c,f){e.has(u,o)||(u[o]=!0,a||f.push(o),e.each(c(o),function(p){r(s,p,a,u,c,f)}),a&&f.push(o))}return kg}var Sg,vE;function NF(){if(vE)return Sg;vE=1;var e=iR();Sg=t;function t(r,s){return e(r,s,"post")}return Sg}var Eg,yE;function CF(){if(yE)return Eg;yE=1;var e=iR();Eg=t;function t(r,s){return e(r,s,"pre")}return Eg}var Ng,wE;function jF(){if(wE)return Ng;wE=1;var e=Fn(),t=C0(),r=tR();Ng=s;function s(o,a){var u=new t,c={},f=new r,p;function d(y){var w=y.v===p?y.w:y.v,S=f.priority(w);if(S!==void 0){var _=a(y);_<S&&(c[w]=p,f.decrease(w,_))}}if(o.nodeCount()===0)return u;e.each(o.nodes(),function(y){f.add(y,Number.POSITIVE_INFINITY),u.setNode(y)}),f.decrease(o.nodes()[0],0);for(var g=!1;f.size()>0;){if(p=f.removeMin(),e.has(c,p))u.setEdge(p,c[p]);else{if(g)throw new Error("Input graph is not connected: "+o);g=!0}o.nodeEdges(p).forEach(d)}return u}return Ng}var Cg,xE;function TF(){return xE||(xE=1,Cg={components:_F(),dijkstra:nR(),dijkstraAll:bF(),findCycles:kF(),floydWarshall:SF(),isAcyclic:EF(),postorder:NF(),preorder:CF(),prim:jF(),tarjan:rR(),topsort:sR()}),Cg}var jg,_E;function RF(){if(_E)return jg;_E=1;var e=wF();return jg={Graph:e.Graph,json:xF(),alg:TF(),version:e.version},jg}var Tg,bE;function ir(){if(bE)return Tg;bE=1;var e;if(typeof d0=="function")try{e=RF()}catch{}return e||(e=window.graphlib),Tg=e,Tg}var Rg,kE;function AF(){if(kE)return Rg;kE=1;var e=RT(),t=1,r=4;function s(o){return e(o,t|r)}return Rg=s,Rg}var Ag,SE;function Pc(){if(SE)return Ag;SE=1;var e=So(),t=Xr(),r=Nc(),s=Dn();function o(a,u,c){if(!s(c))return!1;var f=typeof u;return(f=="number"?t(c)&&r(u,c.length):f=="string"&&u in c)?e(c[u],a):!1}return Ag=o,Ag}var Ig,EE;function IF(){if(EE)return Ig;EE=1;var e=Oc(),t=So(),r=Pc(),s=di(),o=Object.prototype,a=o.hasOwnProperty,u=e(function(c,f){c=Object(c);var p=-1,d=f.length,g=d>2?f[2]:void 0;for(g&&r(f[0],f[1],g)&&(d=1);++p<d;)for(var y=f[p],w=s(y),S=-1,_=w.length;++S<_;){var b=w[S],k=c[b];(k===void 0||t(k,o[b])&&!a.call(c,b))&&(c[b]=y[b])}return c});return Ig=u,Ig}var Mg,NE;function MF(){if(NE)return Mg;NE=1;var e=Qr(),t=Xr(),r=Ts();function s(o){return function(a,u,c){var f=Object(a);if(!t(a)){var p=e(u,3);a=r(a),u=function(g){return p(f[g],g,f)}}var d=o(a,u,c);return d>-1?f[p?a[d]:d]:void 0}}return Mg=s,Mg}var Og,CE;function OF(){if(CE)return Og;CE=1;var e=/\s/;function t(r){for(var s=r.length;s--&&e.test(r.charAt(s)););return s}return Og=t,Og}var Pg,jE;function PF(){if(jE)return Pg;jE=1;var e=OF(),t=/^\s+/;function r(s){return s&&s.slice(0,e(s)+1).replace(t,"")}return Pg=r,Pg}var Lg,TE;function LF(){if(TE)return Lg;TE=1;var e=PF(),t=Dn(),r=jo(),s=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;function f(p){if(typeof p=="number")return p;if(r(p))return s;if(t(p)){var d=typeof p.valueOf=="function"?p.valueOf():p;p=t(d)?d+"":d}if(typeof p!="string")return p===0?p:+p;p=e(p);var g=a.test(p);return g||u.test(p)?c(p.slice(2),g?2:8):o.test(p)?s:+p}return Lg=f,Lg}var $g,RE;function oR(){if(RE)return $g;RE=1;var e=LF(),t=1/0,r=17976931348623157e292;function s(o){if(!o)return o===0?o:0;if(o=e(o),o===t||o===-t){var a=o<0?-1:1;return a*r}return o===o?o:0}return $g=s,$g}var qg,AE;function $F(){if(AE)return qg;AE=1;var e=oR();function t(r){var s=e(r),o=s%1;return s===s?o?s-o:s:0}return qg=t,qg}var Dg,IE;function qF(){if(IE)return Dg;IE=1;var e=ZT(),t=Qr(),r=$F(),s=Math.max;function o(a,u,c){var f=a==null?0:a.length;if(!f)return-1;var p=c==null?0:r(c);return p<0&&(p=s(f+p,0)),e(a,t(u,3),p)}return Dg=o,Dg}var Fg,ME;function DF(){if(ME)return Fg;ME=1;var e=MF(),t=qF(),r=e(t);return Fg=r,Fg}var zg,OE;function aR(){if(OE)return zg;OE=1;var e=N0();function t(r){var s=r==null?0:r.length;return s?e(r,1):[]}return zg=t,zg}var Bg,PE;function FF(){if(PE)return Bg;PE=1;var e=b0(),t=AT(),r=di();function s(o,a){return o==null?o:e(o,t(a),r)}return Bg=s,Bg}var Ug,LE;function zF(){if(LE)return Ug;LE=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Ug=e,Ug}var Hg,$E;function BF(){if($E)return Hg;$E=1;var e=Sc(),t=k0(),r=Qr();function s(o,a){var u={};return a=r(a,3),t(o,function(c,f,p){e(u,f,a(c,f,p))}),u}return Hg=s,Hg}var Wg,qE;function j0(){if(qE)return Wg;qE=1;var e=jo();function t(r,s,o){for(var a=-1,u=r.length;++a<u;){var c=r[a],f=s(c);if(f!=null&&(p===void 0?f===f&&!e(f):o(f,p)))var p=f,d=c}return d}return Wg=t,Wg}var Vg,DE;function UF(){if(DE)return Vg;DE=1;function e(t,r){return t>r}return Vg=e,Vg}var Gg,FE;function HF(){if(FE)return Gg;FE=1;var e=j0(),t=UF(),r=fi();function s(o){return o&&o.length?e(o,r,t):void 0}return Gg=s,Gg}var Yg,zE;function lR(){if(zE)return Yg;zE=1;var e=Sc(),t=So();function r(s,o,a){(a!==void 0&&!t(s[o],a)||a===void 0&&!(o in s))&&e(s,o,a)}return Yg=r,Yg}var Kg,BE;function WF(){if(BE)return Kg;BE=1;var e=ui(),t=Tc(),r=kr(),s="[object Object]",o=Function.prototype,a=Object.prototype,u=o.toString,c=a.hasOwnProperty,f=u.call(Object);function p(d){if(!r(d)||e(d)!=s)return!1;var g=t(d);if(g===null)return!0;var y=c.call(g,"constructor")&&g.constructor;return typeof y=="function"&&y instanceof y&&u.call(y)==f}return Kg=p,Kg}var Xg,UE;function uR(){if(UE)return Xg;UE=1;function e(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}return Xg=e,Xg}var Qg,HE;function VF(){if(HE)return Qg;HE=1;var e=il(),t=di();function r(s){return e(s,t(s))}return Qg=r,Qg}var Zg,WE;function GF(){if(WE)return Zg;WE=1;var e=lR(),t=yT(),r=CT(),s=wT(),o=TT(),a=ol(),u=Ct(),c=JT(),f=No(),p=sl(),d=Dn(),g=WF(),y=al(),w=uR(),S=VF();function _(b,k,E,C,T,A,L){var P=w(b,E),U=w(k,E),O=L.get(U);if(O){e(b,E,O);return}var M=A?A(P,U,E+"",b,k,L):void 0,q=M===void 0;if(q){var V=u(U),X=!V&&f(U),j=!V&&!X&&y(U);M=U,V||X||j?u(P)?M=P:c(P)?M=s(P):X?(q=!1,M=t(U,!0)):j?(q=!1,M=r(U,!0)):M=[]:g(U)||a(U)?(M=P,a(P)?M=S(P):(!d(P)||p(P))&&(M=o(U))):q=!1}q&&(L.set(U,M),T(M,U,C,A,L),L.delete(U)),e(b,E,M)}return Zg=_,Zg}var Jg,VE;function YF(){if(VE)return Jg;VE=1;var e=kc(),t=lR(),r=b0(),s=GF(),o=Dn(),a=di(),u=uR();function c(f,p,d,g,y){f!==p&&r(p,function(w,S){if(y||(y=new e),o(w))s(f,p,S,d,c,g,y);else{var _=g?g(u(f,S),w,S+"",f,p,y):void 0;_===void 0&&(_=w),t(f,S,_)}},a)}return Jg=c,Jg}var ev,GE;function KF(){if(GE)return ev;GE=1;var e=Oc(),t=Pc();function r(s){return e(function(o,a){var u=-1,c=a.length,f=c>1?a[c-1]:void 0,p=c>2?a[2]:void 0;for(f=s.length>3&&typeof f=="function"?(c--,f):void 0,p&&t(a[0],a[1],p)&&(f=c<3?void 0:f,c=1),o=Object(o);++u<c;){var d=a[u];d&&s(o,d,u,f)}return o})}return ev=r,ev}var tv,YE;function XF(){if(YE)return tv;YE=1;var e=YF(),t=KF(),r=t(function(s,o,a){e(s,o,a)});return tv=r,tv}var nv,KE;function cR(){if(KE)return nv;KE=1;function e(t,r){return t<r}return nv=e,nv}var rv,XE;function QF(){if(XE)return rv;XE=1;var e=j0(),t=cR(),r=fi();function s(o){return o&&o.length?e(o,r,t):void 0}return rv=s,rv}var sv,QE;function ZF(){if(QE)return sv;QE=1;var e=j0(),t=Qr(),r=cR();function s(o,a){return o&&o.length?e(o,t(a,2),r):void 0}return sv=s,sv}var iv,ZE;function JF(){if(ZE)return iv;ZE=1;var e=ar(),t=function(){return e.Date.now()};return iv=t,iv}var ov,JE;function ez(){if(JE)return ov;JE=1;var e=Ec(),t=Ic(),r=Nc(),s=Dn(),o=ll();function a(u,c,f,p){if(!s(u))return u;c=t(c,u);for(var d=-1,g=c.length,y=g-1,w=u;w!=null&&++d<g;){var S=o(c[d]),_=f;if(S==="__proto__"||S==="constructor"||S==="prototype")return u;if(d!=y){var b=w[S];_=p?p(b,S,w):void 0,_===void 0&&(_=s(b)?b:r(c[d+1])?[]:{})}e(w,S,_),w=w[S]}return u}return ov=a,ov}var av,eN;function tz(){if(eN)return av;eN=1;var e=Mc(),t=ez(),r=Ic();function s(o,a,u){for(var c=-1,f=a.length,p={};++c<f;){var d=a[c],g=e(o,d);u(g,d)&&t(p,r(d,o),g)}return p}return av=s,av}var lv,tN;function nz(){if(tN)return lv;tN=1;var e=tz(),t=BT();function r(s,o){return e(s,o,function(a,u){return t(s,u)})}return lv=r,lv}var uv,nN;function rz(){if(nN)return uv;nN=1;var e=aR(),t=XT(),r=QT();function s(o){return r(t(o,void 0,e),o+"")}return uv=s,uv}var cv,rN;function sz(){if(rN)return cv;rN=1;var e=nz(),t=rz(),r=t(function(s,o){return s==null?{}:e(s,o)});return cv=r,cv}var dv,sN;function iz(){if(sN)return dv;sN=1;var e=Math.ceil,t=Math.max;function r(s,o,a,u){for(var c=-1,f=t(e((o-s)/(a||1)),0),p=Array(f);f--;)p[u?f:++c]=s,s+=a;return p}return dv=r,dv}var fv,iN;function oz(){if(iN)return fv;iN=1;var e=iz(),t=Pc(),r=oR();function s(o){return function(a,u,c){return c&&typeof c!="number"&&t(a,u,c)&&(u=c=void 0),a=r(a),u===void 0?(u=a,a=0):u=r(u),c=c===void 0?a<u?1:-1:r(c),e(a,u,c,o)}}return fv=s,fv}var hv,oN;function az(){if(oN)return hv;oN=1;var e=oz(),t=e();return hv=t,hv}var pv,aN;function lz(){if(aN)return pv;aN=1;function e(t,r){var s=t.length;for(t.sort(r);s--;)t[s]=t[s].value;return t}return pv=e,pv}var mv,lN;function uz(){if(lN)return mv;lN=1;var e=jo();function t(r,s){if(r!==s){var o=r!==void 0,a=r===null,u=r===r,c=e(r),f=s!==void 0,p=s===null,d=s===s,g=e(s);if(!p&&!g&&!c&&r>s||c&&f&&d&&!p&&!g||a&&f&&d||!o&&d||!u)return 1;if(!a&&!c&&!g&&r<s||g&&o&&u&&!a&&!c||p&&o&&u||!f&&u||!d)return-1}return 0}return mv=t,mv}var gv,uN;function cz(){if(uN)return gv;uN=1;var e=uz();function t(r,s,o){for(var a=-1,u=r.criteria,c=s.criteria,f=u.length,p=o.length;++a<f;){var d=e(u[a],c[a]);if(d){if(a>=p)return d;var g=o[a];return d*(g=="desc"?-1:1)}}return r.index-s.index}return gv=t,gv}var vv,cN;function dz(){if(cN)return vv;cN=1;var e=Ac(),t=Mc(),r=Qr(),s=GT(),o=lz(),a=Cc(),u=cz(),c=fi(),f=Ct();function p(d,g,y){g.length?g=e(g,function(_){return f(_)?function(b){return t(b,_.length===1?_[0]:_)}:_}):g=[c];var w=-1;g=e(g,a(r));var S=s(d,function(_,b,k){var E=e(g,function(C){return C(_)});return{criteria:E,index:++w,value:_}});return o(S,function(_,b){return u(_,b,y)})}return vv=p,vv}var yv,dN;function fz(){if(dN)return yv;dN=1;var e=N0(),t=dz(),r=Oc(),s=Pc(),o=r(function(a,u){if(a==null)return[];var c=u.length;return c>1&&s(a,u[0],u[1])?u=[]:c>2&&s(u[0],u[1],u[2])&&(u=[u[0]]),t(a,e(u,1),[])});return yv=o,yv}var wv,fN;function hz(){if(fN)return wv;fN=1;var e=FT(),t=0;function r(s){var o=++t;return e(s)+o}return wv=r,wv}var xv,hN;function pz(){if(hN)return xv;hN=1;function e(t,r,s){for(var o=-1,a=t.length,u=r.length,c={};++o<a;){var f=o<u?r[o]:void 0;s(c,t[o],f)}return c}return xv=e,xv}var _v,pN;function mz(){if(pN)return _v;pN=1;var e=Ec(),t=pz();function r(s,o){return t(s||[],o||[],e)}return _v=r,_v}var bv,mN;function mt(){if(mN)return bv;mN=1;var e;if(typeof d0=="function")try{e={cloneDeep:AF(),constant:_0(),defaults:IF(),each:MT(),filter:HT(),find:DF(),flatten:aR(),forEach:IT(),forIn:FF(),has:WT(),isUndefined:VT(),last:zF(),map:YT(),mapValues:BF(),max:HF(),merge:XF(),min:QF(),minBy:ZF(),now:JF(),pick:sz(),range:az(),reduce:KT(),sortBy:fz(),uniqueId:hz(),values:eR(),zipObject:mz()}}catch{}return e||(e=window._),bv=e,bv}var kv,gN;function gz(){if(gN)return kv;gN=1,kv=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 t(o),o},e.prototype.enqueue=function(s){var o=this._sentinel;s._prev&&s._next&&t(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,a=o._prev;a!==o;)s.push(JSON.stringify(a,r)),a=a._prev;return"["+s.join(", ")+"]"};function t(s){s._prev._next=s._next,s._next._prev=s._prev,delete s._next,delete s._prev}function r(s,o){if(s!=="_next"&&s!=="_prev")return o}return kv}var Sv,vN;function vz(){if(vN)return Sv;vN=1;var e=mt(),t=ir().Graph,r=gz();Sv=o;var s=e.constant(1);function o(p,d){if(p.nodeCount()<=1)return[];var g=c(p,d||s),y=a(g.graph,g.buckets,g.zeroIdx);return e.flatten(e.map(y,function(w){return p.outEdges(w.v,w.w)}),!0)}function a(p,d,g){for(var y=[],w=d[d.length-1],S=d[0],_;p.nodeCount();){for(;_=S.dequeue();)u(p,d,g,_);for(;_=w.dequeue();)u(p,d,g,_);if(p.nodeCount()){for(var b=d.length-2;b>0;--b)if(_=d[b].dequeue(),_){y=y.concat(u(p,d,g,_,!0));break}}}return y}function u(p,d,g,y,w){var S=w?[]:void 0;return e.forEach(p.inEdges(y.v),function(_){var b=p.edge(_),k=p.node(_.v);w&&S.push({v:_.v,w:_.w}),k.out-=b,f(d,g,k)}),e.forEach(p.outEdges(y.v),function(_){var b=p.edge(_),k=_.w,E=p.node(k);E.in-=b,f(d,g,E)}),p.removeNode(y.v),S}function c(p,d){var g=new t,y=0,w=0;e.forEach(p.nodes(),function(b){g.setNode(b,{v:b,in:0,out:0})}),e.forEach(p.edges(),function(b){var k=g.edge(b.v,b.w)||0,E=d(b),C=k+E;g.setEdge(b.v,b.w,C),w=Math.max(w,g.node(b.v).out+=E),y=Math.max(y,g.node(b.w).in+=E)});var S=e.range(w+y+3).map(function(){return new r}),_=y+1;return e.forEach(g.nodes(),function(b){f(S,_,g.node(b))}),{graph:g,buckets:S,zeroIdx:_}}function f(p,d,g){g.out?g.in?p[g.out-g.in+d].enqueue(g):p[p.length-1].enqueue(g):p[0].enqueue(g)}return Sv}var Ev,yN;function yz(){if(yN)return Ev;yN=1;var e=mt(),t=vz();Ev={run:r,undo:o};function r(a){var u=a.graph().acyclicer==="greedy"?t(a,c(a)):s(a);e.forEach(u,function(f){var p=a.edge(f);a.removeEdge(f),p.forwardName=f.name,p.reversed=!0,a.setEdge(f.w,f.v,p,e.uniqueId("rev"))});function c(f){return function(p){return f.edge(p).weight}}}function s(a){var u=[],c={},f={};function p(d){e.has(f,d)||(f[d]=!0,c[d]=!0,e.forEach(a.outEdges(d),function(g){e.has(c,g.w)?u.push(g):p(g.w)}),delete c[d])}return e.forEach(a.nodes(),p),u}function o(a){e.forEach(a.edges(),function(u){var c=a.edge(u);if(c.reversed){a.removeEdge(u);var f=c.forwardName;delete c.reversed,delete c.forwardName,a.setEdge(u.w,u.v,c,f)}})}return Ev}var Nv,wN;function cn(){if(wN)return Nv;wN=1;var e=mt(),t=ir().Graph;Nv={addDummyNode:r,simplify:s,asNonCompoundGraph:o,successorWeights:a,predecessorWeights:u,intersectRect:c,buildLayerMatrix:f,normalizeRanks:p,removeEmptyRanks:d,addBorderNode:g,maxRank:y,partition:w,time:S,notime:_};function r(b,k,E,C){var T;do T=e.uniqueId(C);while(b.hasNode(T));return E.dummy=k,b.setNode(T,E),T}function s(b){var k=new t().setGraph(b.graph());return e.forEach(b.nodes(),function(E){k.setNode(E,b.node(E))}),e.forEach(b.edges(),function(E){var C=k.edge(E.v,E.w)||{weight:0,minlen:1},T=b.edge(E);k.setEdge(E.v,E.w,{weight:C.weight+T.weight,minlen:Math.max(C.minlen,T.minlen)})}),k}function o(b){var k=new t({multigraph:b.isMultigraph()}).setGraph(b.graph());return e.forEach(b.nodes(),function(E){b.children(E).length||k.setNode(E,b.node(E))}),e.forEach(b.edges(),function(E){k.setEdge(E,b.edge(E))}),k}function a(b){var k=e.map(b.nodes(),function(E){var C={};return e.forEach(b.outEdges(E),function(T){C[T.w]=(C[T.w]||0)+b.edge(T).weight}),C});return e.zipObject(b.nodes(),k)}function u(b){var k=e.map(b.nodes(),function(E){var C={};return e.forEach(b.inEdges(E),function(T){C[T.v]=(C[T.v]||0)+b.edge(T).weight}),C});return e.zipObject(b.nodes(),k)}function c(b,k){var E=b.x,C=b.y,T=k.x-E,A=k.y-C,L=b.width/2,P=b.height/2;if(!T&&!A)throw new Error("Not possible to find intersection inside of the rectangle");var U,O;return Math.abs(A)*L>Math.abs(T)*P?(A<0&&(P=-P),U=P*T/A,O=P):(T<0&&(L=-L),U=L,O=L*A/T),{x:E+U,y:C+O}}function f(b){var k=e.map(e.range(y(b)+1),function(){return[]});return e.forEach(b.nodes(),function(E){var C=b.node(E),T=C.rank;e.isUndefined(T)||(k[T][C.order]=E)}),k}function p(b){var k=e.min(e.map(b.nodes(),function(E){return b.node(E).rank}));e.forEach(b.nodes(),function(E){var C=b.node(E);e.has(C,"rank")&&(C.rank-=k)})}function d(b){var k=e.min(e.map(b.nodes(),function(A){return b.node(A).rank})),E=[];e.forEach(b.nodes(),function(A){var L=b.node(A).rank-k;E[L]||(E[L]=[]),E[L].push(A)});var C=0,T=b.graph().nodeRankFactor;e.forEach(E,function(A,L){e.isUndefined(A)&&L%T!==0?--C:C&&e.forEach(A,function(P){b.node(P).rank+=C})})}function g(b,k,E,C){var T={width:0,height:0};return arguments.length>=4&&(T.rank=E,T.order=C),r(b,"border",T,k)}function y(b){return e.max(e.map(b.nodes(),function(k){var E=b.node(k).rank;if(!e.isUndefined(E))return E}))}function w(b,k){var E={lhs:[],rhs:[]};return e.forEach(b,function(C){k(C)?E.lhs.push(C):E.rhs.push(C)}),E}function S(b,k){var E=e.now();try{return k()}finally{console.log(b+" time: "+(e.now()-E)+"ms")}}function _(b,k){return k()}return Nv}var Cv,xN;function wz(){if(xN)return Cv;xN=1;var e=mt(),t=cn();Cv={run:r,undo:o};function r(a){a.graph().dummyChains=[],e.forEach(a.edges(),function(u){s(a,u)})}function s(a,u){var c=u.v,f=a.node(c).rank,p=u.w,d=a.node(p).rank,g=u.name,y=a.edge(u),w=y.labelRank;if(d!==f+1){a.removeEdge(u);var S,_,b;for(b=0,++f;f<d;++b,++f)y.points=[],_={width:0,height:0,edgeLabel:y,edgeObj:u,rank:f},S=t.addDummyNode(a,"edge",_,"_d"),f===w&&(_.width=y.width,_.height=y.height,_.dummy="edge-label",_.labelpos=y.labelpos),a.setEdge(c,S,{weight:y.weight},g),b===0&&a.graph().dummyChains.push(S),c=S;a.setEdge(c,p,{weight:y.weight},g)}}function o(a){e.forEach(a.graph().dummyChains,function(u){var c=a.node(u),f=c.edgeLabel,p;for(a.setEdge(c.edgeObj,f);c.dummy;)p=a.successors(u)[0],a.removeNode(u),f.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(f.x=c.x,f.y=c.y,f.width=c.width,f.height=c.height),u=p,c=a.node(u)})}return Cv}var jv,_N;function oc(){if(_N)return jv;_N=1;var e=mt();jv={longestPath:t,slack:r};function t(s){var o={};function a(u){var c=s.node(u);if(e.has(o,u))return c.rank;o[u]=!0;var f=e.min(e.map(s.outEdges(u),function(p){return a(p.w)-s.edge(p).minlen}));return(f===Number.POSITIVE_INFINITY||f===void 0||f===null)&&(f=0),c.rank=f}e.forEach(s.sources(),a)}function r(s,o){return s.node(o.w).rank-s.node(o.v).rank-s.edge(o).minlen}return jv}var Tv,bN;function dR(){if(bN)return Tv;bN=1;var e=mt(),t=ir().Graph,r=oc().slack;Tv=s;function s(c){var f=new t({directed:!1}),p=c.nodes()[0],d=c.nodeCount();f.setNode(p,{});for(var g,y;o(f,c)<d;)g=a(f,c),y=f.hasNode(g.v)?r(c,g):-r(c,g),u(f,c,y);return f}function o(c,f){function p(d){e.forEach(f.nodeEdges(d),function(g){var y=g.v,w=d===y?g.w:y;!c.hasNode(w)&&!r(f,g)&&(c.setNode(w,{}),c.setEdge(d,w,{}),p(w))})}return e.forEach(c.nodes(),p),c.nodeCount()}function a(c,f){return e.minBy(f.edges(),function(p){if(c.hasNode(p.v)!==c.hasNode(p.w))return r(f,p)})}function u(c,f,p){e.forEach(c.nodes(),function(d){f.node(d).rank+=p})}return Tv}var Rv,kN;function xz(){if(kN)return Rv;kN=1;var e=mt(),t=dR(),r=oc().slack,s=oc().longestPath,o=ir().alg.preorder,a=ir().alg.postorder,u=cn().simplify;Rv=c,c.initLowLimValues=g,c.initCutValues=f,c.calcCutValue=d,c.leaveEdge=w,c.enterEdge=S,c.exchangeEdges=_;function c(C){C=u(C),s(C);var T=t(C);g(T),f(T,C);for(var A,L;A=w(T);)L=S(T,C,A),_(T,C,A,L)}function f(C,T){var A=a(C,C.nodes());A=A.slice(0,A.length-1),e.forEach(A,function(L){p(C,T,L)})}function p(C,T,A){var L=C.node(A),P=L.parent;C.edge(A,P).cutvalue=d(C,T,A)}function d(C,T,A){var L=C.node(A),P=L.parent,U=!0,O=T.edge(A,P),M=0;return O||(U=!1,O=T.edge(P,A)),M=O.weight,e.forEach(T.nodeEdges(A),function(q){var V=q.v===A,X=V?q.w:q.v;if(X!==P){var j=V===U,G=T.edge(q).weight;if(M+=j?G:-G,k(C,A,X)){var B=C.edge(A,X).cutvalue;M+=j?-B:B}}}),M}function g(C,T){arguments.length<2&&(T=C.nodes()[0]),y(C,{},1,T)}function y(C,T,A,L,P){var U=A,O=C.node(L);return T[L]=!0,e.forEach(C.neighbors(L),function(M){e.has(T,M)||(A=y(C,T,A,M,L))}),O.low=U,O.lim=A++,P?O.parent=P:delete O.parent,A}function w(C){return e.find(C.edges(),function(T){return C.edge(T).cutvalue<0})}function S(C,T,A){var L=A.v,P=A.w;T.hasEdge(L,P)||(L=A.w,P=A.v);var U=C.node(L),O=C.node(P),M=U,q=!1;U.lim>O.lim&&(M=O,q=!0);var V=e.filter(T.edges(),function(X){return q===E(C,C.node(X.v),M)&&q!==E(C,C.node(X.w),M)});return e.minBy(V,function(X){return r(T,X)})}function _(C,T,A,L){var P=A.v,U=A.w;C.removeEdge(P,U),C.setEdge(L.v,L.w,{}),g(C),f(C,T),b(C,T)}function b(C,T){var A=e.find(C.nodes(),function(P){return!T.node(P).parent}),L=o(C,A);L=L.slice(1),e.forEach(L,function(P){var U=C.node(P).parent,O=T.edge(P,U),M=!1;O||(O=T.edge(U,P),M=!0),T.node(P).rank=T.node(U).rank+(M?O.minlen:-O.minlen)})}function k(C,T,A){return C.hasEdge(T,A)}function E(C,T,A){return A.low<=T.lim&&T.lim<=A.lim}return Rv}var Av,SN;function _z(){if(SN)return Av;SN=1;var e=oc(),t=e.longestPath,r=dR(),s=xz();Av=o;function o(f){switch(f.graph().ranker){case"network-simplex":c(f);break;case"tight-tree":u(f);break;case"longest-path":a(f);break;default:c(f)}}var a=t;function u(f){t(f),r(f)}function c(f){s(f)}return Av}var Iv,EN;function bz(){if(EN)return Iv;EN=1;var e=mt();Iv=t;function t(o){var a=s(o);e.forEach(o.graph().dummyChains,function(u){for(var c=o.node(u),f=c.edgeObj,p=r(o,a,f.v,f.w),d=p.path,g=p.lca,y=0,w=d[y],S=!0;u!==f.w;){if(c=o.node(u),S){for(;(w=d[y])!==g&&o.node(w).maxRank<c.rank;)y++;w===g&&(S=!1)}if(!S){for(;y<d.length-1&&o.node(w=d[y+1]).minRank<=c.rank;)y++;w=d[y]}o.setParent(u,w),u=o.successors(u)[0]}})}function r(o,a,u,c){var f=[],p=[],d=Math.min(a[u].low,a[c].low),g=Math.max(a[u].lim,a[c].lim),y,w;y=u;do y=o.parent(y),f.push(y);while(y&&(a[y].low>d||g>a[y].lim));for(w=y,y=c;(y=o.parent(y))!==w;)p.push(y);return{path:f.concat(p.reverse()),lca:w}}function s(o){var a={},u=0;function c(f){var p=u;e.forEach(o.children(f),c),a[f]={low:p,lim:u++}}return e.forEach(o.children(),c),a}return Iv}var Mv,NN;function kz(){if(NN)return Mv;NN=1;var e=mt(),t=cn();Mv={run:r,cleanup:u};function r(c){var f=t.addDummyNode(c,"root",{},"_root"),p=o(c),d=e.max(e.values(p))-1,g=2*d+1;c.graph().nestingRoot=f,e.forEach(c.edges(),function(w){c.edge(w).minlen*=g});var y=a(c)+1;e.forEach(c.children(),function(w){s(c,f,g,y,d,p,w)}),c.graph().nodeRankFactor=g}function s(c,f,p,d,g,y,w){var S=c.children(w);if(!S.length){w!==f&&c.setEdge(f,w,{weight:0,minlen:p});return}var _=t.addBorderNode(c,"_bt"),b=t.addBorderNode(c,"_bb"),k=c.node(w);c.setParent(_,w),k.borderTop=_,c.setParent(b,w),k.borderBottom=b,e.forEach(S,function(E){s(c,f,p,d,g,y,E);var C=c.node(E),T=C.borderTop?C.borderTop:E,A=C.borderBottom?C.borderBottom:E,L=C.borderTop?d:2*d,P=T!==A?1:g-y[w]+1;c.setEdge(_,T,{weight:L,minlen:P,nestingEdge:!0}),c.setEdge(A,b,{weight:L,minlen:P,nestingEdge:!0})}),c.parent(w)||c.setEdge(f,_,{weight:0,minlen:g+y[w]})}function o(c){var f={};function p(d,g){var y=c.children(d);y&&y.length&&e.forEach(y,function(w){p(w,g+1)}),f[d]=g}return e.forEach(c.children(),function(d){p(d,1)}),f}function a(c){return e.reduce(c.edges(),function(f,p){return f+c.edge(p).weight},0)}function u(c){var f=c.graph();c.removeNode(f.nestingRoot),delete f.nestingRoot,e.forEach(c.edges(),function(p){var d=c.edge(p);d.nestingEdge&&c.removeEdge(p)})}return Mv}var Ov,CN;function Sz(){if(CN)return Ov;CN=1;var e=mt(),t=cn();Ov=r;function r(o){function a(u){var c=o.children(u),f=o.node(u);if(c.length&&e.forEach(c,a),e.has(f,"minRank")){f.borderLeft=[],f.borderRight=[];for(var p=f.minRank,d=f.maxRank+1;p<d;++p)s(o,"borderLeft","_bl",u,f,p),s(o,"borderRight","_br",u,f,p)}}e.forEach(o.children(),a)}function s(o,a,u,c,f,p){var d={width:0,height:0,rank:p,borderType:a},g=f[a][p-1],y=t.addDummyNode(o,"border",d,u);f[a][p]=y,o.setParent(y,c),g&&o.setEdge(g,y,{weight:1})}return Ov}var Pv,jN;function Ez(){if(jN)return Pv;jN=1;var e=mt();Pv={adjust:t,undo:r};function t(p){var d=p.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&s(p)}function r(p){var d=p.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&a(p),(d==="lr"||d==="rl")&&(c(p),s(p))}function s(p){e.forEach(p.nodes(),function(d){o(p.node(d))}),e.forEach(p.edges(),function(d){o(p.edge(d))})}function o(p){var d=p.width;p.width=p.height,p.height=d}function a(p){e.forEach(p.nodes(),function(d){u(p.node(d))}),e.forEach(p.edges(),function(d){var g=p.edge(d);e.forEach(g.points,u),e.has(g,"y")&&u(g)})}function u(p){p.y=-p.y}function c(p){e.forEach(p.nodes(),function(d){f(p.node(d))}),e.forEach(p.edges(),function(d){var g=p.edge(d);e.forEach(g.points,f),e.has(g,"x")&&f(g)})}function f(p){var d=p.x;p.x=p.y,p.y=d}return Pv}var Lv,TN;function Nz(){if(TN)return Lv;TN=1;var e=mt();Lv=t;function t(r){var s={},o=e.filter(r.nodes(),function(p){return!r.children(p).length}),a=e.max(e.map(o,function(p){return r.node(p).rank})),u=e.map(e.range(a+1),function(){return[]});function c(p){if(!e.has(s,p)){s[p]=!0;var d=r.node(p);u[d.rank].push(p),e.forEach(r.successors(p),c)}}var f=e.sortBy(o,function(p){return r.node(p).rank});return e.forEach(f,c),u}return Lv}var $v,RN;function Cz(){if(RN)return $v;RN=1;var e=mt();$v=t;function t(s,o){for(var a=0,u=1;u<o.length;++u)a+=r(s,o[u-1],o[u]);return a}function r(s,o,a){for(var u=e.zipObject(a,e.map(a,function(y,w){return w})),c=e.flatten(e.map(o,function(y){return e.sortBy(e.map(s.outEdges(y),function(w){return{pos:u[w.w],weight:s.edge(w).weight}}),"pos")}),!0),f=1;f<a.length;)f<<=1;var p=2*f-1;f-=1;var d=e.map(new Array(p),function(){return 0}),g=0;return e.forEach(c.forEach(function(y){var w=y.pos+f;d[w]+=y.weight;for(var S=0;w>0;)w%2&&(S+=d[w+1]),w=w-1>>1,d[w]+=y.weight;g+=y.weight*S})),g}return $v}var qv,AN;function jz(){if(AN)return qv;AN=1;var e=mt();qv=t;function t(r,s){return e.map(s,function(o){var a=r.inEdges(o);if(a.length){var u=e.reduce(a,function(c,f){var p=r.edge(f),d=r.node(f.v);return{sum:c.sum+p.weight*d.order,weight:c.weight+p.weight}},{sum:0,weight:0});return{v:o,barycenter:u.sum/u.weight,weight:u.weight}}else return{v:o}})}return qv}var Dv,IN;function Tz(){if(IN)return Dv;IN=1;var e=mt();Dv=t;function t(o,a){var u={};e.forEach(o,function(f,p){var d=u[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:p};e.isUndefined(f.barycenter)||(d.barycenter=f.barycenter,d.weight=f.weight)}),e.forEach(a.edges(),function(f){var p=u[f.v],d=u[f.w];!e.isUndefined(p)&&!e.isUndefined(d)&&(d.indegree++,p.out.push(u[f.w]))});var c=e.filter(u,function(f){return!f.indegree});return r(c)}function r(o){var a=[];function u(p){return function(d){d.merged||(e.isUndefined(d.barycenter)||e.isUndefined(p.barycenter)||d.barycenter>=p.barycenter)&&s(p,d)}}function c(p){return function(d){d.in.push(p),--d.indegree===0&&o.push(d)}}for(;o.length;){var f=o.pop();a.push(f),e.forEach(f.in.reverse(),u(f)),e.forEach(f.out,c(f))}return e.map(e.filter(a,function(p){return!p.merged}),function(p){return e.pick(p,["vs","i","barycenter","weight"])})}function s(o,a){var u=0,c=0;o.weight&&(u+=o.barycenter*o.weight,c+=o.weight),a.weight&&(u+=a.barycenter*a.weight,c+=a.weight),o.vs=a.vs.concat(o.vs),o.barycenter=u/c,o.weight=c,o.i=Math.min(a.i,o.i),a.merged=!0}return Dv}var Fv,MN;function Rz(){if(MN)return Fv;MN=1;var e=mt(),t=cn();Fv=r;function r(a,u){var c=t.partition(a,function(_){return e.has(_,"barycenter")}),f=c.lhs,p=e.sortBy(c.rhs,function(_){return-_.i}),d=[],g=0,y=0,w=0;f.sort(o(!!u)),w=s(d,p,w),e.forEach(f,function(_){w+=_.vs.length,d.push(_.vs),g+=_.barycenter*_.weight,y+=_.weight,w=s(d,p,w)});var S={vs:e.flatten(d,!0)};return y&&(S.barycenter=g/y,S.weight=y),S}function s(a,u,c){for(var f;u.length&&(f=e.last(u)).i<=c;)u.pop(),a.push(f.vs),c++;return c}function o(a){return function(u,c){return u.barycenter<c.barycenter?-1:u.barycenter>c.barycenter?1:a?c.i-u.i:u.i-c.i}}return Fv}var zv,ON;function Az(){if(ON)return zv;ON=1;var e=mt(),t=jz(),r=Tz(),s=Rz();zv=o;function o(c,f,p,d){var g=c.children(f),y=c.node(f),w=y?y.borderLeft:void 0,S=y?y.borderRight:void 0,_={};w&&(g=e.filter(g,function(A){return A!==w&&A!==S}));var b=t(c,g);e.forEach(b,function(A){if(c.children(A.v).length){var L=o(c,A.v,p,d);_[A.v]=L,e.has(L,"barycenter")&&u(A,L)}});var k=r(b,p);a(k,_);var E=s(k,d);if(w&&(E.vs=e.flatten([w,E.vs,S],!0),c.predecessors(w).length)){var C=c.node(c.predecessors(w)[0]),T=c.node(c.predecessors(S)[0]);e.has(E,"barycenter")||(E.barycenter=0,E.weight=0),E.barycenter=(E.barycenter*E.weight+C.order+T.order)/(E.weight+2),E.weight+=2}return E}function a(c,f){e.forEach(c,function(p){p.vs=e.flatten(p.vs.map(function(d){return f[d]?f[d].vs:d}),!0)})}function u(c,f){e.isUndefined(c.barycenter)?(c.barycenter=f.barycenter,c.weight=f.weight):(c.barycenter=(c.barycenter*c.weight+f.barycenter*f.weight)/(c.weight+f.weight),c.weight+=f.weight)}return zv}var Bv,PN;function Iz(){if(PN)return Bv;PN=1;var e=mt(),t=ir().Graph;Bv=r;function r(o,a,u){var c=s(o),f=new t({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(p){return o.node(p)});return e.forEach(o.nodes(),function(p){var d=o.node(p),g=o.parent(p);(d.rank===a||d.minRank<=a&&a<=d.maxRank)&&(f.setNode(p),f.setParent(p,g||c),e.forEach(o[u](p),function(y){var w=y.v===p?y.w:y.v,S=f.edge(w,p),_=e.isUndefined(S)?0:S.weight;f.setEdge(w,p,{weight:o.edge(y).weight+_})}),e.has(d,"minRank")&&f.setNode(p,{borderLeft:d.borderLeft[a],borderRight:d.borderRight[a]}))}),f}function s(o){for(var a;o.hasNode(a=e.uniqueId("_root")););return a}return Bv}var Uv,LN;function Mz(){if(LN)return Uv;LN=1;var e=mt();Uv=t;function t(r,s,o){var a={},u;e.forEach(o,function(c){for(var f=r.parent(c),p,d;f;){if(p=r.parent(f),p?(d=a[p],a[p]=f):(d=u,u=f),d&&d!==f){s.setEdge(d,f);return}f=p}})}return Uv}var Hv,$N;function Oz(){if($N)return Hv;$N=1;var e=mt(),t=Nz(),r=Cz(),s=Az(),o=Iz(),a=Mz(),u=ir().Graph,c=cn();Hv=f;function f(y){var w=c.maxRank(y),S=p(y,e.range(1,w+1),"inEdges"),_=p(y,e.range(w-1,-1,-1),"outEdges"),b=t(y);g(y,b);for(var k=Number.POSITIVE_INFINITY,E,C=0,T=0;T<4;++C,++T){d(C%2?S:_,C%4>=2),b=c.buildLayerMatrix(y);var A=r(y,b);A<k&&(T=0,E=e.cloneDeep(b),k=A)}g(y,E)}function p(y,w,S){return e.map(w,function(_){return o(y,_,S)})}function d(y,w){var S=new u;e.forEach(y,function(_){var b=_.graph().root,k=s(_,b,S,w);e.forEach(k.vs,function(E,C){_.node(E).order=C}),a(_,S,k.vs)})}function g(y,w){e.forEach(w,function(S){e.forEach(S,function(_,b){y.node(_).order=b})})}return Hv}var Wv,qN;function Pz(){if(qN)return Wv;qN=1;var e=mt(),t=ir().Graph,r=cn();Wv={positionX:S,findType1Conflicts:s,findType2Conflicts:o,addConflict:u,hasConflict:c,verticalAlignment:f,horizontalCompaction:p,alignCoordinates:y,findSmallestWidthAlignment:g,balance:w};function s(k,E){var C={};function T(A,L){var P=0,U=0,O=A.length,M=e.last(L);return e.forEach(L,function(q,V){var X=a(k,q),j=X?k.node(X).order:O;(X||q===M)&&(e.forEach(L.slice(U,V+1),function(G){e.forEach(k.predecessors(G),function(B){var te=k.node(B),Z=te.order;(Z<P||j<Z)&&!(te.dummy&&k.node(G).dummy)&&u(C,B,G)})}),U=V+1,P=j)}),L}return e.reduce(E,T),C}function o(k,E){var C={};function T(L,P,U,O,M){var q;e.forEach(e.range(P,U),function(V){q=L[V],k.node(q).dummy&&e.forEach(k.predecessors(q),function(X){var j=k.node(X);j.dummy&&(j.order<O||j.order>M)&&u(C,X,q)})})}function A(L,P){var U=-1,O,M=0;return e.forEach(P,function(q,V){if(k.node(q).dummy==="border"){var X=k.predecessors(q);X.length&&(O=k.node(X[0]).order,T(P,M,V,U,O),M=V,U=O)}T(P,M,P.length,O,L.length)}),P}return e.reduce(E,A),C}function a(k,E){if(k.node(E).dummy)return e.find(k.predecessors(E),function(C){return k.node(C).dummy})}function u(k,E,C){if(E>C){var T=E;E=C,C=T}var A=k[E];A||(k[E]=A={}),A[C]=!0}function c(k,E,C){if(E>C){var T=E;E=C,C=T}return e.has(k[E],C)}function f(k,E,C,T){var A={},L={},P={};return e.forEach(E,function(U){e.forEach(U,function(O,M){A[O]=O,L[O]=O,P[O]=M})}),e.forEach(E,function(U){var O=-1;e.forEach(U,function(M){var q=T(M);if(q.length){q=e.sortBy(q,function(B){return P[B]});for(var V=(q.length-1)/2,X=Math.floor(V),j=Math.ceil(V);X<=j;++X){var G=q[X];L[M]===M&&O<P[G]&&!c(C,M,G)&&(L[G]=M,L[M]=A[M]=A[G],O=P[G])}}})}),{root:A,align:L}}function p(k,E,C,T,A){var L={},P=d(k,E,C,A),U=A?"borderLeft":"borderRight";function O(V,X){for(var j=P.nodes(),G=j.pop(),B={};G;)B[G]?V(G):(B[G]=!0,j.push(G),j=j.concat(X(G))),G=j.pop()}function M(V){L[V]=P.inEdges(V).reduce(function(X,j){return Math.max(X,L[j.v]+P.edge(j))},0)}function q(V){var X=P.outEdges(V).reduce(function(G,B){return Math.min(G,L[B.w]-P.edge(B))},Number.POSITIVE_INFINITY),j=k.node(V);X!==Number.POSITIVE_INFINITY&&j.borderType!==U&&(L[V]=Math.max(L[V],X))}return O(M,P.predecessors.bind(P)),O(q,P.successors.bind(P)),e.forEach(T,function(V){L[V]=L[C[V]]}),L}function d(k,E,C,T){var A=new t,L=k.graph(),P=_(L.nodesep,L.edgesep,T);return e.forEach(E,function(U){var O;e.forEach(U,function(M){var q=C[M];if(A.setNode(q),O){var V=C[O],X=A.edge(V,q);A.setEdge(V,q,Math.max(P(k,M,O),X||0))}O=M})}),A}function g(k,E){return e.minBy(e.values(E),function(C){var T=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;return e.forIn(C,function(L,P){var U=b(k,P)/2;T=Math.max(L+U,T),A=Math.min(L-U,A)}),T-A})}function y(k,E){var C=e.values(E),T=e.min(C),A=e.max(C);e.forEach(["u","d"],function(L){e.forEach(["l","r"],function(P){var U=L+P,O=k[U],M;if(O!==E){var q=e.values(O);M=P==="l"?T-e.min(q):A-e.max(q),M&&(k[U]=e.mapValues(O,function(V){return V+M}))}})})}function w(k,E){return e.mapValues(k.ul,function(C,T){if(E)return k[E.toLowerCase()][T];var A=e.sortBy(e.map(k,T));return(A[1]+A[2])/2})}function S(k){var E=r.buildLayerMatrix(k),C=e.merge(s(k,E),o(k,E)),T={},A;e.forEach(["u","d"],function(P){A=P==="u"?E:e.values(E).reverse(),e.forEach(["l","r"],function(U){U==="r"&&(A=e.map(A,function(V){return e.values(V).reverse()}));var O=(P==="u"?k.predecessors:k.successors).bind(k),M=f(k,A,C,O),q=p(k,A,M.root,M.align,U==="r");U==="r"&&(q=e.mapValues(q,function(V){return-V})),T[P+U]=q})});var L=g(k,T);return y(T,L),w(T,k.graph().align)}function _(k,E,C){return function(T,A,L){var P=T.node(A),U=T.node(L),O=0,M;if(O+=P.width/2,e.has(P,"labelpos"))switch(P.labelpos.toLowerCase()){case"l":M=-P.width/2;break;case"r":M=P.width/2;break}if(M&&(O+=C?M:-M),M=0,O+=(P.dummy?E:k)/2,O+=(U.dummy?E:k)/2,O+=U.width/2,e.has(U,"labelpos"))switch(U.labelpos.toLowerCase()){case"l":M=U.width/2;break;case"r":M=-U.width/2;break}return M&&(O+=C?M:-M),M=0,O}}function b(k,E){return k.node(E).width}return Wv}var Vv,DN;function Lz(){if(DN)return Vv;DN=1;var e=mt(),t=cn(),r=Pz().positionX;Vv=s;function s(a){a=t.asNonCompoundGraph(a),o(a),e.forEach(r(a),function(u,c){a.node(c).x=u})}function o(a){var u=t.buildLayerMatrix(a),c=a.graph().ranksep,f=0;e.forEach(u,function(p){var d=e.max(e.map(p,function(g){return a.node(g).height}));e.forEach(p,function(g){a.node(g).y=f+d/2}),f+=d+c})}return Vv}var Gv,FN;function $z(){if(FN)return Gv;FN=1;var e=mt(),t=yz(),r=wz(),s=_z(),o=cn().normalizeRanks,a=bz(),u=cn().removeEmptyRanks,c=kz(),f=Sz(),p=Ez(),d=Oz(),g=Lz(),y=cn(),w=ir().Graph;Gv=S;function S(z,Q){var ne=Q&&Q.debugTiming?y.time:y.notime;ne("layout",function(){var oe=ne(" buildLayoutGraph",function(){return O(z)});ne(" runLayout",function(){_(oe,ne)}),ne(" updateInputGraph",function(){b(z,oe)})})}function _(z,Q){Q(" makeSpaceForEdgeLabels",function(){M(z)}),Q(" removeSelfEdges",function(){$(z)}),Q(" acyclic",function(){t.run(z)}),Q(" nestingGraph.run",function(){c.run(z)}),Q(" rank",function(){s(y.asNonCompoundGraph(z))}),Q(" injectEdgeLabelProxies",function(){q(z)}),Q(" removeEmptyRanks",function(){u(z)}),Q(" nestingGraph.cleanup",function(){c.cleanup(z)}),Q(" normalizeRanks",function(){o(z)}),Q(" assignRankMinMax",function(){V(z)}),Q(" removeEdgeLabelProxies",function(){X(z)}),Q(" normalize.run",function(){r.run(z)}),Q(" parentDummyChains",function(){a(z)}),Q(" addBorderSegments",function(){f(z)}),Q(" order",function(){d(z)}),Q(" insertSelfEdges",function(){H(z)}),Q(" adjustCoordinateSystem",function(){p.adjust(z)}),Q(" position",function(){g(z)}),Q(" positionSelfEdges",function(){I(z)}),Q(" removeBorderNodes",function(){Z(z)}),Q(" normalize.undo",function(){r.undo(z)}),Q(" fixupEdgeLabelCoords",function(){B(z)}),Q(" undoCoordinateSystem",function(){p.undo(z)}),Q(" translateGraph",function(){j(z)}),Q(" assignNodeIntersects",function(){G(z)}),Q(" reversePoints",function(){te(z)}),Q(" acyclic.undo",function(){t.undo(z)})}function b(z,Q){e.forEach(z.nodes(),function(ne){var oe=z.node(ne),fe=Q.node(ne);oe&&(oe.x=fe.x,oe.y=fe.y,Q.children(ne).length&&(oe.width=fe.width,oe.height=fe.height))}),e.forEach(z.edges(),function(ne){var oe=z.edge(ne),fe=Q.edge(ne);oe.points=fe.points,e.has(fe,"x")&&(oe.x=fe.x,oe.y=fe.y)}),z.graph().width=Q.graph().width,z.graph().height=Q.graph().height}var k=["nodesep","edgesep","ranksep","marginx","marginy"],E={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},C=["acyclicer","ranker","rankdir","align"],T=["width","height"],A={width:0,height:0},L=["minlen","weight","width","height","labeloffset"],P={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"];function O(z){var Q=new w({multigraph:!0,compound:!0}),ne=ce(z.graph());return Q.setGraph(e.merge({},E,Y(ne,k),e.pick(ne,C))),e.forEach(z.nodes(),function(oe){var fe=ce(z.node(oe));Q.setNode(oe,e.defaults(Y(fe,T),A)),Q.setParent(oe,z.parent(oe))}),e.forEach(z.edges(),function(oe){var fe=ce(z.edge(oe));Q.setEdge(oe,e.merge({},P,Y(fe,L),e.pick(fe,U)))}),Q}function M(z){var Q=z.graph();Q.ranksep/=2,e.forEach(z.edges(),function(ne){var oe=z.edge(ne);oe.minlen*=2,oe.labelpos.toLowerCase()!=="c"&&(Q.rankdir==="TB"||Q.rankdir==="BT"?oe.width+=oe.labeloffset:oe.height+=oe.labeloffset)})}function q(z){e.forEach(z.edges(),function(Q){var ne=z.edge(Q);if(ne.width&&ne.height){var oe=z.node(Q.v),fe=z.node(Q.w),pe={rank:(fe.rank-oe.rank)/2+oe.rank,e:Q};y.addDummyNode(z,"edge-proxy",pe,"_ep")}})}function V(z){var Q=0;e.forEach(z.nodes(),function(ne){var oe=z.node(ne);oe.borderTop&&(oe.minRank=z.node(oe.borderTop).rank,oe.maxRank=z.node(oe.borderBottom).rank,Q=e.max(Q,oe.maxRank))}),z.graph().maxRank=Q}function X(z){e.forEach(z.nodes(),function(Q){var ne=z.node(Q);ne.dummy==="edge-proxy"&&(z.edge(ne.e).labelRank=ne.rank,z.removeNode(Q))})}function j(z){var Q=Number.POSITIVE_INFINITY,ne=0,oe=Number.POSITIVE_INFINITY,fe=0,pe=z.graph(),ye=pe.marginx||0,Me=pe.marginy||0;function Ue(ze){var Ie=ze.x,ke=ze.y,le=ze.width,we=ze.height;Q=Math.min(Q,Ie-le/2),ne=Math.max(ne,Ie+le/2),oe=Math.min(oe,ke-we/2),fe=Math.max(fe,ke+we/2)}e.forEach(z.nodes(),function(ze){Ue(z.node(ze))}),e.forEach(z.edges(),function(ze){var Ie=z.edge(ze);e.has(Ie,"x")&&Ue(Ie)}),Q-=ye,oe-=Me,e.forEach(z.nodes(),function(ze){var Ie=z.node(ze);Ie.x-=Q,Ie.y-=oe}),e.forEach(z.edges(),function(ze){var Ie=z.edge(ze);e.forEach(Ie.points,function(ke){ke.x-=Q,ke.y-=oe}),e.has(Ie,"x")&&(Ie.x-=Q),e.has(Ie,"y")&&(Ie.y-=oe)}),pe.width=ne-Q+ye,pe.height=fe-oe+Me}function G(z){e.forEach(z.edges(),function(Q){var ne=z.edge(Q),oe=z.node(Q.v),fe=z.node(Q.w),pe,ye;ne.points?(pe=ne.points[0],ye=ne.points[ne.points.length-1]):(ne.points=[],pe=fe,ye=oe),ne.points.unshift(y.intersectRect(oe,pe)),ne.points.push(y.intersectRect(fe,ye))})}function B(z){e.forEach(z.edges(),function(Q){var ne=z.edge(Q);if(e.has(ne,"x"))switch((ne.labelpos==="l"||ne.labelpos==="r")&&(ne.width-=ne.labeloffset),ne.labelpos){case"l":ne.x-=ne.width/2+ne.labeloffset;break;case"r":ne.x+=ne.width/2+ne.labeloffset;break}})}function te(z){e.forEach(z.edges(),function(Q){var ne=z.edge(Q);ne.reversed&&ne.points.reverse()})}function Z(z){e.forEach(z.nodes(),function(Q){if(z.children(Q).length){var ne=z.node(Q),oe=z.node(ne.borderTop),fe=z.node(ne.borderBottom),pe=z.node(e.last(ne.borderLeft)),ye=z.node(e.last(ne.borderRight));ne.width=Math.abs(ye.x-pe.x),ne.height=Math.abs(fe.y-oe.y),ne.x=pe.x+ne.width/2,ne.y=oe.y+ne.height/2}}),e.forEach(z.nodes(),function(Q){z.node(Q).dummy==="border"&&z.removeNode(Q)})}function $(z){e.forEach(z.edges(),function(Q){if(Q.v===Q.w){var ne=z.node(Q.v);ne.selfEdges||(ne.selfEdges=[]),ne.selfEdges.push({e:Q,label:z.edge(Q)}),z.removeEdge(Q)}})}function H(z){var Q=y.buildLayerMatrix(z);e.forEach(Q,function(ne){var oe=0;e.forEach(ne,function(fe,pe){var ye=z.node(fe);ye.order=pe+oe,e.forEach(ye.selfEdges,function(Me){y.addDummyNode(z,"selfedge",{width:Me.label.width,height:Me.label.height,rank:ye.rank,order:pe+ ++oe,e:Me.e,label:Me.label},"_se")}),delete ye.selfEdges})})}function I(z){e.forEach(z.nodes(),function(Q){var ne=z.node(Q);if(ne.dummy==="selfedge"){var oe=z.node(ne.e.v),fe=oe.x+oe.width/2,pe=oe.y,ye=ne.x-fe,Me=oe.height/2;z.setEdge(ne.e,ne.label),z.removeNode(Q),ne.label.points=[{x:fe+2*ye/3,y:pe-Me},{x:fe+5*ye/6,y:pe-Me},{x:fe+ye,y:pe},{x:fe+5*ye/6,y:pe+Me},{x:fe+2*ye/3,y:pe+Me}],ne.label.x=ne.x,ne.label.y=ne.y}})}function Y(z,Q){return e.mapValues(e.pick(z,Q),Number)}function ce(z){var Q={};return e.forEach(z,function(ne,oe){Q[oe.toLowerCase()]=ne}),Q}return Gv}var Yv,zN;function qz(){if(zN)return Yv;zN=1;var e=mt(),t=cn(),r=ir().Graph;Yv={debugOrdering:s};function s(o){var a=t.buildLayerMatrix(o),u=new r({compound:!0,multigraph:!0}).setGraph({});return e.forEach(o.nodes(),function(c){u.setNode(c,{label:c}),u.setParent(c,"layer"+o.node(c).rank)}),e.forEach(o.edges(),function(c){u.setEdge(c.v,c.w,{},c.name)}),e.forEach(a,function(c,f){var p="layer"+f;u.setNode(p,{rank:"same"}),e.reduce(c,function(d,g){return u.setEdge(d,g,{style:"invis"}),g})}),u}return Yv}var Kv,BN;function Dz(){return BN||(BN=1,Kv="0.8.5"),Kv}var Xv,UN;function Fz(){return UN||(UN=1,Xv={graphlib:ir(),layout:$z(),debug:qz(),util:{time:cn().time,notime:cn().notime},version:Dz()}),Xv}var zz=Fz();const HN=My(zz),bo=240,ac=130,mo=74,Lc=72,WN=mo+Lc;function Bz(e,t){var s;let r=bo;for(const o of e)r=Math.max(r,((s=t.get(o.id))==null?void 0:s.width)??bo);return r}const fR=420,Uz=2;function Ga(e){var r;return((r=e.data)==null?void 0:r.sessionId)??"_default"}function Hz(e,t){return((t==null?void 0:t.get(e))??0)>0?fR:0}function Wz(e,t){const r=(t==null?void 0:t.get(e))??0;return r>0?6+r*36:0}function Ya(e,t,r){const s=t.get(e);return{w:((s==null?void 0:s.width)??bo)+Hz(e,r),h:Math.max((s==null?void 0:s.height)??ac,Wz(e,r))}}function Vz(e){return[...e.keys()].sort().map(t=>`${t}:${e.get(t)}`).join("|")}function Gz(e,t,r,s,o,a){const u=new HN.graphlib.Graph;u.setDefaultEdgeLabel(()=>({})),u.setGraph({rankdir:r,marginx:0,marginy:0,nodesep:70,ranksep:160,edgesep:30});const c=e.filter(k=>!o.has(k)),f=new Set(c);for(const k of c){const{w:E,h:C}=Ya(k,s,a);u.setNode(k,{width:E,height:C})}for(const k of t)f.has(k.source)&&f.has(k.target)&&u.setEdge(k.source,k.target);HN.layout(u);const p=new Map;let d=1/0,g=1/0,y=-1/0,w=-1/0;for(const k of c){const E=u.node(k);if(!E)continue;const C=s.get(k),T=(C==null?void 0:C.width)??bo,A=(C==null?void 0:C.height)??ac,L=Ya(k,s,a),P=E.x-L.w/2,U=E.y-L.h/2;p.set(k,{x:P,y:U}),P<d&&(d=P),U<g&&(g=U),P+T>y&&(y=P+T),U+A>w&&(w=U+A)}if(Number.isFinite(d)&&Number.isFinite(g))for(const[k,E]of p)p.set(k,{x:E.x-d,y:E.y-g});const S=Number.isFinite(y)?y-d:0,_=Number.isFinite(w)?w-g:0;let b=null;for(const k of e){const E=o.get(k);if(!E)continue;const C=s.get(k),T=(C==null?void 0:C.width)??bo,A=(C==null?void 0:C.height)??ac;b=b===null?{minX:E.x,minY:E.y,maxX:E.x+T,maxY:E.y+A}:{minX:Math.min(b.minX,E.x),minY:Math.min(b.minY,E.y),maxX:Math.max(b.maxX,E.x+T),maxY:Math.max(b.maxY,E.y+A)}}return{positions:p,width:S,height:_,pinnedBox:b}}function Yz(e,t,r={}){const s=r.direction??"LR",o=r.pinned??new Map,a=r.measured??new Map,u=r.lanes,c=new Map;for(const k of e){const E=Ga(k),C=c.get(E);C?C.push(k.id):c.set(E,[k.id])}const p=Array.from(c.keys()).sort().map(k=>({sid:k,...Gz(c.get(k),t,s,a,o,u)})),d=Bz(e,a),g=r.availableHeight&&r.availableHeight>0?r.availableHeight:Number.POSITIVE_INFINITY,y=k=>{const E=[[]];let C=0;for(const T of p)E.length<k&&C>0&&C+T.height>g&&(E.push([]),C=0),E[E.length-1].push(T),C+=T.height+WN;return E},w=k=>k.reduce((E,C)=>Math.max(E,C.width),0)+fR;let S=y(r.availableWidth?Uz:1);S.length>1&&S.reduce((E,C)=>E+w(C),0)+d*(S.length-1)>(r.availableWidth??0)&&(S=y(1));const _=new Map;let b=0;for(const k of S){const E=w(k);let C=0;for(const{positions:T,height:A,pinnedBox:L}of k){for(const[U,O]of T)_.set(U,{x:O.x+b,y:O.y+C});let P=C+A;L&&L.maxY>P&&L.minX<b+E&&b<L.maxX&&(P=L.maxY),C=P+WN}b+=E+d}return e.map(k=>{const E=o.get(k.id);if(E)return{...k,position:E};const C=_.get(k.id);return C?{...k,position:C}:k})}function Kz(e,t,r,s,o){const u=mo+Lc,c=60,f=w=>Ya(w,s,o),p=new Map(e.map(w=>[w.id,Ga(w)])),d=[],g=e.map(w=>({id:w.id,pos:r.get(w.id)??t.get(w.id)})).filter(w=>w.pos!=null).sort((w,S)=>w.pos.y-S.pos.y||w.pos.x-S.pos.x||w.id.localeCompare(S.id)),y=[];for(const{id:w,pos:S}of g){const{w:_,h:b}=f(w),k=p.get(w)??"_default";if(r.has(w)){d.push({x:S.x,y:S.y,w:_,h:b,sid:k});continue}let E=S.y;for(let C=0;C<d.length+1;C++){const T=d.find(A=>{const L=A.sid===k?24:c,P=A.sid===k?24:u;return S.x<A.x+A.w+L&&A.x<S.x+_+L&&E<A.y+A.h+P&&A.y<E+b+P});if(!T)break;E=T.y+T.h+(T.sid===k?24:u)}E!==S.y&&(t.set(w,{x:S.x,y:E}),y.push(w)),d.push({x:S.x,y:E,w:_,h:b,sid:k})}return y}function Xz(e,t,r,s,o,a){const u=_=>Ya(_,s,a),c=_=>r.get(_)??t.get(_),f=new Map;for(const _ of e){if(!c(_.id))continue;const b=Ga(_),k=f.get(b);k?k.push(_):f.set(b,[_])}const p=new Set;for(const[_,b]of f)b.every(k=>o.has(k.id)&&!r.has(k.id))&&p.add(_);const d=new Map,g=[];for(const _ of e){const b=c(_.id);if(!b)continue;const{w:k,h:E}=u(_.id),C=Ga(_);p.has(C)?(d.get(C)??d.set(C,[]).get(C)).push(_):g.push({x:b.x,y:b.y,w:k,h:E})}if(d.size===0)return[];const y=mo+Lc,w=(_,b,k,E)=>g.some(C=>_<C.x+C.w+mo&&C.x<_+k+mo&&b<C.y+C.h+y&&C.y<b+E+y),S=[];for(const _ of[...d.keys()].sort()){const b=d.get(_);let k=1/0,E=1/0,C=-1/0,T=-1/0;for(const q of b){const V=c(q.id),{w:X,h:j}=u(q.id);k=Math.min(k,V.x),E=Math.min(E,V.y),C=Math.max(C,V.x+X),T=Math.max(T,V.y+j)}const A=C-k,L=T-E,P=[...new Set(g.map(q=>Math.round(q.x)))].sort((q,V)=>q-V),U=P.length?P:[k],O=[0,...g.map(q=>q.y+q.h+y)].sort((q,V)=>q-V);let M=null;e:for(const q of U)for(const V of O){if(V>=E)break;if(!w(q,V,A,L)){M={x:q,y:V};break e}}if(M){const q=M.x-k,V=M.y-E;for(const X of b){const j=c(X.id);t.set(X.id,{x:j.x+q,y:j.y+V})}S.push(_)}for(const q of b){const V=c(q.id),{w:X,h:j}=u(q.id);g.push({x:V.x,y:V.y,w:X,h:j})}}return S}function Qz(e,t,r,s,o,a=!1,u){const p=mo+Lc+1,d=8,g=1.75,y=200,w=.7,S=.01,_=M=>Ya(M,s,u),b=M=>r.get(M)??t.get(M),k=new Map;for(const M of e){if(!b(M.id))continue;const q=Ga(M),V=k.get(q);V?V.push(M):k.set(q,[M])}const E=[],C=new Set,T=new Set,A=o.size===0;for(const M of[...k.keys()].sort()){const q=k.get(M);let V=1/0,X=1/0,j=-1/0,G=-1/0,B=!1;for(const H of q){const I=b(H.id),{w:Y,h:ce}=_(H.id);V=Math.min(V,I.x),X=Math.min(X,I.y),j=Math.max(j,I.x+Y),G=Math.max(G,I.y+ce),r.has(H.id)&&(B=!0)}const te=j-V,Z=G-X;T.add(M);const $=o.get(M);$&&(te>$.w+d||Z>$.h+d)&&C.add(M),o.set(M,{w:te,h:Z}),E.push({sid:M,members:q.map(H=>H.id),x:V,y:X,w:te,h:Z,anchored:B,mass:1})}for(const M of[...o.keys()])T.has(M)||o.delete(M);if(a||A)return[];let L=!1;for(let M=0;M<E.length&&!L;M++)for(let q=M+1;q<E.length;q++){const V=E[M],X=E[q];if(!(V.anchored&&X.anchored)&&Math.abs(V.x+V.w/2-(X.x+X.w/2))<(V.w+X.w)/2+61&&Math.abs(V.y+V.h/2-(X.y+X.h/2))<(V.h+X.h)/2+p){L=!0;break}}if(C.size===0&&!L)return[];if(C.size>0)for(const M of E)C.has(M.sid)&&(M.mass=8);else for(const M of E)M.mass=Math.max(1,M.w*M.h/(bo*ac));const P=new Map(E.map(M=>[M.sid,M.x])),U=new Map(E.map(M=>[M.sid,M.y]));for(let M=0;M<y;M++){const q=new Map,V=new Map;let X=0;for(let j=0;j<E.length;j++)for(let G=j+1;G<E.length;G++){const B=E[j],te=E[G];if(B.anchored&&te.anchored)continue;const Z=B.x+B.w/2,$=B.y+B.h/2,H=te.x+te.w/2,I=te.y+te.h/2,Y=(B.w+te.w)/2+61-Math.abs(Z-H),ce=(B.h+te.h)/2+p-Math.abs($-I);if(Y<=0||ce<=0)continue;const z=(Be,et)=>!Be.anchored&&!(et<0&&Be.x<=0),Q=(Be,et)=>!Be.anchored&&!(et<0&&Be.y<=0),ne=(Be,et,Xe)=>{const wt=Be===et,ee=wt?B.sid<te.sid?-1:1:Math.sign(Be-et);return Xe(B,ee)||Xe(te,-ee)?ee:wt&&(Xe(B,-ee)||Xe(te,ee))?-ee:0},oe=ne(Z,H,z),fe=ne($,I,Q),pe=oe!==0,ye=fe!==0;if(!pe&&!ye)continue;const Me=pe&&(!ye||Y*g<ce),[Ue,ze,Ie,ke]=Me?[oe,Y,q,z]:[fe,ce,V,Q],le=ke(B,Ue),we=ke(te,-Ue),xe=B.mass,Ye=te.mass,gt=le?we?Ye/(xe+Ye):1:0,ft=we?le?xe/(xe+Ye):1:0,ot=ze*w;Ie.set(B.sid,(Ie.get(B.sid)??0)+Ue*ot*gt),Ie.set(te.sid,(Ie.get(te.sid)??0)-Ue*ot*ft),X+=ot}for(const j of E)j.anchored||(j.x=Math.max(0,j.x+(q.get(j.sid)??0)),j.y=Math.max(0,j.y+(V.get(j.sid)??0)));if(X<S)break}const O=[];for(const M of E){const q=M.x-P.get(M.sid),V=M.y-U.get(M.sid);if(!(Math.abs(q)<1&&Math.abs(V)<1)){for(const X of M.members){if(r.has(X))continue;const j=t.get(X);j&&t.set(X,{x:j.x+q,y:j.y+V})}O.push(M.sid)}}return O}const Zz=600;function Ty(e,t){return!(e.exitAt!=null&&t-e.exitAt>Zz||e.kind==="root"&&e.state==="done"&&e.tools.length===0&&e.endedAt!=null&&e.endedAt-e.startedAt<3e3)}function Jz(e,t){const r=new Set;for(const s of e.agents.values())Ty(s,t)&&r.add(s.id);return r}function e6(e,t,r=0){return e.right+r>t.left&&e.left-r<t.right&&e.bottom+r>t.top&&e.top-r<t.bottom}function t6(e,t,r=0){if(!e)return!1;for(const s of t)if(e6(e,s,r))return!0;return!1}const hR="sessionGroup";function n6(e,t){var s;if(e.type===hR)return"transparent";const r=(s=e.data)==null?void 0:s.state;return t(r==="err"?"--err":r==="active"?"--inflight":"--ok")}const pR=["--err","--inflight","--ok","--grid-line","--minimap-mask","--panel","--line"];function VN(e){const t={};for(const r of pR)t[r]=e(r);return t}function r6(e){return t=>e[t]??""}function s6(e,t){return pR.every(r=>e[r]===t[r])}function i6(e){const t=new Set(e.pins),r=new Map,s=new Map;for(const[o,a]of e.positions)r.set(o,a),t.has(o)&&s.set(o,a);return{positions:r,pinned:s}}const o6=1200,a6=1e3;function GN(e){return e.lastDeckFitAt>0&&e.at-e.lastDeckFitAt<o6?!1:e.hasSourceEvent?!0:e.lastCanvasInputAt>0&&e.at-e.lastCanvasInputAt<a6}function Qv({durationMs:e,documentHidden:t}){return t?!1:Number.isFinite(e)&&e>0}function l6(e,t,r){const s=e.x*t.zoom+t.x,o=e.y*t.zoom+t.y,a=(e.x+e.width)*t.zoom+t.x,u=(e.y+e.height)*t.zoom+t.y;return a>0&&s<r.width&&u>0&&o<r.height}function u6({pane:e,viewport:t,boxes:r}){if(!e||!(e.width>0)||!(e.height>0)||!Number.isFinite(t.zoom)||t.zoom<=0||!Number.isFinite(t.x)||!Number.isFinite(t.y))return!1;let s=!1;for(const o of r)if(s=!0,l6(o,t,e))return!1;return s}const c6="Update checks are off (AGENTS_DECK_NO_UPDATE_CHECK=1)",Zv="click for what's new";function d6(e){if(e.checkDisabled)return`${c6} · ${Zv}`;if(e.checking)return`Asking npm for the newest release… · ${Zv}`;const t=e.latest?`npm has v${e.latest}`:e.latestPending?`npm's latest tag names v${e.latestPending}, which it cannot serve yet`:"npm not reached yet",r=e.checkedAgo?` · checked ${e.checkedAgo}`:"";return`${t}${r} · re-checked periodically · ${Zv}, and to check npm now`}function f6(e){const t=`Version v${e.running}, show what's new`;return e.checkDisabled?`${t} — update checks are off`:e.checking?`${t} — checking npm for a newer release`:`${t} and check npm for a newer release`}function h6(e){const t=e.kind==="restart"?`v${e.to} is installed and waiting for a restart`:`v${e.to} is available on npm`,r=e.open?"show what's new":"show what's new and the notice";return`Version v${e.from}, ${t} — ${r}`}function p6(e){if(e==null)return{kind:"unknown",lead:"No data yet. Start a Claude Code or Codex session — it appears here as soon as the deck sees its first event.",workspace:null,tail:""};const t=e.trim();return t===""?{kind:"machine",lead:"No data yet. Start a Claude Code or Codex session anywhere on this machine — this deck is unscoped and captures every workspace.",workspace:null,tail:""}:{kind:"scoped",lead:"No data yet. This deck only captures sessions running under",workspace:t,tail:" — start one there, or restart it without --workspace/--scope to watch the whole machine."}}const Ry={kind:"assumed",claude:!0,codex:!0};function m6(e){if(!e||typeof e!="object")return Ry;const t=e.providers;if(!t||typeof t!="object")return Ry;const r=t;return{kind:"reported",claude:r.claude!==!1,codex:r.codex!==!1}}function lc(e){const t=Math.max(0,Math.floor(e));return`${t} event${t===1?"":"s"}`}const YN=99;function g6(e){const t=Math.max(0,Math.floor(e));return t>YN?`${YN}+`:String(t)}const v6="Pause the canvas";function y6(e){if(!e.paused)return"Pause live updates — events keep arriving and are applied when you resume (Space)";const t=Math.max(0,Math.floor(e.dropped??0));return t>0?`The pause is full — ${lc(e.held)} held and ${t} older ${t===1?"one":"ones"} already dropped. Resume to follow the canvas again (Space)`:e.held<=0?"Nothing has arrived since you paused. Resume to follow the canvas again (Space)":`${lc(e.held)} arrived while paused and will be applied in order when you resume (Space)`}function w6(e){return e.connected||!e.paused?null:"The canvas is paused as well — Space resumes it, but nothing new arrives until the stream is back."}const mR="paused · full",x6=(e,t)=>t>0?mR:e>0?`paused · ${g6(e)}`:"paused";function _6(e){const t=Math.max(0,Math.floor(e.dropped??0));return e.connected?e.paused?{tone:"paused",label:x6(e.held,t),widest:mR,title:t>0?`Connected — the pause is full at ${lc(e.held)}; the oldest are being dropped as new ones arrive. Resume to catch up (Space)`:e.held>0?`Connected — ${lc(e.held)} held until you resume (Space)`:"Connected — updates held until you resume (Space)"}:{tone:"live",label:"live",widest:"live",title:"Receiving events"}:{tone:"dead",label:"offline",widest:"offline",title:e.paused?"SSE disconnected — and the canvas is paused, so resuming will not bring events back until it reconnects":"SSE disconnected"}}function KN(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}const b6={agent:C$,sessionGroup:U$},gR="react-flow__node";function XN(e){var t,r;return!!e&&((r=(t=e.classList)==null?void 0:t.contains)==null?void 0:r.call(t,gR))===!0}function k6(e){try{const t=document.querySelector(`.${gR}[data-id="${CSS.escape(e)}"]`);t==null||t.focus({preventScroll:!0})}catch{}}const S6=["a[href]","button:not(:disabled)","input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)","summary","[tabindex]"].join(","),E6=420,Fu=18,N6=200,C6=5*6e4,j6=6,T6=2*6e4,QN=400,T0="agent-dag.layout",R0="agent-dag.viewport",vR="agent-dag.summariesDismissed",yR="agent-dag.sessionListOpen",wR="agent-dag.detailOpen",xR="agent-dag.usagePanelOpen",ZN="agent-dag.accountsPanelOpen",Jv="agent-dag.versionNoticeDismissed",JN="agent-dag.oldNameNoticeDismissed",R6=15*6e4,ey={git_checkout:"this deck runs from a git checkout — pull instead:",npx:"npx runs from a cache that cannot be upgraded in place — run:",not_writable:"the install directory is not writable by this user — run:",opted_out:"installs are off (AGENTS_DECK_NO_INSTALL=1) — run:"},eC="agent-dag.autoRestart",tC="agent-dag.bundleReloadedFor";function A6(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(yR)==="1"}catch{return!1}}function I6(e){if(!(typeof window>"u"))try{window.localStorage.setItem(yR,e?"1":"0")}catch{}}function M6(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(wR)==="1"}catch{return!1}}function O6(e){if(!(typeof window>"u"))try{window.localStorage.setItem(wR,e?"1":"0")}catch{}}function P6(){const e=yc(xR);return e===null?!0:e==="1"}function L6(e){if(!(typeof window>"u"))try{window.localStorage.setItem(xR,e?"1":"0")}catch{}}function $6(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(vR);if(!e)return new Set;const t=JSON.parse(e);return new Set(Array.isArray(t)?t.filter(r=>typeof r=="string"):[])}catch{return new Set}}function nC(e){if(!(typeof window>"u"))try{const t=Array.from(e),r=t.length>200?t.slice(-200):t;window.localStorage.setItem(vR,JSON.stringify(r))}catch{}}function q6(){const e={positions:[],pins:[]};if(typeof window>"u")return e;try{const t=window.localStorage.getItem(T0);if(!t)return e;const r=JSON.parse(t);if(!("v"in r)){const o=Object.entries(r).filter(([,a])=>a&&typeof a.x=="number"&&typeof a.y=="number");return{positions:o,pins:o.map(([a])=>a)}}return{positions:Object.entries(r.positions??{}).filter(([,o])=>o&&typeof o.x=="number"&&typeof o.y=="number"),pins:Array.isArray(r.pins)?r.pins:[]}}catch{return e}}function ty(e,t){if(!(typeof window>"u"))try{const r={};for(const[s,o]of e)r[s]=o;for(const[s,o]of t)r[s]=o;window.localStorage.setItem(T0,JSON.stringify({v:2,positions:r,pins:Array.from(t.keys())}))}catch{}}function D6(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(R0);if(!e)return null;const t=JSON.parse(e);return typeof(t==null?void 0:t.x)!="number"||typeof(t==null?void 0:t.y)!="number"||typeof(t==null?void 0:t.zoom)!="number"?null:t}catch{return null}}function F6(e){if(!(typeof window>"u"))try{window.localStorage.setItem(R0,JSON.stringify(e))}catch{}}function rC(){if(!(typeof window>"u")){try{window.localStorage.removeItem(T0)}catch{}try{window.localStorage.removeItem(R0)}catch{}}}function z6(e,t){const r=e.agents.get(t);if(!r)return;const s=[];for(const d of e.agents.values())d.sessionId===t&&s.push(d);const o={schemaVersion:1,exportedAt:new Date().toISOString(),sessionId:t,label:r.label,cwd:r.cwd,startedAt:r.startedAt,endedAt:r.endedAt,model:r.model,agents:s.map(d=>({id:d.id,kind:d.kind,label:d.label,parentId:d.parentId,state:d.state,startedAt:d.startedAt,endedAt:d.endedAt,model:d.model,cwd:d.cwd,usage:d.usage,prompts:d.prompts,tools:d.tools.map(g=>({id:g.id,name:g.name,inputPreview:g.inputPreview,startedAt:g.startedAt,endedAt:g.endedAt,ok:g.ok,errorPreview:g.errorPreview,usage:g.usage}))}))},a=JSON.stringify(o,null,2),u=new Blob([a],{type:"application/json"}),c=URL.createObjectURL(u),f=document.createElement("a"),p=(r.label||"session").replace(/[^a-z0-9._-]/gi,"_");f.href=c,f.download=`${Yt}-${p}-${t.slice(0,8)}.json`,document.body.appendChild(f),f.click(),document.body.removeChild(f),setTimeout(()=>URL.revokeObjectURL(c),1e3)}const Ay={file:"📁",shell:"⚡",web:"🌐",agent:"🤖",task:"📋",plan:"🧭",mcp:"🔌",other:"✨"},Iy={file:"file",shell:"shell",web:"web",agent:"agent",task:"task",plan:"plan",mcp:"mcp",other:"other"},_R=Uj;function B6(e,t,r,s,o,a,u,c,f,p,d,g,y,w,S,_,b,k){const E=[],C=[];for(const M of e.agents.values()){if(!b.has(M.id))continue;const q=M.exitAt!=null,V=_!=null&&!_.has(M.id),X=[q?"rf-exiting":"",V?"rf-spotlit-out":""].filter(Boolean).join(" ")||void 0,j=a.get(M.id);if(E.push({id:M.id,type:"agent",position:{x:0,y:0},data:{...M,now:t,onOpenContext:k},className:X,...j?{width:j.width,height:j.height}:null}),M.parentId&&b.has(M.parentId)){const G=Zy(M.sessionId),B=q,te=S.size>0&&(S.has(M.id)||S.has(M.parentId)),Z=_!=null&&!_.has(M.id)&&!_.has(M.parentId),$=M.state==="active"?2:1.5,H=te?$+1.5:$,I=B?.2:Z?.12:1,Y=["sess-edge",M.state==="active"?"sess-live":"sess-idle",B?"rf-edge-exiting":"",te?"rf-edge-selected":""].filter(Boolean).join(" ");C.push({id:`e:${M.parentId}->${M.id}`,source:M.parentId,target:M.id,animated:(M.state==="active"||te)&&!B,type:"smoothstep",style:{"--session-hue":G,strokeWidth:H,opacity:I,transition:"var(--edge-transition)"},className:Y})}}const T=new Map;for(const M of e.agents.values())M.tools.length>0&&T.set(M.id,Math.min(4,M.tools.length));const A=`${y}#lanes:${Vz(T)}`,L=E.filter(M=>Z4(M.id,o,d,g));if(L.length>0||A!==w.current){if(L.length>0){const M=Yz(E,C,{direction:"LR",pinned:o,measured:a,availableWidth:r,availableHeight:s,lanes:T});for(const q of M)cT(q.id,d,g)&&eD(q.id,q.position,d,g);Xz(E,d,o,a,new Set(L.map(q=>q.id)),T)}Kz(E,d,o,a,T),w.current=A}const P=Qz(E,d,o,a,u,!f||p,T);P.length>0&&c(P),Lu(d,e.agents),Lu(g,e.agents),Lu(o,e.agents),Lu(a,K4(e.agents.values()));const U=[];let O=!1;for(const M of E){let q=o.get(M.id)??d.get(M.id);q||(q=J4(M.id,d,g),O=!0),U.push({...M,position:q})}return O&&(w.current=""),{nodes:U,edges:C}}function U6(){return m.jsx(Xy,{children:m.jsx(H6,{})})}function H6(){var Ko,Xo,Or,Cl;const e=Ja(),t=Nt(),r=N.useState(yy)[0],s=N.useRef(r),[,o]=N.useState(0),a=N.useCallback(()=>o(F=>F+1),[]),[u,c]=N.useState(()=>new Set),[f,p]=N.useState(null),[d,g]=N.useState(null),y=N.useCallback((F,W)=>{c(ae=>{if(!W)return new Set([F]);const de=new Set(ae);return de.has(F)?de.delete(F):de.add(F),de}),p(ae=>W&&ae===F?ae:F)},[]),w=N.useCallback(()=>{c(new Set),p(null)},[]),[S,_]=N.useState(null),[b,k]=N.useState(null),E=N.useCallback(F=>k(F),[]),[C,T]=N.useState(!1),[A,L]=N.useState(!1),P=N.useState($6)[0],[U,O]=N.useState(A6);N.useEffect(()=>{I6(U)},[U]);const[M,q]=N.useState(M6);N.useEffect(()=>{O6(M)},[M]);const[V,X]=N.useState(P6);N.useEffect(()=>{L6(V)},[V]);const[j,G]=N.useState(()=>{try{const F=window.localStorage.getItem(ZN);return F===null?!0:F==="1"}catch{return!0}});N.useEffect(()=>{try{window.localStorage.setItem(ZN,j?"1":"0")}catch{}},[j]);const[B,te]=N.useState(null);N.useEffect(()=>{let F=null;try{F=localStorage.getItem("agent-dag.sound")}catch{}te(F===null?!0:F==="on")},[]);const Z=N.useCallback(()=>{te(F=>{var ae;const W=F!==!0;try{localStorage.setItem("agent-dag.sound",W?"on":"off")}catch{}return W&&((ae=Me.current)==null||ae.unlock()),W})},[]),$=N.useCallback(F=>{Z()},[Z]),H=N.useRef($);H.current=$;const I=N.useRef(B);I.current=B;const[Y,ce]=N.useState(()=>S4(yc)),z=N.useRef(Y);z.current=Y;const Q=N.useRef(null),ne=N.useCallback((F,W=!1)=>{var ae,de;if((ae=Me.current)==null||ae.unlock(),Q.current!==null&&clearTimeout(Q.current),Q.current=null,!W){(de=Me.current)==null||de.play(F,!0);return}Q.current=setTimeout(()=>{var _e;Q.current=null,(_e=Me.current)==null||_e.play(F,!0)},w4)},[]),oe=N.useCallback((F,W)=>{ce(ae=>{const de={level:Ha(W.level??ae[F].level),figure:sT(F,W.figure??ae[F].figure)};try{localStorage.setItem(oT[F],String(de.level)),localStorage.setItem(aT[F],de.figure)}catch{}return{...ae,[F]:de}}),ne(F,!0)},[ne]);N.useEffect(()=>()=>{Q.current!==null&&clearTimeout(Q.current)},[]);const[fe,pe]=N.useState(!1),ye=N.useRef(null),Me=N.useRef(null),[Ue,ze]=N.useState("locked");N.useEffect(()=>{const F=C4({enabled:()=>I.current===!0,prefs:()=>z.current,onState:ze});Me.current=F,ze(F.state());const W=()=>F.unlock();return window.addEventListener("pointerdown",W,{once:!0,capture:!0}),window.addEventListener("keydown",W,{once:!0,capture:!0}),()=>{window.removeEventListener("pointerdown",W,{capture:!0}),window.removeEventListener("keydown",W,{capture:!0})}},[]);const[Ie,ke]=N.useState(!1),[le,we]=N.useState(null),[xe,Ye]=N.useState(()=>{if(typeof window>"u")return"";try{return window.localStorage.getItem(Jv)??""}catch{return""}}),[gt,ft]=N.useState(!1),ot=N.useRef(0),[Be,et]=N.useState(!1),Xe=N.useCallback((F=!1)=>(F&&(ot.current=Date.now(),et(!0)),fetch(F?"/api/version?refresh=1":"/api/version").then(W=>W.ok?W.json():null).then(W=>{W&&we(W)}).catch(()=>{}).finally(()=>{F&&et(!1)})),[]),wt=N.useCallback(()=>{Xe(Date.now()-ot.current>=R6)},[Xe]);N.useEffect(()=>{Xe();const F=window.setInterval(wt,5*6e4),W=()=>{document.visibilityState==="visible"&&wt()};return document.addEventListener("visibilitychange",W),()=>{window.clearInterval(F),document.removeEventListener("visibilitychange",W)}},[Xe,wt]),N.useEffect(()=>{Ie&&Xe()},[Ie,Xe]);const ee=(le==null?void 0:le.notice)??null,[Le,De]=N.useState(null),Re=N.useRef(!1);N.useEffect(()=>{if(Re.current)return;const F=$4(),W=q4(F),ae=F4({stored:W,running:(le==null?void 0:le.running)??null,notes:_1});ae.reason!=="no-version"&&(Re.current=!0,ae.record&&D4(F,ae.record),ae.show.length&&De({entries:ae.show,since:W}))},[le==null?void 0:le.running]);const $e=(le==null?void 0:le.running)??"1.46.1",rt=N.useMemo(()=>uT(_1,null,$e),[$e]),tt=N.useCallback(()=>{De({entries:rt,since:null})},[rt]),[Ce,kt]=N.useState(null),[Ve,lt]=N.useState(Ry);N.useEffect(()=>{let F=!1;return fetch("/api/health").then(W=>W.ok?W.json():null).then(W=>{F||(lt(m6(W)),!(!W||typeof W.workspace!="string")&&kt(W.workspace))}).catch(()=>{}),()=>{F=!0}},[Ie]);const dn=N.useRef(Ve);dn.current=Ve;const wn=ee?`${ee.kind}:${ee.to}`:"",xn=ee!=null&&xe!==wn,_n=N.useCallback(()=>{Ye("");try{window.localStorage.setItem(Jv,"")}catch{}},[]),zn=N.useCallback(()=>{if(ee){Ye(wn);try{window.localStorage.setItem(Jv,wn)}catch{}}},[ee,wn]),[bn,hi]=N.useState(()=>{if(typeof window>"u")return"";try{return window.localStorage.getItem(JN)??""}catch{return""}}),fn=le!=null&&le.invokedAs&&le.invokedAs!==Yt?le.invokedAs:null,pi=fn!=null&&bn!==fn,mi=N.useCallback(()=>{if(fn){hi(fn);try{window.localStorage.setItem(JN,fn)}catch{}}},[fn]),qt=((Ko=le==null?void 0:le.upgrade)==null?void 0:Ko.state)??"idle",Sr=t4(le==null?void 0:le.upgrade),Bn=N.useRef(!1),Rs=N.useCallback(async()=>{if(js(Bn.current||qt==="running")){Bn.current=!0;try{await fetch("/api/upgrade",{method:"POST"})}catch{}await Xe(),Bn.current=!1}},[qt,Xe]);N.useEffect(()=>{if(qt!=="running")return;const F=window.setInterval(Xe,3e3);return()=>window.clearInterval(F)},[qt,Xe]);const Er=N.useCallback(async()=>{var ae;const F=le==null?void 0:le.command;if(!F)return;let W=!1;try{W=await Promise.race([((ae=navigator.clipboard)==null?void 0:ae.writeText(F).then(()=>!0))??Promise.resolve(!1),new Promise(de=>window.setTimeout(()=>de(!1),500))])}catch{W=!1}if(!W)try{const de=document.createElement("textarea");de.value=F,de.setAttribute("readonly",""),de.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(de),de.select(),W=document.execCommand("copy"),de.remove()}catch{W=!1}W&&(ft(!0),window.setTimeout(()=>ft(!1),1600))},[le==null?void 0:le.command]),To=N.useCallback(()=>{O(F=>(F||G(!1),!F))},[]),lr=N.useCallback(()=>{G(F=>(F||O(!1),!F))},[]),[Nr,ur]=N.useState(!1),[As,gi]=N.useState(0),vi=N.useRef(null),[yi,kn]=N.useState(!1),cr=N.useRef(null),[wi,xi]=N.useState(0),Bt=N.useState(()=>iD({protect:F=>FL(s.current,F)}))[0],[Cr,_i]=N.useState(!1),Zr=N.useCallback(()=>{const F=Bt.paused&&Bt.dropped>0,W=Bt.setPaused(!Bt.paused);F&&zL(s.current);for(const ae of W)s.current=O_(s.current,ae);_i(Bt.paused)},[Bt]),[xt,Ro]=N.useState(Date.now()),[st,Ao]=N.useState(()=>{if(typeof window>"u")return!0;try{return window.localStorage.getItem(eC)!=="0"}catch{return!0}}),Is=N.useCallback(()=>{Ao(F=>{const W=!F;try{window.localStorage.setItem(eC,W?"1":"0")}catch{}return W})},[]),[Sn,Un]=N.useState(!1),[bi,ki]=N.useState("restart"),[jr,Kt]=N.useState(null),En=N.useRef(!1),tn=N.useRef(null),ul=N.useRef(0),Si=N.useCallback(async F=>{if(!js(En.current))return;const W=(F==null?void 0:F.upgrade)===!0;En.current=!0,tn.current=Sr;const ae=++ul.current;ki(W?"npx":"restart"),Un(!0);try{window.sessionStorage.setItem("agent-dag.restartPending",(ee==null?void 0:ee.to)??"")}catch{}try{await fetch("/api/restart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({upgrade:W})})}catch{}window.setTimeout(()=>{if(ul.current===ae&&En.current){En.current=!1,Un(!1);try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}}},W?18e4:3e4)},[ee==null?void 0:ee.to,Sr]),cl=N.useRef(null);N.useEffect(()=>{let F=!1;for(const ae of s.current.agents.values())if(ae.state==="active"){F=!0;break}const W=r4({enabled:st,kind:ee==null?void 0:ee.kind,canRestart:(le==null?void 0:le.canRestart)===!0,busy:F,idleSince:cl.current,now:xt});cl.current=W.idleSince,W.restart&&Si()},[st,ee==null?void 0:ee.kind,le==null?void 0:le.canRestart,xt,Si]),N.useEffect(()=>{const F=le==null?void 0:le.running;let W=null,ae=null;try{W=window.sessionStorage.getItem("agent-dag.restartPending"),ae=window.sessionStorage.getItem(tC)}catch{return}const de=e4({bundle:"1.46.1",running:F,pending:W,lastTried:ae});if(de==="reload"){try{window.sessionStorage.setItem(tC,F??"")}catch{return}window.location.reload();return}if(de!=="confirm")return;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}En.current=!1,Un(!1),Kt(F??null);const _e=window.setTimeout(()=>Kt(null),6e3);return()=>window.clearTimeout(_e)},[le==null?void 0:le.running]),N.useEffect(()=>{if(Sn&&n4({asked:tn.current,reported:Sr})){try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}En.current=!1,Un(!1)}},[Sn,Sr]);const Ms=N.useState(()=>i6(q6()))[0],Mt=N.useRef(Ms.pinned),dr=N.useRef(null),Tr=N.useState(()=>D6())[0],[dl,$c]=N.useState(()=>new Set),[Rr,Io]=N.useState(aD),[Hn,Os]=N.useState(()=>VN(KN)),fl=N.useMemo(()=>r6(Hn),[Hn]),Mo=N.useCallback(F=>n6(F,fl),[fl]),Je=N.useMemo(()=>({background:Hn["--panel"],border:`1px solid ${Hn["--line"]}`,borderRadius:8}),[Hn]),[Oo,hl]=N.useState(!1);N.useEffect(()=>{document.documentElement.dataset.theme=Rr;try{window.localStorage.setItem(dT,Rr)}catch{}Os(F=>{const W=VN(KN);return s6(F,W)?F:W})},[Rr]);const Wn=N.useCallback((F,W)=>{if(Qv({durationMs:W,documentHidden:document.hidden})){e.setViewport(F,{duration:W});return}const{d3Zoom:ae,d3Selection:de}=t.getState(),_e=de==null?void 0:de.property("__zoom");if(ae&&de&&_e&&_e.k>0&&F.zoom>0){ae.transform(de,_e.scale(F.zoom/_e.k).translate((F.x-_e.x)/F.zoom,(F.y-_e.y)/F.zoom));return}e.setViewport(F,{duration:0})},[e,t]),Jr=N.useRef(null);N.useEffect(()=>{if(!Tr)return;const F=window.setTimeout(()=>{try{Wn(Tr,0)}catch{}Nn.current=Date.now()},60);return()=>window.clearTimeout(F)},[Wn,Tr]);const Po=N.useRef(!0);N.useEffect(()=>{const F=new EventSource("/events"),W=rD(a,{now:()=>Date.now(),setTimeout:(ae,de)=>window.setTimeout(ae,de),clearTimeout:ae=>window.clearTimeout(ae)});return F.addEventListener("open",()=>{ke(!0),hl(!0)}),F.addEventListener("error",()=>ke(!1)),F.addEventListener("replay-end",()=>{Po.current=!1,W.flush()}),F.addEventListener("hook",ae=>{var de;try{const _e=JSON.parse(ae.data);if(!Bt.accept(_e))return;s.current=O_(s.current,_e);const Se=_e.replay===!0||Po.current||Date.now()-_e.receivedAt>3e4;Se?W.replay():W.live();const Fe=N4(_e,Se);Fe&&((de=Me.current)==null||de.play(Fe))}catch{}}),()=>{F.close(),W.cancel()}},[a]),N.useEffect(()=>{const F=setInterval(()=>{const W=Date.now();Ro(W);let ae=BL(s.current,W,M_);UL(s.current,W,M_)&&(ae=!0),qL(s.current,W,N6,C6)&&(ae=!0),DL(s.current,W,j6,T6)&&(ae=!0),c(de=>Y4(de,s.current.agents)),p(de=>de!=null&&!s.current.agents.has(de)?null:de),ae&&a()},250);return()=>clearInterval(F)},[a]);const Ei=N.useRef(null),Nn=N.useRef(0),Ni=420,jt=N.useCallback((F=500)=>{try{const Se=document.querySelector(".canvas-wrap"),Fe=Array.from(document.querySelectorAll(".react-flow__node")).filter(nt=>nt.offsetWidth>0);if(!Se||Fe.length===0)return;const Ke=Se.getBoundingClientRect(),ht=e.getViewport();if(!Number.isFinite(ht.zoom)||ht.zoom<=0)return;const at=nt=>(nt-Ke.left-ht.x)/ht.zoom,Ut=nt=>(nt-Ke.top-ht.y)/ht.zoom,os=Fe.map(nt=>nt.getBoundingClientRect()),Qo=Math.min(...os.map(nt=>at(nt.left))),jl=Math.max(...os.map(nt=>at(nt.right))),Zo=Math.min(...os.map(nt=>Ut(nt.top))),Wc=Math.max(...os.map(nt=>Ut(nt.bottom))),Tl=jl-Qo,Jo=Wc-Zo;if(!(Tl>0&&Jo>0))return;const Fs=Math.max(.2,Math.min(1,(Ke.width-160)/(Tl+Ni)*.86,(Ke.height-160)/Jo*.86)),zs={x:80-Qo*Fs,y:Math.max(80,(Ke.height-Jo*Fs)/2)-Zo*Fs,zoom:Fs};Wn(zs,F),Nn.current=Date.now(),Jr.current=Qv({durationMs:F,documentHidden:document.hidden})?{target:zs,until:Date.now()+F+60}:null,window.setTimeout(()=>{var nt;try{((nt=Jr.current)==null?void 0:nt.target)===zs&&(Jr.current=null);const as=e.getViewport();(Math.abs(as.zoom-Fs)>.01||Math.abs(as.x-zs.x)>2)&&Wn(zs,0)}catch{}},F+60)}catch{}},[e,Wn]);N.useEffect(()=>{const F=()=>{if(!document.hidden)return;const W=Jr.current;if(Jr.current=null,!(!W||Date.now()>W.until)){try{Wn(W.target,0)}catch{}Nn.current=Date.now()}};return document.addEventListener("visibilitychange",F),()=>document.removeEventListener("visibilitychange",F)},[Wn]);const Cn=N.useRef(""),jn=N.useRef(null),es=N.useRef(0),fr=N.useCallback(()=>{es.current=Date.now()},[]),Tn=N.useRef(null),pl=N.useRef(0),Ci=N.useCallback(()=>{pl.current=Date.now()},[]),ts=N.useCallback(F=>({hasSourceEvent:!!F,at:Date.now(),lastDeckFitAt:Nn.current,lastCanvasInputAt:pl.current}),[]),Lo="agent-dag.autoFitDisabled",$o=N.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(Lo)==="1"}catch{return!1}})[0],Vn=N.useRef($o),[qo,ml]=N.useState($o),Ar=N.useCallback(()=>{if(!Vn.current){Vn.current=!0,ml(!0);try{window.localStorage.setItem(Lo,"1")}catch{}}},[]),Ps=N.useCallback(()=>{Vn.current=!1,ml(!1);try{window.localStorage.removeItem(Lo)}catch{}jt(400)},[e,jt]);N.useEffect(()=>{const F=setInterval(()=>{if(Vn.current||Date.now()-es.current<800)return;const W=s.current,ae=Date.now(),de=[];for(const Se of W.agents.values())Ty(Se,ae)&&de.push({id:Se.id});if(de.length===0)return;const _e=[];for(const{id:Se}of de){const Fe=Gn.current.get(Se),Ke=Mt.current.get(Se)??Xt.current.get(Se);!Fe||!Ke||_e.push({x:Ke.x,y:Ke.y,width:Fe.width,height:Fe.height})}u6({pane:Tn.current,viewport:e.getViewport(),boxes:_e})&&jt(600)},1500);return()=>clearInterval(F)},[e]);const hr=N.useRef(!1),Gn=N.useRef(new Map),gl=N.useRef(0),qc=N.useCallback(F=>{const W=Gn.current;let ae=!1;for(const de of F.nodeInternals.values()){const _e=de.width,Se=de.height;if(_e==null||Se==null)continue;const Fe=W.get(de.id);Fe?(Math.abs(Fe.height-Se)>4||Math.abs(Fe.width-_e)>4)&&(W.set(de.id,{width:_e,height:Se}),ae=!0):(W.set(de.id,{width:_e,height:Se}),ae=!0)}return ae&&(gl.current+=1),gl.current},[]),ji=it(qc),[Ls,Do]=N.useState(0);N.useEffect(()=>{let F=0;const W=()=>{const de=Gn.current;let _e=!1;for(const Se of document.querySelectorAll(".react-flow__node[data-id]")){const Fe=Se.getAttribute("data-id");if(!Fe)continue;const Ke=Se.offsetWidth,ht=Se.offsetHeight;if(!Ke||!ht)continue;const at=de.get(Fe);(!at||Math.abs(at.width-Ke)>4||Math.abs(at.height-ht)>4)&&(de.set(Fe,{width:Ke,height:ht}),_e=!0)}_e&&Do(Se=>Se+1)};if(hr.current)return;let ae=0;return document.visibilityState==="hidden"?ae=window.setTimeout(W,32):F=requestAnimationFrame(W),()=>{cancelAnimationFrame(F),window.clearTimeout(ae)}});const Xt=N.useRef(Ms.positions),pr=N.useRef(new Set),$s=N.useRef(""),Yn=N.useMemo(()=>{const F=[];for(const W of s.current.agents.values())Ty(W,xt)&&F.push(W.id+(W.parentId?`>${W.parentId}`:""));return F.sort(),`${F.join("|")}#sv${ji}.${Ls}`},[s.current,s.current.revision,xt,ji,Ls]),ns=N.useRef(null);N.useEffect(()=>(ns.current!=null&&window.clearTimeout(ns.current),ns.current=window.setTimeout(()=>{ty(Xt.current,Mt.current)},1500),()=>{ns.current!=null&&window.clearTimeout(ns.current)}),[Yn]),N.useEffect(()=>{if(Cn.current===Yn)return;const F=Cn.current;if(Cn.current=Yn,!F||Vn.current)return;Date.now()-Nn.current>1200&&jt(400),Ei.current&&window.clearTimeout(Ei.current),Ei.current=window.setTimeout(()=>{Vn.current||jt(500)},280)},[Yn,e,jt]);const rs=N.useMemo(()=>Q4(s.current,u),[s.current,s.current.revision,u]),ss=N.useMemo(()=>Jz(s.current,xt),[s.current,s.current.revision,xt]),Fo=N.useRef(null),[Ot,Ir]=N.useState({w:0,h:0});N.useEffect(()=>{const F=Fo.current;if(!F||typeof ResizeObserver>"u")return;const W=new ResizeObserver(ae=>{var _e;const de=(_e=ae[0])==null?void 0:_e.contentRect;de&&(Tn.current={width:de.width,height:de.height},Ir(Se=>Math.abs(Se.w-de.width)>40||Math.abs(Se.h-de.height)>40?{w:de.width,h:de.height}:Se))});return W.observe(F),Tn.current={width:F.clientWidth,height:F.clientHeight},Ir({w:F.clientWidth,h:F.clientHeight}),()=>W.disconnect()},[]);const zo=N.useCallback(F=>{var ae,de;const W=F.target;!(W!=null&&W.closest)||W.closest(S6)!==F.currentTarget||(F.preventDefault(),(de=(ae=document.activeElement)==null?void 0:ae.blur)==null||de.call(ae))},[]),qs=N.useRef(new Map),[vl,Bo]=N.useState(!1);N.useEffect(()=>{const F=window.setTimeout(()=>Bo(!0),2500);return()=>window.clearTimeout(F)},[]);const[Uo,Mr]=N.useState(!1),hn=N.useRef(null),[Ti,yl]=N.useState(!1),Dc=N.useCallback(()=>{hn.current&&(window.clearTimeout(hn.current),hn.current=null),Mr(!1)},[]),Fc=N.useCallback(F=>{F.length!==0&&queueMicrotask(()=>{Mr(!0),hn.current&&window.clearTimeout(hn.current),hn.current=window.setTimeout(()=>Mr(!1),E6+80)})},[]);N.useEffect(()=>()=>{hn.current&&window.clearTimeout(hn.current)},[]);const Ri=Ot.w>0?Ot.w*.92:0,wl=Ot.h>0?Ot.h:0,{nodes:mr,edges:zc}=N.useMemo(()=>B6(s.current,xt,Ri,wl,Mt.current,Gn.current,qs.current,Fc,vl,Ti,Xt.current,pr.current,Yn,$s,u,rs,ss,E),[s.current,s.current.revision,xt,Ri,wl,vl,Ti,Yn,u,rs,ss,E,As]),xl=N.useMemo(()=>{const F=new Map;for(const ae of mr){const de=ae.data;if(!(de!=null&&de.sessionId)||de.exitAt!=null)continue;const _e=ae.width,Se=ae.height;if(_e==null||Se==null)continue;const Fe=ae.position.x,Ke=ae.position.y,ht=Fe+_e,at=Ke+Se,Ut=F.get(de.sessionId);Ut?(Ut.minX=Math.min(Ut.minX,Fe),Ut.minY=Math.min(Ut.minY,Ke),Ut.maxX=Math.max(Ut.maxX,ht),Ut.maxY=Math.max(Ut.maxY,at)):F.set(de.sessionId,{minX:Fe,minY:Ke,maxX:ht,maxY:at})}const W=[];for(const[ae,de]of F){const _e=de.maxX-de.minX+Fu*2,Se=de.maxY-de.minY+Fu*2;W.push({id:`group:${ae}`,type:hR,position:{x:de.minX-Fu,y:de.minY-Fu},data:{sessionId:ae,w:_e,h:Se},width:_e,height:Se,style:{width:_e,height:Se},zIndex:-1,draggable:!0,selectable:!1,focusable:!1,deletable:!1,connectable:!1})}return W},[mr,xt]),Bc=N.useMemo(()=>{const F=[...xl,...mr],W=cr.current;return!W||W.size===0?F:F.map(ae=>{const de=W.get(ae.id);return de?{...ae,position:de}:ae})},[xl,mr,wi]),Ds=N.useMemo(()=>{const F=new Set;for(const W of s.current.agents.values())for(const ae of W.tools)F.add(_R(ae.name));return Object.keys(Ay).filter(W=>F.has(W))},[s.current,s.current.revision]);N.useEffect(()=>{if(Ds.length<=1){kn(!1);return}let F=0;const W=()=>{const ae=vi.current;if(ae&&!document.hidden){const de=ae.getBoundingClientRect(),_e=Array.from(document.querySelectorAll(".react-flow__node, .tool-burst")).map(Fe=>Fe.getBoundingClientRect()),Se=t6(de,_e,8);kn(Fe=>Fe===Se?Fe:Se)}F=window.setTimeout(W,300)};return W(),()=>window.clearTimeout(F)},[Ds.length]);const Uc=N.useCallback(F=>{$c(W=>{const ae=new Set(W);return ae.has(F)?ae.delete(F):ae.add(F),ae})},[]),Qt=f?s.current.agents.get(f):null,Ho=d?Array.from(s.current.agents.values()).flatMap(F=>F.tools).find(F=>F.id===d)??null:null,_l=N.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}s.current=yy(),Mt.current.clear(),Gn.current.clear(),Xt.current.clear(),$s.current="",rC(),w(),a()},[a,w]),Ai=N.useRef(C);Ai.current=C;const bl=N.useRef(A);bl.current=A;const Wo=N.useRef(!1);Wo.current=Ho!=null||Nr||b!=null||S!=null||A||Le!=null;const Ii=N.useCallback(F=>{const W=s4(F,{confirmOpen:Ai.current,modalOpen:Wo.current});W==="confirm"?T(!0):W==="clear"&&(T(!1),_l())},[_l]),Mi=N.useCallback(()=>{Mt.current.clear(),Xt.current.clear(),$s.current="",rC(),a(),window.setTimeout(()=>jt(500),80)},[a,e,jt]),kl=N.useCallback(()=>jt(500),[jt]),Oi=N.useRef(mr);Oi.current=mr;const Sl=N.useRef(f);Sl.current=f;const Vo=N.useCallback(F=>{const W=Oi.current,ae=U4(W.map(Se=>({id:Se.id,x:Se.position.x,y:Se.position.y})),Sl.current,F),de=ae?W.find(Se=>Se.id===ae):void 0;if(!de)return;const _e=XN(document.activeElement);y(de.id,!1),window.setTimeout(()=>{try{e.fitView({padding:.35,duration:350,nodes:[de]})}catch{}Nn.current=Date.now(),_e&&k6(de.id)},30)},[y,e]),El=N.useCallback(F=>{y(F,!1),window.setTimeout(()=>{try{const W=Oi.current.find(ae=>ae.id===F);W&&e.fitView({padding:.3,duration:500,nodes:[W]}),Nn.current=Date.now()}catch{}},60)},[y,e]);N.useEffect(()=>{const F=W=>{var Ke,ht;const ae=W.target,de={tagName:ae==null?void 0:ae.tagName,isContentEditable:ae==null?void 0:ae.isContentEditable,role:(Ke=ae==null?void 0:ae.getAttribute)==null?void 0:Ke.call(ae,"role"),type:ae==null?void 0:ae.type};if(W.key==="Escape"){const at=c$({overlayOpen:po.depth()>0,panelOnTop:po.topIsPanel(),typing:t0(de)});at==="dismiss"?po.dismissTop():at==="blur"?ae==null||ae.blur():(G4(de)&&(ae==null||ae.blur()),w());return}if(e0(W))return;const _e=XN(ae)?(ht=ae==null?void 0:ae.getAttribute)==null?void 0:ht.call(ae,"data-id"):null,Se=_e&&Oi.current.some(at=>at.id===_e)?_e:null,Fe=W4(W,Se);if(Fe.kind==="activate"){W.preventDefault(),y(Fe.nodeId,Fe.additive);return}Fe.kind!=="node"&&(Fe.nodeId==null&&y$(de)||w$({key:W.key,modalOpen:Wo.current,sheetOpen:bl.current})||(W.key===" "&&(W.preventDefault(),Zr()),(W.key==="c"||W.key==="C")&&Ii("shortcut"),(W.key==="r"||W.key==="R")&&Mi(),(W.key==="f"||W.key==="F")&&kl(),(W.key==="l"||W.key==="L")&&To(),(W.key==="h"||W.key==="H")&&ur(at=>!at),(W.key==="u"||W.key==="U")&&X(at=>!at),(W.key==="a"||W.key==="A")&&dn.current.claude&&lr(),(W.key==="j"||W.key==="J")&&Vo(1),(W.key==="k"||W.key==="K")&&Vo(-1),(W.key==="t"||W.key==="T")&&Io(at=>at==="dark"?"light":"dark"),(W.key==="m"||W.key==="M")&&dn.current.claude&&I.current!==null&&H.current(W.shiftKey),W.key==="?"&&L(at=>!at)))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[Ii,Mi,kl,w,y,Vo,Zr]);const Go=s.current.agents.size,Kn=N.useMemo(()=>R3(s.current.agents.values()),[s.current,s.current.revision]),Pi=N.useMemo(()=>A3(s.current.agents.values()),[s.current,s.current.revision]),is=N.useRef(null);N.useEffect(()=>{const F=lD({waiting:Kn.length,running:Pi}),W=is.current;if(is.current=F,(W==null?void 0:W.title)!==F.title&&(document.title=F.title),(W==null?void 0:W.icon)!==F.icon){const ae=document.querySelector('link[rel="icon"]');ae&&(ae.href=uD[F.icon])}},[Kn.length,Pi]);const[Hc,Nl]=N.useState(""),Yo=dD(Kn);N.useEffect(()=>{Nl(F=>fD(F,Yo))},[Yo]);const Zt=N.useMemo(()=>Yj(s.current.agents.values()),[s.current,s.current.revision]);return m.jsxs("div",{className:"app",children:[m.jsx("a",{className:"skip-link",href:"#canvas",children:"Skip to the canvas"}),m.jsxs("header",{className:"topbar",children:[m.jsxs("div",{className:"readout",children:[m.jsxs("div",{className:"brand",children:[m.jsx("span",{className:"logo"}),m.jsx("h1",{children:Yt}),ee?m.jsxs("button",{type:"button",className:"v stale",onClick:()=>{tt(),_n()},"aria-haspopup":"dialog","aria-label":h6({...ee,open:xn}),title:ee.kind==="restart"?`Running v${ee.from}; v${ee.to} is installed on disk. Restart to pick it up · click for what's new`:`Running v${ee.from}; v${ee.to} is on npm · click for what's new`,children:["v",ee.from,m.jsx("span",{className:"v-dot","aria-hidden":!0})]}):(()=>{const F={running:$e,latest:le==null?void 0:le.latest,latestPending:le==null?void 0:le.latestPending,checkedAgo:le!=null&&le.checkedAt?by(xt-le.checkedAt):null,checkDisabled:le==null?void 0:le.checkDisabled,checking:Be};return m.jsxs("button",{type:"button",className:Be?"v checking":"v",onClick:()=>{tt(),Xe(!0)},"aria-busy":Be||void 0,"aria-haspopup":"dialog","aria-label":f6(F),title:d6(F),children:["v",F.running]})})()]}),m.jsxs("span",{className:"status",children:[(()=>{const F=_6({connected:Ie,paused:Cr,held:Bt.size,dropped:Bt.dropped});return m.jsx("span",{className:`pill ${F.tone}`,title:F.title,children:m.jsxs("span",{className:"pill-box",children:[m.jsx("span",{className:"pill-widest","aria-hidden":!0,children:F.widest}),m.jsx("span",{className:"pill-label",children:F.label})]})})})(),m.jsx(nq,{usageOpen:V}),Zt.sum>0&&m.jsxs("span",{className:"stat",title:`in:${Zt.inputTokens.toLocaleString()} out:${Zt.outputTokens.toLocaleString()} cache-r:${Zt.cacheReadTokens.toLocaleString()} cache-c:${Zt.cacheCreateTokens.toLocaleString()}
|
|
87
|
+
Click to set the volume and the sound of each tone, and to hear either one.`}function fT(e){const t=new Map;for(const r of e)for(const s of r.agents??[]){if(!s||typeof s.agent!="string"||s.agent==="")continue;const o=t.get(s.agent)??{id:s.agent,cost:0,tokens:0};o.cost+=Number.isFinite(s.totalCost)?s.totalCost:0,o.tokens+=Number.isFinite(s.totalTokens)?s.totalTokens:0,t.set(s.agent,o)}return[...t.values()].sort((r,s)=>s.cost-r.cost||r.id.localeCompare(s.id))}function kD(e){const t=fT([{agents:e}]);return t.length<2?null:t.map(r=>`${d0(r.id)} ${Ge(r.cost)}`).join(" · ")}function S1(e){switch(e.toLowerCase()){case"claude":return"var(--usage-purple)";case"codex":return"var(--usage-orange)";case"gemini":return"var(--usage-indigo)";case"copilot":return"var(--usage-green)";default:return"var(--usage-zinc)"}}function SD(e,t){if(!(t>0)||!(e>0))return"0%";const r=e/t*100;return r<.1?"<0.1%":`${r.toFixed(1)}%`}function $u(e){const t=e.toLowerCase();return t.includes("opus")?"var(--usage-purple)":t.includes("sonnet")?"var(--usage-blue)":t.includes("haiku")?"var(--usage-green)":t.includes("gpt-5")||t.includes("gpt5")?"var(--usage-amber)":t.includes("gpt")?"var(--usage-red)":t.includes("gemini")?"var(--usage-indigo)":t.includes("codex")?"var(--usage-orange)":"var(--usage-zinc)"}const ED=[7,14,30,90];function ND(e){const[t,r]=N.useState(null),[s,o]=N.useState(!1),a=N.useState(mD)[0],u=N.useRef(!1),c=(f=!1)=>{if(f&&!js(u.current))return;const p=a.begin();u.current=f;const d=e;o(!0);const y=`/api/ccusage?since=${gD(d)}${f?"&refresh=1":""}`;fetch(y).then(w=>w.json()).then(w=>{p()&&r({range:d,resp:w})}).catch(()=>{p()&&r({range:d,resp:{ok:!1,reason:"unreachable"}})}).finally(()=>{p()&&(u.current=!1,o(!1))})};return N.useEffect(()=>(c(!1),()=>a.cancel()),[e]),{landed:t,loading:s,reload:()=>c(!0)}}function CD({onClose:e,providers:t}){var U;const[r,s]=N.useState(30),[o,a]=N.useState(null),{landed:u,loading:c,reload:f}=ND(r),p=N.useRef(null),d=Kr(e,{focusRef:p}),g=vD({loading:c,want:r,answer:u&&{range:u.range,ok:u.resp.ok===!0,days:((U=u.resp.days)==null?void 0:U.length)??0}}),y=g.phase==="chart"?u.resp.days??[]:[],w=N.useMemo(()=>y.reduce((O,M)=>Math.max(O,M.totalCost),0),[y]),S=N.useRef(null);N.useLayoutEffect(()=>{const O=S.current;O&&(O.scrollLeft=O.scrollWidth)},[y]);const{totalCost:_,totalTok:b,inOut:k,cacheRead:E,modelCosts:C}=N.useMemo(()=>{let O=0,M=0,q=0,V=0;const X=new Map;for(const j of y){O+=j.totalCost,M+=j.totalTokens,q+=j.inputTokens+j.outputTokens,V+=j.cacheReadTokens;for(const G of j.modelBreakdowns)X.set(G.modelName,(X.get(G.modelName)??0)+G.cost)}return{totalCost:O,totalTok:M,inOut:q,cacheRead:V,modelCosts:X}},[y]),T=N.useMemo(()=>Array.from(C.entries()).sort((O,M)=>M[1]-O[1]),[C]),A=N.useMemo(()=>fT(y),[y]),L=A.length>1,P=o?y.find(O=>O.period===o)??null:null;return m.jsx("div",{className:"uh-backdrop",onClick:e,role:"presentation",children:m.jsxs("div",{ref:d,className:"uh-modal",onClick:O=>O.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Usage history",children:[m.jsxs("header",{className:"uh-head",children:[m.jsxs("div",{className:"uh-titlewrap",children:[m.jsx("div",{className:"uh-title",children:"Usage history"}),m.jsx("div",{className:"uh-sub",children:xD(t,A.map(O=>O.id))})]}),m.jsx("div",{className:"uh-range",role:"group","aria-label":"Range",children:ED.map(O=>m.jsxs("button",{type:"button","aria-pressed":r===O,className:"uh-range-btn",onClick:()=>{s(O),a(null)},children:[O,"d"]},O))}),m.jsx("button",{className:"glyph-btn uh-reload",onClick:f,...Wr(c),title:"Re-run ccusage","aria-label":"Reload",children:c?"…":"↻"}),m.jsx("button",{ref:p,className:"glyph-btn uh-close",onClick:e,"aria-label":"Close",children:"×"})]}),g.phase==="busy"?m.jsx("div",{className:"uh-status","aria-busy":"true",children:u?"running ccusage…":"running ccusage… (first run downloads the package)"}):g.phase==="error"?m.jsxs("div",{className:"uh-status uh-err",title:xo(u.resp)||void 0,children:[Eq(u.resp,"ccusage did not report usage"),m.jsx("div",{children:m.jsx("button",{className:"btn uh-retry",onClick:f,...Wr(c),children:c?"trying…":"Try again"})})]}):g.phase==="empty"?m.jsx("div",{className:`uh-status${g.stale?" uh-stale":""}`,"aria-busy":g.stale||void 0,children:"no usage in this range"}):m.jsxs("div",{className:g.stale?"uh-stale":void 0,"aria-busy":g.stale||void 0,children:[m.jsxs("div",{className:"uh-totals",children:[m.jsx(qu,{label:"total cost",val:Ge(_),accent:!0}),m.jsx(qu,{label:"tokens",val:At(b)}),m.jsx(qu,{label:"input+output",val:At(k)}),m.jsx(qu,{label:"cache reads",val:At(E)})]}),L&&m.jsxs("div",{className:"uh-agents",role:"group","aria-label":"Cost by CLI",children:[m.jsx("div",{className:"uh-agent-bar","aria-hidden":"true",children:A.map(O=>m.jsx("span",{className:"uh-agent-seg",style:{width:`${_>0?O.cost/_*100:0}%`,background:S1(O.id)}},O.id))}),m.jsx("div",{className:"uh-agent-keys",children:A.map(O=>m.jsxs("span",{className:"uh-agent-key",title:`${O.id} · ${At(O.tokens)} tokens`,children:[m.jsx("span",{className:"uh-legend-dot",style:{background:S1(O.id)}}),d0(O.id),m.jsx("span",{className:"uh-agent-cost",children:Ge(O.cost)}),m.jsx("span",{className:"uh-agent-share",children:SD(O.cost,_)})]},O.id))})]}),m.jsx("div",{ref:S,className:"uh-chart",role:"group","aria-label":"Daily cost by model",children:y.map(O=>{const M=w>0?O.totalCost/w*100:0,q=O.period===o,V=`${O.period}, ${Ge(O.totalCost)}`;return m.jsxs("button",{className:`uh-bar-col${q?" sel":""}`,onClick:()=>a(q?null:O.period),"aria-pressed":q,"aria-label":V,title:`${O.period} · ${Ge(O.totalCost)}`,style:{flexBasis:`${100/y.length}%`},children:[m.jsx("div",{className:"uh-bar",style:{height:`${Math.max(M,O.totalCost>0?2:0)}%`},children:O.modelBreakdowns.slice().sort((X,j)=>j.cost-X.cost).map(X=>{const j=O.totalCost>0?X.cost/O.totalCost*100:0;return m.jsx("div",{className:"uh-bar-seg",style:{height:`${j}%`,background:$u(X.modelName)}},X.modelName)})}),m.jsx("span",{className:"uh-bar-label",children:O.period.slice(5)})]},O.period)})}),m.jsx("div",{className:"uh-legend",children:T.map(([O,M])=>m.jsxs("span",{className:"uh-legend-item",title:O,children:[m.jsx("span",{className:"uh-legend-dot",style:{background:$u(O)}}),li(O)," ",m.jsx("span",{className:"uh-legend-cost",children:Ge(M)})]},O))}),P&&m.jsxs("div",{className:"uh-detail",children:[m.jsxs("div",{className:"uh-detail-head",children:[m.jsx("span",{className:"uh-detail-date",children:P.period}),m.jsx("span",{className:"uh-detail-cost",children:Ge(P.totalCost)}),(()=>{var q,V;const M=kD(P.agents)??((V=(q=P.metadata)==null?void 0:q.agents)!=null&&V.length?P.metadata.agents.join(" · "):null);return M?m.jsx("span",{className:"uh-detail-agents",title:M,children:M}):null})()]}),m.jsxs("div",{className:"uh-detail-mini",children:[m.jsx(Du,{label:"input",val:At(P.inputTokens)}),m.jsx(Du,{label:"output",val:At(P.outputTokens)}),m.jsx(Du,{label:"cache write",val:At(P.cacheCreationTokens)}),m.jsx(Du,{label:"cache read",val:At(P.cacheReadTokens)})]}),m.jsx("div",{className:"uh-detail-models",children:P.modelBreakdowns.slice().sort((O,M)=>M.cost-O.cost).map(O=>{const M=P.totalCost>0?O.cost/P.totalCost*100:0;return m.jsxs("div",{className:"uh-model-row",title:O.modelName,children:[m.jsxs("span",{className:"uh-model-name",children:[m.jsx("span",{className:"uh-legend-dot",style:{background:$u(O.modelName)}}),m.jsx("span",{className:"uh-model-label",children:li(O.modelName)})]}),m.jsx("span",{className:"uh-model-bar",children:m.jsx("span",{className:"uh-model-bar-fill",style:{width:`${M}%`,background:$u(O.modelName)}})}),m.jsx("span",{className:"uh-model-cost",children:Ge(O.cost)})]},O.modelName)})})]})]})]})})}function qu({label:e,val:t,accent:r}){return m.jsxs("div",{className:"uh-stat",children:[m.jsx("span",{className:`uh-stat-val${r?" accent":""}`,children:t}),m.jsx("span",{className:"uh-stat-label",children:e})]})}function Du({label:e,val:t}){return m.jsxs("div",{className:"uh-ministat",children:[m.jsx("span",{className:"uh-ministat-val",children:t}),m.jsx("span",{className:"uh-ministat-label",children:e})]})}function f0(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 Of,E1;function jD(){if(E1)return Of;E1=1;function e(){this.__data__=[],this.size=0}return Of=e,Of}var Pf,N1;function No(){if(N1)return Pf;N1=1;function e(t,r){return t===r||t!==t&&r!==r}return Pf=e,Pf}var Lf,C1;function wc(){if(C1)return Lf;C1=1;var e=No();function t(r,s){for(var o=r.length;o--;)if(e(r[o][0],s))return o;return-1}return Lf=t,Lf}var $f,j1;function TD(){if(j1)return $f;j1=1;var e=wc(),t=Array.prototype,r=t.splice;function s(o){var a=this.__data__,u=e(a,o);if(u<0)return!1;var c=a.length-1;return u==c?a.pop():r.call(a,u,1),--this.size,!0}return $f=s,$f}var qf,T1;function RD(){if(T1)return qf;T1=1;var e=wc();function t(r){var s=this.__data__,o=e(s,r);return o<0?void 0:s[o][1]}return qf=t,qf}var Df,R1;function AD(){if(R1)return Df;R1=1;var e=wc();function t(r){return e(this.__data__,r)>-1}return Df=t,Df}var Ff,A1;function ID(){if(A1)return Ff;A1=1;var e=wc();function t(r,s){var o=this.__data__,a=e(o,r);return a<0?(++this.size,o.push([r,s])):o[a][1]=s,this}return Ff=t,Ff}var zf,I1;function xc(){if(I1)return zf;I1=1;var e=jD(),t=TD(),r=RD(),s=AD(),o=ID();function a(u){var c=-1,f=u==null?0:u.length;for(this.clear();++c<f;){var p=u[c];this.set(p[0],p[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,zf=a,zf}var Bf,M1;function MD(){if(M1)return Bf;M1=1;var e=xc();function t(){this.__data__=new e,this.size=0}return Bf=t,Bf}var Uf,O1;function OD(){if(O1)return Uf;O1=1;function e(t){var r=this.__data__,s=r.delete(t);return this.size=r.size,s}return Uf=e,Uf}var Hf,P1;function PD(){if(P1)return Hf;P1=1;function e(t){return this.__data__.get(t)}return Hf=e,Hf}var Wf,L1;function LD(){if(L1)return Wf;L1=1;function e(t){return this.__data__.has(t)}return Wf=e,Wf}var Vf,$1;function hT(){if($1)return Vf;$1=1;var e=typeof _u=="object"&&_u&&_u.Object===Object&&_u;return Vf=e,Vf}var Gf,q1;function ar(){if(q1)return Gf;q1=1;var e=hT(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Gf=r,Gf}var Yf,D1;function Co(){if(D1)return Yf;D1=1;var e=ar(),t=e.Symbol;return Yf=t,Yf}var Kf,F1;function $D(){if(F1)return Kf;F1=1;var e=Co(),t=Object.prototype,r=t.hasOwnProperty,s=t.toString,o=e?e.toStringTag:void 0;function a(u){var c=r.call(u,o),f=u[o];try{u[o]=void 0;var p=!0}catch{}var d=s.call(u);return p&&(c?u[o]=f:delete u[o]),d}return Kf=a,Kf}var Xf,z1;function qD(){if(z1)return Xf;z1=1;var e=Object.prototype,t=e.toString;function r(s){return t.call(s)}return Xf=r,Xf}var Qf,B1;function ui(){if(B1)return Qf;B1=1;var e=Co(),t=$D(),r=qD(),s="[object Null]",o="[object Undefined]",a=e?e.toStringTag:void 0;function u(c){return c==null?c===void 0?o:s:a&&a in Object(c)?t(c):r(c)}return Qf=u,Qf}var Zf,U1;function Dn(){if(U1)return Zf;U1=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Zf=e,Zf}var Jf,H1;function sl(){if(H1)return Jf;H1=1;var e=ui(),t=Dn(),r="[object AsyncFunction]",s="[object Function]",o="[object GeneratorFunction]",a="[object Proxy]";function u(c){if(!t(c))return!1;var f=e(c);return f==s||f==o||f==r||f==a}return Jf=u,Jf}var eh,W1;function DD(){if(W1)return eh;W1=1;var e=ar(),t=e["__core-js_shared__"];return eh=t,eh}var th,V1;function FD(){if(V1)return th;V1=1;var e=DD(),t=(function(){var s=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""})();function r(s){return!!t&&t in s}return th=r,th}var nh,G1;function pT(){if(G1)return nh;G1=1;var e=Function.prototype,t=e.toString;function r(s){if(s!=null){try{return t.call(s)}catch{}try{return s+""}catch{}}return""}return nh=r,nh}var rh,Y1;function zD(){if(Y1)return rh;Y1=1;var e=sl(),t=FD(),r=Dn(),s=pT(),o=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,f=u.toString,p=c.hasOwnProperty,d=RegExp("^"+f.call(p).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function g(y){if(!r(y)||t(y))return!1;var w=e(y)?d:a;return w.test(s(y))}return rh=g,rh}var sh,K1;function BD(){if(K1)return sh;K1=1;function e(t,r){return t==null?void 0:t[r]}return sh=e,sh}var ih,X1;function ci(){if(X1)return ih;X1=1;var e=zD(),t=BD();function r(s,o){var a=t(s,o);return e(a)?a:void 0}return ih=r,ih}var oh,Q1;function h0(){if(Q1)return oh;Q1=1;var e=ci(),t=ar(),r=e(t,"Map");return oh=r,oh}var ah,Z1;function _c(){if(Z1)return ah;Z1=1;var e=ci(),t=e(Object,"create");return ah=t,ah}var lh,J1;function UD(){if(J1)return lh;J1=1;var e=_c();function t(){this.__data__=e?e(null):{},this.size=0}return lh=t,lh}var uh,eb;function HD(){if(eb)return uh;eb=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return uh=e,uh}var ch,tb;function WD(){if(tb)return ch;tb=1;var e=_c(),t="__lodash_hash_undefined__",r=Object.prototype,s=r.hasOwnProperty;function o(a){var u=this.__data__;if(e){var c=u[a];return c===t?void 0:c}return s.call(u,a)?u[a]:void 0}return ch=o,ch}var dh,nb;function VD(){if(nb)return dh;nb=1;var e=_c(),t=Object.prototype,r=t.hasOwnProperty;function s(o){var a=this.__data__;return e?a[o]!==void 0:r.call(a,o)}return dh=s,dh}var fh,rb;function GD(){if(rb)return fh;rb=1;var e=_c(),t="__lodash_hash_undefined__";function r(s,o){var a=this.__data__;return this.size+=this.has(s)?0:1,a[s]=e&&o===void 0?t:o,this}return fh=r,fh}var hh,sb;function YD(){if(sb)return hh;sb=1;var e=UD(),t=HD(),r=WD(),s=VD(),o=GD();function a(u){var c=-1,f=u==null?0:u.length;for(this.clear();++c<f;){var p=u[c];this.set(p[0],p[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,hh=a,hh}var ph,ib;function KD(){if(ib)return ph;ib=1;var e=YD(),t=xc(),r=h0();function s(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return ph=s,ph}var mh,ob;function XD(){if(ob)return mh;ob=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return mh=e,mh}var gh,ab;function bc(){if(ab)return gh;ab=1;var e=XD();function t(r,s){var o=r.__data__;return e(s)?o[typeof s=="string"?"string":"hash"]:o.map}return gh=t,gh}var vh,lb;function QD(){if(lb)return vh;lb=1;var e=bc();function t(r){var s=e(this,r).delete(r);return this.size-=s?1:0,s}return vh=t,vh}var yh,ub;function ZD(){if(ub)return yh;ub=1;var e=bc();function t(r){return e(this,r).get(r)}return yh=t,yh}var wh,cb;function JD(){if(cb)return wh;cb=1;var e=bc();function t(r){return e(this,r).has(r)}return wh=t,wh}var xh,db;function e5(){if(db)return xh;db=1;var e=bc();function t(r,s){var o=e(this,r),a=o.size;return o.set(r,s),this.size+=o.size==a?0:1,this}return xh=t,xh}var _h,fb;function p0(){if(fb)return _h;fb=1;var e=KD(),t=QD(),r=ZD(),s=JD(),o=e5();function a(u){var c=-1,f=u==null?0:u.length;for(this.clear();++c<f;){var p=u[c];this.set(p[0],p[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=s,a.prototype.set=o,_h=a,_h}var bh,hb;function t5(){if(hb)return bh;hb=1;var e=xc(),t=h0(),r=p0(),s=200;function o(a,u){var c=this.__data__;if(c instanceof e){var f=c.__data__;if(!t||f.length<s-1)return f.push([a,u]),this.size=++c.size,this;c=this.__data__=new r(f)}return c.set(a,u),this.size=c.size,this}return bh=o,bh}var kh,pb;function kc(){if(pb)return kh;pb=1;var e=xc(),t=MD(),r=OD(),s=PD(),o=LD(),a=t5();function u(c){var f=this.__data__=new e(c);this.size=f.size}return u.prototype.clear=t,u.prototype.delete=r,u.prototype.get=s,u.prototype.has=o,u.prototype.set=a,kh=u,kh}var Sh,mb;function m0(){if(mb)return Sh;mb=1;function e(t,r){for(var s=-1,o=t==null?0:t.length;++s<o&&r(t[s],s,t)!==!1;);return t}return Sh=e,Sh}var Eh,gb;function mT(){if(gb)return Eh;gb=1;var e=ci(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return Eh=t,Eh}var Nh,vb;function Sc(){if(vb)return Nh;vb=1;var e=mT();function t(r,s,o){s=="__proto__"&&e?e(r,s,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[s]=o}return Nh=t,Nh}var Ch,yb;function Ec(){if(yb)return Ch;yb=1;var e=Sc(),t=No(),r=Object.prototype,s=r.hasOwnProperty;function o(a,u,c){var f=a[u];(!(s.call(a,u)&&t(f,c))||c===void 0&&!(u in a))&&e(a,u,c)}return Ch=o,Ch}var jh,wb;function il(){if(wb)return jh;wb=1;var e=Ec(),t=Sc();function r(s,o,a,u){var c=!a;a||(a={});for(var f=-1,p=o.length;++f<p;){var d=o[f],g=u?u(a[d],s[d],d,a,s):void 0;g===void 0&&(g=s[d]),c?t(a,d,g):e(a,d,g)}return a}return jh=r,jh}var Th,xb;function n5(){if(xb)return Th;xb=1;function e(t,r){for(var s=-1,o=Array(t);++s<t;)o[s]=r(s);return o}return Th=e,Th}var Rh,_b;function kr(){if(_b)return Rh;_b=1;function e(t){return t!=null&&typeof t=="object"}return Rh=e,Rh}var Ah,bb;function r5(){if(bb)return Ah;bb=1;var e=ui(),t=kr(),r="[object Arguments]";function s(o){return t(o)&&e(o)==r}return Ah=s,Ah}var Ih,kb;function ol(){if(kb)return Ih;kb=1;var e=r5(),t=kr(),r=Object.prototype,s=r.hasOwnProperty,o=r.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(u){return t(u)&&s.call(u,"callee")&&!o.call(u,"callee")};return Ih=a,Ih}var Mh,Sb;function Ct(){if(Sb)return Mh;Sb=1;var e=Array.isArray;return Mh=e,Mh}var Ia={exports:{}},Oh,Eb;function s5(){if(Eb)return Oh;Eb=1;function e(){return!1}return Oh=e,Oh}Ia.exports;var Nb;function jo(){return Nb||(Nb=1,(function(e,t){var r=ar(),s=s5(),o=t&&!t.nodeType&&t,a=o&&!0&&e&&!e.nodeType&&e,u=a&&a.exports===o,c=u?r.Buffer:void 0,f=c?c.isBuffer:void 0,p=f||s;e.exports=p})(Ia,Ia.exports)),Ia.exports}var Ph,Cb;function Nc(){if(Cb)return Ph;Cb=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(s,o){var a=typeof s;return o=o??e,!!o&&(a=="number"||a!="symbol"&&t.test(s))&&s>-1&&s%1==0&&s<o}return Ph=r,Ph}var Lh,jb;function g0(){if(jb)return Lh;jb=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return Lh=t,Lh}var $h,Tb;function i5(){if(Tb)return $h;Tb=1;var e=ui(),t=g0(),r=kr(),s="[object Arguments]",o="[object Array]",a="[object Boolean]",u="[object Date]",c="[object Error]",f="[object Function]",p="[object Map]",d="[object Number]",g="[object Object]",y="[object RegExp]",w="[object Set]",S="[object String]",_="[object WeakMap]",b="[object ArrayBuffer]",k="[object DataView]",E="[object Float32Array]",C="[object Float64Array]",T="[object Int8Array]",A="[object Int16Array]",L="[object Int32Array]",P="[object Uint8Array]",U="[object Uint8ClampedArray]",O="[object Uint16Array]",M="[object Uint32Array]",q={};q[E]=q[C]=q[T]=q[A]=q[L]=q[P]=q[U]=q[O]=q[M]=!0,q[s]=q[o]=q[b]=q[a]=q[k]=q[u]=q[c]=q[f]=q[p]=q[d]=q[g]=q[y]=q[w]=q[S]=q[_]=!1;function V(X){return r(X)&&t(X.length)&&!!q[e(X)]}return $h=V,$h}var qh,Rb;function Cc(){if(Rb)return qh;Rb=1;function e(t){return function(r){return t(r)}}return qh=e,qh}var Ma={exports:{}};Ma.exports;var Ab;function v0(){return Ab||(Ab=1,(function(e,t){var r=hT(),s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,u=a&&r.process,c=(function(){try{var f=o&&o.require&&o.require("util").types;return f||u&&u.binding&&u.binding("util")}catch{}})();e.exports=c})(Ma,Ma.exports)),Ma.exports}var Dh,Ib;function al(){if(Ib)return Dh;Ib=1;var e=i5(),t=Cc(),r=v0(),s=r&&r.isTypedArray,o=s?t(s):e;return Dh=o,Dh}var Fh,Mb;function gT(){if(Mb)return Fh;Mb=1;var e=n5(),t=ol(),r=Ct(),s=jo(),o=Nc(),a=al(),u=Object.prototype,c=u.hasOwnProperty;function f(p,d){var g=r(p),y=!g&&t(p),w=!g&&!y&&s(p),S=!g&&!y&&!w&&a(p),_=g||y||w||S,b=_?e(p.length,String):[],k=b.length;for(var E in p)(d||c.call(p,E))&&!(_&&(E=="length"||w&&(E=="offset"||E=="parent")||S&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||o(E,k)))&&b.push(E);return b}return Fh=f,Fh}var zh,Ob;function jc(){if(Ob)return zh;Ob=1;var e=Object.prototype;function t(r){var s=r&&r.constructor,o=typeof s=="function"&&s.prototype||e;return r===o}return zh=t,zh}var Bh,Pb;function vT(){if(Pb)return Bh;Pb=1;function e(t,r){return function(s){return t(r(s))}}return Bh=e,Bh}var Uh,Lb;function o5(){if(Lb)return Uh;Lb=1;var e=vT(),t=e(Object.keys,Object);return Uh=t,Uh}var Hh,$b;function y0(){if($b)return Hh;$b=1;var e=jc(),t=o5(),r=Object.prototype,s=r.hasOwnProperty;function o(a){if(!e(a))return t(a);var u=[];for(var c in Object(a))s.call(a,c)&&c!="constructor"&&u.push(c);return u}return Hh=o,Hh}var Wh,qb;function Xr(){if(qb)return Wh;qb=1;var e=sl(),t=g0();function r(s){return s!=null&&t(s.length)&&!e(s)}return Wh=r,Wh}var Vh,Db;function Ts(){if(Db)return Vh;Db=1;var e=gT(),t=y0(),r=Xr();function s(o){return r(o)?e(o):t(o)}return Vh=s,Vh}var Gh,Fb;function a5(){if(Fb)return Gh;Fb=1;var e=il(),t=Ts();function r(s,o){return s&&e(o,t(o),s)}return Gh=r,Gh}var Yh,zb;function l5(){if(zb)return Yh;zb=1;function e(t){var r=[];if(t!=null)for(var s in Object(t))r.push(s);return r}return Yh=e,Yh}var Kh,Bb;function u5(){if(Bb)return Kh;Bb=1;var e=Dn(),t=jc(),r=l5(),s=Object.prototype,o=s.hasOwnProperty;function a(u){if(!e(u))return r(u);var c=t(u),f=[];for(var p in u)p=="constructor"&&(c||!o.call(u,p))||f.push(p);return f}return Kh=a,Kh}var Xh,Ub;function di(){if(Ub)return Xh;Ub=1;var e=gT(),t=u5(),r=Xr();function s(o){return r(o)?e(o,!0):t(o)}return Xh=s,Xh}var Qh,Hb;function c5(){if(Hb)return Qh;Hb=1;var e=il(),t=di();function r(s,o){return s&&e(o,t(o),s)}return Qh=r,Qh}var Oa={exports:{}};Oa.exports;var Wb;function yT(){return Wb||(Wb=1,(function(e,t){var r=ar(),s=t&&!t.nodeType&&t,o=s&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===s,u=a?r.Buffer:void 0,c=u?u.allocUnsafe:void 0;function f(p,d){if(d)return p.slice();var g=p.length,y=c?c(g):new p.constructor(g);return p.copy(y),y}e.exports=f})(Oa,Oa.exports)),Oa.exports}var Zh,Vb;function wT(){if(Vb)return Zh;Vb=1;function e(t,r){var s=-1,o=t.length;for(r||(r=Array(o));++s<o;)r[s]=t[s];return r}return Zh=e,Zh}var Jh,Gb;function xT(){if(Gb)return Jh;Gb=1;function e(t,r){for(var s=-1,o=t==null?0:t.length,a=0,u=[];++s<o;){var c=t[s];r(c,s,t)&&(u[a++]=c)}return u}return Jh=e,Jh}var ep,Yb;function _T(){if(Yb)return ep;Yb=1;function e(){return[]}return ep=e,ep}var tp,Kb;function w0(){if(Kb)return tp;Kb=1;var e=xT(),t=_T(),r=Object.prototype,s=r.propertyIsEnumerable,o=Object.getOwnPropertySymbols,a=o?function(u){return u==null?[]:(u=Object(u),e(o(u),function(c){return s.call(u,c)}))}:t;return tp=a,tp}var np,Xb;function d5(){if(Xb)return np;Xb=1;var e=il(),t=w0();function r(s,o){return e(s,t(s),o)}return np=r,np}var rp,Qb;function x0(){if(Qb)return rp;Qb=1;function e(t,r){for(var s=-1,o=r.length,a=t.length;++s<o;)t[a+s]=r[s];return t}return rp=e,rp}var sp,Zb;function Tc(){if(Zb)return sp;Zb=1;var e=vT(),t=e(Object.getPrototypeOf,Object);return sp=t,sp}var ip,Jb;function bT(){if(Jb)return ip;Jb=1;var e=x0(),t=Tc(),r=w0(),s=_T(),o=Object.getOwnPropertySymbols,a=o?function(u){for(var c=[];u;)e(c,r(u)),u=t(u);return c}:s;return ip=a,ip}var op,ek;function f5(){if(ek)return op;ek=1;var e=il(),t=bT();function r(s,o){return e(s,t(s),o)}return op=r,op}var ap,tk;function kT(){if(tk)return ap;tk=1;var e=x0(),t=Ct();function r(s,o,a){var u=o(s);return t(s)?u:e(u,a(s))}return ap=r,ap}var lp,nk;function ST(){if(nk)return lp;nk=1;var e=kT(),t=w0(),r=Ts();function s(o){return e(o,r,t)}return lp=s,lp}var up,rk;function h5(){if(rk)return up;rk=1;var e=kT(),t=bT(),r=di();function s(o){return e(o,r,t)}return up=s,up}var cp,sk;function p5(){if(sk)return cp;sk=1;var e=ci(),t=ar(),r=e(t,"DataView");return cp=r,cp}var dp,ik;function m5(){if(ik)return dp;ik=1;var e=ci(),t=ar(),r=e(t,"Promise");return dp=r,dp}var fp,ok;function ET(){if(ok)return fp;ok=1;var e=ci(),t=ar(),r=e(t,"Set");return fp=r,fp}var hp,ak;function g5(){if(ak)return hp;ak=1;var e=ci(),t=ar(),r=e(t,"WeakMap");return hp=r,hp}var pp,lk;function To(){if(lk)return pp;lk=1;var e=p5(),t=h0(),r=m5(),s=ET(),o=g5(),a=ui(),u=pT(),c="[object Map]",f="[object Object]",p="[object Promise]",d="[object Set]",g="[object WeakMap]",y="[object DataView]",w=u(e),S=u(t),_=u(r),b=u(s),k=u(o),E=a;return(e&&E(new e(new ArrayBuffer(1)))!=y||t&&E(new t)!=c||r&&E(r.resolve())!=p||s&&E(new s)!=d||o&&E(new o)!=g)&&(E=function(C){var T=a(C),A=T==f?C.constructor:void 0,L=A?u(A):"";if(L)switch(L){case w:return y;case S:return c;case _:return p;case b:return d;case k:return g}return T}),pp=E,pp}var mp,uk;function v5(){if(uk)return mp;uk=1;var e=Object.prototype,t=e.hasOwnProperty;function r(s){var o=s.length,a=new s.constructor(o);return o&&typeof s[0]=="string"&&t.call(s,"index")&&(a.index=s.index,a.input=s.input),a}return mp=r,mp}var gp,ck;function NT(){if(ck)return gp;ck=1;var e=ar(),t=e.Uint8Array;return gp=t,gp}var vp,dk;function _0(){if(dk)return vp;dk=1;var e=NT();function t(r){var s=new r.constructor(r.byteLength);return new e(s).set(new e(r)),s}return vp=t,vp}var yp,fk;function y5(){if(fk)return yp;fk=1;var e=_0();function t(r,s){var o=s?e(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.byteLength)}return yp=t,yp}var wp,hk;function w5(){if(hk)return wp;hk=1;var e=/\w*$/;function t(r){var s=new r.constructor(r.source,e.exec(r));return s.lastIndex=r.lastIndex,s}return wp=t,wp}var xp,pk;function x5(){if(pk)return xp;pk=1;var e=Co(),t=e?e.prototype:void 0,r=t?t.valueOf:void 0;function s(o){return r?Object(r.call(o)):{}}return xp=s,xp}var _p,mk;function CT(){if(mk)return _p;mk=1;var e=_0();function t(r,s){var o=s?e(r.buffer):r.buffer;return new r.constructor(o,r.byteOffset,r.length)}return _p=t,_p}var bp,gk;function _5(){if(gk)return bp;gk=1;var e=_0(),t=y5(),r=w5(),s=x5(),o=CT(),a="[object Boolean]",u="[object Date]",c="[object Map]",f="[object Number]",p="[object RegExp]",d="[object Set]",g="[object String]",y="[object Symbol]",w="[object ArrayBuffer]",S="[object DataView]",_="[object Float32Array]",b="[object Float64Array]",k="[object Int8Array]",E="[object Int16Array]",C="[object Int32Array]",T="[object Uint8Array]",A="[object Uint8ClampedArray]",L="[object Uint16Array]",P="[object Uint32Array]";function U(O,M,q){var V=O.constructor;switch(M){case w:return e(O);case a:case u:return new V(+O);case S:return t(O,q);case _:case b:case k:case E:case C:case T:case A:case L:case P:return o(O,q);case c:return new V;case f:case g:return new V(O);case p:return r(O);case d:return new V;case y:return s(O)}}return bp=U,bp}var kp,vk;function jT(){if(vk)return kp;vk=1;var e=Dn(),t=Object.create,r=(function(){function s(){}return function(o){if(!e(o))return{};if(t)return t(o);s.prototype=o;var a=new s;return s.prototype=void 0,a}})();return kp=r,kp}var Sp,yk;function TT(){if(yk)return Sp;yk=1;var e=jT(),t=Tc(),r=jc();function s(o){return typeof o.constructor=="function"&&!r(o)?e(t(o)):{}}return Sp=s,Sp}var Ep,wk;function b5(){if(wk)return Ep;wk=1;var e=To(),t=kr(),r="[object Map]";function s(o){return t(o)&&e(o)==r}return Ep=s,Ep}var Np,xk;function k5(){if(xk)return Np;xk=1;var e=b5(),t=Cc(),r=v0(),s=r&&r.isMap,o=s?t(s):e;return Np=o,Np}var Cp,_k;function S5(){if(_k)return Cp;_k=1;var e=To(),t=kr(),r="[object Set]";function s(o){return t(o)&&e(o)==r}return Cp=s,Cp}var jp,bk;function E5(){if(bk)return jp;bk=1;var e=S5(),t=Cc(),r=v0(),s=r&&r.isSet,o=s?t(s):e;return jp=o,jp}var Tp,kk;function RT(){if(kk)return Tp;kk=1;var e=kc(),t=m0(),r=Ec(),s=a5(),o=c5(),a=yT(),u=wT(),c=d5(),f=f5(),p=ST(),d=h5(),g=To(),y=v5(),w=_5(),S=TT(),_=Ct(),b=jo(),k=k5(),E=Dn(),C=E5(),T=Ts(),A=di(),L=1,P=2,U=4,O="[object Arguments]",M="[object Array]",q="[object Boolean]",V="[object Date]",X="[object Error]",j="[object Function]",G="[object GeneratorFunction]",B="[object Map]",te="[object Number]",Z="[object Object]",$="[object RegExp]",H="[object Set]",I="[object String]",Y="[object Symbol]",ce="[object WeakMap]",z="[object ArrayBuffer]",Q="[object DataView]",ne="[object Float32Array]",ae="[object Float64Array]",fe="[object Int8Array]",pe="[object Int16Array]",ye="[object Int32Array]",Me="[object Uint8Array]",Ue="[object Uint8ClampedArray]",ze="[object Uint16Array]",Ie="[object Uint32Array]",ke={};ke[O]=ke[M]=ke[z]=ke[Q]=ke[q]=ke[V]=ke[ne]=ke[ae]=ke[fe]=ke[pe]=ke[ye]=ke[B]=ke[te]=ke[Z]=ke[$]=ke[H]=ke[I]=ke[Y]=ke[Me]=ke[Ue]=ke[ze]=ke[Ie]=!0,ke[X]=ke[j]=ke[ce]=!1;function le(we,xe,Ye,gt,ft,ot){var Be,et=xe&L,Xe=xe&P,wt=xe&U;if(Ye&&(Be=ft?Ye(we,gt,ft,ot):Ye(we)),Be!==void 0)return Be;if(!E(we))return we;var ee=_(we);if(ee){if(Be=y(we),!et)return u(we,Be)}else{var Le=g(we),De=Le==j||Le==G;if(b(we))return a(we,et);if(Le==Z||Le==O||De&&!ft){if(Be=Xe||De?{}:S(we),!et)return Xe?f(we,o(Be,we)):c(we,s(Be,we))}else{if(!ke[Le])return ft?we:{};Be=w(we,Le,et)}}ot||(ot=new e);var Re=ot.get(we);if(Re)return Re;ot.set(we,Be),C(we)?we.forEach(function(tt){Be.add(le(tt,xe,Ye,tt,we,ot))}):k(we)&&we.forEach(function(tt,Ce){Be.set(Ce,le(tt,xe,Ye,Ce,we,ot))});var $e=wt?Xe?d:p:Xe?A:T,rt=ee?void 0:$e(we);return t(rt||we,function(tt,Ce){rt&&(Ce=tt,tt=we[Ce]),r(Be,Ce,le(tt,xe,Ye,Ce,we,ot))}),Be}return Tp=le,Tp}var Rp,Sk;function N5(){if(Sk)return Rp;Sk=1;var e=RT(),t=4;function r(s){return e(s,t)}return Rp=r,Rp}var Ap,Ek;function b0(){if(Ek)return Ap;Ek=1;function e(t){return function(){return t}}return Ap=e,Ap}var Ip,Nk;function C5(){if(Nk)return Ip;Nk=1;function e(t){return function(r,s,o){for(var a=-1,u=Object(r),c=o(r),f=c.length;f--;){var p=c[t?f:++a];if(s(u[p],p,u)===!1)break}return r}}return Ip=e,Ip}var Mp,Ck;function k0(){if(Ck)return Mp;Ck=1;var e=C5(),t=e();return Mp=t,Mp}var Op,jk;function S0(){if(jk)return Op;jk=1;var e=k0(),t=Ts();function r(s,o){return s&&e(s,o,t)}return Op=r,Op}var Pp,Tk;function j5(){if(Tk)return Pp;Tk=1;var e=Xr();function t(r,s){return function(o,a){if(o==null)return o;if(!e(o))return r(o,a);for(var u=o.length,c=s?u:-1,f=Object(o);(s?c--:++c<u)&&a(f[c],c,f)!==!1;);return o}}return Pp=t,Pp}var Lp,Rk;function Rc(){if(Rk)return Lp;Rk=1;var e=S0(),t=j5(),r=t(e);return Lp=r,Lp}var $p,Ak;function fi(){if(Ak)return $p;Ak=1;function e(t){return t}return $p=e,$p}var qp,Ik;function AT(){if(Ik)return qp;Ik=1;var e=fi();function t(r){return typeof r=="function"?r:e}return qp=t,qp}var Dp,Mk;function IT(){if(Mk)return Dp;Mk=1;var e=m0(),t=Rc(),r=AT(),s=Ct();function o(a,u){var c=s(a)?e:t;return c(a,r(u))}return Dp=o,Dp}var Fp,Ok;function MT(){return Ok||(Ok=1,Fp=IT()),Fp}var zp,Pk;function T5(){if(Pk)return zp;Pk=1;var e=Rc();function t(r,s){var o=[];return e(r,function(a,u,c){s(a,u,c)&&o.push(a)}),o}return zp=t,zp}var Bp,Lk;function R5(){if(Lk)return Bp;Lk=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return Bp=t,Bp}var Up,$k;function A5(){if($k)return Up;$k=1;function e(t){return this.__data__.has(t)}return Up=e,Up}var Hp,qk;function OT(){if(qk)return Hp;qk=1;var e=p0(),t=R5(),r=A5();function s(o){var a=-1,u=o==null?0:o.length;for(this.__data__=new e;++a<u;)this.add(o[a])}return s.prototype.add=s.prototype.push=t,s.prototype.has=r,Hp=s,Hp}var Wp,Dk;function I5(){if(Dk)return Wp;Dk=1;function e(t,r){for(var s=-1,o=t==null?0:t.length;++s<o;)if(r(t[s],s,t))return!0;return!1}return Wp=e,Wp}var Vp,Fk;function PT(){if(Fk)return Vp;Fk=1;function e(t,r){return t.has(r)}return Vp=e,Vp}var Gp,zk;function LT(){if(zk)return Gp;zk=1;var e=OT(),t=I5(),r=PT(),s=1,o=2;function a(u,c,f,p,d,g){var y=f&s,w=u.length,S=c.length;if(w!=S&&!(y&&S>w))return!1;var _=g.get(u),b=g.get(c);if(_&&b)return _==c&&b==u;var k=-1,E=!0,C=f&o?new e:void 0;for(g.set(u,c),g.set(c,u);++k<w;){var T=u[k],A=c[k];if(p)var L=y?p(A,T,k,c,u,g):p(T,A,k,u,c,g);if(L!==void 0){if(L)continue;E=!1;break}if(C){if(!t(c,function(P,U){if(!r(C,U)&&(T===P||d(T,P,f,p,g)))return C.push(U)})){E=!1;break}}else if(!(T===A||d(T,A,f,p,g))){E=!1;break}}return g.delete(u),g.delete(c),E}return Gp=a,Gp}var Yp,Bk;function M5(){if(Bk)return Yp;Bk=1;function e(t){var r=-1,s=Array(t.size);return t.forEach(function(o,a){s[++r]=[a,o]}),s}return Yp=e,Yp}var Kp,Uk;function E0(){if(Uk)return Kp;Uk=1;function e(t){var r=-1,s=Array(t.size);return t.forEach(function(o){s[++r]=o}),s}return Kp=e,Kp}var Xp,Hk;function O5(){if(Hk)return Xp;Hk=1;var e=Co(),t=NT(),r=No(),s=LT(),o=M5(),a=E0(),u=1,c=2,f="[object Boolean]",p="[object Date]",d="[object Error]",g="[object Map]",y="[object Number]",w="[object RegExp]",S="[object Set]",_="[object String]",b="[object Symbol]",k="[object ArrayBuffer]",E="[object DataView]",C=e?e.prototype:void 0,T=C?C.valueOf:void 0;function A(L,P,U,O,M,q,V){switch(U){case E:if(L.byteLength!=P.byteLength||L.byteOffset!=P.byteOffset)return!1;L=L.buffer,P=P.buffer;case k:return!(L.byteLength!=P.byteLength||!q(new t(L),new t(P)));case f:case p:case y:return r(+L,+P);case d:return L.name==P.name&&L.message==P.message;case w:case _:return L==P+"";case g:var X=o;case S:var j=O&u;if(X||(X=a),L.size!=P.size&&!j)return!1;var G=V.get(L);if(G)return G==P;O|=c,V.set(L,P);var B=s(X(L),X(P),O,M,q,V);return V.delete(L),B;case b:if(T)return T.call(L)==T.call(P)}return!1}return Xp=A,Xp}var Qp,Wk;function P5(){if(Wk)return Qp;Wk=1;var e=ST(),t=1,r=Object.prototype,s=r.hasOwnProperty;function o(a,u,c,f,p,d){var g=c&t,y=e(a),w=y.length,S=e(u),_=S.length;if(w!=_&&!g)return!1;for(var b=w;b--;){var k=y[b];if(!(g?k in u:s.call(u,k)))return!1}var E=d.get(a),C=d.get(u);if(E&&C)return E==u&&C==a;var T=!0;d.set(a,u),d.set(u,a);for(var A=g;++b<w;){k=y[b];var L=a[k],P=u[k];if(f)var U=g?f(P,L,k,u,a,d):f(L,P,k,a,u,d);if(!(U===void 0?L===P||p(L,P,c,f,d):U)){T=!1;break}A||(A=k=="constructor")}if(T&&!A){var O=a.constructor,M=u.constructor;O!=M&&"constructor"in a&&"constructor"in u&&!(typeof O=="function"&&O instanceof O&&typeof M=="function"&&M instanceof M)&&(T=!1)}return d.delete(a),d.delete(u),T}return Qp=o,Qp}var Zp,Vk;function L5(){if(Vk)return Zp;Vk=1;var e=kc(),t=LT(),r=O5(),s=P5(),o=To(),a=Ct(),u=jo(),c=al(),f=1,p="[object Arguments]",d="[object Array]",g="[object Object]",y=Object.prototype,w=y.hasOwnProperty;function S(_,b,k,E,C,T){var A=a(_),L=a(b),P=A?d:o(_),U=L?d:o(b);P=P==p?g:P,U=U==p?g:U;var O=P==g,M=U==g,q=P==U;if(q&&u(_)){if(!u(b))return!1;A=!0,O=!1}if(q&&!O)return T||(T=new e),A||c(_)?t(_,b,k,E,C,T):r(_,b,P,k,E,C,T);if(!(k&f)){var V=O&&w.call(_,"__wrapped__"),X=M&&w.call(b,"__wrapped__");if(V||X){var j=V?_.value():_,G=X?b.value():b;return T||(T=new e),C(j,G,k,E,T)}}return q?(T||(T=new e),s(_,b,k,E,C,T)):!1}return Zp=S,Zp}var Jp,Gk;function $T(){if(Gk)return Jp;Gk=1;var e=L5(),t=kr();function r(s,o,a,u,c){return s===o?!0:s==null||o==null||!t(s)&&!t(o)?s!==s&&o!==o:e(s,o,a,u,r,c)}return Jp=r,Jp}var em,Yk;function $5(){if(Yk)return em;Yk=1;var e=kc(),t=$T(),r=1,s=2;function o(a,u,c,f){var p=c.length,d=p,g=!f;if(a==null)return!d;for(a=Object(a);p--;){var y=c[p];if(g&&y[2]?y[1]!==a[y[0]]:!(y[0]in a))return!1}for(;++p<d;){y=c[p];var w=y[0],S=a[w],_=y[1];if(g&&y[2]){if(S===void 0&&!(w in a))return!1}else{var b=new e;if(f)var k=f(S,_,w,a,u,b);if(!(k===void 0?t(_,S,r|s,f,b):k))return!1}}return!0}return em=o,em}var tm,Kk;function qT(){if(Kk)return tm;Kk=1;var e=Dn();function t(r){return r===r&&!e(r)}return tm=t,tm}var nm,Xk;function q5(){if(Xk)return nm;Xk=1;var e=qT(),t=Ts();function r(s){for(var o=t(s),a=o.length;a--;){var u=o[a],c=s[u];o[a]=[u,c,e(c)]}return o}return nm=r,nm}var rm,Qk;function DT(){if(Qk)return rm;Qk=1;function e(t,r){return function(s){return s==null?!1:s[t]===r&&(r!==void 0||t in Object(s))}}return rm=e,rm}var sm,Zk;function D5(){if(Zk)return sm;Zk=1;var e=$5(),t=q5(),r=DT();function s(o){var a=t(o);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(u){return u===o||e(u,o,a)}}return sm=s,sm}var im,Jk;function Ro(){if(Jk)return im;Jk=1;var e=ui(),t=kr(),r="[object Symbol]";function s(o){return typeof o=="symbol"||t(o)&&e(o)==r}return im=s,im}var om,eS;function N0(){if(eS)return om;eS=1;var e=Ct(),t=Ro(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;function o(a,u){if(e(a))return!1;var c=typeof a;return c=="number"||c=="symbol"||c=="boolean"||a==null||t(a)?!0:s.test(a)||!r.test(a)||u!=null&&a in Object(u)}return om=o,om}var am,tS;function F5(){if(tS)return am;tS=1;var e=p0(),t="Expected a function";function r(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new TypeError(t);var a=function(){var u=arguments,c=o?o.apply(this,u):u[0],f=a.cache;if(f.has(c))return f.get(c);var p=s.apply(this,u);return a.cache=f.set(c,p)||f,p};return a.cache=new(r.Cache||e),a}return r.Cache=e,am=r,am}var lm,nS;function z5(){if(nS)return lm;nS=1;var e=F5(),t=500;function r(s){var o=e(s,function(u){return a.size===t&&a.clear(),u}),a=o.cache;return o}return lm=r,lm}var um,rS;function B5(){if(rS)return um;rS=1;var e=z5(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,s=e(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(t,function(u,c,f,p){a.push(f?p.replace(r,"$1"):c||u)}),a});return um=s,um}var cm,sS;function Ac(){if(sS)return cm;sS=1;function e(t,r){for(var s=-1,o=t==null?0:t.length,a=Array(o);++s<o;)a[s]=r(t[s],s,t);return a}return cm=e,cm}var dm,iS;function U5(){if(iS)return dm;iS=1;var e=Co(),t=Ac(),r=Ct(),s=Ro(),o=e?e.prototype:void 0,a=o?o.toString:void 0;function u(c){if(typeof c=="string")return c;if(r(c))return t(c,u)+"";if(s(c))return a?a.call(c):"";var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}return dm=u,dm}var fm,oS;function FT(){if(oS)return fm;oS=1;var e=U5();function t(r){return r==null?"":e(r)}return fm=t,fm}var hm,aS;function Ic(){if(aS)return hm;aS=1;var e=Ct(),t=N0(),r=B5(),s=FT();function o(a,u){return e(a)?a:t(a,u)?[a]:r(s(a))}return hm=o,hm}var pm,lS;function ll(){if(lS)return pm;lS=1;var e=Ro();function t(r){if(typeof r=="string"||e(r))return r;var s=r+"";return s=="0"&&1/r==-1/0?"-0":s}return pm=t,pm}var mm,uS;function Mc(){if(uS)return mm;uS=1;var e=Ic(),t=ll();function r(s,o){o=e(o,s);for(var a=0,u=o.length;s!=null&&a<u;)s=s[t(o[a++])];return a&&a==u?s:void 0}return mm=r,mm}var gm,cS;function H5(){if(cS)return gm;cS=1;var e=Mc();function t(r,s,o){var a=r==null?void 0:e(r,s);return a===void 0?o:a}return gm=t,gm}var vm,dS;function W5(){if(dS)return vm;dS=1;function e(t,r){return t!=null&&r in Object(t)}return vm=e,vm}var ym,fS;function zT(){if(fS)return ym;fS=1;var e=Ic(),t=ol(),r=Ct(),s=Nc(),o=g0(),a=ll();function u(c,f,p){f=e(f,c);for(var d=-1,g=f.length,y=!1;++d<g;){var w=a(f[d]);if(!(y=c!=null&&p(c,w)))break;c=c[w]}return y||++d!=g?y:(g=c==null?0:c.length,!!g&&o(g)&&s(w,g)&&(r(c)||t(c)))}return ym=u,ym}var wm,hS;function BT(){if(hS)return wm;hS=1;var e=W5(),t=zT();function r(s,o){return s!=null&&t(s,o,e)}return wm=r,wm}var xm,pS;function V5(){if(pS)return xm;pS=1;var e=$T(),t=H5(),r=BT(),s=N0(),o=qT(),a=DT(),u=ll(),c=1,f=2;function p(d,g){return s(d)&&o(g)?a(u(d),g):function(y){var w=t(y,d);return w===void 0&&w===g?r(y,d):e(g,w,c|f)}}return xm=p,xm}var _m,mS;function UT(){if(mS)return _m;mS=1;function e(t){return function(r){return r==null?void 0:r[t]}}return _m=e,_m}var bm,gS;function G5(){if(gS)return bm;gS=1;var e=Mc();function t(r){return function(s){return e(s,r)}}return bm=t,bm}var km,vS;function Y5(){if(vS)return km;vS=1;var e=UT(),t=G5(),r=N0(),s=ll();function o(a){return r(a)?e(s(a)):t(a)}return km=o,km}var Sm,yS;function Qr(){if(yS)return Sm;yS=1;var e=D5(),t=V5(),r=fi(),s=Ct(),o=Y5();function a(u){return typeof u=="function"?u:u==null?r:typeof u=="object"?s(u)?t(u[0],u[1]):e(u):o(u)}return Sm=a,Sm}var Em,wS;function HT(){if(wS)return Em;wS=1;var e=xT(),t=T5(),r=Qr(),s=Ct();function o(a,u){var c=s(a)?e:t;return c(a,r(u,3))}return Em=o,Em}var Nm,xS;function K5(){if(xS)return Nm;xS=1;var e=Object.prototype,t=e.hasOwnProperty;function r(s,o){return s!=null&&t.call(s,o)}return Nm=r,Nm}var Cm,_S;function WT(){if(_S)return Cm;_S=1;var e=K5(),t=zT();function r(s,o){return s!=null&&t(s,o,e)}return Cm=r,Cm}var jm,bS;function X5(){if(bS)return jm;bS=1;var e=y0(),t=To(),r=ol(),s=Ct(),o=Xr(),a=jo(),u=jc(),c=al(),f="[object Map]",p="[object Set]",d=Object.prototype,g=d.hasOwnProperty;function y(w){if(w==null)return!0;if(o(w)&&(s(w)||typeof w=="string"||typeof w.splice=="function"||a(w)||c(w)||r(w)))return!w.length;var S=t(w);if(S==f||S==p)return!w.size;if(u(w))return!e(w).length;for(var _ in w)if(g.call(w,_))return!1;return!0}return jm=y,jm}var Tm,kS;function VT(){if(kS)return Tm;kS=1;function e(t){return t===void 0}return Tm=e,Tm}var Rm,SS;function GT(){if(SS)return Rm;SS=1;var e=Rc(),t=Xr();function r(s,o){var a=-1,u=t(s)?Array(s.length):[];return e(s,function(c,f,p){u[++a]=o(c,f,p)}),u}return Rm=r,Rm}var Am,ES;function YT(){if(ES)return Am;ES=1;var e=Ac(),t=Qr(),r=GT(),s=Ct();function o(a,u){var c=s(a)?e:r;return c(a,t(u,3))}return Am=o,Am}var Im,NS;function Q5(){if(NS)return Im;NS=1;function e(t,r,s,o){var a=-1,u=t==null?0:t.length;for(o&&u&&(s=t[++a]);++a<u;)s=r(s,t[a],a,t);return s}return Im=e,Im}var Mm,CS;function Z5(){if(CS)return Mm;CS=1;function e(t,r,s,o,a){return a(t,function(u,c,f){s=o?(o=!1,u):r(s,u,c,f)}),s}return Mm=e,Mm}var Om,jS;function KT(){if(jS)return Om;jS=1;var e=Q5(),t=Rc(),r=Qr(),s=Z5(),o=Ct();function a(u,c,f){var p=o(u)?e:s,d=arguments.length<3;return p(u,r(c,4),f,d,t)}return Om=a,Om}var Pm,TS;function J5(){if(TS)return Pm;TS=1;var e=ui(),t=Ct(),r=kr(),s="[object String]";function o(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==s}return Pm=o,Pm}var Lm,RS;function eF(){if(RS)return Lm;RS=1;var e=UT(),t=e("length");return Lm=t,Lm}var $m,AS;function tF(){if(AS)return $m;AS=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=t+r+s,a="\\ufe0e\\ufe0f",u="\\u200d",c=RegExp("["+u+e+o+a+"]");function f(p){return c.test(p)}return $m=f,$m}var qm,IS;function nF(){if(IS)return qm;IS=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=t+r+s,a="\\ufe0e\\ufe0f",u="["+e+"]",c="["+o+"]",f="\\ud83c[\\udffb-\\udfff]",p="(?:"+c+"|"+f+")",d="[^"+e+"]",g="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",w="\\u200d",S=p+"?",_="["+a+"]?",b="(?:"+w+"(?:"+[d,g,y].join("|")+")"+_+S+")*",k=_+S+b,E="(?:"+[d+c+"?",c,g,y,u].join("|")+")",C=RegExp(f+"(?="+f+")|"+E+k,"g");function T(A){for(var L=C.lastIndex=0;C.test(A);)++L;return L}return qm=T,qm}var Dm,MS;function rF(){if(MS)return Dm;MS=1;var e=eF(),t=tF(),r=nF();function s(o){return t(o)?r(o):e(o)}return Dm=s,Dm}var Fm,OS;function sF(){if(OS)return Fm;OS=1;var e=y0(),t=To(),r=Xr(),s=J5(),o=rF(),a="[object Map]",u="[object Set]";function c(f){if(f==null)return 0;if(r(f))return s(f)?o(f):f.length;var p=t(f);return p==a||p==u?f.size:e(f).length}return Fm=c,Fm}var zm,PS;function iF(){if(PS)return zm;PS=1;var e=m0(),t=jT(),r=S0(),s=Qr(),o=Tc(),a=Ct(),u=jo(),c=sl(),f=Dn(),p=al();function d(g,y,w){var S=a(g),_=S||u(g)||p(g);if(y=s(y,4),w==null){var b=g&&g.constructor;_?w=S?new b:[]:f(g)?w=c(b)?t(o(g)):{}:w={}}return(_?e:r)(g,function(k,E,C){return y(w,k,E,C)}),w}return zm=d,zm}var Bm,LS;function oF(){if(LS)return Bm;LS=1;var e=Co(),t=ol(),r=Ct(),s=e?e.isConcatSpreadable:void 0;function o(a){return r(a)||t(a)||!!(s&&a&&a[s])}return Bm=o,Bm}var Um,$S;function C0(){if($S)return Um;$S=1;var e=x0(),t=oF();function r(s,o,a,u,c){var f=-1,p=s.length;for(a||(a=t),c||(c=[]);++f<p;){var d=s[f];o>0&&a(d)?o>1?r(d,o-1,a,u,c):e(c,d):u||(c[c.length]=d)}return c}return Um=r,Um}var Hm,qS;function aF(){if(qS)return Hm;qS=1;function e(t,r,s){switch(s.length){case 0:return t.call(r);case 1:return t.call(r,s[0]);case 2:return t.call(r,s[0],s[1]);case 3:return t.call(r,s[0],s[1],s[2])}return t.apply(r,s)}return Hm=e,Hm}var Wm,DS;function XT(){if(DS)return Wm;DS=1;var e=aF(),t=Math.max;function r(s,o,a){return o=t(o===void 0?s.length-1:o,0),function(){for(var u=arguments,c=-1,f=t(u.length-o,0),p=Array(f);++c<f;)p[c]=u[o+c];c=-1;for(var d=Array(o+1);++c<o;)d[c]=u[c];return d[o]=a(p),e(s,this,d)}}return Wm=r,Wm}var Vm,FS;function lF(){if(FS)return Vm;FS=1;var e=b0(),t=mT(),r=fi(),s=t?function(o,a){return t(o,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:r;return Vm=s,Vm}var Gm,zS;function uF(){if(zS)return Gm;zS=1;var e=800,t=16,r=Date.now;function s(o){var a=0,u=0;return function(){var c=r(),f=t-(c-u);if(u=c,f>0){if(++a>=e)return arguments[0]}else a=0;return o.apply(void 0,arguments)}}return Gm=s,Gm}var Ym,BS;function QT(){if(BS)return Ym;BS=1;var e=lF(),t=uF(),r=t(e);return Ym=r,Ym}var Km,US;function Oc(){if(US)return Km;US=1;var e=fi(),t=XT(),r=QT();function s(o,a){return r(t(o,a,e),o+"")}return Km=s,Km}var Xm,HS;function ZT(){if(HS)return Xm;HS=1;function e(t,r,s,o){for(var a=t.length,u=s+(o?1:-1);o?u--:++u<a;)if(r(t[u],u,t))return u;return-1}return Xm=e,Xm}var Qm,WS;function cF(){if(WS)return Qm;WS=1;function e(t){return t!==t}return Qm=e,Qm}var Zm,VS;function dF(){if(VS)return Zm;VS=1;function e(t,r,s){for(var o=s-1,a=t.length;++o<a;)if(t[o]===r)return o;return-1}return Zm=e,Zm}var Jm,GS;function fF(){if(GS)return Jm;GS=1;var e=ZT(),t=cF(),r=dF();function s(o,a,u){return a===a?r(o,a,u):e(o,t,u)}return Jm=s,Jm}var eg,YS;function hF(){if(YS)return eg;YS=1;var e=fF();function t(r,s){var o=r==null?0:r.length;return!!o&&e(r,s,0)>-1}return eg=t,eg}var tg,KS;function pF(){if(KS)return tg;KS=1;function e(t,r,s){for(var o=-1,a=t==null?0:t.length;++o<a;)if(s(r,t[o]))return!0;return!1}return tg=e,tg}var ng,XS;function mF(){if(XS)return ng;XS=1;function e(){}return ng=e,ng}var rg,QS;function gF(){if(QS)return rg;QS=1;var e=ET(),t=mF(),r=E0(),s=1/0,o=e&&1/r(new e([,-0]))[1]==s?function(a){return new e(a)}:t;return rg=o,rg}var sg,ZS;function vF(){if(ZS)return sg;ZS=1;var e=OT(),t=hF(),r=pF(),s=PT(),o=gF(),a=E0(),u=200;function c(f,p,d){var g=-1,y=t,w=f.length,S=!0,_=[],b=_;if(d)S=!1,y=r;else if(w>=u){var k=p?null:o(f);if(k)return a(k);S=!1,y=s,b=new e}else b=p?[]:_;e:for(;++g<w;){var E=f[g],C=p?p(E):E;if(E=d||E!==0?E:0,S&&C===C){for(var T=b.length;T--;)if(b[T]===C)continue e;p&&b.push(C),_.push(E)}else y(b,C,d)||(b!==_&&b.push(C),_.push(E))}return _}return sg=c,sg}var ig,JS;function JT(){if(JS)return ig;JS=1;var e=Xr(),t=kr();function r(s){return t(s)&&e(s)}return ig=r,ig}var og,eE;function yF(){if(eE)return og;eE=1;var e=C0(),t=Oc(),r=vF(),s=JT(),o=t(function(a){return r(e(a,1,s,!0))});return og=o,og}var ag,tE;function wF(){if(tE)return ag;tE=1;var e=Ac();function t(r,s){return e(s,function(o){return r[o]})}return ag=t,ag}var lg,nE;function eR(){if(nE)return lg;nE=1;var e=wF(),t=Ts();function r(s){return s==null?[]:e(s,t(s))}return lg=r,lg}var ug,rE;function Fn(){if(rE)return ug;rE=1;var e;if(typeof f0=="function")try{e={clone:N5(),constant:b0(),each:MT(),filter:HT(),has:WT(),isArray:Ct(),isEmpty:X5(),isFunction:sl(),isUndefined:VT(),keys:Ts(),map:YT(),reduce:KT(),size:sF(),transform:iF(),union:yF(),values:eR()}}catch{}return e||(e=window._),ug=e,ug}var cg,sE;function j0(){if(sE)return cg;sE=1;var e=Fn();cg=o;var t="\0",r="\0",s="";function o(d){this._isDirected=e.has(d,"directed")?d.directed:!0,this._isMultigraph=e.has(d,"multigraph")?d.multigraph:!1,this._isCompound=e.has(d,"compound")?d.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[r]={}),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(d){return this._label=d,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(d){return e.isFunction(d)||(d=e.constant(d)),this._defaultNodeLabelFn=d,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return e.keys(this._nodes)},o.prototype.sources=function(){var d=this;return e.filter(this.nodes(),function(g){return e.isEmpty(d._in[g])})},o.prototype.sinks=function(){var d=this;return e.filter(this.nodes(),function(g){return e.isEmpty(d._out[g])})},o.prototype.setNodes=function(d,g){var y=arguments,w=this;return e.each(d,function(S){y.length>1?w.setNode(S,g):w.setNode(S)}),this},o.prototype.setNode=function(d,g){return e.has(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=g),this):(this._nodes[d]=arguments.length>1?g:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=r,this._children[d]={},this._children[r][d]=!0),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)},o.prototype.node=function(d){return this._nodes[d]},o.prototype.hasNode=function(d){return e.has(this._nodes,d)},o.prototype.removeNode=function(d){var g=this;if(e.has(this._nodes,d)){var y=function(w){g.removeEdge(g._edgeObjs[w])};delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],e.each(this.children(d),function(w){g.setParent(w)}),delete this._children[d]),e.each(e.keys(this._in[d]),y),delete this._in[d],delete this._preds[d],e.each(e.keys(this._out[d]),y),delete this._out[d],delete this._sucs[d],--this._nodeCount}return this},o.prototype.setParent=function(d,g){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(g))g=r;else{g+="";for(var y=g;!e.isUndefined(y);y=this.parent(y))if(y===d)throw new Error("Setting "+g+" as parent of "+d+" would create a cycle");this.setNode(g)}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=g,this._children[g][d]=!0,this},o.prototype._removeFromParentsChildList=function(d){delete this._children[this._parent[d]][d]},o.prototype.parent=function(d){if(this._isCompound){var g=this._parent[d];if(g!==r)return g}},o.prototype.children=function(d){if(e.isUndefined(d)&&(d=r),this._isCompound){var g=this._children[d];if(g)return e.keys(g)}else{if(d===r)return this.nodes();if(this.hasNode(d))return[]}},o.prototype.predecessors=function(d){var g=this._preds[d];if(g)return e.keys(g)},o.prototype.successors=function(d){var g=this._sucs[d];if(g)return e.keys(g)},o.prototype.neighbors=function(d){var g=this.predecessors(d);if(g)return e.union(g,this.successors(d))},o.prototype.isLeaf=function(d){var g;return this.isDirected()?g=this.successors(d):g=this.neighbors(d),g.length===0},o.prototype.filterNodes=function(d){var g=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});g.setGraph(this.graph());var y=this;e.each(this._nodes,function(_,b){d(b)&&g.setNode(b,_)}),e.each(this._edgeObjs,function(_){g.hasNode(_.v)&&g.hasNode(_.w)&&g.setEdge(_,y.edge(_))});var w={};function S(_){var b=y.parent(_);return b===void 0||g.hasNode(b)?(w[_]=b,b):b in w?w[b]:S(b)}return this._isCompound&&e.each(g.nodes(),function(_){g.setParent(_,S(_))}),g},o.prototype.setDefaultEdgeLabel=function(d){return e.isFunction(d)||(d=e.constant(d)),this._defaultEdgeLabelFn=d,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return e.values(this._edgeObjs)},o.prototype.setPath=function(d,g){var y=this,w=arguments;return e.reduce(d,function(S,_){return w.length>1?y.setEdge(S,_,g):y.setEdge(S,_),_}),this},o.prototype.setEdge=function(){var d,g,y,w,S=!1,_=arguments[0];typeof _=="object"&&_!==null&&"v"in _?(d=_.v,g=_.w,y=_.name,arguments.length===2&&(w=arguments[1],S=!0)):(d=_,g=arguments[1],y=arguments[3],arguments.length>2&&(w=arguments[2],S=!0)),d=""+d,g=""+g,e.isUndefined(y)||(y=""+y);var b=c(this._isDirected,d,g,y);if(e.has(this._edgeLabels,b))return S&&(this._edgeLabels[b]=w),this;if(!e.isUndefined(y)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(g),this._edgeLabels[b]=S?w:this._defaultEdgeLabelFn(d,g,y);var k=f(this._isDirected,d,g,y);return d=k.v,g=k.w,Object.freeze(k),this._edgeObjs[b]=k,a(this._preds[g],d),a(this._sucs[d],g),this._in[g][b]=k,this._out[d][b]=k,this._edgeCount++,this},o.prototype.edge=function(d,g,y){var w=arguments.length===1?p(this._isDirected,arguments[0]):c(this._isDirected,d,g,y);return this._edgeLabels[w]},o.prototype.hasEdge=function(d,g,y){var w=arguments.length===1?p(this._isDirected,arguments[0]):c(this._isDirected,d,g,y);return e.has(this._edgeLabels,w)},o.prototype.removeEdge=function(d,g,y){var w=arguments.length===1?p(this._isDirected,arguments[0]):c(this._isDirected,d,g,y),S=this._edgeObjs[w];return S&&(d=S.v,g=S.w,delete this._edgeLabels[w],delete this._edgeObjs[w],u(this._preds[g],d),u(this._sucs[d],g),delete this._in[g][w],delete this._out[d][w],this._edgeCount--),this},o.prototype.inEdges=function(d,g){var y=this._in[d];if(y){var w=e.values(y);return g?e.filter(w,function(S){return S.v===g}):w}},o.prototype.outEdges=function(d,g){var y=this._out[d];if(y){var w=e.values(y);return g?e.filter(w,function(S){return S.w===g}):w}},o.prototype.nodeEdges=function(d,g){var y=this.inEdges(d,g);if(y)return y.concat(this.outEdges(d,g))};function a(d,g){d[g]?d[g]++:d[g]=1}function u(d,g){--d[g]||delete d[g]}function c(d,g,y,w){var S=""+g,_=""+y;if(!d&&S>_){var b=S;S=_,_=b}return S+s+_+s+(e.isUndefined(w)?t:w)}function f(d,g,y,w){var S=""+g,_=""+y;if(!d&&S>_){var b=S;S=_,_=b}var k={v:S,w:_};return w&&(k.name=w),k}function p(d,g){return c(d,g.v,g.w,g.name)}return cg}var dg,iE;function xF(){return iE||(iE=1,dg="2.1.8"),dg}var fg,oE;function _F(){return oE||(oE=1,fg={Graph:j0(),version:xF()}),fg}var hg,aE;function bF(){if(aE)return hg;aE=1;var e=Fn(),t=j0();hg={write:r,read:a};function r(u){var c={options:{directed:u.isDirected(),multigraph:u.isMultigraph(),compound:u.isCompound()},nodes:s(u),edges:o(u)};return e.isUndefined(u.graph())||(c.value=e.clone(u.graph())),c}function s(u){return e.map(u.nodes(),function(c){var f=u.node(c),p=u.parent(c),d={v:c};return e.isUndefined(f)||(d.value=f),e.isUndefined(p)||(d.parent=p),d})}function o(u){return e.map(u.edges(),function(c){var f=u.edge(c),p={v:c.v,w:c.w};return e.isUndefined(c.name)||(p.name=c.name),e.isUndefined(f)||(p.value=f),p})}function a(u){var c=new t(u.options).setGraph(u.value);return e.each(u.nodes,function(f){c.setNode(f.v,f.value),f.parent&&c.setParent(f.v,f.parent)}),e.each(u.edges,function(f){c.setEdge({v:f.v,w:f.w,name:f.name},f.value)}),c}return hg}var pg,lE;function kF(){if(lE)return pg;lE=1;var e=Fn();pg=t;function t(r){var s={},o=[],a;function u(c){e.has(s,c)||(s[c]=!0,a.push(c),e.each(r.successors(c),u),e.each(r.predecessors(c),u))}return e.each(r.nodes(),function(c){a=[],u(c),a.length&&o.push(a)}),o}return pg}var mg,uE;function tR(){if(uE)return mg;uE=1;var e=Fn();mg=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(r){return r.key})},t.prototype.has=function(r){return e.has(this._keyIndices,r)},t.prototype.priority=function(r){var s=this._keyIndices[r];if(s!==void 0)return this._arr[s].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(r,s){var o=this._keyIndices;if(r=String(r),!e.has(o,r)){var a=this._arr,u=a.length;return o[r]=u,a.push({key:r,priority:s}),this._decrease(u),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},t.prototype.decrease=function(r,s){var o=this._keyIndices[r];if(s>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[o].priority+" New: "+s);this._arr[o].priority=s,this._decrease(o)},t.prototype._heapify=function(r){var s=this._arr,o=2*r,a=o+1,u=r;o<s.length&&(u=s[o].priority<s[u].priority?o:u,a<s.length&&(u=s[a].priority<s[u].priority?a:u),u!==r&&(this._swap(r,u),this._heapify(u)))},t.prototype._decrease=function(r){for(var s=this._arr,o=s[r].priority,a;r!==0&&(a=r>>1,!(s[a].priority<o));)this._swap(r,a),r=a},t.prototype._swap=function(r,s){var o=this._arr,a=this._keyIndices,u=o[r],c=o[s];o[r]=c,o[s]=u,a[c.key]=r,a[u.key]=s},mg}var gg,cE;function nR(){if(cE)return gg;cE=1;var e=Fn(),t=tR();gg=s;var r=e.constant(1);function s(a,u,c,f){return o(a,String(u),c||r,f||function(p){return a.outEdges(p)})}function o(a,u,c,f){var p={},d=new t,g,y,w=function(S){var _=S.v!==g?S.v:S.w,b=p[_],k=c(S),E=y.distance+k;if(k<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+S+" Weight: "+k);E<b.distance&&(b.distance=E,b.predecessor=g,d.decrease(_,E))};for(a.nodes().forEach(function(S){var _=S===u?0:Number.POSITIVE_INFINITY;p[S]={distance:_},d.add(S,_)});d.size()>0&&(g=d.removeMin(),y=p[g],y.distance!==Number.POSITIVE_INFINITY);)f(g).forEach(w);return p}return gg}var vg,dE;function SF(){if(dE)return vg;dE=1;var e=nR(),t=Fn();vg=r;function r(s,o,a){return t.transform(s.nodes(),function(u,c){u[c]=e(s,c,o,a)},{})}return vg}var yg,fE;function rR(){if(fE)return yg;fE=1;var e=Fn();yg=t;function t(r){var s=0,o=[],a={},u=[];function c(f){var p=a[f]={onStack:!0,lowlink:s,index:s++};if(o.push(f),r.successors(f).forEach(function(y){e.has(a,y)?a[y].onStack&&(p.lowlink=Math.min(p.lowlink,a[y].index)):(c(y),p.lowlink=Math.min(p.lowlink,a[y].lowlink))}),p.lowlink===p.index){var d=[],g;do g=o.pop(),a[g].onStack=!1,d.push(g);while(f!==g);u.push(d)}}return r.nodes().forEach(function(f){e.has(a,f)||c(f)}),u}return yg}var wg,hE;function EF(){if(hE)return wg;hE=1;var e=Fn(),t=rR();wg=r;function r(s){return e.filter(t(s),function(o){return o.length>1||o.length===1&&s.hasEdge(o[0],o[0])})}return wg}var xg,pE;function NF(){if(pE)return xg;pE=1;var e=Fn();xg=r;var t=e.constant(1);function r(o,a,u){return s(o,a||t,u||function(c){return o.outEdges(c)})}function s(o,a,u){var c={},f=o.nodes();return f.forEach(function(p){c[p]={},c[p][p]={distance:0},f.forEach(function(d){p!==d&&(c[p][d]={distance:Number.POSITIVE_INFINITY})}),u(p).forEach(function(d){var g=d.v===p?d.w:d.v,y=a(d);c[p][g]={distance:y,predecessor:p}})}),f.forEach(function(p){var d=c[p];f.forEach(function(g){var y=c[g];f.forEach(function(w){var S=y[p],_=d[w],b=y[w],k=S.distance+_.distance;k<b.distance&&(b.distance=k,b.predecessor=_.predecessor)})})}),c}return xg}var _g,mE;function sR(){if(mE)return _g;mE=1;var e=Fn();_g=t,t.CycleException=r;function t(s){var o={},a={},u=[];function c(f){if(e.has(a,f))throw new r;e.has(o,f)||(a[f]=!0,o[f]=!0,e.each(s.predecessors(f),c),delete a[f],u.push(f))}if(e.each(s.sinks(),c),e.size(o)!==s.nodeCount())throw new r;return u}function r(){}return r.prototype=new Error,_g}var bg,gE;function CF(){if(gE)return bg;gE=1;var e=sR();bg=t;function t(r){try{e(r)}catch(s){if(s instanceof e.CycleException)return!1;throw s}return!0}return bg}var kg,vE;function iR(){if(vE)return kg;vE=1;var e=Fn();kg=t;function t(s,o,a){e.isArray(o)||(o=[o]);var u=(s.isDirected()?s.successors:s.neighbors).bind(s),c=[],f={};return e.each(o,function(p){if(!s.hasNode(p))throw new Error("Graph does not have node: "+p);r(s,p,a==="post",f,u,c)}),c}function r(s,o,a,u,c,f){e.has(u,o)||(u[o]=!0,a||f.push(o),e.each(c(o),function(p){r(s,p,a,u,c,f)}),a&&f.push(o))}return kg}var Sg,yE;function jF(){if(yE)return Sg;yE=1;var e=iR();Sg=t;function t(r,s){return e(r,s,"post")}return Sg}var Eg,wE;function TF(){if(wE)return Eg;wE=1;var e=iR();Eg=t;function t(r,s){return e(r,s,"pre")}return Eg}var Ng,xE;function RF(){if(xE)return Ng;xE=1;var e=Fn(),t=j0(),r=tR();Ng=s;function s(o,a){var u=new t,c={},f=new r,p;function d(y){var w=y.v===p?y.w:y.v,S=f.priority(w);if(S!==void 0){var _=a(y);_<S&&(c[w]=p,f.decrease(w,_))}}if(o.nodeCount()===0)return u;e.each(o.nodes(),function(y){f.add(y,Number.POSITIVE_INFINITY),u.setNode(y)}),f.decrease(o.nodes()[0],0);for(var g=!1;f.size()>0;){if(p=f.removeMin(),e.has(c,p))u.setEdge(p,c[p]);else{if(g)throw new Error("Input graph is not connected: "+o);g=!0}o.nodeEdges(p).forEach(d)}return u}return Ng}var Cg,_E;function AF(){return _E||(_E=1,Cg={components:kF(),dijkstra:nR(),dijkstraAll:SF(),findCycles:EF(),floydWarshall:NF(),isAcyclic:CF(),postorder:jF(),preorder:TF(),prim:RF(),tarjan:rR(),topsort:sR()}),Cg}var jg,bE;function IF(){if(bE)return jg;bE=1;var e=_F();return jg={Graph:e.Graph,json:bF(),alg:AF(),version:e.version},jg}var Tg,kE;function ir(){if(kE)return Tg;kE=1;var e;if(typeof f0=="function")try{e=IF()}catch{}return e||(e=window.graphlib),Tg=e,Tg}var Rg,SE;function MF(){if(SE)return Rg;SE=1;var e=RT(),t=1,r=4;function s(o){return e(o,t|r)}return Rg=s,Rg}var Ag,EE;function Pc(){if(EE)return Ag;EE=1;var e=No(),t=Xr(),r=Nc(),s=Dn();function o(a,u,c){if(!s(c))return!1;var f=typeof u;return(f=="number"?t(c)&&r(u,c.length):f=="string"&&u in c)?e(c[u],a):!1}return Ag=o,Ag}var Ig,NE;function OF(){if(NE)return Ig;NE=1;var e=Oc(),t=No(),r=Pc(),s=di(),o=Object.prototype,a=o.hasOwnProperty,u=e(function(c,f){c=Object(c);var p=-1,d=f.length,g=d>2?f[2]:void 0;for(g&&r(f[0],f[1],g)&&(d=1);++p<d;)for(var y=f[p],w=s(y),S=-1,_=w.length;++S<_;){var b=w[S],k=c[b];(k===void 0||t(k,o[b])&&!a.call(c,b))&&(c[b]=y[b])}return c});return Ig=u,Ig}var Mg,CE;function PF(){if(CE)return Mg;CE=1;var e=Qr(),t=Xr(),r=Ts();function s(o){return function(a,u,c){var f=Object(a);if(!t(a)){var p=e(u,3);a=r(a),u=function(g){return p(f[g],g,f)}}var d=o(a,u,c);return d>-1?f[p?a[d]:d]:void 0}}return Mg=s,Mg}var Og,jE;function LF(){if(jE)return Og;jE=1;var e=/\s/;function t(r){for(var s=r.length;s--&&e.test(r.charAt(s)););return s}return Og=t,Og}var Pg,TE;function $F(){if(TE)return Pg;TE=1;var e=LF(),t=/^\s+/;function r(s){return s&&s.slice(0,e(s)+1).replace(t,"")}return Pg=r,Pg}var Lg,RE;function qF(){if(RE)return Lg;RE=1;var e=$F(),t=Dn(),r=Ro(),s=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;function f(p){if(typeof p=="number")return p;if(r(p))return s;if(t(p)){var d=typeof p.valueOf=="function"?p.valueOf():p;p=t(d)?d+"":d}if(typeof p!="string")return p===0?p:+p;p=e(p);var g=a.test(p);return g||u.test(p)?c(p.slice(2),g?2:8):o.test(p)?s:+p}return Lg=f,Lg}var $g,AE;function oR(){if(AE)return $g;AE=1;var e=qF(),t=1/0,r=17976931348623157e292;function s(o){if(!o)return o===0?o:0;if(o=e(o),o===t||o===-t){var a=o<0?-1:1;return a*r}return o===o?o:0}return $g=s,$g}var qg,IE;function DF(){if(IE)return qg;IE=1;var e=oR();function t(r){var s=e(r),o=s%1;return s===s?o?s-o:s:0}return qg=t,qg}var Dg,ME;function FF(){if(ME)return Dg;ME=1;var e=ZT(),t=Qr(),r=DF(),s=Math.max;function o(a,u,c){var f=a==null?0:a.length;if(!f)return-1;var p=c==null?0:r(c);return p<0&&(p=s(f+p,0)),e(a,t(u,3),p)}return Dg=o,Dg}var Fg,OE;function zF(){if(OE)return Fg;OE=1;var e=PF(),t=FF(),r=e(t);return Fg=r,Fg}var zg,PE;function aR(){if(PE)return zg;PE=1;var e=C0();function t(r){var s=r==null?0:r.length;return s?e(r,1):[]}return zg=t,zg}var Bg,LE;function BF(){if(LE)return Bg;LE=1;var e=k0(),t=AT(),r=di();function s(o,a){return o==null?o:e(o,t(a),r)}return Bg=s,Bg}var Ug,$E;function UF(){if($E)return Ug;$E=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Ug=e,Ug}var Hg,qE;function HF(){if(qE)return Hg;qE=1;var e=Sc(),t=S0(),r=Qr();function s(o,a){var u={};return a=r(a,3),t(o,function(c,f,p){e(u,f,a(c,f,p))}),u}return Hg=s,Hg}var Wg,DE;function T0(){if(DE)return Wg;DE=1;var e=Ro();function t(r,s,o){for(var a=-1,u=r.length;++a<u;){var c=r[a],f=s(c);if(f!=null&&(p===void 0?f===f&&!e(f):o(f,p)))var p=f,d=c}return d}return Wg=t,Wg}var Vg,FE;function WF(){if(FE)return Vg;FE=1;function e(t,r){return t>r}return Vg=e,Vg}var Gg,zE;function VF(){if(zE)return Gg;zE=1;var e=T0(),t=WF(),r=fi();function s(o){return o&&o.length?e(o,r,t):void 0}return Gg=s,Gg}var Yg,BE;function lR(){if(BE)return Yg;BE=1;var e=Sc(),t=No();function r(s,o,a){(a!==void 0&&!t(s[o],a)||a===void 0&&!(o in s))&&e(s,o,a)}return Yg=r,Yg}var Kg,UE;function GF(){if(UE)return Kg;UE=1;var e=ui(),t=Tc(),r=kr(),s="[object Object]",o=Function.prototype,a=Object.prototype,u=o.toString,c=a.hasOwnProperty,f=u.call(Object);function p(d){if(!r(d)||e(d)!=s)return!1;var g=t(d);if(g===null)return!0;var y=c.call(g,"constructor")&&g.constructor;return typeof y=="function"&&y instanceof y&&u.call(y)==f}return Kg=p,Kg}var Xg,HE;function uR(){if(HE)return Xg;HE=1;function e(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}return Xg=e,Xg}var Qg,WE;function YF(){if(WE)return Qg;WE=1;var e=il(),t=di();function r(s){return e(s,t(s))}return Qg=r,Qg}var Zg,VE;function KF(){if(VE)return Zg;VE=1;var e=lR(),t=yT(),r=CT(),s=wT(),o=TT(),a=ol(),u=Ct(),c=JT(),f=jo(),p=sl(),d=Dn(),g=GF(),y=al(),w=uR(),S=YF();function _(b,k,E,C,T,A,L){var P=w(b,E),U=w(k,E),O=L.get(U);if(O){e(b,E,O);return}var M=A?A(P,U,E+"",b,k,L):void 0,q=M===void 0;if(q){var V=u(U),X=!V&&f(U),j=!V&&!X&&y(U);M=U,V||X||j?u(P)?M=P:c(P)?M=s(P):X?(q=!1,M=t(U,!0)):j?(q=!1,M=r(U,!0)):M=[]:g(U)||a(U)?(M=P,a(P)?M=S(P):(!d(P)||p(P))&&(M=o(U))):q=!1}q&&(L.set(U,M),T(M,U,C,A,L),L.delete(U)),e(b,E,M)}return Zg=_,Zg}var Jg,GE;function XF(){if(GE)return Jg;GE=1;var e=kc(),t=lR(),r=k0(),s=KF(),o=Dn(),a=di(),u=uR();function c(f,p,d,g,y){f!==p&&r(p,function(w,S){if(y||(y=new e),o(w))s(f,p,S,d,c,g,y);else{var _=g?g(u(f,S),w,S+"",f,p,y):void 0;_===void 0&&(_=w),t(f,S,_)}},a)}return Jg=c,Jg}var ev,YE;function QF(){if(YE)return ev;YE=1;var e=Oc(),t=Pc();function r(s){return e(function(o,a){var u=-1,c=a.length,f=c>1?a[c-1]:void 0,p=c>2?a[2]:void 0;for(f=s.length>3&&typeof f=="function"?(c--,f):void 0,p&&t(a[0],a[1],p)&&(f=c<3?void 0:f,c=1),o=Object(o);++u<c;){var d=a[u];d&&s(o,d,u,f)}return o})}return ev=r,ev}var tv,KE;function ZF(){if(KE)return tv;KE=1;var e=XF(),t=QF(),r=t(function(s,o,a){e(s,o,a)});return tv=r,tv}var nv,XE;function cR(){if(XE)return nv;XE=1;function e(t,r){return t<r}return nv=e,nv}var rv,QE;function JF(){if(QE)return rv;QE=1;var e=T0(),t=cR(),r=fi();function s(o){return o&&o.length?e(o,r,t):void 0}return rv=s,rv}var sv,ZE;function ez(){if(ZE)return sv;ZE=1;var e=T0(),t=Qr(),r=cR();function s(o,a){return o&&o.length?e(o,t(a,2),r):void 0}return sv=s,sv}var iv,JE;function tz(){if(JE)return iv;JE=1;var e=ar(),t=function(){return e.Date.now()};return iv=t,iv}var ov,eN;function nz(){if(eN)return ov;eN=1;var e=Ec(),t=Ic(),r=Nc(),s=Dn(),o=ll();function a(u,c,f,p){if(!s(u))return u;c=t(c,u);for(var d=-1,g=c.length,y=g-1,w=u;w!=null&&++d<g;){var S=o(c[d]),_=f;if(S==="__proto__"||S==="constructor"||S==="prototype")return u;if(d!=y){var b=w[S];_=p?p(b,S,w):void 0,_===void 0&&(_=s(b)?b:r(c[d+1])?[]:{})}e(w,S,_),w=w[S]}return u}return ov=a,ov}var av,tN;function rz(){if(tN)return av;tN=1;var e=Mc(),t=nz(),r=Ic();function s(o,a,u){for(var c=-1,f=a.length,p={};++c<f;){var d=a[c],g=e(o,d);u(g,d)&&t(p,r(d,o),g)}return p}return av=s,av}var lv,nN;function sz(){if(nN)return lv;nN=1;var e=rz(),t=BT();function r(s,o){return e(s,o,function(a,u){return t(s,u)})}return lv=r,lv}var uv,rN;function iz(){if(rN)return uv;rN=1;var e=aR(),t=XT(),r=QT();function s(o){return r(t(o,void 0,e),o+"")}return uv=s,uv}var cv,sN;function oz(){if(sN)return cv;sN=1;var e=sz(),t=iz(),r=t(function(s,o){return s==null?{}:e(s,o)});return cv=r,cv}var dv,iN;function az(){if(iN)return dv;iN=1;var e=Math.ceil,t=Math.max;function r(s,o,a,u){for(var c=-1,f=t(e((o-s)/(a||1)),0),p=Array(f);f--;)p[u?f:++c]=s,s+=a;return p}return dv=r,dv}var fv,oN;function lz(){if(oN)return fv;oN=1;var e=az(),t=Pc(),r=oR();function s(o){return function(a,u,c){return c&&typeof c!="number"&&t(a,u,c)&&(u=c=void 0),a=r(a),u===void 0?(u=a,a=0):u=r(u),c=c===void 0?a<u?1:-1:r(c),e(a,u,c,o)}}return fv=s,fv}var hv,aN;function uz(){if(aN)return hv;aN=1;var e=lz(),t=e();return hv=t,hv}var pv,lN;function cz(){if(lN)return pv;lN=1;function e(t,r){var s=t.length;for(t.sort(r);s--;)t[s]=t[s].value;return t}return pv=e,pv}var mv,uN;function dz(){if(uN)return mv;uN=1;var e=Ro();function t(r,s){if(r!==s){var o=r!==void 0,a=r===null,u=r===r,c=e(r),f=s!==void 0,p=s===null,d=s===s,g=e(s);if(!p&&!g&&!c&&r>s||c&&f&&d&&!p&&!g||a&&f&&d||!o&&d||!u)return 1;if(!a&&!c&&!g&&r<s||g&&o&&u&&!a&&!c||p&&o&&u||!f&&u||!d)return-1}return 0}return mv=t,mv}var gv,cN;function fz(){if(cN)return gv;cN=1;var e=dz();function t(r,s,o){for(var a=-1,u=r.criteria,c=s.criteria,f=u.length,p=o.length;++a<f;){var d=e(u[a],c[a]);if(d){if(a>=p)return d;var g=o[a];return d*(g=="desc"?-1:1)}}return r.index-s.index}return gv=t,gv}var vv,dN;function hz(){if(dN)return vv;dN=1;var e=Ac(),t=Mc(),r=Qr(),s=GT(),o=cz(),a=Cc(),u=fz(),c=fi(),f=Ct();function p(d,g,y){g.length?g=e(g,function(_){return f(_)?function(b){return t(b,_.length===1?_[0]:_)}:_}):g=[c];var w=-1;g=e(g,a(r));var S=s(d,function(_,b,k){var E=e(g,function(C){return C(_)});return{criteria:E,index:++w,value:_}});return o(S,function(_,b){return u(_,b,y)})}return vv=p,vv}var yv,fN;function pz(){if(fN)return yv;fN=1;var e=C0(),t=hz(),r=Oc(),s=Pc(),o=r(function(a,u){if(a==null)return[];var c=u.length;return c>1&&s(a,u[0],u[1])?u=[]:c>2&&s(u[0],u[1],u[2])&&(u=[u[0]]),t(a,e(u,1),[])});return yv=o,yv}var wv,hN;function mz(){if(hN)return wv;hN=1;var e=FT(),t=0;function r(s){var o=++t;return e(s)+o}return wv=r,wv}var xv,pN;function gz(){if(pN)return xv;pN=1;function e(t,r,s){for(var o=-1,a=t.length,u=r.length,c={};++o<a;){var f=o<u?r[o]:void 0;s(c,t[o],f)}return c}return xv=e,xv}var _v,mN;function vz(){if(mN)return _v;mN=1;var e=Ec(),t=gz();function r(s,o){return t(s||[],o||[],e)}return _v=r,_v}var bv,gN;function mt(){if(gN)return bv;gN=1;var e;if(typeof f0=="function")try{e={cloneDeep:MF(),constant:b0(),defaults:OF(),each:MT(),filter:HT(),find:zF(),flatten:aR(),forEach:IT(),forIn:BF(),has:WT(),isUndefined:VT(),last:UF(),map:YT(),mapValues:HF(),max:VF(),merge:ZF(),min:JF(),minBy:ez(),now:tz(),pick:oz(),range:uz(),reduce:KT(),sortBy:pz(),uniqueId:mz(),values:eR(),zipObject:vz()}}catch{}return e||(e=window._),bv=e,bv}var kv,vN;function yz(){if(vN)return kv;vN=1,kv=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 t(o),o},e.prototype.enqueue=function(s){var o=this._sentinel;s._prev&&s._next&&t(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,a=o._prev;a!==o;)s.push(JSON.stringify(a,r)),a=a._prev;return"["+s.join(", ")+"]"};function t(s){s._prev._next=s._next,s._next._prev=s._prev,delete s._next,delete s._prev}function r(s,o){if(s!=="_next"&&s!=="_prev")return o}return kv}var Sv,yN;function wz(){if(yN)return Sv;yN=1;var e=mt(),t=ir().Graph,r=yz();Sv=o;var s=e.constant(1);function o(p,d){if(p.nodeCount()<=1)return[];var g=c(p,d||s),y=a(g.graph,g.buckets,g.zeroIdx);return e.flatten(e.map(y,function(w){return p.outEdges(w.v,w.w)}),!0)}function a(p,d,g){for(var y=[],w=d[d.length-1],S=d[0],_;p.nodeCount();){for(;_=S.dequeue();)u(p,d,g,_);for(;_=w.dequeue();)u(p,d,g,_);if(p.nodeCount()){for(var b=d.length-2;b>0;--b)if(_=d[b].dequeue(),_){y=y.concat(u(p,d,g,_,!0));break}}}return y}function u(p,d,g,y,w){var S=w?[]:void 0;return e.forEach(p.inEdges(y.v),function(_){var b=p.edge(_),k=p.node(_.v);w&&S.push({v:_.v,w:_.w}),k.out-=b,f(d,g,k)}),e.forEach(p.outEdges(y.v),function(_){var b=p.edge(_),k=_.w,E=p.node(k);E.in-=b,f(d,g,E)}),p.removeNode(y.v),S}function c(p,d){var g=new t,y=0,w=0;e.forEach(p.nodes(),function(b){g.setNode(b,{v:b,in:0,out:0})}),e.forEach(p.edges(),function(b){var k=g.edge(b.v,b.w)||0,E=d(b),C=k+E;g.setEdge(b.v,b.w,C),w=Math.max(w,g.node(b.v).out+=E),y=Math.max(y,g.node(b.w).in+=E)});var S=e.range(w+y+3).map(function(){return new r}),_=y+1;return e.forEach(g.nodes(),function(b){f(S,_,g.node(b))}),{graph:g,buckets:S,zeroIdx:_}}function f(p,d,g){g.out?g.in?p[g.out-g.in+d].enqueue(g):p[p.length-1].enqueue(g):p[0].enqueue(g)}return Sv}var Ev,wN;function xz(){if(wN)return Ev;wN=1;var e=mt(),t=wz();Ev={run:r,undo:o};function r(a){var u=a.graph().acyclicer==="greedy"?t(a,c(a)):s(a);e.forEach(u,function(f){var p=a.edge(f);a.removeEdge(f),p.forwardName=f.name,p.reversed=!0,a.setEdge(f.w,f.v,p,e.uniqueId("rev"))});function c(f){return function(p){return f.edge(p).weight}}}function s(a){var u=[],c={},f={};function p(d){e.has(f,d)||(f[d]=!0,c[d]=!0,e.forEach(a.outEdges(d),function(g){e.has(c,g.w)?u.push(g):p(g.w)}),delete c[d])}return e.forEach(a.nodes(),p),u}function o(a){e.forEach(a.edges(),function(u){var c=a.edge(u);if(c.reversed){a.removeEdge(u);var f=c.forwardName;delete c.reversed,delete c.forwardName,a.setEdge(u.w,u.v,c,f)}})}return Ev}var Nv,xN;function cn(){if(xN)return Nv;xN=1;var e=mt(),t=ir().Graph;Nv={addDummyNode:r,simplify:s,asNonCompoundGraph:o,successorWeights:a,predecessorWeights:u,intersectRect:c,buildLayerMatrix:f,normalizeRanks:p,removeEmptyRanks:d,addBorderNode:g,maxRank:y,partition:w,time:S,notime:_};function r(b,k,E,C){var T;do T=e.uniqueId(C);while(b.hasNode(T));return E.dummy=k,b.setNode(T,E),T}function s(b){var k=new t().setGraph(b.graph());return e.forEach(b.nodes(),function(E){k.setNode(E,b.node(E))}),e.forEach(b.edges(),function(E){var C=k.edge(E.v,E.w)||{weight:0,minlen:1},T=b.edge(E);k.setEdge(E.v,E.w,{weight:C.weight+T.weight,minlen:Math.max(C.minlen,T.minlen)})}),k}function o(b){var k=new t({multigraph:b.isMultigraph()}).setGraph(b.graph());return e.forEach(b.nodes(),function(E){b.children(E).length||k.setNode(E,b.node(E))}),e.forEach(b.edges(),function(E){k.setEdge(E,b.edge(E))}),k}function a(b){var k=e.map(b.nodes(),function(E){var C={};return e.forEach(b.outEdges(E),function(T){C[T.w]=(C[T.w]||0)+b.edge(T).weight}),C});return e.zipObject(b.nodes(),k)}function u(b){var k=e.map(b.nodes(),function(E){var C={};return e.forEach(b.inEdges(E),function(T){C[T.v]=(C[T.v]||0)+b.edge(T).weight}),C});return e.zipObject(b.nodes(),k)}function c(b,k){var E=b.x,C=b.y,T=k.x-E,A=k.y-C,L=b.width/2,P=b.height/2;if(!T&&!A)throw new Error("Not possible to find intersection inside of the rectangle");var U,O;return Math.abs(A)*L>Math.abs(T)*P?(A<0&&(P=-P),U=P*T/A,O=P):(T<0&&(L=-L),U=L,O=L*A/T),{x:E+U,y:C+O}}function f(b){var k=e.map(e.range(y(b)+1),function(){return[]});return e.forEach(b.nodes(),function(E){var C=b.node(E),T=C.rank;e.isUndefined(T)||(k[T][C.order]=E)}),k}function p(b){var k=e.min(e.map(b.nodes(),function(E){return b.node(E).rank}));e.forEach(b.nodes(),function(E){var C=b.node(E);e.has(C,"rank")&&(C.rank-=k)})}function d(b){var k=e.min(e.map(b.nodes(),function(A){return b.node(A).rank})),E=[];e.forEach(b.nodes(),function(A){var L=b.node(A).rank-k;E[L]||(E[L]=[]),E[L].push(A)});var C=0,T=b.graph().nodeRankFactor;e.forEach(E,function(A,L){e.isUndefined(A)&&L%T!==0?--C:C&&e.forEach(A,function(P){b.node(P).rank+=C})})}function g(b,k,E,C){var T={width:0,height:0};return arguments.length>=4&&(T.rank=E,T.order=C),r(b,"border",T,k)}function y(b){return e.max(e.map(b.nodes(),function(k){var E=b.node(k).rank;if(!e.isUndefined(E))return E}))}function w(b,k){var E={lhs:[],rhs:[]};return e.forEach(b,function(C){k(C)?E.lhs.push(C):E.rhs.push(C)}),E}function S(b,k){var E=e.now();try{return k()}finally{console.log(b+" time: "+(e.now()-E)+"ms")}}function _(b,k){return k()}return Nv}var Cv,_N;function _z(){if(_N)return Cv;_N=1;var e=mt(),t=cn();Cv={run:r,undo:o};function r(a){a.graph().dummyChains=[],e.forEach(a.edges(),function(u){s(a,u)})}function s(a,u){var c=u.v,f=a.node(c).rank,p=u.w,d=a.node(p).rank,g=u.name,y=a.edge(u),w=y.labelRank;if(d!==f+1){a.removeEdge(u);var S,_,b;for(b=0,++f;f<d;++b,++f)y.points=[],_={width:0,height:0,edgeLabel:y,edgeObj:u,rank:f},S=t.addDummyNode(a,"edge",_,"_d"),f===w&&(_.width=y.width,_.height=y.height,_.dummy="edge-label",_.labelpos=y.labelpos),a.setEdge(c,S,{weight:y.weight},g),b===0&&a.graph().dummyChains.push(S),c=S;a.setEdge(c,p,{weight:y.weight},g)}}function o(a){e.forEach(a.graph().dummyChains,function(u){var c=a.node(u),f=c.edgeLabel,p;for(a.setEdge(c.edgeObj,f);c.dummy;)p=a.successors(u)[0],a.removeNode(u),f.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(f.x=c.x,f.y=c.y,f.width=c.width,f.height=c.height),u=p,c=a.node(u)})}return Cv}var jv,bN;function oc(){if(bN)return jv;bN=1;var e=mt();jv={longestPath:t,slack:r};function t(s){var o={};function a(u){var c=s.node(u);if(e.has(o,u))return c.rank;o[u]=!0;var f=e.min(e.map(s.outEdges(u),function(p){return a(p.w)-s.edge(p).minlen}));return(f===Number.POSITIVE_INFINITY||f===void 0||f===null)&&(f=0),c.rank=f}e.forEach(s.sources(),a)}function r(s,o){return s.node(o.w).rank-s.node(o.v).rank-s.edge(o).minlen}return jv}var Tv,kN;function dR(){if(kN)return Tv;kN=1;var e=mt(),t=ir().Graph,r=oc().slack;Tv=s;function s(c){var f=new t({directed:!1}),p=c.nodes()[0],d=c.nodeCount();f.setNode(p,{});for(var g,y;o(f,c)<d;)g=a(f,c),y=f.hasNode(g.v)?r(c,g):-r(c,g),u(f,c,y);return f}function o(c,f){function p(d){e.forEach(f.nodeEdges(d),function(g){var y=g.v,w=d===y?g.w:y;!c.hasNode(w)&&!r(f,g)&&(c.setNode(w,{}),c.setEdge(d,w,{}),p(w))})}return e.forEach(c.nodes(),p),c.nodeCount()}function a(c,f){return e.minBy(f.edges(),function(p){if(c.hasNode(p.v)!==c.hasNode(p.w))return r(f,p)})}function u(c,f,p){e.forEach(c.nodes(),function(d){f.node(d).rank+=p})}return Tv}var Rv,SN;function bz(){if(SN)return Rv;SN=1;var e=mt(),t=dR(),r=oc().slack,s=oc().longestPath,o=ir().alg.preorder,a=ir().alg.postorder,u=cn().simplify;Rv=c,c.initLowLimValues=g,c.initCutValues=f,c.calcCutValue=d,c.leaveEdge=w,c.enterEdge=S,c.exchangeEdges=_;function c(C){C=u(C),s(C);var T=t(C);g(T),f(T,C);for(var A,L;A=w(T);)L=S(T,C,A),_(T,C,A,L)}function f(C,T){var A=a(C,C.nodes());A=A.slice(0,A.length-1),e.forEach(A,function(L){p(C,T,L)})}function p(C,T,A){var L=C.node(A),P=L.parent;C.edge(A,P).cutvalue=d(C,T,A)}function d(C,T,A){var L=C.node(A),P=L.parent,U=!0,O=T.edge(A,P),M=0;return O||(U=!1,O=T.edge(P,A)),M=O.weight,e.forEach(T.nodeEdges(A),function(q){var V=q.v===A,X=V?q.w:q.v;if(X!==P){var j=V===U,G=T.edge(q).weight;if(M+=j?G:-G,k(C,A,X)){var B=C.edge(A,X).cutvalue;M+=j?-B:B}}}),M}function g(C,T){arguments.length<2&&(T=C.nodes()[0]),y(C,{},1,T)}function y(C,T,A,L,P){var U=A,O=C.node(L);return T[L]=!0,e.forEach(C.neighbors(L),function(M){e.has(T,M)||(A=y(C,T,A,M,L))}),O.low=U,O.lim=A++,P?O.parent=P:delete O.parent,A}function w(C){return e.find(C.edges(),function(T){return C.edge(T).cutvalue<0})}function S(C,T,A){var L=A.v,P=A.w;T.hasEdge(L,P)||(L=A.w,P=A.v);var U=C.node(L),O=C.node(P),M=U,q=!1;U.lim>O.lim&&(M=O,q=!0);var V=e.filter(T.edges(),function(X){return q===E(C,C.node(X.v),M)&&q!==E(C,C.node(X.w),M)});return e.minBy(V,function(X){return r(T,X)})}function _(C,T,A,L){var P=A.v,U=A.w;C.removeEdge(P,U),C.setEdge(L.v,L.w,{}),g(C),f(C,T),b(C,T)}function b(C,T){var A=e.find(C.nodes(),function(P){return!T.node(P).parent}),L=o(C,A);L=L.slice(1),e.forEach(L,function(P){var U=C.node(P).parent,O=T.edge(P,U),M=!1;O||(O=T.edge(U,P),M=!0),T.node(P).rank=T.node(U).rank+(M?O.minlen:-O.minlen)})}function k(C,T,A){return C.hasEdge(T,A)}function E(C,T,A){return A.low<=T.lim&&T.lim<=A.lim}return Rv}var Av,EN;function kz(){if(EN)return Av;EN=1;var e=oc(),t=e.longestPath,r=dR(),s=bz();Av=o;function o(f){switch(f.graph().ranker){case"network-simplex":c(f);break;case"tight-tree":u(f);break;case"longest-path":a(f);break;default:c(f)}}var a=t;function u(f){t(f),r(f)}function c(f){s(f)}return Av}var Iv,NN;function Sz(){if(NN)return Iv;NN=1;var e=mt();Iv=t;function t(o){var a=s(o);e.forEach(o.graph().dummyChains,function(u){for(var c=o.node(u),f=c.edgeObj,p=r(o,a,f.v,f.w),d=p.path,g=p.lca,y=0,w=d[y],S=!0;u!==f.w;){if(c=o.node(u),S){for(;(w=d[y])!==g&&o.node(w).maxRank<c.rank;)y++;w===g&&(S=!1)}if(!S){for(;y<d.length-1&&o.node(w=d[y+1]).minRank<=c.rank;)y++;w=d[y]}o.setParent(u,w),u=o.successors(u)[0]}})}function r(o,a,u,c){var f=[],p=[],d=Math.min(a[u].low,a[c].low),g=Math.max(a[u].lim,a[c].lim),y,w;y=u;do y=o.parent(y),f.push(y);while(y&&(a[y].low>d||g>a[y].lim));for(w=y,y=c;(y=o.parent(y))!==w;)p.push(y);return{path:f.concat(p.reverse()),lca:w}}function s(o){var a={},u=0;function c(f){var p=u;e.forEach(o.children(f),c),a[f]={low:p,lim:u++}}return e.forEach(o.children(),c),a}return Iv}var Mv,CN;function Ez(){if(CN)return Mv;CN=1;var e=mt(),t=cn();Mv={run:r,cleanup:u};function r(c){var f=t.addDummyNode(c,"root",{},"_root"),p=o(c),d=e.max(e.values(p))-1,g=2*d+1;c.graph().nestingRoot=f,e.forEach(c.edges(),function(w){c.edge(w).minlen*=g});var y=a(c)+1;e.forEach(c.children(),function(w){s(c,f,g,y,d,p,w)}),c.graph().nodeRankFactor=g}function s(c,f,p,d,g,y,w){var S=c.children(w);if(!S.length){w!==f&&c.setEdge(f,w,{weight:0,minlen:p});return}var _=t.addBorderNode(c,"_bt"),b=t.addBorderNode(c,"_bb"),k=c.node(w);c.setParent(_,w),k.borderTop=_,c.setParent(b,w),k.borderBottom=b,e.forEach(S,function(E){s(c,f,p,d,g,y,E);var C=c.node(E),T=C.borderTop?C.borderTop:E,A=C.borderBottom?C.borderBottom:E,L=C.borderTop?d:2*d,P=T!==A?1:g-y[w]+1;c.setEdge(_,T,{weight:L,minlen:P,nestingEdge:!0}),c.setEdge(A,b,{weight:L,minlen:P,nestingEdge:!0})}),c.parent(w)||c.setEdge(f,_,{weight:0,minlen:g+y[w]})}function o(c){var f={};function p(d,g){var y=c.children(d);y&&y.length&&e.forEach(y,function(w){p(w,g+1)}),f[d]=g}return e.forEach(c.children(),function(d){p(d,1)}),f}function a(c){return e.reduce(c.edges(),function(f,p){return f+c.edge(p).weight},0)}function u(c){var f=c.graph();c.removeNode(f.nestingRoot),delete f.nestingRoot,e.forEach(c.edges(),function(p){var d=c.edge(p);d.nestingEdge&&c.removeEdge(p)})}return Mv}var Ov,jN;function Nz(){if(jN)return Ov;jN=1;var e=mt(),t=cn();Ov=r;function r(o){function a(u){var c=o.children(u),f=o.node(u);if(c.length&&e.forEach(c,a),e.has(f,"minRank")){f.borderLeft=[],f.borderRight=[];for(var p=f.minRank,d=f.maxRank+1;p<d;++p)s(o,"borderLeft","_bl",u,f,p),s(o,"borderRight","_br",u,f,p)}}e.forEach(o.children(),a)}function s(o,a,u,c,f,p){var d={width:0,height:0,rank:p,borderType:a},g=f[a][p-1],y=t.addDummyNode(o,"border",d,u);f[a][p]=y,o.setParent(y,c),g&&o.setEdge(g,y,{weight:1})}return Ov}var Pv,TN;function Cz(){if(TN)return Pv;TN=1;var e=mt();Pv={adjust:t,undo:r};function t(p){var d=p.graph().rankdir.toLowerCase();(d==="lr"||d==="rl")&&s(p)}function r(p){var d=p.graph().rankdir.toLowerCase();(d==="bt"||d==="rl")&&a(p),(d==="lr"||d==="rl")&&(c(p),s(p))}function s(p){e.forEach(p.nodes(),function(d){o(p.node(d))}),e.forEach(p.edges(),function(d){o(p.edge(d))})}function o(p){var d=p.width;p.width=p.height,p.height=d}function a(p){e.forEach(p.nodes(),function(d){u(p.node(d))}),e.forEach(p.edges(),function(d){var g=p.edge(d);e.forEach(g.points,u),e.has(g,"y")&&u(g)})}function u(p){p.y=-p.y}function c(p){e.forEach(p.nodes(),function(d){f(p.node(d))}),e.forEach(p.edges(),function(d){var g=p.edge(d);e.forEach(g.points,f),e.has(g,"x")&&f(g)})}function f(p){var d=p.x;p.x=p.y,p.y=d}return Pv}var Lv,RN;function jz(){if(RN)return Lv;RN=1;var e=mt();Lv=t;function t(r){var s={},o=e.filter(r.nodes(),function(p){return!r.children(p).length}),a=e.max(e.map(o,function(p){return r.node(p).rank})),u=e.map(e.range(a+1),function(){return[]});function c(p){if(!e.has(s,p)){s[p]=!0;var d=r.node(p);u[d.rank].push(p),e.forEach(r.successors(p),c)}}var f=e.sortBy(o,function(p){return r.node(p).rank});return e.forEach(f,c),u}return Lv}var $v,AN;function Tz(){if(AN)return $v;AN=1;var e=mt();$v=t;function t(s,o){for(var a=0,u=1;u<o.length;++u)a+=r(s,o[u-1],o[u]);return a}function r(s,o,a){for(var u=e.zipObject(a,e.map(a,function(y,w){return w})),c=e.flatten(e.map(o,function(y){return e.sortBy(e.map(s.outEdges(y),function(w){return{pos:u[w.w],weight:s.edge(w).weight}}),"pos")}),!0),f=1;f<a.length;)f<<=1;var p=2*f-1;f-=1;var d=e.map(new Array(p),function(){return 0}),g=0;return e.forEach(c.forEach(function(y){var w=y.pos+f;d[w]+=y.weight;for(var S=0;w>0;)w%2&&(S+=d[w+1]),w=w-1>>1,d[w]+=y.weight;g+=y.weight*S})),g}return $v}var qv,IN;function Rz(){if(IN)return qv;IN=1;var e=mt();qv=t;function t(r,s){return e.map(s,function(o){var a=r.inEdges(o);if(a.length){var u=e.reduce(a,function(c,f){var p=r.edge(f),d=r.node(f.v);return{sum:c.sum+p.weight*d.order,weight:c.weight+p.weight}},{sum:0,weight:0});return{v:o,barycenter:u.sum/u.weight,weight:u.weight}}else return{v:o}})}return qv}var Dv,MN;function Az(){if(MN)return Dv;MN=1;var e=mt();Dv=t;function t(o,a){var u={};e.forEach(o,function(f,p){var d=u[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:p};e.isUndefined(f.barycenter)||(d.barycenter=f.barycenter,d.weight=f.weight)}),e.forEach(a.edges(),function(f){var p=u[f.v],d=u[f.w];!e.isUndefined(p)&&!e.isUndefined(d)&&(d.indegree++,p.out.push(u[f.w]))});var c=e.filter(u,function(f){return!f.indegree});return r(c)}function r(o){var a=[];function u(p){return function(d){d.merged||(e.isUndefined(d.barycenter)||e.isUndefined(p.barycenter)||d.barycenter>=p.barycenter)&&s(p,d)}}function c(p){return function(d){d.in.push(p),--d.indegree===0&&o.push(d)}}for(;o.length;){var f=o.pop();a.push(f),e.forEach(f.in.reverse(),u(f)),e.forEach(f.out,c(f))}return e.map(e.filter(a,function(p){return!p.merged}),function(p){return e.pick(p,["vs","i","barycenter","weight"])})}function s(o,a){var u=0,c=0;o.weight&&(u+=o.barycenter*o.weight,c+=o.weight),a.weight&&(u+=a.barycenter*a.weight,c+=a.weight),o.vs=a.vs.concat(o.vs),o.barycenter=u/c,o.weight=c,o.i=Math.min(a.i,o.i),a.merged=!0}return Dv}var Fv,ON;function Iz(){if(ON)return Fv;ON=1;var e=mt(),t=cn();Fv=r;function r(a,u){var c=t.partition(a,function(_){return e.has(_,"barycenter")}),f=c.lhs,p=e.sortBy(c.rhs,function(_){return-_.i}),d=[],g=0,y=0,w=0;f.sort(o(!!u)),w=s(d,p,w),e.forEach(f,function(_){w+=_.vs.length,d.push(_.vs),g+=_.barycenter*_.weight,y+=_.weight,w=s(d,p,w)});var S={vs:e.flatten(d,!0)};return y&&(S.barycenter=g/y,S.weight=y),S}function s(a,u,c){for(var f;u.length&&(f=e.last(u)).i<=c;)u.pop(),a.push(f.vs),c++;return c}function o(a){return function(u,c){return u.barycenter<c.barycenter?-1:u.barycenter>c.barycenter?1:a?c.i-u.i:u.i-c.i}}return Fv}var zv,PN;function Mz(){if(PN)return zv;PN=1;var e=mt(),t=Rz(),r=Az(),s=Iz();zv=o;function o(c,f,p,d){var g=c.children(f),y=c.node(f),w=y?y.borderLeft:void 0,S=y?y.borderRight:void 0,_={};w&&(g=e.filter(g,function(A){return A!==w&&A!==S}));var b=t(c,g);e.forEach(b,function(A){if(c.children(A.v).length){var L=o(c,A.v,p,d);_[A.v]=L,e.has(L,"barycenter")&&u(A,L)}});var k=r(b,p);a(k,_);var E=s(k,d);if(w&&(E.vs=e.flatten([w,E.vs,S],!0),c.predecessors(w).length)){var C=c.node(c.predecessors(w)[0]),T=c.node(c.predecessors(S)[0]);e.has(E,"barycenter")||(E.barycenter=0,E.weight=0),E.barycenter=(E.barycenter*E.weight+C.order+T.order)/(E.weight+2),E.weight+=2}return E}function a(c,f){e.forEach(c,function(p){p.vs=e.flatten(p.vs.map(function(d){return f[d]?f[d].vs:d}),!0)})}function u(c,f){e.isUndefined(c.barycenter)?(c.barycenter=f.barycenter,c.weight=f.weight):(c.barycenter=(c.barycenter*c.weight+f.barycenter*f.weight)/(c.weight+f.weight),c.weight+=f.weight)}return zv}var Bv,LN;function Oz(){if(LN)return Bv;LN=1;var e=mt(),t=ir().Graph;Bv=r;function r(o,a,u){var c=s(o),f=new t({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(p){return o.node(p)});return e.forEach(o.nodes(),function(p){var d=o.node(p),g=o.parent(p);(d.rank===a||d.minRank<=a&&a<=d.maxRank)&&(f.setNode(p),f.setParent(p,g||c),e.forEach(o[u](p),function(y){var w=y.v===p?y.w:y.v,S=f.edge(w,p),_=e.isUndefined(S)?0:S.weight;f.setEdge(w,p,{weight:o.edge(y).weight+_})}),e.has(d,"minRank")&&f.setNode(p,{borderLeft:d.borderLeft[a],borderRight:d.borderRight[a]}))}),f}function s(o){for(var a;o.hasNode(a=e.uniqueId("_root")););return a}return Bv}var Uv,$N;function Pz(){if($N)return Uv;$N=1;var e=mt();Uv=t;function t(r,s,o){var a={},u;e.forEach(o,function(c){for(var f=r.parent(c),p,d;f;){if(p=r.parent(f),p?(d=a[p],a[p]=f):(d=u,u=f),d&&d!==f){s.setEdge(d,f);return}f=p}})}return Uv}var Hv,qN;function Lz(){if(qN)return Hv;qN=1;var e=mt(),t=jz(),r=Tz(),s=Mz(),o=Oz(),a=Pz(),u=ir().Graph,c=cn();Hv=f;function f(y){var w=c.maxRank(y),S=p(y,e.range(1,w+1),"inEdges"),_=p(y,e.range(w-1,-1,-1),"outEdges"),b=t(y);g(y,b);for(var k=Number.POSITIVE_INFINITY,E,C=0,T=0;T<4;++C,++T){d(C%2?S:_,C%4>=2),b=c.buildLayerMatrix(y);var A=r(y,b);A<k&&(T=0,E=e.cloneDeep(b),k=A)}g(y,E)}function p(y,w,S){return e.map(w,function(_){return o(y,_,S)})}function d(y,w){var S=new u;e.forEach(y,function(_){var b=_.graph().root,k=s(_,b,S,w);e.forEach(k.vs,function(E,C){_.node(E).order=C}),a(_,S,k.vs)})}function g(y,w){e.forEach(w,function(S){e.forEach(S,function(_,b){y.node(_).order=b})})}return Hv}var Wv,DN;function $z(){if(DN)return Wv;DN=1;var e=mt(),t=ir().Graph,r=cn();Wv={positionX:S,findType1Conflicts:s,findType2Conflicts:o,addConflict:u,hasConflict:c,verticalAlignment:f,horizontalCompaction:p,alignCoordinates:y,findSmallestWidthAlignment:g,balance:w};function s(k,E){var C={};function T(A,L){var P=0,U=0,O=A.length,M=e.last(L);return e.forEach(L,function(q,V){var X=a(k,q),j=X?k.node(X).order:O;(X||q===M)&&(e.forEach(L.slice(U,V+1),function(G){e.forEach(k.predecessors(G),function(B){var te=k.node(B),Z=te.order;(Z<P||j<Z)&&!(te.dummy&&k.node(G).dummy)&&u(C,B,G)})}),U=V+1,P=j)}),L}return e.reduce(E,T),C}function o(k,E){var C={};function T(L,P,U,O,M){var q;e.forEach(e.range(P,U),function(V){q=L[V],k.node(q).dummy&&e.forEach(k.predecessors(q),function(X){var j=k.node(X);j.dummy&&(j.order<O||j.order>M)&&u(C,X,q)})})}function A(L,P){var U=-1,O,M=0;return e.forEach(P,function(q,V){if(k.node(q).dummy==="border"){var X=k.predecessors(q);X.length&&(O=k.node(X[0]).order,T(P,M,V,U,O),M=V,U=O)}T(P,M,P.length,O,L.length)}),P}return e.reduce(E,A),C}function a(k,E){if(k.node(E).dummy)return e.find(k.predecessors(E),function(C){return k.node(C).dummy})}function u(k,E,C){if(E>C){var T=E;E=C,C=T}var A=k[E];A||(k[E]=A={}),A[C]=!0}function c(k,E,C){if(E>C){var T=E;E=C,C=T}return e.has(k[E],C)}function f(k,E,C,T){var A={},L={},P={};return e.forEach(E,function(U){e.forEach(U,function(O,M){A[O]=O,L[O]=O,P[O]=M})}),e.forEach(E,function(U){var O=-1;e.forEach(U,function(M){var q=T(M);if(q.length){q=e.sortBy(q,function(B){return P[B]});for(var V=(q.length-1)/2,X=Math.floor(V),j=Math.ceil(V);X<=j;++X){var G=q[X];L[M]===M&&O<P[G]&&!c(C,M,G)&&(L[G]=M,L[M]=A[M]=A[G],O=P[G])}}})}),{root:A,align:L}}function p(k,E,C,T,A){var L={},P=d(k,E,C,A),U=A?"borderLeft":"borderRight";function O(V,X){for(var j=P.nodes(),G=j.pop(),B={};G;)B[G]?V(G):(B[G]=!0,j.push(G),j=j.concat(X(G))),G=j.pop()}function M(V){L[V]=P.inEdges(V).reduce(function(X,j){return Math.max(X,L[j.v]+P.edge(j))},0)}function q(V){var X=P.outEdges(V).reduce(function(G,B){return Math.min(G,L[B.w]-P.edge(B))},Number.POSITIVE_INFINITY),j=k.node(V);X!==Number.POSITIVE_INFINITY&&j.borderType!==U&&(L[V]=Math.max(L[V],X))}return O(M,P.predecessors.bind(P)),O(q,P.successors.bind(P)),e.forEach(T,function(V){L[V]=L[C[V]]}),L}function d(k,E,C,T){var A=new t,L=k.graph(),P=_(L.nodesep,L.edgesep,T);return e.forEach(E,function(U){var O;e.forEach(U,function(M){var q=C[M];if(A.setNode(q),O){var V=C[O],X=A.edge(V,q);A.setEdge(V,q,Math.max(P(k,M,O),X||0))}O=M})}),A}function g(k,E){return e.minBy(e.values(E),function(C){var T=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;return e.forIn(C,function(L,P){var U=b(k,P)/2;T=Math.max(L+U,T),A=Math.min(L-U,A)}),T-A})}function y(k,E){var C=e.values(E),T=e.min(C),A=e.max(C);e.forEach(["u","d"],function(L){e.forEach(["l","r"],function(P){var U=L+P,O=k[U],M;if(O!==E){var q=e.values(O);M=P==="l"?T-e.min(q):A-e.max(q),M&&(k[U]=e.mapValues(O,function(V){return V+M}))}})})}function w(k,E){return e.mapValues(k.ul,function(C,T){if(E)return k[E.toLowerCase()][T];var A=e.sortBy(e.map(k,T));return(A[1]+A[2])/2})}function S(k){var E=r.buildLayerMatrix(k),C=e.merge(s(k,E),o(k,E)),T={},A;e.forEach(["u","d"],function(P){A=P==="u"?E:e.values(E).reverse(),e.forEach(["l","r"],function(U){U==="r"&&(A=e.map(A,function(V){return e.values(V).reverse()}));var O=(P==="u"?k.predecessors:k.successors).bind(k),M=f(k,A,C,O),q=p(k,A,M.root,M.align,U==="r");U==="r"&&(q=e.mapValues(q,function(V){return-V})),T[P+U]=q})});var L=g(k,T);return y(T,L),w(T,k.graph().align)}function _(k,E,C){return function(T,A,L){var P=T.node(A),U=T.node(L),O=0,M;if(O+=P.width/2,e.has(P,"labelpos"))switch(P.labelpos.toLowerCase()){case"l":M=-P.width/2;break;case"r":M=P.width/2;break}if(M&&(O+=C?M:-M),M=0,O+=(P.dummy?E:k)/2,O+=(U.dummy?E:k)/2,O+=U.width/2,e.has(U,"labelpos"))switch(U.labelpos.toLowerCase()){case"l":M=U.width/2;break;case"r":M=-U.width/2;break}return M&&(O+=C?M:-M),M=0,O}}function b(k,E){return k.node(E).width}return Wv}var Vv,FN;function qz(){if(FN)return Vv;FN=1;var e=mt(),t=cn(),r=$z().positionX;Vv=s;function s(a){a=t.asNonCompoundGraph(a),o(a),e.forEach(r(a),function(u,c){a.node(c).x=u})}function o(a){var u=t.buildLayerMatrix(a),c=a.graph().ranksep,f=0;e.forEach(u,function(p){var d=e.max(e.map(p,function(g){return a.node(g).height}));e.forEach(p,function(g){a.node(g).y=f+d/2}),f+=d+c})}return Vv}var Gv,zN;function Dz(){if(zN)return Gv;zN=1;var e=mt(),t=xz(),r=_z(),s=kz(),o=cn().normalizeRanks,a=Sz(),u=cn().removeEmptyRanks,c=Ez(),f=Nz(),p=Cz(),d=Lz(),g=qz(),y=cn(),w=ir().Graph;Gv=S;function S(z,Q){var ne=Q&&Q.debugTiming?y.time:y.notime;ne("layout",function(){var ae=ne(" buildLayoutGraph",function(){return O(z)});ne(" runLayout",function(){_(ae,ne)}),ne(" updateInputGraph",function(){b(z,ae)})})}function _(z,Q){Q(" makeSpaceForEdgeLabels",function(){M(z)}),Q(" removeSelfEdges",function(){$(z)}),Q(" acyclic",function(){t.run(z)}),Q(" nestingGraph.run",function(){c.run(z)}),Q(" rank",function(){s(y.asNonCompoundGraph(z))}),Q(" injectEdgeLabelProxies",function(){q(z)}),Q(" removeEmptyRanks",function(){u(z)}),Q(" nestingGraph.cleanup",function(){c.cleanup(z)}),Q(" normalizeRanks",function(){o(z)}),Q(" assignRankMinMax",function(){V(z)}),Q(" removeEdgeLabelProxies",function(){X(z)}),Q(" normalize.run",function(){r.run(z)}),Q(" parentDummyChains",function(){a(z)}),Q(" addBorderSegments",function(){f(z)}),Q(" order",function(){d(z)}),Q(" insertSelfEdges",function(){H(z)}),Q(" adjustCoordinateSystem",function(){p.adjust(z)}),Q(" position",function(){g(z)}),Q(" positionSelfEdges",function(){I(z)}),Q(" removeBorderNodes",function(){Z(z)}),Q(" normalize.undo",function(){r.undo(z)}),Q(" fixupEdgeLabelCoords",function(){B(z)}),Q(" undoCoordinateSystem",function(){p.undo(z)}),Q(" translateGraph",function(){j(z)}),Q(" assignNodeIntersects",function(){G(z)}),Q(" reversePoints",function(){te(z)}),Q(" acyclic.undo",function(){t.undo(z)})}function b(z,Q){e.forEach(z.nodes(),function(ne){var ae=z.node(ne),fe=Q.node(ne);ae&&(ae.x=fe.x,ae.y=fe.y,Q.children(ne).length&&(ae.width=fe.width,ae.height=fe.height))}),e.forEach(z.edges(),function(ne){var ae=z.edge(ne),fe=Q.edge(ne);ae.points=fe.points,e.has(fe,"x")&&(ae.x=fe.x,ae.y=fe.y)}),z.graph().width=Q.graph().width,z.graph().height=Q.graph().height}var k=["nodesep","edgesep","ranksep","marginx","marginy"],E={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},C=["acyclicer","ranker","rankdir","align"],T=["width","height"],A={width:0,height:0},L=["minlen","weight","width","height","labeloffset"],P={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},U=["labelpos"];function O(z){var Q=new w({multigraph:!0,compound:!0}),ne=ce(z.graph());return Q.setGraph(e.merge({},E,Y(ne,k),e.pick(ne,C))),e.forEach(z.nodes(),function(ae){var fe=ce(z.node(ae));Q.setNode(ae,e.defaults(Y(fe,T),A)),Q.setParent(ae,z.parent(ae))}),e.forEach(z.edges(),function(ae){var fe=ce(z.edge(ae));Q.setEdge(ae,e.merge({},P,Y(fe,L),e.pick(fe,U)))}),Q}function M(z){var Q=z.graph();Q.ranksep/=2,e.forEach(z.edges(),function(ne){var ae=z.edge(ne);ae.minlen*=2,ae.labelpos.toLowerCase()!=="c"&&(Q.rankdir==="TB"||Q.rankdir==="BT"?ae.width+=ae.labeloffset:ae.height+=ae.labeloffset)})}function q(z){e.forEach(z.edges(),function(Q){var ne=z.edge(Q);if(ne.width&&ne.height){var ae=z.node(Q.v),fe=z.node(Q.w),pe={rank:(fe.rank-ae.rank)/2+ae.rank,e:Q};y.addDummyNode(z,"edge-proxy",pe,"_ep")}})}function V(z){var Q=0;e.forEach(z.nodes(),function(ne){var ae=z.node(ne);ae.borderTop&&(ae.minRank=z.node(ae.borderTop).rank,ae.maxRank=z.node(ae.borderBottom).rank,Q=e.max(Q,ae.maxRank))}),z.graph().maxRank=Q}function X(z){e.forEach(z.nodes(),function(Q){var ne=z.node(Q);ne.dummy==="edge-proxy"&&(z.edge(ne.e).labelRank=ne.rank,z.removeNode(Q))})}function j(z){var Q=Number.POSITIVE_INFINITY,ne=0,ae=Number.POSITIVE_INFINITY,fe=0,pe=z.graph(),ye=pe.marginx||0,Me=pe.marginy||0;function Ue(ze){var Ie=ze.x,ke=ze.y,le=ze.width,we=ze.height;Q=Math.min(Q,Ie-le/2),ne=Math.max(ne,Ie+le/2),ae=Math.min(ae,ke-we/2),fe=Math.max(fe,ke+we/2)}e.forEach(z.nodes(),function(ze){Ue(z.node(ze))}),e.forEach(z.edges(),function(ze){var Ie=z.edge(ze);e.has(Ie,"x")&&Ue(Ie)}),Q-=ye,ae-=Me,e.forEach(z.nodes(),function(ze){var Ie=z.node(ze);Ie.x-=Q,Ie.y-=ae}),e.forEach(z.edges(),function(ze){var Ie=z.edge(ze);e.forEach(Ie.points,function(ke){ke.x-=Q,ke.y-=ae}),e.has(Ie,"x")&&(Ie.x-=Q),e.has(Ie,"y")&&(Ie.y-=ae)}),pe.width=ne-Q+ye,pe.height=fe-ae+Me}function G(z){e.forEach(z.edges(),function(Q){var ne=z.edge(Q),ae=z.node(Q.v),fe=z.node(Q.w),pe,ye;ne.points?(pe=ne.points[0],ye=ne.points[ne.points.length-1]):(ne.points=[],pe=fe,ye=ae),ne.points.unshift(y.intersectRect(ae,pe)),ne.points.push(y.intersectRect(fe,ye))})}function B(z){e.forEach(z.edges(),function(Q){var ne=z.edge(Q);if(e.has(ne,"x"))switch((ne.labelpos==="l"||ne.labelpos==="r")&&(ne.width-=ne.labeloffset),ne.labelpos){case"l":ne.x-=ne.width/2+ne.labeloffset;break;case"r":ne.x+=ne.width/2+ne.labeloffset;break}})}function te(z){e.forEach(z.edges(),function(Q){var ne=z.edge(Q);ne.reversed&&ne.points.reverse()})}function Z(z){e.forEach(z.nodes(),function(Q){if(z.children(Q).length){var ne=z.node(Q),ae=z.node(ne.borderTop),fe=z.node(ne.borderBottom),pe=z.node(e.last(ne.borderLeft)),ye=z.node(e.last(ne.borderRight));ne.width=Math.abs(ye.x-pe.x),ne.height=Math.abs(fe.y-ae.y),ne.x=pe.x+ne.width/2,ne.y=ae.y+ne.height/2}}),e.forEach(z.nodes(),function(Q){z.node(Q).dummy==="border"&&z.removeNode(Q)})}function $(z){e.forEach(z.edges(),function(Q){if(Q.v===Q.w){var ne=z.node(Q.v);ne.selfEdges||(ne.selfEdges=[]),ne.selfEdges.push({e:Q,label:z.edge(Q)}),z.removeEdge(Q)}})}function H(z){var Q=y.buildLayerMatrix(z);e.forEach(Q,function(ne){var ae=0;e.forEach(ne,function(fe,pe){var ye=z.node(fe);ye.order=pe+ae,e.forEach(ye.selfEdges,function(Me){y.addDummyNode(z,"selfedge",{width:Me.label.width,height:Me.label.height,rank:ye.rank,order:pe+ ++ae,e:Me.e,label:Me.label},"_se")}),delete ye.selfEdges})})}function I(z){e.forEach(z.nodes(),function(Q){var ne=z.node(Q);if(ne.dummy==="selfedge"){var ae=z.node(ne.e.v),fe=ae.x+ae.width/2,pe=ae.y,ye=ne.x-fe,Me=ae.height/2;z.setEdge(ne.e,ne.label),z.removeNode(Q),ne.label.points=[{x:fe+2*ye/3,y:pe-Me},{x:fe+5*ye/6,y:pe-Me},{x:fe+ye,y:pe},{x:fe+5*ye/6,y:pe+Me},{x:fe+2*ye/3,y:pe+Me}],ne.label.x=ne.x,ne.label.y=ne.y}})}function Y(z,Q){return e.mapValues(e.pick(z,Q),Number)}function ce(z){var Q={};return e.forEach(z,function(ne,ae){Q[ae.toLowerCase()]=ne}),Q}return Gv}var Yv,BN;function Fz(){if(BN)return Yv;BN=1;var e=mt(),t=cn(),r=ir().Graph;Yv={debugOrdering:s};function s(o){var a=t.buildLayerMatrix(o),u=new r({compound:!0,multigraph:!0}).setGraph({});return e.forEach(o.nodes(),function(c){u.setNode(c,{label:c}),u.setParent(c,"layer"+o.node(c).rank)}),e.forEach(o.edges(),function(c){u.setEdge(c.v,c.w,{},c.name)}),e.forEach(a,function(c,f){var p="layer"+f;u.setNode(p,{rank:"same"}),e.reduce(c,function(d,g){return u.setEdge(d,g,{style:"invis"}),g})}),u}return Yv}var Kv,UN;function zz(){return UN||(UN=1,Kv="0.8.5"),Kv}var Xv,HN;function Bz(){return HN||(HN=1,Xv={graphlib:ir(),layout:Dz(),debug:Fz(),util:{time:cn().time,notime:cn().notime},version:zz()}),Xv}var Uz=Bz();const WN=My(Uz),So=240,ac=130,mo=74,Lc=72,VN=mo+Lc;function Hz(e,t){var s;let r=So;for(const o of e)r=Math.max(r,((s=t.get(o.id))==null?void 0:s.width)??So);return r}const fR=420,Wz=2;function Ga(e){var r;return((r=e.data)==null?void 0:r.sessionId)??"_default"}function Vz(e,t){return((t==null?void 0:t.get(e))??0)>0?fR:0}function Gz(e,t){const r=(t==null?void 0:t.get(e))??0;return r>0?6+r*36:0}function Ya(e,t,r){const s=t.get(e);return{w:((s==null?void 0:s.width)??So)+Vz(e,r),h:Math.max((s==null?void 0:s.height)??ac,Gz(e,r))}}function Yz(e){return[...e.keys()].sort().map(t=>`${t}:${e.get(t)}`).join("|")}function Kz(e,t,r,s,o,a){const u=new WN.graphlib.Graph;u.setDefaultEdgeLabel(()=>({})),u.setGraph({rankdir:r,marginx:0,marginy:0,nodesep:70,ranksep:160,edgesep:30});const c=e.filter(k=>!o.has(k)),f=new Set(c);for(const k of c){const{w:E,h:C}=Ya(k,s,a);u.setNode(k,{width:E,height:C})}for(const k of t)f.has(k.source)&&f.has(k.target)&&u.setEdge(k.source,k.target);WN.layout(u);const p=new Map;let d=1/0,g=1/0,y=-1/0,w=-1/0;for(const k of c){const E=u.node(k);if(!E)continue;const C=s.get(k),T=(C==null?void 0:C.width)??So,A=(C==null?void 0:C.height)??ac,L=Ya(k,s,a),P=E.x-L.w/2,U=E.y-L.h/2;p.set(k,{x:P,y:U}),P<d&&(d=P),U<g&&(g=U),P+T>y&&(y=P+T),U+A>w&&(w=U+A)}if(Number.isFinite(d)&&Number.isFinite(g))for(const[k,E]of p)p.set(k,{x:E.x-d,y:E.y-g});const S=Number.isFinite(y)?y-d:0,_=Number.isFinite(w)?w-g:0;let b=null;for(const k of e){const E=o.get(k);if(!E)continue;const C=s.get(k),T=(C==null?void 0:C.width)??So,A=(C==null?void 0:C.height)??ac;b=b===null?{minX:E.x,minY:E.y,maxX:E.x+T,maxY:E.y+A}:{minX:Math.min(b.minX,E.x),minY:Math.min(b.minY,E.y),maxX:Math.max(b.maxX,E.x+T),maxY:Math.max(b.maxY,E.y+A)}}return{positions:p,width:S,height:_,pinnedBox:b}}function Xz(e,t,r={}){const s=r.direction??"LR",o=r.pinned??new Map,a=r.measured??new Map,u=r.lanes,c=new Map;for(const k of e){const E=Ga(k),C=c.get(E);C?C.push(k.id):c.set(E,[k.id])}const p=Array.from(c.keys()).sort().map(k=>({sid:k,...Kz(c.get(k),t,s,a,o,u)})),d=Hz(e,a),g=r.availableHeight&&r.availableHeight>0?r.availableHeight:Number.POSITIVE_INFINITY,y=k=>{const E=[[]];let C=0;for(const T of p)E.length<k&&C>0&&C+T.height>g&&(E.push([]),C=0),E[E.length-1].push(T),C+=T.height+VN;return E},w=k=>k.reduce((E,C)=>Math.max(E,C.width),0)+fR;let S=y(r.availableWidth?Wz:1);S.length>1&&S.reduce((E,C)=>E+w(C),0)+d*(S.length-1)>(r.availableWidth??0)&&(S=y(1));const _=new Map;let b=0;for(const k of S){const E=w(k);let C=0;for(const{positions:T,height:A,pinnedBox:L}of k){for(const[U,O]of T)_.set(U,{x:O.x+b,y:O.y+C});let P=C+A;L&&L.maxY>P&&L.minX<b+E&&b<L.maxX&&(P=L.maxY),C=P+VN}b+=E+d}return e.map(k=>{const E=o.get(k.id);if(E)return{...k,position:E};const C=_.get(k.id);return C?{...k,position:C}:k})}function Qz(e,t,r,s,o){const u=mo+Lc,c=60,f=w=>Ya(w,s,o),p=new Map(e.map(w=>[w.id,Ga(w)])),d=[],g=e.map(w=>({id:w.id,pos:r.get(w.id)??t.get(w.id)})).filter(w=>w.pos!=null).sort((w,S)=>w.pos.y-S.pos.y||w.pos.x-S.pos.x||w.id.localeCompare(S.id)),y=[];for(const{id:w,pos:S}of g){const{w:_,h:b}=f(w),k=p.get(w)??"_default";if(r.has(w)){d.push({x:S.x,y:S.y,w:_,h:b,sid:k});continue}let E=S.y;for(let C=0;C<d.length+1;C++){const T=d.find(A=>{const L=A.sid===k?24:c,P=A.sid===k?24:u;return S.x<A.x+A.w+L&&A.x<S.x+_+L&&E<A.y+A.h+P&&A.y<E+b+P});if(!T)break;E=T.y+T.h+(T.sid===k?24:u)}E!==S.y&&(t.set(w,{x:S.x,y:E}),y.push(w)),d.push({x:S.x,y:E,w:_,h:b,sid:k})}return y}function Zz(e,t,r,s,o,a){const u=_=>Ya(_,s,a),c=_=>r.get(_)??t.get(_),f=new Map;for(const _ of e){if(!c(_.id))continue;const b=Ga(_),k=f.get(b);k?k.push(_):f.set(b,[_])}const p=new Set;for(const[_,b]of f)b.every(k=>o.has(k.id)&&!r.has(k.id))&&p.add(_);const d=new Map,g=[];for(const _ of e){const b=c(_.id);if(!b)continue;const{w:k,h:E}=u(_.id),C=Ga(_);p.has(C)?(d.get(C)??d.set(C,[]).get(C)).push(_):g.push({x:b.x,y:b.y,w:k,h:E})}if(d.size===0)return[];const y=mo+Lc,w=(_,b,k,E)=>g.some(C=>_<C.x+C.w+mo&&C.x<_+k+mo&&b<C.y+C.h+y&&C.y<b+E+y),S=[];for(const _ of[...d.keys()].sort()){const b=d.get(_);let k=1/0,E=1/0,C=-1/0,T=-1/0;for(const q of b){const V=c(q.id),{w:X,h:j}=u(q.id);k=Math.min(k,V.x),E=Math.min(E,V.y),C=Math.max(C,V.x+X),T=Math.max(T,V.y+j)}const A=C-k,L=T-E,P=[...new Set(g.map(q=>Math.round(q.x)))].sort((q,V)=>q-V),U=P.length?P:[k],O=[0,...g.map(q=>q.y+q.h+y)].sort((q,V)=>q-V);let M=null;e:for(const q of U)for(const V of O){if(V>=E)break;if(!w(q,V,A,L)){M={x:q,y:V};break e}}if(M){const q=M.x-k,V=M.y-E;for(const X of b){const j=c(X.id);t.set(X.id,{x:j.x+q,y:j.y+V})}S.push(_)}for(const q of b){const V=c(q.id),{w:X,h:j}=u(q.id);g.push({x:V.x,y:V.y,w:X,h:j})}}return S}function Jz(e,t,r,s,o,a=!1,u){const p=mo+Lc+1,d=8,g=1.75,y=200,w=.7,S=.01,_=M=>Ya(M,s,u),b=M=>r.get(M)??t.get(M),k=new Map;for(const M of e){if(!b(M.id))continue;const q=Ga(M),V=k.get(q);V?V.push(M):k.set(q,[M])}const E=[],C=new Set,T=new Set,A=o.size===0;for(const M of[...k.keys()].sort()){const q=k.get(M);let V=1/0,X=1/0,j=-1/0,G=-1/0,B=!1;for(const H of q){const I=b(H.id),{w:Y,h:ce}=_(H.id);V=Math.min(V,I.x),X=Math.min(X,I.y),j=Math.max(j,I.x+Y),G=Math.max(G,I.y+ce),r.has(H.id)&&(B=!0)}const te=j-V,Z=G-X;T.add(M);const $=o.get(M);$&&(te>$.w+d||Z>$.h+d)&&C.add(M),o.set(M,{w:te,h:Z}),E.push({sid:M,members:q.map(H=>H.id),x:V,y:X,w:te,h:Z,anchored:B,mass:1})}for(const M of[...o.keys()])T.has(M)||o.delete(M);if(a||A)return[];let L=!1;for(let M=0;M<E.length&&!L;M++)for(let q=M+1;q<E.length;q++){const V=E[M],X=E[q];if(!(V.anchored&&X.anchored)&&Math.abs(V.x+V.w/2-(X.x+X.w/2))<(V.w+X.w)/2+61&&Math.abs(V.y+V.h/2-(X.y+X.h/2))<(V.h+X.h)/2+p){L=!0;break}}if(C.size===0&&!L)return[];if(C.size>0)for(const M of E)C.has(M.sid)&&(M.mass=8);else for(const M of E)M.mass=Math.max(1,M.w*M.h/(So*ac));const P=new Map(E.map(M=>[M.sid,M.x])),U=new Map(E.map(M=>[M.sid,M.y]));for(let M=0;M<y;M++){const q=new Map,V=new Map;let X=0;for(let j=0;j<E.length;j++)for(let G=j+1;G<E.length;G++){const B=E[j],te=E[G];if(B.anchored&&te.anchored)continue;const Z=B.x+B.w/2,$=B.y+B.h/2,H=te.x+te.w/2,I=te.y+te.h/2,Y=(B.w+te.w)/2+61-Math.abs(Z-H),ce=(B.h+te.h)/2+p-Math.abs($-I);if(Y<=0||ce<=0)continue;const z=(Be,et)=>!Be.anchored&&!(et<0&&Be.x<=0),Q=(Be,et)=>!Be.anchored&&!(et<0&&Be.y<=0),ne=(Be,et,Xe)=>{const wt=Be===et,ee=wt?B.sid<te.sid?-1:1:Math.sign(Be-et);return Xe(B,ee)||Xe(te,-ee)?ee:wt&&(Xe(B,-ee)||Xe(te,ee))?-ee:0},ae=ne(Z,H,z),fe=ne($,I,Q),pe=ae!==0,ye=fe!==0;if(!pe&&!ye)continue;const Me=pe&&(!ye||Y*g<ce),[Ue,ze,Ie,ke]=Me?[ae,Y,q,z]:[fe,ce,V,Q],le=ke(B,Ue),we=ke(te,-Ue),xe=B.mass,Ye=te.mass,gt=le?we?Ye/(xe+Ye):1:0,ft=we?le?xe/(xe+Ye):1:0,ot=ze*w;Ie.set(B.sid,(Ie.get(B.sid)??0)+Ue*ot*gt),Ie.set(te.sid,(Ie.get(te.sid)??0)-Ue*ot*ft),X+=ot}for(const j of E)j.anchored||(j.x=Math.max(0,j.x+(q.get(j.sid)??0)),j.y=Math.max(0,j.y+(V.get(j.sid)??0)));if(X<S)break}const O=[];for(const M of E){const q=M.x-P.get(M.sid),V=M.y-U.get(M.sid);if(!(Math.abs(q)<1&&Math.abs(V)<1)){for(const X of M.members){if(r.has(X))continue;const j=t.get(X);j&&t.set(X,{x:j.x+q,y:j.y+V})}O.push(M.sid)}}return O}const e6=600;function Ty(e,t){return!(e.exitAt!=null&&t-e.exitAt>e6||e.kind==="root"&&e.state==="done"&&e.tools.length===0&&e.endedAt!=null&&e.endedAt-e.startedAt<3e3)}function t6(e,t){const r=new Set;for(const s of e.agents.values())Ty(s,t)&&r.add(s.id);return r}function n6(e,t,r=0){return e.right+r>t.left&&e.left-r<t.right&&e.bottom+r>t.top&&e.top-r<t.bottom}function r6(e,t,r=0){if(!e)return!1;for(const s of t)if(n6(e,s,r))return!0;return!1}const hR="sessionGroup";function s6(e,t){var s;if(e.type===hR)return"transparent";const r=(s=e.data)==null?void 0:s.state;return t(r==="err"?"--err":r==="active"?"--inflight":"--ok")}const pR=["--err","--inflight","--ok","--grid-line","--minimap-mask","--panel","--line"];function GN(e){const t={};for(const r of pR)t[r]=e(r);return t}function i6(e){return t=>e[t]??""}function o6(e,t){return pR.every(r=>e[r]===t[r])}function a6(e){const t=new Set(e.pins),r=new Map,s=new Map;for(const[o,a]of e.positions)r.set(o,a),t.has(o)&&s.set(o,a);return{positions:r,pinned:s}}const l6=1200,u6=1e3;function YN(e){return e.lastDeckFitAt>0&&e.at-e.lastDeckFitAt<l6?!1:e.hasSourceEvent?!0:e.lastCanvasInputAt>0&&e.at-e.lastCanvasInputAt<u6}function Qv({durationMs:e,documentHidden:t}){return t?!1:Number.isFinite(e)&&e>0}function c6(e,t,r){const s=e.x*t.zoom+t.x,o=e.y*t.zoom+t.y,a=(e.x+e.width)*t.zoom+t.x,u=(e.y+e.height)*t.zoom+t.y;return a>0&&s<r.width&&u>0&&o<r.height}function d6({pane:e,viewport:t,boxes:r}){if(!e||!(e.width>0)||!(e.height>0)||!Number.isFinite(t.zoom)||t.zoom<=0||!Number.isFinite(t.x)||!Number.isFinite(t.y))return!1;let s=!1;for(const o of r)if(s=!0,c6(o,t,e))return!1;return s}const f6="Update checks are off (AGENTS_DECK_NO_UPDATE_CHECK=1)",Zv="click for what's new";function h6(e){if(e.checkDisabled)return`${f6} · ${Zv}`;if(e.checking)return`Asking npm for the newest release… · ${Zv}`;const t=e.latest?`npm has v${e.latest}`:e.latestPending?`npm's latest tag names v${e.latestPending}, which it cannot serve yet`:"npm not reached yet",r=e.checkedAgo?` · checked ${e.checkedAgo}`:"";return`${t}${r} · re-checked periodically · ${Zv}, and to check npm now`}function p6(e){const t=`Version v${e.running}, show what's new`;return e.checkDisabled?`${t} — update checks are off`:e.checking?`${t} — checking npm for a newer release`:`${t} and check npm for a newer release`}function m6(e){const t=e.kind==="restart"?`v${e.to} is installed and waiting for a restart`:`v${e.to} is available on npm`,r=e.open?"show what's new":"show what's new and the notice";return`Version v${e.from}, ${t} — ${r}`}function g6(e){if(e==null)return{kind:"unknown",lead:"No data yet. Start a Claude Code or Codex session — it appears here as soon as the deck sees its first event.",workspace:null,tail:""};const t=e.trim();return t===""?{kind:"machine",lead:"No data yet. Start a Claude Code or Codex session anywhere on this machine — this deck is unscoped and captures every workspace.",workspace:null,tail:""}:{kind:"scoped",lead:"No data yet. This deck only captures sessions running under",workspace:t,tail:" — start one there, or restart it without --workspace/--scope to watch the whole machine."}}const Ry={kind:"assumed",claude:!0,codex:!0};function v6(e){if(!e||typeof e!="object")return Ry;const t=e.providers;if(!t||typeof t!="object")return Ry;const r=t;return{kind:"reported",claude:r.claude!==!1,codex:r.codex!==!1}}function lc(e){const t=Math.max(0,Math.floor(e));return`${t} event${t===1?"":"s"}`}const KN=99;function y6(e){const t=Math.max(0,Math.floor(e));return t>KN?`${KN}+`:String(t)}const w6="Pause the canvas";function x6(e){if(!e.paused)return"Pause live updates — events keep arriving and are applied when you resume (Space)";const t=Math.max(0,Math.floor(e.dropped??0));return t>0?`The pause is full — ${lc(e.held)} held and ${t} older ${t===1?"one":"ones"} already dropped. Resume to follow the canvas again (Space)`:e.held<=0?"Nothing has arrived since you paused. Resume to follow the canvas again (Space)":`${lc(e.held)} arrived while paused and will be applied in order when you resume (Space)`}function _6(e){return e.connected||!e.paused?null:"The canvas is paused as well — Space resumes it, but nothing new arrives until the stream is back."}const mR="paused · full",b6=(e,t)=>t>0?mR:e>0?`paused · ${y6(e)}`:"paused";function k6(e){const t=Math.max(0,Math.floor(e.dropped??0));return e.connected?e.paused?{tone:"paused",label:b6(e.held,t),widest:mR,title:t>0?`Connected — the pause is full at ${lc(e.held)}; the oldest are being dropped as new ones arrive. Resume to catch up (Space)`:e.held>0?`Connected — ${lc(e.held)} held until you resume (Space)`:"Connected — updates held until you resume (Space)"}:{tone:"live",label:"live",widest:"live",title:"Receiving events"}:{tone:"dead",label:"offline",widest:"offline",title:e.paused?"SSE disconnected — and the canvas is paused, so resuming will not bring events back until it reconnects":"SSE disconnected"}}function XN(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}const S6={agent:C$,sessionGroup:U$},gR="react-flow__node";function QN(e){var t,r;return!!e&&((r=(t=e.classList)==null?void 0:t.contains)==null?void 0:r.call(t,gR))===!0}function E6(e){try{const t=document.querySelector(`.${gR}[data-id="${CSS.escape(e)}"]`);t==null||t.focus({preventScroll:!0})}catch{}}const N6=["a[href]","button:not(:disabled)","input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)","summary","[tabindex]"].join(","),C6=420,Fu=18,j6=200,T6=5*6e4,R6=6,A6=2*6e4,ZN=400,R0="agent-dag.layout",A0="agent-dag.viewport",vR="agent-dag.summariesDismissed",yR="agent-dag.sessionListOpen",wR="agent-dag.detailOpen",xR="agent-dag.usagePanelOpen",JN="agent-dag.accountsPanelOpen",Jv="agent-dag.versionNoticeDismissed",eC="agent-dag.oldNameNoticeDismissed",I6=15*6e4,ey={git_checkout:"this deck runs from a git checkout — pull instead:",npx:"npx runs from a cache that cannot be upgraded in place — run:",not_writable:"the install directory is not writable by this user — run:",opted_out:"installs are off (AGENTS_DECK_NO_INSTALL=1) — run:"},tC="agent-dag.autoRestart",nC="agent-dag.bundleReloadedFor";function M6(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(yR)==="1"}catch{return!1}}function O6(e){if(!(typeof window>"u"))try{window.localStorage.setItem(yR,e?"1":"0")}catch{}}function P6(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(wR)==="1"}catch{return!1}}function L6(e){if(!(typeof window>"u"))try{window.localStorage.setItem(wR,e?"1":"0")}catch{}}function $6(){const e=yc(xR);return e===null?!0:e==="1"}function q6(e){if(!(typeof window>"u"))try{window.localStorage.setItem(xR,e?"1":"0")}catch{}}function D6(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(vR);if(!e)return new Set;const t=JSON.parse(e);return new Set(Array.isArray(t)?t.filter(r=>typeof r=="string"):[])}catch{return new Set}}function rC(e){if(!(typeof window>"u"))try{const t=Array.from(e),r=t.length>200?t.slice(-200):t;window.localStorage.setItem(vR,JSON.stringify(r))}catch{}}function F6(){const e={positions:[],pins:[]};if(typeof window>"u")return e;try{const t=window.localStorage.getItem(R0);if(!t)return e;const r=JSON.parse(t);if(!("v"in r)){const o=Object.entries(r).filter(([,a])=>a&&typeof a.x=="number"&&typeof a.y=="number");return{positions:o,pins:o.map(([a])=>a)}}return{positions:Object.entries(r.positions??{}).filter(([,o])=>o&&typeof o.x=="number"&&typeof o.y=="number"),pins:Array.isArray(r.pins)?r.pins:[]}}catch{return e}}function ty(e,t){if(!(typeof window>"u"))try{const r={};for(const[s,o]of e)r[s]=o;for(const[s,o]of t)r[s]=o;window.localStorage.setItem(R0,JSON.stringify({v:2,positions:r,pins:Array.from(t.keys())}))}catch{}}function z6(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(A0);if(!e)return null;const t=JSON.parse(e);return typeof(t==null?void 0:t.x)!="number"||typeof(t==null?void 0:t.y)!="number"||typeof(t==null?void 0:t.zoom)!="number"?null:t}catch{return null}}function B6(e){if(!(typeof window>"u"))try{window.localStorage.setItem(A0,JSON.stringify(e))}catch{}}function sC(){if(!(typeof window>"u")){try{window.localStorage.removeItem(R0)}catch{}try{window.localStorage.removeItem(A0)}catch{}}}function U6(e,t){const r=e.agents.get(t);if(!r)return;const s=[];for(const d of e.agents.values())d.sessionId===t&&s.push(d);const o={schemaVersion:1,exportedAt:new Date().toISOString(),sessionId:t,label:r.label,cwd:r.cwd,startedAt:r.startedAt,endedAt:r.endedAt,model:r.model,agents:s.map(d=>({id:d.id,kind:d.kind,label:d.label,parentId:d.parentId,state:d.state,startedAt:d.startedAt,endedAt:d.endedAt,model:d.model,cwd:d.cwd,usage:d.usage,prompts:d.prompts,tools:d.tools.map(g=>({id:g.id,name:g.name,inputPreview:g.inputPreview,startedAt:g.startedAt,endedAt:g.endedAt,ok:g.ok,errorPreview:g.errorPreview,usage:g.usage}))}))},a=JSON.stringify(o,null,2),u=new Blob([a],{type:"application/json"}),c=URL.createObjectURL(u),f=document.createElement("a"),p=(r.label||"session").replace(/[^a-z0-9._-]/gi,"_");f.href=c,f.download=`${Yt}-${p}-${t.slice(0,8)}.json`,document.body.appendChild(f),f.click(),document.body.removeChild(f),setTimeout(()=>URL.revokeObjectURL(c),1e3)}const Ay={file:"📁",shell:"⚡",web:"🌐",agent:"🤖",task:"📋",plan:"🧭",mcp:"🔌",other:"✨"},Iy={file:"file",shell:"shell",web:"web",agent:"agent",task:"task",plan:"plan",mcp:"mcp",other:"other"},_R=Hj;function H6(e,t,r,s,o,a,u,c,f,p,d,g,y,w,S,_,b,k){const E=[],C=[];for(const M of e.agents.values()){if(!b.has(M.id))continue;const q=M.exitAt!=null,V=_!=null&&!_.has(M.id),X=[q?"rf-exiting":"",V?"rf-spotlit-out":""].filter(Boolean).join(" ")||void 0,j=a.get(M.id);if(E.push({id:M.id,type:"agent",position:{x:0,y:0},data:{...M,now:t,onOpenContext:k},className:X,...j?{width:j.width,height:j.height}:null}),M.parentId&&b.has(M.parentId)){const G=Zy(M.sessionId),B=q,te=S.size>0&&(S.has(M.id)||S.has(M.parentId)),Z=_!=null&&!_.has(M.id)&&!_.has(M.parentId),$=M.state==="active"?2:1.5,H=te?$+1.5:$,I=B?.2:Z?.12:1,Y=["sess-edge",M.state==="active"?"sess-live":"sess-idle",B?"rf-edge-exiting":"",te?"rf-edge-selected":""].filter(Boolean).join(" ");C.push({id:`e:${M.parentId}->${M.id}`,source:M.parentId,target:M.id,animated:(M.state==="active"||te)&&!B,type:"smoothstep",style:{"--session-hue":G,strokeWidth:H,opacity:I,transition:"var(--edge-transition)"},className:Y})}}const T=new Map;for(const M of e.agents.values())M.tools.length>0&&T.set(M.id,Math.min(4,M.tools.length));const A=`${y}#lanes:${Yz(T)}`,L=E.filter(M=>eD(M.id,o,d,g));if(L.length>0||A!==w.current){if(L.length>0){const M=Xz(E,C,{direction:"LR",pinned:o,measured:a,availableWidth:r,availableHeight:s,lanes:T});for(const q of M)cT(q.id,d,g)&&nD(q.id,q.position,d,g);Zz(E,d,o,a,new Set(L.map(q=>q.id)),T)}Qz(E,d,o,a,T),w.current=A}const P=Jz(E,d,o,a,u,!f||p,T);P.length>0&&c(P),Lu(d,e.agents),Lu(g,e.agents),Lu(o,e.agents),Lu(a,Q4(e.agents.values()));const U=[];let O=!1;for(const M of E){let q=o.get(M.id)??d.get(M.id);q||(q=tD(M.id,d,g),O=!0),U.push({...M,position:q})}return O&&(w.current=""),{nodes:U,edges:C}}function W6(){return m.jsx(Xy,{children:m.jsx(V6,{})})}function V6(){var Qo,Zo,Or,Cl;const e=Ja(),t=Nt(),r=N.useState(yy)[0],s=N.useRef(r),[,o]=N.useState(0),a=N.useCallback(()=>o(F=>F+1),[]),[u,c]=N.useState(()=>new Set),[f,p]=N.useState(null),[d,g]=N.useState(null),y=N.useCallback((F,W)=>{c(ie=>{if(!W)return new Set([F]);const de=new Set(ie);return de.has(F)?de.delete(F):de.add(F),de}),p(ie=>W&&ie===F?ie:F)},[]),w=N.useCallback(()=>{c(new Set),p(null)},[]),[S,_]=N.useState(null),[b,k]=N.useState(null),E=N.useCallback(F=>k(F),[]),[C,T]=N.useState(!1),[A,L]=N.useState(!1),P=N.useState(D6)[0],[U,O]=N.useState(M6);N.useEffect(()=>{O6(U)},[U]);const[M,q]=N.useState(P6);N.useEffect(()=>{L6(M)},[M]);const[V,X]=N.useState($6);N.useEffect(()=>{q6(V)},[V]);const[j,G]=N.useState(()=>{try{const F=window.localStorage.getItem(JN);return F===null?!0:F==="1"}catch{return!0}});N.useEffect(()=>{try{window.localStorage.setItem(JN,j?"1":"0")}catch{}},[j]);const[B,te]=N.useState(null);N.useEffect(()=>{let F=null;try{F=localStorage.getItem("agent-dag.sound")}catch{}te(F===null?!0:F==="on")},[]);const Z=N.useCallback(()=>{te(F=>{var ie;const W=F!==!0;try{localStorage.setItem("agent-dag.sound",W?"on":"off")}catch{}return W&&((ie=Me.current)==null||ie.unlock()),W})},[]),$=N.useCallback(F=>{Z()},[Z]),H=N.useRef($);H.current=$;const I=N.useRef(B);I.current=B;const[Y,ce]=N.useState(()=>S4(yc)),z=N.useRef(Y);z.current=Y;const Q=N.useRef(null),ne=N.useCallback((F,W=!1)=>{var ie,de;if((ie=Me.current)==null||ie.unlock(),Q.current!==null&&clearTimeout(Q.current),Q.current=null,!W){(de=Me.current)==null||de.play(F,!0);return}Q.current=setTimeout(()=>{var _e;Q.current=null,(_e=Me.current)==null||_e.play(F,!0)},w4)},[]),ae=N.useCallback((F,W)=>{ce(ie=>{const de={level:Va(W.level??ie[F].level),figure:iT(F,W.figure??ie[F].figure)};try{localStorage.setItem(aT[F],String(de.level)),localStorage.setItem(lT[F],de.figure)}catch{}return{...ie,[F]:de}}),ne(F,!0)},[ne]);N.useEffect(()=>()=>{Q.current!==null&&clearTimeout(Q.current)},[]);const[fe,pe]=N.useState(!1),ye=N.useRef(null),Me=N.useRef(null),[Ue,ze]=N.useState("locked");N.useEffect(()=>{const F=C4({enabled:()=>I.current===!0,prefs:()=>z.current,onState:ze});Me.current=F,ze(F.state());const W=()=>F.unlock();return window.addEventListener("pointerdown",W,{once:!0,capture:!0}),window.addEventListener("keydown",W,{once:!0,capture:!0}),()=>{window.removeEventListener("pointerdown",W,{capture:!0}),window.removeEventListener("keydown",W,{capture:!0})}},[]);const[Ie,ke]=N.useState(!1),[le,we]=N.useState(null),[xe,Ye]=N.useState(()=>{if(typeof window>"u")return"";try{return window.localStorage.getItem(Jv)??""}catch{return""}}),[gt,ft]=N.useState(!1),ot=N.useRef(0),[Be,et]=N.useState(!1),Xe=N.useCallback((F=!1)=>(F&&(ot.current=Date.now(),et(!0)),fetch(F?"/api/version?refresh=1":"/api/version").then(W=>W.ok?W.json():null).then(W=>{W&&we(W)}).catch(()=>{}).finally(()=>{F&&et(!1)})),[]),wt=N.useCallback(()=>{Xe(Date.now()-ot.current>=I6)},[Xe]);N.useEffect(()=>{Xe();const F=window.setInterval(wt,5*6e4),W=()=>{document.visibilityState==="visible"&&wt()};return document.addEventListener("visibilitychange",W),()=>{window.clearInterval(F),document.removeEventListener("visibilitychange",W)}},[Xe,wt]),N.useEffect(()=>{Ie&&Xe()},[Ie,Xe]);const ee=(le==null?void 0:le.notice)??null,[Le,De]=N.useState(null),Re=N.useRef(!1);N.useEffect(()=>{if(Re.current)return;const F=q4(),W=D4(F),ie=B4({stored:W,running:(le==null?void 0:le.running)??null,notes:b1,remembers:F4(F)});ie.reason!=="no-version"&&(Re.current=!0,ie.record&&z4(F,ie.record),ie.show.length&&De({entries:ie.show,since:W,firstRun:ie.reason==="welcome"}))},[le==null?void 0:le.running]);const $e=(le==null?void 0:le.running)??"1.46.2",rt=N.useMemo(()=>uT(b1,null,$e),[$e]),tt=N.useCallback(()=>{De({entries:rt,since:null,firstRun:!1})},[rt]),[Ce,kt]=N.useState(null),[Ve,lt]=N.useState(Ry);N.useEffect(()=>{let F=!1;return fetch("/api/health").then(W=>W.ok?W.json():null).then(W=>{F||(lt(v6(W)),!(!W||typeof W.workspace!="string")&&kt(W.workspace))}).catch(()=>{}),()=>{F=!0}},[Ie]);const dn=N.useRef(Ve);dn.current=Ve;const wn=ee?`${ee.kind}:${ee.to}`:"",xn=ee!=null&&xe!==wn,_n=N.useCallback(()=>{Ye("");try{window.localStorage.setItem(Jv,"")}catch{}},[]),zn=N.useCallback(()=>{if(ee){Ye(wn);try{window.localStorage.setItem(Jv,wn)}catch{}}},[ee,wn]),[bn,hi]=N.useState(()=>{if(typeof window>"u")return"";try{return window.localStorage.getItem(eC)??""}catch{return""}}),fn=le!=null&&le.invokedAs&&le.invokedAs!==Yt?le.invokedAs:null,pi=fn!=null&&bn!==fn,mi=N.useCallback(()=>{if(fn){hi(fn);try{window.localStorage.setItem(eC,fn)}catch{}}},[fn]),qt=((Qo=le==null?void 0:le.upgrade)==null?void 0:Qo.state)??"idle",Sr=t4(le==null?void 0:le.upgrade),Bn=N.useRef(!1),Rs=N.useCallback(async()=>{if(js(Bn.current||qt==="running")){Bn.current=!0;try{await fetch("/api/upgrade",{method:"POST"})}catch{}await Xe(),Bn.current=!1}},[qt,Xe]);N.useEffect(()=>{if(qt!=="running")return;const F=window.setInterval(Xe,3e3);return()=>window.clearInterval(F)},[qt,Xe]);const Er=N.useCallback(async()=>{var ie;const F=le==null?void 0:le.command;if(!F)return;let W=!1;try{W=await Promise.race([((ie=navigator.clipboard)==null?void 0:ie.writeText(F).then(()=>!0))??Promise.resolve(!1),new Promise(de=>window.setTimeout(()=>de(!1),500))])}catch{W=!1}if(!W)try{const de=document.createElement("textarea");de.value=F,de.setAttribute("readonly",""),de.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(de),de.select(),W=document.execCommand("copy"),de.remove()}catch{W=!1}W&&(ft(!0),window.setTimeout(()=>ft(!1),1600))},[le==null?void 0:le.command]),Ao=N.useCallback(()=>{O(F=>(F||G(!1),!F))},[]),lr=N.useCallback(()=>{G(F=>(F||O(!1),!F))},[]),[Nr,ur]=N.useState(!1),[As,gi]=N.useState(0),vi=N.useRef(null),[yi,kn]=N.useState(!1),cr=N.useRef(null),[wi,xi]=N.useState(0),Bt=N.useState(()=>aD({protect:F=>FL(s.current,F)}))[0],[Cr,_i]=N.useState(!1),Zr=N.useCallback(()=>{const F=Bt.paused&&Bt.dropped>0,W=Bt.setPaused(!Bt.paused);F&&zL(s.current);for(const ie of W)s.current=P_(s.current,ie);_i(Bt.paused)},[Bt]),[xt,Io]=N.useState(Date.now()),[st,Mo]=N.useState(()=>{if(typeof window>"u")return!0;try{return window.localStorage.getItem(tC)!=="0"}catch{return!0}}),Is=N.useCallback(()=>{Mo(F=>{const W=!F;try{window.localStorage.setItem(tC,W?"1":"0")}catch{}return W})},[]),[Sn,Un]=N.useState(!1),[bi,ki]=N.useState("restart"),[jr,Kt]=N.useState(null),En=N.useRef(!1),tn=N.useRef(null),ul=N.useRef(0),Si=N.useCallback(async F=>{if(!js(En.current))return;const W=(F==null?void 0:F.upgrade)===!0;En.current=!0,tn.current=Sr;const ie=++ul.current;ki(W?"npx":"restart"),Un(!0);try{window.sessionStorage.setItem("agent-dag.restartPending",(ee==null?void 0:ee.to)??"")}catch{}try{await fetch("/api/restart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({upgrade:W})})}catch{}window.setTimeout(()=>{if(ul.current===ie&&En.current){En.current=!1,Un(!1);try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}}},W?18e4:3e4)},[ee==null?void 0:ee.to,Sr]),cl=N.useRef(null);N.useEffect(()=>{let F=!1;for(const ie of s.current.agents.values())if(ie.state==="active"){F=!0;break}const W=r4({enabled:st,kind:ee==null?void 0:ee.kind,canRestart:(le==null?void 0:le.canRestart)===!0,busy:F,idleSince:cl.current,now:xt});cl.current=W.idleSince,W.restart&&Si()},[st,ee==null?void 0:ee.kind,le==null?void 0:le.canRestart,xt,Si]),N.useEffect(()=>{const F=le==null?void 0:le.running;let W=null,ie=null;try{W=window.sessionStorage.getItem("agent-dag.restartPending"),ie=window.sessionStorage.getItem(nC)}catch{return}const de=e4({bundle:"1.46.2",running:F,pending:W,lastTried:ie});if(de==="reload"){try{window.sessionStorage.setItem(nC,F??"")}catch{return}window.location.reload();return}if(de!=="confirm")return;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}En.current=!1,Un(!1),Kt(F??null);const _e=window.setTimeout(()=>Kt(null),6e3);return()=>window.clearTimeout(_e)},[le==null?void 0:le.running]),N.useEffect(()=>{if(Sn&&n4({asked:tn.current,reported:Sr})){try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}En.current=!1,Un(!1)}},[Sn,Sr]);const Ms=N.useState(()=>a6(F6()))[0],Mt=N.useRef(Ms.pinned),dr=N.useRef(null),Tr=N.useState(()=>z6())[0],[dl,$c]=N.useState(()=>new Set),[Rr,Oo]=N.useState(uD),[Hn,Os]=N.useState(()=>GN(XN)),fl=N.useMemo(()=>i6(Hn),[Hn]),Po=N.useCallback(F=>s6(F,fl),[fl]),Je=N.useMemo(()=>({background:Hn["--panel"],border:`1px solid ${Hn["--line"]}`,borderRadius:8}),[Hn]),[Lo,hl]=N.useState(!1);N.useEffect(()=>{document.documentElement.dataset.theme=Rr;try{window.localStorage.setItem(dT,Rr)}catch{}Os(F=>{const W=GN(XN);return o6(F,W)?F:W})},[Rr]);const Wn=N.useCallback((F,W)=>{if(Qv({durationMs:W,documentHidden:document.hidden})){e.setViewport(F,{duration:W});return}const{d3Zoom:ie,d3Selection:de}=t.getState(),_e=de==null?void 0:de.property("__zoom");if(ie&&de&&_e&&_e.k>0&&F.zoom>0){ie.transform(de,_e.scale(F.zoom/_e.k).translate((F.x-_e.x)/F.zoom,(F.y-_e.y)/F.zoom));return}e.setViewport(F,{duration:0})},[e,t]),Jr=N.useRef(null);N.useEffect(()=>{if(!Tr)return;const F=window.setTimeout(()=>{try{Wn(Tr,0)}catch{}Nn.current=Date.now()},60);return()=>window.clearTimeout(F)},[Wn,Tr]);const $o=N.useRef(!0);N.useEffect(()=>{const F=new EventSource("/events"),W=iD(a,{now:()=>Date.now(),setTimeout:(ie,de)=>window.setTimeout(ie,de),clearTimeout:ie=>window.clearTimeout(ie)});return F.addEventListener("open",()=>{ke(!0),hl(!0)}),F.addEventListener("error",()=>ke(!1)),F.addEventListener("replay-end",()=>{$o.current=!1,W.flush()}),F.addEventListener("hook",ie=>{var de;try{const _e=JSON.parse(ie.data);if(!Bt.accept(_e))return;s.current=P_(s.current,_e);const Se=_e.replay===!0||$o.current||Date.now()-_e.receivedAt>3e4;Se?W.replay():W.live();const Fe=N4(_e,Se);Fe&&((de=Me.current)==null||de.play(Fe))}catch{}}),()=>{F.close(),W.cancel()}},[a]),N.useEffect(()=>{const F=setInterval(()=>{const W=Date.now();Io(W);let ie=BL(s.current,W,O_);UL(s.current,W,O_)&&(ie=!0),qL(s.current,W,j6,T6)&&(ie=!0),DL(s.current,W,R6,A6)&&(ie=!0),c(de=>X4(de,s.current.agents)),p(de=>de!=null&&!s.current.agents.has(de)?null:de),ie&&a()},250);return()=>clearInterval(F)},[a]);const Ei=N.useRef(null),Nn=N.useRef(0),Ni=420,jt=N.useCallback((F=500)=>{try{const Se=document.querySelector(".canvas-wrap"),Fe=Array.from(document.querySelectorAll(".react-flow__node")).filter(nt=>nt.offsetWidth>0);if(!Se||Fe.length===0)return;const Ke=Se.getBoundingClientRect(),ht=e.getViewport();if(!Number.isFinite(ht.zoom)||ht.zoom<=0)return;const at=nt=>(nt-Ke.left-ht.x)/ht.zoom,Ut=nt=>(nt-Ke.top-ht.y)/ht.zoom,os=Fe.map(nt=>nt.getBoundingClientRect()),Jo=Math.min(...os.map(nt=>at(nt.left))),jl=Math.max(...os.map(nt=>at(nt.right))),ea=Math.min(...os.map(nt=>Ut(nt.top))),Wc=Math.max(...os.map(nt=>Ut(nt.bottom))),Tl=jl-Jo,ta=Wc-ea;if(!(Tl>0&&ta>0))return;const Fs=Math.max(.2,Math.min(1,(Ke.width-160)/(Tl+Ni)*.86,(Ke.height-160)/ta*.86)),zs={x:80-Jo*Fs,y:Math.max(80,(Ke.height-ta*Fs)/2)-ea*Fs,zoom:Fs};Wn(zs,F),Nn.current=Date.now(),Jr.current=Qv({durationMs:F,documentHidden:document.hidden})?{target:zs,until:Date.now()+F+60}:null,window.setTimeout(()=>{var nt;try{((nt=Jr.current)==null?void 0:nt.target)===zs&&(Jr.current=null);const as=e.getViewport();(Math.abs(as.zoom-Fs)>.01||Math.abs(as.x-zs.x)>2)&&Wn(zs,0)}catch{}},F+60)}catch{}},[e,Wn]);N.useEffect(()=>{const F=()=>{if(!document.hidden)return;const W=Jr.current;if(Jr.current=null,!(!W||Date.now()>W.until)){try{Wn(W.target,0)}catch{}Nn.current=Date.now()}};return document.addEventListener("visibilitychange",F),()=>document.removeEventListener("visibilitychange",F)},[Wn]);const Cn=N.useRef(""),jn=N.useRef(null),es=N.useRef(0),fr=N.useCallback(()=>{es.current=Date.now()},[]),Tn=N.useRef(null),pl=N.useRef(0),Ci=N.useCallback(()=>{pl.current=Date.now()},[]),ts=N.useCallback(F=>({hasSourceEvent:!!F,at:Date.now(),lastDeckFitAt:Nn.current,lastCanvasInputAt:pl.current}),[]),qo="agent-dag.autoFitDisabled",Do=N.useState(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(qo)==="1"}catch{return!1}})[0],Vn=N.useRef(Do),[Fo,ml]=N.useState(Do),Ar=N.useCallback(()=>{if(!Vn.current){Vn.current=!0,ml(!0);try{window.localStorage.setItem(qo,"1")}catch{}}},[]),Ps=N.useCallback(()=>{Vn.current=!1,ml(!1);try{window.localStorage.removeItem(qo)}catch{}jt(400)},[e,jt]);N.useEffect(()=>{const F=setInterval(()=>{if(Vn.current||Date.now()-es.current<800)return;const W=s.current,ie=Date.now(),de=[];for(const Se of W.agents.values())Ty(Se,ie)&&de.push({id:Se.id});if(de.length===0)return;const _e=[];for(const{id:Se}of de){const Fe=Gn.current.get(Se),Ke=Mt.current.get(Se)??Xt.current.get(Se);!Fe||!Ke||_e.push({x:Ke.x,y:Ke.y,width:Fe.width,height:Fe.height})}d6({pane:Tn.current,viewport:e.getViewport(),boxes:_e})&&jt(600)},1500);return()=>clearInterval(F)},[e]);const hr=N.useRef(!1),Gn=N.useRef(new Map),gl=N.useRef(0),qc=N.useCallback(F=>{const W=Gn.current;let ie=!1;for(const de of F.nodeInternals.values()){const _e=de.width,Se=de.height;if(_e==null||Se==null)continue;const Fe=W.get(de.id);Fe?(Math.abs(Fe.height-Se)>4||Math.abs(Fe.width-_e)>4)&&(W.set(de.id,{width:_e,height:Se}),ie=!0):(W.set(de.id,{width:_e,height:Se}),ie=!0)}return ie&&(gl.current+=1),gl.current},[]),ji=it(qc),[Ls,zo]=N.useState(0);N.useEffect(()=>{let F=0;const W=()=>{const de=Gn.current;let _e=!1;for(const Se of document.querySelectorAll(".react-flow__node[data-id]")){const Fe=Se.getAttribute("data-id");if(!Fe)continue;const Ke=Se.offsetWidth,ht=Se.offsetHeight;if(!Ke||!ht)continue;const at=de.get(Fe);(!at||Math.abs(at.width-Ke)>4||Math.abs(at.height-ht)>4)&&(de.set(Fe,{width:Ke,height:ht}),_e=!0)}_e&&zo(Se=>Se+1)};if(hr.current)return;let ie=0;return document.visibilityState==="hidden"?ie=window.setTimeout(W,32):F=requestAnimationFrame(W),()=>{cancelAnimationFrame(F),window.clearTimeout(ie)}});const Xt=N.useRef(Ms.positions),pr=N.useRef(new Set),$s=N.useRef(""),Yn=N.useMemo(()=>{const F=[];for(const W of s.current.agents.values())Ty(W,xt)&&F.push(W.id+(W.parentId?`>${W.parentId}`:""));return F.sort(),`${F.join("|")}#sv${ji}.${Ls}`},[s.current,s.current.revision,xt,ji,Ls]),ns=N.useRef(null);N.useEffect(()=>(ns.current!=null&&window.clearTimeout(ns.current),ns.current=window.setTimeout(()=>{ty(Xt.current,Mt.current)},1500),()=>{ns.current!=null&&window.clearTimeout(ns.current)}),[Yn]),N.useEffect(()=>{if(Cn.current===Yn)return;const F=Cn.current;if(Cn.current=Yn,!F||Vn.current)return;Date.now()-Nn.current>1200&&jt(400),Ei.current&&window.clearTimeout(Ei.current),Ei.current=window.setTimeout(()=>{Vn.current||jt(500)},280)},[Yn,e,jt]);const rs=N.useMemo(()=>J4(s.current,u),[s.current,s.current.revision,u]),ss=N.useMemo(()=>t6(s.current,xt),[s.current,s.current.revision,xt]),Bo=N.useRef(null),[Ot,Ir]=N.useState({w:0,h:0});N.useEffect(()=>{const F=Bo.current;if(!F||typeof ResizeObserver>"u")return;const W=new ResizeObserver(ie=>{var _e;const de=(_e=ie[0])==null?void 0:_e.contentRect;de&&(Tn.current={width:de.width,height:de.height},Ir(Se=>Math.abs(Se.w-de.width)>40||Math.abs(Se.h-de.height)>40?{w:de.width,h:de.height}:Se))});return W.observe(F),Tn.current={width:F.clientWidth,height:F.clientHeight},Ir({w:F.clientWidth,h:F.clientHeight}),()=>W.disconnect()},[]);const Uo=N.useCallback(F=>{var ie,de;const W=F.target;!(W!=null&&W.closest)||W.closest(N6)!==F.currentTarget||(F.preventDefault(),(de=(ie=document.activeElement)==null?void 0:ie.blur)==null||de.call(ie))},[]),qs=N.useRef(new Map),[vl,Ho]=N.useState(!1);N.useEffect(()=>{const F=window.setTimeout(()=>Ho(!0),2500);return()=>window.clearTimeout(F)},[]);const[Wo,Mr]=N.useState(!1),hn=N.useRef(null),[Ti,yl]=N.useState(!1),Dc=N.useCallback(()=>{hn.current&&(window.clearTimeout(hn.current),hn.current=null),Mr(!1)},[]),Fc=N.useCallback(F=>{F.length!==0&&queueMicrotask(()=>{Mr(!0),hn.current&&window.clearTimeout(hn.current),hn.current=window.setTimeout(()=>Mr(!1),C6+80)})},[]);N.useEffect(()=>()=>{hn.current&&window.clearTimeout(hn.current)},[]);const Ri=Ot.w>0?Ot.w*.92:0,wl=Ot.h>0?Ot.h:0,{nodes:mr,edges:zc}=N.useMemo(()=>H6(s.current,xt,Ri,wl,Mt.current,Gn.current,qs.current,Fc,vl,Ti,Xt.current,pr.current,Yn,$s,u,rs,ss,E),[s.current,s.current.revision,xt,Ri,wl,vl,Ti,Yn,u,rs,ss,E,As]),xl=N.useMemo(()=>{const F=new Map;for(const ie of mr){const de=ie.data;if(!(de!=null&&de.sessionId)||de.exitAt!=null)continue;const _e=ie.width,Se=ie.height;if(_e==null||Se==null)continue;const Fe=ie.position.x,Ke=ie.position.y,ht=Fe+_e,at=Ke+Se,Ut=F.get(de.sessionId);Ut?(Ut.minX=Math.min(Ut.minX,Fe),Ut.minY=Math.min(Ut.minY,Ke),Ut.maxX=Math.max(Ut.maxX,ht),Ut.maxY=Math.max(Ut.maxY,at)):F.set(de.sessionId,{minX:Fe,minY:Ke,maxX:ht,maxY:at})}const W=[];for(const[ie,de]of F){const _e=de.maxX-de.minX+Fu*2,Se=de.maxY-de.minY+Fu*2;W.push({id:`group:${ie}`,type:hR,position:{x:de.minX-Fu,y:de.minY-Fu},data:{sessionId:ie,w:_e,h:Se},width:_e,height:Se,style:{width:_e,height:Se},zIndex:-1,draggable:!0,selectable:!1,focusable:!1,deletable:!1,connectable:!1})}return W},[mr,xt]),Bc=N.useMemo(()=>{const F=[...xl,...mr],W=cr.current;return!W||W.size===0?F:F.map(ie=>{const de=W.get(ie.id);return de?{...ie,position:de}:ie})},[xl,mr,wi]),Ds=N.useMemo(()=>{const F=new Set;for(const W of s.current.agents.values())for(const ie of W.tools)F.add(_R(ie.name));return Object.keys(Ay).filter(W=>F.has(W))},[s.current,s.current.revision]);N.useEffect(()=>{if(Ds.length<=1){kn(!1);return}let F=0;const W=()=>{const ie=vi.current;if(ie&&!document.hidden){const de=ie.getBoundingClientRect(),_e=Array.from(document.querySelectorAll(".react-flow__node, .tool-burst")).map(Fe=>Fe.getBoundingClientRect()),Se=r6(de,_e,8);kn(Fe=>Fe===Se?Fe:Se)}F=window.setTimeout(W,300)};return W(),()=>window.clearTimeout(F)},[Ds.length]);const Uc=N.useCallback(F=>{$c(W=>{const ie=new Set(W);return ie.has(F)?ie.delete(F):ie.add(F),ie})},[]),Qt=f?s.current.agents.get(f):null,Vo=d?Array.from(s.current.agents.values()).flatMap(F=>F.tools).find(F=>F.id===d)??null:null,_l=N.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}s.current=yy(),Mt.current.clear(),Gn.current.clear(),Xt.current.clear(),$s.current="",sC(),w(),a()},[a,w]),Ai=N.useRef(C);Ai.current=C;const bl=N.useRef(A);bl.current=A;const Go=N.useRef(!1);Go.current=Vo!=null||Nr||b!=null||S!=null||A||Le!=null;const Ii=N.useCallback(F=>{const W=s4(F,{confirmOpen:Ai.current,modalOpen:Go.current});W==="confirm"?T(!0):W==="clear"&&(T(!1),_l())},[_l]),Mi=N.useCallback(()=>{Mt.current.clear(),Xt.current.clear(),$s.current="",sC(),a(),window.setTimeout(()=>jt(500),80)},[a,e,jt]),kl=N.useCallback(()=>jt(500),[jt]),Oi=N.useRef(mr);Oi.current=mr;const Sl=N.useRef(f);Sl.current=f;const Yo=N.useCallback(F=>{const W=Oi.current,ie=W4(W.map(Se=>({id:Se.id,x:Se.position.x,y:Se.position.y})),Sl.current,F),de=ie?W.find(Se=>Se.id===ie):void 0;if(!de)return;const _e=QN(document.activeElement);y(de.id,!1),window.setTimeout(()=>{try{e.fitView({padding:.35,duration:350,nodes:[de]})}catch{}Nn.current=Date.now(),_e&&E6(de.id)},30)},[y,e]),El=N.useCallback(F=>{y(F,!1),window.setTimeout(()=>{try{const W=Oi.current.find(ie=>ie.id===F);W&&e.fitView({padding:.3,duration:500,nodes:[W]}),Nn.current=Date.now()}catch{}},60)},[y,e]);N.useEffect(()=>{const F=W=>{var Ke,ht;const ie=W.target,de={tagName:ie==null?void 0:ie.tagName,isContentEditable:ie==null?void 0:ie.isContentEditable,role:(Ke=ie==null?void 0:ie.getAttribute)==null?void 0:Ke.call(ie,"role"),type:ie==null?void 0:ie.type};if(W.key==="Escape"){const at=c$({overlayOpen:po.depth()>0,panelOnTop:po.topIsPanel(),typing:t0(de)});at==="dismiss"?po.dismissTop():at==="blur"?ie==null||ie.blur():(K4(de)&&(ie==null||ie.blur()),w());return}if(e0(W))return;const _e=QN(ie)?(ht=ie==null?void 0:ie.getAttribute)==null?void 0:ht.call(ie,"data-id"):null,Se=_e&&Oi.current.some(at=>at.id===_e)?_e:null,Fe=G4(W,Se);if(Fe.kind==="activate"){W.preventDefault(),y(Fe.nodeId,Fe.additive);return}Fe.kind!=="node"&&(Fe.nodeId==null&&y$(de)||w$({key:W.key,modalOpen:Go.current,sheetOpen:bl.current})||(W.key===" "&&(W.preventDefault(),Zr()),(W.key==="c"||W.key==="C")&&Ii("shortcut"),(W.key==="r"||W.key==="R")&&Mi(),(W.key==="f"||W.key==="F")&&kl(),(W.key==="l"||W.key==="L")&&Ao(),(W.key==="h"||W.key==="H")&&ur(at=>!at),(W.key==="u"||W.key==="U")&&X(at=>!at),(W.key==="a"||W.key==="A")&&dn.current.claude&&lr(),(W.key==="j"||W.key==="J")&&Yo(1),(W.key==="k"||W.key==="K")&&Yo(-1),(W.key==="t"||W.key==="T")&&Oo(at=>at==="dark"?"light":"dark"),(W.key==="m"||W.key==="M")&&dn.current.claude&&I.current!==null&&H.current(W.shiftKey),W.key==="?"&&L(at=>!at)))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[Ii,Mi,kl,w,y,Yo,Zr]);const Ko=s.current.agents.size,Kn=N.useMemo(()=>R3(s.current.agents.values()),[s.current,s.current.revision]),Pi=N.useMemo(()=>A3(s.current.agents.values()),[s.current,s.current.revision]),is=N.useRef(null);N.useEffect(()=>{const F=cD({waiting:Kn.length,running:Pi}),W=is.current;if(is.current=F,(W==null?void 0:W.title)!==F.title&&(document.title=F.title),(W==null?void 0:W.icon)!==F.icon){const ie=document.querySelector('link[rel="icon"]');ie&&(ie.href=dD[F.icon])}},[Kn.length,Pi]);const[Hc,Nl]=N.useState(""),Xo=hD(Kn);N.useEffect(()=>{Nl(F=>pD(F,Xo))},[Xo]);const Zt=N.useMemo(()=>Kj(s.current.agents.values()),[s.current,s.current.revision]);return m.jsxs("div",{className:"app",children:[m.jsx("a",{className:"skip-link",href:"#canvas",children:"Skip to the canvas"}),m.jsxs("header",{className:"topbar",children:[m.jsxs("div",{className:"readout",children:[m.jsxs("div",{className:"brand",children:[m.jsx("span",{className:"logo"}),m.jsx("h1",{children:Yt}),ee?m.jsxs("button",{type:"button",className:"v stale",onClick:()=>{tt(),_n()},"aria-haspopup":"dialog","aria-label":m6({...ee,open:xn}),title:ee.kind==="restart"?`Running v${ee.from}; v${ee.to} is installed on disk. Restart to pick it up · click for what's new`:`Running v${ee.from}; v${ee.to} is on npm · click for what's new`,children:["v",ee.from,m.jsx("span",{className:"v-dot","aria-hidden":!0})]}):(()=>{const F={running:$e,latest:le==null?void 0:le.latest,latestPending:le==null?void 0:le.latestPending,checkedAgo:le!=null&&le.checkedAt?by(xt-le.checkedAt):null,checkDisabled:le==null?void 0:le.checkDisabled,checking:Be};return m.jsxs("button",{type:"button",className:Be?"v checking":"v",onClick:()=>{tt(),Xe(!0)},"aria-busy":Be||void 0,"aria-haspopup":"dialog","aria-label":p6(F),title:h6(F),children:["v",F.running]})})()]}),m.jsxs("span",{className:"status",children:[(()=>{const F=k6({connected:Ie,paused:Cr,held:Bt.size,dropped:Bt.dropped});return m.jsx("span",{className:`pill ${F.tone}`,title:F.title,children:m.jsxs("span",{className:"pill-box",children:[m.jsx("span",{className:"pill-widest","aria-hidden":!0,children:F.widest}),m.jsx("span",{className:"pill-label",children:F.label})]})})})(),m.jsx(nq,{usageOpen:V}),Zt.sum>0&&m.jsxs("span",{className:"stat",title:`in:${Zt.inputTokens.toLocaleString()} out:${Zt.outputTokens.toLocaleString()} cache-r:${Zt.cacheReadTokens.toLocaleString()} cache-c:${Zt.cacheCreateTokens.toLocaleString()}
|
|
88
88
|
|
|
89
|
-
${ic}`,children:[m.jsx("span",{className:"count",children:At(Zt.sum)}),m.jsx("span",{className:"lbl",children:N3})]}),Zt.cost.total>0&&(()=>{let F=0,W=0;for(const _e of s.current.agents.values()){if(_e.state!=="active")continue;const Se=vn(_e);F+=Se.total,W=Math.max(W,((_e.endedAt??xt)-_e.startedAt)/1e3)}const
|
|
90
|
-
active burn: ${
|
|
89
|
+
${ic}`,children:[m.jsx("span",{className:"count",children:At(Zt.sum)}),m.jsx("span",{className:"lbl",children:N3})]}),Zt.cost.total>0&&(()=>{let F=0,W=0;for(const _e of s.current.agents.values()){if(_e.state!=="active")continue;const Se=vn(_e);F+=Se.total,W=Math.max(W,((_e.endedAt??xt)-_e.startedAt)/1e3)}const ie=W>0?rc(F,W):null,de=`input ${Ge(Zt.cost.input)} + output ${Ge(Zt.cost.output)} + cache r ${Ge(Zt.cost.cacheRead)} + cache w ${Ge(Zt.cost.cacheWrite)}${ie?`
|
|
90
|
+
active burn: ${ie}`:""}
|
|
91
91
|
|
|
92
|
-
${ic}`;return m.jsxs("span",{className:"stat",title:de,children:[m.jsx("span",{className:"count",children:Ge(Zt.cost.total)}),m.jsxs("span",{className:"lbl",children:[C3,
|
|
92
|
+
${ic}`;return m.jsxs("span",{className:"stat",title:de,children:[m.jsx("span",{className:"count",children:Ge(Zt.cost.total)}),m.jsxs("span",{className:"lbl",children:[C3,ie?` · ${ie}`:""]})]})})()]}),m.jsx("div",{className:"vis-hidden",role:"status","aria-atomic":"true",children:Hc}),Kn.length>0&&m.jsxs("button",{type:"button",className:"waiting-stat",onClick:()=>El(Kn[0].id),title:`Blocked waiting for you — click to go to the one that has been stuck longest:
|
|
93
93
|
${Kn.map(F=>` ${F.label}: ${vc(F.waiting)} (${by(xt-F.waiting.since)})`).join(`
|
|
94
|
-
`)}`,"aria-label":`${Kn.length} session${Kn.length===1?"":"s"} waiting for you`,children:[m.jsx("span",{className:"ap-pulse","aria-hidden":!0}),m.jsx("b",{children:Kn.length})," waiting"]})]}),Qt&&(()=>{const F=vn(Qt),W=Math.max(0,((Qt.endedAt??xt)-Qt.startedAt)/1e3),ae=Qt.state==="active"?rc(F.total,W):null,de=u.size-1;return m.jsxs("button",{type:"button",className:"selected-ribbon",title:`Fit view to ${Qt.label}`,onClick:()=>{try{const _e=mr.find(Se=>Se.id===Qt.id);_e&&e.fitView({padding:.35,duration:500,nodes:[_e]}),Nn.current=Date.now()}catch{}},children:[m.jsx("span",{className:`state-pill state-${Qt.state}`,children:Qt.state==="active"?"live":Qt.state}),m.jsx("span",{className:"selected-label",children:Qt.label}),F.total>0&&m.jsxs("span",{className:"selected-cost",children:[Ge(F.total),ae?m.jsxs("span",{className:"selected-rate",children:[" · ",ae]}):null]}),de>0&&m.jsxs("span",{className:"selected-extra",children:["+",de]}),m.jsx("span",{"aria-hidden":!0,className:"selected-close",onClick:_e=>{_e.stopPropagation(),w()},children:"×"})]})})(),m.jsxs("div",{className:"actions",children:[m.jsxs("div",{className:"action-run",children:[m.jsx("button",{className:"btn icon-btn",onClick:()=>X(F=>!F),title:`${V?"Hide":"Show"} usage panel (U)`,"aria-label":"Toggle usage panel","aria-expanded":V,"aria-controls":V?"usage-panel":void 0,children:"$"}),Ve.claude&&m.jsx("button",{className:"btn icon-btn",onClick:lr,title:`${j?"Hide":"Show"} accounts (A)`,"aria-label":"Toggle accounts panel","aria-expanded":j,"aria-controls":j?"accounts-panel":void 0,children:m.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:[m.jsx("circle",{cx:"7",cy:"4.6",r:"2.4"}),m.jsx("path",{d:"M2.4 12c0-2.3 2.1-3.7 4.6-3.7s4.6 1.4 4.6 3.7"})]})}),m.jsx("button",{className:"btn icon-btn",onClick:()=>ur(F=>!F),title:"Usage history — ccusage (H)","aria-label":"Open usage history","aria-haspopup":"dialog",children:m.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":!0,children:[m.jsx("line",{x1:"3",y1:"11.5",x2:"3",y2:"7"}),m.jsx("line",{x1:"7",y1:"11.5",x2:"7",y2:"3"}),m.jsx("line",{x1:"11",y1:"11.5",x2:"11",y2:"8.5"})]})})]}),m.jsxs("div",{className:"action-run",children:[Ve.claude&&B!==null&&m.jsxs("div",{className:"sound-slot",children:[m.jsx("button",{ref:ye,className:"btn icon-btn",onClick:()=>pe(F=>!F),...Wr(!1),title:xD(Ve,{on:B===!0,locked:Ue==="locked",prefs:Y}),"aria-label":"Sound settings","aria-haspopup":"dialog","aria-expanded":fe,"aria-controls":fe?"sound-menu":void 0,children:m.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:[m.jsx("path",{d:"M3.2 5.2h2L7.8 3v8L5.2 8.8h-2z"}),B?m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M9.8 5.4a2.4 2.4 0 0 1 0 3.2"}),m.jsx("path",{d:"M11.3 3.9a4.6 4.6 0 0 1 0 6.2"})]}):m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M10 5.6l2.6 2.8"}),m.jsx("path",{d:"M12.6 5.6L10 8.4"})]})]})}),fe&&m.jsx(T4,{onClose:()=>pe(!1),soundOn:B===!0,onToggleSound:Z,prefs:Y,onLevel:(F,W)=>oe(F,{level:W}),onFigure:(F,W)=>oe(F,{figure:W}),onPreview:F=>ne(F),openerRef:ye})]}),m.jsx("button",{className:"btn icon-btn",onClick:()=>Io(F=>F==="dark"?"light":"dark"),title:`Switch to ${Rr==="dark"?"light":"dark"} mode (T)`,"aria-label":"Toggle theme",children:Rr==="dark"?"☀":"☾"})]})]})]}),jr?m.jsxs("div",{className:"ver-banner done",role:"status",children:[m.jsx("span",{className:"ver-dot"}),m.jsxs("strong",{children:["Restarted — now running v",jr,"."]}),m.jsx("span",{className:"ver-sub",children:"The canvas replayed from the event log."})]}):Oo&&!Ie?m.jsxs("div",{className:"conn-banner",role:"alert",children:[m.jsx("span",{className:"conn-dot"}),Sn?bi==="npx"?"Fetching the new version with npx — this can take a minute…":`Restarting ${Yt}…`:(()=>{const F=w6({connected:Ie,paused:Cr});return m.jsxs(m.Fragment,{children:[`Lost connection to the ${Yt} server. Reconnecting…`,F&&m.jsx("span",{className:"conn-sub",children:F})]})})()]}):xn&&ee?m.jsxs("div",{className:`ver-banner ${ee.kind}`,role:"status",children:[m.jsx("span",{className:"ver-dot"}),ee.kind==="restart"?m.jsxs(m.Fragment,{children:[m.jsxs("strong",{children:["v",ee.to," is installed — this deck still runs v",ee.from,"."]}),le!=null&&le.canRestart?m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"ver-act",onClick:()=>Si(),...Wr(Sn),title:"Stop this process and bring it back on the same port. The canvas replays from the event log.",children:Sn?"restarting…":"Restart now"}),m.jsxs("button",{type:"button",className:`ver-auto${st?" on":""}`,role:"switch","aria-checked":st,onClick:Is,title:st?"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:[m.jsx("i",{"aria-hidden":!0}),"auto when idle"]})]}):m.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."})]}):m.jsxs(m.Fragment,{children:[m.jsxs("strong",{children:[Yt," v",ee.to," is out — you are on v",ee.from,"."]}),(le==null?void 0:le.upgradeMode)==="install"&&qt!=="failed"&&m.jsx("button",{type:"button",className:"ver-act",onClick:Rs,...Wr(qt==="running",qt==="done"),title:`Runs ${((Xo=le==null?void 0:le.upgrade)==null?void 0:Xo.command)??(le==null?void 0:le.command)??"npm i -g"} here, then restarts once nothing is running.`,children:qt==="running"?"installing…":qt==="done"?"installed":"Update now"}),(le==null?void 0:le.upgradeMode)==="npx"&&(le==null?void 0:le.canRestart)&&m.jsx("button",{type:"button",className:"ver-act",onClick:()=>Si({upgrade:!0}),...Wr(Sn),title:`Runs ${le==null?void 0:le.command} and hands it this port. Nothing is installed globally — npx unpacks its own copy.`,children:Sn?"fetching…":qt==="failed"?"Retry update":"Update & restart"}),qt==="failed"?m.jsxs("span",{className:"ver-sub fail",title:((Or=le==null?void 0:le.upgrade)==null?void 0:Or.error)??"",children:[(le==null?void 0:le.upgradeMode)==="npx"?"update failed":"install failed",": ",((Cl=le==null?void 0:le.upgrade)==null?void 0:Cl.error)??"unknown error"," — run it yourself:"]}):(le==null?void 0:le.upgradeMode)==="npx"?m.jsx("span",{className:"ver-sub",children:le!=null&&le.canRestart?"npx cannot upgrade in place, so the deck re-runs:":ey.npx}):le!=null&&le.upgradeBlocked?m.jsx("span",{className:"ver-sub",children:Object.hasOwn(ey,le.upgradeBlocked)?ey[le.upgradeBlocked]:"cannot install from here"}):null,m.jsxs("button",{type:"button",className:"ver-cmd",onClick:Er,title:"Copy to clipboard",children:[m.jsx("code",{children:le==null?void 0:le.command}),m.jsx("span",{className:"ver-cmd-hint",children:gt?"copied":"copy"})]})]}),m.jsx("button",{type:"button","aria-label":"Dismiss",className:"ver-close",onClick:zn,children:"×"})]}):pi&&fn?m.jsxs("div",{className:"ver-banner",role:"status",children:[m.jsx("span",{className:"ver-dot"}),m.jsxs("strong",{children:[fn," still works — the deck is called ",Yt," now."]}),le!=null&&le.renameFix?m.jsx("span",{className:"ver-sub",children:le.renameFix}):null,m.jsx("button",{type:"button","aria-label":"Dismiss",className:"ver-close",onClick:mi,children:"×"})]}):null,V&&m.jsx(W3,{state:s.current,now:xt,providers:Ve,onClose:()=>X(!1)}),j&&Ve.claude&&m.jsx(Qq,{onClose:()=>G(!1)}),U&&m.jsx(M3,{state:s.current,now:xt,selectedIds:u,onSelect:El,onClose:()=>O(!1)}),m.jsxs("main",{id:"canvas",tabIndex:-1,className:`canvas-wrap${Uo?" bubbling":""}${Ti?" dragging-any":""}`,ref:Fo,onMouseDownCapture:zo,onPointerDownCapture:Ci,onPointerUpCapture:Ci,onWheelCapture:Ci,children:[Go===0&&m.jsx(W6,{live:Ie,everConnected:Oo,providers:Ve}),Ds.length>1&&m.jsx("div",{ref:vi,className:`cat-filter-bar${yi?" occluded":""}`,role:"group","aria-label":"Filter tools by category",children:Ds.map(F=>{const W=dl.has(F);return m.jsxs("button",{type:"button",className:`cat-filter${W?" off":""}`,onClick:()=>Uc(F),"aria-pressed":!W,title:`${W?"Show":"Hide"} ${Iy[F]} tools`,children:[m.jsx("span",{className:"cat-emoji",children:Ay[F]}),m.jsx("span",{className:"cat-name",children:Iy[F]})]},F)})}),m.jsxs(bj,{nodes:Bc,edges:zc,nodeTypes:b6,fitView:!Tr,fitViewOptions:{padding:.25,duration:Qv({durationMs:QN,documentHidden:document.hidden})?QN:0},minZoom:.2,maxZoom:1.6,panOnScroll:!0,nodesDraggable:!0,nodesConnectable:!1,selectionOnDrag:!1,nodeDragThreshold:5,onNodeClick:(F,W)=>{if(W.type==="sessionGroup"){w();return}y(W.id,F.shiftKey)},onPaneClick:()=>w(),onMoveStart:F=>{GN(ts(F))&&Ar()},onMove:(F,W)=>{fr(),GN(ts(F))&&Ar(),jn.current&&window.clearTimeout(jn.current),jn.current=window.setTimeout(()=>F6(W),250)},onNodeDragStart:(F,W)=>{var ae;if(Dc(),hr.current=!0,cr.current=new Map,yl(!0),fr(),Ar(),W.type==="sessionGroup"){const de=(ae=W.data)==null?void 0:ae.sessionId,_e=new Map;if(de)for(const Se of mr){const Fe=Se.data;(Fe==null?void 0:Fe.sessionId)===de&&_e.set(Se.id,{x:Se.position.x,y:Se.position.y})}dr.current={start:{x:W.position.x,y:W.position.y},members:_e};return}Mt.current.set(W.id,{x:W.position.x,y:W.position.y})},onNodeDrag:(F,W)=>{var ae;if(fr(),W.type==="sessionGroup"){const de=dr.current;if(!de)return;const _e=W.position.x-de.start.x,Se=W.position.y-de.start.y;for(const[Ke,ht]of de.members){const at={x:ht.x+_e,y:ht.y+Se};Mt.current.set(Ke,at),Xt.current.set(Ke,at)}const Fe=cr.current;if(Fe){for(const[Ke,ht]of de.members)Fe.set(Ke,{x:ht.x+_e,y:ht.y+Se});Fe.set(W.id,{x:W.position.x,y:W.position.y})}xi(Ke=>Ke+1);return}Mt.current.set(W.id,{x:W.position.x,y:W.position.y}),Xt.current.set(W.id,{x:W.position.x,y:W.position.y}),(ae=cr.current)==null||ae.set(W.id,{x:W.position.x,y:W.position.y}),xi(de=>de+1)},onNodeDragStop:(F,W)=>{if(fr(),hr.current=!1,cr.current=null,yl(!1),gi(ae=>ae+1),W.type==="sessionGroup"){const ae=dr.current;if(ae){const de=W.position.x-ae.start.x,_e=W.position.y-ae.start.y;for(const[Se,Fe]of ae.members){const Ke={x:Fe.x+de,y:Fe.y+_e};Mt.current.set(Se,Ke),Xt.current.set(Se,Ke)}}dr.current=null,ty(Xt.current,Mt.current),gi(de=>de+1);return}Mt.current.set(W.id,{x:W.position.x,y:W.position.y}),Xt.current.set(W.id,{x:W.position.x,y:W.position.y}),ty(Xt.current,Mt.current)},children:[m.jsx(SL,{gap:28,size:1,color:Hn["--grid-line"]}),m.jsx(z$,{}),m.jsx(b3,{agents:s.current.agents,visibleAgentIds:ss,positions:Xt.current,pinned:Mt.current,measured:Gn.current,spotlight:rs,hiddenCategories:dl,now:xt,onOpenTool:g}),m.jsxs(yL,{showInteractive:!1,children:[m.jsx(xr,{onClick:Ps,title:qo?"Recenter view + re-enable autofit":"Recenter view (autofit already on)","aria-label":"Recenter view",style:qo?{color:"var(--accent)"}:void 0,children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[m.jsx("circle",{cx:"12",cy:"12",r:"3.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),m.jsx("path",{d:"M12 2v4M12 18v4M2 12h4M18 12h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})}),m.jsx(xr,{onClick:Zr,title:y6({paused:Cr,held:Bt.size,dropped:Bt.dropped}),"aria-label":v6,"aria-pressed":Cr,children:m.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:m.jsx("path",{d:"M9 5.5v13M15 5.5v13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"})})}),m.jsx(xr,{onClick:Mi,title:"Auto-arrange — clear pins (R)","aria-label":"Re-arrange the canvas",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[m.jsx("rect",{x:"8.5",y:"2",width:"7",height:"5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),m.jsx("rect",{x:"1.5",y:"17",width:"7",height:"5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),m.jsx("rect",{x:"15.5",y:"17",width:"7",height:"5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),m.jsx("path",{d:"M12 7v6.5M5 17v-3.5h14V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})}),m.jsx(xr,{onClick:()=>Ii("button"),title:"Clear the canvas and the server's event log — asks first (C)","aria-label":"Clear the canvas",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[m.jsx("path",{d:"M4 6.2h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),m.jsx("path",{d:"M9 6.2V4.4a1.6 1.6 0 0 1 1.6-1.6h2.8a1.6 1.6 0 0 1 1.6 1.6v1.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),m.jsx("path",{d:"M17.4 6.4 16.7 20a2 2 0 0 1-2 1.9H9.3a2 2 0 0 1-2-1.9L6.6 6.4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),m.jsx("path",{d:"M10.3 10.6v6.8M13.7 10.6v6.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})}),m.jsx(xr,{onClick:()=>L(F=>!F),title:"Keyboard shortcuts (?)","aria-label":"Open the keyboard shortcuts","aria-haspopup":"dialog",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[m.jsx("path",{d:"M8.6 8.4a3.5 3.5 0 1 1 4.6 3.35c-.85.3-1.2 1-1.2 1.85v1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),m.jsx("path",{d:"M12 18.4v.2",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",fill:"none"})]})})]}),m.jsx(dL,{zoomable:!0,pannable:!0,nodeColor:Mo,nodeStrokeWidth:2,maskColor:Hn["--minimap-mask"],style:Je})]})]}),M?m.jsxs("aside",{className:"detail","aria-label":"Detail",children:[m.jsx("button",{type:"button",className:"glyph-btn detail-close",title:"Close panel","aria-label":"Close detail panel",onClick:()=>q(!1),children:"×"}),Qt?m.jsx(Y6,{agent:Qt,now:xt,onOpenTool:g,onShowSummary:F=>{P.has(F)&&(P.delete(F),nC(P)),_(F)},onExportSession:F=>z6(s.current,F)}):m.jsx(G6,{count:Go,workspace:Ce})]}):m.jsx("button",{type:"button",className:"detail-reopen",title:"Show detail panel","aria-label":"Show detail panel",onClick:()=>q(!0),children:"‹"}),Ho&&m.jsx(I$,{tool:Ho,onClose:()=>g(null)}),Nr&&m.jsx(ED,{providers:Ve,onClose:()=>ur(!1)}),b&&(()=>{const F=s.current.agents.get(b);return F?m.jsx(E$,{agent:F,onClose:()=>k(null)}):null})(),S&&m.jsx(j3,{state:s.current,sessionId:S,onClose:()=>{P.add(S),nC(P),_(null)}}),Le&&m.jsx(z4,{entries:Le.entries,since:Le.since,running:$e,onClose:()=>De(null)}),A&&m.jsx(d4,{onClose:()=>L(!1)}),C&&m.jsx(l4,{agentCount:Go,onConfirm:()=>Ii("confirmation"),onCancel:()=>T(!1)})]})}function W6({live:e,everConnected:t,providers:r}){const s=!e;return m.jsxs("div",{className:"empty-hero",children:[m.jsxs("div",{className:"orbit-stack","aria-hidden":!0,children:[m.jsx("div",{className:"core"}),m.jsxs("div",{className:"orbit r1",children:[m.jsx("span",{className:"dot"}),m.jsx("span",{className:"dot b"})]}),m.jsxs("div",{className:"orbit r2",children:[m.jsx("span",{className:"dot"}),m.jsx("span",{className:"dot b"})]}),m.jsxs("div",{className:"orbit r3",children:[m.jsx("span",{className:"dot"}),m.jsx("span",{className:"dot b"})]})]}),s?m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:t?"Disconnected from server":"Server unreachable"}),m.jsxs("p",{children:["The browser cannot reach ",m.jsx("code",{children:"/events"}),". Check that",m.jsx("code",{children:Yt})," is still running in your terminal, then this page will resume automatically."]})]}):V6(r)]})}function V6(e){return m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:"Waiting for Claude Code or Codex"}),m.jsxs("p",{children:["Run ",m.jsx("code",{children:"claude"})," or ",m.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."]}),m.jsxs("p",{className:"hint-row",children:["Not seeing anything? Make sure ",m.jsx("code",{children:Yt})," is running."]}),wD(e).map(t=>m.jsx("p",{className:"hint-row",children:t.spans.map((r,s)=>r.code?m.jsx("code",{children:r.text},s):m.jsx("span",{children:r.text},s))},t.provider))]})}function G6({count:e,workspace:t}){const r=p6(t);return m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:"Detail"}),e===0?m.jsxs("div",{className:"hint",children:[r.lead,r.workspace!==null&&m.jsxs(m.Fragment,{children:[" ",m.jsx("code",{children:r.workspace}),r.tail]})]}):m.jsx("div",{className:"empty",children:"Click an agent to see its tools."}),m.jsx("h3",{style:{marginTop:4},children:"Shortcuts"}),m.jsxs("div",{className:"shortcuts",children:[m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"?"}),m.jsx("span",{children:"all shortcuts"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"drag"}),m.jsx("span",{children:"move a node"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"tab"}),m.jsx("span",{children:"reach the cards"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"enter"}),m.jsx("span",{children:"select the focused card"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"space"}),m.jsx("span",{children:"pause / resume"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"J"}),m.jsx("span",{children:"next agent"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"K"}),m.jsx("span",{children:"previous agent"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"R"}),m.jsx("span",{children:"re-arrange"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"F"}),m.jsx("span",{children:"fit view"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"L"}),m.jsx("span",{children:"session list"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"H"}),m.jsx("span",{children:"usage history"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"U"}),m.jsx("span",{children:"usage panel"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"C"}),m.jsx("span",{children:"clear canvas"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"T"}),m.jsx("span",{children:"toggle theme"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"Esc"}),m.jsx("span",{children:"deselect, release focus"})]})]})]})}function Y6({agent:e,now:t,onOpenTool:r,onShowSummary:s,onExportSession:o}){const a=sc(e.startedAt,e.endedAt,t),u=vn(e),c=u.total>0,f=e.usage.inputTokens+e.usage.outputTokens,p=new Map;for(const S of e.tools){const _=_R(S.name);p.set(_,(p.get(_)??0)+1)}const d=e.tools.filter(S=>S.ok===!1).length,g=e.tools.filter(S=>!S.endedAt).length,y=Array.from(p.entries()).sort((S,_)=>_[1]-S[1]),w=p.has("mcp")?v3(e.tools.map(S=>S.name)):null;return m.jsxs(m.Fragment,{children:[m.jsxs("header",{className:"detail-hero",children:[m.jsxs("div",{className:"hero-line",children:[m.jsx("span",{className:`state-pill state-${e.state}`,children:e.state==="active"?"live":e.state}),m.jsx("h2",{className:"hero-title",title:e.cwd??e.label,children:e.label})]}),m.jsxs("div",{className:"hero-meta",children:[m.jsx("span",{className:"hero-meta-item",children:e.kind}),m.jsx("span",{className:"hero-sep",children:"·"}),m.jsx("span",{className:"hero-meta-item",title:`started ${new Date(e.startedAt).toLocaleString()}`,children:a}),e.model&&(()=>{const S=$j(e);return m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"hero-sep",children:"·"}),m.jsxs("span",{className:"model-chip",title:S.length>0?`${e.model}
|
|
94
|
+
`)}`,"aria-label":`${Kn.length} session${Kn.length===1?"":"s"} waiting for you`,children:[m.jsx("span",{className:"ap-pulse","aria-hidden":!0}),m.jsx("b",{children:Kn.length})," waiting"]})]}),Qt&&(()=>{const F=vn(Qt),W=Math.max(0,((Qt.endedAt??xt)-Qt.startedAt)/1e3),ie=Qt.state==="active"?rc(F.total,W):null,de=u.size-1;return m.jsxs("button",{type:"button",className:"selected-ribbon",title:`Fit view to ${Qt.label}`,onClick:()=>{try{const _e=mr.find(Se=>Se.id===Qt.id);_e&&e.fitView({padding:.35,duration:500,nodes:[_e]}),Nn.current=Date.now()}catch{}},children:[m.jsx("span",{className:`state-pill state-${Qt.state}`,children:Qt.state==="active"?"live":Qt.state}),m.jsx("span",{className:"selected-label",children:Qt.label}),F.total>0&&m.jsxs("span",{className:"selected-cost",children:[Ge(F.total),ie?m.jsxs("span",{className:"selected-rate",children:[" · ",ie]}):null]}),de>0&&m.jsxs("span",{className:"selected-extra",children:["+",de]}),m.jsx("span",{"aria-hidden":!0,className:"selected-close",onClick:_e=>{_e.stopPropagation(),w()},children:"×"})]})})(),m.jsxs("div",{className:"actions",children:[m.jsxs("div",{className:"action-run",children:[m.jsx("button",{className:"btn icon-btn",onClick:()=>X(F=>!F),title:`${V?"Hide":"Show"} usage panel (U)`,"aria-label":"Toggle usage panel","aria-expanded":V,"aria-controls":V?"usage-panel":void 0,children:"$"}),Ve.claude&&m.jsx("button",{className:"btn icon-btn",onClick:lr,title:`${j?"Hide":"Show"} accounts (A)`,"aria-label":"Toggle accounts panel","aria-expanded":j,"aria-controls":j?"accounts-panel":void 0,children:m.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:[m.jsx("circle",{cx:"7",cy:"4.6",r:"2.4"}),m.jsx("path",{d:"M2.4 12c0-2.3 2.1-3.7 4.6-3.7s4.6 1.4 4.6 3.7"})]})}),m.jsx("button",{className:"btn icon-btn",onClick:()=>ur(F=>!F),title:"Usage history — ccusage (H)","aria-label":"Open usage history","aria-haspopup":"dialog",children:m.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":!0,children:[m.jsx("line",{x1:"3",y1:"11.5",x2:"3",y2:"7"}),m.jsx("line",{x1:"7",y1:"11.5",x2:"7",y2:"3"}),m.jsx("line",{x1:"11",y1:"11.5",x2:"11",y2:"8.5"})]})})]}),m.jsxs("div",{className:"action-run",children:[Ve.claude&&B!==null&&m.jsxs("div",{className:"sound-slot",children:[m.jsx("button",{ref:ye,className:"btn icon-btn",onClick:()=>pe(F=>!F),...Wr(!1),title:bD(Ve,{on:B===!0,locked:Ue==="locked",prefs:Y}),"aria-label":"Sound settings","aria-haspopup":"dialog","aria-expanded":fe,"aria-controls":fe?"sound-menu":void 0,children:m.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:[m.jsx("path",{d:"M3.2 5.2h2L7.8 3v8L5.2 8.8h-2z"}),B?m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M9.8 5.4a2.4 2.4 0 0 1 0 3.2"}),m.jsx("path",{d:"M11.3 3.9a4.6 4.6 0 0 1 0 6.2"})]}):m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M10 5.6l2.6 2.8"}),m.jsx("path",{d:"M12.6 5.6L10 8.4"})]})]})}),fe&&m.jsx(T4,{onClose:()=>pe(!1),soundOn:B===!0,onToggleSound:Z,prefs:Y,onLevel:(F,W)=>ae(F,{level:W}),onFigure:(F,W)=>ae(F,{figure:W}),onPreview:F=>ne(F),openerRef:ye})]}),m.jsx("button",{className:"btn icon-btn",onClick:()=>Oo(F=>F==="dark"?"light":"dark"),title:`Switch to ${Rr==="dark"?"light":"dark"} mode (T)`,"aria-label":"Toggle theme",children:Rr==="dark"?"☀":"☾"})]})]})]}),jr?m.jsxs("div",{className:"ver-banner done",role:"status",children:[m.jsx("span",{className:"ver-dot"}),m.jsxs("strong",{children:["Restarted — now running v",jr,"."]}),m.jsx("span",{className:"ver-sub",children:"The canvas replayed from the event log."})]}):Lo&&!Ie?m.jsxs("div",{className:"conn-banner",role:"alert",children:[m.jsx("span",{className:"conn-dot"}),Sn?bi==="npx"?"Fetching the new version with npx — this can take a minute…":`Restarting ${Yt}…`:(()=>{const F=_6({connected:Ie,paused:Cr});return m.jsxs(m.Fragment,{children:[`Lost connection to the ${Yt} server. Reconnecting…`,F&&m.jsx("span",{className:"conn-sub",children:F})]})})()]}):xn&&ee?m.jsxs("div",{className:`ver-banner ${ee.kind}`,role:"status",children:[m.jsx("span",{className:"ver-dot"}),ee.kind==="restart"?m.jsxs(m.Fragment,{children:[m.jsxs("strong",{children:["v",ee.to," is installed — this deck still runs v",ee.from,"."]}),le!=null&&le.canRestart?m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"ver-act",onClick:()=>Si(),...Wr(Sn),title:"Stop this process and bring it back on the same port. The canvas replays from the event log.",children:Sn?"restarting…":"Restart now"}),m.jsxs("button",{type:"button",className:`ver-auto${st?" on":""}`,role:"switch","aria-checked":st,onClick:Is,title:st?"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:[m.jsx("i",{"aria-hidden":!0}),"auto when idle"]})]}):m.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."})]}):m.jsxs(m.Fragment,{children:[m.jsxs("strong",{children:[Yt," v",ee.to," is out — you are on v",ee.from,"."]}),(le==null?void 0:le.upgradeMode)==="install"&&qt!=="failed"&&m.jsx("button",{type:"button",className:"ver-act",onClick:Rs,...Wr(qt==="running",qt==="done"),title:`Runs ${((Zo=le==null?void 0:le.upgrade)==null?void 0:Zo.command)??(le==null?void 0:le.command)??"npm i -g"} here, then restarts once nothing is running.`,children:qt==="running"?"installing…":qt==="done"?"installed":"Update now"}),(le==null?void 0:le.upgradeMode)==="npx"&&(le==null?void 0:le.canRestart)&&m.jsx("button",{type:"button",className:"ver-act",onClick:()=>Si({upgrade:!0}),...Wr(Sn),title:`Runs ${le==null?void 0:le.command} and hands it this port. Nothing is installed globally — npx unpacks its own copy.`,children:Sn?"fetching…":qt==="failed"?"Retry update":"Update & restart"}),qt==="failed"?m.jsxs("span",{className:"ver-sub fail",title:((Or=le==null?void 0:le.upgrade)==null?void 0:Or.error)??"",children:[(le==null?void 0:le.upgradeMode)==="npx"?"update failed":"install failed",": ",((Cl=le==null?void 0:le.upgrade)==null?void 0:Cl.error)??"unknown error"," — run it yourself:"]}):(le==null?void 0:le.upgradeMode)==="npx"?m.jsx("span",{className:"ver-sub",children:le!=null&&le.canRestart?"npx cannot upgrade in place, so the deck re-runs:":ey.npx}):le!=null&&le.upgradeBlocked?m.jsx("span",{className:"ver-sub",children:Object.hasOwn(ey,le.upgradeBlocked)?ey[le.upgradeBlocked]:"cannot install from here"}):null,m.jsxs("button",{type:"button",className:"ver-cmd",onClick:Er,title:"Copy to clipboard",children:[m.jsx("code",{children:le==null?void 0:le.command}),m.jsx("span",{className:"ver-cmd-hint",children:gt?"copied":"copy"})]})]}),m.jsx("button",{type:"button","aria-label":"Dismiss",className:"ver-close",onClick:zn,children:"×"})]}):pi&&fn?m.jsxs("div",{className:"ver-banner",role:"status",children:[m.jsx("span",{className:"ver-dot"}),m.jsxs("strong",{children:[fn," still works — the deck is called ",Yt," now."]}),le!=null&&le.renameFix?m.jsx("span",{className:"ver-sub",children:le.renameFix}):null,m.jsx("button",{type:"button","aria-label":"Dismiss",className:"ver-close",onClick:mi,children:"×"})]}):null,V&&m.jsx(W3,{state:s.current,now:xt,providers:Ve,onClose:()=>X(!1)}),j&&Ve.claude&&m.jsx(Qq,{onClose:()=>G(!1)}),U&&m.jsx(M3,{state:s.current,now:xt,selectedIds:u,onSelect:El,onClose:()=>O(!1)}),m.jsxs("main",{id:"canvas",tabIndex:-1,className:`canvas-wrap${Wo?" bubbling":""}${Ti?" dragging-any":""}`,ref:Bo,onMouseDownCapture:Uo,onPointerDownCapture:Ci,onPointerUpCapture:Ci,onWheelCapture:Ci,children:[Ko===0&&m.jsx(G6,{live:Ie,everConnected:Lo,providers:Ve}),Ds.length>1&&m.jsx("div",{ref:vi,className:`cat-filter-bar${yi?" occluded":""}`,role:"group","aria-label":"Filter tools by category",children:Ds.map(F=>{const W=dl.has(F);return m.jsxs("button",{type:"button",className:`cat-filter${W?" off":""}`,onClick:()=>Uc(F),"aria-pressed":!W,title:`${W?"Show":"Hide"} ${Iy[F]} tools`,children:[m.jsx("span",{className:"cat-emoji",children:Ay[F]}),m.jsx("span",{className:"cat-name",children:Iy[F]})]},F)})}),m.jsxs(kj,{nodes:Bc,edges:zc,nodeTypes:S6,fitView:!Tr,fitViewOptions:{padding:.25,duration:Qv({durationMs:ZN,documentHidden:document.hidden})?ZN:0},minZoom:.2,maxZoom:1.6,panOnScroll:!0,nodesDraggable:!0,nodesConnectable:!1,selectionOnDrag:!1,nodeDragThreshold:5,onNodeClick:(F,W)=>{if(W.type==="sessionGroup"){w();return}y(W.id,F.shiftKey)},onPaneClick:()=>w(),onMoveStart:F=>{YN(ts(F))&&Ar()},onMove:(F,W)=>{fr(),YN(ts(F))&&Ar(),jn.current&&window.clearTimeout(jn.current),jn.current=window.setTimeout(()=>B6(W),250)},onNodeDragStart:(F,W)=>{var ie;if(Dc(),hr.current=!0,cr.current=new Map,yl(!0),fr(),Ar(),W.type==="sessionGroup"){const de=(ie=W.data)==null?void 0:ie.sessionId,_e=new Map;if(de)for(const Se of mr){const Fe=Se.data;(Fe==null?void 0:Fe.sessionId)===de&&_e.set(Se.id,{x:Se.position.x,y:Se.position.y})}dr.current={start:{x:W.position.x,y:W.position.y},members:_e};return}Mt.current.set(W.id,{x:W.position.x,y:W.position.y})},onNodeDrag:(F,W)=>{var ie;if(fr(),W.type==="sessionGroup"){const de=dr.current;if(!de)return;const _e=W.position.x-de.start.x,Se=W.position.y-de.start.y;for(const[Ke,ht]of de.members){const at={x:ht.x+_e,y:ht.y+Se};Mt.current.set(Ke,at),Xt.current.set(Ke,at)}const Fe=cr.current;if(Fe){for(const[Ke,ht]of de.members)Fe.set(Ke,{x:ht.x+_e,y:ht.y+Se});Fe.set(W.id,{x:W.position.x,y:W.position.y})}xi(Ke=>Ke+1);return}Mt.current.set(W.id,{x:W.position.x,y:W.position.y}),Xt.current.set(W.id,{x:W.position.x,y:W.position.y}),(ie=cr.current)==null||ie.set(W.id,{x:W.position.x,y:W.position.y}),xi(de=>de+1)},onNodeDragStop:(F,W)=>{if(fr(),hr.current=!1,cr.current=null,yl(!1),gi(ie=>ie+1),W.type==="sessionGroup"){const ie=dr.current;if(ie){const de=W.position.x-ie.start.x,_e=W.position.y-ie.start.y;for(const[Se,Fe]of ie.members){const Ke={x:Fe.x+de,y:Fe.y+_e};Mt.current.set(Se,Ke),Xt.current.set(Se,Ke)}}dr.current=null,ty(Xt.current,Mt.current),gi(de=>de+1);return}Mt.current.set(W.id,{x:W.position.x,y:W.position.y}),Xt.current.set(W.id,{x:W.position.x,y:W.position.y}),ty(Xt.current,Mt.current)},children:[m.jsx(SL,{gap:28,size:1,color:Hn["--grid-line"]}),m.jsx(z$,{}),m.jsx(b3,{agents:s.current.agents,visibleAgentIds:ss,positions:Xt.current,pinned:Mt.current,measured:Gn.current,spotlight:rs,hiddenCategories:dl,now:xt,onOpenTool:g}),m.jsxs(yL,{showInteractive:!1,children:[m.jsx(xr,{onClick:Ps,title:Fo?"Recenter view + re-enable autofit":"Recenter view (autofit already on)","aria-label":"Recenter view",style:Fo?{color:"var(--accent)"}:void 0,children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[m.jsx("circle",{cx:"12",cy:"12",r:"3.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),m.jsx("path",{d:"M12 2v4M12 18v4M2 12h4M18 12h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})}),m.jsx(xr,{onClick:Zr,title:x6({paused:Cr,held:Bt.size,dropped:Bt.dropped}),"aria-label":w6,"aria-pressed":Cr,children:m.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:m.jsx("path",{d:"M9 5.5v13M15 5.5v13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"})})}),m.jsx(xr,{onClick:Mi,title:"Auto-arrange — clear pins (R)","aria-label":"Re-arrange the canvas",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[m.jsx("rect",{x:"8.5",y:"2",width:"7",height:"5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),m.jsx("rect",{x:"1.5",y:"17",width:"7",height:"5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),m.jsx("rect",{x:"15.5",y:"17",width:"7",height:"5",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),m.jsx("path",{d:"M12 7v6.5M5 17v-3.5h14V17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})}),m.jsx(xr,{onClick:()=>Ii("button"),title:"Clear the canvas and the server's event log — asks first (C)","aria-label":"Clear the canvas",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[m.jsx("path",{d:"M4 6.2h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),m.jsx("path",{d:"M9 6.2V4.4a1.6 1.6 0 0 1 1.6-1.6h2.8a1.6 1.6 0 0 1 1.6 1.6v1.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),m.jsx("path",{d:"M17.4 6.4 16.7 20a2 2 0 0 1-2 1.9H9.3a2 2 0 0 1-2-1.9L6.6 6.4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),m.jsx("path",{d:"M10.3 10.6v6.8M13.7 10.6v6.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})}),m.jsx(xr,{onClick:()=>L(F=>!F),title:"Keyboard shortcuts (?)","aria-label":"Open the keyboard shortcuts","aria-haspopup":"dialog",children:m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[m.jsx("path",{d:"M8.6 8.4a3.5 3.5 0 1 1 4.6 3.35c-.85.3-1.2 1-1.2 1.85v1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),m.jsx("path",{d:"M12 18.4v.2",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",fill:"none"})]})})]}),m.jsx(dL,{zoomable:!0,pannable:!0,nodeColor:Po,nodeStrokeWidth:2,maskColor:Hn["--minimap-mask"],style:Je})]})]}),M?m.jsxs("aside",{className:"detail","aria-label":"Detail",children:[m.jsx("button",{type:"button",className:"glyph-btn detail-close",title:"Close panel","aria-label":"Close detail panel",onClick:()=>q(!1),children:"×"}),Qt?m.jsx(X6,{agent:Qt,now:xt,onOpenTool:g,onShowSummary:F=>{P.has(F)&&(P.delete(F),rC(P)),_(F)},onExportSession:F=>U6(s.current,F)}):m.jsx(K6,{count:Ko,workspace:Ce})]}):m.jsx("button",{type:"button",className:"detail-reopen",title:"Show detail panel","aria-label":"Show detail panel",onClick:()=>q(!0),children:"‹"}),Vo&&m.jsx(I$,{tool:Vo,onClose:()=>g(null)}),Nr&&m.jsx(CD,{providers:Ve,onClose:()=>ur(!1)}),b&&(()=>{const F=s.current.agents.get(b);return F?m.jsx(E$,{agent:F,onClose:()=>k(null)}):null})(),S&&m.jsx(j3,{state:s.current,sessionId:S,onClose:()=>{P.add(S),rC(P),_(null)}}),Le&&m.jsx(U4,{entries:Le.entries,since:Le.since,firstRun:Le.firstRun,running:$e,onClose:()=>De(null)}),A&&m.jsx(d4,{onClose:()=>L(!1)}),C&&m.jsx(l4,{agentCount:Ko,onConfirm:()=>Ii("confirmation"),onCancel:()=>T(!1)})]})}function G6({live:e,everConnected:t,providers:r}){const s=!e;return m.jsxs("div",{className:"empty-hero",children:[m.jsxs("div",{className:"orbit-stack","aria-hidden":!0,children:[m.jsx("div",{className:"core"}),m.jsxs("div",{className:"orbit r1",children:[m.jsx("span",{className:"dot"}),m.jsx("span",{className:"dot b"})]}),m.jsxs("div",{className:"orbit r2",children:[m.jsx("span",{className:"dot"}),m.jsx("span",{className:"dot b"})]}),m.jsxs("div",{className:"orbit r3",children:[m.jsx("span",{className:"dot"}),m.jsx("span",{className:"dot b"})]})]}),s?m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:t?"Disconnected from server":"Server unreachable"}),m.jsxs("p",{children:["The browser cannot reach ",m.jsx("code",{children:"/events"}),". Check that",m.jsx("code",{children:Yt})," is still running in your terminal, then this page will resume automatically."]})]}):Y6(r)]})}function Y6(e){return m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:"Waiting for Claude Code or Codex"}),m.jsxs("p",{children:["Run ",m.jsx("code",{children:"claude"})," or ",m.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."]}),m.jsxs("p",{className:"hint-row",children:["Not seeing anything? Make sure ",m.jsx("code",{children:Yt})," is running."]}),_D(e).map(t=>m.jsx("p",{className:"hint-row",children:t.spans.map((r,s)=>r.code?m.jsx("code",{children:r.text},s):m.jsx("span",{children:r.text},s))},t.provider))]})}function K6({count:e,workspace:t}){const r=g6(t);return m.jsxs(m.Fragment,{children:[m.jsx("h2",{children:"Detail"}),e===0?m.jsxs("div",{className:"hint",children:[r.lead,r.workspace!==null&&m.jsxs(m.Fragment,{children:[" ",m.jsx("code",{children:r.workspace}),r.tail]})]}):m.jsx("div",{className:"empty",children:"Click an agent to see its tools."}),m.jsx("h3",{style:{marginTop:4},children:"Shortcuts"}),m.jsxs("div",{className:"shortcuts",children:[m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"?"}),m.jsx("span",{children:"all shortcuts"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"drag"}),m.jsx("span",{children:"move a node"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"tab"}),m.jsx("span",{children:"reach the cards"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"enter"}),m.jsx("span",{children:"select the focused card"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"space"}),m.jsx("span",{children:"pause / resume"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"J"}),m.jsx("span",{children:"next agent"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"K"}),m.jsx("span",{children:"previous agent"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"R"}),m.jsx("span",{children:"re-arrange"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"F"}),m.jsx("span",{children:"fit view"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"L"}),m.jsx("span",{children:"session list"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"H"}),m.jsx("span",{children:"usage history"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"U"}),m.jsx("span",{children:"usage panel"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"C"}),m.jsx("span",{children:"clear canvas"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"T"}),m.jsx("span",{children:"toggle theme"})]}),m.jsxs("div",{className:"sc",children:[m.jsx("kbd",{children:"Esc"}),m.jsx("span",{children:"deselect, release focus"})]})]})]})}function X6({agent:e,now:t,onOpenTool:r,onShowSummary:s,onExportSession:o}){const a=sc(e.startedAt,e.endedAt,t),u=vn(e),c=u.total>0,f=e.usage.inputTokens+e.usage.outputTokens,p=new Map;for(const S of e.tools){const _=_R(S.name);p.set(_,(p.get(_)??0)+1)}const d=e.tools.filter(S=>S.ok===!1).length,g=e.tools.filter(S=>!S.endedAt).length,y=Array.from(p.entries()).sort((S,_)=>_[1]-S[1]),w=p.has("mcp")?v3(e.tools.map(S=>S.name)):null;return m.jsxs(m.Fragment,{children:[m.jsxs("header",{className:"detail-hero",children:[m.jsxs("div",{className:"hero-line",children:[m.jsx("span",{className:`state-pill state-${e.state}`,children:e.state==="active"?"live":e.state}),m.jsx("h2",{className:"hero-title",title:e.cwd??e.label,children:e.label})]}),m.jsxs("div",{className:"hero-meta",children:[m.jsx("span",{className:"hero-meta-item",children:e.kind}),m.jsx("span",{className:"hero-sep",children:"·"}),m.jsx("span",{className:"hero-meta-item",title:`started ${new Date(e.startedAt).toLocaleString()}`,children:a}),e.model&&(()=>{const S=qj(e);return m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"hero-sep",children:"·"}),m.jsxs("span",{className:"model-chip",title:S.length>0?`${e.model}
|
|
95
95
|
spend on this panel also covers:
|
|
96
96
|
${S.join(`
|
|
97
|
-
`)}`:e.model,children:[li(e.model),S.length>0?` +${S.length}`:""]})]})})()]}),c&&m.jsxs("div",{className:"hero-cost",children:[m.jsxs("div",{className:"hero-cost-headline",children:[m.jsx("span",{className:"hero-cost-value",children:Ge(u.total)}),m.jsx("span",{className:"hero-cost-label",children:"spend"})]}),m.jsx(s0,{cost:u})]}),m.jsxs("div",{className:"hero-actions",children:[e.kind==="root"&&e.state==="done"&&s&&m.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&&m.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&&m.jsxs("section",{className:"detail-section",children:[m.jsx("h3",{children:"Activity"}),m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{className:"activity-counters",children:[m.jsxs("span",{className:"ac-item",children:[m.jsx("b",{children:e.toolCount})," calls"]}),g>0&&m.jsxs("span",{className:"ac-item ac-live",children:[m.jsx("b",{children:g})," live"]}),d>0&&m.jsxs("span",{className:"ac-item ac-err",children:[m.jsx("b",{children:d})," err"]})]}),m.jsx("div",{className:"cat-strip",children:y.map(([S,_])=>{const b=S==="mcp"?w:null,k=b==null?void 0:b.hue,E=`${_} ${Iy[S]} call${_===1?"":"s"}`;return m.jsxs("span",{className:`cat-chip cat-${S}${k!=null?" mcp-hue":""}`,style:k!=null?{"--mcp-hue":k}:void 0,title:b?`${E}, all to ${b.label}`:E,children:[m.jsx("span",{className:"cat-emoji",children:Ay[S]}),m.jsx("span",{className:"cat-count",children:_}),b&&m.jsx("span",{className:"cat-server",children:b.label})]},S)})})]})]}),f>0&&m.jsxs("section",{className:"detail-section",children:[m.jsx("h3",{children:"Tokens"}),m.jsxs("div",{className:"tokens-grid",children:[m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"in"}),m.jsx("b",{children:e.usage.inputTokens.toLocaleString()})]}),m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"out"}),m.jsx("b",{children:e.usage.outputTokens.toLocaleString()})]}),m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"cache r"}),m.jsx("b",{children:e.usage.cacheReadTokens.toLocaleString()})]}),m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"cache c"}),m.jsx("b",{children:e.usage.cacheCreateTokens.toLocaleString()})]})]})]}),m.jsxs("section",{className:"detail-section",children:[m.jsx("h3",{children:"Identity"}),m.jsxs("div",{children:[e.cwd&&m.jsxs("div",{className:"row",children:[m.jsx("span",{className:"k",children:"cwd"}),m.jsx("span",{className:"v",title:e.cwd,children:e.cwd})]}),m.jsxs("div",{className:"row",children:[m.jsx("span",{className:"k",children:"session"}),m.jsxs("span",{className:"v",children:[e.sessionId.slice(0,12),"…"]})]}),e.parentId&&m.jsxs("div",{className:"row",children:[m.jsx("span",{className:"k",children:"parent"}),m.jsxs("span",{className:"v",children:[e.parentId.slice(0,12),"…"]})]})]})]}),e.prompts.length>0&&m.jsxs("section",{className:"detail-section",children:[m.jsxs("h3",{children:["Prompts ",m.jsx("span",{className:"section-count",children:e.prompts.length})]}),m.jsx("div",{className:"prompts",children:e.prompts.slice().reverse().map((S,_)=>{const b=P3(S.at,t);return m.jsxs("div",{className:"prompt-entry",children:[m.jsx("div",{className:"prompt-time",title:b.title,children:b.label}),m.jsx("div",{className:"prompt-text",children:S.text})]},_)})})]}),m.jsxs("section",{className:"detail-section",children:[m.jsxs("h3",{children:["Tool calls ",m.jsx("span",{className:"section-count",children:e.tools.length})]}),e.tools.length===0&&m.jsx("div",{className:"empty",children:"No tool calls yet."}),m.jsx("div",{children:e.tools.slice().reverse().map(S=>m.jsx(
|
|
97
|
+
`)}`:e.model,children:[li(e.model),S.length>0?` +${S.length}`:""]})]})})()]}),c&&m.jsxs("div",{className:"hero-cost",children:[m.jsxs("div",{className:"hero-cost-headline",children:[m.jsx("span",{className:"hero-cost-value",children:Ge(u.total)}),m.jsx("span",{className:"hero-cost-label",children:"spend"})]}),m.jsx(s0,{cost:u})]}),m.jsxs("div",{className:"hero-actions",children:[e.kind==="root"&&e.state==="done"&&s&&m.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&&m.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&&m.jsxs("section",{className:"detail-section",children:[m.jsx("h3",{children:"Activity"}),m.jsxs("div",{className:"activity-row",children:[m.jsxs("div",{className:"activity-counters",children:[m.jsxs("span",{className:"ac-item",children:[m.jsx("b",{children:e.toolCount})," calls"]}),g>0&&m.jsxs("span",{className:"ac-item ac-live",children:[m.jsx("b",{children:g})," live"]}),d>0&&m.jsxs("span",{className:"ac-item ac-err",children:[m.jsx("b",{children:d})," err"]})]}),m.jsx("div",{className:"cat-strip",children:y.map(([S,_])=>{const b=S==="mcp"?w:null,k=b==null?void 0:b.hue,E=`${_} ${Iy[S]} call${_===1?"":"s"}`;return m.jsxs("span",{className:`cat-chip cat-${S}${k!=null?" mcp-hue":""}`,style:k!=null?{"--mcp-hue":k}:void 0,title:b?`${E}, all to ${b.label}`:E,children:[m.jsx("span",{className:"cat-emoji",children:Ay[S]}),m.jsx("span",{className:"cat-count",children:_}),b&&m.jsx("span",{className:"cat-server",children:b.label})]},S)})})]})]}),f>0&&m.jsxs("section",{className:"detail-section",children:[m.jsx("h3",{children:"Tokens"}),m.jsxs("div",{className:"tokens-grid",children:[m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"in"}),m.jsx("b",{children:e.usage.inputTokens.toLocaleString()})]}),m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"out"}),m.jsx("b",{children:e.usage.outputTokens.toLocaleString()})]}),m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"cache r"}),m.jsx("b",{children:e.usage.cacheReadTokens.toLocaleString()})]}),m.jsxs("div",{children:[m.jsx("span",{className:"k",children:"cache c"}),m.jsx("b",{children:e.usage.cacheCreateTokens.toLocaleString()})]})]})]}),m.jsxs("section",{className:"detail-section",children:[m.jsx("h3",{children:"Identity"}),m.jsxs("div",{children:[e.cwd&&m.jsxs("div",{className:"row",children:[m.jsx("span",{className:"k",children:"cwd"}),m.jsx("span",{className:"v",title:e.cwd,children:e.cwd})]}),m.jsxs("div",{className:"row",children:[m.jsx("span",{className:"k",children:"session"}),m.jsxs("span",{className:"v",children:[e.sessionId.slice(0,12),"…"]})]}),e.parentId&&m.jsxs("div",{className:"row",children:[m.jsx("span",{className:"k",children:"parent"}),m.jsxs("span",{className:"v",children:[e.parentId.slice(0,12),"…"]})]})]})]}),e.prompts.length>0&&m.jsxs("section",{className:"detail-section",children:[m.jsxs("h3",{children:["Prompts ",m.jsx("span",{className:"section-count",children:e.prompts.length})]}),m.jsx("div",{className:"prompts",children:e.prompts.slice().reverse().map((S,_)=>{const b=P3(S.at,t);return m.jsxs("div",{className:"prompt-entry",children:[m.jsx("div",{className:"prompt-time",title:b.title,children:b.label}),m.jsx("div",{className:"prompt-text",children:S.text})]},_)})})]}),m.jsxs("section",{className:"detail-section",children:[m.jsxs("h3",{children:["Tool calls ",m.jsx("span",{className:"section-count",children:e.tools.length})]}),e.tools.length===0&&m.jsx("div",{className:"empty",children:"No tool calls yet."}),m.jsx("div",{children:e.tools.slice().reverse().map(S=>m.jsx(Z6,{t:S,onClick:()=>r(S.id)},S.id))})]})]})}const Q6={inflight:"in-flight",done:"done",err:"error"};function Z6({t:e,onClick:t}){const r=e.endedAt==null?"inflight":e.ok===!1?"err":"done",s=Dj(e,"…");return m.jsxs("button",{className:"tool clickable",title:e.inputPreview||e.name,onClick:t,children:[m.jsxs("span",{className:"name",children:[m.jsx("span",{className:`status-dot ${r}`,"aria-hidden":!0}),m.jsx("span",{className:"vis-hidden",children:Q6[r]}),e.name]}),m.jsx("span",{style:{color:"var(--muted)"},children:s})]})}try{Y3(window.localStorage)}catch{}const J6=bA.createRoot(document.getElementById("root"));J6.render(m.jsx(W6,{}));
|